From da36abd06c6eb1cf7b0ebb7315ef2fb7313a9699 Mon Sep 17 00:00:00 2001 From: Niklas Engblom Date: Sat, 16 May 2026 17:33:49 +0300 Subject: [PATCH 01/17] Fix eslint setup - Previous upgrade from v8 -> v10 caused linter to break because of unsupported configuration files --- .eslintignore | 21 ------ .eslintrc.json | 102 ------------------------- eslint.config.mjs | 184 ++++++++++++++++++++++++++++++++++++++++++++++ package-lock.json | 62 +++++++++++++++- package.json | 7 +- 5 files changed, 249 insertions(+), 127 deletions(-) delete mode 100644 .eslintignore delete mode 100644 .eslintrc.json create mode 100644 eslint.config.mjs diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 074e996605..0000000000 --- a/.eslintignore +++ /dev/null @@ -1,21 +0,0 @@ -src/phaser-esm.js -src/phaser-arcade-physics.js -src/animations/config.json -src/physics/matter-js/lib/ -src/physics/matter-js/poly-decomp/ -src/polyfills/ -src/renderer/webgl/shaders/ -src/geom/polygon/Earcut.js -src/utils/array/StableSort.js -src/utils/object/Extend.js -src/structs/RTree.js -plugins/spine/dist/ -plugins/spine/src/runtimes/ -scripts/ -webpack.* -webpack.config.js -webpack-nospector.config.js -webpack.dist.config.js -webpack.fb.config.js -webpack.fb.dist.config.js -build/ diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index c0c33cfeab..0000000000 --- a/.eslintrc.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "root": true, - "env": { - "browser": true, - "es6": true, - "commonjs": true - }, - "plugins": [ - "es5" - ], - "extends": [ - "eslint:recommended" - ], - "globals": { - "WEBGL_RENDERER": true, - "CANVAS_RENDERER": true, - "Phaser": true, - "process": true, - "ActiveXObject": true - }, - "rules": { - - "es5/no-arrow-functions": 2, - "es5/no-binary-and-octal-literals": 2, - "es5/no-block-scoping": 2, - "es5/no-classes": 2, - "es5/no-computed-properties": 2, - "es5/no-default-parameters": 2, - "es5/no-destructuring": 2, - "es5/no-for-of": 2, - "es5/no-generators": 2, - "es5/no-modules": 2, - "es5/no-object-super": 2, - "es5/no-rest-parameters": 2, - "es5/no-shorthand-properties": 2, - "es5/no-spread": 2, - "es5/no-template-literals": 2, - "es5/no-typeof-symbol": 2, - "es5/no-unicode-code-point-escape": 2, - "es5/no-unicode-regex": 2, - - "no-cond-assign": [ "error", "except-parens" ], - "no-duplicate-case": [ "error" ], - "no-unused-vars": [ "error", { "args": "none" } ], - - "accessor-pairs": "error", - "curly": "error", - "eqeqeq": [ "error", "smart" ], - "no-alert": "error", - "no-caller": "error", - "no-console": [ "error", { "allow": ["warn", "log"] } ], - "no-floating-decimal": "error", - "no-invalid-this": "error", - "no-multi-spaces": "error", - "no-multi-str": "error", - "no-new-func": "error", - "no-new-wrappers": "error", - "no-redeclare": "error", - "no-self-assign": "error", - "no-self-compare": "error", - "yoda": [ "error", "never" ], - - "array-bracket-spacing": [ "error", "always" ], - "block-spacing": [ "error", "always" ], - "brace-style": [ "error", "allman", { "allowSingleLine": true } ], - "camelcase": "error", - "comma-dangle": [ "error", "never" ], - "comma-style": [ "error", "last" ], - "computed-property-spacing": [ "error", "never" ], - "consistent-this": [ "error", "_this" ], - "eol-last": [ "error" ], - "func-call-spacing": [ "error", "never" ], - "indent": [ "error", 4, { "SwitchCase": 1 } ], - "key-spacing": [ "error", { "beforeColon": false, "afterColon": true } ], - "keyword-spacing": [ "error", { "after": true } ], - "linebreak-style": [ "off" ], - "lines-around-comment": [ "error", { "beforeBlockComment": true, "afterBlockComment": false, "beforeLineComment": true, "afterLineComment": false, "allowBlockStart": true, "allowBlockEnd": false, "allowObjectStart": true, "allowArrayStart": true }], - "new-parens": "error", - "no-constant-condition": 0, - "no-array-constructor": "error", - "no-lonely-if": "error", - "no-mixed-spaces-and-tabs": "error", - "no-plusplus": "off", - "no-prototype-builtins": "off", - "no-trailing-spaces": [ "error", { "skipBlankLines": true, "ignoreComments": true } ], - "no-underscore-dangle": "off", - "no-whitespace-before-property": "error", - "object-curly-newline": [ "error", { "multiline": true, "minProperties": 0, "consistent": true } ], - "one-var-declaration-per-line": [ "error", "initializations" ], - "quote-props": [ "error", "as-needed" ], - "quotes": [ "error", "single" ], - "semi-spacing": [ "error", { "before": false, "after": true } ], - "semi": [ "error", "always" ], - "space-before-blocks": "error", - "space-before-function-paren": "error", - "space-in-parens": [ "error", "never" ], - "space-infix-ops": [ "error", { "int32Hint": true } ], - "wrap-regex": "error", - "spaced-comment": [ "error", "always", { "block": { "balanced": true, "exceptions": ["*", "!"] }} ], - "no-irregular-whitespace": ["error", { "skipComments": true }] - } -} diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000000..88d7c00e6a --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,184 @@ +// eslint.config.mjs +import { defineConfig } from 'eslint/config'; +import js from '@eslint/js'; +import globals from 'globals'; +import es5Plugin from 'eslint-plugin-es5'; +import { fixupPluginRules } from '@eslint/compat'; + +const projectGlobals = { + WEBGL_RENDERER: 'writable', + CANVAS_RENDERER: 'writable', + Phaser: 'writable', + process: 'writable', + ActiveXObject: 'writable' +}; + +const es5Rules = { + 'es5/no-arrow-functions': 'error', + 'es5/no-binary-and-octal-literals': 'error', + 'es5/no-block-scoping': 'error', + 'es5/no-classes': 'error', + 'es5/no-computed-properties': 'error', + 'es5/no-default-parameters': 'error', + 'es5/no-destructuring': 'error', + 'es5/no-for-of': 'error', + 'es5/no-generators': 'error', + 'es5/no-modules': 'error', + 'es5/no-object-super': 'error', + 'es5/no-rest-parameters': 'error', + 'es5/no-shorthand-properties': 'error', + 'es5/no-spread': 'error', + 'es5/no-template-literals': 'error', + 'es5/no-typeof-symbol': 'error', + 'es5/no-unicode-code-point-escape': 'error', + 'es5/no-unicode-regex': 'error' +}; + +const phaserRules = { + 'no-cond-assign': [ 'error', 'except-parens' ], + 'no-duplicate-case': [ 'error' ], + 'no-unused-vars': [ 'error', { args: 'none', caughtErrors: 'none' } ], + + 'accessor-pairs': 'error', + curly: 'error', + eqeqeq: [ 'error', 'smart' ], + 'no-alert': 'error', + 'no-caller': 'error', + 'no-console': [ 'error', { allow: [ 'warn', 'log' ] } ], + 'no-floating-decimal': 'error', + 'no-invalid-this': 'error', + 'no-multi-spaces': 'error', + 'no-multi-str': 'error', + 'no-new-func': 'error', + 'no-new-wrappers': 'error', + 'no-redeclare': 'error', + 'no-self-assign': 'error', + 'no-self-compare': 'error', + yoda: [ 'error', 'never' ], + + 'array-bracket-spacing': [ 'error', 'always' ], + 'block-spacing': [ 'error', 'always' ], + 'brace-style': [ 'error', 'allman', { allowSingleLine: true } ], + camelcase: 'error', + 'comma-dangle': [ 'error', 'never' ], + 'comma-style': [ 'error', 'last' ], + 'computed-property-spacing': [ 'error', 'never' ], + 'consistent-this': [ 'error', '_this' ], + 'eol-last': [ 'error' ], + 'func-call-spacing': [ 'error', 'never' ], + indent: [ 'error', 4, { SwitchCase: 1 } ], + 'key-spacing': [ 'error', { beforeColon: false, afterColon: true } ], + 'keyword-spacing': [ 'error', { after: true } ], + 'linebreak-style': [ 'off' ], + 'lines-around-comment': [ + 'error', + { + beforeBlockComment: true, + afterBlockComment: false, + beforeLineComment: true, + afterLineComment: false, + allowBlockStart: true, + allowBlockEnd: false, + allowObjectStart: true, + allowArrayStart: true + } + ], + 'new-parens': 'error', + 'no-constant-condition': 'off', + 'no-array-constructor': 'error', + 'no-lonely-if': 'error', + 'no-mixed-spaces-and-tabs': 'error', + 'no-plusplus': 'off', + 'no-prototype-builtins': 'off', + 'no-trailing-spaces': [ + 'error', + { + skipBlankLines: true, + ignoreComments: true + } + ], + 'no-underscore-dangle': 'off', + 'no-whitespace-before-property': 'error', + 'object-curly-newline': [ + 'error', + { + multiline: true, + minProperties: 0, + consistent: true + } + ], + 'one-var-declaration-per-line': [ 'error', 'initializations' ], + 'quote-props': [ 'error', 'as-needed' ], + quotes: [ 'error', 'single' ], + 'semi-spacing': [ 'error', { before: false, after: true } ], + semi: [ 'error', 'always' ], + 'space-before-blocks': 'error', + 'space-before-function-paren': 'error', + 'space-in-parens': [ 'error', 'never' ], + 'space-infix-ops': [ 'error', { int32Hint: true } ], + 'wrap-regex': 'error', + 'spaced-comment': [ + 'error', + 'always', + { + block: { + balanced: true, + exceptions: [ '*', '!' ] + } + } + ], + 'no-irregular-whitespace': [ 'error', { skipComments: true } ], + 'no-extra-semi': 'error', + 'no-useless-assignment': 'off', + 'no-constant-binary-expression': 'off' +}; + +export default defineConfig([ + { + ignores: [ + 'node_modules/**', + 'dist/**', + 'build/**', + 'coverage/**', + 'src/phaser-esm.js', + 'src/phaser-arcade-physics.js', + 'src/physics/matter-js/lib/**', + 'src/physics/matter-js/poly-decomp/**', + 'src/polyfills/**', + 'src/renderer/webgl/shaders/**', + 'src/geom/polygon/Earcut.js', + 'src/utils/array/StableSort.js', + 'src/utils/object/Extend.js', + 'src/structs/RTree.js', + 'plugins/spine/dist/**', + 'plugins/spine/src/runtimes/**', + 'scripts/**' + ] + }, + + js.configs.recommended, + + { + files: [ '**/*.js' ], + + languageOptions: { + ecmaVersion: 6, + sourceType: 'commonjs', + globals: { + ...globals.browser, + ...globals.es2015, + ...globals.commonjs, + ...projectGlobals + } + }, + + plugins: { + es5: fixupPluginRules(es5Plugin) + }, + + rules: { + ...es5Rules, + ...phaserRules + } + } +]); diff --git a/package-lock.json b/package-lock.json index 02280c70b9..5864a00aa7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,17 +1,19 @@ { "name": "phaser", - "version": "4.0.0", + "version": "4.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "phaser", - "version": "4.0.0", + "version": "4.1.0", "license": "MIT", "dependencies": { "eventemitter3": "^5.0.4" }, "devDependencies": { + "@eslint/compat": "2.1.0", + "@eslint/js": "10.0.1", "@types/offscreencanvas": "^2019.7.3", "@types/source-map": "^0.5.7", "clean-webpack-plugin": "^4.0.0", @@ -20,6 +22,7 @@ "eslint-plugin-es5": "^1.5.0", "exports-loader": "^5.0.0", "fs-extra": "^11.3.4", + "globals": "17.6.0", "imports-loader": "^5.0.0", "jsdoc": "3.x.x", "jsdom": "^29.0.2", @@ -365,6 +368,27 @@ "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, + "node_modules/@eslint/compat": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@eslint/compat/-/compat-2.1.0.tgz", + "integrity": "sha512-LgaSCymEpw7tF53xvDw9SNsraPb1IBHxpdABIOM0hW8UAlP8znrjYtuxfR58FSJ3L9BhwD+FaPRFQpZq84Nh6g==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^1.2.1" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "peerDependencies": { + "eslint": "^8.40 || 9 || 10" + }, + "peerDependenciesMeta": { + "eslint": { + "optional": true + } + } + }, "node_modules/@eslint/config-array": { "version": "0.23.5", "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.23.5.tgz", @@ -406,6 +430,27 @@ "node": "^20.19.0 || ^22.13.0 || >=24" } }, + "node_modules/@eslint/js": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-10.0.1.tgz", + "integrity": "sha512-zeR9k5pd4gxjZ0abRoIaxdc7I3nDktoXZk2qOv9gCNWx3mVwEn32VRhyLaRsDiJjTs0xq/T8mfPtyuXu7GWBcA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "eslint": "^10.0.0" + }, + "peerDependenciesMeta": { + "eslint": { + "optional": true + } + } + }, "node_modules/@eslint/object-schema": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-3.0.5.tgz", @@ -2456,6 +2501,19 @@ "node": "*" } }, + "node_modules/globals": { + "version": "17.6.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-17.6.0.tgz", + "integrity": "sha512-sepffkT8stwnIYbsMBpoCHJuJM5l98FUF2AnE07hfvE0m/qp3R586hw4jF4uadbhvg1ooIdzuu7CsfD2jzCaNA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/globby": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", diff --git a/package.json b/package.json index 4d9e0a7c02..9f932409c1 100644 --- a/package.json +++ b/package.json @@ -32,8 +32,8 @@ "watch": "webpack --watch --config config/webpack.config.js", "watchns": "webpack --watch --config config/webpack-nospector.config.js", "dist": "webpack --config config/webpack.dist.config.js", - "lint": "eslint --config .eslintrc.json \"src/**/*.js\"", - "lintfix": "eslint --config .eslintrc.json \"src/**/*.js\" --fix", + "lint": "eslint \"src/**/*.js\"", + "lintfix": "npm run lint -- --fix", "sloc": "node-sloc \"./src\" --include-extensions \"js\"", "bundleshaders": "node scripts/bundle-shaders.js", "build-tsgen": "cd scripts/tsgen && tsc", @@ -57,6 +57,8 @@ "web audio" ], "devDependencies": { + "@eslint/compat": "2.1.0", + "@eslint/js": "10.0.1", "@types/offscreencanvas": "^2019.7.3", "@types/source-map": "^0.5.7", "clean-webpack-plugin": "^4.0.0", @@ -65,6 +67,7 @@ "eslint-plugin-es5": "^1.5.0", "exports-loader": "^5.0.0", "fs-extra": "^11.3.4", + "globals": "17.6.0", "imports-loader": "^5.0.0", "jsdoc": "3.x.x", "jsdom": "^29.0.2", From b9639bc14d7992e31148703127c2c6d0e06a513b Mon Sep 17 00:00:00 2001 From: Niklas Engblom Date: Thu, 14 May 2026 07:34:22 +0300 Subject: [PATCH 02/17] Add TypeScript tooling and build support --- .gitignore | 2 + config/webpack-nospector.config.js | 19 + config/webpack.config.js | 19 + config/webpack.dist.config.js | 38 + eslint.config.mjs | 50 +- package-lock.json | 1256 +++++++++++++++++++++++----- package.json | 9 +- tsconfig.json | 22 + vitest.config.js | 2 +- 9 files changed, 1220 insertions(+), 197 deletions(-) create mode 100644 tsconfig.json diff --git a/.gitignore b/.gitignore index 7c821167e4..eea0f6f7f8 100644 --- a/.gitignore +++ b/.gitignore @@ -18,5 +18,7 @@ test-fix-logs/ build/ out/ types/phaser.json +types/generated/ scripts/tsgen/test/bin/ scripts/tsgen/test/output.txt +tsconfig.tsbuildinfo diff --git a/config/webpack-nospector.config.js b/config/webpack-nospector.config.js index ce13e19638..770973c435 100644 --- a/config/webpack-nospector.config.js +++ b/config/webpack-nospector.config.js @@ -16,6 +16,25 @@ module.exports = [ devtool: 'source-map', + resolve: { + extensions: ['.js', '.ts'], + extensionAlias: { + '.js': ['.ts', '.js'] + } + }, + + module: { + rules: [ + { + test: /\.ts$/, + loader: 'esbuild-loader', + options: { + target: 'es2018' + } + } + ] + }, + output: { path: `${__dirname}/../build/`, globalObject: 'this', diff --git a/config/webpack.config.js b/config/webpack.config.js index 38018a9a40..b55f6b8599 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -16,6 +16,25 @@ module.exports = [ devtool: 'source-map', + resolve: { + extensions: ['.js', '.ts'], + extensionAlias: { + '.js': ['.ts', '.js'] + } + }, + + module: { + rules: [ + { + test: /\.ts$/, + loader: 'esbuild-loader', + options: { + target: 'es2018' + } + } + ] + }, + output: { path: `${__dirname}/../build/`, globalObject: 'this', diff --git a/config/webpack.dist.config.js b/config/webpack.dist.config.js index 23ffbc2648..6758c35cc0 100644 --- a/config/webpack.dist.config.js +++ b/config/webpack.dist.config.js @@ -18,6 +18,25 @@ module.exports = [ 'phaser-arcade-physics.min': './phaser-arcade-physics.js' }, + resolve: { + extensions: ['.js', '.ts'], + extensionAlias: { + '.js': ['.ts', '.js'] + } + }, + + module: { + rules: [ + { + test: /\.ts$/, + loader: 'esbuild-loader', + options: { + target: 'es2018' + } + } + ] + }, + output: { path: `${__dirname}/../dist/`, filename: '[name].js', @@ -77,6 +96,25 @@ module.exports = [ 'phaser.esm.min': './phaser-esm.js' }, + resolve: { + extensions: ['.js', '.ts'], + extensionAlias: { + '.js': ['.ts', '.js'] + } + }, + + module: { + rules: [ + { + test: /\.ts$/, + loader: 'esbuild-loader', + options: { + target: 'es2018' + } + } + ] + }, + output: { path: `${__dirname}/../dist/`, filename: '[name].js', diff --git a/eslint.config.mjs b/eslint.config.mjs index 88d7c00e6a..d266b0728d 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -3,6 +3,7 @@ import { defineConfig } from 'eslint/config'; import js from '@eslint/js'; import globals from 'globals'; import es5Plugin from 'eslint-plugin-es5'; +import tseslint from 'typescript-eslint'; import { fixupPluginRules } from '@eslint/compat'; const projectGlobals = { @@ -133,6 +134,27 @@ const phaserRules = { 'no-constant-binary-expression': 'off' }; +const tsRules = { + "es5/no-arrow-functions": "off", + "es5/no-block-scoping": "off", + "es5/no-classes": "off", + "es5/no-computed-properties": "off", + "es5/no-default-parameters": "off", + "es5/no-destructuring": "off", + "es5/no-for-of": "off", + "es5/no-generators": "off", + "es5/no-modules": "off", + "es5/no-object-super": "off", + "es5/no-rest-parameters": "off", + "es5/no-shorthand-properties": "off", + "es5/no-spread": "off", + "es5/no-template-literals": "off", + "es5/no-typeof-symbol": "off", + "es5/no-unicode-code-point-escape": "off", + "es5/no-unicode-regex": "off", + "es5/no-binary-and-octal-literals": "off", +}; + export default defineConfig([ { ignores: [ @@ -156,11 +178,34 @@ export default defineConfig([ ] }, - js.configs.recommended, + { + files: ["**/*.ts"], + extends: [ + tseslint.configs.recommended, + ], + languageOptions: { + ecmaVersion: 6, + parserOptions: { + sourceType: 'module' + }, + globals: { + ...globals.browser, + ...globals.es2015, + ...globals.commonjs, + ...projectGlobals + } + }, + rules: { + ...phaserRules, + ...tsRules, + } + }, { files: [ '**/*.js' ], - + extends: [ + js.configs.recommended + ], languageOptions: { ecmaVersion: 6, sourceType: 'commonjs', @@ -178,6 +223,7 @@ export default defineConfig([ rules: { ...es5Rules, + ...tsRules, ...phaserRules } } diff --git a/package-lock.json b/package-lock.json index 5864a00aa7..dc1a302b8b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,6 +18,7 @@ "@types/source-map": "^0.5.7", "clean-webpack-plugin": "^4.0.0", "dts-dom": "^3.7.0", + "esbuild-loader": "4.4.3", "eslint": "^10.2.0", "eslint-plugin-es5": "^1.5.0", "exports-loader": "^5.0.0", @@ -33,6 +34,7 @@ "source-map": "^0.7.6", "terser-webpack-plugin": "^5.4.0", "typescript": "^6.0.2", + "typescript-eslint": "8.59.3", "vitest": "^4.1.4", "vivid-cli": "^1.1.2", "webpack": "^5.106.0", @@ -283,9 +285,9 @@ } }, "node_modules/@discoveryjs/json-ext": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-1.0.0.tgz", - "integrity": "sha512-dDlz3W405VMFO4w5kIP9DOmELBcvFQGmLoKSdIRstBDubKFYwaNHV1NnlzMCQpXQFGWVALmeMORAuiLx18AvZQ==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-1.1.0.tgz", + "integrity": "sha512-Xc3VhU02wqZ1HvHRJUwL09HkZSTvidqY5Ya0NXBSYOxAp+Ln9dcJr9fySI+CkONzP3PekQo9WdzCv0PGER/mOA==", "dev": true, "license": "MIT", "engines": { @@ -293,9 +295,9 @@ } }, "node_modules/@emnapi/core": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.9.2.tgz", - "integrity": "sha512-UC+ZhH3XtczQYfOlu3lNEkdW/p4dsJ1r/bP7H8+rhao3TTTMO1ATq/4DdIi23XuGoFY+Cz0JmCbdVl0hz9jZcA==", + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.10.0.tgz", + "integrity": "sha512-yq6OkJ4p82CAfPl0u9mQebQHKPJkY7WrIuk205cTYnYe+k2Z8YBh11FrbRG/H6ihirqcacOgl2BIO8oyMQLeXw==", "dev": true, "license": "MIT", "optional": true, @@ -305,9 +307,9 @@ } }, "node_modules/@emnapi/runtime": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.9.2.tgz", - "integrity": "sha512-3U4+MIWHImeyu1wnmVygh5WlgfYDtyf0k8AbLhMFxOipihf6nrWC4syIm/SwEeec0mNSafiiNnMJwbza/Is6Lw==", + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.10.0.tgz", + "integrity": "sha512-ewvYlk86xUoGI0zQRNq/mC+16R1QeDlKQy21Ki3oSYXNgLb45GV1P6A0M+/s6nyCuNDqe5VpaY84BzXGwVbwFA==", "dev": true, "license": "MIT", "optional": true, @@ -326,6 +328,448 @@ "tslib": "^2.4.0" } }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.7.tgz", + "integrity": "sha512-EKX3Qwmhz1eMdEJokhALr0YiD0lhQNwDqkPYyPhiSwKrh7/4KRjQc04sZ8db+5DVVnZ1LmbNDI1uAMPEUBnQPg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.7.tgz", + "integrity": "sha512-jbPXvB4Yj2yBV7HUfE2KHe4GJX51QplCN1pGbYjvsyCZbQmies29EoJbkEc+vYuU5o45AfQn37vZlyXy4YJ8RQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.7.tgz", + "integrity": "sha512-62dPZHpIXzvChfvfLJow3q5dDtiNMkwiRzPylSCfriLvZeq0a1bWChrGx/BbUbPwOrsWKMn8idSllklzBy+dgQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.7.tgz", + "integrity": "sha512-x5VpMODneVDb70PYV2VQOmIUUiBtY3D3mPBG8NxVk5CogneYhkR7MmM3yR/uMdITLrC1ml/NV1rj4bMJuy9MCg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.7.tgz", + "integrity": "sha512-5lckdqeuBPlKUwvoCXIgI2D9/ABmPq3Rdp7IfL70393YgaASt7tbju3Ac+ePVi3KDH6N2RqePfHnXkaDtY9fkw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.7.tgz", + "integrity": "sha512-rYnXrKcXuT7Z+WL5K980jVFdvVKhCHhUwid+dDYQpH+qu+TefcomiMAJpIiC2EM3Rjtq0sO3StMV/+3w3MyyqQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.7.tgz", + "integrity": "sha512-B48PqeCsEgOtzME2GbNM2roU29AMTuOIN91dsMO30t+Ydis3z/3Ngoj5hhnsOSSwNzS+6JppqWsuhTp6E82l2w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.7.tgz", + "integrity": "sha512-jOBDK5XEjA4m5IJK3bpAQF9/Lelu/Z9ZcdhTRLf4cajlB+8VEhFFRjWgfy3M1O4rO2GQ/b2dLwCUGpiF/eATNQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.7.tgz", + "integrity": "sha512-RkT/YXYBTSULo3+af8Ib0ykH8u2MBh57o7q/DAs3lTJlyVQkgQvlrPTnjIzzRPQyavxtPtfg0EopvDyIt0j1rA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.7.tgz", + "integrity": "sha512-RZPHBoxXuNnPQO9rvjh5jdkRmVizktkT7TCDkDmQ0W2SwHInKCAV95GRuvdSvA7w4VMwfCjUiPwDi0ZO6Nfe9A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.7.tgz", + "integrity": "sha512-GA48aKNkyQDbd3KtkplYWT102C5sn/EZTY4XROkxONgruHPU72l+gW+FfF8tf2cFjeHaRbWpOYa/uRBz/Xq1Pg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.7.tgz", + "integrity": "sha512-a4POruNM2oWsD4WKvBSEKGIiWQF8fZOAsycHOt6JBpZ+JN2n2JH9WAv56SOyu9X5IqAjqSIPTaJkqN8F7XOQ5Q==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.7.tgz", + "integrity": "sha512-KabT5I6StirGfIz0FMgl1I+R1H73Gp0ofL9A3nG3i/cYFJzKHhouBV5VWK1CSgKvVaG4q1RNpCTR2LuTVB3fIw==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.7.tgz", + "integrity": "sha512-gRsL4x6wsGHGRqhtI+ifpN/vpOFTQtnbsupUF5R5YTAg+y/lKelYR1hXbnBdzDjGbMYjVJLJTd2OFmMewAgwlQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.7.tgz", + "integrity": "sha512-hL25LbxO1QOngGzu2U5xeXtxXcW+/GvMN3ejANqXkxZ/opySAZMrc+9LY/WyjAan41unrR3YrmtTsUpwT66InQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.7.tgz", + "integrity": "sha512-2k8go8Ycu1Kb46vEelhu1vqEP+UeRVj2zY1pSuPdgvbd5ykAw82Lrro28vXUrRmzEsUV0NzCf54yARIK8r0fdw==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.7.tgz", + "integrity": "sha512-hzznmADPt+OmsYzw1EE33ccA+HPdIqiCRq7cQeL1Jlq2gb1+OyWBkMCrYGBJ+sxVzve2ZJEVeePbLM2iEIZSxA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.7.tgz", + "integrity": "sha512-b6pqtrQdigZBwZxAn1UpazEisvwaIDvdbMbmrly7cDTMFnw/+3lVxxCTGOrkPVnsYIosJJXAsILG9XcQS+Yu6w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.7.tgz", + "integrity": "sha512-OfatkLojr6U+WN5EDYuoQhtM+1xco+/6FSzJJnuWiUw5eVcicbyK3dq5EeV/QHT1uy6GoDhGbFpprUiHUYggrw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.7.tgz", + "integrity": "sha512-AFuojMQTxAz75Fo8idVcqoQWEHIXFRbOc1TrVcFSgCZtQfSdc1RXgB3tjOn/krRHENUB4j00bfGjyl2mJrU37A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.7.tgz", + "integrity": "sha512-+A1NJmfM8WNDv5CLVQYJ5PshuRm/4cI6WMZRg1by1GwPIQPCTs1GLEUHwiiQGT5zDdyLiRM/l1G0Pv54gvtKIg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.7.tgz", + "integrity": "sha512-+KrvYb/C8zA9CU/g0sR6w2RBw7IGc5J2BPnc3dYc5VJxHCSF1yNMxTV5LQ7GuKteQXZtspjFbiuW5/dOj7H4Yw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.7.tgz", + "integrity": "sha512-ikktIhFBzQNt/QDyOL580ti9+5mL/YZeUPKU2ivGtGjdTYoqz6jObj6nOMfhASpS4GU4Q/Clh1QtxWAvcYKamA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.7.tgz", + "integrity": "sha512-7yRhbHvPqSpRUV7Q20VuDwbjW5kIMwTHpptuUzV+AA46kiPze5Z7qgt6CLCK3pWFrHeNfDd1VKgyP4O+ng17CA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.7.tgz", + "integrity": "sha512-SmwKXe6VHIyZYbBLJrhOoCJRB/Z1tckzmgTLfFYOfpMAx63BJEaL9ExI8x7v0oAO3Zh6D/Oi1gVxEYr5oUCFhw==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.7.tgz", + "integrity": "sha512-56hiAJPhwQ1R4i+21FVF7V8kSD5zZTdHcVuRFMW0hn753vVfQN8xlx4uOPT4xoGH0Z/oVATuR82AiqSTDIpaHg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, "node_modules/@eslint-community/eslint-utils": { "version": "4.9.1", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz", @@ -596,9 +1040,9 @@ } }, "node_modules/@napi-rs/wasm-runtime": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.3.tgz", - "integrity": "sha512-xK9sGVbJWYb08+mTJt3/YV24WxvxpXcXtP6B172paPZ+Ts69Re9dAr7lKwJoeIx8OoeuimEiRZ7umkiUVClmmQ==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.4.tgz", + "integrity": "sha512-3NQNNgA1YSlJb/kMH1ildASP9HW7/7kYnRI2szWJaofaS1hWmbGI4H+d3+22aGzXXN9IJ+n+GiFVcGipJP18ow==", "dev": true, "license": "MIT", "optional": true, @@ -615,9 +1059,9 @@ } }, "node_modules/@oxc-project/types": { - "version": "0.124.0", - "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.124.0.tgz", - "integrity": "sha512-VBFWMTBvHxS11Z5Lvlr3IWgrwhMTXV+Md+EQF0Xf60+wAdsGFTBx7X7K/hP4pi8N7dcm1RvcHwDxZ16Qx8keUg==", + "version": "0.129.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.129.0.tgz", + "integrity": "sha512-3oz8m3FGdr2nDXVqmFUw7jolKliC4MoyXYIG2c7gpjBnzUWQpUGIYcXYKxTdTi+N2jusvt610ckTMkxdwHkYEg==", "dev": true, "license": "MIT", "funding": { @@ -625,9 +1069,9 @@ } }, "node_modules/@rolldown/binding-android-arm64": { - "version": "1.0.0-rc.15", - "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.0.0-rc.15.tgz", - "integrity": "sha512-YYe6aWruPZDtHNpwu7+qAHEMbQ/yRl6atqb/AhznLTnD3UY99Q1jE7ihLSahNWkF4EqRPVC4SiR4O0UkLK02tA==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.0.0.tgz", + "integrity": "sha512-TWMZnRLMe63C2Lhyicviu7ZHaU4kxa6PS3rofvc9GmcvptzNN11BcfQ4Sl7MwTOsisQoa2keB/EBdNCAnUo8vA==", "cpu": [ "arm64" ], @@ -642,9 +1086,9 @@ } }, "node_modules/@rolldown/binding-darwin-arm64": { - "version": "1.0.0-rc.15", - "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.0.0-rc.15.tgz", - "integrity": "sha512-oArR/ig8wNTPYsXL+Mzhs0oxhxfuHRfG7Ikw7jXsw8mYOtk71W0OkF2VEVh699pdmzjPQsTjlD1JIOoHkLP1Fg==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.0.0.tgz", + "integrity": "sha512-6XcD+8k0gPVItNagEw78/qqcBDwKcwDYS8V2hRmVsfUSIrd8cWe/CBvRDI5toqFyPfj+FJr6t8U6Xj2P2prEew==", "cpu": [ "arm64" ], @@ -659,9 +1103,9 @@ } }, "node_modules/@rolldown/binding-darwin-x64": { - "version": "1.0.0-rc.15", - "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.0.0-rc.15.tgz", - "integrity": "sha512-YzeVqOqjPYvUbJSWJ4EDL8ahbmsIXQpgL3JVipmN+MX0XnXMeWomLN3Fb+nwCmP/jfyqte5I3XRSm7OfQrbyxw==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.0.0.tgz", + "integrity": "sha512-iN/tWVXRQDWvmZlKdceP1Dwug9GDpEymhb9p4xnEe6zvCg5lFmzVljl+1qR1NVx3yfGpr2Na+CuLmv5IU8uzfQ==", "cpu": [ "x64" ], @@ -676,9 +1120,9 @@ } }, "node_modules/@rolldown/binding-freebsd-x64": { - "version": "1.0.0-rc.15", - "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.0.0-rc.15.tgz", - "integrity": "sha512-9Erhx956jeQ0nNTyif1+QWAXDRD38ZNjr//bSHrt6wDwB+QkAfl2q6Mn1k6OBPerznjRmbM10lgRb1Pli4xZPw==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.0.0.tgz", + "integrity": "sha512-jjQMDvvwSOuhOwMszD/klSOjyWMM3zI64hWTj9KT5x4MxRbZAf+7vLQ6qouRhtsLVFHr3f0ILaJAfgENPiQdAQ==", "cpu": [ "x64" ], @@ -693,9 +1137,9 @@ } }, "node_modules/@rolldown/binding-linux-arm-gnueabihf": { - "version": "1.0.0-rc.15", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.0.0-rc.15.tgz", - "integrity": "sha512-cVwk0w8QbZJGTnP/AHQBs5yNwmpgGYStL88t4UIaqcvYJWBfS0s3oqVLZPwsPU6M0zlW4GqjP0Zq5MnAGwFeGA==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.0.0.tgz", + "integrity": "sha512-d//Dtg2x6/m3mbV64yUGNnDGNZaDGRpDLLNGerHQUVObuNaIQaaDp25yUiqGXtHEXX+NP2d0wAlmKgpYgIAJ2A==", "cpu": [ "arm" ], @@ -710,9 +1154,9 @@ } }, "node_modules/@rolldown/binding-linux-arm64-gnu": { - "version": "1.0.0-rc.15", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.0.0-rc.15.tgz", - "integrity": "sha512-eBZ/u8iAK9SoHGanqe/jrPnY0JvBN6iXbVOsbO38mbz+ZJsaobExAm1Iu+rxa4S1l2FjG0qEZn4Rc6X8n+9M+w==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.0.0.tgz", + "integrity": "sha512-n7Ofp0mx+aB2cC+Sdy5YtMnXtY9lchnHbY+3Yt0uq9JsWQExf4f5Whu0tK0R8Jdc9S6RchTHjIFY7uc92puOVQ==", "cpu": [ "arm64" ], @@ -727,9 +1171,9 @@ } }, "node_modules/@rolldown/binding-linux-arm64-musl": { - "version": "1.0.0-rc.15", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.0.0-rc.15.tgz", - "integrity": "sha512-ZvRYMGrAklV9PEkgt4LQM6MjQX2P58HPAuecwYObY2DhS2t35R0I810bKi0wmaYORt6m/2Sm+Z+nFgb0WhXNcQ==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.0.0.tgz", + "integrity": "sha512-EIVjy2cgd7uuMMo94FVkBp7F6DhcZAUwNURkSG3RwUmvAXR6s0ISxM81U+IydcZByPG0pZIHsf1b6kTxoFDgJA==", "cpu": [ "arm64" ], @@ -744,9 +1188,9 @@ } }, "node_modules/@rolldown/binding-linux-ppc64-gnu": { - "version": "1.0.0-rc.15", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.0.0-rc.15.tgz", - "integrity": "sha512-VDpgGBzgfg5hLg+uBpCLoFG5kVvEyafmfxGUV0UHLcL5irxAK7PKNeC2MwClgk6ZAiNhmo9FLhRYgvMmedLtnQ==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.0.0.tgz", + "integrity": "sha512-JEwwOPcwTLAcpDQlqSmjEmfs63xJnSiUNIGvLcDLUHCWK4XowpS/7c7tUsUH6uT/ct6bMUTdXKfI8967FYj6mg==", "cpu": [ "ppc64" ], @@ -761,9 +1205,9 @@ } }, "node_modules/@rolldown/binding-linux-s390x-gnu": { - "version": "1.0.0-rc.15", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.0.0-rc.15.tgz", - "integrity": "sha512-y1uXY3qQWCzcPgRJATPSOUP4tCemh4uBdY7e3EZbVwCJTY3gLJWnQABgeUetvED+bt1FQ01OeZwvhLS2bpNrAQ==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.0.0.tgz", + "integrity": "sha512-0wjCFhLrihtAubnT9iA0N++0pSV0z5Hg7tNGdNJ4RFaINceHadoF+kiFGyY1qSSNVIAZtLotG8Ju1bgDPkjnFA==", "cpu": [ "s390x" ], @@ -778,9 +1222,9 @@ } }, "node_modules/@rolldown/binding-linux-x64-gnu": { - "version": "1.0.0-rc.15", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.0.0-rc.15.tgz", - "integrity": "sha512-023bTPBod7J3Y/4fzAN6QtpkSABR0rigtrwaP+qSEabUh5zf6ELr9Nc7GujaROuPY3uwdSIXWrvhn1KxOvurWA==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.0.0.tgz", + "integrity": "sha512-Dfn7iak9BcMMePxcoJfpSbWqnEyrp/dRF63/8qW/eHBdOZov6x5aShLLEYGYdIeSJ6vMLK/XCVB+lGIxm41bQA==", "cpu": [ "x64" ], @@ -795,9 +1239,9 @@ } }, "node_modules/@rolldown/binding-linux-x64-musl": { - "version": "1.0.0-rc.15", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.0.0-rc.15.tgz", - "integrity": "sha512-witB2O0/hU4CgfOOKUoeFgQ4GktPi1eEbAhaLAIpgD6+ZnhcPkUtPsoKKHRzmOoWPZue46IThdSgdo4XneOLYw==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.0.0.tgz", + "integrity": "sha512-5/utzzDmD/pD/bmuaUcbTf/sZYy0aztwIVlfpoW1fTjCZ0BaPOMVWGZL1zvgxyi7ZIVYWlxKONHmSbHuiOh8Jw==", "cpu": [ "x64" ], @@ -812,9 +1256,9 @@ } }, "node_modules/@rolldown/binding-openharmony-arm64": { - "version": "1.0.0-rc.15", - "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.0.0-rc.15.tgz", - "integrity": "sha512-UCL68NJ0Ud5zRipXZE9dF5PmirzJE4E4BCIOOssEnM7wLDsxjc6Qb0sGDxTNRTP53I6MZpygyCpY8Aa8sPfKPg==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.0.0.tgz", + "integrity": "sha512-ouJs8VcUomfLfpbUECqFMRqdV4x6aeAK3MA4m6vTrJJjKyWTV5KnxZx7Jd9G+GlDaQQxubcba00x16OyJ1meig==", "cpu": [ "arm64" ], @@ -829,9 +1273,9 @@ } }, "node_modules/@rolldown/binding-wasm32-wasi": { - "version": "1.0.0-rc.15", - "resolved": "https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.0.0-rc.15.tgz", - "integrity": "sha512-ApLruZq/ig+nhaE7OJm4lDjayUnOHVUa77zGeqnqZ9pn0ovdVbbNPerVibLXDmWeUZXjIYIT8V3xkT58Rm9u5Q==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.0.0.tgz", + "integrity": "sha512-E+oHKGiDA+lsKMmFtffDDw91EryDT7uJocrIuCHqhm6bCTM6xFK+3gaCkYOHfPwQr0cCNarSM2xaELoQDz9jJg==", "cpu": [ "wasm32" ], @@ -839,18 +1283,18 @@ "license": "MIT", "optional": true, "dependencies": { - "@emnapi/core": "1.9.2", - "@emnapi/runtime": "1.9.2", - "@napi-rs/wasm-runtime": "^1.1.3" + "@emnapi/core": "1.10.0", + "@emnapi/runtime": "1.10.0", + "@napi-rs/wasm-runtime": "^1.1.4" }, "engines": { - "node": ">=14.0.0" + "node": "^20.19.0 || >=22.12.0" } }, "node_modules/@rolldown/binding-win32-arm64-msvc": { - "version": "1.0.0-rc.15", - "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.0.0-rc.15.tgz", - "integrity": "sha512-KmoUoU7HnN+Si5YWJigfTws1jz1bKBYDQKdbLspz0UaqjjFkddHsqorgiW1mxcAj88lYUE6NC/zJNwT+SloqtA==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.0.0.tgz", + "integrity": "sha512-yYK02n8Rngo+gbm1y6G0+7jk1sJ/2Wt7K0me0Y7k/ErBpyf+LJ2gFpqWVTcRV1rUepBlQRmpgWkTQCiiwrK0Ow==", "cpu": [ "arm64" ], @@ -865,9 +1309,9 @@ } }, "node_modules/@rolldown/binding-win32-x64-msvc": { - "version": "1.0.0-rc.15", - "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.0.0-rc.15.tgz", - "integrity": "sha512-3P2A8L+x75qavWLe/Dll3EYBJLQmtkJN8rfh+U/eR3MqMgL/h98PhYI+JFfXuDPgPeCB7iZAKiqii5vqOvnA0g==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.0.0.tgz", + "integrity": "sha512-14bpChMahXRRXiTwahSl+zzHPW6qQTXtkMuJBFlbo+pqSAews2d4BdCSHfrJ/MBsCZtpmTafsY+1QhBzitcmdg==", "cpu": [ "x64" ], @@ -882,9 +1326,9 @@ } }, "node_modules/@rolldown/pluginutils": { - "version": "1.0.0-rc.15", - "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-rc.15.tgz", - "integrity": "sha512-UromN0peaE53IaBRe9W7CjrZgXl90fqGpK+mIZbA3qSTeYqg3pqpROBdIPvOG3F5ereDHNwoHBI2e50n1BDr1g==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0.tgz", + "integrity": "sha512-aKs/3GSWyV0mrhNmt/96/Z3yczC3yvrzYATCiCXQebBsGyYzjNdUphRVLeJQ67ySKVXRfMxt2lm12pmXvbPFQQ==", "dev": true, "license": "MIT" }, @@ -919,9 +1363,9 @@ } }, "node_modules/@tybys/wasm-util": { - "version": "0.10.1", - "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.1.tgz", - "integrity": "sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==", + "version": "0.10.2", + "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.2.tgz", + "integrity": "sha512-RoBvJ2X0wuKlWFIjrwffGw1IqZHKQqzIchKaadZZfnNpsAYp2mM0h36JtPCjNDAHGgYez/15uMBpfGwchhiMgg==", "dev": true, "license": "MIT", "optional": true, @@ -1034,13 +1478,13 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "25.6.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-25.6.0.tgz", - "integrity": "sha512-+qIYRKdNYJwY3vRCZMdJbPLJAtGjQBudzZzdzwQYkEPQd+PJGixUL5QfvCLDaULoLv+RhT3LDkwEfKaAkgSmNQ==", + "version": "25.7.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-25.7.0.tgz", + "integrity": "sha512-z+pdZyxE+RTQE9AcboAZCb4otwcrvgHD+GlBpPgn0emDVt0ohrTMhAwlr2Wd9nZ+nihhYFxO2pThz3C5qSu2Eg==", "dev": true, "license": "MIT", "dependencies": { - "undici-types": "~7.19.0" + "undici-types": "~7.21.0" } }, "node_modules/@types/offscreencanvas": { @@ -1073,6 +1517,249 @@ "webpack": "^5" } }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.59.3.tgz", + "integrity": "sha512-PwFvSKsXGShKGW6n5bZOhGHEcCZXM8HofLK9fNsEwZXzFRjoY+XT1Vsf1zgyXdwTr0ZYz1/2tkZ0DBTT9jZjhw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/regexpp": "^4.12.2", + "@typescript-eslint/scope-manager": "8.59.3", + "@typescript-eslint/type-utils": "8.59.3", + "@typescript-eslint/utils": "8.59.3", + "@typescript-eslint/visitor-keys": "8.59.3", + "ignore": "^7.0.5", + "natural-compare": "^1.4.0", + "ts-api-utils": "^2.5.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^8.59.3", + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz", + "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.59.3.tgz", + "integrity": "sha512-HPwA+hVkfcriajbNvTmZv4VRauibay+cWArYUYq7u7W7PmGShMxbPxLvrwDme55a6d5alG3nrYfhyJ/G28XlLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/scope-manager": "8.59.3", + "@typescript-eslint/types": "8.59.3", + "@typescript-eslint/typescript-estree": "8.59.3", + "@typescript-eslint/visitor-keys": "8.59.3", + "debug": "^4.4.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/project-service": { + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.59.3.tgz", + "integrity": "sha512-ECiUWa/KYRGDFUqTNehaRgzDshnJfkTABJxVemHk4ko22gcr0ukloKjWvyQ64g8YCV/UI47kN1dbmjf/GaQYng==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/tsconfig-utils": "^8.59.3", + "@typescript-eslint/types": "^8.59.3", + "debug": "^4.4.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.59.3.tgz", + "integrity": "sha512-t2LvZnoEfzKtnPjgeEu41xw5gxq9mQVfYy4OoZ4Vlt0sk3JwxmhCca/AR7DwOiHrjWgjAj6as4AhRLKSDfvZIA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.59.3", + "@typescript-eslint/visitor-keys": "8.59.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/tsconfig-utils": { + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.59.3.tgz", + "integrity": "sha512-PcIJHjmaREXLgIAIzLnSY9VucEzz8FKXsRgFa1DmdGCK/5tJpW03TKJF01Q6VZd1lLdz2sIKPWaDUZN9dp//dw==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.59.3.tgz", + "integrity": "sha512-g71d8QD8UaiHGvrJwyIS1hCX5r63w6Jll+4VEYhEAHXTDIqX1JgxhTAbEHtKntL9kuc4jRo7/GWw5xfCepSccQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.59.3", + "@typescript-eslint/typescript-estree": "8.59.3", + "@typescript-eslint/utils": "8.59.3", + "debug": "^4.4.3", + "ts-api-utils": "^2.5.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/types": { + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.59.3.tgz", + "integrity": "sha512-ePFoH0g4ludssdRFqqDxQePCxU4WQyRa9+XVwjm7yLn0FKhMeoetC+qBEEI1Eyb1pGSDveTIT09Bvw2WhlGayg==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.59.3.tgz", + "integrity": "sha512-CbRjVRAf7Lr9Kr8RopKcbY45p2VfmmHrm0ygOCYFi7oU8q19m0Fs/6iHS7kNOmwpp+ob07ZVcAqlxUod9lYdmg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/project-service": "8.59.3", + "@typescript-eslint/tsconfig-utils": "8.59.3", + "@typescript-eslint/types": "8.59.3", + "@typescript-eslint/visitor-keys": "8.59.3", + "debug": "^4.4.3", + "minimatch": "^10.2.2", + "semver": "^7.7.3", + "tinyglobby": "^0.2.15", + "ts-api-utils": "^2.5.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.0.tgz", + "integrity": "sha512-AcM7dV/5ul4EekoQ29Agm5vri8JNqRyj39o0qpX6vDF2GZrtutZl5RwgD1XnZjiTAfncsJhMI48QQH3sN87YNA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.59.3.tgz", + "integrity": "sha512-JAvT14goBzRzzzZyqq3P9BLArIxTtQURUtFgQ/V7FO+eU+Gg6ES+5ymOPP1wRxXcxAYeivCk4uS3jCKWI1K8Zg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.9.1", + "@typescript-eslint/scope-manager": "8.59.3", + "@typescript-eslint/types": "8.59.3", + "@typescript-eslint/typescript-estree": "8.59.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.59.3.tgz", + "integrity": "sha512-f1UQF7ggd42YiwI5wGrRaPsa+P0CINBlrkLPmGfpq/u/I/oVtecoEIfFR9ag/oa1sLOsRNZ6xehf6qMZhQGBDg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.59.3", + "eslint-visitor-keys": "^5.0.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, "node_modules/@vitest/expect": { "version": "4.1.4", "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-4.1.4.tgz", @@ -1447,9 +2134,9 @@ } }, "node_modules/ajv-formats/node_modules/ajv": { - "version": "8.18.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.18.0.tgz", - "integrity": "sha512-PlXPeEWMXMZ7sPYOHqmDyCJzcfNrUr3fGNKtezX14ykXOEIvyK81d+qydx89KY5O71FKMPaQ2vBfBFI5NHR63A==", + "version": "8.20.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz", + "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==", "dev": true, "license": "MIT", "dependencies": { @@ -1537,9 +2224,9 @@ } }, "node_modules/baseline-browser-mapping": { - "version": "2.10.17", - "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.17.tgz", - "integrity": "sha512-HdrkN8eVG2CXxeifv/VdJ4A4RSra1DTW8dc/hdxzhGHN8QePs6gKaWM9pHPcpCoxYZJuOZ8drHmbdpLHjCYjLA==", + "version": "2.10.29", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.29.tgz", + "integrity": "sha512-Asa2krT+XTPZINCS+2QcyS8WTkObE77RwkydwF7h6DmnKqbvlalz93m/dnphUyCa6SWSP51VgtEUf2FN+gelFQ==", "dev": true, "license": "Apache-2.0", "bin": { @@ -1559,6 +2246,16 @@ "require-from-string": "^2.0.2" } }, + "node_modules/big.js": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", + "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + } + }, "node_modules/bluebird": { "version": "3.7.2", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", @@ -1634,9 +2331,9 @@ "license": "MIT" }, "node_modules/caniuse-lite": { - "version": "1.0.30001787", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001787.tgz", - "integrity": "sha512-mNcrMN9KeI68u7muanUpEejSLghOKlVhRqS/Za2IeyGllJ9I9otGpR9g3nsw7n4W378TE/LyIteA0+/FOZm4Kg==", + "version": "1.0.30001792", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001792.tgz", + "integrity": "sha512-hVLMUZFgR4JJ6ACt1uEESvQN1/dBVqPAKY0hgrV70eN3391K6juAfTjKZLKvOMsx8PxA7gsY1/tLMMTcfFLLpw==", "dev": true, "funding": [ { @@ -1911,12 +2608,22 @@ "license": "Apache-2.0" }, "node_modules/electron-to-chromium": { - "version": "1.5.334", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.334.tgz", - "integrity": "sha512-mgjZAz7Jyx1SRCwEpy9wefDS7GvNPazLthHg8eQMJ76wBdGQQDW33TCrUTvQ4wzpmOrv2zrFoD3oNufMdyMpog==", + "version": "1.5.354", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.354.tgz", + "integrity": "sha512-JaBHwWcfIdmSAfWM5l3uwjGd431j8YEMikZ+K/2nXVuBqJKyZ0f+2h4n4JY5AyNiZmnY9qQr2RU3v9DxDmHMNg==", "dev": true, "license": "ISC" }, + "node_modules/emojis-list": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", + "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, "node_modules/end-of-stream": { "version": "1.4.5", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz", @@ -1928,14 +2635,14 @@ } }, "node_modules/enhanced-resolve": { - "version": "5.20.1", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.20.1.tgz", - "integrity": "sha512-Qohcme7V1inbAfvjItgw0EaxVX5q2rdVEZHRBrEQdRZTssLDGsL8Lwrznl8oQ/6kuTJONLaDcGjkNP247XEhcA==", + "version": "5.21.3", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.21.3.tgz", + "integrity": "sha512-QyL119InA+XXEkNLNTPCXPugSvOfhwv0JOlGNzvxs0hZaiHLNvXSpudUWsOlsXGWJh8G6ckCScEkVHfX3kw/2Q==", "dev": true, "license": "MIT", "dependencies": { "graceful-fs": "^4.2.4", - "tapable": "^2.3.0" + "tapable": "^2.3.3" }, "engines": { "node": ">=10.13.0" @@ -1964,6 +2671,16 @@ "node": ">=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, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, "node_modules/es-module-lexer": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.0.0.tgz", @@ -1971,6 +2688,67 @@ "dev": true, "license": "MIT" }, + "node_modules/esbuild": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.7.tgz", + "integrity": "sha512-IxpibTjyVnmrIQo5aqNpCgoACA/dTKLTlhMHihVHhdkxKyPO1uBBthumT0rdHmcsk9uMonIWS0m4FljWzILh3w==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.27.7", + "@esbuild/android-arm": "0.27.7", + "@esbuild/android-arm64": "0.27.7", + "@esbuild/android-x64": "0.27.7", + "@esbuild/darwin-arm64": "0.27.7", + "@esbuild/darwin-x64": "0.27.7", + "@esbuild/freebsd-arm64": "0.27.7", + "@esbuild/freebsd-x64": "0.27.7", + "@esbuild/linux-arm": "0.27.7", + "@esbuild/linux-arm64": "0.27.7", + "@esbuild/linux-ia32": "0.27.7", + "@esbuild/linux-loong64": "0.27.7", + "@esbuild/linux-mips64el": "0.27.7", + "@esbuild/linux-ppc64": "0.27.7", + "@esbuild/linux-riscv64": "0.27.7", + "@esbuild/linux-s390x": "0.27.7", + "@esbuild/linux-x64": "0.27.7", + "@esbuild/netbsd-arm64": "0.27.7", + "@esbuild/netbsd-x64": "0.27.7", + "@esbuild/openbsd-arm64": "0.27.7", + "@esbuild/openbsd-x64": "0.27.7", + "@esbuild/openharmony-arm64": "0.27.7", + "@esbuild/sunos-x64": "0.27.7", + "@esbuild/win32-arm64": "0.27.7", + "@esbuild/win32-ia32": "0.27.7", + "@esbuild/win32-x64": "0.27.7" + } + }, + "node_modules/esbuild-loader": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/esbuild-loader/-/esbuild-loader-4.4.3.tgz", + "integrity": "sha512-Wpui03EzqC151xFteKlgJQhbyZl5CgnBpUHXVuao02nItULlkaTeiLdEMPTmR2zdwpEBWkXVNoT5dDOYJluUzg==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "^0.27.1", + "get-tsconfig": "^4.10.1", + "loader-utils": "^2.0.4", + "webpack-sources": "^3.3.4" + }, + "funding": { + "url": "https://github.com/privatenumber/esbuild-loader?sponsor=1" + }, + "peerDependencies": { + "webpack": "^4.40.0 || ^5.0.0" + } + }, "node_modules/escalade": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", @@ -2265,9 +3043,9 @@ "license": "MIT" }, "node_modules/fast-uri": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.0.tgz", - "integrity": "sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.2.tgz", + "integrity": "sha512-rVjf7ArG3LTk+FS6Yw81V1DLuZl1bRbNrev6Tmd/9RaroeeRRJhAt7jg/6YFxbvAQXUCavSoZhPPj6oOx+5KjQ==", "dev": true, "funding": [ { @@ -2428,6 +3206,19 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/get-tsconfig": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.14.0.tgz", + "integrity": "sha512-yTb+8DXzDREzgvYmh6s9vHsSVCHeC0G3PI5bEXNBHtmshPnO+S5O7qgLEOn0I5QvMy6kpZN8K1NKGyilLb93wA==", + "dev": true, + "license": "MIT", + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -2478,9 +3269,9 @@ "license": "MIT" }, "node_modules/glob/node_modules/brace-expansion": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.13.tgz", - "integrity": "sha512-9ZLprWS6EENmhEOpjCYW2c8VkmOvckIJZfkr7rBW6dObmfgJ/L1GpSYW5Hpo9lDz4D1+n0Ckz8rU7FwHDQiG/w==", + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.14.tgz", + "integrity": "sha512-MWPGfDxnyzKU7rNOW9SP/c50vi3xrmrua/+6hfPbCS2ABNWfx24vPidzvC7krjU/RTo235sV776ymlsMtGKj8g==", "dev": true, "license": "MIT", "dependencies": { @@ -2559,9 +3350,9 @@ } }, "node_modules/hasown": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", - "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.3.tgz", + "integrity": "sha512-ej4AhfhfL2Q2zpMmLo7U1Uv9+PyhIZpgQLGT1F9miIGmiCJIoCgSmczFdrc97mWT4kVY72KA+WnnhJ5pghSvSg==", "dev": true, "license": "MIT", "dependencies": { @@ -2685,13 +3476,13 @@ } }, "node_modules/is-core-module": { - "version": "2.16.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", - "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", + "version": "2.16.2", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.2.tgz", + "integrity": "sha512-evOr8xfXKxE6qSR0hSXL2r3sd7ALj8+7jQEUvPYcm5sgZFdJ+AYzT6yNmJenvIYQBgIGwfwz08sL8zoL7yq2BA==", "dev": true, "license": "MIT", "dependencies": { - "hasown": "^2.0.2" + "hasown": "^2.0.3" }, "engines": { "node": ">= 0.4" @@ -2948,13 +3739,6 @@ "dev": true, "license": "MIT" }, - "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" - }, "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -2969,6 +3753,19 @@ "dev": true, "license": "MIT" }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/jsonfile": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.0.tgz", @@ -3298,9 +4095,9 @@ } }, "node_modules/loader-runner": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.1.tgz", - "integrity": "sha512-IWqP2SCPhyVFTBtRcgMHdzlf9ul25NwaFx4wCEH/KjAXuuHY4yNjvPXsBokp8jCB936PyWRaPKUNh8NvylLp2Q==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.2.tgz", + "integrity": "sha512-DFEqQ3ihfS9blba08cLfYf1NRAIEm+dDjic073DRDc3/JspI/8wYmtDsHwd3+4hwvdxSK7PGaElfTmm0awWJ4w==", "dev": true, "license": "MIT", "engines": { @@ -3311,6 +4108,21 @@ "url": "https://opencollective.com/webpack" } }, + "node_modules/loader-utils": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", + "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^2.1.2" + }, + "engines": { + "node": ">=8.9.0" + } + }, "node_modules/locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", @@ -3447,24 +4259,11 @@ } }, "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==", + "version": "1.54.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", + "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", "dev": true, "license": "MIT", - "dependencies": { - "mime-db": "1.52.0" - }, "engines": { "node": ">= 0.6" } @@ -3577,9 +4376,9 @@ "license": "MIT" }, "node_modules/nanoid": { - "version": "3.3.11", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", - "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", + "version": "3.3.12", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.12.tgz", + "integrity": "sha512-ZB9RH/39qpq5Vu6Y+NmUaFhQR6pp+M2Xt76XBnEwDaGcVAqhlvxrl3B2bKS5D3NH3QR76v3aSrKaF/Kiy7lEtQ==", "dev": true, "funding": [ { @@ -3610,9 +4409,9 @@ "license": "MIT" }, "node_modules/node-releases": { - "version": "2.0.37", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.37.tgz", - "integrity": "sha512-1h5gKZCF+pO/o3Iqt5Jp7wc9rH3eJJ0+nh/CIoiRwjRxde/hAHyLPXYN4V3CqKAbiZPSeJFSWHmJsbkicta0Eg==", + "version": "2.0.44", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.44.tgz", + "integrity": "sha512-5WUyunoPMsvvEhS8AxHtRzP+oA8UCkJ7YRxatWKjngndhDGLiqEVAQKWjFAiAiuL8zMRGzGSJxFnLetoa43qGQ==", "dev": true, "license": "MIT" }, @@ -4027,9 +4826,9 @@ } }, "node_modules/postcss": { - "version": "8.5.9", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.9.tgz", - "integrity": "sha512-7a70Nsot+EMX9fFU3064K/kdHWZqGVY+BADLyXc8Dfv+mTLLVl6JzJpPaCZ2kQL9gIJvKXSLMHhqdRRjwQeFtw==", + "version": "8.5.14", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.14.tgz", + "integrity": "sha512-SoSL4+OSEtR99LHFZQiJLkT59C5B1amGO1NzTwj7TT1qCUgUO6hxOvzkOYxD+vMrXBM3XJIKzokoERdqQq/Zmg==", "dev": true, "funding": [ { @@ -4147,12 +4946,13 @@ } }, "node_modules/resolve": { - "version": "1.22.11", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.11.tgz", - "integrity": "sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ==", + "version": "1.22.12", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.12.tgz", + "integrity": "sha512-TyeJ1zif53BPfHootBGwPRYT1RUt6oGWsaQr8UyZW/eAm9bKoijtvruSDEmZHm92CwS9nj7/fWttqPCgzep8CA==", "dev": true, "license": "MIT", "dependencies": { + "es-errors": "^1.3.0", "is-core-module": "^2.16.1", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" @@ -4190,6 +4990,16 @@ "node": ">=8" } }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, "node_modules/rimraf": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", @@ -4205,14 +5015,14 @@ } }, "node_modules/rolldown": { - "version": "1.0.0-rc.15", - "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.0.0-rc.15.tgz", - "integrity": "sha512-Ff31guA5zT6WjnGp0SXw76X6hzGRk/OQq2hE+1lcDe+lJdHSgnSX6nK3erbONHyCbpSj9a9E+uX/OvytZoWp2g==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.0.0.tgz", + "integrity": "sha512-yD986aXDESFGS95spT1LAv0jssywP4npMEjmMHyN2/5+eE8qQJUype2AaKkRiLgBgyD0LFlubwAht7VmY8rGoA==", "dev": true, "license": "MIT", "dependencies": { - "@oxc-project/types": "=0.124.0", - "@rolldown/pluginutils": "1.0.0-rc.15" + "@oxc-project/types": "=0.129.0", + "@rolldown/pluginutils": "1.0.0" }, "bin": { "rolldown": "bin/cli.mjs" @@ -4221,21 +5031,21 @@ "node": "^20.19.0 || >=22.12.0" }, "optionalDependencies": { - "@rolldown/binding-android-arm64": "1.0.0-rc.15", - "@rolldown/binding-darwin-arm64": "1.0.0-rc.15", - "@rolldown/binding-darwin-x64": "1.0.0-rc.15", - "@rolldown/binding-freebsd-x64": "1.0.0-rc.15", - "@rolldown/binding-linux-arm-gnueabihf": "1.0.0-rc.15", - "@rolldown/binding-linux-arm64-gnu": "1.0.0-rc.15", - "@rolldown/binding-linux-arm64-musl": "1.0.0-rc.15", - "@rolldown/binding-linux-ppc64-gnu": "1.0.0-rc.15", - "@rolldown/binding-linux-s390x-gnu": "1.0.0-rc.15", - "@rolldown/binding-linux-x64-gnu": "1.0.0-rc.15", - "@rolldown/binding-linux-x64-musl": "1.0.0-rc.15", - "@rolldown/binding-openharmony-arm64": "1.0.0-rc.15", - "@rolldown/binding-wasm32-wasi": "1.0.0-rc.15", - "@rolldown/binding-win32-arm64-msvc": "1.0.0-rc.15", - "@rolldown/binding-win32-x64-msvc": "1.0.0-rc.15" + "@rolldown/binding-android-arm64": "1.0.0", + "@rolldown/binding-darwin-arm64": "1.0.0", + "@rolldown/binding-darwin-x64": "1.0.0", + "@rolldown/binding-freebsd-x64": "1.0.0", + "@rolldown/binding-linux-arm-gnueabihf": "1.0.0", + "@rolldown/binding-linux-arm64-gnu": "1.0.0", + "@rolldown/binding-linux-arm64-musl": "1.0.0", + "@rolldown/binding-linux-ppc64-gnu": "1.0.0", + "@rolldown/binding-linux-s390x-gnu": "1.0.0", + "@rolldown/binding-linux-x64-gnu": "1.0.0", + "@rolldown/binding-linux-x64-musl": "1.0.0", + "@rolldown/binding-openharmony-arm64": "1.0.0", + "@rolldown/binding-wasm32-wasi": "1.0.0", + "@rolldown/binding-win32-arm64-msvc": "1.0.0", + "@rolldown/binding-win32-x64-msvc": "1.0.0" } }, "node_modules/saxes": { @@ -4272,9 +5082,9 @@ } }, "node_modules/schema-utils/node_modules/ajv": { - "version": "8.18.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.18.0.tgz", - "integrity": "sha512-PlXPeEWMXMZ7sPYOHqmDyCJzcfNrUr3fGNKtezX14ykXOEIvyK81d+qydx89KY5O71FKMPaQ2vBfBFI5NHR63A==", + "version": "8.20.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz", + "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==", "dev": true, "license": "MIT", "dependencies": { @@ -4506,9 +5316,9 @@ "dev": true }, "node_modules/tapable": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.2.tgz", - "integrity": "sha512-1MOpMXuhGzGL5TTCZFItxCc0AARf1EZFQkGqMm7ERKj8+Hgr5oLvJOVFcC+lRmR8hCe2S3jC4T5D7Vg/d7/fhA==", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.3.tgz", + "integrity": "sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A==", "dev": true, "license": "MIT", "engines": { @@ -4520,9 +5330,9 @@ } }, "node_modules/terser": { - "version": "5.46.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.46.1.tgz", - "integrity": "sha512-vzCjQO/rgUuK9sf8VJZvjqiqiHFaZLnOiimmUuOKODxWL8mm/xua7viT7aqX7dgPY60otQjUotzFMmCB4VdmqQ==", + "version": "5.47.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.47.1.tgz", + "integrity": "sha512-tPbLXTI6ohPASb/1YViL428oEHu6/qv1OxqYnfaonVCFHqx4+wCd95pHrQWsL5X4pl90CTyW9piSAsS2L0VoMw==", "dev": true, "license": "BSD-2-Clause", "dependencies": { @@ -4539,9 +5349,9 @@ } }, "node_modules/terser-webpack-plugin": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.4.0.tgz", - "integrity": "sha512-Bn5vxm48flOIfkdl5CaD2+1CiUVbonWQ3KQPyP7/EuIl9Gbzq/gQFOzaMFUEgVjB1396tcK0SG8XcNJ/2kDH8g==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.6.0.tgz", + "integrity": "sha512-Eum+5ajkaOhf5KbM26osvv21kLD7BaGqQ1UA4Ami4arYwylmGUQTgHFpHDdmJod1q4QXa66p0to/FBKID+J1vA==", "dev": true, "license": "MIT", "dependencies": { @@ -4561,12 +5371,39 @@ "webpack": "^5.1.0" }, "peerDependenciesMeta": { + "@minify-html/node": { + "optional": true + }, "@swc/core": { "optional": true }, + "@swc/css": { + "optional": true + }, + "@swc/html": { + "optional": true + }, + "clean-css": { + "optional": true + }, + "cssnano": { + "optional": true + }, + "csso": { + "optional": true + }, "esbuild": { "optional": true }, + "html-minifier-terser": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "postcss": { + "optional": true + }, "uglify-js": { "optional": true } @@ -4790,6 +5627,19 @@ "node": ">=4" } }, + "node_modules/ts-api-utils": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.5.0.tgz", + "integrity": "sha512-OJ/ibxhPlqrMM0UiNHJ/0CKQkoKF243/AEmplt3qpRgkW8VG7IfOS41h7V8TjITqdByHzrjcS/2si+y4lIh8NA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.12" + }, + "peerDependencies": { + "typescript": ">=4.8.4" + } + }, "node_modules/tslib": { "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", @@ -4825,6 +5675,30 @@ "node": ">=14.17" } }, + "node_modules/typescript-eslint": { + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.59.3.tgz", + "integrity": "sha512-KgusgyDgG4LI8Ih/sWaCtZ06tckLAS5CvT5A4D1Q7bYVoAAyzwiZvE4BmwDHkhRVkvhRBepKeASoFzQetha7Fg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/eslint-plugin": "8.59.3", + "@typescript-eslint/parser": "8.59.3", + "@typescript-eslint/typescript-estree": "8.59.3", + "@typescript-eslint/utils": "8.59.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, "node_modules/uc.micro": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", @@ -4850,9 +5724,9 @@ } }, "node_modules/undici-types": { - "version": "7.19.2", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.19.2.tgz", - "integrity": "sha512-qYVnV5OEm2AW8cJMCpdV20CDyaN3g0AjDlOGf1OW4iaDEx8MwdtChUp4zu4H0VP3nDRF/8RKWH+IPp9uW0YGZg==", + "version": "7.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.21.0.tgz", + "integrity": "sha512-w9IMgQrz4O0YN1LtB7K5P63vhlIOvC7opSmouCJ+ZywlPAlO9gIkJ+otk6LvGpAs2wg4econaCz3TvQ9xPoyuQ==", "dev": true, "license": "MIT" }, @@ -4941,6 +5815,7 @@ "version": "8.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "deprecated": "uuid@10 and below is no longer supported. For ESM codebases, update to uuid@latest. For CommonJS codebases, use uuid@11 (but be aware this version will likely be deprecated in 2028).", "dev": true, "license": "MIT", "bin": { @@ -4948,17 +5823,17 @@ } }, "node_modules/vite": { - "version": "8.0.8", - "resolved": "https://registry.npmjs.org/vite/-/vite-8.0.8.tgz", - "integrity": "sha512-dbU7/iLVa8KZALJyLOBOQ88nOXtNG8vxKuOT4I2mD+Ya70KPceF4IAmDsmU0h1Qsn5bPrvsY9HJstCRh3hG6Uw==", + "version": "8.0.12", + "resolved": "https://registry.npmjs.org/vite/-/vite-8.0.12.tgz", + "integrity": "sha512-w2dDofOWv2QB09ZITZBsvKTVAlYvPR4IAmrY/v0ir9KvLs0xybR7i48wxhM1/oyBWO34wPns+bPGw5ZrZqDpZg==", "dev": true, "license": "MIT", "dependencies": { "lightningcss": "^1.32.0", "picomatch": "^4.0.4", - "postcss": "^8.5.8", - "rolldown": "1.0.0-rc.15", - "tinyglobby": "^0.2.15" + "postcss": "^8.5.14", + "rolldown": "1.0.0", + "tinyglobby": "^0.2.16" }, "bin": { "vite": "bin/vite.js" @@ -4974,7 +5849,7 @@ }, "peerDependencies": { "@types/node": "^20.19.0 || >=22.12.0", - "@vitejs/devtools": "^0.1.0", + "@vitejs/devtools": "^0.1.18", "esbuild": "^0.27.0 || ^0.28.0", "jiti": ">=1.21.0", "less": "^4.0.0", @@ -5186,9 +6061,9 @@ } }, "node_modules/webpack": { - "version": "5.106.1", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.106.1.tgz", - "integrity": "sha512-EW8af29ak8Oaf4T8k8YsajjrDBDYgnKZ5er6ljWFJsXABfTNowQfvHLftwcepVgdz+IoLSdEAbBiM9DFXoll9w==", + "version": "5.106.2", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.106.2.tgz", + "integrity": "sha512-wGN3qcrBQIFmQ/c0AiOAQBvrZ5lmY8vbbMv4Mxfgzqd/B6+9pXtLo73WuS1dSGXM5QYY3hZnIbvx+K1xxe6FyA==", "dev": true, "license": "MIT", "dependencies": { @@ -5208,9 +6083,8 @@ "events": "^3.2.0", "glob-to-regexp": "^0.4.1", "graceful-fs": "^4.2.11", - "json-parse-even-better-errors": "^2.3.1", "loader-runner": "^4.3.1", - "mime-types": "^2.1.27", + "mime-db": "^1.54.0", "neo-async": "^2.6.2", "schema-utils": "^4.3.3", "tapable": "^2.3.0", @@ -5308,9 +6182,9 @@ "license": "MIT" }, "node_modules/webpack-sources": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.3.4.tgz", - "integrity": "sha512-7tP1PdV4vF+lYPnkMR0jMY5/la2ub5Fc/8VQrrU+lXkiM6C4TjVfGw7iKfyhnTQOsD+6Q/iKw0eFciziRgD58Q==", + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.4.1.tgz", + "integrity": "sha512-eACpxRN02yaawnt+uUNIF7Qje6A9zArxBbcAJjK1PK3S9Ycg5jIuJ8pW4q8EMnwNZCEGltcjkRx1QzOxOkKD8A==", "dev": true, "license": "MIT", "engines": { diff --git a/package.json b/package.json index 9f932409c1..fa942dbd96 100644 --- a/package.json +++ b/package.json @@ -32,9 +32,9 @@ "watch": "webpack --watch --config config/webpack.config.js", "watchns": "webpack --watch --config config/webpack-nospector.config.js", "dist": "webpack --config config/webpack.dist.config.js", - "lint": "eslint \"src/**/*.js\"", + "lint": "eslint \"src/**/*.{js,ts}\"", "lintfix": "npm run lint -- --fix", - "sloc": "node-sloc \"./src\" --include-extensions \"js\"", + "sloc": "node-sloc \"./src\" --include-extensions \"js,ts\"", "bundleshaders": "node scripts/bundle-shaders.js", "build-tsgen": "cd scripts/tsgen && tsc", "tsgen": "cd scripts/tsgen && jsdoc -c jsdoc-tsd.conf.json", @@ -42,7 +42,8 @@ "ts": "npm run tsgen && npm run test-ts", "tsdev": "npm run build-tsgen && npm run tsgen && npm run test-ts", "test": "vitest run", - "test:watch": "vitest" + "test:watch": "vitest", + "typecheck": "tsc --noEmit" }, "keywords": [ "2d", @@ -63,6 +64,7 @@ "@types/source-map": "^0.5.7", "clean-webpack-plugin": "^4.0.0", "dts-dom": "^3.7.0", + "esbuild-loader": "4.4.3", "eslint": "^10.2.0", "eslint-plugin-es5": "^1.5.0", "exports-loader": "^5.0.0", @@ -78,6 +80,7 @@ "source-map": "^0.7.6", "terser-webpack-plugin": "^5.4.0", "typescript": "^6.0.2", + "typescript-eslint": "8.59.3", "vitest": "^4.1.4", "vivid-cli": "^1.1.2", "webpack": "^5.106.0", diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000000..61798f21a6 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "strict": true, + "target": "ES2018", + "module": "ES2020", + "moduleResolution": "bundler", + "allowJs": true, + "checkJs": false, + "declaration": true, + "declarationDir": "./types/generated/", + "emitDeclarationOnly": true, + "outDir": "./dist/", + "rootDir": "./src/", + "esModuleInterop": true, + "resolveJsonModule": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true + }, + "include": ["src/**/*.ts"], + "exclude": ["node_modules", "dist", "build", "tests", "scripts", "types"] +} diff --git a/vitest.config.js b/vitest.config.js index 7375edaa9f..b5fbe66f50 100644 --- a/vitest.config.js +++ b/vitest.config.js @@ -2,7 +2,7 @@ import { defineConfig } from 'vitest/config'; export default defineConfig({ test: { - include: ['tests/**/*.test.js'], + include: ['tests/**/*.test.{js,ts}'], globals: true, environment: 'jsdom', setupFiles: ['./tests/setup.js'] From 7fa8b37e86c1d163320137e7ac41bcb770bd12e5 Mon Sep 17 00:00:00 2001 From: Niklas Engblom Date: Thu, 14 May 2026 07:34:27 +0300 Subject: [PATCH 03/17] Rename Clamp, Wrap, Equal from js to ts --- src/math/{Clamp.js => Clamp.ts} | 0 src/math/{Wrap.js => Wrap.ts} | 0 src/math/fuzzy/{Equal.js => Equal.ts} | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename src/math/{Clamp.js => Clamp.ts} (100%) rename src/math/{Wrap.js => Wrap.ts} (100%) rename src/math/fuzzy/{Equal.js => Equal.ts} (100%) diff --git a/src/math/Clamp.js b/src/math/Clamp.ts similarity index 100% rename from src/math/Clamp.js rename to src/math/Clamp.ts diff --git a/src/math/Wrap.js b/src/math/Wrap.ts similarity index 100% rename from src/math/Wrap.js rename to src/math/Wrap.ts diff --git a/src/math/fuzzy/Equal.js b/src/math/fuzzy/Equal.ts similarity index 100% rename from src/math/fuzzy/Equal.js rename to src/math/fuzzy/Equal.ts From 797f9c54974b975f79d6296e3bf07fdb1b32a4af Mon Sep 17 00:00:00 2001 From: Niklas Engblom Date: Thu, 14 May 2026 07:34:27 +0300 Subject: [PATCH 04/17] Convert Clamp, Wrap, and Fuzzy.Equal to TypeScript --- src/math/Clamp.js | 1 + src/math/Clamp.ts | 15 +++++++-------- src/math/Wrap.js | 1 + src/math/Wrap.ts | 19 +++++++++---------- src/math/fuzzy/Equal.js | 1 + src/math/fuzzy/Equal.ts | 17 +++++++---------- src/renderer/webgl/renderNodes/Camera.js | 2 +- 7 files changed, 27 insertions(+), 29 deletions(-) create mode 100644 src/math/Clamp.js create mode 100644 src/math/Wrap.js create mode 100644 src/math/fuzzy/Equal.js diff --git a/src/math/Clamp.js b/src/math/Clamp.js new file mode 100644 index 0000000000..dcc9c31e0e --- /dev/null +++ b/src/math/Clamp.js @@ -0,0 +1 @@ +module.exports = require('./Clamp.ts').default; diff --git a/src/math/Clamp.ts b/src/math/Clamp.ts index 5e75e691f1..db8112d719 100644 --- a/src/math/Clamp.ts +++ b/src/math/Clamp.ts @@ -10,15 +10,14 @@ * @function Phaser.Math.Clamp * @since 3.0.0 * - * @param {number} value - The value to be clamped. - * @param {number} min - The minimum bounds. - * @param {number} max - The maximum bounds. - * - * @return {number} The clamped value. + * @param value - The value to be clamped. + * @param min - The minimum bounds. + * @param max - The maximum bounds. + * @returns The clamped value. */ -var Clamp = function (value, min, max) +export function Clamp (value: number, min: number, max: number): number { return Math.max(min, Math.min(max, value)); -}; +} -module.exports = Clamp; +export default Clamp; diff --git a/src/math/Wrap.js b/src/math/Wrap.js new file mode 100644 index 0000000000..a3c3f172e4 --- /dev/null +++ b/src/math/Wrap.js @@ -0,0 +1 @@ +module.exports = require('./Wrap.ts').default; diff --git a/src/math/Wrap.ts b/src/math/Wrap.ts index fff3d3997e..45745d08b8 100644 --- a/src/math/Wrap.ts +++ b/src/math/Wrap.ts @@ -9,23 +9,22 @@ * * When the value exceeds `max` it wraps back around to `min`, and when it falls * below `min` it wraps around to just below `max`. This is useful for cycling - * through a range, such as keeping an angle within 0–360 degrees or looping a + * through a range, such as keeping an angle within 0-360 degrees or looping a * tile index within a tileset. * * @function Phaser.Math.Wrap * @since 3.0.0 * - * @param {number} value - The value to wrap. - * @param {number} min - The minimum bound of the range (inclusive). - * @param {number} max - The maximum bound of the range (exclusive). - * - * @return {number} The wrapped value, guaranteed to be within `[min, max)`. + * @param value - The value to wrap. + * @param min - The minimum bound of the range (inclusive). + * @param max - The maximum bound of the range (exclusive). + * @returns The wrapped value, guaranteed to be within `[min, max)`. */ -var Wrap = function (value, min, max) +export function Wrap (value: number, min: number, max: number): number { - var range = max - min; + const range = max - min; return (min + ((((value - min) % range) + range) % range)); -}; +} -module.exports = Wrap; +export default Wrap; diff --git a/src/math/fuzzy/Equal.js b/src/math/fuzzy/Equal.js new file mode 100644 index 0000000000..a3c13b33cc --- /dev/null +++ b/src/math/fuzzy/Equal.js @@ -0,0 +1 @@ +module.exports = require('./Equal.ts').default; diff --git a/src/math/fuzzy/Equal.ts b/src/math/fuzzy/Equal.ts index 6ec307edc3..87e81e595d 100644 --- a/src/math/fuzzy/Equal.ts +++ b/src/math/fuzzy/Equal.ts @@ -12,17 +12,14 @@ * @function Phaser.Math.Fuzzy.Equal * @since 3.0.0 * - * @param {number} a - The first value. - * @param {number} b - The second value. - * @param {number} [epsilon=0.0001] - The maximum absolute difference below which the two values are considered equal. - * - * @return {boolean} `true` if the values are fuzzily equal, otherwise `false`. + * @param a - The first value. + * @param b - The second value. + * @param epsilon - The maximum absolute difference below which the two values are considered equal. + * @returns `true` if the values are fuzzily equal, otherwise `false`. */ -var Equal = function (a, b, epsilon) +export function Equal (a: number, b: number, epsilon: number = 0.0001): boolean { - if (epsilon === undefined) { epsilon = 0.0001; } - return Math.abs(a - b) < epsilon; -}; +} -module.exports = Equal; +export default Equal; diff --git a/src/renderer/webgl/renderNodes/Camera.js b/src/renderer/webgl/renderNodes/Camera.js index cb860b86d5..8dce793f7f 100644 --- a/src/renderer/webgl/renderNodes/Camera.js +++ b/src/renderer/webgl/renderNodes/Camera.js @@ -8,7 +8,7 @@ var CameraEvents = require('../../../cameras/2d/events'); var GetColor32 = require('../../../display/color/GetColor32'); var TransformMatrix = require('../../../gameobjects/components/TransformMatrix.js'); var Rectangle = require('../../../geom/rectangle/Rectangle'); -var Equal = require('../../../math/fuzzy/Equal.js'); +var Equal = require('../../../math/fuzzy/Equal'); var Class = require('../../../utils/Class'); var Utils = require('../Utils.js'); var RenderNode = require('./RenderNode'); From 791a81eb78c28cd77fc7ce4cf2ade797c1494c0b Mon Sep 17 00:00:00 2001 From: Niklas Engblom Date: Thu, 14 May 2026 07:34:29 +0300 Subject: [PATCH 05/17] Rename Vector2 from js to ts --- src/math/{Vector2.js => Vector2.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/math/{Vector2.js => Vector2.ts} (100%) diff --git a/src/math/Vector2.js b/src/math/Vector2.ts similarity index 100% rename from src/math/Vector2.js rename to src/math/Vector2.ts From 78085969e97bcc69687780ba7b34699e9117d4b8 Mon Sep 17 00:00:00 2001 From: Niklas Engblom Date: Thu, 14 May 2026 07:34:29 +0300 Subject: [PATCH 06/17] Convert Vector2 to TypeScript --- src/math/Vector2.js | 1 + src/math/Vector2.ts | 618 +++++++++++++++++++------------------------- 2 files changed, 272 insertions(+), 347 deletions(-) create mode 100644 src/math/Vector2.js diff --git a/src/math/Vector2.js b/src/math/Vector2.js new file mode 100644 index 0000000000..15d34b49ff --- /dev/null +++ b/src/math/Vector2.js @@ -0,0 +1 @@ +module.exports = require('./Vector2.ts').default; diff --git a/src/math/Vector2.ts b/src/math/Vector2.ts index a7afa90106..28272c0a4e 100644 --- a/src/math/Vector2.ts +++ b/src/math/Vector2.ts @@ -7,8 +7,17 @@ // Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji // and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl -var Class = require('../utils/Class'); -var FuzzyEqual = require('../math/fuzzy/Equal'); +import FuzzyEqual from './fuzzy/Equal.js'; + +/** + * @memberof Phaser.Types.Math + * @since 3.0.0 + */ +export interface Vector2Like +{ + x: number; + y: number; +} /** * @classdesc @@ -21,38 +30,34 @@ var FuzzyEqual = require('../math/fuzzy/Equal'); * `Vector2Like` object (any object with `x` and `y` number properties), making * Vector2 easy to integrate across the framework. * - * @class Vector2 * @memberof Phaser.Math - * @constructor * @since 3.0.0 - * - * @param {number|Phaser.Types.Math.Vector2Like} [x=0] - The x component, or an object with `x` and `y` properties. - * @param {number} [y=x] - The y component. */ -var Vector2 = new Class({ +export class Vector2 +{ + /** + * The x component of this Vector. + * + * @default 0 + * @since 3.0.0 + */ + x: number; - initialize: + /** + * The y component of this Vector. + * + * @default 0 + * @since 3.0.0 + */ + y: number; - function Vector2 (x, y) + /** + * @param x - The x component, or an object with `x` and `y` properties. + * @param y - The y component. + */ + constructor (x?: number | Vector2Like, y?: number) { - /** - * The x component of this Vector. - * - * @name Phaser.Math.Vector2#x - * @type {number} - * @default 0 - * @since 3.0.0 - */ this.x = 0; - - /** - * The y component of this Vector. - * - * @name Phaser.Math.Vector2#y - * @type {number} - * @default 0 - * @since 3.0.0 - */ this.y = 0; if (typeof x === 'object') @@ -67,69 +72,62 @@ var Vector2 = new Class({ this.x = x || 0; this.y = y || 0; } - }, + } /** * Make a clone of this Vector2. * - * @method Phaser.Math.Vector2#clone * @since 3.0.0 * - * @return {Phaser.Math.Vector2} A clone of this Vector2. + * @returns A clone of this Vector2. */ - clone: function () + clone (): Vector2 { return new Vector2(this.x, this.y); - }, + } /** * Copy the components of a given Vector into this Vector. * - * @method Phaser.Math.Vector2#copy * @since 3.0.0 * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector to copy the components from. - * - * @return {Phaser.Math.Vector2} This Vector2. + * @param src - The Vector to copy the components from. + * @returns This Vector2. */ - copy: function (src) + copy (src: Vector2Like): this { this.x = src.x || 0; this.y = src.y || 0; return this; - }, + } /** * Set the component values of this Vector from a given Vector2Like object. * - * @method Phaser.Math.Vector2#setFromObject * @since 3.0.0 * - * @param {Phaser.Types.Math.Vector2Like} obj - The object containing the component values to set for this Vector. - * - * @return {Phaser.Math.Vector2} This Vector2. + * @param obj - The object containing the component values to set for this Vector. + * @returns This Vector2. */ - setFromObject: function (obj) + setFromObject (obj: Vector2Like): this { this.x = obj.x || 0; this.y = obj.y || 0; return this; - }, + } /** * Set the `x` and `y` components of this Vector to the given `x` and `y` values. * - * @method Phaser.Math.Vector2#set * @since 3.0.0 * - * @param {number} x - The x value to set for this Vector. - * @param {number} [y=x] - The y value to set for this Vector. - * - * @return {Phaser.Math.Vector2} This Vector2. + * @param x - The x value to set for this Vector. + * @param y - The y value to set for this Vector. + * @returns This Vector2. */ - set: function (x, y) + set (x: number, y?: number): this { if (y === undefined) { y = x; } @@ -137,136 +135,124 @@ var Vector2 = new Class({ this.y = y; return this; - }, + } /** * This method is an alias for `Vector2.set`. * - * @method Phaser.Math.Vector2#setTo * @since 3.4.0 * - * @param {number} x - The x value to set for this Vector. - * @param {number} [y=x] - The y value to set for this Vector. - * - * @return {Phaser.Math.Vector2} This Vector2. + * @param x - The x value to set for this Vector. + * @param y - The y value to set for this Vector. + * @returns This Vector2. */ - setTo: function (x, y) + setTo (x: number, y?: number): this { return this.set(x, y); - }, - + } + /** * Runs the x and y components of this Vector2 through Math.ceil and then sets them. * - * @method Phaser.Math.Vector2#ceil * @since 4.0.0 * - * @return {Phaser.Math.Vector2} This Vector2. + * @returns This Vector2. */ - ceil: function () + ceil (): this { this.x = Math.ceil(this.x); this.y = Math.ceil(this.y); return this; - }, + } /** * Runs the x and y components of this Vector2 through Math.floor and then sets them. * - * @method Phaser.Math.Vector2#floor * @since 4.0.0 * - * @return {Phaser.Math.Vector2} This Vector2. + * @returns This Vector2. */ - floor: function () + floor (): this { this.x = Math.floor(this.x); this.y = Math.floor(this.y); return this; - }, + } /** * Swaps the x and y components of this Vector2. * - * @method Phaser.Math.Vector2#invert * @since 4.0.0 * - * @return {Phaser.Math.Vector2} This Vector2. + * @returns This Vector2. */ - invert: function () + invert (): this { return this.set(this.y, this.x); - }, + } /** * Sets the x and y components of this Vector from the given angle and length. * - * @method Phaser.Math.Vector2#setToPolar * @since 3.0.0 * - * @param {number} angle - The angle from the positive x-axis, in radians. - * @param {number} [length=1] - The distance from the origin. - * - * @return {Phaser.Math.Vector2} This Vector2. + * @param angle - The angle from the positive x-axis, in radians. + * @param length - The distance from the origin. + * @returns This Vector2. */ - setToPolar: function (angle, length) + setToPolar (angle: number, length?: number | null): this { - if (length == null) { length = 1; } + if (length === null || length === undefined) { length = 1; } this.x = Math.cos(angle) * length; this.y = Math.sin(angle) * length; return this; - }, + } /** * Check whether this Vector is equal to a given Vector. * * Performs a strict equality check against each Vector's components. * - * @method Phaser.Math.Vector2#equals * @since 3.0.0 * - * @param {Phaser.Types.Math.Vector2Like} v - The vector to compare with this Vector. - * - * @return {boolean} Whether the given Vector is equal to this Vector. + * @param v - The vector to compare with this Vector. + * @returns Whether the given Vector is equal to this Vector. */ - equals: function (v) + equals (v: Vector2Like): boolean { return ((this.x === v.x) && (this.y === v.y)); - }, + } /** * Check whether this Vector is approximately equal to a given Vector. * - * @method Phaser.Math.Vector2#fuzzyEquals * @since 3.23.0 * - * @param {Phaser.Types.Math.Vector2Like} v - The vector to compare with this Vector. - * @param {number} [epsilon=0.0001] - The tolerance value. - * - * @return {boolean} Whether both absolute differences of the x and y components are smaller than `epsilon`. + * @param v - The vector to compare with this Vector. + * @param epsilon - The tolerance value. + * @returns Whether both absolute differences of the x and y components are smaller than `epsilon`. */ - fuzzyEquals: function (v, epsilon) + fuzzyEquals (v: Vector2Like, epsilon?: number): boolean { return (FuzzyEqual(this.x, v.x, epsilon) && FuzzyEqual(this.y, v.y, epsilon)); - }, + } /** * Calculate the angle between this Vector and the positive x-axis, in radians. * - * @method Phaser.Math.Vector2#angle * @since 3.0.0 * - * @return {number} The angle between this Vector, and the positive x-axis, given in radians. + * @returns The angle between this Vector, and the positive x-axis, given in radians. */ - angle: function () + angle (): number { // computes the angle in radians with respect to the positive x-axis - var angle = Math.atan2(this.y, this.x); + let angle = Math.atan2(this.y, this.x); if (angle < 0) { @@ -274,90 +260,80 @@ var Vector2 = new Class({ } return angle; - }, + } /** * Set the angle of this Vector. * - * @method Phaser.Math.Vector2#setAngle * @since 3.23.0 * - * @param {number} angle - The angle, in radians. - * - * @return {Phaser.Math.Vector2} This Vector2. + * @param angle - The angle, in radians. + * @returns This Vector2. */ - setAngle: function (angle) + setAngle (angle: number): this { return this.setToPolar(angle, this.length()); - }, + } /** * Add a given Vector to this Vector. Addition is component-wise. * - * @method Phaser.Math.Vector2#add * @since 3.0.0 * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector to add to this Vector. - * - * @return {Phaser.Math.Vector2} This Vector2. + * @param src - The Vector to add to this Vector. + * @returns This Vector2. */ - add: function (src) + add (src: Vector2Like): this { this.x += src.x; this.y += src.y; return this; - }, + } /** * Subtract the given Vector from this Vector. Subtraction is component-wise. * - * @method Phaser.Math.Vector2#subtract * @since 3.0.0 * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector to subtract from this Vector. - * - * @return {Phaser.Math.Vector2} This Vector2. + * @param src - The Vector to subtract from this Vector. + * @returns This Vector2. */ - subtract: function (src) + subtract (src: Vector2Like): this { this.x -= src.x; this.y -= src.y; return this; - }, + } /** * Perform a component-wise multiplication between this Vector and the given Vector. * * Multiplies this Vector by the given Vector. * - * @method Phaser.Math.Vector2#multiply * @since 3.0.0 * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector to multiply this Vector by. - * - * @return {Phaser.Math.Vector2} This Vector2. + * @param src - The Vector to multiply this Vector by. + * @returns This Vector2. */ - multiply: function (src) + multiply (src: Vector2Like): this { this.x *= src.x; this.y *= src.y; return this; - }, + } /** * Scale this Vector by the given value. * - * @method Phaser.Math.Vector2#scale * @since 3.0.0 * - * @param {number} value - The value to scale this Vector by. - * - * @return {Phaser.Math.Vector2} This Vector2. + * @param value - The value to scale this Vector by. + * @returns This Vector2. */ - scale: function (value) + scale (value: number): this { if (isFinite(value)) { @@ -371,142 +347,130 @@ var Vector2 = new Class({ } return this; - }, + } /** * Perform a component-wise division between this Vector and the given Vector. * * Divides this Vector by the given Vector. * - * @method Phaser.Math.Vector2#divide * @since 3.0.0 * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector to divide this Vector by. - * - * @return {Phaser.Math.Vector2} This Vector2. + * @param src - The Vector to divide this Vector by. + * @returns This Vector2. */ - divide: function (src) + divide (src: Vector2Like): this { this.x /= src.x; this.y /= src.y; return this; - }, + } /** * Negate the `x` and `y` components of this Vector. * - * @method Phaser.Math.Vector2#negate * @since 3.0.0 * - * @return {Phaser.Math.Vector2} This Vector2. + * @returns This Vector2. */ - negate: function () + negate (): this { this.x = -this.x; this.y = -this.y; return this; - }, + } /** * Calculate the distance between this Vector and the given Vector. * - * @method Phaser.Math.Vector2#distance * @since 3.0.0 * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector to calculate the distance to. - * - * @return {number} The distance from this Vector to the given Vector. + * @param src - The Vector to calculate the distance to. + * @returns The distance from this Vector to the given Vector. */ - distance: function (src) + distance (src: Vector2Like): number { - var dx = src.x - this.x; - var dy = src.y - this.y; + const dx = src.x - this.x; + const dy = src.y - this.y; return Math.sqrt(dx * dx + dy * dy); - }, + } /** * Calculate the distance between this Vector and the given Vector, squared. * - * @method Phaser.Math.Vector2#distanceSq * @since 3.0.0 * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector to calculate the distance to. - * - * @return {number} The distance from this Vector to the given Vector, squared. + * @param src - The Vector to calculate the distance to. + * @returns The distance from this Vector to the given Vector, squared. */ - distanceSq: function (src) + distanceSq (src: Vector2Like): number { - var dx = src.x - this.x; - var dy = src.y - this.y; + const dx = src.x - this.x; + const dy = src.y - this.y; return dx * dx + dy * dy; - }, + } /** * Calculate the length (or magnitude) of this Vector. * - * @method Phaser.Math.Vector2#length * @since 3.0.0 * - * @return {number} The length of this Vector. + * @returns The length of this Vector. */ - length: function () + length (): number { - var x = this.x; - var y = this.y; + const x = this.x; + const y = this.y; return Math.sqrt(x * x + y * y); - }, + } /** * Set the length (or magnitude) of this Vector. * - * @method Phaser.Math.Vector2#setLength * @since 3.23.0 * - * @param {number} length - The new magnitude of this Vector. - * - * @return {Phaser.Math.Vector2} This Vector2. + * @param length - The new magnitude of this Vector. + * @returns This Vector2. */ - setLength: function (length) + setLength (length: number): this { return this.normalize().scale(length); - }, + } /** * Calculate the length of this Vector squared. * - * @method Phaser.Math.Vector2#lengthSq * @since 3.0.0 * - * @return {number} The length of this Vector, squared. + * @returns The length of this Vector, squared. */ - lengthSq: function () + lengthSq (): number { - var x = this.x; - var y = this.y; + const x = this.x; + const y = this.y; return x * x + y * y; - }, + } /** * Normalize this Vector. * * Makes the vector a unit length vector (magnitude of 1) in the same direction. * - * @method Phaser.Math.Vector2#normalize * @since 3.0.0 * - * @return {Phaser.Math.Vector2} This Vector2. + * @returns This Vector2. */ - normalize: function () + normalize (): this { - var x = this.x; - var y = this.y; - var len = x * x + y * y; + const x = this.x; + const y = this.y; + let len = x * x + y * y; if (len > 0) { @@ -517,173 +481,156 @@ var Vector2 = new Class({ } return this; - }, + } /** * Rotate this Vector to its perpendicular, in the positive direction. * - * @method Phaser.Math.Vector2#normalizeRightHand * @since 3.0.0 * - * @return {Phaser.Math.Vector2} This Vector2. + * @returns This Vector2. */ - normalizeRightHand: function () + normalizeRightHand (): this { - var x = this.x; + const x = this.x; this.x = this.y * -1; this.y = x; return this; - }, + } /** * Rotate this Vector to its perpendicular, in the negative direction. * - * @method Phaser.Math.Vector2#normalizeLeftHand * @since 3.23.0 * - * @return {Phaser.Math.Vector2} This Vector2. + * @returns This Vector2. */ - normalizeLeftHand: function () + normalizeLeftHand (): this { - var x = this.x; + const x = this.x; this.x = this.y; this.y = x * -1; return this; - }, + } /** * Calculate the dot product of this Vector and the given Vector. * - * @method Phaser.Math.Vector2#dot * @since 3.0.0 * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector2 to dot product with this Vector2. - * - * @return {number} The dot product of this Vector and the given Vector. + * @param src - The Vector2 to dot product with this Vector2. + * @returns The dot product of this Vector and the given Vector. */ - dot: function (src) + dot (src: Vector2Like): number { return this.x * src.x + this.y * src.y; - }, + } /** * Calculate the cross product of this Vector and the given Vector. * - * @method Phaser.Math.Vector2#cross * @since 3.0.0 * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector2 to cross with this Vector2. - * - * @return {number} The cross product of this Vector and the given Vector. + * @param src - The Vector2 to cross with this Vector2. + * @returns The cross product of this Vector and the given Vector. */ - cross: function (src) + cross (src: Vector2Like): number { return this.x * src.y - this.y * src.x; - }, + } /** * Linearly interpolate between this Vector and the given Vector. * * Interpolates this Vector towards the given Vector. * - * @method Phaser.Math.Vector2#lerp * @since 3.0.0 * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector2 to interpolate towards. - * @param {number} [t=0] - The interpolation percentage, between 0 and 1. - * - * @return {Phaser.Math.Vector2} This Vector2. + * @param src - The Vector2 to interpolate towards. + * @param t - The interpolation percentage, between 0 and 1. + * @returns This Vector2. */ - lerp: function (src, t) + lerp (src: Vector2Like, t: number = 0): this { - if (t === undefined) { t = 0; } - - var ax = this.x; - var ay = this.y; + const ax = this.x; + const ay = this.y; this.x = ax + t * (src.x - ax); this.y = ay + t * (src.y - ay); return this; - }, + } /** * Transform this Vector with the given Matrix3. * - * @method Phaser.Math.Vector2#transformMat3 * @since 3.0.0 * - * @param {Phaser.Math.Matrix3} mat - The Matrix3 to transform this Vector2 with. - * - * @return {Phaser.Math.Vector2} This Vector2. + * @param mat - The Matrix3 to transform this Vector2 with. + * @returns This Vector2. */ - transformMat3: function (mat) + transformMat3 (mat: { val: Float32Array | number[] }): this { - var x = this.x; - var y = this.y; - var m = mat.val; + const x = this.x; + const y = this.y; + const m = mat.val; this.x = m[0] * x + m[3] * y + m[6]; this.y = m[1] * x + m[4] * y + m[7]; return this; - }, + } /** * Transform this Vector with the given Matrix4. * - * @method Phaser.Math.Vector2#transformMat4 * @since 3.0.0 * - * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector2 with. - * - * @return {Phaser.Math.Vector2} This Vector2. + * @param mat - The Matrix4 to transform this Vector2 with. + * @returns This Vector2. */ - transformMat4: function (mat) + transformMat4 (mat: { val: Float32Array | number[] }): this { - var x = this.x; - var y = this.y; - var m = mat.val; + const x = this.x; + const y = this.y; + const m = mat.val; this.x = m[0] * x + m[4] * y + m[12]; this.y = m[1] * x + m[5] * y + m[13]; return this; - }, + } /** * Make this Vector the zero vector (0, 0). * - * @method Phaser.Math.Vector2#reset * @since 3.0.0 * - * @return {Phaser.Math.Vector2} This Vector2. + * @returns This Vector2. */ - reset: function () + reset (): this { this.x = 0; this.y = 0; return this; - }, + } /** * Limit the length (or magnitude) of this Vector. * - * @method Phaser.Math.Vector2#limit * @since 3.23.0 * - * @param {number} max - The maximum length. - * - * @return {Phaser.Math.Vector2} This Vector2. + * @param max - The maximum length. + * @returns This Vector2. */ - limit: function (max) + limit (max: number): this { - var len = this.length(); + const len = this.length(); if (len && len > max) { @@ -691,174 +638,151 @@ var Vector2 = new Class({ } return this; - }, + } /** * Reflect this Vector off a line defined by a normal. * - * @method Phaser.Math.Vector2#reflect * @since 3.23.0 * - * @param {Phaser.Math.Vector2} normal - A vector perpendicular to the line. - * - * @return {Phaser.Math.Vector2} This Vector2. + * @param normal - A vector perpendicular to the line. + * @returns This Vector2. */ - reflect: function (normal) + reflect (normal: Vector2): this { - normal = normal.clone().normalize(); + const n = normal.clone().normalize(); - return this.subtract(normal.scale(2 * this.dot(normal))); - }, + return this.subtract(n.scale(2 * this.dot(n))); + } /** * Reflect this Vector across another. * - * @method Phaser.Math.Vector2#mirror * @since 3.23.0 * - * @param {Phaser.Math.Vector2} axis - A vector to reflect across. - * - * @return {Phaser.Math.Vector2} This Vector2. + * @param axis - A vector to reflect across. + * @returns This Vector2. */ - mirror: function (axis) + mirror (axis: Vector2): this { return this.reflect(axis).negate(); - }, + } /** * Rotate this Vector by an angle amount. * - * @method Phaser.Math.Vector2#rotate * @since 3.23.0 * - * @param {number} delta - The angle to rotate by, in radians. - * - * @return {Phaser.Math.Vector2} This Vector2. + * @param delta - The angle to rotate by, in radians. + * @returns This Vector2. */ - rotate: function (delta) + rotate (delta: number): this { - var cos = Math.cos(delta); - var sin = Math.sin(delta); + const cos = Math.cos(delta); + const sin = Math.sin(delta); return this.set(cos * this.x - sin * this.y, sin * this.x + cos * this.y); - }, + } /** * Project this Vector onto another. * - * @method Phaser.Math.Vector2#project * @since 3.60.0 * - * @param {Phaser.Math.Vector2} src - The vector to project onto. - * - * @return {Phaser.Math.Vector2} This Vector2. + * @param src - The vector to project onto. + * @returns This Vector2. */ - project: function (src) + project (src: Vector2): this { - var scalar = this.dot(src) / src.dot(src); + const scalar = this.dot(src) / src.dot(src); return this.copy(src).scale(scalar); - }, + } /** * Calculates the vector projection of this Vector2 onto the non-zero `vecB`. This is the * orthogonal projection of this vector onto a straight line parallel to `vecB`. * - * @method Phaser.Math.Vector2#projectUnit * @since 4.0.0 * - * @param {Phaser.Math.Vector2} vecB - The vector to project onto. - * @param {Phaser.Math.Vector2} [out] - The Vector2 object to store the position in. If not given, a new Vector2 instance is created. - * - * @return {Phaser.Math.Vector2} The `out` Vector2 containing the projected values. + * @param vecB - The vector to project onto. + * @param out - The Vector2 object to store the position in. If not given, a new Vector2 instance is created. + * @returns The `out` Vector2 containing the projected values. */ - projectUnit: function (vecB, out) + projectUnit (vecB: Vector2, out?: Vector2): Vector2 { if (out === undefined) { out = new Vector2(); } - var amt = ((this.x * vecB.x) + (this.y * vecB.y)); - + const amt = ((this.x * vecB.x) + (this.y * vecB.y)); + if (amt !== 0) { out.x = amt * vecB.x; out.y = amt * vecB.y; } - + return out; } -}); - -/** - * A static zero Vector2 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector2.ZERO - * @type {Phaser.Math.Vector2} - * @since 3.1.0 - */ -Vector2.ZERO = new Vector2(); + /** + * A static zero Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @since 3.1.0 + */ + static readonly ZERO = new Vector2(); -/** - * A static right Vector2 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector2.RIGHT - * @type {Phaser.Math.Vector2} - * @since 3.16.0 - */ -Vector2.RIGHT = new Vector2(1, 0); + /** + * A static right Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @since 3.16.0 + */ + static readonly RIGHT = new Vector2(1, 0); -/** - * A static left Vector2 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector2.LEFT - * @type {Phaser.Math.Vector2} - * @since 3.16.0 - */ -Vector2.LEFT = new Vector2(-1, 0); + /** + * A static left Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @since 3.16.0 + */ + static readonly LEFT = new Vector2(-1, 0); -/** - * A static up Vector2 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector2.UP - * @type {Phaser.Math.Vector2} - * @since 3.16.0 - */ -Vector2.UP = new Vector2(0, -1); + /** + * A static up Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @since 3.16.0 + */ + static readonly UP = new Vector2(0, -1); -/** - * A static down Vector2 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector2.DOWN - * @type {Phaser.Math.Vector2} - * @since 3.16.0 - */ -Vector2.DOWN = new Vector2(0, 1); + /** + * A static down Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @since 3.16.0 + */ + static readonly DOWN = new Vector2(0, 1); -/** - * A static one Vector2 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector2.ONE - * @type {Phaser.Math.Vector2} - * @since 3.16.0 - */ -Vector2.ONE = new Vector2(1, 1); + /** + * A static one Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @since 3.16.0 + */ + static readonly ONE = new Vector2(1, 1); +} -module.exports = Vector2; +export default Vector2; From 02a8ccc01960c0339620ab985c283be5dfc10e62 Mon Sep 17 00:00:00 2001 From: Niklas Engblom Date: Thu, 14 May 2026 07:34:34 +0300 Subject: [PATCH 07/17] Rename Map from js to ts --- src/structs/{Map.js => Map.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/structs/{Map.js => Map.ts} (100%) diff --git a/src/structs/Map.js b/src/structs/Map.ts similarity index 100% rename from src/structs/Map.js rename to src/structs/Map.ts From c22a5302058c66e6272deb5b719a16cc20eb5814 Mon Sep 17 00:00:00 2001 From: Niklas Engblom Date: Thu, 14 May 2026 07:34:34 +0300 Subject: [PATCH 08/17] Convert Structs.Map to TypeScript --- .../webgl/renderNodes/filters/FilterBlend.js | 2 +- src/structs/Map.js | 1 + src/structs/Map.ts | 261 +++++++----------- src/utils/object/TypedObjectUtils.js | 3 + src/utils/object/TypedObjectUtils.ts | 15 + 5 files changed, 117 insertions(+), 165 deletions(-) create mode 100644 src/structs/Map.js create mode 100644 src/utils/object/TypedObjectUtils.js create mode 100644 src/utils/object/TypedObjectUtils.ts diff --git a/src/renderer/webgl/renderNodes/filters/FilterBlend.js b/src/renderer/webgl/renderNodes/filters/FilterBlend.js index 00a472b67d..9da0ad53f5 100644 --- a/src/renderer/webgl/renderNodes/filters/FilterBlend.js +++ b/src/renderer/webgl/renderNodes/filters/FilterBlend.js @@ -4,7 +4,7 @@ * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Map = require('../../../../structs/Map.js'); +var Map = require('../../../../structs/Map'); var Class = require('../../../../utils/Class'); var BlendModes = require('../../../BlendModes'); var BaseFilterShader = require('./BaseFilterShader'); diff --git a/src/structs/Map.js b/src/structs/Map.js new file mode 100644 index 0000000000..0b4acd0d46 --- /dev/null +++ b/src/structs/Map.js @@ -0,0 +1 @@ +module.exports = require('./Map.ts').default; diff --git a/src/structs/Map.ts b/src/structs/Map.ts index 110a37c3fd..39141dbe78 100644 --- a/src/structs/Map.ts +++ b/src/structs/Map.ts @@ -4,22 +4,21 @@ * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Class = require('../utils/Class'); +import { objectKeys } from '../utils/object/TypedObjectUtils.js'; /** - * @callback EachMapCallback + * @param key - The key of the Map entry. + * @param entry - The value of the Map entry. * - * @param {string} key - The key of the Map entry. - * @param {E} entry - The value of the Map entry. - * - * @return {?boolean} The callback result. + * @returns The callback result. */ +type EachMapCallback = (key: K, entry: V) => boolean | void; /** * @classdesc * A custom Map implementation that stores entries as key-value pairs with ordered iteration. - * Unlike a native JavaScript Map, it also maintains an internal array of entries for efficient - * indexed access and iteration. Supports filtering, merging, and contains/size operations. + * Unlike a native JavaScript Map, it also maintains an internal object of entries for efficient + * keyed access and iteration. Supports filtering, merging, and contains/size operations. * Used internally by various Phaser systems for managing collections. * * ```javascript @@ -30,76 +29,60 @@ var Class = require('../utils/Class'); * ]); * ``` * - * @class Map * @memberof Phaser.Structs - * @constructor * @since 3.0.0 - * - * @generic K - * @generic V - * @genericUse {V[]} - [elements] - * - * @param {Array.<*>} elements - An optional array of key-value pairs to populate this Map with. */ -var Map = new Class({ +export class Map +{ + /** + * The entries in this Map. + * + * @default {} + * @since 3.0.0 + */ + entries: Record; - initialize: + /** + * The number of key / value pairs in this Map. + * + * @default 0 + * @since 3.0.0 + */ + size: number; - function Map (elements) + /** + * @param elements - An optional array of key-value pairs to populate this Map with. + */ + constructor (elements?: Array<[K, V]> | null) { - /** - * The entries in this Map. - * - * @genericUse {Object.} - [$type] - * - * @name Phaser.Structs.Map#entries - * @type {Object.} - * @default {} - * @since 3.0.0 - */ - this.entries = {}; - - /** - * The number of key / value pairs in this Map. - * - * @name Phaser.Structs.Map#size - * @type {number} - * @default 0 - * @since 3.0.0 - */ + this.entries = {} as Record; this.size = 0; this.setAll(elements); - }, + } /** * Adds all the elements in the given array to this Map. * * If the key already exists, the value will be replaced. * - * @method Phaser.Structs.Map#setAll * @since 3.70.0 * - * @generic K - * @generic V - * @genericUse {V[]} - [elements] - * - * @param {Array.<*>} elements - An array of key-value pairs to populate this Map with. - * - * @return {this} This Map object. + * @param elements - An array of key-value pairs to populate this Map with. + * @returns This Map object. */ - setAll: function (elements) + setAll (elements?: Array<[K, V]> | null): this { if (Array.isArray(elements)) { - for (var i = 0; i < elements.length; i++) + for (let i = 0; i < elements.length; i++) { this.set(elements[i][0], elements[i][1]); } } return this; - }, + } /** * Adds an element with a specified `key` and `value` to this Map. @@ -108,19 +91,13 @@ var Map = new Class({ * * If you wish to add multiple elements in a single call, use the `setAll` method instead. * - * @method Phaser.Structs.Map#set * @since 3.0.0 * - * @genericUse {K} - [key] - * @genericUse {V} - [value] - * @genericUse {Phaser.Structs.Map.} - [$return] - * - * @param {string} key - The key of the element to be added to this Map. - * @param {*} value - The value of the element to be added to this Map. - * - * @return {this} This Map object. + * @param key - The key of the element to be added to this Map. + * @param value - The value of the element to be added to this Map. + * @returns This Map object. */ - set: function (key, value) + set (key: K, value: V): this { if (!this.has(key)) { @@ -130,83 +107,66 @@ var Map = new Class({ this.entries[key] = value; return this; - }, + } /** * Returns the value associated to the `key`, or `undefined` if there is none. * - * @method Phaser.Structs.Map#get * @since 3.0.0 * - * @genericUse {K} - [key] - * @genericUse {V} - [$return] - * - * @param {string} key - The key of the element to return from the `Map` object. - * - * @return {*} The element associated with the specified key or `undefined` if the key can't be found in this Map object. + * @param key - The key of the element to return from the `Map` object. + * @returns The element associated with the specified key or `undefined` if the key can't be found in this Map object. */ - get: function (key) + get (key: K): V | undefined { if (this.has(key)) { return this.entries[key]; } - }, + } /** * Returns an `Array` of all the values stored in this Map. * - * @method Phaser.Structs.Map#getArray * @since 3.0.0 * - * @genericUse {V[]} - [$return] - * - * @return {Array.<*>} An array of the values stored in this Map. + * @returns An array of the values stored in this Map. */ - getArray: function () + getArray (): V[] { - var output = []; - var entries = this.entries; + const output: V[] = []; + const entries = this.entries; - for (var key in entries) + for (const key of objectKeys(entries)) { output.push(entries[key]); } return output; - }, + } /** * Returns a boolean indicating whether an element with the specified key exists or not. * - * @method Phaser.Structs.Map#has * @since 3.0.0 * - * @genericUse {K} - [key] - * - * @param {string} key - The key of the element to test for presence of in this Map. - * - * @return {boolean} Returns `true` if an element with the specified key exists in this Map, otherwise `false`. + * @param key - The key of the element to test for presence of in this Map. + * @returns Returns `true` if an element with the specified key exists in this Map, otherwise `false`. */ - has: function (key) + has (key: K): boolean { return (this.entries.hasOwnProperty(key)); - }, + } /** * Delete the specified element from this Map. * - * @method Phaser.Structs.Map#delete * @since 3.0.0 * - * @genericUse {K} - [key] - * @genericUse {Phaser.Structs.Map.} - [$return] - * - * @param {string} key - The key of the element to delete from this Map. - * - * @return {this} This Map object. + * @param key - The key of the element to delete from this Map. + * @returns This Map object. */ - delete: function (key) + delete (key: K): this { if (this.has(key)) { @@ -215,111 +175,95 @@ var Map = new Class({ } return this; - }, + } /** * Delete all entries from this Map. * - * @method Phaser.Structs.Map#clear * @since 3.0.0 * - * @genericUse {Phaser.Structs.Map.} - [$return] - * - * @return {this} This Map object. + * @returns This Map object. */ - clear: function () + clear (): this { - Object.keys(this.entries).forEach(function (prop) + for (const prop of objectKeys(this.entries)) { delete this.entries[prop]; - - }, this); + } this.size = 0; return this; - }, + } /** * Returns an array of all entry keys in this Map. * - * @method Phaser.Structs.Map#keys * @since 3.0.0 * - * @genericUse {K[]} - [$return] - * - * @return {string[]} Array containing entries' keys. + * @returns Array containing entries' keys. */ - keys: function () + keys (): K[] { - return Object.keys(this.entries); - }, + return objectKeys(this.entries); + } /** * Returns an `Array` of all values stored in this Map. * - * @method Phaser.Structs.Map#values * @since 3.0.0 * - * @genericUse {V[]} - [$return] - * - * @return {Array.<*>} An `Array` of values. + * @returns An `Array` of values. */ - values: function () + values (): V[] { - var output = []; - var entries = this.entries; + const output: V[] = []; + const entries = this.entries; - for (var key in entries) + for (const key of objectKeys(entries)) { output.push(entries[key]); } return output; - }, + } /** * Dumps the contents of this Map to the console via `console.group`. * - * @method Phaser.Structs.Map#dump * @since 3.0.0 */ - dump: function () + dump (): void { - var entries = this.entries; + const entries = this.entries; // eslint-disable-next-line no-console console.group('Map'); - for (var key in entries) + for (const key of objectKeys(entries)) { console.log(key, entries[key]); } // eslint-disable-next-line no-console console.groupEnd(); - }, + } /** * Iterates through all entries in this Map, passing each one to the given callback. * * If the callback returns `false`, the iteration will break. * - * @method Phaser.Structs.Map#each * @since 3.0.0 * - * @genericUse {EachMapCallback.} - [callback] - * @genericUse {Phaser.Structs.Map.} - [$return] - * - * @param {EachMapCallback} callback - The callback which will receive the keys and entries held in this Map. - * - * @return {this} This Map object. + * @param callback - The callback which will receive the keys and entries held in this Map. + * @returns This Map object. */ - each: function (callback) + each (callback: EachMapCallback): this { - var entries = this.entries; + const entries = this.entries; - for (var key in entries) + for (const key of objectKeys(entries)) { if (callback(key, entries[key]) === false) { @@ -328,25 +272,21 @@ var Map = new Class({ } return this; - }, + } /** * Returns `true` if the value exists within this Map. Otherwise, returns `false`. * - * @method Phaser.Structs.Map#contains * @since 3.0.0 * - * @genericUse {V} - [value] - * - * @param {*} value - The value to search for. - * - * @return {boolean} `true` if the value is found, otherwise `false`. + * @param value - The value to search for. + * @returns `true` if the value is found, otherwise `false`. */ - contains: function (value) + contains (value: V): boolean { - var entries = this.entries; + const entries = this.entries; - for (var key in entries) + for (const key of objectKeys(entries)) { if (entries[key] === value) { @@ -355,30 +295,24 @@ var Map = new Class({ } return false; - }, + } /** * Merges all new keys from the given Map into this one. * If it encounters a key that already exists it will be skipped unless override is set to `true`. * - * @method Phaser.Structs.Map#merge * @since 3.0.0 * - * @genericUse {Phaser.Structs.Map.} - [map,$return] - * - * @param {Phaser.Structs.Map} map - The Map to merge in to this Map. - * @param {boolean} [override=false] - Set to `true` to replace values in this Map with those from the source map, or `false` to skip them. - * - * @return {this} This Map object. + * @param map - The Map to merge in to this Map. + * @param override - Set to `true` to replace values in this Map with those from the source map, or `false` to skip them. + * @returns This Map object. */ - merge: function (map, override) + merge (map: Map, override: boolean = false): this { - if (override === undefined) { override = false; } - - var local = this.entries; - var source = map.entries; + const local = this.entries; + const source = map.entries; - for (var key in source) + for (const key of objectKeys(source)) { if (local.hasOwnProperty(key) && override) { @@ -392,7 +326,6 @@ var Map = new Class({ return this; } +} -}); - -module.exports = Map; +export default Map; diff --git a/src/utils/object/TypedObjectUtils.js b/src/utils/object/TypedObjectUtils.js new file mode 100644 index 0000000000..06f7e32763 --- /dev/null +++ b/src/utils/object/TypedObjectUtils.js @@ -0,0 +1,3 @@ +const mod = require('./TypedObjectUtils.ts'); +module.exports = mod; +module.exports.objectKeys = mod.objectKeys; diff --git a/src/utils/object/TypedObjectUtils.ts b/src/utils/object/TypedObjectUtils.ts new file mode 100644 index 0000000000..9164e9a714 --- /dev/null +++ b/src/utils/object/TypedObjectUtils.ts @@ -0,0 +1,15 @@ +/** + * Type-safe wrapper around `Object.keys()` that preserves the key type. + * + * The built-in `Object.keys()` always returns `string[]`, which loses + * generic key information. This helper returns `K[]` instead, making it + * safe to use the result to index back into the same record without casts. + * + * + * @param obj - The object whose own enumerable property names to retrieve. + * @returns An array of the object's own enumerable property names, typed as `K[]`. + */ +export function objectKeys (obj: Record): K[] +{ + return Object.keys(obj) as K[]; +} From 2517190a20563f0134f0fe69e3b1cf9b12fbdd5a Mon Sep 17 00:00:00 2001 From: Niklas Engblom Date: Thu, 14 May 2026 07:34:36 +0300 Subject: [PATCH 09/17] Rename Contains, Rectangle from js to ts --- src/geom/rectangle/{Contains.js => Contains.ts} | 0 src/geom/rectangle/{Rectangle.js => Rectangle.ts} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename src/geom/rectangle/{Contains.js => Contains.ts} (100%) rename src/geom/rectangle/{Rectangle.js => Rectangle.ts} (100%) diff --git a/src/geom/rectangle/Contains.js b/src/geom/rectangle/Contains.ts similarity index 100% rename from src/geom/rectangle/Contains.js rename to src/geom/rectangle/Contains.ts diff --git a/src/geom/rectangle/Rectangle.js b/src/geom/rectangle/Rectangle.ts similarity index 100% rename from src/geom/rectangle/Rectangle.js rename to src/geom/rectangle/Rectangle.ts From f9db019786712c9ee8ddaac29daade16d8f33af7 Mon Sep 17 00:00:00 2001 From: Niklas Engblom Date: Thu, 14 May 2026 07:34:36 +0300 Subject: [PATCH 10/17] Convert Rectangle and Rectangle.Contains to TypeScript --- src/geom/rectangle/Contains.js | 3 + src/geom/rectangle/Contains.ts | 16 +- src/geom/rectangle/Rectangle.js | 3 + src/geom/rectangle/Rectangle.ts | 501 ++++++++++++++------------------ 4 files changed, 236 insertions(+), 287 deletions(-) create mode 100644 src/geom/rectangle/Contains.js create mode 100644 src/geom/rectangle/Rectangle.js diff --git a/src/geom/rectangle/Contains.js b/src/geom/rectangle/Contains.js new file mode 100644 index 0000000000..352337f6fb --- /dev/null +++ b/src/geom/rectangle/Contains.js @@ -0,0 +1,3 @@ +const mod = require('./Contains.ts'); +module.exports = mod.default; +module.exports.Contains = mod.Contains; diff --git a/src/geom/rectangle/Contains.ts b/src/geom/rectangle/Contains.ts index cbb0acb719..984264499b 100644 --- a/src/geom/rectangle/Contains.ts +++ b/src/geom/rectangle/Contains.ts @@ -4,19 +4,21 @@ * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +import type { Rectangle } from './Rectangle'; + /** * Checks if a given point is inside a Rectangle's bounds. * * @function Phaser.Geom.Rectangle.Contains * @since 3.0.0 * - * @param {Phaser.Geom.Rectangle} rect - The Rectangle to check. - * @param {number} x - The X coordinate of the point to check. - * @param {number} y - The Y coordinate of the point to check. + * @param rect - The Rectangle to check. + * @param x - The X coordinate of the point to check. + * @param y - The Y coordinate of the point to check. * - * @return {boolean} `true` if the point is within the Rectangle's bounds, otherwise `false`. + * @returns `true` if the point is within the Rectangle's bounds, otherwise `false`. */ -var Contains = function (rect, x, y) +export function Contains (rect: Rectangle, x: number, y: number): boolean { if (rect.width <= 0 || rect.height <= 0) { @@ -24,6 +26,6 @@ var Contains = function (rect, x, y) } return (rect.x <= x && rect.x + rect.width >= x && rect.y <= y && rect.y + rect.height >= y); -}; +} -module.exports = Contains; +export default Contains; diff --git a/src/geom/rectangle/Rectangle.js b/src/geom/rectangle/Rectangle.js new file mode 100644 index 0000000000..91e5ca3be9 --- /dev/null +++ b/src/geom/rectangle/Rectangle.js @@ -0,0 +1,3 @@ +const mod = require('./Rectangle.ts'); +module.exports = mod.default; +module.exports.Rectangle = mod.Rectangle; diff --git a/src/geom/rectangle/Rectangle.ts b/src/geom/rectangle/Rectangle.ts index 4d210a70b7..60eebc8fee 100644 --- a/src/geom/rectangle/Rectangle.ts +++ b/src/geom/rectangle/Rectangle.ts @@ -4,13 +4,13 @@ * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Class = require('../../utils/Class'); -var Contains = require('./Contains'); -var GetPoint = require('./GetPoint'); -var GetPoints = require('./GetPoints'); -var GEOM_CONST = require('../const'); -var Line = require('../line/Line'); -var Random = require('./Random'); +import Contains from './Contains.js'; +import GetPoint from './GetPoint.js'; +import GetPoints from './GetPoints.js'; +import GEOM_CONST from '../const.js'; +import Line from '../line/Line.js'; +import Random from './Random.js'; +import type { Vector2 } from '../../math/Vector2'; /** * @classdesc @@ -23,167 +23,149 @@ var Random = require('./Random'); * properties provide convenient access to derived positional values and can be set directly to reposition or * resize the Rectangle. * - * @class Rectangle * @memberof Phaser.Geom - * @constructor * @since 3.0.0 - * - * @param {number} [x=0] - The X coordinate of the top left corner of the Rectangle. - * @param {number} [y=0] - The Y coordinate of the top left corner of the Rectangle. - * @param {number} [width=0] - The width of the Rectangle. - * @param {number} [height=0] - The height of the Rectangle. */ -var Rectangle = new Class({ +export class Rectangle +{ + /** + * The geometry constant type of this object: `GEOM_CONST.RECTANGLE`. + * Used for fast type comparisons. + * + * @readonly + * @since 3.19.0 + */ + readonly type: number; + + /** + * The X coordinate of the top left corner of the Rectangle. + * + * @default 0 + * @since 3.0.0 + */ + x: number; + + /** + * The Y coordinate of the top left corner of the Rectangle. + * + * @default 0 + * @since 3.0.0 + */ + y: number; + + /** + * The width of the Rectangle, i.e. the distance between its left side (defined by `x`) and its right side. + * + * @default 0 + * @since 3.0.0 + */ + width: number; - initialize: + /** + * The height of the Rectangle, i.e. the distance between its top side (defined by `y`) and its bottom side. + * + * @default 0 + * @since 3.0.0 + */ + height: number; - function Rectangle (x, y, width, height) + /** + * @param x - The X coordinate of the top left corner of the Rectangle. + * @param y - The Y coordinate of the top left corner of the Rectangle. + * @param width - The width of the Rectangle. + * @param height - The height of the Rectangle. + */ + constructor (x: number = 0, y: number = 0, width: number = 0, height: number = 0) { - if (x === undefined) { x = 0; } - if (y === undefined) { y = 0; } - if (width === undefined) { width = 0; } - if (height === undefined) { height = 0; } - - /** - * The geometry constant type of this object: `GEOM_CONST.RECTANGLE`. - * Used for fast type comparisons. - * - * @name Phaser.Geom.Rectangle#type - * @type {number} - * @readonly - * @since 3.19.0 - */ this.type = GEOM_CONST.RECTANGLE; - - /** - * The X coordinate of the top left corner of the Rectangle. - * - * @name Phaser.Geom.Rectangle#x - * @type {number} - * @default 0 - * @since 3.0.0 - */ this.x = x; - - /** - * The Y coordinate of the top left corner of the Rectangle. - * - * @name Phaser.Geom.Rectangle#y - * @type {number} - * @default 0 - * @since 3.0.0 - */ this.y = y; - - /** - * The width of the Rectangle, i.e. the distance between its left side (defined by `x`) and its right side. - * - * @name Phaser.Geom.Rectangle#width - * @type {number} - * @default 0 - * @since 3.0.0 - */ this.width = width; - - /** - * The height of the Rectangle, i.e. the distance between its top side (defined by `y`) and its bottom side. - * - * @name Phaser.Geom.Rectangle#height - * @type {number} - * @default 0 - * @since 3.0.0 - */ this.height = height; - }, + } /** * Checks if the given point is inside the Rectangle's bounds. * - * @method Phaser.Geom.Rectangle#contains * @since 3.0.0 * - * @param {number} x - The X coordinate of the point to check. - * @param {number} y - The Y coordinate of the point to check. + * @param x - The X coordinate of the point to check. + * @param y - The Y coordinate of the point to check. * - * @return {boolean} `true` if the point is within the Rectangle's bounds, otherwise `false`. + * @returns `true` if the point is within the Rectangle's bounds, otherwise `false`. */ - contains: function (x, y) + contains (x: number, y: number): boolean { return Contains(this, x, y); - }, + } /** * Calculates the coordinates of a point at a certain `position` on the Rectangle's perimeter. * * The `position` is a fraction between 0 and 1 which defines how far into the perimeter the point is. * - * A value of 0 or 1 returns the point at the top left corner of the rectangle, while a value of 0.5 returns the point at the bottom right corner of the rectangle. Values between 0 and 0.5 are on the top or the right side and values between 0.5 and 1 are on the bottom or the left side. + * A value of 0 or 1 returns the point at the top left corner of the rectangle, while a value of 0.5 + * returns the point at the bottom right corner of the rectangle. Values between 0 and 0.5 are on the + * top or the right side and values between 0.5 and 1 are on the bottom or the left side. * - * @method Phaser.Geom.Rectangle#getPoint * @since 3.0.0 * - * @generic {Phaser.Math.Vector2} O - [output,$return] - * - * @param {number} position - The normalized distance into the Rectangle's perimeter to return. - * @param {Phaser.Math.Vector2} [output] - A Vector2 instance to update with the `x` and `y` coordinates of the point. + * @param position - The normalized distance into the Rectangle's perimeter to return. + * @param output - A Vector2 instance to update with the `x` and `y` coordinates of the point. * - * @return {Phaser.Math.Vector2} The updated `output` object, or a new Vector2 if no `output` object was given. + * @returns The updated `output` object, or a new Vector2 if no `output` object was given. */ - getPoint: function (position, output) + getPoint (position: number, output?: O): O { - return GetPoint(this, position, output); - }, + return GetPoint(this, position, output) as O; + } /** - * Returns an array of points from the perimeter of the Rectangle, each spaced out based on the quantity or step required. + * Returns an array of points from the perimeter of the Rectangle, each spaced out based + * on the quantity or step required. * - * @method Phaser.Geom.Rectangle#getPoints * @since 3.0.0 * - * @generic {Phaser.Math.Vector2[]} O - [output,$return] + * @param quantity - The number of points to return. Set to `false` or 0 to return an arbitrary + * number of points (`perimeter / stepRate`) evenly spaced around the Rectangle based on the `stepRate`. + * @param stepRate - If `quantity` is 0, determines the normalized distance between each returned point. + * @param output - An array to which to append the points. * - * @param {number} quantity - The number of points to return. Set to `false` or 0 to return an arbitrary number of points (`perimeter / stepRate`) evenly spaced around the Rectangle based on the `stepRate`. - * @param {number} [stepRate] - If `quantity` is 0, determines the normalized distance between each returned point. - * @param {Phaser.Math.Vector2[]} [output] - An array to which to append the points. - * - * @return {Phaser.Math.Vector2[]} The modified `output` array, or a new array if none was provided. + * @returns The modified `output` array, or a new array if none was provided. */ - getPoints: function (quantity, stepRate, output) + getPoints (quantity: number | false, stepRate?: number, output?: O): O { - return GetPoints(this, quantity, stepRate, output); - }, + // @ts-expect-error - JS GetPoints handles undefined stepRate despite its JSDoc signature + return GetPoints(this, quantity, stepRate, output) as O; + } /** * Returns a random point within the Rectangle's bounds. * - * @method Phaser.Geom.Rectangle#getRandomPoint * @since 3.0.0 * - * @generic {Phaser.Math.Vector2} O - [point,$return] - * - * @param {Phaser.Math.Vector2} [vec] - The object in which to store the `x` and `y` coordinates of the point. + * @param vec - The object in which to store the `x` and `y` coordinates of the point. * - * @return {Phaser.Math.Vector2} The updated `vec`, or a new Vector2 if none was provided. + * @returns The updated `vec`, or a new Vector2 if none was provided. */ - getRandomPoint: function (vec) + getRandomPoint (vec?: O): O { - return Random(this, vec); - }, + return Random(this, vec) as O; + } /** * Sets the position, width, and height of the Rectangle. * - * @method Phaser.Geom.Rectangle#setTo * @since 3.0.0 * - * @param {number} x - The X coordinate of the top left corner of the Rectangle. - * @param {number} y - The Y coordinate of the top left corner of the Rectangle. - * @param {number} width - The width of the Rectangle. - * @param {number} height - The height of the Rectangle. + * @param x - The X coordinate of the top left corner of the Rectangle. + * @param y - The Y coordinate of the top left corner of the Rectangle. + * @param width - The width of the Rectangle. + * @param height - The height of the Rectangle. * - * @return {this} This Rectangle object. + * @returns This Rectangle object. */ - setTo: function (x, y, width, height) + setTo (x: number, y: number, width: number, height: number): this { this.x = x; this.y = y; @@ -191,33 +173,31 @@ var Rectangle = new Class({ this.height = height; return this; - }, + } /** * Resets the position, width, and height of the Rectangle to 0. * - * @method Phaser.Geom.Rectangle#setEmpty * @since 3.0.0 * - * @return {this} This Rectangle object. + * @returns This Rectangle object. */ - setEmpty: function () + setEmpty (): this { return this.setTo(0, 0, 0, 0); - }, + } /** * Sets the position of the Rectangle. * - * @method Phaser.Geom.Rectangle#setPosition * @since 3.0.0 * - * @param {number} x - The X coordinate of the top left corner of the Rectangle. - * @param {number} [y=x] - The Y coordinate of the top left corner of the Rectangle. + * @param x - The X coordinate of the top left corner of the Rectangle. + * @param y - The Y coordinate of the top left corner of the Rectangle. * - * @return {this} This Rectangle object. + * @returns This Rectangle object. */ - setPosition: function (x, y) + setPosition (x: number, y?: number): this { if (y === undefined) { y = x; } @@ -225,20 +205,19 @@ var Rectangle = new Class({ this.y = y; return this; - }, + } /** * Sets the width and height of the Rectangle. * - * @method Phaser.Geom.Rectangle#setSize * @since 3.0.0 * - * @param {number} width - The width to set the Rectangle to. - * @param {number} [height=width] - The height to set the Rectangle to. + * @param width - The width to set the Rectangle to. + * @param height - The height to set the Rectangle to. * - * @return {this} This Rectangle object. + * @returns This Rectangle object. */ - setSize: function (width, height) + setSize (width: number, height?: number): this { if (height === undefined) { height = width; } @@ -246,267 +225,229 @@ var Rectangle = new Class({ this.height = height; return this; - }, + } /** * Determines if the Rectangle is empty. A Rectangle is empty if its width or height is less than or equal to 0. * - * @method Phaser.Geom.Rectangle#isEmpty * @since 3.0.0 * - * @return {boolean} `true` if the Rectangle is empty, otherwise `false`. + * @returns `true` if the Rectangle is empty, otherwise `false`. */ - isEmpty: function () + isEmpty (): boolean { return (this.width <= 0 || this.height <= 0); - }, + } /** * Returns a Line object that corresponds to the top of this Rectangle. * - * @method Phaser.Geom.Rectangle#getLineA * @since 3.0.0 * - * @generic {Phaser.Geom.Line} O - [line,$return] + * @param line - A Line object to set the results in. If `undefined` a new Line will be created. * - * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. - * - * @return {Phaser.Geom.Line} A Line object that corresponds to the top of this Rectangle. + * @returns A Line object that corresponds to the top of this Rectangle. */ - getLineA: function (line) + // @ts-expect-error - Line is a JS Class() factory value, not a TypeScript type + getLineA (line?: O): O { - if (line === undefined) { line = new Line(); } + // @ts-expect-error - Class() factory is not seen as constructable by TypeScript + if (line === undefined) { line = new Line() as O; } - line.setTo(this.x, this.y, this.right, this.y); + line!.setTo(this.x, this.y, this.right, this.y); - return line; - }, + return line!; + } /** * Returns a Line object that corresponds to the right of this Rectangle. * - * @method Phaser.Geom.Rectangle#getLineB * @since 3.0.0 * - * @generic {Phaser.Geom.Line} O - [line,$return] - * - * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. + * @param line - A Line object to set the results in. If `undefined` a new Line will be created. * - * @return {Phaser.Geom.Line} A Line object that corresponds to the right of this Rectangle. + * @returns A Line object that corresponds to the right of this Rectangle. */ - getLineB: function (line) + // @ts-expect-error - Line is a JS Class() factory value, not a TypeScript type + getLineB (line?: O): O { - if (line === undefined) { line = new Line(); } + // @ts-expect-error - Class() factory is not seen as constructable by TypeScript + if (line === undefined) { line = new Line() as O; } - line.setTo(this.right, this.y, this.right, this.bottom); + line!.setTo(this.right, this.y, this.right, this.bottom); - return line; - }, + return line!; + } /** * Returns a Line object that corresponds to the bottom of this Rectangle. * - * @method Phaser.Geom.Rectangle#getLineC * @since 3.0.0 * - * @generic {Phaser.Geom.Line} O - [line,$return] - * - * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. + * @param line - A Line object to set the results in. If `undefined` a new Line will be created. * - * @return {Phaser.Geom.Line} A Line object that corresponds to the bottom of this Rectangle. + * @returns A Line object that corresponds to the bottom of this Rectangle. */ - getLineC: function (line) + // @ts-expect-error - Line is a JS Class() factory value, not a TypeScript type + getLineC (line?: O): O { - if (line === undefined) { line = new Line(); } + // @ts-expect-error - Class() factory is not seen as constructable by TypeScript + if (line === undefined) { line = new Line() as O; } - line.setTo(this.right, this.bottom, this.x, this.bottom); + line!.setTo(this.right, this.bottom, this.x, this.bottom); - return line; - }, + return line!; + } /** * Returns a Line object that corresponds to the left of this Rectangle. * - * @method Phaser.Geom.Rectangle#getLineD * @since 3.0.0 * - * @generic {Phaser.Geom.Line} O - [line,$return] - * - * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. + * @param line - A Line object to set the results in. If `undefined` a new Line will be created. * - * @return {Phaser.Geom.Line} A Line object that corresponds to the left of this Rectangle. + * @returns A Line object that corresponds to the left of this Rectangle. */ - getLineD: function (line) + // @ts-expect-error - Line is a JS Class() factory value, not a TypeScript type + getLineD (line?: O): O { - if (line === undefined) { line = new Line(); } + // @ts-expect-error - Class() factory is not seen as constructable by TypeScript + if (line === undefined) { line = new Line() as O; } - line.setTo(this.x, this.bottom, this.x, this.y); + line!.setTo(this.x, this.bottom, this.x, this.y); - return line; - }, + return line!; + } /** * The x coordinate of the left of the Rectangle. - * Changing the left property of a Rectangle object has no effect on the y and height properties. However it does affect the width property, whereas changing the x value does not affect the width property. + * Changing the left property of a Rectangle object has no effect on the y and height properties. + * However it does affect the width property, whereas changing the x value does not affect the width property. * - * @name Phaser.Geom.Rectangle#left - * @type {number} * @since 3.0.0 */ - left: { + get left (): number + { + return this.x; + } - get: function () + set left (value: number) + { + if (value >= this.right) { - return this.x; - }, - - set: function (value) + this.width = 0; + } + else { - if (value >= this.right) - { - this.width = 0; - } - else - { - this.width = this.right - value; - } - - this.x = value; + this.width = this.right - value; } - }, + this.x = value; + } /** * The sum of the x and width properties. - * Changing the right property of a Rectangle object has no effect on the x, y and height properties, however it does affect the width property. + * Changing the right property of a Rectangle object has no effect on the x, y and height properties, + * however it does affect the width property. * - * @name Phaser.Geom.Rectangle#right - * @type {number} * @since 3.0.0 */ - right: { + get right (): number + { + return this.x + this.width; + } - get: function () + set right (value: number) + { + if (value <= this.x) { - return this.x + this.width; - }, - - set: function (value) + this.width = 0; + } + else { - if (value <= this.x) - { - this.width = 0; - } - else - { - this.width = value - this.x; - } + this.width = value - this.x; } - - }, + } /** - * The y coordinate of the top of the Rectangle. Changing the top property of a Rectangle object has no effect on the x and width properties. - * However it does affect the height property, whereas changing the y value does not affect the height property. + * The y coordinate of the top of the Rectangle. Changing the top property of a Rectangle object has no + * effect on the x and width properties. However it does affect the height property, whereas changing + * the y value does not affect the height property. * - * @name Phaser.Geom.Rectangle#top - * @type {number} * @since 3.0.0 */ - top: { + get top (): number + { + return this.y; + } - get: function () + set top (value: number) + { + if (value >= this.bottom) { - return this.y; - }, - - set: function (value) + this.height = 0; + } + else { - if (value >= this.bottom) - { - this.height = 0; - } - else - { - this.height = (this.bottom - value); - } - - this.y = value; + this.height = (this.bottom - value); } - }, + this.y = value; + } /** * The sum of the y and height properties. - * Changing the bottom property of a Rectangle object has no effect on the x, y and width properties, but does change the height property. + * Changing the bottom property of a Rectangle object has no effect on the x, y and width properties, + * but does change the height property. * - * @name Phaser.Geom.Rectangle#bottom - * @type {number} * @since 3.0.0 */ - bottom: { + get bottom (): number + { + return this.y + this.height; + } - get: function () + set bottom (value: number) + { + if (value <= this.y) { - return this.y + this.height; - }, - - set: function (value) + this.height = 0; + } + else { - if (value <= this.y) - { - this.height = 0; - } - else - { - this.height = value - this.y; - } + this.height = value - this.y; } - - }, + } /** * The x coordinate of the center of the Rectangle. * - * @name Phaser.Geom.Rectangle#centerX - * @type {number} * @since 3.0.0 */ - centerX: { - - get: function () - { - return this.x + (this.width / 2); - }, - - set: function (value) - { - this.x = value - (this.width / 2); - } + get centerX (): number + { + return this.x + (this.width / 2); + } - }, + set centerX (value: number) + { + this.x = value - (this.width / 2); + } /** * The y coordinate of the center of the Rectangle. * - * @name Phaser.Geom.Rectangle#centerY - * @type {number} * @since 3.0.0 */ - centerY: { - - get: function () - { - return this.y + (this.height / 2); - }, - - set: function (value) - { - this.y = value - (this.height / 2); - } - + get centerY (): number + { + return this.y + (this.height / 2); } -}); + set centerY (value: number) + { + this.y = value - (this.height / 2); + } +} -module.exports = Rectangle; +export default Rectangle; From 2d1ff2ad86e8c39214fb2d3d8ea40287d32c0053 Mon Sep 17 00:00:00 2001 From: Niklas Engblom Date: Thu, 14 May 2026 07:34:39 +0300 Subject: [PATCH 11/17] Rename NineSliceVertex from js to ts --- .../nineslice/{NineSliceVertex.js => NineSliceVertex.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/gameobjects/nineslice/{NineSliceVertex.js => NineSliceVertex.ts} (100%) diff --git a/src/gameobjects/nineslice/NineSliceVertex.js b/src/gameobjects/nineslice/NineSliceVertex.ts similarity index 100% rename from src/gameobjects/nineslice/NineSliceVertex.js rename to src/gameobjects/nineslice/NineSliceVertex.ts From 7164b2cb2bdd779cff3d1e44ad9c55e170ec759f Mon Sep 17 00:00:00 2001 From: Niklas Engblom Date: Thu, 14 May 2026 07:34:39 +0300 Subject: [PATCH 12/17] Convert NineSliceVertex to TypeScript --- src/gameobjects/nineslice/NineSliceVertex.js | 1 + src/gameobjects/nineslice/NineSliceVertex.ts | 116 +++++++++---------- 2 files changed, 53 insertions(+), 64 deletions(-) create mode 100644 src/gameobjects/nineslice/NineSliceVertex.js diff --git a/src/gameobjects/nineslice/NineSliceVertex.js b/src/gameobjects/nineslice/NineSliceVertex.js new file mode 100644 index 0000000000..cd47d1f520 --- /dev/null +++ b/src/gameobjects/nineslice/NineSliceVertex.js @@ -0,0 +1 @@ +module.exports = require('./NineSliceVertex.ts').default; diff --git a/src/gameobjects/nineslice/NineSliceVertex.ts b/src/gameobjects/nineslice/NineSliceVertex.ts index 505eef0a7a..460f211635 100644 --- a/src/gameobjects/nineslice/NineSliceVertex.ts +++ b/src/gameobjects/nineslice/NineSliceVertex.ts @@ -4,8 +4,7 @@ * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Class = require('../../utils/Class'); -var Vector2 = require('../../math/Vector2'); +import Vector2 from '../../math/Vector2.js'; /** * @classdesc @@ -19,82 +18,72 @@ var Vector2 = require('../../math/Vector2'); * You do not typically create NineSliceVertex instances directly. They are created and * managed internally by the NineSlice Game Object. * - * @class NineSliceVertex * @memberof Phaser.GameObjects - * @constructor - * @extends Phaser.Math.Vector2 * @since 4.0.0 - * - * @param {number} x - The x position of the vertex. - * @param {number} y - The y position of the vertex. - * @param {number} u - The UV u coordinate of the vertex. - * @param {number} v - The UV v coordinate of the vertex. */ -var Vertex = new Class({ +export class NineSliceVertex extends Vector2 +{ + /** + * The projected x coordinate of this vertex. + * + * @since 4.0.0 + */ + vx: number; - Extends: Vector2, + /** + * The projected y coordinate of this vertex. + * + * @since 4.0.0 + */ + vy: number; - initialize: + /** + * UV u coordinate of this vertex. + * + * @since 4.0.0 + */ + u: number; - function Vertex (x, y, u, v) + /** + * UV v coordinate of this vertex. + * + * @since 4.0.0 + */ + v: number; + + /** + * @param x - The x position of the vertex. + * @param y - The y position of the vertex. + * @param u - The UV u coordinate of the vertex. + * @param v - The UV v coordinate of the vertex. + */ + constructor (x: number, y: number, u: number, v: number) { - Vector2.call(this, x, y); + super(x, y); - /** - * The projected x coordinate of this vertex. - * - * @name Phaser.GameObjects.NineSliceVertex#vx - * @type {number} - * @since 4.0.0 - */ this.vx = 0; - - /** - * The projected y coordinate of this vertex. - * - * @name Phaser.GameObjects.NineSliceVertex#vy - * @type {number} - * @since 4.0.0 - */ this.vy = 0; - - /** - * UV u coordinate of this vertex. - * - * @name Phaser.GameObjects.NineSliceVertex#u - * @type {number} - * @since 4.0.0 - */ this.u = u; - - /** - * UV v coordinate of this vertex. - * - * @name Phaser.GameObjects.NineSliceVertex#v - * @type {number} - * @since 4.0.0 - */ this.v = v; - }, + } /** * Sets the UV texture coordinates of this vertex. * - * @method Phaser.GameObjects.NineSliceVertex#setUVs * @since 4.0.0 * - * @param {number} u - The UV u coordinate of the vertex. - * @param {number} v - The UV v coordinate of the vertex. + * @param u - The UV u coordinate of the vertex. + * @param v - The UV v coordinate of the vertex. * - * @return {this} This Vertex. + * @return This Vertex. */ - setUVs: function (u, v) + setUVs (u: number, v: number): this { this.u = u; this.v = v; return this; - }, + } /** * Updates this vertex's position and calculates its projected screen-space coordinates. @@ -104,19 +93,18 @@ var Vertex = new Class({ * offset of the parent object is then factored in, shifting `vx` and `vy` so that the * mesh is correctly aligned relative to the object's origin point. * - * @method Phaser.GameObjects.NineSliceVertex#resize * @since 4.0.0 * - * @param {number} x - The x position of the vertex. - * @param {number} y - The y position of the vertex. - * @param {number} width - The width of the parent object. - * @param {number} height - The height of the parent object. - * @param {number} originX - The originX of the parent object. - * @param {number} originY - The originY of the parent object. + * @param x - The x position of the vertex. + * @param y - The y position of the vertex. + * @param width - The width of the parent object. + * @param height - The height of the parent object. + * @param originX - The originX of the parent object. + * @param originY - The originY of the parent object. * - * @return {this} This Vertex. + * @return This Vertex. */ - resize: function (x, y, width, height, originX, originY) + resize (x: number, y: number, width: number, height: number, originX: number, originY: number): this { this.x = x; this.y = y; @@ -144,6 +132,6 @@ var Vertex = new Class({ return this; } -}); +} -module.exports = Vertex; +export default NineSliceVertex; From 9c19e9574402a41f84fac67906b11846396208eb Mon Sep 17 00:00:00 2001 From: Niklas Engblom Date: Sat, 16 May 2026 14:04:05 +0300 Subject: [PATCH 13/17] Rename Zone, Depth, Visible from js to ts --- src/gameobjects/components/{Depth.js => Depth.ts} | 0 src/gameobjects/components/{Visible.js => Visible.ts} | 0 src/gameobjects/zone/{Zone.js => Zone.ts} | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename src/gameobjects/components/{Depth.js => Depth.ts} (100%) rename src/gameobjects/components/{Visible.js => Visible.ts} (100%) rename src/gameobjects/zone/{Zone.js => Zone.ts} (100%) diff --git a/src/gameobjects/components/Depth.js b/src/gameobjects/components/Depth.ts similarity index 100% rename from src/gameobjects/components/Depth.js rename to src/gameobjects/components/Depth.ts diff --git a/src/gameobjects/components/Visible.js b/src/gameobjects/components/Visible.ts similarity index 100% rename from src/gameobjects/components/Visible.js rename to src/gameobjects/components/Visible.ts diff --git a/src/gameobjects/zone/Zone.js b/src/gameobjects/zone/Zone.ts similarity index 100% rename from src/gameobjects/zone/Zone.js rename to src/gameobjects/zone/Zone.ts From 3350ae72828e3360a9639fa5badaf1fa1c932abd Mon Sep 17 00:00:00 2001 From: Niklas Engblom Date: Sat, 16 May 2026 15:36:12 +0300 Subject: [PATCH 14/17] Convert Zone, Depth, Visible to TypeScript --- eslint.config.mjs | 2 +- src/gameobjects/components/Depth.js | 11 ++ src/gameobjects/components/Depth.ts | 236 +++++++++++++--------- src/gameobjects/components/Visible.js | 11 ++ src/gameobjects/components/Visible.ts | 98 ++++++--- src/gameobjects/components/index.d.ts | 50 +++++ src/gameobjects/components/index.js | 1 - src/gameobjects/zone/Zone.js | 10 + src/gameobjects/zone/Zone.ts | 274 +++++++++++++------------- src/input/typedefs/HitAreaCallback.js | 11 -- src/input/typedefs/HitAreaCallback.ts | 14 ++ src/utils/Mixin.js | 7 + src/utils/Mixin.ts | 119 +++++++++++ src/utils/migrationPlaceholders.js | 3 + src/utils/migrationPlaceholders.ts | 12 ++ 15 files changed, 589 insertions(+), 270 deletions(-) create mode 100644 src/gameobjects/components/Depth.js create mode 100644 src/gameobjects/components/Visible.js create mode 100644 src/gameobjects/components/index.d.ts create mode 100644 src/gameobjects/zone/Zone.js delete mode 100644 src/input/typedefs/HitAreaCallback.js create mode 100644 src/input/typedefs/HitAreaCallback.ts create mode 100644 src/utils/Mixin.js create mode 100644 src/utils/Mixin.ts create mode 100644 src/utils/migrationPlaceholders.js create mode 100644 src/utils/migrationPlaceholders.ts diff --git a/eslint.config.mjs b/eslint.config.mjs index d266b0728d..69a83bd219 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -60,7 +60,7 @@ const phaserRules = { 'array-bracket-spacing': [ 'error', 'always' ], 'block-spacing': [ 'error', 'always' ], 'brace-style': [ 'error', 'allman', { allowSingleLine: true } ], - camelcase: 'error', + camelcase: ['error', { allow: ["^TODO_MIGRATE_"] }], 'comma-dangle': [ 'error', 'never' ], 'comma-style': [ 'error', 'last' ], 'computed-property-spacing': [ 'error', 'never' ], diff --git a/src/gameobjects/components/Depth.js b/src/gameobjects/components/Depth.js new file mode 100644 index 0000000000..6c3de20451 --- /dev/null +++ b/src/gameobjects/components/Depth.js @@ -0,0 +1,11 @@ +/** + * @author Richard Davey + * @copyright 2013-2026 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// CJS compatibility wrapper — consumed by Class() factory Mixins arrays during the +// hybrid JS/TS migration period. Remove once all callers are TypeScript. +const mod = require('./Depth.ts'); +module.exports = mod.DepthDescriptors; +Object.defineProperty(module.exports, 'Depth', { value: mod.Depth }); diff --git a/src/gameobjects/components/Depth.ts b/src/gameobjects/components/Depth.ts index 4b657e0599..2b6f247d87 100644 --- a/src/gameobjects/components/Depth.ts +++ b/src/gameobjects/components/Depth.ts @@ -4,28 +4,27 @@ * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +import { applyMixin, defineMixin } from '../../utils/Mixin.js'; +import ArrayUtils from '../../utils/array/index.js'; + /** - * Provides methods used for setting the depth of a Game Object. - * Should be applied as a mixin and not used directly. + * Interface describing the public API contributed by the Depth mixin. * - * @namespace Phaser.GameObjects.Components.Depth + * @memberof Phaser.GameObjects.Components * @since 3.0.0 */ - -var ArrayUtils = require('../../utils/array'); - -var Depth = { +export interface DepthMixin +{ /** * Private internal value. Holds the depth of the Game Object. * * @name Phaser.GameObjects.Components.Depth#_depth - * @type {number} * @private * @default 0 * @since 3.0.0 */ - _depth: 0, + _depth: number; /** * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. @@ -39,27 +38,9 @@ var Depth = { * Setting the depth will queue a depth sort event within the Scene. * * @name Phaser.GameObjects.Components.Depth#depth - * @type {number} * @since 3.0.0 */ - depth: { - - get: function () - { - return this._depth; - }, - - set: function (value) - { - if (this.displayList) - { - this.displayList.queueDepthSort(); - } - - this._depth = value; - } - - }, + depth: number; /** * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. @@ -74,34 +55,130 @@ var Depth = { * @method Phaser.GameObjects.Components.Depth#setDepth * @since 3.0.0 * - * @param {number} value - The depth of this Game Object. Ensure this value is only ever a number data-type. + * @param value - The depth of this Game Object. Ensure this value is only ever a number data-type. * - * @return {this} This Game Object instance. + * @return This Game Object instance. */ - setDepth: function (value) - { - if (value === undefined) { value = 0; } - - this.depth = value; - - return this; - }, + setDepth(value?: number): this; /** * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * + * * Being at the top means it will render on top of everything else. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * * @method Phaser.GameObjects.Components.Depth#setToTop * @since 3.85.0 - * - * @return {this} This Game Object instance. + * + * @return This Game Object instance. */ - setToTop: function () + setToTop(): this; + + /** + * Sets this Game Object to the back of the display list, or the back of its parent container. + * + * Being at the back means it will render below everything else. + * + * This method does not change this Game Objects `depth` value, it simply alters its list position. + * + * @method Phaser.GameObjects.Components.Depth#setToBack + * @since 3.85.0 + * + * @return This Game Object instance. + */ + setToBack(): this; + + /** + * Move this Game Object so that it appears above the given Game Object. + * + * This means it will render immediately after the other object in the display list. + * + * Both objects must belong to the same display list, or parent container. + * + * This method does not change this Game Objects `depth` value, it simply alters its list position. + * + * @method Phaser.GameObjects.Components.Depth#setAbove + * @since 3.85.0 + * + * @param gameObject - The Game Object that this Game Object will be moved to be above. + * + * @return This Game Object instance. + */ + setAbove(gameObject: object): this; + + /** + * Move this Game Object so that it appears below the given Game Object. + * + * This means it will render immediately under the other object in the display list. + * + * Both objects must belong to the same display list, or parent container. + * + * This method does not change this Game Objects `depth` value, it simply alters its list position. + * + * @method Phaser.GameObjects.Components.Depth#setBelow + * @since 3.85.0 + * + * @param gameObject - The Game Object that this Game Object will be moved to be below. + * + * @return This Game Object instance. + */ + setBelow(gameObject: object): this; +} + +/** + * Minimal shape expected by Depth descriptor-bag methods at runtime. + * Describes only the properties the methods actually access. + */ +interface DepthContext +{ + _depth: number; + depth: number; + displayList: { queueDepthSort(): void } | null; + getDisplayList(): unknown[]; +} + +/** + * Runtime descriptor-bag for the Depth mixin. The `{ get, set }` shape on + * `depth` is installed as a real prototype getter/setter via `applyMixin`. + * + * @since 3.0.0 + */ +export const DepthDescriptors = { + + _depth: 0, + + depth: { + + get: function (this: DepthContext): number + { + return this._depth; + }, + + set: function (this: DepthContext, value: number): void + { + if (this.displayList) + { + this.displayList.queueDepthSort(); + } + + this._depth = value; + } + + }, + + setDepth: function (this: DepthContext, value?: number): DepthContext + { + if (value === undefined) { value = 0; } + + this.depth = value; + + return this; + }, + + setToTop: function (this: DepthContext): DepthContext { - var list = this.getDisplayList(); + const list = this.getDisplayList(); if (list) { @@ -111,21 +188,9 @@ var Depth = { return this; }, - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * - * @method Phaser.GameObjects.Components.Depth#setToBack - * @since 3.85.0 - * - * @return {this} This Game Object instance. - */ - setToBack: function () + setToBack: function (this: DepthContext): DepthContext { - var list = this.getDisplayList(); + const list = this.getDisplayList(); if (list) { @@ -135,25 +200,9 @@ var Depth = { return this; }, - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * - * @method Phaser.GameObjects.Components.Depth#setAbove - * @since 3.85.0 - * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that this Game Object will be moved to be above. - * - * @return {this} This Game Object instance. - */ - setAbove: function (gameObject) + setAbove: function (this: DepthContext, gameObject: object): DepthContext { - var list = this.getDisplayList(); + const list = this.getDisplayList(); if (list && gameObject) { @@ -163,25 +212,9 @@ var Depth = { return this; }, - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * - * @method Phaser.GameObjects.Components.Depth#setBelow - * @since 3.85.0 - * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that this Game Object will be moved to be below. - * - * @return {this} This Game Object instance. - */ - setBelow: function (gameObject) + setBelow: function (this: DepthContext, gameObject: object): DepthContext { - var list = this.getDisplayList(); + const list = this.getDisplayList(); if (list && gameObject) { @@ -193,4 +226,17 @@ var Depth = { }; -module.exports = Depth; +/** + * Provides methods used for setting the depth of a Game Object. + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.GameObjects.Components.Depth + * @since 3.0.0 + */ +export const Depth = defineMixin()(function Depth (Base) +{ + applyMixin(Base, DepthDescriptors); + return Base; +}); + +export default Depth; diff --git a/src/gameobjects/components/Visible.js b/src/gameobjects/components/Visible.js new file mode 100644 index 0000000000..2286e4d8ce --- /dev/null +++ b/src/gameobjects/components/Visible.js @@ -0,0 +1,11 @@ +/** + * @author Richard Davey + * @copyright 2013-2026 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// CJS compatibility wrapper — consumed by Class() factory Mixins arrays during the +// hybrid JS/TS migration period. Remove once all callers are TypeScript. +const mod = require('./Visible.ts'); +module.exports = mod.VisibleDescriptors; +Object.defineProperty(module.exports, 'Visible', { value: mod.Visible }); diff --git a/src/gameobjects/components/Visible.ts b/src/gameobjects/components/Visible.ts index 5697c701ce..7d1f3ac4f5 100644 --- a/src/gameobjects/components/Visible.ts +++ b/src/gameobjects/components/Visible.ts @@ -4,33 +4,29 @@ * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +import { applyMixin, defineMixin } from '../../utils/Mixin.js'; + // bitmask flag for GameObject.renderMask -var _FLAG = 1; // 0001 +const _FLAG = 1; // 0001 /** - * Provides methods used for setting the visibility of a Game Object. - * The Visible component is mixed into Game Objects to give them a `visible` boolean property - * and a `setVisible` method. Visibility is tracked via a bitmask flag on `renderFlags`, so - * toggling it is a fast bitwise operation. An invisible Game Object is excluded from the - * render pass entirely, but its `update` logic continues to run normally each frame. - * Should be applied as a mixin and not used directly. + * Interface describing the public API contributed by the Visible mixin. * - * @namespace Phaser.GameObjects.Components.Visible + * @memberof Phaser.GameObjects.Components * @since 3.0.0 */ - -var Visible = { +export interface VisibleMixin +{ /** * Private internal value. Holds the visible value. * * @name Phaser.GameObjects.Components.Visible#_visible - * @type {boolean} * @private * @default true * @since 3.0.0 */ - _visible: true, + _visible: boolean; /** * The visible state of the Game Object. @@ -38,17 +34,55 @@ var Visible = { * An invisible Game Object will skip rendering, but will still process update logic. * * @name Phaser.GameObjects.Components.Visible#visible - * @type {boolean} * @since 3.0.0 */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * + * @method Phaser.GameObjects.Components.Visible#setVisible + * @since 3.0.0 + * + * @param value - The visible state of the Game Object. + * + * @return This Game Object instance. + */ + setVisible(value: boolean): this; +} + +/** + * Minimal shape expected by Visible descriptor-bag methods at runtime. + * Describes only the properties the methods actually access. + */ +interface VisibleContext +{ + _visible: boolean; + visible: boolean; + renderFlags: number; +} + +/** + * Runtime descriptor-bag for the Visible mixin. Class.js detects the + * `{ get, set }` shape on `visible` and installs it as a real prototype + * getter/setter via `Object.defineProperty`. + * + * @since 3.0.0 + */ +export const VisibleDescriptors = { + + _visible: true, + visible: { - get: function () + get: function (this: VisibleContext): boolean { return this._visible; }, - set: function (value) + set: function (this: VisibleContext, value: boolean): void { if (value) { @@ -64,24 +98,30 @@ var Visible = { }, - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * - * @method Phaser.GameObjects.Components.Visible#setVisible - * @since 3.0.0 - * - * @param {boolean} value - The visible state of the Game Object. - * - * @return {this} This Game Object instance. - */ - setVisible: function (value) + setVisible: function (this: VisibleContext, value: boolean): VisibleContext { this.visible = value; return this; } + }; -module.exports = Visible; +/** + * Provides methods used for setting the visibility of a Game Object. + * The Visible component is mixed into Game Objects to give them a `visible` boolean property + * and a `setVisible` method. Visibility is tracked via a bitmask flag on `renderFlags`, so + * toggling it is a fast bitwise operation. An invisible Game Object is excluded from the + * render pass entirely, but its `update` logic continues to run normally each frame. + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.GameObjects.Components.Visible + * @since 3.0.0 + */ +export const Visible = defineMixin()(function Visible (Base) +{ + applyMixin(Base, VisibleDescriptors); + return Base; +}); + +export default Visible; diff --git a/src/gameobjects/components/index.d.ts b/src/gameobjects/components/index.d.ts new file mode 100644 index 0000000000..5d350215c5 --- /dev/null +++ b/src/gameobjects/components/index.d.ts @@ -0,0 +1,50 @@ +/** + * Type declaration for the components CJS barrel (index.js). + * + * Prevents TS9005/TS9006 declaration-emit errors that occur when a TypeScript + * module imports this barrel and TypeScript tries to infer types through all + * the plain-JS component files. + * + * Delete this file once the barrel itself is converted. + */ + +type DescriptorBag = Record; + +interface Components { + + // --- Migrated components --------------------------------------------------- + + Depth: DescriptorBag; + Visible: DescriptorBag; + + // --- Unmigrated components (descriptor bags) ------------------------------- + + Alpha: DescriptorBag; + AlphaSingle: DescriptorBag; + BlendMode: DescriptorBag; + ComputedSize: DescriptorBag; + Crop: DescriptorBag; + ElapseTimer: DescriptorBag; + FilterList: DescriptorBag; + Filters: DescriptorBag; + Flip: DescriptorBag; + GetBounds: DescriptorBag; + Lighting: DescriptorBag; + Mask: DescriptorBag; + Origin: DescriptorBag; + PathFollower: DescriptorBag; + RenderNodes: DescriptorBag; + RenderSteps: DescriptorBag; + ScrollFactor: DescriptorBag; + Size: DescriptorBag; + Texture: DescriptorBag; + TextureCrop: DescriptorBag; + Tint: DescriptorBag; + ToJSON: DescriptorBag; + Transform: DescriptorBag; + TransformMatrix: DescriptorBag; +} + +// eslint-disable-next-line no-redeclare +declare const Components: Components; +export default Components; diff --git a/src/gameobjects/components/index.js b/src/gameobjects/components/index.js index d734c45b0d..c97b2cd3dc 100644 --- a/src/gameobjects/components/index.js +++ b/src/gameobjects/components/index.js @@ -9,7 +9,6 @@ */ module.exports = { - Alpha: require('./Alpha'), AlphaSingle: require('./AlphaSingle'), BlendMode: require('./BlendMode'), diff --git a/src/gameobjects/zone/Zone.js b/src/gameobjects/zone/Zone.js new file mode 100644 index 0000000000..4a248a071f --- /dev/null +++ b/src/gameobjects/zone/Zone.js @@ -0,0 +1,10 @@ +/** + * @author Richard Davey + * @copyright 2013-2026 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// CJS compatibility wrapper — consumed by the hybrid build pipeline and any +// remaining JS callers during the migration period. Remove once all callers +// are TypeScript. +module.exports = require('./Zone.ts').default; diff --git a/src/gameobjects/zone/Zone.ts b/src/gameobjects/zone/Zone.ts index d93f9c1a60..aa42775c28 100644 --- a/src/gameobjects/zone/Zone.ts +++ b/src/gameobjects/zone/Zone.ts @@ -4,14 +4,19 @@ * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BlendModes = require('../../renderer/BlendModes'); -var Circle = require('../../geom/circle/Circle'); -var CircleContains = require('../../geom/circle/Contains'); -var Class = require('../../utils/Class'); -var Components = require('../components'); -var GameObject = require('../GameObject'); -var Rectangle = require('../../geom/rectangle/Rectangle'); -var RectangleContains = require('../../geom/rectangle/Contains'); +import BlendModes from '../../renderer/BlendModes.js'; +import Circle from '../../geom/circle/Circle.js'; +import CircleContains from '../../geom/circle/Contains.js'; +import Components from '../components/index.js'; +import { Rectangle } from '../../geom/rectangle/Rectangle.js'; +import { Contains as RectangleContains } from '../../geom/rectangle/Contains.js'; +import { Visible } from '../components/Visible.js'; +import { Depth } from '../components/Depth.js'; +import { applyMixin, composeMixins } from '../../utils/Mixin.js'; +import { TODO_MIGRATE_GameObjectCtor, TODO_MIGRATE_Scene } from '../../utils/migrationPlaceholders.js'; +import type { HitAreaCallback } from '../../input/typedefs/HitAreaCallback'; + +const ZoneBase = composeMixins(Visible, Depth)(TODO_MIGRATE_GameObjectCtor); /** * @classdesc @@ -38,135 +43,111 @@ var RectangleContains = require('../../geom/rectangle/Contains'); * @extends Phaser.GameObjects.Components.ScrollFactor * @extends Phaser.GameObjects.Components.Visible * - * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. - * @param {number} x - The horizontal position of this Game Object in the world. - * @param {number} y - The vertical position of this Game Object in the world. - * @param {number} [width=1] - The width of the Game Object. - * @param {number} [height=1] - The height of the Game Object. + * @param scene - The Scene to which this Game Object belongs. + * @param x - The horizontal position of this Game Object in the world. + * @param y - The vertical position of this Game Object in the world. + * @param [width=1] - The width of the Game Object. + * @param [height=1] - The height of the Game Object. */ -var Zone = new Class({ - - Extends: GameObject, +// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging +export class Zone extends ZoneBase +{ + /** + * The native (un-scaled) width of this Game Object. + * + * @name Phaser.GameObjects.Zone#width + * @since 3.0.0 + */ + width: number; - Mixins: [ - Components.Depth, - Components.GetBounds, - Components.Origin, - Components.Transform, - Components.ScrollFactor, - Components.Visible - ], + /** + * The native (un-scaled) height of this Game Object. + * + * @name Phaser.GameObjects.Zone#height + * @since 3.0.0 + */ + height: number; - initialize: + /** + * The Blend Mode of the Game Object. + * Although a Zone never renders, it still has a blend mode to allow it to fit seamlessly into + * display lists without causing a batch flush. + * + * @name Phaser.GameObjects.Zone#blendMode + * @since 3.0.0 + */ + blendMode: number; - function Zone (scene, x, y, width, height) + /** + * @since 3.0.0 + */ + constructor (scene: TODO_MIGRATE_Scene, x: number, y: number, width: number = 1, height: number = width) { - if (width === undefined) { width = 1; } - if (height === undefined) { height = width; } - - GameObject.call(this, scene, 'Zone'); + super(scene, 'Zone'); this.setPosition(x, y); - /** - * The native (un-scaled) width of this Game Object. - * - * @name Phaser.GameObjects.Zone#width - * @type {number} - * @since 3.0.0 - */ this.width = width; - - /** - * The native (un-scaled) height of this Game Object. - * - * @name Phaser.GameObjects.Zone#height - * @type {number} - * @since 3.0.0 - */ this.height = height; - /** - * The Blend Mode of the Game Object. - * Although a Zone never renders, it still has a blend mode to allow it to fit seamlessly into - * display lists without causing a batch flush. - * - * @name Phaser.GameObjects.Zone#blendMode - * @type {number} - * @since 3.0.0 - */ this.blendMode = BlendModes.NORMAL; this.updateDisplayOrigin(); - }, + } /** * The displayed width of this Game Object. * This value takes into account the scale factor. * * @name Phaser.GameObjects.Zone#displayWidth - * @type {number} * @since 3.0.0 */ - displayWidth: { - - get: function () - { - return this.scaleX * this.width; - }, - - set: function (value) - { - this.scaleX = value / this.width; - } + get displayWidth (): number + { + return this.scaleX * this.width; + } - }, + set displayWidth (value: number) + { + this.scaleX = value / this.width; + } /** * The displayed height of this Game Object. * This value takes into account the scale factor. * - * @name Phaser.GameObjects.Zone#displayHeight - * @type {number} * @since 3.0.0 */ - displayHeight: { - - get: function () - { - return this.scaleY * this.height; - }, - - set: function (value) - { - this.scaleY = value / this.height; - } + get displayHeight (): number + { + return this.scaleY * this.height; + } - }, + set displayHeight (value: number) + { + this.scaleY = value / this.height; + } /** * Sets the native (un-scaled) width and height of this Zone. Also updates the display origin * and, by default, resizes any non-custom input hit area associated with this Zone. * - * @method Phaser.GameObjects.Zone#setSize * @since 3.0.0 * - * @param {number} width - The width of this Game Object. - * @param {number} height - The height of this Game Object. - * @param {boolean} [resizeInput=true] - If this Zone has a Rectangle for a hit area this argument will resize the hit area as well. + * @param width - The width of this Game Object. + * @param height - The height of this Game Object. + * @param [resizeInput=true] - If this Zone has a Rectangle for a hit area this argument will resize the hit area as well. * - * @return {this} This Game Object. + * @return This Game Object. */ - setSize: function (width, height, resizeInput) + setSize (width: number, height: number, resizeInput: boolean = true): this { - if (resizeInput === undefined) { resizeInput = true; } - this.width = width; this.height = height; this.updateDisplayOrigin(); - var input = this.input; + const input = this.input; if (resizeInput && input && !input.customHitArea) { @@ -175,60 +156,58 @@ var Zone = new Class({ } return this; - }, + } /** * Sets the display size of this Game Object. * Calling this will adjust the scale. * - * @method Phaser.GameObjects.Zone#setDisplaySize * @since 3.0.0 * - * @param {number} width - The width of this Game Object. - * @param {number} height - The height of this Game Object. + * @param width - The width of this Game Object. + * @param height - The height of this Game Object. * - * @return {this} This Game Object. + * @return This Game Object. */ - setDisplaySize: function (width, height) + setDisplaySize (width: number, height: number): this { this.displayWidth = width; this.displayHeight = height; return this; - }, + } /** * Sets this Zone to be a Circular Drop Zone. * The circle is centered on this Zone's `x` and `y` coordinates. * - * @method Phaser.GameObjects.Zone#setCircleDropZone * @since 3.0.0 * - * @param {number} radius - The radius of the Circle that will form the Drop Zone. + * @param radius - The radius of the Circle that will form the Drop Zone. * - * @return {this} This Game Object. + * @return This Game Object. */ - setCircleDropZone: function (radius) + setCircleDropZone (radius: number): this { + // @ts-expect-error - Circle is a JS Class() factory, not a native ES6 class return this.setDropZone(new Circle(0, 0, radius), CircleContains); - }, + } /** * Sets this Zone to be a Rectangle Drop Zone. * The rectangle is centered on this Zone's `x` and `y` coordinates. * - * @method Phaser.GameObjects.Zone#setRectangleDropZone * @since 3.0.0 * - * @param {number} width - The width of the rectangle drop zone. - * @param {number} height - The height of the rectangle drop zone. + * @param width - The width of the rectangle drop zone. + * @param height - The height of the rectangle drop zone. * - * @return {this} This Game Object. + * @return This Game Object. */ - setRectangleDropZone: function (width, height) + setRectangleDropZone (width: number, height: number): this { return this.setDropZone(new Rectangle(0, 0, width, height), RectangleContains); - }, + } /** * Enables this Zone as an interactive Drop Zone by calling `setInteractive` with the given @@ -236,15 +215,14 @@ var Zone = new Class({ * a matching hit-test callback. If no arguments are provided, a Rectangle matching the size of * this Zone will be used automatically. Has no effect if this Zone is already interactive. * - * @method Phaser.GameObjects.Zone#setDropZone * @since 3.0.0 * - * @param {object} [hitArea] - A Geometry shape instance, such as Phaser.Geom.Ellipse, or your own custom shape. If not given it will try to create a Rectangle based on the size of this zone. - * @param {Phaser.Types.Input.HitAreaCallback} [hitAreaCallback] - A function that will return `true` if the given x/y coords it is sent are within the shape. If you provide a shape you must also provide a callback. + * @param [hitArea] - A Geometry shape instance, such as Phaser.Geom.Ellipse, or your own custom shape. + * @param [hitAreaCallback] - A function that will return `true` if the given x/y coords it is sent are within the shape. * - * @return {this} This Game Object. + * @return This Game Object. */ - setDropZone: function (hitArea, hitAreaCallback) + setDropZone (hitArea?: T, hitAreaCallback?: HitAreaCallback): this { if (!this.input) { @@ -252,7 +230,7 @@ var Zone = new Class({ } return this; - }, + } /** * A NOOP method so you can pass a Zone to a Container. @@ -262,9 +240,9 @@ var Zone = new Class({ * @private * @since 3.11.0 */ - setAlpha: function () + setAlpha (): void { - }, + } /** * A NOOP method so you can pass a Zone to a Container in Canvas. @@ -274,9 +252,9 @@ var Zone = new Class({ * @private * @since 3.16.2 */ - setBlendMode: function () + setBlendMode (): void { - }, + } /** * A Zone does not render. @@ -285,15 +263,14 @@ var Zone = new Class({ * @private * @since 3.53.0 * - * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. - * @param {Phaser.GameObjects.Image} src - The Game Object being rendered in this call. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + * @param renderer - A reference to the current active Canvas renderer. + * @param src - The Game Object being rendered in this call. + * @param camera - The Camera that is rendering the Game Object. */ - renderCanvas: function (renderer, src, camera) + renderCanvas (_renderer: object, src: Zone, camera: { addToRenderList(src: object): void }): void { camera.addToRenderList(src); - }, + } /** * A Zone does not render. @@ -302,15 +279,46 @@ var Zone = new Class({ * @private * @since 3.53.0 * - * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. - * @param {Phaser.GameObjects.Image} src - The Game Object being rendered in this call. - * @param {Phaser.Renderer.WebGL.DrawingContext} drawingContext - The current drawing context. + * @param renderer - A reference to the current active WebGL renderer. + * @param src - The Game Object being rendered in this call. + * @param drawingContext - The current drawing context. */ - renderWebGL: function (renderer, src, drawingContext) + renderWebGL (_renderer: object, src: Zone, drawingContext: { camera: { addToRenderList(src: object): void } }): void { drawingContext.camera.addToRenderList(src); } - -}); - -module.exports = Zone; +} + +// --------------------------------------------------------------------------- +// Unmigrated JS mixin application +// --------------------------------------------------------------------------- +// These remain as runtime applyMixin() calls until each component .js is +// converted to a typed mixin function. Remove each line as you migrate its +// component to TypeScript. +applyMixin(Zone, Components.GetBounds); +applyMixin(Zone, Components.Origin); +applyMixin(Zone, Components.ScrollFactor); +applyMixin(Zone, Components.Transform); + +// --------------------------------------------------------------------------- +// Declaration merging — unmigrated mixin / parent surface used by Zone's body. +// Remove entries as each dependency is migrated to TypeScript. +// --------------------------------------------------------------------------- +// eslint-disable-next-line no-redeclare, @typescript-eslint/no-unsafe-declaration-merging +export interface Zone +{ + + // From Transform mixin + scaleX: number; + scaleY: number; + setPosition(x: number, y: number): this; + + // From Origin mixin + updateDisplayOrigin(): this; + + // From GameObject parent + input: { customHitArea: boolean; hitArea: { width: number; height: number } } | null; + setInteractive(hitArea?: T, hitAreaCallback?: HitAreaCallback, dropZone?: boolean): this; +} + +export default Zone; diff --git a/src/input/typedefs/HitAreaCallback.js b/src/input/typedefs/HitAreaCallback.js deleted file mode 100644 index 90bcf55fa9..0000000000 --- a/src/input/typedefs/HitAreaCallback.js +++ /dev/null @@ -1,11 +0,0 @@ -/** - * @callback Phaser.Types.Input.HitAreaCallback - * @since 3.0.0 - * - * @param {any} hitArea - The hit area object. - * @param {number} x - The translated x coordinate of the hit test event. - * @param {number} y - The translated y coordinate of the hit test event. - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that invoked the hit test. - * - * @return {boolean} `true` if the coordinates fall within the space of the hitArea, otherwise `false`. - */ diff --git a/src/input/typedefs/HitAreaCallback.ts b/src/input/typedefs/HitAreaCallback.ts new file mode 100644 index 0000000000..054a9d1e0d --- /dev/null +++ b/src/input/typedefs/HitAreaCallback.ts @@ -0,0 +1,14 @@ +import { TODO_MIGRATE_GameObjectInstance } from '../../utils/migrationPlaceholders.js'; + +/** + * @callback Phaser.Types.Input.HitAreaCallback + * @since 3.0.0 + * + * @param hitArea - The hit area object. + * @param x - The translated x coordinate of the hit test event. + * @param y - The translated y coordinate of the hit test event. + * @param gameObject - The Game Object that invoked the hit test. + * + * @return `true` if the coordinates fall within the space of the hitArea, otherwise `false`. + */ +export type HitAreaCallback = (hitArea: T, x: number, y: number, gameObject: TODO_MIGRATE_GameObjectInstance) => boolean; diff --git a/src/utils/Mixin.js b/src/utils/Mixin.js new file mode 100644 index 0000000000..88af475394 --- /dev/null +++ b/src/utils/Mixin.js @@ -0,0 +1,7 @@ +// CJS compatibility wrapper - consumed by Class() factory Mixins arrays during the +// hybrid JS/TS migration period. Remove once all callers are TypeScript. +const mod = require('./Mixin.ts'); +module.exports = mod; +module.exports.applyMixin = mod.applyMixin; +module.exports.defineMixin = mod.defineMixin; +module.exports.composeMixins = mod.composeMixins; diff --git a/src/utils/Mixin.ts b/src/utils/Mixin.ts new file mode 100644 index 0000000000..e1a48a2cd1 --- /dev/null +++ b/src/utils/Mixin.ts @@ -0,0 +1,119 @@ +/** + * A generic constructor type. Used as a constraint for mixin base classes. + * + * The `any[]` for args is the standard TypeScript mixin pattern — required + * because `unknown[]` breaks assignability of concrete constructors like + * `new (scene: Scene, type: string) => T` to the generic constraint. + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +type Constructor = new (...args: any[]) => T; + +/** + * A descriptor-bag entry shaped as `{ get, set }` that `applyMixin` installs + * as a prototype getter/setter via `Object.defineProperty`. + */ +interface AccessorDescriptor +{ + get?: () => unknown; + set?: (value: unknown) => void; +} + +/** + * Type guard: returns true when `value` is a getter/setter descriptor object. + */ +function isAccessorDescriptor (value: unknown): value is AccessorDescriptor +{ + if (value === null || typeof value !== 'object') { return false; } + + const record = value as Record; + + return typeof record.get === 'function' || typeof record.set === 'function'; +} + +/** + * Applies a Phaser-style descriptor-bag mixin object to a class prototype, + * mirroring what the Class() factory's mixin() + extend() functions do. + * + * A descriptor-bag is a plain object where: + * - Entries shaped as `{ get: fn, set: fn }` become prototype getters/setters. + * - All other entries become regular writable prototype properties. + * + * This is the runtime half of the mixin pattern. Each migrated component + * exports a typed mixin function that calls `applyMixin` internally and + * returns a properly typed constructor via the return-type cast. + * + * @param target - The class whose prototype receives the mixin. + * @param mixin - A Phaser component descriptor-bag object. + * + */ +export function applyMixin (target: Constructor, mixin: Record): void +{ + for (const key of Object.keys(mixin)) + { + const value = mixin[key]; + + if (isAccessorDescriptor(value)) + { + // Getter / setter descriptor + Object.defineProperty(target.prototype, key, { + get: value.get, + set: value.set, + enumerable: true, + configurable: true + }); + } + else + { + // Plain value (method, default property) + Object.defineProperty(target.prototype, key, { + value, + writable: true, + enumerable: false, + configurable: true + }); + } + } +} + +export type Mixin = + ( + Base: TBase + ) => TBase & Constructor & TAdded>; + +export function defineMixin () +{ + return function ( + fn: (Base: TBase) => TBase + ): Mixin + { + return fn as unknown as Mixin; + }; +} + +type AddedBy = + T extends Mixin + ? TAdded + : never; + +type UnionToIntersection = + (T extends unknown ? (value: T) => void : never) extends + (value: infer I) => void + ? I + : never; + +type AddedByAll[]> = + UnionToIntersection>; + +export function composeMixins[]> ( + ...mixins: TMixins +): ( + Base: TBase +) => TBase & Constructor & AddedByAll> +{ + // The reduce chain is type-safe at call sites via the overload signature; + // the implementation needs a single cast to bridge the generic gap. + return ((Base: Constructor) => + mixins.reduce((Current, mixin) => mixin(Current), Base) + // eslint-disable-next-line @typescript-eslint/no-explicit-any + ) as any; +} diff --git a/src/utils/migrationPlaceholders.js b/src/utils/migrationPlaceholders.js new file mode 100644 index 0000000000..f479d25f6d --- /dev/null +++ b/src/utils/migrationPlaceholders.js @@ -0,0 +1,3 @@ +const mod = require('./migrationPlaceholders.ts'); +module.exports = mod; +module.exports.TODO_MIGRATE_GameObjectCtor = mod.TODO_MIGRATE_GameObjectCtor; diff --git a/src/utils/migrationPlaceholders.ts b/src/utils/migrationPlaceholders.ts new file mode 100644 index 0000000000..f5fa150b39 --- /dev/null +++ b/src/utils/migrationPlaceholders.ts @@ -0,0 +1,12 @@ +import GameObject from '../gameobjects/GameObject.js'; + +export type TODO_MIGRATE_Scene = object; +export type TODO_MIGRATE_GameObjectInstance = object; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +export type TODO_MIGRATE_Callback = (...args: any[]) => any; + +/** + * Class() factory produces a plain constructor function, not a TypeScript-visible + * class. Cast to a minimal constructor type so native `extends` can reference it. + */ +export const TODO_MIGRATE_GameObjectCtor = GameObject as unknown as new (scene: TODO_MIGRATE_Scene, type: string) => TODO_MIGRATE_GameObjectInstance; From 835ad1936a8ac911b8051298e968b9e6e48dce7d Mon Sep 17 00:00:00 2001 From: Niklas Engblom Date: Thu, 14 May 2026 07:35:09 +0300 Subject: [PATCH 15/17] Add hybrid tsgen overlay for migrated TypeScript modules --- scripts/tsgen/README.md | 54 + scripts/tsgen/bin/MigratedOverlay.js | 1068 +++ scripts/tsgen/bin/MigratedOverlay.js.map | 1 + scripts/tsgen/bin/Parser.js | 64 +- scripts/tsgen/bin/Parser.js.map | 2 +- scripts/tsgen/bin/publish.js | 20 +- scripts/tsgen/bin/publish.js.map | 2 +- scripts/tsgen/src/MigratedOverlay.ts | 1345 ++++ scripts/tsgen/src/Parser.ts | 76 +- scripts/tsgen/src/publish.ts | 38 +- scripts/tsgen/test/bin/game.js | 694 -- scripts/tsgen/test/bin/game.js.map | 1 - scripts/tsgen/test/src/game.ts | 14 +- types/phaser.d.ts | 8174 +++++----------------- 14 files changed, 4407 insertions(+), 7146 deletions(-) create mode 100644 scripts/tsgen/bin/MigratedOverlay.js create mode 100644 scripts/tsgen/bin/MigratedOverlay.js.map create mode 100644 scripts/tsgen/src/MigratedOverlay.ts delete mode 100644 scripts/tsgen/test/bin/game.js delete mode 100644 scripts/tsgen/test/bin/game.js.map diff --git a/scripts/tsgen/README.md b/scripts/tsgen/README.md index 835936c4f2..32a1a3000d 100644 --- a/scripts/tsgen/README.md +++ b/scripts/tsgen/README.md @@ -5,3 +5,57 @@ The TypeScript defs generation tool is called `tsgen` and is written in TypeScri You can then run `npm run tsgen` to build the actual defs. They will replace the file located in the root `types` folder. Once the parser is built you only need use this command. Use it to re-generate the defs if you have modified the Phaser source code and wish to test your change worked. There is also a test script available: `npm run test-ts` which will compile a test TypeScript project and output any compilation errors to `output.txt`. + +## Hybrid migration foundation + +Type generation now uses a hybrid model during native TypeScript migration: + +1. JSDoc + tsgen remain the baseline for non-migrated modules. +2. Migrated modules are declared from native TypeScript and overlaid into the final single-file output. +3. `types/phaser.d.ts` remains the public artifact. + +### Migrated module discovery + +Migrated modules are discovered automatically by scanning `src/**/*.ts` files +(excluding `.d.ts`) for JSDoc namespace annotations (`@function Phaser.X.Y` or +`@class` + `@memberof Phaser.X`). No manual manifest is required. + +The discovery drives synthetic continuity handling and migrated-symbol validation. + +### Synthetic symbol continuity rationale + +When a module moves from JSDoc-authored `.js` to native `.ts`, its JSDoc owner doclets can disappear from the baseline parse. Non-migrated helpers under the same namespace path can then lose parent ownership and fail to bind. + +To avoid this, tsgen injects synthetic migrated parent symbols before parser resolution. These placeholders preserve namespace/class/function continuity for baseline binding and are then replaced by TS-authoritative declarations during overlay. + +### Guard scripts and expected usage + +- `npm run check:migrated-jsdoc-types`: fails if migrated `.ts` files still contain type-bearing JSDoc payloads. +- `npm run validate:migrated-symbols`: fails if canonical symbols listed in the manifest are missing from `types/phaser.d.ts`. + +Recommended verification sequence for hybrid migration work: + +1. `npm run build-tsgen` +2. `npm run check:migrated-jsdoc-types` +3. `npm run tsgen` +4. `npm run validate:migrated-symbols` +5. `npm run test-ts` + +Run `npm run build` as a final repository-level integration gate when landing migration changes. + +### Adding a newly migrated module + +For each newly migrated module: + +1. Keep runtime `.js` wrapper compatibility in place during the hybrid period. +2. Remove only type-bearing JSDoc syntax in the migrated `.ts` file; keep semantic docs and tags + (including `@function Phaser.X.Y` or `@class` + `@memberof Phaser.X` — these are used for + auto-discovery). +3. Regenerate and validate with the hybrid verification sequence above. + +Wrapper lifecycle policy during hybrid migration: + +- wrappers remain while runtime/test pipelines depend on `src`-path `.js` loading, +- runtime dynamic wrapper generation is not allowed, +- deterministic manifest-driven wrapper generation is optional only if manual maintenance becomes noisy, +- wrapper removal is allowed only after CI validates wrapper-free build and type gates. diff --git a/scripts/tsgen/bin/MigratedOverlay.js b/scripts/tsgen/bin/MigratedOverlay.js new file mode 100644 index 0000000000..39d006a614 --- /dev/null +++ b/scripts/tsgen/bin/MigratedOverlay.js @@ -0,0 +1,1068 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.discoverMigratedModules = discoverMigratedModules; +exports.flattenCanonicalSymbols = flattenCanonicalSymbols; +exports.reportMigrationProgress = reportMigrationProgress; +exports.getDeclarationKindForStatement = getDeclarationKindForStatement; +exports.parseSourceFile = parseSourceFile; +exports.collectExportedDeclarationKinds = collectExportedDeclarationKinds; +exports.validateSymbolInDeclarations = validateSymbolInDeclarations; +exports.buildSyntheticDoclets = buildSyntheticDoclets; +exports.applyMigratedAuthorityOverlay = applyMigratedAuthorityOverlay; +exports.validateNoSyntheticLeak = validateNoSyntheticLeak; +exports.normalizeDeclarationOutput = normalizeDeclarationOutput; +const fs = __importStar(require("fs-extra")); +const path = __importStar(require("path")); +const ts = __importStar(require("typescript")); +const Parser_1 = require("./Parser"); +const REPO_ROOT = path.resolve(__dirname, '..', '..', '..'); +let cachedSrcWalk = null; +function walkSrcDirectory() { + if (cachedSrcWalk) { + return cachedSrcWalk; + } + const srcDir = path.resolve(REPO_ROOT, 'src'); + const tsFiles = []; + const jsFiles = []; + function walk(dir) { + for (const entry of fs.readdirSync(dir, { withFileTypes: true })) { + const fullPath = path.join(dir, entry.name); + if (entry.isDirectory()) { + walk(fullPath); + } + else if (entry.name.endsWith('.ts') && !entry.name.endsWith('.d.ts')) { + tsFiles.push(fullPath); + } + else if (entry.name.endsWith('.js')) { + jsFiles.push(fullPath); + } + } + } + walk(srcDir); + cachedSrcWalk = { tsFiles, jsFiles, sourceKindByRelPath: new Map() }; + return cachedSrcWalk; +} +// --------------------------------------------------------------------------- +// Canonical symbol extraction +// --------------------------------------------------------------------------- +function extractCanonicalSymbols(source) { + const symbols = []; + const seen = new Set(); + const jsdocBlockRegex = /\/\*\*[\s\S]*?\*\//g; + const classAfterRegex = /export\s+(?:default\s+)?class\s+(\w+)/y; + const typeAfterRegex = /export\s+type\s+(\w+)\b/y; + let blockMatch; + while ((blockMatch = jsdocBlockRegex.exec(source)) !== null) { + const block = blockMatch[0]; + const callbackMatch = block.match(/@callback\s+(Phaser(?:\.\w+)+)(?:\s|$)/); + if (callbackMatch) { + typeAfterRegex.lastIndex = skipWhitespaceAndLineCommentsAfterJSDoc(source, blockMatch.index + block.length); + const typeMatch = typeAfterRegex.exec(source); + const declarationName = callbackMatch[1].split('.').pop(); + if (typeMatch && typeMatch[1] === declarationName && !seen.has(callbackMatch[1])) { + seen.add(callbackMatch[1]); + symbols.push(callbackMatch[1]); + } + continue; + } + const functionMatch = block.match(/@function\s+(Phaser(?:\.\w+)+)(?:\s|$)/); + if (functionMatch) { + if (!seen.has(functionMatch[1])) { + seen.add(functionMatch[1]); + symbols.push(functionMatch[1]); + } + continue; + } + const memberofMatch = block.match(/@memberof\s+(Phaser(?:\.\w+)*)/); + if (memberofMatch) { + classAfterRegex.lastIndex = skipWhitespaceAndLineCommentsAfterJSDoc(source, blockMatch.index + block.length); + const classMatch = classAfterRegex.exec(source); + if (classMatch) { + const symbol = `${memberofMatch[1]}.${classMatch[1]}`; + if (!seen.has(symbol)) { + seen.add(symbol); + symbols.push(symbol); + } + } + } + // Handle mixin modules annotated with `@namespace Phaser.xxx.ClassName` where + // the last segment matches an `export const ClassName` in the same file. + // This covers migrated mixin components (e.g. Depth, Visible) that cannot use + // the `@memberof + export class` pattern because they export a mixin function, + // not a constructor class. + const namespaceMatch = block.match(/@namespace\s+(Phaser(?:\.\w+)+)(?:\s|$)/); + if (namespaceMatch) { + const nsName = namespaceMatch[1]; + const lastName = nsName.split('.').pop(); + // Only extract when the file also exports a value with the same name as the + // last namespace segment (const, function, or class). + const escapedLastName = lastName.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); + const exportPattern = new RegExp(`\\bexport\\s+(?:const|function|class)\\s+${escapedLastName}\\b`); + if (exportPattern.test(source) && !seen.has(nsName)) { + seen.add(nsName); + symbols.push(nsName); + } + } + } + return symbols; +} +function skipWhitespaceAndLineCommentsAfterJSDoc(source, start) { + let index = start; + while (index < source.length) { + const char = source[index]; + const nextChar = source[index + 1]; + if (/\s/.test(char)) { + index++; + } + else if (char === '/' && nextChar === '/') { + const lineEnd = source.indexOf('\n', index + 2); + index = lineEnd === -1 ? source.length : lineEnd + 1; + } + else { + break; + } + } + return index; +} +function inferSourceKind(source) { + if (/\bexport\s+(?:default\s+)?class\b/.test(source)) { + return 'class'; + } + if (/\bexport\s+(?:default\s+)?function\b/.test(source)) { + return 'function'; + } + if (/\bexport\s+type\s+\w+\b/.test(source)) { + return 'type'; + } + return null; +} +// --------------------------------------------------------------------------- +// Discovery & progress +// --------------------------------------------------------------------------- +function discoverMigratedModules() { + const { tsFiles, sourceKindByRelPath } = walkSrcDirectory(); + const manifest = {}; + for (const absolutePath of tsFiles) { + const relativePath = path.relative(REPO_ROOT, absolutePath); + const source = fs.readFileSync(absolutePath, 'utf8'); + // Cache source kind while we already have the file content + sourceKindByRelPath.set(relativePath, inferSourceKind(source)); + const symbols = extractCanonicalSymbols(source); + if (symbols.length > 0) { + manifest[relativePath] = symbols; + } + } + return manifest; +} +function flattenCanonicalSymbols(manifest) { + const symbols = []; + const seen = new Set(); + for (const [modulePath, canonicalSymbols] of Object.entries(manifest)) { + for (const symbol of canonicalSymbols) { + if (seen.has(symbol)) { + throw new Error(`Duplicate canonical symbol '${symbol}' discovered in '${modulePath}'`); + } + seen.add(symbol); + symbols.push(symbol); + } + } + symbols.sort((a, b) => a.localeCompare(b)); + return symbols; +} +function reportMigrationProgress(migratedCount) { + const { tsFiles, jsFiles } = walkSrcDirectory(); + const tsFilePaths = new Set(tsFiles); + const leafJsCount = jsFiles.filter((jsPath) => { + if (path.basename(jsPath) === 'index.js') { + return false; + } + const tsCounterpart = jsPath.replace(/\.js$/, '.ts'); + return !tsFilePaths.has(tsCounterpart); + }).length; + const totalModules = leafJsCount + migratedCount; + const percent = totalModules > 0 ? ((migratedCount / totalModules) * 100).toFixed(1) : '0.0'; + console.log('------------------------------------------------------------------'); + console.log(`TypeScript Migration: ${migratedCount} / ${totalModules} source modules (${percent}%)`); + if (totalModules > 0 && migratedCount / totalModules >= 0.5) { + console.log('Over 50% of source modules are now TypeScript.'); + console.log('Consider switching to a TS-first declaration pipeline.'); + } + console.log('------------------------------------------------------------------'); +} +// --------------------------------------------------------------------------- +// TS AST helpers (internal) +// --------------------------------------------------------------------------- +function getModuleDeclarationNameText(name) { + if (ts.isIdentifier(name) || ts.isStringLiteral(name)) { + return name.text; + } + return null; +} +function getDeclarationKindForStatement(statement) { + if (ts.isFunctionDeclaration(statement)) { + return 'function'; + } + if (ts.isClassDeclaration(statement)) { + return 'class'; + } + if (ts.isInterfaceDeclaration(statement)) { + return 'interface'; + } + if (ts.isTypeAliasDeclaration(statement)) { + return 'type'; + } + if (ts.isEnumDeclaration(statement)) { + return 'enum'; + } + if (ts.isModuleDeclaration(statement)) { + return 'namespace'; + } + if (ts.isVariableStatement(statement)) { + return 'variable'; + } + return null; +} +function getStatementName(statement) { + if (ts.isModuleDeclaration(statement)) { + return getModuleDeclarationNameText(statement.name); + } + if ('name' in statement) { + const named = statement; + if (named.name && ts.isIdentifier(named.name)) { + return named.name.text; + } + } + return null; +} +/** + * Collect all statements from the namespace identified by `namespaceParts`, + * merging multiple declarations of the same namespace (common in .d.ts files). + * Returns an empty array when the namespace path cannot be resolved. + */ +function collectNamespaceMembers(sourceFile, namespaceParts) { + let currentStatements = sourceFile.statements; + for (const part of namespaceParts) { + const nextStatements = []; + let matched = false; + for (const statement of currentStatements) { + if (!ts.isModuleDeclaration(statement) || getModuleDeclarationNameText(statement.name) !== part) { + continue; + } + matched = true; + let body = statement.body; + while (body && ts.isModuleDeclaration(body)) { + body = body.body; + } + if (body && ts.isModuleBlock(body)) { + for (const stmt of body.statements) { + nextStatements.push(stmt); + } + } + } + if (!matched) { + return []; + } + currentStatements = nextStatements; + } + return currentStatements; +} +function findDeclarationNode(statements, declarationName, expectedKind) { + var _a, _b, _c, _d; + const candidateKinds = expectedKind ? [expectedKind] : ['class', 'function', 'interface', 'type']; + for (const kind of candidateKinds) { + for (const statement of statements) { + if (kind === 'class' && ts.isClassDeclaration(statement) && ((_a = statement.name) === null || _a === void 0 ? void 0 : _a.text) === declarationName) { + return { node: statement, kind }; + } + if (kind === 'function' && ts.isFunctionDeclaration(statement) && ((_b = statement.name) === null || _b === void 0 ? void 0 : _b.text) === declarationName) { + return { node: statement, kind }; + } + if (kind === 'interface' && ts.isInterfaceDeclaration(statement) && ((_c = statement.name) === null || _c === void 0 ? void 0 : _c.text) === declarationName) { + return { node: statement, kind }; + } + if (kind === 'type' && ts.isTypeAliasDeclaration(statement) && ((_d = statement.name) === null || _d === void 0 ? void 0 : _d.text) === declarationName) { + return { node: statement, kind }; + } + } + } + return null; +} +function getNodeRange(node) { + return { start: node.getFullStart(), end: node.end }; +} +function buildDeclarationIndex(sourceFile) { + const byPath = new Map(); + const getOrCreate = (path) => { + let entry = byPath.get(path); + if (!entry) { + entry = {}; + byPath.set(path, entry); + } + return entry; + }; + const visit = (statements, prefix) => { + let maxEnd = -1; + for (const statement of statements) { + if (statement.end > maxEnd) { + maxEnd = statement.end; + } + if (ts.isClassDeclaration(statement) && statement.name) { + const path = prefix ? `${prefix}.${statement.name.text}` : statement.name.text; + const entry = getOrCreate(path); + if (!entry.classNode) { + entry.classNode = statement; + } + } + else if (ts.isFunctionDeclaration(statement) && statement.name) { + const path = prefix ? `${prefix}.${statement.name.text}` : statement.name.text; + const entry = getOrCreate(path); + if (!entry.functionNode) { + entry.functionNode = statement; + } + } + else if (ts.isInterfaceDeclaration(statement) && statement.name) { + const path = prefix ? `${prefix}.${statement.name.text}` : statement.name.text; + const entry = getOrCreate(path); + if (!entry.interfaceNode) { + entry.interfaceNode = statement; + } + } + else if (ts.isTypeAliasDeclaration(statement) && statement.name) { + const path = prefix ? `${prefix}.${statement.name.text}` : statement.name.text; + const entry = getOrCreate(path); + if (!entry.typeNode) { + entry.typeNode = statement; + } + } + else if (ts.isModuleDeclaration(statement)) { + const name = getModuleDeclarationNameText(statement.name); + if (!name) { + continue; + } + const path = prefix ? `${prefix}.${name}` : name; + const entry = getOrCreate(path); + if (!entry.namespaceNode) { + entry.namespaceNode = statement; + } + let body = statement.body; + while (body && ts.isModuleDeclaration(body)) { + body = body.body; + } + if (body && ts.isModuleBlock(body)) { + visit(body.statements, path); + } + } + } + if (prefix && maxEnd >= 0) { + const parentEntry = getOrCreate(prefix); + if (parentEntry.lastMemberEnd === undefined || maxEnd > parentEntry.lastMemberEnd) { + parentEntry.lastMemberEnd = maxEnd; + } + } + }; + visit(sourceFile.statements, ''); + return { byPath }; +} +function getDeclarationRangeFromIndex(index, canonicalSymbol, expectedKind) { + const dotIndex = canonicalSymbol.indexOf('.'); + if (dotIndex < 0 || !canonicalSymbol.startsWith('Phaser.')) { + throw new Error(`Unsupported canonical symbol '${canonicalSymbol}'. Expected to start with 'Phaser.'.`); + } + const entry = index.byPath.get(canonicalSymbol); + const candidateKinds = expectedKind ? [expectedKind] : ['class', 'function', 'interface', 'type']; + if (entry) { + for (const kind of candidateKinds) { + const node = kind === 'class' ? entry.classNode : kind === 'function' ? entry.functionNode : kind === 'interface' ? entry.interfaceNode : entry.typeNode; + if (node) { + return { ...getNodeRange(node), kind }; + } + } + } + // Distinguish "namespace missing" from "declaration missing" to preserve + // the original error messages used by callers and tests. + const parentPath = canonicalSymbol.substring(0, canonicalSymbol.lastIndexOf('.')); + const parentEntry = index.byPath.get(parentPath); + if (!parentEntry || parentEntry.lastMemberEnd === undefined) { + throw new Error(`Unable to find namespace '${parentPath}' in generated declaration output.`); + } + const prefix = expectedKind ? `${expectedKind} ` : ''; + throw new Error(`Unable to find ${prefix}declaration for migrated symbol '${canonicalSymbol}'.`); +} +function getClassInsertionPointFromIndex(index, canonicalSymbol) { + // Insertion point: if a namespace already exists at the canonical symbol's + // path, insert immediately before it (so the class can be merged with the + // namespace declaration). Otherwise append after the parent's last member. + const entry = index.byPath.get(canonicalSymbol); + if (entry === null || entry === void 0 ? void 0 : entry.namespaceNode) { + return entry.namespaceNode.getFullStart(); + } + const parentPath = canonicalSymbol.substring(0, canonicalSymbol.lastIndexOf('.')); + const parentEntry = parentPath ? index.byPath.get(parentPath) : undefined; + if ((parentEntry === null || parentEntry === void 0 ? void 0 : parentEntry.lastMemberEnd) !== undefined) { + return parentEntry.lastMemberEnd; + } + throw new Error(`Unable to resolve insertion point for '${canonicalSymbol}'.`); +} +function getTopLevelDeclarationRange(source, declarationName, expectedKind) { + const sourceFile = ts.createSourceFile('migrated-fragment.d.ts', source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS); + const result = findDeclarationNode(sourceFile.statements, declarationName, expectedKind); + if (!result) { + const prefix = expectedKind ? `${expectedKind} ` : ''; + throw new Error(`Unable to find top-level ${prefix}declaration '${declarationName}' in emitted fragment.`); + } + return { ...getNodeRange(result.node), kind: result.kind }; +} +function removePrivateClassMembers(source, className) { + var _a; + const sourceFile = ts.createSourceFile('migrated-fragment.d.ts', source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS); + const removals = []; + for (const statement of sourceFile.statements) { + if (!ts.isClassDeclaration(statement) || ((_a = statement.name) === null || _a === void 0 ? void 0 : _a.text) !== className) { + continue; + } + for (const member of statement.members) { + const jsDoc = ts.getJSDocTags(member); + if (jsDoc.some((tag) => tag.tagName.text === 'private')) { + removals.push({ start: member.getFullStart(), end: member.getEnd() }); + } + } + } + let output = source; + for (const removal of removals.sort((a, b) => b.start - a.start)) { + output = output.slice(0, removal.start) + output.slice(removal.end); + } + return output; +} +// --------------------------------------------------------------------------- +// Exported AST helpers for external validation scripts +// --------------------------------------------------------------------------- +function parseSourceFile(filePath) { + const sourceText = fs.readFileSync(filePath, 'utf8'); + return ts.createSourceFile(filePath, sourceText, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS); +} +function hasExportModifier(node) { + var _a; + if (!ts.canHaveModifiers(node)) { + return false; + } + const modifiers = ts.getModifiers(node); + return (_a = modifiers === null || modifiers === void 0 ? void 0 : modifiers.some((modifier) => modifier.kind === ts.SyntaxKind.ExportKeyword)) !== null && _a !== void 0 ? _a : false; +} +function addToKindMap(map, name, kind) { + let kinds = map.get(name); + if (!kinds) { + kinds = new Set(); + map.set(name, kinds); + } + kinds.add(kind); +} +/** + * Return the declaration kind and the set of names introduced by a statement, + * or null if the statement does not introduce any named declarations. + */ +function getDeclarationNames(statement) { + const kind = getDeclarationKindForStatement(statement); + if (!kind) { + return null; + } + if (ts.isVariableStatement(statement)) { + const names = []; + for (const declaration of statement.declarationList.declarations) { + if (ts.isIdentifier(declaration.name)) { + names.push(declaration.name.text); + } + } + return names.length > 0 ? { kind, names } : null; + } + const name = getStatementName(statement); + return name ? { kind, names: [name] } : null; +} +/** + * Parse a TypeScript source file and collect all exported declaration kinds by name. + * Returns a map from declaration name to the set of declaration kinds (class, function, etc.). + */ +function collectExportedDeclarationKinds(filePath) { + const sourceFile = parseSourceFile(filePath); + const localKinds = new Map(); + const exportedKinds = new Map(); + // Single pass: collect local declaration kinds, and exported ones when the statement has `export`. + for (const statement of sourceFile.statements) { + const info = getDeclarationNames(statement); + if (!info) { + continue; + } + const isExported = hasExportModifier(statement); + for (const name of info.names) { + addToKindMap(localKinds, name, info.kind); + if (isExported) { + addToKindMap(exportedKinds, name, info.kind); + } + } + } + // Handle `export { Foo, Bar as Baz }` declarations (must run after localKinds is fully built). + for (const statement of sourceFile.statements) { + if (!ts.isExportDeclaration(statement) || statement.moduleSpecifier) { + continue; + } + if (!statement.exportClause || !ts.isNamedExports(statement.exportClause)) { + continue; + } + for (const element of statement.exportClause.elements) { + const exportedName = element.name.text; + const localName = element.propertyName ? element.propertyName.text : exportedName; + const kinds = localKinds.get(localName); + if (kinds) { + for (const kind of kinds) { + addToKindMap(exportedKinds, exportedName, kind); + } + } + } + } + return exportedKinds; +} +/** + * Check whether a canonical symbol (e.g. "Phaser.Math.Vector2") exists in the + * given parsed declaration file with one of the expected declaration kinds. + * Returns null on success, or a reason object on failure. + */ +function validateSymbolInDeclarations(declarationsFile, canonicalSymbol, expectedKinds) { + const parts = canonicalSymbol.split('.'); + if (parts.length < 2) { + return { symbol: canonicalSymbol, reason: 'invalid canonical symbol path' }; + } + const namespaceParts = parts.slice(0, -1); + const symbolName = parts[parts.length - 1]; + const members = collectNamespaceMembers(declarationsFile, namespaceParts); + if (members.length === 0) { + return { symbol: canonicalSymbol, reason: 'namespace path not found' }; + } + const expectedKindSet = new Set(expectedKinds); + for (const statement of members) { + const kind = getDeclarationKindForStatement(statement); + if (!kind || !expectedKindSet.has(kind)) { + continue; + } + if (ts.isVariableStatement(statement)) { + for (const declaration of statement.declarationList.declarations) { + if (ts.isIdentifier(declaration.name) && declaration.name.text === symbolName) { + return null; + } + } + continue; + } + const name = getStatementName(statement); + if (name === symbolName) { + return null; + } + } + return { symbol: canonicalSymbol, reason: `declaration anchor not found for expected kind(s) "${expectedKinds.join(', ')}"` }; +} +// --------------------------------------------------------------------------- +// Kind inference +// --------------------------------------------------------------------------- +function inferKindFromMigratedSource(modulePath) { + const { sourceKindByRelPath } = walkSrcDirectory(); + if (sourceKindByRelPath.has(modulePath)) { + return sourceKindByRelPath.get(modulePath); + } + // Fallback: read file if not in cache (shouldn't happen after discoverMigratedModules) + const sourcePath = path.resolve(REPO_ROOT, modulePath); + if (!fs.existsSync(sourcePath)) { + sourceKindByRelPath.set(modulePath, null); + return null; + } + const source = fs.readFileSync(sourcePath, 'utf8'); + const kind = inferSourceKind(source); + sourceKindByRelPath.set(modulePath, kind); + return kind; +} +function inferSyntheticKind(modulePath, symbol, docs) { + const inferredFromSource = inferKindFromMigratedSource(modulePath); + if (inferredFromSource === 'type') { + return 'typedef'; + } + if (inferredFromSource) { + return inferredFromSource; + } + const instancePrefix = `${symbol}#`; + for (const doclet of docs) { + const longname = doclet.longname; + if (typeof longname !== 'string') { + continue; + } + if (longname === symbol) { + if (doclet.kind === 'class') { + return 'class'; + } + if (doclet.kind === 'function') { + return 'function'; + } + } + if ((doclet.memberof === symbol && doclet.scope === 'instance') || longname.startsWith(instancePrefix)) { + return 'class'; + } + } + return 'function'; +} +// --------------------------------------------------------------------------- +// Synthetic doclet generation +// --------------------------------------------------------------------------- +function createSyntheticDoclet(kind, longname, lineno) { + const dotIndex = longname.lastIndexOf('.'); + const hashIndex = longname.lastIndexOf('#'); + const splitIndex = Math.max(dotIndex, hashIndex); + const memberof = (splitIndex !== -1) ? longname.substring(0, splitIndex) : undefined; + const name = (splitIndex !== -1) ? longname.substring(splitIndex + 1) : longname; + const scope = (hashIndex > dotIndex) ? 'instance' : 'static'; + const doclet = { + [Parser_1.SYNTHETIC_DOCLET_FLAG]: true, + kind, + name, + longname, + scope, + meta: { + filename: `${Parser_1.SYNTHETIC_META_MARKER}/auto-discovered`, + lineno, + columnno: 0, + path: Parser_1.SYNTHETIC_META_MARKER + } + }; + if (kind === 'function' || kind === 'class') { + doclet.params = [ + { + name: 'args', + variable: true, + type: { names: ['*'] } + } + ]; + } + if (kind === 'function') { + doclet.returns = [ + { + type: { names: ['*'] } + } + ]; + } + if (kind === 'typedef') { + doclet.type = { names: ['function'] }; + doclet.params = [ + { + name: 'args', + variable: true, + type: { names: ['*'] } + } + ]; + doclet.returns = [ + { + type: { names: ['*'] } + } + ]; + } + if (memberof) { + doclet.memberof = memberof; + } + return doclet; +} +function buildSyntheticDoclets(manifest, docs) { + const existingLongnames = new Set(); + const syntheticKinds = new Map(); + const syntheticOrder = []; + for (const doclet of docs) { + if (typeof doclet.longname === 'string') { + existingLongnames.add(doclet.longname); + } + } + for (const [modulePath, canonicalSymbols] of Object.entries(manifest)) { + if (!Array.isArray(canonicalSymbols)) { + continue; + } + for (const symbol of canonicalSymbols) { + if (!existingLongnames.has(symbol) && !syntheticKinds.has(symbol)) { + syntheticKinds.set(symbol, inferSyntheticKind(modulePath, symbol, docs)); + syntheticOrder.push(symbol); + } + const parts = symbol.split('.'); + for (let i = 1; i < parts.length; i++) { + const parentLongname = parts.slice(0, i).join('.'); + if (existingLongnames.has(parentLongname) || syntheticKinds.has(parentLongname)) { + continue; + } + syntheticKinds.set(parentLongname, 'namespace'); + syntheticOrder.push(parentLongname); + } + } + } + syntheticOrder.sort((a, b) => { + const byDepth = a.split('.').length - b.split('.').length; + if (byDepth !== 0) { + return byDepth; + } + return a.localeCompare(b); + }); + return syntheticOrder.map((longname, index) => { + const kind = syntheticKinds.get(longname); + return createSyntheticDoclet(kind, longname, index + 1); + }); +} +// --------------------------------------------------------------------------- +// Declaration emission & overlay +// --------------------------------------------------------------------------- +function detectAuthorityKind(modulePath, canonicalSymbol, declarationFragment) { + const declarationName = canonicalSymbol.split('.').pop() || canonicalSymbol; + const classPattern = new RegExp(`\\bclass\\s+${declarationName}\\b`); + if (classPattern.test(declarationFragment)) { + return 'class'; + } + const functionPattern = new RegExp(`\\bfunction\\s+${declarationName}\\s*\\(`); + if (functionPattern.test(declarationFragment)) { + return 'function'; + } + // Check for an interface declaration with the canonical name. + // This handles mixin modules where the exported mixin interface has been + // renamed (via MODULE_TYPE_RULES) from e.g. DepthMixin to Depth before + // this function is called. + const interfacePattern = new RegExp(`\\binterface\\s+${declarationName}\\b`); + if (interfacePattern.test(declarationFragment)) { + return 'interface'; + } + const typePattern = new RegExp(`\\btype\\s+${declarationName}\\b`); + if (typePattern.test(declarationFragment)) { + return 'type'; + } + // Fallback: const/variable/type/enum exports are not recognised here and + // will default to 'function'; those cases are handled upstream. + return inferKindFromMigratedSource(modulePath) || 'function'; +} +function buildCanonicalSymbolModuleLookup(manifest) { + const symbolToModulePath = new Map(); + for (const [modulePath, canonicalSymbols] of Object.entries(manifest)) { + for (const canonicalSymbol of canonicalSymbols) { + symbolToModulePath.set(canonicalSymbol, modulePath); + } + } + return symbolToModulePath; +} +function toIndentedBlock(block, indent) { + const normalized = block.replace(/\s+$/, ''); + const lines = normalized.split(/\r?\n/); + return `${lines.map((line) => (line.length > 0 ? `${indent}${line}` : '')).join('\n')}\n`; +} +function normalizeAuthorityFragment(modulePath, declarationText) { + let fragment = declarationText; + fragment = fragment.replace(/^import[^\n]*\n/gm, ''); + fragment = fragment.replace(/^export\s+default[^\n]*\n/gm, ''); + fragment = fragment.replace(/\bexport\s+declare\s+/g, ''); + fragment = fragment.replace(/\bexport\s+/g, ''); + return fragment.trim(); +} +function qualifyType(fragment, shortName, qualifiedName) { + const prefix = qualifiedName.slice(0, qualifiedName.length - shortName.length); + const pattern = new RegExp(`\\b${shortName}\\b`, 'g'); + // Pre-compute JSDoc comment regions so we can skip prose matches. + // Only matches inside /** ... */ blocks are skipped; type positions + // (extends clauses, parameter types, return types) are outside comments. + const commentRegions = []; + const commentPattern = /\/\*\*[\s\S]*?\*\//g; + let cm; + while ((cm = commentPattern.exec(fragment)) !== null) { + commentRegions.push({ start: cm.index, end: cm.index + cm[0].length }); + } + return fragment.replace(pattern, (match, offset, source) => { + if (offset >= prefix.length && source.startsWith(prefix, offset - prefix.length)) { + return match; + } + // Don't qualify type names inside JSDoc prose comments. + for (const region of commentRegions) { + if (offset >= region.start && offset < region.end) { + return match; + } + } + return qualifiedName; + }); +} +const MODULE_TYPE_RULES = { + 'src/geom/rectangle/Rectangle.ts': [ + { type: 'replace', pattern: /typeof\s+Line\.prototype/g, replacement: 'Phaser.Geom.Line' }, + { type: 'qualify', shortName: 'Vector2', qualifiedName: 'Phaser.Math.Vector2' }, + ], + 'src/gameobjects/nineslice/NineSliceVertex.ts': [ + { type: 'qualify', shortName: 'Vector2', qualifiedName: 'Phaser.Math.Vector2' }, + ], + 'src/geom/rectangle/Contains.ts': [ + { type: 'qualify', shortName: 'Rectangle', qualifiedName: 'Phaser.Geom.Rectangle' }, + ], + 'src/math/Vector2.ts': [ + { type: 'qualify', shortName: 'Vector2Like', qualifiedName: 'Phaser.Types.Math.Vector2Like' }, + ], + 'src/structs/Map.ts': [ + { type: 'replace', pattern: /map: Map/g, replacement: 'map: Phaser.Structs.Map' }, + { type: 'replace', pattern: /\bEachMapCallback\s*<\s*K\s*,\s*V\s*>/g, replacement: '(key: K, entry: V) => boolean | void' }, + ], + 'src/gameobjects/components/Depth.ts': [ + { type: 'replace', pattern: /\bDepthMixin\b/g, replacement: 'Depth' }, + ], + 'src/gameobjects/components/Visible.ts': [ + { type: 'replace', pattern: /\bVisibleMixin\b/g, replacement: 'Visible' }, + ], + 'src/gameobjects/zone/Zone.ts': [ + { type: 'qualify', shortName: 'HitAreaCallback', qualifiedName: 'Phaser.Types.Input.HitAreaCallback' }, + ], + 'src/input/typedefs/HitAreaCallback.ts': [ + { type: 'replace', pattern: /gameObject:\s*GameObject\b/g, replacement: 'gameObject: Phaser.GameObjects.GameObject' }, + ], +}; +function normalizeCanonicalDeclaration(modulePath, declarationText) { + let fragment = declarationText; + const rules = MODULE_TYPE_RULES[modulePath]; + if (rules) { + for (const rule of rules) { + if (rule.type === 'qualify') { + fragment = qualifyType(fragment, rule.shortName, rule.qualifiedName); + } + else { + fragment = fragment.replace(rule.pattern, rule.replacement); + } + } + } + fragment = fragment.replace(/extends\s+\w*Base\b/g, 'extends Phaser.GameObjects.GameObject'); + fragment = fragment.replace(/\bTODO_MIGRATE_Scene\b/g, 'Phaser.Scene'); + fragment = fragment.replace(/\bTODO_MIGRATE_GameObjectInstance\b/g, 'Phaser.GameObjects.GameObject'); + fragment = fragment.replace(/\bTODO_MIGRATE_GameObjectCtor\b/g, 'Phaser.GameObjects.GameObject'); + return fragment.trim(); +} +function getSourceText(modulePath) { + return fs.readFileSync(path.resolve(REPO_ROOT, modulePath), 'utf8'); +} +function extractClassComponentExtends(source, className) { + const jsdocBlockRegex = /\/\*\*[\s\S]*?\*\//g; + const classAfterRegex = /export\s+(?:default\s+)?class\s+(\w+)/y; + const extendsTags = []; + let blockMatch; + while ((blockMatch = jsdocBlockRegex.exec(source)) !== null) { + classAfterRegex.lastIndex = skipWhitespaceAndLineCommentsAfterJSDoc(source, blockMatch.index + blockMatch[0].length); + const classMatch = classAfterRegex.exec(source); + if (!classMatch || classMatch[1] !== className) { + continue; + } + const tagRegex = /@extends\s+(Phaser\.GameObjects\.Components\.\w+)/g; + let tagMatch; + while ((tagMatch = tagRegex.exec(blockMatch[0])) !== null) { + extendsTags.push(tagMatch[1]); + } + break; + } + return Array.from(new Set(extendsTags)); +} +function buildClassMergeInterface(modulePath, className) { + const components = extractClassComponentExtends(getSourceText(modulePath), className); + if (components.length === 0) { + return null; + } + return `interface ${className} extends ${components.join(', ')} {\n}`; +} +function deriveCanonicalDeclarationMap(moduleDeclarationMap, symbolToModulePath) { + const canonicalDeclarationMap = new Map(); + const canonicalSymbols = Array.from(symbolToModulePath.keys()).sort((a, b) => a.localeCompare(b)); + for (const canonicalSymbol of canonicalSymbols) { + const modulePath = symbolToModulePath.get(canonicalSymbol); + const moduleDeclaration = moduleDeclarationMap.get(modulePath); + if (!moduleDeclaration) { + throw new Error(`No declaration fragment available for migrated module '${modulePath}'.`); + } + const declarationName = canonicalSymbol.split('.').pop(); + // Apply module-type rules (e.g. interface renames) to the full declaration + // fragment *before* authority-kind detection and declaration extraction. + // This ensures that detectAuthorityKind and getTopLevelDeclarationRange see + // the final canonical names (e.g. `interface Depth` after renaming `DepthMixin`). + const normalizedModuleDeclaration = normalizeCanonicalDeclaration(modulePath, moduleDeclaration); + const expectedKind = detectAuthorityKind(modulePath, canonicalSymbol, normalizedModuleDeclaration); + const range = getTopLevelDeclarationRange(normalizedModuleDeclaration, declarationName, expectedKind); + let declaration = normalizedModuleDeclaration.substring(range.start, range.end).trim(); + if (expectedKind === 'class') { + declaration = removePrivateClassMembers(declaration, declarationName); + const mergeInterface = buildClassMergeInterface(modulePath, declarationName); + if (mergeInterface) { + declaration += `\n\n${mergeInterface}`; + } + } + // Normalization was applied to the full module text, not just this range. + canonicalDeclarationMap.set(canonicalSymbol, declaration); + } + return canonicalDeclarationMap; +} +function emitMigratedModuleDeclarations(manifest) { + const modulePaths = Object.keys(manifest).sort((a, b) => a.localeCompare(b)); + const entryFiles = modulePaths.map((modulePath) => path.resolve(REPO_ROOT, modulePath)); + const emittedDeclarations = new Map(); + const compilerOptions = { + target: ts.ScriptTarget.ES2018, + module: ts.ModuleKind.Node16, + moduleResolution: ts.ModuleResolutionKind.Node16, + declaration: true, + emitDeclarationOnly: true, + allowJs: true, + skipLibCheck: true, + strict: false + }; + const host = ts.createCompilerHost(compilerOptions); + const program = ts.createProgram(entryFiles, compilerOptions, { + ...host, + writeFile: (fileName, content) => { + if (fileName.endsWith('.d.ts')) { + emittedDeclarations.set(path.normalize(fileName), content); + } + } + }); + const emitResult = program.emit(); + const diagnostics = ts + .getPreEmitDiagnostics(program) + .concat(emitResult.diagnostics) + .filter((diagnostic) => diagnostic.code !== 2578); + if (diagnostics.length > 0) { + const formattedDiagnostics = ts.formatDiagnosticsWithColorAndContext(diagnostics, { + getCurrentDirectory: () => REPO_ROOT, + getCanonicalFileName: (fileName) => fileName, + getNewLine: () => '\n' + }); + throw new Error(`Failed to emit authoritative migrated declarations:\n${formattedDiagnostics}`); + } + const moduleDeclarationMap = new Map(); + for (const modulePath of modulePaths) { + const absoluteSource = path.resolve(REPO_ROOT, modulePath); + const emittedPath = path.normalize(absoluteSource.replace(/\.[jt]s$/, '.d.ts')); + const declarationText = emittedDeclarations.get(emittedPath); + if (!declarationText) { + throw new Error(`Missing emitted declaration for migrated module '${modulePath}'.`); + } + moduleDeclarationMap.set(modulePath, normalizeAuthorityFragment(modulePath, declarationText)); + } + return moduleDeclarationMap; +} +// --------------------------------------------------------------------------- +// Public overlay API +// --------------------------------------------------------------------------- +function applyMigratedAuthorityOverlay(out, manifest) { + const moduleDeclarationMap = emitMigratedModuleDeclarations(manifest); + const symbolToModulePath = buildCanonicalSymbolModuleLookup(manifest); + const canonicalDeclarationMap = deriveCanonicalDeclarationMap(moduleDeclarationMap, symbolToModulePath); + // Parse the declaration output once and build a name-keyed index so each + // canonical symbol lookup below is O(1) instead of an AST traversal. + const sourceFile = ts.createSourceFile('phaser.d.ts', out, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS); + const index = buildDeclarationIndex(sourceFile); + const ops = []; + for (const [canonicalSymbol, declarationFragment] of canonicalDeclarationMap) { + const modulePath = symbolToModulePath.get(canonicalSymbol); + const expectedKind = detectAuthorityKind(modulePath, canonicalSymbol, declarationFragment); + let replaceStart; + let replaceEnd; + try { + const range = getDeclarationRangeFromIndex(index, canonicalSymbol, expectedKind); + replaceStart = range.start; + replaceEnd = range.end; + } + catch (error) { + // Only class/interface may be freshly inserted; functions must replace existing. + if (expectedKind !== 'class' && expectedKind !== 'interface') { + throw error; + } + // No existing class/interface declaration: insert a fresh one inside the namespace. + replaceStart = getClassInsertionPointFromIndex(index, canonicalSymbol); + replaceEnd = replaceStart; + } + ops.push({ start: replaceStart, end: replaceEnd, fragment: declarationFragment }); + } + // Sort ascending by start offset for segment-based assembly + ops.sort((a, b) => a.start - b.start); + const segments = []; + let cursor = 0; + for (const op of ops) { + // Preserve text between previous op and this one + segments.push(out.substring(cursor, op.start)); + // Compute indentation from original text + const lineStart = out.lastIndexOf('\n', op.start - 1) + 1; + const linePrefix = out.substring(lineStart, op.start); + const indentMatch = linePrefix.match(/^\s*/); + const indent = indentMatch ? indentMatch[0] : ''; + let replacement = toIndentedBlock(op.fragment, indent); + if (op.start > 0 && out[op.start - 1] !== '\n') { + replacement = `\n${replacement}`; + } + // Ensure a trailing newline if the original text after the op doesn't start with one + const charAfterEnd = op.end < out.length ? out[op.end] : '\n'; + const needsTrailingGap = charAfterEnd !== '\r' && charAfterEnd !== '\n'; + segments.push(replacement); + if (needsTrailingGap) { + segments.push('\n'); + } + cursor = op.end; + } + segments.push(out.substring(cursor)); + // Normalize blank lines: toIndentedBlock uses LF and appends '\n', + // while the original d.ts uses CRLF. This can create runs of 3+ + // consecutive line breaks at replacement boundaries (both between + // adjacent replacements and between a replacement and original text). + // Collapse any such run to exactly 2 line breaks (one blank line). + return segments.join('').replace(/(\r?\n){3,}/g, (match) => { + // Detect line-ending style from the first captured sequence + const eol = match.includes('\r\n') ? '\r\n' : '\n'; + return `${eol}${eol}`; + }); +} +function validateNoSyntheticLeak(out, canonicalSymbols) { + const leakedMarkers = [Parser_1.SYNTHETIC_META_MARKER, Parser_1.SYNTHETIC_DOCLET_FLAG]; + for (const marker of leakedMarkers) { + if (out.includes(marker)) { + throw new Error(`Synthetic marker metadata leaked into emitted declarations: '${marker}'.`); + } + } + // Parse once and index by canonical name for O(1) symbol range lookups. + const sourceFile = ts.createSourceFile('phaser.d.ts', out, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS); + const index = buildDeclarationIndex(sourceFile); + const fallbackPatterns = [/\.\.\.args:\s*any\[\]/, /@returns\s+undefined/, /constructor\(\.\.\.args:\s*any\[\]\)/]; + for (const canonicalSymbol of canonicalSymbols) { + const range = getDeclarationRangeFromIndex(index, canonicalSymbol); + const declarationText = out.substring(range.start, range.end); + for (const pattern of fallbackPatterns) { + if (pattern.test(declarationText)) { + throw new Error(`Synthetic fallback signature leaked for migrated symbol '${canonicalSymbol}' (${pattern}).`); + } + } + } +} +function normalizeDeclarationOutput(out) { + return out.replace(/\r\n?/g, '\n'); +} +//# sourceMappingURL=MigratedOverlay.js.map \ No newline at end of file diff --git a/scripts/tsgen/bin/MigratedOverlay.js.map b/scripts/tsgen/bin/MigratedOverlay.js.map new file mode 100644 index 0000000000..1c4b7d3d66 --- /dev/null +++ b/scripts/tsgen/bin/MigratedOverlay.js.map @@ -0,0 +1 @@ +{"version":3,"file":"MigratedOverlay.js","sourceRoot":"","sources":["../src/MigratedOverlay.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwLA,0DAmBC;AAED,0DAkBC;AAED,0DA0BC;AAcD,wEAUC;AA0SD,0CAIC;AAuDD,0EAgDC;AAOD,oEA8CC;AAkID,sDAmDC;AAoTD,sEA2FC;AAED,0DAyBC;AAED,gEAEC;AAh0CD,6CAA+B;AAC/B,2CAA6B;AAC7B,+CAAiC;AACjC,qCAAwE;AAUxE,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAa5D,IAAI,aAAa,GAAyB,IAAI,CAAC;AAE/C,SAAS,gBAAgB;IACrB,IAAI,aAAa,EAAE,CAAC;QAChB,OAAO,aAAa,CAAC;IACzB,CAAC;IAED,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IAC9C,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,MAAM,OAAO,GAAa,EAAE,CAAC;IAE7B,SAAS,IAAI,CAAC,GAAW;QACrB,KAAK,MAAM,KAAK,IAAI,EAAE,CAAC,WAAW,CAAC,GAAG,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;YAC/D,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;YAE5C,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;gBACtB,IAAI,CAAC,QAAQ,CAAC,CAAC;YACnB,CAAC;iBACI,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;gBACnE,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC3B,CAAC;iBACI,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;gBAClC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC3B,CAAC;QACL,CAAC;IACL,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,CAAC;IAEb,aAAa,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,IAAI,GAAG,EAAE,EAAE,CAAC;IAErE,OAAO,aAAa,CAAC;AACzB,CAAC;AAED,8EAA8E;AAC9E,8BAA8B;AAC9B,8EAA8E;AAE9E,SAAS,uBAAuB,CAAC,MAAc;IAC3C,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,MAAM,eAAe,GAAG,qBAAqB,CAAC;IAC9C,MAAM,eAAe,GAAG,wCAAwC,CAAC;IACjE,MAAM,cAAc,GAAG,0BAA0B,CAAC;IAClD,IAAI,UAAkC,CAAC;IAEvC,OAAO,CAAC,UAAU,GAAG,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;QAC1D,MAAM,KAAK,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;QAC5B,MAAM,aAAa,GAAG,KAAK,CAAC,KAAK,CAAC,wCAAwC,CAAC,CAAC;QAE5E,IAAI,aAAa,EAAE,CAAC;YAChB,cAAc,CAAC,SAAS,GAAG,uCAAuC,CAAC,MAAM,EAAE,UAAU,CAAC,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;YAC5G,MAAM,SAAS,GAAG,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAC9C,MAAM,eAAe,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;YAE1D,IAAI,SAAS,IAAI,SAAS,CAAC,CAAC,CAAC,KAAK,eAAe,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC/E,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC3B,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;YACnC,CAAC;YAED,SAAS;QACb,CAAC;QAED,MAAM,aAAa,GAAG,KAAK,CAAC,KAAK,CAAC,wCAAwC,CAAC,CAAC;QAE5E,IAAI,aAAa,EAAE,CAAC;YAChB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC9B,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC3B,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;YACnC,CAAC;YAED,SAAS;QACb,CAAC;QAED,MAAM,aAAa,GAAG,KAAK,CAAC,KAAK,CAAC,gCAAgC,CAAC,CAAC;QAEpE,IAAI,aAAa,EAAE,CAAC;YAChB,eAAe,CAAC,SAAS,GAAG,uCAAuC,CAAC,MAAM,EAAE,UAAU,CAAC,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;YAC7G,MAAM,UAAU,GAAG,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAEhD,IAAI,UAAU,EAAE,CAAC;gBACb,MAAM,MAAM,GAAG,GAAG,aAAa,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;gBAEtD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;oBACpB,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;oBACjB,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;gBACzB,CAAC;YACL,CAAC;QACL,CAAC;QAED,8EAA8E;QAC9E,yEAAyE;QACzE,8EAA8E;QAC9E,+EAA+E;QAC/E,2BAA2B;QAC3B,MAAM,cAAc,GAAG,KAAK,CAAC,KAAK,CAAC,yCAAyC,CAAC,CAAC;QAE9E,IAAI,cAAc,EAAE,CAAC;YACjB,MAAM,MAAM,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC;YACjC,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAG,CAAC;YAC1C,4EAA4E;YAC5E,sDAAsD;YACtD,MAAM,eAAe,GAAG,QAAQ,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;YACxE,MAAM,aAAa,GAAG,IAAI,MAAM,CAAC,4CAA4C,eAAe,KAAK,CAAC,CAAC;YAEnG,IAAI,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;gBAClD,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;gBACjB,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACzB,CAAC;QACL,CAAC;IACL,CAAC;IAED,OAAO,OAAO,CAAC;AACnB,CAAC;AAED,SAAS,uCAAuC,CAAC,MAAc,EAAE,KAAa;IAC1E,IAAI,KAAK,GAAG,KAAK,CAAC;IAElB,OAAO,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC;QAC3B,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;QAC3B,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;QAEnC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YAClB,KAAK,EAAE,CAAC;QACZ,CAAC;aACI,IAAI,IAAI,KAAK,GAAG,IAAI,QAAQ,KAAK,GAAG,EAAE,CAAC;YACxC,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;YAEhD,KAAK,GAAG,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC;QACzD,CAAC;aACI,CAAC;YACF,MAAM;QACV,CAAC;IACL,CAAC;IAED,OAAO,KAAK,CAAC;AACjB,CAAC;AAED,SAAS,eAAe,CAAC,MAAc;IACnC,IAAI,mCAAmC,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QACnD,OAAO,OAAO,CAAC;IACnB,CAAC;IAED,IAAI,sCAAsC,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QACtD,OAAO,UAAU,CAAC;IACtB,CAAC;IAED,IAAI,yBAAyB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QACzC,OAAO,MAAM,CAAC;IAClB,CAAC;IAED,OAAO,IAAI,CAAC;AAChB,CAAC;AAED,8EAA8E;AAC9E,uBAAuB;AACvB,8EAA8E;AAE9E,SAAgB,uBAAuB;IACnC,MAAM,EAAE,OAAO,EAAE,mBAAmB,EAAE,GAAG,gBAAgB,EAAE,CAAC;IAC5D,MAAM,QAAQ,GAA4B,EAAE,CAAC;IAE7C,KAAK,MAAM,YAAY,IAAI,OAAO,EAAE,CAAC;QACjC,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;QAC5D,MAAM,MAAM,GAAG,EAAE,CAAC,YAAY,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;QAErD,2DAA2D;QAC3D,mBAAmB,CAAC,GAAG,CAAC,YAAY,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC;QAE/D,MAAM,OAAO,GAAG,uBAAuB,CAAC,MAAM,CAAC,CAAC;QAEhD,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACrB,QAAQ,CAAC,YAAY,CAAC,GAAG,OAAO,CAAC;QACrC,CAAC;IACL,CAAC;IAED,OAAO,QAAQ,CAAC;AACpB,CAAC;AAED,SAAgB,uBAAuB,CAAC,QAAiC;IACrE,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAE/B,KAAK,MAAM,CAAC,UAAU,EAAE,gBAAgB,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QACpE,KAAK,MAAM,MAAM,IAAI,gBAAgB,EAAE,CAAC;YACpC,IAAI,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;gBACnB,MAAM,IAAI,KAAK,CAAC,+BAA+B,MAAM,oBAAoB,UAAU,GAAG,CAAC,CAAC;YAC5F,CAAC;YAED,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;YACjB,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACzB,CAAC;IACL,CAAC;IAED,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;IAE3C,OAAO,OAAO,CAAC;AACnB,CAAC;AAED,SAAgB,uBAAuB,CAAC,aAAqB;IACzD,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,gBAAgB,EAAE,CAAC;IAChD,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC;IAErC,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE;QAC1C,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,UAAU,EAAE,CAAC;YACvC,OAAO,KAAK,CAAC;QACjB,CAAC;QAED,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QAErD,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAC,MAAM,CAAC;IAEV,MAAM,YAAY,GAAG,WAAW,GAAG,aAAa,CAAC;IACjD,MAAM,OAAO,GAAG,YAAY,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,GAAG,YAAY,CAAC,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IAE7F,OAAO,CAAC,GAAG,CAAC,oEAAoE,CAAC,CAAC;IAClF,OAAO,CAAC,GAAG,CAAC,yBAAyB,aAAa,MAAM,YAAY,oBAAoB,OAAO,IAAI,CAAC,CAAC;IAErG,IAAI,YAAY,GAAG,CAAC,IAAI,aAAa,GAAG,YAAY,IAAI,GAAG,EAAE,CAAC;QAC1D,OAAO,CAAC,GAAG,CAAC,gDAAgD,CAAC,CAAC;QAC9D,OAAO,CAAC,GAAG,CAAC,wDAAwD,CAAC,CAAC;IAC1E,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,oEAAoE,CAAC,CAAC;AACtF,CAAC;AAED,8EAA8E;AAC9E,4BAA4B;AAC5B,8EAA8E;AAE9E,SAAS,4BAA4B,CAAC,IAAmB;IACrD,IAAI,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC;QACpD,OAAO,IAAI,CAAC,IAAI,CAAC;IACrB,CAAC;IAED,OAAO,IAAI,CAAC;AAChB,CAAC;AAED,SAAgB,8BAA8B,CAAC,SAAuB;IAClE,IAAI,EAAE,CAAC,qBAAqB,CAAC,SAAS,CAAC,EAAE,CAAC;QAAC,OAAO,UAAU,CAAC;IAAC,CAAC;IAC/D,IAAI,EAAE,CAAC,kBAAkB,CAAC,SAAS,CAAC,EAAE,CAAC;QAAC,OAAO,OAAO,CAAC;IAAC,CAAC;IACzD,IAAI,EAAE,CAAC,sBAAsB,CAAC,SAAS,CAAC,EAAE,CAAC;QAAC,OAAO,WAAW,CAAC;IAAC,CAAC;IACjE,IAAI,EAAE,CAAC,sBAAsB,CAAC,SAAS,CAAC,EAAE,CAAC;QAAC,OAAO,MAAM,CAAC;IAAC,CAAC;IAC5D,IAAI,EAAE,CAAC,iBAAiB,CAAC,SAAS,CAAC,EAAE,CAAC;QAAC,OAAO,MAAM,CAAC;IAAC,CAAC;IACvD,IAAI,EAAE,CAAC,mBAAmB,CAAC,SAAS,CAAC,EAAE,CAAC;QAAC,OAAO,WAAW,CAAC;IAAC,CAAC;IAC9D,IAAI,EAAE,CAAC,mBAAmB,CAAC,SAAS,CAAC,EAAE,CAAC;QAAC,OAAO,UAAU,CAAC;IAAC,CAAC;IAE7D,OAAO,IAAI,CAAC;AAChB,CAAC;AAED,SAAS,gBAAgB,CAAC,SAAuB;IAC7C,IAAI,EAAE,CAAC,mBAAmB,CAAC,SAAS,CAAC,EAAE,CAAC;QACpC,OAAO,4BAA4B,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IACxD,CAAC;IAED,IAAI,MAAM,IAAI,SAAS,EAAE,CAAC;QACtB,MAAM,KAAK,GAAG,SAA0C,CAAC;QAEzD,IAAI,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YAC5C,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;QAC3B,CAAC;IACL,CAAC;IAED,OAAO,IAAI,CAAC;AAChB,CAAC;AAED;;;;GAIG;AACH,SAAS,uBAAuB,CAAC,UAAyB,EAAE,cAAwB;IAChF,IAAI,iBAAiB,GAAgC,UAAU,CAAC,UAAU,CAAC;IAE3E,KAAK,MAAM,IAAI,IAAI,cAAc,EAAE,CAAC;QAChC,MAAM,cAAc,GAAmB,EAAE,CAAC;QAC1C,IAAI,OAAO,GAAG,KAAK,CAAC;QAEpB,KAAK,MAAM,SAAS,IAAI,iBAAiB,EAAE,CAAC;YACxC,IAAI,CAAC,EAAE,CAAC,mBAAmB,CAAC,SAAS,CAAC,IAAI,4BAA4B,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;gBAC9F,SAAS;YACb,CAAC;YAED,OAAO,GAAG,IAAI,CAAC;YAEf,IAAI,IAAI,GAA8B,SAAS,CAAC,IAAI,CAAC;YAErD,OAAO,IAAI,IAAI,EAAE,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC1C,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;YACrB,CAAC;YAED,IAAI,IAAI,IAAI,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC;gBACjC,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;oBACjC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAC9B,CAAC;YACL,CAAC;QACL,CAAC;QAED,IAAI,CAAC,OAAO,EAAE,CAAC;YACX,OAAO,EAAE,CAAC;QACd,CAAC;QAED,iBAAiB,GAAG,cAAc,CAAC;IACvC,CAAC;IAED,OAAO,iBAAiB,CAAC;AAC7B,CAAC;AAED,SAAS,mBAAmB,CACxB,UAAuC,EACvC,eAAuB,EACvB,YAAqC;;IAErC,MAAM,cAAc,GAA6B,YAAY,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;IAE5H,KAAK,MAAM,IAAI,IAAI,cAAc,EAAE,CAAC;QAChC,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;YACjC,IAAI,IAAI,KAAK,OAAO,IAAI,EAAE,CAAC,kBAAkB,CAAC,SAAS,CAAC,IAAI,CAAA,MAAA,SAAS,CAAC,IAAI,0CAAE,IAAI,MAAK,eAAe,EAAE,CAAC;gBACnG,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;YACrC,CAAC;YAED,IAAI,IAAI,KAAK,UAAU,IAAI,EAAE,CAAC,qBAAqB,CAAC,SAAS,CAAC,IAAI,CAAA,MAAA,SAAS,CAAC,IAAI,0CAAE,IAAI,MAAK,eAAe,EAAE,CAAC;gBACzG,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;YACrC,CAAC;YAED,IAAI,IAAI,KAAK,WAAW,IAAI,EAAE,CAAC,sBAAsB,CAAC,SAAS,CAAC,IAAI,CAAA,MAAA,SAAS,CAAC,IAAI,0CAAE,IAAI,MAAK,eAAe,EAAE,CAAC;gBAC3G,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;YACrC,CAAC;YAED,IAAI,IAAI,KAAK,MAAM,IAAI,EAAE,CAAC,sBAAsB,CAAC,SAAS,CAAC,IAAI,CAAA,MAAA,SAAS,CAAC,IAAI,0CAAE,IAAI,MAAK,eAAe,EAAE,CAAC;gBACtG,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;YACrC,CAAC;QACL,CAAC;IACL,CAAC;IAED,OAAO,IAAI,CAAC;AAChB,CAAC;AAED,SAAS,YAAY,CAAC,IAAa;IAC/B,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC;AACzD,CAAC;AAsBD,SAAS,qBAAqB,CAAC,UAAyB;IACpD,MAAM,MAAM,GAAG,IAAI,GAAG,EAAiC,CAAC;IAExD,MAAM,WAAW,GAAG,CAAC,IAAY,EAAyB,EAAE;QACxD,IAAI,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAE7B,IAAI,CAAC,KAAK,EAAE,CAAC;YACT,KAAK,GAAG,EAAE,CAAC;YACX,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAC5B,CAAC;QAED,OAAO,KAAK,CAAC;IACjB,CAAC,CAAC;IAEF,MAAM,KAAK,GAAG,CAAC,UAAuC,EAAE,MAAc,EAAQ,EAAE;QAC5E,IAAI,MAAM,GAAG,CAAC,CAAC,CAAC;QAEhB,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;YACjC,IAAI,SAAS,CAAC,GAAG,GAAG,MAAM,EAAE,CAAC;gBACzB,MAAM,GAAG,SAAS,CAAC,GAAG,CAAC;YAC3B,CAAC;YAED,IAAI,EAAE,CAAC,kBAAkB,CAAC,SAAS,CAAC,IAAI,SAAS,CAAC,IAAI,EAAE,CAAC;gBACrD,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;gBAC/E,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;gBAEhC,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC;oBAAC,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC;gBAAC,CAAC;YAC1D,CAAC;iBACI,IAAI,EAAE,CAAC,qBAAqB,CAAC,SAAS,CAAC,IAAI,SAAS,CAAC,IAAI,EAAE,CAAC;gBAC7D,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;gBAC/E,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;gBAEhC,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC;oBAAC,KAAK,CAAC,YAAY,GAAG,SAAS,CAAC;gBAAC,CAAC;YAChE,CAAC;iBACI,IAAI,EAAE,CAAC,sBAAsB,CAAC,SAAS,CAAC,IAAI,SAAS,CAAC,IAAI,EAAE,CAAC;gBAC9D,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;gBAC/E,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;gBAEhC,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;oBAAC,KAAK,CAAC,aAAa,GAAG,SAAS,CAAC;gBAAC,CAAC;YAClE,CAAC;iBACI,IAAI,EAAE,CAAC,sBAAsB,CAAC,SAAS,CAAC,IAAI,SAAS,CAAC,IAAI,EAAE,CAAC;gBAC9D,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;gBAC/E,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;gBAEhC,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;oBAAC,KAAK,CAAC,QAAQ,GAAG,SAAS,CAAC;gBAAC,CAAC;YACxD,CAAC;iBACI,IAAI,EAAE,CAAC,mBAAmB,CAAC,SAAS,CAAC,EAAE,CAAC;gBACzC,MAAM,IAAI,GAAG,4BAA4B,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;gBAE1D,IAAI,CAAC,IAAI,EAAE,CAAC;oBAAC,SAAS;gBAAC,CAAC;gBAExB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;gBACjD,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;gBAEhC,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;oBAAC,KAAK,CAAC,aAAa,GAAG,SAAS,CAAC;gBAAC,CAAC;gBAE9D,IAAI,IAAI,GAA8B,SAAS,CAAC,IAAI,CAAC;gBAErD,OAAO,IAAI,IAAI,EAAE,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,CAAC;oBAC1C,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;gBACrB,CAAC;gBAED,IAAI,IAAI,IAAI,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC;oBACjC,KAAK,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;gBACjC,CAAC;YACL,CAAC;QACL,CAAC;QAED,IAAI,MAAM,IAAI,MAAM,IAAI,CAAC,EAAE,CAAC;YACxB,MAAM,WAAW,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;YAExC,IAAI,WAAW,CAAC,aAAa,KAAK,SAAS,IAAI,MAAM,GAAG,WAAW,CAAC,aAAa,EAAE,CAAC;gBAChF,WAAW,CAAC,aAAa,GAAG,MAAM,CAAC;YACvC,CAAC;QACL,CAAC;IACL,CAAC,CAAC;IAEF,KAAK,CAAC,UAAU,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;IAEjC,OAAO,EAAE,MAAM,EAAE,CAAC;AACtB,CAAC;AAED,SAAS,4BAA4B,CACjC,KAAuB,EACvB,eAAuB,EACvB,YAAqC;IAErC,MAAM,QAAQ,GAAG,eAAe,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAE9C,IAAI,QAAQ,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;QACzD,MAAM,IAAI,KAAK,CAAC,iCAAiC,eAAe,sCAAsC,CAAC,CAAC;IAC5G,CAAC;IAED,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IAChD,MAAM,cAAc,GAA6B,YAAY,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;IAE5H,IAAI,KAAK,EAAE,CAAC;QACR,KAAK,MAAM,IAAI,IAAI,cAAc,EAAE,CAAC;YAChC,MAAM,IAAI,GAAG,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC;YAEzJ,IAAI,IAAI,EAAE,CAAC;gBACP,OAAO,EAAE,GAAG,YAAY,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC;YAC3C,CAAC;QACL,CAAC;IACL,CAAC;IAED,yEAAyE;IACzE,yDAAyD;IACzD,MAAM,UAAU,GAAG,eAAe,CAAC,SAAS,CAAC,CAAC,EAAE,eAAe,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;IAClF,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAEjD,IAAI,CAAC,WAAW,IAAI,WAAW,CAAC,aAAa,KAAK,SAAS,EAAE,CAAC;QAC1D,MAAM,IAAI,KAAK,CAAC,6BAA6B,UAAU,oCAAoC,CAAC,CAAC;IACjG,CAAC;IAED,MAAM,MAAM,GAAG,YAAY,CAAC,CAAC,CAAC,GAAG,YAAY,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IAEtD,MAAM,IAAI,KAAK,CAAC,kBAAkB,MAAM,oCAAoC,eAAe,IAAI,CAAC,CAAC;AACrG,CAAC;AAED,SAAS,+BAA+B,CAAC,KAAuB,EAAE,eAAuB;IACrF,2EAA2E;IAC3E,0EAA0E;IAC1E,2EAA2E;IAC3E,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IAEhD,IAAI,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,aAAa,EAAE,CAAC;QACvB,OAAO,KAAK,CAAC,aAAa,CAAC,YAAY,EAAE,CAAC;IAC9C,CAAC;IAED,MAAM,UAAU,GAAG,eAAe,CAAC,SAAS,CAAC,CAAC,EAAE,eAAe,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;IAClF,MAAM,WAAW,GAAG,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAE1E,IAAI,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,aAAa,MAAK,SAAS,EAAE,CAAC;QAC3C,OAAO,WAAW,CAAC,aAAa,CAAC;IACrC,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,0CAA0C,eAAe,IAAI,CAAC,CAAC;AACnF,CAAC;AAED,SAAS,2BAA2B,CAAC,MAAc,EAAE,eAAuB,EAAE,YAAqC;IAC/G,MAAM,UAAU,GAAG,EAAE,CAAC,gBAAgB,CAAC,wBAAwB,EAAE,MAAM,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;IACzH,MAAM,MAAM,GAAG,mBAAmB,CAAC,UAAU,CAAC,UAAU,EAAE,eAAe,EAAE,YAAY,CAAC,CAAC;IAEzF,IAAI,CAAC,MAAM,EAAE,CAAC;QACV,MAAM,MAAM,GAAG,YAAY,CAAC,CAAC,CAAC,GAAG,YAAY,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QAEtD,MAAM,IAAI,KAAK,CAAC,4BAA4B,MAAM,gBAAgB,eAAe,wBAAwB,CAAC,CAAC;IAC/G,CAAC;IAED,OAAO,EAAE,GAAG,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;AAC/D,CAAC;AAED,SAAS,yBAAyB,CAAC,MAAc,EAAE,SAAiB;;IAChE,MAAM,UAAU,GAAG,EAAE,CAAC,gBAAgB,CAAC,wBAAwB,EAAE,MAAM,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;IACzH,MAAM,QAAQ,GAA0C,EAAE,CAAC;IAE3D,KAAK,MAAM,SAAS,IAAI,UAAU,CAAC,UAAU,EAAE,CAAC;QAC5C,IAAI,CAAC,EAAE,CAAC,kBAAkB,CAAC,SAAS,CAAC,IAAI,CAAA,MAAA,SAAS,CAAC,IAAI,0CAAE,IAAI,MAAK,SAAS,EAAE,CAAC;YAC1E,SAAS;QACb,CAAC;QAED,KAAK,MAAM,MAAM,IAAI,SAAS,CAAC,OAAO,EAAE,CAAC;YACrC,MAAM,KAAK,GAAG,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;YAEtC,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,KAAK,SAAS,CAAC,EAAE,CAAC;gBACtD,QAAQ,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,YAAY,EAAE,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;YAC1E,CAAC;QACL,CAAC;IACL,CAAC;IAED,IAAI,MAAM,GAAG,MAAM,CAAC;IAEpB,KAAK,MAAM,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC;QAC/D,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACxE,CAAC;IAED,OAAO,MAAM,CAAC;AAClB,CAAC;AAED,8EAA8E;AAC9E,uDAAuD;AACvD,8EAA8E;AAE9E,SAAgB,eAAe,CAAC,QAAgB;IAC5C,MAAM,UAAU,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAErD,OAAO,EAAE,CAAC,gBAAgB,CAAC,QAAQ,EAAE,UAAU,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;AACrG,CAAC;AAED,SAAS,iBAAiB,CAAC,IAAa;;IACpC,IAAI,CAAC,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;QAC7B,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,MAAM,SAAS,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IAExC,OAAO,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,KAAK,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,mCAAI,KAAK,CAAC;AACjG,CAAC;AAED,SAAS,YAAY,CAAC,GAA6B,EAAE,IAAY,EAAE,IAAY;IAC3E,IAAI,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAE1B,IAAI,CAAC,KAAK,EAAE,CAAC;QACT,KAAK,GAAG,IAAI,GAAG,EAAE,CAAC;QAClB,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACpB,CAAC;AAED;;;GAGG;AACH,SAAS,mBAAmB,CAAC,SAAuB;IAChD,MAAM,IAAI,GAAG,8BAA8B,CAAC,SAAS,CAAC,CAAC;IAEvD,IAAI,CAAC,IAAI,EAAE,CAAC;QACR,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,IAAI,EAAE,CAAC,mBAAmB,CAAC,SAAS,CAAC,EAAE,CAAC;QACpC,MAAM,KAAK,GAAa,EAAE,CAAC;QAE3B,KAAK,MAAM,WAAW,IAAI,SAAS,CAAC,eAAe,CAAC,YAAY,EAAE,CAAC;YAC/D,IAAI,EAAE,CAAC,YAAY,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC;gBACpC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACtC,CAAC;QACL,CAAC;QAED,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IACrD,CAAC;IAED,MAAM,IAAI,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAC;IAEzC,OAAO,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AACjD,CAAC;AAED;;;GAGG;AACH,SAAgB,+BAA+B,CAAC,QAAgB;IAC5D,MAAM,UAAU,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;IAC7C,MAAM,UAAU,GAAG,IAAI,GAAG,EAAuB,CAAC;IAClD,MAAM,aAAa,GAAG,IAAI,GAAG,EAAuB,CAAC;IAErD,mGAAmG;IACnG,KAAK,MAAM,SAAS,IAAI,UAAU,CAAC,UAAU,EAAE,CAAC;QAC5C,MAAM,IAAI,GAAG,mBAAmB,CAAC,SAAS,CAAC,CAAC;QAE5C,IAAI,CAAC,IAAI,EAAE,CAAC;YACR,SAAS;QACb,CAAC;QAED,MAAM,UAAU,GAAG,iBAAiB,CAAC,SAAS,CAAC,CAAC;QAEhD,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YAC5B,YAAY,CAAC,UAAU,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;YAE1C,IAAI,UAAU,EAAE,CAAC;gBACb,YAAY,CAAC,aAAa,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;YACjD,CAAC;QACL,CAAC;IACL,CAAC;IAED,+FAA+F;IAC/F,KAAK,MAAM,SAAS,IAAI,UAAU,CAAC,UAAU,EAAE,CAAC;QAC5C,IAAI,CAAC,EAAE,CAAC,mBAAmB,CAAC,SAAS,CAAC,IAAI,SAAS,CAAC,eAAe,EAAE,CAAC;YAClE,SAAS;QACb,CAAC;QAED,IAAI,CAAC,SAAS,CAAC,YAAY,IAAI,CAAC,EAAE,CAAC,cAAc,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,CAAC;YACxE,SAAS;QACb,CAAC;QAED,KAAK,MAAM,OAAO,IAAI,SAAS,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC;YACpD,MAAM,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;YACvC,MAAM,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC;YAClF,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;YAExC,IAAI,KAAK,EAAE,CAAC;gBACR,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;oBACvB,YAAY,CAAC,aAAa,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC;gBACpD,CAAC;YACL,CAAC;QACL,CAAC;IACL,CAAC;IAED,OAAO,aAAa,CAAC;AACzB,CAAC;AAED;;;;GAIG;AACH,SAAgB,4BAA4B,CACxC,gBAA+B,EAC/B,eAAuB,EACvB,aAAuB;IAEvB,MAAM,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAEzC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACnB,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,+BAA+B,EAAE,CAAC;IAChF,CAAC;IAED,MAAM,cAAc,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC1C,MAAM,UAAU,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC3C,MAAM,OAAO,GAAG,uBAAuB,CAAC,gBAAgB,EAAE,cAAc,CAAC,CAAC;IAE1E,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,0BAA0B,EAAE,CAAC;IAC3E,CAAC;IAED,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,aAAa,CAAC,CAAC;IAE/C,KAAK,MAAM,SAAS,IAAI,OAAO,EAAE,CAAC;QAC9B,MAAM,IAAI,GAAG,8BAA8B,CAAC,SAAS,CAAC,CAAC;QAEvD,IAAI,CAAC,IAAI,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YACtC,SAAS;QACb,CAAC;QAED,IAAI,EAAE,CAAC,mBAAmB,CAAC,SAAS,CAAC,EAAE,CAAC;YACpC,KAAK,MAAM,WAAW,IAAI,SAAS,CAAC,eAAe,CAAC,YAAY,EAAE,CAAC;gBAC/D,IAAI,EAAE,CAAC,YAAY,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;oBAC5E,OAAO,IAAI,CAAC;gBAChB,CAAC;YACL,CAAC;YAED,SAAS;QACb,CAAC;QAED,MAAM,IAAI,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAC;QAEzC,IAAI,IAAI,KAAK,UAAU,EAAE,CAAC;YACtB,OAAO,IAAI,CAAC;QAChB,CAAC;IACL,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,sDAAsD,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;AAClI,CAAC;AAED,8EAA8E;AAC9E,iBAAiB;AACjB,8EAA8E;AAE9E,SAAS,2BAA2B,CAAC,UAAkB;IACnD,MAAM,EAAE,mBAAmB,EAAE,GAAG,gBAAgB,EAAE,CAAC;IAEnD,IAAI,mBAAmB,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;QACtC,OAAO,mBAAmB,CAAC,GAAG,CAAC,UAAU,CAAE,CAAC;IAChD,CAAC;IAED,uFAAuF;IACvF,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IAEvD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC7B,mBAAmB,CAAC,GAAG,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QAE1C,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,MAAM,MAAM,GAAG,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IACnD,MAAM,IAAI,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;IAErC,mBAAmB,CAAC,GAAG,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IAE1C,OAAO,IAAI,CAAC;AAChB,CAAC;AAED,SAAS,kBAAkB,CAAC,UAAkB,EAAE,MAAc,EAAE,IAAmB;IAC/E,MAAM,kBAAkB,GAAG,2BAA2B,CAAC,UAAU,CAAC,CAAC;IAEnE,IAAI,kBAAkB,KAAK,MAAM,EAAE,CAAC;QAChC,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,IAAI,kBAAkB,EAAE,CAAC;QACrB,OAAO,kBAAkB,CAAC;IAC9B,CAAC;IAED,MAAM,cAAc,GAAG,GAAG,MAAM,GAAG,CAAC;IAEpC,KAAK,MAAM,MAAM,IAAI,IAAI,EAAE,CAAC;QACxB,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;QAEjC,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;YAC/B,SAAS;QACb,CAAC;QAED,IAAI,QAAQ,KAAK,MAAM,EAAE,CAAC;YACtB,IAAI,MAAM,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;gBAAC,OAAO,OAAO,CAAC;YAAC,CAAC;YAChD,IAAI,MAAM,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;gBAAC,OAAO,UAAU,CAAC;YAAC,CAAC;QAC1D,CAAC;QAED,IAAI,CAAC,MAAM,CAAC,QAAQ,KAAK,MAAM,IAAI,MAAM,CAAC,KAAK,KAAK,UAAU,CAAC,IAAI,QAAQ,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,CAAC;YACrG,OAAO,OAAO,CAAC;QACnB,CAAC;IACL,CAAC;IAED,OAAO,UAAU,CAAC;AACtB,CAAC;AAED,8EAA8E;AAC9E,8BAA8B;AAC9B,8EAA8E;AAE9E,SAAS,qBAAqB,CAAC,IAAY,EAAE,QAAgB,EAAE,MAAc;IACzE,MAAM,QAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAC3C,MAAM,SAAS,GAAG,QAAQ,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAC5C,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;IACjD,MAAM,QAAQ,GAAG,CAAC,UAAU,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACrF,MAAM,IAAI,GAAG,CAAC,UAAU,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;IACjF,MAAM,KAAK,GAAG,CAAC,SAAS,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC;IAE7D,MAAM,MAAM,GAAgB;QACxB,CAAC,8BAAqB,CAAC,EAAE,IAAI;QAC7B,IAAI;QACJ,IAAI;QACJ,QAAQ;QACR,KAAK;QACL,IAAI,EAAE;YACF,QAAQ,EAAE,GAAG,8BAAqB,kBAAkB;YACpD,MAAM;YACN,QAAQ,EAAE,CAAC;YACX,IAAI,EAAE,8BAAqB;SAC9B;KACJ,CAAC;IAEF,IAAI,IAAI,KAAK,UAAU,IAAI,IAAI,KAAK,OAAO,EAAE,CAAC;QAC1C,MAAM,CAAC,MAAM,GAAG;YACZ;gBACI,IAAI,EAAE,MAAM;gBACZ,QAAQ,EAAE,IAAI;gBACd,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,EAAE;aACzB;SACJ,CAAC;IACN,CAAC;IAED,IAAI,IAAI,KAAK,UAAU,EAAE,CAAC;QACtB,MAAM,CAAC,OAAO,GAAG;YACb;gBACI,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,EAAE;aACzB;SACJ,CAAC;IACN,CAAC;IAED,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACrB,MAAM,CAAC,IAAI,GAAG,EAAE,KAAK,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC;QACtC,MAAM,CAAC,MAAM,GAAG;YACZ;gBACI,IAAI,EAAE,MAAM;gBACZ,QAAQ,EAAE,IAAI;gBACd,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,EAAE;aACzB;SACJ,CAAC;QACF,MAAM,CAAC,OAAO,GAAG;YACb;gBACI,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,EAAE;aACzB;SACJ,CAAC;IACN,CAAC;IAED,IAAI,QAAQ,EAAE,CAAC;QACX,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC/B,CAAC;IAED,OAAO,MAAM,CAAC;AAClB,CAAC;AAED,SAAgB,qBAAqB,CAAC,QAAiC,EAAE,IAAmB;IACxF,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAAU,CAAC;IAC5C,MAAM,cAAc,GAAG,IAAI,GAAG,EAAqE,CAAC;IACpG,MAAM,cAAc,GAAa,EAAE,CAAC;IAEpC,KAAK,MAAM,MAAM,IAAI,IAAI,EAAE,CAAC;QACxB,IAAI,OAAO,MAAM,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;YACtC,iBAAiB,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC3C,CAAC;IACL,CAAC;IAED,KAAK,MAAM,CAAC,UAAU,EAAE,gBAAgB,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QACpE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE,CAAC;YACnC,SAAS;QACb,CAAC;QAED,KAAK,MAAM,MAAM,IAAI,gBAAgB,EAAE,CAAC;YACpC,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;gBAChE,cAAc,CAAC,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;gBACzE,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAChC,CAAC;YAED,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAEhC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBACpC,MAAM,cAAc,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBAEnD,IAAI,iBAAiB,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,cAAc,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE,CAAC;oBAC9E,SAAS;gBACb,CAAC;gBAED,cAAc,CAAC,GAAG,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;gBAChD,cAAc,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;YACxC,CAAC;QACL,CAAC;IACL,CAAC;IAED,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QACzB,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC;QAE1D,IAAI,OAAO,KAAK,CAAC,EAAE,CAAC;YAChB,OAAO,OAAO,CAAC;QACnB,CAAC;QAED,OAAO,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;IAEH,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE;QAC1C,MAAM,IAAI,GAAG,cAAc,CAAC,GAAG,CAAC,QAAQ,CAAE,CAAC;QAC3C,OAAO,qBAAqB,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;AACP,CAAC;AAED,8EAA8E;AAC9E,iCAAiC;AACjC,8EAA8E;AAE9E,SAAS,mBAAmB,CAAC,UAAkB,EAAE,eAAuB,EAAE,mBAA2B;IACjG,MAAM,eAAe,GAAG,eAAe,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,IAAI,eAAe,CAAC;IAC5E,MAAM,YAAY,GAAG,IAAI,MAAM,CAAC,eAAe,eAAe,KAAK,CAAC,CAAC;IAErE,IAAI,YAAY,CAAC,IAAI,CAAC,mBAAmB,CAAC,EAAE,CAAC;QACzC,OAAO,OAAO,CAAC;IACnB,CAAC;IAED,MAAM,eAAe,GAAG,IAAI,MAAM,CAAC,kBAAkB,eAAe,SAAS,CAAC,CAAC;IAE/E,IAAI,eAAe,CAAC,IAAI,CAAC,mBAAmB,CAAC,EAAE,CAAC;QAC5C,OAAO,UAAU,CAAC;IACtB,CAAC;IAED,8DAA8D;IAC9D,yEAAyE;IACzE,uEAAuE;IACvE,2BAA2B;IAC3B,MAAM,gBAAgB,GAAG,IAAI,MAAM,CAAC,mBAAmB,eAAe,KAAK,CAAC,CAAC;IAE7E,IAAI,gBAAgB,CAAC,IAAI,CAAC,mBAAmB,CAAC,EAAE,CAAC;QAC7C,OAAO,WAAW,CAAC;IACvB,CAAC;IAED,MAAM,WAAW,GAAG,IAAI,MAAM,CAAC,cAAc,eAAe,KAAK,CAAC,CAAC;IAEnE,IAAI,WAAW,CAAC,IAAI,CAAC,mBAAmB,CAAC,EAAE,CAAC;QACxC,OAAO,MAAM,CAAC;IAClB,CAAC;IAED,yEAAyE;IACzE,gEAAgE;IAChE,OAAO,2BAA2B,CAAC,UAAU,CAAC,IAAI,UAAU,CAAC;AACjE,CAAC;AAED,SAAS,gCAAgC,CAAC,QAAiC;IACvE,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAkB,CAAC;IAErD,KAAK,MAAM,CAAC,UAAU,EAAE,gBAAgB,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QACpE,KAAK,MAAM,eAAe,IAAI,gBAAgB,EAAE,CAAC;YAC7C,kBAAkB,CAAC,GAAG,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;QACxD,CAAC;IACL,CAAC;IAED,OAAO,kBAAkB,CAAC;AAC9B,CAAC;AAED,SAAS,eAAe,CAAC,KAAa,EAAE,MAAc;IAClD,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAC7C,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAExC,OAAO,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;AAC9F,CAAC;AAED,SAAS,0BAA0B,CAAC,UAAkB,EAAE,eAAuB;IAC3E,IAAI,QAAQ,GAAG,eAAe,CAAC;IAE/B,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,mBAAmB,EAAE,EAAE,CAAC,CAAC;IACrD,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,6BAA6B,EAAE,EAAE,CAAC,CAAC;IAC/D,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,wBAAwB,EAAE,EAAE,CAAC,CAAC;IAC1D,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;IAEhD,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;AAC3B,CAAC;AAED,SAAS,WAAW,CAAC,QAAgB,EAAE,SAAiB,EAAE,aAAqB;IAC3E,MAAM,MAAM,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC,EAAE,aAAa,CAAC,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;IAC/E,MAAM,OAAO,GAAG,IAAI,MAAM,CAAC,MAAM,SAAS,KAAK,EAAE,GAAG,CAAC,CAAC;IAEtD,kEAAkE;IAClE,oEAAoE;IACpE,yEAAyE;IACzE,MAAM,cAAc,GAA0C,EAAE,CAAC;IACjE,MAAM,cAAc,GAAG,qBAAqB,CAAC;IAC7C,IAAI,EAA0B,CAAC;IAE/B,OAAO,CAAC,EAAE,GAAG,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;QACnD,cAAc,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;IAC3E,CAAC;IAED,OAAO,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;QACvD,IAAI,MAAM,IAAI,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;YAC/E,OAAO,KAAK,CAAC;QACjB,CAAC;QAED,wDAAwD;QACxD,KAAK,MAAM,MAAM,IAAI,cAAc,EAAE,CAAC;YAClC,IAAI,MAAM,IAAI,MAAM,CAAC,KAAK,IAAI,MAAM,GAAG,MAAM,CAAC,GAAG,EAAE,CAAC;gBAChD,OAAO,KAAK,CAAC;YACjB,CAAC;QACL,CAAC;QAED,OAAO,aAAa,CAAC;IACzB,CAAC,CAAC,CAAC;AACP,CAAC;AAMD,MAAM,iBAAiB,GAAwC;IAC3D,iCAAiC,EAAE;QAC/B,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,2BAA2B,EAAE,WAAW,EAAE,kBAAkB,EAAE;QAC1F,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,qBAAqB,EAAE;KAClF;IACD,8CAA8C,EAAE;QAC5C,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,qBAAqB,EAAE;KAClF;IACD,gCAAgC,EAAE;QAC9B,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,uBAAuB,EAAE;KACtF;IACD,qBAAqB,EAAE;QACnB,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE,+BAA+B,EAAE;KAChG;IACD,oBAAoB,EAAE;QAClB,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,+BAA+B,EAAE;QAC7F,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,wCAAwC,EAAE,WAAW,EAAE,sCAAsC,EAAE;KAC9H;IACD,qCAAqC,EAAE;QACnC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,OAAO,EAAE;KACxE;IACD,uCAAuC,EAAE;QACrC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,SAAS,EAAE;KAC5E;IACD,8BAA8B,EAAE;QAC5B,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,iBAAiB,EAAE,aAAa,EAAE,oCAAoC,EAAE;KACzG;IACD,uCAAuC,EAAE;QACrC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,6BAA6B,EAAE,WAAW,EAAE,2CAA2C,EAAE;KACxH;CACJ,CAAC;AAEF,SAAS,6BAA6B,CAAC,UAAkB,EAAE,eAAuB;IAC9E,IAAI,QAAQ,GAAG,eAAe,CAAC;IAC/B,MAAM,KAAK,GAAG,iBAAiB,CAAC,UAAU,CAAC,CAAC;IAE5C,IAAI,KAAK,EAAE,CAAC;QACR,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACvB,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;gBAC1B,QAAQ,GAAG,WAAW,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;YACzE,CAAC;iBACI,CAAC;gBACF,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;YAChE,CAAC;QACL,CAAC;IACL,CAAC;IAED,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,sBAAsB,EAAE,uCAAuC,CAAC,CAAC;IAC7F,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,yBAAyB,EAAE,cAAc,CAAC,CAAC;IACvE,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,sCAAsC,EAAE,+BAA+B,CAAC,CAAC;IACrG,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,kCAAkC,EAAE,+BAA+B,CAAC,CAAC;IAEjG,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;AAC3B,CAAC;AAED,SAAS,aAAa,CAAC,UAAkB;IACrC,OAAO,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,CAAC;AACxE,CAAC;AAED,SAAS,4BAA4B,CAAC,MAAc,EAAE,SAAiB;IACnE,MAAM,eAAe,GAAG,qBAAqB,CAAC;IAC9C,MAAM,eAAe,GAAG,wCAAwC,CAAC;IACjE,MAAM,WAAW,GAAa,EAAE,CAAC;IACjC,IAAI,UAAkC,CAAC;IAEvC,OAAO,CAAC,UAAU,GAAG,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;QAC1D,eAAe,CAAC,SAAS,GAAG,uCAAuC,CAAC,MAAM,EAAE,UAAU,CAAC,KAAK,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;QACrH,MAAM,UAAU,GAAG,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAEhD,IAAI,CAAC,UAAU,IAAI,UAAU,CAAC,CAAC,CAAC,KAAK,SAAS,EAAE,CAAC;YAC7C,SAAS;QACb,CAAC;QAED,MAAM,QAAQ,GAAG,oDAAoD,CAAC;QACtE,IAAI,QAAgC,CAAC;QAErC,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;YACxD,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;QAClC,CAAC;QAED,MAAM;IACV,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC;AAC5C,CAAC;AAED,SAAS,wBAAwB,CAAC,UAAkB,EAAE,SAAiB;IACnE,MAAM,UAAU,GAAG,4BAA4B,CAAC,aAAa,CAAC,UAAU,CAAC,EAAE,SAAS,CAAC,CAAC;IAEtF,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1B,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,OAAO,aAAa,SAAS,YAAY,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;AAC1E,CAAC;AAED,SAAS,6BAA6B,CAClC,oBAAyC,EACzC,kBAAuC;IAEvC,MAAM,uBAAuB,GAAG,IAAI,GAAG,EAAkB,CAAC;IAC1D,MAAM,gBAAgB,GAAG,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;IAElG,KAAK,MAAM,eAAe,IAAI,gBAAgB,EAAE,CAAC;QAC7C,MAAM,UAAU,GAAG,kBAAkB,CAAC,GAAG,CAAC,eAAe,CAAE,CAAC;QAC5D,MAAM,iBAAiB,GAAG,oBAAoB,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QAE/D,IAAI,CAAC,iBAAiB,EAAE,CAAC;YACrB,MAAM,IAAI,KAAK,CAAC,0DAA0D,UAAU,IAAI,CAAC,CAAC;QAC9F,CAAC;QAED,MAAM,eAAe,GAAG,eAAe,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAG,CAAC;QAE1D,2EAA2E;QAC3E,yEAAyE;QACzE,4EAA4E;QAC5E,kFAAkF;QAClF,MAAM,2BAA2B,GAAG,6BAA6B,CAAC,UAAU,EAAE,iBAAiB,CAAC,CAAC;QAEjG,MAAM,YAAY,GAAG,mBAAmB,CAAC,UAAU,EAAE,eAAe,EAAE,2BAA2B,CAAC,CAAC;QACnG,MAAM,KAAK,GAAG,2BAA2B,CAAC,2BAA2B,EAAE,eAAe,EAAE,YAAY,CAAC,CAAC;QACtG,IAAI,WAAW,GAAG,2BAA2B,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;QAEvF,IAAI,YAAY,KAAK,OAAO,EAAE,CAAC;YAC3B,WAAW,GAAG,yBAAyB,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;YAEtE,MAAM,cAAc,GAAG,wBAAwB,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC;YAE7E,IAAI,cAAc,EAAE,CAAC;gBACjB,WAAW,IAAI,OAAO,cAAc,EAAE,CAAC;YAC3C,CAAC;QACL,CAAC;QAED,0EAA0E;QAC1E,uBAAuB,CAAC,GAAG,CAAC,eAAe,EAAE,WAAW,CAAC,CAAC;IAC9D,CAAC;IAED,OAAO,uBAAuB,CAAC;AACnC,CAAC;AAED,SAAS,8BAA8B,CAAC,QAAiC;IACrE,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7E,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;IACxF,MAAM,mBAAmB,GAAG,IAAI,GAAG,EAAkB,CAAC;IACtD,MAAM,eAAe,GAAuB;QACxC,MAAM,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM;QAC9B,MAAM,EAAE,EAAE,CAAC,UAAU,CAAC,MAAM;QAC5B,gBAAgB,EAAE,EAAE,CAAC,oBAAoB,CAAC,MAAM;QAChD,WAAW,EAAE,IAAI;QACjB,mBAAmB,EAAE,IAAI;QACzB,OAAO,EAAE,IAAI;QACb,YAAY,EAAE,IAAI;QAClB,MAAM,EAAE,KAAK;KAChB,CAAC;IACF,MAAM,IAAI,GAAG,EAAE,CAAC,kBAAkB,CAAC,eAAe,CAAC,CAAC;IAEpD,MAAM,OAAO,GAAG,EAAE,CAAC,aAAa,CAAC,UAAU,EAAE,eAAe,EAAE;QAC1D,GAAG,IAAI;QACP,SAAS,EAAE,CAAC,QAAgB,EAAE,OAAe,EAAE,EAAE;YAC7C,IAAI,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;gBAC7B,mBAAmB,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,CAAC;YAC/D,CAAC;QACL,CAAC;KACJ,CAAC,CAAC;IAEH,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAClC,MAAM,WAAW,GAAG,EAAE;SACjB,qBAAqB,CAAC,OAAO,CAAC;SAC9B,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC;SAC9B,MAAM,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;IAEtD,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACzB,MAAM,oBAAoB,GAAG,EAAE,CAAC,oCAAoC,CAAC,WAAW,EAAE;YAC9E,mBAAmB,EAAE,GAAG,EAAE,CAAC,SAAS;YACpC,oBAAoB,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ;YAC5C,UAAU,EAAE,GAAG,EAAE,CAAC,IAAI;SACzB,CAAC,CAAC;QAEH,MAAM,IAAI,KAAK,CAAC,wDAAwD,oBAAoB,EAAE,CAAC,CAAC;IACpG,CAAC;IAED,MAAM,oBAAoB,GAAG,IAAI,GAAG,EAAkB,CAAC;IAEvD,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;QACnC,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;QAC3D,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC;QAChF,MAAM,eAAe,GAAG,mBAAmB,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QAE7D,IAAI,CAAC,eAAe,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,oDAAoD,UAAU,IAAI,CAAC,CAAC;QACxF,CAAC;QAED,oBAAoB,CAAC,GAAG,CAAC,UAAU,EAAE,0BAA0B,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC,CAAC;IAClG,CAAC;IAED,OAAO,oBAAoB,CAAC;AAChC,CAAC;AAED,8EAA8E;AAC9E,qBAAqB;AACrB,8EAA8E;AAE9E,SAAgB,6BAA6B,CAAC,GAAW,EAAE,QAAiC;IACxF,MAAM,oBAAoB,GAAG,8BAA8B,CAAC,QAAQ,CAAC,CAAC;IACtE,MAAM,kBAAkB,GAAG,gCAAgC,CAAC,QAAQ,CAAC,CAAC;IACtE,MAAM,uBAAuB,GAAG,6BAA6B,CAAC,oBAAoB,EAAE,kBAAkB,CAAC,CAAC;IAExG,yEAAyE;IACzE,qEAAqE;IACrE,MAAM,UAAU,GAAG,EAAE,CAAC,gBAAgB,CAAC,aAAa,EAAE,GAAG,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;IAC3G,MAAM,KAAK,GAAG,qBAAqB,CAAC,UAAU,CAAC,CAAC;IAQhD,MAAM,GAAG,GAAoB,EAAE,CAAC;IAEhC,KAAK,MAAM,CAAC,eAAe,EAAE,mBAAmB,CAAC,IAAI,uBAAuB,EAAE,CAAC;QAC3E,MAAM,UAAU,GAAG,kBAAkB,CAAC,GAAG,CAAC,eAAe,CAAE,CAAC;QAC5D,MAAM,YAAY,GAAG,mBAAmB,CAAC,UAAU,EAAE,eAAe,EAAE,mBAAmB,CAAC,CAAC;QAC3F,IAAI,YAAoB,CAAC;QACzB,IAAI,UAAkB,CAAC;QAEvB,IAAI,CAAC;YACD,MAAM,KAAK,GAAG,4BAA4B,CAAC,KAAK,EAAE,eAAe,EAAE,YAAY,CAAC,CAAC;YAEjF,YAAY,GAAG,KAAK,CAAC,KAAK,CAAC;YAC3B,UAAU,GAAG,KAAK,CAAC,GAAG,CAAC;QAC3B,CAAC;QACD,OAAO,KAAK,EAAE,CAAC;YACX,iFAAiF;YACjF,IAAI,YAAY,KAAK,OAAO,IAAI,YAAY,KAAK,WAAW,EAAE,CAAC;gBAC3D,MAAM,KAAK,CAAC;YAChB,CAAC;YAED,oFAAoF;YACpF,YAAY,GAAG,+BAA+B,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC;YACvE,UAAU,GAAG,YAAY,CAAC;QAC9B,CAAC;QAED,GAAG,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,UAAU,EAAE,QAAQ,EAAE,mBAAmB,EAAE,CAAC,CAAC;IACtF,CAAC;IAED,4DAA4D;IAC5D,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;IAEtC,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,IAAI,MAAM,GAAG,CAAC,CAAC;IAEf,KAAK,MAAM,EAAE,IAAI,GAAG,EAAE,CAAC;QACnB,iDAAiD;QACjD,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,MAAM,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;QAE/C,yCAAyC;QACzC,MAAM,SAAS,GAAG,GAAG,CAAC,WAAW,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;QAC1D,MAAM,UAAU,GAAG,GAAG,CAAC,SAAS,CAAC,SAAS,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC;QACtD,MAAM,WAAW,GAAG,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC7C,MAAM,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACjD,IAAI,WAAW,GAAG,eAAe,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAEvD,IAAI,EAAE,CAAC,KAAK,GAAG,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;YAC7C,WAAW,GAAG,KAAK,WAAW,EAAE,CAAC;QACrC,CAAC;QAED,qFAAqF;QACrF,MAAM,YAAY,GAAG,EAAE,CAAC,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAC9D,MAAM,gBAAgB,GAAG,YAAY,KAAK,IAAI,IAAI,YAAY,KAAK,IAAI,CAAC;QAExE,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAE3B,IAAI,gBAAgB,EAAE,CAAC;YACnB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACxB,CAAC;QAED,MAAM,GAAG,EAAE,CAAC,GAAG,CAAC;IACpB,CAAC;IAED,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;IAErC,mEAAmE;IACnE,gEAAgE;IAChE,kEAAkE;IAClE,sEAAsE;IACtE,mEAAmE;IACnE,OAAO,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,CAAC,KAAK,EAAE,EAAE;QACvD,4DAA4D;QAC5D,MAAM,GAAG,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;QAEnD,OAAO,GAAG,GAAG,GAAG,GAAG,EAAE,CAAC;IAC1B,CAAC,CAAC,CAAC;AACP,CAAC;AAED,SAAgB,uBAAuB,CAAC,GAAW,EAAE,gBAA0B;IAC3E,MAAM,aAAa,GAAG,CAAC,8BAAqB,EAAE,8BAAqB,CAAC,CAAC;IAErE,KAAK,MAAM,MAAM,IAAI,aAAa,EAAE,CAAC;QACjC,IAAI,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;YACvB,MAAM,IAAI,KAAK,CAAC,gEAAgE,MAAM,IAAI,CAAC,CAAC;QAChG,CAAC;IACL,CAAC;IAED,wEAAwE;IACxE,MAAM,UAAU,GAAG,EAAE,CAAC,gBAAgB,CAAC,aAAa,EAAE,GAAG,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;IAC3G,MAAM,KAAK,GAAG,qBAAqB,CAAC,UAAU,CAAC,CAAC;IAEhD,MAAM,gBAAgB,GAAG,CAAC,uBAAuB,EAAE,sBAAsB,EAAE,sCAAsC,CAAC,CAAC;IAEnH,KAAK,MAAM,eAAe,IAAI,gBAAgB,EAAE,CAAC;QAC7C,MAAM,KAAK,GAAG,4BAA4B,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC;QACnE,MAAM,eAAe,GAAG,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;QAE9D,KAAK,MAAM,OAAO,IAAI,gBAAgB,EAAE,CAAC;YACrC,IAAI,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,EAAE,CAAC;gBAChC,MAAM,IAAI,KAAK,CAAC,4DAA4D,eAAe,MAAM,OAAO,IAAI,CAAC,CAAC;YAClH,CAAC;QACL,CAAC;IACL,CAAC;AACL,CAAC;AAED,SAAgB,0BAA0B,CAAC,GAAW;IAClD,OAAO,GAAG,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;AACvC,CAAC"} \ No newline at end of file diff --git a/scripts/tsgen/bin/Parser.js b/scripts/tsgen/bin/Parser.js index 445111dc71..7f62fd85eb 100644 --- a/scripts/tsgen/bin/Parser.js +++ b/scripts/tsgen/bin/Parser.js @@ -33,13 +33,15 @@ var __importStar = (this && this.__importStar) || (function () { }; })(); Object.defineProperty(exports, "__esModule", { value: true }); -exports.Parser = void 0; +exports.Parser = exports.SYNTHETIC_META_MARKER = exports.SYNTHETIC_DOCLET_FLAG = void 0; const dom = __importStar(require("dts-dom")); /** * Note that this Parser only works with jsdoc 3.6.6 output. * Downgrading, or upgrading jsdoc will cause it to break. */ const regexEndLine = /^(.*)\r\n|\n|\r/gm; +exports.SYNTHETIC_DOCLET_FLAG = '_syntheticTsgen'; +exports.SYNTHETIC_META_MARKER = '[tsgen-synthetic]'; class Parser { constructor(docs) { this.topLevel = []; @@ -72,6 +74,8 @@ class Parser { result = result.concat(this.topLevel.reduce((out, obj) => { return out + dom.emit(obj); }, '')); + // Workaround: dts-dom omits the space before `extends` in interface declarations + result = result.replace(/\binterface (\w+)extends /g, 'interface $1 extends '); if (ignored.length > 0) { console.log('ignored top level properties:'); console.log(ignored); @@ -168,13 +172,17 @@ class Parser { obj = this.createEvent(doclet); break; default: - console.log('Ignored doclet kind: ' + doclet.kind); + if (!doclet[exports.SYNTHETIC_DOCLET_FLAG]) { + console.log('Ignored doclet kind: ' + doclet.kind); + } break; } if (obj) { if (container[doclet.longname]) { - console.log('Warning: ignoring duplicate doc name: ' + doclet.longname); - console.log('Meta: ', doclet.meta); + if (!doclet[exports.SYNTHETIC_DOCLET_FLAG]) { + console.log('Warning: ignoring duplicate doc name: ' + doclet.longname); + console.log('Meta: ', doclet.meta); + } docs.splice(i--, 1); continue; } @@ -195,8 +203,10 @@ class Parser { let obj = (doclet.kind === 'namespace') ? this.namespaces[doclet.longname] : this.objects[doclet.longname]; // console.log(`${doclet.longname} - Kind: ${doclet.kind}`); if (!obj) { - console.log(`${doclet.longname} - Kind: ${doclet.kind}`); - console.log(`Warning: Didn't find object`); + if (!doclet[exports.SYNTHETIC_DOCLET_FLAG]) { + console.log(`${doclet.longname} - Kind: ${doclet.kind}`); + console.log(`Warning: Didn't find object`); + } continue; } if (!doclet.memberof) { @@ -206,20 +216,26 @@ class Parser { let isNamespaceMember = doclet.kind === 'class' || doclet.kind === 'typedef' || doclet.kind == 'namespace' || doclet.isEnum; let parent = isNamespaceMember ? this.namespaces[doclet.memberof] : (this.objects[doclet.memberof] || this.namespaces[doclet.memberof]); if (!parent) { - console.log(`${doclet.longname} - Kind: ${doclet.kind}`); - console.log(`PARENT WARNING: ${doclet.longname} in ${doclet.meta.filename}@${doclet.meta.lineno} has parent '${doclet.memberof}' that is not defined.`); + if (!doclet[exports.SYNTHETIC_DOCLET_FLAG]) { + console.log(`${doclet.longname} - Kind: ${doclet.kind}`); + console.log(`PARENT WARNING: ${doclet.longname} in ${doclet.meta.filename}@${doclet.meta.lineno} has parent '${doclet.memberof}' that is not defined.`); + } continue; } if (!parent.kind) { - console.log(`PARENT KIND WARNING: ${doclet.longname} in ${doclet.meta.filename}@${doclet.meta.lineno} has parent '${doclet.memberof}' that is not defined.`); + if (!doclet[exports.SYNTHETIC_DOCLET_FLAG]) { + console.log(`PARENT KIND WARNING: ${doclet.longname} in ${doclet.meta.filename}@${doclet.meta.lineno} has parent '${doclet.memberof}' that is not defined.`); + } } if (parent.members) { parent.members.push(obj); } else { - console.log(`${doclet.longname} - Kind: ${doclet.kind}`); - console.log('Could not find members array'); - console.log(parent); + if (!doclet[exports.SYNTHETIC_DOCLET_FLAG]) { + console.log(`${doclet.longname} - Kind: ${doclet.kind}`); + console.log('Could not find members array'); + console.log(parent); + } } obj._parent = parent; // class / interface members have methods, not functions @@ -264,6 +280,7 @@ class Parser { } } resolveParents(docs) { + var _a; console.log('------------------------------------------------------------------'); console.log('Resolve Parents'); console.log('------------------------------------------------------------------'); @@ -287,6 +304,24 @@ class Parser { } else { o.implements.push(dom.create.interface(name)); + // Add a companion interface declaration for declaration merging so + // that mixin members are accessible as class-instance members. + // TypeScript's `implements` only constrains at definition time; a + // companion `interface Foo extends Mixin {}` in the same namespace + // is the idiomatic way to expose mixin members on the class type. + const parentNs = this.namespaces[doclet.memberof]; + if (parentNs) { + // Reuse an existing companion interface for this class if one + // was already created by a previous mixin in the same loop, + // avoiding duplicate interface declarations with the same name. + let companion = parentNs.members.find((m) => m.kind === 'interface' && m.name === doclet.name); + if (!companion) { + companion = dom.create.interface(doclet.name); + companion.baseTypes = (_a = companion.baseTypes) !== null && _a !== void 0 ? _a : []; + parentNs.members.push(companion); + } + companion.baseTypes.push(dom.create.interface(name)); + } } } } @@ -478,6 +513,8 @@ class Parser { processTypeName(name) { if (name === 'float') return 'number'; + if (name === 'String') + return 'string'; if (name === 'function') return 'Function'; if (name === 'Array.') @@ -485,6 +522,9 @@ class Parser { if (name === 'array') return 'any[]'; // if (name === 'object') return '{[key: string]: any}'; + if (name.includes('<')) { + name = name.replace(/([<,]\s*)String(?=\s*[,>])/g, '$1string'); + } if (name.startsWith('Array<')) { let matches = name.match(/^Array<(.*)>$/); if (matches && matches[1]) { diff --git a/scripts/tsgen/bin/Parser.js.map b/scripts/tsgen/bin/Parser.js.map index f3243d4b15..c13fd2afba 100644 --- a/scripts/tsgen/bin/Parser.js.map +++ b/scripts/tsgen/bin/Parser.js.map @@ -1 +1 @@ -{"version":3,"file":"Parser.js","sourceRoot":"","sources":["../src/Parser.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA+B;AAE/B;;;GAGG;AAEH,MAAM,YAAY,GAAG,mBAAmB,CAAC;AAEzC,MAAa,MAAM;IAMf,YAAY,IAAW;QAEnB,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACnB,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAClB,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QAErB,qDAAqD;QACrD,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;QAExB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAE1B,yCAAyC;QACzC,yIAAyI;QACzI,kDAAkD;QAClD,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;QAE9B,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAE1B,OAAO,CAAC,GAAG,CAAC,oEAAoE,CAAC,CAAC;QAClF,OAAO,CAAC,GAAG,CAAC,sCAAsC,CAAC,CAAC;QACpD,OAAO,CAAC,GAAG,CAAC,oEAAoE,CAAC,CAAC;QAElF,oBAAoB;QACpB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,EAAE,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QAEjE,qBAAqB;QACrB,MAAM,kBAAkB,GAAG,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAEvD,kBAAkB,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC;QAEnE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;IAC3C,CAAC;IAED,IAAI;QAEA,OAAO,CAAC,GAAG,CAAC,oEAAoE,CAAC,CAAC;QAClF,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QAC3B,OAAO,CAAC,GAAG,CAAC,oEAAoE,CAAC,CAAC;QAElF,IAAI,OAAO,GAAG,EAAE,CAAC;QAEjB,IAAI,MAAM,GAAG,+GAA+G,CAAC;QAE7H,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAW,EAAE,GAA4B,EAAE,EAAE;YACtF,OAAO,GAAG,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC/B,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;QAER,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EACtB,CAAC;YACG,OAAO,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC;YAC7C,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACzB,CAAC;QAED,4DAA4D;QAC5D,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,WAAW,EAAE,wBAAwB,CAAC,CAAC;QAE/D,OAAO,MAAM,CAAC;IAClB,CAAC;IAEO,YAAY,CAAC,IAAW;QAE5B,OAAO,CAAC,GAAG,CAAC,oEAAoE,CAAC,CAAC;QAClF,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;QAC7B,OAAO,CAAC,GAAG,CAAC,oEAAoE,CAAC,CAAC;QAElF,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAEnC,IAAI,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;YAErB,QAAQ,MAAM,CAAC,QAAQ,EACvB,CAAC;gBACG,KAAK,qCAAqC,CAAC;gBAC3C,KAAK,2CAA2C,CAAC;gBACjD,KAAK,yCAAyC,CAAC;gBAC/C,KAAK,yCAAyC,CAAC;gBAC/C,KAAK,4CAA4C,CAAC;gBAClD,KAAK,oCAAoC,CAAC;gBAC1C,KAAK,qCAAqC,CAAC;gBAC3C,KAAK,2CAA2C,CAAC;gBACjD,KAAK,uCAAuC,CAAC;gBAC7C,KAAK,oCAAoC,CAAC;gBAC1C,KAAK,yCAAyC,CAAC;gBAC/C,KAAK,wCAAwC,CAAC;gBAC9C,KAAK,oCAAoC,CAAC;gBAC1C,KAAK,sCAAsC,CAAC;gBAC5C,KAAK,4CAA4C,CAAC;gBAClD,KAAK,2CAA2C,CAAC;gBACjD,KAAK,2CAA2C,CAAC;gBACjD,KAAK,4CAA4C,CAAC;gBAClD,KAAK,oCAAoC,CAAC;gBAC1C,KAAK,uCAAuC,CAAC;gBAC7C,KAAK,2CAA2C,CAAC;gBACjD,KAAK,oCAAoC,CAAC;gBAC1C,KAAK,sCAAsC,CAAC;gBAC5C,KAAK,yCAAyC,CAAC;gBAC/C,KAAK,uCAAuC;oBACxC,MAAM,CAAC,IAAI,GAAG,OAAO,CAAC;oBACtB,MAAM;gBAEV,+BAA+B;gBAC/B,KAAK,mBAAmB,CAAC;gBACzB,KAAK,kBAAkB,CAAC;gBACxB,KAAK,mBAAmB,CAAC;gBACzB,KAAK,4BAA4B,CAAC;gBAClC,KAAK,gCAAgC,CAAC;gBACtC,KAAK,qBAAqB,CAAC;gBAC3B,KAAK,0BAA0B,CAAC;gBAChC,KAAK,yBAAyB,CAAC;gBAC/B,KAAK,mBAAmB,CAAC;gBACzB,KAAK,4BAA4B,CAAC;gBAClC,KAAK,0BAA0B,CAAC;gBAChC,KAAK,6BAA6B,CAAC;gBACnC,KAAK,sBAAsB;oBACvB,sDAAsD;oBACtD,MAAM,CAAC,IAAI,GAAG,QAAQ,CAAC;oBACvB,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC;oBACrB,MAAM;YACd,CAAC;YAED,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,mCAAmC,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,mCAAmC,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,mCAAmC,CAAC,IAAI,CAAC,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EACvP,CAAC;gBACG,MAAM,CAAC,IAAI,GAAG,OAAO,CAAC;YAC1B,CAAC;YAED,kEAAkE;YAElE,IAAI,GAAG,GAA+B,IAAI,CAAC;YAC3C,IAAI,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC;YAE7B,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;gBAClB,KAAK,WAAW;oBACZ,GAAG,GAAG,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;oBACnC,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC;oBAC5B,MAAM;gBACV,KAAK,OAAO;oBACR,GAAG,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;oBAC/B,MAAM;gBACV,KAAK,OAAO;oBACR,GAAG,GAAG,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;oBACnC,MAAM;gBACV,KAAK,QAAQ;oBACT,IAAI,MAAM,CAAC,MAAM,KAAK,IAAI,EAAE,CAAC;wBACzB,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;wBAC9B,MAAM;oBACV,CAAC;gBACL,KAAK,UAAU;oBACX,GAAG,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;oBAChC,MAAM;gBACV,KAAK,UAAU;oBACX,GAAG,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;oBAClC,MAAM;gBACV,KAAK,SAAS;oBACV,GAAG,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;oBACjC,MAAM;gBACV,KAAK,OAAO;oBACR,GAAG,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;oBAC/B,MAAM;gBACV;oBACI,OAAO,CAAC,GAAG,CAAC,uBAAuB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;oBACnD,MAAM;YACd,CAAC;YAED,IAAI,GAAG,EACP,CAAC;gBACG,IAAI,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,EAC9B,CAAC;oBACG,OAAO,CAAC,GAAG,CAAC,wCAAwC,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;oBACxE,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;oBAEnC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;oBACpB,SAAS;gBACb,CAAC;gBAED,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,GAAG,CAAC;gBAEjC,IAAI,MAAM,CAAC,WAAW,EACtB,CAAC;oBACG,IAAI,SAAS,GAAG,GAAG,CAAC,YAAY,IAAI,EAAE,CAAC;oBACvC,GAAG,CAAC,YAAY,GAAG,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;gBACpF,CAAC;YACL,CAAC;QACL,CAAC;IACL,CAAC;IAEO,cAAc,CAAC,IAAW;QAE9B,OAAO,CAAC,GAAG,CAAC,oEAAoE,CAAC,CAAC;QAClF,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC/B,OAAO,CAAC,GAAG,CAAC,oEAAoE,CAAC,CAAC;QAElF,IAAI,QAAQ,GAAG,IAAI,GAAG,EAAU,CAAC;QAEjC,KAAK,IAAI,MAAM,IAAI,IAAI,EACvB,CAAC;YACG,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YAE3G,4DAA4D;YAE5D,IAAI,CAAC,GAAG,EACR,CAAC;gBACG,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,QAAQ,YAAY,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;gBACzD,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;gBAE3C,SAAS;YACb,CAAC;YAED,IAAI,CAAC,MAAM,CAAC,QAAQ,EACpB,CAAC;gBACG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,GAA8B,CAAC,CAAC;YACvD,CAAC;iBAED,CAAC;gBACG,IAAI,iBAAiB,GAAG,MAAM,CAAC,IAAI,KAAK,OAAO,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS,IAAI,MAAM,CAAC,IAAI,IAAI,WAAW,IAAI,MAAM,CAAC,MAAM,CAAC;gBAE5H,IAAI,MAAM,GAAG,iBAAiB,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;gBAExI,IAAI,CAAC,MAAM,EACX,CAAC;oBACG,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,QAAQ,YAAY,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;oBACzD,OAAO,CAAC,GAAG,CAAC,mBAAmB,MAAM,CAAC,QAAQ,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,gBAAgB,MAAM,CAAC,QAAQ,wBAAwB,CAAC,CAAC;oBACxJ,SAAS;gBACb,CAAC;gBAED,IAAI,CAAE,MAAc,CAAC,IAAI,EACzB,CAAC;oBACG,OAAO,CAAC,GAAG,CAAC,wBAAwB,MAAM,CAAC,QAAQ,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,gBAAgB,MAAM,CAAC,QAAQ,wBAAwB,CAAC,CAAC;gBACjK,CAAC;gBAED,IAAU,MAAO,CAAC,OAAO,EACzB,CAAC;oBACS,MAAO,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACpC,CAAC;qBAED,CAAC;oBACG,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,QAAQ,YAAY,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;oBACzD,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;oBAC5C,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;gBACxB,CAAC;gBAEK,GAAI,CAAC,OAAO,GAAG,MAAM,CAAC;gBAE5B,wDAAwD;gBACxD,IAAI,CAAE,MAAc,CAAC,IAAI,KAAK,OAAO,IAAK,MAAc,CAAC,IAAI,KAAK,WAAW,CAAC,IAAK,GAAW,CAAC,IAAI,KAAK,UAAU,EAClH,CAAC;oBACI,GAAW,CAAC,IAAI,GAAG,QAAQ,CAAC;gBACjC,CAAC;gBAED,uDAAuD;gBACvD,IAAK,MAAc,CAAC,IAAI,KAAK,WAAW,IAAK,GAAW,CAAC,IAAI,KAAK,UAAU,EAC5E,CAAC;oBACG,IAAI,MAAM,CAAC,IAAI,IAAI,UAAU,EAC7B,CAAC;wBACI,GAAW,CAAC,IAAI,GAAG,OAAO,CAAC;oBAChC,CAAC;yBAED,CAAC;wBACI,GAAW,CAAC,IAAI,GAAG,KAAK,CAAC;oBAC9B,CAAC;gBACL,CAAC;YACL,CAAC;QACL,CAAC;IACL,CAAC;IAEO,kBAAkB,CAAC,IAAW;QAElC,OAAO,CAAC,GAAG,CAAC,oEAAoE,CAAC,CAAC;QAClF,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;QACnC,OAAO,CAAC,GAAG,CAAC,oEAAoE,CAAC,CAAC;QAElF,KAAK,IAAI,MAAM,IAAI,IAAI,EACvB,CAAC;YACG,IAAI,GAAG,GAAG,MAAM,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YAEzG,IAAI,CAAC,GAAG,EACR,CAAC;gBACG,OAAO,CAAC,GAAG,CAAC,oBAAoB,MAAM,CAAC,QAAQ,MAAM,CAAC,CAAC;gBACvD,SAAS;YACb,CAAC;YAED,IAAI,CAAO,GAAI,CAAC,OAAO;gBAAE,SAAS;YAElC,IAAI,MAAM,CAAC,SAAS,EACpB,CAAC;gBACG,4DAA4D;gBAC5D,IAAI,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;gBAEzC,IAAI,CAAC,IAAI,IAAI,CAAO,IAAK,CAAC,OAAO,EACjC,CAAC;oBACG,MAAM,IAAI,MAAM,CAAC,QAAQ,0BAA0B,MAAM,CAAC,QAAQ,0BAA0B,CAAC;gBACjG,CAAC;gBAED,IAAU,IAAK,CAAC,OAAO,CAAC,IAAI,IAAI,WAAW,EAC3C,CAAC;oBACS,GAAI,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAO,GAAI,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;oBACxE,GAAI,CAAC,OAAO,GAAG,IAAI,CAAC;gBAC9B,CAAC;YACL,CAAC;QACL,CAAC;IACL,CAAC;IAEO,cAAc,CAAC,IAAW;QAE9B,OAAO,CAAC,GAAG,CAAC,oEAAoE,CAAC,CAAC;QAClF,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC/B,OAAO,CAAC,GAAG,CAAC,oEAAoE,CAAC,CAAC;QAElF,KAAK,IAAI,MAAM,IAAI,IAAI,EACvB,CAAC;YACG,IAAI,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YAExC,IAAI,CAAC,GAAG,IAAI,MAAM,CAAC,IAAI,KAAK,OAAO;gBAAE,SAAS;YAE9C,IAAI,CAAC,GAAG,GAA2B,CAAC;YAEpC,mBAAmB;YACnB,IAAI,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,EAC7C,CAAC;gBACG,KAAK,IAAI,OAAO,IAAI,MAAM,CAAC,QAAQ,EACnC,CAAC;oBACG,IAAI,IAAI,GAAW,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;oBAEjD,IAAI,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAE,CAAC,CAAC,CAAC,CAAC,CAAA,2EAA2E;oBAEvH,IAAI,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,CAAoD,CAAC;oBAE7F,IAAI,CAAC,QAAQ,EACb,CAAC;wBACG,OAAO,CAAC,GAAG,CAAC,kCAAkC,OAAO,QAAQ,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;oBACpF,CAAC;yBAED,CAAC;wBACG,IAAI,QAAQ,CAAC,IAAI,IAAI,OAAO,EAC5B,CAAC;4BACG,CAAC,CAAC,QAAQ,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;wBACxC,CAAC;6BAED,CAAC;4BACG,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;wBAClD,CAAC;oBACL,CAAC;gBACL,CAAC;YACL,CAAC;QACL,CAAC;IACL,CAAC;IAEO,eAAe,CAAC,MAAW;QAE/B;;;;;;;;;;;;;;;WAeG;QAEC,8CAA8C;QAElD,IAAI,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAE5C,OAAO,GAAG,CAAC;IACf,CAAC;IAEO,WAAW,CAAC,MAAW;QAC3B,IAAI,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAExC,IAAI,MAAM,GAAoB,EAAE,CAAC;QACjC,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;YAChB,IAAI,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;YACtC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;YAC7B,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC;YAEzB,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACjB,IAAK,CAAC,OAAO,GAAG,GAAG,CAAC;QAC9B,CAAC;QAED,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;QAEzC,IAAI,MAAM,CAAC,SAAS;YAChB,MAAM,CAAC,WAAW,GAAG,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC,+BAA+B;QAExG,OAAO,GAAG,CAAC;IACf,CAAC;IAEO,eAAe,CAAC,MAAW;QAC/B,OAAO,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;IAEO,YAAY,CAAC,MAAW;QAC5B,IAAI,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAElC,IAAI,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAEjD,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;QAErC,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAE/B,OAAO,GAAG,CAAC;IACf,CAAC;IAEO,WAAW,CAAC,MAAW;QAE3B,IAAI,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAElC,IAAI,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAE9C,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAE/B,OAAO,GAAG,CAAC;IACf,CAAC;IAEO,UAAU,CAAC,MAAW;QAC1B,IAAI,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAE9C,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAE/B,OAAO,GAAG,CAAC;IACf,CAAC;IAEO,cAAc,CAAC,MAAW;;QAC9B,IAAI,UAAU,GAAa,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;QAEzC,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACjB,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;QACnD,CAAC;QAED,IAAI,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,EAAE,UAAU,CAAC,CAAC;QAC3D,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAE5B,IAAI,MAAA,MAAM,CAAC,OAAO,0CAAE,MAAM,EAAE,CAAC;YACzB,GAAG,CAAC,YAAY,IAAI,cAAc,MAAA,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,0CAAE,WAAW,EAAE,CAAC;QACvE,CAAC;QAED,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC;QAEjD,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAE/B,OAAO,GAAG,CAAC;IACf,CAAC;IAEO,aAAa,CAAC,MAAW;QAC7B,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACtC,IAAI,IAAc,CAAC;QAEnB,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,QAAQ,EAAE,CAAC;YACpC,IAAI,UAAU,GAA8B,EAAE,CAAC;YAE/C,KAAK,IAAI,OAAO,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;gBACpC,IAAI,IAAI,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;gBACtC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBACtB,IAAI,OAAO,CAAC,WAAW;oBACnB,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;YAC9E,CAAC;YAED,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;YAEzC,IAAI,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;gBAC5C,IAAI,iBAAiB,GAAe,EAAE,CAAC;gBACvC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;oBAC9C,iBAAiB,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC9E,CAAC;gBACD,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAC7B,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,iBAAiB,CAAC,CAAC;YACtD,CAAC;QAEL,CAAC;aAAM,CAAC;YACJ,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,UAAU,EAAE,CAAC;gBACrC,IAAI,UAAU,GAAa,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;gBACzC,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;oBACjB,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;gBACnD,CAAC;gBACD,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC;gBAC/C,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAA0C,CAAC,CAAC;YACvE,CAAC;iBAAM,CAAC;gBACJ,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;YAClC,CAAC;QACL,CAAC;QAED,IAAI,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAEhD,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;QAEvC,OAAO,KAAK,CAAC;IACjB,CAAC;IAEO,SAAS,CAAC,MAAW,EAAE,GAAyD;QACpF,IAAI,UAAU,GAAoB,EAAE,CAAC;QAErC,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;YACd,IAAI,QAAQ,GAAG,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YACjD,IAAI,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,kBAAkB,CAAC,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC,CAAC;YACzE,IAAI,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YAEtD,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC3B,CAAC;QAED,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;YAEhB,IAAI,QAAQ,GAAG,KAAK,CAAC;YAErB,GAAG,CAAC,YAAY,GAAG,EAAE,CAAC;YAEtB,KAAK,IAAI,QAAQ,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;gBAEjC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAClB,CAAC;oBACG,OAAO,CAAC,GAAG,CAAC,kBAAkB,MAAM,CAAC,QAAQ,QAAQ,MAAM,CAAC,IAAI,CAAC,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;oBAEnG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;oBACvB,SAAS;gBACb,CAAC;gBAED,IAAI,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;oBAEnC,OAAO,CAAC,GAAG,CAAC,yCAAyC,MAAM,CAAC,QAAQ,QAAQ,MAAM,CAAC,IAAI,CAAC,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;oBAE1H,IAAI,UAAU,GAAG,QAAQ,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,YAAY,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;oBAEzG,IAAI,QAAQ,CAAC,WAAW;wBACpB,GAAG,CAAC,YAAY,IAAI,YAAY,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,WAAW,CAAC,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC,EAAE,GAAG,UAAU,CAAC;yBAClH,IAAI,UAAU,CAAC,MAAM;wBACtB,GAAG,CAAC,YAAY,IAAI,YAAY,QAAQ,CAAC,IAAI,GAAG,GAAG,UAAU,CAAC;oBAClE,SAAS;gBACb,CAAC;gBAED,IAAI,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;gBAC9F,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBAEvB,IAAI,QAAQ,IAAI,QAAQ,CAAC,QAAQ,IAAI,IAAI,EAAE,CAAC;oBACxC,OAAO,CAAC,GAAG,CAAC,+CAA+C,QAAQ,CAAC,IAAI,UAAU,MAAM,CAAC,QAAQ,QAAQ,MAAM,CAAC,IAAI,CAAC,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;oBACvJ,QAAQ,CAAC,QAAQ,GAAG,IAAI,CAAC;gBAC7B,CAAC;gBAED,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;gBAEnC,QAAQ,GAAG,QAAQ,IAAI,QAAQ,CAAC,QAAQ,KAAK,IAAI,CAAC;gBAElD,IAAI,UAAU,GAAG,QAAQ,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,YAAY,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;gBAEzG,IAAI,QAAQ,CAAC,WAAW;oBACpB,GAAG,CAAC,YAAY,IAAI,YAAY,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,WAAW,CAAC,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC,EAAE,GAAG,UAAU,CAAC;qBAClH,IAAI,UAAU,CAAC,MAAM;oBACtB,GAAG,CAAC,YAAY,IAAI,YAAY,QAAQ,CAAC,IAAI,GAAG,GAAG,UAAU,CAAC;YACtE,CAAC;QACL,CAAC;QAED,GAAG,CAAC,UAAU,GAAG,UAAU,CAAC;IAChC,CAAC;IAEO,SAAS,CAAC,OAAY,EAAE,YAAY,GAAG,GAAG,CAAC,IAAI,CAAC,IAAI;QACxD,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;YAC5B,OAAO,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC;QACxB,CAAC;aAAM,CAAC;YACJ,IAAI,KAAK,GAAe,EAAE,CAAC;YAC3B,KAAK,IAAI,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;gBAElC,IAAI,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;gBAElC,IAAI,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,kBAAkB,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC;gBAErE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACrB,CAAC;YACD,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;gBACnB,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YAC7B,CAAC;YACD,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC;gBAAE,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;;gBAClC,OAAO,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACxC,CAAC;IACL,CAAC;IAEO,eAAe,CAAC,IAAY;QAChC,IAAI,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;YAC1B,IAAI,GAAY,IAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACjD,CAAC;QACD,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,KAAK,oBAAoB,EAAE,CAAC;YAC5D,IAAI,GAAY,IAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAChD,CAAC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;IAEO,eAAe,CAAC,IAAY;QAChC,IAAI,IAAI,KAAK,OAAO;YAAE,OAAO,QAAQ,CAAC;QACtC,IAAI,IAAI,KAAK,UAAU;YAAE,OAAO,UAAU,CAAC;QAC3C,IAAI,IAAI,KAAK,oBAAoB;YAAE,OAAO,YAAY,CAAC;QACvD,IAAI,IAAI,KAAK,OAAO;YAAE,OAAO,OAAO,CAAC;QACrC,wDAAwD;QAExD,IAAI,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC5B,IAAI,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;YAE1C,IAAI,OAAO,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;gBACxB,OAAO,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;YACnD,CAAC;QACL,CAAC;aAAM,IAAI,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;YACpC,IAAI,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;YAE3C,IAAI,OAAO,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;gBACxB,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;oBAChC,IAAI,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;oBAClC,OAAO,UAAU,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;gBAC3F,CAAC;qBAAM,CAAC;oBACJ,OAAO,mBAAmB,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;gBAClE,CAAC;YACL,CAAC;QACL,CAAC;aAAM,IAAI,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;YACpC,IAAI,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;YAE3C,IAAI,OAAO,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;gBACxB,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;oBAChC,IAAI,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;oBAClC,OAAO,UAAU,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,aAAa,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;gBAClG,CAAC;qBAAM,CAAC;oBACJ,OAAO,0BAA0B,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;gBACzE,CAAC;YACL,CAAC;QACL,CAAC;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;IAEO,YAAY,CAAC,MAAW,EAAE,GAAwC;QACtE,GAAG,CAAC,KAAK,GAAG,GAAG,CAAC,gBAAgB,CAAC,IAAI,CAAC;QACtC,IAAI,MAAM,CAAC,QAAQ,KAAK,IAAI,EAAE,CAAC;YAC3B,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,cAAc,CAAC,IAAI,CAAC;YACrC,IAAI,IAAI,GAAwB,GAAI,CAAC,IAAI,CAAC;YAC1C,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC5B,IAAI,IAAI,CAAC,IAAI,IAAI,KAAK;oBAClB,OAAO,CAAC,GAAG,CAAC,uDAAuD,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;gBAC1F,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,mBAAmB;YACrD,CAAC;QACL,CAAC;aAAM,IAAI,MAAM,CAAC,QAAQ,KAAK,IAAI,EAAE,CAAC,CAAA,qDAAqD;YACvF,IAAI,GAAG,CAAC,MAAM,CAAC,KAAK,WAAW;gBAAE,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,cAAc,CAAC,QAAQ,CAAC;;gBACrE,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,gBAAgB,CAAC,QAAQ,CAAC;QACpD,CAAC;QACD,QAAQ,MAAM,CAAC,MAAM,EAAE,CAAC;YACpB,KAAK,WAAW;gBACZ,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,gBAAgB,CAAC,SAAS,CAAC;gBAC5C,MAAM;YACV,KAAK,SAAS;gBACV,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,gBAAgB,CAAC,OAAO,CAAC;gBAC1C,MAAM;QACd,CAAC;QACD,IAAI,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,IAAI,KAAK,UAAU;YAAE,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,gBAAgB,CAAC,QAAQ,CAAC;QAC9F,IAAI,MAAM,CAAC,KAAK,KAAK,QAAQ;YAAE,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,gBAAgB,CAAC,MAAM,CAAC;IAC5E,CAAC;IAEO,cAAc,CAAC,MAAW,EAAE,GAAwG,EAAE,MAAuB;QACjK,IAAI,MAAM,CAAC,IAAI;YACX,KAAK,IAAI,GAAG,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;gBAC1B,IAAI,GAAG,CAAC,aAAa,KAAK,SAAS,EAAE,CAAC;oBAElC;;;;;;uBAMG;oBACH,MAAM,OAAO,GAAY,GAAG,CAAC,KAAM,CAAC,KAAK,CAAC,+EAA+E,CAAC,CAAC;oBAC3H,IAAI,CAAC,OAAO,EAAE,CAAC;wBAAC,SAAS;oBAAC,CAAC;oBAC3B,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,CAAC,GAAG,OAAO,CAAC;oBAE9D,MAAM,SAAS,GAAG,GAAG,CAAC,MAAM,CAAC,aAAa,CACtC,KAAK,EACL,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,CAC9D,CAAC;oBAEF,IAAG,YAAY,IAAI,IAAI,EAAE,CAAC;wBACtB,SAAS,CAAC,WAAW,GAAG,GAAG,CAAC,MAAM,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;oBACnE,CAAC;oBAE2E,GAAI,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;oBAChH,eAAe,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;gBAEzC,CAAC;qBAAM,IAAI,GAAG,CAAC,aAAa,KAAK,YAAY,EAAE,CAAC;oBAC5C,IAAI,OAAO,GAAY,GAAG,CAAC,KAAM,CAAC,KAAK,CAAC,mDAAmD,CAAC,CAAC;oBAC7F,IAAI,OAAO,EACX,CAAC;wBACG,IAAI,YAAY,GAAW,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;wBAE5D,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC;oBACpE,CAAC;gBACL,CAAC;YACL,CAAC;QAEL,SAAS,eAAe,CAAC,aAAqB,EAAE,YAAoB;YAChE,IAAI,aAAa,IAAI,IAAI,EAAE,CAAC;gBACxB,IAAI,SAAS,GAAG,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBACzC,IAAI,MAAM,IAAI,IAAI,EAAE,CAAC;oBACjB,KAAK,IAAI,KAAK,IAAI,MAAM,EAAE,CAAC;wBACvB,IAAI,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;4BACtC,KAAK,CAAC,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAC;wBAC7D,CAAC;oBACL,CAAC;gBACL,CAAC;gBACD,IAAI,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAA,kCAAkC;oBAC7C,GAAI,CAAC,UAAU,GAAG,GAAG,CAAC,MAAM,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAC;gBAC5F,CAAC;gBACD,IAAI,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAA,gCAAgC;oBACzC,GAAI,CAAC,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAC;gBACtF,CAAC;YACL,CAAC;QACL,CAAC;IACL,CAAC;CAEJ;AA/sBD,wBA+sBC"} \ No newline at end of file +{"version":3,"file":"Parser.js","sourceRoot":"","sources":["../src/Parser.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA+B;AAE/B;;;GAGG;AAEH,MAAM,YAAY,GAAG,mBAAmB,CAAC;AAE5B,QAAA,qBAAqB,GAAG,iBAAiB,CAAC;AAC1C,QAAA,qBAAqB,GAAG,mBAAmB,CAAC;AAEzD,MAAa,MAAM;IAMf,YAAY,IAAW;QAEnB,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACnB,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAClB,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QAErB,qDAAqD;QACrD,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;QAExB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAE1B,yCAAyC;QACzC,yIAAyI;QACzI,kDAAkD;QAClD,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;QAE9B,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAE1B,OAAO,CAAC,GAAG,CAAC,oEAAoE,CAAC,CAAC;QAClF,OAAO,CAAC,GAAG,CAAC,sCAAsC,CAAC,CAAC;QACpD,OAAO,CAAC,GAAG,CAAC,oEAAoE,CAAC,CAAC;QAElF,oBAAoB;QACpB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,EAAE,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QAEjE,qBAAqB;QACrB,MAAM,kBAAkB,GAAG,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAEvD,kBAAkB,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC;QAEnE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;IAC3C,CAAC;IAED,IAAI;QAEA,OAAO,CAAC,GAAG,CAAC,oEAAoE,CAAC,CAAC;QAClF,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QAC3B,OAAO,CAAC,GAAG,CAAC,oEAAoE,CAAC,CAAC;QAElF,IAAI,OAAO,GAAG,EAAE,CAAC;QAEjB,IAAI,MAAM,GAAG,+GAA+G,CAAC;QAE7H,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAW,EAAE,GAA4B,EAAE,EAAE;YACtF,OAAO,GAAG,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC/B,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;QAER,iFAAiF;QACjF,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,4BAA4B,EAAE,uBAAuB,CAAC,CAAC;QAE/E,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EACtB,CAAC;YACG,OAAO,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC;YAC7C,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACzB,CAAC;QAED,4DAA4D;QAC5D,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,WAAW,EAAE,wBAAwB,CAAC,CAAC;QAE/D,OAAO,MAAM,CAAC;IAClB,CAAC;IAEO,YAAY,CAAC,IAAW;QAE5B,OAAO,CAAC,GAAG,CAAC,oEAAoE,CAAC,CAAC;QAClF,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;QAC7B,OAAO,CAAC,GAAG,CAAC,oEAAoE,CAAC,CAAC;QAElF,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAEnC,IAAI,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;YAErB,QAAQ,MAAM,CAAC,QAAQ,EACvB,CAAC;gBACG,KAAK,qCAAqC,CAAC;gBAC3C,KAAK,2CAA2C,CAAC;gBACjD,KAAK,yCAAyC,CAAC;gBAC/C,KAAK,yCAAyC,CAAC;gBAC/C,KAAK,4CAA4C,CAAC;gBAClD,KAAK,oCAAoC,CAAC;gBAC1C,KAAK,qCAAqC,CAAC;gBAC3C,KAAK,2CAA2C,CAAC;gBACjD,KAAK,uCAAuC,CAAC;gBAC7C,KAAK,oCAAoC,CAAC;gBAC1C,KAAK,yCAAyC,CAAC;gBAC/C,KAAK,wCAAwC,CAAC;gBAC9C,KAAK,oCAAoC,CAAC;gBAC1C,KAAK,sCAAsC,CAAC;gBAC5C,KAAK,4CAA4C,CAAC;gBAClD,KAAK,2CAA2C,CAAC;gBACjD,KAAK,2CAA2C,CAAC;gBACjD,KAAK,4CAA4C,CAAC;gBAClD,KAAK,oCAAoC,CAAC;gBAC1C,KAAK,uCAAuC,CAAC;gBAC7C,KAAK,2CAA2C,CAAC;gBACjD,KAAK,oCAAoC,CAAC;gBAC1C,KAAK,sCAAsC,CAAC;gBAC5C,KAAK,yCAAyC,CAAC;gBAC/C,KAAK,uCAAuC;oBACxC,MAAM,CAAC,IAAI,GAAG,OAAO,CAAC;oBACtB,MAAM;gBAEV,+BAA+B;gBAC/B,KAAK,mBAAmB,CAAC;gBACzB,KAAK,kBAAkB,CAAC;gBACxB,KAAK,mBAAmB,CAAC;gBACzB,KAAK,4BAA4B,CAAC;gBAClC,KAAK,gCAAgC,CAAC;gBACtC,KAAK,qBAAqB,CAAC;gBAC3B,KAAK,0BAA0B,CAAC;gBAChC,KAAK,yBAAyB,CAAC;gBAC/B,KAAK,mBAAmB,CAAC;gBACzB,KAAK,4BAA4B,CAAC;gBAClC,KAAK,0BAA0B,CAAC;gBAChC,KAAK,6BAA6B,CAAC;gBACnC,KAAK,sBAAsB;oBACvB,sDAAsD;oBACtD,MAAM,CAAC,IAAI,GAAG,QAAQ,CAAC;oBACvB,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC;oBACrB,MAAM;YACd,CAAC;YAED,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,mCAAmC,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,mCAAmC,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,mCAAmC,CAAC,IAAI,CAAC,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EACvP,CAAC;gBACG,MAAM,CAAC,IAAI,GAAG,OAAO,CAAC;YAC1B,CAAC;YAED,kEAAkE;YAElE,IAAI,GAAG,GAA+B,IAAI,CAAC;YAC3C,IAAI,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC;YAE7B,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;gBAClB,KAAK,WAAW;oBACZ,GAAG,GAAG,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;oBACnC,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC;oBAC5B,MAAM;gBACV,KAAK,OAAO;oBACR,GAAG,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;oBAC/B,MAAM;gBACV,KAAK,OAAO;oBACR,GAAG,GAAG,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;oBACnC,MAAM;gBACV,KAAK,QAAQ;oBACT,IAAI,MAAM,CAAC,MAAM,KAAK,IAAI,EAAE,CAAC;wBACzB,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;wBAC9B,MAAM;oBACV,CAAC;gBACL,KAAK,UAAU;oBACX,GAAG,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;oBAChC,MAAM;gBACV,KAAK,UAAU;oBACX,GAAG,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;oBAClC,MAAM;gBACV,KAAK,SAAS;oBACV,GAAG,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;oBACjC,MAAM;gBACV,KAAK,OAAO;oBACR,GAAG,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;oBAC/B,MAAM;gBACV;oBACI,IAAI,CAAC,MAAM,CAAC,6BAAqB,CAAC,EAClC,CAAC;wBACG,OAAO,CAAC,GAAG,CAAC,uBAAuB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;oBACvD,CAAC;oBACD,MAAM;YACd,CAAC;YAED,IAAI,GAAG,EACP,CAAC;gBACG,IAAI,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,EAC9B,CAAC;oBACG,IAAI,CAAC,MAAM,CAAC,6BAAqB,CAAC,EAClC,CAAC;wBACG,OAAO,CAAC,GAAG,CAAC,wCAAwC,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;wBACxE,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;oBACvC,CAAC;oBAED,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;oBACpB,SAAS;gBACb,CAAC;gBAED,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,GAAG,CAAC;gBAEjC,IAAI,MAAM,CAAC,WAAW,EACtB,CAAC;oBACG,IAAI,SAAS,GAAG,GAAG,CAAC,YAAY,IAAI,EAAE,CAAC;oBACvC,GAAG,CAAC,YAAY,GAAG,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;gBACpF,CAAC;YACL,CAAC;QACL,CAAC;IACL,CAAC;IAEO,cAAc,CAAC,IAAW;QAE9B,OAAO,CAAC,GAAG,CAAC,oEAAoE,CAAC,CAAC;QAClF,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC/B,OAAO,CAAC,GAAG,CAAC,oEAAoE,CAAC,CAAC;QAElF,IAAI,QAAQ,GAAG,IAAI,GAAG,EAAU,CAAC;QAEjC,KAAK,IAAI,MAAM,IAAI,IAAI,EACvB,CAAC;YACG,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YAE3G,4DAA4D;YAE5D,IAAI,CAAC,GAAG,EACR,CAAC;gBACG,IAAI,CAAC,MAAM,CAAC,6BAAqB,CAAC,EAClC,CAAC;oBACG,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,QAAQ,YAAY,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;oBACzD,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;gBAC/C,CAAC;gBAED,SAAS;YACb,CAAC;YAED,IAAI,CAAC,MAAM,CAAC,QAAQ,EACpB,CAAC;gBACG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,GAA8B,CAAC,CAAC;YACvD,CAAC;iBAED,CAAC;gBACG,IAAI,iBAAiB,GAAG,MAAM,CAAC,IAAI,KAAK,OAAO,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS,IAAI,MAAM,CAAC,IAAI,IAAI,WAAW,IAAI,MAAM,CAAC,MAAM,CAAC;gBAE5H,IAAI,MAAM,GAAG,iBAAiB,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;gBAExI,IAAI,CAAC,MAAM,EACX,CAAC;oBACG,IAAI,CAAC,MAAM,CAAC,6BAAqB,CAAC,EAClC,CAAC;wBACG,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,QAAQ,YAAY,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;wBACzD,OAAO,CAAC,GAAG,CAAC,mBAAmB,MAAM,CAAC,QAAQ,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,gBAAgB,MAAM,CAAC,QAAQ,wBAAwB,CAAC,CAAC;oBAC5J,CAAC;oBACD,SAAS;gBACb,CAAC;gBAED,IAAI,CAAE,MAAc,CAAC,IAAI,EACzB,CAAC;oBACG,IAAI,CAAC,MAAM,CAAC,6BAAqB,CAAC,EAClC,CAAC;wBACG,OAAO,CAAC,GAAG,CAAC,wBAAwB,MAAM,CAAC,QAAQ,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,gBAAgB,MAAM,CAAC,QAAQ,wBAAwB,CAAC,CAAC;oBACjK,CAAC;gBACL,CAAC;gBAED,IAAU,MAAO,CAAC,OAAO,EACzB,CAAC;oBACS,MAAO,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACpC,CAAC;qBAED,CAAC;oBACG,IAAI,CAAC,MAAM,CAAC,6BAAqB,CAAC,EAClC,CAAC;wBACG,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,QAAQ,YAAY,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;wBACzD,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;wBAC5C,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;oBACxB,CAAC;gBACL,CAAC;gBAEK,GAAI,CAAC,OAAO,GAAG,MAAM,CAAC;gBAE5B,wDAAwD;gBACxD,IAAI,CAAE,MAAc,CAAC,IAAI,KAAK,OAAO,IAAK,MAAc,CAAC,IAAI,KAAK,WAAW,CAAC,IAAK,GAAW,CAAC,IAAI,KAAK,UAAU,EAClH,CAAC;oBACI,GAAW,CAAC,IAAI,GAAG,QAAQ,CAAC;gBACjC,CAAC;gBAED,uDAAuD;gBACvD,IAAK,MAAc,CAAC,IAAI,KAAK,WAAW,IAAK,GAAW,CAAC,IAAI,KAAK,UAAU,EAC5E,CAAC;oBACG,IAAI,MAAM,CAAC,IAAI,IAAI,UAAU,EAC7B,CAAC;wBACI,GAAW,CAAC,IAAI,GAAG,OAAO,CAAC;oBAChC,CAAC;yBAED,CAAC;wBACI,GAAW,CAAC,IAAI,GAAG,KAAK,CAAC;oBAC9B,CAAC;gBACL,CAAC;YACL,CAAC;QACL,CAAC;IACL,CAAC;IAEO,kBAAkB,CAAC,IAAW;QAElC,OAAO,CAAC,GAAG,CAAC,oEAAoE,CAAC,CAAC;QAClF,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;QACnC,OAAO,CAAC,GAAG,CAAC,oEAAoE,CAAC,CAAC;QAElF,KAAK,IAAI,MAAM,IAAI,IAAI,EACvB,CAAC;YACG,IAAI,GAAG,GAAG,MAAM,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YAEzG,IAAI,CAAC,GAAG,EACR,CAAC;gBACG,OAAO,CAAC,GAAG,CAAC,oBAAoB,MAAM,CAAC,QAAQ,MAAM,CAAC,CAAC;gBACvD,SAAS;YACb,CAAC;YAED,IAAI,CAAO,GAAI,CAAC,OAAO;gBAAE,SAAS;YAElC,IAAI,MAAM,CAAC,SAAS,EACpB,CAAC;gBACG,4DAA4D;gBAC5D,IAAI,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;gBAEzC,IAAI,CAAC,IAAI,IAAI,CAAO,IAAK,CAAC,OAAO,EACjC,CAAC;oBACG,MAAM,IAAI,MAAM,CAAC,QAAQ,0BAA0B,MAAM,CAAC,QAAQ,0BAA0B,CAAC;gBACjG,CAAC;gBAED,IAAU,IAAK,CAAC,OAAO,CAAC,IAAI,IAAI,WAAW,EAC3C,CAAC;oBACS,GAAI,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAO,GAAI,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;oBACxE,GAAI,CAAC,OAAO,GAAG,IAAI,CAAC;gBAC9B,CAAC;YACL,CAAC;QACL,CAAC;IACL,CAAC;IAEO,cAAc,CAAC,IAAW;;QAE9B,OAAO,CAAC,GAAG,CAAC,oEAAoE,CAAC,CAAC;QAClF,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC/B,OAAO,CAAC,GAAG,CAAC,oEAAoE,CAAC,CAAC;QAElF,KAAK,IAAI,MAAM,IAAI,IAAI,EACvB,CAAC;YACG,IAAI,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YAExC,IAAI,CAAC,GAAG,IAAI,MAAM,CAAC,IAAI,KAAK,OAAO;gBAAE,SAAS;YAE9C,IAAI,CAAC,GAAG,GAA2B,CAAC;YAEpC,mBAAmB;YACnB,IAAI,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,EAC7C,CAAC;gBACG,KAAK,IAAI,OAAO,IAAI,MAAM,CAAC,QAAQ,EACnC,CAAC;oBACG,IAAI,IAAI,GAAW,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;oBAEjD,IAAI,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAE,CAAC,CAAC,CAAC,CAAC,CAAA,2EAA2E;oBAEvH,IAAI,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,CAAoD,CAAC;oBAE7F,IAAI,CAAC,QAAQ,EACb,CAAC;wBACG,OAAO,CAAC,GAAG,CAAC,kCAAkC,OAAO,QAAQ,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;oBACpF,CAAC;yBAED,CAAC;wBACG,IAAI,QAAQ,CAAC,IAAI,IAAI,OAAO,EAC5B,CAAC;4BACG,CAAC,CAAC,QAAQ,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;wBACxC,CAAC;6BAED,CAAC;4BACG,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;4BAE9C,mEAAmE;4BACnE,+DAA+D;4BAC/D,kEAAkE;4BAClE,mEAAmE;4BACnE,kEAAkE;4BAClE,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;4BAClD,IAAI,QAAQ,EACZ,CAAC;gCACG,8DAA8D;gCAC9D,4DAA4D;gCAC5D,gEAAgE;gCAChE,IAAI,SAAS,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,CACjC,CAAC,CAAC,EAAiC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,WAAW,IAAI,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,IAAI,CACjD,CAAC;gCAE1C,IAAI,CAAC,SAAS,EACd,CAAC;oCACG,SAAS,GAAG,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;oCAC9C,SAAS,CAAC,SAAS,GAAG,MAAA,SAAS,CAAC,SAAS,mCAAI,EAAE,CAAC;oCAChD,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;gCACrC,CAAC;gCAED,SAAS,CAAC,SAAU,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;4BAC1D,CAAC;wBACL,CAAC;oBACL,CAAC;gBACL,CAAC;YACL,CAAC;QACL,CAAC;IACL,CAAC;IAEO,eAAe,CAAC,MAAW;QAE/B;;;;;;;;;;;;;;;WAeG;QAEC,8CAA8C;QAElD,IAAI,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAE5C,OAAO,GAAG,CAAC;IACf,CAAC;IAEO,WAAW,CAAC,MAAW;QAC3B,IAAI,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAExC,IAAI,MAAM,GAAoB,EAAE,CAAC;QACjC,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;YAChB,IAAI,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;YACtC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;YAC7B,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC;YAEzB,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACjB,IAAK,CAAC,OAAO,GAAG,GAAG,CAAC;QAC9B,CAAC;QAED,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;QAEzC,IAAI,MAAM,CAAC,SAAS;YAChB,MAAM,CAAC,WAAW,GAAG,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC,+BAA+B;QAExG,OAAO,GAAG,CAAC;IACf,CAAC;IAEO,eAAe,CAAC,MAAW;QAC/B,OAAO,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;IAEO,YAAY,CAAC,MAAW;QAC5B,IAAI,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAElC,IAAI,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAEjD,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;QAErC,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAE/B,OAAO,GAAG,CAAC;IACf,CAAC;IAEO,WAAW,CAAC,MAAW;QAE3B,IAAI,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAElC,IAAI,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAE9C,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAE/B,OAAO,GAAG,CAAC;IACf,CAAC;IAEO,UAAU,CAAC,MAAW;QAC1B,IAAI,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAE9C,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAE/B,OAAO,GAAG,CAAC;IACf,CAAC;IAEO,cAAc,CAAC,MAAW;;QAC9B,IAAI,UAAU,GAAa,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;QAEzC,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACjB,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;QACnD,CAAC;QAED,IAAI,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,EAAE,UAAU,CAAC,CAAC;QAC3D,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAE5B,IAAI,MAAA,MAAM,CAAC,OAAO,0CAAE,MAAM,EAAE,CAAC;YACzB,GAAG,CAAC,YAAY,IAAI,cAAc,MAAA,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,0CAAE,WAAW,EAAE,CAAC;QACvE,CAAC;QAED,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC;QAEjD,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAE/B,OAAO,GAAG,CAAC;IACf,CAAC;IAEO,aAAa,CAAC,MAAW;QAC7B,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACtC,IAAI,IAAc,CAAC;QAEnB,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,QAAQ,EAAE,CAAC;YACpC,IAAI,UAAU,GAA8B,EAAE,CAAC;YAE/C,KAAK,IAAI,OAAO,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;gBACpC,IAAI,IAAI,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;gBACtC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBACtB,IAAI,OAAO,CAAC,WAAW;oBACnB,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;YAC9E,CAAC;YAED,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;YAEzC,IAAI,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;gBAC5C,IAAI,iBAAiB,GAAe,EAAE,CAAC;gBACvC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;oBAC9C,iBAAiB,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC9E,CAAC;gBACD,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAC7B,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,iBAAiB,CAAC,CAAC;YACtD,CAAC;QAEL,CAAC;aAAM,CAAC;YACJ,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,UAAU,EAAE,CAAC;gBACrC,IAAI,UAAU,GAAa,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;gBACzC,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;oBACjB,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;gBACnD,CAAC;gBACD,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC;gBAC/C,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAA0C,CAAC,CAAC;YACvE,CAAC;iBAAM,CAAC;gBACJ,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;YAClC,CAAC;QACL,CAAC;QAED,IAAI,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAEhD,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;QAEvC,OAAO,KAAK,CAAC;IACjB,CAAC;IAEO,SAAS,CAAC,MAAW,EAAE,GAAyD;QACpF,IAAI,UAAU,GAAoB,EAAE,CAAC;QAErC,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;YACd,IAAI,QAAQ,GAAG,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YACjD,IAAI,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,kBAAkB,CAAC,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC,CAAC;YACzE,IAAI,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YAEtD,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC3B,CAAC;QAED,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;YAEhB,IAAI,QAAQ,GAAG,KAAK,CAAC;YAErB,GAAG,CAAC,YAAY,GAAG,EAAE,CAAC;YAEtB,KAAK,IAAI,QAAQ,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;gBAEjC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAClB,CAAC;oBACG,OAAO,CAAC,GAAG,CAAC,kBAAkB,MAAM,CAAC,QAAQ,QAAQ,MAAM,CAAC,IAAI,CAAC,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;oBAEnG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;oBACvB,SAAS;gBACb,CAAC;gBAED,IAAI,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;oBAEnC,OAAO,CAAC,GAAG,CAAC,yCAAyC,MAAM,CAAC,QAAQ,QAAQ,MAAM,CAAC,IAAI,CAAC,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;oBAE1H,IAAI,UAAU,GAAG,QAAQ,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,YAAY,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;oBAEzG,IAAI,QAAQ,CAAC,WAAW;wBACpB,GAAG,CAAC,YAAY,IAAI,YAAY,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,WAAW,CAAC,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC,EAAE,GAAG,UAAU,CAAC;yBAClH,IAAI,UAAU,CAAC,MAAM;wBACtB,GAAG,CAAC,YAAY,IAAI,YAAY,QAAQ,CAAC,IAAI,GAAG,GAAG,UAAU,CAAC;oBAClE,SAAS;gBACb,CAAC;gBAED,IAAI,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;gBAC9F,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBAEvB,IAAI,QAAQ,IAAI,QAAQ,CAAC,QAAQ,IAAI,IAAI,EAAE,CAAC;oBACxC,OAAO,CAAC,GAAG,CAAC,+CAA+C,QAAQ,CAAC,IAAI,UAAU,MAAM,CAAC,QAAQ,QAAQ,MAAM,CAAC,IAAI,CAAC,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;oBACvJ,QAAQ,CAAC,QAAQ,GAAG,IAAI,CAAC;gBAC7B,CAAC;gBAED,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;gBAEnC,QAAQ,GAAG,QAAQ,IAAI,QAAQ,CAAC,QAAQ,KAAK,IAAI,CAAC;gBAElD,IAAI,UAAU,GAAG,QAAQ,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,YAAY,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;gBAEzG,IAAI,QAAQ,CAAC,WAAW;oBACpB,GAAG,CAAC,YAAY,IAAI,YAAY,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,WAAW,CAAC,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC,EAAE,GAAG,UAAU,CAAC;qBAClH,IAAI,UAAU,CAAC,MAAM;oBACtB,GAAG,CAAC,YAAY,IAAI,YAAY,QAAQ,CAAC,IAAI,GAAG,GAAG,UAAU,CAAC;YACtE,CAAC;QACL,CAAC;QAED,GAAG,CAAC,UAAU,GAAG,UAAU,CAAC;IAChC,CAAC;IAEO,SAAS,CAAC,OAAY,EAAE,YAAY,GAAG,GAAG,CAAC,IAAI,CAAC,IAAI;QACxD,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;YAC5B,OAAO,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC;QACxB,CAAC;aAAM,CAAC;YACJ,IAAI,KAAK,GAAe,EAAE,CAAC;YAC3B,KAAK,IAAI,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;gBAElC,IAAI,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;gBAElC,IAAI,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,kBAAkB,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC;gBAErE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACrB,CAAC;YACD,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;gBACnB,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YAC7B,CAAC;YACD,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC;gBAAE,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;;gBAClC,OAAO,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACxC,CAAC;IACL,CAAC;IAEO,eAAe,CAAC,IAAY;QAChC,IAAI,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;YAC1B,IAAI,GAAY,IAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACjD,CAAC;QACD,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,KAAK,oBAAoB,EAAE,CAAC;YAC5D,IAAI,GAAY,IAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAChD,CAAC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;IAEO,eAAe,CAAC,IAAY;QAChC,IAAI,IAAI,KAAK,OAAO;YAAE,OAAO,QAAQ,CAAC;QACtC,IAAI,IAAI,KAAK,QAAQ;YAAE,OAAO,QAAQ,CAAC;QACvC,IAAI,IAAI,KAAK,UAAU;YAAE,OAAO,UAAU,CAAC;QAC3C,IAAI,IAAI,KAAK,oBAAoB;YAAE,OAAO,YAAY,CAAC;QACvD,IAAI,IAAI,KAAK,OAAO;YAAE,OAAO,OAAO,CAAC;QACrC,wDAAwD;QAExD,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YACrB,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,6BAA6B,EAAE,UAAU,CAAC,CAAC;QACnE,CAAC;QAED,IAAI,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC5B,IAAI,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;YAE1C,IAAI,OAAO,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;gBACxB,OAAO,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;YACnD,CAAC;QACL,CAAC;aAAM,IAAI,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;YACpC,IAAI,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;YAE3C,IAAI,OAAO,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;gBACxB,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;oBAChC,IAAI,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;oBAClC,OAAO,UAAU,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;gBAC3F,CAAC;qBAAM,CAAC;oBACJ,OAAO,mBAAmB,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;gBAClE,CAAC;YACL,CAAC;QACL,CAAC;aAAM,IAAI,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;YACpC,IAAI,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;YAE3C,IAAI,OAAO,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;gBACxB,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;oBAChC,IAAI,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;oBAClC,OAAO,UAAU,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,aAAa,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;gBAClG,CAAC;qBAAM,CAAC;oBACJ,OAAO,0BAA0B,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;gBACzE,CAAC;YACL,CAAC;QACL,CAAC;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;IAEO,YAAY,CAAC,MAAW,EAAE,GAAwC;QACtE,GAAG,CAAC,KAAK,GAAG,GAAG,CAAC,gBAAgB,CAAC,IAAI,CAAC;QACtC,IAAI,MAAM,CAAC,QAAQ,KAAK,IAAI,EAAE,CAAC;YAC3B,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,cAAc,CAAC,IAAI,CAAC;YACrC,IAAI,IAAI,GAAwB,GAAI,CAAC,IAAI,CAAC;YAC1C,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC5B,IAAI,IAAI,CAAC,IAAI,IAAI,KAAK;oBAClB,OAAO,CAAC,GAAG,CAAC,uDAAuD,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;gBAC1F,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,mBAAmB;YACrD,CAAC;QACL,CAAC;aAAM,IAAI,MAAM,CAAC,QAAQ,KAAK,IAAI,EAAE,CAAC,CAAA,qDAAqD;YACvF,IAAI,GAAG,CAAC,MAAM,CAAC,KAAK,WAAW;gBAAE,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,cAAc,CAAC,QAAQ,CAAC;;gBACrE,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,gBAAgB,CAAC,QAAQ,CAAC;QACpD,CAAC;QACD,QAAQ,MAAM,CAAC,MAAM,EAAE,CAAC;YACpB,KAAK,WAAW;gBACZ,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,gBAAgB,CAAC,SAAS,CAAC;gBAC5C,MAAM;YACV,KAAK,SAAS;gBACV,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,gBAAgB,CAAC,OAAO,CAAC;gBAC1C,MAAM;QACd,CAAC;QACD,IAAI,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,IAAI,KAAK,UAAU;YAAE,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,gBAAgB,CAAC,QAAQ,CAAC;QAC9F,IAAI,MAAM,CAAC,KAAK,KAAK,QAAQ;YAAE,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,gBAAgB,CAAC,MAAM,CAAC;IAC5E,CAAC;IAEO,cAAc,CAAC,MAAW,EAAE,GAAwG,EAAE,MAAuB;QACjK,IAAI,MAAM,CAAC,IAAI;YACX,KAAK,IAAI,GAAG,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;gBAC1B,IAAI,GAAG,CAAC,aAAa,KAAK,SAAS,EAAE,CAAC;oBAElC;;;;;;uBAMG;oBACH,MAAM,OAAO,GAAY,GAAG,CAAC,KAAM,CAAC,KAAK,CAAC,+EAA+E,CAAC,CAAC;oBAC3H,IAAI,CAAC,OAAO,EAAE,CAAC;wBAAC,SAAS;oBAAC,CAAC;oBAC3B,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,CAAC,GAAG,OAAO,CAAC;oBAE9D,MAAM,SAAS,GAAG,GAAG,CAAC,MAAM,CAAC,aAAa,CACtC,KAAK,EACL,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,CAC9D,CAAC;oBAEF,IAAG,YAAY,IAAI,IAAI,EAAE,CAAC;wBACtB,SAAS,CAAC,WAAW,GAAG,GAAG,CAAC,MAAM,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;oBACnE,CAAC;oBAE2E,GAAI,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;oBAChH,eAAe,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;gBAEzC,CAAC;qBAAM,IAAI,GAAG,CAAC,aAAa,KAAK,YAAY,EAAE,CAAC;oBAC5C,IAAI,OAAO,GAAY,GAAG,CAAC,KAAM,CAAC,KAAK,CAAC,mDAAmD,CAAC,CAAC;oBAC7F,IAAI,OAAO,EACX,CAAC;wBACG,IAAI,YAAY,GAAW,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;wBAE5D,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC;oBACpE,CAAC;gBACL,CAAC;YACL,CAAC;QAEL,SAAS,eAAe,CAAC,aAAqB,EAAE,YAAoB;YAChE,IAAI,aAAa,IAAI,IAAI,EAAE,CAAC;gBACxB,IAAI,SAAS,GAAG,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBACzC,IAAI,MAAM,IAAI,IAAI,EAAE,CAAC;oBACjB,KAAK,IAAI,KAAK,IAAI,MAAM,EAAE,CAAC;wBACvB,IAAI,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;4BACtC,KAAK,CAAC,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAC;wBAC7D,CAAC;oBACL,CAAC;gBACL,CAAC;gBACD,IAAI,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAA,kCAAkC;oBAC7C,GAAI,CAAC,UAAU,GAAG,GAAG,CAAC,MAAM,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAC;gBAC5F,CAAC;gBACD,IAAI,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAA,gCAAgC;oBACzC,GAAI,CAAC,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAC;gBACtF,CAAC;YACL,CAAC;QACL,CAAC;IACL,CAAC;CAEJ;AAlwBD,wBAkwBC"} \ No newline at end of file diff --git a/scripts/tsgen/bin/publish.js b/scripts/tsgen/bin/publish.js index 715a9ec64e..2451472a37 100644 --- a/scripts/tsgen/bin/publish.js +++ b/scripts/tsgen/bin/publish.js @@ -33,10 +33,16 @@ var __importStar = (this && this.__importStar) || (function () { }; })(); Object.defineProperty(exports, "__esModule", { value: true }); +exports.isMigratedCanonicalSymbol = isMigratedCanonicalSymbol; exports.publish = publish; const fs = __importStar(require("fs-extra")); const path = __importStar(require("path")); const Parser_1 = require("./Parser"); +const MigratedOverlay_1 = require("./MigratedOverlay"); +let migratedCanonicalSymbolLookup = null; +function isMigratedCanonicalSymbol(symbol) { + return migratedCanonicalSymbolLookup !== null && migratedCanonicalSymbolLookup.has(symbol); +} function publish(data, opts) { // remove undocumented stuff. data({ undocumented: true }).remove(); @@ -51,9 +57,19 @@ function publish(data, opts) { if (!fs.existsSync(opts.destination)) { fs.mkdirSync(opts.destination); } - var str = JSON.stringify(data().get(), null, 4); + const docs = data().get(); + var str = JSON.stringify(docs, null, 4); fs.writeFileSync(path.join(opts.destination, 'phaser.json'), str); - var out = new Parser_1.Parser(data().get()).emit(); + const manifest = (0, MigratedOverlay_1.discoverMigratedModules)(); + const canonicalSymbols = (0, MigratedOverlay_1.flattenCanonicalSymbols)(manifest); + migratedCanonicalSymbolLookup = new Set(canonicalSymbols); + (0, MigratedOverlay_1.reportMigrationProgress)(canonicalSymbols.length); + const syntheticDoclets = (0, MigratedOverlay_1.buildSyntheticDoclets)(manifest, docs); + docs.push(...syntheticDoclets); + var out = new Parser_1.Parser(docs).emit(); + out = (0, MigratedOverlay_1.applyMigratedAuthorityOverlay)(out, manifest); + out = (0, MigratedOverlay_1.normalizeDeclarationOutput)(out); + (0, MigratedOverlay_1.validateNoSyntheticLeak)(out, canonicalSymbols); fs.writeFileSync(path.join(opts.destination, 'phaser.d.ts'), out); } ; diff --git a/scripts/tsgen/bin/publish.js.map b/scripts/tsgen/bin/publish.js.map index 05a1231759..423cd536cf 100644 --- a/scripts/tsgen/bin/publish.js.map +++ b/scripts/tsgen/bin/publish.js.map @@ -1 +1 @@ -{"version":3,"file":"publish.js","sourceRoot":"","sources":["../src/publish.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,0BAuBC;AA3BD,6CAA+B;AAC/B,2CAA6B;AAC7B,qCAAkC;AAElC,SAAgB,OAAO,CAAC,IAAS,EAAE,IAAS;IACxC,6BAA6B;IAC7B,IAAI,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;IACtC,sBAAsB;IACtB,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;IACnC,yBAAyB;IACzB,IAAI,CAAC,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;IACjD,yBAAyB;IACzB,IAAI,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;IACrC,yBAAyB;IACzB,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;IAEhC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC;QACnC,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACnC,CAAC;IAED,IAAI,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAEhD,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,aAAa,CAAC,EAAE,GAAG,CAAC,CAAC;IAElE,IAAI,GAAG,GAAG,IAAI,eAAM,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IAE1C,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,aAAa,CAAC,EAAE,GAAG,CAAC,CAAC;AACtE,CAAC;AAAA,CAAC"} \ No newline at end of file +{"version":3,"file":"publish.js","sourceRoot":"","sources":["../src/publish.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,8DAEC;AAED,0BA0CC;AA7DD,6CAA+B;AAC/B,2CAA6B;AAC7B,qCAAkC;AAClC,uDAQ2B;AAE3B,IAAI,6BAA6B,GAAuB,IAAI,CAAC;AAE7D,SAAgB,yBAAyB,CAAC,MAAc;IACpD,OAAO,6BAA6B,KAAK,IAAI,IAAI,6BAA6B,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAC/F,CAAC;AAED,SAAgB,OAAO,CAAC,IAAS,EAAE,IAAS;IACxC,6BAA6B;IAC7B,IAAI,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;IACtC,sBAAsB;IACtB,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;IACnC,yBAAyB;IACzB,IAAI,CAAC,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;IACjD,yBAAyB;IACzB,IAAI,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;IACrC,yBAAyB;IACzB,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;IAEhC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC;QACnC,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACnC,CAAC;IAED,MAAM,IAAI,GAAG,IAAI,EAAE,CAAC,GAAG,EAAE,CAAC;IAE1B,IAAI,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAExC,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,aAAa,CAAC,EAAE,GAAG,CAAC,CAAC;IAElE,MAAM,QAAQ,GAAG,IAAA,yCAAuB,GAAE,CAAC;IAC3C,MAAM,gBAAgB,GAAG,IAAA,yCAAuB,EAAC,QAAQ,CAAC,CAAC;IAE3D,6BAA6B,GAAG,IAAI,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAE1D,IAAA,yCAAuB,EAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAEjD,MAAM,gBAAgB,GAAG,IAAA,uCAAqB,EAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IAE/D,IAAI,CAAC,IAAI,CAAC,GAAG,gBAAgB,CAAC,CAAC;IAE/B,IAAI,GAAG,GAAG,IAAI,eAAM,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;IAElC,GAAG,GAAG,IAAA,+CAA6B,EAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IAEnD,GAAG,GAAG,IAAA,4CAA0B,EAAC,GAAG,CAAC,CAAC;IAEtC,IAAA,yCAAuB,EAAC,GAAG,EAAE,gBAAgB,CAAC,CAAC;IAE/C,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,aAAa,CAAC,EAAE,GAAG,CAAC,CAAC;AACtE,CAAC;AAAA,CAAC"} \ No newline at end of file diff --git a/scripts/tsgen/src/MigratedOverlay.ts b/scripts/tsgen/src/MigratedOverlay.ts new file mode 100644 index 0000000000..8230db6464 --- /dev/null +++ b/scripts/tsgen/src/MigratedOverlay.ts @@ -0,0 +1,1345 @@ +import * as fs from 'fs-extra'; +import * as path from 'path'; +import * as ts from 'typescript'; +import { SYNTHETIC_DOCLET_FLAG, SYNTHETIC_META_MARKER } from './Parser'; + +declare const __dirname: string; + +export type MigratedModulesManifest = Record; +type TsgenDoclet = Record; +export type DeclarationKind = 'class' | 'function' | 'variable' | 'interface' | 'type' | 'enum' | 'namespace'; +type MigratedSourceKind = 'class' | 'function' | 'type' | null; +type OverlayDeclarationKind = 'class' | 'function' | 'interface' | 'type'; + +const REPO_ROOT = path.resolve(__dirname, '..', '..', '..'); + +// --------------------------------------------------------------------------- +// Cached source-directory walk — single walk collects both .ts and .js files, +// and infers source kind (class/function) while reading each .ts file. +// --------------------------------------------------------------------------- + +interface SrcWalkResult { + tsFiles: string[]; + jsFiles: string[]; + sourceKindByRelPath: Map; +} + +let cachedSrcWalk: SrcWalkResult | null = null; + +function walkSrcDirectory(): SrcWalkResult { + if (cachedSrcWalk) { + return cachedSrcWalk; + } + + const srcDir = path.resolve(REPO_ROOT, 'src'); + const tsFiles: string[] = []; + const jsFiles: string[] = []; + + function walk(dir: string): void { + for (const entry of fs.readdirSync(dir, { withFileTypes: true })) { + const fullPath = path.join(dir, entry.name); + + if (entry.isDirectory()) { + walk(fullPath); + } + else if (entry.name.endsWith('.ts') && !entry.name.endsWith('.d.ts')) { + tsFiles.push(fullPath); + } + else if (entry.name.endsWith('.js')) { + jsFiles.push(fullPath); + } + } + } + + walk(srcDir); + + cachedSrcWalk = { tsFiles, jsFiles, sourceKindByRelPath: new Map() }; + + return cachedSrcWalk; +} + +// --------------------------------------------------------------------------- +// Canonical symbol extraction +// --------------------------------------------------------------------------- + +function extractCanonicalSymbols(source: string): string[] { + const symbols: string[] = []; + const seen = new Set(); + const jsdocBlockRegex = /\/\*\*[\s\S]*?\*\//g; + const classAfterRegex = /export\s+(?:default\s+)?class\s+(\w+)/y; + const typeAfterRegex = /export\s+type\s+(\w+)\b/y; + let blockMatch: RegExpExecArray | null; + + while ((blockMatch = jsdocBlockRegex.exec(source)) !== null) { + const block = blockMatch[0]; + const callbackMatch = block.match(/@callback\s+(Phaser(?:\.\w+)+)(?:\s|$)/); + + if (callbackMatch) { + typeAfterRegex.lastIndex = skipWhitespaceAndLineCommentsAfterJSDoc(source, blockMatch.index + block.length); + const typeMatch = typeAfterRegex.exec(source); + const declarationName = callbackMatch[1].split('.').pop(); + + if (typeMatch && typeMatch[1] === declarationName && !seen.has(callbackMatch[1])) { + seen.add(callbackMatch[1]); + symbols.push(callbackMatch[1]); + } + + continue; + } + + const functionMatch = block.match(/@function\s+(Phaser(?:\.\w+)+)(?:\s|$)/); + + if (functionMatch) { + if (!seen.has(functionMatch[1])) { + seen.add(functionMatch[1]); + symbols.push(functionMatch[1]); + } + + continue; + } + + const memberofMatch = block.match(/@memberof\s+(Phaser(?:\.\w+)*)/); + + if (memberofMatch) { + classAfterRegex.lastIndex = skipWhitespaceAndLineCommentsAfterJSDoc(source, blockMatch.index + block.length); + const classMatch = classAfterRegex.exec(source); + + if (classMatch) { + const symbol = `${memberofMatch[1]}.${classMatch[1]}`; + + if (!seen.has(symbol)) { + seen.add(symbol); + symbols.push(symbol); + } + } + } + + // Handle mixin modules annotated with `@namespace Phaser.xxx.ClassName` where + // the last segment matches an `export const ClassName` in the same file. + // This covers migrated mixin components (e.g. Depth, Visible) that cannot use + // the `@memberof + export class` pattern because they export a mixin function, + // not a constructor class. + const namespaceMatch = block.match(/@namespace\s+(Phaser(?:\.\w+)+)(?:\s|$)/); + + if (namespaceMatch) { + const nsName = namespaceMatch[1]; + const lastName = nsName.split('.').pop()!; + // Only extract when the file also exports a value with the same name as the + // last namespace segment (const, function, or class). + const escapedLastName = lastName.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); + const exportPattern = new RegExp(`\\bexport\\s+(?:const|function|class)\\s+${escapedLastName}\\b`); + + if (exportPattern.test(source) && !seen.has(nsName)) { + seen.add(nsName); + symbols.push(nsName); + } + } + } + + return symbols; +} + +function skipWhitespaceAndLineCommentsAfterJSDoc(source: string, start: number): number { + let index = start; + + while (index < source.length) { + const char = source[index]; + const nextChar = source[index + 1]; + + if (/\s/.test(char)) { + index++; + } + else if (char === '/' && nextChar === '/') { + const lineEnd = source.indexOf('\n', index + 2); + + index = lineEnd === -1 ? source.length : lineEnd + 1; + } + else { + break; + } + } + + return index; +} + +function inferSourceKind(source: string): MigratedSourceKind { + if (/\bexport\s+(?:default\s+)?class\b/.test(source)) { + return 'class'; + } + + if (/\bexport\s+(?:default\s+)?function\b/.test(source)) { + return 'function'; + } + + if (/\bexport\s+type\s+\w+\b/.test(source)) { + return 'type'; + } + + return null; +} + +// --------------------------------------------------------------------------- +// Discovery & progress +// --------------------------------------------------------------------------- + +export function discoverMigratedModules(): MigratedModulesManifest { + const { tsFiles, sourceKindByRelPath } = walkSrcDirectory(); + const manifest: MigratedModulesManifest = {}; + + for (const absolutePath of tsFiles) { + const relativePath = path.relative(REPO_ROOT, absolutePath); + const source = fs.readFileSync(absolutePath, 'utf8'); + + // Cache source kind while we already have the file content + sourceKindByRelPath.set(relativePath, inferSourceKind(source)); + + const symbols = extractCanonicalSymbols(source); + + if (symbols.length > 0) { + manifest[relativePath] = symbols; + } + } + + return manifest; +} + +export function flattenCanonicalSymbols(manifest: MigratedModulesManifest): string[] { + const symbols: string[] = []; + const seen = new Set(); + + for (const [modulePath, canonicalSymbols] of Object.entries(manifest)) { + for (const symbol of canonicalSymbols) { + if (seen.has(symbol)) { + throw new Error(`Duplicate canonical symbol '${symbol}' discovered in '${modulePath}'`); + } + + seen.add(symbol); + symbols.push(symbol); + } + } + + symbols.sort((a, b) => a.localeCompare(b)); + + return symbols; +} + +export function reportMigrationProgress(migratedCount: number): void { + const { tsFiles, jsFiles } = walkSrcDirectory(); + const tsFilePaths = new Set(tsFiles); + + const leafJsCount = jsFiles.filter((jsPath) => { + if (path.basename(jsPath) === 'index.js') { + return false; + } + + const tsCounterpart = jsPath.replace(/\.js$/, '.ts'); + + return !tsFilePaths.has(tsCounterpart); + }).length; + + const totalModules = leafJsCount + migratedCount; + const percent = totalModules > 0 ? ((migratedCount / totalModules) * 100).toFixed(1) : '0.0'; + + console.log('------------------------------------------------------------------'); + console.log(`TypeScript Migration: ${migratedCount} / ${totalModules} source modules (${percent}%)`); + + if (totalModules > 0 && migratedCount / totalModules >= 0.5) { + console.log('Over 50% of source modules are now TypeScript.'); + console.log('Consider switching to a TS-first declaration pipeline.'); + } + + console.log('------------------------------------------------------------------'); +} + +// --------------------------------------------------------------------------- +// TS AST helpers (internal) +// --------------------------------------------------------------------------- + +function getModuleDeclarationNameText(name: ts.ModuleName): string | null { + if (ts.isIdentifier(name) || ts.isStringLiteral(name)) { + return name.text; + } + + return null; +} + +export function getDeclarationKindForStatement(statement: ts.Statement): DeclarationKind | null { + if (ts.isFunctionDeclaration(statement)) { return 'function'; } + if (ts.isClassDeclaration(statement)) { return 'class'; } + if (ts.isInterfaceDeclaration(statement)) { return 'interface'; } + if (ts.isTypeAliasDeclaration(statement)) { return 'type'; } + if (ts.isEnumDeclaration(statement)) { return 'enum'; } + if (ts.isModuleDeclaration(statement)) { return 'namespace'; } + if (ts.isVariableStatement(statement)) { return 'variable'; } + + return null; +} + +function getStatementName(statement: ts.Statement): string | null { + if (ts.isModuleDeclaration(statement)) { + return getModuleDeclarationNameText(statement.name); + } + + if ('name' in statement) { + const named = statement as unknown as { name?: ts.Node }; + + if (named.name && ts.isIdentifier(named.name)) { + return named.name.text; + } + } + + return null; +} + +/** + * Collect all statements from the namespace identified by `namespaceParts`, + * merging multiple declarations of the same namespace (common in .d.ts files). + * Returns an empty array when the namespace path cannot be resolved. + */ +function collectNamespaceMembers(sourceFile: ts.SourceFile, namespaceParts: string[]): ReadonlyArray { + let currentStatements: ReadonlyArray = sourceFile.statements; + + for (const part of namespaceParts) { + const nextStatements: ts.Statement[] = []; + let matched = false; + + for (const statement of currentStatements) { + if (!ts.isModuleDeclaration(statement) || getModuleDeclarationNameText(statement.name) !== part) { + continue; + } + + matched = true; + + let body: ts.ModuleBody | undefined = statement.body; + + while (body && ts.isModuleDeclaration(body)) { + body = body.body; + } + + if (body && ts.isModuleBlock(body)) { + for (const stmt of body.statements) { + nextStatements.push(stmt); + } + } + } + + if (!matched) { + return []; + } + + currentStatements = nextStatements; + } + + return currentStatements; +} + +function findDeclarationNode( + statements: ReadonlyArray, + declarationName: string, + expectedKind?: OverlayDeclarationKind +): { node: ts.ClassDeclaration | ts.FunctionDeclaration | ts.InterfaceDeclaration | ts.TypeAliasDeclaration; kind: OverlayDeclarationKind } | null { + const candidateKinds: OverlayDeclarationKind[] = expectedKind ? [expectedKind] : ['class', 'function', 'interface', 'type']; + + for (const kind of candidateKinds) { + for (const statement of statements) { + if (kind === 'class' && ts.isClassDeclaration(statement) && statement.name?.text === declarationName) { + return { node: statement, kind }; + } + + if (kind === 'function' && ts.isFunctionDeclaration(statement) && statement.name?.text === declarationName) { + return { node: statement, kind }; + } + + if (kind === 'interface' && ts.isInterfaceDeclaration(statement) && statement.name?.text === declarationName) { + return { node: statement, kind }; + } + + if (kind === 'type' && ts.isTypeAliasDeclaration(statement) && statement.name?.text === declarationName) { + return { node: statement, kind }; + } + } + } + + return null; +} + +function getNodeRange(node: ts.Node): { start: number; end: number } { + return { start: node.getFullStart(), end: node.end }; +} + +// --------------------------------------------------------------------------- +// Declaration index - single AST walk that records every class / function / +// namespace by its fully-qualified canonical name. Subsequent symbol lookups +// run in O(1) without re-walking the AST per symbol. +// --------------------------------------------------------------------------- + +interface DeclarationIndexEntry { + classNode?: ts.ClassDeclaration; + functionNode?: ts.FunctionDeclaration; + interfaceNode?: ts.InterfaceDeclaration; + typeNode?: ts.TypeAliasDeclaration; + namespaceNode?: ts.ModuleDeclaration; + /** End offset of the last member statement inside this namespace (max across merged declarations). */ + lastMemberEnd?: number; +} + +interface DeclarationIndex { + byPath: Map; +} + +function buildDeclarationIndex(sourceFile: ts.SourceFile): DeclarationIndex { + const byPath = new Map(); + + const getOrCreate = (path: string): DeclarationIndexEntry => { + let entry = byPath.get(path); + + if (!entry) { + entry = {}; + byPath.set(path, entry); + } + + return entry; + }; + + const visit = (statements: ReadonlyArray, prefix: string): void => { + let maxEnd = -1; + + for (const statement of statements) { + if (statement.end > maxEnd) { + maxEnd = statement.end; + } + + if (ts.isClassDeclaration(statement) && statement.name) { + const path = prefix ? `${prefix}.${statement.name.text}` : statement.name.text; + const entry = getOrCreate(path); + + if (!entry.classNode) { entry.classNode = statement; } + } + else if (ts.isFunctionDeclaration(statement) && statement.name) { + const path = prefix ? `${prefix}.${statement.name.text}` : statement.name.text; + const entry = getOrCreate(path); + + if (!entry.functionNode) { entry.functionNode = statement; } + } + else if (ts.isInterfaceDeclaration(statement) && statement.name) { + const path = prefix ? `${prefix}.${statement.name.text}` : statement.name.text; + const entry = getOrCreate(path); + + if (!entry.interfaceNode) { entry.interfaceNode = statement; } + } + else if (ts.isTypeAliasDeclaration(statement) && statement.name) { + const path = prefix ? `${prefix}.${statement.name.text}` : statement.name.text; + const entry = getOrCreate(path); + + if (!entry.typeNode) { entry.typeNode = statement; } + } + else if (ts.isModuleDeclaration(statement)) { + const name = getModuleDeclarationNameText(statement.name); + + if (!name) { continue; } + + const path = prefix ? `${prefix}.${name}` : name; + const entry = getOrCreate(path); + + if (!entry.namespaceNode) { entry.namespaceNode = statement; } + + let body: ts.ModuleBody | undefined = statement.body; + + while (body && ts.isModuleDeclaration(body)) { + body = body.body; + } + + if (body && ts.isModuleBlock(body)) { + visit(body.statements, path); + } + } + } + + if (prefix && maxEnd >= 0) { + const parentEntry = getOrCreate(prefix); + + if (parentEntry.lastMemberEnd === undefined || maxEnd > parentEntry.lastMemberEnd) { + parentEntry.lastMemberEnd = maxEnd; + } + } + }; + + visit(sourceFile.statements, ''); + + return { byPath }; +} + +function getDeclarationRangeFromIndex( + index: DeclarationIndex, + canonicalSymbol: string, + expectedKind?: OverlayDeclarationKind +): { start: number; end: number; kind: OverlayDeclarationKind } { + const dotIndex = canonicalSymbol.indexOf('.'); + + if (dotIndex < 0 || !canonicalSymbol.startsWith('Phaser.')) { + throw new Error(`Unsupported canonical symbol '${canonicalSymbol}'. Expected to start with 'Phaser.'.`); + } + + const entry = index.byPath.get(canonicalSymbol); + const candidateKinds: OverlayDeclarationKind[] = expectedKind ? [expectedKind] : ['class', 'function', 'interface', 'type']; + + if (entry) { + for (const kind of candidateKinds) { + const node = kind === 'class' ? entry.classNode : kind === 'function' ? entry.functionNode : kind === 'interface' ? entry.interfaceNode : entry.typeNode; + + if (node) { + return { ...getNodeRange(node), kind }; + } + } + } + + // Distinguish "namespace missing" from "declaration missing" to preserve + // the original error messages used by callers and tests. + const parentPath = canonicalSymbol.substring(0, canonicalSymbol.lastIndexOf('.')); + const parentEntry = index.byPath.get(parentPath); + + if (!parentEntry || parentEntry.lastMemberEnd === undefined) { + throw new Error(`Unable to find namespace '${parentPath}' in generated declaration output.`); + } + + const prefix = expectedKind ? `${expectedKind} ` : ''; + + throw new Error(`Unable to find ${prefix}declaration for migrated symbol '${canonicalSymbol}'.`); +} + +function getClassInsertionPointFromIndex(index: DeclarationIndex, canonicalSymbol: string): number { + // Insertion point: if a namespace already exists at the canonical symbol's + // path, insert immediately before it (so the class can be merged with the + // namespace declaration). Otherwise append after the parent's last member. + const entry = index.byPath.get(canonicalSymbol); + + if (entry?.namespaceNode) { + return entry.namespaceNode.getFullStart(); + } + + const parentPath = canonicalSymbol.substring(0, canonicalSymbol.lastIndexOf('.')); + const parentEntry = parentPath ? index.byPath.get(parentPath) : undefined; + + if (parentEntry?.lastMemberEnd !== undefined) { + return parentEntry.lastMemberEnd; + } + + throw new Error(`Unable to resolve insertion point for '${canonicalSymbol}'.`); +} + +function getTopLevelDeclarationRange(source: string, declarationName: string, expectedKind?: OverlayDeclarationKind): { start: number; end: number; kind: OverlayDeclarationKind } { + const sourceFile = ts.createSourceFile('migrated-fragment.d.ts', source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS); + const result = findDeclarationNode(sourceFile.statements, declarationName, expectedKind); + + if (!result) { + const prefix = expectedKind ? `${expectedKind} ` : ''; + + throw new Error(`Unable to find top-level ${prefix}declaration '${declarationName}' in emitted fragment.`); + } + + return { ...getNodeRange(result.node), kind: result.kind }; +} + +function removePrivateClassMembers(source: string, className: string): string { + const sourceFile = ts.createSourceFile('migrated-fragment.d.ts', source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS); + const removals: Array<{ start: number; end: number }> = []; + + for (const statement of sourceFile.statements) { + if (!ts.isClassDeclaration(statement) || statement.name?.text !== className) { + continue; + } + + for (const member of statement.members) { + const jsDoc = ts.getJSDocTags(member); + + if (jsDoc.some((tag) => tag.tagName.text === 'private')) { + removals.push({ start: member.getFullStart(), end: member.getEnd() }); + } + } + } + + let output = source; + + for (const removal of removals.sort((a, b) => b.start - a.start)) { + output = output.slice(0, removal.start) + output.slice(removal.end); + } + + return output; +} + +// --------------------------------------------------------------------------- +// Exported AST helpers for external validation scripts +// --------------------------------------------------------------------------- + +export function parseSourceFile(filePath: string): ts.SourceFile { + const sourceText = fs.readFileSync(filePath, 'utf8'); + + return ts.createSourceFile(filePath, sourceText, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS); +} + +function hasExportModifier(node: ts.Node): boolean { + if (!ts.canHaveModifiers(node)) { + return false; + } + + const modifiers = ts.getModifiers(node); + + return modifiers?.some((modifier) => modifier.kind === ts.SyntaxKind.ExportKeyword) ?? false; +} + +function addToKindMap(map: Map>, name: string, kind: string): void { + let kinds = map.get(name); + + if (!kinds) { + kinds = new Set(); + map.set(name, kinds); + } + + kinds.add(kind); +} + +/** + * Return the declaration kind and the set of names introduced by a statement, + * or null if the statement does not introduce any named declarations. + */ +function getDeclarationNames(statement: ts.Statement): { kind: DeclarationKind; names: string[] } | null { + const kind = getDeclarationKindForStatement(statement); + + if (!kind) { + return null; + } + + if (ts.isVariableStatement(statement)) { + const names: string[] = []; + + for (const declaration of statement.declarationList.declarations) { + if (ts.isIdentifier(declaration.name)) { + names.push(declaration.name.text); + } + } + + return names.length > 0 ? { kind, names } : null; + } + + const name = getStatementName(statement); + + return name ? { kind, names: [name] } : null; +} + +/** + * Parse a TypeScript source file and collect all exported declaration kinds by name. + * Returns a map from declaration name to the set of declaration kinds (class, function, etc.). + */ +export function collectExportedDeclarationKinds(filePath: string): Map> { + const sourceFile = parseSourceFile(filePath); + const localKinds = new Map>(); + const exportedKinds = new Map>(); + + // Single pass: collect local declaration kinds, and exported ones when the statement has `export`. + for (const statement of sourceFile.statements) { + const info = getDeclarationNames(statement); + + if (!info) { + continue; + } + + const isExported = hasExportModifier(statement); + + for (const name of info.names) { + addToKindMap(localKinds, name, info.kind); + + if (isExported) { + addToKindMap(exportedKinds, name, info.kind); + } + } + } + + // Handle `export { Foo, Bar as Baz }` declarations (must run after localKinds is fully built). + for (const statement of sourceFile.statements) { + if (!ts.isExportDeclaration(statement) || statement.moduleSpecifier) { + continue; + } + + if (!statement.exportClause || !ts.isNamedExports(statement.exportClause)) { + continue; + } + + for (const element of statement.exportClause.elements) { + const exportedName = element.name.text; + const localName = element.propertyName ? element.propertyName.text : exportedName; + const kinds = localKinds.get(localName); + + if (kinds) { + for (const kind of kinds) { + addToKindMap(exportedKinds, exportedName, kind); + } + } + } + } + + return exportedKinds; +} + +/** + * Check whether a canonical symbol (e.g. "Phaser.Math.Vector2") exists in the + * given parsed declaration file with one of the expected declaration kinds. + * Returns null on success, or a reason object on failure. + */ +export function validateSymbolInDeclarations( + declarationsFile: ts.SourceFile, + canonicalSymbol: string, + expectedKinds: string[] +): { symbol: string; reason: string } | null { + const parts = canonicalSymbol.split('.'); + + if (parts.length < 2) { + return { symbol: canonicalSymbol, reason: 'invalid canonical symbol path' }; + } + + const namespaceParts = parts.slice(0, -1); + const symbolName = parts[parts.length - 1]; + const members = collectNamespaceMembers(declarationsFile, namespaceParts); + + if (members.length === 0) { + return { symbol: canonicalSymbol, reason: 'namespace path not found' }; + } + + const expectedKindSet = new Set(expectedKinds); + + for (const statement of members) { + const kind = getDeclarationKindForStatement(statement); + + if (!kind || !expectedKindSet.has(kind)) { + continue; + } + + if (ts.isVariableStatement(statement)) { + for (const declaration of statement.declarationList.declarations) { + if (ts.isIdentifier(declaration.name) && declaration.name.text === symbolName) { + return null; + } + } + + continue; + } + + const name = getStatementName(statement); + + if (name === symbolName) { + return null; + } + } + + return { symbol: canonicalSymbol, reason: `declaration anchor not found for expected kind(s) "${expectedKinds.join(', ')}"` }; +} + +// --------------------------------------------------------------------------- +// Kind inference +// --------------------------------------------------------------------------- + +function inferKindFromMigratedSource(modulePath: string): MigratedSourceKind { + const { sourceKindByRelPath } = walkSrcDirectory(); + + if (sourceKindByRelPath.has(modulePath)) { + return sourceKindByRelPath.get(modulePath)!; + } + + // Fallback: read file if not in cache (shouldn't happen after discoverMigratedModules) + const sourcePath = path.resolve(REPO_ROOT, modulePath); + + if (!fs.existsSync(sourcePath)) { + sourceKindByRelPath.set(modulePath, null); + + return null; + } + + const source = fs.readFileSync(sourcePath, 'utf8'); + const kind = inferSourceKind(source); + + sourceKindByRelPath.set(modulePath, kind); + + return kind; +} + +function inferSyntheticKind(modulePath: string, symbol: string, docs: TsgenDoclet[]): 'class' | 'function' | 'typedef' { + const inferredFromSource = inferKindFromMigratedSource(modulePath); + + if (inferredFromSource === 'type') { + return 'typedef'; + } + + if (inferredFromSource) { + return inferredFromSource; + } + + const instancePrefix = `${symbol}#`; + + for (const doclet of docs) { + const longname = doclet.longname; + + if (typeof longname !== 'string') { + continue; + } + + if (longname === symbol) { + if (doclet.kind === 'class') { return 'class'; } + if (doclet.kind === 'function') { return 'function'; } + } + + if ((doclet.memberof === symbol && doclet.scope === 'instance') || longname.startsWith(instancePrefix)) { + return 'class'; + } + } + + return 'function'; +} + +// --------------------------------------------------------------------------- +// Synthetic doclet generation +// --------------------------------------------------------------------------- + +function createSyntheticDoclet(kind: string, longname: string, lineno: number): TsgenDoclet { + const dotIndex = longname.lastIndexOf('.'); + const hashIndex = longname.lastIndexOf('#'); + const splitIndex = Math.max(dotIndex, hashIndex); + const memberof = (splitIndex !== -1) ? longname.substring(0, splitIndex) : undefined; + const name = (splitIndex !== -1) ? longname.substring(splitIndex + 1) : longname; + const scope = (hashIndex > dotIndex) ? 'instance' : 'static'; + + const doclet: TsgenDoclet = { + [SYNTHETIC_DOCLET_FLAG]: true, + kind, + name, + longname, + scope, + meta: { + filename: `${SYNTHETIC_META_MARKER}/auto-discovered`, + lineno, + columnno: 0, + path: SYNTHETIC_META_MARKER + } + }; + + if (kind === 'function' || kind === 'class') { + doclet.params = [ + { + name: 'args', + variable: true, + type: { names: ['*'] } + } + ]; + } + + if (kind === 'function') { + doclet.returns = [ + { + type: { names: ['*'] } + } + ]; + } + + if (kind === 'typedef') { + doclet.type = { names: ['function'] }; + doclet.params = [ + { + name: 'args', + variable: true, + type: { names: ['*'] } + } + ]; + doclet.returns = [ + { + type: { names: ['*'] } + } + ]; + } + + if (memberof) { + doclet.memberof = memberof; + } + + return doclet; +} + +export function buildSyntheticDoclets(manifest: MigratedModulesManifest, docs: TsgenDoclet[]): TsgenDoclet[] { + const existingLongnames = new Set(); + const syntheticKinds = new Map(); + const syntheticOrder: string[] = []; + + for (const doclet of docs) { + if (typeof doclet.longname === 'string') { + existingLongnames.add(doclet.longname); + } + } + + for (const [modulePath, canonicalSymbols] of Object.entries(manifest)) { + if (!Array.isArray(canonicalSymbols)) { + continue; + } + + for (const symbol of canonicalSymbols) { + if (!existingLongnames.has(symbol) && !syntheticKinds.has(symbol)) { + syntheticKinds.set(symbol, inferSyntheticKind(modulePath, symbol, docs)); + syntheticOrder.push(symbol); + } + + const parts = symbol.split('.'); + + for (let i = 1; i < parts.length; i++) { + const parentLongname = parts.slice(0, i).join('.'); + + if (existingLongnames.has(parentLongname) || syntheticKinds.has(parentLongname)) { + continue; + } + + syntheticKinds.set(parentLongname, 'namespace'); + syntheticOrder.push(parentLongname); + } + } + } + + syntheticOrder.sort((a, b) => { + const byDepth = a.split('.').length - b.split('.').length; + + if (byDepth !== 0) { + return byDepth; + } + + return a.localeCompare(b); + }); + + return syntheticOrder.map((longname, index) => { + const kind = syntheticKinds.get(longname)!; + return createSyntheticDoclet(kind, longname, index + 1); + }); +} + +// --------------------------------------------------------------------------- +// Declaration emission & overlay +// --------------------------------------------------------------------------- + +function detectAuthorityKind(modulePath: string, canonicalSymbol: string, declarationFragment: string): OverlayDeclarationKind { + const declarationName = canonicalSymbol.split('.').pop() || canonicalSymbol; + const classPattern = new RegExp(`\\bclass\\s+${declarationName}\\b`); + + if (classPattern.test(declarationFragment)) { + return 'class'; + } + + const functionPattern = new RegExp(`\\bfunction\\s+${declarationName}\\s*\\(`); + + if (functionPattern.test(declarationFragment)) { + return 'function'; + } + + // Check for an interface declaration with the canonical name. + // This handles mixin modules where the exported mixin interface has been + // renamed (via MODULE_TYPE_RULES) from e.g. DepthMixin to Depth before + // this function is called. + const interfacePattern = new RegExp(`\\binterface\\s+${declarationName}\\b`); + + if (interfacePattern.test(declarationFragment)) { + return 'interface'; + } + + const typePattern = new RegExp(`\\btype\\s+${declarationName}\\b`); + + if (typePattern.test(declarationFragment)) { + return 'type'; + } + + // Fallback: const/variable/type/enum exports are not recognised here and + // will default to 'function'; those cases are handled upstream. + return inferKindFromMigratedSource(modulePath) || 'function'; +} + +function buildCanonicalSymbolModuleLookup(manifest: MigratedModulesManifest): Map { + const symbolToModulePath = new Map(); + + for (const [modulePath, canonicalSymbols] of Object.entries(manifest)) { + for (const canonicalSymbol of canonicalSymbols) { + symbolToModulePath.set(canonicalSymbol, modulePath); + } + } + + return symbolToModulePath; +} + +function toIndentedBlock(block: string, indent: string): string { + const normalized = block.replace(/\s+$/, ''); + const lines = normalized.split(/\r?\n/); + + return `${lines.map((line) => (line.length > 0 ? `${indent}${line}` : '')).join('\n')}\n`; +} + +function normalizeAuthorityFragment(modulePath: string, declarationText: string): string { + let fragment = declarationText; + + fragment = fragment.replace(/^import[^\n]*\n/gm, ''); + fragment = fragment.replace(/^export\s+default[^\n]*\n/gm, ''); + fragment = fragment.replace(/\bexport\s+declare\s+/g, ''); + fragment = fragment.replace(/\bexport\s+/g, ''); + + return fragment.trim(); +} + +function qualifyType(fragment: string, shortName: string, qualifiedName: string): string { + const prefix = qualifiedName.slice(0, qualifiedName.length - shortName.length); + const pattern = new RegExp(`\\b${shortName}\\b`, 'g'); + + // Pre-compute JSDoc comment regions so we can skip prose matches. + // Only matches inside /** ... */ blocks are skipped; type positions + // (extends clauses, parameter types, return types) are outside comments. + const commentRegions: Array<{ start: number; end: number }> = []; + const commentPattern = /\/\*\*[\s\S]*?\*\//g; + let cm: RegExpExecArray | null; + + while ((cm = commentPattern.exec(fragment)) !== null) { + commentRegions.push({ start: cm.index, end: cm.index + cm[0].length }); + } + + return fragment.replace(pattern, (match, offset, source) => { + if (offset >= prefix.length && source.startsWith(prefix, offset - prefix.length)) { + return match; + } + + // Don't qualify type names inside JSDoc prose comments. + for (const region of commentRegions) { + if (offset >= region.start && offset < region.end) { + return match; + } + } + + return qualifiedName; + }); +} + +type QualificationRule = + | { type: 'qualify'; shortName: string; qualifiedName: string } + | { type: 'replace'; pattern: RegExp; replacement: string }; + +const MODULE_TYPE_RULES: Record = { + 'src/geom/rectangle/Rectangle.ts': [ + { type: 'replace', pattern: /typeof\s+Line\.prototype/g, replacement: 'Phaser.Geom.Line' }, + { type: 'qualify', shortName: 'Vector2', qualifiedName: 'Phaser.Math.Vector2' }, + ], + 'src/gameobjects/nineslice/NineSliceVertex.ts': [ + { type: 'qualify', shortName: 'Vector2', qualifiedName: 'Phaser.Math.Vector2' }, + ], + 'src/geom/rectangle/Contains.ts': [ + { type: 'qualify', shortName: 'Rectangle', qualifiedName: 'Phaser.Geom.Rectangle' }, + ], + 'src/math/Vector2.ts': [ + { type: 'qualify', shortName: 'Vector2Like', qualifiedName: 'Phaser.Types.Math.Vector2Like' }, + ], + 'src/structs/Map.ts': [ + { type: 'replace', pattern: /map: Map/g, replacement: 'map: Phaser.Structs.Map' }, + { type: 'replace', pattern: /\bEachMapCallback\s*<\s*K\s*,\s*V\s*>/g, replacement: '(key: K, entry: V) => boolean | void' }, + ], + 'src/gameobjects/components/Depth.ts': [ + { type: 'replace', pattern: /\bDepthMixin\b/g, replacement: 'Depth' }, + ], + 'src/gameobjects/components/Visible.ts': [ + { type: 'replace', pattern: /\bVisibleMixin\b/g, replacement: 'Visible' }, + ], + 'src/gameobjects/zone/Zone.ts': [ + { type: 'qualify', shortName: 'HitAreaCallback', qualifiedName: 'Phaser.Types.Input.HitAreaCallback' }, + ], + 'src/input/typedefs/HitAreaCallback.ts': [ + { type: 'replace', pattern: /gameObject:\s*GameObject\b/g, replacement: 'gameObject: Phaser.GameObjects.GameObject' }, + ], +}; + +function normalizeCanonicalDeclaration(modulePath: string, declarationText: string): string { + let fragment = declarationText; + const rules = MODULE_TYPE_RULES[modulePath]; + + if (rules) { + for (const rule of rules) { + if (rule.type === 'qualify') { + fragment = qualifyType(fragment, rule.shortName, rule.qualifiedName); + } + else { + fragment = fragment.replace(rule.pattern, rule.replacement); + } + } + } + + fragment = fragment.replace(/extends\s+\w*Base\b/g, 'extends Phaser.GameObjects.GameObject'); + fragment = fragment.replace(/\bTODO_MIGRATE_Scene\b/g, 'Phaser.Scene'); + fragment = fragment.replace(/\bTODO_MIGRATE_GameObjectInstance\b/g, 'Phaser.GameObjects.GameObject'); + fragment = fragment.replace(/\bTODO_MIGRATE_GameObjectCtor\b/g, 'Phaser.GameObjects.GameObject'); + + return fragment.trim(); +} + +function getSourceText(modulePath: string): string { + return fs.readFileSync(path.resolve(REPO_ROOT, modulePath), 'utf8'); +} + +function extractClassComponentExtends(source: string, className: string): string[] { + const jsdocBlockRegex = /\/\*\*[\s\S]*?\*\//g; + const classAfterRegex = /export\s+(?:default\s+)?class\s+(\w+)/y; + const extendsTags: string[] = []; + let blockMatch: RegExpExecArray | null; + + while ((blockMatch = jsdocBlockRegex.exec(source)) !== null) { + classAfterRegex.lastIndex = skipWhitespaceAndLineCommentsAfterJSDoc(source, blockMatch.index + blockMatch[0].length); + const classMatch = classAfterRegex.exec(source); + + if (!classMatch || classMatch[1] !== className) { + continue; + } + + const tagRegex = /@extends\s+(Phaser\.GameObjects\.Components\.\w+)/g; + let tagMatch: RegExpExecArray | null; + + while ((tagMatch = tagRegex.exec(blockMatch[0])) !== null) { + extendsTags.push(tagMatch[1]); + } + + break; + } + + return Array.from(new Set(extendsTags)); +} + +function buildClassMergeInterface(modulePath: string, className: string): string | null { + const components = extractClassComponentExtends(getSourceText(modulePath), className); + + if (components.length === 0) { + return null; + } + + return `interface ${className} extends ${components.join(', ')} {\n}`; +} + +function deriveCanonicalDeclarationMap( + moduleDeclarationMap: Map, + symbolToModulePath: Map +): Map { + const canonicalDeclarationMap = new Map(); + const canonicalSymbols = Array.from(symbolToModulePath.keys()).sort((a, b) => a.localeCompare(b)); + + for (const canonicalSymbol of canonicalSymbols) { + const modulePath = symbolToModulePath.get(canonicalSymbol)!; + const moduleDeclaration = moduleDeclarationMap.get(modulePath); + + if (!moduleDeclaration) { + throw new Error(`No declaration fragment available for migrated module '${modulePath}'.`); + } + + const declarationName = canonicalSymbol.split('.').pop()!; + + // Apply module-type rules (e.g. interface renames) to the full declaration + // fragment *before* authority-kind detection and declaration extraction. + // This ensures that detectAuthorityKind and getTopLevelDeclarationRange see + // the final canonical names (e.g. `interface Depth` after renaming `DepthMixin`). + const normalizedModuleDeclaration = normalizeCanonicalDeclaration(modulePath, moduleDeclaration); + + const expectedKind = detectAuthorityKind(modulePath, canonicalSymbol, normalizedModuleDeclaration); + const range = getTopLevelDeclarationRange(normalizedModuleDeclaration, declarationName, expectedKind); + let declaration = normalizedModuleDeclaration.substring(range.start, range.end).trim(); + + if (expectedKind === 'class') { + declaration = removePrivateClassMembers(declaration, declarationName); + + const mergeInterface = buildClassMergeInterface(modulePath, declarationName); + + if (mergeInterface) { + declaration += `\n\n${mergeInterface}`; + } + } + + // Normalization was applied to the full module text, not just this range. + canonicalDeclarationMap.set(canonicalSymbol, declaration); + } + + return canonicalDeclarationMap; +} + +function emitMigratedModuleDeclarations(manifest: MigratedModulesManifest): Map { + const modulePaths = Object.keys(manifest).sort((a, b) => a.localeCompare(b)); + const entryFiles = modulePaths.map((modulePath) => path.resolve(REPO_ROOT, modulePath)); + const emittedDeclarations = new Map(); + const compilerOptions: ts.CompilerOptions = { + target: ts.ScriptTarget.ES2018, + module: ts.ModuleKind.Node16, + moduleResolution: ts.ModuleResolutionKind.Node16, + declaration: true, + emitDeclarationOnly: true, + allowJs: true, + skipLibCheck: true, + strict: false + }; + const host = ts.createCompilerHost(compilerOptions); + + const program = ts.createProgram(entryFiles, compilerOptions, { + ...host, + writeFile: (fileName: string, content: string) => { + if (fileName.endsWith('.d.ts')) { + emittedDeclarations.set(path.normalize(fileName), content); + } + } + }); + + const emitResult = program.emit(); + const diagnostics = ts + .getPreEmitDiagnostics(program) + .concat(emitResult.diagnostics) + .filter((diagnostic) => diagnostic.code !== 2578); + + if (diagnostics.length > 0) { + const formattedDiagnostics = ts.formatDiagnosticsWithColorAndContext(diagnostics, { + getCurrentDirectory: () => REPO_ROOT, + getCanonicalFileName: (fileName) => fileName, + getNewLine: () => '\n' + }); + + throw new Error(`Failed to emit authoritative migrated declarations:\n${formattedDiagnostics}`); + } + + const moduleDeclarationMap = new Map(); + + for (const modulePath of modulePaths) { + const absoluteSource = path.resolve(REPO_ROOT, modulePath); + const emittedPath = path.normalize(absoluteSource.replace(/\.[jt]s$/, '.d.ts')); + const declarationText = emittedDeclarations.get(emittedPath); + + if (!declarationText) { + throw new Error(`Missing emitted declaration for migrated module '${modulePath}'.`); + } + + moduleDeclarationMap.set(modulePath, normalizeAuthorityFragment(modulePath, declarationText)); + } + + return moduleDeclarationMap; +} + +// --------------------------------------------------------------------------- +// Public overlay API +// --------------------------------------------------------------------------- + +export function applyMigratedAuthorityOverlay(out: string, manifest: MigratedModulesManifest): string { + const moduleDeclarationMap = emitMigratedModuleDeclarations(manifest); + const symbolToModulePath = buildCanonicalSymbolModuleLookup(manifest); + const canonicalDeclarationMap = deriveCanonicalDeclarationMap(moduleDeclarationMap, symbolToModulePath); + + // Parse the declaration output once and build a name-keyed index so each + // canonical symbol lookup below is O(1) instead of an AST traversal. + const sourceFile = ts.createSourceFile('phaser.d.ts', out, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS); + const index = buildDeclarationIndex(sourceFile); + + type ReplacementOp = { + start: number; + end: number; + fragment: string; + }; + + const ops: ReplacementOp[] = []; + + for (const [canonicalSymbol, declarationFragment] of canonicalDeclarationMap) { + const modulePath = symbolToModulePath.get(canonicalSymbol)!; + const expectedKind = detectAuthorityKind(modulePath, canonicalSymbol, declarationFragment); + let replaceStart: number; + let replaceEnd: number; + + try { + const range = getDeclarationRangeFromIndex(index, canonicalSymbol, expectedKind); + + replaceStart = range.start; + replaceEnd = range.end; + } + catch (error) { + // Only class/interface may be freshly inserted; functions must replace existing. + if (expectedKind !== 'class' && expectedKind !== 'interface') { + throw error; + } + + // No existing class/interface declaration: insert a fresh one inside the namespace. + replaceStart = getClassInsertionPointFromIndex(index, canonicalSymbol); + replaceEnd = replaceStart; + } + + ops.push({ start: replaceStart, end: replaceEnd, fragment: declarationFragment }); + } + + // Sort ascending by start offset for segment-based assembly + ops.sort((a, b) => a.start - b.start); + + const segments: string[] = []; + let cursor = 0; + + for (const op of ops) { + // Preserve text between previous op and this one + segments.push(out.substring(cursor, op.start)); + + // Compute indentation from original text + const lineStart = out.lastIndexOf('\n', op.start - 1) + 1; + const linePrefix = out.substring(lineStart, op.start); + const indentMatch = linePrefix.match(/^\s*/); + const indent = indentMatch ? indentMatch[0] : ''; + let replacement = toIndentedBlock(op.fragment, indent); + + if (op.start > 0 && out[op.start - 1] !== '\n') { + replacement = `\n${replacement}`; + } + + // Ensure a trailing newline if the original text after the op doesn't start with one + const charAfterEnd = op.end < out.length ? out[op.end] : '\n'; + const needsTrailingGap = charAfterEnd !== '\r' && charAfterEnd !== '\n'; + + segments.push(replacement); + + if (needsTrailingGap) { + segments.push('\n'); + } + + cursor = op.end; + } + + segments.push(out.substring(cursor)); + + // Normalize blank lines: toIndentedBlock uses LF and appends '\n', + // while the original d.ts uses CRLF. This can create runs of 3+ + // consecutive line breaks at replacement boundaries (both between + // adjacent replacements and between a replacement and original text). + // Collapse any such run to exactly 2 line breaks (one blank line). + return segments.join('').replace(/(\r?\n){3,}/g, (match) => { + // Detect line-ending style from the first captured sequence + const eol = match.includes('\r\n') ? '\r\n' : '\n'; + + return `${eol}${eol}`; + }); +} + +export function validateNoSyntheticLeak(out: string, canonicalSymbols: string[]): void { + const leakedMarkers = [SYNTHETIC_META_MARKER, SYNTHETIC_DOCLET_FLAG]; + + for (const marker of leakedMarkers) { + if (out.includes(marker)) { + throw new Error(`Synthetic marker metadata leaked into emitted declarations: '${marker}'.`); + } + } + + // Parse once and index by canonical name for O(1) symbol range lookups. + const sourceFile = ts.createSourceFile('phaser.d.ts', out, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS); + const index = buildDeclarationIndex(sourceFile); + + const fallbackPatterns = [/\.\.\.args:\s*any\[\]/, /@returns\s+undefined/, /constructor\(\.\.\.args:\s*any\[\]\)/]; + + for (const canonicalSymbol of canonicalSymbols) { + const range = getDeclarationRangeFromIndex(index, canonicalSymbol); + const declarationText = out.substring(range.start, range.end); + + for (const pattern of fallbackPatterns) { + if (pattern.test(declarationText)) { + throw new Error(`Synthetic fallback signature leaked for migrated symbol '${canonicalSymbol}' (${pattern}).`); + } + } + } +} + +export function normalizeDeclarationOutput(out: string): string { + return out.replace(/\r\n?/g, '\n'); +} diff --git a/scripts/tsgen/src/Parser.ts b/scripts/tsgen/src/Parser.ts index dc7f6df76e..4d78fc8591 100644 --- a/scripts/tsgen/src/Parser.ts +++ b/scripts/tsgen/src/Parser.ts @@ -7,6 +7,9 @@ import * as dom from 'dts-dom'; const regexEndLine = /^(.*)\r\n|\n|\r/gm; +export const SYNTHETIC_DOCLET_FLAG = '_syntheticTsgen'; +export const SYNTHETIC_META_MARKER = '[tsgen-synthetic]'; + export class Parser { topLevel: dom.TopLevelDeclaration[]; @@ -60,6 +63,9 @@ export class Parser { return out + dom.emit(obj); }, '')); + // Workaround: dts-dom omits the space before `extends` in interface declarations + result = result.replace(/\binterface (\w+)extends /g, 'interface $1 extends '); + if (ignored.length > 0) { console.log('ignored top level properties:'); @@ -171,7 +177,10 @@ export class Parser { obj = this.createEvent(doclet); break; default: - console.log('Ignored doclet kind: ' + doclet.kind); + if (!doclet[SYNTHETIC_DOCLET_FLAG]) + { + console.log('Ignored doclet kind: ' + doclet.kind); + } break; } @@ -179,8 +188,11 @@ export class Parser { { if (container[doclet.longname]) { - console.log('Warning: ignoring duplicate doc name: ' + doclet.longname); - console.log('Meta: ', doclet.meta); + if (!doclet[SYNTHETIC_DOCLET_FLAG]) + { + console.log('Warning: ignoring duplicate doc name: ' + doclet.longname); + console.log('Meta: ', doclet.meta); + } docs.splice(i--, 1); continue; @@ -213,8 +225,11 @@ export class Parser { if (!obj) { - console.log(`${doclet.longname} - Kind: ${doclet.kind}`); - console.log(`Warning: Didn't find object`); + if (!doclet[SYNTHETIC_DOCLET_FLAG]) + { + console.log(`${doclet.longname} - Kind: ${doclet.kind}`); + console.log(`Warning: Didn't find object`); + } continue; } @@ -231,14 +246,20 @@ export class Parser { if (!parent) { - console.log(`${doclet.longname} - Kind: ${doclet.kind}`); - console.log(`PARENT WARNING: ${doclet.longname} in ${doclet.meta.filename}@${doclet.meta.lineno} has parent '${doclet.memberof}' that is not defined.`); + if (!doclet[SYNTHETIC_DOCLET_FLAG]) + { + console.log(`${doclet.longname} - Kind: ${doclet.kind}`); + console.log(`PARENT WARNING: ${doclet.longname} in ${doclet.meta.filename}@${doclet.meta.lineno} has parent '${doclet.memberof}' that is not defined.`); + } continue; } if (!(parent as any).kind) { - console.log(`PARENT KIND WARNING: ${doclet.longname} in ${doclet.meta.filename}@${doclet.meta.lineno} has parent '${doclet.memberof}' that is not defined.`); + if (!doclet[SYNTHETIC_DOCLET_FLAG]) + { + console.log(`PARENT KIND WARNING: ${doclet.longname} in ${doclet.meta.filename}@${doclet.meta.lineno} has parent '${doclet.memberof}' that is not defined.`); + } } if ((parent).members) @@ -247,9 +268,12 @@ export class Parser { } else { - console.log(`${doclet.longname} - Kind: ${doclet.kind}`); - console.log('Could not find members array'); - console.log(parent); + if (!doclet[SYNTHETIC_DOCLET_FLAG]) + { + console.log(`${doclet.longname} - Kind: ${doclet.kind}`); + console.log('Could not find members array'); + console.log(parent); + } } (obj)._parent = parent; @@ -351,6 +375,31 @@ export class Parser { else { o.implements.push(dom.create.interface(name)); + + // Add a companion interface declaration for declaration merging so + // that mixin members are accessible as class-instance members. + // TypeScript's `implements` only constrains at definition time; a + // companion `interface Foo extends Mixin {}` in the same namespace + // is the idiomatic way to expose mixin members on the class type. + const parentNs = this.namespaces[doclet.memberof]; + if (parentNs) + { + // Reuse an existing companion interface for this class if one + // was already created by a previous mixin in the same loop, + // avoiding duplicate interface declarations with the same name. + let companion = parentNs.members.find( + (m): m is dom.InterfaceDeclaration => m.kind === 'interface' && m.name === doclet.name + ) as dom.InterfaceDeclaration | undefined; + + if (!companion) + { + companion = dom.create.interface(doclet.name); + companion.baseTypes = companion.baseTypes ?? []; + parentNs.members.push(companion); + } + + companion.baseTypes!.push(dom.create.interface(name)); + } } } } @@ -603,11 +652,16 @@ export class Parser { private processTypeName(name: string): string { if (name === 'float') return 'number'; + if (name === 'String') return 'string'; if (name === 'function') return 'Function'; if (name === 'Array.') return 'Function[]'; if (name === 'array') return 'any[]'; // if (name === 'object') return '{[key: string]: any}'; + if (name.includes('<')) { + name = name.replace(/([<,]\s*)String(?=\s*[,>])/g, '$1string'); + } + if (name.startsWith('Array<')) { let matches = name.match(/^Array<(.*)>$/); diff --git a/scripts/tsgen/src/publish.ts b/scripts/tsgen/src/publish.ts index b93fe0e144..b77c013623 100644 --- a/scripts/tsgen/src/publish.ts +++ b/scripts/tsgen/src/publish.ts @@ -1,6 +1,21 @@ import * as fs from 'fs-extra'; import * as path from 'path'; import { Parser } from './Parser'; +import { + discoverMigratedModules, + flattenCanonicalSymbols, + reportMigrationProgress, + buildSyntheticDoclets, + applyMigratedAuthorityOverlay, + normalizeDeclarationOutput, + validateNoSyntheticLeak, +} from './MigratedOverlay'; + +let migratedCanonicalSymbolLookup: Set | null = null; + +export function isMigratedCanonicalSymbol(symbol: string): boolean { + return migratedCanonicalSymbolLookup !== null && migratedCanonicalSymbolLookup.has(symbol); +} export function publish(data: any, opts: any) { // remove undocumented stuff. @@ -18,11 +33,30 @@ export function publish(data: any, opts: any) { fs.mkdirSync(opts.destination); } - var str = JSON.stringify(data().get(), null, 4); + const docs = data().get(); + + var str = JSON.stringify(docs, null, 4); fs.writeFileSync(path.join(opts.destination, 'phaser.json'), str); - var out = new Parser(data().get()).emit(); + const manifest = discoverMigratedModules(); + const canonicalSymbols = flattenCanonicalSymbols(manifest); + + migratedCanonicalSymbolLookup = new Set(canonicalSymbols); + + reportMigrationProgress(canonicalSymbols.length); + + const syntheticDoclets = buildSyntheticDoclets(manifest, docs); + + docs.push(...syntheticDoclets); + + var out = new Parser(docs).emit(); + + out = applyMigratedAuthorityOverlay(out, manifest); + + out = normalizeDeclarationOutput(out); + + validateNoSyntheticLeak(out, canonicalSymbols); fs.writeFileSync(path.join(opts.destination, 'phaser.d.ts'), out); }; diff --git a/scripts/tsgen/test/bin/game.js b/scripts/tsgen/test/bin/game.js deleted file mode 100644 index 84c2da7211..0000000000 --- a/scripts/tsgen/test/bin/game.js +++ /dev/null @@ -1,694 +0,0 @@ -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -// --------------------------------------------------------------------------- -// Phaser TypeScript Definitions Test -// --------------------------------------------------------------------------- -// This file exercises as much of the Phaser API surface as possible so that -// TypeScript compilation errors reveal problems in the generated .d.ts file. -// It is NOT a runtime test -- it just needs to compile cleanly. -// --------------------------------------------------------------------------- -// --------------------------------------------------------------------------- -// Scene -// --------------------------------------------------------------------------- -var BootScene = /** @class */ (function (_super) { - __extends(BootScene, _super); - function BootScene() { - return _super.call(this, { key: 'BootScene', active: true }) || this; - } - BootScene.prototype.init = function (data) { - }; - BootScene.prototype.preload = function () { - // Loader - various file types (files do not exist, so these will 404 at runtime, but that's not what we're testing here) - this.load.image('logo', 'assets/logo.png'); - this.load.atlas('cards', 'assets/atlas/cards.png', 'assets/atlas/cards.json'); - this.load.spritesheet('gems', 'assets/gems.png', { frameWidth: 32, frameHeight: 32 }); - this.load.audio('bgm', ['assets/bgm.ogg', 'assets/bgm.mp3']); - this.load.bitmapFont('font', 'assets/font.png', 'assets/font.fnt'); - this.load.tilemapTiledJSON('map', 'assets/map.json'); - this.load.json('data', 'assets/data.json'); - this.load.text('story', 'assets/story.txt'); - this.load.glsl('shader', 'assets/shader.frag'); - this.load.html('form', 'assets/form.html'); - this.load.video('intro', 'assets/intro.mp4'); - // Loader events - this.load.on(Phaser.Loader.Events.COMPLETE, function () { }); - this.load.on(Phaser.Loader.Events.PROGRESS, function (value) { }); - }; - BootScene.prototype.create = function () { - // --------------------------------------------------------------- - // Game Objects - Core types - // --------------------------------------------------------------- - // Image - var image = this.add.image(100, 100, 'logo'); - image.setOrigin(0.5, 0.5); - image.setScale(2); - image.setAngle(45); - image.setAlpha(0.8); - image.setDepth(10); - image.setPosition(200, 200); - image.setRotation(Math.PI / 4); - image.setVisible(true); - image.setBlendMode(Phaser.BlendModes.ADD); - image.setScrollFactor(1, 1); - image.setFlip(true, false); - image.setTint(0xff0000); - image.setTexture('logo'); - image.setDisplaySize(64, 64); - image.setSize(64, 64); - image.setInteractive(); - image.setName('myImage'); - image.setData('score', 100); - image.getData('score'); - image.setDataEnabled(); - image.destroy(); - // Sprite - var sprite = this.add.sprite(400, 300, 'cards', 'clubs3'); - sprite.play('walk'); - sprite.anims.pause(); - sprite.anims.resume(); - sprite.anims.stop(); - // Text - var text = this.add.text(100, 100, 'Hello Phaser 4', { - fontFamily: 'Arial', - fontSize: '32px', - color: '#ffffff', - align: 'center', - wordWrap: { width: 300 }, - padding: { x: 10, y: 10 }, - backgroundColor: '#000000', - stroke: '#ff0000', - strokeThickness: 2, - shadow: { offsetX: 2, offsetY: 2, color: '#000', blur: 4, fill: true } - }); - text.setText('Updated text'); - text.setStyle({ fontSize: '48px' }); - text.setColor('#00ff00'); - text.setFontSize(24); - text.setFontFamily('Courier'); - text.setWordWrapWidth(400); - text.setPadding(10, 10, 10, 10); - // BitmapText - var bitmapText = this.add.bitmapText(200, 200, 'font', 'Hello', 32); - bitmapText.setText('Updated'); - bitmapText.setFontSize(48); - bitmapText.setLetterSpacing(2); - bitmapText.setTint(0x00ff00); - // Container - var container = this.add.container(0, 0); - container.add(sprite); - container.addAt(image, 0); - container.setSize(300, 200); - container.setDepth(5); - container.removeAll(); - // Layer - var layer = this.add.layer(); - layer.add(sprite); - layer.setDepth(1); - layer.setVisible(true); - // Graphics - var graphics = this.add.graphics(); - graphics.fillStyle(0xff0000, 1); - graphics.fillRect(0, 0, 100, 100); - graphics.fillCircle(200, 200, 50); - graphics.fillRoundedRect(0, 0, 200, 100, 16); - graphics.lineStyle(2, 0x00ff00, 1); - graphics.strokeRect(50, 50, 100, 100); - graphics.strokeCircle(300, 300, 75); - graphics.lineBetween(0, 0, 400, 400); - graphics.beginPath(); - graphics.moveTo(0, 0); - graphics.lineTo(100, 100); - graphics.closePath(); - graphics.strokePath(); - graphics.fillPath(); - graphics.clear(); - // Shapes - var rect = this.add.rectangle(100, 100, 200, 150, 0xff0000); - rect.setStrokeStyle(2, 0x00ff00); - var circle = this.add.circle(300, 300, 50, 0x0000ff); - circle.setStrokeStyle(1, 0xffffff); - var triangle = this.add.triangle(400, 400, 0, 100, 50, 0, 100, 100, 0xff00ff); - var ellipse = this.add.ellipse(500, 300, 120, 80, 0xffff00); - var line = this.add.line(0, 0, 100, 100, 300, 300, 0x00ffff); - line.setLineWidth(3); - var star = this.add.star(200, 200, 5, 30, 60, 0xffaa00); - var polygon = this.add.polygon(300, 300, [0, 0, 100, 0, 100, 100, 0, 100], 0x00aaff); - var arc = this.add.arc(400, 200, 50, 0, 270, false, 0xaa00ff); - var grid = this.add.grid(400, 300, 256, 256, 32, 32, 0x222222, 1, 0x444444, 1); - // NineSlice - var nineSlice = this.add.nineslice(400, 300, 'logo', undefined, 256, 128, 20, 20, 20, 20); - nineSlice.setSize(512, 256); - // TileSprite - var tileSprite = this.add.tileSprite(400, 300, 800, 600, 'logo'); - tileSprite.setTilePosition(10, 20); - tileSprite.setTileScale(2, 2); - // Video - var video = this.add.video(400, 300, 'intro'); - video.play(true); - // Zone - var zone = this.add.zone(400, 300, 200, 200); - zone.setInteractive(); - // Particles - var particles = this.add.particles(400, 300, 'logo', { - speed: 100, - scale: { start: 1, end: 0 }, - lifespan: 2000, - blendMode: Phaser.BlendModes.ADD, - frequency: 50, - quantity: 2, - gravityY: 200, - alpha: { start: 1, end: 0 }, - angle: { min: 0, max: 360 }, - rotate: { min: 0, max: 360 }, - emitting: true - }); - particles.stop(); - particles.start(); - // Blitter - var blitter = this.add.blitter(0, 0, 'cards'); - blitter.create(100, 100, 'clubs3'); - // --------------------------------------------------------------- - // RenderTexture / DynamicTexture - // --------------------------------------------------------------- - var rt = this.add.renderTexture(400, 300, 256, 256); - rt.draw(sprite); - rt.clear(); - var dt = this.textures.addDynamicTexture('dynamic', 256, 256); - if (dt) { - dt.fill(0xff0000); - dt.stamp('logo', undefined, 128, 128); - } - // --------------------------------------------------------------- - // Animations - // --------------------------------------------------------------- - this.anims.create({ - key: 'walk', - frames: this.anims.generateFrameNumbers('gems', { start: 0, end: 7 }), - frameRate: 10, - repeat: -1, - yoyo: true - }); - this.anims.create({ - key: 'explode', - frames: this.anims.generateFrameNames('cards', { - prefix: 'clubs', - start: 1, - end: 10 - }), - frameRate: 20, - repeat: 0, - hideOnComplete: true - }); - var anim = this.anims.get('walk'); - if (anim) { - var totalFrames = anim.getTotalFrames(); - } - this.anims.remove('walk'); - // --------------------------------------------------------------- - // Input - // --------------------------------------------------------------- - // Pointer input - this.input.on(Phaser.Input.Events.POINTER_DOWN, function (pointer) { - var x = pointer.x; - var y = pointer.y; - var isDown = pointer.isDown; - var worldX = pointer.worldX; - var worldY = pointer.worldY; - }); - this.input.on(Phaser.Input.Events.POINTER_UP, function () { }); - this.input.on(Phaser.Input.Events.POINTER_MOVE, function () { }); - // Game object input events - sprite.on(Phaser.Input.Events.POINTER_OVER, function () { }); - sprite.on(Phaser.Input.Events.POINTER_OUT, function () { }); - sprite.on(Phaser.Input.Events.DRAG_START, function () { }); - sprite.on(Phaser.Input.Events.DRAG, function () { }); - sprite.on(Phaser.Input.Events.DRAG_END, function () { }); - this.input.setDraggable(sprite); - // Keyboard - var cursors = this.input.keyboard.createCursorKeys(); - var spaceKey = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.SPACE); - var combo = this.input.keyboard.createCombo('PHASER', { - resetOnWrongKey: true, - resetOnMatch: true - }); - // --------------------------------------------------------------- - // Camera - // --------------------------------------------------------------- - var cam = this.cameras.main; - cam.setZoom(1.5); - cam.setScroll(100, 100); - cam.setBounds(0, 0, 1600, 1200); - cam.setBackgroundColor(0x222222); - cam.setSize(800, 600); - cam.setPosition(0, 0); - cam.setRotation(0.1); - cam.setRoundPixels(true); - cam.startFollow(sprite, true, 0.1, 0.1); - cam.stopFollow(); - cam.fadeIn(1000); - cam.fadeOut(1000); - cam.flash(500); - cam.shake(300, 0.01); - cam.pan(400, 300, 2000); - cam.zoomTo(2, 1000); - cam.ignore(graphics); - cam.centerOn(400, 300); - cam.setViewport(0, 0, 800, 600); - var cam2 = this.cameras.add(0, 0, 400, 300); - this.cameras.remove(cam2); - // --------------------------------------------------------------- - // Tweens - // --------------------------------------------------------------- - var tween = this.tweens.add({ - targets: sprite, - x: 600, - y: 400, - alpha: 0.5, - scaleX: 2, - scaleY: 2, - rotation: Math.PI, - duration: 2000, - ease: 'Power2', - delay: 500, - repeat: 3, - repeatDelay: 200, - yoyo: true, - hold: 100, - onStart: function () { }, - onComplete: function () { }, - onUpdate: function () { }, - onRepeat: function () { }, - onYoyo: function () { } - }); - tween.pause(); - tween.resume(); - tween.stop(); - tween.remove(); - // Tween chain - var chain = this.tweens.chain({ - targets: sprite, - tweens: [ - { x: 100, duration: 500 }, - { y: 100, duration: 500 }, - { x: 400, y: 300, duration: 1000 } - ], - loop: 2 - }); - // Number tween - var counter = this.tweens.addCounter({ - from: 0, - to: 100, - duration: 2000, - ease: 'Linear', - onUpdate: function (tween) { - var value = tween.getValue(); - } - }); - // Stagger - this.tweens.add({ - targets: [sprite, image], - y: 500, - duration: 1000, - delay: this.tweens.stagger(100) - }); - // --------------------------------------------------------------- - // Timer Events - // --------------------------------------------------------------- - this.time.addEvent({ - delay: 1000, - callback: function () { }, - callbackScope: this, - loop: true - }); - this.time.delayedCall(2000, function () { }); - // --------------------------------------------------------------- - // Physics - Arcade - // --------------------------------------------------------------- - var physSprite = this.physics.add.sprite(400, 300, 'logo'); - physSprite.setVelocity(100, 200); - physSprite.setAcceleration(10, 10); - physSprite.setBounce(0.5, 0.5); - physSprite.setCollideWorldBounds(true); - physSprite.setDrag(50, 50); - physSprite.setFriction(0.1, 0.1); - physSprite.setGravityY(300); - physSprite.setImmovable(false); - physSprite.setMass(1); - physSprite.setMaxVelocity(300, 300); - physSprite.setCircle(16); - physSprite.setSize(32, 32); - physSprite.setOffset(0, 0); - var physImage = this.physics.add.image(200, 200, 'logo'); - physImage.setVelocityX(50); - var staticGroup = this.physics.add.staticGroup(); - var dynamicGroup = this.physics.add.group(); - this.physics.add.collider(physSprite, staticGroup); - this.physics.add.overlap(physSprite, dynamicGroup, function (obj1, obj2) { }); - this.physics.world.setBounds(0, 0, 1600, 1200); - this.physics.world.gravity.y = 300; - var closest = this.physics.closest(physSprite); - // --------------------------------------------------------------- - // Tilemap - // --------------------------------------------------------------- - var tilemap = this.make.tilemap({ key: 'map' }); - var tileset = tilemap.addTilesetImage('tiles', 'logo'); - if (tileset) { - var tilemapLayer = tilemap.createLayer('ground', tileset, 0, 0); - if (tilemapLayer) { - tilemapLayer.setCollisionByProperty({ collides: true }); - tilemapLayer.setCollisionBetween(1, 100); - tilemapLayer.setTileIndexCallback(1, function () { }, this); - tilemap.setCollision([1, 2, 3]); - } - tilemap.createFromObjects('objects', { gid: 1 }); - } - // --------------------------------------------------------------- - // Scene Management - // --------------------------------------------------------------- - this.scene.start('BootScene', { level: 1 }); - this.scene.launch('BootScene'); - this.scene.pause('BootScene'); - this.scene.resume('BootScene'); - this.scene.stop('BootScene'); - this.scene.restart(); - this.scene.setVisible(true); - this.scene.sendToBack('BootScene'); - this.scene.bringToTop('BootScene'); - this.scene.moveUp('BootScene'); - this.scene.moveDown('BootScene'); - // --------------------------------------------------------------- - // Sound - // --------------------------------------------------------------- - var sound = this.sound.add('bgm', { - volume: 0.5, - loop: true, - delay: 0 - }); - sound.play(); - sound.pause(); - sound.resume(); - sound.stop(); - this.sound.pauseAll(); - this.sound.resumeAll(); - this.sound.stopAll(); - // --------------------------------------------------------------- - // Data Manager - // --------------------------------------------------------------- - this.registry.set('highscore', 1000); - var hs = this.registry.get('highscore'); - this.registry.remove('highscore'); - this.data.set('lives', 3); - this.data.get('lives'); - this.data.remove('lives'); - // --------------------------------------------------------------- - // Events - // --------------------------------------------------------------- - this.events.on('custom-event', function (data) { }); - this.events.emit('custom-event', { score: 100 }); - this.events.once('one-time', function () { }); - this.events.off('custom-event'); - this.game.events.on(Phaser.Core.Events.BLUR, function () { }); - this.game.events.on(Phaser.Core.Events.FOCUS, function () { }); - this.game.events.on(Phaser.Core.Events.HIDDEN, function () { }); - this.game.events.on(Phaser.Core.Events.VISIBLE, function () { }); - // --------------------------------------------------------------- - // Math - // --------------------------------------------------------------- - var between = Phaser.Math.Between(1, 100); - var clamp = Phaser.Math.Clamp(150, 0, 100); - var distance = Phaser.Math.Distance.Between(0, 0, 100, 100); - var chebyshev = Phaser.Math.Distance.Chebyshev(0, 0, 100, 100); - var snake = Phaser.Math.Distance.Snake(0, 0, 100, 100); - var mathAngle = Phaser.Math.Angle.Between(0, 0, 100, 100); - var angleBetweenPoints = Phaser.Math.Angle.BetweenPoints({ x: 0, y: 0 }, { x: 100, y: 100 }); - var angleWrap = Phaser.Math.Angle.Wrap(7); - var degToRad = Phaser.Math.DegToRad(90); - var radToDeg = Phaser.Math.RadToDeg(Math.PI); - var lerp = Phaser.Math.Linear(0, 100, 0.5); - var percent = Phaser.Math.Percent(50, 0, 100); - var snap = Phaser.Math.Snap.To(55, 10); - var snapFloor = Phaser.Math.Snap.Floor(55, 10); - var snapCeil = Phaser.Math.Snap.Ceil(55, 10); - var fuzzyEqual = Phaser.Math.Fuzzy.Equal(1.001, 1, 0.01); - var fuzzyGreater = Phaser.Math.Fuzzy.GreaterThan(1.001, 1, 0.01); - var fuzzyLess = Phaser.Math.Fuzzy.LessThan(0.999, 1, 0.01); - var tau = Phaser.Math.TAU; - var piOver2 = Phaser.Math.PI_OVER_2; - // Vector2 - var v1 = new Phaser.Math.Vector2(10, 20); - var v2 = new Phaser.Math.Vector2(30, 40); - v1.add(v2); - v1.subtract(v2); - v1.scale(2); - v1.normalize(); - var len = v1.length(); - var lenSq = v1.lengthSq(); - var dot = v1.dot(v2); - var cross = v1.cross(v2); - v1.lerp(v2, 0.5); - v1.set(5, 10); - v1.setAngle(Math.PI); - v1.setLength(100); - v1.negate(); - v1.rotate(Math.PI / 2); - var v1Clone = v1.clone(); - v1.copy(v2); - v1.equals(v2); - v1.ceil(); - v1.floor(); - v1.invert(); - v1.project(v2); - // Vector3 - var v3 = new Phaser.Math.Vector3(1, 2, 3); - var v4 = new Phaser.Math.Vector3(4, 5, 6); - v3.add(v4); - v3.subtract(v4); - v3.scale(2); - v3.normalize(); - v3.cross(v4); - // Matrix - var matrix = new Phaser.Math.Matrix4(); - matrix.identity(); - matrix.translate(new Phaser.Math.Vector3(1, 2, 3)); - matrix.scale(new Phaser.Math.Vector3(2, 2, 2)); - matrix.invert(); - matrix.transpose(); - matrix.determinant(); - // Random data generator - var rng = new Phaser.Math.RandomDataGenerator(['seed1']); - var rngInt = rng.integer(); - var rngReal = rng.real(); - var rngFrac = rng.frac(); - var rngBetween = rng.between(0, 100); - var rngSign = rng.sign(); - var rngAngle = rng.angle(); - var rngPick = rng.pick(['a', 'b', 'c']); - var rngWeightedPick = rng.weightedPick(['a', 'b', 'c']); - // --------------------------------------------------------------- - // Geometry - // --------------------------------------------------------------- - // Circle - var geomCircle = new Phaser.Geom.Circle(100, 100, 50); - var circleArea = Phaser.Geom.Circle.Area(geomCircle); - var circumference = Phaser.Geom.Circle.Circumference(geomCircle); - var circleContains = geomCircle.contains(110, 110); - var circlePoint = geomCircle.getPoint(0.5); - var circlePoints = geomCircle.getPoints(10); - var circleRandom = geomCircle.getRandomPoint(); - // Rectangle - var geomRect = new Phaser.Geom.Rectangle(0, 0, 200, 100); - var rectArea = Phaser.Geom.Rectangle.Area(geomRect); - var rectPerimeter = Phaser.Geom.Rectangle.Perimeter(geomRect); - var rectContains = geomRect.contains(50, 50); - var rectPoint = geomRect.getPoint(0.5); - var rectPoints = geomRect.getPoints(10); - var rectRandom = geomRect.getRandomPoint(); - var rectCenter = Phaser.Geom.Rectangle.GetCenter(geomRect); - var rectSize = Phaser.Geom.Rectangle.GetSize(geomRect); - Phaser.Geom.Rectangle.Inflate(geomRect, 10, 10); - Phaser.Geom.Rectangle.CeilAll(geomRect); - Phaser.Geom.Rectangle.FloorAll(geomRect); - // Line - var geomLine = new Phaser.Geom.Line(0, 0, 100, 100); - var lineLength = Phaser.Geom.Line.Length(geomLine); - var lineAngle = Phaser.Geom.Line.Angle(geomLine); - var linePoint = geomLine.getPoint(0.5); - var linePoints = geomLine.getPoints(10); - var lineMid = Phaser.Geom.Line.GetMidPoint(geomLine); - // Triangle - var geomTriangle = new Phaser.Geom.Triangle(0, 100, 50, 0, 100, 100); - var triArea = Phaser.Geom.Triangle.Area(geomTriangle); - var triContains = geomTriangle.contains(50, 50); - var triPoint = geomTriangle.getPoint(0.5); - var triPoints = geomTriangle.getPoints(10); - var triCentroid = Phaser.Geom.Triangle.Centroid(geomTriangle); - var triInCenter = Phaser.Geom.Triangle.InCenter(geomTriangle); - // Ellipse - var geomEllipse = new Phaser.Geom.Ellipse(200, 200, 100, 60); - var ellipseArea = Phaser.Geom.Ellipse.Area(geomEllipse); - var ellipseContains = geomEllipse.contains(200, 200); - var ellipsePoint = geomEllipse.getPoint(0.5); - var ellipsePoints = geomEllipse.getPoints(10); - // Polygon - var geomPolygon = new Phaser.Geom.Polygon([0, 0, 100, 0, 100, 100, 0, 100]); - var polyArea = Phaser.Geom.Polygon.GetAABB(geomPolygon).width; - var polyContains = geomPolygon.contains(50, 50); - var polyPoints = geomPolygon.getPoints(10); - // Intersects - var rectOverlap = Phaser.Geom.Intersects.RectangleToRectangle(geomRect, new Phaser.Geom.Rectangle(50, 50, 100, 100)); - var circleRect = Phaser.Geom.Intersects.CircleToRectangle(geomCircle, geomRect); - var lineRect = Phaser.Geom.Intersects.LineToRectangle(geomLine, geomRect); - var lineCircle = Phaser.Geom.Intersects.LineToCircle(geomLine, geomCircle); - // --------------------------------------------------------------- - // Display - Color - // --------------------------------------------------------------- - var color = new Phaser.Display.Color(255, 128, 0, 255); - var r = color.red; - var g = color.green; - var b = color.blue; - var a = color.alpha; - var colorInt = color.color; - var colorStr = color.rgba; - color.setTo(0, 255, 0, 255); - var fromHex = Phaser.Display.Color.HexStringToColor('#ff0000'); - var fromInt = Phaser.Display.Color.IntegerToColor(0xff0000); - var fromRGB = Phaser.Display.Color.RGBStringToColor('rgb(255,0,0)'); - var fromValue = Phaser.Display.Color.ValueToColor('#ff0000'); - var random = Phaser.Display.Color.RandomRGB(); - var interpolated = Phaser.Display.Color.Interpolate.ColorWithColor(color, fromHex, 100, 50); - // --------------------------------------------------------------- - // Texture Manager - // --------------------------------------------------------------- - var texManager = this.textures; - var exists = texManager.exists('logo'); - var texture = texManager.get('logo'); - var frame = texture.get(); - var frameWidth = frame.width; - var frameHeight = frame.height; - // --------------------------------------------------------------- - // Scale Manager - // --------------------------------------------------------------- - var scaleManager = this.scale; - scaleManager.resize(1024, 768); - scaleManager.setGameSize(1024, 768); - var gameWidth = scaleManager.width; - var gameHeight = scaleManager.height; - scaleManager.lockOrientation('landscape'); - // --------------------------------------------------------------- - // Game Config - // --------------------------------------------------------------- - var config2 = { - type: Phaser.WEBGL, - width: 1024, - height: 768, - parent: 'game', - backgroundColor: '#000000', - scene: BootScene, - physics: { - default: 'arcade', - arcade: { - gravity: { x: 0, y: 300 }, - debug: true - } - }, - scale: { - mode: Phaser.Scale.FIT, - autoCenter: Phaser.Scale.CENTER_BOTH, - width: 1024, - height: 768 - }, - input: { - keyboard: true, - mouse: true, - touch: true, - gamepad: true - }, - render: { - pixelArt: false, - antialias: true, - roundPixels: false - }, - audio: { - disableWebAudio: false - } - }; - // --------------------------------------------------------------- - // Actions - // --------------------------------------------------------------- - var sprites = [sprite, physSprite]; - Phaser.Actions.SetXY(sprites, 100, 200); - Phaser.Actions.SetAlpha(sprites, 0.5); - Phaser.Actions.SetRotation(sprites, 1.5); - Phaser.Actions.SetScale(sprites, 2, 2); - Phaser.Actions.SetVisible(sprites, true); - Phaser.Actions.SetDepth(sprites, 10); - Phaser.Actions.SetBlendMode(sprites, Phaser.BlendModes.ADD); - Phaser.Actions.SetScrollFactor(sprites, 0.5, 0.5); - Phaser.Actions.IncXY(sprites, 10, 20); - Phaser.Actions.Rotate(sprites, 0.1); - Phaser.Actions.PlaceOnCircle(sprites, geomCircle); - Phaser.Actions.PlaceOnLine(sprites, geomLine); - Phaser.Actions.PlaceOnRectangle(sprites, geomRect); - Phaser.Actions.PlaceOnTriangle(sprites, geomTriangle); - Phaser.Actions.PlaceOnEllipse(sprites, geomEllipse); - Phaser.Actions.RandomCircle(sprites, geomCircle); - Phaser.Actions.RandomRectangle(sprites, geomRect); - Phaser.Actions.RandomLine(sprites, geomLine); - Phaser.Actions.RandomTriangle(sprites, geomTriangle); - Phaser.Actions.RandomEllipse(sprites, geomEllipse); - Phaser.Actions.Spread(sprites, 'x', 0, 800); - Phaser.Actions.Shuffle(sprites); - Phaser.Actions.GetFirst(sprites, { active: true }); - Phaser.Actions.GetLast(sprites, { active: true }); - // --------------------------------------------------------------- - // Structs - // --------------------------------------------------------------- - var list = new Phaser.Structs.List(null); - list.add(sprite); - list.remove(sprite); - var pq = new Phaser.Structs.ProcessQueue(); - pq.add(sprite); - pq.remove(sprite); - pq.update(); - // --------------------------------------------------------------- - // Utils - // --------------------------------------------------------------- - var arr = Phaser.Utils.Array.Shuffle([1, 2, 3, 4, 5]); - var removed = Phaser.Utils.Array.Remove(arr, 3); - var item = Phaser.Utils.Array.GetRandom(arr); - var merged = Phaser.Utils.Objects.Merge({ a: 1 }, { b: 2 }); - var value = Phaser.Utils.Objects.GetValue({ nested: { key: 42 } }, 'nested.key', 0); - var objClone = Phaser.Utils.Objects.Clone({ x: 1, y: 2 }); - var padded = Phaser.Utils.String.Pad('42', 5, '0', 1); - }; - BootScene.prototype.update = function (time, delta) { - // Standard update parameters - var fps = this.game.loop.actualFps; - }; - return BootScene; -}(Phaser.Scene)); -// --------------------------------------------------------------------------- -// Game instantiation -// --------------------------------------------------------------------------- -var config = { - type: Phaser.AUTO, - parent: 'phaser-example', - width: 800, - height: 600, - scene: BootScene -}; -var game = new Phaser.Game(config); -//# sourceMappingURL=game.js.map \ No newline at end of file diff --git a/scripts/tsgen/test/bin/game.js.map b/scripts/tsgen/test/bin/game.js.map deleted file mode 100644 index 462e752688..0000000000 --- a/scripts/tsgen/test/bin/game.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"game.js","sourceRoot":"","sources":["../src/game.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,8EAA8E;AAC9E,qCAAqC;AACrC,8EAA8E;AAC9E,4EAA4E;AAC5E,6EAA6E;AAC7E,gEAAgE;AAChE,8EAA8E;AAE9E,8EAA8E;AAC9E,QAAQ;AACR,8EAA8E;AAE9E;IAAwB,6BAAY;IAEhC;QAEI,OAAA,MAAK,YAAC,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,SAAC;IAC9C,CAAC;IAEM,wBAAI,GAAX,UAAa,IAAY;IAEzB,CAAC;IAEM,2BAAO,GAAd;QAEI,yHAAyH;QACzH,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;QAC3C,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,wBAAwB,EAAE,yBAAyB,CAAC,CAAC;QAC9E,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,iBAAiB,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC;QACtF,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,CAAC,CAAC;QAC7D,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,iBAAiB,EAAE,iBAAiB,CAAC,CAAC;QACnE,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,iBAAiB,CAAC,CAAC;QACrD,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;QAC3C,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC;QAC5C,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,oBAAoB,CAAC,CAAC;QAC/C,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;QAC3C,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC;QAE7C,gBAAgB;QAChB,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,cAAO,CAAC,CAAC,CAAC;QACtD,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,UAAC,KAAa,IAAM,CAAC,CAAC,CAAC;IACvE,CAAC;IAEM,0BAAM,GAAb;QAEI,kEAAkE;QAClE,4BAA4B;QAC5B,kEAAkE;QAElE,QAAQ;QACR,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;QAC7C,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QAC1B,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAClB,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QACnB,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QACpB,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QACnB,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QAC5B,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;QAC/B,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACvB,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QAC1C,KAAK,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAC5B,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAC3B,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QACxB,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACzB,KAAK,CAAC,cAAc,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QAC7B,KAAK,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QACtB,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QACzB,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAC5B,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACvB,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,KAAK,CAAC,OAAO,EAAE,CAAC;QAEhB,SAAS;QACT,IAAI,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;QAC1D,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACpB,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QACrB,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;QACtB,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;QAEpB,OAAO;QACP,IAAI,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,gBAAgB,EAAE;YACjD,UAAU,EAAE,OAAO;YACnB,QAAQ,EAAE,MAAM;YAChB,KAAK,EAAE,SAAS;YAChB,KAAK,EAAE,QAAQ;YACf,QAAQ,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE;YACxB,OAAO,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE;YACzB,eAAe,EAAE,SAAS;YAC1B,MAAM,EAAE,SAAS;YACjB,eAAe,EAAE,CAAC;YAClB,MAAM,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE;SACzE,CAAC,CAAC;QACH,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;QAC7B,IAAI,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;QACpC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;QACzB,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;QACrB,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;QAC9B,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;QAC3B,IAAI,CAAC,UAAU,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;QAEhC,aAAa;QACb,IAAI,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;QACpE,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC9B,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;QAC3B,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC;QAC/B,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAE7B,YAAY;QACZ,IAAI,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACzC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACtB,SAAS,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QAC1B,SAAS,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QAC5B,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QACtB,SAAS,CAAC,SAAS,EAAE,CAAC;QAEtB,QAAQ;QACR,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC;QAC7B,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAClB,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAClB,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAEvB,WAAW;QACX,IAAI,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;QACnC,QAAQ,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;QAChC,QAAQ,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QAClC,QAAQ,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;QAClC,QAAQ,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;QAC7C,QAAQ,CAAC,SAAS,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;QACnC,QAAQ,CAAC,UAAU,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QACtC,QAAQ,CAAC,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;QACpC,QAAQ,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QACrC,QAAQ,CAAC,SAAS,EAAE,CAAC;QACrB,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACtB,QAAQ,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QAC1B,QAAQ,CAAC,SAAS,EAAE,CAAC;QACrB,QAAQ,CAAC,UAAU,EAAE,CAAC;QACtB,QAAQ,CAAC,QAAQ,EAAE,CAAC;QACpB,QAAQ,CAAC,KAAK,EAAE,CAAC;QAEjB,SAAS;QACT,IAAI,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC;QAC5D,IAAI,CAAC,cAAc,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;QAEjC,IAAI,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,QAAQ,CAAC,CAAC;QACrD,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;QAEnC,IAAI,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC;QAE9E,IAAI,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,QAAQ,CAAC,CAAC;QAE5D,IAAI,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC;QAC7D,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QAErB,IAAI,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,QAAQ,CAAC,CAAC;QAExD,IAAI,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,QAAQ,CAAC,CAAC;QAErF,IAAI,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;QAE9D,IAAI,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;QAE/E,YAAY;QACZ,IAAI,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;QAC1F,SAAS,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QAE5B,aAAa;QACb,IAAI,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;QACjE,UAAU,CAAC,eAAe,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QACnC,UAAU,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAE9B,QAAQ;QACR,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;QAC9C,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEjB,OAAO;QACP,IAAI,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QAC7C,IAAI,CAAC,cAAc,EAAE,CAAC;QAEtB,YAAY;QACZ,IAAI,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE;YACjD,KAAK,EAAE,GAAG;YACV,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE;YAC3B,QAAQ,EAAE,IAAI;YACd,SAAS,EAAE,MAAM,CAAC,UAAU,CAAC,GAAG;YAChC,SAAS,EAAE,EAAE;YACb,QAAQ,EAAE,CAAC;YACX,QAAQ,EAAE,GAAG;YACb,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE;YAC3B,KAAK,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE;YAC3B,MAAM,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE;YAC5B,QAAQ,EAAE,IAAI;SACjB,CAAC,CAAC;QACH,SAAS,CAAC,IAAI,EAAE,CAAC;QACjB,SAAS,CAAC,KAAK,EAAE,CAAC;QAElB,UAAU;QACV,IAAI,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC;QAC9C,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC;QAEnC,kEAAkE;QAClE,iCAAiC;QACjC,kEAAkE;QAElE,IAAI,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QACpD,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAChB,EAAE,CAAC,KAAK,EAAE,CAAC;QAEX,IAAI,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC,SAAS,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QAC9D,IAAI,EAAE,EACN,CAAC;YACG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAClB,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QAC1C,CAAC;QAED,kEAAkE;QAClE,aAAa;QACb,kEAAkE;QAElE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;YACd,GAAG,EAAE,MAAM;YACX,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;YACrE,SAAS,EAAE,EAAE;YACb,MAAM,EAAE,CAAC,CAAC;YACV,IAAI,EAAE,IAAI;SACb,CAAC,CAAC;QAEH,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;YACd,GAAG,EAAE,SAAS;YACd,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,OAAO,EAAE;gBAC3C,MAAM,EAAE,OAAO;gBACf,KAAK,EAAE,CAAC;gBACR,GAAG,EAAE,EAAE;aACV,CAAC;YACF,SAAS,EAAE,EAAE;YACb,MAAM,EAAE,CAAC;YACT,cAAc,EAAE,IAAI;SACvB,CAAC,CAAC;QAEH,IAAI,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAClC,IAAI,IAAI,EACR,CAAC;YACG,IAAI,WAAW,GAAW,IAAI,CAAC,cAAc,EAAE,CAAC;QACpD,CAAC;QAED,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAE1B,kEAAkE;QAClE,QAAQ;QACR,kEAAkE;QAElE,gBAAgB;QAChB,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,YAAY,EAAE,UAAC,OAA6B;YAC1E,IAAI,CAAC,GAAW,OAAO,CAAC,CAAC,CAAC;YAC1B,IAAI,CAAC,GAAW,OAAO,CAAC,CAAC,CAAC;YAC1B,IAAI,MAAM,GAAY,OAAO,CAAC,MAAM,CAAC;YACrC,IAAI,MAAM,GAAW,OAAO,CAAC,MAAM,CAAC;YACpC,IAAI,MAAM,GAAW,OAAO,CAAC,MAAM,CAAC;QACxC,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,EAAE,cAAO,CAAC,CAAC,CAAC;QACxD,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,YAAY,EAAE,cAAO,CAAC,CAAC,CAAC;QAE1D,2BAA2B;QAC3B,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,YAAY,EAAE,cAAO,CAAC,CAAC,CAAC;QACtD,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE,cAAO,CAAC,CAAC,CAAC;QACrD,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,EAAE,cAAO,CAAC,CAAC,CAAC;QACpD,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,cAAO,CAAC,CAAC,CAAC;QAC9C,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,cAAO,CAAC,CAAC,CAAC;QAElD,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QAEhC,WAAW;QACX,IAAI,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,QAAS,CAAC,gBAAgB,EAAE,CAAC;QACtD,IAAI,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,QAAS,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QACjF,IAAI,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,QAAS,CAAC,WAAW,CAAC,QAAQ,EAAE;YACnD,eAAe,EAAE,IAAI;YACrB,YAAY,EAAE,IAAI;SACrB,CAAC,CAAC;QAEH,kEAAkE;QAClE,SAAS;QACT,kEAAkE;QAElE,IAAI,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;QAC5B,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACjB,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QACxB,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QAChC,GAAG,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC;QACjC,GAAG,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QACtB,GAAG,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACtB,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QACrB,GAAG,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QACzB,GAAG,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QACxC,GAAG,CAAC,UAAU,EAAE,CAAC;QACjB,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACjB,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAClB,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACf,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACrB,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;QACxB,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;QACpB,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACrB,GAAG,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QACvB,GAAG,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QAEhC,IAAI,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QAC5C,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAE1B,kEAAkE;QAClE,SAAS;QACT,kEAAkE;QAElE,IAAI,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC;YACxB,OAAO,EAAE,MAAM;YACf,CAAC,EAAE,GAAG;YACN,CAAC,EAAE,GAAG;YACN,KAAK,EAAE,GAAG;YACV,MAAM,EAAE,CAAC;YACT,MAAM,EAAE,CAAC;YACT,QAAQ,EAAE,IAAI,CAAC,EAAE;YACjB,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,GAAG;YACV,MAAM,EAAE,CAAC;YACT,WAAW,EAAE,GAAG;YAChB,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,GAAG;YACT,OAAO,EAAE,cAAO,CAAC;YACjB,UAAU,EAAE,cAAO,CAAC;YACpB,QAAQ,EAAE,cAAO,CAAC;YAClB,QAAQ,EAAE,cAAO,CAAC;YAClB,MAAM,EAAE,cAAO,CAAC;SACnB,CAAC,CAAC;QACH,KAAK,CAAC,KAAK,EAAE,CAAC;QACd,KAAK,CAAC,MAAM,EAAE,CAAC;QACf,KAAK,CAAC,IAAI,EAAE,CAAC;QACb,KAAK,CAAC,MAAM,EAAE,CAAC;QAEf,cAAc;QACd,IAAI,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;YAC1B,OAAO,EAAE,MAAM;YACf,MAAM,EAAE;gBACJ,EAAE,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE;gBACzB,EAAE,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE;gBACzB,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE;aACrC;YACD,IAAI,EAAE,CAAC;SACV,CAAC,CAAC;QAEH,eAAe;QACf,IAAI,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC;YACjC,IAAI,EAAE,CAAC;YACP,EAAE,EAAE,GAAG;YACP,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,UAAC,KAA0B;gBACjC,IAAI,KAAK,GAAW,KAAK,CAAC,QAAQ,EAAY,CAAC;YACnD,CAAC;SACJ,CAAC,CAAC;QAEH,UAAU;QACV,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC;YACZ,OAAO,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC;YACxB,CAAC,EAAE,GAAG;YACN,QAAQ,EAAE,IAAI;YACd,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC;SAClC,CAAC,CAAC;QAEH,kEAAkE;QAClE,eAAe;QACf,kEAAkE;QAElE,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;YACf,KAAK,EAAE,IAAI;YACX,QAAQ,EAAE,cAAO,CAAC;YAClB,aAAa,EAAE,IAAI;YACnB,IAAI,EAAE,IAAI;SACb,CAAC,CAAC;QAEH,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,cAAO,CAAC,CAAC,CAAC;QAEtC,kEAAkE;QAClE,mBAAmB;QACnB,kEAAkE;QAElE,IAAI,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;QAC3D,UAAU,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QACjC,UAAU,CAAC,eAAe,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QACnC,UAAU,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QAC/B,UAAU,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC;QACvC,UAAU,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QAC3B,UAAU,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QACjC,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QAC5B,UAAU,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;QAC/B,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACtB,UAAU,CAAC,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QACpC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;QACzB,UAAU,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QAC3B,UAAU,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAE3B,IAAI,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;QACzD,SAAS,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;QAE3B,IAAI,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;QACjD,IAAI,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC;QAE5C,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;QACnD,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,YAAY,EAAE,UAAC,IAAI,EAAE,IAAI,IAAM,CAAC,CAAC,CAAC;QAEvE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QAC/C,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,GAAG,GAAG,CAAC;QAEnC,IAAI,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAE/C,kEAAkE;QAClE,UAAU;QACV,kEAAkE;QAElE,IAAI,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC;QAChD,IAAI,OAAO,GAAG,OAAO,CAAC,eAAe,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAEvD,IAAI,OAAO,EACX,CAAC;YACG,IAAI,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,QAAQ,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;YAEhE,IAAI,YAAY,EAChB,CAAC;gBACG,YAAY,CAAC,sBAAsB,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;gBACxD,YAAY,CAAC,mBAAmB,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;gBACzC,YAAY,CAAC,oBAAoB,CAAC,CAAC,EAAE,cAAO,CAAC,EAAE,IAAI,CAAC,CAAC;gBACrD,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;YACpC,CAAC;YAED,OAAO,CAAC,iBAAiB,CAAC,SAAS,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;QACrD,CAAC;QAED,kEAAkE;QAClE,mBAAmB;QACnB,kEAAkE;QAElE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;QAC5C,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QAC/B,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QAC9B,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QAC/B,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC7B,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;QACrB,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAC5B,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QACnC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QACnC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QAC/B,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;QAEjC,kEAAkE;QAClE,QAAQ;QACR,kEAAkE;QAElE,IAAI,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE;YAC9B,MAAM,EAAE,GAAG;YACX,IAAI,EAAE,IAAI;YACV,KAAK,EAAE,CAAC;SACX,CAAC,CAAC;QACH,KAAK,CAAC,IAAI,EAAE,CAAC;QACb,KAAK,CAAC,KAAK,EAAE,CAAC;QACd,KAAK,CAAC,MAAM,EAAE,CAAC;QACf,KAAK,CAAC,IAAI,EAAE,CAAC;QAEb,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;QACtB,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC;QACvB,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;QAErB,kEAAkE;QAClE,eAAe;QACf,kEAAkE;QAElE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;QACrC,IAAI,EAAE,GAAW,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QAChD,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QAElC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;QAC1B,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACvB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAE1B,kEAAkE;QAClE,SAAS;QACT,kEAAkE;QAElE,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,cAAc,EAAE,UAAC,IAAS,IAAM,CAAC,CAAC,CAAC;QAClD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;QACjD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,cAAO,CAAC,CAAC,CAAC;QACvC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QAEhC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,cAAO,CAAC,CAAC,CAAC;QACvD,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,cAAO,CAAC,CAAC,CAAC;QACxD,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,cAAO,CAAC,CAAC,CAAC;QACzD,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,cAAO,CAAC,CAAC,CAAC;QAE1D,kEAAkE;QAClE,OAAO;QACP,kEAAkE;QAElE,IAAI,OAAO,GAAW,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QAClD,IAAI,KAAK,GAAW,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;QACnD,IAAI,QAAQ,GAAW,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QACpE,IAAI,SAAS,GAAW,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QACvE,IAAI,KAAK,GAAW,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QAC/D,IAAI,SAAS,GAAW,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QAClE,IAAI,kBAAkB,GAAW,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;QACrG,IAAI,SAAS,GAAW,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClD,IAAI,QAAQ,GAAW,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QAChD,IAAI,QAAQ,GAAW,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACrD,IAAI,IAAI,GAAW,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QACnD,IAAI,OAAO,GAAW,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;QACtD,IAAI,IAAI,GAAW,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QAC/C,IAAI,SAAS,GAAW,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QACvD,IAAI,QAAQ,GAAW,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QACrD,IAAI,UAAU,GAAY,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC;QAClE,IAAI,YAAY,GAAY,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC;QAC1E,IAAI,SAAS,GAAY,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC;QAEpE,IAAI,GAAG,GAAW,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;QAClC,IAAI,OAAO,GAAW,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC;QAE5C,UAAU;QACV,IAAI,EAAE,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QACzC,IAAI,EAAE,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QACzC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACX,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QAChB,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACZ,EAAE,CAAC,SAAS,EAAE,CAAC;QACf,IAAI,GAAG,GAAW,EAAE,CAAC,MAAM,EAAE,CAAC;QAC9B,IAAI,KAAK,GAAW,EAAE,CAAC,QAAQ,EAAE,CAAC;QAClC,IAAI,GAAG,GAAW,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC7B,IAAI,KAAK,GAAW,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACjC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;QACjB,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACd,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACrB,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QAClB,EAAE,CAAC,MAAM,EAAE,CAAC;QACZ,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;QACvB,IAAI,OAAO,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC;QACzB,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACZ,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACd,EAAE,CAAC,IAAI,EAAE,CAAC;QACV,EAAE,CAAC,KAAK,EAAE,CAAC;QACX,EAAE,CAAC,MAAM,EAAE,CAAC;QACZ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAEf,UAAU;QACV,IAAI,EAAE,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAC1C,IAAI,EAAE,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAC1C,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACX,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QAChB,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACZ,EAAE,CAAC,SAAS,EAAE,CAAC;QACf,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAEb,SAAS;QACT,IAAI,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;QACvC,MAAM,CAAC,QAAQ,EAAE,CAAC;QAClB,MAAM,CAAC,SAAS,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACnD,MAAM,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC/C,MAAM,CAAC,MAAM,EAAE,CAAC;QAChB,MAAM,CAAC,SAAS,EAAE,CAAC;QACnB,MAAM,CAAC,WAAW,EAAE,CAAC;QAErB,wBAAwB;QACxB,IAAI,GAAG,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;QACzD,IAAI,MAAM,GAAW,GAAG,CAAC,OAAO,EAAE,CAAC;QACnC,IAAI,OAAO,GAAW,GAAG,CAAC,IAAI,EAAE,CAAC;QACjC,IAAI,OAAO,GAAW,GAAG,CAAC,IAAI,EAAE,CAAC;QACjC,IAAI,UAAU,GAAW,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QAC7C,IAAI,OAAO,GAAW,GAAG,CAAC,IAAI,EAAE,CAAC;QACjC,IAAI,QAAQ,GAAW,GAAG,CAAC,KAAK,EAAE,CAAC;QACnC,IAAI,OAAO,GAAW,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;QAChD,IAAI,eAAe,GAAW,GAAG,CAAC,YAAY,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;QAEhE,kEAAkE;QAClE,WAAW;QACX,kEAAkE;QAElE,SAAS;QACT,IAAI,UAAU,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;QACtD,IAAI,UAAU,GAAW,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC7D,IAAI,aAAa,GAAW,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;QACzE,IAAI,cAAc,GAAY,UAAU,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QAC5D,IAAI,WAAW,GAAG,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QAC3C,IAAI,YAAY,GAAG,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;QAC5C,IAAI,YAAY,GAAG,UAAU,CAAC,cAAc,EAAE,CAAC;QAE/C,YAAY;QACZ,IAAI,QAAQ,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QACzD,IAAI,QAAQ,GAAW,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC5D,IAAI,aAAa,GAAW,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;QACtE,IAAI,YAAY,GAAY,QAAQ,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QACtD,IAAI,SAAS,GAAG,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QACvC,IAAI,UAAU,GAAG,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;QACxC,IAAI,UAAU,GAAG,QAAQ,CAAC,cAAc,EAAE,CAAC;QAC3C,IAAI,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;QAC3D,IAAI,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QACvD,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;QAChD,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QACxC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAEzC,OAAO;QACP,IAAI,QAAQ,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QACpD,IAAI,UAAU,GAAW,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC3D,IAAI,SAAS,GAAW,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QACzD,IAAI,SAAS,GAAG,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QACvC,IAAI,UAAU,GAAG,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;QACxC,IAAI,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QAErD,WAAW;QACX,IAAI,YAAY,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QACrE,IAAI,OAAO,GAAW,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC9D,IAAI,WAAW,GAAY,YAAY,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QACzD,IAAI,QAAQ,GAAG,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QAC1C,IAAI,SAAS,GAAG,YAAY,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;QAC3C,IAAI,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;QAC9D,IAAI,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;QAE9D,UAAU;QACV,IAAI,WAAW,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;QAC7D,IAAI,WAAW,GAAW,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAChE,IAAI,eAAe,GAAY,WAAW,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QAC9D,IAAI,YAAY,GAAG,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QAC7C,IAAI,aAAa,GAAG,WAAW,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;QAE9C,UAAU;QACV,IAAI,WAAW,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;QAC5E,IAAI,QAAQ,GAAW,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC;QACtE,IAAI,YAAY,GAAY,WAAW,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QACzD,IAAI,UAAU,GAAG,WAAW,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;QAE3C,aAAa;QACb,IAAI,WAAW,GAAY,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,oBAAoB,CAAC,QAAQ,EAAE,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;QAC9H,IAAI,UAAU,GAAY,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QACzF,IAAI,QAAQ,GAAY,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACnF,IAAI,UAAU,GAAY,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;QAEpF,kEAAkE;QAClE,kBAAkB;QAClB,kEAAkE;QAElE,IAAI,KAAK,GAAG,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;QACvD,IAAI,CAAC,GAAW,KAAK,CAAC,GAAG,CAAC;QAC1B,IAAI,CAAC,GAAW,KAAK,CAAC,KAAK,CAAC;QAC5B,IAAI,CAAC,GAAW,KAAK,CAAC,IAAI,CAAC;QAC3B,IAAI,CAAC,GAAW,KAAK,CAAC,KAAK,CAAC;QAC5B,IAAI,QAAQ,GAAW,KAAK,CAAC,KAAK,CAAC;QACnC,IAAI,QAAQ,GAAW,KAAK,CAAC,IAAI,CAAC;QAClC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;QAE5B,IAAI,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;QAC/D,IAAI,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;QAC5D,IAAI,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;QACpE,IAAI,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;QAC7D,IAAI,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC;QAC9C,IAAI,YAAY,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,cAAc,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;QAE5F,kEAAkE;QAClE,kBAAkB;QAClB,kEAAkE;QAElE,IAAI,UAAU,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC/B,IAAI,MAAM,GAAY,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAChD,IAAI,OAAO,GAAG,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACrC,IAAI,KAAK,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;QAC1B,IAAI,UAAU,GAAW,KAAK,CAAC,KAAK,CAAC;QACrC,IAAI,WAAW,GAAW,KAAK,CAAC,MAAM,CAAC;QAEvC,kEAAkE;QAClE,gBAAgB;QAChB,kEAAkE;QAElE,IAAI,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC;QAC9B,YAAY,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QAC/B,YAAY,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QACpC,IAAI,SAAS,GAAW,YAAY,CAAC,KAAK,CAAC;QAC3C,IAAI,UAAU,GAAW,YAAY,CAAC,MAAM,CAAC;QAC7C,YAAY,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC;QAE1C,kEAAkE;QAClE,cAAc;QACd,kEAAkE;QAElE,IAAI,OAAO,GAAiC;YACxC,IAAI,EAAE,MAAM,CAAC,KAAK;YAClB,KAAK,EAAE,IAAI;YACX,MAAM,EAAE,GAAG;YACX,MAAM,EAAE,MAAM;YACd,eAAe,EAAE,SAAS;YAC1B,KAAK,EAAE,SAAS;YAChB,OAAO,EAAE;gBACL,OAAO,EAAE,QAAQ;gBACjB,MAAM,EAAE;oBACJ,OAAO,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE;oBACzB,KAAK,EAAE,IAAI;iBACd;aACJ;YACD,KAAK,EAAE;gBACH,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG;gBACtB,UAAU,EAAE,MAAM,CAAC,KAAK,CAAC,WAAW;gBACpC,KAAK,EAAE,IAAI;gBACX,MAAM,EAAE,GAAG;aACd;YACD,KAAK,EAAE;gBACH,QAAQ,EAAE,IAAI;gBACd,KAAK,EAAE,IAAI;gBACX,KAAK,EAAE,IAAI;gBACX,OAAO,EAAE,IAAI;aAChB;YACD,MAAM,EAAE;gBACJ,QAAQ,EAAE,KAAK;gBACf,SAAS,EAAE,IAAI;gBACf,WAAW,EAAE,KAAK;aACrB;YACD,KAAK,EAAE;gBACH,eAAe,EAAE,KAAK;aACzB;SACJ,CAAC;QAEF,kEAAkE;QAClE,UAAU;QACV,kEAAkE;QAElE,IAAI,OAAO,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;QACnC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QACxC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QACtC,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QACzC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QACvC,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QACzC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QACrC,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QAC5D,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QAClD,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;QACtC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QACpC,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;QAClD,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QAC9C,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QACnD,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;QACtD,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;QACpD,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;QACjD,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QAClD,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QAC7C,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;QACrD,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;QACnD,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;QAC5C,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAChC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;QACnD,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;QAElD,kEAAkE;QAClE,UAAU;QACV,kEAAkE;QAElE,IAAI,IAAI,GAAG,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAA4B,IAAI,CAAC,CAAC;QACpE,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACjB,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAEpB,IAAI,EAAE,GAAG,IAAI,MAAM,CAAC,OAAO,CAAC,YAAY,EAA6B,CAAC;QACtE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACf,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAClB,EAAE,CAAC,MAAM,EAAE,CAAC;QAEZ,kEAAkE;QAClE,QAAQ;QACR,kEAAkE;QAElE,IAAI,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACtD,IAAI,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;QAChD,IAAI,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QAE7C,IAAI,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QAC5D,IAAI,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC;QACpF,IAAI,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QAE1D,IAAI,MAAM,GAAW,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;IAClE,CAAC;IAEM,0BAAM,GAAb,UAAe,IAAY,EAAE,KAAa;QAEtC,6BAA6B;QAC7B,IAAI,GAAG,GAAW,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC;IAC/C,CAAC;IACL,gBAAC;AAAD,CAAC,AApwBD,CAAwB,MAAM,CAAC,KAAK,GAowBnC;AAED,8EAA8E;AAC9E,qBAAqB;AACrB,8EAA8E;AAE9E,IAAI,MAAM,GAAiC;IACvC,IAAI,EAAE,MAAM,CAAC,IAAI;IACjB,MAAM,EAAE,gBAAgB;IACxB,KAAK,EAAE,GAAG;IACV,MAAM,EAAE,GAAG;IACX,KAAK,EAAE,SAAS;CACnB,CAAC;AAEF,IAAI,IAAI,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC"} \ No newline at end of file diff --git a/scripts/tsgen/test/src/game.ts b/scripts/tsgen/test/src/game.ts index d8b108110c..8c46209283 100644 --- a/scripts/tsgen/test/src/game.ts +++ b/scripts/tsgen/test/src/game.ts @@ -499,7 +499,10 @@ class BootScene extends Phaser.Scene { // --------------------------------------------------------------- let between: number = Phaser.Math.Between(1, 100); - let clamp: number = Phaser.Math.Clamp(150, 0, 100); + let clampRef: typeof Phaser.Math.Clamp = Phaser.Math.Clamp; + let clampedValue: number = Phaser.Math.Clamp(120, 0, 100); + let wrapRef: typeof Phaser.Math.Wrap = Phaser.Math.Wrap; + let wrappedValue: number = Phaser.Math.Wrap(-2, 0, 10); let distance: number = Phaser.Math.Distance.Between(0, 0, 100, 100); let chebyshev: number = Phaser.Math.Distance.Chebyshev(0, 0, 100, 100); let snake: number = Phaser.Math.Distance.Snake(0, 0, 100, 100); @@ -513,6 +516,7 @@ class BootScene extends Phaser.Scene { let snap: number = Phaser.Math.Snap.To(55, 10); let snapFloor: number = Phaser.Math.Snap.Floor(55, 10); let snapCeil: number = Phaser.Math.Snap.Ceil(55, 10); + let fuzzyEqualRef: typeof Phaser.Math.Fuzzy.Equal = Phaser.Math.Fuzzy.Equal; let fuzzyEqual: boolean = Phaser.Math.Fuzzy.Equal(1.001, 1, 0.01); let fuzzyGreater: boolean = Phaser.Math.Fuzzy.GreaterThan(1.001, 1, 0.01); let fuzzyLess: boolean = Phaser.Math.Fuzzy.LessThan(0.999, 1, 0.01); @@ -521,6 +525,7 @@ class BootScene extends Phaser.Scene { let piOver2: number = Phaser.Math.PI_OVER_2; // Vector2 + let vector2Ref: typeof Phaser.Math.Vector2 = Phaser.Math.Vector2; let v1 = new Phaser.Math.Vector2(10, 20); let v2 = new Phaser.Math.Vector2(30, 40); v1.add(v2); @@ -588,7 +593,11 @@ class BootScene extends Phaser.Scene { let circleRandom = geomCircle.getRandomPoint(); // Rectangle + let rectangleRef: typeof Phaser.Geom.Rectangle = Phaser.Geom.Rectangle; let geomRect = new Phaser.Geom.Rectangle(0, 0, 200, 100); + let geomRectFromXY = Phaser.Geom.Rectangle.FromXY(0, 0, 200, 100); + let rectangleContainsRef: typeof Phaser.Geom.Rectangle.Contains = Phaser.Geom.Rectangle.Contains; + let rectContainsStatic: boolean = Phaser.Geom.Rectangle.Contains(geomRect, 10, 10); let rectArea: number = Phaser.Geom.Rectangle.Area(geomRect); let rectPerimeter: number = Phaser.Geom.Rectangle.Perimeter(geomRect); let rectContains: boolean = geomRect.contains(50, 50); @@ -762,6 +771,9 @@ class BootScene extends Phaser.Scene { pq.remove(sprite); pq.update(); + let mapRef: typeof Phaser.Structs.Map = Phaser.Structs.Map; + let structMap = new Phaser.Structs.Map(); + // --------------------------------------------------------------- // Utils // --------------------------------------------------------------- diff --git a/types/phaser.d.ts b/types/phaser.d.ts index 62345ca813..e0a784eadf 100644 --- a/types/phaser.d.ts +++ b/types/phaser.d.ts @@ -2846,7 +2846,7 @@ declare namespace Phaser { * * You can query the Map directly or use the BaseCache methods. */ - entries: Phaser.Structs.Map; + entries: Phaser.Structs.Map; /** * An instance of EventEmitter used by the cache to emit related events. @@ -5292,6 +5292,9 @@ declare namespace Phaser { } + interface BaseCamera extends Phaser.GameObjects.Components.AlphaSingle, Phaser.GameObjects.Components.Visible { + } + } namespace Controls { @@ -16237,79 +16240,6 @@ declare namespace Phaser { */ setBlendMode(value: string | Phaser.BlendModes | number): this; - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - * @returns This Game Object instance. - */ - setDepth(value: number): this; - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToTop(): this; - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToBack(): this; - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be above. - * @returns This Game Object instance. - */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be below. - * @returns This Game Object instance. - */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; - /** * Gets the center coordinate of this Game Object, regardless of origin. * @@ -17073,22 +17003,6 @@ declare namespace Phaser { */ getParentRotation(): number; - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. - */ - setVisible(value: boolean): this; - } /** @@ -17892,79 +17806,6 @@ declare namespace Phaser { */ setBlendMode(value: string | Phaser.BlendModes | number): this; - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - * @returns This Game Object instance. - */ - setDepth(value: number): this; - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToTop(): this; - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToBack(): this; - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be above. - * @returns This Game Object instance. - */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be below. - * @returns This Game Object instance. - */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; - /** * Gets the center coordinate of this Game Object, regardless of origin. * @@ -18728,22 +18569,6 @@ declare namespace Phaser { */ getParentRotation(): number; - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. - */ - setVisible(value: boolean): this; - } /** @@ -19172,79 +18997,6 @@ declare namespace Phaser { */ setBlendMode(value: string | Phaser.BlendModes | number): this; - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - * @returns This Game Object instance. - */ - setDepth(value: number): this; - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToTop(): this; - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToBack(): this; - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be above. - * @returns This Game Object instance. - */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be below. - * @returns This Game Object instance. - */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; - /** * Controls whether this Game Object participates in the WebGL lighting system. * When `true`, the object will respond to dynamic lights added via the Lights plugin, @@ -19798,22 +19550,6 @@ declare namespace Phaser { */ getParentRotation(): number; - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. - */ - setVisible(value: boolean): this; - } /** @@ -20327,79 +20063,6 @@ declare namespace Phaser { */ setBlendMode(value: string | Phaser.BlendModes | number): this; - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - * @returns This Game Object instance. - */ - setDepth(value: number): this; - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToTop(): this; - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToBack(): this; - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be above. - * @returns This Game Object instance. - */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be below. - * @returns This Game Object instance. - */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; - /** * Customized WebGL render nodes of this Game Object. * RenderNodes are responsible for managing the rendering process of this Game Object. @@ -20467,22 +20130,6 @@ declare namespace Phaser { */ setRenderNodeData(renderNode: string | Phaser.Renderer.WebGL.RenderNodes.RenderNode, key: string, value: any): this; - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. - */ - setVisible(value: boolean): this; - } namespace Components { @@ -20768,80 +20415,6 @@ declare namespace Phaser { setCrop(x?: number | Phaser.Geom.Rectangle, y?: number, width?: number, height?: number): this; } - /** - * Provides methods used for setting the depth of a Game Object. - * Should be applied as a mixin and not used directly. - */ - interface Depth { - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - * @returns This Game Object instance. - */ - setDepth(value: number): this; - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToTop(): this; - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToBack(): this; - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be above. - * @returns This Game Object instance. - */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be below. - * @returns This Game Object instance. - */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; - } - /** * Provides methods for managing an elapse timer on a Game Object. * The timer is used to drive animations and other time-based effects. @@ -23227,28 +22800,163 @@ declare namespace Phaser { destroy(): void; } + /** + * @author Richard Davey + * @copyright 2013-2026 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + /** + * Interface describing the public API contributed by the Depth mixin. + * + * @memberof Phaser.GameObjects.Components + * @since 3.0.0 + */ + interface Depth { + /** + * Private internal value. Holds the depth of the Game Object. + * + * @name Phaser.GameObjects.Components.Depth#_depth + * @private + * @default 0 + * @since 3.0.0 + */ + _depth: number; + /** + * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The default depth is zero. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * + * @name Phaser.GameObjects.Components.Depth#depth + * @since 3.0.0 + */ + depth: number; + /** + * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * A Game Object with a higher depth value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * + * @method Phaser.GameObjects.Components.Depth#setDepth + * @since 3.0.0 + * + * @param value - The depth of this Game Object. Ensure this value is only ever a number data-type. + * + * @return This Game Object instance. + */ + setDepth(value?: number): this; + /** + * Sets this Game Object to be at the top of the display list, or the top of its parent container. + * + * Being at the top means it will render on top of everything else. + * + * This method does not change this Game Objects `depth` value, it simply alters its list position. + * + * @method Phaser.GameObjects.Components.Depth#setToTop + * @since 3.85.0 + * + * @return This Game Object instance. + */ + setToTop(): this; + /** + * Sets this Game Object to the back of the display list, or the back of its parent container. + * + * Being at the back means it will render below everything else. + * + * This method does not change this Game Objects `depth` value, it simply alters its list position. + * + * @method Phaser.GameObjects.Components.Depth#setToBack + * @since 3.85.0 + * + * @return This Game Object instance. + */ + setToBack(): this; + /** + * Move this Game Object so that it appears above the given Game Object. + * + * This means it will render immediately after the other object in the display list. + * + * Both objects must belong to the same display list, or parent container. + * + * This method does not change this Game Objects `depth` value, it simply alters its list position. + * + * @method Phaser.GameObjects.Components.Depth#setAbove + * @since 3.85.0 + * + * @param gameObject - The Game Object that this Game Object will be moved to be above. + * + * @return This Game Object instance. + */ + setAbove(gameObject: object): this; + /** + * Move this Game Object so that it appears below the given Game Object. + * + * This means it will render immediately under the other object in the display list. + * + * Both objects must belong to the same display list, or parent container. + * + * This method does not change this Game Objects `depth` value, it simply alters its list position. + * + * @method Phaser.GameObjects.Components.Depth#setBelow + * @since 3.85.0 + * + * @param gameObject - The Game Object that this Game Object will be moved to be below. + * + * @return This Game Object instance. + */ + setBelow(gameObject: object): this; + } /** - * Provides methods used for setting the visibility of a Game Object. - * The Visible component is mixed into Game Objects to give them a `visible` boolean property - * and a `setVisible` method. Visibility is tracked via a bitmask flag on `renderFlags`, so - * toggling it is a fast bitwise operation. An invisible Game Object is excluded from the - * render pass entirely, but its `update` logic continues to run normally each frame. - * Should be applied as a mixin and not used directly. + * @author Richard Davey + * @copyright 2013-2026 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + /** + * Interface describing the public API contributed by the Visible mixin. + * + * @memberof Phaser.GameObjects.Components + * @since 3.0.0 */ interface Visible { + /** + * Private internal value. Holds the visible value. + * + * @name Phaser.GameObjects.Components.Visible#_visible + * @private + * @default true + * @since 3.0.0 + */ + _visible: boolean; /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. + * + * @name Phaser.GameObjects.Components.Visible#visible + * @since 3.0.0 */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. + * + * @method Phaser.GameObjects.Components.Visible#setVisible + * @since 3.0.0 + * + * @param value - The visible state of the Game Object. + * + * @return This Game Object instance. */ setVisible(value: boolean): this; } @@ -24196,79 +23904,6 @@ declare namespace Phaser { */ setDisplaySize(width: number, height: number): this; - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - * @returns This Game Object instance. - */ - setDepth(value: number): this; - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToTop(): this; - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToBack(): this; - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be above. - * @returns This Game Object instance. - */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be below. - * @returns This Game Object instance. - */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; - /** * The Mask this Game Object is using during render, or `null` if no mask has been set. */ @@ -24523,22 +24158,6 @@ declare namespace Phaser { */ getParentRotation(): number; - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. - */ - setVisible(value: boolean): this; - } /** @@ -25304,79 +24923,6 @@ declare namespace Phaser { */ setBlendMode(value: string | Phaser.BlendModes | number): this; - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - * @returns This Game Object instance. - */ - setDepth(value: number): this; - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToTop(): this; - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToBack(): this; - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be above. - * @returns This Game Object instance. - */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be below. - * @returns This Game Object instance. - */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; - /** * The horizontal origin of this Game Object. * The origin maps the relationship between the size and position of the Game Object. @@ -25710,22 +25256,6 @@ declare namespace Phaser { */ getParentRotation(): number; - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. - */ - setVisible(value: boolean): this; - } namespace Events { @@ -26340,79 +25870,6 @@ declare namespace Phaser { */ setBlendMode(value: string | Phaser.BlendModes | number): this; - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - * @returns This Game Object instance. - */ - setDepth(value: number): this; - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToTop(): this; - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToBack(): this; - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be above. - * @returns This Game Object instance. - */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be below. - * @returns This Game Object instance. - */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; - /** * The horizontally flipped state of the Game Object. * @@ -27063,22 +26520,6 @@ declare namespace Phaser { */ getParentRotation(): number; - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. - */ - setVisible(value: boolean): this; - } /** @@ -27548,79 +26989,6 @@ declare namespace Phaser { */ setDisplaySize(width: number, height: number): this; - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - * @returns This Game Object instance. - */ - setDepth(value: number): this; - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToTop(): this; - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToBack(): this; - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be above. - * @returns This Game Object instance. - */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be below. - * @returns This Game Object instance. - */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; - /** * Gets the center coordinate of this Game Object, regardless of origin. * @@ -28067,22 +27435,6 @@ declare namespace Phaser { */ getParentRotation(): number; - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. - */ - setVisible(value: boolean): this; - } /** @@ -28996,79 +28348,6 @@ declare namespace Phaser { */ setBlendMode(value: string | Phaser.BlendModes | number): this; - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - * @returns This Game Object instance. - */ - setDepth(value: number): this; - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToTop(): this; - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToBack(): this; - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be above. - * @returns This Game Object instance. - */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be below. - * @returns This Game Object instance. - */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; - /** * Controls whether this Game Object participates in the WebGL lighting system. * When `true`, the object will respond to dynamic lights added via the Lights plugin, @@ -29436,22 +28715,6 @@ declare namespace Phaser { */ getParentRotation(): number; - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. - */ - setVisible(value: boolean): this; - /** * The horizontal scroll factor of this Game Object. * @@ -30502,79 +29765,6 @@ declare namespace Phaser { */ setBlendMode(value: string | Phaser.BlendModes | number): this; - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - * @returns This Game Object instance. - */ - setDepth(value: number): this; - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToTop(): this; - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToBack(): this; - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be above. - * @returns This Game Object instance. - */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be below. - * @returns This Game Object instance. - */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; - /** * The horizontally flipped state of the Game Object. * @@ -31536,22 +30726,6 @@ declare namespace Phaser { */ getParentRotation(): number; - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. - */ - setVisible(value: boolean): this; - } /** @@ -32388,79 +31562,6 @@ declare namespace Phaser { */ setBlendMode(value: string | Phaser.BlendModes | number): this; - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - * @returns This Game Object instance. - */ - setDepth(value: number): this; - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToTop(): this; - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToBack(): this; - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be above. - * @returns This Game Object instance. - */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be below. - * @returns This Game Object instance. - */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; - /** * The Mask this Game Object is using during render, or `null` if no mask has been set. */ @@ -32513,22 +31614,6 @@ declare namespace Phaser { */ createGeometryMask(graphics?: Phaser.GameObjects.Graphics | Phaser.GameObjects.Shape): Phaser.Display.Masks.GeometryMask; - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. - */ - setVisible(value: boolean): this; - } /** @@ -32817,22 +31902,6 @@ declare namespace Phaser { */ setScrollFactor(x: number, y?: number): this; - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. - */ - setVisible(value: boolean): this; - } /** @@ -33778,79 +32847,6 @@ declare namespace Phaser { */ setBlendMode(value: string | Phaser.BlendModes | number): this; - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - * @returns This Game Object instance. - */ - setDepth(value: number): this; - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToTop(): this; - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToBack(): this; - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be above. - * @returns This Game Object instance. - */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be below. - * @returns This Game Object instance. - */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; - /** * Gets the center coordinate of this Game Object, regardless of origin. * @@ -34432,90 +33428,6 @@ declare namespace Phaser { */ getParentRotation(): number; - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. - */ - setVisible(value: boolean): this; - - } - - /** - * Represents a single vertex within a NineSlice Game Object. - * - * A NineSlice Game Object is divided into a 3x3 grid of regions, each defined by a mesh - * of vertices. This class stores all the data needed for one vertex: its normalized position - * (x, y inherited from Vector2), its projected screen-space position (vx, vy), and its - * UV texture coordinates (u, v) used during rendering. - * - * You do not typically create NineSliceVertex instances directly. They are created and - * managed internally by the NineSlice Game Object. - */ - class NineSliceVertex extends Phaser.Math.Vector2 { - /** - * - * @param x The x position of the vertex. - * @param y The y position of the vertex. - * @param u The UV u coordinate of the vertex. - * @param v The UV v coordinate of the vertex. - */ - constructor(x: number, y: number, u: number, v: number); - - /** - * The projected x coordinate of this vertex. - */ - vx: number; - - /** - * The projected y coordinate of this vertex. - */ - vy: number; - - /** - * UV u coordinate of this vertex. - */ - u: number; - - /** - * UV v coordinate of this vertex. - */ - v: number; - - /** - * Sets the UV texture coordinates of this vertex. - * @param u The UV u coordinate of the vertex. - * @param v The UV v coordinate of the vertex. - * @returns This Vertex. - */ - setUVs(u: number, v: number): this; - - /** - * Updates this vertex's position and calculates its projected screen-space coordinates. - * - * Sets the normalized `x` and `y` position, then scales them by the parent object's - * `width` and `height` to produce the projected `vx` and `vy` values. The origin - * offset of the parent object is then factored in, shifting `vx` and `vy` so that the - * mesh is correctly aligned relative to the object's origin point. - * @param x The x position of the vertex. - * @param y The y position of the vertex. - * @param width The width of the parent object. - * @param height The height of the parent object. - * @param originX The originX of the parent object. - * @param originY The originY of the parent object. - * @returns This Vertex. - */ - resize(x: number, y: number, width: number, height: number, originX: number, originY: number): this; - } /** @@ -34952,79 +33864,6 @@ declare namespace Phaser { */ setDisplaySize(width: number, height: number): this; - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - * @returns This Game Object instance. - */ - setDepth(value: number): this; - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToTop(): this; - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToBack(): this; - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be above. - * @returns This Game Object instance. - */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be below. - * @returns This Game Object instance. - */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; - /** * Gets the center coordinate of this Game Object, regardless of origin. * @@ -35471,22 +34310,6 @@ declare namespace Phaser { */ getParentRotation(): number; - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. - */ - setVisible(value: boolean): this; - } /** @@ -36047,79 +34870,6 @@ declare namespace Phaser { */ setDisplaySize(width: number, height: number): this; - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - * @returns This Game Object instance. - */ - setDepth(value: number): this; - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToTop(): this; - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToBack(): this; - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be above. - * @returns This Game Object instance. - */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be below. - * @returns This Game Object instance. - */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; - /** * Gets the center coordinate of this Game Object, regardless of origin. * @@ -36566,22 +35316,6 @@ declare namespace Phaser { */ getParentRotation(): number; - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. - */ - setVisible(value: boolean): this; - } /** @@ -37152,79 +35886,6 @@ declare namespace Phaser { */ setDisplaySize(width: number, height: number): this; - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - * @returns This Game Object instance. - */ - setDepth(value: number): this; - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToTop(): this; - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToBack(): this; - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be above. - * @returns This Game Object instance. - */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be below. - * @returns This Game Object instance. - */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; - /** * Gets the center coordinate of this Game Object, regardless of origin. * @@ -37671,22 +36332,6 @@ declare namespace Phaser { */ getParentRotation(): number; - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. - */ - setVisible(value: boolean): this; - } /** @@ -38268,79 +36913,6 @@ declare namespace Phaser { */ setDisplaySize(width: number, height: number): this; - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - * @returns This Game Object instance. - */ - setDepth(value: number): this; - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToTop(): this; - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToBack(): this; - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be above. - * @returns This Game Object instance. - */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be below. - * @returns This Game Object instance. - */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; - /** * Gets the center coordinate of this Game Object, regardless of origin. * @@ -38787,22 +37359,6 @@ declare namespace Phaser { */ getParentRotation(): number; - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. - */ - setVisible(value: boolean): this; - } /** @@ -39419,79 +37975,6 @@ declare namespace Phaser { */ setDisplaySize(width: number, height: number): this; - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - * @returns This Game Object instance. - */ - setDepth(value: number): this; - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToTop(): this; - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToBack(): this; - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be above. - * @returns This Game Object instance. - */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be below. - * @returns This Game Object instance. - */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; - /** * Gets the center coordinate of this Game Object, regardless of origin. * @@ -39938,22 +38421,6 @@ declare namespace Phaser { */ getParentRotation(): number; - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. - */ - setVisible(value: boolean): this; - } /** @@ -40573,79 +39040,6 @@ declare namespace Phaser { */ setDisplaySize(width: number, height: number): this; - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - * @returns This Game Object instance. - */ - setDepth(value: number): this; - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToTop(): this; - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToBack(): this; - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be above. - * @returns This Game Object instance. - */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be below. - * @returns This Game Object instance. - */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; - /** * Gets the center coordinate of this Game Object, regardless of origin. * @@ -41092,22 +39486,6 @@ declare namespace Phaser { */ getParentRotation(): number; - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. - */ - setVisible(value: boolean): this; - } namespace Particles { @@ -43667,79 +42045,6 @@ declare namespace Phaser { */ setBlendMode(value: string | Phaser.BlendModes | number): this; - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - * @returns This Game Object instance. - */ - setDepth(value: number): this; - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToTop(): this; - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToBack(): this; - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be above. - * @returns This Game Object instance. - */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be below. - * @returns This Game Object instance. - */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; - /** * Controls whether this Game Object participates in the WebGL lighting system. * When `true`, the object will respond to dynamic lights added via the Lights plugin, @@ -44213,22 +42518,6 @@ declare namespace Phaser { */ getParentRotation(): number; - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. - */ - setVisible(value: boolean): this; - } /** @@ -44548,6 +42837,9 @@ declare namespace Phaser { } + interface ParticleEmitter extends Phaser.GameObjects.Components.AlphaSingle, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Lighting, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.RenderNodes, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + } + } /** @@ -44937,79 +43229,6 @@ declare namespace Phaser { */ setBlendMode(value: string | Phaser.BlendModes | number): this; - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - * @returns This Game Object instance. - */ - setDepth(value: number): this; - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToTop(): this; - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToBack(): this; - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be above. - * @returns This Game Object instance. - */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be below. - * @returns This Game Object instance. - */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; - /** * The horizontally flipped state of the Game Object. * @@ -45971,22 +44190,6 @@ declare namespace Phaser { */ getParentRotation(): number; - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. - */ - setVisible(value: boolean): this; - /** * The Path this PathFollower is following. It can only follow one Path at a time. */ @@ -46453,79 +44656,6 @@ declare namespace Phaser { */ setBlendMode(value: string | Phaser.BlendModes | number): this; - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - * @returns This Game Object instance. - */ - setDepth(value: number): this; - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToTop(): this; - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToBack(): this; - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be above. - * @returns This Game Object instance. - */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be below. - * @returns This Game Object instance. - */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; - /** * Gets the center coordinate of this Game Object, regardless of origin. * @@ -47022,22 +45152,6 @@ declare namespace Phaser { */ getParentRotation(): number; - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. - */ - setVisible(value: boolean): this; - } /** @@ -47791,79 +45905,6 @@ declare namespace Phaser { */ setBlendMode(value: string | Phaser.BlendModes | number): this; - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - * @returns This Game Object instance. - */ - setDepth(value: number): this; - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToTop(): this; - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToBack(): this; - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be above. - * @returns This Game Object instance. - */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be below. - * @returns This Game Object instance. - */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; - /** * The horizontally flipped state of the Game Object. * @@ -48809,22 +46850,6 @@ declare namespace Phaser { */ getParentRotation(): number; - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. - */ - setVisible(value: boolean): this; - } /** @@ -49509,79 +47534,6 @@ declare namespace Phaser { */ setBlendMode(value: string | Phaser.BlendModes | number): this; - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - * @returns This Game Object instance. - */ - setDepth(value: number): this; - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToTop(): this; - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToBack(): this; - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be above. - * @returns This Game Object instance. - */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be below. - * @returns This Game Object instance. - */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; - /** * Toggles the horizontal flipped state of this Game Object. * @@ -50087,22 +48039,6 @@ declare namespace Phaser { */ getParentRotation(): number; - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. - */ - setVisible(value: boolean): this; - /** * The horizontal scroll factor of this Game Object. * @@ -50782,79 +48718,6 @@ declare namespace Phaser { */ setDisplaySize(width: number, height: number): this; - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - * @returns This Game Object instance. - */ - setDepth(value: number): this; - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToTop(): this; - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToBack(): this; - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be above. - * @returns This Game Object instance. - */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be below. - * @returns This Game Object instance. - */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; - /** * Gets the center coordinate of this Game Object, regardless of origin. * @@ -51301,22 +49164,6 @@ declare namespace Phaser { */ getParentRotation(): number; - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. - */ - setVisible(value: boolean): this; - } /** @@ -51793,79 +49640,6 @@ declare namespace Phaser { */ setBlendMode(value: string | Phaser.BlendModes | number): this; - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - * @returns This Game Object instance. - */ - setDepth(value: number): this; - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToTop(): this; - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToBack(): this; - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be above. - * @returns This Game Object instance. - */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be below. - * @returns This Game Object instance. - */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; - /** * Gets the center coordinate of this Game Object, regardless of origin. * @@ -52431,22 +50205,6 @@ declare namespace Phaser { */ getParentRotation(): number; - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. - */ - setVisible(value: boolean): this; - } /** @@ -52843,79 +50601,6 @@ declare namespace Phaser { */ setBlendMode(value: string | Phaser.BlendModes | number): this; - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - * @returns This Game Object instance. - */ - setDepth(value: number): this; - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToTop(): this; - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToBack(): this; - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be above. - * @returns This Game Object instance. - */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be below. - * @returns This Game Object instance. - */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; - /** * Gets the center coordinate of this Game Object, regardless of origin. * @@ -53481,22 +51166,6 @@ declare namespace Phaser { */ getParentRotation(): number; - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. - */ - setVisible(value: boolean): this; - } /** @@ -53838,79 +51507,6 @@ declare namespace Phaser { */ setBlendMode(value: string | Phaser.BlendModes | number): this; - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - * @returns This Game Object instance. - */ - setDepth(value: number): this; - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToTop(): this; - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToBack(): this; - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be above. - * @returns This Game Object instance. - */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be below. - * @returns This Game Object instance. - */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; - /** * Gets the center coordinate of this Game Object, regardless of origin. * @@ -54476,22 +52072,6 @@ declare namespace Phaser { */ getParentRotation(): number; - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. - */ - setVisible(value: boolean): this; - } /** @@ -54844,79 +52424,6 @@ declare namespace Phaser { */ setBlendMode(value: string | Phaser.BlendModes | number): this; - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - * @returns This Game Object instance. - */ - setDepth(value: number): this; - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToTop(): this; - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToBack(): this; - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be above. - * @returns This Game Object instance. - */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be below. - * @returns This Game Object instance. - */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; - /** * Gets the center coordinate of this Game Object, regardless of origin. * @@ -55482,22 +52989,6 @@ declare namespace Phaser { */ getParentRotation(): number; - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. - */ - setVisible(value: boolean): this; - } /** @@ -55916,79 +53407,6 @@ declare namespace Phaser { */ setBlendMode(value: string | Phaser.BlendModes | number): this; - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - * @returns This Game Object instance. - */ - setDepth(value: number): this; - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToTop(): this; - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToBack(): this; - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be above. - * @returns This Game Object instance. - */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be below. - * @returns This Game Object instance. - */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; - /** * Gets the center coordinate of this Game Object, regardless of origin. * @@ -56554,22 +53972,6 @@ declare namespace Phaser { */ getParentRotation(): number; - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. - */ - setVisible(value: boolean): this; - } /** @@ -56960,79 +54362,6 @@ declare namespace Phaser { */ setBlendMode(value: string | Phaser.BlendModes | number): this; - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - * @returns This Game Object instance. - */ - setDepth(value: number): this; - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToTop(): this; - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToBack(): this; - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be above. - * @returns This Game Object instance. - */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be below. - * @returns This Game Object instance. - */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; - /** * Gets the center coordinate of this Game Object, regardless of origin. * @@ -57598,22 +54927,6 @@ declare namespace Phaser { */ getParentRotation(): number; - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. - */ - setVisible(value: boolean): this; - } /** @@ -58019,79 +55332,6 @@ declare namespace Phaser { */ setBlendMode(value: string | Phaser.BlendModes | number): this; - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - * @returns This Game Object instance. - */ - setDepth(value: number): this; - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToTop(): this; - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToBack(): this; - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be above. - * @returns This Game Object instance. - */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be below. - * @returns This Game Object instance. - */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; - /** * Gets the center coordinate of this Game Object, regardless of origin. * @@ -58657,22 +55897,6 @@ declare namespace Phaser { */ getParentRotation(): number; - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. - */ - setVisible(value: boolean): this; - } /** @@ -59032,79 +56256,6 @@ declare namespace Phaser { */ setBlendMode(value: string | Phaser.BlendModes | number): this; - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - * @returns This Game Object instance. - */ - setDepth(value: number): this; - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToTop(): this; - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToBack(): this; - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be above. - * @returns This Game Object instance. - */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be below. - * @returns This Game Object instance. - */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; - /** * Gets the center coordinate of this Game Object, regardless of origin. * @@ -59670,22 +56821,6 @@ declare namespace Phaser { */ getParentRotation(): number; - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. - */ - setVisible(value: boolean): this; - } /** @@ -60049,79 +57184,6 @@ declare namespace Phaser { */ setBlendMode(value: string | Phaser.BlendModes | number): this; - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - * @returns This Game Object instance. - */ - setDepth(value: number): this; - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToTop(): this; - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToBack(): this; - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be above. - * @returns This Game Object instance. - */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be below. - * @returns This Game Object instance. - */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; - /** * Gets the center coordinate of this Game Object, regardless of origin. * @@ -60687,22 +57749,6 @@ declare namespace Phaser { */ getParentRotation(): number; - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. - */ - setVisible(value: boolean): this; - } /** @@ -61062,79 +58108,6 @@ declare namespace Phaser { */ setBlendMode(value: string | Phaser.BlendModes | number): this; - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - * @returns This Game Object instance. - */ - setDepth(value: number): this; - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToTop(): this; - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToBack(): this; - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be above. - * @returns This Game Object instance. - */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be below. - * @returns This Game Object instance. - */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; - /** * Gets the center coordinate of this Game Object, regardless of origin. * @@ -61700,22 +58673,6 @@ declare namespace Phaser { */ getParentRotation(): number; - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. - */ - setVisible(value: boolean): this; - } /** @@ -62083,79 +59040,6 @@ declare namespace Phaser { */ setBlendMode(value: string | Phaser.BlendModes | number): this; - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - * @returns This Game Object instance. - */ - setDepth(value: number): this; - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToTop(): this; - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToBack(): this; - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be above. - * @returns This Game Object instance. - */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be below. - * @returns This Game Object instance. - */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; - /** * Gets the center coordinate of this Game Object, regardless of origin. * @@ -62721,22 +59605,6 @@ declare namespace Phaser { */ getParentRotation(): number; - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. - */ - setVisible(value: boolean): this; - } /** @@ -63076,79 +59944,6 @@ declare namespace Phaser { */ setBlendMode(value: string | Phaser.BlendModes | number): this; - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - * @returns This Game Object instance. - */ - setDepth(value: number): this; - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToTop(): this; - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToBack(): this; - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be above. - * @returns This Game Object instance. - */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be below. - * @returns This Game Object instance. - */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; - /** * Gets the center coordinate of this Game Object, regardless of origin. * @@ -63714,22 +60509,6 @@ declare namespace Phaser { */ getParentRotation(): number; - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. - */ - setVisible(value: boolean): this; - } /** @@ -64346,79 +61125,6 @@ declare namespace Phaser { */ setBlendMode(value: string | Phaser.BlendModes | number): this; - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - * @returns This Game Object instance. - */ - setDepth(value: number): this; - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToTop(): this; - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToBack(): this; - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be above. - * @returns This Game Object instance. - */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be below. - * @returns This Game Object instance. - */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; - /** * The horizontally flipped state of the Game Object. * @@ -65380,22 +62086,6 @@ declare namespace Phaser { */ getParentRotation(): number; - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. - */ - setVisible(value: boolean): this; - } /** @@ -66262,79 +62952,6 @@ declare namespace Phaser { */ setBlendMode(value: string | Phaser.BlendModes | number): this; - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - * @returns This Game Object instance. - */ - setDepth(value: number): this; - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToTop(): this; - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToBack(): this; - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be above. - * @returns This Game Object instance. - */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be below. - * @returns This Game Object instance. - */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; - /** * The time elapsed since timer initialization, in milliseconds. */ @@ -66635,22 +63252,6 @@ declare namespace Phaser { */ setFrame(frame: string | number | Phaser.Textures.Frame, updateSize?: boolean, updateOrigin?: boolean): this; - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. - */ - setVisible(value: boolean): this; - } /** @@ -67003,79 +63604,6 @@ declare namespace Phaser { */ setBlendMode(value: string | Phaser.BlendModes | number): this; - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - * @returns This Game Object instance. - */ - setDepth(value: number): this; - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToTop(): this; - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToBack(): this; - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be above. - * @returns This Game Object instance. - */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be below. - * @returns This Game Object instance. - */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; - /** * The horizontally flipped state of the Game Object. * @@ -68037,22 +64565,6 @@ declare namespace Phaser { */ getParentRotation(): number; - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. - */ - setVisible(value: boolean): this; - } /** @@ -68964,79 +65476,6 @@ declare namespace Phaser { */ setCrop(x?: number | Phaser.Geom.Rectangle, y?: number, width?: number, height?: number): this; - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - * @returns This Game Object instance. - */ - setDepth(value: number): this; - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToTop(): this; - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToBack(): this; - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be above. - * @returns This Game Object instance. - */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be below. - * @returns This Game Object instance. - */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; - /** * The horizontally flipped state of the Game Object. * @@ -69795,22 +66234,6 @@ declare namespace Phaser { */ getParentRotation(): number; - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. - */ - setVisible(value: boolean): this; - } /** @@ -70790,79 +67213,6 @@ declare namespace Phaser { */ setDisplaySize(width: number, height: number): this; - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - * @returns This Game Object instance. - */ - setDepth(value: number): this; - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToTop(): this; - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToBack(): this; - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be above. - * @returns This Game Object instance. - */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be below. - * @returns This Game Object instance. - */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; - /** * The horizontally flipped state of the Game Object. * @@ -71693,22 +68043,6 @@ declare namespace Phaser { */ getParentRotation(): number; - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. - */ - setVisible(value: boolean): this; - } /** @@ -72917,79 +69251,6 @@ declare namespace Phaser { */ setDisplaySize(width: number, height: number): this; - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - * @returns This Game Object instance. - */ - setDepth(value: number): this; - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToTop(): this; - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToBack(): this; - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be above. - * @returns This Game Object instance. - */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be below. - * @returns This Game Object instance. - */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; - /** * The horizontally flipped state of the Game Object. * @@ -73871,878 +70132,302 @@ declare namespace Phaser { */ getParentRotation(): number; + } + /** + * @author Richard Davey + * @copyright 2013-2026 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + /** + * @classdesc + * Represents a single vertex within a NineSlice Game Object. + * + * A NineSlice Game Object is divided into a 3x3 grid of regions, each defined by a mesh + * of vertices. This class stores all the data needed for one vertex: its normalized position + * (x, y inherited from Vector2), its projected screen-space position (vx, vy), and its + * UV texture coordinates (u, v) used during rendering. + * + * You do not typically create NineSliceVertex instances directly. They are created and + * managed internally by the NineSlice Game Object. + * + * @memberof Phaser.GameObjects + * @since 4.0.0 + */ + class NineSliceVertex extends Phaser.Math.Vector2 { /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. + * The projected x coordinate of this vertex. + * + * @since 4.0.0 */ - visible: boolean; - + vx: number; /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. + * The projected y coordinate of this vertex. + * + * @since 4.0.0 */ - setVisible(value: boolean): this; - + vy: number; + /** + * UV u coordinate of this vertex. + * + * @since 4.0.0 + */ + u: number; + /** + * UV v coordinate of this vertex. + * + * @since 4.0.0 + */ + v: number; + /** + * @param x - The x position of the vertex. + * @param y - The y position of the vertex. + * @param u - The UV u coordinate of the vertex. + * @param v - The UV v coordinate of the vertex. + */ + constructor(x: number, y: number, u: number, v: number); + /** + * Sets the UV texture coordinates of this vertex. + * + * @since 4.0.0 + * + * @param u - The UV u coordinate of the vertex. + * @param v - The UV v coordinate of the vertex. + * + * @return This Vertex. + */ + setUVs(u: number, v: number): this; + /** + * Updates this vertex's position and calculates its projected screen-space coordinates. + * + * Sets the normalized `x` and `y` position, then scales them by the parent object's + * `width` and `height` to produce the projected `vx` and `vy` values. The origin + * offset of the parent object is then factored in, shifting `vx` and `vy` so that the + * mesh is correctly aligned relative to the object's origin point. + * + * @since 4.0.0 + * + * @param x - The x position of the vertex. + * @param y - The y position of the vertex. + * @param width - The width of the parent object. + * @param height - The height of the parent object. + * @param originX - The originX of the parent object. + * @param originY - The originY of the parent object. + * + * @return This Vertex. + */ + resize(x: number, y: number, width: number, height: number, originX: number, originY: number): this; } /** + * @classdesc * A Zone is a non-rendering rectangular Game Object that has a position and size but no texture. * It never displays visually, but it does live on the display list and can be moved, scaled, * and rotated like any other Game Object. - * + * * Its primary use is for creating Drop Zones and Input Hit Areas. It provides helper methods for * both circular and rectangular drop zones, and can also accept custom geometry shapes. Zones are * also useful for object overlap checks, or as a base class for your own non-displaying Game Objects. - * + * * The default origin is 0.5, placing it at the center of the Zone, consistent with other Game Objects. + * + * @class Zone + * @extends Phaser.GameObjects.GameObject + * @memberof Phaser.GameObjects + * @constructor + * @since 3.0.0 + * + * @extends Phaser.GameObjects.Components.Depth + * @extends Phaser.GameObjects.Components.GetBounds + * @extends Phaser.GameObjects.Components.Origin + * @extends Phaser.GameObjects.Components.Transform + * @extends Phaser.GameObjects.Components.ScrollFactor + * @extends Phaser.GameObjects.Components.Visible + * + * @param scene - The Scene to which this Game Object belongs. + * @param x - The horizontal position of this Game Object in the world. + * @param y - The vertical position of this Game Object in the world. + * @param [width=1] - The width of the Game Object. + * @param [height=1] - The height of the Game Object. */ - class Zone extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Visible { - /** - * - * @param scene The Scene to which this Game Object belongs. - * @param x The horizontal position of this Game Object in the world. - * @param y The vertical position of this Game Object in the world. - * @param width The width of the Game Object. Default 1. - * @param height The height of the Game Object. Default 1. - */ - constructor(scene: Phaser.Scene, x: number, y: number, width?: number, height?: number); - + class Zone extends Phaser.GameObjects.GameObject { /** * The native (un-scaled) width of this Game Object. + * + * @name Phaser.GameObjects.Zone#width + * @since 3.0.0 */ width: number; - /** * The native (un-scaled) height of this Game Object. + * + * @name Phaser.GameObjects.Zone#height + * @since 3.0.0 */ height: number; - /** * The Blend Mode of the Game Object. * Although a Zone never renders, it still has a blend mode to allow it to fit seamlessly into * display lists without causing a batch flush. + * + * @name Phaser.GameObjects.Zone#blendMode + * @since 3.0.0 */ blendMode: number; - + /** + * @since 3.0.0 + */ + constructor(scene: Phaser.Scene, x: number, y: number, width?: number, height?: number); /** * The displayed width of this Game Object. * This value takes into account the scale factor. + * + * @name Phaser.GameObjects.Zone#displayWidth + * @since 3.0.0 */ - displayWidth: number; - + get displayWidth(): number; + set displayWidth(value: number); /** * The displayed height of this Game Object. * This value takes into account the scale factor. + * + * @since 3.0.0 */ - displayHeight: number; - + get displayHeight(): number; + set displayHeight(value: number); /** * Sets the native (un-scaled) width and height of this Zone. Also updates the display origin * and, by default, resizes any non-custom input hit area associated with this Zone. - * @param width The width of this Game Object. - * @param height The height of this Game Object. - * @param resizeInput If this Zone has a Rectangle for a hit area this argument will resize the hit area as well. Default true. - * @returns This Game Object. + * + * @since 3.0.0 + * + * @param width - The width of this Game Object. + * @param height - The height of this Game Object. + * @param [resizeInput=true] - If this Zone has a Rectangle for a hit area this argument will resize the hit area as well. + * + * @return This Game Object. */ setSize(width: number, height: number, resizeInput?: boolean): this; - /** * Sets the display size of this Game Object. * Calling this will adjust the scale. - * @param width The width of this Game Object. - * @param height The height of this Game Object. - * @returns This Game Object. + * + * @since 3.0.0 + * + * @param width - The width of this Game Object. + * @param height - The height of this Game Object. + * + * @return This Game Object. */ setDisplaySize(width: number, height: number): this; - /** * Sets this Zone to be a Circular Drop Zone. * The circle is centered on this Zone's `x` and `y` coordinates. - * @param radius The radius of the Circle that will form the Drop Zone. - * @returns This Game Object. + * + * @since 3.0.0 + * + * @param radius - The radius of the Circle that will form the Drop Zone. + * + * @return This Game Object. */ setCircleDropZone(radius: number): this; - /** * Sets this Zone to be a Rectangle Drop Zone. * The rectangle is centered on this Zone's `x` and `y` coordinates. - * @param width The width of the rectangle drop zone. - * @param height The height of the rectangle drop zone. - * @returns This Game Object. + * + * @since 3.0.0 + * + * @param width - The width of the rectangle drop zone. + * @param height - The height of the rectangle drop zone. + * + * @return This Game Object. */ setRectangleDropZone(width: number, height: number): this; - /** * Enables this Zone as an interactive Drop Zone by calling `setInteractive` with the given * hit area shape and callback. You can pass any Phaser geometry shape, or a custom shape with * a matching hit-test callback. If no arguments are provided, a Rectangle matching the size of * this Zone will be used automatically. Has no effect if this Zone is already interactive. - * @param hitArea A Geometry shape instance, such as Phaser.Geom.Ellipse, or your own custom shape. If not given it will try to create a Rectangle based on the size of this zone. - * @param hitAreaCallback A function that will return `true` if the given x/y coords it is sent are within the shape. If you provide a shape you must also provide a callback. - * @returns This Game Object. - */ - setDropZone(hitArea?: object, hitAreaCallback?: Phaser.Types.Input.HitAreaCallback): this; - - /** - * The Camera used for filters. - * You can use this to alter the perspective of filters. - * It is not necessary to use this camera for ordinary rendering. - * - * This is only available if you use the `enableFilters` method. - */ - filterCamera: Phaser.Cameras.Scene2D.Camera; - - /** - * The filter lists for this Game Object. - * This is an object with `internal` and `external` properties. - * Each list is a {@link Phaser.GameObjects.Components.FilterList} object. - * - * This is only available if you use the `enableFilters` method. - */ - readonly filters: Phaser.Types.GameObjects.FiltersInternalExternal | null; - - /** - * Whether any filters should be rendered on this Game Object. - * This is `true` by default, even if there are no filters yet. - * Disable this to skip filter rendering. - * - * Use `willRenderFilters()` to see if there are any active filters. - */ - renderFilters: boolean; - - /** - * The maximum size of the base filter texture. - * Filters may use a larger texture after the base texture is rendered. - * The maximum texture size is at least 4096 in WebGL, based on the hardware. - * You may set this lower to save memory or prevent resizing. - */ - maxFilterSize: Phaser.Math.Vector2; - - /** - * Whether `filterCamera` should update every frame - * to focus on the Game Object. - * Disable this if you want to manually control the camera. - */ - filtersAutoFocus: boolean; - - /** - * Whether the filters should focus on the context, - * rather than attempt to focus on the Game Object. - * This is enabled automatically when enabling filters on objects - * which don't have well-defined bounds. - * - * This effectively sets the internal filters to render the same way - * as the external filters. - * - * This is only used if `filtersAutoFocus` is enabled. - * - * The "context" is the framebuffer to which the Game Object is rendered. - * This is usually the main framebuffer, but might be another framebuffer. - * It can even be several different framebuffers if the Game Object is - * rendered multiple times. - */ - filtersFocusContext: boolean; - - /** - * Whether the Filters component should always draw to a framebuffer, - * even if there are no active filters. - */ - filtersForceComposite: boolean; - - /** - * Whether this Game Object will render filters. - * This is true if it has active filters, - * and if the `renderFilters` property is also true.undefined - * @returns Whether the Game Object will render filters. - */ - willRenderFilters(): boolean; - - /** - * Enable this Game Object to have filters. - * - * You need to call this method if you want to use the `filterCamera` - * and `filters` properties. It sets up the necessary data structures. - * You may disable filter rendering with the `renderFilters` property. - * - * This is a WebGL only feature. It will return early if not available.undefined - * @returns undefined - */ - enableFilters(): this; - - /** - * Render this object using filters. - * - * This function's scope is not guaranteed, so it doesn't refer to `this`. - * @param renderer The WebGL Renderer instance to render with. - * @param gameObject The Game Object being rendered. - * @param drawingContext The current drawing context. - * @param parentMatrix The parent matrix of the Game Object, if it has one. - * @param renderStep The index of this function in the Game Object's list of render processes. Used to support multiple rendering functions. Default 0. - * @returns undefined - */ - renderWebGLFilters(renderer: Phaser.Renderer.WebGL.WebGLRenderer, gameObject: Phaser.GameObjects.GameObject, drawingContext: Phaser.Renderer.WebGL.DrawingContext, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix, renderStep?: number): Phaser.Types.GameObjects.RenderWebGLStep; - - /** - * Focus the filter camera. - * This sets the size and position of the filter camera to match the GameObject. - * This is called automatically on render if `filtersAutoFocus` is enabled. - * - * This will focus on the GameObject's raw dimensions if available. - * If the GameObject has no dimensions, this will focus on the context: - * the camera belonging to the DrawingContext used to render the GameObject. - * Context focus occurs during rendering, - * as the context is not known until then.undefined - * @returns undefined - */ - focusFilters(): this; - - /** - * Focus the filter camera on a specific camera. - * This is used internally when `filtersFocusContext` is enabled. - * @param camera The camera to focus on. - * @returns undefined - */ - focusFiltersOnCamera(camera: Phaser.Cameras.Scene2D.Camera): this; - - /** - * Manually override the focus of the filter camera. - * This allows you to set the size and position of the filter camera manually. - * It deactivates `filtersAutoFocus` when called. - * - * The camera will set scroll to place the game object at the - * given position within a rectangle of the given width and height. - * For example, calling `focusFiltersOverride(400, 200, 800, 600)` - * will focus the camera to place the object's center - * 100 pixels above the center of the camera (which is at 400x300). - * @param x The x-coordinate of the focus point, relative to the filter size. Default is the center. - * @param y The y-coordinate of the focus point, relative to the filter size. Default is the center. - * @param width The width of the focus area. Default is the filter width. - * @param height The height of the focus area. Default is the filter height. - * @returns undefined - */ - focusFiltersOverride(x?: number, y?: number, width?: number, height?: number): this; - - /** - * Set the base size of the filter camera. - * This is the size of the texture that internal filters will be drawn to. - * External filters are drawn to the size of the context (usually the game canvas). - * - * This is typically the size of the GameObject. - * It is set automatically when the Game Object is rendered - * and `filtersAutoFocus` is enabled. - * Turn off auto focus to set it manually. - * - * Technically, larger framebuffers may be used to provide padding. - * This is the size of the final framebuffer used for "internal" rendering. - * @param width Base width of the filter texture. - * @param height Base height of the filter texture. - * @returns undefined - */ - setFilterSize(width: number, height: number): this; - - /** - * Sets whether the filter camera should automatically re-focus on the Game Object every frame. - * Sets the `filtersAutoFocus` property. - * @param value Whether filters should be updated every frame. - * @returns undefined - */ - setFiltersAutoFocus(value: boolean): this; - - /** - * Set whether the filters should focus on the context. - * Sets the `filtersFocusContext` property. - * @param value Whether the filters should focus on the context. - * @returns undefined - */ - setFiltersFocusContext(value: boolean): this; - - /** - * Set whether the filters should always draw to a framebuffer. - * Sets the `filtersForceComposite` property. - * @param value Whether the object should always draw to a framebuffer, even if there are no active filters. - * @returns undefined - */ - setFiltersForceComposite(value: boolean): this; - - /** - * Set whether the filters should be rendered. - * Sets the `renderFilters` property. - * @param value Whether the filters should be rendered. - * @returns undefined - */ - setRenderFilters(value: boolean): this; - - /** - * Run a step in the render process. - * This is called automatically by the Render module. - * - * In most cases, it just runs the `renderWebGL` function. - * - * When `_renderSteps` has more than one entry, - * such as when Filters are enabled for this object, - * it allows those processes to defer `renderWebGL` - * and otherwise manage the flow of rendering. - * @param renderer The WebGL Renderer instance to render with. - * @param gameObject The Game Object being rendered. - * @param drawingContext The current drawing context. - * @param parentMatrix The parent matrix of the Game Object, if it has one. - * @param renderStep Which step of the rendering process should be run? Default 0. - * @param displayList The display list which is currently being rendered. If not provided, it will be created with the Game Object. - * @param displayListIndex The index of the Game Object within the display list. Default 0. - */ - renderWebGLStep(renderer: Phaser.Renderer.WebGL.WebGLRenderer, gameObject: Phaser.GameObjects.GameObject, drawingContext: Phaser.Renderer.WebGL.DrawingContext, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix, renderStep?: number, displayList?: Phaser.GameObjects.GameObject[], displayListIndex?: number): void; - - /** - * Adds a render step function to this Game Object's WebGL render pipeline. - * - * The first render step in `_renderSteps` is run first. - * It should call the next render step in the list. - * This allows render steps to control the rendering flow. - * @param fn The render step function to add. - * @param index The index in the render list to add the step to. Omit to add to the end. - * @returns This Game Object instance. - */ - addRenderStep(fn: Phaser.Types.GameObjects.RenderWebGLStep, index?: number): this; - - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - * @returns This Game Object instance. - */ - setDepth(value: number): this; - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToTop(): this; - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToBack(): this; - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be above. - * @returns This Game Object instance. - */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be below. - * @returns This Game Object instance. - */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Gets the center coordinate of this Game Object, regardless of origin. - * - * The returned point is calculated in local space and does not factor in any parent Containers, - * unless the `includeParent` argument is set to `true`. - * @param output An object to store the values in. If not provided a new Vector2 will be created. - * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. - * @returns The values stored in the output object. - */ - getCenter(output?: O, includeParent?: boolean): O; - - /** - * Gets the top-left corner coordinate of this Game Object, regardless of origin. - * - * The returned point is calculated in local space and does not factor in any parent Containers, - * unless the `includeParent` argument is set to `true`. - * @param output An object to store the values in. If not provided a new Vector2 will be created. - * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. - * @returns The values stored in the output object. - */ - getTopLeft(output?: O, includeParent?: boolean): O; - - /** - * Gets the top-center coordinate of this Game Object, regardless of origin. - * - * The returned point is calculated in local space and does not factor in any parent Containers, - * unless the `includeParent` argument is set to `true`. - * @param output An object to store the values in. If not provided a new Vector2 will be created. - * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. - * @returns The values stored in the output object. - */ - getTopCenter(output?: O, includeParent?: boolean): O; - - /** - * Gets the top-right corner coordinate of this Game Object, regardless of origin. - * - * The returned point is calculated in local space and does not factor in any parent Containers, - * unless the `includeParent` argument is set to `true`. - * @param output An object to store the values in. If not provided a new Vector2 will be created. - * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. - * @returns The values stored in the output object. - */ - getTopRight(output?: O, includeParent?: boolean): O; - - /** - * Gets the left-center coordinate of this Game Object, regardless of origin. - * - * The returned point is calculated in local space and does not factor in any parent Containers, - * unless the `includeParent` argument is set to `true`. - * @param output An object to store the values in. If not provided a new Vector2 will be created. - * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. - * @returns The values stored in the output object. - */ - getLeftCenter(output?: O, includeParent?: boolean): O; - - /** - * Gets the right-center coordinate of this Game Object, regardless of origin. - * - * The returned point is calculated in local space and does not factor in any parent Containers, - * unless the `includeParent` argument is set to `true`. - * @param output An object to store the values in. If not provided a new Vector2 will be created. - * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. - * @returns The values stored in the output object. - */ - getRightCenter(output?: O, includeParent?: boolean): O; - - /** - * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. - * - * The returned point is calculated in local space and does not factor in any parent Containers, - * unless the `includeParent` argument is set to `true`. - * @param output An object to store the values in. If not provided a new Vector2 will be created. - * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. - * @returns The values stored in the output object. - */ - getBottomLeft(output?: O, includeParent?: boolean): O; - - /** - * Gets the bottom-center coordinate of this Game Object, regardless of origin. - * - * The returned point is calculated in local space and does not factor in any parent Containers, - * unless the `includeParent` argument is set to `true`. - * @param output An object to store the values in. If not provided a new Vector2 will be created. - * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. - * @returns The values stored in the output object. - */ - getBottomCenter(output?: O, includeParent?: boolean): O; - - /** - * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. - * - * The returned point is calculated in local space and does not factor in any parent Containers, - * unless the `includeParent` argument is set to `true`. - * @param output An object to store the values in. If not provided a new Vector2 will be created. - * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. - * @returns The values stored in the output object. - */ - getBottomRight(output?: O, includeParent?: boolean): O; - - /** - * Gets the axis-aligned bounding rectangle of this Game Object, regardless of origin. - * - * The bounding rectangle is computed by retrieving all four corner positions of the - * Game Object (top-left, top-right, bottom-left, bottom-right), applying any rotation - * and parent Container transforms, and then calculating the smallest axis-aligned - * rectangle that fully encloses all four points. - * - * The values are stored and returned in a Rectangle, or Rectangle-like, object. - * @param output An object to store the values in. If not provided a new Rectangle will be created. - * @returns The values stored in the output object. - */ - getBounds(output?: O): O; - - /** - * The horizontal origin of this Game Object. - * The origin maps the relationship between the size and position of the Game Object. - * The default value is 0.5, meaning all Game Objects are positioned based on their center. - * Setting the value to 0 means the position now relates to the left of the Game Object. - * Set this value with `setOrigin()`. - */ - originX: number; - - /** - * The vertical origin of this Game Object. - * The origin maps the relationship between the size and position of the Game Object. - * The default value is 0.5, meaning all Game Objects are positioned based on their center. - * Setting the value to 0 means the position now relates to the top of the Game Object. - * Set this value with `setOrigin()`. - */ - originY: number; - - /** - * The horizontal display origin of this Game Object, expressed in pixels. - * Unlike `originX`, which is a normalized value between 0 and 1, the display origin is the - * calculated pixel offset derived from the Game Object's width multiplied by its `originX` value. - * Setting this property updates `originX` accordingly. - */ - displayOriginX: number; - - /** - * The vertical display origin of this Game Object, expressed in pixels. - * Unlike `originY`, which is a normalized value between 0 and 1, the display origin is the - * calculated pixel offset derived from the Game Object's height multiplied by its `originY` value. - * Setting this property updates `originY` accordingly. - */ - displayOriginY: number; - - /** - * Sets the origin of this Game Object. - * - * The values are given in the range 0 to 1. - * @param x The horizontal origin value. Default 0.5. - * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. - * @returns This Game Object instance. - */ - setOrigin(x?: number, y?: number): this; - - /** - * Sets the origin of this Game Object based on the Pivot values in its Frame. - * If the Frame has a custom pivot point defined, the origin is set to match it. - * If the Frame does not have a custom pivot, this method falls back to `setOrigin()`, - * resetting the origin to the default value of 0.5 for both axes.undefined - * @returns This Game Object instance. - */ - setOriginFromFrame(): this; - - /** - * Sets the display origin of this Game Object. - * The difference between this and setting the origin is that you can use pixel values for setting the display origin. - * @param x The horizontal display origin value. Default 0. - * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. - * @returns This Game Object instance. - */ - setDisplayOrigin(x?: number, y?: number): this; - - /** - * Updates the Display Origin cached values internally stored on this Game Object. - * You don't usually call this directly, but it is exposed for edge-cases where you may.undefined - * @returns This Game Object instance. - */ - updateDisplayOrigin(): this; - - /** - * A property indicating that a Game Object has this component. - */ - readonly hasTransformComponent: boolean; - - /** - * The x position of this Game Object. - */ - x: number; - - /** - * The y position of this Game Object. - */ - y: number; - - /** - * The z position of this Game Object. - * - * Note: The z position does not control the rendering order of 2D Game Objects. Use - * {@link Phaser.GameObjects.Components.Depth#depth} instead. - */ - z: number; - - /** - * The w position of this Game Object. - */ - w: number; - - /** - * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object - * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * - * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this - * isn't the case, use the `scaleX` or `scaleY` properties instead. - */ - scale: number; - - /** - * The horizontal scale of this Game Object. - */ - scaleX: number; + * + * @since 3.0.0 + * + * @param [hitArea] - A Geometry shape instance, such as Phaser.Geom.Ellipse, or your own custom shape. + * @param [hitAreaCallback] - A function that will return `true` if the given x/y coords it is sent are within the shape. + * + * @return This Game Object. + */ + setDropZone(hitArea?: T, hitAreaCallback?: Phaser.Types.Input.HitAreaCallback): this; + } - /** - * The vertical scale of this Game Object. - */ - scaleY: number; + interface Zone extends Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Visible { + } - /** - * The angle of this Game Object as expressed in degrees. - * - * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left - * and -90 is up. - * - * If you prefer to work in radians, see the `rotation` property instead. - */ - angle: number; + interface GameObject extends Phaser.GameObjects.Components.Filters, Phaser.GameObjects.Components.RenderSteps { + } - /** - * The angle of this Game Object in radians. - * - * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left - * and -PI/2 is up. - * - * If you prefer to work in degrees, see the `angle` property instead. - */ - rotation: number; + interface BitmapText extends Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Lighting, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.RenderNodes, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + } - /** - * Sets the position of this Game Object. - * @param x The x position of this Game Object. Default 0. - * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. - * @param z The z position of this Game Object. Default 0. - * @param w The w position of this Game Object. Default 0. - * @returns This Game Object instance. - */ - setPosition(x?: number, y?: number, z?: number, w?: number): this; + interface Blitter extends Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Lighting, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.RenderNodes, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + } - /** - * Copies an object's coordinates to this Game Object's position. - * @param source An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. - * @returns This Game Object instance. - */ - copyPosition(source: Phaser.Types.Math.Vector2Like | Phaser.Types.Math.Vector3Like | Phaser.Types.Math.Vector4Like): this; + interface CaptureFrame extends Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.RenderNodes, Phaser.GameObjects.Components.Visible { + } - /** - * Sets the position of this Game Object to be a random position within the confines of - * the given area. - * - * If no area is specified a random position between 0 x 0 and the game width x height is used instead. - * - * The position does not factor in the size of this Game Object, meaning that only the origin is - * guaranteed to be within the area. - * @param x The x position of the top-left of the random area. Default 0. - * @param y The y position of the top-left of the random area. Default 0. - * @param width The width of the random area. - * @param height The height of the random area. - * @returns This Game Object instance. - */ - setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + interface Container extends Phaser.GameObjects.Components.AlphaSingle, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.ComputedSize, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + } - /** - * Sets the rotation of this Game Object. - * @param radians The rotation of this Game Object, in radians. Default 0. - * @returns This Game Object instance. - */ - setRotation(radians?: number): this; + interface DOMElement extends Phaser.GameObjects.Components.AlphaSingle, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + } - /** - * Sets the angle of this Game Object. - * @param degrees The rotation of this Game Object, in degrees. Default 0. - * @returns This Game Object instance. - */ - setAngle(degrees?: number): this; + interface Extern extends Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + } - /** - * Sets the scale of this Game Object. - * @param x The horizontal scale of this Game Object. Default 1. - * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. - * @returns This Game Object instance. - */ - setScale(x?: number, y?: number): this; + interface Graphics extends Phaser.GameObjects.Components.AlphaSingle, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Lighting, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.RenderNodes, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible, Phaser.GameObjects.Components.ScrollFactor { + } - /** - * Sets the x position of this Game Object. - * @param value The x position of this Game Object. Default 0. - * @returns This Game Object instance. - */ - setX(value?: number): this; + interface Image extends Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Lighting, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.RenderNodes, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.TextureCrop, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + } - /** - * Sets the y position of this Game Object. - * @param value The y position of this Game Object. Default 0. - * @returns This Game Object instance. - */ - setY(value?: number): this; + interface Layer extends Phaser.GameObjects.Components.AlphaSingle, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Visible { + } - /** - * Sets the z position of this Game Object. - * - * Note: The z position does not control the rendering order of 2D Game Objects. Use - * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. - * @param value The z position of this Game Object. Default 0. - * @returns This Game Object instance. - */ - setZ(value?: number): this; + interface Light extends Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Visible { + } - /** - * Sets the w position of this Game Object. - * @param value The w position of this Game Object. Default 0. - * @returns This Game Object instance. - */ - setW(value?: number): this; + interface NineSlice extends Phaser.GameObjects.Components.AlphaSingle, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.RenderNodes, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + } - /** - * Gets the local transform matrix for this Game Object. - * @param tempMatrix The matrix to populate with the values from this Game Object. - * @returns The populated Transform Matrix. - */ - getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + interface PathFollower extends Phaser.GameObjects.Components.PathFollower { + } - /** - * Gets the world transform matrix for this Game Object, factoring in any parent Containers. - * @param tempMatrix The matrix to populate with the values from this Game Object. - * @param parentMatrix A temporary matrix to hold parent values during the calculations. - * @returns The populated Transform Matrix. - */ - getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + interface PointLight extends Phaser.GameObjects.Components.AlphaSingle, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.RenderNodes, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + } - /** - * Takes the given `x` and `y` coordinates and converts them into local space for this - * Game Object, taking into account parent and local transforms, and the Display Origin. - * - * The returned Vector2 contains the translated point in its properties. - * - * A Camera needs to be provided in order to handle modified scroll factors. If no - * camera is specified, it will use the `main` camera from the Scene to which this - * Game Object belongs. - * @param x The x position to translate. - * @param y The y position to translate. - * @param point A Vector2, or point-like object, to store the results in. - * @param camera The Camera which is being tested against. If not given will use the Scene default camera. - * @returns The translated point. - */ - getLocalPoint(x: number, y: number, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; + interface Rope extends Phaser.GameObjects.Components.AlphaSingle, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.RenderNodes, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible, Phaser.GameObjects.Components.ScrollFactor { + } - /** - * Gets the world position of this Game Object, factoring in any parent Containers. - * @param point A Vector2, or point-like object, to store the result in. - * @param tempMatrix A temporary matrix to hold the Game Object's values. - * @param parentMatrix A temporary matrix to hold parent values. - * @returns The world position of this Game Object. - */ - getWorldPoint(point?: Phaser.Math.Vector2, tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.Math.Vector2; + interface Shader extends Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.ComputedSize, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + } - /** - * Gets the sum total rotation of all of this Game Object's parent Containers. - * - * The returned value is in radians and will be zero if this Game Object has no parent container.undefined - * @returns The sum total rotation, in radians, of all parent containers of this Game Object. - */ - getParentRotation(): number; + interface Shape extends Phaser.GameObjects.Components.AlphaSingle, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.RenderNodes, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + } - /** - * The horizontal scroll factor of this Game Object. - * - * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * - * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. - * It does not change the Game Objects actual position values. - * - * A value of 1 means it will move exactly in sync with a camera. - * A value of 0 means it will not move at all, even if the camera moves. - * Other values control the degree to which the camera movement is mapped to this Game Object. - * - * Please be aware that scroll factor values other than 1 are not taken into consideration when - * calculating physics collisions. Bodies always collide based on their world position, but changing - * the scroll factor is a visual adjustment to where the textures are rendered, which can offset - * them from physics bodies if not accounted for in your code. - */ - scrollFactorX: number; + interface Sprite extends Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Lighting, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.RenderNodes, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.TextureCrop, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + } - /** - * The vertical scroll factor of this Game Object. - * - * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * - * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. - * It does not change the Game Objects actual position values. - * - * A value of 1 means it will move exactly in sync with a camera. - * A value of 0 means it will not move at all, even if the camera moves. - * Other values control the degree to which the camera movement is mapped to this Game Object. - * - * Please be aware that scroll factor values other than 1 are not taken into consideration when - * calculating physics collisions. Bodies always collide based on their world position, but changing - * the scroll factor is a visual adjustment to where the textures are rendered, which can offset - * them from physics bodies if not accounted for in your code. - */ - scrollFactorY: number; + interface SpriteGPULayer extends Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.ElapseTimer, Phaser.GameObjects.Components.Lighting, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.RenderNodes, Phaser.GameObjects.Components.TextureCrop, Phaser.GameObjects.Components.Visible { + } - /** - * Sets the horizontal and vertical scroll factor of this Game Object. If only the `x` value is - * provided, it is applied to both axes. This is a convenience method for setting `scrollFactorX` - * and `scrollFactorY` in a single call. - * - * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * - * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. - * It does not change the Game Objects actual position values. - * - * A value of 1 means it will move exactly in sync with a camera. - * A value of 0 means it will not move at all, even if the camera moves. - * Other values control the degree to which the camera movement is mapped to this Game Object. - * - * Please be aware that scroll factor values other than 1 are not taken into consideration when - * calculating physics collisions. Bodies always collide based on their world position, but changing - * the scroll factor is a visual adjustment to where the textures are rendered, which can offset - * them from physics bodies if not accounted for in your code. - * @param x The horizontal scroll factor of this Game Object. - * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. - * @returns This Game Object instance. - */ - setScrollFactor(x: number, y?: number): this; + interface Stamp extends Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Lighting, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.RenderNodes, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.TextureCrop, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + } - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; + interface Text extends Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.ComputedSize, Phaser.GameObjects.Components.Crop, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.RenderNodes, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + } - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. - */ - setVisible(value: boolean): this; + interface TileSprite extends Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.ComputedSize, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Lighting, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.RenderNodes, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + } + interface Video extends Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.ComputedSize, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Lighting, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.RenderNodes, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.TextureCrop, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { } } @@ -76317,45 +72002,656 @@ declare namespace Phaser { } /** + * A Triangle is a closed polygon defined by three vertices in 2D space, useful for hit testing, + * defining spawn or trigger regions, and geometric calculations. It is a geometry object only — + * not a Game Object — and cannot be rendered directly. To draw a Triangle to the screen, pass it + * to a Graphics Game Object's `strokeTriangleShape` or `fillTriangleShape` method. + * + * The three vertices are stored as coordinate pairs (`x1`,`y1`), (`x2`,`y2`), and (`x3`,`y3`). + * All coordinates default to `0` if not provided. + */ + class Triangle { + /** + * + * @param x1 `x` coordinate of the first point. Default 0. + * @param y1 `y` coordinate of the first point. Default 0. + * @param x2 `x` coordinate of the second point. Default 0. + * @param y2 `y` coordinate of the second point. Default 0. + * @param x3 `x` coordinate of the third point. Default 0. + * @param y3 `y` coordinate of the third point. Default 0. + */ + constructor(x1?: number, y1?: number, x2?: number, y2?: number, x3?: number, y3?: number); + + /** + * Returns the area of a Triangle. + * @param triangle The Triangle to use. + * @returns The area of the Triangle, always non-negative. + */ + static Area(triangle: Phaser.Geom.Triangle): number; + + /** + * Builds an equilateral triangle. In the equilateral triangle, all the sides are the same length (congruent) and all the angles are the same size (congruent). + * The x/y specifies the top-middle of the triangle (x1/y1) and length is the length of each side. + * @param x x coordinate of the top point of the triangle. + * @param y y coordinate of the top point of the triangle. + * @param length Length of each side of the triangle. + * @returns A new equilateral Triangle with its apex at (`x`, `y`) and all sides of the specified `length`. + */ + static BuildEquilateral(x: number, y: number, length: number): Phaser.Geom.Triangle; + + /** + * Takes an array of vertex coordinates, and optionally an array of hole indices, then returns an array + * of Triangle instances, where the given vertices have been decomposed into a series of triangles. + * @param data A flat array of vertex coordinates like [x0,y0, x1,y1, x2,y2, ...] + * @param holes An array of hole indices if any (e.g. [5, 8] for a 12-vertex input would mean one hole with vertices 5–7 and another with 8–11). Default null. + * @param scaleX Horizontal scale factor to multiply the resulting points by. Default 1. + * @param scaleY Vertical scale factor to multiply the resulting points by. Default 1. + * @param out An array to store the resulting Triangle instances in. If not provided, a new array is created. + * @returns An array of Triangle instances, where each triangle is based on the decomposed vertices data. + */ + static BuildFromPolygon(data: any[], holes?: any[], scaleX?: number, scaleY?: number, out?: O): O; + + /** + * Builds a right triangle, i.e. one which has a 90-degree angle and two acute angles. The `x` and `y` coordinates mark the position of the right-angle vertex, which becomes the first point of the Triangle. The `width` and `height` values determine the lengths of the two sides adjacent to the right angle and may be positive or negative, which controls the direction in which each side extends from the right-angle vertex. + * @param x The X coordinate of the right angle, which will also be the first X coordinate of the constructed Triangle. + * @param y The Y coordinate of the right angle, which will also be the first Y coordinate of the constructed Triangle. + * @param width The length of the side which is to the left or to the right of the right angle. + * @param height The length of the side which is above or below the right angle. If not given, defaults to the value of `width`. + * @returns The constructed right Triangle. + */ + static BuildRight(x: number, y: number, width: number, height: number): Phaser.Geom.Triangle; + + /** + * Positions the Triangle so that it is centered on the given coordinates. + * @param triangle The triangle to be positioned. + * @param x The horizontal coordinate to center on. + * @param y The vertical coordinate to center on. + * @param centerFunc The function used to center the triangle. Defaults to Centroid centering. + * @returns The Triangle that was centered. + */ + static CenterOn(triangle: O, x: number, y: number, centerFunc?: CenterFunction): O; + + /** + * Calculates the position of a Triangle's centroid, which is also its center of mass (center of gravity). + * + * The centroid is the point in a Triangle at which its three medians (the lines drawn from the vertices to the bisectors of the opposite sides) meet. It divides each one in a 2:1 ratio. + * @param triangle The Triangle to use. + * @param out A Vector2 object to store the coordinates in. + * @returns The `out` object with modified `x` and `y` properties, or a new Vector2 if none was provided. + */ + static Centroid(triangle: Phaser.Geom.Triangle, out?: O): O; + + /** + * Computes the circumcenter of a triangle. The circumcenter is the centre of + * the circumcircle, the unique circle that passes through all three vertices of + * the triangle. It is also the common intersection point of the perpendicular + * bisectors of the sides of the triangle, and is the only point which has equal + * distance to all three vertices of the triangle. + * + * Adapted from http://bjornharrtell.github.io/jsts/doc/api/jsts_geom_Triangle.js.html + * @param triangle The Triangle to get the circumcenter of. + * @param out The Vector2 object to store the position in. If not given, a new Vector2 instance is created. + * @returns A Vector2 object holding the coordinates of the circumcenter of the Triangle. + */ + static CircumCenter(triangle: Phaser.Geom.Triangle, out?: O): O; + + /** + * Finds the circumscribed circle (circumcircle) of a Triangle object. The circumcircle is the circle which touches all of the triangle's vertices. + * + * Adapted from https://gist.github.com/mutoo/5617691 + * @param triangle The Triangle to use as input. + * @param out An optional Circle to store the result in. + * @returns The updated `out` Circle, or a new Circle if none was provided. + */ + static CircumCircle(triangle: Phaser.Geom.Triangle, out?: O): O; + + /** + * Clones a Triangle object. + * @param source The Triangle to clone. + * @returns A new Triangle identical to the given one but separate from it. + */ + static Clone(source: Phaser.Geom.Triangle): Phaser.Geom.Triangle; + + /** + * Checks if a point (as a pair of coordinates) is inside a Triangle's bounds. + * @param triangle The Triangle to check. + * @param x The X coordinate of the point to check. + * @param y The Y coordinate of the point to check. + * @returns `true` if the point is inside the Triangle, otherwise `false`. + */ + static Contains(triangle: Phaser.Geom.Triangle, x: number, y: number): boolean; + + /** + * Filters an array of point-like objects to only those contained within a triangle. + * + * If `returnFirst` is true, will return an array containing only the first point in the provided array that is within the triangle (or an empty array if there are no such points). + * @param triangle The triangle that the points are being checked in. + * @param points An array of Vector2 objects to check if they are within the triangle. + * @param returnFirst If `true`, return an array containing only the first point found that is within the triangle. Default false. + * @param out If provided, the points that are within the triangle will be appended to this array instead of being added to a new array. If `returnFirst` is true, only the first point found within the triangle will be appended. This array will also be returned by this function. + * @returns An array containing all the points from `points` that are within the triangle, if an array was provided as `out`, points will be appended to that array and it will also be returned here. + */ + static ContainsArray(triangle: Phaser.Geom.Triangle, points: Phaser.Math.Vector2[], returnFirst?: boolean, out?: any[]): Phaser.Math.Vector2[]; + + /** + * Tests if a triangle contains a point. + * @param triangle The triangle. + * @param vec The Vector2 point to test if it's within the triangle. + * @returns `true` if the point is within the triangle, otherwise `false`. + */ + static ContainsPoint(triangle: Phaser.Geom.Triangle, vec: Phaser.Math.Vector2): boolean; + + /** + * Copy the values of one Triangle to a destination Triangle. + * @param source The source Triangle to copy the values from. + * @param dest The destination Triangle to copy the values to. + * @returns The destination Triangle. + */ + static CopyFrom(source: Phaser.Geom.Triangle, dest: O): O; + + /** + * Decomposes a Triangle into an array of its points. + * @param triangle The Triangle to decompose. + * @param out An array to store the points into. + * @returns The provided `out` array, or a new array if none was provided, with three objects with `x` and `y` properties representing each point of the Triangle appended to it. + */ + static Decompose(triangle: Phaser.Geom.Triangle, out?: any[]): any[]; + + /** + * Returns true if two triangles have the same coordinates. + * @param triangle The first triangle to check. + * @param toCompare The second triangle to check. + * @returns `true` if the two given triangles have the exact same coordinates, otherwise `false`. + */ + static Equals(triangle: Phaser.Geom.Triangle, toCompare: Phaser.Geom.Triangle): boolean; + + /** + * Returns a point along the perimeter of a Triangle as a Vector2, based on a normalized position value. + * + * The `position` parameter is a value between 0 and 1, where 0 and 1 both map to the start of + * line A (the first vertex). The point is calculated by traversing the triangle's perimeter in + * order: line A, then line B, then line C. + * @param triangle The Triangle to get the point on its perimeter from. + * @param position A normalized value between 0 and 1 representing a position along the triangle's perimeter. Both 0 and 1 return the start of line A. + * @param out An optional Vector2 point to store the result in. If not given, a new Vector2 will be created. + * @returns A Vector2 point containing the coordinates of the position on the triangle's perimeter. + */ + static GetPoint(triangle: Phaser.Geom.Triangle, position: number, out?: O): O; + + /** + * Returns an array of evenly spaced points on the perimeter of a Triangle. + * + * The points are placed along the triangle's three edges in order (A, B, then C), + * with their positions calculated proportionally based on the total perimeter length. + * @param triangle The Triangle to get the points from. + * @param quantity The number of evenly spaced points to return. Set to 0 to return an arbitrary number of points based on the `stepRate`. + * @param stepRate If `quantity` is 0, the distance in pixels between each returned point along the perimeter. + * @param out An array to which the points should be appended. + * @returns The modified `out` array, or a new array if none was provided. + */ + static GetPoints(triangle: Phaser.Geom.Triangle, quantity: number, stepRate: number, out?: O): O; + + /** + * Calculates the position of the incenter of a Triangle object. This is the point where its three angle bisectors meet and it's also the center of the incircle, which is the circle inscribed in the triangle. + * @param triangle The Triangle to find the incenter of. + * @param out An optional Vector2 point in which to store the coordinates. + * @returns The incenter of the triangle in a Vector2. + */ + static InCenter(triangle: Phaser.Geom.Triangle, out?: O): O; + + /** + * Moves each point (vertex) of a Triangle by a given offset, thus moving the entire Triangle by that offset. + * @param triangle The Triangle to move. + * @param x The horizontal offset (distance) by which to move each point. Can be positive or negative. + * @param y The vertical offset (distance) by which to move each point. Can be positive or negative. + * @returns The modified Triangle. + */ + static Offset(triangle: O, x: number, y: number): O; + + /** + * Gets the length of the perimeter of the given triangle. + * Calculated by adding together the length of each of the three sides. + * @param triangle The Triangle to get the length from. + * @returns The length of the Triangle. + */ + static Perimeter(triangle: Phaser.Geom.Triangle): number; + + /** + * Returns a random Point from within the area of the given Triangle. + * @param triangle The Triangle to get a random point from. + * @param out The Vector2 point object to store the position in. If not given, a new Vector2 instance is created. + * @returns A Vector2 point object holding the coordinates of a random position within the Triangle. + */ + static Random(triangle: Phaser.Geom.Triangle, out?: O): O; + + /** + * Rotates a Triangle about its incenter, which is the point at which its three angle bisectors meet. + * @param triangle The Triangle to rotate. + * @param angle The angle by which to rotate the Triangle, in radians. + * @returns The rotated Triangle. + */ + static Rotate(triangle: O, angle: number): O; + + /** + * Rotates a Triangle at a certain angle about a given Vector2 point. + * @param triangle The Triangle to rotate. + * @param point The Vector2 point to rotate the Triangle around. + * @param angle The angle by which to rotate the Triangle, in radians. + * @returns The rotated Triangle. + */ + static RotateAroundPoint(triangle: O, point: Phaser.Math.Vector2, angle: number): O; + + /** + * Rotates an entire Triangle at a given angle about a specific point. + * @param triangle The Triangle to rotate. + * @param x The X coordinate of the point to rotate the Triangle about. + * @param y The Y coordinate of the point to rotate the Triangle about. + * @param angle The angle by which to rotate the Triangle, in radians. + * @returns The rotated Triangle. + */ + static RotateAroundXY(triangle: O, x: number, y: number, angle: number): O; + + /** + * The geometry constant type of this object: `GEOM_CONST.TRIANGLE`. + * Used for fast type comparisons. + */ + readonly type: number; + + /** + * `x` coordinate of the first point. + */ + x1: number; + + /** + * `y` coordinate of the first point. + */ + y1: number; + + /** + * `x` coordinate of the second point. + */ + x2: number; + + /** + * `y` coordinate of the second point. + */ + y2: number; + + /** + * `x` coordinate of the third point. + */ + x3: number; + + /** + * `y` coordinate of the third point. + */ + y3: number; + + /** + * Checks whether a given point lies within the triangle. + * @param x The x coordinate of the point to check. + * @param y The y coordinate of the point to check. + * @returns `true` if the coordinate pair is within the triangle, otherwise `false`. + */ + contains(x: number, y: number): boolean; + + /** + * Returns a point at a given normalized position along the perimeter of the triangle. + * @param position Position as float within `0` and `1`. `0` equals the first point. + * @param output Optional Vector2 point that the calculated point will be written to. + * @returns Calculated Vector2 that represents the requested position. It is the same as `output` when this parameter has been given. + */ + getPoint(position: number, output?: O): O; + + /** + * Calculates a list of evenly distributed points along the perimeter of the triangle. Either pass the number of points to generate (`quantity`) or the distance between consecutive points (`stepRate`). + * @param quantity Number of points to be generated. Can be falsey when `stepRate` should be used. All points have the same distance along the triangle. + * @param stepRate Distance between two points. Will only be used when `quantity` is falsey. + * @param output Optional array of Vector2 points for writing the calculated points into. Otherwise a new array will be created. + * @returns Returns a list of calculated `Vector2` instances or the filled array passed as parameter `output`. + */ + getPoints(quantity: number, stepRate?: number, output?: O): O; + + /** + * Returns a random point from within the area of the triangle. + * @param vec Optional Vector2 point that will be modified. Otherwise a new one will be created. + * @returns Random Vector2. When parameter `vec` has been provided it will be returned. + */ + getRandomPoint(vec?: Phaser.Math.Vector2): O; + + /** + * Sets all three points of the triangle. Leaving out any coordinate sets it to be `0`. + * @param x1 `x` coordinate of the first point. Default 0. + * @param y1 `y` coordinate of the first point. Default 0. + * @param x2 `x` coordinate of the second point. Default 0. + * @param y2 `y` coordinate of the second point. Default 0. + * @param x3 `x` coordinate of the third point. Default 0. + * @param y3 `y` coordinate of the third point. Default 0. + * @returns This Triangle object. + */ + setTo(x1?: number, y1?: number, x2?: number, y2?: number, x3?: number, y3?: number): this; + + /** + * Returns a Line object that corresponds to Line A of this Triangle, running from vertex 1 (`x1`, `y1`) to vertex 2 (`x2`, `y2`). + * @param line A Line object to set the results in. If `undefined` a new Line will be created. + * @returns A Line object that corresponds to line A of this Triangle. + */ + getLineA(line?: O): O; + + /** + * Returns a Line object that corresponds to Line B of this Triangle, running from vertex 2 (`x2`, `y2`) to vertex 3 (`x3`, `y3`). + * @param line A Line object to set the results in. If `undefined` a new Line will be created. + * @returns A Line object that corresponds to line B of this Triangle. + */ + getLineB(line?: O): O; + + /** + * Returns a Line object that corresponds to Line C of this Triangle, running from vertex 3 (`x3`, `y3`) back to vertex 1 (`x1`, `y1`), closing the shape. + * @param line A Line object to set the results in. If `undefined` a new Line will be created. + * @returns A Line object that corresponds to line C of this Triangle. + */ + getLineC(line?: O): O; + + /** + * Left most X coordinate of the triangle. Setting it moves the triangle on the X axis accordingly. + */ + left: number; + + /** + * Right most X coordinate of the triangle. Setting it moves the triangle on the X axis accordingly. + */ + right: number; + + /** + * Top most Y coordinate of the triangle. Setting it moves the triangle on the Y axis accordingly. + */ + top: number; + + /** + * Bottom most Y coordinate of the triangle. Setting it moves the triangle on the Y axis accordingly. + */ + bottom: number; + + } + /** + * @author Richard Davey + * @copyright 2013-2026 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + /** + * @classdesc * A Rectangle is an axis-aligned region of 2D space defined by its top-left corner position (`x`, `y`) and its * dimensions (`width`, `height`). It is one of the core geometric primitives in Phaser and is used extensively * throughout the framework for bounds checking, camera viewports, hit areas, culling regions, and UI layout. - * + * * Rectangles support containment tests, perimeter point sampling, and many other geometric operations available * via the `Phaser.Geom.Rectangle` static methods. The `left`, `right`, `top`, `bottom`, `centerX`, and `centerY` * properties provide convenient access to derived positional values and can be set directly to reposition or * resize the Rectangle. + * + * @memberof Phaser.Geom + * @since 3.0.0 */ class Rectangle { /** - * - * @param x The X coordinate of the top left corner of the Rectangle. Default 0. - * @param y The Y coordinate of the top left corner of the Rectangle. Default 0. - * @param width The width of the Rectangle. Default 0. - * @param height The height of the Rectangle. Default 0. + * The geometry constant type of this object: `GEOM_CONST.RECTANGLE`. + * Used for fast type comparisons. + * + * @readonly + * @since 3.19.0 + */ + readonly type: number; + /** + * The X coordinate of the top left corner of the Rectangle. + * + * @default 0 + * @since 3.0.0 + */ + x: number; + /** + * The Y coordinate of the top left corner of the Rectangle. + * + * @default 0 + * @since 3.0.0 + */ + y: number; + /** + * The width of the Rectangle, i.e. the distance between its left side (defined by `x`) and its right side. + * + * @default 0 + * @since 3.0.0 + */ + width: number; + /** + * The height of the Rectangle, i.e. the distance between its top side (defined by `y`) and its bottom side. + * + * @default 0 + * @since 3.0.0 + */ + height: number; + /** + * @param x - The X coordinate of the top left corner of the Rectangle. + * @param y - The Y coordinate of the top left corner of the Rectangle. + * @param width - The width of the Rectangle. + * @param height - The height of the Rectangle. */ constructor(x?: number, y?: number, width?: number, height?: number); + /** + * Checks if the given point is inside the Rectangle's bounds. + * + * @since 3.0.0 + * + * @param x - The X coordinate of the point to check. + * @param y - The Y coordinate of the point to check. + * + * @returns `true` if the point is within the Rectangle's bounds, otherwise `false`. + */ + contains(x: number, y: number): boolean; + /** + * Calculates the coordinates of a point at a certain `position` on the Rectangle's perimeter. + * + * The `position` is a fraction between 0 and 1 which defines how far into the perimeter the point is. + * + * A value of 0 or 1 returns the point at the top left corner of the rectangle, while a value of 0.5 + * returns the point at the bottom right corner of the rectangle. Values between 0 and 0.5 are on the + * top or the right side and values between 0.5 and 1 are on the bottom or the left side. + * + * @since 3.0.0 + * + * @param position - The normalized distance into the Rectangle's perimeter to return. + * @param output - A Vector2 instance to update with the `x` and `y` coordinates of the point. + * + * @returns The updated `output` object, or a new Vector2 if no `output` object was given. + */ + getPoint(position: number, output?: O): O; + /** + * Returns an array of points from the perimeter of the Rectangle, each spaced out based + * on the quantity or step required. + * + * @since 3.0.0 + * + * @param quantity - The number of points to return. Set to `false` or 0 to return an arbitrary + * number of points (`perimeter / stepRate`) evenly spaced around the Rectangle based on the `stepRate`. + * @param stepRate - If `quantity` is 0, determines the normalized distance between each returned point. + * @param output - An array to which to append the points. + * + * @returns The modified `output` array, or a new array if none was provided. + */ + getPoints(quantity: number | false, stepRate?: number, output?: O): O; + /** + * Returns a random point within the Rectangle's bounds. + * + * @since 3.0.0 + * + * @param vec - The object in which to store the `x` and `y` coordinates of the point. + * + * @returns The updated `vec`, or a new Vector2 if none was provided. + */ + getRandomPoint(vec?: O): O; + /** + * Sets the position, width, and height of the Rectangle. + * + * @since 3.0.0 + * + * @param x - The X coordinate of the top left corner of the Rectangle. + * @param y - The Y coordinate of the top left corner of the Rectangle. + * @param width - The width of the Rectangle. + * @param height - The height of the Rectangle. + * + * @returns This Rectangle object. + */ + setTo(x: number, y: number, width: number, height: number): this; + /** + * Resets the position, width, and height of the Rectangle to 0. + * + * @since 3.0.0 + * + * @returns This Rectangle object. + */ + setEmpty(): this; + /** + * Sets the position of the Rectangle. + * + * @since 3.0.0 + * + * @param x - The X coordinate of the top left corner of the Rectangle. + * @param y - The Y coordinate of the top left corner of the Rectangle. + * + * @returns This Rectangle object. + */ + setPosition(x: number, y?: number): this; + /** + * Sets the width and height of the Rectangle. + * + * @since 3.0.0 + * + * @param width - The width to set the Rectangle to. + * @param height - The height to set the Rectangle to. + * + * @returns This Rectangle object. + */ + setSize(width: number, height?: number): this; + /** + * Determines if the Rectangle is empty. A Rectangle is empty if its width or height is less than or equal to 0. + * + * @since 3.0.0 + * + * @returns `true` if the Rectangle is empty, otherwise `false`. + */ + isEmpty(): boolean; + /** + * Returns a Line object that corresponds to the top of this Rectangle. + * + * @since 3.0.0 + * + * @param line - A Line object to set the results in. If `undefined` a new Line will be created. + * + * @returns A Line object that corresponds to the top of this Rectangle. + */ + getLineA(line?: O): O; + /** + * Returns a Line object that corresponds to the right of this Rectangle. + * + * @since 3.0.0 + * + * @param line - A Line object to set the results in. If `undefined` a new Line will be created. + * + * @returns A Line object that corresponds to the right of this Rectangle. + */ + getLineB(line?: O): O; + /** + * Returns a Line object that corresponds to the bottom of this Rectangle. + * + * @since 3.0.0 + * + * @param line - A Line object to set the results in. If `undefined` a new Line will be created. + * + * @returns A Line object that corresponds to the bottom of this Rectangle. + */ + getLineC(line?: O): O; + /** + * Returns a Line object that corresponds to the left of this Rectangle. + * + * @since 3.0.0 + * + * @param line - A Line object to set the results in. If `undefined` a new Line will be created. + * + * @returns A Line object that corresponds to the left of this Rectangle. + */ + getLineD(line?: O): O; + /** + * The x coordinate of the left of the Rectangle. + * Changing the left property of a Rectangle object has no effect on the y and height properties. + * However it does affect the width property, whereas changing the x value does not affect the width property. + * + * @since 3.0.0 + */ + get left(): number; + set left(value: number); + /** + * The sum of the x and width properties. + * Changing the right property of a Rectangle object has no effect on the x, y and height properties, + * however it does affect the width property. + * + * @since 3.0.0 + */ + get right(): number; + set right(value: number); + /** + * The y coordinate of the top of the Rectangle. Changing the top property of a Rectangle object has no + * effect on the x and width properties. However it does affect the height property, whereas changing + * the y value does not affect the height property. + * + * @since 3.0.0 + */ + get top(): number; + set top(value: number); + /** + * The sum of the y and height properties. + * Changing the bottom property of a Rectangle object has no effect on the x, y and width properties, + * but does change the height property. + * + * @since 3.0.0 + */ + get bottom(): number; + set bottom(value: number); + /** + * The x coordinate of the center of the Rectangle. + * + * @since 3.0.0 + */ + get centerX(): number; + set centerX(value: number); + /** + * The y coordinate of the center of the Rectangle. + * + * @since 3.0.0 + */ + get centerY(): number; + set centerY(value: number); + } + namespace Rectangle { /** * Calculates the area of the given Rectangle object. * @param rect The rectangle to calculate the area of. * @returns The area of the Rectangle object. */ - static Area(rect: Phaser.Geom.Rectangle): number; + function Area(rect: Phaser.Geom.Rectangle): number; /** * Rounds a Rectangle's position up to the smallest integer greater than or equal to each current coordinate. * @param rect The Rectangle to adjust. * @returns The adjusted Rectangle. */ - static Ceil(rect: O): O; + function Ceil(rect: O): O; /** * Rounds a Rectangle's position and size up to the smallest integer greater than or equal to each respective value. * @param rect The Rectangle to modify. * @returns The modified Rectangle. */ - static CeilAll(rect: O): O; + function CeilAll(rect: O): O; /** * Moves the top-left corner of a Rectangle so that its center is at the given coordinates. @@ -76364,23 +72660,14 @@ declare namespace Phaser { * @param y The Y coordinate of the Rectangle's center. * @returns The centered rectangle. */ - static CenterOn(rect: O, x: number, y: number): O; + function CenterOn(rect: O, x: number, y: number): O; /** * Creates a new Rectangle which is identical to the given one. * @param source The Rectangle to clone. * @returns The newly created Rectangle, which is separate from the given one. */ - static Clone(source: Phaser.Geom.Rectangle): Phaser.Geom.Rectangle; - - /** - * Checks if a given point is inside a Rectangle's bounds. - * @param rect The Rectangle to check. - * @param x The X coordinate of the point to check. - * @param y The Y coordinate of the point to check. - * @returns `true` if the point is within the Rectangle's bounds, otherwise `false`. - */ - static Contains(rect: Phaser.Geom.Rectangle, x: number, y: number): boolean; + function Clone(source: Phaser.Geom.Rectangle): Phaser.Geom.Rectangle; /** * Determines whether the specified point is contained within the rectangular region defined by this Rectangle object. @@ -76388,7 +72675,7 @@ declare namespace Phaser { * @param vec The Vector2 object to check the coordinates of. * @returns A value of true if the Rectangle object contains the specified point, otherwise false. */ - static ContainsPoint(rect: Phaser.Geom.Rectangle, vec: Phaser.Math.Vector2): boolean; + function ContainsPoint(rect: Phaser.Geom.Rectangle, vec: Phaser.Math.Vector2): boolean; /** * Tests if one rectangle fully contains another. A rectangle is considered fully contained @@ -76398,7 +72685,7 @@ declare namespace Phaser { * @param rectB The inner rectangle to test for full containment within rectA. * @returns True only if rectA fully contains rectB. */ - static ContainsRect(rectA: Phaser.Geom.Rectangle, rectB: Phaser.Geom.Rectangle): boolean; + function ContainsRect(rectA: Phaser.Geom.Rectangle, rectB: Phaser.Geom.Rectangle): boolean; /** * Copy the values of one Rectangle to a destination Rectangle. @@ -76406,7 +72693,7 @@ declare namespace Phaser { * @param dest The destination Rectangle to copy the values to. * @returns The destination Rectangle. */ - static CopyFrom(source: Phaser.Geom.Rectangle, dest: O): O; + function CopyFrom(source: Phaser.Geom.Rectangle, dest: O): O; /** * Creates an array of plain `{x, y}` point objects for each of the four corners of a Rectangle, in the order: top-left, top-right, bottom-right, bottom-left. @@ -76415,7 +72702,7 @@ declare namespace Phaser { * @param out If provided, each point will be added to this array. * @returns Will return the array you specified or a new array containing the points of the Rectangle. */ - static Decompose(rect: Phaser.Geom.Rectangle, out?: any[]): any[]; + function Decompose(rect: Phaser.Geom.Rectangle, out?: any[]): any[]; /** * Compares the `x`, `y`, `width` and `height` properties of two rectangles. @@ -76426,7 +72713,7 @@ declare namespace Phaser { * @param toCompare The second rectangle to compare against. * @returns `true` if the rectangles' properties are an exact match, otherwise `false`. */ - static Equals(rect: Phaser.Geom.Rectangle, toCompare: Phaser.Geom.Rectangle): boolean; + function Equals(rect: Phaser.Geom.Rectangle, toCompare: Phaser.Geom.Rectangle): boolean; /** * Adjusts the target rectangle, changing its width, height and position, @@ -76438,7 +72725,7 @@ declare namespace Phaser { * @param source The source rectangle to envelop the target in. * @returns The modified target rectangle instance. */ - static FitInside(target: O, source: Phaser.Geom.Rectangle): O; + function FitInside(target: O, source: Phaser.Geom.Rectangle): O; /** * Adjusts the target rectangle, changing its width, height and position, @@ -76450,21 +72737,21 @@ declare namespace Phaser { * @param source The source rectangle to envelope the target in. * @returns The modified target rectangle instance. */ - static FitOutside(target: O, source: Phaser.Geom.Rectangle): O; + function FitOutside(target: O, source: Phaser.Geom.Rectangle): O; /** * Rounds down (floors) the top left X and Y coordinates of the given Rectangle to the largest integer less than or equal to them * @param rect The rectangle to floor the top left X and Y coordinates of * @returns The rectangle that was passed to this function with its coordinates floored. */ - static Floor(rect: O): O; + function Floor(rect: O): O; /** * Rounds a Rectangle's position and size down to the largest integer less than or equal to each current coordinate or dimension. * @param rect The Rectangle to adjust. * @returns The adjusted Rectangle. */ - static FloorAll(rect: O): O; + function FloorAll(rect: O): O; /** * Constructs a new Rectangle or repositions and resizes an existing Rectangle so that all of the given points are on or within its bounds. @@ -76482,7 +72769,7 @@ declare namespace Phaser { * @param out Optional Rectangle to adjust. * @returns The adjusted `out` Rectangle, or a new Rectangle if none was provided. */ - static FromPoints(points: any[], out?: O): O; + function FromPoints(points: any[], out?: O): O; /** * Create the smallest Rectangle containing two coordinate pairs. @@ -76493,14 +72780,14 @@ declare namespace Phaser { * @param out Optional Rectangle to adjust. * @returns The adjusted `out` Rectangle, or a new Rectangle if none was provided. */ - static FromXY(x1: number, y1: number, x2: number, y2: number, out?: O): O; + function FromXY(x1: number, y1: number, x2: number, y2: number, out?: O): O; /** * Calculates the width/height ratio of a rectangle. * @param rect The rectangle. * @returns The width/height ratio of the rectangle. */ - static GetAspectRatio(rect: Phaser.Geom.Rectangle): number; + function GetAspectRatio(rect: Phaser.Geom.Rectangle): number; /** * Returns the center of a Rectangle as a Point. @@ -76508,7 +72795,7 @@ declare namespace Phaser { * @param out Optional Vector2 object to update with the center coordinates. * @returns The modified `out` object, or a new Vector2 if none was provided. */ - static GetCenter(rect: Phaser.Geom.Rectangle, out?: O): O; + function GetCenter(rect: Phaser.Geom.Rectangle, out?: O): O; /** * Calculates the coordinates of a point at a certain `position` on the Rectangle's perimeter. @@ -76521,7 +72808,7 @@ declare namespace Phaser { * @param out A Vector2 object to update with the `x` and `y` coordinates of the point. * @returns The updated `out` object, or a new Vector2 if no `out` object was given. */ - static GetPoint(rectangle: Phaser.Geom.Rectangle, position: number, out?: O): O; + function GetPoint(rectangle: Phaser.Geom.Rectangle, position: number, out?: O): O; /** * Return an array of Vector2 points from the perimeter of the rectangle, each spaced out based on the quantity or step required. @@ -76531,7 +72818,7 @@ declare namespace Phaser { * @param out An optional array to store the points in. * @returns An array of Vector2 points from the perimeter of the rectangle. */ - static GetPoints(rectangle: Phaser.Geom.Rectangle, quantity: number, stepRate: number, out?: O): O; + function GetPoints(rectangle: Phaser.Geom.Rectangle, quantity: number, stepRate: number, out?: O): O; /** * Returns the size of the Rectangle, expressed as a Vector2 object. @@ -76540,7 +72827,7 @@ declare namespace Phaser { * @param out The Vector2 object to store the size in. If not given, a new Vector2 instance is created. * @returns A Vector2 object where `x` holds the width and `y` holds the height of the Rectangle. */ - static GetSize(rect: Phaser.Geom.Rectangle, out?: O): O; + function GetSize(rect: Phaser.Geom.Rectangle, out?: O): O; /** * Increases the size of a Rectangle by a specified amount. @@ -76551,7 +72838,7 @@ declare namespace Phaser { * @param y How many pixels the top and the bottom side should be moved by vertically. * @returns The inflated Rectangle. */ - static Inflate(rect: O, x: number, y: number): O; + function Inflate(rect: O, x: number, y: number): O; /** * Takes two Rectangles and first checks to see if they intersect. @@ -76562,7 +72849,7 @@ declare namespace Phaser { * @param out A Rectangle to store the intersection results in. * @returns The intersection result. If the width and height are zero, no intersection occurred. */ - static Intersection(rectA: Phaser.Geom.Rectangle, rectB: Phaser.Geom.Rectangle, out?: Phaser.Geom.Rectangle): O; + function Intersection(rectA: Phaser.Geom.Rectangle, rectB: Phaser.Geom.Rectangle, out?: Phaser.Geom.Rectangle): O; /** * Returns an array of Vector2 points evenly distributed around the perimeter of the Rectangle. This is @@ -76579,7 +72866,7 @@ declare namespace Phaser { * @param out An array in which the perimeter points will be stored. If not given, a new array instance is created. * @returns An array containing the perimeter points from the Rectangle. */ - static MarchingAnts(rect: Phaser.Geom.Rectangle, step?: number, quantity?: number, out?: O): O; + function MarchingAnts(rect: Phaser.Geom.Rectangle, step?: number, quantity?: number, out?: O): O; /** * Merges a Rectangle with a list of points by repositioning and/or resizing it such that all points are located on or within its bounds. @@ -76587,7 +72874,7 @@ declare namespace Phaser { * @param points An array of Vector2 objects which should be merged with the Rectangle. * @returns The modified Rectangle. */ - static MergePoints(target: O, points: Phaser.Math.Vector2[]): O; + function MergePoints(target: O, points: Phaser.Math.Vector2[]): O; /** * Merges the source rectangle into the target rectangle and returns the target. @@ -76596,7 +72883,7 @@ declare namespace Phaser { * @param source Rectangle that will be merged into target rectangle. * @returns Modified target rectangle that contains source rectangle. */ - static MergeRect(target: O, source: Phaser.Geom.Rectangle): O; + function MergeRect(target: O, source: Phaser.Geom.Rectangle): O; /** * Merges a Rectangle with a point by repositioning and/or resizing it so that the point is on or within its bounds. @@ -76605,7 +72892,7 @@ declare namespace Phaser { * @param y The Y coordinate of the point which should be merged. * @returns The modified `target` Rectangle. */ - static MergeXY(target: O, x: number, y: number): O; + function MergeXY(target: O, x: number, y: number): O; /** * Translates a Rectangle by the given horizontal and vertical amounts, moving its position while preserving its size. @@ -76614,7 +72901,7 @@ declare namespace Phaser { * @param y The distance to move the Rectangle vertically. * @returns The adjusted Rectangle. */ - static Offset(rect: O, x: number, y: number): O; + function Offset(rect: O, x: number, y: number): O; /** * Translates the top-left corner of a Rectangle by the coordinates of a translation vector. @@ -76622,7 +72909,7 @@ declare namespace Phaser { * @param vec The Vector2 point whose coordinates should be used as an offset. * @returns The adjusted Rectangle. */ - static OffsetPoint(rect: O, vec: Phaser.Math.Vector2): O; + function OffsetPoint(rect: O, vec: Phaser.Math.Vector2): O; /** * Checks if two Rectangles overlap. If a Rectangle is within another Rectangle, the two will be considered overlapping. Thus, the Rectangles are treated as "solid". @@ -76630,14 +72917,14 @@ declare namespace Phaser { * @param rectB The second Rectangle to check. * @returns `true` if the two Rectangles overlap, `false` otherwise. */ - static Overlaps(rectA: Phaser.Geom.Rectangle, rectB: Phaser.Geom.Rectangle): boolean; + function Overlaps(rectA: Phaser.Geom.Rectangle, rectB: Phaser.Geom.Rectangle): boolean; /** * Calculates the perimeter of a Rectangle. * @param rect The Rectangle to use. * @returns The perimeter of the Rectangle, equal to `(width * 2) + (height * 2)`. */ - static Perimeter(rect: Phaser.Geom.Rectangle): number; + function Perimeter(rect: Phaser.Geom.Rectangle): number; /** * Returns a point from the perimeter of a Rectangle based on the given angle, measured in degrees from the center of the Rectangle. @@ -76646,7 +72933,7 @@ declare namespace Phaser { * @param out The Vector2 object to store the position in. If not given, a new Vector2 instance is created. * @returns A Vector2 object holding the coordinates of the point on the Rectangle's perimeter. */ - static PerimeterPoint(rectangle: Phaser.Geom.Rectangle, angle: number, out?: O): O; + function PerimeterPoint(rectangle: Phaser.Geom.Rectangle, angle: number, out?: O): O; /** * Returns a random point within a Rectangle. @@ -76654,7 +72941,7 @@ declare namespace Phaser { * @param out The object to update with the point's coordinates. * @returns The modified `out` object, or a new Point if none was provided. */ - static Random(rect: Phaser.Geom.Rectangle, out: O): O; + function Random(rect: Phaser.Geom.Rectangle, out: O): O; /** * Calculates a random point that lies within the `outer` Rectangle, but outside of the `inner` Rectangle. @@ -76665,169 +72952,7 @@ declare namespace Phaser { * @param out A Vector2 object to store the result in. If not specified, a new Vector2 will be created. * @returns A Vector2 object containing the random values in its `x` and `y` properties. */ - static RandomOutside(outer: Phaser.Geom.Rectangle, inner: Phaser.Geom.Rectangle, out?: O): O; - - /** - * The geometry constant type of this object: `GEOM_CONST.RECTANGLE`. - * Used for fast type comparisons. - */ - readonly type: number; - - /** - * The X coordinate of the top left corner of the Rectangle. - */ - x: number; - - /** - * The Y coordinate of the top left corner of the Rectangle. - */ - y: number; - - /** - * The width of the Rectangle, i.e. the distance between its left side (defined by `x`) and its right side. - */ - width: number; - - /** - * The height of the Rectangle, i.e. the distance between its top side (defined by `y`) and its bottom side. - */ - height: number; - - /** - * Checks if the given point is inside the Rectangle's bounds. - * @param x The X coordinate of the point to check. - * @param y The Y coordinate of the point to check. - * @returns `true` if the point is within the Rectangle's bounds, otherwise `false`. - */ - contains(x: number, y: number): boolean; - - /** - * Calculates the coordinates of a point at a certain `position` on the Rectangle's perimeter. - * - * The `position` is a fraction between 0 and 1 which defines how far into the perimeter the point is. - * - * A value of 0 or 1 returns the point at the top left corner of the rectangle, while a value of 0.5 returns the point at the bottom right corner of the rectangle. Values between 0 and 0.5 are on the top or the right side and values between 0.5 and 1 are on the bottom or the left side. - * @param position The normalized distance into the Rectangle's perimeter to return. - * @param output A Vector2 instance to update with the `x` and `y` coordinates of the point. - * @returns The updated `output` object, or a new Vector2 if no `output` object was given. - */ - getPoint(position: number, output?: O): O; - - /** - * Returns an array of points from the perimeter of the Rectangle, each spaced out based on the quantity or step required. - * @param quantity The number of points to return. Set to `false` or 0 to return an arbitrary number of points (`perimeter / stepRate`) evenly spaced around the Rectangle based on the `stepRate`. - * @param stepRate If `quantity` is 0, determines the normalized distance between each returned point. - * @param output An array to which to append the points. - * @returns The modified `output` array, or a new array if none was provided. - */ - getPoints(quantity: number, stepRate?: number, output?: O): O; - - /** - * Returns a random point within the Rectangle's bounds. - * @param vec The object in which to store the `x` and `y` coordinates of the point. - * @returns The updated `vec`, or a new Vector2 if none was provided. - */ - getRandomPoint(vec?: Phaser.Math.Vector2): O; - - /** - * Sets the position, width, and height of the Rectangle. - * @param x The X coordinate of the top left corner of the Rectangle. - * @param y The Y coordinate of the top left corner of the Rectangle. - * @param width The width of the Rectangle. - * @param height The height of the Rectangle. - * @returns This Rectangle object. - */ - setTo(x: number, y: number, width: number, height: number): this; - - /** - * Resets the position, width, and height of the Rectangle to 0.undefined - * @returns This Rectangle object. - */ - setEmpty(): this; - - /** - * Sets the position of the Rectangle. - * @param x The X coordinate of the top left corner of the Rectangle. - * @param y The Y coordinate of the top left corner of the Rectangle. Default x. - * @returns This Rectangle object. - */ - setPosition(x: number, y?: number): this; - - /** - * Sets the width and height of the Rectangle. - * @param width The width to set the Rectangle to. - * @param height The height to set the Rectangle to. Default width. - * @returns This Rectangle object. - */ - setSize(width: number, height?: number): this; - - /** - * Determines if the Rectangle is empty. A Rectangle is empty if its width or height is less than or equal to 0.undefined - * @returns `true` if the Rectangle is empty, otherwise `false`. - */ - isEmpty(): boolean; - - /** - * Returns a Line object that corresponds to the top of this Rectangle. - * @param line A Line object to set the results in. If `undefined` a new Line will be created. - * @returns A Line object that corresponds to the top of this Rectangle. - */ - getLineA(line?: O): O; - - /** - * Returns a Line object that corresponds to the right of this Rectangle. - * @param line A Line object to set the results in. If `undefined` a new Line will be created. - * @returns A Line object that corresponds to the right of this Rectangle. - */ - getLineB(line?: O): O; - - /** - * Returns a Line object that corresponds to the bottom of this Rectangle. - * @param line A Line object to set the results in. If `undefined` a new Line will be created. - * @returns A Line object that corresponds to the bottom of this Rectangle. - */ - getLineC(line?: O): O; - - /** - * Returns a Line object that corresponds to the left of this Rectangle. - * @param line A Line object to set the results in. If `undefined` a new Line will be created. - * @returns A Line object that corresponds to the left of this Rectangle. - */ - getLineD(line?: O): O; - - /** - * The x coordinate of the left of the Rectangle. - * Changing the left property of a Rectangle object has no effect on the y and height properties. However it does affect the width property, whereas changing the x value does not affect the width property. - */ - left: number; - - /** - * The sum of the x and width properties. - * Changing the right property of a Rectangle object has no effect on the x, y and height properties, however it does affect the width property. - */ - right: number; - - /** - * The y coordinate of the top of the Rectangle. Changing the top property of a Rectangle object has no effect on the x and width properties. - * However it does affect the height property, whereas changing the y value does not affect the height property. - */ - top: number; - - /** - * The sum of the y and height properties. - * Changing the bottom property of a Rectangle object has no effect on the x, y and width properties, but does change the height property. - */ - bottom: number; - - /** - * The x coordinate of the center of the Rectangle. - */ - centerX: number; - - /** - * The y coordinate of the center of the Rectangle. - */ - centerY: number; + function RandomOutside(outer: Phaser.Geom.Rectangle, inner: Phaser.Geom.Rectangle, out?: O): O; /** * Determines if the two objects (either Rectangles or Rectangle-like) have the same width and height values under strict equality. @@ -76835,7 +72960,7 @@ declare namespace Phaser { * @param toCompare The second Rectangle object. * @returns `true` if the objects have equivalent values for the `width` and `height` properties, otherwise `false`. */ - static SameDimensions(rect: Phaser.Geom.Rectangle, toCompare: Phaser.Geom.Rectangle): boolean; + function SameDimensions(rect: Phaser.Geom.Rectangle, toCompare: Phaser.Geom.Rectangle): boolean; /** * Scales the width and height of the given Rectangle by the given factors. @@ -76844,7 +72969,7 @@ declare namespace Phaser { * @param y The factor by which to scale the rectangle vertically. If this is not specified, the rectangle will be scaled by the factor `x` in both directions. * @returns The rectangle object with updated `width` and `height` properties as calculated from the scaling factor(s). */ - static Scale(rect: O, x: number, y: number): O; + function Scale(rect: O, x: number, y: number): O; /** * Creates a new Rectangle or repositions and/or resizes an existing Rectangle so that it encompasses the two given Rectangles, i.e. calculates their union. @@ -76853,380 +72978,25 @@ declare namespace Phaser { * @param out The Rectangle to store the union in. * @returns The modified `out` Rectangle, or a new Rectangle if none was provided. */ - static Union(rectA: Phaser.Geom.Rectangle, rectB: Phaser.Geom.Rectangle, out?: O): O; - - } - - /** - * A Triangle is a closed polygon defined by three vertices in 2D space, useful for hit testing, - * defining spawn or trigger regions, and geometric calculations. It is a geometry object only — - * not a Game Object — and cannot be rendered directly. To draw a Triangle to the screen, pass it - * to a Graphics Game Object's `strokeTriangleShape` or `fillTriangleShape` method. - * - * The three vertices are stored as coordinate pairs (`x1`,`y1`), (`x2`,`y2`), and (`x3`,`y3`). - * All coordinates default to `0` if not provided. - */ - class Triangle { - /** - * - * @param x1 `x` coordinate of the first point. Default 0. - * @param y1 `y` coordinate of the first point. Default 0. - * @param x2 `x` coordinate of the second point. Default 0. - * @param y2 `y` coordinate of the second point. Default 0. - * @param x3 `x` coordinate of the third point. Default 0. - * @param y3 `y` coordinate of the third point. Default 0. - */ - constructor(x1?: number, y1?: number, x2?: number, y2?: number, x3?: number, y3?: number); - + function Union(rectA: Phaser.Geom.Rectangle, rectB: Phaser.Geom.Rectangle, out?: O): O; /** - * Returns the area of a Triangle. - * @param triangle The Triangle to use. - * @returns The area of the Triangle, always non-negative. - */ - static Area(triangle: Phaser.Geom.Triangle): number; - - /** - * Builds an equilateral triangle. In the equilateral triangle, all the sides are the same length (congruent) and all the angles are the same size (congruent). - * The x/y specifies the top-middle of the triangle (x1/y1) and length is the length of each side. - * @param x x coordinate of the top point of the triangle. - * @param y y coordinate of the top point of the triangle. - * @param length Length of each side of the triangle. - * @returns A new equilateral Triangle with its apex at (`x`, `y`) and all sides of the specified `length`. + * @author Richard Davey + * @copyright 2013-2026 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} */ - static BuildEquilateral(x: number, y: number, length: number): Phaser.Geom.Triangle; - - /** - * Takes an array of vertex coordinates, and optionally an array of hole indices, then returns an array - * of Triangle instances, where the given vertices have been decomposed into a series of triangles. - * @param data A flat array of vertex coordinates like [x0,y0, x1,y1, x2,y2, ...] - * @param holes An array of hole indices if any (e.g. [5, 8] for a 12-vertex input would mean one hole with vertices 5–7 and another with 8–11). Default null. - * @param scaleX Horizontal scale factor to multiply the resulting points by. Default 1. - * @param scaleY Vertical scale factor to multiply the resulting points by. Default 1. - * @param out An array to store the resulting Triangle instances in. If not provided, a new array is created. - * @returns An array of Triangle instances, where each triangle is based on the decomposed vertices data. - */ - static BuildFromPolygon(data: any[], holes?: any[], scaleX?: number, scaleY?: number, out?: O): O; - - /** - * Builds a right triangle, i.e. one which has a 90-degree angle and two acute angles. The `x` and `y` coordinates mark the position of the right-angle vertex, which becomes the first point of the Triangle. The `width` and `height` values determine the lengths of the two sides adjacent to the right angle and may be positive or negative, which controls the direction in which each side extends from the right-angle vertex. - * @param x The X coordinate of the right angle, which will also be the first X coordinate of the constructed Triangle. - * @param y The Y coordinate of the right angle, which will also be the first Y coordinate of the constructed Triangle. - * @param width The length of the side which is to the left or to the right of the right angle. - * @param height The length of the side which is above or below the right angle. If not given, defaults to the value of `width`. - * @returns The constructed right Triangle. - */ - static BuildRight(x: number, y: number, width: number, height: number): Phaser.Geom.Triangle; - - /** - * Positions the Triangle so that it is centered on the given coordinates. - * @param triangle The triangle to be positioned. - * @param x The horizontal coordinate to center on. - * @param y The vertical coordinate to center on. - * @param centerFunc The function used to center the triangle. Defaults to Centroid centering. - * @returns The Triangle that was centered. - */ - static CenterOn(triangle: O, x: number, y: number, centerFunc?: CenterFunction): O; - - /** - * Calculates the position of a Triangle's centroid, which is also its center of mass (center of gravity). - * - * The centroid is the point in a Triangle at which its three medians (the lines drawn from the vertices to the bisectors of the opposite sides) meet. It divides each one in a 2:1 ratio. - * @param triangle The Triangle to use. - * @param out A Vector2 object to store the coordinates in. - * @returns The `out` object with modified `x` and `y` properties, or a new Vector2 if none was provided. - */ - static Centroid(triangle: Phaser.Geom.Triangle, out?: O): O; - - /** - * Computes the circumcenter of a triangle. The circumcenter is the centre of - * the circumcircle, the unique circle that passes through all three vertices of - * the triangle. It is also the common intersection point of the perpendicular - * bisectors of the sides of the triangle, and is the only point which has equal - * distance to all three vertices of the triangle. - * - * Adapted from http://bjornharrtell.github.io/jsts/doc/api/jsts_geom_Triangle.js.html - * @param triangle The Triangle to get the circumcenter of. - * @param out The Vector2 object to store the position in. If not given, a new Vector2 instance is created. - * @returns A Vector2 object holding the coordinates of the circumcenter of the Triangle. - */ - static CircumCenter(triangle: Phaser.Geom.Triangle, out?: O): O; - /** - * Finds the circumscribed circle (circumcircle) of a Triangle object. The circumcircle is the circle which touches all of the triangle's vertices. - * - * Adapted from https://gist.github.com/mutoo/5617691 - * @param triangle The Triangle to use as input. - * @param out An optional Circle to store the result in. - * @returns The updated `out` Circle, or a new Circle if none was provided. - */ - static CircumCircle(triangle: Phaser.Geom.Triangle, out?: O): O; - - /** - * Clones a Triangle object. - * @param source The Triangle to clone. - * @returns A new Triangle identical to the given one but separate from it. - */ - static Clone(source: Phaser.Geom.Triangle): Phaser.Geom.Triangle; - - /** - * Checks if a point (as a pair of coordinates) is inside a Triangle's bounds. - * @param triangle The Triangle to check. - * @param x The X coordinate of the point to check. - * @param y The Y coordinate of the point to check. - * @returns `true` if the point is inside the Triangle, otherwise `false`. - */ - static Contains(triangle: Phaser.Geom.Triangle, x: number, y: number): boolean; - - /** - * Filters an array of point-like objects to only those contained within a triangle. - * - * If `returnFirst` is true, will return an array containing only the first point in the provided array that is within the triangle (or an empty array if there are no such points). - * @param triangle The triangle that the points are being checked in. - * @param points An array of Vector2 objects to check if they are within the triangle. - * @param returnFirst If `true`, return an array containing only the first point found that is within the triangle. Default false. - * @param out If provided, the points that are within the triangle will be appended to this array instead of being added to a new array. If `returnFirst` is true, only the first point found within the triangle will be appended. This array will also be returned by this function. - * @returns An array containing all the points from `points` that are within the triangle, if an array was provided as `out`, points will be appended to that array and it will also be returned here. - */ - static ContainsArray(triangle: Phaser.Geom.Triangle, points: Phaser.Math.Vector2[], returnFirst?: boolean, out?: any[]): Phaser.Math.Vector2[]; - - /** - * Tests if a triangle contains a point. - * @param triangle The triangle. - * @param vec The Vector2 point to test if it's within the triangle. - * @returns `true` if the point is within the triangle, otherwise `false`. - */ - static ContainsPoint(triangle: Phaser.Geom.Triangle, vec: Phaser.Math.Vector2): boolean; - - /** - * Copy the values of one Triangle to a destination Triangle. - * @param source The source Triangle to copy the values from. - * @param dest The destination Triangle to copy the values to. - * @returns The destination Triangle. - */ - static CopyFrom(source: Phaser.Geom.Triangle, dest: O): O; - - /** - * Decomposes a Triangle into an array of its points. - * @param triangle The Triangle to decompose. - * @param out An array to store the points into. - * @returns The provided `out` array, or a new array if none was provided, with three objects with `x` and `y` properties representing each point of the Triangle appended to it. - */ - static Decompose(triangle: Phaser.Geom.Triangle, out?: any[]): any[]; - - /** - * Returns true if two triangles have the same coordinates. - * @param triangle The first triangle to check. - * @param toCompare The second triangle to check. - * @returns `true` if the two given triangles have the exact same coordinates, otherwise `false`. - */ - static Equals(triangle: Phaser.Geom.Triangle, toCompare: Phaser.Geom.Triangle): boolean; - - /** - * Returns a point along the perimeter of a Triangle as a Vector2, based on a normalized position value. - * - * The `position` parameter is a value between 0 and 1, where 0 and 1 both map to the start of - * line A (the first vertex). The point is calculated by traversing the triangle's perimeter in - * order: line A, then line B, then line C. - * @param triangle The Triangle to get the point on its perimeter from. - * @param position A normalized value between 0 and 1 representing a position along the triangle's perimeter. Both 0 and 1 return the start of line A. - * @param out An optional Vector2 point to store the result in. If not given, a new Vector2 will be created. - * @returns A Vector2 point containing the coordinates of the position on the triangle's perimeter. - */ - static GetPoint(triangle: Phaser.Geom.Triangle, position: number, out?: O): O; - - /** - * Returns an array of evenly spaced points on the perimeter of a Triangle. - * - * The points are placed along the triangle's three edges in order (A, B, then C), - * with their positions calculated proportionally based on the total perimeter length. - * @param triangle The Triangle to get the points from. - * @param quantity The number of evenly spaced points to return. Set to 0 to return an arbitrary number of points based on the `stepRate`. - * @param stepRate If `quantity` is 0, the distance in pixels between each returned point along the perimeter. - * @param out An array to which the points should be appended. - * @returns The modified `out` array, or a new array if none was provided. - */ - static GetPoints(triangle: Phaser.Geom.Triangle, quantity: number, stepRate: number, out?: O): O; - - /** - * Calculates the position of the incenter of a Triangle object. This is the point where its three angle bisectors meet and it's also the center of the incircle, which is the circle inscribed in the triangle. - * @param triangle The Triangle to find the incenter of. - * @param out An optional Vector2 point in which to store the coordinates. - * @returns The incenter of the triangle in a Vector2. - */ - static InCenter(triangle: Phaser.Geom.Triangle, out?: O): O; - - /** - * Moves each point (vertex) of a Triangle by a given offset, thus moving the entire Triangle by that offset. - * @param triangle The Triangle to move. - * @param x The horizontal offset (distance) by which to move each point. Can be positive or negative. - * @param y The vertical offset (distance) by which to move each point. Can be positive or negative. - * @returns The modified Triangle. - */ - static Offset(triangle: O, x: number, y: number): O; - - /** - * Gets the length of the perimeter of the given triangle. - * Calculated by adding together the length of each of the three sides. - * @param triangle The Triangle to get the length from. - * @returns The length of the Triangle. - */ - static Perimeter(triangle: Phaser.Geom.Triangle): number; - - /** - * Returns a random Point from within the area of the given Triangle. - * @param triangle The Triangle to get a random point from. - * @param out The Vector2 point object to store the position in. If not given, a new Vector2 instance is created. - * @returns A Vector2 point object holding the coordinates of a random position within the Triangle. - */ - static Random(triangle: Phaser.Geom.Triangle, out?: O): O; - - /** - * Rotates a Triangle about its incenter, which is the point at which its three angle bisectors meet. - * @param triangle The Triangle to rotate. - * @param angle The angle by which to rotate the Triangle, in radians. - * @returns The rotated Triangle. - */ - static Rotate(triangle: O, angle: number): O; - - /** - * Rotates a Triangle at a certain angle about a given Vector2 point. - * @param triangle The Triangle to rotate. - * @param point The Vector2 point to rotate the Triangle around. - * @param angle The angle by which to rotate the Triangle, in radians. - * @returns The rotated Triangle. - */ - static RotateAroundPoint(triangle: O, point: Phaser.Math.Vector2, angle: number): O; - - /** - * Rotates an entire Triangle at a given angle about a specific point. - * @param triangle The Triangle to rotate. - * @param x The X coordinate of the point to rotate the Triangle about. - * @param y The Y coordinate of the point to rotate the Triangle about. - * @param angle The angle by which to rotate the Triangle, in radians. - * @returns The rotated Triangle. - */ - static RotateAroundXY(triangle: O, x: number, y: number, angle: number): O; - - /** - * The geometry constant type of this object: `GEOM_CONST.TRIANGLE`. - * Used for fast type comparisons. - */ - readonly type: number; - - /** - * `x` coordinate of the first point. - */ - x1: number; - - /** - * `y` coordinate of the first point. - */ - y1: number; - - /** - * `x` coordinate of the second point. - */ - x2: number; - - /** - * `y` coordinate of the second point. - */ - y2: number; - - /** - * `x` coordinate of the third point. - */ - x3: number; - - /** - * `y` coordinate of the third point. - */ - y3: number; - - /** - * Checks whether a given point lies within the triangle. - * @param x The x coordinate of the point to check. - * @param y The y coordinate of the point to check. - * @returns `true` if the coordinate pair is within the triangle, otherwise `false`. - */ - contains(x: number, y: number): boolean; - - /** - * Returns a point at a given normalized position along the perimeter of the triangle. - * @param position Position as float within `0` and `1`. `0` equals the first point. - * @param output Optional Vector2 point that the calculated point will be written to. - * @returns Calculated Vector2 that represents the requested position. It is the same as `output` when this parameter has been given. - */ - getPoint(position: number, output?: O): O; - - /** - * Calculates a list of evenly distributed points along the perimeter of the triangle. Either pass the number of points to generate (`quantity`) or the distance between consecutive points (`stepRate`). - * @param quantity Number of points to be generated. Can be falsey when `stepRate` should be used. All points have the same distance along the triangle. - * @param stepRate Distance between two points. Will only be used when `quantity` is falsey. - * @param output Optional array of Vector2 points for writing the calculated points into. Otherwise a new array will be created. - * @returns Returns a list of calculated `Vector2` instances or the filled array passed as parameter `output`. - */ - getPoints(quantity: number, stepRate?: number, output?: O): O; - - /** - * Returns a random point from within the area of the triangle. - * @param vec Optional Vector2 point that will be modified. Otherwise a new one will be created. - * @returns Random Vector2. When parameter `vec` has been provided it will be returned. - */ - getRandomPoint(vec?: Phaser.Math.Vector2): O; - - /** - * Sets all three points of the triangle. Leaving out any coordinate sets it to be `0`. - * @param x1 `x` coordinate of the first point. Default 0. - * @param y1 `y` coordinate of the first point. Default 0. - * @param x2 `x` coordinate of the second point. Default 0. - * @param y2 `y` coordinate of the second point. Default 0. - * @param x3 `x` coordinate of the third point. Default 0. - * @param y3 `y` coordinate of the third point. Default 0. - * @returns This Triangle object. - */ - setTo(x1?: number, y1?: number, x2?: number, y2?: number, x3?: number, y3?: number): this; - - /** - * Returns a Line object that corresponds to Line A of this Triangle, running from vertex 1 (`x1`, `y1`) to vertex 2 (`x2`, `y2`). - * @param line A Line object to set the results in. If `undefined` a new Line will be created. - * @returns A Line object that corresponds to line A of this Triangle. - */ - getLineA(line?: O): O; - - /** - * Returns a Line object that corresponds to Line B of this Triangle, running from vertex 2 (`x2`, `y2`) to vertex 3 (`x3`, `y3`). - * @param line A Line object to set the results in. If `undefined` a new Line will be created. - * @returns A Line object that corresponds to line B of this Triangle. - */ - getLineB(line?: O): O; - - /** - * Returns a Line object that corresponds to Line C of this Triangle, running from vertex 3 (`x3`, `y3`) back to vertex 1 (`x1`, `y1`), closing the shape. - * @param line A Line object to set the results in. If `undefined` a new Line will be created. - * @returns A Line object that corresponds to line C of this Triangle. - */ - getLineC(line?: O): O; - - /** - * Left most X coordinate of the triangle. Setting it moves the triangle on the X axis accordingly. - */ - left: number; - - /** - * Right most X coordinate of the triangle. Setting it moves the triangle on the X axis accordingly. - */ - right: number; - - /** - * Top most Y coordinate of the triangle. Setting it moves the triangle on the Y axis accordingly. - */ - top: number; - - /** - * Bottom most Y coordinate of the triangle. Setting it moves the triangle on the Y axis accordingly. + * Checks if a given point is inside a Rectangle's bounds. + * + * @function Phaser.Geom.Rectangle.Contains + * @since 3.0.0 + * + * @param rect - The Rectangle to check. + * @param x - The X coordinate of the point to check. + * @param y - The Y coordinate of the point to check. + * + * @returns `true` if the point is within the Rectangle's bounds, otherwise `false`. */ - bottom: number; + function Contains(rect: Phaser.Geom.Rectangle, x: number, y: number): boolean; } @@ -87118,15 +82888,6 @@ declare namespace Phaser { */ function CeilTo(value: number, place?: number, base?: number): number; - /** - * Force a value within the boundaries by clamping it to the range `min`, `max`. - * @param value The value to be clamped. - * @param min The minimum bounds. - * @param max The maximum bounds. - * @returns The clamped value. - */ - function Clamp(value: number, min: number, max: number): number; - /** * Convert the given angle from degrees, to the equivalent angle in radians. * @param degrees The angle (in degrees) to convert to radians. @@ -88461,356 +84222,6 @@ declare namespace Phaser { */ function TransformXY(x: number, y: number, positionX: number, positionY: number, rotation: number, scaleX: number, scaleY: number, output?: Phaser.Types.Math.Vector2Like): Phaser.Types.Math.Vector2Like; - /** - * A representation of a vector in 2D space, defined by an `x` and `y` component. - * - * Vector2 is used throughout Phaser for positions, directions, velocities, and other - * quantities that have both magnitude and direction. It provides methods for common - * vector operations such as addition, subtraction, scaling, normalization, dot and - * cross products, linear interpolation, and rotation. Many Phaser APIs accept a - * `Vector2Like` object (any object with `x` and `y` number properties), making - * Vector2 easy to integrate across the framework. - */ - class Vector2 { - /** - * - * @param x The x component, or an object with `x` and `y` properties. Default 0. - * @param y The y component. Default x. - */ - constructor(x?: number | Phaser.Types.Math.Vector2Like, y?: number); - - /** - * The x component of this Vector. - */ - x: number; - - /** - * The y component of this Vector. - */ - y: number; - - /** - * Make a clone of this Vector2.undefined - * @returns A clone of this Vector2. - */ - clone(): Phaser.Math.Vector2; - - /** - * Copy the components of a given Vector into this Vector. - * @param src The Vector to copy the components from. - * @returns This Vector2. - */ - copy(src: Phaser.Types.Math.Vector2Like): Phaser.Math.Vector2; - - /** - * Set the component values of this Vector from a given Vector2Like object. - * @param obj The object containing the component values to set for this Vector. - * @returns This Vector2. - */ - setFromObject(obj: Phaser.Types.Math.Vector2Like): Phaser.Math.Vector2; - - /** - * Set the `x` and `y` components of this Vector to the given `x` and `y` values. - * @param x The x value to set for this Vector. - * @param y The y value to set for this Vector. Default x. - * @returns This Vector2. - */ - set(x: number, y?: number): Phaser.Math.Vector2; - - /** - * This method is an alias for `Vector2.set`. - * @param x The x value to set for this Vector. - * @param y The y value to set for this Vector. Default x. - * @returns This Vector2. - */ - setTo(x: number, y?: number): Phaser.Math.Vector2; - - /** - * Runs the x and y components of this Vector2 through Math.ceil and then sets them.undefined - * @returns This Vector2. - */ - ceil(): Phaser.Math.Vector2; - - /** - * Runs the x and y components of this Vector2 through Math.floor and then sets them.undefined - * @returns This Vector2. - */ - floor(): Phaser.Math.Vector2; - - /** - * Swaps the x and y components of this Vector2.undefined - * @returns This Vector2. - */ - invert(): Phaser.Math.Vector2; - - /** - * Sets the x and y components of this Vector from the given angle and length. - * @param angle The angle from the positive x-axis, in radians. - * @param length The distance from the origin. Default 1. - * @returns This Vector2. - */ - setToPolar(angle: number, length?: number): Phaser.Math.Vector2; - - /** - * Check whether this Vector is equal to a given Vector. - * - * Performs a strict equality check against each Vector's components. - * @param v The vector to compare with this Vector. - * @returns Whether the given Vector is equal to this Vector. - */ - equals(v: Phaser.Types.Math.Vector2Like): boolean; - - /** - * Check whether this Vector is approximately equal to a given Vector. - * @param v The vector to compare with this Vector. - * @param epsilon The tolerance value. Default 0.0001. - * @returns Whether both absolute differences of the x and y components are smaller than `epsilon`. - */ - fuzzyEquals(v: Phaser.Types.Math.Vector2Like, epsilon?: number): boolean; - - /** - * Calculate the angle between this Vector and the positive x-axis, in radians.undefined - * @returns The angle between this Vector, and the positive x-axis, given in radians. - */ - angle(): number; - - /** - * Set the angle of this Vector. - * @param angle The angle, in radians. - * @returns This Vector2. - */ - setAngle(angle: number): Phaser.Math.Vector2; - - /** - * Add a given Vector to this Vector. Addition is component-wise. - * @param src The Vector to add to this Vector. - * @returns This Vector2. - */ - add(src: Phaser.Types.Math.Vector2Like): Phaser.Math.Vector2; - - /** - * Subtract the given Vector from this Vector. Subtraction is component-wise. - * @param src The Vector to subtract from this Vector. - * @returns This Vector2. - */ - subtract(src: Phaser.Types.Math.Vector2Like): Phaser.Math.Vector2; - - /** - * Perform a component-wise multiplication between this Vector and the given Vector. - * - * Multiplies this Vector by the given Vector. - * @param src The Vector to multiply this Vector by. - * @returns This Vector2. - */ - multiply(src: Phaser.Types.Math.Vector2Like): Phaser.Math.Vector2; - - /** - * Scale this Vector by the given value. - * @param value The value to scale this Vector by. - * @returns This Vector2. - */ - scale(value: number): Phaser.Math.Vector2; - - /** - * Perform a component-wise division between this Vector and the given Vector. - * - * Divides this Vector by the given Vector. - * @param src The Vector to divide this Vector by. - * @returns This Vector2. - */ - divide(src: Phaser.Types.Math.Vector2Like): Phaser.Math.Vector2; - - /** - * Negate the `x` and `y` components of this Vector.undefined - * @returns This Vector2. - */ - negate(): Phaser.Math.Vector2; - - /** - * Calculate the distance between this Vector and the given Vector. - * @param src The Vector to calculate the distance to. - * @returns The distance from this Vector to the given Vector. - */ - distance(src: Phaser.Types.Math.Vector2Like): number; - - /** - * Calculate the distance between this Vector and the given Vector, squared. - * @param src The Vector to calculate the distance to. - * @returns The distance from this Vector to the given Vector, squared. - */ - distanceSq(src: Phaser.Types.Math.Vector2Like): number; - - /** - * Calculate the length (or magnitude) of this Vector.undefined - * @returns The length of this Vector. - */ - length(): number; - - /** - * Set the length (or magnitude) of this Vector. - * @param length The new magnitude of this Vector. - * @returns This Vector2. - */ - setLength(length: number): Phaser.Math.Vector2; - - /** - * Calculate the length of this Vector squared.undefined - * @returns The length of this Vector, squared. - */ - lengthSq(): number; - - /** - * Normalize this Vector. - * - * Makes the vector a unit length vector (magnitude of 1) in the same direction.undefined - * @returns This Vector2. - */ - normalize(): Phaser.Math.Vector2; - - /** - * Rotate this Vector to its perpendicular, in the positive direction.undefined - * @returns This Vector2. - */ - normalizeRightHand(): Phaser.Math.Vector2; - - /** - * Rotate this Vector to its perpendicular, in the negative direction.undefined - * @returns This Vector2. - */ - normalizeLeftHand(): Phaser.Math.Vector2; - - /** - * Calculate the dot product of this Vector and the given Vector. - * @param src The Vector2 to dot product with this Vector2. - * @returns The dot product of this Vector and the given Vector. - */ - dot(src: Phaser.Types.Math.Vector2Like): number; - - /** - * Calculate the cross product of this Vector and the given Vector. - * @param src The Vector2 to cross with this Vector2. - * @returns The cross product of this Vector and the given Vector. - */ - cross(src: Phaser.Types.Math.Vector2Like): number; - - /** - * Linearly interpolate between this Vector and the given Vector. - * - * Interpolates this Vector towards the given Vector. - * @param src The Vector2 to interpolate towards. - * @param t The interpolation percentage, between 0 and 1. Default 0. - * @returns This Vector2. - */ - lerp(src: Phaser.Types.Math.Vector2Like, t?: number): Phaser.Math.Vector2; - - /** - * Transform this Vector with the given Matrix3. - * @param mat The Matrix3 to transform this Vector2 with. - * @returns This Vector2. - */ - transformMat3(mat: Phaser.Math.Matrix3): Phaser.Math.Vector2; - - /** - * Transform this Vector with the given Matrix4. - * @param mat The Matrix4 to transform this Vector2 with. - * @returns This Vector2. - */ - transformMat4(mat: Phaser.Math.Matrix4): Phaser.Math.Vector2; - - /** - * Make this Vector the zero vector (0, 0).undefined - * @returns This Vector2. - */ - reset(): Phaser.Math.Vector2; - - /** - * Limit the length (or magnitude) of this Vector. - * @param max The maximum length. - * @returns This Vector2. - */ - limit(max: number): Phaser.Math.Vector2; - - /** - * Reflect this Vector off a line defined by a normal. - * @param normal A vector perpendicular to the line. - * @returns This Vector2. - */ - reflect(normal: Phaser.Math.Vector2): Phaser.Math.Vector2; - - /** - * Reflect this Vector across another. - * @param axis A vector to reflect across. - * @returns This Vector2. - */ - mirror(axis: Phaser.Math.Vector2): Phaser.Math.Vector2; - - /** - * Rotate this Vector by an angle amount. - * @param delta The angle to rotate by, in radians. - * @returns This Vector2. - */ - rotate(delta: number): Phaser.Math.Vector2; - - /** - * Project this Vector onto another. - * @param src The vector to project onto. - * @returns This Vector2. - */ - project(src: Phaser.Math.Vector2): Phaser.Math.Vector2; - - /** - * Calculates the vector projection of this Vector2 onto the non-zero `vecB`. This is the - * orthogonal projection of this vector onto a straight line parallel to `vecB`. - * @param vecB The vector to project onto. - * @param out The Vector2 object to store the position in. If not given, a new Vector2 instance is created. - * @returns The `out` Vector2 containing the projected values. - */ - projectUnit(vecB: Phaser.Math.Vector2, out?: Phaser.Math.Vector2): Phaser.Math.Vector2; - - /** - * A static zero Vector2 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - */ - static readonly ZERO: Phaser.Math.Vector2; - - /** - * A static right Vector2 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - */ - static readonly RIGHT: Phaser.Math.Vector2; - - /** - * A static left Vector2 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - */ - static readonly LEFT: Phaser.Math.Vector2; - - /** - * A static up Vector2 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - */ - static readonly UP: Phaser.Math.Vector2; - - /** - * A static down Vector2 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - */ - static readonly DOWN: Phaser.Math.Vector2; - - /** - * A static one Vector2 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - */ - static readonly ONE: Phaser.Math.Vector2; - - } - /** * A Vector3 is a mathematical object representing a point or direction in 3D space, * defined by three components: `x`, `y`, and `z`. @@ -89417,20 +84828,6 @@ declare namespace Phaser { */ function Within(a: number, b: number, tolerance: number): boolean; - /** - * Wrap the given `value` between `min` (inclusive) and `max` (exclusive). - * - * When the value exceeds `max` it wraps back around to `min`, and when it falls - * below `min` it wraps around to just below `max`. This is useful for cycling - * through a range, such as keeping an angle within 0–360 degrees or looping a - * tile index within a tileset. - * @param value The value to wrap. - * @param min The minimum bound of the range (inclusive). - * @param max The maximum bound of the range (exclusive). - * @returns The wrapped value, guaranteed to be within `[min, max)`. - */ - function Wrap(value: number, min: number, max: number): number; - namespace Angle { /** * Find the angle of a segment from (x1, y1) -> (x2, y2). @@ -90083,17 +85480,6 @@ declare namespace Phaser { */ function Ceil(value: number, epsilon?: number): number; - /** - * Check whether the given values are fuzzily equal. - * - * Two numbers are fuzzily equal if their difference is less than `epsilon`. - * @param a The first value. - * @param b The second value. - * @param epsilon The maximum absolute difference below which the two values are considered equal. Default 0.0001. - * @returns `true` if the values are fuzzily equal, otherwise `false`. - */ - function Equal(a: number, b: number, epsilon?: number): boolean; - /** * Calculates the fuzzy floor of the given value by adding a small epsilon before * flooring. This avoids floating-point precision issues where a value that should @@ -90126,6 +85512,25 @@ declare namespace Phaser { * @returns `true` if `a` is fuzzily less than `b`, otherwise `false`. */ function LessThan(a: number, b: number, epsilon?: number): boolean; + /** + * @author Richard Davey + * @copyright 2013-2026 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + /** + * Check whether the given values are fuzzily equal. + * + * Two numbers are fuzzily equal if their difference is less than `epsilon`. + * + * @function Phaser.Math.Fuzzy.Equal + * @since 3.0.0 + * + * @param a - The first value. + * @param b - The second value. + * @param epsilon - The maximum absolute difference below which the two values are considered equal. + * @returns `true` if the values are fuzzily equal, otherwise `false`. + */ + function Equal(a: number, b: number, epsilon?: number): boolean; } @@ -90458,6 +85863,496 @@ declare namespace Phaser { function To(value: number, gap: number, start?: number, divide?: boolean): number; } + /** + * @author Richard Davey + * @copyright 2013-2026 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + /** + * Force a value within the boundaries by clamping it to the range `min`, `max`. + * + * @function Phaser.Math.Clamp + * @since 3.0.0 + * + * @param value - The value to be clamped. + * @param min - The minimum bounds. + * @param max - The maximum bounds. + * @returns The clamped value. + */ + function Clamp(value: number, min: number, max: number): number; + + /** + * @classdesc + * A representation of a vector in 2D space, defined by an `x` and `y` component. + * + * Vector2 is used throughout Phaser for positions, directions, velocities, and other + * quantities that have both magnitude and direction. It provides methods for common + * vector operations such as addition, subtraction, scaling, normalization, dot and + * cross products, linear interpolation, and rotation. Many Phaser APIs accept a + * `Vector2Like` object (any object with `x` and `y` number properties), making + * Vector2 easy to integrate across the framework. + * + * @memberof Phaser.Math + * @since 3.0.0 + */ + class Vector2 { + /** + * The x component of this Vector. + * + * @default 0 + * @since 3.0.0 + */ + x: number; + /** + * The y component of this Vector. + * + * @default 0 + * @since 3.0.0 + */ + y: number; + /** + * @param x - The x component, or an object with `x` and `y` properties. + * @param y - The y component. + */ + constructor(x?: number | Phaser.Types.Math.Vector2Like, y?: number); + /** + * Make a clone of this Vector2. + * + * @since 3.0.0 + * + * @returns A clone of this Vector2. + */ + clone(): Vector2; + /** + * Copy the components of a given Vector into this Vector. + * + * @since 3.0.0 + * + * @param src - The Vector to copy the components from. + * @returns This Vector2. + */ + copy(src: Phaser.Types.Math.Vector2Like): this; + /** + * Set the component values of this Vector from a given Vector2Like object. + * + * @since 3.0.0 + * + * @param obj - The object containing the component values to set for this Vector. + * @returns This Vector2. + */ + setFromObject(obj: Phaser.Types.Math.Vector2Like): this; + /** + * Set the `x` and `y` components of this Vector to the given `x` and `y` values. + * + * @since 3.0.0 + * + * @param x - The x value to set for this Vector. + * @param y - The y value to set for this Vector. + * @returns This Vector2. + */ + set(x: number, y?: number): this; + /** + * This method is an alias for `Vector2.set`. + * + * @since 3.4.0 + * + * @param x - The x value to set for this Vector. + * @param y - The y value to set for this Vector. + * @returns This Vector2. + */ + setTo(x: number, y?: number): this; + /** + * Runs the x and y components of this Vector2 through Math.ceil and then sets them. + * + * @since 4.0.0 + * + * @returns This Vector2. + */ + ceil(): this; + /** + * Runs the x and y components of this Vector2 through Math.floor and then sets them. + * + * @since 4.0.0 + * + * @returns This Vector2. + */ + floor(): this; + /** + * Swaps the x and y components of this Vector2. + * + * @since 4.0.0 + * + * @returns This Vector2. + */ + invert(): this; + /** + * Sets the x and y components of this Vector from the given angle and length. + * + * @since 3.0.0 + * + * @param angle - The angle from the positive x-axis, in radians. + * @param length - The distance from the origin. + * @returns This Vector2. + */ + setToPolar(angle: number, length?: number | null): this; + /** + * Check whether this Vector is equal to a given Vector. + * + * Performs a strict equality check against each Vector's components. + * + * @since 3.0.0 + * + * @param v - The vector to compare with this Vector. + * @returns Whether the given Vector is equal to this Vector. + */ + equals(v: Phaser.Types.Math.Vector2Like): boolean; + /** + * Check whether this Vector is approximately equal to a given Vector. + * + * @since 3.23.0 + * + * @param v - The vector to compare with this Vector. + * @param epsilon - The tolerance value. + * @returns Whether both absolute differences of the x and y components are smaller than `epsilon`. + */ + fuzzyEquals(v: Phaser.Types.Math.Vector2Like, epsilon?: number): boolean; + /** + * Calculate the angle between this Vector and the positive x-axis, in radians. + * + * @since 3.0.0 + * + * @returns The angle between this Vector, and the positive x-axis, given in radians. + */ + angle(): number; + /** + * Set the angle of this Vector. + * + * @since 3.23.0 + * + * @param angle - The angle, in radians. + * @returns This Vector2. + */ + setAngle(angle: number): this; + /** + * Add a given Vector to this Vector. Addition is component-wise. + * + * @since 3.0.0 + * + * @param src - The Vector to add to this Vector. + * @returns This Vector2. + */ + add(src: Phaser.Types.Math.Vector2Like): this; + /** + * Subtract the given Vector from this Vector. Subtraction is component-wise. + * + * @since 3.0.0 + * + * @param src - The Vector to subtract from this Vector. + * @returns This Vector2. + */ + subtract(src: Phaser.Types.Math.Vector2Like): this; + /** + * Perform a component-wise multiplication between this Vector and the given Vector. + * + * Multiplies this Vector by the given Vector. + * + * @since 3.0.0 + * + * @param src - The Vector to multiply this Vector by. + * @returns This Vector2. + */ + multiply(src: Phaser.Types.Math.Vector2Like): this; + /** + * Scale this Vector by the given value. + * + * @since 3.0.0 + * + * @param value - The value to scale this Vector by. + * @returns This Vector2. + */ + scale(value: number): this; + /** + * Perform a component-wise division between this Vector and the given Vector. + * + * Divides this Vector by the given Vector. + * + * @since 3.0.0 + * + * @param src - The Vector to divide this Vector by. + * @returns This Vector2. + */ + divide(src: Phaser.Types.Math.Vector2Like): this; + /** + * Negate the `x` and `y` components of this Vector. + * + * @since 3.0.0 + * + * @returns This Vector2. + */ + negate(): this; + /** + * Calculate the distance between this Vector and the given Vector. + * + * @since 3.0.0 + * + * @param src - The Vector to calculate the distance to. + * @returns The distance from this Vector to the given Vector. + */ + distance(src: Phaser.Types.Math.Vector2Like): number; + /** + * Calculate the distance between this Vector and the given Vector, squared. + * + * @since 3.0.0 + * + * @param src - The Vector to calculate the distance to. + * @returns The distance from this Vector to the given Vector, squared. + */ + distanceSq(src: Phaser.Types.Math.Vector2Like): number; + /** + * Calculate the length (or magnitude) of this Vector. + * + * @since 3.0.0 + * + * @returns The length of this Vector. + */ + length(): number; + /** + * Set the length (or magnitude) of this Vector. + * + * @since 3.23.0 + * + * @param length - The new magnitude of this Vector. + * @returns This Vector2. + */ + setLength(length: number): this; + /** + * Calculate the length of this Vector squared. + * + * @since 3.0.0 + * + * @returns The length of this Vector, squared. + */ + lengthSq(): number; + /** + * Normalize this Vector. + * + * Makes the vector a unit length vector (magnitude of 1) in the same direction. + * + * @since 3.0.0 + * + * @returns This Vector2. + */ + normalize(): this; + /** + * Rotate this Vector to its perpendicular, in the positive direction. + * + * @since 3.0.0 + * + * @returns This Vector2. + */ + normalizeRightHand(): this; + /** + * Rotate this Vector to its perpendicular, in the negative direction. + * + * @since 3.23.0 + * + * @returns This Vector2. + */ + normalizeLeftHand(): this; + /** + * Calculate the dot product of this Vector and the given Vector. + * + * @since 3.0.0 + * + * @param src - The Vector2 to dot product with this Vector2. + * @returns The dot product of this Vector and the given Vector. + */ + dot(src: Phaser.Types.Math.Vector2Like): number; + /** + * Calculate the cross product of this Vector and the given Vector. + * + * @since 3.0.0 + * + * @param src - The Vector2 to cross with this Vector2. + * @returns The cross product of this Vector and the given Vector. + */ + cross(src: Phaser.Types.Math.Vector2Like): number; + /** + * Linearly interpolate between this Vector and the given Vector. + * + * Interpolates this Vector towards the given Vector. + * + * @since 3.0.0 + * + * @param src - The Vector2 to interpolate towards. + * @param t - The interpolation percentage, between 0 and 1. + * @returns This Vector2. + */ + lerp(src: Phaser.Types.Math.Vector2Like, t?: number): this; + /** + * Transform this Vector with the given Matrix3. + * + * @since 3.0.0 + * + * @param mat - The Matrix3 to transform this Vector2 with. + * @returns This Vector2. + */ + transformMat3(mat: { + val: Float32Array | number[]; + }): this; + /** + * Transform this Vector with the given Matrix4. + * + * @since 3.0.0 + * + * @param mat - The Matrix4 to transform this Vector2 with. + * @returns This Vector2. + */ + transformMat4(mat: { + val: Float32Array | number[]; + }): this; + /** + * Make this Vector the zero vector (0, 0). + * + * @since 3.0.0 + * + * @returns This Vector2. + */ + reset(): this; + /** + * Limit the length (or magnitude) of this Vector. + * + * @since 3.23.0 + * + * @param max - The maximum length. + * @returns This Vector2. + */ + limit(max: number): this; + /** + * Reflect this Vector off a line defined by a normal. + * + * @since 3.23.0 + * + * @param normal - A vector perpendicular to the line. + * @returns This Vector2. + */ + reflect(normal: Vector2): this; + /** + * Reflect this Vector across another. + * + * @since 3.23.0 + * + * @param axis - A vector to reflect across. + * @returns This Vector2. + */ + mirror(axis: Vector2): this; + /** + * Rotate this Vector by an angle amount. + * + * @since 3.23.0 + * + * @param delta - The angle to rotate by, in radians. + * @returns This Vector2. + */ + rotate(delta: number): this; + /** + * Project this Vector onto another. + * + * @since 3.60.0 + * + * @param src - The vector to project onto. + * @returns This Vector2. + */ + project(src: Vector2): this; + /** + * Calculates the vector projection of this Vector2 onto the non-zero `vecB`. This is the + * orthogonal projection of this vector onto a straight line parallel to `vecB`. + * + * @since 4.0.0 + * + * @param vecB - The vector to project onto. + * @param out - The Vector2 object to store the position in. If not given, a new Vector2 instance is created. + * @returns The `out` Vector2 containing the projected values. + */ + projectUnit(vecB: Vector2, out?: Vector2): Vector2; + /** + * A static zero Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @since 3.1.0 + */ + static readonly ZERO: Vector2; + /** + * A static right Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @since 3.16.0 + */ + static readonly RIGHT: Vector2; + /** + * A static left Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @since 3.16.0 + */ + static readonly LEFT: Vector2; + /** + * A static up Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @since 3.16.0 + */ + static readonly UP: Vector2; + /** + * A static down Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @since 3.16.0 + */ + static readonly DOWN: Vector2; + /** + * A static one Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @since 3.16.0 + */ + static readonly ONE: Vector2; + } + + /** + * @author Richard Davey + * @copyright 2013-2026 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + /** + * Wrap the given `value` between `min` (inclusive) and `max` (exclusive). + * + * When the value exceeds `max` it wraps back around to `min`, and when it falls + * below `min` it wraps around to just below `max`. This is useful for cycling + * through a range, such as keeping an angle within 0-360 degrees or looping a + * tile index within a tileset. + * + * @function Phaser.Math.Wrap + * @since 3.0.0 + * + * @param value - The value to wrap. + * @param min - The minimum bound of the range (inclusive). + * @param max - The maximum bound of the range (exclusive). + * @returns The wrapped value, guaranteed to be within `[min, max)`. + */ + function Wrap(value: number, min: number, max: number): number; } @@ -95316,8 +91211,6 @@ declare namespace Phaser { stopPropagation: Function; }; - type HitAreaCallback = (hitArea: any, x: number, y: number, gameObject: Phaser.GameObjects.GameObject)=>boolean; - type InputConfiguration = { /** * The object / shape to use as the Hit Area. If not given it will try to create a Rectangle based on the texture frame. @@ -95450,6 +91343,18 @@ declare namespace Phaser { */ dragY: number; }; + /** + * @callback Phaser.Types.Input.HitAreaCallback + * @since 3.0.0 + * + * @param hitArea - The hit area object. + * @param x - The translated x coordinate of the hit test event. + * @param y - The translated y coordinate of the hit test event. + * @param gameObject - The Game Object that invoked the hit test. + * + * @return `true` if the coordinates fall within the space of the hitArea, otherwise `false`. + */ + type HitAreaCallback = (hitArea: T, x: number, y: number, gameObject: Phaser.GameObjects.GameObject) => boolean; } @@ -101432,79 +97337,6 @@ declare namespace Phaser { */ setBlendMode(value: string | Phaser.BlendModes | number): this; - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - * @returns This Game Object instance. - */ - setDepth(value: number): this; - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToTop(): this; - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToBack(): this; - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be above. - * @returns This Game Object instance. - */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be below. - * @returns This Game Object instance. - */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; - /** * The horizontally flipped state of the Game Object. * @@ -102466,22 +98298,6 @@ declare namespace Phaser { */ getParentRotation(): number; - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. - */ - setVisible(value: boolean): this; - /** * Sets the body's horizontal and vertical acceleration. If the vertical acceleration value is not provided, the vertical acceleration is set to the same value as the horizontal acceleration. * @param x The horizontal acceleration, in pixels per second squared. @@ -103639,79 +99455,6 @@ declare namespace Phaser { */ setBlendMode(value: string | Phaser.BlendModes | number): this; - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - * @returns This Game Object instance. - */ - setDepth(value: number): this; - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToTop(): this; - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToBack(): this; - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be above. - * @returns This Game Object instance. - */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be below. - * @returns This Game Object instance. - */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; - /** * The horizontally flipped state of the Game Object. * @@ -104673,22 +100416,6 @@ declare namespace Phaser { */ getParentRotation(): number; - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. - */ - setVisible(value: boolean): this; - /** * Sets the body's horizontal and vertical acceleration. If the vertical acceleration value is not provided, the vertical acceleration is set to the same value as the horizontal acceleration. * @param x The horizontal acceleration, in pixels per second squared. @@ -108803,6 +104530,24 @@ declare namespace Phaser { } + interface Image extends Phaser.Physics.Arcade.Components.Acceleration, Phaser.Physics.Arcade.Components.Angular, Phaser.Physics.Arcade.Components.Bounce, Phaser.Physics.Arcade.Components.Collision, Phaser.Physics.Arcade.Components.Debug, Phaser.Physics.Arcade.Components.Drag, Phaser.Physics.Arcade.Components.Enable, Phaser.Physics.Arcade.Components.Friction, Phaser.Physics.Arcade.Components.Gravity, Phaser.Physics.Arcade.Components.Immovable, Phaser.Physics.Arcade.Components.Mass, Phaser.Physics.Arcade.Components.Pushable, Phaser.Physics.Arcade.Components.Size, Phaser.Physics.Arcade.Components.Velocity, Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + } + + interface Sprite extends Phaser.Physics.Arcade.Components.Acceleration, Phaser.Physics.Arcade.Components.Angular, Phaser.Physics.Arcade.Components.Bounce, Phaser.Physics.Arcade.Components.Collision, Phaser.Physics.Arcade.Components.Debug, Phaser.Physics.Arcade.Components.Drag, Phaser.Physics.Arcade.Components.Enable, Phaser.Physics.Arcade.Components.Friction, Phaser.Physics.Arcade.Components.Gravity, Phaser.Physics.Arcade.Components.Immovable, Phaser.Physics.Arcade.Components.Mass, Phaser.Physics.Arcade.Components.Pushable, Phaser.Physics.Arcade.Components.Size, Phaser.Physics.Arcade.Components.Velocity, Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + } + + interface Body extends Phaser.Physics.Arcade.Components.Collision { + } + + interface Group extends Phaser.Physics.Arcade.Components.Collision { + } + + interface StaticBody extends Phaser.Physics.Arcade.Components.Collision { + } + + interface StaticGroup extends Phaser.Physics.Arcade.Components.Collision { + } + } namespace Matter { @@ -109840,79 +105585,6 @@ declare namespace Phaser { */ setBlendMode(value: string | Phaser.BlendModes | number): this; - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - * @returns This Game Object instance. - */ - setDepth(value: number): this; - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToTop(): this; - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToBack(): this; - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be above. - * @returns This Game Object instance. - */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be below. - * @returns This Game Object instance. - */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; - /** * The horizontally flipped state of the Game Object. * @@ -110874,22 +106546,6 @@ declare namespace Phaser { */ getParentRotation(): number; - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. - */ - setVisible(value: boolean): this; - /** * Sets the restitution (bounciness) of this Game Object's Matter.js physics body. * This controls how much of the body's kinetic energy is preserved after a collision. @@ -112208,79 +107864,6 @@ declare namespace Phaser { */ setBlendMode(value: string | Phaser.BlendModes | number): this; - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - * @returns This Game Object instance. - */ - setDepth(value: number): this; - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToTop(): this; - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToBack(): this; - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be above. - * @returns This Game Object instance. - */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be below. - * @returns This Game Object instance. - */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; - /** * The horizontally flipped state of the Game Object. * @@ -113242,22 +108825,6 @@ declare namespace Phaser { */ getParentRotation(): number; - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. - */ - setVisible(value: boolean): this; - /** * Sets the restitution (bounciness) of this Game Object's Matter.js physics body. * This controls how much of the body's kinetic energy is preserved after a collision. @@ -115602,6 +111169,15 @@ declare namespace Phaser { } + interface Image extends Phaser.Physics.Matter.Components.Bounce, Phaser.Physics.Matter.Components.Collision, Phaser.Physics.Matter.Components.Force, Phaser.Physics.Matter.Components.Friction, Phaser.Physics.Matter.Components.Gravity, Phaser.Physics.Matter.Components.Mass, Phaser.Physics.Matter.Components.Sensor, Phaser.Physics.Matter.Components.SetBody, Phaser.Physics.Matter.Components.Sleep, Phaser.Physics.Matter.Components.Static, Phaser.Physics.Matter.Components.Transform, Phaser.Physics.Matter.Components.Velocity, Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + } + + interface Sprite extends Phaser.Physics.Matter.Components.Bounce, Phaser.Physics.Matter.Components.Collision, Phaser.Physics.Matter.Components.Force, Phaser.Physics.Matter.Components.Friction, Phaser.Physics.Matter.Components.Gravity, Phaser.Physics.Matter.Components.Mass, Phaser.Physics.Matter.Components.Sensor, Phaser.Physics.Matter.Components.SetBody, Phaser.Physics.Matter.Components.Sleep, Phaser.Physics.Matter.Components.Static, Phaser.Physics.Matter.Components.Transform, Phaser.Physics.Matter.Components.Velocity, Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + } + + interface TileBody extends Phaser.Physics.Matter.Components.Bounce, Phaser.Physics.Matter.Components.Collision, Phaser.Physics.Matter.Components.Friction, Phaser.Physics.Matter.Components.Gravity, Phaser.Physics.Matter.Components.Mass, Phaser.Physics.Matter.Components.Sensor, Phaser.Physics.Matter.Components.Sleep, Phaser.Physics.Matter.Components.Static { + } + } } @@ -128081,135 +123657,6 @@ declare namespace Phaser { } - /** - * A custom Map implementation that stores entries as key-value pairs with ordered iteration. - * Unlike a native JavaScript Map, it also maintains an internal array of entries for efficient - * indexed access and iteration. Supports filtering, merging, and contains/size operations. - * Used internally by various Phaser systems for managing collections. - * - * ```javascript - * var map = new Map([ - * [ 1, 'one' ], - * [ 2, 'two' ], - * [ 3, 'three' ] - * ]); - * ``` - */ - class Map { - /** - * - * @param elements An optional array of key-value pairs to populate this Map with. - */ - constructor(elements: V[]); - - /** - * The entries in this Map. - */ - entries: {[key: string]: V}; - - /** - * The number of key / value pairs in this Map. - */ - size: number; - - /** - * Adds all the elements in the given array to this Map. - * - * If the key already exists, the value will be replaced. - * @param elements An array of key-value pairs to populate this Map with. - * @returns This Map object. - */ - setAll(elements: V[]): this; - - /** - * Adds an element with a specified `key` and `value` to this Map. - * - * If the `key` already exists, the value will be replaced. - * - * If you wish to add multiple elements in a single call, use the `setAll` method instead. - * @param key The key of the element to be added to this Map. - * @param value The value of the element to be added to this Map. - * @returns This Map object. - */ - set(key: K, value: V): Phaser.Structs.Map; - - /** - * Returns the value associated to the `key`, or `undefined` if there is none. - * @param key The key of the element to return from the `Map` object. - * @returns The element associated with the specified key or `undefined` if the key can't be found in this Map object. - */ - get(key: K): V; - - /** - * Returns an `Array` of all the values stored in this Map.undefined - * @returns An array of the values stored in this Map. - */ - getArray(): V[]; - - /** - * Returns a boolean indicating whether an element with the specified key exists or not. - * @param key The key of the element to test for presence of in this Map. - * @returns Returns `true` if an element with the specified key exists in this Map, otherwise `false`. - */ - has(key: K): boolean; - - /** - * Delete the specified element from this Map. - * @param key The key of the element to delete from this Map. - * @returns This Map object. - */ - delete(key: K): Phaser.Structs.Map; - - /** - * Delete all entries from this Map.undefined - * @returns This Map object. - */ - clear(): Phaser.Structs.Map; - - /** - * Returns an array of all entry keys in this Map.undefined - * @returns Array containing entries' keys. - */ - keys(): K[]; - - /** - * Returns an `Array` of all values stored in this Map.undefined - * @returns An `Array` of values. - */ - values(): V[]; - - /** - * Dumps the contents of this Map to the console via `console.group`. - */ - dump(): void; - - /** - * Iterates through all entries in this Map, passing each one to the given callback. - * - * If the callback returns `false`, the iteration will break. - * @param callback The callback which will receive the keys and entries held in this Map. - * @returns This Map object. - */ - each(callback: EachMapCallback): Phaser.Structs.Map; - - /** - * Returns `true` if the value exists within this Map. Otherwise, returns `false`. - * @param value The value to search for. - * @returns `true` if the value is found, otherwise `false`. - */ - contains(value: V): boolean; - - /** - * Merges all new keys from the given Map into this one. - * If it encounters a key that already exists it will be skipped unless override is set to `true`. - * @param map The Map to merge in to this Map. - * @param override Set to `true` to replace values in this Map with those from the source map, or `false` to skip them. Default false. - * @returns This Map object. - */ - merge(map: Phaser.Structs.Map, override?: boolean): Phaser.Structs.Map; - - } - /** * A Process Queue maintains three internal lists. * @@ -128803,6 +124250,165 @@ declare namespace Phaser { const PROCESS_QUEUE_REMOVE: string; } + /** + * @classdesc + * A custom Map implementation that stores entries as key-value pairs with ordered iteration. + * Unlike a native JavaScript Map, it also maintains an internal object of entries for efficient + * keyed access and iteration. Supports filtering, merging, and contains/size operations. + * Used internally by various Phaser systems for managing collections. + * + * ```javascript + * var map = new Map([ + * [ 1, 'one' ], + * [ 2, 'two' ], + * [ 3, 'three' ] + * ]); + * ``` + * + * @memberof Phaser.Structs + * @since 3.0.0 + */ + class Map { + /** + * The entries in this Map. + * + * @default {} + * @since 3.0.0 + */ + entries: Record; + /** + * The number of key / value pairs in this Map. + * + * @default 0 + * @since 3.0.0 + */ + size: number; + /** + * @param elements - An optional array of key-value pairs to populate this Map with. + */ + constructor(elements?: Array<[K, V]> | null); + /** + * Adds all the elements in the given array to this Map. + * + * If the key already exists, the value will be replaced. + * + * @since 3.70.0 + * + * @param elements - An array of key-value pairs to populate this Map with. + * @returns This Map object. + */ + setAll(elements?: Array<[K, V]> | null): this; + /** + * Adds an element with a specified `key` and `value` to this Map. + * + * If the `key` already exists, the value will be replaced. + * + * If you wish to add multiple elements in a single call, use the `setAll` method instead. + * + * @since 3.0.0 + * + * @param key - The key of the element to be added to this Map. + * @param value - The value of the element to be added to this Map. + * @returns This Map object. + */ + set(key: K, value: V): this; + /** + * Returns the value associated to the `key`, or `undefined` if there is none. + * + * @since 3.0.0 + * + * @param key - The key of the element to return from the `Map` object. + * @returns The element associated with the specified key or `undefined` if the key can't be found in this Map object. + */ + get(key: K): V | undefined; + /** + * Returns an `Array` of all the values stored in this Map. + * + * @since 3.0.0 + * + * @returns An array of the values stored in this Map. + */ + getArray(): V[]; + /** + * Returns a boolean indicating whether an element with the specified key exists or not. + * + * @since 3.0.0 + * + * @param key - The key of the element to test for presence of in this Map. + * @returns Returns `true` if an element with the specified key exists in this Map, otherwise `false`. + */ + has(key: K): boolean; + /** + * Delete the specified element from this Map. + * + * @since 3.0.0 + * + * @param key - The key of the element to delete from this Map. + * @returns This Map object. + */ + delete(key: K): this; + /** + * Delete all entries from this Map. + * + * @since 3.0.0 + * + * @returns This Map object. + */ + clear(): this; + /** + * Returns an array of all entry keys in this Map. + * + * @since 3.0.0 + * + * @returns Array containing entries' keys. + */ + keys(): K[]; + /** + * Returns an `Array` of all values stored in this Map. + * + * @since 3.0.0 + * + * @returns An `Array` of values. + */ + values(): V[]; + /** + * Dumps the contents of this Map to the console via `console.group`. + * + * @since 3.0.0 + */ + dump(): void; + /** + * Iterates through all entries in this Map, passing each one to the given callback. + * + * If the callback returns `false`, the iteration will break. + * + * @since 3.0.0 + * + * @param callback - The callback which will receive the keys and entries held in this Map. + * @returns This Map object. + */ + each(callback: (key: K, entry: V) => boolean | void): this; + /** + * Returns `true` if the value exists within this Map. Otherwise, returns `false`. + * + * @since 3.0.0 + * + * @param value - The value to search for. + * @returns `true` if the value is found, otherwise `false`. + */ + contains(value: V): boolean; + /** + * Merges all new keys from the given Map into this one. + * If it encounters a key that already exists it will be skipped unless override is set to `true`. + * + * @since 3.0.0 + * + * @param map - The Map to merge in to this Map. + * @param override - Set to `true` to replace values in this Map with those from the source map, or `false` to skip them. + * @returns This Map object. + */ + merge(map: Phaser.Structs.Map, override?: boolean): this; + } } @@ -130528,7 +126134,8 @@ declare namespace Phaser { * @param y The y coordinate of the pixel within the Texture. * @param key The unique string-based key of the Texture. * @param frame The string or index of the Frame. - * @returns A Color object populated with the color values of the requested pixel, or `null` if the coordinates were out of bounds. + * @returns A Color object populated with the color values of the requested pixel, + * or `null` if the coordinates were out of bounds. */ getPixel(x: number, y: number, key: string, frame?: string | number): Phaser.Display.Color | null; @@ -131694,22 +127301,6 @@ declare namespace Phaser { */ resetFlip(): this; - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. - */ - setVisible(value: boolean): this; - } /** @@ -131924,7 +127515,8 @@ declare namespace Phaser { * GID this set will use here. Default 0. * @param tileOffset Tile texture drawing offset. * If not specified, it will default to {0, 0} Default {x: 0, y: 0}. - * @returns Returns the Tileset object that was created or updated, or null if it failed. + * @returns Returns the Tileset object that was created or updated, or null if it + * failed. */ addTilesetImage(tilesetName: string, key?: string, tileWidth?: number, tileHeight?: number, tileMargin?: number, tileSpacing?: number, gid?: number, tileOffset?: object): Phaser.Tilemaps.Tileset | null; @@ -133439,79 +129031,6 @@ declare namespace Phaser { */ setDisplaySize(width: number, height: number): this; - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - * @returns This Game Object instance. - */ - setDepth(value: number): this; - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToTop(): this; - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToBack(): this; - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be above. - * @returns This Game Object instance. - */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be below. - * @returns This Game Object instance. - */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; - /** * The time elapsed since timer initialization, in milliseconds. */ @@ -134225,22 +129744,6 @@ declare namespace Phaser { */ getParentRotation(): number; - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. - */ - setVisible(value: boolean): this; - /** * Sets the Collision Category that this Arcade Physics Body * will use in order to determine what it can collide with. @@ -134898,79 +130401,6 @@ declare namespace Phaser { */ setDisplaySize(width: number, height: number): this; - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - * @returns This Game Object instance. - */ - setDepth(value: number): this; - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToTop(): this; - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToBack(): this; - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be above. - * @returns This Game Object instance. - */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be below. - * @returns This Game Object instance. - */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; - /** * The time elapsed since timer initialization, in milliseconds. */ @@ -135684,22 +131114,6 @@ declare namespace Phaser { */ getParentRotation(): number; - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. - */ - setVisible(value: boolean): this; - /** * Sets the Collision Category that this Arcade Physics Body * will use in order to determine what it can collide with. @@ -136803,79 +132217,6 @@ declare namespace Phaser { */ setDisplaySize(width: number, height: number): this; - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - * @returns This Game Object instance. - */ - setDepth(value: number): this; - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToTop(): this; - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined - * @returns This Game Object instance. - */ - setToBack(): this; - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be above. - * @returns This Game Object instance. - */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be below. - * @returns This Game Object instance. - */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; - /** * The time elapsed since timer initialization, in milliseconds. */ @@ -137589,22 +132930,6 @@ declare namespace Phaser { */ getParentRotation(): number; - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - * @returns This Game Object instance. - */ - setVisible(value: boolean): this; - /** * Sets the Collision Category that this Arcade Physics Body * will use in order to determine what it can collide with. @@ -137833,7 +133158,8 @@ declare namespace Phaser { * Returns the texture coordinates (UV in pixels) in the Tileset image for the given tile index. * Returns null if tile index is not contained in this Tileset. * @param tileIndex The unique id of the tile across all tilesets in the map. - * @returns Object in the form { x, y } representing the top-left UV coordinate within the Tileset image. + * @returns Object in the form { x, y } representing the top-left UV coordinate + * within the Tileset image. */ getTileTextureCoordinates(tileIndex: number): object | null; @@ -139243,7 +134569,8 @@ declare namespace Phaser { * @param insertNull Controls how empty tiles (those with an index of -1) are stored in * the LayerData. If `true`, empty tile positions are stored as `null`. If `false`, a Tile object * with an index of -1 is created for each empty position instead. - * @returns - An array of LayerData objects, one for each entry in json.layer. + * @returns - An array of LayerData objects, one for each entry in + * json.layer. */ function ParseTileLayers(json: object, insertNull: boolean): Phaser.Tilemaps.LayerData[]; @@ -139412,7 +134739,8 @@ declare namespace Phaser { * @param json The Tiled JSON object. * @param insertNull Controls how empty tiles, tiles with an index of -1, in the map * data are handled (see {@link Phaser.Tilemaps.Parsers.Tiled.ParseJSONTiled}). - * @returns - An array of LayerData objects, one for each entry in json.layers with the type 'tilelayer'. + * @returns - An array of LayerData objects, one for each entry in + * json.layers with the type 'tilelayer'. */ function ParseTileLayers(json: object, insertNull: boolean): Phaser.Tilemaps.LayerData[]; @@ -139467,6 +134795,12 @@ declare namespace Phaser { */ const HEXAGONAL: number; + interface Tile extends Phaser.GameObjects.Components.AlphaSingle, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.Visible { + } + + interface TilemapLayerBase extends Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.ComputedSize, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.ElapseTimer, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Lighting, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.RenderNodes, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible, Phaser.Physics.Arcade.Components.Collision { + } + } namespace Time { @@ -143609,8 +138943,6 @@ declare type Attachment = { declare type EachListCallback = (item: I, ...args: any[])=>void; -declare type EachMapCallback = (key: string, entry: E)=>boolean | null; - declare type EachTextureCallback = (texture: Phaser.Textures.Texture, ...args: any[])=>void; /** From e3cade4a926de3cd947fd87eb676f48d625b7581 Mon Sep 17 00:00:00 2001 From: Niklas Engblom Date: Thu, 14 May 2026 07:35:32 +0300 Subject: [PATCH 16/17] Add migrated symbol and JSDoc validation gates --- package.json | 4 +- scripts/check-migrated-jsdoc-types.js | 120 ++++++++++++++++ scripts/validate-migrated-symbols.js | 193 ++++++++++++++++++++++++++ 3 files changed, 316 insertions(+), 1 deletion(-) create mode 100644 scripts/check-migrated-jsdoc-types.js create mode 100644 scripts/validate-migrated-symbols.js diff --git a/package.json b/package.json index fa942dbd96..87234643b3 100644 --- a/package.json +++ b/package.json @@ -38,8 +38,10 @@ "bundleshaders": "node scripts/bundle-shaders.js", "build-tsgen": "cd scripts/tsgen && tsc", "tsgen": "cd scripts/tsgen && jsdoc -c jsdoc-tsd.conf.json", + "validate:migrated-symbols": "node scripts/validate-migrated-symbols.js", "test-ts": "cd scripts/tsgen/test && tsc --build tsconfig.json > output.txt 2>&1", - "ts": "npm run tsgen && npm run test-ts", + "check:migrated-jsdoc-types": "node scripts/check-migrated-jsdoc-types.js", + "ts": "npm run check:migrated-jsdoc-types && npm run tsgen && npm run validate:migrated-symbols && npm run test-ts", "tsdev": "npm run build-tsgen && npm run tsgen && npm run test-ts", "test": "vitest run", "test:watch": "vitest", diff --git a/scripts/check-migrated-jsdoc-types.js b/scripts/check-migrated-jsdoc-types.js new file mode 100644 index 0000000000..53f1f59329 --- /dev/null +++ b/scripts/check-migrated-jsdoc-types.js @@ -0,0 +1,120 @@ +const fs = require('fs'); +const path = require('path'); +const { discoverMigratedModules } = require('./tsgen/bin/MigratedOverlay'); + +const repoRoot = path.resolve(__dirname, '..'); + +function getLineNumber(text, index) +{ + let line = 1; + + for (let i = 0; i < index; i++) + { + if (text[i] === '\n') + { + line++; + } + } + + return line; +} + +function collectViolations(filePath, source) +{ + const violations = []; + const commentRegex = /\/\*\*[\s\S]*?\*\//g; + + const explicitTypedTagRegex = /@(param|arg|argument|returns?|type|property|prop|typedef)\s*\{(?!@)[^}]+\}/gi; + const trailingTypedPayloadRegex = /@(param|arg|argument|property|prop)\s+[^{}\n]+\s+\{(?!@)[^}]+\}/gi; + + let commentMatch; + + while ((commentMatch = commentRegex.exec(source)) !== null) + { + const commentText = commentMatch[0]; + const commentStart = commentMatch.index; + + const checks = [ + { regex: explicitTypedTagRegex, kind: 'typed-tag' }, + { regex: trailingTypedPayloadRegex, kind: 'typed-tag-payload' } + ]; + + for (let i = 0; i < checks.length; i++) + { + const check = checks[i]; + check.regex.lastIndex = 0; + + let lineMatch; + + while ((lineMatch = check.regex.exec(commentText)) !== null) + { + const absoluteIndex = commentStart + lineMatch.index; + const line = getLineNumber(source, absoluteIndex); + + violations.push({ + filePath, + line, + kind: check.kind, + snippet: lineMatch[0] + }); + } + } + } + + return violations; +} + +function main() +{ + let manifest; + + try + { + manifest = discoverMigratedModules(); + } + catch (error) + { + console.error(`Unable to discover migrated modules: ${error.message}`); + process.exit(1); + } + + const migratedFiles = Object.keys(manifest); + const violations = []; + + for (let i = 0; i < migratedFiles.length; i++) + { + const relativePath = migratedFiles[i]; + const absolutePath = path.join(repoRoot, relativePath); + + if (!fs.existsSync(absolutePath)) + { + console.error(`Manifest entry does not exist: ${relativePath}`); + process.exit(1); + } + + const source = fs.readFileSync(absolutePath, 'utf8'); + const fileViolations = collectViolations(relativePath, source); + + for (let j = 0; j < fileViolations.length; j++) + { + violations.push(fileViolations[j]); + } + } + + if (violations.length > 0) + { + console.error('Found type-bearing JSDoc annotations in migrated TypeScript files:'); + + for (let i = 0; i < violations.length; i++) + { + const violation = violations[i]; + console.error(`- ${violation.filePath}:${violation.line} (${violation.kind}) ${violation.snippet}`); + } + + process.exit(1); + } + + console.log('No type-bearing JSDoc annotations found in migrated TypeScript files.'); +} + +main(); diff --git a/scripts/validate-migrated-symbols.js b/scripts/validate-migrated-symbols.js new file mode 100644 index 0000000000..32510201d2 --- /dev/null +++ b/scripts/validate-migrated-symbols.js @@ -0,0 +1,193 @@ +const fs = require('fs'); +const path = require('path'); +const { + discoverMigratedModules, + parseSourceFile, + collectExportedDeclarationKinds, + validateSymbolInDeclarations +} = require('./tsgen/bin/MigratedOverlay'); + +const repoRoot = path.resolve(__dirname, '..'); +const declarationsPath = path.join(repoRoot, 'types', 'phaser.d.ts'); +const supportedExpectedKinds = new Set([ 'class', 'function', 'variable', 'interface', 'type', 'enum', 'namespace' ]); + +function getCanonicalSymbolName(canonicalSymbol) +{ + const parts = canonicalSymbol.split('.'); + + if (parts.length < 2) + { + return null; + } + + return parts[parts.length - 1]; +} + +function inferExpectedKindForSymbol(modulePath, canonicalSymbol, moduleSymbolKindsCache) +{ + let symbolKinds = moduleSymbolKindsCache.get(modulePath); + + if (!symbolKinds) + { + const absoluteModulePath = path.join(repoRoot, modulePath); + + if (!fs.existsSync(absoluteModulePath)) + { + throw new Error(`Manifest references missing module file: ${modulePath}`); + } + + symbolKinds = collectExportedDeclarationKinds(absoluteModulePath); + moduleSymbolKindsCache.set(modulePath, symbolKinds); + } + + const symbolName = getCanonicalSymbolName(canonicalSymbol); + + if (!symbolName) + { + throw new Error(`Invalid canonical symbol path: ${canonicalSymbol}`); + } + + const expectedKinds = symbolKinds.get(symbolName); + + if (!expectedKinds || expectedKinds.size === 0) + { + throw new Error(`Unable to infer declaration kind for ${canonicalSymbol} from ${modulePath}. Expected an exported declaration named ${symbolName}.`); + } + + const inferredKinds = Array.from(expectedKinds); + + for (let i = 0; i < inferredKinds.length; i++) + { + if (!supportedExpectedKinds.has(inferredKinds[i])) + { + throw new Error(`Unsupported declaration kind for ${canonicalSymbol} from ${modulePath}: ${inferredKinds[i]}. Supported kinds: class, function, variable, interface, type, enum, namespace.`); + } + } + + inferredKinds.sort(); + + // Heuristic: variable exports typically represent mixin factories whose + // companion interface should also be validated. + if (inferredKinds.includes('variable') && !inferredKinds.includes('interface')) + { + inferredKinds.push('interface'); + } + + return inferredKinds; +} + +function collectCanonicalSymbols(manifest) +{ + if (!manifest || typeof manifest !== 'object' || Array.isArray(manifest)) + { + throw new Error('Invalid manifest shape: expected an object mapping module paths to arrays of canonical symbols.'); + } + + const symbols = []; + const seenSymbols = new Map(); + const moduleSymbolKindsCache = new Map(); + const files = Object.keys(manifest); + + for (let i = 0; i < files.length; i++) + { + const modulePath = files[i]; + const canonicalSymbols = manifest[modulePath]; + + if (!Array.isArray(canonicalSymbols)) + { + throw new Error(`Invalid manifest entry for ${modulePath}: expected an array of canonical symbols.`); + } + + for (let j = 0; j < canonicalSymbols.length; j++) + { + const canonicalSymbol = canonicalSymbols[j]; + + if (typeof canonicalSymbol !== 'string' || canonicalSymbol.length === 0) + { + throw new Error(`Invalid canonical symbol in ${modulePath} at index ${j}: expected a non-empty string.`); + } + + if (seenSymbols.has(canonicalSymbol)) + { + const firstModulePath = seenSymbols.get(canonicalSymbol); + + throw new Error(`Duplicate canonical symbol in manifest: ${canonicalSymbol} appears in both ${firstModulePath} and ${modulePath}.`); + } + + seenSymbols.set(canonicalSymbol, modulePath); + + symbols.push({ + symbol: canonicalSymbol, + expectedKinds: inferExpectedKindForSymbol(modulePath, canonicalSymbol, moduleSymbolKindsCache) + }); + } + } + + symbols.sort((a, b) => a.symbol.localeCompare(b.symbol)); + + return symbols; +} + +function main() +{ + if (!fs.existsSync(declarationsPath)) + { + console.error(`Unable to find generated declarations: ${declarationsPath}`); + process.exit(1); + } + + let manifest; + + try + { + manifest = discoverMigratedModules(); + } + catch (error) + { + console.error(`Unable to discover migrated modules: ${error.message}`); + process.exit(1); + } + + let canonicalSymbols; + + try + { + canonicalSymbols = collectCanonicalSymbols(manifest); + } + catch (error) + { + console.error(`Invalid migrated modules: ${error.message}`); + process.exit(1); + } + + const sourceFile = parseSourceFile(declarationsPath); + const missingSymbols = []; + + for (let i = 0; i < canonicalSymbols.length; i++) + { + const entry = canonicalSymbols[i]; + const result = validateSymbolInDeclarations(sourceFile, entry.symbol, entry.expectedKinds); + + if (result) + { + missingSymbols.push(result); + } + } + + if (missingSymbols.length > 0) + { + console.error('Missing migrated canonical symbols in types/phaser.d.ts:'); + + for (let i = 0; i < missingSymbols.length; i++) + { + const missing = missingSymbols[i]; + console.error(`- ${missing.symbol} (${missing.reason})`); + } + + process.exit(1); + } + + console.log(`Validated ${canonicalSymbols.length} migrated canonical symbols in types/phaser.d.ts with declaration kind checks.`); +} + +main(); From b9e8eb9e1bcf63423e869c6616c28aaac39c2670 Mon Sep 17 00:00:00 2001 From: Niklas Engblom Date: Thu, 14 May 2026 07:35:41 +0300 Subject: [PATCH 17/17] Rebuild distribution bundles after TypeScript migration updates --- dist/phaser-arcade-physics.js | 4586 ++++++++++++----------------- dist/phaser-arcade-physics.min.js | 2 +- dist/phaser.esm.js | 4557 ++++++++++++---------------- dist/phaser.esm.min.js | 2 +- dist/phaser.js | 4586 ++++++++++++----------------- dist/phaser.min.js | 2 +- 6 files changed, 5707 insertions(+), 8028 deletions(-) diff --git a/dist/phaser-arcade-physics.js b/dist/phaser-arcade-physics.js index 3d19c2397c..2914e7dd69 100644 --- a/dist/phaser-arcade-physics.js +++ b/dist/phaser-arcade-physics.js @@ -11,6 +11,1816 @@ return /******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ +/***/ 7889 +(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Depth: () => (/* binding */ Depth), +/* harmony export */ DepthDescriptors: () => (/* binding */ DepthDescriptors), +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_Mixin_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(42969); +/* harmony import */ var _utils_array_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(37105); +/* harmony import */ var _utils_array_index_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_utils_array_index_js__WEBPACK_IMPORTED_MODULE_1__); + +/** + * @author Richard Davey + * @copyright 2013-2026 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + + +const DepthDescriptors = { + _depth: 0, + depth: { + get: function() { + return this._depth; + }, + set: function(value) { + if (this.displayList) { + this.displayList.queueDepthSort(); + } + this._depth = value; + } + }, + setDepth: function(value) { + if (value === void 0) { + value = 0; + } + this.depth = value; + return this; + }, + setToTop: function() { + const list = this.getDisplayList(); + if (list) { + _utils_array_index_js__WEBPACK_IMPORTED_MODULE_1___default().BringToTop(list, this); + } + return this; + }, + setToBack: function() { + const list = this.getDisplayList(); + if (list) { + _utils_array_index_js__WEBPACK_IMPORTED_MODULE_1___default().SendToBack(list, this); + } + return this; + }, + setAbove: function(gameObject) { + const list = this.getDisplayList(); + if (list && gameObject) { + _utils_array_index_js__WEBPACK_IMPORTED_MODULE_1___default().MoveAbove(list, this, gameObject); + } + return this; + }, + setBelow: function(gameObject) { + const list = this.getDisplayList(); + if (list && gameObject) { + _utils_array_index_js__WEBPACK_IMPORTED_MODULE_1___default().MoveBelow(list, this, gameObject); + } + return this; + } +}; +const Depth = (0,_utils_Mixin_js__WEBPACK_IMPORTED_MODULE_0__/* .defineMixin */ .lv)()(function Depth2(Base) { + (0,_utils_Mixin_js__WEBPACK_IMPORTED_MODULE_0__/* .applyMixin */ .AD)(Base, DepthDescriptors); + return Base; +}); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Depth); + + +/***/ }, + +/***/ 36626 +(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Visible: () => (/* binding */ Visible), +/* harmony export */ VisibleDescriptors: () => (/* binding */ VisibleDescriptors), +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_Mixin_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(42969); + +/** + * @author Richard Davey + * @copyright 2013-2026 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +const _FLAG = 1; +const VisibleDescriptors = { + _visible: true, + visible: { + get: function() { + return this._visible; + }, + set: function(value) { + if (value) { + this._visible = true; + this.renderFlags |= _FLAG; + } else { + this._visible = false; + this.renderFlags &= ~_FLAG; + } + } + }, + setVisible: function(value) { + this.visible = value; + return this; + } +}; +const Visible = (0,_utils_Mixin_js__WEBPACK_IMPORTED_MODULE_0__/* .defineMixin */ .lv)()(function Visible2(Base) { + (0,_utils_Mixin_js__WEBPACK_IMPORTED_MODULE_0__/* .applyMixin */ .AD)(Base, VisibleDescriptors); + return Base; +}); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Visible); + + +/***/ }, + +/***/ 18134 +(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* unused harmony export NineSliceVertex */ +/* harmony import */ var _math_Vector2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(70038); + +/** + * @author Richard Davey + * @copyright 2013-2026 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +class NineSliceVertex extends _math_Vector2_js__WEBPACK_IMPORTED_MODULE_0__["default"] { + /** + * @param x - The x position of the vertex. + * @param y - The y position of the vertex. + * @param u - The UV u coordinate of the vertex. + * @param v - The UV v coordinate of the vertex. + */ + constructor(x, y, u, v) { + super(x, y); + this.vx = 0; + this.vy = 0; + this.u = u; + this.v = v; + } + /** + * Sets the UV texture coordinates of this vertex. + * + * @since 4.0.0 + * + * @param u - The UV u coordinate of the vertex. + * @param v - The UV v coordinate of the vertex. + * + * @return This Vertex. + */ + setUVs(u, v) { + this.u = u; + this.v = v; + return this; + } + /** + * Updates this vertex's position and calculates its projected screen-space coordinates. + * + * Sets the normalized `x` and `y` position, then scales them by the parent object's + * `width` and `height` to produce the projected `vx` and `vy` values. The origin + * offset of the parent object is then factored in, shifting `vx` and `vy` so that the + * mesh is correctly aligned relative to the object's origin point. + * + * @since 4.0.0 + * + * @param x - The x position of the vertex. + * @param y - The y position of the vertex. + * @param width - The width of the parent object. + * @param height - The height of the parent object. + * @param originX - The originX of the parent object. + * @param originY - The originY of the parent object. + * + * @return This Vertex. + */ + resize(x, y, width, height, originX, originY) { + this.x = x; + this.y = y; + this.vx = this.x * width; + this.vy = -this.y * height; + if (originX < 0.5) { + this.vx += width * (0.5 - originX); + } else if (originX > 0.5) { + this.vx -= width * (originX - 0.5); + } + if (originY < 0.5) { + this.vy += height * (0.5 - originY); + } else if (originY > 0.5) { + this.vy -= height * (originY - 0.5); + } + return this; + } +} +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (NineSliceVertex); + + +/***/ }, + +/***/ 58715 +(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; + +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + "default": () => (/* binding */ zone_Zone) +}); + +// UNUSED EXPORTS: Zone + +// EXTERNAL MODULE: ./renderer/BlendModes.js +var BlendModes = __webpack_require__(10312); +var BlendModes_default = /*#__PURE__*/__webpack_require__.n(BlendModes); +// EXTERNAL MODULE: ./geom/circle/Circle.js +var Circle = __webpack_require__(96503); +var Circle_default = /*#__PURE__*/__webpack_require__.n(Circle); +// EXTERNAL MODULE: ./geom/circle/Contains.js +var Contains = __webpack_require__(87902); +var Contains_default = /*#__PURE__*/__webpack_require__.n(Contains); +// EXTERNAL MODULE: ./gameobjects/components/index.js +var components = __webpack_require__(31401); +var components_default = /*#__PURE__*/__webpack_require__.n(components); +// EXTERNAL MODULE: ./geom/rectangle/Rectangle.ts +var Rectangle = __webpack_require__(59428); +// EXTERNAL MODULE: ./geom/rectangle/Contains.ts +var rectangle_Contains = __webpack_require__(72488); +// EXTERNAL MODULE: ./gameobjects/components/Visible.ts +var Visible = __webpack_require__(36626); +// EXTERNAL MODULE: ./gameobjects/components/Depth.ts +var Depth = __webpack_require__(7889); +// EXTERNAL MODULE: ./utils/Mixin.ts +var Mixin = __webpack_require__(42969); +// EXTERNAL MODULE: ./gameobjects/GameObject.js +var GameObject = __webpack_require__(95643); +var GameObject_default = /*#__PURE__*/__webpack_require__.n(GameObject); +;// ./utils/migrationPlaceholders.ts + + +const TODO_MIGRATE_GameObjectCtor = (GameObject_default()); + +;// ./gameobjects/zone/Zone.ts + +/** + * @author Richard Davey + * @copyright 2013-2026 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + + + + + + + + + + +const ZoneBase = (0,Mixin/* composeMixins */.fP)(Visible.Visible, Depth.Depth)(TODO_MIGRATE_GameObjectCtor); +class Zone extends ZoneBase { + /** + * @since 3.0.0 + */ + constructor(scene, x, y, width = 1, height = width) { + super(scene, "Zone"); + this.setPosition(x, y); + this.width = width; + this.height = height; + this.blendMode = (BlendModes_default()).NORMAL; + this.updateDisplayOrigin(); + } + /** + * The displayed width of this Game Object. + * This value takes into account the scale factor. + * + * @name Phaser.GameObjects.Zone#displayWidth + * @since 3.0.0 + */ + get displayWidth() { + return this.scaleX * this.width; + } + set displayWidth(value) { + this.scaleX = value / this.width; + } + /** + * The displayed height of this Game Object. + * This value takes into account the scale factor. + * + * @since 3.0.0 + */ + get displayHeight() { + return this.scaleY * this.height; + } + set displayHeight(value) { + this.scaleY = value / this.height; + } + /** + * Sets the native (un-scaled) width and height of this Zone. Also updates the display origin + * and, by default, resizes any non-custom input hit area associated with this Zone. + * + * @since 3.0.0 + * + * @param width - The width of this Game Object. + * @param height - The height of this Game Object. + * @param [resizeInput=true] - If this Zone has a Rectangle for a hit area this argument will resize the hit area as well. + * + * @return This Game Object. + */ + setSize(width, height, resizeInput = true) { + this.width = width; + this.height = height; + this.updateDisplayOrigin(); + const input = this.input; + if (resizeInput && input && !input.customHitArea) { + input.hitArea.width = width; + input.hitArea.height = height; + } + return this; + } + /** + * Sets the display size of this Game Object. + * Calling this will adjust the scale. + * + * @since 3.0.0 + * + * @param width - The width of this Game Object. + * @param height - The height of this Game Object. + * + * @return This Game Object. + */ + setDisplaySize(width, height) { + this.displayWidth = width; + this.displayHeight = height; + return this; + } + /** + * Sets this Zone to be a Circular Drop Zone. + * The circle is centered on this Zone's `x` and `y` coordinates. + * + * @since 3.0.0 + * + * @param radius - The radius of the Circle that will form the Drop Zone. + * + * @return This Game Object. + */ + setCircleDropZone(radius) { + return this.setDropZone(new (Circle_default())(0, 0, radius), (Contains_default())); + } + /** + * Sets this Zone to be a Rectangle Drop Zone. + * The rectangle is centered on this Zone's `x` and `y` coordinates. + * + * @since 3.0.0 + * + * @param width - The width of the rectangle drop zone. + * @param height - The height of the rectangle drop zone. + * + * @return This Game Object. + */ + setRectangleDropZone(width, height) { + return this.setDropZone(new Rectangle.Rectangle(0, 0, width, height), rectangle_Contains.Contains); + } + /** + * Enables this Zone as an interactive Drop Zone by calling `setInteractive` with the given + * hit area shape and callback. You can pass any Phaser geometry shape, or a custom shape with + * a matching hit-test callback. If no arguments are provided, a Rectangle matching the size of + * this Zone will be used automatically. Has no effect if this Zone is already interactive. + * + * @since 3.0.0 + * + * @param [hitArea] - A Geometry shape instance, such as Phaser.Geom.Ellipse, or your own custom shape. + * @param [hitAreaCallback] - A function that will return `true` if the given x/y coords it is sent are within the shape. + * + * @return This Game Object. + */ + setDropZone(hitArea, hitAreaCallback) { + if (!this.input) { + this.setInteractive(hitArea, hitAreaCallback, true); + } + return this; + } + /** + * A NOOP method so you can pass a Zone to a Container. + * Calling this method will do nothing. It is intentionally empty. + * + * @method Phaser.GameObjects.Zone#setAlpha + * @private + * @since 3.11.0 + */ + setAlpha() { + } + /** + * A NOOP method so you can pass a Zone to a Container in Canvas. + * Calling this method will do nothing. It is intentionally empty. + * + * @method Phaser.GameObjects.Zone#setBlendMode + * @private + * @since 3.16.2 + */ + setBlendMode() { + } + /** + * A Zone does not render. + * + * @method Phaser.GameObjects.Zone#renderCanvas + * @private + * @since 3.53.0 + * + * @param renderer - A reference to the current active Canvas renderer. + * @param src - The Game Object being rendered in this call. + * @param camera - The Camera that is rendering the Game Object. + */ + renderCanvas(_renderer, src, camera) { + camera.addToRenderList(src); + } + /** + * A Zone does not render. + * + * @method Phaser.GameObjects.Zone#renderWebGL + * @private + * @since 3.53.0 + * + * @param renderer - A reference to the current active WebGL renderer. + * @param src - The Game Object being rendered in this call. + * @param drawingContext - The current drawing context. + */ + renderWebGL(_renderer, src, drawingContext) { + drawingContext.camera.addToRenderList(src); + } +} +(0,Mixin/* applyMixin */.AD)(Zone, (components_default()).GetBounds); +(0,Mixin/* applyMixin */.AD)(Zone, (components_default()).Origin); +(0,Mixin/* applyMixin */.AD)(Zone, (components_default()).ScrollFactor); +(0,Mixin/* applyMixin */.AD)(Zone, (components_default()).Transform); +/* harmony default export */ const zone_Zone = (Zone); + + +/***/ }, + +/***/ 72488 +(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Contains: () => (/* binding */ Contains), +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); + +/** + * @author Richard Davey + * @copyright 2013-2026 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ +function Contains(rect, x, y) { + if (rect.width <= 0 || rect.height <= 0) { + return false; + } + return rect.x <= x && rect.x + rect.width >= x && rect.y <= y && rect.y + rect.height >= y; +} +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Contains); + + +/***/ }, + +/***/ 59428 +(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Rectangle: () => (/* binding */ Rectangle), +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _Contains_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(72488); +/* harmony import */ var _GetPoint_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20812); +/* harmony import */ var _GetPoint_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_GetPoint_js__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _GetPoints_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(34819); +/* harmony import */ var _GetPoints_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_GetPoints_js__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _const_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(23777); +/* harmony import */ var _const_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_const_js__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var _line_Line_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(23031); +/* harmony import */ var _line_Line_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_line_Line_js__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var _Random_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(26597); +/* harmony import */ var _Random_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_Random_js__WEBPACK_IMPORTED_MODULE_5__); + +/** + * @author Richard Davey + * @copyright 2013-2026 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + + + + + + +class Rectangle { + /** + * @param x - The X coordinate of the top left corner of the Rectangle. + * @param y - The Y coordinate of the top left corner of the Rectangle. + * @param width - The width of the Rectangle. + * @param height - The height of the Rectangle. + */ + constructor(x = 0, y = 0, width = 0, height = 0) { + this.type = (_const_js__WEBPACK_IMPORTED_MODULE_3___default().RECTANGLE); + this.x = x; + this.y = y; + this.width = width; + this.height = height; + } + /** + * Checks if the given point is inside the Rectangle's bounds. + * + * @since 3.0.0 + * + * @param x - The X coordinate of the point to check. + * @param y - The Y coordinate of the point to check. + * + * @returns `true` if the point is within the Rectangle's bounds, otherwise `false`. + */ + contains(x, y) { + return (0,_Contains_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, x, y); + } + /** + * Calculates the coordinates of a point at a certain `position` on the Rectangle's perimeter. + * + * The `position` is a fraction between 0 and 1 which defines how far into the perimeter the point is. + * + * A value of 0 or 1 returns the point at the top left corner of the rectangle, while a value of 0.5 + * returns the point at the bottom right corner of the rectangle. Values between 0 and 0.5 are on the + * top or the right side and values between 0.5 and 1 are on the bottom or the left side. + * + * @since 3.0.0 + * + * @param position - The normalized distance into the Rectangle's perimeter to return. + * @param output - A Vector2 instance to update with the `x` and `y` coordinates of the point. + * + * @returns The updated `output` object, or a new Vector2 if no `output` object was given. + */ + getPoint(position, output) { + return _GetPoint_js__WEBPACK_IMPORTED_MODULE_1___default()(this, position, output); + } + /** + * Returns an array of points from the perimeter of the Rectangle, each spaced out based + * on the quantity or step required. + * + * @since 3.0.0 + * + * @param quantity - The number of points to return. Set to `false` or 0 to return an arbitrary + * number of points (`perimeter / stepRate`) evenly spaced around the Rectangle based on the `stepRate`. + * @param stepRate - If `quantity` is 0, determines the normalized distance between each returned point. + * @param output - An array to which to append the points. + * + * @returns The modified `output` array, or a new array if none was provided. + */ + getPoints(quantity, stepRate, output) { + return _GetPoints_js__WEBPACK_IMPORTED_MODULE_2___default()(this, quantity, stepRate, output); + } + /** + * Returns a random point within the Rectangle's bounds. + * + * @since 3.0.0 + * + * @param vec - The object in which to store the `x` and `y` coordinates of the point. + * + * @returns The updated `vec`, or a new Vector2 if none was provided. + */ + getRandomPoint(vec) { + return _Random_js__WEBPACK_IMPORTED_MODULE_5___default()(this, vec); + } + /** + * Sets the position, width, and height of the Rectangle. + * + * @since 3.0.0 + * + * @param x - The X coordinate of the top left corner of the Rectangle. + * @param y - The Y coordinate of the top left corner of the Rectangle. + * @param width - The width of the Rectangle. + * @param height - The height of the Rectangle. + * + * @returns This Rectangle object. + */ + setTo(x, y, width, height) { + this.x = x; + this.y = y; + this.width = width; + this.height = height; + return this; + } + /** + * Resets the position, width, and height of the Rectangle to 0. + * + * @since 3.0.0 + * + * @returns This Rectangle object. + */ + setEmpty() { + return this.setTo(0, 0, 0, 0); + } + /** + * Sets the position of the Rectangle. + * + * @since 3.0.0 + * + * @param x - The X coordinate of the top left corner of the Rectangle. + * @param y - The Y coordinate of the top left corner of the Rectangle. + * + * @returns This Rectangle object. + */ + setPosition(x, y) { + if (y === void 0) { + y = x; + } + this.x = x; + this.y = y; + return this; + } + /** + * Sets the width and height of the Rectangle. + * + * @since 3.0.0 + * + * @param width - The width to set the Rectangle to. + * @param height - The height to set the Rectangle to. + * + * @returns This Rectangle object. + */ + setSize(width, height) { + if (height === void 0) { + height = width; + } + this.width = width; + this.height = height; + return this; + } + /** + * Determines if the Rectangle is empty. A Rectangle is empty if its width or height is less than or equal to 0. + * + * @since 3.0.0 + * + * @returns `true` if the Rectangle is empty, otherwise `false`. + */ + isEmpty() { + return this.width <= 0 || this.height <= 0; + } + /** + * Returns a Line object that corresponds to the top of this Rectangle. + * + * @since 3.0.0 + * + * @param line - A Line object to set the results in. If `undefined` a new Line will be created. + * + * @returns A Line object that corresponds to the top of this Rectangle. + */ + // @ts-expect-error - Line is a JS Class() factory value, not a TypeScript type + getLineA(line) { + if (line === void 0) { + line = new (_line_Line_js__WEBPACK_IMPORTED_MODULE_4___default())(); + } + line.setTo(this.x, this.y, this.right, this.y); + return line; + } + /** + * Returns a Line object that corresponds to the right of this Rectangle. + * + * @since 3.0.0 + * + * @param line - A Line object to set the results in. If `undefined` a new Line will be created. + * + * @returns A Line object that corresponds to the right of this Rectangle. + */ + // @ts-expect-error - Line is a JS Class() factory value, not a TypeScript type + getLineB(line) { + if (line === void 0) { + line = new (_line_Line_js__WEBPACK_IMPORTED_MODULE_4___default())(); + } + line.setTo(this.right, this.y, this.right, this.bottom); + return line; + } + /** + * Returns a Line object that corresponds to the bottom of this Rectangle. + * + * @since 3.0.0 + * + * @param line - A Line object to set the results in. If `undefined` a new Line will be created. + * + * @returns A Line object that corresponds to the bottom of this Rectangle. + */ + // @ts-expect-error - Line is a JS Class() factory value, not a TypeScript type + getLineC(line) { + if (line === void 0) { + line = new (_line_Line_js__WEBPACK_IMPORTED_MODULE_4___default())(); + } + line.setTo(this.right, this.bottom, this.x, this.bottom); + return line; + } + /** + * Returns a Line object that corresponds to the left of this Rectangle. + * + * @since 3.0.0 + * + * @param line - A Line object to set the results in. If `undefined` a new Line will be created. + * + * @returns A Line object that corresponds to the left of this Rectangle. + */ + // @ts-expect-error - Line is a JS Class() factory value, not a TypeScript type + getLineD(line) { + if (line === void 0) { + line = new (_line_Line_js__WEBPACK_IMPORTED_MODULE_4___default())(); + } + line.setTo(this.x, this.bottom, this.x, this.y); + return line; + } + /** + * The x coordinate of the left of the Rectangle. + * Changing the left property of a Rectangle object has no effect on the y and height properties. + * However it does affect the width property, whereas changing the x value does not affect the width property. + * + * @since 3.0.0 + */ + get left() { + return this.x; + } + set left(value) { + if (value >= this.right) { + this.width = 0; + } else { + this.width = this.right - value; + } + this.x = value; + } + /** + * The sum of the x and width properties. + * Changing the right property of a Rectangle object has no effect on the x, y and height properties, + * however it does affect the width property. + * + * @since 3.0.0 + */ + get right() { + return this.x + this.width; + } + set right(value) { + if (value <= this.x) { + this.width = 0; + } else { + this.width = value - this.x; + } + } + /** + * The y coordinate of the top of the Rectangle. Changing the top property of a Rectangle object has no + * effect on the x and width properties. However it does affect the height property, whereas changing + * the y value does not affect the height property. + * + * @since 3.0.0 + */ + get top() { + return this.y; + } + set top(value) { + if (value >= this.bottom) { + this.height = 0; + } else { + this.height = this.bottom - value; + } + this.y = value; + } + /** + * The sum of the y and height properties. + * Changing the bottom property of a Rectangle object has no effect on the x, y and width properties, + * but does change the height property. + * + * @since 3.0.0 + */ + get bottom() { + return this.y + this.height; + } + set bottom(value) { + if (value <= this.y) { + this.height = 0; + } else { + this.height = value - this.y; + } + } + /** + * The x coordinate of the center of the Rectangle. + * + * @since 3.0.0 + */ + get centerX() { + return this.x + this.width / 2; + } + set centerX(value) { + this.x = value - this.width / 2; + } + /** + * The y coordinate of the center of the Rectangle. + * + * @since 3.0.0 + */ + get centerY() { + return this.y + this.height / 2; + } + set centerY(value) { + this.y = value - this.height / 2; + } +} +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Rectangle); + + +/***/ }, + +/***/ 350 +(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* unused harmony export Clamp */ + +/** + * @author Richard Davey + * @copyright 2013-2026 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ +function Clamp(value, min, max) { + return Math.max(min, Math.min(max, value)); +} +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Clamp); + + +/***/ }, + +/***/ 70038 +(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* unused harmony export Vector2 */ +/* harmony import */ var _fuzzy_Equal_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(30010); + +/** + * @author Richard Davey + * @copyright 2013-2026 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +const _Vector2 = class _Vector2 { + /** + * @param x - The x component, or an object with `x` and `y` properties. + * @param y - The y component. + */ + constructor(x, y) { + this.x = 0; + this.y = 0; + if (typeof x === "object") { + this.x = x.x || 0; + this.y = x.y || 0; + } else { + if (y === void 0) { + y = x; + } + this.x = x || 0; + this.y = y || 0; + } + } + /** + * Make a clone of this Vector2. + * + * @since 3.0.0 + * + * @returns A clone of this Vector2. + */ + clone() { + return new _Vector2(this.x, this.y); + } + /** + * Copy the components of a given Vector into this Vector. + * + * @since 3.0.0 + * + * @param src - The Vector to copy the components from. + * @returns This Vector2. + */ + copy(src) { + this.x = src.x || 0; + this.y = src.y || 0; + return this; + } + /** + * Set the component values of this Vector from a given Vector2Like object. + * + * @since 3.0.0 + * + * @param obj - The object containing the component values to set for this Vector. + * @returns This Vector2. + */ + setFromObject(obj) { + this.x = obj.x || 0; + this.y = obj.y || 0; + return this; + } + /** + * Set the `x` and `y` components of this Vector to the given `x` and `y` values. + * + * @since 3.0.0 + * + * @param x - The x value to set for this Vector. + * @param y - The y value to set for this Vector. + * @returns This Vector2. + */ + set(x, y) { + if (y === void 0) { + y = x; + } + this.x = x; + this.y = y; + return this; + } + /** + * This method is an alias for `Vector2.set`. + * + * @since 3.4.0 + * + * @param x - The x value to set for this Vector. + * @param y - The y value to set for this Vector. + * @returns This Vector2. + */ + setTo(x, y) { + return this.set(x, y); + } + /** + * Runs the x and y components of this Vector2 through Math.ceil and then sets them. + * + * @since 4.0.0 + * + * @returns This Vector2. + */ + ceil() { + this.x = Math.ceil(this.x); + this.y = Math.ceil(this.y); + return this; + } + /** + * Runs the x and y components of this Vector2 through Math.floor and then sets them. + * + * @since 4.0.0 + * + * @returns This Vector2. + */ + floor() { + this.x = Math.floor(this.x); + this.y = Math.floor(this.y); + return this; + } + /** + * Swaps the x and y components of this Vector2. + * + * @since 4.0.0 + * + * @returns This Vector2. + */ + invert() { + return this.set(this.y, this.x); + } + /** + * Sets the x and y components of this Vector from the given angle and length. + * + * @since 3.0.0 + * + * @param angle - The angle from the positive x-axis, in radians. + * @param length - The distance from the origin. + * @returns This Vector2. + */ + setToPolar(angle, length) { + if (length === null || length === void 0) { + length = 1; + } + this.x = Math.cos(angle) * length; + this.y = Math.sin(angle) * length; + return this; + } + /** + * Check whether this Vector is equal to a given Vector. + * + * Performs a strict equality check against each Vector's components. + * + * @since 3.0.0 + * + * @param v - The vector to compare with this Vector. + * @returns Whether the given Vector is equal to this Vector. + */ + equals(v) { + return this.x === v.x && this.y === v.y; + } + /** + * Check whether this Vector is approximately equal to a given Vector. + * + * @since 3.23.0 + * + * @param v - The vector to compare with this Vector. + * @param epsilon - The tolerance value. + * @returns Whether both absolute differences of the x and y components are smaller than `epsilon`. + */ + fuzzyEquals(v, epsilon) { + return (0,_fuzzy_Equal_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this.x, v.x, epsilon) && (0,_fuzzy_Equal_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this.y, v.y, epsilon); + } + /** + * Calculate the angle between this Vector and the positive x-axis, in radians. + * + * @since 3.0.0 + * + * @returns The angle between this Vector, and the positive x-axis, given in radians. + */ + angle() { + let angle = Math.atan2(this.y, this.x); + if (angle < 0) { + angle += 2 * Math.PI; + } + return angle; + } + /** + * Set the angle of this Vector. + * + * @since 3.23.0 + * + * @param angle - The angle, in radians. + * @returns This Vector2. + */ + setAngle(angle) { + return this.setToPolar(angle, this.length()); + } + /** + * Add a given Vector to this Vector. Addition is component-wise. + * + * @since 3.0.0 + * + * @param src - The Vector to add to this Vector. + * @returns This Vector2. + */ + add(src) { + this.x += src.x; + this.y += src.y; + return this; + } + /** + * Subtract the given Vector from this Vector. Subtraction is component-wise. + * + * @since 3.0.0 + * + * @param src - The Vector to subtract from this Vector. + * @returns This Vector2. + */ + subtract(src) { + this.x -= src.x; + this.y -= src.y; + return this; + } + /** + * Perform a component-wise multiplication between this Vector and the given Vector. + * + * Multiplies this Vector by the given Vector. + * + * @since 3.0.0 + * + * @param src - The Vector to multiply this Vector by. + * @returns This Vector2. + */ + multiply(src) { + this.x *= src.x; + this.y *= src.y; + return this; + } + /** + * Scale this Vector by the given value. + * + * @since 3.0.0 + * + * @param value - The value to scale this Vector by. + * @returns This Vector2. + */ + scale(value) { + if (isFinite(value)) { + this.x *= value; + this.y *= value; + } else { + this.x = 0; + this.y = 0; + } + return this; + } + /** + * Perform a component-wise division between this Vector and the given Vector. + * + * Divides this Vector by the given Vector. + * + * @since 3.0.0 + * + * @param src - The Vector to divide this Vector by. + * @returns This Vector2. + */ + divide(src) { + this.x /= src.x; + this.y /= src.y; + return this; + } + /** + * Negate the `x` and `y` components of this Vector. + * + * @since 3.0.0 + * + * @returns This Vector2. + */ + negate() { + this.x = -this.x; + this.y = -this.y; + return this; + } + /** + * Calculate the distance between this Vector and the given Vector. + * + * @since 3.0.0 + * + * @param src - The Vector to calculate the distance to. + * @returns The distance from this Vector to the given Vector. + */ + distance(src) { + const dx = src.x - this.x; + const dy = src.y - this.y; + return Math.sqrt(dx * dx + dy * dy); + } + /** + * Calculate the distance between this Vector and the given Vector, squared. + * + * @since 3.0.0 + * + * @param src - The Vector to calculate the distance to. + * @returns The distance from this Vector to the given Vector, squared. + */ + distanceSq(src) { + const dx = src.x - this.x; + const dy = src.y - this.y; + return dx * dx + dy * dy; + } + /** + * Calculate the length (or magnitude) of this Vector. + * + * @since 3.0.0 + * + * @returns The length of this Vector. + */ + length() { + const x = this.x; + const y = this.y; + return Math.sqrt(x * x + y * y); + } + /** + * Set the length (or magnitude) of this Vector. + * + * @since 3.23.0 + * + * @param length - The new magnitude of this Vector. + * @returns This Vector2. + */ + setLength(length) { + return this.normalize().scale(length); + } + /** + * Calculate the length of this Vector squared. + * + * @since 3.0.0 + * + * @returns The length of this Vector, squared. + */ + lengthSq() { + const x = this.x; + const y = this.y; + return x * x + y * y; + } + /** + * Normalize this Vector. + * + * Makes the vector a unit length vector (magnitude of 1) in the same direction. + * + * @since 3.0.0 + * + * @returns This Vector2. + */ + normalize() { + const x = this.x; + const y = this.y; + let len = x * x + y * y; + if (len > 0) { + len = 1 / Math.sqrt(len); + this.x = x * len; + this.y = y * len; + } + return this; + } + /** + * Rotate this Vector to its perpendicular, in the positive direction. + * + * @since 3.0.0 + * + * @returns This Vector2. + */ + normalizeRightHand() { + const x = this.x; + this.x = this.y * -1; + this.y = x; + return this; + } + /** + * Rotate this Vector to its perpendicular, in the negative direction. + * + * @since 3.23.0 + * + * @returns This Vector2. + */ + normalizeLeftHand() { + const x = this.x; + this.x = this.y; + this.y = x * -1; + return this; + } + /** + * Calculate the dot product of this Vector and the given Vector. + * + * @since 3.0.0 + * + * @param src - The Vector2 to dot product with this Vector2. + * @returns The dot product of this Vector and the given Vector. + */ + dot(src) { + return this.x * src.x + this.y * src.y; + } + /** + * Calculate the cross product of this Vector and the given Vector. + * + * @since 3.0.0 + * + * @param src - The Vector2 to cross with this Vector2. + * @returns The cross product of this Vector and the given Vector. + */ + cross(src) { + return this.x * src.y - this.y * src.x; + } + /** + * Linearly interpolate between this Vector and the given Vector. + * + * Interpolates this Vector towards the given Vector. + * + * @since 3.0.0 + * + * @param src - The Vector2 to interpolate towards. + * @param t - The interpolation percentage, between 0 and 1. + * @returns This Vector2. + */ + lerp(src, t = 0) { + const ax = this.x; + const ay = this.y; + this.x = ax + t * (src.x - ax); + this.y = ay + t * (src.y - ay); + return this; + } + /** + * Transform this Vector with the given Matrix3. + * + * @since 3.0.0 + * + * @param mat - The Matrix3 to transform this Vector2 with. + * @returns This Vector2. + */ + transformMat3(mat) { + const x = this.x; + const y = this.y; + const m = mat.val; + this.x = m[0] * x + m[3] * y + m[6]; + this.y = m[1] * x + m[4] * y + m[7]; + return this; + } + /** + * Transform this Vector with the given Matrix4. + * + * @since 3.0.0 + * + * @param mat - The Matrix4 to transform this Vector2 with. + * @returns This Vector2. + */ + transformMat4(mat) { + const x = this.x; + const y = this.y; + const m = mat.val; + this.x = m[0] * x + m[4] * y + m[12]; + this.y = m[1] * x + m[5] * y + m[13]; + return this; + } + /** + * Make this Vector the zero vector (0, 0). + * + * @since 3.0.0 + * + * @returns This Vector2. + */ + reset() { + this.x = 0; + this.y = 0; + return this; + } + /** + * Limit the length (or magnitude) of this Vector. + * + * @since 3.23.0 + * + * @param max - The maximum length. + * @returns This Vector2. + */ + limit(max) { + const len = this.length(); + if (len && len > max) { + this.scale(max / len); + } + return this; + } + /** + * Reflect this Vector off a line defined by a normal. + * + * @since 3.23.0 + * + * @param normal - A vector perpendicular to the line. + * @returns This Vector2. + */ + reflect(normal) { + const n = normal.clone().normalize(); + return this.subtract(n.scale(2 * this.dot(n))); + } + /** + * Reflect this Vector across another. + * + * @since 3.23.0 + * + * @param axis - A vector to reflect across. + * @returns This Vector2. + */ + mirror(axis) { + return this.reflect(axis).negate(); + } + /** + * Rotate this Vector by an angle amount. + * + * @since 3.23.0 + * + * @param delta - The angle to rotate by, in radians. + * @returns This Vector2. + */ + rotate(delta) { + const cos = Math.cos(delta); + const sin = Math.sin(delta); + return this.set(cos * this.x - sin * this.y, sin * this.x + cos * this.y); + } + /** + * Project this Vector onto another. + * + * @since 3.60.0 + * + * @param src - The vector to project onto. + * @returns This Vector2. + */ + project(src) { + const scalar = this.dot(src) / src.dot(src); + return this.copy(src).scale(scalar); + } + /** + * Calculates the vector projection of this Vector2 onto the non-zero `vecB`. This is the + * orthogonal projection of this vector onto a straight line parallel to `vecB`. + * + * @since 4.0.0 + * + * @param vecB - The vector to project onto. + * @param out - The Vector2 object to store the position in. If not given, a new Vector2 instance is created. + * @returns The `out` Vector2 containing the projected values. + */ + projectUnit(vecB, out) { + if (out === void 0) { + out = new _Vector2(); + } + const amt = this.x * vecB.x + this.y * vecB.y; + if (amt !== 0) { + out.x = amt * vecB.x; + out.y = amt * vecB.y; + } + return out; + } +}; +/** + * A static zero Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @since 3.1.0 + */ +_Vector2.ZERO = new _Vector2(); +/** + * A static right Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @since 3.16.0 + */ +_Vector2.RIGHT = new _Vector2(1, 0); +/** + * A static left Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @since 3.16.0 + */ +_Vector2.LEFT = new _Vector2(-1, 0); +/** + * A static up Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @since 3.16.0 + */ +_Vector2.UP = new _Vector2(0, -1); +/** + * A static down Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @since 3.16.0 + */ +_Vector2.DOWN = new _Vector2(0, 1); +/** + * A static one Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @since 3.16.0 + */ +_Vector2.ONE = new _Vector2(1, 1); +let Vector2 = _Vector2; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Vector2); + + +/***/ }, + +/***/ 68077 +(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* unused harmony export Wrap */ + +/** + * @author Richard Davey + * @copyright 2013-2026 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ +function Wrap(value, min, max) { + const range = max - min; + return min + ((value - min) % range + range) % range; +} +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Wrap); + + +/***/ }, + +/***/ 30010 +(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* unused harmony export Equal */ + +/** + * @author Richard Davey + * @copyright 2013-2026 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ +function Equal(a, b, epsilon = 1e-4) { + return Math.abs(a - b) < epsilon; +} +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Equal); + + +/***/ }, + +/***/ 60269 +(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; + +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + "default": () => (/* binding */ structs_Map) +}); + +// UNUSED EXPORTS: Map + +;// ./utils/object/TypedObjectUtils.ts + +function objectKeys(obj) { + return Object.keys(obj); +} + +;// ./structs/Map.ts + +/** + * @author Richard Davey + * @copyright 2013-2026 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +class Map { + /** + * @param elements - An optional array of key-value pairs to populate this Map with. + */ + constructor(elements) { + this.entries = {}; + this.size = 0; + this.setAll(elements); + } + /** + * Adds all the elements in the given array to this Map. + * + * If the key already exists, the value will be replaced. + * + * @since 3.70.0 + * + * @param elements - An array of key-value pairs to populate this Map with. + * @returns This Map object. + */ + setAll(elements) { + if (Array.isArray(elements)) { + for (let i = 0; i < elements.length; i++) { + this.set(elements[i][0], elements[i][1]); + } + } + return this; + } + /** + * Adds an element with a specified `key` and `value` to this Map. + * + * If the `key` already exists, the value will be replaced. + * + * If you wish to add multiple elements in a single call, use the `setAll` method instead. + * + * @since 3.0.0 + * + * @param key - The key of the element to be added to this Map. + * @param value - The value of the element to be added to this Map. + * @returns This Map object. + */ + set(key, value) { + if (!this.has(key)) { + this.size++; + } + this.entries[key] = value; + return this; + } + /** + * Returns the value associated to the `key`, or `undefined` if there is none. + * + * @since 3.0.0 + * + * @param key - The key of the element to return from the `Map` object. + * @returns The element associated with the specified key or `undefined` if the key can't be found in this Map object. + */ + get(key) { + if (this.has(key)) { + return this.entries[key]; + } + } + /** + * Returns an `Array` of all the values stored in this Map. + * + * @since 3.0.0 + * + * @returns An array of the values stored in this Map. + */ + getArray() { + const output = []; + const entries = this.entries; + for (const key of objectKeys(entries)) { + output.push(entries[key]); + } + return output; + } + /** + * Returns a boolean indicating whether an element with the specified key exists or not. + * + * @since 3.0.0 + * + * @param key - The key of the element to test for presence of in this Map. + * @returns Returns `true` if an element with the specified key exists in this Map, otherwise `false`. + */ + has(key) { + return this.entries.hasOwnProperty(key); + } + /** + * Delete the specified element from this Map. + * + * @since 3.0.0 + * + * @param key - The key of the element to delete from this Map. + * @returns This Map object. + */ + delete(key) { + if (this.has(key)) { + delete this.entries[key]; + this.size--; + } + return this; + } + /** + * Delete all entries from this Map. + * + * @since 3.0.0 + * + * @returns This Map object. + */ + clear() { + for (const prop of objectKeys(this.entries)) { + delete this.entries[prop]; + } + this.size = 0; + return this; + } + /** + * Returns an array of all entry keys in this Map. + * + * @since 3.0.0 + * + * @returns Array containing entries' keys. + */ + keys() { + return objectKeys(this.entries); + } + /** + * Returns an `Array` of all values stored in this Map. + * + * @since 3.0.0 + * + * @returns An `Array` of values. + */ + values() { + const output = []; + const entries = this.entries; + for (const key of objectKeys(entries)) { + output.push(entries[key]); + } + return output; + } + /** + * Dumps the contents of this Map to the console via `console.group`. + * + * @since 3.0.0 + */ + dump() { + const entries = this.entries; + console.group("Map"); + for (const key of objectKeys(entries)) { + console.log(key, entries[key]); + } + console.groupEnd(); + } + /** + * Iterates through all entries in this Map, passing each one to the given callback. + * + * If the callback returns `false`, the iteration will break. + * + * @since 3.0.0 + * + * @param callback - The callback which will receive the keys and entries held in this Map. + * @returns This Map object. + */ + each(callback) { + const entries = this.entries; + for (const key of objectKeys(entries)) { + if (callback(key, entries[key]) === false) { + break; + } + } + return this; + } + /** + * Returns `true` if the value exists within this Map. Otherwise, returns `false`. + * + * @since 3.0.0 + * + * @param value - The value to search for. + * @returns `true` if the value is found, otherwise `false`. + */ + contains(value) { + const entries = this.entries; + for (const key of objectKeys(entries)) { + if (entries[key] === value) { + return true; + } + } + return false; + } + /** + * Merges all new keys from the given Map into this one. + * If it encounters a key that already exists it will be skipped unless override is set to `true`. + * + * @since 3.0.0 + * + * @param map - The Map to merge in to this Map. + * @param override - Set to `true` to replace values in this Map with those from the source map, or `false` to skip them. + * @returns This Map object. + */ + merge(map, override = false) { + const local = this.entries; + const source = map.entries; + for (const key of objectKeys(source)) { + if (local.hasOwnProperty(key) && override) { + local[key] = source[key]; + } else { + this.set(key, source[key]); + } + } + return this; + } +} +/* harmony default export */ const structs_Map = (Map); + + +/***/ }, + +/***/ 42969 +(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ AD: () => (/* binding */ applyMixin), +/* harmony export */ fP: () => (/* binding */ composeMixins), +/* harmony export */ lv: () => (/* binding */ defineMixin) +/* harmony export */ }); + +function isAccessorDescriptor(value) { + if (value === null || typeof value !== "object") { + return false; + } + const record = value; + return typeof record.get === "function" || typeof record.set === "function"; +} +function applyMixin(target, mixin) { + for (const key of Object.keys(mixin)) { + const value = mixin[key]; + if (isAccessorDescriptor(value)) { + Object.defineProperty(target.prototype, key, { + get: value.get, + set: value.set, + enumerable: true, + configurable: true + }); + } else { + Object.defineProperty(target.prototype, key, { + value, + writable: true, + enumerable: false, + configurable: true + }); + } + } +} +function defineMixin() { + return function(fn) { + return fn; + }; +} +function composeMixins(...mixins) { + return ((Base) => mixins.reduce((Current, mixin) => mixin(Current), Base)); +} + + +/***/ }, + /***/ 50792 (module) { @@ -33325,8 +35135,6 @@ var Blur = new Class({ Controller.call(this, camera, 'FilterBlur'); - // TODO: @GN suggests altering `boundedSampler` to better support full-screen effects where we don't want transparent borders. - /** * The quality of the blur effect. * @@ -42781,7 +44589,7 @@ var BitmapText = new Class({ */ displayWidth: { - set: function(value) + set: function (value) { this.setScaleX(1); @@ -42813,7 +44621,7 @@ var BitmapText = new Class({ */ displayHeight: { - set: function(value) + set: function (value) { this.setScaleY(1); @@ -45852,196 +47660,11 @@ module.exports = Crop; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -/** - * Provides methods used for setting the depth of a Game Object. - * Should be applied as a mixin and not used directly. - * - * @namespace Phaser.GameObjects.Components.Depth - * @since 3.0.0 - */ - -var ArrayUtils = __webpack_require__(37105); - -var Depth = { - - /** - * Private internal value. Holds the depth of the Game Object. - * - * @name Phaser.GameObjects.Components.Depth#_depth - * @type {number} - * @private - * @default 0 - * @since 3.0.0 - */ - _depth: 0, - - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * - * @name Phaser.GameObjects.Components.Depth#depth - * @type {number} - * @since 3.0.0 - */ - depth: { - - get: function () - { - return this._depth; - }, - - set: function (value) - { - if (this.displayList) - { - this.displayList.queueDepthSort(); - } - - this._depth = value; - } - - }, - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * - * @method Phaser.GameObjects.Components.Depth#setDepth - * @since 3.0.0 - * - * @param {number} value - The depth of this Game Object. Ensure this value is only ever a number data-type. - * - * @return {this} This Game Object instance. - */ - setDepth: function (value) - { - if (value === undefined) { value = 0; } - - this.depth = value; - - return this; - }, - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * - * @method Phaser.GameObjects.Components.Depth#setToTop - * @since 3.85.0 - * - * @return {this} This Game Object instance. - */ - setToTop: function () - { - var list = this.getDisplayList(); - - if (list) - { - ArrayUtils.BringToTop(list, this); - } - - return this; - }, - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * - * @method Phaser.GameObjects.Components.Depth#setToBack - * @since 3.85.0 - * - * @return {this} This Game Object instance. - */ - setToBack: function () - { - var list = this.getDisplayList(); - - if (list) - { - ArrayUtils.SendToBack(list, this); - } - - return this; - }, - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * - * @method Phaser.GameObjects.Components.Depth#setAbove - * @since 3.85.0 - * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that this Game Object will be moved to be above. - * - * @return {this} This Game Object instance. - */ - setAbove: function (gameObject) - { - var list = this.getDisplayList(); - - if (list && gameObject) - { - ArrayUtils.MoveAbove(list, this, gameObject); - } - - return this; - }, - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * - * @method Phaser.GameObjects.Components.Depth#setBelow - * @since 3.85.0 - * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that this Game Object will be moved to be below. - * - * @return {this} This Game Object instance. - */ - setBelow: function (gameObject) - { - var list = this.getDisplayList(); - - if (list && gameObject) - { - ArrayUtils.MoveBelow(list, this, gameObject); - } - - return this; - } - -}; - -module.exports = Depth; +// CJS compatibility wrapper — consumed by Class() factory Mixins arrays during the +// hybrid JS/TS migration period. Remove once all callers are TypeScript. +const mod = __webpack_require__(7889); +module.exports = mod.DepthDescriptors; +Object.defineProperty(module.exports, "Depth", ({ value: mod.Depth })); /***/ }, @@ -52501,7 +54124,7 @@ module.exports = TransformMatrix; /***/ }, /***/ 59715 -(module) { +(module, __unused_webpack_exports, __webpack_require__) { /** * @author Richard Davey @@ -52509,87 +54132,11 @@ module.exports = TransformMatrix; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -// bitmask flag for GameObject.renderMask -var _FLAG = 1; // 0001 - -/** - * Provides methods used for setting the visibility of a Game Object. - * The Visible component is mixed into Game Objects to give them a `visible` boolean property - * and a `setVisible` method. Visibility is tracked via a bitmask flag on `renderFlags`, so - * toggling it is a fast bitwise operation. An invisible Game Object is excluded from the - * render pass entirely, but its `update` logic continues to run normally each frame. - * Should be applied as a mixin and not used directly. - * - * @namespace Phaser.GameObjects.Components.Visible - * @since 3.0.0 - */ - -var Visible = { - - /** - * Private internal value. Holds the visible value. - * - * @name Phaser.GameObjects.Components.Visible#_visible - * @type {boolean} - * @private - * @default true - * @since 3.0.0 - */ - _visible: true, - - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * - * @name Phaser.GameObjects.Components.Visible#visible - * @type {boolean} - * @since 3.0.0 - */ - visible: { - - get: function () - { - return this._visible; - }, - - set: function (value) - { - if (value) - { - this._visible = true; - this.renderFlags |= _FLAG; - } - else - { - this._visible = false; - this.renderFlags &= ~_FLAG; - } - } - - }, - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * - * @method Phaser.GameObjects.Components.Visible#setVisible - * @since 3.0.0 - * - * @param {boolean} value - The visible state of the Game Object. - * - * @return {this} This Game Object instance. - */ - setVisible: function (value) - { - this.visible = value; - - return this; - } -}; - -module.exports = Visible; +// CJS compatibility wrapper — consumed by Class() factory Mixins arrays during the +// hybrid JS/TS migration period. Remove once all callers are TypeScript. +const mod = __webpack_require__(36626); +module.exports = mod.VisibleDescriptors; +Object.defineProperty(module.exports, "Visible", ({ value: mod.Visible })); /***/ }, @@ -52608,7 +54155,6 @@ module.exports = Visible; */ module.exports = { - Alpha: __webpack_require__(16005), AlphaSingle: __webpack_require__(88509), BlendMode: __webpack_require__(90065), @@ -65598,155 +67144,7 @@ module.exports = { /***/ 82513 (module, __unused_webpack_exports, __webpack_require__) { -/** - * @author Richard Davey - * @copyright 2013-2026 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(83419); -var Vector2 = __webpack_require__(26099); - -/** - * @classdesc - * Represents a single vertex within a NineSlice Game Object. - * - * A NineSlice Game Object is divided into a 3x3 grid of regions, each defined by a mesh - * of vertices. This class stores all the data needed for one vertex: its normalized position - * (x, y inherited from Vector2), its projected screen-space position (vx, vy), and its - * UV texture coordinates (u, v) used during rendering. - * - * You do not typically create NineSliceVertex instances directly. They are created and - * managed internally by the NineSlice Game Object. - * - * @class NineSliceVertex - * @memberof Phaser.GameObjects - * @constructor - * @extends Phaser.Math.Vector2 - * @since 4.0.0 - * - * @param {number} x - The x position of the vertex. - * @param {number} y - The y position of the vertex. - * @param {number} u - The UV u coordinate of the vertex. - * @param {number} v - The UV v coordinate of the vertex. - */ -var Vertex = new Class({ - - Extends: Vector2, - - initialize: - - function Vertex (x, y, u, v) - { - Vector2.call(this, x, y); - - /** - * The projected x coordinate of this vertex. - * - * @name Phaser.GameObjects.NineSliceVertex#vx - * @type {number} - * @since 4.0.0 - */ - this.vx = 0; - - /** - * The projected y coordinate of this vertex. - * - * @name Phaser.GameObjects.NineSliceVertex#vy - * @type {number} - * @since 4.0.0 - */ - this.vy = 0; - - /** - * UV u coordinate of this vertex. - * - * @name Phaser.GameObjects.NineSliceVertex#u - * @type {number} - * @since 4.0.0 - */ - this.u = u; - - /** - * UV v coordinate of this vertex. - * - * @name Phaser.GameObjects.NineSliceVertex#v - * @type {number} - * @since 4.0.0 - */ - this.v = v; - }, - - /** - * Sets the UV texture coordinates of this vertex. - * - * @method Phaser.GameObjects.NineSliceVertex#setUVs - * @since 4.0.0 - * - * @param {number} u - The UV u coordinate of the vertex. - * @param {number} v - The UV v coordinate of the vertex. - * - * @return {this} This Vertex. - */ - setUVs: function (u, v) - { - this.u = u; - this.v = v; - - return this; - }, - - /** - * Updates this vertex's position and calculates its projected screen-space coordinates. - * - * Sets the normalized `x` and `y` position, then scales them by the parent object's - * `width` and `height` to produce the projected `vx` and `vy` values. The origin - * offset of the parent object is then factored in, shifting `vx` and `vy` so that the - * mesh is correctly aligned relative to the object's origin point. - * - * @method Phaser.GameObjects.NineSliceVertex#resize - * @since 4.0.0 - * - * @param {number} x - The x position of the vertex. - * @param {number} y - The y position of the vertex. - * @param {number} width - The width of the parent object. - * @param {number} height - The height of the parent object. - * @param {number} originX - The originX of the parent object. - * @param {number} originY - The originY of the parent object. - * - * @return {this} This Vertex. - */ - resize: function (x, y, width, height, originX, originY) - { - this.x = x; - this.y = y; - - this.vx = this.x * width; - this.vy = -this.y * height; - - if (originX < 0.5) - { - this.vx += width * (0.5 - originX); - } - else if (originX > 0.5) - { - this.vx -= width * (originX - 0.5); - } - - if (originY < 0.5) - { - this.vy += height * (0.5 - originY); - } - else if (originY > 0.5) - { - this.vy -= height * (originY - 0.5); - } - - return this; - } -}); - -module.exports = Vertex; +module.exports = __webpack_require__(18134)["default"]; /***/ }, @@ -97327,316 +98725,10 @@ module.exports = VideoWebGLRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BlendModes = __webpack_require__(10312); -var Circle = __webpack_require__(96503); -var CircleContains = __webpack_require__(87902); -var Class = __webpack_require__(83419); -var Components = __webpack_require__(31401); -var GameObject = __webpack_require__(95643); -var Rectangle = __webpack_require__(87841); -var RectangleContains = __webpack_require__(37303); - -/** - * @classdesc - * A Zone is a non-rendering rectangular Game Object that has a position and size but no texture. - * It never displays visually, but it does live on the display list and can be moved, scaled, - * and rotated like any other Game Object. - * - * Its primary use is for creating Drop Zones and Input Hit Areas. It provides helper methods for - * both circular and rectangular drop zones, and can also accept custom geometry shapes. Zones are - * also useful for object overlap checks, or as a base class for your own non-displaying Game Objects. - * - * The default origin is 0.5, placing it at the center of the Zone, consistent with other Game Objects. - * - * @class Zone - * @extends Phaser.GameObjects.GameObject - * @memberof Phaser.GameObjects - * @constructor - * @since 3.0.0 - * - * @extends Phaser.GameObjects.Components.Depth - * @extends Phaser.GameObjects.Components.GetBounds - * @extends Phaser.GameObjects.Components.Origin - * @extends Phaser.GameObjects.Components.Transform - * @extends Phaser.GameObjects.Components.ScrollFactor - * @extends Phaser.GameObjects.Components.Visible - * - * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. - * @param {number} x - The horizontal position of this Game Object in the world. - * @param {number} y - The vertical position of this Game Object in the world. - * @param {number} [width=1] - The width of the Game Object. - * @param {number} [height=1] - The height of the Game Object. - */ -var Zone = new Class({ - - Extends: GameObject, - - Mixins: [ - Components.Depth, - Components.GetBounds, - Components.Origin, - Components.Transform, - Components.ScrollFactor, - Components.Visible - ], - - initialize: - - function Zone (scene, x, y, width, height) - { - if (width === undefined) { width = 1; } - if (height === undefined) { height = width; } - - GameObject.call(this, scene, 'Zone'); - - this.setPosition(x, y); - - /** - * The native (un-scaled) width of this Game Object. - * - * @name Phaser.GameObjects.Zone#width - * @type {number} - * @since 3.0.0 - */ - this.width = width; - - /** - * The native (un-scaled) height of this Game Object. - * - * @name Phaser.GameObjects.Zone#height - * @type {number} - * @since 3.0.0 - */ - this.height = height; - - /** - * The Blend Mode of the Game Object. - * Although a Zone never renders, it still has a blend mode to allow it to fit seamlessly into - * display lists without causing a batch flush. - * - * @name Phaser.GameObjects.Zone#blendMode - * @type {number} - * @since 3.0.0 - */ - this.blendMode = BlendModes.NORMAL; - - this.updateDisplayOrigin(); - }, - - /** - * The displayed width of this Game Object. - * This value takes into account the scale factor. - * - * @name Phaser.GameObjects.Zone#displayWidth - * @type {number} - * @since 3.0.0 - */ - displayWidth: { - - get: function () - { - return this.scaleX * this.width; - }, - - set: function (value) - { - this.scaleX = value / this.width; - } - - }, - - /** - * The displayed height of this Game Object. - * This value takes into account the scale factor. - * - * @name Phaser.GameObjects.Zone#displayHeight - * @type {number} - * @since 3.0.0 - */ - displayHeight: { - - get: function () - { - return this.scaleY * this.height; - }, - - set: function (value) - { - this.scaleY = value / this.height; - } - - }, - - /** - * Sets the native (un-scaled) width and height of this Zone. Also updates the display origin - * and, by default, resizes any non-custom input hit area associated with this Zone. - * - * @method Phaser.GameObjects.Zone#setSize - * @since 3.0.0 - * - * @param {number} width - The width of this Game Object. - * @param {number} height - The height of this Game Object. - * @param {boolean} [resizeInput=true] - If this Zone has a Rectangle for a hit area this argument will resize the hit area as well. - * - * @return {this} This Game Object. - */ - setSize: function (width, height, resizeInput) - { - if (resizeInput === undefined) { resizeInput = true; } - - this.width = width; - this.height = height; - - this.updateDisplayOrigin(); - - var input = this.input; - - if (resizeInput && input && !input.customHitArea) - { - input.hitArea.width = width; - input.hitArea.height = height; - } - - return this; - }, - - /** - * Sets the display size of this Game Object. - * Calling this will adjust the scale. - * - * @method Phaser.GameObjects.Zone#setDisplaySize - * @since 3.0.0 - * - * @param {number} width - The width of this Game Object. - * @param {number} height - The height of this Game Object. - * - * @return {this} This Game Object. - */ - setDisplaySize: function (width, height) - { - this.displayWidth = width; - this.displayHeight = height; - - return this; - }, - - /** - * Sets this Zone to be a Circular Drop Zone. - * The circle is centered on this Zone's `x` and `y` coordinates. - * - * @method Phaser.GameObjects.Zone#setCircleDropZone - * @since 3.0.0 - * - * @param {number} radius - The radius of the Circle that will form the Drop Zone. - * - * @return {this} This Game Object. - */ - setCircleDropZone: function (radius) - { - return this.setDropZone(new Circle(0, 0, radius), CircleContains); - }, - - /** - * Sets this Zone to be a Rectangle Drop Zone. - * The rectangle is centered on this Zone's `x` and `y` coordinates. - * - * @method Phaser.GameObjects.Zone#setRectangleDropZone - * @since 3.0.0 - * - * @param {number} width - The width of the rectangle drop zone. - * @param {number} height - The height of the rectangle drop zone. - * - * @return {this} This Game Object. - */ - setRectangleDropZone: function (width, height) - { - return this.setDropZone(new Rectangle(0, 0, width, height), RectangleContains); - }, - - /** - * Enables this Zone as an interactive Drop Zone by calling `setInteractive` with the given - * hit area shape and callback. You can pass any Phaser geometry shape, or a custom shape with - * a matching hit-test callback. If no arguments are provided, a Rectangle matching the size of - * this Zone will be used automatically. Has no effect if this Zone is already interactive. - * - * @method Phaser.GameObjects.Zone#setDropZone - * @since 3.0.0 - * - * @param {object} [hitArea] - A Geometry shape instance, such as Phaser.Geom.Ellipse, or your own custom shape. If not given it will try to create a Rectangle based on the size of this zone. - * @param {Phaser.Types.Input.HitAreaCallback} [hitAreaCallback] - A function that will return `true` if the given x/y coords it is sent are within the shape. If you provide a shape you must also provide a callback. - * - * @return {this} This Game Object. - */ - setDropZone: function (hitArea, hitAreaCallback) - { - if (!this.input) - { - this.setInteractive(hitArea, hitAreaCallback, true); - } - - return this; - }, - - /** - * A NOOP method so you can pass a Zone to a Container. - * Calling this method will do nothing. It is intentionally empty. - * - * @method Phaser.GameObjects.Zone#setAlpha - * @private - * @since 3.11.0 - */ - setAlpha: function () - { - }, - - /** - * A NOOP method so you can pass a Zone to a Container in Canvas. - * Calling this method will do nothing. It is intentionally empty. - * - * @method Phaser.GameObjects.Zone#setBlendMode - * @private - * @since 3.16.2 - */ - setBlendMode: function () - { - }, - - /** - * A Zone does not render. - * - * @method Phaser.GameObjects.Zone#renderCanvas - * @private - * @since 3.53.0 - * - * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. - * @param {Phaser.GameObjects.Image} src - The Game Object being rendered in this call. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested - */ - renderCanvas: function (renderer, src, camera) - { - camera.addToRenderList(src); - }, - - /** - * A Zone does not render. - * - * @method Phaser.GameObjects.Zone#renderWebGL - * @private - * @since 3.53.0 - * - * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. - * @param {Phaser.GameObjects.Image} src - The Game Object being rendered in this call. - * @param {Phaser.Renderer.WebGL.DrawingContext} drawingContext - The current drawing context. - */ - renderWebGL: function (renderer, src, drawingContext) - { - drawingContext.camera.addToRenderList(src); - } - -}); - -module.exports = Zone; +// CJS compatibility wrapper — consumed by the hybrid build pipeline and any +// remaining JS callers during the migration period. Remove once all callers +// are TypeScript. +module.exports = __webpack_require__(58715)["default"]; /***/ }, @@ -105301,37 +106393,11 @@ module.exports = Clone; /***/ }, /***/ 37303 -(module) { - -/** - * @author Richard Davey - * @copyright 2013-2026 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Checks if a given point is inside a Rectangle's bounds. - * - * @function Phaser.Geom.Rectangle.Contains - * @since 3.0.0 - * - * @param {Phaser.Geom.Rectangle} rect - The Rectangle to check. - * @param {number} x - The X coordinate of the point to check. - * @param {number} y - The Y coordinate of the point to check. - * - * @return {boolean} `true` if the point is within the Rectangle's bounds, otherwise `false`. - */ -var Contains = function (rect, x, y) -{ - if (rect.width <= 0 || rect.height <= 0) - { - return false; - } - - return (rect.x <= x && rect.x + rect.width >= x && rect.y <= y && rect.y + rect.height >= y); -}; +(module, __unused_webpack_exports, __webpack_require__) { -module.exports = Contains; +const mod = __webpack_require__(72488); +module.exports = mod.default; +module.exports.Contains = mod.Contains; /***/ }, @@ -106739,518 +107805,9 @@ module.exports = RandomOutside; /***/ 87841 (module, __unused_webpack_exports, __webpack_require__) { -/** - * @author Richard Davey - * @copyright 2013-2026 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(83419); -var Contains = __webpack_require__(37303); -var GetPoint = __webpack_require__(20812); -var GetPoints = __webpack_require__(34819); -var GEOM_CONST = __webpack_require__(23777); -var Line = __webpack_require__(23031); -var Random = __webpack_require__(26597); - -/** - * @classdesc - * A Rectangle is an axis-aligned region of 2D space defined by its top-left corner position (`x`, `y`) and its - * dimensions (`width`, `height`). It is one of the core geometric primitives in Phaser and is used extensively - * throughout the framework for bounds checking, camera viewports, hit areas, culling regions, and UI layout. - * - * Rectangles support containment tests, perimeter point sampling, and many other geometric operations available - * via the `Phaser.Geom.Rectangle` static methods. The `left`, `right`, `top`, `bottom`, `centerX`, and `centerY` - * properties provide convenient access to derived positional values and can be set directly to reposition or - * resize the Rectangle. - * - * @class Rectangle - * @memberof Phaser.Geom - * @constructor - * @since 3.0.0 - * - * @param {number} [x=0] - The X coordinate of the top left corner of the Rectangle. - * @param {number} [y=0] - The Y coordinate of the top left corner of the Rectangle. - * @param {number} [width=0] - The width of the Rectangle. - * @param {number} [height=0] - The height of the Rectangle. - */ -var Rectangle = new Class({ - - initialize: - - function Rectangle (x, y, width, height) - { - if (x === undefined) { x = 0; } - if (y === undefined) { y = 0; } - if (width === undefined) { width = 0; } - if (height === undefined) { height = 0; } - - /** - * The geometry constant type of this object: `GEOM_CONST.RECTANGLE`. - * Used for fast type comparisons. - * - * @name Phaser.Geom.Rectangle#type - * @type {number} - * @readonly - * @since 3.19.0 - */ - this.type = GEOM_CONST.RECTANGLE; - - /** - * The X coordinate of the top left corner of the Rectangle. - * - * @name Phaser.Geom.Rectangle#x - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.x = x; - - /** - * The Y coordinate of the top left corner of the Rectangle. - * - * @name Phaser.Geom.Rectangle#y - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.y = y; - - /** - * The width of the Rectangle, i.e. the distance between its left side (defined by `x`) and its right side. - * - * @name Phaser.Geom.Rectangle#width - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.width = width; - - /** - * The height of the Rectangle, i.e. the distance between its top side (defined by `y`) and its bottom side. - * - * @name Phaser.Geom.Rectangle#height - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.height = height; - }, - - /** - * Checks if the given point is inside the Rectangle's bounds. - * - * @method Phaser.Geom.Rectangle#contains - * @since 3.0.0 - * - * @param {number} x - The X coordinate of the point to check. - * @param {number} y - The Y coordinate of the point to check. - * - * @return {boolean} `true` if the point is within the Rectangle's bounds, otherwise `false`. - */ - contains: function (x, y) - { - return Contains(this, x, y); - }, - - /** - * Calculates the coordinates of a point at a certain `position` on the Rectangle's perimeter. - * - * The `position` is a fraction between 0 and 1 which defines how far into the perimeter the point is. - * - * A value of 0 or 1 returns the point at the top left corner of the rectangle, while a value of 0.5 returns the point at the bottom right corner of the rectangle. Values between 0 and 0.5 are on the top or the right side and values between 0.5 and 1 are on the bottom or the left side. - * - * @method Phaser.Geom.Rectangle#getPoint - * @since 3.0.0 - * - * @generic {Phaser.Math.Vector2} O - [output,$return] - * - * @param {number} position - The normalized distance into the Rectangle's perimeter to return. - * @param {Phaser.Math.Vector2} [output] - A Vector2 instance to update with the `x` and `y` coordinates of the point. - * - * @return {Phaser.Math.Vector2} The updated `output` object, or a new Vector2 if no `output` object was given. - */ - getPoint: function (position, output) - { - return GetPoint(this, position, output); - }, - - /** - * Returns an array of points from the perimeter of the Rectangle, each spaced out based on the quantity or step required. - * - * @method Phaser.Geom.Rectangle#getPoints - * @since 3.0.0 - * - * @generic {Phaser.Math.Vector2[]} O - [output,$return] - * - * @param {number} quantity - The number of points to return. Set to `false` or 0 to return an arbitrary number of points (`perimeter / stepRate`) evenly spaced around the Rectangle based on the `stepRate`. - * @param {number} [stepRate] - If `quantity` is 0, determines the normalized distance between each returned point. - * @param {Phaser.Math.Vector2[]} [output] - An array to which to append the points. - * - * @return {Phaser.Math.Vector2[]} The modified `output` array, or a new array if none was provided. - */ - getPoints: function (quantity, stepRate, output) - { - return GetPoints(this, quantity, stepRate, output); - }, - - /** - * Returns a random point within the Rectangle's bounds. - * - * @method Phaser.Geom.Rectangle#getRandomPoint - * @since 3.0.0 - * - * @generic {Phaser.Math.Vector2} O - [point,$return] - * - * @param {Phaser.Math.Vector2} [vec] - The object in which to store the `x` and `y` coordinates of the point. - * - * @return {Phaser.Math.Vector2} The updated `vec`, or a new Vector2 if none was provided. - */ - getRandomPoint: function (vec) - { - return Random(this, vec); - }, - - /** - * Sets the position, width, and height of the Rectangle. - * - * @method Phaser.Geom.Rectangle#setTo - * @since 3.0.0 - * - * @param {number} x - The X coordinate of the top left corner of the Rectangle. - * @param {number} y - The Y coordinate of the top left corner of the Rectangle. - * @param {number} width - The width of the Rectangle. - * @param {number} height - The height of the Rectangle. - * - * @return {this} This Rectangle object. - */ - setTo: function (x, y, width, height) - { - this.x = x; - this.y = y; - this.width = width; - this.height = height; - - return this; - }, - - /** - * Resets the position, width, and height of the Rectangle to 0. - * - * @method Phaser.Geom.Rectangle#setEmpty - * @since 3.0.0 - * - * @return {this} This Rectangle object. - */ - setEmpty: function () - { - return this.setTo(0, 0, 0, 0); - }, - - /** - * Sets the position of the Rectangle. - * - * @method Phaser.Geom.Rectangle#setPosition - * @since 3.0.0 - * - * @param {number} x - The X coordinate of the top left corner of the Rectangle. - * @param {number} [y=x] - The Y coordinate of the top left corner of the Rectangle. - * - * @return {this} This Rectangle object. - */ - setPosition: function (x, y) - { - if (y === undefined) { y = x; } - - this.x = x; - this.y = y; - - return this; - }, - - /** - * Sets the width and height of the Rectangle. - * - * @method Phaser.Geom.Rectangle#setSize - * @since 3.0.0 - * - * @param {number} width - The width to set the Rectangle to. - * @param {number} [height=width] - The height to set the Rectangle to. - * - * @return {this} This Rectangle object. - */ - setSize: function (width, height) - { - if (height === undefined) { height = width; } - - this.width = width; - this.height = height; - - return this; - }, - - /** - * Determines if the Rectangle is empty. A Rectangle is empty if its width or height is less than or equal to 0. - * - * @method Phaser.Geom.Rectangle#isEmpty - * @since 3.0.0 - * - * @return {boolean} `true` if the Rectangle is empty, otherwise `false`. - */ - isEmpty: function () - { - return (this.width <= 0 || this.height <= 0); - }, - - /** - * Returns a Line object that corresponds to the top of this Rectangle. - * - * @method Phaser.Geom.Rectangle#getLineA - * @since 3.0.0 - * - * @generic {Phaser.Geom.Line} O - [line,$return] - * - * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. - * - * @return {Phaser.Geom.Line} A Line object that corresponds to the top of this Rectangle. - */ - getLineA: function (line) - { - if (line === undefined) { line = new Line(); } - - line.setTo(this.x, this.y, this.right, this.y); - - return line; - }, - - /** - * Returns a Line object that corresponds to the right of this Rectangle. - * - * @method Phaser.Geom.Rectangle#getLineB - * @since 3.0.0 - * - * @generic {Phaser.Geom.Line} O - [line,$return] - * - * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. - * - * @return {Phaser.Geom.Line} A Line object that corresponds to the right of this Rectangle. - */ - getLineB: function (line) - { - if (line === undefined) { line = new Line(); } - - line.setTo(this.right, this.y, this.right, this.bottom); - - return line; - }, - - /** - * Returns a Line object that corresponds to the bottom of this Rectangle. - * - * @method Phaser.Geom.Rectangle#getLineC - * @since 3.0.0 - * - * @generic {Phaser.Geom.Line} O - [line,$return] - * - * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. - * - * @return {Phaser.Geom.Line} A Line object that corresponds to the bottom of this Rectangle. - */ - getLineC: function (line) - { - if (line === undefined) { line = new Line(); } - - line.setTo(this.right, this.bottom, this.x, this.bottom); - - return line; - }, - - /** - * Returns a Line object that corresponds to the left of this Rectangle. - * - * @method Phaser.Geom.Rectangle#getLineD - * @since 3.0.0 - * - * @generic {Phaser.Geom.Line} O - [line,$return] - * - * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. - * - * @return {Phaser.Geom.Line} A Line object that corresponds to the left of this Rectangle. - */ - getLineD: function (line) - { - if (line === undefined) { line = new Line(); } - - line.setTo(this.x, this.bottom, this.x, this.y); - - return line; - }, - - /** - * The x coordinate of the left of the Rectangle. - * Changing the left property of a Rectangle object has no effect on the y and height properties. However it does affect the width property, whereas changing the x value does not affect the width property. - * - * @name Phaser.Geom.Rectangle#left - * @type {number} - * @since 3.0.0 - */ - left: { - - get: function () - { - return this.x; - }, - - set: function (value) - { - if (value >= this.right) - { - this.width = 0; - } - else - { - this.width = this.right - value; - } - - this.x = value; - } - - }, - - /** - * The sum of the x and width properties. - * Changing the right property of a Rectangle object has no effect on the x, y and height properties, however it does affect the width property. - * - * @name Phaser.Geom.Rectangle#right - * @type {number} - * @since 3.0.0 - */ - right: { - - get: function () - { - return this.x + this.width; - }, - - set: function (value) - { - if (value <= this.x) - { - this.width = 0; - } - else - { - this.width = value - this.x; - } - } - - }, - - /** - * The y coordinate of the top of the Rectangle. Changing the top property of a Rectangle object has no effect on the x and width properties. - * However it does affect the height property, whereas changing the y value does not affect the height property. - * - * @name Phaser.Geom.Rectangle#top - * @type {number} - * @since 3.0.0 - */ - top: { - - get: function () - { - return this.y; - }, - - set: function (value) - { - if (value >= this.bottom) - { - this.height = 0; - } - else - { - this.height = (this.bottom - value); - } - - this.y = value; - } - - }, - - /** - * The sum of the y and height properties. - * Changing the bottom property of a Rectangle object has no effect on the x, y and width properties, but does change the height property. - * - * @name Phaser.Geom.Rectangle#bottom - * @type {number} - * @since 3.0.0 - */ - bottom: { - - get: function () - { - return this.y + this.height; - }, - - set: function (value) - { - if (value <= this.y) - { - this.height = 0; - } - else - { - this.height = value - this.y; - } - } - - }, - - /** - * The x coordinate of the center of the Rectangle. - * - * @name Phaser.Geom.Rectangle#centerX - * @type {number} - * @since 3.0.0 - */ - centerX: { - - get: function () - { - return this.x + (this.width / 2); - }, - - set: function (value) - { - this.x = value - (this.width / 2); - } - - }, - - /** - * The y coordinate of the center of the Rectangle. - * - * @name Phaser.Geom.Rectangle#centerY - * @type {number} - * @since 3.0.0 - */ - centerY: { - - get: function () - { - return this.y + (this.height / 2); - }, - - set: function (value) - { - this.y = value - (this.height / 2); - } - - } - -}); - -module.exports = Rectangle; +const mod = __webpack_require__(59428); +module.exports = mod.default; +module.exports.Rectangle = mod.Rectangle; /***/ }, @@ -124035,13 +124592,11 @@ module.exports = MouseManager; * @namespace Phaser.Input.Mouse */ -/* eslint-disable */ module.exports = { MouseManager: __webpack_require__(85098) }; -/* eslint-enable */ /***/ }, @@ -124467,13 +125022,11 @@ module.exports = TouchManager; * @namespace Phaser.Input.Touch */ -/* eslint-disable */ module.exports = { TouchManager: __webpack_require__(36210) }; -/* eslint-enable */ /***/ }, @@ -136330,32 +136883,9 @@ module.exports = CeilTo; /***/ }, /***/ 45319 -(module) { - -/** - * @author Richard Davey - * @copyright 2013-2026 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Force a value within the boundaries by clamping it to the range `min`, `max`. - * - * @function Phaser.Math.Clamp - * @since 3.0.0 - * - * @param {number} value - The value to be clamped. - * @param {number} min - The minimum bounds. - * @param {number} max - The maximum bounds. - * - * @return {number} The clamped value. - */ -var Clamp = function (value, min, max) -{ - return Math.max(min, Math.min(max, value)); -}; +(module, __unused_webpack_exports, __webpack_require__) { -module.exports = Clamp; +module.exports = __webpack_require__(350)["default"]; /***/ }, @@ -142720,870 +143250,7 @@ module.exports = TransformXY; /***/ 26099 (module, __unused_webpack_exports, __webpack_require__) { -/** - * @author Richard Davey - * @copyright 2013-2026 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji -// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl - -var Class = __webpack_require__(83419); -var FuzzyEqual = __webpack_require__(43855); - -/** - * @classdesc - * A representation of a vector in 2D space, defined by an `x` and `y` component. - * - * Vector2 is used throughout Phaser for positions, directions, velocities, and other - * quantities that have both magnitude and direction. It provides methods for common - * vector operations such as addition, subtraction, scaling, normalization, dot and - * cross products, linear interpolation, and rotation. Many Phaser APIs accept a - * `Vector2Like` object (any object with `x` and `y` number properties), making - * Vector2 easy to integrate across the framework. - * - * @class Vector2 - * @memberof Phaser.Math - * @constructor - * @since 3.0.0 - * - * @param {number|Phaser.Types.Math.Vector2Like} [x=0] - The x component, or an object with `x` and `y` properties. - * @param {number} [y=x] - The y component. - */ -var Vector2 = new Class({ - - initialize: - - function Vector2 (x, y) - { - /** - * The x component of this Vector. - * - * @name Phaser.Math.Vector2#x - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.x = 0; - - /** - * The y component of this Vector. - * - * @name Phaser.Math.Vector2#y - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.y = 0; - - if (typeof x === 'object') - { - this.x = x.x || 0; - this.y = x.y || 0; - } - else - { - if (y === undefined) { y = x; } - - this.x = x || 0; - this.y = y || 0; - } - }, - - /** - * Make a clone of this Vector2. - * - * @method Phaser.Math.Vector2#clone - * @since 3.0.0 - * - * @return {Phaser.Math.Vector2} A clone of this Vector2. - */ - clone: function () - { - return new Vector2(this.x, this.y); - }, - - /** - * Copy the components of a given Vector into this Vector. - * - * @method Phaser.Math.Vector2#copy - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector to copy the components from. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - copy: function (src) - { - this.x = src.x || 0; - this.y = src.y || 0; - - return this; - }, - - /** - * Set the component values of this Vector from a given Vector2Like object. - * - * @method Phaser.Math.Vector2#setFromObject - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} obj - The object containing the component values to set for this Vector. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - setFromObject: function (obj) - { - this.x = obj.x || 0; - this.y = obj.y || 0; - - return this; - }, - - /** - * Set the `x` and `y` components of this Vector to the given `x` and `y` values. - * - * @method Phaser.Math.Vector2#set - * @since 3.0.0 - * - * @param {number} x - The x value to set for this Vector. - * @param {number} [y=x] - The y value to set for this Vector. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - set: function (x, y) - { - if (y === undefined) { y = x; } - - this.x = x; - this.y = y; - - return this; - }, - - /** - * This method is an alias for `Vector2.set`. - * - * @method Phaser.Math.Vector2#setTo - * @since 3.4.0 - * - * @param {number} x - The x value to set for this Vector. - * @param {number} [y=x] - The y value to set for this Vector. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - setTo: function (x, y) - { - return this.set(x, y); - }, - - /** - * Runs the x and y components of this Vector2 through Math.ceil and then sets them. - * - * @method Phaser.Math.Vector2#ceil - * @since 4.0.0 - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - ceil: function () - { - this.x = Math.ceil(this.x); - this.y = Math.ceil(this.y); - - return this; - }, - - /** - * Runs the x and y components of this Vector2 through Math.floor and then sets them. - * - * @method Phaser.Math.Vector2#floor - * @since 4.0.0 - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - floor: function () - { - this.x = Math.floor(this.x); - this.y = Math.floor(this.y); - - return this; - }, - - /** - * Swaps the x and y components of this Vector2. - * - * @method Phaser.Math.Vector2#invert - * @since 4.0.0 - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - invert: function () - { - return this.set(this.y, this.x); - }, - - /** - * Sets the x and y components of this Vector from the given angle and length. - * - * @method Phaser.Math.Vector2#setToPolar - * @since 3.0.0 - * - * @param {number} angle - The angle from the positive x-axis, in radians. - * @param {number} [length=1] - The distance from the origin. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - setToPolar: function (angle, length) - { - if (length == null) { length = 1; } - - this.x = Math.cos(angle) * length; - this.y = Math.sin(angle) * length; - - return this; - }, - - /** - * Check whether this Vector is equal to a given Vector. - * - * Performs a strict equality check against each Vector's components. - * - * @method Phaser.Math.Vector2#equals - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} v - The vector to compare with this Vector. - * - * @return {boolean} Whether the given Vector is equal to this Vector. - */ - equals: function (v) - { - return ((this.x === v.x) && (this.y === v.y)); - }, - - /** - * Check whether this Vector is approximately equal to a given Vector. - * - * @method Phaser.Math.Vector2#fuzzyEquals - * @since 3.23.0 - * - * @param {Phaser.Types.Math.Vector2Like} v - The vector to compare with this Vector. - * @param {number} [epsilon=0.0001] - The tolerance value. - * - * @return {boolean} Whether both absolute differences of the x and y components are smaller than `epsilon`. - */ - fuzzyEquals: function (v, epsilon) - { - return (FuzzyEqual(this.x, v.x, epsilon) && FuzzyEqual(this.y, v.y, epsilon)); - }, - - /** - * Calculate the angle between this Vector and the positive x-axis, in radians. - * - * @method Phaser.Math.Vector2#angle - * @since 3.0.0 - * - * @return {number} The angle between this Vector, and the positive x-axis, given in radians. - */ - angle: function () - { - // computes the angle in radians with respect to the positive x-axis - - var angle = Math.atan2(this.y, this.x); - - if (angle < 0) - { - angle += 2 * Math.PI; - } - - return angle; - }, - - /** - * Set the angle of this Vector. - * - * @method Phaser.Math.Vector2#setAngle - * @since 3.23.0 - * - * @param {number} angle - The angle, in radians. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - setAngle: function (angle) - { - return this.setToPolar(angle, this.length()); - }, - - /** - * Add a given Vector to this Vector. Addition is component-wise. - * - * @method Phaser.Math.Vector2#add - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector to add to this Vector. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - add: function (src) - { - this.x += src.x; - this.y += src.y; - - return this; - }, - - /** - * Subtract the given Vector from this Vector. Subtraction is component-wise. - * - * @method Phaser.Math.Vector2#subtract - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector to subtract from this Vector. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - subtract: function (src) - { - this.x -= src.x; - this.y -= src.y; - - return this; - }, - - /** - * Perform a component-wise multiplication between this Vector and the given Vector. - * - * Multiplies this Vector by the given Vector. - * - * @method Phaser.Math.Vector2#multiply - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector to multiply this Vector by. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - multiply: function (src) - { - this.x *= src.x; - this.y *= src.y; - - return this; - }, - - /** - * Scale this Vector by the given value. - * - * @method Phaser.Math.Vector2#scale - * @since 3.0.0 - * - * @param {number} value - The value to scale this Vector by. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - scale: function (value) - { - if (isFinite(value)) - { - this.x *= value; - this.y *= value; - } - else - { - this.x = 0; - this.y = 0; - } - - return this; - }, - - /** - * Perform a component-wise division between this Vector and the given Vector. - * - * Divides this Vector by the given Vector. - * - * @method Phaser.Math.Vector2#divide - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector to divide this Vector by. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - divide: function (src) - { - this.x /= src.x; - this.y /= src.y; - - return this; - }, - - /** - * Negate the `x` and `y` components of this Vector. - * - * @method Phaser.Math.Vector2#negate - * @since 3.0.0 - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - negate: function () - { - this.x = -this.x; - this.y = -this.y; - - return this; - }, - - /** - * Calculate the distance between this Vector and the given Vector. - * - * @method Phaser.Math.Vector2#distance - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector to calculate the distance to. - * - * @return {number} The distance from this Vector to the given Vector. - */ - distance: function (src) - { - var dx = src.x - this.x; - var dy = src.y - this.y; - - return Math.sqrt(dx * dx + dy * dy); - }, - - /** - * Calculate the distance between this Vector and the given Vector, squared. - * - * @method Phaser.Math.Vector2#distanceSq - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector to calculate the distance to. - * - * @return {number} The distance from this Vector to the given Vector, squared. - */ - distanceSq: function (src) - { - var dx = src.x - this.x; - var dy = src.y - this.y; - - return dx * dx + dy * dy; - }, - - /** - * Calculate the length (or magnitude) of this Vector. - * - * @method Phaser.Math.Vector2#length - * @since 3.0.0 - * - * @return {number} The length of this Vector. - */ - length: function () - { - var x = this.x; - var y = this.y; - - return Math.sqrt(x * x + y * y); - }, - - /** - * Set the length (or magnitude) of this Vector. - * - * @method Phaser.Math.Vector2#setLength - * @since 3.23.0 - * - * @param {number} length - The new magnitude of this Vector. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - setLength: function (length) - { - return this.normalize().scale(length); - }, - - /** - * Calculate the length of this Vector squared. - * - * @method Phaser.Math.Vector2#lengthSq - * @since 3.0.0 - * - * @return {number} The length of this Vector, squared. - */ - lengthSq: function () - { - var x = this.x; - var y = this.y; - - return x * x + y * y; - }, - - /** - * Normalize this Vector. - * - * Makes the vector a unit length vector (magnitude of 1) in the same direction. - * - * @method Phaser.Math.Vector2#normalize - * @since 3.0.0 - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - normalize: function () - { - var x = this.x; - var y = this.y; - var len = x * x + y * y; - - if (len > 0) - { - len = 1 / Math.sqrt(len); - - this.x = x * len; - this.y = y * len; - } - - return this; - }, - - /** - * Rotate this Vector to its perpendicular, in the positive direction. - * - * @method Phaser.Math.Vector2#normalizeRightHand - * @since 3.0.0 - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - normalizeRightHand: function () - { - var x = this.x; - - this.x = this.y * -1; - this.y = x; - - return this; - }, - - /** - * Rotate this Vector to its perpendicular, in the negative direction. - * - * @method Phaser.Math.Vector2#normalizeLeftHand - * @since 3.23.0 - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - normalizeLeftHand: function () - { - var x = this.x; - - this.x = this.y; - this.y = x * -1; - - return this; - }, - - /** - * Calculate the dot product of this Vector and the given Vector. - * - * @method Phaser.Math.Vector2#dot - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector2 to dot product with this Vector2. - * - * @return {number} The dot product of this Vector and the given Vector. - */ - dot: function (src) - { - return this.x * src.x + this.y * src.y; - }, - - /** - * Calculate the cross product of this Vector and the given Vector. - * - * @method Phaser.Math.Vector2#cross - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector2 to cross with this Vector2. - * - * @return {number} The cross product of this Vector and the given Vector. - */ - cross: function (src) - { - return this.x * src.y - this.y * src.x; - }, - - /** - * Linearly interpolate between this Vector and the given Vector. - * - * Interpolates this Vector towards the given Vector. - * - * @method Phaser.Math.Vector2#lerp - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector2 to interpolate towards. - * @param {number} [t=0] - The interpolation percentage, between 0 and 1. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - lerp: function (src, t) - { - if (t === undefined) { t = 0; } - - var ax = this.x; - var ay = this.y; - - this.x = ax + t * (src.x - ax); - this.y = ay + t * (src.y - ay); - - return this; - }, - - /** - * Transform this Vector with the given Matrix3. - * - * @method Phaser.Math.Vector2#transformMat3 - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix3} mat - The Matrix3 to transform this Vector2 with. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - transformMat3: function (mat) - { - var x = this.x; - var y = this.y; - var m = mat.val; - - this.x = m[0] * x + m[3] * y + m[6]; - this.y = m[1] * x + m[4] * y + m[7]; - - return this; - }, - - /** - * Transform this Vector with the given Matrix4. - * - * @method Phaser.Math.Vector2#transformMat4 - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector2 with. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - transformMat4: function (mat) - { - var x = this.x; - var y = this.y; - var m = mat.val; - - this.x = m[0] * x + m[4] * y + m[12]; - this.y = m[1] * x + m[5] * y + m[13]; - - return this; - }, - - /** - * Make this Vector the zero vector (0, 0). - * - * @method Phaser.Math.Vector2#reset - * @since 3.0.0 - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - reset: function () - { - this.x = 0; - this.y = 0; - - return this; - }, - - /** - * Limit the length (or magnitude) of this Vector. - * - * @method Phaser.Math.Vector2#limit - * @since 3.23.0 - * - * @param {number} max - The maximum length. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - limit: function (max) - { - var len = this.length(); - - if (len && len > max) - { - this.scale(max / len); - } - - return this; - }, - - /** - * Reflect this Vector off a line defined by a normal. - * - * @method Phaser.Math.Vector2#reflect - * @since 3.23.0 - * - * @param {Phaser.Math.Vector2} normal - A vector perpendicular to the line. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - reflect: function (normal) - { - normal = normal.clone().normalize(); - - return this.subtract(normal.scale(2 * this.dot(normal))); - }, - - /** - * Reflect this Vector across another. - * - * @method Phaser.Math.Vector2#mirror - * @since 3.23.0 - * - * @param {Phaser.Math.Vector2} axis - A vector to reflect across. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - mirror: function (axis) - { - return this.reflect(axis).negate(); - }, - - /** - * Rotate this Vector by an angle amount. - * - * @method Phaser.Math.Vector2#rotate - * @since 3.23.0 - * - * @param {number} delta - The angle to rotate by, in radians. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - rotate: function (delta) - { - var cos = Math.cos(delta); - var sin = Math.sin(delta); - - return this.set(cos * this.x - sin * this.y, sin * this.x + cos * this.y); - }, - - /** - * Project this Vector onto another. - * - * @method Phaser.Math.Vector2#project - * @since 3.60.0 - * - * @param {Phaser.Math.Vector2} src - The vector to project onto. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - project: function (src) - { - var scalar = this.dot(src) / src.dot(src); - - return this.copy(src).scale(scalar); - }, - - /** - * Calculates the vector projection of this Vector2 onto the non-zero `vecB`. This is the - * orthogonal projection of this vector onto a straight line parallel to `vecB`. - * - * @method Phaser.Math.Vector2#projectUnit - * @since 4.0.0 - * - * @param {Phaser.Math.Vector2} vecB - The vector to project onto. - * @param {Phaser.Math.Vector2} [out] - The Vector2 object to store the position in. If not given, a new Vector2 instance is created. - * - * @return {Phaser.Math.Vector2} The `out` Vector2 containing the projected values. - */ - projectUnit: function (vecB, out) - { - if (out === undefined) { out = new Vector2(); } - - var amt = ((this.x * vecB.x) + (this.y * vecB.y)); - - if (amt !== 0) - { - out.x = amt * vecB.x; - out.y = amt * vecB.y; - } - - return out; - } - -}); - -/** - * A static zero Vector2 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector2.ZERO - * @type {Phaser.Math.Vector2} - * @since 3.1.0 - */ -Vector2.ZERO = new Vector2(); - -/** - * A static right Vector2 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector2.RIGHT - * @type {Phaser.Math.Vector2} - * @since 3.16.0 - */ -Vector2.RIGHT = new Vector2(1, 0); - -/** - * A static left Vector2 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector2.LEFT - * @type {Phaser.Math.Vector2} - * @since 3.16.0 - */ -Vector2.LEFT = new Vector2(-1, 0); - -/** - * A static up Vector2 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector2.UP - * @type {Phaser.Math.Vector2} - * @since 3.16.0 - */ -Vector2.UP = new Vector2(0, -1); - -/** - * A static down Vector2 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector2.DOWN - * @type {Phaser.Math.Vector2} - * @since 3.16.0 - */ -Vector2.DOWN = new Vector2(0, 1); - -/** - * A static one Vector2 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector2.ONE - * @type {Phaser.Math.Vector2} - * @since 3.16.0 - */ -Vector2.ONE = new Vector2(1, 1); - -module.exports = Vector2; +module.exports = __webpack_require__(70038)["default"]; /***/ }, @@ -145245,39 +144912,9 @@ module.exports = Within; /***/ }, /***/ 15994 -(module) { - -/** - * @author Richard Davey - * @copyright 2013-2026 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Wrap the given `value` between `min` (inclusive) and `max` (exclusive). - * - * When the value exceeds `max` it wraps back around to `min`, and when it falls - * below `min` it wraps around to just below `max`. This is useful for cycling - * through a range, such as keeping an angle within 0–360 degrees or looping a - * tile index within a tileset. - * - * @function Phaser.Math.Wrap - * @since 3.0.0 - * - * @param {number} value - The value to wrap. - * @param {number} min - The minimum bound of the range (inclusive). - * @param {number} max - The maximum bound of the range (exclusive). - * - * @return {number} The wrapped value, guaranteed to be within `[min, max)`. - */ -var Wrap = function (value, min, max) -{ - var range = max - min; - - return (min + ((((value - min) % range) + range) % range)); -}; +(module, __unused_webpack_exports, __webpack_require__) { -module.exports = Wrap; +module.exports = __webpack_require__(68077)["default"]; /***/ }, @@ -147984,36 +147621,9 @@ module.exports = Ceil; /***/ }, /***/ 43855 -(module) { - -/** - * @author Richard Davey - * @copyright 2013-2026 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Check whether the given values are fuzzily equal. - * - * Two numbers are fuzzily equal if their difference is less than `epsilon`. - * - * @function Phaser.Math.Fuzzy.Equal - * @since 3.0.0 - * - * @param {number} a - The first value. - * @param {number} b - The second value. - * @param {number} [epsilon=0.0001] - The maximum absolute difference below which the two values are considered equal. - * - * @return {boolean} `true` if the values are fuzzily equal, otherwise `false`. - */ -var Equal = function (a, b, epsilon) -{ - if (epsilon === undefined) { epsilon = 0.0001; } - - return Math.abs(a - b) < epsilon; -}; +(module, __unused_webpack_exports, __webpack_require__) { -module.exports = Equal; +module.exports = __webpack_require__(30010)["default"]; /***/ }, @@ -149110,7 +148720,7 @@ var RandomDataGenerator = new Class({ for (b = a = ''; a++ < 36; b += ~a % 5 | a * 3 & 4 ? (a ^ 15 ? 8 ^ this.frac() * (a ^ 20 ? 16 : 4) : 4).toString(16) : '-') { - // eslint-disable-next-line no-empty + // noop } return b; @@ -173700,9 +173310,6 @@ var Camera = new Class({ { var index, filter, padding, renderNode, tint; - // // Mipmap. - // currentContext.texture.needsMipmapRegeneration = true; - // Set up render options. var renderOptions = { smoothPixelArt: manager.renderer.game.config.smoothPixelArt @@ -173726,9 +173333,6 @@ var Camera = new Class({ coverageInternal.width + padding.width, coverageInternal.height + padding.height ); - - // // Mipmap. - // currentContext.texture.needsMipmapRegeneration = true; } var outputContext = currentContext; @@ -173808,9 +173412,6 @@ var Camera = new Class({ quad[7] = Math.round(quad[7]); } - // // Mipmap. - // outputContext.texture.needsMipmapRegeneration = true; - this.batchHandlerQuadSingleNode.batch( currentContext, @@ -173890,9 +173491,6 @@ var Camera = new Class({ padding.y = -padding.y; padding.width = -padding.width; padding.height = -padding.height; - - // // Mipmap. - // currentContext.texture.needsMipmapRegeneration = true; } if (!skipDrawOut) @@ -199066,7 +198664,6 @@ var BaseSound = new Class({ if (!this.markers[marker.name]) { - // eslint-disable-next-line no-console console.warn('Audio Marker: ' + marker.name + ' missing in Sound: ' + this.key); return false; @@ -199140,7 +198737,6 @@ var BaseSound = new Class({ { if (!this.markers[markerName]) { - // eslint-disable-next-line no-console console.warn('Marker: ' + markerName + ' missing in Sound: ' + this.key); return false; @@ -201449,7 +201045,6 @@ var HTML5AudioSound = new Class({ if (playPromise) { - // eslint-disable-next-line no-unused-vars playPromise.catch(function (reason) { console.warn(reason); @@ -203213,7 +202808,6 @@ var NoAudioSoundManager = new Class({ * * @return {boolean} Always 'false' for the No Audio Sound Manager. */ - // eslint-disable-next-line no-unused-vars play: function (key, extra) { return false; @@ -203232,7 +202826,6 @@ var NoAudioSoundManager = new Class({ * * @return {boolean} Always 'false' for the No Audio Sound Manager. */ - // eslint-disable-next-line no-unused-vars playAudioSprite: function (key, spriteName, config) { return false; @@ -206117,404 +205710,7 @@ module.exports = List; /***/ 90330 (module, __unused_webpack_exports, __webpack_require__) { -/** - * @author Richard Davey - * @copyright 2013-2026 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(83419); - -/** - * @callback EachMapCallback - * - * @param {string} key - The key of the Map entry. - * @param {E} entry - The value of the Map entry. - * - * @return {?boolean} The callback result. - */ - -/** - * @classdesc - * A custom Map implementation that stores entries as key-value pairs with ordered iteration. - * Unlike a native JavaScript Map, it also maintains an internal array of entries for efficient - * indexed access and iteration. Supports filtering, merging, and contains/size operations. - * Used internally by various Phaser systems for managing collections. - * - * ```javascript - * var map = new Map([ - * [ 1, 'one' ], - * [ 2, 'two' ], - * [ 3, 'three' ] - * ]); - * ``` - * - * @class Map - * @memberof Phaser.Structs - * @constructor - * @since 3.0.0 - * - * @generic K - * @generic V - * @genericUse {V[]} - [elements] - * - * @param {Array.<*>} elements - An optional array of key-value pairs to populate this Map with. - */ -var Map = new Class({ - - initialize: - - function Map (elements) - { - /** - * The entries in this Map. - * - * @genericUse {Object.} - [$type] - * - * @name Phaser.Structs.Map#entries - * @type {Object.} - * @default {} - * @since 3.0.0 - */ - this.entries = {}; - - /** - * The number of key / value pairs in this Map. - * - * @name Phaser.Structs.Map#size - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.size = 0; - - this.setAll(elements); - }, - - /** - * Adds all the elements in the given array to this Map. - * - * If the key already exists, the value will be replaced. - * - * @method Phaser.Structs.Map#setAll - * @since 3.70.0 - * - * @generic K - * @generic V - * @genericUse {V[]} - [elements] - * - * @param {Array.<*>} elements - An array of key-value pairs to populate this Map with. - * - * @return {this} This Map object. - */ - setAll: function (elements) - { - if (Array.isArray(elements)) - { - for (var i = 0; i < elements.length; i++) - { - this.set(elements[i][0], elements[i][1]); - } - } - - return this; - }, - - /** - * Adds an element with a specified `key` and `value` to this Map. - * - * If the `key` already exists, the value will be replaced. - * - * If you wish to add multiple elements in a single call, use the `setAll` method instead. - * - * @method Phaser.Structs.Map#set - * @since 3.0.0 - * - * @genericUse {K} - [key] - * @genericUse {V} - [value] - * @genericUse {Phaser.Structs.Map.} - [$return] - * - * @param {string} key - The key of the element to be added to this Map. - * @param {*} value - The value of the element to be added to this Map. - * - * @return {this} This Map object. - */ - set: function (key, value) - { - if (!this.has(key)) - { - this.size++; - } - - this.entries[key] = value; - - return this; - }, - - /** - * Returns the value associated to the `key`, or `undefined` if there is none. - * - * @method Phaser.Structs.Map#get - * @since 3.0.0 - * - * @genericUse {K} - [key] - * @genericUse {V} - [$return] - * - * @param {string} key - The key of the element to return from the `Map` object. - * - * @return {*} The element associated with the specified key or `undefined` if the key can't be found in this Map object. - */ - get: function (key) - { - if (this.has(key)) - { - return this.entries[key]; - } - }, - - /** - * Returns an `Array` of all the values stored in this Map. - * - * @method Phaser.Structs.Map#getArray - * @since 3.0.0 - * - * @genericUse {V[]} - [$return] - * - * @return {Array.<*>} An array of the values stored in this Map. - */ - getArray: function () - { - var output = []; - var entries = this.entries; - - for (var key in entries) - { - output.push(entries[key]); - } - - return output; - }, - - /** - * Returns a boolean indicating whether an element with the specified key exists or not. - * - * @method Phaser.Structs.Map#has - * @since 3.0.0 - * - * @genericUse {K} - [key] - * - * @param {string} key - The key of the element to test for presence of in this Map. - * - * @return {boolean} Returns `true` if an element with the specified key exists in this Map, otherwise `false`. - */ - has: function (key) - { - return (this.entries.hasOwnProperty(key)); - }, - - /** - * Delete the specified element from this Map. - * - * @method Phaser.Structs.Map#delete - * @since 3.0.0 - * - * @genericUse {K} - [key] - * @genericUse {Phaser.Structs.Map.} - [$return] - * - * @param {string} key - The key of the element to delete from this Map. - * - * @return {this} This Map object. - */ - delete: function (key) - { - if (this.has(key)) - { - delete this.entries[key]; - this.size--; - } - - return this; - }, - - /** - * Delete all entries from this Map. - * - * @method Phaser.Structs.Map#clear - * @since 3.0.0 - * - * @genericUse {Phaser.Structs.Map.} - [$return] - * - * @return {this} This Map object. - */ - clear: function () - { - Object.keys(this.entries).forEach(function (prop) - { - delete this.entries[prop]; - - }, this); - - this.size = 0; - - return this; - }, - - /** - * Returns an array of all entry keys in this Map. - * - * @method Phaser.Structs.Map#keys - * @since 3.0.0 - * - * @genericUse {K[]} - [$return] - * - * @return {string[]} Array containing entries' keys. - */ - keys: function () - { - return Object.keys(this.entries); - }, - - /** - * Returns an `Array` of all values stored in this Map. - * - * @method Phaser.Structs.Map#values - * @since 3.0.0 - * - * @genericUse {V[]} - [$return] - * - * @return {Array.<*>} An `Array` of values. - */ - values: function () - { - var output = []; - var entries = this.entries; - - for (var key in entries) - { - output.push(entries[key]); - } - - return output; - }, - - /** - * Dumps the contents of this Map to the console via `console.group`. - * - * @method Phaser.Structs.Map#dump - * @since 3.0.0 - */ - dump: function () - { - var entries = this.entries; - - // eslint-disable-next-line no-console - console.group('Map'); - - for (var key in entries) - { - console.log(key, entries[key]); - } - - // eslint-disable-next-line no-console - console.groupEnd(); - }, - - /** - * Iterates through all entries in this Map, passing each one to the given callback. - * - * If the callback returns `false`, the iteration will break. - * - * @method Phaser.Structs.Map#each - * @since 3.0.0 - * - * @genericUse {EachMapCallback.} - [callback] - * @genericUse {Phaser.Structs.Map.} - [$return] - * - * @param {EachMapCallback} callback - The callback which will receive the keys and entries held in this Map. - * - * @return {this} This Map object. - */ - each: function (callback) - { - var entries = this.entries; - - for (var key in entries) - { - if (callback(key, entries[key]) === false) - { - break; - } - } - - return this; - }, - - /** - * Returns `true` if the value exists within this Map. Otherwise, returns `false`. - * - * @method Phaser.Structs.Map#contains - * @since 3.0.0 - * - * @genericUse {V} - [value] - * - * @param {*} value - The value to search for. - * - * @return {boolean} `true` if the value is found, otherwise `false`. - */ - contains: function (value) - { - var entries = this.entries; - - for (var key in entries) - { - if (entries[key] === value) - { - return true; - } - } - - return false; - }, - - /** - * Merges all new keys from the given Map into this one. - * If it encounters a key that already exists it will be skipped unless override is set to `true`. - * - * @method Phaser.Structs.Map#merge - * @since 3.0.0 - * - * @genericUse {Phaser.Structs.Map.} - [map,$return] - * - * @param {Phaser.Structs.Map} map - The Map to merge in to this Map. - * @param {boolean} [override=false] - Set to `true` to replace values in this Map with those from the source map, or `false` to skip them. - * - * @return {this} This Map object. - */ - merge: function (map, override) - { - if (override === undefined) { override = false; } - - var local = this.entries; - var source = map.entries; - - for (var key in source) - { - if (local.hasOwnProperty(key) && override) - { - local[key] = source[key]; - } - else - { - this.set(key, source[key]); - } - } - - return this; - } - -}); - -module.exports = Map; +module.exports = __webpack_require__(60269)["default"]; /***/ }, @@ -215649,7 +214845,7 @@ var resolveFullName = function (raw, folders, extSuffix) } // Extension index: "name~N" (per-name, overrides line-level) - var extMatch = /~([1-5])$/.exec(name); + var extMatch = (/~([1-5])$/).exec(name); if (extMatch) { @@ -215674,7 +214870,7 @@ var expandNames = function (line, folders) { // Check for trailing extension suffix: ~N at very end var extSuffix = ''; - var extMatch = /~([1-5])$/.exec(line); + var extMatch = (/~([1-5])$/).exec(line); if (extMatch) { @@ -219106,7 +218302,7 @@ var Tilemap = new Class({ if (typeof renderOrder === 'number') { - renderOrder = orders[ renderOrder ]; + renderOrder = orders[renderOrder]; } if (orders.indexOf(renderOrder) > -1) @@ -219169,7 +218365,7 @@ var Tilemap = new Class({ return null; } - var tileset = this.tilesets[ index ]; + var tileset = this.tilesets[index]; if (tileset) { @@ -219358,7 +218554,7 @@ var Tilemap = new Class({ return null; } - var layerData = this.layers[ index ]; + var layerData = this.layers[index]; // Check for an associated tilemap layer if (layerData.tilemapLayer) @@ -219582,7 +218778,7 @@ var Tilemap = new Class({ for (var c = 0; c < config.length; c++) { - var singleConfig = config[ c ]; + var singleConfig = config[c]; var id = GetFastValue(singleConfig, 'id', null); var gid = GetFastValue(singleConfig, 'gid', null); @@ -219596,7 +218792,7 @@ var Tilemap = new Class({ // Sweep to get all the objects we want to convert in this pass for (var s = 0; s < objects.length; s++) { - obj = objects[ s ]; + obj = objects[s]; if ( (id === null && gid === null && name === null && type === null) || @@ -219620,7 +218816,7 @@ var Tilemap = new Class({ for (var i = 0; i < toConvert.length; i++) { - obj = toConvert[ i ]; + obj = toConvert[i]; var sprite = new classType(scene); @@ -220010,7 +219206,7 @@ var Tilemap = new Class({ { for (var i = 0; i < location.length; i++) { - if (location[ i ].name === name) + if (location[i].name === name) { return i; } @@ -220033,7 +219229,7 @@ var Tilemap = new Class({ { var index = this.getLayerIndex(layer); - return (index !== null) ? this.layers[ index ] : null; + return (index !== null) ? this.layers[index] : null; }, /** @@ -220050,7 +219246,7 @@ var Tilemap = new Class({ { var index = this.getIndex(this.objects, name); - return (index !== null) ? this.objects[ index ] : null; + return (index !== null) ? this.objects[index] : null; }, /** @@ -220287,7 +219483,7 @@ var Tilemap = new Class({ { var index = this.getIndex(this.tilesets, name); - return (index !== null) ? this.tilesets[ index ] : null; + return (index !== null) ? this.tilesets[index] : null; }, /** @@ -220366,7 +219562,7 @@ var Tilemap = new Class({ layer: { get: function () { - return this.layers[ this.currentLayerIndex ]; + return this.layers[this.currentLayerIndex]; }, set: function (layer) @@ -220579,9 +219775,9 @@ var Tilemap = new Class({ for (var i = index; i < this.layers.length; i++) { - if (this.layers[ i ].tilemapLayer) + if (this.layers[i].tilemapLayer) { - this.layers[ i ].tilemapLayer.layerIndex--; + this.layers[i].tilemapLayer.layerIndex--; } } @@ -220616,7 +219812,7 @@ var Tilemap = new Class({ if (index !== null) { - layer = this.layers[ index ]; + layer = this.layers[index]; layer.tilemapLayer.destroy(); @@ -220649,9 +219845,9 @@ var Tilemap = new Class({ for (var i = 0; i < layers.length; i++) { - if (layers[ i ].tilemapLayer) + if (layers[i].tilemapLayer) { - layers[ i ].tilemapLayer.destroy(false); + layers[i].tilemapLayer.destroy(false); } } @@ -220689,7 +219885,7 @@ var Tilemap = new Class({ for (var i = 0; i < tiles.length; i++) { - var tile = tiles[ i ]; + var tile = tiles[i]; removed.push(this.removeTileAt(tile.x, tile.y, true, recalculateFaces, tile.tilemapLayer)); @@ -220813,7 +220009,7 @@ var Tilemap = new Class({ for (var i = 0; i < layers.length; i++) { - TilemapComponents.RenderDebug(graphics, styleConfig, layers[ i ]); + TilemapComponents.RenderDebug(graphics, styleConfig, layers[i]); } return this; @@ -221117,18 +220313,18 @@ var Tilemap = new Class({ // Update the base tile size on all layers & tiles for (var i = 0; i < this.layers.length; i++) { - this.layers[ i ].baseTileWidth = tileWidth; - this.layers[ i ].baseTileHeight = tileHeight; + this.layers[i].baseTileWidth = tileWidth; + this.layers[i].baseTileHeight = tileHeight; - var mapData = this.layers[ i ].data; - var mapWidth = this.layers[ i ].width; - var mapHeight = this.layers[ i ].height; + var mapData = this.layers[i].data; + var mapWidth = this.layers[i].width; + var mapHeight = this.layers[i].height; for (var row = 0; row < mapHeight; row++) { for (var col = 0; col < mapWidth; col++) { - var tile = mapData[ row ][ col ]; + var tile = mapData[row][col]; if (tile !== null) { @@ -221172,7 +220368,7 @@ var Tilemap = new Class({ { for (var col = 0; col < mapWidth; col++) { - var tile = mapData[ row ][ col ]; + var tile = mapData[row][col]; if (tile !== null) { @@ -246186,6 +245382,30 @@ module.exports = { /******/ } /******/ /************************************************************************/ +/******/ /* webpack/runtime/compat get default export */ +/******/ (() => { +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = (module) => { +/******/ var getter = module && module.__esModule ? +/******/ () => (module['default']) : +/******/ () => (module); +/******/ __webpack_require__.d(getter, { a: getter }); +/******/ return getter; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ /******/ /* webpack/runtime/global */ /******/ (() => { /******/ __webpack_require__.g = (function() { @@ -246198,6 +245418,22 @@ module.exports = { /******/ })(); /******/ })(); /******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ /************************************************************************/ /******/ /******/ // startup diff --git a/dist/phaser-arcade-physics.min.js b/dist/phaser-arcade-physics.min.js index 011aafce69..0e1e45c1a7 100644 --- a/dist/phaser-arcade-physics.min.js +++ b/dist/phaser-arcade-physics.min.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Phaser",[],e):"object"==typeof exports?exports.Phaser=e():t.Phaser=e()}(this,()=>(()=>{var t={50792(t){"use strict";var e=Object.prototype.hasOwnProperty,i="~";function s(){}function r(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function n(t,e,s,n,a){if("function"!=typeof s)throw new TypeError("The listener must be a function");var o=new r(s,n||t,a),h=i?i+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],o]:t._events[h].push(o):(t._events[h]=o,t._eventsCount++),t}function a(t,e){0===--t._eventsCount?t._events=new s:delete t._events[e]}function o(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),(new s).__proto__||(i=!1)),o.prototype.eventNames=function(){var t,s,r=[];if(0===this._eventsCount)return r;for(s in t=this._events)e.call(t,s)&&r.push(i?s.slice(1):s);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},o.prototype.listeners=function(t){var e=i?i+t:t,s=this._events[e];if(!s)return[];if(s.fn)return[s.fn];for(var r=0,n=s.length,a=new Array(n);r3*Math.PI/2?p.y=1:l>Math.PI?(p.x=1,p.y=1):l>Math.PI/2&&(p.x=1);for(var m=[],g=0;g0&&u.enableFilters().filters.external.addBlur(e.blurQuality,e.blurRadius,e.blurRadius,1,void 0,e.blurSteps),d instanceof s&&d.enableFilters();var f=(e.useInternal?d.filters.internal:d.filters.external).addMask(u,e.invert);h.push(f)}return h}},11517(t,e,i){var s=i(38829);t.exports=function(t,e,i,r){for(var n=t[0],a=1;a=i;s--){var r=t[s],n=!0;for(var a in e)r[a]!==e[a]&&(n=!1);if(n)return r}return null}},94420(t,e,i){var s=i(11879),r=i(60461),n=i(95540),a=i(29747),o=new(i(41481))({sys:{queueDepthSort:a,events:{once:a}}},0,0,1,1).setOrigin(0,0);t.exports=function(t,e){void 0===e&&(e={});var i=e.hasOwnProperty("width"),a=e.hasOwnProperty("height"),h=n(e,"width",-1),l=n(e,"height",-1),u=n(e,"cellWidth",1),d=n(e,"cellHeight",u),c=n(e,"position",r.TOP_LEFT),f=n(e,"x",0),p=n(e,"y",0),m=0,g=0,v=h*u,x=l*d;o.setPosition(f,p),o.setSize(u,d);for(var y=0;y0?r(a,i):i<0&&n(a,Math.abs(i));for(var o=0;o=0;a--)t[a][e]+=i+o*s,o++;return t}},43967(t){t.exports=function(t,e,i,s,r,n){var a;void 0===s&&(s=0),void 0===r&&(r=0),void 0===n&&(n=1);var o=0,h=t.length;if(1===n)for(a=r;a=0;a--)t[a][e]=i+o*s,o++;return t}},88926(t,e,i){var s=i(28176);t.exports=function(t,e){for(var i=0;i=h||-1===l)){var c=t[l],f=c.x,p=c.y;c.x=a,c.y=o,a=f,o=p,0===r?l--:l++}}return n.x=a,n.y=o,n}},8628(t,e,i){var s=i(33680);t.exports=function(t){return s(t)}},21837(t,e,i){var s=i(7602);t.exports=function(t,e,i,r,n){void 0===n&&(n=!1);var a,o=Math.abs(r-i)/t.length;if(n)for(a=0;a0){if(0===t)this.frames=i.concat(this.frames);else if(t===this.frames.length)this.frames=this.frames.concat(i);else{var s=this.frames.slice(0,t),r=this.frames.slice(t);this.frames=s.concat(i,r)}this.updateFrameSequence()}return this},checkFrame:function(t){return t>=0&&t0){n.isLast=!0,n.nextFrame=d[0],d[0].prevFrame=n;var x=1/(d.length-1);for(a=0;a0?t.inReverse&&t.forward?t.forward=!1:this.repeatAnimation(t):t.complete():this.updateAndGetNextTick(t,e.nextFrame)},handleYoyoFrame:function(t,e){if(e||(e=!1),t.inReverse===!e&&t.repeatCounter>0)return(0===t.repeatDelay||t.pendingRepeat)&&(t.forward=e),void this.repeatAnimation(t);if(t.inReverse===e||0!==t.repeatCounter){t.forward=e;var i=e?t.currentFrame.nextFrame:t.currentFrame.prevFrame;this.updateAndGetNextTick(t,i)}else t.complete()},getLastFrame:function(){return this.frames[this.frames.length-1]},previousFrame:function(t){var e=t.currentFrame;e.isFirst?t.yoyo?this.handleYoyoFrame(t,!0):t.repeatCounter>0?(t.inReverse&&!t.forward||(t.forward=!0),this.repeatAnimation(t)):t.complete():this.updateAndGetNextTick(t,e.prevFrame)},updateAndGetNextTick:function(t,e){t.setCurrentFrame(e),this.getNextTick(t)},removeFrame:function(t){var e=this.frames.indexOf(t);return-1!==e&&this.removeFrameAt(e),this},removeFrameAt:function(t){return this.frames.splice(t,1),this.updateFrameSequence(),this},repeatAnimation:function(t){if(2===t._pendingStop){if(0===t._pendingStopValue)return t.stop();t._pendingStopValue--}t.repeatDelay>0&&!t.pendingRepeat?(t.pendingRepeat=!0,t.accumulator-=t.nextTick,t.nextTick+=t.repeatDelay):(t.repeatCounter--,t.forward?t.setCurrentFrame(t.currentFrame.nextFrame):t.setCurrentFrame(t.currentFrame.prevFrame),t.isPlaying&&(this.getNextTick(t),t.handleRepeat()))},toJSON:function(){var t={key:this.key,type:this.type,frames:[],frameRate:this.frameRate,duration:this.duration,skipMissedFrames:this.skipMissedFrames,delay:this.delay,repeat:this.repeat,repeatDelay:this.repeatDelay,yoyo:this.yoyo,showBeforeDelay:this.showBeforeDelay,showOnStart:this.showOnStart,randomFrame:this.randomFrame,hideOnComplete:this.hideOnComplete};return this.frames.forEach(function(e){t.frames.push(e.toJSON())}),t},updateFrameSequence:function(){for(var t,e=this.frames.length,i=1/(e-1),s=0;s1?(t.isLast=!0,t.prevFrame=this.frames[e-2],t.nextFrame=this.frames[0]):e>1&&(t.prevFrame=this.frames[s-1],t.nextFrame=this.frames[s+1]);return this},pause:function(){return this.paused=!0,this},resume:function(){return this.paused=!1,this},destroy:function(){this.manager.off&&(this.manager.off(n.PAUSE_ALL,this.pause,this),this.manager.off(n.RESUME_ALL,this.resume,this)),this.manager.remove(this.key);for(var t=0;t-1)){for(var p=0,m=u;m<=c;m++){var g=m.toString(),v=o[g];if(v){var x=l(v,"duration",d.MAX_SAFE_INTEGER);a.push({key:t,frame:g,duration:x}),p+=x}}"reverse"===f&&(a=a.reverse());var y,T={key:h,frames:a,duration:p,yoyo:"pingpong"===f};i?i.anims&&(y=i.anims.create(T)):y=n.create(T),y&&s.push(y)}});return s},create:function(t){var e=t.key,i=!1;return e&&((i=this.get(e))?console.warn("AnimationManager key already exists: "+e):(i=new s(this,e,t),this.anims.set(e,i),this.emit(o.ADD_ANIMATION,e,i))),i},fromJSON:function(t,e){void 0===e&&(e=!1),e&&this.anims.clear(),"string"==typeof t&&(t=JSON.parse(t));var i=[];if(t.hasOwnProperty("anims")&&Array.isArray(t.anims)){for(var s=0;sn&&(l=0),this.randomFrame&&(l=r(0,n-1));var u=s.frames[l];0!==l||this.forward||(u=s.getLastFrame()),this.currentFrame=u}else console.warn("Missing animation: "+i);return this.parent},pause:function(t){return this._paused||(this._paused=!0,this._wasPlaying=this.isPlaying,this.isPlaying=!1),void 0!==t&&this.setCurrentFrame(t),this.parent},resume:function(t){return this._paused&&(this._paused=!1,this.isPlaying=this._wasPlaying),void 0!==t&&this.setCurrentFrame(t),this.parent},playAfterDelay:function(t,e){if(this.isPlaying){var i=this.nextAnim,s=this.nextAnimsQueue;i&&s.unshift(i),this.nextAnim=t,this._pendingStop=1,this._pendingStopValue=e}else this.delayCounter=e,this.play(t,!0);return this.parent},playAfterRepeat:function(t,e){if(void 0===e&&(e=1),this.isPlaying){var i=this.nextAnim,s=this.nextAnimsQueue;i&&s.unshift(i),-1!==this.repeatCounter&&e>this.repeatCounter&&(e=this.repeatCounter),this.nextAnim=t,this._pendingStop=2,this._pendingStopValue=e}else this.play(t);return this.parent},play:function(t,e){void 0===e&&(e=!1);var i=this.currentAnim,s=this.parent,r="string"==typeof t?t:t.key;if(e&&this.isPlaying&&i.key===r)return s;if(i&&this.isPlaying){var n=this.animationManager.getMix(i.key,t);if(n>0)return this.playAfterDelay(t,n)}return this.forward=!0,this.inReverse=!1,this._paused=!1,this._wasPlaying=!0,this.startAnimation(t)},playReverse:function(t,e){void 0===e&&(e=!1);var i="string"==typeof t?t:t.key;return e&&this.isPlaying&&this.currentAnim.key===i?this.parent:(this.forward=!1,this.inReverse=!0,this._paused=!1,this._wasPlaying=!0,this.startAnimation(t))},startAnimation:function(t){this.load(t);var e=this.currentAnim,i=this.parent;return e?(this.repeatCounter=-1===this.repeat?Number.MAX_VALUE:this.repeat,e.getFirstTick(this),this.isPlaying=!0,this.pendingRepeat=!1,this.hasStarted=!1,this._pendingStop=0,this._pendingStopValue=0,this._paused=!1,this.delayCounter+=this.delay,0===this.delayCounter?this.handleStart():this.showBeforeDelay&&this.setCurrentFrame(this.currentFrame),i):i},handleStart:function(){this.showOnStart&&this.parent.setVisible(!0),this.setCurrentFrame(this.currentFrame),this.hasStarted=!0,this.emitEvents(o.ANIMATION_START)},handleRepeat:function(){this.pendingRepeat=!1,this.emitEvents(o.ANIMATION_REPEAT)},handleStop:function(){this._pendingStop=0,this.isPlaying=!1,this.emitEvents(o.ANIMATION_STOP)},handleComplete:function(){this._pendingStop=0,this.isPlaying=!1,this.hideOnComplete&&this.parent.setVisible(!1),this.emitEvents(o.ANIMATION_COMPLETE,o.ANIMATION_COMPLETE_KEY)},emitEvents:function(t,e){var i=this.currentAnim;if(i){var s=this.currentFrame,r=this.parent,n=s.textureFrame;r.emit(t,i,s,r,n),e&&r.emit(e+i.key,i,s,r,n)}},reverse:function(){return this.isPlaying&&(this.inReverse=!this.inReverse,this.forward=!this.forward),this.parent},getProgress:function(){var t=this.currentFrame;if(!t)return 0;var e=t.progress;return this.inReverse&&(e*=-1),e},setProgress:function(t){return this.forward||(t=1-t),this.setCurrentFrame(this.currentAnim.getFrameByProgress(t)),this.parent},setRepeat:function(t){return this.repeatCounter=-1===t?Number.MAX_VALUE:t,this.parent},globalRemove:function(t,e){void 0===e&&(e=this.currentAnim),this.isPlaying&&e.key===this.currentAnim.key&&(this.stop(),this.setCurrentFrame(this.currentAnim.frames[0]))},restart:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1);var i=this.currentAnim,s=this.parent;return i?(e&&(this.repeatCounter=-1===this.repeat?Number.MAX_VALUE:this.repeat),i.getFirstTick(this),this.emitEvents(o.ANIMATION_RESTART),this.isPlaying=!0,this.pendingRepeat=!1,this.hasStarted=!t,this._pendingStop=0,this._pendingStopValue=0,this._paused=!1,this.setCurrentFrame(i.frames[0]),this.parent):s},complete:function(){if(this._pendingStop=0,this.isPlaying=!1,this.currentAnim&&this.handleComplete(),this.nextAnim){var t=this.nextAnim;this.nextAnim=this.nextAnimsQueue.length>0?this.nextAnimsQueue.shift():null,this.play(t)}return this.parent},stop:function(){if(this._pendingStop=0,this.isPlaying=!1,this.delayCounter=0,this.currentAnim&&this.handleStop(),this.nextAnim){var t=this.nextAnim;this.nextAnim=this.nextAnimsQueue.shift(),this.play(t)}return this.parent},stopAfterDelay:function(t){return this._pendingStop=1,this._pendingStopValue=t,this.parent},stopAfterRepeat:function(t){return void 0===t&&(t=1),-1!==this.repeatCounter&&t>this.repeatCounter&&(t=this.repeatCounter),this._pendingStop=2,this._pendingStopValue=t,this.parent},stopOnFrame:function(t){return this._pendingStop=3,this._pendingStopValue=t,this.parent},getTotalFrames:function(){return this.currentAnim?this.currentAnim.getTotalFrames():0},update:function(t,e){var i=this.currentAnim;if(this.isPlaying&&i&&!i.paused){if(this.accumulator+=e*this.timeScale*this.animationManager.globalTimeScale,1===this._pendingStop&&(this._pendingStopValue-=e,this._pendingStopValue<=0))return this.stop();if(this.hasStarted){if(this.accumulator>=this.nextTick&&(this.forward?i.nextFrame(this):i.previousFrame(this),this.isPlaying&&0===this._pendingStop&&this.skipMissedFrames&&this.accumulator>this.nextTick)){var s=0;do{this.forward?i.nextFrame(this):i.previousFrame(this),s++}while(this.isPlaying&&this.accumulator>this.nextTick&&s<60)}}else this.accumulator>=this.delayCounter&&(this.accumulator-=this.delayCounter,this.handleStart())}},setCurrentFrame:function(t){var e=this.parent;return this.currentFrame=t,e.texture=t.frame.texture,e.frame=t.frame,e.isCropped&&e.frame.updateCropUVs(e._crop,e.flipX,e.flipY),t.setAlpha&&(e.alpha=t.alpha),e.setSizeToFrame(),e._originComponent&&(t.frame.customPivot?e.setOrigin(t.frame.pivotX,t.frame.pivotY):e.updateDisplayOrigin()),this.isPlaying&&this.hasStarted&&(this.emitEvents(o.ANIMATION_UPDATE),3===this._pendingStop&&this._pendingStopValue===t&&this.stop()),e},nextFrame:function(){return this.currentAnim&&this.currentAnim.nextFrame(this),this.parent},previousFrame:function(){return this.currentAnim&&this.currentAnim.previousFrame(this),this.parent},get:function(t){return this.anims?this.anims.get(t):null},exists:function(t){return!!this.anims&&this.anims.has(t)},create:function(t){var e=t.key,i=!1;return e&&((i=this.get(e))?console.warn("Animation key already exists: "+e):(i=new s(this,e,t),this.anims||(this.anims=new a),this.anims.set(e,i))),i},createFromAseprite:function(t,e){return this.animationManager.createFromAseprite(t,e,this.parent)},generateFrameNames:function(t,e){return this.animationManager.generateFrameNames(t,e)},generateFrameNumbers:function(t,e){return this.animationManager.generateFrameNumbers(t,e)},remove:function(t){var e=this.get(t);return e&&(this.currentAnim===e&&this.stop(),this.anims.delete(t)),e},destroy:function(){this.animationManager.off(o.REMOVE_ANIMATION,this.globalRemove,this),this.anims&&this.anims.clear(),this.animationManager=null,this.parent=null,this.nextAnim=null,this.nextAnimsQueue.length=0,this.currentAnim=null,this.currentFrame=null},isPaused:{get:function(){return this._paused}}});t.exports=l},57090(t){t.exports="add"},25312(t){t.exports="animationcomplete"},89580(t){t.exports="animationcomplete-"},52860(t){t.exports="animationrepeat"},63850(t){t.exports="animationrestart"},99085(t){t.exports="animationstart"},28087(t){t.exports="animationstop"},1794(t){t.exports="animationupdate"},52562(t){t.exports="pauseall"},57953(t){t.exports="remove"},68339(t){t.exports="resumeall"},74943(t,e,i){t.exports={ADD_ANIMATION:i(57090),ANIMATION_COMPLETE:i(25312),ANIMATION_COMPLETE_KEY:i(89580),ANIMATION_REPEAT:i(52860),ANIMATION_RESTART:i(63850),ANIMATION_START:i(99085),ANIMATION_STOP:i(28087),ANIMATION_UPDATE:i(1794),PAUSE_ALL:i(52562),REMOVE_ANIMATION:i(57953),RESUME_ALL:i(68339)}},60421(t,e,i){t.exports={Animation:i(42099),AnimationFrame:i(41138),AnimationManager:i(60848),AnimationState:i(9674),Events:i(74943)}},2161(t,e,i){var s=i(83419),r=i(90330),n=i(50792),a=i(24736),o=new s({initialize:function(){this.entries=new r,this.events=new n},add:function(t,e){return this.entries.set(t,e),this.events.emit(a.ADD,this,t,e),this},has:function(t){return this.entries.has(t)},exists:function(t){return this.entries.has(t)},get:function(t){return this.entries.get(t)},remove:function(t){var e=this.get(t);return e&&(this.entries.delete(t),this.events.emit(a.REMOVE,this,t,e.data)),this},getKeys:function(){return this.entries.keys()},destroy:function(){this.entries.clear(),this.events.removeAllListeners(),this.entries=null,this.events=null}});t.exports=o},24047(t,e,i){var s=i(2161),r=i(83419),n=i(8443),a=new r({initialize:function(t){this.game=t,this.binary=new s,this.bitmapFont=new s,this.json=new s,this.physics=new s,this.shader=new s,this.audio=new s,this.video=new s,this.text=new s,this.html=new s,this.tilemap=new s,this.xml=new s,this.atlas=new s,this.custom={},this.game.events.once(n.DESTROY,this.destroy,this)},addCustom:function(t){return this.custom.hasOwnProperty(t)||(this.custom[t]=new s),this.custom[t]},destroy:function(){for(var t=["binary","bitmapFont","json","physics","shader","audio","video","text","html","tilemap","xml","atlas"],e=0;ef&&w*i+S*rd&&w*s+S*nr&&(t=r),t},clampY:function(t){var e=this._bounds,i=this.displayHeight,s=e.y+(i-this.height)/2,r=Math.max(s,s+e.height-i);return tr&&(t=r),t},removeBounds:function(){return this.useBounds=!1,this.dirty=!0,this._bounds.setEmpty(),this},setAngle:function(t){return void 0===t&&(t=0),this.rotation=r(t),this},setBackgroundColor:function(t){return void 0===t&&(t="rgba(0,0,0,0)"),this.backgroundColor=d(t),this.transparent=0===this.backgroundColor.alpha,this},setBounds:function(t,e,i,s,r){return void 0===r&&(r=!1),this._bounds.setTo(t,e,i,s),this.dirty=!0,this.useBounds=!0,r?this.centerToBounds():(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},setForceComposite:function(t){return this.forceComposite=t,this},getBounds:function(t){void 0===t&&(t=new o);var e=this._bounds;return t.setTo(e.x,e.y,e.width,e.height),t},setName:function(t){return void 0===t&&(t=""),this.name=t,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setRoundPixels:function(t){return this.roundPixels=t,this},setScene:function(t,e){void 0===e&&(e=!0),this.scene&&this._customViewport&&this.sceneManager.customViewports--,this.scene=t,this.isSceneCamera=e;var i=t.sys;return this.sceneManager=i.game.scene,this.scaleManager=i.scale,this.cameraManager=i.cameras,this.updateSystem(),this},setScroll:function(t,e){return void 0===e&&(e=t),this.scrollX=t,this.scrollY=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},setViewport:function(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this},setZoom:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),0===t&&(t=.001),0===e&&(e=.001),this.zoomX=t,this.zoomY=e,this},setMask:function(t,e){return void 0===e&&(e=!0),this.mask=t,this._maskCamera=e?this.cameraManager.default:this,this},clearMask:function(t){return void 0===t&&(t=!1),t&&this.mask&&this.mask.destroy(),this.mask=null,this},toJSON:function(){var t={name:this.name,x:this.x,y:this.y,width:this.width,height:this.height,zoom:this.zoom,rotation:this.rotation,roundPixels:this.roundPixels,scrollX:this.scrollX,scrollY:this.scrollY,backgroundColor:this.backgroundColor.rgba};return this.useBounds&&(t.bounds={x:this._bounds.x,y:this._bounds.y,width:this._bounds.width,height:this._bounds.height}),t},update:function(){},setIsSceneCamera:function(t){return this.isSceneCamera=t,this},updateSystem:function(){if(this.scaleManager&&this.isSceneCamera){var t=0!==this._x||0!==this._y||this.scaleManager.width!==this._width||this.scaleManager.height!==this._height,e=this.sceneManager;t&&!this._customViewport?e.customViewports++:!t&&this._customViewport&&e.customViewports--,this.dirty=!0,this._customViewport=t}},destroy:function(){this.emit(a.DESTROY,this),this.removeAllListeners(),this.matrix.destroy(),this.matrixCombined.destroy(),this.matrixExternal.destroy(),this.culledObjects=[],this._customViewport&&this.sceneManager.customViewports--,this.renderList=[],this._bounds=null,this.scene=null,this.scaleManager=null,this.sceneManager=null,this.cameraManager=null},x:{get:function(){return this._x},set:function(t){this._x=t,this.updateSystem()}},y:{get:function(){return this._y},set:function(t){this._y=t,this.updateSystem()}},width:{get:function(){return this._width},set:function(t){this._width=t,this.updateSystem()}},height:{get:function(){return this._height},set:function(t){this._height=t,this.updateSystem()}},scrollX:{get:function(){return this._scrollX},set:function(t){t!==this._scrollX&&(this._scrollX=t,this.dirty=!0)}},scrollY:{get:function(){return this._scrollY},set:function(t){t!==this._scrollY&&(this._scrollY=t,this.dirty=!0)}},zoom:{get:function(){return(this._zoomX+this._zoomY)/2},set:function(t){this._zoomX=t,this._zoomY=t,this.dirty=!0}},zoomX:{get:function(){return this._zoomX},set:function(t){this._zoomX=t,this.dirty=!0}},zoomY:{get:function(){return this._zoomY},set:function(t){this._zoomY=t,this.dirty=!0}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=t,this.dirty=!0}},centerX:{get:function(){return this.x+.5*this.width}},centerY:{get:function(){return this.y+.5*this.height}},displayWidth:{get:function(){return this.width/this.zoomX}},displayHeight:{get:function(){return this.height/this.zoomY}}});t.exports=f},38058(t,e,i){var s=i(71911),r=i(67502),n=i(45319),a=i(83419),o=i(31401),h=i(20052),l=i(19715),u=i(28915),d=i(87841),c=i(26099),f=new a({Extends:s,initialize:function(t,e,i,r){s.call(this,t,e,i,r),this.filters={internal:new o.FilterList(this),external:new o.FilterList(this)},this.isObjectInversion=!1,this.inputEnabled=!0,this.fadeEffect=new h.Fade(this),this.flashEffect=new h.Flash(this),this.shakeEffect=new h.Shake(this),this.panEffect=new h.Pan(this),this.rotateToEffect=new h.RotateTo(this),this.zoomEffect=new h.Zoom(this),this.lerp=new c(1,1),this.followOffset=new c,this.deadzone=null,this._follow=null},setDeadzone:function(t,e){if(void 0===t)this.deadzone=null;else{if(this.deadzone?(this.deadzone.width=t,this.deadzone.height=e):this.deadzone=new d(0,0,t,e),this._follow){var i=this.width/2,s=this.height/2,n=this._follow.x-this.followOffset.x,a=this._follow.y-this.followOffset.y;this.midPoint.set(n,a),this.scrollX=n-i,this.scrollY=a-s}r(this.deadzone,this.midPoint.x,this.midPoint.y)}return this},fadeIn:function(t,e,i,s,r,n){return this.fadeEffect.start(!1,t,e,i,s,!0,r,n)},fadeOut:function(t,e,i,s,r,n){return this.fadeEffect.start(!0,t,e,i,s,!0,r,n)},fadeFrom:function(t,e,i,s,r,n,a){return this.fadeEffect.start(!1,t,e,i,s,r,n,a)},fade:function(t,e,i,s,r,n,a){return this.fadeEffect.start(!0,t,e,i,s,r,n,a)},flash:function(t,e,i,s,r,n,a){return this.flashEffect.start(t,e,i,s,r,n,a)},shake:function(t,e,i,s,r){return this.shakeEffect.start(t,e,i,s,r)},pan:function(t,e,i,s,r,n,a){return this.panEffect.start(t,e,i,s,r,n,a)},rotateTo:function(t,e,i,s,r,n,a){return this.rotateToEffect.start(t,e,i,s,r,n,a)},zoomTo:function(t,e,i,s,r,n){return this.zoomEffect.start(t,e,i,s,r,n)},preRender:function(){this.renderList.length=0;var t=this.width,e=this.height,i=.5*t,s=.5*e,n=this.zoomX,a=this.zoomY;this.renderRoundPixels=this.roundPixels&&Number.isInteger(n)&&Number.isInteger(a);var o=t*this.originX,h=e*this.originY,d=this._follow,c=this.deadzone,f=this.scrollX,p=this.scrollY;c&&r(c,this.midPoint.x,this.midPoint.y);var m=!1;if(d&&!this.panEffect.isRunning){var g=this.lerp,v=d.x-this.followOffset.x,x=d.y-this.followOffset.y;c?(vc.right&&(f=u(f,f+(v-c.right),g.x)),xc.bottom&&(p=u(p,p+(x-c.bottom),g.y))):(f=u(f,v-o,g.x),p=u(p,x-h,g.y)),m=!0}this.useBounds&&(f=this.clampX(f),p=this.clampY(p)),this.scrollX=f,this.scrollY=p;var y=f+i,T=p+s;this.midPoint.set(y,T);var w=t/n,S=e/a,b=y-w/2,E=T-S/2;this.worldView.setTo(b,E,w,S);var C=this.matrix,A=this.matrixExternal;this.isObjectInversion?(C.loadIdentity(),C.translate(o,h),C.scale(n,a),C.rotate(this.rotation),C.translate(-f-o,-p-h)):(C.applyITRS(o,h,this.rotation,n,a),C.translate(-f-o,-p-h)),A.applyITRS(this.x,this.y,0,1,1),this.shakeEffect.preRender(),A.multiply(C,this.matrixCombined),m&&this.emit(l.FOLLOW_UPDATE,this,d)},getViewMatrix:function(t){return t||this.forceComposite||this.filters.external.length>0||this.filters.internal.length>0?this.matrix:this.matrixCombined},getPaddingWrapper:function(t){var e={padding:0},i=new Proxy(this,{get:function(t,i){switch(i){case"padding":return e.padding;case"x":case"y":case"scrollX":case"scrollY":return t[i]+e.padding;case"width":case"height":return t[i]-2*e.padding;default:return t[i]}},set:function(i,s,r){switch(s){case"padding":var n=e.padding;e.padding=r;var a=e.padding-n;return i.x-=a,i.y-=a,i.width+=2*a,i.height+=2*a,i.scrollX-=a,i.scrollY-=a,t;case"x":case"y":case"scrollX":case"scrollY":return i[s]=r-e.padding;case"width":case"height":return i[s]=r+2*e.padding;default:return i[s]=r}}});return i.padding=t||0,i},setLerp:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.lerp.set(t,e),this},setFollowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),this.followOffset.set(t,e),this},startFollow:function(t,e,i,s,r,a){void 0===e&&(e=!1),void 0===i&&(i=1),void 0===s&&(s=i),void 0===r&&(r=0),void 0===a&&(a=r),this._follow=t,this.roundPixels=e,i=n(i,0,1),s=n(s,0,1),this.lerp.set(i,s),this.followOffset.set(r,a);var o=this.width/2,h=this.height/2,l=t.x-r,u=t.y-a;return this.midPoint.set(l,u),this.scrollX=l-o,this.scrollY=u-h,this.useBounds&&(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},stopFollow:function(){return this._follow=null,this},resetFX:function(){return this.rotateToEffect.reset(),this.panEffect.reset(),this.shakeEffect.reset(),this.flashEffect.reset(),this.fadeEffect.reset(),this},update:function(t,e){this.visible&&(this.rotateToEffect.update(t,e),this.panEffect.update(t,e),this.zoomEffect.update(t,e),this.shakeEffect.update(t,e),this.flashEffect.update(t,e),this.fadeEffect.update(t,e))},destroy:function(){this.resetFX(),this.filters.internal.destroy(),this.filters.external.destroy(),s.prototype.destroy.call(this),this._follow=null,this.deadzone=null}});t.exports=f},32743(t,e,i){var s=i(38058),r=i(83419),n=i(95540),a=i(37277),o=i(37303),h=i(97480),l=i(44594),u=new r({initialize:function(t){this.scene=t,this.systems=t.sys,this.roundPixels=t.sys.game.config.roundPixels,this.cameras=[],this.main,this.default,t.sys.events.once(l.BOOT,this.boot,this),t.sys.events.on(l.START,this.start,this)},boot:function(){var t=this.systems;t.settings.cameras?this.fromJSON(t.settings.cameras):this.add(),this.main=this.cameras[0],this.default=new s(0,0,t.scale.width,t.scale.height).setScene(this.scene),t.game.scale.on(h.RESIZE,this.onResize,this),this.systems.events.once(l.DESTROY,this.destroy,this)},start:function(){if(!this.main){var t=this.systems;t.settings.cameras?this.fromJSON(t.settings.cameras):this.add(),this.main=this.cameras[0]}var e=this.systems.events;e.on(l.UPDATE,this.update,this),e.once(l.SHUTDOWN,this.shutdown,this)},add:function(t,e,i,r,n,a){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===r&&(r=this.scene.sys.scale.height),void 0===n&&(n=!1),void 0===a&&(a="");var o=new s(t,e,i,r);return o.setName(a),o.setScene(this.scene),o.setRoundPixels(this.roundPixels),o.id=this.getNextID(),this.cameras.push(o),n&&(this.main=o),o},addExisting:function(t,e){return void 0===e&&(e=!1),-1===this.cameras.indexOf(t)?(t.id=this.getNextID(),t.setRoundPixels(this.roundPixels),this.cameras.push(t),e&&(this.main=t),t):null},getNextID:function(){for(var t=this.cameras,e=1,i=0;i<32;i++){for(var s=!1,r=0;r0){n.preRender();var a=this.getVisibleChildren(e.getChildren(),n);t.render(i,a,n)}}},getVisibleChildren:function(t,e){return t.filter(function(t){return t.willRender(e)})},resetAll:function(){for(var t=0;t=0}else this.clockwise=this.destination>=this.source;return this.camera.emit(n.ROTATE_START,this.camera,this,i,this.destination),u},update:function(t,e){if(this.isRunning){this._elapsed+=e;var i=s(this._elapsed/this.duration,0,1);this.progress=i;var r=this.camera;if(this._elapsedthis.maxZoom&&(e.zoom=this.maxZoom))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=n},58818(t,e,i){var s=i(83419),r=i(35154),n=new s({initialize:function(t){this.camera=r(t,"camera",null),this.left=r(t,"left",null),this.right=r(t,"right",null),this.up=r(t,"up",null),this.down=r(t,"down",null),this.zoomIn=r(t,"zoomIn",null),this.zoomOut=r(t,"zoomOut",null),this.zoomSpeed=r(t,"zoomSpeed",.01),this.minZoom=r(t,"minZoom",.001),this.maxZoom=r(t,"maxZoom",1e3),this.accelX=0,this.accelY=0;var e=r(t,"acceleration",null);"number"==typeof e?(this.accelX=e,this.accelY=e):(this.accelX=r(t,"acceleration.x",0),this.accelY=r(t,"acceleration.y",0)),this.dragX=0,this.dragY=0;var i=r(t,"drag",null);"number"==typeof i?(this.dragX=i,this.dragY=i):(this.dragX=r(t,"drag.x",0),this.dragY=r(t,"drag.y",0)),this.maxSpeedX=0,this.maxSpeedY=0;var s=r(t,"maxSpeed",null);"number"==typeof s?(this.maxSpeedX=s,this.maxSpeedY=s):(this.maxSpeedX=r(t,"maxSpeed.x",0),this.maxSpeedY=r(t,"maxSpeed.y",0)),this._speedX=0,this._speedY=0,this._zoom=0,this.active=null!==this.camera},start:function(){return this.active=null!==this.camera,this},stop:function(){return this.active=!1,this},setCamera:function(t){return this.camera=t,this},update:function(t){if(this.active){void 0===t&&(t=1);var e=this.camera;this._speedX>0?(this._speedX-=this.dragX*t,this._speedX<0&&(this._speedX=0)):this._speedX<0&&(this._speedX+=this.dragX*t,this._speedX>0&&(this._speedX=0)),this._speedY>0?(this._speedY-=this.dragY*t,this._speedY<0&&(this._speedY=0)):this._speedY<0&&(this._speedY+=this.dragY*t,this._speedY>0&&(this._speedY=0)),this.up&&this.up.isDown?(this._speedY+=this.accelY,this._speedY>this.maxSpeedY&&(this._speedY=this.maxSpeedY)):this.down&&this.down.isDown&&(this._speedY-=this.accelY,this._speedY<-this.maxSpeedY&&(this._speedY=-this.maxSpeedY)),this.left&&this.left.isDown?(this._speedX+=this.accelX,this._speedX>this.maxSpeedX&&(this._speedX=this.maxSpeedX)):this.right&&this.right.isDown&&(this._speedX-=this.accelX,this._speedX<-this.maxSpeedX&&(this._speedX=-this.maxSpeedX)),this.zoomIn&&this.zoomIn.isDown?this._zoom=-this.zoomSpeed:this.zoomOut&&this.zoomOut.isDown?this._zoom=this.zoomSpeed:this._zoom=0,0!==this._speedX&&(e.scrollX-=this._speedX*t|0),0!==this._speedY&&(e.scrollY-=this._speedY*t|0),0!==this._zoom&&(e.zoom+=this._zoom,e.zoomthis.maxZoom&&(e.zoom=this.maxZoom))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=n},38865(t,e,i){t.exports={FixedKeyControl:i(63091),SmoothedKeyControl:i(58818)}},26638(t,e,i){t.exports={Controls:i(38865),Scene2D:i(87969)}},8054(t,e,i){var s={VERSION:"4.1.0",LOG_VERSION:"v401",BlendModes:i(10312),ScaleModes:i(29795),AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,FOREVER:-1,NONE:4,UP:5,DOWN:6,LEFT:7,RIGHT:8};t.exports=s},69547(t,e,i){var s=i(83419),r=i(8054),n=i(42363),a=i(82264),o=i(95540),h=i(35154),l=i(41212),u=i(29747),d=i(75508),c=i(80333),f=new s({initialize:function(t){void 0===t&&(t={});var e=h(t,"scale",null);this.width=h(e,"width",1024,t),this.height=h(e,"height",768,t),this.zoom=h(e,"zoom",1,t),this.parent=h(e,"parent",void 0,t),this.scaleMode=h(e,e?"mode":"scaleMode",0,t),this.expandParent=h(e,"expandParent",!0,t),this.autoRound=h(e,"autoRound",!1,t),this.autoCenter=h(e,"autoCenter",0,t),this.resizeInterval=h(e,"resizeInterval",500,t),this.fullscreenTarget=h(e,"fullscreenTarget",null,t),this.minWidth=h(e,"min.width",0,t),this.maxWidth=h(e,"max.width",0,t),this.minHeight=h(e,"min.height",0,t),this.maxHeight=h(e,"max.height",0,t),this.snapWidth=h(e,"snap.width",0,t),this.snapHeight=h(e,"snap.height",0,t),this.renderType=h(t,"type",r.AUTO),this.canvas=h(t,"canvas",null),this.context=h(t,"context",null),this.canvasStyle=h(t,"canvasStyle",null),this.customEnvironment=h(t,"customEnvironment",!1),this.sceneConfig=h(t,"scene",null),this.seed=h(t,"seed",[(Date.now()*Math.random()).toString()]),d.RND=new d.RandomDataGenerator(this.seed),this.gameTitle=h(t,"title",""),this.gameURL=h(t,"url","https://phaser.io/"+r.LOG_VERSION),this.gameVersion=h(t,"version",""),this.autoFocus=h(t,"autoFocus",!0),this.stableSort=h(t,"stableSort",-1),-1===this.stableSort&&(this.stableSort=a.browser.es2019?1:0),a.features.stableSort=this.stableSort,this.domCreateContainer=h(t,"dom.createContainer",!1),this.domPointerEvents=h(t,"dom.pointerEvents","none"),this.inputKeyboard=h(t,"input.keyboard",!0),this.inputKeyboardEventTarget=h(t,"input.keyboard.target",window),this.inputKeyboardCapture=h(t,"input.keyboard.capture",[]),this.inputMouse=h(t,"input.mouse",!0),this.inputMouseEventTarget=h(t,"input.mouse.target",null),this.inputMousePreventDefaultDown=h(t,"input.mouse.preventDefaultDown",!0),this.inputMousePreventDefaultUp=h(t,"input.mouse.preventDefaultUp",!0),this.inputMousePreventDefaultMove=h(t,"input.mouse.preventDefaultMove",!0),this.inputMousePreventDefaultWheel=h(t,"input.mouse.preventDefaultWheel",!0),this.inputTouch=h(t,"input.touch",a.input.touch),this.inputTouchEventTarget=h(t,"input.touch.target",null),this.inputTouchCapture=h(t,"input.touch.capture",!0),this.inputActivePointers=h(t,"input.activePointers",1),this.inputSmoothFactor=h(t,"input.smoothFactor",0),this.inputWindowEvents=h(t,"input.windowEvents",!0),this.inputGamepad=h(t,"input.gamepad",!1),this.inputGamepadEventTarget=h(t,"input.gamepad.target",window),this.disableContextMenu=h(t,"disableContextMenu",!1),this.audio=h(t,"audio",{}),this.hideBanner=!1===h(t,"banner",null),this.hidePhaser=h(t,"banner.hidePhaser",!1),this.bannerTextColor=h(t,"banner.text","#ffffff"),this.bannerBackgroundColor=h(t,"banner.background",["#000814","#001d3d","#003566"]),""===this.gameTitle&&this.hidePhaser&&(this.hideBanner=!0),this.fps=h(t,"fps",null);var i=h(t,"render",null);this.autoMobileTextures=h(i,"autoMobileTextures",!0,t),this.antialias=h(i,"antialias",!0,t),this.antialiasGL=h(i,"antialiasGL",!0,t),this.mipmapFilter=h(i,"mipmapFilter","",t),this.mipmapRegeneration=h(i,"mipmapRegeneration",!1,t),this.desynchronized=h(i,"desynchronized",!1,t),this.roundPixels=h(i,"roundPixels",!1,t),this.selfShadow=h(i,"selfShadow",!1,t),this.pathDetailThreshold=h(i,"pathDetailThreshold",1,t),this.pixelArt=h(i,"pixelArt",!1,t),this.pixelArt&&(this.antialias=!1,this.antialiasGL=!1,this.roundPixels=!0),this.smoothPixelArt=h(i,"smoothPixelArt",!1,t),this.smoothPixelArt&&(this.antialias=!0,this.antialiasGL=!0,this.pixelArt=!1),this.transparent=h(i,"transparent",!1,t),this.clearBeforeRender=h(i,"clearBeforeRender",!0,t),this.preserveDrawingBuffer=h(i,"preserveDrawingBuffer",!1,t),this.premultipliedAlpha=h(i,"premultipliedAlpha",!0,t),this.skipUnreadyShaders=h(i,"skipUnreadyShaders",!1,t),this.failIfMajorPerformanceCaveat=h(i,"failIfMajorPerformanceCaveat",!1,t),this.powerPreference=h(i,"powerPreference","default",t),this.batchSize=h(i,"batchSize",16384,t),this.maxTextures=h(i,"maxTextures",-1,t),this.maxLights=h(i,"maxLights",10,t),this.renderNodes=h(i,"renderNodes",{},t);var s=h(t,"backgroundColor",0);this.backgroundColor=c(s),this.transparent&&(this.backgroundColor=c(0),this.backgroundColor.alpha=0),this.preBoot=h(t,"callbacks.preBoot",u),this.postBoot=h(t,"callbacks.postBoot",u),this.physics=h(t,"physics",{}),this.defaultPhysicsSystem=h(this.physics,"default",!1),this.loaderBaseURL=h(t,"loader.baseURL",""),this.loaderPath=h(t,"loader.path",""),this.loaderMaxParallelDownloads=h(t,"loader.maxParallelDownloads",a.os.android?6:32),this.loaderCrossOrigin=h(t,"loader.crossOrigin",void 0),this.loaderResponseType=h(t,"loader.responseType",""),this.loaderAsync=h(t,"loader.async",!0),this.loaderUser=h(t,"loader.user",""),this.loaderPassword=h(t,"loader.password",""),this.loaderTimeout=h(t,"loader.timeout",0),this.loaderMaxRetries=h(t,"loader.maxRetries",2),this.loaderWithCredentials=h(t,"loader.withCredentials",!1),this.loaderImageLoadType=h(t,"loader.imageLoadType","XHR"),this.loaderLocalScheme=h(t,"loader.localScheme",["file://","capacitor://"]),this.glowQuality=h(t,"filters.glow.quality",10),this.glowDistance=h(t,"filters.glow.distance",10),this.installGlobalPlugins=[],this.installScenePlugins=[];var f=h(t,"plugins",null),p=n.DefaultScene;f&&(Array.isArray(f)?this.defaultPlugins=f:l(f)&&(this.installGlobalPlugins=o(f,"global",[]),this.installScenePlugins=o(f,"scene",[]),Array.isArray(f.default)?p=f.default:Array.isArray(f.defaultMerge)&&(p=p.concat(f.defaultMerge)))),this.defaultPlugins=p;var m="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg";this.defaultImage=h(t,"images.default",m+"AQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg=="),this.missingImage=h(t,"images.missing",m+"CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg=="),this.whiteImage=h(t,"images.white","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABdJREFUeNpi/P//PwMMMDEgAdwcgAADAJZuAwXJYZOzAAAAAElFTkSuQmCC"),window&&(window.FORCE_WEBGL?this.renderType=r.WEBGL:window.FORCE_CANVAS&&(this.renderType=r.CANVAS))}});t.exports=f},86054(t,e,i){var s=i(20623),r=i(27919),n=i(8054),a=i(89357);t.exports=function(t){var e=t.config;if((e.customEnvironment||e.canvas)&&e.renderType===n.AUTO)throw new Error("Must set explicit renderType in custom environment");if(!e.customEnvironment&&!e.canvas&&e.renderType!==n.HEADLESS)if(e.renderType===n.AUTO&&(e.renderType=a.webGL?n.WEBGL:n.CANVAS),e.renderType===n.WEBGL){if(!a.webGL)throw new Error("Cannot create WebGL context, aborting.")}else{if(e.renderType!==n.CANVAS)throw new Error("Unknown value for renderer type: "+e.renderType);if(!a.canvas)throw new Error("Cannot create Canvas context, aborting.")}e.antialias||r.disableSmoothing();var o,h,l=t.scale.baseSize,u=l.width,d=l.height;(e.canvas?(t.canvas=e.canvas,t.canvas.width=u,t.canvas.height=d):t.canvas=r.create(t,u,d,e.renderType),e.canvasStyle&&(t.canvas.style=e.canvasStyle),e.antialias||s.setCrisp(t.canvas),e.renderType!==n.HEADLESS)&&(o=i(68627),h=i(74797),e.renderType===n.WEBGL?t.renderer=new h(t):(t.renderer=new o(t),t.context=t.renderer.gameContext))}},96391(t,e,i){var s=i(8054);t.exports=function(t){var e=t.config;if(!e.hideBanner){var i="WebGL";e.renderType===s.CANVAS?i="Canvas":e.renderType===s.HEADLESS&&(i="Headless");var r,n=e.audio,a=t.device.audio;if(r=a.webAudio&&!n.disableWebAudio?"Web Audio":n.noAudio||!a.webAudio&&!a.audioData?"No Audio":"HTML5 Audio",t.device.browser.ie)window.console&&console.log("Phaser v"+s.VERSION+" / https://phaser.io");else{var o="color: "+e.bannerTextColor+";",h=Array.isArray(e.bannerBackgroundColor)?e.bannerBackgroundColor:[e.bannerBackgroundColor];1===h.length&&(h=[h[0],h[0]]),o+=' background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAOCAYAAAAmL5yKAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAARBJREFUeNpi/P//P0OHsPB/BiCoePuWkYFEwALSXJElzMBgLwE2CNkQxgWr/yMr/p8QimlBu5DQ//+8vBBco/ofzAe6imH+qv/53/6jYJAYSA4ZoxoANYTPKhiuCQZwGcJU+e4dqpMmvsDq14krV2MPAxDha2CMKvoXoiE/PBQUDgQD8j82UFae9B9bOIC8B9UD9gIjjIMN7Ns6lWHn4XMoYu62RgxO3tkMjIyMII2MYAOAtmFVhA+ADHf2ycGMRhANjUq8YO+WKWCvgAORIV8CkpDCrzIwsLIymC1qAtuAD4Bsh3sBmqAY3qcGwL2AC4DCpKtzHlgzOLWihwEuzTCN0GhDJHeYC4gByBphACDAAH2dDIxdjr+VAAAAAElFTkSuQmCC"), '+("linear-gradient(to bottom, "+h.join(", ")+")")+";",o+=" background-repeat: no-repeat;",o+=" background-position: 4px center, 0 0;";var l="%c",u=[null,o+=" padding: 2px 6px 2px 24px;"];u.push("background: transparent"),e.gameTitle&&(l=l.concat(e.gameTitle),e.gameVersion&&(l=l.concat(" v"+e.gameVersion)),e.hidePhaser||(l=l.concat(" / "))),e.hidePhaser||(l=l.concat("Phaser v"+s.VERSION+" ("+i+" | "+r+")")),l=l.concat("%c "+e.gameURL),u[0]=l,console.log.apply(console,u)}}}},50127(t,e,i){var s=i(40366),r=i(60848),n=i(24047),a=i(27919),o=i(83419),h=i(69547),l=i(83719),u=i(86054),d=i(45893),c=i(96391),f=i(82264),p=i(57264),m=i(50792),g=i(8443),v=i(7003),x=i(37277),y=i(77332),T=i(76531),w=i(60903),S=i(69442),b=i(17130),E=i(65898),C=i(51085),A=i(14747),_=new o({initialize:function(t){this.config=new h(t),this.renderer=null,this.domContainer=null,this.canvas=null,this.context=null,this.isBooted=!1,this.isRunning=!1,this.events=new m,this.anims=new r(this),this.textures=new b(this),this.cache=new n(this),this.registry=new d(this,new m),this.input=new v(this,this.config),this.scene=new w(this,this.config.sceneConfig),this.device=f,this.scale=new T(this,this.config),this.sound=null,this.sound=A.create(this),this.loop=new E(this,this.config.fps),this.plugins=new y(this,this.config),this.pendingDestroy=!1,this.removeCanvas=!1,this.noReturn=!1,this.hasFocus=!1,this.isPaused=!1,p(this.boot.bind(this))},boot:function(){x.hasCore("EventEmitter")?(this.isBooted=!0,this.config.preBoot(this),this.scale.preBoot(),u(this),l(this),c(this),s(this.canvas,this.config.parent),this.textures.once(S.READY,this.texturesReady,this),this.events.emit(g.BOOT)):console.warn("Aborting. Core Plugins missing.")},texturesReady:function(){this.events.emit(g.READY),this.start()},start:function(){this.isRunning=!0,this.config.postBoot(this),this.renderer?this.loop.start(this.step.bind(this)):this.loop.start(this.headlessStep.bind(this)),C(this);var t=this.events;t.on(g.HIDDEN,this.onHidden,this),t.on(g.VISIBLE,this.onVisible,this),t.on(g.BLUR,this.onBlur,this),t.on(g.FOCUS,this.onFocus,this)},step:function(t,e){if(this.pendingDestroy)return this.runDestroy();if(!this.isPaused){var i=this.events;i.emit(g.PRE_STEP,t,e),i.emit(g.STEP,t,e),this.scene.update(t,e),i.emit(g.POST_STEP,t,e);var s=this.renderer;s.preRender(),i.emit(g.PRE_RENDER,s,t,e),this.scene.render(s),s.postRender(),i.emit(g.POST_RENDER,s,t,e)}},headlessStep:function(t,e){if(this.pendingDestroy)return this.runDestroy();if(!this.isPaused){var i=this.events;i.emit(g.PRE_STEP,t,e),i.emit(g.STEP,t,e),this.scene.update(t,e),i.emit(g.POST_STEP,t,e),this.scene.isProcessing=!1,i.emit(g.PRE_RENDER,null,t,e),i.emit(g.POST_RENDER,null,t,e)}},onHidden:function(){this.loop.pause(),this.events.emit(g.PAUSE)},pause:function(){var t=this.isPaused;this.isPaused=!0,t||this.events.emit(g.PAUSE)},onVisible:function(){this.loop.resume(),this.events.emit(g.RESUME,this.loop.pauseDuration)},resume:function(){var t=this.isPaused;this.isPaused=!1,t&&this.events.emit(g.RESUME,0)},onBlur:function(){this.hasFocus=!1,this.loop.blur()},onFocus:function(){this.hasFocus=!0,this.loop.focus()},getFrame:function(){return this.loop.frame},getTime:function(){return this.loop.now},destroy:function(t,e){void 0===e&&(e=!1),this.pendingDestroy=!0,this.removeCanvas=t,this.noReturn=e},runDestroy:function(){this.scene.destroy(),this.events.emit(g.DESTROY),this.events.removeAllListeners(),this.renderer&&this.renderer.destroy(),this.removeCanvas&&this.canvas&&(a.remove(this.canvas),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)),this.domContainer&&this.domContainer.parentNode&&this.domContainer.parentNode.removeChild(this.domContainer),this.loop.destroy(),this.pendingDestroy=!1}});t.exports=_},65898(t,e,i){var s=i(83419),r=i(35154),n=i(29747),a=i(43092),o=new s({initialize:function(t,e){this.game=t,this.raf=new a,this.started=!1,this.running=!1,this.minFps=r(e,"min",5),this.targetFps=r(e,"target",60),this.fpsLimit=r(e,"limit",0),this.hasFpsLimit=this.fpsLimit>0,this._limitRate=this.hasFpsLimit?1e3/this.fpsLimit:0,this._min=1e3/this.minFps,this._target=1e3/this.targetFps,this.actualFps=this.targetFps,this.nextFpsUpdate=0,this.framesThisSecond=0,this.callback=n,this.forceSetTimeOut=r(e,"forceSetTimeOut",!1),this.time=0,this.startTime=0,this.lastTime=0,this.frame=0,this.inFocus=!0,this.pauseDuration=0,this._pauseTime=0,this._coolDown=0,this.delta=0,this.deltaIndex=0,this.deltaHistory=[],this.deltaSmoothingMax=r(e,"deltaHistory",10),this.panicMax=r(e,"panicMax",120),this.rawDelta=0,this.now=0,this.smoothStep=r(e,"smoothStep",!0)},blur:function(){this.inFocus=!1},focus:function(){this.inFocus=!0,this.resetDelta()},pause:function(){this._pauseTime=window.performance.now()},resume:function(){this.resetDelta(),this.pauseDuration=this.time-this._pauseTime,this.startTime+=this.pauseDuration},resetDelta:function(){var t=window.performance.now();this.time=t,this.lastTime=t,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0;for(var e=0;e0||!this.inFocus)&&(this._coolDown--,t=Math.min(t,this._target)),t>this._min&&(t=i[e],t=Math.min(t,this._min)),i[e]=t,this.deltaIndex++,this.deltaIndex>=s&&(this.deltaIndex=0);for(var r=0,n=0;n=this.nextFpsUpdate&&this.updateFPS(t),this.framesThisSecond++,this.delta>=this._limitRate&&(this.callback(t,this.delta),this.delta%=this._limitRate),this.lastTime=t,this.frame++},step:function(t){this.now=t;var e=Math.max(0,t-this.lastTime);this.rawDelta=e,this.time+=this.rawDelta,this.smoothStep&&(e=this.smoothDelta(e)),this.delta=e,t>=this.nextFpsUpdate&&this.updateFPS(t),this.framesThisSecond++,this.callback(t,e),this.lastTime=t,this.frame++},tick:function(){var t=window.performance.now();this.hasFpsLimit?this.stepLimitFPS(t):this.step(t)},sleep:function(){this.running&&(this.raf.stop(),this.running=!1)},wake:function(t){void 0===t&&(t=!1);var e=window.performance.now();if(!this.running){t&&(this.startTime+=-this.lastTime+(this.lastTime+e));var i=this.hasFpsLimit?this.stepLimitFPS.bind(this):this.step.bind(this);this.raf.start(i,this.forceSetTimeOut,this._target),this.running=!0,this.nextFpsUpdate=e+1e3,this.framesThisSecond=0,this.fpsLimitTriggered=!1,this.tick()}},getDuration:function(){return Math.round(this.lastTime-this.startTime)/1e3},getDurationMS:function(){return Math.round(this.lastTime-this.startTime)},stop:function(){return this.running=!1,this.started=!1,this.raf.stop(),this},destroy:function(){this.stop(),this.raf.destroy(),this.raf=null,this.game=null,this.callback=null}});t.exports=o},51085(t,e,i){var s=i(8443);t.exports=function(t){var e,i=t.events;if(void 0!==document.hidden)e="visibilitychange";else{["webkit","moz","ms"].forEach(function(t){void 0!==document[t+"Hidden"]&&(document.hidden=function(){return document[t+"Hidden"]},e=t+"visibilitychange")})}e&&document.addEventListener(e,function(t){document.hidden||"pause"===t.type?i.emit(s.HIDDEN):i.emit(s.VISIBLE)},!1),window.onblur=function(){i.emit(s.BLUR)},window.onfocus=function(){i.emit(s.FOCUS)},window.focus&&t.config.autoFocus&&window.focus()}},97217(t){t.exports="blur"},47548(t){t.exports="boot"},19814(t){t.exports="contextlost"},68446(t){t.exports="destroy"},41700(t){t.exports="focus"},25432(t){t.exports="hidden"},65942(t){t.exports="pause"},59211(t){t.exports="postrender"},47789(t){t.exports="poststep"},39066(t){t.exports="prerender"},460(t){t.exports="prestep"},16175(t){t.exports="ready"},42331(t){t.exports="resume"},11966(t){t.exports="step"},32969(t){t.exports="systemready"},94830(t){t.exports="visible"},8443(t,e,i){t.exports={BLUR:i(97217),BOOT:i(47548),CONTEXT_LOST:i(19814),DESTROY:i(68446),FOCUS:i(41700),HIDDEN:i(25432),PAUSE:i(65942),POST_RENDER:i(59211),POST_STEP:i(47789),PRE_RENDER:i(39066),PRE_STEP:i(460),READY:i(16175),RESUME:i(42331),STEP:i(11966),SYSTEM_READY:i(32969),VISIBLE:i(94830)}},42857(t,e,i){t.exports={Config:i(69547),CreateRenderer:i(86054),DebugHeader:i(96391),Events:i(8443),TimeStep:i(65898),VisibilityHandler:i(51085)}},46728(t,e,i){var s=i(83419),r=i(36316),n=i(80021),a=i(26099),o=new s({Extends:n,initialize:function(t,e,i,s){n.call(this,"CubicBezierCurve"),Array.isArray(t)&&(s=new a(t[6],t[7]),i=new a(t[4],t[5]),e=new a(t[2],t[3]),t=new a(t[0],t[1])),this.p0=t,this.p1=e,this.p2=i,this.p3=s},getStartPoint:function(t){return void 0===t&&(t=new a),t.copy(this.p0)},getResolution:function(t){return t},getPoint:function(t,e){void 0===e&&(e=new a);var i=this.p0,s=this.p1,n=this.p2,o=this.p3;return e.set(r(t,i.x,s.x,n.x,o.x),r(t,i.y,s.y,n.y,o.y))},draw:function(t,e){void 0===e&&(e=32);var i=this.getPoints(e);t.beginPath(),t.moveTo(this.p0.x,this.p0.y);for(var s=1;si&&(e=i/2);var s=Math.max(1,Math.round(i/e));return r(this.getSpacedPoints(s),t)},getDistancePoints:function(t){var e=this.getLength(),i=Math.max(1,e/t);return this.getSpacedPoints(i)},getEndPoint:function(t){return void 0===t&&(t=new a),this.getPointAt(1,t)},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,i=[],s=this.getPoint(0,this._tmpVec2A),r=0;i.push(0);for(var n=1;n<=t;n++)r+=(e=this.getPoint(n/t,this._tmpVec2B)).distance(s),i.push(r),s.copy(e);return this.cacheArcLengths=i,i},getPointAt:function(t,e){var i=this.getUtoTmapping(t);return this.getPoint(i,e)},getPoints:function(t,e,i){void 0===i&&(i=[]),t||(t=e?this.getLength()/e:this.defaultDivisions);for(var s=0;s<=t;s++)i.push(this.getPoint(s/t));return i},getRandomPoint:function(t){return void 0===t&&(t=new a),this.getPoint(Math.random(),t)},getSpacedPoints:function(t,e,i){void 0===i&&(i=[]),t||(t=e?this.getLength()/e:this.defaultDivisions);for(var s=0;s<=t;s++){var r=this.getUtoTmapping(s/t,null,t);i.push(this.getPoint(r))}return i},getStartPoint:function(t){return void 0===t&&(t=new a),this.getPointAt(0,t)},getTangent:function(t,e){void 0===e&&(e=new a);var i=1e-4,s=t-i,r=t+i;return s<0&&(s=0),r>1&&(r=1),this.getPoint(s,this._tmpVec2A),this.getPoint(r,e),e.subtract(this._tmpVec2A).normalize()},getTangentAt:function(t,e){var i=this.getUtoTmapping(t);return this.getTangent(i,e)},getTFromDistance:function(t,e){return t<=0?0:this.getUtoTmapping(0,t,e)},getUtoTmapping:function(t,e,i){var s,r=this.getLengths(i),n=0,a=r.length;s=e?Math.min(e,r[a-1]):t*r[a-1];for(var o,h=0,l=a-1;h<=l;)if((o=r[n=Math.floor(h+(l-h)/2)]-s)<0)h=n+1;else{if(!(o>0)){l=n;break}l=n-1}if(r[n=l]===s)return n/(a-1);var u=r[n];return(n+(s-u)/(r[n+1]-u))/(a-1)},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()}});t.exports=o},73825(t,e,i){var s=i(83419),r=i(80021),n=i(39506),a=i(35154),o=i(43396),h=i(26099),l=new s({Extends:r,initialize:function(t,e,i,s,o,l,u,d){if("object"==typeof t){var c=t;t=a(c,"x",0),e=a(c,"y",0),i=a(c,"xRadius",0),s=a(c,"yRadius",i),o=a(c,"startAngle",0),l=a(c,"endAngle",360),u=a(c,"clockwise",!1),d=a(c,"rotation",0)}else void 0===s&&(s=i),void 0===o&&(o=0),void 0===l&&(l=360),void 0===u&&(u=!1),void 0===d&&(d=0);r.call(this,"EllipseCurve"),this.p0=new h(t,e),this._xRadius=i,this._yRadius=s,this._startAngle=n(o),this._endAngle=n(l),this._clockwise=u,this._rotation=n(d)},getStartPoint:function(t){return void 0===t&&(t=new h),this.getPoint(0,t)},getResolution:function(t){return 2*t},getPoint:function(t,e){void 0===e&&(e=new h);for(var i=2*Math.PI,s=this._endAngle-this._startAngle,r=Math.abs(s)i;)s-=i;si.length-2?i.length-1:n+1],d=i[n>i.length-3?i.length-1:n+2];return e.set(s(o,h.x,l.x,u.x,d.x),s(o,h.y,l.y,u.y,d.y))},toJSON:function(){for(var t=[],e=0;e=e)return this.curves[s];s++}return null},getEndPoint:function(t){return void 0===t&&(t=new c),this.curves.length>0?this.curves[this.curves.length-1].getPoint(1,t):t.copy(this.startPoint),t},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},getPoint:function(t,e){void 0===e&&(e=new c);for(var i=t*this.getLength(),s=this.getCurveLengths(),r=0;r=i){var n=s[r]-i,a=this.curves[r],o=a.getLength(),h=0===o?0:1-n/o;return a.getPointAt(h,e)}r++}return null},getPoints:function(t,e){t||e||(t=this.defaultDivisions);for(var i,s=[],r=0;r1&&!s[s.length-1].equals(s[0])&&s.push(s[0]),s},getRandomPoint:function(t){return void 0===t&&(t=new c),this.getPoint(Math.random(),t)},getSpacedPoints:function(t){void 0===t&&(t=40);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e},getStartPoint:function(t){return void 0===t&&(t=new c),t.copy(this.startPoint)},getTangent:function(t,e){void 0===e&&(e=new c);for(var i=t*this.getLength(),s=this.getCurveLengths(),r=0;r=i){var n=s[r]-i,a=this.curves[r],o=a.getLength(),h=0===o?0:1-n/o;return a.getTangentAt(h,e)}r++}return null},lineTo:function(t,e){t instanceof c?this._tmpVec2B.copy(t):"object"==typeof t?this._tmpVec2B.setFromObject(t):this._tmpVec2B.set(t,e);var i=this.getEndPoint(this._tmpVec2A);return this.add(new o([i.x,i.y,this._tmpVec2B.x,this._tmpVec2B.y]))},splineTo:function(t){return t.unshift(this.getEndPoint()),this.add(new d(t))},moveTo:function(t,e){return t instanceof c?this.add(new h(t.x,t.y)):this.add(new h(t,e))},toJSON:function(){for(var t=[],e=0;e=9&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){var n=parseInt(RegExp.$1,10),a=parseInt(RegExp.$2,10);(10===n&&a>=11||n>10)&&(r.dolby=!0)}}}catch(t){}return r}()},84148(t,e,i){var s,r=i(25892),n={chrome:!1,chromeVersion:0,edge:!1,firefox:!1,firefoxVersion:0,ie:!1,ieVersion:0,mobileSafari:!1,opera:!1,safari:!1,safariVersion:0,silk:!1,trident:!1,tridentVersion:0,es2019:!1};t.exports=(s=navigator.userAgent,/Edg\/\d+/.test(s)?(n.edge=!0,n.es2019=!0):/OPR/.test(s)?(n.opera=!0,n.es2019=!0):/Chrome\/(\d+)/.test(s)&&!r.windowsPhone?(n.chrome=!0,n.chromeVersion=parseInt(RegExp.$1,10),n.es2019=n.chromeVersion>69):/Firefox\D+(\d+)/.test(s)?(n.firefox=!0,n.firefoxVersion=parseInt(RegExp.$1,10),n.es2019=n.firefoxVersion>10):/AppleWebKit\/(?!.*CriOS)/.test(s)&&r.iOS?(n.mobileSafari=!0,n.es2019=!0):/MSIE (\d+\.\d+);/.test(s)?(n.ie=!0,n.ieVersion=parseInt(RegExp.$1,10)):/Version\/(\d+\.\d+(\.\d+)?) Safari/.test(s)&&!r.windowsPhone?(n.safari=!0,n.safariVersion=parseInt(RegExp.$1,10),n.es2019=n.safariVersion>10):/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(s)&&(n.ie=!0,n.trident=!0,n.tridentVersion=parseInt(RegExp.$1,10),n.ieVersion=parseInt(RegExp.$3,10)),/Silk/.test(s)&&(n.silk=!0),n)},89289(t,e,i){var s,r,n,a=i(27919),o={supportInverseAlpha:!1,supportNewBlendModes:!1};t.exports=("function"!=typeof importScripts&&void 0!==document&&(o.supportNewBlendModes=(s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",r="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",(n=new Image).onload=function(){var t=new Image;t.onload=function(){var e=a.create2D(t,6).getContext("2d",{willReadFrequently:!0});if(e.globalCompositeOperation="multiply",e.drawImage(n,0,0),e.drawImage(t,2,0),!e.getImageData(2,0,1,1))return!1;var i=e.getImageData(2,0,1,1).data;a.remove(t),o.supportNewBlendModes=255===i[0]&&0===i[1]&&0===i[2]},t.src=s+"/wCKxvRF"+r},n.src=s+"AP804Oa6"+r,!1),o.supportInverseAlpha=function(){var t=a.create2D(this,2).getContext("2d",{willReadFrequently:!0});t.fillStyle="rgba(10, 20, 30, 0.5)",t.fillRect(0,0,1,1);var e=t.getImageData(0,0,1,1);if(null===e)return!1;t.putImageData(e,1,0);var i=t.getImageData(1,0,1,1),s=i.data[0]===e.data[0]&&i.data[1]===e.data[1]&&i.data[2]===e.data[2]&&i.data[3]===e.data[3];return a.remove(this),s}()),o)},89357(t,e,i){var s=i(25892),r=i(84148),n=i(27919),a={canvas:!1,canvasBitBltShift:null,file:!1,fileSystem:!1,getUserMedia:!0,littleEndian:!1,localStorage:!1,pointerLock:!1,stableSort:!1,support32bit:!1,vibration:!1,webGL:!1,worker:!1};t.exports=function(){if("function"==typeof importScripts)return a;a.canvas=!!window.CanvasRenderingContext2D;try{a.localStorage=!!localStorage.getItem}catch(t){a.localStorage=!1}a.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),a.fileSystem=!!window.requestFileSystem;var t,e,i,o=!1;return a.webGL=function(){if(window.WebGLRenderingContext)try{var t=n.createWebGL(this),e=t.getContext("webgl")||t.getContext("experimental-webgl"),i=n.create2D(this),s=i.getContext("2d",{willReadFrequently:!0}).createImageData(1,1);return o=s.data instanceof Uint8ClampedArray,n.remove(t),n.remove(i),!!e}catch(t){return!1}return!1}(),a.worker=!!window.Worker,a.pointerLock="pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||navigator.oGetUserMedia,window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,a.getUserMedia=a.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,r.firefox&&r.firefoxVersion<21&&(a.getUserMedia=!1),!s.iOS&&(r.ie||r.firefox||r.chrome)&&(a.canvasBitBltShift=!0),(r.safari||r.mobileSafari)&&(a.canvasBitBltShift=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(a.vibration=!0),"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint32Array&&(a.littleEndian=(t=new ArrayBuffer(4),e=new Uint8Array(t),i=new Uint32Array(t),e[0]=161,e[1]=178,e[2]=195,e[3]=212,3569595041===i[0]||2712847316!==i[0]&&null)),a.support32bit="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof Int32Array&&null!==a.littleEndian&&o,a}()},91639(t){var e={available:!1,cancel:"",keyboard:!1,request:""};t.exports=function(){if("function"==typeof importScripts)return e;var t,i="Fullscreen",s="FullScreen",r=["request"+i,"request"+s,"webkitRequest"+i,"webkitRequest"+s,"msRequest"+i,"msRequest"+s,"mozRequest"+s,"mozRequest"+i];for(t=0;t=1)&&(r.touch=!0),(navigator.msPointerEnabled||navigator.pointerEnabled)&&(r.mspointer=!0),navigator.getGamepads&&(r.gamepads=!0),"onwheel"in window||s.ie&&"WheelEvent"in window?r.wheelEvent="wheel":"onmousewheel"in window?r.wheelEvent="mousewheel":s.firefox&&"MouseScrollEvent"in window&&(r.wheelEvent="DOMMouseScroll")),r)},25892(t){var e={android:!1,chromeOS:!1,cordova:!1,crosswalk:!1,desktop:!1,ejecta:!1,electron:!1,iOS:!1,iOSVersion:0,iPad:!1,iPhone:!1,kindle:!1,linux:!1,macOS:!1,node:!1,nodeWebkit:!1,pixelRatio:1,webApp:!1,windows:!1,windowsPhone:!1};t.exports=function(){if("function"==typeof importScripts)return e;var t=navigator.userAgent;/Windows/.test(t)?e.windows=!0:/Mac OS/.test(t)&&!/like Mac OS/.test(t)?navigator.maxTouchPoints&&navigator.maxTouchPoints>2?(e.iOS=!0,e.iPad=!0,navigator.appVersion.match(/Version\/(\d+)/),e.iOSVersion=parseInt(RegExp.$1,10)):e.macOS=!0:/Android/.test(t)?e.android=!0:/Linux/.test(t)?e.linux=!0:/iP[ao]d|iPhone/i.test(t)?(e.iOS=!0,navigator.appVersion.match(/OS (\d+)/),e.iOSVersion=parseInt(RegExp.$1,10),e.iPhone=-1!==t.toLowerCase().indexOf("iphone"),e.iPad=-1!==t.toLowerCase().indexOf("ipad")):/Kindle/.test(t)||/\bKF[A-Z][A-Z]+/.test(t)||/Silk.*Mobile Safari/.test(t)?e.kindle=!0:/CrOS/.test(t)&&(e.chromeOS=!0),(/Windows Phone/i.test(t)||/IEMobile/i.test(t))&&(e.android=!1,e.iOS=!1,e.macOS=!1,e.windows=!0,e.windowsPhone=!0);var i=/Silk/.test(t);return(e.windows||e.macOS||e.linux&&!i||e.chromeOS)&&(e.desktop=!0),(e.windowsPhone||/Windows NT/i.test(t)&&/Touch/i.test(t))&&(e.desktop=!1),navigator.standalone&&(e.webApp=!0),"function"!=typeof importScripts&&(void 0!==window.cordova&&(e.cordova=!0),void 0!==window.ejecta&&(e.ejecta=!0)),"undefined"!=typeof process&&process.versions&&process.versions.node&&(e.node=!0),e.node&&"object"==typeof process.versions&&(e.nodeWebkit=!!process.versions["node-webkit"],e.electron=!!process.versions.electron),/Crosswalk/.test(t)&&(e.crosswalk=!0),e.pixelRatio=window.devicePixelRatio||1,e}()},43267(t,e,i){var s=i(95540),r={h264:!1,hls:!1,mov:!1,mp4:!1,m4v:!1,ogg:!1,vp9:!1,webm:!1,hasRequestVideoFrame:!1};t.exports=function(){if("function"==typeof importScripts)return r;var t=document.createElement("video"),e=!!t.canPlayType,i=/^no$/;try{e&&(t.canPlayType('video/ogg; codecs="theora"').replace(i,"")&&(r.ogg=!0),t.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(i,"")&&(r.h264=!0,r.mp4=!0),t.canPlayType('video/quicktime4; codecs="avc1.42E01E"').replace(i,"")&&(r.mov=!0),t.canPlayType("video/x-m4v").replace(i,"")&&(r.m4v=!0),t.canPlayType('video/webm; codecs="vp8, vorbis"').replace(i,"")&&(r.webm=!0),t.canPlayType('video/webm; codecs="vp9"').replace(i,"")&&(r.vp9=!0),t.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(i,"")&&(r.hls=!0))}catch(t){}return t.parentNode&&t.parentNode.removeChild(t),r.getVideoURL=function(t){Array.isArray(t)||(t=[t]);for(var e=0;e4096&&(r=Math.ceil(s/4096),s=4096),this.dataTextureResolution[0]=s,this.dataTextureResolution[1]=r;var n=new ArrayBuffer(s*r*4),o=new Uint32Array(n),l=new Uint8Array(n),u=0,d=65536;o[u++]=Math.round(this.bands[0].start*d),o[u++]=Math.round(this.bands[this.bands.length-1].end*d);for(var c=0;c<=e;c++)for(var f=Math.pow(2,c),p=1;po.end&&(o.end=o.start)}return i&&(this.bands=r.filter(function(t){return t.start=t){e=s;break}}return e?(t=(t-e.start)/(e.end-e.start),e.getColor(t)):{r:0,g:0,b:0,a:0,color:0}},destroy:function(){this.scene=null,this.dataTexture&&this.dataTexture.destroy()}});t.exports=l},51767(t,e,i){var s=i(83419),r=i(29747),n=new s({initialize:function(t,e,i){this._rgb=[0,0,0],this.onChangeCallback=r,this.dirty=!1,this.set(t,e,i)},set:function(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this._rgb=[t,e,i],this.onChange(),this},equals:function(t,e,i){var s=this._rgb;return s[0]===t&&s[1]===e&&s[2]===i},onChange:function(){this.dirty=!0;var t=this._rgb;this.onChangeCallback.call(this,t[0],t[1],t[2])},r:{get:function(){return this._rgb[0]},set:function(t){this._rgb[0]=t,this.onChange()}},g:{get:function(){return this._rgb[1]},set:function(t){this._rgb[1]=t,this.onChange()}},b:{get:function(){return this._rgb[2]},set:function(t){this._rgb[2]=t,this.onChange()}},destroy:function(){this.onChangeCallback=null}});t.exports=n},60461(t){t.exports={TOP_LEFT:0,TOP_CENTER:1,TOP_RIGHT:2,LEFT_TOP:3,LEFT_CENTER:4,LEFT_BOTTOM:5,CENTER:6,RIGHT_TOP:7,RIGHT_CENTER:8,RIGHT_BOTTOM:9,BOTTOM_LEFT:10,BOTTOM_CENTER:11,BOTTOM_RIGHT:12}},54312(t,e,i){var s=i(62235),r=i(35893),n=i(86327),a=i(88417);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,r(e)+i),n(t,s(e)+o),t}},46768(t,e,i){var s=i(62235),r=i(26541),n=i(86327),a=i(385);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,r(e)-i),n(t,s(e)+o),t}},35827(t,e,i){var s=i(62235),r=i(54380),n=i(86327),a=i(40136);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,r(e)+i),n(t,s(e)+o),t}},46871(t,e,i){var s=i(66786),r=i(35893),n=i(7702);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),s(t,r(e)+i,n(e)+a),t}},5198(t,e,i){var s=i(7702),r=i(26541),n=i(20786),a=i(385);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,r(e)-i),n(t,s(e)+o),t}},11879(t,e,i){var s=i(60461),r=[];r[s.BOTTOM_CENTER]=i(54312),r[s.BOTTOM_LEFT]=i(46768),r[s.BOTTOM_RIGHT]=i(35827),r[s.CENTER]=i(46871),r[s.LEFT_CENTER]=i(5198),r[s.RIGHT_CENTER]=i(80503),r[s.TOP_CENTER]=i(89698),r[s.TOP_LEFT]=i(922),r[s.TOP_RIGHT]=i(21373),r[s.LEFT_BOTTOM]=r[s.BOTTOM_LEFT],r[s.LEFT_TOP]=r[s.TOP_LEFT],r[s.RIGHT_BOTTOM]=r[s.BOTTOM_RIGHT],r[s.RIGHT_TOP]=r[s.TOP_RIGHT];t.exports=function(t,e,i,s,n){return r[i](t,e,s,n)}},80503(t,e,i){var s=i(7702),r=i(54380),n=i(20786),a=i(40136);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,r(e)+i),n(t,s(e)+o),t}},89698(t,e,i){var s=i(35893),r=i(17717),n=i(88417),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,s(e)+i),a(t,r(e)-o),t}},922(t,e,i){var s=i(26541),r=i(17717),n=i(385),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,s(e)-i),a(t,r(e)-o),t}},21373(t,e,i){var s=i(54380),r=i(17717),n=i(40136),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,s(e)+i),a(t,r(e)-o),t}},91660(t,e,i){t.exports={BottomCenter:i(54312),BottomLeft:i(46768),BottomRight:i(35827),Center:i(46871),LeftCenter:i(5198),QuickSet:i(11879),RightCenter:i(80503),TopCenter:i(89698),TopLeft:i(922),TopRight:i(21373)}},71926(t,e,i){var s=i(60461),r=i(79291),n={In:i(91660),To:i(16694)};n=r(!1,n,s),t.exports=n},21578(t,e,i){var s=i(62235),r=i(35893),n=i(88417),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,r(e)+i),a(t,s(e)+o),t}},10210(t,e,i){var s=i(62235),r=i(26541),n=i(385),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,r(e)-i),a(t,s(e)+o),t}},82341(t,e,i){var s=i(62235),r=i(54380),n=i(40136),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,r(e)+i),a(t,s(e)+o),t}},87958(t,e,i){var s=i(62235),r=i(26541),n=i(86327),a=i(40136);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,r(e)-i),n(t,s(e)+o),t}},40080(t,e,i){var s=i(7702),r=i(26541),n=i(20786),a=i(40136);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,r(e)-i),n(t,s(e)+o),t}},88466(t,e,i){var s=i(26541),r=i(17717),n=i(40136),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,s(e)-i),a(t,r(e)-o),t}},38829(t,e,i){var s=i(60461),r=[];r[s.BOTTOM_CENTER]=i(21578),r[s.BOTTOM_LEFT]=i(10210),r[s.BOTTOM_RIGHT]=i(82341),r[s.LEFT_BOTTOM]=i(87958),r[s.LEFT_CENTER]=i(40080),r[s.LEFT_TOP]=i(88466),r[s.RIGHT_BOTTOM]=i(19211),r[s.RIGHT_CENTER]=i(34609),r[s.RIGHT_TOP]=i(48741),r[s.TOP_CENTER]=i(49440),r[s.TOP_LEFT]=i(81288),r[s.TOP_RIGHT]=i(61323);t.exports=function(t,e,i,s,n){return r[i](t,e,s,n)}},19211(t,e,i){var s=i(62235),r=i(54380),n=i(86327),a=i(385);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,r(e)+i),n(t,s(e)+o),t}},34609(t,e,i){var s=i(7702),r=i(54380),n=i(20786),a=i(385);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,r(e)+i),n(t,s(e)+o),t}},48741(t,e,i){var s=i(54380),r=i(17717),n=i(385),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,s(e)+i),a(t,r(e)-o),t}},49440(t,e,i){var s=i(35893),r=i(17717),n=i(86327),a=i(88417);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)+i),n(t,r(e)-o),t}},81288(t,e,i){var s=i(26541),r=i(17717),n=i(86327),a=i(385);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)-i),n(t,r(e)-o),t}},61323(t,e,i){var s=i(54380),r=i(17717),n=i(86327),a=i(40136);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)+i),n(t,r(e)-o),t}},16694(t,e,i){t.exports={BottomCenter:i(21578),BottomLeft:i(10210),BottomRight:i(82341),LeftBottom:i(87958),LeftCenter:i(40080),LeftTop:i(88466),QuickSet:i(38829),RightBottom:i(19211),RightCenter:i(34609),RightTop:i(48741),TopCenter:i(49440),TopLeft:i(81288),TopRight:i(61323)}},66786(t,e,i){var s=i(88417),r=i(20786);t.exports=function(t,e,i){return s(t,e),r(t,i)}},62235(t){t.exports=function(t){return t.y+t.height-t.height*t.originY}},72873(t,e,i){var s=i(62235),r=i(26541),n=i(54380),a=i(17717),o=i(87841);t.exports=function(t,e){void 0===e&&(e=new o);var i=r(t),h=a(t);return e.x=i,e.y=h,e.width=n(t)-i,e.height=s(t)-h,e}},35893(t){t.exports=function(t){return t.x-t.width*t.originX+.5*t.width}},7702(t){t.exports=function(t){return t.y-t.height*t.originY+.5*t.height}},26541(t){t.exports=function(t){return t.x-t.width*t.originX}},87431(t){t.exports=function(t){return t.width*t.originX}},46928(t){t.exports=function(t){return t.height*t.originY}},54380(t){t.exports=function(t){return t.x+t.width-t.width*t.originX}},17717(t){t.exports=function(t){return t.y-t.height*t.originY}},86327(t){t.exports=function(t,e){return t.y=e-t.height+t.height*t.originY,t}},88417(t){t.exports=function(t,e){var i=t.width*t.originX;return t.x=e+i-.5*t.width,t}},20786(t){t.exports=function(t,e){var i=t.height*t.originY;return t.y=e+i-.5*t.height,t}},385(t){t.exports=function(t,e){return t.x=e+t.width*t.originX,t}},40136(t){t.exports=function(t,e){return t.x=e-t.width+t.width*t.originX,t}},66737(t){t.exports=function(t,e){return t.y=e+t.height*t.originY,t}},58724(t,e,i){t.exports={CenterOn:i(66786),GetBottom:i(62235),GetBounds:i(72873),GetCenterX:i(35893),GetCenterY:i(7702),GetLeft:i(26541),GetOffsetX:i(87431),GetOffsetY:i(46928),GetRight:i(54380),GetTop:i(17717),SetBottom:i(86327),SetCenterX:i(88417),SetCenterY:i(20786),SetLeft:i(385),SetRight:i(40136),SetTop:i(66737)}},20623(t){t.exports={setCrisp:function(t){return["optimizeSpeed","-moz-crisp-edges","-o-crisp-edges","-webkit-optimize-contrast","optimize-contrast","crisp-edges","pixelated"].forEach(function(e){t.style["image-rendering"]=e}),t.style.msInterpolationMode="nearest-neighbor",t},setBicubic:function(t){return t.style["image-rendering"]="auto",t.style.msInterpolationMode="bicubic",t}}},27919(t,e,i){var s,r,n,a=i(8054),o=i(68703),h=[],l=!1;t.exports=(n=function(){var t=0;return h.forEach(function(e){e.parent&&t++}),t},{create2D:function(t,e,i){return s(t,e,i,a.CANVAS)},create:s=function(t,e,i,s,n){var u;void 0===e&&(e=1),void 0===i&&(i=1),void 0===s&&(s=a.CANVAS),void 0===n&&(n=!1);var d=r(s);return null===d?(d={parent:t,canvas:document.createElement("canvas"),type:s},s===a.CANVAS&&h.push(d),u=d.canvas):(d.parent=t,u=d.canvas),n&&(d.parent=u),u.width=e,u.height=i,l&&s===a.CANVAS&&o.disable(u.getContext("2d",{willReadFrequently:!1})),u},createWebGL:function(t,e,i){return s(t,e,i,a.WEBGL)},disableSmoothing:function(){l=!0},enableSmoothing:function(){l=!1},first:r=function(t){if(void 0===t&&(t=a.CANVAS),t===a.WEBGL)return null;for(var e=0;e=0;e--)i.push({r:e,g:a,b:o,color:s(e,a,o)});for(n=0,e=0;e<=r;e++,a--)i.push({r:n,g:a,b:e,color:s(n,a,e)});for(a=0,o=255,e=0;e<=r;e++,o--,n++)i.push({r:n,g:a,b:o,color:s(n,a,o)});if(1024===t)return i;var h=[],l=0,u=1024/t;for(e=0;e>16&255,g:t>>8&255,b:255&t,a:255};return t>16777215&&(e.a=t>>>24),e}},62957(t){t.exports=function(t){var e=t.toString(16);return 1===e.length?"0"+e:e}},37589(t){t.exports=function(t,e,i){return t<<16|e<<8|i}},1e3(t){t.exports=function(t,e,i,s){return s<<24|t<<16|e<<8|i}},62183(t,e,i){var s=i(40987),r=i(89528);t.exports=function(t,e,i,n){n||(n=new s);var a=i,o=i,h=i;if(0!==e){var l=i<.5?i*(1+e):i+e-i*e,u=2*i-l;a=r(u,l,t+1/3),o=r(u,l,t),h=r(u,l,t-1/3)}return n.setGLTo(a,o,h,1)}},27939(t,e,i){var s=i(7537);t.exports=function(t,e){void 0===t&&(t=1),void 0===e&&(e=1);for(var i=[],r=0;r<=359;r++)i.push(s(r/359,t,e));return i}},7537(t,e,i){var s=i(37589);function r(t,e,i,s){var r=(t+6*e)%6,n=Math.min(r,4-r,1);return Math.round(255*(s-s*i*Math.max(0,n)))}t.exports=function(t,e,i,n){void 0===e&&(e=1),void 0===i&&(i=1);var a=r(5,t,e,i),o=r(3,t,e,i),h=r(1,t,e,i);return n?n.setTo?n.setTo(a,o,h,n.alpha,!0):(n.r=a,n.g=o,n.b=h,n.color=s(a,o,h),n):{r:a,g:o,b:h,color:s(a,o,h)}}},70238(t,e,i){var s=i(40987);t.exports=function(t,e){e||(e=new s),t=t.replace(/^(?:#|0x)?([a-f\d])([a-f\d])([a-f\d])$/i,function(t,e,i,s){return e+e+i+i+s+s});var i=/^(?:#|0x)?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);if(i){var r=parseInt(i[1],16),n=parseInt(i[2],16),a=parseInt(i[3],16);e.setTo(r,n,a)}return e}},89528(t){t.exports=function(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}},30100(t,e,i){var s=i(40987),r=i(90664);t.exports=function(t,e){var i=r(t);return e?e.setTo(i.r,i.g,i.b,i.a):new s(i.r,i.g,i.b,i.a)}},90664(t){t.exports=function(t){return t>16777215?{a:t>>>24,r:t>>16&255,g:t>>8&255,b:255&t}:{a:255,r:t>>16&255,g:t>>8&255,b:255&t}}},13699(t,e,i){var s=i(28915),r=i(37589),n=i(7537),a=function(t,e,i,n,a,o,h,l){void 0===h&&(h=100),void 0===l&&(l=0);var u=l/h,d=s(t,n,u),c=s(e,a,u),f=s(i,o,u);return{r:d,g:c,b:f,a:255,color:r(d,c,f)}},o=function(t,e,i,r,a,o,h,l,u){if(void 0===u&&(u=0),0===u){var d=t-r;d>.5?t-=1:d<-.5&&(t+=1)}else u>0?t>r&&(t-=1):tt?s.ORIENTATION.PORTRAIT:s.ORIENTATION.LANDSCAPE}},74403(t){t.exports=function(t){var e;return""!==t&&("string"==typeof t?e=document.getElementById(t):t&&1===t.nodeType&&(e=t)),e||(e=document.body),e}},56836(t){t.exports=function(t){var e="";try{if(window.DOMParser)e=(new DOMParser).parseFromString(t,"text/xml");else(e=new ActiveXObject("Microsoft.XMLDOM")).loadXML(t)}catch(t){e=null}return e&&e.documentElement&&!e.getElementsByTagName("parsererror").length?e:null}},35846(t){t.exports=function(t){t.parentNode&&t.parentNode.removeChild(t)}},43092(t,e,i){var s=i(83419),r=i(29747),n=new s({initialize:function(){this.isRunning=!1,this.callback=r,this.isSetTimeOut=!1,this.timeOutID=null,this.delay=0;var t=this;this.step=function e(i){t.callback(i),t.isRunning&&(t.timeOutID=window.requestAnimationFrame(e))},this.stepTimeout=function e(){t.isRunning&&(t.timeOutID=window.setTimeout(e,t.delay)),t.callback(window.performance.now())}},start:function(t,e,i){this.isRunning||(this.callback=t,this.isSetTimeOut=e,this.delay=i,this.isRunning=!0,this.timeOutID=e?window.setTimeout(this.stepTimeout,0):window.requestAnimationFrame(this.step))},stop:function(){this.isRunning=!1,this.isSetTimeOut?clearTimeout(this.timeOutID):window.cancelAnimationFrame(this.timeOutID)},destroy:function(){this.stop(),this.callback=r}});t.exports=n},84902(t,e,i){var s={AddToDOM:i(40366),DOMContentLoaded:i(57264),GetInnerHeight:i(57811),GetScreenOrientation:i(45818),GetTarget:i(74403),ParseXML:i(56836),RemoveFromDOM:i(35846),RequestAnimationFrame:i(43092)};t.exports=s},47565(t,e,i){var s=i(83419),r=i(50792),n=i(37277),a=new s({Extends:r,initialize:function(){r.call(this)},shutdown:function(){this.removeAllListeners()},destroy:function(){this.removeAllListeners()}});n.register("EventEmitter",a,"events"),t.exports=a},93055(t,e,i){t.exports={EventEmitter:i(47565)}},10189(t,e,i){var s=i(83419),r=i(13045),n=new s({Extends:r,initialize:function(t,e){void 0===e&&(e=1),r.call(this,t,"FilterBarrel"),this.amount=e}});t.exports=n},16762(t,e,i){var s=i(83419),r=i(13045),n=new s({Extends:r,initialize:function(t,e,i,s,n){void 0===e&&(e="__WHITE"),void 0===i&&(i=0),void 0===s&&(s=1),void 0===n&&(n=[1,1,1,1]),r.call(this,t,"FilterBlend"),this.glTexture,this.blendMode=i,this.amount=s,this.color=n,this.setTexture(e)},setTexture:function(t){var e=this.camera.scene.sys.textures.getFrame(t);return e&&(this.glTexture=e.glTexture),this}});t.exports=n},37597(t,e,i){var s=i(83419),r=i(13045),n=new s({Extends:r,initialize:function(t,e){r.call(this,t,"FilterBlocky"),this.size={x:4,y:4},this.offset={x:0,y:0},e&&(void 0!==e.size&&("number"==typeof e.size?(this.size.x=e.size,this.size.y=e.size):(this.size.x=e.size.x,this.size.y=e.size.y)),void 0!==e.offset&&("number"==typeof e.offset?(this.offset.x=e.offset,this.offset.y=e.offset):(this.offset.x=e.offset.x,this.offset.y=e.offset.y)))}});t.exports=n},88344(t,e,i){var s=i(83419),r=i(13045),n=new s({Extends:r,initialize:function(t,e,i,s,n,a,o){void 0===e&&(e=0),void 0===i&&(i=2),void 0===s&&(s=2),void 0===n&&(n=1),void 0===o&&(o=4),r.call(this,t,"FilterBlur"),this.quality=e,this.x=i,this.y=s,this.strength=n,this.glcolor=[1,1,1],null!=a&&(this.color=a),this.steps=o},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}},getPadding:function(){var t=this.paddingOverride;if(t)return this.currentPadding.setTo(t.x,t.y,t.width,t.height),t;var e=this.quality,i=0===e?1.333:1===e?3.2307692308:5.176470588235294,s=this.steps*this.strength*i,r=Math.ceil(this.x*s),n=Math.ceil(this.y*s);return this.currentPadding.setTo(-r,-n,2*r,2*n),this.currentPadding}});t.exports=n},47564(t,e,i){var s=i(83419),r=i(13045),n=new s({Extends:r,initialize:function(t,e,i,s,n,a,o,h){void 0===e&&(e=.5),void 0===i&&(i=1),void 0===s&&(s=.2),void 0===n&&(n=!1),void 0===a&&(a=1),void 0===o&&(o=1),void 0===h&&(h=1),r.call(this,t,"FilterBokeh"),this.radius=e,this.amount=i,this.contrast=s,this.isTiltShift=n,this.blurX=a,this.blurY=o,this.strength=h},getPadding:function(){var t=this.paddingOverride;if(t)return this.currentPadding.setTo(t.x,t.y,t.width,t.height),t;var e=Math.ceil(this.camera.height*this.radius*.021426096060426905);return this.currentPadding.setTo(-e,-e,2*e,2*e),this.currentPadding}});t.exports=n},77011(t,e,i){var s=i(83419),r=i(13045),n=i(89422),a=new s({Extends:r,initialize:function(t){r.call(this,t,"FilterColorMatrix"),this.colorMatrix=new n},destroy:function(){this.colorMatrix=null,r.prototype.destroy.call(this)}});t.exports=a},95200(t,e,i){var s=i(83419),r=i(13045),n=i(89422),a=new s({Extends:r,initialize:function(t,e){r.call(this,t,"FilterCombineColorMatrix"),this.glTexture,this.colorMatrixSelf=new n,this.colorMatrixTransfer=new n,this.additions=[1,1,1,0],this.multiplications=[0,0,0,1],this.setTexture(e||"__WHITE")},setTexture:function(t){var e=t instanceof Phaser.Textures.Texture?t:this.camera.scene.sys.textures.getFrame(t);return e&&(this.glTexture=e.glTexture),this},setupAlphaTransfer:function(t,e,i,s,r,n){var a=this.colorMatrixSelf,o=this.colorMatrixTransfer;a.reset(),o.reset(),this.additions=[1,1,1,0],this.multiplications=[0,0,0,1],t||a.black(),e||o.black(),r?a.brightnessToAlphaInverse(!0):i&&a.brightnessToAlpha(!0),n?o.brightnessToAlphaInverse(!0):s&&o.brightnessToAlpha(!0)},destroy:function(){this.colorMatrixSelf=null,this.colorMatrixTransfer=null,r.prototype.destroy.call(this)}});t.exports=a},13045(t,e,i){var s=i(83419),r=i(87841),n=new s({initialize:function(t,e){this.active=!0,this.camera=t,this.renderNode=e,this.paddingOverride=new r,this.currentPadding=new r,this.allowBaseDraw=!0,this.ignoreDestroy=!1},getPadding:function(){return this.paddingOverride||this.currentPadding},getPaddingCeil:function(){var t=this.getPadding(),e=new r(Math.ceil(t.x),Math.ceil(t.y),Math.ceil(t.width),Math.ceil(t.height));return this.currentPadding.setTo(e.x,e.y,e.width,e.height),e},setPaddingOverride:function(t,e,i,s){return null===t?(this.paddingOverride=null,this):(void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.paddingOverride=new r(t,e,i-t,s-e),this)},setActive:function(t){return this.active=t,this},destroy:function(){this.active=!1,this.renderNode=null,this.camera=null}});t.exports=n},16898(t,e,i){var s=i(83419),r=i(13045),n=new s({Extends:r,initialize:function(t,e,i,s){void 0===e&&(e="__WHITE"),void 0===i&&(i=.005),void 0===s&&(s=.005),r.call(this,t,"FilterDisplacement"),this.x=i,this.y=s,this.glTexture,this.setTexture(e)},setTexture:function(t){var e=this.camera.scene.sys.textures.getFrame(t);return e&&(this.glTexture=e.glTexture),this},getPadding:function(){var t=this.paddingOverride;if(t)return this.currentPadding.setTo(t.x,t.y,t.width,t.height),t;var e=this.camera,i=Math.ceil(e.width*this.x*.5),s=Math.ceil(e.height*this.y*.5);return this.currentPadding.setTo(-i,-s,2*i,2*s),this.currentPadding}});t.exports=n},42652(t,e,i){var s=i(83419),r=i(13045),n=new s({Extends:r,initialize:function(t,e,i,s,n,a,o,h){void 0===i&&(i=4),void 0===s&&(s=0),void 0===n&&(n=1),void 0===a&&(a=!1),void 0===o&&(o=t.scene.sys.game.config.glowQuality),void 0===h&&(h=t.scene.sys.game.config.glowDistance),r.call(this,t,"FilterGlow"),this.outerStrength=i,this.innerStrength=s,this.scale=n,this.knockout=a,this._quality=Math.max(Math.round(o),1),this._distance=Math.max(Math.round(h),1),this.glcolor=[1,1,1,1],void 0!==e&&(this.color=e)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}},distance:{get:function(){return this._distance}},quality:{get:function(){return this._quality}},getPadding:function(){var t=this.paddingOverride;if(t)return this.currentPadding.setTo(t.x,t.y,t.width,t.height),t;var e=this.currentPadding,i=Math.ceil(this.distance*this.scale);return e.left=-i,e.top=-i,e.right=i,e.bottom=i,e}});t.exports=n},43927(t,e,i){var s=i(83419),r=i(13045),n=i(73043),a=new s({Extends:r,initialize:function(t,e){e||(e={});var i=t.scene;r.call(this,t,"FilterGradientMap");var s=e.ramp;s||(s={colorStart:0,colorEnd:16777215}),s instanceof n||(s=new n(i,s,!0)),this.ramp=s,this.dither=!!e.dither,this.color=[0,0,0,0],e.color&&(this.color[0]=e.color[0]||0,this.color[1]=e.color[1]||0,this.color[2]=e.color[2]||0,this.color[3]=e.color[3]||0),this.colorFactor=[.3,.6,.1,0],e.colorFactor&&(this.colorFactor[0]=e.colorFactor[0]||0,this.colorFactor[1]=e.colorFactor[1]||0,this.colorFactor[2]=e.colorFactor[2]||0,this.colorFactor[3]=e.colorFactor[3]||0),this.unpremultiply=void 0===e.unpremultiply||e.unpremultiply,this.alpha=void 0===e.alpha?1:e.alpha}});t.exports=a},84714(t,e,i){var s=i(83419),r=i(13045),n=i(37867),a=i(61340),o=new s({Extends:r,initialize:function(t,e){r.call(this,t,"FilterImageLight"),this.normalGlTexture,this.environmentGlTexture,this.viewMatrix=new n,this.modelRotation=e.modelRotation||0,this.modelRotationSource=e.modelRotationSource||null,this.bulge=e.bulge||0,this.colorFactor=e.colorFactor||[1,1,1],this._tempMatrix=new a,this._tempParentMatrix=new a,this.setEnvironmentMap(e.environmentMap||"__WHITE"),this.setNormalMap(e.normalMap||"__NORMAL"),e.viewMatrix&&this.viewMatrix.set(e.viewMatrix)},setEnvironmentMap:function(t){var e=t instanceof Phaser.Textures.Texture?t:this.camera.scene.sys.textures.getFrame(t);return e&&(this.environmentGlTexture=e.glTexture),this},setNormalMap:function(t){var e=t instanceof Phaser.Textures.Texture?t:this.camera.scene.sys.textures.getFrame(t);return e&&(this.normalGlTexture=e.glTexture),this},setNormalMapFromGameObject:function(t){var e=t.texture.dataSource[0];return e&&(this.normalGlTexture=e.glTexture),this},getModelRotation:function(){return this.modelRotationSource?"function"==typeof this.modelRotationSource?this.modelRotationSource():this.modelRotationSource.hasTransformComponent?this.modelRotationSource.getWorldTransformMatrix(this._tempMatrix,this._tempParentMatrix).rotationNormalized:this.modelRotation:this.modelRotation}});t.exports=o},51890(t,e,i){var s=i(83419),r=i(13045),n=i(40987),a=new s({Extends:r,initialize:function(t,e){void 0===e&&(e={}),r.call(this,t,"FilterKey"),this.color=[1,1,1,1],void 0!==e.color&&this.setColor(e.color),void 0!==e.alpha&&this.setAlpha(e.alpha),this.isolate=!1,void 0!==e.isolate&&(this.isolate=e.isolate),this.threshold=.0625,void 0!==e.threshold&&(this.threshold=e.threshold),this.feather=0,void 0!==e.feather&&(this.feather=e.feather)},setAlpha:function(t){return this.color[3]=t,this},setColor:function(t){var e=this.color[3];if("number"==typeof t){var i=n.IntegerToRGB(t);this.color=[i.r/255,i.g/255,i.b/255,e]}else if("string"==typeof t){var s=n.HexStringToColor(t);this.color=[s.redGL,s.greenGL,s.blueGL,e]}else Array.isArray(t)?this.color=[t[0],t[1],t[2],e]:t instanceof n&&(this.color=[t.redGL,t.greenGL,t.blueGL,e]);return this}});t.exports=a},97797(t,e,i){var s=i(83419),r=i(45650),n=i(13045),a=new s({Extends:n,initialize:function(t,e,i,s,r,a){void 0===e&&(e="__WHITE"),void 0===i&&(i=!1),void 0===a&&(a=1),n.call(this,t,"FilterMask"),this.glTexture,this._dynamicTexture=null,this.maskGameObject=null,this.invert=i,this.autoUpdate=!0,this.needsUpdate=!1,this.viewTransform=r||"world",this.viewCamera=s,this.scaleFactor=a,"string"==typeof e?this.setTexture(e):this.setGameObject(e)},updateDynamicTexture:function(t,e){var i=this.scaleFactor,s=t*i,n=e*i,a=this.maskGameObject;if(a){if(this._dynamicTexture)this._dynamicTexture.width!==s||this._dynamicTexture.height!==n?this._dynamicTexture.setSize(s,n,!1):this._dynamicTexture.clear();else{var o=this.camera.scene.sys.textures;this._dynamicTexture=o.addDynamicTexture(r(),s,n,!1)}this.glTexture=this._dynamicTexture.get().glTexture;var h=this.viewCamera||a.scene.renderer.currentViewCamera;this._dynamicTexture.capture(a,{transform:this.viewTransform,camera:h}),this._dynamicTexture.render(),this.needsUpdate=!1}},setGameObject:function(t){return this.maskGameObject=t,this.needsUpdate=!0,this},setTexture:function(t){var e=this.camera.scene.sys.textures.getFrame(t);return e&&(this.maskGameObject=null,this.glTexture=e.glTexture),this},destroy:function(){this._dynamicTexture&&this._dynamicTexture.destroy(),this.maskGameObject=null,this._dynamicTexture=null,n.prototype.destroy.call(this)}});t.exports=a},37911(t,e,i){var s=i(83419),r=i(13045),n=i(37867),a=i(25836),o=new s({Extends:r,initialize:function(t,e){e=e||{},r.call(this,t,"FilterNormalTools"),this._rotation=0,this.viewMatrix=new n,this.setRotation(e.rotation||0),this.rotationSource=e.rotationSource||null,this.facingPower=e.facingPower||1,this.outputRatio=e.outputRatio||!1,this.ratioVector=new a(0,0,1),e.ratioVector&&this.ratioVector.set(e.ratioVector[0],e.ratioVector[1],e.ratioVector[2]),this.ratioRadius=e.ratioRadius||1},getRotation:function(){if(this.rotationSource){if("function"==typeof this.rotationSource)return this.rotationSource();if(this.rotationSource.hasTransformComponent)return this.rotationSource.getWorldTransformMatrix().rotationNormalized}return this._rotation},setRotation:function(t){return this.viewMatrix.identity().rotateZ(t),this._rotation=t,this},updateRotation:function(){if(this.rotationSource){var t=this.getRotation();this.viewMatrix.identity().rotateZ(t),this._rotation=t}return this}});t.exports=o},6379(t,e,i){var s=i(83419),r=i(13045),n=new s({Extends:r,initialize:function(t,e){void 0===e&&(e={}),r.call(this,t,"FilterPanoramaBlur"),this.radius=e.radius||1,this.samplesX=e.samplesX||32,this.samplesY=e.samplesY||16,this.power=e.power||1}});t.exports=n},2195(t,e,i){var s=i(83419),r=i(53427),n=i(13045),a=i(16762),o=new s({Extends:n,initialize:function(t){n.call(this,t,"FilterParallelFilters"),this.top=new r(t),this.bottom=new r(t),this.blend=new a(t)}});r.prototype.addParallelFilters=function(){return this.add(new o(this.camera))},t.exports=o},29861(t,e,i){var s=i(83419),r=i(13045),n=new s({Extends:r,initialize:function(t,e){void 0===e&&(e=1),r.call(this,t,"FilterPixelate"),this.amount=e}});t.exports=n},14366(t,e,i){var s=i(83419),r=i(13045),n=new s({Extends:r,initialize:function(t,e){e||(e={}),r.call(this,t,"FilterQuantize"),this.steps=[8,8,8,8],e.steps&&(this.steps[0]=e.steps[0],this.steps[1]=e.steps[1],this.steps[2]=e.steps[2],this.steps[3]=e.steps[3]),this.gamma=[1,1,1,1],e.gamma&&(this.gamma[0]=e.gamma[0],this.gamma[1]=e.gamma[1],this.gamma[2]=e.gamma[2],this.gamma[3]=e.gamma[3]),this.offset=[0,0,0,0],e.offset&&(this.offset[0]=e.offset[0],this.offset[1]=e.offset[1],this.offset[2]=e.offset[2],this.offset[3]=e.offset[3]),this.mode=e.mode||0,this.dither=!!e.dither}});t.exports=n},63785(t,e,i){var s=i(83419),r=i(13045),n=new s({Extends:r,initialize:function(t,e,i){void 0===i&&(i=null),r.call(this,t,"FilterSampler"),this.allowBaseDraw=!1,this.callback=e,this.region=i}});t.exports=n},62229(t,e,i){var s=i(83419),r=i(13045),n=new s({Extends:r,initialize:function(t,e,i,s,n,a,o,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=.1),void 0===n&&(n=1),void 0===o&&(o=6),void 0===h&&(h=1),r.call(this,t,"FilterShadow"),this.x=e,this.y=i,this.decay=s,this.power=n,this.glcolor=[0,0,0,1],this.samples=o,this.intensity=h,void 0!==a&&(this.color=a)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}},getPadding:function(){var t=this.paddingOverride;if(t)return this.currentPadding.setTo(t.x,t.y,t.width,t.height),t;var e=this.camera,i=this.decay*this.intensity,s=Math.ceil(Math.abs(this.x)*e.width*i),r=Math.ceil(Math.abs(this.y)*e.height*i);return this.currentPadding.setTo(-s,-r,2*s,2*r),this.currentPadding}});t.exports=n},99534(t,e,i){var s=i(83419),r=i(13045),n=new s({Extends:r,initialize:function(t,e,i,s){r.call(this,t,"FilterThreshold"),this.edge1=[.5,.5,.5,.5],this.edge2=[.5,.5,.5,.5],this.invert=[!1,!1,!1,!1],this.setEdge(e,i),this.setInvert(s)},setEdge:function(t,e){void 0===t&&(t=.5),"number"==typeof t&&(t=[t,t,t,t]),this.edge1[0]=t[0],this.edge1[1]=t[1],this.edge1[2]=t[2],this.edge1[3]=t[3],void 0===e&&(e=t),"number"==typeof e&&(e=[e,e,e,e]),this.edge2[0]=e[0],this.edge2[1]=e[1],this.edge2[2]=e[2],this.edge2[3]=e[3];for(var i=0;i<4;i++)if(this.edge1[i]>this.edge2[i]){var s=this.edge1[i];this.edge1[i]=this.edge2[i],this.edge2[i]=s}return this},setInvert:function(t){return void 0===t&&(t=!1),"boolean"==typeof t&&(t=[t,t,t,t]),this.invert[0]=t[0],this.invert[1]=t[1],this.invert[2]=t[2],this.invert[3]=t[3],this}});t.exports=n},20263(t,e,i){var s=i(83419),r=i(13045),n=i(40987),a=new s({Extends:r,initialize:function(t,e,i,s,a,o,h){void 0===e&&(e=.5),void 0===i&&(i=.5),void 0===s&&(s=.5),void 0===a&&(a=.5),void 0===o&&(o=0),void 0===h&&(h=0),r.call(this,t,"FilterVignette"),this.x=e,this.y=i,this.radius=s,this.strength=a,this.color=new n,this.blendMode=h,this.setColor(o)},setColor:function(t){return"number"==typeof t?n.IntegerToColor(t,this.color):"string"==typeof t?n.HexStringToColor(t,this.color):t.setTo?this.color.setTo(t.red,t.green,t.blue,t.alpha):t?this.color.setTo(t.r||0,t.g||0,t.b||0,t.a||255):this.color.setTo(0,0,0,255),this}});t.exports=a},90002(t,e,i){var s=i(83419),r=i(13045),n=i(79237),a=new s({Extends:r,initialize:function(t,e,i,s,n,a){void 0===e&&(e=.1),r.call(this,t,"FilterWipe"),this.progress=0,this.wipeWidth=e,this.direction=i||0,this.axis=s||0,this.reveal=n||0,this.wipeTexture=null,this.setTexture(a)},setWipeWidth:function(t){return void 0===t&&(t=.1),this.wipeWidth=t,this},setLeftToRight:function(){return this.direction=0,this.axis=0,this},setRightToLeft:function(){return this.direction=1,this.axis=0,this},setTopToBottom:function(){return this.direction=1,this.axis=1,this},setBottomToTop:function(){return this.direction=0,this.axis=1,this},setWipeEffect:function(){return this.reveal=0,this.progress=0,this},setRevealEffect:function(){return this.setTexture(),this.reveal=1,this.progress=0,this},setTexture:function(t){return void 0===t&&(t="__DEFAULT"),this.wipeTexture=t instanceof n?t:this.camera.scene.sys.textures.get(t)||this.camera.scene.sys.textures.get("__DEFAULT"),this},setProgress:function(t){return this.progress=t,this}});t.exports=a},11889(t,e,i){var s={Controller:i(13045),Barrel:i(10189),Blend:i(16762),Blocky:i(37597),Blur:i(88344),Bokeh:i(47564),ColorMatrix:i(77011),CombineColorMatrix:i(95200),Displacement:i(16898),Glow:i(42652),GradientMap:i(43927),ImageLight:i(84714),Key:i(51890),Mask:i(97797),NormalTools:i(37911),PanoramaBlur:i(6379),ParallelFilters:i(2195),Pixelate:i(29861),Quantize:i(14366),Sampler:i(63785),Shadow:i(62229),Threshold:i(99534),Vignette:i(20263),Wipe:i(90002)};t.exports=s},25305(t,e,i){var s=i(10312),r=i(23568);t.exports=function(t,e,i){e.x=r(i,"x",0),e.y=r(i,"y",0),e.depth=r(i,"depth",0),e.flipX=r(i,"flipX",!1),e.flipY=r(i,"flipY",!1);var n=r(i,"scale",null);"number"==typeof n?e.setScale(n):null!==n&&(e.scaleX=r(n,"x",1),e.scaleY=r(n,"y",1));var a=r(i,"scrollFactor",null);"number"==typeof a?e.setScrollFactor(a):null!==a&&(e.scrollFactorX=r(a,"x",1),e.scrollFactorY=r(a,"y",1)),e.rotation=r(i,"rotation",0);var o=r(i,"angle",null);null!==o&&(e.angle=o),e.alpha=r(i,"alpha",1);var h=r(i,"origin",null);if("number"==typeof h)e.setOrigin(h);else if(null!==h){var l=r(h,"x",.5),u=r(h,"y",.5);e.setOrigin(l,u)}return e.blendMode=r(i,"blendMode",s.NORMAL),e.visible=r(i,"visible",!0),r(i,"add",!0)&&t.sys.displayList.add(e),e.preUpdate&&t.sys.updateList.add(e),e}},13059(t,e,i){var s=i(23568);t.exports=function(t,e){var i=s(e,"anims",null);if(null===i)return t;if("string"==typeof i)t.anims.play(i);else if("object"==typeof i){var r=t.anims,n=s(i,"key",void 0);if(n){var a=s(i,"startFrame",void 0),o=s(i,"delay",0),h=s(i,"repeat",0),l=s(i,"repeatDelay",0),u=s(i,"yoyo",!1),d=s(i,"play",!1),c=s(i,"delayedPlay",0),f={key:n,delay:o,repeat:h,repeatDelay:l,yoyo:u,startFrame:a};d?r.play(f):c>0?r.playAfterDelay(f,c):r.load(f)}}return t}},8050(t,e,i){var s=i(83419),r=i(73162),n=i(37277),a=i(51708),o=i(44594),h=i(19186),l=new s({Extends:r,initialize:function(t){r.call(this,t),this.sortChildrenFlag=!1,this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.addCallback=this.addChildCallback,this.removeCallback=this.removeChildCallback,this.events.once(o.BOOT,this.boot,this),this.events.on(o.START,this.start,this)},boot:function(){this.events.once(o.DESTROY,this.destroy,this)},addChildCallback:function(t){t.displayList&&t.displayList!==this&&t.removeFromDisplayList(),t.parentContainer&&t.parentContainer.remove(t),t.displayList||(this.queueDepthSort(),t.displayList=this,t.emit(a.ADDED_TO_SCENE,t,this.scene),this.events.emit(o.ADDED_TO_SCENE,t,this.scene))},removeChildCallback:function(t){this.queueDepthSort(),t.displayList=null,t.emit(a.REMOVED_FROM_SCENE,t,this.scene),this.events.emit(o.REMOVED_FROM_SCENE,t,this.scene)},start:function(){this.events.once(o.SHUTDOWN,this.shutdown,this)},queueDepthSort:function(){this.sortChildrenFlag=!0},depthSort:function(){this.sortChildrenFlag&&(h(this.list,this.sortByDepth),this.sortChildrenFlag=!1)},sortByDepth:function(t,e){return t._depth-e._depth},getChildren:function(){return this.list},shutdown:function(){for(var t=this.list,e=t.length;e--;)t[e]&&t[e].destroy(!0);t.length=0,this.events.off(o.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(o.START,this.start,this),this.scene=null,this.systems=null,this.events=null}});n.register("DisplayList",l,"displayList"),t.exports=l},95643(t,e,i){var s=i(83419),r=i(31401),n=i(53774),a=i(45893),o=i(50792),h=i(51708),l=i(44594),u=new s({Extends:o,Mixins:[r.Filters,r.RenderSteps],initialize:function(t,e){o.call(this),this.scene=t,this.displayList=null,this.type=e,this.state=0,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.vertexRoundMode="safeAuto",this.input=null,this.body=null,this.ignoreDestroy=!1,this.isDestroyed=!1,this.addRenderStep&&this.addRenderStep(this.renderWebGL),this.on(h.ADDED_TO_SCENE,this.addedToScene,this),this.on(h.REMOVED_FROM_SCENE,this.removedFromScene,this),t.sys.queueDepthSort()},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},setState:function(t){return this.state=t,this},setDataEnabled:function(){return this.data||(this.data=new a(this)),this},setData:function(t,e){return this.data||(this.data=new a(this)),this.data.set(t,e),this},incData:function(t,e){return this.data||(this.data=new a(this)),this.data.inc(t,e),this},toggleData:function(t){return this.data||(this.data=new a(this)),this.data.toggle(t),this},getData:function(t){return this.data||(this.data=new a(this)),this.data.get(t)},setInteractive:function(t,e,i){return this.scene.sys.input.enable(this,t,e,i),this},disableInteractive:function(t){return void 0===t&&(t=!1),this.scene.sys.input.disable(this,t),this},removeInteractive:function(t){return void 0===t&&(t=!1),this.scene.sys.input.clear(this),t&&this.scene.sys.input.resetCursor(),this.input=void 0,this},addedToScene:function(){},removedFromScene:function(){},update:function(){},toJSON:function(){return n(this)},willRender:function(t){return!(!(!this.displayList||!this.displayList.active||this.displayList.willRender(t))||u.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},willRoundVertices:function(t,e){switch(this.vertexRoundMode){case"safe":return e;case"safeAuto":return e&&t.roundPixels;case"full":return!0;case"fullAuto":return t.roundPixels;default:return!1}},setVertexRoundMode:function(t){return this.vertexRoundMode=t,this},getIndexList:function(){for(var t=this,e=this.parentContainer,i=[];e&&(i.unshift(e.getIndex(t)),t=e,e.parentContainer);)e=e.parentContainer;return this.displayList?i.unshift(this.displayList.getIndex(t)):i.unshift(this.scene.sys.displayList.getIndex(t)),i},addToDisplayList:function(t){return void 0===t&&(t=this.scene.sys.displayList),this.displayList&&this.displayList!==t&&this.removeFromDisplayList(),t.exists(this)||(this.displayList=t,t.add(this,!0),t.queueDepthSort(),this.emit(h.ADDED_TO_SCENE,this,this.scene),t.events.emit(l.ADDED_TO_SCENE,this,this.scene)),this},addToUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.add(this),this},removeFromDisplayList:function(){var t=this.displayList||this.scene.sys.displayList;return t&&t.exists(this)&&(t.remove(this,!0),t.queueDepthSort(),this.displayList=null,this.emit(h.REMOVED_FROM_SCENE,this,this.scene),t.events.emit(l.REMOVED_FROM_SCENE,this,this.scene)),this},removeFromUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.remove(this),this},getDisplayList:function(){var t=null;return this.parentContainer?t=this.parentContainer.list:this.displayList&&(t=this.displayList.list),t},destroy:function(t){this.scene&&!this.ignoreDestroy&&(void 0===t&&(t=!1),this.isDestroyed=!0,this.preDestroy&&this.preDestroy.call(this),this.emit(h.DESTROY,this,t),this.removeAllListeners(),this.removeFromDisplayList(),this.removeFromUpdateList(),this.input&&(this.scene.sys.input.clear(this),this.input=void 0),this.data&&(this.data.destroy(),this.data=void 0),this.body&&(this.body.destroy(),this.body=void 0),this.filterCamera&&(this.filterCamera.destroy(),this.filterCamera=void 0),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0)}});u.RENDER_MASK=15,t.exports=u},44603(t,e,i){var s=i(83419),r=i(37277),n=i(44594),a=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.displayList,this.updateList,this.events.once(n.BOOT,this.boot,this),this.events.on(n.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(n.DESTROY,this.destroy,this)},start:function(){this.events.once(n.SHUTDOWN,this.shutdown,this)},shutdown:function(){this.events.off(n.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(n.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});a.register=function(t,e){a.prototype.hasOwnProperty(t)||(a.prototype[t]=e)},a.remove=function(t){a.prototype.hasOwnProperty(t)&&delete a.prototype[t]},r.register("GameObjectCreator",a,"make"),t.exports=a},39429(t,e,i){var s=i(83419),r=i(37277),n=i(44594),a=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.displayList,this.updateList,this.events.once(n.BOOT,this.boot,this),this.events.on(n.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(n.DESTROY,this.destroy,this)},start:function(){this.events.once(n.SHUTDOWN,this.shutdown,this)},existing:function(t){return(t.renderCanvas||t.renderWebGL)&&this.displayList.add(t),t.preUpdate&&this.updateList.add(t),t},shutdown:function(){this.events.off(n.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(n.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});a.register=function(t,e){a.prototype.hasOwnProperty(t)||(a.prototype[t]=e)},a.remove=function(t){a.prototype.hasOwnProperty(t)&&delete a.prototype[t]},r.register("GameObjectFactory",a,"add"),t.exports=a},91296(t,e,i){var s=i(61340),r=new s,n=new s,a=new s,o=new s,h={camera:r,sprite:n,calc:a,cameraExternal:o};t.exports=function(t,e,i,s){return s?o.loadIdentity():o.copyFrom(e.matrixExternal),r.copyWithScrollFactorFrom(s?e.matrix:e.matrixCombined,e.scrollX,e.scrollY,t.scrollFactorX,t.scrollFactorY),a.copyFrom(r),i&&a.multiply(i),n.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),a.multiply(n),h}},45027(t,e,i){var s=i(83419),r=i(25774),n=i(37277),a=i(44594),o=new s({Extends:r,initialize:function(t){r.call(this),this.checkQueue=!0,this.scene=t,this.systems=t.sys,t.sys.events.once(a.BOOT,this.boot,this),t.sys.events.on(a.START,this.start,this)},boot:function(){this.systems.events.once(a.DESTROY,this.destroy,this)},start:function(){var t=this.systems.events;t.on(a.PRE_UPDATE,this.update,this),t.on(a.UPDATE,this.sceneUpdate,this),t.once(a.SHUTDOWN,this.shutdown,this)},sceneUpdate:function(t,e){for(var i=this._active,s=i.length,r=0;r0){a=o.split("\n");var z=[];for(r=0;rE&&(d=E),c>C&&(c=C);var q=E+S.xAdvance,K=C+g;fF&&(F=I),IF&&(F=I),I0)for(var Q=0;Qo.length&&(y=o.length);for(var T=p,w=m,S={retroFont:!0,font:h,size:i,lineHeight:r+x,chars:{}},b=0,E=0;E?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",TEXT_SET2:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET3:"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",TEXT_SET4:"ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789",TEXT_SET5:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789",TEXT_SET6:"ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' ",TEXT_SET7:"AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39",TEXT_SET8:"0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET9:"ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?!",TEXT_SET10:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET11:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789"}},2638(t,e,i){var s=i(22186),r=i(83419),n=i(12310),a=new r({Extends:s,Mixins:[n],initialize:function(t,e,i,r,n,a,o){s.call(this,t,e,i,r,n,a,o),this.type="DynamicBitmapText",this.scrollX=0,this.scrollY=0,this.cropWidth=0,this.cropHeight=0,this.displayCallback,this.callbackData={parent:this,color:0,tint:{topLeft:0,topRight:0,bottomLeft:0,bottomRight:0},index:0,charCode:0,x:0,y:0,scale:0,rotation:0,data:0}},setSize:function(t,e){return this.cropWidth=t,this.cropHeight=e,this},setDisplayCallback:function(t){return this.displayCallback=t,this},setScrollX:function(t){return this.scrollX=t,this},setScrollY:function(t){return this.scrollY=t,this}});t.exports=a},86741(t,e,i){var s=i(20926);t.exports=function(t,e,i,r){var n=e._text,a=n.length,o=t.currentContext;if(0!==a&&s(t,o,e,i,r)){i.addToRenderList(e);var h=e.fromAtlas?e.frame:e.texture.frames.__BASE,l=e.displayCallback,u=e.callbackData,d=e.fontData.chars,c=e.fontData.lineHeight,f=e._letterSpacing,p=0,m=0,g=0,v=null,x=0,y=0,T=0,w=0,S=0,b=0,E=null,C=0,A=e.frame.source.image,_=h.cutX,M=h.cutY,R=0,O=0,P=e._fontSize/e.fontData.size,L=e._align,F=0,D=0;e.getTextBounds(!1);var I=e._bounds.lines;1===L?D=(I.longest-I.lengths[0])/2:2===L&&(D=I.longest-I.lengths[0]),o.translate(-e.displayOriginX,-e.displayOriginY);var N=i.roundPixels;e.cropWidth>0&&e.cropHeight>0&&(o.beginPath(),o.rect(0,0,e.cropWidth,e.cropHeight),o.clip());for(var B=0;B0||e.cropHeight>0;y&&((f=i.getClone()).setScissorEnable(!0),f.setScissorBox(v.tx,v.ty,e.cropWidth*v.scaleX,e.cropHeight*v.scaleY),f.use()),h.frame=e.frame;var T,w,S=r.MULTIPLY,b=a.getTintAppendFloatAlpha(e.tintTopLeft,e._alphaTL),E=a.getTintAppendFloatAlpha(e.tintTopRight,e._alphaTR),C=a.getTintAppendFloatAlpha(e.tintBottomLeft,e._alphaBL),A=a.getTintAppendFloatAlpha(e.tintBottomRight,e._alphaBR),_=0,M=0,R=0,O=0,P=e.letterSpacing,L=0,F=0,D=e.scrollX,I=e.scrollY,N=e.fontData,B=N.chars,k=N.lineHeight,U=e.fontSize/N.size,z=0,Y=e._align,X=0,W=0,G=e.getTextBounds(!1);e.maxWidth>0&&(d=(u=G.wrappedText).length);var H=e._bounds.lines;1===Y?W=(H.longest-H.lengths[0])/2:2===Y&&(W=H.longest-H.lengths[0]);for(var V=e.displayCallback,j=e.callbackData,q=0;q0&&(a=(n=L.wrappedText).length);var F=e._bounds.lines;1===R?P=(F.longest-F.lengths[0])/2:2===R&&(P=F.longest-F.lengths[0]),o.translate(-e.displayOriginX,-e.displayOriginY);for(var D=i.roundPixels,I=0;I0},getRenderList:function(){return this.dirty&&(this.renderList=this.children.list.filter(this.childCanRender,this),this.dirty=!1),this.renderList},clear:function(){this.children.removeAll(),this.dirty=!0},preDestroy:function(){this.children.destroy(),this.renderList=[]}});t.exports=d},72396(t){t.exports=function(t,e,i,s){var r=e.getRenderList();if(0!==r.length){var n=t.currentContext,a=i.alpha*e.alpha;if(0!==a){i.addToRenderList(e),n.globalCompositeOperation=t.blendModes[e.blendMode],n.imageSmoothingEnabled=!e.frame.source.scaleMode;var o=e.x-i.scrollX*e.scrollFactorX,h=e.y-i.scrollY*e.scrollFactorY;n.save(),s&&s.copyToContext(n);for(var l=i.roundPixels,u=0;u0&&p.height>0&&(n.save(),n.translate(d.x+o,d.y+h),n.scale(v,x),n.drawImage(f.source.image,p.x,p.y,p.width,p.height,m,g,p.width,p.height),n.restore())):(l&&(m=Math.round(m),g=Math.round(g)),p.width>0&&p.height>0&&n.drawImage(f.source.image,p.x,p.y,p.width,p.height,m+d.x+o,g+d.y+h,p.width,p.height)))}n.restore()}}}},9403(t,e,i){var s=i(6107),r=i(25305),n=i(44603),a=i(23568);n.register("blitter",function(t,e){void 0===t&&(t={});var i=a(t,"key",null),n=a(t,"frame",null),o=new s(this.scene,0,0,i,n);return void 0!==e&&(t.add=e),r(this.scene,o,t),o})},12709(t,e,i){var s=i(6107);i(39429).register("blitter",function(t,e,i,r){return this.displayList.add(new s(this.scene,t,e,i,r))})},48011(t,e,i){var s=i(29747),r=s,n=s;r=i(99485),n=i(72396),t.exports={renderWebGL:r,renderCanvas:n}},99485(t,e,i){var s=i(61340),r=i(70554),n=new s,a={quad:new Float32Array(8)},o={},h={};t.exports=function(t,e,i,s){var l=e.getRenderList(),u=i.camera,d=e.alpha;if(0!==l.length&&0!==d){u.addToRenderList(e);var c=n.copyWithScrollFactorFrom(u.getViewMatrix(!i.useCanvas),u.scrollX,u.scrollY,e.scrollFactorX,e.scrollFactorY);s&&c.multiply(s);for(var f=e.x,p=e.y,m=e.customRenderNodes,g=e.defaultRenderNodes,v=0;v0!=t>0,this._alpha=t}}});t.exports=n},43451(t,e,i){var s=i(87774),r=i(30529),n=i(83419),a=i(31401),o=i(95643),h=i(36683),l=new n({Extends:o,Mixins:[a.BlendMode,a.Depth,a.RenderNodes,a.Visible,h],initialize:function(t,e){o.call(this,t,"CaptureFrame");var i=t.renderer;this.drawingContext=new s(i,{width:i.width,height:i.height}),this.captureTexture=t.sys.textures.addGLTexture(e,this.drawingContext.texture),this.initRenderNodes(this._defaultRenderNodesMap)},_defaultRenderNodesMap:{get:function(){return r}},setAlpha:function(t){return this},setScrollFactor:function(t,e){return this}});t.exports=l},23675(t,e,i){var s=i(44603),r=i(23568),n=i(43451);s.register("captureFrame",function(t,e){void 0===t&&(t={});var i=r(t,"depth",0),s=r(t,"key",null),a=r(t,"visible",!0),o=new n(this.scene,s);return void 0!==e&&(t.add=e),o.setDepth(i).setVisible(a),t.add&&this.scene.sys.displayList.add(o),o})},20421(t,e,i){var s=i(43451);i(39429).register("captureFrame",function(t){return this.displayList.add(new s(this.scene,t))})},36683(t,e,i){var s=i(29747),r=s,n=s;r=i(82237),t.exports={renderWebGL:r,renderCanvas:n}},82237(t){var e=!1;t.exports=function(t,i,s){if(s.useCanvas)e||(e=!0,console.warn("CaptureFrame: Cannot capture from main canvas. Activate `forceComposite` on the camera to use this feature. This warning will now mute."));else{s.camera.addToRenderList(i);var r=s.width,n=s.height,a=i.customRenderNodes,o=i.defaultRenderNodes;i.drawingContext.resize(r,n),i.drawingContext.use(),(a.BatchHandler||o.BatchHandler).batch(i.drawingContext,s.texture,0,n,0,0,r,n,r,0,0,0,1,1,!1,4294967295,4294967295,4294967295,4294967295,{}),i.drawingContext.release()}}},16005(t,e,i){var s=i(45319),r={_alpha:1,_alphaTL:1,_alphaTR:1,_alphaBL:1,_alphaBR:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t,e,i,r){return void 0===t&&(t=1),void 0===e?this.alpha=t:(this._alphaTL=s(t,0,1),this._alphaTR=s(e,0,1),this._alphaBL=s(i,0,1),this._alphaBR=s(r,0,1)),this},alpha:{get:function(){return this._alpha},set:function(t){var e=s(t,0,1);this._alpha=e,this._alphaTL=e,this._alphaTR=e,this._alphaBL=e,this._alphaBR=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}},alphaTopLeft:{get:function(){return this._alphaTL},set:function(t){var e=s(t,0,1);this._alphaTL=e,0!==e&&(this.renderFlags|=2)}},alphaTopRight:{get:function(){return this._alphaTR},set:function(t){var e=s(t,0,1);this._alphaTR=e,0!==e&&(this.renderFlags|=2)}},alphaBottomLeft:{get:function(){return this._alphaBL},set:function(t){var e=s(t,0,1);this._alphaBL=e,0!==e&&(this.renderFlags|=2)}},alphaBottomRight:{get:function(){return this._alphaBR},set:function(t){var e=s(t,0,1);this._alphaBR=e,0!==e&&(this.renderFlags|=2)}}};t.exports=r},88509(t,e,i){var s=i(45319),r={_alpha:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t){return void 0===t&&(t=1),this.alpha=t,this},alpha:{get:function(){return this._alpha},set:function(t){var e=s(t,0,1);this._alpha=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}}};t.exports=r},90065(t,e,i){var s=i(10312),r={_blendMode:s.NORMAL,blendMode:{get:function(){return this._blendMode},set:function(t){"string"==typeof t&&(t=s[t]),(t|=0)>=-1&&(this._blendMode=t)}},setBlendMode:function(t){return this.blendMode=t,this}};t.exports=r},94215(t){t.exports={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}}},61683(t){var e={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,s){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,s,this.flipX,this.flipY);else{var r=t;this.frame.setCropUVs(this._crop,r.x,r.y,r.width,r.height,this.flipX,this.flipY)}this.isCropped=!0}return this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=e},89272(t,e,i){var s=i(37105),r={_depth:0,depth:{get:function(){return this._depth},set:function(t){this.displayList&&this.displayList.queueDepthSort(),this._depth=t}},setDepth:function(t){return void 0===t&&(t=0),this.depth=t,this},setToTop:function(){var t=this.getDisplayList();return t&&s.BringToTop(t,this),this},setToBack:function(){var t=this.getDisplayList();return t&&s.SendToBack(t,this),this},setAbove:function(t){var e=this.getDisplayList();return e&&t&&s.MoveAbove(e,this,t),this},setBelow:function(t){var e=this.getDisplayList();return e&&t&&s.MoveBelow(e,this,t),this}};t.exports=r},3248(t){var e={timeElapsed:0,timeElapsedResetPeriod:36e5,timePaused:!1,setTimerResetPeriod:function(t){return this.timeElapsedResetPeriod=t,this},setTimerPaused:function(t){return this.timePaused=!!t,this},resetTimer:function(t){return void 0===t&&(t=0),this.timeElapsed=t,this},updateTimer:function(t,e){return this.timePaused||(this.timeElapsed+=e,this.timeElapsed>=this.timeElapsedResetPeriod&&(this.timeElapsed-=this.timeElapsedResetPeriod)),this}};t.exports=e},53427(t,e,i){var s=i(83419),r=i(10189),n=i(16762),a=i(37597),o=i(88344),h=i(47564),l=i(77011),u=i(95200),d=i(16898),c=i(42652),f=i(43927),p=i(84714),m=i(51890),g=i(97797),v=i(37911),x=i(6379),y=i(29861),T=i(14366),w=i(63785),S=i(62229),b=i(99534),E=i(20263),C=i(90002),A=new s({initialize:function(t){this.camera=t,this.list=[]},clear:function(){for(var t=0;t0||this.filters.external.getActive().length>0||this.filtersForceComposite)},enableFilters:function(){if(this.filterCamera||!this.scene.renderer.gl)return this;var t=this.scene;if(s||(s=i(38058)),this.filterCamera=new s(0,0,1,1).setScene(t,!1),this.filterCamera.isObjectInversion=!0,t.game.config.roundPixels&&(this.filterCamera.roundPixels=!0),!this.maxFilterSize){var e=t.renderer.getMaxTextureSize();this.maxFilterSize=new r(e,e)}return this._filtersMatrix=new n,this._filtersViewMatrix=new n,this.getBounds&&void 0!==this.width&&void 0!==this.height&&0!==this.width&&0!==this.height||(this.filtersFocusContext=!0),this.addRenderStep(this.renderWebGLFilters,0),this},renderWebGLFilters:function(t,e,i,s,r){if(e.willRenderFilters()){var n=i.camera,a=e.filtersAutoFocus,o=e.filtersFocusContext;a&&(o?e.focusFiltersOnCamera(n):e.focusFilters());var h=e.filterCamera;h.preRender();var l=h.roundPixels;if(h.roundPixels=e.willRoundVertices(h,e.rotation%(2*Math.PI)==0&&(e.scaleX,1===e.scaleY)),a&&o){var u=e.parentContainer;if(u){var d=u.getWorldTransformMatrix();h.matrix.multiply(d)}}var c=e._filtersMatrix,f=e._filtersViewMatrix.copyWithScrollFactorFrom(n.getViewMatrix(!i.useCanvas),n.scrollX,n.scrollY,e.scrollFactorX,e.scrollFactorY);if(s&&f.multiply(s),o)c.loadIdentity();else{if("Layer"===e.type)c.loadIdentity();else{var p=e.flipX?-1:1,m=e.flipY?-1:1;c.applyITRS(e.x,e.y,e.rotation,e.scaleX*p,e.scaleY*m)}var g=h.width,v=h.height;c.translate(-g*h.originX,-v*h.originY),f.multiply(c,c)}var x=e.scrollFactorX,y=e.scrollFactorY;e.scrollFactorX=1,e.scrollFactorY=1,t.cameraRenderNode.run(i,[e],h,c,!0,r+1),e.scrollFactorX=x,e.scrollFactorY=y,h.roundPixels=l;for(var T=h.renderList.length,w=0;w0?Math.acos(e/this.scaleX):-Math.acos(e/this.scaleX):s||n?r.PI_OVER_2-(n>0?Math.acos(-s/this.scaleY):-Math.acos(s/this.scaleY)):0}},scaleX:{get:function(){return Math.sqrt(this.a*this.a+this.b*this.b)}},scaleY:{get:function(){return Math.sqrt(this.c*this.c+this.d*this.d)}},loadIdentity:function(){var t=this.matrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,this},translate:function(t,e){var i=this.matrix;return i[4]=i[0]*t+i[2]*e+i[4],i[5]=i[1]*t+i[3]*e+i[5],this},scale:function(t,e){var i=this.matrix;return i[0]*=t,i[1]*=t,i[2]*=e,i[3]*=e,this},rotate:function(t){var e=Math.sin(t),i=Math.cos(t),s=this.matrix,r=s[0],n=s[1],a=s[2],o=s[3];return s[0]=r*i+a*e,s[1]=n*i+o*e,s[2]=r*-e+a*i,s[3]=n*-e+o*i,this},multiply:function(t,e){var i=this.matrix,s=t.matrix,r=i[0],n=i[1],a=i[2],o=i[3],h=i[4],l=i[5],u=s[0],d=s[1],c=s[2],f=s[3],p=s[4],m=s[5],g=void 0===e?i:e.matrix;return g[0]=u*r+d*a,g[1]=u*n+d*o,g[2]=c*r+f*a,g[3]=c*n+f*o,g[4]=p*r+m*a+h,g[5]=p*n+m*o+l,g},multiplyWithOffset:function(t,e,i){var s=this.matrix,r=t.matrix,n=s[0],a=s[1],o=s[2],h=s[3],l=e*n+i*o+s[4],u=e*a+i*h+s[5],d=r[0],c=r[1],f=r[2],p=r[3],m=r[4],g=r[5];return s[0]=d*n+c*o,s[1]=d*a+c*h,s[2]=f*n+p*o,s[3]=f*a+p*h,s[4]=m*n+g*o+l,s[5]=m*a+g*h+u,this},transform:function(t,e,i,s,r,n){var a=this.matrix,o=a[0],h=a[1],l=a[2],u=a[3],d=a[4],c=a[5];return a[0]=t*o+e*l,a[1]=t*h+e*u,a[2]=i*o+s*l,a[3]=i*h+s*u,a[4]=r*o+n*l+d,a[5]=r*h+n*u+c,this},transformPoint:function(t,e,i){void 0===i&&(i={x:0,y:0});var s=this.matrix,r=s[0],n=s[1],a=s[2],o=s[3],h=s[4],l=s[5];return i.x=t*r+e*a+h,i.y=t*n+e*o+l,i},invert:function(){var t=this.matrix,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=e*r-i*s;return t[0]=r/o,t[1]=-i/o,t[2]=-s/o,t[3]=e/o,t[4]=(s*a-r*n)/o,t[5]=-(e*a-i*n)/o,this},copyFrom:function(t){var e=this.matrix;return e[0]=t.a,e[1]=t.b,e[2]=t.c,e[3]=t.d,e[4]=t.e,e[5]=t.f,this},copyFromArray:function(t){var e=this.matrix;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],this},copyWithScrollFactorFrom:function(t,e,i,s,r){var n=this.matrix;n[0]=t.a,n[1]=t.b,n[2]=t.c,n[3]=t.d;var a=e*(1-s),o=i*(1-r);return n[4]=t.a*a+t.c*o+t.e,n[5]=t.b*a+t.d*o+t.f,this},copyToContext:function(t){var e=this.matrix;return t.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t},setToContext:function(t){return t.setTransform(this.a,this.b,this.c,this.d,this.e,this.f),t},copyToArray:function(t){var e=this.matrix;return void 0===t?t=[e[0],e[1],e[2],e[3],e[4],e[5]]:(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5]),t},setTransform:function(t,e,i,s,r,n){var a=this.matrix;return a[0]=t,a[1]=e,a[2]=i,a[3]=s,a[4]=r,a[5]=n,this},decomposeMatrix:function(){var t=this.decomposedMatrix,e=this.matrix,i=e[0],s=e[1],r=e[2],n=e[3],a=i*n-s*r;if(t.translateX=e[4],t.translateY=e[5],i||s){var o=Math.sqrt(i*i+s*s);t.rotation=s>0?Math.acos(i/o):-Math.acos(i/o),t.scaleX=o,t.scaleY=a/o}else if(r||n){var h=Math.sqrt(r*r+n*n);t.rotation=.5*Math.PI-(n>0?Math.acos(-r/h):-Math.acos(r/h)),t.scaleX=a/h,t.scaleY=h}else t.rotation=0,t.scaleX=0,t.scaleY=0;return t},applyITRS:function(t,e,i,s,r){var n=this.matrix,a=Math.sin(i),o=Math.cos(i);return n[4]=t,n[5]=e,n[0]=o*s,n[1]=a*s,n[2]=-a*r,n[3]=o*r,this},applyInverse:function(t,e,i){void 0===i&&(i=new n);var s=this.matrix,r=s[0],a=s[1],o=s[2],h=s[3],l=s[4],u=s[5],d=1/(r*h+o*-a);return i.x=h*d*t+-o*d*e+(u*o-l*h)*d,i.y=r*d*e+-a*d*t+(-u*r+l*a)*d,i},setQuad:function(t,e,i,s,r){void 0===r&&(r=this.quad);var n=this.matrix,a=n[0],o=n[1],h=n[2],l=n[3],u=n[4],d=n[5];return r[0]=t*a+e*h+u,r[1]=t*o+e*l+d,r[2]=t*a+s*h+u,r[3]=t*o+s*l+d,r[4]=i*a+s*h+u,r[5]=i*o+s*l+d,r[6]=i*a+e*h+u,r[7]=i*o+e*l+d,r},getX:function(t,e){return t*this.a+e*this.c+this.e},getY:function(t,e){return t*this.b+e*this.d+this.f},getXRound:function(t,e,i){var s=this.getX(t,e);return i&&(s=Math.floor(s+.5)),s},getYRound:function(t,e,i){var s=this.getY(t,e);return i&&(s=Math.floor(s+.5)),s},getCSSMatrix:function(){var t=this.matrix;return"matrix("+t[0]+","+t[1]+","+t[2]+","+t[3]+","+t[4]+","+t[5]+")"},destroy:function(){this.matrix=null,this.quad=null,this.decomposedMatrix=null}});t.exports=a},59715(t){var e={_visible:!0,visible:{get:function(){return this._visible},set:function(t){t?(this._visible=!0,this.renderFlags|=1):(this._visible=!1,this.renderFlags&=-2)}},setVisible:function(t){return this.visible=t,this}};t.exports=e},31401(t,e,i){t.exports={Alpha:i(16005),AlphaSingle:i(88509),BlendMode:i(90065),ComputedSize:i(94215),Crop:i(61683),Depth:i(89272),ElapseTimer:i(3248),FilterList:i(53427),Filters:i(43102),Flip:i(54434),GetBounds:i(8004),Lighting:i(73629),Mask:i(8573),Origin:i(27387),PathFollower:i(37640),RenderNodes:i(68680),RenderSteps:i(86038),ScrollFactor:i(80227),Size:i(16736),Texture:i(37726),TextureCrop:i(79812),Tint:i(27472),ToJSON:i(53774),Transform:i(16901),TransformMatrix:i(61340),Visible:i(59715)}},31559(t,e,i){var s=i(37105),r=i(10312),n=i(83419),a=i(31401),o=i(51708),h=i(95643),l=i(87841),u=i(29959),d=i(36899),c=i(26099),f=i(93595),p=new a.TransformMatrix,m=new n({Extends:h,Mixins:[a.AlphaSingle,a.BlendMode,a.ComputedSize,a.Depth,a.Mask,a.Transform,a.Visible,u],initialize:function(t,e,i,s){h.call(this,t,"Container"),this.list=[],this.exclusive=!0,this.maxSize=-1,this.position=0,this.localTransform=new a.TransformMatrix,this._sortKey="",this._sysEvents=t.sys.events,this.scrollFactorX=1,this.scrollFactorY=1,this.setPosition(e,i),this.setBlendMode(r.SKIP_CHECK),s&&this.add(s)},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return.5*this.width}},displayOriginY:{get:function(){return.5*this.height}},setExclusive:function(t){return void 0===t&&(t=!0),this.exclusive=t,this},getBounds:function(t){if(void 0===t&&(t=new l),t.setTo(this.x,this.y,0,0),this.parentContainer){var e=this.parentContainer.getBoundsTransformMatrix().transformPoint(this.x,this.y);t.setTo(e.x,e.y,0,0)}if(this.list.length>0){var i=this.list,s=new l,r=!1;t.setEmpty();for(var n=0;n-1},setAll:function(t,e,i,r){return s.SetAll(this.list,t,e,i,r),this},each:function(t,e){var i,s=[null],r=this.list.slice(),n=r.length;for(i=2;i0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.list=[]},onChildDestroyed:function(t){s.Remove(this.list,t),this.exclusive&&(t.parentContainer=null,t.removedFromScene())}});t.exports=m},53584(t){t.exports=function(t,e,i,s){i.addToRenderList(e);var r=e.list;if(0!==r.length){var n=e.localTransform;s?(n.loadIdentity(),n.multiply(s),n.translate(e.x,e.y),n.rotate(e.rotation),n.scale(e.scaleX,e.scaleY)):n.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var a=-1!==e.blendMode;a||t.setBlendMode(0);var o=e._alpha,h=e.scrollFactorX,l=e.scrollFactorY;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var u=0;u=0,d=a>=0,f=o>=0,p=h>=0;return n=Math.abs(n),a=Math.abs(a),o=Math.abs(o),h=Math.abs(h),this.beginPath(),this.moveTo(t+n,e),this.lineTo(t+i-a,e),d?this.arc(t+i-a,e+a,a,-c.PI_OVER_2,0):this.arc(t+i,e,a,Math.PI,c.PI_OVER_2,!0),this.lineTo(t+i,e+s-h),p?this.arc(t+i-h,e+s-h,h,0,c.PI_OVER_2):this.arc(t+i,e+s,h,-c.PI_OVER_2,Math.PI,!0),this.lineTo(t+o,e+s),f?this.arc(t+o,e+s-o,o,c.PI_OVER_2,Math.PI):this.arc(t,e+s,o,0,-c.PI_OVER_2,!0),this.lineTo(t,e+n),l?this.arc(t+n,e+n,n,-Math.PI,-c.PI_OVER_2):this.arc(t,e,n,c.PI_OVER_2,0,!0),this.fillPath(),this},strokeRoundedRect:function(t,e,i,s,r){void 0===r&&(r=20);var n=r,a=r,o=r,h=r,l=Math.min(i,s)/2;"number"!=typeof r&&(n=u(r,"tl",20),a=u(r,"tr",20),o=u(r,"bl",20),h=u(r,"br",20));var d=n>=0,f=a>=0,p=o>=0,m=h>=0;return n=Math.min(Math.abs(n),l),a=Math.min(Math.abs(a),l),o=Math.min(Math.abs(o),l),h=Math.min(Math.abs(h),l),this.beginPath(),this.moveTo(t+n,e),this.lineTo(t+i-a,e),this.moveTo(t+i-a,e),f?this.arc(t+i-a,e+a,a,-c.PI_OVER_2,0):this.arc(t+i,e,a,Math.PI,c.PI_OVER_2,!0),this.lineTo(t+i,e+s-h),this.moveTo(t+i,e+s-h),m?this.arc(t+i-h,e+s-h,h,0,c.PI_OVER_2):this.arc(t+i,e+s,h,-c.PI_OVER_2,Math.PI,!0),this.lineTo(t+o,e+s),this.moveTo(t+o,e+s),p?this.arc(t+o,e+s-o,o,c.PI_OVER_2,Math.PI):this.arc(t,e+s,o,0,-c.PI_OVER_2,!0),this.lineTo(t,e+n),this.moveTo(t,e+n),d?this.arc(t+n,e+n,n,-Math.PI,-c.PI_OVER_2):this.arc(t,e,n,c.PI_OVER_2,0,!0),this.strokePath(),this},fillPointShape:function(t,e){return this.fillPoint(t.x,t.y,e)},fillPoint:function(t,e,i){return!i||i<1?i=1:(t-=i/2,e-=i/2),this.commandBuffer.push(n.FILL_RECT,t,e,i,i),this},fillTriangleShape:function(t){return this.fillTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},strokeTriangleShape:function(t){return this.strokeTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},fillTriangle:function(t,e,i,s,r,a){return this.commandBuffer.push(n.FILL_TRIANGLE,t,e,i,s,r,a),this},strokeTriangle:function(t,e,i,s,r,a){return this.commandBuffer.push(n.STROKE_TRIANGLE,t,e,i,s,r,a),this},strokeLineShape:function(t){return this.lineBetween(t.x1,t.y1,t.x2,t.y2)},lineBetween:function(t,e,i,s){return this.beginPath(),this.moveTo(t,e),this.lineTo(i,s),this.strokePath(),this},lineTo:function(t,e){return this.commandBuffer.push(n.LINE_TO,t,e),this},moveTo:function(t,e){return this.commandBuffer.push(n.MOVE_TO,t,e),this},strokePoints:function(t,e,i,s){void 0===e&&(e=!1),void 0===i&&(i=!1),void 0===s&&(s=t.length),this.beginPath(),this.moveTo(t[0].x,t[0].y);for(var r=1;r-1&&this.fillStyle(this.defaultFillColor,this.defaultFillAlpha),this.defaultStrokeColor>-1&&this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha),this},generateTexture:function(t,e,i){var s,r,n=this.scene.sys,a=n.game.renderer;void 0===e&&(e=n.scale.width),void 0===i&&(i=n.scale.height),p.TargetCamera.setScene(this.scene),p.TargetCamera.setViewport(0,0,e,i),p.TargetCamera.scrollX=this.x,p.TargetCamera.scrollY=this.y;var o={willReadFrequently:!0};if("string"==typeof t)if(n.textures.exists(t)){var h=(s=n.textures.get(t)).getSourceImage();h instanceof HTMLCanvasElement&&(r=h.getContext("2d",o))}else r=(s=n.textures.createCanvas(t,e,i)).getSourceImage().getContext("2d",o);else t instanceof HTMLCanvasElement&&(r=t.getContext("2d",o));return r&&(this.renderCanvas(a,this,p.TargetCamera,null,r,!1),s&&s.refresh()),this},preDestroy:function(){this.commandBuffer=[]}});p.TargetCamera=new s,t.exports=p},32768(t,e,i){var s=i(85592),r=i(20926);t.exports=function(t,e,i,n,a,o){var h=e.commandBuffer,l=h.length,u=a||t.currentContext;if(0!==l&&r(t,u,e,i,n)){i.addToRenderList(e);var d=1,c=1,f=0,p=0,m=1,g=0,v=0,x=0;u.beginPath();for(var y=0;y>>16,v=(65280&f)>>>8,x=255&f,u.strokeStyle="rgba("+g+","+v+","+x+","+d+")",u.lineWidth=m,y+=3;break;case s.FILL_STYLE:p=h[y+1],c=h[y+2],g=(16711680&p)>>>16,v=(65280&p)>>>8,x=255&p,u.fillStyle="rgba("+g+","+v+","+x+","+c+")",y+=2;break;case s.BEGIN_PATH:u.beginPath();break;case s.CLOSE_PATH:u.closePath();break;case s.FILL_PATH:o||u.fill();break;case s.STROKE_PATH:o||u.stroke();break;case s.FILL_RECT:o?u.rect(h[y+1],h[y+2],h[y+3],h[y+4]):u.fillRect(h[y+1],h[y+2],h[y+3],h[y+4]),y+=4;break;case s.FILL_TRIANGLE:u.beginPath(),u.moveTo(h[y+1],h[y+2]),u.lineTo(h[y+3],h[y+4]),u.lineTo(h[y+5],h[y+6]),u.closePath(),o||u.fill(),y+=6;break;case s.STROKE_TRIANGLE:u.beginPath(),u.moveTo(h[y+1],h[y+2]),u.lineTo(h[y+3],h[y+4]),u.lineTo(h[y+5],h[y+6]),u.closePath(),o||u.stroke(),y+=6;break;case s.LINE_TO:u.lineTo(h[y+1],h[y+2]),y+=2;break;case s.MOVE_TO:u.moveTo(h[y+1],h[y+2]),y+=2;break;case s.LINE_FX_TO:u.lineTo(h[y+1],h[y+2]),y+=5;break;case s.MOVE_FX_TO:u.moveTo(h[y+1],h[y+2]),y+=5;break;case s.SAVE:u.save();break;case s.RESTORE:u.restore();break;case s.TRANSLATE:u.translate(h[y+1],h[y+2]),y+=2;break;case s.SCALE:u.scale(h[y+1],h[y+2]),y+=2;break;case s.ROTATE:u.rotate(h[y+1]),y+=1;break;case s.GRADIENT_FILL_STYLE:y+=5;break;case s.GRADIENT_LINE_STYLE:y+=6}}u.restore()}}},87079(t,e,i){var s=i(44603),r=i(43831);s.register("graphics",function(t,e){void 0===t&&(t={}),void 0!==e&&(t.add=e);var i=new r(this.scene,t);return t.add&&this.scene.sys.displayList.add(i),i})},1201(t,e,i){var s=i(43831);i(39429).register("graphics",function(t){return this.displayList.add(new s(this.scene,t))})},84503(t,e,i){var s=i(29747),r=s,n=s;r=i(77545),n=i(32768),n=i(32768),t.exports={renderWebGL:r,renderCanvas:n}},77545(t,e,i){var s=i(85592),r=i(91296),n=i(70554),a=i(61340),o=function(t,e,i){this.x=t,this.y=e,this.width=i},h=function(t,e,i){this.points=[],this.points[0]=new o(t,e,i),this.addPoint=function(t,e,i){var s=this.points[this.points.length-1];s.x===t&&s.y===e||this.points.push(new o(t,e,i))}},l=[],u=new a,d=new a,c={TL:0,TR:0,BL:0,BR:0},f={TL:0,TR:0,BL:0,BR:0},p=[{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0}];t.exports=function(t,e,i,a){if(0!==e.commandBuffer.length){var o=e.customRenderNodes,m=e.defaultRenderNodes,g=o.Submitter||m.Submitter,v=e.lighting,x=i,y=x.camera;y.addToRenderList(e);for(var T=r(e,y,a,!i.useCanvas).calc,w=u.loadIdentity(),S=e.commandBuffer,b=e.alpha,E=Math.max(e.pathDetailThreshold,t.config.pathDetailThreshold,0),C=1,A=0,_=0,M=0,R=2*Math.PI,O=[],P=0,L=!0,F=null,D=n.getTintAppendFloatAlpha,I=0;I0&&(q=q%R-R):q>R?q=R:q<0&&(q=R+q%R),null===F&&(F=new h(G+Math.cos(j)*V,H+Math.sin(j)*V,C),O.push(F),W+=.01);W<1+Z;)M=q*W+j,A=G+Math.cos(M)*V,_=H+Math.sin(M)*V,F.addPoint(A,_,C),W+=.01;M=q+j,A=G+Math.cos(M)*V,_=H+Math.sin(M)*V,F.addPoint(A,_,C);break;case s.FILL_RECT:T.multiply(w,d),(o.FillRect||m.FillRect).run(x,d,g,S[++I],S[++I],S[++I],S[++I],c.TL,c.TR,c.BL,c.BR,v);break;case s.FILL_TRIANGLE:T.multiply(w,d),(o.FillTri||m.FillTri).run(x,d,g,S[++I],S[++I],S[++I],S[++I],S[++I],S[++I],c.TL,c.TR,c.BL,v);break;case s.STROKE_TRIANGLE:T.multiply(w,d),p[0].x=S[++I],p[0].y=S[++I],p[0].width=C,p[1].x=S[++I],p[1].y=S[++I],p[1].width=C,p[2].x=S[++I],p[2].y=S[++I],p[2].width=C,p[3].x=p[0].x,p[3].y=p[0].y,p[3].width=C,(o.StrokePath||m.StrokePath).run(x,g,p,C,!1,d,f.TL,f.TR,f.BL,f.BR,v);break;case s.LINE_TO:G=S[++I],H=S[++I],null!==F?F.addPoint(G,H,C):(F=new h(G,H,C),O.push(F));break;case s.MOVE_TO:F=new h(S[++I],S[++I],C),O.push(F);break;case s.SAVE:l.push(w.copyToArray());break;case s.RESTORE:w.copyFromArray(l.pop());break;case s.TRANSLATE:G=S[++I],H=S[++I],w.translate(G,H);break;case s.SCALE:G=S[++I],H=S[++I],w.scale(G,H);break;case s.ROTATE:w.rotate(S[++I])}}}},26479(t,e,i){var s=i(61061),r=i(83419),n=i(51708),a=i(50792),o=i(46710),h=i(95540),l=i(35154),u=i(97022),d=i(41212),c=i(88492),f=i(68287),p=new r({Extends:a,initialize:function(t,e,i){a.call(this),i?e&&!Array.isArray(e)&&(e=[e]):Array.isArray(e)?d(e[0])&&(i=e,e=null):d(e)&&(i=e,e=null),this.scene=t,this.children=new Set,this.isParent=!0,this.type="Group",this.classType=h(i,"classType",f),this.name=h(i,"name",""),this.active=h(i,"active",!0),this.maxSize=h(i,"maxSize",-1),this.defaultKey=h(i,"defaultKey",null),this.defaultFrame=h(i,"defaultFrame",null),this.runChildUpdate=h(i,"runChildUpdate",!1),this.createCallback=h(i,"createCallback",null),this.removeCallback=h(i,"removeCallback",null),this.createMultipleCallback=h(i,"createMultipleCallback",null),this.internalCreateCallback=h(i,"internalCreateCallback",null),this.internalRemoveCallback=h(i,"internalRemoveCallback",null),e&&this.addMultiple(e),i&&this.createMultiple(i),this.on(n.ADDED_TO_SCENE,this.addedToScene,this),this.on(n.REMOVED_FROM_SCENE,this.removedFromScene,this)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},create:function(t,e,i,s,r,n){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.defaultKey),void 0===s&&(s=this.defaultFrame),void 0===r&&(r=!0),void 0===n&&(n=!0),this.isFull())return null;var a=new this.classType(this.scene,t,e,i,s);return a.addToDisplayList(this.scene.sys.displayList),a.addToUpdateList(),a.visible=r,a.setActive(n),this.add(a),a},createMultiple:function(t){if(this.isFull())return[];Array.isArray(t)||(t=[t]);var e=[];if(t[0].key)for(var i=0;i=0;u--)if((l=c[u]).active===i){if(++d===e)break}else l=null;return l?("number"==typeof r&&(l.x=r),"number"==typeof n&&(l.y=n),l):s?this.create(r,n,a,o,h):null},get:function(t,e,i,s,r){return this.getFirst(!1,!0,t,e,i,s,r)},getFirstAlive:function(t,e,i,s,r,n){return this.getFirst(!0,t,e,i,s,r,n)},getFirstDead:function(t,e,i,s,r,n){return this.getFirst(!1,t,e,i,s,r,n)},playAnimation:function(t,e){return s.PlayAnimation(Array.from(this.children),t,e),this},isFull:function(){return-1!==this.maxSize&&this.children.size>=this.maxSize},countActive:function(t){void 0===t&&(t=!0);var e=0;return this.children.forEach(function(i){i.active===t&&e++}),e},getTotalUsed:function(){return this.countActive()},getTotalFree:function(){var t=this.getTotalUsed();return(-1===this.maxSize?999999999999:this.maxSize)-t},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},propertyValueSet:function(t,e,i,r,n){return s.PropertyValueSet(Array.from(this.children),t,e,i,r,n),this},propertyValueInc:function(t,e,i,r,n){return s.PropertyValueInc(Array.from(this.children),t,e,i,r,n),this},setX:function(t,e){return s.SetX(Array.from(this.children),t,e),this},setY:function(t,e){return s.SetY(Array.from(this.children),t,e),this},setXY:function(t,e,i,r){return s.SetXY(Array.from(this.children),t,e,i,r),this},incX:function(t,e){return s.IncX(Array.from(this.children),t,e),this},incY:function(t,e){return s.IncY(Array.from(this.children),t,e),this},incXY:function(t,e,i,r){return s.IncXY(Array.from(this.children),t,e,i,r),this},shiftPosition:function(t,e,i){return s.ShiftPosition(Array.from(this.children),t,e,i),this},angle:function(t,e){return s.Angle(Array.from(this.children),t,e),this},rotate:function(t,e){return s.Rotate(Array.from(this.children),t,e),this},rotateAround:function(t,e){return s.RotateAround(Array.from(this.children),t,e),this},rotateAroundDistance:function(t,e,i){return s.RotateAroundDistance(Array.from(this.children),t,e,i),this},setAlpha:function(t,e){return s.SetAlpha(Array.from(this.children),t,e),this},setTint:function(t,e,i,r){return s.SetTint(Array.from(this.children),t,e,i,r),this},setOrigin:function(t,e,i,r){return s.SetOrigin(Array.from(this.children),t,e,i,r),this},scaleX:function(t,e){return s.ScaleX(Array.from(this.children),t,e),this},scaleY:function(t,e){return s.ScaleY(Array.from(this.children),t,e),this},scaleXY:function(t,e,i,r){return s.ScaleXY(Array.from(this.children),t,e,i,r),this},setDepth:function(t,e){return s.SetDepth(Array.from(this.children),t,e),this},setBlendMode:function(t){return s.SetBlendMode(Array.from(this.children),t),this},setHitArea:function(t,e){return s.SetHitArea(Array.from(this.children),t,e),this},shuffle:function(){return s.Shuffle(Array.from(this.children)),this},kill:function(t){this.children.has(t)&&t.setActive(!1)},killAndHide:function(t){this.children.has(t)&&(t.setActive(!1),t.setVisible(!1))},setVisible:function(t,e,i){return s.SetVisible(Array.from(this.children),t,e,i),this},toggleVisible:function(){return s.ToggleVisible(Array.from(this.children)),this},destroy:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1),this.scene&&!this.ignoreDestroy&&(this.emit(n.DESTROY,this),this.removeAllListeners(),this.scene.sys.updateList.remove(this),this.clear(e,t),this.scene=void 0,this.children=void 0)}});t.exports=p},94975(t,e,i){var s=i(44603),r=i(26479);s.register("group",function(t){return new r(this.scene,null,t)})},3385(t,e,i){var s=i(26479);i(39429).register("group",function(t,e){return this.updateList.add(new s(this.scene,t,e))})},88571(t,e,i){var s=i(40939),r=i(83419),n=i(31401),a=i(95643),o=i(59819),h=new r({Extends:a,Mixins:[n.Alpha,n.BlendMode,n.Depth,n.Flip,n.GetBounds,n.Lighting,n.Mask,n.Origin,n.RenderNodes,n.ScrollFactor,n.Size,n.TextureCrop,n.Tint,n.Transform,n.Visible,o],initialize:function(t,e,i,s,r){a.call(this,t,"Image"),this._crop=this.resetCropObject(),this.setTexture(s,r),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initRenderNodes(this._defaultRenderNodesMap)},_defaultRenderNodesMap:{get:function(){return s}}});t.exports=h},40652(t){t.exports=function(t,e,i,s){i.addToRenderList(e),t.batchSprite(e,e.frame,i,s)}},82459(t,e,i){var s=i(25305),r=i(44603),n=i(23568),a=i(88571);r.register("image",function(t,e){void 0===t&&(t={});var i=n(t,"key",null),r=n(t,"frame",null),o=new a(this.scene,0,0,i,r);return void 0!==e&&(t.add=e),s(this.scene,o,t),o})},2117(t,e,i){var s=i(88571);i(39429).register("image",function(t,e,i,r){return this.displayList.add(new s(this.scene,t,e,i,r))})},59819(t,e,i){var s=i(29747),r=s,n=s;r=i(99517),n=i(40652),t.exports={renderWebGL:r,renderCanvas:n}},99517(t){t.exports=function(t,e,i,s){i.camera.addToRenderList(e);var r=e.customRenderNodes,n=e.defaultRenderNodes;(r.Submitter||n.Submitter).run(i,e,s,0,r.Texturer||n.Texturer,r.Transformer||n.Transformer)}},77856(t,e,i){var s={Events:i(51708),DisplayList:i(8050),GameObjectCreator:i(44603),GameObjectFactory:i(39429),UpdateList:i(45027),Components:i(31401),GetCalcMatrix:i(91296),BuildGameObject:i(25305),BuildGameObjectAnimation:i(13059),GameObject:i(95643),BitmapText:i(22186),Blitter:i(6107),Bob:i(46590),Container:i(31559),DOMElement:i(3069),DynamicBitmapText:i(2638),Extern:i(42421),Graphics:i(43831),Group:i(26479),Image:i(88571),Layer:i(93595),Particles:i(18404),PathFollower:i(1159),RenderTexture:i(591),RetroFont:i(196),Rope:i(77757),Sprite:i(68287),Stamp:i(14727),Text:i(50171),GetTextSize:i(14220),MeasureText:i(79557),TextStyle:i(35762),TileSprite:i(20839),Zone:i(41481),Video:i(18471),Shape:i(17803),Arc:i(23629),Curve:i(89),Ellipse:i(19921),Grid:i(30479),IsoBox:i(61475),IsoTriangle:i(16933),Line:i(57847),Polygon:i(24949),Rectangle:i(74561),Star:i(55911),Triangle:i(36931),Factories:{Blitter:i(12709),Container:i(24961),DOMElement:i(2611),DynamicBitmapText:i(72566),Extern:i(56315),Graphics:i(1201),Group:i(3385),Image:i(2117),Layer:i(20005),Particles:i(676),PathFollower:i(90145),RenderTexture:i(60505),Rope:i(96819),Sprite:i(46409),Stamp:i(85326),StaticBitmapText:i(34914),Text:i(68005),TileSprite:i(91681),Zone:i(84175),Video:i(89025),Arc:i(42563),Curve:i(40511),Ellipse:i(1543),Grid:i(34137),IsoBox:i(3933),IsoTriangle:i(49803),Line:i(2481),Polygon:i(64827),Rectangle:i(87959),Star:i(93697),Triangle:i(45245)},Creators:{Blitter:i(9403),Container:i(77143),DynamicBitmapText:i(11164),Graphics:i(87079),Group:i(94975),Image:i(82459),Layer:i(25179),Particles:i(92730),RenderTexture:i(34495),Rope:i(26209),Sprite:i(15567),Stamp:i(31479),StaticBitmapText:i(57336),Text:i(71259),TileSprite:i(14167),Zone:i(95261),Video:i(11511)}};s.CaptureFrame=i(43451),s.Gradient=i(34637),s.Noise=i(35387),s.NoiseCell2D=i(51513),s.NoiseCell3D=i(15686),s.NoiseCell4D=i(41946),s.NoiseSimplex2D=i(1792),s.NoiseSimplex3D=i(51098),s.Shader=i(20071),s.NineSlice=i(28103),s.PointLight=i(80321),s.SpriteGPULayer=i(76573),s.Factories.CaptureFrame=i(20421),s.Factories.Gradient=i(69315),s.Factories.Noise=i(34757),s.Factories.NoiseCell2D=i(26590),s.Factories.NoiseCell3D=i(89918),s.Factories.NoiseCell4D=i(65874),s.Factories.NoiseSimplex2D=i(80308),s.Factories.NoiseSimplex3D=i(73810),s.Factories.Shader=i(74177),s.Factories.NineSlice=i(47521),s.Factories.PointLight=i(71255),s.Factories.SpriteGPULayer=i(96019),s.Creators.CaptureFrame=i(23675),s.Creators.Gradient=i(26353),s.Creators.Noise=i(39931),s.Creators.NoiseCell2D=i(98292),s.Creators.NoiseCell3D=i(97044),s.Creators.NoiseCell4D=i(20136),s.Creators.NoiseSimplex2D=i(51754),s.Creators.NoiseSimplex3D=i(71112),s.Creators.Shader=i(54935),s.Creators.NineSlice=i(28279),s.Creators.PointLight=i(39829),s.Creators.SpriteGPULayer=i(16193),s.Light=i(41432),s.LightsManager=i(61356),s.LightsPlugin=i(88992),t.exports=s},93595(t,e,i){var s=i(10312),r=i(83419),n=i(31401),a=i(50792),o=i(95643),h=i(51708),l=i(73162),u=i(33963),d=i(44594),c=i(19186),f=new r({Extends:l,Mixins:[a,o,n.AlphaSingle,n.BlendMode,n.Depth,n.Mask,n.Visible,u],initialize:function(t,e){l.call(this,t),a.call(this),o.call(this,t,"Layer"),this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.sortChildrenFlag=!1,this.addCallback=this.addChildCallback,this.removeCallback=this.removeChildCallback,this.clearAlpha(),this.setBlendMode(s.SKIP_CHECK),e&&this.add(e),this.addRenderStep&&this.addRenderStep(this.renderWebGL),t.sys.queueDepthSort()},setInteractive:function(){return this},disableInteractive:function(){return this},removeInteractive:function(){return this},willRender:function(t){return!(15!==this.renderFlags||0===this.list.length||0!==this.cameraFilter&&this.cameraFilter&t.id)},addChildCallback:function(t){var e=t.displayList;e&&e!==this&&t.removeFromDisplayList(),t.displayList||(this.queueDepthSort(),t.displayList=this,t.emit(h.ADDED_TO_SCENE,t,this.scene),this.events.emit(d.ADDED_TO_SCENE,t,this.scene))},removeChildCallback:function(t){this.queueDepthSort(),t.displayList=null,t.emit(h.REMOVED_FROM_SCENE,t,this.scene),this.events.emit(d.REMOVED_FROM_SCENE,t,this.scene)},queueDepthSort:function(){this.sortChildrenFlag=!0},depthSort:function(){this.sortChildrenFlag&&(c(this.list,this.sortByDepth),this.sortChildrenFlag=!1)},sortByDepth:function(t,e){return t._depth-e._depth},getChildren:function(){return this.list},destroy:function(t){if(this.scene&&!this.ignoreDestroy){o.prototype.destroy.call(this,t);for(var e=this.list;e.length;)e[0].destroy(t);this.list=void 0,this.systems=void 0,this.events=void 0}}});t.exports=f},2956(t){t.exports=function(t,e,i){var s=e.list;if(0!==s.length){e.depthSort();var r=-1!==e.blendMode;r||t.setBlendMode(0);var n=e._alpha;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var a=0;athis.maxLights&&(u(r,this.sortByDistance),r=r.slice(0,this.maxLights)),this.visibleLights=r.length,r},sortByDistance:function(t,e){return t.distance>=e.distance},setAmbientColor:function(t){var e=d.getFloatsFromUintRGB(t);return this.ambientColor.set(e[0],e[1],e[2]),this},getMaxVisibleLights:function(){return this.maxLights},getLightCount:function(){return this.lights.length},addLight:function(t,e,i,s,r,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=128),void 0===s&&(s=16777215),void 0===r&&(r=1),void 0===n&&(n=.1*i);var o=d.getFloatsFromUintRGB(s),h=new a(t,e,i,o[0],o[1],o[2],r,n);return this.lights.push(h),h},removeLight:function(t){var e=this.lights.indexOf(t);return e>=0&&l(this.lights,e),this},shutdown:function(){this.lights.length=0},destroy:function(){this.shutdown()}});t.exports=c},88992(t,e,i){var s=i(83419),r=i(61356),n=i(37277),a=i(44594),o=new s({Extends:r,initialize:function(t){this.scene=t,this.systems=t.sys,t.sys.settings.isBooted||t.sys.events.once(a.BOOT,this.boot,this),r.call(this)},boot:function(){var t=this.systems.events;t.on(a.SHUTDOWN,this.shutdown,this),t.on(a.DESTROY,this.destroy,this)},destroy:function(){this.shutdown(),this.scene=void 0,this.systems=void 0}});n.register("LightsPlugin",o,"lights"),t.exports=o},28103(t,e,i){var s=i(30529),r=i(83419),n=i(31401),a=i(95643),o=i(78023),h=i(84322),l=i(82513),u=new r({Extends:a,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.GetBounds,n.Mask,n.Origin,n.RenderNodes,n.ScrollFactor,n.Texture,n.Transform,n.Visible,o],initialize:function(t,e,i,s,r,n,o,u,d,c,f,p,m){a.call(this,t,"NineSlice"),this._width,this._height,this._originX=.5,this._originY=.5,this._sizeComponent=!0,this.vertices=[],this.leftWidth,this.rightWidth,this.topHeight,this.bottomHeight,this.tileX=p||!1,this.tileY=m||!1,this._repeatCountX=1,this._repeatCountY=1,this.tint=16777215,this.tintMode=h.MULTIPLY;var g=t.textures.getFrame(s,r);this.is3Slice=!c&&!f,g&&g.scale9&&(this.is3Slice=g.is3Slice);for(var v=this.is3Slice?18:54,x=0;x0?Math.max(1,Math.floor(t/e)):1},_rebuildVertexArray:function(t,e){if(t===this._repeatCountX&&e===this._repeatCountY)return!1;this._repeatCountX=t,this._repeatCountY=e;var i=(t+2)*(this.is3Slice?1:e+2)*6,s=this.vertices;if(s.length!==i){s.length=0;for(var r=0;r.5&&(this.vx-=i*(r-.5)),n<.5?this.vy+=s*(.5-n):n>.5&&(this.vy-=s*(n-.5)),this}});t.exports=n},52230(t,e,i){var s=i(91296),r=i(70554),n={multiTexturing:!0};t.exports=function(t,e,i,a){var o=e.vertices,h=o.length;if(0!==h){var l=i.camera;l.addToRenderList(e);for(var u,d,c,f=e.alpha,p=e.customRenderNodes.BatchHandler||e.defaultRenderNodes.BatchHandler,m=s(e,l,a,!i.useCanvas).calc,g=r.getTintAppendFloatAlpha(e.tint,f),v=e.frame.source.glTexture,x=e.tintMode,y=0;y=0&&(e=t);break;case 4:var i=(this.end-this.start)/this.steps;e=u(t,i),this.counter=e;break;case 5:case 6:case 7:e=r(t,this.start,this.end);break;case 9:e=this.start[0]}return this.current=e,this},getMethod:function(){var t=this.propertyValue;if(null===t)return 0;var e=typeof t;if("number"===e)return 1;if(Array.isArray(t))return 2;if("function"===e)return 3;if("object"===e){if(this.hasBoth(t,"start","end"))return this.has(t,"steps")?4:5;if(this.hasBoth(t,"min","max"))return 6;if(this.has(t,"random"))return 7;if(this.hasEither(t,"onEmit","onUpdate"))return 8;if(this.hasEither(t,"values","interpolation"))return 9}return 0},setMethods:function(){var t=this.propertyValue,e=t,i=this.defaultEmit,s=this.defaultUpdate;switch(this.method){case 1:i=this.staticValueEmit;break;case 2:i=this.randomStaticValueEmit,e=t[0];break;case 3:this._onEmit=t,i=this.proxyEmit,e=this.defaultValue;break;case 4:this.start=t.start,this.end=t.end,this.steps=t.steps,this.counter=this.start,this.yoyo=!!this.has(t,"yoyo")&&t.yoyo,this.direction=0,i=this.steppedEmit,e=this.start;break;case 5:this.start=t.start,this.end=t.end;var r=this.has(t,"ease")?t.ease:"Linear";this.ease=o(r,t.easeParams),i=this.has(t,"random")&&t.random?this.randomRangedValueEmit:this.easedValueEmit,s=this.easeValueUpdate,e=this.start;break;case 6:this.start=t.min,this.end=t.max,i=this.has(t,"int")&&t.int?this.randomRangedIntEmit:this.randomRangedValueEmit,e=this.start;break;case 7:var n=t.random;Array.isArray(n)&&(this.start=n[0],this.end=n[1]),i=this.randomRangedIntEmit,e=this.start;break;case 8:this._onEmit=this.has(t,"onEmit")?t.onEmit:this.defaultEmit,this._onUpdate=this.has(t,"onUpdate")?t.onUpdate:this.defaultUpdate,i=this.proxyEmit,s=this.proxyUpdate,e=this.defaultValue;break;case 9:this.start=t.values;var a=this.has(t,"ease")?t.ease:"Linear";this.ease=o(a,t.easeParams),this.interpolation=l(t.interpolation),i=this.easedValueEmit,s=this.easeValueUpdate,e=this.start[0]}return this.onEmit=i,this.onUpdate=s,this.current=e,this},has:function(t,e){return t.hasOwnProperty(e)},hasBoth:function(t,e,i){return t.hasOwnProperty(e)&&t.hasOwnProperty(i)},hasEither:function(t,e,i){return t.hasOwnProperty(e)||t.hasOwnProperty(i)},defaultEmit:function(){return this.defaultValue},defaultUpdate:function(t,e,i,s){return s},proxyEmit:function(t,e,i){var s=this._onEmit(t,e,i);return this.current=s,s},proxyUpdate:function(t,e,i,s){var r=this._onUpdate(t,e,i,s);return this.current=r,r},staticValueEmit:function(){return this.current},staticValueUpdate:function(){return this.current},randomStaticValueEmit:function(){var t=Math.floor(Math.random()*this.propertyValue.length);return this.current=this.propertyValue[t],this.current},randomRangedValueEmit:function(t,e){var i=a(this.start,this.end);return t&&t.data[e]&&(t.data[e].min=i,t.data[e].max=this.end),this.current=i,i},randomRangedIntEmit:function(t,e){var i=s(this.start,this.end);return t&&t.data[e]&&(t.data[e].min=i,t.data[e].max=this.end),this.current=i,i},steppedEmit:function(){var t,e=this.counter,i=e,s=(this.end-this.start)/this.steps;this.yoyo?(0===this.direction?(i+=s)>=this.end&&(t=i-this.end,i=this.end-t,this.direction=1):(i-=s)<=this.start&&(t=this.start-i,i=this.start+t,this.direction=0),this.counter=i):this.counter=d(i+s,this.start,this.end);return this.current=e,e},easedValueEmit:function(t,e){if(t&&t.data[e]){var i=t.data[e];i.min=this.start,i.max=this.end}return this.current=this.start,this.start},easeValueUpdate:function(t,e,i){var s,r=t.data[e],n=this.ease(i);return s=this.interpolation?this.interpolation(this.start,n):(r.max-r.min)*n+r.min,this.current=s,s},destroy:function(){this.propertyValue=null,this.defaultValue=null,this.ease=null,this.interpolation=null,this._onEmit=null,this._onUpdate=null}});t.exports=c},24502(t,e,i){var s=i(83419),r=i(95540),n=i(20286),a=new s({Extends:n,initialize:function(t,e,i,s,a){if("object"==typeof t){var o=t;t=r(o,"x",0),e=r(o,"y",0),i=r(o,"power",0),s=r(o,"epsilon",100),a=r(o,"gravity",50)}else void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=100),void 0===a&&(a=50);n.call(this,t,e,!0),this._gravity=a,this._power=i*a,this._epsilon=s*s},update:function(t,e){var i=this.x-t.x,s=this.y-t.y,r=i*i+s*s;if(0!==r){var n=Math.sqrt(r);r0&&(this.anims=new s(this)),this.bounds=new o},emit:function(t,e,i,s,r,n){return this.emitter.emit(t,e,i,s,r,n)},isAlive:function(){return this.lifeCurrent>0},kill:function(){this.lifeCurrent=0},setPosition:function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=t,this.y=e},fire:function(t,e){var i=this.emitter,s=i.ops,r=i.getAnim();if(r?this.anims.play(r):(this.frame=i.getFrame(),this.texture=this.frame.texture),!this.frame)throw new Error("Particle has no texture frame");if(i.getEmitZone(this),void 0===t?this.x+=s.x.onEmit(this,"x"):s.x.steps>0?this.x+=t+s.x.onEmit(this,"x"):this.x+=t,void 0===e?this.y+=s.y.onEmit(this,"y"):s.y.steps>0?this.y+=e+s.y.onEmit(this,"y"):this.y+=e,this.life=s.lifespan.onEmit(this,"lifespan"),this.lifeCurrent=this.life,this.lifeT=0,this.delayCurrent=s.delay.onEmit(this,"delay"),this.holdCurrent=s.hold.onEmit(this,"hold"),this.scaleX=s.scaleX.onEmit(this,"scaleX"),this.scaleY=s.scaleY.active?s.scaleY.onEmit(this,"scaleY"):this.scaleX,this.angle=s.rotate.onEmit(this,"rotate"),this.rotation=a(this.angle),i.worldMatrix.transformPoint(this.x,this.y,this.worldPosition),0===this.delayCurrent&&i.getDeathZone(this))return this.lifeCurrent=0,!1;var n=s.speedX.onEmit(this,"speedX"),o=s.speedY.active?s.speedY.onEmit(this,"speedY"):n;if(i.radial){var h=a(s.angle.onEmit(this,"angle"));this.velocityX=Math.cos(h)*Math.abs(n),this.velocityY=Math.sin(h)*Math.abs(o)}else if(i.moveTo){var l=s.moveToX.onEmit(this,"moveToX"),u=s.moveToY.onEmit(this,"moveToY"),d=this.life/1e3;this.velocityX=(l-this.x)/d,this.velocityY=(u-this.y)/d}else this.velocityX=n,this.velocityY=o;return i.acceleration&&(this.accelerationX=s.accelerationX.onEmit(this,"accelerationX"),this.accelerationY=s.accelerationY.onEmit(this,"accelerationY")),this.maxVelocityX=s.maxVelocityX.onEmit(this,"maxVelocityX"),this.maxVelocityY=s.maxVelocityY.onEmit(this,"maxVelocityY"),this.bounce=s.bounce.onEmit(this,"bounce"),this.alpha=s.alpha.onEmit(this,"alpha"),s.color.active?this.tint=s.color.onEmit(this,"tint"):this.tint=s.tint.onEmit(this,"tint"),!0},update:function(t,e,i){if(this.lifeCurrent<=0)return!(this.holdCurrent>0)||(this.holdCurrent-=t,this.holdCurrent<=0);if(this.delayCurrent>0)return this.delayCurrent-=t,!1;this.anims&&this.anims.update(0,t);var s=this.emitter,n=s.ops,o=1-this.lifeCurrent/this.life;if(this.lifeT=o,this.x=n.x.onUpdate(this,"x",o,this.x),this.y=n.y.onUpdate(this,"y",o,this.y),s.moveTo){var h=n.moveToX.onUpdate(this,"moveToX",o,s.moveToX),l=n.moveToY.onUpdate(this,"moveToY",o,s.moveToY),u=this.lifeCurrent/1e3;this.velocityX=(h-this.x)/u,this.velocityY=(l-this.y)/u}return this.computeVelocity(s,t,e,i,o),this.scaleX=n.scaleX.onUpdate(this,"scaleX",o,this.scaleX),n.scaleY.active?this.scaleY=n.scaleY.onUpdate(this,"scaleY",o,this.scaleY):this.scaleY=this.scaleX,this.angle=n.rotate.onUpdate(this,"rotate",o,this.angle),this.rotation=a(this.angle),s.getDeathZone(this)?(this.lifeCurrent=0,!0):(this.alpha=r(n.alpha.onUpdate(this,"alpha",o,this.alpha),0,1),n.color.active?this.tint=n.color.onUpdate(this,"color",o,this.tint):this.tint=n.tint.onUpdate(this,"tint",o,this.tint),this.lifeCurrent-=t,this.lifeCurrent<=0&&this.holdCurrent<=0)},computeVelocity:function(t,e,i,s,n){var a=t.ops,o=this.velocityX,h=this.velocityY,l=a.accelerationX.onUpdate(this,"accelerationX",n,this.accelerationX),u=a.accelerationY.onUpdate(this,"accelerationY",n,this.accelerationY),d=a.maxVelocityX.onUpdate(this,"maxVelocityX",n,this.maxVelocityX),c=a.maxVelocityY.onUpdate(this,"maxVelocityY",n,this.maxVelocityY);this.bounce=a.bounce.onUpdate(this,"bounce",n,this.bounce),o+=t.gravityX*i+l*i,h+=t.gravityY*i+u*i,o=r(o,-d,d),h=r(h,-c,c),this.velocityX=o,this.velocityY=h,this.x+=o*i,this.y+=h*i,t.worldMatrix.transformPoint(this.x,this.y,this.worldPosition);for(var f=0;fe.right&&this.collideRight&&(t.x-=s.x-e.right,t.velocityX*=i),s.ye.bottom&&this.collideBottom&&(t.y-=s.y-e.bottom,t.velocityY*=i)}});t.exports=a},31600(t,e,i){var s=i(68668),r=i(83419),n=i(31401),a=i(53774),o=i(43459),h=i(26388),l=i(19909),u=i(76472),d=i(44777),c=i(20696),f=i(95643),p=i(95540),m=i(26546),g=i(24502),v=i(69036),x=i(1985),y=i(97022),T=i(86091),w=i(73162),S=i(20074),b=i(269),E=i(56480),C=i(69601),A=i(68875),_=i(87841),M=i(59996),R=i(72905),O=i(90668),P=i(19186),L=i(84322),F=i(61340),D=i(26099),I=i(15994),N=["active","advance","blendMode","colorEase","deathCallback","deathCallbackScope","duration","emitCallback","emitCallbackScope","follow","frequency","gravityX","gravityY","maxAliveParticles","maxParticles","name","emitting","particleBringToTop","particleClass","radial","sortCallback","sortOrderAsc","sortProperty","stopAfter","tintMode","timeScale","trackVisible","visible"],B=["accelerationX","accelerationY","alpha","angle","bounce","color","delay","hold","lifespan","maxVelocityX","maxVelocityY","moveToX","moveToY","quantity","rotate","scaleX","scaleY","speedX","speedY","tint","x","y"],k=new r({Extends:f,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.Lighting,n.Mask,n.RenderNodes,n.ScrollFactor,n.Texture,n.Transform,n.Visible,O],initialize:function(t,e,i,s,r){f.call(this,t,"ParticleEmitter"),this.particleClass=E,this.config=null,this.ops={accelerationX:new d("accelerationX",0),accelerationY:new d("accelerationY",0),alpha:new d("alpha",1),angle:new d("angle",{min:0,max:360},!0),bounce:new d("bounce",0),color:new u("color"),delay:new d("delay",0,!0),hold:new d("hold",0,!0),lifespan:new d("lifespan",1e3,!0),maxVelocityX:new d("maxVelocityX",1e4),maxVelocityY:new d("maxVelocityY",1e4),moveToX:new d("moveToX",0),moveToY:new d("moveToY",0),quantity:new d("quantity",1,!0),rotate:new d("rotate",0),scaleX:new d("scaleX",1),scaleY:new d("scaleY",1),speedX:new d("speedX",0,!0),speedY:new d("speedY",0,!0),tint:new d("tint",16777215),x:new d("x",0),y:new d("y",0)},this.radial=!0,this.gravityX=0,this.gravityY=0,this.acceleration=!1,this.moveTo=!1,this.emitCallback=null,this.emitCallbackScope=null,this.deathCallback=null,this.deathCallbackScope=null,this.maxParticles=0,this.maxAliveParticles=0,this.stopAfter=0,this.duration=0,this.frequency=0,this.emitting=!0,this.particleBringToTop=!0,this.timeScale=1,this.emitZones=[],this.deathZones=[],this.viewBounds=null,this.follow=null,this.followOffset=new D,this.trackVisible=!1,this.frames=[],this.randomFrame=!0,this.frameQuantity=1,this.anims=[],this.randomAnim=!0,this.animQuantity=1,this.dead=[],this.alive=[],this.counters=new Float32Array(10),this.skipping=!1,this.worldMatrix=new F,this.sortProperty="",this.sortOrderAsc=!0,this.sortCallback=this.depthSortCallback,this.processors=new w(this),this.tintMode=L.MULTIPLY,this.initRenderNodes(this._defaultRenderNodesMap),this.setPosition(e,i),this.setTexture(s),r&&this.setConfig(r)},_defaultRenderNodesMap:{get:function(){return s}},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},setConfig:function(t){if(!t)return this;this.config=t;var e=0,i="",s=this.ops;for(e=0;e=this.animQuantity&&(this.animCounter=0,this.currentAnim=I(this.currentAnim+1,0,e)),i},setAnim:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=1),this.randomAnim=e,this.animQuantity=i,this.currentAnim=0;var s=typeof t;if(this.anims.length=0,Array.isArray(t))this.anims=this.anims.concat(t);else if("string"===s)this.anims.push(t);else if("object"===s){var r=t;(t=p(r,"anims",null))&&(this.anims=this.anims.concat(t));var n=p(r,"cycle",!1);this.randomAnim=!n,this.animQuantity=p(r,"quantity",i)}return 1===this.anims.length&&(this.animQuantity=1,this.randomAnim=!1),this},setRadial:function(t){return void 0===t&&(t=!0),this.radial=t,this},addParticleBounds:function(t,e,i,s,r,n,a,o){if("object"==typeof t){var h=t;t=h.x,e=h.y,i=y(h,"w")?h.w:h.width,s=y(h,"h")?h.h:h.height}return this.addParticleProcessor(new C(t,e,i,s,r,n,a,o))},setParticleSpeed:function(t,e){return void 0===e&&(e=t),this.ops.speedX.onChange(t),t===e?this.ops.speedY.active=!1:this.ops.speedY.onChange(e),this.radial=!0,this},setParticleScale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.ops.scaleX.onChange(t),this.ops.scaleY.onChange(e),this},setParticleGravity:function(t,e){return this.gravityX=t,this.gravityY=e,this},setParticleAlpha:function(t){return this.ops.alpha.onChange(t),this},setParticleTint:function(t){return this.ops.tint.onChange(t),this},setEmitterAngle:function(t){return this.ops.angle.onChange(t),this},setParticleLifespan:function(t){return this.ops.lifespan.onChange(t),this},setQuantity:function(t){return this.quantity=t,this},setFrequency:function(t,e){return this.frequency=t,this.flowCounter=t>0?t:0,e&&(this.quantity=e),this},addDeathZone:function(t){var e;Array.isArray(t)||(t=[t]);for(var i=[],s=0;s-1&&(this.zoneTotal++,this.zoneTotal===s.total&&(this.zoneTotal=0,this.zoneIndex++,this.zoneIndex===i&&(this.zoneIndex=0)))}},getDeathZone:function(t){for(var e=this.deathZones,i=0;i=0&&(this.zoneIndex=e),this},addParticleProcessor:function(t){return this.processors.exists(t)||(t.emitter&&t.emitter.removeParticleProcessor(t),this.processors.add(t),t.emitter=this),t},removeParticleProcessor:function(t){return this.processors.exists(t)&&(this.processors.remove(t,!0),t.emitter=null),t},getProcessors:function(){return this.processors.getAll("active",!0)},createGravityWell:function(t){return this.addParticleProcessor(new g(t))},reserve:function(t){var e=this.dead;if(this.maxParticles>0){var i=this.getParticleCount();i+t>this.maxParticles&&(t=this.maxParticles-(i+t))}for(var s=0;s0&&this.getParticleCount()>=this.maxParticles||this.maxAliveParticles>0&&this.getAliveParticleCount()>=this.maxAliveParticles},onParticleEmit:function(t,e){return void 0===t?(this.emitCallback=null,this.emitCallbackScope=null):"function"==typeof t&&(this.emitCallback=t,e&&(this.emitCallbackScope=e)),this},onParticleDeath:function(t,e){return void 0===t?(this.deathCallback=null,this.deathCallbackScope=null):"function"==typeof t&&(this.deathCallback=t,e&&(this.deathCallbackScope=e)),this},killAll:function(){for(var t=this.dead,e=this.alive;e.length>0;)t.push(e.pop());return this},forEachAlive:function(t,e){for(var i=this.alive,s=i.length,r=0;r0&&this.fastForward(t),this.emitting=!0,this.resetCounters(this.frequency,!0),void 0!==e&&(this.duration=Math.abs(e)),this.emit(c.START,this)),this},stop:function(t){return void 0===t&&(t=!1),this.emitting&&(this.emitting=!1,t&&this.killAll(),this.emit(c.STOP,this)),this},pause:function(){return this.active=!1,this},resume:function(){return this.active=!0,this},setSortProperty:function(t,e){return void 0===t&&(t=""),void 0===e&&(e=this.true),this.sortProperty=t,this.sortOrderAsc=e,this.sortCallback=this.depthSortCallback,this},setSortCallback:function(t){return t=""!==this.sortProperty?this.depthSortCallback:null,this.sortCallback=t,this},depthSort:function(){return P(this.alive,this.sortCallback.bind(this)),this},depthSortCallback:function(t,e){var i=this.sortProperty;return this.sortOrderAsc?t[i]-e[i]:e[i]-t[i]},flow:function(t,e,i){return void 0===e&&(e=1),this.emitting=!1,this.frequency=t,this.quantity=e,void 0!==i&&(this.stopAfter=i),this.start()},explode:function(t,e,i){this.frequency=-1,this.resetCounters(-1,!0);var s=this.emitParticle(t,e,i);return this.emit(c.EXPLODE,this,s),s},emitParticleAt:function(t,e,i){return this.emitParticle(i,t,e)},emitParticle:function(t,e,i){if(!this.atLimit()){void 0===t&&(t=this.ops.quantity.onEmit());for(var s=this.dead,r=this.stopAfter,n=this.follow?this.follow.x+this.followOffset.x:e,a=this.follow?this.follow.y+this.followOffset.y:i,o=0;o0&&(this.stopCounter++,this.stopCounter>=r))break;if(this.atLimit())break}return h}},fastForward:function(t,e){void 0===e&&(e=1e3/60);var i=0;for(this.skipping=!0;i0){var u=this.deathCallback,d=this.deathCallbackScope;for(a=h-1;a>=0;a--){var f=o[a];r.splice(f.index,1),n.push(f.particle),u&&u.call(d,f.particle),f.particle.setPosition()}}if(this.emitting||this.skipping){if(0===this.frequency)this.emitParticle();else if(this.frequency>0)for(this.flowCounter-=e;this.flowCounter<=0;)this.emitParticle(),this.flowCounter+=this.frequency;this.skipping||(this.duration>0&&(this.elapsed+=e,this.elapsed>=this.duration&&this.stop()),this.stopAfter>0&&this.stopCounter>=this.stopAfter&&this.stop())}else 1===this.completeFlag&&0===r.length&&(this.completeFlag=0,this.emit(c.COMPLETE,this))},overlap:function(t){for(var e=this.getWorldTransformMatrix(),i=this.alive,s=i.length,r=[],n=0;n0){var u=0;for(this.skipping=!0;u0&&T(s,t,t),s},createEmitter:function(){throw new Error("createEmitter removed. See ParticleEmitter docs for info")},particleX:{get:function(){return this.ops.x.current},set:function(t){this.ops.x.onChange(t)}},particleY:{get:function(){return this.ops.y.current},set:function(t){this.ops.y.onChange(t)}},accelerationX:{get:function(){return this.ops.accelerationX.current},set:function(t){this.ops.accelerationX.onChange(t)}},accelerationY:{get:function(){return this.ops.accelerationY.current},set:function(t){this.ops.accelerationY.onChange(t)}},maxVelocityX:{get:function(){return this.ops.maxVelocityX.current},set:function(t){this.ops.maxVelocityX.onChange(t)}},maxVelocityY:{get:function(){return this.ops.maxVelocityY.current},set:function(t){this.ops.maxVelocityY.onChange(t)}},speed:{get:function(){return this.ops.speedX.current},set:function(t){this.ops.speedX.onChange(t),this.ops.speedY.onChange(t)}},speedX:{get:function(){return this.ops.speedX.current},set:function(t){this.ops.speedX.onChange(t)}},speedY:{get:function(){return this.ops.speedY.current},set:function(t){this.ops.speedY.onChange(t)}},moveToX:{get:function(){return this.ops.moveToX.current},set:function(t){this.ops.moveToX.onChange(t)}},moveToY:{get:function(){return this.ops.moveToY.current},set:function(t){this.ops.moveToY.onChange(t)}},bounce:{get:function(){return this.ops.bounce.current},set:function(t){this.ops.bounce.onChange(t)}},particleScaleX:{get:function(){return this.ops.scaleX.current},set:function(t){this.ops.scaleX.onChange(t)}},particleScaleY:{get:function(){return this.ops.scaleY.current},set:function(t){this.ops.scaleY.onChange(t)}},particleColor:{get:function(){return this.ops.color.current},set:function(t){this.ops.color.onChange(t)}},colorEase:{get:function(){return this.ops.color.easeName},set:function(t){this.ops.color.setEase(t)}},particleTint:{get:function(){return this.ops.tint.current},set:function(t){this.ops.tint.onChange(t)}},particleAlpha:{get:function(){return this.ops.alpha.current},set:function(t){this.ops.alpha.onChange(t)}},lifespan:{get:function(){return this.ops.lifespan.current},set:function(t){this.ops.lifespan.onChange(t)}},particleAngle:{get:function(){return this.ops.angle.current},set:function(t){this.ops.angle.onChange(t)}},particleRotate:{get:function(){return this.ops.rotate.current},set:function(t){this.ops.rotate.onChange(t)}},quantity:{get:function(){return this.ops.quantity.current},set:function(t){this.ops.quantity.onChange(t)}},delay:{get:function(){return this.ops.delay.current},set:function(t){this.ops.delay.onChange(t)}},hold:{get:function(){return this.ops.hold.current},set:function(t){this.ops.hold.onChange(t)}},flowCounter:{get:function(){return this.counters[0]},set:function(t){this.counters[0]=t}},frameCounter:{get:function(){return this.counters[1]},set:function(t){this.counters[1]=t}},animCounter:{get:function(){return this.counters[2]},set:function(t){this.counters[2]=t}},elapsed:{get:function(){return this.counters[3]},set:function(t){this.counters[3]=t}},stopCounter:{get:function(){return this.counters[4]},set:function(t){this.counters[4]=t}},completeFlag:{get:function(){return this.counters[5]},set:function(t){this.counters[5]=t}},zoneIndex:{get:function(){return this.counters[6]},set:function(t){this.counters[6]=t}},zoneTotal:{get:function(){return this.counters[7]},set:function(t){this.counters[7]=t}},currentFrame:{get:function(){return this.counters[8]},set:function(t){this.counters[8]=t}},currentAnim:{get:function(){return this.counters[9]},set:function(t){this.counters[9]=t}},preDestroy:function(){var t;this.texture=null,this.frames=null,this.anims=null,this.emitCallback=null,this.emitCallbackScope=null,this.deathCallback=null,this.deathCallbackScope=null,this.emitZones=null,this.deathZones=null,this.bounds=null,this.follow=null,this.counters=null;var e=this.ops;for(t=0;t0&&T.height>0){var w=-y.halfWidth,S=-y.halfHeight;l.globalAlpha=x,l.save(),a.setToContext(l),u&&(w=Math.round(w),S=Math.round(S)),l.imageSmoothingEnabled=!y.source.scaleMode,l.drawImage(y.source.image,T.x,T.y,T.width,T.height,w,S,T.width,T.height),l.restore()}}}l.restore()}}},92730(t,e,i){var s=i(25305),r=i(44603),n=i(23568),a=i(95540),o=i(31600);r.register("particles",function(t,e){void 0===t&&(t={});var i=n(t,"key",null),r=a(t,"config",null),h=new o(this.scene,0,0,i);return void 0!==e&&(t.add=e),s(this.scene,h,t),r&&h.setConfig(r),h})},676(t,e,i){var s=i(39429),r=i(31600);s.register("particles",function(t,e,i,s){return void 0!==t&&"string"==typeof t&&console.warn("ParticleEmitterManager was removed in Phaser 3.60. See documentation for details"),this.displayList.add(new r(this.scene,t,e,i,s))})},90668(t,e,i){var s=i(29747),r=s,n=s;r=i(21188),n=i(9871),t.exports={renderWebGL:r,renderCanvas:n}},21188(t,e,i){var s=i(59996),r=i(61340),n=i(70554),a=new r,o=new r,h=new r,l=new r,u={},d={},c={quad:new Float32Array(8)};t.exports=function(t,e,i,r){var f=i.camera;f.addToRenderList(e),a.copyWithScrollFactorFrom(f.getViewMatrix(!i.useCanvas),f.scrollX,f.scrollY,e.scrollFactorX,e.scrollFactorY),r&&a.multiply(r),l.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),a.multiply(l);var p=n.getTintAppendFloatAlpha,m=e.alpha,g=e.alive,v=g.length,x=e.viewBounds;if(0!==v&&(!x||s(x,f.worldView))){e.sortCallback&&e.depthSort();for(var y=e.tintMode,T=0;Tthis._length&&(this.counter=this._length-1),this},changeSource:function(t){return this.source=t,this.updateSource()},getPoint:function(t){0===this._direction?(this.counter++,this.counter>=this._length&&(this.yoyo?(this._direction=1,this.counter=this._length-1):this.counter=0)):(this.counter--,-1===this.counter&&(this.yoyo?(this._direction=0,this.counter=0):this.counter=this._length-1));var e=this.points[this.counter];e&&(t.x=e.x,t.y=e.y)}});t.exports=s},68875(t,e,i){var s=i(83419),r=i(26099),n=new s({initialize:function(t){this.source=t,this._tempVec=new r,this.total=-1},getPoint:function(t){var e=this._tempVec;this.source.getRandomPoint(e),t.x=e.x,t.y=e.y}});t.exports=n},21024(t,e,i){t.exports={DeathZone:i(26388),EdgeZone:i(19909),RandomZone:i(68875)}},1159(t,e,i){var s=i(83419),r=i(31401),n=i(68287),a=new s({Extends:n,Mixins:[r.PathFollower],initialize:function(t,e,i,s,r,a){n.call(this,t,i,s,r,a),this.path=e},preUpdate:function(t,e){this.anims.update(t,e),this.pathUpdate(t)}});t.exports=a},90145(t,e,i){var s=i(39429),r=i(1159);s.register("follower",function(t,e,i,s,n){var a=new r(this.scene,t,e,i,s,n);return this.displayList.add(a),this.updateList.add(a),a})},80321(t,e,i){var s=i(43246),r=i(83419),n=i(31401),a=i(95643),o=i(30100),h=i(67277),l=new r({Extends:a,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.Mask,n.RenderNodes,n.ScrollFactor,n.Transform,n.Visible,h],initialize:function(t,e,i,s,r,n,h){void 0===s&&(s=16777215),void 0===r&&(r=128),void 0===n&&(n=1),void 0===h&&(h=.1),a.call(this,t,"PointLight"),this.initRenderNodes(this._defaultRenderNodesMap),this.setPosition(e,i),this.color=o(s),this.intensity=n,this.attenuation=h,this.width=2*r,this.height=2*r,this._radius=r},_defaultRenderNodesMap:{get:function(){return s}},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this.width=2*t,this.height=2*t}},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return this._radius}},displayOriginY:{get:function(){return this._radius}}});t.exports=l},39829(t,e,i){var s=i(25305),r=i(44603),n=i(23568),a=i(80321);r.register("pointlight",function(t,e){void 0===t&&(t={});var i=n(t,"color",16777215),r=n(t,"radius",128),o=n(t,"intensity",1),h=n(t,"attenuation",.1),l=new a(this.scene,0,0,i,r,o,h);return void 0!==e&&(t.add=e),s(this.scene,l,t),l})},71255(t,e,i){var s=i(39429),r=i(80321);s.register("pointlight",function(t,e,i,s,n,a){return this.displayList.add(new r(this.scene,t,e,i,s,n,a))})},67277(t,e,i){var s=i(29747),r=s,n=s;r=i(57787),t.exports={renderWebGL:r,renderCanvas:n}},57787(t,e,i){var s=i(91296);t.exports=function(t,e,i,r){var n=i.camera;n.addToRenderList(e);var a=s(e,n,r,!i.useCanvas).calc,o=e.width,h=e.height,l=-e._radius,u=-e._radius,d=l+o,c=u+h,f=a.getX(0,0),p=a.getY(0,0),m=a.getX(l,u),g=a.getY(l,u),v=a.getX(l,c),x=a.getY(l,c),y=a.getX(d,c),T=a.getY(d,c),w=a.getX(d,u),S=a.getY(d,u);(e.customRenderNodes.BatchHandler||e.defaultRenderNodes.BatchHandler).batch(i,e,m,g,v,x,w,S,y,T,f,p)}},591(t,e,i){var s=i(83419),r=i(45650),n=i(88571),a=i(83999),o=i(58855),h=new s({Extends:n,Mixins:[a],initialize:function(t,e,i,s,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=32),void 0===a&&(a=32),void 0===h&&(h=!0);var l=t.sys.textures.addDynamicTexture(r(),s,a,h);n.call(this,t,e,i,l),this.type="RenderTexture",this.camera=this.texture.camera,this._saved=!1,this.renderMode=o.RENDER,this.isCurrentlyRendering=!1},setSize:function(t,e){this.width=t,this.height=e,this.updateDisplayOrigin();var i=this.input;return i&&!i.customHitArea&&(i.hitArea.width=t,i.hitArea.height=e),this},resize:function(t,e,i){return this.texture.setSize(t,e,i),this.setSize(this.texture.width,this.texture.height),this},saveTexture:function(t){var e=this.texture,i=e.key,s=e.manager;return s.exists(i)&&s.get(i)===e?(s.renameTexture(i,t),this._saved=!0):(e.key=t,e.manager.addDynamicTexture(e)&&(this._saved=!0)),e},setRenderMode:function(t,e){return this.renderMode=t,e&&this.texture.preserve(!0),this},render:function(){return this.texture.render(),this},fill:function(t,e,i,s,r,n){return this.texture.fill(t,e,i,s,r,n),this},clear:function(t,e,i,s){return this.texture.clear(t,e,i,s),this},stamp:function(t,e,i,s,r){return this.texture.stamp(t,e,i,s,r),this},erase:function(t,e,i){return this.texture.erase(t,e,i),this},draw:function(t,e,i,s,r){return this.texture.draw(t,e,i,s,r),this},capture:function(t,e){return this.texture.capture(t,e),this},repeat:function(t,e,i,s,r,n,a){return this.texture.repeat(t,e,i,s,r,n,a),this},preserve:function(t){return this.texture.preserve(t),this},callback:function(t){return this.texture.callback(t),this},snapshotArea:function(t,e,i,s,r,n,a){return this.texture.snapshotArea(t,e,i,s,r,n,a),this},snapshot:function(t,e,i){return this.texture.snapshot(t,e,i)},snapshotPixel:function(t,e,i){return this.texture.snapshotPixel(t,e,i)},preDestroy:function(){this.camera=null,this._saved||this.texture.destroy()}});t.exports=h},97272(t,e,i){var s=i(40652),r=i(58855);t.exports=function(t,e,i,n){var a=!0,o=!0;e.renderMode===r.REDRAW?o=!1:e.renderMode===r.RENDER&&(a=!1),a&&e.render(),o&&s(t,e,i,n)}},34495(t,e,i){var s=i(25305),r=i(44603),n=i(23568),a=i(591);r.register("renderTexture",function(t,e){void 0===t&&(t={});var i=n(t,"x",0),r=n(t,"y",0),o=n(t,"width",32),h=n(t,"height",32),l=new a(this.scene,i,r,o,h);return void 0!==e&&(t.add=e),s(this.scene,l,t),l})},60505(t,e,i){var s=i(39429),r=i(591);s.register("renderTexture",function(t,e,i,s){return this.displayList.add(new r(this.scene,t,e,i,s))})},83999(t,e,i){var s=i(29747),r=s,n=s;r=i(53937),n=i(97272),t.exports={renderWebGL:r,renderCanvas:n}},58855(t){t.exports={RENDER:"render",REDRAW:"redraw",ALL:"all"}},53937(t,e,i){var s=i(99517),r=i(58855);t.exports=function(t,e,i,n){if(!e.isCurrentlyRendering){e.isCurrentlyRendering=!0;var a=!0,o=!0;e.renderMode===r.REDRAW?o=!1:e.renderMode===r.RENDER&&(a=!1),a&&e.render(),o&&s(t,e,i,n),e.isCurrentlyRendering=!1}}},77757(t,e,i){var s=i(9674),r=i(85760),n=i(83419),a=i(31401),o=i(95643),h=i(38745),l=i(84322),u=i(26099),d=new n({Extends:o,Mixins:[a.AlphaSingle,a.BlendMode,a.Depth,a.Flip,a.Mask,a.RenderNodes,a.Size,a.Texture,a.Transform,a.Visible,a.ScrollFactor,h],initialize:function(t,e,i,r,n,a,h,d,c){void 0===r&&(r="__DEFAULT"),void 0===a&&(a=2),void 0===h&&(h=!0),o.call(this,t,"Rope"),this.anims=new s(this),this.points=a,this.vertices,this.uv,this.colors,this.alphas,this.tintMode="__DEFAULT"===r?l.FILL:l.MULTIPLY,this.dirty=!1,this.horizontal=h,this._flipX=!1,this._flipY=!1,this._perp=new u,this.debugCallback=null,this.debugGraphic=null,this.setTexture(r,n),this.setPosition(e,i),this.setSizeToFrame(),this.initRenderNodes(this._defaultRenderNodesMap),Array.isArray(a)&&this.resizeArrays(a.length),this.setPoints(a,d,c),this.updateVertices()},_defaultRenderNodesMap:{get:function(){return r}},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(t,e){var i=this.anims.currentFrame;this.anims.update(t,e),this.anims.currentFrame!==i&&(this.updateUVs(),this.updateVertices())},play:function(t,e,i){return this.anims.play(t,e,i),this},setDirty:function(){return this.dirty=!0,this},setHorizontal:function(t,e,i){return void 0===t&&(t=this.points.length),this.horizontal?this:(this.horizontal=!0,this.setPoints(t,e,i))},setVertical:function(t,e,i){return void 0===t&&(t=this.points.length),this.horizontal?(this.horizontal=!1,this.setPoints(t,e,i)):this},setTintMode:function(t){return void 0===t&&(t=l.MULTIPLY),this.tintMode=t,this},setAlphas:function(t,e){var i=this.points.length;if(i<1)return this;var s,r=this.alphas;void 0===t?t=[1]:Array.isArray(t)||void 0!==e||(t=[t]);var n=0;if(void 0!==e)for(s=0;sn&&(a=t[n]),r[n]=a,t.length>n+1&&(a=t[n+1]),r[n+1]=a}return this},setColors:function(t){var e=this.points.length;if(e<1)return this;var i,s=this.colors;void 0===t?t=[16777215]:Array.isArray(t)||(t=[t]);var r=0;if(t.length===e)for(i=0;ir&&(n=t[r]),s[r]=n,t.length>r+1&&(n=t[r+1]),s[r+1]=n}return this},setPoints:function(t,e,i){if(void 0===t&&(t=2),"number"==typeof t){var s,r,n,a=t;if(a<2&&(a=2),t=[],this.horizontal)for(n=-this.frame.halfWidth,r=this.frame.width/(a-1),s=0;s>>16,o=(65280&r)>>>8,h=255&r;t.fillStyle="rgba("+a+","+o+","+h+","+n+")"}},75177(t){t.exports=function(t,e,i,s){var r=i||e.strokeColor,n=s||e.strokeAlpha,a=(16711680&r)>>>16,o=(65280&r)>>>8,h=255&r;t.strokeStyle="rgba("+a+","+o+","+h+","+n+")",t.lineWidth=e.lineWidth}},17803(t,e,i){var s=i(87891),r=i(83419),n=i(31401),a=i(95643),o=i(23031),h=new r({Extends:a,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.GetBounds,n.Lighting,n.Mask,n.Origin,n.RenderNodes,n.ScrollFactor,n.Transform,n.Visible],initialize:function(t,e,i){void 0===e&&(e="Shape"),a.call(this,t,e),this.geom=i,this.pathData=[],this.pathIndexes=[],this.fillColor=16777215,this.fillAlpha=1,this.strokeColor=16777215,this.strokeAlpha=1,this.lineWidth=1,this.isFilled=!1,this.isStroked=!1,this.closePath=!0,this._tempLine=new o,this.width=0,this.height=0,this.enableFilters&&(this.filtersFocusContext=!0),this.initRenderNodes(this._defaultRenderNodesMap)},_defaultRenderNodesMap:{get:function(){return s}},setFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.isFilled=!1:(this.fillColor=t,this.fillAlpha=e,this.isFilled=!0),this},setStrokeStyle:function(t,e,i){return void 0===i&&(i=1),void 0===t?this.isStroked=!1:(this.lineWidth=t,this.strokeColor=e,this.strokeAlpha=i,this.isStroked=!0),this},setClosePath:function(t){return this.closePath=t,this},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this},preDestroy:function(){this.geom=null,this._tempLine=null,this.pathData=[],this.pathIndexes=[]},displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}}});t.exports=h},34682(t,e,i){var s=i(70554);t.exports=function(t,e,i,r,n,a,o){var h=s.getTintAppendFloatAlpha(r.strokeColor,r.strokeAlpha*n),l=r.pathData,u=l.length-1,d=r.lineWidth,c=!r.closePath,f=r.customRenderNodes.StrokePath||r.defaultRenderNodes.StrokePath,p=[];c&&(u-=2);for(var m=0;m0&&g===l[m-2]&&v===l[m-1]||p.push({x:g,y:v,width:d})}f.run(t,e,p,d,c,i,h,h,h,h,void 0,r.lighting)}},23629(t,e,i){var s=i(13609),r=i(83419),n=i(39506),a=i(94811),o=i(96503),h=i(36383),l=i(17803),u=new r({Extends:l,Mixins:[s],initialize:function(t,e,i,s,r,n,a,h,u){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=128),void 0===r&&(r=0),void 0===n&&(n=360),void 0===a&&(a=!1),l.call(this,t,"Arc",new o(0,0,s)),this._startAngle=r,this._endAngle=n,this._anticlockwise=a,this._iterations=.01,this.setPosition(e,i);var d=2*this.geom.radius;this.setSize(d,d),void 0!==h&&this.setFillStyle(h,u),this.updateDisplayOrigin(),this.updateData()},iterations:{get:function(){return this._iterations},set:function(t){this._iterations=t,this.updateData()}},radius:{get:function(){return this.geom.radius},set:function(t){this.geom.radius=t;var e=2*t;this.setSize(e,e),this.updateDisplayOrigin(),this.updateData()}},startAngle:{get:function(){return this._startAngle},set:function(t){this._startAngle=t,this.updateData()}},endAngle:{get:function(){return this._endAngle},set:function(t){this._endAngle=t,this.updateData()}},anticlockwise:{get:function(){return this._anticlockwise},set:function(t){this._anticlockwise=t,this.updateData()}},setRadius:function(t){return this.radius=t,this},setIterations:function(t){return void 0===t&&(t=.01),this.iterations=t,this},setStartAngle:function(t,e){return this._startAngle=t,void 0!==e&&(this._anticlockwise=e),this.updateData()},setEndAngle:function(t,e){return this._endAngle=t,void 0!==e&&(this._anticlockwise=e),this.updateData()},updateData:function(){var t=this._iterations,e=t,i=this.geom.radius,s=n(this._startAngle),r=n(this._endAngle),o=i,l=i;r-=s,this._anticlockwise?r<-h.TAU?r=-h.TAU:r>0&&(r=-h.TAU+r%h.TAU):r>h.TAU?r=h.TAU:r<0&&(r=h.TAU+r%h.TAU);for(var u,d=[o+Math.cos(s)*i,l+Math.sin(s)*i];e<1;)u=r*e+s,d.push(o+Math.cos(u)*i,l+Math.sin(u)*i),e+=t;return u=r+s,d.push(o+Math.cos(u)*i,l+Math.sin(u)*i),d.push(o+Math.cos(s)*i,l+Math.sin(s)*i),this.pathIndexes=a(d),this.pathData=d,this}});t.exports=u},42542(t,e,i){var s=i(39506),r=i(65960),n=i(75177),a=i(20926);t.exports=function(t,e,i,o){i.addToRenderList(e);var h=t.currentContext;if(a(t,h,e,i,o)){var l=e.radius;h.beginPath(),h.arc(l-e.originX*(2*l),l-e.originY*(2*l),l,s(e._startAngle),s(e._endAngle),e.anticlockwise),e.closePath&&h.closePath(),e.isFilled&&(r(h,e),h.fill()),e.isStroked&&(n(h,e),h.stroke()),h.restore()}}},42563(t,e,i){var s=i(23629),r=i(39429);r.register("arc",function(t,e,i,r,n,a,o,h){return this.displayList.add(new s(this.scene,t,e,i,r,n,a,o,h))}),r.register("circle",function(t,e,i,r,n){return this.displayList.add(new s(this.scene,t,e,i,0,360,!1,r,n))})},13609(t,e,i){var s=i(29747),r=s,n=s;r=i(41447),n=i(42542),t.exports={renderWebGL:r,renderCanvas:n}},41447(t,e,i){var s=i(91296),r=i(10441),n=i(34682);t.exports=function(t,e,i,a){var o=i.camera;o.addToRenderList(e);var h=s(e,o,a,!i.useCanvas).calc,l=e._displayOriginX,u=e._displayOriginY,d=e.alpha,c=e.customRenderNodes.Submitter||e.defaultRenderNodes.Submitter;e.isFilled&&r(i,c,h,e,d,l,u),e.isStroked&&n(i,c,h,e,d,l,u)}},89(t,e,i){var s=i(83419),r=i(33141),n=i(94811),a=i(87841),o=i(17803),h=new s({Extends:o,Mixins:[r],initialize:function(t,e,i,s,r,n){void 0===e&&(e=0),void 0===i&&(i=0),o.call(this,t,"Curve",s),this._smoothness=32,this._curveBounds=new a,this.closePath=!1,this.setPosition(e,i),void 0!==r&&this.setFillStyle(r,n),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(t){this._smoothness=t,this.updateData()}},setSmoothness:function(t){return this._smoothness=t,this.updateData()},updateData:function(){var t=this._curveBounds,e=this._smoothness;this.geom.getBounds(t,e),this.setSize(t.width,t.height),this.updateDisplayOrigin();for(var i=[],s=this.geom.getPoints(e),r=0;r0)for(s(o,e),_=0;_0&&O>0&&o.fillRect(h+A*f+E,l+_*p+E,R,O));if(S&&e.altFillAlpha>0)for(s(o,e,e.altFillColor,e.altFillAlpha*u),_=0;_0&&O>0&&o.fillRect(h+A*f+E,l+_*p+E,R,O)):M=1;if(b&&e.strokeAlpha>0){r(o,e,e.strokeColor,e.strokeAlpha*u);var P=e.strokeOutside?0:1;for(A=P;AC&&(o.beginPath(),o.moveTo(d+h,l),o.lineTo(d+h,c+l),o.stroke()),c>C&&(o.beginPath(),o.moveTo(h,c+l),o.lineTo(d+h,c+l),o.stroke()))}o.restore()}}},34137(t,e,i){var s=i(39429),r=i(30479);s.register("grid",function(t,e,i,s,n,a,o,h,l,u){return this.displayList.add(new r(this.scene,t,e,i,s,n,a,o,h,l,u))})},26015(t,e,i){var s=i(29747),r=s,n=s;r=i(46161),n=i(49912),t.exports={renderWebGL:r,renderCanvas:n}},46161(t,e,i){var s=i(91296),r=i(70554);t.exports=function(t,e,i,n){var a=i.camera;a.addToRenderList(e);var o=e.customRenderNodes.FillRect||e.defaultRenderNodes.FillRect,h=e.customRenderNodes.Submitter||e.defaultRenderNodes.Submitter,l=s(e,a,n,!i.useCanvas).calc;l.translate(-e._displayOriginX,-e._displayOriginY);var u,d=e.alpha,c=e.width,f=e.height,p=e.cellWidth,m=e.cellHeight,g=Math.ceil(c/p),v=Math.ceil(f/m),x=p,y=m,T=p-(g*p-c),w=m-(v*m-f),S=e.isFilled,b=e.showAltCells,E=e.isStroked,C=e.cellPadding,A=e.lineWidth,_=A/2,M=0,R=0,O=0,P=0,L=0;if(C&&(x-=2*C,y-=2*C,T-=2*C,w-=2*C),S&&e.fillAlpha>0)for(u=r.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*d),R=0;R0&&L>0&&o.run(i,l,h,M*p+C,R*m+C,P,L,u,u,u,u,e.lighting));if(b&&e.altFillAlpha>0)for(u=r.getTintAppendFloatAlpha(e.altFillColor,e.altFillAlpha*d),R=0;R0&&L>0&&o.run(i,l,h,M*p+C,R*m+C,P,L,u,u,u,u)):O=1;if(E&&e.strokeAlpha>0){var F=r.getTintAppendFloatAlpha(e.strokeColor,e.strokeAlpha*d),D=e.strokeOutside?0:1;for(M=D;M_&&o.run(i,l,h,c-_,0,A,f,F,F,F,F),f>_&&o.run(i,l,h,0,f-_,c,A,F,F,F,F))}}},61475(t,e,i){var s=i(99651),r=i(83419),n=i(17803),a=new r({Extends:n,Mixins:[s],initialize:function(t,e,i,s,r,a,o,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=48),void 0===r&&(r=32),void 0===a&&(a=15658734),void 0===o&&(o=10066329),void 0===h&&(h=13421772),n.call(this,t,"IsoBox",null),this.projection=4,this.fillTop=a,this.fillLeft=o,this.fillRight=h,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isFilled=!0,this.setPosition(e,i),this.setSize(s,r),this.updateDisplayOrigin()},setProjection:function(t){return this.projection=t,this},setFaces:function(t,e,i){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),this.showTop=t,this.showLeft=e,this.showRight=i,this},setFillStyle:function(t,e,i){return this.fillTop=t,this.fillLeft=e,this.fillRight=i,this.isFilled=!0,this}});t.exports=a},11508(t,e,i){var s=i(65960),r=i(20926);t.exports=function(t,e,i,n){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,n)&&e.isFilled){var o=e.width,h=e.height,l=o/2,u=o/e.projection;e.showTop&&(s(a,e,e.fillTop),a.beginPath(),a.moveTo(-l,-h),a.lineTo(0,-u-h),a.lineTo(l,-h),a.lineTo(l,-1),a.lineTo(0,u-1),a.lineTo(-l,-1),a.lineTo(-l,-h),a.fill()),e.showLeft&&(s(a,e,e.fillLeft),a.beginPath(),a.moveTo(-l,0),a.lineTo(0,u),a.lineTo(0,u-h),a.lineTo(-l,-h),a.lineTo(-l,0),a.fill()),e.showRight&&(s(a,e,e.fillRight),a.beginPath(),a.moveTo(l,0),a.lineTo(0,u),a.lineTo(0,u-h),a.lineTo(l,-h),a.lineTo(l,0),a.fill()),a.restore()}}},3933(t,e,i){var s=i(39429),r=i(61475);s.register("isobox",function(t,e,i,s,n,a,o){return this.displayList.add(new r(this.scene,t,e,i,s,n,a,o))})},99651(t,e,i){var s=i(29747),r=s,n=s;r=i(68149),n=i(11508),t.exports={renderWebGL:r,renderCanvas:n}},68149(t,e,i){var s=i(91296),r=i(70554);t.exports=function(t,e,i,n){if(e.isFilled){var a=i.camera;a.addToRenderList(e);var o,h,l,u,d,c,f,p,m,g=e.customRenderNodes.FillTri||e.defaultRenderNodes.FillTri,v=e.customRenderNodes.Submitter||e.defaultRenderNodes.Submitter,x=s(e,a,n,!i.useCanvas).calc,y=e.width,T=e.height,w=y/2,S=y/e.projection,b=e.alpha,E=e.lighting;e.showTop&&(o=r.getTintAppendFloatAlpha(e.fillTop,b),h=-w,l=-T,u=0,d=-S-T,c=w,f=-T,p=0,m=S-T,g.run(i,x,v,h,l,u,d,c,f,o,o,o,E),g.run(i,x,v,c,f,p,m,h,l,o,o,o,E)),e.showLeft&&(o=r.getTintAppendFloatAlpha(e.fillLeft,b),h=-w,l=0,u=0,d=S,c=0,f=S-T,p=-w,m=-T,g.run(i,x,v,h,l,u,d,c,f,o,o,o,E),g.run(i,x,v,c,f,p,m,h,l,o,o,o,E)),e.showRight&&(o=r.getTintAppendFloatAlpha(e.fillRight,b),h=w,l=0,u=0,d=S,c=0,f=S-T,p=w,m=-T,g.run(i,x,v,h,l,u,d,c,f,o,o,o,E),g.run(i,x,v,c,f,p,m,h,l,o,o,o,E))}}},16933(t,e,i){var s=i(83419),r=i(60561),n=i(17803),a=new s({Extends:n,Mixins:[r],initialize:function(t,e,i,s,r,a,o,h,l){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=48),void 0===r&&(r=32),void 0===a&&(a=!1),void 0===o&&(o=15658734),void 0===h&&(h=10066329),void 0===l&&(l=13421772),n.call(this,t,"IsoTriangle",null),this.projection=4,this.fillTop=o,this.fillLeft=h,this.fillRight=l,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isReversed=a,this.isFilled=!0,this.setPosition(e,i),this.setSize(s,r),this.updateDisplayOrigin()},setProjection:function(t){return this.projection=t,this},setReversed:function(t){return this.isReversed=t,this},setFaces:function(t,e,i){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),this.showTop=t,this.showLeft=e,this.showRight=i,this},setFillStyle:function(t,e,i){return this.fillTop=t,this.fillLeft=e,this.fillRight=i,this.isFilled=!0,this}});t.exports=a},79590(t,e,i){var s=i(65960),r=i(20926);t.exports=function(t,e,i,n){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,n)&&e.isFilled){var o=e.width,h=e.height,l=o/2,u=o/e.projection,d=e.isReversed;e.showTop&&d&&(s(a,e,e.fillTop),a.beginPath(),a.moveTo(-l,-h),a.lineTo(0,-u-h),a.lineTo(l,-h),a.lineTo(0,u-h),a.fill()),e.showLeft&&(s(a,e,e.fillLeft),a.beginPath(),d?(a.moveTo(-l,-h),a.lineTo(0,u),a.lineTo(0,u-h)):(a.moveTo(-l,0),a.lineTo(0,u),a.lineTo(0,u-h)),a.fill()),e.showRight&&(s(a,e,e.fillRight),a.beginPath(),d?(a.moveTo(l,-h),a.lineTo(0,u),a.lineTo(0,u-h)):(a.moveTo(l,0),a.lineTo(0,u),a.lineTo(0,u-h)),a.fill()),a.restore()}}},49803(t,e,i){var s=i(39429),r=i(16933);s.register("isotriangle",function(t,e,i,s,n,a,o,h){return this.displayList.add(new r(this.scene,t,e,i,s,n,a,o,h))})},60561(t,e,i){var s=i(29747),r=s,n=s;r=i(51503),n=i(79590),t.exports={renderWebGL:r,renderCanvas:n}},51503(t,e,i){var s=i(91296),r=i(70554);t.exports=function(t,e,i,n){if(e.isFilled){var a=i.camera;a.addToRenderList(e);var o,h,l,u,d,c,f,p=e.customRenderNodes.FillTri||e.defaultRenderNodes.FillTri,m=e.customRenderNodes.Submitter||e.defaultRenderNodes.Submitter,g=s(e,a,n,!i.useCanvas).calc,v=e.width,x=e.height,y=v/2,T=v/e.projection,w=e.isReversed,S=e.alpha,b=e.lighting;if(e.showTop&&w){o=r.getTintAppendFloatAlpha(e.fillTop,S),h=-y,l=-x,u=0,d=-T-x,c=y,f=-x;var E=T-x;p.run(i,g,m,h,l,u,d,c,f,o,o,o,b),p.run(i,g,m,c,f,0,E,h,l,o,o,o,b)}e.showLeft&&(o=r.getTintAppendFloatAlpha(e.fillLeft,S),w?(h=-y,l=-x,u=0,d=T,c=0,f=T-x):(h=-y,l=0,u=0,d=T,c=0,f=T-x),p.run(i,g,m,h,l,u,d,c,f,o,o,o,b)),e.showRight&&(o=r.getTintAppendFloatAlpha(e.fillRight,S),w?(h=y,l=-x,u=0,d=T,c=0,f=T-x):(h=y,l=0,u=0,d=T,c=0,f=T-x),p.run(i,g,m,h,l,u,d,c,f,o,o,o,b))}}},57847(t,e,i){var s=i(83419),r=i(17803),n=i(23031),a=i(36823),o=new s({Extends:r,Mixins:[a],initialize:function(t,e,i,s,a,o,h,l,u){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===a&&(a=0),void 0===o&&(o=128),void 0===h&&(h=0),r.call(this,t,"Line",new n(s,a,o,h));var d=Math.max(1,this.geom.right-this.geom.left),c=Math.max(1,this.geom.bottom-this.geom.top);this.lineWidth=1,this._startWidth=1,this._endWidth=1,this.setPosition(e,i),this.setSize(d,c),void 0!==l&&this.setStrokeStyle(1,l,u),this.updateDisplayOrigin()},setLineWidth:function(t,e){return void 0===e&&(e=t),this._startWidth=t,this._endWidth=e,this.lineWidth=t,this},setTo:function(t,e,i,s){return this.geom.setTo(t,e,i,s),this}});t.exports=o},17440(t,e,i){var s=i(75177),r=i(20926);t.exports=function(t,e,i,n){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,n)){var o=e._displayOriginX,h=e._displayOriginY;e.isStroked&&(s(a,e),a.beginPath(),a.moveTo(e.geom.x1-o,e.geom.y1-h),a.lineTo(e.geom.x2-o,e.geom.y2-h),a.stroke()),a.restore()}}},2481(t,e,i){var s=i(39429),r=i(57847);s.register("line",function(t,e,i,s,n,a,o,h){return this.displayList.add(new r(this.scene,t,e,i,s,n,a,o,h))})},36823(t,e,i){var s=i(29747),r=s,n=s;r=i(77385),n=i(17440),t.exports={renderWebGL:r,renderCanvas:n}},77385(t,e,i){var s=i(91296),r=i(70554),n=[{x:0,y:0,width:0},{x:0,y:0,width:0}];t.exports=function(t,e,i,a){var o=i.camera;o.addToRenderList(e);var h=s(e,o,a,!i.useCanvas).calc,l=e._displayOriginX,u=e._displayOriginY,d=e.alpha;if(e.isStroked){var c=r.getTintAppendFloatAlpha(e.strokeColor,e.strokeAlpha*d);n[0].x=e.geom.x1-l,n[0].y=e.geom.y1-u,n[0].width=e._startWidth,n[1].x=e.geom.x2-l,n[1].y=e.geom.y2-u,n[1].width=e._endWidth,(e.customRenderNodes.StrokePath||e.defaultRenderNodes.StrokePath).run(i,e.customRenderNodes.Submitter||e.defaultRenderNodes.Submitter,n,1,!0,h,c,c,c,c,void 0,e.lighting)}}},24949(t,e,i){var s=i(90273),r=i(83419),n=i(94811),a=i(13829),o=i(25717),h=i(17803),l=i(5469),u=new r({Extends:h,Mixins:[s],initialize:function(t,e,i,s,r,n){void 0===e&&(e=0),void 0===i&&(i=0),h.call(this,t,"Polygon",new o(s));var l=a(this.geom);this.setPosition(e,i),this.setSize(l.width,l.height),void 0!==r&&this.setFillStyle(r,n),this.updateDisplayOrigin(),this.updateData()},smooth:function(t){void 0===t&&(t=1);for(var e=0;e0,this.updateRoundedData()},setSize:function(t,e){this.width=t,this.height=e,this.geom.setSize(t,e),this.updateData(),this.updateDisplayOrigin();var i=this.input;return i&&!i.customHitArea&&(i.hitArea.width=t,i.hitArea.height=e),this},updateData:function(){if(this.isRounded)return this.updateRoundedData();var t=[],e=this.geom,i=this._tempLine;return e.getLineA(i),t.push(i.x1,i.y1,i.x2,i.y2),e.getLineB(i),t.push(i.x2,i.y2),e.getLineC(i),t.push(i.x2,i.y2),e.getLineD(i),t.push(i.x2,i.y2),this.pathData=t,this},updateRoundedData:function(){var t=[],e=this.width/2,i=this.height/2,s=Math.min(e,i),n=Math.min(this.radius,s),a=e,o=i,h=Math.max(4,Math.min(16,Math.ceil(n/2)));return this.arcTo(t,a-e+n,o-i+n,n,Math.PI,1.5*Math.PI,h),t.push(a+e-n,o-i),this.arcTo(t,a+e-n,o-i+n,n,1.5*Math.PI,2*Math.PI,h),t.push(a+e,o+i-n),this.arcTo(t,a+e-n,o+i-n,n,0,.5*Math.PI,h),t.push(a-e+n,o+i),this.arcTo(t,a-e+n,o+i-n,n,.5*Math.PI,Math.PI,h),t.push(a-e,o-i+n),this.pathIndexes=r(t),this.pathData=t,this},arcTo:function(t,e,i,s,r,n,a){for(var o=(n-r)/a,h=0;h<=a;h++){var l=r+o*h;t.push(e+Math.cos(l)*s,i+Math.sin(l)*s)}}});t.exports=h},48682(t,e,i){var s=i(65960),r=i(75177),n=i(20926),a=function(t,e,i,s,r,n){var a=Math.min(s/2,r/2),o=Math.min(n,a);0!==o?(t.moveTo(e+o,i),t.lineTo(e+s-o,i),t.arcTo(e+s,i,e+s,i+o,o),t.lineTo(e+s,i+r-o),t.arcTo(e+s,i+r,e+s-o,i+r,o),t.lineTo(e+o,i+r),t.arcTo(e,i+r,e,i+r-o,o),t.lineTo(e,i+o),t.arcTo(e,i,e+o,i,o),t.closePath()):t.rect(e,i,s,r)};t.exports=function(t,e,i,o){i.addToRenderList(e);var h=t.currentContext;if(n(t,h,e,i,o)){var l=e._displayOriginX,u=e._displayOriginY;e.isFilled&&(s(h,e),e.isRounded?(h.beginPath(),a(h,-l,-u,e.width,e.height,e.radius),h.fill()):h.fillRect(-l,-u,e.width,e.height)),e.isStroked&&(r(h,e),h.beginPath(),e.isRounded?a(h,-l,-u,e.width,e.height,e.radius):h.rect(-l,-u,e.width,e.height),h.stroke()),h.restore()}}},87959(t,e,i){var s=i(39429),r=i(74561);s.register("rectangle",function(t,e,i,s,n,a){return this.displayList.add(new r(this.scene,t,e,i,s,n,a))})},95597(t,e,i){var s=i(29747),r=s,n=s;r=i(52059),n=i(48682),t.exports={renderWebGL:r,renderCanvas:n}},52059(t,e,i){var s=i(10441),r=i(91296),n=i(34682),a=i(70554);t.exports=function(t,e,i,o){var h=i.camera;h.addToRenderList(e);var l=r(e,h,o,!i.useCanvas).calc,u=e._displayOriginX,d=e._displayOriginY,c=e.alpha,f=e.customRenderNodes,p=e.defaultRenderNodes,m=f.Submitter||p.Submitter;if(e.isFilled)if(e.isRounded)s(i,m,l,e,c,u,d);else{var g=a.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*c);(f.FillRect||p.FillRect).run(i,l,m,-u,-d,e.width,e.height,g,g,g,g,e.lighting)}e.isStroked&&n(i,m,l,e,c,u,d)}},55911(t,e,i){var s=i(81991),r=i(83419),n=i(94811),a=i(17803),o=new r({Extends:a,Mixins:[s],initialize:function(t,e,i,s,r,n,o,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=5),void 0===r&&(r=32),void 0===n&&(n=64),a.call(this,t,"Star",null),this._points=s,this._innerRadius=r,this._outerRadius=n,this.setPosition(e,i),this.setSize(2*n,2*n),void 0!==o&&this.setFillStyle(o,h),this.updateDisplayOrigin(),this.updateData()},setPoints:function(t){return this._points=t,this.updateData()},setInnerRadius:function(t){return this._innerRadius=t,this.updateData()},setOuterRadius:function(t){return this._outerRadius=t,this.updateData()},points:{get:function(){return this._points},set:function(t){this._points=t,this.updateData()}},innerRadius:{get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this.updateData()}},outerRadius:{get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this.updateData()}},updateData:function(){var t=[],e=this._points,i=this._innerRadius,s=this._outerRadius,r=Math.PI/2*3,a=Math.PI/e,o=s,h=s;t.push(o,h+-s);for(var l=0;l=this.size||this.bufferUpdateSegments===this.MAX_BUFFER_UPDATE_SEGMENTS_FULL)){var e=Math.floor(t/this.bufferUpdateSegmentSize);this.bufferUpdateSegments|=1<=this.size)return this;var e=this.submitterNode.instanceBufferLayout,i=e.buffer.viewF32,s=this.memberCount*e.layout.stride;return i.set(t,s/i.BYTES_PER_ELEMENT),this.setSegmentNeedsUpdate(this.memberCount),this.memberCount++,this},addMember:function(t){if(this.memberCount>=this.size)return this;var e=this.nextMemberF32,i=this.nextMemberU32;t||(t={});var s=this.frame;if(void 0!==t.frame&&(s=t.frame.base?t.frame.base:t.frame),"string"==typeof s&&!(s=this.texture.get(s)))return this;var r=0;this._setAnimatedValue(t.x,r),r+=4,this._setAnimatedValue(t.y,r),r+=4,this._setAnimatedValue(t.rotation,r),r+=4,this._setAnimatedValue(t.scaleX,r,1),r+=4,this._setAnimatedValue(t.scaleY,r,1),r+=4,this._setAnimatedValue(t.alpha,r,1),r+=4;var n=t.animation;if(n){var a;if("string"==typeof n||"number"==typeof n)a="string"==typeof n?this.animationDataNames[n]:this.animationDataIndices[n],this._setAnimatedValue({base:a.index,amplitude:a.frameCount,duration:a.duration,ease:h.Linear,yoyo:!1},r);else{var o=n.base;a="string"==typeof o?this.animationDataNames[o]:"number"==typeof o?this.animationDataIndices[o]:this.animationData[0],this._setAnimatedValue({base:a.index,amplitude:"number"==typeof n.amplitude?n.amplitude:a.frameCount,duration:n.duration||a.duration,delay:n.delay||0,ease:n.ease||h.Linear,yoyo:!!n.yoyo},r)}}else{var l=this.frameDataIndices[s.name],u=t.frame;u&&void 0!==u.base?this._setAnimatedValue({base:l,amplitude:u.amplitude,duration:u.duration,delay:u.delay,ease:u.ease,yoyo:u.yoyo},r):this._setAnimatedValue(l,r)}r+=4,this._setAnimatedValue(t.tintBlend,r,1),r+=4;var c=void 0===t.tintBottomLeft?16777215:t.tintBottomLeft,f=void 0===t.tintTopLeft?16777215:t.tintTopLeft,p=void 0===t.tintBottomRight?16777215:t.tintBottomRight,m=void 0===t.tintTopRight?16777215:t.tintTopRight,g=void 0===t.alphaBottomLeft?1:t.alphaBottomLeft,v=void 0===t.alphaTopLeft?1:t.alphaTopLeft,x=void 0===t.alphaBottomRight?1:t.alphaBottomRight,y=void 0===t.alphaTopRight?1:t.alphaTopRight;return i[r++]=d(c,g),i[r++]=d(f,v),i[r++]=d(p,x),i[r++]=d(m,y),e[r++]=void 0===t.originX?.5:t.originX,e[r++]=void 0===t.originY?.5:t.originY,e[r++]=t.tintMode||0,e[r++]=void 0===t.creationTime?this.timeElapsed:t.creationTime,e[r++]=void 0===t.scrollFactorX?1:t.scrollFactorX,e[r++]=void 0===t.scrollFactorY?1:t.scrollFactorY,this.addData(this.nextMemberF32),this},editMember:function(t,e){if(t<0||t>=this.memberCount)return this;var i=this.memberCount;return this.memberCount=t,this.addMember(e),this.memberCount=i,this},patchMember:function(t,e,i){if(!(t<0||t>=this.memberCount)){var s=this.submitterNode.instanceBufferLayout,r=s.buffer,n=t*s.layout.stride,a=r.viewU32,o=n/4;if(i)for(var h=0;h=this.memberCount)return null;var e=this.submitterNode.instanceBufferLayout,i=e.buffer,s=t*e.layout.stride,r=i.viewF32,n=i.viewU32,a={},o=s/r.BYTES_PER_ELEMENT;a.x=this._getAnimatedValue(o),o+=4,a.y=this._getAnimatedValue(o),o+=4,a.rotation=this._getAnimatedValue(o),o+=4,a.scaleX=this._getAnimatedValue(o),o+=4,a.scaleY=this._getAnimatedValue(o),o+=4,a.alpha=this._getAnimatedValue(o),o+=4;var h=this._getAnimatedValue(o);o+=4,"number"!=typeof h&&(h=h.base);var l=this.frameDataIndicesInv[h];if(void 0===l){var u=this.animationDataIndices[h];u&&(a.animation=u.name)}else a.frame=l;return a.tintBlend=this._getAnimatedValue(o),o+=4,a.tintBottomLeft=n[o++],a.tintTopLeft=n[o++],a.tintBottomRight=n[o++],a.tintTopRight=n[o++],a.alphaBottomLeft=(a.tintBottomLeft>>>24)/255,a.alphaTopLeft=(a.tintTopLeft>>>24)/255,a.alphaBottomRight=(a.tintBottomRight>>>24)/255,a.alphaTopRight=(a.tintTopRight>>>24)/255,a.tintBottomLeft&=16777215,a.tintTopLeft&=16777215,a.tintBottomRight&=16777215,a.tintTopRight&=16777215,a.originX=r[o++],a.originY=r[o++],a.tintMode=r[o++],a.creationTime=r[o++],a.scrollFactorX=r[o++],a.scrollFactorY=r[o++],a},getMemberData:function(t,e){if(t<0||t>=this.memberCount)return null;var i=this.submitterNode.instanceBufferLayout,s=i.buffer,r=i.layout.stride,n=t*r;e||(e=this.nextMemberU32);var a=s.viewU32,o=a.BYTES_PER_ELEMENT;return e.set(a.subarray(n/o,n/o+r/o)),e},removeMembers:function(t,e){if(t<0||t>=this.memberCount)return this;void 0===e&&(e=1),e=Math.min(e,this.memberCount-t);var i=this.submitterNode.instanceBufferLayout,s=i.layout.stride,r=t*s,n=e*s,a=i.buffer.viewU8;a.set(a.subarray(r+n),r);for(var o=t;othis.memberCount)return this;Array.isArray(e)||(e=[e]);var i=this.memberCount,s=this.submitterNode.instanceBufferLayout,r=s.layout.stride,n=t*r,a=e.length*r;s.buffer.viewU8.copyWithin(n+a,n,i*r),this.memberCount=t;for(var o=0;othis.memberCount)return this;var i=e.length*e.BYTES_PER_ELEMENT,s=this.submitterNode.instanceBufferLayout,r=s.layout.stride,n=t*r;s.buffer.viewU8.copyWithin(n+i,n,this.memberCount*r),s.buffer.viewU32.set(e,n/e.BYTES_PER_ELEMENT),this.memberCount=Math.min(this.size,this.memberCount+i/r);for(var a=t;a=1?p=0:p<-1&&(p=-.999),p=(p+1)/2,a=Math.floor(f)+p}(l=o>0?l/o%2:0)<0&&(l+=2),l/=2,l+=n,u&&(o=-o),d||(l=-l),s[e++]=r,s[e++]=a,s[e++]=o,s[e]=l}},_getAnimatedValue:function(t){var e=this.submitterNode.instanceBufferLayout.buffer.viewF32,i=e[t++],s=e[t++],r=e[t++],n=e[t];if(0===s||0===r||0===o)return i;n>0||(n=-n);var a=r<0;a&&(r=-r);var o=Math.floor(n);if(n=(n-=o)*r*2%r,o===h.Gravity){var l=Math.floor(s),u=2*(s-l)-1;return 0===u&&(u=1),{base:i,ease:o,duration:r,delay:n,yoyo:a,velocity:l,gravityFactor:u}}return{base:i,ease:o,amplitude:s,duration:r,delay:n,yoyo:a}},setAnimationEnabled:function(t,e){return this._animationsEnabled[t]=!!e,this},preDestroy:function(){this.frameDataTexture.destroy()}});t.exports=c},16193(t,e,i){var s=i(10312),r=i(44603),n=i(23568),a=i(76573);r.register("spriteGPULayer",function(t,e){void 0===t&&(t={});var i=n(t,"key",null),r=n(t,"size",1),o=new a(this.scene,i,r);return void 0!==e&&(t.add=e),o.alpha=n(t,"alpha",1),o.blendMode=n(t,"blendMode",s.NORMAL),o.visible=n(t,"visible",!0),e&&this.scene.sys.displayList.add(o),o})},96019(t,e,i){var s=i(76573);i(39429).register("spriteGPULayer",function(t,e){return this.displayList.add(new s(this.scene,t,e))})},71238(t,e,i){var s=i(29747),r=i(97591),n=s;t.exports={renderWebGL:r,renderCanvas:n}},97591(t){t.exports=function(t,e,i,s){i.camera.addToRenderList(e);var r=e.customRenderNodes,n=e.defaultRenderNodes;(r.Submitter||n.Submitter).run(i)}},14727(t,e,i){var s=i(78705),r=i(83419),n=i(88571),a=i(74759),o=new r({Extends:n,Mixins:[a],initialize:function(t,e,i,s,r){n.call(this,t,e,i,s,r),this.type="Stamp"},_defaultRenderNodesMap:{get:function(){return s}}});t.exports=o},656(t,e,i){var s=new(i(61340));t.exports=function(t,e,i){i.addToRenderList(e),s.copyFrom(i.matrix),i.matrix.loadIdentity();var r=i.scrollX,n=i.scrollY;i.scrollX=0,i.scrollY=0,t.batchSprite(e,e.frame,i),i.scrollX=r,i.scrollY=n,i.matrix.copyFrom(s)}},31479(t,e,i){var s=i(25305),r=i(44603),n=i(23568),a=i(14727);r.register("stamp",function(t,e){void 0===t&&(t={});var i=n(t,"key",null),r=n(t,"frame",null),o=new a(this.scene,0,0,i,r);return void 0!==e&&(t.add=e),s(this.scene,o,t),o})},85326(t,e,i){var s=i(14727);i(39429).register("stamp",function(t,e,i,r){return this.displayList.add(new s(this.scene,t,e,i,r))})},74759(t,e,i){var s=i(29747);s=i(656),t.exports={renderCanvas:s}},14220(t){t.exports=function(t,e,i){var s=t.canvas,r=t.context,n=t.style,a=[],o=0,h=i.length;n.maxLines>0&&n.maxLines1&&(d+=l*(c.length-1))}n.wordWrap&&(d-=r.measureText(" ").width),a[u]=Math.ceil(d),o=Math.max(o,a[u])}var p=e.fontSize+n.strokeThickness,m=p*h,g=t.lineSpacing;return h>1&&(m+=g*(h-1)),{width:o,height:m,lines:h,lineWidths:a,lineSpacing:g,lineHeight:p}}},79557(t,e,i){var s=i(27919);t.exports=function(t){var e=s.create(this),i=e.getContext("2d",{willReadFrequently:!0});t.syncFont(e,i);var r=i.measureText(t.testString);if("actualBoundingBoxAscent"in r){var n=r.actualBoundingBoxAscent,a=r.actualBoundingBoxDescent;return s.remove(e),{ascent:n,descent:a,fontSize:n+a}}var o=Math.ceil(r.width*t.baselineX),h=o,l=2*h;h=h*t.baselineY|0,e.width=o,e.height=l,i.fillStyle="#f00",i.fillRect(0,0,o,l),i.font=t._font,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(t.testString,0,h);var u={ascent:0,descent:0,fontSize:0},d=i.getImageData(0,0,o,l);if(!d)return u.ascent=h,u.descent=h+6,u.fontSize=u.ascent+u.descent,s.remove(e),u;var c,f,p=d.data,m=p.length,g=4*o,v=0,x=!1;for(c=0;ch;c--){for(f=0;fu){if(0===c){for(var v=p;v.length;){var x=(v=v.slice(0,-1)).length*this.letterSpacing;if((g=e.measureText(v).width+x)<=u)break}if(!v.length)throw new Error("wordWrapWidth < a single character");var y=f.substr(v.length);d[c]=y,h+=v}var T=d[c].length?c:c+1,w=d.slice(T).join(" ").replace(/[ \n]*$/gi,"");r.splice(a+1,0,w),n=r.length;break}h+=p,u-=g}s+=h.replace(/[ \n]*$/gi,"")+"\n"}}return s=s.replace(/[\s|\n]*$/gi,"")},basicWordWrap:function(t,e,i){for(var s="",r=t.split(this.splitRegExp),n=r.length-1,a=e.measureText(" ").width,o=0;o<=n;o++){for(var h=i,l=r[o].split(" "),u=l.length-1,d=0;d<=u;d++){var c=l[d],f=c.length*this.letterSpacing,p=e.measureText(c).width+f,m=p;dh&&d>0&&(s+="\n",h=i),s+=c,d0&&(c+=h.lineSpacing*m),i.rtl)d=f-d-u.left-u.right;else if("right"===i.align)d+=a-h.lineWidths[m];else if("center"===i.align)d+=(a-h.lineWidths[m])/2;else if("justify"===i.align){if(h.lineWidths[m]/h.width>=.85){var g=h.width-h.lineWidths[m],v=e.measureText(" ").width,x=o[m].trim(),y=x.split(" ");g+=(o[m].length-x.length)*v;for(var T=Math.floor(g/v),w=0;T>0;)y[w]+=" ",w=(w+1)%(y.length-1||1),--T;o[m]=y.join(" ")}}this.autoRound&&(d=Math.round(d),c=Math.round(c));var S=this.letterSpacing;if(i.strokeThickness&&0===S&&(i.syncShadow(e,i.shadowStroke),e.strokeText(o[m],d,c)),i.color)if(i.syncShadow(e,i.shadowFill),0!==S)for(var b=0,E=o[m].split(""),C=0;C2?a[o++]:"",s=a[o++]||"16px",i=a[o++]||"Courier"}return i===this.fontFamily&&s===this.fontSize&&r===this.fontStyle||(this.fontFamily=i,this.fontSize=s,this.fontStyle=r,e&&this.update(!0)),this.parent},setFontFamily:function(t){return this.fontFamily!==t&&(this.fontFamily=t,this.update(!0)),this.parent},setFontStyle:function(t){return this.fontStyle!==t&&(this.fontStyle=t,this.update(!0)),this.parent},setFontSize:function(t){return"number"==typeof t&&(t=t.toString()+"px"),this.fontSize!==t&&(this.fontSize=t,this.update(!0)),this.parent},setTestString:function(t){return this.testString=t,this.update(!0)},setFixedSize:function(t,e){return this.fixedWidth=t,this.fixedHeight=e,t&&(this.parent.width=t),e&&(this.parent.height=e),this.update(!1)},setBackgroundColor:function(t){return this.backgroundColor=t,this.update(!1)},setFill:function(t){return this.color=t,this.update(!1)},setColor:function(t){return this.color=t,this.update(!1)},setResolution:function(t){return this.resolution=t,this.update(!1)},setStroke:function(t,e){return void 0===e&&(e=this.strokeThickness),void 0===t&&0!==this.strokeThickness?(this.strokeThickness=0,this.update(!0)):this.stroke===t&&this.strokeThickness===e||(this.stroke=t,this.strokeThickness=e,this.update(!0)),this.parent},setShadow:function(t,e,i,s,r,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i="#000"),void 0===s&&(s=0),void 0===r&&(r=!1),void 0===n&&(n=!0),this.shadowOffsetX=t,this.shadowOffsetY=e,this.shadowColor=i,this.shadowBlur=s,this.shadowStroke=r,this.shadowFill=n,this.update(!1)},setShadowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.shadowOffsetX=t,this.shadowOffsetY=e,this.update(!1)},setShadowColor:function(t){return void 0===t&&(t="#000"),this.shadowColor=t,this.update(!1)},setShadowBlur:function(t){return void 0===t&&(t=0),this.shadowBlur=t,this.update(!1)},setShadowStroke:function(t){return this.shadowStroke=t,this.update(!1)},setShadowFill:function(t){return this.shadowFill=t,this.update(!1)},setWordWrapWidth:function(t,e){return void 0===e&&(e=!1),this.wordWrapWidth=t,this.wordWrapUseAdvanced=e,this.update(!1)},setWordWrapCallback:function(t,e){return void 0===e&&(e=null),this.wordWrapCallback=t,this.wordWrapCallbackScope=e,this.update(!1)},setAlign:function(t){return void 0===t&&(t="left"),this.align=t,this.update(!1)},setMaxLines:function(t){return void 0===t&&(t=0),this.maxLines=t,this.update(!1)},getTextMetrics:function(){var t=this.metrics;return{ascent:t.ascent,descent:t.descent,fontSize:t.fontSize}},toJSON:function(){var t={};for(var e in o)t[e]=this[e];return t.metrics=this.getTextMetrics(),t},destroy:function(){this.parent=void 0}});t.exports=h},34397(t){t.exports=function(t,e,i,s){if(0!==e.width&&0!==e.height){i.camera.addToRenderList(e);var r=e.customRenderNodes,n=e.defaultRenderNodes;(r.Submitter||n.Submitter).run(i,e,s,0,r.Texturer||n.Texturer,r.Transformer||n.Transformer)}}},20839(t,e,i){var s=i(9674),r=i(27919),n=i(41571),a=i(83419),o=i(31401),h=i(95643),l=i(68703),u=i(56295),d=i(45650),c=i(26099),f=new a({Extends:h,Mixins:[o.Alpha,o.BlendMode,o.ComputedSize,o.Depth,o.Flip,o.GetBounds,o.Lighting,o.Mask,o.Origin,o.RenderNodes,o.ScrollFactor,o.Texture,o.Tint,o.Transform,o.Visible,u],initialize:function(t,e,i,n,a,o,l){var u=t.sys.renderer,f=u&&!u.gl;h.call(this,t,"TileSprite");var p=t.sys.textures.get(o).get(l);n=n?Math.floor(n):p.width,a=a?Math.floor(a):p.height,this._tilePosition=new c,this._tileScale=new c(1,1),this._tileRotation=0,this.dirty=!1,this.renderer=u,this.canvas=f?r.create(this,n,a):null,this.context=f?this.canvas.getContext("2d",{willReadFrequently:!1}):null,this._displayTextureKey=d(),this.displayTexture=f?t.sys.textures.addCanvas(this._displayTextureKey,this.canvas):null,this.displayFrame=this.displayTexture?this.displayTexture.get():null,this.currentFrame=null,this.fillCanvas=f?r.create2D(this,p.width,this.displayFrame.height):null,this.fillContext=this.fillCanvas?this.fillCanvas.getContext("2d",{willReadFrequently:!1}):null,this.fillPattern=null,this.anims=new s(this),this.setTexture(o,l),this.setPosition(e,i),this.setSize(n,a),this.setOrigin(.5,.5),this.initRenderNodes(this._defaultRenderNodesMap)},_defaultRenderNodesMap:{get:function(){return n}},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(t,e){this.anims.update(t,e)},setFrame:function(t){var e=this.texture.get(t);return e.cutWidth&&e.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this.frame=e,this.dirty=!0,this},setSizeToFrame:function(){return this},setTilePosition:function(t,e){return void 0!==t&&(this.tilePositionX=t),void 0!==e&&(this.tilePositionY=e),this},setTileRotation:function(t){return void 0===t&&(t=0),this.tileRotation=t,this},setTileScale:function(t,e){return void 0===t&&(t=this.tileScaleX),void 0===e&&(e=t),this.tileScaleX=t,this.tileScaleY=e,this},updateTileTexture:function(){if(this.renderer&&!this.renderer.gl){var t=this.frame,e=this.fillContext,i=this.fillCanvas,s=t.cutWidth,r=t.cutHeight;e.clearRect(0,0,s,r),i.width=s,i.height=r,e.drawImage(t.source.image,t.cutX,t.cutY,t.cutWidth,t.cutHeight,0,0,s,r),this.fillPattern=e.createPattern(i,"repeat"),this.currentFrame=t}},updateCanvas:function(){var t=this.canvas,e=this.width,i=this.height,s=this.currentFrame!==this.frame;if((t.width!==e||t.height!==i||s)&&(t.width=e,t.height=i,this.displayFrame.setSize(e,i),this.updateDisplayOrigin(),s&&this.updateTileTexture(),this.dirty=!0),!this.dirty||this.renderer&&this.renderer.gl)this.dirty=!1;else{var r=this.context;this.scene.sys.game.config.antialias||l.disable(r);var n=this._tileScale.x,a=this._tileScale.y,o=this._tilePosition.x,h=this._tilePosition.y;r.clearRect(0,0,e,i),r.save(),r.rotate(this._tileRotation),r.scale(n,a),r.translate(-o,-h),r.fillStyle=this.fillPattern;var u=Math.max(e,Math.abs(e/n)),d=Math.max(i,Math.abs(i/a)),c=Math.sqrt(u*u+d*d);r.fillRect(o-c,h-c,2*c,2*c),r.restore(),this.dirty=!1}},setSize:function(t,e){this.width=t,this.height=e,this.updateDisplayOrigin();var i=this.input;return i&&!i.customHitArea&&(i.hitArea.width=t,i.hitArea.height=e),this},preDestroy:function(){this.canvas&&r.remove(this.canvas),this.fillCanvas&&r.remove(this.fillCanvas),this.fillPattern=null,this.fillContext=null,this.fillCanvas=null,this.displayTexture=null,this.displayFrame=null,this.renderer=null,this.anims.destroy(),this.anims=void 0},tilePositionX:{get:function(){return this._tilePosition.x},set:function(t){this._tilePosition.x=t,this.dirty=!0}},tilePositionY:{get:function(){return this._tilePosition.y},set:function(t){this._tilePosition.y=t,this.dirty=!0}},tileRotation:{get:function(){return this._tileRotation},set:function(t){this._tileRotation=t,this.dirty=!0}},tileScaleX:{get:function(){return this._tileScale.x},set:function(t){this._tileScale.x=t,this.dirty=!0}},tileScaleY:{get:function(){return this._tileScale.y},set:function(t){this._tileScale.y=t,this.dirty=!0}}});t.exports=f},46992(t){t.exports=function(t,e,i,s){e.updateCanvas(),i.addToRenderList(e),t.batchSprite(e,e.displayFrame,i,s)}},14167(t,e,i){var s=i(25305),r=i(44603),n=i(23568),a=i(20839);r.register("tileSprite",function(t,e){void 0===t&&(t={});var i=n(t,"x",0),r=n(t,"y",0),o=n(t,"width",512),h=n(t,"height",512),l=n(t,"key",""),u=n(t,"frame",""),d=new a(this.scene,i,r,o,h,l,u);return void 0!==e&&(t.add=e),s(this.scene,d,t),d})},91681(t,e,i){var s=i(20839);i(39429).register("tileSprite",function(t,e,i,r,n,a){return this.displayList.add(new s(this.scene,t,e,i,r,n,a))})},56295(t,e,i){var s=i(29747),r=s,n=s;r=i(18553),n=i(46992),t.exports={renderWebGL:r,renderCanvas:n}},18553(t){t.exports=function(t,e,i,s){var r=e.width,n=e.height;if(0!==r&&0!==n){i.camera.addToRenderList(e);var a=e.customRenderNodes,o=e.defaultRenderNodes;(a.Submitter||o.Submitter).run(i,e,s,0,a.Texturer||o.Texturer,a.Transformer||o.Transformer)}}},18471(t,e,i){var s=i(45319),r=i(40939),n=i(83419),a=i(31401),o=i(51708),h=i(8443),l=i(95643),u=i(36383),d=i(14463),c=i(45650),f=i(10247),p=new n({Extends:l,Mixins:[a.Alpha,a.BlendMode,a.ComputedSize,a.Depth,a.Flip,a.GetBounds,a.Lighting,a.Mask,a.Origin,a.RenderNodes,a.ScrollFactor,a.TextureCrop,a.Tint,a.Transform,a.Visible,f],initialize:function(t,e,i,s){l.call(this,t,"Video"),this.video,this.videoTexture,this.videoTextureSource,this.snapshotTexture,this.glFlipY=!0,this._key=c(),this.touchLocked=!1,this.playWhenUnlocked=!1,this.frameReady=!1,this.isStalled=!1,this.failedPlayAttempts=0,this.metadata,this.retry=0,this.retryInterval=500,this._systemMuted=!1,this._codeMuted=!1,this._systemPaused=!1,this._codePaused=!1,this._callbacks={ended:this.completeHandler.bind(this),legacy:this.legacyPlayHandler.bind(this),playing:this.playingHandler.bind(this),seeked:this.seekedHandler.bind(this),seeking:this.seekingHandler.bind(this),stalled:this.stalledHandler.bind(this),suspend:this.stalledHandler.bind(this),waiting:this.stalledHandler.bind(this)},this._loadCallbackHandler=this.loadErrorHandler.bind(this),this._metadataCallbackHandler=this.metadataHandler.bind(this),this._crop=this.resetCropObject(),this.markers={},this._markerIn=0,this._markerOut=0,this._playingMarker=!1,this._lastUpdate=0,this.cacheKey="",this.isSeeking=!1,this._playCalled=!1,this._getFrame=!1,this._rfvCallbackId=0;var r=t.sys.game;this._device=r.device.video,this.setPosition(e,i),this.setSize(256,256),this.initRenderNodes(this._defaultRenderNodesMap),r.events.on(h.PAUSE,this.globalPause,this),r.events.on(h.RESUME,this.globalResume,this);var n=t.sys.sound;n&&n.on(d.GLOBAL_MUTE,this.globalMute,this),s&&this.load(s)},_defaultRenderNodesMap:{get:function(){return r}},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},load:function(t){var e=this.scene.sys.cache.video.get(t);return e?(this.cacheKey=t,this.loadHandler(e.url,e.noAudio,e.crossOrigin)):console.warn("No video in cache for key: "+t),this},changeSource:function(t,e,i,s,r){void 0===e&&(e=!0),void 0===i&&(i=!1),this.cacheKey!==t&&(this.load(t),e&&this.play(i,s,r))},getVideoKey:function(){return this.cacheKey},loadURL:function(t,e,i){void 0===e&&(e=!1);var s=this._device.getVideoURL(t);return s?(this.cacheKey="",this.loadHandler(s.url,e,i)):console.warn("No supported video format found for "+t),this},loadMediaStream:function(t,e,i){return this.loadHandler(null,e,i,t)},loadHandler:function(t,e,i,s){e||(e=!1);var r=this.video;if(r?(this.removeLoadEventHandlers(),this.stop()):((r=document.createElement("video")).controls=!1,r.setAttribute("playsinline","playsinline"),r.setAttribute("preload","auto"),r.setAttribute("disablePictureInPicture","true")),e?(r.muted=!0,r.defaultMuted=!0,r.setAttribute("autoplay","autoplay")):(r.muted=!1,r.defaultMuted=!1,r.removeAttribute("autoplay")),i?r.setAttribute("crossorigin",i):r.removeAttribute("crossorigin"),s)if("srcObject"in r)try{r.srcObject=s}catch(t){if("TypeError"!==t.name)throw t;r.src=URL.createObjectURL(s)}else r.src=URL.createObjectURL(s);else r.src=t;this.retry=0,this.video=r,this._playCalled=!1,r.load(),this.addLoadEventHandlers();var n=this.scene.sys.textures.get(this._key);return this.setTexture(n),this},requestVideoFrame:function(t,e){var i=this.video;if(i){var s=e.width,r=e.height,n=this.videoTexture,a=this.videoTextureSource,h=!n||a.source!==i;h?(this._codePaused=i.paused,this._codeMuted=i.muted,n?(a.source=i,a.width=s,a.height=r,n.get().setSize(s,r)):((n=this.scene.sys.textures.create(this._key,i,s,r)).add("__BASE",0,0,0,s,r),this.setTexture(n),this.videoTexture=n,this.videoTextureSource=n.source[0],this.videoTextureSource.setFlipY(this.glFlipY),this.emit(o.VIDEO_TEXTURE,this,n)),this.setSizeToFrame(),this.updateDisplayOrigin()):a.update(),this.isStalled=!1,this.metadata=e;var l=e.mediaTime;h&&(this._lastUpdate=l,this.emit(o.VIDEO_CREATED,this,s,r),this.frameReady||(this.frameReady=!0,this.emit(o.VIDEO_PLAY,this))),this._playingMarker?l>=this._markerOut&&(i.loop?(i.currentTime=this._markerIn,this.emit(o.VIDEO_LOOP,this)):(this.stop(!1),this.emit(o.VIDEO_COMPLETE,this))):l-1&&i>e&&i=0&&!isNaN(i)&&i>e&&(this.markers[t]=[e,i]),this},playMarker:function(t,e){var i=this.markers[t];return i&&this.play(e,i[0],i[1]),this},removeMarker:function(t){return delete this.markers[t],this},snapshot:function(t,e){return void 0===t&&(t=this.width),void 0===e&&(e=this.height),this.snapshotArea(0,0,this.width,this.height,t,e)},snapshotArea:function(t,e,i,s,r,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===s&&(s=this.height),void 0===r&&(r=i),void 0===n&&(n=s);var a=this.video,o=this.snapshotTexture;return o?(o.setSize(r,n),a&&o.context.drawImage(a,t,e,i,s,0,0,r,n)):(o=this.scene.sys.textures.createCanvas(c(),r,n),this.snapshotTexture=o,a&&o.context.drawImage(a,t,e,i,s,0,0,r,n)),o.update()},saveSnapshotTexture:function(t){return this.snapshotTexture?this.scene.sys.textures.renameTexture(this.snapshotTexture.key,t):this.snapshotTexture=this.scene.sys.textures.createCanvas(t,this.width,this.height),this.snapshotTexture},playSuccess:function(){if(this._playCalled){this.addEventHandlers(),this._codePaused=!1,this.touchLocked&&(this.touchLocked=!1,this.emit(o.VIDEO_UNLOCKED,this));var t=this.scene.sys.sound;t&&t.mute&&this.setMute(!0),this._markerIn>-1&&(this.video.currentTime=this._markerIn)}},playError:function(t){var e=t.name;"NotAllowedError"===e?(this.touchLocked=!0,this.playWhenUnlocked=!0,this.failedPlayAttempts=1,this.emit(o.VIDEO_LOCKED,this)):"NotSupportedError"===e?(this.stop(!1),this.emit(o.VIDEO_UNSUPPORTED,this,t)):(this.stop(!1),this.emit(o.VIDEO_ERROR,this,t))},legacyPlayHandler:function(){var t=this.video;t&&(this.playSuccess(),t.removeEventListener("playing",this._callbacks.legacy))},playingHandler:function(){this.isStalled=!1,this.emit(o.VIDEO_PLAYING,this)},loadErrorHandler:function(t){this.stop(!1),this.emit(o.VIDEO_ERROR,this,t)},metadataHandler:function(t){this.emit(o.VIDEO_METADATA,this,t)},setSizeToFrame:function(t){t||(t=this.frame),this.width=t.realWidth,this.height=t.realHeight,1!==this.scaleX&&(this.scaleX=this.displayWidth/this.width),1!==this.scaleY&&(this.scaleY=this.displayHeight/this.height);var e=this.input;return e&&!e.customHitArea&&(e.hitArea.width=this.width,e.hitArea.height=this.height),this},stalledHandler:function(t){this.isStalled=!0,this.emit(o.VIDEO_STALLED,this,t)},completeHandler:function(){this._playCalled=!1,this.emit(o.VIDEO_COMPLETE,this)},preUpdate:function(t,e){this.video&&this._playCalled&&this.touchLocked&&this.playWhenUnlocked&&(this.retry+=e,this.retry>=this.retryInterval&&(this.createPlayPromise(!1),this.retry=0))},seekTo:function(t){var e=this.video;if(e){var i=e.duration;if(i!==1/0&&!isNaN(i)){var s=i*t;this.setCurrentTime(s)}}return this},getCurrentTime:function(){return this.video?this.video.currentTime:0},setCurrentTime:function(t){var e=this.video;if(e){if("string"==typeof t){var i=t[0],s=parseFloat(t.substr(1));"+"===i?t=e.currentTime+s:"-"===i&&(t=e.currentTime-s)}e.currentTime=t}return this},seekingHandler:function(){this.isSeeking=!0,this.emit(o.VIDEO_SEEKING,this)},seekedHandler:function(){this.isSeeking=!1,this.emit(o.VIDEO_SEEKED,this)},getProgress:function(){var t=this.video;if(t){var e=t.duration;if(e!==1/0&&!isNaN(e))return t.currentTime/e}return-1},getDuration:function(){return this.video?this.video.duration:0},setMute:function(t){void 0===t&&(t=!0),this._codeMuted=t;var e=this.video;return e&&(e.muted=!!this._systemMuted||t),this},isMuted:function(){return this._codeMuted},globalMute:function(t,e){this._systemMuted=e;var i=this.video;i&&(i.muted=!!this._codeMuted||e)},globalPause:function(){this._systemPaused=!0,this.video&&!this.video.ended&&(this.removeEventHandlers(),this.video.pause())},globalResume:function(){this._systemPaused=!1,!this.video||this._codePaused||this.video.ended||this.createPlayPromise()},setPaused:function(t){void 0===t&&(t=!0);var e=this.video;return this._codePaused=t,e&&!e.ended&&(t?e.paused||(this.removeEventHandlers(),e.pause()):t||(this._playCalled?e.paused&&!this._systemPaused&&this.createPlayPromise():this.play())),this},pause:function(){return this.setPaused(!0)},resume:function(){return this.setPaused(!1)},getVolume:function(){return this.video?this.video.volume:1},setVolume:function(t){return void 0===t&&(t=1),this.video&&(this.video.volume=s(t,0,1)),this},getPlaybackRate:function(){return this.video?this.video.playbackRate:1},setPlaybackRate:function(t){return this.video&&(this.video.playbackRate=t),this},getLoop:function(){return!!this.video&&this.video.loop},setLoop:function(t){return void 0===t&&(t=!0),this.video&&(this.video.loop=t),this},isPlaying:function(){return!!this.video&&!(this.video.paused||this.video.ended)},isPaused:function(){return this.video&&this._playCalled&&this.video.paused||this._codePaused||this._systemPaused},saveTexture:function(t,e){return void 0===e&&(e=!0),this.videoTexture&&(this.scene.sys.textures.renameTexture(this._key,t),this.videoTextureSource.setFlipY(e)),this._key=t,this.glFlipY=e,!!this.videoTexture},stop:function(t){void 0===t&&(t=!0);var e=this.video;return e&&(this.removeEventHandlers(),e.cancelVideoFrameCallback(this._rfvCallbackId),e.pause()),this.retry=0,this._playCalled=!1,t&&this.emit(o.VIDEO_STOP,this),this},removeVideoElement:function(){var t=this.video;if(t){for(t.parentNode&&t.parentNode.removeChild(t);t.hasChildNodes();)t.removeChild(t.firstChild);t.removeAttribute("autoplay"),t.removeAttribute("src"),this.video=null}},preDestroy:function(){this.stop(!1),this.removeLoadEventHandlers(),this.removeVideoElement();var t=this.scene.sys.game.events;t.off(h.PAUSE,this.globalPause,this),t.off(h.RESUME,this.globalResume,this);var e=this.scene.sys.sound;e&&e.off(d.GLOBAL_MUTE,this.globalMute,this)}});t.exports=p},58352(t){t.exports=function(t,e,i,s){e.videoTexture&&(i.addToRenderList(e),t.batchSprite(e,e.frame,i,s))}},11511(t,e,i){var s=i(25305),r=i(44603),n=i(23568),a=i(18471);r.register("video",function(t,e){void 0===t&&(t={});var i=n(t,"key",null),r=new a(this.scene,0,0,i);return void 0!==e&&(t.add=e),s(this.scene,r,t),r})},89025(t,e,i){var s=i(18471);i(39429).register("video",function(t,e,i){return this.displayList.add(new s(this.scene,t,e,i))})},10247(t,e,i){var s=i(29747),r=s,n=s;r=i(29849),n=i(58352),t.exports={renderWebGL:r,renderCanvas:n}},29849(t){t.exports=function(t,e,i,s){if(e.videoTexture){i.camera.addToRenderList(e);var r=e.customRenderNodes,n=e.defaultRenderNodes;(r.Submitter||n.Submitter).run(i,e,s,0,r.Texturer||n.Texturer,r.Transformer||n.Transformer)}}},41481(t,e,i){var s=i(10312),r=i(96503),n=i(87902),a=i(83419),o=i(31401),h=i(95643),l=i(87841),u=i(37303),d=new a({Extends:h,Mixins:[o.Depth,o.GetBounds,o.Origin,o.Transform,o.ScrollFactor,o.Visible],initialize:function(t,e,i,r,n){void 0===r&&(r=1),void 0===n&&(n=r),h.call(this,t,"Zone"),this.setPosition(e,i),this.width=r,this.height=n,this.blendMode=s.NORMAL,this.updateDisplayOrigin()},displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e,i){void 0===i&&(i=!0),this.width=t,this.height=e,this.updateDisplayOrigin();var s=this.input;return i&&s&&!s.customHitArea&&(s.hitArea.width=t,s.hitArea.height=e),this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this},setCircleDropZone:function(t){return this.setDropZone(new r(0,0,t),n)},setRectangleDropZone:function(t,e){return this.setDropZone(new l(0,0,t,e),u)},setDropZone:function(t,e){return this.input||this.setInteractive(t,e,!0),this},setAlpha:function(){},setBlendMode:function(){},renderCanvas:function(t,e,i){i.addToRenderList(e)},renderWebGL:function(t,e,i){i.camera.addToRenderList(e)}});t.exports=d},95261(t,e,i){var s=i(44603),r=i(23568),n=i(41481);s.register("zone",function(t){var e=r(t,"x",0),i=r(t,"y",0),s=r(t,"width",1),a=r(t,"height",s);return new n(this.scene,e,i,s,a)})},84175(t,e,i){var s=i(41481);i(39429).register("zone",function(t,e,i,r){return this.displayList.add(new s(this.scene,t,e,i,r))})},95166(t){t.exports=function(t){return t.radius>0?Math.PI*t.radius*t.radius:0}},96503(t,e,i){var s=i(83419),r=i(87902),n=i(26241),a=i(79124),o=i(23777),h=i(28176),l=new s({initialize:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this.type=o.CIRCLE,this.x=t,this.y=e,this._radius=i,this._diameter=2*i},contains:function(t,e){return r(this,t,e)},getPoint:function(t,e){return n(this,t,e)},getPoints:function(t,e,i){return a(this,t,e,i)},getRandomPoint:function(t){return h(this,t)},setTo:function(t,e,i){return this.x=t,this.y=e,this._radius=i,this._diameter=2*i,this},setEmpty:function(){return this._radius=0,this._diameter=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},isEmpty:function(){return this._radius<=0},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this._diameter=2*t}},diameter:{get:function(){return this._diameter},set:function(t){this._diameter=t,this._radius=.5*t}},left:{get:function(){return this.x-this._radius},set:function(t){this.x=t+this._radius}},right:{get:function(){return this.x+this._radius},set:function(t){this.x=t-this._radius}},top:{get:function(){return this.y-this._radius},set:function(t){this.y=t+this._radius}},bottom:{get:function(){return this.y+this._radius},set:function(t){this.y=t-this._radius}}});t.exports=l},71562(t){t.exports=function(t){return Math.PI*t.radius*2}},92110(t,e,i){var s=i(26099);t.exports=function(t,e,i){return void 0===i&&(i=new s),i.x=t.x+t.radius*Math.cos(e),i.y=t.y+t.radius*Math.sin(e),i}},42250(t,e,i){var s=i(96503);t.exports=function(t){return new s(t.x,t.y,t.radius)}},87902(t){t.exports=function(t,e,i){return t.radius>0&&e>=t.left&&e<=t.right&&i>=t.top&&i<=t.bottom&&(t.x-e)*(t.x-e)+(t.y-i)*(t.y-i)<=t.radius*t.radius}},5698(t,e,i){var s=i(87902);t.exports=function(t,e){return s(t,e.x,e.y)}},70588(t,e,i){var s=i(87902);t.exports=function(t,e){return s(t,e.x,e.y)&&s(t,e.right,e.y)&&s(t,e.x,e.bottom)&&s(t,e.right,e.bottom)}},26394(t){t.exports=function(t,e){return e.setTo(t.x,t.y,t.radius)}},76278(t){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.radius===e.radius}},2074(t,e,i){var s=i(87841);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.left,e.y=t.top,e.width=t.diameter,e.height=t.diameter,e}},26241(t,e,i){var s=i(92110),r=i(62945),n=i(36383),a=i(26099);t.exports=function(t,e,i){void 0===i&&(i=new a);var o=r(e,0,n.TAU);return s(t,o,i)}},79124(t,e,i){var s=i(71562),r=i(92110),n=i(62945),a=i(36383);t.exports=function(t,e,i,o){void 0===o&&(o=[]),!e&&i>0&&(e=s(t)/i);for(var h=0;h1?2-r:r,a=n*Math.cos(i),o=n*Math.sin(i);return e.x=t.x+a*t.radius,e.y=t.y+o*t.radius,e}},88911(t,e,i){var s=i(96503);s.Area=i(95166),s.Circumference=i(71562),s.CircumferencePoint=i(92110),s.Clone=i(42250),s.Contains=i(87902),s.ContainsPoint=i(5698),s.ContainsRect=i(70588),s.CopyFrom=i(26394),s.Equals=i(76278),s.GetBounds=i(2074),s.GetPoint=i(26241),s.GetPoints=i(79124),s.Offset=i(50884),s.OffsetPoint=i(39212),s.Random=i(28176),t.exports=s},23777(t){t.exports={CIRCLE:0,ELLIPSE:1,LINE:2,POINT:3,POLYGON:4,RECTANGLE:5,TRIANGLE:6}},78874(t){t.exports=function(t){return t.isEmpty()?0:t.getMajorRadius()*t.getMinorRadius()*Math.PI}},92990(t){t.exports=function(t){var e=t.width/2,i=t.height/2,s=Math.pow(e-i,2)/Math.pow(e+i,2);return Math.PI*(e+i)*(1+3*s/(10+Math.sqrt(4-3*s)))}},79522(t,e,i){var s=i(26099);t.exports=function(t,e,i){void 0===i&&(i=new s);var r=t.width/2,n=t.height/2;return i.x=t.x+r*Math.cos(e),i.y=t.y+n*Math.sin(e),i}},58102(t,e,i){var s=i(8497);t.exports=function(t){return new s(t.x,t.y,t.width,t.height)}},81154(t){t.exports=function(t,e,i){if(t.width<=0||t.height<=0)return!1;var s=(e-t.x)/t.width,r=(i-t.y)/t.height;return(s*=s)+(r*=r)<.25}},46662(t,e,i){var s=i(81154);t.exports=function(t,e){return s(t,e.x,e.y)}},1632(t,e,i){var s=i(81154);t.exports=function(t,e){return s(t,e.x,e.y)&&s(t,e.right,e.y)&&s(t,e.x,e.bottom)&&s(t,e.right,e.bottom)}},65534(t){t.exports=function(t,e){return e.setTo(t.x,t.y,t.width,t.height)}},8497(t,e,i){var s=i(83419),r=i(81154),n=i(90549),a=i(48320),o=i(23777),h=i(24820),l=new s({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.type=o.ELLIPSE,this.x=t,this.y=e,this.width=i,this.height=s},contains:function(t,e){return r(this,t,e)},getPoint:function(t,e){return n(this,t,e)},getPoints:function(t,e,i){return a(this,t,e,i)},getRandomPoint:function(t){return h(this,t)},setTo:function(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this},setEmpty:function(){return this.width=0,this.height=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getMinorRadius:function(){return Math.min(this.width,this.height)/2},getMajorRadius:function(){return Math.max(this.width,this.height)/2},left:{get:function(){return this.x-this.width/2},set:function(t){this.x=t+this.width/2}},right:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},top:{get:function(){return this.y-this.height/2},set:function(t){this.y=t+this.height/2}},bottom:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=l},36146(t){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}},23694(t,e,i){var s=i(87841);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.left,e.y=t.top,e.width=t.width,e.height=t.height,e}},90549(t,e,i){var s=i(79522),r=i(62945),n=i(36383),a=i(26099);t.exports=function(t,e,i){void 0===i&&(i=new a);var o=r(e,0,n.TAU);return s(t,o,i)}},48320(t,e,i){var s=i(92990),r=i(79522),n=i(62945),a=i(36383);t.exports=function(t,e,i,o){void 0===o&&(o=[]),!e&&i>0&&(e=s(t)/i);for(var h=0;ha||n>o)return!1;if(r<=i||n<=s)return!0;var h=r-i,l=n-s;return h*h+l*l<=t.radius*t.radius}},63376(t,e,i){var s=i(26099),r=i(2044);t.exports=function(t,e,i){if(void 0===i&&(i=[]),r(t,e)){var n,a,o,h,l=t.x,u=t.y,d=t.radius,c=e.x,f=e.y,p=e.radius;if(u===f)0===(o=(a=-2*f)*a-4*(n=1)*(c*c+(h=(p*p-d*d-c*c+l*l)/(2*(l-c)))*h-2*c*h+f*f-p*p))?i.push(new s(h,-a/(2*n))):o>0&&(i.push(new s(h,(-a+Math.sqrt(o))/(2*n))),i.push(new s(h,(-a-Math.sqrt(o))/(2*n))));else{var m=(l-c)/(u-f),g=(p*p-d*d-c*c+l*l-f*f+u*u)/(2*(u-f));0===(o=(a=2*u*m-2*g*m-2*l)*a-4*(n=m*m+1)*(l*l+u*u+g*g-d*d-2*u*g))?(h=-a/(2*n),i.push(new s(h,g-h*m))):o>0&&(h=(-a+Math.sqrt(o))/(2*n),i.push(new s(h,g-h*m)),h=(-a-Math.sqrt(o))/(2*n),i.push(new s(h,g-h*m)))}}return i}},97439(t,e,i){var s=i(4042),r=i(81491);t.exports=function(t,e,i){if(void 0===i&&(i=[]),r(t,e)){var n=e.getLineA(),a=e.getLineB(),o=e.getLineC(),h=e.getLineD();s(n,t,i),s(a,t,i),s(o,t,i),s(h,t,i)}return i}},4042(t,e,i){var s=i(26099),r=i(80462);t.exports=function(t,e,i){if(void 0===i&&(i=[]),r(t,e)){var n,a,o=t.x1,h=t.y1,l=t.x2,u=t.y2,d=e.x,c=e.y,f=e.radius,p=l-o,m=u-h,g=o-d,v=h-c,x=p*p+m*m,y=2*(p*g+m*v),T=y*y-4*x*(g*g+v*v-f*f);if(0===T){var w=-y/(2*x);n=o+w*p,a=h+w*m,w>=0&&w<=1&&i.push(new s(n,a))}else if(T>0){var S=(-y-Math.sqrt(T))/(2*x);n=o+S*p,a=h+S*m,S>=0&&S<=1&&i.push(new s(n,a));var b=(-y+Math.sqrt(T))/(2*x);n=o+b*p,a=h+b*m,b>=0&&b<=1&&i.push(new s(n,a))}}return i}},36100(t,e,i){var s=i(25836);t.exports=function(t,e,i,r){void 0===i&&(i=!1);var n,a,o,h=t.x1,l=t.y1,u=t.x2,d=t.y2,c=e.x1,f=e.y1,p=u-h,m=d-l,g=e.x2-c,v=e.y2-f,x=p*v-m*g;if(0===x)return null;if(i){if(n=(p*(f-l)+m*(h-c))/(g*m-v*p),0!==p)a=(c+g*n-h)/p;else{if(0===m)return null;a=(f+v*n-l)/m}if(a<0||n<0||n>1)return null;o=a}else{if(a=((l-f)*p-(h-c)*m)/x,(n=((c-h)*v-(f-l)*g)/x)<0||n>1||a<0||a>1)return null;o=n}return void 0===r&&(r=new s),r.set(h+p*o,l+m*o,o)}},3073(t,e,i){var s=i(36100),r=i(23031),n=i(25836),a=new r,o=new n;t.exports=function(t,e,i,r){void 0===i&&(i=!1),void 0===r&&(r=new n);var h=!1;r.set(),o.set();for(var l=e[e.length-1],u=0;u0){var c=(o*n+h*a)/l;u*=c,d*=c}return i.x=t.x1+u,i.y=t.y1+d,u*u+d*d<=l&&u*n+d*a>=0&&s(e,i.x,i.y)}},76112(t){t.exports=function(t,e,i){var s=t.x1,r=t.y1,n=t.x2,a=t.y2,o=e.x1,h=e.y1,l=e.x2,u=e.y2;if(s===n&&r===a||o===l&&h===u)return!1;var d=(u-h)*(n-s)-(l-o)*(a-r);if(0===d)return!1;var c=((l-o)*(r-h)-(u-h)*(s-o))/d,f=((n-s)*(r-h)-(a-r)*(s-o))/d;return!(c<0||c>1||f<0||f>1)&&(i&&(i.x=s+c*(n-s),i.y=r+c*(a-r)),!0)}},92773(t){t.exports=function(t,e){var i=t.x1,s=t.y1,r=t.x2,n=t.y2,a=e.x,o=e.y,h=e.right,l=e.bottom,u=0;if(i>=a&&i<=h&&s>=o&&s<=l||r>=a&&r<=h&&n>=o&&n<=l)return!0;if(i=a){if((u=s+(n-s)*(a-i)/(r-i))>o&&u<=l)return!0}else if(i>h&&r<=h&&(u=s+(n-s)*(h-i)/(r-i))>=o&&u<=l)return!0;if(s=o){if((u=i+(r-i)*(o-s)/(n-s))>=a&&u<=h)return!0}else if(s>l&&n<=l&&(u=i+(r-i)*(l-s)/(n-s))>=a&&u<=h)return!0;return!1}},16204(t){t.exports=function(t,e,i){void 0===i&&(i=1);var s=e.x1,r=e.y1,n=e.x2,a=e.y2,o=t.x,h=t.y,l=(n-s)*(n-s)+(a-r)*(a-r);if(0===l)return!1;var u=((o-s)*(n-s)+(h-r)*(a-r))/l;if(u<0)return Math.sqrt((s-o)*(s-o)+(r-h)*(r-h))<=i;if(u>=0&&u<=1){var d=((r-h)*(n-s)-(s-o)*(a-r))/l;return Math.abs(d)*Math.sqrt(l)<=i}return Math.sqrt((n-o)*(n-o)+(a-h)*(a-h))<=i}},14199(t,e,i){var s=i(16204);t.exports=function(t,e){if(!s(t,e))return!1;var i=Math.min(e.x1,e.x2),r=Math.max(e.x1,e.x2),n=Math.min(e.y1,e.y2),a=Math.max(e.y1,e.y2);return t.x>=i&&t.x<=r&&t.y>=n&&t.y<=a}},59996(t){t.exports=function(t,e){return!(t.width<=0||t.height<=0||e.width<=0||e.height<=0)&&!(t.righte.right||t.y>e.bottom)}},89265(t,e,i){var s=i(76112),r=i(37303),n=i(48653),a=i(77493);t.exports=function(t,e){if(e.left>t.right||e.rightt.bottom||e.bottom0}},84411(t){t.exports=function(t,e,i,s,r,n){return void 0===n&&(n=0),!(e>t.right+n||it.bottom+n||re.right||t.righte.bottom||t.bottome.right||t.righte.bottom||t.bottom0||(d=r(e),(c=s(t,d,!0)).length>0)}},91865(t,e,i){t.exports={CircleToCircle:i(2044),CircleToRectangle:i(81491),GetCircleToCircle:i(63376),GetCircleToRectangle:i(97439),GetLineToCircle:i(4042),GetLineToLine:i(36100),GetLineToPoints:i(3073),GetLineToPolygon:i(56362),GetLineToRectangle:i(60646),GetRaysFromPointToPolygon:i(71147),GetRectangleIntersection:i(68389),GetRectangleToRectangle:i(52784),GetRectangleToTriangle:i(26341),GetTriangleToCircle:i(38720),GetTriangleToLine:i(13882),GetTriangleToTriangle:i(75636),LineToCircle:i(80462),LineToLine:i(76112),LineToRectangle:i(92773),PointToLine:i(16204),PointToLineSegment:i(14199),RectangleToRectangle:i(59996),RectangleToTriangle:i(89265),RectangleToValues:i(84411),TriangleToCircle:i(67636),TriangleToLine:i(2822),TriangleToTriangle:i(82944)}},91938(t){t.exports=function(t){return Math.atan2(t.y2-t.y1,t.x2-t.x1)}},84993(t){t.exports=function(t,e,i){void 0===e&&(e=1),void 0===i&&(i=[]);var s=Math.round(t.x1),r=Math.round(t.y1),n=Math.round(t.x2),a=Math.round(t.y2),o=Math.abs(n-s),h=Math.abs(a-r),l=s-h&&(d-=h,s+=l),f0){var v=u[0],x=[v];for(h=1;h=a&&(x.push(y),v=y)}var T=u[u.length-1];return s(v,T)0&&(e=s(t)/i);for(var a=t.x1,o=t.y1,h=t.x2,l=t.y2,u=0;uthis.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=l},64795(t,e,i){var s=i(36383),r=i(15994),n=i(91938);t.exports=function(t){var e=n(t)-s.PI_OVER_2;return r(e,-Math.PI,Math.PI)}},52616(t,e,i){var s=i(36383),r=i(91938);t.exports=function(t){return Math.cos(r(t)-s.PI_OVER_2)}},87231(t,e,i){var s=i(36383),r=i(91938);t.exports=function(t){return Math.sin(r(t)-s.PI_OVER_2)}},89662(t){t.exports=function(t,e,i){return t.x1+=e,t.y1+=i,t.x2+=e,t.y2+=i,t}},71165(t){t.exports=function(t){return-(t.x2-t.x1)/(t.y2-t.y1)}},65822(t,e,i){var s=i(26099);t.exports=function(t,e){void 0===e&&(e=new s);var i=Math.random();return e.x=t.x1+i*(t.x2-t.x1),e.y=t.y1+i*(t.y2-t.y1),e}},69777(t,e,i){var s=i(91938),r=i(64795);t.exports=function(t,e){return 2*r(e)-Math.PI-s(t)}},39706(t,e,i){var s=i(64400);t.exports=function(t,e){var i=(t.x1+t.x2)/2,r=(t.y1+t.y2)/2;return s(t,i,r,e)}},82585(t,e,i){var s=i(64400);t.exports=function(t,e,i){return s(t,e.x,e.y,i)}},64400(t){t.exports=function(t,e,i,s){var r=Math.cos(s),n=Math.sin(s),a=t.x1-e,o=t.y1-i;return t.x1=a*r-o*n+e,t.y1=a*n+o*r+i,a=t.x2-e,o=t.y2-i,t.x2=a*r-o*n+e,t.y2=a*n+o*r+i,t}},62377(t){t.exports=function(t,e,i,s,r){return t.x1=e,t.y1=i,t.x2=e+Math.cos(s)*r,t.y2=i+Math.sin(s)*r,t}},71366(t){t.exports=function(t){return(t.y2-t.y1)/(t.x2-t.x1)}},10809(t){t.exports=function(t){return Math.abs(t.x1-t.x2)}},2529(t,e,i){var s=i(23031);s.Angle=i(91938),s.BresenhamPoints=i(84993),s.CenterOn=i(36469),s.Clone=i(31116),s.CopyFrom=i(59944),s.Equals=i(59220),s.Extend=i(78177),s.GetEasedPoints=i(26708),s.GetMidPoint=i(32125),s.GetNearestPoint=i(99569),s.GetNormal=i(34638),s.GetPoint=i(13151),s.GetPoints=i(15258),s.GetShortestDistance=i(26408),s.Height=i(98770),s.Length=i(35001),s.NormalAngle=i(64795),s.NormalX=i(52616),s.NormalY=i(87231),s.Offset=i(89662),s.PerpSlope=i(71165),s.Random=i(65822),s.ReflectAngle=i(69777),s.Rotate=i(39706),s.RotateAroundPoint=i(82585),s.RotateAroundXY=i(64400),s.SetToAngle=i(62377),s.Slope=i(71366),s.Width=i(10809),t.exports=s},12306(t,e,i){var s=i(25717);t.exports=function(t){return new s(t.points)}},63814(t){t.exports=function(t,e,i){for(var s=!1,r=-1,n=t.points.length-1;++r80*s){n=o=t[0],a=h=t[1];for(var y=s;yo&&(o=d),c>h&&(h=c);p=0!==(p=Math.max(o-n,h-a))?32767/p:0}return r(v,x,s,n,a,p,0),x}function i(t,e,i,s,r){var n,a;if(r===A(t,e,i,s)>0)for(n=e;n=e;n-=s)a=b(n,t[n],t[n+1],a);return a&&v(a,a.next)&&(E(a),a=a.next),a}function s(t,e){if(!t)return t;e||(e=t);var i,s=t;do{if(i=!1,s.steiner||!v(s,s.next)&&0!==g(s.prev,s,s.next))s=s.next;else{if(E(s),(s=e=s.prev)===s.next)break;i=!0}}while(i||s!==e);return e}function r(t,e,i,l,u,d,f){if(t){!f&&d&&function(t,e,i,s){var r=t;do{0===r.z&&(r.z=c(r.x,r.y,e,i,s)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){var e,i,s,r,n,a,o,h,l=1;do{for(i=t,t=null,n=null,a=0;i;){for(a++,s=i,o=0,e=0;e0||h>0&&s;)0!==o&&(0===h||!s||i.z<=s.z)?(r=i,i=i.nextZ,o--):(r=s,s=s.nextZ,h--),n?n.nextZ=r:t=r,r.prevZ=n,n=r;i=s}n.nextZ=null,l*=2}while(a>1)}(r)}(t,l,u,d);for(var p,m,g=t;t.prev!==t.next;)if(p=t.prev,m=t.next,d?a(t,l,u,d):n(t))e.push(p.i/i|0),e.push(t.i/i|0),e.push(m.i/i|0),E(t),t=m.next,g=m.next;else if((t=m)===g){f?1===f?r(t=o(s(t),e,i),e,i,l,u,d,2):2===f&&h(t,e,i,l,u,d):r(s(t),e,i,l,u,d,1);break}}}function n(t){var e=t.prev,i=t,s=t.next;if(g(e,i,s)>=0)return!1;for(var r=e.x,n=i.x,a=s.x,o=e.y,h=i.y,l=s.y,u=rn?r>a?r:a:n>a?n:a,f=o>h?o>l?o:l:h>l?h:l,m=s.next;m!==e;){if(m.x>=u&&m.x<=c&&m.y>=d&&m.y<=f&&p(r,o,n,h,a,l,m.x,m.y)&&g(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function a(t,e,i,s){var r=t.prev,n=t,a=t.next;if(g(r,n,a)>=0)return!1;for(var o=r.x,h=n.x,l=a.x,u=r.y,d=n.y,f=a.y,m=oh?o>l?o:l:h>l?h:l,y=u>d?u>f?u:f:d>f?d:f,T=c(m,v,e,i,s),w=c(x,y,e,i,s),S=t.prevZ,b=t.nextZ;S&&S.z>=T&&b&&b.z<=w;){if(S.x>=m&&S.x<=x&&S.y>=v&&S.y<=y&&S!==r&&S!==a&&p(o,u,h,d,l,f,S.x,S.y)&&g(S.prev,S,S.next)>=0)return!1;if(S=S.prevZ,b.x>=m&&b.x<=x&&b.y>=v&&b.y<=y&&b!==r&&b!==a&&p(o,u,h,d,l,f,b.x,b.y)&&g(b.prev,b,b.next)>=0)return!1;b=b.nextZ}for(;S&&S.z>=T;){if(S.x>=m&&S.x<=x&&S.y>=v&&S.y<=y&&S!==r&&S!==a&&p(o,u,h,d,l,f,S.x,S.y)&&g(S.prev,S,S.next)>=0)return!1;S=S.prevZ}for(;b&&b.z<=w;){if(b.x>=m&&b.x<=x&&b.y>=v&&b.y<=y&&b!==r&&b!==a&&p(o,u,h,d,l,f,b.x,b.y)&&g(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function o(t,e,i){var r=t;do{var n=r.prev,a=r.next.next;!v(n,a)&&x(n,r,r.next,a)&&w(n,a)&&w(a,n)&&(e.push(n.i/i|0),e.push(r.i/i|0),e.push(a.i/i|0),E(r),E(r.next),r=t=a),r=r.next}while(r!==t);return s(r)}function h(t,e,i,n,a,o){var h=t;do{for(var l=h.next.next;l!==h.prev;){if(h.i!==l.i&&m(h,l)){var u=S(h,l);return h=s(h,h.next),u=s(u,u.next),r(h,e,i,n,a,o,0),void r(u,e,i,n,a,o,0)}l=l.next}h=h.next}while(h!==t)}function l(t,e){return t.x-e.x}function u(t,e){var i=function(t,e){var i,s=e,r=t.x,n=t.y,a=-1/0;do{if(n<=s.y&&n>=s.next.y&&s.next.y!==s.y){var o=s.x+(n-s.y)*(s.next.x-s.x)/(s.next.y-s.y);if(o<=r&&o>a&&(a=o,i=s.x=s.x&&s.x>=u&&r!==s.x&&p(ni.x||s.x===i.x&&d(i,s)))&&(i=s,f=h)),s=s.next}while(s!==l);return i}(t,e);if(!i)return e;var r=S(i,t);return s(r,r.next),s(i,i.next)}function d(t,e){return g(t.prev,t,e.prev)<0&&g(e.next,t,t.next)<0}function c(t,e,i,s,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-s)*r|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function f(t){var e=t,i=t;do{(e.x=(t-a)*(n-o)&&(t-a)*(s-o)>=(i-a)*(e-o)&&(i-a)*(n-o)>=(r-a)*(s-o)}function m(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&x(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(w(t,e)&&w(e,t)&&function(t,e){var i=t,s=!1,r=(t.x+e.x)/2,n=(t.y+e.y)/2;do{i.y>n!=i.next.y>n&&i.next.y!==i.y&&r<(i.next.x-i.x)*(n-i.y)/(i.next.y-i.y)+i.x&&(s=!s),i=i.next}while(i!==t);return s}(t,e)&&(g(t.prev,t,e.prev)||g(t,e.prev,e))||v(t,e)&&g(t.prev,t,t.next)>0&&g(e.prev,e,e.next)>0)}function g(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function v(t,e){return t.x===e.x&&t.y===e.y}function x(t,e,i,s){var r=T(g(t,e,i)),n=T(g(t,e,s)),a=T(g(i,s,t)),o=T(g(i,s,e));return r!==n&&a!==o||(!(0!==r||!y(t,i,e))||(!(0!==n||!y(t,s,e))||(!(0!==a||!y(i,t,s))||!(0!==o||!y(i,e,s)))))}function y(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function T(t){return t>0?1:t<0?-1:0}function w(t,e){return g(t.prev,t,t.next)<0?g(t,e,t.next)>=0&&g(t,t.prev,e)>=0:g(t,e,t.prev)<0||g(t,t.next,e)<0}function S(t,e){var i=new C(t.i,t.x,t.y),s=new C(e.i,e.x,e.y),r=t.next,n=e.prev;return t.next=e,e.prev=t,i.next=r,r.prev=i,s.next=i,i.prev=s,n.next=s,s.prev=n,s}function b(t,e,i,s){var r=new C(t,e,i);return s?(r.next=s.next,r.prev=s,s.next.prev=r,s.next=r):(r.prev=r,r.next=r),r}function E(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function C(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function A(t,e,i,s){for(var r=0,n=e,a=i-s;n0&&(s+=t[r-1].length,i.holes.push(s))}return i},t.exports=e},13829(t,e,i){var s=i(87841);t.exports=function(t,e){void 0===e&&(e=new s);for(var i,r=1/0,n=1/0,a=-r,o=-n,h=0;h0&&(e=h/i);for(var l=0;ld+g)){var v=m.getPoint((u-d)/g);a.push(v);break}d+=g}return a}},30052(t,e,i){var s=i(35001),r=i(23031);t.exports=function(t){for(var e=t.points,i=0,n=0;n1?(s=i.x,r=i.y):o>0&&(s+=n*o,r+=a*o)}return(n=t.x-s)*n+(a=t.y-r)*a}function s(t,e,r,n,a){for(var o,h=n,l=e+1;lh&&(o=l,h=u)}h>n&&(o-e>1&&s(t,e,o,n,a),a.push(t[o]),r-o>1&&s(t,o,r,n,a))}function r(t,e){var i=t.length-1,r=[t[0]];return s(t,0,i,e,r),r.push(t[i]),r}t.exports=function(t,i,s){void 0===i&&(i=1),void 0===s&&(s=!1);var n=t.points;if(n.length>2){var a=i*i;s||(n=function(t,i){for(var s,r=t[0],n=[r],a=1,o=t.length;ai&&(n.push(s),r=s);return r!==s&&n.push(s),n}(n,a)),t.setTo(r(n,a))}return t}},5469(t){var e=function(t,e){return t[0]=e[0],t[1]=e[1],t};t.exports=function(t){var i,s=[],r=t.points;for(i=0;i0&&n.push(e([0,0],s[0])),i=0;i1&&n.push(e([0,0],s[s.length-1])),t.setTo(n)}},24709(t){t.exports=function(t,e,i){for(var s=t.points,r=0;r=e&&t.y<=i&&t.y+t.height>=i)}},96553(t,e,i){var s=i(37303);t.exports=function(t,e){return s(t,e.x,e.y)}},70273(t){t.exports=function(t,e){return!(e.width*e.height>t.width*t.height)&&(e.x>t.x&&e.xt.x&&e.rightt.y&&e.yt.y&&e.bottoms(e)?t.setSize(e.height*i,e.height):t.setSize(e.width,e.width/i),t.setPosition(e.centerX-t.width/2,e.centerY-t.height/2)}},80774(t){t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t}},83859(t){t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t.width=Math.floor(t.width),t.height=Math.floor(t.height),t}},19217(t,e,i){var s=i(87841),r=i(36383);t.exports=function(t,e){if(void 0===e&&(e=new s),0===t.length)return e;for(var i,n,a,o=Number.MAX_VALUE,h=Number.MAX_VALUE,l=r.MIN_SAFE_INTEGER,u=r.MIN_SAFE_INTEGER,d=0;d=1)return i.x=t.x,i.y=t.y,i;var n=s(t)*e;return e>.5?(n-=t.width+t.height)<=t.width?(i.x=t.right-n,i.y=t.bottom):(i.x=t.x,i.y=t.bottom-(n-t.width)):n<=t.width?(i.x=t.x+n,i.y=t.y):(i.x=t.right,i.y=t.y+(n-t.width)),i}},34819(t,e,i){var s=i(20812),r=i(13019);t.exports=function(t,e,i,n){void 0===n&&(n=[]),!e&&i>0&&(e=r(t)/i);for(var a=0;a=t.right&&(h=1,o+=a-t.right,a=t.right);break;case 1:(o+=e)>=t.bottom&&(h=2,a-=o-t.bottom,o=t.bottom);break;case 2:(a-=e)<=t.left&&(h=3,o-=t.left-a,a=t.left);break;case 3:(o-=e)<=t.top&&(h=0,o=t.top)}return n}},33595(t){t.exports=function(t,e){for(var i=t.x,s=t.right,r=t.y,n=t.bottom,a=0;ae.x&&t.ye.y}},13019(t){t.exports=function(t){return 2*(t.width+t.height)}},85133(t,e,i){var s=i(26099),r=i(39506);t.exports=function(t,e,i){void 0===i&&(i=new s),e=r(e);var n=Math.sin(e),a=Math.cos(e),o=a>0?t.width/2:t.width/-2,h=n>0?t.height/2:t.height/-2;return Math.abs(o*n)=this.right?this.width=0:this.width=this.right-t,this.x=t}},right:{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}},top:{get:function(){return this.y},set:function(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}},bottom:{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=u},94845(t){t.exports=function(t,e){return t.width===e.width&&t.height===e.height}},31730(t){t.exports=function(t,e,i){return void 0===i&&(i=e),t.width*=e,t.height*=i,t}},36899(t,e,i){var s=i(87841);t.exports=function(t,e,i){void 0===i&&(i=new s);var r=Math.min(t.x,e.x),n=Math.min(t.y,e.y),a=Math.max(t.right,e.right)-r,o=Math.max(t.bottom,e.bottom)-n;return i.setTo(r,n,a,o)}},93232(t,e,i){var s=i(87841);s.Area=i(39843),s.Ceil=i(98615),s.CeilAll=i(31688),s.CenterOn=i(67502),s.Clone=i(65085),s.Contains=i(37303),s.ContainsPoint=i(96553),s.ContainsRect=i(70273),s.CopyFrom=i(43459),s.Decompose=i(77493),s.Equals=i(9219),s.FitInside=i(53751),s.FitOutside=i(16088),s.Floor=i(80774),s.FloorAll=i(83859),s.FromPoints=i(19217),s.FromXY=i(9477),s.GetAspectRatio=i(8249),s.GetCenter=i(27165),s.GetPoint=i(20812),s.GetPoints=i(34819),s.GetSize=i(51313),s.Inflate=i(86091),s.Intersection=i(53951),s.MarchingAnts=i(14649),s.MergePoints=i(33595),s.MergeRect=i(20074),s.MergeXY=i(92171),s.Offset=i(42981),s.OffsetPoint=i(46907),s.Overlaps=i(60170),s.Perimeter=i(13019),s.PerimeterPoint=i(85133),s.Random=i(26597),s.RandomOutside=i(86470),s.SameDimensions=i(94845),s.Scale=i(31730),s.Union=i(36899),t.exports=s},41658(t){t.exports=function(t){var e=t.x1,i=t.y1,s=t.x2,r=t.y2,n=t.x3,a=t.y3;return Math.abs(((n-e)*(r-i)-(s-e)*(a-i))/2)}},39208(t,e,i){var s=i(16483);t.exports=function(t,e,i){var r=i*(Math.sqrt(3)/2);return new s(t,e,t+i/2,e+r,t-i/2,e+r)}},39545(t,e,i){var s=i(94811),r=i(16483);t.exports=function(t,e,i,n,a){void 0===e&&(e=null),void 0===i&&(i=1),void 0===n&&(n=1),void 0===a&&(a=[]);for(var o,h,l,u,d,c,f,p,m,g=s(t,e),v=0;v=0&&v>=0&&g+v<1}},48653(t){t.exports=function(t,e,i,s){void 0===i&&(i=!1),void 0===s&&(s=[]);for(var r,n,a,o,h,l,u=t.x3-t.x1,d=t.y3-t.y1,c=t.x2-t.x1,f=t.y2-t.y1,p=u*u+d*d,m=u*c+d*f,g=c*c+f*f,v=p*g-m*m,x=0===v?0:1/v,y=t.x1,T=t.y1,w=0;w=0&&n>=0&&r+n<1&&(s.push({x:e[w].x,y:e[w].y}),i)));w++);return s}},96006(t,e,i){var s=i(10690);t.exports=function(t,e){return s(t,e.x,e.y)}},71326(t){t.exports=function(t,e){return e.setTo(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)}},71694(t){t.exports=function(t,e){return void 0===e&&(e=[]),e.push({x:t.x1,y:t.y1}),e.push({x:t.x2,y:t.y2}),e.push({x:t.x3,y:t.y3}),e}},33522(t){t.exports=function(t,e){return t.x1===e.x1&&t.y1===e.y1&&t.x2===e.x2&&t.y2===e.y2&&t.x3===e.x3&&t.y3===e.y3}},20437(t,e,i){var s=i(26099),r=i(35001);t.exports=function(t,e,i){void 0===i&&(i=new s);var n=t.getLineA(),a=t.getLineB(),o=t.getLineC();if(e<=0||e>=1)return i.x=n.x1,i.y=n.y1,i;var h=r(n),l=r(a),u=r(o),d=(h+l+u)*e,c=0;return dh+l?(c=(d-=h+l)/u,i.x=o.x1+(o.x2-o.x1)*c,i.y=o.y1+(o.y2-o.y1)*c):(c=(d-=h)/l,i.x=a.x1+(a.x2-a.x1)*c,i.y=a.y1+(a.y2-a.y1)*c),i}},80672(t,e,i){var s=i(35001),r=i(26099);t.exports=function(t,e,i,n){void 0===n&&(n=[]);var a=t.getLineA(),o=t.getLineB(),h=t.getLineC(),l=s(a),u=s(o),d=s(h),c=l+u+d;!e&&i>0&&(e=c/i);for(var f=0;fl+u?(m=(p-=l+u)/d,g.x=h.x1+(h.x2-h.x1)*m,g.y=h.y1+(h.y2-h.y1)*m):(m=(p-=l)/u,g.x=o.x1+(o.x2-o.x1)*m,g.y=o.y1+(o.y2-o.y1)*m),n.push(g)}return n}},39757(t,e,i){var s=i(26099);function r(t,e,i,s){var r=t-i,n=e-s,a=r*r+n*n;return Math.sqrt(a)}t.exports=function(t,e){void 0===e&&(e=new s);var i=t.x1,n=t.y1,a=t.x2,o=t.y2,h=t.x3,l=t.y3,u=r(h,l,a,o),d=r(i,n,h,l),c=r(a,o,i,n),f=u+d+c;return e.x=(i*u+a*d+h*c)/f,e.y=(n*u+o*d+l*c)/f,e}},13584(t){t.exports=function(t,e,i){return t.x1+=e,t.y1+=i,t.x2+=e,t.y2+=i,t.x3+=e,t.y3+=i,t}},1376(t,e,i){var s=i(35001);t.exports=function(t){var e=t.getLineA(),i=t.getLineB(),r=t.getLineC();return s(e)+s(i)+s(r)}},90260(t,e,i){var s=i(26099);t.exports=function(t,e){void 0===e&&(e=new s);var i=t.x2-t.x1,r=t.y2-t.y1,n=t.x3-t.x1,a=t.y3-t.y1,o=Math.random(),h=Math.random();return o+h>=1&&(o=1-o,h=1-h),e.x=t.x1+(i*o+n*h),e.y=t.y1+(r*o+a*h),e}},52172(t,e,i){var s=i(99614),r=i(39757);t.exports=function(t,e){var i=r(t);return s(t,i.x,i.y,e)}},49907(t,e,i){var s=i(99614);t.exports=function(t,e,i){return s(t,e.x,e.y,i)}},99614(t){t.exports=function(t,e,i,s){var r=Math.cos(s),n=Math.sin(s),a=t.x1-e,o=t.y1-i;return t.x1=a*r-o*n+e,t.y1=a*n+o*r+i,a=t.x2-e,o=t.y2-i,t.x2=a*r-o*n+e,t.y2=a*n+o*r+i,a=t.x3-e,o=t.y3-i,t.x3=a*r-o*n+e,t.y3=a*n+o*r+i,t}},16483(t,e,i){var s=i(83419),r=i(10690),n=i(20437),a=i(80672),o=i(23777),h=i(23031),l=i(90260),u=new s({initialize:function(t,e,i,s,r,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===r&&(r=0),void 0===n&&(n=0),this.type=o.TRIANGLE,this.x1=t,this.y1=e,this.x2=i,this.y2=s,this.x3=r,this.y3=n},contains:function(t,e){return r(this,t,e)},getPoint:function(t,e){return n(this,t,e)},getPoints:function(t,e,i){return a(this,t,e,i)},getRandomPoint:function(t){return l(this,t)},setTo:function(t,e,i,s,r,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===r&&(r=0),void 0===n&&(n=0),this.x1=t,this.y1=e,this.x2=i,this.y2=s,this.x3=r,this.y3=n,this},getLineA:function(t){return void 0===t&&(t=new h),t.setTo(this.x1,this.y1,this.x2,this.y2),t},getLineB:function(t){return void 0===t&&(t=new h),t.setTo(this.x2,this.y2,this.x3,this.y3),t},getLineC:function(t){return void 0===t&&(t=new h),t.setTo(this.x3,this.y3,this.x1,this.y1),t},left:{get:function(){return Math.min(this.x1,this.x2,this.x3)},set:function(t){var e=0;e=this.x1<=this.x2&&this.x1<=this.x3?this.x1-t:this.x2<=this.x1&&this.x2<=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},right:{get:function(){return Math.max(this.x1,this.x2,this.x3)},set:function(t){var e=0;e=this.x1>=this.x2&&this.x1>=this.x3?this.x1-t:this.x2>=this.x1&&this.x2>=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},top:{get:function(){return Math.min(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1<=this.y2&&this.y1<=this.y3?this.y1-t:this.y2<=this.y1&&this.y2<=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}},bottom:{get:function(){return Math.max(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1>=this.y2&&this.y1>=this.y3?this.y1-t:this.y2>=this.y1&&this.y2>=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}}});t.exports=u},84435(t,e,i){var s=i(16483);s.Area=i(41658),s.BuildEquilateral=i(39208),s.BuildFromPolygon=i(39545),s.BuildRight=i(90301),s.CenterOn=i(23707),s.Centroid=i(97523),s.CircumCenter=i(24951),s.CircumCircle=i(85614),s.Clone=i(74422),s.Contains=i(10690),s.ContainsArray=i(48653),s.ContainsPoint=i(96006),s.CopyFrom=i(71326),s.Decompose=i(71694),s.Equals=i(33522),s.GetPoint=i(20437),s.GetPoints=i(80672),s.InCenter=i(39757),s.Perimeter=i(1376),s.Offset=i(13584),s.Random=i(90260),s.Rotate=i(52172),s.RotateAroundPoint=i(49907),s.RotateAroundXY=i(99614),t.exports=s},74457(t){t.exports=function(t,e,i){return{gameObject:t,enabled:!0,draggable:!1,dropZone:!1,cursor:!1,target:null,camera:null,hitArea:e,hitAreaCallback:i,hitAreaDebug:null,customHitArea:!1,localX:0,localY:0,dragState:0,dragStartX:0,dragStartY:0,dragStartXGlobal:0,dragStartYGlobal:0,dragStartCamera:null,dragX:0,dragY:0}}},84409(t){t.exports=function(t,e){return function(i,s,r,n){var a=t.getPixelAlpha(s,r,n.texture.key,n.frame.name);return a&&a>=e}}},7003(t,e,i){var s=i(83419),r=i(93301),n=i(50792),a=i(8214),o=i(8443),h=i(78970),l=i(85098),u=i(42515),d=i(36210),c=i(61340),f=i(85955),p=new s({initialize:function(t,e){this.game=t,this.scaleManager,this.canvas,this.config=e,this.enabled=!0,this.events=new n,this.isOver=!0,this.defaultCursor="",this.keyboard=e.inputKeyboard?new h(this):null,this.mouse=e.inputMouse?new l(this):null,this.touch=e.inputTouch?new d(this):null,this.pointers=[],this.pointersTotal=e.inputActivePointers;for(var i=0;i<=this.pointersTotal;i++){var s=new u(this,i);s.smoothFactor=e.inputSmoothFactor,this.pointers.push(s)}this.mousePointer=e.inputMouse?this.pointers[0]:null,this.activePointer=this.pointers[0],this.globalTopOnly=!0,this.time=0,this._tempPoint={x:0,y:0},this._tempHitTest=[],this._tempMatrix=new c,this._tempMatrix2=new c,this._tempSkip=!1,this.mousePointerContainer=[this.mousePointer],t.events.once(o.BOOT,this.boot,this)},boot:function(){var t=this.game,e=t.events;this.canvas=t.canvas,this.scaleManager=t.scale,this.events.emit(a.MANAGER_BOOT),e.on(o.PRE_RENDER,this.preRender,this),e.once(o.DESTROY,this.destroy,this)},setCanvasOver:function(t){this.isOver=!0,this.events.emit(a.GAME_OVER,t)},setCanvasOut:function(t){this.isOver=!1,this.events.emit(a.GAME_OUT,t)},preRender:function(){var t=this.game.loop.now,e=this.game.loop.delta,i=this.game.scene.getScenes(!0,!0);this.time=t,this.events.emit(a.MANAGER_UPDATE);for(var s=0;s10&&(t=10-this.pointersTotal);for(var i=0;i-1&&(r.splice(o,1),this.clear(a,!0))}this._pendingRemoval.length=0,this._list=r.concat(e.splice(0))}},isActive:function(){return this.manager&&this.manager.enabled&&this.enabled&&this.scene.sys.canInput()},setCursor:function(t){this.manager&&this.manager.setCursor(t)},resetCursor:function(){this.manager&&this.manager.resetCursor(null,!0)},updatePoll:function(t,e){if(!this.isActive())return!1;if(this.pluginEvents.emit(c.UPDATE,t,e),this._updatedThisFrame)return this._updatedThisFrame=!1,!1;var i,s=this.manager.pointers;for(i=0;i0){if(this._pollTimer-=e,!(this._pollTimer<0))return!1;this._pollTimer=this.pollRate}var n=!1;for(i=0;i0&&(n=!0)}return n},update:function(t,e){if(!this.isActive())return!1;for(var i=!1,s=0;s0&&(i=!0)}return this._updatedThisFrame=!0,i},clear:function(t,e){void 0===e&&(e=!1),this.disable(t);var i=t.input;i&&(this.removeDebug(t),this.manager.resetCursor(i),i.gameObject=void 0,i.target=void 0,i.hitArea=void 0,i.hitAreaCallback=void 0,i.callbackContext=void 0,t.input=null),e||this.queueForRemoval(t);var s=this._draggable.indexOf(t);return s>-1&&this._draggable.splice(s,1),t},disable:function(t,e){void 0===e&&(e=!1);var i=t.input;i&&(i.enabled=!1,i.dragState=0);for(var s,r=this._drag,n=this._over,a=this.manager,o=0;o-1&&r[o].splice(s,1),(s=n[o].indexOf(t))>-1&&n[o].splice(s,1);return e&&this.resetCursor(),this},enable:function(t,e,i,s){return void 0===s&&(s=!1),t.input?t.input.enabled=!0:this.setHitArea(t,e,i),t.input&&s&&!t.input.dropZone&&(t.input.dropZone=s),this},hitTestPointer:function(t){for(var e=this.cameras.getCamerasBelowPointer(t),i=0;i0)return t.camera=s,r}return t.camera=e[0],[]},processDownEvents:function(t){var e=0,i=this._temp,s=this._eventData,r=this._eventContainer;s.cancelled=!1;for(var n=0;n0&&l(t.x,t.y,t.downX,t.downY)>=r||s>0&&e>=t.downTime+s)&&(i=!0),i)return this.setDragState(t,3),this.processDragStartList(t)},processDragStartList:function(t){if(3!==this.getDragState(t))return 0;var e=this._drag[t.id];e.length>1&&(e=e.slice(0));for(var i=0;i1&&(this.sortGameObjects(i,t),this.topOnly&&i.splice(1)),this._drag[t.id]=i,0===this.dragDistanceThreshold&&0===this.dragTimeThreshold?(this.setDragState(t,3),this.processDragStartList(t)):(this.setDragState(t,2),0))},processDragMoveEvent:function(t){if(2===this.getDragState(t)&&this.processDragThresholdEvent(t,this.manager.game.loop.now),4!==this.getDragState(t))return 0;var e=this._tempZones,i=this._drag[t.id];i.length>1&&(i=i.slice(0));for(var s=0;s0?(a.emit(c.GAMEOBJECT_DRAG_LEAVE,t,h),this.emit(c.DRAG_LEAVE,t,a,h),o.target=e[0],h=o.target,a.emit(c.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(c.DRAG_ENTER,t,a,h)):(a.emit(c.GAMEOBJECT_DRAG_LEAVE,t,h),this.emit(c.DRAG_LEAVE,t,a,h),e[0]?(o.target=e[0],h=o.target,a.emit(c.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(c.DRAG_ENTER,t,a,h)):o.target=null)}else!h&&e[0]&&(o.target=e[0],h=o.target,a.emit(c.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(c.DRAG_ENTER,t,a,h));var u=t.positionToCamera(o.dragStartCamera);if(a.parentContainer){var d=u.x-o.dragStartXGlobal,f=u.y-o.dragStartYGlobal,p=a.getParentRotation(),m=d*Math.cos(p)+f*Math.sin(p),g=f*Math.cos(p)-d*Math.sin(p);m*=1/a.parentContainer.scaleX,g*=1/a.parentContainer.scaleY,r=m+o.dragStartX,n=g+o.dragStartY}else r=u.x-o.dragX,n=u.y-o.dragY;a.emit(c.GAMEOBJECT_DRAG,t,r,n),this.emit(c.DRAG,t,a,r,n)}return i.length},processDragUpEvent:function(t){var e=this._drag[t.id];e.length>1&&(e=e.slice(0));for(var i=0;i0){var n=this.manager,a=this._eventData,o=this._eventContainer;a.cancelled=!1;for(var h=0;h0){var r=this.manager,n=this._eventData,a=this._eventContainer;n.cancelled=!1,this.sortGameObjects(e,t);for(var o=0;o0){for(this.sortGameObjects(r,t),e=0;e0){for(this.sortGameObjects(n,t),e=0;e-1&&this._draggable.splice(r,1)}return this},makePixelPerfect:function(t){void 0===t&&(t=1);var e=this.systems.textures;return h(e,t)},setHitArea:function(t,e,i){if(void 0===e)return this.setHitAreaFromTexture(t);Array.isArray(t)||(t=[t]);var s=!1,r=!1,n=!1,a=!1,h=!1,l=!0;if(v(e)&&Object.keys(e).length){var u=e;e=p(u,"hitArea",null),i=p(u,"hitAreaCallback",null),h=p(u,"pixelPerfect",!1);var d=p(u,"alphaTolerance",1);h&&(e={},i=this.makePixelPerfect(d)),s=p(u,"draggable",!1),r=p(u,"dropZone",!1),n=p(u,"cursor",!1),a=p(u,"useHandCursor",!1),e&&i||(this.setHitAreaFromTexture(t),l=!1)}else"function"!=typeof e||i||(i=e,e={});for(var c=0;c=this.threshold?this.pressed||(this.pressed=!0,this.events.emit(r.BUTTON_DOWN,e,this,t),this.pad.emit(r.GAMEPAD_BUTTON_DOWN,i,t,this)):this.pressed&&(this.pressed=!1,this.events.emit(r.BUTTON_UP,e,this,t),this.pad.emit(r.GAMEPAD_BUTTON_UP,i,t,this))},destroy:function(){this.pad=null,this.events=null}});t.exports=n},99125(t,e,i){var s=i(97421),r=i(28884),n=i(83419),a=i(50792),o=i(26099),h=new n({Extends:a,initialize:function(t,e){a.call(this),this.manager=t,this.pad=e,this.id=e.id,this.index=e.index;for(var i=[],n=0;n=.5));this.buttons=i;var h=[];for(n=0;n=2&&(this.leftStick.set(n[0].getValue(),n[1].getValue()),r>=4&&this.rightStick.set(n[2].getValue(),n[3].getValue()))}},destroy:function(){var t;for(this.removeAllListeners(),this.manager=null,this.pad=null,t=0;t-1&&e.preventDefault()}},this.onKeyUp=function(e){if(!e.defaultPrevented&&t.enabled&&t.manager){t.queue.push(e),t.manager.events.emit(a.MANAGER_PROCESS);var i=e.altKey||e.ctrlKey||e.shiftKey||e.metaKey;t.preventDefault&&!i&&t.captures.indexOf(e.keyCode)>-1&&e.preventDefault()}};var e=this.target;e&&(e.addEventListener("keydown",this.onKeyDown,!1),e.addEventListener("keyup",this.onKeyUp,!1),this.enabled=!0)},stopListeners:function(){var t=this.target;t.removeEventListener("keydown",this.onKeyDown,!1),t.removeEventListener("keyup",this.onKeyUp,!1),this.enabled=!1},postUpdate:function(){this.queue=[]},addCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i0},removeCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i0},clearCaptures:function(){this.captures=[],this.preventDefault=!1},destroy:function(){this.stopListeners(),this.clearCaptures(),this.queue=[],this.manager.game.events.off(n.POST_STEP,this.postUpdate,this),this.target=null,this.enabled=!1,this.manager=null}});t.exports=l},28846(t,e,i){var s=i(83419),r=i(50792),n=i(95922),a=i(8443),o=i(35154),h=i(8214),l=i(89639),u=i(30472),d=i(46032),c=i(87960),f=i(74600),p=i(44594),m=i(56583),g=new s({Extends:r,initialize:function(t){r.call(this),this.game=t.systems.game,this.scene=t.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=t,this.manager=t.manager.keyboard,this.enabled=!0,this.keys=[],this.combos=[],this.prevCode=null,this.prevTime=0,this.prevType=null,t.pluginEvents.once(h.BOOT,this.boot,this),t.pluginEvents.on(h.START,this.start,this)},boot:function(){var t=this.settings.input;this.enabled=o(t,"keyboard",!0);var e=o(t,"keyboard.capture",null);e&&this.addCaptures(e),this.sceneInputPlugin.pluginEvents.once(h.DESTROY,this.destroy,this)},start:function(){this.sceneInputPlugin.manager.events.on(h.MANAGER_PROCESS,this.update,this),this.sceneInputPlugin.pluginEvents.once(h.SHUTDOWN,this.shutdown,this),this.game.events.on(a.BLUR,this.resetKeys,this),this.scene.sys.events.on(p.PAUSE,this.resetKeys,this),this.scene.sys.events.on(p.SLEEP,this.resetKeys,this)},isActive:function(){return this.enabled&&this.scene.sys.canInput()},addCapture:function(t){return this.manager.addCapture(t),this},removeCapture:function(t){return this.manager.removeCapture(t),this},getCaptures:function(){return this.manager.captures},enableGlobalCapture:function(){return this.manager.preventDefault=!0,this},disableGlobalCapture:function(){return this.manager.preventDefault=!1,this},clearCaptures:function(){return this.manager.clearCaptures(),this},createCursorKeys:function(){return this.addKeys({up:d.UP,down:d.DOWN,left:d.LEFT,right:d.RIGHT,space:d.SPACE,shift:d.SHIFT})},addKeys:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!1);var s={};if("string"==typeof t){t=t.split(",");for(var r=0;r-1?s[r]=t:s[t.keyCode]=t,e&&this.addCapture(t.keyCode),t.setEmitOnRepeat(i),t}return"string"==typeof t&&(t=d[t.toUpperCase()]),s[t]||(s[t]=new u(this,t),e&&this.addCapture(t),s[t].setEmitOnRepeat(i)),s[t]},removeKey:function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var s,r=this.keys;if(t instanceof u){var n=r.indexOf(t);n>-1&&(s=this.keys[n],this.keys[n]=void 0)}else"string"==typeof t&&(t=d[t.toUpperCase()]);return r[t]&&(s=r[t],r[t]=void 0),s&&(s.plugin=null,i&&this.removeCapture(s.keyCode),e&&s.destroy()),this},removeAllKeys:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1);for(var i=this.keys,s=0;st._tick)return t._tick=i,!0}return!1},update:function(){var t=this.manager.queue,e=t.length;if(this.isActive()&&0!==e)for(var i=this.keys,s=0;s0&&e.maxKeyDelay>0){var n=e.timeLastMatched+e.maxKeyDelay;t.timeStamp<=n&&(r=!0,i=s(t,e))}else r=!0,i=s(t,e);return!r&&e.resetOnWrongKey&&(e.index=0,e.current=e.keyCodes[0]),i&&(e.timeLastMatched=t.timeStamp,e.matched=!0,e.timeMatched=t.timeStamp),i}},92803(t){t.exports=function(t){return t.current=t.keyCodes[0],t.index=0,t.timeLastMatched=0,t.matched=!1,t.timeMatched=0,t}},92612(t){t.exports="keydown"},23345(t){t.exports="keyup"},21957(t){t.exports="keycombomatch"},44743(t){t.exports="down"},3771(t){t.exports="keydown-"},46358(t){t.exports="keyup-"},75674(t){t.exports="up"},95922(t,e,i){t.exports={ANY_KEY_DOWN:i(92612),ANY_KEY_UP:i(23345),COMBO_MATCH:i(21957),DOWN:i(44743),KEY_DOWN:i(3771),KEY_UP:i(46358),UP:i(75674)}},51442(t,e,i){t.exports={Events:i(95922),KeyboardManager:i(78970),KeyboardPlugin:i(28846),Key:i(30472),KeyCodes:i(46032),KeyCombo:i(87960),AdvanceKeyCombo:i(66970),ProcessKeyCombo:i(68769),ResetKeyCombo:i(92803),JustDown:i(90229),JustUp:i(38796),DownDuration:i(37015),UpDuration:i(41170)}},37015(t){t.exports=function(t,e){void 0===e&&(e=50);var i=t.plugin.game.loop.time-t.timeDown;return t.isDown&&i=400&&t.status<=599&&(s=!1),this.state=r.FILE_LOADED,this.resetXHR(),this.loader.nextFile(this,s)},onBase64Load:function(t){this.xhrLoader=t,this.state=r.FILE_LOADED,this.percentComplete=1,this.loader.emit(n.FILE_PROGRESS,this,this.percentComplete),this.loader.nextFile(this,!0)},onError:function(){this.resetXHR(),this.retryAttempts>0?(this.retryAttempts--,this.load()):this.loader.nextFile(this,!1)},onProgress:function(t){t.lengthComputable&&(this.bytesLoaded=t.loaded,this.bytesTotal=t.total,this.percentComplete=Math.min(this.bytesLoaded/this.bytesTotal,1),this.loader.emit(n.FILE_PROGRESS,this,this.percentComplete))},onProcess:function(){this.state=r.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=r.FILE_COMPLETE,this.multiFile&&this.multiFile.onFileComplete(this),this.loader.fileProcessComplete(this)},onProcessError:function(){console.error('Failed to process file: %s "%s"',this.type,this.key),this.state=r.FILE_ERRORED,this.multiFile&&this.multiFile.onFileFailed(this),this.loader.fileProcessComplete(this)},hasCacheConflict:function(){return this.cache&&this.cache.exists(this.key)},addToCache:function(){this.cache&&this.data&&this.cache.add(this.key,this.data)},pendingDestroy:function(t){if(this.state!==r.FILE_PENDING_DESTROY){void 0===t&&(t=this.data);var e=this.key,i=this.type;this.loader.emit(n.FILE_COMPLETE,e,i,t),this.loader.emit(n.FILE_KEY_COMPLETE+i+"-"+e,e,i,t),this.loader.flagForRemoval(this),this.state=r.FILE_PENDING_DESTROY}},destroy:function(){this.loader=null,this.cache=null,this.xhrSettings=null,this.multiFile=null,this.linkFile=null,this.data=null}});d.createObjectURL=function(t,e,i){if("function"==typeof URL)t.src=URL.createObjectURL(e);else{var s=new FileReader;s.onload=function(){t.removeAttribute("crossOrigin"),t.src="data:"+(e.type||i)+";base64,"+s.result.split(",")[1]},s.onerror=t.onerror,s.readAsDataURL(e)}},d.revokeObjectURL=function(t){"function"==typeof URL&&URL.revokeObjectURL(t.src)},t.exports=d},74099(t){var e={},i={install:function(t){for(var i in e)t[i]=e[i]},register:function(t,i){e[t]=i},destroy:function(){e={}}};t.exports=i},98356(t){t.exports=function(t,e){return!!t.url&&(t.url.match(/^(?:blob:|data:|capacitor:\/\/|file:\/\/|http:\/\/|https:\/\/|\/\/)/)?t.url:e+t.url)}},74261(t,e,i){var s=i(83419),r=i(23906),n=i(50792),a=i(54899),o=i(74099),h=i(95540),l=i(35154),u=i(41212),d=i(37277),c=i(44594),f=i(92638),p=new s({Extends:n,initialize:function(t){n.call(this);var e=t.sys.game.config,i=t.sys.settings.loader;this.scene=t,this.systems=t.sys,this.cacheManager=t.sys.cache,this.textureManager=t.sys.textures,this.sceneManager=t.sys.game.scene,o.install(this),this.prefix="",this.path="",this.baseURL="",this.setBaseURL(h(i,"baseURL",e.loaderBaseURL)),this.setPath(h(i,"path",e.loaderPath)),this.setPrefix(h(i,"prefix",e.loaderPrefix)),this.maxParallelDownloads=h(i,"maxParallelDownloads",e.loaderMaxParallelDownloads),this.xhr=f(h(i,"responseType",e.loaderResponseType),h(i,"async",e.loaderAsync),h(i,"user",e.loaderUser),h(i,"password",e.loaderPassword),h(i,"timeout",e.loaderTimeout),h(i,"withCredentials",e.loaderWithCredentials)),this.crossOrigin=h(i,"crossOrigin",e.loaderCrossOrigin),this.imageLoadType=h(i,"imageLoadType",e.loaderImageLoadType),this.localSchemes=h(i,"localScheme",e.loaderLocalScheme),this.totalToLoad=0,this.progress=0,this.list=new Set,this.inflight=new Set,this.queue=new Set,this._deleteQueue=new Set,this.totalFailed=0,this.totalComplete=0,this.state=r.LOADER_IDLE,this.multiKeyIndex=0,this.maxRetries=h(i,"maxRetries",e.loaderMaxRetries),t.sys.events.once(c.BOOT,this.boot,this),t.sys.events.on(c.START,this.pluginStart,this)},boot:function(){this.systems.events.once(c.DESTROY,this.destroy,this)},pluginStart:function(){this.systems.events.once(c.SHUTDOWN,this.shutdown,this)},setBaseURL:function(t){return void 0===t&&(t=""),""!==t&&"/"!==t.substr(-1)&&(t=t.concat("/")),this.baseURL=t,this},setPath:function(t){return void 0===t&&(t=""),""!==t&&"/"!==t.substr(-1)&&(t=t.concat("/")),this.path=t,this},setPrefix:function(t){return void 0===t&&(t=""),this.prefix=t,this},setCORS:function(t){return this.crossOrigin=t,this},addFile:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e0},removePack:function(t,e){var i,s=this.systems.anims,r=this.cacheManager,n=this.textureManager,a={animation:"json",aseprite:"json",audio:"audio",audioSprite:"audio",binary:"binary",bitmapFont:"bitmapFont",css:null,glsl:"shader",html:"html",json:"json",obj:"obj",plugin:null,scenePlugin:null,script:null,spine:"json",text:"text",tilemapCSV:"tilemap",tilemapImpact:"tilemap",tilemapTiledJSON:"tilemap",video:"video",xml:"xml"};if(u(t))i=t;else if(!(i=r.json.get(t)))return void console.warn("Asset Pack not found in JSON cache:",t);for(var o in e&&(i={_:i[e]}),i){var l=i[o],d=h(l,"prefix",""),c=h(l,"files"),f=h(l,"defaultType");if(Array.isArray(c))for(var p=0;p0&&this.inflight.size'),i.push(''),i.push(''),i.push(this.xhrLoader.responseText),i.push(""),i.push(""),i.push("");var s=[i.join("\n")],a=this;try{var o=new window.Blob(s,{type:"image/svg+xml;charset=utf-8"})}catch(t){return a.state=r.FILE_ERRORED,void a.onProcessComplete()}this.data=new Image,this.data.crossOrigin=this.crossOrigin,this.data.onload=function(){n.revokeObjectURL(a.data),a.onProcessComplete()},this.data.onerror=function(){n.revokeObjectURL(a.data),a.onProcessError()},n.createObjectURL(this.data,o,"image/svg+xml")},addToCache:function(){this.cache.addImage(this.key,this.data)}});a.register("htmlTexture",function(t,e,i,s,r){if(Array.isArray(t))for(var n=0;n=r.FILE_COMPLETE&&("spritesheet"===t.type?t.addToCache():"normalMap"===this.type?this.cache.addImage(this.key,t.data,this.data):this.cache.addImage(this.key,this.data,t.data)):this.cache.addImage(this.key,this.data)}});a.register("image",function(t,e,i){if(Array.isArray(t))for(var s=0;s=0?a.substring(o+i.length):a]=n.data}for(var h=[],l=0;l=r.FILE_COMPLETE&&("normalMap"===this.type?this.cache.addSpriteSheet(this.key,t.data,this.config,this.data):this.cache.addSpriteSheet(this.key,this.data,this.config,t.data)):this.cache.addSpriteSheet(this.key,this.data,this.config)}});n.register("spritesheet",function(t,e,i,s){if(Array.isArray(t))for(var r=0;ri&&(i=h.x),h.xn&&(n=h.y),h.y>>0)+2891336453,r=277803737*(s>>>(s>>>28)+4^s),n=(r>>>22^r)>>>0;return n/=f};t.exports=function(t,e){switch("number"==typeof t&&(t=[t]),e){case 2:return p(t,!0);case 1:return p(t);default:return c(t)}}},84854(t,e,i){var s=i(72958),r=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16],n=Array(4),a=Array(4),o=Array(4),h=Array(4),l=Array(4),u=Array(4),d=function(t,e,i){var s,r,h,l,u=e.noiseMode||0,d=void 0===e.noiseSmoothing?1:e.noiseSmoothing,p=Math.max(1,Math.min(t.length,4)),m=e.noiseCells||[32,32,32,32].slice(0,p);for(s=0;s1&&(o[1]=Math.floor(l/3)%3-1,p>2&&(o[2]=Math.floor(l/9)%3-1,p>3&&(o[3]=Math.floor(l/27)%3-1))),r=c(p,n,o,e,i),h=f(p,o,a,r),u){case 0:h0||e[1]>0)for(j[0]=U.x,j[1]=z.x,j[2]=Y.x,q[0]=U.y,q[1]=z.y,q[2]=Y.y,e[0]>0&&(j[0]=(U.x%e[0]+e[0])%e[0],j[1]=(z.x%e[0]+e[0])%e[0],j[2]=(Y.x%e[0]+e[0])%e[0]),e[1]>0&&(q[0]=(U.y%e[1]+e[1])%e[1],q[1]=(z.y%e[1]+e[1])%e[1],q[2]=(Y.y%e[1]+e[1])%e[1]),s=0;s<3;s++)H[s]=Math.floor(j[s]+.5*q[s]+.5),V[s]=Math.floor(q[s]+.5);else H[0]=n.x,H[1]=B.x,H[2]=k.x,V[0]=n.y,V[1]=B.y,V[2]=k.y;for(H[0]+=a[0],H[1]+=a[0],H[2]+=a[0],V[0]+=a[1],V[1]+=a[1],V[2]+=a[1],s=0;s<3;s++)K[s]=H[s]%289,K[s]<0&&(K[s]+=289);for(s=0;s<3;s++)K[s]=((51*K[s]+2)*K[s]+V[s])%289;for(s=0;s<3;s++)K[s]=(34*K[s]+10)*K[s]%289;for(s=0;s<3;s++)Z[s]=.07482*K[s]+i,Q[s]=Math.cos(Z[s]),J[s]=Math.sin(Z[s]);for($.x=Q[0],$.y=J[0],tt.x=Q[1],tt.y=J[1],et.x=Q[2],et.y=J[2],it[0]=.8-I(X,X),it[1]=.8-I(W,W),it[2]=.8-I(G,G),s=0;s<3;s++)it[s]=Math.max(it[s],0),st[s]=it[s]*it[s],rt[s]=st[s]*st[s];return nt[0]=I($,X),nt[1]=I(tt,W),nt[2]=I(et,G),10.9*(rt[0]*nt[0]+rt[1]*nt[1]+rt[2]*nt[2])},B=[0,0,0],k=[0,0,0],U=[0,0,0],z=[0,0,0],Y=[0,0,0],X=[0,0,0],W=[0,0,0],G=[0,0,0],H=[0,0,0],V=[0,0,0],j=[0,0,0],q=[0,0,0],K=[0,0,0],Z=[0,0,0],Q=[0,0,0],J=[0,0,0],$=[0,0,0],tt=[0,0,0],et=[0,0,0],it=[0,0,0],st=[0,0,0,0],rt=[0,0,0,0],nt=[0,0,0,0],at=[0,0,0,0],ot=[0,0,0,0],ht=[0,0,0,0],lt=[0,0,0,0],ut=[0,0,0,0],dt=[0,0,0,0],ct=[0,0,0,0],ft=[0,0,0,0],pt=[0,0,0,0],mt=[0,0,0,0],gt=[0,0,0,0],vt=[0,0,0,0],xt=[0,0,0,0],yt=[0,0,0,0],Tt=[0,0,0,0],wt=[0,0,0,0],St=[0,0,0,0],bt=[0,0,0,0],Et=[0,0,0,0],Ct=[0,0,0,0],At=[0,0,0,0],_t=[0,0,0,0],Mt=[0,0,0,0],Rt=[0,0,0,0],Ot=[0,0,0,0],Pt=function(t,e){for(var i=0;i<4;i++){var s=t[i]%289;s<0&&(s+=289),e[i]=(34*s+10)*s%289}},Lt=function(t,e,i){var s=B,r=k,n=U,o=z,h=Y,l=X,u=W,d=G,c=H,f=V,p=j,m=q,g=K,v=Z,x=Q,y=J,T=$,w=tt,S=et,b=it,E=st,C=rt,A=nt,_=at,M=ot,R=ht,O=lt,P=ut,L=dt,F=ct,D=ft,I=pt,N=mt,Lt=gt,Ft=vt,Dt=xt,It=yt,Nt=Tt,Bt=wt,kt=St,Ut=bt,zt=Et,Yt=Ct,Xt=At,Wt=_t,Gt=Mt,Ht=Rt,Vt=Ot;s[0]=0*t[0]+1*t[1]+1*t[2],s[1]=1*t[0]+0*t[1]+1*t[2],s[2]=1*t[0]+1*t[1]+0*t[2];for(var jt=0;jt<3;jt++)r[jt]=Math.floor(s[jt]),n[jt]=s[jt]-r[jt];for(o[0]=n[0]>n[1]?0:1,o[1]=n[1]>n[2]?0:1,o[2]=n[0]>n[2]?0:1,h[0]=1-o[0],h[1]=1-o[1],h[2]=1-o[2],l[0]=h[2],l[1]=o[0],l[2]=o[1],u[0]=h[0],u[1]=h[1],u[2]=o[2],jt=0;jt<3;jt++)d[jt]=Math.min(l[jt],u[jt]),c[jt]=Math.max(l[jt],u[jt]);for(jt=0;jt<3;jt++)f[jt]=r[jt]+d[jt],p[jt]=r[jt]+c[jt],m[jt]=r[jt]+1;var qt=r[0],Kt=r[1],Zt=r[2],Qt=f[0],Jt=f[1],$t=f[2],te=p[0],ee=p[1],ie=p[2],se=m[0],re=m[1],ne=m[2];for(g[0]=-.5*qt+.5*Kt+.5*Zt,g[1]=.5*qt-.5*Kt+.5*Zt,g[2]=.5*qt+.5*Kt-.5*Zt,v[0]=-.5*Qt+.5*Jt+.5*$t,v[1]=.5*Qt-.5*Jt+.5*$t,v[2]=.5*Qt+.5*Jt-.5*$t,x[0]=-.5*te+.5*ee+.5*ie,x[1]=.5*te-.5*ee+.5*ie,x[2]=.5*te+.5*ee-.5*ie,y[0]=-.5*se+.5*re+.5*ne,y[1]=.5*se-.5*re+.5*ne,y[2]=.5*se+.5*re-.5*ne,jt=0;jt<3;jt++)T[jt]=t[jt]-g[jt],w[jt]=t[jt]-v[jt],S[jt]=t[jt]-x[jt],b[jt]=t[jt]-y[jt];if(e[0]>0||e[1]>0||e[2]>0){if(E[0]=g[0],E[1]=v[0],E[2]=x[0],E[3]=y[0],C[0]=g[1],C[1]=v[1],C[2]=x[1],C[3]=y[1],A[0]=g[2],A[1]=v[2],A[2]=x[2],A[3]=y[2],e[0]>0)for(jt=0;jt<4;jt++)E[jt]=(E[jt]%e[0]+e[0])%e[0];if(e[1]>0)for(jt=0;jt<4;jt++)C[jt]=(C[jt]%e[1]+e[1])%e[1];if(e[2]>0)for(jt=0;jt<4;jt++)A[jt]=(A[jt]%e[2]+e[2])%e[2];var ae=E[0],oe=C[0],he=A[0],le=E[1],ue=C[1],de=A[1],ce=E[2],fe=C[2],pe=A[2],me=E[3],ge=C[3],ve=A[3];r[0]=Math.floor(0*ae+1*oe+1*he+.5),r[1]=Math.floor(1*ae+0*oe+1*he+.5),r[2]=Math.floor(1*ae+1*oe+0*he+.5),f[0]=Math.floor(0*le+1*ue+1*de+.5),f[1]=Math.floor(1*le+0*ue+1*de+.5),f[2]=Math.floor(1*le+1*ue+0*de+.5),p[0]=Math.floor(0*ce+1*fe+1*pe+.5),p[1]=Math.floor(1*ce+0*fe+1*pe+.5),p[2]=Math.floor(1*ce+1*fe+0*pe+.5),m[0]=Math.floor(0*me+1*ge+1*ve+.5),m[1]=Math.floor(1*me+0*ge+1*ve+.5),m[2]=Math.floor(1*me+1*ge+0*ve+.5)}r[0]+=a[0],r[1]+=a[1],r[2]+=a[2],f[0]+=a[0],f[1]+=a[1],f[2]+=a[2],p[0]+=a[0],p[1]+=a[1],p[2]+=a[2],m[0]+=a[0],m[1]+=a[1],m[2]+=a[2];var xe=st,ye=rt;for(xe[0]=r[2],xe[1]=f[2],xe[2]=p[2],xe[3]=m[2],Pt(xe,ye),ye[0]+=r[1],ye[1]+=f[1],ye[2]+=p[1],ye[3]+=m[1],Pt(ye,xe),xe[0]+=r[0],xe[1]+=f[0],xe[2]+=p[0],xe[3]+=m[0],Pt(xe,_),jt=0;jt<4;jt++)M[jt]=3.883222077*_[jt],R[jt]=.996539792-.006920415*_[jt],O[jt]=.108705628*_[jt],P[jt]=Math.cos(M[jt]),L[jt]=Math.sin(M[jt]),F[jt]=Math.sqrt(Math.max(0,1-R[jt]*R[jt]));if(0!==i)for(jt=0;jt<4;jt++)Lt[jt]=P[jt]*F[jt],Ft[jt]=L[jt]*F[jt],Dt[jt]=R[jt],It[jt]=Math.sin(O[jt]),Nt[jt]=Math.cos(O[jt]),Bt[jt]=L[jt]*It[jt]-P[jt]*Nt[jt],kt[jt]=(1-R[jt])*(Bt[jt]*L[jt])+R[jt]*It[jt],Ut[jt]=(1-R[jt])*(-Bt[jt]*P[jt])+R[jt]*Nt[jt],zt[jt]=-(Ft[jt]*Nt[jt]+Lt[jt]*It[jt]),Yt[jt]=Math.sin(i),Xt[jt]=Math.cos(i),D[jt]=Xt[jt]*Lt[jt]+Yt[jt]*kt[jt],I[jt]=Xt[jt]*Ft[jt]+Yt[jt]*Ut[jt],N[jt]=Xt[jt]*Dt[jt]+Yt[jt]*zt[jt];else for(jt=0;jt<4;jt++)D[jt]=P[jt]*F[jt],I[jt]=L[jt]*F[jt],N[jt]=R[jt];for(jt=0;jt<4;jt++){var Te=0===jt?T[0]:1===jt?w[0]:2===jt?S[0]:b[0],we=0===jt?T[1]:1===jt?w[1]:2===jt?S[1]:b[1],Se=0===jt?T[2]:1===jt?w[2]:2===jt?S[2]:b[2],be=Te*Te+we*we+Se*Se;Wt[jt]=.5-be,Wt[jt]<0&&(Wt[jt]=0),Gt[jt]=Wt[jt]*Wt[jt],Ht[jt]=Gt[jt]*Wt[jt]}for(jt=0;jt<4;jt++){var Ee=D[jt],Ce=I[jt],Ae=N[jt],_e=0===jt?T[0]:1===jt?w[0]:2===jt?S[0]:b[0],Me=0===jt?T[1]:1===jt?w[1]:2===jt?S[1]:b[1],Re=0===jt?T[2]:1===jt?w[2]:2===jt?S[2]:b[2];Vt[jt]=Ee*_e+Ce*Me+Ae*Re}var Oe=0;for(jt=0;jt<4;jt++)Oe+=Ht[jt]*Vt[jt];return 39.5*Oe};t.exports=function(t,s){"number"==typeof t&&(t=[t]),s||(s={});for(var h=Math.min(3,t.length);h<2;)t.push(0),h++;var l=s.noiseIterations||1,u=s.noiseWarpIterations||1,d=s.noiseDetailPower||2,c=s.noiseFlowPower||2,f=s.noiseContributionPower||2,p=s.noiseWarpDetailPower||2,m=s.noiseWarpFlowPower||2,g=s.noiseWarpContributionPower||2,v=s.noiseCells||[32,32,32],x=s.noiseOffset||[0,0,0],y=s.noiseWarpAmount||0;if(s.noiseSeed)for(var T=[1,2,3],w=0;w0&&u>0&&h>=2)if(2===h){var S=o(u,2,e,s,p,m,g);i[0]=e[0]+r[0],i[1]=e[1]+r[1];var b=o(u,2,i,s,p,m,g);e[0]+=S*y,e[1]+=b*y}else if(3===h){var E=o(u,3,e,s,p,m,g);i[0]=e[0]+r[0],i[1]=e[1]+r[1],i[2]=e[2]+r[2];var C=o(u,3,i,s,p,m,g);i[0]=e[0]+n[0],i[1]=e[1]+n[1],i[2]=e[2]+n[2];var A=o(u,3,i,s,p,m,g);e[0]+=E*y,e[1]+=C*y,e[2]+=A*y}return o(l,h,e,s,d,c,f)}},78702(t){t.exports=function(t){return t==parseFloat(t)?!(t%2):void 0}},94883(t){t.exports=function(t){return t===parseFloat(t)?!(t%2):void 0}},28915(t){t.exports=function(t,e,i){return(e-t)*i+t}},94908(t){t.exports=function(t,e,i){return void 0===i&&(i=0),t.clone().lerp(e,i)}},94434(t,e,i){var s=new(i(83419))({initialize:function(t){this.val=new Float32Array(9),t?this.copy(t):this.identity()},clone:function(){return new s(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this},fromMat4:function(t){var e=t.val,i=this.val;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[4],i[4]=e[5],i[5]=e[6],i[6]=e[8],i[7]=e[9],i[8]=e[10],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],s=t[5];return t[1]=t[3],t[2]=t[6],t[3]=e,t[5]=t[7],t[6]=i,t[7]=s,this},invert:function(){var t=this.val,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=l*n-a*h,d=-l*r+a*o,c=h*r-n*o,f=e*u+i*d+s*c;return f?(f=1/f,t[0]=u*f,t[1]=(-l*i+s*h)*f,t[2]=(a*i-s*n)*f,t[3]=d*f,t[4]=(l*e-s*o)*f,t[5]=(-a*e+s*r)*f,t[6]=c*f,t[7]=(-h*e+i*o)*f,t[8]=(n*e-i*r)*f,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return t[0]=n*l-a*h,t[1]=s*h-i*l,t[2]=i*a-s*n,t[3]=a*o-r*l,t[4]=e*l-s*o,t[5]=s*r-e*a,t[6]=r*h-n*o,t[7]=i*o-e*h,t[8]=e*n-i*r,this},determinant:function(){var t=this.val,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return e*(l*n-a*h)+i*(-l*r+a*o)+s*(h*r-n*o)},multiply:function(t){var e=this.val,i=e[0],s=e[1],r=e[2],n=e[3],a=e[4],o=e[5],h=e[6],l=e[7],u=e[8],d=t.val,c=d[0],f=d[1],p=d[2],m=d[3],g=d[4],v=d[5],x=d[6],y=d[7],T=d[8];return e[0]=c*i+f*n+p*h,e[1]=c*s+f*a+p*l,e[2]=c*r+f*o+p*u,e[3]=m*i+g*n+v*h,e[4]=m*s+g*a+v*l,e[5]=m*r+g*o+v*u,e[6]=x*i+y*n+T*h,e[7]=x*s+y*a+T*l,e[8]=x*r+y*o+T*u,this},translate:function(t){var e=this.val,i=t.x,s=t.y;return e[6]=i*e[0]+s*e[3]+e[6],e[7]=i*e[1]+s*e[4]+e[7],e[8]=i*e[2]+s*e[5]+e[8],this},rotate:function(t){var e=this.val,i=e[0],s=e[1],r=e[2],n=e[3],a=e[4],o=e[5],h=Math.sin(t),l=Math.cos(t);return e[0]=l*i+h*n,e[1]=l*s+h*a,e[2]=l*r+h*o,e[3]=l*n-h*i,e[4]=l*a-h*s,e[5]=l*o-h*r,this},scale:function(t){var e=this.val,i=t.x,s=t.y;return e[0]=i*e[0],e[1]=i*e[1],e[2]=i*e[2],e[3]=s*e[3],e[4]=s*e[4],e[5]=s*e[5],this},fromQuat:function(t){var e=t.x,i=t.y,s=t.z,r=t.w,n=e+e,a=i+i,o=s+s,h=e*n,l=e*a,u=e*o,d=i*a,c=i*o,f=s*o,p=r*n,m=r*a,g=r*o,v=this.val;return v[0]=1-(d+f),v[3]=l+g,v[6]=u-m,v[1]=l-g,v[4]=1-(h+f),v[7]=c+p,v[2]=u+m,v[5]=c-p,v[8]=1-(h+d),this},normalFromMat4:function(t){var e=t.val,i=this.val,s=e[0],r=e[1],n=e[2],a=e[3],o=e[4],h=e[5],l=e[6],u=e[7],d=e[8],c=e[9],f=e[10],p=e[11],m=e[12],g=e[13],v=e[14],x=e[15],y=s*h-r*o,T=s*l-n*o,w=s*u-a*o,S=r*l-n*h,b=r*u-a*h,E=n*u-a*l,C=d*g-c*m,A=d*v-f*m,_=d*x-p*m,M=c*v-f*g,R=c*x-p*g,O=f*x-p*v,P=y*O-T*R+w*M+S*_-b*A+E*C;return P?(P=1/P,i[0]=(h*O-l*R+u*M)*P,i[1]=(l*_-o*O-u*A)*P,i[2]=(o*R-h*_+u*C)*P,i[3]=(n*R-r*O-a*M)*P,i[4]=(s*O-n*_+a*A)*P,i[5]=(r*_-s*R-a*C)*P,i[6]=(g*E-v*b+x*S)*P,i[7]=(v*w-m*E-x*T)*P,i[8]=(m*b-g*w+x*y)*P,this):null}});t.exports=s},37867(t,e,i){var s=i(83419),r=i(25836),n=1e-6,a=new s({initialize:function(t){this.val=new Float32Array(16),t?this.copy(t):this.identity()},clone:function(){return new a(this)},set:function(t){return this.copy(t)},setValues:function(t,e,i,s,r,n,a,o,h,l,u,d,c,f,p,m){var g=this.val;return g[0]=t,g[1]=e,g[2]=i,g[3]=s,g[4]=r,g[5]=n,g[6]=a,g[7]=o,g[8]=h,g[9]=l,g[10]=u,g[11]=d,g[12]=c,g[13]=f,g[14]=p,g[15]=m,this},copy:function(t){var e=t.val;return this.setValues(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},fromArray:function(t){return this.setValues(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},zero:function(){return this.setValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)},transform:function(t,e,i){var s=o.fromQuat(i).val,r=e.x,n=e.y,a=e.z;return this.setValues(s[0]*r,s[1]*r,s[2]*r,0,s[4]*n,s[5]*n,s[6]*n,0,s[8]*a,s[9]*a,s[10]*a,0,t.x,t.y,t.z,1)},xyz:function(t,e,i){this.identity();var s=this.val;return s[12]=t,s[13]=e,s[14]=i,this},scaling:function(t,e,i){this.zero();var s=this.val;return s[0]=t,s[5]=e,s[10]=i,s[15]=1,this},identity:function(){return this.setValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)},transpose:function(){var t=this.val,e=t[1],i=t[2],s=t[3],r=t[6],n=t[7],a=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=e,t[6]=t[9],t[7]=t[13],t[8]=i,t[9]=r,t[11]=t[14],t[12]=s,t[13]=n,t[14]=a,this},getInverse:function(t){return this.copy(t),this.invert()},invert:function(){var t=this.val,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],d=t[10],c=t[11],f=t[12],p=t[13],m=t[14],g=t[15],v=e*a-i*n,x=e*o-s*n,y=e*h-r*n,T=i*o-s*a,w=i*h-r*a,S=s*h-r*o,b=l*p-u*f,E=l*m-d*f,C=l*g-c*f,A=u*m-d*p,_=u*g-c*p,M=d*g-c*m,R=v*M-x*_+y*A+T*C-w*E+S*b;return R?(R=1/R,this.setValues((a*M-o*_+h*A)*R,(s*_-i*M-r*A)*R,(p*S-m*w+g*T)*R,(d*w-u*S-c*T)*R,(o*C-n*M-h*E)*R,(e*M-s*C+r*E)*R,(m*y-f*S-g*x)*R,(l*S-d*y+c*x)*R,(n*_-a*C+h*b)*R,(i*C-e*_-r*b)*R,(f*w-p*y+g*v)*R,(u*y-l*w-c*v)*R,(a*E-n*A-o*b)*R,(e*A-i*E+s*b)*R,(p*x-f*T-m*v)*R,(l*T-u*x+d*v)*R)):this},adjoint:function(){var t=this.val,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],d=t[10],c=t[11],f=t[12],p=t[13],m=t[14],g=t[15];return this.setValues(a*(d*g-c*m)-u*(o*g-h*m)+p*(o*c-h*d),-(i*(d*g-c*m)-u*(s*g-r*m)+p*(s*c-r*d)),i*(o*g-h*m)-a*(s*g-r*m)+p*(s*h-r*o),-(i*(o*c-h*d)-a*(s*c-r*d)+u*(s*h-r*o)),-(n*(d*g-c*m)-l*(o*g-h*m)+f*(o*c-h*d)),e*(d*g-c*m)-l*(s*g-r*m)+f*(s*c-r*d),-(e*(o*g-h*m)-n*(s*g-r*m)+f*(s*h-r*o)),e*(o*c-h*d)-n*(s*c-r*d)+l*(s*h-r*o),n*(u*g-c*p)-l*(a*g-h*p)+f*(a*c-h*u),-(e*(u*g-c*p)-l*(i*g-r*p)+f*(i*c-r*u)),e*(a*g-h*p)-n*(i*g-r*p)+f*(i*h-r*a),-(e*(a*c-h*u)-n*(i*c-r*u)+l*(i*h-r*a)),-(n*(u*m-d*p)-l*(a*m-o*p)+f*(a*d-o*u)),e*(u*m-d*p)-l*(i*m-s*p)+f*(i*d-s*u),-(e*(a*m-o*p)-n*(i*m-s*p)+f*(i*o-s*a)),e*(a*d-o*u)-n*(i*d-s*u)+l*(i*o-s*a))},determinant:function(){var t=this.val,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],d=t[10],c=t[11],f=t[12],p=t[13],m=t[14],g=t[15];return(e*a-i*n)*(d*g-c*m)-(e*o-s*n)*(u*g-c*p)+(e*h-r*n)*(u*m-d*p)+(i*o-s*a)*(l*g-c*f)-(i*h-r*a)*(l*m-d*f)+(s*h-r*o)*(l*p-u*f)},multiply:function(t){var e=this.val,i=e[0],s=e[1],r=e[2],n=e[3],a=e[4],o=e[5],h=e[6],l=e[7],u=e[8],d=e[9],c=e[10],f=e[11],p=e[12],m=e[13],g=e[14],v=e[15],x=t.val,y=x[0],T=x[1],w=x[2],S=x[3];return e[0]=y*i+T*a+w*u+S*p,e[1]=y*s+T*o+w*d+S*m,e[2]=y*r+T*h+w*c+S*g,e[3]=y*n+T*l+w*f+S*v,y=x[4],T=x[5],w=x[6],S=x[7],e[4]=y*i+T*a+w*u+S*p,e[5]=y*s+T*o+w*d+S*m,e[6]=y*r+T*h+w*c+S*g,e[7]=y*n+T*l+w*f+S*v,y=x[8],T=x[9],w=x[10],S=x[11],e[8]=y*i+T*a+w*u+S*p,e[9]=y*s+T*o+w*d+S*m,e[10]=y*r+T*h+w*c+S*g,e[11]=y*n+T*l+w*f+S*v,y=x[12],T=x[13],w=x[14],S=x[15],e[12]=y*i+T*a+w*u+S*p,e[13]=y*s+T*o+w*d+S*m,e[14]=y*r+T*h+w*c+S*g,e[15]=y*n+T*l+w*f+S*v,this},multiplyLocal:function(t){var e=this.val,i=t.val;return this.setValues(e[0]*i[0]+e[1]*i[4]+e[2]*i[8]+e[3]*i[12],e[0]*i[1]+e[1]*i[5]+e[2]*i[9]+e[3]*i[13],e[0]*i[2]+e[1]*i[6]+e[2]*i[10]+e[3]*i[14],e[0]*i[3]+e[1]*i[7]+e[2]*i[11]+e[3]*i[15],e[4]*i[0]+e[5]*i[4]+e[6]*i[8]+e[7]*i[12],e[4]*i[1]+e[5]*i[5]+e[6]*i[9]+e[7]*i[13],e[4]*i[2]+e[5]*i[6]+e[6]*i[10]+e[7]*i[14],e[4]*i[3]+e[5]*i[7]+e[6]*i[11]+e[7]*i[15],e[8]*i[0]+e[9]*i[4]+e[10]*i[8]+e[11]*i[12],e[8]*i[1]+e[9]*i[5]+e[10]*i[9]+e[11]*i[13],e[8]*i[2]+e[9]*i[6]+e[10]*i[10]+e[11]*i[14],e[8]*i[3]+e[9]*i[7]+e[10]*i[11]+e[11]*i[15],e[12]*i[0]+e[13]*i[4]+e[14]*i[8]+e[15]*i[12],e[12]*i[1]+e[13]*i[5]+e[14]*i[9]+e[15]*i[13],e[12]*i[2]+e[13]*i[6]+e[14]*i[10]+e[15]*i[14],e[12]*i[3]+e[13]*i[7]+e[14]*i[11]+e[15]*i[15])},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var i=t.val,s=e.val,r=i[0],n=i[4],a=i[8],o=i[12],h=i[1],l=i[5],u=i[9],d=i[13],c=i[2],f=i[6],p=i[10],m=i[14],g=i[3],v=i[7],x=i[11],y=i[15],T=s[0],w=s[4],S=s[8],b=s[12],E=s[1],C=s[5],A=s[9],_=s[13],M=s[2],R=s[6],O=s[10],P=s[14],L=s[3],F=s[7],D=s[11],I=s[15];return this.setValues(r*T+n*E+a*M+o*L,h*T+l*E+u*M+d*L,c*T+f*E+p*M+m*L,g*T+v*E+x*M+y*L,r*w+n*C+a*R+o*F,h*w+l*C+u*R+d*F,c*w+f*C+p*R+m*F,g*w+v*C+x*R+y*F,r*S+n*A+a*O+o*D,h*S+l*A+u*O+d*D,c*S+f*A+p*O+m*D,g*S+v*A+x*O+y*D,r*b+n*_+a*P+o*I,h*b+l*_+u*P+d*I,c*b+f*_+p*P+m*I,g*b+v*_+x*P+y*I)},translate:function(t){return this.translateXYZ(t.x,t.y,t.z)},translateXYZ:function(t,e,i){var s=this.val;return s[12]=s[0]*t+s[4]*e+s[8]*i+s[12],s[13]=s[1]*t+s[5]*e+s[9]*i+s[13],s[14]=s[2]*t+s[6]*e+s[10]*i+s[14],s[15]=s[3]*t+s[7]*e+s[11]*i+s[15],this},scale:function(t){return this.scaleXYZ(t.x,t.y,t.z)},scaleXYZ:function(t,e,i){var s=this.val;return s[0]=s[0]*t,s[1]=s[1]*t,s[2]=s[2]*t,s[3]=s[3]*t,s[4]=s[4]*e,s[5]=s[5]*e,s[6]=s[6]*e,s[7]=s[7]*e,s[8]=s[8]*i,s[9]=s[9]*i,s[10]=s[10]*i,s[11]=s[11]*i,this},makeRotationAxis:function(t,e){var i=Math.cos(e),s=Math.sin(e),r=1-i,n=t.x,a=t.y,o=t.z,h=r*n,l=r*a;return this.setValues(h*n+i,h*a-s*o,h*o+s*a,0,h*a+s*o,l*a+i,l*o-s*n,0,h*o-s*a,l*o+s*n,r*o*o+i,0,0,0,0,1)},rotate:function(t,e){var i=this.val,s=e.x,r=e.y,a=e.z,o=Math.sqrt(s*s+r*r+a*a);if(Math.abs(o)1?void 0!==s?(r=(s-t)/(s-i))<0&&(r=0):r=1:r<0&&(r=0),r}},15746(t,e,i){var s=i(83419),r=i(94434),n=i(29747),a=i(25836),o=1e-6,h=new Int8Array([1,2,0]),l=new Float32Array([0,0,0]),u=new a(1,0,0),d=new a(0,1,0),c=new a,f=new r,p=new s({initialize:function(t,e,i,s){this.onChangeCallback=n,this.set(t,e,i,s)},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},w:{get:function(){return this._w},set:function(t){this._w=t,this.onChangeCallback(this)}},copy:function(t){return this.set(t)},set:function(t,e,i,s,r){return void 0===r&&(r=!0),"object"==typeof t?(this._x=t.x||0,this._y=t.y||0,this._z=t.z||0,this._w=t.w||0):(this._x=t||0,this._y=e||0,this._z=i||0,this._w=s||0),r&&this.onChangeCallback(this),this},add:function(t){return this._x+=t.x,this._y+=t.y,this._z+=t.z,this._w+=t.w,this.onChangeCallback(this),this},subtract:function(t){return this._x-=t.x,this._y-=t.y,this._z-=t.z,this._w-=t.w,this.onChangeCallback(this),this},scale:function(t){return this._x*=t,this._y*=t,this._z*=t,this._w*=t,this.onChangeCallback(this),this},length:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return Math.sqrt(t*t+e*e+i*i+s*s)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return t*t+e*e+i*i+s*s},normalize:function(){var t=this.x,e=this.y,i=this.z,s=this.w,r=t*t+e*e+i*i+s*s;return r>0&&(r=1/Math.sqrt(r),this._x=t*r,this._y=e*r,this._z=i*r,this._w=s*r),this.onChangeCallback(this),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,r=this.z,n=this.w;return this.set(i+e*(t.x-i),s+e*(t.y-s),r+e*(t.z-r),n+e*(t.w-n))},rotationTo:function(t,e){var i=t.x*e.x+t.y*e.y+t.z*e.z;return i<-.999999?(c.copy(u).cross(t).length().999999?this.set(0,0,0,1):(c.copy(t).cross(e),this._x=c.x,this._y=c.y,this._z=c.z,this._w=1+i,this.normalize())},setAxes:function(t,e,i){var s=f.val;return s[0]=e.x,s[3]=e.y,s[6]=e.z,s[1]=i.x,s[4]=i.y,s[7]=i.z,s[2]=-t.x,s[5]=-t.y,s[8]=-t.z,this.fromMat3(f).normalize()},identity:function(){return this.set(0,0,0,1)},setAxisAngle:function(t,e){e*=.5;var i=Math.sin(e);return this.set(i*t.x,i*t.y,i*t.z,Math.cos(e))},multiply:function(t){var e=this.x,i=this.y,s=this.z,r=this.w,n=t.x,a=t.y,o=t.z,h=t.w;return this.set(e*h+r*n+i*o-s*a,i*h+r*a+s*n-e*o,s*h+r*o+e*a-i*n,r*h-e*n-i*a-s*o)},slerp:function(t,e){var i=this.x,s=this.y,r=this.z,n=this.w,a=t.x,h=t.y,l=t.z,u=t.w,d=i*a+s*h+r*l+n*u;d<0&&(d=-d,a=-a,h=-h,l=-l,u=-u);var c=1-e,f=e;if(1-d>o){var p=Math.acos(d),m=Math.sin(p);c=Math.sin((1-e)*p)/m,f=Math.sin(e*p)/m}return this.set(c*i+f*a,c*s+f*h,c*r+f*l,c*n+f*u)},invert:function(){var t=this.x,e=this.y,i=this.z,s=this.w,r=t*t+e*e+i*i+s*s,n=r?1/r:0;return this.set(-t*n,-e*n,-i*n,s*n)},conjugate:function(){return this._x=-this.x,this._y=-this.y,this._z=-this.z,this.onChangeCallback(this),this},rotateX:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,r=this.w,n=Math.sin(t),a=Math.cos(t);return this.set(e*a+r*n,i*a+s*n,s*a-i*n,r*a-e*n)},rotateY:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,r=this.w,n=Math.sin(t),a=Math.cos(t);return this.set(e*a-s*n,i*a+r*n,s*a+e*n,r*a-i*n)},rotateZ:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,r=this.w,n=Math.sin(t),a=Math.cos(t);return this.set(e*a+i*n,i*a-e*n,s*a+r*n,r*a-s*n)},calculateW:function(){var t=this.x,e=this.y,i=this.z;return this.w=-Math.sqrt(1-t*t-e*e-i*i),this},setFromEuler:function(t,e){var i=t.x/2,s=t.y/2,r=t.z/2,n=Math.cos(i),a=Math.cos(s),o=Math.cos(r),h=Math.sin(i),l=Math.sin(s),u=Math.sin(r);switch(t.order){case"XYZ":this.set(h*a*o+n*l*u,n*l*o-h*a*u,n*a*u+h*l*o,n*a*o-h*l*u,e);break;case"YXZ":this.set(h*a*o+n*l*u,n*l*o-h*a*u,n*a*u-h*l*o,n*a*o+h*l*u,e);break;case"ZXY":this.set(h*a*o-n*l*u,n*l*o+h*a*u,n*a*u+h*l*o,n*a*o-h*l*u,e);break;case"ZYX":this.set(h*a*o-n*l*u,n*l*o+h*a*u,n*a*u-h*l*o,n*a*o+h*l*u,e);break;case"YZX":this.set(h*a*o+n*l*u,n*l*o+h*a*u,n*a*u-h*l*o,n*a*o-h*l*u,e);break;case"XZY":this.set(h*a*o-n*l*u,n*l*o-h*a*u,n*a*u+h*l*o,n*a*o+h*l*u,e)}return this},setFromRotationMatrix:function(t){var e,i=t.val,s=i[0],r=i[4],n=i[8],a=i[1],o=i[5],h=i[9],l=i[2],u=i[6],d=i[10],c=s+o+d;return c>0?(e=.5/Math.sqrt(c+1),this.set((u-h)*e,(n-l)*e,(a-r)*e,.25/e)):s>o&&s>d?(e=2*Math.sqrt(1+s-o-d),this.set(.25*e,(r+a)/e,(n+l)/e,(u-h)/e)):o>d?(e=2*Math.sqrt(1+o-s-d),this.set((r+a)/e,.25*e,(h+u)/e,(n-l)/e)):(e=2*Math.sqrt(1+d-s-o),this.set((n+l)/e,(h+u)/e,.25*e,(a-r)/e)),this},fromMat3:function(t){var e,i=t.val,s=i[0]+i[4]+i[8];if(s>0)e=Math.sqrt(s+1),this.w=.5*e,e=.5/e,this._x=(i[7]-i[5])*e,this._y=(i[2]-i[6])*e,this._z=(i[3]-i[1])*e;else{var r=0;i[4]>i[0]&&(r=1),i[8]>i[3*r+r]&&(r=2);var n=h[r],a=h[n];e=Math.sqrt(i[3*r+r]-i[3*n+n]-i[3*a+a]+1),l[r]=.5*e,e=.5/e,l[n]=(i[3*n+r]+i[3*r+n])*e,l[a]=(i[3*a+r]+i[3*r+a])*e,this._x=l[0],this._y=l[1],this._z=l[2],this._w=(i[3*a+n]-i[3*n+a])*e}return this.onChangeCallback(this),this}});t.exports=p},43396(t,e,i){var s=i(36383);t.exports=function(t){return t*s.RAD_TO_DEG}},74362(t){t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI;return t.x=Math.cos(i)*e,t.y=Math.sin(i)*e,t}},60706(t){t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI,s=2*Math.random()-1,r=Math.sqrt(1-s*s)*e;return t.x=Math.cos(i)*r,t.y=Math.sin(i)*r,t.z=s*e,t}},67421(t){t.exports=function(t,e){return void 0===e&&(e=1),t.x=(2*Math.random()-1)*e,t.y=(2*Math.random()-1)*e,t.z=(2*Math.random()-1)*e,t.w=(2*Math.random()-1)*e,t}},36305(t){t.exports=function(t,e){var i=t.x,s=t.y;return t.x=i*Math.cos(e)-s*Math.sin(e),t.y=i*Math.sin(e)+s*Math.cos(e),t}},11520(t){t.exports=function(t,e,i,s){var r=Math.cos(s),n=Math.sin(s),a=t.x-e,o=t.y-i;return t.x=a*r-o*n+e,t.y=a*n+o*r+i,t}},1163(t){t.exports=function(t,e,i,s,r){var n=s+Math.atan2(t.y-i,t.x-e);return t.x=e+r*Math.cos(n),t.y=i+r*Math.sin(n),t}},70336(t){t.exports=function(t,e,i,s,r){return t.x=e+r*Math.cos(s),t.y=i+r*Math.sin(s),t}},72678(t,e,i){var s=i(25836),r=i(37867),n=i(15746),a=new r,o=new n,h=new s;t.exports=function(t,e,i){return o.setAxisAngle(e,i),a.fromRotationTranslation(o,h.set(0,0,0)),t.transformMat4(a)}},2284(t){t.exports=function(t){return t>0?Math.ceil(t):Math.floor(t)}},41013(t){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.round(t*s)/s}},7602(t){t.exports=function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)}},54261(t){t.exports=function(t,e,i){return(t=Math.max(0,Math.min(1,(t-e)/(i-e))))*t*t*(t*(6*t-15)+10)}},44408(t,e,i){var s=i(26099);t.exports=function(t,e,i,r){void 0===r&&(r=new s);var n=0,a=0;return t>0&&t<=e*i&&(n=t>e-1?t-(a=Math.floor(t/e))*e:t),r.set(n,a)}},85955(t,e,i){var s=i(26099);t.exports=function(t,e,i,r,n,a,o,h){void 0===h&&(h=new s);var l=Math.sin(n),u=Math.cos(n),d=u*a,c=l*a,f=-l*o,p=u*o,m=1/(d*p+f*-c);return h.x=p*m*t+-f*m*e+(r*f-i*p)*m,h.y=d*m*e+-c*m*t+(-r*d+i*c)*m,h}},26099(t,e,i){var s=i(83419),r=i(43855),n=new s({initialize:function(t,e){this.x=0,this.y=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0):(void 0===e&&(e=t),this.x=t||0,this.y=e||0)},clone:function(){return new n(this.x,this.y)},copy:function(t){return this.x=t.x||0,this.y=t.y||0,this},setFromObject:function(t){return this.x=t.x||0,this.y=t.y||0,this},set:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setTo:function(t,e){return this.set(t,e)},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},invert:function(){return this.set(this.y,this.x)},setToPolar:function(t,e){return null==e&&(e=1),this.x=Math.cos(t)*e,this.y=Math.sin(t)*e,this},equals:function(t){return this.x===t.x&&this.y===t.y},fuzzyEquals:function(t,e){return r(this.x,t.x,e)&&r(this.y,t.y,e)},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},setAngle:function(t){return this.setToPolar(t,this.length())},add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t):(this.x=0,this.y=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},negate:function(){return this.x=-this.x,this.y=-this.y,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},length:function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)},setLength:function(t){return this.normalize().scale(t)},lengthSq:function(){var t=this.x,e=this.y;return t*t+e*e},normalize:function(){var t=this.x,e=this.y,i=t*t+e*e;return i>0&&(i=1/Math.sqrt(i),this.x=t*i,this.y=e*i),this},normalizeRightHand:function(){var t=this.x;return this.x=-1*this.y,this.y=t,this},normalizeLeftHand:function(){var t=this.x;return this.x=this.y,this.y=-1*t,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this},transformMat3:function(t){var e=this.x,i=this.y,s=t.val;return this.x=s[0]*e+s[3]*i+s[6],this.y=s[1]*e+s[4]*i+s[7],this},transformMat4:function(t){var e=this.x,i=this.y,s=t.val;return this.x=s[0]*e+s[4]*i+s[12],this.y=s[1]*e+s[5]*i+s[13],this},reset:function(){return this.x=0,this.y=0,this},limit:function(t){var e=this.length();return e&&e>t&&this.scale(t/e),this},reflect:function(t){return t=t.clone().normalize(),this.subtract(t.scale(2*this.dot(t)))},mirror:function(t){return this.reflect(t).negate()},rotate:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e*this.x-i*this.y,i*this.x+e*this.y)},project:function(t){var e=this.dot(t)/t.dot(t);return this.copy(t).scale(e)},projectUnit:function(t,e){void 0===e&&(e=new n);var i=this.x*t.x+this.y*t.y;return 0!==i&&(e.x=i*t.x,e.y=i*t.y),e}});n.ZERO=new n,n.RIGHT=new n(1,0),n.LEFT=new n(-1,0),n.UP=new n(0,-1),n.DOWN=new n(0,1),n.ONE=new n(1,1),t.exports=n},25836(t,e,i){var s=new(i(83419))({initialize:function(t,e,i){this.x=0,this.y=0,this.z=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0)},up:function(){return this.x=0,this.y=1,this.z=0,this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clone:function(){return new s(this.x,this.y,this.z)},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},crossVectors:function(t,e){var i=t.x,s=t.y,r=t.z,n=e.x,a=e.y,o=e.z;return this.x=s*o-r*a,this.y=r*n-i*o,this.z=i*a-s*n,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this},set:function(t,e,i){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0),this},setFromMatrixPosition:function(t){return this.fromArray(t.val,12)},setFromMatrixColumn:function(t,e){return this.fromArray(t.val,4*e)},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addScale:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t):(this.x=0,this.y=0,this.z=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0;return Math.sqrt(e*e+i*i+s*s)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0;return e*e+i*i+s*s},length:function(){var t=this.x,e=this.y,i=this.z;return Math.sqrt(t*t+e*e+i*i)},lengthSq:function(){var t=this.x,e=this.y,i=this.z;return t*t+e*e+i*i},normalize:function(){var t=this.x,e=this.y,i=this.z,s=t*t+e*e+i*i;return s>0&&(s=1/Math.sqrt(s),this.x=t*s,this.y=e*s,this.z=i*s),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},cross:function(t){var e=this.x,i=this.y,s=this.z,r=t.x,n=t.y,a=t.z;return this.x=i*a-s*n,this.y=s*r-e*a,this.z=e*n-i*r,this},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,r=this.z;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this.z=r+e*(t.z-r),this},applyMatrix3:function(t){var e=this.x,i=this.y,s=this.z,r=t.val;return this.x=r[0]*e+r[3]*i+r[6]*s,this.y=r[1]*e+r[4]*i+r[7]*s,this.z=r[2]*e+r[5]*i+r[8]*s,this},applyMatrix4:function(t){var e=this.x,i=this.y,s=this.z,r=t.val,n=1/(r[3]*e+r[7]*i+r[11]*s+r[15]);return this.x=(r[0]*e+r[4]*i+r[8]*s+r[12])*n,this.y=(r[1]*e+r[5]*i+r[9]*s+r[13])*n,this.z=(r[2]*e+r[6]*i+r[10]*s+r[14])*n,this},transformMat3:function(t){var e=this.x,i=this.y,s=this.z,r=t.val;return this.x=e*r[0]+i*r[3]+s*r[6],this.y=e*r[1]+i*r[4]+s*r[7],this.z=e*r[2]+i*r[5]+s*r[8],this},transformMat4:function(t){var e=this.x,i=this.y,s=this.z,r=t.val;return this.x=r[0]*e+r[4]*i+r[8]*s+r[12],this.y=r[1]*e+r[5]*i+r[9]*s+r[13],this.z=r[2]*e+r[6]*i+r[10]*s+r[14],this},transformCoordinates:function(t){var e=this.x,i=this.y,s=this.z,r=t.val,n=e*r[0]+i*r[4]+s*r[8]+r[12],a=e*r[1]+i*r[5]+s*r[9]+r[13],o=e*r[2]+i*r[6]+s*r[10]+r[14],h=e*r[3]+i*r[7]+s*r[11]+r[15];return this.x=n/h,this.y=a/h,this.z=o/h,this},transformQuat:function(t){var e=this.x,i=this.y,s=this.z,r=t.x,n=t.y,a=t.z,o=t.w,h=o*e+n*s-a*i,l=o*i+a*e-r*s,u=o*s+r*i-n*e,d=-r*e-n*i-a*s;return this.x=h*o+d*-r+l*-a-u*-n,this.y=l*o+d*-n+u*-r-h*-a,this.z=u*o+d*-a+h*-n-l*-r,this},project:function(t){var e=this.x,i=this.y,s=this.z,r=t.val,n=r[0],a=r[1],o=r[2],h=r[3],l=r[4],u=r[5],d=r[6],c=r[7],f=r[8],p=r[9],m=r[10],g=r[11],v=r[12],x=r[13],y=r[14],T=1/(e*h+i*c+s*g+r[15]);return this.x=(e*n+i*l+s*f+v)*T,this.y=(e*a+i*u+s*p+x)*T,this.z=(e*o+i*d+s*m+y)*T,this},projectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unprojectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unproject:function(t,e){var i=t.x,s=t.y,r=t.z,n=t.w,a=this.x-i,o=n-this.y-1-s,h=this.z;return this.x=2*a/r-1,this.y=2*o/n-1,this.z=2*h-1,this.project(e)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});s.ZERO=new s,s.RIGHT=new s(1,0,0),s.LEFT=new s(-1,0,0),s.UP=new s(0,-1,0),s.DOWN=new s(0,1,0),s.FORWARD=new s(0,0,1),s.BACK=new s(0,0,-1),s.ONE=new s(1,1,1),t.exports=s},61369(t,e,i){var s=new(i(83419))({initialize:function(t,e,i,s){this.x=0,this.y=0,this.z=0,this.w=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=s||0)},clone:function(){return new s(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this.w=t.w||0,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},set:function(t,e,i,s){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=s||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this.w+=t.w||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this.w-=t.w||0,this},scale:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},length:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return Math.sqrt(t*t+e*e+i*i+s*s)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return t*t+e*e+i*i+s*s},normalize:function(){var t=this.x,e=this.y,i=this.z,s=this.w,r=t*t+e*e+i*i+s*s;return r>0&&(r=1/Math.sqrt(r),this.x=t*r,this.y=e*r,this.z=i*r,this.w=s*r),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,r=this.z,n=this.w;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this.z=r+e*(t.z-r),this.w=n+e*(t.w-n),this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this.w*=t.w||1,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this.w/=t.w||1,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0,r=t.w-this.w||0;return Math.sqrt(e*e+i*i+s*s+r*r)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0,r=t.w-this.w||0;return e*e+i*i+s*s+r*r},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},transformMat4:function(t){var e=this.x,i=this.y,s=this.z,r=this.w,n=t.val;return this.x=n[0]*e+n[4]*i+n[8]*s+n[12]*r,this.y=n[1]*e+n[5]*i+n[9]*s+n[13]*r,this.z=n[2]*e+n[6]*i+n[10]*s+n[14]*r,this.w=n[3]*e+n[7]*i+n[11]*s+n[15]*r,this},transformQuat:function(t){var e=this.x,i=this.y,s=this.z,r=t.x,n=t.y,a=t.z,o=t.w,h=o*e+n*s-a*i,l=o*i+a*e-r*s,u=o*s+r*i-n*e,d=-r*e-n*i-a*s;return this.x=h*o+d*-r+l*-a-u*-n,this.y=l*o+d*-n+u*-r-h*-a,this.z=u*o+d*-a+h*-n-l*-r,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});s.prototype.sub=s.prototype.subtract,s.prototype.mul=s.prototype.multiply,s.prototype.div=s.prototype.divide,s.prototype.dist=s.prototype.distance,s.prototype.distSq=s.prototype.distanceSq,s.prototype.len=s.prototype.length,s.prototype.lenSq=s.prototype.lengthSq,t.exports=s},60417(t){t.exports=function(t,e,i){return Math.abs(t-e)<=i}},15994(t){t.exports=function(t,e,i){var s=i-e;return e+((t-e)%s+s)%s}},31040(t){t.exports=function(t,e,i,s){return Math.atan2(s-e,i-t)}},55495(t){t.exports=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}},128(t){t.exports=function(t,e){return Math.atan2(e.x-t.x,e.y-t.y)}},41273(t){t.exports=function(t,e,i,s){return Math.atan2(i-t,s-e)}},1432(t,e,i){var s=i(36383);t.exports=function(t){return t>Math.PI&&(t-=s.TAU),Math.abs(((t+s.PI_OVER_2)%s.TAU-s.TAU)%s.TAU)}},49127(t,e,i){var s=i(12407);t.exports=function(t,e){return s(e-t)}},52285(t,e,i){var s=i(36383),r=i(12407),n=s.TAU;t.exports=function(t,e){var i=r(e-t);return i>0&&(i-=n),i}},67317(t,e,i){var s=i(86554);t.exports=function(t,e){return s(e-t)}},12407(t){t.exports=function(t){return(t%=2*Math.PI)>=0?t:t+2*Math.PI}},53993(t,e,i){var s=i(99472);t.exports=function(){return s(-Math.PI,Math.PI)}},86564(t,e,i){var s=i(99472);t.exports=function(){return s(-180,180)}},90154(t,e,i){var s=i(12407);t.exports=function(t){return s(t+Math.PI)}},48736(t,e,i){var s=i(36383);t.exports=function(t,e,i){return void 0===i&&(i=.05),t===e||(Math.abs(e-t)<=i||Math.abs(e-t)>=s.TAU-i?t=e:(Math.abs(e-t)>Math.PI&&(et?t+=i:e=1?1:1/e*(1+(e*t|0))}},49752(t,e,i){t.exports=i(72251)},75698(t){t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.ceil(t-e)}},43855(t){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),Math.abs(t-e)e-i}},94977(t){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t1?t[i]-(s(r-i,t[i],t[i],t[i-1],t[i-1])-t[i]):s(r-n,t[n?n-1:0],t[n],t[i1?s(t[i],t[i-1],i-r):s(t[n],t[n+1>i?i:n+1],r-n)}},32112(t){t.exports=function(t,e,i,s){return function(t,e){var i=1-t;return i*i*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,i)+function(t,e){return t*t*e}(t,s)}},47235(t,e,i){var s=i(7602);t.exports=function(t,e,i){return e+(i-e)*s(t,0,1)}},50178(t,e,i){var s=i(54261);t.exports=function(t,e,i){return e+(i-e)*s(t,0,1)}},38289(t,e,i){t.exports={Bezier:i(89318),CatmullRom:i(77259),CubicBezier:i(36316),Linear:i(28392),QuadraticBezier:i(32112),SmoothStep:i(47235),SmootherStep:i(50178)}},98439(t){t.exports=function(t){var e=Math.log(t)/.6931471805599453;return 1<0&&!(t&t-1)&&e>0&&!(e&e-1)}},81230(t){t.exports=function(t){return t>0&&!(t&t-1)}},49001(t,e,i){t.exports={GetNext:i(98439),IsSize:i(50030),IsValue:i(81230)}},28453(t,e,i){var s=new(i(83419))({initialize:function(t){void 0===t&&(t=[(Date.now()*Math.random()).toString()]),this.c=1,this.s0=0,this.s1=0,this.s2=0,this.n=0,this.signs=[-1,1],t&&this.init(t)},rnd:function(){var t=2091639*this.s0+2.3283064365386963e-10*this.c;return this.c=0|t,this.s0=this.s1,this.s1=this.s2,this.s2=t-this.c,this.s2},hash:function(t){var e,i=this.n;t=t.toString();for(var s=0;s>>0,i=(e*=i)>>>0,i+=4294967296*(e-=i);return this.n=i,2.3283064365386963e-10*(i>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e0;e--){var i=Math.floor(this.frac()*(e+1)),s=t[i];t[i]=t[e],t[e]=s}return t}});t.exports=s},63448(t){t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.ceil(t/e),s?(i+t)/e:i+t)}},56583(t){t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.floor(t/e),s?(i+t)/e:i+t)}},77720(t){t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.round(t/e),s?(i+t)/e:i+t)}},73697(t,e,i){t.exports={Ceil:i(63448),Floor:i(56583),To:i(77720)}},97139(t,e,i){i(63595);var s=i(8054),r=i(79291),n={Actions:i(61061),Animations:i(60421),BlendModes:i(10312),Cache:i(83388),Cameras:i(26638),Core:i(42857),Class:i(83419),Curves:i(25410),Data:i(44965),Display:i(27460),DOM:i(84902),Events:i(93055),Filters:i(11889),Game:i(50127),GameObjects:i(77856),Geom:i(55738),Input:i(14350),Loader:i(57777),Math:i(75508),Physics:{Arcade:i(27064)},Plugins:i(18922),Renderer:i(36909),Scale:i(93364),ScaleModes:i(29795),Scene:i(97482),Scenes:i(62194),Structs:i(41392),Textures:i(27458),Tilemaps:i(62501),Time:i(90291),TintModes:i(84322),Tweens:i(43066),Utils:i(91799)};n.Sound=i(23717),n=r(!1,n,s),t.exports=n,i.g.Phaser=n},71289(t,e,i){var s=i(83419),r=i(92209),n=i(88571),a=new s({Extends:n,Mixins:[r.Acceleration,r.Angular,r.Bounce,r.Collision,r.Debug,r.Drag,r.Enable,r.Friction,r.Gravity,r.Immovable,r.Mass,r.Pushable,r.Size,r.Velocity],initialize:function(t,e,i,s,r){n.call(this,t,e,i,s,r),this.body=null}});t.exports=a},86689(t,e,i){var s=i(83419),r=i(39506),n=i(20339),a=i(89774),o=i(66022),h=i(95540),l=i(46975),u=i(72441),d=i(47956),c=i(37277),f=i(44594),p=i(26099),m=i(82248),g=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.config=this.getConfig(),this.world,this.add,this._category=1,t.sys.events.once(f.BOOT,this.boot,this),t.sys.events.on(f.START,this.start,this)},boot:function(){this.world=new m(this.scene,this.config),this.add=new o(this.world),this.systems.events.once(f.DESTROY,this.destroy,this)},start:function(){this.world||(this.world=new m(this.scene,this.config),this.add=new o(this.world));var t=this.systems.events;h(this.config,"customUpdate",!1)||t.on(f.UPDATE,this.world.update,this.world),t.on(f.POST_UPDATE,this.world.postUpdate,this.world),t.once(f.SHUTDOWN,this.shutdown,this)},enableUpdate:function(){this.systems.events.on(f.UPDATE,this.world.update,this.world)},disableUpdate:function(){this.systems.events.off(f.UPDATE,this.world.update,this.world)},getConfig:function(){var t=this.systems.game.config.physics,e=this.systems.settings.physics;return l(h(e,"arcade",{}),h(t,"arcade",{}))},nextCategory:function(){return this._category=this._category<<1,this._category},overlap:function(t,e,i,s,r){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===r&&(r=i),this.world.collideObjects(t,e,i,s,r,!0)},collide:function(t,e,i,s,r){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===r&&(r=i),this.world.collideObjects(t,e,i,s,r,!1)},collideTiles:function(t,e,i,s,r){return this.world.collideTiles(t,e,i,s,r)},overlapTiles:function(t,e,i,s,r){return this.world.overlapTiles(t,e,i,s,r)},pause:function(){return this.world.pause()},resume:function(){return this.world.resume()},accelerateTo:function(t,e,i,s,r,n){void 0===s&&(s=60);var a=Math.atan2(i-t.y,e-t.x);return t.body.acceleration.setToPolar(a,s),void 0!==r&&void 0!==n&&t.body.maxVelocity.set(r,n),a},accelerateToObject:function(t,e,i,s,r){return this.accelerateTo(t,e.x,e.y,i,s,r)},closest:function(t,e){e||(e=Array.from(this.world.bodies));for(var i=Number.MAX_VALUE,s=null,r=t.x,n=t.y,o=e.length,h=0;hi&&(s=l,i=d)}}return s},moveTo:function(t,e,i,s,r){void 0===s&&(s=60),void 0===r&&(r=0);var a=Math.atan2(i-t.y,e-t.x);return r>0&&(s=n(t.x,t.y,e,i)/(r/1e3)),t.body.velocity.setToPolar(a,s),a},moveToObject:function(t,e,i,s){return this.moveTo(t,e.x,e.y,i,s)},velocityFromAngle:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new p),i.setToPolar(r(t),e)},velocityFromRotation:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new p),i.setToPolar(t,e)},overlapRect:function(t,e,i,s,r,n){return d(this.world,t,e,i,s,r,n)},overlapCirc:function(t,e,i,s,r){return u(this.world,t,e,i,s,r)},shutdown:function(){if(this.world){var t=this.systems.events;t.off(f.UPDATE,this.world.update,this.world),t.off(f.POST_UPDATE,this.world.postUpdate,this.world),t.off(f.SHUTDOWN,this.shutdown,this),this.add.destroy(),this.world.destroy(),this.add=null,this.world=null,this._category=1}},destroy:function(){this.shutdown(),this.scene.sys.events.off(f.START,this.start,this),this.scene=null,this.systems=null}});c.register("ArcadePhysics",g,"arcadePhysics"),t.exports=g},13759(t,e,i){var s=i(83419),r=i(92209),n=i(68287),a=new s({Extends:n,Mixins:[r.Acceleration,r.Angular,r.Bounce,r.Collision,r.Debug,r.Drag,r.Enable,r.Friction,r.Gravity,r.Immovable,r.Mass,r.Pushable,r.Size,r.Velocity],initialize:function(t,e,i,s,r){n.call(this,t,e,i,s,r),this.body=null}});t.exports=a},37742(t,e,i){var s=i(83419),r=i(78389),n=i(37747),a=i(63012),o=i(43396),h=i(87841),l=i(37303),u=i(95829),d=i(26099),c=new s({Mixins:[r],initialize:function(t,e){var i=64,s=64,r=void 0!==e;r&&e.displayWidth&&(i=e.displayWidth,s=e.displayHeight),r||(e={x:0,y:0,angle:0,rotation:0,scaleX:1,scaleY:1,displayOriginX:0,displayOriginY:0}),this.world=t,this.gameObject=r?e:void 0,this.isBody=!0,this.transform={x:e.x,y:e.y,rotation:e.angle,scaleX:e.scaleX,scaleY:e.scaleY,displayOriginX:e.displayOriginX,displayOriginY:e.displayOriginY},this.debugShowBody=t.defaults.debugShowBody,this.debugShowVelocity=t.defaults.debugShowVelocity,this.debugBodyColor=t.defaults.bodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new d,this.position=new d(e.x-e.scaleX*e.displayOriginX,e.y-e.scaleY*e.displayOriginY),this.prev=this.position.clone(),this.prevFrame=this.position.clone(),this.allowRotation=!0,this.rotation=e.angle,this.preRotation=e.angle,this.width=i,this.height=s,this.sourceWidth=i,this.sourceHeight=s,e.frame&&(this.sourceWidth=e.frame.realWidth,this.sourceHeight=e.frame.realHeight),this.halfWidth=Math.abs(i/2),this.halfHeight=Math.abs(s/2),this.center=new d(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=new d,this.newVelocity=new d,this.deltaMax=new d,this.acceleration=new d,this.allowDrag=!0,this.drag=new d,this.allowGravity=!0,this.gravity=new d,this.bounce=new d,this.worldBounce=null,this.customBoundsRectangle=t.bounds,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.maxVelocity=new d(1e4,1e4),this.maxSpeed=-1,this.friction=new d(1,0),this.useDamping=!1,this.angularVelocity=0,this.angularAcceleration=0,this.angularDrag=0,this.maxAngular=1e3,this.mass=1,this.angle=0,this.speed=0,this.facing=n.FACING_NONE,this.immovable=!1,this.pushable=!0,this.slideFactor=new d(1,1),this.moves=!0,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision=u(!1),this.touching=u(!0),this.wasTouching=u(!0),this.blocked=u(!0),this.syncBounds=!1,this.physicsType=n.DYNAMIC_BODY,this.collisionCategory=1,this.collisionMask=1,this._sx=e.scaleX,this._sy=e.scaleY,this._dx=0,this._dy=0,this._tx=0,this._ty=0,this._bounds=new h,this.directControl=!1,this.autoFrame=this.position.clone()},updateBounds:function(){var t=this.gameObject,e=this.transform;if(t.parentContainer){var i=t.getWorldTransformMatrix(this.world._tempMatrix,this.world._tempMatrix2);e.x=i.tx,e.y=i.ty,e.rotation=o(i.rotation),e.scaleX=i.scaleX,e.scaleY=i.scaleY,e.displayOriginX=t.displayOriginX,e.displayOriginY=t.displayOriginY}else e.x=t.x,e.y=t.y,e.rotation=t.angle,e.scaleX=t.scaleX,e.scaleY=t.scaleY,e.displayOriginX=t.displayOriginX,e.displayOriginY=t.displayOriginY;var s=!1;if(this.syncBounds){var r=t.getBounds(this._bounds);this.width=r.width,this.height=r.height,s=!0}else{var n=Math.abs(e.scaleX),a=Math.abs(e.scaleY);this._sx===n&&this._sy===a||(this.width=this.sourceWidth*n,this.height=this.sourceHeight*a,this._sx=n,this._sy=a,s=!0)}s&&(this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter())},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},updateFromGameObject:function(){this.updateBounds();var t=this.transform;this.position.x=t.x+t.scaleX*(this.offset.x-t.displayOriginX),this.position.y=t.y+t.scaleY*(this.offset.y-t.displayOriginY),this.updateCenter()},resetFlags:function(t){void 0===t&&(t=!1);var e=this.wasTouching,i=this.touching,s=this.blocked;t?u(!0,e):(e.none=i.none,e.up=i.up,e.down=i.down,e.left=i.left,e.right=i.right),u(!0,i),u(!0,s),this.overlapR=0,this.overlapX=0,this.overlapY=0,this.embedded=!1},preUpdate:function(t,e){if(t&&this.resetFlags(),this.gameObject&&this.updateFromGameObject(),this.rotation=this.transform.rotation,this.preRotation=this.rotation,this.moves){var i=this.position;this.prev.x=i.x,this.prev.y=i.y,this.prevFrame.x=i.x,this.prevFrame.y=i.y}t&&this.update(e)},update:function(t){var e=this.prev,i=this.position,s=this.velocity;if(e.set(i.x,i.y),!this.moves)return this._dx=i.x-e.x,void(this._dy=i.y-e.y);if(this.directControl){var r=this.autoFrame;s.set((i.x-r.x)/t,(i.y-r.y)/t),this.world.updateMotion(this,t),this._dx=i.x-r.x,this._dy=i.y-r.y}else this.world.updateMotion(this,t),this.newVelocity.set(s.x*t,s.y*t),i.add(this.newVelocity),this._dx=i.x-e.x,this._dy=i.y-e.y;var n=s.x,o=s.y;if(this.updateCenter(),this.angle=Math.atan2(o,n),this.speed=Math.sqrt(n*n+o*o),this.collideWorldBounds&&this.checkWorldBounds()&&this.onWorldBounds){var h=this.blocked;this.world.emit(a.WORLD_BOUNDS,this,h.up,h.down,h.left,h.right)}},postUpdate:function(){var t=this.position,e=t.x-this.prevFrame.x,i=t.y-this.prevFrame.y,s=this.gameObject;if(this.moves){var r=this.deltaMax.x,a=this.deltaMax.y;0!==r&&0!==e&&(e<0&&e<-r?e=-r:e>0&&e>r&&(e=r)),0!==a&&0!==i&&(i<0&&i<-a?i=-a:i>0&&i>a&&(i=a)),s&&(s.x+=e,s.y+=i)}e<0?this.facing=n.FACING_LEFT:e>0&&(this.facing=n.FACING_RIGHT),i<0?this.facing=n.FACING_UP:i>0&&(this.facing=n.FACING_DOWN),this.allowRotation&&s&&(s.angle+=this.deltaZ()),this._tx=e,this._ty=i,this.autoFrame.set(t.x,t.y)},setBoundsRectangle:function(t){return this.customBoundsRectangle=t||this.world.bounds,this},checkWorldBounds:function(){var t=this.position,e=this.velocity,i=this.blocked,s=this.customBoundsRectangle,r=this.world.checkCollision,n=this.worldBounce?-this.worldBounce.x:-this.bounce.x,a=this.worldBounce?-this.worldBounce.y:-this.bounce.y,o=!1;return t.xs.right&&r.right&&(t.x=s.right-this.width,e.x*=n,i.right=!0,o=!0),t.ys.bottom&&r.down&&(t.y=s.bottom-this.height,e.y*=a,i.down=!0,o=!0),o&&(this.blocked.none=!1,this.updateCenter()),o},setOffset:function(t,e){return void 0===e&&(e=t),this.offset.set(t,e),this},setGameObject:function(t,e){if(void 0===e&&(e=!0),!t||!t.hasTransformComponent)return this;var i=this.world;return this.gameObject&&this.gameObject.body&&(i.disable(this.gameObject),this.gameObject.body=null),t.body&&i.disable(t),this.gameObject=t,t.body=this,this.setSize(),this.enable=e,this},setSize:function(t,e,i){void 0===i&&(i=!0);var s=this.gameObject;if(s&&(!t&&s.frame&&(t=s.frame.realWidth),!e&&s.frame&&(e=s.frame.realHeight)),this.sourceWidth=t,this.sourceHeight=e,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter(),i&&s&&s.getCenter){var r=(s.width-t)/2,n=(s.height-e)/2;this.offset.set(r,n)}return this.isCircle=!1,this.radius=0,this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.isCircle=!0,this.radius=t,this.sourceWidth=2*t,this.sourceHeight=2*t,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter()):this.isCircle=!1,this},reset:function(t,e){this.stop();var i=this.gameObject;i&&(i.setPosition(t,e),this.rotation=i.angle,this.preRotation=i.angle);var s=this.position;i&&i.getTopLeft?i.getTopLeft(s):s.set(t,e),this.prev.copy(s),this.prevFrame.copy(s),this.autoFrame.copy(s),i&&this.updateBounds(),this.updateCenter(),this.collideWorldBounds&&this.checkWorldBounds(),this.resetFlags(!0)},stop:function(){return this.velocity.set(0),this.acceleration.set(0),this.speed=0,this.angularVelocity=0,this.angularAcceleration=0,this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?this.radius>0&&t>=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom&&(this.center.x-t)*(this.center.x-t)+(this.center.y-e)*(this.center.y-e)<=this.radius*this.radius:l(this,t,e)},onFloor:function(){return this.blocked.down},onCeiling:function(){return this.blocked.up},onWall:function(){return this.blocked.left||this.blocked.right},deltaAbsX:function(){return this._dx>0?this._dx:-this._dx},deltaAbsY:function(){return this._dy>0?this._dy:-this._dy},deltaX:function(){return this._dx},deltaY:function(){return this._dy},deltaXFinal:function(){return this._tx},deltaYFinal:function(){return this._ty},deltaZ:function(){return this.rotation-this.preRotation},destroy:function(){this.enable=!1,this.world&&this.world.pendingDestroy.add(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,s=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(t.defaultStrokeWidth,this.debugBodyColor),this.isCircle?t.strokeCircle(i,s,this.width/2):(this.checkCollision.up&&t.lineBetween(e.x,e.y,e.x+this.width,e.y),this.checkCollision.right&&t.lineBetween(e.x+this.width,e.y,e.x+this.width,e.y+this.height),this.checkCollision.down&&t.lineBetween(e.x,e.y+this.height,e.x+this.width,e.y+this.height),this.checkCollision.left&&t.lineBetween(e.x,e.y,e.x,e.y+this.height))),this.debugShowVelocity&&(t.lineStyle(t.defaultStrokeWidth,this.world.defaults.velocityDebugColor,1),t.lineBetween(i,s,i+this.velocity.x/2,s+this.velocity.y/2))},willDrawDebug:function(){return this.debugShowBody||this.debugShowVelocity},setDirectControl:function(t){return void 0===t&&(t=!0),this.directControl=t,this},setCollideWorldBounds:function(t,e,i,s){void 0===t&&(t=!0),this.collideWorldBounds=t;var r=void 0!==e,n=void 0!==i;return(r||n)&&(this.worldBounce||(this.worldBounce=new d),r&&(this.worldBounce.x=e),n&&(this.worldBounce.y=i)),void 0!==s&&(this.onWorldBounds=s),this},setVelocity:function(t,e){return this.velocity.set(t,e),t=this.velocity.x,e=this.velocity.y,this.speed=Math.sqrt(t*t+e*e),this},setVelocityX:function(t){return this.setVelocity(t,this.velocity.y)},setVelocityY:function(t){return this.setVelocity(this.velocity.x,t)},setMaxVelocity:function(t,e){return this.maxVelocity.set(t,e),this},setMaxVelocityX:function(t){return this.maxVelocity.x=t,this},setMaxVelocityY:function(t){return this.maxVelocity.y=t,this},setMaxSpeed:function(t){return this.maxSpeed=t,this},setSlideFactor:function(t,e){return this.slideFactor.set(t,e),this},setBounce:function(t,e){return this.bounce.set(t,e),this},setBounceX:function(t){return this.bounce.x=t,this},setBounceY:function(t){return this.bounce.y=t,this},setAcceleration:function(t,e){return this.acceleration.set(t,e),this},setAccelerationX:function(t){return this.acceleration.x=t,this},setAccelerationY:function(t){return this.acceleration.y=t,this},setAllowDrag:function(t){return void 0===t&&(t=!0),this.allowDrag=t,this},setAllowGravity:function(t){return void 0===t&&(t=!0),this.allowGravity=t,this},setAllowRotation:function(t){return void 0===t&&(t=!0),this.allowRotation=t,this},setDrag:function(t,e){return this.drag.set(t,e),this},setDamping:function(t){return this.useDamping=t,this},setDragX:function(t){return this.drag.x=t,this},setDragY:function(t){return this.drag.y=t,this},setGravity:function(t,e){return this.gravity.set(t,e),this},setGravityX:function(t){return this.gravity.x=t,this},setGravityY:function(t){return this.gravity.y=t,this},setFriction:function(t,e){return this.friction.set(t,e),this},setFrictionX:function(t){return this.friction.x=t,this},setFrictionY:function(t){return this.friction.y=t,this},setAngularVelocity:function(t){return this.angularVelocity=t,this},setAngularAcceleration:function(t){return this.angularAcceleration=t,this},setAngularDrag:function(t){return this.angularDrag=t,this},setMass:function(t){return this.mass=t,this},setImmovable:function(t){return void 0===t&&(t=!0),this.immovable=t,this},setEnable:function(t){return void 0===t&&(t=!0),this.enable=t,this},processX:function(t,e,i,s){this.x+=t,this.updateCenter(),null!==e&&(this.velocity.x=e*this.slideFactor.x);var r=this.blocked;i&&(r.left=!0,r.none=!1),s&&(r.right=!0,r.none=!1)},processY:function(t,e,i,s){this.y+=t,this.updateCenter(),null!==e&&(this.velocity.y=e*this.slideFactor.y);var r=this.blocked;i&&(r.up=!0,r.none=!1),s&&(r.down=!0,r.none=!1)},x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=c},79342(t,e,i){var s=new(i(83419))({initialize:function(t,e,i,s,r,n,a){this.world=t,this.name="",this.active=!0,this.overlapOnly=e,this.object1=i,this.object2=s,this.collideCallback=r,this.processCallback=n,this.callbackContext=a},setName:function(t){return this.name=t,this},update:function(){this.world.collideObjects(this.object1,this.object2,this.collideCallback,this.processCallback,this.callbackContext,this.overlapOnly)},destroy:function(){this.world.removeCollider(this),this.active=!1,this.world=null,this.object1=null,this.object2=null,this.collideCallback=null,this.processCallback=null,this.callbackContext=null}});t.exports=s},66022(t,e,i){var s=i(71289),r=i(13759),n=i(37742),a=i(83419),o=i(37747),h=i(60758),l=i(72624),u=i(71464),d=new a({initialize:function(t){this.world=t,this.scene=t.scene,this.sys=t.scene.sys},collider:function(t,e,i,s,r){return this.world.addCollider(t,e,i,s,r)},overlap:function(t,e,i,s,r){return this.world.addOverlap(t,e,i,s,r)},existing:function(t,e){var i=e?o.STATIC_BODY:o.DYNAMIC_BODY;return this.world.enableBody(t,i),t},staticImage:function(t,e,i,r){var n=new s(this.scene,t,e,i,r);return this.sys.displayList.add(n),this.world.enableBody(n,o.STATIC_BODY),n},image:function(t,e,i,r){var n=new s(this.scene,t,e,i,r);return this.sys.displayList.add(n),this.world.enableBody(n,o.DYNAMIC_BODY),n},staticSprite:function(t,e,i,s){var n=new r(this.scene,t,e,i,s);return this.sys.displayList.add(n),this.sys.updateList.add(n),this.world.enableBody(n,o.STATIC_BODY),n},sprite:function(t,e,i,s){var n=new r(this.scene,t,e,i,s);return this.sys.displayList.add(n),this.sys.updateList.add(n),this.world.enableBody(n,o.DYNAMIC_BODY),n},staticGroup:function(t,e){return this.sys.updateList.add(new u(this.world,this.world.scene,t,e))},group:function(t,e){return this.sys.updateList.add(new h(this.world,this.world.scene,t,e))},body:function(t,e,i,s){var r=new n(this.world);return r.position.set(t,e),i&&s&&r.setSize(i,s),this.world.add(r,o.DYNAMIC_BODY),r},staticBody:function(t,e,i,s){var r=new l(this.world);return r.position.set(t,e),i&&s&&r.setSize(i,s),this.world.add(r,o.STATIC_BODY),r},destroy:function(){this.world=null,this.scene=null,this.sys=null}});t.exports=d},79599(t){t.exports=function(t){var e=0;if(Array.isArray(t))for(var i=0;ie._dx?(n=t.right-e.x)>a&&!i||!1===t.checkCollision.right||!1===e.checkCollision.left?n=0:(t.touching.none=!1,t.touching.right=!0,e.touching.none=!1,e.touching.left=!0,e.physicsType!==s.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.right=!0),t.physicsType!==s.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.left=!0)):t._dxa&&!i||!1===t.checkCollision.left||!1===e.checkCollision.right?n=0:(t.touching.none=!1,t.touching.left=!0,e.touching.none=!1,e.touching.right=!0,e.physicsType!==s.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.left=!0),t.physicsType!==s.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.right=!0))),t.overlapX=n,e.overlapX=n,n}},45170(t,e,i){var s=i(37747);t.exports=function(t,e,i,r){var n=0,a=t.deltaAbsY()+e.deltaAbsY()+r;return 0===t._dy&&0===e._dy?(t.embedded=!0,e.embedded=!0):t._dy>e._dy?(n=t.bottom-e.y)>a&&!i||!1===t.checkCollision.down||!1===e.checkCollision.up?n=0:(t.touching.none=!1,t.touching.down=!0,e.touching.none=!1,e.touching.up=!0,e.physicsType!==s.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.down=!0),t.physicsType!==s.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.up=!0)):t._dya&&!i||!1===t.checkCollision.up||!1===e.checkCollision.down?n=0:(t.touching.none=!1,t.touching.up=!0,e.touching.none=!1,e.touching.down=!0,e.physicsType!==s.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.up=!0),t.physicsType!==s.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.down=!0))),t.overlapY=n,e.overlapY=n,n}},60758(t,e,i){var s=i(13759),r=i(83419),n=i(78389),a=i(37747),o=i(95540),h=i(26479),l=i(41212),u=new r({Extends:h,Mixins:[n],initialize:function(t,e,i,r){if(i||r)if(l(i))r=i,i=null,r.internalCreateCallback=this.createCallbackHandler,r.internalRemoveCallback=this.removeCallbackHandler;else if(Array.isArray(i)&&l(i[0])){var n=this;i.forEach(function(t){t.internalCreateCallback=n.createCallbackHandler,t.internalRemoveCallback=n.removeCallbackHandler,t.classType=o(t,"classType",s)}),r=null}else r={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler};else r={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler};this.world=t,r&&(r.classType=o(r,"classType",s)),this.physicsType=a.DYNAMIC_BODY,this.collisionCategory=1,this.collisionMask=2147483647,this.defaults={setCollideWorldBounds:o(r,"collideWorldBounds",!1),setBoundsRectangle:o(r,"customBoundsRectangle",null),setAccelerationX:o(r,"accelerationX",0),setAccelerationY:o(r,"accelerationY",0),setAllowDrag:o(r,"allowDrag",!0),setAllowGravity:o(r,"allowGravity",!0),setAllowRotation:o(r,"allowRotation",!0),setDamping:o(r,"useDamping",!1),setBounceX:o(r,"bounceX",0),setBounceY:o(r,"bounceY",0),setDragX:o(r,"dragX",0),setDragY:o(r,"dragY",0),setEnable:o(r,"enable",!0),setGravityX:o(r,"gravityX",0),setGravityY:o(r,"gravityY",0),setFrictionX:o(r,"frictionX",0),setFrictionY:o(r,"frictionY",0),setMaxSpeed:o(r,"maxSpeed",-1),setMaxVelocityX:o(r,"maxVelocityX",1e4),setMaxVelocityY:o(r,"maxVelocityY",1e4),setVelocityX:o(r,"velocityX",0),setVelocityY:o(r,"velocityY",0),setAngularVelocity:o(r,"angularVelocity",0),setAngularAcceleration:o(r,"angularAcceleration",0),setAngularDrag:o(r,"angularDrag",0),setMass:o(r,"mass",1),setImmovable:o(r,"immovable",!1)},h.call(this,e,i,r),this.type="PhysicsGroup"},createCallbackHandler:function(t){t.body&&t.body.physicsType===a.DYNAMIC_BODY||(t.body&&(t.body.destroy(),t.body=null),this.world.enableBody(t,a.DYNAMIC_BODY));var e=t.body;for(var i in this.defaults)e[i](this.defaults[i])},removeCallbackHandler:function(t){t.body&&this.world.disableBody(t)},setVelocity:function(t,e,i){void 0===i&&(i=0);for(var s=this.getChildren(),r=0;r0?1:-1),o=Math.sqrt(t*t*e.mass/i.mass)*(t>0?1:-1),h=.5*(r+o);return o-=h,n=h+(r-=h)*e.bounce.x,a=h+o*i.bounce.x,l&&g?y(0):c&&m?y(1):u&&m?y(2):!(!f||!g)&&y(3)},Set:function(t,n,a){i=n;var y=(e=t).velocity.x,T=i.velocity.x;return s=e.pushable,l=e._dx<0,u=e._dx>0,d=0===e._dx,m=Math.abs(e.right-i.x)<=Math.abs(i.right-e.x),o=T-y*e.bounce.x,r=i.pushable,c=i._dx<0,f=i._dx>0,p=0===i._dx,g=!m,h=y-T*i.bounce.x,v=Math.abs(a),x()},Run:y,RunImmovableBody1:function(t){if(1===t?i.velocity.x=0:m?i.processX(v,h,!0):i.processX(-v,h,!1,!0),e.moves){var s=e.directControl?e.y-e.autoFrame.y:e.y-e.prev.y;i.y+=s*e.friction.y,i._dy=i.y-i.prev.y}},RunImmovableBody2:function(t){if(2===t?e.velocity.x=0:g?e.processX(v,o,!0):e.processX(-v,o,!1,!0),i.moves){var s=i.directControl?i.y-i.autoFrame.y:i.y-i.prev.y;e.y+=s*i.friction.y,e._dy=e.y-e.prev.y}}}},47962(t){var e,i,s,r,n,a,o,h,l,u,d,c,f,p,m,g,v,x=function(){return u&&m&&i.blocked.down?(e.processY(-v,o,!1,!0),1):l&&g&&i.blocked.up?(e.processY(v,o,!0),1):f&&g&&e.blocked.down?(i.processY(-v,h,!1,!0),2):c&&m&&e.blocked.up?(i.processY(v,h,!0),2):0},y=function(t){if(s&&r)v*=.5,0===t||3===t?(e.processY(v,n),i.processY(-v,a)):(e.processY(-v,n),i.processY(v,a));else if(s&&!r)0===t||3===t?e.processY(v,o,!0):e.processY(-v,o,!1,!0);else if(!s&&r)0===t||3===t?i.processY(-v,h,!1,!0):i.processY(v,h,!0);else{var m=.5*v;0===t?p?(e.processY(v,0,!0),i.processY(0,null,!1,!0)):f?(e.processY(m,0,!0),i.processY(-m,0,!1,!0)):(e.processY(m,i.velocity.y,!0),i.processY(-m,null,!1,!0)):1===t?d?(e.processY(0,null,!1,!0),i.processY(v,0,!0)):u?(e.processY(-m,0,!1,!0),i.processY(m,0,!0)):(e.processY(-m,null,!1,!0),i.processY(m,e.velocity.y,!0)):2===t?p?(e.processY(-v,0,!1,!0),i.processY(0,null,!0)):c?(e.processY(-m,0,!1,!0),i.processY(m,0,!0)):(e.processY(-m,i.velocity.y,!1,!0),i.processY(m,null,!0)):3===t&&(d?(e.processY(0,null,!0),i.processY(-v,0,!1,!0)):l?(e.processY(m,0,!0),i.processY(-m,0,!1,!0)):(e.processY(m,i.velocity.y,!0),i.processY(-m,null,!1,!0)))}return!0};t.exports={BlockCheck:x,Check:function(){var t=e.velocity.y,s=i.velocity.y,r=Math.sqrt(s*s*i.mass/e.mass)*(s>0?1:-1),o=Math.sqrt(t*t*e.mass/i.mass)*(t>0?1:-1),h=.5*(r+o);return o-=h,n=h+(r-=h)*e.bounce.y,a=h+o*i.bounce.y,l&&g?y(0):c&&m?y(1):u&&m?y(2):!(!f||!g)&&y(3)},Set:function(t,n,a){i=n;var y=(e=t).velocity.y,T=i.velocity.y;return s=e.pushable,l=e._dy<0,u=e._dy>0,d=0===e._dy,m=Math.abs(e.bottom-i.y)<=Math.abs(i.bottom-e.y),o=T-y*e.bounce.y,r=i.pushable,c=i._dy<0,f=i._dy>0,p=0===i._dy,g=!m,h=y-T*i.bounce.y,v=Math.abs(a),x()},Run:y,RunImmovableBody1:function(t){if(1===t?i.velocity.y=0:m?i.processY(v,h,!0):i.processY(-v,h,!1,!0),e.moves){var s=e.directControl?e.x-e.autoFrame.x:e.x-e.prev.x;i.x+=s*e.friction.x,i._dx=i.x-i.prev.x}},RunImmovableBody2:function(t){if(2===t?e.velocity.y=0:g?e.processY(v,o,!0):e.processY(-v,o,!1,!0),i.moves){var s=i.directControl?i.x-i.autoFrame.x:i.x-i.prev.x;e.x+=s*i.friction.x,e._dx=e.x-e.prev.x}}}},14087(t,e,i){var s=i(64897),r=i(3017);t.exports=function(t,e,i,n,a){void 0===a&&(a=s(t,e,i,n));var o=t.immovable,h=e.immovable;if(i||0===a||o&&h||t.customSeparateX||e.customSeparateX)return 0!==a||t.embedded&&e.embedded;var l=r.Set(t,e,a);return o||h?(o?r.RunImmovableBody1(l):h&&r.RunImmovableBody2(l),!0):l>0||r.Check()}},89936(t,e,i){var s=i(45170),r=i(47962);t.exports=function(t,e,i,n,a){void 0===a&&(a=s(t,e,i,n));var o=t.immovable,h=e.immovable;if(i||0===a||o&&h||t.customSeparateY||e.customSeparateY)return 0!==a||t.embedded&&e.embedded;var l=r.Set(t,e,a);return o||h?(o?r.RunImmovableBody1(l):h&&r.RunImmovableBody2(l),!0):l>0||r.Check()}},95829(t){t.exports=function(t,e){return void 0===e&&(e={}),e.none=t,e.up=!1,e.down=!1,e.left=!1,e.right=!1,t||(e.up=!0,e.down=!0,e.left=!0,e.right=!0),e}},72624(t,e,i){var s=i(87902),r=i(83419),n=i(78389),a=i(37747),o=i(37303),h=i(95829),l=i(26099),u=new r({Mixins:[n],initialize:function(t,e){var i=64,s=64,r=void 0!==e;r&&e.displayWidth&&(i=e.displayWidth,s=e.displayHeight),r||(e={x:0,y:0,angle:0,rotation:0,scaleX:1,scaleY:1,displayOriginX:0,displayOriginY:0}),this.world=t,this.gameObject=r?e:void 0,this.isBody=!0,this.debugShowBody=t.defaults.debugShowStaticBody,this.debugBodyColor=t.defaults.staticBodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new l,this.position=new l(e.x-i*e.originX,e.y-s*e.originY),this.width=i,this.height=s,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center=new l(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=l.ZERO,this.allowGravity=!1,this.gravity=l.ZERO,this.bounce=l.ZERO,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.mass=1,this.immovable=!0,this.pushable=!1,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision=h(!1),this.touching=h(!0),this.wasTouching=h(!0),this.blocked=h(!0),this.physicsType=a.STATIC_BODY,this.collisionCategory=1,this.collisionMask=1,this._dx=0,this._dy=0},setGameObject:function(t,e,i){if(void 0===e&&(e=!0),void 0===i&&(i=!0),!t||!t.hasTransformComponent)return this;var s=this.world;return this.gameObject&&this.gameObject.body&&(s.disable(this.gameObject),this.gameObject.body=null),t.body&&s.disable(t),this.gameObject=t,t.body=this,this.setSize(),e&&this.updateFromGameObject(),this.enable=i,this},updateFromGameObject:function(){this.world.staticTree.remove(this);var t=this.gameObject;return t.getTopLeft(this.position),this.width=t.displayWidth,this.height=t.displayHeight,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.world.staticTree.insert(this),this},setOffset:function(t,e){return void 0===e&&(e=t),this.world.staticTree.remove(this),this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(t,e),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this),this},setSize:function(t,e,i){void 0===i&&(i=!0);var s=this.gameObject;if(s&&s.frame&&(t||(t=s.frame.realWidth),e||(e=s.frame.realHeight)),this.world.staticTree.remove(this),this.width=t,this.height=e,this.halfWidth=Math.floor(t/2),this.halfHeight=Math.floor(e/2),i&&s&&s.getCenter){var r=s.displayWidth/2,n=s.displayHeight/2;this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(r-this.halfWidth,n-this.halfHeight),this.position.x+=this.offset.x,this.position.y+=this.offset.y}return this.updateCenter(),this.isCircle=!1,this.radius=0,this.world.staticTree.insert(this),this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.world.staticTree.remove(this),this.isCircle=!0,this.radius=t,this.width=2*t,this.height=2*t,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter(),this.world.staticTree.insert(this)):this.isCircle=!1,this},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},reset:function(t,e){var i=this.gameObject;void 0===t&&(t=i.x),void 0===e&&(e=i.y),this.world.staticTree.remove(this),i.setPosition(t,e),i.getTopLeft(this.position),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this)},stop:function(){return this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?s(this,t,e):o(this,t,e)},postUpdate:function(){},deltaAbsX:function(){return 0},deltaAbsY:function(){return 0},deltaX:function(){return 0},deltaY:function(){return 0},deltaZ:function(){return 0},destroy:function(){this.enable=!1,this.world.pendingDestroy.add(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,s=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(t.defaultStrokeWidth,this.debugBodyColor,1),this.isCircle?t.strokeCircle(i,s,this.width/2):t.strokeRect(e.x,e.y,this.width,this.height))},willDrawDebug:function(){return this.debugShowBody},setMass:function(t){return t<=0&&(t=.1),this.mass=t,this},x:{get:function(){return this.position.x},set:function(t){this.world.staticTree.remove(this),this.position.x=t,this.world.staticTree.insert(this)}},y:{get:function(){return this.position.y},set:function(t){this.world.staticTree.remove(this),this.position.y=t,this.world.staticTree.insert(this)}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=u},71464(t,e,i){var s=i(13759),r=i(83419),n=i(78389),a=i(37747),o=i(95540),h=i(26479),l=i(41212),u=new r({Extends:h,Mixins:[n],initialize:function(t,e,i,r){i||r?l(i)?(r=i,i=null,r.internalCreateCallback=this.createCallbackHandler,r.internalRemoveCallback=this.removeCallbackHandler,r.createMultipleCallback=this.createMultipleCallbackHandler,r.classType=o(r,"classType",s)):Array.isArray(i)&&l(i[0])?(r=i,i=null,r.forEach(function(t){t.internalCreateCallback=this.createCallbackHandler,t.internalRemoveCallback=this.removeCallbackHandler,t.createMultipleCallback=this.createMultipleCallbackHandler,t.classType=o(t,"classType",s)},this)):r={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler}:r={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler,createMultipleCallback:this.createMultipleCallbackHandler,classType:s},this.world=t,this.physicsType=a.STATIC_BODY,this.collisionCategory=1,this.collisionMask=1,h.call(this,e,i,r),this.type="StaticPhysicsGroup"},createCallbackHandler:function(t){t.body&&t.body.physicsType===a.STATIC_BODY||(t.body&&(t.body.destroy(),t.body=null),this.world.enableBody(t,a.STATIC_BODY))},removeCallbackHandler:function(t){t.body&&this.world.disableBody(t)},createMultipleCallbackHandler:function(){this.refresh()},refresh:function(){for(var t=Array.from(this.children),e=0;e=s;if(this.fixedStep||(i=.001*e,n=!0,this._elapsed=0),r.forEach(function(t){t.enable&&t.preUpdate(n,i)}),n){this._elapsed-=s,this.stepsLastFrame=1,this.useTree&&(this.tree.clear(),this.tree.load(Array.from(r)));for(var a=this.colliders.update(),o=0;o=s;)this._elapsed-=s,this.step(i)}},step:function(t){var e=this.bodies;e.forEach(function(e){e.enable&&e.update(t)}),this.useTree&&(this.tree.clear(),this.tree.load(Array.from(e)));for(var i=this.colliders.update(),s=0;s0){var r=this.tree,n=this.staticTree;s.forEach(function(i){i.physicsType===h.DYNAMIC_BODY?(r.remove(i),t.delete(i)):i.physicsType===h.STATIC_BODY&&(n.remove(i),e.delete(i)),i.world=void 0,i.gameObject=void 0}),s.clear()}},updateMotion:function(t,e){t.allowRotation&&this.computeAngularVelocity(t,e),this.computeVelocity(t,e)},computeAngularVelocity:function(t,e){var i=t.angularVelocity,s=t.angularAcceleration,r=t.angularDrag,a=t.maxAngular;s?i+=s*e:t.allowDrag&&r&&(p(i-(r*=e),0,.1)?i-=r:m(i+r,0,.1)?i+=r:i=0);var o=(i=n(i,-a,a))-t.angularVelocity;t.angularVelocity+=o,t.rotation+=t.angularVelocity*e},computeVelocity:function(t,e){var i=t.velocity.x,s=t.acceleration.x,r=t.drag.x,a=t.maxVelocity.x,o=t.velocity.y,h=t.acceleration.y,l=t.drag.y,u=t.maxVelocity.y,d=t.speed,c=t.maxSpeed,g=t.allowDrag,v=t.useDamping;t.allowGravity&&(i+=(this.gravity.x+t.gravity.x)*e,o+=(this.gravity.y+t.gravity.y)*e),s?i+=s*e:g&&r&&(v?(i*=r=Math.pow(r,e),d=Math.sqrt(i*i+o*o),f(d,0,.001)&&(i=0)):p(i-(r*=e),0,.01)?i-=r:m(i+r,0,.01)?i+=r:i=0),h?o+=h*e:g&&l&&(v?(o*=l=Math.pow(l,e),d=Math.sqrt(i*i+o*o),f(d,0,.001)&&(o=0)):p(o-(l*=e),0,.01)?o-=l:m(o+l,0,.01)?o+=l:o=0),i=n(i,-a,a),o=n(o,-u,u),t.velocity.set(i,o),c>-1&&t.velocity.length()>c&&(t.velocity.normalize().scale(c),d=c),t.speed=d},separate:function(t,e,i,s,r){var n,a,o=!1,h=!0;if(!t.enable||!e.enable||t.checkCollision.none||e.checkCollision.none||!this.intersects(t,e)||0===(t.collisionMask&e.collisionCategory)||0===(e.collisionMask&t.collisionCategory))return o;if(i&&!1===i.call(s,t.gameObject||t,e.gameObject||e))return o;if(t.isCircle||e.isCircle){var l=this.separateCircle(t,e,r);l.result?(o=!0,h=!1):(n=l.x,a=l.y,h=!0)}if(h){var u=!1,d=!1,f=this.OVERLAP_BIAS;r?(u=A(t,e,r,f,n),d=_(t,e,r,f,a)):this.forceX||Math.abs(this.gravity.y+t.gravity.y)E&&(p=l(x,y,E,b)-w):y>C&&(xE&&(p=l(x,y,E,C)-w)),p*=-1}else p=t.halfWidth+e.halfWidth-u(a,o);t.overlapR=p,e.overlapR=p;var A=s(a,o),_=(p+T.EPSILON)*Math.cos(A),M=(p+T.EPSILON)*Math.sin(A),R={overlap:p,result:!1,x:_,y:M};if(i&&(!m||m&&0!==p))return R.result=!0,R;if(!m&&0===p||h&&d||t.customSeparateX||e.customSeparateX)return R.x=void 0,R.y=void 0,R;var O=!t.pushable&&!e.pushable;if(m){var P=a.x-o.x,L=a.y-o.y,F=Math.sqrt(Math.pow(P,2)+Math.pow(L,2)),D=(o.x-a.x)/F||0,I=(o.y-a.y)/F||0,N=2*(c.x*D+c.y*I-f.x*D-f.y*I)/(t.mass+e.mass);!h&&!d&&t.pushable&&e.pushable||(N*=2),!h&&t.pushable&&(c.x=c.x-N/t.mass*D,c.y=c.y-N/t.mass*I,c.multiply(t.bounce)),!d&&e.pushable&&(f.x=f.x+N/e.mass*D,f.y=f.y+N/e.mass*I,f.multiply(e.bounce)),h||d||(_*=.5,M*=.5),(!h||t.pushable||O)&&(t.x-=_,t.y-=M,t.updateCenter()),(!d||e.pushable||O)&&(e.x+=_,e.y+=M,e.updateCenter()),R.result=!0}else h||!t.pushable&&!O||(t.x-=_,t.y-=M,t.updateCenter()),(!d||e.pushable||O)&&(e.x+=_,e.y+=M,e.updateCenter()),R.x=void 0,R.y=void 0;return R},intersects:function(t,e){return t!==e&&(t.isCircle||e.isCircle?t.isCircle?e.isCircle?u(t.center,e.center)<=t.halfWidth+e.halfWidth:this.circleBodyIntersects(t,e):this.circleBodyIntersects(e,t):!(t.right<=e.left||t.bottom<=e.top||t.left>=e.right||t.top>=e.bottom))},circleBodyIntersects:function(t,e){var i=n(t.center.x,e.left,e.right),s=n(t.center.y,e.top,e.bottom);return(t.center.x-i)*(t.center.x-i)+(t.center.y-s)*(t.center.y-s)<=t.halfWidth*t.halfWidth},overlap:function(t,e,i,s,r){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===r&&(r=i),this.collideObjects(t,e,i,s,r,!0)},collide:function(t,e,i,s,r){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===r&&(r=i),this.collideObjects(t,e,i,s,r,!1)},collideObjects:function(t,e,i,s,r,n){var a,o;!t.isParent||void 0!==t.physicsType&&void 0!==e&&t!==e||(t=Array.from(t.children)),e&&e.isParent&&void 0===e.physicsType&&(e=Array.from(e.children));var h=Array.isArray(t),l=Array.isArray(e);if(this._total=0,h||l)if(!h&&l)for(a=0;a0},collideHandler:function(t,e,i,s,r,n){if(void 0===e&&t.isParent)return this.collideGroupVsGroup(t,t,i,s,r,n);if(!t||!e)return!1;if(t.body||t.isBody){if(e.body||e.isBody)return this.collideSpriteVsSprite(t,e,i,s,r,n);if(e.isParent)return this.collideSpriteVsGroup(t,e,i,s,r,n);if(e.isTilemap)return this.collideSpriteVsTilemapLayer(t,e,i,s,r,n)}else if(t.isParent){if(e.body||e.isBody)return this.collideSpriteVsGroup(e,t,i,s,r,n);if(e.isParent)return this.collideGroupVsGroup(t,e,i,s,r,n);if(e.isTilemap)return this.collideGroupVsTilemapLayer(t,e,i,s,r,n)}else if(t.isTilemap){if(e.body||e.isBody)return this.collideSpriteVsTilemapLayer(e,t,i,s,r,n);if(e.isParent)return this.collideGroupVsTilemapLayer(e,t,i,s,r,n)}},canCollide:function(t,e){return t&&e&&0!==(t.collisionMask&e.collisionCategory)&&0!==(e.collisionMask&t.collisionCategory)},collideSpriteVsSprite:function(t,e,i,s,r,n){var a=t.isBody?t:t.body,o=e.isBody?e:e.body;return!!this.canCollide(a,o)&&(this.separate(a,o,s,r,n)&&(i&&i.call(r,t,e),this._total++),!0)},collideSpriteVsGroup:function(t,e,i,s,r,n){var a,o,l,u=t.isBody?t:t.body;if(0!==e.getLength()&&u&&u.enable&&!u.checkCollision.none&&this.canCollide(u,e))if(this.useTree||e.physicsType===h.STATIC_BODY){var d=this.treeMinMax;d.minX=u.left,d.minY=u.top,d.maxX=u.right,d.maxY=u.bottom;var c=e.physicsType===h.DYNAMIC_BODY?this.tree.search(d):this.staticTree.search(d);for(o=c.length,a=0;a0&&(t.blocked.none=!1,t.blocked.right=!0),t.position.x-=e,t.updateCenter(),0===t.bounce.x?t.velocity.x=0:t.velocity.x=-t.velocity.x*t.bounce.x}},67013(t){t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.up=!0):e>0&&(t.blocked.none=!1,t.blocked.down=!0),t.position.y-=e,t.updateCenter(),0===t.bounce.y?t.velocity.y=0:t.velocity.y=-t.velocity.y*t.bounce.y}},40012(t,e,i){var s=i(21329),r=i(53442),n=i(2483);t.exports=function(t,e,i,a,o,h,l){var u=a.left,d=a.top,c=a.right,f=a.bottom,p=i.faceLeft||i.faceRight,m=i.faceTop||i.faceBottom;if(l||(p=!0,m=!0),!p&&!m)return!1;var g=0,v=0,x=0,y=1;if(e.deltaAbsX()>e.deltaAbsY()?x=-1:e.deltaAbsX()0&&u&&t.checkCollision.right&&h&&t.right>i&&(o=t.right-i)>n&&(o=0),0!==o&&(t.customSeparateX?t.overlapX=o:s(t,o)),o}},53442(t,e,i){var s=i(67013);t.exports=function(t,e,i,r,n,a){var o=0,h=e.faceTop,l=e.faceBottom,u=e.collideUp,d=e.collideDown;return a||(h=!0,l=!0,u=!0,d=!0),t.deltaY()<0&&d&&t.checkCollision.up?l&&t.y0&&u&&t.checkCollision.down&&h&&t.bottom>i&&(o=t.bottom-i)>n&&(o=0),0!==o&&(t.customSeparateY?t.overlapY=o:s(t,o)),o}},2483(t){t.exports=function(t,e){return!(e.right<=t.left||e.bottom<=t.top||e.position.x>=t.right||e.position.y>=t.bottom)}},55173(t,e,i){var s={ProcessTileCallbacks:i(96602),ProcessTileSeparationX:i(36294),ProcessTileSeparationY:i(67013),SeparateTile:i(40012),TileCheckX:i(21329),TileCheckY:i(53442),TileIntersectsBody:i(2483)};t.exports=s},52018(t,e,i){var s=new(i(83419))({initialize:function(t){this.pluginManager=t,this.game=t.game},init:function(){},start:function(){},stop:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=s},42363(t){var e={Global:["game","anims","cache","plugins","registry","scale","sound","textures","renderer"],CoreScene:["EventEmitter","CameraManager","GameObjectCreator","GameObjectFactory","ScenePlugin","DisplayList","UpdateList"],DefaultScene:["Clock","DataManagerPlugin","InputPlugin","Loader","TweenManager","LightsPlugin"]};e.DefaultScene.push("CameraManager3D"),e.Global.push("facebook"),t.exports=e},37277(t){var e={},i={},s={register:function(t,i,s,r){void 0===r&&(r=!1),e[t]={plugin:i,mapping:s,custom:r}},registerCustom:function(t,e,s,r){i[t]={plugin:e,mapping:s,data:r}},hasCore:function(t){return e.hasOwnProperty(t)},hasCustom:function(t){return i.hasOwnProperty(t)},getCore:function(t){return e[t]},getCustom:function(t){return i[t]},getCustomClass:function(t){return i.hasOwnProperty(t)?i[t].plugin:null},remove:function(t){e.hasOwnProperty(t)&&delete e[t]},removeCustom:function(t){i.hasOwnProperty(t)&&delete i[t]},destroyCorePlugins:function(){for(var t in e)e.hasOwnProperty(t)&&delete e[t]},destroyCustomPlugins:function(){for(var t in i)i.hasOwnProperty(t)&&delete i[t]}};t.exports=s},77332(t,e,i){var s=i(83419),r=i(8443),n=i(50792),a=i(74099),o=i(44603),h=i(39429),l=i(95540),u=i(37277),d=i(72905),c=i(8054),f=new s({Extends:n,initialize:function(t){n.call(this),this.game=t,this.plugins=[],this.scenePlugins=[],this._pendingGlobal=[],this._pendingScene=[],t.isBooted||t.config.renderType===c.HEADLESS?this.boot():t.events.once(r.BOOT,this.boot,this)},boot:function(){var t,e,i,s,n,a,o,h=this.game.config,u=h.installGlobalPlugins;for(u=u.concat(this._pendingGlobal),t=0;t{const o=this.getVideoPlaybackQuality(),h=this.mozPresentedFrames||this.mozPaintedFrames||o.totalVideoFrames-o.droppedVideoFrames;if(h>s){const s=this.mozFrameDelay||o.totalFrameDelay-i.totalFrameDelay||0,r=a-n;t(a,{presentationTime:a+1e3*s,expectedDisplayTime:a+r,width:this.videoWidth,height:this.videoHeight,mediaTime:Math.max(0,this.currentTime||0)+r/1e3,presentedFrames:h,processingDuration:s}),delete this._rvfcpolyfillmap[e]}else this._rvfcpolyfillmap[e]=requestAnimationFrame(t=>r(a,t))};return this._rvfcpolyfillmap[e]=requestAnimationFrame(t=>r(e,t)),e},HTMLVideoElement.prototype.cancelVideoFrameCallback=function(t){cancelAnimationFrame(this._rvfcpolyfillmap[t]),delete this._rvfcpolyfillmap[t]})},10312(t){t.exports={SKIP_CHECK:-1,NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16,ERASE:17,SOURCE_IN:18,SOURCE_OUT:19,SOURCE_ATOP:20,DESTINATION_OVER:21,DESTINATION_IN:22,DESTINATION_OUT:23,DESTINATION_ATOP:24,LIGHTER:25,COPY:26,XOR:27}},29795(t){t.exports={DEFAULT:0,LINEAR:0,NEAREST:1}},84322(t){t.exports={MULTIPLY:0,FILL:1,ADD:2,SCREEN:4,OVERLAY:5,HARD_LIGHT:6}},68627(t,e,i){var s=i(19715),r=i(32880),n=i(83419),a=i(8054),o=i(50792),h=i(92503),l=i(56373),u=i(97480),d=i(69442),c=i(8443),f=i(61340),p=new n({Extends:o,initialize:function(t){o.call(this);var e=t.config;this.config={clearBeforeRender:e.clearBeforeRender,backgroundColor:e.backgroundColor,antialias:e.antialias,roundPixels:e.roundPixels,transparent:e.transparent},this.game=t,this.type=a.CANVAS,this.drawCount=0,this.width=0,this.height=0,this.gameCanvas=t.canvas;var i={alpha:e.transparent,desynchronized:e.desynchronized,willReadFrequently:!1};this.gameContext=e.context?e.context:this.gameCanvas.getContext("2d",i),this.currentContext=this.gameContext,this.antialias=e.antialias,this.blendModes=l(),this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92},this._tempMatrix1=new f,this._tempMatrix2=new f,this._tempMatrix3=new f,this.isBooted=!1,this.init()},init:function(){var t=this.game;t.events.once(c.BOOT,function(){var t=this.config;if(!t.transparent){var e=this.gameContext,i=this.gameCanvas;e.fillStyle=t.backgroundColor.rgba,e.fillRect(0,0,i.width,i.height)}},this),t.textures.once(d.READY,this.boot,this)},boot:function(){var t=this.game,e=t.scale.baseSize;this.width=e.width,this.height=e.height,this.isBooted=!0,t.scale.on(u.RESIZE,this.onResize,this),this.resize(e.width,e.height)},onResize:function(t,e){e.width===this.width&&e.height===this.height||this.resize(e.width,e.height)},resize:function(t,e){this.width=t,this.height=e,this.emit(h.RESIZE,t,e)},resetTransform:function(){this.currentContext.setTransform(1,0,0,1,0,0)},setBlendMode:function(t){return this.currentContext.globalCompositeOperation=t,this},setContext:function(t){return this.currentContext=t||this.gameContext,this},setAlpha:function(t){return this.currentContext.globalAlpha=t,this},preRender:function(){var t=this.gameContext,e=this.config,i=this.width,s=this.height;t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),this.emit(h.PRE_RENDER_CLEAR),e.clearBeforeRender&&(t.clearRect(0,0,i,s),e.transparent||(t.fillStyle=e.backgroundColor.rgba,t.fillRect(0,0,i,s))),t.save(),this.drawCount=0,this.emit(h.PRE_RENDER)},render:function(t,e,i){var r=e.length;this.emit(h.RENDER,t,i);var n=i.x,a=i.y,o=i.width,l=i.height,u=i.renderToTexture?i.context:t.sys.context;u.save(),this.game.scene.customViewports&&(u.beginPath(),u.rect(n,a,o,l),u.clip()),i.emit(s.PRE_RENDER,i),this.currentContext=u;var d=i.mask;d&&d.preRenderCanvas(this,null,i._maskCamera),i.transparent||(u.fillStyle=i.backgroundColor.rgba,u.fillRect(n,a,o,l)),u.globalAlpha=i.alpha,u.globalCompositeOperation="source-over",this.drawCount+=r,i.renderToTexture&&i.emit(s.PRE_RENDER,i),i.matrix.copyToContext(u);for(var c=0;c=0?v=-(v+d):v<0&&(v=Math.abs(v)-d)),t.flipY&&(x>=0?x=-(x+c):x<0&&(x=Math.abs(x)-c))}var T=1,w=1;t.flipX&&(f||(v+=-e.realWidth+2*m),T=-1),t.flipY&&(f||(x+=-e.realHeight+2*g),w=-1);var S=t.x,b=t.y;if(i.roundPixels&&(S=Math.floor(S),b=Math.floor(b)),o.applyITRS(S,b,t.rotation,t.scaleX*T,t.scaleY*w),a.copyWithScrollFactorFrom(i.matrixCombined,i.scrollX,i.scrollY,t.scrollFactorX,t.scrollFactorY),s&&a.multiply(s),a.multiply(o),i.renderRoundPixels&&(a.e=Math.floor(a.e+.5),a.f=Math.floor(a.f+.5)),n.save(),a.setToContext(n),n.globalCompositeOperation=this.blendModes[t.blendMode],n.globalAlpha=r,n.imageSmoothingEnabled=!e.source.scaleMode,t.mask&&t.mask.preRenderCanvas(this,t,i),d>0&&c>0){var E=d/p,C=c/p;i.roundPixels&&(v=Math.floor(v+.5),x=Math.floor(x+.5),E+=.5,C+=.5),n.drawImage(e.source.image,l,u,d,c,v,x,E,C)}t.mask&&t.mask.postRenderCanvas(this,t,i),n.restore()}},destroy:function(){this.removeAllListeners(),this.game=null,this.gameCanvas=null,this.gameContext=null}});t.exports=p},55830(t,e,i){t.exports={CanvasRenderer:i(68627),GetBlendModes:i(56373),SetTransform:i(20926)}},56373(t,e,i){var s=i(10312),r=i(89289);t.exports=function(){var t=[],e=r.supportNewBlendModes,i="source-over";return t[s.NORMAL]=i,t[s.ADD]="lighter",t[s.MULTIPLY]=e?"multiply":i,t[s.SCREEN]=e?"screen":i,t[s.OVERLAY]=e?"overlay":i,t[s.DARKEN]=e?"darken":i,t[s.LIGHTEN]=e?"lighten":i,t[s.COLOR_DODGE]=e?"color-dodge":i,t[s.COLOR_BURN]=e?"color-burn":i,t[s.HARD_LIGHT]=e?"hard-light":i,t[s.SOFT_LIGHT]=e?"soft-light":i,t[s.DIFFERENCE]=e?"difference":i,t[s.EXCLUSION]=e?"exclusion":i,t[s.HUE]=e?"hue":i,t[s.SATURATION]=e?"saturation":i,t[s.COLOR]=e?"color":i,t[s.LUMINOSITY]=e?"luminosity":i,t[s.ERASE]="destination-out",t[s.SOURCE_IN]="source-in",t[s.SOURCE_OUT]="source-out",t[s.SOURCE_ATOP]="source-atop",t[s.DESTINATION_OVER]="destination-over",t[s.DESTINATION_IN]="destination-in",t[s.DESTINATION_OUT]="destination-out",t[s.DESTINATION_ATOP]="destination-atop",t[s.LIGHTER]="lighter",t[s.COPY]="copy",t[s.XOR]="xor",t}},20926(t,e,i){var s=i(91296);t.exports=function(t,e,i,r,n){var a=r.alpha*i.alpha;if(a<=0)return!1;var o=s(i,r,n).calc;return e.globalCompositeOperation=t.blendModes[i.blendMode],e.globalAlpha=a,e.save(),o.setToContext(e),e.imageSmoothingEnabled=i.frame?!i.frame.source.scaleMode:t.antialias,!0}},63899(t){t.exports="losewebgl"},6119(t){t.exports="postrender"},31124(t){t.exports="prerenderclear"},48070(t){t.exports="prerender"},15640(t){t.exports="render"},8912(t){t.exports="resize"},87124(t){t.exports="restorewebgl"},53998(t){t.exports="setparalleltextureunits"},92503(t,e,i){t.exports={LOSE_WEBGL:i(63899),POST_RENDER:i(6119),PRE_RENDER:i(48070),PRE_RENDER_CLEAR:i(31124),RENDER:i(15640),RESIZE:i(8912),RESTORE_WEBGL:i(87124),SET_PARALLEL_TEXTURE_UNITS:i(53998)}},36909(t,e,i){t.exports={Events:i(92503),Snapshot:i(89966)},t.exports.Canvas=i(55830),t.exports.WebGL=i(4159)},32880(t,e,i){var s=i(27919),r=i(40987),n=i(95540);t.exports=function(t,e){var i=n(e,"callback"),a=n(e,"type","image/png"),o=n(e,"encoder",.92),h=Math.abs(Math.round(n(e,"x",0))),l=Math.abs(Math.round(n(e,"y",0))),u=Math.floor(n(e,"width",t.width)),d=Math.floor(n(e,"height",t.height));if(n(e,"getPixel",!1)){var c=t.getContext("2d",{willReadFrequently:!1}).getImageData(h,l,1,1).data;i.call(null,new r(c[0],c[1],c[2],c[3]))}else if(0!==h||0!==l||u!==t.width||d!==t.height){var f=s.createWebGL(this,u,d),p=f.getContext("2d",{willReadFrequently:!0});u>0&&d>0&&p.drawImage(t,h,l,u,d,0,0,u,d);var m=new Image;m.onerror=function(){i.call(null),s.remove(f)},m.onload=function(){i.call(null,m),s.remove(f)},m.src=f.toDataURL(a,o)}else{var g=new Image;g.onerror=function(){i.call(null)},g.onload=function(){i.call(null,g)},g.src=t.toDataURL(a,o)}}},88815(t,e,i){var s=i(27919),r=i(40987),n=i(95540);t.exports=function(t,e){var i=t,a=n(e,"callback"),o=n(e,"type","image/png"),h=n(e,"encoder",.92),l=Math.abs(Math.round(n(e,"x",0))),u=Math.abs(Math.round(n(e,"y",0))),d=n(e,"getPixel",!1),c=n(e,"isFramebuffer",!1),f=c?n(e,"bufferWidth",1):i.drawingBufferWidth,p=c?n(e,"bufferHeight",1):i.drawingBufferHeight;if(d){var m=new Uint8Array(4),g=p-u-1;i.readPixels(l,g,1,1,i.RGBA,i.UNSIGNED_BYTE,m),a.call(null,new r(m[0],m[1],m[2],m[3]))}else{var v=Math.floor(n(e,"width",f)),x=Math.floor(n(e,"height",p)),y=new Uint8Array(v*x*4);i.readPixels(l,p-u-x,v,x,i.RGBA,i.UNSIGNED_BYTE,y);for(var T=s.createWebGL(this,v,x),w=T.getContext("2d",{willReadFrequently:!0}),S=w.getImageData(0,0,v,x),b=S.data,E=0;E0},beginDraw:function(){this.framebuffer&&this.renderer.glTextureUnits.unbindTexture(this.texture),this.renderer.glWrapper.update(this.state)},clear:function(t){this.beginDraw(),void 0===t&&(t=this.autoClear),this.renderer.renderNodes.finishBatch(),this.renderer.gl.clear(t)},destroy:function(){this.renderer.deleteTexture(this.texture),this.renderer.deleteFramebuffer(this.state.bindings.framebuffer),this.renderer=null,this.camera=null,this.state=null,this.framebuffer=null,this.texture=null}});t.exports=r},65656(t,e,i){var s=i(83419),r=i(87774),n=new s({initialize:function(t,e,i){this.renderer=t,this.maxAge=e,this.maxPoolSize=i,this.agePool=[],this.sizePool={}},add:function(t){if(-1===this.agePool.indexOf(t)){var e=t.width+"x"+t.height;this.sizePool[e]?this.sizePool[e].push(t):this.sizePool[e]=[t],this.agePool.push(t)}},get:function(t,e){var i,s,n=this.renderer;void 0===t&&(t=n.width),void 0===e&&(e=n.height);var a=n.getMaxTextureSize();t>a&&(t=a),e>a&&(e=a);var o=t+"x"+e,h=this.sizePool[o];if(h&&h.length>0)return i=h.pop(),s=this.agePool.indexOf(i),this.agePool.splice(s,1),i;if(this.agePool.length>0){var l=Date.now(),u=this.maxAge;if(l-(i=this.agePool[0]).lastUsed>u){this.agePool.shift();var d=i.width+"x"+i.height;return s=(h=this.sizePool[d]).indexOf(i),h.splice(s,1),i.resize(t,e),i}}return this.agePool.length0)for(var s=e.splice(0,i),r=0;r0){s+="_";for(var r=0;r0&&(s+="__",s+=i.sort().join("_")),s},createShaderProgram:function(t,e,i,s){var r=e.vertexShader,n=e.fragmentShader;if(r=r.replace(/\r/g,""),n=n.replace(/\r/g,""),i){for(var a,o,h={},l=0;l>>0},getTintAppendFloatAlpha:function(t,e){return((255*e&255)<<24|t)>>>0},getTintAppendFloatAlphaAndSwap:function(t,e){return((255*e&255)<<24|(255&t)<<16|(t>>8&255)<<8|t>>16&255)>>>0},getFloatsFromUintRGB:function(t){return[(t>>16&255)/255,(t>>8&255)/255,(255&t)/255]},checkShaderMax:function(t,e){var i=Math.min(16,t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS));return e&&-1!==e?Math.min(i,e):i},updateLightingUniforms:function(t,e,i,r,n,a,o,h){var l=e.camera,u=l.scene.sys.lights;if(u&&u.active){var d=u.getLights(l),c=d.length,f=u.ambientColor,p=e.height;if(t){i.setUniform("uNormSampler",r),i.setUniform("uCamera",[l.x,l.y,l.rotation,l.zoom]),i.setUniform("uAmbientLightColor",[f.r,f.g,f.b]),i.setUniform("uLightCount",c);for(var m=new s,g=0;g-1?t.getExtension(s):null,e.config.skipUnreadyShaders){var r="KHR_parallel_shader_compile";this.parallelShaderCompileExtension=i.indexOf(r)>-1?t.getExtension(r):null,this.parallelShaderCompileExtension||(e.config.skipUnreadyShaders=!1)}var n="OES_vertex_array_object";this.vaoExtension=i.indexOf(n)>-1?t.getExtension(n):null;var a="OES_standard_derivatives";if(this.standardDerivativesExtension=i.indexOf(a)>-1?t.getExtension(a):null,t instanceof WebGLRenderingContext){if(!this.instancedArraysExtension)throw new Error("ANGLE_instanced_arrays extension not supported. Required for rendering.");if(t.vertexAttribDivisor=this.instancedArraysExtension.vertexAttribDivisorANGLE.bind(this.instancedArraysExtension),t.drawArraysInstanced=this.instancedArraysExtension.drawArraysInstancedANGLE.bind(this.instancedArraysExtension),t.drawElementsInstanced=this.instancedArraysExtension.drawElementsInstancedANGLE.bind(this.instancedArraysExtension),!this.vaoExtension)throw new Error("OES_vertex_array_object extension not supported. Required for rendering.");if(t.createVertexArray=this.vaoExtension.createVertexArrayOES.bind(this.vaoExtension),t.bindVertexArray=this.vaoExtension.bindVertexArrayOES.bind(this.vaoExtension),t.deleteVertexArray=this.vaoExtension.deleteVertexArrayOES.bind(this.vaoExtension),t.isVertexArray=this.vaoExtension.isVertexArrayOES.bind(this.vaoExtension),this.standardDerivativesExtension)t.FRAGMENT_SHADER_DERIVATIVE_HINT=this.standardDerivativesExtension.FRAGMENT_SHADER_DERIVATIVE_HINT_OES;else if(e.config.smoothPixelArt)throw new Error("OES_standard_derivatives extension not supported. Cannot use smoothPixelArt.")}},setContextHandlers:function(t,e){this.previousContextLostHandler&&this.canvas.removeEventListener("webglcontextlost",this.previousContextLostHandler,!1),this.previousContextRestoredHandler&&this.canvas.removeEventListener("webglcontextrestored",this.previousContextRestoredHandler,!1),this.contextLostHandler="function"==typeof t?t.bind(this):this.dispatchContextLost.bind(this),this.contextRestoredHandler="function"==typeof e?e.bind(this):this.dispatchContextRestored.bind(this),this.canvas.addEventListener("webglcontextlost",this.contextLostHandler,!1),this.canvas.addEventListener("webglcontextrestored",this.contextRestoredHandler,!1),this.previousContextLostHandler=this.contextLostHandler,this.previousContextRestoredHandler=this.contextRestoredHandler},dispatchContextLost:function(t){this.contextLost=!0,console&&console.warn("WebGL Context lost. Renderer disabled"),this.emit(h.LOSE_WEBGL,this),t.preventDefault()},dispatchContextRestored:function(t){if(this.gl.isContextLost())console&&console.log("WebGL Context restored, but context is still lost");else{this.setExtensions(),this.glWrapper.update(A.getDefault(this),!0),this.glTextureUnits.init(),this.compression=this.getCompressedTextures();var e=function(t){t.createResource()};s(this.glTextureWrappers,e),s(this.glBufferWrappers,e),s(this.glFramebufferWrappers,e),s(this.glProgramWrappers,e),s(this.glVAOWrappers,e),this.glTextureUnits.bindUnits(this.glTextureUnits.units,!0),this.resize(this.game.scale.baseSize.width,this.game.scale.baseSize.height),this.contextLost=!1,console&&console.warn("WebGL Context restored. Renderer running again."),this.emit(h.RESTORE_WEBGL,this),t.preventDefault()}},captureFrame:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1)},captureNextFrame:function(){O},getFps:function(){O},log:function(){},startCapture:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=!1),void 0===i&&(i=!1)},stopCapture:function(){O},onCapture:function(t){},onResize:function(t,e){e.width===this.width&&e.height===this.height||this.resize(e.width,e.height)},resize:function(t,e){var i=this.gl;return this.width=t,this.height=e,this.setProjectionMatrix(t,e),this.drawingBufferHeight=i.drawingBufferHeight,this.glWrapper.update({scissor:{box:[0,i.drawingBufferHeight-e,t,e]},viewport:[0,0,t,e]}),this.emit(h.RESIZE,t,e),this},getCompressedTextures:function(){var t="WEBGL_compressed_texture_",e="WEBKIT_"+t,i=function(i,s){var r=i.getExtension(t+s)||i.getExtension(e+s)||i.getExtension("EXT_texture_compression_"+s);if(r){var n={};for(var a in r)n[r[a]]=a;return n}},s=this.gl;return{ETC:i(s,"etc"),ETC1:i(s,"etc1"),ATC:i(s,"atc"),ASTC:i(s,"astc"),BPTC:i(s,"bptc"),RGTC:i(s,"rgtc"),PVRTC:i(s,"pvrtc"),S3TC:i(s,"s3tc"),S3TCSRGB:i(s,"s3tc_srgb"),IMG:!0}},getCompressedTextureName:function(t,e){var i=this.compression[t.toUpperCase()];if(e in i)return i[e]},supportsCompressedTexture:function(t,e){var i=this.compression[t.toUpperCase()];return!!i&&(!e||e in i)},getAspectRatio:function(){return this.width/this.height},setProjectionMatrix:function(t,e,i){return t===this.projectionWidth&&e===this.projectionHeight&&i===this.projectionFlipY||(this.projectionWidth=t,this.projectionHeight=e,this.projectionFlipY=!!i,i?this.projectionMatrix.ortho(0,t,0,e,-1e3,1e3):this.projectionMatrix.ortho(0,t,e,0,-1e3,1e3)),this},setProjectionMatrixFromDrawingContext:function(t){return this.setProjectionMatrix(t.width,t.height,!1)},resetProjectionMatrix:function(){return this.setProjectionMatrix(this.width,this.height)},hasExtension:function(t){return!!this.supportedExtensions&&this.supportedExtensions.indexOf(t)},getExtension:function(t){return this.hasExtension(t)?(t in this.extensions||(this.extensions[t]=this.gl.getExtension(t)),this.extensions[t]):null},addBlendMode:function(t,e){return this.blendModes.push(C.createCombined(this,!0,void 0,e,t[0],t[1]))-1-1},updateBlendMode:function(t,e,i){if(t>17&&this.blendModes[t]){var s=this.blendModes[t];2===e.length?s.func=[e[0],e[1],e[0],e[1]]:s.func=[e[0],e[1],e[2],e[3]],s.equation="number"==typeof i?[i,i]:[i[0],i[1]]}return this},removeBlendMode:function(t){return t>17&&this.blendModes[t]&&this.blendModes.splice(t,1),this},clearFramebuffer:function(t,e,i){var s=this.gl,r=0;t&&(this.glWrapper.updateColorClearValue({colorClearValue:t}),r|=s.COLOR_BUFFER_BIT),void 0!==e&&(this.glWrapper.updateStencilClear({stencil:{clear:e}}),r|=s.STENCIL_BUFFER_BIT),void 0!==i&&(r|=s.DEPTH_BUFFER_BIT),s.clear(r)},createTextureFromSource:function(t,e,i,s,r,n){void 0===r&&(r=!1);var o=this.gl,h=o.NEAREST,u=o.NEAREST,d=o.CLAMP_TO_EDGE;e=t?t.width:e,i=t?t.height:i;var c=l(e,i);if(c&&!r&&(d=o.REPEAT),s===a.ScaleModes.LINEAR&&this.config.antialias){var f=t&&t.compressed,p=!f&&c||f&&t.mipmaps.length>1;h=this.mipmapFilter&&p?this.mipmapFilter:o.LINEAR,u=o.LINEAR}return t||"number"!=typeof e||"number"!=typeof i?this.createTexture2D(0,h,u,d,d,o.RGBA,t,void 0,void 0,void 0,void 0,n):this.createTexture2D(0,h,u,d,d,o.RGBA,null,e,i,void 0,void 0,n)},createTexture2D:function(t,e,i,s,r,n,a,o,h,l,u,d){"number"!=typeof o&&(o=a?a.width:1),"number"!=typeof h&&(h=a?a.height:1);var c=new w(this,t,e,i,s,r,n,a,o,h,l,u,d);return this.glTextureWrappers.push(c),c},createFramebuffer:function(t,e,i){Array.isArray(t)||null===t||(t=[t]);var s=new b(this,t,e,i);return this.glFramebufferWrappers.push(s),s},createProgram:function(t,e){var i=new y(this,t,e);return this.glProgramWrappers.push(i),i},createVertexBuffer:function(t,e){var i=this.gl,s=new v(this,t,i.ARRAY_BUFFER,e);return this.glBufferWrappers.push(s),s},createIndexBuffer:function(t,e){var i=this.gl,s=new v(this,t,i.ELEMENT_ARRAY_BUFFER,e);return this.glBufferWrappers.push(s),s},createVAO:function(t,e,i){var s=new E(this,t,e,i);return this.glVAOWrappers.push(s),s},deleteTexture:function(t){if(t)return r(this.glTextureWrappers,t),t.destroy(),this},deleteFramebuffer:function(t){return t?(r(this.glFramebufferWrappers,t),t.destroy(),this):this},deleteProgram:function(t){return t&&(r(this.glProgramWrappers,t),t.destroy()),this},deleteBuffer:function(t){return t?(r(this.glBufferWrappers,t),t.destroy(),this):this},preRender:function(){if(!this.contextLost){this.emit(h.PRE_RENDER_CLEAR);var t=this.baseDrawingContext;if(this.config.clearBeforeRender){var e=this.config.backgroundColor;t.setClearColor(e.redGL,e.greenGL,e.blueGL,e.alphaGL),t.setAutoClear(!0,!0,!0)}else t.setAutoClear(!1,!1,!1);t.use(),this.emit(h.PRE_RENDER)}},render:function(t,e,i){this.contextLost||(this.emit(h.RENDER,t,i),this.currentViewCamera=i,this.cameraRenderNode.run(this.baseDrawingContext,e,i),this.currentViewCamera=null)},postRender:function(){if(this.baseDrawingContext.release(),!this.contextLost){this.emit(h.POST_RENDER);var t=this.snapshotState;t.callback&&(g(this.gl,t),t.callback=null)}},drawElements:function(t,e,i,s,r,n,a){var o=this.gl;t.beginDraw(),i.bind(),s.bind(),this.glTextureUnits.bindUnits(e),o.drawElements(a||o.TRIANGLE_STRIP,r,o.UNSIGNED_SHORT,n)},drawInstancedArrays:function(t,e,i,s,r,n,a,o){var h=this.gl;t.beginDraw(),i.bind(),s.bind(),this.glTextureUnits.bindUnits(e),h.drawArraysInstanced(o||h.TRIANGLE_STRIP,r,n,a)},snapshot:function(t,e,i){return this.snapshotArea(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight,t,e,i)},snapshotArea:function(t,e,i,s,r,n,a){var o=this.snapshotState;return o.callback=r,o.type=n,o.encoder=a,o.getPixel=!1,o.x=t,o.y=e,o.width=i,o.height=s,o.unpremultiplyAlpha=this.game.config.premultipliedAlpha,this},snapshotPixel:function(t,e,i){return this.snapshotArea(t,e,1,1,i),this.snapshotState.getPixel=!0,this},snapshotFramebuffer:function(t,e,i,s,r,n,a,o,h,l,u){void 0===r&&(r=!1),void 0===n&&(n=0),void 0===a&&(a=0),void 0===o&&(o=e),void 0===h&&(h=i),"pixel"===l&&(r=!0,l="image/png"),this.snapshotArea(n,a,o,h,s,l,u);var d=this.snapshotState;return d.getPixel=r,d.isFramebuffer=!0,d.bufferWidth=e,d.bufferHeight=i,d.width=Math.min(d.width,e),d.height=Math.min(d.height,i),this.glWrapper.updateBindingsFramebuffer({bindings:{framebuffer:t}}),g(this.gl,d),d.callback=null,d.isFramebuffer=!1,this},canvasToTexture:function(t,e,i,s){void 0===i&&(i=!1),void 0===s&&(s=!0);var r=this.gl,n=r.NEAREST,a=r.NEAREST,o=t.width,h=t.height,u=r.CLAMP_TO_EDGE,d=l(o,h);return!i&&d&&(u=r.REPEAT),this.config.antialias&&(n=d&&this.mipmapFilter?this.mipmapFilter:r.LINEAR,a=r.LINEAR),e?(e.update(t,o,h,s,u,u,n,a,e.format),e):this.createTexture2D(0,n,a,u,u,r.RGBA,t,o,h,!0,!1,s)},createCanvasTexture:function(t,e,i){return void 0===e&&(e=!1),void 0===i&&(i=!0),this.canvasToTexture(t,null,e,i)},updateCanvasTexture:function(t,e,i,s){return void 0===i&&(i=!0),void 0===s&&(s=!1),this.canvasToTexture(t,e,s,i)},videoToTexture:function(t,e,i,s){void 0===i&&(i=!1),void 0===s&&(s=!0);var r=this.gl,n=r.NEAREST,a=r.NEAREST,o=t.videoWidth,h=t.videoHeight,u=r.CLAMP_TO_EDGE,d=l(o,h);return!i&&d&&(u=r.REPEAT),this.config.antialias&&(n=d&&this.mipmapFilter?this.mipmapFilter:r.LINEAR,a=r.LINEAR),e?(e.update(t,o,h,s,u,u,n,a,e.format),e):this.createTexture2D(0,n,a,u,u,r.RGBA,t,o,h,!0,!0,s)},createVideoTexture:function(t,e,i){return void 0===e&&(e=!1),void 0===i&&(i=!0),this.videoToTexture(t,null,e,i)},updateVideoTexture:function(t,e,i,s){return void 0===i&&(i=!0),void 0===s&&(s=!1),this.videoToTexture(t,e,s,i)},createUint8ArrayTexture:function(t,e,i,s,r){var n=this.gl,a=n.NEAREST,o=n.NEAREST,h=n.CLAMP_TO_EDGE;return l(e,i)&&(h=n.REPEAT),void 0===s&&(s=!0),void 0===r&&(r=!0),this.createTexture2D(0,a,o,h,h,n.RGBA,t,e,i,s,!1,r)},setTextureFilter:function(t,e){var i=this.gl,s=0===e?i.LINEAR:i.NEAREST,r=this.glTextureUnits,n=r.units[0];return r.bind(t,0),t.update(t.pixels,t.width,t.height,t.flipY,t.wrapS,t.wrapT,s,s,t.format),n&&r.bind(n,0),this},setTextureWrap:function(t,e,i){var s=this.gl;if(!l(t.width,t.height)&&(e!==s.CLAMP_TO_EDGE||i!==s.CLAMP_TO_EDGE))return this;var r=this.glTextureUnits,n=r.units[0];return r.bind(t,0),t.update(t.pixels,t.width,t.height,t.flipY,e,i,t.minFilter,t.magFilter,t.format),n&&r.bind(n,0),this},getMaxTextureSize:function(){return this.config.maxTextureSize},destroy:function(){this.off(h.RESIZE,this.baseDrawingContext.resize,this.baseDrawingContext),this.canvas.removeEventListener("webglcontextlost",this.contextLostHandler,!1),this.canvas.removeEventListener("webglcontextrestored",this.contextRestoredHandler,!1);var t=function(t){t.destroy()};s(this.glBufferWrappers,t),s(this.glFramebufferWrappers,t),s(this.glProgramWrappers,t),s(this.glTextureWrappers,t),this.removeAllListeners(),this.extensions={},this.gl=null,this.game=null,this.canvas=null,this.contextLost=!0}});t.exports=P},14500(t){t.exports={BYTE:{enum:5120,size:1},UNSIGNED_BYTE:{enum:5121,size:1},SHORT:{enum:5122,size:2},UNSIGNED_SHORT:{enum:5123,size:2},INT:{enum:5124,size:4},UNSIGNED_INT:{enum:5125,size:4},FLOAT:{enum:5126,size:4}}},4159(t,e,i){var s=i(14500),r=i(79291),n={Shaders:i(89350),ShaderAdditionMakers:i(83786),DrawingContext:i(87774),DrawingContextPool:i(65656),ProgramManager:i(56436),RenderNodes:i(54521),ShaderProgramFactory:i(18804),Utils:i(70554),WebGLRenderer:i(74797),Wrappers:i(31884)};n=r(!1,n,s),t.exports=n},47774(t){var e={createCombined:function(t,e,i,s,r,n){var a=t.gl;return void 0===e&&(e=!0),void 0===i&&(i=[0,0,0,0]),void 0===s&&(s=a.FUNC_ADD),void 0===r&&(r=a.ONE),void 0===n&&(n=a.ONE_MINUS_SRC_ALPHA),{enabled:e,color:i,equation:[s,s],func:[r,n,r,n]}},createSeparate:function(t,e,i,s,r,n,a,o,h){var l=t.gl;return void 0===e&&(e=!0),void 0===i&&(i=[0,0,0,0]),void 0===s&&(s=l.FUNC_ADD),void 0===r&&(r=l.FUNC_ADD),void 0===n&&(n=l.ONE),void 0===a&&(a=l.ONE_MINUS_SRC_ALPHA),void 0===o&&(o=l.ONE),void 0===h&&(h=l.ONE_MINUS_SRC_ALPHA),{enabled:e,color:i,equation:[s,r],func:[n,a,o,h]}}};t.exports=e},53314(t,e,i){var s=i(8054),r=i(62644),n=i(71623),a={getDefault:function(t){return{bindings:{activeTexture:0,arrayBuffer:null,elementArrayBuffer:null,framebuffer:null,program:null,renderbuffer:null},blend:r(t.blendModes[s.BlendModes.NORMAL]),colorClearValue:[0,0,0,1],colorWritemask:[!0,!0,!0,!0],cullFace:!1,depthTest:!1,scissor:{enable:!0,box:[0,0,0,0]},stencil:n.create(t),texturing:{flipY:!1,premultiplyAlpha:!1},vao:null,viewport:[0,0,0,0]}}};t.exports=a},71623(t){var e={create:function(t,e,i,s,r,n,a,o,h){var l=t.gl;return void 0===e&&(e=!1),void 0===i&&(i=l.ALWAYS),void 0===s&&(s=0),void 0===r&&(r=255),void 0===n&&(n=l.KEEP),void 0===a&&(a=l.KEEP),void 0===o&&(o=l.KEEP),void 0===h&&(h=0),{enabled:e,func:{func:i,ref:s,mask:r},op:{fail:n,zfail:a,zpass:o},clear:h}}};t.exports=e},13961(t,e,i){var s=i(83419),r=i(56436),n=i(40952),a=i(6141),o=i(36909),h=new s({Extends:a,initialize:function(t,e,i){var s=t.renderer,h=s.gl,l=(i=this._copyAndCompleteConfig(t,i||{},e)).name;if(!l)throw new Error("BatchHandler must have a name");a.call(this,l,t),this.instancesPerBatch=-1,this.verticesPerInstance=i.verticesPerInstance;var u=Math.floor(65536/this.verticesPerInstance),d=i.instancesPerBatch||s.config.batchSize||u;this.instancesPerBatch=Math.min(d,u),this.indicesPerInstance=i.indicesPerInstance,this.bytesPerIndexPerInstance=this.indicesPerInstance*Uint16Array.BYTES_PER_ELEMENT,this.maxTexturesPerBatch=1,this.manager.on(o.Events.SET_PARALLEL_TEXTURE_UNITS,this.updateTextureCount,this),s.glWrapper.updateVAO({vao:null}),this.indexBuffer=s.createIndexBuffer(this._generateElementIndices(this.instancesPerBatch),i.indexBufferDynamic?h.DYNAMIC_DRAW:h.STATIC_DRAW);var c=i.vertexBufferLayout;if(c.count=this.instancesPerBatch*this.verticesPerInstance,this.vertexBufferLayout=new n(s,c,null),this.programManager=new r(s,[this.vertexBufferLayout],this.indexBuffer),this.programManager.setBaseShader(i.shaderName,i.vertexSource,i.fragmentSource),i.shaderAdditions)for(var f=0;fthis.instancesPerBatch)throw new Error("BatchHandlerStrip: Vertex count exceeds maximum per batch ("+this.maxVerticesPerBatch+")");this.instanceCount+c>this.instancesPerBatch&&this.run(t),this.updateRenderOptions(u),this._renderOptionsChanged&&(this.run(t),this.updateShaderConfig());var f,m=this.batchTextures(s),g=this.instanceCount*this.floatsPerInstance,v=this.vertexBufferLayout.buffer,x=v.viewF32,y=v.viewU32,T=!1;if(this.instanceCount>0){var w=1+this.floatsPerInstance/this.verticesPerInstance;x[g++]=x[g-w],x[g++]=x[g-w],x[g++]=x[g-w],x[g++]=x[g-w],x[g++]=x[g-w],x[g++]=x[g-w],y[g++]=y[g-w],T=!0}d&&(f=[]);for(var S=i.a,b=i.b,E=i.c,C=i.d,A=i.e,_=i.f,M=r.length,R=0;R=u.length)&&(n++,this.run(t),d=this.instanceCount*this.indicesPerInstance,m=this.vertexCount*h/f.BYTES_PER_ELEMENT,v=0,y=0)}}});t.exports=c},61842(t,e,i){var s=i(19715),r=i(1e3),n=i(61340),a=i(87841),o=i(43855),h=i(83419),l=i(70554),u=i(6141);function d(t){return l.getTintAppendFloatAlpha(16777215,t)}var c=new h({Extends:u,initialize:function(t){u.call(this,"Camera",t),this.batchHandlerQuadSingleNode=t.getNode("BatchHandlerQuadSingle"),this.fillCameraNode=t.getNode("FillCamera"),this.listCompositorNode=t.getNode("ListCompositor"),this._parentTransformMatrix=new n},run:function(t,e,i,n,h,l){var u;this.onRunBegin(t);var c=t.renderer.drawingContextPool,f=this.manager,p=i.alpha,m=i.filters.internal.getActive(),g=i.filters.external.getActive(),v=h||i.forceComposite||m.length||g.length||p<1;n?i.matrixExternal.multiply(n,n):n=this._parentTransformMatrix.copyFrom(i.matrixExternal);var x=n.decomposeMatrix(),y=o(x.translateX,0)&&o(x.translateY,0)&&o(x.rotation,0)&&o(x.scaleX,1)&&o(x.scaleY,1),T=i.x,w=i.y,S=i.width,b=i.height,E=t.getClone();E.setCamera(i),v?((u=c.get(S,b)).setCamera(i),u.setScissorBox(0,0,S,b)):(u=E).setScissorBox(T,w,S,b),u.use();var C=this.fillCameraNode;if(i.backgroundColor.alphaGL>0){var A=i.backgroundColor,_=r(A.red,A.green,A.blue,A.alpha);C.run(u,_,v)}this.listCompositorNode.run(u,e,null,l);var M=i.flashEffect;M.postRenderWebGL()&&(_=r(M.red,M.green,M.blue,255*M.alpha),C.run(u,_,v));var R=i.fadeEffect;if(R.postRenderWebGL()&&(_=r(R.red,R.green,R.blue,255*R.alpha),C.run(u,_,v)),f.finishBatch(),v){var O,P,L,F,D={smoothPixelArt:f.renderer.game.config.smoothPixelArt},I=new a(0,0,u.width,u.height);for(O=0;O0,k=!B,U=new a(0,0,E.width,E.height);if(B){for(O=g.length-1;O>=0;O--)(P=g[O]).active&&(L=P.getPaddingCeil(),U.setTo(U.x+L.x,U.y+L.y,U.width+L.width,U.height+L.height));(k=U.width!==u.width||U.height!==u.height||!y)&&((u=c.get(U.width,U.height)).setScissorBox(0,0,U.width,U.height),u.setCamera(E.camera),u.use())}else u=E;if(k){var z,Y=U.x,X=U.y;n.setQuad(I.x,I.y,I.x+I.width,I.y+I.height),z=n.quad,F=B?4294967295:d(p),i.roundPixels&&(z[0]=Math.round(z[0]),z[1]=Math.round(z[1]),z[2]=Math.round(z[2]),z[3]=Math.round(z[3]),z[4]=Math.round(z[4]),z[5]=Math.round(z[5]),z[6]=Math.round(z[6]),z[7]=Math.round(z[7])),this.batchHandlerQuadSingleNode.batch(u,N.texture,z[0]-Y,z[1]-X,z[2]-Y,z[3]-X,z[6]-Y,z[7]-X,z[4]-Y,z[5]-X,0,1,1,-1,!1,F,F,F,F,D)}if(N!==u&&N.release(),B){var W=!1;for(N=null,L=new a,O=0;O0&&d2&&m>1&&(g=!0,r||(v=!0));for(var x,y,T,w,S,b,E,C,A=[],_=0,M=[],R=0,O=[],P=0,L=u*u,F=0;F0){var l=e,u=e;if(a.length>0){r=h;for(var d=0;d0)for(r=h,d=0;d0){var r=this.instanceBufferLayout.buffer,n=i.memberCount,a=Math.floor(n/i.bufferUpdateSegmentSize),o=!0;for(e=0;e<=a;e++)if(!(1<0&&e.addAddition(h(t.tileset.maxAnimationLength));for(var r=t.lighting,n=e.getAdditionsByTag("LIGHTING"),a=0;a0,T=[x,e.layerDataTexture];if(y&&(T[2]=v.getAnimationDataTexture(r)),e.lighting){var w=v.image.dataSource[0];w=w?w.glTexture:this.manager.renderer.normalTexture,T[3]=w}this.updateRenderOptions(e);var S=this.programManager,b=S.getCurrentProgramSuite();if(b){var E=b.program,C=b.vao;this.setupUniforms(t,e),S.applyUniforms(E),r.drawElements(t,T,E,C,4,0)}this.onRunEnd(t)}});t.exports=x},12913(t,e,i){var s=i(83419),r=i(6141),n=new s({Extends:r,initialize:function(t){r.call(this,"TexturerImage",t),this.frame=null,this.frameWidth=0,this.frameHeight=0,this.uvSource=null},run:function(t,e,i){this.onRunBegin(t);var s=e.frame;if(this.frame=s,this.frameWidth=s.cutWidth,this.frameHeight=s.cutHeight,this.uvSource=s,e.isCropped){var r=e._crop;this.uvSource=r,r.flipX===e.flipX&&r.flipY===e.flipY||e.frame.updateCropUVs(r,e.flipX,e.flipY),this.frameWidth=r.width,this.frameHeight=r.height}var n=s.source.resolution;this.frameWidth/=n,this.frameHeight/=n,this.onRunEnd(t)}});t.exports=n},22995(t,e,i){var s=i(61340),r=i(83419),n=i(6141),a=new r({Extends:n,initialize:function(t){n.call(this,"TexturerTileSprite",t),this.frame=null,this.uvMatrix=new s},run:function(t,e,i){this.onRunBegin(t);var s=e.frame;if(this.frame=s,e.isCropped){var r=e._crop;r.flipX===e.flipX&&r.flipY===e.flipY||e.frame.updateCropUVs(r,e.flipX,e.flipY)}this.uvMatrix.loadIdentity(),this.uvMatrix.scale(1/s.width,1/s.height),this.uvMatrix.translate(e.tilePositionX,e.tilePositionY),this.uvMatrix.scale(1/e.tileScaleX,1/e.tileScaleY),this.uvMatrix.rotate(-e.tileRotation),this.uvMatrix.setQuad(0,0,e.width,e.height),this.onRunEnd(t)}});t.exports=a},86081(t,e,i){var s=i(61340),r=i(83419),n=i(46975),a=i(6141),o=new r({Extends:a,initialize:function(t,e){e=n(e||{},this.defaultConfig),a.call(this,e.name,t),this.quad=new Float32Array(8),this._spriteMatrix=new s,this._calcMatrix=new s},defaultConfig:{name:"TransformerImage",role:"Transformer"},run:function(t,e,i,s,r){this.onRunBegin(t);var n=i.frame,a=i.uvSource,o=a.x,h=a.y,l=e.displayOriginX,u=e.displayOriginY,d=-l+o,c=-u+h,f=n.customPivot,p=1,m=1;e.flipX&&(f||(d+=-n.realWidth+2*l),p=-1),e.flipY&&(f||(c+=-n.realHeight+2*u),m=-1);var g=t.camera,v=this._spriteMatrix,x=this._calcMatrix.copyWithScrollFactorFrom(g.getViewMatrix(!t.useCanvas),g.scrollX,g.scrollY,e.scrollFactorX,e.scrollFactorY);s&&x.multiply(s),v.applyITRS(e.x,e.y,e.rotation,e.scaleX*p,e.scaleY*m),x.multiply(v),x.setQuad(d,c,d+i.frameWidth,c+i.frameHeight,this.quad);var y=x.matrix,T=1===y[0]&&0===y[1]&&0===y[2]&&1===y[3];if(e.willRoundVertices(g,T)){var w=this.quad;w[0]=Math.round(w[0]),w[1]=Math.round(w[1]),w[2]=Math.round(w[2]),w[3]=Math.round(w[3]),w[4]=Math.round(w[4]),w[5]=Math.round(w[5]),w[6]=Math.round(w[6]),w[7]=Math.round(w[7])}this.onRunEnd(t)}});t.exports=o},88383(t,e,i){var s=i(61340),r=i(83419),n=i(46975),a=i(6141),o=new r({Extends:a,initialize:function(t,e){e=n(e||{},this.defaultConfig),a.call(this,e.name,t),this._spriteMatrix=new s,this.quad=this._spriteMatrix.quad},defaultConfig:{name:"TransformerStamp",role:"Transformer"},run:function(t,e,i,s,r){this.onRunBegin(t);var n=i.frame,a=i.uvSource,o=a.x,h=a.y,l=e.displayOriginX,u=e.displayOriginY,d=-l+o,c=-u+h,f=n.customPivot,p=1,m=1;e.flipX&&(f||(d+=-n.realWidth+2*l),p=-1),e.flipY&&(f||(c+=-n.realHeight+2*u),m=-1);var g=e.x,v=e.y,x=this._spriteMatrix;x.applyITRS(g,v,e.rotation,e.scaleX*p,e.scaleY*m);var y=x.matrix;this.onlyTranslate=1===y[0]&&0===y[1]&&0===y[2]&&1===y[3],x.setQuad(d,c,d+i.frameWidth,c+i.frameHeight);var T=x.matrix,w=1===T[0]&&0===T[1]&&0===T[2]&&1===T[3];if(e.willRoundVertices(t.camera,w)){var S=this.quad;S[0]=Math.round(S[0]),S[1]=Math.round(S[1]),S[2]=Math.round(S[2]),S[3]=Math.round(S[3]),S[4]=Math.round(S[4]),S[5]=Math.round(S[5]),S[6]=Math.round(S[6]),S[7]=Math.round(S[7])}this.onRunEnd(t)}});t.exports=o},34454(t,e,i){var s=i(83419),r=i(86081),n=new s({Extends:r,initialize:function(t,e){r.call(this,t,e)},defaultConfig:{name:"TransformerTile",role:"Transformer"},run:function(t,e,i,s,r){this.onRunBegin(t);var n=t.camera,a=this._calcMatrix,o=this._spriteMatrix;a.copyWithScrollFactorFrom(n.getViewMatrix(!t.useCanvas),n.scrollX,n.scrollY,e.scrollFactorX,e.scrollFactorY),s&&a.multiply(s);var h=i.frameWidth,l=i.frameHeight,u=h,d=l,c=h/2,f=l/2,p=e.scaleX,m=e.scaleY,g=e.gidMap[r.index],v=g.tileOffset.x,x=g.tileOffset.y,y=e.x+r.pixelX*p+(c*p-v),T=e.y+r.pixelY*m+(f*m-x),w=-c,S=-f;r.flipX&&(u*=-1,w+=h),r.flipY&&(d*=-1,w+=l),o.applyITRS(y,T,r.rotation,p,m),a.multiply(o),a.setQuad(w,S,w+u,S+d,this.quad);var b=a.matrix,E=1===b[0]&&0===b[1]&&0===b[2]&&1===b[3];if(e.willRoundVertices(n,E)){var C=this.quad;C[0]=Math.round(C[0]),C[1]=Math.round(C[1]),C[2]=Math.round(C[2]),C[3]=Math.round(C[3]),C[4]=Math.round(C[4]),C[5]=Math.round(C[5]),C[6]=Math.round(C[6]),C[7]=Math.round(C[7])}this.onRunEnd(t)}});t.exports=n},46211(t,e,i){var s=i(83419),r=i(86081),n=new s({Extends:r,initialize:function(t,e){r.call(this,t,e)},defaultConfig:{name:"TransformerTileSprite",role:"Transformer"},run:function(t,e,i,s,r){this.onRunBegin(t);var n=e.width,a=e.height,o=e.displayOriginX,h=e.displayOriginY,l=-o,u=-h,d=1,c=1;e.flipX&&(l+=2*o-n,d=-1),e.flipY&&(u+=2*h-a,c=-1);var f=e.x,p=e.y,m=t.camera,g=this._calcMatrix,v=this._spriteMatrix;g.copyWithScrollFactorFrom(m.getViewMatrix(!t.useCanvas),m.scrollX,m.scrollY,e.scrollFactorX,e.scrollFactorY),s&&g.multiply(s),v.applyITRS(f,p,e.rotation,e.scaleX*d,e.scaleY*c),g.multiply(v),g.setQuad(l,u,l+n,u+a,this.quad);var x=g.matrix,y=1===x[0]&&0===x[1]&&0===x[2]&&1===x[3];if(e.willRoundVertices(m,y)){var T=this.quad;T[0]=Math.round(T[0]),T[1]=Math.round(T[1]),T[2]=Math.round(T[2]),T[3]=Math.round(T[3]),T[4]=Math.round(T[4]),T[5]=Math.round(T[5]),T[6]=Math.round(T[6]),T[7]=Math.round(T[7])}this.onRunEnd(t)}});t.exports=n},84547(t){t.exports=["vec4 applyLighting (vec4 fragColor, vec3 normal)","{"," vec4 lighting = getLighting(fragColor, normal);"," return fragColor * vec4(lighting.rgb * lighting.a, lighting.a);","}"].join("\n")},11104(t){t.exports=["vec4 applyTint(vec4 texture)","{"," vec3 unpremultTexture = texture.rgb / texture.a;"," float alpha = texture.a * outTint.a;"," vec3 color = vec3(unpremultTexture);"," if (outTintEffect == 0.0) {"," color *= outTint.bgr;"," }"," else if (outTintEffect == 1.0) {"," color = outTint.bgr;"," }"," else if (outTintEffect == 2.0) {"," color += outTint.bgr;"," }"," else if (outTintEffect == 4.0) {"," color = 1.0 - (1.0 - unpremultTexture) * (1.0 - outTint.bgr);"," }"," else if (outTintEffect == 5.0) {"," color = vec3("," unpremultTexture.r < 0.5 ? 2.0 * outTint.b * unpremultTexture.r : 1.0 - 2.0 * (1.0 - outTint.b) * (1.0 - unpremultTexture.r),"," unpremultTexture.g < 0.5 ? 2.0 * outTint.g * unpremultTexture.g : 1.0 - 2.0 * (1.0 - outTint.g) * (1.0 - unpremultTexture.g),"," unpremultTexture.b < 0.5 ? 2.0 * outTint.r * unpremultTexture.b : 1.0 - 2.0 * (1.0 - outTint.r) * (1.0 - unpremultTexture.b)"," );"," }"," else if (outTintEffect == 6.0) {"," color = vec3("," outTint.b < 0.5 ? 2.0 * outTint.b * unpremultTexture.r : 1.0 - 2.0 * (1.0 - outTint.b) * (1.0 - unpremultTexture.r),"," outTint.g < 0.5 ? 2.0 * outTint.g * unpremultTexture.g : 1.0 - 2.0 * (1.0 - outTint.g) * (1.0 - unpremultTexture.g),"," outTint.r < 0.5 ? 2.0 * outTint.r * unpremultTexture.b : 1.0 - 2.0 * (1.0 - outTint.r) * (1.0 - unpremultTexture.b)"," );"," }"," return vec4(color * alpha, alpha);","}"].join("\n")},81556(t){t.exports=["vec4 boundedSampler(sampler2D sampler, vec2 uv)","{"," if (clamp(uv, 0.0, 1.0) != uv)"," {"," return vec4(0.0, 0.0, 0.0, 0.0);"," }"," return texture2D(sampler, uv);","}"].join("\n")},96293(t){t.exports=["#define SHADER_NAME PHASER_COLORMATRIX_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform float uColorMatrix[20];","uniform float uAlpha;","varying vec2 outTexCoord;","void main ()","{"," vec4 c = texture2D(uMainSampler, outTexCoord);"," if (uAlpha == 0.0)"," {"," gl_FragColor = c;"," return;"," }"," if (c.a > 0.0)"," {"," c.rgb /= c.a;"," }"," vec4 result;"," result.r = (uColorMatrix[0] * c.r) + (uColorMatrix[1] * c.g) + (uColorMatrix[2] * c.b) + (uColorMatrix[3] * c.a) + uColorMatrix[4];"," result.g = (uColorMatrix[5] * c.r) + (uColorMatrix[6] * c.g) + (uColorMatrix[7] * c.b) + (uColorMatrix[8] * c.a) + uColorMatrix[9];"," result.b = (uColorMatrix[10] * c.r) + (uColorMatrix[11] * c.g) + (uColorMatrix[12] * c.b) + (uColorMatrix[13] * c.a) + uColorMatrix[14];"," result.a = (uColorMatrix[15] * c.r) + (uColorMatrix[16] * c.g) + (uColorMatrix[17] * c.b) + (uColorMatrix[18] * c.a) + uColorMatrix[19];"," c.rgb *= c.a;"," result.rgb *= result.a;"," gl_FragColor = mix(c, result, uAlpha);","}"].join("\n")},78390(t){t.exports=["vec2 v2len (vec2 a, vec2 b)","{"," return sqrt(a*a+b*b);","}","vec2 getBlockyTexCoord (vec2 texCoord, vec2 texRes) {"," texCoord *= texRes;"," vec2 seam = floor(texCoord + 0.5);"," texCoord = (texCoord - seam) / v2len(dFdx(texCoord), dFdy(texCoord)) + seam;"," texCoord = clamp(texCoord, seam-.5, seam+.5);"," return texCoord / texRes;","}"].join("\n")},11719(t){t.exports=["struct Light","{"," vec3 position;"," vec3 color;"," float intensity;"," float radius;","};","const int kMaxLights = LIGHT_COUNT;","uniform vec4 uCamera; /* x, y, rotation, zoom */","uniform sampler2D uNormSampler;","uniform vec3 uAmbientLightColor;","uniform Light uLights[kMaxLights];","uniform int uLightCount;","#ifdef FEATURE_SELFSHADOW","uniform float uDiffuseFlatThreshold;","uniform float uPenumbra;","#endif","vec4 getLighting (vec4 fragColor, vec3 normal)","{"," vec3 finalColor = vec3(0.0);"," vec2 res = vec2(min(uResolution.x, uResolution.y)) * uCamera.w;"," #ifdef FEATURE_SELFSHADOW"," vec3 unpremultipliedColor = fragColor.rgb / fragColor.a;"," float occlusionThreshold = 1.0 - ((unpremultipliedColor.r + unpremultipliedColor.g + unpremultipliedColor.b) / uDiffuseFlatThreshold);"," #endif"," for (int index = 0; index < kMaxLights; ++index)"," {"," if (index < uLightCount)"," {"," Light light = uLights[index];"," vec3 lightDir = vec3((light.position.xy / res) - (gl_FragCoord.xy / res), light.position.z / res.x);"," vec3 lightNormal = normalize(lightDir);"," float distToSurf = length(lightDir) * uCamera.w;"," float diffuseFactor = max(dot(normal, lightNormal), 0.0);"," float radius = (light.radius / res.x * uCamera.w) * uCamera.w;"," float attenuation = clamp(1.0 - distToSurf * distToSurf / (radius * radius), 0.0, 1.0);"," #ifdef FEATURE_SELFSHADOW"," float occluded = smoothstep(0.0, 1.0, (diffuseFactor - occlusionThreshold) / uPenumbra);"," vec3 diffuse = light.color * diffuseFactor * occluded;"," #else"," vec3 diffuse = light.color * diffuseFactor;"," #endif"," finalColor += (attenuation * diffuse) * light.intensity;"," }"," }"," vec4 colorOutput = vec4(uAmbientLightColor + finalColor, 1.0);"," return colorOutput;","}"].join("\n")},14030(t){t.exports=["vec2 clampTexCoordWithinFrame (vec2 texCoord)","{"," vec2 texRes = getTexRes();"," vec4 frameTexel = outFrame * texRes.xyxy;"," vec2 frameMin = frameTexel.xy + vec2(0.5, 0.5);"," vec2 frameMax = frameTexel.xy + frameTexel.zw - vec2(0.5, 0.5);"," return clamp(texCoord, frameMin / texRes, frameMax / texRes);","}"].join("\n")},10235(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform float amount;","varying vec2 outTexCoord;","#pragma phaserTemplate(fragmentHeader)","vec2 Distort(vec2 p)","{"," float theta = atan(p.y, p.x);"," float radius = length(p);"," radius = pow(radius, amount);"," p.x = radius * cos(theta);"," p.y = radius * sin(theta);"," return 0.5 * (p + 1.0);","}","void main()","{"," vec2 xy = 2.0 * outTexCoord - 1.0;"," vec2 texCoord = outTexCoord;"," if (length(xy) < 1.0)"," {"," texCoord = Distort(xy);"," }"," gl_FragColor = boundedSampler(uMainSampler, texCoord);","}"].join("\n")},65980(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uMainSampler2;","uniform float amount;","uniform vec4 color;","varying vec2 outTexCoord;","vec4 NORMAL (vec4 base, vec4 blend)","{"," return blend + base * (1.0 - blend.a);","}","vec4 ADD (vec4 base, vec4 blend)","{"," return base + blend;","}","vec4 MULTIPLY (vec4 base, vec4 blend)","{"," return base * blend;","}","vec4 SCREEN (vec4 base, vec4 blend)","{"," return 1.0 - (1.0 - base) * (1.0 - blend);","}","float overlayChannel (float base, float blend)","{"," return base < 0.5 ? 2.0 * base * blend : 1.0 - 2.0 * (1.0 - base) * (1.0 - blend);","}","vec4 OVERLAY (vec4 base, vec4 blend)","{"," return vec4("," overlayChannel(base.r, blend.r),"," overlayChannel(base.g, blend.g),"," overlayChannel(base.b, blend.b),"," overlayChannel(base.a, blend.a)"," );","}","vec4 DARKEN (vec4 base, vec4 blend)","{"," return min(base, blend);","}","vec4 LIGHTEN (vec4 base, vec4 blend)","{"," return max(base, blend);","}","float dodgeChannel (float base, float blend)","{"," return blend == 1.0 ? blend : min(1.0, base / (1.0 - blend));","}","vec4 COLOR_DODGE (vec4 base, vec4 blend)","{"," return vec4("," dodgeChannel(base.r, blend.r),"," dodgeChannel(base.g, blend.g),"," dodgeChannel(base.b, blend.b),"," dodgeChannel(base.a, blend.a)"," );","}","float burnChannel (float base, float blend)","{"," return blend == 0.0 ? blend : 1.0 - min(1.0, (1.0 - base) / blend);","}","vec4 COLOR_BURN (vec4 base, vec4 blend)","{"," return vec4("," burnChannel(base.r, blend.r),"," burnChannel(base.g, blend.g),"," burnChannel(base.b, blend.b),"," burnChannel(base.a, blend.a)"," );","}","float hardLightChannel (float base, float blend)","{"," return blend < 0.5 ? 2.0 * base * blend : 1.0 - 2.0 * (1.0 - base) * (1.0 - blend);","}","vec4 HARD_LIGHT (vec4 base, vec4 blend)","{"," return vec4("," hardLightChannel(base.r, blend.r),"," hardLightChannel(base.g, blend.g),"," hardLightChannel(base.b, blend.b),"," hardLightChannel(base.a, blend.a)"," );","}","float softLightChannel (float base, float blend)","{"," return blend < 0.5 ? (2.0 * base * blend + base * base * (1.0 - 2.0 * blend)) : (sqrt(base) * (2.0 * blend - 1.0) + 2.0 * base * (1.0 - blend));","}","vec4 SOFT_LIGHT (vec4 base, vec4 blend)","{"," return vec4("," softLightChannel(base.r, blend.r),"," softLightChannel(base.g, blend.g),"," softLightChannel(base.b, blend.b),"," softLightChannel(base.a, blend.a)"," );","}","vec4 DIFFERENCE (vec4 base, vec4 blend)","{"," return abs(base - blend);","}","vec4 EXCLUSION (vec4 base, vec4 blend)","{"," return base + blend - 2.0 * base * blend;","}","vec3 rgbToHsl (vec3 color)","{"," vec3 hsl = vec3(0.0);"," float fmin = min(min(color.r, color.g), color.b);"," float fmax = max(max(color.r, color.g), color.b);"," float delta = fmax - fmin;"," hsl.z = (fmax + fmin) / 2.0;"," if (delta == 0.0)"," {"," hsl.x = 0.0;"," hsl.y = 0.0;"," }"," else"," {"," if (hsl.z < 0.5)"," {"," hsl.y = delta / (fmax + fmin);"," }"," else"," {"," hsl.y = delta / (2.0 - fmax - fmin);"," }"," float deltaR = (((fmax - color.r) / 6.0) + (delta / 2.0)) / delta;"," float deltaG = (((fmax - color.g) / 6.0) + (delta / 2.0)) / delta;"," float deltaB = (((fmax - color.b) / 6.0) + (delta / 2.0)) / delta;"," if (color.r == fmax)"," {"," hsl.x = deltaB - deltaG;"," }"," else if (color.g == fmax)"," {"," hsl.x = (1.0 / 3.0) + deltaR - deltaB;"," }"," else if (color.b == fmax)"," {"," hsl.x = (2.0 / 3.0) + deltaG - deltaR;"," }"," if (hsl.x < 0.0)"," {"," hsl.x += 1.0;"," }"," else if (hsl.x > 1.0)"," {"," hsl.x -= 1.0;"," }"," }"," return hsl;","}","vec3 hslToRgb (vec3 hsl)","{"," float p = hsl.z * (1.0 - hsl.y);"," float q = hsl.z * (1.0 - hsl.y * hsl.x);"," float t = hsl.z * (1.0 - hsl.y * (1.0 - hsl.x));"," if (hsl.x < 1.0 / 6.0)"," {"," return vec3(hsl.z, t, p);"," }"," else if (hsl.x < 0.5)"," {"," return vec3(q, hsl.z, p);"," }"," else if (hsl.x < 2.0 / 3.0)"," {"," return vec3(p, hsl.z, t);"," }"," return vec3(p, q, hsl.z);","}","vec4 HUE (vec4 base, vec4 blend)","{"," vec3 baseHSL = rgbToHsl(base.rgb);"," vec3 blendHSL = rgbToHsl(blend.rgb);"," return vec4(hslToRgb(vec3(blendHSL.x, baseHSL.y, baseHSL.z)), base.a);","}","vec4 SATURATION (vec4 base, vec4 blend)","{"," vec3 baseHSL = rgbToHsl(base.rgb);"," vec3 blendHSL = rgbToHsl(blend.rgb);"," return vec4(hslToRgb(vec3(baseHSL.x, blendHSL.y, baseHSL.z)), base.a);","}","vec4 COLOR (vec4 base, vec4 blend)","{"," vec3 baseHSL = rgbToHsl(base.rgb);"," vec3 blendHSL = rgbToHsl(blend.rgb);"," return vec4(hslToRgb(vec3(blendHSL.x, blendHSL.y, baseHSL.z)), base.a);","}","vec4 LUMINOSITY (vec4 base, vec4 blend)","{"," vec3 baseHSL = rgbToHsl(base.rgb);"," vec3 blendHSL = rgbToHsl(blend.rgb);"," return vec4(hslToRgb(vec3(baseHSL.x, baseHSL.y, blendHSL.z)), base.a);","}","vec4 ERASE (vec4 base, vec4 blend)","{"," return base * (1.0 - blend.a);","}","vec4 SOURCE_IN (vec4 base, vec4 blend)","{"," return blend * base.a;","}","vec4 SOURCE_OUT (vec4 base, vec4 blend)","{"," return blend * (1.0 - base.a);","}","vec4 SOURCE_ATOP (vec4 base, vec4 blend)","{"," return base * (1.0 - blend.a) + blend * base.a;","}","vec4 DESTINATION_OVER (vec4 base, vec4 blend)","{"," return base + blend * (1.0 - base.a);","}","vec4 DESTINATION_IN (vec4 base, vec4 blend)","{"," return base * blend.a;","}","vec4 DESTINATION_OUT (vec4 base, vec4 blend)","{"," return base * (1.0 - blend.a);","}","vec4 DESTINATION_ATOP (vec4 base, vec4 blend)","{"," return base * blend.a + blend * (1.0 - base.a);","}","vec4 LIGHTER (vec4 base, vec4 blend)","{"," return ADD(base, blend);","}","vec4 COPY (vec4 base, vec4 blend)","{"," return blend;","}","vec4 XOR (vec4 base, vec4 blend)","{"," return base * (1.0 - blend.a) + blend * (1.0 - base.a);","}","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec4 base = boundedSampler(uMainSampler, outTexCoord);"," vec4 blend = boundedSampler(uMainSampler2, outTexCoord) * color;"," vec4 blended = BLEND(base, blend);"," gl_FragColor = mix(base, blended, amount);","}"].join("\n")},5899(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec4 uSizeAndOffset;","varying vec2 outTexCoord;","void main()","{"," vec2 gridCell = floor((outTexCoord * resolution + uSizeAndOffset.zw) / uSizeAndOffset.xy) * uSizeAndOffset.xy - uSizeAndOffset.zw;"," vec2 texCoord = gridCell / resolution;"," gl_FragColor = texture2D(uMainSampler, texCoord);","}"].join("\n")},20784(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec2 offset;","uniform float strength;","uniform vec3 color;","varying vec2 outTexCoord;","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec2 uv = outTexCoord;"," vec4 col = vec4(0.0);"," vec2 off1 = vec2(1.411764705882353) * offset * strength;"," vec2 off2 = vec2(3.2941176470588234) * offset * strength;"," vec2 off3 = vec2(5.176470588235294) * offset * strength;"," col += boundedSampler(uMainSampler, uv) * 0.1964825501511404;"," col += boundedSampler(uMainSampler, uv + (off1 / resolution)) * 0.2969069646728344;"," col += boundedSampler(uMainSampler, uv - (off1 / resolution)) * 0.2969069646728344;"," col += boundedSampler(uMainSampler, uv + (off2 / resolution)) * 0.09447039785044732;"," col += boundedSampler(uMainSampler, uv - (off2 / resolution)) * 0.09447039785044732;"," col += boundedSampler(uMainSampler, uv + (off3 / resolution)) * 0.010381362401148057;"," col += boundedSampler(uMainSampler, uv - (off3 / resolution)) * 0.010381362401148057;"," gl_FragColor = col * vec4(color, 1.0);","}"].join("\n")},65122(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec2 offset;","uniform float strength;","uniform vec3 color;","varying vec2 outTexCoord;","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec2 uv = outTexCoord;"," vec4 col = vec4(0.0);"," vec2 offset = vec2(1.333) * offset * strength;"," col += boundedSampler(uMainSampler, uv) * 0.29411764705882354;"," col += boundedSampler(uMainSampler, uv + (offset / resolution)) * 0.35294117647058826;"," col += boundedSampler(uMainSampler, uv - (offset / resolution)) * 0.35294117647058826;"," gl_FragColor = col * vec4(color, 1.0);","}"].join("\n")},60942(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec2 offset;","uniform float strength;","uniform vec3 color;","varying vec2 outTexCoord;","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec2 uv = outTexCoord;"," vec4 col = vec4(0.0);"," vec2 off1 = vec2(1.3846153846) * offset * strength;"," vec2 off2 = vec2(3.2307692308) * offset * strength;"," col += boundedSampler(uMainSampler, uv) * 0.2270270270;"," col += boundedSampler(uMainSampler, uv + (off1 / resolution)) * 0.3162162162;"," col += boundedSampler(uMainSampler, uv - (off1 / resolution)) * 0.3162162162;"," col += boundedSampler(uMainSampler, uv + (off2 / resolution)) * 0.0702702703;"," col += boundedSampler(uMainSampler, uv - (off2 / resolution)) * 0.0702702703;"," gl_FragColor = col * vec4(color, 1.0);","}"].join("\n")},43722(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","#define ITERATIONS 100.0","#define ONEOVER_ITR 1.0 / ITERATIONS","#define PI 3.141596","#define GOLDEN_ANGLE 2.39996323","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform float radius;","uniform float amount;","uniform float contrast;","uniform bool isTiltShift;","uniform float strength;","uniform vec2 blur;","varying vec2 outTexCoord;","vec2 Sample (in float theta, inout float r)","{"," r += 1.0 / r;"," return (r - 1.0) * vec2(cos(theta), sin(theta)) * 0.06;","}","#pragma phaserTemplate(fragmentHeader)","vec3 Bokeh (sampler2D tex, vec2 uv, float radius)","{"," vec3 acc = vec3(0.0);"," vec3 div = vec3(0.0);"," vec2 pixel = vec2(resolution.y / resolution.x, 1.0) * radius * .025;"," float r = 1.0;"," for (float j = 0.0; j < GOLDEN_ANGLE * ITERATIONS; j += GOLDEN_ANGLE)"," {"," vec3 col = boundedSampler(tex, uv + pixel * Sample(j, r)).xyz;"," col = contrast > 0.0 ? col * col * (1.0 + contrast) : col;"," vec3 bokeh = vec3(0.5) + pow(col, vec3(10.0)) * amount;"," acc += col * bokeh;"," div += bokeh;"," }"," return acc / div;","}","void main ()","{"," float shift = 1.0;"," if (isTiltShift)"," {"," vec2 uv = vec2(gl_FragCoord.xy / resolution + vec2(-0.5, -0.5)) * 2.0;"," float centerStrength = 1.0;"," shift = length(uv * blur * strength) * centerStrength;"," }"," gl_FragColor = vec4(Bokeh(uMainSampler, outTexCoord * vec2(1.0, 1.0), radius * shift), 0.0);","}"].join("\n")},19883(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform float uColorMatrix[20];","uniform float uAlpha;","varying vec2 outTexCoord;","void main ()","{"," vec4 c = texture2D(uMainSampler, outTexCoord);"," if (uAlpha == 0.0)"," {"," gl_FragColor = c;"," return;"," }"," if (c.a > 0.0)"," {"," c.rgb /= c.a;"," }"," vec4 result;"," result.r = (uColorMatrix[0] * c.r) + (uColorMatrix[1] * c.g) + (uColorMatrix[2] * c.b) + (uColorMatrix[3] * c.a) + uColorMatrix[4];"," result.g = (uColorMatrix[5] * c.r) + (uColorMatrix[6] * c.g) + (uColorMatrix[7] * c.b) + (uColorMatrix[8] * c.a) + uColorMatrix[9];"," result.b = (uColorMatrix[10] * c.r) + (uColorMatrix[11] * c.g) + (uColorMatrix[12] * c.b) + (uColorMatrix[13] * c.a) + uColorMatrix[14];"," result.a = (uColorMatrix[15] * c.r) + (uColorMatrix[16] * c.g) + (uColorMatrix[17] * c.b) + (uColorMatrix[18] * c.a) + uColorMatrix[19];"," vec3 rgb = mix(c.rgb, result.rgb, uAlpha);"," rgb *= result.a;"," gl_FragColor = vec4(rgb, result.a);","}"].join("\n")},32624(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uTransferSampler;","uniform float uColorMatrixSelf[20];","uniform float uColorMatrixTransfer[20];","uniform float uAlphaSelf;","uniform float uAlphaTransfer;","uniform vec4 uAdditions;","uniform vec4 uMultiplications;","varying vec2 outTexCoord;","#define S uColorMatrixSelf","#define T uColorMatrixTransfer","void main ()","{"," vec4 self = texture2D(uMainSampler, outTexCoord);"," if (uAlphaSelf == 0.0)"," {"," gl_FragColor = self;"," return;"," }"," if (self.a > 0.0)"," {"," self.rgb /= self.a;"," }"," vec4 resultSelf;"," resultSelf.r = (S[0] * self.r) + (S[1] * self.g) + (S[2] * self.b) + (S[3] * self.a) + S[4];"," resultSelf.g = (S[5] * self.r) + (S[6] * self.g) + (S[7] * self.b) + (S[8] * self.a) + S[9];"," resultSelf.b = (S[10] * self.r) + (S[11] * self.g) + (S[12] * self.b) + (S[13] * self.a) + S[14];"," resultSelf.a = (S[15] * self.r) + (S[16] * self.g) + (S[17] * self.b) + (S[18] * self.a) + S[19];"," if (uAlphaTransfer == 0.0)"," {"," self.rgb *= self.a;"," resultSelf.rgb *= resultSelf.a;"," gl_FragColor = mix(self, resultSelf, uAlphaSelf);"," return;"," }"," vec4 tex = texture2D(uTransferSampler, outTexCoord);"," if (tex.a > 0.0)"," {"," tex.rgb /= tex.a;"," }"," vec4 resultTransfer;"," resultTransfer.r = (T[0] * tex.r) + (T[1] * tex.g) + (T[2] * tex.b) + (T[3] * tex.a) + T[4];"," resultTransfer.g = (T[5] * tex.r) + (T[6] * tex.g) + (T[7] * tex.b) + (T[8] * tex.a) + T[9];"," resultTransfer.b = (T[10] * tex.r) + (T[11] * tex.g) + (T[12] * tex.b) + (T[13] * tex.a) + T[14];"," resultTransfer.a = (T[15] * tex.r) + (T[16] * tex.g) + (T[17] * tex.b) + (T[18] * tex.a) + T[19];"," vec4 combo = (resultSelf + resultTransfer) * uAdditions + (resultSelf * resultTransfer) * uMultiplications;"," self.rgb *= self.a;"," resultSelf.rgb *= resultSelf.a;"," combo.rgb *= combo.a;"," gl_FragColor = mix(self, mix(resultSelf, combo, uAlphaTransfer), uAlphaSelf);","}"].join("\n")},12886(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uDisplacementSampler;","uniform vec2 amount;","varying vec2 outTexCoord;","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec2 disp = (-vec2(0.5, 0.5) + texture2D(uDisplacementSampler, outTexCoord).rg) * amount;"," gl_FragColor = boundedSampler(uMainSampler, outTexCoord + disp).rgba;","}"].join("\n")},33016(t){t.exports=["#pragma phaserTemplate(shaderName)","#define DISTANCE 10.0","#define QUALITY 10.0","#pragma phaserTemplate(fragmentDefine)","precision mediump float;","uniform sampler2D uMainSampler;","varying vec2 outTexCoord;","uniform float outerStrength;","uniform float innerStrength;","uniform float scale;","uniform vec2 resolution;","uniform vec4 glowColor;","uniform bool knockout;","const float PI = 3.14159265358979323846264;","const float MAX_ALPHA = DISTANCE * (DISTANCE + 1.0) * QUALITY / 2.0;","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec2 px = vec2(1.0 / resolution.x, 1.0 / resolution.y) * scale;"," float totalAlpha = 0.0;"," float curAngle = 0.0;"," vec2 direction;"," vec2 displaced;"," vec4 color;"," for (float curDistance = 0.0; curDistance < DISTANCE; curDistance++)"," {"," curAngle += fract(sin(dot(vec2(curDistance, outTexCoord.x + outTexCoord.y), vec2(12.9898, 78.233))) * 43758.5453);"," for (float i = 0.0; i < QUALITY; i++)"," {"," curAngle += PI * 2.0 / (QUALITY);"," direction = vec2(cos(curAngle), sin(curAngle)) * px;"," displaced = outTexCoord + direction * (curDistance + 1.0);"," color = boundedSampler(uMainSampler, displaced);"," totalAlpha += (DISTANCE - curDistance) * color.a;"," }"," }"," color = boundedSampler(uMainSampler, outTexCoord);"," float alphaRatio = (totalAlpha / MAX_ALPHA);"," float innerGlowAlpha = (1.0 - alphaRatio) * innerStrength * color.a;"," float innerGlowStrength = min(1.0, innerGlowAlpha);"," vec4 innerColor = mix(color, glowColor, innerGlowStrength);"," float outerGlowAlpha = alphaRatio * outerStrength * (1.0 - color.a);"," float outerGlowStrength = min(1.0 - innerColor.a, outerGlowAlpha);"," if (knockout)"," {"," float resultAlpha = outerGlowStrength + innerGlowStrength;"," gl_FragColor = vec4(glowColor.rgb * resultAlpha, resultAlpha);"," }"," else"," {"," vec4 outerGlowColor = outerGlowStrength * glowColor.rgba;"," gl_FragColor = innerColor + outerGlowColor;"," }","}"].join("\n")},33179(t){t.exports=["#pragma phaserTemplate(shaderName)","precision highp float;","#pragma phaserTemplate(fragmentHeader)","uniform sampler2D uMainSampler;","uniform vec4 uColor;","uniform vec4 uColorFactor;","uniform bool uUnpremultiply;","uniform float uAlpha;","varying vec2 outTexCoord;","void main ()","{"," vec4 sample = texture2D(uMainSampler, outTexCoord);"," if (uUnpremultiply)"," {"," sample.rgb /= sample.a;"," }"," vec4 modulatedSample = sample * uColorFactor + uColor;"," float progress = modulatedSample.r + modulatedSample.g + modulatedSample.b + modulatedSample.a;"," vec4 rampColor = getRampAt(progress);"," rampColor.rgb *= rampColor.a;"," gl_FragColor = mix(sample, rampColor * sample.a, uAlpha);","}"].join("\n")},94526(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uEnvSampler;","uniform sampler2D uNormSampler;","uniform mat4 uViewMatrix;","uniform float uModelRotation;","uniform float uBulge;","uniform vec3 uColorFactor;","varying vec2 outTexCoord;","#define PI 3.14159265358979323846","void main()","{"," vec4 color = texture2D(uMainSampler, outTexCoord);"," vec3 normal = texture2D(uNormSampler, outTexCoord).rgb;"," vec3 normalN = normal * 2.0 - 1.0;"," float normalXYLength = length(normalN.xy);"," float angle = atan("," normalN.y,"," normalN.x"," ) - uModelRotation;"," normalN = vec3("," normalXYLength * cos(angle),"," normalXYLength * sin(angle),"," normalN.z"," );"," normalN = reflect(vec3(0.0, 0.0, -1.0), normalN);"," normalN = (uViewMatrix * vec4(normalN, 1.0)).xyz;"," float envX = atan(normalN.x, normalN.z) / PI;"," float envY = sin(normalN.y * PI / 2.0);"," vec2 uv = vec2(envX, envY) * 0.5 + 0.5;"," vec2 rotatedTexCoord = vec2("," cos(-uModelRotation) * outTexCoord.x - sin(-uModelRotation) * outTexCoord.y,"," sin(-uModelRotation) * outTexCoord.x + cos(- uModelRotation) * outTexCoord.y"," );"," uv += uBulge * (rotatedTexCoord - 0.5);"," if (uv.y < 0.0)"," {"," uv.y = abs(uv.y);"," uv.x += 0.5;"," }"," else if (uv.y > 1.0)"," {"," uv.y = 2.0 - uv.y;"," uv.x += 0.5;"," }"," vec3 environment = texture2D(uEnvSampler, uv).rgb;"," gl_FragColor = vec4(environment * color.rgb * uColorFactor, color.a);","}"].join("\n")},4488(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec4 uColor;","uniform vec4 uIsolateThresholdFeather;","varying vec2 outTexCoord;","void main()","{"," vec4 color = texture2D(uMainSampler, outTexCoord);"," vec3 unpremultipliedColor = color.rgb / color.a;"," float isolate = uIsolateThresholdFeather.x;"," float threshold = uIsolateThresholdFeather.y;"," float feather = uIsolateThresholdFeather.z;"," float match = distance(unpremultipliedColor, uColor.rgb);"," match = clamp(match - threshold, 0.0, 1.0);"," match = clamp(match / feather, 0.0, 1.0);"," if (isolate == 1.0)"," {"," match = 1.0 - match;"," }"," match = mix(1.0, match, uColor.a);"," gl_FragColor = color * match;","}"].join("\n")},39603(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uMaskSampler;","uniform bool invert;","varying vec2 outTexCoord;","void main ()","{"," vec4 color = texture2D(uMainSampler, outTexCoord);"," vec4 mask = texture2D(uMaskSampler, outTexCoord);"," float a = mask.a;"," color *= invert ? (1.0 - a) : a;"," gl_FragColor = color;","}"].join("\n")},60047(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","#pragma phaserTemplate(fragmentHeader)","uniform sampler2D uMainSampler;","uniform mat4 uViewMatrix;","#ifdef FACING_POWER","uniform float uFacingPower;","#endif","#ifdef OUTPUT_RATIO","uniform vec3 uRatioVector;","uniform float uRatioRadius;","#endif","varying vec2 outTexCoord;","void main()","{"," vec3 normal = texture2D(uMainSampler, outTexCoord).rgb * 2.0 - 1.0;"," normal = (uViewMatrix * vec4(normal, 1.0)).xyz;"," #ifdef FACING_POWER"," normal = normalize(normal * vec3(1.0, 1.0, uFacingPower));"," #endif"," #ifdef OUTPUT_RATIO"," float ratio = dot(normal, normalize(uRatioVector));"," ratio = (ratio - 1.0 + uRatioRadius) / uRatioRadius;"," if (ratio <= 0.0)"," {"," ratio = 0.0;"," }"," normal = vec3(ratio * 2.0 - 1.0);"," #endif"," gl_FragColor = vec4((normal + 1.0) * 0.5, 1.0);","}"].join("\n")},7529(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform float uRadius;","uniform float uPower;","varying vec2 outTexCoord;","#define PI 3.14159265358979323846","#pragma phaserTemplate(fragmentHeader)","#define STEP_X 1.0 / SAMPLES_X","#define STEP_Y 1.0 / SAMPLES_Y","vec3 uvPanoramaNormal(vec2 uv)","{"," float y = uv.y * 2.0 - 1.0;"," float angle = (uv.x * 2.0 - 1.0) * PI;"," float x = sin(angle);"," float z = cos(angle);"," vec2 xz = vec2(x, z);"," xz *= sqrt(1.0 - y * y);"," return normalize(vec3(xz.x, y, xz.y));","}","void main()","{"," vec3 acc = vec3(0.0);"," float div = 0.0;"," vec3 texelNormal = uvPanoramaNormal(outTexCoord);"," for (float y = STEP_Y / 2.0; y < 1.0; y += STEP_Y)"," {"," float yWeight = cos((y * 2.0 - 1.0) * PI / 2.0);"," for (float x = STEP_X / 2.0; x < 1.0; x += STEP_X)"," {"," vec2 uv = vec2(x, y);"," vec3 sampleNormal = uvPanoramaNormal(uv);"," float dotProduct = dot(sampleNormal, texelNormal);"," dotProduct = (dotProduct - 1.0 + uRadius) / uRadius;"," if (dotProduct <= 0.0)"," {"," continue;"," }"," vec3 color = texture2D(uMainSampler, uv).rgb;"," color *= pow(length(color), uPower);"," acc += color * dotProduct * yWeight;"," div += dotProduct * yWeight;"," }"," }"," gl_FragColor = vec4(acc / div, 1.0);","}"].join("\n")},99191(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform float amount;","varying vec2 outTexCoord;","void main ()","{"," float pixelSize = floor(2.0 + amount);"," vec2 center = pixelSize * floor(outTexCoord * resolution / pixelSize) + pixelSize * vec2(0.5, 0.5);"," vec2 corner1 = center + pixelSize * vec2(-0.5, -0.5);"," vec2 corner2 = center + pixelSize * vec2(+0.5, -0.5);"," vec2 corner3 = center + pixelSize * vec2(+0.5, +0.5);"," vec2 corner4 = center + pixelSize * vec2(-0.5, +0.5);"," vec4 pixel = 0.4 * texture2D(uMainSampler, center / resolution);"," pixel += 0.15 * texture2D(uMainSampler, corner1 / resolution);"," pixel += 0.15 * texture2D(uMainSampler, corner2 / resolution);"," pixel += 0.15 * texture2D(uMainSampler, corner3 / resolution);"," pixel += 0.15 * texture2D(uMainSampler, corner4 / resolution);"," gl_FragColor = pixel;","}"].join("\n")},88430(t){t.exports=["#pragma phaserTemplate(shaderName)","precision highp float;","uniform sampler2D uMainSampler;","uniform vec4 uSteps;","uniform vec4 uGamma;","uniform vec4 uOffset;","uniform int uMode;","uniform bool uDither;","varying vec2 outTexCoord;","vec4 rgbaToHsva(vec4 rgba)","{"," float r = rgba.r;"," float g = rgba.g;"," float b = rgba.b;"," float a = rgba.a;"," float min = min(min(r, g), b);"," float max = max(max(r, g), b);"," float d = max - min;"," float h = 0.0;"," float s = (max == 0.0) ? 0.0 : d / max;"," float v = max;"," if (max != min)"," {"," if (max == r)"," {"," h = (g - b) / d + ((g < b) ? 6.0 : 0.0);"," }"," else if (max == g)"," {"," h = (b - r) / d + 2.0;"," }"," else"," {"," h = (r - g) / d + 4.0;"," }"," h /= 6.0;"," }"," return vec4(h, s, v, a);","}","float hsvaToRgbaConvert(float n, vec4 hsva)","{"," float k = mod(n + hsva.x * 6.0, 6.0);"," float min = min(min(k, 4.0 - k), 1.0);"," return hsva.z - hsva.z * hsva.y * max(0.0, min);","}","vec4 hsvaToRgba(vec4 hsva)","{"," return vec4("," hsvaToRgbaConvert(5.0, hsva),"," hsvaToRgbaConvert(3.0, hsva),"," hsvaToRgbaConvert(1.0, hsva),"," hsva.a"," );","}","vec4 ditherIGN(vec4 value)","{"," value += fract(52.9829189 * fract(0.06711056 * gl_FragCoord.x + 0.00583715 * gl_FragCoord.y)) - 0.5;"," return value;","}","void main ()","{"," vec4 sample = texture2D(uMainSampler, outTexCoord);"," if (uMode == 1)"," {"," sample = rgbaToHsva(sample);"," }"," sample = pow(sample, uGamma);"," sample -= uOffset;"," vec4 steps = max(uSteps - 1.0, 1.0);"," sample *= steps;"," if (uDither)"," {"," sample = ditherIGN(sample);"," }"," sample = ceil(sample - 0.5);"," sample /= steps;"," sample += uOffset;"," sample = pow(sample, 1.0 / uGamma);"," if (uMode == 1)"," {"," sample.x = mod(sample.x, 1.0);"," sample = hsvaToRgba(clamp(sample, 0.0, 1.0));"," }"," gl_FragColor = sample;","}"].join("\n")},69355(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","varying vec2 outTexCoord;","uniform vec2 lightPosition;","uniform vec4 color;","uniform float decay;","uniform float power;","uniform float intensity;","uniform int samples;","const int MAX = 12;","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec4 texture = boundedSampler(uMainSampler, outTexCoord);"," vec2 pc = (lightPosition - outTexCoord) * intensity;"," float shadow = 0.0;"," float limit = max(float(MAX), float(samples));"," for (int i = 0; i < MAX; ++i)"," {"," if (i >= samples)"," {"," break;"," }"," shadow += boundedSampler(uMainSampler, outTexCoord + float(i) * decay / limit * pc).a * power;"," }"," float mask = 1.0 - texture.a;"," gl_FragColor = mix(texture, color, clamp(shadow * mask, 0.0, 1.0));","}"].join("\n")},92636(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec4 edge1;","uniform vec4 edge2;","uniform vec4 invert;","varying vec2 outTexCoord;","void main ()","{"," vec4 color = texture2D(uMainSampler, outTexCoord);"," color = clamp((color - edge1) / (edge2 - edge1), 0.0, 1.0);"," color = mix(color, 1.0 - color, invert);"," gl_FragColor = color;","}"].join("\n")},18185(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform float uRadius;","uniform float uStrength;","uniform vec2 uPosition;","uniform vec4 uColor;","uniform int uBlendMode;","varying vec2 outTexCoord;","void main ()","{"," float vignette = 1.0;"," vec2 position = vec2(uPosition.x, 1.0 - uPosition.y);"," float d = length(outTexCoord - position);"," if (d <= uRadius)"," {"," float g = d / uRadius;"," vignette = sin(g * 3.14 * uStrength);"," }"," vec4 color = uColor;"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," if (uBlendMode == 1)"," {"," color.rgb = texture.rgb + color.rgb;"," }"," else if (uBlendMode == 2)"," {"," color.rgb = texture.rgb * color.rgb;"," }"," else if (uBlendMode == 3)"," {"," color.rgb = 1.0 - ((1.0 - texture.rgb) * (1.0 - color.rgb));"," }"," gl_FragColor = mix(texture, color, vignette);","}"].join("\n")},99174(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uMainSampler2;","uniform vec4 uProgress_WipeWidth_Direction_Axis;","uniform float uReveal;","varying vec2 outTexCoord;","void main ()","{"," vec4 color0;"," vec4 color1;"," if (uReveal == 0.0)"," {"," color0 = texture2D(uMainSampler, outTexCoord);"," color1 = texture2D(uMainSampler2, outTexCoord);"," }"," else"," {"," color0 = texture2D(uMainSampler2, outTexCoord);"," color1 = texture2D(uMainSampler, outTexCoord);"," }"," float distance = uProgress_WipeWidth_Direction_Axis.x;"," float width = uProgress_WipeWidth_Direction_Axis.y;"," float direction = uProgress_WipeWidth_Direction_Axis.z;"," float axis = outTexCoord.x;"," if (uProgress_WipeWidth_Direction_Axis.w == 1.0)"," {"," axis = outTexCoord.y;"," }"," float adjust = mix(width, -width, distance);"," float value = smoothstep(distance - width, distance + width, abs(direction - axis) + adjust);"," gl_FragColor = mix(color1, color0, value);","}"].join("\n")},73416(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(fragmentDefine)","uniform vec2 uResolution;","varying vec4 outTint;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec4 fragColor = outTint;"," #pragma phaserTemplate(fragmentProcess)"," gl_FragColor = fragColor;","}"].join("\n")},91627(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(vertexDefine)","uniform mat4 uProjectionMatrix;","uniform vec2 uResolution;","attribute vec2 inPosition;","attribute vec4 inTint;","varying vec4 outTint;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(vertexHeader)","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);"," outTint = vec4(inTint.bgr * inTint.a, inTint.a);"," #pragma phaserTemplate(vertexProcess)","}"].join("\n")},84220(t){t.exports=["vec3 getNormalFromMap (vec2 texCoord)","{"," vec3 normalMap = texture2D(uNormSampler, texCoord).rgb;"," return normalize(outInverseRotationMatrix * vec3(normalMap * 2.0 - 1.0));","}"].join("\n")},2860(t){t.exports=["uniform vec2 uMainResolution[TEXTURE_COUNT];","vec2 getTexRes ()","{"," #if TEXTURE_COUNT == 1"," float texId = 0.0;"," #else"," float texId = outTexDatum;"," #endif"," #pragma phaserTemplate(texIdProcess)"," vec2 texRes = vec2(0.0);"," for (int i = 0; i < TEXTURE_COUNT; i++)"," {"," if (texId == float(i))"," {"," texRes = uMainResolution[i];"," break;"," }"," }"," return texRes;","}"].join("\n")},46432(t){t.exports=["uniform sampler2D uMainSampler[TEXTURE_COUNT];","vec4 getTexture (vec2 texCoord)","{"," #if TEXTURE_COUNT == 1"," return texture2D(uMainSampler[0], texCoord);"," #else"," if (outTexDatum == 0.0) return texture2D(uMainSampler[0], texCoord);"," #define ELSE_TEX_CASE(INDEX) else if (outTexDatum == float(INDEX)) return texture2D(uMainSampler[INDEX], texCoord);"," #pragma phaserTemplate(texIdProcess)"," else return vec4(0.0, 0.0, 0.0, 0.0);"," #endif","}"].join("\n")},41509(t){t.exports=["#pragma phaserTemplate(shaderName)","precision highp float;","#pragma phaserTemplate(fragmentHeader)","#define PI 3.14159265358979323846","uniform int uRepeatMode;","uniform float uOffset;","uniform int uShapeMode;","uniform vec2 uShape;","uniform vec2 uStart;","varying vec2 outTexCoord;","float linear()","{"," float len = length(uShape);"," return dot(uShape, outTexCoord - uStart) / len / len;","}","float bilinear()","{"," return abs(linear());","}","float radial()","{"," return distance(uStart, outTexCoord) / length(uShape);","}","float conicSymmetric()","{"," return dot(normalize(uShape), normalize(outTexCoord - uStart)) * 0.5 + 0.5;","}","float conicAsymmetric()","{"," vec2 fromStart = outTexCoord - uStart;"," float angleFromStart = atan(fromStart.y, fromStart.x);"," float shapeAngle = atan(uShape.y, uShape.x);"," float angle = (angleFromStart - shapeAngle) / PI / 2.0;"," if (angle < 0.0) angle += 1.0;"," return angle;","}","float repeat(float value)","{"," if (uRepeatMode == 1)"," {"," if (value < 0.0 || value > 1.0)"," {"," discard;"," }"," return value;"," }"," else if (uRepeatMode == 2)"," {"," return mod(value, 1.0);"," }"," else if (uRepeatMode == 3)"," {"," return 1.0 - abs(1.0 - mod(value, 2.0));"," }"," return clamp(value, 0.0, 1.0);","}","void main()","{"," float progress = 0.0;"," if (uShapeMode == 0)"," {"," progress = linear();"," }"," else if (uShapeMode == 1)"," {"," progress = bilinear();"," }"," else if (uShapeMode == 2)"," {"," progress = radial();"," }"," else if (uShapeMode == 3)"," {"," progress = conicSymmetric();"," }"," else if (uShapeMode == 4)"," {"," progress = conicAsymmetric();"," }"," progress -= uOffset;"," progress = repeat(progress);"," vec4 bandCol = getRampAt(progress);"," bandCol.rgb *= bandCol.a;"," gl_FragColor = bandCol;","}"].join("\n")},98840(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(fragmentDefine)","uniform vec2 uResolution;","varying vec2 outTexCoord;","varying float outTexDatum;","varying float outTintEffect;","varying vec4 outTint;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," #pragma phaserTemplate(fragmentProcess)"," gl_FragColor = fragColor;","}"].join("\n")},44667(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(vertexDefine)","uniform mat4 uProjectionMatrix;","uniform vec2 uResolution;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","attribute float inTexDatum;","attribute float inTintEffect;","attribute vec4 inTint;","varying vec2 outTexCoord;","varying float outTexDatum;","varying float outTintEffect;","varying vec4 outTint;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(vertexHeader)","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);"," outTexCoord = inTexCoord;"," outTexDatum = inTexDatum;"," outTint = inTint;"," outTintEffect = inTintEffect;"," #pragma phaserTemplate(vertexProcess)","}"].join("\n")},16421(t){t.exports=["#version 100","#pragma phaserTemplate(shaderName)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform vec2 uOffset;","uniform vec4 uColorStart;","uniform vec4 uColorEnd;","uniform float uPower;","uniform int uMode;","varying vec2 outTexCoord;","float trig(vec2 p)","{"," return fract(43757.5453*sin(dot(p, vec2(12.9898,78.233))));","}","void main ()","{"," float value = pow(trig(outTexCoord + uOffset), uPower);"," if (uMode == 0)"," {"," vec4 color = mix(uColorStart, uColorEnd, value);"," color.rgb *= color.a;"," gl_FragColor = color;"," }"," else if (uMode == 1)"," {"," float valueR = pow(trig(outTexCoord + uOffset + 32.1), uPower);"," float valueG = pow(trig(outTexCoord + uOffset + 11.1), uPower);"," float valueB = pow(trig(outTexCoord + uOffset + 23.4), uPower);"," vec4 color = vec4(valueR, valueG, valueB, 1.);"," color *= mix(uColorStart, uColorEnd, value);"," color.rgb *= color.a;"," gl_FragColor = color;"," }"," else if (uMode == 2)"," {"," float valueAngle = pow(trig(outTexCoord + uOffset), uPower) * 3.141592;"," float x = value * cos(valueAngle);"," float y = value * sin(valueAngle);"," vec4 color = vec4("," x,"," y,"," sqrt(1. - x * x - y * y),"," 1.0"," );"," gl_FragColor = color * 0.5 + 0.5;"," }","}"].join("\n")},83587(t){t.exports=["#version 100","#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(fragmentIterations)","#pragma phaserTemplate(fragmentNormalMap)","#ifndef ITERATION_COUNT","#define ITERATION_COUNT 1.0","#endif","#ifndef WARP_ITERATION_COUNT","#define WARP_ITERATION_COUNT 1.0","#endif","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform vec2 uCells;","uniform vec2 uPeriod;","uniform vec2 uOffset;","uniform float uFlow;","uniform float uDetailPower;","uniform float uFlowPower;","uniform float uContributionPower;","uniform float uWarpDetailPower;","uniform float uWarpFlowPower;","uniform float uWarpContributionPower;","uniform float uWarpAmount;","uniform vec4 uColorStart;","uniform vec4 uColorEnd;","uniform float uNormalScale;","uniform float uValueFactor;","uniform float uValueAdd;","uniform float uValuePower;","uniform vec2 uSeed;","varying vec2 outTexCoord;","float psrdnoise(vec2 x, vec2 period, float alpha)","{"," vec2 uv = vec2(x.x+x.y*0.5, x.y);"," vec2 i0 = floor(uv), f0 = fract(uv);"," float cmp = step(f0.y, f0.x);"," vec2 o1 = vec2(cmp, 1.0-cmp);"," vec2 i1 = i0 + o1, i2 = i0 + 1.0;"," vec2 v0 = vec2(i0.x - i0.y*0.5, i0.y);"," vec2 v1 = vec2(v0.x + o1.x - o1.y*0.5, v0.y + o1.y);"," vec2 v2 = vec2(v0.x + 0.5, v0.y + 1.0);"," vec2 x0 = x - v0, x1 = x - v1, x2 = x - v2;"," vec3 iu, iv, xw, yw;"," if(any(greaterThan(period, vec2(0.0)))) {"," xw = vec3(v0.x, v1.x, v2.x); yw = vec3(v0.y, v1.y, v2.y);"," if(period.x > 0.0)"," xw = mod(vec3(v0.x, v1.x, v2.x), period.x);"," if(period.y > 0.0)"," yw = mod(vec3(v0.y, v1.y, v2.y), period.y);"," iu = floor(xw + 0.5*yw + 0.5); iv = floor(yw + 0.5);"," } else {"," iu = vec3(i0.x, i1.x, i2.x); iv = vec3(i0.y, i1.y, i2.y);"," }"," iu += uSeed.xxx; iv += uSeed.yyy;"," vec3 hash = mod(iu, 289.0);"," hash = mod((hash*51.0 + 2.0)*hash + iv, 289.0);"," hash = mod((hash*34.0 + 10.0)*hash, 289.0);"," vec3 psi = hash*0.07482 + alpha;"," vec3 gx = cos(psi); vec3 gy = sin(psi);"," vec2 g0 = vec2(gx.x, gy.x);"," vec2 g1 = vec2(gx.y, gy.y);"," vec2 g2 = vec2(gx.z, gy.z);"," vec3 w = 0.8 - vec3(dot(x0, x0), dot(x1, x1), dot(x2, x2));"," w = max(w, 0.0); vec3 w2 = w*w; vec3 w4 = w2*w2;"," vec3 gdotx = vec3(dot(g0, x0), dot(g1, x1), dot(g2, x2));"," float n = dot(w4, gdotx);"," return 10.9*n;","}","float iterate (vec2 coord, float detailPower, float flowPower, float contributionPower)","{"," float value = 0.;"," float itValue = 0.;"," for (float iteration = 0.; iteration < ITERATION_COUNT; iteration++)"," {"," float detailScale = pow(detailPower, iteration);"," float flowScale = pow(flowPower, iteration);"," itValue = psrdnoise((coord + iteration) * detailScale, uPeriod * detailScale, uFlow * flowScale + iteration);"," value += itValue / pow(contributionPower, iteration);"," }"," return value;","}","float iterateWarp (vec2 coord, float detailPower, float flowPower, float contributionPower)","{"," float value = 0.;"," float itValue = 0.;"," for (float iteration = 0.; iteration < WARP_ITERATION_COUNT; iteration++)"," {"," float detailScale = pow(detailPower, iteration);"," float flowScale = pow(flowPower, iteration);"," itValue = psrdnoise((coord + iteration) * detailScale, uPeriod * detailScale, uFlow * flowScale + iteration);"," value += itValue / pow(contributionPower, iteration);"," }"," return value;","}","vec2 warp (vec2 coord)","{"," vec2 o2 = vec2(11.3, 23.7);"," float coord1 = iterateWarp(coord, uWarpDetailPower, uWarpFlowPower, uWarpContributionPower);"," float coord2 = iterateWarp(coord + o2, uWarpDetailPower, uWarpFlowPower, uWarpContributionPower);"," return vec2(coord1, coord2);","}","void main ()","{"," vec2 coord = outTexCoord * uCells + uOffset;"," if (uWarpAmount > 0.)"," {"," coord += warp(coord) * uWarpAmount;"," }"," float value = iterate(coord, uDetailPower, uFlowPower, uContributionPower) * uValueFactor + uValueAdd;"," value = pow(clamp(value, 0., 1.), uValuePower);"," #ifndef NORMAL_MAP"," vec4 color = mix(uColorStart, uColorEnd, value);"," color.rgb *= color.a;"," gl_FragColor = color;"," #else"," float dx = dFdx(value) * uNormalScale;"," float dy = dFdy(value) * uNormalScale;"," vec3 normal = vec3(dx, dy, 1.0 - sqrt(dx * dx + dy * dy)) * 0.5 + 0.5;"," gl_FragColor = vec4(normal, 1.0);"," #endif","}"].join("\n")},13460(t){t.exports=["#version 100","#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(fragmentIterations)","#pragma phaserTemplate(fragmentNormalMap)","#ifndef ITERATION_COUNT","#define ITERATION_COUNT 1.0","#endif","#ifndef WARP_ITERATION_COUNT","#define WARP_ITERATION_COUNT 1.0","#endif","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform vec3 uCells;","uniform vec3 uPeriod;","uniform vec3 uOffset;","uniform float uFlow;","uniform float uDetailPower;","uniform float uFlowPower;","uniform float uContributionPower;","uniform float uWarpDetailPower;","uniform float uWarpFlowPower;","uniform float uWarpContributionPower;","uniform float uWarpAmount;","uniform vec4 uColorStart;","uniform vec4 uColorEnd;","uniform float uNormalScale;","uniform float uValueFactor;","uniform float uValueAdd;","uniform float uValuePower;","uniform vec3 uSeed;","varying vec2 outTexCoord;","vec4 permute(vec4 i) {"," vec4 im = mod(i, 289.0);"," return mod(((im * 34.0) + 10.0) * im, 289.0);","}","float psrdnoise(vec3 x, vec3 period, float alpha) {"," const mat3 M = mat3(0.0, 1.0, 1.0, 1.0, 0.0, 1.0, 1.0, 1.0, 0.0);"," const mat3 Mi = mat3(-0.5, 0.5, 0.5, 0.5, -0.5, 0.5, 0.5, 0.5, -0.5);"," vec3 uvw = M * x;"," vec3 i0 = floor(uvw);"," vec3 f0 = fract(uvw);"," vec3 g_ = step(f0.xyx, f0.yzz);"," vec3 l_ = 1.0 - g_;"," vec3 g = vec3(l_.z, g_.xy);"," vec3 l = vec3(l_.xy, g_.z);"," vec3 o1 = min(g, l);"," vec3 o2 = max(g, l);"," vec3 i1 = i0 + o1, i2 = i0 + o2, i3 = i0 + 1.0;"," vec3 v0 = Mi * i0, v1 = Mi * i1, v2 = Mi * i2, v3 = Mi * i3;"," vec3 x0 = x - v0, x1 = x - v1, x2 = x - v2, x3 = x - v3;"," if(any(greaterThan(period, vec3(0.0)))) {"," vec4 vx = vec4(v0.x, v1.x, v2.x, v3.x);"," vec4 vy = vec4(v0.y, v1.y, v2.y, v3.y);"," vec4 vz = vec4(v0.z, v1.z, v2.z, v3.z);"," if(period.x > 0.0)"," vx = mod(vx, period.x);"," if(period.y > 0.0)"," vy = mod(vy, period.y);"," if(period.z > 0.0)"," vz = mod(vz, period.z);"," i0 = floor(M * vec3(vx.x, vy.x, vz.x) + 0.5);"," i1 = floor(M * vec3(vx.y, vy.y, vz.y) + 0.5);"," i2 = floor(M * vec3(vx.z, vy.z, vz.z) + 0.5);"," i3 = floor(M * vec3(vx.w, vy.w, vz.w) + 0.5);"," }"," i0 += uSeed; i1 += uSeed; i2 += uSeed; i3 += uSeed;"," vec4 hash = permute(permute(permute(vec4(i0.z, i1.z, i2.z, i3.z)) + vec4(i0.y, i1.y, i2.y, i3.y)) + vec4(i0.x, i1.x, i2.x, i3.x));"," vec4 theta = hash * 3.883222077;"," vec4 sz = 0.996539792 - 0.006920415 * hash;"," vec4 psi = hash * 0.108705628;"," vec4 Ct = cos(theta);"," vec4 St = sin(theta);"," vec4 sz_prime = sqrt(1.0 - sz * sz);"," vec4 gx, gy, gz;"," if(alpha != 0.0) {"," vec4 px = Ct * sz_prime;"," vec4 py = St * sz_prime;"," vec4 pz = sz;"," vec4 Sp = sin(psi);"," vec4 Cp = cos(psi);"," vec4 Ctp = St * Sp - Ct * Cp;"," vec4 qx = mix(Ctp * St, Sp, sz);"," vec4 qy = mix(-Ctp * Ct, Cp, sz);"," vec4 qz = -(py * Cp + px * Sp);"," vec4 Sa = vec4(sin(alpha));"," vec4 Ca = vec4(cos(alpha));"," gx = Ca * px + Sa * qx;"," gy = Ca * py + Sa * qy;"," gz = Ca * pz + Sa * qz;"," } else {"," gx = Ct * sz_prime;"," gy = St * sz_prime;"," gz = sz;"," }"," vec3 g0 = vec3(gx.x, gy.x, gz.x), g1 = vec3(gx.y, gy.y, gz.y);"," vec3 g2 = vec3(gx.z, gy.z, gz.z), g3 = vec3(gx.w, gy.w, gz.w);"," vec4 w = 0.5 - vec4(dot(x0, x0), dot(x1, x1), dot(x2, x2), dot(x3, x3));"," w = max(w, 0.0);"," vec4 w2 = w * w;"," vec4 w3 = w2 * w;"," vec4 gdotx = vec4(dot(g0, x0), dot(g1, x1), dot(g2, x2), dot(g3, x3));"," float n = dot(w3, gdotx);"," return 39.5 * n;","}","float iterate (vec3 coord, float detailPower, float flowPower, float contributionPower)","{"," float value = 0.;"," float itValue = 0.;"," for (float iteration = 0.; iteration < ITERATION_COUNT; iteration++)"," {"," float detailScale = pow(detailPower, iteration);"," float flowScale = pow(flowPower, iteration);"," itValue = psrdnoise((coord + iteration) * detailScale, uPeriod * detailScale, uFlow * flowScale + iteration);"," value += itValue / pow(contributionPower, iteration);"," }"," return value;","}","float iterateWarp (vec3 coord, float detailPower, float flowPower, float contributionPower)","{"," float value = 0.;"," float itValue = 0.;"," for (float iteration = 0.; iteration < WARP_ITERATION_COUNT; iteration++)"," {"," float detailScale = pow(detailPower, iteration);"," float flowScale = pow(flowPower, iteration);"," itValue = psrdnoise((coord + iteration) * detailScale, uPeriod * detailScale, uFlow * flowScale + iteration);"," value += itValue / pow(contributionPower, iteration);"," }"," return value;","}","vec3 warp (vec3 coord)","{"," vec3 o2 = vec3(11.3, 23.7, 13.1);"," vec3 o3 = vec3(29.9, 2.3, 31.7);"," float coord1 = iterateWarp(coord, uWarpDetailPower, uWarpFlowPower, uWarpContributionPower);"," float coord2 = iterateWarp(coord + o2, uWarpDetailPower, uWarpFlowPower, uWarpContributionPower);"," float coord3 = iterateWarp(coord + o3, uWarpDetailPower, uWarpFlowPower, uWarpContributionPower);"," return vec3(coord1, coord2, coord3);","}","void main ()","{"," vec3 coord = (vec3(outTexCoord, 0.0) * uCells) + uOffset;"," if (uWarpAmount > 0.)"," {"," coord += warp(coord) * uWarpAmount;"," }"," float value = iterate(coord, uDetailPower, uFlowPower, uContributionPower) * uValueFactor + uValueAdd;"," value = pow(clamp(value, 0., 1.), uValuePower);"," #ifndef NORMAL_MAP"," vec4 color = mix(uColorStart, uColorEnd, value);"," color.rgb *= color.a;"," gl_FragColor = color;"," #else"," float dx = dFdx(value) * uNormalScale;"," float dy = dFdy(value) * uNormalScale;"," vec3 normal = vec3(dx, dy, 1.0 - sqrt(dx * dx + dy * dy)) * 0.5 + 0.5;"," gl_FragColor = vec4(normal, 1.0);"," #endif","}"].join("\n")},17205(t){t.exports=["#version 100","#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(fragmentMode)","#pragma phaserTemplate(fragmentIterations)","#pragma phaserTemplate(fragmentNormalMap)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform vec2 uSeedX;","uniform vec2 uSeedY;","uniform vec2 uCells;","uniform vec2 uCellOffset;","uniform vec2 uVariation;","uniform vec2 uWrap;","uniform float uSmoothing;","uniform float uNormalScale;","uniform vec4 uColorStart;","uniform vec4 uColorEnd;","varying vec2 outTexCoord;","float trig(vec2 p)","{"," return fract(43757.5453*sin(dot(p, vec2(12.9898,78.233))));","}","vec2 bigCoord (vec2 coord, float scale)","{"," return (coord + uCellOffset) * scale * uCells;","}","vec2 hash2D (vec2 coord)","{"," return vec2("," trig(coord + uSeedX),"," trig(coord + uSeedY)"," ) * uVariation;","}","float worley2D (vec2 uv, float scale)","{"," vec2 coord = bigCoord(uv, scale);"," vec2 point = floor(coord);"," vec2 frac = fract(coord);"," float dist = 12.0;"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec2 cellNeighbor = vec2(i, j);"," vec2 jitter = hash2D(mod(point + cellNeighbor, uWrap * scale));"," vec2 diff = cellNeighbor - frac + jitter;"," float d = dot(diff, diff); // Squared length of diff."," if (d < dist)"," {"," dist = d;"," }"," }"," return sqrt(dist);","}","float worley2DIndex (vec2 uv, float scale)","{"," vec2 coord = bigCoord(uv, scale);"," vec2 point = floor(coord);"," vec2 frac = fract(coord);"," float dist = 12.0;"," float random = 0.0;"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec2 cellNeighbor = vec2(i, j);"," vec2 jitter = hash2D(mod(point + cellNeighbor, uWrap * scale));"," vec2 diff = cellNeighbor - frac + jitter;"," float d = dot(diff, diff); // Squared length of diff."," if (d < dist)"," {"," dist = d;"," random = jitter.x;"," }"," }"," return random;","}","float worley2DSmooth (vec2 uv, float scale)","{"," vec2 coord = bigCoord(uv, scale);"," vec2 point = floor(coord);"," vec2 frac = fract(coord);"," float value = 0.0;"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec2 cellNeighbor = vec2(i, j);"," vec2 jitter = hash2D(mod(point + cellNeighbor, uWrap * scale));"," vec2 diff = cellNeighbor - frac + jitter;"," float d = length(diff);"," value += exp2(-32.0 / uSmoothing * d); // Accumulate fast-decaying exponential of length."," }"," return -(1.0 / 32.0 * uSmoothing) * log2(value);","}","float iterateWorley2D (vec2 uv)","{"," float value = 0.0;"," float itValue = 0.0;"," for (float iteration = 0.0; iteration < ITERATION_COUNT; iteration++)"," {"," float scale = exp2(iteration);"," #ifdef MODE_DISTANCE"," itValue = worley2D(uv + iteration, scale);"," #endif"," #ifdef MODE_INDEX"," itValue = worley2DIndex(uv + iteration, scale);"," #endif"," #ifdef MODE_DISTANCE_SMOOTH"," itValue = worley2DSmooth(uv + iteration, scale);"," #endif"," value += (itValue - 0.5) / scale;"," }"," return value + 0.5;","}","void main ()","{"," float value = iterateWorley2D(outTexCoord);"," #ifndef NORMAL_MAP"," vec4 color = mix(uColorStart, uColorEnd, value);"," color.rgb *= color.a;"," gl_FragColor = color;"," #else"," float dx = dFdx(value) * uNormalScale;"," float dy = dFdy(value) * uNormalScale;"," vec3 normal = vec3(dx, dy, 1.0 - sqrt(dx * dx + dy * dy)) * 0.5 + 0.5;"," gl_FragColor = vec4(normal, 1.0);"," #endif","}"].join("\n")},79814(t){t.exports=["#version 100","#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(fragmentMode)","#pragma phaserTemplate(fragmentIterations)","#pragma phaserTemplate(fragmentNormalMap)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform vec3 uSeedX;","uniform vec3 uSeedY;","uniform vec3 uSeedZ;","uniform vec3 uCells;","uniform vec3 uCellOffset;","uniform vec3 uVariation;","uniform vec3 uWrap;","uniform float uSmoothing;","uniform float uNormalScale;","uniform vec4 uColorStart;","uniform vec4 uColorEnd;","varying vec2 outTexCoord;","float trig(vec3 p)","{"," return fract(43757.5453*sin(dot(p, vec3(12.9898,78.233, 9441.8953))));","}","vec3 bigCoord (vec3 coord, float scale)","{"," return (coord + uCellOffset) * scale * uCells;","}","vec3 hash3D (vec3 coord)","{"," return vec3("," trig(coord + uSeedX),"," trig(coord + uSeedY),"," trig(coord + uSeedZ)"," ) * uVariation;","}","float worley3D (vec3 uv, float scale)","{"," vec3 coord = bigCoord(uv, scale);"," vec3 point = floor(coord);"," vec3 frac = fract(coord);"," float dist = 12.0;"," for (float k = -1.0; k <= 1.0; k++)"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec3 cellNeighbor = vec3(i, j, k);"," vec3 jitter = hash3D(mod(point + cellNeighbor, uWrap * scale));"," vec3 diff = cellNeighbor - frac + jitter;"," float d = dot(diff, diff); // Squared length of diff."," if (d < dist)"," {"," dist = d;"," }"," }"," return sqrt(dist);","}","float worley3DIndex (vec3 uv, float scale)","{"," vec3 coord = bigCoord(uv, scale);"," vec3 point = floor(coord);"," vec3 frac = fract(coord);"," float dist = 12.0;"," float random = 0.0;"," for (float k = -1.0; k <= 1.0; k++)"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec3 cellNeighbor = vec3(i, j, k);"," vec3 jitter = hash3D(mod(point + cellNeighbor, uWrap * scale));"," vec3 diff = cellNeighbor - frac + jitter;"," float d = dot(diff, diff); // Squared length of diff."," if (d < dist)"," {"," dist = d;"," random = jitter.x;"," }"," }"," return random;","}","float worley3DSmooth (vec3 uv, float scale)","{"," vec3 coord = bigCoord(uv, scale);"," vec3 point = floor(coord);"," vec3 frac = fract(coord);"," float value = 0.0;"," for (float k = -1.0; k <= 1.0; k++)"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec3 cellNeighbor = vec3(i, j, k);"," vec3 jitter = hash3D(mod(point + cellNeighbor, uWrap * scale));"," vec3 diff = cellNeighbor - frac + jitter;"," float d = length(diff);"," value += exp2(-32.0 / uSmoothing * d); // Accumulate fast-decaying exponential of length."," }"," return -(1.0 / 32.0 * uSmoothing) * log2(value);","}","float iterateWorley3D (vec3 uv)","{"," float value = 0.0;"," float itValue = 0.0;"," for (float iteration = 0.0; iteration < ITERATION_COUNT; iteration++)"," {"," float scale = exp2(iteration);"," #ifdef MODE_DISTANCE"," itValue = worley3D(uv + iteration, scale);"," #endif"," #ifdef MODE_INDEX"," itValue = worley3DIndex(uv + iteration, scale);"," #endif"," #ifdef MODE_DISTANCE_SMOOTH"," itValue = worley3DSmooth(uv + iteration, scale);"," #endif"," value += (itValue - 0.5) / scale;"," }"," return value + 0.5;","}","void main ()","{"," vec3 uv = vec3(outTexCoord, 0.0);"," float value = iterateWorley3D(uv);"," #ifndef NORMAL_MAP"," vec4 color = mix(uColorStart, uColorEnd, value);"," color.rgb *= color.a;"," gl_FragColor = color;"," #else"," float dx = dFdx(value) * uNormalScale;"," float dy = dFdy(value) * uNormalScale;"," vec3 normal = vec3(dx, dy, 1.0 - sqrt(dx * dx + dy * dy)) * 0.5 + 0.5;"," gl_FragColor = vec4(normal, 1.0);"," #endif","}"].join("\n")},99595(t){t.exports=["#version 100","#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(fragmentMode)","#pragma phaserTemplate(fragmentIterations)","#pragma phaserTemplate(fragmentNormalMap)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform vec4 uSeedX;","uniform vec4 uSeedY;","uniform vec4 uSeedZ;","uniform vec4 uSeedW;","uniform vec4 uCells;","uniform vec4 uCellOffset;","uniform vec4 uVariation;","uniform vec4 uWrap;","uniform float uSmoothing;","uniform float uNormalScale;","uniform vec4 uColorStart;","uniform vec4 uColorEnd;","varying vec2 outTexCoord;","float trig(vec4 p)","{"," return fract(43757.5453*sin(dot(p, vec4(12.9898,78.233,9441.8953,61.99))));","}","vec4 bigCoord (vec4 coord, float scale)","{"," return (coord + uCellOffset) * scale * uCells;","}","vec4 hash4D (vec4 coord)","{"," return vec4("," trig(coord + uSeedX),"," trig(coord + uSeedY),"," trig(coord + uSeedZ),"," trig(coord + uSeedW)"," ) * uVariation;","}","float worley4D (vec4 uv, float scale)","{"," vec4 coord = bigCoord(uv, scale);"," vec4 point = floor(coord);"," vec4 frac = fract(coord);"," float dist = 16.0;"," for (float l = -1.0; l <= 1.0; l++)"," for (float k = -1.0; k <= 1.0; k++)"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec4 cellNeighbor = vec4(i, j, k, l);"," vec4 jitter = hash4D(mod(point + cellNeighbor, uWrap * scale));"," vec4 diff = cellNeighbor - frac + jitter;"," float d = dot(diff, diff); // Squared length of diff."," if (d < dist)"," {"," dist = d;"," }"," }"," return sqrt(dist);","}","float worley4DIndex (vec4 uv, float scale)","{"," vec4 coord = bigCoord(uv, scale);"," vec4 point = floor(coord);"," vec4 frac = fract(coord);"," float dist = 16.0;"," float random = 0.0;"," for (float l = -1.0; l <= 1.0; l++)"," for (float k = -1.0; k <= 1.0; k++)"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec4 cellNeighbor = vec4(i, j, k, l);"," vec4 jitter = hash4D(mod(point + cellNeighbor, uWrap * scale));"," vec4 diff = cellNeighbor - frac + jitter;"," float d = dot(diff, diff); // Squared length of diff."," if (d < dist)"," {"," dist = d;"," random = jitter.x;"," }"," }"," return random;","}","float worley4DSmooth (vec4 uv, float scale)","{"," vec4 coord = bigCoord(uv, scale);"," vec4 point = floor(coord);"," vec4 frac = fract(coord);"," float value = 0.0;"," for (float l = -1.0; l <= 1.0; l++)"," for (float k = -1.0; k <= 1.0; k++)"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec4 cellNeighbor = vec4(i, j, k, l);"," vec4 jitter = hash4D(mod(point + cellNeighbor, uWrap * scale));"," vec4 diff = cellNeighbor - frac + jitter;"," float d = length(diff);"," value += exp2(-32.0 / uSmoothing * d); // Accumulate fast-decaying exponential of length."," }"," return -(1.0 / 32.0 * uSmoothing) * log2(value);","}","float iterateWorley4D (vec4 uv)","{"," float value = 0.0;"," float itValue = 0.0;"," for (float iteration = 0.0; iteration < ITERATION_COUNT; iteration++)"," {"," float scale = exp2(iteration);"," #ifdef MODE_DISTANCE"," itValue = worley4D(uv + iteration, scale);"," #endif"," #ifdef MODE_INDEX"," itValue = worley4DIndex(uv + iteration, scale);"," #endif"," #ifdef MODE_DISTANCE_SMOOTH"," itValue = worley4DSmooth(uv + iteration, scale);"," #endif"," value += (itValue - 0.5) / scale;"," }"," return value + 0.5;","}","void main ()","{"," vec4 uv = vec4(outTexCoord, 0.0, 0.0);"," float value = iterateWorley4D(uv);"," #ifndef NORMAL_MAP"," vec4 color = mix(uColorStart, uColorEnd, value);"," color.rgb *= color.a;"," gl_FragColor = color;"," #else"," float dx = dFdx(value) * uNormalScale;"," float dy = dFdy(value) * uNormalScale;"," vec3 normal = vec3(dx, dy, 1.0 - sqrt(dx * dx + dy * dy)) * 0.5 + 0.5;"," gl_FragColor = vec4(normal, 1.0);"," #endif","}"].join("\n")},62807(t){t.exports=["float inverseRotation = -rotation - uCamera.z;","float irSine = sin(inverseRotation);","float irCosine = cos(inverseRotation);","outInverseRotationMatrix = mat3("," irCosine, irSine, 0.0,"," -irSine, irCosine, 0.0,"," 0.0, 0.0, 1.0",");"].join("\n")},4127(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","precision mediump float;","#pragma phaserTemplate(fragmentDefine)","uniform vec2 uResolution;","uniform float uCameraZoom;","varying vec4 lightPosition;","varying vec4 lightColor;","varying float lightRadius;","varying float lightAttenuation;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec2 center = (lightPosition.xy + 1.0) * (uResolution.xy * 0.5);"," float distToSurf = length(center - gl_FragCoord.xy);"," float radius = 1.0 - distToSurf / (lightRadius * uCameraZoom);"," float intensity = smoothstep(0.0, 1.0, radius * lightAttenuation);"," vec4 color = vec4(intensity, intensity, intensity, 0.0) * lightColor;"," #pragma phaserTemplate(fragmentProcess)"," gl_FragColor = vec4(color.rgb * lightColor.a, color.a);","}"].join("\n")},89924(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","precision mediump float;","#pragma phaserTemplate(vertexDefine)","uniform mat4 uProjectionMatrix;","attribute vec2 inPosition;","attribute vec2 inLightPosition;","attribute vec4 inLightColor;","attribute float inLightRadius;","attribute float inLightAttenuation;","varying vec4 lightPosition;","varying vec4 lightColor;","varying float lightRadius;","varying float lightAttenuation;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(vertexHeader)","void main ()","{"," lightColor = inLightColor;"," lightRadius = inLightRadius;"," lightAttenuation = inLightAttenuation;"," lightPosition = uProjectionMatrix * vec4(inLightPosition, 1.0, 1.0);"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);"," #pragma phaserTemplate(vertexProcess)","}"].join("\n")},68589(t){t.exports=["#extension GL_OES_standard_derivatives : enable","#define BAND_TREE_DEPTH 0.0","uniform sampler2D uRampTexture;","uniform vec2 uRampResolution;","uniform float uRampBandStart;","uniform bool uDither;","float decodeNumberSample(vec4 sample)","{"," return ("," sample.r * 255.0 +"," sample.g * 255.0 * 256.0 +"," sample.b * 255.0 * 256.0 * 256.0 +"," sample.a * 255.0 * 256.0 * 256.0 * 256.0"," ) / 256.0 / 256.0;","}","struct Band","{"," vec4 colorStart;"," vec4 colorEnd;"," float start;"," float end;"," int colorSpace;"," int interpolation;"," float middle;","};","Band getBand(float progress)","{"," vec2 rampStep = 1.0 / uRampResolution;"," vec2 c = rampStep / 2.0;"," float start = decodeNumberSample(texture2D(uRampTexture, c));"," float end = decodeNumberSample(texture2D(uRampTexture, vec2(1.0, 0.0) * rampStep + c));"," float TREE_OFFSET = 2.0; // Beginning of tree block."," float index = 0.0;"," float x, y;"," for (float i = 0.0; i < BAND_TREE_DEPTH; i++)"," {"," x = mod(index + TREE_OFFSET, uRampResolution.x);"," y = floor(x / uRampResolution.x);"," float pivot = decodeNumberSample(texture2D(uRampTexture, vec2(x, y) * rampStep + c));"," if (progress > pivot)"," {"," start = pivot;"," index = index * 2.0 + 2.0;"," }"," else"," {"," end = pivot;"," index = index * 2.0 + 1.0;"," }"," }"," float bandNumber = index - uRampBandStart + TREE_OFFSET;"," float bandIndex = bandNumber * 3.0 + uRampBandStart;"," x = mod(bandIndex, uRampResolution.x);"," y = floor(bandIndex / uRampResolution.x);"," vec4 colorStart = texture2D(uRampTexture, vec2(x, y) * rampStep + c);"," x = mod(bandIndex + 1.0, uRampResolution.x);"," y = floor(bandIndex / uRampResolution.x);"," vec4 colorEnd = texture2D(uRampTexture, vec2(x, y) * rampStep + c);"," x = mod(bandIndex + 2.0, uRampResolution.x);"," y = floor(bandIndex / uRampResolution.x);"," float bandData = decodeNumberSample(texture2D(uRampTexture, vec2(x, y) * rampStep + c));"," int colorSpace = int(floor(bandData / 255.0));"," int interpolation = int(floor(bandData)) - colorSpace * 255;"," return Band(colorStart, colorEnd, start, end, colorSpace, interpolation, fract(bandData) * 2.0);","}","float interpolate(float progress, int mode)","{"," if (mode == 1)"," {"," if ((progress *= 2.0) < 1.0)"," {"," return 0.5 * sqrt(1.0 - (--progress * progress));"," }"," progress = 1.0 - progress;"," return 1.0 - 0.5 * sqrt(1.0 - progress * progress);"," }"," if (mode == 2)"," {"," return sin((progress - 0.5) * 3.14159265358979323846) * 0.5 + 0.5;"," }"," if (mode == 3)"," {"," return sqrt(1.0 - (--progress * progress));"," }"," if (mode == 4)"," {"," return 1.0 - sqrt(1.0 - progress * progress);"," }"," return progress;","}","float ditherIGN(float value)","{"," float dx = dFdx(value);"," float dy = dFdy(value);"," float rateOfChange = sqrt(dx * dx + dy * dy);"," value += (fract(52.9829189 * fract(0.06711056 * gl_FragCoord.x + 0.00583715 * gl_FragCoord.y)) - 0.5) * rateOfChange;"," return value;","}","vec4 rgbaToHsva(vec4 rgba)","{"," float r = rgba.r;"," float g = rgba.g;"," float b = rgba.b;"," float a = rgba.a;"," float min = min(min(r, g), b);"," float max = max(max(r, g), b);"," float d = max - min;"," float h = 0.0;"," float s = (max == 0.0) ? 0.0 : d / max;"," float v = max;"," if (max != min)"," {"," if (max == r)"," {"," h = (g - b) / d + ((g < b) ? 6.0 : 0.0);"," }"," else if (max == g)"," {"," h = (b - r) / d + 2.0;"," }"," else"," {"," h = (r - g) / d + 4.0;"," }"," h /= 6.0;"," }"," return vec4(h, s, v, a);","}","float hsvaToRgbaConvert(float n, vec4 hsva)","{"," float k = mod(n + hsva.x * 6.0, 6.0);"," float min = min(min(k, 4.0 - k), 1.0);"," return hsva.z - hsva.z * hsva.y * max(0.0, min);","}","vec4 hsvaToRgba(vec4 hsva)","{"," return vec4("," hsvaToRgbaConvert(5.0, hsva),"," hsvaToRgbaConvert(3.0, hsva),"," hsvaToRgbaConvert(1.0, hsva),"," hsva.a"," );","}","vec4 mixBandColor(float progress, Band band)","{"," if (band.colorSpace == 0)"," {"," return mix(band.colorStart, band.colorEnd, progress);"," }"," vec4 hsvaStart = rgbaToHsva(band.colorStart);"," vec4 hsvaEnd = rgbaToHsva(band.colorEnd);"," if (band.colorSpace == 1)"," {"," float dH = hsvaStart.x - hsvaEnd.x;"," if (dH > 0.5)"," {"," hsvaStart.x -= 1.0;"," }"," else if (dH < -0.5)"," {"," hsvaStart.x += 1.0;"," }"," }"," else if (band.colorSpace == 2)"," {"," if (hsvaStart.x > hsvaEnd.x)"," {"," hsvaStart.x -= 1.0;"," }"," }"," else if (band.colorSpace == 3)"," {"," if (hsvaStart.x < hsvaEnd.x)"," {"," hsvaStart.x += 1.0;"," }"," }"," vec4 hsvaMix = mix(hsvaStart, hsvaEnd, progress);"," hsvaMix.x = mod(hsvaMix.x, 1.0);"," return hsvaToRgba(hsvaMix);","}","vec4 getRampAt(float progress)","{"," Band band = getBand(progress);"," float bandProgress = (progress - band.start) / (band.end - band.start);"," float gamma = log(0.5) / log(band.middle);"," bandProgress = pow(bandProgress, gamma);"," bandProgress = interpolate(bandProgress, band.interpolation);"," if (uDither)"," {"," bandProgress = ditherIGN(bandProgress);"," }"," return mixBandColor(bandProgress, band);","}"].join("\n")},72823(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(fragmentDefine)","varying vec2 outTexCoord;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec4 fragColor = vec4(outTexCoord.xyx, 1.0);"," #pragma phaserTemplate(fragmentProcess)"," gl_FragColor = fragColor;","}"].join("\n")},65884(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(vertexDefine)","uniform mat4 uProjectionMatrix;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","varying vec2 outTexCoord;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(vertexHeader)","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);"," outTexCoord = inTexCoord;"," #pragma phaserTemplate(vertexProcess)","}"].join("\n")},2807(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","varying vec2 outFragCoord;","varying vec2 outTexCoord;","void main ()","{"," outFragCoord = inPosition.xy * 0.5 + 0.5;"," outTexCoord = inTexCoord;"," gl_Position = vec4(inPosition, 0, 1);","}"].join("\n")},49119(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(fragmentDefine)","uniform vec2 uResolution;","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," #pragma phaserTemplate(fragmentProcess)"," gl_FragColor = fragColor;","}"].join("\n")},3524(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#define ROUND_BIAS 0.5001","#pragma phaserTemplate(vertexDefine)","uniform mat4 uProjectionMatrix;","uniform mat3 uViewMatrix;","uniform vec3 uCameraScrollAndAlpha;","uniform int uRoundPixels;","uniform vec2 uResolution;","uniform float uTime;","uniform vec2 uDiffuseResolution;","uniform vec2 uFrameDataResolution;","uniform sampler2D uFrameDataTexture;","uniform float uGravity;","attribute float inVertex;","attribute vec4 inPositionX;","attribute vec4 inPositionY;","attribute vec4 inRotation;","attribute vec4 inScaleX;","attribute vec4 inScaleY;","attribute vec4 inAlpha;","attribute vec4 inFrame;","attribute vec4 inTintBlend;","attribute vec4 inTintTL;","attribute vec4 inTintTR;","attribute vec4 inTintBL;","attribute vec4 inTintBR;","attribute vec4 inOriginAndTintModeAndCreationTime;","attribute vec2 inScrollFactor;","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(vertexHeader)","const float PI = 3.14159265359;","const float HALF_PI = PI / 2.0;","const float BOUNCE_OVERSHOOT = 1.70158;","const float BOUNCE_OVERSHOOT_PLUS = BOUNCE_OVERSHOOT + 1.0;","const float BOUNCE_OVERSHOOT_IN_OUT = BOUNCE_OVERSHOOT * 1.525;","const float BOUNCE_OVERSHOOT_IN_OUT_PLUS = BOUNCE_OVERSHOOT_IN_OUT + 1.0;","float animate (vec4 anim)","{"," float value = anim.x;"," float a = anim.y;"," float b = abs(anim.z);"," float c = abs(anim.w);"," bool yoyo = anim.z < 0.0;"," bool loop = anim.w > 0.0;"," int type = int(floor(c));"," if (type == 0|| b == 0.0)"," {"," return value;"," }"," float duration = b;"," float delay = mod(c, 1.0) * 2.0;"," float rawTime = ((uTime - inOriginAndTintModeAndCreationTime.w) / duration) - delay;"," float time = mod(rawTime, 1.0);"," if (yoyo && (mod(rawTime, 2.0) >= 1.0))"," {"," time = 1.0 - time;"," }"," float repeats = loop ? 0.0 : floor(a);"," float timeContinuous = loop ? time : rawTime;"," #ifdef FEATURE_LINEAR"," if (type == 1)"," {"," return value + a * timeContinuous;"," }"," #endif"," #ifdef FEATURE_GRAVITY"," if (type == 2)"," {"," float v = floor(a);"," float gravityFactor = (a - v) * 2.0 - 1.0;"," if (gravityFactor == 0.0)"," {"," gravityFactor = 1.0;"," }"," float seconds = timeContinuous * duration / 1000.0;"," float accel = uGravity * gravityFactor;"," return value + (v * seconds) + (0.5 * accel * seconds * seconds);"," }"," #endif"," #ifdef FEATURE_QUAD_EASEOUT"," if (type == 10)"," {"," return value + a * time * (2.0 - time)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUAD_EASEIN"," if (type == 11)"," {"," return value + a * time * time"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUAD_EASEINOUT"," if (type == 12)"," {"," time *= 2.0;"," if (time < 1.0)"," {"," return value + a * time * time * 0.5"," + repeats * a;"," }"," time -= 1.0;"," return value + a * -0.5 * (time * (time - 2.0) - 1.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_CUBIC_EASEOUT"," if (type == 20)"," {"," time -= 1.0;"," return value + a * (time * time * time + 1.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_CUBIC_EASEIN"," if (type == 21)"," {"," return value + a * time * time * time"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_CUBIC_EASEINOUT"," if (type == 22)"," {"," time *= 2.0;"," if (time < 1.0)"," {"," return value + a * time * time * time * 0.5"," + repeats * a;"," }"," time -= 2.0;"," return value + a * 0.5 * (time * time * time + 2.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUART_EASEOUT"," if (type == 30)"," {"," time -= 1.0;"," return value + a * (1.0 - time * time * time * time)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUART_EASEIN"," if (type == 31)"," {"," return value + a * time * time * time * time"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUART_EASEINOUT"," if (type == 32)"," {"," time *= 2.0;"," if (time < 1.0)"," {"," return value + a * time * time * time * time * 0.5"," + repeats * a;"," }"," time -= 2.0;"," return value + a * -0.5 * (time * time * time * time - 2.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUINT_EASEOUT"," if (type == 40)"," {"," time -= 1.0;"," return value + a * (time * time * time * time * time + 1.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUINT_EASEIN"," if (type == 41)"," {"," return value + a * time * time * time * time * time"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUINT_EASEINOUT"," if (type == 42)"," {"," time *= 2.0;"," if (time < 1.0)"," {"," return value + a * time * time * time * time * time * 0.5"," + repeats * a;"," }"," time -= 2.0;"," return value + a * 0.5 * (time * time * time * time * time + 2.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_SINE_EASEOUT"," if (type == 50)"," {"," return value + a * sin(time * HALF_PI)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_SINE_EASEIN"," if (type == 51)"," {"," return value + a * (1.0 - cos(time * HALF_PI))"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_SINE_EASEINOUT"," if (type == 52)"," {"," return value + a * 0.5 * (1.0 - cos(PI * time))"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_EXPO_EASEOUT"," if (type == 60)"," {"," return value + a * (1.0 - pow(2.0, -10.0 * time))"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_EXPO_EASEIN"," if (type == 61)"," {"," return value + a * pow(2.0, 10.0 * (time - 1.0) - 0.001)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_EXPO_EASEINOUT"," if (type == 62)"," {"," time *= 2.0;"," if (time < 1.0)"," {"," return value + a * 0.5 * pow(2.0, 10.0 * (time - 1.0))"," + repeats * a;"," }"," time -= 1.0;"," return value + a * 0.5 * (2.0 - pow(2.0, -10.0 * (time - 1.0)))"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_CIRC_EASEOUT"," if (type == 70)"," {"," time -= 1.0;"," return value + a * sqrt(1.0 - time * time)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_CIRC_EASEIN"," if (type == 71)"," {"," return value + a * (1.0 - sqrt(1.0 - time * time))"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_CIRC_EASEINOUT"," if (type == 72)"," {"," time *= 2.0;"," if (time < 1.0)"," {"," return value + a * -0.5 * (sqrt(1.0 - time * time) - 1.0)"," + repeats * a;"," }"," time -= 2.0;"," return value + a * 0.5 * (sqrt(1.0 - time * time) + 1.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_BACK_EASEOUT"," if (type == 90)"," {"," time -= 1.0;"," return value + a * (time * time * (BOUNCE_OVERSHOOT_PLUS * time + BOUNCE_OVERSHOOT) + 1.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_BACK_EASEIN"," if (type == 91)"," {"," return value + a * time * time * (BOUNCE_OVERSHOOT_PLUS * time - BOUNCE_OVERSHOOT)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_BACK_EASEINOUT"," if (type == 92)"," {"," time *= 2.0;"," if (time < 1.0)"," {"," return value + a * 0.5 * (time * time * (BOUNCE_OVERSHOOT_IN_OUT_PLUS * time - BOUNCE_OVERSHOOT_IN_OUT))"," + repeats * a;"," }"," time -= 2.0;"," return value + a * 0.5 * (time * time * (BOUNCE_OVERSHOOT_IN_OUT_PLUS * time + BOUNCE_OVERSHOOT_IN_OUT) + 2.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_BOUNCE_EASEOUT"," if (type == 100)"," {"," if (time < 1.0 / 2.75)"," {"," return value + a * (7.5625 * time * time)"," + repeats * a;"," }"," else if (time < 2.0 / 2.75)"," {"," time -= 1.5 / 2.75;"," return value + a * (7.5625 * time * time + 0.75)"," + repeats * a;"," }"," else if (time < 2.5 / 2.75)"," {"," time -= 2.25 / 2.75;"," return value + a * (7.5625 * time * time + 0.9375)"," + repeats * a;"," }"," else"," {"," time -= 2.625 / 2.75;"," return value + a * (7.5625 * time * time + 0.984375)"," + repeats * a;"," }"," }"," #endif"," #ifdef FEATURE_BOUNCE_EASEIN"," if (type == 101)"," {"," time = 1.0 - time;"," if (time < 1.0 / 2.75)"," {"," return value + a * (1.0 - 7.5625 * time * time)"," + repeats * a;"," }"," else if (time < 2.0 / 2.75)"," {"," time -= 1.5 / 2.75;"," return value + a * (1.0 - (7.5625 * time * time + 0.75))"," + repeats * a;"," }"," else if (time < 2.5 / 2.75)"," {"," time -= 2.25 / 2.75;"," return value + a * (1.0 - (7.5625 * time * time + 0.9375))"," + repeats * a;"," }"," else"," {"," time -= 2.625 / 2.75;"," return value + a * (1.0 - (7.5625 * time * time + 0.984375))"," + repeats * a;"," }"," }"," #endif"," #ifdef FEATURE_BOUNCE_EASEINOUT"," if (type == 102)"," {"," bool reverse = false;"," if (time < 0.5)"," {"," time = 1.0 - time * 2.0;"," reverse = true;"," }"," if (time < 1.0 / 2.75)"," {"," time = 7.5625 * time * time;"," }"," else if (time < 2.0 / 2.75)"," {"," time -= 1.5 / 2.75;"," time = 7.5625 * time * time + 0.75;"," }"," else if (time < 2.5 / 2.75)"," {"," time -= 2.25 / 2.75;"," time = 7.5625 * time * time + 0.9375;"," }"," else"," {"," time -= 2.625 / 2.75;"," time = 7.5625 * time * time + 0.984375;"," }"," if (reverse)"," {"," return value + a * (1.0 - time) * 0.5"," + repeats * a;"," }"," return value + a * time * 0.5 + 0.5"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_STEPPED"," if (type == 110)"," {"," return value + a * floor(time + 0.5)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_SMOOTHSTEP_EASEOUT"," if (type == 120)"," {"," return value + a * (smoothstep(0.0, 1.0, time / 2.0 + 0.5) * 2.0 - 1.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_SMOOTHSTEP_EASEIN"," if (type == 121)"," {"," return value + a * smoothstep(0.0, 1.0, time / 2.0) * 2.0"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_SMOOTHSTEP_EASEINOUT"," if (type == 122)"," {"," return value + a * smoothstep(0.0, 1.0, time)"," + repeats * a;"," }"," #endif"," return value;","}","struct Frame {"," vec2 position;"," vec2 size;"," vec2 offset;","};","Frame getFrame (float frame)","{"," float index1 = floor(frame) * 3.0;"," float index2 = index1 + 1.0;"," float index3 = index1 + 2.0;"," float width = uFrameDataResolution.x;"," float x = mod(index1, width);"," float y = floor(index1 / width);"," vec4 texelUV = texture2D("," uFrameDataTexture,"," vec2(x + 0.5, y + 0.5) / uFrameDataResolution"," );"," x = mod(index2, width);"," y = floor(index2 / width);"," vec4 texelWH = texture2D("," uFrameDataTexture,"," vec2(x + 0.5, y + 0.5) / uFrameDataResolution"," );"," x = mod(index3, width);"," y = floor(index3 / width);"," vec4 texelOrigin = texture2D("," uFrameDataTexture,"," vec2(x + 0.5, y + 0.5) / uFrameDataResolution"," );"," return Frame("," vec2("," texelUV.r + texelUV.g * 256.0,"," texelUV.b + texelUV.a * 256.0"," ) * 255.0,"," vec2("," texelWH.r + texelWH.g * 256.0,"," texelWH.b + texelWH.a * 256.0"," ) * 255.0,"," vec2("," texelOrigin.r + texelOrigin.g * 256.0,"," texelOrigin.b + texelOrigin.a * 256.0"," ) * 255.0 - 32768.0"," );","}","void main ()","{"," float positionX = animate(inPositionX);"," float positionY = animate(inPositionY);"," float rotation = animate(inRotation);"," float scaleX = animate(inScaleX);"," float scaleY = animate(inScaleY);"," float frame = animate(inFrame);"," float tintBlend = animate(inTintBlend);"," float alpha = animate(inAlpha);"," vec2 origin = inOriginAndTintModeAndCreationTime.xy;"," float tintMode = inOriginAndTintModeAndCreationTime.z;"," float scrollFactorX = inScrollFactor.x;"," float scrollFactorY = inScrollFactor.y;"," Frame frameData = getFrame(frame);"," vec2 uv = frameData.position / uDiffuseResolution;"," vec2 wh = frameData.size / uDiffuseResolution;"," float u = uv.s;"," float v = uv.t;"," float w = wh.s;"," float h = wh.t;"," float width = frameData.size.s;"," float height = frameData.size.t;"," vec4 tint = inTintTL;"," float x = -origin.x;"," float y = -origin.y;"," if (inVertex == 0.0)"," {"," y = 1.0 - origin.y;"," v += h;"," tint = inTintBL;"," }"," else if (inVertex == 2.0)"," {"," x = 1.0 - origin.x;"," y = 1.0 - origin.y;"," u += w;"," v += h;"," tint = inTintBR;"," }"," else if (inVertex == 3.0)"," {"," x = 1.0 - origin.x;"," u += w;"," tint = inTintTR;"," }"," vec3 position = vec3("," (x * width - frameData.offset.x) * scaleX,"," (y * height - frameData.offset.y) * scaleY,"," 1.0"," );"," mat3 viewMatrix = uViewMatrix * mat3("," 1.0, 0.0, 0.0,"," 0.0, 1.0, 0.0,"," uCameraScrollAndAlpha.x * (1.0 - scrollFactorX), uCameraScrollAndAlpha.y * (1.0 - scrollFactorY), 1.0"," );"," float sine = sin(rotation);"," float cosine = cos(rotation);"," mat3 transformMatrix = mat3("," cosine, sine, 0.0,"," -sine, cosine, 0.0,"," positionX, positionY, 1.0"," );"," position = viewMatrix * transformMatrix * position;"," alpha *= uCameraScrollAndAlpha.z;"," tint.a *= alpha;"," if (uRoundPixels == 1 && rotation == 0.0 && scaleX == 1.0 && scaleY == 1.0)"," {"," position.xy = floor(position.xy + ROUND_BIAS);"," }"," gl_Position = uProjectionMatrix * vec4(position.xy, 1.0, 1.0);"," outTexCoord = vec2(u, 1.0 - v);"," outTint = mix(vec4(1.0, 1.0, 1.0, tint.a), tint, tintBlend);"," outTintEffect = tintMode;"," #pragma phaserTemplate(vertexProcess)","}"].join("\n")},57532(t){t.exports=["#version 100","#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","/* Redefine MAX_ANIM_FRAMES to support animations with different frame numbers. */","#define MAX_ANIM_FRAMES 0","#pragma phaserTemplate(fragmentDefine)","uniform vec2 uResolution;","uniform sampler2D uMainSampler;","uniform sampler2D uLayerSampler;","uniform vec2 uMainResolution;","uniform vec2 uLayerResolution;","uniform float uTileColumns;","uniform vec4 uTileWidthHeightMarginSpacing;","uniform float uAlpha;","uniform float uTime;","#if MAX_ANIM_FRAMES > 0","uniform sampler2D uAnimSampler;","uniform vec2 uAnimResolution;","#endif","varying vec2 outTexCoord;","varying vec2 outTileStride;","#pragma phaserTemplate(outVariables)","vec2 getTexRes ()","{"," return uMainResolution;","}","float floatTexel (vec4 texel)","{"," return texel.r * 255.0 + (texel.g * 255.0 * 256.0) + (texel.b * 255.0 * 256.0 * 256.0) + (texel.a * 255.0 * 256.0 * 256.0 * 256.0);","}","struct Tile","{"," float index;"," vec2 uv; // In texels."," #if MAX_ANIM_FRAMES > 0"," bool animated;"," #endif"," bool empty;","};","Tile getLayerData (vec2 coord)","{"," vec2 texelCoord = coord * uLayerResolution;"," vec2 tile = floor(texelCoord);"," vec2 uv = fract(texelCoord);"," uv.y = 1.0 - uv.y;"," vec4 texel = texture2D(uLayerSampler, (tile + 0.5) / uLayerResolution) * 255.0;"," float flags = texel.a;"," /* Check for empty tile flag in bit 28. */"," if (flags == 16.0)"," {"," return Tile("," 0.0,"," vec2(0.0),"," #if MAX_ANIM_FRAMES > 0"," false,"," #endif"," true"," );"," }"," /* Bit 31 is flipX. */"," bool flipX = flags > 127.0;"," /* Bit 30 is flipY. */"," bool flipY = mod(flags, 128.0) > 63.0;"," #if MAX_ANIM_FRAMES > 0"," /* Bit 29 is animation. */"," bool animated = mod(flags, 64.0) > 31.0;"," #endif"," if (flipX)"," {"," uv.x = 1.0 - uv.x;"," }"," if (flipY)"," {"," uv.y = 1.0 - uv.y;"," }"," float index = texel.r + (texel.g * 256.0) + (texel.b * 256.0 * 256.0);"," return Tile("," index,"," uv * uTileWidthHeightMarginSpacing.xy,"," #if MAX_ANIM_FRAMES > 0"," animated,"," #endif"," false"," );","}","vec2 getFrameCorner (float index)","{"," float x = mod(index, uTileColumns);"," float y = floor(index / uTileColumns);"," vec2 xy = vec2(x, y);"," return xy * outTileStride + uTileWidthHeightMarginSpacing.zz;","}","#if MAX_ANIM_FRAMES > 0","float animationIndex (float index)","{"," float animTextureWidth = uAnimResolution.x;"," vec2 index2D = vec2(mod(index, animTextureWidth), floor(index / animTextureWidth));"," vec4 animDurationTexel = texture2D(uAnimSampler, (index2D + 0.5) / uAnimResolution);"," index2D = vec2(mod(index + 1.0, animTextureWidth), floor((index + 1.0) / animTextureWidth));"," vec4 animIndexTexel = texture2D(uAnimSampler, (index2D + 0.5) / uAnimResolution);"," float animDuration = floatTexel(animDurationTexel);"," float animIndex = floatTexel(animIndexTexel);"," float animTime = mod(uTime, animDuration);"," float animTimeAccum = 0.0;"," for (int i = 0; i < MAX_ANIM_FRAMES; i++)"," {"," index2D = vec2(mod(animIndex, animTextureWidth), floor(animIndex / animTextureWidth));"," animDurationTexel = texture2D(uAnimSampler, (index2D + 0.5) / uAnimResolution);"," float frameDuration = floatTexel(animDurationTexel);"," animTimeAccum += frameDuration;"," if (animTime <= animTimeAccum)"," {"," break;"," }"," animIndex += 2.0;"," }"," animIndex += 1.0;"," index2D = vec2(mod(animIndex, animTextureWidth), floor(animIndex / animTextureWidth));"," animIndexTexel = texture2D(uAnimSampler, (index2D + 0.5) / uAnimResolution);"," float animFrameIndex = floatTexel(animIndexTexel);"," return animFrameIndex;","}","#endif","vec2 getTileTexelCoord (Tile tile)","{"," if (tile.empty)"," {"," return vec2(0.0);"," }"," float index = tile.index;"," #if MAX_ANIM_FRAMES > 0"," if (tile.animated)"," {"," index = animationIndex(index);"," }"," #endif"," vec2 frameCorner = getFrameCorner(index);"," return frameCorner + tile.uv;","}","#pragma phaserTemplate(fragmentHeader)","struct Samples {"," vec4 color;"," #pragma phaserTemplate(defineSamples)","};","Samples getColorSamples (vec2 texCoord)","{"," Samples samples;"," samples.color = texture2D("," uMainSampler,"," vec2(texCoord.x, 1.0 - texCoord.y)"," );"," #pragma phaserTemplate(getSamples)"," return samples;","}","Samples mixSamples (Samples samples1, Samples samples2, float alpha)","{"," Samples samples;"," samples.color = mix(samples1.color, samples2.color, alpha);"," #pragma phaserTemplate(mixSamples)"," return samples;","}","Samples getFinalSamples (Tile tile, vec2 layerTexCoord)","{"," vec2 texelCoord = getTileTexelCoord(tile);"," vec2 texCoord = texelCoord / uMainResolution;"," #pragma phaserTemplate(texCoord)"," #ifndef FEATURE_BORDERFILTER"," return getColorSamples(texCoord);"," #else"," #pragma phaserTemplate(finalSamples)"," vec2 wh = uTileWidthHeightMarginSpacing.xy;"," vec2 frameCorner = getFrameCorner(tile.index);"," vec2 frameCornerOpposite = frameCorner + wh;"," vec2 texCoordClamped = clamp(texCoord, (frameCorner + 0.5) / uMainResolution, (frameCornerOpposite - 0.5) / uMainResolution);"," vec2 dTexelCoord = (texCoord - texCoordClamped) * uMainResolution;"," dTexelCoord.y = -dTexelCoord.y;"," vec2 offsets = sign(dTexelCoord);"," Samples samples0 = getColorSamples(texCoordClamped);"," if (offsets.x == 0.0)"," {"," if (offsets.y == 0.0)"," {"," return samples0;"," }"," Tile tileY = getLayerData(layerTexCoord + (offsets - dTexelCoord) / wh / uLayerResolution);"," vec2 texelCoordY = getTileTexelCoord(tileY);"," vec2 texCoordY = texelCoordY / uMainResolution;"," Samples samplesY = getColorSamples(texCoordY);"," return mixSamples(samples0, samplesY, abs(dTexelCoord.y));"," }"," else"," {"," if (offsets.y == 0.0)"," {"," Tile tileX = getLayerData(layerTexCoord + (offsets - dTexelCoord) / wh / uLayerResolution);"," vec2 texelCoordX = getTileTexelCoord(tileX);"," vec2 texCoordX = texelCoordX / uMainResolution;"," Samples samplesX = getColorSamples(texCoordX);"," return mixSamples(samples0, samplesX, abs(dTexelCoord.x));"," }"," Tile tileX = getLayerData(layerTexCoord + (offsets * vec2(1.0, 0.0) - dTexelCoord) / wh / uLayerResolution);"," vec2 texelCoordX = getTileTexelCoord(tileX);"," vec2 texCoordX = texelCoordX / uMainResolution;"," Samples samplesX = getColorSamples(texCoordX);"," Tile tileY = getLayerData(layerTexCoord + (offsets * vec2(0.0, 1.0) - dTexelCoord) / wh / uLayerResolution);"," vec2 texelCoordY = getTileTexelCoord(tileY);"," vec2 texCoordY = texelCoordY / uMainResolution;"," Samples samplesY = getColorSamples(texCoordY);"," Tile tileXY = getLayerData(layerTexCoord + (offsets - dTexelCoord) / wh / uLayerResolution);"," vec2 texelCoordXY = getTileTexelCoord(tileXY);"," vec2 texCoordXY = texelCoordXY / uMainResolution;"," Samples samplesXY = getColorSamples(texCoordXY);"," Samples samples1 = mixSamples(samples0, samplesX, abs(dTexelCoord.x));"," Samples samples2 = mixSamples(samplesY, samplesXY, abs(dTexelCoord.x));"," return mixSamples(samples1, samples2, abs(dTexelCoord.y));"," }"," #endif","}","void main ()","{"," vec2 layerTexCoord = outTexCoord;"," Tile tile = getLayerData(layerTexCoord);"," Samples samples = getFinalSamples(tile, layerTexCoord);"," vec4 fragColor = samples.color;"," #pragma phaserTemplate(declareSamples)"," #pragma phaserTemplate(fragmentProcess)"," fragColor *= uAlpha;"," gl_FragColor = fragColor;","}"].join("\n")},23879(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(vertexDefine)","uniform mat4 uProjectionMatrix;","uniform vec2 uResolution;","uniform vec4 uTileWidthHeightMarginSpacing;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","varying vec2 outTexCoord;","varying vec2 outTileStride;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(vertexHeader)","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);"," outTexCoord = inTexCoord;"," outTileStride = uTileWidthHeightMarginSpacing.xy + uTileWidthHeightMarginSpacing.zz;"," #pragma phaserTemplate(vertexProcess)","}"].join("\n")},84639(t){t.exports=function(t,e){return{name:t+"Anims",additions:{fragmentDefine:"#undef MAX_ANIM_FRAMES\n#define MAX_ANIM_FRAMES "+t},tags:["MAXANIMS"],disable:!!e}}},81084(t,e,i){var s=i(84547);t.exports=function(t){return{name:"ApplyLighting",additions:{fragmentHeader:s,fragmentProcess:"fragColor = applyLighting(fragColor, normal);"},tags:["LIGHTING"],disable:!!t}}},44349(t,e,i){var s=i(11104);t.exports=function(t){return{name:"Tint",additions:{fragmentHeader:s,fragmentProcess:"fragColor = applyTint(fragColor);"},tags:["TINT"],disable:!!t}}},99501(t,e,i){var s=i(81556);t.exports=function(t){return{name:"BoundedSampler",additions:{fragmentHeader:s},disable:!!t}}},6184(t,e,i){var s=i(11719);t.exports=function(t){return{name:"DefineLights",additions:{fragmentDefine:"#define LIGHT_COUNT 1",fragmentHeader:s},tags:["LIGHTING"],disable:!!t}}},11653(t){t.exports=function(t,e){return{name:t+"TexCount",additions:{fragmentDefine:"#define TEXTURE_COUNT "+t},tags:["TexCount"],disable:!!e}}},13198(t){t.exports=function(t){return{name:"FlatNormal",additions:{fragmentProcess:"vec3 normal = vec3(0.0, 0.0, 1.0);"},tags:["LIGHTING"],disable:!!t}}},40829(t,e,i){var s=i(84220);t.exports=function(t){return{name:"NormalMap",additions:{fragmentHeader:s,fragmentProcess:"vec3 normal = getNormalFromMap(texCoord);"},tags:["LIGHTING"],disable:!!t}}},42792(t){t.exports=function(t){return{name:"TexCoordOut",additions:{fragmentProcess:"vec2 texCoord = outTexCoord;\n#pragma phaserTemplate(texCoord)"},tags:["TEXCOORD"],disable:!!t}}},96049(t,e,i){var s=i(2860);t.exports=function(t){return{name:"GetTexRes",additions:{fragmentHeader:s},tags:["TEXRES"],disable:!!t}}},33997(t,e,i){var s=i(46432);t.exports=function(t,e){void 0===t&&(t=1);for(var i="",r=1;r1&&(d=u.baseType===i.FLOAT?new Float32Array(c):new Int32Array(c)),this.glUniforms.set(l.name,{location:i.getUniformLocation(t,l.name),size:l.size,type:l.type,value:d})}},setUniform:function(t,e){this.uniformRequests.set(t,e)},bind:function(){this.renderer.glWrapper.updateBindingsProgram(this.glState),this.uniformRequests.each(this._processUniformRequest.bind(this)),this.uniformRequests.clear()},_processUniformRequest:function(t,e){var i=this.renderer,s=i.gl,n=this.glUniforms.get(t);if(n){var a=n.value;if(a.length){for(var o=!1,h=0;h1)c.setV.call(s,l,a);else switch(c.size){case 1:c.set.call(s,l,e);break;case 2:c.set.call(s,l,e[0],e[1]);break;case 3:c.set.call(s,l,e[0],e[1],e[2]);break;case 4:c.set.call(s,l,e[0],e[1],e[2],e[3])}}},destroy:function(){if(this.webGLProgram){var t=this.renderer.gl;if(!t.isContextLost()){this._vertexShader&&t.deleteShader(this._vertexShader),this._fragmentShader&&t.deleteShader(this._fragmentShader),t.deleteProgram(this.webGLProgram);for(var e=0;e=0;i--)this.units[i]=void 0,this.renderer.glWrapper.updateBindingsActiveTexture({bindings:{activeTexture:i}}),t.bindTexture(t.TEXTURE_2D,e),this.unitIndices[i]=i;t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array([0,0,255,255]))},bind:function(t,e,i,s){var r=this.units[e]!==t;if((i||!1!==s||r)&&this.renderer.glWrapper.updateBindingsActiveTexture({bindings:{activeTexture:e}},i),r||i){this.units[e]=t;var n=t?t.webGLTexture:null,a=this.renderer.gl;a.bindTexture(a.TEXTURE_2D,n),t&&t.needsMipmapRegeneration&&t.generateMipmap()}},bindUnits:function(t,e){for(var i=Math.min(t.length,this.renderer.maxTextures)-1;i>=0;i--)void 0!==t[i]&&this.bind(t[i],i,e,!1)},unbindTexture:function(t){for(var e=this.units.length-1;e>=0;e--)this.units[e]===t&&this.bind(null,e,!0,!1)},unbindAllUnits:function(){for(var t=this.units.length-1;t>=0;t--)this.bind(null,t,!0,!1)}});t.exports=s},82751(t,e,i){var s=i(83419),r=i(50030),n=new s({initialize:function(t,e,i,s,r,n,a,o,h,l,u,d,c){void 0===c&&(c=!0),this.renderer=t,this.webGLTexture=null,this.isRenderTexture=!1,this.mipLevel=e,this.minFilter=i,this.magFilter=s,this.wrapT=r,this.wrapS=n,this.format=a,this.pixels=o,this.width=h,this.height=l,this.pma=null==u||u,this.forceSize=!!d,this.flipY=!!c,this.__SPECTOR_Metadata={},this.batchUnit=-1,this.needsMipmapRegeneration=!1,this.createResource()},createResource:function(){var t=this.renderer.gl;if(!t.isContextLost())if(this.pixels instanceof n)this.webGLTexture=this.pixels.webGLTexture;else{var e=t.createTexture();e.__SPECTOR_Metadata=this.__SPECTOR_Metadata,this.webGLTexture=e,this._processTexture()}},resize:function(t,e){if(this.width!==t||this.height!==e){this.width=t,this.height=e;var i=this.renderer,s=i.gl,n=r(t,e);n?(this.wrapS=s.REPEAT,this.wrapT=s.REPEAT):(this.wrapS=s.CLAMP_TO_EDGE,this.wrapT=s.CLAMP_TO_EDGE),n&&i.mipmapFilter&&(!this.isRenderTexture||i.config.mipmapRegeneration)?this.minFilter=i.mipmapFilter:i.config.antialias?this.minFilter=s.LINEAR:this.minFilter=s.NEAREST,this._processTexture()}},update:function(t,e,i,s,r,n,a,o,h){0!==e&&0!==i&&(this.pixels=t,this.width=e,this.height=i,this.flipY=s,this.wrapS=r,this.wrapT=n,this.minFilter=a,this.magFilter=o,this.format=h,this._processTexture())},_processTexture:function(){var t=this.renderer.gl;this.renderer.glTextureUnits.bind(this,0),this.renderer.glWrapper.updateTexturing({texturing:{flipY:this.flipY,premultiplyAlpha:this.pma}}),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,this.minFilter),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,this.magFilter),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,this.wrapS),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,this.wrapT);var e=this.pixels,i=this.mipLevel,s=this.width,r=this.height,n=this.format;if(null==e)t.texImage2D(t.TEXTURE_2D,i,n,s,r,0,n,t.UNSIGNED_BYTE,null),this.generateMipmap();else if(e.compressed){s=e.width,r=e.height;for(var a=0;a0&&this.parentSize.height>0&&this.displaySize.setParent(this.parentSize),this.refresh()),t.events.on(h.PRE_STEP,this.step,this),t.events.once(h.READY,this.refresh,this),t.events.once(h.DESTROY,this.destroy,this),this.startListeners()},parseConfig:function(t){this.getParent(t),this.getParentBounds();var e=t.width,i=t.height,r=t.scaleMode,n=t.zoom,a=t.autoRound;if("string"==typeof e)if("%"!==e.substr(-1))e=parseInt(e,10);else{var o=this.parentSize.width;0===o&&(o=window.innerWidth);var h=parseInt(e,10)/100;e=Math.floor(o*h)}if("string"==typeof i)if("%"!==i.substr(-1))i=parseInt(i,10);else{var l=this.parentSize.height;0===l&&(l=window.innerHeight);var u=parseInt(i,10)/100;i=Math.floor(l*u)}this.scaleMode=r,this.autoRound=a,this.autoCenter=t.autoCenter,this.resizeInterval=t.resizeInterval,a&&(e=Math.floor(e),i=Math.floor(i)),this.gameSize.setSize(e,i),n===s.ZOOM.MAX_ZOOM&&(n=this.getMaxZoom()),this.zoom=n,1!==n&&(this._resetZoom=!0),this.baseSize.setSize(e,i),a&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),t.minWidth>0&&this.displaySize.setMin(t.minWidth*n,t.minHeight*n),t.maxWidth>0&&this.displaySize.setMax(t.maxWidth*n,t.maxHeight*n),this.displaySize.setSize(e,i),(t.snapWidth>0||t.snapHeight>0)&&this.displaySize.setSnap(t.snapWidth,t.snapHeight),this.orientation=d(e,i)},getParent:function(t){var e=t.parent;if(null!==e){if(this.parent=u(e),this.parentIsWindow=this.parent===document.body,t.expandParent&&t.scaleMode!==s.SCALE_MODE.NONE){var i=this.parent.getBoundingClientRect();(this.parentIsWindow||0===i.height)&&(document.documentElement.style.height="100%",document.body.style.height="100%",i=this.parent.getBoundingClientRect(),this.parentIsWindow||0!==i.height||(this.parent.style.overflow="hidden",this.parent.style.width="100%",this.parent.style.height="100%"))}t.fullscreenTarget&&!this.fullscreenTarget&&(this.fullscreenTarget=u(t.fullscreenTarget))}},getParentBounds:function(){if(!this.parent)return!1;var t=this.parentSize,e=this.parent.getBoundingClientRect();this.parentIsWindow&&this.game.device.os.iOS&&(e.height=l(!0));var i=e.width,s=e.height;if(t.width!==i||t.height!==s)return t.setSize(i,s),!0;if(this.canvas){var r=this.canvasBounds,n=this.canvas.getBoundingClientRect();if(n.x!==r.x||n.y!==r.y)return!0}return!1},lockOrientation:function(t){var e=screen.lockOrientation||screen.mozLockOrientation||screen.msLockOrientation;return!!e&&e.call(screen,t)},setParentSize:function(t,e){return this.parentSize.setSize(t,e),this.refresh()},setGameSize:function(t,e){var i=this.autoRound;i&&(t=Math.floor(t),e=Math.floor(e));var s=this.width,r=this.height;return this.gameSize.resize(t,e),this.baseSize.resize(t,e),i&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setAspectRatio(t/e),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height,this.refresh(s,r)},resize:function(t,e){var i=this.zoom,s=this.autoRound;s&&(t=Math.floor(t),e=Math.floor(e));var r=this.width,n=this.height;this.gameSize.resize(t,e),this.baseSize.resize(t,e),s&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setSize(t*i,e*i),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height;var a=this.canvas.style,o=t*i,h=e*i;return s&&(o=Math.floor(o),h=Math.floor(h)),o===t&&h===e||(a.width=o+"px",a.height=h+"px"),this.refresh(r,n)},setZoom:function(t){return this.zoom=t,this._resetZoom=!0,this.refresh()},setMaxZoom:function(){return this.zoom=this.getMaxZoom(),this._resetZoom=!0,this.refresh()},setSnap:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.displaySize.setSnap(t,e),this.refresh()},refresh:function(t,e){void 0===t&&(t=this.width),void 0===e&&(e=this.height),this.updateScale(),this.updateBounds(),this.updateOrientation(),this.displayScale.set(this.baseSize.width/this.canvasBounds.width,this.baseSize.height/this.canvasBounds.height);var i=this.game.domContainer;if(i){this.baseSize.setCSS(i);var s=this.canvas.style,r=i.style;r.transform="scale("+this.displaySize.width/this.baseSize.width+","+this.displaySize.height/this.baseSize.height+")",r.marginLeft=s.marginLeft,r.marginTop=s.marginTop}return this.emit(o.RESIZE,this.gameSize,this.baseSize,this.displaySize,t,e),this},updateOrientation:function(){if(this._checkOrientation){this._checkOrientation=!1;var t=d(this.width,this.height);t!==this.orientation&&(this.orientation=t,this.emit(o.ORIENTATION_CHANGE,t))}},updateScale:function(){var t,e,i=this.canvas.style,r=this.gameSize.width,a=this.gameSize.height,o=this.zoom,h=this.autoRound;if(this.scaleMode===s.SCALE_MODE.NONE)this.displaySize.setSize(r*o,a*o),t=this.displaySize.width,e=this.displaySize.height,h&&(t=Math.floor(t),e=Math.floor(e)),this._resetZoom&&(i.width=t+"px",i.height=e+"px",this._resetZoom=!1);else if(this.scaleMode===s.SCALE_MODE.RESIZE)this.displaySize.setSize(this.parentSize.width,this.parentSize.height),this.gameSize.setSize(this.displaySize.width,this.displaySize.height),this.baseSize.setSize(this.displaySize.width,this.displaySize.height),t=this.displaySize.width,e=this.displaySize.height,h&&(t=Math.floor(t),e=Math.floor(e)),this.canvas.width=t,this.canvas.height=e;else if(this.scaleMode===s.SCALE_MODE.EXPAND){var l,u,d=this.game.config.width,c=this.game.config.height,f=this.parentSize.width,p=this.parentSize.height,m=f/d,g=p/c;m=0?0:-a.x*o.x,l=a.y>=0?0:-a.y*o.y;return i=n.width>=a.width?r.width:r.width-(a.width-n.width)*o.x,s=n.height>=a.height?r.height:r.height-(a.height-n.height)*o.y,e.setTo(h,l,i,s),t&&(e.width/=t.zoomX,e.height/=t.zoomY,e.centerX=t.centerX+t.scrollX,e.centerY=t.centerY+t.scrollY),e},step:function(t,e){this.parent&&(this._lastCheck+=e,(this.dirty||this._lastCheck>this.resizeInterval)&&(this.getParentBounds()&&this.refresh(),this.dirty=!1,this._lastCheck=0))},stopListeners:function(){var t=this.domlisteners;screen.orientation&&screen.orientation.addEventListener?screen.orientation.removeEventListener("change",t.orientationChange,!1):window.removeEventListener("orientationchange",t.orientationChange,!1),window.removeEventListener("resize",t.windowResize,!1);["webkit","moz",""].forEach(function(e){document.removeEventListener(e+"fullscreenchange",t.fullScreenChange,!1),document.removeEventListener(e+"fullscreenerror",t.fullScreenError,!1)}),document.removeEventListener("MSFullscreenChange",t.fullScreenChange,!1),document.removeEventListener("MSFullscreenError",t.fullScreenError,!1)},destroy:function(){this.removeAllListeners(),this.stopListeners(),this.game=null,this.canvas=null,this.canvasBounds=null,this.parent=null,this.fullscreenTarget=null,this.parentSize.destroy(),this.gameSize.destroy(),this.baseSize.destroy(),this.displaySize.destroy()},isFullscreen:{get:function(){return this.fullscreen.active}},width:{get:function(){return this.gameSize.width}},height:{get:function(){return this.gameSize.height}},isPortrait:{get:function(){return this.orientation===s.ORIENTATION.PORTRAIT}},isLandscape:{get:function(){return this.orientation===s.ORIENTATION.LANDSCAPE}},isGamePortrait:{get:function(){return this.height>this.width}},isGameLandscape:{get:function(){return this.width>this.height}}});t.exports=x},64743(t){t.exports={NO_CENTER:0,CENTER_BOTH:1,CENTER_HORIZONTALLY:2,CENTER_VERTICALLY:3}},39218(t){t.exports={LANDSCAPE:"landscape-primary",LANDSCAPE_SECONDARY:"landscape-secondary",PORTRAIT:"portrait-primary",PORTRAIT_SECONDARY:"portrait-secondary"}},81050(t){t.exports={NONE:0,WIDTH_CONTROLS_HEIGHT:1,HEIGHT_CONTROLS_WIDTH:2,FIT:3,ENVELOP:4,RESIZE:5,EXPAND:6}},80805(t){t.exports={NO_ZOOM:1,ZOOM_2X:2,ZOOM_4X:4,MAX_ZOOM:-1}},13560(t,e,i){var s={CENTER:i(64743),ORIENTATION:i(39218),SCALE_MODE:i(81050),ZOOM:i(80805)};t.exports=s},56139(t){t.exports="enterfullscreen"},2336(t){t.exports="fullscreenfailed"},47412(t){t.exports="fullscreenunsupported"},51452(t){t.exports="leavefullscreen"},20666(t){t.exports="orientationchange"},47945(t){t.exports="resize"},97480(t,e,i){t.exports={ENTER_FULLSCREEN:i(56139),FULLSCREEN_FAILED:i(2336),FULLSCREEN_UNSUPPORTED:i(47412),LEAVE_FULLSCREEN:i(51452),ORIENTATION_CHANGE:i(20666),RESIZE:i(47945)}},93364(t,e,i){var s=i(79291),r=i(13560),n={Center:i(64743),Events:i(97480),Orientation:i(39218),ScaleManager:i(76531),ScaleModes:i(81050),Zoom:i(80805)};n=s(!1,n,r.CENTER),n=s(!1,n,r.ORIENTATION),n=s(!1,n,r.SCALE_MODE),n=s(!1,n,r.ZOOM),t.exports=n},27397(t,e,i){var s=i(95540),r=i(35355);t.exports=function(t){var e=t.game.config.defaultPhysicsSystem,i=s(t.settings,"physics",!1);if(e||i){var n=[];if(e&&n.push(r(e+"Physics")),i)for(var a in i)a=r(a.concat("Physics")),-1===n.indexOf(a)&&n.push(a);return n}}},52106(t,e,i){var s=i(95540);t.exports=function(t){var e=t.plugins.getDefaultScenePlugins(),i=s(t.settings,"plugins",!1);return Array.isArray(i)?i:e||[]}},87033(t){t.exports={game:"game",renderer:"renderer",anims:"anims",cache:"cache",plugins:"plugins",registry:"registry",scale:"scale",sound:"sound",textures:"textures",events:"events",cameras:"cameras",add:"add",make:"make",scenePlugin:"scene",displayList:"children",lights:"lights",data:"data",input:"input",load:"load",time:"time",tweens:"tweens",arcadePhysics:"physics",matterPhysics:"matter"}},97482(t,e,i){var s=i(83419),r=i(2368),n=new s({initialize:function(t){this.sys=new r(this,t),this.game,this.anims,this.cache,this.registry,this.sound,this.textures,this.events,this.cameras,this.add,this.make,this.scene,this.children,this.lights,this.data,this.input,this.load,this.time,this.tweens,this.physics,this.matter,this.scale,this.plugins,this.renderer},update:function(){}});t.exports=n},60903(t,e,i){var s=i(83419),r=i(89993),n=i(44594),a=i(8443),o=i(35154),h=i(54899),l=i(29747),u=i(97482),d=i(2368),c=new s({initialize:function(t,e){if(this.game=t,this.keys={},this.scenes=[],this._pending=[],this._start=[],this._queue=[],this._data={},this.isProcessing=!1,this.isBooted=!1,this.customViewports=0,this.systemScene,e){Array.isArray(e)||(e=[e]);for(var i=0;i-1&&(delete this.keys[s],this.scenes.splice(i,1),this._start.indexOf(s)>-1&&(i=this._start.indexOf(s),this._start.splice(i,1)),e.sys.destroy()),this},bootScene:function(t){var e,i=t.sys,s=i.settings;i.sceneUpdate=l,t.init&&(t.init.call(t,s.data),s.status=r.INIT,s.isTransition&&i.events.emit(n.TRANSITION_INIT,s.transitionFrom,s.transitionDuration)),i.load&&(e=i.load).reset(),e&&t.preload?(t.preload.call(t),s.status=r.LOADING,e.once(h.COMPLETE,this.loadComplete,this),e.start()):this.create(t)},loadComplete:function(t){this.create(t.scene)},payloadComplete:function(t){this.bootScene(t.scene)},update:function(t,e){this.processQueue(),this.isProcessing=!0;for(var i=this.scenes.length-1;i>=0;i--){var s=this.scenes[i].sys;s.settings.status>r.START&&s.settings.status<=r.RUNNING&&s.step(t,e),s.scenePlugin&&s.scenePlugin._target&&s.scenePlugin.step(t,e)}},render:function(t){for(var e=0;e=r.LOADING&&i.settings.status=r.START&&a<=r.CREATING)return this;if(a>=r.RUNNING&&a<=r.SLEEPING)n.shutdown(),n.sceneUpdate=l,n.start(e);else if(n.sceneUpdate=l,n.start(e),n.load&&(s=n.load),s&&n.settings.hasOwnProperty("pack")&&(s.reset(),s.addPack({payload:n.settings.pack})))return n.settings.status=r.LOADING,s.once(h.COMPLETE,this.payloadComplete,this),s.start(),this;return this.bootScene(i),this},stop:function(t,e){var i=this.getScene(t);if(i&&!i.sys.isTransitioning()&&i.sys.settings.status!==r.SHUTDOWN){var s=i.sys.load;s&&(s.off(h.COMPLETE,this.loadComplete,this),s.off(h.COMPLETE,this.payloadComplete,this)),i.sys.shutdown(e)}return this},switch:function(t,e,i){var s=this.getScene(t),r=this.getScene(e);return s&&r&&s!==r&&(this.sleep(t),this.isSleeping(e)?this.wake(e,i):this.start(e,i)),this},getAt:function(t){return this.scenes[t]},getIndex:function(t){var e=this.getScene(t);return this.scenes.indexOf(e)},bringToTop:function(t){if(this.isProcessing)return this.queueOp("bringToTop",t);var e=this.getIndex(t),i=this.scenes;if(-1!==e&&e0){var i=this.getScene(t);this.scenes.splice(e,1),this.scenes.unshift(i)}return this},moveDown:function(t){if(this.isProcessing)return this.queueOp("moveDown",t);var e=this.getIndex(t);if(e>0){var i=e-1,s=this.getScene(t),r=this.getAt(i);this.scenes[e]=r,this.scenes[i]=s}return this},moveUp:function(t){if(this.isProcessing)return this.queueOp("moveUp",t);var e=this.getIndex(t);if(ei),0,r)}return this},moveBelow:function(t,e){if(t===e)return this;if(this.isProcessing)return this.queueOp("moveBelow",t,e);var i=this.getIndex(t),s=this.getIndex(e);if(-1!==i&&-1!==s&&s>i){var r=this.getAt(s);this.scenes.splice(s,1),0===i?this.scenes.unshift(r):this.scenes.splice(i-(s=this._duration&&this.transitionComplete()},transitionComplete:function(){var t=this._target.sys,e=this._target.sys.settings;t.events.emit(n.TRANSITION_COMPLETE,this.scene),e.isTransition=!1,e.transitionFrom=null,this._duration=0,this._target=null,this._onUpdate=null,this._onUpdateScope=null,this._willRemove?this.manager.remove(this.key):this._willSleep?this.systems.sleep():this.manager.stop(this.key)},add:function(t,e,i,s){return this.manager.add(t,e,i,s)},launch:function(t,e){return t&&t!==this.key&&this.manager.queueOp("start",t,e),this},run:function(t,e){return t&&t!==this.key&&this.manager.queueOp("run",t,e),this},pause:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("pause",t,e),this},resume:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("resume",t,e),this},sleep:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("sleep",t,e),this},wake:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("wake",t,e),this},switch:function(t,e){return t!==this.key&&this.manager.queueOp("switch",this.key,t,e),this},stop:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("stop",t,e),this},setActive:function(t,e,i){void 0===e&&(e=this.key);var s=this.manager.getScene(e);return s&&s.sys.setActive(t,i),this},setVisible:function(t,e){void 0===e&&(e=this.key);var i=this.manager.getScene(e);return i&&i.sys.setVisible(t),this},isSleeping:function(t){return void 0===t&&(t=this.key),this.manager.isSleeping(t)},isActive:function(t){return void 0===t&&(t=this.key),this.manager.isActive(t)},isPaused:function(t){return void 0===t&&(t=this.key),this.manager.isPaused(t)},isVisible:function(t){return void 0===t&&(t=this.key),this.manager.isVisible(t)},swapPosition:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.swapPosition(t,e),this},moveAbove:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveAbove(t,e),this},moveBelow:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveBelow(t,e),this},remove:function(t){return void 0===t&&(t=this.key),this.manager.remove(t),this},moveUp:function(t){return void 0===t&&(t=this.key),this.manager.moveUp(t),this},moveDown:function(t){return void 0===t&&(t=this.key),this.manager.moveDown(t),this},bringToTop:function(t){return void 0===t&&(t=this.key),this.manager.bringToTop(t),this},sendToBack:function(t){return void 0===t&&(t=this.key),this.manager.sendToBack(t),this},get:function(t){return this.manager.getScene(t)},getStatus:function(t){var e=this.manager.getScene(t);if(e)return e.sys.getStatus()},getIndex:function(t){return void 0===t&&(t=this.key),this.manager.getIndex(t)},shutdown:function(){var t=this.systems.events;t.off(n.SHUTDOWN,this.shutdown,this),t.off(n.TRANSITION_OUT)},destroy:function(){this.shutdown(),this.scene.sys.events.off(n.START,this.start,this),this.scene=null,this.systems=null,this.settings=null,this.manager=null}});o.register("ScenePlugin",h,"scenePlugin"),t.exports=h},55681(t,e,i){var s=i(89993),r=i(35154),n=i(46975),a=i(87033),o={create:function(t){return"string"==typeof t?t={key:t}:void 0===t&&(t={}),{status:s.PENDING,key:r(t,"key",""),active:r(t,"active",!1),visible:r(t,"visible",!0),isBooted:!1,isTransition:!1,transitionFrom:null,transitionDuration:0,transitionAllowInput:!0,data:{},pack:r(t,"pack",!1),cameras:r(t,"cameras",null),map:r(t,"map",n(a,r(t,"mapAdd",{}))),physics:r(t,"physics",{}),loader:r(t,"loader",{}),plugins:r(t,"plugins",!1),input:r(t,"input",{})}}};t.exports=o},2368(t,e,i){var s=i(83419),r=i(89993),n=i(42363),a=i(44594),o=i(27397),h=i(52106),l=i(29747),u=i(55681),d=new s({initialize:function(t,e){this.scene=t,this.game,this.renderer,this.config=e,this.settings=u.create(e),this.canvas,this.context,this.anims,this.cache,this.plugins,this.registry,this.scale,this.sound,this.textures,this.add,this.cameras,this.displayList,this.events,this.make,this.scenePlugin,this.updateList,this.sceneUpdate=l},init:function(t){this.settings.status=r.INIT,this.sceneUpdate=l,this.game=t,this.renderer=t.renderer,this.canvas=t.canvas,this.context=t.context;var e=t.plugins;this.plugins=e,e.addToScene(this,n.Global,[n.CoreScene,h(this),o(this)]),this.events.emit(a.BOOT,this),this.settings.isBooted=!0},step:function(t,e){var i=this.events;i.emit(a.PRE_UPDATE,t,e),i.emit(a.UPDATE,t,e),this.sceneUpdate.call(this.scene,t,e),i.emit(a.POST_UPDATE,t,e)},render:function(t){var e=this.displayList;e.depthSort(),this.events.emit(a.PRE_RENDER,t),this.cameras.render(t,e),this.events.emit(a.RENDER,t)},queueDepthSort:function(){this.displayList.queueDepthSort()},depthSort:function(){this.displayList.depthSort()},pause:function(t){var e=this.settings,i=this.getStatus();return i!==r.CREATING&&i!==r.RUNNING?console.warn("Cannot pause non-running Scene",e.key):this.settings.active&&(e.status=r.PAUSED,e.active=!1,this.events.emit(a.PAUSE,this,t)),this},resume:function(t){var e=this.events,i=this.settings;return this.settings.active||(i.status=r.RUNNING,i.active=!0,e.emit(a.RESUME,this,t)),this},sleep:function(t){var e=this.settings,i=this.getStatus();return i!==r.CREATING&&i!==r.RUNNING?console.warn("Cannot sleep non-running Scene",e.key):(e.status=r.SLEEPING,e.active=!1,e.visible=!1,this.events.emit(a.SLEEP,this,t)),this},wake:function(t){var e=this.events,i=this.settings;return i.status=r.RUNNING,i.active=!0,i.visible=!0,e.emit(a.WAKE,this,t),i.isTransition&&e.emit(a.TRANSITION_WAKE,i.transitionFrom,i.transitionDuration),this},getData:function(){return this.settings.data},getStatus:function(){return this.settings.status},canInput:function(){var t=this.settings.status;return t>r.PENDING&&t<=r.RUNNING},isSleeping:function(){return this.settings.status===r.SLEEPING},isActive:function(){return this.settings.status===r.RUNNING},isPaused:function(){return this.settings.status===r.PAUSED},isTransitioning:function(){return this.settings.isTransition||null!==this.scenePlugin._target},isTransitionOut:function(){return null!==this.scenePlugin._target&&this.scenePlugin._duration>0},isTransitionIn:function(){return this.settings.isTransition},isVisible:function(){return this.settings.visible},setVisible:function(t){return this.settings.visible=t,this},setActive:function(t,e){return t?this.resume(e):this.pause(e)},start:function(t){var e=this.events,i=this.settings;t&&(i.data=t),i.status=r.START,i.active=!0,i.visible=!0,e.emit(a.START,this),e.emit(a.READY,this,t)},shutdown:function(t){var e=this.events,i=this.settings;e.off(a.TRANSITION_INIT),e.off(a.TRANSITION_START),e.off(a.TRANSITION_COMPLETE),e.off(a.TRANSITION_OUT),i.status=r.SHUTDOWN,i.active=!1,i.visible=!1,e.emit(a.SHUTDOWN,this,t)},destroy:function(){var t=this.events,e=this.settings;e.status=r.DESTROYED,e.active=!1,e.visible=!1,t.emit(a.DESTROY,this),t.removeAllListeners();for(var i=["scene","game","anims","cache","plugins","registry","sound","textures","add","cameras","displayList","events","make","scenePlugin","updateList"],s=0;s=0;i--){var s=this.sounds[i];s.key===t&&(s.destroy(),this.sounds.splice(i,1),e++)}return e},pauseAll:function(){this.forEachActiveSound(function(t){t.pause()}),this.emit(a.PAUSE_ALL,this)},resumeAll:function(){this.forEachActiveSound(function(t){t.resume()}),this.emit(a.RESUME_ALL,this)},setListenerPosition:u,stopAll:function(){this.forEachActiveSound(function(t){t.stop()}),this.emit(a.STOP_ALL,this)},stopByKey:function(t){var e=0;return this.getAll(t).forEach(function(t){t.stop()&&e++}),e},isPlaying:function(t){var e,i=this.sounds.length-1;if(void 0===t){for(;i>=0;i--)if((e=this.sounds[i]).isPlaying)return!0}else for(;i>=0;i--)if((e=this.sounds[i]).key===t&&e.isPlaying)return!0;return!1},unlock:u,onBlur:u,onFocus:u,onGameBlur:function(){this.gameLostFocus=!0,this.pauseOnBlur&&this.onBlur()},onGameFocus:function(){this.gameLostFocus=!1,this.pauseOnBlur&&this.onFocus()},update:function(t,e){this.unlocked&&(this.unlocked=!1,this.locked=!1,this.emit(a.UNLOCKED,this));for(var i=this.sounds.length-1;i>=0;i--)this.sounds[i].pendingRemove&&this.sounds.splice(i,1);this.sounds.forEach(function(i){i.update(t,e)})},destroy:function(){this.game.events.off(o.BLUR,this.onGameBlur,this),this.game.events.off(o.FOCUS,this.onGameFocus,this),this.game.events.off(o.PRE_STEP,this.update,this),this.removeAllListeners(),this.removeAll(),this.sounds.length=0,this.sounds=null,this.listenerPosition=null,this.game=null},forEachActiveSound:function(t,e){var i=this;this.sounds.forEach(function(s,r){s&&!s.pendingRemove&&t.call(e||i,s,r,i.sounds)})},setRate:function(t){return this.rate=t,this},rate:{get:function(){return this._rate},set:function(t){this._rate=t,this.forEachActiveSound(function(t){t.calculateRate()}),this.emit(a.GLOBAL_RATE,this,t)}},setDetune:function(t){return this.detune=t,this},detune:{get:function(){return this._detune},set:function(t){this._detune=t,this.forEachActiveSound(function(t){t.calculateRate()}),this.emit(a.GLOBAL_DETUNE,this,t)}}});t.exports=c},14747(t,e,i){var s=i(33684),r=i(25960),n=i(57490),a={create:function(t){var e=t.config.audio,i=t.device.audio;return e.noAudio||!i.webAudio&&!i.audioData?new r(t):i.webAudio&&!e.disableWebAudio?new n(t):new s(t)}};t.exports=a},19723(t){t.exports="complete"},98882(t){t.exports="decodedall"},57506(t){t.exports="decoded"},73146(t){t.exports="destroy"},11305(t){t.exports="detune"},40577(t){t.exports="detune"},30333(t){t.exports="mute"},20394(t){t.exports="rate"},21802(t){t.exports="volume"},1299(t){t.exports="looped"},99190(t){t.exports="loop"},97125(t){t.exports="mute"},89259(t){t.exports="pan"},79986(t){t.exports="pauseall"},17586(t){t.exports="pause"},19618(t){t.exports="play"},42306(t){t.exports="rate"},10387(t){t.exports="resumeall"},48959(t){t.exports="resume"},9960(t){t.exports="seek"},19180(t){t.exports="stopall"},98328(t){t.exports="stop"},50401(t){t.exports="unlocked"},52498(t){t.exports="volume"},14463(t,e,i){t.exports={COMPLETE:i(19723),DECODED:i(57506),DECODED_ALL:i(98882),DESTROY:i(73146),DETUNE:i(11305),GLOBAL_DETUNE:i(40577),GLOBAL_MUTE:i(30333),GLOBAL_RATE:i(20394),GLOBAL_VOLUME:i(21802),LOOP:i(99190),LOOPED:i(1299),MUTE:i(97125),PAN:i(89259),PAUSE_ALL:i(79986),PAUSE:i(17586),PLAY:i(19618),RATE:i(42306),RESUME_ALL:i(10387),RESUME:i(48959),SEEK:i(9960),STOP_ALL:i(19180),STOP:i(98328),UNLOCKED:i(50401),VOLUME:i(52498)}},64895(t,e,i){var s=i(30341),r=i(83419),n=i(14463),a=i(45319),o=new r({Extends:s,initialize:function(t,e,i){if(void 0===i&&(i={}),this.tags=t.game.cache.audio.get(e),!this.tags)throw new Error('No cached audio asset with key "'+e);this.audio=null,this.startTime=0,this.previousTime=0,this.duration=this.tags[0].duration,this.totalDuration=this.tags[0].duration,s.call(this,t,e,i)},play:function(t,e){return!this.manager.isLocked(this,"play",[t,e])&&(!!s.prototype.play.call(this,t,e)&&(!!this.pickAndPlayAudioTag()&&(this.emit(n.PLAY,this),!0)))},pause:function(){return!this.manager.isLocked(this,"pause")&&(!(this.startTime>0)&&(!!s.prototype.pause.call(this)&&(this.currentConfig.seek=this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0),this.stopAndReleaseAudioTag(),this.emit(n.PAUSE,this),!0)))},resume:function(){return!this.manager.isLocked(this,"resume")&&(!(this.startTime>0)&&(!!s.prototype.resume.call(this)&&(!!this.pickAndPlayAudioTag()&&(this.emit(n.RESUME,this),!0))))},stop:function(){return!this.manager.isLocked(this,"stop")&&(!!s.prototype.stop.call(this)&&(this.stopAndReleaseAudioTag(),this.emit(n.STOP,this),!0))},pickAndPlayAudioTag:function(){if(!this.pickAudioTag())return this.reset(),!1;var t=this.currentConfig.seek,e=this.currentConfig.delay,i=(this.currentMarker?this.currentMarker.start:0)+t;return this.previousTime=i,this.audio.currentTime=i,this.applyConfig(),0===e?(this.startTime=0,this.audio.paused&&this.playCatchPromise()):(this.startTime=window.performance.now()+1e3*e,this.audio.paused||this.audio.pause()),this.resetConfig(),!0},pickAudioTag:function(){if(this.audio)return!0;for(var t=0;t0)this.startTime=i-this.manager.loopEndOffset?(this.audio.currentTime=e+Math.max(0,s-i),s=this.audio.currentTime):s=i)return this.reset(),this.stopAndReleaseAudioTag(),void this.emit(n.COMPLETE,this);this.previousTime=s}},destroy:function(){s.prototype.destroy.call(this),this.tags=null,this.audio&&this.stopAndReleaseAudioTag()},updateMute:function(){this.audio&&(this.audio.muted=this.currentConfig.mute||this.manager.mute)},updateVolume:function(){this.audio&&(this.audio.volume=a(this.currentConfig.volume*this.manager.volume,0,1))},calculateRate:function(){s.prototype.calculateRate.call(this),this.audio&&(this.audio.playbackRate=this.totalRate)},mute:{get:function(){return this.currentConfig.mute},set:function(t){this.currentConfig.mute=t,this.manager.isLocked(this,"mute",t)||(this.updateMute(),this.emit(n.MUTE,this,t))}},setMute:function(t){return this.mute=t,this},volume:{get:function(){return this.currentConfig.volume},set:function(t){this.currentConfig.volume=t,this.manager.isLocked(this,"volume",t)||(this.updateVolume(),this.emit(n.VOLUME,this,t))}},setVolume:function(t){return this.volume=t,this},rate:{get:function(){return this.currentConfig.rate},set:function(t){this.currentConfig.rate=t,this.manager.isLocked(this,n.RATE,t)||(this.calculateRate(),this.emit(n.RATE,this,t))}},setRate:function(t){return this.rate=t,this},detune:{get:function(){return this.currentConfig.detune},set:function(t){this.currentConfig.detune=t,this.manager.isLocked(this,n.DETUNE,t)||(this.calculateRate(),this.emit(n.DETUNE,this,t))}},setDetune:function(t){return this.detune=t,this},seek:{get:function(){return this.isPlaying?this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0):this.isPaused?this.currentConfig.seek:0},set:function(t){this.manager.isLocked(this,"seek",t)||this.startTime>0||(this.isPlaying||this.isPaused)&&(t=Math.min(Math.max(0,t),this.duration),this.isPlaying?(this.previousTime=t,this.audio.currentTime=t):this.isPaused&&(this.currentConfig.seek=t),this.emit(n.SEEK,this,t))}},setSeek:function(t){return this.seek=t,this},loop:{get:function(){return this.currentConfig.loop},set:function(t){this.currentConfig.loop=t,this.manager.isLocked(this,"loop",t)||(this.audio&&(this.audio.loop=t),this.emit(n.LOOP,this,t))}},setLoop:function(t){return this.loop=t,this},pan:{get:function(){return this.currentConfig.pan},set:function(t){this.currentConfig.pan=t,this.emit(n.PAN,this,t)}},setPan:function(t){return this.pan=t,this}});t.exports=o},33684(t,e,i){var s=i(85034),r=i(83419),n=i(14463),a=i(64895),o=new r({Extends:s,initialize:function(t){this.override=!0,this.audioPlayDelay=.1,this.loopEndOffset=.05,this.onBlurPausedSounds=[],this.locked="ontouchstart"in window,this.lockedActionsQueue=this.locked?[]:null,this._mute=!1,this._volume=1,s.call(this,t)},add:function(t,e){var i=new a(this,t,e);return this.sounds.push(i),i},unlock:function(){this.locked=!1;var t=this;if(this.game.cache.audio.entries.each(function(e,i){for(var s=0;s-1},setAll:function(t,e,i,r){return s.SetAll(this.list,t,e,i,r),this},each:function(t,e){for(var i=[null],s=2;s0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}}});t.exports=o},90330(t,e,i){var s=new(i(83419))({initialize:function(t){this.entries={},this.size=0,this.setAll(t)},setAll:function(t){if(Array.isArray(t))for(var e=0;e-1},isPending:function(t){return this._toProcess>0&&this._pending.indexOf(t)>-1},isDestroying:function(t){return this._destroy.indexOf(t)>-1},add:function(t){return this.checkQueue&&this.isActive(t)&&!this.isDestroying(t)||this.isPending(t)||(this._pending.push(t),this._toProcess++),t},remove:function(t){if(this.isPending(t)){var e=this._pending,i=e.indexOf(t);-1!==i&&e.splice(i,1)}else this.isActive(t)&&(this._destroy.push(t),this._toProcess++);return t},removeAll:function(){for(var t=this._active,e=this._destroy,i=t.length;i--;)e.push(t[i]),this._toProcess++;return this},update:function(){if(0===this._toProcess)return this._active;var t,e,i=this._destroy,s=this._active;for(t=0;t=t.minX&&e.maxY>=t.minY}function v(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function x(t,e,i,r,n){for(var a,o=[e,i];o.length;)(i=o.pop())-(e=o.pop())<=r||(a=e+Math.ceil((i-e)/r/2)*r,s(t,a,e,i,n),o.push(e,a,a,i))}r.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],s=this.toBBox;if(!g(t,e))return i;for(var r,n,a,o,h=[];e;){for(r=0,n=e.children.length;r=0&&n[e].children.length>this._maxEntries;)this._split(n,e),e--;this._adjustParentBBoxes(r,n,e)},_split:function(t,e){var i=t[e],s=i.children.length,r=this._minEntries;this._chooseSplitAxis(i,r,s);var n=this._chooseSplitIndex(i,r,s),o=v(i.children.splice(n,i.children.length-n));o.height=i.height,o.leaf=i.leaf,a(i,this.toBBox),a(o,this.toBBox),e?t[e-1].children.push(o):this._splitRoot(i,o)},_splitRoot:function(t,e){this.data=v([t,e]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var s,r,n,a,h,l,u,c;for(l=u=1/0,s=e;s<=i-e;s++)a=p(r=o(t,0,s,this.toBBox),n=o(t,s,i,this.toBBox)),h=d(r)+d(n),a=e;r--)n=t.children[r],h(u,t.leaf?a(n):n),d+=c(u);return d},_adjustParentBBoxes:function(t,e,i){for(var s=i;s>=0;s--)h(e[s],t)},_condense:function(t){for(var e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():a(t[i],this.toBBox)},compareMinX:function(t,e){return t.left-e.left},compareMinY:function(t,e){return t.top-e.top},toBBox:function(t){return{minX:t.left,minY:t.top,maxX:t.right,maxY:t.bottom}}},t.exports=r},86555(t,e,i){var s=i(45319),r=i(83419),n=i(56583),a=i(26099),o=new r({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===s&&(s=null),this._width=t,this._height=e,this._parent=s,this.aspectMode=i,this.aspectRatio=0===e?1:t/e,this.minWidth=0,this.minHeight=0,this.maxWidth=Number.MAX_VALUE,this.maxHeight=Number.MAX_VALUE,this.snapTo=new a},setAspectMode:function(t){return void 0===t&&(t=0),this.aspectMode=t,this.setSize(this._width,this._height)},setSnap:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.snapTo.set(t,e),this.setSize(this._width,this._height)},setParent:function(t){return this._parent=t,this.setSize(this._width,this._height)},setMin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.minWidth=s(t,0,this.maxWidth),this.minHeight=s(e,0,this.maxHeight),this.setSize(this._width,this._height)},setMax:function(t,e){return void 0===t&&(t=Number.MAX_VALUE),void 0===e&&(e=t),this.maxWidth=s(t,this.minWidth,Number.MAX_VALUE),this.maxHeight=s(e,this.minHeight,Number.MAX_VALUE),this.setSize(this._width,this._height)},setSize:function(t,e){switch(void 0===t&&(t=0),void 0===e&&(e=t),this.aspectMode){case o.NONE:this._width=this.getNewWidth(n(t,this.snapTo.x)),this._height=this.getNewHeight(n(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height;break;case o.WIDTH_CONTROLS_HEIGHT:this._width=this.getNewWidth(n(t,this.snapTo.x)),this._height=this.getNewHeight(this._width*(1/this.aspectRatio),!1);break;case o.HEIGHT_CONTROLS_WIDTH:this._height=this.getNewHeight(n(e,this.snapTo.y)),this._width=this.getNewWidth(this._height*this.aspectRatio,!1);break;case o.FIT:this.constrain(t,e,!0);break;case o.ENVELOP:this.constrain(t,e,!1)}return this},setAspectRatio:function(t){return this.aspectRatio=t,this.setSize(this._width,this._height)},resize:function(t,e){return this._width=this.getNewWidth(n(t,this.snapTo.x)),this._height=this.getNewHeight(n(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height,this},getNewWidth:function(t,e){return void 0===e&&(e=!0),t=s(t,this.minWidth,this.maxWidth),e&&this._parent&&t>this._parent.width&&(t=Math.max(this.minWidth,this._parent.width)),t},getNewHeight:function(t,e){return void 0===e&&(e=!0),t=s(t,this.minHeight,this.maxHeight),e&&this._parent&&t>this._parent.height&&(t=Math.max(this.minHeight,this._parent.height)),t},constrain:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=!0),t=this.getNewWidth(t),e=this.getNewHeight(e);var s=this.snapTo,r=0===e?1:t/e;return i&&this.aspectRatio>r||!i&&this.aspectRatio0&&(t=(e=n(e,s.y))*this.aspectRatio)):(i&&this.aspectRatior)&&(t=(e=n(e,s.y))*this.aspectRatio,s.x>0&&(e=(t=n(t,s.x))*(1/this.aspectRatio))),this._width=t,this._height=e,this},fitTo:function(t,e){return this.constrain(t,e,!0)},envelop:function(t,e){return this.constrain(t,e,!1)},setWidth:function(t){return this.setSize(t,this._height)},setHeight:function(t){return this.setSize(this._width,t)},toString:function(){return"[{ Size (width="+this._width+" height="+this._height+" aspectRatio="+this.aspectRatio+" aspectMode="+this.aspectMode+") }]"},setCSS:function(t){t&&t.style&&(t.style.width=this._width+"px",t.style.height=this._height+"px")},copy:function(t){return t.setAspectMode(this.aspectMode),t.aspectRatio=this.aspectRatio,t.setSize(this.width,this.height)},destroy:function(){this._parent=null,this.snapTo=null},width:{get:function(){return this._width},set:function(t){this.setSize(t,this._height)}},height:{get:function(){return this._height},set:function(t){this.setSize(this._width,t)}}});o.NONE=0,o.WIDTH_CONTROLS_HEIGHT=1,o.HEIGHT_CONTROLS_WIDTH=2,o.FIT=3,o.ENVELOP=4,t.exports=o},15238(t){t.exports="add"},56187(t){t.exports="remove"},82348(t,e,i){t.exports={PROCESS_QUEUE_ADD:i(15238),PROCESS_QUEUE_REMOVE:i(56187)}},41392(t,e,i){t.exports={Events:i(82348),List:i(73162),Map:i(90330),ProcessQueue:i(25774),RTree:i(59542),Size:i(86555)}},57382(t,e,i){var s=i(83419),r=i(45319),n=i(40987),a=i(8054),o=i(50030),h=i(79237),l=new s({Extends:h,initialize:function(t,e,i,s,r){h.call(this,t,e,i,s,r),this.add("__BASE",0,0,0,s,r),this._source=this.frames.__BASE.source,this.canvas=this._source.image,this.context=this.canvas.getContext("2d",{willReadFrequently:!0}),this.width=s,this.height=r,this.imageData=this.context.getImageData(0,0,s,r),this.data=null,this.imageData&&(this.data=this.imageData.data),this.pixels=null,this.buffer,this.data&&(this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data)},update:function(){return this.imageData=this.context.getImageData(0,0,this.width,this.height),this.data=this.imageData.data,this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data,this.manager.game.config.renderType===a.WEBGL&&this.refresh(),this},draw:function(t,e,i,s){return void 0===s&&(s=!0),this.context.drawImage(i,t,e),s&&this.update(),this},drawFrame:function(t,e,i,s,r){void 0===i&&(i=0),void 0===s&&(s=0),void 0===r&&(r=!0);var n=this.manager.getFrame(t,e);if(n){var a=n.canvasData,o=n.cutWidth,h=n.cutHeight,l=n.source.resolution;this.context.drawImage(n.source.image,a.x,a.y,o,h,i,s,o/l,h/l),r&&this.update()}return this},setPixel:function(t,e,i,s,r,n){if(void 0===n&&(n=255),t=Math.abs(Math.floor(t)),e=Math.abs(Math.floor(e)),this.getIndex(t,e)>-1){var a=this.context.getImageData(t,e,1,1);a.data[0]=i,a.data[1]=s,a.data[2]=r,a.data[3]=n,this.context.putImageData(a,t,e)}return this},putData:function(t,e,i,s,r,n,a){return void 0===s&&(s=0),void 0===r&&(r=0),void 0===n&&(n=t.width),void 0===a&&(a=t.height),this.context.putImageData(t,e,i,s,r,n,a),this},getData:function(t,e,i,s){return t=r(Math.floor(t),0,this.width-1),e=r(Math.floor(e),0,this.height-1),i=r(i,1,this.width-t),s=r(s,1,this.height-e),this.context.getImageData(t,e,i,s)},getPixel:function(t,e,i){i||(i=new n);var s=this.getIndex(t,e);if(s>-1){var r=this.data,a=r[s+0],o=r[s+1],h=r[s+2],l=r[s+3];i.setTo(a,o,h,l)}return i},getPixels:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===s&&(s=i),t=Math.abs(Math.round(t)),e=Math.abs(Math.round(e));for(var a=r(t,0,this.width),o=r(t+i,0,this.width),h=r(e,0,this.height),l=r(e+s,0,this.height),u=new n,d=[],c=h;ca.width&&(t=a.width-s.cutX),s.cutY+e>a.height&&(e=a.height-s.cutY),s.setSize(t,e,s.cutX,s.cutY)}return this},render:function(){if(0!==this.commandBuffer.length)return this.camera.preRender(),this.renderer.type===o.WEBGL&&this._renderWebGL(),this.renderer.type===o.CANVAS&&this._renderCanvas(),this},_renderWebGL:function(){this.renderer.renderNodes.getNode("DynamicTextureHandler").run(this)},_renderCanvas:function(){var t,e,i,r,n,a,o,h,l,u,d,c,p,m,g,v=this.camera,x=this.context,y=this.renderer,T=this.manager;y.setContext(x);for(var w=this.commandBuffer,S=w.length,b=!1,E=!1,C=0;C>24&255)/255;var _=A>>16&255,M=A>>8&255,R=255&A;x.save(),x.globalCompositeOperation="source-over",x.fillStyle="rgba("+_+","+M+","+R+","+t+")",x.fillRect(m,g,p,n),x.restore();break;case f.STAMP:a=w[++C],r=w[++C],m=w[++C],g=w[++C],t=w[++C],c=w[++C],l=w[++C],u=w[++C],d=w[++C],o=w[++C],h=w[++C],e=w[++C],E&&(e=s.ERASE);var O=T.resetStamp(t,c);O.setPosition(m,g).setRotation(l).setScale(u,d).setTexture(a,r).setOrigin(o,h).setBlendMode(e),O.renderCanvas(y,O,v,null);break;case f.REPEAT:a=w[++C],r=w[++C],m=w[++C],g=w[++C],t=w[++C],c=w[++C],l=w[++C],u=w[++C],d=w[++C],o=w[++C],h=w[++C],e=w[++C],p=w[++C],n=w[++C];var P=w[++C],L=w[++C],F=w[++C],D=w[++C],I=w[++C];E&&(e=s.ERASE);var N=T.resetTileSprite(t,c);N.setPosition(m,g).setRotation(l).setScale(u,d).setTexture(a,r).setSize(p,n).setOrigin(o,h).setBlendMode(e).setTilePosition(P,L).setTileRotation(F).setTileScale(D,I),N.renderCanvas(y,N,v,null);break;case f.DRAW:var B=w[++C];if(m=w[++C],g=w[++C],void 0!==m){var k=B.x;B.x=m}if(void 0!==g){var U=B.y;B.y=g}E&&(i=B.blendMode,B.blendMode=s.ERASE),B.renderCanvas(y,B,v,null),void 0!==m&&(B.x=k),void 0!==g&&(B.y=U),E&&(B.blendMode=i);break;case f.SET_ERASE:E=!!w[++C];break;case f.PRESERVE:b=w[++C];break;case f.CALLBACK:(0,w[++C])();break;case f.CAPTURE:B=w[++C];var z=w[++C],Y=this.startCapture(B,z);B.renderCanvas(y,B,z.camera||v,Y.transform),this.finishCapture(B,Y)}}b||(w.length=0),y.setContext()},fill:function(t,e,i,s,r,n){void 0===e&&(e=1),void 0===i&&(i=0),void 0===s&&(s=0),void 0===r&&(r=this.width),void 0===n&&(n=this.height);var a=t>>16&255,o=t>>8&255,h=255&t,l=c.getTintFromFloats(a/255,o/255,h/255,e);return this.commandBuffer.push(f.FILL,l,i,s,r,n),this},clear:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===s&&(s=this.height),this.commandBuffer.push(f.CLEAR,t,e,i,s),this},stamp:function(t,e,i,s,r){void 0===i&&(i=0),void 0===s&&(s=0);var n=u(r,"alpha",1),a=u(r,"tint",16777215),o=u(r,"angle",0),h=u(r,"rotation",0),l=u(r,"scale",1),d=u(r,"scaleX",l),c=u(r,"scaleY",l),p=u(r,"originX",.5),m=u(r,"originY",.5),g=u(r,"blendMode",0);return 0!==o&&(h=o*Math.PI/180),this.commandBuffer.push(f.STAMP,t,e,i,s,n,a,h,d,c,p,m,g),this},erase:function(t,e,i,s,r){var n=this.commandBuffer,a=n.length;return n[a-2]!==f.SET_ERASE||n[a-1]?n.push(f.SET_ERASE,!0):n.length-=2,this.draw(t,e,i,s,r),n.push(f.SET_ERASE,!1),this},draw:function(t,e,i,s,r){Array.isArray(t)||(t=[t]);for(var n=t.length,a=0;aT||y.y>w)){var S=Math.max(y.x,e),b=Math.max(y.y,i),E=Math.min(y.r,T)-S,C=Math.min(y.b,w)-b;g=E,v=C,p=a?h+(u-(S-y.x)-E):h+(S-y.x),m=o?l+(d-(b-y.y)-C):l+(b-y.y),e=S,i=b,s=E,n=C}else p=0,m=0,g=0,v=0}else a&&(p=h+(u-e-s)),o&&(m=l+(d-i-n));var A=this.source.width,_=this.source.height;return t.u0=Math.max(0,p/A),t.v0=1-Math.max(0,m/_),t.u1=Math.min(1,(p+g)/A),t.v1=1-Math.min(1,(m+v)/_),t.x=e,t.y=i,t.cx=p,t.cy=m,t.cw=g,t.ch=v,t.width=s,t.height=n,t.flipX=a,t.flipY=o,t},updateCropUVs:function(t,e,i){return this.setCropUVs(t,t.x,t.y,t.width,t.height,e,i)},setUVs:function(t,e,i,s,r,n){var a=this.data.drawImage;return a.width=t,a.height=e,this.u0=i,this.v0=s,this.u1=r,this.v1=n,this},updateUVs:function(){var t=this.cutX,e=this.cutY,i=this.cutWidth,s=this.cutHeight,r=this.data.drawImage;r.width=i,r.height=s;var n=this.source.width,a=this.source.height;return this.u0=t/n,this.v0=1-e/a,this.u1=(t+i)/n,this.v1=1-(e+s)/a,this},updateUVsInverted:function(){var t=this.source.width,e=this.source.height;return this.u0=(this.cutX+this.cutHeight)/t,this.v0=1-this.cutY/e,this.u1=this.cutX/t,this.v1=1-(this.cutY+this.cutWidth)/e,this},clone:function(){var t=new a(this.texture,this.name,this.sourceIndex);return t.cutX=this.cutX,t.cutY=this.cutY,t.cutWidth=this.cutWidth,t.cutHeight=this.cutHeight,t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t.halfWidth=this.halfWidth,t.halfHeight=this.halfHeight,t.centerX=this.centerX,t.centerY=this.centerY,t.rotated=this.rotated,t.data=n(!0,t.data,this.data),t.updateUVs(),t},destroy:function(){this.texture=null,this.source=null,this.customData=null,this.data=null},glTexture:{get:function(){return this.source.glTexture}},realWidth:{get:function(){return this.data.sourceSize.w}},realHeight:{get:function(){return this.data.sourceSize.h}},radius:{get:function(){return this.data.radius}},trimmed:{get:function(){return this.data.trim}},scale9:{get:function(){return this.data.scale9}},is3Slice:{get:function(){return this.data.is3Slice}},canvasData:{get:function(){return this.data.drawImage}}});t.exports=a},79237(t,e,i){var s=i(83419),r=i(4327),n=i(11876),a='Texture "%s" has no frame "%s"',o=new s({initialize:function(t,e,i,s,r){Array.isArray(i)||(i=[i]),this.manager=t,this.key=e,this.source=[],this.dataSource=[],this.frames={},this.customData={},this.firstFrame="__BASE",this.frameTotal=0,this.smoothPixelArt=null;for(var a=0;an&&(n=h.cutX+h.cutWidth),h.cutY+h.cutHeight>a&&(a=h.cutY+h.cutHeight)}return{x:s,y:r,width:n-s,height:a-r}},getFrameNames:function(t){void 0===t&&(t=!1);var e=Object.keys(this.frames);if(!t){var i=e.indexOf("__BASE");-1!==i&&e.splice(i,1)}return e},getSourceImage:function(t){null!=t&&1!==this.frameTotal||(t="__BASE");var e=this.frames[t];return e?e.source.image:(console.warn(a,this.key,t),this.frames.__BASE.source.image)},getDataSourceImage:function(t){null!=t&&1!==this.frameTotal||(t="__BASE");var e,i=this.frames[t];return i?e=i.sourceIndex:(console.warn(a,this.key,t),e=this.frames.__BASE.sourceIndex),this.dataSource[e].image},setSource:function(t,e,i,s,r){void 0===e&&(e=0),void 0===i&&(i=!1),Array.isArray(t)||(t=[t]);for(var a=0;a0&&o.height>0&&l.drawImage(a.source.image,o.x,o.y,o.width,o.height,0,0,o.width,o.height),n=h.toDataURL(i,r),s.remove(h)}return n},addImage:function(t,e,i){var s=null;return this.checkKey(t)&&(s=this.create(t,e),v.Image(s,0),i&&s.setDataSource(i),this.emit(u.ADD,t,s),this.emit(u.ADD_KEY+t,s)),s},addGLTexture:function(t,e){var i=null;if(this.checkKey(t)){var s=e.width,r=e.height;(i=this.create(t,e,s,r)).add("__BASE",0,0,0,s,r),this.emit(u.ADD,t,i),this.emit(u.ADD_KEY+t,i)}return i},addCompressedTexture:function(t,e,i){var s=null;if(this.checkKey(t)){if((s=this.create(t,e)).add("__BASE",0,0,0,e.width,e.height),i){var r=function(t,e,i){Array.isArray(i.textures)||Array.isArray(i.frames)?v.JSONArray(t,e,i):v.JSONHash(t,e,i)};if(Array.isArray(i))for(var n=0;n=h.x&&t=h.y&&e=o.x&&t=o.y&&e>1),m=Math.max(1,m>>1),f+=g}return{mipmaps:c,width:h,height:l,internalFormat:o,compressed:!0,generateMipmap:!1}}console.warn("KTXParser - Only compressed formats supported")}},41942(t){t.exports=function(t,e){if(e&&e.frames&&e.pages){var i=t.source[0];t.add("__BASE",0,0,0,i.width,i.height);var s=e.frames;for(var r in s)if(s.hasOwnProperty(r)){var n=s[r],a=0|n.page;if(a>=t.source.length)console.warn('PCT atlas frame "'+r+'" references missing page '+a);else{var o=t.add(n.key||r,a,n.x,n.y,n.w,n.h);o?(n.trimmed&&o.setTrim(n.sourceW,n.sourceH,n.trimX,n.trimY,n.w,n.h),n.rotated&&(o.rotated=!0,o.updateUVsInverted())):console.warn("Invalid PCT atlas, frame already exists: "+r)}}return t.customData.pct={pages:e.pages,folders:e.folders},t}console.warn("Invalid PCT atlas data given")}},39620(t){var e={1:".png",2:".webp",3:".jpg",4:".jpeg",5:".gif"},i=function(t,e){for(var i=String(t);i.length0&&function(t){if(0===t.length)return!1;for(var e=0;e57)return!1}return!0}(r.substring(0,a))&&(n=i[parseInt(r.substring(0,a),10)],r=r.substring(a+1));var o=/~([1-5])$/.exec(r);if(o){var h=e[parseInt(o[1],10)];r=r.substring(0,r.length-2)+h}else s&&(r+=s);return n?n+"/"+r:r},r=function(t,r){var n="",a=/~([1-5])$/.exec(t);a&&(n=e[parseInt(a[1],10)],t=t.substring(0,t.length-2));for(var o=[],h=t.split(","),l=0;l=0)for(var c=u.substring(0,d),f=u.substring(d+1),p=f.indexOf("-"),m=f.substring(0,p),g=f.substring(p+1),v=parseInt(m,10),x=parseInt(g,10),y=m.length>1&&"0"===m.charAt(0)?m.length:0,T=v;T<=x;T++){var w=y>0?i(T,y):String(T);o.push(s(c+w,r,n))}else o.push(s(u,r,n))}return o};t.exports=function(t){if("string"!=typeof t||0===t.length)return console.warn("Invalid PCT file: empty or not a string"),null;var e=t.split("\n"),i=e[0];if(13===i.charCodeAt(i.length-1)&&(i=i.substring(0,i.length-1)),!i||0!==i.indexOf("PCT:"))return console.warn("Not a PCT file: missing PCT: header"),null;var n=i.substring(4),a=n.split("."),o=parseInt(a[0],10);if(isNaN(o)||o>1)return console.warn("Unsupported PCT version: "+n),null;for(var h=[],l=[],u={},d=0,c=null,f=1;f1};if(y.trimmed){var T=v[1].split(",");y.sourceW=parseInt(T[0],10),y.sourceH=parseInt(T[1],10),y.trimX=parseInt(T[2],10),y.trimY=parseInt(T[3],10)}c=y}else if("A:"===m){var w=p.indexOf("=",2);if(-1===w)continue;var S=s(p.substring(2,w),l,""),b=r(p.substring(w+1),l),E=u[S];if(E)for(var C=0;C>1),m=Math.max(1,m>>1),f+=v}return{mipmaps:c,width:h,height:l,internalFormat:r,compressed:!0,generateMipmap:!1}}},75549(t,e,i){var s=i(95540);t.exports=function(t,e,i,r,n,a,o){var h=s(o,"frameWidth",null),l=s(o,"frameHeight",h);if(null===h)throw new Error("TextureManager.SpriteSheet: Invalid frameWidth given.");var u=t.source[e];t.add("__BASE",e,0,0,u.width,u.height);var d=s(o,"startFrame",0),c=s(o,"endFrame",-1),f=s(o,"margin",0),p=s(o,"spacing",0),m=Math.floor((n-f+p)/(h+p))*Math.floor((a-f+p)/(l+p));0===m&&console.warn("SpriteSheet frame dimensions will result in zero frames for texture:",t.key),(d>m||d<-m)&&(d=0),d<0&&(d=m+d),(-1===c||c>m||cn&&(x=S-n),b>a&&(y=b-a),w>=d&&w<=c&&(t.add(T,e,i+g,r+v,h-x,l-y),T++),(g+=h+p)+h>n&&(g=f,v+=l+p)}return t}},47534(t,e,i){var s=i(95540);t.exports=function(t,e,i){var r=s(i,"frameWidth",null),n=s(i,"frameHeight",r);if(!r)throw new Error("TextureManager.SpriteSheetFromAtlas: Invalid frameWidth given.");var a=t.source[0];t.add("__BASE",0,0,0,a.width,a.height);var o,h=s(i,"startFrame",0),l=s(i,"endFrame",-1),u=s(i,"margin",0),d=s(i,"spacing",0),c=e.cutX,f=e.cutY,p=e.cutWidth,m=e.cutHeight,g=e.realWidth,v=e.realHeight,x=Math.floor((g-u+d)/(r+d)),y=Math.floor((v-u+d)/(n+d)),T=x*y,w=e.x,S=r-w,b=r-(g-p-w),E=e.y,C=n-E,A=n-(v-m-E);(h>T||h<-T)&&(h=0),h<0&&(h=T+h),-1!==l&&(T=h+(l+1));for(var _=u,M=u,R=0,O=0;O=this.firstgid&&tthis.right||e>this.bottom)},copy:function(t){return this.index=t.index,this.alpha=t.alpha,this.properties=a(t.properties),this.visible=t.visible,this.setFlip(t.flipX,t.flipY),this.tint=t.tint,this.rotation=t.rotation,this.collideUp=t.collideUp,this.collideDown=t.collideDown,this.collideLeft=t.collideLeft,this.collideRight=t.collideRight,this.collisionCallback=t.collisionCallback,this.collisionCallbackContext=t.collisionCallbackContext,this},getCollisionGroup:function(){return this.tileset?this.tileset.getTileCollisionGroup(this.index):null},getTileData:function(){return this.tileset?this.tileset.getTileData(this.index):null},getLeft:function(t){var e=this.tilemapLayer;return e?e.tileToWorldXY(this.x,this.y,void 0,t).x:this.x*this.baseWidth},getRight:function(t){var e=this.tilemapLayer;return e?this.getLeft(t)+this.width*e.scaleX:this.getLeft(t)+this.width},getTop:function(t){var e=this.tilemapLayer;return e?e.tileToWorldXY(this.x,this.y,void 0,t).y:this.y*this.baseWidth-(this.height-this.baseHeight)},getBottom:function(t){var e=this.tilemapLayer;return e?this.getTop(t)+this.height*e.scaleY:this.getTop(t)+this.height},getBounds:function(t,e){return void 0===e&&(e=new o),e.x=this.getLeft(t),e.y=this.getTop(t),e.width=this.getRight(t)-e.x,e.height=this.getBottom(t)-e.y,e},getCenterX:function(t){return(this.getLeft(t)+this.getRight(t))/2},getCenterY:function(t){return(this.getTop(t)+this.getBottom(t))/2},intersects:function(t,e,i,s){return!(i<=this.pixelX||s<=this.pixelY||t>=this.right||e>=this.bottom)},isInteresting:function(t,e){return t&&e?this.canCollide||this.hasInterestingFace:t?this.collides:!!e&&this.hasInterestingFace},resetCollision:function(t){(void 0===t&&(t=!0),this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,t)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},resetFaces:function(){return this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this},setCollision:function(t,e,i,s,r){(void 0===e&&(e=t),void 0===i&&(i=t),void 0===s&&(s=t),void 0===r&&(r=!0),this.collideLeft=t,this.collideRight=e,this.collideUp=i,this.collideDown=s,this.faceLeft=t,this.faceRight=e,this.faceTop=i,this.faceBottom=s,r)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},setCollisionCallback:function(t,e){return null===t?(this.collisionCallback=void 0,this.collisionCallbackContext=void 0):(this.collisionCallback=t,this.collisionCallbackContext=e),this},setSize:function(t,e,i,s){return void 0!==t&&(this.width=t),void 0!==e&&(this.height=e),void 0!==i&&(this.baseWidth=i),void 0!==s&&(this.baseHeight=s),this.updatePixelXY(),this},updatePixelXY:function(){var t=this.layer.orientation;if(t===n.ORTHOGONAL)this.pixelX=this.x*this.baseWidth,this.pixelY=this.y*this.baseHeight;else if(t===n.ISOMETRIC)this.pixelX=(this.x-this.y)*this.baseWidth*.5,this.pixelY=(this.x+this.y)*this.baseHeight*.5;else if(t===n.STAGGERED)this.pixelX=this.x*this.baseWidth+this.y%2*(this.baseWidth/2),this.pixelY=this.y*(this.baseHeight/2);else if(t===n.HEXAGONAL){var e,i,s=this.layer.staggerAxis,r=this.layer.staggerIndex,a=this.layer.hexSideLength;"y"===s?(i=(this.baseHeight-a)/2+a,this.pixelX="odd"===r?this.x*this.baseWidth+this.y%2*(this.baseWidth/2):this.x*this.baseWidth-this.y%2*(this.baseWidth/2),this.pixelY=this.y*i):"x"===s&&(e=(this.baseWidth-a)/2+a,this.pixelX=this.x*e,this.pixelY="odd"===r?this.y*this.baseHeight+this.x%2*(this.baseHeight/2):this.y*this.baseHeight-this.x%2*(this.baseHeight/2))}return this.right=this.pixelX+this.baseWidth,this.bottom=this.pixelY+this.baseHeight,this},destroy:function(){this.collisionCallback=void 0,this.collisionCallbackContext=void 0,this.properties=void 0},canCollide:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown||void 0!==this.collisionCallback}},collides:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown}},hasInterestingFace:{get:function(){return this.faceTop||this.faceBottom||this.faceLeft||this.faceRight}},tileset:{get:function(){var t=this.layer.tilemapLayer;if(t){var e=t.gidMap[this.index];if(e)return e}return null}},tilemapLayer:{get:function(){return this.layer.tilemapLayer}},tilemap:{get:function(){var t=this.tilemapLayer;return t?t.tilemap:null}}});t.exports=l},49075(t,e,i){var s=i(84101),r=i(83419),n=i(39506),a=i(80341),o=i(95540),h=i(14977),l=i(27462),u=i(91907),d=i(36305),c=i(19133),f=i(68287),p=i(23029),m=i(81086),g=i(44731),v=i(53180),x=i(20442),y=i(33629),T=new r({initialize:function(t,e){this.scene=t,this.tileWidth=e.tileWidth,this.tileHeight=e.tileHeight,this.width=e.width,this.height=e.height,this.orientation=e.orientation,this.renderOrder=e.renderOrder,this.format=e.format,this.version=e.version,this.properties=e.properties,this.widthInPixels=e.widthInPixels,this.heightInPixels=e.heightInPixels,this.imageCollections=e.imageCollections,this.images=e.images,this.layers=e.layers,this.tiles=e.tiles,this.tilesets=e.tilesets,this.objects=e.objects,this.currentLayerIndex=0,this.hexSideLength=e.hexSideLength;var i=this.orientation;this._convert={WorldToTileXY:m.GetWorldToTileXYFunction(i),WorldToTileX:m.GetWorldToTileXFunction(i),WorldToTileY:m.GetWorldToTileYFunction(i),TileToWorldXY:m.GetTileToWorldXYFunction(i),TileToWorldX:m.GetTileToWorldXFunction(i),TileToWorldY:m.GetTileToWorldYFunction(i),GetTileCorners:m.GetTileCornersFunction(i)}},setRenderOrder:function(t){var e=["right-down","left-down","right-up","left-up"];return"number"==typeof t&&(t=e[t]),e.indexOf(t)>-1&&(this.renderOrder=t),this},addTilesetImage:function(t,e,i,r,n,o,h,l){if(void 0===t)return null;null==e&&(e=t);var u=this.scene.sys.textures;if(!u.exists(e))return console.warn('Texture key "%s" not found',e),null;var d=u.get(e),c=this.getTilesetIndex(t);if(null===c&&this.format===a.TILED_JSON)return console.warn('Tilemap has no tileset "%s". Its tilesets are %o',t,this.tilesets),null;var f=this.tilesets[c];return f?((i||r)&&f.setTileSize(i,r),(n||o)&&f.setSpacing(n,o),f.setImage(d),f):(void 0===i&&(i=this.tileWidth),void 0===r&&(r=this.tileHeight),void 0===n&&(n=0),void 0===o&&(o=0),void 0===h&&(h=0),void 0===l&&(l={x:0,y:0}),(f=new y(t,h,i,r,n,o,void 0,void 0,l)).setImage(d),this.tilesets.push(f),this.tiles=s(this),f)},copy:function(t,e,i,s,r,n,a,o){return null!==(o=this.getLayer(o))?(m.Copy(t,e,i,s,r,n,a,o),this):null},createBlankLayer:function(t,e,i,s,r,n,a,o){if(void 0===i&&(i=0),void 0===s&&(s=0),void 0===r&&(r=this.width),void 0===n&&(n=this.height),void 0===a&&(a=this.tileWidth),void 0===o&&(o=this.tileHeight),null!==this.getLayerIndex(t))return console.warn("Invalid Tilemap Layer ID: "+t),null;for(var l,u=new h({name:t,tileWidth:a,tileHeight:o,width:r,height:n,orientation:this.orientation,hexSideLength:this.hexSideLength}),d=0;d1&&console.warn("TilemapGPULayer can only use one tileset. Using the first item given."),e=e[0]),a=new v(this.scene,this,n,e,i,s)):(a=new x(this.scene,this,n,e,i,s)).setRenderOrder(this.renderOrder),this.scene.sys.displayList.add(a),a)},createFromObjects:function(t,e,i){void 0===i&&(i=!0);var s=[],r=this.getObjectLayer(t);if(!r)return console.warn("createFromObjects: Invalid objectLayerName given: "+t),s;var a=new l(i?this.tilesets:void 0);Array.isArray(e)||(e=[e]);var h=r.objects;e.sortByY&&h.sort(function(t,e){return t.y>e.y?1:-1});for(var c=0;c-1&&this.putTileAt(e,n.x,n.y,i,n.tilemapLayer)}return s},removeTileAt:function(t,e,i,s,r){return void 0===i&&(i=!0),void 0===s&&(s=!0),null===(r=this.getLayer(r))?null:m.RemoveTileAt(t,e,i,s,r)},removeTileAtWorldXY:function(t,e,i,s,r,n){return void 0===i&&(i=!0),void 0===s&&(s=!0),null===(n=this.getLayer(n))?null:m.RemoveTileAtWorldXY(t,e,i,s,r,n)},renderDebug:function(t,e,i){return null===(i=this.getLayer(i))?null:(this.orientation===u.ORTHOGONAL&&m.RenderDebug(t,e,i),this)},renderDebugFull:function(t,e){for(var i=this.layers,s=0;s=0&&t<4&&(this._renderOrder=t),this},cull:function(t){return this.cullCallback(this.layer,t,this.culledTiles,this._renderOrder)},setSkipCull:function(t){return void 0===t&&(t=!0),this.skipCull=t,this},setCullPadding:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=1),this.cullPaddingX=t,this.cullPaddingY=e,this},setTint:function(t,e,i,s,r,n){void 0===t&&(t=16777215);return this.forEachTile(function(e){e.tint=t},this,e,i,s,r,n)},setTintMode:function(t,e,i,s,r,n){void 0===t&&(t=h.MULTIPLY);return this.forEachTile(function(e){e.tintMode=t},this,e,i,s,r,n)},destroy:function(t){this.culledTiles.length=0,this.cullCallback=null,o.prototype.destroy.call(this,t)}});t.exports=l},44731(t,e,i){var s=i(83419),r=i(78389),n=i(31401),a=i(95643),o=i(81086),h=i(26099),l=new s({Extends:a,Mixins:[n.Alpha,n.BlendMode,n.ComputedSize,n.Depth,n.ElapseTimer,n.Flip,n.GetBounds,n.Lighting,n.Mask,n.Origin,n.RenderNodes,n.Transform,n.Visible,n.ScrollFactor,r],initialize:function(t,e,i,s,r,n){a.call(this,e,t),this.isTilemap=!0,this.tilemap=i,this.layerIndex=s,this.layer=i.layers[s],this.layer.tilemapLayer=this,this.gidMap=[],this.tempVec=new h,this.collisionCategory=1,this.collisionMask=1,this.setAlpha(this.layer.alpha),this.setPosition(r,n),this.setOrigin(0,0),this.setSize(i.tileWidth*this.layer.width,i.tileHeight*this.layer.height)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(t,e){this.updateTimer(t,e)},calculateFacesAt:function(t,e){return o.CalculateFacesAt(t,e,this.layer),this},calculateFacesWithin:function(t,e,i,s){return o.CalculateFacesWithin(t,e,i,s,this.layer),this},createFromTiles:function(t,e,i,s,r){return o.CreateFromTiles(t,e,i,s,r,this.layer)},copy:function(t,e,i,s,r,n,a){return o.Copy(t,e,i,s,r,n,a,this.layer),this},fill:function(t,e,i,s,r,n){return o.Fill(t,e,i,s,r,n,this.layer),this},filterTiles:function(t,e,i,s,r,n,a){return o.FilterTiles(t,e,i,s,r,n,a,this.layer)},findByIndex:function(t,e,i){return o.FindByIndex(t,e,i,this.layer)},findTile:function(t,e,i,s,r,n,a){return o.FindTile(t,e,i,s,r,n,a,this.layer)},forEachTile:function(t,e,i,s,r,n,a){return o.ForEachTile(t,e,i,s,r,n,a,this.layer),this},getTileAt:function(t,e,i){return o.GetTileAt(t,e,i,this.layer)},getTileAtWorldXY:function(t,e,i,s){return o.GetTileAtWorldXY(t,e,i,s,this.layer)},getIsoTileAtWorldXY:function(t,e,i,s,r){void 0===i&&(i=!0);var n=this.tempVec;return o.IsometricWorldToTileXY(t,e,!0,n,r,this.layer,i),this.getTileAt(n.x,n.y,s)},getTilesWithin:function(t,e,i,s,r){return o.GetTilesWithin(t,e,i,s,r,this.layer)},getTilesWithinShape:function(t,e,i){return o.GetTilesWithinShape(t,e,i,this.layer)},getTilesWithinWorldXY:function(t,e,i,s,r,n){return o.GetTilesWithinWorldXY(t,e,i,s,r,n,this.layer)},hasTileAt:function(t,e){return o.HasTileAt(t,e,this.layer)},hasTileAtWorldXY:function(t,e,i){return o.HasTileAtWorldXY(t,e,i,this.layer)},putTileAt:function(t,e,i,s){return o.PutTileAt(t,e,i,s,this.layer)},putTileAtWorldXY:function(t,e,i,s,r){return o.PutTileAtWorldXY(t,e,i,s,r,this.layer)},putTilesAt:function(t,e,i,s){return o.PutTilesAt(t,e,i,s,this.layer),this},randomize:function(t,e,i,s,r){return o.Randomize(t,e,i,s,r,this.layer),this},removeTileAt:function(t,e,i,s){return o.RemoveTileAt(t,e,i,s,this.layer)},removeTileAtWorldXY:function(t,e,i,s,r){return o.RemoveTileAtWorldXY(t,e,i,s,r,this.layer)},renderDebug:function(t,e){return o.RenderDebug(t,e,this.layer),this},replaceByIndex:function(t,e,i,s,r,n){return o.ReplaceByIndex(t,e,i,s,r,n,this.layer),this},setCollision:function(t,e,i,s){return o.SetCollision(t,e,i,this.layer,s),this},setCollisionBetween:function(t,e,i,s){return o.SetCollisionBetween(t,e,i,s,this.layer),this},setCollisionByProperty:function(t,e,i){return o.SetCollisionByProperty(t,e,i,this.layer),this},setCollisionByExclusion:function(t,e,i){return o.SetCollisionByExclusion(t,e,i,this.layer),this},setCollisionFromCollisionGroup:function(t,e){return o.SetCollisionFromCollisionGroup(t,e,this.layer),this},setTileIndexCallback:function(t,e,i){return o.SetTileIndexCallback(t,e,i,this.layer),this},setTileLocationCallback:function(t,e,i,s,r,n){return o.SetTileLocationCallback(t,e,i,s,r,n,this.layer),this},shuffle:function(t,e,i,s){return o.Shuffle(t,e,i,s,this.layer),this},swapByIndex:function(t,e,i,s,r,n){return o.SwapByIndex(t,e,i,s,r,n,this.layer),this},tileToWorldX:function(t,e){return this.tilemap.tileToWorldX(t,e,this)},tileToWorldY:function(t,e){return this.tilemap.tileToWorldY(t,e,this)},tileToWorldXY:function(t,e,i,s){return this.tilemap.tileToWorldXY(t,e,i,s,this)},getTileCorners:function(t,e,i){return this.tilemap.getTileCorners(t,e,i,this)},weightedRandomize:function(t,e,i,s,r){return o.WeightedRandomize(e,i,s,r,t,this.layer),this},worldToTileX:function(t,e,i){return this.tilemap.worldToTileX(t,e,i,this)},worldToTileY:function(t,e,i){return this.tilemap.worldToTileY(t,e,i,this)},worldToTileXY:function(t,e,i,s,r){return this.tilemap.worldToTileXY(t,e,i,s,r,this)},destroy:function(t){void 0===t&&(t=!0),this.tilemap&&(this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),t&&this.tilemap.removeLayer(this),this.tilemap=void 0,this.layer=void 0,this.gidMap=[],this.tileset=[],a.prototype.destroy.call(this))}});t.exports=l},16153(t,e,i){var s=i(61340),r=new s,n=new s,a=new s;t.exports=function(t,e,i,s){var o=e.cull(i),h=o.length,l=i.alpha*e.alpha;if(!(0===h||l<=0)){n.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var u=t.currentContext,d=e.gidMap;u.save(),r.copyWithScrollFactorFrom(i.matrixCombined,i.scrollX,i.scrollY,e.scrollFactorX,e.scrollFactorY),s&&r.multiply(s),r.multiply(n,a),a.setToContext(u),(!t.antialias||e.scaleX>1||e.scaleY>1)&&(u.imageSmoothingEnabled=!1);for(var c=0;c=this.firstgid&&t>>1]).startTime)<=e&&h+r.duration>e)return r.tileid+this.firstgid;hi.width||e.height>i.height?this.updateTileData(e.width,e.height):this.updateTileData(i.width,i.height,i.x,i.y),this},setTileSize:function(t,e){return void 0!==t&&(this.tileWidth=t),void 0!==e&&(this.tileHeight=e),this.image&&this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},setSpacing:function(t,e){return void 0!==t&&(this.tileMargin=t),void 0!==e&&(this.tileSpacing=e),this.image&&this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},updateTileData:function(t,e,i,s){void 0===i&&(i=0),void 0===s&&(s=0);var r=(e-2*this.tileMargin+this.tileSpacing)/(this.tileHeight+this.tileSpacing),n=(t-2*this.tileMargin+this.tileSpacing)/(this.tileWidth+this.tileSpacing);r%1==0&&n%1==0||console.warn("Image tile area not tile size multiple in: "+this.name),r=Math.floor(r),n=Math.floor(n),this.rows=r,this.columns=n,this.total=r*n,this.texCoordinates.length=0;for(var a=this.tileMargin+i,o=this.tileMargin+s,h=0;h8388608)throw new Error("Tileset._animationDataTexture: too many animations - total number of animations plus animation frames is max 8388608, got "+f);var p=2*f,m=Math.min(p,4096),g=Math.ceil(p/4096),v=new Uint32Array(m*g),x=0,y=s.length;for(o=0;or.worldView.x+n.scaleX*i.tileWidth*(-a-.5)&&h.xr.worldView.y+n.scaleY*i.tileHeight*(-o-1)&&h.y=0;n--)for(r=s.width-1;r>=0;r--)if((a=s.data[n][r])&&a.index===t){if(o===e)return a;o+=1}}else for(n=0;na.width&&(i=Math.max(a.width-t,0)),e+r>a.height&&(r=Math.max(a.height-e,0));for(var u=[],d=e;d-1}return!1}},24152(t,e,i){var s=i(45091),r=new(i(26099));t.exports=function(t,e,i,n){n.tilemapLayer.worldToTileXY(t,e,!0,r,i);var a=r.x,o=r.y;return s(a,o,n)}},90454(t,e,i){var s=i(63448),r=i(56583);t.exports=function(t,e){var i,n,a,o,h=t.tilemapLayer.tilemap,l=t.tilemapLayer,u=Math.floor(h.tileWidth*l.scaleX),d=Math.floor(h.tileHeight*l.scaleY),c=t.hexSideLength;if("y"===t.staggerAxis){var f=(d-c)/2+c;i=r(e.worldView.x-l.x,u,0,!0)-l.cullPaddingX,n=s(e.worldView.right-l.x,u,0,!0)+l.cullPaddingX,a=r(e.worldView.y-l.y,f,0,!0)-l.cullPaddingY,o=s(e.worldView.bottom-l.y,f,0,!0)+l.cullPaddingY}else{var p=(u-c)/2+c;i=r(e.worldView.x-l.x,p,0,!0)-l.cullPaddingX,n=s(e.worldView.right-l.x,p,0,!0)+l.cullPaddingX,a=r(e.worldView.y-l.y,d,0,!0)-l.cullPaddingY,o=s(e.worldView.bottom-l.y,d,0,!0)+l.cullPaddingY}return{left:i,right:n,top:a,bottom:o}}},9474(t,e,i){var s=i(90454),r=i(32483);t.exports=function(t,e,i,n){void 0===i&&(i=[]),void 0===n&&(n=0),i.length=0;var a=t.tilemapLayer,o=s(t,e);return a.skipCull&&1===a.scrollFactorX&&1===a.scrollFactorY&&(o.left=0,o.right=t.width,o.top=0,o.bottom=t.height),r(t,o,n,i),i}},27229(t,e,i){var s=i(19951),r=i(26099),n=new r;t.exports=function(t,e,i,a){var o=a.baseTileWidth,h=a.baseTileHeight,l=a.tilemapLayer;l&&(o*=l.scaleX,h*=l.scaleY);var u,d,c=s(t,e,n,i,a),f=[],p=.5773502691896257;"y"===a.staggerAxis?(u=p*o,d=h/2):(u=o/2,d=p*h);for(var m=0;m<6;m++){var g=2*Math.PI*(.5-m)/6;f.push(new r(c.x+u*Math.cos(g),c.y+d*Math.sin(g)))}return f}},19951(t,e,i){var s=i(26099);t.exports=function(t,e,i,r,n){i||(i=new s);var a=n.baseTileWidth,o=n.baseTileHeight,h=n.tilemapLayer,l=0,u=0;h&&(r||(r=h.scene.cameras.main),l=h.x+r.scrollX*(1-h.scrollFactorX),u=h.y+r.scrollY*(1-h.scrollFactorY),a*=h.scaleX,o*=h.scaleY);var d,c,f=a/2,p=o/2,m=n.staggerAxis,g=n.staggerIndex;return"y"===m?(d=l+a*t+a,c=u+1.5*e*p+p,e%2==0&&("odd"===g?d-=f:d+=f)):"x"===m&&"odd"===g&&(d=l+1.5*t*f+f,c=u+o*t+o,t%2==0&&("odd"===g?c-=p:c+=p)),i.set(d,c)}},86625(t,e,i){var s=i(26099);t.exports=function(t,e,i,r,n,a){r||(r=new s);var o=a.baseTileWidth,h=a.baseTileHeight,l=a.tilemapLayer;l&&(n||(n=l.scene.cameras.main),t-=l.x+n.scrollX*(1-l.scrollFactorX),e-=l.y+n.scrollY*(1-l.scrollFactorY),o*=l.scaleX,h*=l.scaleY);var u,d,c,f,p,m=.5773502691896257,g=-.3333333333333333,v=.6666666666666666,x=o/2,y=h/2;"y"===a.staggerAxis?(c=m*(u=(t-x)/(m*o))+g*(d=(e-y)/y),f=0*u+v*d):(c=g*(u=(t-x)/x)+m*(d=(e-y)/(m*h)),f=v*u+0*d),p=-c-f;var T,w=Math.round(c),S=Math.round(f),b=Math.round(p),E=Math.abs(w-c),C=Math.abs(S-f),A=Math.abs(b-p);E>C&&E>A?w=-S-b:C>A&&(S=-w-b);var _=S;return T="odd"===a.staggerIndex?_%2==0?S/2+w:S/2+w-.5:_%2==0?S/2+w:S/2+w+.5,r.set(T,_)}},62991(t){t.exports=function(t,e,i){return t>=0&&t=0&&e=0;n--)(o=l[a][n])&&-1!==o.index&&o.visible&&0!==o.alpha&&(c||s(n,a,t,e))&&i.push(o);else if(2===r)for(a=p;a>=0;a--)for(n=0;n=0;a--)for(n=f;n>=0;n--)(o=l[a][n])&&-1!==o.index&&o.visible&&0!==o.alpha&&(c||s(n,a,t,e))&&i.push(o);return h.tilesDrawn=i.length,h.tilesTotal=u*d,i}},14127(t,e,i){var s=i(26099);t.exports=function(t,e,i,r,n){i||(i=new s);var a=n.baseTileWidth,o=n.baseTileHeight,h=n.tilemapLayer,l=0,u=0;h&&(r||(r=h.scene.cameras.main),l=h.x+r.scrollX*(1-h.scrollFactorX),a*=h.scaleX,u=h.y+r.scrollY*(1-h.scrollFactorY),o*=h.scaleY);var d=l+a/2*(t-e),c=u+(t+e)*(o/2);return i.set(d,c)}},96897(t,e,i){var s=i(26099);t.exports=function(t,e,i,r,n,a,o){r||(r=new s);var h=a.baseTileWidth,l=a.baseTileHeight,u=a.tilemapLayer;u&&(n||(n=u.scene.cameras.main),e-=u.y+n.scrollY*(1-u.scrollFactorY),l*=u.scaleY,t-=u.x+n.scrollX*(1-u.scrollFactorX),h*=u.scaleX);var d=h/2,c=l/2;o||(e-=l);var f=.5*((t-=d)/d+e/c),p=.5*(-t/d+e/c);return i&&(f=Math.floor(f),p=Math.floor(p)),r.set(f,p)}},71558(t,e,i){var s=i(23029),r=i(62991),n=i(72023),a=i(20576);t.exports=function(t,e,i,o,h){if(void 0===o&&(o=!0),!r(e,i,h))return null;var l,u=h.data[i][e],d=u&&u.collides;t instanceof s?(null===h.data[i][e]&&(h.data[i][e]=new s(h,t.index,e,i,h.tileWidth,h.tileHeight)),h.data[i][e].copy(t)):(l=t,null===h.data[i][e]?h.data[i][e]=new s(h,l,e,i,h.tileWidth,h.tileHeight):h.data[i][e].index=l);var c=h.data[i][e],f=-1!==h.collideIndexes.indexOf(c.index);if(-1===(l=t instanceof s?t.index:t))c.width=h.tileWidth,c.height=h.tileHeight;else{var p=h.tilemapLayer.tilemap,m=p.tiles[l][2],g=p.tilesets[m];c.width=g.tileWidth,c.height=g.tileHeight}return a(c,f),o&&d!==c.collides&&n(e,i,h),c}},26303(t,e,i){var s=i(71558),r=new(i(26099));t.exports=function(t,e,i,n,a,o){return o.tilemapLayer.worldToTileXY(e,i,!0,r,a,o),s(t,r.x,r.y,n,o)}},14051(t,e,i){var s=i(42573),r=i(71558);t.exports=function(t,e,i,n,a){if(void 0===n&&(n=!0),!Array.isArray(t))return null;Array.isArray(t[0])||(t=[t]);for(var o=t.length,h=t[0].length,l=0;l=d;r--)(a=o[n][r])&&-1!==a.index&&a.visible&&0!==a.alpha&&s.push(a);else if(2===i)for(n=p;n>=f;n--)for(r=d;o[n]&&r=f;n--)for(r=c;o[n]&&r>=d;r--)(a=o[n][r])&&-1!==a.index&&a.visible&&0!==a.alpha&&s.push(a);return u.tilesDrawn=s.length,u.tilesTotal=h*l,s}},57068(t,e,i){var s=i(20576),r=i(42573),n=i(9589);t.exports=function(t,e,i,a,o){void 0===e&&(e=!0),void 0===i&&(i=!0),void 0===o&&(o=!0),Array.isArray(t)||(t=[t]);for(var h=0;he)){for(var l=t;l<=e;l++)n(l,i,o);if(h)for(var u=0;u=t&&c.index<=e&&s(c,i)}a&&r(0,0,o.width,o.height,o)}}},75661(t,e,i){var s=i(20576),r=i(42573),n=i(9589);t.exports=function(t,e,i,a){void 0===e&&(e=!0),void 0===i&&(i=!0),Array.isArray(t)||(t=[t]);for(var o=0;o0&&s(o,t)}}e&&r(0,0,i.width,i.height,i)}},9589(t){t.exports=function(t,e,i){var s=i.collideIndexes.indexOf(t);e&&-1===s?i.collideIndexes.push(t):e||-1===s||i.collideIndexes.splice(s,1)}},20576(t){t.exports=function(t,e){e?t.setCollision(!0,!0,!0,!0,!1):t.resetCollision(!1)}},79583(t){t.exports=function(t,e,i,s){if("number"==typeof t)s.callbacks[t]=null!==e?{callback:e,callbackContext:i}:void 0;else for(var r=0,n=t.length;r-1?new r(o,f,d,u,a.tilesize,a.tilesize):e?null:new r(o,-1,d,u,a.tilesize,a.tilesize),h.push(c)}l.push(h),h=[]}o.data=l,i.push(o)}return i}},96483(t,e,i){var s=i(33629);t.exports=function(t){for(var e=[],i=[],r=0;ro&&(o=e.layer[l].width),e.layer[l].height>h&&(h=e.layer[l].height);var u=new r({width:o,height:h,name:t,tileWidth:e.layer[0].tilesize,tileHeight:e.layer[0].tilesize,format:s.WELTMEISTER});return u.layers=n(e,i),u.tilesets=a(e),u}},52833(t,e,i){t.exports={ParseTileLayers:i(6656),ParseTilesets:i(96483),ParseWeltmeister:i(87021)}},57442(t,e,i){t.exports={FromOrientationString:i(6641),Parse:i(46177),Parse2DArray:i(2342),ParseCSV:i(82593),Impact:i(52833),Tiled:i(96761)}},51233(t,e,i){var s=i(79291);t.exports=function(t){for(var e,i,r,n,a,o=0;o>>0;return s}},84101(t,e,i){var s=i(33629);t.exports=function(t){var e,i,r=[];for(e=0;e0;)if(n.i>=n.layers.length){if(i.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}n=i.pop()}else{var a=n.layers[n.i];if(n.i++,"imagelayer"===a.type){var o=s(a,"offsetx",0)+s(a,"startx",0),h=s(a,"offsety",0)+s(a,"starty",0);e.push({name:n.name+a.name,image:a.image,x:n.x+o+a.x,y:n.y+h+a.y,alpha:n.opacity*a.opacity,visible:n.visible&&a.visible,properties:s(a,"properties",{})})}else if("group"===a.type){var l=r(t,a,n);i.push(n),n=l}}return e}},46594(t,e,i){var s=i(51233),r=i(84101),n=i(91907),a=i(62644),o=i(80341),h=i(6641),l=i(87010),u=i(12635),d=i(22611),c=i(28200),f=i(24619);t.exports=function(t,e,i){var p=a(e),m=new l({width:p.width,height:p.height,name:t,tileWidth:p.tilewidth,tileHeight:p.tileheight,orientation:h(p.orientation),format:o.TILED_JSON,version:p.version,properties:p.properties,renderOrder:p.renderorder,infinite:p.infinite});if(m.orientation===n.HEXAGONAL)if(m.hexSideLength=p.hexsidelength,m.staggerAxis=p.staggeraxis,m.staggerIndex=p.staggerindex,"y"===m.staggerAxis){var g=(m.tileHeight-m.hexSideLength)/2;m.widthInPixels=m.tileWidth*(m.width+.5),m.heightInPixels=m.height*(m.hexSideLength+g)+g}else{var v=(m.tileWidth-m.hexSideLength)/2;m.widthInPixels=m.width*(m.hexSideLength+v)+v,m.heightInPixels=m.tileHeight*(m.height+.5)}m.layers=c(p,i),m.images=u(p);var x=f(p);return m.tilesets=x.tilesets,m.imageCollections=x.imageCollections,m.objects=d(p),m.tiles=r(m),s(m),m}},52205(t,e,i){var s=i(18254),r=i(29920),n=function(t){return{x:t.x,y:t.y}},a=["id","name","type","rotation","properties","visible","x","y","width","height"];t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=0);var o=s(t,a);if(o.x+=e,o.y+=i,t.gid){var h=r(t.gid);o.gid=h.gid,o.flippedHorizontal=h.flippedHorizontal,o.flippedVertical=h.flippedVertical,o.flippedAntiDiagonal=h.flippedAntiDiagonal}else t.polyline?o.polyline=t.polyline.map(n):t.polygon?o.polygon=t.polygon.map(n):t.ellipse?o.ellipse=t.ellipse:t.text?o.text=t.text:t.point?o.point=!0:o.rectangle=!0;return o}},22611(t,e,i){var s=i(95540),r=i(52205),n=i(48700),a=i(79677);t.exports=function(t){for(var e=[],i=[],o=a(t);o.i0;)if(o.i>=o.layers.length){if(i.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}o=i.pop()}else{var h=o.layers[o.i];if(o.i++,h.opacity*=o.opacity,h.visible=o.visible&&h.visible,"objectgroup"===h.type){h.name=o.name+h.name;for(var l=o.x+s(h,"startx",0)+s(h,"offsetx",0),u=o.y+s(h,"starty",0)+s(h,"offsety",0),d=[],c=0;c0;)if(f.i>=f.layers.length){if(c.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}f=c.pop()}else{var p=f.layers[f.i];if(f.i++,"tilelayer"===p.type)if(p.compression)console.warn("TilemapParser.parseTiledJSON - Layer compression is unsupported, skipping layer '"+p.name+"'");else{if(p.encoding&&"base64"===p.encoding){if(p.chunks)for(var m=0;m0?((x=new u(g,v.gid,D,I,t.tilewidth,t.tileheight)).rotation=v.rotation,x.flipX=v.flipped,S[I][D]=x):(y=e?null:new u(g,-1,D,I,t.tilewidth,t.tileheight),S[I][D]=y),++b===M.width&&(P++,b=0)}}else{(g=new h({name:f.name+p.name,id:p.id,x:f.x+o(p,"offsetx",0)+p.x,y:f.y+o(p,"offsety",0)+p.y,width:p.width,height:p.height,tileWidth:t.tilewidth,tileHeight:t.tileheight,alpha:f.opacity*p.opacity,visible:f.visible&&p.visible,properties:o(p,"properties",[]),orientation:a(t.orientation)})).orientation===r.HEXAGONAL&&(g.hexSideLength=t.hexsidelength,g.staggerAxis=t.staggeraxis,g.staggerIndex=t.staggerindex,"y"===g.staggerAxis?(T=(g.tileHeight-g.hexSideLength)/2,g.widthInPixels=g.tileWidth*(g.width+.5),g.heightInPixels=g.height*(g.hexSideLength+T)+T):(w=(g.tileWidth-g.hexSideLength)/2,g.widthInPixels=g.width*(g.hexSideLength+w)+w,g.heightInPixels=g.tileHeight*(g.height+.5)));for(var N=[],B=0,k=p.data.length;B0?((x=new u(g,v.gid,b,S.length,t.tilewidth,t.tileheight)).rotation=v.rotation,x.flipX=v.flipped,N.push(x)):(y=e?null:new u(g,-1,b,S.length,t.tilewidth,t.tileheight),N.push(y)),++b===p.width&&(S.push(N),b=0,N=[])}g.data=S,d.push(g)}else if("group"===p.type){var U=n(t,p,f);c.push(f),f=U}}return d}},24619(t,e,i){var s=i(33629),r=i(16536),n=i(52205),a=i(57880);t.exports=function(t){for(var e,i=[],o=[],h=null,l=0;l1){var c=void 0,f=void 0;if(Array.isArray(u.tiles)){c=c||{},f=f||{};for(var p=0;p0){var n,a,o,h={},l={};if(Array.isArray(s.edgecolors))for(n=0;n0)throw new Error("TimerEvent infinite loop created via zero delay")}else e=new a(t);return this._pendingInsertion.push(e),e},delayedCall:function(t,e,i,s){return this.addEvent({delay:t,callback:e,args:i,callbackScope:s})},clearPendingEvents:function(){return this._pendingInsertion=[],this},removeEvent:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e-1&&this._active.splice(r,1),s.destroy()}for(i=0;i=s.delay)){var r=s.elapsed-s.delay;if(s.elapsed=s.delay,!s.hasDispatched&&s.callback&&(s.hasDispatched=!0,s.callback.apply(s.callbackScope,s.args)),s.repeatCount>0){if(s.repeatCount--,r>=s.delay)for(;r>=s.delay&&s.repeatCount>0;)s.callback&&s.callback.apply(s.callbackScope,s.args),r-=s.delay,s.repeatCount--;s.elapsed=r,s.hasDispatched=!1}else s.hasDispatched&&this._pendingRemoval.push(s)}}}},shutdown:function(){var t;for(t=0;t0||this.totalComplete>0)&&(0!==this.loop&&(-1===this.loop||this.loop>this.iteration)?(this.iteration++,this.reset(!0)):this.complete=!0),this.complete&&this.emit(h.COMPLETE,this)}},play:function(t){return void 0===t&&(t=!0),this.paused=!1,this.complete=!1,this.totalComplete=0,t&&this.reset(),this},pause:function(){this.paused=!0;for(var t=this.events,e=0;e0&&(i=e[e.length-1].time);for(var s=0;s0)throw new Error("TimerEvent infinite loop created via zero delay");return this},getProgress:function(){return this.elapsed/this.delay},getOverallProgress:function(){if(this.repeat>0){var t=this.delay+this.delay*this.repeat;return(this.elapsed+this.delay*(this.repeat-this.repeatCount))/t}return this.getProgress()},getRepeatCount:function(){return this.repeatCount},getElapsed:function(){return this.elapsed},getElapsedSeconds:function(){return.001*this.elapsed},getRemaining:function(){return this.delay-this.elapsed},getRemainingSeconds:function(){return.001*this.getRemaining()},getOverallRemaining:function(){return this.delay*(1+this.repeatCount)-this.elapsed},getOverallRemainingSeconds:function(){return.001*this.getOverallRemaining()},remove:function(t){void 0===t&&(t=!1),this.elapsed=this.delay,this.hasDispatched=!t,this.repeatCount=0},destroy:function(){this.callback=void 0,this.callbackScope=void 0,this.args=[]}});t.exports=n},35945(t){t.exports="complete"},89809(t,e,i){t.exports={COMPLETE:i(35945)}},90291(t,e,i){t.exports={Clock:i(33385),Events:i(89809),Timeline:i(96120),TimerEvent:i(94880)}},40382(t,e,i){var s=i(72905),r=i(83419),n=i(43491),a=i(88032),o=i(37277),h=i(44594),l=i(93109),u=i(8462),d=i(8357),c=i(43960),f=i(26012),p=new r({initialize:function(t){this.scene=t,this.events=t.sys.events,this.timeScale=1,this.paused=!1,this.processing=!1,this.tweens=[],this.time=0,this.startTime=0,this.nextTime=0,this.prevTime=0,this.maxLag=500,this.lagSkip=33,this.gap=1e3/240,this.events.once(h.BOOT,this.boot,this),this.events.on(h.START,this.start,this)},boot:function(){this.events.once(h.DESTROY,this.destroy,this)},start:function(){this.timeScale=1,this.paused=!1,this.startTime=Date.now(),this.prevTime=this.startTime,this.nextTime=this.gap,this.events.on(h.UPDATE,this.update,this),this.events.once(h.SHUTDOWN,this.shutdown,this)},create:function(t){Array.isArray(t)||(t=[t]);for(var e=[],i=0;i-1},existing:function(t){return this.has(t)||this.tweens.push(t.reset()),this},addCounter:function(t){var e=a(this,t);return this.tweens.push(e.reset()),e},stagger:function(t,e){return l(t,e)},setLagSmooth:function(t,e){return void 0===t&&(t=1/1e-8),void 0===e&&(e=0),this.maxLag=t,this.lagSkip=Math.min(e,this.maxLag),this},setFps:function(t){return void 0===t&&(t=240),this.gap=1e3/t,this.nextTime=1e3*this.time+this.gap,this},getDelta:function(t){var e=Date.now()-this.prevTime;e>this.maxLag&&(this.startTime+=e-this.lagSkip),this.prevTime+=e;var i=this.prevTime-this.startTime,s=i-this.nextTime,r=i-1e3*this.time;return s>0||t?(i/=1e3,this.time=i,this.nextTime+=s+(s>=this.gap?4:this.gap-s)):r=0,r},tick:function(){return this.step(!0),this},update:function(){this.paused||this.step(!1)},step:function(t){void 0===t&&(t=!1);var e=this.getDelta(t);if(!(e<=0)){var i,s;this.processing=!0;var r=[],n=this.tweens;for(i=0;i0){for(i=0;i-1&&(s.isPendingRemove()||s.isDestroyed())&&(n.splice(o,1),s.destroy())}r.length=0}this.processing=!1}},remove:function(t){return this.processing?t.setPendingRemoveState():(s(this.tweens,t),t.setRemovedState()),this},reset:function(t){return this.existing(t),t.seek(),t.setActiveState(),this},makeActive:function(t){return this.existing(t),t.setActiveState(),this},each:function(t,e){var i,s=[null];for(i=1;iC&&(C=M),E[A][_]=M}}}var R=o?s(o):null;return i=h?function(t,e,i,s){var r,n=0,o=s%x,h=Math.floor(s/x);if(o>=0&&o=0&&ht&&(this.loopCounter=t),this},remove:function(){return this.parent&&this.parent.remove(this),this},stop:function(){return!this.parent||this.isRemoved()||this.isPendingRemove()||this.isDestroyed()||(this.dispatchEvent(n.TWEEN_STOP,"onStop"),this.setPendingRemoveState()),this},updateLoopCountdown:function(t){this.countdown-=t,this.countdown<=0&&(this.setActiveState(),this.dispatchEvent(n.TWEEN_LOOP,"onLoop"))},updateStartCountdown:function(t){return this.countdown-=t,this.countdown<=0&&(this.hasStarted=!0,this.setActiveState(),this.dispatchEvent(n.TWEEN_START,"onStart"),t=0),t},updateCompleteDelay:function(t){this.countdown-=t,this.countdown<=0&&this.onCompleteHandler()},setCallback:function(t,e,i){return void 0===i&&(i=[]),this.callbacks.hasOwnProperty(t)&&(this.callbacks[t]={func:e,params:i}),this},setPendingState:function(){this.state=a.PENDING},setActiveState:function(){this.state=a.ACTIVE,this.hasStarted=!1},setLoopDelayState:function(){this.state=a.LOOP_DELAY},setCompleteDelayState:function(){this.state=a.COMPLETE_DELAY},setStartDelayState:function(){this.state=a.START_DELAY,this.countdown=this.startDelay,this.hasStarted=!1},setPendingRemoveState:function(){this.state=a.PENDING_REMOVE},setRemovedState:function(){this.state=a.REMOVED},setFinishedState:function(){this.state=a.FINISHED},setDestroyedState:function(){this.state=a.DESTROYED},isPending:function(){return this.state===a.PENDING},isActive:function(){return this.state===a.ACTIVE},isLoopDelayed:function(){return this.state===a.LOOP_DELAY},isCompleteDelayed:function(){return this.state===a.COMPLETE_DELAY},isStartDelayed:function(){return this.state===a.START_DELAY},isPendingRemove:function(){return this.state===a.PENDING_REMOVE},isRemoved:function(){return this.state===a.REMOVED},isFinished:function(){return this.state===a.FINISHED},isDestroyed:function(){return this.state===a.DESTROYED},destroy:function(){this.data&&this.data.forEach(function(t){t.destroy()}),this.removeAllListeners(),this.callbacks=null,this.data=null,this.parent=null,this.setDestroyedState()}});o.TYPES=["onActive","onComplete","onLoop","onPause","onRepeat","onResume","onStart","onStop","onUpdate","onYoyo"],t.exports=o},95042(t,e,i){var s=i(83419),r=i(842),n=i(86353),a=new s({initialize:function(t,e,i,s,r,n,a,o,h,l){this.tween=t,this.targetIndex=e,this.duration=s<=0?.01:s,this.totalDuration=0,this.delay=0,this.getDelay=i,this.yoyo=r,this.hold=n,this.repeat=a,this.repeatDelay=o,this.repeatCounter=0,this.flipX=h,this.flipY=l,this.progress=0,this.elapsed=0,this.state=0,this.isCountdown=!1},getTarget:function(){return this.tween.targets[this.targetIndex]},setTargetValue:function(t){void 0===t&&(t=this.current),this.tween.targets[this.targetIndex][this.key]=t},setCreatedState:function(){this.state=n.CREATED,this.isCountdown=!1},setDelayState:function(){this.state=n.DELAY,this.isCountdown=!0},setPendingRenderState:function(){this.state=n.PENDING_RENDER,this.isCountdown=!1},setPlayingForwardState:function(){this.state=n.PLAYING_FORWARD,this.isCountdown=!1},setPlayingBackwardState:function(){this.state=n.PLAYING_BACKWARD,this.isCountdown=!1},setHoldState:function(){this.state=n.HOLD_DELAY,this.isCountdown=!0},setRepeatState:function(){this.state=n.REPEAT_DELAY,this.isCountdown=!0},setCompleteState:function(){this.state=n.COMPLETE,this.isCountdown=!1},isCreated:function(){return this.state===n.CREATED},isDelayed:function(){return this.state===n.DELAY},isPendingRender:function(){return this.state===n.PENDING_RENDER},isPlayingForward:function(){return this.state===n.PLAYING_FORWARD},isPlayingBackward:function(){return this.state===n.PLAYING_BACKWARD},isHolding:function(){return this.state===n.HOLD_DELAY},isRepeating:function(){return this.state===n.REPEAT_DELAY},isComplete:function(){return this.state===n.COMPLETE},setStateFromEnd:function(t){this.yoyo?this.onRepeat(t,!0,!0):this.repeatCounter>0?this.onRepeat(t,!0,!1):this.setCompleteState()},setStateFromStart:function(t){this.repeatCounter>0?this.onRepeat(t,!1):this.setCompleteState()},reset:function(){var t=this.tween,e=t.totalTargets,i=this.targetIndex,s=t.targets[i],r=this.key;this.progress=0,this.elapsed=0,this.delay=this.getDelay(s,r,0,i,e,t),this.repeatCounter=-1===this.repeat?n.MAX:this.repeat,this.setPendingRenderState();var a=this.duration+this.hold;this.yoyo&&(a+=this.duration);var o=a+this.repeatDelay;this.totalDuration=this.delay+a,-1===this.repeat?(this.totalDuration+=o*n.MAX,t.isInfinite=!0):this.repeat>0&&(this.totalDuration+=o*this.repeat),this.totalDuration>t.duration&&(t.duration=this.totalDuration),this.delay0&&(this.elapsed=this.delay,this.setDelayState())},onRepeat:function(t,e,i){var s=this.tween,n=s.totalTargets,a=this.targetIndex,o=s.targets[a],h=this.key,l="texture"!==h;if(this.elapsed=t,this.progress=t/this.duration,this.flipX&&o.toggleFlipX(),this.flipY&&o.toggleFlipY(),l&&(e||i)&&(this.start=this.getStartValue(o,h,this.start,a,n,s)),i)return this.setPlayingBackwardState(),void this.dispatchEvent(r.TWEEN_YOYO,"onYoyo");this.repeatCounter--,l&&(this.end=this.getEndValue(o,h,this.start,a,n,s)),this.repeatDelay>0?(this.elapsed=this.repeatDelay-t,l&&(this.current=this.start,o[h]=this.current),this.setRepeatState()):(this.setPlayingForwardState(),this.dispatchEvent(r.TWEEN_REPEAT,"onRepeat"))},destroy:function(){this.tween=null,this.getDelay=null,this.setCompleteState()}});t.exports=a},69902(t){t.exports={targets:null,delay:0,duration:1e3,ease:"Power0",easeParams:null,hold:0,repeat:0,repeatDelay:0,yoyo:!1,flipX:!1,flipY:!1,persist:!1,interpolation:null}},81076(t){t.exports=["callbackScope","completeDelay","delay","duration","ease","easeParams","flipX","flipY","hold","interpolation","loop","loopDelay","onActive","onActiveParams","onComplete","onCompleteParams","onLoop","onLoopParams","onPause","onPauseParams","onRepeat","onRepeatParams","onResume","onResumeParams","onStart","onStartParams","onStop","onStopParams","onUpdate","onUpdateParams","onYoyo","onYoyoParams","paused","persist","props","repeat","repeatDelay","targets","yoyo"]},8462(t,e,i){var s=i(70402),r=i(83419),n=i(842),a=i(44603),o=i(39429),h=i(36383),l=i(86353),u=i(48177),d=i(42220),c=new r({Extends:s,initialize:function(t,e){s.call(this,t),this.targets=e,this.totalTargets=e.length,this.isSeeking=!1,this.isInfinite=!1,this.elapsed=0,this.totalElapsed=0,this.duration=0,this.progress=0,this.totalDuration=0,this.totalProgress=0,this.isNumberTween=!1},add:function(t,e,i,s,r,n,a,o,h,l,d,c,f,p,m,g){var v=new u(this,t,e,i,s,r,n,a,o,h,l,d,c,f,p,m,g);return this.totalData=this.data.push(v),v},addFrame:function(t,e,i,s,r,n,a,o,h,l){var u=new d(this,t,e,i,s,r,n,a,o,h,l);return this.totalData=this.data.push(u),u},getValue:function(t){void 0===t&&(t=0);var e=null;return this.data&&(e=this.data[t].current),e},hasTarget:function(t){return this.targets&&-1!==this.targets.indexOf(t)},updateTo:function(t,e,i){if(void 0===i&&(i=!1),"texture"!==t)for(var s=0;s0)this.elapsed=0,this.progress=0,this.loopCounter--,this.initTweenData(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.setLoopDelayState()):(this.setActiveState(),this.dispatchEvent(n.TWEEN_LOOP,"onLoop"));else{if(!(this.completeDelay>0))return this.onCompleteHandler(),!0;this.countdown=this.completeDelay,this.setCompleteDelayState()}return!1},onCompleteHandler:function(){this.progress=1,this.totalProgress=1,s.prototype.onCompleteHandler.call(this)},play:function(){return this.isDestroyed()?(console.warn("Cannot play destroyed Tween",this),this):((this.isPendingRemove()||this.isFinished())&&this.seek(),this.paused=!1,this.setActiveState(),this)},seek:function(t,e,i){if(void 0===t&&(t=0),void 0===e&&(e=16.6),void 0===i&&(i=!1),this.isDestroyed())return console.warn("Cannot seek destroyed Tween",this),this;i||(this.isSeeking=!0),this.reset(!0),this.initTweenData(!0),this.setActiveState(),this.dispatchEvent(n.TWEEN_ACTIVE,"onActive");var s=this.paused;if(this.paused=!1,t>0){for(var r=Math.floor(t/e),a=t-r*e,o=0;o0&&this.update(a)}return this.paused=s,this.isSeeking=!1,this},initTweenData:function(t){void 0===t&&(t=!1),this.duration=0,this.startDelay=h.MAX_SAFE_INTEGER;for(var e=this.data,i=0;i0?s+r+(s+a)*n:s+r},reset:function(t){return void 0===t&&(t=!1),this.elapsed=0,this.totalElapsed=0,this.progress=0,this.totalProgress=0,this.loopCounter=this.loop,-1===this.loop&&(this.isInfinite=!0,this.loopCounter=l.MAX),t||(this.initTweenData(),this.setActiveState(),this.dispatchEvent(n.TWEEN_ACTIVE,"onActive")),this},update:function(t){if(this.isPendingRemove()||this.isDestroyed())return!this.persist||(this.setFinishedState(),!1);if(this.paused||this.isFinished())return!1;if(t*=this.timeScale*this.parent.timeScale,this.isLoopDelayed())return this.updateLoopCountdown(t),!1;if(this.isCompleteDelayed())return this.updateCompleteDelay(t),!1;this.hasStarted||(this.startDelay-=t,this.startDelay<=0&&(this.hasStarted=!0,this.dispatchEvent(n.TWEEN_START,"onStart"),t=0));var e=!1;if(this.isActive())for(var i=this.data,s=0;s0&&!this.isStartDelayed()?this.setStartDelayState():this.setActiveState(),this},add:function(t){var e=this.parent.create(t);Array.isArray(e)||(e=[e]);for(var i=this.data,s=0;s0)this.loopCounter--,this.resetTweens(),this.loopDelay>0?(this.countdown=this.loopDelay,this.setLoopDelayState()):(this.setActiveState(),this.dispatchEvent(a.TWEEN_LOOP,"onLoop"));else{if(!(this.completeDelay>0))return this.onCompleteHandler(),!0;this.countdown=this.completeDelay,this.setCompleteDelayState()}return!1},play:function(){return this.isDestroyed()?(console.warn("Cannot play destroyed TweenChain",this),this):((this.isPendingRemove()||this.isPending())&&this.resetTweens(),this.paused=!1,this.startDelay>0&&!this.isStartDelayed()?this.setStartDelayState():this.setActiveState(),this)},resetTweens:function(){for(var t=this.data,e=this.totalData,i=0;i=d?(c=u-d,u=d,f=!0):u<0&&(u=0);var p=r(u/d,0,1);this.elapsed=u,this.progress=p,this.previous=this.current,h||(p=1-p);var m=this.ease(p);this.interpolation?this.current=this.interpolation(this.interpolationData,m):this.current=this.start+(this.end-this.start)*m,n[o]=this.current,f&&(h?(e.isNumberTween&&(this.current=this.end,n[o]=this.current),this.hold>0?(this.elapsed=this.hold,this.setHoldState()):this.setStateFromEnd(c)):(e.isNumberTween&&(this.current=this.start,n[o]=this.current),this.setStateFromStart(c))),this.dispatchEvent(a.TWEEN_UPDATE,"onUpdate")}return!this.isComplete()},dispatchEvent:function(t,e){var i=this.tween;if(!i.isSeeking){var s=i.targets[this.targetIndex],r=this.key,n=this.current,a=this.previous;i.emit(t,i,r,s,n,a);var o=i.callbacks[e];o&&o.func.apply(i.callbackScope,[i,s,r,n,a].concat(o.params))}},destroy:function(){s.prototype.destroy.call(this),this.getActiveValue=null,this.getEndValue=null,this.getStartValue=null,this.ease=null}});t.exports=o},42220(t,e,i){var s=i(95042),r=i(45319),n=i(83419),a=i(842),o=new n({Extends:s,initialize:function(t,e,i,r,n,a,o,h,l,u,d){s.call(this,t,e,n,a,!1,o,h,l,u,d),this.key="texture",this.startTexture=null,this.endTexture=i,this.startFrame=null,this.endFrame=r,this.yoyo=0!==h},reset:function(t){s.prototype.reset.call(this);var e=this.tween.targets[this.targetIndex];this.startTexture||(this.startTexture=e.texture.key,this.startFrame=e.frame.name),t&&e.setTexture(this.startTexture,this.startFrame)},update:function(t){var e=this.tween,i=this.targetIndex,s=e.targets[i];if(!s)return this.setCompleteState(),!1;if(this.isCountdown&&(this.elapsed-=t,this.elapsed<=0&&(this.elapsed=0,t=0,this.isDelayed()?this.setPendingRenderState():this.isRepeating()?(this.setPlayingForwardState(),this.dispatchEvent(a.TWEEN_REPEAT,"onRepeat")):this.isHolding()&&this.setStateFromEnd(0))),this.isPendingRender())return this.startTexture&&s.setTexture(this.startTexture,this.startFrame),this.setPlayingForwardState(),!0;var n=this.isPlayingForward(),o=this.isPlayingBackward();if(n||o){var h=this.elapsed,l=this.duration,u=0,d=!1;(h+=t)>=l?(u=h-l,h=l,d=!0):h<0&&(h=0);var c=r(h/l,0,1);this.elapsed=h,this.progress=c,d&&(n?(s.setTexture(this.endTexture,this.endFrame),this.hold>0?(this.elapsed=this.hold,this.setHoldState()):this.setStateFromEnd(u)):(s.setTexture(this.startTexture,this.startFrame),this.setStateFromStart(u))),this.dispatchEvent(a.TWEEN_UPDATE,"onUpdate")}return!this.isComplete()},dispatchEvent:function(t,e){var i=this.tween;if(!i.isSeeking){var s=i.targets[this.targetIndex],r=this.key;i.emit(t,i,r,s);var n=i.callbacks[e];n&&n.func.apply(i.callbackScope,[i,s,r].concat(n.params))}},destroy:function(){s.prototype.destroy.call(this),this.startTexture=null,this.endTexture=null,this.startFrame=null,this.endFrame=null}});t.exports=o},86353(t){t.exports={CREATED:0,DELAY:2,PENDING_RENDER:4,PLAYING_FORWARD:5,PLAYING_BACKWARD:6,HOLD_DELAY:7,REPEAT_DELAY:8,COMPLETE:9,PENDING:20,ACTIVE:21,LOOP_DELAY:22,COMPLETE_DELAY:23,START_DELAY:24,PENDING_REMOVE:25,REMOVED:26,FINISHED:27,DESTROYED:28,MAX:999999999999}},83419(t){function e(t,e,i){var s=i?t[e]:Object.getOwnPropertyDescriptor(t,e);return!i&&s.value&&"object"==typeof s.value&&(s=s.value),!(!s||!function(t){return!!t.get&&"function"==typeof t.get||!!t.set&&"function"==typeof t.set}(s))&&(void 0===s.enumerable&&(s.enumerable=!0),void 0===s.configurable&&(s.configurable=!0),s)}function i(t,e){var i=Object.getOwnPropertyDescriptor(t,e);return!!i&&(i.value&&"object"==typeof i.value&&(i=i.value),!1===i.configurable)}function s(t,s,r,a){for(var o in s)if(s.hasOwnProperty(o)){var h=e(s,o,r);if(!1!==h){if(i((a||t).prototype,o)){if(n.ignoreFinals)continue;throw new Error("cannot override final property '"+o+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,o,h)}else t.prototype[o]=s[o]}}function r(t,e){if(e){Array.isArray(e)||(e=[e]);for(var i=0;i0){var n=i-t.length;if(n<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.push(e),s&&s.call(r,e),e):null;for(var a=e.length-1;a>=0;)-1!==t.indexOf(e[a])&&e.splice(a,1),a--;if(0===(a=e.length))return null;i>0&&a>n&&(e.splice(n),a=n);for(var o=0;o0){var a=s-t.length;if(a<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.splice(i,0,e),r&&r.call(n,e),e):null;for(var o=e.length-1;o>=0;)-1!==t.indexOf(e[o])&&e.pop(),o--;if(0===(o=e.length))return null;s>0&&o>a&&(e.splice(a),o=a);for(var h=o-1;h>=0;h--){var l=e[h];t.splice(i,0,l),r&&r.call(n,l)}return e}},66905(t){t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&ie.length&&(n=e.length),i?(s=e[n-1][i],(r=e[n][i])-t<=t-s?e[n]:e[n-1]):(s=e[n-1],(r=e[n])-t<=t-s?r:s)}},43491(t){var e=function(t,i){void 0===i&&(i=[]);for(var s=0;s=0;a--)if(o=t[a],!e||e&&void 0===i&&o.hasOwnProperty(e)||e&&void 0!==i&&o[e]===i)return o;return null}},26546(t){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var s=e+Math.floor(Math.random()*(i-e));return void 0===t[s]?null:t[s]}},85835(t){t.exports=function(t,e,i){if(e===i)return t;var s=t.indexOf(e),r=t.indexOf(i);if(s<0||r<0)throw new Error("Supplied items must be elements of the same array");return s>r||(t.splice(s,1),r=t.indexOf(i),t.splice(r+1,0,e)),t}},83371(t){t.exports=function(t,e,i){if(e===i)return t;var s=t.indexOf(e),r=t.indexOf(i);if(s<0||r<0)throw new Error("Supplied items must be elements of the same array");return s0){var s=t[i-1],r=t.indexOf(s);t[i]=s,t[r]=e}return t}},69693(t){t.exports=function(t,e,i){var s=t.indexOf(e);if(-1===s||i<0||i>=t.length)throw new Error("Supplied index out of bounds");return s!==i&&(t.splice(s,1),t.splice(i,0,e)),e}},40853(t){t.exports=function(t,e){var i=t.indexOf(e);if(-1!==i&&i=e;r--)a?n.push(i+r.toString()+s):n.push(r);else for(r=t;r<=e;r++)a?n.push(i+r.toString()+s):n.push(r);return n}},593(t,e,i){var s=i(2284);t.exports=function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=null),void 0===i&&(i=1),null===e&&(e=t,t=0);for(var r=[],n=Math.max(s((e-t)/(i||1)),0),a=0;ae?1:0}var s=function(t,r,n,a,o){for(void 0===n&&(n=0),void 0===a&&(a=t.length-1),void 0===o&&(o=i);a>n;){if(a-n>600){var h=a-n+1,l=r-n+1,u=Math.log(h),d=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*d*(h-d)/h)*(l-h/2<0?-1:1),f=Math.max(n,Math.floor(r-l*d/h+c)),p=Math.min(a,Math.floor(r+(h-l)*d/h+c));s(t,r,f,p,o)}var m=t[r],g=n,v=a;for(e(t,n,r),o(t[a],m)>0&&e(t,n,a);g0;)v--}0===o(t[n],m)?e(t,n,v):e(t,++v,a),v<=r&&(n=v+1),r<=v&&(a=v-1)}};t.exports=s},88492(t,e,i){var s=i(35154),r=i(33680),n=function(t,e,i){for(var s=[],r=0;r=0;){var h=e[a];-1!==(n=t.indexOf(h))&&(s(t,n),o.push(h),i&&i.call(r,h)),a--}return o}},60248(t,e,i){var s=i(19133);t.exports=function(t,e,i,r){if(void 0===r&&(r=t),e<0||e>t.length-1)throw new Error("Index out of bounds");var n=s(t,e);return i&&i.call(r,n),n}},81409(t,e,i){var s=i(82011);t.exports=function(t,e,i,r,n){if(void 0===e&&(e=0),void 0===i&&(i=t.length),void 0===n&&(n=t),s(t,e,i)){var a=i-e,o=t.splice(e,a);if(r)for(var h=0;h=r||e>=i||i>r){if(s)throw new Error("Range Error: Values outside acceptable range");return!1}return!0}},89545(t){t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i>0&&(t.splice(i,1),t.unshift(e)),e}},17810(t,e,i){var s=i(82011);t.exports=function(t,e,i,r,n){if(void 0===r&&(r=0),void 0===n&&(n=t.length),s(t,r,n))for(var a=r;a0;e--){var i=Math.floor(Math.random()*(e+1)),s=t[e];t[e]=t[i],t[i]=s}return t}},90126(t){t.exports=function(t){var e=/\D/g;return t.sort(function(t,i){return parseInt(t.replace(e,""),10)-parseInt(i.replace(e,""),10)}),t}},19133(t){t.exports=function(t,e){if(!(e>=t.length)){for(var i=t.length-1,s=t[e],r=e;rl&&(n=l),a>l&&(a=l),o=r,h=n;;)if(o-1;n--)s[r][n]=t[n][r]}return s}},54915(t,e,i){t.exports={CheckMatrix:i(86922),MatrixToString:i(63362),ReverseColumns:i(92598),ReverseRows:i(21224),Rotate180:i(98717),RotateLeft:i(44657),RotateMatrix:i(37829),RotateRight:i(92632),Translate:i(69512),TransposeMatrix:i(2429)}},71334(t){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";t.exports=function(t,i){for(var s=new Uint8Array(t),r=s.length,n=i?"data:"+i+";base64,":"",a=0;a>2],n+=e[(3&s[a])<<4|s[a+1]>>4],n+=e[(15&s[a+1])<<2|s[a+2]>>6],n+=e[63&s[a+2]];return r%3==2?n=n.substring(0,n.length-1)+"=":r%3==1&&(n=n.substring(0,n.length-2)+"=="),n}},53134(t){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=new Uint8Array(256),s=0;s<64;s++)i[e.charCodeAt(s)]=s;t.exports=function(t){var e,s,r,n,a=(t=t.substr(t.indexOf(",")+1)).length,o=.75*a,h=0;"="===t[a-1]&&(o--,"="===t[a-2]&&o--);for(var l=new ArrayBuffer(o),u=new Uint8Array(l),d=0;d>4,u[h++]=(15&s)<<4|r>>2,u[h++]=(3&r)<<6|63&n;return l}},65839(t,e,i){t.exports={ArrayBufferToBase64:i(71334),Base64ToArrayBuffer:i(53134)}},91799(t,e,i){t.exports={Array:i(37105),Base64:i(65839),Objects:i(1183),String:i(31749),NOOP:i(29747),NULL:i(20242)}},41786(t){t.exports=function(t){var e={};for(var i in t)Array.isArray(t[i])?e[i]=t[i].slice(0):e[i]=t[i];return e}},62644(t){var e=function(t){var i,s,r;if("object"!=typeof t||null===t)return t;for(r in i=Array.isArray(t)?[]:{},t)s=t[r],i[r]=e(s);return i};t.exports=e},79291(t,e,i){var s=i(41212),r=function(){var t,e,i,n,a,o,h=arguments[0]||{},l=1,u=arguments.length,d=!1;for("boolean"==typeof h&&(d=h,h=arguments[1]||{},l=2),u===l&&(h=this,--l);l=(t=t.toString()).length)switch(s){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var n=Math.ceil((r=e-t.length)/2);t=new Array(r-n+1).join(i)+t+new Array(n+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t}},33628(t){t.exports=function(t,e){return 0===e?t.slice(1):t.slice(0,e)+t.slice(e+1)}},27671(t){t.exports=function(t){return t.split("").reverse().join("")}},45650(t){t.exports=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})}},35355(t){t.exports=function(t){return t&&t[0].toUpperCase()+t.slice(1)}},31749(t,e,i){t.exports={Format:i(27902),Pad:i(41836),RemoveAt:i(33628),Reverse:i(27671),UppercaseFirst:i(35355),UUID:i(45650)}}},e={};function i(s){var r=e[s];if(void 0!==r)return r.exports;var n=e[s]={exports:{}};return t[s](n,n.exports,i),n.exports}return i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i(97139)})()); \ No newline at end of file +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Phaser",[],e):"object"==typeof exports?exports.Phaser=e():t.Phaser=e()}(this,()=>(()=>{var t={7889(t,e,i){"use strict";i.r(e),i.d(e,{Depth:()=>o,DepthDescriptors:()=>a,default:()=>h});var s=i(42969),r=i(37105),n=i.n(r);const a={_depth:0,depth:{get:function(){return this._depth},set:function(t){this.displayList&&this.displayList.queueDepthSort(),this._depth=t}},setDepth:function(t){return void 0===t&&(t=0),this.depth=t,this},setToTop:function(){const t=this.getDisplayList();return t&&n().BringToTop(t,this),this},setToBack:function(){const t=this.getDisplayList();return t&&n().SendToBack(t,this),this},setAbove:function(t){const e=this.getDisplayList();return e&&t&&n().MoveAbove(e,this,t),this},setBelow:function(t){const e=this.getDisplayList();return e&&t&&n().MoveBelow(e,this,t),this}},o=(0,s.lv)()(function(t){return(0,s.AD)(t,a),t}),h=o},36626(t,e,i){"use strict";i.r(e),i.d(e,{Visible:()=>n,VisibleDescriptors:()=>r,default:()=>a});var s=i(42969);const r={_visible:!0,visible:{get:function(){return this._visible},set:function(t){t?(this._visible=!0,this.renderFlags|=1):(this._visible=!1,this.renderFlags&=-2)}},setVisible:function(t){return this.visible=t,this}},n=(0,s.lv)()(function(t){return(0,s.AD)(t,r),t}),a=n},18134(t,e,i){"use strict";i.d(e,{default:()=>n});var s=i(70038);class r extends s.default{constructor(t,e,i,s){super(t,e),this.vx=0,this.vy=0,this.u=i,this.v=s}setUVs(t,e){return this.u=t,this.v=e,this}resize(t,e,i,s,r,n){return this.x=t,this.y=e,this.vx=this.x*i,this.vy=-this.y*s,r<.5?this.vx+=i*(.5-r):r>.5&&(this.vx-=i*(r-.5)),n<.5?this.vy+=s*(.5-n):n>.5&&(this.vy-=s*(n-.5)),this}}const n=r},58715(t,e,i){"use strict";i.d(e,{default:()=>T});var s=i(10312),r=i.n(s),n=i(96503),a=i.n(n),o=i(87902),h=i.n(o),l=i(31401),u=i.n(l),d=i(59428),c=i(72488),f=i(36626),p=i(7889),m=i(42969),g=i(95643);const v=i.n(g)(),x=(0,m.fP)(f.Visible,p.Depth)(v);class y extends x{constructor(t,e,i,s=1,n=s){super(t,"Zone"),this.setPosition(e,i),this.width=s,this.height=n,this.blendMode=r().NORMAL,this.updateDisplayOrigin()}get displayWidth(){return this.scaleX*this.width}set displayWidth(t){this.scaleX=t/this.width}get displayHeight(){return this.scaleY*this.height}set displayHeight(t){this.scaleY=t/this.height}setSize(t,e,i=!0){this.width=t,this.height=e,this.updateDisplayOrigin();const s=this.input;return i&&s&&!s.customHitArea&&(s.hitArea.width=t,s.hitArea.height=e),this}setDisplaySize(t,e){return this.displayWidth=t,this.displayHeight=e,this}setCircleDropZone(t){return this.setDropZone(new(a())(0,0,t),h())}setRectangleDropZone(t,e){return this.setDropZone(new d.Rectangle(0,0,t,e),c.Contains)}setDropZone(t,e){return this.input||this.setInteractive(t,e,!0),this}setAlpha(){}setBlendMode(){}renderCanvas(t,e,i){i.addToRenderList(e)}renderWebGL(t,e,i){i.camera.addToRenderList(e)}}(0,m.AD)(y,u().GetBounds),(0,m.AD)(y,u().Origin),(0,m.AD)(y,u().ScrollFactor),(0,m.AD)(y,u().Transform);const T=y},72488(t,e,i){"use strict";function s(t,e,i){return!(t.width<=0||t.height<=0)&&(t.x<=e&&t.x+t.width>=e&&t.y<=i&&t.y+t.height>=i)}i.r(e),i.d(e,{Contains:()=>s,default:()=>r});const r=s},59428(t,e,i){"use strict";i.r(e),i.d(e,{Rectangle:()=>p,default:()=>m});var s=i(72488),r=i(20812),n=i.n(r),a=i(34819),o=i.n(a),h=i(23777),l=i.n(h),u=i(23031),d=i.n(u),c=i(26597),f=i.n(c);class p{constructor(t=0,e=0,i=0,s=0){this.type=l().RECTANGLE,this.x=t,this.y=e,this.width=i,this.height=s}contains(t,e){return(0,s.default)(this,t,e)}getPoint(t,e){return n()(this,t,e)}getPoints(t,e,i){return o()(this,t,e,i)}getRandomPoint(t){return f()(this,t)}setTo(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this}setEmpty(){return this.setTo(0,0,0,0)}setPosition(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this}setSize(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this}isEmpty(){return this.width<=0||this.height<=0}getLineA(t){return void 0===t&&(t=new(d())),t.setTo(this.x,this.y,this.right,this.y),t}getLineB(t){return void 0===t&&(t=new(d())),t.setTo(this.right,this.y,this.right,this.bottom),t}getLineC(t){return void 0===t&&(t=new(d())),t.setTo(this.right,this.bottom,this.x,this.bottom),t}getLineD(t){return void 0===t&&(t=new(d())),t.setTo(this.x,this.bottom,this.x,this.y),t}get left(){return this.x}set left(t){t>=this.right?this.width=0:this.width=this.right-t,this.x=t}get right(){return this.x+this.width}set right(t){t<=this.x?this.width=0:this.width=t-this.x}get top(){return this.y}set top(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}get bottom(){return this.y+this.height}set bottom(t){t<=this.y?this.height=0:this.height=t-this.y}get centerX(){return this.x+this.width/2}set centerX(t){this.x=t-this.width/2}get centerY(){return this.y+this.height/2}set centerY(t){this.y=t-this.height/2}}const m=p},350(t,e,i){"use strict";i.d(e,{default:()=>s});const s=function(t,e,i){return Math.max(e,Math.min(i,t))}},70038(t,e,i){"use strict";i.d(e,{default:()=>n});var s=i(30010);const r=class t{constructor(t,e){this.x=0,this.y=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0):(void 0===e&&(e=t),this.x=t||0,this.y=e||0)}clone(){return new t(this.x,this.y)}copy(t){return this.x=t.x||0,this.y=t.y||0,this}setFromObject(t){return this.x=t.x||0,this.y=t.y||0,this}set(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this}setTo(t,e){return this.set(t,e)}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}invert(){return this.set(this.y,this.x)}setToPolar(t,e){return null==e&&(e=1),this.x=Math.cos(t)*e,this.y=Math.sin(t)*e,this}equals(t){return this.x===t.x&&this.y===t.y}fuzzyEquals(t,e){return(0,s.default)(this.x,t.x,e)&&(0,s.default)(this.y,t.y,e)}angle(){let t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t}setAngle(t){return this.setToPolar(t,this.length())}add(t){return this.x+=t.x,this.y+=t.y,this}subtract(t){return this.x-=t.x,this.y-=t.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}scale(t){return isFinite(t)?(this.x*=t,this.y*=t):(this.x=0,this.y=0),this}divide(t){return this.x/=t.x,this.y/=t.y,this}negate(){return this.x=-this.x,this.y=-this.y,this}distance(t){const e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)}distanceSq(t){const e=t.x-this.x,i=t.y-this.y;return e*e+i*i}length(){const t=this.x,e=this.y;return Math.sqrt(t*t+e*e)}setLength(t){return this.normalize().scale(t)}lengthSq(){const t=this.x,e=this.y;return t*t+e*e}normalize(){const t=this.x,e=this.y;let i=t*t+e*e;return i>0&&(i=1/Math.sqrt(i),this.x=t*i,this.y=e*i),this}normalizeRightHand(){const t=this.x;return this.x=-1*this.y,this.y=t,this}normalizeLeftHand(){const t=this.x;return this.x=this.y,this.y=-1*t,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lerp(t,e=0){const i=this.x,s=this.y;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this}transformMat3(t){const e=this.x,i=this.y,s=t.val;return this.x=s[0]*e+s[3]*i+s[6],this.y=s[1]*e+s[4]*i+s[7],this}transformMat4(t){const e=this.x,i=this.y,s=t.val;return this.x=s[0]*e+s[4]*i+s[12],this.y=s[1]*e+s[5]*i+s[13],this}reset(){return this.x=0,this.y=0,this}limit(t){const e=this.length();return e&&e>t&&this.scale(t/e),this}reflect(t){const e=t.clone().normalize();return this.subtract(e.scale(2*this.dot(e)))}mirror(t){return this.reflect(t).negate()}rotate(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e*this.x-i*this.y,i*this.x+e*this.y)}project(t){const e=this.dot(t)/t.dot(t);return this.copy(t).scale(e)}projectUnit(e,i){void 0===i&&(i=new t);const s=this.x*e.x+this.y*e.y;return 0!==s&&(i.x=s*e.x,i.y=s*e.y),i}};r.ZERO=new r,r.RIGHT=new r(1,0),r.LEFT=new r(-1,0),r.UP=new r(0,-1),r.DOWN=new r(0,1),r.ONE=new r(1,1);const n=r},68077(t,e,i){"use strict";i.d(e,{default:()=>s});const s=function(t,e,i){const s=i-e;return e+((t-e)%s+s)%s}},30010(t,e,i){"use strict";i.d(e,{default:()=>s});const s=function(t,e,i=1e-4){return Math.abs(t-e)r});const r=class{constructor(t){this.entries={},this.size=0,this.setAll(t)}setAll(t){if(Array.isArray(t))for(let e=0;et.reduce((t,e)=>e(t),e)}i.d(e,{AD:()=>r,fP:()=>a,lv:()=>n})},50792(t){"use strict";var e=Object.prototype.hasOwnProperty,i="~";function s(){}function r(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function n(t,e,s,n,a){if("function"!=typeof s)throw new TypeError("The listener must be a function");var o=new r(s,n||t,a),h=i?i+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],o]:t._events[h].push(o):(t._events[h]=o,t._eventsCount++),t}function a(t,e){0===--t._eventsCount?t._events=new s:delete t._events[e]}function o(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),(new s).__proto__||(i=!1)),o.prototype.eventNames=function(){var t,s,r=[];if(0===this._eventsCount)return r;for(s in t=this._events)e.call(t,s)&&r.push(i?s.slice(1):s);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},o.prototype.listeners=function(t){var e=i?i+t:t,s=this._events[e];if(!s)return[];if(s.fn)return[s.fn];for(var r=0,n=s.length,a=new Array(n);r3*Math.PI/2?p.y=1:l>Math.PI?(p.x=1,p.y=1):l>Math.PI/2&&(p.x=1);for(var m=[],g=0;g0&&u.enableFilters().filters.external.addBlur(e.blurQuality,e.blurRadius,e.blurRadius,1,void 0,e.blurSteps),d instanceof s&&d.enableFilters();var f=(e.useInternal?d.filters.internal:d.filters.external).addMask(u,e.invert);h.push(f)}return h}},11517(t,e,i){var s=i(38829);t.exports=function(t,e,i,r){for(var n=t[0],a=1;a=i;s--){var r=t[s],n=!0;for(var a in e)r[a]!==e[a]&&(n=!1);if(n)return r}return null}},94420(t,e,i){var s=i(11879),r=i(60461),n=i(95540),a=i(29747),o=new(i(41481))({sys:{queueDepthSort:a,events:{once:a}}},0,0,1,1).setOrigin(0,0);t.exports=function(t,e){void 0===e&&(e={});var i=e.hasOwnProperty("width"),a=e.hasOwnProperty("height"),h=n(e,"width",-1),l=n(e,"height",-1),u=n(e,"cellWidth",1),d=n(e,"cellHeight",u),c=n(e,"position",r.TOP_LEFT),f=n(e,"x",0),p=n(e,"y",0),m=0,g=0,v=h*u,x=l*d;o.setPosition(f,p),o.setSize(u,d);for(var y=0;y0?r(a,i):i<0&&n(a,Math.abs(i));for(var o=0;o=0;a--)t[a][e]+=i+o*s,o++;return t}},43967(t){t.exports=function(t,e,i,s,r,n){var a;void 0===s&&(s=0),void 0===r&&(r=0),void 0===n&&(n=1);var o=0,h=t.length;if(1===n)for(a=r;a=0;a--)t[a][e]=i+o*s,o++;return t}},88926(t,e,i){var s=i(28176);t.exports=function(t,e){for(var i=0;i=h||-1===l)){var c=t[l],f=c.x,p=c.y;c.x=a,c.y=o,a=f,o=p,0===r?l--:l++}}return n.x=a,n.y=o,n}},8628(t,e,i){var s=i(33680);t.exports=function(t){return s(t)}},21837(t,e,i){var s=i(7602);t.exports=function(t,e,i,r,n){void 0===n&&(n=!1);var a,o=Math.abs(r-i)/t.length;if(n)for(a=0;a0){if(0===t)this.frames=i.concat(this.frames);else if(t===this.frames.length)this.frames=this.frames.concat(i);else{var s=this.frames.slice(0,t),r=this.frames.slice(t);this.frames=s.concat(i,r)}this.updateFrameSequence()}return this},checkFrame:function(t){return t>=0&&t0){n.isLast=!0,n.nextFrame=d[0],d[0].prevFrame=n;var x=1/(d.length-1);for(a=0;a0?t.inReverse&&t.forward?t.forward=!1:this.repeatAnimation(t):t.complete():this.updateAndGetNextTick(t,e.nextFrame)},handleYoyoFrame:function(t,e){if(e||(e=!1),t.inReverse===!e&&t.repeatCounter>0)return(0===t.repeatDelay||t.pendingRepeat)&&(t.forward=e),void this.repeatAnimation(t);if(t.inReverse===e||0!==t.repeatCounter){t.forward=e;var i=e?t.currentFrame.nextFrame:t.currentFrame.prevFrame;this.updateAndGetNextTick(t,i)}else t.complete()},getLastFrame:function(){return this.frames[this.frames.length-1]},previousFrame:function(t){var e=t.currentFrame;e.isFirst?t.yoyo?this.handleYoyoFrame(t,!0):t.repeatCounter>0?(t.inReverse&&!t.forward||(t.forward=!0),this.repeatAnimation(t)):t.complete():this.updateAndGetNextTick(t,e.prevFrame)},updateAndGetNextTick:function(t,e){t.setCurrentFrame(e),this.getNextTick(t)},removeFrame:function(t){var e=this.frames.indexOf(t);return-1!==e&&this.removeFrameAt(e),this},removeFrameAt:function(t){return this.frames.splice(t,1),this.updateFrameSequence(),this},repeatAnimation:function(t){if(2===t._pendingStop){if(0===t._pendingStopValue)return t.stop();t._pendingStopValue--}t.repeatDelay>0&&!t.pendingRepeat?(t.pendingRepeat=!0,t.accumulator-=t.nextTick,t.nextTick+=t.repeatDelay):(t.repeatCounter--,t.forward?t.setCurrentFrame(t.currentFrame.nextFrame):t.setCurrentFrame(t.currentFrame.prevFrame),t.isPlaying&&(this.getNextTick(t),t.handleRepeat()))},toJSON:function(){var t={key:this.key,type:this.type,frames:[],frameRate:this.frameRate,duration:this.duration,skipMissedFrames:this.skipMissedFrames,delay:this.delay,repeat:this.repeat,repeatDelay:this.repeatDelay,yoyo:this.yoyo,showBeforeDelay:this.showBeforeDelay,showOnStart:this.showOnStart,randomFrame:this.randomFrame,hideOnComplete:this.hideOnComplete};return this.frames.forEach(function(e){t.frames.push(e.toJSON())}),t},updateFrameSequence:function(){for(var t,e=this.frames.length,i=1/(e-1),s=0;s1?(t.isLast=!0,t.prevFrame=this.frames[e-2],t.nextFrame=this.frames[0]):e>1&&(t.prevFrame=this.frames[s-1],t.nextFrame=this.frames[s+1]);return this},pause:function(){return this.paused=!0,this},resume:function(){return this.paused=!1,this},destroy:function(){this.manager.off&&(this.manager.off(n.PAUSE_ALL,this.pause,this),this.manager.off(n.RESUME_ALL,this.resume,this)),this.manager.remove(this.key);for(var t=0;t-1)){for(var p=0,m=u;m<=c;m++){var g=m.toString(),v=o[g];if(v){var x=l(v,"duration",d.MAX_SAFE_INTEGER);a.push({key:t,frame:g,duration:x}),p+=x}}"reverse"===f&&(a=a.reverse());var y,T={key:h,frames:a,duration:p,yoyo:"pingpong"===f};i?i.anims&&(y=i.anims.create(T)):y=n.create(T),y&&s.push(y)}});return s},create:function(t){var e=t.key,i=!1;return e&&((i=this.get(e))?console.warn("AnimationManager key already exists: "+e):(i=new s(this,e,t),this.anims.set(e,i),this.emit(o.ADD_ANIMATION,e,i))),i},fromJSON:function(t,e){void 0===e&&(e=!1),e&&this.anims.clear(),"string"==typeof t&&(t=JSON.parse(t));var i=[];if(t.hasOwnProperty("anims")&&Array.isArray(t.anims)){for(var s=0;sn&&(l=0),this.randomFrame&&(l=r(0,n-1));var u=s.frames[l];0!==l||this.forward||(u=s.getLastFrame()),this.currentFrame=u}else console.warn("Missing animation: "+i);return this.parent},pause:function(t){return this._paused||(this._paused=!0,this._wasPlaying=this.isPlaying,this.isPlaying=!1),void 0!==t&&this.setCurrentFrame(t),this.parent},resume:function(t){return this._paused&&(this._paused=!1,this.isPlaying=this._wasPlaying),void 0!==t&&this.setCurrentFrame(t),this.parent},playAfterDelay:function(t,e){if(this.isPlaying){var i=this.nextAnim,s=this.nextAnimsQueue;i&&s.unshift(i),this.nextAnim=t,this._pendingStop=1,this._pendingStopValue=e}else this.delayCounter=e,this.play(t,!0);return this.parent},playAfterRepeat:function(t,e){if(void 0===e&&(e=1),this.isPlaying){var i=this.nextAnim,s=this.nextAnimsQueue;i&&s.unshift(i),-1!==this.repeatCounter&&e>this.repeatCounter&&(e=this.repeatCounter),this.nextAnim=t,this._pendingStop=2,this._pendingStopValue=e}else this.play(t);return this.parent},play:function(t,e){void 0===e&&(e=!1);var i=this.currentAnim,s=this.parent,r="string"==typeof t?t:t.key;if(e&&this.isPlaying&&i.key===r)return s;if(i&&this.isPlaying){var n=this.animationManager.getMix(i.key,t);if(n>0)return this.playAfterDelay(t,n)}return this.forward=!0,this.inReverse=!1,this._paused=!1,this._wasPlaying=!0,this.startAnimation(t)},playReverse:function(t,e){void 0===e&&(e=!1);var i="string"==typeof t?t:t.key;return e&&this.isPlaying&&this.currentAnim.key===i?this.parent:(this.forward=!1,this.inReverse=!0,this._paused=!1,this._wasPlaying=!0,this.startAnimation(t))},startAnimation:function(t){this.load(t);var e=this.currentAnim,i=this.parent;return e?(this.repeatCounter=-1===this.repeat?Number.MAX_VALUE:this.repeat,e.getFirstTick(this),this.isPlaying=!0,this.pendingRepeat=!1,this.hasStarted=!1,this._pendingStop=0,this._pendingStopValue=0,this._paused=!1,this.delayCounter+=this.delay,0===this.delayCounter?this.handleStart():this.showBeforeDelay&&this.setCurrentFrame(this.currentFrame),i):i},handleStart:function(){this.showOnStart&&this.parent.setVisible(!0),this.setCurrentFrame(this.currentFrame),this.hasStarted=!0,this.emitEvents(o.ANIMATION_START)},handleRepeat:function(){this.pendingRepeat=!1,this.emitEvents(o.ANIMATION_REPEAT)},handleStop:function(){this._pendingStop=0,this.isPlaying=!1,this.emitEvents(o.ANIMATION_STOP)},handleComplete:function(){this._pendingStop=0,this.isPlaying=!1,this.hideOnComplete&&this.parent.setVisible(!1),this.emitEvents(o.ANIMATION_COMPLETE,o.ANIMATION_COMPLETE_KEY)},emitEvents:function(t,e){var i=this.currentAnim;if(i){var s=this.currentFrame,r=this.parent,n=s.textureFrame;r.emit(t,i,s,r,n),e&&r.emit(e+i.key,i,s,r,n)}},reverse:function(){return this.isPlaying&&(this.inReverse=!this.inReverse,this.forward=!this.forward),this.parent},getProgress:function(){var t=this.currentFrame;if(!t)return 0;var e=t.progress;return this.inReverse&&(e*=-1),e},setProgress:function(t){return this.forward||(t=1-t),this.setCurrentFrame(this.currentAnim.getFrameByProgress(t)),this.parent},setRepeat:function(t){return this.repeatCounter=-1===t?Number.MAX_VALUE:t,this.parent},globalRemove:function(t,e){void 0===e&&(e=this.currentAnim),this.isPlaying&&e.key===this.currentAnim.key&&(this.stop(),this.setCurrentFrame(this.currentAnim.frames[0]))},restart:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1);var i=this.currentAnim,s=this.parent;return i?(e&&(this.repeatCounter=-1===this.repeat?Number.MAX_VALUE:this.repeat),i.getFirstTick(this),this.emitEvents(o.ANIMATION_RESTART),this.isPlaying=!0,this.pendingRepeat=!1,this.hasStarted=!t,this._pendingStop=0,this._pendingStopValue=0,this._paused=!1,this.setCurrentFrame(i.frames[0]),this.parent):s},complete:function(){if(this._pendingStop=0,this.isPlaying=!1,this.currentAnim&&this.handleComplete(),this.nextAnim){var t=this.nextAnim;this.nextAnim=this.nextAnimsQueue.length>0?this.nextAnimsQueue.shift():null,this.play(t)}return this.parent},stop:function(){if(this._pendingStop=0,this.isPlaying=!1,this.delayCounter=0,this.currentAnim&&this.handleStop(),this.nextAnim){var t=this.nextAnim;this.nextAnim=this.nextAnimsQueue.shift(),this.play(t)}return this.parent},stopAfterDelay:function(t){return this._pendingStop=1,this._pendingStopValue=t,this.parent},stopAfterRepeat:function(t){return void 0===t&&(t=1),-1!==this.repeatCounter&&t>this.repeatCounter&&(t=this.repeatCounter),this._pendingStop=2,this._pendingStopValue=t,this.parent},stopOnFrame:function(t){return this._pendingStop=3,this._pendingStopValue=t,this.parent},getTotalFrames:function(){return this.currentAnim?this.currentAnim.getTotalFrames():0},update:function(t,e){var i=this.currentAnim;if(this.isPlaying&&i&&!i.paused){if(this.accumulator+=e*this.timeScale*this.animationManager.globalTimeScale,1===this._pendingStop&&(this._pendingStopValue-=e,this._pendingStopValue<=0))return this.stop();if(this.hasStarted){if(this.accumulator>=this.nextTick&&(this.forward?i.nextFrame(this):i.previousFrame(this),this.isPlaying&&0===this._pendingStop&&this.skipMissedFrames&&this.accumulator>this.nextTick)){var s=0;do{this.forward?i.nextFrame(this):i.previousFrame(this),s++}while(this.isPlaying&&this.accumulator>this.nextTick&&s<60)}}else this.accumulator>=this.delayCounter&&(this.accumulator-=this.delayCounter,this.handleStart())}},setCurrentFrame:function(t){var e=this.parent;return this.currentFrame=t,e.texture=t.frame.texture,e.frame=t.frame,e.isCropped&&e.frame.updateCropUVs(e._crop,e.flipX,e.flipY),t.setAlpha&&(e.alpha=t.alpha),e.setSizeToFrame(),e._originComponent&&(t.frame.customPivot?e.setOrigin(t.frame.pivotX,t.frame.pivotY):e.updateDisplayOrigin()),this.isPlaying&&this.hasStarted&&(this.emitEvents(o.ANIMATION_UPDATE),3===this._pendingStop&&this._pendingStopValue===t&&this.stop()),e},nextFrame:function(){return this.currentAnim&&this.currentAnim.nextFrame(this),this.parent},previousFrame:function(){return this.currentAnim&&this.currentAnim.previousFrame(this),this.parent},get:function(t){return this.anims?this.anims.get(t):null},exists:function(t){return!!this.anims&&this.anims.has(t)},create:function(t){var e=t.key,i=!1;return e&&((i=this.get(e))?console.warn("Animation key already exists: "+e):(i=new s(this,e,t),this.anims||(this.anims=new a),this.anims.set(e,i))),i},createFromAseprite:function(t,e){return this.animationManager.createFromAseprite(t,e,this.parent)},generateFrameNames:function(t,e){return this.animationManager.generateFrameNames(t,e)},generateFrameNumbers:function(t,e){return this.animationManager.generateFrameNumbers(t,e)},remove:function(t){var e=this.get(t);return e&&(this.currentAnim===e&&this.stop(),this.anims.delete(t)),e},destroy:function(){this.animationManager.off(o.REMOVE_ANIMATION,this.globalRemove,this),this.anims&&this.anims.clear(),this.animationManager=null,this.parent=null,this.nextAnim=null,this.nextAnimsQueue.length=0,this.currentAnim=null,this.currentFrame=null},isPaused:{get:function(){return this._paused}}});t.exports=l},57090(t){t.exports="add"},25312(t){t.exports="animationcomplete"},89580(t){t.exports="animationcomplete-"},52860(t){t.exports="animationrepeat"},63850(t){t.exports="animationrestart"},99085(t){t.exports="animationstart"},28087(t){t.exports="animationstop"},1794(t){t.exports="animationupdate"},52562(t){t.exports="pauseall"},57953(t){t.exports="remove"},68339(t){t.exports="resumeall"},74943(t,e,i){t.exports={ADD_ANIMATION:i(57090),ANIMATION_COMPLETE:i(25312),ANIMATION_COMPLETE_KEY:i(89580),ANIMATION_REPEAT:i(52860),ANIMATION_RESTART:i(63850),ANIMATION_START:i(99085),ANIMATION_STOP:i(28087),ANIMATION_UPDATE:i(1794),PAUSE_ALL:i(52562),REMOVE_ANIMATION:i(57953),RESUME_ALL:i(68339)}},60421(t,e,i){t.exports={Animation:i(42099),AnimationFrame:i(41138),AnimationManager:i(60848),AnimationState:i(9674),Events:i(74943)}},2161(t,e,i){var s=i(83419),r=i(90330),n=i(50792),a=i(24736),o=new s({initialize:function(){this.entries=new r,this.events=new n},add:function(t,e){return this.entries.set(t,e),this.events.emit(a.ADD,this,t,e),this},has:function(t){return this.entries.has(t)},exists:function(t){return this.entries.has(t)},get:function(t){return this.entries.get(t)},remove:function(t){var e=this.get(t);return e&&(this.entries.delete(t),this.events.emit(a.REMOVE,this,t,e.data)),this},getKeys:function(){return this.entries.keys()},destroy:function(){this.entries.clear(),this.events.removeAllListeners(),this.entries=null,this.events=null}});t.exports=o},24047(t,e,i){var s=i(2161),r=i(83419),n=i(8443),a=new r({initialize:function(t){this.game=t,this.binary=new s,this.bitmapFont=new s,this.json=new s,this.physics=new s,this.shader=new s,this.audio=new s,this.video=new s,this.text=new s,this.html=new s,this.tilemap=new s,this.xml=new s,this.atlas=new s,this.custom={},this.game.events.once(n.DESTROY,this.destroy,this)},addCustom:function(t){return this.custom.hasOwnProperty(t)||(this.custom[t]=new s),this.custom[t]},destroy:function(){for(var t=["binary","bitmapFont","json","physics","shader","audio","video","text","html","tilemap","xml","atlas"],e=0;ef&&w*i+S*rd&&w*s+S*nr&&(t=r),t},clampY:function(t){var e=this._bounds,i=this.displayHeight,s=e.y+(i-this.height)/2,r=Math.max(s,s+e.height-i);return tr&&(t=r),t},removeBounds:function(){return this.useBounds=!1,this.dirty=!0,this._bounds.setEmpty(),this},setAngle:function(t){return void 0===t&&(t=0),this.rotation=r(t),this},setBackgroundColor:function(t){return void 0===t&&(t="rgba(0,0,0,0)"),this.backgroundColor=d(t),this.transparent=0===this.backgroundColor.alpha,this},setBounds:function(t,e,i,s,r){return void 0===r&&(r=!1),this._bounds.setTo(t,e,i,s),this.dirty=!0,this.useBounds=!0,r?this.centerToBounds():(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},setForceComposite:function(t){return this.forceComposite=t,this},getBounds:function(t){void 0===t&&(t=new o);var e=this._bounds;return t.setTo(e.x,e.y,e.width,e.height),t},setName:function(t){return void 0===t&&(t=""),this.name=t,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setRoundPixels:function(t){return this.roundPixels=t,this},setScene:function(t,e){void 0===e&&(e=!0),this.scene&&this._customViewport&&this.sceneManager.customViewports--,this.scene=t,this.isSceneCamera=e;var i=t.sys;return this.sceneManager=i.game.scene,this.scaleManager=i.scale,this.cameraManager=i.cameras,this.updateSystem(),this},setScroll:function(t,e){return void 0===e&&(e=t),this.scrollX=t,this.scrollY=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},setViewport:function(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this},setZoom:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),0===t&&(t=.001),0===e&&(e=.001),this.zoomX=t,this.zoomY=e,this},setMask:function(t,e){return void 0===e&&(e=!0),this.mask=t,this._maskCamera=e?this.cameraManager.default:this,this},clearMask:function(t){return void 0===t&&(t=!1),t&&this.mask&&this.mask.destroy(),this.mask=null,this},toJSON:function(){var t={name:this.name,x:this.x,y:this.y,width:this.width,height:this.height,zoom:this.zoom,rotation:this.rotation,roundPixels:this.roundPixels,scrollX:this.scrollX,scrollY:this.scrollY,backgroundColor:this.backgroundColor.rgba};return this.useBounds&&(t.bounds={x:this._bounds.x,y:this._bounds.y,width:this._bounds.width,height:this._bounds.height}),t},update:function(){},setIsSceneCamera:function(t){return this.isSceneCamera=t,this},updateSystem:function(){if(this.scaleManager&&this.isSceneCamera){var t=0!==this._x||0!==this._y||this.scaleManager.width!==this._width||this.scaleManager.height!==this._height,e=this.sceneManager;t&&!this._customViewport?e.customViewports++:!t&&this._customViewport&&e.customViewports--,this.dirty=!0,this._customViewport=t}},destroy:function(){this.emit(a.DESTROY,this),this.removeAllListeners(),this.matrix.destroy(),this.matrixCombined.destroy(),this.matrixExternal.destroy(),this.culledObjects=[],this._customViewport&&this.sceneManager.customViewports--,this.renderList=[],this._bounds=null,this.scene=null,this.scaleManager=null,this.sceneManager=null,this.cameraManager=null},x:{get:function(){return this._x},set:function(t){this._x=t,this.updateSystem()}},y:{get:function(){return this._y},set:function(t){this._y=t,this.updateSystem()}},width:{get:function(){return this._width},set:function(t){this._width=t,this.updateSystem()}},height:{get:function(){return this._height},set:function(t){this._height=t,this.updateSystem()}},scrollX:{get:function(){return this._scrollX},set:function(t){t!==this._scrollX&&(this._scrollX=t,this.dirty=!0)}},scrollY:{get:function(){return this._scrollY},set:function(t){t!==this._scrollY&&(this._scrollY=t,this.dirty=!0)}},zoom:{get:function(){return(this._zoomX+this._zoomY)/2},set:function(t){this._zoomX=t,this._zoomY=t,this.dirty=!0}},zoomX:{get:function(){return this._zoomX},set:function(t){this._zoomX=t,this.dirty=!0}},zoomY:{get:function(){return this._zoomY},set:function(t){this._zoomY=t,this.dirty=!0}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=t,this.dirty=!0}},centerX:{get:function(){return this.x+.5*this.width}},centerY:{get:function(){return this.y+.5*this.height}},displayWidth:{get:function(){return this.width/this.zoomX}},displayHeight:{get:function(){return this.height/this.zoomY}}});t.exports=f},38058(t,e,i){var s=i(71911),r=i(67502),n=i(45319),a=i(83419),o=i(31401),h=i(20052),l=i(19715),u=i(28915),d=i(87841),c=i(26099),f=new a({Extends:s,initialize:function(t,e,i,r){s.call(this,t,e,i,r),this.filters={internal:new o.FilterList(this),external:new o.FilterList(this)},this.isObjectInversion=!1,this.inputEnabled=!0,this.fadeEffect=new h.Fade(this),this.flashEffect=new h.Flash(this),this.shakeEffect=new h.Shake(this),this.panEffect=new h.Pan(this),this.rotateToEffect=new h.RotateTo(this),this.zoomEffect=new h.Zoom(this),this.lerp=new c(1,1),this.followOffset=new c,this.deadzone=null,this._follow=null},setDeadzone:function(t,e){if(void 0===t)this.deadzone=null;else{if(this.deadzone?(this.deadzone.width=t,this.deadzone.height=e):this.deadzone=new d(0,0,t,e),this._follow){var i=this.width/2,s=this.height/2,n=this._follow.x-this.followOffset.x,a=this._follow.y-this.followOffset.y;this.midPoint.set(n,a),this.scrollX=n-i,this.scrollY=a-s}r(this.deadzone,this.midPoint.x,this.midPoint.y)}return this},fadeIn:function(t,e,i,s,r,n){return this.fadeEffect.start(!1,t,e,i,s,!0,r,n)},fadeOut:function(t,e,i,s,r,n){return this.fadeEffect.start(!0,t,e,i,s,!0,r,n)},fadeFrom:function(t,e,i,s,r,n,a){return this.fadeEffect.start(!1,t,e,i,s,r,n,a)},fade:function(t,e,i,s,r,n,a){return this.fadeEffect.start(!0,t,e,i,s,r,n,a)},flash:function(t,e,i,s,r,n,a){return this.flashEffect.start(t,e,i,s,r,n,a)},shake:function(t,e,i,s,r){return this.shakeEffect.start(t,e,i,s,r)},pan:function(t,e,i,s,r,n,a){return this.panEffect.start(t,e,i,s,r,n,a)},rotateTo:function(t,e,i,s,r,n,a){return this.rotateToEffect.start(t,e,i,s,r,n,a)},zoomTo:function(t,e,i,s,r,n){return this.zoomEffect.start(t,e,i,s,r,n)},preRender:function(){this.renderList.length=0;var t=this.width,e=this.height,i=.5*t,s=.5*e,n=this.zoomX,a=this.zoomY;this.renderRoundPixels=this.roundPixels&&Number.isInteger(n)&&Number.isInteger(a);var o=t*this.originX,h=e*this.originY,d=this._follow,c=this.deadzone,f=this.scrollX,p=this.scrollY;c&&r(c,this.midPoint.x,this.midPoint.y);var m=!1;if(d&&!this.panEffect.isRunning){var g=this.lerp,v=d.x-this.followOffset.x,x=d.y-this.followOffset.y;c?(vc.right&&(f=u(f,f+(v-c.right),g.x)),xc.bottom&&(p=u(p,p+(x-c.bottom),g.y))):(f=u(f,v-o,g.x),p=u(p,x-h,g.y)),m=!0}this.useBounds&&(f=this.clampX(f),p=this.clampY(p)),this.scrollX=f,this.scrollY=p;var y=f+i,T=p+s;this.midPoint.set(y,T);var w=t/n,S=e/a,b=y-w/2,E=T-S/2;this.worldView.setTo(b,E,w,S);var C=this.matrix,A=this.matrixExternal;this.isObjectInversion?(C.loadIdentity(),C.translate(o,h),C.scale(n,a),C.rotate(this.rotation),C.translate(-f-o,-p-h)):(C.applyITRS(o,h,this.rotation,n,a),C.translate(-f-o,-p-h)),A.applyITRS(this.x,this.y,0,1,1),this.shakeEffect.preRender(),A.multiply(C,this.matrixCombined),m&&this.emit(l.FOLLOW_UPDATE,this,d)},getViewMatrix:function(t){return t||this.forceComposite||this.filters.external.length>0||this.filters.internal.length>0?this.matrix:this.matrixCombined},getPaddingWrapper:function(t){var e={padding:0},i=new Proxy(this,{get:function(t,i){switch(i){case"padding":return e.padding;case"x":case"y":case"scrollX":case"scrollY":return t[i]+e.padding;case"width":case"height":return t[i]-2*e.padding;default:return t[i]}},set:function(i,s,r){switch(s){case"padding":var n=e.padding;e.padding=r;var a=e.padding-n;return i.x-=a,i.y-=a,i.width+=2*a,i.height+=2*a,i.scrollX-=a,i.scrollY-=a,t;case"x":case"y":case"scrollX":case"scrollY":return i[s]=r-e.padding;case"width":case"height":return i[s]=r+2*e.padding;default:return i[s]=r}}});return i.padding=t||0,i},setLerp:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.lerp.set(t,e),this},setFollowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),this.followOffset.set(t,e),this},startFollow:function(t,e,i,s,r,a){void 0===e&&(e=!1),void 0===i&&(i=1),void 0===s&&(s=i),void 0===r&&(r=0),void 0===a&&(a=r),this._follow=t,this.roundPixels=e,i=n(i,0,1),s=n(s,0,1),this.lerp.set(i,s),this.followOffset.set(r,a);var o=this.width/2,h=this.height/2,l=t.x-r,u=t.y-a;return this.midPoint.set(l,u),this.scrollX=l-o,this.scrollY=u-h,this.useBounds&&(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},stopFollow:function(){return this._follow=null,this},resetFX:function(){return this.rotateToEffect.reset(),this.panEffect.reset(),this.shakeEffect.reset(),this.flashEffect.reset(),this.fadeEffect.reset(),this},update:function(t,e){this.visible&&(this.rotateToEffect.update(t,e),this.panEffect.update(t,e),this.zoomEffect.update(t,e),this.shakeEffect.update(t,e),this.flashEffect.update(t,e),this.fadeEffect.update(t,e))},destroy:function(){this.resetFX(),this.filters.internal.destroy(),this.filters.external.destroy(),s.prototype.destroy.call(this),this._follow=null,this.deadzone=null}});t.exports=f},32743(t,e,i){var s=i(38058),r=i(83419),n=i(95540),a=i(37277),o=i(37303),h=i(97480),l=i(44594),u=new r({initialize:function(t){this.scene=t,this.systems=t.sys,this.roundPixels=t.sys.game.config.roundPixels,this.cameras=[],this.main,this.default,t.sys.events.once(l.BOOT,this.boot,this),t.sys.events.on(l.START,this.start,this)},boot:function(){var t=this.systems;t.settings.cameras?this.fromJSON(t.settings.cameras):this.add(),this.main=this.cameras[0],this.default=new s(0,0,t.scale.width,t.scale.height).setScene(this.scene),t.game.scale.on(h.RESIZE,this.onResize,this),this.systems.events.once(l.DESTROY,this.destroy,this)},start:function(){if(!this.main){var t=this.systems;t.settings.cameras?this.fromJSON(t.settings.cameras):this.add(),this.main=this.cameras[0]}var e=this.systems.events;e.on(l.UPDATE,this.update,this),e.once(l.SHUTDOWN,this.shutdown,this)},add:function(t,e,i,r,n,a){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===r&&(r=this.scene.sys.scale.height),void 0===n&&(n=!1),void 0===a&&(a="");var o=new s(t,e,i,r);return o.setName(a),o.setScene(this.scene),o.setRoundPixels(this.roundPixels),o.id=this.getNextID(),this.cameras.push(o),n&&(this.main=o),o},addExisting:function(t,e){return void 0===e&&(e=!1),-1===this.cameras.indexOf(t)?(t.id=this.getNextID(),t.setRoundPixels(this.roundPixels),this.cameras.push(t),e&&(this.main=t),t):null},getNextID:function(){for(var t=this.cameras,e=1,i=0;i<32;i++){for(var s=!1,r=0;r0){n.preRender();var a=this.getVisibleChildren(e.getChildren(),n);t.render(i,a,n)}}},getVisibleChildren:function(t,e){return t.filter(function(t){return t.willRender(e)})},resetAll:function(){for(var t=0;t=0}else this.clockwise=this.destination>=this.source;return this.camera.emit(n.ROTATE_START,this.camera,this,i,this.destination),u},update:function(t,e){if(this.isRunning){this._elapsed+=e;var i=s(this._elapsed/this.duration,0,1);this.progress=i;var r=this.camera;if(this._elapsedthis.maxZoom&&(e.zoom=this.maxZoom))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=n},58818(t,e,i){var s=i(83419),r=i(35154),n=new s({initialize:function(t){this.camera=r(t,"camera",null),this.left=r(t,"left",null),this.right=r(t,"right",null),this.up=r(t,"up",null),this.down=r(t,"down",null),this.zoomIn=r(t,"zoomIn",null),this.zoomOut=r(t,"zoomOut",null),this.zoomSpeed=r(t,"zoomSpeed",.01),this.minZoom=r(t,"minZoom",.001),this.maxZoom=r(t,"maxZoom",1e3),this.accelX=0,this.accelY=0;var e=r(t,"acceleration",null);"number"==typeof e?(this.accelX=e,this.accelY=e):(this.accelX=r(t,"acceleration.x",0),this.accelY=r(t,"acceleration.y",0)),this.dragX=0,this.dragY=0;var i=r(t,"drag",null);"number"==typeof i?(this.dragX=i,this.dragY=i):(this.dragX=r(t,"drag.x",0),this.dragY=r(t,"drag.y",0)),this.maxSpeedX=0,this.maxSpeedY=0;var s=r(t,"maxSpeed",null);"number"==typeof s?(this.maxSpeedX=s,this.maxSpeedY=s):(this.maxSpeedX=r(t,"maxSpeed.x",0),this.maxSpeedY=r(t,"maxSpeed.y",0)),this._speedX=0,this._speedY=0,this._zoom=0,this.active=null!==this.camera},start:function(){return this.active=null!==this.camera,this},stop:function(){return this.active=!1,this},setCamera:function(t){return this.camera=t,this},update:function(t){if(this.active){void 0===t&&(t=1);var e=this.camera;this._speedX>0?(this._speedX-=this.dragX*t,this._speedX<0&&(this._speedX=0)):this._speedX<0&&(this._speedX+=this.dragX*t,this._speedX>0&&(this._speedX=0)),this._speedY>0?(this._speedY-=this.dragY*t,this._speedY<0&&(this._speedY=0)):this._speedY<0&&(this._speedY+=this.dragY*t,this._speedY>0&&(this._speedY=0)),this.up&&this.up.isDown?(this._speedY+=this.accelY,this._speedY>this.maxSpeedY&&(this._speedY=this.maxSpeedY)):this.down&&this.down.isDown&&(this._speedY-=this.accelY,this._speedY<-this.maxSpeedY&&(this._speedY=-this.maxSpeedY)),this.left&&this.left.isDown?(this._speedX+=this.accelX,this._speedX>this.maxSpeedX&&(this._speedX=this.maxSpeedX)):this.right&&this.right.isDown&&(this._speedX-=this.accelX,this._speedX<-this.maxSpeedX&&(this._speedX=-this.maxSpeedX)),this.zoomIn&&this.zoomIn.isDown?this._zoom=-this.zoomSpeed:this.zoomOut&&this.zoomOut.isDown?this._zoom=this.zoomSpeed:this._zoom=0,0!==this._speedX&&(e.scrollX-=this._speedX*t|0),0!==this._speedY&&(e.scrollY-=this._speedY*t|0),0!==this._zoom&&(e.zoom+=this._zoom,e.zoomthis.maxZoom&&(e.zoom=this.maxZoom))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=n},38865(t,e,i){t.exports={FixedKeyControl:i(63091),SmoothedKeyControl:i(58818)}},26638(t,e,i){t.exports={Controls:i(38865),Scene2D:i(87969)}},8054(t,e,i){var s={VERSION:"4.1.0",LOG_VERSION:"v401",BlendModes:i(10312),ScaleModes:i(29795),AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,FOREVER:-1,NONE:4,UP:5,DOWN:6,LEFT:7,RIGHT:8};t.exports=s},69547(t,e,i){var s=i(83419),r=i(8054),n=i(42363),a=i(82264),o=i(95540),h=i(35154),l=i(41212),u=i(29747),d=i(75508),c=i(80333),f=new s({initialize:function(t){void 0===t&&(t={});var e=h(t,"scale",null);this.width=h(e,"width",1024,t),this.height=h(e,"height",768,t),this.zoom=h(e,"zoom",1,t),this.parent=h(e,"parent",void 0,t),this.scaleMode=h(e,e?"mode":"scaleMode",0,t),this.expandParent=h(e,"expandParent",!0,t),this.autoRound=h(e,"autoRound",!1,t),this.autoCenter=h(e,"autoCenter",0,t),this.resizeInterval=h(e,"resizeInterval",500,t),this.fullscreenTarget=h(e,"fullscreenTarget",null,t),this.minWidth=h(e,"min.width",0,t),this.maxWidth=h(e,"max.width",0,t),this.minHeight=h(e,"min.height",0,t),this.maxHeight=h(e,"max.height",0,t),this.snapWidth=h(e,"snap.width",0,t),this.snapHeight=h(e,"snap.height",0,t),this.renderType=h(t,"type",r.AUTO),this.canvas=h(t,"canvas",null),this.context=h(t,"context",null),this.canvasStyle=h(t,"canvasStyle",null),this.customEnvironment=h(t,"customEnvironment",!1),this.sceneConfig=h(t,"scene",null),this.seed=h(t,"seed",[(Date.now()*Math.random()).toString()]),d.RND=new d.RandomDataGenerator(this.seed),this.gameTitle=h(t,"title",""),this.gameURL=h(t,"url","https://phaser.io/"+r.LOG_VERSION),this.gameVersion=h(t,"version",""),this.autoFocus=h(t,"autoFocus",!0),this.stableSort=h(t,"stableSort",-1),-1===this.stableSort&&(this.stableSort=a.browser.es2019?1:0),a.features.stableSort=this.stableSort,this.domCreateContainer=h(t,"dom.createContainer",!1),this.domPointerEvents=h(t,"dom.pointerEvents","none"),this.inputKeyboard=h(t,"input.keyboard",!0),this.inputKeyboardEventTarget=h(t,"input.keyboard.target",window),this.inputKeyboardCapture=h(t,"input.keyboard.capture",[]),this.inputMouse=h(t,"input.mouse",!0),this.inputMouseEventTarget=h(t,"input.mouse.target",null),this.inputMousePreventDefaultDown=h(t,"input.mouse.preventDefaultDown",!0),this.inputMousePreventDefaultUp=h(t,"input.mouse.preventDefaultUp",!0),this.inputMousePreventDefaultMove=h(t,"input.mouse.preventDefaultMove",!0),this.inputMousePreventDefaultWheel=h(t,"input.mouse.preventDefaultWheel",!0),this.inputTouch=h(t,"input.touch",a.input.touch),this.inputTouchEventTarget=h(t,"input.touch.target",null),this.inputTouchCapture=h(t,"input.touch.capture",!0),this.inputActivePointers=h(t,"input.activePointers",1),this.inputSmoothFactor=h(t,"input.smoothFactor",0),this.inputWindowEvents=h(t,"input.windowEvents",!0),this.inputGamepad=h(t,"input.gamepad",!1),this.inputGamepadEventTarget=h(t,"input.gamepad.target",window),this.disableContextMenu=h(t,"disableContextMenu",!1),this.audio=h(t,"audio",{}),this.hideBanner=!1===h(t,"banner",null),this.hidePhaser=h(t,"banner.hidePhaser",!1),this.bannerTextColor=h(t,"banner.text","#ffffff"),this.bannerBackgroundColor=h(t,"banner.background",["#000814","#001d3d","#003566"]),""===this.gameTitle&&this.hidePhaser&&(this.hideBanner=!0),this.fps=h(t,"fps",null);var i=h(t,"render",null);this.autoMobileTextures=h(i,"autoMobileTextures",!0,t),this.antialias=h(i,"antialias",!0,t),this.antialiasGL=h(i,"antialiasGL",!0,t),this.mipmapFilter=h(i,"mipmapFilter","",t),this.mipmapRegeneration=h(i,"mipmapRegeneration",!1,t),this.desynchronized=h(i,"desynchronized",!1,t),this.roundPixels=h(i,"roundPixels",!1,t),this.selfShadow=h(i,"selfShadow",!1,t),this.pathDetailThreshold=h(i,"pathDetailThreshold",1,t),this.pixelArt=h(i,"pixelArt",!1,t),this.pixelArt&&(this.antialias=!1,this.antialiasGL=!1,this.roundPixels=!0),this.smoothPixelArt=h(i,"smoothPixelArt",!1,t),this.smoothPixelArt&&(this.antialias=!0,this.antialiasGL=!0,this.pixelArt=!1),this.transparent=h(i,"transparent",!1,t),this.clearBeforeRender=h(i,"clearBeforeRender",!0,t),this.preserveDrawingBuffer=h(i,"preserveDrawingBuffer",!1,t),this.premultipliedAlpha=h(i,"premultipliedAlpha",!0,t),this.skipUnreadyShaders=h(i,"skipUnreadyShaders",!1,t),this.failIfMajorPerformanceCaveat=h(i,"failIfMajorPerformanceCaveat",!1,t),this.powerPreference=h(i,"powerPreference","default",t),this.batchSize=h(i,"batchSize",16384,t),this.maxTextures=h(i,"maxTextures",-1,t),this.maxLights=h(i,"maxLights",10,t),this.renderNodes=h(i,"renderNodes",{},t);var s=h(t,"backgroundColor",0);this.backgroundColor=c(s),this.transparent&&(this.backgroundColor=c(0),this.backgroundColor.alpha=0),this.preBoot=h(t,"callbacks.preBoot",u),this.postBoot=h(t,"callbacks.postBoot",u),this.physics=h(t,"physics",{}),this.defaultPhysicsSystem=h(this.physics,"default",!1),this.loaderBaseURL=h(t,"loader.baseURL",""),this.loaderPath=h(t,"loader.path",""),this.loaderMaxParallelDownloads=h(t,"loader.maxParallelDownloads",a.os.android?6:32),this.loaderCrossOrigin=h(t,"loader.crossOrigin",void 0),this.loaderResponseType=h(t,"loader.responseType",""),this.loaderAsync=h(t,"loader.async",!0),this.loaderUser=h(t,"loader.user",""),this.loaderPassword=h(t,"loader.password",""),this.loaderTimeout=h(t,"loader.timeout",0),this.loaderMaxRetries=h(t,"loader.maxRetries",2),this.loaderWithCredentials=h(t,"loader.withCredentials",!1),this.loaderImageLoadType=h(t,"loader.imageLoadType","XHR"),this.loaderLocalScheme=h(t,"loader.localScheme",["file://","capacitor://"]),this.glowQuality=h(t,"filters.glow.quality",10),this.glowDistance=h(t,"filters.glow.distance",10),this.installGlobalPlugins=[],this.installScenePlugins=[];var f=h(t,"plugins",null),p=n.DefaultScene;f&&(Array.isArray(f)?this.defaultPlugins=f:l(f)&&(this.installGlobalPlugins=o(f,"global",[]),this.installScenePlugins=o(f,"scene",[]),Array.isArray(f.default)?p=f.default:Array.isArray(f.defaultMerge)&&(p=p.concat(f.defaultMerge)))),this.defaultPlugins=p;var m="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg";this.defaultImage=h(t,"images.default",m+"AQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg=="),this.missingImage=h(t,"images.missing",m+"CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg=="),this.whiteImage=h(t,"images.white","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABdJREFUeNpi/P//PwMMMDEgAdwcgAADAJZuAwXJYZOzAAAAAElFTkSuQmCC"),window&&(window.FORCE_WEBGL?this.renderType=r.WEBGL:window.FORCE_CANVAS&&(this.renderType=r.CANVAS))}});t.exports=f},86054(t,e,i){var s=i(20623),r=i(27919),n=i(8054),a=i(89357);t.exports=function(t){var e=t.config;if((e.customEnvironment||e.canvas)&&e.renderType===n.AUTO)throw new Error("Must set explicit renderType in custom environment");if(!e.customEnvironment&&!e.canvas&&e.renderType!==n.HEADLESS)if(e.renderType===n.AUTO&&(e.renderType=a.webGL?n.WEBGL:n.CANVAS),e.renderType===n.WEBGL){if(!a.webGL)throw new Error("Cannot create WebGL context, aborting.")}else{if(e.renderType!==n.CANVAS)throw new Error("Unknown value for renderer type: "+e.renderType);if(!a.canvas)throw new Error("Cannot create Canvas context, aborting.")}e.antialias||r.disableSmoothing();var o,h,l=t.scale.baseSize,u=l.width,d=l.height;(e.canvas?(t.canvas=e.canvas,t.canvas.width=u,t.canvas.height=d):t.canvas=r.create(t,u,d,e.renderType),e.canvasStyle&&(t.canvas.style=e.canvasStyle),e.antialias||s.setCrisp(t.canvas),e.renderType!==n.HEADLESS)&&(o=i(68627),h=i(74797),e.renderType===n.WEBGL?t.renderer=new h(t):(t.renderer=new o(t),t.context=t.renderer.gameContext))}},96391(t,e,i){var s=i(8054);t.exports=function(t){var e=t.config;if(!e.hideBanner){var i="WebGL";e.renderType===s.CANVAS?i="Canvas":e.renderType===s.HEADLESS&&(i="Headless");var r,n=e.audio,a=t.device.audio;if(r=a.webAudio&&!n.disableWebAudio?"Web Audio":n.noAudio||!a.webAudio&&!a.audioData?"No Audio":"HTML5 Audio",t.device.browser.ie)window.console&&console.log("Phaser v"+s.VERSION+" / https://phaser.io");else{var o="color: "+e.bannerTextColor+";",h=Array.isArray(e.bannerBackgroundColor)?e.bannerBackgroundColor:[e.bannerBackgroundColor];1===h.length&&(h=[h[0],h[0]]),o+=' background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAOCAYAAAAmL5yKAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAARBJREFUeNpi/P//P0OHsPB/BiCoePuWkYFEwALSXJElzMBgLwE2CNkQxgWr/yMr/p8QimlBu5DQ//+8vBBco/ofzAe6imH+qv/53/6jYJAYSA4ZoxoANYTPKhiuCQZwGcJU+e4dqpMmvsDq14krV2MPAxDha2CMKvoXoiE/PBQUDgQD8j82UFae9B9bOIC8B9UD9gIjjIMN7Ns6lWHn4XMoYu62RgxO3tkMjIyMII2MYAOAtmFVhA+ADHf2ycGMRhANjUq8YO+WKWCvgAORIV8CkpDCrzIwsLIymC1qAtuAD4Bsh3sBmqAY3qcGwL2AC4DCpKtzHlgzOLWihwEuzTCN0GhDJHeYC4gByBphACDAAH2dDIxdjr+VAAAAAElFTkSuQmCC"), '+("linear-gradient(to bottom, "+h.join(", ")+")")+";",o+=" background-repeat: no-repeat;",o+=" background-position: 4px center, 0 0;";var l="%c",u=[null,o+=" padding: 2px 6px 2px 24px;"];u.push("background: transparent"),e.gameTitle&&(l=l.concat(e.gameTitle),e.gameVersion&&(l=l.concat(" v"+e.gameVersion)),e.hidePhaser||(l=l.concat(" / "))),e.hidePhaser||(l=l.concat("Phaser v"+s.VERSION+" ("+i+" | "+r+")")),l=l.concat("%c "+e.gameURL),u[0]=l,console.log.apply(console,u)}}}},50127(t,e,i){var s=i(40366),r=i(60848),n=i(24047),a=i(27919),o=i(83419),h=i(69547),l=i(83719),u=i(86054),d=i(45893),c=i(96391),f=i(82264),p=i(57264),m=i(50792),g=i(8443),v=i(7003),x=i(37277),y=i(77332),T=i(76531),w=i(60903),S=i(69442),b=i(17130),E=i(65898),C=i(51085),A=i(14747),_=new o({initialize:function(t){this.config=new h(t),this.renderer=null,this.domContainer=null,this.canvas=null,this.context=null,this.isBooted=!1,this.isRunning=!1,this.events=new m,this.anims=new r(this),this.textures=new b(this),this.cache=new n(this),this.registry=new d(this,new m),this.input=new v(this,this.config),this.scene=new w(this,this.config.sceneConfig),this.device=f,this.scale=new T(this,this.config),this.sound=null,this.sound=A.create(this),this.loop=new E(this,this.config.fps),this.plugins=new y(this,this.config),this.pendingDestroy=!1,this.removeCanvas=!1,this.noReturn=!1,this.hasFocus=!1,this.isPaused=!1,p(this.boot.bind(this))},boot:function(){x.hasCore("EventEmitter")?(this.isBooted=!0,this.config.preBoot(this),this.scale.preBoot(),u(this),l(this),c(this),s(this.canvas,this.config.parent),this.textures.once(S.READY,this.texturesReady,this),this.events.emit(g.BOOT)):console.warn("Aborting. Core Plugins missing.")},texturesReady:function(){this.events.emit(g.READY),this.start()},start:function(){this.isRunning=!0,this.config.postBoot(this),this.renderer?this.loop.start(this.step.bind(this)):this.loop.start(this.headlessStep.bind(this)),C(this);var t=this.events;t.on(g.HIDDEN,this.onHidden,this),t.on(g.VISIBLE,this.onVisible,this),t.on(g.BLUR,this.onBlur,this),t.on(g.FOCUS,this.onFocus,this)},step:function(t,e){if(this.pendingDestroy)return this.runDestroy();if(!this.isPaused){var i=this.events;i.emit(g.PRE_STEP,t,e),i.emit(g.STEP,t,e),this.scene.update(t,e),i.emit(g.POST_STEP,t,e);var s=this.renderer;s.preRender(),i.emit(g.PRE_RENDER,s,t,e),this.scene.render(s),s.postRender(),i.emit(g.POST_RENDER,s,t,e)}},headlessStep:function(t,e){if(this.pendingDestroy)return this.runDestroy();if(!this.isPaused){var i=this.events;i.emit(g.PRE_STEP,t,e),i.emit(g.STEP,t,e),this.scene.update(t,e),i.emit(g.POST_STEP,t,e),this.scene.isProcessing=!1,i.emit(g.PRE_RENDER,null,t,e),i.emit(g.POST_RENDER,null,t,e)}},onHidden:function(){this.loop.pause(),this.events.emit(g.PAUSE)},pause:function(){var t=this.isPaused;this.isPaused=!0,t||this.events.emit(g.PAUSE)},onVisible:function(){this.loop.resume(),this.events.emit(g.RESUME,this.loop.pauseDuration)},resume:function(){var t=this.isPaused;this.isPaused=!1,t&&this.events.emit(g.RESUME,0)},onBlur:function(){this.hasFocus=!1,this.loop.blur()},onFocus:function(){this.hasFocus=!0,this.loop.focus()},getFrame:function(){return this.loop.frame},getTime:function(){return this.loop.now},destroy:function(t,e){void 0===e&&(e=!1),this.pendingDestroy=!0,this.removeCanvas=t,this.noReturn=e},runDestroy:function(){this.scene.destroy(),this.events.emit(g.DESTROY),this.events.removeAllListeners(),this.renderer&&this.renderer.destroy(),this.removeCanvas&&this.canvas&&(a.remove(this.canvas),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)),this.domContainer&&this.domContainer.parentNode&&this.domContainer.parentNode.removeChild(this.domContainer),this.loop.destroy(),this.pendingDestroy=!1}});t.exports=_},65898(t,e,i){var s=i(83419),r=i(35154),n=i(29747),a=i(43092),o=new s({initialize:function(t,e){this.game=t,this.raf=new a,this.started=!1,this.running=!1,this.minFps=r(e,"min",5),this.targetFps=r(e,"target",60),this.fpsLimit=r(e,"limit",0),this.hasFpsLimit=this.fpsLimit>0,this._limitRate=this.hasFpsLimit?1e3/this.fpsLimit:0,this._min=1e3/this.minFps,this._target=1e3/this.targetFps,this.actualFps=this.targetFps,this.nextFpsUpdate=0,this.framesThisSecond=0,this.callback=n,this.forceSetTimeOut=r(e,"forceSetTimeOut",!1),this.time=0,this.startTime=0,this.lastTime=0,this.frame=0,this.inFocus=!0,this.pauseDuration=0,this._pauseTime=0,this._coolDown=0,this.delta=0,this.deltaIndex=0,this.deltaHistory=[],this.deltaSmoothingMax=r(e,"deltaHistory",10),this.panicMax=r(e,"panicMax",120),this.rawDelta=0,this.now=0,this.smoothStep=r(e,"smoothStep",!0)},blur:function(){this.inFocus=!1},focus:function(){this.inFocus=!0,this.resetDelta()},pause:function(){this._pauseTime=window.performance.now()},resume:function(){this.resetDelta(),this.pauseDuration=this.time-this._pauseTime,this.startTime+=this.pauseDuration},resetDelta:function(){var t=window.performance.now();this.time=t,this.lastTime=t,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0;for(var e=0;e0||!this.inFocus)&&(this._coolDown--,t=Math.min(t,this._target)),t>this._min&&(t=i[e],t=Math.min(t,this._min)),i[e]=t,this.deltaIndex++,this.deltaIndex>=s&&(this.deltaIndex=0);for(var r=0,n=0;n=this.nextFpsUpdate&&this.updateFPS(t),this.framesThisSecond++,this.delta>=this._limitRate&&(this.callback(t,this.delta),this.delta%=this._limitRate),this.lastTime=t,this.frame++},step:function(t){this.now=t;var e=Math.max(0,t-this.lastTime);this.rawDelta=e,this.time+=this.rawDelta,this.smoothStep&&(e=this.smoothDelta(e)),this.delta=e,t>=this.nextFpsUpdate&&this.updateFPS(t),this.framesThisSecond++,this.callback(t,e),this.lastTime=t,this.frame++},tick:function(){var t=window.performance.now();this.hasFpsLimit?this.stepLimitFPS(t):this.step(t)},sleep:function(){this.running&&(this.raf.stop(),this.running=!1)},wake:function(t){void 0===t&&(t=!1);var e=window.performance.now();if(!this.running){t&&(this.startTime+=-this.lastTime+(this.lastTime+e));var i=this.hasFpsLimit?this.stepLimitFPS.bind(this):this.step.bind(this);this.raf.start(i,this.forceSetTimeOut,this._target),this.running=!0,this.nextFpsUpdate=e+1e3,this.framesThisSecond=0,this.fpsLimitTriggered=!1,this.tick()}},getDuration:function(){return Math.round(this.lastTime-this.startTime)/1e3},getDurationMS:function(){return Math.round(this.lastTime-this.startTime)},stop:function(){return this.running=!1,this.started=!1,this.raf.stop(),this},destroy:function(){this.stop(),this.raf.destroy(),this.raf=null,this.game=null,this.callback=null}});t.exports=o},51085(t,e,i){var s=i(8443);t.exports=function(t){var e,i=t.events;if(void 0!==document.hidden)e="visibilitychange";else{["webkit","moz","ms"].forEach(function(t){void 0!==document[t+"Hidden"]&&(document.hidden=function(){return document[t+"Hidden"]},e=t+"visibilitychange")})}e&&document.addEventListener(e,function(t){document.hidden||"pause"===t.type?i.emit(s.HIDDEN):i.emit(s.VISIBLE)},!1),window.onblur=function(){i.emit(s.BLUR)},window.onfocus=function(){i.emit(s.FOCUS)},window.focus&&t.config.autoFocus&&window.focus()}},97217(t){t.exports="blur"},47548(t){t.exports="boot"},19814(t){t.exports="contextlost"},68446(t){t.exports="destroy"},41700(t){t.exports="focus"},25432(t){t.exports="hidden"},65942(t){t.exports="pause"},59211(t){t.exports="postrender"},47789(t){t.exports="poststep"},39066(t){t.exports="prerender"},460(t){t.exports="prestep"},16175(t){t.exports="ready"},42331(t){t.exports="resume"},11966(t){t.exports="step"},32969(t){t.exports="systemready"},94830(t){t.exports="visible"},8443(t,e,i){t.exports={BLUR:i(97217),BOOT:i(47548),CONTEXT_LOST:i(19814),DESTROY:i(68446),FOCUS:i(41700),HIDDEN:i(25432),PAUSE:i(65942),POST_RENDER:i(59211),POST_STEP:i(47789),PRE_RENDER:i(39066),PRE_STEP:i(460),READY:i(16175),RESUME:i(42331),STEP:i(11966),SYSTEM_READY:i(32969),VISIBLE:i(94830)}},42857(t,e,i){t.exports={Config:i(69547),CreateRenderer:i(86054),DebugHeader:i(96391),Events:i(8443),TimeStep:i(65898),VisibilityHandler:i(51085)}},46728(t,e,i){var s=i(83419),r=i(36316),n=i(80021),a=i(26099),o=new s({Extends:n,initialize:function(t,e,i,s){n.call(this,"CubicBezierCurve"),Array.isArray(t)&&(s=new a(t[6],t[7]),i=new a(t[4],t[5]),e=new a(t[2],t[3]),t=new a(t[0],t[1])),this.p0=t,this.p1=e,this.p2=i,this.p3=s},getStartPoint:function(t){return void 0===t&&(t=new a),t.copy(this.p0)},getResolution:function(t){return t},getPoint:function(t,e){void 0===e&&(e=new a);var i=this.p0,s=this.p1,n=this.p2,o=this.p3;return e.set(r(t,i.x,s.x,n.x,o.x),r(t,i.y,s.y,n.y,o.y))},draw:function(t,e){void 0===e&&(e=32);var i=this.getPoints(e);t.beginPath(),t.moveTo(this.p0.x,this.p0.y);for(var s=1;si&&(e=i/2);var s=Math.max(1,Math.round(i/e));return r(this.getSpacedPoints(s),t)},getDistancePoints:function(t){var e=this.getLength(),i=Math.max(1,e/t);return this.getSpacedPoints(i)},getEndPoint:function(t){return void 0===t&&(t=new a),this.getPointAt(1,t)},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,i=[],s=this.getPoint(0,this._tmpVec2A),r=0;i.push(0);for(var n=1;n<=t;n++)r+=(e=this.getPoint(n/t,this._tmpVec2B)).distance(s),i.push(r),s.copy(e);return this.cacheArcLengths=i,i},getPointAt:function(t,e){var i=this.getUtoTmapping(t);return this.getPoint(i,e)},getPoints:function(t,e,i){void 0===i&&(i=[]),t||(t=e?this.getLength()/e:this.defaultDivisions);for(var s=0;s<=t;s++)i.push(this.getPoint(s/t));return i},getRandomPoint:function(t){return void 0===t&&(t=new a),this.getPoint(Math.random(),t)},getSpacedPoints:function(t,e,i){void 0===i&&(i=[]),t||(t=e?this.getLength()/e:this.defaultDivisions);for(var s=0;s<=t;s++){var r=this.getUtoTmapping(s/t,null,t);i.push(this.getPoint(r))}return i},getStartPoint:function(t){return void 0===t&&(t=new a),this.getPointAt(0,t)},getTangent:function(t,e){void 0===e&&(e=new a);var i=1e-4,s=t-i,r=t+i;return s<0&&(s=0),r>1&&(r=1),this.getPoint(s,this._tmpVec2A),this.getPoint(r,e),e.subtract(this._tmpVec2A).normalize()},getTangentAt:function(t,e){var i=this.getUtoTmapping(t);return this.getTangent(i,e)},getTFromDistance:function(t,e){return t<=0?0:this.getUtoTmapping(0,t,e)},getUtoTmapping:function(t,e,i){var s,r=this.getLengths(i),n=0,a=r.length;s=e?Math.min(e,r[a-1]):t*r[a-1];for(var o,h=0,l=a-1;h<=l;)if((o=r[n=Math.floor(h+(l-h)/2)]-s)<0)h=n+1;else{if(!(o>0)){l=n;break}l=n-1}if(r[n=l]===s)return n/(a-1);var u=r[n];return(n+(s-u)/(r[n+1]-u))/(a-1)},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()}});t.exports=o},73825(t,e,i){var s=i(83419),r=i(80021),n=i(39506),a=i(35154),o=i(43396),h=i(26099),l=new s({Extends:r,initialize:function(t,e,i,s,o,l,u,d){if("object"==typeof t){var c=t;t=a(c,"x",0),e=a(c,"y",0),i=a(c,"xRadius",0),s=a(c,"yRadius",i),o=a(c,"startAngle",0),l=a(c,"endAngle",360),u=a(c,"clockwise",!1),d=a(c,"rotation",0)}else void 0===s&&(s=i),void 0===o&&(o=0),void 0===l&&(l=360),void 0===u&&(u=!1),void 0===d&&(d=0);r.call(this,"EllipseCurve"),this.p0=new h(t,e),this._xRadius=i,this._yRadius=s,this._startAngle=n(o),this._endAngle=n(l),this._clockwise=u,this._rotation=n(d)},getStartPoint:function(t){return void 0===t&&(t=new h),this.getPoint(0,t)},getResolution:function(t){return 2*t},getPoint:function(t,e){void 0===e&&(e=new h);for(var i=2*Math.PI,s=this._endAngle-this._startAngle,r=Math.abs(s)i;)s-=i;si.length-2?i.length-1:n+1],d=i[n>i.length-3?i.length-1:n+2];return e.set(s(o,h.x,l.x,u.x,d.x),s(o,h.y,l.y,u.y,d.y))},toJSON:function(){for(var t=[],e=0;e=e)return this.curves[s];s++}return null},getEndPoint:function(t){return void 0===t&&(t=new c),this.curves.length>0?this.curves[this.curves.length-1].getPoint(1,t):t.copy(this.startPoint),t},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},getPoint:function(t,e){void 0===e&&(e=new c);for(var i=t*this.getLength(),s=this.getCurveLengths(),r=0;r=i){var n=s[r]-i,a=this.curves[r],o=a.getLength(),h=0===o?0:1-n/o;return a.getPointAt(h,e)}r++}return null},getPoints:function(t,e){t||e||(t=this.defaultDivisions);for(var i,s=[],r=0;r1&&!s[s.length-1].equals(s[0])&&s.push(s[0]),s},getRandomPoint:function(t){return void 0===t&&(t=new c),this.getPoint(Math.random(),t)},getSpacedPoints:function(t){void 0===t&&(t=40);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e},getStartPoint:function(t){return void 0===t&&(t=new c),t.copy(this.startPoint)},getTangent:function(t,e){void 0===e&&(e=new c);for(var i=t*this.getLength(),s=this.getCurveLengths(),r=0;r=i){var n=s[r]-i,a=this.curves[r],o=a.getLength(),h=0===o?0:1-n/o;return a.getTangentAt(h,e)}r++}return null},lineTo:function(t,e){t instanceof c?this._tmpVec2B.copy(t):"object"==typeof t?this._tmpVec2B.setFromObject(t):this._tmpVec2B.set(t,e);var i=this.getEndPoint(this._tmpVec2A);return this.add(new o([i.x,i.y,this._tmpVec2B.x,this._tmpVec2B.y]))},splineTo:function(t){return t.unshift(this.getEndPoint()),this.add(new d(t))},moveTo:function(t,e){return t instanceof c?this.add(new h(t.x,t.y)):this.add(new h(t,e))},toJSON:function(){for(var t=[],e=0;e=9&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){var n=parseInt(RegExp.$1,10),a=parseInt(RegExp.$2,10);(10===n&&a>=11||n>10)&&(r.dolby=!0)}}}catch(t){}return r}()},84148(t,e,i){var s,r=i(25892),n={chrome:!1,chromeVersion:0,edge:!1,firefox:!1,firefoxVersion:0,ie:!1,ieVersion:0,mobileSafari:!1,opera:!1,safari:!1,safariVersion:0,silk:!1,trident:!1,tridentVersion:0,es2019:!1};t.exports=(s=navigator.userAgent,/Edg\/\d+/.test(s)?(n.edge=!0,n.es2019=!0):/OPR/.test(s)?(n.opera=!0,n.es2019=!0):/Chrome\/(\d+)/.test(s)&&!r.windowsPhone?(n.chrome=!0,n.chromeVersion=parseInt(RegExp.$1,10),n.es2019=n.chromeVersion>69):/Firefox\D+(\d+)/.test(s)?(n.firefox=!0,n.firefoxVersion=parseInt(RegExp.$1,10),n.es2019=n.firefoxVersion>10):/AppleWebKit\/(?!.*CriOS)/.test(s)&&r.iOS?(n.mobileSafari=!0,n.es2019=!0):/MSIE (\d+\.\d+);/.test(s)?(n.ie=!0,n.ieVersion=parseInt(RegExp.$1,10)):/Version\/(\d+\.\d+(\.\d+)?) Safari/.test(s)&&!r.windowsPhone?(n.safari=!0,n.safariVersion=parseInt(RegExp.$1,10),n.es2019=n.safariVersion>10):/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(s)&&(n.ie=!0,n.trident=!0,n.tridentVersion=parseInt(RegExp.$1,10),n.ieVersion=parseInt(RegExp.$3,10)),/Silk/.test(s)&&(n.silk=!0),n)},89289(t,e,i){var s,r,n,a=i(27919),o={supportInverseAlpha:!1,supportNewBlendModes:!1};t.exports=("function"!=typeof importScripts&&void 0!==document&&(o.supportNewBlendModes=(s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",r="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",(n=new Image).onload=function(){var t=new Image;t.onload=function(){var e=a.create2D(t,6).getContext("2d",{willReadFrequently:!0});if(e.globalCompositeOperation="multiply",e.drawImage(n,0,0),e.drawImage(t,2,0),!e.getImageData(2,0,1,1))return!1;var i=e.getImageData(2,0,1,1).data;a.remove(t),o.supportNewBlendModes=255===i[0]&&0===i[1]&&0===i[2]},t.src=s+"/wCKxvRF"+r},n.src=s+"AP804Oa6"+r,!1),o.supportInverseAlpha=function(){var t=a.create2D(this,2).getContext("2d",{willReadFrequently:!0});t.fillStyle="rgba(10, 20, 30, 0.5)",t.fillRect(0,0,1,1);var e=t.getImageData(0,0,1,1);if(null===e)return!1;t.putImageData(e,1,0);var i=t.getImageData(1,0,1,1),s=i.data[0]===e.data[0]&&i.data[1]===e.data[1]&&i.data[2]===e.data[2]&&i.data[3]===e.data[3];return a.remove(this),s}()),o)},89357(t,e,i){var s=i(25892),r=i(84148),n=i(27919),a={canvas:!1,canvasBitBltShift:null,file:!1,fileSystem:!1,getUserMedia:!0,littleEndian:!1,localStorage:!1,pointerLock:!1,stableSort:!1,support32bit:!1,vibration:!1,webGL:!1,worker:!1};t.exports=function(){if("function"==typeof importScripts)return a;a.canvas=!!window.CanvasRenderingContext2D;try{a.localStorage=!!localStorage.getItem}catch(t){a.localStorage=!1}a.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),a.fileSystem=!!window.requestFileSystem;var t,e,i,o=!1;return a.webGL=function(){if(window.WebGLRenderingContext)try{var t=n.createWebGL(this),e=t.getContext("webgl")||t.getContext("experimental-webgl"),i=n.create2D(this),s=i.getContext("2d",{willReadFrequently:!0}).createImageData(1,1);return o=s.data instanceof Uint8ClampedArray,n.remove(t),n.remove(i),!!e}catch(t){return!1}return!1}(),a.worker=!!window.Worker,a.pointerLock="pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||navigator.oGetUserMedia,window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,a.getUserMedia=a.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,r.firefox&&r.firefoxVersion<21&&(a.getUserMedia=!1),!s.iOS&&(r.ie||r.firefox||r.chrome)&&(a.canvasBitBltShift=!0),(r.safari||r.mobileSafari)&&(a.canvasBitBltShift=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(a.vibration=!0),"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint32Array&&(a.littleEndian=(t=new ArrayBuffer(4),e=new Uint8Array(t),i=new Uint32Array(t),e[0]=161,e[1]=178,e[2]=195,e[3]=212,3569595041===i[0]||2712847316!==i[0]&&null)),a.support32bit="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof Int32Array&&null!==a.littleEndian&&o,a}()},91639(t){var e={available:!1,cancel:"",keyboard:!1,request:""};t.exports=function(){if("function"==typeof importScripts)return e;var t,i="Fullscreen",s="FullScreen",r=["request"+i,"request"+s,"webkitRequest"+i,"webkitRequest"+s,"msRequest"+i,"msRequest"+s,"mozRequest"+s,"mozRequest"+i];for(t=0;t=1)&&(r.touch=!0),(navigator.msPointerEnabled||navigator.pointerEnabled)&&(r.mspointer=!0),navigator.getGamepads&&(r.gamepads=!0),"onwheel"in window||s.ie&&"WheelEvent"in window?r.wheelEvent="wheel":"onmousewheel"in window?r.wheelEvent="mousewheel":s.firefox&&"MouseScrollEvent"in window&&(r.wheelEvent="DOMMouseScroll")),r)},25892(t){var e={android:!1,chromeOS:!1,cordova:!1,crosswalk:!1,desktop:!1,ejecta:!1,electron:!1,iOS:!1,iOSVersion:0,iPad:!1,iPhone:!1,kindle:!1,linux:!1,macOS:!1,node:!1,nodeWebkit:!1,pixelRatio:1,webApp:!1,windows:!1,windowsPhone:!1};t.exports=function(){if("function"==typeof importScripts)return e;var t=navigator.userAgent;/Windows/.test(t)?e.windows=!0:/Mac OS/.test(t)&&!/like Mac OS/.test(t)?navigator.maxTouchPoints&&navigator.maxTouchPoints>2?(e.iOS=!0,e.iPad=!0,navigator.appVersion.match(/Version\/(\d+)/),e.iOSVersion=parseInt(RegExp.$1,10)):e.macOS=!0:/Android/.test(t)?e.android=!0:/Linux/.test(t)?e.linux=!0:/iP[ao]d|iPhone/i.test(t)?(e.iOS=!0,navigator.appVersion.match(/OS (\d+)/),e.iOSVersion=parseInt(RegExp.$1,10),e.iPhone=-1!==t.toLowerCase().indexOf("iphone"),e.iPad=-1!==t.toLowerCase().indexOf("ipad")):/Kindle/.test(t)||/\bKF[A-Z][A-Z]+/.test(t)||/Silk.*Mobile Safari/.test(t)?e.kindle=!0:/CrOS/.test(t)&&(e.chromeOS=!0),(/Windows Phone/i.test(t)||/IEMobile/i.test(t))&&(e.android=!1,e.iOS=!1,e.macOS=!1,e.windows=!0,e.windowsPhone=!0);var i=/Silk/.test(t);return(e.windows||e.macOS||e.linux&&!i||e.chromeOS)&&(e.desktop=!0),(e.windowsPhone||/Windows NT/i.test(t)&&/Touch/i.test(t))&&(e.desktop=!1),navigator.standalone&&(e.webApp=!0),"function"!=typeof importScripts&&(void 0!==window.cordova&&(e.cordova=!0),void 0!==window.ejecta&&(e.ejecta=!0)),"undefined"!=typeof process&&process.versions&&process.versions.node&&(e.node=!0),e.node&&"object"==typeof process.versions&&(e.nodeWebkit=!!process.versions["node-webkit"],e.electron=!!process.versions.electron),/Crosswalk/.test(t)&&(e.crosswalk=!0),e.pixelRatio=window.devicePixelRatio||1,e}()},43267(t,e,i){var s=i(95540),r={h264:!1,hls:!1,mov:!1,mp4:!1,m4v:!1,ogg:!1,vp9:!1,webm:!1,hasRequestVideoFrame:!1};t.exports=function(){if("function"==typeof importScripts)return r;var t=document.createElement("video"),e=!!t.canPlayType,i=/^no$/;try{e&&(t.canPlayType('video/ogg; codecs="theora"').replace(i,"")&&(r.ogg=!0),t.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(i,"")&&(r.h264=!0,r.mp4=!0),t.canPlayType('video/quicktime4; codecs="avc1.42E01E"').replace(i,"")&&(r.mov=!0),t.canPlayType("video/x-m4v").replace(i,"")&&(r.m4v=!0),t.canPlayType('video/webm; codecs="vp8, vorbis"').replace(i,"")&&(r.webm=!0),t.canPlayType('video/webm; codecs="vp9"').replace(i,"")&&(r.vp9=!0),t.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(i,"")&&(r.hls=!0))}catch(t){}return t.parentNode&&t.parentNode.removeChild(t),r.getVideoURL=function(t){Array.isArray(t)||(t=[t]);for(var e=0;e4096&&(r=Math.ceil(s/4096),s=4096),this.dataTextureResolution[0]=s,this.dataTextureResolution[1]=r;var n=new ArrayBuffer(s*r*4),o=new Uint32Array(n),l=new Uint8Array(n),u=0,d=65536;o[u++]=Math.round(this.bands[0].start*d),o[u++]=Math.round(this.bands[this.bands.length-1].end*d);for(var c=0;c<=e;c++)for(var f=Math.pow(2,c),p=1;po.end&&(o.end=o.start)}return i&&(this.bands=r.filter(function(t){return t.start=t){e=s;break}}return e?(t=(t-e.start)/(e.end-e.start),e.getColor(t)):{r:0,g:0,b:0,a:0,color:0}},destroy:function(){this.scene=null,this.dataTexture&&this.dataTexture.destroy()}});t.exports=l},51767(t,e,i){var s=i(83419),r=i(29747),n=new s({initialize:function(t,e,i){this._rgb=[0,0,0],this.onChangeCallback=r,this.dirty=!1,this.set(t,e,i)},set:function(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this._rgb=[t,e,i],this.onChange(),this},equals:function(t,e,i){var s=this._rgb;return s[0]===t&&s[1]===e&&s[2]===i},onChange:function(){this.dirty=!0;var t=this._rgb;this.onChangeCallback.call(this,t[0],t[1],t[2])},r:{get:function(){return this._rgb[0]},set:function(t){this._rgb[0]=t,this.onChange()}},g:{get:function(){return this._rgb[1]},set:function(t){this._rgb[1]=t,this.onChange()}},b:{get:function(){return this._rgb[2]},set:function(t){this._rgb[2]=t,this.onChange()}},destroy:function(){this.onChangeCallback=null}});t.exports=n},60461(t){t.exports={TOP_LEFT:0,TOP_CENTER:1,TOP_RIGHT:2,LEFT_TOP:3,LEFT_CENTER:4,LEFT_BOTTOM:5,CENTER:6,RIGHT_TOP:7,RIGHT_CENTER:8,RIGHT_BOTTOM:9,BOTTOM_LEFT:10,BOTTOM_CENTER:11,BOTTOM_RIGHT:12}},54312(t,e,i){var s=i(62235),r=i(35893),n=i(86327),a=i(88417);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,r(e)+i),n(t,s(e)+o),t}},46768(t,e,i){var s=i(62235),r=i(26541),n=i(86327),a=i(385);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,r(e)-i),n(t,s(e)+o),t}},35827(t,e,i){var s=i(62235),r=i(54380),n=i(86327),a=i(40136);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,r(e)+i),n(t,s(e)+o),t}},46871(t,e,i){var s=i(66786),r=i(35893),n=i(7702);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),s(t,r(e)+i,n(e)+a),t}},5198(t,e,i){var s=i(7702),r=i(26541),n=i(20786),a=i(385);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,r(e)-i),n(t,s(e)+o),t}},11879(t,e,i){var s=i(60461),r=[];r[s.BOTTOM_CENTER]=i(54312),r[s.BOTTOM_LEFT]=i(46768),r[s.BOTTOM_RIGHT]=i(35827),r[s.CENTER]=i(46871),r[s.LEFT_CENTER]=i(5198),r[s.RIGHT_CENTER]=i(80503),r[s.TOP_CENTER]=i(89698),r[s.TOP_LEFT]=i(922),r[s.TOP_RIGHT]=i(21373),r[s.LEFT_BOTTOM]=r[s.BOTTOM_LEFT],r[s.LEFT_TOP]=r[s.TOP_LEFT],r[s.RIGHT_BOTTOM]=r[s.BOTTOM_RIGHT],r[s.RIGHT_TOP]=r[s.TOP_RIGHT];t.exports=function(t,e,i,s,n){return r[i](t,e,s,n)}},80503(t,e,i){var s=i(7702),r=i(54380),n=i(20786),a=i(40136);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,r(e)+i),n(t,s(e)+o),t}},89698(t,e,i){var s=i(35893),r=i(17717),n=i(88417),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,s(e)+i),a(t,r(e)-o),t}},922(t,e,i){var s=i(26541),r=i(17717),n=i(385),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,s(e)-i),a(t,r(e)-o),t}},21373(t,e,i){var s=i(54380),r=i(17717),n=i(40136),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,s(e)+i),a(t,r(e)-o),t}},91660(t,e,i){t.exports={BottomCenter:i(54312),BottomLeft:i(46768),BottomRight:i(35827),Center:i(46871),LeftCenter:i(5198),QuickSet:i(11879),RightCenter:i(80503),TopCenter:i(89698),TopLeft:i(922),TopRight:i(21373)}},71926(t,e,i){var s=i(60461),r=i(79291),n={In:i(91660),To:i(16694)};n=r(!1,n,s),t.exports=n},21578(t,e,i){var s=i(62235),r=i(35893),n=i(88417),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,r(e)+i),a(t,s(e)+o),t}},10210(t,e,i){var s=i(62235),r=i(26541),n=i(385),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,r(e)-i),a(t,s(e)+o),t}},82341(t,e,i){var s=i(62235),r=i(54380),n=i(40136),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,r(e)+i),a(t,s(e)+o),t}},87958(t,e,i){var s=i(62235),r=i(26541),n=i(86327),a=i(40136);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,r(e)-i),n(t,s(e)+o),t}},40080(t,e,i){var s=i(7702),r=i(26541),n=i(20786),a=i(40136);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,r(e)-i),n(t,s(e)+o),t}},88466(t,e,i){var s=i(26541),r=i(17717),n=i(40136),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,s(e)-i),a(t,r(e)-o),t}},38829(t,e,i){var s=i(60461),r=[];r[s.BOTTOM_CENTER]=i(21578),r[s.BOTTOM_LEFT]=i(10210),r[s.BOTTOM_RIGHT]=i(82341),r[s.LEFT_BOTTOM]=i(87958),r[s.LEFT_CENTER]=i(40080),r[s.LEFT_TOP]=i(88466),r[s.RIGHT_BOTTOM]=i(19211),r[s.RIGHT_CENTER]=i(34609),r[s.RIGHT_TOP]=i(48741),r[s.TOP_CENTER]=i(49440),r[s.TOP_LEFT]=i(81288),r[s.TOP_RIGHT]=i(61323);t.exports=function(t,e,i,s,n){return r[i](t,e,s,n)}},19211(t,e,i){var s=i(62235),r=i(54380),n=i(86327),a=i(385);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,r(e)+i),n(t,s(e)+o),t}},34609(t,e,i){var s=i(7702),r=i(54380),n=i(20786),a=i(385);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,r(e)+i),n(t,s(e)+o),t}},48741(t,e,i){var s=i(54380),r=i(17717),n=i(385),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,s(e)+i),a(t,r(e)-o),t}},49440(t,e,i){var s=i(35893),r=i(17717),n=i(86327),a=i(88417);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)+i),n(t,r(e)-o),t}},81288(t,e,i){var s=i(26541),r=i(17717),n=i(86327),a=i(385);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)-i),n(t,r(e)-o),t}},61323(t,e,i){var s=i(54380),r=i(17717),n=i(86327),a=i(40136);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)+i),n(t,r(e)-o),t}},16694(t,e,i){t.exports={BottomCenter:i(21578),BottomLeft:i(10210),BottomRight:i(82341),LeftBottom:i(87958),LeftCenter:i(40080),LeftTop:i(88466),QuickSet:i(38829),RightBottom:i(19211),RightCenter:i(34609),RightTop:i(48741),TopCenter:i(49440),TopLeft:i(81288),TopRight:i(61323)}},66786(t,e,i){var s=i(88417),r=i(20786);t.exports=function(t,e,i){return s(t,e),r(t,i)}},62235(t){t.exports=function(t){return t.y+t.height-t.height*t.originY}},72873(t,e,i){var s=i(62235),r=i(26541),n=i(54380),a=i(17717),o=i(87841);t.exports=function(t,e){void 0===e&&(e=new o);var i=r(t),h=a(t);return e.x=i,e.y=h,e.width=n(t)-i,e.height=s(t)-h,e}},35893(t){t.exports=function(t){return t.x-t.width*t.originX+.5*t.width}},7702(t){t.exports=function(t){return t.y-t.height*t.originY+.5*t.height}},26541(t){t.exports=function(t){return t.x-t.width*t.originX}},87431(t){t.exports=function(t){return t.width*t.originX}},46928(t){t.exports=function(t){return t.height*t.originY}},54380(t){t.exports=function(t){return t.x+t.width-t.width*t.originX}},17717(t){t.exports=function(t){return t.y-t.height*t.originY}},86327(t){t.exports=function(t,e){return t.y=e-t.height+t.height*t.originY,t}},88417(t){t.exports=function(t,e){var i=t.width*t.originX;return t.x=e+i-.5*t.width,t}},20786(t){t.exports=function(t,e){var i=t.height*t.originY;return t.y=e+i-.5*t.height,t}},385(t){t.exports=function(t,e){return t.x=e+t.width*t.originX,t}},40136(t){t.exports=function(t,e){return t.x=e-t.width+t.width*t.originX,t}},66737(t){t.exports=function(t,e){return t.y=e+t.height*t.originY,t}},58724(t,e,i){t.exports={CenterOn:i(66786),GetBottom:i(62235),GetBounds:i(72873),GetCenterX:i(35893),GetCenterY:i(7702),GetLeft:i(26541),GetOffsetX:i(87431),GetOffsetY:i(46928),GetRight:i(54380),GetTop:i(17717),SetBottom:i(86327),SetCenterX:i(88417),SetCenterY:i(20786),SetLeft:i(385),SetRight:i(40136),SetTop:i(66737)}},20623(t){t.exports={setCrisp:function(t){return["optimizeSpeed","-moz-crisp-edges","-o-crisp-edges","-webkit-optimize-contrast","optimize-contrast","crisp-edges","pixelated"].forEach(function(e){t.style["image-rendering"]=e}),t.style.msInterpolationMode="nearest-neighbor",t},setBicubic:function(t){return t.style["image-rendering"]="auto",t.style.msInterpolationMode="bicubic",t}}},27919(t,e,i){var s,r,n,a=i(8054),o=i(68703),h=[],l=!1;t.exports=(n=function(){var t=0;return h.forEach(function(e){e.parent&&t++}),t},{create2D:function(t,e,i){return s(t,e,i,a.CANVAS)},create:s=function(t,e,i,s,n){var u;void 0===e&&(e=1),void 0===i&&(i=1),void 0===s&&(s=a.CANVAS),void 0===n&&(n=!1);var d=r(s);return null===d?(d={parent:t,canvas:document.createElement("canvas"),type:s},s===a.CANVAS&&h.push(d),u=d.canvas):(d.parent=t,u=d.canvas),n&&(d.parent=u),u.width=e,u.height=i,l&&s===a.CANVAS&&o.disable(u.getContext("2d",{willReadFrequently:!1})),u},createWebGL:function(t,e,i){return s(t,e,i,a.WEBGL)},disableSmoothing:function(){l=!0},enableSmoothing:function(){l=!1},first:r=function(t){if(void 0===t&&(t=a.CANVAS),t===a.WEBGL)return null;for(var e=0;e=0;e--)i.push({r:e,g:a,b:o,color:s(e,a,o)});for(n=0,e=0;e<=r;e++,a--)i.push({r:n,g:a,b:e,color:s(n,a,e)});for(a=0,o=255,e=0;e<=r;e++,o--,n++)i.push({r:n,g:a,b:o,color:s(n,a,o)});if(1024===t)return i;var h=[],l=0,u=1024/t;for(e=0;e>16&255,g:t>>8&255,b:255&t,a:255};return t>16777215&&(e.a=t>>>24),e}},62957(t){t.exports=function(t){var e=t.toString(16);return 1===e.length?"0"+e:e}},37589(t){t.exports=function(t,e,i){return t<<16|e<<8|i}},1e3(t){t.exports=function(t,e,i,s){return s<<24|t<<16|e<<8|i}},62183(t,e,i){var s=i(40987),r=i(89528);t.exports=function(t,e,i,n){n||(n=new s);var a=i,o=i,h=i;if(0!==e){var l=i<.5?i*(1+e):i+e-i*e,u=2*i-l;a=r(u,l,t+1/3),o=r(u,l,t),h=r(u,l,t-1/3)}return n.setGLTo(a,o,h,1)}},27939(t,e,i){var s=i(7537);t.exports=function(t,e){void 0===t&&(t=1),void 0===e&&(e=1);for(var i=[],r=0;r<=359;r++)i.push(s(r/359,t,e));return i}},7537(t,e,i){var s=i(37589);function r(t,e,i,s){var r=(t+6*e)%6,n=Math.min(r,4-r,1);return Math.round(255*(s-s*i*Math.max(0,n)))}t.exports=function(t,e,i,n){void 0===e&&(e=1),void 0===i&&(i=1);var a=r(5,t,e,i),o=r(3,t,e,i),h=r(1,t,e,i);return n?n.setTo?n.setTo(a,o,h,n.alpha,!0):(n.r=a,n.g=o,n.b=h,n.color=s(a,o,h),n):{r:a,g:o,b:h,color:s(a,o,h)}}},70238(t,e,i){var s=i(40987);t.exports=function(t,e){e||(e=new s),t=t.replace(/^(?:#|0x)?([a-f\d])([a-f\d])([a-f\d])$/i,function(t,e,i,s){return e+e+i+i+s+s});var i=/^(?:#|0x)?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);if(i){var r=parseInt(i[1],16),n=parseInt(i[2],16),a=parseInt(i[3],16);e.setTo(r,n,a)}return e}},89528(t){t.exports=function(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}},30100(t,e,i){var s=i(40987),r=i(90664);t.exports=function(t,e){var i=r(t);return e?e.setTo(i.r,i.g,i.b,i.a):new s(i.r,i.g,i.b,i.a)}},90664(t){t.exports=function(t){return t>16777215?{a:t>>>24,r:t>>16&255,g:t>>8&255,b:255&t}:{a:255,r:t>>16&255,g:t>>8&255,b:255&t}}},13699(t,e,i){var s=i(28915),r=i(37589),n=i(7537),a=function(t,e,i,n,a,o,h,l){void 0===h&&(h=100),void 0===l&&(l=0);var u=l/h,d=s(t,n,u),c=s(e,a,u),f=s(i,o,u);return{r:d,g:c,b:f,a:255,color:r(d,c,f)}},o=function(t,e,i,r,a,o,h,l,u){if(void 0===u&&(u=0),0===u){var d=t-r;d>.5?t-=1:d<-.5&&(t+=1)}else u>0?t>r&&(t-=1):tt?s.ORIENTATION.PORTRAIT:s.ORIENTATION.LANDSCAPE}},74403(t){t.exports=function(t){var e;return""!==t&&("string"==typeof t?e=document.getElementById(t):t&&1===t.nodeType&&(e=t)),e||(e=document.body),e}},56836(t){t.exports=function(t){var e="";try{if(window.DOMParser)e=(new DOMParser).parseFromString(t,"text/xml");else(e=new ActiveXObject("Microsoft.XMLDOM")).loadXML(t)}catch(t){e=null}return e&&e.documentElement&&!e.getElementsByTagName("parsererror").length?e:null}},35846(t){t.exports=function(t){t.parentNode&&t.parentNode.removeChild(t)}},43092(t,e,i){var s=i(83419),r=i(29747),n=new s({initialize:function(){this.isRunning=!1,this.callback=r,this.isSetTimeOut=!1,this.timeOutID=null,this.delay=0;var t=this;this.step=function e(i){t.callback(i),t.isRunning&&(t.timeOutID=window.requestAnimationFrame(e))},this.stepTimeout=function e(){t.isRunning&&(t.timeOutID=window.setTimeout(e,t.delay)),t.callback(window.performance.now())}},start:function(t,e,i){this.isRunning||(this.callback=t,this.isSetTimeOut=e,this.delay=i,this.isRunning=!0,this.timeOutID=e?window.setTimeout(this.stepTimeout,0):window.requestAnimationFrame(this.step))},stop:function(){this.isRunning=!1,this.isSetTimeOut?clearTimeout(this.timeOutID):window.cancelAnimationFrame(this.timeOutID)},destroy:function(){this.stop(),this.callback=r}});t.exports=n},84902(t,e,i){var s={AddToDOM:i(40366),DOMContentLoaded:i(57264),GetInnerHeight:i(57811),GetScreenOrientation:i(45818),GetTarget:i(74403),ParseXML:i(56836),RemoveFromDOM:i(35846),RequestAnimationFrame:i(43092)};t.exports=s},47565(t,e,i){var s=i(83419),r=i(50792),n=i(37277),a=new s({Extends:r,initialize:function(){r.call(this)},shutdown:function(){this.removeAllListeners()},destroy:function(){this.removeAllListeners()}});n.register("EventEmitter",a,"events"),t.exports=a},93055(t,e,i){t.exports={EventEmitter:i(47565)}},10189(t,e,i){var s=i(83419),r=i(13045),n=new s({Extends:r,initialize:function(t,e){void 0===e&&(e=1),r.call(this,t,"FilterBarrel"),this.amount=e}});t.exports=n},16762(t,e,i){var s=i(83419),r=i(13045),n=new s({Extends:r,initialize:function(t,e,i,s,n){void 0===e&&(e="__WHITE"),void 0===i&&(i=0),void 0===s&&(s=1),void 0===n&&(n=[1,1,1,1]),r.call(this,t,"FilterBlend"),this.glTexture,this.blendMode=i,this.amount=s,this.color=n,this.setTexture(e)},setTexture:function(t){var e=this.camera.scene.sys.textures.getFrame(t);return e&&(this.glTexture=e.glTexture),this}});t.exports=n},37597(t,e,i){var s=i(83419),r=i(13045),n=new s({Extends:r,initialize:function(t,e){r.call(this,t,"FilterBlocky"),this.size={x:4,y:4},this.offset={x:0,y:0},e&&(void 0!==e.size&&("number"==typeof e.size?(this.size.x=e.size,this.size.y=e.size):(this.size.x=e.size.x,this.size.y=e.size.y)),void 0!==e.offset&&("number"==typeof e.offset?(this.offset.x=e.offset,this.offset.y=e.offset):(this.offset.x=e.offset.x,this.offset.y=e.offset.y)))}});t.exports=n},88344(t,e,i){var s=i(83419),r=i(13045),n=new s({Extends:r,initialize:function(t,e,i,s,n,a,o){void 0===e&&(e=0),void 0===i&&(i=2),void 0===s&&(s=2),void 0===n&&(n=1),void 0===o&&(o=4),r.call(this,t,"FilterBlur"),this.quality=e,this.x=i,this.y=s,this.strength=n,this.glcolor=[1,1,1],null!=a&&(this.color=a),this.steps=o},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}},getPadding:function(){var t=this.paddingOverride;if(t)return this.currentPadding.setTo(t.x,t.y,t.width,t.height),t;var e=this.quality,i=0===e?1.333:1===e?3.2307692308:5.176470588235294,s=this.steps*this.strength*i,r=Math.ceil(this.x*s),n=Math.ceil(this.y*s);return this.currentPadding.setTo(-r,-n,2*r,2*n),this.currentPadding}});t.exports=n},47564(t,e,i){var s=i(83419),r=i(13045),n=new s({Extends:r,initialize:function(t,e,i,s,n,a,o,h){void 0===e&&(e=.5),void 0===i&&(i=1),void 0===s&&(s=.2),void 0===n&&(n=!1),void 0===a&&(a=1),void 0===o&&(o=1),void 0===h&&(h=1),r.call(this,t,"FilterBokeh"),this.radius=e,this.amount=i,this.contrast=s,this.isTiltShift=n,this.blurX=a,this.blurY=o,this.strength=h},getPadding:function(){var t=this.paddingOverride;if(t)return this.currentPadding.setTo(t.x,t.y,t.width,t.height),t;var e=Math.ceil(this.camera.height*this.radius*.021426096060426905);return this.currentPadding.setTo(-e,-e,2*e,2*e),this.currentPadding}});t.exports=n},77011(t,e,i){var s=i(83419),r=i(13045),n=i(89422),a=new s({Extends:r,initialize:function(t){r.call(this,t,"FilterColorMatrix"),this.colorMatrix=new n},destroy:function(){this.colorMatrix=null,r.prototype.destroy.call(this)}});t.exports=a},95200(t,e,i){var s=i(83419),r=i(13045),n=i(89422),a=new s({Extends:r,initialize:function(t,e){r.call(this,t,"FilterCombineColorMatrix"),this.glTexture,this.colorMatrixSelf=new n,this.colorMatrixTransfer=new n,this.additions=[1,1,1,0],this.multiplications=[0,0,0,1],this.setTexture(e||"__WHITE")},setTexture:function(t){var e=t instanceof Phaser.Textures.Texture?t:this.camera.scene.sys.textures.getFrame(t);return e&&(this.glTexture=e.glTexture),this},setupAlphaTransfer:function(t,e,i,s,r,n){var a=this.colorMatrixSelf,o=this.colorMatrixTransfer;a.reset(),o.reset(),this.additions=[1,1,1,0],this.multiplications=[0,0,0,1],t||a.black(),e||o.black(),r?a.brightnessToAlphaInverse(!0):i&&a.brightnessToAlpha(!0),n?o.brightnessToAlphaInverse(!0):s&&o.brightnessToAlpha(!0)},destroy:function(){this.colorMatrixSelf=null,this.colorMatrixTransfer=null,r.prototype.destroy.call(this)}});t.exports=a},13045(t,e,i){var s=i(83419),r=i(87841),n=new s({initialize:function(t,e){this.active=!0,this.camera=t,this.renderNode=e,this.paddingOverride=new r,this.currentPadding=new r,this.allowBaseDraw=!0,this.ignoreDestroy=!1},getPadding:function(){return this.paddingOverride||this.currentPadding},getPaddingCeil:function(){var t=this.getPadding(),e=new r(Math.ceil(t.x),Math.ceil(t.y),Math.ceil(t.width),Math.ceil(t.height));return this.currentPadding.setTo(e.x,e.y,e.width,e.height),e},setPaddingOverride:function(t,e,i,s){return null===t?(this.paddingOverride=null,this):(void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.paddingOverride=new r(t,e,i-t,s-e),this)},setActive:function(t){return this.active=t,this},destroy:function(){this.active=!1,this.renderNode=null,this.camera=null}});t.exports=n},16898(t,e,i){var s=i(83419),r=i(13045),n=new s({Extends:r,initialize:function(t,e,i,s){void 0===e&&(e="__WHITE"),void 0===i&&(i=.005),void 0===s&&(s=.005),r.call(this,t,"FilterDisplacement"),this.x=i,this.y=s,this.glTexture,this.setTexture(e)},setTexture:function(t){var e=this.camera.scene.sys.textures.getFrame(t);return e&&(this.glTexture=e.glTexture),this},getPadding:function(){var t=this.paddingOverride;if(t)return this.currentPadding.setTo(t.x,t.y,t.width,t.height),t;var e=this.camera,i=Math.ceil(e.width*this.x*.5),s=Math.ceil(e.height*this.y*.5);return this.currentPadding.setTo(-i,-s,2*i,2*s),this.currentPadding}});t.exports=n},42652(t,e,i){var s=i(83419),r=i(13045),n=new s({Extends:r,initialize:function(t,e,i,s,n,a,o,h){void 0===i&&(i=4),void 0===s&&(s=0),void 0===n&&(n=1),void 0===a&&(a=!1),void 0===o&&(o=t.scene.sys.game.config.glowQuality),void 0===h&&(h=t.scene.sys.game.config.glowDistance),r.call(this,t,"FilterGlow"),this.outerStrength=i,this.innerStrength=s,this.scale=n,this.knockout=a,this._quality=Math.max(Math.round(o),1),this._distance=Math.max(Math.round(h),1),this.glcolor=[1,1,1,1],void 0!==e&&(this.color=e)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}},distance:{get:function(){return this._distance}},quality:{get:function(){return this._quality}},getPadding:function(){var t=this.paddingOverride;if(t)return this.currentPadding.setTo(t.x,t.y,t.width,t.height),t;var e=this.currentPadding,i=Math.ceil(this.distance*this.scale);return e.left=-i,e.top=-i,e.right=i,e.bottom=i,e}});t.exports=n},43927(t,e,i){var s=i(83419),r=i(13045),n=i(73043),a=new s({Extends:r,initialize:function(t,e){e||(e={});var i=t.scene;r.call(this,t,"FilterGradientMap");var s=e.ramp;s||(s={colorStart:0,colorEnd:16777215}),s instanceof n||(s=new n(i,s,!0)),this.ramp=s,this.dither=!!e.dither,this.color=[0,0,0,0],e.color&&(this.color[0]=e.color[0]||0,this.color[1]=e.color[1]||0,this.color[2]=e.color[2]||0,this.color[3]=e.color[3]||0),this.colorFactor=[.3,.6,.1,0],e.colorFactor&&(this.colorFactor[0]=e.colorFactor[0]||0,this.colorFactor[1]=e.colorFactor[1]||0,this.colorFactor[2]=e.colorFactor[2]||0,this.colorFactor[3]=e.colorFactor[3]||0),this.unpremultiply=void 0===e.unpremultiply||e.unpremultiply,this.alpha=void 0===e.alpha?1:e.alpha}});t.exports=a},84714(t,e,i){var s=i(83419),r=i(13045),n=i(37867),a=i(61340),o=new s({Extends:r,initialize:function(t,e){r.call(this,t,"FilterImageLight"),this.normalGlTexture,this.environmentGlTexture,this.viewMatrix=new n,this.modelRotation=e.modelRotation||0,this.modelRotationSource=e.modelRotationSource||null,this.bulge=e.bulge||0,this.colorFactor=e.colorFactor||[1,1,1],this._tempMatrix=new a,this._tempParentMatrix=new a,this.setEnvironmentMap(e.environmentMap||"__WHITE"),this.setNormalMap(e.normalMap||"__NORMAL"),e.viewMatrix&&this.viewMatrix.set(e.viewMatrix)},setEnvironmentMap:function(t){var e=t instanceof Phaser.Textures.Texture?t:this.camera.scene.sys.textures.getFrame(t);return e&&(this.environmentGlTexture=e.glTexture),this},setNormalMap:function(t){var e=t instanceof Phaser.Textures.Texture?t:this.camera.scene.sys.textures.getFrame(t);return e&&(this.normalGlTexture=e.glTexture),this},setNormalMapFromGameObject:function(t){var e=t.texture.dataSource[0];return e&&(this.normalGlTexture=e.glTexture),this},getModelRotation:function(){return this.modelRotationSource?"function"==typeof this.modelRotationSource?this.modelRotationSource():this.modelRotationSource.hasTransformComponent?this.modelRotationSource.getWorldTransformMatrix(this._tempMatrix,this._tempParentMatrix).rotationNormalized:this.modelRotation:this.modelRotation}});t.exports=o},51890(t,e,i){var s=i(83419),r=i(13045),n=i(40987),a=new s({Extends:r,initialize:function(t,e){void 0===e&&(e={}),r.call(this,t,"FilterKey"),this.color=[1,1,1,1],void 0!==e.color&&this.setColor(e.color),void 0!==e.alpha&&this.setAlpha(e.alpha),this.isolate=!1,void 0!==e.isolate&&(this.isolate=e.isolate),this.threshold=.0625,void 0!==e.threshold&&(this.threshold=e.threshold),this.feather=0,void 0!==e.feather&&(this.feather=e.feather)},setAlpha:function(t){return this.color[3]=t,this},setColor:function(t){var e=this.color[3];if("number"==typeof t){var i=n.IntegerToRGB(t);this.color=[i.r/255,i.g/255,i.b/255,e]}else if("string"==typeof t){var s=n.HexStringToColor(t);this.color=[s.redGL,s.greenGL,s.blueGL,e]}else Array.isArray(t)?this.color=[t[0],t[1],t[2],e]:t instanceof n&&(this.color=[t.redGL,t.greenGL,t.blueGL,e]);return this}});t.exports=a},97797(t,e,i){var s=i(83419),r=i(45650),n=i(13045),a=new s({Extends:n,initialize:function(t,e,i,s,r,a){void 0===e&&(e="__WHITE"),void 0===i&&(i=!1),void 0===a&&(a=1),n.call(this,t,"FilterMask"),this.glTexture,this._dynamicTexture=null,this.maskGameObject=null,this.invert=i,this.autoUpdate=!0,this.needsUpdate=!1,this.viewTransform=r||"world",this.viewCamera=s,this.scaleFactor=a,"string"==typeof e?this.setTexture(e):this.setGameObject(e)},updateDynamicTexture:function(t,e){var i=this.scaleFactor,s=t*i,n=e*i,a=this.maskGameObject;if(a){if(this._dynamicTexture)this._dynamicTexture.width!==s||this._dynamicTexture.height!==n?this._dynamicTexture.setSize(s,n,!1):this._dynamicTexture.clear();else{var o=this.camera.scene.sys.textures;this._dynamicTexture=o.addDynamicTexture(r(),s,n,!1)}this.glTexture=this._dynamicTexture.get().glTexture;var h=this.viewCamera||a.scene.renderer.currentViewCamera;this._dynamicTexture.capture(a,{transform:this.viewTransform,camera:h}),this._dynamicTexture.render(),this.needsUpdate=!1}},setGameObject:function(t){return this.maskGameObject=t,this.needsUpdate=!0,this},setTexture:function(t){var e=this.camera.scene.sys.textures.getFrame(t);return e&&(this.maskGameObject=null,this.glTexture=e.glTexture),this},destroy:function(){this._dynamicTexture&&this._dynamicTexture.destroy(),this.maskGameObject=null,this._dynamicTexture=null,n.prototype.destroy.call(this)}});t.exports=a},37911(t,e,i){var s=i(83419),r=i(13045),n=i(37867),a=i(25836),o=new s({Extends:r,initialize:function(t,e){e=e||{},r.call(this,t,"FilterNormalTools"),this._rotation=0,this.viewMatrix=new n,this.setRotation(e.rotation||0),this.rotationSource=e.rotationSource||null,this.facingPower=e.facingPower||1,this.outputRatio=e.outputRatio||!1,this.ratioVector=new a(0,0,1),e.ratioVector&&this.ratioVector.set(e.ratioVector[0],e.ratioVector[1],e.ratioVector[2]),this.ratioRadius=e.ratioRadius||1},getRotation:function(){if(this.rotationSource){if("function"==typeof this.rotationSource)return this.rotationSource();if(this.rotationSource.hasTransformComponent)return this.rotationSource.getWorldTransformMatrix().rotationNormalized}return this._rotation},setRotation:function(t){return this.viewMatrix.identity().rotateZ(t),this._rotation=t,this},updateRotation:function(){if(this.rotationSource){var t=this.getRotation();this.viewMatrix.identity().rotateZ(t),this._rotation=t}return this}});t.exports=o},6379(t,e,i){var s=i(83419),r=i(13045),n=new s({Extends:r,initialize:function(t,e){void 0===e&&(e={}),r.call(this,t,"FilterPanoramaBlur"),this.radius=e.radius||1,this.samplesX=e.samplesX||32,this.samplesY=e.samplesY||16,this.power=e.power||1}});t.exports=n},2195(t,e,i){var s=i(83419),r=i(53427),n=i(13045),a=i(16762),o=new s({Extends:n,initialize:function(t){n.call(this,t,"FilterParallelFilters"),this.top=new r(t),this.bottom=new r(t),this.blend=new a(t)}});r.prototype.addParallelFilters=function(){return this.add(new o(this.camera))},t.exports=o},29861(t,e,i){var s=i(83419),r=i(13045),n=new s({Extends:r,initialize:function(t,e){void 0===e&&(e=1),r.call(this,t,"FilterPixelate"),this.amount=e}});t.exports=n},14366(t,e,i){var s=i(83419),r=i(13045),n=new s({Extends:r,initialize:function(t,e){e||(e={}),r.call(this,t,"FilterQuantize"),this.steps=[8,8,8,8],e.steps&&(this.steps[0]=e.steps[0],this.steps[1]=e.steps[1],this.steps[2]=e.steps[2],this.steps[3]=e.steps[3]),this.gamma=[1,1,1,1],e.gamma&&(this.gamma[0]=e.gamma[0],this.gamma[1]=e.gamma[1],this.gamma[2]=e.gamma[2],this.gamma[3]=e.gamma[3]),this.offset=[0,0,0,0],e.offset&&(this.offset[0]=e.offset[0],this.offset[1]=e.offset[1],this.offset[2]=e.offset[2],this.offset[3]=e.offset[3]),this.mode=e.mode||0,this.dither=!!e.dither}});t.exports=n},63785(t,e,i){var s=i(83419),r=i(13045),n=new s({Extends:r,initialize:function(t,e,i){void 0===i&&(i=null),r.call(this,t,"FilterSampler"),this.allowBaseDraw=!1,this.callback=e,this.region=i}});t.exports=n},62229(t,e,i){var s=i(83419),r=i(13045),n=new s({Extends:r,initialize:function(t,e,i,s,n,a,o,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=.1),void 0===n&&(n=1),void 0===o&&(o=6),void 0===h&&(h=1),r.call(this,t,"FilterShadow"),this.x=e,this.y=i,this.decay=s,this.power=n,this.glcolor=[0,0,0,1],this.samples=o,this.intensity=h,void 0!==a&&(this.color=a)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}},getPadding:function(){var t=this.paddingOverride;if(t)return this.currentPadding.setTo(t.x,t.y,t.width,t.height),t;var e=this.camera,i=this.decay*this.intensity,s=Math.ceil(Math.abs(this.x)*e.width*i),r=Math.ceil(Math.abs(this.y)*e.height*i);return this.currentPadding.setTo(-s,-r,2*s,2*r),this.currentPadding}});t.exports=n},99534(t,e,i){var s=i(83419),r=i(13045),n=new s({Extends:r,initialize:function(t,e,i,s){r.call(this,t,"FilterThreshold"),this.edge1=[.5,.5,.5,.5],this.edge2=[.5,.5,.5,.5],this.invert=[!1,!1,!1,!1],this.setEdge(e,i),this.setInvert(s)},setEdge:function(t,e){void 0===t&&(t=.5),"number"==typeof t&&(t=[t,t,t,t]),this.edge1[0]=t[0],this.edge1[1]=t[1],this.edge1[2]=t[2],this.edge1[3]=t[3],void 0===e&&(e=t),"number"==typeof e&&(e=[e,e,e,e]),this.edge2[0]=e[0],this.edge2[1]=e[1],this.edge2[2]=e[2],this.edge2[3]=e[3];for(var i=0;i<4;i++)if(this.edge1[i]>this.edge2[i]){var s=this.edge1[i];this.edge1[i]=this.edge2[i],this.edge2[i]=s}return this},setInvert:function(t){return void 0===t&&(t=!1),"boolean"==typeof t&&(t=[t,t,t,t]),this.invert[0]=t[0],this.invert[1]=t[1],this.invert[2]=t[2],this.invert[3]=t[3],this}});t.exports=n},20263(t,e,i){var s=i(83419),r=i(13045),n=i(40987),a=new s({Extends:r,initialize:function(t,e,i,s,a,o,h){void 0===e&&(e=.5),void 0===i&&(i=.5),void 0===s&&(s=.5),void 0===a&&(a=.5),void 0===o&&(o=0),void 0===h&&(h=0),r.call(this,t,"FilterVignette"),this.x=e,this.y=i,this.radius=s,this.strength=a,this.color=new n,this.blendMode=h,this.setColor(o)},setColor:function(t){return"number"==typeof t?n.IntegerToColor(t,this.color):"string"==typeof t?n.HexStringToColor(t,this.color):t.setTo?this.color.setTo(t.red,t.green,t.blue,t.alpha):t?this.color.setTo(t.r||0,t.g||0,t.b||0,t.a||255):this.color.setTo(0,0,0,255),this}});t.exports=a},90002(t,e,i){var s=i(83419),r=i(13045),n=i(79237),a=new s({Extends:r,initialize:function(t,e,i,s,n,a){void 0===e&&(e=.1),r.call(this,t,"FilterWipe"),this.progress=0,this.wipeWidth=e,this.direction=i||0,this.axis=s||0,this.reveal=n||0,this.wipeTexture=null,this.setTexture(a)},setWipeWidth:function(t){return void 0===t&&(t=.1),this.wipeWidth=t,this},setLeftToRight:function(){return this.direction=0,this.axis=0,this},setRightToLeft:function(){return this.direction=1,this.axis=0,this},setTopToBottom:function(){return this.direction=1,this.axis=1,this},setBottomToTop:function(){return this.direction=0,this.axis=1,this},setWipeEffect:function(){return this.reveal=0,this.progress=0,this},setRevealEffect:function(){return this.setTexture(),this.reveal=1,this.progress=0,this},setTexture:function(t){return void 0===t&&(t="__DEFAULT"),this.wipeTexture=t instanceof n?t:this.camera.scene.sys.textures.get(t)||this.camera.scene.sys.textures.get("__DEFAULT"),this},setProgress:function(t){return this.progress=t,this}});t.exports=a},11889(t,e,i){var s={Controller:i(13045),Barrel:i(10189),Blend:i(16762),Blocky:i(37597),Blur:i(88344),Bokeh:i(47564),ColorMatrix:i(77011),CombineColorMatrix:i(95200),Displacement:i(16898),Glow:i(42652),GradientMap:i(43927),ImageLight:i(84714),Key:i(51890),Mask:i(97797),NormalTools:i(37911),PanoramaBlur:i(6379),ParallelFilters:i(2195),Pixelate:i(29861),Quantize:i(14366),Sampler:i(63785),Shadow:i(62229),Threshold:i(99534),Vignette:i(20263),Wipe:i(90002)};t.exports=s},25305(t,e,i){var s=i(10312),r=i(23568);t.exports=function(t,e,i){e.x=r(i,"x",0),e.y=r(i,"y",0),e.depth=r(i,"depth",0),e.flipX=r(i,"flipX",!1),e.flipY=r(i,"flipY",!1);var n=r(i,"scale",null);"number"==typeof n?e.setScale(n):null!==n&&(e.scaleX=r(n,"x",1),e.scaleY=r(n,"y",1));var a=r(i,"scrollFactor",null);"number"==typeof a?e.setScrollFactor(a):null!==a&&(e.scrollFactorX=r(a,"x",1),e.scrollFactorY=r(a,"y",1)),e.rotation=r(i,"rotation",0);var o=r(i,"angle",null);null!==o&&(e.angle=o),e.alpha=r(i,"alpha",1);var h=r(i,"origin",null);if("number"==typeof h)e.setOrigin(h);else if(null!==h){var l=r(h,"x",.5),u=r(h,"y",.5);e.setOrigin(l,u)}return e.blendMode=r(i,"blendMode",s.NORMAL),e.visible=r(i,"visible",!0),r(i,"add",!0)&&t.sys.displayList.add(e),e.preUpdate&&t.sys.updateList.add(e),e}},13059(t,e,i){var s=i(23568);t.exports=function(t,e){var i=s(e,"anims",null);if(null===i)return t;if("string"==typeof i)t.anims.play(i);else if("object"==typeof i){var r=t.anims,n=s(i,"key",void 0);if(n){var a=s(i,"startFrame",void 0),o=s(i,"delay",0),h=s(i,"repeat",0),l=s(i,"repeatDelay",0),u=s(i,"yoyo",!1),d=s(i,"play",!1),c=s(i,"delayedPlay",0),f={key:n,delay:o,repeat:h,repeatDelay:l,yoyo:u,startFrame:a};d?r.play(f):c>0?r.playAfterDelay(f,c):r.load(f)}}return t}},8050(t,e,i){var s=i(83419),r=i(73162),n=i(37277),a=i(51708),o=i(44594),h=i(19186),l=new s({Extends:r,initialize:function(t){r.call(this,t),this.sortChildrenFlag=!1,this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.addCallback=this.addChildCallback,this.removeCallback=this.removeChildCallback,this.events.once(o.BOOT,this.boot,this),this.events.on(o.START,this.start,this)},boot:function(){this.events.once(o.DESTROY,this.destroy,this)},addChildCallback:function(t){t.displayList&&t.displayList!==this&&t.removeFromDisplayList(),t.parentContainer&&t.parentContainer.remove(t),t.displayList||(this.queueDepthSort(),t.displayList=this,t.emit(a.ADDED_TO_SCENE,t,this.scene),this.events.emit(o.ADDED_TO_SCENE,t,this.scene))},removeChildCallback:function(t){this.queueDepthSort(),t.displayList=null,t.emit(a.REMOVED_FROM_SCENE,t,this.scene),this.events.emit(o.REMOVED_FROM_SCENE,t,this.scene)},start:function(){this.events.once(o.SHUTDOWN,this.shutdown,this)},queueDepthSort:function(){this.sortChildrenFlag=!0},depthSort:function(){this.sortChildrenFlag&&(h(this.list,this.sortByDepth),this.sortChildrenFlag=!1)},sortByDepth:function(t,e){return t._depth-e._depth},getChildren:function(){return this.list},shutdown:function(){for(var t=this.list,e=t.length;e--;)t[e]&&t[e].destroy(!0);t.length=0,this.events.off(o.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(o.START,this.start,this),this.scene=null,this.systems=null,this.events=null}});n.register("DisplayList",l,"displayList"),t.exports=l},95643(t,e,i){var s=i(83419),r=i(31401),n=i(53774),a=i(45893),o=i(50792),h=i(51708),l=i(44594),u=new s({Extends:o,Mixins:[r.Filters,r.RenderSteps],initialize:function(t,e){o.call(this),this.scene=t,this.displayList=null,this.type=e,this.state=0,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.vertexRoundMode="safeAuto",this.input=null,this.body=null,this.ignoreDestroy=!1,this.isDestroyed=!1,this.addRenderStep&&this.addRenderStep(this.renderWebGL),this.on(h.ADDED_TO_SCENE,this.addedToScene,this),this.on(h.REMOVED_FROM_SCENE,this.removedFromScene,this),t.sys.queueDepthSort()},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},setState:function(t){return this.state=t,this},setDataEnabled:function(){return this.data||(this.data=new a(this)),this},setData:function(t,e){return this.data||(this.data=new a(this)),this.data.set(t,e),this},incData:function(t,e){return this.data||(this.data=new a(this)),this.data.inc(t,e),this},toggleData:function(t){return this.data||(this.data=new a(this)),this.data.toggle(t),this},getData:function(t){return this.data||(this.data=new a(this)),this.data.get(t)},setInteractive:function(t,e,i){return this.scene.sys.input.enable(this,t,e,i),this},disableInteractive:function(t){return void 0===t&&(t=!1),this.scene.sys.input.disable(this,t),this},removeInteractive:function(t){return void 0===t&&(t=!1),this.scene.sys.input.clear(this),t&&this.scene.sys.input.resetCursor(),this.input=void 0,this},addedToScene:function(){},removedFromScene:function(){},update:function(){},toJSON:function(){return n(this)},willRender:function(t){return!(!(!this.displayList||!this.displayList.active||this.displayList.willRender(t))||u.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},willRoundVertices:function(t,e){switch(this.vertexRoundMode){case"safe":return e;case"safeAuto":return e&&t.roundPixels;case"full":return!0;case"fullAuto":return t.roundPixels;default:return!1}},setVertexRoundMode:function(t){return this.vertexRoundMode=t,this},getIndexList:function(){for(var t=this,e=this.parentContainer,i=[];e&&(i.unshift(e.getIndex(t)),t=e,e.parentContainer);)e=e.parentContainer;return this.displayList?i.unshift(this.displayList.getIndex(t)):i.unshift(this.scene.sys.displayList.getIndex(t)),i},addToDisplayList:function(t){return void 0===t&&(t=this.scene.sys.displayList),this.displayList&&this.displayList!==t&&this.removeFromDisplayList(),t.exists(this)||(this.displayList=t,t.add(this,!0),t.queueDepthSort(),this.emit(h.ADDED_TO_SCENE,this,this.scene),t.events.emit(l.ADDED_TO_SCENE,this,this.scene)),this},addToUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.add(this),this},removeFromDisplayList:function(){var t=this.displayList||this.scene.sys.displayList;return t&&t.exists(this)&&(t.remove(this,!0),t.queueDepthSort(),this.displayList=null,this.emit(h.REMOVED_FROM_SCENE,this,this.scene),t.events.emit(l.REMOVED_FROM_SCENE,this,this.scene)),this},removeFromUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.remove(this),this},getDisplayList:function(){var t=null;return this.parentContainer?t=this.parentContainer.list:this.displayList&&(t=this.displayList.list),t},destroy:function(t){this.scene&&!this.ignoreDestroy&&(void 0===t&&(t=!1),this.isDestroyed=!0,this.preDestroy&&this.preDestroy.call(this),this.emit(h.DESTROY,this,t),this.removeAllListeners(),this.removeFromDisplayList(),this.removeFromUpdateList(),this.input&&(this.scene.sys.input.clear(this),this.input=void 0),this.data&&(this.data.destroy(),this.data=void 0),this.body&&(this.body.destroy(),this.body=void 0),this.filterCamera&&(this.filterCamera.destroy(),this.filterCamera=void 0),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0)}});u.RENDER_MASK=15,t.exports=u},44603(t,e,i){var s=i(83419),r=i(37277),n=i(44594),a=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.displayList,this.updateList,this.events.once(n.BOOT,this.boot,this),this.events.on(n.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(n.DESTROY,this.destroy,this)},start:function(){this.events.once(n.SHUTDOWN,this.shutdown,this)},shutdown:function(){this.events.off(n.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(n.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});a.register=function(t,e){a.prototype.hasOwnProperty(t)||(a.prototype[t]=e)},a.remove=function(t){a.prototype.hasOwnProperty(t)&&delete a.prototype[t]},r.register("GameObjectCreator",a,"make"),t.exports=a},39429(t,e,i){var s=i(83419),r=i(37277),n=i(44594),a=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.displayList,this.updateList,this.events.once(n.BOOT,this.boot,this),this.events.on(n.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(n.DESTROY,this.destroy,this)},start:function(){this.events.once(n.SHUTDOWN,this.shutdown,this)},existing:function(t){return(t.renderCanvas||t.renderWebGL)&&this.displayList.add(t),t.preUpdate&&this.updateList.add(t),t},shutdown:function(){this.events.off(n.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(n.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});a.register=function(t,e){a.prototype.hasOwnProperty(t)||(a.prototype[t]=e)},a.remove=function(t){a.prototype.hasOwnProperty(t)&&delete a.prototype[t]},r.register("GameObjectFactory",a,"add"),t.exports=a},91296(t,e,i){var s=i(61340),r=new s,n=new s,a=new s,o=new s,h={camera:r,sprite:n,calc:a,cameraExternal:o};t.exports=function(t,e,i,s){return s?o.loadIdentity():o.copyFrom(e.matrixExternal),r.copyWithScrollFactorFrom(s?e.matrix:e.matrixCombined,e.scrollX,e.scrollY,t.scrollFactorX,t.scrollFactorY),a.copyFrom(r),i&&a.multiply(i),n.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),a.multiply(n),h}},45027(t,e,i){var s=i(83419),r=i(25774),n=i(37277),a=i(44594),o=new s({Extends:r,initialize:function(t){r.call(this),this.checkQueue=!0,this.scene=t,this.systems=t.sys,t.sys.events.once(a.BOOT,this.boot,this),t.sys.events.on(a.START,this.start,this)},boot:function(){this.systems.events.once(a.DESTROY,this.destroy,this)},start:function(){var t=this.systems.events;t.on(a.PRE_UPDATE,this.update,this),t.on(a.UPDATE,this.sceneUpdate,this),t.once(a.SHUTDOWN,this.shutdown,this)},sceneUpdate:function(t,e){for(var i=this._active,s=i.length,r=0;r0){a=o.split("\n");var z=[];for(r=0;rE&&(d=E),c>C&&(c=C);var q=E+S.xAdvance,K=C+g;fF&&(F=I),IF&&(F=I),I0)for(var Q=0;Qo.length&&(y=o.length);for(var T=p,w=m,S={retroFont:!0,font:h,size:i,lineHeight:r+x,chars:{}},b=0,E=0;E?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",TEXT_SET2:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET3:"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",TEXT_SET4:"ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789",TEXT_SET5:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789",TEXT_SET6:"ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' ",TEXT_SET7:"AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39",TEXT_SET8:"0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET9:"ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?!",TEXT_SET10:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET11:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789"}},2638(t,e,i){var s=i(22186),r=i(83419),n=i(12310),a=new r({Extends:s,Mixins:[n],initialize:function(t,e,i,r,n,a,o){s.call(this,t,e,i,r,n,a,o),this.type="DynamicBitmapText",this.scrollX=0,this.scrollY=0,this.cropWidth=0,this.cropHeight=0,this.displayCallback,this.callbackData={parent:this,color:0,tint:{topLeft:0,topRight:0,bottomLeft:0,bottomRight:0},index:0,charCode:0,x:0,y:0,scale:0,rotation:0,data:0}},setSize:function(t,e){return this.cropWidth=t,this.cropHeight=e,this},setDisplayCallback:function(t){return this.displayCallback=t,this},setScrollX:function(t){return this.scrollX=t,this},setScrollY:function(t){return this.scrollY=t,this}});t.exports=a},86741(t,e,i){var s=i(20926);t.exports=function(t,e,i,r){var n=e._text,a=n.length,o=t.currentContext;if(0!==a&&s(t,o,e,i,r)){i.addToRenderList(e);var h=e.fromAtlas?e.frame:e.texture.frames.__BASE,l=e.displayCallback,u=e.callbackData,d=e.fontData.chars,c=e.fontData.lineHeight,f=e._letterSpacing,p=0,m=0,g=0,v=null,x=0,y=0,T=0,w=0,S=0,b=0,E=null,C=0,A=e.frame.source.image,_=h.cutX,M=h.cutY,R=0,O=0,P=e._fontSize/e.fontData.size,L=e._align,F=0,D=0;e.getTextBounds(!1);var I=e._bounds.lines;1===L?D=(I.longest-I.lengths[0])/2:2===L&&(D=I.longest-I.lengths[0]),o.translate(-e.displayOriginX,-e.displayOriginY);var N=i.roundPixels;e.cropWidth>0&&e.cropHeight>0&&(o.beginPath(),o.rect(0,0,e.cropWidth,e.cropHeight),o.clip());for(var B=0;B0||e.cropHeight>0;y&&((f=i.getClone()).setScissorEnable(!0),f.setScissorBox(v.tx,v.ty,e.cropWidth*v.scaleX,e.cropHeight*v.scaleY),f.use()),h.frame=e.frame;var T,w,S=r.MULTIPLY,b=a.getTintAppendFloatAlpha(e.tintTopLeft,e._alphaTL),E=a.getTintAppendFloatAlpha(e.tintTopRight,e._alphaTR),C=a.getTintAppendFloatAlpha(e.tintBottomLeft,e._alphaBL),A=a.getTintAppendFloatAlpha(e.tintBottomRight,e._alphaBR),_=0,M=0,R=0,O=0,P=e.letterSpacing,L=0,F=0,D=e.scrollX,I=e.scrollY,N=e.fontData,B=N.chars,k=N.lineHeight,U=e.fontSize/N.size,z=0,Y=e._align,X=0,W=0,G=e.getTextBounds(!1);e.maxWidth>0&&(d=(u=G.wrappedText).length);var H=e._bounds.lines;1===Y?W=(H.longest-H.lengths[0])/2:2===Y&&(W=H.longest-H.lengths[0]);for(var V=e.displayCallback,j=e.callbackData,q=0;q0&&(a=(n=L.wrappedText).length);var F=e._bounds.lines;1===R?P=(F.longest-F.lengths[0])/2:2===R&&(P=F.longest-F.lengths[0]),o.translate(-e.displayOriginX,-e.displayOriginY);for(var D=i.roundPixels,I=0;I0},getRenderList:function(){return this.dirty&&(this.renderList=this.children.list.filter(this.childCanRender,this),this.dirty=!1),this.renderList},clear:function(){this.children.removeAll(),this.dirty=!0},preDestroy:function(){this.children.destroy(),this.renderList=[]}});t.exports=d},72396(t){t.exports=function(t,e,i,s){var r=e.getRenderList();if(0!==r.length){var n=t.currentContext,a=i.alpha*e.alpha;if(0!==a){i.addToRenderList(e),n.globalCompositeOperation=t.blendModes[e.blendMode],n.imageSmoothingEnabled=!e.frame.source.scaleMode;var o=e.x-i.scrollX*e.scrollFactorX,h=e.y-i.scrollY*e.scrollFactorY;n.save(),s&&s.copyToContext(n);for(var l=i.roundPixels,u=0;u0&&p.height>0&&(n.save(),n.translate(d.x+o,d.y+h),n.scale(v,x),n.drawImage(f.source.image,p.x,p.y,p.width,p.height,m,g,p.width,p.height),n.restore())):(l&&(m=Math.round(m),g=Math.round(g)),p.width>0&&p.height>0&&n.drawImage(f.source.image,p.x,p.y,p.width,p.height,m+d.x+o,g+d.y+h,p.width,p.height)))}n.restore()}}}},9403(t,e,i){var s=i(6107),r=i(25305),n=i(44603),a=i(23568);n.register("blitter",function(t,e){void 0===t&&(t={});var i=a(t,"key",null),n=a(t,"frame",null),o=new s(this.scene,0,0,i,n);return void 0!==e&&(t.add=e),r(this.scene,o,t),o})},12709(t,e,i){var s=i(6107);i(39429).register("blitter",function(t,e,i,r){return this.displayList.add(new s(this.scene,t,e,i,r))})},48011(t,e,i){var s=i(29747),r=s,n=s;r=i(99485),n=i(72396),t.exports={renderWebGL:r,renderCanvas:n}},99485(t,e,i){var s=i(61340),r=i(70554),n=new s,a={quad:new Float32Array(8)},o={},h={};t.exports=function(t,e,i,s){var l=e.getRenderList(),u=i.camera,d=e.alpha;if(0!==l.length&&0!==d){u.addToRenderList(e);var c=n.copyWithScrollFactorFrom(u.getViewMatrix(!i.useCanvas),u.scrollX,u.scrollY,e.scrollFactorX,e.scrollFactorY);s&&c.multiply(s);for(var f=e.x,p=e.y,m=e.customRenderNodes,g=e.defaultRenderNodes,v=0;v0!=t>0,this._alpha=t}}});t.exports=n},43451(t,e,i){var s=i(87774),r=i(30529),n=i(83419),a=i(31401),o=i(95643),h=i(36683),l=new n({Extends:o,Mixins:[a.BlendMode,a.Depth,a.RenderNodes,a.Visible,h],initialize:function(t,e){o.call(this,t,"CaptureFrame");var i=t.renderer;this.drawingContext=new s(i,{width:i.width,height:i.height}),this.captureTexture=t.sys.textures.addGLTexture(e,this.drawingContext.texture),this.initRenderNodes(this._defaultRenderNodesMap)},_defaultRenderNodesMap:{get:function(){return r}},setAlpha:function(t){return this},setScrollFactor:function(t,e){return this}});t.exports=l},23675(t,e,i){var s=i(44603),r=i(23568),n=i(43451);s.register("captureFrame",function(t,e){void 0===t&&(t={});var i=r(t,"depth",0),s=r(t,"key",null),a=r(t,"visible",!0),o=new n(this.scene,s);return void 0!==e&&(t.add=e),o.setDepth(i).setVisible(a),t.add&&this.scene.sys.displayList.add(o),o})},20421(t,e,i){var s=i(43451);i(39429).register("captureFrame",function(t){return this.displayList.add(new s(this.scene,t))})},36683(t,e,i){var s=i(29747),r=s,n=s;r=i(82237),t.exports={renderWebGL:r,renderCanvas:n}},82237(t){var e=!1;t.exports=function(t,i,s){if(s.useCanvas)e||(e=!0,console.warn("CaptureFrame: Cannot capture from main canvas. Activate `forceComposite` on the camera to use this feature. This warning will now mute."));else{s.camera.addToRenderList(i);var r=s.width,n=s.height,a=i.customRenderNodes,o=i.defaultRenderNodes;i.drawingContext.resize(r,n),i.drawingContext.use(),(a.BatchHandler||o.BatchHandler).batch(i.drawingContext,s.texture,0,n,0,0,r,n,r,0,0,0,1,1,!1,4294967295,4294967295,4294967295,4294967295,{}),i.drawingContext.release()}}},16005(t,e,i){var s=i(45319),r={_alpha:1,_alphaTL:1,_alphaTR:1,_alphaBL:1,_alphaBR:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t,e,i,r){return void 0===t&&(t=1),void 0===e?this.alpha=t:(this._alphaTL=s(t,0,1),this._alphaTR=s(e,0,1),this._alphaBL=s(i,0,1),this._alphaBR=s(r,0,1)),this},alpha:{get:function(){return this._alpha},set:function(t){var e=s(t,0,1);this._alpha=e,this._alphaTL=e,this._alphaTR=e,this._alphaBL=e,this._alphaBR=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}},alphaTopLeft:{get:function(){return this._alphaTL},set:function(t){var e=s(t,0,1);this._alphaTL=e,0!==e&&(this.renderFlags|=2)}},alphaTopRight:{get:function(){return this._alphaTR},set:function(t){var e=s(t,0,1);this._alphaTR=e,0!==e&&(this.renderFlags|=2)}},alphaBottomLeft:{get:function(){return this._alphaBL},set:function(t){var e=s(t,0,1);this._alphaBL=e,0!==e&&(this.renderFlags|=2)}},alphaBottomRight:{get:function(){return this._alphaBR},set:function(t){var e=s(t,0,1);this._alphaBR=e,0!==e&&(this.renderFlags|=2)}}};t.exports=r},88509(t,e,i){var s=i(45319),r={_alpha:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t){return void 0===t&&(t=1),this.alpha=t,this},alpha:{get:function(){return this._alpha},set:function(t){var e=s(t,0,1);this._alpha=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}}};t.exports=r},90065(t,e,i){var s=i(10312),r={_blendMode:s.NORMAL,blendMode:{get:function(){return this._blendMode},set:function(t){"string"==typeof t&&(t=s[t]),(t|=0)>=-1&&(this._blendMode=t)}},setBlendMode:function(t){return this.blendMode=t,this}};t.exports=r},94215(t){t.exports={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}}},61683(t){var e={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,s){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,s,this.flipX,this.flipY);else{var r=t;this.frame.setCropUVs(this._crop,r.x,r.y,r.width,r.height,this.flipX,this.flipY)}this.isCropped=!0}return this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=e},89272(t,e,i){const s=i(7889);t.exports=s.DepthDescriptors,Object.defineProperty(t.exports,"Depth",{value:s.Depth})},3248(t){var e={timeElapsed:0,timeElapsedResetPeriod:36e5,timePaused:!1,setTimerResetPeriod:function(t){return this.timeElapsedResetPeriod=t,this},setTimerPaused:function(t){return this.timePaused=!!t,this},resetTimer:function(t){return void 0===t&&(t=0),this.timeElapsed=t,this},updateTimer:function(t,e){return this.timePaused||(this.timeElapsed+=e,this.timeElapsed>=this.timeElapsedResetPeriod&&(this.timeElapsed-=this.timeElapsedResetPeriod)),this}};t.exports=e},53427(t,e,i){var s=i(83419),r=i(10189),n=i(16762),a=i(37597),o=i(88344),h=i(47564),l=i(77011),u=i(95200),d=i(16898),c=i(42652),f=i(43927),p=i(84714),m=i(51890),g=i(97797),v=i(37911),x=i(6379),y=i(29861),T=i(14366),w=i(63785),S=i(62229),b=i(99534),E=i(20263),C=i(90002),A=new s({initialize:function(t){this.camera=t,this.list=[]},clear:function(){for(var t=0;t0||this.filters.external.getActive().length>0||this.filtersForceComposite)},enableFilters:function(){if(this.filterCamera||!this.scene.renderer.gl)return this;var t=this.scene;if(s||(s=i(38058)),this.filterCamera=new s(0,0,1,1).setScene(t,!1),this.filterCamera.isObjectInversion=!0,t.game.config.roundPixels&&(this.filterCamera.roundPixels=!0),!this.maxFilterSize){var e=t.renderer.getMaxTextureSize();this.maxFilterSize=new r(e,e)}return this._filtersMatrix=new n,this._filtersViewMatrix=new n,this.getBounds&&void 0!==this.width&&void 0!==this.height&&0!==this.width&&0!==this.height||(this.filtersFocusContext=!0),this.addRenderStep(this.renderWebGLFilters,0),this},renderWebGLFilters:function(t,e,i,s,r){if(e.willRenderFilters()){var n=i.camera,a=e.filtersAutoFocus,o=e.filtersFocusContext;a&&(o?e.focusFiltersOnCamera(n):e.focusFilters());var h=e.filterCamera;h.preRender();var l=h.roundPixels;if(h.roundPixels=e.willRoundVertices(h,e.rotation%(2*Math.PI)==0&&(e.scaleX,1===e.scaleY)),a&&o){var u=e.parentContainer;if(u){var d=u.getWorldTransformMatrix();h.matrix.multiply(d)}}var c=e._filtersMatrix,f=e._filtersViewMatrix.copyWithScrollFactorFrom(n.getViewMatrix(!i.useCanvas),n.scrollX,n.scrollY,e.scrollFactorX,e.scrollFactorY);if(s&&f.multiply(s),o)c.loadIdentity();else{if("Layer"===e.type)c.loadIdentity();else{var p=e.flipX?-1:1,m=e.flipY?-1:1;c.applyITRS(e.x,e.y,e.rotation,e.scaleX*p,e.scaleY*m)}var g=h.width,v=h.height;c.translate(-g*h.originX,-v*h.originY),f.multiply(c,c)}var x=e.scrollFactorX,y=e.scrollFactorY;e.scrollFactorX=1,e.scrollFactorY=1,t.cameraRenderNode.run(i,[e],h,c,!0,r+1),e.scrollFactorX=x,e.scrollFactorY=y,h.roundPixels=l;for(var T=h.renderList.length,w=0;w0?Math.acos(e/this.scaleX):-Math.acos(e/this.scaleX):s||n?r.PI_OVER_2-(n>0?Math.acos(-s/this.scaleY):-Math.acos(s/this.scaleY)):0}},scaleX:{get:function(){return Math.sqrt(this.a*this.a+this.b*this.b)}},scaleY:{get:function(){return Math.sqrt(this.c*this.c+this.d*this.d)}},loadIdentity:function(){var t=this.matrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,this},translate:function(t,e){var i=this.matrix;return i[4]=i[0]*t+i[2]*e+i[4],i[5]=i[1]*t+i[3]*e+i[5],this},scale:function(t,e){var i=this.matrix;return i[0]*=t,i[1]*=t,i[2]*=e,i[3]*=e,this},rotate:function(t){var e=Math.sin(t),i=Math.cos(t),s=this.matrix,r=s[0],n=s[1],a=s[2],o=s[3];return s[0]=r*i+a*e,s[1]=n*i+o*e,s[2]=r*-e+a*i,s[3]=n*-e+o*i,this},multiply:function(t,e){var i=this.matrix,s=t.matrix,r=i[0],n=i[1],a=i[2],o=i[3],h=i[4],l=i[5],u=s[0],d=s[1],c=s[2],f=s[3],p=s[4],m=s[5],g=void 0===e?i:e.matrix;return g[0]=u*r+d*a,g[1]=u*n+d*o,g[2]=c*r+f*a,g[3]=c*n+f*o,g[4]=p*r+m*a+h,g[5]=p*n+m*o+l,g},multiplyWithOffset:function(t,e,i){var s=this.matrix,r=t.matrix,n=s[0],a=s[1],o=s[2],h=s[3],l=e*n+i*o+s[4],u=e*a+i*h+s[5],d=r[0],c=r[1],f=r[2],p=r[3],m=r[4],g=r[5];return s[0]=d*n+c*o,s[1]=d*a+c*h,s[2]=f*n+p*o,s[3]=f*a+p*h,s[4]=m*n+g*o+l,s[5]=m*a+g*h+u,this},transform:function(t,e,i,s,r,n){var a=this.matrix,o=a[0],h=a[1],l=a[2],u=a[3],d=a[4],c=a[5];return a[0]=t*o+e*l,a[1]=t*h+e*u,a[2]=i*o+s*l,a[3]=i*h+s*u,a[4]=r*o+n*l+d,a[5]=r*h+n*u+c,this},transformPoint:function(t,e,i){void 0===i&&(i={x:0,y:0});var s=this.matrix,r=s[0],n=s[1],a=s[2],o=s[3],h=s[4],l=s[5];return i.x=t*r+e*a+h,i.y=t*n+e*o+l,i},invert:function(){var t=this.matrix,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=e*r-i*s;return t[0]=r/o,t[1]=-i/o,t[2]=-s/o,t[3]=e/o,t[4]=(s*a-r*n)/o,t[5]=-(e*a-i*n)/o,this},copyFrom:function(t){var e=this.matrix;return e[0]=t.a,e[1]=t.b,e[2]=t.c,e[3]=t.d,e[4]=t.e,e[5]=t.f,this},copyFromArray:function(t){var e=this.matrix;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],this},copyWithScrollFactorFrom:function(t,e,i,s,r){var n=this.matrix;n[0]=t.a,n[1]=t.b,n[2]=t.c,n[3]=t.d;var a=e*(1-s),o=i*(1-r);return n[4]=t.a*a+t.c*o+t.e,n[5]=t.b*a+t.d*o+t.f,this},copyToContext:function(t){var e=this.matrix;return t.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t},setToContext:function(t){return t.setTransform(this.a,this.b,this.c,this.d,this.e,this.f),t},copyToArray:function(t){var e=this.matrix;return void 0===t?t=[e[0],e[1],e[2],e[3],e[4],e[5]]:(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5]),t},setTransform:function(t,e,i,s,r,n){var a=this.matrix;return a[0]=t,a[1]=e,a[2]=i,a[3]=s,a[4]=r,a[5]=n,this},decomposeMatrix:function(){var t=this.decomposedMatrix,e=this.matrix,i=e[0],s=e[1],r=e[2],n=e[3],a=i*n-s*r;if(t.translateX=e[4],t.translateY=e[5],i||s){var o=Math.sqrt(i*i+s*s);t.rotation=s>0?Math.acos(i/o):-Math.acos(i/o),t.scaleX=o,t.scaleY=a/o}else if(r||n){var h=Math.sqrt(r*r+n*n);t.rotation=.5*Math.PI-(n>0?Math.acos(-r/h):-Math.acos(r/h)),t.scaleX=a/h,t.scaleY=h}else t.rotation=0,t.scaleX=0,t.scaleY=0;return t},applyITRS:function(t,e,i,s,r){var n=this.matrix,a=Math.sin(i),o=Math.cos(i);return n[4]=t,n[5]=e,n[0]=o*s,n[1]=a*s,n[2]=-a*r,n[3]=o*r,this},applyInverse:function(t,e,i){void 0===i&&(i=new n);var s=this.matrix,r=s[0],a=s[1],o=s[2],h=s[3],l=s[4],u=s[5],d=1/(r*h+o*-a);return i.x=h*d*t+-o*d*e+(u*o-l*h)*d,i.y=r*d*e+-a*d*t+(-u*r+l*a)*d,i},setQuad:function(t,e,i,s,r){void 0===r&&(r=this.quad);var n=this.matrix,a=n[0],o=n[1],h=n[2],l=n[3],u=n[4],d=n[5];return r[0]=t*a+e*h+u,r[1]=t*o+e*l+d,r[2]=t*a+s*h+u,r[3]=t*o+s*l+d,r[4]=i*a+s*h+u,r[5]=i*o+s*l+d,r[6]=i*a+e*h+u,r[7]=i*o+e*l+d,r},getX:function(t,e){return t*this.a+e*this.c+this.e},getY:function(t,e){return t*this.b+e*this.d+this.f},getXRound:function(t,e,i){var s=this.getX(t,e);return i&&(s=Math.floor(s+.5)),s},getYRound:function(t,e,i){var s=this.getY(t,e);return i&&(s=Math.floor(s+.5)),s},getCSSMatrix:function(){var t=this.matrix;return"matrix("+t[0]+","+t[1]+","+t[2]+","+t[3]+","+t[4]+","+t[5]+")"},destroy:function(){this.matrix=null,this.quad=null,this.decomposedMatrix=null}});t.exports=a},59715(t,e,i){const s=i(36626);t.exports=s.VisibleDescriptors,Object.defineProperty(t.exports,"Visible",{value:s.Visible})},31401(t,e,i){t.exports={Alpha:i(16005),AlphaSingle:i(88509),BlendMode:i(90065),ComputedSize:i(94215),Crop:i(61683),Depth:i(89272),ElapseTimer:i(3248),FilterList:i(53427),Filters:i(43102),Flip:i(54434),GetBounds:i(8004),Lighting:i(73629),Mask:i(8573),Origin:i(27387),PathFollower:i(37640),RenderNodes:i(68680),RenderSteps:i(86038),ScrollFactor:i(80227),Size:i(16736),Texture:i(37726),TextureCrop:i(79812),Tint:i(27472),ToJSON:i(53774),Transform:i(16901),TransformMatrix:i(61340),Visible:i(59715)}},31559(t,e,i){var s=i(37105),r=i(10312),n=i(83419),a=i(31401),o=i(51708),h=i(95643),l=i(87841),u=i(29959),d=i(36899),c=i(26099),f=i(93595),p=new a.TransformMatrix,m=new n({Extends:h,Mixins:[a.AlphaSingle,a.BlendMode,a.ComputedSize,a.Depth,a.Mask,a.Transform,a.Visible,u],initialize:function(t,e,i,s){h.call(this,t,"Container"),this.list=[],this.exclusive=!0,this.maxSize=-1,this.position=0,this.localTransform=new a.TransformMatrix,this._sortKey="",this._sysEvents=t.sys.events,this.scrollFactorX=1,this.scrollFactorY=1,this.setPosition(e,i),this.setBlendMode(r.SKIP_CHECK),s&&this.add(s)},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return.5*this.width}},displayOriginY:{get:function(){return.5*this.height}},setExclusive:function(t){return void 0===t&&(t=!0),this.exclusive=t,this},getBounds:function(t){if(void 0===t&&(t=new l),t.setTo(this.x,this.y,0,0),this.parentContainer){var e=this.parentContainer.getBoundsTransformMatrix().transformPoint(this.x,this.y);t.setTo(e.x,e.y,0,0)}if(this.list.length>0){var i=this.list,s=new l,r=!1;t.setEmpty();for(var n=0;n-1},setAll:function(t,e,i,r){return s.SetAll(this.list,t,e,i,r),this},each:function(t,e){var i,s=[null],r=this.list.slice(),n=r.length;for(i=2;i0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.list=[]},onChildDestroyed:function(t){s.Remove(this.list,t),this.exclusive&&(t.parentContainer=null,t.removedFromScene())}});t.exports=m},53584(t){t.exports=function(t,e,i,s){i.addToRenderList(e);var r=e.list;if(0!==r.length){var n=e.localTransform;s?(n.loadIdentity(),n.multiply(s),n.translate(e.x,e.y),n.rotate(e.rotation),n.scale(e.scaleX,e.scaleY)):n.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var a=-1!==e.blendMode;a||t.setBlendMode(0);var o=e._alpha,h=e.scrollFactorX,l=e.scrollFactorY;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var u=0;u=0,d=a>=0,f=o>=0,p=h>=0;return n=Math.abs(n),a=Math.abs(a),o=Math.abs(o),h=Math.abs(h),this.beginPath(),this.moveTo(t+n,e),this.lineTo(t+i-a,e),d?this.arc(t+i-a,e+a,a,-c.PI_OVER_2,0):this.arc(t+i,e,a,Math.PI,c.PI_OVER_2,!0),this.lineTo(t+i,e+s-h),p?this.arc(t+i-h,e+s-h,h,0,c.PI_OVER_2):this.arc(t+i,e+s,h,-c.PI_OVER_2,Math.PI,!0),this.lineTo(t+o,e+s),f?this.arc(t+o,e+s-o,o,c.PI_OVER_2,Math.PI):this.arc(t,e+s,o,0,-c.PI_OVER_2,!0),this.lineTo(t,e+n),l?this.arc(t+n,e+n,n,-Math.PI,-c.PI_OVER_2):this.arc(t,e,n,c.PI_OVER_2,0,!0),this.fillPath(),this},strokeRoundedRect:function(t,e,i,s,r){void 0===r&&(r=20);var n=r,a=r,o=r,h=r,l=Math.min(i,s)/2;"number"!=typeof r&&(n=u(r,"tl",20),a=u(r,"tr",20),o=u(r,"bl",20),h=u(r,"br",20));var d=n>=0,f=a>=0,p=o>=0,m=h>=0;return n=Math.min(Math.abs(n),l),a=Math.min(Math.abs(a),l),o=Math.min(Math.abs(o),l),h=Math.min(Math.abs(h),l),this.beginPath(),this.moveTo(t+n,e),this.lineTo(t+i-a,e),this.moveTo(t+i-a,e),f?this.arc(t+i-a,e+a,a,-c.PI_OVER_2,0):this.arc(t+i,e,a,Math.PI,c.PI_OVER_2,!0),this.lineTo(t+i,e+s-h),this.moveTo(t+i,e+s-h),m?this.arc(t+i-h,e+s-h,h,0,c.PI_OVER_2):this.arc(t+i,e+s,h,-c.PI_OVER_2,Math.PI,!0),this.lineTo(t+o,e+s),this.moveTo(t+o,e+s),p?this.arc(t+o,e+s-o,o,c.PI_OVER_2,Math.PI):this.arc(t,e+s,o,0,-c.PI_OVER_2,!0),this.lineTo(t,e+n),this.moveTo(t,e+n),d?this.arc(t+n,e+n,n,-Math.PI,-c.PI_OVER_2):this.arc(t,e,n,c.PI_OVER_2,0,!0),this.strokePath(),this},fillPointShape:function(t,e){return this.fillPoint(t.x,t.y,e)},fillPoint:function(t,e,i){return!i||i<1?i=1:(t-=i/2,e-=i/2),this.commandBuffer.push(n.FILL_RECT,t,e,i,i),this},fillTriangleShape:function(t){return this.fillTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},strokeTriangleShape:function(t){return this.strokeTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},fillTriangle:function(t,e,i,s,r,a){return this.commandBuffer.push(n.FILL_TRIANGLE,t,e,i,s,r,a),this},strokeTriangle:function(t,e,i,s,r,a){return this.commandBuffer.push(n.STROKE_TRIANGLE,t,e,i,s,r,a),this},strokeLineShape:function(t){return this.lineBetween(t.x1,t.y1,t.x2,t.y2)},lineBetween:function(t,e,i,s){return this.beginPath(),this.moveTo(t,e),this.lineTo(i,s),this.strokePath(),this},lineTo:function(t,e){return this.commandBuffer.push(n.LINE_TO,t,e),this},moveTo:function(t,e){return this.commandBuffer.push(n.MOVE_TO,t,e),this},strokePoints:function(t,e,i,s){void 0===e&&(e=!1),void 0===i&&(i=!1),void 0===s&&(s=t.length),this.beginPath(),this.moveTo(t[0].x,t[0].y);for(var r=1;r-1&&this.fillStyle(this.defaultFillColor,this.defaultFillAlpha),this.defaultStrokeColor>-1&&this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha),this},generateTexture:function(t,e,i){var s,r,n=this.scene.sys,a=n.game.renderer;void 0===e&&(e=n.scale.width),void 0===i&&(i=n.scale.height),p.TargetCamera.setScene(this.scene),p.TargetCamera.setViewport(0,0,e,i),p.TargetCamera.scrollX=this.x,p.TargetCamera.scrollY=this.y;var o={willReadFrequently:!0};if("string"==typeof t)if(n.textures.exists(t)){var h=(s=n.textures.get(t)).getSourceImage();h instanceof HTMLCanvasElement&&(r=h.getContext("2d",o))}else r=(s=n.textures.createCanvas(t,e,i)).getSourceImage().getContext("2d",o);else t instanceof HTMLCanvasElement&&(r=t.getContext("2d",o));return r&&(this.renderCanvas(a,this,p.TargetCamera,null,r,!1),s&&s.refresh()),this},preDestroy:function(){this.commandBuffer=[]}});p.TargetCamera=new s,t.exports=p},32768(t,e,i){var s=i(85592),r=i(20926);t.exports=function(t,e,i,n,a,o){var h=e.commandBuffer,l=h.length,u=a||t.currentContext;if(0!==l&&r(t,u,e,i,n)){i.addToRenderList(e);var d=1,c=1,f=0,p=0,m=1,g=0,v=0,x=0;u.beginPath();for(var y=0;y>>16,v=(65280&f)>>>8,x=255&f,u.strokeStyle="rgba("+g+","+v+","+x+","+d+")",u.lineWidth=m,y+=3;break;case s.FILL_STYLE:p=h[y+1],c=h[y+2],g=(16711680&p)>>>16,v=(65280&p)>>>8,x=255&p,u.fillStyle="rgba("+g+","+v+","+x+","+c+")",y+=2;break;case s.BEGIN_PATH:u.beginPath();break;case s.CLOSE_PATH:u.closePath();break;case s.FILL_PATH:o||u.fill();break;case s.STROKE_PATH:o||u.stroke();break;case s.FILL_RECT:o?u.rect(h[y+1],h[y+2],h[y+3],h[y+4]):u.fillRect(h[y+1],h[y+2],h[y+3],h[y+4]),y+=4;break;case s.FILL_TRIANGLE:u.beginPath(),u.moveTo(h[y+1],h[y+2]),u.lineTo(h[y+3],h[y+4]),u.lineTo(h[y+5],h[y+6]),u.closePath(),o||u.fill(),y+=6;break;case s.STROKE_TRIANGLE:u.beginPath(),u.moveTo(h[y+1],h[y+2]),u.lineTo(h[y+3],h[y+4]),u.lineTo(h[y+5],h[y+6]),u.closePath(),o||u.stroke(),y+=6;break;case s.LINE_TO:u.lineTo(h[y+1],h[y+2]),y+=2;break;case s.MOVE_TO:u.moveTo(h[y+1],h[y+2]),y+=2;break;case s.LINE_FX_TO:u.lineTo(h[y+1],h[y+2]),y+=5;break;case s.MOVE_FX_TO:u.moveTo(h[y+1],h[y+2]),y+=5;break;case s.SAVE:u.save();break;case s.RESTORE:u.restore();break;case s.TRANSLATE:u.translate(h[y+1],h[y+2]),y+=2;break;case s.SCALE:u.scale(h[y+1],h[y+2]),y+=2;break;case s.ROTATE:u.rotate(h[y+1]),y+=1;break;case s.GRADIENT_FILL_STYLE:y+=5;break;case s.GRADIENT_LINE_STYLE:y+=6}}u.restore()}}},87079(t,e,i){var s=i(44603),r=i(43831);s.register("graphics",function(t,e){void 0===t&&(t={}),void 0!==e&&(t.add=e);var i=new r(this.scene,t);return t.add&&this.scene.sys.displayList.add(i),i})},1201(t,e,i){var s=i(43831);i(39429).register("graphics",function(t){return this.displayList.add(new s(this.scene,t))})},84503(t,e,i){var s=i(29747),r=s,n=s;r=i(77545),n=i(32768),n=i(32768),t.exports={renderWebGL:r,renderCanvas:n}},77545(t,e,i){var s=i(85592),r=i(91296),n=i(70554),a=i(61340),o=function(t,e,i){this.x=t,this.y=e,this.width=i},h=function(t,e,i){this.points=[],this.points[0]=new o(t,e,i),this.addPoint=function(t,e,i){var s=this.points[this.points.length-1];s.x===t&&s.y===e||this.points.push(new o(t,e,i))}},l=[],u=new a,d=new a,c={TL:0,TR:0,BL:0,BR:0},f={TL:0,TR:0,BL:0,BR:0},p=[{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0}];t.exports=function(t,e,i,a){if(0!==e.commandBuffer.length){var o=e.customRenderNodes,m=e.defaultRenderNodes,g=o.Submitter||m.Submitter,v=e.lighting,x=i,y=x.camera;y.addToRenderList(e);for(var T=r(e,y,a,!i.useCanvas).calc,w=u.loadIdentity(),S=e.commandBuffer,b=e.alpha,E=Math.max(e.pathDetailThreshold,t.config.pathDetailThreshold,0),C=1,A=0,_=0,M=0,R=2*Math.PI,O=[],P=0,L=!0,F=null,D=n.getTintAppendFloatAlpha,I=0;I0&&(q=q%R-R):q>R?q=R:q<0&&(q=R+q%R),null===F&&(F=new h(G+Math.cos(j)*V,H+Math.sin(j)*V,C),O.push(F),W+=.01);W<1+Z;)M=q*W+j,A=G+Math.cos(M)*V,_=H+Math.sin(M)*V,F.addPoint(A,_,C),W+=.01;M=q+j,A=G+Math.cos(M)*V,_=H+Math.sin(M)*V,F.addPoint(A,_,C);break;case s.FILL_RECT:T.multiply(w,d),(o.FillRect||m.FillRect).run(x,d,g,S[++I],S[++I],S[++I],S[++I],c.TL,c.TR,c.BL,c.BR,v);break;case s.FILL_TRIANGLE:T.multiply(w,d),(o.FillTri||m.FillTri).run(x,d,g,S[++I],S[++I],S[++I],S[++I],S[++I],S[++I],c.TL,c.TR,c.BL,v);break;case s.STROKE_TRIANGLE:T.multiply(w,d),p[0].x=S[++I],p[0].y=S[++I],p[0].width=C,p[1].x=S[++I],p[1].y=S[++I],p[1].width=C,p[2].x=S[++I],p[2].y=S[++I],p[2].width=C,p[3].x=p[0].x,p[3].y=p[0].y,p[3].width=C,(o.StrokePath||m.StrokePath).run(x,g,p,C,!1,d,f.TL,f.TR,f.BL,f.BR,v);break;case s.LINE_TO:G=S[++I],H=S[++I],null!==F?F.addPoint(G,H,C):(F=new h(G,H,C),O.push(F));break;case s.MOVE_TO:F=new h(S[++I],S[++I],C),O.push(F);break;case s.SAVE:l.push(w.copyToArray());break;case s.RESTORE:w.copyFromArray(l.pop());break;case s.TRANSLATE:G=S[++I],H=S[++I],w.translate(G,H);break;case s.SCALE:G=S[++I],H=S[++I],w.scale(G,H);break;case s.ROTATE:w.rotate(S[++I])}}}},26479(t,e,i){var s=i(61061),r=i(83419),n=i(51708),a=i(50792),o=i(46710),h=i(95540),l=i(35154),u=i(97022),d=i(41212),c=i(88492),f=i(68287),p=new r({Extends:a,initialize:function(t,e,i){a.call(this),i?e&&!Array.isArray(e)&&(e=[e]):Array.isArray(e)?d(e[0])&&(i=e,e=null):d(e)&&(i=e,e=null),this.scene=t,this.children=new Set,this.isParent=!0,this.type="Group",this.classType=h(i,"classType",f),this.name=h(i,"name",""),this.active=h(i,"active",!0),this.maxSize=h(i,"maxSize",-1),this.defaultKey=h(i,"defaultKey",null),this.defaultFrame=h(i,"defaultFrame",null),this.runChildUpdate=h(i,"runChildUpdate",!1),this.createCallback=h(i,"createCallback",null),this.removeCallback=h(i,"removeCallback",null),this.createMultipleCallback=h(i,"createMultipleCallback",null),this.internalCreateCallback=h(i,"internalCreateCallback",null),this.internalRemoveCallback=h(i,"internalRemoveCallback",null),e&&this.addMultiple(e),i&&this.createMultiple(i),this.on(n.ADDED_TO_SCENE,this.addedToScene,this),this.on(n.REMOVED_FROM_SCENE,this.removedFromScene,this)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},create:function(t,e,i,s,r,n){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.defaultKey),void 0===s&&(s=this.defaultFrame),void 0===r&&(r=!0),void 0===n&&(n=!0),this.isFull())return null;var a=new this.classType(this.scene,t,e,i,s);return a.addToDisplayList(this.scene.sys.displayList),a.addToUpdateList(),a.visible=r,a.setActive(n),this.add(a),a},createMultiple:function(t){if(this.isFull())return[];Array.isArray(t)||(t=[t]);var e=[];if(t[0].key)for(var i=0;i=0;u--)if((l=c[u]).active===i){if(++d===e)break}else l=null;return l?("number"==typeof r&&(l.x=r),"number"==typeof n&&(l.y=n),l):s?this.create(r,n,a,o,h):null},get:function(t,e,i,s,r){return this.getFirst(!1,!0,t,e,i,s,r)},getFirstAlive:function(t,e,i,s,r,n){return this.getFirst(!0,t,e,i,s,r,n)},getFirstDead:function(t,e,i,s,r,n){return this.getFirst(!1,t,e,i,s,r,n)},playAnimation:function(t,e){return s.PlayAnimation(Array.from(this.children),t,e),this},isFull:function(){return-1!==this.maxSize&&this.children.size>=this.maxSize},countActive:function(t){void 0===t&&(t=!0);var e=0;return this.children.forEach(function(i){i.active===t&&e++}),e},getTotalUsed:function(){return this.countActive()},getTotalFree:function(){var t=this.getTotalUsed();return(-1===this.maxSize?999999999999:this.maxSize)-t},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},propertyValueSet:function(t,e,i,r,n){return s.PropertyValueSet(Array.from(this.children),t,e,i,r,n),this},propertyValueInc:function(t,e,i,r,n){return s.PropertyValueInc(Array.from(this.children),t,e,i,r,n),this},setX:function(t,e){return s.SetX(Array.from(this.children),t,e),this},setY:function(t,e){return s.SetY(Array.from(this.children),t,e),this},setXY:function(t,e,i,r){return s.SetXY(Array.from(this.children),t,e,i,r),this},incX:function(t,e){return s.IncX(Array.from(this.children),t,e),this},incY:function(t,e){return s.IncY(Array.from(this.children),t,e),this},incXY:function(t,e,i,r){return s.IncXY(Array.from(this.children),t,e,i,r),this},shiftPosition:function(t,e,i){return s.ShiftPosition(Array.from(this.children),t,e,i),this},angle:function(t,e){return s.Angle(Array.from(this.children),t,e),this},rotate:function(t,e){return s.Rotate(Array.from(this.children),t,e),this},rotateAround:function(t,e){return s.RotateAround(Array.from(this.children),t,e),this},rotateAroundDistance:function(t,e,i){return s.RotateAroundDistance(Array.from(this.children),t,e,i),this},setAlpha:function(t,e){return s.SetAlpha(Array.from(this.children),t,e),this},setTint:function(t,e,i,r){return s.SetTint(Array.from(this.children),t,e,i,r),this},setOrigin:function(t,e,i,r){return s.SetOrigin(Array.from(this.children),t,e,i,r),this},scaleX:function(t,e){return s.ScaleX(Array.from(this.children),t,e),this},scaleY:function(t,e){return s.ScaleY(Array.from(this.children),t,e),this},scaleXY:function(t,e,i,r){return s.ScaleXY(Array.from(this.children),t,e,i,r),this},setDepth:function(t,e){return s.SetDepth(Array.from(this.children),t,e),this},setBlendMode:function(t){return s.SetBlendMode(Array.from(this.children),t),this},setHitArea:function(t,e){return s.SetHitArea(Array.from(this.children),t,e),this},shuffle:function(){return s.Shuffle(Array.from(this.children)),this},kill:function(t){this.children.has(t)&&t.setActive(!1)},killAndHide:function(t){this.children.has(t)&&(t.setActive(!1),t.setVisible(!1))},setVisible:function(t,e,i){return s.SetVisible(Array.from(this.children),t,e,i),this},toggleVisible:function(){return s.ToggleVisible(Array.from(this.children)),this},destroy:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1),this.scene&&!this.ignoreDestroy&&(this.emit(n.DESTROY,this),this.removeAllListeners(),this.scene.sys.updateList.remove(this),this.clear(e,t),this.scene=void 0,this.children=void 0)}});t.exports=p},94975(t,e,i){var s=i(44603),r=i(26479);s.register("group",function(t){return new r(this.scene,null,t)})},3385(t,e,i){var s=i(26479);i(39429).register("group",function(t,e){return this.updateList.add(new s(this.scene,t,e))})},88571(t,e,i){var s=i(40939),r=i(83419),n=i(31401),a=i(95643),o=i(59819),h=new r({Extends:a,Mixins:[n.Alpha,n.BlendMode,n.Depth,n.Flip,n.GetBounds,n.Lighting,n.Mask,n.Origin,n.RenderNodes,n.ScrollFactor,n.Size,n.TextureCrop,n.Tint,n.Transform,n.Visible,o],initialize:function(t,e,i,s,r){a.call(this,t,"Image"),this._crop=this.resetCropObject(),this.setTexture(s,r),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initRenderNodes(this._defaultRenderNodesMap)},_defaultRenderNodesMap:{get:function(){return s}}});t.exports=h},40652(t){t.exports=function(t,e,i,s){i.addToRenderList(e),t.batchSprite(e,e.frame,i,s)}},82459(t,e,i){var s=i(25305),r=i(44603),n=i(23568),a=i(88571);r.register("image",function(t,e){void 0===t&&(t={});var i=n(t,"key",null),r=n(t,"frame",null),o=new a(this.scene,0,0,i,r);return void 0!==e&&(t.add=e),s(this.scene,o,t),o})},2117(t,e,i){var s=i(88571);i(39429).register("image",function(t,e,i,r){return this.displayList.add(new s(this.scene,t,e,i,r))})},59819(t,e,i){var s=i(29747),r=s,n=s;r=i(99517),n=i(40652),t.exports={renderWebGL:r,renderCanvas:n}},99517(t){t.exports=function(t,e,i,s){i.camera.addToRenderList(e);var r=e.customRenderNodes,n=e.defaultRenderNodes;(r.Submitter||n.Submitter).run(i,e,s,0,r.Texturer||n.Texturer,r.Transformer||n.Transformer)}},77856(t,e,i){var s={Events:i(51708),DisplayList:i(8050),GameObjectCreator:i(44603),GameObjectFactory:i(39429),UpdateList:i(45027),Components:i(31401),GetCalcMatrix:i(91296),BuildGameObject:i(25305),BuildGameObjectAnimation:i(13059),GameObject:i(95643),BitmapText:i(22186),Blitter:i(6107),Bob:i(46590),Container:i(31559),DOMElement:i(3069),DynamicBitmapText:i(2638),Extern:i(42421),Graphics:i(43831),Group:i(26479),Image:i(88571),Layer:i(93595),Particles:i(18404),PathFollower:i(1159),RenderTexture:i(591),RetroFont:i(196),Rope:i(77757),Sprite:i(68287),Stamp:i(14727),Text:i(50171),GetTextSize:i(14220),MeasureText:i(79557),TextStyle:i(35762),TileSprite:i(20839),Zone:i(41481),Video:i(18471),Shape:i(17803),Arc:i(23629),Curve:i(89),Ellipse:i(19921),Grid:i(30479),IsoBox:i(61475),IsoTriangle:i(16933),Line:i(57847),Polygon:i(24949),Rectangle:i(74561),Star:i(55911),Triangle:i(36931),Factories:{Blitter:i(12709),Container:i(24961),DOMElement:i(2611),DynamicBitmapText:i(72566),Extern:i(56315),Graphics:i(1201),Group:i(3385),Image:i(2117),Layer:i(20005),Particles:i(676),PathFollower:i(90145),RenderTexture:i(60505),Rope:i(96819),Sprite:i(46409),Stamp:i(85326),StaticBitmapText:i(34914),Text:i(68005),TileSprite:i(91681),Zone:i(84175),Video:i(89025),Arc:i(42563),Curve:i(40511),Ellipse:i(1543),Grid:i(34137),IsoBox:i(3933),IsoTriangle:i(49803),Line:i(2481),Polygon:i(64827),Rectangle:i(87959),Star:i(93697),Triangle:i(45245)},Creators:{Blitter:i(9403),Container:i(77143),DynamicBitmapText:i(11164),Graphics:i(87079),Group:i(94975),Image:i(82459),Layer:i(25179),Particles:i(92730),RenderTexture:i(34495),Rope:i(26209),Sprite:i(15567),Stamp:i(31479),StaticBitmapText:i(57336),Text:i(71259),TileSprite:i(14167),Zone:i(95261),Video:i(11511)}};s.CaptureFrame=i(43451),s.Gradient=i(34637),s.Noise=i(35387),s.NoiseCell2D=i(51513),s.NoiseCell3D=i(15686),s.NoiseCell4D=i(41946),s.NoiseSimplex2D=i(1792),s.NoiseSimplex3D=i(51098),s.Shader=i(20071),s.NineSlice=i(28103),s.PointLight=i(80321),s.SpriteGPULayer=i(76573),s.Factories.CaptureFrame=i(20421),s.Factories.Gradient=i(69315),s.Factories.Noise=i(34757),s.Factories.NoiseCell2D=i(26590),s.Factories.NoiseCell3D=i(89918),s.Factories.NoiseCell4D=i(65874),s.Factories.NoiseSimplex2D=i(80308),s.Factories.NoiseSimplex3D=i(73810),s.Factories.Shader=i(74177),s.Factories.NineSlice=i(47521),s.Factories.PointLight=i(71255),s.Factories.SpriteGPULayer=i(96019),s.Creators.CaptureFrame=i(23675),s.Creators.Gradient=i(26353),s.Creators.Noise=i(39931),s.Creators.NoiseCell2D=i(98292),s.Creators.NoiseCell3D=i(97044),s.Creators.NoiseCell4D=i(20136),s.Creators.NoiseSimplex2D=i(51754),s.Creators.NoiseSimplex3D=i(71112),s.Creators.Shader=i(54935),s.Creators.NineSlice=i(28279),s.Creators.PointLight=i(39829),s.Creators.SpriteGPULayer=i(16193),s.Light=i(41432),s.LightsManager=i(61356),s.LightsPlugin=i(88992),t.exports=s},93595(t,e,i){var s=i(10312),r=i(83419),n=i(31401),a=i(50792),o=i(95643),h=i(51708),l=i(73162),u=i(33963),d=i(44594),c=i(19186),f=new r({Extends:l,Mixins:[a,o,n.AlphaSingle,n.BlendMode,n.Depth,n.Mask,n.Visible,u],initialize:function(t,e){l.call(this,t),a.call(this),o.call(this,t,"Layer"),this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.sortChildrenFlag=!1,this.addCallback=this.addChildCallback,this.removeCallback=this.removeChildCallback,this.clearAlpha(),this.setBlendMode(s.SKIP_CHECK),e&&this.add(e),this.addRenderStep&&this.addRenderStep(this.renderWebGL),t.sys.queueDepthSort()},setInteractive:function(){return this},disableInteractive:function(){return this},removeInteractive:function(){return this},willRender:function(t){return!(15!==this.renderFlags||0===this.list.length||0!==this.cameraFilter&&this.cameraFilter&t.id)},addChildCallback:function(t){var e=t.displayList;e&&e!==this&&t.removeFromDisplayList(),t.displayList||(this.queueDepthSort(),t.displayList=this,t.emit(h.ADDED_TO_SCENE,t,this.scene),this.events.emit(d.ADDED_TO_SCENE,t,this.scene))},removeChildCallback:function(t){this.queueDepthSort(),t.displayList=null,t.emit(h.REMOVED_FROM_SCENE,t,this.scene),this.events.emit(d.REMOVED_FROM_SCENE,t,this.scene)},queueDepthSort:function(){this.sortChildrenFlag=!0},depthSort:function(){this.sortChildrenFlag&&(c(this.list,this.sortByDepth),this.sortChildrenFlag=!1)},sortByDepth:function(t,e){return t._depth-e._depth},getChildren:function(){return this.list},destroy:function(t){if(this.scene&&!this.ignoreDestroy){o.prototype.destroy.call(this,t);for(var e=this.list;e.length;)e[0].destroy(t);this.list=void 0,this.systems=void 0,this.events=void 0}}});t.exports=f},2956(t){t.exports=function(t,e,i){var s=e.list;if(0!==s.length){e.depthSort();var r=-1!==e.blendMode;r||t.setBlendMode(0);var n=e._alpha;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var a=0;athis.maxLights&&(u(r,this.sortByDistance),r=r.slice(0,this.maxLights)),this.visibleLights=r.length,r},sortByDistance:function(t,e){return t.distance>=e.distance},setAmbientColor:function(t){var e=d.getFloatsFromUintRGB(t);return this.ambientColor.set(e[0],e[1],e[2]),this},getMaxVisibleLights:function(){return this.maxLights},getLightCount:function(){return this.lights.length},addLight:function(t,e,i,s,r,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=128),void 0===s&&(s=16777215),void 0===r&&(r=1),void 0===n&&(n=.1*i);var o=d.getFloatsFromUintRGB(s),h=new a(t,e,i,o[0],o[1],o[2],r,n);return this.lights.push(h),h},removeLight:function(t){var e=this.lights.indexOf(t);return e>=0&&l(this.lights,e),this},shutdown:function(){this.lights.length=0},destroy:function(){this.shutdown()}});t.exports=c},88992(t,e,i){var s=i(83419),r=i(61356),n=i(37277),a=i(44594),o=new s({Extends:r,initialize:function(t){this.scene=t,this.systems=t.sys,t.sys.settings.isBooted||t.sys.events.once(a.BOOT,this.boot,this),r.call(this)},boot:function(){var t=this.systems.events;t.on(a.SHUTDOWN,this.shutdown,this),t.on(a.DESTROY,this.destroy,this)},destroy:function(){this.shutdown(),this.scene=void 0,this.systems=void 0}});n.register("LightsPlugin",o,"lights"),t.exports=o},28103(t,e,i){var s=i(30529),r=i(83419),n=i(31401),a=i(95643),o=i(78023),h=i(84322),l=i(82513),u=new r({Extends:a,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.GetBounds,n.Mask,n.Origin,n.RenderNodes,n.ScrollFactor,n.Texture,n.Transform,n.Visible,o],initialize:function(t,e,i,s,r,n,o,u,d,c,f,p,m){a.call(this,t,"NineSlice"),this._width,this._height,this._originX=.5,this._originY=.5,this._sizeComponent=!0,this.vertices=[],this.leftWidth,this.rightWidth,this.topHeight,this.bottomHeight,this.tileX=p||!1,this.tileY=m||!1,this._repeatCountX=1,this._repeatCountY=1,this.tint=16777215,this.tintMode=h.MULTIPLY;var g=t.textures.getFrame(s,r);this.is3Slice=!c&&!f,g&&g.scale9&&(this.is3Slice=g.is3Slice);for(var v=this.is3Slice?18:54,x=0;x0?Math.max(1,Math.floor(t/e)):1},_rebuildVertexArray:function(t,e){if(t===this._repeatCountX&&e===this._repeatCountY)return!1;this._repeatCountX=t,this._repeatCountY=e;var i=(t+2)*(this.is3Slice?1:e+2)*6,s=this.vertices;if(s.length!==i){s.length=0;for(var r=0;r=0&&(e=t);break;case 4:var i=(this.end-this.start)/this.steps;e=u(t,i),this.counter=e;break;case 5:case 6:case 7:e=r(t,this.start,this.end);break;case 9:e=this.start[0]}return this.current=e,this},getMethod:function(){var t=this.propertyValue;if(null===t)return 0;var e=typeof t;if("number"===e)return 1;if(Array.isArray(t))return 2;if("function"===e)return 3;if("object"===e){if(this.hasBoth(t,"start","end"))return this.has(t,"steps")?4:5;if(this.hasBoth(t,"min","max"))return 6;if(this.has(t,"random"))return 7;if(this.hasEither(t,"onEmit","onUpdate"))return 8;if(this.hasEither(t,"values","interpolation"))return 9}return 0},setMethods:function(){var t=this.propertyValue,e=t,i=this.defaultEmit,s=this.defaultUpdate;switch(this.method){case 1:i=this.staticValueEmit;break;case 2:i=this.randomStaticValueEmit,e=t[0];break;case 3:this._onEmit=t,i=this.proxyEmit,e=this.defaultValue;break;case 4:this.start=t.start,this.end=t.end,this.steps=t.steps,this.counter=this.start,this.yoyo=!!this.has(t,"yoyo")&&t.yoyo,this.direction=0,i=this.steppedEmit,e=this.start;break;case 5:this.start=t.start,this.end=t.end;var r=this.has(t,"ease")?t.ease:"Linear";this.ease=o(r,t.easeParams),i=this.has(t,"random")&&t.random?this.randomRangedValueEmit:this.easedValueEmit,s=this.easeValueUpdate,e=this.start;break;case 6:this.start=t.min,this.end=t.max,i=this.has(t,"int")&&t.int?this.randomRangedIntEmit:this.randomRangedValueEmit,e=this.start;break;case 7:var n=t.random;Array.isArray(n)&&(this.start=n[0],this.end=n[1]),i=this.randomRangedIntEmit,e=this.start;break;case 8:this._onEmit=this.has(t,"onEmit")?t.onEmit:this.defaultEmit,this._onUpdate=this.has(t,"onUpdate")?t.onUpdate:this.defaultUpdate,i=this.proxyEmit,s=this.proxyUpdate,e=this.defaultValue;break;case 9:this.start=t.values;var a=this.has(t,"ease")?t.ease:"Linear";this.ease=o(a,t.easeParams),this.interpolation=l(t.interpolation),i=this.easedValueEmit,s=this.easeValueUpdate,e=this.start[0]}return this.onEmit=i,this.onUpdate=s,this.current=e,this},has:function(t,e){return t.hasOwnProperty(e)},hasBoth:function(t,e,i){return t.hasOwnProperty(e)&&t.hasOwnProperty(i)},hasEither:function(t,e,i){return t.hasOwnProperty(e)||t.hasOwnProperty(i)},defaultEmit:function(){return this.defaultValue},defaultUpdate:function(t,e,i,s){return s},proxyEmit:function(t,e,i){var s=this._onEmit(t,e,i);return this.current=s,s},proxyUpdate:function(t,e,i,s){var r=this._onUpdate(t,e,i,s);return this.current=r,r},staticValueEmit:function(){return this.current},staticValueUpdate:function(){return this.current},randomStaticValueEmit:function(){var t=Math.floor(Math.random()*this.propertyValue.length);return this.current=this.propertyValue[t],this.current},randomRangedValueEmit:function(t,e){var i=a(this.start,this.end);return t&&t.data[e]&&(t.data[e].min=i,t.data[e].max=this.end),this.current=i,i},randomRangedIntEmit:function(t,e){var i=s(this.start,this.end);return t&&t.data[e]&&(t.data[e].min=i,t.data[e].max=this.end),this.current=i,i},steppedEmit:function(){var t,e=this.counter,i=e,s=(this.end-this.start)/this.steps;this.yoyo?(0===this.direction?(i+=s)>=this.end&&(t=i-this.end,i=this.end-t,this.direction=1):(i-=s)<=this.start&&(t=this.start-i,i=this.start+t,this.direction=0),this.counter=i):this.counter=d(i+s,this.start,this.end);return this.current=e,e},easedValueEmit:function(t,e){if(t&&t.data[e]){var i=t.data[e];i.min=this.start,i.max=this.end}return this.current=this.start,this.start},easeValueUpdate:function(t,e,i){var s,r=t.data[e],n=this.ease(i);return s=this.interpolation?this.interpolation(this.start,n):(r.max-r.min)*n+r.min,this.current=s,s},destroy:function(){this.propertyValue=null,this.defaultValue=null,this.ease=null,this.interpolation=null,this._onEmit=null,this._onUpdate=null}});t.exports=c},24502(t,e,i){var s=i(83419),r=i(95540),n=i(20286),a=new s({Extends:n,initialize:function(t,e,i,s,a){if("object"==typeof t){var o=t;t=r(o,"x",0),e=r(o,"y",0),i=r(o,"power",0),s=r(o,"epsilon",100),a=r(o,"gravity",50)}else void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=100),void 0===a&&(a=50);n.call(this,t,e,!0),this._gravity=a,this._power=i*a,this._epsilon=s*s},update:function(t,e){var i=this.x-t.x,s=this.y-t.y,r=i*i+s*s;if(0!==r){var n=Math.sqrt(r);r0&&(this.anims=new s(this)),this.bounds=new o},emit:function(t,e,i,s,r,n){return this.emitter.emit(t,e,i,s,r,n)},isAlive:function(){return this.lifeCurrent>0},kill:function(){this.lifeCurrent=0},setPosition:function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=t,this.y=e},fire:function(t,e){var i=this.emitter,s=i.ops,r=i.getAnim();if(r?this.anims.play(r):(this.frame=i.getFrame(),this.texture=this.frame.texture),!this.frame)throw new Error("Particle has no texture frame");if(i.getEmitZone(this),void 0===t?this.x+=s.x.onEmit(this,"x"):s.x.steps>0?this.x+=t+s.x.onEmit(this,"x"):this.x+=t,void 0===e?this.y+=s.y.onEmit(this,"y"):s.y.steps>0?this.y+=e+s.y.onEmit(this,"y"):this.y+=e,this.life=s.lifespan.onEmit(this,"lifespan"),this.lifeCurrent=this.life,this.lifeT=0,this.delayCurrent=s.delay.onEmit(this,"delay"),this.holdCurrent=s.hold.onEmit(this,"hold"),this.scaleX=s.scaleX.onEmit(this,"scaleX"),this.scaleY=s.scaleY.active?s.scaleY.onEmit(this,"scaleY"):this.scaleX,this.angle=s.rotate.onEmit(this,"rotate"),this.rotation=a(this.angle),i.worldMatrix.transformPoint(this.x,this.y,this.worldPosition),0===this.delayCurrent&&i.getDeathZone(this))return this.lifeCurrent=0,!1;var n=s.speedX.onEmit(this,"speedX"),o=s.speedY.active?s.speedY.onEmit(this,"speedY"):n;if(i.radial){var h=a(s.angle.onEmit(this,"angle"));this.velocityX=Math.cos(h)*Math.abs(n),this.velocityY=Math.sin(h)*Math.abs(o)}else if(i.moveTo){var l=s.moveToX.onEmit(this,"moveToX"),u=s.moveToY.onEmit(this,"moveToY"),d=this.life/1e3;this.velocityX=(l-this.x)/d,this.velocityY=(u-this.y)/d}else this.velocityX=n,this.velocityY=o;return i.acceleration&&(this.accelerationX=s.accelerationX.onEmit(this,"accelerationX"),this.accelerationY=s.accelerationY.onEmit(this,"accelerationY")),this.maxVelocityX=s.maxVelocityX.onEmit(this,"maxVelocityX"),this.maxVelocityY=s.maxVelocityY.onEmit(this,"maxVelocityY"),this.bounce=s.bounce.onEmit(this,"bounce"),this.alpha=s.alpha.onEmit(this,"alpha"),s.color.active?this.tint=s.color.onEmit(this,"tint"):this.tint=s.tint.onEmit(this,"tint"),!0},update:function(t,e,i){if(this.lifeCurrent<=0)return!(this.holdCurrent>0)||(this.holdCurrent-=t,this.holdCurrent<=0);if(this.delayCurrent>0)return this.delayCurrent-=t,!1;this.anims&&this.anims.update(0,t);var s=this.emitter,n=s.ops,o=1-this.lifeCurrent/this.life;if(this.lifeT=o,this.x=n.x.onUpdate(this,"x",o,this.x),this.y=n.y.onUpdate(this,"y",o,this.y),s.moveTo){var h=n.moveToX.onUpdate(this,"moveToX",o,s.moveToX),l=n.moveToY.onUpdate(this,"moveToY",o,s.moveToY),u=this.lifeCurrent/1e3;this.velocityX=(h-this.x)/u,this.velocityY=(l-this.y)/u}return this.computeVelocity(s,t,e,i,o),this.scaleX=n.scaleX.onUpdate(this,"scaleX",o,this.scaleX),n.scaleY.active?this.scaleY=n.scaleY.onUpdate(this,"scaleY",o,this.scaleY):this.scaleY=this.scaleX,this.angle=n.rotate.onUpdate(this,"rotate",o,this.angle),this.rotation=a(this.angle),s.getDeathZone(this)?(this.lifeCurrent=0,!0):(this.alpha=r(n.alpha.onUpdate(this,"alpha",o,this.alpha),0,1),n.color.active?this.tint=n.color.onUpdate(this,"color",o,this.tint):this.tint=n.tint.onUpdate(this,"tint",o,this.tint),this.lifeCurrent-=t,this.lifeCurrent<=0&&this.holdCurrent<=0)},computeVelocity:function(t,e,i,s,n){var a=t.ops,o=this.velocityX,h=this.velocityY,l=a.accelerationX.onUpdate(this,"accelerationX",n,this.accelerationX),u=a.accelerationY.onUpdate(this,"accelerationY",n,this.accelerationY),d=a.maxVelocityX.onUpdate(this,"maxVelocityX",n,this.maxVelocityX),c=a.maxVelocityY.onUpdate(this,"maxVelocityY",n,this.maxVelocityY);this.bounce=a.bounce.onUpdate(this,"bounce",n,this.bounce),o+=t.gravityX*i+l*i,h+=t.gravityY*i+u*i,o=r(o,-d,d),h=r(h,-c,c),this.velocityX=o,this.velocityY=h,this.x+=o*i,this.y+=h*i,t.worldMatrix.transformPoint(this.x,this.y,this.worldPosition);for(var f=0;fe.right&&this.collideRight&&(t.x-=s.x-e.right,t.velocityX*=i),s.ye.bottom&&this.collideBottom&&(t.y-=s.y-e.bottom,t.velocityY*=i)}});t.exports=a},31600(t,e,i){var s=i(68668),r=i(83419),n=i(31401),a=i(53774),o=i(43459),h=i(26388),l=i(19909),u=i(76472),d=i(44777),c=i(20696),f=i(95643),p=i(95540),m=i(26546),g=i(24502),v=i(69036),x=i(1985),y=i(97022),T=i(86091),w=i(73162),S=i(20074),b=i(269),E=i(56480),C=i(69601),A=i(68875),_=i(87841),M=i(59996),R=i(72905),O=i(90668),P=i(19186),L=i(84322),F=i(61340),D=i(26099),I=i(15994),N=["active","advance","blendMode","colorEase","deathCallback","deathCallbackScope","duration","emitCallback","emitCallbackScope","follow","frequency","gravityX","gravityY","maxAliveParticles","maxParticles","name","emitting","particleBringToTop","particleClass","radial","sortCallback","sortOrderAsc","sortProperty","stopAfter","tintMode","timeScale","trackVisible","visible"],B=["accelerationX","accelerationY","alpha","angle","bounce","color","delay","hold","lifespan","maxVelocityX","maxVelocityY","moveToX","moveToY","quantity","rotate","scaleX","scaleY","speedX","speedY","tint","x","y"],k=new r({Extends:f,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.Lighting,n.Mask,n.RenderNodes,n.ScrollFactor,n.Texture,n.Transform,n.Visible,O],initialize:function(t,e,i,s,r){f.call(this,t,"ParticleEmitter"),this.particleClass=E,this.config=null,this.ops={accelerationX:new d("accelerationX",0),accelerationY:new d("accelerationY",0),alpha:new d("alpha",1),angle:new d("angle",{min:0,max:360},!0),bounce:new d("bounce",0),color:new u("color"),delay:new d("delay",0,!0),hold:new d("hold",0,!0),lifespan:new d("lifespan",1e3,!0),maxVelocityX:new d("maxVelocityX",1e4),maxVelocityY:new d("maxVelocityY",1e4),moveToX:new d("moveToX",0),moveToY:new d("moveToY",0),quantity:new d("quantity",1,!0),rotate:new d("rotate",0),scaleX:new d("scaleX",1),scaleY:new d("scaleY",1),speedX:new d("speedX",0,!0),speedY:new d("speedY",0,!0),tint:new d("tint",16777215),x:new d("x",0),y:new d("y",0)},this.radial=!0,this.gravityX=0,this.gravityY=0,this.acceleration=!1,this.moveTo=!1,this.emitCallback=null,this.emitCallbackScope=null,this.deathCallback=null,this.deathCallbackScope=null,this.maxParticles=0,this.maxAliveParticles=0,this.stopAfter=0,this.duration=0,this.frequency=0,this.emitting=!0,this.particleBringToTop=!0,this.timeScale=1,this.emitZones=[],this.deathZones=[],this.viewBounds=null,this.follow=null,this.followOffset=new D,this.trackVisible=!1,this.frames=[],this.randomFrame=!0,this.frameQuantity=1,this.anims=[],this.randomAnim=!0,this.animQuantity=1,this.dead=[],this.alive=[],this.counters=new Float32Array(10),this.skipping=!1,this.worldMatrix=new F,this.sortProperty="",this.sortOrderAsc=!0,this.sortCallback=this.depthSortCallback,this.processors=new w(this),this.tintMode=L.MULTIPLY,this.initRenderNodes(this._defaultRenderNodesMap),this.setPosition(e,i),this.setTexture(s),r&&this.setConfig(r)},_defaultRenderNodesMap:{get:function(){return s}},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},setConfig:function(t){if(!t)return this;this.config=t;var e=0,i="",s=this.ops;for(e=0;e=this.animQuantity&&(this.animCounter=0,this.currentAnim=I(this.currentAnim+1,0,e)),i},setAnim:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=1),this.randomAnim=e,this.animQuantity=i,this.currentAnim=0;var s=typeof t;if(this.anims.length=0,Array.isArray(t))this.anims=this.anims.concat(t);else if("string"===s)this.anims.push(t);else if("object"===s){var r=t;(t=p(r,"anims",null))&&(this.anims=this.anims.concat(t));var n=p(r,"cycle",!1);this.randomAnim=!n,this.animQuantity=p(r,"quantity",i)}return 1===this.anims.length&&(this.animQuantity=1,this.randomAnim=!1),this},setRadial:function(t){return void 0===t&&(t=!0),this.radial=t,this},addParticleBounds:function(t,e,i,s,r,n,a,o){if("object"==typeof t){var h=t;t=h.x,e=h.y,i=y(h,"w")?h.w:h.width,s=y(h,"h")?h.h:h.height}return this.addParticleProcessor(new C(t,e,i,s,r,n,a,o))},setParticleSpeed:function(t,e){return void 0===e&&(e=t),this.ops.speedX.onChange(t),t===e?this.ops.speedY.active=!1:this.ops.speedY.onChange(e),this.radial=!0,this},setParticleScale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.ops.scaleX.onChange(t),this.ops.scaleY.onChange(e),this},setParticleGravity:function(t,e){return this.gravityX=t,this.gravityY=e,this},setParticleAlpha:function(t){return this.ops.alpha.onChange(t),this},setParticleTint:function(t){return this.ops.tint.onChange(t),this},setEmitterAngle:function(t){return this.ops.angle.onChange(t),this},setParticleLifespan:function(t){return this.ops.lifespan.onChange(t),this},setQuantity:function(t){return this.quantity=t,this},setFrequency:function(t,e){return this.frequency=t,this.flowCounter=t>0?t:0,e&&(this.quantity=e),this},addDeathZone:function(t){var e;Array.isArray(t)||(t=[t]);for(var i=[],s=0;s-1&&(this.zoneTotal++,this.zoneTotal===s.total&&(this.zoneTotal=0,this.zoneIndex++,this.zoneIndex===i&&(this.zoneIndex=0)))}},getDeathZone:function(t){for(var e=this.deathZones,i=0;i=0&&(this.zoneIndex=e),this},addParticleProcessor:function(t){return this.processors.exists(t)||(t.emitter&&t.emitter.removeParticleProcessor(t),this.processors.add(t),t.emitter=this),t},removeParticleProcessor:function(t){return this.processors.exists(t)&&(this.processors.remove(t,!0),t.emitter=null),t},getProcessors:function(){return this.processors.getAll("active",!0)},createGravityWell:function(t){return this.addParticleProcessor(new g(t))},reserve:function(t){var e=this.dead;if(this.maxParticles>0){var i=this.getParticleCount();i+t>this.maxParticles&&(t=this.maxParticles-(i+t))}for(var s=0;s0&&this.getParticleCount()>=this.maxParticles||this.maxAliveParticles>0&&this.getAliveParticleCount()>=this.maxAliveParticles},onParticleEmit:function(t,e){return void 0===t?(this.emitCallback=null,this.emitCallbackScope=null):"function"==typeof t&&(this.emitCallback=t,e&&(this.emitCallbackScope=e)),this},onParticleDeath:function(t,e){return void 0===t?(this.deathCallback=null,this.deathCallbackScope=null):"function"==typeof t&&(this.deathCallback=t,e&&(this.deathCallbackScope=e)),this},killAll:function(){for(var t=this.dead,e=this.alive;e.length>0;)t.push(e.pop());return this},forEachAlive:function(t,e){for(var i=this.alive,s=i.length,r=0;r0&&this.fastForward(t),this.emitting=!0,this.resetCounters(this.frequency,!0),void 0!==e&&(this.duration=Math.abs(e)),this.emit(c.START,this)),this},stop:function(t){return void 0===t&&(t=!1),this.emitting&&(this.emitting=!1,t&&this.killAll(),this.emit(c.STOP,this)),this},pause:function(){return this.active=!1,this},resume:function(){return this.active=!0,this},setSortProperty:function(t,e){return void 0===t&&(t=""),void 0===e&&(e=this.true),this.sortProperty=t,this.sortOrderAsc=e,this.sortCallback=this.depthSortCallback,this},setSortCallback:function(t){return t=""!==this.sortProperty?this.depthSortCallback:null,this.sortCallback=t,this},depthSort:function(){return P(this.alive,this.sortCallback.bind(this)),this},depthSortCallback:function(t,e){var i=this.sortProperty;return this.sortOrderAsc?t[i]-e[i]:e[i]-t[i]},flow:function(t,e,i){return void 0===e&&(e=1),this.emitting=!1,this.frequency=t,this.quantity=e,void 0!==i&&(this.stopAfter=i),this.start()},explode:function(t,e,i){this.frequency=-1,this.resetCounters(-1,!0);var s=this.emitParticle(t,e,i);return this.emit(c.EXPLODE,this,s),s},emitParticleAt:function(t,e,i){return this.emitParticle(i,t,e)},emitParticle:function(t,e,i){if(!this.atLimit()){void 0===t&&(t=this.ops.quantity.onEmit());for(var s=this.dead,r=this.stopAfter,n=this.follow?this.follow.x+this.followOffset.x:e,a=this.follow?this.follow.y+this.followOffset.y:i,o=0;o0&&(this.stopCounter++,this.stopCounter>=r))break;if(this.atLimit())break}return h}},fastForward:function(t,e){void 0===e&&(e=1e3/60);var i=0;for(this.skipping=!0;i0){var u=this.deathCallback,d=this.deathCallbackScope;for(a=h-1;a>=0;a--){var f=o[a];r.splice(f.index,1),n.push(f.particle),u&&u.call(d,f.particle),f.particle.setPosition()}}if(this.emitting||this.skipping){if(0===this.frequency)this.emitParticle();else if(this.frequency>0)for(this.flowCounter-=e;this.flowCounter<=0;)this.emitParticle(),this.flowCounter+=this.frequency;this.skipping||(this.duration>0&&(this.elapsed+=e,this.elapsed>=this.duration&&this.stop()),this.stopAfter>0&&this.stopCounter>=this.stopAfter&&this.stop())}else 1===this.completeFlag&&0===r.length&&(this.completeFlag=0,this.emit(c.COMPLETE,this))},overlap:function(t){for(var e=this.getWorldTransformMatrix(),i=this.alive,s=i.length,r=[],n=0;n0){var u=0;for(this.skipping=!0;u0&&T(s,t,t),s},createEmitter:function(){throw new Error("createEmitter removed. See ParticleEmitter docs for info")},particleX:{get:function(){return this.ops.x.current},set:function(t){this.ops.x.onChange(t)}},particleY:{get:function(){return this.ops.y.current},set:function(t){this.ops.y.onChange(t)}},accelerationX:{get:function(){return this.ops.accelerationX.current},set:function(t){this.ops.accelerationX.onChange(t)}},accelerationY:{get:function(){return this.ops.accelerationY.current},set:function(t){this.ops.accelerationY.onChange(t)}},maxVelocityX:{get:function(){return this.ops.maxVelocityX.current},set:function(t){this.ops.maxVelocityX.onChange(t)}},maxVelocityY:{get:function(){return this.ops.maxVelocityY.current},set:function(t){this.ops.maxVelocityY.onChange(t)}},speed:{get:function(){return this.ops.speedX.current},set:function(t){this.ops.speedX.onChange(t),this.ops.speedY.onChange(t)}},speedX:{get:function(){return this.ops.speedX.current},set:function(t){this.ops.speedX.onChange(t)}},speedY:{get:function(){return this.ops.speedY.current},set:function(t){this.ops.speedY.onChange(t)}},moveToX:{get:function(){return this.ops.moveToX.current},set:function(t){this.ops.moveToX.onChange(t)}},moveToY:{get:function(){return this.ops.moveToY.current},set:function(t){this.ops.moveToY.onChange(t)}},bounce:{get:function(){return this.ops.bounce.current},set:function(t){this.ops.bounce.onChange(t)}},particleScaleX:{get:function(){return this.ops.scaleX.current},set:function(t){this.ops.scaleX.onChange(t)}},particleScaleY:{get:function(){return this.ops.scaleY.current},set:function(t){this.ops.scaleY.onChange(t)}},particleColor:{get:function(){return this.ops.color.current},set:function(t){this.ops.color.onChange(t)}},colorEase:{get:function(){return this.ops.color.easeName},set:function(t){this.ops.color.setEase(t)}},particleTint:{get:function(){return this.ops.tint.current},set:function(t){this.ops.tint.onChange(t)}},particleAlpha:{get:function(){return this.ops.alpha.current},set:function(t){this.ops.alpha.onChange(t)}},lifespan:{get:function(){return this.ops.lifespan.current},set:function(t){this.ops.lifespan.onChange(t)}},particleAngle:{get:function(){return this.ops.angle.current},set:function(t){this.ops.angle.onChange(t)}},particleRotate:{get:function(){return this.ops.rotate.current},set:function(t){this.ops.rotate.onChange(t)}},quantity:{get:function(){return this.ops.quantity.current},set:function(t){this.ops.quantity.onChange(t)}},delay:{get:function(){return this.ops.delay.current},set:function(t){this.ops.delay.onChange(t)}},hold:{get:function(){return this.ops.hold.current},set:function(t){this.ops.hold.onChange(t)}},flowCounter:{get:function(){return this.counters[0]},set:function(t){this.counters[0]=t}},frameCounter:{get:function(){return this.counters[1]},set:function(t){this.counters[1]=t}},animCounter:{get:function(){return this.counters[2]},set:function(t){this.counters[2]=t}},elapsed:{get:function(){return this.counters[3]},set:function(t){this.counters[3]=t}},stopCounter:{get:function(){return this.counters[4]},set:function(t){this.counters[4]=t}},completeFlag:{get:function(){return this.counters[5]},set:function(t){this.counters[5]=t}},zoneIndex:{get:function(){return this.counters[6]},set:function(t){this.counters[6]=t}},zoneTotal:{get:function(){return this.counters[7]},set:function(t){this.counters[7]=t}},currentFrame:{get:function(){return this.counters[8]},set:function(t){this.counters[8]=t}},currentAnim:{get:function(){return this.counters[9]},set:function(t){this.counters[9]=t}},preDestroy:function(){var t;this.texture=null,this.frames=null,this.anims=null,this.emitCallback=null,this.emitCallbackScope=null,this.deathCallback=null,this.deathCallbackScope=null,this.emitZones=null,this.deathZones=null,this.bounds=null,this.follow=null,this.counters=null;var e=this.ops;for(t=0;t0&&T.height>0){var w=-y.halfWidth,S=-y.halfHeight;l.globalAlpha=x,l.save(),a.setToContext(l),u&&(w=Math.round(w),S=Math.round(S)),l.imageSmoothingEnabled=!y.source.scaleMode,l.drawImage(y.source.image,T.x,T.y,T.width,T.height,w,S,T.width,T.height),l.restore()}}}l.restore()}}},92730(t,e,i){var s=i(25305),r=i(44603),n=i(23568),a=i(95540),o=i(31600);r.register("particles",function(t,e){void 0===t&&(t={});var i=n(t,"key",null),r=a(t,"config",null),h=new o(this.scene,0,0,i);return void 0!==e&&(t.add=e),s(this.scene,h,t),r&&h.setConfig(r),h})},676(t,e,i){var s=i(39429),r=i(31600);s.register("particles",function(t,e,i,s){return void 0!==t&&"string"==typeof t&&console.warn("ParticleEmitterManager was removed in Phaser 3.60. See documentation for details"),this.displayList.add(new r(this.scene,t,e,i,s))})},90668(t,e,i){var s=i(29747),r=s,n=s;r=i(21188),n=i(9871),t.exports={renderWebGL:r,renderCanvas:n}},21188(t,e,i){var s=i(59996),r=i(61340),n=i(70554),a=new r,o=new r,h=new r,l=new r,u={},d={},c={quad:new Float32Array(8)};t.exports=function(t,e,i,r){var f=i.camera;f.addToRenderList(e),a.copyWithScrollFactorFrom(f.getViewMatrix(!i.useCanvas),f.scrollX,f.scrollY,e.scrollFactorX,e.scrollFactorY),r&&a.multiply(r),l.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),a.multiply(l);var p=n.getTintAppendFloatAlpha,m=e.alpha,g=e.alive,v=g.length,x=e.viewBounds;if(0!==v&&(!x||s(x,f.worldView))){e.sortCallback&&e.depthSort();for(var y=e.tintMode,T=0;Tthis._length&&(this.counter=this._length-1),this},changeSource:function(t){return this.source=t,this.updateSource()},getPoint:function(t){0===this._direction?(this.counter++,this.counter>=this._length&&(this.yoyo?(this._direction=1,this.counter=this._length-1):this.counter=0)):(this.counter--,-1===this.counter&&(this.yoyo?(this._direction=0,this.counter=0):this.counter=this._length-1));var e=this.points[this.counter];e&&(t.x=e.x,t.y=e.y)}});t.exports=s},68875(t,e,i){var s=i(83419),r=i(26099),n=new s({initialize:function(t){this.source=t,this._tempVec=new r,this.total=-1},getPoint:function(t){var e=this._tempVec;this.source.getRandomPoint(e),t.x=e.x,t.y=e.y}});t.exports=n},21024(t,e,i){t.exports={DeathZone:i(26388),EdgeZone:i(19909),RandomZone:i(68875)}},1159(t,e,i){var s=i(83419),r=i(31401),n=i(68287),a=new s({Extends:n,Mixins:[r.PathFollower],initialize:function(t,e,i,s,r,a){n.call(this,t,i,s,r,a),this.path=e},preUpdate:function(t,e){this.anims.update(t,e),this.pathUpdate(t)}});t.exports=a},90145(t,e,i){var s=i(39429),r=i(1159);s.register("follower",function(t,e,i,s,n){var a=new r(this.scene,t,e,i,s,n);return this.displayList.add(a),this.updateList.add(a),a})},80321(t,e,i){var s=i(43246),r=i(83419),n=i(31401),a=i(95643),o=i(30100),h=i(67277),l=new r({Extends:a,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.Mask,n.RenderNodes,n.ScrollFactor,n.Transform,n.Visible,h],initialize:function(t,e,i,s,r,n,h){void 0===s&&(s=16777215),void 0===r&&(r=128),void 0===n&&(n=1),void 0===h&&(h=.1),a.call(this,t,"PointLight"),this.initRenderNodes(this._defaultRenderNodesMap),this.setPosition(e,i),this.color=o(s),this.intensity=n,this.attenuation=h,this.width=2*r,this.height=2*r,this._radius=r},_defaultRenderNodesMap:{get:function(){return s}},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this.width=2*t,this.height=2*t}},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return this._radius}},displayOriginY:{get:function(){return this._radius}}});t.exports=l},39829(t,e,i){var s=i(25305),r=i(44603),n=i(23568),a=i(80321);r.register("pointlight",function(t,e){void 0===t&&(t={});var i=n(t,"color",16777215),r=n(t,"radius",128),o=n(t,"intensity",1),h=n(t,"attenuation",.1),l=new a(this.scene,0,0,i,r,o,h);return void 0!==e&&(t.add=e),s(this.scene,l,t),l})},71255(t,e,i){var s=i(39429),r=i(80321);s.register("pointlight",function(t,e,i,s,n,a){return this.displayList.add(new r(this.scene,t,e,i,s,n,a))})},67277(t,e,i){var s=i(29747),r=s,n=s;r=i(57787),t.exports={renderWebGL:r,renderCanvas:n}},57787(t,e,i){var s=i(91296);t.exports=function(t,e,i,r){var n=i.camera;n.addToRenderList(e);var a=s(e,n,r,!i.useCanvas).calc,o=e.width,h=e.height,l=-e._radius,u=-e._radius,d=l+o,c=u+h,f=a.getX(0,0),p=a.getY(0,0),m=a.getX(l,u),g=a.getY(l,u),v=a.getX(l,c),x=a.getY(l,c),y=a.getX(d,c),T=a.getY(d,c),w=a.getX(d,u),S=a.getY(d,u);(e.customRenderNodes.BatchHandler||e.defaultRenderNodes.BatchHandler).batch(i,e,m,g,v,x,w,S,y,T,f,p)}},591(t,e,i){var s=i(83419),r=i(45650),n=i(88571),a=i(83999),o=i(58855),h=new s({Extends:n,Mixins:[a],initialize:function(t,e,i,s,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=32),void 0===a&&(a=32),void 0===h&&(h=!0);var l=t.sys.textures.addDynamicTexture(r(),s,a,h);n.call(this,t,e,i,l),this.type="RenderTexture",this.camera=this.texture.camera,this._saved=!1,this.renderMode=o.RENDER,this.isCurrentlyRendering=!1},setSize:function(t,e){this.width=t,this.height=e,this.updateDisplayOrigin();var i=this.input;return i&&!i.customHitArea&&(i.hitArea.width=t,i.hitArea.height=e),this},resize:function(t,e,i){return this.texture.setSize(t,e,i),this.setSize(this.texture.width,this.texture.height),this},saveTexture:function(t){var e=this.texture,i=e.key,s=e.manager;return s.exists(i)&&s.get(i)===e?(s.renameTexture(i,t),this._saved=!0):(e.key=t,e.manager.addDynamicTexture(e)&&(this._saved=!0)),e},setRenderMode:function(t,e){return this.renderMode=t,e&&this.texture.preserve(!0),this},render:function(){return this.texture.render(),this},fill:function(t,e,i,s,r,n){return this.texture.fill(t,e,i,s,r,n),this},clear:function(t,e,i,s){return this.texture.clear(t,e,i,s),this},stamp:function(t,e,i,s,r){return this.texture.stamp(t,e,i,s,r),this},erase:function(t,e,i){return this.texture.erase(t,e,i),this},draw:function(t,e,i,s,r){return this.texture.draw(t,e,i,s,r),this},capture:function(t,e){return this.texture.capture(t,e),this},repeat:function(t,e,i,s,r,n,a){return this.texture.repeat(t,e,i,s,r,n,a),this},preserve:function(t){return this.texture.preserve(t),this},callback:function(t){return this.texture.callback(t),this},snapshotArea:function(t,e,i,s,r,n,a){return this.texture.snapshotArea(t,e,i,s,r,n,a),this},snapshot:function(t,e,i){return this.texture.snapshot(t,e,i)},snapshotPixel:function(t,e,i){return this.texture.snapshotPixel(t,e,i)},preDestroy:function(){this.camera=null,this._saved||this.texture.destroy()}});t.exports=h},97272(t,e,i){var s=i(40652),r=i(58855);t.exports=function(t,e,i,n){var a=!0,o=!0;e.renderMode===r.REDRAW?o=!1:e.renderMode===r.RENDER&&(a=!1),a&&e.render(),o&&s(t,e,i,n)}},34495(t,e,i){var s=i(25305),r=i(44603),n=i(23568),a=i(591);r.register("renderTexture",function(t,e){void 0===t&&(t={});var i=n(t,"x",0),r=n(t,"y",0),o=n(t,"width",32),h=n(t,"height",32),l=new a(this.scene,i,r,o,h);return void 0!==e&&(t.add=e),s(this.scene,l,t),l})},60505(t,e,i){var s=i(39429),r=i(591);s.register("renderTexture",function(t,e,i,s){return this.displayList.add(new r(this.scene,t,e,i,s))})},83999(t,e,i){var s=i(29747),r=s,n=s;r=i(53937),n=i(97272),t.exports={renderWebGL:r,renderCanvas:n}},58855(t){t.exports={RENDER:"render",REDRAW:"redraw",ALL:"all"}},53937(t,e,i){var s=i(99517),r=i(58855);t.exports=function(t,e,i,n){if(!e.isCurrentlyRendering){e.isCurrentlyRendering=!0;var a=!0,o=!0;e.renderMode===r.REDRAW?o=!1:e.renderMode===r.RENDER&&(a=!1),a&&e.render(),o&&s(t,e,i,n),e.isCurrentlyRendering=!1}}},77757(t,e,i){var s=i(9674),r=i(85760),n=i(83419),a=i(31401),o=i(95643),h=i(38745),l=i(84322),u=i(26099),d=new n({Extends:o,Mixins:[a.AlphaSingle,a.BlendMode,a.Depth,a.Flip,a.Mask,a.RenderNodes,a.Size,a.Texture,a.Transform,a.Visible,a.ScrollFactor,h],initialize:function(t,e,i,r,n,a,h,d,c){void 0===r&&(r="__DEFAULT"),void 0===a&&(a=2),void 0===h&&(h=!0),o.call(this,t,"Rope"),this.anims=new s(this),this.points=a,this.vertices,this.uv,this.colors,this.alphas,this.tintMode="__DEFAULT"===r?l.FILL:l.MULTIPLY,this.dirty=!1,this.horizontal=h,this._flipX=!1,this._flipY=!1,this._perp=new u,this.debugCallback=null,this.debugGraphic=null,this.setTexture(r,n),this.setPosition(e,i),this.setSizeToFrame(),this.initRenderNodes(this._defaultRenderNodesMap),Array.isArray(a)&&this.resizeArrays(a.length),this.setPoints(a,d,c),this.updateVertices()},_defaultRenderNodesMap:{get:function(){return r}},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(t,e){var i=this.anims.currentFrame;this.anims.update(t,e),this.anims.currentFrame!==i&&(this.updateUVs(),this.updateVertices())},play:function(t,e,i){return this.anims.play(t,e,i),this},setDirty:function(){return this.dirty=!0,this},setHorizontal:function(t,e,i){return void 0===t&&(t=this.points.length),this.horizontal?this:(this.horizontal=!0,this.setPoints(t,e,i))},setVertical:function(t,e,i){return void 0===t&&(t=this.points.length),this.horizontal?(this.horizontal=!1,this.setPoints(t,e,i)):this},setTintMode:function(t){return void 0===t&&(t=l.MULTIPLY),this.tintMode=t,this},setAlphas:function(t,e){var i=this.points.length;if(i<1)return this;var s,r=this.alphas;void 0===t?t=[1]:Array.isArray(t)||void 0!==e||(t=[t]);var n=0;if(void 0!==e)for(s=0;sn&&(a=t[n]),r[n]=a,t.length>n+1&&(a=t[n+1]),r[n+1]=a}return this},setColors:function(t){var e=this.points.length;if(e<1)return this;var i,s=this.colors;void 0===t?t=[16777215]:Array.isArray(t)||(t=[t]);var r=0;if(t.length===e)for(i=0;ir&&(n=t[r]),s[r]=n,t.length>r+1&&(n=t[r+1]),s[r+1]=n}return this},setPoints:function(t,e,i){if(void 0===t&&(t=2),"number"==typeof t){var s,r,n,a=t;if(a<2&&(a=2),t=[],this.horizontal)for(n=-this.frame.halfWidth,r=this.frame.width/(a-1),s=0;s>>16,o=(65280&r)>>>8,h=255&r;t.fillStyle="rgba("+a+","+o+","+h+","+n+")"}},75177(t){t.exports=function(t,e,i,s){var r=i||e.strokeColor,n=s||e.strokeAlpha,a=(16711680&r)>>>16,o=(65280&r)>>>8,h=255&r;t.strokeStyle="rgba("+a+","+o+","+h+","+n+")",t.lineWidth=e.lineWidth}},17803(t,e,i){var s=i(87891),r=i(83419),n=i(31401),a=i(95643),o=i(23031),h=new r({Extends:a,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.GetBounds,n.Lighting,n.Mask,n.Origin,n.RenderNodes,n.ScrollFactor,n.Transform,n.Visible],initialize:function(t,e,i){void 0===e&&(e="Shape"),a.call(this,t,e),this.geom=i,this.pathData=[],this.pathIndexes=[],this.fillColor=16777215,this.fillAlpha=1,this.strokeColor=16777215,this.strokeAlpha=1,this.lineWidth=1,this.isFilled=!1,this.isStroked=!1,this.closePath=!0,this._tempLine=new o,this.width=0,this.height=0,this.enableFilters&&(this.filtersFocusContext=!0),this.initRenderNodes(this._defaultRenderNodesMap)},_defaultRenderNodesMap:{get:function(){return s}},setFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.isFilled=!1:(this.fillColor=t,this.fillAlpha=e,this.isFilled=!0),this},setStrokeStyle:function(t,e,i){return void 0===i&&(i=1),void 0===t?this.isStroked=!1:(this.lineWidth=t,this.strokeColor=e,this.strokeAlpha=i,this.isStroked=!0),this},setClosePath:function(t){return this.closePath=t,this},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this},preDestroy:function(){this.geom=null,this._tempLine=null,this.pathData=[],this.pathIndexes=[]},displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}}});t.exports=h},34682(t,e,i){var s=i(70554);t.exports=function(t,e,i,r,n,a,o){var h=s.getTintAppendFloatAlpha(r.strokeColor,r.strokeAlpha*n),l=r.pathData,u=l.length-1,d=r.lineWidth,c=!r.closePath,f=r.customRenderNodes.StrokePath||r.defaultRenderNodes.StrokePath,p=[];c&&(u-=2);for(var m=0;m0&&g===l[m-2]&&v===l[m-1]||p.push({x:g,y:v,width:d})}f.run(t,e,p,d,c,i,h,h,h,h,void 0,r.lighting)}},23629(t,e,i){var s=i(13609),r=i(83419),n=i(39506),a=i(94811),o=i(96503),h=i(36383),l=i(17803),u=new r({Extends:l,Mixins:[s],initialize:function(t,e,i,s,r,n,a,h,u){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=128),void 0===r&&(r=0),void 0===n&&(n=360),void 0===a&&(a=!1),l.call(this,t,"Arc",new o(0,0,s)),this._startAngle=r,this._endAngle=n,this._anticlockwise=a,this._iterations=.01,this.setPosition(e,i);var d=2*this.geom.radius;this.setSize(d,d),void 0!==h&&this.setFillStyle(h,u),this.updateDisplayOrigin(),this.updateData()},iterations:{get:function(){return this._iterations},set:function(t){this._iterations=t,this.updateData()}},radius:{get:function(){return this.geom.radius},set:function(t){this.geom.radius=t;var e=2*t;this.setSize(e,e),this.updateDisplayOrigin(),this.updateData()}},startAngle:{get:function(){return this._startAngle},set:function(t){this._startAngle=t,this.updateData()}},endAngle:{get:function(){return this._endAngle},set:function(t){this._endAngle=t,this.updateData()}},anticlockwise:{get:function(){return this._anticlockwise},set:function(t){this._anticlockwise=t,this.updateData()}},setRadius:function(t){return this.radius=t,this},setIterations:function(t){return void 0===t&&(t=.01),this.iterations=t,this},setStartAngle:function(t,e){return this._startAngle=t,void 0!==e&&(this._anticlockwise=e),this.updateData()},setEndAngle:function(t,e){return this._endAngle=t,void 0!==e&&(this._anticlockwise=e),this.updateData()},updateData:function(){var t=this._iterations,e=t,i=this.geom.radius,s=n(this._startAngle),r=n(this._endAngle),o=i,l=i;r-=s,this._anticlockwise?r<-h.TAU?r=-h.TAU:r>0&&(r=-h.TAU+r%h.TAU):r>h.TAU?r=h.TAU:r<0&&(r=h.TAU+r%h.TAU);for(var u,d=[o+Math.cos(s)*i,l+Math.sin(s)*i];e<1;)u=r*e+s,d.push(o+Math.cos(u)*i,l+Math.sin(u)*i),e+=t;return u=r+s,d.push(o+Math.cos(u)*i,l+Math.sin(u)*i),d.push(o+Math.cos(s)*i,l+Math.sin(s)*i),this.pathIndexes=a(d),this.pathData=d,this}});t.exports=u},42542(t,e,i){var s=i(39506),r=i(65960),n=i(75177),a=i(20926);t.exports=function(t,e,i,o){i.addToRenderList(e);var h=t.currentContext;if(a(t,h,e,i,o)){var l=e.radius;h.beginPath(),h.arc(l-e.originX*(2*l),l-e.originY*(2*l),l,s(e._startAngle),s(e._endAngle),e.anticlockwise),e.closePath&&h.closePath(),e.isFilled&&(r(h,e),h.fill()),e.isStroked&&(n(h,e),h.stroke()),h.restore()}}},42563(t,e,i){var s=i(23629),r=i(39429);r.register("arc",function(t,e,i,r,n,a,o,h){return this.displayList.add(new s(this.scene,t,e,i,r,n,a,o,h))}),r.register("circle",function(t,e,i,r,n){return this.displayList.add(new s(this.scene,t,e,i,0,360,!1,r,n))})},13609(t,e,i){var s=i(29747),r=s,n=s;r=i(41447),n=i(42542),t.exports={renderWebGL:r,renderCanvas:n}},41447(t,e,i){var s=i(91296),r=i(10441),n=i(34682);t.exports=function(t,e,i,a){var o=i.camera;o.addToRenderList(e);var h=s(e,o,a,!i.useCanvas).calc,l=e._displayOriginX,u=e._displayOriginY,d=e.alpha,c=e.customRenderNodes.Submitter||e.defaultRenderNodes.Submitter;e.isFilled&&r(i,c,h,e,d,l,u),e.isStroked&&n(i,c,h,e,d,l,u)}},89(t,e,i){var s=i(83419),r=i(33141),n=i(94811),a=i(87841),o=i(17803),h=new s({Extends:o,Mixins:[r],initialize:function(t,e,i,s,r,n){void 0===e&&(e=0),void 0===i&&(i=0),o.call(this,t,"Curve",s),this._smoothness=32,this._curveBounds=new a,this.closePath=!1,this.setPosition(e,i),void 0!==r&&this.setFillStyle(r,n),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(t){this._smoothness=t,this.updateData()}},setSmoothness:function(t){return this._smoothness=t,this.updateData()},updateData:function(){var t=this._curveBounds,e=this._smoothness;this.geom.getBounds(t,e),this.setSize(t.width,t.height),this.updateDisplayOrigin();for(var i=[],s=this.geom.getPoints(e),r=0;r0)for(s(o,e),_=0;_0&&O>0&&o.fillRect(h+A*f+E,l+_*p+E,R,O));if(S&&e.altFillAlpha>0)for(s(o,e,e.altFillColor,e.altFillAlpha*u),_=0;_0&&O>0&&o.fillRect(h+A*f+E,l+_*p+E,R,O)):M=1;if(b&&e.strokeAlpha>0){r(o,e,e.strokeColor,e.strokeAlpha*u);var P=e.strokeOutside?0:1;for(A=P;AC&&(o.beginPath(),o.moveTo(d+h,l),o.lineTo(d+h,c+l),o.stroke()),c>C&&(o.beginPath(),o.moveTo(h,c+l),o.lineTo(d+h,c+l),o.stroke()))}o.restore()}}},34137(t,e,i){var s=i(39429),r=i(30479);s.register("grid",function(t,e,i,s,n,a,o,h,l,u){return this.displayList.add(new r(this.scene,t,e,i,s,n,a,o,h,l,u))})},26015(t,e,i){var s=i(29747),r=s,n=s;r=i(46161),n=i(49912),t.exports={renderWebGL:r,renderCanvas:n}},46161(t,e,i){var s=i(91296),r=i(70554);t.exports=function(t,e,i,n){var a=i.camera;a.addToRenderList(e);var o=e.customRenderNodes.FillRect||e.defaultRenderNodes.FillRect,h=e.customRenderNodes.Submitter||e.defaultRenderNodes.Submitter,l=s(e,a,n,!i.useCanvas).calc;l.translate(-e._displayOriginX,-e._displayOriginY);var u,d=e.alpha,c=e.width,f=e.height,p=e.cellWidth,m=e.cellHeight,g=Math.ceil(c/p),v=Math.ceil(f/m),x=p,y=m,T=p-(g*p-c),w=m-(v*m-f),S=e.isFilled,b=e.showAltCells,E=e.isStroked,C=e.cellPadding,A=e.lineWidth,_=A/2,M=0,R=0,O=0,P=0,L=0;if(C&&(x-=2*C,y-=2*C,T-=2*C,w-=2*C),S&&e.fillAlpha>0)for(u=r.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*d),R=0;R0&&L>0&&o.run(i,l,h,M*p+C,R*m+C,P,L,u,u,u,u,e.lighting));if(b&&e.altFillAlpha>0)for(u=r.getTintAppendFloatAlpha(e.altFillColor,e.altFillAlpha*d),R=0;R0&&L>0&&o.run(i,l,h,M*p+C,R*m+C,P,L,u,u,u,u)):O=1;if(E&&e.strokeAlpha>0){var F=r.getTintAppendFloatAlpha(e.strokeColor,e.strokeAlpha*d),D=e.strokeOutside?0:1;for(M=D;M_&&o.run(i,l,h,c-_,0,A,f,F,F,F,F),f>_&&o.run(i,l,h,0,f-_,c,A,F,F,F,F))}}},61475(t,e,i){var s=i(99651),r=i(83419),n=i(17803),a=new r({Extends:n,Mixins:[s],initialize:function(t,e,i,s,r,a,o,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=48),void 0===r&&(r=32),void 0===a&&(a=15658734),void 0===o&&(o=10066329),void 0===h&&(h=13421772),n.call(this,t,"IsoBox",null),this.projection=4,this.fillTop=a,this.fillLeft=o,this.fillRight=h,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isFilled=!0,this.setPosition(e,i),this.setSize(s,r),this.updateDisplayOrigin()},setProjection:function(t){return this.projection=t,this},setFaces:function(t,e,i){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),this.showTop=t,this.showLeft=e,this.showRight=i,this},setFillStyle:function(t,e,i){return this.fillTop=t,this.fillLeft=e,this.fillRight=i,this.isFilled=!0,this}});t.exports=a},11508(t,e,i){var s=i(65960),r=i(20926);t.exports=function(t,e,i,n){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,n)&&e.isFilled){var o=e.width,h=e.height,l=o/2,u=o/e.projection;e.showTop&&(s(a,e,e.fillTop),a.beginPath(),a.moveTo(-l,-h),a.lineTo(0,-u-h),a.lineTo(l,-h),a.lineTo(l,-1),a.lineTo(0,u-1),a.lineTo(-l,-1),a.lineTo(-l,-h),a.fill()),e.showLeft&&(s(a,e,e.fillLeft),a.beginPath(),a.moveTo(-l,0),a.lineTo(0,u),a.lineTo(0,u-h),a.lineTo(-l,-h),a.lineTo(-l,0),a.fill()),e.showRight&&(s(a,e,e.fillRight),a.beginPath(),a.moveTo(l,0),a.lineTo(0,u),a.lineTo(0,u-h),a.lineTo(l,-h),a.lineTo(l,0),a.fill()),a.restore()}}},3933(t,e,i){var s=i(39429),r=i(61475);s.register("isobox",function(t,e,i,s,n,a,o){return this.displayList.add(new r(this.scene,t,e,i,s,n,a,o))})},99651(t,e,i){var s=i(29747),r=s,n=s;r=i(68149),n=i(11508),t.exports={renderWebGL:r,renderCanvas:n}},68149(t,e,i){var s=i(91296),r=i(70554);t.exports=function(t,e,i,n){if(e.isFilled){var a=i.camera;a.addToRenderList(e);var o,h,l,u,d,c,f,p,m,g=e.customRenderNodes.FillTri||e.defaultRenderNodes.FillTri,v=e.customRenderNodes.Submitter||e.defaultRenderNodes.Submitter,x=s(e,a,n,!i.useCanvas).calc,y=e.width,T=e.height,w=y/2,S=y/e.projection,b=e.alpha,E=e.lighting;e.showTop&&(o=r.getTintAppendFloatAlpha(e.fillTop,b),h=-w,l=-T,u=0,d=-S-T,c=w,f=-T,p=0,m=S-T,g.run(i,x,v,h,l,u,d,c,f,o,o,o,E),g.run(i,x,v,c,f,p,m,h,l,o,o,o,E)),e.showLeft&&(o=r.getTintAppendFloatAlpha(e.fillLeft,b),h=-w,l=0,u=0,d=S,c=0,f=S-T,p=-w,m=-T,g.run(i,x,v,h,l,u,d,c,f,o,o,o,E),g.run(i,x,v,c,f,p,m,h,l,o,o,o,E)),e.showRight&&(o=r.getTintAppendFloatAlpha(e.fillRight,b),h=w,l=0,u=0,d=S,c=0,f=S-T,p=w,m=-T,g.run(i,x,v,h,l,u,d,c,f,o,o,o,E),g.run(i,x,v,c,f,p,m,h,l,o,o,o,E))}}},16933(t,e,i){var s=i(83419),r=i(60561),n=i(17803),a=new s({Extends:n,Mixins:[r],initialize:function(t,e,i,s,r,a,o,h,l){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=48),void 0===r&&(r=32),void 0===a&&(a=!1),void 0===o&&(o=15658734),void 0===h&&(h=10066329),void 0===l&&(l=13421772),n.call(this,t,"IsoTriangle",null),this.projection=4,this.fillTop=o,this.fillLeft=h,this.fillRight=l,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isReversed=a,this.isFilled=!0,this.setPosition(e,i),this.setSize(s,r),this.updateDisplayOrigin()},setProjection:function(t){return this.projection=t,this},setReversed:function(t){return this.isReversed=t,this},setFaces:function(t,e,i){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),this.showTop=t,this.showLeft=e,this.showRight=i,this},setFillStyle:function(t,e,i){return this.fillTop=t,this.fillLeft=e,this.fillRight=i,this.isFilled=!0,this}});t.exports=a},79590(t,e,i){var s=i(65960),r=i(20926);t.exports=function(t,e,i,n){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,n)&&e.isFilled){var o=e.width,h=e.height,l=o/2,u=o/e.projection,d=e.isReversed;e.showTop&&d&&(s(a,e,e.fillTop),a.beginPath(),a.moveTo(-l,-h),a.lineTo(0,-u-h),a.lineTo(l,-h),a.lineTo(0,u-h),a.fill()),e.showLeft&&(s(a,e,e.fillLeft),a.beginPath(),d?(a.moveTo(-l,-h),a.lineTo(0,u),a.lineTo(0,u-h)):(a.moveTo(-l,0),a.lineTo(0,u),a.lineTo(0,u-h)),a.fill()),e.showRight&&(s(a,e,e.fillRight),a.beginPath(),d?(a.moveTo(l,-h),a.lineTo(0,u),a.lineTo(0,u-h)):(a.moveTo(l,0),a.lineTo(0,u),a.lineTo(0,u-h)),a.fill()),a.restore()}}},49803(t,e,i){var s=i(39429),r=i(16933);s.register("isotriangle",function(t,e,i,s,n,a,o,h){return this.displayList.add(new r(this.scene,t,e,i,s,n,a,o,h))})},60561(t,e,i){var s=i(29747),r=s,n=s;r=i(51503),n=i(79590),t.exports={renderWebGL:r,renderCanvas:n}},51503(t,e,i){var s=i(91296),r=i(70554);t.exports=function(t,e,i,n){if(e.isFilled){var a=i.camera;a.addToRenderList(e);var o,h,l,u,d,c,f,p=e.customRenderNodes.FillTri||e.defaultRenderNodes.FillTri,m=e.customRenderNodes.Submitter||e.defaultRenderNodes.Submitter,g=s(e,a,n,!i.useCanvas).calc,v=e.width,x=e.height,y=v/2,T=v/e.projection,w=e.isReversed,S=e.alpha,b=e.lighting;if(e.showTop&&w){o=r.getTintAppendFloatAlpha(e.fillTop,S),h=-y,l=-x,u=0,d=-T-x,c=y,f=-x;var E=T-x;p.run(i,g,m,h,l,u,d,c,f,o,o,o,b),p.run(i,g,m,c,f,0,E,h,l,o,o,o,b)}e.showLeft&&(o=r.getTintAppendFloatAlpha(e.fillLeft,S),w?(h=-y,l=-x,u=0,d=T,c=0,f=T-x):(h=-y,l=0,u=0,d=T,c=0,f=T-x),p.run(i,g,m,h,l,u,d,c,f,o,o,o,b)),e.showRight&&(o=r.getTintAppendFloatAlpha(e.fillRight,S),w?(h=y,l=-x,u=0,d=T,c=0,f=T-x):(h=y,l=0,u=0,d=T,c=0,f=T-x),p.run(i,g,m,h,l,u,d,c,f,o,o,o,b))}}},57847(t,e,i){var s=i(83419),r=i(17803),n=i(23031),a=i(36823),o=new s({Extends:r,Mixins:[a],initialize:function(t,e,i,s,a,o,h,l,u){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===a&&(a=0),void 0===o&&(o=128),void 0===h&&(h=0),r.call(this,t,"Line",new n(s,a,o,h));var d=Math.max(1,this.geom.right-this.geom.left),c=Math.max(1,this.geom.bottom-this.geom.top);this.lineWidth=1,this._startWidth=1,this._endWidth=1,this.setPosition(e,i),this.setSize(d,c),void 0!==l&&this.setStrokeStyle(1,l,u),this.updateDisplayOrigin()},setLineWidth:function(t,e){return void 0===e&&(e=t),this._startWidth=t,this._endWidth=e,this.lineWidth=t,this},setTo:function(t,e,i,s){return this.geom.setTo(t,e,i,s),this}});t.exports=o},17440(t,e,i){var s=i(75177),r=i(20926);t.exports=function(t,e,i,n){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,n)){var o=e._displayOriginX,h=e._displayOriginY;e.isStroked&&(s(a,e),a.beginPath(),a.moveTo(e.geom.x1-o,e.geom.y1-h),a.lineTo(e.geom.x2-o,e.geom.y2-h),a.stroke()),a.restore()}}},2481(t,e,i){var s=i(39429),r=i(57847);s.register("line",function(t,e,i,s,n,a,o,h){return this.displayList.add(new r(this.scene,t,e,i,s,n,a,o,h))})},36823(t,e,i){var s=i(29747),r=s,n=s;r=i(77385),n=i(17440),t.exports={renderWebGL:r,renderCanvas:n}},77385(t,e,i){var s=i(91296),r=i(70554),n=[{x:0,y:0,width:0},{x:0,y:0,width:0}];t.exports=function(t,e,i,a){var o=i.camera;o.addToRenderList(e);var h=s(e,o,a,!i.useCanvas).calc,l=e._displayOriginX,u=e._displayOriginY,d=e.alpha;if(e.isStroked){var c=r.getTintAppendFloatAlpha(e.strokeColor,e.strokeAlpha*d);n[0].x=e.geom.x1-l,n[0].y=e.geom.y1-u,n[0].width=e._startWidth,n[1].x=e.geom.x2-l,n[1].y=e.geom.y2-u,n[1].width=e._endWidth,(e.customRenderNodes.StrokePath||e.defaultRenderNodes.StrokePath).run(i,e.customRenderNodes.Submitter||e.defaultRenderNodes.Submitter,n,1,!0,h,c,c,c,c,void 0,e.lighting)}}},24949(t,e,i){var s=i(90273),r=i(83419),n=i(94811),a=i(13829),o=i(25717),h=i(17803),l=i(5469),u=new r({Extends:h,Mixins:[s],initialize:function(t,e,i,s,r,n){void 0===e&&(e=0),void 0===i&&(i=0),h.call(this,t,"Polygon",new o(s));var l=a(this.geom);this.setPosition(e,i),this.setSize(l.width,l.height),void 0!==r&&this.setFillStyle(r,n),this.updateDisplayOrigin(),this.updateData()},smooth:function(t){void 0===t&&(t=1);for(var e=0;e0,this.updateRoundedData()},setSize:function(t,e){this.width=t,this.height=e,this.geom.setSize(t,e),this.updateData(),this.updateDisplayOrigin();var i=this.input;return i&&!i.customHitArea&&(i.hitArea.width=t,i.hitArea.height=e),this},updateData:function(){if(this.isRounded)return this.updateRoundedData();var t=[],e=this.geom,i=this._tempLine;return e.getLineA(i),t.push(i.x1,i.y1,i.x2,i.y2),e.getLineB(i),t.push(i.x2,i.y2),e.getLineC(i),t.push(i.x2,i.y2),e.getLineD(i),t.push(i.x2,i.y2),this.pathData=t,this},updateRoundedData:function(){var t=[],e=this.width/2,i=this.height/2,s=Math.min(e,i),n=Math.min(this.radius,s),a=e,o=i,h=Math.max(4,Math.min(16,Math.ceil(n/2)));return this.arcTo(t,a-e+n,o-i+n,n,Math.PI,1.5*Math.PI,h),t.push(a+e-n,o-i),this.arcTo(t,a+e-n,o-i+n,n,1.5*Math.PI,2*Math.PI,h),t.push(a+e,o+i-n),this.arcTo(t,a+e-n,o+i-n,n,0,.5*Math.PI,h),t.push(a-e+n,o+i),this.arcTo(t,a-e+n,o+i-n,n,.5*Math.PI,Math.PI,h),t.push(a-e,o-i+n),this.pathIndexes=r(t),this.pathData=t,this},arcTo:function(t,e,i,s,r,n,a){for(var o=(n-r)/a,h=0;h<=a;h++){var l=r+o*h;t.push(e+Math.cos(l)*s,i+Math.sin(l)*s)}}});t.exports=h},48682(t,e,i){var s=i(65960),r=i(75177),n=i(20926),a=function(t,e,i,s,r,n){var a=Math.min(s/2,r/2),o=Math.min(n,a);0!==o?(t.moveTo(e+o,i),t.lineTo(e+s-o,i),t.arcTo(e+s,i,e+s,i+o,o),t.lineTo(e+s,i+r-o),t.arcTo(e+s,i+r,e+s-o,i+r,o),t.lineTo(e+o,i+r),t.arcTo(e,i+r,e,i+r-o,o),t.lineTo(e,i+o),t.arcTo(e,i,e+o,i,o),t.closePath()):t.rect(e,i,s,r)};t.exports=function(t,e,i,o){i.addToRenderList(e);var h=t.currentContext;if(n(t,h,e,i,o)){var l=e._displayOriginX,u=e._displayOriginY;e.isFilled&&(s(h,e),e.isRounded?(h.beginPath(),a(h,-l,-u,e.width,e.height,e.radius),h.fill()):h.fillRect(-l,-u,e.width,e.height)),e.isStroked&&(r(h,e),h.beginPath(),e.isRounded?a(h,-l,-u,e.width,e.height,e.radius):h.rect(-l,-u,e.width,e.height),h.stroke()),h.restore()}}},87959(t,e,i){var s=i(39429),r=i(74561);s.register("rectangle",function(t,e,i,s,n,a){return this.displayList.add(new r(this.scene,t,e,i,s,n,a))})},95597(t,e,i){var s=i(29747),r=s,n=s;r=i(52059),n=i(48682),t.exports={renderWebGL:r,renderCanvas:n}},52059(t,e,i){var s=i(10441),r=i(91296),n=i(34682),a=i(70554);t.exports=function(t,e,i,o){var h=i.camera;h.addToRenderList(e);var l=r(e,h,o,!i.useCanvas).calc,u=e._displayOriginX,d=e._displayOriginY,c=e.alpha,f=e.customRenderNodes,p=e.defaultRenderNodes,m=f.Submitter||p.Submitter;if(e.isFilled)if(e.isRounded)s(i,m,l,e,c,u,d);else{var g=a.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*c);(f.FillRect||p.FillRect).run(i,l,m,-u,-d,e.width,e.height,g,g,g,g,e.lighting)}e.isStroked&&n(i,m,l,e,c,u,d)}},55911(t,e,i){var s=i(81991),r=i(83419),n=i(94811),a=i(17803),o=new r({Extends:a,Mixins:[s],initialize:function(t,e,i,s,r,n,o,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=5),void 0===r&&(r=32),void 0===n&&(n=64),a.call(this,t,"Star",null),this._points=s,this._innerRadius=r,this._outerRadius=n,this.setPosition(e,i),this.setSize(2*n,2*n),void 0!==o&&this.setFillStyle(o,h),this.updateDisplayOrigin(),this.updateData()},setPoints:function(t){return this._points=t,this.updateData()},setInnerRadius:function(t){return this._innerRadius=t,this.updateData()},setOuterRadius:function(t){return this._outerRadius=t,this.updateData()},points:{get:function(){return this._points},set:function(t){this._points=t,this.updateData()}},innerRadius:{get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this.updateData()}},outerRadius:{get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this.updateData()}},updateData:function(){var t=[],e=this._points,i=this._innerRadius,s=this._outerRadius,r=Math.PI/2*3,a=Math.PI/e,o=s,h=s;t.push(o,h+-s);for(var l=0;l=this.size||this.bufferUpdateSegments===this.MAX_BUFFER_UPDATE_SEGMENTS_FULL)){var e=Math.floor(t/this.bufferUpdateSegmentSize);this.bufferUpdateSegments|=1<=this.size)return this;var e=this.submitterNode.instanceBufferLayout,i=e.buffer.viewF32,s=this.memberCount*e.layout.stride;return i.set(t,s/i.BYTES_PER_ELEMENT),this.setSegmentNeedsUpdate(this.memberCount),this.memberCount++,this},addMember:function(t){if(this.memberCount>=this.size)return this;var e=this.nextMemberF32,i=this.nextMemberU32;t||(t={});var s=this.frame;if(void 0!==t.frame&&(s=t.frame.base?t.frame.base:t.frame),"string"==typeof s&&!(s=this.texture.get(s)))return this;var r=0;this._setAnimatedValue(t.x,r),r+=4,this._setAnimatedValue(t.y,r),r+=4,this._setAnimatedValue(t.rotation,r),r+=4,this._setAnimatedValue(t.scaleX,r,1),r+=4,this._setAnimatedValue(t.scaleY,r,1),r+=4,this._setAnimatedValue(t.alpha,r,1),r+=4;var n=t.animation;if(n){var a;if("string"==typeof n||"number"==typeof n)a="string"==typeof n?this.animationDataNames[n]:this.animationDataIndices[n],this._setAnimatedValue({base:a.index,amplitude:a.frameCount,duration:a.duration,ease:h.Linear,yoyo:!1},r);else{var o=n.base;a="string"==typeof o?this.animationDataNames[o]:"number"==typeof o?this.animationDataIndices[o]:this.animationData[0],this._setAnimatedValue({base:a.index,amplitude:"number"==typeof n.amplitude?n.amplitude:a.frameCount,duration:n.duration||a.duration,delay:n.delay||0,ease:n.ease||h.Linear,yoyo:!!n.yoyo},r)}}else{var l=this.frameDataIndices[s.name],u=t.frame;u&&void 0!==u.base?this._setAnimatedValue({base:l,amplitude:u.amplitude,duration:u.duration,delay:u.delay,ease:u.ease,yoyo:u.yoyo},r):this._setAnimatedValue(l,r)}r+=4,this._setAnimatedValue(t.tintBlend,r,1),r+=4;var c=void 0===t.tintBottomLeft?16777215:t.tintBottomLeft,f=void 0===t.tintTopLeft?16777215:t.tintTopLeft,p=void 0===t.tintBottomRight?16777215:t.tintBottomRight,m=void 0===t.tintTopRight?16777215:t.tintTopRight,g=void 0===t.alphaBottomLeft?1:t.alphaBottomLeft,v=void 0===t.alphaTopLeft?1:t.alphaTopLeft,x=void 0===t.alphaBottomRight?1:t.alphaBottomRight,y=void 0===t.alphaTopRight?1:t.alphaTopRight;return i[r++]=d(c,g),i[r++]=d(f,v),i[r++]=d(p,x),i[r++]=d(m,y),e[r++]=void 0===t.originX?.5:t.originX,e[r++]=void 0===t.originY?.5:t.originY,e[r++]=t.tintMode||0,e[r++]=void 0===t.creationTime?this.timeElapsed:t.creationTime,e[r++]=void 0===t.scrollFactorX?1:t.scrollFactorX,e[r++]=void 0===t.scrollFactorY?1:t.scrollFactorY,this.addData(this.nextMemberF32),this},editMember:function(t,e){if(t<0||t>=this.memberCount)return this;var i=this.memberCount;return this.memberCount=t,this.addMember(e),this.memberCount=i,this},patchMember:function(t,e,i){if(!(t<0||t>=this.memberCount)){var s=this.submitterNode.instanceBufferLayout,r=s.buffer,n=t*s.layout.stride,a=r.viewU32,o=n/4;if(i)for(var h=0;h=this.memberCount)return null;var e=this.submitterNode.instanceBufferLayout,i=e.buffer,s=t*e.layout.stride,r=i.viewF32,n=i.viewU32,a={},o=s/r.BYTES_PER_ELEMENT;a.x=this._getAnimatedValue(o),o+=4,a.y=this._getAnimatedValue(o),o+=4,a.rotation=this._getAnimatedValue(o),o+=4,a.scaleX=this._getAnimatedValue(o),o+=4,a.scaleY=this._getAnimatedValue(o),o+=4,a.alpha=this._getAnimatedValue(o),o+=4;var h=this._getAnimatedValue(o);o+=4,"number"!=typeof h&&(h=h.base);var l=this.frameDataIndicesInv[h];if(void 0===l){var u=this.animationDataIndices[h];u&&(a.animation=u.name)}else a.frame=l;return a.tintBlend=this._getAnimatedValue(o),o+=4,a.tintBottomLeft=n[o++],a.tintTopLeft=n[o++],a.tintBottomRight=n[o++],a.tintTopRight=n[o++],a.alphaBottomLeft=(a.tintBottomLeft>>>24)/255,a.alphaTopLeft=(a.tintTopLeft>>>24)/255,a.alphaBottomRight=(a.tintBottomRight>>>24)/255,a.alphaTopRight=(a.tintTopRight>>>24)/255,a.tintBottomLeft&=16777215,a.tintTopLeft&=16777215,a.tintBottomRight&=16777215,a.tintTopRight&=16777215,a.originX=r[o++],a.originY=r[o++],a.tintMode=r[o++],a.creationTime=r[o++],a.scrollFactorX=r[o++],a.scrollFactorY=r[o++],a},getMemberData:function(t,e){if(t<0||t>=this.memberCount)return null;var i=this.submitterNode.instanceBufferLayout,s=i.buffer,r=i.layout.stride,n=t*r;e||(e=this.nextMemberU32);var a=s.viewU32,o=a.BYTES_PER_ELEMENT;return e.set(a.subarray(n/o,n/o+r/o)),e},removeMembers:function(t,e){if(t<0||t>=this.memberCount)return this;void 0===e&&(e=1),e=Math.min(e,this.memberCount-t);var i=this.submitterNode.instanceBufferLayout,s=i.layout.stride,r=t*s,n=e*s,a=i.buffer.viewU8;a.set(a.subarray(r+n),r);for(var o=t;othis.memberCount)return this;Array.isArray(e)||(e=[e]);var i=this.memberCount,s=this.submitterNode.instanceBufferLayout,r=s.layout.stride,n=t*r,a=e.length*r;s.buffer.viewU8.copyWithin(n+a,n,i*r),this.memberCount=t;for(var o=0;othis.memberCount)return this;var i=e.length*e.BYTES_PER_ELEMENT,s=this.submitterNode.instanceBufferLayout,r=s.layout.stride,n=t*r;s.buffer.viewU8.copyWithin(n+i,n,this.memberCount*r),s.buffer.viewU32.set(e,n/e.BYTES_PER_ELEMENT),this.memberCount=Math.min(this.size,this.memberCount+i/r);for(var a=t;a=1?p=0:p<-1&&(p=-.999),p=(p+1)/2,a=Math.floor(f)+p}(l=o>0?l/o%2:0)<0&&(l+=2),l/=2,l+=n,u&&(o=-o),d||(l=-l),s[e++]=r,s[e++]=a,s[e++]=o,s[e]=l}},_getAnimatedValue:function(t){var e=this.submitterNode.instanceBufferLayout.buffer.viewF32,i=e[t++],s=e[t++],r=e[t++],n=e[t];if(0===s||0===r||0===o)return i;n>0||(n=-n);var a=r<0;a&&(r=-r);var o=Math.floor(n);if(n=(n-=o)*r*2%r,o===h.Gravity){var l=Math.floor(s),u=2*(s-l)-1;return 0===u&&(u=1),{base:i,ease:o,duration:r,delay:n,yoyo:a,velocity:l,gravityFactor:u}}return{base:i,ease:o,amplitude:s,duration:r,delay:n,yoyo:a}},setAnimationEnabled:function(t,e){return this._animationsEnabled[t]=!!e,this},preDestroy:function(){this.frameDataTexture.destroy()}});t.exports=c},16193(t,e,i){var s=i(10312),r=i(44603),n=i(23568),a=i(76573);r.register("spriteGPULayer",function(t,e){void 0===t&&(t={});var i=n(t,"key",null),r=n(t,"size",1),o=new a(this.scene,i,r);return void 0!==e&&(t.add=e),o.alpha=n(t,"alpha",1),o.blendMode=n(t,"blendMode",s.NORMAL),o.visible=n(t,"visible",!0),e&&this.scene.sys.displayList.add(o),o})},96019(t,e,i){var s=i(76573);i(39429).register("spriteGPULayer",function(t,e){return this.displayList.add(new s(this.scene,t,e))})},71238(t,e,i){var s=i(29747),r=i(97591),n=s;t.exports={renderWebGL:r,renderCanvas:n}},97591(t){t.exports=function(t,e,i,s){i.camera.addToRenderList(e);var r=e.customRenderNodes,n=e.defaultRenderNodes;(r.Submitter||n.Submitter).run(i)}},14727(t,e,i){var s=i(78705),r=i(83419),n=i(88571),a=i(74759),o=new r({Extends:n,Mixins:[a],initialize:function(t,e,i,s,r){n.call(this,t,e,i,s,r),this.type="Stamp"},_defaultRenderNodesMap:{get:function(){return s}}});t.exports=o},656(t,e,i){var s=new(i(61340));t.exports=function(t,e,i){i.addToRenderList(e),s.copyFrom(i.matrix),i.matrix.loadIdentity();var r=i.scrollX,n=i.scrollY;i.scrollX=0,i.scrollY=0,t.batchSprite(e,e.frame,i),i.scrollX=r,i.scrollY=n,i.matrix.copyFrom(s)}},31479(t,e,i){var s=i(25305),r=i(44603),n=i(23568),a=i(14727);r.register("stamp",function(t,e){void 0===t&&(t={});var i=n(t,"key",null),r=n(t,"frame",null),o=new a(this.scene,0,0,i,r);return void 0!==e&&(t.add=e),s(this.scene,o,t),o})},85326(t,e,i){var s=i(14727);i(39429).register("stamp",function(t,e,i,r){return this.displayList.add(new s(this.scene,t,e,i,r))})},74759(t,e,i){var s=i(29747);s=i(656),t.exports={renderCanvas:s}},14220(t){t.exports=function(t,e,i){var s=t.canvas,r=t.context,n=t.style,a=[],o=0,h=i.length;n.maxLines>0&&n.maxLines1&&(d+=l*(c.length-1))}n.wordWrap&&(d-=r.measureText(" ").width),a[u]=Math.ceil(d),o=Math.max(o,a[u])}var p=e.fontSize+n.strokeThickness,m=p*h,g=t.lineSpacing;return h>1&&(m+=g*(h-1)),{width:o,height:m,lines:h,lineWidths:a,lineSpacing:g,lineHeight:p}}},79557(t,e,i){var s=i(27919);t.exports=function(t){var e=s.create(this),i=e.getContext("2d",{willReadFrequently:!0});t.syncFont(e,i);var r=i.measureText(t.testString);if("actualBoundingBoxAscent"in r){var n=r.actualBoundingBoxAscent,a=r.actualBoundingBoxDescent;return s.remove(e),{ascent:n,descent:a,fontSize:n+a}}var o=Math.ceil(r.width*t.baselineX),h=o,l=2*h;h=h*t.baselineY|0,e.width=o,e.height=l,i.fillStyle="#f00",i.fillRect(0,0,o,l),i.font=t._font,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(t.testString,0,h);var u={ascent:0,descent:0,fontSize:0},d=i.getImageData(0,0,o,l);if(!d)return u.ascent=h,u.descent=h+6,u.fontSize=u.ascent+u.descent,s.remove(e),u;var c,f,p=d.data,m=p.length,g=4*o,v=0,x=!1;for(c=0;ch;c--){for(f=0;fu){if(0===c){for(var v=p;v.length;){var x=(v=v.slice(0,-1)).length*this.letterSpacing;if((g=e.measureText(v).width+x)<=u)break}if(!v.length)throw new Error("wordWrapWidth < a single character");var y=f.substr(v.length);d[c]=y,h+=v}var T=d[c].length?c:c+1,w=d.slice(T).join(" ").replace(/[ \n]*$/gi,"");r.splice(a+1,0,w),n=r.length;break}h+=p,u-=g}s+=h.replace(/[ \n]*$/gi,"")+"\n"}}return s=s.replace(/[\s|\n]*$/gi,"")},basicWordWrap:function(t,e,i){for(var s="",r=t.split(this.splitRegExp),n=r.length-1,a=e.measureText(" ").width,o=0;o<=n;o++){for(var h=i,l=r[o].split(" "),u=l.length-1,d=0;d<=u;d++){var c=l[d],f=c.length*this.letterSpacing,p=e.measureText(c).width+f,m=p;dh&&d>0&&(s+="\n",h=i),s+=c,d0&&(c+=h.lineSpacing*m),i.rtl)d=f-d-u.left-u.right;else if("right"===i.align)d+=a-h.lineWidths[m];else if("center"===i.align)d+=(a-h.lineWidths[m])/2;else if("justify"===i.align){if(h.lineWidths[m]/h.width>=.85){var g=h.width-h.lineWidths[m],v=e.measureText(" ").width,x=o[m].trim(),y=x.split(" ");g+=(o[m].length-x.length)*v;for(var T=Math.floor(g/v),w=0;T>0;)y[w]+=" ",w=(w+1)%(y.length-1||1),--T;o[m]=y.join(" ")}}this.autoRound&&(d=Math.round(d),c=Math.round(c));var S=this.letterSpacing;if(i.strokeThickness&&0===S&&(i.syncShadow(e,i.shadowStroke),e.strokeText(o[m],d,c)),i.color)if(i.syncShadow(e,i.shadowFill),0!==S)for(var b=0,E=o[m].split(""),C=0;C2?a[o++]:"",s=a[o++]||"16px",i=a[o++]||"Courier"}return i===this.fontFamily&&s===this.fontSize&&r===this.fontStyle||(this.fontFamily=i,this.fontSize=s,this.fontStyle=r,e&&this.update(!0)),this.parent},setFontFamily:function(t){return this.fontFamily!==t&&(this.fontFamily=t,this.update(!0)),this.parent},setFontStyle:function(t){return this.fontStyle!==t&&(this.fontStyle=t,this.update(!0)),this.parent},setFontSize:function(t){return"number"==typeof t&&(t=t.toString()+"px"),this.fontSize!==t&&(this.fontSize=t,this.update(!0)),this.parent},setTestString:function(t){return this.testString=t,this.update(!0)},setFixedSize:function(t,e){return this.fixedWidth=t,this.fixedHeight=e,t&&(this.parent.width=t),e&&(this.parent.height=e),this.update(!1)},setBackgroundColor:function(t){return this.backgroundColor=t,this.update(!1)},setFill:function(t){return this.color=t,this.update(!1)},setColor:function(t){return this.color=t,this.update(!1)},setResolution:function(t){return this.resolution=t,this.update(!1)},setStroke:function(t,e){return void 0===e&&(e=this.strokeThickness),void 0===t&&0!==this.strokeThickness?(this.strokeThickness=0,this.update(!0)):this.stroke===t&&this.strokeThickness===e||(this.stroke=t,this.strokeThickness=e,this.update(!0)),this.parent},setShadow:function(t,e,i,s,r,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i="#000"),void 0===s&&(s=0),void 0===r&&(r=!1),void 0===n&&(n=!0),this.shadowOffsetX=t,this.shadowOffsetY=e,this.shadowColor=i,this.shadowBlur=s,this.shadowStroke=r,this.shadowFill=n,this.update(!1)},setShadowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.shadowOffsetX=t,this.shadowOffsetY=e,this.update(!1)},setShadowColor:function(t){return void 0===t&&(t="#000"),this.shadowColor=t,this.update(!1)},setShadowBlur:function(t){return void 0===t&&(t=0),this.shadowBlur=t,this.update(!1)},setShadowStroke:function(t){return this.shadowStroke=t,this.update(!1)},setShadowFill:function(t){return this.shadowFill=t,this.update(!1)},setWordWrapWidth:function(t,e){return void 0===e&&(e=!1),this.wordWrapWidth=t,this.wordWrapUseAdvanced=e,this.update(!1)},setWordWrapCallback:function(t,e){return void 0===e&&(e=null),this.wordWrapCallback=t,this.wordWrapCallbackScope=e,this.update(!1)},setAlign:function(t){return void 0===t&&(t="left"),this.align=t,this.update(!1)},setMaxLines:function(t){return void 0===t&&(t=0),this.maxLines=t,this.update(!1)},getTextMetrics:function(){var t=this.metrics;return{ascent:t.ascent,descent:t.descent,fontSize:t.fontSize}},toJSON:function(){var t={};for(var e in o)t[e]=this[e];return t.metrics=this.getTextMetrics(),t},destroy:function(){this.parent=void 0}});t.exports=h},34397(t){t.exports=function(t,e,i,s){if(0!==e.width&&0!==e.height){i.camera.addToRenderList(e);var r=e.customRenderNodes,n=e.defaultRenderNodes;(r.Submitter||n.Submitter).run(i,e,s,0,r.Texturer||n.Texturer,r.Transformer||n.Transformer)}}},20839(t,e,i){var s=i(9674),r=i(27919),n=i(41571),a=i(83419),o=i(31401),h=i(95643),l=i(68703),u=i(56295),d=i(45650),c=i(26099),f=new a({Extends:h,Mixins:[o.Alpha,o.BlendMode,o.ComputedSize,o.Depth,o.Flip,o.GetBounds,o.Lighting,o.Mask,o.Origin,o.RenderNodes,o.ScrollFactor,o.Texture,o.Tint,o.Transform,o.Visible,u],initialize:function(t,e,i,n,a,o,l){var u=t.sys.renderer,f=u&&!u.gl;h.call(this,t,"TileSprite");var p=t.sys.textures.get(o).get(l);n=n?Math.floor(n):p.width,a=a?Math.floor(a):p.height,this._tilePosition=new c,this._tileScale=new c(1,1),this._tileRotation=0,this.dirty=!1,this.renderer=u,this.canvas=f?r.create(this,n,a):null,this.context=f?this.canvas.getContext("2d",{willReadFrequently:!1}):null,this._displayTextureKey=d(),this.displayTexture=f?t.sys.textures.addCanvas(this._displayTextureKey,this.canvas):null,this.displayFrame=this.displayTexture?this.displayTexture.get():null,this.currentFrame=null,this.fillCanvas=f?r.create2D(this,p.width,this.displayFrame.height):null,this.fillContext=this.fillCanvas?this.fillCanvas.getContext("2d",{willReadFrequently:!1}):null,this.fillPattern=null,this.anims=new s(this),this.setTexture(o,l),this.setPosition(e,i),this.setSize(n,a),this.setOrigin(.5,.5),this.initRenderNodes(this._defaultRenderNodesMap)},_defaultRenderNodesMap:{get:function(){return n}},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(t,e){this.anims.update(t,e)},setFrame:function(t){var e=this.texture.get(t);return e.cutWidth&&e.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this.frame=e,this.dirty=!0,this},setSizeToFrame:function(){return this},setTilePosition:function(t,e){return void 0!==t&&(this.tilePositionX=t),void 0!==e&&(this.tilePositionY=e),this},setTileRotation:function(t){return void 0===t&&(t=0),this.tileRotation=t,this},setTileScale:function(t,e){return void 0===t&&(t=this.tileScaleX),void 0===e&&(e=t),this.tileScaleX=t,this.tileScaleY=e,this},updateTileTexture:function(){if(this.renderer&&!this.renderer.gl){var t=this.frame,e=this.fillContext,i=this.fillCanvas,s=t.cutWidth,r=t.cutHeight;e.clearRect(0,0,s,r),i.width=s,i.height=r,e.drawImage(t.source.image,t.cutX,t.cutY,t.cutWidth,t.cutHeight,0,0,s,r),this.fillPattern=e.createPattern(i,"repeat"),this.currentFrame=t}},updateCanvas:function(){var t=this.canvas,e=this.width,i=this.height,s=this.currentFrame!==this.frame;if((t.width!==e||t.height!==i||s)&&(t.width=e,t.height=i,this.displayFrame.setSize(e,i),this.updateDisplayOrigin(),s&&this.updateTileTexture(),this.dirty=!0),!this.dirty||this.renderer&&this.renderer.gl)this.dirty=!1;else{var r=this.context;this.scene.sys.game.config.antialias||l.disable(r);var n=this._tileScale.x,a=this._tileScale.y,o=this._tilePosition.x,h=this._tilePosition.y;r.clearRect(0,0,e,i),r.save(),r.rotate(this._tileRotation),r.scale(n,a),r.translate(-o,-h),r.fillStyle=this.fillPattern;var u=Math.max(e,Math.abs(e/n)),d=Math.max(i,Math.abs(i/a)),c=Math.sqrt(u*u+d*d);r.fillRect(o-c,h-c,2*c,2*c),r.restore(),this.dirty=!1}},setSize:function(t,e){this.width=t,this.height=e,this.updateDisplayOrigin();var i=this.input;return i&&!i.customHitArea&&(i.hitArea.width=t,i.hitArea.height=e),this},preDestroy:function(){this.canvas&&r.remove(this.canvas),this.fillCanvas&&r.remove(this.fillCanvas),this.fillPattern=null,this.fillContext=null,this.fillCanvas=null,this.displayTexture=null,this.displayFrame=null,this.renderer=null,this.anims.destroy(),this.anims=void 0},tilePositionX:{get:function(){return this._tilePosition.x},set:function(t){this._tilePosition.x=t,this.dirty=!0}},tilePositionY:{get:function(){return this._tilePosition.y},set:function(t){this._tilePosition.y=t,this.dirty=!0}},tileRotation:{get:function(){return this._tileRotation},set:function(t){this._tileRotation=t,this.dirty=!0}},tileScaleX:{get:function(){return this._tileScale.x},set:function(t){this._tileScale.x=t,this.dirty=!0}},tileScaleY:{get:function(){return this._tileScale.y},set:function(t){this._tileScale.y=t,this.dirty=!0}}});t.exports=f},46992(t){t.exports=function(t,e,i,s){e.updateCanvas(),i.addToRenderList(e),t.batchSprite(e,e.displayFrame,i,s)}},14167(t,e,i){var s=i(25305),r=i(44603),n=i(23568),a=i(20839);r.register("tileSprite",function(t,e){void 0===t&&(t={});var i=n(t,"x",0),r=n(t,"y",0),o=n(t,"width",512),h=n(t,"height",512),l=n(t,"key",""),u=n(t,"frame",""),d=new a(this.scene,i,r,o,h,l,u);return void 0!==e&&(t.add=e),s(this.scene,d,t),d})},91681(t,e,i){var s=i(20839);i(39429).register("tileSprite",function(t,e,i,r,n,a){return this.displayList.add(new s(this.scene,t,e,i,r,n,a))})},56295(t,e,i){var s=i(29747),r=s,n=s;r=i(18553),n=i(46992),t.exports={renderWebGL:r,renderCanvas:n}},18553(t){t.exports=function(t,e,i,s){var r=e.width,n=e.height;if(0!==r&&0!==n){i.camera.addToRenderList(e);var a=e.customRenderNodes,o=e.defaultRenderNodes;(a.Submitter||o.Submitter).run(i,e,s,0,a.Texturer||o.Texturer,a.Transformer||o.Transformer)}}},18471(t,e,i){var s=i(45319),r=i(40939),n=i(83419),a=i(31401),o=i(51708),h=i(8443),l=i(95643),u=i(36383),d=i(14463),c=i(45650),f=i(10247),p=new n({Extends:l,Mixins:[a.Alpha,a.BlendMode,a.ComputedSize,a.Depth,a.Flip,a.GetBounds,a.Lighting,a.Mask,a.Origin,a.RenderNodes,a.ScrollFactor,a.TextureCrop,a.Tint,a.Transform,a.Visible,f],initialize:function(t,e,i,s){l.call(this,t,"Video"),this.video,this.videoTexture,this.videoTextureSource,this.snapshotTexture,this.glFlipY=!0,this._key=c(),this.touchLocked=!1,this.playWhenUnlocked=!1,this.frameReady=!1,this.isStalled=!1,this.failedPlayAttempts=0,this.metadata,this.retry=0,this.retryInterval=500,this._systemMuted=!1,this._codeMuted=!1,this._systemPaused=!1,this._codePaused=!1,this._callbacks={ended:this.completeHandler.bind(this),legacy:this.legacyPlayHandler.bind(this),playing:this.playingHandler.bind(this),seeked:this.seekedHandler.bind(this),seeking:this.seekingHandler.bind(this),stalled:this.stalledHandler.bind(this),suspend:this.stalledHandler.bind(this),waiting:this.stalledHandler.bind(this)},this._loadCallbackHandler=this.loadErrorHandler.bind(this),this._metadataCallbackHandler=this.metadataHandler.bind(this),this._crop=this.resetCropObject(),this.markers={},this._markerIn=0,this._markerOut=0,this._playingMarker=!1,this._lastUpdate=0,this.cacheKey="",this.isSeeking=!1,this._playCalled=!1,this._getFrame=!1,this._rfvCallbackId=0;var r=t.sys.game;this._device=r.device.video,this.setPosition(e,i),this.setSize(256,256),this.initRenderNodes(this._defaultRenderNodesMap),r.events.on(h.PAUSE,this.globalPause,this),r.events.on(h.RESUME,this.globalResume,this);var n=t.sys.sound;n&&n.on(d.GLOBAL_MUTE,this.globalMute,this),s&&this.load(s)},_defaultRenderNodesMap:{get:function(){return r}},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},load:function(t){var e=this.scene.sys.cache.video.get(t);return e?(this.cacheKey=t,this.loadHandler(e.url,e.noAudio,e.crossOrigin)):console.warn("No video in cache for key: "+t),this},changeSource:function(t,e,i,s,r){void 0===e&&(e=!0),void 0===i&&(i=!1),this.cacheKey!==t&&(this.load(t),e&&this.play(i,s,r))},getVideoKey:function(){return this.cacheKey},loadURL:function(t,e,i){void 0===e&&(e=!1);var s=this._device.getVideoURL(t);return s?(this.cacheKey="",this.loadHandler(s.url,e,i)):console.warn("No supported video format found for "+t),this},loadMediaStream:function(t,e,i){return this.loadHandler(null,e,i,t)},loadHandler:function(t,e,i,s){e||(e=!1);var r=this.video;if(r?(this.removeLoadEventHandlers(),this.stop()):((r=document.createElement("video")).controls=!1,r.setAttribute("playsinline","playsinline"),r.setAttribute("preload","auto"),r.setAttribute("disablePictureInPicture","true")),e?(r.muted=!0,r.defaultMuted=!0,r.setAttribute("autoplay","autoplay")):(r.muted=!1,r.defaultMuted=!1,r.removeAttribute("autoplay")),i?r.setAttribute("crossorigin",i):r.removeAttribute("crossorigin"),s)if("srcObject"in r)try{r.srcObject=s}catch(t){if("TypeError"!==t.name)throw t;r.src=URL.createObjectURL(s)}else r.src=URL.createObjectURL(s);else r.src=t;this.retry=0,this.video=r,this._playCalled=!1,r.load(),this.addLoadEventHandlers();var n=this.scene.sys.textures.get(this._key);return this.setTexture(n),this},requestVideoFrame:function(t,e){var i=this.video;if(i){var s=e.width,r=e.height,n=this.videoTexture,a=this.videoTextureSource,h=!n||a.source!==i;h?(this._codePaused=i.paused,this._codeMuted=i.muted,n?(a.source=i,a.width=s,a.height=r,n.get().setSize(s,r)):((n=this.scene.sys.textures.create(this._key,i,s,r)).add("__BASE",0,0,0,s,r),this.setTexture(n),this.videoTexture=n,this.videoTextureSource=n.source[0],this.videoTextureSource.setFlipY(this.glFlipY),this.emit(o.VIDEO_TEXTURE,this,n)),this.setSizeToFrame(),this.updateDisplayOrigin()):a.update(),this.isStalled=!1,this.metadata=e;var l=e.mediaTime;h&&(this._lastUpdate=l,this.emit(o.VIDEO_CREATED,this,s,r),this.frameReady||(this.frameReady=!0,this.emit(o.VIDEO_PLAY,this))),this._playingMarker?l>=this._markerOut&&(i.loop?(i.currentTime=this._markerIn,this.emit(o.VIDEO_LOOP,this)):(this.stop(!1),this.emit(o.VIDEO_COMPLETE,this))):l-1&&i>e&&i=0&&!isNaN(i)&&i>e&&(this.markers[t]=[e,i]),this},playMarker:function(t,e){var i=this.markers[t];return i&&this.play(e,i[0],i[1]),this},removeMarker:function(t){return delete this.markers[t],this},snapshot:function(t,e){return void 0===t&&(t=this.width),void 0===e&&(e=this.height),this.snapshotArea(0,0,this.width,this.height,t,e)},snapshotArea:function(t,e,i,s,r,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===s&&(s=this.height),void 0===r&&(r=i),void 0===n&&(n=s);var a=this.video,o=this.snapshotTexture;return o?(o.setSize(r,n),a&&o.context.drawImage(a,t,e,i,s,0,0,r,n)):(o=this.scene.sys.textures.createCanvas(c(),r,n),this.snapshotTexture=o,a&&o.context.drawImage(a,t,e,i,s,0,0,r,n)),o.update()},saveSnapshotTexture:function(t){return this.snapshotTexture?this.scene.sys.textures.renameTexture(this.snapshotTexture.key,t):this.snapshotTexture=this.scene.sys.textures.createCanvas(t,this.width,this.height),this.snapshotTexture},playSuccess:function(){if(this._playCalled){this.addEventHandlers(),this._codePaused=!1,this.touchLocked&&(this.touchLocked=!1,this.emit(o.VIDEO_UNLOCKED,this));var t=this.scene.sys.sound;t&&t.mute&&this.setMute(!0),this._markerIn>-1&&(this.video.currentTime=this._markerIn)}},playError:function(t){var e=t.name;"NotAllowedError"===e?(this.touchLocked=!0,this.playWhenUnlocked=!0,this.failedPlayAttempts=1,this.emit(o.VIDEO_LOCKED,this)):"NotSupportedError"===e?(this.stop(!1),this.emit(o.VIDEO_UNSUPPORTED,this,t)):(this.stop(!1),this.emit(o.VIDEO_ERROR,this,t))},legacyPlayHandler:function(){var t=this.video;t&&(this.playSuccess(),t.removeEventListener("playing",this._callbacks.legacy))},playingHandler:function(){this.isStalled=!1,this.emit(o.VIDEO_PLAYING,this)},loadErrorHandler:function(t){this.stop(!1),this.emit(o.VIDEO_ERROR,this,t)},metadataHandler:function(t){this.emit(o.VIDEO_METADATA,this,t)},setSizeToFrame:function(t){t||(t=this.frame),this.width=t.realWidth,this.height=t.realHeight,1!==this.scaleX&&(this.scaleX=this.displayWidth/this.width),1!==this.scaleY&&(this.scaleY=this.displayHeight/this.height);var e=this.input;return e&&!e.customHitArea&&(e.hitArea.width=this.width,e.hitArea.height=this.height),this},stalledHandler:function(t){this.isStalled=!0,this.emit(o.VIDEO_STALLED,this,t)},completeHandler:function(){this._playCalled=!1,this.emit(o.VIDEO_COMPLETE,this)},preUpdate:function(t,e){this.video&&this._playCalled&&this.touchLocked&&this.playWhenUnlocked&&(this.retry+=e,this.retry>=this.retryInterval&&(this.createPlayPromise(!1),this.retry=0))},seekTo:function(t){var e=this.video;if(e){var i=e.duration;if(i!==1/0&&!isNaN(i)){var s=i*t;this.setCurrentTime(s)}}return this},getCurrentTime:function(){return this.video?this.video.currentTime:0},setCurrentTime:function(t){var e=this.video;if(e){if("string"==typeof t){var i=t[0],s=parseFloat(t.substr(1));"+"===i?t=e.currentTime+s:"-"===i&&(t=e.currentTime-s)}e.currentTime=t}return this},seekingHandler:function(){this.isSeeking=!0,this.emit(o.VIDEO_SEEKING,this)},seekedHandler:function(){this.isSeeking=!1,this.emit(o.VIDEO_SEEKED,this)},getProgress:function(){var t=this.video;if(t){var e=t.duration;if(e!==1/0&&!isNaN(e))return t.currentTime/e}return-1},getDuration:function(){return this.video?this.video.duration:0},setMute:function(t){void 0===t&&(t=!0),this._codeMuted=t;var e=this.video;return e&&(e.muted=!!this._systemMuted||t),this},isMuted:function(){return this._codeMuted},globalMute:function(t,e){this._systemMuted=e;var i=this.video;i&&(i.muted=!!this._codeMuted||e)},globalPause:function(){this._systemPaused=!0,this.video&&!this.video.ended&&(this.removeEventHandlers(),this.video.pause())},globalResume:function(){this._systemPaused=!1,!this.video||this._codePaused||this.video.ended||this.createPlayPromise()},setPaused:function(t){void 0===t&&(t=!0);var e=this.video;return this._codePaused=t,e&&!e.ended&&(t?e.paused||(this.removeEventHandlers(),e.pause()):t||(this._playCalled?e.paused&&!this._systemPaused&&this.createPlayPromise():this.play())),this},pause:function(){return this.setPaused(!0)},resume:function(){return this.setPaused(!1)},getVolume:function(){return this.video?this.video.volume:1},setVolume:function(t){return void 0===t&&(t=1),this.video&&(this.video.volume=s(t,0,1)),this},getPlaybackRate:function(){return this.video?this.video.playbackRate:1},setPlaybackRate:function(t){return this.video&&(this.video.playbackRate=t),this},getLoop:function(){return!!this.video&&this.video.loop},setLoop:function(t){return void 0===t&&(t=!0),this.video&&(this.video.loop=t),this},isPlaying:function(){return!!this.video&&!(this.video.paused||this.video.ended)},isPaused:function(){return this.video&&this._playCalled&&this.video.paused||this._codePaused||this._systemPaused},saveTexture:function(t,e){return void 0===e&&(e=!0),this.videoTexture&&(this.scene.sys.textures.renameTexture(this._key,t),this.videoTextureSource.setFlipY(e)),this._key=t,this.glFlipY=e,!!this.videoTexture},stop:function(t){void 0===t&&(t=!0);var e=this.video;return e&&(this.removeEventHandlers(),e.cancelVideoFrameCallback(this._rfvCallbackId),e.pause()),this.retry=0,this._playCalled=!1,t&&this.emit(o.VIDEO_STOP,this),this},removeVideoElement:function(){var t=this.video;if(t){for(t.parentNode&&t.parentNode.removeChild(t);t.hasChildNodes();)t.removeChild(t.firstChild);t.removeAttribute("autoplay"),t.removeAttribute("src"),this.video=null}},preDestroy:function(){this.stop(!1),this.removeLoadEventHandlers(),this.removeVideoElement();var t=this.scene.sys.game.events;t.off(h.PAUSE,this.globalPause,this),t.off(h.RESUME,this.globalResume,this);var e=this.scene.sys.sound;e&&e.off(d.GLOBAL_MUTE,this.globalMute,this)}});t.exports=p},58352(t){t.exports=function(t,e,i,s){e.videoTexture&&(i.addToRenderList(e),t.batchSprite(e,e.frame,i,s))}},11511(t,e,i){var s=i(25305),r=i(44603),n=i(23568),a=i(18471);r.register("video",function(t,e){void 0===t&&(t={});var i=n(t,"key",null),r=new a(this.scene,0,0,i);return void 0!==e&&(t.add=e),s(this.scene,r,t),r})},89025(t,e,i){var s=i(18471);i(39429).register("video",function(t,e,i){return this.displayList.add(new s(this.scene,t,e,i))})},10247(t,e,i){var s=i(29747),r=s,n=s;r=i(29849),n=i(58352),t.exports={renderWebGL:r,renderCanvas:n}},29849(t){t.exports=function(t,e,i,s){if(e.videoTexture){i.camera.addToRenderList(e);var r=e.customRenderNodes,n=e.defaultRenderNodes;(r.Submitter||n.Submitter).run(i,e,s,0,r.Texturer||n.Texturer,r.Transformer||n.Transformer)}}},41481(t,e,i){t.exports=i(58715).default},95261(t,e,i){var s=i(44603),r=i(23568),n=i(41481);s.register("zone",function(t){var e=r(t,"x",0),i=r(t,"y",0),s=r(t,"width",1),a=r(t,"height",s);return new n(this.scene,e,i,s,a)})},84175(t,e,i){var s=i(41481);i(39429).register("zone",function(t,e,i,r){return this.displayList.add(new s(this.scene,t,e,i,r))})},95166(t){t.exports=function(t){return t.radius>0?Math.PI*t.radius*t.radius:0}},96503(t,e,i){var s=i(83419),r=i(87902),n=i(26241),a=i(79124),o=i(23777),h=i(28176),l=new s({initialize:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this.type=o.CIRCLE,this.x=t,this.y=e,this._radius=i,this._diameter=2*i},contains:function(t,e){return r(this,t,e)},getPoint:function(t,e){return n(this,t,e)},getPoints:function(t,e,i){return a(this,t,e,i)},getRandomPoint:function(t){return h(this,t)},setTo:function(t,e,i){return this.x=t,this.y=e,this._radius=i,this._diameter=2*i,this},setEmpty:function(){return this._radius=0,this._diameter=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},isEmpty:function(){return this._radius<=0},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this._diameter=2*t}},diameter:{get:function(){return this._diameter},set:function(t){this._diameter=t,this._radius=.5*t}},left:{get:function(){return this.x-this._radius},set:function(t){this.x=t+this._radius}},right:{get:function(){return this.x+this._radius},set:function(t){this.x=t-this._radius}},top:{get:function(){return this.y-this._radius},set:function(t){this.y=t+this._radius}},bottom:{get:function(){return this.y+this._radius},set:function(t){this.y=t-this._radius}}});t.exports=l},71562(t){t.exports=function(t){return Math.PI*t.radius*2}},92110(t,e,i){var s=i(26099);t.exports=function(t,e,i){return void 0===i&&(i=new s),i.x=t.x+t.radius*Math.cos(e),i.y=t.y+t.radius*Math.sin(e),i}},42250(t,e,i){var s=i(96503);t.exports=function(t){return new s(t.x,t.y,t.radius)}},87902(t){t.exports=function(t,e,i){return t.radius>0&&e>=t.left&&e<=t.right&&i>=t.top&&i<=t.bottom&&(t.x-e)*(t.x-e)+(t.y-i)*(t.y-i)<=t.radius*t.radius}},5698(t,e,i){var s=i(87902);t.exports=function(t,e){return s(t,e.x,e.y)}},70588(t,e,i){var s=i(87902);t.exports=function(t,e){return s(t,e.x,e.y)&&s(t,e.right,e.y)&&s(t,e.x,e.bottom)&&s(t,e.right,e.bottom)}},26394(t){t.exports=function(t,e){return e.setTo(t.x,t.y,t.radius)}},76278(t){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.radius===e.radius}},2074(t,e,i){var s=i(87841);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.left,e.y=t.top,e.width=t.diameter,e.height=t.diameter,e}},26241(t,e,i){var s=i(92110),r=i(62945),n=i(36383),a=i(26099);t.exports=function(t,e,i){void 0===i&&(i=new a);var o=r(e,0,n.TAU);return s(t,o,i)}},79124(t,e,i){var s=i(71562),r=i(92110),n=i(62945),a=i(36383);t.exports=function(t,e,i,o){void 0===o&&(o=[]),!e&&i>0&&(e=s(t)/i);for(var h=0;h1?2-r:r,a=n*Math.cos(i),o=n*Math.sin(i);return e.x=t.x+a*t.radius,e.y=t.y+o*t.radius,e}},88911(t,e,i){var s=i(96503);s.Area=i(95166),s.Circumference=i(71562),s.CircumferencePoint=i(92110),s.Clone=i(42250),s.Contains=i(87902),s.ContainsPoint=i(5698),s.ContainsRect=i(70588),s.CopyFrom=i(26394),s.Equals=i(76278),s.GetBounds=i(2074),s.GetPoint=i(26241),s.GetPoints=i(79124),s.Offset=i(50884),s.OffsetPoint=i(39212),s.Random=i(28176),t.exports=s},23777(t){t.exports={CIRCLE:0,ELLIPSE:1,LINE:2,POINT:3,POLYGON:4,RECTANGLE:5,TRIANGLE:6}},78874(t){t.exports=function(t){return t.isEmpty()?0:t.getMajorRadius()*t.getMinorRadius()*Math.PI}},92990(t){t.exports=function(t){var e=t.width/2,i=t.height/2,s=Math.pow(e-i,2)/Math.pow(e+i,2);return Math.PI*(e+i)*(1+3*s/(10+Math.sqrt(4-3*s)))}},79522(t,e,i){var s=i(26099);t.exports=function(t,e,i){void 0===i&&(i=new s);var r=t.width/2,n=t.height/2;return i.x=t.x+r*Math.cos(e),i.y=t.y+n*Math.sin(e),i}},58102(t,e,i){var s=i(8497);t.exports=function(t){return new s(t.x,t.y,t.width,t.height)}},81154(t){t.exports=function(t,e,i){if(t.width<=0||t.height<=0)return!1;var s=(e-t.x)/t.width,r=(i-t.y)/t.height;return(s*=s)+(r*=r)<.25}},46662(t,e,i){var s=i(81154);t.exports=function(t,e){return s(t,e.x,e.y)}},1632(t,e,i){var s=i(81154);t.exports=function(t,e){return s(t,e.x,e.y)&&s(t,e.right,e.y)&&s(t,e.x,e.bottom)&&s(t,e.right,e.bottom)}},65534(t){t.exports=function(t,e){return e.setTo(t.x,t.y,t.width,t.height)}},8497(t,e,i){var s=i(83419),r=i(81154),n=i(90549),a=i(48320),o=i(23777),h=i(24820),l=new s({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.type=o.ELLIPSE,this.x=t,this.y=e,this.width=i,this.height=s},contains:function(t,e){return r(this,t,e)},getPoint:function(t,e){return n(this,t,e)},getPoints:function(t,e,i){return a(this,t,e,i)},getRandomPoint:function(t){return h(this,t)},setTo:function(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this},setEmpty:function(){return this.width=0,this.height=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getMinorRadius:function(){return Math.min(this.width,this.height)/2},getMajorRadius:function(){return Math.max(this.width,this.height)/2},left:{get:function(){return this.x-this.width/2},set:function(t){this.x=t+this.width/2}},right:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},top:{get:function(){return this.y-this.height/2},set:function(t){this.y=t+this.height/2}},bottom:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=l},36146(t){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}},23694(t,e,i){var s=i(87841);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.left,e.y=t.top,e.width=t.width,e.height=t.height,e}},90549(t,e,i){var s=i(79522),r=i(62945),n=i(36383),a=i(26099);t.exports=function(t,e,i){void 0===i&&(i=new a);var o=r(e,0,n.TAU);return s(t,o,i)}},48320(t,e,i){var s=i(92990),r=i(79522),n=i(62945),a=i(36383);t.exports=function(t,e,i,o){void 0===o&&(o=[]),!e&&i>0&&(e=s(t)/i);for(var h=0;ha||n>o)return!1;if(r<=i||n<=s)return!0;var h=r-i,l=n-s;return h*h+l*l<=t.radius*t.radius}},63376(t,e,i){var s=i(26099),r=i(2044);t.exports=function(t,e,i){if(void 0===i&&(i=[]),r(t,e)){var n,a,o,h,l=t.x,u=t.y,d=t.radius,c=e.x,f=e.y,p=e.radius;if(u===f)0===(o=(a=-2*f)*a-4*(n=1)*(c*c+(h=(p*p-d*d-c*c+l*l)/(2*(l-c)))*h-2*c*h+f*f-p*p))?i.push(new s(h,-a/(2*n))):o>0&&(i.push(new s(h,(-a+Math.sqrt(o))/(2*n))),i.push(new s(h,(-a-Math.sqrt(o))/(2*n))));else{var m=(l-c)/(u-f),g=(p*p-d*d-c*c+l*l-f*f+u*u)/(2*(u-f));0===(o=(a=2*u*m-2*g*m-2*l)*a-4*(n=m*m+1)*(l*l+u*u+g*g-d*d-2*u*g))?(h=-a/(2*n),i.push(new s(h,g-h*m))):o>0&&(h=(-a+Math.sqrt(o))/(2*n),i.push(new s(h,g-h*m)),h=(-a-Math.sqrt(o))/(2*n),i.push(new s(h,g-h*m)))}}return i}},97439(t,e,i){var s=i(4042),r=i(81491);t.exports=function(t,e,i){if(void 0===i&&(i=[]),r(t,e)){var n=e.getLineA(),a=e.getLineB(),o=e.getLineC(),h=e.getLineD();s(n,t,i),s(a,t,i),s(o,t,i),s(h,t,i)}return i}},4042(t,e,i){var s=i(26099),r=i(80462);t.exports=function(t,e,i){if(void 0===i&&(i=[]),r(t,e)){var n,a,o=t.x1,h=t.y1,l=t.x2,u=t.y2,d=e.x,c=e.y,f=e.radius,p=l-o,m=u-h,g=o-d,v=h-c,x=p*p+m*m,y=2*(p*g+m*v),T=y*y-4*x*(g*g+v*v-f*f);if(0===T){var w=-y/(2*x);n=o+w*p,a=h+w*m,w>=0&&w<=1&&i.push(new s(n,a))}else if(T>0){var S=(-y-Math.sqrt(T))/(2*x);n=o+S*p,a=h+S*m,S>=0&&S<=1&&i.push(new s(n,a));var b=(-y+Math.sqrt(T))/(2*x);n=o+b*p,a=h+b*m,b>=0&&b<=1&&i.push(new s(n,a))}}return i}},36100(t,e,i){var s=i(25836);t.exports=function(t,e,i,r){void 0===i&&(i=!1);var n,a,o,h=t.x1,l=t.y1,u=t.x2,d=t.y2,c=e.x1,f=e.y1,p=u-h,m=d-l,g=e.x2-c,v=e.y2-f,x=p*v-m*g;if(0===x)return null;if(i){if(n=(p*(f-l)+m*(h-c))/(g*m-v*p),0!==p)a=(c+g*n-h)/p;else{if(0===m)return null;a=(f+v*n-l)/m}if(a<0||n<0||n>1)return null;o=a}else{if(a=((l-f)*p-(h-c)*m)/x,(n=((c-h)*v-(f-l)*g)/x)<0||n>1||a<0||a>1)return null;o=n}return void 0===r&&(r=new s),r.set(h+p*o,l+m*o,o)}},3073(t,e,i){var s=i(36100),r=i(23031),n=i(25836),a=new r,o=new n;t.exports=function(t,e,i,r){void 0===i&&(i=!1),void 0===r&&(r=new n);var h=!1;r.set(),o.set();for(var l=e[e.length-1],u=0;u0){var c=(o*n+h*a)/l;u*=c,d*=c}return i.x=t.x1+u,i.y=t.y1+d,u*u+d*d<=l&&u*n+d*a>=0&&s(e,i.x,i.y)}},76112(t){t.exports=function(t,e,i){var s=t.x1,r=t.y1,n=t.x2,a=t.y2,o=e.x1,h=e.y1,l=e.x2,u=e.y2;if(s===n&&r===a||o===l&&h===u)return!1;var d=(u-h)*(n-s)-(l-o)*(a-r);if(0===d)return!1;var c=((l-o)*(r-h)-(u-h)*(s-o))/d,f=((n-s)*(r-h)-(a-r)*(s-o))/d;return!(c<0||c>1||f<0||f>1)&&(i&&(i.x=s+c*(n-s),i.y=r+c*(a-r)),!0)}},92773(t){t.exports=function(t,e){var i=t.x1,s=t.y1,r=t.x2,n=t.y2,a=e.x,o=e.y,h=e.right,l=e.bottom,u=0;if(i>=a&&i<=h&&s>=o&&s<=l||r>=a&&r<=h&&n>=o&&n<=l)return!0;if(i=a){if((u=s+(n-s)*(a-i)/(r-i))>o&&u<=l)return!0}else if(i>h&&r<=h&&(u=s+(n-s)*(h-i)/(r-i))>=o&&u<=l)return!0;if(s=o){if((u=i+(r-i)*(o-s)/(n-s))>=a&&u<=h)return!0}else if(s>l&&n<=l&&(u=i+(r-i)*(l-s)/(n-s))>=a&&u<=h)return!0;return!1}},16204(t){t.exports=function(t,e,i){void 0===i&&(i=1);var s=e.x1,r=e.y1,n=e.x2,a=e.y2,o=t.x,h=t.y,l=(n-s)*(n-s)+(a-r)*(a-r);if(0===l)return!1;var u=((o-s)*(n-s)+(h-r)*(a-r))/l;if(u<0)return Math.sqrt((s-o)*(s-o)+(r-h)*(r-h))<=i;if(u>=0&&u<=1){var d=((r-h)*(n-s)-(s-o)*(a-r))/l;return Math.abs(d)*Math.sqrt(l)<=i}return Math.sqrt((n-o)*(n-o)+(a-h)*(a-h))<=i}},14199(t,e,i){var s=i(16204);t.exports=function(t,e){if(!s(t,e))return!1;var i=Math.min(e.x1,e.x2),r=Math.max(e.x1,e.x2),n=Math.min(e.y1,e.y2),a=Math.max(e.y1,e.y2);return t.x>=i&&t.x<=r&&t.y>=n&&t.y<=a}},59996(t){t.exports=function(t,e){return!(t.width<=0||t.height<=0||e.width<=0||e.height<=0)&&!(t.righte.right||t.y>e.bottom)}},89265(t,e,i){var s=i(76112),r=i(37303),n=i(48653),a=i(77493);t.exports=function(t,e){if(e.left>t.right||e.rightt.bottom||e.bottom0}},84411(t){t.exports=function(t,e,i,s,r,n){return void 0===n&&(n=0),!(e>t.right+n||it.bottom+n||re.right||t.righte.bottom||t.bottome.right||t.righte.bottom||t.bottom0||(d=r(e),(c=s(t,d,!0)).length>0)}},91865(t,e,i){t.exports={CircleToCircle:i(2044),CircleToRectangle:i(81491),GetCircleToCircle:i(63376),GetCircleToRectangle:i(97439),GetLineToCircle:i(4042),GetLineToLine:i(36100),GetLineToPoints:i(3073),GetLineToPolygon:i(56362),GetLineToRectangle:i(60646),GetRaysFromPointToPolygon:i(71147),GetRectangleIntersection:i(68389),GetRectangleToRectangle:i(52784),GetRectangleToTriangle:i(26341),GetTriangleToCircle:i(38720),GetTriangleToLine:i(13882),GetTriangleToTriangle:i(75636),LineToCircle:i(80462),LineToLine:i(76112),LineToRectangle:i(92773),PointToLine:i(16204),PointToLineSegment:i(14199),RectangleToRectangle:i(59996),RectangleToTriangle:i(89265),RectangleToValues:i(84411),TriangleToCircle:i(67636),TriangleToLine:i(2822),TriangleToTriangle:i(82944)}},91938(t){t.exports=function(t){return Math.atan2(t.y2-t.y1,t.x2-t.x1)}},84993(t){t.exports=function(t,e,i){void 0===e&&(e=1),void 0===i&&(i=[]);var s=Math.round(t.x1),r=Math.round(t.y1),n=Math.round(t.x2),a=Math.round(t.y2),o=Math.abs(n-s),h=Math.abs(a-r),l=s-h&&(d-=h,s+=l),f0){var v=u[0],x=[v];for(h=1;h=a&&(x.push(y),v=y)}var T=u[u.length-1];return s(v,T)0&&(e=s(t)/i);for(var a=t.x1,o=t.y1,h=t.x2,l=t.y2,u=0;uthis.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=l},64795(t,e,i){var s=i(36383),r=i(15994),n=i(91938);t.exports=function(t){var e=n(t)-s.PI_OVER_2;return r(e,-Math.PI,Math.PI)}},52616(t,e,i){var s=i(36383),r=i(91938);t.exports=function(t){return Math.cos(r(t)-s.PI_OVER_2)}},87231(t,e,i){var s=i(36383),r=i(91938);t.exports=function(t){return Math.sin(r(t)-s.PI_OVER_2)}},89662(t){t.exports=function(t,e,i){return t.x1+=e,t.y1+=i,t.x2+=e,t.y2+=i,t}},71165(t){t.exports=function(t){return-(t.x2-t.x1)/(t.y2-t.y1)}},65822(t,e,i){var s=i(26099);t.exports=function(t,e){void 0===e&&(e=new s);var i=Math.random();return e.x=t.x1+i*(t.x2-t.x1),e.y=t.y1+i*(t.y2-t.y1),e}},69777(t,e,i){var s=i(91938),r=i(64795);t.exports=function(t,e){return 2*r(e)-Math.PI-s(t)}},39706(t,e,i){var s=i(64400);t.exports=function(t,e){var i=(t.x1+t.x2)/2,r=(t.y1+t.y2)/2;return s(t,i,r,e)}},82585(t,e,i){var s=i(64400);t.exports=function(t,e,i){return s(t,e.x,e.y,i)}},64400(t){t.exports=function(t,e,i,s){var r=Math.cos(s),n=Math.sin(s),a=t.x1-e,o=t.y1-i;return t.x1=a*r-o*n+e,t.y1=a*n+o*r+i,a=t.x2-e,o=t.y2-i,t.x2=a*r-o*n+e,t.y2=a*n+o*r+i,t}},62377(t){t.exports=function(t,e,i,s,r){return t.x1=e,t.y1=i,t.x2=e+Math.cos(s)*r,t.y2=i+Math.sin(s)*r,t}},71366(t){t.exports=function(t){return(t.y2-t.y1)/(t.x2-t.x1)}},10809(t){t.exports=function(t){return Math.abs(t.x1-t.x2)}},2529(t,e,i){var s=i(23031);s.Angle=i(91938),s.BresenhamPoints=i(84993),s.CenterOn=i(36469),s.Clone=i(31116),s.CopyFrom=i(59944),s.Equals=i(59220),s.Extend=i(78177),s.GetEasedPoints=i(26708),s.GetMidPoint=i(32125),s.GetNearestPoint=i(99569),s.GetNormal=i(34638),s.GetPoint=i(13151),s.GetPoints=i(15258),s.GetShortestDistance=i(26408),s.Height=i(98770),s.Length=i(35001),s.NormalAngle=i(64795),s.NormalX=i(52616),s.NormalY=i(87231),s.Offset=i(89662),s.PerpSlope=i(71165),s.Random=i(65822),s.ReflectAngle=i(69777),s.Rotate=i(39706),s.RotateAroundPoint=i(82585),s.RotateAroundXY=i(64400),s.SetToAngle=i(62377),s.Slope=i(71366),s.Width=i(10809),t.exports=s},12306(t,e,i){var s=i(25717);t.exports=function(t){return new s(t.points)}},63814(t){t.exports=function(t,e,i){for(var s=!1,r=-1,n=t.points.length-1;++r80*s){n=o=t[0],a=h=t[1];for(var y=s;yo&&(o=d),c>h&&(h=c);p=0!==(p=Math.max(o-n,h-a))?32767/p:0}return r(v,x,s,n,a,p,0),x}function i(t,e,i,s,r){var n,a;if(r===A(t,e,i,s)>0)for(n=e;n=e;n-=s)a=b(n,t[n],t[n+1],a);return a&&v(a,a.next)&&(E(a),a=a.next),a}function s(t,e){if(!t)return t;e||(e=t);var i,s=t;do{if(i=!1,s.steiner||!v(s,s.next)&&0!==g(s.prev,s,s.next))s=s.next;else{if(E(s),(s=e=s.prev)===s.next)break;i=!0}}while(i||s!==e);return e}function r(t,e,i,l,u,d,f){if(t){!f&&d&&function(t,e,i,s){var r=t;do{0===r.z&&(r.z=c(r.x,r.y,e,i,s)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){var e,i,s,r,n,a,o,h,l=1;do{for(i=t,t=null,n=null,a=0;i;){for(a++,s=i,o=0,e=0;e0||h>0&&s;)0!==o&&(0===h||!s||i.z<=s.z)?(r=i,i=i.nextZ,o--):(r=s,s=s.nextZ,h--),n?n.nextZ=r:t=r,r.prevZ=n,n=r;i=s}n.nextZ=null,l*=2}while(a>1)}(r)}(t,l,u,d);for(var p,m,g=t;t.prev!==t.next;)if(p=t.prev,m=t.next,d?a(t,l,u,d):n(t))e.push(p.i/i|0),e.push(t.i/i|0),e.push(m.i/i|0),E(t),t=m.next,g=m.next;else if((t=m)===g){f?1===f?r(t=o(s(t),e,i),e,i,l,u,d,2):2===f&&h(t,e,i,l,u,d):r(s(t),e,i,l,u,d,1);break}}}function n(t){var e=t.prev,i=t,s=t.next;if(g(e,i,s)>=0)return!1;for(var r=e.x,n=i.x,a=s.x,o=e.y,h=i.y,l=s.y,u=rn?r>a?r:a:n>a?n:a,f=o>h?o>l?o:l:h>l?h:l,m=s.next;m!==e;){if(m.x>=u&&m.x<=c&&m.y>=d&&m.y<=f&&p(r,o,n,h,a,l,m.x,m.y)&&g(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function a(t,e,i,s){var r=t.prev,n=t,a=t.next;if(g(r,n,a)>=0)return!1;for(var o=r.x,h=n.x,l=a.x,u=r.y,d=n.y,f=a.y,m=oh?o>l?o:l:h>l?h:l,y=u>d?u>f?u:f:d>f?d:f,T=c(m,v,e,i,s),w=c(x,y,e,i,s),S=t.prevZ,b=t.nextZ;S&&S.z>=T&&b&&b.z<=w;){if(S.x>=m&&S.x<=x&&S.y>=v&&S.y<=y&&S!==r&&S!==a&&p(o,u,h,d,l,f,S.x,S.y)&&g(S.prev,S,S.next)>=0)return!1;if(S=S.prevZ,b.x>=m&&b.x<=x&&b.y>=v&&b.y<=y&&b!==r&&b!==a&&p(o,u,h,d,l,f,b.x,b.y)&&g(b.prev,b,b.next)>=0)return!1;b=b.nextZ}for(;S&&S.z>=T;){if(S.x>=m&&S.x<=x&&S.y>=v&&S.y<=y&&S!==r&&S!==a&&p(o,u,h,d,l,f,S.x,S.y)&&g(S.prev,S,S.next)>=0)return!1;S=S.prevZ}for(;b&&b.z<=w;){if(b.x>=m&&b.x<=x&&b.y>=v&&b.y<=y&&b!==r&&b!==a&&p(o,u,h,d,l,f,b.x,b.y)&&g(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function o(t,e,i){var r=t;do{var n=r.prev,a=r.next.next;!v(n,a)&&x(n,r,r.next,a)&&w(n,a)&&w(a,n)&&(e.push(n.i/i|0),e.push(r.i/i|0),e.push(a.i/i|0),E(r),E(r.next),r=t=a),r=r.next}while(r!==t);return s(r)}function h(t,e,i,n,a,o){var h=t;do{for(var l=h.next.next;l!==h.prev;){if(h.i!==l.i&&m(h,l)){var u=S(h,l);return h=s(h,h.next),u=s(u,u.next),r(h,e,i,n,a,o,0),void r(u,e,i,n,a,o,0)}l=l.next}h=h.next}while(h!==t)}function l(t,e){return t.x-e.x}function u(t,e){var i=function(t,e){var i,s=e,r=t.x,n=t.y,a=-1/0;do{if(n<=s.y&&n>=s.next.y&&s.next.y!==s.y){var o=s.x+(n-s.y)*(s.next.x-s.x)/(s.next.y-s.y);if(o<=r&&o>a&&(a=o,i=s.x=s.x&&s.x>=u&&r!==s.x&&p(ni.x||s.x===i.x&&d(i,s)))&&(i=s,f=h)),s=s.next}while(s!==l);return i}(t,e);if(!i)return e;var r=S(i,t);return s(r,r.next),s(i,i.next)}function d(t,e){return g(t.prev,t,e.prev)<0&&g(e.next,t,t.next)<0}function c(t,e,i,s,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-s)*r|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function f(t){var e=t,i=t;do{(e.x=(t-a)*(n-o)&&(t-a)*(s-o)>=(i-a)*(e-o)&&(i-a)*(n-o)>=(r-a)*(s-o)}function m(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&x(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(w(t,e)&&w(e,t)&&function(t,e){var i=t,s=!1,r=(t.x+e.x)/2,n=(t.y+e.y)/2;do{i.y>n!=i.next.y>n&&i.next.y!==i.y&&r<(i.next.x-i.x)*(n-i.y)/(i.next.y-i.y)+i.x&&(s=!s),i=i.next}while(i!==t);return s}(t,e)&&(g(t.prev,t,e.prev)||g(t,e.prev,e))||v(t,e)&&g(t.prev,t,t.next)>0&&g(e.prev,e,e.next)>0)}function g(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function v(t,e){return t.x===e.x&&t.y===e.y}function x(t,e,i,s){var r=T(g(t,e,i)),n=T(g(t,e,s)),a=T(g(i,s,t)),o=T(g(i,s,e));return r!==n&&a!==o||(!(0!==r||!y(t,i,e))||(!(0!==n||!y(t,s,e))||(!(0!==a||!y(i,t,s))||!(0!==o||!y(i,e,s)))))}function y(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function T(t){return t>0?1:t<0?-1:0}function w(t,e){return g(t.prev,t,t.next)<0?g(t,e,t.next)>=0&&g(t,t.prev,e)>=0:g(t,e,t.prev)<0||g(t,t.next,e)<0}function S(t,e){var i=new C(t.i,t.x,t.y),s=new C(e.i,e.x,e.y),r=t.next,n=e.prev;return t.next=e,e.prev=t,i.next=r,r.prev=i,s.next=i,i.prev=s,n.next=s,s.prev=n,s}function b(t,e,i,s){var r=new C(t,e,i);return s?(r.next=s.next,r.prev=s,s.next.prev=r,s.next=r):(r.prev=r,r.next=r),r}function E(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function C(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function A(t,e,i,s){for(var r=0,n=e,a=i-s;n0&&(s+=t[r-1].length,i.holes.push(s))}return i},t.exports=e},13829(t,e,i){var s=i(87841);t.exports=function(t,e){void 0===e&&(e=new s);for(var i,r=1/0,n=1/0,a=-r,o=-n,h=0;h0&&(e=h/i);for(var l=0;ld+g)){var v=m.getPoint((u-d)/g);a.push(v);break}d+=g}return a}},30052(t,e,i){var s=i(35001),r=i(23031);t.exports=function(t){for(var e=t.points,i=0,n=0;n1?(s=i.x,r=i.y):o>0&&(s+=n*o,r+=a*o)}return(n=t.x-s)*n+(a=t.y-r)*a}function s(t,e,r,n,a){for(var o,h=n,l=e+1;lh&&(o=l,h=u)}h>n&&(o-e>1&&s(t,e,o,n,a),a.push(t[o]),r-o>1&&s(t,o,r,n,a))}function r(t,e){var i=t.length-1,r=[t[0]];return s(t,0,i,e,r),r.push(t[i]),r}t.exports=function(t,i,s){void 0===i&&(i=1),void 0===s&&(s=!1);var n=t.points;if(n.length>2){var a=i*i;s||(n=function(t,i){for(var s,r=t[0],n=[r],a=1,o=t.length;ai&&(n.push(s),r=s);return r!==s&&n.push(s),n}(n,a)),t.setTo(r(n,a))}return t}},5469(t){var e=function(t,e){return t[0]=e[0],t[1]=e[1],t};t.exports=function(t){var i,s=[],r=t.points;for(i=0;i0&&n.push(e([0,0],s[0])),i=0;i1&&n.push(e([0,0],s[s.length-1])),t.setTo(n)}},24709(t){t.exports=function(t,e,i){for(var s=t.points,r=0;rt.width*t.height)&&(e.x>t.x&&e.xt.x&&e.rightt.y&&e.yt.y&&e.bottoms(e)?t.setSize(e.height*i,e.height):t.setSize(e.width,e.width/i),t.setPosition(e.centerX-t.width/2,e.centerY-t.height/2)}},80774(t){t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t}},83859(t){t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t.width=Math.floor(t.width),t.height=Math.floor(t.height),t}},19217(t,e,i){var s=i(87841),r=i(36383);t.exports=function(t,e){if(void 0===e&&(e=new s),0===t.length)return e;for(var i,n,a,o=Number.MAX_VALUE,h=Number.MAX_VALUE,l=r.MIN_SAFE_INTEGER,u=r.MIN_SAFE_INTEGER,d=0;d=1)return i.x=t.x,i.y=t.y,i;var n=s(t)*e;return e>.5?(n-=t.width+t.height)<=t.width?(i.x=t.right-n,i.y=t.bottom):(i.x=t.x,i.y=t.bottom-(n-t.width)):n<=t.width?(i.x=t.x+n,i.y=t.y):(i.x=t.right,i.y=t.y+(n-t.width)),i}},34819(t,e,i){var s=i(20812),r=i(13019);t.exports=function(t,e,i,n){void 0===n&&(n=[]),!e&&i>0&&(e=r(t)/i);for(var a=0;a=t.right&&(h=1,o+=a-t.right,a=t.right);break;case 1:(o+=e)>=t.bottom&&(h=2,a-=o-t.bottom,o=t.bottom);break;case 2:(a-=e)<=t.left&&(h=3,o-=t.left-a,a=t.left);break;case 3:(o-=e)<=t.top&&(h=0,o=t.top)}return n}},33595(t){t.exports=function(t,e){for(var i=t.x,s=t.right,r=t.y,n=t.bottom,a=0;ae.x&&t.ye.y}},13019(t){t.exports=function(t){return 2*(t.width+t.height)}},85133(t,e,i){var s=i(26099),r=i(39506);t.exports=function(t,e,i){void 0===i&&(i=new s),e=r(e);var n=Math.sin(e),a=Math.cos(e),o=a>0?t.width/2:t.width/-2,h=n>0?t.height/2:t.height/-2;return Math.abs(o*n)=0&&v>=0&&g+v<1}},48653(t){t.exports=function(t,e,i,s){void 0===i&&(i=!1),void 0===s&&(s=[]);for(var r,n,a,o,h,l,u=t.x3-t.x1,d=t.y3-t.y1,c=t.x2-t.x1,f=t.y2-t.y1,p=u*u+d*d,m=u*c+d*f,g=c*c+f*f,v=p*g-m*m,x=0===v?0:1/v,y=t.x1,T=t.y1,w=0;w=0&&n>=0&&r+n<1&&(s.push({x:e[w].x,y:e[w].y}),i)));w++);return s}},96006(t,e,i){var s=i(10690);t.exports=function(t,e){return s(t,e.x,e.y)}},71326(t){t.exports=function(t,e){return e.setTo(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)}},71694(t){t.exports=function(t,e){return void 0===e&&(e=[]),e.push({x:t.x1,y:t.y1}),e.push({x:t.x2,y:t.y2}),e.push({x:t.x3,y:t.y3}),e}},33522(t){t.exports=function(t,e){return t.x1===e.x1&&t.y1===e.y1&&t.x2===e.x2&&t.y2===e.y2&&t.x3===e.x3&&t.y3===e.y3}},20437(t,e,i){var s=i(26099),r=i(35001);t.exports=function(t,e,i){void 0===i&&(i=new s);var n=t.getLineA(),a=t.getLineB(),o=t.getLineC();if(e<=0||e>=1)return i.x=n.x1,i.y=n.y1,i;var h=r(n),l=r(a),u=r(o),d=(h+l+u)*e,c=0;return dh+l?(c=(d-=h+l)/u,i.x=o.x1+(o.x2-o.x1)*c,i.y=o.y1+(o.y2-o.y1)*c):(c=(d-=h)/l,i.x=a.x1+(a.x2-a.x1)*c,i.y=a.y1+(a.y2-a.y1)*c),i}},80672(t,e,i){var s=i(35001),r=i(26099);t.exports=function(t,e,i,n){void 0===n&&(n=[]);var a=t.getLineA(),o=t.getLineB(),h=t.getLineC(),l=s(a),u=s(o),d=s(h),c=l+u+d;!e&&i>0&&(e=c/i);for(var f=0;fl+u?(m=(p-=l+u)/d,g.x=h.x1+(h.x2-h.x1)*m,g.y=h.y1+(h.y2-h.y1)*m):(m=(p-=l)/u,g.x=o.x1+(o.x2-o.x1)*m,g.y=o.y1+(o.y2-o.y1)*m),n.push(g)}return n}},39757(t,e,i){var s=i(26099);function r(t,e,i,s){var r=t-i,n=e-s,a=r*r+n*n;return Math.sqrt(a)}t.exports=function(t,e){void 0===e&&(e=new s);var i=t.x1,n=t.y1,a=t.x2,o=t.y2,h=t.x3,l=t.y3,u=r(h,l,a,o),d=r(i,n,h,l),c=r(a,o,i,n),f=u+d+c;return e.x=(i*u+a*d+h*c)/f,e.y=(n*u+o*d+l*c)/f,e}},13584(t){t.exports=function(t,e,i){return t.x1+=e,t.y1+=i,t.x2+=e,t.y2+=i,t.x3+=e,t.y3+=i,t}},1376(t,e,i){var s=i(35001);t.exports=function(t){var e=t.getLineA(),i=t.getLineB(),r=t.getLineC();return s(e)+s(i)+s(r)}},90260(t,e,i){var s=i(26099);t.exports=function(t,e){void 0===e&&(e=new s);var i=t.x2-t.x1,r=t.y2-t.y1,n=t.x3-t.x1,a=t.y3-t.y1,o=Math.random(),h=Math.random();return o+h>=1&&(o=1-o,h=1-h),e.x=t.x1+(i*o+n*h),e.y=t.y1+(r*o+a*h),e}},52172(t,e,i){var s=i(99614),r=i(39757);t.exports=function(t,e){var i=r(t);return s(t,i.x,i.y,e)}},49907(t,e,i){var s=i(99614);t.exports=function(t,e,i){return s(t,e.x,e.y,i)}},99614(t){t.exports=function(t,e,i,s){var r=Math.cos(s),n=Math.sin(s),a=t.x1-e,o=t.y1-i;return t.x1=a*r-o*n+e,t.y1=a*n+o*r+i,a=t.x2-e,o=t.y2-i,t.x2=a*r-o*n+e,t.y2=a*n+o*r+i,a=t.x3-e,o=t.y3-i,t.x3=a*r-o*n+e,t.y3=a*n+o*r+i,t}},16483(t,e,i){var s=i(83419),r=i(10690),n=i(20437),a=i(80672),o=i(23777),h=i(23031),l=i(90260),u=new s({initialize:function(t,e,i,s,r,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===r&&(r=0),void 0===n&&(n=0),this.type=o.TRIANGLE,this.x1=t,this.y1=e,this.x2=i,this.y2=s,this.x3=r,this.y3=n},contains:function(t,e){return r(this,t,e)},getPoint:function(t,e){return n(this,t,e)},getPoints:function(t,e,i){return a(this,t,e,i)},getRandomPoint:function(t){return l(this,t)},setTo:function(t,e,i,s,r,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===r&&(r=0),void 0===n&&(n=0),this.x1=t,this.y1=e,this.x2=i,this.y2=s,this.x3=r,this.y3=n,this},getLineA:function(t){return void 0===t&&(t=new h),t.setTo(this.x1,this.y1,this.x2,this.y2),t},getLineB:function(t){return void 0===t&&(t=new h),t.setTo(this.x2,this.y2,this.x3,this.y3),t},getLineC:function(t){return void 0===t&&(t=new h),t.setTo(this.x3,this.y3,this.x1,this.y1),t},left:{get:function(){return Math.min(this.x1,this.x2,this.x3)},set:function(t){var e=0;e=this.x1<=this.x2&&this.x1<=this.x3?this.x1-t:this.x2<=this.x1&&this.x2<=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},right:{get:function(){return Math.max(this.x1,this.x2,this.x3)},set:function(t){var e=0;e=this.x1>=this.x2&&this.x1>=this.x3?this.x1-t:this.x2>=this.x1&&this.x2>=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},top:{get:function(){return Math.min(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1<=this.y2&&this.y1<=this.y3?this.y1-t:this.y2<=this.y1&&this.y2<=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}},bottom:{get:function(){return Math.max(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1>=this.y2&&this.y1>=this.y3?this.y1-t:this.y2>=this.y1&&this.y2>=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}}});t.exports=u},84435(t,e,i){var s=i(16483);s.Area=i(41658),s.BuildEquilateral=i(39208),s.BuildFromPolygon=i(39545),s.BuildRight=i(90301),s.CenterOn=i(23707),s.Centroid=i(97523),s.CircumCenter=i(24951),s.CircumCircle=i(85614),s.Clone=i(74422),s.Contains=i(10690),s.ContainsArray=i(48653),s.ContainsPoint=i(96006),s.CopyFrom=i(71326),s.Decompose=i(71694),s.Equals=i(33522),s.GetPoint=i(20437),s.GetPoints=i(80672),s.InCenter=i(39757),s.Perimeter=i(1376),s.Offset=i(13584),s.Random=i(90260),s.Rotate=i(52172),s.RotateAroundPoint=i(49907),s.RotateAroundXY=i(99614),t.exports=s},74457(t){t.exports=function(t,e,i){return{gameObject:t,enabled:!0,draggable:!1,dropZone:!1,cursor:!1,target:null,camera:null,hitArea:e,hitAreaCallback:i,hitAreaDebug:null,customHitArea:!1,localX:0,localY:0,dragState:0,dragStartX:0,dragStartY:0,dragStartXGlobal:0,dragStartYGlobal:0,dragStartCamera:null,dragX:0,dragY:0}}},84409(t){t.exports=function(t,e){return function(i,s,r,n){var a=t.getPixelAlpha(s,r,n.texture.key,n.frame.name);return a&&a>=e}}},7003(t,e,i){var s=i(83419),r=i(93301),n=i(50792),a=i(8214),o=i(8443),h=i(78970),l=i(85098),u=i(42515),d=i(36210),c=i(61340),f=i(85955),p=new s({initialize:function(t,e){this.game=t,this.scaleManager,this.canvas,this.config=e,this.enabled=!0,this.events=new n,this.isOver=!0,this.defaultCursor="",this.keyboard=e.inputKeyboard?new h(this):null,this.mouse=e.inputMouse?new l(this):null,this.touch=e.inputTouch?new d(this):null,this.pointers=[],this.pointersTotal=e.inputActivePointers;for(var i=0;i<=this.pointersTotal;i++){var s=new u(this,i);s.smoothFactor=e.inputSmoothFactor,this.pointers.push(s)}this.mousePointer=e.inputMouse?this.pointers[0]:null,this.activePointer=this.pointers[0],this.globalTopOnly=!0,this.time=0,this._tempPoint={x:0,y:0},this._tempHitTest=[],this._tempMatrix=new c,this._tempMatrix2=new c,this._tempSkip=!1,this.mousePointerContainer=[this.mousePointer],t.events.once(o.BOOT,this.boot,this)},boot:function(){var t=this.game,e=t.events;this.canvas=t.canvas,this.scaleManager=t.scale,this.events.emit(a.MANAGER_BOOT),e.on(o.PRE_RENDER,this.preRender,this),e.once(o.DESTROY,this.destroy,this)},setCanvasOver:function(t){this.isOver=!0,this.events.emit(a.GAME_OVER,t)},setCanvasOut:function(t){this.isOver=!1,this.events.emit(a.GAME_OUT,t)},preRender:function(){var t=this.game.loop.now,e=this.game.loop.delta,i=this.game.scene.getScenes(!0,!0);this.time=t,this.events.emit(a.MANAGER_UPDATE);for(var s=0;s10&&(t=10-this.pointersTotal);for(var i=0;i-1&&(r.splice(o,1),this.clear(a,!0))}this._pendingRemoval.length=0,this._list=r.concat(e.splice(0))}},isActive:function(){return this.manager&&this.manager.enabled&&this.enabled&&this.scene.sys.canInput()},setCursor:function(t){this.manager&&this.manager.setCursor(t)},resetCursor:function(){this.manager&&this.manager.resetCursor(null,!0)},updatePoll:function(t,e){if(!this.isActive())return!1;if(this.pluginEvents.emit(c.UPDATE,t,e),this._updatedThisFrame)return this._updatedThisFrame=!1,!1;var i,s=this.manager.pointers;for(i=0;i0){if(this._pollTimer-=e,!(this._pollTimer<0))return!1;this._pollTimer=this.pollRate}var n=!1;for(i=0;i0&&(n=!0)}return n},update:function(t,e){if(!this.isActive())return!1;for(var i=!1,s=0;s0&&(i=!0)}return this._updatedThisFrame=!0,i},clear:function(t,e){void 0===e&&(e=!1),this.disable(t);var i=t.input;i&&(this.removeDebug(t),this.manager.resetCursor(i),i.gameObject=void 0,i.target=void 0,i.hitArea=void 0,i.hitAreaCallback=void 0,i.callbackContext=void 0,t.input=null),e||this.queueForRemoval(t);var s=this._draggable.indexOf(t);return s>-1&&this._draggable.splice(s,1),t},disable:function(t,e){void 0===e&&(e=!1);var i=t.input;i&&(i.enabled=!1,i.dragState=0);for(var s,r=this._drag,n=this._over,a=this.manager,o=0;o-1&&r[o].splice(s,1),(s=n[o].indexOf(t))>-1&&n[o].splice(s,1);return e&&this.resetCursor(),this},enable:function(t,e,i,s){return void 0===s&&(s=!1),t.input?t.input.enabled=!0:this.setHitArea(t,e,i),t.input&&s&&!t.input.dropZone&&(t.input.dropZone=s),this},hitTestPointer:function(t){for(var e=this.cameras.getCamerasBelowPointer(t),i=0;i0)return t.camera=s,r}return t.camera=e[0],[]},processDownEvents:function(t){var e=0,i=this._temp,s=this._eventData,r=this._eventContainer;s.cancelled=!1;for(var n=0;n0&&l(t.x,t.y,t.downX,t.downY)>=r||s>0&&e>=t.downTime+s)&&(i=!0),i)return this.setDragState(t,3),this.processDragStartList(t)},processDragStartList:function(t){if(3!==this.getDragState(t))return 0;var e=this._drag[t.id];e.length>1&&(e=e.slice(0));for(var i=0;i1&&(this.sortGameObjects(i,t),this.topOnly&&i.splice(1)),this._drag[t.id]=i,0===this.dragDistanceThreshold&&0===this.dragTimeThreshold?(this.setDragState(t,3),this.processDragStartList(t)):(this.setDragState(t,2),0))},processDragMoveEvent:function(t){if(2===this.getDragState(t)&&this.processDragThresholdEvent(t,this.manager.game.loop.now),4!==this.getDragState(t))return 0;var e=this._tempZones,i=this._drag[t.id];i.length>1&&(i=i.slice(0));for(var s=0;s0?(a.emit(c.GAMEOBJECT_DRAG_LEAVE,t,h),this.emit(c.DRAG_LEAVE,t,a,h),o.target=e[0],h=o.target,a.emit(c.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(c.DRAG_ENTER,t,a,h)):(a.emit(c.GAMEOBJECT_DRAG_LEAVE,t,h),this.emit(c.DRAG_LEAVE,t,a,h),e[0]?(o.target=e[0],h=o.target,a.emit(c.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(c.DRAG_ENTER,t,a,h)):o.target=null)}else!h&&e[0]&&(o.target=e[0],h=o.target,a.emit(c.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(c.DRAG_ENTER,t,a,h));var u=t.positionToCamera(o.dragStartCamera);if(a.parentContainer){var d=u.x-o.dragStartXGlobal,f=u.y-o.dragStartYGlobal,p=a.getParentRotation(),m=d*Math.cos(p)+f*Math.sin(p),g=f*Math.cos(p)-d*Math.sin(p);m*=1/a.parentContainer.scaleX,g*=1/a.parentContainer.scaleY,r=m+o.dragStartX,n=g+o.dragStartY}else r=u.x-o.dragX,n=u.y-o.dragY;a.emit(c.GAMEOBJECT_DRAG,t,r,n),this.emit(c.DRAG,t,a,r,n)}return i.length},processDragUpEvent:function(t){var e=this._drag[t.id];e.length>1&&(e=e.slice(0));for(var i=0;i0){var n=this.manager,a=this._eventData,o=this._eventContainer;a.cancelled=!1;for(var h=0;h0){var r=this.manager,n=this._eventData,a=this._eventContainer;n.cancelled=!1,this.sortGameObjects(e,t);for(var o=0;o0){for(this.sortGameObjects(r,t),e=0;e0){for(this.sortGameObjects(n,t),e=0;e-1&&this._draggable.splice(r,1)}return this},makePixelPerfect:function(t){void 0===t&&(t=1);var e=this.systems.textures;return h(e,t)},setHitArea:function(t,e,i){if(void 0===e)return this.setHitAreaFromTexture(t);Array.isArray(t)||(t=[t]);var s=!1,r=!1,n=!1,a=!1,h=!1,l=!0;if(v(e)&&Object.keys(e).length){var u=e;e=p(u,"hitArea",null),i=p(u,"hitAreaCallback",null),h=p(u,"pixelPerfect",!1);var d=p(u,"alphaTolerance",1);h&&(e={},i=this.makePixelPerfect(d)),s=p(u,"draggable",!1),r=p(u,"dropZone",!1),n=p(u,"cursor",!1),a=p(u,"useHandCursor",!1),e&&i||(this.setHitAreaFromTexture(t),l=!1)}else"function"!=typeof e||i||(i=e,e={});for(var c=0;c=this.threshold?this.pressed||(this.pressed=!0,this.events.emit(r.BUTTON_DOWN,e,this,t),this.pad.emit(r.GAMEPAD_BUTTON_DOWN,i,t,this)):this.pressed&&(this.pressed=!1,this.events.emit(r.BUTTON_UP,e,this,t),this.pad.emit(r.GAMEPAD_BUTTON_UP,i,t,this))},destroy:function(){this.pad=null,this.events=null}});t.exports=n},99125(t,e,i){var s=i(97421),r=i(28884),n=i(83419),a=i(50792),o=i(26099),h=new n({Extends:a,initialize:function(t,e){a.call(this),this.manager=t,this.pad=e,this.id=e.id,this.index=e.index;for(var i=[],n=0;n=.5));this.buttons=i;var h=[];for(n=0;n=2&&(this.leftStick.set(n[0].getValue(),n[1].getValue()),r>=4&&this.rightStick.set(n[2].getValue(),n[3].getValue()))}},destroy:function(){var t;for(this.removeAllListeners(),this.manager=null,this.pad=null,t=0;t-1&&e.preventDefault()}},this.onKeyUp=function(e){if(!e.defaultPrevented&&t.enabled&&t.manager){t.queue.push(e),t.manager.events.emit(a.MANAGER_PROCESS);var i=e.altKey||e.ctrlKey||e.shiftKey||e.metaKey;t.preventDefault&&!i&&t.captures.indexOf(e.keyCode)>-1&&e.preventDefault()}};var e=this.target;e&&(e.addEventListener("keydown",this.onKeyDown,!1),e.addEventListener("keyup",this.onKeyUp,!1),this.enabled=!0)},stopListeners:function(){var t=this.target;t.removeEventListener("keydown",this.onKeyDown,!1),t.removeEventListener("keyup",this.onKeyUp,!1),this.enabled=!1},postUpdate:function(){this.queue=[]},addCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i0},removeCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i0},clearCaptures:function(){this.captures=[],this.preventDefault=!1},destroy:function(){this.stopListeners(),this.clearCaptures(),this.queue=[],this.manager.game.events.off(n.POST_STEP,this.postUpdate,this),this.target=null,this.enabled=!1,this.manager=null}});t.exports=l},28846(t,e,i){var s=i(83419),r=i(50792),n=i(95922),a=i(8443),o=i(35154),h=i(8214),l=i(89639),u=i(30472),d=i(46032),c=i(87960),f=i(74600),p=i(44594),m=i(56583),g=new s({Extends:r,initialize:function(t){r.call(this),this.game=t.systems.game,this.scene=t.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=t,this.manager=t.manager.keyboard,this.enabled=!0,this.keys=[],this.combos=[],this.prevCode=null,this.prevTime=0,this.prevType=null,t.pluginEvents.once(h.BOOT,this.boot,this),t.pluginEvents.on(h.START,this.start,this)},boot:function(){var t=this.settings.input;this.enabled=o(t,"keyboard",!0);var e=o(t,"keyboard.capture",null);e&&this.addCaptures(e),this.sceneInputPlugin.pluginEvents.once(h.DESTROY,this.destroy,this)},start:function(){this.sceneInputPlugin.manager.events.on(h.MANAGER_PROCESS,this.update,this),this.sceneInputPlugin.pluginEvents.once(h.SHUTDOWN,this.shutdown,this),this.game.events.on(a.BLUR,this.resetKeys,this),this.scene.sys.events.on(p.PAUSE,this.resetKeys,this),this.scene.sys.events.on(p.SLEEP,this.resetKeys,this)},isActive:function(){return this.enabled&&this.scene.sys.canInput()},addCapture:function(t){return this.manager.addCapture(t),this},removeCapture:function(t){return this.manager.removeCapture(t),this},getCaptures:function(){return this.manager.captures},enableGlobalCapture:function(){return this.manager.preventDefault=!0,this},disableGlobalCapture:function(){return this.manager.preventDefault=!1,this},clearCaptures:function(){return this.manager.clearCaptures(),this},createCursorKeys:function(){return this.addKeys({up:d.UP,down:d.DOWN,left:d.LEFT,right:d.RIGHT,space:d.SPACE,shift:d.SHIFT})},addKeys:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!1);var s={};if("string"==typeof t){t=t.split(",");for(var r=0;r-1?s[r]=t:s[t.keyCode]=t,e&&this.addCapture(t.keyCode),t.setEmitOnRepeat(i),t}return"string"==typeof t&&(t=d[t.toUpperCase()]),s[t]||(s[t]=new u(this,t),e&&this.addCapture(t),s[t].setEmitOnRepeat(i)),s[t]},removeKey:function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var s,r=this.keys;if(t instanceof u){var n=r.indexOf(t);n>-1&&(s=this.keys[n],this.keys[n]=void 0)}else"string"==typeof t&&(t=d[t.toUpperCase()]);return r[t]&&(s=r[t],r[t]=void 0),s&&(s.plugin=null,i&&this.removeCapture(s.keyCode),e&&s.destroy()),this},removeAllKeys:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1);for(var i=this.keys,s=0;st._tick)return t._tick=i,!0}return!1},update:function(){var t=this.manager.queue,e=t.length;if(this.isActive()&&0!==e)for(var i=this.keys,s=0;s0&&e.maxKeyDelay>0){var n=e.timeLastMatched+e.maxKeyDelay;t.timeStamp<=n&&(r=!0,i=s(t,e))}else r=!0,i=s(t,e);return!r&&e.resetOnWrongKey&&(e.index=0,e.current=e.keyCodes[0]),i&&(e.timeLastMatched=t.timeStamp,e.matched=!0,e.timeMatched=t.timeStamp),i}},92803(t){t.exports=function(t){return t.current=t.keyCodes[0],t.index=0,t.timeLastMatched=0,t.matched=!1,t.timeMatched=0,t}},92612(t){t.exports="keydown"},23345(t){t.exports="keyup"},21957(t){t.exports="keycombomatch"},44743(t){t.exports="down"},3771(t){t.exports="keydown-"},46358(t){t.exports="keyup-"},75674(t){t.exports="up"},95922(t,e,i){t.exports={ANY_KEY_DOWN:i(92612),ANY_KEY_UP:i(23345),COMBO_MATCH:i(21957),DOWN:i(44743),KEY_DOWN:i(3771),KEY_UP:i(46358),UP:i(75674)}},51442(t,e,i){t.exports={Events:i(95922),KeyboardManager:i(78970),KeyboardPlugin:i(28846),Key:i(30472),KeyCodes:i(46032),KeyCombo:i(87960),AdvanceKeyCombo:i(66970),ProcessKeyCombo:i(68769),ResetKeyCombo:i(92803),JustDown:i(90229),JustUp:i(38796),DownDuration:i(37015),UpDuration:i(41170)}},37015(t){t.exports=function(t,e){void 0===e&&(e=50);var i=t.plugin.game.loop.time-t.timeDown;return t.isDown&&i=400&&t.status<=599&&(s=!1),this.state=r.FILE_LOADED,this.resetXHR(),this.loader.nextFile(this,s)},onBase64Load:function(t){this.xhrLoader=t,this.state=r.FILE_LOADED,this.percentComplete=1,this.loader.emit(n.FILE_PROGRESS,this,this.percentComplete),this.loader.nextFile(this,!0)},onError:function(){this.resetXHR(),this.retryAttempts>0?(this.retryAttempts--,this.load()):this.loader.nextFile(this,!1)},onProgress:function(t){t.lengthComputable&&(this.bytesLoaded=t.loaded,this.bytesTotal=t.total,this.percentComplete=Math.min(this.bytesLoaded/this.bytesTotal,1),this.loader.emit(n.FILE_PROGRESS,this,this.percentComplete))},onProcess:function(){this.state=r.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=r.FILE_COMPLETE,this.multiFile&&this.multiFile.onFileComplete(this),this.loader.fileProcessComplete(this)},onProcessError:function(){console.error('Failed to process file: %s "%s"',this.type,this.key),this.state=r.FILE_ERRORED,this.multiFile&&this.multiFile.onFileFailed(this),this.loader.fileProcessComplete(this)},hasCacheConflict:function(){return this.cache&&this.cache.exists(this.key)},addToCache:function(){this.cache&&this.data&&this.cache.add(this.key,this.data)},pendingDestroy:function(t){if(this.state!==r.FILE_PENDING_DESTROY){void 0===t&&(t=this.data);var e=this.key,i=this.type;this.loader.emit(n.FILE_COMPLETE,e,i,t),this.loader.emit(n.FILE_KEY_COMPLETE+i+"-"+e,e,i,t),this.loader.flagForRemoval(this),this.state=r.FILE_PENDING_DESTROY}},destroy:function(){this.loader=null,this.cache=null,this.xhrSettings=null,this.multiFile=null,this.linkFile=null,this.data=null}});d.createObjectURL=function(t,e,i){if("function"==typeof URL)t.src=URL.createObjectURL(e);else{var s=new FileReader;s.onload=function(){t.removeAttribute("crossOrigin"),t.src="data:"+(e.type||i)+";base64,"+s.result.split(",")[1]},s.onerror=t.onerror,s.readAsDataURL(e)}},d.revokeObjectURL=function(t){"function"==typeof URL&&URL.revokeObjectURL(t.src)},t.exports=d},74099(t){var e={},i={install:function(t){for(var i in e)t[i]=e[i]},register:function(t,i){e[t]=i},destroy:function(){e={}}};t.exports=i},98356(t){t.exports=function(t,e){return!!t.url&&(t.url.match(/^(?:blob:|data:|capacitor:\/\/|file:\/\/|http:\/\/|https:\/\/|\/\/)/)?t.url:e+t.url)}},74261(t,e,i){var s=i(83419),r=i(23906),n=i(50792),a=i(54899),o=i(74099),h=i(95540),l=i(35154),u=i(41212),d=i(37277),c=i(44594),f=i(92638),p=new s({Extends:n,initialize:function(t){n.call(this);var e=t.sys.game.config,i=t.sys.settings.loader;this.scene=t,this.systems=t.sys,this.cacheManager=t.sys.cache,this.textureManager=t.sys.textures,this.sceneManager=t.sys.game.scene,o.install(this),this.prefix="",this.path="",this.baseURL="",this.setBaseURL(h(i,"baseURL",e.loaderBaseURL)),this.setPath(h(i,"path",e.loaderPath)),this.setPrefix(h(i,"prefix",e.loaderPrefix)),this.maxParallelDownloads=h(i,"maxParallelDownloads",e.loaderMaxParallelDownloads),this.xhr=f(h(i,"responseType",e.loaderResponseType),h(i,"async",e.loaderAsync),h(i,"user",e.loaderUser),h(i,"password",e.loaderPassword),h(i,"timeout",e.loaderTimeout),h(i,"withCredentials",e.loaderWithCredentials)),this.crossOrigin=h(i,"crossOrigin",e.loaderCrossOrigin),this.imageLoadType=h(i,"imageLoadType",e.loaderImageLoadType),this.localSchemes=h(i,"localScheme",e.loaderLocalScheme),this.totalToLoad=0,this.progress=0,this.list=new Set,this.inflight=new Set,this.queue=new Set,this._deleteQueue=new Set,this.totalFailed=0,this.totalComplete=0,this.state=r.LOADER_IDLE,this.multiKeyIndex=0,this.maxRetries=h(i,"maxRetries",e.loaderMaxRetries),t.sys.events.once(c.BOOT,this.boot,this),t.sys.events.on(c.START,this.pluginStart,this)},boot:function(){this.systems.events.once(c.DESTROY,this.destroy,this)},pluginStart:function(){this.systems.events.once(c.SHUTDOWN,this.shutdown,this)},setBaseURL:function(t){return void 0===t&&(t=""),""!==t&&"/"!==t.substr(-1)&&(t=t.concat("/")),this.baseURL=t,this},setPath:function(t){return void 0===t&&(t=""),""!==t&&"/"!==t.substr(-1)&&(t=t.concat("/")),this.path=t,this},setPrefix:function(t){return void 0===t&&(t=""),this.prefix=t,this},setCORS:function(t){return this.crossOrigin=t,this},addFile:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e0},removePack:function(t,e){var i,s=this.systems.anims,r=this.cacheManager,n=this.textureManager,a={animation:"json",aseprite:"json",audio:"audio",audioSprite:"audio",binary:"binary",bitmapFont:"bitmapFont",css:null,glsl:"shader",html:"html",json:"json",obj:"obj",plugin:null,scenePlugin:null,script:null,spine:"json",text:"text",tilemapCSV:"tilemap",tilemapImpact:"tilemap",tilemapTiledJSON:"tilemap",video:"video",xml:"xml"};if(u(t))i=t;else if(!(i=r.json.get(t)))return void console.warn("Asset Pack not found in JSON cache:",t);for(var o in e&&(i={_:i[e]}),i){var l=i[o],d=h(l,"prefix",""),c=h(l,"files"),f=h(l,"defaultType");if(Array.isArray(c))for(var p=0;p0&&this.inflight.size'),i.push(''),i.push(''),i.push(this.xhrLoader.responseText),i.push(""),i.push(""),i.push("");var s=[i.join("\n")],a=this;try{var o=new window.Blob(s,{type:"image/svg+xml;charset=utf-8"})}catch(t){return a.state=r.FILE_ERRORED,void a.onProcessComplete()}this.data=new Image,this.data.crossOrigin=this.crossOrigin,this.data.onload=function(){n.revokeObjectURL(a.data),a.onProcessComplete()},this.data.onerror=function(){n.revokeObjectURL(a.data),a.onProcessError()},n.createObjectURL(this.data,o,"image/svg+xml")},addToCache:function(){this.cache.addImage(this.key,this.data)}});a.register("htmlTexture",function(t,e,i,s,r){if(Array.isArray(t))for(var n=0;n=r.FILE_COMPLETE&&("spritesheet"===t.type?t.addToCache():"normalMap"===this.type?this.cache.addImage(this.key,t.data,this.data):this.cache.addImage(this.key,this.data,t.data)):this.cache.addImage(this.key,this.data)}});a.register("image",function(t,e,i){if(Array.isArray(t))for(var s=0;s=0?a.substring(o+i.length):a]=n.data}for(var h=[],l=0;l=r.FILE_COMPLETE&&("normalMap"===this.type?this.cache.addSpriteSheet(this.key,t.data,this.config,this.data):this.cache.addSpriteSheet(this.key,this.data,this.config,t.data)):this.cache.addSpriteSheet(this.key,this.data,this.config)}});n.register("spritesheet",function(t,e,i,s){if(Array.isArray(t))for(var r=0;ri&&(i=h.x),h.xn&&(n=h.y),h.y>>0)+2891336453,r=277803737*(s>>>(s>>>28)+4^s),n=(r>>>22^r)>>>0;return n/=f};t.exports=function(t,e){switch("number"==typeof t&&(t=[t]),e){case 2:return p(t,!0);case 1:return p(t);default:return c(t)}}},84854(t,e,i){var s=i(72958),r=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16],n=Array(4),a=Array(4),o=Array(4),h=Array(4),l=Array(4),u=Array(4),d=function(t,e,i){var s,r,h,l,u=e.noiseMode||0,d=void 0===e.noiseSmoothing?1:e.noiseSmoothing,p=Math.max(1,Math.min(t.length,4)),m=e.noiseCells||[32,32,32,32].slice(0,p);for(s=0;s1&&(o[1]=Math.floor(l/3)%3-1,p>2&&(o[2]=Math.floor(l/9)%3-1,p>3&&(o[3]=Math.floor(l/27)%3-1))),r=c(p,n,o,e,i),h=f(p,o,a,r),u){case 0:h0||e[1]>0)for(j[0]=U.x,j[1]=z.x,j[2]=Y.x,q[0]=U.y,q[1]=z.y,q[2]=Y.y,e[0]>0&&(j[0]=(U.x%e[0]+e[0])%e[0],j[1]=(z.x%e[0]+e[0])%e[0],j[2]=(Y.x%e[0]+e[0])%e[0]),e[1]>0&&(q[0]=(U.y%e[1]+e[1])%e[1],q[1]=(z.y%e[1]+e[1])%e[1],q[2]=(Y.y%e[1]+e[1])%e[1]),s=0;s<3;s++)H[s]=Math.floor(j[s]+.5*q[s]+.5),V[s]=Math.floor(q[s]+.5);else H[0]=n.x,H[1]=B.x,H[2]=k.x,V[0]=n.y,V[1]=B.y,V[2]=k.y;for(H[0]+=a[0],H[1]+=a[0],H[2]+=a[0],V[0]+=a[1],V[1]+=a[1],V[2]+=a[1],s=0;s<3;s++)K[s]=H[s]%289,K[s]<0&&(K[s]+=289);for(s=0;s<3;s++)K[s]=((51*K[s]+2)*K[s]+V[s])%289;for(s=0;s<3;s++)K[s]=(34*K[s]+10)*K[s]%289;for(s=0;s<3;s++)Z[s]=.07482*K[s]+i,Q[s]=Math.cos(Z[s]),J[s]=Math.sin(Z[s]);for($.x=Q[0],$.y=J[0],tt.x=Q[1],tt.y=J[1],et.x=Q[2],et.y=J[2],it[0]=.8-I(X,X),it[1]=.8-I(W,W),it[2]=.8-I(G,G),s=0;s<3;s++)it[s]=Math.max(it[s],0),st[s]=it[s]*it[s],rt[s]=st[s]*st[s];return nt[0]=I($,X),nt[1]=I(tt,W),nt[2]=I(et,G),10.9*(rt[0]*nt[0]+rt[1]*nt[1]+rt[2]*nt[2])},B=[0,0,0],k=[0,0,0],U=[0,0,0],z=[0,0,0],Y=[0,0,0],X=[0,0,0],W=[0,0,0],G=[0,0,0],H=[0,0,0],V=[0,0,0],j=[0,0,0],q=[0,0,0],K=[0,0,0],Z=[0,0,0],Q=[0,0,0],J=[0,0,0],$=[0,0,0],tt=[0,0,0],et=[0,0,0],it=[0,0,0],st=[0,0,0,0],rt=[0,0,0,0],nt=[0,0,0,0],at=[0,0,0,0],ot=[0,0,0,0],ht=[0,0,0,0],lt=[0,0,0,0],ut=[0,0,0,0],dt=[0,0,0,0],ct=[0,0,0,0],ft=[0,0,0,0],pt=[0,0,0,0],mt=[0,0,0,0],gt=[0,0,0,0],vt=[0,0,0,0],xt=[0,0,0,0],yt=[0,0,0,0],Tt=[0,0,0,0],wt=[0,0,0,0],St=[0,0,0,0],bt=[0,0,0,0],Et=[0,0,0,0],Ct=[0,0,0,0],At=[0,0,0,0],_t=[0,0,0,0],Mt=[0,0,0,0],Rt=[0,0,0,0],Ot=[0,0,0,0],Pt=function(t,e){for(var i=0;i<4;i++){var s=t[i]%289;s<0&&(s+=289),e[i]=(34*s+10)*s%289}},Lt=function(t,e,i){var s=B,r=k,n=U,o=z,h=Y,l=X,u=W,d=G,c=H,f=V,p=j,m=q,g=K,v=Z,x=Q,y=J,T=$,w=tt,S=et,b=it,E=st,C=rt,A=nt,_=at,M=ot,R=ht,O=lt,P=ut,L=dt,F=ct,D=ft,I=pt,N=mt,Lt=gt,Ft=vt,Dt=xt,It=yt,Nt=Tt,Bt=wt,kt=St,Ut=bt,zt=Et,Yt=Ct,Xt=At,Wt=_t,Gt=Mt,Ht=Rt,Vt=Ot;s[0]=0*t[0]+1*t[1]+1*t[2],s[1]=1*t[0]+0*t[1]+1*t[2],s[2]=1*t[0]+1*t[1]+0*t[2];for(var jt=0;jt<3;jt++)r[jt]=Math.floor(s[jt]),n[jt]=s[jt]-r[jt];for(o[0]=n[0]>n[1]?0:1,o[1]=n[1]>n[2]?0:1,o[2]=n[0]>n[2]?0:1,h[0]=1-o[0],h[1]=1-o[1],h[2]=1-o[2],l[0]=h[2],l[1]=o[0],l[2]=o[1],u[0]=h[0],u[1]=h[1],u[2]=o[2],jt=0;jt<3;jt++)d[jt]=Math.min(l[jt],u[jt]),c[jt]=Math.max(l[jt],u[jt]);for(jt=0;jt<3;jt++)f[jt]=r[jt]+d[jt],p[jt]=r[jt]+c[jt],m[jt]=r[jt]+1;var qt=r[0],Kt=r[1],Zt=r[2],Qt=f[0],Jt=f[1],$t=f[2],te=p[0],ee=p[1],ie=p[2],se=m[0],re=m[1],ne=m[2];for(g[0]=-.5*qt+.5*Kt+.5*Zt,g[1]=.5*qt-.5*Kt+.5*Zt,g[2]=.5*qt+.5*Kt-.5*Zt,v[0]=-.5*Qt+.5*Jt+.5*$t,v[1]=.5*Qt-.5*Jt+.5*$t,v[2]=.5*Qt+.5*Jt-.5*$t,x[0]=-.5*te+.5*ee+.5*ie,x[1]=.5*te-.5*ee+.5*ie,x[2]=.5*te+.5*ee-.5*ie,y[0]=-.5*se+.5*re+.5*ne,y[1]=.5*se-.5*re+.5*ne,y[2]=.5*se+.5*re-.5*ne,jt=0;jt<3;jt++)T[jt]=t[jt]-g[jt],w[jt]=t[jt]-v[jt],S[jt]=t[jt]-x[jt],b[jt]=t[jt]-y[jt];if(e[0]>0||e[1]>0||e[2]>0){if(E[0]=g[0],E[1]=v[0],E[2]=x[0],E[3]=y[0],C[0]=g[1],C[1]=v[1],C[2]=x[1],C[3]=y[1],A[0]=g[2],A[1]=v[2],A[2]=x[2],A[3]=y[2],e[0]>0)for(jt=0;jt<4;jt++)E[jt]=(E[jt]%e[0]+e[0])%e[0];if(e[1]>0)for(jt=0;jt<4;jt++)C[jt]=(C[jt]%e[1]+e[1])%e[1];if(e[2]>0)for(jt=0;jt<4;jt++)A[jt]=(A[jt]%e[2]+e[2])%e[2];var ae=E[0],oe=C[0],he=A[0],le=E[1],ue=C[1],de=A[1],ce=E[2],fe=C[2],pe=A[2],me=E[3],ge=C[3],ve=A[3];r[0]=Math.floor(0*ae+1*oe+1*he+.5),r[1]=Math.floor(1*ae+0*oe+1*he+.5),r[2]=Math.floor(1*ae+1*oe+0*he+.5),f[0]=Math.floor(0*le+1*ue+1*de+.5),f[1]=Math.floor(1*le+0*ue+1*de+.5),f[2]=Math.floor(1*le+1*ue+0*de+.5),p[0]=Math.floor(0*ce+1*fe+1*pe+.5),p[1]=Math.floor(1*ce+0*fe+1*pe+.5),p[2]=Math.floor(1*ce+1*fe+0*pe+.5),m[0]=Math.floor(0*me+1*ge+1*ve+.5),m[1]=Math.floor(1*me+0*ge+1*ve+.5),m[2]=Math.floor(1*me+1*ge+0*ve+.5)}r[0]+=a[0],r[1]+=a[1],r[2]+=a[2],f[0]+=a[0],f[1]+=a[1],f[2]+=a[2],p[0]+=a[0],p[1]+=a[1],p[2]+=a[2],m[0]+=a[0],m[1]+=a[1],m[2]+=a[2];var xe=st,ye=rt;for(xe[0]=r[2],xe[1]=f[2],xe[2]=p[2],xe[3]=m[2],Pt(xe,ye),ye[0]+=r[1],ye[1]+=f[1],ye[2]+=p[1],ye[3]+=m[1],Pt(ye,xe),xe[0]+=r[0],xe[1]+=f[0],xe[2]+=p[0],xe[3]+=m[0],Pt(xe,_),jt=0;jt<4;jt++)M[jt]=3.883222077*_[jt],R[jt]=.996539792-.006920415*_[jt],O[jt]=.108705628*_[jt],P[jt]=Math.cos(M[jt]),L[jt]=Math.sin(M[jt]),F[jt]=Math.sqrt(Math.max(0,1-R[jt]*R[jt]));if(0!==i)for(jt=0;jt<4;jt++)Lt[jt]=P[jt]*F[jt],Ft[jt]=L[jt]*F[jt],Dt[jt]=R[jt],It[jt]=Math.sin(O[jt]),Nt[jt]=Math.cos(O[jt]),Bt[jt]=L[jt]*It[jt]-P[jt]*Nt[jt],kt[jt]=(1-R[jt])*(Bt[jt]*L[jt])+R[jt]*It[jt],Ut[jt]=(1-R[jt])*(-Bt[jt]*P[jt])+R[jt]*Nt[jt],zt[jt]=-(Ft[jt]*Nt[jt]+Lt[jt]*It[jt]),Yt[jt]=Math.sin(i),Xt[jt]=Math.cos(i),D[jt]=Xt[jt]*Lt[jt]+Yt[jt]*kt[jt],I[jt]=Xt[jt]*Ft[jt]+Yt[jt]*Ut[jt],N[jt]=Xt[jt]*Dt[jt]+Yt[jt]*zt[jt];else for(jt=0;jt<4;jt++)D[jt]=P[jt]*F[jt],I[jt]=L[jt]*F[jt],N[jt]=R[jt];for(jt=0;jt<4;jt++){var Te=0===jt?T[0]:1===jt?w[0]:2===jt?S[0]:b[0],we=0===jt?T[1]:1===jt?w[1]:2===jt?S[1]:b[1],Se=0===jt?T[2]:1===jt?w[2]:2===jt?S[2]:b[2],be=Te*Te+we*we+Se*Se;Wt[jt]=.5-be,Wt[jt]<0&&(Wt[jt]=0),Gt[jt]=Wt[jt]*Wt[jt],Ht[jt]=Gt[jt]*Wt[jt]}for(jt=0;jt<4;jt++){var Ee=D[jt],Ce=I[jt],Ae=N[jt],_e=0===jt?T[0]:1===jt?w[0]:2===jt?S[0]:b[0],Me=0===jt?T[1]:1===jt?w[1]:2===jt?S[1]:b[1],Re=0===jt?T[2]:1===jt?w[2]:2===jt?S[2]:b[2];Vt[jt]=Ee*_e+Ce*Me+Ae*Re}var Oe=0;for(jt=0;jt<4;jt++)Oe+=Ht[jt]*Vt[jt];return 39.5*Oe};t.exports=function(t,s){"number"==typeof t&&(t=[t]),s||(s={});for(var h=Math.min(3,t.length);h<2;)t.push(0),h++;var l=s.noiseIterations||1,u=s.noiseWarpIterations||1,d=s.noiseDetailPower||2,c=s.noiseFlowPower||2,f=s.noiseContributionPower||2,p=s.noiseWarpDetailPower||2,m=s.noiseWarpFlowPower||2,g=s.noiseWarpContributionPower||2,v=s.noiseCells||[32,32,32],x=s.noiseOffset||[0,0,0],y=s.noiseWarpAmount||0;if(s.noiseSeed)for(var T=[1,2,3],w=0;w0&&u>0&&h>=2)if(2===h){var S=o(u,2,e,s,p,m,g);i[0]=e[0]+r[0],i[1]=e[1]+r[1];var b=o(u,2,i,s,p,m,g);e[0]+=S*y,e[1]+=b*y}else if(3===h){var E=o(u,3,e,s,p,m,g);i[0]=e[0]+r[0],i[1]=e[1]+r[1],i[2]=e[2]+r[2];var C=o(u,3,i,s,p,m,g);i[0]=e[0]+n[0],i[1]=e[1]+n[1],i[2]=e[2]+n[2];var A=o(u,3,i,s,p,m,g);e[0]+=E*y,e[1]+=C*y,e[2]+=A*y}return o(l,h,e,s,d,c,f)}},78702(t){t.exports=function(t){return t==parseFloat(t)?!(t%2):void 0}},94883(t){t.exports=function(t){return t===parseFloat(t)?!(t%2):void 0}},28915(t){t.exports=function(t,e,i){return(e-t)*i+t}},94908(t){t.exports=function(t,e,i){return void 0===i&&(i=0),t.clone().lerp(e,i)}},94434(t,e,i){var s=new(i(83419))({initialize:function(t){this.val=new Float32Array(9),t?this.copy(t):this.identity()},clone:function(){return new s(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this},fromMat4:function(t){var e=t.val,i=this.val;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[4],i[4]=e[5],i[5]=e[6],i[6]=e[8],i[7]=e[9],i[8]=e[10],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],s=t[5];return t[1]=t[3],t[2]=t[6],t[3]=e,t[5]=t[7],t[6]=i,t[7]=s,this},invert:function(){var t=this.val,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=l*n-a*h,d=-l*r+a*o,c=h*r-n*o,f=e*u+i*d+s*c;return f?(f=1/f,t[0]=u*f,t[1]=(-l*i+s*h)*f,t[2]=(a*i-s*n)*f,t[3]=d*f,t[4]=(l*e-s*o)*f,t[5]=(-a*e+s*r)*f,t[6]=c*f,t[7]=(-h*e+i*o)*f,t[8]=(n*e-i*r)*f,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return t[0]=n*l-a*h,t[1]=s*h-i*l,t[2]=i*a-s*n,t[3]=a*o-r*l,t[4]=e*l-s*o,t[5]=s*r-e*a,t[6]=r*h-n*o,t[7]=i*o-e*h,t[8]=e*n-i*r,this},determinant:function(){var t=this.val,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return e*(l*n-a*h)+i*(-l*r+a*o)+s*(h*r-n*o)},multiply:function(t){var e=this.val,i=e[0],s=e[1],r=e[2],n=e[3],a=e[4],o=e[5],h=e[6],l=e[7],u=e[8],d=t.val,c=d[0],f=d[1],p=d[2],m=d[3],g=d[4],v=d[5],x=d[6],y=d[7],T=d[8];return e[0]=c*i+f*n+p*h,e[1]=c*s+f*a+p*l,e[2]=c*r+f*o+p*u,e[3]=m*i+g*n+v*h,e[4]=m*s+g*a+v*l,e[5]=m*r+g*o+v*u,e[6]=x*i+y*n+T*h,e[7]=x*s+y*a+T*l,e[8]=x*r+y*o+T*u,this},translate:function(t){var e=this.val,i=t.x,s=t.y;return e[6]=i*e[0]+s*e[3]+e[6],e[7]=i*e[1]+s*e[4]+e[7],e[8]=i*e[2]+s*e[5]+e[8],this},rotate:function(t){var e=this.val,i=e[0],s=e[1],r=e[2],n=e[3],a=e[4],o=e[5],h=Math.sin(t),l=Math.cos(t);return e[0]=l*i+h*n,e[1]=l*s+h*a,e[2]=l*r+h*o,e[3]=l*n-h*i,e[4]=l*a-h*s,e[5]=l*o-h*r,this},scale:function(t){var e=this.val,i=t.x,s=t.y;return e[0]=i*e[0],e[1]=i*e[1],e[2]=i*e[2],e[3]=s*e[3],e[4]=s*e[4],e[5]=s*e[5],this},fromQuat:function(t){var e=t.x,i=t.y,s=t.z,r=t.w,n=e+e,a=i+i,o=s+s,h=e*n,l=e*a,u=e*o,d=i*a,c=i*o,f=s*o,p=r*n,m=r*a,g=r*o,v=this.val;return v[0]=1-(d+f),v[3]=l+g,v[6]=u-m,v[1]=l-g,v[4]=1-(h+f),v[7]=c+p,v[2]=u+m,v[5]=c-p,v[8]=1-(h+d),this},normalFromMat4:function(t){var e=t.val,i=this.val,s=e[0],r=e[1],n=e[2],a=e[3],o=e[4],h=e[5],l=e[6],u=e[7],d=e[8],c=e[9],f=e[10],p=e[11],m=e[12],g=e[13],v=e[14],x=e[15],y=s*h-r*o,T=s*l-n*o,w=s*u-a*o,S=r*l-n*h,b=r*u-a*h,E=n*u-a*l,C=d*g-c*m,A=d*v-f*m,_=d*x-p*m,M=c*v-f*g,R=c*x-p*g,O=f*x-p*v,P=y*O-T*R+w*M+S*_-b*A+E*C;return P?(P=1/P,i[0]=(h*O-l*R+u*M)*P,i[1]=(l*_-o*O-u*A)*P,i[2]=(o*R-h*_+u*C)*P,i[3]=(n*R-r*O-a*M)*P,i[4]=(s*O-n*_+a*A)*P,i[5]=(r*_-s*R-a*C)*P,i[6]=(g*E-v*b+x*S)*P,i[7]=(v*w-m*E-x*T)*P,i[8]=(m*b-g*w+x*y)*P,this):null}});t.exports=s},37867(t,e,i){var s=i(83419),r=i(25836),n=1e-6,a=new s({initialize:function(t){this.val=new Float32Array(16),t?this.copy(t):this.identity()},clone:function(){return new a(this)},set:function(t){return this.copy(t)},setValues:function(t,e,i,s,r,n,a,o,h,l,u,d,c,f,p,m){var g=this.val;return g[0]=t,g[1]=e,g[2]=i,g[3]=s,g[4]=r,g[5]=n,g[6]=a,g[7]=o,g[8]=h,g[9]=l,g[10]=u,g[11]=d,g[12]=c,g[13]=f,g[14]=p,g[15]=m,this},copy:function(t){var e=t.val;return this.setValues(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},fromArray:function(t){return this.setValues(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},zero:function(){return this.setValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)},transform:function(t,e,i){var s=o.fromQuat(i).val,r=e.x,n=e.y,a=e.z;return this.setValues(s[0]*r,s[1]*r,s[2]*r,0,s[4]*n,s[5]*n,s[6]*n,0,s[8]*a,s[9]*a,s[10]*a,0,t.x,t.y,t.z,1)},xyz:function(t,e,i){this.identity();var s=this.val;return s[12]=t,s[13]=e,s[14]=i,this},scaling:function(t,e,i){this.zero();var s=this.val;return s[0]=t,s[5]=e,s[10]=i,s[15]=1,this},identity:function(){return this.setValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)},transpose:function(){var t=this.val,e=t[1],i=t[2],s=t[3],r=t[6],n=t[7],a=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=e,t[6]=t[9],t[7]=t[13],t[8]=i,t[9]=r,t[11]=t[14],t[12]=s,t[13]=n,t[14]=a,this},getInverse:function(t){return this.copy(t),this.invert()},invert:function(){var t=this.val,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],d=t[10],c=t[11],f=t[12],p=t[13],m=t[14],g=t[15],v=e*a-i*n,x=e*o-s*n,y=e*h-r*n,T=i*o-s*a,w=i*h-r*a,S=s*h-r*o,b=l*p-u*f,E=l*m-d*f,C=l*g-c*f,A=u*m-d*p,_=u*g-c*p,M=d*g-c*m,R=v*M-x*_+y*A+T*C-w*E+S*b;return R?(R=1/R,this.setValues((a*M-o*_+h*A)*R,(s*_-i*M-r*A)*R,(p*S-m*w+g*T)*R,(d*w-u*S-c*T)*R,(o*C-n*M-h*E)*R,(e*M-s*C+r*E)*R,(m*y-f*S-g*x)*R,(l*S-d*y+c*x)*R,(n*_-a*C+h*b)*R,(i*C-e*_-r*b)*R,(f*w-p*y+g*v)*R,(u*y-l*w-c*v)*R,(a*E-n*A-o*b)*R,(e*A-i*E+s*b)*R,(p*x-f*T-m*v)*R,(l*T-u*x+d*v)*R)):this},adjoint:function(){var t=this.val,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],d=t[10],c=t[11],f=t[12],p=t[13],m=t[14],g=t[15];return this.setValues(a*(d*g-c*m)-u*(o*g-h*m)+p*(o*c-h*d),-(i*(d*g-c*m)-u*(s*g-r*m)+p*(s*c-r*d)),i*(o*g-h*m)-a*(s*g-r*m)+p*(s*h-r*o),-(i*(o*c-h*d)-a*(s*c-r*d)+u*(s*h-r*o)),-(n*(d*g-c*m)-l*(o*g-h*m)+f*(o*c-h*d)),e*(d*g-c*m)-l*(s*g-r*m)+f*(s*c-r*d),-(e*(o*g-h*m)-n*(s*g-r*m)+f*(s*h-r*o)),e*(o*c-h*d)-n*(s*c-r*d)+l*(s*h-r*o),n*(u*g-c*p)-l*(a*g-h*p)+f*(a*c-h*u),-(e*(u*g-c*p)-l*(i*g-r*p)+f*(i*c-r*u)),e*(a*g-h*p)-n*(i*g-r*p)+f*(i*h-r*a),-(e*(a*c-h*u)-n*(i*c-r*u)+l*(i*h-r*a)),-(n*(u*m-d*p)-l*(a*m-o*p)+f*(a*d-o*u)),e*(u*m-d*p)-l*(i*m-s*p)+f*(i*d-s*u),-(e*(a*m-o*p)-n*(i*m-s*p)+f*(i*o-s*a)),e*(a*d-o*u)-n*(i*d-s*u)+l*(i*o-s*a))},determinant:function(){var t=this.val,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],d=t[10],c=t[11],f=t[12],p=t[13],m=t[14],g=t[15];return(e*a-i*n)*(d*g-c*m)-(e*o-s*n)*(u*g-c*p)+(e*h-r*n)*(u*m-d*p)+(i*o-s*a)*(l*g-c*f)-(i*h-r*a)*(l*m-d*f)+(s*h-r*o)*(l*p-u*f)},multiply:function(t){var e=this.val,i=e[0],s=e[1],r=e[2],n=e[3],a=e[4],o=e[5],h=e[6],l=e[7],u=e[8],d=e[9],c=e[10],f=e[11],p=e[12],m=e[13],g=e[14],v=e[15],x=t.val,y=x[0],T=x[1],w=x[2],S=x[3];return e[0]=y*i+T*a+w*u+S*p,e[1]=y*s+T*o+w*d+S*m,e[2]=y*r+T*h+w*c+S*g,e[3]=y*n+T*l+w*f+S*v,y=x[4],T=x[5],w=x[6],S=x[7],e[4]=y*i+T*a+w*u+S*p,e[5]=y*s+T*o+w*d+S*m,e[6]=y*r+T*h+w*c+S*g,e[7]=y*n+T*l+w*f+S*v,y=x[8],T=x[9],w=x[10],S=x[11],e[8]=y*i+T*a+w*u+S*p,e[9]=y*s+T*o+w*d+S*m,e[10]=y*r+T*h+w*c+S*g,e[11]=y*n+T*l+w*f+S*v,y=x[12],T=x[13],w=x[14],S=x[15],e[12]=y*i+T*a+w*u+S*p,e[13]=y*s+T*o+w*d+S*m,e[14]=y*r+T*h+w*c+S*g,e[15]=y*n+T*l+w*f+S*v,this},multiplyLocal:function(t){var e=this.val,i=t.val;return this.setValues(e[0]*i[0]+e[1]*i[4]+e[2]*i[8]+e[3]*i[12],e[0]*i[1]+e[1]*i[5]+e[2]*i[9]+e[3]*i[13],e[0]*i[2]+e[1]*i[6]+e[2]*i[10]+e[3]*i[14],e[0]*i[3]+e[1]*i[7]+e[2]*i[11]+e[3]*i[15],e[4]*i[0]+e[5]*i[4]+e[6]*i[8]+e[7]*i[12],e[4]*i[1]+e[5]*i[5]+e[6]*i[9]+e[7]*i[13],e[4]*i[2]+e[5]*i[6]+e[6]*i[10]+e[7]*i[14],e[4]*i[3]+e[5]*i[7]+e[6]*i[11]+e[7]*i[15],e[8]*i[0]+e[9]*i[4]+e[10]*i[8]+e[11]*i[12],e[8]*i[1]+e[9]*i[5]+e[10]*i[9]+e[11]*i[13],e[8]*i[2]+e[9]*i[6]+e[10]*i[10]+e[11]*i[14],e[8]*i[3]+e[9]*i[7]+e[10]*i[11]+e[11]*i[15],e[12]*i[0]+e[13]*i[4]+e[14]*i[8]+e[15]*i[12],e[12]*i[1]+e[13]*i[5]+e[14]*i[9]+e[15]*i[13],e[12]*i[2]+e[13]*i[6]+e[14]*i[10]+e[15]*i[14],e[12]*i[3]+e[13]*i[7]+e[14]*i[11]+e[15]*i[15])},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var i=t.val,s=e.val,r=i[0],n=i[4],a=i[8],o=i[12],h=i[1],l=i[5],u=i[9],d=i[13],c=i[2],f=i[6],p=i[10],m=i[14],g=i[3],v=i[7],x=i[11],y=i[15],T=s[0],w=s[4],S=s[8],b=s[12],E=s[1],C=s[5],A=s[9],_=s[13],M=s[2],R=s[6],O=s[10],P=s[14],L=s[3],F=s[7],D=s[11],I=s[15];return this.setValues(r*T+n*E+a*M+o*L,h*T+l*E+u*M+d*L,c*T+f*E+p*M+m*L,g*T+v*E+x*M+y*L,r*w+n*C+a*R+o*F,h*w+l*C+u*R+d*F,c*w+f*C+p*R+m*F,g*w+v*C+x*R+y*F,r*S+n*A+a*O+o*D,h*S+l*A+u*O+d*D,c*S+f*A+p*O+m*D,g*S+v*A+x*O+y*D,r*b+n*_+a*P+o*I,h*b+l*_+u*P+d*I,c*b+f*_+p*P+m*I,g*b+v*_+x*P+y*I)},translate:function(t){return this.translateXYZ(t.x,t.y,t.z)},translateXYZ:function(t,e,i){var s=this.val;return s[12]=s[0]*t+s[4]*e+s[8]*i+s[12],s[13]=s[1]*t+s[5]*e+s[9]*i+s[13],s[14]=s[2]*t+s[6]*e+s[10]*i+s[14],s[15]=s[3]*t+s[7]*e+s[11]*i+s[15],this},scale:function(t){return this.scaleXYZ(t.x,t.y,t.z)},scaleXYZ:function(t,e,i){var s=this.val;return s[0]=s[0]*t,s[1]=s[1]*t,s[2]=s[2]*t,s[3]=s[3]*t,s[4]=s[4]*e,s[5]=s[5]*e,s[6]=s[6]*e,s[7]=s[7]*e,s[8]=s[8]*i,s[9]=s[9]*i,s[10]=s[10]*i,s[11]=s[11]*i,this},makeRotationAxis:function(t,e){var i=Math.cos(e),s=Math.sin(e),r=1-i,n=t.x,a=t.y,o=t.z,h=r*n,l=r*a;return this.setValues(h*n+i,h*a-s*o,h*o+s*a,0,h*a+s*o,l*a+i,l*o-s*n,0,h*o-s*a,l*o+s*n,r*o*o+i,0,0,0,0,1)},rotate:function(t,e){var i=this.val,s=e.x,r=e.y,a=e.z,o=Math.sqrt(s*s+r*r+a*a);if(Math.abs(o)1?void 0!==s?(r=(s-t)/(s-i))<0&&(r=0):r=1:r<0&&(r=0),r}},15746(t,e,i){var s=i(83419),r=i(94434),n=i(29747),a=i(25836),o=1e-6,h=new Int8Array([1,2,0]),l=new Float32Array([0,0,0]),u=new a(1,0,0),d=new a(0,1,0),c=new a,f=new r,p=new s({initialize:function(t,e,i,s){this.onChangeCallback=n,this.set(t,e,i,s)},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},w:{get:function(){return this._w},set:function(t){this._w=t,this.onChangeCallback(this)}},copy:function(t){return this.set(t)},set:function(t,e,i,s,r){return void 0===r&&(r=!0),"object"==typeof t?(this._x=t.x||0,this._y=t.y||0,this._z=t.z||0,this._w=t.w||0):(this._x=t||0,this._y=e||0,this._z=i||0,this._w=s||0),r&&this.onChangeCallback(this),this},add:function(t){return this._x+=t.x,this._y+=t.y,this._z+=t.z,this._w+=t.w,this.onChangeCallback(this),this},subtract:function(t){return this._x-=t.x,this._y-=t.y,this._z-=t.z,this._w-=t.w,this.onChangeCallback(this),this},scale:function(t){return this._x*=t,this._y*=t,this._z*=t,this._w*=t,this.onChangeCallback(this),this},length:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return Math.sqrt(t*t+e*e+i*i+s*s)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return t*t+e*e+i*i+s*s},normalize:function(){var t=this.x,e=this.y,i=this.z,s=this.w,r=t*t+e*e+i*i+s*s;return r>0&&(r=1/Math.sqrt(r),this._x=t*r,this._y=e*r,this._z=i*r,this._w=s*r),this.onChangeCallback(this),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,r=this.z,n=this.w;return this.set(i+e*(t.x-i),s+e*(t.y-s),r+e*(t.z-r),n+e*(t.w-n))},rotationTo:function(t,e){var i=t.x*e.x+t.y*e.y+t.z*e.z;return i<-.999999?(c.copy(u).cross(t).length().999999?this.set(0,0,0,1):(c.copy(t).cross(e),this._x=c.x,this._y=c.y,this._z=c.z,this._w=1+i,this.normalize())},setAxes:function(t,e,i){var s=f.val;return s[0]=e.x,s[3]=e.y,s[6]=e.z,s[1]=i.x,s[4]=i.y,s[7]=i.z,s[2]=-t.x,s[5]=-t.y,s[8]=-t.z,this.fromMat3(f).normalize()},identity:function(){return this.set(0,0,0,1)},setAxisAngle:function(t,e){e*=.5;var i=Math.sin(e);return this.set(i*t.x,i*t.y,i*t.z,Math.cos(e))},multiply:function(t){var e=this.x,i=this.y,s=this.z,r=this.w,n=t.x,a=t.y,o=t.z,h=t.w;return this.set(e*h+r*n+i*o-s*a,i*h+r*a+s*n-e*o,s*h+r*o+e*a-i*n,r*h-e*n-i*a-s*o)},slerp:function(t,e){var i=this.x,s=this.y,r=this.z,n=this.w,a=t.x,h=t.y,l=t.z,u=t.w,d=i*a+s*h+r*l+n*u;d<0&&(d=-d,a=-a,h=-h,l=-l,u=-u);var c=1-e,f=e;if(1-d>o){var p=Math.acos(d),m=Math.sin(p);c=Math.sin((1-e)*p)/m,f=Math.sin(e*p)/m}return this.set(c*i+f*a,c*s+f*h,c*r+f*l,c*n+f*u)},invert:function(){var t=this.x,e=this.y,i=this.z,s=this.w,r=t*t+e*e+i*i+s*s,n=r?1/r:0;return this.set(-t*n,-e*n,-i*n,s*n)},conjugate:function(){return this._x=-this.x,this._y=-this.y,this._z=-this.z,this.onChangeCallback(this),this},rotateX:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,r=this.w,n=Math.sin(t),a=Math.cos(t);return this.set(e*a+r*n,i*a+s*n,s*a-i*n,r*a-e*n)},rotateY:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,r=this.w,n=Math.sin(t),a=Math.cos(t);return this.set(e*a-s*n,i*a+r*n,s*a+e*n,r*a-i*n)},rotateZ:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,r=this.w,n=Math.sin(t),a=Math.cos(t);return this.set(e*a+i*n,i*a-e*n,s*a+r*n,r*a-s*n)},calculateW:function(){var t=this.x,e=this.y,i=this.z;return this.w=-Math.sqrt(1-t*t-e*e-i*i),this},setFromEuler:function(t,e){var i=t.x/2,s=t.y/2,r=t.z/2,n=Math.cos(i),a=Math.cos(s),o=Math.cos(r),h=Math.sin(i),l=Math.sin(s),u=Math.sin(r);switch(t.order){case"XYZ":this.set(h*a*o+n*l*u,n*l*o-h*a*u,n*a*u+h*l*o,n*a*o-h*l*u,e);break;case"YXZ":this.set(h*a*o+n*l*u,n*l*o-h*a*u,n*a*u-h*l*o,n*a*o+h*l*u,e);break;case"ZXY":this.set(h*a*o-n*l*u,n*l*o+h*a*u,n*a*u+h*l*o,n*a*o-h*l*u,e);break;case"ZYX":this.set(h*a*o-n*l*u,n*l*o+h*a*u,n*a*u-h*l*o,n*a*o+h*l*u,e);break;case"YZX":this.set(h*a*o+n*l*u,n*l*o+h*a*u,n*a*u-h*l*o,n*a*o-h*l*u,e);break;case"XZY":this.set(h*a*o-n*l*u,n*l*o-h*a*u,n*a*u+h*l*o,n*a*o+h*l*u,e)}return this},setFromRotationMatrix:function(t){var e,i=t.val,s=i[0],r=i[4],n=i[8],a=i[1],o=i[5],h=i[9],l=i[2],u=i[6],d=i[10],c=s+o+d;return c>0?(e=.5/Math.sqrt(c+1),this.set((u-h)*e,(n-l)*e,(a-r)*e,.25/e)):s>o&&s>d?(e=2*Math.sqrt(1+s-o-d),this.set(.25*e,(r+a)/e,(n+l)/e,(u-h)/e)):o>d?(e=2*Math.sqrt(1+o-s-d),this.set((r+a)/e,.25*e,(h+u)/e,(n-l)/e)):(e=2*Math.sqrt(1+d-s-o),this.set((n+l)/e,(h+u)/e,.25*e,(a-r)/e)),this},fromMat3:function(t){var e,i=t.val,s=i[0]+i[4]+i[8];if(s>0)e=Math.sqrt(s+1),this.w=.5*e,e=.5/e,this._x=(i[7]-i[5])*e,this._y=(i[2]-i[6])*e,this._z=(i[3]-i[1])*e;else{var r=0;i[4]>i[0]&&(r=1),i[8]>i[3*r+r]&&(r=2);var n=h[r],a=h[n];e=Math.sqrt(i[3*r+r]-i[3*n+n]-i[3*a+a]+1),l[r]=.5*e,e=.5/e,l[n]=(i[3*n+r]+i[3*r+n])*e,l[a]=(i[3*a+r]+i[3*r+a])*e,this._x=l[0],this._y=l[1],this._z=l[2],this._w=(i[3*a+n]-i[3*n+a])*e}return this.onChangeCallback(this),this}});t.exports=p},43396(t,e,i){var s=i(36383);t.exports=function(t){return t*s.RAD_TO_DEG}},74362(t){t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI;return t.x=Math.cos(i)*e,t.y=Math.sin(i)*e,t}},60706(t){t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI,s=2*Math.random()-1,r=Math.sqrt(1-s*s)*e;return t.x=Math.cos(i)*r,t.y=Math.sin(i)*r,t.z=s*e,t}},67421(t){t.exports=function(t,e){return void 0===e&&(e=1),t.x=(2*Math.random()-1)*e,t.y=(2*Math.random()-1)*e,t.z=(2*Math.random()-1)*e,t.w=(2*Math.random()-1)*e,t}},36305(t){t.exports=function(t,e){var i=t.x,s=t.y;return t.x=i*Math.cos(e)-s*Math.sin(e),t.y=i*Math.sin(e)+s*Math.cos(e),t}},11520(t){t.exports=function(t,e,i,s){var r=Math.cos(s),n=Math.sin(s),a=t.x-e,o=t.y-i;return t.x=a*r-o*n+e,t.y=a*n+o*r+i,t}},1163(t){t.exports=function(t,e,i,s,r){var n=s+Math.atan2(t.y-i,t.x-e);return t.x=e+r*Math.cos(n),t.y=i+r*Math.sin(n),t}},70336(t){t.exports=function(t,e,i,s,r){return t.x=e+r*Math.cos(s),t.y=i+r*Math.sin(s),t}},72678(t,e,i){var s=i(25836),r=i(37867),n=i(15746),a=new r,o=new n,h=new s;t.exports=function(t,e,i){return o.setAxisAngle(e,i),a.fromRotationTranslation(o,h.set(0,0,0)),t.transformMat4(a)}},2284(t){t.exports=function(t){return t>0?Math.ceil(t):Math.floor(t)}},41013(t){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.round(t*s)/s}},7602(t){t.exports=function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)}},54261(t){t.exports=function(t,e,i){return(t=Math.max(0,Math.min(1,(t-e)/(i-e))))*t*t*(t*(6*t-15)+10)}},44408(t,e,i){var s=i(26099);t.exports=function(t,e,i,r){void 0===r&&(r=new s);var n=0,a=0;return t>0&&t<=e*i&&(n=t>e-1?t-(a=Math.floor(t/e))*e:t),r.set(n,a)}},85955(t,e,i){var s=i(26099);t.exports=function(t,e,i,r,n,a,o,h){void 0===h&&(h=new s);var l=Math.sin(n),u=Math.cos(n),d=u*a,c=l*a,f=-l*o,p=u*o,m=1/(d*p+f*-c);return h.x=p*m*t+-f*m*e+(r*f-i*p)*m,h.y=d*m*e+-c*m*t+(-r*d+i*c)*m,h}},26099(t,e,i){t.exports=i(70038).default},25836(t,e,i){var s=new(i(83419))({initialize:function(t,e,i){this.x=0,this.y=0,this.z=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0)},up:function(){return this.x=0,this.y=1,this.z=0,this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clone:function(){return new s(this.x,this.y,this.z)},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},crossVectors:function(t,e){var i=t.x,s=t.y,r=t.z,n=e.x,a=e.y,o=e.z;return this.x=s*o-r*a,this.y=r*n-i*o,this.z=i*a-s*n,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this},set:function(t,e,i){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0),this},setFromMatrixPosition:function(t){return this.fromArray(t.val,12)},setFromMatrixColumn:function(t,e){return this.fromArray(t.val,4*e)},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addScale:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t):(this.x=0,this.y=0,this.z=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0;return Math.sqrt(e*e+i*i+s*s)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0;return e*e+i*i+s*s},length:function(){var t=this.x,e=this.y,i=this.z;return Math.sqrt(t*t+e*e+i*i)},lengthSq:function(){var t=this.x,e=this.y,i=this.z;return t*t+e*e+i*i},normalize:function(){var t=this.x,e=this.y,i=this.z,s=t*t+e*e+i*i;return s>0&&(s=1/Math.sqrt(s),this.x=t*s,this.y=e*s,this.z=i*s),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},cross:function(t){var e=this.x,i=this.y,s=this.z,r=t.x,n=t.y,a=t.z;return this.x=i*a-s*n,this.y=s*r-e*a,this.z=e*n-i*r,this},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,r=this.z;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this.z=r+e*(t.z-r),this},applyMatrix3:function(t){var e=this.x,i=this.y,s=this.z,r=t.val;return this.x=r[0]*e+r[3]*i+r[6]*s,this.y=r[1]*e+r[4]*i+r[7]*s,this.z=r[2]*e+r[5]*i+r[8]*s,this},applyMatrix4:function(t){var e=this.x,i=this.y,s=this.z,r=t.val,n=1/(r[3]*e+r[7]*i+r[11]*s+r[15]);return this.x=(r[0]*e+r[4]*i+r[8]*s+r[12])*n,this.y=(r[1]*e+r[5]*i+r[9]*s+r[13])*n,this.z=(r[2]*e+r[6]*i+r[10]*s+r[14])*n,this},transformMat3:function(t){var e=this.x,i=this.y,s=this.z,r=t.val;return this.x=e*r[0]+i*r[3]+s*r[6],this.y=e*r[1]+i*r[4]+s*r[7],this.z=e*r[2]+i*r[5]+s*r[8],this},transformMat4:function(t){var e=this.x,i=this.y,s=this.z,r=t.val;return this.x=r[0]*e+r[4]*i+r[8]*s+r[12],this.y=r[1]*e+r[5]*i+r[9]*s+r[13],this.z=r[2]*e+r[6]*i+r[10]*s+r[14],this},transformCoordinates:function(t){var e=this.x,i=this.y,s=this.z,r=t.val,n=e*r[0]+i*r[4]+s*r[8]+r[12],a=e*r[1]+i*r[5]+s*r[9]+r[13],o=e*r[2]+i*r[6]+s*r[10]+r[14],h=e*r[3]+i*r[7]+s*r[11]+r[15];return this.x=n/h,this.y=a/h,this.z=o/h,this},transformQuat:function(t){var e=this.x,i=this.y,s=this.z,r=t.x,n=t.y,a=t.z,o=t.w,h=o*e+n*s-a*i,l=o*i+a*e-r*s,u=o*s+r*i-n*e,d=-r*e-n*i-a*s;return this.x=h*o+d*-r+l*-a-u*-n,this.y=l*o+d*-n+u*-r-h*-a,this.z=u*o+d*-a+h*-n-l*-r,this},project:function(t){var e=this.x,i=this.y,s=this.z,r=t.val,n=r[0],a=r[1],o=r[2],h=r[3],l=r[4],u=r[5],d=r[6],c=r[7],f=r[8],p=r[9],m=r[10],g=r[11],v=r[12],x=r[13],y=r[14],T=1/(e*h+i*c+s*g+r[15]);return this.x=(e*n+i*l+s*f+v)*T,this.y=(e*a+i*u+s*p+x)*T,this.z=(e*o+i*d+s*m+y)*T,this},projectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unprojectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unproject:function(t,e){var i=t.x,s=t.y,r=t.z,n=t.w,a=this.x-i,o=n-this.y-1-s,h=this.z;return this.x=2*a/r-1,this.y=2*o/n-1,this.z=2*h-1,this.project(e)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});s.ZERO=new s,s.RIGHT=new s(1,0,0),s.LEFT=new s(-1,0,0),s.UP=new s(0,-1,0),s.DOWN=new s(0,1,0),s.FORWARD=new s(0,0,1),s.BACK=new s(0,0,-1),s.ONE=new s(1,1,1),t.exports=s},61369(t,e,i){var s=new(i(83419))({initialize:function(t,e,i,s){this.x=0,this.y=0,this.z=0,this.w=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=s||0)},clone:function(){return new s(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this.w=t.w||0,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},set:function(t,e,i,s){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=s||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this.w+=t.w||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this.w-=t.w||0,this},scale:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},length:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return Math.sqrt(t*t+e*e+i*i+s*s)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return t*t+e*e+i*i+s*s},normalize:function(){var t=this.x,e=this.y,i=this.z,s=this.w,r=t*t+e*e+i*i+s*s;return r>0&&(r=1/Math.sqrt(r),this.x=t*r,this.y=e*r,this.z=i*r,this.w=s*r),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,r=this.z,n=this.w;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this.z=r+e*(t.z-r),this.w=n+e*(t.w-n),this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this.w*=t.w||1,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this.w/=t.w||1,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0,r=t.w-this.w||0;return Math.sqrt(e*e+i*i+s*s+r*r)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0,r=t.w-this.w||0;return e*e+i*i+s*s+r*r},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},transformMat4:function(t){var e=this.x,i=this.y,s=this.z,r=this.w,n=t.val;return this.x=n[0]*e+n[4]*i+n[8]*s+n[12]*r,this.y=n[1]*e+n[5]*i+n[9]*s+n[13]*r,this.z=n[2]*e+n[6]*i+n[10]*s+n[14]*r,this.w=n[3]*e+n[7]*i+n[11]*s+n[15]*r,this},transformQuat:function(t){var e=this.x,i=this.y,s=this.z,r=t.x,n=t.y,a=t.z,o=t.w,h=o*e+n*s-a*i,l=o*i+a*e-r*s,u=o*s+r*i-n*e,d=-r*e-n*i-a*s;return this.x=h*o+d*-r+l*-a-u*-n,this.y=l*o+d*-n+u*-r-h*-a,this.z=u*o+d*-a+h*-n-l*-r,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});s.prototype.sub=s.prototype.subtract,s.prototype.mul=s.prototype.multiply,s.prototype.div=s.prototype.divide,s.prototype.dist=s.prototype.distance,s.prototype.distSq=s.prototype.distanceSq,s.prototype.len=s.prototype.length,s.prototype.lenSq=s.prototype.lengthSq,t.exports=s},60417(t){t.exports=function(t,e,i){return Math.abs(t-e)<=i}},15994(t,e,i){t.exports=i(68077).default},31040(t){t.exports=function(t,e,i,s){return Math.atan2(s-e,i-t)}},55495(t){t.exports=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}},128(t){t.exports=function(t,e){return Math.atan2(e.x-t.x,e.y-t.y)}},41273(t){t.exports=function(t,e,i,s){return Math.atan2(i-t,s-e)}},1432(t,e,i){var s=i(36383);t.exports=function(t){return t>Math.PI&&(t-=s.TAU),Math.abs(((t+s.PI_OVER_2)%s.TAU-s.TAU)%s.TAU)}},49127(t,e,i){var s=i(12407);t.exports=function(t,e){return s(e-t)}},52285(t,e,i){var s=i(36383),r=i(12407),n=s.TAU;t.exports=function(t,e){var i=r(e-t);return i>0&&(i-=n),i}},67317(t,e,i){var s=i(86554);t.exports=function(t,e){return s(e-t)}},12407(t){t.exports=function(t){return(t%=2*Math.PI)>=0?t:t+2*Math.PI}},53993(t,e,i){var s=i(99472);t.exports=function(){return s(-Math.PI,Math.PI)}},86564(t,e,i){var s=i(99472);t.exports=function(){return s(-180,180)}},90154(t,e,i){var s=i(12407);t.exports=function(t){return s(t+Math.PI)}},48736(t,e,i){var s=i(36383);t.exports=function(t,e,i){return void 0===i&&(i=.05),t===e||(Math.abs(e-t)<=i||Math.abs(e-t)>=s.TAU-i?t=e:(Math.abs(e-t)>Math.PI&&(et?t+=i:e=1?1:1/e*(1+(e*t|0))}},49752(t,e,i){t.exports=i(72251)},75698(t){t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.ceil(t-e)}},43855(t,e,i){t.exports=i(30010).default},25777(t){t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.floor(t+e)}},5470(t){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t>e-i}},94977(t){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t1?t[i]-(s(r-i,t[i],t[i],t[i-1],t[i-1])-t[i]):s(r-n,t[n?n-1:0],t[n],t[i1?s(t[i],t[i-1],i-r):s(t[n],t[n+1>i?i:n+1],r-n)}},32112(t){t.exports=function(t,e,i,s){return function(t,e){var i=1-t;return i*i*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,i)+function(t,e){return t*t*e}(t,s)}},47235(t,e,i){var s=i(7602);t.exports=function(t,e,i){return e+(i-e)*s(t,0,1)}},50178(t,e,i){var s=i(54261);t.exports=function(t,e,i){return e+(i-e)*s(t,0,1)}},38289(t,e,i){t.exports={Bezier:i(89318),CatmullRom:i(77259),CubicBezier:i(36316),Linear:i(28392),QuadraticBezier:i(32112),SmoothStep:i(47235),SmootherStep:i(50178)}},98439(t){t.exports=function(t){var e=Math.log(t)/.6931471805599453;return 1<0&&!(t&t-1)&&e>0&&!(e&e-1)}},81230(t){t.exports=function(t){return t>0&&!(t&t-1)}},49001(t,e,i){t.exports={GetNext:i(98439),IsSize:i(50030),IsValue:i(81230)}},28453(t,e,i){var s=new(i(83419))({initialize:function(t){void 0===t&&(t=[(Date.now()*Math.random()).toString()]),this.c=1,this.s0=0,this.s1=0,this.s2=0,this.n=0,this.signs=[-1,1],t&&this.init(t)},rnd:function(){var t=2091639*this.s0+2.3283064365386963e-10*this.c;return this.c=0|t,this.s0=this.s1,this.s1=this.s2,this.s2=t-this.c,this.s2},hash:function(t){var e,i=this.n;t=t.toString();for(var s=0;s>>0,i=(e*=i)>>>0,i+=4294967296*(e-=i);return this.n=i,2.3283064365386963e-10*(i>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e0;e--){var i=Math.floor(this.frac()*(e+1)),s=t[i];t[i]=t[e],t[e]=s}return t}});t.exports=s},63448(t){t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.ceil(t/e),s?(i+t)/e:i+t)}},56583(t){t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.floor(t/e),s?(i+t)/e:i+t)}},77720(t){t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.round(t/e),s?(i+t)/e:i+t)}},73697(t,e,i){t.exports={Ceil:i(63448),Floor:i(56583),To:i(77720)}},97139(t,e,i){i(63595);var s=i(8054),r=i(79291),n={Actions:i(61061),Animations:i(60421),BlendModes:i(10312),Cache:i(83388),Cameras:i(26638),Core:i(42857),Class:i(83419),Curves:i(25410),Data:i(44965),Display:i(27460),DOM:i(84902),Events:i(93055),Filters:i(11889),Game:i(50127),GameObjects:i(77856),Geom:i(55738),Input:i(14350),Loader:i(57777),Math:i(75508),Physics:{Arcade:i(27064)},Plugins:i(18922),Renderer:i(36909),Scale:i(93364),ScaleModes:i(29795),Scene:i(97482),Scenes:i(62194),Structs:i(41392),Textures:i(27458),Tilemaps:i(62501),Time:i(90291),TintModes:i(84322),Tweens:i(43066),Utils:i(91799)};n.Sound=i(23717),n=r(!1,n,s),t.exports=n,i.g.Phaser=n},71289(t,e,i){var s=i(83419),r=i(92209),n=i(88571),a=new s({Extends:n,Mixins:[r.Acceleration,r.Angular,r.Bounce,r.Collision,r.Debug,r.Drag,r.Enable,r.Friction,r.Gravity,r.Immovable,r.Mass,r.Pushable,r.Size,r.Velocity],initialize:function(t,e,i,s,r){n.call(this,t,e,i,s,r),this.body=null}});t.exports=a},86689(t,e,i){var s=i(83419),r=i(39506),n=i(20339),a=i(89774),o=i(66022),h=i(95540),l=i(46975),u=i(72441),d=i(47956),c=i(37277),f=i(44594),p=i(26099),m=i(82248),g=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.config=this.getConfig(),this.world,this.add,this._category=1,t.sys.events.once(f.BOOT,this.boot,this),t.sys.events.on(f.START,this.start,this)},boot:function(){this.world=new m(this.scene,this.config),this.add=new o(this.world),this.systems.events.once(f.DESTROY,this.destroy,this)},start:function(){this.world||(this.world=new m(this.scene,this.config),this.add=new o(this.world));var t=this.systems.events;h(this.config,"customUpdate",!1)||t.on(f.UPDATE,this.world.update,this.world),t.on(f.POST_UPDATE,this.world.postUpdate,this.world),t.once(f.SHUTDOWN,this.shutdown,this)},enableUpdate:function(){this.systems.events.on(f.UPDATE,this.world.update,this.world)},disableUpdate:function(){this.systems.events.off(f.UPDATE,this.world.update,this.world)},getConfig:function(){var t=this.systems.game.config.physics,e=this.systems.settings.physics;return l(h(e,"arcade",{}),h(t,"arcade",{}))},nextCategory:function(){return this._category=this._category<<1,this._category},overlap:function(t,e,i,s,r){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===r&&(r=i),this.world.collideObjects(t,e,i,s,r,!0)},collide:function(t,e,i,s,r){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===r&&(r=i),this.world.collideObjects(t,e,i,s,r,!1)},collideTiles:function(t,e,i,s,r){return this.world.collideTiles(t,e,i,s,r)},overlapTiles:function(t,e,i,s,r){return this.world.overlapTiles(t,e,i,s,r)},pause:function(){return this.world.pause()},resume:function(){return this.world.resume()},accelerateTo:function(t,e,i,s,r,n){void 0===s&&(s=60);var a=Math.atan2(i-t.y,e-t.x);return t.body.acceleration.setToPolar(a,s),void 0!==r&&void 0!==n&&t.body.maxVelocity.set(r,n),a},accelerateToObject:function(t,e,i,s,r){return this.accelerateTo(t,e.x,e.y,i,s,r)},closest:function(t,e){e||(e=Array.from(this.world.bodies));for(var i=Number.MAX_VALUE,s=null,r=t.x,n=t.y,o=e.length,h=0;hi&&(s=l,i=d)}}return s},moveTo:function(t,e,i,s,r){void 0===s&&(s=60),void 0===r&&(r=0);var a=Math.atan2(i-t.y,e-t.x);return r>0&&(s=n(t.x,t.y,e,i)/(r/1e3)),t.body.velocity.setToPolar(a,s),a},moveToObject:function(t,e,i,s){return this.moveTo(t,e.x,e.y,i,s)},velocityFromAngle:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new p),i.setToPolar(r(t),e)},velocityFromRotation:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new p),i.setToPolar(t,e)},overlapRect:function(t,e,i,s,r,n){return d(this.world,t,e,i,s,r,n)},overlapCirc:function(t,e,i,s,r){return u(this.world,t,e,i,s,r)},shutdown:function(){if(this.world){var t=this.systems.events;t.off(f.UPDATE,this.world.update,this.world),t.off(f.POST_UPDATE,this.world.postUpdate,this.world),t.off(f.SHUTDOWN,this.shutdown,this),this.add.destroy(),this.world.destroy(),this.add=null,this.world=null,this._category=1}},destroy:function(){this.shutdown(),this.scene.sys.events.off(f.START,this.start,this),this.scene=null,this.systems=null}});c.register("ArcadePhysics",g,"arcadePhysics"),t.exports=g},13759(t,e,i){var s=i(83419),r=i(92209),n=i(68287),a=new s({Extends:n,Mixins:[r.Acceleration,r.Angular,r.Bounce,r.Collision,r.Debug,r.Drag,r.Enable,r.Friction,r.Gravity,r.Immovable,r.Mass,r.Pushable,r.Size,r.Velocity],initialize:function(t,e,i,s,r){n.call(this,t,e,i,s,r),this.body=null}});t.exports=a},37742(t,e,i){var s=i(83419),r=i(78389),n=i(37747),a=i(63012),o=i(43396),h=i(87841),l=i(37303),u=i(95829),d=i(26099),c=new s({Mixins:[r],initialize:function(t,e){var i=64,s=64,r=void 0!==e;r&&e.displayWidth&&(i=e.displayWidth,s=e.displayHeight),r||(e={x:0,y:0,angle:0,rotation:0,scaleX:1,scaleY:1,displayOriginX:0,displayOriginY:0}),this.world=t,this.gameObject=r?e:void 0,this.isBody=!0,this.transform={x:e.x,y:e.y,rotation:e.angle,scaleX:e.scaleX,scaleY:e.scaleY,displayOriginX:e.displayOriginX,displayOriginY:e.displayOriginY},this.debugShowBody=t.defaults.debugShowBody,this.debugShowVelocity=t.defaults.debugShowVelocity,this.debugBodyColor=t.defaults.bodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new d,this.position=new d(e.x-e.scaleX*e.displayOriginX,e.y-e.scaleY*e.displayOriginY),this.prev=this.position.clone(),this.prevFrame=this.position.clone(),this.allowRotation=!0,this.rotation=e.angle,this.preRotation=e.angle,this.width=i,this.height=s,this.sourceWidth=i,this.sourceHeight=s,e.frame&&(this.sourceWidth=e.frame.realWidth,this.sourceHeight=e.frame.realHeight),this.halfWidth=Math.abs(i/2),this.halfHeight=Math.abs(s/2),this.center=new d(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=new d,this.newVelocity=new d,this.deltaMax=new d,this.acceleration=new d,this.allowDrag=!0,this.drag=new d,this.allowGravity=!0,this.gravity=new d,this.bounce=new d,this.worldBounce=null,this.customBoundsRectangle=t.bounds,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.maxVelocity=new d(1e4,1e4),this.maxSpeed=-1,this.friction=new d(1,0),this.useDamping=!1,this.angularVelocity=0,this.angularAcceleration=0,this.angularDrag=0,this.maxAngular=1e3,this.mass=1,this.angle=0,this.speed=0,this.facing=n.FACING_NONE,this.immovable=!1,this.pushable=!0,this.slideFactor=new d(1,1),this.moves=!0,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision=u(!1),this.touching=u(!0),this.wasTouching=u(!0),this.blocked=u(!0),this.syncBounds=!1,this.physicsType=n.DYNAMIC_BODY,this.collisionCategory=1,this.collisionMask=1,this._sx=e.scaleX,this._sy=e.scaleY,this._dx=0,this._dy=0,this._tx=0,this._ty=0,this._bounds=new h,this.directControl=!1,this.autoFrame=this.position.clone()},updateBounds:function(){var t=this.gameObject,e=this.transform;if(t.parentContainer){var i=t.getWorldTransformMatrix(this.world._tempMatrix,this.world._tempMatrix2);e.x=i.tx,e.y=i.ty,e.rotation=o(i.rotation),e.scaleX=i.scaleX,e.scaleY=i.scaleY,e.displayOriginX=t.displayOriginX,e.displayOriginY=t.displayOriginY}else e.x=t.x,e.y=t.y,e.rotation=t.angle,e.scaleX=t.scaleX,e.scaleY=t.scaleY,e.displayOriginX=t.displayOriginX,e.displayOriginY=t.displayOriginY;var s=!1;if(this.syncBounds){var r=t.getBounds(this._bounds);this.width=r.width,this.height=r.height,s=!0}else{var n=Math.abs(e.scaleX),a=Math.abs(e.scaleY);this._sx===n&&this._sy===a||(this.width=this.sourceWidth*n,this.height=this.sourceHeight*a,this._sx=n,this._sy=a,s=!0)}s&&(this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter())},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},updateFromGameObject:function(){this.updateBounds();var t=this.transform;this.position.x=t.x+t.scaleX*(this.offset.x-t.displayOriginX),this.position.y=t.y+t.scaleY*(this.offset.y-t.displayOriginY),this.updateCenter()},resetFlags:function(t){void 0===t&&(t=!1);var e=this.wasTouching,i=this.touching,s=this.blocked;t?u(!0,e):(e.none=i.none,e.up=i.up,e.down=i.down,e.left=i.left,e.right=i.right),u(!0,i),u(!0,s),this.overlapR=0,this.overlapX=0,this.overlapY=0,this.embedded=!1},preUpdate:function(t,e){if(t&&this.resetFlags(),this.gameObject&&this.updateFromGameObject(),this.rotation=this.transform.rotation,this.preRotation=this.rotation,this.moves){var i=this.position;this.prev.x=i.x,this.prev.y=i.y,this.prevFrame.x=i.x,this.prevFrame.y=i.y}t&&this.update(e)},update:function(t){var e=this.prev,i=this.position,s=this.velocity;if(e.set(i.x,i.y),!this.moves)return this._dx=i.x-e.x,void(this._dy=i.y-e.y);if(this.directControl){var r=this.autoFrame;s.set((i.x-r.x)/t,(i.y-r.y)/t),this.world.updateMotion(this,t),this._dx=i.x-r.x,this._dy=i.y-r.y}else this.world.updateMotion(this,t),this.newVelocity.set(s.x*t,s.y*t),i.add(this.newVelocity),this._dx=i.x-e.x,this._dy=i.y-e.y;var n=s.x,o=s.y;if(this.updateCenter(),this.angle=Math.atan2(o,n),this.speed=Math.sqrt(n*n+o*o),this.collideWorldBounds&&this.checkWorldBounds()&&this.onWorldBounds){var h=this.blocked;this.world.emit(a.WORLD_BOUNDS,this,h.up,h.down,h.left,h.right)}},postUpdate:function(){var t=this.position,e=t.x-this.prevFrame.x,i=t.y-this.prevFrame.y,s=this.gameObject;if(this.moves){var r=this.deltaMax.x,a=this.deltaMax.y;0!==r&&0!==e&&(e<0&&e<-r?e=-r:e>0&&e>r&&(e=r)),0!==a&&0!==i&&(i<0&&i<-a?i=-a:i>0&&i>a&&(i=a)),s&&(s.x+=e,s.y+=i)}e<0?this.facing=n.FACING_LEFT:e>0&&(this.facing=n.FACING_RIGHT),i<0?this.facing=n.FACING_UP:i>0&&(this.facing=n.FACING_DOWN),this.allowRotation&&s&&(s.angle+=this.deltaZ()),this._tx=e,this._ty=i,this.autoFrame.set(t.x,t.y)},setBoundsRectangle:function(t){return this.customBoundsRectangle=t||this.world.bounds,this},checkWorldBounds:function(){var t=this.position,e=this.velocity,i=this.blocked,s=this.customBoundsRectangle,r=this.world.checkCollision,n=this.worldBounce?-this.worldBounce.x:-this.bounce.x,a=this.worldBounce?-this.worldBounce.y:-this.bounce.y,o=!1;return t.xs.right&&r.right&&(t.x=s.right-this.width,e.x*=n,i.right=!0,o=!0),t.ys.bottom&&r.down&&(t.y=s.bottom-this.height,e.y*=a,i.down=!0,o=!0),o&&(this.blocked.none=!1,this.updateCenter()),o},setOffset:function(t,e){return void 0===e&&(e=t),this.offset.set(t,e),this},setGameObject:function(t,e){if(void 0===e&&(e=!0),!t||!t.hasTransformComponent)return this;var i=this.world;return this.gameObject&&this.gameObject.body&&(i.disable(this.gameObject),this.gameObject.body=null),t.body&&i.disable(t),this.gameObject=t,t.body=this,this.setSize(),this.enable=e,this},setSize:function(t,e,i){void 0===i&&(i=!0);var s=this.gameObject;if(s&&(!t&&s.frame&&(t=s.frame.realWidth),!e&&s.frame&&(e=s.frame.realHeight)),this.sourceWidth=t,this.sourceHeight=e,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter(),i&&s&&s.getCenter){var r=(s.width-t)/2,n=(s.height-e)/2;this.offset.set(r,n)}return this.isCircle=!1,this.radius=0,this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.isCircle=!0,this.radius=t,this.sourceWidth=2*t,this.sourceHeight=2*t,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter()):this.isCircle=!1,this},reset:function(t,e){this.stop();var i=this.gameObject;i&&(i.setPosition(t,e),this.rotation=i.angle,this.preRotation=i.angle);var s=this.position;i&&i.getTopLeft?i.getTopLeft(s):s.set(t,e),this.prev.copy(s),this.prevFrame.copy(s),this.autoFrame.copy(s),i&&this.updateBounds(),this.updateCenter(),this.collideWorldBounds&&this.checkWorldBounds(),this.resetFlags(!0)},stop:function(){return this.velocity.set(0),this.acceleration.set(0),this.speed=0,this.angularVelocity=0,this.angularAcceleration=0,this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?this.radius>0&&t>=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom&&(this.center.x-t)*(this.center.x-t)+(this.center.y-e)*(this.center.y-e)<=this.radius*this.radius:l(this,t,e)},onFloor:function(){return this.blocked.down},onCeiling:function(){return this.blocked.up},onWall:function(){return this.blocked.left||this.blocked.right},deltaAbsX:function(){return this._dx>0?this._dx:-this._dx},deltaAbsY:function(){return this._dy>0?this._dy:-this._dy},deltaX:function(){return this._dx},deltaY:function(){return this._dy},deltaXFinal:function(){return this._tx},deltaYFinal:function(){return this._ty},deltaZ:function(){return this.rotation-this.preRotation},destroy:function(){this.enable=!1,this.world&&this.world.pendingDestroy.add(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,s=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(t.defaultStrokeWidth,this.debugBodyColor),this.isCircle?t.strokeCircle(i,s,this.width/2):(this.checkCollision.up&&t.lineBetween(e.x,e.y,e.x+this.width,e.y),this.checkCollision.right&&t.lineBetween(e.x+this.width,e.y,e.x+this.width,e.y+this.height),this.checkCollision.down&&t.lineBetween(e.x,e.y+this.height,e.x+this.width,e.y+this.height),this.checkCollision.left&&t.lineBetween(e.x,e.y,e.x,e.y+this.height))),this.debugShowVelocity&&(t.lineStyle(t.defaultStrokeWidth,this.world.defaults.velocityDebugColor,1),t.lineBetween(i,s,i+this.velocity.x/2,s+this.velocity.y/2))},willDrawDebug:function(){return this.debugShowBody||this.debugShowVelocity},setDirectControl:function(t){return void 0===t&&(t=!0),this.directControl=t,this},setCollideWorldBounds:function(t,e,i,s){void 0===t&&(t=!0),this.collideWorldBounds=t;var r=void 0!==e,n=void 0!==i;return(r||n)&&(this.worldBounce||(this.worldBounce=new d),r&&(this.worldBounce.x=e),n&&(this.worldBounce.y=i)),void 0!==s&&(this.onWorldBounds=s),this},setVelocity:function(t,e){return this.velocity.set(t,e),t=this.velocity.x,e=this.velocity.y,this.speed=Math.sqrt(t*t+e*e),this},setVelocityX:function(t){return this.setVelocity(t,this.velocity.y)},setVelocityY:function(t){return this.setVelocity(this.velocity.x,t)},setMaxVelocity:function(t,e){return this.maxVelocity.set(t,e),this},setMaxVelocityX:function(t){return this.maxVelocity.x=t,this},setMaxVelocityY:function(t){return this.maxVelocity.y=t,this},setMaxSpeed:function(t){return this.maxSpeed=t,this},setSlideFactor:function(t,e){return this.slideFactor.set(t,e),this},setBounce:function(t,e){return this.bounce.set(t,e),this},setBounceX:function(t){return this.bounce.x=t,this},setBounceY:function(t){return this.bounce.y=t,this},setAcceleration:function(t,e){return this.acceleration.set(t,e),this},setAccelerationX:function(t){return this.acceleration.x=t,this},setAccelerationY:function(t){return this.acceleration.y=t,this},setAllowDrag:function(t){return void 0===t&&(t=!0),this.allowDrag=t,this},setAllowGravity:function(t){return void 0===t&&(t=!0),this.allowGravity=t,this},setAllowRotation:function(t){return void 0===t&&(t=!0),this.allowRotation=t,this},setDrag:function(t,e){return this.drag.set(t,e),this},setDamping:function(t){return this.useDamping=t,this},setDragX:function(t){return this.drag.x=t,this},setDragY:function(t){return this.drag.y=t,this},setGravity:function(t,e){return this.gravity.set(t,e),this},setGravityX:function(t){return this.gravity.x=t,this},setGravityY:function(t){return this.gravity.y=t,this},setFriction:function(t,e){return this.friction.set(t,e),this},setFrictionX:function(t){return this.friction.x=t,this},setFrictionY:function(t){return this.friction.y=t,this},setAngularVelocity:function(t){return this.angularVelocity=t,this},setAngularAcceleration:function(t){return this.angularAcceleration=t,this},setAngularDrag:function(t){return this.angularDrag=t,this},setMass:function(t){return this.mass=t,this},setImmovable:function(t){return void 0===t&&(t=!0),this.immovable=t,this},setEnable:function(t){return void 0===t&&(t=!0),this.enable=t,this},processX:function(t,e,i,s){this.x+=t,this.updateCenter(),null!==e&&(this.velocity.x=e*this.slideFactor.x);var r=this.blocked;i&&(r.left=!0,r.none=!1),s&&(r.right=!0,r.none=!1)},processY:function(t,e,i,s){this.y+=t,this.updateCenter(),null!==e&&(this.velocity.y=e*this.slideFactor.y);var r=this.blocked;i&&(r.up=!0,r.none=!1),s&&(r.down=!0,r.none=!1)},x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=c},79342(t,e,i){var s=new(i(83419))({initialize:function(t,e,i,s,r,n,a){this.world=t,this.name="",this.active=!0,this.overlapOnly=e,this.object1=i,this.object2=s,this.collideCallback=r,this.processCallback=n,this.callbackContext=a},setName:function(t){return this.name=t,this},update:function(){this.world.collideObjects(this.object1,this.object2,this.collideCallback,this.processCallback,this.callbackContext,this.overlapOnly)},destroy:function(){this.world.removeCollider(this),this.active=!1,this.world=null,this.object1=null,this.object2=null,this.collideCallback=null,this.processCallback=null,this.callbackContext=null}});t.exports=s},66022(t,e,i){var s=i(71289),r=i(13759),n=i(37742),a=i(83419),o=i(37747),h=i(60758),l=i(72624),u=i(71464),d=new a({initialize:function(t){this.world=t,this.scene=t.scene,this.sys=t.scene.sys},collider:function(t,e,i,s,r){return this.world.addCollider(t,e,i,s,r)},overlap:function(t,e,i,s,r){return this.world.addOverlap(t,e,i,s,r)},existing:function(t,e){var i=e?o.STATIC_BODY:o.DYNAMIC_BODY;return this.world.enableBody(t,i),t},staticImage:function(t,e,i,r){var n=new s(this.scene,t,e,i,r);return this.sys.displayList.add(n),this.world.enableBody(n,o.STATIC_BODY),n},image:function(t,e,i,r){var n=new s(this.scene,t,e,i,r);return this.sys.displayList.add(n),this.world.enableBody(n,o.DYNAMIC_BODY),n},staticSprite:function(t,e,i,s){var n=new r(this.scene,t,e,i,s);return this.sys.displayList.add(n),this.sys.updateList.add(n),this.world.enableBody(n,o.STATIC_BODY),n},sprite:function(t,e,i,s){var n=new r(this.scene,t,e,i,s);return this.sys.displayList.add(n),this.sys.updateList.add(n),this.world.enableBody(n,o.DYNAMIC_BODY),n},staticGroup:function(t,e){return this.sys.updateList.add(new u(this.world,this.world.scene,t,e))},group:function(t,e){return this.sys.updateList.add(new h(this.world,this.world.scene,t,e))},body:function(t,e,i,s){var r=new n(this.world);return r.position.set(t,e),i&&s&&r.setSize(i,s),this.world.add(r,o.DYNAMIC_BODY),r},staticBody:function(t,e,i,s){var r=new l(this.world);return r.position.set(t,e),i&&s&&r.setSize(i,s),this.world.add(r,o.STATIC_BODY),r},destroy:function(){this.world=null,this.scene=null,this.sys=null}});t.exports=d},79599(t){t.exports=function(t){var e=0;if(Array.isArray(t))for(var i=0;ie._dx?(n=t.right-e.x)>a&&!i||!1===t.checkCollision.right||!1===e.checkCollision.left?n=0:(t.touching.none=!1,t.touching.right=!0,e.touching.none=!1,e.touching.left=!0,e.physicsType!==s.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.right=!0),t.physicsType!==s.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.left=!0)):t._dxa&&!i||!1===t.checkCollision.left||!1===e.checkCollision.right?n=0:(t.touching.none=!1,t.touching.left=!0,e.touching.none=!1,e.touching.right=!0,e.physicsType!==s.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.left=!0),t.physicsType!==s.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.right=!0))),t.overlapX=n,e.overlapX=n,n}},45170(t,e,i){var s=i(37747);t.exports=function(t,e,i,r){var n=0,a=t.deltaAbsY()+e.deltaAbsY()+r;return 0===t._dy&&0===e._dy?(t.embedded=!0,e.embedded=!0):t._dy>e._dy?(n=t.bottom-e.y)>a&&!i||!1===t.checkCollision.down||!1===e.checkCollision.up?n=0:(t.touching.none=!1,t.touching.down=!0,e.touching.none=!1,e.touching.up=!0,e.physicsType!==s.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.down=!0),t.physicsType!==s.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.up=!0)):t._dya&&!i||!1===t.checkCollision.up||!1===e.checkCollision.down?n=0:(t.touching.none=!1,t.touching.up=!0,e.touching.none=!1,e.touching.down=!0,e.physicsType!==s.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.up=!0),t.physicsType!==s.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.down=!0))),t.overlapY=n,e.overlapY=n,n}},60758(t,e,i){var s=i(13759),r=i(83419),n=i(78389),a=i(37747),o=i(95540),h=i(26479),l=i(41212),u=new r({Extends:h,Mixins:[n],initialize:function(t,e,i,r){if(i||r)if(l(i))r=i,i=null,r.internalCreateCallback=this.createCallbackHandler,r.internalRemoveCallback=this.removeCallbackHandler;else if(Array.isArray(i)&&l(i[0])){var n=this;i.forEach(function(t){t.internalCreateCallback=n.createCallbackHandler,t.internalRemoveCallback=n.removeCallbackHandler,t.classType=o(t,"classType",s)}),r=null}else r={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler};else r={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler};this.world=t,r&&(r.classType=o(r,"classType",s)),this.physicsType=a.DYNAMIC_BODY,this.collisionCategory=1,this.collisionMask=2147483647,this.defaults={setCollideWorldBounds:o(r,"collideWorldBounds",!1),setBoundsRectangle:o(r,"customBoundsRectangle",null),setAccelerationX:o(r,"accelerationX",0),setAccelerationY:o(r,"accelerationY",0),setAllowDrag:o(r,"allowDrag",!0),setAllowGravity:o(r,"allowGravity",!0),setAllowRotation:o(r,"allowRotation",!0),setDamping:o(r,"useDamping",!1),setBounceX:o(r,"bounceX",0),setBounceY:o(r,"bounceY",0),setDragX:o(r,"dragX",0),setDragY:o(r,"dragY",0),setEnable:o(r,"enable",!0),setGravityX:o(r,"gravityX",0),setGravityY:o(r,"gravityY",0),setFrictionX:o(r,"frictionX",0),setFrictionY:o(r,"frictionY",0),setMaxSpeed:o(r,"maxSpeed",-1),setMaxVelocityX:o(r,"maxVelocityX",1e4),setMaxVelocityY:o(r,"maxVelocityY",1e4),setVelocityX:o(r,"velocityX",0),setVelocityY:o(r,"velocityY",0),setAngularVelocity:o(r,"angularVelocity",0),setAngularAcceleration:o(r,"angularAcceleration",0),setAngularDrag:o(r,"angularDrag",0),setMass:o(r,"mass",1),setImmovable:o(r,"immovable",!1)},h.call(this,e,i,r),this.type="PhysicsGroup"},createCallbackHandler:function(t){t.body&&t.body.physicsType===a.DYNAMIC_BODY||(t.body&&(t.body.destroy(),t.body=null),this.world.enableBody(t,a.DYNAMIC_BODY));var e=t.body;for(var i in this.defaults)e[i](this.defaults[i])},removeCallbackHandler:function(t){t.body&&this.world.disableBody(t)},setVelocity:function(t,e,i){void 0===i&&(i=0);for(var s=this.getChildren(),r=0;r0?1:-1),o=Math.sqrt(t*t*e.mass/i.mass)*(t>0?1:-1),h=.5*(r+o);return o-=h,n=h+(r-=h)*e.bounce.x,a=h+o*i.bounce.x,l&&g?y(0):c&&m?y(1):u&&m?y(2):!(!f||!g)&&y(3)},Set:function(t,n,a){i=n;var y=(e=t).velocity.x,T=i.velocity.x;return s=e.pushable,l=e._dx<0,u=e._dx>0,d=0===e._dx,m=Math.abs(e.right-i.x)<=Math.abs(i.right-e.x),o=T-y*e.bounce.x,r=i.pushable,c=i._dx<0,f=i._dx>0,p=0===i._dx,g=!m,h=y-T*i.bounce.x,v=Math.abs(a),x()},Run:y,RunImmovableBody1:function(t){if(1===t?i.velocity.x=0:m?i.processX(v,h,!0):i.processX(-v,h,!1,!0),e.moves){var s=e.directControl?e.y-e.autoFrame.y:e.y-e.prev.y;i.y+=s*e.friction.y,i._dy=i.y-i.prev.y}},RunImmovableBody2:function(t){if(2===t?e.velocity.x=0:g?e.processX(v,o,!0):e.processX(-v,o,!1,!0),i.moves){var s=i.directControl?i.y-i.autoFrame.y:i.y-i.prev.y;e.y+=s*i.friction.y,e._dy=e.y-e.prev.y}}}},47962(t){var e,i,s,r,n,a,o,h,l,u,d,c,f,p,m,g,v,x=function(){return u&&m&&i.blocked.down?(e.processY(-v,o,!1,!0),1):l&&g&&i.blocked.up?(e.processY(v,o,!0),1):f&&g&&e.blocked.down?(i.processY(-v,h,!1,!0),2):c&&m&&e.blocked.up?(i.processY(v,h,!0),2):0},y=function(t){if(s&&r)v*=.5,0===t||3===t?(e.processY(v,n),i.processY(-v,a)):(e.processY(-v,n),i.processY(v,a));else if(s&&!r)0===t||3===t?e.processY(v,o,!0):e.processY(-v,o,!1,!0);else if(!s&&r)0===t||3===t?i.processY(-v,h,!1,!0):i.processY(v,h,!0);else{var m=.5*v;0===t?p?(e.processY(v,0,!0),i.processY(0,null,!1,!0)):f?(e.processY(m,0,!0),i.processY(-m,0,!1,!0)):(e.processY(m,i.velocity.y,!0),i.processY(-m,null,!1,!0)):1===t?d?(e.processY(0,null,!1,!0),i.processY(v,0,!0)):u?(e.processY(-m,0,!1,!0),i.processY(m,0,!0)):(e.processY(-m,null,!1,!0),i.processY(m,e.velocity.y,!0)):2===t?p?(e.processY(-v,0,!1,!0),i.processY(0,null,!0)):c?(e.processY(-m,0,!1,!0),i.processY(m,0,!0)):(e.processY(-m,i.velocity.y,!1,!0),i.processY(m,null,!0)):3===t&&(d?(e.processY(0,null,!0),i.processY(-v,0,!1,!0)):l?(e.processY(m,0,!0),i.processY(-m,0,!1,!0)):(e.processY(m,i.velocity.y,!0),i.processY(-m,null,!1,!0)))}return!0};t.exports={BlockCheck:x,Check:function(){var t=e.velocity.y,s=i.velocity.y,r=Math.sqrt(s*s*i.mass/e.mass)*(s>0?1:-1),o=Math.sqrt(t*t*e.mass/i.mass)*(t>0?1:-1),h=.5*(r+o);return o-=h,n=h+(r-=h)*e.bounce.y,a=h+o*i.bounce.y,l&&g?y(0):c&&m?y(1):u&&m?y(2):!(!f||!g)&&y(3)},Set:function(t,n,a){i=n;var y=(e=t).velocity.y,T=i.velocity.y;return s=e.pushable,l=e._dy<0,u=e._dy>0,d=0===e._dy,m=Math.abs(e.bottom-i.y)<=Math.abs(i.bottom-e.y),o=T-y*e.bounce.y,r=i.pushable,c=i._dy<0,f=i._dy>0,p=0===i._dy,g=!m,h=y-T*i.bounce.y,v=Math.abs(a),x()},Run:y,RunImmovableBody1:function(t){if(1===t?i.velocity.y=0:m?i.processY(v,h,!0):i.processY(-v,h,!1,!0),e.moves){var s=e.directControl?e.x-e.autoFrame.x:e.x-e.prev.x;i.x+=s*e.friction.x,i._dx=i.x-i.prev.x}},RunImmovableBody2:function(t){if(2===t?e.velocity.y=0:g?e.processY(v,o,!0):e.processY(-v,o,!1,!0),i.moves){var s=i.directControl?i.x-i.autoFrame.x:i.x-i.prev.x;e.x+=s*i.friction.x,e._dx=e.x-e.prev.x}}}},14087(t,e,i){var s=i(64897),r=i(3017);t.exports=function(t,e,i,n,a){void 0===a&&(a=s(t,e,i,n));var o=t.immovable,h=e.immovable;if(i||0===a||o&&h||t.customSeparateX||e.customSeparateX)return 0!==a||t.embedded&&e.embedded;var l=r.Set(t,e,a);return o||h?(o?r.RunImmovableBody1(l):h&&r.RunImmovableBody2(l),!0):l>0||r.Check()}},89936(t,e,i){var s=i(45170),r=i(47962);t.exports=function(t,e,i,n,a){void 0===a&&(a=s(t,e,i,n));var o=t.immovable,h=e.immovable;if(i||0===a||o&&h||t.customSeparateY||e.customSeparateY)return 0!==a||t.embedded&&e.embedded;var l=r.Set(t,e,a);return o||h?(o?r.RunImmovableBody1(l):h&&r.RunImmovableBody2(l),!0):l>0||r.Check()}},95829(t){t.exports=function(t,e){return void 0===e&&(e={}),e.none=t,e.up=!1,e.down=!1,e.left=!1,e.right=!1,t||(e.up=!0,e.down=!0,e.left=!0,e.right=!0),e}},72624(t,e,i){var s=i(87902),r=i(83419),n=i(78389),a=i(37747),o=i(37303),h=i(95829),l=i(26099),u=new r({Mixins:[n],initialize:function(t,e){var i=64,s=64,r=void 0!==e;r&&e.displayWidth&&(i=e.displayWidth,s=e.displayHeight),r||(e={x:0,y:0,angle:0,rotation:0,scaleX:1,scaleY:1,displayOriginX:0,displayOriginY:0}),this.world=t,this.gameObject=r?e:void 0,this.isBody=!0,this.debugShowBody=t.defaults.debugShowStaticBody,this.debugBodyColor=t.defaults.staticBodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new l,this.position=new l(e.x-i*e.originX,e.y-s*e.originY),this.width=i,this.height=s,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center=new l(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=l.ZERO,this.allowGravity=!1,this.gravity=l.ZERO,this.bounce=l.ZERO,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.mass=1,this.immovable=!0,this.pushable=!1,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision=h(!1),this.touching=h(!0),this.wasTouching=h(!0),this.blocked=h(!0),this.physicsType=a.STATIC_BODY,this.collisionCategory=1,this.collisionMask=1,this._dx=0,this._dy=0},setGameObject:function(t,e,i){if(void 0===e&&(e=!0),void 0===i&&(i=!0),!t||!t.hasTransformComponent)return this;var s=this.world;return this.gameObject&&this.gameObject.body&&(s.disable(this.gameObject),this.gameObject.body=null),t.body&&s.disable(t),this.gameObject=t,t.body=this,this.setSize(),e&&this.updateFromGameObject(),this.enable=i,this},updateFromGameObject:function(){this.world.staticTree.remove(this);var t=this.gameObject;return t.getTopLeft(this.position),this.width=t.displayWidth,this.height=t.displayHeight,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.world.staticTree.insert(this),this},setOffset:function(t,e){return void 0===e&&(e=t),this.world.staticTree.remove(this),this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(t,e),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this),this},setSize:function(t,e,i){void 0===i&&(i=!0);var s=this.gameObject;if(s&&s.frame&&(t||(t=s.frame.realWidth),e||(e=s.frame.realHeight)),this.world.staticTree.remove(this),this.width=t,this.height=e,this.halfWidth=Math.floor(t/2),this.halfHeight=Math.floor(e/2),i&&s&&s.getCenter){var r=s.displayWidth/2,n=s.displayHeight/2;this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(r-this.halfWidth,n-this.halfHeight),this.position.x+=this.offset.x,this.position.y+=this.offset.y}return this.updateCenter(),this.isCircle=!1,this.radius=0,this.world.staticTree.insert(this),this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.world.staticTree.remove(this),this.isCircle=!0,this.radius=t,this.width=2*t,this.height=2*t,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter(),this.world.staticTree.insert(this)):this.isCircle=!1,this},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},reset:function(t,e){var i=this.gameObject;void 0===t&&(t=i.x),void 0===e&&(e=i.y),this.world.staticTree.remove(this),i.setPosition(t,e),i.getTopLeft(this.position),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this)},stop:function(){return this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?s(this,t,e):o(this,t,e)},postUpdate:function(){},deltaAbsX:function(){return 0},deltaAbsY:function(){return 0},deltaX:function(){return 0},deltaY:function(){return 0},deltaZ:function(){return 0},destroy:function(){this.enable=!1,this.world.pendingDestroy.add(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,s=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(t.defaultStrokeWidth,this.debugBodyColor,1),this.isCircle?t.strokeCircle(i,s,this.width/2):t.strokeRect(e.x,e.y,this.width,this.height))},willDrawDebug:function(){return this.debugShowBody},setMass:function(t){return t<=0&&(t=.1),this.mass=t,this},x:{get:function(){return this.position.x},set:function(t){this.world.staticTree.remove(this),this.position.x=t,this.world.staticTree.insert(this)}},y:{get:function(){return this.position.y},set:function(t){this.world.staticTree.remove(this),this.position.y=t,this.world.staticTree.insert(this)}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=u},71464(t,e,i){var s=i(13759),r=i(83419),n=i(78389),a=i(37747),o=i(95540),h=i(26479),l=i(41212),u=new r({Extends:h,Mixins:[n],initialize:function(t,e,i,r){i||r?l(i)?(r=i,i=null,r.internalCreateCallback=this.createCallbackHandler,r.internalRemoveCallback=this.removeCallbackHandler,r.createMultipleCallback=this.createMultipleCallbackHandler,r.classType=o(r,"classType",s)):Array.isArray(i)&&l(i[0])?(r=i,i=null,r.forEach(function(t){t.internalCreateCallback=this.createCallbackHandler,t.internalRemoveCallback=this.removeCallbackHandler,t.createMultipleCallback=this.createMultipleCallbackHandler,t.classType=o(t,"classType",s)},this)):r={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler}:r={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler,createMultipleCallback:this.createMultipleCallbackHandler,classType:s},this.world=t,this.physicsType=a.STATIC_BODY,this.collisionCategory=1,this.collisionMask=1,h.call(this,e,i,r),this.type="StaticPhysicsGroup"},createCallbackHandler:function(t){t.body&&t.body.physicsType===a.STATIC_BODY||(t.body&&(t.body.destroy(),t.body=null),this.world.enableBody(t,a.STATIC_BODY))},removeCallbackHandler:function(t){t.body&&this.world.disableBody(t)},createMultipleCallbackHandler:function(){this.refresh()},refresh:function(){for(var t=Array.from(this.children),e=0;e=s;if(this.fixedStep||(i=.001*e,n=!0,this._elapsed=0),r.forEach(function(t){t.enable&&t.preUpdate(n,i)}),n){this._elapsed-=s,this.stepsLastFrame=1,this.useTree&&(this.tree.clear(),this.tree.load(Array.from(r)));for(var a=this.colliders.update(),o=0;o=s;)this._elapsed-=s,this.step(i)}},step:function(t){var e=this.bodies;e.forEach(function(e){e.enable&&e.update(t)}),this.useTree&&(this.tree.clear(),this.tree.load(Array.from(e)));for(var i=this.colliders.update(),s=0;s0){var r=this.tree,n=this.staticTree;s.forEach(function(i){i.physicsType===h.DYNAMIC_BODY?(r.remove(i),t.delete(i)):i.physicsType===h.STATIC_BODY&&(n.remove(i),e.delete(i)),i.world=void 0,i.gameObject=void 0}),s.clear()}},updateMotion:function(t,e){t.allowRotation&&this.computeAngularVelocity(t,e),this.computeVelocity(t,e)},computeAngularVelocity:function(t,e){var i=t.angularVelocity,s=t.angularAcceleration,r=t.angularDrag,a=t.maxAngular;s?i+=s*e:t.allowDrag&&r&&(p(i-(r*=e),0,.1)?i-=r:m(i+r,0,.1)?i+=r:i=0);var o=(i=n(i,-a,a))-t.angularVelocity;t.angularVelocity+=o,t.rotation+=t.angularVelocity*e},computeVelocity:function(t,e){var i=t.velocity.x,s=t.acceleration.x,r=t.drag.x,a=t.maxVelocity.x,o=t.velocity.y,h=t.acceleration.y,l=t.drag.y,u=t.maxVelocity.y,d=t.speed,c=t.maxSpeed,g=t.allowDrag,v=t.useDamping;t.allowGravity&&(i+=(this.gravity.x+t.gravity.x)*e,o+=(this.gravity.y+t.gravity.y)*e),s?i+=s*e:g&&r&&(v?(i*=r=Math.pow(r,e),d=Math.sqrt(i*i+o*o),f(d,0,.001)&&(i=0)):p(i-(r*=e),0,.01)?i-=r:m(i+r,0,.01)?i+=r:i=0),h?o+=h*e:g&&l&&(v?(o*=l=Math.pow(l,e),d=Math.sqrt(i*i+o*o),f(d,0,.001)&&(o=0)):p(o-(l*=e),0,.01)?o-=l:m(o+l,0,.01)?o+=l:o=0),i=n(i,-a,a),o=n(o,-u,u),t.velocity.set(i,o),c>-1&&t.velocity.length()>c&&(t.velocity.normalize().scale(c),d=c),t.speed=d},separate:function(t,e,i,s,r){var n,a,o=!1,h=!0;if(!t.enable||!e.enable||t.checkCollision.none||e.checkCollision.none||!this.intersects(t,e)||0===(t.collisionMask&e.collisionCategory)||0===(e.collisionMask&t.collisionCategory))return o;if(i&&!1===i.call(s,t.gameObject||t,e.gameObject||e))return o;if(t.isCircle||e.isCircle){var l=this.separateCircle(t,e,r);l.result?(o=!0,h=!1):(n=l.x,a=l.y,h=!0)}if(h){var u=!1,d=!1,f=this.OVERLAP_BIAS;r?(u=A(t,e,r,f,n),d=_(t,e,r,f,a)):this.forceX||Math.abs(this.gravity.y+t.gravity.y)E&&(p=l(x,y,E,b)-w):y>C&&(xE&&(p=l(x,y,E,C)-w)),p*=-1}else p=t.halfWidth+e.halfWidth-u(a,o);t.overlapR=p,e.overlapR=p;var A=s(a,o),_=(p+T.EPSILON)*Math.cos(A),M=(p+T.EPSILON)*Math.sin(A),R={overlap:p,result:!1,x:_,y:M};if(i&&(!m||m&&0!==p))return R.result=!0,R;if(!m&&0===p||h&&d||t.customSeparateX||e.customSeparateX)return R.x=void 0,R.y=void 0,R;var O=!t.pushable&&!e.pushable;if(m){var P=a.x-o.x,L=a.y-o.y,F=Math.sqrt(Math.pow(P,2)+Math.pow(L,2)),D=(o.x-a.x)/F||0,I=(o.y-a.y)/F||0,N=2*(c.x*D+c.y*I-f.x*D-f.y*I)/(t.mass+e.mass);!h&&!d&&t.pushable&&e.pushable||(N*=2),!h&&t.pushable&&(c.x=c.x-N/t.mass*D,c.y=c.y-N/t.mass*I,c.multiply(t.bounce)),!d&&e.pushable&&(f.x=f.x+N/e.mass*D,f.y=f.y+N/e.mass*I,f.multiply(e.bounce)),h||d||(_*=.5,M*=.5),(!h||t.pushable||O)&&(t.x-=_,t.y-=M,t.updateCenter()),(!d||e.pushable||O)&&(e.x+=_,e.y+=M,e.updateCenter()),R.result=!0}else h||!t.pushable&&!O||(t.x-=_,t.y-=M,t.updateCenter()),(!d||e.pushable||O)&&(e.x+=_,e.y+=M,e.updateCenter()),R.x=void 0,R.y=void 0;return R},intersects:function(t,e){return t!==e&&(t.isCircle||e.isCircle?t.isCircle?e.isCircle?u(t.center,e.center)<=t.halfWidth+e.halfWidth:this.circleBodyIntersects(t,e):this.circleBodyIntersects(e,t):!(t.right<=e.left||t.bottom<=e.top||t.left>=e.right||t.top>=e.bottom))},circleBodyIntersects:function(t,e){var i=n(t.center.x,e.left,e.right),s=n(t.center.y,e.top,e.bottom);return(t.center.x-i)*(t.center.x-i)+(t.center.y-s)*(t.center.y-s)<=t.halfWidth*t.halfWidth},overlap:function(t,e,i,s,r){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===r&&(r=i),this.collideObjects(t,e,i,s,r,!0)},collide:function(t,e,i,s,r){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===r&&(r=i),this.collideObjects(t,e,i,s,r,!1)},collideObjects:function(t,e,i,s,r,n){var a,o;!t.isParent||void 0!==t.physicsType&&void 0!==e&&t!==e||(t=Array.from(t.children)),e&&e.isParent&&void 0===e.physicsType&&(e=Array.from(e.children));var h=Array.isArray(t),l=Array.isArray(e);if(this._total=0,h||l)if(!h&&l)for(a=0;a0},collideHandler:function(t,e,i,s,r,n){if(void 0===e&&t.isParent)return this.collideGroupVsGroup(t,t,i,s,r,n);if(!t||!e)return!1;if(t.body||t.isBody){if(e.body||e.isBody)return this.collideSpriteVsSprite(t,e,i,s,r,n);if(e.isParent)return this.collideSpriteVsGroup(t,e,i,s,r,n);if(e.isTilemap)return this.collideSpriteVsTilemapLayer(t,e,i,s,r,n)}else if(t.isParent){if(e.body||e.isBody)return this.collideSpriteVsGroup(e,t,i,s,r,n);if(e.isParent)return this.collideGroupVsGroup(t,e,i,s,r,n);if(e.isTilemap)return this.collideGroupVsTilemapLayer(t,e,i,s,r,n)}else if(t.isTilemap){if(e.body||e.isBody)return this.collideSpriteVsTilemapLayer(e,t,i,s,r,n);if(e.isParent)return this.collideGroupVsTilemapLayer(e,t,i,s,r,n)}},canCollide:function(t,e){return t&&e&&0!==(t.collisionMask&e.collisionCategory)&&0!==(e.collisionMask&t.collisionCategory)},collideSpriteVsSprite:function(t,e,i,s,r,n){var a=t.isBody?t:t.body,o=e.isBody?e:e.body;return!!this.canCollide(a,o)&&(this.separate(a,o,s,r,n)&&(i&&i.call(r,t,e),this._total++),!0)},collideSpriteVsGroup:function(t,e,i,s,r,n){var a,o,l,u=t.isBody?t:t.body;if(0!==e.getLength()&&u&&u.enable&&!u.checkCollision.none&&this.canCollide(u,e))if(this.useTree||e.physicsType===h.STATIC_BODY){var d=this.treeMinMax;d.minX=u.left,d.minY=u.top,d.maxX=u.right,d.maxY=u.bottom;var c=e.physicsType===h.DYNAMIC_BODY?this.tree.search(d):this.staticTree.search(d);for(o=c.length,a=0;a0&&(t.blocked.none=!1,t.blocked.right=!0),t.position.x-=e,t.updateCenter(),0===t.bounce.x?t.velocity.x=0:t.velocity.x=-t.velocity.x*t.bounce.x}},67013(t){t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.up=!0):e>0&&(t.blocked.none=!1,t.blocked.down=!0),t.position.y-=e,t.updateCenter(),0===t.bounce.y?t.velocity.y=0:t.velocity.y=-t.velocity.y*t.bounce.y}},40012(t,e,i){var s=i(21329),r=i(53442),n=i(2483);t.exports=function(t,e,i,a,o,h,l){var u=a.left,d=a.top,c=a.right,f=a.bottom,p=i.faceLeft||i.faceRight,m=i.faceTop||i.faceBottom;if(l||(p=!0,m=!0),!p&&!m)return!1;var g=0,v=0,x=0,y=1;if(e.deltaAbsX()>e.deltaAbsY()?x=-1:e.deltaAbsX()0&&u&&t.checkCollision.right&&h&&t.right>i&&(o=t.right-i)>n&&(o=0),0!==o&&(t.customSeparateX?t.overlapX=o:s(t,o)),o}},53442(t,e,i){var s=i(67013);t.exports=function(t,e,i,r,n,a){var o=0,h=e.faceTop,l=e.faceBottom,u=e.collideUp,d=e.collideDown;return a||(h=!0,l=!0,u=!0,d=!0),t.deltaY()<0&&d&&t.checkCollision.up?l&&t.y0&&u&&t.checkCollision.down&&h&&t.bottom>i&&(o=t.bottom-i)>n&&(o=0),0!==o&&(t.customSeparateY?t.overlapY=o:s(t,o)),o}},2483(t){t.exports=function(t,e){return!(e.right<=t.left||e.bottom<=t.top||e.position.x>=t.right||e.position.y>=t.bottom)}},55173(t,e,i){var s={ProcessTileCallbacks:i(96602),ProcessTileSeparationX:i(36294),ProcessTileSeparationY:i(67013),SeparateTile:i(40012),TileCheckX:i(21329),TileCheckY:i(53442),TileIntersectsBody:i(2483)};t.exports=s},52018(t,e,i){var s=new(i(83419))({initialize:function(t){this.pluginManager=t,this.game=t.game},init:function(){},start:function(){},stop:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=s},42363(t){var e={Global:["game","anims","cache","plugins","registry","scale","sound","textures","renderer"],CoreScene:["EventEmitter","CameraManager","GameObjectCreator","GameObjectFactory","ScenePlugin","DisplayList","UpdateList"],DefaultScene:["Clock","DataManagerPlugin","InputPlugin","Loader","TweenManager","LightsPlugin"]};e.DefaultScene.push("CameraManager3D"),e.Global.push("facebook"),t.exports=e},37277(t){var e={},i={},s={register:function(t,i,s,r){void 0===r&&(r=!1),e[t]={plugin:i,mapping:s,custom:r}},registerCustom:function(t,e,s,r){i[t]={plugin:e,mapping:s,data:r}},hasCore:function(t){return e.hasOwnProperty(t)},hasCustom:function(t){return i.hasOwnProperty(t)},getCore:function(t){return e[t]},getCustom:function(t){return i[t]},getCustomClass:function(t){return i.hasOwnProperty(t)?i[t].plugin:null},remove:function(t){e.hasOwnProperty(t)&&delete e[t]},removeCustom:function(t){i.hasOwnProperty(t)&&delete i[t]},destroyCorePlugins:function(){for(var t in e)e.hasOwnProperty(t)&&delete e[t]},destroyCustomPlugins:function(){for(var t in i)i.hasOwnProperty(t)&&delete i[t]}};t.exports=s},77332(t,e,i){var s=i(83419),r=i(8443),n=i(50792),a=i(74099),o=i(44603),h=i(39429),l=i(95540),u=i(37277),d=i(72905),c=i(8054),f=new s({Extends:n,initialize:function(t){n.call(this),this.game=t,this.plugins=[],this.scenePlugins=[],this._pendingGlobal=[],this._pendingScene=[],t.isBooted||t.config.renderType===c.HEADLESS?this.boot():t.events.once(r.BOOT,this.boot,this)},boot:function(){var t,e,i,s,n,a,o,h=this.game.config,u=h.installGlobalPlugins;for(u=u.concat(this._pendingGlobal),t=0;t{const o=this.getVideoPlaybackQuality(),h=this.mozPresentedFrames||this.mozPaintedFrames||o.totalVideoFrames-o.droppedVideoFrames;if(h>s){const s=this.mozFrameDelay||o.totalFrameDelay-i.totalFrameDelay||0,r=a-n;t(a,{presentationTime:a+1e3*s,expectedDisplayTime:a+r,width:this.videoWidth,height:this.videoHeight,mediaTime:Math.max(0,this.currentTime||0)+r/1e3,presentedFrames:h,processingDuration:s}),delete this._rvfcpolyfillmap[e]}else this._rvfcpolyfillmap[e]=requestAnimationFrame(t=>r(a,t))};return this._rvfcpolyfillmap[e]=requestAnimationFrame(t=>r(e,t)),e},HTMLVideoElement.prototype.cancelVideoFrameCallback=function(t){cancelAnimationFrame(this._rvfcpolyfillmap[t]),delete this._rvfcpolyfillmap[t]})},10312(t){t.exports={SKIP_CHECK:-1,NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16,ERASE:17,SOURCE_IN:18,SOURCE_OUT:19,SOURCE_ATOP:20,DESTINATION_OVER:21,DESTINATION_IN:22,DESTINATION_OUT:23,DESTINATION_ATOP:24,LIGHTER:25,COPY:26,XOR:27}},29795(t){t.exports={DEFAULT:0,LINEAR:0,NEAREST:1}},84322(t){t.exports={MULTIPLY:0,FILL:1,ADD:2,SCREEN:4,OVERLAY:5,HARD_LIGHT:6}},68627(t,e,i){var s=i(19715),r=i(32880),n=i(83419),a=i(8054),o=i(50792),h=i(92503),l=i(56373),u=i(97480),d=i(69442),c=i(8443),f=i(61340),p=new n({Extends:o,initialize:function(t){o.call(this);var e=t.config;this.config={clearBeforeRender:e.clearBeforeRender,backgroundColor:e.backgroundColor,antialias:e.antialias,roundPixels:e.roundPixels,transparent:e.transparent},this.game=t,this.type=a.CANVAS,this.drawCount=0,this.width=0,this.height=0,this.gameCanvas=t.canvas;var i={alpha:e.transparent,desynchronized:e.desynchronized,willReadFrequently:!1};this.gameContext=e.context?e.context:this.gameCanvas.getContext("2d",i),this.currentContext=this.gameContext,this.antialias=e.antialias,this.blendModes=l(),this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92},this._tempMatrix1=new f,this._tempMatrix2=new f,this._tempMatrix3=new f,this.isBooted=!1,this.init()},init:function(){var t=this.game;t.events.once(c.BOOT,function(){var t=this.config;if(!t.transparent){var e=this.gameContext,i=this.gameCanvas;e.fillStyle=t.backgroundColor.rgba,e.fillRect(0,0,i.width,i.height)}},this),t.textures.once(d.READY,this.boot,this)},boot:function(){var t=this.game,e=t.scale.baseSize;this.width=e.width,this.height=e.height,this.isBooted=!0,t.scale.on(u.RESIZE,this.onResize,this),this.resize(e.width,e.height)},onResize:function(t,e){e.width===this.width&&e.height===this.height||this.resize(e.width,e.height)},resize:function(t,e){this.width=t,this.height=e,this.emit(h.RESIZE,t,e)},resetTransform:function(){this.currentContext.setTransform(1,0,0,1,0,0)},setBlendMode:function(t){return this.currentContext.globalCompositeOperation=t,this},setContext:function(t){return this.currentContext=t||this.gameContext,this},setAlpha:function(t){return this.currentContext.globalAlpha=t,this},preRender:function(){var t=this.gameContext,e=this.config,i=this.width,s=this.height;t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),this.emit(h.PRE_RENDER_CLEAR),e.clearBeforeRender&&(t.clearRect(0,0,i,s),e.transparent||(t.fillStyle=e.backgroundColor.rgba,t.fillRect(0,0,i,s))),t.save(),this.drawCount=0,this.emit(h.PRE_RENDER)},render:function(t,e,i){var r=e.length;this.emit(h.RENDER,t,i);var n=i.x,a=i.y,o=i.width,l=i.height,u=i.renderToTexture?i.context:t.sys.context;u.save(),this.game.scene.customViewports&&(u.beginPath(),u.rect(n,a,o,l),u.clip()),i.emit(s.PRE_RENDER,i),this.currentContext=u;var d=i.mask;d&&d.preRenderCanvas(this,null,i._maskCamera),i.transparent||(u.fillStyle=i.backgroundColor.rgba,u.fillRect(n,a,o,l)),u.globalAlpha=i.alpha,u.globalCompositeOperation="source-over",this.drawCount+=r,i.renderToTexture&&i.emit(s.PRE_RENDER,i),i.matrix.copyToContext(u);for(var c=0;c=0?v=-(v+d):v<0&&(v=Math.abs(v)-d)),t.flipY&&(x>=0?x=-(x+c):x<0&&(x=Math.abs(x)-c))}var T=1,w=1;t.flipX&&(f||(v+=-e.realWidth+2*m),T=-1),t.flipY&&(f||(x+=-e.realHeight+2*g),w=-1);var S=t.x,b=t.y;if(i.roundPixels&&(S=Math.floor(S),b=Math.floor(b)),o.applyITRS(S,b,t.rotation,t.scaleX*T,t.scaleY*w),a.copyWithScrollFactorFrom(i.matrixCombined,i.scrollX,i.scrollY,t.scrollFactorX,t.scrollFactorY),s&&a.multiply(s),a.multiply(o),i.renderRoundPixels&&(a.e=Math.floor(a.e+.5),a.f=Math.floor(a.f+.5)),n.save(),a.setToContext(n),n.globalCompositeOperation=this.blendModes[t.blendMode],n.globalAlpha=r,n.imageSmoothingEnabled=!e.source.scaleMode,t.mask&&t.mask.preRenderCanvas(this,t,i),d>0&&c>0){var E=d/p,C=c/p;i.roundPixels&&(v=Math.floor(v+.5),x=Math.floor(x+.5),E+=.5,C+=.5),n.drawImage(e.source.image,l,u,d,c,v,x,E,C)}t.mask&&t.mask.postRenderCanvas(this,t,i),n.restore()}},destroy:function(){this.removeAllListeners(),this.game=null,this.gameCanvas=null,this.gameContext=null}});t.exports=p},55830(t,e,i){t.exports={CanvasRenderer:i(68627),GetBlendModes:i(56373),SetTransform:i(20926)}},56373(t,e,i){var s=i(10312),r=i(89289);t.exports=function(){var t=[],e=r.supportNewBlendModes,i="source-over";return t[s.NORMAL]=i,t[s.ADD]="lighter",t[s.MULTIPLY]=e?"multiply":i,t[s.SCREEN]=e?"screen":i,t[s.OVERLAY]=e?"overlay":i,t[s.DARKEN]=e?"darken":i,t[s.LIGHTEN]=e?"lighten":i,t[s.COLOR_DODGE]=e?"color-dodge":i,t[s.COLOR_BURN]=e?"color-burn":i,t[s.HARD_LIGHT]=e?"hard-light":i,t[s.SOFT_LIGHT]=e?"soft-light":i,t[s.DIFFERENCE]=e?"difference":i,t[s.EXCLUSION]=e?"exclusion":i,t[s.HUE]=e?"hue":i,t[s.SATURATION]=e?"saturation":i,t[s.COLOR]=e?"color":i,t[s.LUMINOSITY]=e?"luminosity":i,t[s.ERASE]="destination-out",t[s.SOURCE_IN]="source-in",t[s.SOURCE_OUT]="source-out",t[s.SOURCE_ATOP]="source-atop",t[s.DESTINATION_OVER]="destination-over",t[s.DESTINATION_IN]="destination-in",t[s.DESTINATION_OUT]="destination-out",t[s.DESTINATION_ATOP]="destination-atop",t[s.LIGHTER]="lighter",t[s.COPY]="copy",t[s.XOR]="xor",t}},20926(t,e,i){var s=i(91296);t.exports=function(t,e,i,r,n){var a=r.alpha*i.alpha;if(a<=0)return!1;var o=s(i,r,n).calc;return e.globalCompositeOperation=t.blendModes[i.blendMode],e.globalAlpha=a,e.save(),o.setToContext(e),e.imageSmoothingEnabled=i.frame?!i.frame.source.scaleMode:t.antialias,!0}},63899(t){t.exports="losewebgl"},6119(t){t.exports="postrender"},31124(t){t.exports="prerenderclear"},48070(t){t.exports="prerender"},15640(t){t.exports="render"},8912(t){t.exports="resize"},87124(t){t.exports="restorewebgl"},53998(t){t.exports="setparalleltextureunits"},92503(t,e,i){t.exports={LOSE_WEBGL:i(63899),POST_RENDER:i(6119),PRE_RENDER:i(48070),PRE_RENDER_CLEAR:i(31124),RENDER:i(15640),RESIZE:i(8912),RESTORE_WEBGL:i(87124),SET_PARALLEL_TEXTURE_UNITS:i(53998)}},36909(t,e,i){t.exports={Events:i(92503),Snapshot:i(89966)},t.exports.Canvas=i(55830),t.exports.WebGL=i(4159)},32880(t,e,i){var s=i(27919),r=i(40987),n=i(95540);t.exports=function(t,e){var i=n(e,"callback"),a=n(e,"type","image/png"),o=n(e,"encoder",.92),h=Math.abs(Math.round(n(e,"x",0))),l=Math.abs(Math.round(n(e,"y",0))),u=Math.floor(n(e,"width",t.width)),d=Math.floor(n(e,"height",t.height));if(n(e,"getPixel",!1)){var c=t.getContext("2d",{willReadFrequently:!1}).getImageData(h,l,1,1).data;i.call(null,new r(c[0],c[1],c[2],c[3]))}else if(0!==h||0!==l||u!==t.width||d!==t.height){var f=s.createWebGL(this,u,d),p=f.getContext("2d",{willReadFrequently:!0});u>0&&d>0&&p.drawImage(t,h,l,u,d,0,0,u,d);var m=new Image;m.onerror=function(){i.call(null),s.remove(f)},m.onload=function(){i.call(null,m),s.remove(f)},m.src=f.toDataURL(a,o)}else{var g=new Image;g.onerror=function(){i.call(null)},g.onload=function(){i.call(null,g)},g.src=t.toDataURL(a,o)}}},88815(t,e,i){var s=i(27919),r=i(40987),n=i(95540);t.exports=function(t,e){var i=t,a=n(e,"callback"),o=n(e,"type","image/png"),h=n(e,"encoder",.92),l=Math.abs(Math.round(n(e,"x",0))),u=Math.abs(Math.round(n(e,"y",0))),d=n(e,"getPixel",!1),c=n(e,"isFramebuffer",!1),f=c?n(e,"bufferWidth",1):i.drawingBufferWidth,p=c?n(e,"bufferHeight",1):i.drawingBufferHeight;if(d){var m=new Uint8Array(4),g=p-u-1;i.readPixels(l,g,1,1,i.RGBA,i.UNSIGNED_BYTE,m),a.call(null,new r(m[0],m[1],m[2],m[3]))}else{var v=Math.floor(n(e,"width",f)),x=Math.floor(n(e,"height",p)),y=new Uint8Array(v*x*4);i.readPixels(l,p-u-x,v,x,i.RGBA,i.UNSIGNED_BYTE,y);for(var T=s.createWebGL(this,v,x),w=T.getContext("2d",{willReadFrequently:!0}),S=w.getImageData(0,0,v,x),b=S.data,E=0;E0},beginDraw:function(){this.framebuffer&&this.renderer.glTextureUnits.unbindTexture(this.texture),this.renderer.glWrapper.update(this.state)},clear:function(t){this.beginDraw(),void 0===t&&(t=this.autoClear),this.renderer.renderNodes.finishBatch(),this.renderer.gl.clear(t)},destroy:function(){this.renderer.deleteTexture(this.texture),this.renderer.deleteFramebuffer(this.state.bindings.framebuffer),this.renderer=null,this.camera=null,this.state=null,this.framebuffer=null,this.texture=null}});t.exports=r},65656(t,e,i){var s=i(83419),r=i(87774),n=new s({initialize:function(t,e,i){this.renderer=t,this.maxAge=e,this.maxPoolSize=i,this.agePool=[],this.sizePool={}},add:function(t){if(-1===this.agePool.indexOf(t)){var e=t.width+"x"+t.height;this.sizePool[e]?this.sizePool[e].push(t):this.sizePool[e]=[t],this.agePool.push(t)}},get:function(t,e){var i,s,n=this.renderer;void 0===t&&(t=n.width),void 0===e&&(e=n.height);var a=n.getMaxTextureSize();t>a&&(t=a),e>a&&(e=a);var o=t+"x"+e,h=this.sizePool[o];if(h&&h.length>0)return i=h.pop(),s=this.agePool.indexOf(i),this.agePool.splice(s,1),i;if(this.agePool.length>0){var l=Date.now(),u=this.maxAge;if(l-(i=this.agePool[0]).lastUsed>u){this.agePool.shift();var d=i.width+"x"+i.height;return s=(h=this.sizePool[d]).indexOf(i),h.splice(s,1),i.resize(t,e),i}}return this.agePool.length0)for(var s=e.splice(0,i),r=0;r0){s+="_";for(var r=0;r0&&(s+="__",s+=i.sort().join("_")),s},createShaderProgram:function(t,e,i,s){var r=e.vertexShader,n=e.fragmentShader;if(r=r.replace(/\r/g,""),n=n.replace(/\r/g,""),i){for(var a,o,h={},l=0;l>>0},getTintAppendFloatAlpha:function(t,e){return((255*e&255)<<24|t)>>>0},getTintAppendFloatAlphaAndSwap:function(t,e){return((255*e&255)<<24|(255&t)<<16|(t>>8&255)<<8|t>>16&255)>>>0},getFloatsFromUintRGB:function(t){return[(t>>16&255)/255,(t>>8&255)/255,(255&t)/255]},checkShaderMax:function(t,e){var i=Math.min(16,t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS));return e&&-1!==e?Math.min(i,e):i},updateLightingUniforms:function(t,e,i,r,n,a,o,h){var l=e.camera,u=l.scene.sys.lights;if(u&&u.active){var d=u.getLights(l),c=d.length,f=u.ambientColor,p=e.height;if(t){i.setUniform("uNormSampler",r),i.setUniform("uCamera",[l.x,l.y,l.rotation,l.zoom]),i.setUniform("uAmbientLightColor",[f.r,f.g,f.b]),i.setUniform("uLightCount",c);for(var m=new s,g=0;g-1?t.getExtension(s):null,e.config.skipUnreadyShaders){var r="KHR_parallel_shader_compile";this.parallelShaderCompileExtension=i.indexOf(r)>-1?t.getExtension(r):null,this.parallelShaderCompileExtension||(e.config.skipUnreadyShaders=!1)}var n="OES_vertex_array_object";this.vaoExtension=i.indexOf(n)>-1?t.getExtension(n):null;var a="OES_standard_derivatives";if(this.standardDerivativesExtension=i.indexOf(a)>-1?t.getExtension(a):null,t instanceof WebGLRenderingContext){if(!this.instancedArraysExtension)throw new Error("ANGLE_instanced_arrays extension not supported. Required for rendering.");if(t.vertexAttribDivisor=this.instancedArraysExtension.vertexAttribDivisorANGLE.bind(this.instancedArraysExtension),t.drawArraysInstanced=this.instancedArraysExtension.drawArraysInstancedANGLE.bind(this.instancedArraysExtension),t.drawElementsInstanced=this.instancedArraysExtension.drawElementsInstancedANGLE.bind(this.instancedArraysExtension),!this.vaoExtension)throw new Error("OES_vertex_array_object extension not supported. Required for rendering.");if(t.createVertexArray=this.vaoExtension.createVertexArrayOES.bind(this.vaoExtension),t.bindVertexArray=this.vaoExtension.bindVertexArrayOES.bind(this.vaoExtension),t.deleteVertexArray=this.vaoExtension.deleteVertexArrayOES.bind(this.vaoExtension),t.isVertexArray=this.vaoExtension.isVertexArrayOES.bind(this.vaoExtension),this.standardDerivativesExtension)t.FRAGMENT_SHADER_DERIVATIVE_HINT=this.standardDerivativesExtension.FRAGMENT_SHADER_DERIVATIVE_HINT_OES;else if(e.config.smoothPixelArt)throw new Error("OES_standard_derivatives extension not supported. Cannot use smoothPixelArt.")}},setContextHandlers:function(t,e){this.previousContextLostHandler&&this.canvas.removeEventListener("webglcontextlost",this.previousContextLostHandler,!1),this.previousContextRestoredHandler&&this.canvas.removeEventListener("webglcontextrestored",this.previousContextRestoredHandler,!1),this.contextLostHandler="function"==typeof t?t.bind(this):this.dispatchContextLost.bind(this),this.contextRestoredHandler="function"==typeof e?e.bind(this):this.dispatchContextRestored.bind(this),this.canvas.addEventListener("webglcontextlost",this.contextLostHandler,!1),this.canvas.addEventListener("webglcontextrestored",this.contextRestoredHandler,!1),this.previousContextLostHandler=this.contextLostHandler,this.previousContextRestoredHandler=this.contextRestoredHandler},dispatchContextLost:function(t){this.contextLost=!0,console&&console.warn("WebGL Context lost. Renderer disabled"),this.emit(h.LOSE_WEBGL,this),t.preventDefault()},dispatchContextRestored:function(t){if(this.gl.isContextLost())console&&console.log("WebGL Context restored, but context is still lost");else{this.setExtensions(),this.glWrapper.update(A.getDefault(this),!0),this.glTextureUnits.init(),this.compression=this.getCompressedTextures();var e=function(t){t.createResource()};s(this.glTextureWrappers,e),s(this.glBufferWrappers,e),s(this.glFramebufferWrappers,e),s(this.glProgramWrappers,e),s(this.glVAOWrappers,e),this.glTextureUnits.bindUnits(this.glTextureUnits.units,!0),this.resize(this.game.scale.baseSize.width,this.game.scale.baseSize.height),this.contextLost=!1,console&&console.warn("WebGL Context restored. Renderer running again."),this.emit(h.RESTORE_WEBGL,this),t.preventDefault()}},captureFrame:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1)},captureNextFrame:function(){O},getFps:function(){O},log:function(){},startCapture:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=!1),void 0===i&&(i=!1)},stopCapture:function(){O},onCapture:function(t){},onResize:function(t,e){e.width===this.width&&e.height===this.height||this.resize(e.width,e.height)},resize:function(t,e){var i=this.gl;return this.width=t,this.height=e,this.setProjectionMatrix(t,e),this.drawingBufferHeight=i.drawingBufferHeight,this.glWrapper.update({scissor:{box:[0,i.drawingBufferHeight-e,t,e]},viewport:[0,0,t,e]}),this.emit(h.RESIZE,t,e),this},getCompressedTextures:function(){var t="WEBGL_compressed_texture_",e="WEBKIT_"+t,i=function(i,s){var r=i.getExtension(t+s)||i.getExtension(e+s)||i.getExtension("EXT_texture_compression_"+s);if(r){var n={};for(var a in r)n[r[a]]=a;return n}},s=this.gl;return{ETC:i(s,"etc"),ETC1:i(s,"etc1"),ATC:i(s,"atc"),ASTC:i(s,"astc"),BPTC:i(s,"bptc"),RGTC:i(s,"rgtc"),PVRTC:i(s,"pvrtc"),S3TC:i(s,"s3tc"),S3TCSRGB:i(s,"s3tc_srgb"),IMG:!0}},getCompressedTextureName:function(t,e){var i=this.compression[t.toUpperCase()];if(e in i)return i[e]},supportsCompressedTexture:function(t,e){var i=this.compression[t.toUpperCase()];return!!i&&(!e||e in i)},getAspectRatio:function(){return this.width/this.height},setProjectionMatrix:function(t,e,i){return t===this.projectionWidth&&e===this.projectionHeight&&i===this.projectionFlipY||(this.projectionWidth=t,this.projectionHeight=e,this.projectionFlipY=!!i,i?this.projectionMatrix.ortho(0,t,0,e,-1e3,1e3):this.projectionMatrix.ortho(0,t,e,0,-1e3,1e3)),this},setProjectionMatrixFromDrawingContext:function(t){return this.setProjectionMatrix(t.width,t.height,!1)},resetProjectionMatrix:function(){return this.setProjectionMatrix(this.width,this.height)},hasExtension:function(t){return!!this.supportedExtensions&&this.supportedExtensions.indexOf(t)},getExtension:function(t){return this.hasExtension(t)?(t in this.extensions||(this.extensions[t]=this.gl.getExtension(t)),this.extensions[t]):null},addBlendMode:function(t,e){return this.blendModes.push(C.createCombined(this,!0,void 0,e,t[0],t[1]))-1-1},updateBlendMode:function(t,e,i){if(t>17&&this.blendModes[t]){var s=this.blendModes[t];2===e.length?s.func=[e[0],e[1],e[0],e[1]]:s.func=[e[0],e[1],e[2],e[3]],s.equation="number"==typeof i?[i,i]:[i[0],i[1]]}return this},removeBlendMode:function(t){return t>17&&this.blendModes[t]&&this.blendModes.splice(t,1),this},clearFramebuffer:function(t,e,i){var s=this.gl,r=0;t&&(this.glWrapper.updateColorClearValue({colorClearValue:t}),r|=s.COLOR_BUFFER_BIT),void 0!==e&&(this.glWrapper.updateStencilClear({stencil:{clear:e}}),r|=s.STENCIL_BUFFER_BIT),void 0!==i&&(r|=s.DEPTH_BUFFER_BIT),s.clear(r)},createTextureFromSource:function(t,e,i,s,r,n){void 0===r&&(r=!1);var o=this.gl,h=o.NEAREST,u=o.NEAREST,d=o.CLAMP_TO_EDGE;e=t?t.width:e,i=t?t.height:i;var c=l(e,i);if(c&&!r&&(d=o.REPEAT),s===a.ScaleModes.LINEAR&&this.config.antialias){var f=t&&t.compressed,p=!f&&c||f&&t.mipmaps.length>1;h=this.mipmapFilter&&p?this.mipmapFilter:o.LINEAR,u=o.LINEAR}return t||"number"!=typeof e||"number"!=typeof i?this.createTexture2D(0,h,u,d,d,o.RGBA,t,void 0,void 0,void 0,void 0,n):this.createTexture2D(0,h,u,d,d,o.RGBA,null,e,i,void 0,void 0,n)},createTexture2D:function(t,e,i,s,r,n,a,o,h,l,u,d){"number"!=typeof o&&(o=a?a.width:1),"number"!=typeof h&&(h=a?a.height:1);var c=new w(this,t,e,i,s,r,n,a,o,h,l,u,d);return this.glTextureWrappers.push(c),c},createFramebuffer:function(t,e,i){Array.isArray(t)||null===t||(t=[t]);var s=new b(this,t,e,i);return this.glFramebufferWrappers.push(s),s},createProgram:function(t,e){var i=new y(this,t,e);return this.glProgramWrappers.push(i),i},createVertexBuffer:function(t,e){var i=this.gl,s=new v(this,t,i.ARRAY_BUFFER,e);return this.glBufferWrappers.push(s),s},createIndexBuffer:function(t,e){var i=this.gl,s=new v(this,t,i.ELEMENT_ARRAY_BUFFER,e);return this.glBufferWrappers.push(s),s},createVAO:function(t,e,i){var s=new E(this,t,e,i);return this.glVAOWrappers.push(s),s},deleteTexture:function(t){if(t)return r(this.glTextureWrappers,t),t.destroy(),this},deleteFramebuffer:function(t){return t?(r(this.glFramebufferWrappers,t),t.destroy(),this):this},deleteProgram:function(t){return t&&(r(this.glProgramWrappers,t),t.destroy()),this},deleteBuffer:function(t){return t?(r(this.glBufferWrappers,t),t.destroy(),this):this},preRender:function(){if(!this.contextLost){this.emit(h.PRE_RENDER_CLEAR);var t=this.baseDrawingContext;if(this.config.clearBeforeRender){var e=this.config.backgroundColor;t.setClearColor(e.redGL,e.greenGL,e.blueGL,e.alphaGL),t.setAutoClear(!0,!0,!0)}else t.setAutoClear(!1,!1,!1);t.use(),this.emit(h.PRE_RENDER)}},render:function(t,e,i){this.contextLost||(this.emit(h.RENDER,t,i),this.currentViewCamera=i,this.cameraRenderNode.run(this.baseDrawingContext,e,i),this.currentViewCamera=null)},postRender:function(){if(this.baseDrawingContext.release(),!this.contextLost){this.emit(h.POST_RENDER);var t=this.snapshotState;t.callback&&(g(this.gl,t),t.callback=null)}},drawElements:function(t,e,i,s,r,n,a){var o=this.gl;t.beginDraw(),i.bind(),s.bind(),this.glTextureUnits.bindUnits(e),o.drawElements(a||o.TRIANGLE_STRIP,r,o.UNSIGNED_SHORT,n)},drawInstancedArrays:function(t,e,i,s,r,n,a,o){var h=this.gl;t.beginDraw(),i.bind(),s.bind(),this.glTextureUnits.bindUnits(e),h.drawArraysInstanced(o||h.TRIANGLE_STRIP,r,n,a)},snapshot:function(t,e,i){return this.snapshotArea(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight,t,e,i)},snapshotArea:function(t,e,i,s,r,n,a){var o=this.snapshotState;return o.callback=r,o.type=n,o.encoder=a,o.getPixel=!1,o.x=t,o.y=e,o.width=i,o.height=s,o.unpremultiplyAlpha=this.game.config.premultipliedAlpha,this},snapshotPixel:function(t,e,i){return this.snapshotArea(t,e,1,1,i),this.snapshotState.getPixel=!0,this},snapshotFramebuffer:function(t,e,i,s,r,n,a,o,h,l,u){void 0===r&&(r=!1),void 0===n&&(n=0),void 0===a&&(a=0),void 0===o&&(o=e),void 0===h&&(h=i),"pixel"===l&&(r=!0,l="image/png"),this.snapshotArea(n,a,o,h,s,l,u);var d=this.snapshotState;return d.getPixel=r,d.isFramebuffer=!0,d.bufferWidth=e,d.bufferHeight=i,d.width=Math.min(d.width,e),d.height=Math.min(d.height,i),this.glWrapper.updateBindingsFramebuffer({bindings:{framebuffer:t}}),g(this.gl,d),d.callback=null,d.isFramebuffer=!1,this},canvasToTexture:function(t,e,i,s){void 0===i&&(i=!1),void 0===s&&(s=!0);var r=this.gl,n=r.NEAREST,a=r.NEAREST,o=t.width,h=t.height,u=r.CLAMP_TO_EDGE,d=l(o,h);return!i&&d&&(u=r.REPEAT),this.config.antialias&&(n=d&&this.mipmapFilter?this.mipmapFilter:r.LINEAR,a=r.LINEAR),e?(e.update(t,o,h,s,u,u,n,a,e.format),e):this.createTexture2D(0,n,a,u,u,r.RGBA,t,o,h,!0,!1,s)},createCanvasTexture:function(t,e,i){return void 0===e&&(e=!1),void 0===i&&(i=!0),this.canvasToTexture(t,null,e,i)},updateCanvasTexture:function(t,e,i,s){return void 0===i&&(i=!0),void 0===s&&(s=!1),this.canvasToTexture(t,e,s,i)},videoToTexture:function(t,e,i,s){void 0===i&&(i=!1),void 0===s&&(s=!0);var r=this.gl,n=r.NEAREST,a=r.NEAREST,o=t.videoWidth,h=t.videoHeight,u=r.CLAMP_TO_EDGE,d=l(o,h);return!i&&d&&(u=r.REPEAT),this.config.antialias&&(n=d&&this.mipmapFilter?this.mipmapFilter:r.LINEAR,a=r.LINEAR),e?(e.update(t,o,h,s,u,u,n,a,e.format),e):this.createTexture2D(0,n,a,u,u,r.RGBA,t,o,h,!0,!0,s)},createVideoTexture:function(t,e,i){return void 0===e&&(e=!1),void 0===i&&(i=!0),this.videoToTexture(t,null,e,i)},updateVideoTexture:function(t,e,i,s){return void 0===i&&(i=!0),void 0===s&&(s=!1),this.videoToTexture(t,e,s,i)},createUint8ArrayTexture:function(t,e,i,s,r){var n=this.gl,a=n.NEAREST,o=n.NEAREST,h=n.CLAMP_TO_EDGE;return l(e,i)&&(h=n.REPEAT),void 0===s&&(s=!0),void 0===r&&(r=!0),this.createTexture2D(0,a,o,h,h,n.RGBA,t,e,i,s,!1,r)},setTextureFilter:function(t,e){var i=this.gl,s=0===e?i.LINEAR:i.NEAREST,r=this.glTextureUnits,n=r.units[0];return r.bind(t,0),t.update(t.pixels,t.width,t.height,t.flipY,t.wrapS,t.wrapT,s,s,t.format),n&&r.bind(n,0),this},setTextureWrap:function(t,e,i){var s=this.gl;if(!l(t.width,t.height)&&(e!==s.CLAMP_TO_EDGE||i!==s.CLAMP_TO_EDGE))return this;var r=this.glTextureUnits,n=r.units[0];return r.bind(t,0),t.update(t.pixels,t.width,t.height,t.flipY,e,i,t.minFilter,t.magFilter,t.format),n&&r.bind(n,0),this},getMaxTextureSize:function(){return this.config.maxTextureSize},destroy:function(){this.off(h.RESIZE,this.baseDrawingContext.resize,this.baseDrawingContext),this.canvas.removeEventListener("webglcontextlost",this.contextLostHandler,!1),this.canvas.removeEventListener("webglcontextrestored",this.contextRestoredHandler,!1);var t=function(t){t.destroy()};s(this.glBufferWrappers,t),s(this.glFramebufferWrappers,t),s(this.glProgramWrappers,t),s(this.glTextureWrappers,t),this.removeAllListeners(),this.extensions={},this.gl=null,this.game=null,this.canvas=null,this.contextLost=!0}});t.exports=P},14500(t){t.exports={BYTE:{enum:5120,size:1},UNSIGNED_BYTE:{enum:5121,size:1},SHORT:{enum:5122,size:2},UNSIGNED_SHORT:{enum:5123,size:2},INT:{enum:5124,size:4},UNSIGNED_INT:{enum:5125,size:4},FLOAT:{enum:5126,size:4}}},4159(t,e,i){var s=i(14500),r=i(79291),n={Shaders:i(89350),ShaderAdditionMakers:i(83786),DrawingContext:i(87774),DrawingContextPool:i(65656),ProgramManager:i(56436),RenderNodes:i(54521),ShaderProgramFactory:i(18804),Utils:i(70554),WebGLRenderer:i(74797),Wrappers:i(31884)};n=r(!1,n,s),t.exports=n},47774(t){var e={createCombined:function(t,e,i,s,r,n){var a=t.gl;return void 0===e&&(e=!0),void 0===i&&(i=[0,0,0,0]),void 0===s&&(s=a.FUNC_ADD),void 0===r&&(r=a.ONE),void 0===n&&(n=a.ONE_MINUS_SRC_ALPHA),{enabled:e,color:i,equation:[s,s],func:[r,n,r,n]}},createSeparate:function(t,e,i,s,r,n,a,o,h){var l=t.gl;return void 0===e&&(e=!0),void 0===i&&(i=[0,0,0,0]),void 0===s&&(s=l.FUNC_ADD),void 0===r&&(r=l.FUNC_ADD),void 0===n&&(n=l.ONE),void 0===a&&(a=l.ONE_MINUS_SRC_ALPHA),void 0===o&&(o=l.ONE),void 0===h&&(h=l.ONE_MINUS_SRC_ALPHA),{enabled:e,color:i,equation:[s,r],func:[n,a,o,h]}}};t.exports=e},53314(t,e,i){var s=i(8054),r=i(62644),n=i(71623),a={getDefault:function(t){return{bindings:{activeTexture:0,arrayBuffer:null,elementArrayBuffer:null,framebuffer:null,program:null,renderbuffer:null},blend:r(t.blendModes[s.BlendModes.NORMAL]),colorClearValue:[0,0,0,1],colorWritemask:[!0,!0,!0,!0],cullFace:!1,depthTest:!1,scissor:{enable:!0,box:[0,0,0,0]},stencil:n.create(t),texturing:{flipY:!1,premultiplyAlpha:!1},vao:null,viewport:[0,0,0,0]}}};t.exports=a},71623(t){var e={create:function(t,e,i,s,r,n,a,o,h){var l=t.gl;return void 0===e&&(e=!1),void 0===i&&(i=l.ALWAYS),void 0===s&&(s=0),void 0===r&&(r=255),void 0===n&&(n=l.KEEP),void 0===a&&(a=l.KEEP),void 0===o&&(o=l.KEEP),void 0===h&&(h=0),{enabled:e,func:{func:i,ref:s,mask:r},op:{fail:n,zfail:a,zpass:o},clear:h}}};t.exports=e},13961(t,e,i){var s=i(83419),r=i(56436),n=i(40952),a=i(6141),o=i(36909),h=new s({Extends:a,initialize:function(t,e,i){var s=t.renderer,h=s.gl,l=(i=this._copyAndCompleteConfig(t,i||{},e)).name;if(!l)throw new Error("BatchHandler must have a name");a.call(this,l,t),this.instancesPerBatch=-1,this.verticesPerInstance=i.verticesPerInstance;var u=Math.floor(65536/this.verticesPerInstance),d=i.instancesPerBatch||s.config.batchSize||u;this.instancesPerBatch=Math.min(d,u),this.indicesPerInstance=i.indicesPerInstance,this.bytesPerIndexPerInstance=this.indicesPerInstance*Uint16Array.BYTES_PER_ELEMENT,this.maxTexturesPerBatch=1,this.manager.on(o.Events.SET_PARALLEL_TEXTURE_UNITS,this.updateTextureCount,this),s.glWrapper.updateVAO({vao:null}),this.indexBuffer=s.createIndexBuffer(this._generateElementIndices(this.instancesPerBatch),i.indexBufferDynamic?h.DYNAMIC_DRAW:h.STATIC_DRAW);var c=i.vertexBufferLayout;if(c.count=this.instancesPerBatch*this.verticesPerInstance,this.vertexBufferLayout=new n(s,c,null),this.programManager=new r(s,[this.vertexBufferLayout],this.indexBuffer),this.programManager.setBaseShader(i.shaderName,i.vertexSource,i.fragmentSource),i.shaderAdditions)for(var f=0;fthis.instancesPerBatch)throw new Error("BatchHandlerStrip: Vertex count exceeds maximum per batch ("+this.maxVerticesPerBatch+")");this.instanceCount+c>this.instancesPerBatch&&this.run(t),this.updateRenderOptions(u),this._renderOptionsChanged&&(this.run(t),this.updateShaderConfig());var f,m=this.batchTextures(s),g=this.instanceCount*this.floatsPerInstance,v=this.vertexBufferLayout.buffer,x=v.viewF32,y=v.viewU32,T=!1;if(this.instanceCount>0){var w=1+this.floatsPerInstance/this.verticesPerInstance;x[g++]=x[g-w],x[g++]=x[g-w],x[g++]=x[g-w],x[g++]=x[g-w],x[g++]=x[g-w],x[g++]=x[g-w],y[g++]=y[g-w],T=!0}d&&(f=[]);for(var S=i.a,b=i.b,E=i.c,C=i.d,A=i.e,_=i.f,M=r.length,R=0;R=u.length)&&(n++,this.run(t),d=this.instanceCount*this.indicesPerInstance,m=this.vertexCount*h/f.BYTES_PER_ELEMENT,v=0,y=0)}}});t.exports=c},61842(t,e,i){var s=i(19715),r=i(1e3),n=i(61340),a=i(87841),o=i(43855),h=i(83419),l=i(70554),u=i(6141);function d(t){return l.getTintAppendFloatAlpha(16777215,t)}var c=new h({Extends:u,initialize:function(t){u.call(this,"Camera",t),this.batchHandlerQuadSingleNode=t.getNode("BatchHandlerQuadSingle"),this.fillCameraNode=t.getNode("FillCamera"),this.listCompositorNode=t.getNode("ListCompositor"),this._parentTransformMatrix=new n},run:function(t,e,i,n,h,l){var u;this.onRunBegin(t);var c=t.renderer.drawingContextPool,f=this.manager,p=i.alpha,m=i.filters.internal.getActive(),g=i.filters.external.getActive(),v=h||i.forceComposite||m.length||g.length||p<1;n?i.matrixExternal.multiply(n,n):n=this._parentTransformMatrix.copyFrom(i.matrixExternal);var x=n.decomposeMatrix(),y=o(x.translateX,0)&&o(x.translateY,0)&&o(x.rotation,0)&&o(x.scaleX,1)&&o(x.scaleY,1),T=i.x,w=i.y,S=i.width,b=i.height,E=t.getClone();E.setCamera(i),v?((u=c.get(S,b)).setCamera(i),u.setScissorBox(0,0,S,b)):(u=E).setScissorBox(T,w,S,b),u.use();var C=this.fillCameraNode;if(i.backgroundColor.alphaGL>0){var A=i.backgroundColor,_=r(A.red,A.green,A.blue,A.alpha);C.run(u,_,v)}this.listCompositorNode.run(u,e,null,l);var M=i.flashEffect;M.postRenderWebGL()&&(_=r(M.red,M.green,M.blue,255*M.alpha),C.run(u,_,v));var R=i.fadeEffect;if(R.postRenderWebGL()&&(_=r(R.red,R.green,R.blue,255*R.alpha),C.run(u,_,v)),f.finishBatch(),v){var O,P,L,F,D={smoothPixelArt:f.renderer.game.config.smoothPixelArt},I=new a(0,0,u.width,u.height);for(O=0;O0,k=!B,U=new a(0,0,E.width,E.height);if(B){for(O=g.length-1;O>=0;O--)(P=g[O]).active&&(L=P.getPaddingCeil(),U.setTo(U.x+L.x,U.y+L.y,U.width+L.width,U.height+L.height));(k=U.width!==u.width||U.height!==u.height||!y)&&((u=c.get(U.width,U.height)).setScissorBox(0,0,U.width,U.height),u.setCamera(E.camera),u.use())}else u=E;if(k){var z,Y=U.x,X=U.y;n.setQuad(I.x,I.y,I.x+I.width,I.y+I.height),z=n.quad,F=B?4294967295:d(p),i.roundPixels&&(z[0]=Math.round(z[0]),z[1]=Math.round(z[1]),z[2]=Math.round(z[2]),z[3]=Math.round(z[3]),z[4]=Math.round(z[4]),z[5]=Math.round(z[5]),z[6]=Math.round(z[6]),z[7]=Math.round(z[7])),this.batchHandlerQuadSingleNode.batch(u,N.texture,z[0]-Y,z[1]-X,z[2]-Y,z[3]-X,z[6]-Y,z[7]-X,z[4]-Y,z[5]-X,0,1,1,-1,!1,F,F,F,F,D)}if(N!==u&&N.release(),B){var W=!1;for(N=null,L=new a,O=0;O0&&d2&&m>1&&(g=!0,r||(v=!0));for(var x,y,T,w,S,b,E,C,A=[],_=0,M=[],R=0,O=[],P=0,L=u*u,F=0;F0){var l=e,u=e;if(a.length>0){r=h;for(var d=0;d0)for(r=h,d=0;d0){var r=this.instanceBufferLayout.buffer,n=i.memberCount,a=Math.floor(n/i.bufferUpdateSegmentSize),o=!0;for(e=0;e<=a;e++)if(!(1<0&&e.addAddition(h(t.tileset.maxAnimationLength));for(var r=t.lighting,n=e.getAdditionsByTag("LIGHTING"),a=0;a0,T=[x,e.layerDataTexture];if(y&&(T[2]=v.getAnimationDataTexture(r)),e.lighting){var w=v.image.dataSource[0];w=w?w.glTexture:this.manager.renderer.normalTexture,T[3]=w}this.updateRenderOptions(e);var S=this.programManager,b=S.getCurrentProgramSuite();if(b){var E=b.program,C=b.vao;this.setupUniforms(t,e),S.applyUniforms(E),r.drawElements(t,T,E,C,4,0)}this.onRunEnd(t)}});t.exports=x},12913(t,e,i){var s=i(83419),r=i(6141),n=new s({Extends:r,initialize:function(t){r.call(this,"TexturerImage",t),this.frame=null,this.frameWidth=0,this.frameHeight=0,this.uvSource=null},run:function(t,e,i){this.onRunBegin(t);var s=e.frame;if(this.frame=s,this.frameWidth=s.cutWidth,this.frameHeight=s.cutHeight,this.uvSource=s,e.isCropped){var r=e._crop;this.uvSource=r,r.flipX===e.flipX&&r.flipY===e.flipY||e.frame.updateCropUVs(r,e.flipX,e.flipY),this.frameWidth=r.width,this.frameHeight=r.height}var n=s.source.resolution;this.frameWidth/=n,this.frameHeight/=n,this.onRunEnd(t)}});t.exports=n},22995(t,e,i){var s=i(61340),r=i(83419),n=i(6141),a=new r({Extends:n,initialize:function(t){n.call(this,"TexturerTileSprite",t),this.frame=null,this.uvMatrix=new s},run:function(t,e,i){this.onRunBegin(t);var s=e.frame;if(this.frame=s,e.isCropped){var r=e._crop;r.flipX===e.flipX&&r.flipY===e.flipY||e.frame.updateCropUVs(r,e.flipX,e.flipY)}this.uvMatrix.loadIdentity(),this.uvMatrix.scale(1/s.width,1/s.height),this.uvMatrix.translate(e.tilePositionX,e.tilePositionY),this.uvMatrix.scale(1/e.tileScaleX,1/e.tileScaleY),this.uvMatrix.rotate(-e.tileRotation),this.uvMatrix.setQuad(0,0,e.width,e.height),this.onRunEnd(t)}});t.exports=a},86081(t,e,i){var s=i(61340),r=i(83419),n=i(46975),a=i(6141),o=new r({Extends:a,initialize:function(t,e){e=n(e||{},this.defaultConfig),a.call(this,e.name,t),this.quad=new Float32Array(8),this._spriteMatrix=new s,this._calcMatrix=new s},defaultConfig:{name:"TransformerImage",role:"Transformer"},run:function(t,e,i,s,r){this.onRunBegin(t);var n=i.frame,a=i.uvSource,o=a.x,h=a.y,l=e.displayOriginX,u=e.displayOriginY,d=-l+o,c=-u+h,f=n.customPivot,p=1,m=1;e.flipX&&(f||(d+=-n.realWidth+2*l),p=-1),e.flipY&&(f||(c+=-n.realHeight+2*u),m=-1);var g=t.camera,v=this._spriteMatrix,x=this._calcMatrix.copyWithScrollFactorFrom(g.getViewMatrix(!t.useCanvas),g.scrollX,g.scrollY,e.scrollFactorX,e.scrollFactorY);s&&x.multiply(s),v.applyITRS(e.x,e.y,e.rotation,e.scaleX*p,e.scaleY*m),x.multiply(v),x.setQuad(d,c,d+i.frameWidth,c+i.frameHeight,this.quad);var y=x.matrix,T=1===y[0]&&0===y[1]&&0===y[2]&&1===y[3];if(e.willRoundVertices(g,T)){var w=this.quad;w[0]=Math.round(w[0]),w[1]=Math.round(w[1]),w[2]=Math.round(w[2]),w[3]=Math.round(w[3]),w[4]=Math.round(w[4]),w[5]=Math.round(w[5]),w[6]=Math.round(w[6]),w[7]=Math.round(w[7])}this.onRunEnd(t)}});t.exports=o},88383(t,e,i){var s=i(61340),r=i(83419),n=i(46975),a=i(6141),o=new r({Extends:a,initialize:function(t,e){e=n(e||{},this.defaultConfig),a.call(this,e.name,t),this._spriteMatrix=new s,this.quad=this._spriteMatrix.quad},defaultConfig:{name:"TransformerStamp",role:"Transformer"},run:function(t,e,i,s,r){this.onRunBegin(t);var n=i.frame,a=i.uvSource,o=a.x,h=a.y,l=e.displayOriginX,u=e.displayOriginY,d=-l+o,c=-u+h,f=n.customPivot,p=1,m=1;e.flipX&&(f||(d+=-n.realWidth+2*l),p=-1),e.flipY&&(f||(c+=-n.realHeight+2*u),m=-1);var g=e.x,v=e.y,x=this._spriteMatrix;x.applyITRS(g,v,e.rotation,e.scaleX*p,e.scaleY*m);var y=x.matrix;this.onlyTranslate=1===y[0]&&0===y[1]&&0===y[2]&&1===y[3],x.setQuad(d,c,d+i.frameWidth,c+i.frameHeight);var T=x.matrix,w=1===T[0]&&0===T[1]&&0===T[2]&&1===T[3];if(e.willRoundVertices(t.camera,w)){var S=this.quad;S[0]=Math.round(S[0]),S[1]=Math.round(S[1]),S[2]=Math.round(S[2]),S[3]=Math.round(S[3]),S[4]=Math.round(S[4]),S[5]=Math.round(S[5]),S[6]=Math.round(S[6]),S[7]=Math.round(S[7])}this.onRunEnd(t)}});t.exports=o},34454(t,e,i){var s=i(83419),r=i(86081),n=new s({Extends:r,initialize:function(t,e){r.call(this,t,e)},defaultConfig:{name:"TransformerTile",role:"Transformer"},run:function(t,e,i,s,r){this.onRunBegin(t);var n=t.camera,a=this._calcMatrix,o=this._spriteMatrix;a.copyWithScrollFactorFrom(n.getViewMatrix(!t.useCanvas),n.scrollX,n.scrollY,e.scrollFactorX,e.scrollFactorY),s&&a.multiply(s);var h=i.frameWidth,l=i.frameHeight,u=h,d=l,c=h/2,f=l/2,p=e.scaleX,m=e.scaleY,g=e.gidMap[r.index],v=g.tileOffset.x,x=g.tileOffset.y,y=e.x+r.pixelX*p+(c*p-v),T=e.y+r.pixelY*m+(f*m-x),w=-c,S=-f;r.flipX&&(u*=-1,w+=h),r.flipY&&(d*=-1,w+=l),o.applyITRS(y,T,r.rotation,p,m),a.multiply(o),a.setQuad(w,S,w+u,S+d,this.quad);var b=a.matrix,E=1===b[0]&&0===b[1]&&0===b[2]&&1===b[3];if(e.willRoundVertices(n,E)){var C=this.quad;C[0]=Math.round(C[0]),C[1]=Math.round(C[1]),C[2]=Math.round(C[2]),C[3]=Math.round(C[3]),C[4]=Math.round(C[4]),C[5]=Math.round(C[5]),C[6]=Math.round(C[6]),C[7]=Math.round(C[7])}this.onRunEnd(t)}});t.exports=n},46211(t,e,i){var s=i(83419),r=i(86081),n=new s({Extends:r,initialize:function(t,e){r.call(this,t,e)},defaultConfig:{name:"TransformerTileSprite",role:"Transformer"},run:function(t,e,i,s,r){this.onRunBegin(t);var n=e.width,a=e.height,o=e.displayOriginX,h=e.displayOriginY,l=-o,u=-h,d=1,c=1;e.flipX&&(l+=2*o-n,d=-1),e.flipY&&(u+=2*h-a,c=-1);var f=e.x,p=e.y,m=t.camera,g=this._calcMatrix,v=this._spriteMatrix;g.copyWithScrollFactorFrom(m.getViewMatrix(!t.useCanvas),m.scrollX,m.scrollY,e.scrollFactorX,e.scrollFactorY),s&&g.multiply(s),v.applyITRS(f,p,e.rotation,e.scaleX*d,e.scaleY*c),g.multiply(v),g.setQuad(l,u,l+n,u+a,this.quad);var x=g.matrix,y=1===x[0]&&0===x[1]&&0===x[2]&&1===x[3];if(e.willRoundVertices(m,y)){var T=this.quad;T[0]=Math.round(T[0]),T[1]=Math.round(T[1]),T[2]=Math.round(T[2]),T[3]=Math.round(T[3]),T[4]=Math.round(T[4]),T[5]=Math.round(T[5]),T[6]=Math.round(T[6]),T[7]=Math.round(T[7])}this.onRunEnd(t)}});t.exports=n},84547(t){t.exports=["vec4 applyLighting (vec4 fragColor, vec3 normal)","{"," vec4 lighting = getLighting(fragColor, normal);"," return fragColor * vec4(lighting.rgb * lighting.a, lighting.a);","}"].join("\n")},11104(t){t.exports=["vec4 applyTint(vec4 texture)","{"," vec3 unpremultTexture = texture.rgb / texture.a;"," float alpha = texture.a * outTint.a;"," vec3 color = vec3(unpremultTexture);"," if (outTintEffect == 0.0) {"," color *= outTint.bgr;"," }"," else if (outTintEffect == 1.0) {"," color = outTint.bgr;"," }"," else if (outTintEffect == 2.0) {"," color += outTint.bgr;"," }"," else if (outTintEffect == 4.0) {"," color = 1.0 - (1.0 - unpremultTexture) * (1.0 - outTint.bgr);"," }"," else if (outTintEffect == 5.0) {"," color = vec3("," unpremultTexture.r < 0.5 ? 2.0 * outTint.b * unpremultTexture.r : 1.0 - 2.0 * (1.0 - outTint.b) * (1.0 - unpremultTexture.r),"," unpremultTexture.g < 0.5 ? 2.0 * outTint.g * unpremultTexture.g : 1.0 - 2.0 * (1.0 - outTint.g) * (1.0 - unpremultTexture.g),"," unpremultTexture.b < 0.5 ? 2.0 * outTint.r * unpremultTexture.b : 1.0 - 2.0 * (1.0 - outTint.r) * (1.0 - unpremultTexture.b)"," );"," }"," else if (outTintEffect == 6.0) {"," color = vec3("," outTint.b < 0.5 ? 2.0 * outTint.b * unpremultTexture.r : 1.0 - 2.0 * (1.0 - outTint.b) * (1.0 - unpremultTexture.r),"," outTint.g < 0.5 ? 2.0 * outTint.g * unpremultTexture.g : 1.0 - 2.0 * (1.0 - outTint.g) * (1.0 - unpremultTexture.g),"," outTint.r < 0.5 ? 2.0 * outTint.r * unpremultTexture.b : 1.0 - 2.0 * (1.0 - outTint.r) * (1.0 - unpremultTexture.b)"," );"," }"," return vec4(color * alpha, alpha);","}"].join("\n")},81556(t){t.exports=["vec4 boundedSampler(sampler2D sampler, vec2 uv)","{"," if (clamp(uv, 0.0, 1.0) != uv)"," {"," return vec4(0.0, 0.0, 0.0, 0.0);"," }"," return texture2D(sampler, uv);","}"].join("\n")},96293(t){t.exports=["#define SHADER_NAME PHASER_COLORMATRIX_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform float uColorMatrix[20];","uniform float uAlpha;","varying vec2 outTexCoord;","void main ()","{"," vec4 c = texture2D(uMainSampler, outTexCoord);"," if (uAlpha == 0.0)"," {"," gl_FragColor = c;"," return;"," }"," if (c.a > 0.0)"," {"," c.rgb /= c.a;"," }"," vec4 result;"," result.r = (uColorMatrix[0] * c.r) + (uColorMatrix[1] * c.g) + (uColorMatrix[2] * c.b) + (uColorMatrix[3] * c.a) + uColorMatrix[4];"," result.g = (uColorMatrix[5] * c.r) + (uColorMatrix[6] * c.g) + (uColorMatrix[7] * c.b) + (uColorMatrix[8] * c.a) + uColorMatrix[9];"," result.b = (uColorMatrix[10] * c.r) + (uColorMatrix[11] * c.g) + (uColorMatrix[12] * c.b) + (uColorMatrix[13] * c.a) + uColorMatrix[14];"," result.a = (uColorMatrix[15] * c.r) + (uColorMatrix[16] * c.g) + (uColorMatrix[17] * c.b) + (uColorMatrix[18] * c.a) + uColorMatrix[19];"," c.rgb *= c.a;"," result.rgb *= result.a;"," gl_FragColor = mix(c, result, uAlpha);","}"].join("\n")},78390(t){t.exports=["vec2 v2len (vec2 a, vec2 b)","{"," return sqrt(a*a+b*b);","}","vec2 getBlockyTexCoord (vec2 texCoord, vec2 texRes) {"," texCoord *= texRes;"," vec2 seam = floor(texCoord + 0.5);"," texCoord = (texCoord - seam) / v2len(dFdx(texCoord), dFdy(texCoord)) + seam;"," texCoord = clamp(texCoord, seam-.5, seam+.5);"," return texCoord / texRes;","}"].join("\n")},11719(t){t.exports=["struct Light","{"," vec3 position;"," vec3 color;"," float intensity;"," float radius;","};","const int kMaxLights = LIGHT_COUNT;","uniform vec4 uCamera; /* x, y, rotation, zoom */","uniform sampler2D uNormSampler;","uniform vec3 uAmbientLightColor;","uniform Light uLights[kMaxLights];","uniform int uLightCount;","#ifdef FEATURE_SELFSHADOW","uniform float uDiffuseFlatThreshold;","uniform float uPenumbra;","#endif","vec4 getLighting (vec4 fragColor, vec3 normal)","{"," vec3 finalColor = vec3(0.0);"," vec2 res = vec2(min(uResolution.x, uResolution.y)) * uCamera.w;"," #ifdef FEATURE_SELFSHADOW"," vec3 unpremultipliedColor = fragColor.rgb / fragColor.a;"," float occlusionThreshold = 1.0 - ((unpremultipliedColor.r + unpremultipliedColor.g + unpremultipliedColor.b) / uDiffuseFlatThreshold);"," #endif"," for (int index = 0; index < kMaxLights; ++index)"," {"," if (index < uLightCount)"," {"," Light light = uLights[index];"," vec3 lightDir = vec3((light.position.xy / res) - (gl_FragCoord.xy / res), light.position.z / res.x);"," vec3 lightNormal = normalize(lightDir);"," float distToSurf = length(lightDir) * uCamera.w;"," float diffuseFactor = max(dot(normal, lightNormal), 0.0);"," float radius = (light.radius / res.x * uCamera.w) * uCamera.w;"," float attenuation = clamp(1.0 - distToSurf * distToSurf / (radius * radius), 0.0, 1.0);"," #ifdef FEATURE_SELFSHADOW"," float occluded = smoothstep(0.0, 1.0, (diffuseFactor - occlusionThreshold) / uPenumbra);"," vec3 diffuse = light.color * diffuseFactor * occluded;"," #else"," vec3 diffuse = light.color * diffuseFactor;"," #endif"," finalColor += (attenuation * diffuse) * light.intensity;"," }"," }"," vec4 colorOutput = vec4(uAmbientLightColor + finalColor, 1.0);"," return colorOutput;","}"].join("\n")},14030(t){t.exports=["vec2 clampTexCoordWithinFrame (vec2 texCoord)","{"," vec2 texRes = getTexRes();"," vec4 frameTexel = outFrame * texRes.xyxy;"," vec2 frameMin = frameTexel.xy + vec2(0.5, 0.5);"," vec2 frameMax = frameTexel.xy + frameTexel.zw - vec2(0.5, 0.5);"," return clamp(texCoord, frameMin / texRes, frameMax / texRes);","}"].join("\n")},10235(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform float amount;","varying vec2 outTexCoord;","#pragma phaserTemplate(fragmentHeader)","vec2 Distort(vec2 p)","{"," float theta = atan(p.y, p.x);"," float radius = length(p);"," radius = pow(radius, amount);"," p.x = radius * cos(theta);"," p.y = radius * sin(theta);"," return 0.5 * (p + 1.0);","}","void main()","{"," vec2 xy = 2.0 * outTexCoord - 1.0;"," vec2 texCoord = outTexCoord;"," if (length(xy) < 1.0)"," {"," texCoord = Distort(xy);"," }"," gl_FragColor = boundedSampler(uMainSampler, texCoord);","}"].join("\n")},65980(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uMainSampler2;","uniform float amount;","uniform vec4 color;","varying vec2 outTexCoord;","vec4 NORMAL (vec4 base, vec4 blend)","{"," return blend + base * (1.0 - blend.a);","}","vec4 ADD (vec4 base, vec4 blend)","{"," return base + blend;","}","vec4 MULTIPLY (vec4 base, vec4 blend)","{"," return base * blend;","}","vec4 SCREEN (vec4 base, vec4 blend)","{"," return 1.0 - (1.0 - base) * (1.0 - blend);","}","float overlayChannel (float base, float blend)","{"," return base < 0.5 ? 2.0 * base * blend : 1.0 - 2.0 * (1.0 - base) * (1.0 - blend);","}","vec4 OVERLAY (vec4 base, vec4 blend)","{"," return vec4("," overlayChannel(base.r, blend.r),"," overlayChannel(base.g, blend.g),"," overlayChannel(base.b, blend.b),"," overlayChannel(base.a, blend.a)"," );","}","vec4 DARKEN (vec4 base, vec4 blend)","{"," return min(base, blend);","}","vec4 LIGHTEN (vec4 base, vec4 blend)","{"," return max(base, blend);","}","float dodgeChannel (float base, float blend)","{"," return blend == 1.0 ? blend : min(1.0, base / (1.0 - blend));","}","vec4 COLOR_DODGE (vec4 base, vec4 blend)","{"," return vec4("," dodgeChannel(base.r, blend.r),"," dodgeChannel(base.g, blend.g),"," dodgeChannel(base.b, blend.b),"," dodgeChannel(base.a, blend.a)"," );","}","float burnChannel (float base, float blend)","{"," return blend == 0.0 ? blend : 1.0 - min(1.0, (1.0 - base) / blend);","}","vec4 COLOR_BURN (vec4 base, vec4 blend)","{"," return vec4("," burnChannel(base.r, blend.r),"," burnChannel(base.g, blend.g),"," burnChannel(base.b, blend.b),"," burnChannel(base.a, blend.a)"," );","}","float hardLightChannel (float base, float blend)","{"," return blend < 0.5 ? 2.0 * base * blend : 1.0 - 2.0 * (1.0 - base) * (1.0 - blend);","}","vec4 HARD_LIGHT (vec4 base, vec4 blend)","{"," return vec4("," hardLightChannel(base.r, blend.r),"," hardLightChannel(base.g, blend.g),"," hardLightChannel(base.b, blend.b),"," hardLightChannel(base.a, blend.a)"," );","}","float softLightChannel (float base, float blend)","{"," return blend < 0.5 ? (2.0 * base * blend + base * base * (1.0 - 2.0 * blend)) : (sqrt(base) * (2.0 * blend - 1.0) + 2.0 * base * (1.0 - blend));","}","vec4 SOFT_LIGHT (vec4 base, vec4 blend)","{"," return vec4("," softLightChannel(base.r, blend.r),"," softLightChannel(base.g, blend.g),"," softLightChannel(base.b, blend.b),"," softLightChannel(base.a, blend.a)"," );","}","vec4 DIFFERENCE (vec4 base, vec4 blend)","{"," return abs(base - blend);","}","vec4 EXCLUSION (vec4 base, vec4 blend)","{"," return base + blend - 2.0 * base * blend;","}","vec3 rgbToHsl (vec3 color)","{"," vec3 hsl = vec3(0.0);"," float fmin = min(min(color.r, color.g), color.b);"," float fmax = max(max(color.r, color.g), color.b);"," float delta = fmax - fmin;"," hsl.z = (fmax + fmin) / 2.0;"," if (delta == 0.0)"," {"," hsl.x = 0.0;"," hsl.y = 0.0;"," }"," else"," {"," if (hsl.z < 0.5)"," {"," hsl.y = delta / (fmax + fmin);"," }"," else"," {"," hsl.y = delta / (2.0 - fmax - fmin);"," }"," float deltaR = (((fmax - color.r) / 6.0) + (delta / 2.0)) / delta;"," float deltaG = (((fmax - color.g) / 6.0) + (delta / 2.0)) / delta;"," float deltaB = (((fmax - color.b) / 6.0) + (delta / 2.0)) / delta;"," if (color.r == fmax)"," {"," hsl.x = deltaB - deltaG;"," }"," else if (color.g == fmax)"," {"," hsl.x = (1.0 / 3.0) + deltaR - deltaB;"," }"," else if (color.b == fmax)"," {"," hsl.x = (2.0 / 3.0) + deltaG - deltaR;"," }"," if (hsl.x < 0.0)"," {"," hsl.x += 1.0;"," }"," else if (hsl.x > 1.0)"," {"," hsl.x -= 1.0;"," }"," }"," return hsl;","}","vec3 hslToRgb (vec3 hsl)","{"," float p = hsl.z * (1.0 - hsl.y);"," float q = hsl.z * (1.0 - hsl.y * hsl.x);"," float t = hsl.z * (1.0 - hsl.y * (1.0 - hsl.x));"," if (hsl.x < 1.0 / 6.0)"," {"," return vec3(hsl.z, t, p);"," }"," else if (hsl.x < 0.5)"," {"," return vec3(q, hsl.z, p);"," }"," else if (hsl.x < 2.0 / 3.0)"," {"," return vec3(p, hsl.z, t);"," }"," return vec3(p, q, hsl.z);","}","vec4 HUE (vec4 base, vec4 blend)","{"," vec3 baseHSL = rgbToHsl(base.rgb);"," vec3 blendHSL = rgbToHsl(blend.rgb);"," return vec4(hslToRgb(vec3(blendHSL.x, baseHSL.y, baseHSL.z)), base.a);","}","vec4 SATURATION (vec4 base, vec4 blend)","{"," vec3 baseHSL = rgbToHsl(base.rgb);"," vec3 blendHSL = rgbToHsl(blend.rgb);"," return vec4(hslToRgb(vec3(baseHSL.x, blendHSL.y, baseHSL.z)), base.a);","}","vec4 COLOR (vec4 base, vec4 blend)","{"," vec3 baseHSL = rgbToHsl(base.rgb);"," vec3 blendHSL = rgbToHsl(blend.rgb);"," return vec4(hslToRgb(vec3(blendHSL.x, blendHSL.y, baseHSL.z)), base.a);","}","vec4 LUMINOSITY (vec4 base, vec4 blend)","{"," vec3 baseHSL = rgbToHsl(base.rgb);"," vec3 blendHSL = rgbToHsl(blend.rgb);"," return vec4(hslToRgb(vec3(baseHSL.x, baseHSL.y, blendHSL.z)), base.a);","}","vec4 ERASE (vec4 base, vec4 blend)","{"," return base * (1.0 - blend.a);","}","vec4 SOURCE_IN (vec4 base, vec4 blend)","{"," return blend * base.a;","}","vec4 SOURCE_OUT (vec4 base, vec4 blend)","{"," return blend * (1.0 - base.a);","}","vec4 SOURCE_ATOP (vec4 base, vec4 blend)","{"," return base * (1.0 - blend.a) + blend * base.a;","}","vec4 DESTINATION_OVER (vec4 base, vec4 blend)","{"," return base + blend * (1.0 - base.a);","}","vec4 DESTINATION_IN (vec4 base, vec4 blend)","{"," return base * blend.a;","}","vec4 DESTINATION_OUT (vec4 base, vec4 blend)","{"," return base * (1.0 - blend.a);","}","vec4 DESTINATION_ATOP (vec4 base, vec4 blend)","{"," return base * blend.a + blend * (1.0 - base.a);","}","vec4 LIGHTER (vec4 base, vec4 blend)","{"," return ADD(base, blend);","}","vec4 COPY (vec4 base, vec4 blend)","{"," return blend;","}","vec4 XOR (vec4 base, vec4 blend)","{"," return base * (1.0 - blend.a) + blend * (1.0 - base.a);","}","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec4 base = boundedSampler(uMainSampler, outTexCoord);"," vec4 blend = boundedSampler(uMainSampler2, outTexCoord) * color;"," vec4 blended = BLEND(base, blend);"," gl_FragColor = mix(base, blended, amount);","}"].join("\n")},5899(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec4 uSizeAndOffset;","varying vec2 outTexCoord;","void main()","{"," vec2 gridCell = floor((outTexCoord * resolution + uSizeAndOffset.zw) / uSizeAndOffset.xy) * uSizeAndOffset.xy - uSizeAndOffset.zw;"," vec2 texCoord = gridCell / resolution;"," gl_FragColor = texture2D(uMainSampler, texCoord);","}"].join("\n")},20784(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec2 offset;","uniform float strength;","uniform vec3 color;","varying vec2 outTexCoord;","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec2 uv = outTexCoord;"," vec4 col = vec4(0.0);"," vec2 off1 = vec2(1.411764705882353) * offset * strength;"," vec2 off2 = vec2(3.2941176470588234) * offset * strength;"," vec2 off3 = vec2(5.176470588235294) * offset * strength;"," col += boundedSampler(uMainSampler, uv) * 0.1964825501511404;"," col += boundedSampler(uMainSampler, uv + (off1 / resolution)) * 0.2969069646728344;"," col += boundedSampler(uMainSampler, uv - (off1 / resolution)) * 0.2969069646728344;"," col += boundedSampler(uMainSampler, uv + (off2 / resolution)) * 0.09447039785044732;"," col += boundedSampler(uMainSampler, uv - (off2 / resolution)) * 0.09447039785044732;"," col += boundedSampler(uMainSampler, uv + (off3 / resolution)) * 0.010381362401148057;"," col += boundedSampler(uMainSampler, uv - (off3 / resolution)) * 0.010381362401148057;"," gl_FragColor = col * vec4(color, 1.0);","}"].join("\n")},65122(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec2 offset;","uniform float strength;","uniform vec3 color;","varying vec2 outTexCoord;","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec2 uv = outTexCoord;"," vec4 col = vec4(0.0);"," vec2 offset = vec2(1.333) * offset * strength;"," col += boundedSampler(uMainSampler, uv) * 0.29411764705882354;"," col += boundedSampler(uMainSampler, uv + (offset / resolution)) * 0.35294117647058826;"," col += boundedSampler(uMainSampler, uv - (offset / resolution)) * 0.35294117647058826;"," gl_FragColor = col * vec4(color, 1.0);","}"].join("\n")},60942(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec2 offset;","uniform float strength;","uniform vec3 color;","varying vec2 outTexCoord;","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec2 uv = outTexCoord;"," vec4 col = vec4(0.0);"," vec2 off1 = vec2(1.3846153846) * offset * strength;"," vec2 off2 = vec2(3.2307692308) * offset * strength;"," col += boundedSampler(uMainSampler, uv) * 0.2270270270;"," col += boundedSampler(uMainSampler, uv + (off1 / resolution)) * 0.3162162162;"," col += boundedSampler(uMainSampler, uv - (off1 / resolution)) * 0.3162162162;"," col += boundedSampler(uMainSampler, uv + (off2 / resolution)) * 0.0702702703;"," col += boundedSampler(uMainSampler, uv - (off2 / resolution)) * 0.0702702703;"," gl_FragColor = col * vec4(color, 1.0);","}"].join("\n")},43722(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","#define ITERATIONS 100.0","#define ONEOVER_ITR 1.0 / ITERATIONS","#define PI 3.141596","#define GOLDEN_ANGLE 2.39996323","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform float radius;","uniform float amount;","uniform float contrast;","uniform bool isTiltShift;","uniform float strength;","uniform vec2 blur;","varying vec2 outTexCoord;","vec2 Sample (in float theta, inout float r)","{"," r += 1.0 / r;"," return (r - 1.0) * vec2(cos(theta), sin(theta)) * 0.06;","}","#pragma phaserTemplate(fragmentHeader)","vec3 Bokeh (sampler2D tex, vec2 uv, float radius)","{"," vec3 acc = vec3(0.0);"," vec3 div = vec3(0.0);"," vec2 pixel = vec2(resolution.y / resolution.x, 1.0) * radius * .025;"," float r = 1.0;"," for (float j = 0.0; j < GOLDEN_ANGLE * ITERATIONS; j += GOLDEN_ANGLE)"," {"," vec3 col = boundedSampler(tex, uv + pixel * Sample(j, r)).xyz;"," col = contrast > 0.0 ? col * col * (1.0 + contrast) : col;"," vec3 bokeh = vec3(0.5) + pow(col, vec3(10.0)) * amount;"," acc += col * bokeh;"," div += bokeh;"," }"," return acc / div;","}","void main ()","{"," float shift = 1.0;"," if (isTiltShift)"," {"," vec2 uv = vec2(gl_FragCoord.xy / resolution + vec2(-0.5, -0.5)) * 2.0;"," float centerStrength = 1.0;"," shift = length(uv * blur * strength) * centerStrength;"," }"," gl_FragColor = vec4(Bokeh(uMainSampler, outTexCoord * vec2(1.0, 1.0), radius * shift), 0.0);","}"].join("\n")},19883(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform float uColorMatrix[20];","uniform float uAlpha;","varying vec2 outTexCoord;","void main ()","{"," vec4 c = texture2D(uMainSampler, outTexCoord);"," if (uAlpha == 0.0)"," {"," gl_FragColor = c;"," return;"," }"," if (c.a > 0.0)"," {"," c.rgb /= c.a;"," }"," vec4 result;"," result.r = (uColorMatrix[0] * c.r) + (uColorMatrix[1] * c.g) + (uColorMatrix[2] * c.b) + (uColorMatrix[3] * c.a) + uColorMatrix[4];"," result.g = (uColorMatrix[5] * c.r) + (uColorMatrix[6] * c.g) + (uColorMatrix[7] * c.b) + (uColorMatrix[8] * c.a) + uColorMatrix[9];"," result.b = (uColorMatrix[10] * c.r) + (uColorMatrix[11] * c.g) + (uColorMatrix[12] * c.b) + (uColorMatrix[13] * c.a) + uColorMatrix[14];"," result.a = (uColorMatrix[15] * c.r) + (uColorMatrix[16] * c.g) + (uColorMatrix[17] * c.b) + (uColorMatrix[18] * c.a) + uColorMatrix[19];"," vec3 rgb = mix(c.rgb, result.rgb, uAlpha);"," rgb *= result.a;"," gl_FragColor = vec4(rgb, result.a);","}"].join("\n")},32624(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uTransferSampler;","uniform float uColorMatrixSelf[20];","uniform float uColorMatrixTransfer[20];","uniform float uAlphaSelf;","uniform float uAlphaTransfer;","uniform vec4 uAdditions;","uniform vec4 uMultiplications;","varying vec2 outTexCoord;","#define S uColorMatrixSelf","#define T uColorMatrixTransfer","void main ()","{"," vec4 self = texture2D(uMainSampler, outTexCoord);"," if (uAlphaSelf == 0.0)"," {"," gl_FragColor = self;"," return;"," }"," if (self.a > 0.0)"," {"," self.rgb /= self.a;"," }"," vec4 resultSelf;"," resultSelf.r = (S[0] * self.r) + (S[1] * self.g) + (S[2] * self.b) + (S[3] * self.a) + S[4];"," resultSelf.g = (S[5] * self.r) + (S[6] * self.g) + (S[7] * self.b) + (S[8] * self.a) + S[9];"," resultSelf.b = (S[10] * self.r) + (S[11] * self.g) + (S[12] * self.b) + (S[13] * self.a) + S[14];"," resultSelf.a = (S[15] * self.r) + (S[16] * self.g) + (S[17] * self.b) + (S[18] * self.a) + S[19];"," if (uAlphaTransfer == 0.0)"," {"," self.rgb *= self.a;"," resultSelf.rgb *= resultSelf.a;"," gl_FragColor = mix(self, resultSelf, uAlphaSelf);"," return;"," }"," vec4 tex = texture2D(uTransferSampler, outTexCoord);"," if (tex.a > 0.0)"," {"," tex.rgb /= tex.a;"," }"," vec4 resultTransfer;"," resultTransfer.r = (T[0] * tex.r) + (T[1] * tex.g) + (T[2] * tex.b) + (T[3] * tex.a) + T[4];"," resultTransfer.g = (T[5] * tex.r) + (T[6] * tex.g) + (T[7] * tex.b) + (T[8] * tex.a) + T[9];"," resultTransfer.b = (T[10] * tex.r) + (T[11] * tex.g) + (T[12] * tex.b) + (T[13] * tex.a) + T[14];"," resultTransfer.a = (T[15] * tex.r) + (T[16] * tex.g) + (T[17] * tex.b) + (T[18] * tex.a) + T[19];"," vec4 combo = (resultSelf + resultTransfer) * uAdditions + (resultSelf * resultTransfer) * uMultiplications;"," self.rgb *= self.a;"," resultSelf.rgb *= resultSelf.a;"," combo.rgb *= combo.a;"," gl_FragColor = mix(self, mix(resultSelf, combo, uAlphaTransfer), uAlphaSelf);","}"].join("\n")},12886(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uDisplacementSampler;","uniform vec2 amount;","varying vec2 outTexCoord;","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec2 disp = (-vec2(0.5, 0.5) + texture2D(uDisplacementSampler, outTexCoord).rg) * amount;"," gl_FragColor = boundedSampler(uMainSampler, outTexCoord + disp).rgba;","}"].join("\n")},33016(t){t.exports=["#pragma phaserTemplate(shaderName)","#define DISTANCE 10.0","#define QUALITY 10.0","#pragma phaserTemplate(fragmentDefine)","precision mediump float;","uniform sampler2D uMainSampler;","varying vec2 outTexCoord;","uniform float outerStrength;","uniform float innerStrength;","uniform float scale;","uniform vec2 resolution;","uniform vec4 glowColor;","uniform bool knockout;","const float PI = 3.14159265358979323846264;","const float MAX_ALPHA = DISTANCE * (DISTANCE + 1.0) * QUALITY / 2.0;","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec2 px = vec2(1.0 / resolution.x, 1.0 / resolution.y) * scale;"," float totalAlpha = 0.0;"," float curAngle = 0.0;"," vec2 direction;"," vec2 displaced;"," vec4 color;"," for (float curDistance = 0.0; curDistance < DISTANCE; curDistance++)"," {"," curAngle += fract(sin(dot(vec2(curDistance, outTexCoord.x + outTexCoord.y), vec2(12.9898, 78.233))) * 43758.5453);"," for (float i = 0.0; i < QUALITY; i++)"," {"," curAngle += PI * 2.0 / (QUALITY);"," direction = vec2(cos(curAngle), sin(curAngle)) * px;"," displaced = outTexCoord + direction * (curDistance + 1.0);"," color = boundedSampler(uMainSampler, displaced);"," totalAlpha += (DISTANCE - curDistance) * color.a;"," }"," }"," color = boundedSampler(uMainSampler, outTexCoord);"," float alphaRatio = (totalAlpha / MAX_ALPHA);"," float innerGlowAlpha = (1.0 - alphaRatio) * innerStrength * color.a;"," float innerGlowStrength = min(1.0, innerGlowAlpha);"," vec4 innerColor = mix(color, glowColor, innerGlowStrength);"," float outerGlowAlpha = alphaRatio * outerStrength * (1.0 - color.a);"," float outerGlowStrength = min(1.0 - innerColor.a, outerGlowAlpha);"," if (knockout)"," {"," float resultAlpha = outerGlowStrength + innerGlowStrength;"," gl_FragColor = vec4(glowColor.rgb * resultAlpha, resultAlpha);"," }"," else"," {"," vec4 outerGlowColor = outerGlowStrength * glowColor.rgba;"," gl_FragColor = innerColor + outerGlowColor;"," }","}"].join("\n")},33179(t){t.exports=["#pragma phaserTemplate(shaderName)","precision highp float;","#pragma phaserTemplate(fragmentHeader)","uniform sampler2D uMainSampler;","uniform vec4 uColor;","uniform vec4 uColorFactor;","uniform bool uUnpremultiply;","uniform float uAlpha;","varying vec2 outTexCoord;","void main ()","{"," vec4 sample = texture2D(uMainSampler, outTexCoord);"," if (uUnpremultiply)"," {"," sample.rgb /= sample.a;"," }"," vec4 modulatedSample = sample * uColorFactor + uColor;"," float progress = modulatedSample.r + modulatedSample.g + modulatedSample.b + modulatedSample.a;"," vec4 rampColor = getRampAt(progress);"," rampColor.rgb *= rampColor.a;"," gl_FragColor = mix(sample, rampColor * sample.a, uAlpha);","}"].join("\n")},94526(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uEnvSampler;","uniform sampler2D uNormSampler;","uniform mat4 uViewMatrix;","uniform float uModelRotation;","uniform float uBulge;","uniform vec3 uColorFactor;","varying vec2 outTexCoord;","#define PI 3.14159265358979323846","void main()","{"," vec4 color = texture2D(uMainSampler, outTexCoord);"," vec3 normal = texture2D(uNormSampler, outTexCoord).rgb;"," vec3 normalN = normal * 2.0 - 1.0;"," float normalXYLength = length(normalN.xy);"," float angle = atan("," normalN.y,"," normalN.x"," ) - uModelRotation;"," normalN = vec3("," normalXYLength * cos(angle),"," normalXYLength * sin(angle),"," normalN.z"," );"," normalN = reflect(vec3(0.0, 0.0, -1.0), normalN);"," normalN = (uViewMatrix * vec4(normalN, 1.0)).xyz;"," float envX = atan(normalN.x, normalN.z) / PI;"," float envY = sin(normalN.y * PI / 2.0);"," vec2 uv = vec2(envX, envY) * 0.5 + 0.5;"," vec2 rotatedTexCoord = vec2("," cos(-uModelRotation) * outTexCoord.x - sin(-uModelRotation) * outTexCoord.y,"," sin(-uModelRotation) * outTexCoord.x + cos(- uModelRotation) * outTexCoord.y"," );"," uv += uBulge * (rotatedTexCoord - 0.5);"," if (uv.y < 0.0)"," {"," uv.y = abs(uv.y);"," uv.x += 0.5;"," }"," else if (uv.y > 1.0)"," {"," uv.y = 2.0 - uv.y;"," uv.x += 0.5;"," }"," vec3 environment = texture2D(uEnvSampler, uv).rgb;"," gl_FragColor = vec4(environment * color.rgb * uColorFactor, color.a);","}"].join("\n")},4488(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec4 uColor;","uniform vec4 uIsolateThresholdFeather;","varying vec2 outTexCoord;","void main()","{"," vec4 color = texture2D(uMainSampler, outTexCoord);"," vec3 unpremultipliedColor = color.rgb / color.a;"," float isolate = uIsolateThresholdFeather.x;"," float threshold = uIsolateThresholdFeather.y;"," float feather = uIsolateThresholdFeather.z;"," float match = distance(unpremultipliedColor, uColor.rgb);"," match = clamp(match - threshold, 0.0, 1.0);"," match = clamp(match / feather, 0.0, 1.0);"," if (isolate == 1.0)"," {"," match = 1.0 - match;"," }"," match = mix(1.0, match, uColor.a);"," gl_FragColor = color * match;","}"].join("\n")},39603(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uMaskSampler;","uniform bool invert;","varying vec2 outTexCoord;","void main ()","{"," vec4 color = texture2D(uMainSampler, outTexCoord);"," vec4 mask = texture2D(uMaskSampler, outTexCoord);"," float a = mask.a;"," color *= invert ? (1.0 - a) : a;"," gl_FragColor = color;","}"].join("\n")},60047(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","#pragma phaserTemplate(fragmentHeader)","uniform sampler2D uMainSampler;","uniform mat4 uViewMatrix;","#ifdef FACING_POWER","uniform float uFacingPower;","#endif","#ifdef OUTPUT_RATIO","uniform vec3 uRatioVector;","uniform float uRatioRadius;","#endif","varying vec2 outTexCoord;","void main()","{"," vec3 normal = texture2D(uMainSampler, outTexCoord).rgb * 2.0 - 1.0;"," normal = (uViewMatrix * vec4(normal, 1.0)).xyz;"," #ifdef FACING_POWER"," normal = normalize(normal * vec3(1.0, 1.0, uFacingPower));"," #endif"," #ifdef OUTPUT_RATIO"," float ratio = dot(normal, normalize(uRatioVector));"," ratio = (ratio - 1.0 + uRatioRadius) / uRatioRadius;"," if (ratio <= 0.0)"," {"," ratio = 0.0;"," }"," normal = vec3(ratio * 2.0 - 1.0);"," #endif"," gl_FragColor = vec4((normal + 1.0) * 0.5, 1.0);","}"].join("\n")},7529(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform float uRadius;","uniform float uPower;","varying vec2 outTexCoord;","#define PI 3.14159265358979323846","#pragma phaserTemplate(fragmentHeader)","#define STEP_X 1.0 / SAMPLES_X","#define STEP_Y 1.0 / SAMPLES_Y","vec3 uvPanoramaNormal(vec2 uv)","{"," float y = uv.y * 2.0 - 1.0;"," float angle = (uv.x * 2.0 - 1.0) * PI;"," float x = sin(angle);"," float z = cos(angle);"," vec2 xz = vec2(x, z);"," xz *= sqrt(1.0 - y * y);"," return normalize(vec3(xz.x, y, xz.y));","}","void main()","{"," vec3 acc = vec3(0.0);"," float div = 0.0;"," vec3 texelNormal = uvPanoramaNormal(outTexCoord);"," for (float y = STEP_Y / 2.0; y < 1.0; y += STEP_Y)"," {"," float yWeight = cos((y * 2.0 - 1.0) * PI / 2.0);"," for (float x = STEP_X / 2.0; x < 1.0; x += STEP_X)"," {"," vec2 uv = vec2(x, y);"," vec3 sampleNormal = uvPanoramaNormal(uv);"," float dotProduct = dot(sampleNormal, texelNormal);"," dotProduct = (dotProduct - 1.0 + uRadius) / uRadius;"," if (dotProduct <= 0.0)"," {"," continue;"," }"," vec3 color = texture2D(uMainSampler, uv).rgb;"," color *= pow(length(color), uPower);"," acc += color * dotProduct * yWeight;"," div += dotProduct * yWeight;"," }"," }"," gl_FragColor = vec4(acc / div, 1.0);","}"].join("\n")},99191(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform float amount;","varying vec2 outTexCoord;","void main ()","{"," float pixelSize = floor(2.0 + amount);"," vec2 center = pixelSize * floor(outTexCoord * resolution / pixelSize) + pixelSize * vec2(0.5, 0.5);"," vec2 corner1 = center + pixelSize * vec2(-0.5, -0.5);"," vec2 corner2 = center + pixelSize * vec2(+0.5, -0.5);"," vec2 corner3 = center + pixelSize * vec2(+0.5, +0.5);"," vec2 corner4 = center + pixelSize * vec2(-0.5, +0.5);"," vec4 pixel = 0.4 * texture2D(uMainSampler, center / resolution);"," pixel += 0.15 * texture2D(uMainSampler, corner1 / resolution);"," pixel += 0.15 * texture2D(uMainSampler, corner2 / resolution);"," pixel += 0.15 * texture2D(uMainSampler, corner3 / resolution);"," pixel += 0.15 * texture2D(uMainSampler, corner4 / resolution);"," gl_FragColor = pixel;","}"].join("\n")},88430(t){t.exports=["#pragma phaserTemplate(shaderName)","precision highp float;","uniform sampler2D uMainSampler;","uniform vec4 uSteps;","uniform vec4 uGamma;","uniform vec4 uOffset;","uniform int uMode;","uniform bool uDither;","varying vec2 outTexCoord;","vec4 rgbaToHsva(vec4 rgba)","{"," float r = rgba.r;"," float g = rgba.g;"," float b = rgba.b;"," float a = rgba.a;"," float min = min(min(r, g), b);"," float max = max(max(r, g), b);"," float d = max - min;"," float h = 0.0;"," float s = (max == 0.0) ? 0.0 : d / max;"," float v = max;"," if (max != min)"," {"," if (max == r)"," {"," h = (g - b) / d + ((g < b) ? 6.0 : 0.0);"," }"," else if (max == g)"," {"," h = (b - r) / d + 2.0;"," }"," else"," {"," h = (r - g) / d + 4.0;"," }"," h /= 6.0;"," }"," return vec4(h, s, v, a);","}","float hsvaToRgbaConvert(float n, vec4 hsva)","{"," float k = mod(n + hsva.x * 6.0, 6.0);"," float min = min(min(k, 4.0 - k), 1.0);"," return hsva.z - hsva.z * hsva.y * max(0.0, min);","}","vec4 hsvaToRgba(vec4 hsva)","{"," return vec4("," hsvaToRgbaConvert(5.0, hsva),"," hsvaToRgbaConvert(3.0, hsva),"," hsvaToRgbaConvert(1.0, hsva),"," hsva.a"," );","}","vec4 ditherIGN(vec4 value)","{"," value += fract(52.9829189 * fract(0.06711056 * gl_FragCoord.x + 0.00583715 * gl_FragCoord.y)) - 0.5;"," return value;","}","void main ()","{"," vec4 sample = texture2D(uMainSampler, outTexCoord);"," if (uMode == 1)"," {"," sample = rgbaToHsva(sample);"," }"," sample = pow(sample, uGamma);"," sample -= uOffset;"," vec4 steps = max(uSteps - 1.0, 1.0);"," sample *= steps;"," if (uDither)"," {"," sample = ditherIGN(sample);"," }"," sample = ceil(sample - 0.5);"," sample /= steps;"," sample += uOffset;"," sample = pow(sample, 1.0 / uGamma);"," if (uMode == 1)"," {"," sample.x = mod(sample.x, 1.0);"," sample = hsvaToRgba(clamp(sample, 0.0, 1.0));"," }"," gl_FragColor = sample;","}"].join("\n")},69355(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","varying vec2 outTexCoord;","uniform vec2 lightPosition;","uniform vec4 color;","uniform float decay;","uniform float power;","uniform float intensity;","uniform int samples;","const int MAX = 12;","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec4 texture = boundedSampler(uMainSampler, outTexCoord);"," vec2 pc = (lightPosition - outTexCoord) * intensity;"," float shadow = 0.0;"," float limit = max(float(MAX), float(samples));"," for (int i = 0; i < MAX; ++i)"," {"," if (i >= samples)"," {"," break;"," }"," shadow += boundedSampler(uMainSampler, outTexCoord + float(i) * decay / limit * pc).a * power;"," }"," float mask = 1.0 - texture.a;"," gl_FragColor = mix(texture, color, clamp(shadow * mask, 0.0, 1.0));","}"].join("\n")},92636(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec4 edge1;","uniform vec4 edge2;","uniform vec4 invert;","varying vec2 outTexCoord;","void main ()","{"," vec4 color = texture2D(uMainSampler, outTexCoord);"," color = clamp((color - edge1) / (edge2 - edge1), 0.0, 1.0);"," color = mix(color, 1.0 - color, invert);"," gl_FragColor = color;","}"].join("\n")},18185(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform float uRadius;","uniform float uStrength;","uniform vec2 uPosition;","uniform vec4 uColor;","uniform int uBlendMode;","varying vec2 outTexCoord;","void main ()","{"," float vignette = 1.0;"," vec2 position = vec2(uPosition.x, 1.0 - uPosition.y);"," float d = length(outTexCoord - position);"," if (d <= uRadius)"," {"," float g = d / uRadius;"," vignette = sin(g * 3.14 * uStrength);"," }"," vec4 color = uColor;"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," if (uBlendMode == 1)"," {"," color.rgb = texture.rgb + color.rgb;"," }"," else if (uBlendMode == 2)"," {"," color.rgb = texture.rgb * color.rgb;"," }"," else if (uBlendMode == 3)"," {"," color.rgb = 1.0 - ((1.0 - texture.rgb) * (1.0 - color.rgb));"," }"," gl_FragColor = mix(texture, color, vignette);","}"].join("\n")},99174(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uMainSampler2;","uniform vec4 uProgress_WipeWidth_Direction_Axis;","uniform float uReveal;","varying vec2 outTexCoord;","void main ()","{"," vec4 color0;"," vec4 color1;"," if (uReveal == 0.0)"," {"," color0 = texture2D(uMainSampler, outTexCoord);"," color1 = texture2D(uMainSampler2, outTexCoord);"," }"," else"," {"," color0 = texture2D(uMainSampler2, outTexCoord);"," color1 = texture2D(uMainSampler, outTexCoord);"," }"," float distance = uProgress_WipeWidth_Direction_Axis.x;"," float width = uProgress_WipeWidth_Direction_Axis.y;"," float direction = uProgress_WipeWidth_Direction_Axis.z;"," float axis = outTexCoord.x;"," if (uProgress_WipeWidth_Direction_Axis.w == 1.0)"," {"," axis = outTexCoord.y;"," }"," float adjust = mix(width, -width, distance);"," float value = smoothstep(distance - width, distance + width, abs(direction - axis) + adjust);"," gl_FragColor = mix(color1, color0, value);","}"].join("\n")},73416(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(fragmentDefine)","uniform vec2 uResolution;","varying vec4 outTint;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec4 fragColor = outTint;"," #pragma phaserTemplate(fragmentProcess)"," gl_FragColor = fragColor;","}"].join("\n")},91627(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(vertexDefine)","uniform mat4 uProjectionMatrix;","uniform vec2 uResolution;","attribute vec2 inPosition;","attribute vec4 inTint;","varying vec4 outTint;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(vertexHeader)","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);"," outTint = vec4(inTint.bgr * inTint.a, inTint.a);"," #pragma phaserTemplate(vertexProcess)","}"].join("\n")},84220(t){t.exports=["vec3 getNormalFromMap (vec2 texCoord)","{"," vec3 normalMap = texture2D(uNormSampler, texCoord).rgb;"," return normalize(outInverseRotationMatrix * vec3(normalMap * 2.0 - 1.0));","}"].join("\n")},2860(t){t.exports=["uniform vec2 uMainResolution[TEXTURE_COUNT];","vec2 getTexRes ()","{"," #if TEXTURE_COUNT == 1"," float texId = 0.0;"," #else"," float texId = outTexDatum;"," #endif"," #pragma phaserTemplate(texIdProcess)"," vec2 texRes = vec2(0.0);"," for (int i = 0; i < TEXTURE_COUNT; i++)"," {"," if (texId == float(i))"," {"," texRes = uMainResolution[i];"," break;"," }"," }"," return texRes;","}"].join("\n")},46432(t){t.exports=["uniform sampler2D uMainSampler[TEXTURE_COUNT];","vec4 getTexture (vec2 texCoord)","{"," #if TEXTURE_COUNT == 1"," return texture2D(uMainSampler[0], texCoord);"," #else"," if (outTexDatum == 0.0) return texture2D(uMainSampler[0], texCoord);"," #define ELSE_TEX_CASE(INDEX) else if (outTexDatum == float(INDEX)) return texture2D(uMainSampler[INDEX], texCoord);"," #pragma phaserTemplate(texIdProcess)"," else return vec4(0.0, 0.0, 0.0, 0.0);"," #endif","}"].join("\n")},41509(t){t.exports=["#pragma phaserTemplate(shaderName)","precision highp float;","#pragma phaserTemplate(fragmentHeader)","#define PI 3.14159265358979323846","uniform int uRepeatMode;","uniform float uOffset;","uniform int uShapeMode;","uniform vec2 uShape;","uniform vec2 uStart;","varying vec2 outTexCoord;","float linear()","{"," float len = length(uShape);"," return dot(uShape, outTexCoord - uStart) / len / len;","}","float bilinear()","{"," return abs(linear());","}","float radial()","{"," return distance(uStart, outTexCoord) / length(uShape);","}","float conicSymmetric()","{"," return dot(normalize(uShape), normalize(outTexCoord - uStart)) * 0.5 + 0.5;","}","float conicAsymmetric()","{"," vec2 fromStart = outTexCoord - uStart;"," float angleFromStart = atan(fromStart.y, fromStart.x);"," float shapeAngle = atan(uShape.y, uShape.x);"," float angle = (angleFromStart - shapeAngle) / PI / 2.0;"," if (angle < 0.0) angle += 1.0;"," return angle;","}","float repeat(float value)","{"," if (uRepeatMode == 1)"," {"," if (value < 0.0 || value > 1.0)"," {"," discard;"," }"," return value;"," }"," else if (uRepeatMode == 2)"," {"," return mod(value, 1.0);"," }"," else if (uRepeatMode == 3)"," {"," return 1.0 - abs(1.0 - mod(value, 2.0));"," }"," return clamp(value, 0.0, 1.0);","}","void main()","{"," float progress = 0.0;"," if (uShapeMode == 0)"," {"," progress = linear();"," }"," else if (uShapeMode == 1)"," {"," progress = bilinear();"," }"," else if (uShapeMode == 2)"," {"," progress = radial();"," }"," else if (uShapeMode == 3)"," {"," progress = conicSymmetric();"," }"," else if (uShapeMode == 4)"," {"," progress = conicAsymmetric();"," }"," progress -= uOffset;"," progress = repeat(progress);"," vec4 bandCol = getRampAt(progress);"," bandCol.rgb *= bandCol.a;"," gl_FragColor = bandCol;","}"].join("\n")},98840(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(fragmentDefine)","uniform vec2 uResolution;","varying vec2 outTexCoord;","varying float outTexDatum;","varying float outTintEffect;","varying vec4 outTint;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," #pragma phaserTemplate(fragmentProcess)"," gl_FragColor = fragColor;","}"].join("\n")},44667(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(vertexDefine)","uniform mat4 uProjectionMatrix;","uniform vec2 uResolution;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","attribute float inTexDatum;","attribute float inTintEffect;","attribute vec4 inTint;","varying vec2 outTexCoord;","varying float outTexDatum;","varying float outTintEffect;","varying vec4 outTint;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(vertexHeader)","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);"," outTexCoord = inTexCoord;"," outTexDatum = inTexDatum;"," outTint = inTint;"," outTintEffect = inTintEffect;"," #pragma phaserTemplate(vertexProcess)","}"].join("\n")},16421(t){t.exports=["#version 100","#pragma phaserTemplate(shaderName)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform vec2 uOffset;","uniform vec4 uColorStart;","uniform vec4 uColorEnd;","uniform float uPower;","uniform int uMode;","varying vec2 outTexCoord;","float trig(vec2 p)","{"," return fract(43757.5453*sin(dot(p, vec2(12.9898,78.233))));","}","void main ()","{"," float value = pow(trig(outTexCoord + uOffset), uPower);"," if (uMode == 0)"," {"," vec4 color = mix(uColorStart, uColorEnd, value);"," color.rgb *= color.a;"," gl_FragColor = color;"," }"," else if (uMode == 1)"," {"," float valueR = pow(trig(outTexCoord + uOffset + 32.1), uPower);"," float valueG = pow(trig(outTexCoord + uOffset + 11.1), uPower);"," float valueB = pow(trig(outTexCoord + uOffset + 23.4), uPower);"," vec4 color = vec4(valueR, valueG, valueB, 1.);"," color *= mix(uColorStart, uColorEnd, value);"," color.rgb *= color.a;"," gl_FragColor = color;"," }"," else if (uMode == 2)"," {"," float valueAngle = pow(trig(outTexCoord + uOffset), uPower) * 3.141592;"," float x = value * cos(valueAngle);"," float y = value * sin(valueAngle);"," vec4 color = vec4("," x,"," y,"," sqrt(1. - x * x - y * y),"," 1.0"," );"," gl_FragColor = color * 0.5 + 0.5;"," }","}"].join("\n")},83587(t){t.exports=["#version 100","#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(fragmentIterations)","#pragma phaserTemplate(fragmentNormalMap)","#ifndef ITERATION_COUNT","#define ITERATION_COUNT 1.0","#endif","#ifndef WARP_ITERATION_COUNT","#define WARP_ITERATION_COUNT 1.0","#endif","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform vec2 uCells;","uniform vec2 uPeriod;","uniform vec2 uOffset;","uniform float uFlow;","uniform float uDetailPower;","uniform float uFlowPower;","uniform float uContributionPower;","uniform float uWarpDetailPower;","uniform float uWarpFlowPower;","uniform float uWarpContributionPower;","uniform float uWarpAmount;","uniform vec4 uColorStart;","uniform vec4 uColorEnd;","uniform float uNormalScale;","uniform float uValueFactor;","uniform float uValueAdd;","uniform float uValuePower;","uniform vec2 uSeed;","varying vec2 outTexCoord;","float psrdnoise(vec2 x, vec2 period, float alpha)","{"," vec2 uv = vec2(x.x+x.y*0.5, x.y);"," vec2 i0 = floor(uv), f0 = fract(uv);"," float cmp = step(f0.y, f0.x);"," vec2 o1 = vec2(cmp, 1.0-cmp);"," vec2 i1 = i0 + o1, i2 = i0 + 1.0;"," vec2 v0 = vec2(i0.x - i0.y*0.5, i0.y);"," vec2 v1 = vec2(v0.x + o1.x - o1.y*0.5, v0.y + o1.y);"," vec2 v2 = vec2(v0.x + 0.5, v0.y + 1.0);"," vec2 x0 = x - v0, x1 = x - v1, x2 = x - v2;"," vec3 iu, iv, xw, yw;"," if(any(greaterThan(period, vec2(0.0)))) {"," xw = vec3(v0.x, v1.x, v2.x); yw = vec3(v0.y, v1.y, v2.y);"," if(period.x > 0.0)"," xw = mod(vec3(v0.x, v1.x, v2.x), period.x);"," if(period.y > 0.0)"," yw = mod(vec3(v0.y, v1.y, v2.y), period.y);"," iu = floor(xw + 0.5*yw + 0.5); iv = floor(yw + 0.5);"," } else {"," iu = vec3(i0.x, i1.x, i2.x); iv = vec3(i0.y, i1.y, i2.y);"," }"," iu += uSeed.xxx; iv += uSeed.yyy;"," vec3 hash = mod(iu, 289.0);"," hash = mod((hash*51.0 + 2.0)*hash + iv, 289.0);"," hash = mod((hash*34.0 + 10.0)*hash, 289.0);"," vec3 psi = hash*0.07482 + alpha;"," vec3 gx = cos(psi); vec3 gy = sin(psi);"," vec2 g0 = vec2(gx.x, gy.x);"," vec2 g1 = vec2(gx.y, gy.y);"," vec2 g2 = vec2(gx.z, gy.z);"," vec3 w = 0.8 - vec3(dot(x0, x0), dot(x1, x1), dot(x2, x2));"," w = max(w, 0.0); vec3 w2 = w*w; vec3 w4 = w2*w2;"," vec3 gdotx = vec3(dot(g0, x0), dot(g1, x1), dot(g2, x2));"," float n = dot(w4, gdotx);"," return 10.9*n;","}","float iterate (vec2 coord, float detailPower, float flowPower, float contributionPower)","{"," float value = 0.;"," float itValue = 0.;"," for (float iteration = 0.; iteration < ITERATION_COUNT; iteration++)"," {"," float detailScale = pow(detailPower, iteration);"," float flowScale = pow(flowPower, iteration);"," itValue = psrdnoise((coord + iteration) * detailScale, uPeriod * detailScale, uFlow * flowScale + iteration);"," value += itValue / pow(contributionPower, iteration);"," }"," return value;","}","float iterateWarp (vec2 coord, float detailPower, float flowPower, float contributionPower)","{"," float value = 0.;"," float itValue = 0.;"," for (float iteration = 0.; iteration < WARP_ITERATION_COUNT; iteration++)"," {"," float detailScale = pow(detailPower, iteration);"," float flowScale = pow(flowPower, iteration);"," itValue = psrdnoise((coord + iteration) * detailScale, uPeriod * detailScale, uFlow * flowScale + iteration);"," value += itValue / pow(contributionPower, iteration);"," }"," return value;","}","vec2 warp (vec2 coord)","{"," vec2 o2 = vec2(11.3, 23.7);"," float coord1 = iterateWarp(coord, uWarpDetailPower, uWarpFlowPower, uWarpContributionPower);"," float coord2 = iterateWarp(coord + o2, uWarpDetailPower, uWarpFlowPower, uWarpContributionPower);"," return vec2(coord1, coord2);","}","void main ()","{"," vec2 coord = outTexCoord * uCells + uOffset;"," if (uWarpAmount > 0.)"," {"," coord += warp(coord) * uWarpAmount;"," }"," float value = iterate(coord, uDetailPower, uFlowPower, uContributionPower) * uValueFactor + uValueAdd;"," value = pow(clamp(value, 0., 1.), uValuePower);"," #ifndef NORMAL_MAP"," vec4 color = mix(uColorStart, uColorEnd, value);"," color.rgb *= color.a;"," gl_FragColor = color;"," #else"," float dx = dFdx(value) * uNormalScale;"," float dy = dFdy(value) * uNormalScale;"," vec3 normal = vec3(dx, dy, 1.0 - sqrt(dx * dx + dy * dy)) * 0.5 + 0.5;"," gl_FragColor = vec4(normal, 1.0);"," #endif","}"].join("\n")},13460(t){t.exports=["#version 100","#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(fragmentIterations)","#pragma phaserTemplate(fragmentNormalMap)","#ifndef ITERATION_COUNT","#define ITERATION_COUNT 1.0","#endif","#ifndef WARP_ITERATION_COUNT","#define WARP_ITERATION_COUNT 1.0","#endif","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform vec3 uCells;","uniform vec3 uPeriod;","uniform vec3 uOffset;","uniform float uFlow;","uniform float uDetailPower;","uniform float uFlowPower;","uniform float uContributionPower;","uniform float uWarpDetailPower;","uniform float uWarpFlowPower;","uniform float uWarpContributionPower;","uniform float uWarpAmount;","uniform vec4 uColorStart;","uniform vec4 uColorEnd;","uniform float uNormalScale;","uniform float uValueFactor;","uniform float uValueAdd;","uniform float uValuePower;","uniform vec3 uSeed;","varying vec2 outTexCoord;","vec4 permute(vec4 i) {"," vec4 im = mod(i, 289.0);"," return mod(((im * 34.0) + 10.0) * im, 289.0);","}","float psrdnoise(vec3 x, vec3 period, float alpha) {"," const mat3 M = mat3(0.0, 1.0, 1.0, 1.0, 0.0, 1.0, 1.0, 1.0, 0.0);"," const mat3 Mi = mat3(-0.5, 0.5, 0.5, 0.5, -0.5, 0.5, 0.5, 0.5, -0.5);"," vec3 uvw = M * x;"," vec3 i0 = floor(uvw);"," vec3 f0 = fract(uvw);"," vec3 g_ = step(f0.xyx, f0.yzz);"," vec3 l_ = 1.0 - g_;"," vec3 g = vec3(l_.z, g_.xy);"," vec3 l = vec3(l_.xy, g_.z);"," vec3 o1 = min(g, l);"," vec3 o2 = max(g, l);"," vec3 i1 = i0 + o1, i2 = i0 + o2, i3 = i0 + 1.0;"," vec3 v0 = Mi * i0, v1 = Mi * i1, v2 = Mi * i2, v3 = Mi * i3;"," vec3 x0 = x - v0, x1 = x - v1, x2 = x - v2, x3 = x - v3;"," if(any(greaterThan(period, vec3(0.0)))) {"," vec4 vx = vec4(v0.x, v1.x, v2.x, v3.x);"," vec4 vy = vec4(v0.y, v1.y, v2.y, v3.y);"," vec4 vz = vec4(v0.z, v1.z, v2.z, v3.z);"," if(period.x > 0.0)"," vx = mod(vx, period.x);"," if(period.y > 0.0)"," vy = mod(vy, period.y);"," if(period.z > 0.0)"," vz = mod(vz, period.z);"," i0 = floor(M * vec3(vx.x, vy.x, vz.x) + 0.5);"," i1 = floor(M * vec3(vx.y, vy.y, vz.y) + 0.5);"," i2 = floor(M * vec3(vx.z, vy.z, vz.z) + 0.5);"," i3 = floor(M * vec3(vx.w, vy.w, vz.w) + 0.5);"," }"," i0 += uSeed; i1 += uSeed; i2 += uSeed; i3 += uSeed;"," vec4 hash = permute(permute(permute(vec4(i0.z, i1.z, i2.z, i3.z)) + vec4(i0.y, i1.y, i2.y, i3.y)) + vec4(i0.x, i1.x, i2.x, i3.x));"," vec4 theta = hash * 3.883222077;"," vec4 sz = 0.996539792 - 0.006920415 * hash;"," vec4 psi = hash * 0.108705628;"," vec4 Ct = cos(theta);"," vec4 St = sin(theta);"," vec4 sz_prime = sqrt(1.0 - sz * sz);"," vec4 gx, gy, gz;"," if(alpha != 0.0) {"," vec4 px = Ct * sz_prime;"," vec4 py = St * sz_prime;"," vec4 pz = sz;"," vec4 Sp = sin(psi);"," vec4 Cp = cos(psi);"," vec4 Ctp = St * Sp - Ct * Cp;"," vec4 qx = mix(Ctp * St, Sp, sz);"," vec4 qy = mix(-Ctp * Ct, Cp, sz);"," vec4 qz = -(py * Cp + px * Sp);"," vec4 Sa = vec4(sin(alpha));"," vec4 Ca = vec4(cos(alpha));"," gx = Ca * px + Sa * qx;"," gy = Ca * py + Sa * qy;"," gz = Ca * pz + Sa * qz;"," } else {"," gx = Ct * sz_prime;"," gy = St * sz_prime;"," gz = sz;"," }"," vec3 g0 = vec3(gx.x, gy.x, gz.x), g1 = vec3(gx.y, gy.y, gz.y);"," vec3 g2 = vec3(gx.z, gy.z, gz.z), g3 = vec3(gx.w, gy.w, gz.w);"," vec4 w = 0.5 - vec4(dot(x0, x0), dot(x1, x1), dot(x2, x2), dot(x3, x3));"," w = max(w, 0.0);"," vec4 w2 = w * w;"," vec4 w3 = w2 * w;"," vec4 gdotx = vec4(dot(g0, x0), dot(g1, x1), dot(g2, x2), dot(g3, x3));"," float n = dot(w3, gdotx);"," return 39.5 * n;","}","float iterate (vec3 coord, float detailPower, float flowPower, float contributionPower)","{"," float value = 0.;"," float itValue = 0.;"," for (float iteration = 0.; iteration < ITERATION_COUNT; iteration++)"," {"," float detailScale = pow(detailPower, iteration);"," float flowScale = pow(flowPower, iteration);"," itValue = psrdnoise((coord + iteration) * detailScale, uPeriod * detailScale, uFlow * flowScale + iteration);"," value += itValue / pow(contributionPower, iteration);"," }"," return value;","}","float iterateWarp (vec3 coord, float detailPower, float flowPower, float contributionPower)","{"," float value = 0.;"," float itValue = 0.;"," for (float iteration = 0.; iteration < WARP_ITERATION_COUNT; iteration++)"," {"," float detailScale = pow(detailPower, iteration);"," float flowScale = pow(flowPower, iteration);"," itValue = psrdnoise((coord + iteration) * detailScale, uPeriod * detailScale, uFlow * flowScale + iteration);"," value += itValue / pow(contributionPower, iteration);"," }"," return value;","}","vec3 warp (vec3 coord)","{"," vec3 o2 = vec3(11.3, 23.7, 13.1);"," vec3 o3 = vec3(29.9, 2.3, 31.7);"," float coord1 = iterateWarp(coord, uWarpDetailPower, uWarpFlowPower, uWarpContributionPower);"," float coord2 = iterateWarp(coord + o2, uWarpDetailPower, uWarpFlowPower, uWarpContributionPower);"," float coord3 = iterateWarp(coord + o3, uWarpDetailPower, uWarpFlowPower, uWarpContributionPower);"," return vec3(coord1, coord2, coord3);","}","void main ()","{"," vec3 coord = (vec3(outTexCoord, 0.0) * uCells) + uOffset;"," if (uWarpAmount > 0.)"," {"," coord += warp(coord) * uWarpAmount;"," }"," float value = iterate(coord, uDetailPower, uFlowPower, uContributionPower) * uValueFactor + uValueAdd;"," value = pow(clamp(value, 0., 1.), uValuePower);"," #ifndef NORMAL_MAP"," vec4 color = mix(uColorStart, uColorEnd, value);"," color.rgb *= color.a;"," gl_FragColor = color;"," #else"," float dx = dFdx(value) * uNormalScale;"," float dy = dFdy(value) * uNormalScale;"," vec3 normal = vec3(dx, dy, 1.0 - sqrt(dx * dx + dy * dy)) * 0.5 + 0.5;"," gl_FragColor = vec4(normal, 1.0);"," #endif","}"].join("\n")},17205(t){t.exports=["#version 100","#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(fragmentMode)","#pragma phaserTemplate(fragmentIterations)","#pragma phaserTemplate(fragmentNormalMap)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform vec2 uSeedX;","uniform vec2 uSeedY;","uniform vec2 uCells;","uniform vec2 uCellOffset;","uniform vec2 uVariation;","uniform vec2 uWrap;","uniform float uSmoothing;","uniform float uNormalScale;","uniform vec4 uColorStart;","uniform vec4 uColorEnd;","varying vec2 outTexCoord;","float trig(vec2 p)","{"," return fract(43757.5453*sin(dot(p, vec2(12.9898,78.233))));","}","vec2 bigCoord (vec2 coord, float scale)","{"," return (coord + uCellOffset) * scale * uCells;","}","vec2 hash2D (vec2 coord)","{"," return vec2("," trig(coord + uSeedX),"," trig(coord + uSeedY)"," ) * uVariation;","}","float worley2D (vec2 uv, float scale)","{"," vec2 coord = bigCoord(uv, scale);"," vec2 point = floor(coord);"," vec2 frac = fract(coord);"," float dist = 12.0;"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec2 cellNeighbor = vec2(i, j);"," vec2 jitter = hash2D(mod(point + cellNeighbor, uWrap * scale));"," vec2 diff = cellNeighbor - frac + jitter;"," float d = dot(diff, diff); // Squared length of diff."," if (d < dist)"," {"," dist = d;"," }"," }"," return sqrt(dist);","}","float worley2DIndex (vec2 uv, float scale)","{"," vec2 coord = bigCoord(uv, scale);"," vec2 point = floor(coord);"," vec2 frac = fract(coord);"," float dist = 12.0;"," float random = 0.0;"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec2 cellNeighbor = vec2(i, j);"," vec2 jitter = hash2D(mod(point + cellNeighbor, uWrap * scale));"," vec2 diff = cellNeighbor - frac + jitter;"," float d = dot(diff, diff); // Squared length of diff."," if (d < dist)"," {"," dist = d;"," random = jitter.x;"," }"," }"," return random;","}","float worley2DSmooth (vec2 uv, float scale)","{"," vec2 coord = bigCoord(uv, scale);"," vec2 point = floor(coord);"," vec2 frac = fract(coord);"," float value = 0.0;"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec2 cellNeighbor = vec2(i, j);"," vec2 jitter = hash2D(mod(point + cellNeighbor, uWrap * scale));"," vec2 diff = cellNeighbor - frac + jitter;"," float d = length(diff);"," value += exp2(-32.0 / uSmoothing * d); // Accumulate fast-decaying exponential of length."," }"," return -(1.0 / 32.0 * uSmoothing) * log2(value);","}","float iterateWorley2D (vec2 uv)","{"," float value = 0.0;"," float itValue = 0.0;"," for (float iteration = 0.0; iteration < ITERATION_COUNT; iteration++)"," {"," float scale = exp2(iteration);"," #ifdef MODE_DISTANCE"," itValue = worley2D(uv + iteration, scale);"," #endif"," #ifdef MODE_INDEX"," itValue = worley2DIndex(uv + iteration, scale);"," #endif"," #ifdef MODE_DISTANCE_SMOOTH"," itValue = worley2DSmooth(uv + iteration, scale);"," #endif"," value += (itValue - 0.5) / scale;"," }"," return value + 0.5;","}","void main ()","{"," float value = iterateWorley2D(outTexCoord);"," #ifndef NORMAL_MAP"," vec4 color = mix(uColorStart, uColorEnd, value);"," color.rgb *= color.a;"," gl_FragColor = color;"," #else"," float dx = dFdx(value) * uNormalScale;"," float dy = dFdy(value) * uNormalScale;"," vec3 normal = vec3(dx, dy, 1.0 - sqrt(dx * dx + dy * dy)) * 0.5 + 0.5;"," gl_FragColor = vec4(normal, 1.0);"," #endif","}"].join("\n")},79814(t){t.exports=["#version 100","#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(fragmentMode)","#pragma phaserTemplate(fragmentIterations)","#pragma phaserTemplate(fragmentNormalMap)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform vec3 uSeedX;","uniform vec3 uSeedY;","uniform vec3 uSeedZ;","uniform vec3 uCells;","uniform vec3 uCellOffset;","uniform vec3 uVariation;","uniform vec3 uWrap;","uniform float uSmoothing;","uniform float uNormalScale;","uniform vec4 uColorStart;","uniform vec4 uColorEnd;","varying vec2 outTexCoord;","float trig(vec3 p)","{"," return fract(43757.5453*sin(dot(p, vec3(12.9898,78.233, 9441.8953))));","}","vec3 bigCoord (vec3 coord, float scale)","{"," return (coord + uCellOffset) * scale * uCells;","}","vec3 hash3D (vec3 coord)","{"," return vec3("," trig(coord + uSeedX),"," trig(coord + uSeedY),"," trig(coord + uSeedZ)"," ) * uVariation;","}","float worley3D (vec3 uv, float scale)","{"," vec3 coord = bigCoord(uv, scale);"," vec3 point = floor(coord);"," vec3 frac = fract(coord);"," float dist = 12.0;"," for (float k = -1.0; k <= 1.0; k++)"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec3 cellNeighbor = vec3(i, j, k);"," vec3 jitter = hash3D(mod(point + cellNeighbor, uWrap * scale));"," vec3 diff = cellNeighbor - frac + jitter;"," float d = dot(diff, diff); // Squared length of diff."," if (d < dist)"," {"," dist = d;"," }"," }"," return sqrt(dist);","}","float worley3DIndex (vec3 uv, float scale)","{"," vec3 coord = bigCoord(uv, scale);"," vec3 point = floor(coord);"," vec3 frac = fract(coord);"," float dist = 12.0;"," float random = 0.0;"," for (float k = -1.0; k <= 1.0; k++)"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec3 cellNeighbor = vec3(i, j, k);"," vec3 jitter = hash3D(mod(point + cellNeighbor, uWrap * scale));"," vec3 diff = cellNeighbor - frac + jitter;"," float d = dot(diff, diff); // Squared length of diff."," if (d < dist)"," {"," dist = d;"," random = jitter.x;"," }"," }"," return random;","}","float worley3DSmooth (vec3 uv, float scale)","{"," vec3 coord = bigCoord(uv, scale);"," vec3 point = floor(coord);"," vec3 frac = fract(coord);"," float value = 0.0;"," for (float k = -1.0; k <= 1.0; k++)"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec3 cellNeighbor = vec3(i, j, k);"," vec3 jitter = hash3D(mod(point + cellNeighbor, uWrap * scale));"," vec3 diff = cellNeighbor - frac + jitter;"," float d = length(diff);"," value += exp2(-32.0 / uSmoothing * d); // Accumulate fast-decaying exponential of length."," }"," return -(1.0 / 32.0 * uSmoothing) * log2(value);","}","float iterateWorley3D (vec3 uv)","{"," float value = 0.0;"," float itValue = 0.0;"," for (float iteration = 0.0; iteration < ITERATION_COUNT; iteration++)"," {"," float scale = exp2(iteration);"," #ifdef MODE_DISTANCE"," itValue = worley3D(uv + iteration, scale);"," #endif"," #ifdef MODE_INDEX"," itValue = worley3DIndex(uv + iteration, scale);"," #endif"," #ifdef MODE_DISTANCE_SMOOTH"," itValue = worley3DSmooth(uv + iteration, scale);"," #endif"," value += (itValue - 0.5) / scale;"," }"," return value + 0.5;","}","void main ()","{"," vec3 uv = vec3(outTexCoord, 0.0);"," float value = iterateWorley3D(uv);"," #ifndef NORMAL_MAP"," vec4 color = mix(uColorStart, uColorEnd, value);"," color.rgb *= color.a;"," gl_FragColor = color;"," #else"," float dx = dFdx(value) * uNormalScale;"," float dy = dFdy(value) * uNormalScale;"," vec3 normal = vec3(dx, dy, 1.0 - sqrt(dx * dx + dy * dy)) * 0.5 + 0.5;"," gl_FragColor = vec4(normal, 1.0);"," #endif","}"].join("\n")},99595(t){t.exports=["#version 100","#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(fragmentMode)","#pragma phaserTemplate(fragmentIterations)","#pragma phaserTemplate(fragmentNormalMap)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform vec4 uSeedX;","uniform vec4 uSeedY;","uniform vec4 uSeedZ;","uniform vec4 uSeedW;","uniform vec4 uCells;","uniform vec4 uCellOffset;","uniform vec4 uVariation;","uniform vec4 uWrap;","uniform float uSmoothing;","uniform float uNormalScale;","uniform vec4 uColorStart;","uniform vec4 uColorEnd;","varying vec2 outTexCoord;","float trig(vec4 p)","{"," return fract(43757.5453*sin(dot(p, vec4(12.9898,78.233,9441.8953,61.99))));","}","vec4 bigCoord (vec4 coord, float scale)","{"," return (coord + uCellOffset) * scale * uCells;","}","vec4 hash4D (vec4 coord)","{"," return vec4("," trig(coord + uSeedX),"," trig(coord + uSeedY),"," trig(coord + uSeedZ),"," trig(coord + uSeedW)"," ) * uVariation;","}","float worley4D (vec4 uv, float scale)","{"," vec4 coord = bigCoord(uv, scale);"," vec4 point = floor(coord);"," vec4 frac = fract(coord);"," float dist = 16.0;"," for (float l = -1.0; l <= 1.0; l++)"," for (float k = -1.0; k <= 1.0; k++)"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec4 cellNeighbor = vec4(i, j, k, l);"," vec4 jitter = hash4D(mod(point + cellNeighbor, uWrap * scale));"," vec4 diff = cellNeighbor - frac + jitter;"," float d = dot(diff, diff); // Squared length of diff."," if (d < dist)"," {"," dist = d;"," }"," }"," return sqrt(dist);","}","float worley4DIndex (vec4 uv, float scale)","{"," vec4 coord = bigCoord(uv, scale);"," vec4 point = floor(coord);"," vec4 frac = fract(coord);"," float dist = 16.0;"," float random = 0.0;"," for (float l = -1.0; l <= 1.0; l++)"," for (float k = -1.0; k <= 1.0; k++)"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec4 cellNeighbor = vec4(i, j, k, l);"," vec4 jitter = hash4D(mod(point + cellNeighbor, uWrap * scale));"," vec4 diff = cellNeighbor - frac + jitter;"," float d = dot(diff, diff); // Squared length of diff."," if (d < dist)"," {"," dist = d;"," random = jitter.x;"," }"," }"," return random;","}","float worley4DSmooth (vec4 uv, float scale)","{"," vec4 coord = bigCoord(uv, scale);"," vec4 point = floor(coord);"," vec4 frac = fract(coord);"," float value = 0.0;"," for (float l = -1.0; l <= 1.0; l++)"," for (float k = -1.0; k <= 1.0; k++)"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec4 cellNeighbor = vec4(i, j, k, l);"," vec4 jitter = hash4D(mod(point + cellNeighbor, uWrap * scale));"," vec4 diff = cellNeighbor - frac + jitter;"," float d = length(diff);"," value += exp2(-32.0 / uSmoothing * d); // Accumulate fast-decaying exponential of length."," }"," return -(1.0 / 32.0 * uSmoothing) * log2(value);","}","float iterateWorley4D (vec4 uv)","{"," float value = 0.0;"," float itValue = 0.0;"," for (float iteration = 0.0; iteration < ITERATION_COUNT; iteration++)"," {"," float scale = exp2(iteration);"," #ifdef MODE_DISTANCE"," itValue = worley4D(uv + iteration, scale);"," #endif"," #ifdef MODE_INDEX"," itValue = worley4DIndex(uv + iteration, scale);"," #endif"," #ifdef MODE_DISTANCE_SMOOTH"," itValue = worley4DSmooth(uv + iteration, scale);"," #endif"," value += (itValue - 0.5) / scale;"," }"," return value + 0.5;","}","void main ()","{"," vec4 uv = vec4(outTexCoord, 0.0, 0.0);"," float value = iterateWorley4D(uv);"," #ifndef NORMAL_MAP"," vec4 color = mix(uColorStart, uColorEnd, value);"," color.rgb *= color.a;"," gl_FragColor = color;"," #else"," float dx = dFdx(value) * uNormalScale;"," float dy = dFdy(value) * uNormalScale;"," vec3 normal = vec3(dx, dy, 1.0 - sqrt(dx * dx + dy * dy)) * 0.5 + 0.5;"," gl_FragColor = vec4(normal, 1.0);"," #endif","}"].join("\n")},62807(t){t.exports=["float inverseRotation = -rotation - uCamera.z;","float irSine = sin(inverseRotation);","float irCosine = cos(inverseRotation);","outInverseRotationMatrix = mat3("," irCosine, irSine, 0.0,"," -irSine, irCosine, 0.0,"," 0.0, 0.0, 1.0",");"].join("\n")},4127(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","precision mediump float;","#pragma phaserTemplate(fragmentDefine)","uniform vec2 uResolution;","uniform float uCameraZoom;","varying vec4 lightPosition;","varying vec4 lightColor;","varying float lightRadius;","varying float lightAttenuation;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec2 center = (lightPosition.xy + 1.0) * (uResolution.xy * 0.5);"," float distToSurf = length(center - gl_FragCoord.xy);"," float radius = 1.0 - distToSurf / (lightRadius * uCameraZoom);"," float intensity = smoothstep(0.0, 1.0, radius * lightAttenuation);"," vec4 color = vec4(intensity, intensity, intensity, 0.0) * lightColor;"," #pragma phaserTemplate(fragmentProcess)"," gl_FragColor = vec4(color.rgb * lightColor.a, color.a);","}"].join("\n")},89924(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","precision mediump float;","#pragma phaserTemplate(vertexDefine)","uniform mat4 uProjectionMatrix;","attribute vec2 inPosition;","attribute vec2 inLightPosition;","attribute vec4 inLightColor;","attribute float inLightRadius;","attribute float inLightAttenuation;","varying vec4 lightPosition;","varying vec4 lightColor;","varying float lightRadius;","varying float lightAttenuation;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(vertexHeader)","void main ()","{"," lightColor = inLightColor;"," lightRadius = inLightRadius;"," lightAttenuation = inLightAttenuation;"," lightPosition = uProjectionMatrix * vec4(inLightPosition, 1.0, 1.0);"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);"," #pragma phaserTemplate(vertexProcess)","}"].join("\n")},68589(t){t.exports=["#extension GL_OES_standard_derivatives : enable","#define BAND_TREE_DEPTH 0.0","uniform sampler2D uRampTexture;","uniform vec2 uRampResolution;","uniform float uRampBandStart;","uniform bool uDither;","float decodeNumberSample(vec4 sample)","{"," return ("," sample.r * 255.0 +"," sample.g * 255.0 * 256.0 +"," sample.b * 255.0 * 256.0 * 256.0 +"," sample.a * 255.0 * 256.0 * 256.0 * 256.0"," ) / 256.0 / 256.0;","}","struct Band","{"," vec4 colorStart;"," vec4 colorEnd;"," float start;"," float end;"," int colorSpace;"," int interpolation;"," float middle;","};","Band getBand(float progress)","{"," vec2 rampStep = 1.0 / uRampResolution;"," vec2 c = rampStep / 2.0;"," float start = decodeNumberSample(texture2D(uRampTexture, c));"," float end = decodeNumberSample(texture2D(uRampTexture, vec2(1.0, 0.0) * rampStep + c));"," float TREE_OFFSET = 2.0; // Beginning of tree block."," float index = 0.0;"," float x, y;"," for (float i = 0.0; i < BAND_TREE_DEPTH; i++)"," {"," x = mod(index + TREE_OFFSET, uRampResolution.x);"," y = floor(x / uRampResolution.x);"," float pivot = decodeNumberSample(texture2D(uRampTexture, vec2(x, y) * rampStep + c));"," if (progress > pivot)"," {"," start = pivot;"," index = index * 2.0 + 2.0;"," }"," else"," {"," end = pivot;"," index = index * 2.0 + 1.0;"," }"," }"," float bandNumber = index - uRampBandStart + TREE_OFFSET;"," float bandIndex = bandNumber * 3.0 + uRampBandStart;"," x = mod(bandIndex, uRampResolution.x);"," y = floor(bandIndex / uRampResolution.x);"," vec4 colorStart = texture2D(uRampTexture, vec2(x, y) * rampStep + c);"," x = mod(bandIndex + 1.0, uRampResolution.x);"," y = floor(bandIndex / uRampResolution.x);"," vec4 colorEnd = texture2D(uRampTexture, vec2(x, y) * rampStep + c);"," x = mod(bandIndex + 2.0, uRampResolution.x);"," y = floor(bandIndex / uRampResolution.x);"," float bandData = decodeNumberSample(texture2D(uRampTexture, vec2(x, y) * rampStep + c));"," int colorSpace = int(floor(bandData / 255.0));"," int interpolation = int(floor(bandData)) - colorSpace * 255;"," return Band(colorStart, colorEnd, start, end, colorSpace, interpolation, fract(bandData) * 2.0);","}","float interpolate(float progress, int mode)","{"," if (mode == 1)"," {"," if ((progress *= 2.0) < 1.0)"," {"," return 0.5 * sqrt(1.0 - (--progress * progress));"," }"," progress = 1.0 - progress;"," return 1.0 - 0.5 * sqrt(1.0 - progress * progress);"," }"," if (mode == 2)"," {"," return sin((progress - 0.5) * 3.14159265358979323846) * 0.5 + 0.5;"," }"," if (mode == 3)"," {"," return sqrt(1.0 - (--progress * progress));"," }"," if (mode == 4)"," {"," return 1.0 - sqrt(1.0 - progress * progress);"," }"," return progress;","}","float ditherIGN(float value)","{"," float dx = dFdx(value);"," float dy = dFdy(value);"," float rateOfChange = sqrt(dx * dx + dy * dy);"," value += (fract(52.9829189 * fract(0.06711056 * gl_FragCoord.x + 0.00583715 * gl_FragCoord.y)) - 0.5) * rateOfChange;"," return value;","}","vec4 rgbaToHsva(vec4 rgba)","{"," float r = rgba.r;"," float g = rgba.g;"," float b = rgba.b;"," float a = rgba.a;"," float min = min(min(r, g), b);"," float max = max(max(r, g), b);"," float d = max - min;"," float h = 0.0;"," float s = (max == 0.0) ? 0.0 : d / max;"," float v = max;"," if (max != min)"," {"," if (max == r)"," {"," h = (g - b) / d + ((g < b) ? 6.0 : 0.0);"," }"," else if (max == g)"," {"," h = (b - r) / d + 2.0;"," }"," else"," {"," h = (r - g) / d + 4.0;"," }"," h /= 6.0;"," }"," return vec4(h, s, v, a);","}","float hsvaToRgbaConvert(float n, vec4 hsva)","{"," float k = mod(n + hsva.x * 6.0, 6.0);"," float min = min(min(k, 4.0 - k), 1.0);"," return hsva.z - hsva.z * hsva.y * max(0.0, min);","}","vec4 hsvaToRgba(vec4 hsva)","{"," return vec4("," hsvaToRgbaConvert(5.0, hsva),"," hsvaToRgbaConvert(3.0, hsva),"," hsvaToRgbaConvert(1.0, hsva),"," hsva.a"," );","}","vec4 mixBandColor(float progress, Band band)","{"," if (band.colorSpace == 0)"," {"," return mix(band.colorStart, band.colorEnd, progress);"," }"," vec4 hsvaStart = rgbaToHsva(band.colorStart);"," vec4 hsvaEnd = rgbaToHsva(band.colorEnd);"," if (band.colorSpace == 1)"," {"," float dH = hsvaStart.x - hsvaEnd.x;"," if (dH > 0.5)"," {"," hsvaStart.x -= 1.0;"," }"," else if (dH < -0.5)"," {"," hsvaStart.x += 1.0;"," }"," }"," else if (band.colorSpace == 2)"," {"," if (hsvaStart.x > hsvaEnd.x)"," {"," hsvaStart.x -= 1.0;"," }"," }"," else if (band.colorSpace == 3)"," {"," if (hsvaStart.x < hsvaEnd.x)"," {"," hsvaStart.x += 1.0;"," }"," }"," vec4 hsvaMix = mix(hsvaStart, hsvaEnd, progress);"," hsvaMix.x = mod(hsvaMix.x, 1.0);"," return hsvaToRgba(hsvaMix);","}","vec4 getRampAt(float progress)","{"," Band band = getBand(progress);"," float bandProgress = (progress - band.start) / (band.end - band.start);"," float gamma = log(0.5) / log(band.middle);"," bandProgress = pow(bandProgress, gamma);"," bandProgress = interpolate(bandProgress, band.interpolation);"," if (uDither)"," {"," bandProgress = ditherIGN(bandProgress);"," }"," return mixBandColor(bandProgress, band);","}"].join("\n")},72823(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(fragmentDefine)","varying vec2 outTexCoord;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec4 fragColor = vec4(outTexCoord.xyx, 1.0);"," #pragma phaserTemplate(fragmentProcess)"," gl_FragColor = fragColor;","}"].join("\n")},65884(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(vertexDefine)","uniform mat4 uProjectionMatrix;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","varying vec2 outTexCoord;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(vertexHeader)","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);"," outTexCoord = inTexCoord;"," #pragma phaserTemplate(vertexProcess)","}"].join("\n")},2807(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","varying vec2 outFragCoord;","varying vec2 outTexCoord;","void main ()","{"," outFragCoord = inPosition.xy * 0.5 + 0.5;"," outTexCoord = inTexCoord;"," gl_Position = vec4(inPosition, 0, 1);","}"].join("\n")},49119(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(fragmentDefine)","uniform vec2 uResolution;","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," #pragma phaserTemplate(fragmentProcess)"," gl_FragColor = fragColor;","}"].join("\n")},3524(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#define ROUND_BIAS 0.5001","#pragma phaserTemplate(vertexDefine)","uniform mat4 uProjectionMatrix;","uniform mat3 uViewMatrix;","uniform vec3 uCameraScrollAndAlpha;","uniform int uRoundPixels;","uniform vec2 uResolution;","uniform float uTime;","uniform vec2 uDiffuseResolution;","uniform vec2 uFrameDataResolution;","uniform sampler2D uFrameDataTexture;","uniform float uGravity;","attribute float inVertex;","attribute vec4 inPositionX;","attribute vec4 inPositionY;","attribute vec4 inRotation;","attribute vec4 inScaleX;","attribute vec4 inScaleY;","attribute vec4 inAlpha;","attribute vec4 inFrame;","attribute vec4 inTintBlend;","attribute vec4 inTintTL;","attribute vec4 inTintTR;","attribute vec4 inTintBL;","attribute vec4 inTintBR;","attribute vec4 inOriginAndTintModeAndCreationTime;","attribute vec2 inScrollFactor;","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(vertexHeader)","const float PI = 3.14159265359;","const float HALF_PI = PI / 2.0;","const float BOUNCE_OVERSHOOT = 1.70158;","const float BOUNCE_OVERSHOOT_PLUS = BOUNCE_OVERSHOOT + 1.0;","const float BOUNCE_OVERSHOOT_IN_OUT = BOUNCE_OVERSHOOT * 1.525;","const float BOUNCE_OVERSHOOT_IN_OUT_PLUS = BOUNCE_OVERSHOOT_IN_OUT + 1.0;","float animate (vec4 anim)","{"," float value = anim.x;"," float a = anim.y;"," float b = abs(anim.z);"," float c = abs(anim.w);"," bool yoyo = anim.z < 0.0;"," bool loop = anim.w > 0.0;"," int type = int(floor(c));"," if (type == 0|| b == 0.0)"," {"," return value;"," }"," float duration = b;"," float delay = mod(c, 1.0) * 2.0;"," float rawTime = ((uTime - inOriginAndTintModeAndCreationTime.w) / duration) - delay;"," float time = mod(rawTime, 1.0);"," if (yoyo && (mod(rawTime, 2.0) >= 1.0))"," {"," time = 1.0 - time;"," }"," float repeats = loop ? 0.0 : floor(a);"," float timeContinuous = loop ? time : rawTime;"," #ifdef FEATURE_LINEAR"," if (type == 1)"," {"," return value + a * timeContinuous;"," }"," #endif"," #ifdef FEATURE_GRAVITY"," if (type == 2)"," {"," float v = floor(a);"," float gravityFactor = (a - v) * 2.0 - 1.0;"," if (gravityFactor == 0.0)"," {"," gravityFactor = 1.0;"," }"," float seconds = timeContinuous * duration / 1000.0;"," float accel = uGravity * gravityFactor;"," return value + (v * seconds) + (0.5 * accel * seconds * seconds);"," }"," #endif"," #ifdef FEATURE_QUAD_EASEOUT"," if (type == 10)"," {"," return value + a * time * (2.0 - time)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUAD_EASEIN"," if (type == 11)"," {"," return value + a * time * time"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUAD_EASEINOUT"," if (type == 12)"," {"," time *= 2.0;"," if (time < 1.0)"," {"," return value + a * time * time * 0.5"," + repeats * a;"," }"," time -= 1.0;"," return value + a * -0.5 * (time * (time - 2.0) - 1.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_CUBIC_EASEOUT"," if (type == 20)"," {"," time -= 1.0;"," return value + a * (time * time * time + 1.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_CUBIC_EASEIN"," if (type == 21)"," {"," return value + a * time * time * time"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_CUBIC_EASEINOUT"," if (type == 22)"," {"," time *= 2.0;"," if (time < 1.0)"," {"," return value + a * time * time * time * 0.5"," + repeats * a;"," }"," time -= 2.0;"," return value + a * 0.5 * (time * time * time + 2.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUART_EASEOUT"," if (type == 30)"," {"," time -= 1.0;"," return value + a * (1.0 - time * time * time * time)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUART_EASEIN"," if (type == 31)"," {"," return value + a * time * time * time * time"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUART_EASEINOUT"," if (type == 32)"," {"," time *= 2.0;"," if (time < 1.0)"," {"," return value + a * time * time * time * time * 0.5"," + repeats * a;"," }"," time -= 2.0;"," return value + a * -0.5 * (time * time * time * time - 2.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUINT_EASEOUT"," if (type == 40)"," {"," time -= 1.0;"," return value + a * (time * time * time * time * time + 1.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUINT_EASEIN"," if (type == 41)"," {"," return value + a * time * time * time * time * time"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUINT_EASEINOUT"," if (type == 42)"," {"," time *= 2.0;"," if (time < 1.0)"," {"," return value + a * time * time * time * time * time * 0.5"," + repeats * a;"," }"," time -= 2.0;"," return value + a * 0.5 * (time * time * time * time * time + 2.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_SINE_EASEOUT"," if (type == 50)"," {"," return value + a * sin(time * HALF_PI)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_SINE_EASEIN"," if (type == 51)"," {"," return value + a * (1.0 - cos(time * HALF_PI))"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_SINE_EASEINOUT"," if (type == 52)"," {"," return value + a * 0.5 * (1.0 - cos(PI * time))"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_EXPO_EASEOUT"," if (type == 60)"," {"," return value + a * (1.0 - pow(2.0, -10.0 * time))"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_EXPO_EASEIN"," if (type == 61)"," {"," return value + a * pow(2.0, 10.0 * (time - 1.0) - 0.001)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_EXPO_EASEINOUT"," if (type == 62)"," {"," time *= 2.0;"," if (time < 1.0)"," {"," return value + a * 0.5 * pow(2.0, 10.0 * (time - 1.0))"," + repeats * a;"," }"," time -= 1.0;"," return value + a * 0.5 * (2.0 - pow(2.0, -10.0 * (time - 1.0)))"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_CIRC_EASEOUT"," if (type == 70)"," {"," time -= 1.0;"," return value + a * sqrt(1.0 - time * time)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_CIRC_EASEIN"," if (type == 71)"," {"," return value + a * (1.0 - sqrt(1.0 - time * time))"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_CIRC_EASEINOUT"," if (type == 72)"," {"," time *= 2.0;"," if (time < 1.0)"," {"," return value + a * -0.5 * (sqrt(1.0 - time * time) - 1.0)"," + repeats * a;"," }"," time -= 2.0;"," return value + a * 0.5 * (sqrt(1.0 - time * time) + 1.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_BACK_EASEOUT"," if (type == 90)"," {"," time -= 1.0;"," return value + a * (time * time * (BOUNCE_OVERSHOOT_PLUS * time + BOUNCE_OVERSHOOT) + 1.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_BACK_EASEIN"," if (type == 91)"," {"," return value + a * time * time * (BOUNCE_OVERSHOOT_PLUS * time - BOUNCE_OVERSHOOT)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_BACK_EASEINOUT"," if (type == 92)"," {"," time *= 2.0;"," if (time < 1.0)"," {"," return value + a * 0.5 * (time * time * (BOUNCE_OVERSHOOT_IN_OUT_PLUS * time - BOUNCE_OVERSHOOT_IN_OUT))"," + repeats * a;"," }"," time -= 2.0;"," return value + a * 0.5 * (time * time * (BOUNCE_OVERSHOOT_IN_OUT_PLUS * time + BOUNCE_OVERSHOOT_IN_OUT) + 2.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_BOUNCE_EASEOUT"," if (type == 100)"," {"," if (time < 1.0 / 2.75)"," {"," return value + a * (7.5625 * time * time)"," + repeats * a;"," }"," else if (time < 2.0 / 2.75)"," {"," time -= 1.5 / 2.75;"," return value + a * (7.5625 * time * time + 0.75)"," + repeats * a;"," }"," else if (time < 2.5 / 2.75)"," {"," time -= 2.25 / 2.75;"," return value + a * (7.5625 * time * time + 0.9375)"," + repeats * a;"," }"," else"," {"," time -= 2.625 / 2.75;"," return value + a * (7.5625 * time * time + 0.984375)"," + repeats * a;"," }"," }"," #endif"," #ifdef FEATURE_BOUNCE_EASEIN"," if (type == 101)"," {"," time = 1.0 - time;"," if (time < 1.0 / 2.75)"," {"," return value + a * (1.0 - 7.5625 * time * time)"," + repeats * a;"," }"," else if (time < 2.0 / 2.75)"," {"," time -= 1.5 / 2.75;"," return value + a * (1.0 - (7.5625 * time * time + 0.75))"," + repeats * a;"," }"," else if (time < 2.5 / 2.75)"," {"," time -= 2.25 / 2.75;"," return value + a * (1.0 - (7.5625 * time * time + 0.9375))"," + repeats * a;"," }"," else"," {"," time -= 2.625 / 2.75;"," return value + a * (1.0 - (7.5625 * time * time + 0.984375))"," + repeats * a;"," }"," }"," #endif"," #ifdef FEATURE_BOUNCE_EASEINOUT"," if (type == 102)"," {"," bool reverse = false;"," if (time < 0.5)"," {"," time = 1.0 - time * 2.0;"," reverse = true;"," }"," if (time < 1.0 / 2.75)"," {"," time = 7.5625 * time * time;"," }"," else if (time < 2.0 / 2.75)"," {"," time -= 1.5 / 2.75;"," time = 7.5625 * time * time + 0.75;"," }"," else if (time < 2.5 / 2.75)"," {"," time -= 2.25 / 2.75;"," time = 7.5625 * time * time + 0.9375;"," }"," else"," {"," time -= 2.625 / 2.75;"," time = 7.5625 * time * time + 0.984375;"," }"," if (reverse)"," {"," return value + a * (1.0 - time) * 0.5"," + repeats * a;"," }"," return value + a * time * 0.5 + 0.5"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_STEPPED"," if (type == 110)"," {"," return value + a * floor(time + 0.5)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_SMOOTHSTEP_EASEOUT"," if (type == 120)"," {"," return value + a * (smoothstep(0.0, 1.0, time / 2.0 + 0.5) * 2.0 - 1.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_SMOOTHSTEP_EASEIN"," if (type == 121)"," {"," return value + a * smoothstep(0.0, 1.0, time / 2.0) * 2.0"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_SMOOTHSTEP_EASEINOUT"," if (type == 122)"," {"," return value + a * smoothstep(0.0, 1.0, time)"," + repeats * a;"," }"," #endif"," return value;","}","struct Frame {"," vec2 position;"," vec2 size;"," vec2 offset;","};","Frame getFrame (float frame)","{"," float index1 = floor(frame) * 3.0;"," float index2 = index1 + 1.0;"," float index3 = index1 + 2.0;"," float width = uFrameDataResolution.x;"," float x = mod(index1, width);"," float y = floor(index1 / width);"," vec4 texelUV = texture2D("," uFrameDataTexture,"," vec2(x + 0.5, y + 0.5) / uFrameDataResolution"," );"," x = mod(index2, width);"," y = floor(index2 / width);"," vec4 texelWH = texture2D("," uFrameDataTexture,"," vec2(x + 0.5, y + 0.5) / uFrameDataResolution"," );"," x = mod(index3, width);"," y = floor(index3 / width);"," vec4 texelOrigin = texture2D("," uFrameDataTexture,"," vec2(x + 0.5, y + 0.5) / uFrameDataResolution"," );"," return Frame("," vec2("," texelUV.r + texelUV.g * 256.0,"," texelUV.b + texelUV.a * 256.0"," ) * 255.0,"," vec2("," texelWH.r + texelWH.g * 256.0,"," texelWH.b + texelWH.a * 256.0"," ) * 255.0,"," vec2("," texelOrigin.r + texelOrigin.g * 256.0,"," texelOrigin.b + texelOrigin.a * 256.0"," ) * 255.0 - 32768.0"," );","}","void main ()","{"," float positionX = animate(inPositionX);"," float positionY = animate(inPositionY);"," float rotation = animate(inRotation);"," float scaleX = animate(inScaleX);"," float scaleY = animate(inScaleY);"," float frame = animate(inFrame);"," float tintBlend = animate(inTintBlend);"," float alpha = animate(inAlpha);"," vec2 origin = inOriginAndTintModeAndCreationTime.xy;"," float tintMode = inOriginAndTintModeAndCreationTime.z;"," float scrollFactorX = inScrollFactor.x;"," float scrollFactorY = inScrollFactor.y;"," Frame frameData = getFrame(frame);"," vec2 uv = frameData.position / uDiffuseResolution;"," vec2 wh = frameData.size / uDiffuseResolution;"," float u = uv.s;"," float v = uv.t;"," float w = wh.s;"," float h = wh.t;"," float width = frameData.size.s;"," float height = frameData.size.t;"," vec4 tint = inTintTL;"," float x = -origin.x;"," float y = -origin.y;"," if (inVertex == 0.0)"," {"," y = 1.0 - origin.y;"," v += h;"," tint = inTintBL;"," }"," else if (inVertex == 2.0)"," {"," x = 1.0 - origin.x;"," y = 1.0 - origin.y;"," u += w;"," v += h;"," tint = inTintBR;"," }"," else if (inVertex == 3.0)"," {"," x = 1.0 - origin.x;"," u += w;"," tint = inTintTR;"," }"," vec3 position = vec3("," (x * width - frameData.offset.x) * scaleX,"," (y * height - frameData.offset.y) * scaleY,"," 1.0"," );"," mat3 viewMatrix = uViewMatrix * mat3("," 1.0, 0.0, 0.0,"," 0.0, 1.0, 0.0,"," uCameraScrollAndAlpha.x * (1.0 - scrollFactorX), uCameraScrollAndAlpha.y * (1.0 - scrollFactorY), 1.0"," );"," float sine = sin(rotation);"," float cosine = cos(rotation);"," mat3 transformMatrix = mat3("," cosine, sine, 0.0,"," -sine, cosine, 0.0,"," positionX, positionY, 1.0"," );"," position = viewMatrix * transformMatrix * position;"," alpha *= uCameraScrollAndAlpha.z;"," tint.a *= alpha;"," if (uRoundPixels == 1 && rotation == 0.0 && scaleX == 1.0 && scaleY == 1.0)"," {"," position.xy = floor(position.xy + ROUND_BIAS);"," }"," gl_Position = uProjectionMatrix * vec4(position.xy, 1.0, 1.0);"," outTexCoord = vec2(u, 1.0 - v);"," outTint = mix(vec4(1.0, 1.0, 1.0, tint.a), tint, tintBlend);"," outTintEffect = tintMode;"," #pragma phaserTemplate(vertexProcess)","}"].join("\n")},57532(t){t.exports=["#version 100","#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","/* Redefine MAX_ANIM_FRAMES to support animations with different frame numbers. */","#define MAX_ANIM_FRAMES 0","#pragma phaserTemplate(fragmentDefine)","uniform vec2 uResolution;","uniform sampler2D uMainSampler;","uniform sampler2D uLayerSampler;","uniform vec2 uMainResolution;","uniform vec2 uLayerResolution;","uniform float uTileColumns;","uniform vec4 uTileWidthHeightMarginSpacing;","uniform float uAlpha;","uniform float uTime;","#if MAX_ANIM_FRAMES > 0","uniform sampler2D uAnimSampler;","uniform vec2 uAnimResolution;","#endif","varying vec2 outTexCoord;","varying vec2 outTileStride;","#pragma phaserTemplate(outVariables)","vec2 getTexRes ()","{"," return uMainResolution;","}","float floatTexel (vec4 texel)","{"," return texel.r * 255.0 + (texel.g * 255.0 * 256.0) + (texel.b * 255.0 * 256.0 * 256.0) + (texel.a * 255.0 * 256.0 * 256.0 * 256.0);","}","struct Tile","{"," float index;"," vec2 uv; // In texels."," #if MAX_ANIM_FRAMES > 0"," bool animated;"," #endif"," bool empty;","};","Tile getLayerData (vec2 coord)","{"," vec2 texelCoord = coord * uLayerResolution;"," vec2 tile = floor(texelCoord);"," vec2 uv = fract(texelCoord);"," uv.y = 1.0 - uv.y;"," vec4 texel = texture2D(uLayerSampler, (tile + 0.5) / uLayerResolution) * 255.0;"," float flags = texel.a;"," /* Check for empty tile flag in bit 28. */"," if (flags == 16.0)"," {"," return Tile("," 0.0,"," vec2(0.0),"," #if MAX_ANIM_FRAMES > 0"," false,"," #endif"," true"," );"," }"," /* Bit 31 is flipX. */"," bool flipX = flags > 127.0;"," /* Bit 30 is flipY. */"," bool flipY = mod(flags, 128.0) > 63.0;"," #if MAX_ANIM_FRAMES > 0"," /* Bit 29 is animation. */"," bool animated = mod(flags, 64.0) > 31.0;"," #endif"," if (flipX)"," {"," uv.x = 1.0 - uv.x;"," }"," if (flipY)"," {"," uv.y = 1.0 - uv.y;"," }"," float index = texel.r + (texel.g * 256.0) + (texel.b * 256.0 * 256.0);"," return Tile("," index,"," uv * uTileWidthHeightMarginSpacing.xy,"," #if MAX_ANIM_FRAMES > 0"," animated,"," #endif"," false"," );","}","vec2 getFrameCorner (float index)","{"," float x = mod(index, uTileColumns);"," float y = floor(index / uTileColumns);"," vec2 xy = vec2(x, y);"," return xy * outTileStride + uTileWidthHeightMarginSpacing.zz;","}","#if MAX_ANIM_FRAMES > 0","float animationIndex (float index)","{"," float animTextureWidth = uAnimResolution.x;"," vec2 index2D = vec2(mod(index, animTextureWidth), floor(index / animTextureWidth));"," vec4 animDurationTexel = texture2D(uAnimSampler, (index2D + 0.5) / uAnimResolution);"," index2D = vec2(mod(index + 1.0, animTextureWidth), floor((index + 1.0) / animTextureWidth));"," vec4 animIndexTexel = texture2D(uAnimSampler, (index2D + 0.5) / uAnimResolution);"," float animDuration = floatTexel(animDurationTexel);"," float animIndex = floatTexel(animIndexTexel);"," float animTime = mod(uTime, animDuration);"," float animTimeAccum = 0.0;"," for (int i = 0; i < MAX_ANIM_FRAMES; i++)"," {"," index2D = vec2(mod(animIndex, animTextureWidth), floor(animIndex / animTextureWidth));"," animDurationTexel = texture2D(uAnimSampler, (index2D + 0.5) / uAnimResolution);"," float frameDuration = floatTexel(animDurationTexel);"," animTimeAccum += frameDuration;"," if (animTime <= animTimeAccum)"," {"," break;"," }"," animIndex += 2.0;"," }"," animIndex += 1.0;"," index2D = vec2(mod(animIndex, animTextureWidth), floor(animIndex / animTextureWidth));"," animIndexTexel = texture2D(uAnimSampler, (index2D + 0.5) / uAnimResolution);"," float animFrameIndex = floatTexel(animIndexTexel);"," return animFrameIndex;","}","#endif","vec2 getTileTexelCoord (Tile tile)","{"," if (tile.empty)"," {"," return vec2(0.0);"," }"," float index = tile.index;"," #if MAX_ANIM_FRAMES > 0"," if (tile.animated)"," {"," index = animationIndex(index);"," }"," #endif"," vec2 frameCorner = getFrameCorner(index);"," return frameCorner + tile.uv;","}","#pragma phaserTemplate(fragmentHeader)","struct Samples {"," vec4 color;"," #pragma phaserTemplate(defineSamples)","};","Samples getColorSamples (vec2 texCoord)","{"," Samples samples;"," samples.color = texture2D("," uMainSampler,"," vec2(texCoord.x, 1.0 - texCoord.y)"," );"," #pragma phaserTemplate(getSamples)"," return samples;","}","Samples mixSamples (Samples samples1, Samples samples2, float alpha)","{"," Samples samples;"," samples.color = mix(samples1.color, samples2.color, alpha);"," #pragma phaserTemplate(mixSamples)"," return samples;","}","Samples getFinalSamples (Tile tile, vec2 layerTexCoord)","{"," vec2 texelCoord = getTileTexelCoord(tile);"," vec2 texCoord = texelCoord / uMainResolution;"," #pragma phaserTemplate(texCoord)"," #ifndef FEATURE_BORDERFILTER"," return getColorSamples(texCoord);"," #else"," #pragma phaserTemplate(finalSamples)"," vec2 wh = uTileWidthHeightMarginSpacing.xy;"," vec2 frameCorner = getFrameCorner(tile.index);"," vec2 frameCornerOpposite = frameCorner + wh;"," vec2 texCoordClamped = clamp(texCoord, (frameCorner + 0.5) / uMainResolution, (frameCornerOpposite - 0.5) / uMainResolution);"," vec2 dTexelCoord = (texCoord - texCoordClamped) * uMainResolution;"," dTexelCoord.y = -dTexelCoord.y;"," vec2 offsets = sign(dTexelCoord);"," Samples samples0 = getColorSamples(texCoordClamped);"," if (offsets.x == 0.0)"," {"," if (offsets.y == 0.0)"," {"," return samples0;"," }"," Tile tileY = getLayerData(layerTexCoord + (offsets - dTexelCoord) / wh / uLayerResolution);"," vec2 texelCoordY = getTileTexelCoord(tileY);"," vec2 texCoordY = texelCoordY / uMainResolution;"," Samples samplesY = getColorSamples(texCoordY);"," return mixSamples(samples0, samplesY, abs(dTexelCoord.y));"," }"," else"," {"," if (offsets.y == 0.0)"," {"," Tile tileX = getLayerData(layerTexCoord + (offsets - dTexelCoord) / wh / uLayerResolution);"," vec2 texelCoordX = getTileTexelCoord(tileX);"," vec2 texCoordX = texelCoordX / uMainResolution;"," Samples samplesX = getColorSamples(texCoordX);"," return mixSamples(samples0, samplesX, abs(dTexelCoord.x));"," }"," Tile tileX = getLayerData(layerTexCoord + (offsets * vec2(1.0, 0.0) - dTexelCoord) / wh / uLayerResolution);"," vec2 texelCoordX = getTileTexelCoord(tileX);"," vec2 texCoordX = texelCoordX / uMainResolution;"," Samples samplesX = getColorSamples(texCoordX);"," Tile tileY = getLayerData(layerTexCoord + (offsets * vec2(0.0, 1.0) - dTexelCoord) / wh / uLayerResolution);"," vec2 texelCoordY = getTileTexelCoord(tileY);"," vec2 texCoordY = texelCoordY / uMainResolution;"," Samples samplesY = getColorSamples(texCoordY);"," Tile tileXY = getLayerData(layerTexCoord + (offsets - dTexelCoord) / wh / uLayerResolution);"," vec2 texelCoordXY = getTileTexelCoord(tileXY);"," vec2 texCoordXY = texelCoordXY / uMainResolution;"," Samples samplesXY = getColorSamples(texCoordXY);"," Samples samples1 = mixSamples(samples0, samplesX, abs(dTexelCoord.x));"," Samples samples2 = mixSamples(samplesY, samplesXY, abs(dTexelCoord.x));"," return mixSamples(samples1, samples2, abs(dTexelCoord.y));"," }"," #endif","}","void main ()","{"," vec2 layerTexCoord = outTexCoord;"," Tile tile = getLayerData(layerTexCoord);"," Samples samples = getFinalSamples(tile, layerTexCoord);"," vec4 fragColor = samples.color;"," #pragma phaserTemplate(declareSamples)"," #pragma phaserTemplate(fragmentProcess)"," fragColor *= uAlpha;"," gl_FragColor = fragColor;","}"].join("\n")},23879(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(vertexDefine)","uniform mat4 uProjectionMatrix;","uniform vec2 uResolution;","uniform vec4 uTileWidthHeightMarginSpacing;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","varying vec2 outTexCoord;","varying vec2 outTileStride;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(vertexHeader)","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);"," outTexCoord = inTexCoord;"," outTileStride = uTileWidthHeightMarginSpacing.xy + uTileWidthHeightMarginSpacing.zz;"," #pragma phaserTemplate(vertexProcess)","}"].join("\n")},84639(t){t.exports=function(t,e){return{name:t+"Anims",additions:{fragmentDefine:"#undef MAX_ANIM_FRAMES\n#define MAX_ANIM_FRAMES "+t},tags:["MAXANIMS"],disable:!!e}}},81084(t,e,i){var s=i(84547);t.exports=function(t){return{name:"ApplyLighting",additions:{fragmentHeader:s,fragmentProcess:"fragColor = applyLighting(fragColor, normal);"},tags:["LIGHTING"],disable:!!t}}},44349(t,e,i){var s=i(11104);t.exports=function(t){return{name:"Tint",additions:{fragmentHeader:s,fragmentProcess:"fragColor = applyTint(fragColor);"},tags:["TINT"],disable:!!t}}},99501(t,e,i){var s=i(81556);t.exports=function(t){return{name:"BoundedSampler",additions:{fragmentHeader:s},disable:!!t}}},6184(t,e,i){var s=i(11719);t.exports=function(t){return{name:"DefineLights",additions:{fragmentDefine:"#define LIGHT_COUNT 1",fragmentHeader:s},tags:["LIGHTING"],disable:!!t}}},11653(t){t.exports=function(t,e){return{name:t+"TexCount",additions:{fragmentDefine:"#define TEXTURE_COUNT "+t},tags:["TexCount"],disable:!!e}}},13198(t){t.exports=function(t){return{name:"FlatNormal",additions:{fragmentProcess:"vec3 normal = vec3(0.0, 0.0, 1.0);"},tags:["LIGHTING"],disable:!!t}}},40829(t,e,i){var s=i(84220);t.exports=function(t){return{name:"NormalMap",additions:{fragmentHeader:s,fragmentProcess:"vec3 normal = getNormalFromMap(texCoord);"},tags:["LIGHTING"],disable:!!t}}},42792(t){t.exports=function(t){return{name:"TexCoordOut",additions:{fragmentProcess:"vec2 texCoord = outTexCoord;\n#pragma phaserTemplate(texCoord)"},tags:["TEXCOORD"],disable:!!t}}},96049(t,e,i){var s=i(2860);t.exports=function(t){return{name:"GetTexRes",additions:{fragmentHeader:s},tags:["TEXRES"],disable:!!t}}},33997(t,e,i){var s=i(46432);t.exports=function(t,e){void 0===t&&(t=1);for(var i="",r=1;r1&&(d=u.baseType===i.FLOAT?new Float32Array(c):new Int32Array(c)),this.glUniforms.set(l.name,{location:i.getUniformLocation(t,l.name),size:l.size,type:l.type,value:d})}},setUniform:function(t,e){this.uniformRequests.set(t,e)},bind:function(){this.renderer.glWrapper.updateBindingsProgram(this.glState),this.uniformRequests.each(this._processUniformRequest.bind(this)),this.uniformRequests.clear()},_processUniformRequest:function(t,e){var i=this.renderer,s=i.gl,n=this.glUniforms.get(t);if(n){var a=n.value;if(a.length){for(var o=!1,h=0;h1)c.setV.call(s,l,a);else switch(c.size){case 1:c.set.call(s,l,e);break;case 2:c.set.call(s,l,e[0],e[1]);break;case 3:c.set.call(s,l,e[0],e[1],e[2]);break;case 4:c.set.call(s,l,e[0],e[1],e[2],e[3])}}},destroy:function(){if(this.webGLProgram){var t=this.renderer.gl;if(!t.isContextLost()){this._vertexShader&&t.deleteShader(this._vertexShader),this._fragmentShader&&t.deleteShader(this._fragmentShader),t.deleteProgram(this.webGLProgram);for(var e=0;e=0;i--)this.units[i]=void 0,this.renderer.glWrapper.updateBindingsActiveTexture({bindings:{activeTexture:i}}),t.bindTexture(t.TEXTURE_2D,e),this.unitIndices[i]=i;t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array([0,0,255,255]))},bind:function(t,e,i,s){var r=this.units[e]!==t;if((i||!1!==s||r)&&this.renderer.glWrapper.updateBindingsActiveTexture({bindings:{activeTexture:e}},i),r||i){this.units[e]=t;var n=t?t.webGLTexture:null,a=this.renderer.gl;a.bindTexture(a.TEXTURE_2D,n),t&&t.needsMipmapRegeneration&&t.generateMipmap()}},bindUnits:function(t,e){for(var i=Math.min(t.length,this.renderer.maxTextures)-1;i>=0;i--)void 0!==t[i]&&this.bind(t[i],i,e,!1)},unbindTexture:function(t){for(var e=this.units.length-1;e>=0;e--)this.units[e]===t&&this.bind(null,e,!0,!1)},unbindAllUnits:function(){for(var t=this.units.length-1;t>=0;t--)this.bind(null,t,!0,!1)}});t.exports=s},82751(t,e,i){var s=i(83419),r=i(50030),n=new s({initialize:function(t,e,i,s,r,n,a,o,h,l,u,d,c){void 0===c&&(c=!0),this.renderer=t,this.webGLTexture=null,this.isRenderTexture=!1,this.mipLevel=e,this.minFilter=i,this.magFilter=s,this.wrapT=r,this.wrapS=n,this.format=a,this.pixels=o,this.width=h,this.height=l,this.pma=null==u||u,this.forceSize=!!d,this.flipY=!!c,this.__SPECTOR_Metadata={},this.batchUnit=-1,this.needsMipmapRegeneration=!1,this.createResource()},createResource:function(){var t=this.renderer.gl;if(!t.isContextLost())if(this.pixels instanceof n)this.webGLTexture=this.pixels.webGLTexture;else{var e=t.createTexture();e.__SPECTOR_Metadata=this.__SPECTOR_Metadata,this.webGLTexture=e,this._processTexture()}},resize:function(t,e){if(this.width!==t||this.height!==e){this.width=t,this.height=e;var i=this.renderer,s=i.gl,n=r(t,e);n?(this.wrapS=s.REPEAT,this.wrapT=s.REPEAT):(this.wrapS=s.CLAMP_TO_EDGE,this.wrapT=s.CLAMP_TO_EDGE),n&&i.mipmapFilter&&(!this.isRenderTexture||i.config.mipmapRegeneration)?this.minFilter=i.mipmapFilter:i.config.antialias?this.minFilter=s.LINEAR:this.minFilter=s.NEAREST,this._processTexture()}},update:function(t,e,i,s,r,n,a,o,h){0!==e&&0!==i&&(this.pixels=t,this.width=e,this.height=i,this.flipY=s,this.wrapS=r,this.wrapT=n,this.minFilter=a,this.magFilter=o,this.format=h,this._processTexture())},_processTexture:function(){var t=this.renderer.gl;this.renderer.glTextureUnits.bind(this,0),this.renderer.glWrapper.updateTexturing({texturing:{flipY:this.flipY,premultiplyAlpha:this.pma}}),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,this.minFilter),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,this.magFilter),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,this.wrapS),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,this.wrapT);var e=this.pixels,i=this.mipLevel,s=this.width,r=this.height,n=this.format;if(null==e)t.texImage2D(t.TEXTURE_2D,i,n,s,r,0,n,t.UNSIGNED_BYTE,null),this.generateMipmap();else if(e.compressed){s=e.width,r=e.height;for(var a=0;a0&&this.parentSize.height>0&&this.displaySize.setParent(this.parentSize),this.refresh()),t.events.on(h.PRE_STEP,this.step,this),t.events.once(h.READY,this.refresh,this),t.events.once(h.DESTROY,this.destroy,this),this.startListeners()},parseConfig:function(t){this.getParent(t),this.getParentBounds();var e=t.width,i=t.height,r=t.scaleMode,n=t.zoom,a=t.autoRound;if("string"==typeof e)if("%"!==e.substr(-1))e=parseInt(e,10);else{var o=this.parentSize.width;0===o&&(o=window.innerWidth);var h=parseInt(e,10)/100;e=Math.floor(o*h)}if("string"==typeof i)if("%"!==i.substr(-1))i=parseInt(i,10);else{var l=this.parentSize.height;0===l&&(l=window.innerHeight);var u=parseInt(i,10)/100;i=Math.floor(l*u)}this.scaleMode=r,this.autoRound=a,this.autoCenter=t.autoCenter,this.resizeInterval=t.resizeInterval,a&&(e=Math.floor(e),i=Math.floor(i)),this.gameSize.setSize(e,i),n===s.ZOOM.MAX_ZOOM&&(n=this.getMaxZoom()),this.zoom=n,1!==n&&(this._resetZoom=!0),this.baseSize.setSize(e,i),a&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),t.minWidth>0&&this.displaySize.setMin(t.minWidth*n,t.minHeight*n),t.maxWidth>0&&this.displaySize.setMax(t.maxWidth*n,t.maxHeight*n),this.displaySize.setSize(e,i),(t.snapWidth>0||t.snapHeight>0)&&this.displaySize.setSnap(t.snapWidth,t.snapHeight),this.orientation=d(e,i)},getParent:function(t){var e=t.parent;if(null!==e){if(this.parent=u(e),this.parentIsWindow=this.parent===document.body,t.expandParent&&t.scaleMode!==s.SCALE_MODE.NONE){var i=this.parent.getBoundingClientRect();(this.parentIsWindow||0===i.height)&&(document.documentElement.style.height="100%",document.body.style.height="100%",i=this.parent.getBoundingClientRect(),this.parentIsWindow||0!==i.height||(this.parent.style.overflow="hidden",this.parent.style.width="100%",this.parent.style.height="100%"))}t.fullscreenTarget&&!this.fullscreenTarget&&(this.fullscreenTarget=u(t.fullscreenTarget))}},getParentBounds:function(){if(!this.parent)return!1;var t=this.parentSize,e=this.parent.getBoundingClientRect();this.parentIsWindow&&this.game.device.os.iOS&&(e.height=l(!0));var i=e.width,s=e.height;if(t.width!==i||t.height!==s)return t.setSize(i,s),!0;if(this.canvas){var r=this.canvasBounds,n=this.canvas.getBoundingClientRect();if(n.x!==r.x||n.y!==r.y)return!0}return!1},lockOrientation:function(t){var e=screen.lockOrientation||screen.mozLockOrientation||screen.msLockOrientation;return!!e&&e.call(screen,t)},setParentSize:function(t,e){return this.parentSize.setSize(t,e),this.refresh()},setGameSize:function(t,e){var i=this.autoRound;i&&(t=Math.floor(t),e=Math.floor(e));var s=this.width,r=this.height;return this.gameSize.resize(t,e),this.baseSize.resize(t,e),i&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setAspectRatio(t/e),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height,this.refresh(s,r)},resize:function(t,e){var i=this.zoom,s=this.autoRound;s&&(t=Math.floor(t),e=Math.floor(e));var r=this.width,n=this.height;this.gameSize.resize(t,e),this.baseSize.resize(t,e),s&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setSize(t*i,e*i),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height;var a=this.canvas.style,o=t*i,h=e*i;return s&&(o=Math.floor(o),h=Math.floor(h)),o===t&&h===e||(a.width=o+"px",a.height=h+"px"),this.refresh(r,n)},setZoom:function(t){return this.zoom=t,this._resetZoom=!0,this.refresh()},setMaxZoom:function(){return this.zoom=this.getMaxZoom(),this._resetZoom=!0,this.refresh()},setSnap:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.displaySize.setSnap(t,e),this.refresh()},refresh:function(t,e){void 0===t&&(t=this.width),void 0===e&&(e=this.height),this.updateScale(),this.updateBounds(),this.updateOrientation(),this.displayScale.set(this.baseSize.width/this.canvasBounds.width,this.baseSize.height/this.canvasBounds.height);var i=this.game.domContainer;if(i){this.baseSize.setCSS(i);var s=this.canvas.style,r=i.style;r.transform="scale("+this.displaySize.width/this.baseSize.width+","+this.displaySize.height/this.baseSize.height+")",r.marginLeft=s.marginLeft,r.marginTop=s.marginTop}return this.emit(o.RESIZE,this.gameSize,this.baseSize,this.displaySize,t,e),this},updateOrientation:function(){if(this._checkOrientation){this._checkOrientation=!1;var t=d(this.width,this.height);t!==this.orientation&&(this.orientation=t,this.emit(o.ORIENTATION_CHANGE,t))}},updateScale:function(){var t,e,i=this.canvas.style,r=this.gameSize.width,a=this.gameSize.height,o=this.zoom,h=this.autoRound;if(this.scaleMode===s.SCALE_MODE.NONE)this.displaySize.setSize(r*o,a*o),t=this.displaySize.width,e=this.displaySize.height,h&&(t=Math.floor(t),e=Math.floor(e)),this._resetZoom&&(i.width=t+"px",i.height=e+"px",this._resetZoom=!1);else if(this.scaleMode===s.SCALE_MODE.RESIZE)this.displaySize.setSize(this.parentSize.width,this.parentSize.height),this.gameSize.setSize(this.displaySize.width,this.displaySize.height),this.baseSize.setSize(this.displaySize.width,this.displaySize.height),t=this.displaySize.width,e=this.displaySize.height,h&&(t=Math.floor(t),e=Math.floor(e)),this.canvas.width=t,this.canvas.height=e;else if(this.scaleMode===s.SCALE_MODE.EXPAND){var l,u,d=this.game.config.width,c=this.game.config.height,f=this.parentSize.width,p=this.parentSize.height,m=f/d,g=p/c;m=0?0:-a.x*o.x,l=a.y>=0?0:-a.y*o.y;return i=n.width>=a.width?r.width:r.width-(a.width-n.width)*o.x,s=n.height>=a.height?r.height:r.height-(a.height-n.height)*o.y,e.setTo(h,l,i,s),t&&(e.width/=t.zoomX,e.height/=t.zoomY,e.centerX=t.centerX+t.scrollX,e.centerY=t.centerY+t.scrollY),e},step:function(t,e){this.parent&&(this._lastCheck+=e,(this.dirty||this._lastCheck>this.resizeInterval)&&(this.getParentBounds()&&this.refresh(),this.dirty=!1,this._lastCheck=0))},stopListeners:function(){var t=this.domlisteners;screen.orientation&&screen.orientation.addEventListener?screen.orientation.removeEventListener("change",t.orientationChange,!1):window.removeEventListener("orientationchange",t.orientationChange,!1),window.removeEventListener("resize",t.windowResize,!1);["webkit","moz",""].forEach(function(e){document.removeEventListener(e+"fullscreenchange",t.fullScreenChange,!1),document.removeEventListener(e+"fullscreenerror",t.fullScreenError,!1)}),document.removeEventListener("MSFullscreenChange",t.fullScreenChange,!1),document.removeEventListener("MSFullscreenError",t.fullScreenError,!1)},destroy:function(){this.removeAllListeners(),this.stopListeners(),this.game=null,this.canvas=null,this.canvasBounds=null,this.parent=null,this.fullscreenTarget=null,this.parentSize.destroy(),this.gameSize.destroy(),this.baseSize.destroy(),this.displaySize.destroy()},isFullscreen:{get:function(){return this.fullscreen.active}},width:{get:function(){return this.gameSize.width}},height:{get:function(){return this.gameSize.height}},isPortrait:{get:function(){return this.orientation===s.ORIENTATION.PORTRAIT}},isLandscape:{get:function(){return this.orientation===s.ORIENTATION.LANDSCAPE}},isGamePortrait:{get:function(){return this.height>this.width}},isGameLandscape:{get:function(){return this.width>this.height}}});t.exports=x},64743(t){t.exports={NO_CENTER:0,CENTER_BOTH:1,CENTER_HORIZONTALLY:2,CENTER_VERTICALLY:3}},39218(t){t.exports={LANDSCAPE:"landscape-primary",LANDSCAPE_SECONDARY:"landscape-secondary",PORTRAIT:"portrait-primary",PORTRAIT_SECONDARY:"portrait-secondary"}},81050(t){t.exports={NONE:0,WIDTH_CONTROLS_HEIGHT:1,HEIGHT_CONTROLS_WIDTH:2,FIT:3,ENVELOP:4,RESIZE:5,EXPAND:6}},80805(t){t.exports={NO_ZOOM:1,ZOOM_2X:2,ZOOM_4X:4,MAX_ZOOM:-1}},13560(t,e,i){var s={CENTER:i(64743),ORIENTATION:i(39218),SCALE_MODE:i(81050),ZOOM:i(80805)};t.exports=s},56139(t){t.exports="enterfullscreen"},2336(t){t.exports="fullscreenfailed"},47412(t){t.exports="fullscreenunsupported"},51452(t){t.exports="leavefullscreen"},20666(t){t.exports="orientationchange"},47945(t){t.exports="resize"},97480(t,e,i){t.exports={ENTER_FULLSCREEN:i(56139),FULLSCREEN_FAILED:i(2336),FULLSCREEN_UNSUPPORTED:i(47412),LEAVE_FULLSCREEN:i(51452),ORIENTATION_CHANGE:i(20666),RESIZE:i(47945)}},93364(t,e,i){var s=i(79291),r=i(13560),n={Center:i(64743),Events:i(97480),Orientation:i(39218),ScaleManager:i(76531),ScaleModes:i(81050),Zoom:i(80805)};n=s(!1,n,r.CENTER),n=s(!1,n,r.ORIENTATION),n=s(!1,n,r.SCALE_MODE),n=s(!1,n,r.ZOOM),t.exports=n},27397(t,e,i){var s=i(95540),r=i(35355);t.exports=function(t){var e=t.game.config.defaultPhysicsSystem,i=s(t.settings,"physics",!1);if(e||i){var n=[];if(e&&n.push(r(e+"Physics")),i)for(var a in i)a=r(a.concat("Physics")),-1===n.indexOf(a)&&n.push(a);return n}}},52106(t,e,i){var s=i(95540);t.exports=function(t){var e=t.plugins.getDefaultScenePlugins(),i=s(t.settings,"plugins",!1);return Array.isArray(i)?i:e||[]}},87033(t){t.exports={game:"game",renderer:"renderer",anims:"anims",cache:"cache",plugins:"plugins",registry:"registry",scale:"scale",sound:"sound",textures:"textures",events:"events",cameras:"cameras",add:"add",make:"make",scenePlugin:"scene",displayList:"children",lights:"lights",data:"data",input:"input",load:"load",time:"time",tweens:"tweens",arcadePhysics:"physics",matterPhysics:"matter"}},97482(t,e,i){var s=i(83419),r=i(2368),n=new s({initialize:function(t){this.sys=new r(this,t),this.game,this.anims,this.cache,this.registry,this.sound,this.textures,this.events,this.cameras,this.add,this.make,this.scene,this.children,this.lights,this.data,this.input,this.load,this.time,this.tweens,this.physics,this.matter,this.scale,this.plugins,this.renderer},update:function(){}});t.exports=n},60903(t,e,i){var s=i(83419),r=i(89993),n=i(44594),a=i(8443),o=i(35154),h=i(54899),l=i(29747),u=i(97482),d=i(2368),c=new s({initialize:function(t,e){if(this.game=t,this.keys={},this.scenes=[],this._pending=[],this._start=[],this._queue=[],this._data={},this.isProcessing=!1,this.isBooted=!1,this.customViewports=0,this.systemScene,e){Array.isArray(e)||(e=[e]);for(var i=0;i-1&&(delete this.keys[s],this.scenes.splice(i,1),this._start.indexOf(s)>-1&&(i=this._start.indexOf(s),this._start.splice(i,1)),e.sys.destroy()),this},bootScene:function(t){var e,i=t.sys,s=i.settings;i.sceneUpdate=l,t.init&&(t.init.call(t,s.data),s.status=r.INIT,s.isTransition&&i.events.emit(n.TRANSITION_INIT,s.transitionFrom,s.transitionDuration)),i.load&&(e=i.load).reset(),e&&t.preload?(t.preload.call(t),s.status=r.LOADING,e.once(h.COMPLETE,this.loadComplete,this),e.start()):this.create(t)},loadComplete:function(t){this.create(t.scene)},payloadComplete:function(t){this.bootScene(t.scene)},update:function(t,e){this.processQueue(),this.isProcessing=!0;for(var i=this.scenes.length-1;i>=0;i--){var s=this.scenes[i].sys;s.settings.status>r.START&&s.settings.status<=r.RUNNING&&s.step(t,e),s.scenePlugin&&s.scenePlugin._target&&s.scenePlugin.step(t,e)}},render:function(t){for(var e=0;e=r.LOADING&&i.settings.status=r.START&&a<=r.CREATING)return this;if(a>=r.RUNNING&&a<=r.SLEEPING)n.shutdown(),n.sceneUpdate=l,n.start(e);else if(n.sceneUpdate=l,n.start(e),n.load&&(s=n.load),s&&n.settings.hasOwnProperty("pack")&&(s.reset(),s.addPack({payload:n.settings.pack})))return n.settings.status=r.LOADING,s.once(h.COMPLETE,this.payloadComplete,this),s.start(),this;return this.bootScene(i),this},stop:function(t,e){var i=this.getScene(t);if(i&&!i.sys.isTransitioning()&&i.sys.settings.status!==r.SHUTDOWN){var s=i.sys.load;s&&(s.off(h.COMPLETE,this.loadComplete,this),s.off(h.COMPLETE,this.payloadComplete,this)),i.sys.shutdown(e)}return this},switch:function(t,e,i){var s=this.getScene(t),r=this.getScene(e);return s&&r&&s!==r&&(this.sleep(t),this.isSleeping(e)?this.wake(e,i):this.start(e,i)),this},getAt:function(t){return this.scenes[t]},getIndex:function(t){var e=this.getScene(t);return this.scenes.indexOf(e)},bringToTop:function(t){if(this.isProcessing)return this.queueOp("bringToTop",t);var e=this.getIndex(t),i=this.scenes;if(-1!==e&&e0){var i=this.getScene(t);this.scenes.splice(e,1),this.scenes.unshift(i)}return this},moveDown:function(t){if(this.isProcessing)return this.queueOp("moveDown",t);var e=this.getIndex(t);if(e>0){var i=e-1,s=this.getScene(t),r=this.getAt(i);this.scenes[e]=r,this.scenes[i]=s}return this},moveUp:function(t){if(this.isProcessing)return this.queueOp("moveUp",t);var e=this.getIndex(t);if(ei),0,r)}return this},moveBelow:function(t,e){if(t===e)return this;if(this.isProcessing)return this.queueOp("moveBelow",t,e);var i=this.getIndex(t),s=this.getIndex(e);if(-1!==i&&-1!==s&&s>i){var r=this.getAt(s);this.scenes.splice(s,1),0===i?this.scenes.unshift(r):this.scenes.splice(i-(s=this._duration&&this.transitionComplete()},transitionComplete:function(){var t=this._target.sys,e=this._target.sys.settings;t.events.emit(n.TRANSITION_COMPLETE,this.scene),e.isTransition=!1,e.transitionFrom=null,this._duration=0,this._target=null,this._onUpdate=null,this._onUpdateScope=null,this._willRemove?this.manager.remove(this.key):this._willSleep?this.systems.sleep():this.manager.stop(this.key)},add:function(t,e,i,s){return this.manager.add(t,e,i,s)},launch:function(t,e){return t&&t!==this.key&&this.manager.queueOp("start",t,e),this},run:function(t,e){return t&&t!==this.key&&this.manager.queueOp("run",t,e),this},pause:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("pause",t,e),this},resume:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("resume",t,e),this},sleep:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("sleep",t,e),this},wake:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("wake",t,e),this},switch:function(t,e){return t!==this.key&&this.manager.queueOp("switch",this.key,t,e),this},stop:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("stop",t,e),this},setActive:function(t,e,i){void 0===e&&(e=this.key);var s=this.manager.getScene(e);return s&&s.sys.setActive(t,i),this},setVisible:function(t,e){void 0===e&&(e=this.key);var i=this.manager.getScene(e);return i&&i.sys.setVisible(t),this},isSleeping:function(t){return void 0===t&&(t=this.key),this.manager.isSleeping(t)},isActive:function(t){return void 0===t&&(t=this.key),this.manager.isActive(t)},isPaused:function(t){return void 0===t&&(t=this.key),this.manager.isPaused(t)},isVisible:function(t){return void 0===t&&(t=this.key),this.manager.isVisible(t)},swapPosition:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.swapPosition(t,e),this},moveAbove:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveAbove(t,e),this},moveBelow:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveBelow(t,e),this},remove:function(t){return void 0===t&&(t=this.key),this.manager.remove(t),this},moveUp:function(t){return void 0===t&&(t=this.key),this.manager.moveUp(t),this},moveDown:function(t){return void 0===t&&(t=this.key),this.manager.moveDown(t),this},bringToTop:function(t){return void 0===t&&(t=this.key),this.manager.bringToTop(t),this},sendToBack:function(t){return void 0===t&&(t=this.key),this.manager.sendToBack(t),this},get:function(t){return this.manager.getScene(t)},getStatus:function(t){var e=this.manager.getScene(t);if(e)return e.sys.getStatus()},getIndex:function(t){return void 0===t&&(t=this.key),this.manager.getIndex(t)},shutdown:function(){var t=this.systems.events;t.off(n.SHUTDOWN,this.shutdown,this),t.off(n.TRANSITION_OUT)},destroy:function(){this.shutdown(),this.scene.sys.events.off(n.START,this.start,this),this.scene=null,this.systems=null,this.settings=null,this.manager=null}});o.register("ScenePlugin",h,"scenePlugin"),t.exports=h},55681(t,e,i){var s=i(89993),r=i(35154),n=i(46975),a=i(87033),o={create:function(t){return"string"==typeof t?t={key:t}:void 0===t&&(t={}),{status:s.PENDING,key:r(t,"key",""),active:r(t,"active",!1),visible:r(t,"visible",!0),isBooted:!1,isTransition:!1,transitionFrom:null,transitionDuration:0,transitionAllowInput:!0,data:{},pack:r(t,"pack",!1),cameras:r(t,"cameras",null),map:r(t,"map",n(a,r(t,"mapAdd",{}))),physics:r(t,"physics",{}),loader:r(t,"loader",{}),plugins:r(t,"plugins",!1),input:r(t,"input",{})}}};t.exports=o},2368(t,e,i){var s=i(83419),r=i(89993),n=i(42363),a=i(44594),o=i(27397),h=i(52106),l=i(29747),u=i(55681),d=new s({initialize:function(t,e){this.scene=t,this.game,this.renderer,this.config=e,this.settings=u.create(e),this.canvas,this.context,this.anims,this.cache,this.plugins,this.registry,this.scale,this.sound,this.textures,this.add,this.cameras,this.displayList,this.events,this.make,this.scenePlugin,this.updateList,this.sceneUpdate=l},init:function(t){this.settings.status=r.INIT,this.sceneUpdate=l,this.game=t,this.renderer=t.renderer,this.canvas=t.canvas,this.context=t.context;var e=t.plugins;this.plugins=e,e.addToScene(this,n.Global,[n.CoreScene,h(this),o(this)]),this.events.emit(a.BOOT,this),this.settings.isBooted=!0},step:function(t,e){var i=this.events;i.emit(a.PRE_UPDATE,t,e),i.emit(a.UPDATE,t,e),this.sceneUpdate.call(this.scene,t,e),i.emit(a.POST_UPDATE,t,e)},render:function(t){var e=this.displayList;e.depthSort(),this.events.emit(a.PRE_RENDER,t),this.cameras.render(t,e),this.events.emit(a.RENDER,t)},queueDepthSort:function(){this.displayList.queueDepthSort()},depthSort:function(){this.displayList.depthSort()},pause:function(t){var e=this.settings,i=this.getStatus();return i!==r.CREATING&&i!==r.RUNNING?console.warn("Cannot pause non-running Scene",e.key):this.settings.active&&(e.status=r.PAUSED,e.active=!1,this.events.emit(a.PAUSE,this,t)),this},resume:function(t){var e=this.events,i=this.settings;return this.settings.active||(i.status=r.RUNNING,i.active=!0,e.emit(a.RESUME,this,t)),this},sleep:function(t){var e=this.settings,i=this.getStatus();return i!==r.CREATING&&i!==r.RUNNING?console.warn("Cannot sleep non-running Scene",e.key):(e.status=r.SLEEPING,e.active=!1,e.visible=!1,this.events.emit(a.SLEEP,this,t)),this},wake:function(t){var e=this.events,i=this.settings;return i.status=r.RUNNING,i.active=!0,i.visible=!0,e.emit(a.WAKE,this,t),i.isTransition&&e.emit(a.TRANSITION_WAKE,i.transitionFrom,i.transitionDuration),this},getData:function(){return this.settings.data},getStatus:function(){return this.settings.status},canInput:function(){var t=this.settings.status;return t>r.PENDING&&t<=r.RUNNING},isSleeping:function(){return this.settings.status===r.SLEEPING},isActive:function(){return this.settings.status===r.RUNNING},isPaused:function(){return this.settings.status===r.PAUSED},isTransitioning:function(){return this.settings.isTransition||null!==this.scenePlugin._target},isTransitionOut:function(){return null!==this.scenePlugin._target&&this.scenePlugin._duration>0},isTransitionIn:function(){return this.settings.isTransition},isVisible:function(){return this.settings.visible},setVisible:function(t){return this.settings.visible=t,this},setActive:function(t,e){return t?this.resume(e):this.pause(e)},start:function(t){var e=this.events,i=this.settings;t&&(i.data=t),i.status=r.START,i.active=!0,i.visible=!0,e.emit(a.START,this),e.emit(a.READY,this,t)},shutdown:function(t){var e=this.events,i=this.settings;e.off(a.TRANSITION_INIT),e.off(a.TRANSITION_START),e.off(a.TRANSITION_COMPLETE),e.off(a.TRANSITION_OUT),i.status=r.SHUTDOWN,i.active=!1,i.visible=!1,e.emit(a.SHUTDOWN,this,t)},destroy:function(){var t=this.events,e=this.settings;e.status=r.DESTROYED,e.active=!1,e.visible=!1,t.emit(a.DESTROY,this),t.removeAllListeners();for(var i=["scene","game","anims","cache","plugins","registry","sound","textures","add","cameras","displayList","events","make","scenePlugin","updateList"],s=0;s=0;i--){var s=this.sounds[i];s.key===t&&(s.destroy(),this.sounds.splice(i,1),e++)}return e},pauseAll:function(){this.forEachActiveSound(function(t){t.pause()}),this.emit(a.PAUSE_ALL,this)},resumeAll:function(){this.forEachActiveSound(function(t){t.resume()}),this.emit(a.RESUME_ALL,this)},setListenerPosition:u,stopAll:function(){this.forEachActiveSound(function(t){t.stop()}),this.emit(a.STOP_ALL,this)},stopByKey:function(t){var e=0;return this.getAll(t).forEach(function(t){t.stop()&&e++}),e},isPlaying:function(t){var e,i=this.sounds.length-1;if(void 0===t){for(;i>=0;i--)if((e=this.sounds[i]).isPlaying)return!0}else for(;i>=0;i--)if((e=this.sounds[i]).key===t&&e.isPlaying)return!0;return!1},unlock:u,onBlur:u,onFocus:u,onGameBlur:function(){this.gameLostFocus=!0,this.pauseOnBlur&&this.onBlur()},onGameFocus:function(){this.gameLostFocus=!1,this.pauseOnBlur&&this.onFocus()},update:function(t,e){this.unlocked&&(this.unlocked=!1,this.locked=!1,this.emit(a.UNLOCKED,this));for(var i=this.sounds.length-1;i>=0;i--)this.sounds[i].pendingRemove&&this.sounds.splice(i,1);this.sounds.forEach(function(i){i.update(t,e)})},destroy:function(){this.game.events.off(o.BLUR,this.onGameBlur,this),this.game.events.off(o.FOCUS,this.onGameFocus,this),this.game.events.off(o.PRE_STEP,this.update,this),this.removeAllListeners(),this.removeAll(),this.sounds.length=0,this.sounds=null,this.listenerPosition=null,this.game=null},forEachActiveSound:function(t,e){var i=this;this.sounds.forEach(function(s,r){s&&!s.pendingRemove&&t.call(e||i,s,r,i.sounds)})},setRate:function(t){return this.rate=t,this},rate:{get:function(){return this._rate},set:function(t){this._rate=t,this.forEachActiveSound(function(t){t.calculateRate()}),this.emit(a.GLOBAL_RATE,this,t)}},setDetune:function(t){return this.detune=t,this},detune:{get:function(){return this._detune},set:function(t){this._detune=t,this.forEachActiveSound(function(t){t.calculateRate()}),this.emit(a.GLOBAL_DETUNE,this,t)}}});t.exports=c},14747(t,e,i){var s=i(33684),r=i(25960),n=i(57490),a={create:function(t){var e=t.config.audio,i=t.device.audio;return e.noAudio||!i.webAudio&&!i.audioData?new r(t):i.webAudio&&!e.disableWebAudio?new n(t):new s(t)}};t.exports=a},19723(t){t.exports="complete"},98882(t){t.exports="decodedall"},57506(t){t.exports="decoded"},73146(t){t.exports="destroy"},11305(t){t.exports="detune"},40577(t){t.exports="detune"},30333(t){t.exports="mute"},20394(t){t.exports="rate"},21802(t){t.exports="volume"},1299(t){t.exports="looped"},99190(t){t.exports="loop"},97125(t){t.exports="mute"},89259(t){t.exports="pan"},79986(t){t.exports="pauseall"},17586(t){t.exports="pause"},19618(t){t.exports="play"},42306(t){t.exports="rate"},10387(t){t.exports="resumeall"},48959(t){t.exports="resume"},9960(t){t.exports="seek"},19180(t){t.exports="stopall"},98328(t){t.exports="stop"},50401(t){t.exports="unlocked"},52498(t){t.exports="volume"},14463(t,e,i){t.exports={COMPLETE:i(19723),DECODED:i(57506),DECODED_ALL:i(98882),DESTROY:i(73146),DETUNE:i(11305),GLOBAL_DETUNE:i(40577),GLOBAL_MUTE:i(30333),GLOBAL_RATE:i(20394),GLOBAL_VOLUME:i(21802),LOOP:i(99190),LOOPED:i(1299),MUTE:i(97125),PAN:i(89259),PAUSE_ALL:i(79986),PAUSE:i(17586),PLAY:i(19618),RATE:i(42306),RESUME_ALL:i(10387),RESUME:i(48959),SEEK:i(9960),STOP_ALL:i(19180),STOP:i(98328),UNLOCKED:i(50401),VOLUME:i(52498)}},64895(t,e,i){var s=i(30341),r=i(83419),n=i(14463),a=i(45319),o=new r({Extends:s,initialize:function(t,e,i){if(void 0===i&&(i={}),this.tags=t.game.cache.audio.get(e),!this.tags)throw new Error('No cached audio asset with key "'+e);this.audio=null,this.startTime=0,this.previousTime=0,this.duration=this.tags[0].duration,this.totalDuration=this.tags[0].duration,s.call(this,t,e,i)},play:function(t,e){return!this.manager.isLocked(this,"play",[t,e])&&(!!s.prototype.play.call(this,t,e)&&(!!this.pickAndPlayAudioTag()&&(this.emit(n.PLAY,this),!0)))},pause:function(){return!this.manager.isLocked(this,"pause")&&(!(this.startTime>0)&&(!!s.prototype.pause.call(this)&&(this.currentConfig.seek=this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0),this.stopAndReleaseAudioTag(),this.emit(n.PAUSE,this),!0)))},resume:function(){return!this.manager.isLocked(this,"resume")&&(!(this.startTime>0)&&(!!s.prototype.resume.call(this)&&(!!this.pickAndPlayAudioTag()&&(this.emit(n.RESUME,this),!0))))},stop:function(){return!this.manager.isLocked(this,"stop")&&(!!s.prototype.stop.call(this)&&(this.stopAndReleaseAudioTag(),this.emit(n.STOP,this),!0))},pickAndPlayAudioTag:function(){if(!this.pickAudioTag())return this.reset(),!1;var t=this.currentConfig.seek,e=this.currentConfig.delay,i=(this.currentMarker?this.currentMarker.start:0)+t;return this.previousTime=i,this.audio.currentTime=i,this.applyConfig(),0===e?(this.startTime=0,this.audio.paused&&this.playCatchPromise()):(this.startTime=window.performance.now()+1e3*e,this.audio.paused||this.audio.pause()),this.resetConfig(),!0},pickAudioTag:function(){if(this.audio)return!0;for(var t=0;t0)this.startTime=i-this.manager.loopEndOffset?(this.audio.currentTime=e+Math.max(0,s-i),s=this.audio.currentTime):s=i)return this.reset(),this.stopAndReleaseAudioTag(),void this.emit(n.COMPLETE,this);this.previousTime=s}},destroy:function(){s.prototype.destroy.call(this),this.tags=null,this.audio&&this.stopAndReleaseAudioTag()},updateMute:function(){this.audio&&(this.audio.muted=this.currentConfig.mute||this.manager.mute)},updateVolume:function(){this.audio&&(this.audio.volume=a(this.currentConfig.volume*this.manager.volume,0,1))},calculateRate:function(){s.prototype.calculateRate.call(this),this.audio&&(this.audio.playbackRate=this.totalRate)},mute:{get:function(){return this.currentConfig.mute},set:function(t){this.currentConfig.mute=t,this.manager.isLocked(this,"mute",t)||(this.updateMute(),this.emit(n.MUTE,this,t))}},setMute:function(t){return this.mute=t,this},volume:{get:function(){return this.currentConfig.volume},set:function(t){this.currentConfig.volume=t,this.manager.isLocked(this,"volume",t)||(this.updateVolume(),this.emit(n.VOLUME,this,t))}},setVolume:function(t){return this.volume=t,this},rate:{get:function(){return this.currentConfig.rate},set:function(t){this.currentConfig.rate=t,this.manager.isLocked(this,n.RATE,t)||(this.calculateRate(),this.emit(n.RATE,this,t))}},setRate:function(t){return this.rate=t,this},detune:{get:function(){return this.currentConfig.detune},set:function(t){this.currentConfig.detune=t,this.manager.isLocked(this,n.DETUNE,t)||(this.calculateRate(),this.emit(n.DETUNE,this,t))}},setDetune:function(t){return this.detune=t,this},seek:{get:function(){return this.isPlaying?this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0):this.isPaused?this.currentConfig.seek:0},set:function(t){this.manager.isLocked(this,"seek",t)||this.startTime>0||(this.isPlaying||this.isPaused)&&(t=Math.min(Math.max(0,t),this.duration),this.isPlaying?(this.previousTime=t,this.audio.currentTime=t):this.isPaused&&(this.currentConfig.seek=t),this.emit(n.SEEK,this,t))}},setSeek:function(t){return this.seek=t,this},loop:{get:function(){return this.currentConfig.loop},set:function(t){this.currentConfig.loop=t,this.manager.isLocked(this,"loop",t)||(this.audio&&(this.audio.loop=t),this.emit(n.LOOP,this,t))}},setLoop:function(t){return this.loop=t,this},pan:{get:function(){return this.currentConfig.pan},set:function(t){this.currentConfig.pan=t,this.emit(n.PAN,this,t)}},setPan:function(t){return this.pan=t,this}});t.exports=o},33684(t,e,i){var s=i(85034),r=i(83419),n=i(14463),a=i(64895),o=new r({Extends:s,initialize:function(t){this.override=!0,this.audioPlayDelay=.1,this.loopEndOffset=.05,this.onBlurPausedSounds=[],this.locked="ontouchstart"in window,this.lockedActionsQueue=this.locked?[]:null,this._mute=!1,this._volume=1,s.call(this,t)},add:function(t,e){var i=new a(this,t,e);return this.sounds.push(i),i},unlock:function(){this.locked=!1;var t=this;if(this.game.cache.audio.entries.each(function(e,i){for(var s=0;s-1},setAll:function(t,e,i,r){return s.SetAll(this.list,t,e,i,r),this},each:function(t,e){for(var i=[null],s=2;s0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}}});t.exports=o},90330(t,e,i){t.exports=i(60269).default},25774(t,e,i){var s=i(83419),r=i(50792),n=i(82348),a=new s({Extends:r,initialize:function(){r.call(this),this._pending=[],this._active=[],this._destroy=[],this._toProcess=0,this.checkQueue=!1},isActive:function(t){return this._active.indexOf(t)>-1},isPending:function(t){return this._toProcess>0&&this._pending.indexOf(t)>-1},isDestroying:function(t){return this._destroy.indexOf(t)>-1},add:function(t){return this.checkQueue&&this.isActive(t)&&!this.isDestroying(t)||this.isPending(t)||(this._pending.push(t),this._toProcess++),t},remove:function(t){if(this.isPending(t)){var e=this._pending,i=e.indexOf(t);-1!==i&&e.splice(i,1)}else this.isActive(t)&&(this._destroy.push(t),this._toProcess++);return t},removeAll:function(){for(var t=this._active,e=this._destroy,i=t.length;i--;)e.push(t[i]),this._toProcess++;return this},update:function(){if(0===this._toProcess)return this._active;var t,e,i=this._destroy,s=this._active;for(t=0;t=t.minX&&e.maxY>=t.minY}function v(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function x(t,e,i,r,n){for(var a,o=[e,i];o.length;)(i=o.pop())-(e=o.pop())<=r||(a=e+Math.ceil((i-e)/r/2)*r,s(t,a,e,i,n),o.push(e,a,a,i))}r.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],s=this.toBBox;if(!g(t,e))return i;for(var r,n,a,o,h=[];e;){for(r=0,n=e.children.length;r=0&&n[e].children.length>this._maxEntries;)this._split(n,e),e--;this._adjustParentBBoxes(r,n,e)},_split:function(t,e){var i=t[e],s=i.children.length,r=this._minEntries;this._chooseSplitAxis(i,r,s);var n=this._chooseSplitIndex(i,r,s),o=v(i.children.splice(n,i.children.length-n));o.height=i.height,o.leaf=i.leaf,a(i,this.toBBox),a(o,this.toBBox),e?t[e-1].children.push(o):this._splitRoot(i,o)},_splitRoot:function(t,e){this.data=v([t,e]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var s,r,n,a,h,l,u,c;for(l=u=1/0,s=e;s<=i-e;s++)a=p(r=o(t,0,s,this.toBBox),n=o(t,s,i,this.toBBox)),h=d(r)+d(n),a=e;r--)n=t.children[r],h(u,t.leaf?a(n):n),d+=c(u);return d},_adjustParentBBoxes:function(t,e,i){for(var s=i;s>=0;s--)h(e[s],t)},_condense:function(t){for(var e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():a(t[i],this.toBBox)},compareMinX:function(t,e){return t.left-e.left},compareMinY:function(t,e){return t.top-e.top},toBBox:function(t){return{minX:t.left,minY:t.top,maxX:t.right,maxY:t.bottom}}},t.exports=r},86555(t,e,i){var s=i(45319),r=i(83419),n=i(56583),a=i(26099),o=new r({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===s&&(s=null),this._width=t,this._height=e,this._parent=s,this.aspectMode=i,this.aspectRatio=0===e?1:t/e,this.minWidth=0,this.minHeight=0,this.maxWidth=Number.MAX_VALUE,this.maxHeight=Number.MAX_VALUE,this.snapTo=new a},setAspectMode:function(t){return void 0===t&&(t=0),this.aspectMode=t,this.setSize(this._width,this._height)},setSnap:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.snapTo.set(t,e),this.setSize(this._width,this._height)},setParent:function(t){return this._parent=t,this.setSize(this._width,this._height)},setMin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.minWidth=s(t,0,this.maxWidth),this.minHeight=s(e,0,this.maxHeight),this.setSize(this._width,this._height)},setMax:function(t,e){return void 0===t&&(t=Number.MAX_VALUE),void 0===e&&(e=t),this.maxWidth=s(t,this.minWidth,Number.MAX_VALUE),this.maxHeight=s(e,this.minHeight,Number.MAX_VALUE),this.setSize(this._width,this._height)},setSize:function(t,e){switch(void 0===t&&(t=0),void 0===e&&(e=t),this.aspectMode){case o.NONE:this._width=this.getNewWidth(n(t,this.snapTo.x)),this._height=this.getNewHeight(n(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height;break;case o.WIDTH_CONTROLS_HEIGHT:this._width=this.getNewWidth(n(t,this.snapTo.x)),this._height=this.getNewHeight(this._width*(1/this.aspectRatio),!1);break;case o.HEIGHT_CONTROLS_WIDTH:this._height=this.getNewHeight(n(e,this.snapTo.y)),this._width=this.getNewWidth(this._height*this.aspectRatio,!1);break;case o.FIT:this.constrain(t,e,!0);break;case o.ENVELOP:this.constrain(t,e,!1)}return this},setAspectRatio:function(t){return this.aspectRatio=t,this.setSize(this._width,this._height)},resize:function(t,e){return this._width=this.getNewWidth(n(t,this.snapTo.x)),this._height=this.getNewHeight(n(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height,this},getNewWidth:function(t,e){return void 0===e&&(e=!0),t=s(t,this.minWidth,this.maxWidth),e&&this._parent&&t>this._parent.width&&(t=Math.max(this.minWidth,this._parent.width)),t},getNewHeight:function(t,e){return void 0===e&&(e=!0),t=s(t,this.minHeight,this.maxHeight),e&&this._parent&&t>this._parent.height&&(t=Math.max(this.minHeight,this._parent.height)),t},constrain:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=!0),t=this.getNewWidth(t),e=this.getNewHeight(e);var s=this.snapTo,r=0===e?1:t/e;return i&&this.aspectRatio>r||!i&&this.aspectRatio0&&(t=(e=n(e,s.y))*this.aspectRatio)):(i&&this.aspectRatior)&&(t=(e=n(e,s.y))*this.aspectRatio,s.x>0&&(e=(t=n(t,s.x))*(1/this.aspectRatio))),this._width=t,this._height=e,this},fitTo:function(t,e){return this.constrain(t,e,!0)},envelop:function(t,e){return this.constrain(t,e,!1)},setWidth:function(t){return this.setSize(t,this._height)},setHeight:function(t){return this.setSize(this._width,t)},toString:function(){return"[{ Size (width="+this._width+" height="+this._height+" aspectRatio="+this.aspectRatio+" aspectMode="+this.aspectMode+") }]"},setCSS:function(t){t&&t.style&&(t.style.width=this._width+"px",t.style.height=this._height+"px")},copy:function(t){return t.setAspectMode(this.aspectMode),t.aspectRatio=this.aspectRatio,t.setSize(this.width,this.height)},destroy:function(){this._parent=null,this.snapTo=null},width:{get:function(){return this._width},set:function(t){this.setSize(t,this._height)}},height:{get:function(){return this._height},set:function(t){this.setSize(this._width,t)}}});o.NONE=0,o.WIDTH_CONTROLS_HEIGHT=1,o.HEIGHT_CONTROLS_WIDTH=2,o.FIT=3,o.ENVELOP=4,t.exports=o},15238(t){t.exports="add"},56187(t){t.exports="remove"},82348(t,e,i){t.exports={PROCESS_QUEUE_ADD:i(15238),PROCESS_QUEUE_REMOVE:i(56187)}},41392(t,e,i){t.exports={Events:i(82348),List:i(73162),Map:i(90330),ProcessQueue:i(25774),RTree:i(59542),Size:i(86555)}},57382(t,e,i){var s=i(83419),r=i(45319),n=i(40987),a=i(8054),o=i(50030),h=i(79237),l=new s({Extends:h,initialize:function(t,e,i,s,r){h.call(this,t,e,i,s,r),this.add("__BASE",0,0,0,s,r),this._source=this.frames.__BASE.source,this.canvas=this._source.image,this.context=this.canvas.getContext("2d",{willReadFrequently:!0}),this.width=s,this.height=r,this.imageData=this.context.getImageData(0,0,s,r),this.data=null,this.imageData&&(this.data=this.imageData.data),this.pixels=null,this.buffer,this.data&&(this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data)},update:function(){return this.imageData=this.context.getImageData(0,0,this.width,this.height),this.data=this.imageData.data,this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data,this.manager.game.config.renderType===a.WEBGL&&this.refresh(),this},draw:function(t,e,i,s){return void 0===s&&(s=!0),this.context.drawImage(i,t,e),s&&this.update(),this},drawFrame:function(t,e,i,s,r){void 0===i&&(i=0),void 0===s&&(s=0),void 0===r&&(r=!0);var n=this.manager.getFrame(t,e);if(n){var a=n.canvasData,o=n.cutWidth,h=n.cutHeight,l=n.source.resolution;this.context.drawImage(n.source.image,a.x,a.y,o,h,i,s,o/l,h/l),r&&this.update()}return this},setPixel:function(t,e,i,s,r,n){if(void 0===n&&(n=255),t=Math.abs(Math.floor(t)),e=Math.abs(Math.floor(e)),this.getIndex(t,e)>-1){var a=this.context.getImageData(t,e,1,1);a.data[0]=i,a.data[1]=s,a.data[2]=r,a.data[3]=n,this.context.putImageData(a,t,e)}return this},putData:function(t,e,i,s,r,n,a){return void 0===s&&(s=0),void 0===r&&(r=0),void 0===n&&(n=t.width),void 0===a&&(a=t.height),this.context.putImageData(t,e,i,s,r,n,a),this},getData:function(t,e,i,s){return t=r(Math.floor(t),0,this.width-1),e=r(Math.floor(e),0,this.height-1),i=r(i,1,this.width-t),s=r(s,1,this.height-e),this.context.getImageData(t,e,i,s)},getPixel:function(t,e,i){i||(i=new n);var s=this.getIndex(t,e);if(s>-1){var r=this.data,a=r[s+0],o=r[s+1],h=r[s+2],l=r[s+3];i.setTo(a,o,h,l)}return i},getPixels:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===s&&(s=i),t=Math.abs(Math.round(t)),e=Math.abs(Math.round(e));for(var a=r(t,0,this.width),o=r(t+i,0,this.width),h=r(e,0,this.height),l=r(e+s,0,this.height),u=new n,d=[],c=h;ca.width&&(t=a.width-s.cutX),s.cutY+e>a.height&&(e=a.height-s.cutY),s.setSize(t,e,s.cutX,s.cutY)}return this},render:function(){if(0!==this.commandBuffer.length)return this.camera.preRender(),this.renderer.type===o.WEBGL&&this._renderWebGL(),this.renderer.type===o.CANVAS&&this._renderCanvas(),this},_renderWebGL:function(){this.renderer.renderNodes.getNode("DynamicTextureHandler").run(this)},_renderCanvas:function(){var t,e,i,r,n,a,o,h,l,u,d,c,p,m,g,v=this.camera,x=this.context,y=this.renderer,T=this.manager;y.setContext(x);for(var w=this.commandBuffer,S=w.length,b=!1,E=!1,C=0;C>24&255)/255;var _=A>>16&255,M=A>>8&255,R=255&A;x.save(),x.globalCompositeOperation="source-over",x.fillStyle="rgba("+_+","+M+","+R+","+t+")",x.fillRect(m,g,p,n),x.restore();break;case f.STAMP:a=w[++C],r=w[++C],m=w[++C],g=w[++C],t=w[++C],c=w[++C],l=w[++C],u=w[++C],d=w[++C],o=w[++C],h=w[++C],e=w[++C],E&&(e=s.ERASE);var O=T.resetStamp(t,c);O.setPosition(m,g).setRotation(l).setScale(u,d).setTexture(a,r).setOrigin(o,h).setBlendMode(e),O.renderCanvas(y,O,v,null);break;case f.REPEAT:a=w[++C],r=w[++C],m=w[++C],g=w[++C],t=w[++C],c=w[++C],l=w[++C],u=w[++C],d=w[++C],o=w[++C],h=w[++C],e=w[++C],p=w[++C],n=w[++C];var P=w[++C],L=w[++C],F=w[++C],D=w[++C],I=w[++C];E&&(e=s.ERASE);var N=T.resetTileSprite(t,c);N.setPosition(m,g).setRotation(l).setScale(u,d).setTexture(a,r).setSize(p,n).setOrigin(o,h).setBlendMode(e).setTilePosition(P,L).setTileRotation(F).setTileScale(D,I),N.renderCanvas(y,N,v,null);break;case f.DRAW:var B=w[++C];if(m=w[++C],g=w[++C],void 0!==m){var k=B.x;B.x=m}if(void 0!==g){var U=B.y;B.y=g}E&&(i=B.blendMode,B.blendMode=s.ERASE),B.renderCanvas(y,B,v,null),void 0!==m&&(B.x=k),void 0!==g&&(B.y=U),E&&(B.blendMode=i);break;case f.SET_ERASE:E=!!w[++C];break;case f.PRESERVE:b=w[++C];break;case f.CALLBACK:(0,w[++C])();break;case f.CAPTURE:B=w[++C];var z=w[++C],Y=this.startCapture(B,z);B.renderCanvas(y,B,z.camera||v,Y.transform),this.finishCapture(B,Y)}}b||(w.length=0),y.setContext()},fill:function(t,e,i,s,r,n){void 0===e&&(e=1),void 0===i&&(i=0),void 0===s&&(s=0),void 0===r&&(r=this.width),void 0===n&&(n=this.height);var a=t>>16&255,o=t>>8&255,h=255&t,l=c.getTintFromFloats(a/255,o/255,h/255,e);return this.commandBuffer.push(f.FILL,l,i,s,r,n),this},clear:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===s&&(s=this.height),this.commandBuffer.push(f.CLEAR,t,e,i,s),this},stamp:function(t,e,i,s,r){void 0===i&&(i=0),void 0===s&&(s=0);var n=u(r,"alpha",1),a=u(r,"tint",16777215),o=u(r,"angle",0),h=u(r,"rotation",0),l=u(r,"scale",1),d=u(r,"scaleX",l),c=u(r,"scaleY",l),p=u(r,"originX",.5),m=u(r,"originY",.5),g=u(r,"blendMode",0);return 0!==o&&(h=o*Math.PI/180),this.commandBuffer.push(f.STAMP,t,e,i,s,n,a,h,d,c,p,m,g),this},erase:function(t,e,i,s,r){var n=this.commandBuffer,a=n.length;return n[a-2]!==f.SET_ERASE||n[a-1]?n.push(f.SET_ERASE,!0):n.length-=2,this.draw(t,e,i,s,r),n.push(f.SET_ERASE,!1),this},draw:function(t,e,i,s,r){Array.isArray(t)||(t=[t]);for(var n=t.length,a=0;aT||y.y>w)){var S=Math.max(y.x,e),b=Math.max(y.y,i),E=Math.min(y.r,T)-S,C=Math.min(y.b,w)-b;g=E,v=C,p=a?h+(u-(S-y.x)-E):h+(S-y.x),m=o?l+(d-(b-y.y)-C):l+(b-y.y),e=S,i=b,s=E,n=C}else p=0,m=0,g=0,v=0}else a&&(p=h+(u-e-s)),o&&(m=l+(d-i-n));var A=this.source.width,_=this.source.height;return t.u0=Math.max(0,p/A),t.v0=1-Math.max(0,m/_),t.u1=Math.min(1,(p+g)/A),t.v1=1-Math.min(1,(m+v)/_),t.x=e,t.y=i,t.cx=p,t.cy=m,t.cw=g,t.ch=v,t.width=s,t.height=n,t.flipX=a,t.flipY=o,t},updateCropUVs:function(t,e,i){return this.setCropUVs(t,t.x,t.y,t.width,t.height,e,i)},setUVs:function(t,e,i,s,r,n){var a=this.data.drawImage;return a.width=t,a.height=e,this.u0=i,this.v0=s,this.u1=r,this.v1=n,this},updateUVs:function(){var t=this.cutX,e=this.cutY,i=this.cutWidth,s=this.cutHeight,r=this.data.drawImage;r.width=i,r.height=s;var n=this.source.width,a=this.source.height;return this.u0=t/n,this.v0=1-e/a,this.u1=(t+i)/n,this.v1=1-(e+s)/a,this},updateUVsInverted:function(){var t=this.source.width,e=this.source.height;return this.u0=(this.cutX+this.cutHeight)/t,this.v0=1-this.cutY/e,this.u1=this.cutX/t,this.v1=1-(this.cutY+this.cutWidth)/e,this},clone:function(){var t=new a(this.texture,this.name,this.sourceIndex);return t.cutX=this.cutX,t.cutY=this.cutY,t.cutWidth=this.cutWidth,t.cutHeight=this.cutHeight,t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t.halfWidth=this.halfWidth,t.halfHeight=this.halfHeight,t.centerX=this.centerX,t.centerY=this.centerY,t.rotated=this.rotated,t.data=n(!0,t.data,this.data),t.updateUVs(),t},destroy:function(){this.texture=null,this.source=null,this.customData=null,this.data=null},glTexture:{get:function(){return this.source.glTexture}},realWidth:{get:function(){return this.data.sourceSize.w}},realHeight:{get:function(){return this.data.sourceSize.h}},radius:{get:function(){return this.data.radius}},trimmed:{get:function(){return this.data.trim}},scale9:{get:function(){return this.data.scale9}},is3Slice:{get:function(){return this.data.is3Slice}},canvasData:{get:function(){return this.data.drawImage}}});t.exports=a},79237(t,e,i){var s=i(83419),r=i(4327),n=i(11876),a='Texture "%s" has no frame "%s"',o=new s({initialize:function(t,e,i,s,r){Array.isArray(i)||(i=[i]),this.manager=t,this.key=e,this.source=[],this.dataSource=[],this.frames={},this.customData={},this.firstFrame="__BASE",this.frameTotal=0,this.smoothPixelArt=null;for(var a=0;an&&(n=h.cutX+h.cutWidth),h.cutY+h.cutHeight>a&&(a=h.cutY+h.cutHeight)}return{x:s,y:r,width:n-s,height:a-r}},getFrameNames:function(t){void 0===t&&(t=!1);var e=Object.keys(this.frames);if(!t){var i=e.indexOf("__BASE");-1!==i&&e.splice(i,1)}return e},getSourceImage:function(t){null!=t&&1!==this.frameTotal||(t="__BASE");var e=this.frames[t];return e?e.source.image:(console.warn(a,this.key,t),this.frames.__BASE.source.image)},getDataSourceImage:function(t){null!=t&&1!==this.frameTotal||(t="__BASE");var e,i=this.frames[t];return i?e=i.sourceIndex:(console.warn(a,this.key,t),e=this.frames.__BASE.sourceIndex),this.dataSource[e].image},setSource:function(t,e,i,s,r){void 0===e&&(e=0),void 0===i&&(i=!1),Array.isArray(t)||(t=[t]);for(var a=0;a0&&o.height>0&&l.drawImage(a.source.image,o.x,o.y,o.width,o.height,0,0,o.width,o.height),n=h.toDataURL(i,r),s.remove(h)}return n},addImage:function(t,e,i){var s=null;return this.checkKey(t)&&(s=this.create(t,e),v.Image(s,0),i&&s.setDataSource(i),this.emit(u.ADD,t,s),this.emit(u.ADD_KEY+t,s)),s},addGLTexture:function(t,e){var i=null;if(this.checkKey(t)){var s=e.width,r=e.height;(i=this.create(t,e,s,r)).add("__BASE",0,0,0,s,r),this.emit(u.ADD,t,i),this.emit(u.ADD_KEY+t,i)}return i},addCompressedTexture:function(t,e,i){var s=null;if(this.checkKey(t)){if((s=this.create(t,e)).add("__BASE",0,0,0,e.width,e.height),i){var r=function(t,e,i){Array.isArray(i.textures)||Array.isArray(i.frames)?v.JSONArray(t,e,i):v.JSONHash(t,e,i)};if(Array.isArray(i))for(var n=0;n=h.x&&t=h.y&&e=o.x&&t=o.y&&e>1),m=Math.max(1,m>>1),f+=g}return{mipmaps:c,width:h,height:l,internalFormat:o,compressed:!0,generateMipmap:!1}}console.warn("KTXParser - Only compressed formats supported")}},41942(t){t.exports=function(t,e){if(e&&e.frames&&e.pages){var i=t.source[0];t.add("__BASE",0,0,0,i.width,i.height);var s=e.frames;for(var r in s)if(s.hasOwnProperty(r)){var n=s[r],a=0|n.page;if(a>=t.source.length)console.warn('PCT atlas frame "'+r+'" references missing page '+a);else{var o=t.add(n.key||r,a,n.x,n.y,n.w,n.h);o?(n.trimmed&&o.setTrim(n.sourceW,n.sourceH,n.trimX,n.trimY,n.w,n.h),n.rotated&&(o.rotated=!0,o.updateUVsInverted())):console.warn("Invalid PCT atlas, frame already exists: "+r)}}return t.customData.pct={pages:e.pages,folders:e.folders},t}console.warn("Invalid PCT atlas data given")}},39620(t){var e={1:".png",2:".webp",3:".jpg",4:".jpeg",5:".gif"},i=function(t,e){for(var i=String(t);i.length0&&function(t){if(0===t.length)return!1;for(var e=0;e57)return!1}return!0}(r.substring(0,a))&&(n=i[parseInt(r.substring(0,a),10)],r=r.substring(a+1));var o=/~([1-5])$/.exec(r);if(o){var h=e[parseInt(o[1],10)];r=r.substring(0,r.length-2)+h}else s&&(r+=s);return n?n+"/"+r:r},r=function(t,r){var n="",a=/~([1-5])$/.exec(t);a&&(n=e[parseInt(a[1],10)],t=t.substring(0,t.length-2));for(var o=[],h=t.split(","),l=0;l=0)for(var c=u.substring(0,d),f=u.substring(d+1),p=f.indexOf("-"),m=f.substring(0,p),g=f.substring(p+1),v=parseInt(m,10),x=parseInt(g,10),y=m.length>1&&"0"===m.charAt(0)?m.length:0,T=v;T<=x;T++){var w=y>0?i(T,y):String(T);o.push(s(c+w,r,n))}else o.push(s(u,r,n))}return o};t.exports=function(t){if("string"!=typeof t||0===t.length)return console.warn("Invalid PCT file: empty or not a string"),null;var e=t.split("\n"),i=e[0];if(13===i.charCodeAt(i.length-1)&&(i=i.substring(0,i.length-1)),!i||0!==i.indexOf("PCT:"))return console.warn("Not a PCT file: missing PCT: header"),null;var n=i.substring(4),a=n.split("."),o=parseInt(a[0],10);if(isNaN(o)||o>1)return console.warn("Unsupported PCT version: "+n),null;for(var h=[],l=[],u={},d=0,c=null,f=1;f1};if(y.trimmed){var T=v[1].split(",");y.sourceW=parseInt(T[0],10),y.sourceH=parseInt(T[1],10),y.trimX=parseInt(T[2],10),y.trimY=parseInt(T[3],10)}c=y}else if("A:"===m){var w=p.indexOf("=",2);if(-1===w)continue;var S=s(p.substring(2,w),l,""),b=r(p.substring(w+1),l),E=u[S];if(E)for(var C=0;C>1),m=Math.max(1,m>>1),f+=v}return{mipmaps:c,width:h,height:l,internalFormat:r,compressed:!0,generateMipmap:!1}}},75549(t,e,i){var s=i(95540);t.exports=function(t,e,i,r,n,a,o){var h=s(o,"frameWidth",null),l=s(o,"frameHeight",h);if(null===h)throw new Error("TextureManager.SpriteSheet: Invalid frameWidth given.");var u=t.source[e];t.add("__BASE",e,0,0,u.width,u.height);var d=s(o,"startFrame",0),c=s(o,"endFrame",-1),f=s(o,"margin",0),p=s(o,"spacing",0),m=Math.floor((n-f+p)/(h+p))*Math.floor((a-f+p)/(l+p));0===m&&console.warn("SpriteSheet frame dimensions will result in zero frames for texture:",t.key),(d>m||d<-m)&&(d=0),d<0&&(d=m+d),(-1===c||c>m||cn&&(x=S-n),b>a&&(y=b-a),w>=d&&w<=c&&(t.add(T,e,i+g,r+v,h-x,l-y),T++),(g+=h+p)+h>n&&(g=f,v+=l+p)}return t}},47534(t,e,i){var s=i(95540);t.exports=function(t,e,i){var r=s(i,"frameWidth",null),n=s(i,"frameHeight",r);if(!r)throw new Error("TextureManager.SpriteSheetFromAtlas: Invalid frameWidth given.");var a=t.source[0];t.add("__BASE",0,0,0,a.width,a.height);var o,h=s(i,"startFrame",0),l=s(i,"endFrame",-1),u=s(i,"margin",0),d=s(i,"spacing",0),c=e.cutX,f=e.cutY,p=e.cutWidth,m=e.cutHeight,g=e.realWidth,v=e.realHeight,x=Math.floor((g-u+d)/(r+d)),y=Math.floor((v-u+d)/(n+d)),T=x*y,w=e.x,S=r-w,b=r-(g-p-w),E=e.y,C=n-E,A=n-(v-m-E);(h>T||h<-T)&&(h=0),h<0&&(h=T+h),-1!==l&&(T=h+(l+1));for(var _=u,M=u,R=0,O=0;O=this.firstgid&&tthis.right||e>this.bottom)},copy:function(t){return this.index=t.index,this.alpha=t.alpha,this.properties=a(t.properties),this.visible=t.visible,this.setFlip(t.flipX,t.flipY),this.tint=t.tint,this.rotation=t.rotation,this.collideUp=t.collideUp,this.collideDown=t.collideDown,this.collideLeft=t.collideLeft,this.collideRight=t.collideRight,this.collisionCallback=t.collisionCallback,this.collisionCallbackContext=t.collisionCallbackContext,this},getCollisionGroup:function(){return this.tileset?this.tileset.getTileCollisionGroup(this.index):null},getTileData:function(){return this.tileset?this.tileset.getTileData(this.index):null},getLeft:function(t){var e=this.tilemapLayer;return e?e.tileToWorldXY(this.x,this.y,void 0,t).x:this.x*this.baseWidth},getRight:function(t){var e=this.tilemapLayer;return e?this.getLeft(t)+this.width*e.scaleX:this.getLeft(t)+this.width},getTop:function(t){var e=this.tilemapLayer;return e?e.tileToWorldXY(this.x,this.y,void 0,t).y:this.y*this.baseWidth-(this.height-this.baseHeight)},getBottom:function(t){var e=this.tilemapLayer;return e?this.getTop(t)+this.height*e.scaleY:this.getTop(t)+this.height},getBounds:function(t,e){return void 0===e&&(e=new o),e.x=this.getLeft(t),e.y=this.getTop(t),e.width=this.getRight(t)-e.x,e.height=this.getBottom(t)-e.y,e},getCenterX:function(t){return(this.getLeft(t)+this.getRight(t))/2},getCenterY:function(t){return(this.getTop(t)+this.getBottom(t))/2},intersects:function(t,e,i,s){return!(i<=this.pixelX||s<=this.pixelY||t>=this.right||e>=this.bottom)},isInteresting:function(t,e){return t&&e?this.canCollide||this.hasInterestingFace:t?this.collides:!!e&&this.hasInterestingFace},resetCollision:function(t){(void 0===t&&(t=!0),this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,t)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},resetFaces:function(){return this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this},setCollision:function(t,e,i,s,r){(void 0===e&&(e=t),void 0===i&&(i=t),void 0===s&&(s=t),void 0===r&&(r=!0),this.collideLeft=t,this.collideRight=e,this.collideUp=i,this.collideDown=s,this.faceLeft=t,this.faceRight=e,this.faceTop=i,this.faceBottom=s,r)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},setCollisionCallback:function(t,e){return null===t?(this.collisionCallback=void 0,this.collisionCallbackContext=void 0):(this.collisionCallback=t,this.collisionCallbackContext=e),this},setSize:function(t,e,i,s){return void 0!==t&&(this.width=t),void 0!==e&&(this.height=e),void 0!==i&&(this.baseWidth=i),void 0!==s&&(this.baseHeight=s),this.updatePixelXY(),this},updatePixelXY:function(){var t=this.layer.orientation;if(t===n.ORTHOGONAL)this.pixelX=this.x*this.baseWidth,this.pixelY=this.y*this.baseHeight;else if(t===n.ISOMETRIC)this.pixelX=(this.x-this.y)*this.baseWidth*.5,this.pixelY=(this.x+this.y)*this.baseHeight*.5;else if(t===n.STAGGERED)this.pixelX=this.x*this.baseWidth+this.y%2*(this.baseWidth/2),this.pixelY=this.y*(this.baseHeight/2);else if(t===n.HEXAGONAL){var e,i,s=this.layer.staggerAxis,r=this.layer.staggerIndex,a=this.layer.hexSideLength;"y"===s?(i=(this.baseHeight-a)/2+a,this.pixelX="odd"===r?this.x*this.baseWidth+this.y%2*(this.baseWidth/2):this.x*this.baseWidth-this.y%2*(this.baseWidth/2),this.pixelY=this.y*i):"x"===s&&(e=(this.baseWidth-a)/2+a,this.pixelX=this.x*e,this.pixelY="odd"===r?this.y*this.baseHeight+this.x%2*(this.baseHeight/2):this.y*this.baseHeight-this.x%2*(this.baseHeight/2))}return this.right=this.pixelX+this.baseWidth,this.bottom=this.pixelY+this.baseHeight,this},destroy:function(){this.collisionCallback=void 0,this.collisionCallbackContext=void 0,this.properties=void 0},canCollide:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown||void 0!==this.collisionCallback}},collides:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown}},hasInterestingFace:{get:function(){return this.faceTop||this.faceBottom||this.faceLeft||this.faceRight}},tileset:{get:function(){var t=this.layer.tilemapLayer;if(t){var e=t.gidMap[this.index];if(e)return e}return null}},tilemapLayer:{get:function(){return this.layer.tilemapLayer}},tilemap:{get:function(){var t=this.tilemapLayer;return t?t.tilemap:null}}});t.exports=l},49075(t,e,i){var s=i(84101),r=i(83419),n=i(39506),a=i(80341),o=i(95540),h=i(14977),l=i(27462),u=i(91907),d=i(36305),c=i(19133),f=i(68287),p=i(23029),m=i(81086),g=i(44731),v=i(53180),x=i(20442),y=i(33629),T=new r({initialize:function(t,e){this.scene=t,this.tileWidth=e.tileWidth,this.tileHeight=e.tileHeight,this.width=e.width,this.height=e.height,this.orientation=e.orientation,this.renderOrder=e.renderOrder,this.format=e.format,this.version=e.version,this.properties=e.properties,this.widthInPixels=e.widthInPixels,this.heightInPixels=e.heightInPixels,this.imageCollections=e.imageCollections,this.images=e.images,this.layers=e.layers,this.tiles=e.tiles,this.tilesets=e.tilesets,this.objects=e.objects,this.currentLayerIndex=0,this.hexSideLength=e.hexSideLength;var i=this.orientation;this._convert={WorldToTileXY:m.GetWorldToTileXYFunction(i),WorldToTileX:m.GetWorldToTileXFunction(i),WorldToTileY:m.GetWorldToTileYFunction(i),TileToWorldXY:m.GetTileToWorldXYFunction(i),TileToWorldX:m.GetTileToWorldXFunction(i),TileToWorldY:m.GetTileToWorldYFunction(i),GetTileCorners:m.GetTileCornersFunction(i)}},setRenderOrder:function(t){var e=["right-down","left-down","right-up","left-up"];return"number"==typeof t&&(t=e[t]),e.indexOf(t)>-1&&(this.renderOrder=t),this},addTilesetImage:function(t,e,i,r,n,o,h,l){if(void 0===t)return null;null==e&&(e=t);var u=this.scene.sys.textures;if(!u.exists(e))return console.warn('Texture key "%s" not found',e),null;var d=u.get(e),c=this.getTilesetIndex(t);if(null===c&&this.format===a.TILED_JSON)return console.warn('Tilemap has no tileset "%s". Its tilesets are %o',t,this.tilesets),null;var f=this.tilesets[c];return f?((i||r)&&f.setTileSize(i,r),(n||o)&&f.setSpacing(n,o),f.setImage(d),f):(void 0===i&&(i=this.tileWidth),void 0===r&&(r=this.tileHeight),void 0===n&&(n=0),void 0===o&&(o=0),void 0===h&&(h=0),void 0===l&&(l={x:0,y:0}),(f=new y(t,h,i,r,n,o,void 0,void 0,l)).setImage(d),this.tilesets.push(f),this.tiles=s(this),f)},copy:function(t,e,i,s,r,n,a,o){return null!==(o=this.getLayer(o))?(m.Copy(t,e,i,s,r,n,a,o),this):null},createBlankLayer:function(t,e,i,s,r,n,a,o){if(void 0===i&&(i=0),void 0===s&&(s=0),void 0===r&&(r=this.width),void 0===n&&(n=this.height),void 0===a&&(a=this.tileWidth),void 0===o&&(o=this.tileHeight),null!==this.getLayerIndex(t))return console.warn("Invalid Tilemap Layer ID: "+t),null;for(var l,u=new h({name:t,tileWidth:a,tileHeight:o,width:r,height:n,orientation:this.orientation,hexSideLength:this.hexSideLength}),d=0;d1&&console.warn("TilemapGPULayer can only use one tileset. Using the first item given."),e=e[0]),a=new v(this.scene,this,n,e,i,s)):(a=new x(this.scene,this,n,e,i,s)).setRenderOrder(this.renderOrder),this.scene.sys.displayList.add(a),a)},createFromObjects:function(t,e,i){void 0===i&&(i=!0);var s=[],r=this.getObjectLayer(t);if(!r)return console.warn("createFromObjects: Invalid objectLayerName given: "+t),s;var a=new l(i?this.tilesets:void 0);Array.isArray(e)||(e=[e]);var h=r.objects;e.sortByY&&h.sort(function(t,e){return t.y>e.y?1:-1});for(var c=0;c-1&&this.putTileAt(e,n.x,n.y,i,n.tilemapLayer)}return s},removeTileAt:function(t,e,i,s,r){return void 0===i&&(i=!0),void 0===s&&(s=!0),null===(r=this.getLayer(r))?null:m.RemoveTileAt(t,e,i,s,r)},removeTileAtWorldXY:function(t,e,i,s,r,n){return void 0===i&&(i=!0),void 0===s&&(s=!0),null===(n=this.getLayer(n))?null:m.RemoveTileAtWorldXY(t,e,i,s,r,n)},renderDebug:function(t,e,i){return null===(i=this.getLayer(i))?null:(this.orientation===u.ORTHOGONAL&&m.RenderDebug(t,e,i),this)},renderDebugFull:function(t,e){for(var i=this.layers,s=0;s=0&&t<4&&(this._renderOrder=t),this},cull:function(t){return this.cullCallback(this.layer,t,this.culledTiles,this._renderOrder)},setSkipCull:function(t){return void 0===t&&(t=!0),this.skipCull=t,this},setCullPadding:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=1),this.cullPaddingX=t,this.cullPaddingY=e,this},setTint:function(t,e,i,s,r,n){void 0===t&&(t=16777215);return this.forEachTile(function(e){e.tint=t},this,e,i,s,r,n)},setTintMode:function(t,e,i,s,r,n){void 0===t&&(t=h.MULTIPLY);return this.forEachTile(function(e){e.tintMode=t},this,e,i,s,r,n)},destroy:function(t){this.culledTiles.length=0,this.cullCallback=null,o.prototype.destroy.call(this,t)}});t.exports=l},44731(t,e,i){var s=i(83419),r=i(78389),n=i(31401),a=i(95643),o=i(81086),h=i(26099),l=new s({Extends:a,Mixins:[n.Alpha,n.BlendMode,n.ComputedSize,n.Depth,n.ElapseTimer,n.Flip,n.GetBounds,n.Lighting,n.Mask,n.Origin,n.RenderNodes,n.Transform,n.Visible,n.ScrollFactor,r],initialize:function(t,e,i,s,r,n){a.call(this,e,t),this.isTilemap=!0,this.tilemap=i,this.layerIndex=s,this.layer=i.layers[s],this.layer.tilemapLayer=this,this.gidMap=[],this.tempVec=new h,this.collisionCategory=1,this.collisionMask=1,this.setAlpha(this.layer.alpha),this.setPosition(r,n),this.setOrigin(0,0),this.setSize(i.tileWidth*this.layer.width,i.tileHeight*this.layer.height)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(t,e){this.updateTimer(t,e)},calculateFacesAt:function(t,e){return o.CalculateFacesAt(t,e,this.layer),this},calculateFacesWithin:function(t,e,i,s){return o.CalculateFacesWithin(t,e,i,s,this.layer),this},createFromTiles:function(t,e,i,s,r){return o.CreateFromTiles(t,e,i,s,r,this.layer)},copy:function(t,e,i,s,r,n,a){return o.Copy(t,e,i,s,r,n,a,this.layer),this},fill:function(t,e,i,s,r,n){return o.Fill(t,e,i,s,r,n,this.layer),this},filterTiles:function(t,e,i,s,r,n,a){return o.FilterTiles(t,e,i,s,r,n,a,this.layer)},findByIndex:function(t,e,i){return o.FindByIndex(t,e,i,this.layer)},findTile:function(t,e,i,s,r,n,a){return o.FindTile(t,e,i,s,r,n,a,this.layer)},forEachTile:function(t,e,i,s,r,n,a){return o.ForEachTile(t,e,i,s,r,n,a,this.layer),this},getTileAt:function(t,e,i){return o.GetTileAt(t,e,i,this.layer)},getTileAtWorldXY:function(t,e,i,s){return o.GetTileAtWorldXY(t,e,i,s,this.layer)},getIsoTileAtWorldXY:function(t,e,i,s,r){void 0===i&&(i=!0);var n=this.tempVec;return o.IsometricWorldToTileXY(t,e,!0,n,r,this.layer,i),this.getTileAt(n.x,n.y,s)},getTilesWithin:function(t,e,i,s,r){return o.GetTilesWithin(t,e,i,s,r,this.layer)},getTilesWithinShape:function(t,e,i){return o.GetTilesWithinShape(t,e,i,this.layer)},getTilesWithinWorldXY:function(t,e,i,s,r,n){return o.GetTilesWithinWorldXY(t,e,i,s,r,n,this.layer)},hasTileAt:function(t,e){return o.HasTileAt(t,e,this.layer)},hasTileAtWorldXY:function(t,e,i){return o.HasTileAtWorldXY(t,e,i,this.layer)},putTileAt:function(t,e,i,s){return o.PutTileAt(t,e,i,s,this.layer)},putTileAtWorldXY:function(t,e,i,s,r){return o.PutTileAtWorldXY(t,e,i,s,r,this.layer)},putTilesAt:function(t,e,i,s){return o.PutTilesAt(t,e,i,s,this.layer),this},randomize:function(t,e,i,s,r){return o.Randomize(t,e,i,s,r,this.layer),this},removeTileAt:function(t,e,i,s){return o.RemoveTileAt(t,e,i,s,this.layer)},removeTileAtWorldXY:function(t,e,i,s,r){return o.RemoveTileAtWorldXY(t,e,i,s,r,this.layer)},renderDebug:function(t,e){return o.RenderDebug(t,e,this.layer),this},replaceByIndex:function(t,e,i,s,r,n){return o.ReplaceByIndex(t,e,i,s,r,n,this.layer),this},setCollision:function(t,e,i,s){return o.SetCollision(t,e,i,this.layer,s),this},setCollisionBetween:function(t,e,i,s){return o.SetCollisionBetween(t,e,i,s,this.layer),this},setCollisionByProperty:function(t,e,i){return o.SetCollisionByProperty(t,e,i,this.layer),this},setCollisionByExclusion:function(t,e,i){return o.SetCollisionByExclusion(t,e,i,this.layer),this},setCollisionFromCollisionGroup:function(t,e){return o.SetCollisionFromCollisionGroup(t,e,this.layer),this},setTileIndexCallback:function(t,e,i){return o.SetTileIndexCallback(t,e,i,this.layer),this},setTileLocationCallback:function(t,e,i,s,r,n){return o.SetTileLocationCallback(t,e,i,s,r,n,this.layer),this},shuffle:function(t,e,i,s){return o.Shuffle(t,e,i,s,this.layer),this},swapByIndex:function(t,e,i,s,r,n){return o.SwapByIndex(t,e,i,s,r,n,this.layer),this},tileToWorldX:function(t,e){return this.tilemap.tileToWorldX(t,e,this)},tileToWorldY:function(t,e){return this.tilemap.tileToWorldY(t,e,this)},tileToWorldXY:function(t,e,i,s){return this.tilemap.tileToWorldXY(t,e,i,s,this)},getTileCorners:function(t,e,i){return this.tilemap.getTileCorners(t,e,i,this)},weightedRandomize:function(t,e,i,s,r){return o.WeightedRandomize(e,i,s,r,t,this.layer),this},worldToTileX:function(t,e,i){return this.tilemap.worldToTileX(t,e,i,this)},worldToTileY:function(t,e,i){return this.tilemap.worldToTileY(t,e,i,this)},worldToTileXY:function(t,e,i,s,r){return this.tilemap.worldToTileXY(t,e,i,s,r,this)},destroy:function(t){void 0===t&&(t=!0),this.tilemap&&(this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),t&&this.tilemap.removeLayer(this),this.tilemap=void 0,this.layer=void 0,this.gidMap=[],this.tileset=[],a.prototype.destroy.call(this))}});t.exports=l},16153(t,e,i){var s=i(61340),r=new s,n=new s,a=new s;t.exports=function(t,e,i,s){var o=e.cull(i),h=o.length,l=i.alpha*e.alpha;if(!(0===h||l<=0)){n.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var u=t.currentContext,d=e.gidMap;u.save(),r.copyWithScrollFactorFrom(i.matrixCombined,i.scrollX,i.scrollY,e.scrollFactorX,e.scrollFactorY),s&&r.multiply(s),r.multiply(n,a),a.setToContext(u),(!t.antialias||e.scaleX>1||e.scaleY>1)&&(u.imageSmoothingEnabled=!1);for(var c=0;c=this.firstgid&&t>>1]).startTime)<=e&&h+r.duration>e)return r.tileid+this.firstgid;hi.width||e.height>i.height?this.updateTileData(e.width,e.height):this.updateTileData(i.width,i.height,i.x,i.y),this},setTileSize:function(t,e){return void 0!==t&&(this.tileWidth=t),void 0!==e&&(this.tileHeight=e),this.image&&this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},setSpacing:function(t,e){return void 0!==t&&(this.tileMargin=t),void 0!==e&&(this.tileSpacing=e),this.image&&this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},updateTileData:function(t,e,i,s){void 0===i&&(i=0),void 0===s&&(s=0);var r=(e-2*this.tileMargin+this.tileSpacing)/(this.tileHeight+this.tileSpacing),n=(t-2*this.tileMargin+this.tileSpacing)/(this.tileWidth+this.tileSpacing);r%1==0&&n%1==0||console.warn("Image tile area not tile size multiple in: "+this.name),r=Math.floor(r),n=Math.floor(n),this.rows=r,this.columns=n,this.total=r*n,this.texCoordinates.length=0;for(var a=this.tileMargin+i,o=this.tileMargin+s,h=0;h8388608)throw new Error("Tileset._animationDataTexture: too many animations - total number of animations plus animation frames is max 8388608, got "+f);var p=2*f,m=Math.min(p,4096),g=Math.ceil(p/4096),v=new Uint32Array(m*g),x=0,y=s.length;for(o=0;or.worldView.x+n.scaleX*i.tileWidth*(-a-.5)&&h.xr.worldView.y+n.scaleY*i.tileHeight*(-o-1)&&h.y=0;n--)for(r=s.width-1;r>=0;r--)if((a=s.data[n][r])&&a.index===t){if(o===e)return a;o+=1}}else for(n=0;na.width&&(i=Math.max(a.width-t,0)),e+r>a.height&&(r=Math.max(a.height-e,0));for(var u=[],d=e;d-1}return!1}},24152(t,e,i){var s=i(45091),r=new(i(26099));t.exports=function(t,e,i,n){n.tilemapLayer.worldToTileXY(t,e,!0,r,i);var a=r.x,o=r.y;return s(a,o,n)}},90454(t,e,i){var s=i(63448),r=i(56583);t.exports=function(t,e){var i,n,a,o,h=t.tilemapLayer.tilemap,l=t.tilemapLayer,u=Math.floor(h.tileWidth*l.scaleX),d=Math.floor(h.tileHeight*l.scaleY),c=t.hexSideLength;if("y"===t.staggerAxis){var f=(d-c)/2+c;i=r(e.worldView.x-l.x,u,0,!0)-l.cullPaddingX,n=s(e.worldView.right-l.x,u,0,!0)+l.cullPaddingX,a=r(e.worldView.y-l.y,f,0,!0)-l.cullPaddingY,o=s(e.worldView.bottom-l.y,f,0,!0)+l.cullPaddingY}else{var p=(u-c)/2+c;i=r(e.worldView.x-l.x,p,0,!0)-l.cullPaddingX,n=s(e.worldView.right-l.x,p,0,!0)+l.cullPaddingX,a=r(e.worldView.y-l.y,d,0,!0)-l.cullPaddingY,o=s(e.worldView.bottom-l.y,d,0,!0)+l.cullPaddingY}return{left:i,right:n,top:a,bottom:o}}},9474(t,e,i){var s=i(90454),r=i(32483);t.exports=function(t,e,i,n){void 0===i&&(i=[]),void 0===n&&(n=0),i.length=0;var a=t.tilemapLayer,o=s(t,e);return a.skipCull&&1===a.scrollFactorX&&1===a.scrollFactorY&&(o.left=0,o.right=t.width,o.top=0,o.bottom=t.height),r(t,o,n,i),i}},27229(t,e,i){var s=i(19951),r=i(26099),n=new r;t.exports=function(t,e,i,a){var o=a.baseTileWidth,h=a.baseTileHeight,l=a.tilemapLayer;l&&(o*=l.scaleX,h*=l.scaleY);var u,d,c=s(t,e,n,i,a),f=[],p=.5773502691896257;"y"===a.staggerAxis?(u=p*o,d=h/2):(u=o/2,d=p*h);for(var m=0;m<6;m++){var g=2*Math.PI*(.5-m)/6;f.push(new r(c.x+u*Math.cos(g),c.y+d*Math.sin(g)))}return f}},19951(t,e,i){var s=i(26099);t.exports=function(t,e,i,r,n){i||(i=new s);var a=n.baseTileWidth,o=n.baseTileHeight,h=n.tilemapLayer,l=0,u=0;h&&(r||(r=h.scene.cameras.main),l=h.x+r.scrollX*(1-h.scrollFactorX),u=h.y+r.scrollY*(1-h.scrollFactorY),a*=h.scaleX,o*=h.scaleY);var d,c,f=a/2,p=o/2,m=n.staggerAxis,g=n.staggerIndex;return"y"===m?(d=l+a*t+a,c=u+1.5*e*p+p,e%2==0&&("odd"===g?d-=f:d+=f)):"x"===m&&"odd"===g&&(d=l+1.5*t*f+f,c=u+o*t+o,t%2==0&&("odd"===g?c-=p:c+=p)),i.set(d,c)}},86625(t,e,i){var s=i(26099);t.exports=function(t,e,i,r,n,a){r||(r=new s);var o=a.baseTileWidth,h=a.baseTileHeight,l=a.tilemapLayer;l&&(n||(n=l.scene.cameras.main),t-=l.x+n.scrollX*(1-l.scrollFactorX),e-=l.y+n.scrollY*(1-l.scrollFactorY),o*=l.scaleX,h*=l.scaleY);var u,d,c,f,p,m=.5773502691896257,g=-.3333333333333333,v=.6666666666666666,x=o/2,y=h/2;"y"===a.staggerAxis?(c=m*(u=(t-x)/(m*o))+g*(d=(e-y)/y),f=0*u+v*d):(c=g*(u=(t-x)/x)+m*(d=(e-y)/(m*h)),f=v*u+0*d),p=-c-f;var T,w=Math.round(c),S=Math.round(f),b=Math.round(p),E=Math.abs(w-c),C=Math.abs(S-f),A=Math.abs(b-p);E>C&&E>A?w=-S-b:C>A&&(S=-w-b);var _=S;return T="odd"===a.staggerIndex?_%2==0?S/2+w:S/2+w-.5:_%2==0?S/2+w:S/2+w+.5,r.set(T,_)}},62991(t){t.exports=function(t,e,i){return t>=0&&t=0&&e=0;n--)(o=l[a][n])&&-1!==o.index&&o.visible&&0!==o.alpha&&(c||s(n,a,t,e))&&i.push(o);else if(2===r)for(a=p;a>=0;a--)for(n=0;n=0;a--)for(n=f;n>=0;n--)(o=l[a][n])&&-1!==o.index&&o.visible&&0!==o.alpha&&(c||s(n,a,t,e))&&i.push(o);return h.tilesDrawn=i.length,h.tilesTotal=u*d,i}},14127(t,e,i){var s=i(26099);t.exports=function(t,e,i,r,n){i||(i=new s);var a=n.baseTileWidth,o=n.baseTileHeight,h=n.tilemapLayer,l=0,u=0;h&&(r||(r=h.scene.cameras.main),l=h.x+r.scrollX*(1-h.scrollFactorX),a*=h.scaleX,u=h.y+r.scrollY*(1-h.scrollFactorY),o*=h.scaleY);var d=l+a/2*(t-e),c=u+(t+e)*(o/2);return i.set(d,c)}},96897(t,e,i){var s=i(26099);t.exports=function(t,e,i,r,n,a,o){r||(r=new s);var h=a.baseTileWidth,l=a.baseTileHeight,u=a.tilemapLayer;u&&(n||(n=u.scene.cameras.main),e-=u.y+n.scrollY*(1-u.scrollFactorY),l*=u.scaleY,t-=u.x+n.scrollX*(1-u.scrollFactorX),h*=u.scaleX);var d=h/2,c=l/2;o||(e-=l);var f=.5*((t-=d)/d+e/c),p=.5*(-t/d+e/c);return i&&(f=Math.floor(f),p=Math.floor(p)),r.set(f,p)}},71558(t,e,i){var s=i(23029),r=i(62991),n=i(72023),a=i(20576);t.exports=function(t,e,i,o,h){if(void 0===o&&(o=!0),!r(e,i,h))return null;var l,u=h.data[i][e],d=u&&u.collides;t instanceof s?(null===h.data[i][e]&&(h.data[i][e]=new s(h,t.index,e,i,h.tileWidth,h.tileHeight)),h.data[i][e].copy(t)):(l=t,null===h.data[i][e]?h.data[i][e]=new s(h,l,e,i,h.tileWidth,h.tileHeight):h.data[i][e].index=l);var c=h.data[i][e],f=-1!==h.collideIndexes.indexOf(c.index);if(-1===(l=t instanceof s?t.index:t))c.width=h.tileWidth,c.height=h.tileHeight;else{var p=h.tilemapLayer.tilemap,m=p.tiles[l][2],g=p.tilesets[m];c.width=g.tileWidth,c.height=g.tileHeight}return a(c,f),o&&d!==c.collides&&n(e,i,h),c}},26303(t,e,i){var s=i(71558),r=new(i(26099));t.exports=function(t,e,i,n,a,o){return o.tilemapLayer.worldToTileXY(e,i,!0,r,a,o),s(t,r.x,r.y,n,o)}},14051(t,e,i){var s=i(42573),r=i(71558);t.exports=function(t,e,i,n,a){if(void 0===n&&(n=!0),!Array.isArray(t))return null;Array.isArray(t[0])||(t=[t]);for(var o=t.length,h=t[0].length,l=0;l=d;r--)(a=o[n][r])&&-1!==a.index&&a.visible&&0!==a.alpha&&s.push(a);else if(2===i)for(n=p;n>=f;n--)for(r=d;o[n]&&r=f;n--)for(r=c;o[n]&&r>=d;r--)(a=o[n][r])&&-1!==a.index&&a.visible&&0!==a.alpha&&s.push(a);return u.tilesDrawn=s.length,u.tilesTotal=h*l,s}},57068(t,e,i){var s=i(20576),r=i(42573),n=i(9589);t.exports=function(t,e,i,a,o){void 0===e&&(e=!0),void 0===i&&(i=!0),void 0===o&&(o=!0),Array.isArray(t)||(t=[t]);for(var h=0;he)){for(var l=t;l<=e;l++)n(l,i,o);if(h)for(var u=0;u=t&&c.index<=e&&s(c,i)}a&&r(0,0,o.width,o.height,o)}}},75661(t,e,i){var s=i(20576),r=i(42573),n=i(9589);t.exports=function(t,e,i,a){void 0===e&&(e=!0),void 0===i&&(i=!0),Array.isArray(t)||(t=[t]);for(var o=0;o0&&s(o,t)}}e&&r(0,0,i.width,i.height,i)}},9589(t){t.exports=function(t,e,i){var s=i.collideIndexes.indexOf(t);e&&-1===s?i.collideIndexes.push(t):e||-1===s||i.collideIndexes.splice(s,1)}},20576(t){t.exports=function(t,e){e?t.setCollision(!0,!0,!0,!0,!1):t.resetCollision(!1)}},79583(t){t.exports=function(t,e,i,s){if("number"==typeof t)s.callbacks[t]=null!==e?{callback:e,callbackContext:i}:void 0;else for(var r=0,n=t.length;r-1?new r(o,f,d,u,a.tilesize,a.tilesize):e?null:new r(o,-1,d,u,a.tilesize,a.tilesize),h.push(c)}l.push(h),h=[]}o.data=l,i.push(o)}return i}},96483(t,e,i){var s=i(33629);t.exports=function(t){for(var e=[],i=[],r=0;ro&&(o=e.layer[l].width),e.layer[l].height>h&&(h=e.layer[l].height);var u=new r({width:o,height:h,name:t,tileWidth:e.layer[0].tilesize,tileHeight:e.layer[0].tilesize,format:s.WELTMEISTER});return u.layers=n(e,i),u.tilesets=a(e),u}},52833(t,e,i){t.exports={ParseTileLayers:i(6656),ParseTilesets:i(96483),ParseWeltmeister:i(87021)}},57442(t,e,i){t.exports={FromOrientationString:i(6641),Parse:i(46177),Parse2DArray:i(2342),ParseCSV:i(82593),Impact:i(52833),Tiled:i(96761)}},51233(t,e,i){var s=i(79291);t.exports=function(t){for(var e,i,r,n,a,o=0;o>>0;return s}},84101(t,e,i){var s=i(33629);t.exports=function(t){var e,i,r=[];for(e=0;e0;)if(n.i>=n.layers.length){if(i.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}n=i.pop()}else{var a=n.layers[n.i];if(n.i++,"imagelayer"===a.type){var o=s(a,"offsetx",0)+s(a,"startx",0),h=s(a,"offsety",0)+s(a,"starty",0);e.push({name:n.name+a.name,image:a.image,x:n.x+o+a.x,y:n.y+h+a.y,alpha:n.opacity*a.opacity,visible:n.visible&&a.visible,properties:s(a,"properties",{})})}else if("group"===a.type){var l=r(t,a,n);i.push(n),n=l}}return e}},46594(t,e,i){var s=i(51233),r=i(84101),n=i(91907),a=i(62644),o=i(80341),h=i(6641),l=i(87010),u=i(12635),d=i(22611),c=i(28200),f=i(24619);t.exports=function(t,e,i){var p=a(e),m=new l({width:p.width,height:p.height,name:t,tileWidth:p.tilewidth,tileHeight:p.tileheight,orientation:h(p.orientation),format:o.TILED_JSON,version:p.version,properties:p.properties,renderOrder:p.renderorder,infinite:p.infinite});if(m.orientation===n.HEXAGONAL)if(m.hexSideLength=p.hexsidelength,m.staggerAxis=p.staggeraxis,m.staggerIndex=p.staggerindex,"y"===m.staggerAxis){var g=(m.tileHeight-m.hexSideLength)/2;m.widthInPixels=m.tileWidth*(m.width+.5),m.heightInPixels=m.height*(m.hexSideLength+g)+g}else{var v=(m.tileWidth-m.hexSideLength)/2;m.widthInPixels=m.width*(m.hexSideLength+v)+v,m.heightInPixels=m.tileHeight*(m.height+.5)}m.layers=c(p,i),m.images=u(p);var x=f(p);return m.tilesets=x.tilesets,m.imageCollections=x.imageCollections,m.objects=d(p),m.tiles=r(m),s(m),m}},52205(t,e,i){var s=i(18254),r=i(29920),n=function(t){return{x:t.x,y:t.y}},a=["id","name","type","rotation","properties","visible","x","y","width","height"];t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=0);var o=s(t,a);if(o.x+=e,o.y+=i,t.gid){var h=r(t.gid);o.gid=h.gid,o.flippedHorizontal=h.flippedHorizontal,o.flippedVertical=h.flippedVertical,o.flippedAntiDiagonal=h.flippedAntiDiagonal}else t.polyline?o.polyline=t.polyline.map(n):t.polygon?o.polygon=t.polygon.map(n):t.ellipse?o.ellipse=t.ellipse:t.text?o.text=t.text:t.point?o.point=!0:o.rectangle=!0;return o}},22611(t,e,i){var s=i(95540),r=i(52205),n=i(48700),a=i(79677);t.exports=function(t){for(var e=[],i=[],o=a(t);o.i0;)if(o.i>=o.layers.length){if(i.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}o=i.pop()}else{var h=o.layers[o.i];if(o.i++,h.opacity*=o.opacity,h.visible=o.visible&&h.visible,"objectgroup"===h.type){h.name=o.name+h.name;for(var l=o.x+s(h,"startx",0)+s(h,"offsetx",0),u=o.y+s(h,"starty",0)+s(h,"offsety",0),d=[],c=0;c0;)if(f.i>=f.layers.length){if(c.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}f=c.pop()}else{var p=f.layers[f.i];if(f.i++,"tilelayer"===p.type)if(p.compression)console.warn("TilemapParser.parseTiledJSON - Layer compression is unsupported, skipping layer '"+p.name+"'");else{if(p.encoding&&"base64"===p.encoding){if(p.chunks)for(var m=0;m0?((x=new u(g,v.gid,D,I,t.tilewidth,t.tileheight)).rotation=v.rotation,x.flipX=v.flipped,S[I][D]=x):(y=e?null:new u(g,-1,D,I,t.tilewidth,t.tileheight),S[I][D]=y),++b===M.width&&(P++,b=0)}}else{(g=new h({name:f.name+p.name,id:p.id,x:f.x+o(p,"offsetx",0)+p.x,y:f.y+o(p,"offsety",0)+p.y,width:p.width,height:p.height,tileWidth:t.tilewidth,tileHeight:t.tileheight,alpha:f.opacity*p.opacity,visible:f.visible&&p.visible,properties:o(p,"properties",[]),orientation:a(t.orientation)})).orientation===r.HEXAGONAL&&(g.hexSideLength=t.hexsidelength,g.staggerAxis=t.staggeraxis,g.staggerIndex=t.staggerindex,"y"===g.staggerAxis?(T=(g.tileHeight-g.hexSideLength)/2,g.widthInPixels=g.tileWidth*(g.width+.5),g.heightInPixels=g.height*(g.hexSideLength+T)+T):(w=(g.tileWidth-g.hexSideLength)/2,g.widthInPixels=g.width*(g.hexSideLength+w)+w,g.heightInPixels=g.tileHeight*(g.height+.5)));for(var N=[],B=0,k=p.data.length;B0?((x=new u(g,v.gid,b,S.length,t.tilewidth,t.tileheight)).rotation=v.rotation,x.flipX=v.flipped,N.push(x)):(y=e?null:new u(g,-1,b,S.length,t.tilewidth,t.tileheight),N.push(y)),++b===p.width&&(S.push(N),b=0,N=[])}g.data=S,d.push(g)}else if("group"===p.type){var U=n(t,p,f);c.push(f),f=U}}return d}},24619(t,e,i){var s=i(33629),r=i(16536),n=i(52205),a=i(57880);t.exports=function(t){for(var e,i=[],o=[],h=null,l=0;l1){var c=void 0,f=void 0;if(Array.isArray(u.tiles)){c=c||{},f=f||{};for(var p=0;p0){var n,a,o,h={},l={};if(Array.isArray(s.edgecolors))for(n=0;n0)throw new Error("TimerEvent infinite loop created via zero delay")}else e=new a(t);return this._pendingInsertion.push(e),e},delayedCall:function(t,e,i,s){return this.addEvent({delay:t,callback:e,args:i,callbackScope:s})},clearPendingEvents:function(){return this._pendingInsertion=[],this},removeEvent:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e-1&&this._active.splice(r,1),s.destroy()}for(i=0;i=s.delay)){var r=s.elapsed-s.delay;if(s.elapsed=s.delay,!s.hasDispatched&&s.callback&&(s.hasDispatched=!0,s.callback.apply(s.callbackScope,s.args)),s.repeatCount>0){if(s.repeatCount--,r>=s.delay)for(;r>=s.delay&&s.repeatCount>0;)s.callback&&s.callback.apply(s.callbackScope,s.args),r-=s.delay,s.repeatCount--;s.elapsed=r,s.hasDispatched=!1}else s.hasDispatched&&this._pendingRemoval.push(s)}}}},shutdown:function(){var t;for(t=0;t0||this.totalComplete>0)&&(0!==this.loop&&(-1===this.loop||this.loop>this.iteration)?(this.iteration++,this.reset(!0)):this.complete=!0),this.complete&&this.emit(h.COMPLETE,this)}},play:function(t){return void 0===t&&(t=!0),this.paused=!1,this.complete=!1,this.totalComplete=0,t&&this.reset(),this},pause:function(){this.paused=!0;for(var t=this.events,e=0;e0&&(i=e[e.length-1].time);for(var s=0;s0)throw new Error("TimerEvent infinite loop created via zero delay");return this},getProgress:function(){return this.elapsed/this.delay},getOverallProgress:function(){if(this.repeat>0){var t=this.delay+this.delay*this.repeat;return(this.elapsed+this.delay*(this.repeat-this.repeatCount))/t}return this.getProgress()},getRepeatCount:function(){return this.repeatCount},getElapsed:function(){return this.elapsed},getElapsedSeconds:function(){return.001*this.elapsed},getRemaining:function(){return this.delay-this.elapsed},getRemainingSeconds:function(){return.001*this.getRemaining()},getOverallRemaining:function(){return this.delay*(1+this.repeatCount)-this.elapsed},getOverallRemainingSeconds:function(){return.001*this.getOverallRemaining()},remove:function(t){void 0===t&&(t=!1),this.elapsed=this.delay,this.hasDispatched=!t,this.repeatCount=0},destroy:function(){this.callback=void 0,this.callbackScope=void 0,this.args=[]}});t.exports=n},35945(t){t.exports="complete"},89809(t,e,i){t.exports={COMPLETE:i(35945)}},90291(t,e,i){t.exports={Clock:i(33385),Events:i(89809),Timeline:i(96120),TimerEvent:i(94880)}},40382(t,e,i){var s=i(72905),r=i(83419),n=i(43491),a=i(88032),o=i(37277),h=i(44594),l=i(93109),u=i(8462),d=i(8357),c=i(43960),f=i(26012),p=new r({initialize:function(t){this.scene=t,this.events=t.sys.events,this.timeScale=1,this.paused=!1,this.processing=!1,this.tweens=[],this.time=0,this.startTime=0,this.nextTime=0,this.prevTime=0,this.maxLag=500,this.lagSkip=33,this.gap=1e3/240,this.events.once(h.BOOT,this.boot,this),this.events.on(h.START,this.start,this)},boot:function(){this.events.once(h.DESTROY,this.destroy,this)},start:function(){this.timeScale=1,this.paused=!1,this.startTime=Date.now(),this.prevTime=this.startTime,this.nextTime=this.gap,this.events.on(h.UPDATE,this.update,this),this.events.once(h.SHUTDOWN,this.shutdown,this)},create:function(t){Array.isArray(t)||(t=[t]);for(var e=[],i=0;i-1},existing:function(t){return this.has(t)||this.tweens.push(t.reset()),this},addCounter:function(t){var e=a(this,t);return this.tweens.push(e.reset()),e},stagger:function(t,e){return l(t,e)},setLagSmooth:function(t,e){return void 0===t&&(t=1/1e-8),void 0===e&&(e=0),this.maxLag=t,this.lagSkip=Math.min(e,this.maxLag),this},setFps:function(t){return void 0===t&&(t=240),this.gap=1e3/t,this.nextTime=1e3*this.time+this.gap,this},getDelta:function(t){var e=Date.now()-this.prevTime;e>this.maxLag&&(this.startTime+=e-this.lagSkip),this.prevTime+=e;var i=this.prevTime-this.startTime,s=i-this.nextTime,r=i-1e3*this.time;return s>0||t?(i/=1e3,this.time=i,this.nextTime+=s+(s>=this.gap?4:this.gap-s)):r=0,r},tick:function(){return this.step(!0),this},update:function(){this.paused||this.step(!1)},step:function(t){void 0===t&&(t=!1);var e=this.getDelta(t);if(!(e<=0)){var i,s;this.processing=!0;var r=[],n=this.tweens;for(i=0;i0){for(i=0;i-1&&(s.isPendingRemove()||s.isDestroyed())&&(n.splice(o,1),s.destroy())}r.length=0}this.processing=!1}},remove:function(t){return this.processing?t.setPendingRemoveState():(s(this.tweens,t),t.setRemovedState()),this},reset:function(t){return this.existing(t),t.seek(),t.setActiveState(),this},makeActive:function(t){return this.existing(t),t.setActiveState(),this},each:function(t,e){var i,s=[null];for(i=1;iC&&(C=M),E[A][_]=M}}}var R=o?s(o):null;return i=h?function(t,e,i,s){var r,n=0,o=s%x,h=Math.floor(s/x);if(o>=0&&o=0&&ht&&(this.loopCounter=t),this},remove:function(){return this.parent&&this.parent.remove(this),this},stop:function(){return!this.parent||this.isRemoved()||this.isPendingRemove()||this.isDestroyed()||(this.dispatchEvent(n.TWEEN_STOP,"onStop"),this.setPendingRemoveState()),this},updateLoopCountdown:function(t){this.countdown-=t,this.countdown<=0&&(this.setActiveState(),this.dispatchEvent(n.TWEEN_LOOP,"onLoop"))},updateStartCountdown:function(t){return this.countdown-=t,this.countdown<=0&&(this.hasStarted=!0,this.setActiveState(),this.dispatchEvent(n.TWEEN_START,"onStart"),t=0),t},updateCompleteDelay:function(t){this.countdown-=t,this.countdown<=0&&this.onCompleteHandler()},setCallback:function(t,e,i){return void 0===i&&(i=[]),this.callbacks.hasOwnProperty(t)&&(this.callbacks[t]={func:e,params:i}),this},setPendingState:function(){this.state=a.PENDING},setActiveState:function(){this.state=a.ACTIVE,this.hasStarted=!1},setLoopDelayState:function(){this.state=a.LOOP_DELAY},setCompleteDelayState:function(){this.state=a.COMPLETE_DELAY},setStartDelayState:function(){this.state=a.START_DELAY,this.countdown=this.startDelay,this.hasStarted=!1},setPendingRemoveState:function(){this.state=a.PENDING_REMOVE},setRemovedState:function(){this.state=a.REMOVED},setFinishedState:function(){this.state=a.FINISHED},setDestroyedState:function(){this.state=a.DESTROYED},isPending:function(){return this.state===a.PENDING},isActive:function(){return this.state===a.ACTIVE},isLoopDelayed:function(){return this.state===a.LOOP_DELAY},isCompleteDelayed:function(){return this.state===a.COMPLETE_DELAY},isStartDelayed:function(){return this.state===a.START_DELAY},isPendingRemove:function(){return this.state===a.PENDING_REMOVE},isRemoved:function(){return this.state===a.REMOVED},isFinished:function(){return this.state===a.FINISHED},isDestroyed:function(){return this.state===a.DESTROYED},destroy:function(){this.data&&this.data.forEach(function(t){t.destroy()}),this.removeAllListeners(),this.callbacks=null,this.data=null,this.parent=null,this.setDestroyedState()}});o.TYPES=["onActive","onComplete","onLoop","onPause","onRepeat","onResume","onStart","onStop","onUpdate","onYoyo"],t.exports=o},95042(t,e,i){var s=i(83419),r=i(842),n=i(86353),a=new s({initialize:function(t,e,i,s,r,n,a,o,h,l){this.tween=t,this.targetIndex=e,this.duration=s<=0?.01:s,this.totalDuration=0,this.delay=0,this.getDelay=i,this.yoyo=r,this.hold=n,this.repeat=a,this.repeatDelay=o,this.repeatCounter=0,this.flipX=h,this.flipY=l,this.progress=0,this.elapsed=0,this.state=0,this.isCountdown=!1},getTarget:function(){return this.tween.targets[this.targetIndex]},setTargetValue:function(t){void 0===t&&(t=this.current),this.tween.targets[this.targetIndex][this.key]=t},setCreatedState:function(){this.state=n.CREATED,this.isCountdown=!1},setDelayState:function(){this.state=n.DELAY,this.isCountdown=!0},setPendingRenderState:function(){this.state=n.PENDING_RENDER,this.isCountdown=!1},setPlayingForwardState:function(){this.state=n.PLAYING_FORWARD,this.isCountdown=!1},setPlayingBackwardState:function(){this.state=n.PLAYING_BACKWARD,this.isCountdown=!1},setHoldState:function(){this.state=n.HOLD_DELAY,this.isCountdown=!0},setRepeatState:function(){this.state=n.REPEAT_DELAY,this.isCountdown=!0},setCompleteState:function(){this.state=n.COMPLETE,this.isCountdown=!1},isCreated:function(){return this.state===n.CREATED},isDelayed:function(){return this.state===n.DELAY},isPendingRender:function(){return this.state===n.PENDING_RENDER},isPlayingForward:function(){return this.state===n.PLAYING_FORWARD},isPlayingBackward:function(){return this.state===n.PLAYING_BACKWARD},isHolding:function(){return this.state===n.HOLD_DELAY},isRepeating:function(){return this.state===n.REPEAT_DELAY},isComplete:function(){return this.state===n.COMPLETE},setStateFromEnd:function(t){this.yoyo?this.onRepeat(t,!0,!0):this.repeatCounter>0?this.onRepeat(t,!0,!1):this.setCompleteState()},setStateFromStart:function(t){this.repeatCounter>0?this.onRepeat(t,!1):this.setCompleteState()},reset:function(){var t=this.tween,e=t.totalTargets,i=this.targetIndex,s=t.targets[i],r=this.key;this.progress=0,this.elapsed=0,this.delay=this.getDelay(s,r,0,i,e,t),this.repeatCounter=-1===this.repeat?n.MAX:this.repeat,this.setPendingRenderState();var a=this.duration+this.hold;this.yoyo&&(a+=this.duration);var o=a+this.repeatDelay;this.totalDuration=this.delay+a,-1===this.repeat?(this.totalDuration+=o*n.MAX,t.isInfinite=!0):this.repeat>0&&(this.totalDuration+=o*this.repeat),this.totalDuration>t.duration&&(t.duration=this.totalDuration),this.delay0&&(this.elapsed=this.delay,this.setDelayState())},onRepeat:function(t,e,i){var s=this.tween,n=s.totalTargets,a=this.targetIndex,o=s.targets[a],h=this.key,l="texture"!==h;if(this.elapsed=t,this.progress=t/this.duration,this.flipX&&o.toggleFlipX(),this.flipY&&o.toggleFlipY(),l&&(e||i)&&(this.start=this.getStartValue(o,h,this.start,a,n,s)),i)return this.setPlayingBackwardState(),void this.dispatchEvent(r.TWEEN_YOYO,"onYoyo");this.repeatCounter--,l&&(this.end=this.getEndValue(o,h,this.start,a,n,s)),this.repeatDelay>0?(this.elapsed=this.repeatDelay-t,l&&(this.current=this.start,o[h]=this.current),this.setRepeatState()):(this.setPlayingForwardState(),this.dispatchEvent(r.TWEEN_REPEAT,"onRepeat"))},destroy:function(){this.tween=null,this.getDelay=null,this.setCompleteState()}});t.exports=a},69902(t){t.exports={targets:null,delay:0,duration:1e3,ease:"Power0",easeParams:null,hold:0,repeat:0,repeatDelay:0,yoyo:!1,flipX:!1,flipY:!1,persist:!1,interpolation:null}},81076(t){t.exports=["callbackScope","completeDelay","delay","duration","ease","easeParams","flipX","flipY","hold","interpolation","loop","loopDelay","onActive","onActiveParams","onComplete","onCompleteParams","onLoop","onLoopParams","onPause","onPauseParams","onRepeat","onRepeatParams","onResume","onResumeParams","onStart","onStartParams","onStop","onStopParams","onUpdate","onUpdateParams","onYoyo","onYoyoParams","paused","persist","props","repeat","repeatDelay","targets","yoyo"]},8462(t,e,i){var s=i(70402),r=i(83419),n=i(842),a=i(44603),o=i(39429),h=i(36383),l=i(86353),u=i(48177),d=i(42220),c=new r({Extends:s,initialize:function(t,e){s.call(this,t),this.targets=e,this.totalTargets=e.length,this.isSeeking=!1,this.isInfinite=!1,this.elapsed=0,this.totalElapsed=0,this.duration=0,this.progress=0,this.totalDuration=0,this.totalProgress=0,this.isNumberTween=!1},add:function(t,e,i,s,r,n,a,o,h,l,d,c,f,p,m,g){var v=new u(this,t,e,i,s,r,n,a,o,h,l,d,c,f,p,m,g);return this.totalData=this.data.push(v),v},addFrame:function(t,e,i,s,r,n,a,o,h,l){var u=new d(this,t,e,i,s,r,n,a,o,h,l);return this.totalData=this.data.push(u),u},getValue:function(t){void 0===t&&(t=0);var e=null;return this.data&&(e=this.data[t].current),e},hasTarget:function(t){return this.targets&&-1!==this.targets.indexOf(t)},updateTo:function(t,e,i){if(void 0===i&&(i=!1),"texture"!==t)for(var s=0;s0)this.elapsed=0,this.progress=0,this.loopCounter--,this.initTweenData(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.setLoopDelayState()):(this.setActiveState(),this.dispatchEvent(n.TWEEN_LOOP,"onLoop"));else{if(!(this.completeDelay>0))return this.onCompleteHandler(),!0;this.countdown=this.completeDelay,this.setCompleteDelayState()}return!1},onCompleteHandler:function(){this.progress=1,this.totalProgress=1,s.prototype.onCompleteHandler.call(this)},play:function(){return this.isDestroyed()?(console.warn("Cannot play destroyed Tween",this),this):((this.isPendingRemove()||this.isFinished())&&this.seek(),this.paused=!1,this.setActiveState(),this)},seek:function(t,e,i){if(void 0===t&&(t=0),void 0===e&&(e=16.6),void 0===i&&(i=!1),this.isDestroyed())return console.warn("Cannot seek destroyed Tween",this),this;i||(this.isSeeking=!0),this.reset(!0),this.initTweenData(!0),this.setActiveState(),this.dispatchEvent(n.TWEEN_ACTIVE,"onActive");var s=this.paused;if(this.paused=!1,t>0){for(var r=Math.floor(t/e),a=t-r*e,o=0;o0&&this.update(a)}return this.paused=s,this.isSeeking=!1,this},initTweenData:function(t){void 0===t&&(t=!1),this.duration=0,this.startDelay=h.MAX_SAFE_INTEGER;for(var e=this.data,i=0;i0?s+r+(s+a)*n:s+r},reset:function(t){return void 0===t&&(t=!1),this.elapsed=0,this.totalElapsed=0,this.progress=0,this.totalProgress=0,this.loopCounter=this.loop,-1===this.loop&&(this.isInfinite=!0,this.loopCounter=l.MAX),t||(this.initTweenData(),this.setActiveState(),this.dispatchEvent(n.TWEEN_ACTIVE,"onActive")),this},update:function(t){if(this.isPendingRemove()||this.isDestroyed())return!this.persist||(this.setFinishedState(),!1);if(this.paused||this.isFinished())return!1;if(t*=this.timeScale*this.parent.timeScale,this.isLoopDelayed())return this.updateLoopCountdown(t),!1;if(this.isCompleteDelayed())return this.updateCompleteDelay(t),!1;this.hasStarted||(this.startDelay-=t,this.startDelay<=0&&(this.hasStarted=!0,this.dispatchEvent(n.TWEEN_START,"onStart"),t=0));var e=!1;if(this.isActive())for(var i=this.data,s=0;s0&&!this.isStartDelayed()?this.setStartDelayState():this.setActiveState(),this},add:function(t){var e=this.parent.create(t);Array.isArray(e)||(e=[e]);for(var i=this.data,s=0;s0)this.loopCounter--,this.resetTweens(),this.loopDelay>0?(this.countdown=this.loopDelay,this.setLoopDelayState()):(this.setActiveState(),this.dispatchEvent(a.TWEEN_LOOP,"onLoop"));else{if(!(this.completeDelay>0))return this.onCompleteHandler(),!0;this.countdown=this.completeDelay,this.setCompleteDelayState()}return!1},play:function(){return this.isDestroyed()?(console.warn("Cannot play destroyed TweenChain",this),this):((this.isPendingRemove()||this.isPending())&&this.resetTweens(),this.paused=!1,this.startDelay>0&&!this.isStartDelayed()?this.setStartDelayState():this.setActiveState(),this)},resetTweens:function(){for(var t=this.data,e=this.totalData,i=0;i=d?(c=u-d,u=d,f=!0):u<0&&(u=0);var p=r(u/d,0,1);this.elapsed=u,this.progress=p,this.previous=this.current,h||(p=1-p);var m=this.ease(p);this.interpolation?this.current=this.interpolation(this.interpolationData,m):this.current=this.start+(this.end-this.start)*m,n[o]=this.current,f&&(h?(e.isNumberTween&&(this.current=this.end,n[o]=this.current),this.hold>0?(this.elapsed=this.hold,this.setHoldState()):this.setStateFromEnd(c)):(e.isNumberTween&&(this.current=this.start,n[o]=this.current),this.setStateFromStart(c))),this.dispatchEvent(a.TWEEN_UPDATE,"onUpdate")}return!this.isComplete()},dispatchEvent:function(t,e){var i=this.tween;if(!i.isSeeking){var s=i.targets[this.targetIndex],r=this.key,n=this.current,a=this.previous;i.emit(t,i,r,s,n,a);var o=i.callbacks[e];o&&o.func.apply(i.callbackScope,[i,s,r,n,a].concat(o.params))}},destroy:function(){s.prototype.destroy.call(this),this.getActiveValue=null,this.getEndValue=null,this.getStartValue=null,this.ease=null}});t.exports=o},42220(t,e,i){var s=i(95042),r=i(45319),n=i(83419),a=i(842),o=new n({Extends:s,initialize:function(t,e,i,r,n,a,o,h,l,u,d){s.call(this,t,e,n,a,!1,o,h,l,u,d),this.key="texture",this.startTexture=null,this.endTexture=i,this.startFrame=null,this.endFrame=r,this.yoyo=0!==h},reset:function(t){s.prototype.reset.call(this);var e=this.tween.targets[this.targetIndex];this.startTexture||(this.startTexture=e.texture.key,this.startFrame=e.frame.name),t&&e.setTexture(this.startTexture,this.startFrame)},update:function(t){var e=this.tween,i=this.targetIndex,s=e.targets[i];if(!s)return this.setCompleteState(),!1;if(this.isCountdown&&(this.elapsed-=t,this.elapsed<=0&&(this.elapsed=0,t=0,this.isDelayed()?this.setPendingRenderState():this.isRepeating()?(this.setPlayingForwardState(),this.dispatchEvent(a.TWEEN_REPEAT,"onRepeat")):this.isHolding()&&this.setStateFromEnd(0))),this.isPendingRender())return this.startTexture&&s.setTexture(this.startTexture,this.startFrame),this.setPlayingForwardState(),!0;var n=this.isPlayingForward(),o=this.isPlayingBackward();if(n||o){var h=this.elapsed,l=this.duration,u=0,d=!1;(h+=t)>=l?(u=h-l,h=l,d=!0):h<0&&(h=0);var c=r(h/l,0,1);this.elapsed=h,this.progress=c,d&&(n?(s.setTexture(this.endTexture,this.endFrame),this.hold>0?(this.elapsed=this.hold,this.setHoldState()):this.setStateFromEnd(u)):(s.setTexture(this.startTexture,this.startFrame),this.setStateFromStart(u))),this.dispatchEvent(a.TWEEN_UPDATE,"onUpdate")}return!this.isComplete()},dispatchEvent:function(t,e){var i=this.tween;if(!i.isSeeking){var s=i.targets[this.targetIndex],r=this.key;i.emit(t,i,r,s);var n=i.callbacks[e];n&&n.func.apply(i.callbackScope,[i,s,r].concat(n.params))}},destroy:function(){s.prototype.destroy.call(this),this.startTexture=null,this.endTexture=null,this.startFrame=null,this.endFrame=null}});t.exports=o},86353(t){t.exports={CREATED:0,DELAY:2,PENDING_RENDER:4,PLAYING_FORWARD:5,PLAYING_BACKWARD:6,HOLD_DELAY:7,REPEAT_DELAY:8,COMPLETE:9,PENDING:20,ACTIVE:21,LOOP_DELAY:22,COMPLETE_DELAY:23,START_DELAY:24,PENDING_REMOVE:25,REMOVED:26,FINISHED:27,DESTROYED:28,MAX:999999999999}},83419(t){function e(t,e,i){var s=i?t[e]:Object.getOwnPropertyDescriptor(t,e);return!i&&s.value&&"object"==typeof s.value&&(s=s.value),!(!s||!function(t){return!!t.get&&"function"==typeof t.get||!!t.set&&"function"==typeof t.set}(s))&&(void 0===s.enumerable&&(s.enumerable=!0),void 0===s.configurable&&(s.configurable=!0),s)}function i(t,e){var i=Object.getOwnPropertyDescriptor(t,e);return!!i&&(i.value&&"object"==typeof i.value&&(i=i.value),!1===i.configurable)}function s(t,s,r,a){for(var o in s)if(s.hasOwnProperty(o)){var h=e(s,o,r);if(!1!==h){if(i((a||t).prototype,o)){if(n.ignoreFinals)continue;throw new Error("cannot override final property '"+o+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,o,h)}else t.prototype[o]=s[o]}}function r(t,e){if(e){Array.isArray(e)||(e=[e]);for(var i=0;i0){var n=i-t.length;if(n<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.push(e),s&&s.call(r,e),e):null;for(var a=e.length-1;a>=0;)-1!==t.indexOf(e[a])&&e.splice(a,1),a--;if(0===(a=e.length))return null;i>0&&a>n&&(e.splice(n),a=n);for(var o=0;o0){var a=s-t.length;if(a<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.splice(i,0,e),r&&r.call(n,e),e):null;for(var o=e.length-1;o>=0;)-1!==t.indexOf(e[o])&&e.pop(),o--;if(0===(o=e.length))return null;s>0&&o>a&&(e.splice(a),o=a);for(var h=o-1;h>=0;h--){var l=e[h];t.splice(i,0,l),r&&r.call(n,l)}return e}},66905(t){t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&ie.length&&(n=e.length),i?(s=e[n-1][i],(r=e[n][i])-t<=t-s?e[n]:e[n-1]):(s=e[n-1],(r=e[n])-t<=t-s?r:s)}},43491(t){var e=function(t,i){void 0===i&&(i=[]);for(var s=0;s=0;a--)if(o=t[a],!e||e&&void 0===i&&o.hasOwnProperty(e)||e&&void 0!==i&&o[e]===i)return o;return null}},26546(t){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var s=e+Math.floor(Math.random()*(i-e));return void 0===t[s]?null:t[s]}},85835(t){t.exports=function(t,e,i){if(e===i)return t;var s=t.indexOf(e),r=t.indexOf(i);if(s<0||r<0)throw new Error("Supplied items must be elements of the same array");return s>r||(t.splice(s,1),r=t.indexOf(i),t.splice(r+1,0,e)),t}},83371(t){t.exports=function(t,e,i){if(e===i)return t;var s=t.indexOf(e),r=t.indexOf(i);if(s<0||r<0)throw new Error("Supplied items must be elements of the same array");return s0){var s=t[i-1],r=t.indexOf(s);t[i]=s,t[r]=e}return t}},69693(t){t.exports=function(t,e,i){var s=t.indexOf(e);if(-1===s||i<0||i>=t.length)throw new Error("Supplied index out of bounds");return s!==i&&(t.splice(s,1),t.splice(i,0,e)),e}},40853(t){t.exports=function(t,e){var i=t.indexOf(e);if(-1!==i&&i=e;r--)a?n.push(i+r.toString()+s):n.push(r);else for(r=t;r<=e;r++)a?n.push(i+r.toString()+s):n.push(r);return n}},593(t,e,i){var s=i(2284);t.exports=function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=null),void 0===i&&(i=1),null===e&&(e=t,t=0);for(var r=[],n=Math.max(s((e-t)/(i||1)),0),a=0;ae?1:0}var s=function(t,r,n,a,o){for(void 0===n&&(n=0),void 0===a&&(a=t.length-1),void 0===o&&(o=i);a>n;){if(a-n>600){var h=a-n+1,l=r-n+1,u=Math.log(h),d=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*d*(h-d)/h)*(l-h/2<0?-1:1),f=Math.max(n,Math.floor(r-l*d/h+c)),p=Math.min(a,Math.floor(r+(h-l)*d/h+c));s(t,r,f,p,o)}var m=t[r],g=n,v=a;for(e(t,n,r),o(t[a],m)>0&&e(t,n,a);g0;)v--}0===o(t[n],m)?e(t,n,v):e(t,++v,a),v<=r&&(n=v+1),r<=v&&(a=v-1)}};t.exports=s},88492(t,e,i){var s=i(35154),r=i(33680),n=function(t,e,i){for(var s=[],r=0;r=0;){var h=e[a];-1!==(n=t.indexOf(h))&&(s(t,n),o.push(h),i&&i.call(r,h)),a--}return o}},60248(t,e,i){var s=i(19133);t.exports=function(t,e,i,r){if(void 0===r&&(r=t),e<0||e>t.length-1)throw new Error("Index out of bounds");var n=s(t,e);return i&&i.call(r,n),n}},81409(t,e,i){var s=i(82011);t.exports=function(t,e,i,r,n){if(void 0===e&&(e=0),void 0===i&&(i=t.length),void 0===n&&(n=t),s(t,e,i)){var a=i-e,o=t.splice(e,a);if(r)for(var h=0;h=r||e>=i||i>r){if(s)throw new Error("Range Error: Values outside acceptable range");return!1}return!0}},89545(t){t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i>0&&(t.splice(i,1),t.unshift(e)),e}},17810(t,e,i){var s=i(82011);t.exports=function(t,e,i,r,n){if(void 0===r&&(r=0),void 0===n&&(n=t.length),s(t,r,n))for(var a=r;a0;e--){var i=Math.floor(Math.random()*(e+1)),s=t[e];t[e]=t[i],t[i]=s}return t}},90126(t){t.exports=function(t){var e=/\D/g;return t.sort(function(t,i){return parseInt(t.replace(e,""),10)-parseInt(i.replace(e,""),10)}),t}},19133(t){t.exports=function(t,e){if(!(e>=t.length)){for(var i=t.length-1,s=t[e],r=e;rl&&(n=l),a>l&&(a=l),o=r,h=n;;)if(o-1;n--)s[r][n]=t[n][r]}return s}},54915(t,e,i){t.exports={CheckMatrix:i(86922),MatrixToString:i(63362),ReverseColumns:i(92598),ReverseRows:i(21224),Rotate180:i(98717),RotateLeft:i(44657),RotateMatrix:i(37829),RotateRight:i(92632),Translate:i(69512),TransposeMatrix:i(2429)}},71334(t){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";t.exports=function(t,i){for(var s=new Uint8Array(t),r=s.length,n=i?"data:"+i+";base64,":"",a=0;a>2],n+=e[(3&s[a])<<4|s[a+1]>>4],n+=e[(15&s[a+1])<<2|s[a+2]>>6],n+=e[63&s[a+2]];return r%3==2?n=n.substring(0,n.length-1)+"=":r%3==1&&(n=n.substring(0,n.length-2)+"=="),n}},53134(t){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=new Uint8Array(256),s=0;s<64;s++)i[e.charCodeAt(s)]=s;t.exports=function(t){var e,s,r,n,a=(t=t.substr(t.indexOf(",")+1)).length,o=.75*a,h=0;"="===t[a-1]&&(o--,"="===t[a-2]&&o--);for(var l=new ArrayBuffer(o),u=new Uint8Array(l),d=0;d>4,u[h++]=(15&s)<<4|r>>2,u[h++]=(3&r)<<6|63&n;return l}},65839(t,e,i){t.exports={ArrayBufferToBase64:i(71334),Base64ToArrayBuffer:i(53134)}},91799(t,e,i){t.exports={Array:i(37105),Base64:i(65839),Objects:i(1183),String:i(31749),NOOP:i(29747),NULL:i(20242)}},41786(t){t.exports=function(t){var e={};for(var i in t)Array.isArray(t[i])?e[i]=t[i].slice(0):e[i]=t[i];return e}},62644(t){var e=function(t){var i,s,r;if("object"!=typeof t||null===t)return t;for(r in i=Array.isArray(t)?[]:{},t)s=t[r],i[r]=e(s);return i};t.exports=e},79291(t,e,i){var s=i(41212),r=function(){var t,e,i,n,a,o,h=arguments[0]||{},l=1,u=arguments.length,d=!1;for("boolean"==typeof h&&(d=h,h=arguments[1]||{},l=2),u===l&&(h=this,--l);l=(t=t.toString()).length)switch(s){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var n=Math.ceil((r=e-t.length)/2);t=new Array(r-n+1).join(i)+t+new Array(n+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t}},33628(t){t.exports=function(t,e){return 0===e?t.slice(1):t.slice(0,e)+t.slice(e+1)}},27671(t){t.exports=function(t){return t.split("").reverse().join("")}},45650(t){t.exports=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})}},35355(t){t.exports=function(t){return t&&t[0].toUpperCase()+t.slice(1)}},31749(t,e,i){t.exports={Format:i(27902),Pad:i(41836),RemoveAt:i(33628),Reverse:i(27671),UppercaseFirst:i(35355),UUID:i(45650)}}},e={};function i(s){var r=e[s];if(void 0!==r)return r.exports;var n=e[s]={exports:{}};return t[s](n,n.exports,i),n.exports}return i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var s in e)i.o(e,s)&&!i.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i(97139)})()); \ No newline at end of file diff --git a/dist/phaser.esm.js b/dist/phaser.esm.js index bb71b9c774..1fbded1b7b 100644 --- a/dist/phaser.esm.js +++ b/dist/phaser.esm.js @@ -1,5 +1,1803 @@ /******/ var __webpack_modules__ = ({ +/***/ 7889 +(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Depth: () => (/* binding */ Depth), +/* harmony export */ DepthDescriptors: () => (/* binding */ DepthDescriptors), +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_Mixin_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(42969); +/* harmony import */ var _utils_array_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(37105); +/* harmony import */ var _utils_array_index_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_utils_array_index_js__WEBPACK_IMPORTED_MODULE_1__); + +/** + * @author Richard Davey + * @copyright 2013-2026 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + + +const DepthDescriptors = { + _depth: 0, + depth: { + get: function() { + return this._depth; + }, + set: function(value) { + if (this.displayList) { + this.displayList.queueDepthSort(); + } + this._depth = value; + } + }, + setDepth: function(value) { + if (value === void 0) { + value = 0; + } + this.depth = value; + return this; + }, + setToTop: function() { + const list = this.getDisplayList(); + if (list) { + _utils_array_index_js__WEBPACK_IMPORTED_MODULE_1___default().BringToTop(list, this); + } + return this; + }, + setToBack: function() { + const list = this.getDisplayList(); + if (list) { + _utils_array_index_js__WEBPACK_IMPORTED_MODULE_1___default().SendToBack(list, this); + } + return this; + }, + setAbove: function(gameObject) { + const list = this.getDisplayList(); + if (list && gameObject) { + _utils_array_index_js__WEBPACK_IMPORTED_MODULE_1___default().MoveAbove(list, this, gameObject); + } + return this; + }, + setBelow: function(gameObject) { + const list = this.getDisplayList(); + if (list && gameObject) { + _utils_array_index_js__WEBPACK_IMPORTED_MODULE_1___default().MoveBelow(list, this, gameObject); + } + return this; + } +}; +const Depth = (0,_utils_Mixin_js__WEBPACK_IMPORTED_MODULE_0__/* .defineMixin */ .lv)()(function Depth2(Base) { + (0,_utils_Mixin_js__WEBPACK_IMPORTED_MODULE_0__/* .applyMixin */ .AD)(Base, DepthDescriptors); + return Base; +}); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Depth); + + +/***/ }, + +/***/ 36626 +(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Visible: () => (/* binding */ Visible), +/* harmony export */ VisibleDescriptors: () => (/* binding */ VisibleDescriptors), +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_Mixin_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(42969); + +/** + * @author Richard Davey + * @copyright 2013-2026 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +const _FLAG = 1; +const VisibleDescriptors = { + _visible: true, + visible: { + get: function() { + return this._visible; + }, + set: function(value) { + if (value) { + this._visible = true; + this.renderFlags |= _FLAG; + } else { + this._visible = false; + this.renderFlags &= ~_FLAG; + } + } + }, + setVisible: function(value) { + this.visible = value; + return this; + } +}; +const Visible = (0,_utils_Mixin_js__WEBPACK_IMPORTED_MODULE_0__/* .defineMixin */ .lv)()(function Visible2(Base) { + (0,_utils_Mixin_js__WEBPACK_IMPORTED_MODULE_0__/* .applyMixin */ .AD)(Base, VisibleDescriptors); + return Base; +}); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Visible); + + +/***/ }, + +/***/ 18134 +(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* unused harmony export NineSliceVertex */ +/* harmony import */ var _math_Vector2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(70038); + +/** + * @author Richard Davey + * @copyright 2013-2026 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +class NineSliceVertex extends _math_Vector2_js__WEBPACK_IMPORTED_MODULE_0__["default"] { + /** + * @param x - The x position of the vertex. + * @param y - The y position of the vertex. + * @param u - The UV u coordinate of the vertex. + * @param v - The UV v coordinate of the vertex. + */ + constructor(x, y, u, v) { + super(x, y); + this.vx = 0; + this.vy = 0; + this.u = u; + this.v = v; + } + /** + * Sets the UV texture coordinates of this vertex. + * + * @since 4.0.0 + * + * @param u - The UV u coordinate of the vertex. + * @param v - The UV v coordinate of the vertex. + * + * @return This Vertex. + */ + setUVs(u, v) { + this.u = u; + this.v = v; + return this; + } + /** + * Updates this vertex's position and calculates its projected screen-space coordinates. + * + * Sets the normalized `x` and `y` position, then scales them by the parent object's + * `width` and `height` to produce the projected `vx` and `vy` values. The origin + * offset of the parent object is then factored in, shifting `vx` and `vy` so that the + * mesh is correctly aligned relative to the object's origin point. + * + * @since 4.0.0 + * + * @param x - The x position of the vertex. + * @param y - The y position of the vertex. + * @param width - The width of the parent object. + * @param height - The height of the parent object. + * @param originX - The originX of the parent object. + * @param originY - The originY of the parent object. + * + * @return This Vertex. + */ + resize(x, y, width, height, originX, originY) { + this.x = x; + this.y = y; + this.vx = this.x * width; + this.vy = -this.y * height; + if (originX < 0.5) { + this.vx += width * (0.5 - originX); + } else if (originX > 0.5) { + this.vx -= width * (originX - 0.5); + } + if (originY < 0.5) { + this.vy += height * (0.5 - originY); + } else if (originY > 0.5) { + this.vy -= height * (originY - 0.5); + } + return this; + } +} +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (NineSliceVertex); + + +/***/ }, + +/***/ 58715 +(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + + +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + "default": () => (/* binding */ zone_Zone) +}); + +// UNUSED EXPORTS: Zone + +// EXTERNAL MODULE: ./renderer/BlendModes.js +var BlendModes = __webpack_require__(10312); +var BlendModes_default = /*#__PURE__*/__webpack_require__.n(BlendModes); +// EXTERNAL MODULE: ./geom/circle/Circle.js +var Circle = __webpack_require__(96503); +var Circle_default = /*#__PURE__*/__webpack_require__.n(Circle); +// EXTERNAL MODULE: ./geom/circle/Contains.js +var Contains = __webpack_require__(87902); +var Contains_default = /*#__PURE__*/__webpack_require__.n(Contains); +// EXTERNAL MODULE: ./gameobjects/components/index.js +var components = __webpack_require__(31401); +var components_default = /*#__PURE__*/__webpack_require__.n(components); +// EXTERNAL MODULE: ./geom/rectangle/Rectangle.ts +var Rectangle = __webpack_require__(59428); +// EXTERNAL MODULE: ./geom/rectangle/Contains.ts +var rectangle_Contains = __webpack_require__(72488); +// EXTERNAL MODULE: ./gameobjects/components/Visible.ts +var Visible = __webpack_require__(36626); +// EXTERNAL MODULE: ./gameobjects/components/Depth.ts +var Depth = __webpack_require__(7889); +// EXTERNAL MODULE: ./utils/Mixin.ts +var Mixin = __webpack_require__(42969); +// EXTERNAL MODULE: ./gameobjects/GameObject.js +var GameObject = __webpack_require__(95643); +var GameObject_default = /*#__PURE__*/__webpack_require__.n(GameObject); +;// ./utils/migrationPlaceholders.ts + + +const TODO_MIGRATE_GameObjectCtor = (GameObject_default()); + +;// ./gameobjects/zone/Zone.ts + +/** + * @author Richard Davey + * @copyright 2013-2026 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + + + + + + + + + + +const ZoneBase = (0,Mixin/* composeMixins */.fP)(Visible.Visible, Depth.Depth)(TODO_MIGRATE_GameObjectCtor); +class Zone extends ZoneBase { + /** + * @since 3.0.0 + */ + constructor(scene, x, y, width = 1, height = width) { + super(scene, "Zone"); + this.setPosition(x, y); + this.width = width; + this.height = height; + this.blendMode = (BlendModes_default()).NORMAL; + this.updateDisplayOrigin(); + } + /** + * The displayed width of this Game Object. + * This value takes into account the scale factor. + * + * @name Phaser.GameObjects.Zone#displayWidth + * @since 3.0.0 + */ + get displayWidth() { + return this.scaleX * this.width; + } + set displayWidth(value) { + this.scaleX = value / this.width; + } + /** + * The displayed height of this Game Object. + * This value takes into account the scale factor. + * + * @since 3.0.0 + */ + get displayHeight() { + return this.scaleY * this.height; + } + set displayHeight(value) { + this.scaleY = value / this.height; + } + /** + * Sets the native (un-scaled) width and height of this Zone. Also updates the display origin + * and, by default, resizes any non-custom input hit area associated with this Zone. + * + * @since 3.0.0 + * + * @param width - The width of this Game Object. + * @param height - The height of this Game Object. + * @param [resizeInput=true] - If this Zone has a Rectangle for a hit area this argument will resize the hit area as well. + * + * @return This Game Object. + */ + setSize(width, height, resizeInput = true) { + this.width = width; + this.height = height; + this.updateDisplayOrigin(); + const input = this.input; + if (resizeInput && input && !input.customHitArea) { + input.hitArea.width = width; + input.hitArea.height = height; + } + return this; + } + /** + * Sets the display size of this Game Object. + * Calling this will adjust the scale. + * + * @since 3.0.0 + * + * @param width - The width of this Game Object. + * @param height - The height of this Game Object. + * + * @return This Game Object. + */ + setDisplaySize(width, height) { + this.displayWidth = width; + this.displayHeight = height; + return this; + } + /** + * Sets this Zone to be a Circular Drop Zone. + * The circle is centered on this Zone's `x` and `y` coordinates. + * + * @since 3.0.0 + * + * @param radius - The radius of the Circle that will form the Drop Zone. + * + * @return This Game Object. + */ + setCircleDropZone(radius) { + return this.setDropZone(new (Circle_default())(0, 0, radius), (Contains_default())); + } + /** + * Sets this Zone to be a Rectangle Drop Zone. + * The rectangle is centered on this Zone's `x` and `y` coordinates. + * + * @since 3.0.0 + * + * @param width - The width of the rectangle drop zone. + * @param height - The height of the rectangle drop zone. + * + * @return This Game Object. + */ + setRectangleDropZone(width, height) { + return this.setDropZone(new Rectangle.Rectangle(0, 0, width, height), rectangle_Contains.Contains); + } + /** + * Enables this Zone as an interactive Drop Zone by calling `setInteractive` with the given + * hit area shape and callback. You can pass any Phaser geometry shape, or a custom shape with + * a matching hit-test callback. If no arguments are provided, a Rectangle matching the size of + * this Zone will be used automatically. Has no effect if this Zone is already interactive. + * + * @since 3.0.0 + * + * @param [hitArea] - A Geometry shape instance, such as Phaser.Geom.Ellipse, or your own custom shape. + * @param [hitAreaCallback] - A function that will return `true` if the given x/y coords it is sent are within the shape. + * + * @return This Game Object. + */ + setDropZone(hitArea, hitAreaCallback) { + if (!this.input) { + this.setInteractive(hitArea, hitAreaCallback, true); + } + return this; + } + /** + * A NOOP method so you can pass a Zone to a Container. + * Calling this method will do nothing. It is intentionally empty. + * + * @method Phaser.GameObjects.Zone#setAlpha + * @private + * @since 3.11.0 + */ + setAlpha() { + } + /** + * A NOOP method so you can pass a Zone to a Container in Canvas. + * Calling this method will do nothing. It is intentionally empty. + * + * @method Phaser.GameObjects.Zone#setBlendMode + * @private + * @since 3.16.2 + */ + setBlendMode() { + } + /** + * A Zone does not render. + * + * @method Phaser.GameObjects.Zone#renderCanvas + * @private + * @since 3.53.0 + * + * @param renderer - A reference to the current active Canvas renderer. + * @param src - The Game Object being rendered in this call. + * @param camera - The Camera that is rendering the Game Object. + */ + renderCanvas(_renderer, src, camera) { + camera.addToRenderList(src); + } + /** + * A Zone does not render. + * + * @method Phaser.GameObjects.Zone#renderWebGL + * @private + * @since 3.53.0 + * + * @param renderer - A reference to the current active WebGL renderer. + * @param src - The Game Object being rendered in this call. + * @param drawingContext - The current drawing context. + */ + renderWebGL(_renderer, src, drawingContext) { + drawingContext.camera.addToRenderList(src); + } +} +(0,Mixin/* applyMixin */.AD)(Zone, (components_default()).GetBounds); +(0,Mixin/* applyMixin */.AD)(Zone, (components_default()).Origin); +(0,Mixin/* applyMixin */.AD)(Zone, (components_default()).ScrollFactor); +(0,Mixin/* applyMixin */.AD)(Zone, (components_default()).Transform); +/* harmony default export */ const zone_Zone = (Zone); + + +/***/ }, + +/***/ 72488 +(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Contains: () => (/* binding */ Contains), +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); + +/** + * @author Richard Davey + * @copyright 2013-2026 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ +function Contains(rect, x, y) { + if (rect.width <= 0 || rect.height <= 0) { + return false; + } + return rect.x <= x && rect.x + rect.width >= x && rect.y <= y && rect.y + rect.height >= y; +} +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Contains); + + +/***/ }, + +/***/ 59428 +(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Rectangle: () => (/* binding */ Rectangle), +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _Contains_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(72488); +/* harmony import */ var _GetPoint_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20812); +/* harmony import */ var _GetPoint_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_GetPoint_js__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _GetPoints_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(34819); +/* harmony import */ var _GetPoints_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_GetPoints_js__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _const_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(23777); +/* harmony import */ var _const_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_const_js__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var _line_Line_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(23031); +/* harmony import */ var _line_Line_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_line_Line_js__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var _Random_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(26597); +/* harmony import */ var _Random_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_Random_js__WEBPACK_IMPORTED_MODULE_5__); + +/** + * @author Richard Davey + * @copyright 2013-2026 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + + + + + + +class Rectangle { + /** + * @param x - The X coordinate of the top left corner of the Rectangle. + * @param y - The Y coordinate of the top left corner of the Rectangle. + * @param width - The width of the Rectangle. + * @param height - The height of the Rectangle. + */ + constructor(x = 0, y = 0, width = 0, height = 0) { + this.type = (_const_js__WEBPACK_IMPORTED_MODULE_3___default().RECTANGLE); + this.x = x; + this.y = y; + this.width = width; + this.height = height; + } + /** + * Checks if the given point is inside the Rectangle's bounds. + * + * @since 3.0.0 + * + * @param x - The X coordinate of the point to check. + * @param y - The Y coordinate of the point to check. + * + * @returns `true` if the point is within the Rectangle's bounds, otherwise `false`. + */ + contains(x, y) { + return (0,_Contains_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, x, y); + } + /** + * Calculates the coordinates of a point at a certain `position` on the Rectangle's perimeter. + * + * The `position` is a fraction between 0 and 1 which defines how far into the perimeter the point is. + * + * A value of 0 or 1 returns the point at the top left corner of the rectangle, while a value of 0.5 + * returns the point at the bottom right corner of the rectangle. Values between 0 and 0.5 are on the + * top or the right side and values between 0.5 and 1 are on the bottom or the left side. + * + * @since 3.0.0 + * + * @param position - The normalized distance into the Rectangle's perimeter to return. + * @param output - A Vector2 instance to update with the `x` and `y` coordinates of the point. + * + * @returns The updated `output` object, or a new Vector2 if no `output` object was given. + */ + getPoint(position, output) { + return _GetPoint_js__WEBPACK_IMPORTED_MODULE_1___default()(this, position, output); + } + /** + * Returns an array of points from the perimeter of the Rectangle, each spaced out based + * on the quantity or step required. + * + * @since 3.0.0 + * + * @param quantity - The number of points to return. Set to `false` or 0 to return an arbitrary + * number of points (`perimeter / stepRate`) evenly spaced around the Rectangle based on the `stepRate`. + * @param stepRate - If `quantity` is 0, determines the normalized distance between each returned point. + * @param output - An array to which to append the points. + * + * @returns The modified `output` array, or a new array if none was provided. + */ + getPoints(quantity, stepRate, output) { + return _GetPoints_js__WEBPACK_IMPORTED_MODULE_2___default()(this, quantity, stepRate, output); + } + /** + * Returns a random point within the Rectangle's bounds. + * + * @since 3.0.0 + * + * @param vec - The object in which to store the `x` and `y` coordinates of the point. + * + * @returns The updated `vec`, or a new Vector2 if none was provided. + */ + getRandomPoint(vec) { + return _Random_js__WEBPACK_IMPORTED_MODULE_5___default()(this, vec); + } + /** + * Sets the position, width, and height of the Rectangle. + * + * @since 3.0.0 + * + * @param x - The X coordinate of the top left corner of the Rectangle. + * @param y - The Y coordinate of the top left corner of the Rectangle. + * @param width - The width of the Rectangle. + * @param height - The height of the Rectangle. + * + * @returns This Rectangle object. + */ + setTo(x, y, width, height) { + this.x = x; + this.y = y; + this.width = width; + this.height = height; + return this; + } + /** + * Resets the position, width, and height of the Rectangle to 0. + * + * @since 3.0.0 + * + * @returns This Rectangle object. + */ + setEmpty() { + return this.setTo(0, 0, 0, 0); + } + /** + * Sets the position of the Rectangle. + * + * @since 3.0.0 + * + * @param x - The X coordinate of the top left corner of the Rectangle. + * @param y - The Y coordinate of the top left corner of the Rectangle. + * + * @returns This Rectangle object. + */ + setPosition(x, y) { + if (y === void 0) { + y = x; + } + this.x = x; + this.y = y; + return this; + } + /** + * Sets the width and height of the Rectangle. + * + * @since 3.0.0 + * + * @param width - The width to set the Rectangle to. + * @param height - The height to set the Rectangle to. + * + * @returns This Rectangle object. + */ + setSize(width, height) { + if (height === void 0) { + height = width; + } + this.width = width; + this.height = height; + return this; + } + /** + * Determines if the Rectangle is empty. A Rectangle is empty if its width or height is less than or equal to 0. + * + * @since 3.0.0 + * + * @returns `true` if the Rectangle is empty, otherwise `false`. + */ + isEmpty() { + return this.width <= 0 || this.height <= 0; + } + /** + * Returns a Line object that corresponds to the top of this Rectangle. + * + * @since 3.0.0 + * + * @param line - A Line object to set the results in. If `undefined` a new Line will be created. + * + * @returns A Line object that corresponds to the top of this Rectangle. + */ + // @ts-expect-error - Line is a JS Class() factory value, not a TypeScript type + getLineA(line) { + if (line === void 0) { + line = new (_line_Line_js__WEBPACK_IMPORTED_MODULE_4___default())(); + } + line.setTo(this.x, this.y, this.right, this.y); + return line; + } + /** + * Returns a Line object that corresponds to the right of this Rectangle. + * + * @since 3.0.0 + * + * @param line - A Line object to set the results in. If `undefined` a new Line will be created. + * + * @returns A Line object that corresponds to the right of this Rectangle. + */ + // @ts-expect-error - Line is a JS Class() factory value, not a TypeScript type + getLineB(line) { + if (line === void 0) { + line = new (_line_Line_js__WEBPACK_IMPORTED_MODULE_4___default())(); + } + line.setTo(this.right, this.y, this.right, this.bottom); + return line; + } + /** + * Returns a Line object that corresponds to the bottom of this Rectangle. + * + * @since 3.0.0 + * + * @param line - A Line object to set the results in. If `undefined` a new Line will be created. + * + * @returns A Line object that corresponds to the bottom of this Rectangle. + */ + // @ts-expect-error - Line is a JS Class() factory value, not a TypeScript type + getLineC(line) { + if (line === void 0) { + line = new (_line_Line_js__WEBPACK_IMPORTED_MODULE_4___default())(); + } + line.setTo(this.right, this.bottom, this.x, this.bottom); + return line; + } + /** + * Returns a Line object that corresponds to the left of this Rectangle. + * + * @since 3.0.0 + * + * @param line - A Line object to set the results in. If `undefined` a new Line will be created. + * + * @returns A Line object that corresponds to the left of this Rectangle. + */ + // @ts-expect-error - Line is a JS Class() factory value, not a TypeScript type + getLineD(line) { + if (line === void 0) { + line = new (_line_Line_js__WEBPACK_IMPORTED_MODULE_4___default())(); + } + line.setTo(this.x, this.bottom, this.x, this.y); + return line; + } + /** + * The x coordinate of the left of the Rectangle. + * Changing the left property of a Rectangle object has no effect on the y and height properties. + * However it does affect the width property, whereas changing the x value does not affect the width property. + * + * @since 3.0.0 + */ + get left() { + return this.x; + } + set left(value) { + if (value >= this.right) { + this.width = 0; + } else { + this.width = this.right - value; + } + this.x = value; + } + /** + * The sum of the x and width properties. + * Changing the right property of a Rectangle object has no effect on the x, y and height properties, + * however it does affect the width property. + * + * @since 3.0.0 + */ + get right() { + return this.x + this.width; + } + set right(value) { + if (value <= this.x) { + this.width = 0; + } else { + this.width = value - this.x; + } + } + /** + * The y coordinate of the top of the Rectangle. Changing the top property of a Rectangle object has no + * effect on the x and width properties. However it does affect the height property, whereas changing + * the y value does not affect the height property. + * + * @since 3.0.0 + */ + get top() { + return this.y; + } + set top(value) { + if (value >= this.bottom) { + this.height = 0; + } else { + this.height = this.bottom - value; + } + this.y = value; + } + /** + * The sum of the y and height properties. + * Changing the bottom property of a Rectangle object has no effect on the x, y and width properties, + * but does change the height property. + * + * @since 3.0.0 + */ + get bottom() { + return this.y + this.height; + } + set bottom(value) { + if (value <= this.y) { + this.height = 0; + } else { + this.height = value - this.y; + } + } + /** + * The x coordinate of the center of the Rectangle. + * + * @since 3.0.0 + */ + get centerX() { + return this.x + this.width / 2; + } + set centerX(value) { + this.x = value - this.width / 2; + } + /** + * The y coordinate of the center of the Rectangle. + * + * @since 3.0.0 + */ + get centerY() { + return this.y + this.height / 2; + } + set centerY(value) { + this.y = value - this.height / 2; + } +} +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Rectangle); + + +/***/ }, + +/***/ 350 +(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* unused harmony export Clamp */ + +/** + * @author Richard Davey + * @copyright 2013-2026 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ +function Clamp(value, min, max) { + return Math.max(min, Math.min(max, value)); +} +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Clamp); + + +/***/ }, + +/***/ 70038 +(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* unused harmony export Vector2 */ +/* harmony import */ var _fuzzy_Equal_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(30010); + +/** + * @author Richard Davey + * @copyright 2013-2026 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +const _Vector2 = class _Vector2 { + /** + * @param x - The x component, or an object with `x` and `y` properties. + * @param y - The y component. + */ + constructor(x, y) { + this.x = 0; + this.y = 0; + if (typeof x === "object") { + this.x = x.x || 0; + this.y = x.y || 0; + } else { + if (y === void 0) { + y = x; + } + this.x = x || 0; + this.y = y || 0; + } + } + /** + * Make a clone of this Vector2. + * + * @since 3.0.0 + * + * @returns A clone of this Vector2. + */ + clone() { + return new _Vector2(this.x, this.y); + } + /** + * Copy the components of a given Vector into this Vector. + * + * @since 3.0.0 + * + * @param src - The Vector to copy the components from. + * @returns This Vector2. + */ + copy(src) { + this.x = src.x || 0; + this.y = src.y || 0; + return this; + } + /** + * Set the component values of this Vector from a given Vector2Like object. + * + * @since 3.0.0 + * + * @param obj - The object containing the component values to set for this Vector. + * @returns This Vector2. + */ + setFromObject(obj) { + this.x = obj.x || 0; + this.y = obj.y || 0; + return this; + } + /** + * Set the `x` and `y` components of this Vector to the given `x` and `y` values. + * + * @since 3.0.0 + * + * @param x - The x value to set for this Vector. + * @param y - The y value to set for this Vector. + * @returns This Vector2. + */ + set(x, y) { + if (y === void 0) { + y = x; + } + this.x = x; + this.y = y; + return this; + } + /** + * This method is an alias for `Vector2.set`. + * + * @since 3.4.0 + * + * @param x - The x value to set for this Vector. + * @param y - The y value to set for this Vector. + * @returns This Vector2. + */ + setTo(x, y) { + return this.set(x, y); + } + /** + * Runs the x and y components of this Vector2 through Math.ceil and then sets them. + * + * @since 4.0.0 + * + * @returns This Vector2. + */ + ceil() { + this.x = Math.ceil(this.x); + this.y = Math.ceil(this.y); + return this; + } + /** + * Runs the x and y components of this Vector2 through Math.floor and then sets them. + * + * @since 4.0.0 + * + * @returns This Vector2. + */ + floor() { + this.x = Math.floor(this.x); + this.y = Math.floor(this.y); + return this; + } + /** + * Swaps the x and y components of this Vector2. + * + * @since 4.0.0 + * + * @returns This Vector2. + */ + invert() { + return this.set(this.y, this.x); + } + /** + * Sets the x and y components of this Vector from the given angle and length. + * + * @since 3.0.0 + * + * @param angle - The angle from the positive x-axis, in radians. + * @param length - The distance from the origin. + * @returns This Vector2. + */ + setToPolar(angle, length) { + if (length === null || length === void 0) { + length = 1; + } + this.x = Math.cos(angle) * length; + this.y = Math.sin(angle) * length; + return this; + } + /** + * Check whether this Vector is equal to a given Vector. + * + * Performs a strict equality check against each Vector's components. + * + * @since 3.0.0 + * + * @param v - The vector to compare with this Vector. + * @returns Whether the given Vector is equal to this Vector. + */ + equals(v) { + return this.x === v.x && this.y === v.y; + } + /** + * Check whether this Vector is approximately equal to a given Vector. + * + * @since 3.23.0 + * + * @param v - The vector to compare with this Vector. + * @param epsilon - The tolerance value. + * @returns Whether both absolute differences of the x and y components are smaller than `epsilon`. + */ + fuzzyEquals(v, epsilon) { + return (0,_fuzzy_Equal_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this.x, v.x, epsilon) && (0,_fuzzy_Equal_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this.y, v.y, epsilon); + } + /** + * Calculate the angle between this Vector and the positive x-axis, in radians. + * + * @since 3.0.0 + * + * @returns The angle between this Vector, and the positive x-axis, given in radians. + */ + angle() { + let angle = Math.atan2(this.y, this.x); + if (angle < 0) { + angle += 2 * Math.PI; + } + return angle; + } + /** + * Set the angle of this Vector. + * + * @since 3.23.0 + * + * @param angle - The angle, in radians. + * @returns This Vector2. + */ + setAngle(angle) { + return this.setToPolar(angle, this.length()); + } + /** + * Add a given Vector to this Vector. Addition is component-wise. + * + * @since 3.0.0 + * + * @param src - The Vector to add to this Vector. + * @returns This Vector2. + */ + add(src) { + this.x += src.x; + this.y += src.y; + return this; + } + /** + * Subtract the given Vector from this Vector. Subtraction is component-wise. + * + * @since 3.0.0 + * + * @param src - The Vector to subtract from this Vector. + * @returns This Vector2. + */ + subtract(src) { + this.x -= src.x; + this.y -= src.y; + return this; + } + /** + * Perform a component-wise multiplication between this Vector and the given Vector. + * + * Multiplies this Vector by the given Vector. + * + * @since 3.0.0 + * + * @param src - The Vector to multiply this Vector by. + * @returns This Vector2. + */ + multiply(src) { + this.x *= src.x; + this.y *= src.y; + return this; + } + /** + * Scale this Vector by the given value. + * + * @since 3.0.0 + * + * @param value - The value to scale this Vector by. + * @returns This Vector2. + */ + scale(value) { + if (isFinite(value)) { + this.x *= value; + this.y *= value; + } else { + this.x = 0; + this.y = 0; + } + return this; + } + /** + * Perform a component-wise division between this Vector and the given Vector. + * + * Divides this Vector by the given Vector. + * + * @since 3.0.0 + * + * @param src - The Vector to divide this Vector by. + * @returns This Vector2. + */ + divide(src) { + this.x /= src.x; + this.y /= src.y; + return this; + } + /** + * Negate the `x` and `y` components of this Vector. + * + * @since 3.0.0 + * + * @returns This Vector2. + */ + negate() { + this.x = -this.x; + this.y = -this.y; + return this; + } + /** + * Calculate the distance between this Vector and the given Vector. + * + * @since 3.0.0 + * + * @param src - The Vector to calculate the distance to. + * @returns The distance from this Vector to the given Vector. + */ + distance(src) { + const dx = src.x - this.x; + const dy = src.y - this.y; + return Math.sqrt(dx * dx + dy * dy); + } + /** + * Calculate the distance between this Vector and the given Vector, squared. + * + * @since 3.0.0 + * + * @param src - The Vector to calculate the distance to. + * @returns The distance from this Vector to the given Vector, squared. + */ + distanceSq(src) { + const dx = src.x - this.x; + const dy = src.y - this.y; + return dx * dx + dy * dy; + } + /** + * Calculate the length (or magnitude) of this Vector. + * + * @since 3.0.0 + * + * @returns The length of this Vector. + */ + length() { + const x = this.x; + const y = this.y; + return Math.sqrt(x * x + y * y); + } + /** + * Set the length (or magnitude) of this Vector. + * + * @since 3.23.0 + * + * @param length - The new magnitude of this Vector. + * @returns This Vector2. + */ + setLength(length) { + return this.normalize().scale(length); + } + /** + * Calculate the length of this Vector squared. + * + * @since 3.0.0 + * + * @returns The length of this Vector, squared. + */ + lengthSq() { + const x = this.x; + const y = this.y; + return x * x + y * y; + } + /** + * Normalize this Vector. + * + * Makes the vector a unit length vector (magnitude of 1) in the same direction. + * + * @since 3.0.0 + * + * @returns This Vector2. + */ + normalize() { + const x = this.x; + const y = this.y; + let len = x * x + y * y; + if (len > 0) { + len = 1 / Math.sqrt(len); + this.x = x * len; + this.y = y * len; + } + return this; + } + /** + * Rotate this Vector to its perpendicular, in the positive direction. + * + * @since 3.0.0 + * + * @returns This Vector2. + */ + normalizeRightHand() { + const x = this.x; + this.x = this.y * -1; + this.y = x; + return this; + } + /** + * Rotate this Vector to its perpendicular, in the negative direction. + * + * @since 3.23.0 + * + * @returns This Vector2. + */ + normalizeLeftHand() { + const x = this.x; + this.x = this.y; + this.y = x * -1; + return this; + } + /** + * Calculate the dot product of this Vector and the given Vector. + * + * @since 3.0.0 + * + * @param src - The Vector2 to dot product with this Vector2. + * @returns The dot product of this Vector and the given Vector. + */ + dot(src) { + return this.x * src.x + this.y * src.y; + } + /** + * Calculate the cross product of this Vector and the given Vector. + * + * @since 3.0.0 + * + * @param src - The Vector2 to cross with this Vector2. + * @returns The cross product of this Vector and the given Vector. + */ + cross(src) { + return this.x * src.y - this.y * src.x; + } + /** + * Linearly interpolate between this Vector and the given Vector. + * + * Interpolates this Vector towards the given Vector. + * + * @since 3.0.0 + * + * @param src - The Vector2 to interpolate towards. + * @param t - The interpolation percentage, between 0 and 1. + * @returns This Vector2. + */ + lerp(src, t = 0) { + const ax = this.x; + const ay = this.y; + this.x = ax + t * (src.x - ax); + this.y = ay + t * (src.y - ay); + return this; + } + /** + * Transform this Vector with the given Matrix3. + * + * @since 3.0.0 + * + * @param mat - The Matrix3 to transform this Vector2 with. + * @returns This Vector2. + */ + transformMat3(mat) { + const x = this.x; + const y = this.y; + const m = mat.val; + this.x = m[0] * x + m[3] * y + m[6]; + this.y = m[1] * x + m[4] * y + m[7]; + return this; + } + /** + * Transform this Vector with the given Matrix4. + * + * @since 3.0.0 + * + * @param mat - The Matrix4 to transform this Vector2 with. + * @returns This Vector2. + */ + transformMat4(mat) { + const x = this.x; + const y = this.y; + const m = mat.val; + this.x = m[0] * x + m[4] * y + m[12]; + this.y = m[1] * x + m[5] * y + m[13]; + return this; + } + /** + * Make this Vector the zero vector (0, 0). + * + * @since 3.0.0 + * + * @returns This Vector2. + */ + reset() { + this.x = 0; + this.y = 0; + return this; + } + /** + * Limit the length (or magnitude) of this Vector. + * + * @since 3.23.0 + * + * @param max - The maximum length. + * @returns This Vector2. + */ + limit(max) { + const len = this.length(); + if (len && len > max) { + this.scale(max / len); + } + return this; + } + /** + * Reflect this Vector off a line defined by a normal. + * + * @since 3.23.0 + * + * @param normal - A vector perpendicular to the line. + * @returns This Vector2. + */ + reflect(normal) { + const n = normal.clone().normalize(); + return this.subtract(n.scale(2 * this.dot(n))); + } + /** + * Reflect this Vector across another. + * + * @since 3.23.0 + * + * @param axis - A vector to reflect across. + * @returns This Vector2. + */ + mirror(axis) { + return this.reflect(axis).negate(); + } + /** + * Rotate this Vector by an angle amount. + * + * @since 3.23.0 + * + * @param delta - The angle to rotate by, in radians. + * @returns This Vector2. + */ + rotate(delta) { + const cos = Math.cos(delta); + const sin = Math.sin(delta); + return this.set(cos * this.x - sin * this.y, sin * this.x + cos * this.y); + } + /** + * Project this Vector onto another. + * + * @since 3.60.0 + * + * @param src - The vector to project onto. + * @returns This Vector2. + */ + project(src) { + const scalar = this.dot(src) / src.dot(src); + return this.copy(src).scale(scalar); + } + /** + * Calculates the vector projection of this Vector2 onto the non-zero `vecB`. This is the + * orthogonal projection of this vector onto a straight line parallel to `vecB`. + * + * @since 4.0.0 + * + * @param vecB - The vector to project onto. + * @param out - The Vector2 object to store the position in. If not given, a new Vector2 instance is created. + * @returns The `out` Vector2 containing the projected values. + */ + projectUnit(vecB, out) { + if (out === void 0) { + out = new _Vector2(); + } + const amt = this.x * vecB.x + this.y * vecB.y; + if (amt !== 0) { + out.x = amt * vecB.x; + out.y = amt * vecB.y; + } + return out; + } +}; +/** + * A static zero Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @since 3.1.0 + */ +_Vector2.ZERO = new _Vector2(); +/** + * A static right Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @since 3.16.0 + */ +_Vector2.RIGHT = new _Vector2(1, 0); +/** + * A static left Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @since 3.16.0 + */ +_Vector2.LEFT = new _Vector2(-1, 0); +/** + * A static up Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @since 3.16.0 + */ +_Vector2.UP = new _Vector2(0, -1); +/** + * A static down Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @since 3.16.0 + */ +_Vector2.DOWN = new _Vector2(0, 1); +/** + * A static one Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @since 3.16.0 + */ +_Vector2.ONE = new _Vector2(1, 1); +let Vector2 = _Vector2; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Vector2); + + +/***/ }, + +/***/ 68077 +(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* unused harmony export Wrap */ + +/** + * @author Richard Davey + * @copyright 2013-2026 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ +function Wrap(value, min, max) { + const range = max - min; + return min + ((value - min) % range + range) % range; +} +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Wrap); + + +/***/ }, + +/***/ 30010 +(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* unused harmony export Equal */ + +/** + * @author Richard Davey + * @copyright 2013-2026 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ +function Equal(a, b, epsilon = 1e-4) { + return Math.abs(a - b) < epsilon; +} +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Equal); + + +/***/ }, + +/***/ 60269 +(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + + +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + "default": () => (/* binding */ structs_Map) +}); + +// UNUSED EXPORTS: Map + +;// ./utils/object/TypedObjectUtils.ts + +function objectKeys(obj) { + return Object.keys(obj); +} + +;// ./structs/Map.ts + +/** + * @author Richard Davey + * @copyright 2013-2026 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +class Map { + /** + * @param elements - An optional array of key-value pairs to populate this Map with. + */ + constructor(elements) { + this.entries = {}; + this.size = 0; + this.setAll(elements); + } + /** + * Adds all the elements in the given array to this Map. + * + * If the key already exists, the value will be replaced. + * + * @since 3.70.0 + * + * @param elements - An array of key-value pairs to populate this Map with. + * @returns This Map object. + */ + setAll(elements) { + if (Array.isArray(elements)) { + for (let i = 0; i < elements.length; i++) { + this.set(elements[i][0], elements[i][1]); + } + } + return this; + } + /** + * Adds an element with a specified `key` and `value` to this Map. + * + * If the `key` already exists, the value will be replaced. + * + * If you wish to add multiple elements in a single call, use the `setAll` method instead. + * + * @since 3.0.0 + * + * @param key - The key of the element to be added to this Map. + * @param value - The value of the element to be added to this Map. + * @returns This Map object. + */ + set(key, value) { + if (!this.has(key)) { + this.size++; + } + this.entries[key] = value; + return this; + } + /** + * Returns the value associated to the `key`, or `undefined` if there is none. + * + * @since 3.0.0 + * + * @param key - The key of the element to return from the `Map` object. + * @returns The element associated with the specified key or `undefined` if the key can't be found in this Map object. + */ + get(key) { + if (this.has(key)) { + return this.entries[key]; + } + } + /** + * Returns an `Array` of all the values stored in this Map. + * + * @since 3.0.0 + * + * @returns An array of the values stored in this Map. + */ + getArray() { + const output = []; + const entries = this.entries; + for (const key of objectKeys(entries)) { + output.push(entries[key]); + } + return output; + } + /** + * Returns a boolean indicating whether an element with the specified key exists or not. + * + * @since 3.0.0 + * + * @param key - The key of the element to test for presence of in this Map. + * @returns Returns `true` if an element with the specified key exists in this Map, otherwise `false`. + */ + has(key) { + return this.entries.hasOwnProperty(key); + } + /** + * Delete the specified element from this Map. + * + * @since 3.0.0 + * + * @param key - The key of the element to delete from this Map. + * @returns This Map object. + */ + delete(key) { + if (this.has(key)) { + delete this.entries[key]; + this.size--; + } + return this; + } + /** + * Delete all entries from this Map. + * + * @since 3.0.0 + * + * @returns This Map object. + */ + clear() { + for (const prop of objectKeys(this.entries)) { + delete this.entries[prop]; + } + this.size = 0; + return this; + } + /** + * Returns an array of all entry keys in this Map. + * + * @since 3.0.0 + * + * @returns Array containing entries' keys. + */ + keys() { + return objectKeys(this.entries); + } + /** + * Returns an `Array` of all values stored in this Map. + * + * @since 3.0.0 + * + * @returns An `Array` of values. + */ + values() { + const output = []; + const entries = this.entries; + for (const key of objectKeys(entries)) { + output.push(entries[key]); + } + return output; + } + /** + * Dumps the contents of this Map to the console via `console.group`. + * + * @since 3.0.0 + */ + dump() { + const entries = this.entries; + console.group("Map"); + for (const key of objectKeys(entries)) { + console.log(key, entries[key]); + } + console.groupEnd(); + } + /** + * Iterates through all entries in this Map, passing each one to the given callback. + * + * If the callback returns `false`, the iteration will break. + * + * @since 3.0.0 + * + * @param callback - The callback which will receive the keys and entries held in this Map. + * @returns This Map object. + */ + each(callback) { + const entries = this.entries; + for (const key of objectKeys(entries)) { + if (callback(key, entries[key]) === false) { + break; + } + } + return this; + } + /** + * Returns `true` if the value exists within this Map. Otherwise, returns `false`. + * + * @since 3.0.0 + * + * @param value - The value to search for. + * @returns `true` if the value is found, otherwise `false`. + */ + contains(value) { + const entries = this.entries; + for (const key of objectKeys(entries)) { + if (entries[key] === value) { + return true; + } + } + return false; + } + /** + * Merges all new keys from the given Map into this one. + * If it encounters a key that already exists it will be skipped unless override is set to `true`. + * + * @since 3.0.0 + * + * @param map - The Map to merge in to this Map. + * @param override - Set to `true` to replace values in this Map with those from the source map, or `false` to skip them. + * @returns This Map object. + */ + merge(map, override = false) { + const local = this.entries; + const source = map.entries; + for (const key of objectKeys(source)) { + if (local.hasOwnProperty(key) && override) { + local[key] = source[key]; + } else { + this.set(key, source[key]); + } + } + return this; + } +} +/* harmony default export */ const structs_Map = (Map); + + +/***/ }, + +/***/ 42969 +(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ AD: () => (/* binding */ applyMixin), +/* harmony export */ fP: () => (/* binding */ composeMixins), +/* harmony export */ lv: () => (/* binding */ defineMixin) +/* harmony export */ }); + +function isAccessorDescriptor(value) { + if (value === null || typeof value !== "object") { + return false; + } + const record = value; + return typeof record.get === "function" || typeof record.set === "function"; +} +function applyMixin(target, mixin) { + for (const key of Object.keys(mixin)) { + const value = mixin[key]; + if (isAccessorDescriptor(value)) { + Object.defineProperty(target.prototype, key, { + get: value.get, + set: value.set, + enumerable: true, + configurable: true + }); + } else { + Object.defineProperty(target.prototype, key, { + value, + writable: true, + enumerable: false, + configurable: true + }); + } + } +} +function defineMixin() { + return function(fn) { + return fn; + }; +} +function composeMixins(...mixins) { + return ((Base) => mixins.reduce((Current, mixin) => mixin(Current), Base)); +} + + +/***/ }, + /***/ 50792 (module) { @@ -33313,8 +35111,6 @@ var Blur = new Class({ Controller.call(this, camera, 'FilterBlur'); - // TODO: @GN suggests altering `boundedSampler` to better support full-screen effects where we don't want transparent borders. - /** * The quality of the blur effect. * @@ -42769,7 +44565,7 @@ var BitmapText = new Class({ */ displayWidth: { - set: function(value) + set: function (value) { this.setScaleX(1); @@ -42801,7 +44597,7 @@ var BitmapText = new Class({ */ displayHeight: { - set: function(value) + set: function (value) { this.setScaleY(1); @@ -45840,196 +47636,11 @@ module.exports = Crop; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -/** - * Provides methods used for setting the depth of a Game Object. - * Should be applied as a mixin and not used directly. - * - * @namespace Phaser.GameObjects.Components.Depth - * @since 3.0.0 - */ - -var ArrayUtils = __webpack_require__(37105); - -var Depth = { - - /** - * Private internal value. Holds the depth of the Game Object. - * - * @name Phaser.GameObjects.Components.Depth#_depth - * @type {number} - * @private - * @default 0 - * @since 3.0.0 - */ - _depth: 0, - - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * - * @name Phaser.GameObjects.Components.Depth#depth - * @type {number} - * @since 3.0.0 - */ - depth: { - - get: function () - { - return this._depth; - }, - - set: function (value) - { - if (this.displayList) - { - this.displayList.queueDepthSort(); - } - - this._depth = value; - } - - }, - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * - * @method Phaser.GameObjects.Components.Depth#setDepth - * @since 3.0.0 - * - * @param {number} value - The depth of this Game Object. Ensure this value is only ever a number data-type. - * - * @return {this} This Game Object instance. - */ - setDepth: function (value) - { - if (value === undefined) { value = 0; } - - this.depth = value; - - return this; - }, - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * - * @method Phaser.GameObjects.Components.Depth#setToTop - * @since 3.85.0 - * - * @return {this} This Game Object instance. - */ - setToTop: function () - { - var list = this.getDisplayList(); - - if (list) - { - ArrayUtils.BringToTop(list, this); - } - - return this; - }, - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * - * @method Phaser.GameObjects.Components.Depth#setToBack - * @since 3.85.0 - * - * @return {this} This Game Object instance. - */ - setToBack: function () - { - var list = this.getDisplayList(); - - if (list) - { - ArrayUtils.SendToBack(list, this); - } - - return this; - }, - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * - * @method Phaser.GameObjects.Components.Depth#setAbove - * @since 3.85.0 - * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that this Game Object will be moved to be above. - * - * @return {this} This Game Object instance. - */ - setAbove: function (gameObject) - { - var list = this.getDisplayList(); - - if (list && gameObject) - { - ArrayUtils.MoveAbove(list, this, gameObject); - } - - return this; - }, - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * - * @method Phaser.GameObjects.Components.Depth#setBelow - * @since 3.85.0 - * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that this Game Object will be moved to be below. - * - * @return {this} This Game Object instance. - */ - setBelow: function (gameObject) - { - var list = this.getDisplayList(); - - if (list && gameObject) - { - ArrayUtils.MoveBelow(list, this, gameObject); - } - - return this; - } - -}; - -module.exports = Depth; +// CJS compatibility wrapper — consumed by Class() factory Mixins arrays during the +// hybrid JS/TS migration period. Remove once all callers are TypeScript. +const mod = __webpack_require__(7889); +module.exports = mod.DepthDescriptors; +Object.defineProperty(module.exports, "Depth", ({ value: mod.Depth })); /***/ }, @@ -52489,7 +54100,7 @@ module.exports = TransformMatrix; /***/ }, /***/ 59715 -(module) { +(module, __unused_webpack_exports, __webpack_require__) { /** * @author Richard Davey @@ -52497,87 +54108,11 @@ module.exports = TransformMatrix; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -// bitmask flag for GameObject.renderMask -var _FLAG = 1; // 0001 - -/** - * Provides methods used for setting the visibility of a Game Object. - * The Visible component is mixed into Game Objects to give them a `visible` boolean property - * and a `setVisible` method. Visibility is tracked via a bitmask flag on `renderFlags`, so - * toggling it is a fast bitwise operation. An invisible Game Object is excluded from the - * render pass entirely, but its `update` logic continues to run normally each frame. - * Should be applied as a mixin and not used directly. - * - * @namespace Phaser.GameObjects.Components.Visible - * @since 3.0.0 - */ - -var Visible = { - - /** - * Private internal value. Holds the visible value. - * - * @name Phaser.GameObjects.Components.Visible#_visible - * @type {boolean} - * @private - * @default true - * @since 3.0.0 - */ - _visible: true, - - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * - * @name Phaser.GameObjects.Components.Visible#visible - * @type {boolean} - * @since 3.0.0 - */ - visible: { - - get: function () - { - return this._visible; - }, - - set: function (value) - { - if (value) - { - this._visible = true; - this.renderFlags |= _FLAG; - } - else - { - this._visible = false; - this.renderFlags &= ~_FLAG; - } - } - - }, - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * - * @method Phaser.GameObjects.Components.Visible#setVisible - * @since 3.0.0 - * - * @param {boolean} value - The visible state of the Game Object. - * - * @return {this} This Game Object instance. - */ - setVisible: function (value) - { - this.visible = value; - - return this; - } -}; - -module.exports = Visible; +// CJS compatibility wrapper — consumed by Class() factory Mixins arrays during the +// hybrid JS/TS migration period. Remove once all callers are TypeScript. +const mod = __webpack_require__(36626); +module.exports = mod.VisibleDescriptors; +Object.defineProperty(module.exports, "Visible", ({ value: mod.Visible })); /***/ }, @@ -52596,7 +54131,6 @@ module.exports = Visible; */ module.exports = { - Alpha: __webpack_require__(16005), AlphaSingle: __webpack_require__(88509), BlendMode: __webpack_require__(90065), @@ -65586,155 +67120,7 @@ module.exports = { /***/ 82513 (module, __unused_webpack_exports, __webpack_require__) { -/** - * @author Richard Davey - * @copyright 2013-2026 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(83419); -var Vector2 = __webpack_require__(26099); - -/** - * @classdesc - * Represents a single vertex within a NineSlice Game Object. - * - * A NineSlice Game Object is divided into a 3x3 grid of regions, each defined by a mesh - * of vertices. This class stores all the data needed for one vertex: its normalized position - * (x, y inherited from Vector2), its projected screen-space position (vx, vy), and its - * UV texture coordinates (u, v) used during rendering. - * - * You do not typically create NineSliceVertex instances directly. They are created and - * managed internally by the NineSlice Game Object. - * - * @class NineSliceVertex - * @memberof Phaser.GameObjects - * @constructor - * @extends Phaser.Math.Vector2 - * @since 4.0.0 - * - * @param {number} x - The x position of the vertex. - * @param {number} y - The y position of the vertex. - * @param {number} u - The UV u coordinate of the vertex. - * @param {number} v - The UV v coordinate of the vertex. - */ -var Vertex = new Class({ - - Extends: Vector2, - - initialize: - - function Vertex (x, y, u, v) - { - Vector2.call(this, x, y); - - /** - * The projected x coordinate of this vertex. - * - * @name Phaser.GameObjects.NineSliceVertex#vx - * @type {number} - * @since 4.0.0 - */ - this.vx = 0; - - /** - * The projected y coordinate of this vertex. - * - * @name Phaser.GameObjects.NineSliceVertex#vy - * @type {number} - * @since 4.0.0 - */ - this.vy = 0; - - /** - * UV u coordinate of this vertex. - * - * @name Phaser.GameObjects.NineSliceVertex#u - * @type {number} - * @since 4.0.0 - */ - this.u = u; - - /** - * UV v coordinate of this vertex. - * - * @name Phaser.GameObjects.NineSliceVertex#v - * @type {number} - * @since 4.0.0 - */ - this.v = v; - }, - - /** - * Sets the UV texture coordinates of this vertex. - * - * @method Phaser.GameObjects.NineSliceVertex#setUVs - * @since 4.0.0 - * - * @param {number} u - The UV u coordinate of the vertex. - * @param {number} v - The UV v coordinate of the vertex. - * - * @return {this} This Vertex. - */ - setUVs: function (u, v) - { - this.u = u; - this.v = v; - - return this; - }, - - /** - * Updates this vertex's position and calculates its projected screen-space coordinates. - * - * Sets the normalized `x` and `y` position, then scales them by the parent object's - * `width` and `height` to produce the projected `vx` and `vy` values. The origin - * offset of the parent object is then factored in, shifting `vx` and `vy` so that the - * mesh is correctly aligned relative to the object's origin point. - * - * @method Phaser.GameObjects.NineSliceVertex#resize - * @since 4.0.0 - * - * @param {number} x - The x position of the vertex. - * @param {number} y - The y position of the vertex. - * @param {number} width - The width of the parent object. - * @param {number} height - The height of the parent object. - * @param {number} originX - The originX of the parent object. - * @param {number} originY - The originY of the parent object. - * - * @return {this} This Vertex. - */ - resize: function (x, y, width, height, originX, originY) - { - this.x = x; - this.y = y; - - this.vx = this.x * width; - this.vy = -this.y * height; - - if (originX < 0.5) - { - this.vx += width * (0.5 - originX); - } - else if (originX > 0.5) - { - this.vx -= width * (originX - 0.5); - } - - if (originY < 0.5) - { - this.vy += height * (0.5 - originY); - } - else if (originY > 0.5) - { - this.vy -= height * (originY - 0.5); - } - - return this; - } -}); - -module.exports = Vertex; +module.exports = __webpack_require__(18134)["default"]; /***/ }, @@ -97315,316 +98701,10 @@ module.exports = VideoWebGLRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BlendModes = __webpack_require__(10312); -var Circle = __webpack_require__(96503); -var CircleContains = __webpack_require__(87902); -var Class = __webpack_require__(83419); -var Components = __webpack_require__(31401); -var GameObject = __webpack_require__(95643); -var Rectangle = __webpack_require__(87841); -var RectangleContains = __webpack_require__(37303); - -/** - * @classdesc - * A Zone is a non-rendering rectangular Game Object that has a position and size but no texture. - * It never displays visually, but it does live on the display list and can be moved, scaled, - * and rotated like any other Game Object. - * - * Its primary use is for creating Drop Zones and Input Hit Areas. It provides helper methods for - * both circular and rectangular drop zones, and can also accept custom geometry shapes. Zones are - * also useful for object overlap checks, or as a base class for your own non-displaying Game Objects. - * - * The default origin is 0.5, placing it at the center of the Zone, consistent with other Game Objects. - * - * @class Zone - * @extends Phaser.GameObjects.GameObject - * @memberof Phaser.GameObjects - * @constructor - * @since 3.0.0 - * - * @extends Phaser.GameObjects.Components.Depth - * @extends Phaser.GameObjects.Components.GetBounds - * @extends Phaser.GameObjects.Components.Origin - * @extends Phaser.GameObjects.Components.Transform - * @extends Phaser.GameObjects.Components.ScrollFactor - * @extends Phaser.GameObjects.Components.Visible - * - * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. - * @param {number} x - The horizontal position of this Game Object in the world. - * @param {number} y - The vertical position of this Game Object in the world. - * @param {number} [width=1] - The width of the Game Object. - * @param {number} [height=1] - The height of the Game Object. - */ -var Zone = new Class({ - - Extends: GameObject, - - Mixins: [ - Components.Depth, - Components.GetBounds, - Components.Origin, - Components.Transform, - Components.ScrollFactor, - Components.Visible - ], - - initialize: - - function Zone (scene, x, y, width, height) - { - if (width === undefined) { width = 1; } - if (height === undefined) { height = width; } - - GameObject.call(this, scene, 'Zone'); - - this.setPosition(x, y); - - /** - * The native (un-scaled) width of this Game Object. - * - * @name Phaser.GameObjects.Zone#width - * @type {number} - * @since 3.0.0 - */ - this.width = width; - - /** - * The native (un-scaled) height of this Game Object. - * - * @name Phaser.GameObjects.Zone#height - * @type {number} - * @since 3.0.0 - */ - this.height = height; - - /** - * The Blend Mode of the Game Object. - * Although a Zone never renders, it still has a blend mode to allow it to fit seamlessly into - * display lists without causing a batch flush. - * - * @name Phaser.GameObjects.Zone#blendMode - * @type {number} - * @since 3.0.0 - */ - this.blendMode = BlendModes.NORMAL; - - this.updateDisplayOrigin(); - }, - - /** - * The displayed width of this Game Object. - * This value takes into account the scale factor. - * - * @name Phaser.GameObjects.Zone#displayWidth - * @type {number} - * @since 3.0.0 - */ - displayWidth: { - - get: function () - { - return this.scaleX * this.width; - }, - - set: function (value) - { - this.scaleX = value / this.width; - } - - }, - - /** - * The displayed height of this Game Object. - * This value takes into account the scale factor. - * - * @name Phaser.GameObjects.Zone#displayHeight - * @type {number} - * @since 3.0.0 - */ - displayHeight: { - - get: function () - { - return this.scaleY * this.height; - }, - - set: function (value) - { - this.scaleY = value / this.height; - } - - }, - - /** - * Sets the native (un-scaled) width and height of this Zone. Also updates the display origin - * and, by default, resizes any non-custom input hit area associated with this Zone. - * - * @method Phaser.GameObjects.Zone#setSize - * @since 3.0.0 - * - * @param {number} width - The width of this Game Object. - * @param {number} height - The height of this Game Object. - * @param {boolean} [resizeInput=true] - If this Zone has a Rectangle for a hit area this argument will resize the hit area as well. - * - * @return {this} This Game Object. - */ - setSize: function (width, height, resizeInput) - { - if (resizeInput === undefined) { resizeInput = true; } - - this.width = width; - this.height = height; - - this.updateDisplayOrigin(); - - var input = this.input; - - if (resizeInput && input && !input.customHitArea) - { - input.hitArea.width = width; - input.hitArea.height = height; - } - - return this; - }, - - /** - * Sets the display size of this Game Object. - * Calling this will adjust the scale. - * - * @method Phaser.GameObjects.Zone#setDisplaySize - * @since 3.0.0 - * - * @param {number} width - The width of this Game Object. - * @param {number} height - The height of this Game Object. - * - * @return {this} This Game Object. - */ - setDisplaySize: function (width, height) - { - this.displayWidth = width; - this.displayHeight = height; - - return this; - }, - - /** - * Sets this Zone to be a Circular Drop Zone. - * The circle is centered on this Zone's `x` and `y` coordinates. - * - * @method Phaser.GameObjects.Zone#setCircleDropZone - * @since 3.0.0 - * - * @param {number} radius - The radius of the Circle that will form the Drop Zone. - * - * @return {this} This Game Object. - */ - setCircleDropZone: function (radius) - { - return this.setDropZone(new Circle(0, 0, radius), CircleContains); - }, - - /** - * Sets this Zone to be a Rectangle Drop Zone. - * The rectangle is centered on this Zone's `x` and `y` coordinates. - * - * @method Phaser.GameObjects.Zone#setRectangleDropZone - * @since 3.0.0 - * - * @param {number} width - The width of the rectangle drop zone. - * @param {number} height - The height of the rectangle drop zone. - * - * @return {this} This Game Object. - */ - setRectangleDropZone: function (width, height) - { - return this.setDropZone(new Rectangle(0, 0, width, height), RectangleContains); - }, - - /** - * Enables this Zone as an interactive Drop Zone by calling `setInteractive` with the given - * hit area shape and callback. You can pass any Phaser geometry shape, or a custom shape with - * a matching hit-test callback. If no arguments are provided, a Rectangle matching the size of - * this Zone will be used automatically. Has no effect if this Zone is already interactive. - * - * @method Phaser.GameObjects.Zone#setDropZone - * @since 3.0.0 - * - * @param {object} [hitArea] - A Geometry shape instance, such as Phaser.Geom.Ellipse, or your own custom shape. If not given it will try to create a Rectangle based on the size of this zone. - * @param {Phaser.Types.Input.HitAreaCallback} [hitAreaCallback] - A function that will return `true` if the given x/y coords it is sent are within the shape. If you provide a shape you must also provide a callback. - * - * @return {this} This Game Object. - */ - setDropZone: function (hitArea, hitAreaCallback) - { - if (!this.input) - { - this.setInteractive(hitArea, hitAreaCallback, true); - } - - return this; - }, - - /** - * A NOOP method so you can pass a Zone to a Container. - * Calling this method will do nothing. It is intentionally empty. - * - * @method Phaser.GameObjects.Zone#setAlpha - * @private - * @since 3.11.0 - */ - setAlpha: function () - { - }, - - /** - * A NOOP method so you can pass a Zone to a Container in Canvas. - * Calling this method will do nothing. It is intentionally empty. - * - * @method Phaser.GameObjects.Zone#setBlendMode - * @private - * @since 3.16.2 - */ - setBlendMode: function () - { - }, - - /** - * A Zone does not render. - * - * @method Phaser.GameObjects.Zone#renderCanvas - * @private - * @since 3.53.0 - * - * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. - * @param {Phaser.GameObjects.Image} src - The Game Object being rendered in this call. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested - */ - renderCanvas: function (renderer, src, camera) - { - camera.addToRenderList(src); - }, - - /** - * A Zone does not render. - * - * @method Phaser.GameObjects.Zone#renderWebGL - * @private - * @since 3.53.0 - * - * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. - * @param {Phaser.GameObjects.Image} src - The Game Object being rendered in this call. - * @param {Phaser.Renderer.WebGL.DrawingContext} drawingContext - The current drawing context. - */ - renderWebGL: function (renderer, src, drawingContext) - { - drawingContext.camera.addToRenderList(src); - } - -}); - -module.exports = Zone; +// CJS compatibility wrapper — consumed by the hybrid build pipeline and any +// remaining JS callers during the migration period. Remove once all callers +// are TypeScript. +module.exports = __webpack_require__(58715)["default"]; /***/ }, @@ -105288,37 +106368,11 @@ module.exports = Clone; /***/ }, /***/ 37303 -(module) { - -/** - * @author Richard Davey - * @copyright 2013-2026 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Checks if a given point is inside a Rectangle's bounds. - * - * @function Phaser.Geom.Rectangle.Contains - * @since 3.0.0 - * - * @param {Phaser.Geom.Rectangle} rect - The Rectangle to check. - * @param {number} x - The X coordinate of the point to check. - * @param {number} y - The Y coordinate of the point to check. - * - * @return {boolean} `true` if the point is within the Rectangle's bounds, otherwise `false`. - */ -var Contains = function (rect, x, y) -{ - if (rect.width <= 0 || rect.height <= 0) - { - return false; - } - - return (rect.x <= x && rect.x + rect.width >= x && rect.y <= y && rect.y + rect.height >= y); -}; +(module, __unused_webpack_exports, __webpack_require__) { -module.exports = Contains; +const mod = __webpack_require__(72488); +module.exports = mod.default; +module.exports.Contains = mod.Contains; /***/ }, @@ -106726,518 +107780,9 @@ module.exports = RandomOutside; /***/ 87841 (module, __unused_webpack_exports, __webpack_require__) { -/** - * @author Richard Davey - * @copyright 2013-2026 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(83419); -var Contains = __webpack_require__(37303); -var GetPoint = __webpack_require__(20812); -var GetPoints = __webpack_require__(34819); -var GEOM_CONST = __webpack_require__(23777); -var Line = __webpack_require__(23031); -var Random = __webpack_require__(26597); - -/** - * @classdesc - * A Rectangle is an axis-aligned region of 2D space defined by its top-left corner position (`x`, `y`) and its - * dimensions (`width`, `height`). It is one of the core geometric primitives in Phaser and is used extensively - * throughout the framework for bounds checking, camera viewports, hit areas, culling regions, and UI layout. - * - * Rectangles support containment tests, perimeter point sampling, and many other geometric operations available - * via the `Phaser.Geom.Rectangle` static methods. The `left`, `right`, `top`, `bottom`, `centerX`, and `centerY` - * properties provide convenient access to derived positional values and can be set directly to reposition or - * resize the Rectangle. - * - * @class Rectangle - * @memberof Phaser.Geom - * @constructor - * @since 3.0.0 - * - * @param {number} [x=0] - The X coordinate of the top left corner of the Rectangle. - * @param {number} [y=0] - The Y coordinate of the top left corner of the Rectangle. - * @param {number} [width=0] - The width of the Rectangle. - * @param {number} [height=0] - The height of the Rectangle. - */ -var Rectangle = new Class({ - - initialize: - - function Rectangle (x, y, width, height) - { - if (x === undefined) { x = 0; } - if (y === undefined) { y = 0; } - if (width === undefined) { width = 0; } - if (height === undefined) { height = 0; } - - /** - * The geometry constant type of this object: `GEOM_CONST.RECTANGLE`. - * Used for fast type comparisons. - * - * @name Phaser.Geom.Rectangle#type - * @type {number} - * @readonly - * @since 3.19.0 - */ - this.type = GEOM_CONST.RECTANGLE; - - /** - * The X coordinate of the top left corner of the Rectangle. - * - * @name Phaser.Geom.Rectangle#x - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.x = x; - - /** - * The Y coordinate of the top left corner of the Rectangle. - * - * @name Phaser.Geom.Rectangle#y - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.y = y; - - /** - * The width of the Rectangle, i.e. the distance between its left side (defined by `x`) and its right side. - * - * @name Phaser.Geom.Rectangle#width - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.width = width; - - /** - * The height of the Rectangle, i.e. the distance between its top side (defined by `y`) and its bottom side. - * - * @name Phaser.Geom.Rectangle#height - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.height = height; - }, - - /** - * Checks if the given point is inside the Rectangle's bounds. - * - * @method Phaser.Geom.Rectangle#contains - * @since 3.0.0 - * - * @param {number} x - The X coordinate of the point to check. - * @param {number} y - The Y coordinate of the point to check. - * - * @return {boolean} `true` if the point is within the Rectangle's bounds, otherwise `false`. - */ - contains: function (x, y) - { - return Contains(this, x, y); - }, - - /** - * Calculates the coordinates of a point at a certain `position` on the Rectangle's perimeter. - * - * The `position` is a fraction between 0 and 1 which defines how far into the perimeter the point is. - * - * A value of 0 or 1 returns the point at the top left corner of the rectangle, while a value of 0.5 returns the point at the bottom right corner of the rectangle. Values between 0 and 0.5 are on the top or the right side and values between 0.5 and 1 are on the bottom or the left side. - * - * @method Phaser.Geom.Rectangle#getPoint - * @since 3.0.0 - * - * @generic {Phaser.Math.Vector2} O - [output,$return] - * - * @param {number} position - The normalized distance into the Rectangle's perimeter to return. - * @param {Phaser.Math.Vector2} [output] - A Vector2 instance to update with the `x` and `y` coordinates of the point. - * - * @return {Phaser.Math.Vector2} The updated `output` object, or a new Vector2 if no `output` object was given. - */ - getPoint: function (position, output) - { - return GetPoint(this, position, output); - }, - - /** - * Returns an array of points from the perimeter of the Rectangle, each spaced out based on the quantity or step required. - * - * @method Phaser.Geom.Rectangle#getPoints - * @since 3.0.0 - * - * @generic {Phaser.Math.Vector2[]} O - [output,$return] - * - * @param {number} quantity - The number of points to return. Set to `false` or 0 to return an arbitrary number of points (`perimeter / stepRate`) evenly spaced around the Rectangle based on the `stepRate`. - * @param {number} [stepRate] - If `quantity` is 0, determines the normalized distance between each returned point. - * @param {Phaser.Math.Vector2[]} [output] - An array to which to append the points. - * - * @return {Phaser.Math.Vector2[]} The modified `output` array, or a new array if none was provided. - */ - getPoints: function (quantity, stepRate, output) - { - return GetPoints(this, quantity, stepRate, output); - }, - - /** - * Returns a random point within the Rectangle's bounds. - * - * @method Phaser.Geom.Rectangle#getRandomPoint - * @since 3.0.0 - * - * @generic {Phaser.Math.Vector2} O - [point,$return] - * - * @param {Phaser.Math.Vector2} [vec] - The object in which to store the `x` and `y` coordinates of the point. - * - * @return {Phaser.Math.Vector2} The updated `vec`, or a new Vector2 if none was provided. - */ - getRandomPoint: function (vec) - { - return Random(this, vec); - }, - - /** - * Sets the position, width, and height of the Rectangle. - * - * @method Phaser.Geom.Rectangle#setTo - * @since 3.0.0 - * - * @param {number} x - The X coordinate of the top left corner of the Rectangle. - * @param {number} y - The Y coordinate of the top left corner of the Rectangle. - * @param {number} width - The width of the Rectangle. - * @param {number} height - The height of the Rectangle. - * - * @return {this} This Rectangle object. - */ - setTo: function (x, y, width, height) - { - this.x = x; - this.y = y; - this.width = width; - this.height = height; - - return this; - }, - - /** - * Resets the position, width, and height of the Rectangle to 0. - * - * @method Phaser.Geom.Rectangle#setEmpty - * @since 3.0.0 - * - * @return {this} This Rectangle object. - */ - setEmpty: function () - { - return this.setTo(0, 0, 0, 0); - }, - - /** - * Sets the position of the Rectangle. - * - * @method Phaser.Geom.Rectangle#setPosition - * @since 3.0.0 - * - * @param {number} x - The X coordinate of the top left corner of the Rectangle. - * @param {number} [y=x] - The Y coordinate of the top left corner of the Rectangle. - * - * @return {this} This Rectangle object. - */ - setPosition: function (x, y) - { - if (y === undefined) { y = x; } - - this.x = x; - this.y = y; - - return this; - }, - - /** - * Sets the width and height of the Rectangle. - * - * @method Phaser.Geom.Rectangle#setSize - * @since 3.0.0 - * - * @param {number} width - The width to set the Rectangle to. - * @param {number} [height=width] - The height to set the Rectangle to. - * - * @return {this} This Rectangle object. - */ - setSize: function (width, height) - { - if (height === undefined) { height = width; } - - this.width = width; - this.height = height; - - return this; - }, - - /** - * Determines if the Rectangle is empty. A Rectangle is empty if its width or height is less than or equal to 0. - * - * @method Phaser.Geom.Rectangle#isEmpty - * @since 3.0.0 - * - * @return {boolean} `true` if the Rectangle is empty, otherwise `false`. - */ - isEmpty: function () - { - return (this.width <= 0 || this.height <= 0); - }, - - /** - * Returns a Line object that corresponds to the top of this Rectangle. - * - * @method Phaser.Geom.Rectangle#getLineA - * @since 3.0.0 - * - * @generic {Phaser.Geom.Line} O - [line,$return] - * - * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. - * - * @return {Phaser.Geom.Line} A Line object that corresponds to the top of this Rectangle. - */ - getLineA: function (line) - { - if (line === undefined) { line = new Line(); } - - line.setTo(this.x, this.y, this.right, this.y); - - return line; - }, - - /** - * Returns a Line object that corresponds to the right of this Rectangle. - * - * @method Phaser.Geom.Rectangle#getLineB - * @since 3.0.0 - * - * @generic {Phaser.Geom.Line} O - [line,$return] - * - * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. - * - * @return {Phaser.Geom.Line} A Line object that corresponds to the right of this Rectangle. - */ - getLineB: function (line) - { - if (line === undefined) { line = new Line(); } - - line.setTo(this.right, this.y, this.right, this.bottom); - - return line; - }, - - /** - * Returns a Line object that corresponds to the bottom of this Rectangle. - * - * @method Phaser.Geom.Rectangle#getLineC - * @since 3.0.0 - * - * @generic {Phaser.Geom.Line} O - [line,$return] - * - * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. - * - * @return {Phaser.Geom.Line} A Line object that corresponds to the bottom of this Rectangle. - */ - getLineC: function (line) - { - if (line === undefined) { line = new Line(); } - - line.setTo(this.right, this.bottom, this.x, this.bottom); - - return line; - }, - - /** - * Returns a Line object that corresponds to the left of this Rectangle. - * - * @method Phaser.Geom.Rectangle#getLineD - * @since 3.0.0 - * - * @generic {Phaser.Geom.Line} O - [line,$return] - * - * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. - * - * @return {Phaser.Geom.Line} A Line object that corresponds to the left of this Rectangle. - */ - getLineD: function (line) - { - if (line === undefined) { line = new Line(); } - - line.setTo(this.x, this.bottom, this.x, this.y); - - return line; - }, - - /** - * The x coordinate of the left of the Rectangle. - * Changing the left property of a Rectangle object has no effect on the y and height properties. However it does affect the width property, whereas changing the x value does not affect the width property. - * - * @name Phaser.Geom.Rectangle#left - * @type {number} - * @since 3.0.0 - */ - left: { - - get: function () - { - return this.x; - }, - - set: function (value) - { - if (value >= this.right) - { - this.width = 0; - } - else - { - this.width = this.right - value; - } - - this.x = value; - } - - }, - - /** - * The sum of the x and width properties. - * Changing the right property of a Rectangle object has no effect on the x, y and height properties, however it does affect the width property. - * - * @name Phaser.Geom.Rectangle#right - * @type {number} - * @since 3.0.0 - */ - right: { - - get: function () - { - return this.x + this.width; - }, - - set: function (value) - { - if (value <= this.x) - { - this.width = 0; - } - else - { - this.width = value - this.x; - } - } - - }, - - /** - * The y coordinate of the top of the Rectangle. Changing the top property of a Rectangle object has no effect on the x and width properties. - * However it does affect the height property, whereas changing the y value does not affect the height property. - * - * @name Phaser.Geom.Rectangle#top - * @type {number} - * @since 3.0.0 - */ - top: { - - get: function () - { - return this.y; - }, - - set: function (value) - { - if (value >= this.bottom) - { - this.height = 0; - } - else - { - this.height = (this.bottom - value); - } - - this.y = value; - } - - }, - - /** - * The sum of the y and height properties. - * Changing the bottom property of a Rectangle object has no effect on the x, y and width properties, but does change the height property. - * - * @name Phaser.Geom.Rectangle#bottom - * @type {number} - * @since 3.0.0 - */ - bottom: { - - get: function () - { - return this.y + this.height; - }, - - set: function (value) - { - if (value <= this.y) - { - this.height = 0; - } - else - { - this.height = value - this.y; - } - } - - }, - - /** - * The x coordinate of the center of the Rectangle. - * - * @name Phaser.Geom.Rectangle#centerX - * @type {number} - * @since 3.0.0 - */ - centerX: { - - get: function () - { - return this.x + (this.width / 2); - }, - - set: function (value) - { - this.x = value - (this.width / 2); - } - - }, - - /** - * The y coordinate of the center of the Rectangle. - * - * @name Phaser.Geom.Rectangle#centerY - * @type {number} - * @since 3.0.0 - */ - centerY: { - - get: function () - { - return this.y + (this.height / 2); - }, - - set: function (value) - { - this.y = value - (this.height / 2); - } - - } - -}); - -module.exports = Rectangle; +const mod = __webpack_require__(59428); +module.exports = mod.default; +module.exports.Rectangle = mod.Rectangle; /***/ }, @@ -124022,13 +124567,11 @@ module.exports = MouseManager; * @namespace Phaser.Input.Mouse */ -/* eslint-disable */ module.exports = { MouseManager: __webpack_require__(85098) }; -/* eslint-enable */ /***/ }, @@ -124454,13 +124997,11 @@ module.exports = TouchManager; * @namespace Phaser.Input.Touch */ -/* eslint-disable */ module.exports = { TouchManager: __webpack_require__(36210) }; -/* eslint-enable */ /***/ }, @@ -136317,32 +136858,9 @@ module.exports = CeilTo; /***/ }, /***/ 45319 -(module) { - -/** - * @author Richard Davey - * @copyright 2013-2026 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Force a value within the boundaries by clamping it to the range `min`, `max`. - * - * @function Phaser.Math.Clamp - * @since 3.0.0 - * - * @param {number} value - The value to be clamped. - * @param {number} min - The minimum bounds. - * @param {number} max - The maximum bounds. - * - * @return {number} The clamped value. - */ -var Clamp = function (value, min, max) -{ - return Math.max(min, Math.min(max, value)); -}; +(module, __unused_webpack_exports, __webpack_require__) { -module.exports = Clamp; +module.exports = __webpack_require__(350)["default"]; /***/ }, @@ -142707,870 +143225,7 @@ module.exports = TransformXY; /***/ 26099 (module, __unused_webpack_exports, __webpack_require__) { -/** - * @author Richard Davey - * @copyright 2013-2026 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji -// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl - -var Class = __webpack_require__(83419); -var FuzzyEqual = __webpack_require__(43855); - -/** - * @classdesc - * A representation of a vector in 2D space, defined by an `x` and `y` component. - * - * Vector2 is used throughout Phaser for positions, directions, velocities, and other - * quantities that have both magnitude and direction. It provides methods for common - * vector operations such as addition, subtraction, scaling, normalization, dot and - * cross products, linear interpolation, and rotation. Many Phaser APIs accept a - * `Vector2Like` object (any object with `x` and `y` number properties), making - * Vector2 easy to integrate across the framework. - * - * @class Vector2 - * @memberof Phaser.Math - * @constructor - * @since 3.0.0 - * - * @param {number|Phaser.Types.Math.Vector2Like} [x=0] - The x component, or an object with `x` and `y` properties. - * @param {number} [y=x] - The y component. - */ -var Vector2 = new Class({ - - initialize: - - function Vector2 (x, y) - { - /** - * The x component of this Vector. - * - * @name Phaser.Math.Vector2#x - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.x = 0; - - /** - * The y component of this Vector. - * - * @name Phaser.Math.Vector2#y - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.y = 0; - - if (typeof x === 'object') - { - this.x = x.x || 0; - this.y = x.y || 0; - } - else - { - if (y === undefined) { y = x; } - - this.x = x || 0; - this.y = y || 0; - } - }, - - /** - * Make a clone of this Vector2. - * - * @method Phaser.Math.Vector2#clone - * @since 3.0.0 - * - * @return {Phaser.Math.Vector2} A clone of this Vector2. - */ - clone: function () - { - return new Vector2(this.x, this.y); - }, - - /** - * Copy the components of a given Vector into this Vector. - * - * @method Phaser.Math.Vector2#copy - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector to copy the components from. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - copy: function (src) - { - this.x = src.x || 0; - this.y = src.y || 0; - - return this; - }, - - /** - * Set the component values of this Vector from a given Vector2Like object. - * - * @method Phaser.Math.Vector2#setFromObject - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} obj - The object containing the component values to set for this Vector. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - setFromObject: function (obj) - { - this.x = obj.x || 0; - this.y = obj.y || 0; - - return this; - }, - - /** - * Set the `x` and `y` components of this Vector to the given `x` and `y` values. - * - * @method Phaser.Math.Vector2#set - * @since 3.0.0 - * - * @param {number} x - The x value to set for this Vector. - * @param {number} [y=x] - The y value to set for this Vector. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - set: function (x, y) - { - if (y === undefined) { y = x; } - - this.x = x; - this.y = y; - - return this; - }, - - /** - * This method is an alias for `Vector2.set`. - * - * @method Phaser.Math.Vector2#setTo - * @since 3.4.0 - * - * @param {number} x - The x value to set for this Vector. - * @param {number} [y=x] - The y value to set for this Vector. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - setTo: function (x, y) - { - return this.set(x, y); - }, - - /** - * Runs the x and y components of this Vector2 through Math.ceil and then sets them. - * - * @method Phaser.Math.Vector2#ceil - * @since 4.0.0 - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - ceil: function () - { - this.x = Math.ceil(this.x); - this.y = Math.ceil(this.y); - - return this; - }, - - /** - * Runs the x and y components of this Vector2 through Math.floor and then sets them. - * - * @method Phaser.Math.Vector2#floor - * @since 4.0.0 - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - floor: function () - { - this.x = Math.floor(this.x); - this.y = Math.floor(this.y); - - return this; - }, - - /** - * Swaps the x and y components of this Vector2. - * - * @method Phaser.Math.Vector2#invert - * @since 4.0.0 - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - invert: function () - { - return this.set(this.y, this.x); - }, - - /** - * Sets the x and y components of this Vector from the given angle and length. - * - * @method Phaser.Math.Vector2#setToPolar - * @since 3.0.0 - * - * @param {number} angle - The angle from the positive x-axis, in radians. - * @param {number} [length=1] - The distance from the origin. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - setToPolar: function (angle, length) - { - if (length == null) { length = 1; } - - this.x = Math.cos(angle) * length; - this.y = Math.sin(angle) * length; - - return this; - }, - - /** - * Check whether this Vector is equal to a given Vector. - * - * Performs a strict equality check against each Vector's components. - * - * @method Phaser.Math.Vector2#equals - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} v - The vector to compare with this Vector. - * - * @return {boolean} Whether the given Vector is equal to this Vector. - */ - equals: function (v) - { - return ((this.x === v.x) && (this.y === v.y)); - }, - - /** - * Check whether this Vector is approximately equal to a given Vector. - * - * @method Phaser.Math.Vector2#fuzzyEquals - * @since 3.23.0 - * - * @param {Phaser.Types.Math.Vector2Like} v - The vector to compare with this Vector. - * @param {number} [epsilon=0.0001] - The tolerance value. - * - * @return {boolean} Whether both absolute differences of the x and y components are smaller than `epsilon`. - */ - fuzzyEquals: function (v, epsilon) - { - return (FuzzyEqual(this.x, v.x, epsilon) && FuzzyEqual(this.y, v.y, epsilon)); - }, - - /** - * Calculate the angle between this Vector and the positive x-axis, in radians. - * - * @method Phaser.Math.Vector2#angle - * @since 3.0.0 - * - * @return {number} The angle between this Vector, and the positive x-axis, given in radians. - */ - angle: function () - { - // computes the angle in radians with respect to the positive x-axis - - var angle = Math.atan2(this.y, this.x); - - if (angle < 0) - { - angle += 2 * Math.PI; - } - - return angle; - }, - - /** - * Set the angle of this Vector. - * - * @method Phaser.Math.Vector2#setAngle - * @since 3.23.0 - * - * @param {number} angle - The angle, in radians. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - setAngle: function (angle) - { - return this.setToPolar(angle, this.length()); - }, - - /** - * Add a given Vector to this Vector. Addition is component-wise. - * - * @method Phaser.Math.Vector2#add - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector to add to this Vector. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - add: function (src) - { - this.x += src.x; - this.y += src.y; - - return this; - }, - - /** - * Subtract the given Vector from this Vector. Subtraction is component-wise. - * - * @method Phaser.Math.Vector2#subtract - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector to subtract from this Vector. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - subtract: function (src) - { - this.x -= src.x; - this.y -= src.y; - - return this; - }, - - /** - * Perform a component-wise multiplication between this Vector and the given Vector. - * - * Multiplies this Vector by the given Vector. - * - * @method Phaser.Math.Vector2#multiply - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector to multiply this Vector by. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - multiply: function (src) - { - this.x *= src.x; - this.y *= src.y; - - return this; - }, - - /** - * Scale this Vector by the given value. - * - * @method Phaser.Math.Vector2#scale - * @since 3.0.0 - * - * @param {number} value - The value to scale this Vector by. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - scale: function (value) - { - if (isFinite(value)) - { - this.x *= value; - this.y *= value; - } - else - { - this.x = 0; - this.y = 0; - } - - return this; - }, - - /** - * Perform a component-wise division between this Vector and the given Vector. - * - * Divides this Vector by the given Vector. - * - * @method Phaser.Math.Vector2#divide - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector to divide this Vector by. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - divide: function (src) - { - this.x /= src.x; - this.y /= src.y; - - return this; - }, - - /** - * Negate the `x` and `y` components of this Vector. - * - * @method Phaser.Math.Vector2#negate - * @since 3.0.0 - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - negate: function () - { - this.x = -this.x; - this.y = -this.y; - - return this; - }, - - /** - * Calculate the distance between this Vector and the given Vector. - * - * @method Phaser.Math.Vector2#distance - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector to calculate the distance to. - * - * @return {number} The distance from this Vector to the given Vector. - */ - distance: function (src) - { - var dx = src.x - this.x; - var dy = src.y - this.y; - - return Math.sqrt(dx * dx + dy * dy); - }, - - /** - * Calculate the distance between this Vector and the given Vector, squared. - * - * @method Phaser.Math.Vector2#distanceSq - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector to calculate the distance to. - * - * @return {number} The distance from this Vector to the given Vector, squared. - */ - distanceSq: function (src) - { - var dx = src.x - this.x; - var dy = src.y - this.y; - - return dx * dx + dy * dy; - }, - - /** - * Calculate the length (or magnitude) of this Vector. - * - * @method Phaser.Math.Vector2#length - * @since 3.0.0 - * - * @return {number} The length of this Vector. - */ - length: function () - { - var x = this.x; - var y = this.y; - - return Math.sqrt(x * x + y * y); - }, - - /** - * Set the length (or magnitude) of this Vector. - * - * @method Phaser.Math.Vector2#setLength - * @since 3.23.0 - * - * @param {number} length - The new magnitude of this Vector. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - setLength: function (length) - { - return this.normalize().scale(length); - }, - - /** - * Calculate the length of this Vector squared. - * - * @method Phaser.Math.Vector2#lengthSq - * @since 3.0.0 - * - * @return {number} The length of this Vector, squared. - */ - lengthSq: function () - { - var x = this.x; - var y = this.y; - - return x * x + y * y; - }, - - /** - * Normalize this Vector. - * - * Makes the vector a unit length vector (magnitude of 1) in the same direction. - * - * @method Phaser.Math.Vector2#normalize - * @since 3.0.0 - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - normalize: function () - { - var x = this.x; - var y = this.y; - var len = x * x + y * y; - - if (len > 0) - { - len = 1 / Math.sqrt(len); - - this.x = x * len; - this.y = y * len; - } - - return this; - }, - - /** - * Rotate this Vector to its perpendicular, in the positive direction. - * - * @method Phaser.Math.Vector2#normalizeRightHand - * @since 3.0.0 - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - normalizeRightHand: function () - { - var x = this.x; - - this.x = this.y * -1; - this.y = x; - - return this; - }, - - /** - * Rotate this Vector to its perpendicular, in the negative direction. - * - * @method Phaser.Math.Vector2#normalizeLeftHand - * @since 3.23.0 - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - normalizeLeftHand: function () - { - var x = this.x; - - this.x = this.y; - this.y = x * -1; - - return this; - }, - - /** - * Calculate the dot product of this Vector and the given Vector. - * - * @method Phaser.Math.Vector2#dot - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector2 to dot product with this Vector2. - * - * @return {number} The dot product of this Vector and the given Vector. - */ - dot: function (src) - { - return this.x * src.x + this.y * src.y; - }, - - /** - * Calculate the cross product of this Vector and the given Vector. - * - * @method Phaser.Math.Vector2#cross - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector2 to cross with this Vector2. - * - * @return {number} The cross product of this Vector and the given Vector. - */ - cross: function (src) - { - return this.x * src.y - this.y * src.x; - }, - - /** - * Linearly interpolate between this Vector and the given Vector. - * - * Interpolates this Vector towards the given Vector. - * - * @method Phaser.Math.Vector2#lerp - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector2 to interpolate towards. - * @param {number} [t=0] - The interpolation percentage, between 0 and 1. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - lerp: function (src, t) - { - if (t === undefined) { t = 0; } - - var ax = this.x; - var ay = this.y; - - this.x = ax + t * (src.x - ax); - this.y = ay + t * (src.y - ay); - - return this; - }, - - /** - * Transform this Vector with the given Matrix3. - * - * @method Phaser.Math.Vector2#transformMat3 - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix3} mat - The Matrix3 to transform this Vector2 with. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - transformMat3: function (mat) - { - var x = this.x; - var y = this.y; - var m = mat.val; - - this.x = m[0] * x + m[3] * y + m[6]; - this.y = m[1] * x + m[4] * y + m[7]; - - return this; - }, - - /** - * Transform this Vector with the given Matrix4. - * - * @method Phaser.Math.Vector2#transformMat4 - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector2 with. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - transformMat4: function (mat) - { - var x = this.x; - var y = this.y; - var m = mat.val; - - this.x = m[0] * x + m[4] * y + m[12]; - this.y = m[1] * x + m[5] * y + m[13]; - - return this; - }, - - /** - * Make this Vector the zero vector (0, 0). - * - * @method Phaser.Math.Vector2#reset - * @since 3.0.0 - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - reset: function () - { - this.x = 0; - this.y = 0; - - return this; - }, - - /** - * Limit the length (or magnitude) of this Vector. - * - * @method Phaser.Math.Vector2#limit - * @since 3.23.0 - * - * @param {number} max - The maximum length. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - limit: function (max) - { - var len = this.length(); - - if (len && len > max) - { - this.scale(max / len); - } - - return this; - }, - - /** - * Reflect this Vector off a line defined by a normal. - * - * @method Phaser.Math.Vector2#reflect - * @since 3.23.0 - * - * @param {Phaser.Math.Vector2} normal - A vector perpendicular to the line. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - reflect: function (normal) - { - normal = normal.clone().normalize(); - - return this.subtract(normal.scale(2 * this.dot(normal))); - }, - - /** - * Reflect this Vector across another. - * - * @method Phaser.Math.Vector2#mirror - * @since 3.23.0 - * - * @param {Phaser.Math.Vector2} axis - A vector to reflect across. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - mirror: function (axis) - { - return this.reflect(axis).negate(); - }, - - /** - * Rotate this Vector by an angle amount. - * - * @method Phaser.Math.Vector2#rotate - * @since 3.23.0 - * - * @param {number} delta - The angle to rotate by, in radians. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - rotate: function (delta) - { - var cos = Math.cos(delta); - var sin = Math.sin(delta); - - return this.set(cos * this.x - sin * this.y, sin * this.x + cos * this.y); - }, - - /** - * Project this Vector onto another. - * - * @method Phaser.Math.Vector2#project - * @since 3.60.0 - * - * @param {Phaser.Math.Vector2} src - The vector to project onto. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - project: function (src) - { - var scalar = this.dot(src) / src.dot(src); - - return this.copy(src).scale(scalar); - }, - - /** - * Calculates the vector projection of this Vector2 onto the non-zero `vecB`. This is the - * orthogonal projection of this vector onto a straight line parallel to `vecB`. - * - * @method Phaser.Math.Vector2#projectUnit - * @since 4.0.0 - * - * @param {Phaser.Math.Vector2} vecB - The vector to project onto. - * @param {Phaser.Math.Vector2} [out] - The Vector2 object to store the position in. If not given, a new Vector2 instance is created. - * - * @return {Phaser.Math.Vector2} The `out` Vector2 containing the projected values. - */ - projectUnit: function (vecB, out) - { - if (out === undefined) { out = new Vector2(); } - - var amt = ((this.x * vecB.x) + (this.y * vecB.y)); - - if (amt !== 0) - { - out.x = amt * vecB.x; - out.y = amt * vecB.y; - } - - return out; - } - -}); - -/** - * A static zero Vector2 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector2.ZERO - * @type {Phaser.Math.Vector2} - * @since 3.1.0 - */ -Vector2.ZERO = new Vector2(); - -/** - * A static right Vector2 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector2.RIGHT - * @type {Phaser.Math.Vector2} - * @since 3.16.0 - */ -Vector2.RIGHT = new Vector2(1, 0); - -/** - * A static left Vector2 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector2.LEFT - * @type {Phaser.Math.Vector2} - * @since 3.16.0 - */ -Vector2.LEFT = new Vector2(-1, 0); - -/** - * A static up Vector2 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector2.UP - * @type {Phaser.Math.Vector2} - * @since 3.16.0 - */ -Vector2.UP = new Vector2(0, -1); - -/** - * A static down Vector2 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector2.DOWN - * @type {Phaser.Math.Vector2} - * @since 3.16.0 - */ -Vector2.DOWN = new Vector2(0, 1); - -/** - * A static one Vector2 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector2.ONE - * @type {Phaser.Math.Vector2} - * @since 3.16.0 - */ -Vector2.ONE = new Vector2(1, 1); - -module.exports = Vector2; +module.exports = __webpack_require__(70038)["default"]; /***/ }, @@ -145232,39 +144887,9 @@ module.exports = Within; /***/ }, /***/ 15994 -(module) { - -/** - * @author Richard Davey - * @copyright 2013-2026 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Wrap the given `value` between `min` (inclusive) and `max` (exclusive). - * - * When the value exceeds `max` it wraps back around to `min`, and when it falls - * below `min` it wraps around to just below `max`. This is useful for cycling - * through a range, such as keeping an angle within 0–360 degrees or looping a - * tile index within a tileset. - * - * @function Phaser.Math.Wrap - * @since 3.0.0 - * - * @param {number} value - The value to wrap. - * @param {number} min - The minimum bound of the range (inclusive). - * @param {number} max - The maximum bound of the range (exclusive). - * - * @return {number} The wrapped value, guaranteed to be within `[min, max)`. - */ -var Wrap = function (value, min, max) -{ - var range = max - min; - - return (min + ((((value - min) % range) + range) % range)); -}; +(module, __unused_webpack_exports, __webpack_require__) { -module.exports = Wrap; +module.exports = __webpack_require__(68077)["default"]; /***/ }, @@ -147971,36 +147596,9 @@ module.exports = Ceil; /***/ }, /***/ 43855 -(module) { - -/** - * @author Richard Davey - * @copyright 2013-2026 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Check whether the given values are fuzzily equal. - * - * Two numbers are fuzzily equal if their difference is less than `epsilon`. - * - * @function Phaser.Math.Fuzzy.Equal - * @since 3.0.0 - * - * @param {number} a - The first value. - * @param {number} b - The second value. - * @param {number} [epsilon=0.0001] - The maximum absolute difference below which the two values are considered equal. - * - * @return {boolean} `true` if the values are fuzzily equal, otherwise `false`. - */ -var Equal = function (a, b, epsilon) -{ - if (epsilon === undefined) { epsilon = 0.0001; } - - return Math.abs(a - b) < epsilon; -}; +(module, __unused_webpack_exports, __webpack_require__) { -module.exports = Equal; +module.exports = __webpack_require__(30010)["default"]; /***/ }, @@ -149097,7 +148695,7 @@ var RandomDataGenerator = new Class({ for (b = a = ''; a++ < 36; b += ~a % 5 | a * 3 & 4 ? (a ^ 15 ? 8 ^ this.frac() * (a ^ 20 ? 16 : 4) : 4).toString(16) : '-') { - // eslint-disable-next-line no-empty + // noop } return b; @@ -191786,9 +191384,6 @@ var Camera = new Class({ { var index, filter, padding, renderNode, tint; - // // Mipmap. - // currentContext.texture.needsMipmapRegeneration = true; - // Set up render options. var renderOptions = { smoothPixelArt: manager.renderer.game.config.smoothPixelArt @@ -191812,9 +191407,6 @@ var Camera = new Class({ coverageInternal.width + padding.width, coverageInternal.height + padding.height ); - - // // Mipmap. - // currentContext.texture.needsMipmapRegeneration = true; } var outputContext = currentContext; @@ -191894,9 +191486,6 @@ var Camera = new Class({ quad[7] = Math.round(quad[7]); } - // // Mipmap. - // outputContext.texture.needsMipmapRegeneration = true; - this.batchHandlerQuadSingleNode.batch( currentContext, @@ -191976,9 +191565,6 @@ var Camera = new Class({ padding.y = -padding.y; padding.width = -padding.width; padding.height = -padding.height; - - // // Mipmap. - // currentContext.texture.needsMipmapRegeneration = true; } if (!skipDrawOut) @@ -217152,7 +216738,6 @@ var BaseSound = new Class({ if (!this.markers[marker.name]) { - // eslint-disable-next-line no-console console.warn('Audio Marker: ' + marker.name + ' missing in Sound: ' + this.key); return false; @@ -217226,7 +216811,6 @@ var BaseSound = new Class({ { if (!this.markers[markerName]) { - // eslint-disable-next-line no-console console.warn('Marker: ' + markerName + ' missing in Sound: ' + this.key); return false; @@ -219535,7 +219119,6 @@ var HTML5AudioSound = new Class({ if (playPromise) { - // eslint-disable-next-line no-unused-vars playPromise.catch(function (reason) { console.warn(reason); @@ -221299,7 +220882,6 @@ var NoAudioSoundManager = new Class({ * * @return {boolean} Always 'false' for the No Audio Sound Manager. */ - // eslint-disable-next-line no-unused-vars play: function (key, extra) { return false; @@ -221318,7 +220900,6 @@ var NoAudioSoundManager = new Class({ * * @return {boolean} Always 'false' for the No Audio Sound Manager. */ - // eslint-disable-next-line no-unused-vars playAudioSprite: function (key, spriteName, config) { return false; @@ -224203,404 +223784,7 @@ module.exports = List; /***/ 90330 (module, __unused_webpack_exports, __webpack_require__) { -/** - * @author Richard Davey - * @copyright 2013-2026 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(83419); - -/** - * @callback EachMapCallback - * - * @param {string} key - The key of the Map entry. - * @param {E} entry - The value of the Map entry. - * - * @return {?boolean} The callback result. - */ - -/** - * @classdesc - * A custom Map implementation that stores entries as key-value pairs with ordered iteration. - * Unlike a native JavaScript Map, it also maintains an internal array of entries for efficient - * indexed access and iteration. Supports filtering, merging, and contains/size operations. - * Used internally by various Phaser systems for managing collections. - * - * ```javascript - * var map = new Map([ - * [ 1, 'one' ], - * [ 2, 'two' ], - * [ 3, 'three' ] - * ]); - * ``` - * - * @class Map - * @memberof Phaser.Structs - * @constructor - * @since 3.0.0 - * - * @generic K - * @generic V - * @genericUse {V[]} - [elements] - * - * @param {Array.<*>} elements - An optional array of key-value pairs to populate this Map with. - */ -var Map = new Class({ - - initialize: - - function Map (elements) - { - /** - * The entries in this Map. - * - * @genericUse {Object.} - [$type] - * - * @name Phaser.Structs.Map#entries - * @type {Object.} - * @default {} - * @since 3.0.0 - */ - this.entries = {}; - - /** - * The number of key / value pairs in this Map. - * - * @name Phaser.Structs.Map#size - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.size = 0; - - this.setAll(elements); - }, - - /** - * Adds all the elements in the given array to this Map. - * - * If the key already exists, the value will be replaced. - * - * @method Phaser.Structs.Map#setAll - * @since 3.70.0 - * - * @generic K - * @generic V - * @genericUse {V[]} - [elements] - * - * @param {Array.<*>} elements - An array of key-value pairs to populate this Map with. - * - * @return {this} This Map object. - */ - setAll: function (elements) - { - if (Array.isArray(elements)) - { - for (var i = 0; i < elements.length; i++) - { - this.set(elements[i][0], elements[i][1]); - } - } - - return this; - }, - - /** - * Adds an element with a specified `key` and `value` to this Map. - * - * If the `key` already exists, the value will be replaced. - * - * If you wish to add multiple elements in a single call, use the `setAll` method instead. - * - * @method Phaser.Structs.Map#set - * @since 3.0.0 - * - * @genericUse {K} - [key] - * @genericUse {V} - [value] - * @genericUse {Phaser.Structs.Map.} - [$return] - * - * @param {string} key - The key of the element to be added to this Map. - * @param {*} value - The value of the element to be added to this Map. - * - * @return {this} This Map object. - */ - set: function (key, value) - { - if (!this.has(key)) - { - this.size++; - } - - this.entries[key] = value; - - return this; - }, - - /** - * Returns the value associated to the `key`, or `undefined` if there is none. - * - * @method Phaser.Structs.Map#get - * @since 3.0.0 - * - * @genericUse {K} - [key] - * @genericUse {V} - [$return] - * - * @param {string} key - The key of the element to return from the `Map` object. - * - * @return {*} The element associated with the specified key or `undefined` if the key can't be found in this Map object. - */ - get: function (key) - { - if (this.has(key)) - { - return this.entries[key]; - } - }, - - /** - * Returns an `Array` of all the values stored in this Map. - * - * @method Phaser.Structs.Map#getArray - * @since 3.0.0 - * - * @genericUse {V[]} - [$return] - * - * @return {Array.<*>} An array of the values stored in this Map. - */ - getArray: function () - { - var output = []; - var entries = this.entries; - - for (var key in entries) - { - output.push(entries[key]); - } - - return output; - }, - - /** - * Returns a boolean indicating whether an element with the specified key exists or not. - * - * @method Phaser.Structs.Map#has - * @since 3.0.0 - * - * @genericUse {K} - [key] - * - * @param {string} key - The key of the element to test for presence of in this Map. - * - * @return {boolean} Returns `true` if an element with the specified key exists in this Map, otherwise `false`. - */ - has: function (key) - { - return (this.entries.hasOwnProperty(key)); - }, - - /** - * Delete the specified element from this Map. - * - * @method Phaser.Structs.Map#delete - * @since 3.0.0 - * - * @genericUse {K} - [key] - * @genericUse {Phaser.Structs.Map.} - [$return] - * - * @param {string} key - The key of the element to delete from this Map. - * - * @return {this} This Map object. - */ - delete: function (key) - { - if (this.has(key)) - { - delete this.entries[key]; - this.size--; - } - - return this; - }, - - /** - * Delete all entries from this Map. - * - * @method Phaser.Structs.Map#clear - * @since 3.0.0 - * - * @genericUse {Phaser.Structs.Map.} - [$return] - * - * @return {this} This Map object. - */ - clear: function () - { - Object.keys(this.entries).forEach(function (prop) - { - delete this.entries[prop]; - - }, this); - - this.size = 0; - - return this; - }, - - /** - * Returns an array of all entry keys in this Map. - * - * @method Phaser.Structs.Map#keys - * @since 3.0.0 - * - * @genericUse {K[]} - [$return] - * - * @return {string[]} Array containing entries' keys. - */ - keys: function () - { - return Object.keys(this.entries); - }, - - /** - * Returns an `Array` of all values stored in this Map. - * - * @method Phaser.Structs.Map#values - * @since 3.0.0 - * - * @genericUse {V[]} - [$return] - * - * @return {Array.<*>} An `Array` of values. - */ - values: function () - { - var output = []; - var entries = this.entries; - - for (var key in entries) - { - output.push(entries[key]); - } - - return output; - }, - - /** - * Dumps the contents of this Map to the console via `console.group`. - * - * @method Phaser.Structs.Map#dump - * @since 3.0.0 - */ - dump: function () - { - var entries = this.entries; - - // eslint-disable-next-line no-console - console.group('Map'); - - for (var key in entries) - { - console.log(key, entries[key]); - } - - // eslint-disable-next-line no-console - console.groupEnd(); - }, - - /** - * Iterates through all entries in this Map, passing each one to the given callback. - * - * If the callback returns `false`, the iteration will break. - * - * @method Phaser.Structs.Map#each - * @since 3.0.0 - * - * @genericUse {EachMapCallback.} - [callback] - * @genericUse {Phaser.Structs.Map.} - [$return] - * - * @param {EachMapCallback} callback - The callback which will receive the keys and entries held in this Map. - * - * @return {this} This Map object. - */ - each: function (callback) - { - var entries = this.entries; - - for (var key in entries) - { - if (callback(key, entries[key]) === false) - { - break; - } - } - - return this; - }, - - /** - * Returns `true` if the value exists within this Map. Otherwise, returns `false`. - * - * @method Phaser.Structs.Map#contains - * @since 3.0.0 - * - * @genericUse {V} - [value] - * - * @param {*} value - The value to search for. - * - * @return {boolean} `true` if the value is found, otherwise `false`. - */ - contains: function (value) - { - var entries = this.entries; - - for (var key in entries) - { - if (entries[key] === value) - { - return true; - } - } - - return false; - }, - - /** - * Merges all new keys from the given Map into this one. - * If it encounters a key that already exists it will be skipped unless override is set to `true`. - * - * @method Phaser.Structs.Map#merge - * @since 3.0.0 - * - * @genericUse {Phaser.Structs.Map.} - [map,$return] - * - * @param {Phaser.Structs.Map} map - The Map to merge in to this Map. - * @param {boolean} [override=false] - Set to `true` to replace values in this Map with those from the source map, or `false` to skip them. - * - * @return {this} This Map object. - */ - merge: function (map, override) - { - if (override === undefined) { override = false; } - - var local = this.entries; - var source = map.entries; - - for (var key in source) - { - if (local.hasOwnProperty(key) && override) - { - local[key] = source[key]; - } - else - { - this.set(key, source[key]); - } - } - - return this; - } - -}); - -module.exports = Map; +module.exports = __webpack_require__(60269)["default"]; /***/ }, @@ -233735,7 +232919,7 @@ var resolveFullName = function (raw, folders, extSuffix) } // Extension index: "name~N" (per-name, overrides line-level) - var extMatch = /~([1-5])$/.exec(name); + var extMatch = (/~([1-5])$/).exec(name); if (extMatch) { @@ -233760,7 +232944,7 @@ var expandNames = function (line, folders) { // Check for trailing extension suffix: ~N at very end var extSuffix = ''; - var extMatch = /~([1-5])$/.exec(line); + var extMatch = (/~([1-5])$/).exec(line); if (extMatch) { @@ -237192,7 +236376,7 @@ var Tilemap = new Class({ if (typeof renderOrder === 'number') { - renderOrder = orders[ renderOrder ]; + renderOrder = orders[renderOrder]; } if (orders.indexOf(renderOrder) > -1) @@ -237255,7 +236439,7 @@ var Tilemap = new Class({ return null; } - var tileset = this.tilesets[ index ]; + var tileset = this.tilesets[index]; if (tileset) { @@ -237444,7 +236628,7 @@ var Tilemap = new Class({ return null; } - var layerData = this.layers[ index ]; + var layerData = this.layers[index]; // Check for an associated tilemap layer if (layerData.tilemapLayer) @@ -237668,7 +236852,7 @@ var Tilemap = new Class({ for (var c = 0; c < config.length; c++) { - var singleConfig = config[ c ]; + var singleConfig = config[c]; var id = GetFastValue(singleConfig, 'id', null); var gid = GetFastValue(singleConfig, 'gid', null); @@ -237682,7 +236866,7 @@ var Tilemap = new Class({ // Sweep to get all the objects we want to convert in this pass for (var s = 0; s < objects.length; s++) { - obj = objects[ s ]; + obj = objects[s]; if ( (id === null && gid === null && name === null && type === null) || @@ -237706,7 +236890,7 @@ var Tilemap = new Class({ for (var i = 0; i < toConvert.length; i++) { - obj = toConvert[ i ]; + obj = toConvert[i]; var sprite = new classType(scene); @@ -238096,7 +237280,7 @@ var Tilemap = new Class({ { for (var i = 0; i < location.length; i++) { - if (location[ i ].name === name) + if (location[i].name === name) { return i; } @@ -238119,7 +237303,7 @@ var Tilemap = new Class({ { var index = this.getLayerIndex(layer); - return (index !== null) ? this.layers[ index ] : null; + return (index !== null) ? this.layers[index] : null; }, /** @@ -238136,7 +237320,7 @@ var Tilemap = new Class({ { var index = this.getIndex(this.objects, name); - return (index !== null) ? this.objects[ index ] : null; + return (index !== null) ? this.objects[index] : null; }, /** @@ -238373,7 +237557,7 @@ var Tilemap = new Class({ { var index = this.getIndex(this.tilesets, name); - return (index !== null) ? this.tilesets[ index ] : null; + return (index !== null) ? this.tilesets[index] : null; }, /** @@ -238452,7 +237636,7 @@ var Tilemap = new Class({ layer: { get: function () { - return this.layers[ this.currentLayerIndex ]; + return this.layers[this.currentLayerIndex]; }, set: function (layer) @@ -238665,9 +237849,9 @@ var Tilemap = new Class({ for (var i = index; i < this.layers.length; i++) { - if (this.layers[ i ].tilemapLayer) + if (this.layers[i].tilemapLayer) { - this.layers[ i ].tilemapLayer.layerIndex--; + this.layers[i].tilemapLayer.layerIndex--; } } @@ -238702,7 +237886,7 @@ var Tilemap = new Class({ if (index !== null) { - layer = this.layers[ index ]; + layer = this.layers[index]; layer.tilemapLayer.destroy(); @@ -238735,9 +237919,9 @@ var Tilemap = new Class({ for (var i = 0; i < layers.length; i++) { - if (layers[ i ].tilemapLayer) + if (layers[i].tilemapLayer) { - layers[ i ].tilemapLayer.destroy(false); + layers[i].tilemapLayer.destroy(false); } } @@ -238775,7 +237959,7 @@ var Tilemap = new Class({ for (var i = 0; i < tiles.length; i++) { - var tile = tiles[ i ]; + var tile = tiles[i]; removed.push(this.removeTileAt(tile.x, tile.y, true, recalculateFaces, tile.tilemapLayer)); @@ -238899,7 +238083,7 @@ var Tilemap = new Class({ for (var i = 0; i < layers.length; i++) { - TilemapComponents.RenderDebug(graphics, styleConfig, layers[ i ]); + TilemapComponents.RenderDebug(graphics, styleConfig, layers[i]); } return this; @@ -239203,18 +238387,18 @@ var Tilemap = new Class({ // Update the base tile size on all layers & tiles for (var i = 0; i < this.layers.length; i++) { - this.layers[ i ].baseTileWidth = tileWidth; - this.layers[ i ].baseTileHeight = tileHeight; + this.layers[i].baseTileWidth = tileWidth; + this.layers[i].baseTileHeight = tileHeight; - var mapData = this.layers[ i ].data; - var mapWidth = this.layers[ i ].width; - var mapHeight = this.layers[ i ].height; + var mapData = this.layers[i].data; + var mapWidth = this.layers[i].width; + var mapHeight = this.layers[i].height; for (var row = 0; row < mapHeight; row++) { for (var col = 0; col < mapWidth; col++) { - var tile = mapData[ row ][ col ]; + var tile = mapData[row][col]; if (tile !== null) { @@ -239258,7 +238442,7 @@ var Tilemap = new Class({ { for (var col = 0; col < mapWidth; col++) { - var tile = mapData[ row ][ col ]; + var tile = mapData[row][col]; if (tile !== null) { @@ -264272,6 +263456,18 @@ module.exports = { /******/ } /******/ /************************************************************************/ +/******/ /* webpack/runtime/compat get default export */ +/******/ (() => { +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = (module) => { +/******/ var getter = module && module.__esModule ? +/******/ () => (module['default']) : +/******/ () => (module); +/******/ __webpack_require__.d(getter, { a: getter }); +/******/ return getter; +/******/ }; +/******/ })(); +/******/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports @@ -264301,6 +263497,17 @@ module.exports = { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ /************************************************************************/ var __webpack_exports__ = {}; /* harmony export */ __webpack_require__.d(__webpack_exports__, { diff --git a/dist/phaser.esm.min.js b/dist/phaser.esm.min.js index cfeaa5c94d..5e371b94f8 100644 --- a/dist/phaser.esm.min.js +++ b/dist/phaser.esm.min.js @@ -1 +1 @@ -var t={50792(t){var e=Object.prototype.hasOwnProperty,i="~";function r(){}function s(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function n(t,e,r,n,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var o=new s(r,n||t,a),h=i?i+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],o]:t._events[h].push(o):(t._events[h]=o,t._eventsCount++),t}function a(t,e){0===--t._eventsCount?t._events=new r:delete t._events[e]}function o(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(i=!1)),o.prototype.eventNames=function(){var t,r,s=[];if(0===this._eventsCount)return s;for(r in t=this._events)e.call(t,r)&&s.push(i?r.slice(1):r);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(t)):s},o.prototype.listeners=function(t){var e=i?i+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var s=0,n=r.length,a=new Array(n);s3*Math.PI/2?p.y=1:l>Math.PI?(p.x=1,p.y=1):l>Math.PI/2&&(p.x=1);for(var g=[],m=0;m0&&u.enableFilters().filters.external.addBlur(e.blurQuality,e.blurRadius,e.blurRadius,1,void 0,e.blurSteps),d instanceof r&&d.enableFilters();var f=(e.useInternal?d.filters.internal:d.filters.external).addMask(u,e.invert);h.push(f)}return h}},11517(t,e,i){var r=i(38829);t.exports=function(t,e,i,s){for(var n=t[0],a=1;a=i;r--){var s=t[r],n=!0;for(var a in e)s[a]!==e[a]&&(n=!1);if(n)return s}return null}},94420(t,e,i){var r=i(11879),s=i(60461),n=i(95540),a=i(29747),o=new(i(41481))({sys:{queueDepthSort:a,events:{once:a}}},0,0,1,1).setOrigin(0,0);t.exports=function(t,e){void 0===e&&(e={});var i=e.hasOwnProperty("width"),a=e.hasOwnProperty("height"),h=n(e,"width",-1),l=n(e,"height",-1),u=n(e,"cellWidth",1),d=n(e,"cellHeight",u),c=n(e,"position",s.TOP_LEFT),f=n(e,"x",0),p=n(e,"y",0),g=0,m=0,v=h*u,y=l*d;o.setPosition(f,p),o.setSize(u,d);for(var x=0;x0?s(a,i):i<0&&n(a,Math.abs(i));for(var o=0;o=0;a--)t[a][e]+=i+o*r,o++;return t}},43967(t){t.exports=function(t,e,i,r,s,n){var a;void 0===r&&(r=0),void 0===s&&(s=0),void 0===n&&(n=1);var o=0,h=t.length;if(1===n)for(a=s;a=0;a--)t[a][e]=i+o*r,o++;return t}},88926(t,e,i){var r=i(28176);t.exports=function(t,e){for(var i=0;i=h||-1===l)){var c=t[l],f=c.x,p=c.y;c.x=a,c.y=o,a=f,o=p,0===s?l--:l++}}return n.x=a,n.y=o,n}},8628(t,e,i){var r=i(33680);t.exports=function(t){return r(t)}},21837(t,e,i){var r=i(7602);t.exports=function(t,e,i,s,n){void 0===n&&(n=!1);var a,o=Math.abs(s-i)/t.length;if(n)for(a=0;a0){if(0===t)this.frames=i.concat(this.frames);else if(t===this.frames.length)this.frames=this.frames.concat(i);else{var r=this.frames.slice(0,t),s=this.frames.slice(t);this.frames=r.concat(i,s)}this.updateFrameSequence()}return this},checkFrame:function(t){return t>=0&&t0){n.isLast=!0,n.nextFrame=d[0],d[0].prevFrame=n;var y=1/(d.length-1);for(a=0;a0?t.inReverse&&t.forward?t.forward=!1:this.repeatAnimation(t):t.complete():this.updateAndGetNextTick(t,e.nextFrame)},handleYoyoFrame:function(t,e){if(e||(e=!1),t.inReverse===!e&&t.repeatCounter>0)return(0===t.repeatDelay||t.pendingRepeat)&&(t.forward=e),void this.repeatAnimation(t);if(t.inReverse===e||0!==t.repeatCounter){t.forward=e;var i=e?t.currentFrame.nextFrame:t.currentFrame.prevFrame;this.updateAndGetNextTick(t,i)}else t.complete()},getLastFrame:function(){return this.frames[this.frames.length-1]},previousFrame:function(t){var e=t.currentFrame;e.isFirst?t.yoyo?this.handleYoyoFrame(t,!0):t.repeatCounter>0?(t.inReverse&&!t.forward||(t.forward=!0),this.repeatAnimation(t)):t.complete():this.updateAndGetNextTick(t,e.prevFrame)},updateAndGetNextTick:function(t,e){t.setCurrentFrame(e),this.getNextTick(t)},removeFrame:function(t){var e=this.frames.indexOf(t);return-1!==e&&this.removeFrameAt(e),this},removeFrameAt:function(t){return this.frames.splice(t,1),this.updateFrameSequence(),this},repeatAnimation:function(t){if(2===t._pendingStop){if(0===t._pendingStopValue)return t.stop();t._pendingStopValue--}t.repeatDelay>0&&!t.pendingRepeat?(t.pendingRepeat=!0,t.accumulator-=t.nextTick,t.nextTick+=t.repeatDelay):(t.repeatCounter--,t.forward?t.setCurrentFrame(t.currentFrame.nextFrame):t.setCurrentFrame(t.currentFrame.prevFrame),t.isPlaying&&(this.getNextTick(t),t.handleRepeat()))},toJSON:function(){var t={key:this.key,type:this.type,frames:[],frameRate:this.frameRate,duration:this.duration,skipMissedFrames:this.skipMissedFrames,delay:this.delay,repeat:this.repeat,repeatDelay:this.repeatDelay,yoyo:this.yoyo,showBeforeDelay:this.showBeforeDelay,showOnStart:this.showOnStart,randomFrame:this.randomFrame,hideOnComplete:this.hideOnComplete};return this.frames.forEach(function(e){t.frames.push(e.toJSON())}),t},updateFrameSequence:function(){for(var t,e=this.frames.length,i=1/(e-1),r=0;r1?(t.isLast=!0,t.prevFrame=this.frames[e-2],t.nextFrame=this.frames[0]):e>1&&(t.prevFrame=this.frames[r-1],t.nextFrame=this.frames[r+1]);return this},pause:function(){return this.paused=!0,this},resume:function(){return this.paused=!1,this},destroy:function(){this.manager.off&&(this.manager.off(n.PAUSE_ALL,this.pause,this),this.manager.off(n.RESUME_ALL,this.resume,this)),this.manager.remove(this.key);for(var t=0;t-1)){for(var p=0,g=u;g<=c;g++){var m=g.toString(),v=o[m];if(v){var y=l(v,"duration",d.MAX_SAFE_INTEGER);a.push({key:t,frame:m,duration:y}),p+=y}}"reverse"===f&&(a=a.reverse());var x,T={key:h,frames:a,duration:p,yoyo:"pingpong"===f};i?i.anims&&(x=i.anims.create(T)):x=n.create(T),x&&r.push(x)}});return r},create:function(t){var e=t.key,i=!1;return e&&((i=this.get(e))?console.warn("AnimationManager key already exists: "+e):(i=new r(this,e,t),this.anims.set(e,i),this.emit(o.ADD_ANIMATION,e,i))),i},fromJSON:function(t,e){void 0===e&&(e=!1),e&&this.anims.clear(),"string"==typeof t&&(t=JSON.parse(t));var i=[];if(t.hasOwnProperty("anims")&&Array.isArray(t.anims)){for(var r=0;rn&&(l=0),this.randomFrame&&(l=s(0,n-1));var u=r.frames[l];0!==l||this.forward||(u=r.getLastFrame()),this.currentFrame=u}else console.warn("Missing animation: "+i);return this.parent},pause:function(t){return this._paused||(this._paused=!0,this._wasPlaying=this.isPlaying,this.isPlaying=!1),void 0!==t&&this.setCurrentFrame(t),this.parent},resume:function(t){return this._paused&&(this._paused=!1,this.isPlaying=this._wasPlaying),void 0!==t&&this.setCurrentFrame(t),this.parent},playAfterDelay:function(t,e){if(this.isPlaying){var i=this.nextAnim,r=this.nextAnimsQueue;i&&r.unshift(i),this.nextAnim=t,this._pendingStop=1,this._pendingStopValue=e}else this.delayCounter=e,this.play(t,!0);return this.parent},playAfterRepeat:function(t,e){if(void 0===e&&(e=1),this.isPlaying){var i=this.nextAnim,r=this.nextAnimsQueue;i&&r.unshift(i),-1!==this.repeatCounter&&e>this.repeatCounter&&(e=this.repeatCounter),this.nextAnim=t,this._pendingStop=2,this._pendingStopValue=e}else this.play(t);return this.parent},play:function(t,e){void 0===e&&(e=!1);var i=this.currentAnim,r=this.parent,s="string"==typeof t?t:t.key;if(e&&this.isPlaying&&i.key===s)return r;if(i&&this.isPlaying){var n=this.animationManager.getMix(i.key,t);if(n>0)return this.playAfterDelay(t,n)}return this.forward=!0,this.inReverse=!1,this._paused=!1,this._wasPlaying=!0,this.startAnimation(t)},playReverse:function(t,e){void 0===e&&(e=!1);var i="string"==typeof t?t:t.key;return e&&this.isPlaying&&this.currentAnim.key===i?this.parent:(this.forward=!1,this.inReverse=!0,this._paused=!1,this._wasPlaying=!0,this.startAnimation(t))},startAnimation:function(t){this.load(t);var e=this.currentAnim,i=this.parent;return e?(this.repeatCounter=-1===this.repeat?Number.MAX_VALUE:this.repeat,e.getFirstTick(this),this.isPlaying=!0,this.pendingRepeat=!1,this.hasStarted=!1,this._pendingStop=0,this._pendingStopValue=0,this._paused=!1,this.delayCounter+=this.delay,0===this.delayCounter?this.handleStart():this.showBeforeDelay&&this.setCurrentFrame(this.currentFrame),i):i},handleStart:function(){this.showOnStart&&this.parent.setVisible(!0),this.setCurrentFrame(this.currentFrame),this.hasStarted=!0,this.emitEvents(o.ANIMATION_START)},handleRepeat:function(){this.pendingRepeat=!1,this.emitEvents(o.ANIMATION_REPEAT)},handleStop:function(){this._pendingStop=0,this.isPlaying=!1,this.emitEvents(o.ANIMATION_STOP)},handleComplete:function(){this._pendingStop=0,this.isPlaying=!1,this.hideOnComplete&&this.parent.setVisible(!1),this.emitEvents(o.ANIMATION_COMPLETE,o.ANIMATION_COMPLETE_KEY)},emitEvents:function(t,e){var i=this.currentAnim;if(i){var r=this.currentFrame,s=this.parent,n=r.textureFrame;s.emit(t,i,r,s,n),e&&s.emit(e+i.key,i,r,s,n)}},reverse:function(){return this.isPlaying&&(this.inReverse=!this.inReverse,this.forward=!this.forward),this.parent},getProgress:function(){var t=this.currentFrame;if(!t)return 0;var e=t.progress;return this.inReverse&&(e*=-1),e},setProgress:function(t){return this.forward||(t=1-t),this.setCurrentFrame(this.currentAnim.getFrameByProgress(t)),this.parent},setRepeat:function(t){return this.repeatCounter=-1===t?Number.MAX_VALUE:t,this.parent},globalRemove:function(t,e){void 0===e&&(e=this.currentAnim),this.isPlaying&&e.key===this.currentAnim.key&&(this.stop(),this.setCurrentFrame(this.currentAnim.frames[0]))},restart:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1);var i=this.currentAnim,r=this.parent;return i?(e&&(this.repeatCounter=-1===this.repeat?Number.MAX_VALUE:this.repeat),i.getFirstTick(this),this.emitEvents(o.ANIMATION_RESTART),this.isPlaying=!0,this.pendingRepeat=!1,this.hasStarted=!t,this._pendingStop=0,this._pendingStopValue=0,this._paused=!1,this.setCurrentFrame(i.frames[0]),this.parent):r},complete:function(){if(this._pendingStop=0,this.isPlaying=!1,this.currentAnim&&this.handleComplete(),this.nextAnim){var t=this.nextAnim;this.nextAnim=this.nextAnimsQueue.length>0?this.nextAnimsQueue.shift():null,this.play(t)}return this.parent},stop:function(){if(this._pendingStop=0,this.isPlaying=!1,this.delayCounter=0,this.currentAnim&&this.handleStop(),this.nextAnim){var t=this.nextAnim;this.nextAnim=this.nextAnimsQueue.shift(),this.play(t)}return this.parent},stopAfterDelay:function(t){return this._pendingStop=1,this._pendingStopValue=t,this.parent},stopAfterRepeat:function(t){return void 0===t&&(t=1),-1!==this.repeatCounter&&t>this.repeatCounter&&(t=this.repeatCounter),this._pendingStop=2,this._pendingStopValue=t,this.parent},stopOnFrame:function(t){return this._pendingStop=3,this._pendingStopValue=t,this.parent},getTotalFrames:function(){return this.currentAnim?this.currentAnim.getTotalFrames():0},update:function(t,e){var i=this.currentAnim;if(this.isPlaying&&i&&!i.paused){if(this.accumulator+=e*this.timeScale*this.animationManager.globalTimeScale,1===this._pendingStop&&(this._pendingStopValue-=e,this._pendingStopValue<=0))return this.stop();if(this.hasStarted){if(this.accumulator>=this.nextTick&&(this.forward?i.nextFrame(this):i.previousFrame(this),this.isPlaying&&0===this._pendingStop&&this.skipMissedFrames&&this.accumulator>this.nextTick)){var r=0;do{this.forward?i.nextFrame(this):i.previousFrame(this),r++}while(this.isPlaying&&this.accumulator>this.nextTick&&r<60)}}else this.accumulator>=this.delayCounter&&(this.accumulator-=this.delayCounter,this.handleStart())}},setCurrentFrame:function(t){var e=this.parent;return this.currentFrame=t,e.texture=t.frame.texture,e.frame=t.frame,e.isCropped&&e.frame.updateCropUVs(e._crop,e.flipX,e.flipY),t.setAlpha&&(e.alpha=t.alpha),e.setSizeToFrame(),e._originComponent&&(t.frame.customPivot?e.setOrigin(t.frame.pivotX,t.frame.pivotY):e.updateDisplayOrigin()),this.isPlaying&&this.hasStarted&&(this.emitEvents(o.ANIMATION_UPDATE),3===this._pendingStop&&this._pendingStopValue===t&&this.stop()),e},nextFrame:function(){return this.currentAnim&&this.currentAnim.nextFrame(this),this.parent},previousFrame:function(){return this.currentAnim&&this.currentAnim.previousFrame(this),this.parent},get:function(t){return this.anims?this.anims.get(t):null},exists:function(t){return!!this.anims&&this.anims.has(t)},create:function(t){var e=t.key,i=!1;return e&&((i=this.get(e))?console.warn("Animation key already exists: "+e):(i=new r(this,e,t),this.anims||(this.anims=new a),this.anims.set(e,i))),i},createFromAseprite:function(t,e){return this.animationManager.createFromAseprite(t,e,this.parent)},generateFrameNames:function(t,e){return this.animationManager.generateFrameNames(t,e)},generateFrameNumbers:function(t,e){return this.animationManager.generateFrameNumbers(t,e)},remove:function(t){var e=this.get(t);return e&&(this.currentAnim===e&&this.stop(),this.anims.delete(t)),e},destroy:function(){this.animationManager.off(o.REMOVE_ANIMATION,this.globalRemove,this),this.anims&&this.anims.clear(),this.animationManager=null,this.parent=null,this.nextAnim=null,this.nextAnimsQueue.length=0,this.currentAnim=null,this.currentFrame=null},isPaused:{get:function(){return this._paused}}});t.exports=l},57090(t){t.exports="add"},25312(t){t.exports="animationcomplete"},89580(t){t.exports="animationcomplete-"},52860(t){t.exports="animationrepeat"},63850(t){t.exports="animationrestart"},99085(t){t.exports="animationstart"},28087(t){t.exports="animationstop"},1794(t){t.exports="animationupdate"},52562(t){t.exports="pauseall"},57953(t){t.exports="remove"},68339(t){t.exports="resumeall"},74943(t,e,i){t.exports={ADD_ANIMATION:i(57090),ANIMATION_COMPLETE:i(25312),ANIMATION_COMPLETE_KEY:i(89580),ANIMATION_REPEAT:i(52860),ANIMATION_RESTART:i(63850),ANIMATION_START:i(99085),ANIMATION_STOP:i(28087),ANIMATION_UPDATE:i(1794),PAUSE_ALL:i(52562),REMOVE_ANIMATION:i(57953),RESUME_ALL:i(68339)}},60421(t,e,i){t.exports={Animation:i(42099),AnimationFrame:i(41138),AnimationManager:i(60848),AnimationState:i(9674),Events:i(74943)}},2161(t,e,i){var r=i(83419),s=i(90330),n=i(50792),a=i(24736),o=new r({initialize:function(){this.entries=new s,this.events=new n},add:function(t,e){return this.entries.set(t,e),this.events.emit(a.ADD,this,t,e),this},has:function(t){return this.entries.has(t)},exists:function(t){return this.entries.has(t)},get:function(t){return this.entries.get(t)},remove:function(t){var e=this.get(t);return e&&(this.entries.delete(t),this.events.emit(a.REMOVE,this,t,e.data)),this},getKeys:function(){return this.entries.keys()},destroy:function(){this.entries.clear(),this.events.removeAllListeners(),this.entries=null,this.events=null}});t.exports=o},24047(t,e,i){var r=i(2161),s=i(83419),n=i(8443),a=new s({initialize:function(t){this.game=t,this.binary=new r,this.bitmapFont=new r,this.json=new r,this.physics=new r,this.shader=new r,this.audio=new r,this.video=new r,this.text=new r,this.html=new r,this.tilemap=new r,this.xml=new r,this.atlas=new r,this.custom={},this.game.events.once(n.DESTROY,this.destroy,this)},addCustom:function(t){return this.custom.hasOwnProperty(t)||(this.custom[t]=new r),this.custom[t]},destroy:function(){for(var t=["binary","bitmapFont","json","physics","shader","audio","video","text","html","tilemap","xml","atlas"],e=0;ef&&w*i+b*sd&&w*r+b*ns&&(t=s),t},clampY:function(t){var e=this._bounds,i=this.displayHeight,r=e.y+(i-this.height)/2,s=Math.max(r,r+e.height-i);return ts&&(t=s),t},removeBounds:function(){return this.useBounds=!1,this.dirty=!0,this._bounds.setEmpty(),this},setAngle:function(t){return void 0===t&&(t=0),this.rotation=s(t),this},setBackgroundColor:function(t){return void 0===t&&(t="rgba(0,0,0,0)"),this.backgroundColor=d(t),this.transparent=0===this.backgroundColor.alpha,this},setBounds:function(t,e,i,r,s){return void 0===s&&(s=!1),this._bounds.setTo(t,e,i,r),this.dirty=!0,this.useBounds=!0,s?this.centerToBounds():(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},setForceComposite:function(t){return this.forceComposite=t,this},getBounds:function(t){void 0===t&&(t=new o);var e=this._bounds;return t.setTo(e.x,e.y,e.width,e.height),t},setName:function(t){return void 0===t&&(t=""),this.name=t,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setRoundPixels:function(t){return this.roundPixels=t,this},setScene:function(t,e){void 0===e&&(e=!0),this.scene&&this._customViewport&&this.sceneManager.customViewports--,this.scene=t,this.isSceneCamera=e;var i=t.sys;return this.sceneManager=i.game.scene,this.scaleManager=i.scale,this.cameraManager=i.cameras,this.updateSystem(),this},setScroll:function(t,e){return void 0===e&&(e=t),this.scrollX=t,this.scrollY=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},setViewport:function(t,e,i,r){return this.x=t,this.y=e,this.width=i,this.height=r,this},setZoom:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),0===t&&(t=.001),0===e&&(e=.001),this.zoomX=t,this.zoomY=e,this},setMask:function(t,e){return void 0===e&&(e=!0),this.mask=t,this._maskCamera=e?this.cameraManager.default:this,this},clearMask:function(t){return void 0===t&&(t=!1),t&&this.mask&&this.mask.destroy(),this.mask=null,this},toJSON:function(){var t={name:this.name,x:this.x,y:this.y,width:this.width,height:this.height,zoom:this.zoom,rotation:this.rotation,roundPixels:this.roundPixels,scrollX:this.scrollX,scrollY:this.scrollY,backgroundColor:this.backgroundColor.rgba};return this.useBounds&&(t.bounds={x:this._bounds.x,y:this._bounds.y,width:this._bounds.width,height:this._bounds.height}),t},update:function(){},setIsSceneCamera:function(t){return this.isSceneCamera=t,this},updateSystem:function(){if(this.scaleManager&&this.isSceneCamera){var t=0!==this._x||0!==this._y||this.scaleManager.width!==this._width||this.scaleManager.height!==this._height,e=this.sceneManager;t&&!this._customViewport?e.customViewports++:!t&&this._customViewport&&e.customViewports--,this.dirty=!0,this._customViewport=t}},destroy:function(){this.emit(a.DESTROY,this),this.removeAllListeners(),this.matrix.destroy(),this.matrixCombined.destroy(),this.matrixExternal.destroy(),this.culledObjects=[],this._customViewport&&this.sceneManager.customViewports--,this.renderList=[],this._bounds=null,this.scene=null,this.scaleManager=null,this.sceneManager=null,this.cameraManager=null},x:{get:function(){return this._x},set:function(t){this._x=t,this.updateSystem()}},y:{get:function(){return this._y},set:function(t){this._y=t,this.updateSystem()}},width:{get:function(){return this._width},set:function(t){this._width=t,this.updateSystem()}},height:{get:function(){return this._height},set:function(t){this._height=t,this.updateSystem()}},scrollX:{get:function(){return this._scrollX},set:function(t){t!==this._scrollX&&(this._scrollX=t,this.dirty=!0)}},scrollY:{get:function(){return this._scrollY},set:function(t){t!==this._scrollY&&(this._scrollY=t,this.dirty=!0)}},zoom:{get:function(){return(this._zoomX+this._zoomY)/2},set:function(t){this._zoomX=t,this._zoomY=t,this.dirty=!0}},zoomX:{get:function(){return this._zoomX},set:function(t){this._zoomX=t,this.dirty=!0}},zoomY:{get:function(){return this._zoomY},set:function(t){this._zoomY=t,this.dirty=!0}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=t,this.dirty=!0}},centerX:{get:function(){return this.x+.5*this.width}},centerY:{get:function(){return this.y+.5*this.height}},displayWidth:{get:function(){return this.width/this.zoomX}},displayHeight:{get:function(){return this.height/this.zoomY}}});t.exports=f},38058(t,e,i){var r=i(71911),s=i(67502),n=i(45319),a=i(83419),o=i(31401),h=i(20052),l=i(19715),u=i(28915),d=i(87841),c=i(26099),f=new a({Extends:r,initialize:function(t,e,i,s){r.call(this,t,e,i,s),this.filters={internal:new o.FilterList(this),external:new o.FilterList(this)},this.isObjectInversion=!1,this.inputEnabled=!0,this.fadeEffect=new h.Fade(this),this.flashEffect=new h.Flash(this),this.shakeEffect=new h.Shake(this),this.panEffect=new h.Pan(this),this.rotateToEffect=new h.RotateTo(this),this.zoomEffect=new h.Zoom(this),this.lerp=new c(1,1),this.followOffset=new c,this.deadzone=null,this._follow=null},setDeadzone:function(t,e){if(void 0===t)this.deadzone=null;else{if(this.deadzone?(this.deadzone.width=t,this.deadzone.height=e):this.deadzone=new d(0,0,t,e),this._follow){var i=this.width/2,r=this.height/2,n=this._follow.x-this.followOffset.x,a=this._follow.y-this.followOffset.y;this.midPoint.set(n,a),this.scrollX=n-i,this.scrollY=a-r}s(this.deadzone,this.midPoint.x,this.midPoint.y)}return this},fadeIn:function(t,e,i,r,s,n){return this.fadeEffect.start(!1,t,e,i,r,!0,s,n)},fadeOut:function(t,e,i,r,s,n){return this.fadeEffect.start(!0,t,e,i,r,!0,s,n)},fadeFrom:function(t,e,i,r,s,n,a){return this.fadeEffect.start(!1,t,e,i,r,s,n,a)},fade:function(t,e,i,r,s,n,a){return this.fadeEffect.start(!0,t,e,i,r,s,n,a)},flash:function(t,e,i,r,s,n,a){return this.flashEffect.start(t,e,i,r,s,n,a)},shake:function(t,e,i,r,s){return this.shakeEffect.start(t,e,i,r,s)},pan:function(t,e,i,r,s,n,a){return this.panEffect.start(t,e,i,r,s,n,a)},rotateTo:function(t,e,i,r,s,n,a){return this.rotateToEffect.start(t,e,i,r,s,n,a)},zoomTo:function(t,e,i,r,s,n){return this.zoomEffect.start(t,e,i,r,s,n)},preRender:function(){this.renderList.length=0;var t=this.width,e=this.height,i=.5*t,r=.5*e,n=this.zoomX,a=this.zoomY;this.renderRoundPixels=this.roundPixels&&Number.isInteger(n)&&Number.isInteger(a);var o=t*this.originX,h=e*this.originY,d=this._follow,c=this.deadzone,f=this.scrollX,p=this.scrollY;c&&s(c,this.midPoint.x,this.midPoint.y);var g=!1;if(d&&!this.panEffect.isRunning){var m=this.lerp,v=d.x-this.followOffset.x,y=d.y-this.followOffset.y;c?(vc.right&&(f=u(f,f+(v-c.right),m.x)),yc.bottom&&(p=u(p,p+(y-c.bottom),m.y))):(f=u(f,v-o,m.x),p=u(p,y-h,m.y)),g=!0}this.useBounds&&(f=this.clampX(f),p=this.clampY(p)),this.scrollX=f,this.scrollY=p;var x=f+i,T=p+r;this.midPoint.set(x,T);var w=t/n,b=e/a,S=x-w/2,C=T-b/2;this.worldView.setTo(S,C,w,b);var E=this.matrix,A=this.matrixExternal;this.isObjectInversion?(E.loadIdentity(),E.translate(o,h),E.scale(n,a),E.rotate(this.rotation),E.translate(-f-o,-p-h)):(E.applyITRS(o,h,this.rotation,n,a),E.translate(-f-o,-p-h)),A.applyITRS(this.x,this.y,0,1,1),this.shakeEffect.preRender(),A.multiply(E,this.matrixCombined),g&&this.emit(l.FOLLOW_UPDATE,this,d)},getViewMatrix:function(t){return t||this.forceComposite||this.filters.external.length>0||this.filters.internal.length>0?this.matrix:this.matrixCombined},getPaddingWrapper:function(t){var e={padding:0},i=new Proxy(this,{get:function(t,i){switch(i){case"padding":return e.padding;case"x":case"y":case"scrollX":case"scrollY":return t[i]+e.padding;case"width":case"height":return t[i]-2*e.padding;default:return t[i]}},set:function(i,r,s){switch(r){case"padding":var n=e.padding;e.padding=s;var a=e.padding-n;return i.x-=a,i.y-=a,i.width+=2*a,i.height+=2*a,i.scrollX-=a,i.scrollY-=a,t;case"x":case"y":case"scrollX":case"scrollY":return i[r]=s-e.padding;case"width":case"height":return i[r]=s+2*e.padding;default:return i[r]=s}}});return i.padding=t||0,i},setLerp:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.lerp.set(t,e),this},setFollowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),this.followOffset.set(t,e),this},startFollow:function(t,e,i,r,s,a){void 0===e&&(e=!1),void 0===i&&(i=1),void 0===r&&(r=i),void 0===s&&(s=0),void 0===a&&(a=s),this._follow=t,this.roundPixels=e,i=n(i,0,1),r=n(r,0,1),this.lerp.set(i,r),this.followOffset.set(s,a);var o=this.width/2,h=this.height/2,l=t.x-s,u=t.y-a;return this.midPoint.set(l,u),this.scrollX=l-o,this.scrollY=u-h,this.useBounds&&(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},stopFollow:function(){return this._follow=null,this},resetFX:function(){return this.rotateToEffect.reset(),this.panEffect.reset(),this.shakeEffect.reset(),this.flashEffect.reset(),this.fadeEffect.reset(),this},update:function(t,e){this.visible&&(this.rotateToEffect.update(t,e),this.panEffect.update(t,e),this.zoomEffect.update(t,e),this.shakeEffect.update(t,e),this.flashEffect.update(t,e),this.fadeEffect.update(t,e))},destroy:function(){this.resetFX(),this.filters.internal.destroy(),this.filters.external.destroy(),r.prototype.destroy.call(this),this._follow=null,this.deadzone=null}});t.exports=f},32743(t,e,i){var r=i(38058),s=i(83419),n=i(95540),a=i(37277),o=i(37303),h=i(97480),l=i(44594),u=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.roundPixels=t.sys.game.config.roundPixels,this.cameras=[],this.main,this.default,t.sys.events.once(l.BOOT,this.boot,this),t.sys.events.on(l.START,this.start,this)},boot:function(){var t=this.systems;t.settings.cameras?this.fromJSON(t.settings.cameras):this.add(),this.main=this.cameras[0],this.default=new r(0,0,t.scale.width,t.scale.height).setScene(this.scene),t.game.scale.on(h.RESIZE,this.onResize,this),this.systems.events.once(l.DESTROY,this.destroy,this)},start:function(){if(!this.main){var t=this.systems;t.settings.cameras?this.fromJSON(t.settings.cameras):this.add(),this.main=this.cameras[0]}var e=this.systems.events;e.on(l.UPDATE,this.update,this),e.once(l.SHUTDOWN,this.shutdown,this)},add:function(t,e,i,s,n,a){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===s&&(s=this.scene.sys.scale.height),void 0===n&&(n=!1),void 0===a&&(a="");var o=new r(t,e,i,s);return o.setName(a),o.setScene(this.scene),o.setRoundPixels(this.roundPixels),o.id=this.getNextID(),this.cameras.push(o),n&&(this.main=o),o},addExisting:function(t,e){return void 0===e&&(e=!1),-1===this.cameras.indexOf(t)?(t.id=this.getNextID(),t.setRoundPixels(this.roundPixels),this.cameras.push(t),e&&(this.main=t),t):null},getNextID:function(){for(var t=this.cameras,e=1,i=0;i<32;i++){for(var r=!1,s=0;s0){n.preRender();var a=this.getVisibleChildren(e.getChildren(),n);t.render(i,a,n)}}},getVisibleChildren:function(t,e){return t.filter(function(t){return t.willRender(e)})},resetAll:function(){for(var t=0;t=0}else this.clockwise=this.destination>=this.source;return this.camera.emit(n.ROTATE_START,this.camera,this,i,this.destination),u},update:function(t,e){if(this.isRunning){this._elapsed+=e;var i=r(this._elapsed/this.duration,0,1);this.progress=i;var s=this.camera;if(this._elapsedthis.maxZoom&&(e.zoom=this.maxZoom))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=n},58818(t,e,i){var r=i(83419),s=i(35154),n=new r({initialize:function(t){this.camera=s(t,"camera",null),this.left=s(t,"left",null),this.right=s(t,"right",null),this.up=s(t,"up",null),this.down=s(t,"down",null),this.zoomIn=s(t,"zoomIn",null),this.zoomOut=s(t,"zoomOut",null),this.zoomSpeed=s(t,"zoomSpeed",.01),this.minZoom=s(t,"minZoom",.001),this.maxZoom=s(t,"maxZoom",1e3),this.accelX=0,this.accelY=0;var e=s(t,"acceleration",null);"number"==typeof e?(this.accelX=e,this.accelY=e):(this.accelX=s(t,"acceleration.x",0),this.accelY=s(t,"acceleration.y",0)),this.dragX=0,this.dragY=0;var i=s(t,"drag",null);"number"==typeof i?(this.dragX=i,this.dragY=i):(this.dragX=s(t,"drag.x",0),this.dragY=s(t,"drag.y",0)),this.maxSpeedX=0,this.maxSpeedY=0;var r=s(t,"maxSpeed",null);"number"==typeof r?(this.maxSpeedX=r,this.maxSpeedY=r):(this.maxSpeedX=s(t,"maxSpeed.x",0),this.maxSpeedY=s(t,"maxSpeed.y",0)),this._speedX=0,this._speedY=0,this._zoom=0,this.active=null!==this.camera},start:function(){return this.active=null!==this.camera,this},stop:function(){return this.active=!1,this},setCamera:function(t){return this.camera=t,this},update:function(t){if(this.active){void 0===t&&(t=1);var e=this.camera;this._speedX>0?(this._speedX-=this.dragX*t,this._speedX<0&&(this._speedX=0)):this._speedX<0&&(this._speedX+=this.dragX*t,this._speedX>0&&(this._speedX=0)),this._speedY>0?(this._speedY-=this.dragY*t,this._speedY<0&&(this._speedY=0)):this._speedY<0&&(this._speedY+=this.dragY*t,this._speedY>0&&(this._speedY=0)),this.up&&this.up.isDown?(this._speedY+=this.accelY,this._speedY>this.maxSpeedY&&(this._speedY=this.maxSpeedY)):this.down&&this.down.isDown&&(this._speedY-=this.accelY,this._speedY<-this.maxSpeedY&&(this._speedY=-this.maxSpeedY)),this.left&&this.left.isDown?(this._speedX+=this.accelX,this._speedX>this.maxSpeedX&&(this._speedX=this.maxSpeedX)):this.right&&this.right.isDown&&(this._speedX-=this.accelX,this._speedX<-this.maxSpeedX&&(this._speedX=-this.maxSpeedX)),this.zoomIn&&this.zoomIn.isDown?this._zoom=-this.zoomSpeed:this.zoomOut&&this.zoomOut.isDown?this._zoom=this.zoomSpeed:this._zoom=0,0!==this._speedX&&(e.scrollX-=this._speedX*t|0),0!==this._speedY&&(e.scrollY-=this._speedY*t|0),0!==this._zoom&&(e.zoom+=this._zoom,e.zoomthis.maxZoom&&(e.zoom=this.maxZoom))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=n},38865(t,e,i){t.exports={FixedKeyControl:i(63091),SmoothedKeyControl:i(58818)}},26638(t,e,i){t.exports={Controls:i(38865),Scene2D:i(87969)}},8054(t,e,i){var r={VERSION:"4.1.0",LOG_VERSION:"v401",BlendModes:i(10312),ScaleModes:i(29795),AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,FOREVER:-1,NONE:4,UP:5,DOWN:6,LEFT:7,RIGHT:8};t.exports=r},69547(t,e,i){var r=i(83419),s=i(8054),n=i(42363),a=i(82264),o=i(95540),h=i(35154),l=i(41212),u=i(29747),d=i(75508),c=i(80333),f=new r({initialize:function(t){void 0===t&&(t={});var e=h(t,"scale",null);this.width=h(e,"width",1024,t),this.height=h(e,"height",768,t),this.zoom=h(e,"zoom",1,t),this.parent=h(e,"parent",void 0,t),this.scaleMode=h(e,e?"mode":"scaleMode",0,t),this.expandParent=h(e,"expandParent",!0,t),this.autoRound=h(e,"autoRound",!1,t),this.autoCenter=h(e,"autoCenter",0,t),this.resizeInterval=h(e,"resizeInterval",500,t),this.fullscreenTarget=h(e,"fullscreenTarget",null,t),this.minWidth=h(e,"min.width",0,t),this.maxWidth=h(e,"max.width",0,t),this.minHeight=h(e,"min.height",0,t),this.maxHeight=h(e,"max.height",0,t),this.snapWidth=h(e,"snap.width",0,t),this.snapHeight=h(e,"snap.height",0,t),this.renderType=h(t,"type",s.AUTO),this.canvas=h(t,"canvas",null),this.context=h(t,"context",null),this.canvasStyle=h(t,"canvasStyle",null),this.customEnvironment=h(t,"customEnvironment",!1),this.sceneConfig=h(t,"scene",null),this.seed=h(t,"seed",[(Date.now()*Math.random()).toString()]),d.RND=new d.RandomDataGenerator(this.seed),this.gameTitle=h(t,"title",""),this.gameURL=h(t,"url","https://phaser.io/"+s.LOG_VERSION),this.gameVersion=h(t,"version",""),this.autoFocus=h(t,"autoFocus",!0),this.stableSort=h(t,"stableSort",-1),-1===this.stableSort&&(this.stableSort=a.browser.es2019?1:0),a.features.stableSort=this.stableSort,this.domCreateContainer=h(t,"dom.createContainer",!1),this.domPointerEvents=h(t,"dom.pointerEvents","none"),this.inputKeyboard=h(t,"input.keyboard",!0),this.inputKeyboardEventTarget=h(t,"input.keyboard.target",window),this.inputKeyboardCapture=h(t,"input.keyboard.capture",[]),this.inputMouse=h(t,"input.mouse",!0),this.inputMouseEventTarget=h(t,"input.mouse.target",null),this.inputMousePreventDefaultDown=h(t,"input.mouse.preventDefaultDown",!0),this.inputMousePreventDefaultUp=h(t,"input.mouse.preventDefaultUp",!0),this.inputMousePreventDefaultMove=h(t,"input.mouse.preventDefaultMove",!0),this.inputMousePreventDefaultWheel=h(t,"input.mouse.preventDefaultWheel",!0),this.inputTouch=h(t,"input.touch",a.input.touch),this.inputTouchEventTarget=h(t,"input.touch.target",null),this.inputTouchCapture=h(t,"input.touch.capture",!0),this.inputActivePointers=h(t,"input.activePointers",1),this.inputSmoothFactor=h(t,"input.smoothFactor",0),this.inputWindowEvents=h(t,"input.windowEvents",!0),this.inputGamepad=h(t,"input.gamepad",!1),this.inputGamepadEventTarget=h(t,"input.gamepad.target",window),this.disableContextMenu=h(t,"disableContextMenu",!1),this.audio=h(t,"audio",{}),this.hideBanner=!1===h(t,"banner",null),this.hidePhaser=h(t,"banner.hidePhaser",!1),this.bannerTextColor=h(t,"banner.text","#ffffff"),this.bannerBackgroundColor=h(t,"banner.background",["#000814","#001d3d","#003566"]),""===this.gameTitle&&this.hidePhaser&&(this.hideBanner=!0),this.fps=h(t,"fps",null);var i=h(t,"render",null);this.autoMobileTextures=h(i,"autoMobileTextures",!0,t),this.antialias=h(i,"antialias",!0,t),this.antialiasGL=h(i,"antialiasGL",!0,t),this.mipmapFilter=h(i,"mipmapFilter","",t),this.mipmapRegeneration=h(i,"mipmapRegeneration",!1,t),this.desynchronized=h(i,"desynchronized",!1,t),this.roundPixels=h(i,"roundPixels",!1,t),this.selfShadow=h(i,"selfShadow",!1,t),this.pathDetailThreshold=h(i,"pathDetailThreshold",1,t),this.pixelArt=h(i,"pixelArt",!1,t),this.pixelArt&&(this.antialias=!1,this.antialiasGL=!1,this.roundPixels=!0),this.smoothPixelArt=h(i,"smoothPixelArt",!1,t),this.smoothPixelArt&&(this.antialias=!0,this.antialiasGL=!0,this.pixelArt=!1),this.transparent=h(i,"transparent",!1,t),this.clearBeforeRender=h(i,"clearBeforeRender",!0,t),this.preserveDrawingBuffer=h(i,"preserveDrawingBuffer",!1,t),this.premultipliedAlpha=h(i,"premultipliedAlpha",!0,t),this.skipUnreadyShaders=h(i,"skipUnreadyShaders",!1,t),this.failIfMajorPerformanceCaveat=h(i,"failIfMajorPerformanceCaveat",!1,t),this.powerPreference=h(i,"powerPreference","default",t),this.batchSize=h(i,"batchSize",16384,t),this.maxTextures=h(i,"maxTextures",-1,t),this.maxLights=h(i,"maxLights",10,t),this.renderNodes=h(i,"renderNodes",{},t);var r=h(t,"backgroundColor",0);this.backgroundColor=c(r),this.transparent&&(this.backgroundColor=c(0),this.backgroundColor.alpha=0),this.preBoot=h(t,"callbacks.preBoot",u),this.postBoot=h(t,"callbacks.postBoot",u),this.physics=h(t,"physics",{}),this.defaultPhysicsSystem=h(this.physics,"default",!1),this.loaderBaseURL=h(t,"loader.baseURL",""),this.loaderPath=h(t,"loader.path",""),this.loaderMaxParallelDownloads=h(t,"loader.maxParallelDownloads",a.os.android?6:32),this.loaderCrossOrigin=h(t,"loader.crossOrigin",void 0),this.loaderResponseType=h(t,"loader.responseType",""),this.loaderAsync=h(t,"loader.async",!0),this.loaderUser=h(t,"loader.user",""),this.loaderPassword=h(t,"loader.password",""),this.loaderTimeout=h(t,"loader.timeout",0),this.loaderMaxRetries=h(t,"loader.maxRetries",2),this.loaderWithCredentials=h(t,"loader.withCredentials",!1),this.loaderImageLoadType=h(t,"loader.imageLoadType","XHR"),this.loaderLocalScheme=h(t,"loader.localScheme",["file://","capacitor://"]),this.glowQuality=h(t,"filters.glow.quality",10),this.glowDistance=h(t,"filters.glow.distance",10),this.installGlobalPlugins=[],this.installScenePlugins=[];var f=h(t,"plugins",null),p=n.DefaultScene;f&&(Array.isArray(f)?this.defaultPlugins=f:l(f)&&(this.installGlobalPlugins=o(f,"global",[]),this.installScenePlugins=o(f,"scene",[]),Array.isArray(f.default)?p=f.default:Array.isArray(f.defaultMerge)&&(p=p.concat(f.defaultMerge)))),this.defaultPlugins=p;var g="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg";this.defaultImage=h(t,"images.default",g+"AQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg=="),this.missingImage=h(t,"images.missing",g+"CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg=="),this.whiteImage=h(t,"images.white","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABdJREFUeNpi/P//PwMMMDEgAdwcgAADAJZuAwXJYZOzAAAAAElFTkSuQmCC"),window&&(window.FORCE_WEBGL?this.renderType=s.WEBGL:window.FORCE_CANVAS&&(this.renderType=s.CANVAS))}});t.exports=f},86054(t,e,i){var r=i(20623),s=i(27919),n=i(8054),a=i(89357);t.exports=function(t){var e=t.config;if((e.customEnvironment||e.canvas)&&e.renderType===n.AUTO)throw new Error("Must set explicit renderType in custom environment");if(!e.customEnvironment&&!e.canvas&&e.renderType!==n.HEADLESS)if(e.renderType===n.AUTO&&(e.renderType=a.webGL?n.WEBGL:n.CANVAS),e.renderType===n.WEBGL){if(!a.webGL)throw new Error("Cannot create WebGL context, aborting.")}else{if(e.renderType!==n.CANVAS)throw new Error("Unknown value for renderer type: "+e.renderType);if(!a.canvas)throw new Error("Cannot create Canvas context, aborting.")}e.antialias||s.disableSmoothing();var o,h,l=t.scale.baseSize,u=l.width,d=l.height;(e.canvas?(t.canvas=e.canvas,t.canvas.width=u,t.canvas.height=d):t.canvas=s.create(t,u,d,e.renderType),e.canvasStyle&&(t.canvas.style=e.canvasStyle),e.antialias||r.setCrisp(t.canvas),e.renderType!==n.HEADLESS)&&(o=i(68627),h=i(74797),e.renderType===n.WEBGL?t.renderer=new h(t):(t.renderer=new o(t),t.context=t.renderer.gameContext))}},96391(t,e,i){var r=i(8054);t.exports=function(t){var e=t.config;if(!e.hideBanner){var i="WebGL";e.renderType===r.CANVAS?i="Canvas":e.renderType===r.HEADLESS&&(i="Headless");var s,n=e.audio,a=t.device.audio;if(s=a.webAudio&&!n.disableWebAudio?"Web Audio":n.noAudio||!a.webAudio&&!a.audioData?"No Audio":"HTML5 Audio",t.device.browser.ie)window.console&&console.log("Phaser v"+r.VERSION+" / https://phaser.io");else{var o="color: "+e.bannerTextColor+";",h=Array.isArray(e.bannerBackgroundColor)?e.bannerBackgroundColor:[e.bannerBackgroundColor];1===h.length&&(h=[h[0],h[0]]),o+=' background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAOCAYAAAAmL5yKAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAARBJREFUeNpi/P//P0OHsPB/BiCoePuWkYFEwALSXJElzMBgLwE2CNkQxgWr/yMr/p8QimlBu5DQ//+8vBBco/ofzAe6imH+qv/53/6jYJAYSA4ZoxoANYTPKhiuCQZwGcJU+e4dqpMmvsDq14krV2MPAxDha2CMKvoXoiE/PBQUDgQD8j82UFae9B9bOIC8B9UD9gIjjIMN7Ns6lWHn4XMoYu62RgxO3tkMjIyMII2MYAOAtmFVhA+ADHf2ycGMRhANjUq8YO+WKWCvgAORIV8CkpDCrzIwsLIymC1qAtuAD4Bsh3sBmqAY3qcGwL2AC4DCpKtzHlgzOLWihwEuzTCN0GhDJHeYC4gByBphACDAAH2dDIxdjr+VAAAAAElFTkSuQmCC"), '+("linear-gradient(to bottom, "+h.join(", ")+")")+";",o+=" background-repeat: no-repeat;",o+=" background-position: 4px center, 0 0;";var l="%c",u=[null,o+=" padding: 2px 6px 2px 24px;"];u.push("background: transparent"),e.gameTitle&&(l=l.concat(e.gameTitle),e.gameVersion&&(l=l.concat(" v"+e.gameVersion)),e.hidePhaser||(l=l.concat(" / "))),e.hidePhaser||(l=l.concat("Phaser v"+r.VERSION+" ("+i+" | "+s+")")),l=l.concat("%c "+e.gameURL),u[0]=l,console.log.apply(console,u)}}}},50127(t,e,i){var r=i(40366),s=i(60848),n=i(24047),a=i(27919),o=i(83419),h=i(69547),l=i(83719),u=i(86054),d=i(45893),c=i(96391),f=i(82264),p=i(57264),g=i(50792),m=i(8443),v=i(7003),y=i(37277),x=i(77332),T=i(76531),w=i(60903),b=i(69442),S=i(17130),C=i(65898),E=i(51085),A=i(14747),_=new o({initialize:function(t){this.config=new h(t),this.renderer=null,this.domContainer=null,this.canvas=null,this.context=null,this.isBooted=!1,this.isRunning=!1,this.events=new g,this.anims=new s(this),this.textures=new S(this),this.cache=new n(this),this.registry=new d(this,new g),this.input=new v(this,this.config),this.scene=new w(this,this.config.sceneConfig),this.device=f,this.scale=new T(this,this.config),this.sound=null,this.sound=A.create(this),this.loop=new C(this,this.config.fps),this.plugins=new x(this,this.config),this.pendingDestroy=!1,this.removeCanvas=!1,this.noReturn=!1,this.hasFocus=!1,this.isPaused=!1,p(this.boot.bind(this))},boot:function(){y.hasCore("EventEmitter")?(this.isBooted=!0,this.config.preBoot(this),this.scale.preBoot(),u(this),l(this),c(this),r(this.canvas,this.config.parent),this.textures.once(b.READY,this.texturesReady,this),this.events.emit(m.BOOT)):console.warn("Aborting. Core Plugins missing.")},texturesReady:function(){this.events.emit(m.READY),this.start()},start:function(){this.isRunning=!0,this.config.postBoot(this),this.renderer?this.loop.start(this.step.bind(this)):this.loop.start(this.headlessStep.bind(this)),E(this);var t=this.events;t.on(m.HIDDEN,this.onHidden,this),t.on(m.VISIBLE,this.onVisible,this),t.on(m.BLUR,this.onBlur,this),t.on(m.FOCUS,this.onFocus,this)},step:function(t,e){if(this.pendingDestroy)return this.runDestroy();if(!this.isPaused){var i=this.events;i.emit(m.PRE_STEP,t,e),i.emit(m.STEP,t,e),this.scene.update(t,e),i.emit(m.POST_STEP,t,e);var r=this.renderer;r.preRender(),i.emit(m.PRE_RENDER,r,t,e),this.scene.render(r),r.postRender(),i.emit(m.POST_RENDER,r,t,e)}},headlessStep:function(t,e){if(this.pendingDestroy)return this.runDestroy();if(!this.isPaused){var i=this.events;i.emit(m.PRE_STEP,t,e),i.emit(m.STEP,t,e),this.scene.update(t,e),i.emit(m.POST_STEP,t,e),this.scene.isProcessing=!1,i.emit(m.PRE_RENDER,null,t,e),i.emit(m.POST_RENDER,null,t,e)}},onHidden:function(){this.loop.pause(),this.events.emit(m.PAUSE)},pause:function(){var t=this.isPaused;this.isPaused=!0,t||this.events.emit(m.PAUSE)},onVisible:function(){this.loop.resume(),this.events.emit(m.RESUME,this.loop.pauseDuration)},resume:function(){var t=this.isPaused;this.isPaused=!1,t&&this.events.emit(m.RESUME,0)},onBlur:function(){this.hasFocus=!1,this.loop.blur()},onFocus:function(){this.hasFocus=!0,this.loop.focus()},getFrame:function(){return this.loop.frame},getTime:function(){return this.loop.now},destroy:function(t,e){void 0===e&&(e=!1),this.pendingDestroy=!0,this.removeCanvas=t,this.noReturn=e},runDestroy:function(){this.scene.destroy(),this.events.emit(m.DESTROY),this.events.removeAllListeners(),this.renderer&&this.renderer.destroy(),this.removeCanvas&&this.canvas&&(a.remove(this.canvas),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)),this.domContainer&&this.domContainer.parentNode&&this.domContainer.parentNode.removeChild(this.domContainer),this.loop.destroy(),this.pendingDestroy=!1}});t.exports=_},65898(t,e,i){var r=i(83419),s=i(35154),n=i(29747),a=i(43092),o=new r({initialize:function(t,e){this.game=t,this.raf=new a,this.started=!1,this.running=!1,this.minFps=s(e,"min",5),this.targetFps=s(e,"target",60),this.fpsLimit=s(e,"limit",0),this.hasFpsLimit=this.fpsLimit>0,this._limitRate=this.hasFpsLimit?1e3/this.fpsLimit:0,this._min=1e3/this.minFps,this._target=1e3/this.targetFps,this.actualFps=this.targetFps,this.nextFpsUpdate=0,this.framesThisSecond=0,this.callback=n,this.forceSetTimeOut=s(e,"forceSetTimeOut",!1),this.time=0,this.startTime=0,this.lastTime=0,this.frame=0,this.inFocus=!0,this.pauseDuration=0,this._pauseTime=0,this._coolDown=0,this.delta=0,this.deltaIndex=0,this.deltaHistory=[],this.deltaSmoothingMax=s(e,"deltaHistory",10),this.panicMax=s(e,"panicMax",120),this.rawDelta=0,this.now=0,this.smoothStep=s(e,"smoothStep",!0)},blur:function(){this.inFocus=!1},focus:function(){this.inFocus=!0,this.resetDelta()},pause:function(){this._pauseTime=window.performance.now()},resume:function(){this.resetDelta(),this.pauseDuration=this.time-this._pauseTime,this.startTime+=this.pauseDuration},resetDelta:function(){var t=window.performance.now();this.time=t,this.lastTime=t,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0;for(var e=0;e0||!this.inFocus)&&(this._coolDown--,t=Math.min(t,this._target)),t>this._min&&(t=i[e],t=Math.min(t,this._min)),i[e]=t,this.deltaIndex++,this.deltaIndex>=r&&(this.deltaIndex=0);for(var s=0,n=0;n=this.nextFpsUpdate&&this.updateFPS(t),this.framesThisSecond++,this.delta>=this._limitRate&&(this.callback(t,this.delta),this.delta%=this._limitRate),this.lastTime=t,this.frame++},step:function(t){this.now=t;var e=Math.max(0,t-this.lastTime);this.rawDelta=e,this.time+=this.rawDelta,this.smoothStep&&(e=this.smoothDelta(e)),this.delta=e,t>=this.nextFpsUpdate&&this.updateFPS(t),this.framesThisSecond++,this.callback(t,e),this.lastTime=t,this.frame++},tick:function(){var t=window.performance.now();this.hasFpsLimit?this.stepLimitFPS(t):this.step(t)},sleep:function(){this.running&&(this.raf.stop(),this.running=!1)},wake:function(t){void 0===t&&(t=!1);var e=window.performance.now();if(!this.running){t&&(this.startTime+=-this.lastTime+(this.lastTime+e));var i=this.hasFpsLimit?this.stepLimitFPS.bind(this):this.step.bind(this);this.raf.start(i,this.forceSetTimeOut,this._target),this.running=!0,this.nextFpsUpdate=e+1e3,this.framesThisSecond=0,this.fpsLimitTriggered=!1,this.tick()}},getDuration:function(){return Math.round(this.lastTime-this.startTime)/1e3},getDurationMS:function(){return Math.round(this.lastTime-this.startTime)},stop:function(){return this.running=!1,this.started=!1,this.raf.stop(),this},destroy:function(){this.stop(),this.raf.destroy(),this.raf=null,this.game=null,this.callback=null}});t.exports=o},51085(t,e,i){var r=i(8443);t.exports=function(t){var e,i=t.events;if(void 0!==document.hidden)e="visibilitychange";else{["webkit","moz","ms"].forEach(function(t){void 0!==document[t+"Hidden"]&&(document.hidden=function(){return document[t+"Hidden"]},e=t+"visibilitychange")})}e&&document.addEventListener(e,function(t){document.hidden||"pause"===t.type?i.emit(r.HIDDEN):i.emit(r.VISIBLE)},!1),window.onblur=function(){i.emit(r.BLUR)},window.onfocus=function(){i.emit(r.FOCUS)},window.focus&&t.config.autoFocus&&window.focus()}},97217(t){t.exports="blur"},47548(t){t.exports="boot"},19814(t){t.exports="contextlost"},68446(t){t.exports="destroy"},41700(t){t.exports="focus"},25432(t){t.exports="hidden"},65942(t){t.exports="pause"},59211(t){t.exports="postrender"},47789(t){t.exports="poststep"},39066(t){t.exports="prerender"},460(t){t.exports="prestep"},16175(t){t.exports="ready"},42331(t){t.exports="resume"},11966(t){t.exports="step"},32969(t){t.exports="systemready"},94830(t){t.exports="visible"},8443(t,e,i){t.exports={BLUR:i(97217),BOOT:i(47548),CONTEXT_LOST:i(19814),DESTROY:i(68446),FOCUS:i(41700),HIDDEN:i(25432),PAUSE:i(65942),POST_RENDER:i(59211),POST_STEP:i(47789),PRE_RENDER:i(39066),PRE_STEP:i(460),READY:i(16175),RESUME:i(42331),STEP:i(11966),SYSTEM_READY:i(32969),VISIBLE:i(94830)}},42857(t,e,i){t.exports={Config:i(69547),CreateRenderer:i(86054),DebugHeader:i(96391),Events:i(8443),TimeStep:i(65898),VisibilityHandler:i(51085)}},46728(t,e,i){var r=i(83419),s=i(36316),n=i(80021),a=i(26099),o=new r({Extends:n,initialize:function(t,e,i,r){n.call(this,"CubicBezierCurve"),Array.isArray(t)&&(r=new a(t[6],t[7]),i=new a(t[4],t[5]),e=new a(t[2],t[3]),t=new a(t[0],t[1])),this.p0=t,this.p1=e,this.p2=i,this.p3=r},getStartPoint:function(t){return void 0===t&&(t=new a),t.copy(this.p0)},getResolution:function(t){return t},getPoint:function(t,e){void 0===e&&(e=new a);var i=this.p0,r=this.p1,n=this.p2,o=this.p3;return e.set(s(t,i.x,r.x,n.x,o.x),s(t,i.y,r.y,n.y,o.y))},draw:function(t,e){void 0===e&&(e=32);var i=this.getPoints(e);t.beginPath(),t.moveTo(this.p0.x,this.p0.y);for(var r=1;ri&&(e=i/2);var r=Math.max(1,Math.round(i/e));return s(this.getSpacedPoints(r),t)},getDistancePoints:function(t){var e=this.getLength(),i=Math.max(1,e/t);return this.getSpacedPoints(i)},getEndPoint:function(t){return void 0===t&&(t=new a),this.getPointAt(1,t)},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,i=[],r=this.getPoint(0,this._tmpVec2A),s=0;i.push(0);for(var n=1;n<=t;n++)s+=(e=this.getPoint(n/t,this._tmpVec2B)).distance(r),i.push(s),r.copy(e);return this.cacheArcLengths=i,i},getPointAt:function(t,e){var i=this.getUtoTmapping(t);return this.getPoint(i,e)},getPoints:function(t,e,i){void 0===i&&(i=[]),t||(t=e?this.getLength()/e:this.defaultDivisions);for(var r=0;r<=t;r++)i.push(this.getPoint(r/t));return i},getRandomPoint:function(t){return void 0===t&&(t=new a),this.getPoint(Math.random(),t)},getSpacedPoints:function(t,e,i){void 0===i&&(i=[]),t||(t=e?this.getLength()/e:this.defaultDivisions);for(var r=0;r<=t;r++){var s=this.getUtoTmapping(r/t,null,t);i.push(this.getPoint(s))}return i},getStartPoint:function(t){return void 0===t&&(t=new a),this.getPointAt(0,t)},getTangent:function(t,e){void 0===e&&(e=new a);var i=1e-4,r=t-i,s=t+i;return r<0&&(r=0),s>1&&(s=1),this.getPoint(r,this._tmpVec2A),this.getPoint(s,e),e.subtract(this._tmpVec2A).normalize()},getTangentAt:function(t,e){var i=this.getUtoTmapping(t);return this.getTangent(i,e)},getTFromDistance:function(t,e){return t<=0?0:this.getUtoTmapping(0,t,e)},getUtoTmapping:function(t,e,i){var r,s=this.getLengths(i),n=0,a=s.length;r=e?Math.min(e,s[a-1]):t*s[a-1];for(var o,h=0,l=a-1;h<=l;)if((o=s[n=Math.floor(h+(l-h)/2)]-r)<0)h=n+1;else{if(!(o>0)){l=n;break}l=n-1}if(s[n=l]===r)return n/(a-1);var u=s[n];return(n+(r-u)/(s[n+1]-u))/(a-1)},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()}});t.exports=o},73825(t,e,i){var r=i(83419),s=i(80021),n=i(39506),a=i(35154),o=i(43396),h=i(26099),l=new r({Extends:s,initialize:function(t,e,i,r,o,l,u,d){if("object"==typeof t){var c=t;t=a(c,"x",0),e=a(c,"y",0),i=a(c,"xRadius",0),r=a(c,"yRadius",i),o=a(c,"startAngle",0),l=a(c,"endAngle",360),u=a(c,"clockwise",!1),d=a(c,"rotation",0)}else void 0===r&&(r=i),void 0===o&&(o=0),void 0===l&&(l=360),void 0===u&&(u=!1),void 0===d&&(d=0);s.call(this,"EllipseCurve"),this.p0=new h(t,e),this._xRadius=i,this._yRadius=r,this._startAngle=n(o),this._endAngle=n(l),this._clockwise=u,this._rotation=n(d)},getStartPoint:function(t){return void 0===t&&(t=new h),this.getPoint(0,t)},getResolution:function(t){return 2*t},getPoint:function(t,e){void 0===e&&(e=new h);for(var i=2*Math.PI,r=this._endAngle-this._startAngle,s=Math.abs(r)i;)r-=i;ri.length-2?i.length-1:n+1],d=i[n>i.length-3?i.length-1:n+2];return e.set(r(o,h.x,l.x,u.x,d.x),r(o,h.y,l.y,u.y,d.y))},toJSON:function(){for(var t=[],e=0;e=e)return this.curves[r];r++}return null},getEndPoint:function(t){return void 0===t&&(t=new c),this.curves.length>0?this.curves[this.curves.length-1].getPoint(1,t):t.copy(this.startPoint),t},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},getPoint:function(t,e){void 0===e&&(e=new c);for(var i=t*this.getLength(),r=this.getCurveLengths(),s=0;s=i){var n=r[s]-i,a=this.curves[s],o=a.getLength(),h=0===o?0:1-n/o;return a.getPointAt(h,e)}s++}return null},getPoints:function(t,e){t||e||(t=this.defaultDivisions);for(var i,r=[],s=0;s1&&!r[r.length-1].equals(r[0])&&r.push(r[0]),r},getRandomPoint:function(t){return void 0===t&&(t=new c),this.getPoint(Math.random(),t)},getSpacedPoints:function(t){void 0===t&&(t=40);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e},getStartPoint:function(t){return void 0===t&&(t=new c),t.copy(this.startPoint)},getTangent:function(t,e){void 0===e&&(e=new c);for(var i=t*this.getLength(),r=this.getCurveLengths(),s=0;s=i){var n=r[s]-i,a=this.curves[s],o=a.getLength(),h=0===o?0:1-n/o;return a.getTangentAt(h,e)}s++}return null},lineTo:function(t,e){t instanceof c?this._tmpVec2B.copy(t):"object"==typeof t?this._tmpVec2B.setFromObject(t):this._tmpVec2B.set(t,e);var i=this.getEndPoint(this._tmpVec2A);return this.add(new o([i.x,i.y,this._tmpVec2B.x,this._tmpVec2B.y]))},splineTo:function(t){return t.unshift(this.getEndPoint()),this.add(new d(t))},moveTo:function(t,e){return t instanceof c?this.add(new h(t.x,t.y)):this.add(new h(t,e))},toJSON:function(){for(var t=[],e=0;e=9&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){var n=parseInt(RegExp.$1,10),a=parseInt(RegExp.$2,10);(10===n&&a>=11||n>10)&&(s.dolby=!0)}}}catch(t){}return s}()},84148(t,e,i){var r,s=i(25892),n={chrome:!1,chromeVersion:0,edge:!1,firefox:!1,firefoxVersion:0,ie:!1,ieVersion:0,mobileSafari:!1,opera:!1,safari:!1,safariVersion:0,silk:!1,trident:!1,tridentVersion:0,es2019:!1};t.exports=(r=navigator.userAgent,/Edg\/\d+/.test(r)?(n.edge=!0,n.es2019=!0):/OPR/.test(r)?(n.opera=!0,n.es2019=!0):/Chrome\/(\d+)/.test(r)&&!s.windowsPhone?(n.chrome=!0,n.chromeVersion=parseInt(RegExp.$1,10),n.es2019=n.chromeVersion>69):/Firefox\D+(\d+)/.test(r)?(n.firefox=!0,n.firefoxVersion=parseInt(RegExp.$1,10),n.es2019=n.firefoxVersion>10):/AppleWebKit\/(?!.*CriOS)/.test(r)&&s.iOS?(n.mobileSafari=!0,n.es2019=!0):/MSIE (\d+\.\d+);/.test(r)?(n.ie=!0,n.ieVersion=parseInt(RegExp.$1,10)):/Version\/(\d+\.\d+(\.\d+)?) Safari/.test(r)&&!s.windowsPhone?(n.safari=!0,n.safariVersion=parseInt(RegExp.$1,10),n.es2019=n.safariVersion>10):/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(r)&&(n.ie=!0,n.trident=!0,n.tridentVersion=parseInt(RegExp.$1,10),n.ieVersion=parseInt(RegExp.$3,10)),/Silk/.test(r)&&(n.silk=!0),n)},89289(t,e,i){var r,s,n,a=i(27919),o={supportInverseAlpha:!1,supportNewBlendModes:!1};t.exports=("function"!=typeof importScripts&&void 0!==document&&(o.supportNewBlendModes=(r="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",s="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",(n=new Image).onload=function(){var t=new Image;t.onload=function(){var e=a.create2D(t,6).getContext("2d",{willReadFrequently:!0});if(e.globalCompositeOperation="multiply",e.drawImage(n,0,0),e.drawImage(t,2,0),!e.getImageData(2,0,1,1))return!1;var i=e.getImageData(2,0,1,1).data;a.remove(t),o.supportNewBlendModes=255===i[0]&&0===i[1]&&0===i[2]},t.src=r+"/wCKxvRF"+s},n.src=r+"AP804Oa6"+s,!1),o.supportInverseAlpha=function(){var t=a.create2D(this,2).getContext("2d",{willReadFrequently:!0});t.fillStyle="rgba(10, 20, 30, 0.5)",t.fillRect(0,0,1,1);var e=t.getImageData(0,0,1,1);if(null===e)return!1;t.putImageData(e,1,0);var i=t.getImageData(1,0,1,1),r=i.data[0]===e.data[0]&&i.data[1]===e.data[1]&&i.data[2]===e.data[2]&&i.data[3]===e.data[3];return a.remove(this),r}()),o)},89357(t,e,i){var r=i(25892),s=i(84148),n=i(27919),a={canvas:!1,canvasBitBltShift:null,file:!1,fileSystem:!1,getUserMedia:!0,littleEndian:!1,localStorage:!1,pointerLock:!1,stableSort:!1,support32bit:!1,vibration:!1,webGL:!1,worker:!1};t.exports=function(){if("function"==typeof importScripts)return a;a.canvas=!!window.CanvasRenderingContext2D;try{a.localStorage=!!localStorage.getItem}catch(t){a.localStorage=!1}a.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),a.fileSystem=!!window.requestFileSystem;var t,e,i,o=!1;return a.webGL=function(){if(window.WebGLRenderingContext)try{var t=n.createWebGL(this),e=t.getContext("webgl")||t.getContext("experimental-webgl"),i=n.create2D(this),r=i.getContext("2d",{willReadFrequently:!0}).createImageData(1,1);return o=r.data instanceof Uint8ClampedArray,n.remove(t),n.remove(i),!!e}catch(t){return!1}return!1}(),a.worker=!!window.Worker,a.pointerLock="pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||navigator.oGetUserMedia,window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,a.getUserMedia=a.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,s.firefox&&s.firefoxVersion<21&&(a.getUserMedia=!1),!r.iOS&&(s.ie||s.firefox||s.chrome)&&(a.canvasBitBltShift=!0),(s.safari||s.mobileSafari)&&(a.canvasBitBltShift=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(a.vibration=!0),"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint32Array&&(a.littleEndian=(t=new ArrayBuffer(4),e=new Uint8Array(t),i=new Uint32Array(t),e[0]=161,e[1]=178,e[2]=195,e[3]=212,3569595041===i[0]||2712847316!==i[0]&&null)),a.support32bit="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof Int32Array&&null!==a.littleEndian&&o,a}()},91639(t){var e={available:!1,cancel:"",keyboard:!1,request:""};t.exports=function(){if("function"==typeof importScripts)return e;var t,i="Fullscreen",r="FullScreen",s=["request"+i,"request"+r,"webkitRequest"+i,"webkitRequest"+r,"msRequest"+i,"msRequest"+r,"mozRequest"+r,"mozRequest"+i];for(t=0;t=1)&&(s.touch=!0),(navigator.msPointerEnabled||navigator.pointerEnabled)&&(s.mspointer=!0),navigator.getGamepads&&(s.gamepads=!0),"onwheel"in window||r.ie&&"WheelEvent"in window?s.wheelEvent="wheel":"onmousewheel"in window?s.wheelEvent="mousewheel":r.firefox&&"MouseScrollEvent"in window&&(s.wheelEvent="DOMMouseScroll")),s)},25892(t){var e={android:!1,chromeOS:!1,cordova:!1,crosswalk:!1,desktop:!1,ejecta:!1,electron:!1,iOS:!1,iOSVersion:0,iPad:!1,iPhone:!1,kindle:!1,linux:!1,macOS:!1,node:!1,nodeWebkit:!1,pixelRatio:1,webApp:!1,windows:!1,windowsPhone:!1};t.exports=function(){if("function"==typeof importScripts)return e;var t=navigator.userAgent;/Windows/.test(t)?e.windows=!0:/Mac OS/.test(t)&&!/like Mac OS/.test(t)?navigator.maxTouchPoints&&navigator.maxTouchPoints>2?(e.iOS=!0,e.iPad=!0,navigator.appVersion.match(/Version\/(\d+)/),e.iOSVersion=parseInt(RegExp.$1,10)):e.macOS=!0:/Android/.test(t)?e.android=!0:/Linux/.test(t)?e.linux=!0:/iP[ao]d|iPhone/i.test(t)?(e.iOS=!0,navigator.appVersion.match(/OS (\d+)/),e.iOSVersion=parseInt(RegExp.$1,10),e.iPhone=-1!==t.toLowerCase().indexOf("iphone"),e.iPad=-1!==t.toLowerCase().indexOf("ipad")):/Kindle/.test(t)||/\bKF[A-Z][A-Z]+/.test(t)||/Silk.*Mobile Safari/.test(t)?e.kindle=!0:/CrOS/.test(t)&&(e.chromeOS=!0),(/Windows Phone/i.test(t)||/IEMobile/i.test(t))&&(e.android=!1,e.iOS=!1,e.macOS=!1,e.windows=!0,e.windowsPhone=!0);var i=/Silk/.test(t);return(e.windows||e.macOS||e.linux&&!i||e.chromeOS)&&(e.desktop=!0),(e.windowsPhone||/Windows NT/i.test(t)&&/Touch/i.test(t))&&(e.desktop=!1),navigator.standalone&&(e.webApp=!0),"function"!=typeof importScripts&&(void 0!==window.cordova&&(e.cordova=!0),void 0!==window.ejecta&&(e.ejecta=!0)),"undefined"!=typeof process&&process.versions&&process.versions.node&&(e.node=!0),e.node&&"object"==typeof process.versions&&(e.nodeWebkit=!!process.versions["node-webkit"],e.electron=!!process.versions.electron),/Crosswalk/.test(t)&&(e.crosswalk=!0),e.pixelRatio=window.devicePixelRatio||1,e}()},43267(t,e,i){var r=i(95540),s={h264:!1,hls:!1,mov:!1,mp4:!1,m4v:!1,ogg:!1,vp9:!1,webm:!1,hasRequestVideoFrame:!1};t.exports=function(){if("function"==typeof importScripts)return s;var t=document.createElement("video"),e=!!t.canPlayType,i=/^no$/;try{e&&(t.canPlayType('video/ogg; codecs="theora"').replace(i,"")&&(s.ogg=!0),t.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(i,"")&&(s.h264=!0,s.mp4=!0),t.canPlayType('video/quicktime4; codecs="avc1.42E01E"').replace(i,"")&&(s.mov=!0),t.canPlayType("video/x-m4v").replace(i,"")&&(s.m4v=!0),t.canPlayType('video/webm; codecs="vp8, vorbis"').replace(i,"")&&(s.webm=!0),t.canPlayType('video/webm; codecs="vp9"').replace(i,"")&&(s.vp9=!0),t.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(i,"")&&(s.hls=!0))}catch(t){}return t.parentNode&&t.parentNode.removeChild(t),s.getVideoURL=function(t){Array.isArray(t)||(t=[t]);for(var e=0;e4096&&(s=Math.ceil(r/4096),r=4096),this.dataTextureResolution[0]=r,this.dataTextureResolution[1]=s;var n=new ArrayBuffer(r*s*4),o=new Uint32Array(n),l=new Uint8Array(n),u=0,d=65536;o[u++]=Math.round(this.bands[0].start*d),o[u++]=Math.round(this.bands[this.bands.length-1].end*d);for(var c=0;c<=e;c++)for(var f=Math.pow(2,c),p=1;po.end&&(o.end=o.start)}return i&&(this.bands=s.filter(function(t){return t.start=t){e=r;break}}return e?(t=(t-e.start)/(e.end-e.start),e.getColor(t)):{r:0,g:0,b:0,a:0,color:0}},destroy:function(){this.scene=null,this.dataTexture&&this.dataTexture.destroy()}});t.exports=l},51767(t,e,i){var r=i(83419),s=i(29747),n=new r({initialize:function(t,e,i){this._rgb=[0,0,0],this.onChangeCallback=s,this.dirty=!1,this.set(t,e,i)},set:function(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this._rgb=[t,e,i],this.onChange(),this},equals:function(t,e,i){var r=this._rgb;return r[0]===t&&r[1]===e&&r[2]===i},onChange:function(){this.dirty=!0;var t=this._rgb;this.onChangeCallback.call(this,t[0],t[1],t[2])},r:{get:function(){return this._rgb[0]},set:function(t){this._rgb[0]=t,this.onChange()}},g:{get:function(){return this._rgb[1]},set:function(t){this._rgb[1]=t,this.onChange()}},b:{get:function(){return this._rgb[2]},set:function(t){this._rgb[2]=t,this.onChange()}},destroy:function(){this.onChangeCallback=null}});t.exports=n},60461(t){t.exports={TOP_LEFT:0,TOP_CENTER:1,TOP_RIGHT:2,LEFT_TOP:3,LEFT_CENTER:4,LEFT_BOTTOM:5,CENTER:6,RIGHT_TOP:7,RIGHT_CENTER:8,RIGHT_BOTTOM:9,BOTTOM_LEFT:10,BOTTOM_CENTER:11,BOTTOM_RIGHT:12}},54312(t,e,i){var r=i(62235),s=i(35893),n=i(86327),a=i(88417);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)+i),n(t,r(e)+o),t}},46768(t,e,i){var r=i(62235),s=i(26541),n=i(86327),a=i(385);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)-i),n(t,r(e)+o),t}},35827(t,e,i){var r=i(62235),s=i(54380),n=i(86327),a=i(40136);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)+i),n(t,r(e)+o),t}},46871(t,e,i){var r=i(66786),s=i(35893),n=i(7702);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)+i,n(e)+a),t}},5198(t,e,i){var r=i(7702),s=i(26541),n=i(20786),a=i(385);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)-i),n(t,r(e)+o),t}},11879(t,e,i){var r=i(60461),s=[];s[r.BOTTOM_CENTER]=i(54312),s[r.BOTTOM_LEFT]=i(46768),s[r.BOTTOM_RIGHT]=i(35827),s[r.CENTER]=i(46871),s[r.LEFT_CENTER]=i(5198),s[r.RIGHT_CENTER]=i(80503),s[r.TOP_CENTER]=i(89698),s[r.TOP_LEFT]=i(922),s[r.TOP_RIGHT]=i(21373),s[r.LEFT_BOTTOM]=s[r.BOTTOM_LEFT],s[r.LEFT_TOP]=s[r.TOP_LEFT],s[r.RIGHT_BOTTOM]=s[r.BOTTOM_RIGHT],s[r.RIGHT_TOP]=s[r.TOP_RIGHT];t.exports=function(t,e,i,r,n){return s[i](t,e,r,n)}},80503(t,e,i){var r=i(7702),s=i(54380),n=i(20786),a=i(40136);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)+i),n(t,r(e)+o),t}},89698(t,e,i){var r=i(35893),s=i(17717),n=i(88417),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,r(e)+i),a(t,s(e)-o),t}},922(t,e,i){var r=i(26541),s=i(17717),n=i(385),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,r(e)-i),a(t,s(e)-o),t}},21373(t,e,i){var r=i(54380),s=i(17717),n=i(40136),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,r(e)+i),a(t,s(e)-o),t}},91660(t,e,i){t.exports={BottomCenter:i(54312),BottomLeft:i(46768),BottomRight:i(35827),Center:i(46871),LeftCenter:i(5198),QuickSet:i(11879),RightCenter:i(80503),TopCenter:i(89698),TopLeft:i(922),TopRight:i(21373)}},71926(t,e,i){var r=i(60461),s=i(79291),n={In:i(91660),To:i(16694)};n=s(!1,n,r),t.exports=n},21578(t,e,i){var r=i(62235),s=i(35893),n=i(88417),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,s(e)+i),a(t,r(e)+o),t}},10210(t,e,i){var r=i(62235),s=i(26541),n=i(385),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,s(e)-i),a(t,r(e)+o),t}},82341(t,e,i){var r=i(62235),s=i(54380),n=i(40136),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,s(e)+i),a(t,r(e)+o),t}},87958(t,e,i){var r=i(62235),s=i(26541),n=i(86327),a=i(40136);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)-i),n(t,r(e)+o),t}},40080(t,e,i){var r=i(7702),s=i(26541),n=i(20786),a=i(40136);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)-i),n(t,r(e)+o),t}},88466(t,e,i){var r=i(26541),s=i(17717),n=i(40136),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,r(e)-i),a(t,s(e)-o),t}},38829(t,e,i){var r=i(60461),s=[];s[r.BOTTOM_CENTER]=i(21578),s[r.BOTTOM_LEFT]=i(10210),s[r.BOTTOM_RIGHT]=i(82341),s[r.LEFT_BOTTOM]=i(87958),s[r.LEFT_CENTER]=i(40080),s[r.LEFT_TOP]=i(88466),s[r.RIGHT_BOTTOM]=i(19211),s[r.RIGHT_CENTER]=i(34609),s[r.RIGHT_TOP]=i(48741),s[r.TOP_CENTER]=i(49440),s[r.TOP_LEFT]=i(81288),s[r.TOP_RIGHT]=i(61323);t.exports=function(t,e,i,r,n){return s[i](t,e,r,n)}},19211(t,e,i){var r=i(62235),s=i(54380),n=i(86327),a=i(385);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)+i),n(t,r(e)+o),t}},34609(t,e,i){var r=i(7702),s=i(54380),n=i(20786),a=i(385);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)+i),n(t,r(e)+o),t}},48741(t,e,i){var r=i(54380),s=i(17717),n=i(385),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,r(e)+i),a(t,s(e)-o),t}},49440(t,e,i){var r=i(35893),s=i(17717),n=i(86327),a=i(88417);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,r(e)+i),n(t,s(e)-o),t}},81288(t,e,i){var r=i(26541),s=i(17717),n=i(86327),a=i(385);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,r(e)-i),n(t,s(e)-o),t}},61323(t,e,i){var r=i(54380),s=i(17717),n=i(86327),a=i(40136);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,r(e)+i),n(t,s(e)-o),t}},16694(t,e,i){t.exports={BottomCenter:i(21578),BottomLeft:i(10210),BottomRight:i(82341),LeftBottom:i(87958),LeftCenter:i(40080),LeftTop:i(88466),QuickSet:i(38829),RightBottom:i(19211),RightCenter:i(34609),RightTop:i(48741),TopCenter:i(49440),TopLeft:i(81288),TopRight:i(61323)}},66786(t,e,i){var r=i(88417),s=i(20786);t.exports=function(t,e,i){return r(t,e),s(t,i)}},62235(t){t.exports=function(t){return t.y+t.height-t.height*t.originY}},72873(t,e,i){var r=i(62235),s=i(26541),n=i(54380),a=i(17717),o=i(87841);t.exports=function(t,e){void 0===e&&(e=new o);var i=s(t),h=a(t);return e.x=i,e.y=h,e.width=n(t)-i,e.height=r(t)-h,e}},35893(t){t.exports=function(t){return t.x-t.width*t.originX+.5*t.width}},7702(t){t.exports=function(t){return t.y-t.height*t.originY+.5*t.height}},26541(t){t.exports=function(t){return t.x-t.width*t.originX}},87431(t){t.exports=function(t){return t.width*t.originX}},46928(t){t.exports=function(t){return t.height*t.originY}},54380(t){t.exports=function(t){return t.x+t.width-t.width*t.originX}},17717(t){t.exports=function(t){return t.y-t.height*t.originY}},86327(t){t.exports=function(t,e){return t.y=e-t.height+t.height*t.originY,t}},88417(t){t.exports=function(t,e){var i=t.width*t.originX;return t.x=e+i-.5*t.width,t}},20786(t){t.exports=function(t,e){var i=t.height*t.originY;return t.y=e+i-.5*t.height,t}},385(t){t.exports=function(t,e){return t.x=e+t.width*t.originX,t}},40136(t){t.exports=function(t,e){return t.x=e-t.width+t.width*t.originX,t}},66737(t){t.exports=function(t,e){return t.y=e+t.height*t.originY,t}},58724(t,e,i){t.exports={CenterOn:i(66786),GetBottom:i(62235),GetBounds:i(72873),GetCenterX:i(35893),GetCenterY:i(7702),GetLeft:i(26541),GetOffsetX:i(87431),GetOffsetY:i(46928),GetRight:i(54380),GetTop:i(17717),SetBottom:i(86327),SetCenterX:i(88417),SetCenterY:i(20786),SetLeft:i(385),SetRight:i(40136),SetTop:i(66737)}},20623(t){t.exports={setCrisp:function(t){return["optimizeSpeed","-moz-crisp-edges","-o-crisp-edges","-webkit-optimize-contrast","optimize-contrast","crisp-edges","pixelated"].forEach(function(e){t.style["image-rendering"]=e}),t.style.msInterpolationMode="nearest-neighbor",t},setBicubic:function(t){return t.style["image-rendering"]="auto",t.style.msInterpolationMode="bicubic",t}}},27919(t,e,i){var r,s,n,a=i(8054),o=i(68703),h=[],l=!1;t.exports=(n=function(){var t=0;return h.forEach(function(e){e.parent&&t++}),t},{create2D:function(t,e,i){return r(t,e,i,a.CANVAS)},create:r=function(t,e,i,r,n){var u;void 0===e&&(e=1),void 0===i&&(i=1),void 0===r&&(r=a.CANVAS),void 0===n&&(n=!1);var d=s(r);return null===d?(d={parent:t,canvas:document.createElement("canvas"),type:r},r===a.CANVAS&&h.push(d),u=d.canvas):(d.parent=t,u=d.canvas),n&&(d.parent=u),u.width=e,u.height=i,l&&r===a.CANVAS&&o.disable(u.getContext("2d",{willReadFrequently:!1})),u},createWebGL:function(t,e,i){return r(t,e,i,a.WEBGL)},disableSmoothing:function(){l=!0},enableSmoothing:function(){l=!1},first:s=function(t){if(void 0===t&&(t=a.CANVAS),t===a.WEBGL)return null;for(var e=0;e=0;e--)i.push({r:e,g:a,b:o,color:r(e,a,o)});for(n=0,e=0;e<=s;e++,a--)i.push({r:n,g:a,b:e,color:r(n,a,e)});for(a=0,o=255,e=0;e<=s;e++,o--,n++)i.push({r:n,g:a,b:o,color:r(n,a,o)});if(1024===t)return i;var h=[],l=0,u=1024/t;for(e=0;e>16&255,g:t>>8&255,b:255&t,a:255};return t>16777215&&(e.a=t>>>24),e}},62957(t){t.exports=function(t){var e=t.toString(16);return 1===e.length?"0"+e:e}},37589(t){t.exports=function(t,e,i){return t<<16|e<<8|i}},1e3(t){t.exports=function(t,e,i,r){return r<<24|t<<16|e<<8|i}},62183(t,e,i){var r=i(40987),s=i(89528);t.exports=function(t,e,i,n){n||(n=new r);var a=i,o=i,h=i;if(0!==e){var l=i<.5?i*(1+e):i+e-i*e,u=2*i-l;a=s(u,l,t+1/3),o=s(u,l,t),h=s(u,l,t-1/3)}return n.setGLTo(a,o,h,1)}},27939(t,e,i){var r=i(7537);t.exports=function(t,e){void 0===t&&(t=1),void 0===e&&(e=1);for(var i=[],s=0;s<=359;s++)i.push(r(s/359,t,e));return i}},7537(t,e,i){var r=i(37589);function s(t,e,i,r){var s=(t+6*e)%6,n=Math.min(s,4-s,1);return Math.round(255*(r-r*i*Math.max(0,n)))}t.exports=function(t,e,i,n){void 0===e&&(e=1),void 0===i&&(i=1);var a=s(5,t,e,i),o=s(3,t,e,i),h=s(1,t,e,i);return n?n.setTo?n.setTo(a,o,h,n.alpha,!0):(n.r=a,n.g=o,n.b=h,n.color=r(a,o,h),n):{r:a,g:o,b:h,color:r(a,o,h)}}},70238(t,e,i){var r=i(40987);t.exports=function(t,e){e||(e=new r),t=t.replace(/^(?:#|0x)?([a-f\d])([a-f\d])([a-f\d])$/i,function(t,e,i,r){return e+e+i+i+r+r});var i=/^(?:#|0x)?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);if(i){var s=parseInt(i[1],16),n=parseInt(i[2],16),a=parseInt(i[3],16);e.setTo(s,n,a)}return e}},89528(t){t.exports=function(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}},30100(t,e,i){var r=i(40987),s=i(90664);t.exports=function(t,e){var i=s(t);return e?e.setTo(i.r,i.g,i.b,i.a):new r(i.r,i.g,i.b,i.a)}},90664(t){t.exports=function(t){return t>16777215?{a:t>>>24,r:t>>16&255,g:t>>8&255,b:255&t}:{a:255,r:t>>16&255,g:t>>8&255,b:255&t}}},13699(t,e,i){var r=i(28915),s=i(37589),n=i(7537),a=function(t,e,i,n,a,o,h,l){void 0===h&&(h=100),void 0===l&&(l=0);var u=l/h,d=r(t,n,u),c=r(e,a,u),f=r(i,o,u);return{r:d,g:c,b:f,a:255,color:s(d,c,f)}},o=function(t,e,i,s,a,o,h,l,u){if(void 0===u&&(u=0),0===u){var d=t-s;d>.5?t-=1:d<-.5&&(t+=1)}else u>0?t>s&&(t-=1):tt?r.ORIENTATION.PORTRAIT:r.ORIENTATION.LANDSCAPE}},74403(t){t.exports=function(t){var e;return""!==t&&("string"==typeof t?e=document.getElementById(t):t&&1===t.nodeType&&(e=t)),e||(e=document.body),e}},56836(t){t.exports=function(t){var e="";try{if(window.DOMParser)e=(new DOMParser).parseFromString(t,"text/xml");else(e=new ActiveXObject("Microsoft.XMLDOM")).loadXML(t)}catch(t){e=null}return e&&e.documentElement&&!e.getElementsByTagName("parsererror").length?e:null}},35846(t){t.exports=function(t){t.parentNode&&t.parentNode.removeChild(t)}},43092(t,e,i){var r=i(83419),s=i(29747),n=new r({initialize:function(){this.isRunning=!1,this.callback=s,this.isSetTimeOut=!1,this.timeOutID=null,this.delay=0;var t=this;this.step=function e(i){t.callback(i),t.isRunning&&(t.timeOutID=window.requestAnimationFrame(e))},this.stepTimeout=function e(){t.isRunning&&(t.timeOutID=window.setTimeout(e,t.delay)),t.callback(window.performance.now())}},start:function(t,e,i){this.isRunning||(this.callback=t,this.isSetTimeOut=e,this.delay=i,this.isRunning=!0,this.timeOutID=e?window.setTimeout(this.stepTimeout,0):window.requestAnimationFrame(this.step))},stop:function(){this.isRunning=!1,this.isSetTimeOut?clearTimeout(this.timeOutID):window.cancelAnimationFrame(this.timeOutID)},destroy:function(){this.stop(),this.callback=s}});t.exports=n},84902(t,e,i){var r={AddToDOM:i(40366),DOMContentLoaded:i(57264),GetInnerHeight:i(57811),GetScreenOrientation:i(45818),GetTarget:i(74403),ParseXML:i(56836),RemoveFromDOM:i(35846),RequestAnimationFrame:i(43092)};t.exports=r},47565(t,e,i){var r=i(83419),s=i(50792),n=i(37277),a=new r({Extends:s,initialize:function(){s.call(this)},shutdown:function(){this.removeAllListeners()},destroy:function(){this.removeAllListeners()}});n.register("EventEmitter",a,"events"),t.exports=a},93055(t,e,i){t.exports={EventEmitter:i(47565)}},10189(t,e,i){var r=i(83419),s=i(13045),n=new r({Extends:s,initialize:function(t,e){void 0===e&&(e=1),s.call(this,t,"FilterBarrel"),this.amount=e}});t.exports=n},16762(t,e,i){var r=i(83419),s=i(13045),n=new r({Extends:s,initialize:function(t,e,i,r,n){void 0===e&&(e="__WHITE"),void 0===i&&(i=0),void 0===r&&(r=1),void 0===n&&(n=[1,1,1,1]),s.call(this,t,"FilterBlend"),this.glTexture,this.blendMode=i,this.amount=r,this.color=n,this.setTexture(e)},setTexture:function(t){var e=this.camera.scene.sys.textures.getFrame(t);return e&&(this.glTexture=e.glTexture),this}});t.exports=n},37597(t,e,i){var r=i(83419),s=i(13045),n=new r({Extends:s,initialize:function(t,e){s.call(this,t,"FilterBlocky"),this.size={x:4,y:4},this.offset={x:0,y:0},e&&(void 0!==e.size&&("number"==typeof e.size?(this.size.x=e.size,this.size.y=e.size):(this.size.x=e.size.x,this.size.y=e.size.y)),void 0!==e.offset&&("number"==typeof e.offset?(this.offset.x=e.offset,this.offset.y=e.offset):(this.offset.x=e.offset.x,this.offset.y=e.offset.y)))}});t.exports=n},88344(t,e,i){var r=i(83419),s=i(13045),n=new r({Extends:s,initialize:function(t,e,i,r,n,a,o){void 0===e&&(e=0),void 0===i&&(i=2),void 0===r&&(r=2),void 0===n&&(n=1),void 0===o&&(o=4),s.call(this,t,"FilterBlur"),this.quality=e,this.x=i,this.y=r,this.strength=n,this.glcolor=[1,1,1],null!=a&&(this.color=a),this.steps=o},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}},getPadding:function(){var t=this.paddingOverride;if(t)return this.currentPadding.setTo(t.x,t.y,t.width,t.height),t;var e=this.quality,i=0===e?1.333:1===e?3.2307692308:5.176470588235294,r=this.steps*this.strength*i,s=Math.ceil(this.x*r),n=Math.ceil(this.y*r);return this.currentPadding.setTo(-s,-n,2*s,2*n),this.currentPadding}});t.exports=n},47564(t,e,i){var r=i(83419),s=i(13045),n=new r({Extends:s,initialize:function(t,e,i,r,n,a,o,h){void 0===e&&(e=.5),void 0===i&&(i=1),void 0===r&&(r=.2),void 0===n&&(n=!1),void 0===a&&(a=1),void 0===o&&(o=1),void 0===h&&(h=1),s.call(this,t,"FilterBokeh"),this.radius=e,this.amount=i,this.contrast=r,this.isTiltShift=n,this.blurX=a,this.blurY=o,this.strength=h},getPadding:function(){var t=this.paddingOverride;if(t)return this.currentPadding.setTo(t.x,t.y,t.width,t.height),t;var e=Math.ceil(this.camera.height*this.radius*.021426096060426905);return this.currentPadding.setTo(-e,-e,2*e,2*e),this.currentPadding}});t.exports=n},77011(t,e,i){var r=i(83419),s=i(13045),n=i(89422),a=new r({Extends:s,initialize:function(t){s.call(this,t,"FilterColorMatrix"),this.colorMatrix=new n},destroy:function(){this.colorMatrix=null,s.prototype.destroy.call(this)}});t.exports=a},95200(t,e,i){var r=i(83419),s=i(13045),n=i(89422),a=new r({Extends:s,initialize:function(t,e){s.call(this,t,"FilterCombineColorMatrix"),this.glTexture,this.colorMatrixSelf=new n,this.colorMatrixTransfer=new n,this.additions=[1,1,1,0],this.multiplications=[0,0,0,1],this.setTexture(e||"__WHITE")},setTexture:function(t){var e=t instanceof Phaser.Textures.Texture?t:this.camera.scene.sys.textures.getFrame(t);return e&&(this.glTexture=e.glTexture),this},setupAlphaTransfer:function(t,e,i,r,s,n){var a=this.colorMatrixSelf,o=this.colorMatrixTransfer;a.reset(),o.reset(),this.additions=[1,1,1,0],this.multiplications=[0,0,0,1],t||a.black(),e||o.black(),s?a.brightnessToAlphaInverse(!0):i&&a.brightnessToAlpha(!0),n?o.brightnessToAlphaInverse(!0):r&&o.brightnessToAlpha(!0)},destroy:function(){this.colorMatrixSelf=null,this.colorMatrixTransfer=null,s.prototype.destroy.call(this)}});t.exports=a},13045(t,e,i){var r=i(83419),s=i(87841),n=new r({initialize:function(t,e){this.active=!0,this.camera=t,this.renderNode=e,this.paddingOverride=new s,this.currentPadding=new s,this.allowBaseDraw=!0,this.ignoreDestroy=!1},getPadding:function(){return this.paddingOverride||this.currentPadding},getPaddingCeil:function(){var t=this.getPadding(),e=new s(Math.ceil(t.x),Math.ceil(t.y),Math.ceil(t.width),Math.ceil(t.height));return this.currentPadding.setTo(e.x,e.y,e.width,e.height),e},setPaddingOverride:function(t,e,i,r){return null===t?(this.paddingOverride=null,this):(void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),this.paddingOverride=new s(t,e,i-t,r-e),this)},setActive:function(t){return this.active=t,this},destroy:function(){this.active=!1,this.renderNode=null,this.camera=null}});t.exports=n},16898(t,e,i){var r=i(83419),s=i(13045),n=new r({Extends:s,initialize:function(t,e,i,r){void 0===e&&(e="__WHITE"),void 0===i&&(i=.005),void 0===r&&(r=.005),s.call(this,t,"FilterDisplacement"),this.x=i,this.y=r,this.glTexture,this.setTexture(e)},setTexture:function(t){var e=this.camera.scene.sys.textures.getFrame(t);return e&&(this.glTexture=e.glTexture),this},getPadding:function(){var t=this.paddingOverride;if(t)return this.currentPadding.setTo(t.x,t.y,t.width,t.height),t;var e=this.camera,i=Math.ceil(e.width*this.x*.5),r=Math.ceil(e.height*this.y*.5);return this.currentPadding.setTo(-i,-r,2*i,2*r),this.currentPadding}});t.exports=n},42652(t,e,i){var r=i(83419),s=i(13045),n=new r({Extends:s,initialize:function(t,e,i,r,n,a,o,h){void 0===i&&(i=4),void 0===r&&(r=0),void 0===n&&(n=1),void 0===a&&(a=!1),void 0===o&&(o=t.scene.sys.game.config.glowQuality),void 0===h&&(h=t.scene.sys.game.config.glowDistance),s.call(this,t,"FilterGlow"),this.outerStrength=i,this.innerStrength=r,this.scale=n,this.knockout=a,this._quality=Math.max(Math.round(o),1),this._distance=Math.max(Math.round(h),1),this.glcolor=[1,1,1,1],void 0!==e&&(this.color=e)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}},distance:{get:function(){return this._distance}},quality:{get:function(){return this._quality}},getPadding:function(){var t=this.paddingOverride;if(t)return this.currentPadding.setTo(t.x,t.y,t.width,t.height),t;var e=this.currentPadding,i=Math.ceil(this.distance*this.scale);return e.left=-i,e.top=-i,e.right=i,e.bottom=i,e}});t.exports=n},43927(t,e,i){var r=i(83419),s=i(13045),n=i(73043),a=new r({Extends:s,initialize:function(t,e){e||(e={});var i=t.scene;s.call(this,t,"FilterGradientMap");var r=e.ramp;r||(r={colorStart:0,colorEnd:16777215}),r instanceof n||(r=new n(i,r,!0)),this.ramp=r,this.dither=!!e.dither,this.color=[0,0,0,0],e.color&&(this.color[0]=e.color[0]||0,this.color[1]=e.color[1]||0,this.color[2]=e.color[2]||0,this.color[3]=e.color[3]||0),this.colorFactor=[.3,.6,.1,0],e.colorFactor&&(this.colorFactor[0]=e.colorFactor[0]||0,this.colorFactor[1]=e.colorFactor[1]||0,this.colorFactor[2]=e.colorFactor[2]||0,this.colorFactor[3]=e.colorFactor[3]||0),this.unpremultiply=void 0===e.unpremultiply||e.unpremultiply,this.alpha=void 0===e.alpha?1:e.alpha}});t.exports=a},84714(t,e,i){var r=i(83419),s=i(13045),n=i(37867),a=i(61340),o=new r({Extends:s,initialize:function(t,e){s.call(this,t,"FilterImageLight"),this.normalGlTexture,this.environmentGlTexture,this.viewMatrix=new n,this.modelRotation=e.modelRotation||0,this.modelRotationSource=e.modelRotationSource||null,this.bulge=e.bulge||0,this.colorFactor=e.colorFactor||[1,1,1],this._tempMatrix=new a,this._tempParentMatrix=new a,this.setEnvironmentMap(e.environmentMap||"__WHITE"),this.setNormalMap(e.normalMap||"__NORMAL"),e.viewMatrix&&this.viewMatrix.set(e.viewMatrix)},setEnvironmentMap:function(t){var e=t instanceof Phaser.Textures.Texture?t:this.camera.scene.sys.textures.getFrame(t);return e&&(this.environmentGlTexture=e.glTexture),this},setNormalMap:function(t){var e=t instanceof Phaser.Textures.Texture?t:this.camera.scene.sys.textures.getFrame(t);return e&&(this.normalGlTexture=e.glTexture),this},setNormalMapFromGameObject:function(t){var e=t.texture.dataSource[0];return e&&(this.normalGlTexture=e.glTexture),this},getModelRotation:function(){return this.modelRotationSource?"function"==typeof this.modelRotationSource?this.modelRotationSource():this.modelRotationSource.hasTransformComponent?this.modelRotationSource.getWorldTransformMatrix(this._tempMatrix,this._tempParentMatrix).rotationNormalized:this.modelRotation:this.modelRotation}});t.exports=o},51890(t,e,i){var r=i(83419),s=i(13045),n=i(40987),a=new r({Extends:s,initialize:function(t,e){void 0===e&&(e={}),s.call(this,t,"FilterKey"),this.color=[1,1,1,1],void 0!==e.color&&this.setColor(e.color),void 0!==e.alpha&&this.setAlpha(e.alpha),this.isolate=!1,void 0!==e.isolate&&(this.isolate=e.isolate),this.threshold=.0625,void 0!==e.threshold&&(this.threshold=e.threshold),this.feather=0,void 0!==e.feather&&(this.feather=e.feather)},setAlpha:function(t){return this.color[3]=t,this},setColor:function(t){var e=this.color[3];if("number"==typeof t){var i=n.IntegerToRGB(t);this.color=[i.r/255,i.g/255,i.b/255,e]}else if("string"==typeof t){var r=n.HexStringToColor(t);this.color=[r.redGL,r.greenGL,r.blueGL,e]}else Array.isArray(t)?this.color=[t[0],t[1],t[2],e]:t instanceof n&&(this.color=[t.redGL,t.greenGL,t.blueGL,e]);return this}});t.exports=a},97797(t,e,i){var r=i(83419),s=i(45650),n=i(13045),a=new r({Extends:n,initialize:function(t,e,i,r,s,a){void 0===e&&(e="__WHITE"),void 0===i&&(i=!1),void 0===a&&(a=1),n.call(this,t,"FilterMask"),this.glTexture,this._dynamicTexture=null,this.maskGameObject=null,this.invert=i,this.autoUpdate=!0,this.needsUpdate=!1,this.viewTransform=s||"world",this.viewCamera=r,this.scaleFactor=a,"string"==typeof e?this.setTexture(e):this.setGameObject(e)},updateDynamicTexture:function(t,e){var i=this.scaleFactor,r=t*i,n=e*i,a=this.maskGameObject;if(a){if(this._dynamicTexture)this._dynamicTexture.width!==r||this._dynamicTexture.height!==n?this._dynamicTexture.setSize(r,n,!1):this._dynamicTexture.clear();else{var o=this.camera.scene.sys.textures;this._dynamicTexture=o.addDynamicTexture(s(),r,n,!1)}this.glTexture=this._dynamicTexture.get().glTexture;var h=this.viewCamera||a.scene.renderer.currentViewCamera;this._dynamicTexture.capture(a,{transform:this.viewTransform,camera:h}),this._dynamicTexture.render(),this.needsUpdate=!1}},setGameObject:function(t){return this.maskGameObject=t,this.needsUpdate=!0,this},setTexture:function(t){var e=this.camera.scene.sys.textures.getFrame(t);return e&&(this.maskGameObject=null,this.glTexture=e.glTexture),this},destroy:function(){this._dynamicTexture&&this._dynamicTexture.destroy(),this.maskGameObject=null,this._dynamicTexture=null,n.prototype.destroy.call(this)}});t.exports=a},37911(t,e,i){var r=i(83419),s=i(13045),n=i(37867),a=i(25836),o=new r({Extends:s,initialize:function(t,e){e=e||{},s.call(this,t,"FilterNormalTools"),this._rotation=0,this.viewMatrix=new n,this.setRotation(e.rotation||0),this.rotationSource=e.rotationSource||null,this.facingPower=e.facingPower||1,this.outputRatio=e.outputRatio||!1,this.ratioVector=new a(0,0,1),e.ratioVector&&this.ratioVector.set(e.ratioVector[0],e.ratioVector[1],e.ratioVector[2]),this.ratioRadius=e.ratioRadius||1},getRotation:function(){if(this.rotationSource){if("function"==typeof this.rotationSource)return this.rotationSource();if(this.rotationSource.hasTransformComponent)return this.rotationSource.getWorldTransformMatrix().rotationNormalized}return this._rotation},setRotation:function(t){return this.viewMatrix.identity().rotateZ(t),this._rotation=t,this},updateRotation:function(){if(this.rotationSource){var t=this.getRotation();this.viewMatrix.identity().rotateZ(t),this._rotation=t}return this}});t.exports=o},6379(t,e,i){var r=i(83419),s=i(13045),n=new r({Extends:s,initialize:function(t,e){void 0===e&&(e={}),s.call(this,t,"FilterPanoramaBlur"),this.radius=e.radius||1,this.samplesX=e.samplesX||32,this.samplesY=e.samplesY||16,this.power=e.power||1}});t.exports=n},2195(t,e,i){var r=i(83419),s=i(53427),n=i(13045),a=i(16762),o=new r({Extends:n,initialize:function(t){n.call(this,t,"FilterParallelFilters"),this.top=new s(t),this.bottom=new s(t),this.blend=new a(t)}});s.prototype.addParallelFilters=function(){return this.add(new o(this.camera))},t.exports=o},29861(t,e,i){var r=i(83419),s=i(13045),n=new r({Extends:s,initialize:function(t,e){void 0===e&&(e=1),s.call(this,t,"FilterPixelate"),this.amount=e}});t.exports=n},14366(t,e,i){var r=i(83419),s=i(13045),n=new r({Extends:s,initialize:function(t,e){e||(e={}),s.call(this,t,"FilterQuantize"),this.steps=[8,8,8,8],e.steps&&(this.steps[0]=e.steps[0],this.steps[1]=e.steps[1],this.steps[2]=e.steps[2],this.steps[3]=e.steps[3]),this.gamma=[1,1,1,1],e.gamma&&(this.gamma[0]=e.gamma[0],this.gamma[1]=e.gamma[1],this.gamma[2]=e.gamma[2],this.gamma[3]=e.gamma[3]),this.offset=[0,0,0,0],e.offset&&(this.offset[0]=e.offset[0],this.offset[1]=e.offset[1],this.offset[2]=e.offset[2],this.offset[3]=e.offset[3]),this.mode=e.mode||0,this.dither=!!e.dither}});t.exports=n},63785(t,e,i){var r=i(83419),s=i(13045),n=new r({Extends:s,initialize:function(t,e,i){void 0===i&&(i=null),s.call(this,t,"FilterSampler"),this.allowBaseDraw=!1,this.callback=e,this.region=i}});t.exports=n},62229(t,e,i){var r=i(83419),s=i(13045),n=new r({Extends:s,initialize:function(t,e,i,r,n,a,o,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=.1),void 0===n&&(n=1),void 0===o&&(o=6),void 0===h&&(h=1),s.call(this,t,"FilterShadow"),this.x=e,this.y=i,this.decay=r,this.power=n,this.glcolor=[0,0,0,1],this.samples=o,this.intensity=h,void 0!==a&&(this.color=a)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}},getPadding:function(){var t=this.paddingOverride;if(t)return this.currentPadding.setTo(t.x,t.y,t.width,t.height),t;var e=this.camera,i=this.decay*this.intensity,r=Math.ceil(Math.abs(this.x)*e.width*i),s=Math.ceil(Math.abs(this.y)*e.height*i);return this.currentPadding.setTo(-r,-s,2*r,2*s),this.currentPadding}});t.exports=n},99534(t,e,i){var r=i(83419),s=i(13045),n=new r({Extends:s,initialize:function(t,e,i,r){s.call(this,t,"FilterThreshold"),this.edge1=[.5,.5,.5,.5],this.edge2=[.5,.5,.5,.5],this.invert=[!1,!1,!1,!1],this.setEdge(e,i),this.setInvert(r)},setEdge:function(t,e){void 0===t&&(t=.5),"number"==typeof t&&(t=[t,t,t,t]),this.edge1[0]=t[0],this.edge1[1]=t[1],this.edge1[2]=t[2],this.edge1[3]=t[3],void 0===e&&(e=t),"number"==typeof e&&(e=[e,e,e,e]),this.edge2[0]=e[0],this.edge2[1]=e[1],this.edge2[2]=e[2],this.edge2[3]=e[3];for(var i=0;i<4;i++)if(this.edge1[i]>this.edge2[i]){var r=this.edge1[i];this.edge1[i]=this.edge2[i],this.edge2[i]=r}return this},setInvert:function(t){return void 0===t&&(t=!1),"boolean"==typeof t&&(t=[t,t,t,t]),this.invert[0]=t[0],this.invert[1]=t[1],this.invert[2]=t[2],this.invert[3]=t[3],this}});t.exports=n},20263(t,e,i){var r=i(83419),s=i(13045),n=i(40987),a=new r({Extends:s,initialize:function(t,e,i,r,a,o,h){void 0===e&&(e=.5),void 0===i&&(i=.5),void 0===r&&(r=.5),void 0===a&&(a=.5),void 0===o&&(o=0),void 0===h&&(h=0),s.call(this,t,"FilterVignette"),this.x=e,this.y=i,this.radius=r,this.strength=a,this.color=new n,this.blendMode=h,this.setColor(o)},setColor:function(t){return"number"==typeof t?n.IntegerToColor(t,this.color):"string"==typeof t?n.HexStringToColor(t,this.color):t.setTo?this.color.setTo(t.red,t.green,t.blue,t.alpha):t?this.color.setTo(t.r||0,t.g||0,t.b||0,t.a||255):this.color.setTo(0,0,0,255),this}});t.exports=a},90002(t,e,i){var r=i(83419),s=i(13045),n=i(79237),a=new r({Extends:s,initialize:function(t,e,i,r,n,a){void 0===e&&(e=.1),s.call(this,t,"FilterWipe"),this.progress=0,this.wipeWidth=e,this.direction=i||0,this.axis=r||0,this.reveal=n||0,this.wipeTexture=null,this.setTexture(a)},setWipeWidth:function(t){return void 0===t&&(t=.1),this.wipeWidth=t,this},setLeftToRight:function(){return this.direction=0,this.axis=0,this},setRightToLeft:function(){return this.direction=1,this.axis=0,this},setTopToBottom:function(){return this.direction=1,this.axis=1,this},setBottomToTop:function(){return this.direction=0,this.axis=1,this},setWipeEffect:function(){return this.reveal=0,this.progress=0,this},setRevealEffect:function(){return this.setTexture(),this.reveal=1,this.progress=0,this},setTexture:function(t){return void 0===t&&(t="__DEFAULT"),this.wipeTexture=t instanceof n?t:this.camera.scene.sys.textures.get(t)||this.camera.scene.sys.textures.get("__DEFAULT"),this},setProgress:function(t){return this.progress=t,this}});t.exports=a},11889(t,e,i){var r={Controller:i(13045),Barrel:i(10189),Blend:i(16762),Blocky:i(37597),Blur:i(88344),Bokeh:i(47564),ColorMatrix:i(77011),CombineColorMatrix:i(95200),Displacement:i(16898),Glow:i(42652),GradientMap:i(43927),ImageLight:i(84714),Key:i(51890),Mask:i(97797),NormalTools:i(37911),PanoramaBlur:i(6379),ParallelFilters:i(2195),Pixelate:i(29861),Quantize:i(14366),Sampler:i(63785),Shadow:i(62229),Threshold:i(99534),Vignette:i(20263),Wipe:i(90002)};t.exports=r},25305(t,e,i){var r=i(10312),s=i(23568);t.exports=function(t,e,i){e.x=s(i,"x",0),e.y=s(i,"y",0),e.depth=s(i,"depth",0),e.flipX=s(i,"flipX",!1),e.flipY=s(i,"flipY",!1);var n=s(i,"scale",null);"number"==typeof n?e.setScale(n):null!==n&&(e.scaleX=s(n,"x",1),e.scaleY=s(n,"y",1));var a=s(i,"scrollFactor",null);"number"==typeof a?e.setScrollFactor(a):null!==a&&(e.scrollFactorX=s(a,"x",1),e.scrollFactorY=s(a,"y",1)),e.rotation=s(i,"rotation",0);var o=s(i,"angle",null);null!==o&&(e.angle=o),e.alpha=s(i,"alpha",1);var h=s(i,"origin",null);if("number"==typeof h)e.setOrigin(h);else if(null!==h){var l=s(h,"x",.5),u=s(h,"y",.5);e.setOrigin(l,u)}return e.blendMode=s(i,"blendMode",r.NORMAL),e.visible=s(i,"visible",!0),s(i,"add",!0)&&t.sys.displayList.add(e),e.preUpdate&&t.sys.updateList.add(e),e}},13059(t,e,i){var r=i(23568);t.exports=function(t,e){var i=r(e,"anims",null);if(null===i)return t;if("string"==typeof i)t.anims.play(i);else if("object"==typeof i){var s=t.anims,n=r(i,"key",void 0);if(n){var a=r(i,"startFrame",void 0),o=r(i,"delay",0),h=r(i,"repeat",0),l=r(i,"repeatDelay",0),u=r(i,"yoyo",!1),d=r(i,"play",!1),c=r(i,"delayedPlay",0),f={key:n,delay:o,repeat:h,repeatDelay:l,yoyo:u,startFrame:a};d?s.play(f):c>0?s.playAfterDelay(f,c):s.load(f)}}return t}},8050(t,e,i){var r=i(83419),s=i(73162),n=i(37277),a=i(51708),o=i(44594),h=i(19186),l=new r({Extends:s,initialize:function(t){s.call(this,t),this.sortChildrenFlag=!1,this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.addCallback=this.addChildCallback,this.removeCallback=this.removeChildCallback,this.events.once(o.BOOT,this.boot,this),this.events.on(o.START,this.start,this)},boot:function(){this.events.once(o.DESTROY,this.destroy,this)},addChildCallback:function(t){t.displayList&&t.displayList!==this&&t.removeFromDisplayList(),t.parentContainer&&t.parentContainer.remove(t),t.displayList||(this.queueDepthSort(),t.displayList=this,t.emit(a.ADDED_TO_SCENE,t,this.scene),this.events.emit(o.ADDED_TO_SCENE,t,this.scene))},removeChildCallback:function(t){this.queueDepthSort(),t.displayList=null,t.emit(a.REMOVED_FROM_SCENE,t,this.scene),this.events.emit(o.REMOVED_FROM_SCENE,t,this.scene)},start:function(){this.events.once(o.SHUTDOWN,this.shutdown,this)},queueDepthSort:function(){this.sortChildrenFlag=!0},depthSort:function(){this.sortChildrenFlag&&(h(this.list,this.sortByDepth),this.sortChildrenFlag=!1)},sortByDepth:function(t,e){return t._depth-e._depth},getChildren:function(){return this.list},shutdown:function(){for(var t=this.list,e=t.length;e--;)t[e]&&t[e].destroy(!0);t.length=0,this.events.off(o.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(o.START,this.start,this),this.scene=null,this.systems=null,this.events=null}});n.register("DisplayList",l,"displayList"),t.exports=l},95643(t,e,i){var r=i(83419),s=i(31401),n=i(53774),a=i(45893),o=i(50792),h=i(51708),l=i(44594),u=new r({Extends:o,Mixins:[s.Filters,s.RenderSteps],initialize:function(t,e){o.call(this),this.scene=t,this.displayList=null,this.type=e,this.state=0,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.vertexRoundMode="safeAuto",this.input=null,this.body=null,this.ignoreDestroy=!1,this.isDestroyed=!1,this.addRenderStep&&this.addRenderStep(this.renderWebGL),this.on(h.ADDED_TO_SCENE,this.addedToScene,this),this.on(h.REMOVED_FROM_SCENE,this.removedFromScene,this),t.sys.queueDepthSort()},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},setState:function(t){return this.state=t,this},setDataEnabled:function(){return this.data||(this.data=new a(this)),this},setData:function(t,e){return this.data||(this.data=new a(this)),this.data.set(t,e),this},incData:function(t,e){return this.data||(this.data=new a(this)),this.data.inc(t,e),this},toggleData:function(t){return this.data||(this.data=new a(this)),this.data.toggle(t),this},getData:function(t){return this.data||(this.data=new a(this)),this.data.get(t)},setInteractive:function(t,e,i){return this.scene.sys.input.enable(this,t,e,i),this},disableInteractive:function(t){return void 0===t&&(t=!1),this.scene.sys.input.disable(this,t),this},removeInteractive:function(t){return void 0===t&&(t=!1),this.scene.sys.input.clear(this),t&&this.scene.sys.input.resetCursor(),this.input=void 0,this},addedToScene:function(){},removedFromScene:function(){},update:function(){},toJSON:function(){return n(this)},willRender:function(t){return!(!(!this.displayList||!this.displayList.active||this.displayList.willRender(t))||u.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},willRoundVertices:function(t,e){switch(this.vertexRoundMode){case"safe":return e;case"safeAuto":return e&&t.roundPixels;case"full":return!0;case"fullAuto":return t.roundPixels;default:return!1}},setVertexRoundMode:function(t){return this.vertexRoundMode=t,this},getIndexList:function(){for(var t=this,e=this.parentContainer,i=[];e&&(i.unshift(e.getIndex(t)),t=e,e.parentContainer);)e=e.parentContainer;return this.displayList?i.unshift(this.displayList.getIndex(t)):i.unshift(this.scene.sys.displayList.getIndex(t)),i},addToDisplayList:function(t){return void 0===t&&(t=this.scene.sys.displayList),this.displayList&&this.displayList!==t&&this.removeFromDisplayList(),t.exists(this)||(this.displayList=t,t.add(this,!0),t.queueDepthSort(),this.emit(h.ADDED_TO_SCENE,this,this.scene),t.events.emit(l.ADDED_TO_SCENE,this,this.scene)),this},addToUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.add(this),this},removeFromDisplayList:function(){var t=this.displayList||this.scene.sys.displayList;return t&&t.exists(this)&&(t.remove(this,!0),t.queueDepthSort(),this.displayList=null,this.emit(h.REMOVED_FROM_SCENE,this,this.scene),t.events.emit(l.REMOVED_FROM_SCENE,this,this.scene)),this},removeFromUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.remove(this),this},getDisplayList:function(){var t=null;return this.parentContainer?t=this.parentContainer.list:this.displayList&&(t=this.displayList.list),t},destroy:function(t){this.scene&&!this.ignoreDestroy&&(void 0===t&&(t=!1),this.isDestroyed=!0,this.preDestroy&&this.preDestroy.call(this),this.emit(h.DESTROY,this,t),this.removeAllListeners(),this.removeFromDisplayList(),this.removeFromUpdateList(),this.input&&(this.scene.sys.input.clear(this),this.input=void 0),this.data&&(this.data.destroy(),this.data=void 0),this.body&&(this.body.destroy(),this.body=void 0),this.filterCamera&&(this.filterCamera.destroy(),this.filterCamera=void 0),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0)}});u.RENDER_MASK=15,t.exports=u},44603(t,e,i){var r=i(83419),s=i(37277),n=i(44594),a=new r({initialize:function(t){this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.displayList,this.updateList,this.events.once(n.BOOT,this.boot,this),this.events.on(n.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(n.DESTROY,this.destroy,this)},start:function(){this.events.once(n.SHUTDOWN,this.shutdown,this)},shutdown:function(){this.events.off(n.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(n.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});a.register=function(t,e){a.prototype.hasOwnProperty(t)||(a.prototype[t]=e)},a.remove=function(t){a.prototype.hasOwnProperty(t)&&delete a.prototype[t]},s.register("GameObjectCreator",a,"make"),t.exports=a},39429(t,e,i){var r=i(83419),s=i(37277),n=i(44594),a=new r({initialize:function(t){this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.displayList,this.updateList,this.events.once(n.BOOT,this.boot,this),this.events.on(n.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(n.DESTROY,this.destroy,this)},start:function(){this.events.once(n.SHUTDOWN,this.shutdown,this)},existing:function(t){return(t.renderCanvas||t.renderWebGL)&&this.displayList.add(t),t.preUpdate&&this.updateList.add(t),t},shutdown:function(){this.events.off(n.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(n.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});a.register=function(t,e){a.prototype.hasOwnProperty(t)||(a.prototype[t]=e)},a.remove=function(t){a.prototype.hasOwnProperty(t)&&delete a.prototype[t]},s.register("GameObjectFactory",a,"add"),t.exports=a},91296(t,e,i){var r=i(61340),s=new r,n=new r,a=new r,o=new r,h={camera:s,sprite:n,calc:a,cameraExternal:o};t.exports=function(t,e,i,r){return r?o.loadIdentity():o.copyFrom(e.matrixExternal),s.copyWithScrollFactorFrom(r?e.matrix:e.matrixCombined,e.scrollX,e.scrollY,t.scrollFactorX,t.scrollFactorY),a.copyFrom(s),i&&a.multiply(i),n.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),a.multiply(n),h}},45027(t,e,i){var r=i(83419),s=i(25774),n=i(37277),a=i(44594),o=new r({Extends:s,initialize:function(t){s.call(this),this.checkQueue=!0,this.scene=t,this.systems=t.sys,t.sys.events.once(a.BOOT,this.boot,this),t.sys.events.on(a.START,this.start,this)},boot:function(){this.systems.events.once(a.DESTROY,this.destroy,this)},start:function(){var t=this.systems.events;t.on(a.PRE_UPDATE,this.update,this),t.on(a.UPDATE,this.sceneUpdate,this),t.once(a.SHUTDOWN,this.shutdown,this)},sceneUpdate:function(t,e){for(var i=this._active,r=i.length,s=0;s0){a=o.split("\n");var z=[];for(s=0;sC&&(d=C),c>E&&(c=E);var q=C+b.xAdvance,K=E+m;fF&&(F=I),IF&&(F=I),I0)for(var Q=0;Qo.length&&(x=o.length);for(var T=p,w=g,b={retroFont:!0,font:h,size:i,lineHeight:s+y,chars:{}},S=0,C=0;C?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",TEXT_SET2:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET3:"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",TEXT_SET4:"ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789",TEXT_SET5:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789",TEXT_SET6:"ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' ",TEXT_SET7:"AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39",TEXT_SET8:"0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET9:"ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?!",TEXT_SET10:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET11:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789"}},2638(t,e,i){var r=i(22186),s=i(83419),n=i(12310),a=new s({Extends:r,Mixins:[n],initialize:function(t,e,i,s,n,a,o){r.call(this,t,e,i,s,n,a,o),this.type="DynamicBitmapText",this.scrollX=0,this.scrollY=0,this.cropWidth=0,this.cropHeight=0,this.displayCallback,this.callbackData={parent:this,color:0,tint:{topLeft:0,topRight:0,bottomLeft:0,bottomRight:0},index:0,charCode:0,x:0,y:0,scale:0,rotation:0,data:0}},setSize:function(t,e){return this.cropWidth=t,this.cropHeight=e,this},setDisplayCallback:function(t){return this.displayCallback=t,this},setScrollX:function(t){return this.scrollX=t,this},setScrollY:function(t){return this.scrollY=t,this}});t.exports=a},86741(t,e,i){var r=i(20926);t.exports=function(t,e,i,s){var n=e._text,a=n.length,o=t.currentContext;if(0!==a&&r(t,o,e,i,s)){i.addToRenderList(e);var h=e.fromAtlas?e.frame:e.texture.frames.__BASE,l=e.displayCallback,u=e.callbackData,d=e.fontData.chars,c=e.fontData.lineHeight,f=e._letterSpacing,p=0,g=0,m=0,v=null,y=0,x=0,T=0,w=0,b=0,S=0,C=null,E=0,A=e.frame.source.image,_=h.cutX,M=h.cutY,R=0,P=0,O=e._fontSize/e.fontData.size,L=e._align,F=0,D=0;e.getTextBounds(!1);var I=e._bounds.lines;1===L?D=(I.longest-I.lengths[0])/2:2===L&&(D=I.longest-I.lengths[0]),o.translate(-e.displayOriginX,-e.displayOriginY);var N=i.roundPixels;e.cropWidth>0&&e.cropHeight>0&&(o.beginPath(),o.rect(0,0,e.cropWidth,e.cropHeight),o.clip());for(var B=0;B0||e.cropHeight>0;x&&((f=i.getClone()).setScissorEnable(!0),f.setScissorBox(v.tx,v.ty,e.cropWidth*v.scaleX,e.cropHeight*v.scaleY),f.use()),h.frame=e.frame;var T,w,b=s.MULTIPLY,S=a.getTintAppendFloatAlpha(e.tintTopLeft,e._alphaTL),C=a.getTintAppendFloatAlpha(e.tintTopRight,e._alphaTR),E=a.getTintAppendFloatAlpha(e.tintBottomLeft,e._alphaBL),A=a.getTintAppendFloatAlpha(e.tintBottomRight,e._alphaBR),_=0,M=0,R=0,P=0,O=e.letterSpacing,L=0,F=0,D=e.scrollX,I=e.scrollY,N=e.fontData,B=N.chars,k=N.lineHeight,U=e.fontSize/N.size,z=0,Y=e._align,X=0,W=0,G=e.getTextBounds(!1);e.maxWidth>0&&(d=(u=G.wrappedText).length);var V=e._bounds.lines;1===Y?W=(V.longest-V.lengths[0])/2:2===Y&&(W=V.longest-V.lengths[0]);for(var H=e.displayCallback,j=e.callbackData,q=0;q0&&(a=(n=L.wrappedText).length);var F=e._bounds.lines;1===R?O=(F.longest-F.lengths[0])/2:2===R&&(O=F.longest-F.lengths[0]),o.translate(-e.displayOriginX,-e.displayOriginY);for(var D=i.roundPixels,I=0;I0},getRenderList:function(){return this.dirty&&(this.renderList=this.children.list.filter(this.childCanRender,this),this.dirty=!1),this.renderList},clear:function(){this.children.removeAll(),this.dirty=!0},preDestroy:function(){this.children.destroy(),this.renderList=[]}});t.exports=d},72396(t){t.exports=function(t,e,i,r){var s=e.getRenderList();if(0!==s.length){var n=t.currentContext,a=i.alpha*e.alpha;if(0!==a){i.addToRenderList(e),n.globalCompositeOperation=t.blendModes[e.blendMode],n.imageSmoothingEnabled=!e.frame.source.scaleMode;var o=e.x-i.scrollX*e.scrollFactorX,h=e.y-i.scrollY*e.scrollFactorY;n.save(),r&&r.copyToContext(n);for(var l=i.roundPixels,u=0;u0&&p.height>0&&(n.save(),n.translate(d.x+o,d.y+h),n.scale(v,y),n.drawImage(f.source.image,p.x,p.y,p.width,p.height,g,m,p.width,p.height),n.restore())):(l&&(g=Math.round(g),m=Math.round(m)),p.width>0&&p.height>0&&n.drawImage(f.source.image,p.x,p.y,p.width,p.height,g+d.x+o,m+d.y+h,p.width,p.height)))}n.restore()}}}},9403(t,e,i){var r=i(6107),s=i(25305),n=i(44603),a=i(23568);n.register("blitter",function(t,e){void 0===t&&(t={});var i=a(t,"key",null),n=a(t,"frame",null),o=new r(this.scene,0,0,i,n);return void 0!==e&&(t.add=e),s(this.scene,o,t),o})},12709(t,e,i){var r=i(6107);i(39429).register("blitter",function(t,e,i,s){return this.displayList.add(new r(this.scene,t,e,i,s))})},48011(t,e,i){var r=i(29747),s=r,n=r;s=i(99485),n=i(72396),t.exports={renderWebGL:s,renderCanvas:n}},99485(t,e,i){var r=i(61340),s=i(70554),n=new r,a={quad:new Float32Array(8)},o={},h={};t.exports=function(t,e,i,r){var l=e.getRenderList(),u=i.camera,d=e.alpha;if(0!==l.length&&0!==d){u.addToRenderList(e);var c=n.copyWithScrollFactorFrom(u.getViewMatrix(!i.useCanvas),u.scrollX,u.scrollY,e.scrollFactorX,e.scrollFactorY);r&&c.multiply(r);for(var f=e.x,p=e.y,g=e.customRenderNodes,m=e.defaultRenderNodes,v=0;v0!=t>0,this._alpha=t}}});t.exports=n},43451(t,e,i){var r=i(87774),s=i(30529),n=i(83419),a=i(31401),o=i(95643),h=i(36683),l=new n({Extends:o,Mixins:[a.BlendMode,a.Depth,a.RenderNodes,a.Visible,h],initialize:function(t,e){o.call(this,t,"CaptureFrame");var i=t.renderer;this.drawingContext=new r(i,{width:i.width,height:i.height}),this.captureTexture=t.sys.textures.addGLTexture(e,this.drawingContext.texture),this.initRenderNodes(this._defaultRenderNodesMap)},_defaultRenderNodesMap:{get:function(){return s}},setAlpha:function(t){return this},setScrollFactor:function(t,e){return this}});t.exports=l},23675(t,e,i){var r=i(44603),s=i(23568),n=i(43451);r.register("captureFrame",function(t,e){void 0===t&&(t={});var i=s(t,"depth",0),r=s(t,"key",null),a=s(t,"visible",!0),o=new n(this.scene,r);return void 0!==e&&(t.add=e),o.setDepth(i).setVisible(a),t.add&&this.scene.sys.displayList.add(o),o})},20421(t,e,i){var r=i(43451);i(39429).register("captureFrame",function(t){return this.displayList.add(new r(this.scene,t))})},36683(t,e,i){var r=i(29747),s=r,n=r;s=i(82237),t.exports={renderWebGL:s,renderCanvas:n}},82237(t){var e=!1;t.exports=function(t,i,r){if(r.useCanvas)e||(e=!0,console.warn("CaptureFrame: Cannot capture from main canvas. Activate `forceComposite` on the camera to use this feature. This warning will now mute."));else{r.camera.addToRenderList(i);var s=r.width,n=r.height,a=i.customRenderNodes,o=i.defaultRenderNodes;i.drawingContext.resize(s,n),i.drawingContext.use(),(a.BatchHandler||o.BatchHandler).batch(i.drawingContext,r.texture,0,n,0,0,s,n,s,0,0,0,1,1,!1,4294967295,4294967295,4294967295,4294967295,{}),i.drawingContext.release()}}},16005(t,e,i){var r=i(45319),s={_alpha:1,_alphaTL:1,_alphaTR:1,_alphaBL:1,_alphaBR:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t,e,i,s){return void 0===t&&(t=1),void 0===e?this.alpha=t:(this._alphaTL=r(t,0,1),this._alphaTR=r(e,0,1),this._alphaBL=r(i,0,1),this._alphaBR=r(s,0,1)),this},alpha:{get:function(){return this._alpha},set:function(t){var e=r(t,0,1);this._alpha=e,this._alphaTL=e,this._alphaTR=e,this._alphaBL=e,this._alphaBR=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}},alphaTopLeft:{get:function(){return this._alphaTL},set:function(t){var e=r(t,0,1);this._alphaTL=e,0!==e&&(this.renderFlags|=2)}},alphaTopRight:{get:function(){return this._alphaTR},set:function(t){var e=r(t,0,1);this._alphaTR=e,0!==e&&(this.renderFlags|=2)}},alphaBottomLeft:{get:function(){return this._alphaBL},set:function(t){var e=r(t,0,1);this._alphaBL=e,0!==e&&(this.renderFlags|=2)}},alphaBottomRight:{get:function(){return this._alphaBR},set:function(t){var e=r(t,0,1);this._alphaBR=e,0!==e&&(this.renderFlags|=2)}}};t.exports=s},88509(t,e,i){var r=i(45319),s={_alpha:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t){return void 0===t&&(t=1),this.alpha=t,this},alpha:{get:function(){return this._alpha},set:function(t){var e=r(t,0,1);this._alpha=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}}};t.exports=s},90065(t,e,i){var r=i(10312),s={_blendMode:r.NORMAL,blendMode:{get:function(){return this._blendMode},set:function(t){"string"==typeof t&&(t=r[t]),(t|=0)>=-1&&(this._blendMode=t)}},setBlendMode:function(t){return this.blendMode=t,this}};t.exports=s},94215(t){t.exports={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}}},61683(t){var e={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,r){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,r,this.flipX,this.flipY);else{var s=t;this.frame.setCropUVs(this._crop,s.x,s.y,s.width,s.height,this.flipX,this.flipY)}this.isCropped=!0}return this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=e},89272(t,e,i){var r=i(37105),s={_depth:0,depth:{get:function(){return this._depth},set:function(t){this.displayList&&this.displayList.queueDepthSort(),this._depth=t}},setDepth:function(t){return void 0===t&&(t=0),this.depth=t,this},setToTop:function(){var t=this.getDisplayList();return t&&r.BringToTop(t,this),this},setToBack:function(){var t=this.getDisplayList();return t&&r.SendToBack(t,this),this},setAbove:function(t){var e=this.getDisplayList();return e&&t&&r.MoveAbove(e,this,t),this},setBelow:function(t){var e=this.getDisplayList();return e&&t&&r.MoveBelow(e,this,t),this}};t.exports=s},3248(t){var e={timeElapsed:0,timeElapsedResetPeriod:36e5,timePaused:!1,setTimerResetPeriod:function(t){return this.timeElapsedResetPeriod=t,this},setTimerPaused:function(t){return this.timePaused=!!t,this},resetTimer:function(t){return void 0===t&&(t=0),this.timeElapsed=t,this},updateTimer:function(t,e){return this.timePaused||(this.timeElapsed+=e,this.timeElapsed>=this.timeElapsedResetPeriod&&(this.timeElapsed-=this.timeElapsedResetPeriod)),this}};t.exports=e},53427(t,e,i){var r=i(83419),s=i(10189),n=i(16762),a=i(37597),o=i(88344),h=i(47564),l=i(77011),u=i(95200),d=i(16898),c=i(42652),f=i(43927),p=i(84714),g=i(51890),m=i(97797),v=i(37911),y=i(6379),x=i(29861),T=i(14366),w=i(63785),b=i(62229),S=i(99534),C=i(20263),E=i(90002),A=new r({initialize:function(t){this.camera=t,this.list=[]},clear:function(){for(var t=0;t0||this.filters.external.getActive().length>0||this.filtersForceComposite)},enableFilters:function(){if(this.filterCamera||!this.scene.renderer.gl)return this;var t=this.scene;if(r||(r=i(38058)),this.filterCamera=new r(0,0,1,1).setScene(t,!1),this.filterCamera.isObjectInversion=!0,t.game.config.roundPixels&&(this.filterCamera.roundPixels=!0),!this.maxFilterSize){var e=t.renderer.getMaxTextureSize();this.maxFilterSize=new s(e,e)}return this._filtersMatrix=new n,this._filtersViewMatrix=new n,this.getBounds&&void 0!==this.width&&void 0!==this.height&&0!==this.width&&0!==this.height||(this.filtersFocusContext=!0),this.addRenderStep(this.renderWebGLFilters,0),this},renderWebGLFilters:function(t,e,i,r,s){if(e.willRenderFilters()){var n=i.camera,a=e.filtersAutoFocus,o=e.filtersFocusContext;a&&(o?e.focusFiltersOnCamera(n):e.focusFilters());var h=e.filterCamera;h.preRender();var l=h.roundPixels;if(h.roundPixels=e.willRoundVertices(h,e.rotation%(2*Math.PI)==0&&(e.scaleX,1===e.scaleY)),a&&o){var u=e.parentContainer;if(u){var d=u.getWorldTransformMatrix();h.matrix.multiply(d)}}var c=e._filtersMatrix,f=e._filtersViewMatrix.copyWithScrollFactorFrom(n.getViewMatrix(!i.useCanvas),n.scrollX,n.scrollY,e.scrollFactorX,e.scrollFactorY);if(r&&f.multiply(r),o)c.loadIdentity();else{if("Layer"===e.type)c.loadIdentity();else{var p=e.flipX?-1:1,g=e.flipY?-1:1;c.applyITRS(e.x,e.y,e.rotation,e.scaleX*p,e.scaleY*g)}var m=h.width,v=h.height;c.translate(-m*h.originX,-v*h.originY),f.multiply(c,c)}var y=e.scrollFactorX,x=e.scrollFactorY;e.scrollFactorX=1,e.scrollFactorY=1,t.cameraRenderNode.run(i,[e],h,c,!0,s+1),e.scrollFactorX=y,e.scrollFactorY=x,h.roundPixels=l;for(var T=h.renderList.length,w=0;w0?Math.acos(e/this.scaleX):-Math.acos(e/this.scaleX):r||n?s.PI_OVER_2-(n>0?Math.acos(-r/this.scaleY):-Math.acos(r/this.scaleY)):0}},scaleX:{get:function(){return Math.sqrt(this.a*this.a+this.b*this.b)}},scaleY:{get:function(){return Math.sqrt(this.c*this.c+this.d*this.d)}},loadIdentity:function(){var t=this.matrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,this},translate:function(t,e){var i=this.matrix;return i[4]=i[0]*t+i[2]*e+i[4],i[5]=i[1]*t+i[3]*e+i[5],this},scale:function(t,e){var i=this.matrix;return i[0]*=t,i[1]*=t,i[2]*=e,i[3]*=e,this},rotate:function(t){var e=Math.sin(t),i=Math.cos(t),r=this.matrix,s=r[0],n=r[1],a=r[2],o=r[3];return r[0]=s*i+a*e,r[1]=n*i+o*e,r[2]=s*-e+a*i,r[3]=n*-e+o*i,this},multiply:function(t,e){var i=this.matrix,r=t.matrix,s=i[0],n=i[1],a=i[2],o=i[3],h=i[4],l=i[5],u=r[0],d=r[1],c=r[2],f=r[3],p=r[4],g=r[5],m=void 0===e?i:e.matrix;return m[0]=u*s+d*a,m[1]=u*n+d*o,m[2]=c*s+f*a,m[3]=c*n+f*o,m[4]=p*s+g*a+h,m[5]=p*n+g*o+l,m},multiplyWithOffset:function(t,e,i){var r=this.matrix,s=t.matrix,n=r[0],a=r[1],o=r[2],h=r[3],l=e*n+i*o+r[4],u=e*a+i*h+r[5],d=s[0],c=s[1],f=s[2],p=s[3],g=s[4],m=s[5];return r[0]=d*n+c*o,r[1]=d*a+c*h,r[2]=f*n+p*o,r[3]=f*a+p*h,r[4]=g*n+m*o+l,r[5]=g*a+m*h+u,this},transform:function(t,e,i,r,s,n){var a=this.matrix,o=a[0],h=a[1],l=a[2],u=a[3],d=a[4],c=a[5];return a[0]=t*o+e*l,a[1]=t*h+e*u,a[2]=i*o+r*l,a[3]=i*h+r*u,a[4]=s*o+n*l+d,a[5]=s*h+n*u+c,this},transformPoint:function(t,e,i){void 0===i&&(i={x:0,y:0});var r=this.matrix,s=r[0],n=r[1],a=r[2],o=r[3],h=r[4],l=r[5];return i.x=t*s+e*a+h,i.y=t*n+e*o+l,i},invert:function(){var t=this.matrix,e=t[0],i=t[1],r=t[2],s=t[3],n=t[4],a=t[5],o=e*s-i*r;return t[0]=s/o,t[1]=-i/o,t[2]=-r/o,t[3]=e/o,t[4]=(r*a-s*n)/o,t[5]=-(e*a-i*n)/o,this},copyFrom:function(t){var e=this.matrix;return e[0]=t.a,e[1]=t.b,e[2]=t.c,e[3]=t.d,e[4]=t.e,e[5]=t.f,this},copyFromArray:function(t){var e=this.matrix;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],this},copyWithScrollFactorFrom:function(t,e,i,r,s){var n=this.matrix;n[0]=t.a,n[1]=t.b,n[2]=t.c,n[3]=t.d;var a=e*(1-r),o=i*(1-s);return n[4]=t.a*a+t.c*o+t.e,n[5]=t.b*a+t.d*o+t.f,this},copyToContext:function(t){var e=this.matrix;return t.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t},setToContext:function(t){return t.setTransform(this.a,this.b,this.c,this.d,this.e,this.f),t},copyToArray:function(t){var e=this.matrix;return void 0===t?t=[e[0],e[1],e[2],e[3],e[4],e[5]]:(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5]),t},setTransform:function(t,e,i,r,s,n){var a=this.matrix;return a[0]=t,a[1]=e,a[2]=i,a[3]=r,a[4]=s,a[5]=n,this},decomposeMatrix:function(){var t=this.decomposedMatrix,e=this.matrix,i=e[0],r=e[1],s=e[2],n=e[3],a=i*n-r*s;if(t.translateX=e[4],t.translateY=e[5],i||r){var o=Math.sqrt(i*i+r*r);t.rotation=r>0?Math.acos(i/o):-Math.acos(i/o),t.scaleX=o,t.scaleY=a/o}else if(s||n){var h=Math.sqrt(s*s+n*n);t.rotation=.5*Math.PI-(n>0?Math.acos(-s/h):-Math.acos(s/h)),t.scaleX=a/h,t.scaleY=h}else t.rotation=0,t.scaleX=0,t.scaleY=0;return t},applyITRS:function(t,e,i,r,s){var n=this.matrix,a=Math.sin(i),o=Math.cos(i);return n[4]=t,n[5]=e,n[0]=o*r,n[1]=a*r,n[2]=-a*s,n[3]=o*s,this},applyInverse:function(t,e,i){void 0===i&&(i=new n);var r=this.matrix,s=r[0],a=r[1],o=r[2],h=r[3],l=r[4],u=r[5],d=1/(s*h+o*-a);return i.x=h*d*t+-o*d*e+(u*o-l*h)*d,i.y=s*d*e+-a*d*t+(-u*s+l*a)*d,i},setQuad:function(t,e,i,r,s){void 0===s&&(s=this.quad);var n=this.matrix,a=n[0],o=n[1],h=n[2],l=n[3],u=n[4],d=n[5];return s[0]=t*a+e*h+u,s[1]=t*o+e*l+d,s[2]=t*a+r*h+u,s[3]=t*o+r*l+d,s[4]=i*a+r*h+u,s[5]=i*o+r*l+d,s[6]=i*a+e*h+u,s[7]=i*o+e*l+d,s},getX:function(t,e){return t*this.a+e*this.c+this.e},getY:function(t,e){return t*this.b+e*this.d+this.f},getXRound:function(t,e,i){var r=this.getX(t,e);return i&&(r=Math.floor(r+.5)),r},getYRound:function(t,e,i){var r=this.getY(t,e);return i&&(r=Math.floor(r+.5)),r},getCSSMatrix:function(){var t=this.matrix;return"matrix("+t[0]+","+t[1]+","+t[2]+","+t[3]+","+t[4]+","+t[5]+")"},destroy:function(){this.matrix=null,this.quad=null,this.decomposedMatrix=null}});t.exports=a},59715(t){var e={_visible:!0,visible:{get:function(){return this._visible},set:function(t){t?(this._visible=!0,this.renderFlags|=1):(this._visible=!1,this.renderFlags&=-2)}},setVisible:function(t){return this.visible=t,this}};t.exports=e},31401(t,e,i){t.exports={Alpha:i(16005),AlphaSingle:i(88509),BlendMode:i(90065),ComputedSize:i(94215),Crop:i(61683),Depth:i(89272),ElapseTimer:i(3248),FilterList:i(53427),Filters:i(43102),Flip:i(54434),GetBounds:i(8004),Lighting:i(73629),Mask:i(8573),Origin:i(27387),PathFollower:i(37640),RenderNodes:i(68680),RenderSteps:i(86038),ScrollFactor:i(80227),Size:i(16736),Texture:i(37726),TextureCrop:i(79812),Tint:i(27472),ToJSON:i(53774),Transform:i(16901),TransformMatrix:i(61340),Visible:i(59715)}},31559(t,e,i){var r=i(37105),s=i(10312),n=i(83419),a=i(31401),o=i(51708),h=i(95643),l=i(87841),u=i(29959),d=i(36899),c=i(26099),f=i(93595),p=new a.TransformMatrix,g=new n({Extends:h,Mixins:[a.AlphaSingle,a.BlendMode,a.ComputedSize,a.Depth,a.Mask,a.Transform,a.Visible,u],initialize:function(t,e,i,r){h.call(this,t,"Container"),this.list=[],this.exclusive=!0,this.maxSize=-1,this.position=0,this.localTransform=new a.TransformMatrix,this._sortKey="",this._sysEvents=t.sys.events,this.scrollFactorX=1,this.scrollFactorY=1,this.setPosition(e,i),this.setBlendMode(s.SKIP_CHECK),r&&this.add(r)},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return.5*this.width}},displayOriginY:{get:function(){return.5*this.height}},setExclusive:function(t){return void 0===t&&(t=!0),this.exclusive=t,this},getBounds:function(t){if(void 0===t&&(t=new l),t.setTo(this.x,this.y,0,0),this.parentContainer){var e=this.parentContainer.getBoundsTransformMatrix().transformPoint(this.x,this.y);t.setTo(e.x,e.y,0,0)}if(this.list.length>0){var i=this.list,r=new l,s=!1;t.setEmpty();for(var n=0;n-1},setAll:function(t,e,i,s){return r.SetAll(this.list,t,e,i,s),this},each:function(t,e){var i,r=[null],s=this.list.slice(),n=s.length;for(i=2;i0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.list=[]},onChildDestroyed:function(t){r.Remove(this.list,t),this.exclusive&&(t.parentContainer=null,t.removedFromScene())}});t.exports=g},53584(t){t.exports=function(t,e,i,r){i.addToRenderList(e);var s=e.list;if(0!==s.length){var n=e.localTransform;r?(n.loadIdentity(),n.multiply(r),n.translate(e.x,e.y),n.rotate(e.rotation),n.scale(e.scaleX,e.scaleY)):n.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var a=-1!==e.blendMode;a||t.setBlendMode(0);var o=e._alpha,h=e.scrollFactorX,l=e.scrollFactorY;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var u=0;u=0,d=a>=0,f=o>=0,p=h>=0;return n=Math.abs(n),a=Math.abs(a),o=Math.abs(o),h=Math.abs(h),this.beginPath(),this.moveTo(t+n,e),this.lineTo(t+i-a,e),d?this.arc(t+i-a,e+a,a,-c.PI_OVER_2,0):this.arc(t+i,e,a,Math.PI,c.PI_OVER_2,!0),this.lineTo(t+i,e+r-h),p?this.arc(t+i-h,e+r-h,h,0,c.PI_OVER_2):this.arc(t+i,e+r,h,-c.PI_OVER_2,Math.PI,!0),this.lineTo(t+o,e+r),f?this.arc(t+o,e+r-o,o,c.PI_OVER_2,Math.PI):this.arc(t,e+r,o,0,-c.PI_OVER_2,!0),this.lineTo(t,e+n),l?this.arc(t+n,e+n,n,-Math.PI,-c.PI_OVER_2):this.arc(t,e,n,c.PI_OVER_2,0,!0),this.fillPath(),this},strokeRoundedRect:function(t,e,i,r,s){void 0===s&&(s=20);var n=s,a=s,o=s,h=s,l=Math.min(i,r)/2;"number"!=typeof s&&(n=u(s,"tl",20),a=u(s,"tr",20),o=u(s,"bl",20),h=u(s,"br",20));var d=n>=0,f=a>=0,p=o>=0,g=h>=0;return n=Math.min(Math.abs(n),l),a=Math.min(Math.abs(a),l),o=Math.min(Math.abs(o),l),h=Math.min(Math.abs(h),l),this.beginPath(),this.moveTo(t+n,e),this.lineTo(t+i-a,e),this.moveTo(t+i-a,e),f?this.arc(t+i-a,e+a,a,-c.PI_OVER_2,0):this.arc(t+i,e,a,Math.PI,c.PI_OVER_2,!0),this.lineTo(t+i,e+r-h),this.moveTo(t+i,e+r-h),g?this.arc(t+i-h,e+r-h,h,0,c.PI_OVER_2):this.arc(t+i,e+r,h,-c.PI_OVER_2,Math.PI,!0),this.lineTo(t+o,e+r),this.moveTo(t+o,e+r),p?this.arc(t+o,e+r-o,o,c.PI_OVER_2,Math.PI):this.arc(t,e+r,o,0,-c.PI_OVER_2,!0),this.lineTo(t,e+n),this.moveTo(t,e+n),d?this.arc(t+n,e+n,n,-Math.PI,-c.PI_OVER_2):this.arc(t,e,n,c.PI_OVER_2,0,!0),this.strokePath(),this},fillPointShape:function(t,e){return this.fillPoint(t.x,t.y,e)},fillPoint:function(t,e,i){return!i||i<1?i=1:(t-=i/2,e-=i/2),this.commandBuffer.push(n.FILL_RECT,t,e,i,i),this},fillTriangleShape:function(t){return this.fillTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},strokeTriangleShape:function(t){return this.strokeTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},fillTriangle:function(t,e,i,r,s,a){return this.commandBuffer.push(n.FILL_TRIANGLE,t,e,i,r,s,a),this},strokeTriangle:function(t,e,i,r,s,a){return this.commandBuffer.push(n.STROKE_TRIANGLE,t,e,i,r,s,a),this},strokeLineShape:function(t){return this.lineBetween(t.x1,t.y1,t.x2,t.y2)},lineBetween:function(t,e,i,r){return this.beginPath(),this.moveTo(t,e),this.lineTo(i,r),this.strokePath(),this},lineTo:function(t,e){return this.commandBuffer.push(n.LINE_TO,t,e),this},moveTo:function(t,e){return this.commandBuffer.push(n.MOVE_TO,t,e),this},strokePoints:function(t,e,i,r){void 0===e&&(e=!1),void 0===i&&(i=!1),void 0===r&&(r=t.length),this.beginPath(),this.moveTo(t[0].x,t[0].y);for(var s=1;s-1&&this.fillStyle(this.defaultFillColor,this.defaultFillAlpha),this.defaultStrokeColor>-1&&this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha),this},generateTexture:function(t,e,i){var r,s,n=this.scene.sys,a=n.game.renderer;void 0===e&&(e=n.scale.width),void 0===i&&(i=n.scale.height),p.TargetCamera.setScene(this.scene),p.TargetCamera.setViewport(0,0,e,i),p.TargetCamera.scrollX=this.x,p.TargetCamera.scrollY=this.y;var o={willReadFrequently:!0};if("string"==typeof t)if(n.textures.exists(t)){var h=(r=n.textures.get(t)).getSourceImage();h instanceof HTMLCanvasElement&&(s=h.getContext("2d",o))}else s=(r=n.textures.createCanvas(t,e,i)).getSourceImage().getContext("2d",o);else t instanceof HTMLCanvasElement&&(s=t.getContext("2d",o));return s&&(this.renderCanvas(a,this,p.TargetCamera,null,s,!1),r&&r.refresh()),this},preDestroy:function(){this.commandBuffer=[]}});p.TargetCamera=new r,t.exports=p},32768(t,e,i){var r=i(85592),s=i(20926);t.exports=function(t,e,i,n,a,o){var h=e.commandBuffer,l=h.length,u=a||t.currentContext;if(0!==l&&s(t,u,e,i,n)){i.addToRenderList(e);var d=1,c=1,f=0,p=0,g=1,m=0,v=0,y=0;u.beginPath();for(var x=0;x>>16,v=(65280&f)>>>8,y=255&f,u.strokeStyle="rgba("+m+","+v+","+y+","+d+")",u.lineWidth=g,x+=3;break;case r.FILL_STYLE:p=h[x+1],c=h[x+2],m=(16711680&p)>>>16,v=(65280&p)>>>8,y=255&p,u.fillStyle="rgba("+m+","+v+","+y+","+c+")",x+=2;break;case r.BEGIN_PATH:u.beginPath();break;case r.CLOSE_PATH:u.closePath();break;case r.FILL_PATH:o||u.fill();break;case r.STROKE_PATH:o||u.stroke();break;case r.FILL_RECT:o?u.rect(h[x+1],h[x+2],h[x+3],h[x+4]):u.fillRect(h[x+1],h[x+2],h[x+3],h[x+4]),x+=4;break;case r.FILL_TRIANGLE:u.beginPath(),u.moveTo(h[x+1],h[x+2]),u.lineTo(h[x+3],h[x+4]),u.lineTo(h[x+5],h[x+6]),u.closePath(),o||u.fill(),x+=6;break;case r.STROKE_TRIANGLE:u.beginPath(),u.moveTo(h[x+1],h[x+2]),u.lineTo(h[x+3],h[x+4]),u.lineTo(h[x+5],h[x+6]),u.closePath(),o||u.stroke(),x+=6;break;case r.LINE_TO:u.lineTo(h[x+1],h[x+2]),x+=2;break;case r.MOVE_TO:u.moveTo(h[x+1],h[x+2]),x+=2;break;case r.LINE_FX_TO:u.lineTo(h[x+1],h[x+2]),x+=5;break;case r.MOVE_FX_TO:u.moveTo(h[x+1],h[x+2]),x+=5;break;case r.SAVE:u.save();break;case r.RESTORE:u.restore();break;case r.TRANSLATE:u.translate(h[x+1],h[x+2]),x+=2;break;case r.SCALE:u.scale(h[x+1],h[x+2]),x+=2;break;case r.ROTATE:u.rotate(h[x+1]),x+=1;break;case r.GRADIENT_FILL_STYLE:x+=5;break;case r.GRADIENT_LINE_STYLE:x+=6}}u.restore()}}},87079(t,e,i){var r=i(44603),s=i(43831);r.register("graphics",function(t,e){void 0===t&&(t={}),void 0!==e&&(t.add=e);var i=new s(this.scene,t);return t.add&&this.scene.sys.displayList.add(i),i})},1201(t,e,i){var r=i(43831);i(39429).register("graphics",function(t){return this.displayList.add(new r(this.scene,t))})},84503(t,e,i){var r=i(29747),s=r,n=r;s=i(77545),n=i(32768),n=i(32768),t.exports={renderWebGL:s,renderCanvas:n}},77545(t,e,i){var r=i(85592),s=i(91296),n=i(70554),a=i(61340),o=function(t,e,i){this.x=t,this.y=e,this.width=i},h=function(t,e,i){this.points=[],this.points[0]=new o(t,e,i),this.addPoint=function(t,e,i){var r=this.points[this.points.length-1];r.x===t&&r.y===e||this.points.push(new o(t,e,i))}},l=[],u=new a,d=new a,c={TL:0,TR:0,BL:0,BR:0},f={TL:0,TR:0,BL:0,BR:0},p=[{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0}];t.exports=function(t,e,i,a){if(0!==e.commandBuffer.length){var o=e.customRenderNodes,g=e.defaultRenderNodes,m=o.Submitter||g.Submitter,v=e.lighting,y=i,x=y.camera;x.addToRenderList(e);for(var T=s(e,x,a,!i.useCanvas).calc,w=u.loadIdentity(),b=e.commandBuffer,S=e.alpha,C=Math.max(e.pathDetailThreshold,t.config.pathDetailThreshold,0),E=1,A=0,_=0,M=0,R=2*Math.PI,P=[],O=0,L=!0,F=null,D=n.getTintAppendFloatAlpha,I=0;I0&&(q=q%R-R):q>R?q=R:q<0&&(q=R+q%R),null===F&&(F=new h(G+Math.cos(j)*H,V+Math.sin(j)*H,E),P.push(F),W+=.01);W<1+Z;)M=q*W+j,A=G+Math.cos(M)*H,_=V+Math.sin(M)*H,F.addPoint(A,_,E),W+=.01;M=q+j,A=G+Math.cos(M)*H,_=V+Math.sin(M)*H,F.addPoint(A,_,E);break;case r.FILL_RECT:T.multiply(w,d),(o.FillRect||g.FillRect).run(y,d,m,b[++I],b[++I],b[++I],b[++I],c.TL,c.TR,c.BL,c.BR,v);break;case r.FILL_TRIANGLE:T.multiply(w,d),(o.FillTri||g.FillTri).run(y,d,m,b[++I],b[++I],b[++I],b[++I],b[++I],b[++I],c.TL,c.TR,c.BL,v);break;case r.STROKE_TRIANGLE:T.multiply(w,d),p[0].x=b[++I],p[0].y=b[++I],p[0].width=E,p[1].x=b[++I],p[1].y=b[++I],p[1].width=E,p[2].x=b[++I],p[2].y=b[++I],p[2].width=E,p[3].x=p[0].x,p[3].y=p[0].y,p[3].width=E,(o.StrokePath||g.StrokePath).run(y,m,p,E,!1,d,f.TL,f.TR,f.BL,f.BR,v);break;case r.LINE_TO:G=b[++I],V=b[++I],null!==F?F.addPoint(G,V,E):(F=new h(G,V,E),P.push(F));break;case r.MOVE_TO:F=new h(b[++I],b[++I],E),P.push(F);break;case r.SAVE:l.push(w.copyToArray());break;case r.RESTORE:w.copyFromArray(l.pop());break;case r.TRANSLATE:G=b[++I],V=b[++I],w.translate(G,V);break;case r.SCALE:G=b[++I],V=b[++I],w.scale(G,V);break;case r.ROTATE:w.rotate(b[++I])}}}},26479(t,e,i){var r=i(61061),s=i(83419),n=i(51708),a=i(50792),o=i(46710),h=i(95540),l=i(35154),u=i(97022),d=i(41212),c=i(88492),f=i(68287),p=new s({Extends:a,initialize:function(t,e,i){a.call(this),i?e&&!Array.isArray(e)&&(e=[e]):Array.isArray(e)?d(e[0])&&(i=e,e=null):d(e)&&(i=e,e=null),this.scene=t,this.children=new Set,this.isParent=!0,this.type="Group",this.classType=h(i,"classType",f),this.name=h(i,"name",""),this.active=h(i,"active",!0),this.maxSize=h(i,"maxSize",-1),this.defaultKey=h(i,"defaultKey",null),this.defaultFrame=h(i,"defaultFrame",null),this.runChildUpdate=h(i,"runChildUpdate",!1),this.createCallback=h(i,"createCallback",null),this.removeCallback=h(i,"removeCallback",null),this.createMultipleCallback=h(i,"createMultipleCallback",null),this.internalCreateCallback=h(i,"internalCreateCallback",null),this.internalRemoveCallback=h(i,"internalRemoveCallback",null),e&&this.addMultiple(e),i&&this.createMultiple(i),this.on(n.ADDED_TO_SCENE,this.addedToScene,this),this.on(n.REMOVED_FROM_SCENE,this.removedFromScene,this)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},create:function(t,e,i,r,s,n){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.defaultKey),void 0===r&&(r=this.defaultFrame),void 0===s&&(s=!0),void 0===n&&(n=!0),this.isFull())return null;var a=new this.classType(this.scene,t,e,i,r);return a.addToDisplayList(this.scene.sys.displayList),a.addToUpdateList(),a.visible=s,a.setActive(n),this.add(a),a},createMultiple:function(t){if(this.isFull())return[];Array.isArray(t)||(t=[t]);var e=[];if(t[0].key)for(var i=0;i=0;u--)if((l=c[u]).active===i){if(++d===e)break}else l=null;return l?("number"==typeof s&&(l.x=s),"number"==typeof n&&(l.y=n),l):r?this.create(s,n,a,o,h):null},get:function(t,e,i,r,s){return this.getFirst(!1,!0,t,e,i,r,s)},getFirstAlive:function(t,e,i,r,s,n){return this.getFirst(!0,t,e,i,r,s,n)},getFirstDead:function(t,e,i,r,s,n){return this.getFirst(!1,t,e,i,r,s,n)},playAnimation:function(t,e){return r.PlayAnimation(Array.from(this.children),t,e),this},isFull:function(){return-1!==this.maxSize&&this.children.size>=this.maxSize},countActive:function(t){void 0===t&&(t=!0);var e=0;return this.children.forEach(function(i){i.active===t&&e++}),e},getTotalUsed:function(){return this.countActive()},getTotalFree:function(){var t=this.getTotalUsed();return(-1===this.maxSize?999999999999:this.maxSize)-t},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},propertyValueSet:function(t,e,i,s,n){return r.PropertyValueSet(Array.from(this.children),t,e,i,s,n),this},propertyValueInc:function(t,e,i,s,n){return r.PropertyValueInc(Array.from(this.children),t,e,i,s,n),this},setX:function(t,e){return r.SetX(Array.from(this.children),t,e),this},setY:function(t,e){return r.SetY(Array.from(this.children),t,e),this},setXY:function(t,e,i,s){return r.SetXY(Array.from(this.children),t,e,i,s),this},incX:function(t,e){return r.IncX(Array.from(this.children),t,e),this},incY:function(t,e){return r.IncY(Array.from(this.children),t,e),this},incXY:function(t,e,i,s){return r.IncXY(Array.from(this.children),t,e,i,s),this},shiftPosition:function(t,e,i){return r.ShiftPosition(Array.from(this.children),t,e,i),this},angle:function(t,e){return r.Angle(Array.from(this.children),t,e),this},rotate:function(t,e){return r.Rotate(Array.from(this.children),t,e),this},rotateAround:function(t,e){return r.RotateAround(Array.from(this.children),t,e),this},rotateAroundDistance:function(t,e,i){return r.RotateAroundDistance(Array.from(this.children),t,e,i),this},setAlpha:function(t,e){return r.SetAlpha(Array.from(this.children),t,e),this},setTint:function(t,e,i,s){return r.SetTint(Array.from(this.children),t,e,i,s),this},setOrigin:function(t,e,i,s){return r.SetOrigin(Array.from(this.children),t,e,i,s),this},scaleX:function(t,e){return r.ScaleX(Array.from(this.children),t,e),this},scaleY:function(t,e){return r.ScaleY(Array.from(this.children),t,e),this},scaleXY:function(t,e,i,s){return r.ScaleXY(Array.from(this.children),t,e,i,s),this},setDepth:function(t,e){return r.SetDepth(Array.from(this.children),t,e),this},setBlendMode:function(t){return r.SetBlendMode(Array.from(this.children),t),this},setHitArea:function(t,e){return r.SetHitArea(Array.from(this.children),t,e),this},shuffle:function(){return r.Shuffle(Array.from(this.children)),this},kill:function(t){this.children.has(t)&&t.setActive(!1)},killAndHide:function(t){this.children.has(t)&&(t.setActive(!1),t.setVisible(!1))},setVisible:function(t,e,i){return r.SetVisible(Array.from(this.children),t,e,i),this},toggleVisible:function(){return r.ToggleVisible(Array.from(this.children)),this},destroy:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1),this.scene&&!this.ignoreDestroy&&(this.emit(n.DESTROY,this),this.removeAllListeners(),this.scene.sys.updateList.remove(this),this.clear(e,t),this.scene=void 0,this.children=void 0)}});t.exports=p},94975(t,e,i){var r=i(44603),s=i(26479);r.register("group",function(t){return new s(this.scene,null,t)})},3385(t,e,i){var r=i(26479);i(39429).register("group",function(t,e){return this.updateList.add(new r(this.scene,t,e))})},88571(t,e,i){var r=i(40939),s=i(83419),n=i(31401),a=i(95643),o=i(59819),h=new s({Extends:a,Mixins:[n.Alpha,n.BlendMode,n.Depth,n.Flip,n.GetBounds,n.Lighting,n.Mask,n.Origin,n.RenderNodes,n.ScrollFactor,n.Size,n.TextureCrop,n.Tint,n.Transform,n.Visible,o],initialize:function(t,e,i,r,s){a.call(this,t,"Image"),this._crop=this.resetCropObject(),this.setTexture(r,s),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initRenderNodes(this._defaultRenderNodesMap)},_defaultRenderNodesMap:{get:function(){return r}}});t.exports=h},40652(t){t.exports=function(t,e,i,r){i.addToRenderList(e),t.batchSprite(e,e.frame,i,r)}},82459(t,e,i){var r=i(25305),s=i(44603),n=i(23568),a=i(88571);s.register("image",function(t,e){void 0===t&&(t={});var i=n(t,"key",null),s=n(t,"frame",null),o=new a(this.scene,0,0,i,s);return void 0!==e&&(t.add=e),r(this.scene,o,t),o})},2117(t,e,i){var r=i(88571);i(39429).register("image",function(t,e,i,s){return this.displayList.add(new r(this.scene,t,e,i,s))})},59819(t,e,i){var r=i(29747),s=r,n=r;s=i(99517),n=i(40652),t.exports={renderWebGL:s,renderCanvas:n}},99517(t){t.exports=function(t,e,i,r){i.camera.addToRenderList(e);var s=e.customRenderNodes,n=e.defaultRenderNodes;(s.Submitter||n.Submitter).run(i,e,r,0,s.Texturer||n.Texturer,s.Transformer||n.Transformer)}},77856(t,e,i){var r={Events:i(51708),DisplayList:i(8050),GameObjectCreator:i(44603),GameObjectFactory:i(39429),UpdateList:i(45027),Components:i(31401),GetCalcMatrix:i(91296),BuildGameObject:i(25305),BuildGameObjectAnimation:i(13059),GameObject:i(95643),BitmapText:i(22186),Blitter:i(6107),Bob:i(46590),Container:i(31559),DOMElement:i(3069),DynamicBitmapText:i(2638),Extern:i(42421),Graphics:i(43831),Group:i(26479),Image:i(88571),Layer:i(93595),Particles:i(18404),PathFollower:i(1159),RenderTexture:i(591),RetroFont:i(196),Rope:i(77757),Sprite:i(68287),Stamp:i(14727),Text:i(50171),GetTextSize:i(14220),MeasureText:i(79557),TextStyle:i(35762),TileSprite:i(20839),Zone:i(41481),Video:i(18471),Shape:i(17803),Arc:i(23629),Curve:i(89),Ellipse:i(19921),Grid:i(30479),IsoBox:i(61475),IsoTriangle:i(16933),Line:i(57847),Polygon:i(24949),Rectangle:i(74561),Star:i(55911),Triangle:i(36931),Factories:{Blitter:i(12709),Container:i(24961),DOMElement:i(2611),DynamicBitmapText:i(72566),Extern:i(56315),Graphics:i(1201),Group:i(3385),Image:i(2117),Layer:i(20005),Particles:i(676),PathFollower:i(90145),RenderTexture:i(60505),Rope:i(96819),Sprite:i(46409),Stamp:i(85326),StaticBitmapText:i(34914),Text:i(68005),TileSprite:i(91681),Zone:i(84175),Video:i(89025),Arc:i(42563),Curve:i(40511),Ellipse:i(1543),Grid:i(34137),IsoBox:i(3933),IsoTriangle:i(49803),Line:i(2481),Polygon:i(64827),Rectangle:i(87959),Star:i(93697),Triangle:i(45245)},Creators:{Blitter:i(9403),Container:i(77143),DynamicBitmapText:i(11164),Graphics:i(87079),Group:i(94975),Image:i(82459),Layer:i(25179),Particles:i(92730),RenderTexture:i(34495),Rope:i(26209),Sprite:i(15567),Stamp:i(31479),StaticBitmapText:i(57336),Text:i(71259),TileSprite:i(14167),Zone:i(95261),Video:i(11511)}};r.CaptureFrame=i(43451),r.Gradient=i(34637),r.Noise=i(35387),r.NoiseCell2D=i(51513),r.NoiseCell3D=i(15686),r.NoiseCell4D=i(41946),r.NoiseSimplex2D=i(1792),r.NoiseSimplex3D=i(51098),r.Shader=i(20071),r.NineSlice=i(28103),r.PointLight=i(80321),r.SpriteGPULayer=i(76573),r.Factories.CaptureFrame=i(20421),r.Factories.Gradient=i(69315),r.Factories.Noise=i(34757),r.Factories.NoiseCell2D=i(26590),r.Factories.NoiseCell3D=i(89918),r.Factories.NoiseCell4D=i(65874),r.Factories.NoiseSimplex2D=i(80308),r.Factories.NoiseSimplex3D=i(73810),r.Factories.Shader=i(74177),r.Factories.NineSlice=i(47521),r.Factories.PointLight=i(71255),r.Factories.SpriteGPULayer=i(96019),r.Creators.CaptureFrame=i(23675),r.Creators.Gradient=i(26353),r.Creators.Noise=i(39931),r.Creators.NoiseCell2D=i(98292),r.Creators.NoiseCell3D=i(97044),r.Creators.NoiseCell4D=i(20136),r.Creators.NoiseSimplex2D=i(51754),r.Creators.NoiseSimplex3D=i(71112),r.Creators.Shader=i(54935),r.Creators.NineSlice=i(28279),r.Creators.PointLight=i(39829),r.Creators.SpriteGPULayer=i(16193),r.Light=i(41432),r.LightsManager=i(61356),r.LightsPlugin=i(88992),t.exports=r},93595(t,e,i){var r=i(10312),s=i(83419),n=i(31401),a=i(50792),o=i(95643),h=i(51708),l=i(73162),u=i(33963),d=i(44594),c=i(19186),f=new s({Extends:l,Mixins:[a,o,n.AlphaSingle,n.BlendMode,n.Depth,n.Mask,n.Visible,u],initialize:function(t,e){l.call(this,t),a.call(this),o.call(this,t,"Layer"),this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.sortChildrenFlag=!1,this.addCallback=this.addChildCallback,this.removeCallback=this.removeChildCallback,this.clearAlpha(),this.setBlendMode(r.SKIP_CHECK),e&&this.add(e),this.addRenderStep&&this.addRenderStep(this.renderWebGL),t.sys.queueDepthSort()},setInteractive:function(){return this},disableInteractive:function(){return this},removeInteractive:function(){return this},willRender:function(t){return!(15!==this.renderFlags||0===this.list.length||0!==this.cameraFilter&&this.cameraFilter&t.id)},addChildCallback:function(t){var e=t.displayList;e&&e!==this&&t.removeFromDisplayList(),t.displayList||(this.queueDepthSort(),t.displayList=this,t.emit(h.ADDED_TO_SCENE,t,this.scene),this.events.emit(d.ADDED_TO_SCENE,t,this.scene))},removeChildCallback:function(t){this.queueDepthSort(),t.displayList=null,t.emit(h.REMOVED_FROM_SCENE,t,this.scene),this.events.emit(d.REMOVED_FROM_SCENE,t,this.scene)},queueDepthSort:function(){this.sortChildrenFlag=!0},depthSort:function(){this.sortChildrenFlag&&(c(this.list,this.sortByDepth),this.sortChildrenFlag=!1)},sortByDepth:function(t,e){return t._depth-e._depth},getChildren:function(){return this.list},destroy:function(t){if(this.scene&&!this.ignoreDestroy){o.prototype.destroy.call(this,t);for(var e=this.list;e.length;)e[0].destroy(t);this.list=void 0,this.systems=void 0,this.events=void 0}}});t.exports=f},2956(t){t.exports=function(t,e,i){var r=e.list;if(0!==r.length){e.depthSort();var s=-1!==e.blendMode;s||t.setBlendMode(0);var n=e._alpha;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var a=0;athis.maxLights&&(u(s,this.sortByDistance),s=s.slice(0,this.maxLights)),this.visibleLights=s.length,s},sortByDistance:function(t,e){return t.distance>=e.distance},setAmbientColor:function(t){var e=d.getFloatsFromUintRGB(t);return this.ambientColor.set(e[0],e[1],e[2]),this},getMaxVisibleLights:function(){return this.maxLights},getLightCount:function(){return this.lights.length},addLight:function(t,e,i,r,s,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=128),void 0===r&&(r=16777215),void 0===s&&(s=1),void 0===n&&(n=.1*i);var o=d.getFloatsFromUintRGB(r),h=new a(t,e,i,o[0],o[1],o[2],s,n);return this.lights.push(h),h},removeLight:function(t){var e=this.lights.indexOf(t);return e>=0&&l(this.lights,e),this},shutdown:function(){this.lights.length=0},destroy:function(){this.shutdown()}});t.exports=c},88992(t,e,i){var r=i(83419),s=i(61356),n=i(37277),a=i(44594),o=new r({Extends:s,initialize:function(t){this.scene=t,this.systems=t.sys,t.sys.settings.isBooted||t.sys.events.once(a.BOOT,this.boot,this),s.call(this)},boot:function(){var t=this.systems.events;t.on(a.SHUTDOWN,this.shutdown,this),t.on(a.DESTROY,this.destroy,this)},destroy:function(){this.shutdown(),this.scene=void 0,this.systems=void 0}});n.register("LightsPlugin",o,"lights"),t.exports=o},28103(t,e,i){var r=i(30529),s=i(83419),n=i(31401),a=i(95643),o=i(78023),h=i(84322),l=i(82513),u=new s({Extends:a,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.GetBounds,n.Mask,n.Origin,n.RenderNodes,n.ScrollFactor,n.Texture,n.Transform,n.Visible,o],initialize:function(t,e,i,r,s,n,o,u,d,c,f,p,g){a.call(this,t,"NineSlice"),this._width,this._height,this._originX=.5,this._originY=.5,this._sizeComponent=!0,this.vertices=[],this.leftWidth,this.rightWidth,this.topHeight,this.bottomHeight,this.tileX=p||!1,this.tileY=g||!1,this._repeatCountX=1,this._repeatCountY=1,this.tint=16777215,this.tintMode=h.MULTIPLY;var m=t.textures.getFrame(r,s);this.is3Slice=!c&&!f,m&&m.scale9&&(this.is3Slice=m.is3Slice);for(var v=this.is3Slice?18:54,y=0;y0?Math.max(1,Math.floor(t/e)):1},_rebuildVertexArray:function(t,e){if(t===this._repeatCountX&&e===this._repeatCountY)return!1;this._repeatCountX=t,this._repeatCountY=e;var i=(t+2)*(this.is3Slice?1:e+2)*6,r=this.vertices;if(r.length!==i){r.length=0;for(var s=0;s.5&&(this.vx-=i*(s-.5)),n<.5?this.vy+=r*(.5-n):n>.5&&(this.vy-=r*(n-.5)),this}});t.exports=n},52230(t,e,i){var r=i(91296),s=i(70554),n={multiTexturing:!0};t.exports=function(t,e,i,a){var o=e.vertices,h=o.length;if(0!==h){var l=i.camera;l.addToRenderList(e);for(var u,d,c,f=e.alpha,p=e.customRenderNodes.BatchHandler||e.defaultRenderNodes.BatchHandler,g=r(e,l,a,!i.useCanvas).calc,m=s.getTintAppendFloatAlpha(e.tint,f),v=e.frame.source.glTexture,y=e.tintMode,x=0;x=0&&(e=t);break;case 4:var i=(this.end-this.start)/this.steps;e=u(t,i),this.counter=e;break;case 5:case 6:case 7:e=s(t,this.start,this.end);break;case 9:e=this.start[0]}return this.current=e,this},getMethod:function(){var t=this.propertyValue;if(null===t)return 0;var e=typeof t;if("number"===e)return 1;if(Array.isArray(t))return 2;if("function"===e)return 3;if("object"===e){if(this.hasBoth(t,"start","end"))return this.has(t,"steps")?4:5;if(this.hasBoth(t,"min","max"))return 6;if(this.has(t,"random"))return 7;if(this.hasEither(t,"onEmit","onUpdate"))return 8;if(this.hasEither(t,"values","interpolation"))return 9}return 0},setMethods:function(){var t=this.propertyValue,e=t,i=this.defaultEmit,r=this.defaultUpdate;switch(this.method){case 1:i=this.staticValueEmit;break;case 2:i=this.randomStaticValueEmit,e=t[0];break;case 3:this._onEmit=t,i=this.proxyEmit,e=this.defaultValue;break;case 4:this.start=t.start,this.end=t.end,this.steps=t.steps,this.counter=this.start,this.yoyo=!!this.has(t,"yoyo")&&t.yoyo,this.direction=0,i=this.steppedEmit,e=this.start;break;case 5:this.start=t.start,this.end=t.end;var s=this.has(t,"ease")?t.ease:"Linear";this.ease=o(s,t.easeParams),i=this.has(t,"random")&&t.random?this.randomRangedValueEmit:this.easedValueEmit,r=this.easeValueUpdate,e=this.start;break;case 6:this.start=t.min,this.end=t.max,i=this.has(t,"int")&&t.int?this.randomRangedIntEmit:this.randomRangedValueEmit,e=this.start;break;case 7:var n=t.random;Array.isArray(n)&&(this.start=n[0],this.end=n[1]),i=this.randomRangedIntEmit,e=this.start;break;case 8:this._onEmit=this.has(t,"onEmit")?t.onEmit:this.defaultEmit,this._onUpdate=this.has(t,"onUpdate")?t.onUpdate:this.defaultUpdate,i=this.proxyEmit,r=this.proxyUpdate,e=this.defaultValue;break;case 9:this.start=t.values;var a=this.has(t,"ease")?t.ease:"Linear";this.ease=o(a,t.easeParams),this.interpolation=l(t.interpolation),i=this.easedValueEmit,r=this.easeValueUpdate,e=this.start[0]}return this.onEmit=i,this.onUpdate=r,this.current=e,this},has:function(t,e){return t.hasOwnProperty(e)},hasBoth:function(t,e,i){return t.hasOwnProperty(e)&&t.hasOwnProperty(i)},hasEither:function(t,e,i){return t.hasOwnProperty(e)||t.hasOwnProperty(i)},defaultEmit:function(){return this.defaultValue},defaultUpdate:function(t,e,i,r){return r},proxyEmit:function(t,e,i){var r=this._onEmit(t,e,i);return this.current=r,r},proxyUpdate:function(t,e,i,r){var s=this._onUpdate(t,e,i,r);return this.current=s,s},staticValueEmit:function(){return this.current},staticValueUpdate:function(){return this.current},randomStaticValueEmit:function(){var t=Math.floor(Math.random()*this.propertyValue.length);return this.current=this.propertyValue[t],this.current},randomRangedValueEmit:function(t,e){var i=a(this.start,this.end);return t&&t.data[e]&&(t.data[e].min=i,t.data[e].max=this.end),this.current=i,i},randomRangedIntEmit:function(t,e){var i=r(this.start,this.end);return t&&t.data[e]&&(t.data[e].min=i,t.data[e].max=this.end),this.current=i,i},steppedEmit:function(){var t,e=this.counter,i=e,r=(this.end-this.start)/this.steps;this.yoyo?(0===this.direction?(i+=r)>=this.end&&(t=i-this.end,i=this.end-t,this.direction=1):(i-=r)<=this.start&&(t=this.start-i,i=this.start+t,this.direction=0),this.counter=i):this.counter=d(i+r,this.start,this.end);return this.current=e,e},easedValueEmit:function(t,e){if(t&&t.data[e]){var i=t.data[e];i.min=this.start,i.max=this.end}return this.current=this.start,this.start},easeValueUpdate:function(t,e,i){var r,s=t.data[e],n=this.ease(i);return r=this.interpolation?this.interpolation(this.start,n):(s.max-s.min)*n+s.min,this.current=r,r},destroy:function(){this.propertyValue=null,this.defaultValue=null,this.ease=null,this.interpolation=null,this._onEmit=null,this._onUpdate=null}});t.exports=c},24502(t,e,i){var r=i(83419),s=i(95540),n=i(20286),a=new r({Extends:n,initialize:function(t,e,i,r,a){if("object"==typeof t){var o=t;t=s(o,"x",0),e=s(o,"y",0),i=s(o,"power",0),r=s(o,"epsilon",100),a=s(o,"gravity",50)}else void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=100),void 0===a&&(a=50);n.call(this,t,e,!0),this._gravity=a,this._power=i*a,this._epsilon=r*r},update:function(t,e){var i=this.x-t.x,r=this.y-t.y,s=i*i+r*r;if(0!==s){var n=Math.sqrt(s);s0&&(this.anims=new r(this)),this.bounds=new o},emit:function(t,e,i,r,s,n){return this.emitter.emit(t,e,i,r,s,n)},isAlive:function(){return this.lifeCurrent>0},kill:function(){this.lifeCurrent=0},setPosition:function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=t,this.y=e},fire:function(t,e){var i=this.emitter,r=i.ops,s=i.getAnim();if(s?this.anims.play(s):(this.frame=i.getFrame(),this.texture=this.frame.texture),!this.frame)throw new Error("Particle has no texture frame");if(i.getEmitZone(this),void 0===t?this.x+=r.x.onEmit(this,"x"):r.x.steps>0?this.x+=t+r.x.onEmit(this,"x"):this.x+=t,void 0===e?this.y+=r.y.onEmit(this,"y"):r.y.steps>0?this.y+=e+r.y.onEmit(this,"y"):this.y+=e,this.life=r.lifespan.onEmit(this,"lifespan"),this.lifeCurrent=this.life,this.lifeT=0,this.delayCurrent=r.delay.onEmit(this,"delay"),this.holdCurrent=r.hold.onEmit(this,"hold"),this.scaleX=r.scaleX.onEmit(this,"scaleX"),this.scaleY=r.scaleY.active?r.scaleY.onEmit(this,"scaleY"):this.scaleX,this.angle=r.rotate.onEmit(this,"rotate"),this.rotation=a(this.angle),i.worldMatrix.transformPoint(this.x,this.y,this.worldPosition),0===this.delayCurrent&&i.getDeathZone(this))return this.lifeCurrent=0,!1;var n=r.speedX.onEmit(this,"speedX"),o=r.speedY.active?r.speedY.onEmit(this,"speedY"):n;if(i.radial){var h=a(r.angle.onEmit(this,"angle"));this.velocityX=Math.cos(h)*Math.abs(n),this.velocityY=Math.sin(h)*Math.abs(o)}else if(i.moveTo){var l=r.moveToX.onEmit(this,"moveToX"),u=r.moveToY.onEmit(this,"moveToY"),d=this.life/1e3;this.velocityX=(l-this.x)/d,this.velocityY=(u-this.y)/d}else this.velocityX=n,this.velocityY=o;return i.acceleration&&(this.accelerationX=r.accelerationX.onEmit(this,"accelerationX"),this.accelerationY=r.accelerationY.onEmit(this,"accelerationY")),this.maxVelocityX=r.maxVelocityX.onEmit(this,"maxVelocityX"),this.maxVelocityY=r.maxVelocityY.onEmit(this,"maxVelocityY"),this.bounce=r.bounce.onEmit(this,"bounce"),this.alpha=r.alpha.onEmit(this,"alpha"),r.color.active?this.tint=r.color.onEmit(this,"tint"):this.tint=r.tint.onEmit(this,"tint"),!0},update:function(t,e,i){if(this.lifeCurrent<=0)return!(this.holdCurrent>0)||(this.holdCurrent-=t,this.holdCurrent<=0);if(this.delayCurrent>0)return this.delayCurrent-=t,!1;this.anims&&this.anims.update(0,t);var r=this.emitter,n=r.ops,o=1-this.lifeCurrent/this.life;if(this.lifeT=o,this.x=n.x.onUpdate(this,"x",o,this.x),this.y=n.y.onUpdate(this,"y",o,this.y),r.moveTo){var h=n.moveToX.onUpdate(this,"moveToX",o,r.moveToX),l=n.moveToY.onUpdate(this,"moveToY",o,r.moveToY),u=this.lifeCurrent/1e3;this.velocityX=(h-this.x)/u,this.velocityY=(l-this.y)/u}return this.computeVelocity(r,t,e,i,o),this.scaleX=n.scaleX.onUpdate(this,"scaleX",o,this.scaleX),n.scaleY.active?this.scaleY=n.scaleY.onUpdate(this,"scaleY",o,this.scaleY):this.scaleY=this.scaleX,this.angle=n.rotate.onUpdate(this,"rotate",o,this.angle),this.rotation=a(this.angle),r.getDeathZone(this)?(this.lifeCurrent=0,!0):(this.alpha=s(n.alpha.onUpdate(this,"alpha",o,this.alpha),0,1),n.color.active?this.tint=n.color.onUpdate(this,"color",o,this.tint):this.tint=n.tint.onUpdate(this,"tint",o,this.tint),this.lifeCurrent-=t,this.lifeCurrent<=0&&this.holdCurrent<=0)},computeVelocity:function(t,e,i,r,n){var a=t.ops,o=this.velocityX,h=this.velocityY,l=a.accelerationX.onUpdate(this,"accelerationX",n,this.accelerationX),u=a.accelerationY.onUpdate(this,"accelerationY",n,this.accelerationY),d=a.maxVelocityX.onUpdate(this,"maxVelocityX",n,this.maxVelocityX),c=a.maxVelocityY.onUpdate(this,"maxVelocityY",n,this.maxVelocityY);this.bounce=a.bounce.onUpdate(this,"bounce",n,this.bounce),o+=t.gravityX*i+l*i,h+=t.gravityY*i+u*i,o=s(o,-d,d),h=s(h,-c,c),this.velocityX=o,this.velocityY=h,this.x+=o*i,this.y+=h*i,t.worldMatrix.transformPoint(this.x,this.y,this.worldPosition);for(var f=0;fe.right&&this.collideRight&&(t.x-=r.x-e.right,t.velocityX*=i),r.ye.bottom&&this.collideBottom&&(t.y-=r.y-e.bottom,t.velocityY*=i)}});t.exports=a},31600(t,e,i){var r=i(68668),s=i(83419),n=i(31401),a=i(53774),o=i(43459),h=i(26388),l=i(19909),u=i(76472),d=i(44777),c=i(20696),f=i(95643),p=i(95540),g=i(26546),m=i(24502),v=i(69036),y=i(1985),x=i(97022),T=i(86091),w=i(73162),b=i(20074),S=i(269),C=i(56480),E=i(69601),A=i(68875),_=i(87841),M=i(59996),R=i(72905),P=i(90668),O=i(19186),L=i(84322),F=i(61340),D=i(26099),I=i(15994),N=["active","advance","blendMode","colorEase","deathCallback","deathCallbackScope","duration","emitCallback","emitCallbackScope","follow","frequency","gravityX","gravityY","maxAliveParticles","maxParticles","name","emitting","particleBringToTop","particleClass","radial","sortCallback","sortOrderAsc","sortProperty","stopAfter","tintMode","timeScale","trackVisible","visible"],B=["accelerationX","accelerationY","alpha","angle","bounce","color","delay","hold","lifespan","maxVelocityX","maxVelocityY","moveToX","moveToY","quantity","rotate","scaleX","scaleY","speedX","speedY","tint","x","y"],k=new s({Extends:f,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.Lighting,n.Mask,n.RenderNodes,n.ScrollFactor,n.Texture,n.Transform,n.Visible,P],initialize:function(t,e,i,r,s){f.call(this,t,"ParticleEmitter"),this.particleClass=C,this.config=null,this.ops={accelerationX:new d("accelerationX",0),accelerationY:new d("accelerationY",0),alpha:new d("alpha",1),angle:new d("angle",{min:0,max:360},!0),bounce:new d("bounce",0),color:new u("color"),delay:new d("delay",0,!0),hold:new d("hold",0,!0),lifespan:new d("lifespan",1e3,!0),maxVelocityX:new d("maxVelocityX",1e4),maxVelocityY:new d("maxVelocityY",1e4),moveToX:new d("moveToX",0),moveToY:new d("moveToY",0),quantity:new d("quantity",1,!0),rotate:new d("rotate",0),scaleX:new d("scaleX",1),scaleY:new d("scaleY",1),speedX:new d("speedX",0,!0),speedY:new d("speedY",0,!0),tint:new d("tint",16777215),x:new d("x",0),y:new d("y",0)},this.radial=!0,this.gravityX=0,this.gravityY=0,this.acceleration=!1,this.moveTo=!1,this.emitCallback=null,this.emitCallbackScope=null,this.deathCallback=null,this.deathCallbackScope=null,this.maxParticles=0,this.maxAliveParticles=0,this.stopAfter=0,this.duration=0,this.frequency=0,this.emitting=!0,this.particleBringToTop=!0,this.timeScale=1,this.emitZones=[],this.deathZones=[],this.viewBounds=null,this.follow=null,this.followOffset=new D,this.trackVisible=!1,this.frames=[],this.randomFrame=!0,this.frameQuantity=1,this.anims=[],this.randomAnim=!0,this.animQuantity=1,this.dead=[],this.alive=[],this.counters=new Float32Array(10),this.skipping=!1,this.worldMatrix=new F,this.sortProperty="",this.sortOrderAsc=!0,this.sortCallback=this.depthSortCallback,this.processors=new w(this),this.tintMode=L.MULTIPLY,this.initRenderNodes(this._defaultRenderNodesMap),this.setPosition(e,i),this.setTexture(r),s&&this.setConfig(s)},_defaultRenderNodesMap:{get:function(){return r}},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},setConfig:function(t){if(!t)return this;this.config=t;var e=0,i="",r=this.ops;for(e=0;e=this.animQuantity&&(this.animCounter=0,this.currentAnim=I(this.currentAnim+1,0,e)),i},setAnim:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=1),this.randomAnim=e,this.animQuantity=i,this.currentAnim=0;var r=typeof t;if(this.anims.length=0,Array.isArray(t))this.anims=this.anims.concat(t);else if("string"===r)this.anims.push(t);else if("object"===r){var s=t;(t=p(s,"anims",null))&&(this.anims=this.anims.concat(t));var n=p(s,"cycle",!1);this.randomAnim=!n,this.animQuantity=p(s,"quantity",i)}return 1===this.anims.length&&(this.animQuantity=1,this.randomAnim=!1),this},setRadial:function(t){return void 0===t&&(t=!0),this.radial=t,this},addParticleBounds:function(t,e,i,r,s,n,a,o){if("object"==typeof t){var h=t;t=h.x,e=h.y,i=x(h,"w")?h.w:h.width,r=x(h,"h")?h.h:h.height}return this.addParticleProcessor(new E(t,e,i,r,s,n,a,o))},setParticleSpeed:function(t,e){return void 0===e&&(e=t),this.ops.speedX.onChange(t),t===e?this.ops.speedY.active=!1:this.ops.speedY.onChange(e),this.radial=!0,this},setParticleScale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.ops.scaleX.onChange(t),this.ops.scaleY.onChange(e),this},setParticleGravity:function(t,e){return this.gravityX=t,this.gravityY=e,this},setParticleAlpha:function(t){return this.ops.alpha.onChange(t),this},setParticleTint:function(t){return this.ops.tint.onChange(t),this},setEmitterAngle:function(t){return this.ops.angle.onChange(t),this},setParticleLifespan:function(t){return this.ops.lifespan.onChange(t),this},setQuantity:function(t){return this.quantity=t,this},setFrequency:function(t,e){return this.frequency=t,this.flowCounter=t>0?t:0,e&&(this.quantity=e),this},addDeathZone:function(t){var e;Array.isArray(t)||(t=[t]);for(var i=[],r=0;r-1&&(this.zoneTotal++,this.zoneTotal===r.total&&(this.zoneTotal=0,this.zoneIndex++,this.zoneIndex===i&&(this.zoneIndex=0)))}},getDeathZone:function(t){for(var e=this.deathZones,i=0;i=0&&(this.zoneIndex=e),this},addParticleProcessor:function(t){return this.processors.exists(t)||(t.emitter&&t.emitter.removeParticleProcessor(t),this.processors.add(t),t.emitter=this),t},removeParticleProcessor:function(t){return this.processors.exists(t)&&(this.processors.remove(t,!0),t.emitter=null),t},getProcessors:function(){return this.processors.getAll("active",!0)},createGravityWell:function(t){return this.addParticleProcessor(new m(t))},reserve:function(t){var e=this.dead;if(this.maxParticles>0){var i=this.getParticleCount();i+t>this.maxParticles&&(t=this.maxParticles-(i+t))}for(var r=0;r0&&this.getParticleCount()>=this.maxParticles||this.maxAliveParticles>0&&this.getAliveParticleCount()>=this.maxAliveParticles},onParticleEmit:function(t,e){return void 0===t?(this.emitCallback=null,this.emitCallbackScope=null):"function"==typeof t&&(this.emitCallback=t,e&&(this.emitCallbackScope=e)),this},onParticleDeath:function(t,e){return void 0===t?(this.deathCallback=null,this.deathCallbackScope=null):"function"==typeof t&&(this.deathCallback=t,e&&(this.deathCallbackScope=e)),this},killAll:function(){for(var t=this.dead,e=this.alive;e.length>0;)t.push(e.pop());return this},forEachAlive:function(t,e){for(var i=this.alive,r=i.length,s=0;s0&&this.fastForward(t),this.emitting=!0,this.resetCounters(this.frequency,!0),void 0!==e&&(this.duration=Math.abs(e)),this.emit(c.START,this)),this},stop:function(t){return void 0===t&&(t=!1),this.emitting&&(this.emitting=!1,t&&this.killAll(),this.emit(c.STOP,this)),this},pause:function(){return this.active=!1,this},resume:function(){return this.active=!0,this},setSortProperty:function(t,e){return void 0===t&&(t=""),void 0===e&&(e=this.true),this.sortProperty=t,this.sortOrderAsc=e,this.sortCallback=this.depthSortCallback,this},setSortCallback:function(t){return t=""!==this.sortProperty?this.depthSortCallback:null,this.sortCallback=t,this},depthSort:function(){return O(this.alive,this.sortCallback.bind(this)),this},depthSortCallback:function(t,e){var i=this.sortProperty;return this.sortOrderAsc?t[i]-e[i]:e[i]-t[i]},flow:function(t,e,i){return void 0===e&&(e=1),this.emitting=!1,this.frequency=t,this.quantity=e,void 0!==i&&(this.stopAfter=i),this.start()},explode:function(t,e,i){this.frequency=-1,this.resetCounters(-1,!0);var r=this.emitParticle(t,e,i);return this.emit(c.EXPLODE,this,r),r},emitParticleAt:function(t,e,i){return this.emitParticle(i,t,e)},emitParticle:function(t,e,i){if(!this.atLimit()){void 0===t&&(t=this.ops.quantity.onEmit());for(var r=this.dead,s=this.stopAfter,n=this.follow?this.follow.x+this.followOffset.x:e,a=this.follow?this.follow.y+this.followOffset.y:i,o=0;o0&&(this.stopCounter++,this.stopCounter>=s))break;if(this.atLimit())break}return h}},fastForward:function(t,e){void 0===e&&(e=1e3/60);var i=0;for(this.skipping=!0;i0){var u=this.deathCallback,d=this.deathCallbackScope;for(a=h-1;a>=0;a--){var f=o[a];s.splice(f.index,1),n.push(f.particle),u&&u.call(d,f.particle),f.particle.setPosition()}}if(this.emitting||this.skipping){if(0===this.frequency)this.emitParticle();else if(this.frequency>0)for(this.flowCounter-=e;this.flowCounter<=0;)this.emitParticle(),this.flowCounter+=this.frequency;this.skipping||(this.duration>0&&(this.elapsed+=e,this.elapsed>=this.duration&&this.stop()),this.stopAfter>0&&this.stopCounter>=this.stopAfter&&this.stop())}else 1===this.completeFlag&&0===s.length&&(this.completeFlag=0,this.emit(c.COMPLETE,this))},overlap:function(t){for(var e=this.getWorldTransformMatrix(),i=this.alive,r=i.length,s=[],n=0;n0){var u=0;for(this.skipping=!0;u0&&T(r,t,t),r},createEmitter:function(){throw new Error("createEmitter removed. See ParticleEmitter docs for info")},particleX:{get:function(){return this.ops.x.current},set:function(t){this.ops.x.onChange(t)}},particleY:{get:function(){return this.ops.y.current},set:function(t){this.ops.y.onChange(t)}},accelerationX:{get:function(){return this.ops.accelerationX.current},set:function(t){this.ops.accelerationX.onChange(t)}},accelerationY:{get:function(){return this.ops.accelerationY.current},set:function(t){this.ops.accelerationY.onChange(t)}},maxVelocityX:{get:function(){return this.ops.maxVelocityX.current},set:function(t){this.ops.maxVelocityX.onChange(t)}},maxVelocityY:{get:function(){return this.ops.maxVelocityY.current},set:function(t){this.ops.maxVelocityY.onChange(t)}},speed:{get:function(){return this.ops.speedX.current},set:function(t){this.ops.speedX.onChange(t),this.ops.speedY.onChange(t)}},speedX:{get:function(){return this.ops.speedX.current},set:function(t){this.ops.speedX.onChange(t)}},speedY:{get:function(){return this.ops.speedY.current},set:function(t){this.ops.speedY.onChange(t)}},moveToX:{get:function(){return this.ops.moveToX.current},set:function(t){this.ops.moveToX.onChange(t)}},moveToY:{get:function(){return this.ops.moveToY.current},set:function(t){this.ops.moveToY.onChange(t)}},bounce:{get:function(){return this.ops.bounce.current},set:function(t){this.ops.bounce.onChange(t)}},particleScaleX:{get:function(){return this.ops.scaleX.current},set:function(t){this.ops.scaleX.onChange(t)}},particleScaleY:{get:function(){return this.ops.scaleY.current},set:function(t){this.ops.scaleY.onChange(t)}},particleColor:{get:function(){return this.ops.color.current},set:function(t){this.ops.color.onChange(t)}},colorEase:{get:function(){return this.ops.color.easeName},set:function(t){this.ops.color.setEase(t)}},particleTint:{get:function(){return this.ops.tint.current},set:function(t){this.ops.tint.onChange(t)}},particleAlpha:{get:function(){return this.ops.alpha.current},set:function(t){this.ops.alpha.onChange(t)}},lifespan:{get:function(){return this.ops.lifespan.current},set:function(t){this.ops.lifespan.onChange(t)}},particleAngle:{get:function(){return this.ops.angle.current},set:function(t){this.ops.angle.onChange(t)}},particleRotate:{get:function(){return this.ops.rotate.current},set:function(t){this.ops.rotate.onChange(t)}},quantity:{get:function(){return this.ops.quantity.current},set:function(t){this.ops.quantity.onChange(t)}},delay:{get:function(){return this.ops.delay.current},set:function(t){this.ops.delay.onChange(t)}},hold:{get:function(){return this.ops.hold.current},set:function(t){this.ops.hold.onChange(t)}},flowCounter:{get:function(){return this.counters[0]},set:function(t){this.counters[0]=t}},frameCounter:{get:function(){return this.counters[1]},set:function(t){this.counters[1]=t}},animCounter:{get:function(){return this.counters[2]},set:function(t){this.counters[2]=t}},elapsed:{get:function(){return this.counters[3]},set:function(t){this.counters[3]=t}},stopCounter:{get:function(){return this.counters[4]},set:function(t){this.counters[4]=t}},completeFlag:{get:function(){return this.counters[5]},set:function(t){this.counters[5]=t}},zoneIndex:{get:function(){return this.counters[6]},set:function(t){this.counters[6]=t}},zoneTotal:{get:function(){return this.counters[7]},set:function(t){this.counters[7]=t}},currentFrame:{get:function(){return this.counters[8]},set:function(t){this.counters[8]=t}},currentAnim:{get:function(){return this.counters[9]},set:function(t){this.counters[9]=t}},preDestroy:function(){var t;this.texture=null,this.frames=null,this.anims=null,this.emitCallback=null,this.emitCallbackScope=null,this.deathCallback=null,this.deathCallbackScope=null,this.emitZones=null,this.deathZones=null,this.bounds=null,this.follow=null,this.counters=null;var e=this.ops;for(t=0;t0&&T.height>0){var w=-x.halfWidth,b=-x.halfHeight;l.globalAlpha=y,l.save(),a.setToContext(l),u&&(w=Math.round(w),b=Math.round(b)),l.imageSmoothingEnabled=!x.source.scaleMode,l.drawImage(x.source.image,T.x,T.y,T.width,T.height,w,b,T.width,T.height),l.restore()}}}l.restore()}}},92730(t,e,i){var r=i(25305),s=i(44603),n=i(23568),a=i(95540),o=i(31600);s.register("particles",function(t,e){void 0===t&&(t={});var i=n(t,"key",null),s=a(t,"config",null),h=new o(this.scene,0,0,i);return void 0!==e&&(t.add=e),r(this.scene,h,t),s&&h.setConfig(s),h})},676(t,e,i){var r=i(39429),s=i(31600);r.register("particles",function(t,e,i,r){return void 0!==t&&"string"==typeof t&&console.warn("ParticleEmitterManager was removed in Phaser 3.60. See documentation for details"),this.displayList.add(new s(this.scene,t,e,i,r))})},90668(t,e,i){var r=i(29747),s=r,n=r;s=i(21188),n=i(9871),t.exports={renderWebGL:s,renderCanvas:n}},21188(t,e,i){var r=i(59996),s=i(61340),n=i(70554),a=new s,o=new s,h=new s,l=new s,u={},d={},c={quad:new Float32Array(8)};t.exports=function(t,e,i,s){var f=i.camera;f.addToRenderList(e),a.copyWithScrollFactorFrom(f.getViewMatrix(!i.useCanvas),f.scrollX,f.scrollY,e.scrollFactorX,e.scrollFactorY),s&&a.multiply(s),l.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),a.multiply(l);var p=n.getTintAppendFloatAlpha,g=e.alpha,m=e.alive,v=m.length,y=e.viewBounds;if(0!==v&&(!y||r(y,f.worldView))){e.sortCallback&&e.depthSort();for(var x=e.tintMode,T=0;Tthis._length&&(this.counter=this._length-1),this},changeSource:function(t){return this.source=t,this.updateSource()},getPoint:function(t){0===this._direction?(this.counter++,this.counter>=this._length&&(this.yoyo?(this._direction=1,this.counter=this._length-1):this.counter=0)):(this.counter--,-1===this.counter&&(this.yoyo?(this._direction=0,this.counter=0):this.counter=this._length-1));var e=this.points[this.counter];e&&(t.x=e.x,t.y=e.y)}});t.exports=r},68875(t,e,i){var r=i(83419),s=i(26099),n=new r({initialize:function(t){this.source=t,this._tempVec=new s,this.total=-1},getPoint:function(t){var e=this._tempVec;this.source.getRandomPoint(e),t.x=e.x,t.y=e.y}});t.exports=n},21024(t,e,i){t.exports={DeathZone:i(26388),EdgeZone:i(19909),RandomZone:i(68875)}},1159(t,e,i){var r=i(83419),s=i(31401),n=i(68287),a=new r({Extends:n,Mixins:[s.PathFollower],initialize:function(t,e,i,r,s,a){n.call(this,t,i,r,s,a),this.path=e},preUpdate:function(t,e){this.anims.update(t,e),this.pathUpdate(t)}});t.exports=a},90145(t,e,i){var r=i(39429),s=i(1159);r.register("follower",function(t,e,i,r,n){var a=new s(this.scene,t,e,i,r,n);return this.displayList.add(a),this.updateList.add(a),a})},80321(t,e,i){var r=i(43246),s=i(83419),n=i(31401),a=i(95643),o=i(30100),h=i(67277),l=new s({Extends:a,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.Mask,n.RenderNodes,n.ScrollFactor,n.Transform,n.Visible,h],initialize:function(t,e,i,r,s,n,h){void 0===r&&(r=16777215),void 0===s&&(s=128),void 0===n&&(n=1),void 0===h&&(h=.1),a.call(this,t,"PointLight"),this.initRenderNodes(this._defaultRenderNodesMap),this.setPosition(e,i),this.color=o(r),this.intensity=n,this.attenuation=h,this.width=2*s,this.height=2*s,this._radius=s},_defaultRenderNodesMap:{get:function(){return r}},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this.width=2*t,this.height=2*t}},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return this._radius}},displayOriginY:{get:function(){return this._radius}}});t.exports=l},39829(t,e,i){var r=i(25305),s=i(44603),n=i(23568),a=i(80321);s.register("pointlight",function(t,e){void 0===t&&(t={});var i=n(t,"color",16777215),s=n(t,"radius",128),o=n(t,"intensity",1),h=n(t,"attenuation",.1),l=new a(this.scene,0,0,i,s,o,h);return void 0!==e&&(t.add=e),r(this.scene,l,t),l})},71255(t,e,i){var r=i(39429),s=i(80321);r.register("pointlight",function(t,e,i,r,n,a){return this.displayList.add(new s(this.scene,t,e,i,r,n,a))})},67277(t,e,i){var r=i(29747),s=r,n=r;s=i(57787),t.exports={renderWebGL:s,renderCanvas:n}},57787(t,e,i){var r=i(91296);t.exports=function(t,e,i,s){var n=i.camera;n.addToRenderList(e);var a=r(e,n,s,!i.useCanvas).calc,o=e.width,h=e.height,l=-e._radius,u=-e._radius,d=l+o,c=u+h,f=a.getX(0,0),p=a.getY(0,0),g=a.getX(l,u),m=a.getY(l,u),v=a.getX(l,c),y=a.getY(l,c),x=a.getX(d,c),T=a.getY(d,c),w=a.getX(d,u),b=a.getY(d,u);(e.customRenderNodes.BatchHandler||e.defaultRenderNodes.BatchHandler).batch(i,e,g,m,v,y,w,b,x,T,f,p)}},591(t,e,i){var r=i(83419),s=i(45650),n=i(88571),a=i(83999),o=i(58855),h=new r({Extends:n,Mixins:[a],initialize:function(t,e,i,r,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=32),void 0===a&&(a=32),void 0===h&&(h=!0);var l=t.sys.textures.addDynamicTexture(s(),r,a,h);n.call(this,t,e,i,l),this.type="RenderTexture",this.camera=this.texture.camera,this._saved=!1,this.renderMode=o.RENDER,this.isCurrentlyRendering=!1},setSize:function(t,e){this.width=t,this.height=e,this.updateDisplayOrigin();var i=this.input;return i&&!i.customHitArea&&(i.hitArea.width=t,i.hitArea.height=e),this},resize:function(t,e,i){return this.texture.setSize(t,e,i),this.setSize(this.texture.width,this.texture.height),this},saveTexture:function(t){var e=this.texture,i=e.key,r=e.manager;return r.exists(i)&&r.get(i)===e?(r.renameTexture(i,t),this._saved=!0):(e.key=t,e.manager.addDynamicTexture(e)&&(this._saved=!0)),e},setRenderMode:function(t,e){return this.renderMode=t,e&&this.texture.preserve(!0),this},render:function(){return this.texture.render(),this},fill:function(t,e,i,r,s,n){return this.texture.fill(t,e,i,r,s,n),this},clear:function(t,e,i,r){return this.texture.clear(t,e,i,r),this},stamp:function(t,e,i,r,s){return this.texture.stamp(t,e,i,r,s),this},erase:function(t,e,i){return this.texture.erase(t,e,i),this},draw:function(t,e,i,r,s){return this.texture.draw(t,e,i,r,s),this},capture:function(t,e){return this.texture.capture(t,e),this},repeat:function(t,e,i,r,s,n,a){return this.texture.repeat(t,e,i,r,s,n,a),this},preserve:function(t){return this.texture.preserve(t),this},callback:function(t){return this.texture.callback(t),this},snapshotArea:function(t,e,i,r,s,n,a){return this.texture.snapshotArea(t,e,i,r,s,n,a),this},snapshot:function(t,e,i){return this.texture.snapshot(t,e,i)},snapshotPixel:function(t,e,i){return this.texture.snapshotPixel(t,e,i)},preDestroy:function(){this.camera=null,this._saved||this.texture.destroy()}});t.exports=h},97272(t,e,i){var r=i(40652),s=i(58855);t.exports=function(t,e,i,n){var a=!0,o=!0;e.renderMode===s.REDRAW?o=!1:e.renderMode===s.RENDER&&(a=!1),a&&e.render(),o&&r(t,e,i,n)}},34495(t,e,i){var r=i(25305),s=i(44603),n=i(23568),a=i(591);s.register("renderTexture",function(t,e){void 0===t&&(t={});var i=n(t,"x",0),s=n(t,"y",0),o=n(t,"width",32),h=n(t,"height",32),l=new a(this.scene,i,s,o,h);return void 0!==e&&(t.add=e),r(this.scene,l,t),l})},60505(t,e,i){var r=i(39429),s=i(591);r.register("renderTexture",function(t,e,i,r){return this.displayList.add(new s(this.scene,t,e,i,r))})},83999(t,e,i){var r=i(29747),s=r,n=r;s=i(53937),n=i(97272),t.exports={renderWebGL:s,renderCanvas:n}},58855(t){t.exports={RENDER:"render",REDRAW:"redraw",ALL:"all"}},53937(t,e,i){var r=i(99517),s=i(58855);t.exports=function(t,e,i,n){if(!e.isCurrentlyRendering){e.isCurrentlyRendering=!0;var a=!0,o=!0;e.renderMode===s.REDRAW?o=!1:e.renderMode===s.RENDER&&(a=!1),a&&e.render(),o&&r(t,e,i,n),e.isCurrentlyRendering=!1}}},77757(t,e,i){var r=i(9674),s=i(85760),n=i(83419),a=i(31401),o=i(95643),h=i(38745),l=i(84322),u=i(26099),d=new n({Extends:o,Mixins:[a.AlphaSingle,a.BlendMode,a.Depth,a.Flip,a.Mask,a.RenderNodes,a.Size,a.Texture,a.Transform,a.Visible,a.ScrollFactor,h],initialize:function(t,e,i,s,n,a,h,d,c){void 0===s&&(s="__DEFAULT"),void 0===a&&(a=2),void 0===h&&(h=!0),o.call(this,t,"Rope"),this.anims=new r(this),this.points=a,this.vertices,this.uv,this.colors,this.alphas,this.tintMode="__DEFAULT"===s?l.FILL:l.MULTIPLY,this.dirty=!1,this.horizontal=h,this._flipX=!1,this._flipY=!1,this._perp=new u,this.debugCallback=null,this.debugGraphic=null,this.setTexture(s,n),this.setPosition(e,i),this.setSizeToFrame(),this.initRenderNodes(this._defaultRenderNodesMap),Array.isArray(a)&&this.resizeArrays(a.length),this.setPoints(a,d,c),this.updateVertices()},_defaultRenderNodesMap:{get:function(){return s}},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(t,e){var i=this.anims.currentFrame;this.anims.update(t,e),this.anims.currentFrame!==i&&(this.updateUVs(),this.updateVertices())},play:function(t,e,i){return this.anims.play(t,e,i),this},setDirty:function(){return this.dirty=!0,this},setHorizontal:function(t,e,i){return void 0===t&&(t=this.points.length),this.horizontal?this:(this.horizontal=!0,this.setPoints(t,e,i))},setVertical:function(t,e,i){return void 0===t&&(t=this.points.length),this.horizontal?(this.horizontal=!1,this.setPoints(t,e,i)):this},setTintMode:function(t){return void 0===t&&(t=l.MULTIPLY),this.tintMode=t,this},setAlphas:function(t,e){var i=this.points.length;if(i<1)return this;var r,s=this.alphas;void 0===t?t=[1]:Array.isArray(t)||void 0!==e||(t=[t]);var n=0;if(void 0!==e)for(r=0;rn&&(a=t[n]),s[n]=a,t.length>n+1&&(a=t[n+1]),s[n+1]=a}return this},setColors:function(t){var e=this.points.length;if(e<1)return this;var i,r=this.colors;void 0===t?t=[16777215]:Array.isArray(t)||(t=[t]);var s=0;if(t.length===e)for(i=0;is&&(n=t[s]),r[s]=n,t.length>s+1&&(n=t[s+1]),r[s+1]=n}return this},setPoints:function(t,e,i){if(void 0===t&&(t=2),"number"==typeof t){var r,s,n,a=t;if(a<2&&(a=2),t=[],this.horizontal)for(n=-this.frame.halfWidth,s=this.frame.width/(a-1),r=0;r>>16,o=(65280&s)>>>8,h=255&s;t.fillStyle="rgba("+a+","+o+","+h+","+n+")"}},75177(t){t.exports=function(t,e,i,r){var s=i||e.strokeColor,n=r||e.strokeAlpha,a=(16711680&s)>>>16,o=(65280&s)>>>8,h=255&s;t.strokeStyle="rgba("+a+","+o+","+h+","+n+")",t.lineWidth=e.lineWidth}},17803(t,e,i){var r=i(87891),s=i(83419),n=i(31401),a=i(95643),o=i(23031),h=new s({Extends:a,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.GetBounds,n.Lighting,n.Mask,n.Origin,n.RenderNodes,n.ScrollFactor,n.Transform,n.Visible],initialize:function(t,e,i){void 0===e&&(e="Shape"),a.call(this,t,e),this.geom=i,this.pathData=[],this.pathIndexes=[],this.fillColor=16777215,this.fillAlpha=1,this.strokeColor=16777215,this.strokeAlpha=1,this.lineWidth=1,this.isFilled=!1,this.isStroked=!1,this.closePath=!0,this._tempLine=new o,this.width=0,this.height=0,this.enableFilters&&(this.filtersFocusContext=!0),this.initRenderNodes(this._defaultRenderNodesMap)},_defaultRenderNodesMap:{get:function(){return r}},setFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.isFilled=!1:(this.fillColor=t,this.fillAlpha=e,this.isFilled=!0),this},setStrokeStyle:function(t,e,i){return void 0===i&&(i=1),void 0===t?this.isStroked=!1:(this.lineWidth=t,this.strokeColor=e,this.strokeAlpha=i,this.isStroked=!0),this},setClosePath:function(t){return this.closePath=t,this},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this},preDestroy:function(){this.geom=null,this._tempLine=null,this.pathData=[],this.pathIndexes=[]},displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}}});t.exports=h},34682(t,e,i){var r=i(70554);t.exports=function(t,e,i,s,n,a,o){var h=r.getTintAppendFloatAlpha(s.strokeColor,s.strokeAlpha*n),l=s.pathData,u=l.length-1,d=s.lineWidth,c=!s.closePath,f=s.customRenderNodes.StrokePath||s.defaultRenderNodes.StrokePath,p=[];c&&(u-=2);for(var g=0;g0&&m===l[g-2]&&v===l[g-1]||p.push({x:m,y:v,width:d})}f.run(t,e,p,d,c,i,h,h,h,h,void 0,s.lighting)}},23629(t,e,i){var r=i(13609),s=i(83419),n=i(39506),a=i(94811),o=i(96503),h=i(36383),l=i(17803),u=new s({Extends:l,Mixins:[r],initialize:function(t,e,i,r,s,n,a,h,u){void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=128),void 0===s&&(s=0),void 0===n&&(n=360),void 0===a&&(a=!1),l.call(this,t,"Arc",new o(0,0,r)),this._startAngle=s,this._endAngle=n,this._anticlockwise=a,this._iterations=.01,this.setPosition(e,i);var d=2*this.geom.radius;this.setSize(d,d),void 0!==h&&this.setFillStyle(h,u),this.updateDisplayOrigin(),this.updateData()},iterations:{get:function(){return this._iterations},set:function(t){this._iterations=t,this.updateData()}},radius:{get:function(){return this.geom.radius},set:function(t){this.geom.radius=t;var e=2*t;this.setSize(e,e),this.updateDisplayOrigin(),this.updateData()}},startAngle:{get:function(){return this._startAngle},set:function(t){this._startAngle=t,this.updateData()}},endAngle:{get:function(){return this._endAngle},set:function(t){this._endAngle=t,this.updateData()}},anticlockwise:{get:function(){return this._anticlockwise},set:function(t){this._anticlockwise=t,this.updateData()}},setRadius:function(t){return this.radius=t,this},setIterations:function(t){return void 0===t&&(t=.01),this.iterations=t,this},setStartAngle:function(t,e){return this._startAngle=t,void 0!==e&&(this._anticlockwise=e),this.updateData()},setEndAngle:function(t,e){return this._endAngle=t,void 0!==e&&(this._anticlockwise=e),this.updateData()},updateData:function(){var t=this._iterations,e=t,i=this.geom.radius,r=n(this._startAngle),s=n(this._endAngle),o=i,l=i;s-=r,this._anticlockwise?s<-h.TAU?s=-h.TAU:s>0&&(s=-h.TAU+s%h.TAU):s>h.TAU?s=h.TAU:s<0&&(s=h.TAU+s%h.TAU);for(var u,d=[o+Math.cos(r)*i,l+Math.sin(r)*i];e<1;)u=s*e+r,d.push(o+Math.cos(u)*i,l+Math.sin(u)*i),e+=t;return u=s+r,d.push(o+Math.cos(u)*i,l+Math.sin(u)*i),d.push(o+Math.cos(r)*i,l+Math.sin(r)*i),this.pathIndexes=a(d),this.pathData=d,this}});t.exports=u},42542(t,e,i){var r=i(39506),s=i(65960),n=i(75177),a=i(20926);t.exports=function(t,e,i,o){i.addToRenderList(e);var h=t.currentContext;if(a(t,h,e,i,o)){var l=e.radius;h.beginPath(),h.arc(l-e.originX*(2*l),l-e.originY*(2*l),l,r(e._startAngle),r(e._endAngle),e.anticlockwise),e.closePath&&h.closePath(),e.isFilled&&(s(h,e),h.fill()),e.isStroked&&(n(h,e),h.stroke()),h.restore()}}},42563(t,e,i){var r=i(23629),s=i(39429);s.register("arc",function(t,e,i,s,n,a,o,h){return this.displayList.add(new r(this.scene,t,e,i,s,n,a,o,h))}),s.register("circle",function(t,e,i,s,n){return this.displayList.add(new r(this.scene,t,e,i,0,360,!1,s,n))})},13609(t,e,i){var r=i(29747),s=r,n=r;s=i(41447),n=i(42542),t.exports={renderWebGL:s,renderCanvas:n}},41447(t,e,i){var r=i(91296),s=i(10441),n=i(34682);t.exports=function(t,e,i,a){var o=i.camera;o.addToRenderList(e);var h=r(e,o,a,!i.useCanvas).calc,l=e._displayOriginX,u=e._displayOriginY,d=e.alpha,c=e.customRenderNodes.Submitter||e.defaultRenderNodes.Submitter;e.isFilled&&s(i,c,h,e,d,l,u),e.isStroked&&n(i,c,h,e,d,l,u)}},89(t,e,i){var r=i(83419),s=i(33141),n=i(94811),a=i(87841),o=i(17803),h=new r({Extends:o,Mixins:[s],initialize:function(t,e,i,r,s,n){void 0===e&&(e=0),void 0===i&&(i=0),o.call(this,t,"Curve",r),this._smoothness=32,this._curveBounds=new a,this.closePath=!1,this.setPosition(e,i),void 0!==s&&this.setFillStyle(s,n),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(t){this._smoothness=t,this.updateData()}},setSmoothness:function(t){return this._smoothness=t,this.updateData()},updateData:function(){var t=this._curveBounds,e=this._smoothness;this.geom.getBounds(t,e),this.setSize(t.width,t.height),this.updateDisplayOrigin();for(var i=[],r=this.geom.getPoints(e),s=0;s0)for(r(o,e),_=0;_0&&P>0&&o.fillRect(h+A*f+C,l+_*p+C,R,P));if(b&&e.altFillAlpha>0)for(r(o,e,e.altFillColor,e.altFillAlpha*u),_=0;_0&&P>0&&o.fillRect(h+A*f+C,l+_*p+C,R,P)):M=1;if(S&&e.strokeAlpha>0){s(o,e,e.strokeColor,e.strokeAlpha*u);var O=e.strokeOutside?0:1;for(A=O;AE&&(o.beginPath(),o.moveTo(d+h,l),o.lineTo(d+h,c+l),o.stroke()),c>E&&(o.beginPath(),o.moveTo(h,c+l),o.lineTo(d+h,c+l),o.stroke()))}o.restore()}}},34137(t,e,i){var r=i(39429),s=i(30479);r.register("grid",function(t,e,i,r,n,a,o,h,l,u){return this.displayList.add(new s(this.scene,t,e,i,r,n,a,o,h,l,u))})},26015(t,e,i){var r=i(29747),s=r,n=r;s=i(46161),n=i(49912),t.exports={renderWebGL:s,renderCanvas:n}},46161(t,e,i){var r=i(91296),s=i(70554);t.exports=function(t,e,i,n){var a=i.camera;a.addToRenderList(e);var o=e.customRenderNodes.FillRect||e.defaultRenderNodes.FillRect,h=e.customRenderNodes.Submitter||e.defaultRenderNodes.Submitter,l=r(e,a,n,!i.useCanvas).calc;l.translate(-e._displayOriginX,-e._displayOriginY);var u,d=e.alpha,c=e.width,f=e.height,p=e.cellWidth,g=e.cellHeight,m=Math.ceil(c/p),v=Math.ceil(f/g),y=p,x=g,T=p-(m*p-c),w=g-(v*g-f),b=e.isFilled,S=e.showAltCells,C=e.isStroked,E=e.cellPadding,A=e.lineWidth,_=A/2,M=0,R=0,P=0,O=0,L=0;if(E&&(y-=2*E,x-=2*E,T-=2*E,w-=2*E),b&&e.fillAlpha>0)for(u=s.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*d),R=0;R0&&L>0&&o.run(i,l,h,M*p+E,R*g+E,O,L,u,u,u,u,e.lighting));if(S&&e.altFillAlpha>0)for(u=s.getTintAppendFloatAlpha(e.altFillColor,e.altFillAlpha*d),R=0;R0&&L>0&&o.run(i,l,h,M*p+E,R*g+E,O,L,u,u,u,u)):P=1;if(C&&e.strokeAlpha>0){var F=s.getTintAppendFloatAlpha(e.strokeColor,e.strokeAlpha*d),D=e.strokeOutside?0:1;for(M=D;M_&&o.run(i,l,h,c-_,0,A,f,F,F,F,F),f>_&&o.run(i,l,h,0,f-_,c,A,F,F,F,F))}}},61475(t,e,i){var r=i(99651),s=i(83419),n=i(17803),a=new s({Extends:n,Mixins:[r],initialize:function(t,e,i,r,s,a,o,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=48),void 0===s&&(s=32),void 0===a&&(a=15658734),void 0===o&&(o=10066329),void 0===h&&(h=13421772),n.call(this,t,"IsoBox",null),this.projection=4,this.fillTop=a,this.fillLeft=o,this.fillRight=h,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isFilled=!0,this.setPosition(e,i),this.setSize(r,s),this.updateDisplayOrigin()},setProjection:function(t){return this.projection=t,this},setFaces:function(t,e,i){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),this.showTop=t,this.showLeft=e,this.showRight=i,this},setFillStyle:function(t,e,i){return this.fillTop=t,this.fillLeft=e,this.fillRight=i,this.isFilled=!0,this}});t.exports=a},11508(t,e,i){var r=i(65960),s=i(20926);t.exports=function(t,e,i,n){i.addToRenderList(e);var a=t.currentContext;if(s(t,a,e,i,n)&&e.isFilled){var o=e.width,h=e.height,l=o/2,u=o/e.projection;e.showTop&&(r(a,e,e.fillTop),a.beginPath(),a.moveTo(-l,-h),a.lineTo(0,-u-h),a.lineTo(l,-h),a.lineTo(l,-1),a.lineTo(0,u-1),a.lineTo(-l,-1),a.lineTo(-l,-h),a.fill()),e.showLeft&&(r(a,e,e.fillLeft),a.beginPath(),a.moveTo(-l,0),a.lineTo(0,u),a.lineTo(0,u-h),a.lineTo(-l,-h),a.lineTo(-l,0),a.fill()),e.showRight&&(r(a,e,e.fillRight),a.beginPath(),a.moveTo(l,0),a.lineTo(0,u),a.lineTo(0,u-h),a.lineTo(l,-h),a.lineTo(l,0),a.fill()),a.restore()}}},3933(t,e,i){var r=i(39429),s=i(61475);r.register("isobox",function(t,e,i,r,n,a,o){return this.displayList.add(new s(this.scene,t,e,i,r,n,a,o))})},99651(t,e,i){var r=i(29747),s=r,n=r;s=i(68149),n=i(11508),t.exports={renderWebGL:s,renderCanvas:n}},68149(t,e,i){var r=i(91296),s=i(70554);t.exports=function(t,e,i,n){if(e.isFilled){var a=i.camera;a.addToRenderList(e);var o,h,l,u,d,c,f,p,g,m=e.customRenderNodes.FillTri||e.defaultRenderNodes.FillTri,v=e.customRenderNodes.Submitter||e.defaultRenderNodes.Submitter,y=r(e,a,n,!i.useCanvas).calc,x=e.width,T=e.height,w=x/2,b=x/e.projection,S=e.alpha,C=e.lighting;e.showTop&&(o=s.getTintAppendFloatAlpha(e.fillTop,S),h=-w,l=-T,u=0,d=-b-T,c=w,f=-T,p=0,g=b-T,m.run(i,y,v,h,l,u,d,c,f,o,o,o,C),m.run(i,y,v,c,f,p,g,h,l,o,o,o,C)),e.showLeft&&(o=s.getTintAppendFloatAlpha(e.fillLeft,S),h=-w,l=0,u=0,d=b,c=0,f=b-T,p=-w,g=-T,m.run(i,y,v,h,l,u,d,c,f,o,o,o,C),m.run(i,y,v,c,f,p,g,h,l,o,o,o,C)),e.showRight&&(o=s.getTintAppendFloatAlpha(e.fillRight,S),h=w,l=0,u=0,d=b,c=0,f=b-T,p=w,g=-T,m.run(i,y,v,h,l,u,d,c,f,o,o,o,C),m.run(i,y,v,c,f,p,g,h,l,o,o,o,C))}}},16933(t,e,i){var r=i(83419),s=i(60561),n=i(17803),a=new r({Extends:n,Mixins:[s],initialize:function(t,e,i,r,s,a,o,h,l){void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=48),void 0===s&&(s=32),void 0===a&&(a=!1),void 0===o&&(o=15658734),void 0===h&&(h=10066329),void 0===l&&(l=13421772),n.call(this,t,"IsoTriangle",null),this.projection=4,this.fillTop=o,this.fillLeft=h,this.fillRight=l,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isReversed=a,this.isFilled=!0,this.setPosition(e,i),this.setSize(r,s),this.updateDisplayOrigin()},setProjection:function(t){return this.projection=t,this},setReversed:function(t){return this.isReversed=t,this},setFaces:function(t,e,i){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),this.showTop=t,this.showLeft=e,this.showRight=i,this},setFillStyle:function(t,e,i){return this.fillTop=t,this.fillLeft=e,this.fillRight=i,this.isFilled=!0,this}});t.exports=a},79590(t,e,i){var r=i(65960),s=i(20926);t.exports=function(t,e,i,n){i.addToRenderList(e);var a=t.currentContext;if(s(t,a,e,i,n)&&e.isFilled){var o=e.width,h=e.height,l=o/2,u=o/e.projection,d=e.isReversed;e.showTop&&d&&(r(a,e,e.fillTop),a.beginPath(),a.moveTo(-l,-h),a.lineTo(0,-u-h),a.lineTo(l,-h),a.lineTo(0,u-h),a.fill()),e.showLeft&&(r(a,e,e.fillLeft),a.beginPath(),d?(a.moveTo(-l,-h),a.lineTo(0,u),a.lineTo(0,u-h)):(a.moveTo(-l,0),a.lineTo(0,u),a.lineTo(0,u-h)),a.fill()),e.showRight&&(r(a,e,e.fillRight),a.beginPath(),d?(a.moveTo(l,-h),a.lineTo(0,u),a.lineTo(0,u-h)):(a.moveTo(l,0),a.lineTo(0,u),a.lineTo(0,u-h)),a.fill()),a.restore()}}},49803(t,e,i){var r=i(39429),s=i(16933);r.register("isotriangle",function(t,e,i,r,n,a,o,h){return this.displayList.add(new s(this.scene,t,e,i,r,n,a,o,h))})},60561(t,e,i){var r=i(29747),s=r,n=r;s=i(51503),n=i(79590),t.exports={renderWebGL:s,renderCanvas:n}},51503(t,e,i){var r=i(91296),s=i(70554);t.exports=function(t,e,i,n){if(e.isFilled){var a=i.camera;a.addToRenderList(e);var o,h,l,u,d,c,f,p=e.customRenderNodes.FillTri||e.defaultRenderNodes.FillTri,g=e.customRenderNodes.Submitter||e.defaultRenderNodes.Submitter,m=r(e,a,n,!i.useCanvas).calc,v=e.width,y=e.height,x=v/2,T=v/e.projection,w=e.isReversed,b=e.alpha,S=e.lighting;if(e.showTop&&w){o=s.getTintAppendFloatAlpha(e.fillTop,b),h=-x,l=-y,u=0,d=-T-y,c=x,f=-y;var C=T-y;p.run(i,m,g,h,l,u,d,c,f,o,o,o,S),p.run(i,m,g,c,f,0,C,h,l,o,o,o,S)}e.showLeft&&(o=s.getTintAppendFloatAlpha(e.fillLeft,b),w?(h=-x,l=-y,u=0,d=T,c=0,f=T-y):(h=-x,l=0,u=0,d=T,c=0,f=T-y),p.run(i,m,g,h,l,u,d,c,f,o,o,o,S)),e.showRight&&(o=s.getTintAppendFloatAlpha(e.fillRight,b),w?(h=x,l=-y,u=0,d=T,c=0,f=T-y):(h=x,l=0,u=0,d=T,c=0,f=T-y),p.run(i,m,g,h,l,u,d,c,f,o,o,o,S))}}},57847(t,e,i){var r=i(83419),s=i(17803),n=i(23031),a=i(36823),o=new r({Extends:s,Mixins:[a],initialize:function(t,e,i,r,a,o,h,l,u){void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===a&&(a=0),void 0===o&&(o=128),void 0===h&&(h=0),s.call(this,t,"Line",new n(r,a,o,h));var d=Math.max(1,this.geom.right-this.geom.left),c=Math.max(1,this.geom.bottom-this.geom.top);this.lineWidth=1,this._startWidth=1,this._endWidth=1,this.setPosition(e,i),this.setSize(d,c),void 0!==l&&this.setStrokeStyle(1,l,u),this.updateDisplayOrigin()},setLineWidth:function(t,e){return void 0===e&&(e=t),this._startWidth=t,this._endWidth=e,this.lineWidth=t,this},setTo:function(t,e,i,r){return this.geom.setTo(t,e,i,r),this}});t.exports=o},17440(t,e,i){var r=i(75177),s=i(20926);t.exports=function(t,e,i,n){i.addToRenderList(e);var a=t.currentContext;if(s(t,a,e,i,n)){var o=e._displayOriginX,h=e._displayOriginY;e.isStroked&&(r(a,e),a.beginPath(),a.moveTo(e.geom.x1-o,e.geom.y1-h),a.lineTo(e.geom.x2-o,e.geom.y2-h),a.stroke()),a.restore()}}},2481(t,e,i){var r=i(39429),s=i(57847);r.register("line",function(t,e,i,r,n,a,o,h){return this.displayList.add(new s(this.scene,t,e,i,r,n,a,o,h))})},36823(t,e,i){var r=i(29747),s=r,n=r;s=i(77385),n=i(17440),t.exports={renderWebGL:s,renderCanvas:n}},77385(t,e,i){var r=i(91296),s=i(70554),n=[{x:0,y:0,width:0},{x:0,y:0,width:0}];t.exports=function(t,e,i,a){var o=i.camera;o.addToRenderList(e);var h=r(e,o,a,!i.useCanvas).calc,l=e._displayOriginX,u=e._displayOriginY,d=e.alpha;if(e.isStroked){var c=s.getTintAppendFloatAlpha(e.strokeColor,e.strokeAlpha*d);n[0].x=e.geom.x1-l,n[0].y=e.geom.y1-u,n[0].width=e._startWidth,n[1].x=e.geom.x2-l,n[1].y=e.geom.y2-u,n[1].width=e._endWidth,(e.customRenderNodes.StrokePath||e.defaultRenderNodes.StrokePath).run(i,e.customRenderNodes.Submitter||e.defaultRenderNodes.Submitter,n,1,!0,h,c,c,c,c,void 0,e.lighting)}}},24949(t,e,i){var r=i(90273),s=i(83419),n=i(94811),a=i(13829),o=i(25717),h=i(17803),l=i(5469),u=new s({Extends:h,Mixins:[r],initialize:function(t,e,i,r,s,n){void 0===e&&(e=0),void 0===i&&(i=0),h.call(this,t,"Polygon",new o(r));var l=a(this.geom);this.setPosition(e,i),this.setSize(l.width,l.height),void 0!==s&&this.setFillStyle(s,n),this.updateDisplayOrigin(),this.updateData()},smooth:function(t){void 0===t&&(t=1);for(var e=0;e0,this.updateRoundedData()},setSize:function(t,e){this.width=t,this.height=e,this.geom.setSize(t,e),this.updateData(),this.updateDisplayOrigin();var i=this.input;return i&&!i.customHitArea&&(i.hitArea.width=t,i.hitArea.height=e),this},updateData:function(){if(this.isRounded)return this.updateRoundedData();var t=[],e=this.geom,i=this._tempLine;return e.getLineA(i),t.push(i.x1,i.y1,i.x2,i.y2),e.getLineB(i),t.push(i.x2,i.y2),e.getLineC(i),t.push(i.x2,i.y2),e.getLineD(i),t.push(i.x2,i.y2),this.pathData=t,this},updateRoundedData:function(){var t=[],e=this.width/2,i=this.height/2,r=Math.min(e,i),n=Math.min(this.radius,r),a=e,o=i,h=Math.max(4,Math.min(16,Math.ceil(n/2)));return this.arcTo(t,a-e+n,o-i+n,n,Math.PI,1.5*Math.PI,h),t.push(a+e-n,o-i),this.arcTo(t,a+e-n,o-i+n,n,1.5*Math.PI,2*Math.PI,h),t.push(a+e,o+i-n),this.arcTo(t,a+e-n,o+i-n,n,0,.5*Math.PI,h),t.push(a-e+n,o+i),this.arcTo(t,a-e+n,o+i-n,n,.5*Math.PI,Math.PI,h),t.push(a-e,o-i+n),this.pathIndexes=s(t),this.pathData=t,this},arcTo:function(t,e,i,r,s,n,a){for(var o=(n-s)/a,h=0;h<=a;h++){var l=s+o*h;t.push(e+Math.cos(l)*r,i+Math.sin(l)*r)}}});t.exports=h},48682(t,e,i){var r=i(65960),s=i(75177),n=i(20926),a=function(t,e,i,r,s,n){var a=Math.min(r/2,s/2),o=Math.min(n,a);0!==o?(t.moveTo(e+o,i),t.lineTo(e+r-o,i),t.arcTo(e+r,i,e+r,i+o,o),t.lineTo(e+r,i+s-o),t.arcTo(e+r,i+s,e+r-o,i+s,o),t.lineTo(e+o,i+s),t.arcTo(e,i+s,e,i+s-o,o),t.lineTo(e,i+o),t.arcTo(e,i,e+o,i,o),t.closePath()):t.rect(e,i,r,s)};t.exports=function(t,e,i,o){i.addToRenderList(e);var h=t.currentContext;if(n(t,h,e,i,o)){var l=e._displayOriginX,u=e._displayOriginY;e.isFilled&&(r(h,e),e.isRounded?(h.beginPath(),a(h,-l,-u,e.width,e.height,e.radius),h.fill()):h.fillRect(-l,-u,e.width,e.height)),e.isStroked&&(s(h,e),h.beginPath(),e.isRounded?a(h,-l,-u,e.width,e.height,e.radius):h.rect(-l,-u,e.width,e.height),h.stroke()),h.restore()}}},87959(t,e,i){var r=i(39429),s=i(74561);r.register("rectangle",function(t,e,i,r,n,a){return this.displayList.add(new s(this.scene,t,e,i,r,n,a))})},95597(t,e,i){var r=i(29747),s=r,n=r;s=i(52059),n=i(48682),t.exports={renderWebGL:s,renderCanvas:n}},52059(t,e,i){var r=i(10441),s=i(91296),n=i(34682),a=i(70554);t.exports=function(t,e,i,o){var h=i.camera;h.addToRenderList(e);var l=s(e,h,o,!i.useCanvas).calc,u=e._displayOriginX,d=e._displayOriginY,c=e.alpha,f=e.customRenderNodes,p=e.defaultRenderNodes,g=f.Submitter||p.Submitter;if(e.isFilled)if(e.isRounded)r(i,g,l,e,c,u,d);else{var m=a.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*c);(f.FillRect||p.FillRect).run(i,l,g,-u,-d,e.width,e.height,m,m,m,m,e.lighting)}e.isStroked&&n(i,g,l,e,c,u,d)}},55911(t,e,i){var r=i(81991),s=i(83419),n=i(94811),a=i(17803),o=new s({Extends:a,Mixins:[r],initialize:function(t,e,i,r,s,n,o,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=5),void 0===s&&(s=32),void 0===n&&(n=64),a.call(this,t,"Star",null),this._points=r,this._innerRadius=s,this._outerRadius=n,this.setPosition(e,i),this.setSize(2*n,2*n),void 0!==o&&this.setFillStyle(o,h),this.updateDisplayOrigin(),this.updateData()},setPoints:function(t){return this._points=t,this.updateData()},setInnerRadius:function(t){return this._innerRadius=t,this.updateData()},setOuterRadius:function(t){return this._outerRadius=t,this.updateData()},points:{get:function(){return this._points},set:function(t){this._points=t,this.updateData()}},innerRadius:{get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this.updateData()}},outerRadius:{get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this.updateData()}},updateData:function(){var t=[],e=this._points,i=this._innerRadius,r=this._outerRadius,s=Math.PI/2*3,a=Math.PI/e,o=r,h=r;t.push(o,h+-r);for(var l=0;l=this.size||this.bufferUpdateSegments===this.MAX_BUFFER_UPDATE_SEGMENTS_FULL)){var e=Math.floor(t/this.bufferUpdateSegmentSize);this.bufferUpdateSegments|=1<=this.size)return this;var e=this.submitterNode.instanceBufferLayout,i=e.buffer.viewF32,r=this.memberCount*e.layout.stride;return i.set(t,r/i.BYTES_PER_ELEMENT),this.setSegmentNeedsUpdate(this.memberCount),this.memberCount++,this},addMember:function(t){if(this.memberCount>=this.size)return this;var e=this.nextMemberF32,i=this.nextMemberU32;t||(t={});var r=this.frame;if(void 0!==t.frame&&(r=t.frame.base?t.frame.base:t.frame),"string"==typeof r&&!(r=this.texture.get(r)))return this;var s=0;this._setAnimatedValue(t.x,s),s+=4,this._setAnimatedValue(t.y,s),s+=4,this._setAnimatedValue(t.rotation,s),s+=4,this._setAnimatedValue(t.scaleX,s,1),s+=4,this._setAnimatedValue(t.scaleY,s,1),s+=4,this._setAnimatedValue(t.alpha,s,1),s+=4;var n=t.animation;if(n){var a;if("string"==typeof n||"number"==typeof n)a="string"==typeof n?this.animationDataNames[n]:this.animationDataIndices[n],this._setAnimatedValue({base:a.index,amplitude:a.frameCount,duration:a.duration,ease:h.Linear,yoyo:!1},s);else{var o=n.base;a="string"==typeof o?this.animationDataNames[o]:"number"==typeof o?this.animationDataIndices[o]:this.animationData[0],this._setAnimatedValue({base:a.index,amplitude:"number"==typeof n.amplitude?n.amplitude:a.frameCount,duration:n.duration||a.duration,delay:n.delay||0,ease:n.ease||h.Linear,yoyo:!!n.yoyo},s)}}else{var l=this.frameDataIndices[r.name],u=t.frame;u&&void 0!==u.base?this._setAnimatedValue({base:l,amplitude:u.amplitude,duration:u.duration,delay:u.delay,ease:u.ease,yoyo:u.yoyo},s):this._setAnimatedValue(l,s)}s+=4,this._setAnimatedValue(t.tintBlend,s,1),s+=4;var c=void 0===t.tintBottomLeft?16777215:t.tintBottomLeft,f=void 0===t.tintTopLeft?16777215:t.tintTopLeft,p=void 0===t.tintBottomRight?16777215:t.tintBottomRight,g=void 0===t.tintTopRight?16777215:t.tintTopRight,m=void 0===t.alphaBottomLeft?1:t.alphaBottomLeft,v=void 0===t.alphaTopLeft?1:t.alphaTopLeft,y=void 0===t.alphaBottomRight?1:t.alphaBottomRight,x=void 0===t.alphaTopRight?1:t.alphaTopRight;return i[s++]=d(c,m),i[s++]=d(f,v),i[s++]=d(p,y),i[s++]=d(g,x),e[s++]=void 0===t.originX?.5:t.originX,e[s++]=void 0===t.originY?.5:t.originY,e[s++]=t.tintMode||0,e[s++]=void 0===t.creationTime?this.timeElapsed:t.creationTime,e[s++]=void 0===t.scrollFactorX?1:t.scrollFactorX,e[s++]=void 0===t.scrollFactorY?1:t.scrollFactorY,this.addData(this.nextMemberF32),this},editMember:function(t,e){if(t<0||t>=this.memberCount)return this;var i=this.memberCount;return this.memberCount=t,this.addMember(e),this.memberCount=i,this},patchMember:function(t,e,i){if(!(t<0||t>=this.memberCount)){var r=this.submitterNode.instanceBufferLayout,s=r.buffer,n=t*r.layout.stride,a=s.viewU32,o=n/4;if(i)for(var h=0;h=this.memberCount)return null;var e=this.submitterNode.instanceBufferLayout,i=e.buffer,r=t*e.layout.stride,s=i.viewF32,n=i.viewU32,a={},o=r/s.BYTES_PER_ELEMENT;a.x=this._getAnimatedValue(o),o+=4,a.y=this._getAnimatedValue(o),o+=4,a.rotation=this._getAnimatedValue(o),o+=4,a.scaleX=this._getAnimatedValue(o),o+=4,a.scaleY=this._getAnimatedValue(o),o+=4,a.alpha=this._getAnimatedValue(o),o+=4;var h=this._getAnimatedValue(o);o+=4,"number"!=typeof h&&(h=h.base);var l=this.frameDataIndicesInv[h];if(void 0===l){var u=this.animationDataIndices[h];u&&(a.animation=u.name)}else a.frame=l;return a.tintBlend=this._getAnimatedValue(o),o+=4,a.tintBottomLeft=n[o++],a.tintTopLeft=n[o++],a.tintBottomRight=n[o++],a.tintTopRight=n[o++],a.alphaBottomLeft=(a.tintBottomLeft>>>24)/255,a.alphaTopLeft=(a.tintTopLeft>>>24)/255,a.alphaBottomRight=(a.tintBottomRight>>>24)/255,a.alphaTopRight=(a.tintTopRight>>>24)/255,a.tintBottomLeft&=16777215,a.tintTopLeft&=16777215,a.tintBottomRight&=16777215,a.tintTopRight&=16777215,a.originX=s[o++],a.originY=s[o++],a.tintMode=s[o++],a.creationTime=s[o++],a.scrollFactorX=s[o++],a.scrollFactorY=s[o++],a},getMemberData:function(t,e){if(t<0||t>=this.memberCount)return null;var i=this.submitterNode.instanceBufferLayout,r=i.buffer,s=i.layout.stride,n=t*s;e||(e=this.nextMemberU32);var a=r.viewU32,o=a.BYTES_PER_ELEMENT;return e.set(a.subarray(n/o,n/o+s/o)),e},removeMembers:function(t,e){if(t<0||t>=this.memberCount)return this;void 0===e&&(e=1),e=Math.min(e,this.memberCount-t);var i=this.submitterNode.instanceBufferLayout,r=i.layout.stride,s=t*r,n=e*r,a=i.buffer.viewU8;a.set(a.subarray(s+n),s);for(var o=t;othis.memberCount)return this;Array.isArray(e)||(e=[e]);var i=this.memberCount,r=this.submitterNode.instanceBufferLayout,s=r.layout.stride,n=t*s,a=e.length*s;r.buffer.viewU8.copyWithin(n+a,n,i*s),this.memberCount=t;for(var o=0;othis.memberCount)return this;var i=e.length*e.BYTES_PER_ELEMENT,r=this.submitterNode.instanceBufferLayout,s=r.layout.stride,n=t*s;r.buffer.viewU8.copyWithin(n+i,n,this.memberCount*s),r.buffer.viewU32.set(e,n/e.BYTES_PER_ELEMENT),this.memberCount=Math.min(this.size,this.memberCount+i/s);for(var a=t;a=1?p=0:p<-1&&(p=-.999),p=(p+1)/2,a=Math.floor(f)+p}(l=o>0?l/o%2:0)<0&&(l+=2),l/=2,l+=n,u&&(o=-o),d||(l=-l),r[e++]=s,r[e++]=a,r[e++]=o,r[e]=l}},_getAnimatedValue:function(t){var e=this.submitterNode.instanceBufferLayout.buffer.viewF32,i=e[t++],r=e[t++],s=e[t++],n=e[t];if(0===r||0===s||0===o)return i;n>0||(n=-n);var a=s<0;a&&(s=-s);var o=Math.floor(n);if(n=(n-=o)*s*2%s,o===h.Gravity){var l=Math.floor(r),u=2*(r-l)-1;return 0===u&&(u=1),{base:i,ease:o,duration:s,delay:n,yoyo:a,velocity:l,gravityFactor:u}}return{base:i,ease:o,amplitude:r,duration:s,delay:n,yoyo:a}},setAnimationEnabled:function(t,e){return this._animationsEnabled[t]=!!e,this},preDestroy:function(){this.frameDataTexture.destroy()}});t.exports=c},16193(t,e,i){var r=i(10312),s=i(44603),n=i(23568),a=i(76573);s.register("spriteGPULayer",function(t,e){void 0===t&&(t={});var i=n(t,"key",null),s=n(t,"size",1),o=new a(this.scene,i,s);return void 0!==e&&(t.add=e),o.alpha=n(t,"alpha",1),o.blendMode=n(t,"blendMode",r.NORMAL),o.visible=n(t,"visible",!0),e&&this.scene.sys.displayList.add(o),o})},96019(t,e,i){var r=i(76573);i(39429).register("spriteGPULayer",function(t,e){return this.displayList.add(new r(this.scene,t,e))})},71238(t,e,i){var r=i(29747),s=i(97591),n=r;t.exports={renderWebGL:s,renderCanvas:n}},97591(t){t.exports=function(t,e,i,r){i.camera.addToRenderList(e);var s=e.customRenderNodes,n=e.defaultRenderNodes;(s.Submitter||n.Submitter).run(i)}},14727(t,e,i){var r=i(78705),s=i(83419),n=i(88571),a=i(74759),o=new s({Extends:n,Mixins:[a],initialize:function(t,e,i,r,s){n.call(this,t,e,i,r,s),this.type="Stamp"},_defaultRenderNodesMap:{get:function(){return r}}});t.exports=o},656(t,e,i){var r=new(i(61340));t.exports=function(t,e,i){i.addToRenderList(e),r.copyFrom(i.matrix),i.matrix.loadIdentity();var s=i.scrollX,n=i.scrollY;i.scrollX=0,i.scrollY=0,t.batchSprite(e,e.frame,i),i.scrollX=s,i.scrollY=n,i.matrix.copyFrom(r)}},31479(t,e,i){var r=i(25305),s=i(44603),n=i(23568),a=i(14727);s.register("stamp",function(t,e){void 0===t&&(t={});var i=n(t,"key",null),s=n(t,"frame",null),o=new a(this.scene,0,0,i,s);return void 0!==e&&(t.add=e),r(this.scene,o,t),o})},85326(t,e,i){var r=i(14727);i(39429).register("stamp",function(t,e,i,s){return this.displayList.add(new r(this.scene,t,e,i,s))})},74759(t,e,i){var r=i(29747);r=i(656),t.exports={renderCanvas:r}},14220(t){t.exports=function(t,e,i){var r=t.canvas,s=t.context,n=t.style,a=[],o=0,h=i.length;n.maxLines>0&&n.maxLines1&&(d+=l*(c.length-1))}n.wordWrap&&(d-=s.measureText(" ").width),a[u]=Math.ceil(d),o=Math.max(o,a[u])}var p=e.fontSize+n.strokeThickness,g=p*h,m=t.lineSpacing;return h>1&&(g+=m*(h-1)),{width:o,height:g,lines:h,lineWidths:a,lineSpacing:m,lineHeight:p}}},79557(t,e,i){var r=i(27919);t.exports=function(t){var e=r.create(this),i=e.getContext("2d",{willReadFrequently:!0});t.syncFont(e,i);var s=i.measureText(t.testString);if("actualBoundingBoxAscent"in s){var n=s.actualBoundingBoxAscent,a=s.actualBoundingBoxDescent;return r.remove(e),{ascent:n,descent:a,fontSize:n+a}}var o=Math.ceil(s.width*t.baselineX),h=o,l=2*h;h=h*t.baselineY|0,e.width=o,e.height=l,i.fillStyle="#f00",i.fillRect(0,0,o,l),i.font=t._font,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(t.testString,0,h);var u={ascent:0,descent:0,fontSize:0},d=i.getImageData(0,0,o,l);if(!d)return u.ascent=h,u.descent=h+6,u.fontSize=u.ascent+u.descent,r.remove(e),u;var c,f,p=d.data,g=p.length,m=4*o,v=0,y=!1;for(c=0;ch;c--){for(f=0;fu){if(0===c){for(var v=p;v.length;){var y=(v=v.slice(0,-1)).length*this.letterSpacing;if((m=e.measureText(v).width+y)<=u)break}if(!v.length)throw new Error("wordWrapWidth < a single character");var x=f.substr(v.length);d[c]=x,h+=v}var T=d[c].length?c:c+1,w=d.slice(T).join(" ").replace(/[ \n]*$/gi,"");s.splice(a+1,0,w),n=s.length;break}h+=p,u-=m}r+=h.replace(/[ \n]*$/gi,"")+"\n"}}return r=r.replace(/[\s|\n]*$/gi,"")},basicWordWrap:function(t,e,i){for(var r="",s=t.split(this.splitRegExp),n=s.length-1,a=e.measureText(" ").width,o=0;o<=n;o++){for(var h=i,l=s[o].split(" "),u=l.length-1,d=0;d<=u;d++){var c=l[d],f=c.length*this.letterSpacing,p=e.measureText(c).width+f,g=p;dh&&d>0&&(r+="\n",h=i),r+=c,d0&&(c+=h.lineSpacing*g),i.rtl)d=f-d-u.left-u.right;else if("right"===i.align)d+=a-h.lineWidths[g];else if("center"===i.align)d+=(a-h.lineWidths[g])/2;else if("justify"===i.align){if(h.lineWidths[g]/h.width>=.85){var m=h.width-h.lineWidths[g],v=e.measureText(" ").width,y=o[g].trim(),x=y.split(" ");m+=(o[g].length-y.length)*v;for(var T=Math.floor(m/v),w=0;T>0;)x[w]+=" ",w=(w+1)%(x.length-1||1),--T;o[g]=x.join(" ")}}this.autoRound&&(d=Math.round(d),c=Math.round(c));var b=this.letterSpacing;if(i.strokeThickness&&0===b&&(i.syncShadow(e,i.shadowStroke),e.strokeText(o[g],d,c)),i.color)if(i.syncShadow(e,i.shadowFill),0!==b)for(var S=0,C=o[g].split(""),E=0;E2?a[o++]:"",r=a[o++]||"16px",i=a[o++]||"Courier"}return i===this.fontFamily&&r===this.fontSize&&s===this.fontStyle||(this.fontFamily=i,this.fontSize=r,this.fontStyle=s,e&&this.update(!0)),this.parent},setFontFamily:function(t){return this.fontFamily!==t&&(this.fontFamily=t,this.update(!0)),this.parent},setFontStyle:function(t){return this.fontStyle!==t&&(this.fontStyle=t,this.update(!0)),this.parent},setFontSize:function(t){return"number"==typeof t&&(t=t.toString()+"px"),this.fontSize!==t&&(this.fontSize=t,this.update(!0)),this.parent},setTestString:function(t){return this.testString=t,this.update(!0)},setFixedSize:function(t,e){return this.fixedWidth=t,this.fixedHeight=e,t&&(this.parent.width=t),e&&(this.parent.height=e),this.update(!1)},setBackgroundColor:function(t){return this.backgroundColor=t,this.update(!1)},setFill:function(t){return this.color=t,this.update(!1)},setColor:function(t){return this.color=t,this.update(!1)},setResolution:function(t){return this.resolution=t,this.update(!1)},setStroke:function(t,e){return void 0===e&&(e=this.strokeThickness),void 0===t&&0!==this.strokeThickness?(this.strokeThickness=0,this.update(!0)):this.stroke===t&&this.strokeThickness===e||(this.stroke=t,this.strokeThickness=e,this.update(!0)),this.parent},setShadow:function(t,e,i,r,s,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i="#000"),void 0===r&&(r=0),void 0===s&&(s=!1),void 0===n&&(n=!0),this.shadowOffsetX=t,this.shadowOffsetY=e,this.shadowColor=i,this.shadowBlur=r,this.shadowStroke=s,this.shadowFill=n,this.update(!1)},setShadowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.shadowOffsetX=t,this.shadowOffsetY=e,this.update(!1)},setShadowColor:function(t){return void 0===t&&(t="#000"),this.shadowColor=t,this.update(!1)},setShadowBlur:function(t){return void 0===t&&(t=0),this.shadowBlur=t,this.update(!1)},setShadowStroke:function(t){return this.shadowStroke=t,this.update(!1)},setShadowFill:function(t){return this.shadowFill=t,this.update(!1)},setWordWrapWidth:function(t,e){return void 0===e&&(e=!1),this.wordWrapWidth=t,this.wordWrapUseAdvanced=e,this.update(!1)},setWordWrapCallback:function(t,e){return void 0===e&&(e=null),this.wordWrapCallback=t,this.wordWrapCallbackScope=e,this.update(!1)},setAlign:function(t){return void 0===t&&(t="left"),this.align=t,this.update(!1)},setMaxLines:function(t){return void 0===t&&(t=0),this.maxLines=t,this.update(!1)},getTextMetrics:function(){var t=this.metrics;return{ascent:t.ascent,descent:t.descent,fontSize:t.fontSize}},toJSON:function(){var t={};for(var e in o)t[e]=this[e];return t.metrics=this.getTextMetrics(),t},destroy:function(){this.parent=void 0}});t.exports=h},34397(t){t.exports=function(t,e,i,r){if(0!==e.width&&0!==e.height){i.camera.addToRenderList(e);var s=e.customRenderNodes,n=e.defaultRenderNodes;(s.Submitter||n.Submitter).run(i,e,r,0,s.Texturer||n.Texturer,s.Transformer||n.Transformer)}}},20839(t,e,i){var r=i(9674),s=i(27919),n=i(41571),a=i(83419),o=i(31401),h=i(95643),l=i(68703),u=i(56295),d=i(45650),c=i(26099),f=new a({Extends:h,Mixins:[o.Alpha,o.BlendMode,o.ComputedSize,o.Depth,o.Flip,o.GetBounds,o.Lighting,o.Mask,o.Origin,o.RenderNodes,o.ScrollFactor,o.Texture,o.Tint,o.Transform,o.Visible,u],initialize:function(t,e,i,n,a,o,l){var u=t.sys.renderer,f=u&&!u.gl;h.call(this,t,"TileSprite");var p=t.sys.textures.get(o).get(l);n=n?Math.floor(n):p.width,a=a?Math.floor(a):p.height,this._tilePosition=new c,this._tileScale=new c(1,1),this._tileRotation=0,this.dirty=!1,this.renderer=u,this.canvas=f?s.create(this,n,a):null,this.context=f?this.canvas.getContext("2d",{willReadFrequently:!1}):null,this._displayTextureKey=d(),this.displayTexture=f?t.sys.textures.addCanvas(this._displayTextureKey,this.canvas):null,this.displayFrame=this.displayTexture?this.displayTexture.get():null,this.currentFrame=null,this.fillCanvas=f?s.create2D(this,p.width,this.displayFrame.height):null,this.fillContext=this.fillCanvas?this.fillCanvas.getContext("2d",{willReadFrequently:!1}):null,this.fillPattern=null,this.anims=new r(this),this.setTexture(o,l),this.setPosition(e,i),this.setSize(n,a),this.setOrigin(.5,.5),this.initRenderNodes(this._defaultRenderNodesMap)},_defaultRenderNodesMap:{get:function(){return n}},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(t,e){this.anims.update(t,e)},setFrame:function(t){var e=this.texture.get(t);return e.cutWidth&&e.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this.frame=e,this.dirty=!0,this},setSizeToFrame:function(){return this},setTilePosition:function(t,e){return void 0!==t&&(this.tilePositionX=t),void 0!==e&&(this.tilePositionY=e),this},setTileRotation:function(t){return void 0===t&&(t=0),this.tileRotation=t,this},setTileScale:function(t,e){return void 0===t&&(t=this.tileScaleX),void 0===e&&(e=t),this.tileScaleX=t,this.tileScaleY=e,this},updateTileTexture:function(){if(this.renderer&&!this.renderer.gl){var t=this.frame,e=this.fillContext,i=this.fillCanvas,r=t.cutWidth,s=t.cutHeight;e.clearRect(0,0,r,s),i.width=r,i.height=s,e.drawImage(t.source.image,t.cutX,t.cutY,t.cutWidth,t.cutHeight,0,0,r,s),this.fillPattern=e.createPattern(i,"repeat"),this.currentFrame=t}},updateCanvas:function(){var t=this.canvas,e=this.width,i=this.height,r=this.currentFrame!==this.frame;if((t.width!==e||t.height!==i||r)&&(t.width=e,t.height=i,this.displayFrame.setSize(e,i),this.updateDisplayOrigin(),r&&this.updateTileTexture(),this.dirty=!0),!this.dirty||this.renderer&&this.renderer.gl)this.dirty=!1;else{var s=this.context;this.scene.sys.game.config.antialias||l.disable(s);var n=this._tileScale.x,a=this._tileScale.y,o=this._tilePosition.x,h=this._tilePosition.y;s.clearRect(0,0,e,i),s.save(),s.rotate(this._tileRotation),s.scale(n,a),s.translate(-o,-h),s.fillStyle=this.fillPattern;var u=Math.max(e,Math.abs(e/n)),d=Math.max(i,Math.abs(i/a)),c=Math.sqrt(u*u+d*d);s.fillRect(o-c,h-c,2*c,2*c),s.restore(),this.dirty=!1}},setSize:function(t,e){this.width=t,this.height=e,this.updateDisplayOrigin();var i=this.input;return i&&!i.customHitArea&&(i.hitArea.width=t,i.hitArea.height=e),this},preDestroy:function(){this.canvas&&s.remove(this.canvas),this.fillCanvas&&s.remove(this.fillCanvas),this.fillPattern=null,this.fillContext=null,this.fillCanvas=null,this.displayTexture=null,this.displayFrame=null,this.renderer=null,this.anims.destroy(),this.anims=void 0},tilePositionX:{get:function(){return this._tilePosition.x},set:function(t){this._tilePosition.x=t,this.dirty=!0}},tilePositionY:{get:function(){return this._tilePosition.y},set:function(t){this._tilePosition.y=t,this.dirty=!0}},tileRotation:{get:function(){return this._tileRotation},set:function(t){this._tileRotation=t,this.dirty=!0}},tileScaleX:{get:function(){return this._tileScale.x},set:function(t){this._tileScale.x=t,this.dirty=!0}},tileScaleY:{get:function(){return this._tileScale.y},set:function(t){this._tileScale.y=t,this.dirty=!0}}});t.exports=f},46992(t){t.exports=function(t,e,i,r){e.updateCanvas(),i.addToRenderList(e),t.batchSprite(e,e.displayFrame,i,r)}},14167(t,e,i){var r=i(25305),s=i(44603),n=i(23568),a=i(20839);s.register("tileSprite",function(t,e){void 0===t&&(t={});var i=n(t,"x",0),s=n(t,"y",0),o=n(t,"width",512),h=n(t,"height",512),l=n(t,"key",""),u=n(t,"frame",""),d=new a(this.scene,i,s,o,h,l,u);return void 0!==e&&(t.add=e),r(this.scene,d,t),d})},91681(t,e,i){var r=i(20839);i(39429).register("tileSprite",function(t,e,i,s,n,a){return this.displayList.add(new r(this.scene,t,e,i,s,n,a))})},56295(t,e,i){var r=i(29747),s=r,n=r;s=i(18553),n=i(46992),t.exports={renderWebGL:s,renderCanvas:n}},18553(t){t.exports=function(t,e,i,r){var s=e.width,n=e.height;if(0!==s&&0!==n){i.camera.addToRenderList(e);var a=e.customRenderNodes,o=e.defaultRenderNodes;(a.Submitter||o.Submitter).run(i,e,r,0,a.Texturer||o.Texturer,a.Transformer||o.Transformer)}}},18471(t,e,i){var r=i(45319),s=i(40939),n=i(83419),a=i(31401),o=i(51708),h=i(8443),l=i(95643),u=i(36383),d=i(14463),c=i(45650),f=i(10247),p=new n({Extends:l,Mixins:[a.Alpha,a.BlendMode,a.ComputedSize,a.Depth,a.Flip,a.GetBounds,a.Lighting,a.Mask,a.Origin,a.RenderNodes,a.ScrollFactor,a.TextureCrop,a.Tint,a.Transform,a.Visible,f],initialize:function(t,e,i,r){l.call(this,t,"Video"),this.video,this.videoTexture,this.videoTextureSource,this.snapshotTexture,this.glFlipY=!0,this._key=c(),this.touchLocked=!1,this.playWhenUnlocked=!1,this.frameReady=!1,this.isStalled=!1,this.failedPlayAttempts=0,this.metadata,this.retry=0,this.retryInterval=500,this._systemMuted=!1,this._codeMuted=!1,this._systemPaused=!1,this._codePaused=!1,this._callbacks={ended:this.completeHandler.bind(this),legacy:this.legacyPlayHandler.bind(this),playing:this.playingHandler.bind(this),seeked:this.seekedHandler.bind(this),seeking:this.seekingHandler.bind(this),stalled:this.stalledHandler.bind(this),suspend:this.stalledHandler.bind(this),waiting:this.stalledHandler.bind(this)},this._loadCallbackHandler=this.loadErrorHandler.bind(this),this._metadataCallbackHandler=this.metadataHandler.bind(this),this._crop=this.resetCropObject(),this.markers={},this._markerIn=0,this._markerOut=0,this._playingMarker=!1,this._lastUpdate=0,this.cacheKey="",this.isSeeking=!1,this._playCalled=!1,this._getFrame=!1,this._rfvCallbackId=0;var s=t.sys.game;this._device=s.device.video,this.setPosition(e,i),this.setSize(256,256),this.initRenderNodes(this._defaultRenderNodesMap),s.events.on(h.PAUSE,this.globalPause,this),s.events.on(h.RESUME,this.globalResume,this);var n=t.sys.sound;n&&n.on(d.GLOBAL_MUTE,this.globalMute,this),r&&this.load(r)},_defaultRenderNodesMap:{get:function(){return s}},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},load:function(t){var e=this.scene.sys.cache.video.get(t);return e?(this.cacheKey=t,this.loadHandler(e.url,e.noAudio,e.crossOrigin)):console.warn("No video in cache for key: "+t),this},changeSource:function(t,e,i,r,s){void 0===e&&(e=!0),void 0===i&&(i=!1),this.cacheKey!==t&&(this.load(t),e&&this.play(i,r,s))},getVideoKey:function(){return this.cacheKey},loadURL:function(t,e,i){void 0===e&&(e=!1);var r=this._device.getVideoURL(t);return r?(this.cacheKey="",this.loadHandler(r.url,e,i)):console.warn("No supported video format found for "+t),this},loadMediaStream:function(t,e,i){return this.loadHandler(null,e,i,t)},loadHandler:function(t,e,i,r){e||(e=!1);var s=this.video;if(s?(this.removeLoadEventHandlers(),this.stop()):((s=document.createElement("video")).controls=!1,s.setAttribute("playsinline","playsinline"),s.setAttribute("preload","auto"),s.setAttribute("disablePictureInPicture","true")),e?(s.muted=!0,s.defaultMuted=!0,s.setAttribute("autoplay","autoplay")):(s.muted=!1,s.defaultMuted=!1,s.removeAttribute("autoplay")),i?s.setAttribute("crossorigin",i):s.removeAttribute("crossorigin"),r)if("srcObject"in s)try{s.srcObject=r}catch(t){if("TypeError"!==t.name)throw t;s.src=URL.createObjectURL(r)}else s.src=URL.createObjectURL(r);else s.src=t;this.retry=0,this.video=s,this._playCalled=!1,s.load(),this.addLoadEventHandlers();var n=this.scene.sys.textures.get(this._key);return this.setTexture(n),this},requestVideoFrame:function(t,e){var i=this.video;if(i){var r=e.width,s=e.height,n=this.videoTexture,a=this.videoTextureSource,h=!n||a.source!==i;h?(this._codePaused=i.paused,this._codeMuted=i.muted,n?(a.source=i,a.width=r,a.height=s,n.get().setSize(r,s)):((n=this.scene.sys.textures.create(this._key,i,r,s)).add("__BASE",0,0,0,r,s),this.setTexture(n),this.videoTexture=n,this.videoTextureSource=n.source[0],this.videoTextureSource.setFlipY(this.glFlipY),this.emit(o.VIDEO_TEXTURE,this,n)),this.setSizeToFrame(),this.updateDisplayOrigin()):a.update(),this.isStalled=!1,this.metadata=e;var l=e.mediaTime;h&&(this._lastUpdate=l,this.emit(o.VIDEO_CREATED,this,r,s),this.frameReady||(this.frameReady=!0,this.emit(o.VIDEO_PLAY,this))),this._playingMarker?l>=this._markerOut&&(i.loop?(i.currentTime=this._markerIn,this.emit(o.VIDEO_LOOP,this)):(this.stop(!1),this.emit(o.VIDEO_COMPLETE,this))):l-1&&i>e&&i=0&&!isNaN(i)&&i>e&&(this.markers[t]=[e,i]),this},playMarker:function(t,e){var i=this.markers[t];return i&&this.play(e,i[0],i[1]),this},removeMarker:function(t){return delete this.markers[t],this},snapshot:function(t,e){return void 0===t&&(t=this.width),void 0===e&&(e=this.height),this.snapshotArea(0,0,this.width,this.height,t,e)},snapshotArea:function(t,e,i,r,s,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===r&&(r=this.height),void 0===s&&(s=i),void 0===n&&(n=r);var a=this.video,o=this.snapshotTexture;return o?(o.setSize(s,n),a&&o.context.drawImage(a,t,e,i,r,0,0,s,n)):(o=this.scene.sys.textures.createCanvas(c(),s,n),this.snapshotTexture=o,a&&o.context.drawImage(a,t,e,i,r,0,0,s,n)),o.update()},saveSnapshotTexture:function(t){return this.snapshotTexture?this.scene.sys.textures.renameTexture(this.snapshotTexture.key,t):this.snapshotTexture=this.scene.sys.textures.createCanvas(t,this.width,this.height),this.snapshotTexture},playSuccess:function(){if(this._playCalled){this.addEventHandlers(),this._codePaused=!1,this.touchLocked&&(this.touchLocked=!1,this.emit(o.VIDEO_UNLOCKED,this));var t=this.scene.sys.sound;t&&t.mute&&this.setMute(!0),this._markerIn>-1&&(this.video.currentTime=this._markerIn)}},playError:function(t){var e=t.name;"NotAllowedError"===e?(this.touchLocked=!0,this.playWhenUnlocked=!0,this.failedPlayAttempts=1,this.emit(o.VIDEO_LOCKED,this)):"NotSupportedError"===e?(this.stop(!1),this.emit(o.VIDEO_UNSUPPORTED,this,t)):(this.stop(!1),this.emit(o.VIDEO_ERROR,this,t))},legacyPlayHandler:function(){var t=this.video;t&&(this.playSuccess(),t.removeEventListener("playing",this._callbacks.legacy))},playingHandler:function(){this.isStalled=!1,this.emit(o.VIDEO_PLAYING,this)},loadErrorHandler:function(t){this.stop(!1),this.emit(o.VIDEO_ERROR,this,t)},metadataHandler:function(t){this.emit(o.VIDEO_METADATA,this,t)},setSizeToFrame:function(t){t||(t=this.frame),this.width=t.realWidth,this.height=t.realHeight,1!==this.scaleX&&(this.scaleX=this.displayWidth/this.width),1!==this.scaleY&&(this.scaleY=this.displayHeight/this.height);var e=this.input;return e&&!e.customHitArea&&(e.hitArea.width=this.width,e.hitArea.height=this.height),this},stalledHandler:function(t){this.isStalled=!0,this.emit(o.VIDEO_STALLED,this,t)},completeHandler:function(){this._playCalled=!1,this.emit(o.VIDEO_COMPLETE,this)},preUpdate:function(t,e){this.video&&this._playCalled&&this.touchLocked&&this.playWhenUnlocked&&(this.retry+=e,this.retry>=this.retryInterval&&(this.createPlayPromise(!1),this.retry=0))},seekTo:function(t){var e=this.video;if(e){var i=e.duration;if(i!==1/0&&!isNaN(i)){var r=i*t;this.setCurrentTime(r)}}return this},getCurrentTime:function(){return this.video?this.video.currentTime:0},setCurrentTime:function(t){var e=this.video;if(e){if("string"==typeof t){var i=t[0],r=parseFloat(t.substr(1));"+"===i?t=e.currentTime+r:"-"===i&&(t=e.currentTime-r)}e.currentTime=t}return this},seekingHandler:function(){this.isSeeking=!0,this.emit(o.VIDEO_SEEKING,this)},seekedHandler:function(){this.isSeeking=!1,this.emit(o.VIDEO_SEEKED,this)},getProgress:function(){var t=this.video;if(t){var e=t.duration;if(e!==1/0&&!isNaN(e))return t.currentTime/e}return-1},getDuration:function(){return this.video?this.video.duration:0},setMute:function(t){void 0===t&&(t=!0),this._codeMuted=t;var e=this.video;return e&&(e.muted=!!this._systemMuted||t),this},isMuted:function(){return this._codeMuted},globalMute:function(t,e){this._systemMuted=e;var i=this.video;i&&(i.muted=!!this._codeMuted||e)},globalPause:function(){this._systemPaused=!0,this.video&&!this.video.ended&&(this.removeEventHandlers(),this.video.pause())},globalResume:function(){this._systemPaused=!1,!this.video||this._codePaused||this.video.ended||this.createPlayPromise()},setPaused:function(t){void 0===t&&(t=!0);var e=this.video;return this._codePaused=t,e&&!e.ended&&(t?e.paused||(this.removeEventHandlers(),e.pause()):t||(this._playCalled?e.paused&&!this._systemPaused&&this.createPlayPromise():this.play())),this},pause:function(){return this.setPaused(!0)},resume:function(){return this.setPaused(!1)},getVolume:function(){return this.video?this.video.volume:1},setVolume:function(t){return void 0===t&&(t=1),this.video&&(this.video.volume=r(t,0,1)),this},getPlaybackRate:function(){return this.video?this.video.playbackRate:1},setPlaybackRate:function(t){return this.video&&(this.video.playbackRate=t),this},getLoop:function(){return!!this.video&&this.video.loop},setLoop:function(t){return void 0===t&&(t=!0),this.video&&(this.video.loop=t),this},isPlaying:function(){return!!this.video&&!(this.video.paused||this.video.ended)},isPaused:function(){return this.video&&this._playCalled&&this.video.paused||this._codePaused||this._systemPaused},saveTexture:function(t,e){return void 0===e&&(e=!0),this.videoTexture&&(this.scene.sys.textures.renameTexture(this._key,t),this.videoTextureSource.setFlipY(e)),this._key=t,this.glFlipY=e,!!this.videoTexture},stop:function(t){void 0===t&&(t=!0);var e=this.video;return e&&(this.removeEventHandlers(),e.cancelVideoFrameCallback(this._rfvCallbackId),e.pause()),this.retry=0,this._playCalled=!1,t&&this.emit(o.VIDEO_STOP,this),this},removeVideoElement:function(){var t=this.video;if(t){for(t.parentNode&&t.parentNode.removeChild(t);t.hasChildNodes();)t.removeChild(t.firstChild);t.removeAttribute("autoplay"),t.removeAttribute("src"),this.video=null}},preDestroy:function(){this.stop(!1),this.removeLoadEventHandlers(),this.removeVideoElement();var t=this.scene.sys.game.events;t.off(h.PAUSE,this.globalPause,this),t.off(h.RESUME,this.globalResume,this);var e=this.scene.sys.sound;e&&e.off(d.GLOBAL_MUTE,this.globalMute,this)}});t.exports=p},58352(t){t.exports=function(t,e,i,r){e.videoTexture&&(i.addToRenderList(e),t.batchSprite(e,e.frame,i,r))}},11511(t,e,i){var r=i(25305),s=i(44603),n=i(23568),a=i(18471);s.register("video",function(t,e){void 0===t&&(t={});var i=n(t,"key",null),s=new a(this.scene,0,0,i);return void 0!==e&&(t.add=e),r(this.scene,s,t),s})},89025(t,e,i){var r=i(18471);i(39429).register("video",function(t,e,i){return this.displayList.add(new r(this.scene,t,e,i))})},10247(t,e,i){var r=i(29747),s=r,n=r;s=i(29849),n=i(58352),t.exports={renderWebGL:s,renderCanvas:n}},29849(t){t.exports=function(t,e,i,r){if(e.videoTexture){i.camera.addToRenderList(e);var s=e.customRenderNodes,n=e.defaultRenderNodes;(s.Submitter||n.Submitter).run(i,e,r,0,s.Texturer||n.Texturer,s.Transformer||n.Transformer)}}},41481(t,e,i){var r=i(10312),s=i(96503),n=i(87902),a=i(83419),o=i(31401),h=i(95643),l=i(87841),u=i(37303),d=new a({Extends:h,Mixins:[o.Depth,o.GetBounds,o.Origin,o.Transform,o.ScrollFactor,o.Visible],initialize:function(t,e,i,s,n){void 0===s&&(s=1),void 0===n&&(n=s),h.call(this,t,"Zone"),this.setPosition(e,i),this.width=s,this.height=n,this.blendMode=r.NORMAL,this.updateDisplayOrigin()},displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e,i){void 0===i&&(i=!0),this.width=t,this.height=e,this.updateDisplayOrigin();var r=this.input;return i&&r&&!r.customHitArea&&(r.hitArea.width=t,r.hitArea.height=e),this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this},setCircleDropZone:function(t){return this.setDropZone(new s(0,0,t),n)},setRectangleDropZone:function(t,e){return this.setDropZone(new l(0,0,t,e),u)},setDropZone:function(t,e){return this.input||this.setInteractive(t,e,!0),this},setAlpha:function(){},setBlendMode:function(){},renderCanvas:function(t,e,i){i.addToRenderList(e)},renderWebGL:function(t,e,i){i.camera.addToRenderList(e)}});t.exports=d},95261(t,e,i){var r=i(44603),s=i(23568),n=i(41481);r.register("zone",function(t){var e=s(t,"x",0),i=s(t,"y",0),r=s(t,"width",1),a=s(t,"height",r);return new n(this.scene,e,i,r,a)})},84175(t,e,i){var r=i(41481);i(39429).register("zone",function(t,e,i,s){return this.displayList.add(new r(this.scene,t,e,i,s))})},95166(t){t.exports=function(t){return t.radius>0?Math.PI*t.radius*t.radius:0}},96503(t,e,i){var r=i(83419),s=i(87902),n=i(26241),a=i(79124),o=i(23777),h=i(28176),l=new r({initialize:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this.type=o.CIRCLE,this.x=t,this.y=e,this._radius=i,this._diameter=2*i},contains:function(t,e){return s(this,t,e)},getPoint:function(t,e){return n(this,t,e)},getPoints:function(t,e,i){return a(this,t,e,i)},getRandomPoint:function(t){return h(this,t)},setTo:function(t,e,i){return this.x=t,this.y=e,this._radius=i,this._diameter=2*i,this},setEmpty:function(){return this._radius=0,this._diameter=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},isEmpty:function(){return this._radius<=0},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this._diameter=2*t}},diameter:{get:function(){return this._diameter},set:function(t){this._diameter=t,this._radius=.5*t}},left:{get:function(){return this.x-this._radius},set:function(t){this.x=t+this._radius}},right:{get:function(){return this.x+this._radius},set:function(t){this.x=t-this._radius}},top:{get:function(){return this.y-this._radius},set:function(t){this.y=t+this._radius}},bottom:{get:function(){return this.y+this._radius},set:function(t){this.y=t-this._radius}}});t.exports=l},71562(t){t.exports=function(t){return Math.PI*t.radius*2}},92110(t,e,i){var r=i(26099);t.exports=function(t,e,i){return void 0===i&&(i=new r),i.x=t.x+t.radius*Math.cos(e),i.y=t.y+t.radius*Math.sin(e),i}},42250(t,e,i){var r=i(96503);t.exports=function(t){return new r(t.x,t.y,t.radius)}},87902(t){t.exports=function(t,e,i){return t.radius>0&&e>=t.left&&e<=t.right&&i>=t.top&&i<=t.bottom&&(t.x-e)*(t.x-e)+(t.y-i)*(t.y-i)<=t.radius*t.radius}},5698(t,e,i){var r=i(87902);t.exports=function(t,e){return r(t,e.x,e.y)}},70588(t,e,i){var r=i(87902);t.exports=function(t,e){return r(t,e.x,e.y)&&r(t,e.right,e.y)&&r(t,e.x,e.bottom)&&r(t,e.right,e.bottom)}},26394(t){t.exports=function(t,e){return e.setTo(t.x,t.y,t.radius)}},76278(t){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.radius===e.radius}},2074(t,e,i){var r=i(87841);t.exports=function(t,e){return void 0===e&&(e=new r),e.x=t.left,e.y=t.top,e.width=t.diameter,e.height=t.diameter,e}},26241(t,e,i){var r=i(92110),s=i(62945),n=i(36383),a=i(26099);t.exports=function(t,e,i){void 0===i&&(i=new a);var o=s(e,0,n.TAU);return r(t,o,i)}},79124(t,e,i){var r=i(71562),s=i(92110),n=i(62945),a=i(36383);t.exports=function(t,e,i,o){void 0===o&&(o=[]),!e&&i>0&&(e=r(t)/i);for(var h=0;h1?2-s:s,a=n*Math.cos(i),o=n*Math.sin(i);return e.x=t.x+a*t.radius,e.y=t.y+o*t.radius,e}},88911(t,e,i){var r=i(96503);r.Area=i(95166),r.Circumference=i(71562),r.CircumferencePoint=i(92110),r.Clone=i(42250),r.Contains=i(87902),r.ContainsPoint=i(5698),r.ContainsRect=i(70588),r.CopyFrom=i(26394),r.Equals=i(76278),r.GetBounds=i(2074),r.GetPoint=i(26241),r.GetPoints=i(79124),r.Offset=i(50884),r.OffsetPoint=i(39212),r.Random=i(28176),t.exports=r},23777(t){t.exports={CIRCLE:0,ELLIPSE:1,LINE:2,POINT:3,POLYGON:4,RECTANGLE:5,TRIANGLE:6}},78874(t){t.exports=function(t){return t.isEmpty()?0:t.getMajorRadius()*t.getMinorRadius()*Math.PI}},92990(t){t.exports=function(t){var e=t.width/2,i=t.height/2,r=Math.pow(e-i,2)/Math.pow(e+i,2);return Math.PI*(e+i)*(1+3*r/(10+Math.sqrt(4-3*r)))}},79522(t,e,i){var r=i(26099);t.exports=function(t,e,i){void 0===i&&(i=new r);var s=t.width/2,n=t.height/2;return i.x=t.x+s*Math.cos(e),i.y=t.y+n*Math.sin(e),i}},58102(t,e,i){var r=i(8497);t.exports=function(t){return new r(t.x,t.y,t.width,t.height)}},81154(t){t.exports=function(t,e,i){if(t.width<=0||t.height<=0)return!1;var r=(e-t.x)/t.width,s=(i-t.y)/t.height;return(r*=r)+(s*=s)<.25}},46662(t,e,i){var r=i(81154);t.exports=function(t,e){return r(t,e.x,e.y)}},1632(t,e,i){var r=i(81154);t.exports=function(t,e){return r(t,e.x,e.y)&&r(t,e.right,e.y)&&r(t,e.x,e.bottom)&&r(t,e.right,e.bottom)}},65534(t){t.exports=function(t,e){return e.setTo(t.x,t.y,t.width,t.height)}},8497(t,e,i){var r=i(83419),s=i(81154),n=i(90549),a=i(48320),o=i(23777),h=i(24820),l=new r({initialize:function(t,e,i,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),this.type=o.ELLIPSE,this.x=t,this.y=e,this.width=i,this.height=r},contains:function(t,e){return s(this,t,e)},getPoint:function(t,e){return n(this,t,e)},getPoints:function(t,e,i){return a(this,t,e,i)},getRandomPoint:function(t){return h(this,t)},setTo:function(t,e,i,r){return this.x=t,this.y=e,this.width=i,this.height=r,this},setEmpty:function(){return this.width=0,this.height=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getMinorRadius:function(){return Math.min(this.width,this.height)/2},getMajorRadius:function(){return Math.max(this.width,this.height)/2},left:{get:function(){return this.x-this.width/2},set:function(t){this.x=t+this.width/2}},right:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},top:{get:function(){return this.y-this.height/2},set:function(t){this.y=t+this.height/2}},bottom:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=l},36146(t){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}},23694(t,e,i){var r=i(87841);t.exports=function(t,e){return void 0===e&&(e=new r),e.x=t.left,e.y=t.top,e.width=t.width,e.height=t.height,e}},90549(t,e,i){var r=i(79522),s=i(62945),n=i(36383),a=i(26099);t.exports=function(t,e,i){void 0===i&&(i=new a);var o=s(e,0,n.TAU);return r(t,o,i)}},48320(t,e,i){var r=i(92990),s=i(79522),n=i(62945),a=i(36383);t.exports=function(t,e,i,o){void 0===o&&(o=[]),!e&&i>0&&(e=r(t)/i);for(var h=0;ha||n>o)return!1;if(s<=i||n<=r)return!0;var h=s-i,l=n-r;return h*h+l*l<=t.radius*t.radius}},63376(t,e,i){var r=i(26099),s=i(2044);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var n,a,o,h,l=t.x,u=t.y,d=t.radius,c=e.x,f=e.y,p=e.radius;if(u===f)0===(o=(a=-2*f)*a-4*(n=1)*(c*c+(h=(p*p-d*d-c*c+l*l)/(2*(l-c)))*h-2*c*h+f*f-p*p))?i.push(new r(h,-a/(2*n))):o>0&&(i.push(new r(h,(-a+Math.sqrt(o))/(2*n))),i.push(new r(h,(-a-Math.sqrt(o))/(2*n))));else{var g=(l-c)/(u-f),m=(p*p-d*d-c*c+l*l-f*f+u*u)/(2*(u-f));0===(o=(a=2*u*g-2*m*g-2*l)*a-4*(n=g*g+1)*(l*l+u*u+m*m-d*d-2*u*m))?(h=-a/(2*n),i.push(new r(h,m-h*g))):o>0&&(h=(-a+Math.sqrt(o))/(2*n),i.push(new r(h,m-h*g)),h=(-a-Math.sqrt(o))/(2*n),i.push(new r(h,m-h*g)))}}return i}},97439(t,e,i){var r=i(4042),s=i(81491);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var n=e.getLineA(),a=e.getLineB(),o=e.getLineC(),h=e.getLineD();r(n,t,i),r(a,t,i),r(o,t,i),r(h,t,i)}return i}},4042(t,e,i){var r=i(26099),s=i(80462);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var n,a,o=t.x1,h=t.y1,l=t.x2,u=t.y2,d=e.x,c=e.y,f=e.radius,p=l-o,g=u-h,m=o-d,v=h-c,y=p*p+g*g,x=2*(p*m+g*v),T=x*x-4*y*(m*m+v*v-f*f);if(0===T){var w=-x/(2*y);n=o+w*p,a=h+w*g,w>=0&&w<=1&&i.push(new r(n,a))}else if(T>0){var b=(-x-Math.sqrt(T))/(2*y);n=o+b*p,a=h+b*g,b>=0&&b<=1&&i.push(new r(n,a));var S=(-x+Math.sqrt(T))/(2*y);n=o+S*p,a=h+S*g,S>=0&&S<=1&&i.push(new r(n,a))}}return i}},36100(t,e,i){var r=i(25836);t.exports=function(t,e,i,s){void 0===i&&(i=!1);var n,a,o,h=t.x1,l=t.y1,u=t.x2,d=t.y2,c=e.x1,f=e.y1,p=u-h,g=d-l,m=e.x2-c,v=e.y2-f,y=p*v-g*m;if(0===y)return null;if(i){if(n=(p*(f-l)+g*(h-c))/(m*g-v*p),0!==p)a=(c+m*n-h)/p;else{if(0===g)return null;a=(f+v*n-l)/g}if(a<0||n<0||n>1)return null;o=a}else{if(a=((l-f)*p-(h-c)*g)/y,(n=((c-h)*v-(f-l)*m)/y)<0||n>1||a<0||a>1)return null;o=n}return void 0===s&&(s=new r),s.set(h+p*o,l+g*o,o)}},3073(t,e,i){var r=i(36100),s=i(23031),n=i(25836),a=new s,o=new n;t.exports=function(t,e,i,s){void 0===i&&(i=!1),void 0===s&&(s=new n);var h=!1;s.set(),o.set();for(var l=e[e.length-1],u=0;u0){var c=(o*n+h*a)/l;u*=c,d*=c}return i.x=t.x1+u,i.y=t.y1+d,u*u+d*d<=l&&u*n+d*a>=0&&r(e,i.x,i.y)}},76112(t){t.exports=function(t,e,i){var r=t.x1,s=t.y1,n=t.x2,a=t.y2,o=e.x1,h=e.y1,l=e.x2,u=e.y2;if(r===n&&s===a||o===l&&h===u)return!1;var d=(u-h)*(n-r)-(l-o)*(a-s);if(0===d)return!1;var c=((l-o)*(s-h)-(u-h)*(r-o))/d,f=((n-r)*(s-h)-(a-s)*(r-o))/d;return!(c<0||c>1||f<0||f>1)&&(i&&(i.x=r+c*(n-r),i.y=s+c*(a-s)),!0)}},92773(t){t.exports=function(t,e){var i=t.x1,r=t.y1,s=t.x2,n=t.y2,a=e.x,o=e.y,h=e.right,l=e.bottom,u=0;if(i>=a&&i<=h&&r>=o&&r<=l||s>=a&&s<=h&&n>=o&&n<=l)return!0;if(i=a){if((u=r+(n-r)*(a-i)/(s-i))>o&&u<=l)return!0}else if(i>h&&s<=h&&(u=r+(n-r)*(h-i)/(s-i))>=o&&u<=l)return!0;if(r=o){if((u=i+(s-i)*(o-r)/(n-r))>=a&&u<=h)return!0}else if(r>l&&n<=l&&(u=i+(s-i)*(l-r)/(n-r))>=a&&u<=h)return!0;return!1}},16204(t){t.exports=function(t,e,i){void 0===i&&(i=1);var r=e.x1,s=e.y1,n=e.x2,a=e.y2,o=t.x,h=t.y,l=(n-r)*(n-r)+(a-s)*(a-s);if(0===l)return!1;var u=((o-r)*(n-r)+(h-s)*(a-s))/l;if(u<0)return Math.sqrt((r-o)*(r-o)+(s-h)*(s-h))<=i;if(u>=0&&u<=1){var d=((s-h)*(n-r)-(r-o)*(a-s))/l;return Math.abs(d)*Math.sqrt(l)<=i}return Math.sqrt((n-o)*(n-o)+(a-h)*(a-h))<=i}},14199(t,e,i){var r=i(16204);t.exports=function(t,e){if(!r(t,e))return!1;var i=Math.min(e.x1,e.x2),s=Math.max(e.x1,e.x2),n=Math.min(e.y1,e.y2),a=Math.max(e.y1,e.y2);return t.x>=i&&t.x<=s&&t.y>=n&&t.y<=a}},59996(t){t.exports=function(t,e){return!(t.width<=0||t.height<=0||e.width<=0||e.height<=0)&&!(t.righte.right||t.y>e.bottom)}},89265(t,e,i){var r=i(76112),s=i(37303),n=i(48653),a=i(77493);t.exports=function(t,e){if(e.left>t.right||e.rightt.bottom||e.bottom0}},84411(t){t.exports=function(t,e,i,r,s,n){return void 0===n&&(n=0),!(e>t.right+n||it.bottom+n||se.right||t.righte.bottom||t.bottome.right||t.righte.bottom||t.bottom0||(d=s(e),(c=r(t,d,!0)).length>0)}},91865(t,e,i){t.exports={CircleToCircle:i(2044),CircleToRectangle:i(81491),GetCircleToCircle:i(63376),GetCircleToRectangle:i(97439),GetLineToCircle:i(4042),GetLineToLine:i(36100),GetLineToPoints:i(3073),GetLineToPolygon:i(56362),GetLineToRectangle:i(60646),GetRaysFromPointToPolygon:i(71147),GetRectangleIntersection:i(68389),GetRectangleToRectangle:i(52784),GetRectangleToTriangle:i(26341),GetTriangleToCircle:i(38720),GetTriangleToLine:i(13882),GetTriangleToTriangle:i(75636),LineToCircle:i(80462),LineToLine:i(76112),LineToRectangle:i(92773),PointToLine:i(16204),PointToLineSegment:i(14199),RectangleToRectangle:i(59996),RectangleToTriangle:i(89265),RectangleToValues:i(84411),TriangleToCircle:i(67636),TriangleToLine:i(2822),TriangleToTriangle:i(82944)}},91938(t){t.exports=function(t){return Math.atan2(t.y2-t.y1,t.x2-t.x1)}},84993(t){t.exports=function(t,e,i){void 0===e&&(e=1),void 0===i&&(i=[]);var r=Math.round(t.x1),s=Math.round(t.y1),n=Math.round(t.x2),a=Math.round(t.y2),o=Math.abs(n-r),h=Math.abs(a-s),l=r-h&&(d-=h,r+=l),f0){var v=u[0],y=[v];for(h=1;h=a&&(y.push(x),v=x)}var T=u[u.length-1];return r(v,T)0&&(e=r(t)/i);for(var a=t.x1,o=t.y1,h=t.x2,l=t.y2,u=0;uthis.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=l},64795(t,e,i){var r=i(36383),s=i(15994),n=i(91938);t.exports=function(t){var e=n(t)-r.PI_OVER_2;return s(e,-Math.PI,Math.PI)}},52616(t,e,i){var r=i(36383),s=i(91938);t.exports=function(t){return Math.cos(s(t)-r.PI_OVER_2)}},87231(t,e,i){var r=i(36383),s=i(91938);t.exports=function(t){return Math.sin(s(t)-r.PI_OVER_2)}},89662(t){t.exports=function(t,e,i){return t.x1+=e,t.y1+=i,t.x2+=e,t.y2+=i,t}},71165(t){t.exports=function(t){return-(t.x2-t.x1)/(t.y2-t.y1)}},65822(t,e,i){var r=i(26099);t.exports=function(t,e){void 0===e&&(e=new r);var i=Math.random();return e.x=t.x1+i*(t.x2-t.x1),e.y=t.y1+i*(t.y2-t.y1),e}},69777(t,e,i){var r=i(91938),s=i(64795);t.exports=function(t,e){return 2*s(e)-Math.PI-r(t)}},39706(t,e,i){var r=i(64400);t.exports=function(t,e){var i=(t.x1+t.x2)/2,s=(t.y1+t.y2)/2;return r(t,i,s,e)}},82585(t,e,i){var r=i(64400);t.exports=function(t,e,i){return r(t,e.x,e.y,i)}},64400(t){t.exports=function(t,e,i,r){var s=Math.cos(r),n=Math.sin(r),a=t.x1-e,o=t.y1-i;return t.x1=a*s-o*n+e,t.y1=a*n+o*s+i,a=t.x2-e,o=t.y2-i,t.x2=a*s-o*n+e,t.y2=a*n+o*s+i,t}},62377(t){t.exports=function(t,e,i,r,s){return t.x1=e,t.y1=i,t.x2=e+Math.cos(r)*s,t.y2=i+Math.sin(r)*s,t}},71366(t){t.exports=function(t){return(t.y2-t.y1)/(t.x2-t.x1)}},10809(t){t.exports=function(t){return Math.abs(t.x1-t.x2)}},2529(t,e,i){var r=i(23031);r.Angle=i(91938),r.BresenhamPoints=i(84993),r.CenterOn=i(36469),r.Clone=i(31116),r.CopyFrom=i(59944),r.Equals=i(59220),r.Extend=i(78177),r.GetEasedPoints=i(26708),r.GetMidPoint=i(32125),r.GetNearestPoint=i(99569),r.GetNormal=i(34638),r.GetPoint=i(13151),r.GetPoints=i(15258),r.GetShortestDistance=i(26408),r.Height=i(98770),r.Length=i(35001),r.NormalAngle=i(64795),r.NormalX=i(52616),r.NormalY=i(87231),r.Offset=i(89662),r.PerpSlope=i(71165),r.Random=i(65822),r.ReflectAngle=i(69777),r.Rotate=i(39706),r.RotateAroundPoint=i(82585),r.RotateAroundXY=i(64400),r.SetToAngle=i(62377),r.Slope=i(71366),r.Width=i(10809),t.exports=r},12306(t,e,i){var r=i(25717);t.exports=function(t){return new r(t.points)}},63814(t){t.exports=function(t,e,i){for(var r=!1,s=-1,n=t.points.length-1;++s80*r){n=o=t[0],a=h=t[1];for(var x=r;xo&&(o=d),c>h&&(h=c);p=0!==(p=Math.max(o-n,h-a))?32767/p:0}return s(v,y,r,n,a,p,0),y}function i(t,e,i,r,s){var n,a;if(s===A(t,e,i,r)>0)for(n=e;n=e;n-=r)a=S(n,t[n],t[n+1],a);return a&&v(a,a.next)&&(C(a),a=a.next),a}function r(t,e){if(!t)return t;e||(e=t);var i,r=t;do{if(i=!1,r.steiner||!v(r,r.next)&&0!==m(r.prev,r,r.next))r=r.next;else{if(C(r),(r=e=r.prev)===r.next)break;i=!0}}while(i||r!==e);return e}function s(t,e,i,l,u,d,f){if(t){!f&&d&&function(t,e,i,r){var s=t;do{0===s.z&&(s.z=c(s.x,s.y,e,i,r)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next}while(s!==t);s.prevZ.nextZ=null,s.prevZ=null,function(t){var e,i,r,s,n,a,o,h,l=1;do{for(i=t,t=null,n=null,a=0;i;){for(a++,r=i,o=0,e=0;e0||h>0&&r;)0!==o&&(0===h||!r||i.z<=r.z)?(s=i,i=i.nextZ,o--):(s=r,r=r.nextZ,h--),n?n.nextZ=s:t=s,s.prevZ=n,n=s;i=r}n.nextZ=null,l*=2}while(a>1)}(s)}(t,l,u,d);for(var p,g,m=t;t.prev!==t.next;)if(p=t.prev,g=t.next,d?a(t,l,u,d):n(t))e.push(p.i/i|0),e.push(t.i/i|0),e.push(g.i/i|0),C(t),t=g.next,m=g.next;else if((t=g)===m){f?1===f?s(t=o(r(t),e,i),e,i,l,u,d,2):2===f&&h(t,e,i,l,u,d):s(r(t),e,i,l,u,d,1);break}}}function n(t){var e=t.prev,i=t,r=t.next;if(m(e,i,r)>=0)return!1;for(var s=e.x,n=i.x,a=r.x,o=e.y,h=i.y,l=r.y,u=sn?s>a?s:a:n>a?n:a,f=o>h?o>l?o:l:h>l?h:l,g=r.next;g!==e;){if(g.x>=u&&g.x<=c&&g.y>=d&&g.y<=f&&p(s,o,n,h,a,l,g.x,g.y)&&m(g.prev,g,g.next)>=0)return!1;g=g.next}return!0}function a(t,e,i,r){var s=t.prev,n=t,a=t.next;if(m(s,n,a)>=0)return!1;for(var o=s.x,h=n.x,l=a.x,u=s.y,d=n.y,f=a.y,g=oh?o>l?o:l:h>l?h:l,x=u>d?u>f?u:f:d>f?d:f,T=c(g,v,e,i,r),w=c(y,x,e,i,r),b=t.prevZ,S=t.nextZ;b&&b.z>=T&&S&&S.z<=w;){if(b.x>=g&&b.x<=y&&b.y>=v&&b.y<=x&&b!==s&&b!==a&&p(o,u,h,d,l,f,b.x,b.y)&&m(b.prev,b,b.next)>=0)return!1;if(b=b.prevZ,S.x>=g&&S.x<=y&&S.y>=v&&S.y<=x&&S!==s&&S!==a&&p(o,u,h,d,l,f,S.x,S.y)&&m(S.prev,S,S.next)>=0)return!1;S=S.nextZ}for(;b&&b.z>=T;){if(b.x>=g&&b.x<=y&&b.y>=v&&b.y<=x&&b!==s&&b!==a&&p(o,u,h,d,l,f,b.x,b.y)&&m(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;S&&S.z<=w;){if(S.x>=g&&S.x<=y&&S.y>=v&&S.y<=x&&S!==s&&S!==a&&p(o,u,h,d,l,f,S.x,S.y)&&m(S.prev,S,S.next)>=0)return!1;S=S.nextZ}return!0}function o(t,e,i){var s=t;do{var n=s.prev,a=s.next.next;!v(n,a)&&y(n,s,s.next,a)&&w(n,a)&&w(a,n)&&(e.push(n.i/i|0),e.push(s.i/i|0),e.push(a.i/i|0),C(s),C(s.next),s=t=a),s=s.next}while(s!==t);return r(s)}function h(t,e,i,n,a,o){var h=t;do{for(var l=h.next.next;l!==h.prev;){if(h.i!==l.i&&g(h,l)){var u=b(h,l);return h=r(h,h.next),u=r(u,u.next),s(h,e,i,n,a,o,0),void s(u,e,i,n,a,o,0)}l=l.next}h=h.next}while(h!==t)}function l(t,e){return t.x-e.x}function u(t,e){var i=function(t,e){var i,r=e,s=t.x,n=t.y,a=-1/0;do{if(n<=r.y&&n>=r.next.y&&r.next.y!==r.y){var o=r.x+(n-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(o<=s&&o>a&&(a=o,i=r.x=r.x&&r.x>=u&&s!==r.x&&p(ni.x||r.x===i.x&&d(i,r)))&&(i=r,f=h)),r=r.next}while(r!==l);return i}(t,e);if(!i)return e;var s=b(i,t);return r(s,s.next),r(i,i.next)}function d(t,e){return m(t.prev,t,e.prev)<0&&m(e.next,t,t.next)<0}function c(t,e,i,r,s){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*s|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*s|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function f(t){var e=t,i=t;do{(e.x=(t-a)*(n-o)&&(t-a)*(r-o)>=(i-a)*(e-o)&&(i-a)*(n-o)>=(s-a)*(r-o)}function g(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&y(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(w(t,e)&&w(e,t)&&function(t,e){var i=t,r=!1,s=(t.x+e.x)/2,n=(t.y+e.y)/2;do{i.y>n!=i.next.y>n&&i.next.y!==i.y&&s<(i.next.x-i.x)*(n-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next}while(i!==t);return r}(t,e)&&(m(t.prev,t,e.prev)||m(t,e.prev,e))||v(t,e)&&m(t.prev,t,t.next)>0&&m(e.prev,e,e.next)>0)}function m(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function v(t,e){return t.x===e.x&&t.y===e.y}function y(t,e,i,r){var s=T(m(t,e,i)),n=T(m(t,e,r)),a=T(m(i,r,t)),o=T(m(i,r,e));return s!==n&&a!==o||(!(0!==s||!x(t,i,e))||(!(0!==n||!x(t,r,e))||(!(0!==a||!x(i,t,r))||!(0!==o||!x(i,e,r)))))}function x(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function T(t){return t>0?1:t<0?-1:0}function w(t,e){return m(t.prev,t,t.next)<0?m(t,e,t.next)>=0&&m(t,t.prev,e)>=0:m(t,e,t.prev)<0||m(t,t.next,e)<0}function b(t,e){var i=new E(t.i,t.x,t.y),r=new E(e.i,e.x,e.y),s=t.next,n=e.prev;return t.next=e,e.prev=t,i.next=s,s.prev=i,r.next=i,i.prev=r,n.next=r,r.prev=n,r}function S(t,e,i,r){var s=new E(t,e,i);return r?(s.next=r.next,s.prev=r,r.next.prev=s,r.next=s):(s.prev=s,s.next=s),s}function C(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function E(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function A(t,e,i,r){for(var s=0,n=e,a=i-r;n0&&(r+=t[s-1].length,i.holes.push(r))}return i},t.exports=e},13829(t,e,i){var r=i(87841);t.exports=function(t,e){void 0===e&&(e=new r);for(var i,s=1/0,n=1/0,a=-s,o=-n,h=0;h0&&(e=h/i);for(var l=0;ld+m)){var v=g.getPoint((u-d)/m);a.push(v);break}d+=m}return a}},30052(t,e,i){var r=i(35001),s=i(23031);t.exports=function(t){for(var e=t.points,i=0,n=0;n1?(r=i.x,s=i.y):o>0&&(r+=n*o,s+=a*o)}return(n=t.x-r)*n+(a=t.y-s)*a}function r(t,e,s,n,a){for(var o,h=n,l=e+1;lh&&(o=l,h=u)}h>n&&(o-e>1&&r(t,e,o,n,a),a.push(t[o]),s-o>1&&r(t,o,s,n,a))}function s(t,e){var i=t.length-1,s=[t[0]];return r(t,0,i,e,s),s.push(t[i]),s}t.exports=function(t,i,r){void 0===i&&(i=1),void 0===r&&(r=!1);var n=t.points;if(n.length>2){var a=i*i;r||(n=function(t,i){for(var r,s=t[0],n=[s],a=1,o=t.length;ai&&(n.push(r),s=r);return s!==r&&n.push(r),n}(n,a)),t.setTo(s(n,a))}return t}},5469(t){var e=function(t,e){return t[0]=e[0],t[1]=e[1],t};t.exports=function(t){var i,r=[],s=t.points;for(i=0;i0&&n.push(e([0,0],r[0])),i=0;i1&&n.push(e([0,0],r[r.length-1])),t.setTo(n)}},24709(t){t.exports=function(t,e,i){for(var r=t.points,s=0;s=e&&t.y<=i&&t.y+t.height>=i)}},96553(t,e,i){var r=i(37303);t.exports=function(t,e){return r(t,e.x,e.y)}},70273(t){t.exports=function(t,e){return!(e.width*e.height>t.width*t.height)&&(e.x>t.x&&e.xt.x&&e.rightt.y&&e.yt.y&&e.bottomr(e)?t.setSize(e.height*i,e.height):t.setSize(e.width,e.width/i),t.setPosition(e.centerX-t.width/2,e.centerY-t.height/2)}},80774(t){t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t}},83859(t){t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t.width=Math.floor(t.width),t.height=Math.floor(t.height),t}},19217(t,e,i){var r=i(87841),s=i(36383);t.exports=function(t,e){if(void 0===e&&(e=new r),0===t.length)return e;for(var i,n,a,o=Number.MAX_VALUE,h=Number.MAX_VALUE,l=s.MIN_SAFE_INTEGER,u=s.MIN_SAFE_INTEGER,d=0;d=1)return i.x=t.x,i.y=t.y,i;var n=r(t)*e;return e>.5?(n-=t.width+t.height)<=t.width?(i.x=t.right-n,i.y=t.bottom):(i.x=t.x,i.y=t.bottom-(n-t.width)):n<=t.width?(i.x=t.x+n,i.y=t.y):(i.x=t.right,i.y=t.y+(n-t.width)),i}},34819(t,e,i){var r=i(20812),s=i(13019);t.exports=function(t,e,i,n){void 0===n&&(n=[]),!e&&i>0&&(e=s(t)/i);for(var a=0;a=t.right&&(h=1,o+=a-t.right,a=t.right);break;case 1:(o+=e)>=t.bottom&&(h=2,a-=o-t.bottom,o=t.bottom);break;case 2:(a-=e)<=t.left&&(h=3,o-=t.left-a,a=t.left);break;case 3:(o-=e)<=t.top&&(h=0,o=t.top)}return n}},33595(t){t.exports=function(t,e){for(var i=t.x,r=t.right,s=t.y,n=t.bottom,a=0;ae.x&&t.ye.y}},13019(t){t.exports=function(t){return 2*(t.width+t.height)}},85133(t,e,i){var r=i(26099),s=i(39506);t.exports=function(t,e,i){void 0===i&&(i=new r),e=s(e);var n=Math.sin(e),a=Math.cos(e),o=a>0?t.width/2:t.width/-2,h=n>0?t.height/2:t.height/-2;return Math.abs(o*n)=this.right?this.width=0:this.width=this.right-t,this.x=t}},right:{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}},top:{get:function(){return this.y},set:function(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}},bottom:{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=u},94845(t){t.exports=function(t,e){return t.width===e.width&&t.height===e.height}},31730(t){t.exports=function(t,e,i){return void 0===i&&(i=e),t.width*=e,t.height*=i,t}},36899(t,e,i){var r=i(87841);t.exports=function(t,e,i){void 0===i&&(i=new r);var s=Math.min(t.x,e.x),n=Math.min(t.y,e.y),a=Math.max(t.right,e.right)-s,o=Math.max(t.bottom,e.bottom)-n;return i.setTo(s,n,a,o)}},93232(t,e,i){var r=i(87841);r.Area=i(39843),r.Ceil=i(98615),r.CeilAll=i(31688),r.CenterOn=i(67502),r.Clone=i(65085),r.Contains=i(37303),r.ContainsPoint=i(96553),r.ContainsRect=i(70273),r.CopyFrom=i(43459),r.Decompose=i(77493),r.Equals=i(9219),r.FitInside=i(53751),r.FitOutside=i(16088),r.Floor=i(80774),r.FloorAll=i(83859),r.FromPoints=i(19217),r.FromXY=i(9477),r.GetAspectRatio=i(8249),r.GetCenter=i(27165),r.GetPoint=i(20812),r.GetPoints=i(34819),r.GetSize=i(51313),r.Inflate=i(86091),r.Intersection=i(53951),r.MarchingAnts=i(14649),r.MergePoints=i(33595),r.MergeRect=i(20074),r.MergeXY=i(92171),r.Offset=i(42981),r.OffsetPoint=i(46907),r.Overlaps=i(60170),r.Perimeter=i(13019),r.PerimeterPoint=i(85133),r.Random=i(26597),r.RandomOutside=i(86470),r.SameDimensions=i(94845),r.Scale=i(31730),r.Union=i(36899),t.exports=r},41658(t){t.exports=function(t){var e=t.x1,i=t.y1,r=t.x2,s=t.y2,n=t.x3,a=t.y3;return Math.abs(((n-e)*(s-i)-(r-e)*(a-i))/2)}},39208(t,e,i){var r=i(16483);t.exports=function(t,e,i){var s=i*(Math.sqrt(3)/2);return new r(t,e,t+i/2,e+s,t-i/2,e+s)}},39545(t,e,i){var r=i(94811),s=i(16483);t.exports=function(t,e,i,n,a){void 0===e&&(e=null),void 0===i&&(i=1),void 0===n&&(n=1),void 0===a&&(a=[]);for(var o,h,l,u,d,c,f,p,g,m=r(t,e),v=0;v=0&&v>=0&&m+v<1}},48653(t){t.exports=function(t,e,i,r){void 0===i&&(i=!1),void 0===r&&(r=[]);for(var s,n,a,o,h,l,u=t.x3-t.x1,d=t.y3-t.y1,c=t.x2-t.x1,f=t.y2-t.y1,p=u*u+d*d,g=u*c+d*f,m=c*c+f*f,v=p*m-g*g,y=0===v?0:1/v,x=t.x1,T=t.y1,w=0;w=0&&n>=0&&s+n<1&&(r.push({x:e[w].x,y:e[w].y}),i)));w++);return r}},96006(t,e,i){var r=i(10690);t.exports=function(t,e){return r(t,e.x,e.y)}},71326(t){t.exports=function(t,e){return e.setTo(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)}},71694(t){t.exports=function(t,e){return void 0===e&&(e=[]),e.push({x:t.x1,y:t.y1}),e.push({x:t.x2,y:t.y2}),e.push({x:t.x3,y:t.y3}),e}},33522(t){t.exports=function(t,e){return t.x1===e.x1&&t.y1===e.y1&&t.x2===e.x2&&t.y2===e.y2&&t.x3===e.x3&&t.y3===e.y3}},20437(t,e,i){var r=i(26099),s=i(35001);t.exports=function(t,e,i){void 0===i&&(i=new r);var n=t.getLineA(),a=t.getLineB(),o=t.getLineC();if(e<=0||e>=1)return i.x=n.x1,i.y=n.y1,i;var h=s(n),l=s(a),u=s(o),d=(h+l+u)*e,c=0;return dh+l?(c=(d-=h+l)/u,i.x=o.x1+(o.x2-o.x1)*c,i.y=o.y1+(o.y2-o.y1)*c):(c=(d-=h)/l,i.x=a.x1+(a.x2-a.x1)*c,i.y=a.y1+(a.y2-a.y1)*c),i}},80672(t,e,i){var r=i(35001),s=i(26099);t.exports=function(t,e,i,n){void 0===n&&(n=[]);var a=t.getLineA(),o=t.getLineB(),h=t.getLineC(),l=r(a),u=r(o),d=r(h),c=l+u+d;!e&&i>0&&(e=c/i);for(var f=0;fl+u?(g=(p-=l+u)/d,m.x=h.x1+(h.x2-h.x1)*g,m.y=h.y1+(h.y2-h.y1)*g):(g=(p-=l)/u,m.x=o.x1+(o.x2-o.x1)*g,m.y=o.y1+(o.y2-o.y1)*g),n.push(m)}return n}},39757(t,e,i){var r=i(26099);function s(t,e,i,r){var s=t-i,n=e-r,a=s*s+n*n;return Math.sqrt(a)}t.exports=function(t,e){void 0===e&&(e=new r);var i=t.x1,n=t.y1,a=t.x2,o=t.y2,h=t.x3,l=t.y3,u=s(h,l,a,o),d=s(i,n,h,l),c=s(a,o,i,n),f=u+d+c;return e.x=(i*u+a*d+h*c)/f,e.y=(n*u+o*d+l*c)/f,e}},13584(t){t.exports=function(t,e,i){return t.x1+=e,t.y1+=i,t.x2+=e,t.y2+=i,t.x3+=e,t.y3+=i,t}},1376(t,e,i){var r=i(35001);t.exports=function(t){var e=t.getLineA(),i=t.getLineB(),s=t.getLineC();return r(e)+r(i)+r(s)}},90260(t,e,i){var r=i(26099);t.exports=function(t,e){void 0===e&&(e=new r);var i=t.x2-t.x1,s=t.y2-t.y1,n=t.x3-t.x1,a=t.y3-t.y1,o=Math.random(),h=Math.random();return o+h>=1&&(o=1-o,h=1-h),e.x=t.x1+(i*o+n*h),e.y=t.y1+(s*o+a*h),e}},52172(t,e,i){var r=i(99614),s=i(39757);t.exports=function(t,e){var i=s(t);return r(t,i.x,i.y,e)}},49907(t,e,i){var r=i(99614);t.exports=function(t,e,i){return r(t,e.x,e.y,i)}},99614(t){t.exports=function(t,e,i,r){var s=Math.cos(r),n=Math.sin(r),a=t.x1-e,o=t.y1-i;return t.x1=a*s-o*n+e,t.y1=a*n+o*s+i,a=t.x2-e,o=t.y2-i,t.x2=a*s-o*n+e,t.y2=a*n+o*s+i,a=t.x3-e,o=t.y3-i,t.x3=a*s-o*n+e,t.y3=a*n+o*s+i,t}},16483(t,e,i){var r=i(83419),s=i(10690),n=i(20437),a=i(80672),o=i(23777),h=i(23031),l=i(90260),u=new r({initialize:function(t,e,i,r,s,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===s&&(s=0),void 0===n&&(n=0),this.type=o.TRIANGLE,this.x1=t,this.y1=e,this.x2=i,this.y2=r,this.x3=s,this.y3=n},contains:function(t,e){return s(this,t,e)},getPoint:function(t,e){return n(this,t,e)},getPoints:function(t,e,i){return a(this,t,e,i)},getRandomPoint:function(t){return l(this,t)},setTo:function(t,e,i,r,s,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===s&&(s=0),void 0===n&&(n=0),this.x1=t,this.y1=e,this.x2=i,this.y2=r,this.x3=s,this.y3=n,this},getLineA:function(t){return void 0===t&&(t=new h),t.setTo(this.x1,this.y1,this.x2,this.y2),t},getLineB:function(t){return void 0===t&&(t=new h),t.setTo(this.x2,this.y2,this.x3,this.y3),t},getLineC:function(t){return void 0===t&&(t=new h),t.setTo(this.x3,this.y3,this.x1,this.y1),t},left:{get:function(){return Math.min(this.x1,this.x2,this.x3)},set:function(t){var e=0;e=this.x1<=this.x2&&this.x1<=this.x3?this.x1-t:this.x2<=this.x1&&this.x2<=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},right:{get:function(){return Math.max(this.x1,this.x2,this.x3)},set:function(t){var e=0;e=this.x1>=this.x2&&this.x1>=this.x3?this.x1-t:this.x2>=this.x1&&this.x2>=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},top:{get:function(){return Math.min(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1<=this.y2&&this.y1<=this.y3?this.y1-t:this.y2<=this.y1&&this.y2<=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}},bottom:{get:function(){return Math.max(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1>=this.y2&&this.y1>=this.y3?this.y1-t:this.y2>=this.y1&&this.y2>=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}}});t.exports=u},84435(t,e,i){var r=i(16483);r.Area=i(41658),r.BuildEquilateral=i(39208),r.BuildFromPolygon=i(39545),r.BuildRight=i(90301),r.CenterOn=i(23707),r.Centroid=i(97523),r.CircumCenter=i(24951),r.CircumCircle=i(85614),r.Clone=i(74422),r.Contains=i(10690),r.ContainsArray=i(48653),r.ContainsPoint=i(96006),r.CopyFrom=i(71326),r.Decompose=i(71694),r.Equals=i(33522),r.GetPoint=i(20437),r.GetPoints=i(80672),r.InCenter=i(39757),r.Perimeter=i(1376),r.Offset=i(13584),r.Random=i(90260),r.Rotate=i(52172),r.RotateAroundPoint=i(49907),r.RotateAroundXY=i(99614),t.exports=r},74457(t){t.exports=function(t,e,i){return{gameObject:t,enabled:!0,draggable:!1,dropZone:!1,cursor:!1,target:null,camera:null,hitArea:e,hitAreaCallback:i,hitAreaDebug:null,customHitArea:!1,localX:0,localY:0,dragState:0,dragStartX:0,dragStartY:0,dragStartXGlobal:0,dragStartYGlobal:0,dragStartCamera:null,dragX:0,dragY:0}}},84409(t){t.exports=function(t,e){return function(i,r,s,n){var a=t.getPixelAlpha(r,s,n.texture.key,n.frame.name);return a&&a>=e}}},7003(t,e,i){var r=i(83419),s=i(93301),n=i(50792),a=i(8214),o=i(8443),h=i(78970),l=i(85098),u=i(42515),d=i(36210),c=i(61340),f=i(85955),p=new r({initialize:function(t,e){this.game=t,this.scaleManager,this.canvas,this.config=e,this.enabled=!0,this.events=new n,this.isOver=!0,this.defaultCursor="",this.keyboard=e.inputKeyboard?new h(this):null,this.mouse=e.inputMouse?new l(this):null,this.touch=e.inputTouch?new d(this):null,this.pointers=[],this.pointersTotal=e.inputActivePointers;for(var i=0;i<=this.pointersTotal;i++){var r=new u(this,i);r.smoothFactor=e.inputSmoothFactor,this.pointers.push(r)}this.mousePointer=e.inputMouse?this.pointers[0]:null,this.activePointer=this.pointers[0],this.globalTopOnly=!0,this.time=0,this._tempPoint={x:0,y:0},this._tempHitTest=[],this._tempMatrix=new c,this._tempMatrix2=new c,this._tempSkip=!1,this.mousePointerContainer=[this.mousePointer],t.events.once(o.BOOT,this.boot,this)},boot:function(){var t=this.game,e=t.events;this.canvas=t.canvas,this.scaleManager=t.scale,this.events.emit(a.MANAGER_BOOT),e.on(o.PRE_RENDER,this.preRender,this),e.once(o.DESTROY,this.destroy,this)},setCanvasOver:function(t){this.isOver=!0,this.events.emit(a.GAME_OVER,t)},setCanvasOut:function(t){this.isOver=!1,this.events.emit(a.GAME_OUT,t)},preRender:function(){var t=this.game.loop.now,e=this.game.loop.delta,i=this.game.scene.getScenes(!0,!0);this.time=t,this.events.emit(a.MANAGER_UPDATE);for(var r=0;r10&&(t=10-this.pointersTotal);for(var i=0;i-1&&(s.splice(o,1),this.clear(a,!0))}this._pendingRemoval.length=0,this._list=s.concat(e.splice(0))}},isActive:function(){return this.manager&&this.manager.enabled&&this.enabled&&this.scene.sys.canInput()},setCursor:function(t){this.manager&&this.manager.setCursor(t)},resetCursor:function(){this.manager&&this.manager.resetCursor(null,!0)},updatePoll:function(t,e){if(!this.isActive())return!1;if(this.pluginEvents.emit(c.UPDATE,t,e),this._updatedThisFrame)return this._updatedThisFrame=!1,!1;var i,r=this.manager.pointers;for(i=0;i0){if(this._pollTimer-=e,!(this._pollTimer<0))return!1;this._pollTimer=this.pollRate}var n=!1;for(i=0;i0&&(n=!0)}return n},update:function(t,e){if(!this.isActive())return!1;for(var i=!1,r=0;r0&&(i=!0)}return this._updatedThisFrame=!0,i},clear:function(t,e){void 0===e&&(e=!1),this.disable(t);var i=t.input;i&&(this.removeDebug(t),this.manager.resetCursor(i),i.gameObject=void 0,i.target=void 0,i.hitArea=void 0,i.hitAreaCallback=void 0,i.callbackContext=void 0,t.input=null),e||this.queueForRemoval(t);var r=this._draggable.indexOf(t);return r>-1&&this._draggable.splice(r,1),t},disable:function(t,e){void 0===e&&(e=!1);var i=t.input;i&&(i.enabled=!1,i.dragState=0);for(var r,s=this._drag,n=this._over,a=this.manager,o=0;o-1&&s[o].splice(r,1),(r=n[o].indexOf(t))>-1&&n[o].splice(r,1);return e&&this.resetCursor(),this},enable:function(t,e,i,r){return void 0===r&&(r=!1),t.input?t.input.enabled=!0:this.setHitArea(t,e,i),t.input&&r&&!t.input.dropZone&&(t.input.dropZone=r),this},hitTestPointer:function(t){for(var e=this.cameras.getCamerasBelowPointer(t),i=0;i0)return t.camera=r,s}return t.camera=e[0],[]},processDownEvents:function(t){var e=0,i=this._temp,r=this._eventData,s=this._eventContainer;r.cancelled=!1;for(var n=0;n0&&l(t.x,t.y,t.downX,t.downY)>=s||r>0&&e>=t.downTime+r)&&(i=!0),i)return this.setDragState(t,3),this.processDragStartList(t)},processDragStartList:function(t){if(3!==this.getDragState(t))return 0;var e=this._drag[t.id];e.length>1&&(e=e.slice(0));for(var i=0;i1&&(this.sortGameObjects(i,t),this.topOnly&&i.splice(1)),this._drag[t.id]=i,0===this.dragDistanceThreshold&&0===this.dragTimeThreshold?(this.setDragState(t,3),this.processDragStartList(t)):(this.setDragState(t,2),0))},processDragMoveEvent:function(t){if(2===this.getDragState(t)&&this.processDragThresholdEvent(t,this.manager.game.loop.now),4!==this.getDragState(t))return 0;var e=this._tempZones,i=this._drag[t.id];i.length>1&&(i=i.slice(0));for(var r=0;r0?(a.emit(c.GAMEOBJECT_DRAG_LEAVE,t,h),this.emit(c.DRAG_LEAVE,t,a,h),o.target=e[0],h=o.target,a.emit(c.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(c.DRAG_ENTER,t,a,h)):(a.emit(c.GAMEOBJECT_DRAG_LEAVE,t,h),this.emit(c.DRAG_LEAVE,t,a,h),e[0]?(o.target=e[0],h=o.target,a.emit(c.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(c.DRAG_ENTER,t,a,h)):o.target=null)}else!h&&e[0]&&(o.target=e[0],h=o.target,a.emit(c.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(c.DRAG_ENTER,t,a,h));var u=t.positionToCamera(o.dragStartCamera);if(a.parentContainer){var d=u.x-o.dragStartXGlobal,f=u.y-o.dragStartYGlobal,p=a.getParentRotation(),g=d*Math.cos(p)+f*Math.sin(p),m=f*Math.cos(p)-d*Math.sin(p);g*=1/a.parentContainer.scaleX,m*=1/a.parentContainer.scaleY,s=g+o.dragStartX,n=m+o.dragStartY}else s=u.x-o.dragX,n=u.y-o.dragY;a.emit(c.GAMEOBJECT_DRAG,t,s,n),this.emit(c.DRAG,t,a,s,n)}return i.length},processDragUpEvent:function(t){var e=this._drag[t.id];e.length>1&&(e=e.slice(0));for(var i=0;i0){var n=this.manager,a=this._eventData,o=this._eventContainer;a.cancelled=!1;for(var h=0;h0){var s=this.manager,n=this._eventData,a=this._eventContainer;n.cancelled=!1,this.sortGameObjects(e,t);for(var o=0;o0){for(this.sortGameObjects(s,t),e=0;e0){for(this.sortGameObjects(n,t),e=0;e-1&&this._draggable.splice(s,1)}return this},makePixelPerfect:function(t){void 0===t&&(t=1);var e=this.systems.textures;return h(e,t)},setHitArea:function(t,e,i){if(void 0===e)return this.setHitAreaFromTexture(t);Array.isArray(t)||(t=[t]);var r=!1,s=!1,n=!1,a=!1,h=!1,l=!0;if(v(e)&&Object.keys(e).length){var u=e;e=p(u,"hitArea",null),i=p(u,"hitAreaCallback",null),h=p(u,"pixelPerfect",!1);var d=p(u,"alphaTolerance",1);h&&(e={},i=this.makePixelPerfect(d)),r=p(u,"draggable",!1),s=p(u,"dropZone",!1),n=p(u,"cursor",!1),a=p(u,"useHandCursor",!1),e&&i||(this.setHitAreaFromTexture(t),l=!1)}else"function"!=typeof e||i||(i=e,e={});for(var c=0;c=this.threshold?this.pressed||(this.pressed=!0,this.events.emit(s.BUTTON_DOWN,e,this,t),this.pad.emit(s.GAMEPAD_BUTTON_DOWN,i,t,this)):this.pressed&&(this.pressed=!1,this.events.emit(s.BUTTON_UP,e,this,t),this.pad.emit(s.GAMEPAD_BUTTON_UP,i,t,this))},destroy:function(){this.pad=null,this.events=null}});t.exports=n},99125(t,e,i){var r=i(97421),s=i(28884),n=i(83419),a=i(50792),o=i(26099),h=new n({Extends:a,initialize:function(t,e){a.call(this),this.manager=t,this.pad=e,this.id=e.id,this.index=e.index;for(var i=[],n=0;n=.5));this.buttons=i;var h=[];for(n=0;n=2&&(this.leftStick.set(n[0].getValue(),n[1].getValue()),s>=4&&this.rightStick.set(n[2].getValue(),n[3].getValue()))}},destroy:function(){var t;for(this.removeAllListeners(),this.manager=null,this.pad=null,t=0;t-1&&e.preventDefault()}},this.onKeyUp=function(e){if(!e.defaultPrevented&&t.enabled&&t.manager){t.queue.push(e),t.manager.events.emit(a.MANAGER_PROCESS);var i=e.altKey||e.ctrlKey||e.shiftKey||e.metaKey;t.preventDefault&&!i&&t.captures.indexOf(e.keyCode)>-1&&e.preventDefault()}};var e=this.target;e&&(e.addEventListener("keydown",this.onKeyDown,!1),e.addEventListener("keyup",this.onKeyUp,!1),this.enabled=!0)},stopListeners:function(){var t=this.target;t.removeEventListener("keydown",this.onKeyDown,!1),t.removeEventListener("keyup",this.onKeyUp,!1),this.enabled=!1},postUpdate:function(){this.queue=[]},addCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i0},removeCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i0},clearCaptures:function(){this.captures=[],this.preventDefault=!1},destroy:function(){this.stopListeners(),this.clearCaptures(),this.queue=[],this.manager.game.events.off(n.POST_STEP,this.postUpdate,this),this.target=null,this.enabled=!1,this.manager=null}});t.exports=l},28846(t,e,i){var r=i(83419),s=i(50792),n=i(95922),a=i(8443),o=i(35154),h=i(8214),l=i(89639),u=i(30472),d=i(46032),c=i(87960),f=i(74600),p=i(44594),g=i(56583),m=new r({Extends:s,initialize:function(t){s.call(this),this.game=t.systems.game,this.scene=t.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=t,this.manager=t.manager.keyboard,this.enabled=!0,this.keys=[],this.combos=[],this.prevCode=null,this.prevTime=0,this.prevType=null,t.pluginEvents.once(h.BOOT,this.boot,this),t.pluginEvents.on(h.START,this.start,this)},boot:function(){var t=this.settings.input;this.enabled=o(t,"keyboard",!0);var e=o(t,"keyboard.capture",null);e&&this.addCaptures(e),this.sceneInputPlugin.pluginEvents.once(h.DESTROY,this.destroy,this)},start:function(){this.sceneInputPlugin.manager.events.on(h.MANAGER_PROCESS,this.update,this),this.sceneInputPlugin.pluginEvents.once(h.SHUTDOWN,this.shutdown,this),this.game.events.on(a.BLUR,this.resetKeys,this),this.scene.sys.events.on(p.PAUSE,this.resetKeys,this),this.scene.sys.events.on(p.SLEEP,this.resetKeys,this)},isActive:function(){return this.enabled&&this.scene.sys.canInput()},addCapture:function(t){return this.manager.addCapture(t),this},removeCapture:function(t){return this.manager.removeCapture(t),this},getCaptures:function(){return this.manager.captures},enableGlobalCapture:function(){return this.manager.preventDefault=!0,this},disableGlobalCapture:function(){return this.manager.preventDefault=!1,this},clearCaptures:function(){return this.manager.clearCaptures(),this},createCursorKeys:function(){return this.addKeys({up:d.UP,down:d.DOWN,left:d.LEFT,right:d.RIGHT,space:d.SPACE,shift:d.SHIFT})},addKeys:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!1);var r={};if("string"==typeof t){t=t.split(",");for(var s=0;s-1?r[s]=t:r[t.keyCode]=t,e&&this.addCapture(t.keyCode),t.setEmitOnRepeat(i),t}return"string"==typeof t&&(t=d[t.toUpperCase()]),r[t]||(r[t]=new u(this,t),e&&this.addCapture(t),r[t].setEmitOnRepeat(i)),r[t]},removeKey:function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var r,s=this.keys;if(t instanceof u){var n=s.indexOf(t);n>-1&&(r=this.keys[n],this.keys[n]=void 0)}else"string"==typeof t&&(t=d[t.toUpperCase()]);return s[t]&&(r=s[t],s[t]=void 0),r&&(r.plugin=null,i&&this.removeCapture(r.keyCode),e&&r.destroy()),this},removeAllKeys:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1);for(var i=this.keys,r=0;rt._tick)return t._tick=i,!0}return!1},update:function(){var t=this.manager.queue,e=t.length;if(this.isActive()&&0!==e)for(var i=this.keys,r=0;r0&&e.maxKeyDelay>0){var n=e.timeLastMatched+e.maxKeyDelay;t.timeStamp<=n&&(s=!0,i=r(t,e))}else s=!0,i=r(t,e);return!s&&e.resetOnWrongKey&&(e.index=0,e.current=e.keyCodes[0]),i&&(e.timeLastMatched=t.timeStamp,e.matched=!0,e.timeMatched=t.timeStamp),i}},92803(t){t.exports=function(t){return t.current=t.keyCodes[0],t.index=0,t.timeLastMatched=0,t.matched=!1,t.timeMatched=0,t}},92612(t){t.exports="keydown"},23345(t){t.exports="keyup"},21957(t){t.exports="keycombomatch"},44743(t){t.exports="down"},3771(t){t.exports="keydown-"},46358(t){t.exports="keyup-"},75674(t){t.exports="up"},95922(t,e,i){t.exports={ANY_KEY_DOWN:i(92612),ANY_KEY_UP:i(23345),COMBO_MATCH:i(21957),DOWN:i(44743),KEY_DOWN:i(3771),KEY_UP:i(46358),UP:i(75674)}},51442(t,e,i){t.exports={Events:i(95922),KeyboardManager:i(78970),KeyboardPlugin:i(28846),Key:i(30472),KeyCodes:i(46032),KeyCombo:i(87960),AdvanceKeyCombo:i(66970),ProcessKeyCombo:i(68769),ResetKeyCombo:i(92803),JustDown:i(90229),JustUp:i(38796),DownDuration:i(37015),UpDuration:i(41170)}},37015(t){t.exports=function(t,e){void 0===e&&(e=50);var i=t.plugin.game.loop.time-t.timeDown;return t.isDown&&i=400&&t.status<=599&&(r=!1),this.state=s.FILE_LOADED,this.resetXHR(),this.loader.nextFile(this,r)},onBase64Load:function(t){this.xhrLoader=t,this.state=s.FILE_LOADED,this.percentComplete=1,this.loader.emit(n.FILE_PROGRESS,this,this.percentComplete),this.loader.nextFile(this,!0)},onError:function(){this.resetXHR(),this.retryAttempts>0?(this.retryAttempts--,this.load()):this.loader.nextFile(this,!1)},onProgress:function(t){t.lengthComputable&&(this.bytesLoaded=t.loaded,this.bytesTotal=t.total,this.percentComplete=Math.min(this.bytesLoaded/this.bytesTotal,1),this.loader.emit(n.FILE_PROGRESS,this,this.percentComplete))},onProcess:function(){this.state=s.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=s.FILE_COMPLETE,this.multiFile&&this.multiFile.onFileComplete(this),this.loader.fileProcessComplete(this)},onProcessError:function(){console.error('Failed to process file: %s "%s"',this.type,this.key),this.state=s.FILE_ERRORED,this.multiFile&&this.multiFile.onFileFailed(this),this.loader.fileProcessComplete(this)},hasCacheConflict:function(){return this.cache&&this.cache.exists(this.key)},addToCache:function(){this.cache&&this.data&&this.cache.add(this.key,this.data)},pendingDestroy:function(t){if(this.state!==s.FILE_PENDING_DESTROY){void 0===t&&(t=this.data);var e=this.key,i=this.type;this.loader.emit(n.FILE_COMPLETE,e,i,t),this.loader.emit(n.FILE_KEY_COMPLETE+i+"-"+e,e,i,t),this.loader.flagForRemoval(this),this.state=s.FILE_PENDING_DESTROY}},destroy:function(){this.loader=null,this.cache=null,this.xhrSettings=null,this.multiFile=null,this.linkFile=null,this.data=null}});d.createObjectURL=function(t,e,i){if("function"==typeof URL)t.src=URL.createObjectURL(e);else{var r=new FileReader;r.onload=function(){t.removeAttribute("crossOrigin"),t.src="data:"+(e.type||i)+";base64,"+r.result.split(",")[1]},r.onerror=t.onerror,r.readAsDataURL(e)}},d.revokeObjectURL=function(t){"function"==typeof URL&&URL.revokeObjectURL(t.src)},t.exports=d},74099(t){var e={},i={install:function(t){for(var i in e)t[i]=e[i]},register:function(t,i){e[t]=i},destroy:function(){e={}}};t.exports=i},98356(t){t.exports=function(t,e){return!!t.url&&(t.url.match(/^(?:blob:|data:|capacitor:\/\/|file:\/\/|http:\/\/|https:\/\/|\/\/)/)?t.url:e+t.url)}},74261(t,e,i){var r=i(83419),s=i(23906),n=i(50792),a=i(54899),o=i(74099),h=i(95540),l=i(35154),u=i(41212),d=i(37277),c=i(44594),f=i(92638),p=new r({Extends:n,initialize:function(t){n.call(this);var e=t.sys.game.config,i=t.sys.settings.loader;this.scene=t,this.systems=t.sys,this.cacheManager=t.sys.cache,this.textureManager=t.sys.textures,this.sceneManager=t.sys.game.scene,o.install(this),this.prefix="",this.path="",this.baseURL="",this.setBaseURL(h(i,"baseURL",e.loaderBaseURL)),this.setPath(h(i,"path",e.loaderPath)),this.setPrefix(h(i,"prefix",e.loaderPrefix)),this.maxParallelDownloads=h(i,"maxParallelDownloads",e.loaderMaxParallelDownloads),this.xhr=f(h(i,"responseType",e.loaderResponseType),h(i,"async",e.loaderAsync),h(i,"user",e.loaderUser),h(i,"password",e.loaderPassword),h(i,"timeout",e.loaderTimeout),h(i,"withCredentials",e.loaderWithCredentials)),this.crossOrigin=h(i,"crossOrigin",e.loaderCrossOrigin),this.imageLoadType=h(i,"imageLoadType",e.loaderImageLoadType),this.localSchemes=h(i,"localScheme",e.loaderLocalScheme),this.totalToLoad=0,this.progress=0,this.list=new Set,this.inflight=new Set,this.queue=new Set,this._deleteQueue=new Set,this.totalFailed=0,this.totalComplete=0,this.state=s.LOADER_IDLE,this.multiKeyIndex=0,this.maxRetries=h(i,"maxRetries",e.loaderMaxRetries),t.sys.events.once(c.BOOT,this.boot,this),t.sys.events.on(c.START,this.pluginStart,this)},boot:function(){this.systems.events.once(c.DESTROY,this.destroy,this)},pluginStart:function(){this.systems.events.once(c.SHUTDOWN,this.shutdown,this)},setBaseURL:function(t){return void 0===t&&(t=""),""!==t&&"/"!==t.substr(-1)&&(t=t.concat("/")),this.baseURL=t,this},setPath:function(t){return void 0===t&&(t=""),""!==t&&"/"!==t.substr(-1)&&(t=t.concat("/")),this.path=t,this},setPrefix:function(t){return void 0===t&&(t=""),this.prefix=t,this},setCORS:function(t){return this.crossOrigin=t,this},addFile:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e0},removePack:function(t,e){var i,r=this.systems.anims,s=this.cacheManager,n=this.textureManager,a={animation:"json",aseprite:"json",audio:"audio",audioSprite:"audio",binary:"binary",bitmapFont:"bitmapFont",css:null,glsl:"shader",html:"html",json:"json",obj:"obj",plugin:null,scenePlugin:null,script:null,spine:"json",text:"text",tilemapCSV:"tilemap",tilemapImpact:"tilemap",tilemapTiledJSON:"tilemap",video:"video",xml:"xml"};if(u(t))i=t;else if(!(i=s.json.get(t)))return void console.warn("Asset Pack not found in JSON cache:",t);for(var o in e&&(i={_:i[e]}),i){var l=i[o],d=h(l,"prefix",""),c=h(l,"files"),f=h(l,"defaultType");if(Array.isArray(c))for(var p=0;p0&&this.inflight.size'),i.push(''),i.push(''),i.push(this.xhrLoader.responseText),i.push(""),i.push(""),i.push("");var r=[i.join("\n")],a=this;try{var o=new window.Blob(r,{type:"image/svg+xml;charset=utf-8"})}catch(t){return a.state=s.FILE_ERRORED,void a.onProcessComplete()}this.data=new Image,this.data.crossOrigin=this.crossOrigin,this.data.onload=function(){n.revokeObjectURL(a.data),a.onProcessComplete()},this.data.onerror=function(){n.revokeObjectURL(a.data),a.onProcessError()},n.createObjectURL(this.data,o,"image/svg+xml")},addToCache:function(){this.cache.addImage(this.key,this.data)}});a.register("htmlTexture",function(t,e,i,r,s){if(Array.isArray(t))for(var n=0;n=s.FILE_COMPLETE&&("spritesheet"===t.type?t.addToCache():"normalMap"===this.type?this.cache.addImage(this.key,t.data,this.data):this.cache.addImage(this.key,this.data,t.data)):this.cache.addImage(this.key,this.data)}});a.register("image",function(t,e,i){if(Array.isArray(t))for(var r=0;r=0?a.substring(o+i.length):a]=n.data}for(var h=[],l=0;l=s.FILE_COMPLETE&&("normalMap"===this.type?this.cache.addSpriteSheet(this.key,t.data,this.config,this.data):this.cache.addSpriteSheet(this.key,this.data,this.config,t.data)):this.cache.addSpriteSheet(this.key,this.data,this.config)}});n.register("spritesheet",function(t,e,i,r){if(Array.isArray(t))for(var s=0;si&&(i=h.x),h.xn&&(n=h.y),h.y>>0)+2891336453,s=277803737*(r>>>(r>>>28)+4^r),n=(s>>>22^s)>>>0;return n/=f};t.exports=function(t,e){switch("number"==typeof t&&(t=[t]),e){case 2:return p(t,!0);case 1:return p(t);default:return c(t)}}},84854(t,e,i){var r=i(72958),s=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16],n=Array(4),a=Array(4),o=Array(4),h=Array(4),l=Array(4),u=Array(4),d=function(t,e,i){var r,s,h,l,u=e.noiseMode||0,d=void 0===e.noiseSmoothing?1:e.noiseSmoothing,p=Math.max(1,Math.min(t.length,4)),g=e.noiseCells||[32,32,32,32].slice(0,p);for(r=0;r1&&(o[1]=Math.floor(l/3)%3-1,p>2&&(o[2]=Math.floor(l/9)%3-1,p>3&&(o[3]=Math.floor(l/27)%3-1))),s=c(p,n,o,e,i),h=f(p,o,a,s),u){case 0:h0||e[1]>0)for(j[0]=U.x,j[1]=z.x,j[2]=Y.x,q[0]=U.y,q[1]=z.y,q[2]=Y.y,e[0]>0&&(j[0]=(U.x%e[0]+e[0])%e[0],j[1]=(z.x%e[0]+e[0])%e[0],j[2]=(Y.x%e[0]+e[0])%e[0]),e[1]>0&&(q[0]=(U.y%e[1]+e[1])%e[1],q[1]=(z.y%e[1]+e[1])%e[1],q[2]=(Y.y%e[1]+e[1])%e[1]),r=0;r<3;r++)V[r]=Math.floor(j[r]+.5*q[r]+.5),H[r]=Math.floor(q[r]+.5);else V[0]=n.x,V[1]=B.x,V[2]=k.x,H[0]=n.y,H[1]=B.y,H[2]=k.y;for(V[0]+=a[0],V[1]+=a[0],V[2]+=a[0],H[0]+=a[1],H[1]+=a[1],H[2]+=a[1],r=0;r<3;r++)K[r]=V[r]%289,K[r]<0&&(K[r]+=289);for(r=0;r<3;r++)K[r]=((51*K[r]+2)*K[r]+H[r])%289;for(r=0;r<3;r++)K[r]=(34*K[r]+10)*K[r]%289;for(r=0;r<3;r++)Z[r]=.07482*K[r]+i,Q[r]=Math.cos(Z[r]),J[r]=Math.sin(Z[r]);for($.x=Q[0],$.y=J[0],tt.x=Q[1],tt.y=J[1],et.x=Q[2],et.y=J[2],it[0]=.8-I(X,X),it[1]=.8-I(W,W),it[2]=.8-I(G,G),r=0;r<3;r++)it[r]=Math.max(it[r],0),rt[r]=it[r]*it[r],st[r]=rt[r]*rt[r];return nt[0]=I($,X),nt[1]=I(tt,W),nt[2]=I(et,G),10.9*(st[0]*nt[0]+st[1]*nt[1]+st[2]*nt[2])},B=[0,0,0],k=[0,0,0],U=[0,0,0],z=[0,0,0],Y=[0,0,0],X=[0,0,0],W=[0,0,0],G=[0,0,0],V=[0,0,0],H=[0,0,0],j=[0,0,0],q=[0,0,0],K=[0,0,0],Z=[0,0,0],Q=[0,0,0],J=[0,0,0],$=[0,0,0],tt=[0,0,0],et=[0,0,0],it=[0,0,0],rt=[0,0,0,0],st=[0,0,0,0],nt=[0,0,0,0],at=[0,0,0,0],ot=[0,0,0,0],ht=[0,0,0,0],lt=[0,0,0,0],ut=[0,0,0,0],dt=[0,0,0,0],ct=[0,0,0,0],ft=[0,0,0,0],pt=[0,0,0,0],gt=[0,0,0,0],mt=[0,0,0,0],vt=[0,0,0,0],yt=[0,0,0,0],xt=[0,0,0,0],Tt=[0,0,0,0],wt=[0,0,0,0],bt=[0,0,0,0],St=[0,0,0,0],Ct=[0,0,0,0],Et=[0,0,0,0],At=[0,0,0,0],_t=[0,0,0,0],Mt=[0,0,0,0],Rt=[0,0,0,0],Pt=[0,0,0,0],Ot=function(t,e){for(var i=0;i<4;i++){var r=t[i]%289;r<0&&(r+=289),e[i]=(34*r+10)*r%289}},Lt=function(t,e,i){var r=B,s=k,n=U,o=z,h=Y,l=X,u=W,d=G,c=V,f=H,p=j,g=q,m=K,v=Z,y=Q,x=J,T=$,w=tt,b=et,S=it,C=rt,E=st,A=nt,_=at,M=ot,R=ht,P=lt,O=ut,L=dt,F=ct,D=ft,I=pt,N=gt,Lt=mt,Ft=vt,Dt=yt,It=xt,Nt=Tt,Bt=wt,kt=bt,Ut=St,zt=Ct,Yt=Et,Xt=At,Wt=_t,Gt=Mt,Vt=Rt,Ht=Pt;r[0]=0*t[0]+1*t[1]+1*t[2],r[1]=1*t[0]+0*t[1]+1*t[2],r[2]=1*t[0]+1*t[1]+0*t[2];for(var jt=0;jt<3;jt++)s[jt]=Math.floor(r[jt]),n[jt]=r[jt]-s[jt];for(o[0]=n[0]>n[1]?0:1,o[1]=n[1]>n[2]?0:1,o[2]=n[0]>n[2]?0:1,h[0]=1-o[0],h[1]=1-o[1],h[2]=1-o[2],l[0]=h[2],l[1]=o[0],l[2]=o[1],u[0]=h[0],u[1]=h[1],u[2]=o[2],jt=0;jt<3;jt++)d[jt]=Math.min(l[jt],u[jt]),c[jt]=Math.max(l[jt],u[jt]);for(jt=0;jt<3;jt++)f[jt]=s[jt]+d[jt],p[jt]=s[jt]+c[jt],g[jt]=s[jt]+1;var qt=s[0],Kt=s[1],Zt=s[2],Qt=f[0],Jt=f[1],$t=f[2],te=p[0],ee=p[1],ie=p[2],re=g[0],se=g[1],ne=g[2];for(m[0]=-.5*qt+.5*Kt+.5*Zt,m[1]=.5*qt-.5*Kt+.5*Zt,m[2]=.5*qt+.5*Kt-.5*Zt,v[0]=-.5*Qt+.5*Jt+.5*$t,v[1]=.5*Qt-.5*Jt+.5*$t,v[2]=.5*Qt+.5*Jt-.5*$t,y[0]=-.5*te+.5*ee+.5*ie,y[1]=.5*te-.5*ee+.5*ie,y[2]=.5*te+.5*ee-.5*ie,x[0]=-.5*re+.5*se+.5*ne,x[1]=.5*re-.5*se+.5*ne,x[2]=.5*re+.5*se-.5*ne,jt=0;jt<3;jt++)T[jt]=t[jt]-m[jt],w[jt]=t[jt]-v[jt],b[jt]=t[jt]-y[jt],S[jt]=t[jt]-x[jt];if(e[0]>0||e[1]>0||e[2]>0){if(C[0]=m[0],C[1]=v[0],C[2]=y[0],C[3]=x[0],E[0]=m[1],E[1]=v[1],E[2]=y[1],E[3]=x[1],A[0]=m[2],A[1]=v[2],A[2]=y[2],A[3]=x[2],e[0]>0)for(jt=0;jt<4;jt++)C[jt]=(C[jt]%e[0]+e[0])%e[0];if(e[1]>0)for(jt=0;jt<4;jt++)E[jt]=(E[jt]%e[1]+e[1])%e[1];if(e[2]>0)for(jt=0;jt<4;jt++)A[jt]=(A[jt]%e[2]+e[2])%e[2];var ae=C[0],oe=E[0],he=A[0],le=C[1],ue=E[1],de=A[1],ce=C[2],fe=E[2],pe=A[2],ge=C[3],me=E[3],ve=A[3];s[0]=Math.floor(0*ae+1*oe+1*he+.5),s[1]=Math.floor(1*ae+0*oe+1*he+.5),s[2]=Math.floor(1*ae+1*oe+0*he+.5),f[0]=Math.floor(0*le+1*ue+1*de+.5),f[1]=Math.floor(1*le+0*ue+1*de+.5),f[2]=Math.floor(1*le+1*ue+0*de+.5),p[0]=Math.floor(0*ce+1*fe+1*pe+.5),p[1]=Math.floor(1*ce+0*fe+1*pe+.5),p[2]=Math.floor(1*ce+1*fe+0*pe+.5),g[0]=Math.floor(0*ge+1*me+1*ve+.5),g[1]=Math.floor(1*ge+0*me+1*ve+.5),g[2]=Math.floor(1*ge+1*me+0*ve+.5)}s[0]+=a[0],s[1]+=a[1],s[2]+=a[2],f[0]+=a[0],f[1]+=a[1],f[2]+=a[2],p[0]+=a[0],p[1]+=a[1],p[2]+=a[2],g[0]+=a[0],g[1]+=a[1],g[2]+=a[2];var ye=rt,xe=st;for(ye[0]=s[2],ye[1]=f[2],ye[2]=p[2],ye[3]=g[2],Ot(ye,xe),xe[0]+=s[1],xe[1]+=f[1],xe[2]+=p[1],xe[3]+=g[1],Ot(xe,ye),ye[0]+=s[0],ye[1]+=f[0],ye[2]+=p[0],ye[3]+=g[0],Ot(ye,_),jt=0;jt<4;jt++)M[jt]=3.883222077*_[jt],R[jt]=.996539792-.006920415*_[jt],P[jt]=.108705628*_[jt],O[jt]=Math.cos(M[jt]),L[jt]=Math.sin(M[jt]),F[jt]=Math.sqrt(Math.max(0,1-R[jt]*R[jt]));if(0!==i)for(jt=0;jt<4;jt++)Lt[jt]=O[jt]*F[jt],Ft[jt]=L[jt]*F[jt],Dt[jt]=R[jt],It[jt]=Math.sin(P[jt]),Nt[jt]=Math.cos(P[jt]),Bt[jt]=L[jt]*It[jt]-O[jt]*Nt[jt],kt[jt]=(1-R[jt])*(Bt[jt]*L[jt])+R[jt]*It[jt],Ut[jt]=(1-R[jt])*(-Bt[jt]*O[jt])+R[jt]*Nt[jt],zt[jt]=-(Ft[jt]*Nt[jt]+Lt[jt]*It[jt]),Yt[jt]=Math.sin(i),Xt[jt]=Math.cos(i),D[jt]=Xt[jt]*Lt[jt]+Yt[jt]*kt[jt],I[jt]=Xt[jt]*Ft[jt]+Yt[jt]*Ut[jt],N[jt]=Xt[jt]*Dt[jt]+Yt[jt]*zt[jt];else for(jt=0;jt<4;jt++)D[jt]=O[jt]*F[jt],I[jt]=L[jt]*F[jt],N[jt]=R[jt];for(jt=0;jt<4;jt++){var Te=0===jt?T[0]:1===jt?w[0]:2===jt?b[0]:S[0],we=0===jt?T[1]:1===jt?w[1]:2===jt?b[1]:S[1],be=0===jt?T[2]:1===jt?w[2]:2===jt?b[2]:S[2],Se=Te*Te+we*we+be*be;Wt[jt]=.5-Se,Wt[jt]<0&&(Wt[jt]=0),Gt[jt]=Wt[jt]*Wt[jt],Vt[jt]=Gt[jt]*Wt[jt]}for(jt=0;jt<4;jt++){var Ce=D[jt],Ee=I[jt],Ae=N[jt],_e=0===jt?T[0]:1===jt?w[0]:2===jt?b[0]:S[0],Me=0===jt?T[1]:1===jt?w[1]:2===jt?b[1]:S[1],Re=0===jt?T[2]:1===jt?w[2]:2===jt?b[2]:S[2];Ht[jt]=Ce*_e+Ee*Me+Ae*Re}var Pe=0;for(jt=0;jt<4;jt++)Pe+=Vt[jt]*Ht[jt];return 39.5*Pe};t.exports=function(t,r){"number"==typeof t&&(t=[t]),r||(r={});for(var h=Math.min(3,t.length);h<2;)t.push(0),h++;var l=r.noiseIterations||1,u=r.noiseWarpIterations||1,d=r.noiseDetailPower||2,c=r.noiseFlowPower||2,f=r.noiseContributionPower||2,p=r.noiseWarpDetailPower||2,g=r.noiseWarpFlowPower||2,m=r.noiseWarpContributionPower||2,v=r.noiseCells||[32,32,32],y=r.noiseOffset||[0,0,0],x=r.noiseWarpAmount||0;if(r.noiseSeed)for(var T=[1,2,3],w=0;w0&&u>0&&h>=2)if(2===h){var b=o(u,2,e,r,p,g,m);i[0]=e[0]+s[0],i[1]=e[1]+s[1];var S=o(u,2,i,r,p,g,m);e[0]+=b*x,e[1]+=S*x}else if(3===h){var C=o(u,3,e,r,p,g,m);i[0]=e[0]+s[0],i[1]=e[1]+s[1],i[2]=e[2]+s[2];var E=o(u,3,i,r,p,g,m);i[0]=e[0]+n[0],i[1]=e[1]+n[1],i[2]=e[2]+n[2];var A=o(u,3,i,r,p,g,m);e[0]+=C*x,e[1]+=E*x,e[2]+=A*x}return o(l,h,e,r,d,c,f)}},78702(t){t.exports=function(t){return t==parseFloat(t)?!(t%2):void 0}},94883(t){t.exports=function(t){return t===parseFloat(t)?!(t%2):void 0}},28915(t){t.exports=function(t,e,i){return(e-t)*i+t}},94908(t){t.exports=function(t,e,i){return void 0===i&&(i=0),t.clone().lerp(e,i)}},94434(t,e,i){var r=new(i(83419))({initialize:function(t){this.val=new Float32Array(9),t?this.copy(t):this.identity()},clone:function(){return new r(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this},fromMat4:function(t){var e=t.val,i=this.val;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[4],i[4]=e[5],i[5]=e[6],i[6]=e[8],i[7]=e[9],i[8]=e[10],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],r=t[5];return t[1]=t[3],t[2]=t[6],t[3]=e,t[5]=t[7],t[6]=i,t[7]=r,this},invert:function(){var t=this.val,e=t[0],i=t[1],r=t[2],s=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=l*n-a*h,d=-l*s+a*o,c=h*s-n*o,f=e*u+i*d+r*c;return f?(f=1/f,t[0]=u*f,t[1]=(-l*i+r*h)*f,t[2]=(a*i-r*n)*f,t[3]=d*f,t[4]=(l*e-r*o)*f,t[5]=(-a*e+r*s)*f,t[6]=c*f,t[7]=(-h*e+i*o)*f,t[8]=(n*e-i*s)*f,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],r=t[2],s=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return t[0]=n*l-a*h,t[1]=r*h-i*l,t[2]=i*a-r*n,t[3]=a*o-s*l,t[4]=e*l-r*o,t[5]=r*s-e*a,t[6]=s*h-n*o,t[7]=i*o-e*h,t[8]=e*n-i*s,this},determinant:function(){var t=this.val,e=t[0],i=t[1],r=t[2],s=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return e*(l*n-a*h)+i*(-l*s+a*o)+r*(h*s-n*o)},multiply:function(t){var e=this.val,i=e[0],r=e[1],s=e[2],n=e[3],a=e[4],o=e[5],h=e[6],l=e[7],u=e[8],d=t.val,c=d[0],f=d[1],p=d[2],g=d[3],m=d[4],v=d[5],y=d[6],x=d[7],T=d[8];return e[0]=c*i+f*n+p*h,e[1]=c*r+f*a+p*l,e[2]=c*s+f*o+p*u,e[3]=g*i+m*n+v*h,e[4]=g*r+m*a+v*l,e[5]=g*s+m*o+v*u,e[6]=y*i+x*n+T*h,e[7]=y*r+x*a+T*l,e[8]=y*s+x*o+T*u,this},translate:function(t){var e=this.val,i=t.x,r=t.y;return e[6]=i*e[0]+r*e[3]+e[6],e[7]=i*e[1]+r*e[4]+e[7],e[8]=i*e[2]+r*e[5]+e[8],this},rotate:function(t){var e=this.val,i=e[0],r=e[1],s=e[2],n=e[3],a=e[4],o=e[5],h=Math.sin(t),l=Math.cos(t);return e[0]=l*i+h*n,e[1]=l*r+h*a,e[2]=l*s+h*o,e[3]=l*n-h*i,e[4]=l*a-h*r,e[5]=l*o-h*s,this},scale:function(t){var e=this.val,i=t.x,r=t.y;return e[0]=i*e[0],e[1]=i*e[1],e[2]=i*e[2],e[3]=r*e[3],e[4]=r*e[4],e[5]=r*e[5],this},fromQuat:function(t){var e=t.x,i=t.y,r=t.z,s=t.w,n=e+e,a=i+i,o=r+r,h=e*n,l=e*a,u=e*o,d=i*a,c=i*o,f=r*o,p=s*n,g=s*a,m=s*o,v=this.val;return v[0]=1-(d+f),v[3]=l+m,v[6]=u-g,v[1]=l-m,v[4]=1-(h+f),v[7]=c+p,v[2]=u+g,v[5]=c-p,v[8]=1-(h+d),this},normalFromMat4:function(t){var e=t.val,i=this.val,r=e[0],s=e[1],n=e[2],a=e[3],o=e[4],h=e[5],l=e[6],u=e[7],d=e[8],c=e[9],f=e[10],p=e[11],g=e[12],m=e[13],v=e[14],y=e[15],x=r*h-s*o,T=r*l-n*o,w=r*u-a*o,b=s*l-n*h,S=s*u-a*h,C=n*u-a*l,E=d*m-c*g,A=d*v-f*g,_=d*y-p*g,M=c*v-f*m,R=c*y-p*m,P=f*y-p*v,O=x*P-T*R+w*M+b*_-S*A+C*E;return O?(O=1/O,i[0]=(h*P-l*R+u*M)*O,i[1]=(l*_-o*P-u*A)*O,i[2]=(o*R-h*_+u*E)*O,i[3]=(n*R-s*P-a*M)*O,i[4]=(r*P-n*_+a*A)*O,i[5]=(s*_-r*R-a*E)*O,i[6]=(m*C-v*S+y*b)*O,i[7]=(v*w-g*C-y*T)*O,i[8]=(g*S-m*w+y*x)*O,this):null}});t.exports=r},37867(t,e,i){var r=i(83419),s=i(25836),n=1e-6,a=new r({initialize:function(t){this.val=new Float32Array(16),t?this.copy(t):this.identity()},clone:function(){return new a(this)},set:function(t){return this.copy(t)},setValues:function(t,e,i,r,s,n,a,o,h,l,u,d,c,f,p,g){var m=this.val;return m[0]=t,m[1]=e,m[2]=i,m[3]=r,m[4]=s,m[5]=n,m[6]=a,m[7]=o,m[8]=h,m[9]=l,m[10]=u,m[11]=d,m[12]=c,m[13]=f,m[14]=p,m[15]=g,this},copy:function(t){var e=t.val;return this.setValues(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},fromArray:function(t){return this.setValues(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},zero:function(){return this.setValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)},transform:function(t,e,i){var r=o.fromQuat(i).val,s=e.x,n=e.y,a=e.z;return this.setValues(r[0]*s,r[1]*s,r[2]*s,0,r[4]*n,r[5]*n,r[6]*n,0,r[8]*a,r[9]*a,r[10]*a,0,t.x,t.y,t.z,1)},xyz:function(t,e,i){this.identity();var r=this.val;return r[12]=t,r[13]=e,r[14]=i,this},scaling:function(t,e,i){this.zero();var r=this.val;return r[0]=t,r[5]=e,r[10]=i,r[15]=1,this},identity:function(){return this.setValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)},transpose:function(){var t=this.val,e=t[1],i=t[2],r=t[3],s=t[6],n=t[7],a=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=e,t[6]=t[9],t[7]=t[13],t[8]=i,t[9]=s,t[11]=t[14],t[12]=r,t[13]=n,t[14]=a,this},getInverse:function(t){return this.copy(t),this.invert()},invert:function(){var t=this.val,e=t[0],i=t[1],r=t[2],s=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],d=t[10],c=t[11],f=t[12],p=t[13],g=t[14],m=t[15],v=e*a-i*n,y=e*o-r*n,x=e*h-s*n,T=i*o-r*a,w=i*h-s*a,b=r*h-s*o,S=l*p-u*f,C=l*g-d*f,E=l*m-c*f,A=u*g-d*p,_=u*m-c*p,M=d*m-c*g,R=v*M-y*_+x*A+T*E-w*C+b*S;return R?(R=1/R,this.setValues((a*M-o*_+h*A)*R,(r*_-i*M-s*A)*R,(p*b-g*w+m*T)*R,(d*w-u*b-c*T)*R,(o*E-n*M-h*C)*R,(e*M-r*E+s*C)*R,(g*x-f*b-m*y)*R,(l*b-d*x+c*y)*R,(n*_-a*E+h*S)*R,(i*E-e*_-s*S)*R,(f*w-p*x+m*v)*R,(u*x-l*w-c*v)*R,(a*C-n*A-o*S)*R,(e*A-i*C+r*S)*R,(p*y-f*T-g*v)*R,(l*T-u*y+d*v)*R)):this},adjoint:function(){var t=this.val,e=t[0],i=t[1],r=t[2],s=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],d=t[10],c=t[11],f=t[12],p=t[13],g=t[14],m=t[15];return this.setValues(a*(d*m-c*g)-u*(o*m-h*g)+p*(o*c-h*d),-(i*(d*m-c*g)-u*(r*m-s*g)+p*(r*c-s*d)),i*(o*m-h*g)-a*(r*m-s*g)+p*(r*h-s*o),-(i*(o*c-h*d)-a*(r*c-s*d)+u*(r*h-s*o)),-(n*(d*m-c*g)-l*(o*m-h*g)+f*(o*c-h*d)),e*(d*m-c*g)-l*(r*m-s*g)+f*(r*c-s*d),-(e*(o*m-h*g)-n*(r*m-s*g)+f*(r*h-s*o)),e*(o*c-h*d)-n*(r*c-s*d)+l*(r*h-s*o),n*(u*m-c*p)-l*(a*m-h*p)+f*(a*c-h*u),-(e*(u*m-c*p)-l*(i*m-s*p)+f*(i*c-s*u)),e*(a*m-h*p)-n*(i*m-s*p)+f*(i*h-s*a),-(e*(a*c-h*u)-n*(i*c-s*u)+l*(i*h-s*a)),-(n*(u*g-d*p)-l*(a*g-o*p)+f*(a*d-o*u)),e*(u*g-d*p)-l*(i*g-r*p)+f*(i*d-r*u),-(e*(a*g-o*p)-n*(i*g-r*p)+f*(i*o-r*a)),e*(a*d-o*u)-n*(i*d-r*u)+l*(i*o-r*a))},determinant:function(){var t=this.val,e=t[0],i=t[1],r=t[2],s=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],d=t[10],c=t[11],f=t[12],p=t[13],g=t[14],m=t[15];return(e*a-i*n)*(d*m-c*g)-(e*o-r*n)*(u*m-c*p)+(e*h-s*n)*(u*g-d*p)+(i*o-r*a)*(l*m-c*f)-(i*h-s*a)*(l*g-d*f)+(r*h-s*o)*(l*p-u*f)},multiply:function(t){var e=this.val,i=e[0],r=e[1],s=e[2],n=e[3],a=e[4],o=e[5],h=e[6],l=e[7],u=e[8],d=e[9],c=e[10],f=e[11],p=e[12],g=e[13],m=e[14],v=e[15],y=t.val,x=y[0],T=y[1],w=y[2],b=y[3];return e[0]=x*i+T*a+w*u+b*p,e[1]=x*r+T*o+w*d+b*g,e[2]=x*s+T*h+w*c+b*m,e[3]=x*n+T*l+w*f+b*v,x=y[4],T=y[5],w=y[6],b=y[7],e[4]=x*i+T*a+w*u+b*p,e[5]=x*r+T*o+w*d+b*g,e[6]=x*s+T*h+w*c+b*m,e[7]=x*n+T*l+w*f+b*v,x=y[8],T=y[9],w=y[10],b=y[11],e[8]=x*i+T*a+w*u+b*p,e[9]=x*r+T*o+w*d+b*g,e[10]=x*s+T*h+w*c+b*m,e[11]=x*n+T*l+w*f+b*v,x=y[12],T=y[13],w=y[14],b=y[15],e[12]=x*i+T*a+w*u+b*p,e[13]=x*r+T*o+w*d+b*g,e[14]=x*s+T*h+w*c+b*m,e[15]=x*n+T*l+w*f+b*v,this},multiplyLocal:function(t){var e=this.val,i=t.val;return this.setValues(e[0]*i[0]+e[1]*i[4]+e[2]*i[8]+e[3]*i[12],e[0]*i[1]+e[1]*i[5]+e[2]*i[9]+e[3]*i[13],e[0]*i[2]+e[1]*i[6]+e[2]*i[10]+e[3]*i[14],e[0]*i[3]+e[1]*i[7]+e[2]*i[11]+e[3]*i[15],e[4]*i[0]+e[5]*i[4]+e[6]*i[8]+e[7]*i[12],e[4]*i[1]+e[5]*i[5]+e[6]*i[9]+e[7]*i[13],e[4]*i[2]+e[5]*i[6]+e[6]*i[10]+e[7]*i[14],e[4]*i[3]+e[5]*i[7]+e[6]*i[11]+e[7]*i[15],e[8]*i[0]+e[9]*i[4]+e[10]*i[8]+e[11]*i[12],e[8]*i[1]+e[9]*i[5]+e[10]*i[9]+e[11]*i[13],e[8]*i[2]+e[9]*i[6]+e[10]*i[10]+e[11]*i[14],e[8]*i[3]+e[9]*i[7]+e[10]*i[11]+e[11]*i[15],e[12]*i[0]+e[13]*i[4]+e[14]*i[8]+e[15]*i[12],e[12]*i[1]+e[13]*i[5]+e[14]*i[9]+e[15]*i[13],e[12]*i[2]+e[13]*i[6]+e[14]*i[10]+e[15]*i[14],e[12]*i[3]+e[13]*i[7]+e[14]*i[11]+e[15]*i[15])},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var i=t.val,r=e.val,s=i[0],n=i[4],a=i[8],o=i[12],h=i[1],l=i[5],u=i[9],d=i[13],c=i[2],f=i[6],p=i[10],g=i[14],m=i[3],v=i[7],y=i[11],x=i[15],T=r[0],w=r[4],b=r[8],S=r[12],C=r[1],E=r[5],A=r[9],_=r[13],M=r[2],R=r[6],P=r[10],O=r[14],L=r[3],F=r[7],D=r[11],I=r[15];return this.setValues(s*T+n*C+a*M+o*L,h*T+l*C+u*M+d*L,c*T+f*C+p*M+g*L,m*T+v*C+y*M+x*L,s*w+n*E+a*R+o*F,h*w+l*E+u*R+d*F,c*w+f*E+p*R+g*F,m*w+v*E+y*R+x*F,s*b+n*A+a*P+o*D,h*b+l*A+u*P+d*D,c*b+f*A+p*P+g*D,m*b+v*A+y*P+x*D,s*S+n*_+a*O+o*I,h*S+l*_+u*O+d*I,c*S+f*_+p*O+g*I,m*S+v*_+y*O+x*I)},translate:function(t){return this.translateXYZ(t.x,t.y,t.z)},translateXYZ:function(t,e,i){var r=this.val;return r[12]=r[0]*t+r[4]*e+r[8]*i+r[12],r[13]=r[1]*t+r[5]*e+r[9]*i+r[13],r[14]=r[2]*t+r[6]*e+r[10]*i+r[14],r[15]=r[3]*t+r[7]*e+r[11]*i+r[15],this},scale:function(t){return this.scaleXYZ(t.x,t.y,t.z)},scaleXYZ:function(t,e,i){var r=this.val;return r[0]=r[0]*t,r[1]=r[1]*t,r[2]=r[2]*t,r[3]=r[3]*t,r[4]=r[4]*e,r[5]=r[5]*e,r[6]=r[6]*e,r[7]=r[7]*e,r[8]=r[8]*i,r[9]=r[9]*i,r[10]=r[10]*i,r[11]=r[11]*i,this},makeRotationAxis:function(t,e){var i=Math.cos(e),r=Math.sin(e),s=1-i,n=t.x,a=t.y,o=t.z,h=s*n,l=s*a;return this.setValues(h*n+i,h*a-r*o,h*o+r*a,0,h*a+r*o,l*a+i,l*o-r*n,0,h*o-r*a,l*o+r*n,s*o*o+i,0,0,0,0,1)},rotate:function(t,e){var i=this.val,r=e.x,s=e.y,a=e.z,o=Math.sqrt(r*r+s*s+a*a);if(Math.abs(o)1?void 0!==r?(s=(r-t)/(r-i))<0&&(s=0):s=1:s<0&&(s=0),s}},15746(t,e,i){var r=i(83419),s=i(94434),n=i(29747),a=i(25836),o=1e-6,h=new Int8Array([1,2,0]),l=new Float32Array([0,0,0]),u=new a(1,0,0),d=new a(0,1,0),c=new a,f=new s,p=new r({initialize:function(t,e,i,r){this.onChangeCallback=n,this.set(t,e,i,r)},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},w:{get:function(){return this._w},set:function(t){this._w=t,this.onChangeCallback(this)}},copy:function(t){return this.set(t)},set:function(t,e,i,r,s){return void 0===s&&(s=!0),"object"==typeof t?(this._x=t.x||0,this._y=t.y||0,this._z=t.z||0,this._w=t.w||0):(this._x=t||0,this._y=e||0,this._z=i||0,this._w=r||0),s&&this.onChangeCallback(this),this},add:function(t){return this._x+=t.x,this._y+=t.y,this._z+=t.z,this._w+=t.w,this.onChangeCallback(this),this},subtract:function(t){return this._x-=t.x,this._y-=t.y,this._z-=t.z,this._w-=t.w,this.onChangeCallback(this),this},scale:function(t){return this._x*=t,this._y*=t,this._z*=t,this._w*=t,this.onChangeCallback(this),this},length:function(){var t=this.x,e=this.y,i=this.z,r=this.w;return Math.sqrt(t*t+e*e+i*i+r*r)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,r=this.w;return t*t+e*e+i*i+r*r},normalize:function(){var t=this.x,e=this.y,i=this.z,r=this.w,s=t*t+e*e+i*i+r*r;return s>0&&(s=1/Math.sqrt(s),this._x=t*s,this._y=e*s,this._z=i*s,this._w=r*s),this.onChangeCallback(this),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,r=this.y,s=this.z,n=this.w;return this.set(i+e*(t.x-i),r+e*(t.y-r),s+e*(t.z-s),n+e*(t.w-n))},rotationTo:function(t,e){var i=t.x*e.x+t.y*e.y+t.z*e.z;return i<-.999999?(c.copy(u).cross(t).length().999999?this.set(0,0,0,1):(c.copy(t).cross(e),this._x=c.x,this._y=c.y,this._z=c.z,this._w=1+i,this.normalize())},setAxes:function(t,e,i){var r=f.val;return r[0]=e.x,r[3]=e.y,r[6]=e.z,r[1]=i.x,r[4]=i.y,r[7]=i.z,r[2]=-t.x,r[5]=-t.y,r[8]=-t.z,this.fromMat3(f).normalize()},identity:function(){return this.set(0,0,0,1)},setAxisAngle:function(t,e){e*=.5;var i=Math.sin(e);return this.set(i*t.x,i*t.y,i*t.z,Math.cos(e))},multiply:function(t){var e=this.x,i=this.y,r=this.z,s=this.w,n=t.x,a=t.y,o=t.z,h=t.w;return this.set(e*h+s*n+i*o-r*a,i*h+s*a+r*n-e*o,r*h+s*o+e*a-i*n,s*h-e*n-i*a-r*o)},slerp:function(t,e){var i=this.x,r=this.y,s=this.z,n=this.w,a=t.x,h=t.y,l=t.z,u=t.w,d=i*a+r*h+s*l+n*u;d<0&&(d=-d,a=-a,h=-h,l=-l,u=-u);var c=1-e,f=e;if(1-d>o){var p=Math.acos(d),g=Math.sin(p);c=Math.sin((1-e)*p)/g,f=Math.sin(e*p)/g}return this.set(c*i+f*a,c*r+f*h,c*s+f*l,c*n+f*u)},invert:function(){var t=this.x,e=this.y,i=this.z,r=this.w,s=t*t+e*e+i*i+r*r,n=s?1/s:0;return this.set(-t*n,-e*n,-i*n,r*n)},conjugate:function(){return this._x=-this.x,this._y=-this.y,this._z=-this.z,this.onChangeCallback(this),this},rotateX:function(t){t*=.5;var e=this.x,i=this.y,r=this.z,s=this.w,n=Math.sin(t),a=Math.cos(t);return this.set(e*a+s*n,i*a+r*n,r*a-i*n,s*a-e*n)},rotateY:function(t){t*=.5;var e=this.x,i=this.y,r=this.z,s=this.w,n=Math.sin(t),a=Math.cos(t);return this.set(e*a-r*n,i*a+s*n,r*a+e*n,s*a-i*n)},rotateZ:function(t){t*=.5;var e=this.x,i=this.y,r=this.z,s=this.w,n=Math.sin(t),a=Math.cos(t);return this.set(e*a+i*n,i*a-e*n,r*a+s*n,s*a-r*n)},calculateW:function(){var t=this.x,e=this.y,i=this.z;return this.w=-Math.sqrt(1-t*t-e*e-i*i),this},setFromEuler:function(t,e){var i=t.x/2,r=t.y/2,s=t.z/2,n=Math.cos(i),a=Math.cos(r),o=Math.cos(s),h=Math.sin(i),l=Math.sin(r),u=Math.sin(s);switch(t.order){case"XYZ":this.set(h*a*o+n*l*u,n*l*o-h*a*u,n*a*u+h*l*o,n*a*o-h*l*u,e);break;case"YXZ":this.set(h*a*o+n*l*u,n*l*o-h*a*u,n*a*u-h*l*o,n*a*o+h*l*u,e);break;case"ZXY":this.set(h*a*o-n*l*u,n*l*o+h*a*u,n*a*u+h*l*o,n*a*o-h*l*u,e);break;case"ZYX":this.set(h*a*o-n*l*u,n*l*o+h*a*u,n*a*u-h*l*o,n*a*o+h*l*u,e);break;case"YZX":this.set(h*a*o+n*l*u,n*l*o+h*a*u,n*a*u-h*l*o,n*a*o-h*l*u,e);break;case"XZY":this.set(h*a*o-n*l*u,n*l*o-h*a*u,n*a*u+h*l*o,n*a*o+h*l*u,e)}return this},setFromRotationMatrix:function(t){var e,i=t.val,r=i[0],s=i[4],n=i[8],a=i[1],o=i[5],h=i[9],l=i[2],u=i[6],d=i[10],c=r+o+d;return c>0?(e=.5/Math.sqrt(c+1),this.set((u-h)*e,(n-l)*e,(a-s)*e,.25/e)):r>o&&r>d?(e=2*Math.sqrt(1+r-o-d),this.set(.25*e,(s+a)/e,(n+l)/e,(u-h)/e)):o>d?(e=2*Math.sqrt(1+o-r-d),this.set((s+a)/e,.25*e,(h+u)/e,(n-l)/e)):(e=2*Math.sqrt(1+d-r-o),this.set((n+l)/e,(h+u)/e,.25*e,(a-s)/e)),this},fromMat3:function(t){var e,i=t.val,r=i[0]+i[4]+i[8];if(r>0)e=Math.sqrt(r+1),this.w=.5*e,e=.5/e,this._x=(i[7]-i[5])*e,this._y=(i[2]-i[6])*e,this._z=(i[3]-i[1])*e;else{var s=0;i[4]>i[0]&&(s=1),i[8]>i[3*s+s]&&(s=2);var n=h[s],a=h[n];e=Math.sqrt(i[3*s+s]-i[3*n+n]-i[3*a+a]+1),l[s]=.5*e,e=.5/e,l[n]=(i[3*n+s]+i[3*s+n])*e,l[a]=(i[3*a+s]+i[3*s+a])*e,this._x=l[0],this._y=l[1],this._z=l[2],this._w=(i[3*a+n]-i[3*n+a])*e}return this.onChangeCallback(this),this}});t.exports=p},43396(t,e,i){var r=i(36383);t.exports=function(t){return t*r.RAD_TO_DEG}},74362(t){t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI;return t.x=Math.cos(i)*e,t.y=Math.sin(i)*e,t}},60706(t){t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI,r=2*Math.random()-1,s=Math.sqrt(1-r*r)*e;return t.x=Math.cos(i)*s,t.y=Math.sin(i)*s,t.z=r*e,t}},67421(t){t.exports=function(t,e){return void 0===e&&(e=1),t.x=(2*Math.random()-1)*e,t.y=(2*Math.random()-1)*e,t.z=(2*Math.random()-1)*e,t.w=(2*Math.random()-1)*e,t}},36305(t){t.exports=function(t,e){var i=t.x,r=t.y;return t.x=i*Math.cos(e)-r*Math.sin(e),t.y=i*Math.sin(e)+r*Math.cos(e),t}},11520(t){t.exports=function(t,e,i,r){var s=Math.cos(r),n=Math.sin(r),a=t.x-e,o=t.y-i;return t.x=a*s-o*n+e,t.y=a*n+o*s+i,t}},1163(t){t.exports=function(t,e,i,r,s){var n=r+Math.atan2(t.y-i,t.x-e);return t.x=e+s*Math.cos(n),t.y=i+s*Math.sin(n),t}},70336(t){t.exports=function(t,e,i,r,s){return t.x=e+s*Math.cos(r),t.y=i+s*Math.sin(r),t}},72678(t,e,i){var r=i(25836),s=i(37867),n=i(15746),a=new s,o=new n,h=new r;t.exports=function(t,e,i){return o.setAxisAngle(e,i),a.fromRotationTranslation(o,h.set(0,0,0)),t.transformMat4(a)}},2284(t){t.exports=function(t){return t>0?Math.ceil(t):Math.floor(t)}},41013(t){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var r=Math.pow(i,-e);return Math.round(t*r)/r}},7602(t){t.exports=function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)}},54261(t){t.exports=function(t,e,i){return(t=Math.max(0,Math.min(1,(t-e)/(i-e))))*t*t*(t*(6*t-15)+10)}},44408(t,e,i){var r=i(26099);t.exports=function(t,e,i,s){void 0===s&&(s=new r);var n=0,a=0;return t>0&&t<=e*i&&(n=t>e-1?t-(a=Math.floor(t/e))*e:t),s.set(n,a)}},85955(t,e,i){var r=i(26099);t.exports=function(t,e,i,s,n,a,o,h){void 0===h&&(h=new r);var l=Math.sin(n),u=Math.cos(n),d=u*a,c=l*a,f=-l*o,p=u*o,g=1/(d*p+f*-c);return h.x=p*g*t+-f*g*e+(s*f-i*p)*g,h.y=d*g*e+-c*g*t+(-s*d+i*c)*g,h}},26099(t,e,i){var r=i(83419),s=i(43855),n=new r({initialize:function(t,e){this.x=0,this.y=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0):(void 0===e&&(e=t),this.x=t||0,this.y=e||0)},clone:function(){return new n(this.x,this.y)},copy:function(t){return this.x=t.x||0,this.y=t.y||0,this},setFromObject:function(t){return this.x=t.x||0,this.y=t.y||0,this},set:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setTo:function(t,e){return this.set(t,e)},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},invert:function(){return this.set(this.y,this.x)},setToPolar:function(t,e){return null==e&&(e=1),this.x=Math.cos(t)*e,this.y=Math.sin(t)*e,this},equals:function(t){return this.x===t.x&&this.y===t.y},fuzzyEquals:function(t,e){return s(this.x,t.x,e)&&s(this.y,t.y,e)},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},setAngle:function(t){return this.setToPolar(t,this.length())},add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t):(this.x=0,this.y=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},negate:function(){return this.x=-this.x,this.y=-this.y,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},length:function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)},setLength:function(t){return this.normalize().scale(t)},lengthSq:function(){var t=this.x,e=this.y;return t*t+e*e},normalize:function(){var t=this.x,e=this.y,i=t*t+e*e;return i>0&&(i=1/Math.sqrt(i),this.x=t*i,this.y=e*i),this},normalizeRightHand:function(){var t=this.x;return this.x=-1*this.y,this.y=t,this},normalizeLeftHand:function(){var t=this.x;return this.x=this.y,this.y=-1*t,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,r=this.y;return this.x=i+e*(t.x-i),this.y=r+e*(t.y-r),this},transformMat3:function(t){var e=this.x,i=this.y,r=t.val;return this.x=r[0]*e+r[3]*i+r[6],this.y=r[1]*e+r[4]*i+r[7],this},transformMat4:function(t){var e=this.x,i=this.y,r=t.val;return this.x=r[0]*e+r[4]*i+r[12],this.y=r[1]*e+r[5]*i+r[13],this},reset:function(){return this.x=0,this.y=0,this},limit:function(t){var e=this.length();return e&&e>t&&this.scale(t/e),this},reflect:function(t){return t=t.clone().normalize(),this.subtract(t.scale(2*this.dot(t)))},mirror:function(t){return this.reflect(t).negate()},rotate:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e*this.x-i*this.y,i*this.x+e*this.y)},project:function(t){var e=this.dot(t)/t.dot(t);return this.copy(t).scale(e)},projectUnit:function(t,e){void 0===e&&(e=new n);var i=this.x*t.x+this.y*t.y;return 0!==i&&(e.x=i*t.x,e.y=i*t.y),e}});n.ZERO=new n,n.RIGHT=new n(1,0),n.LEFT=new n(-1,0),n.UP=new n(0,-1),n.DOWN=new n(0,1),n.ONE=new n(1,1),t.exports=n},25836(t,e,i){var r=new(i(83419))({initialize:function(t,e,i){this.x=0,this.y=0,this.z=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0)},up:function(){return this.x=0,this.y=1,this.z=0,this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clone:function(){return new r(this.x,this.y,this.z)},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},crossVectors:function(t,e){var i=t.x,r=t.y,s=t.z,n=e.x,a=e.y,o=e.z;return this.x=r*o-s*a,this.y=s*n-i*o,this.z=i*a-r*n,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this},set:function(t,e,i){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0),this},setFromMatrixPosition:function(t){return this.fromArray(t.val,12)},setFromMatrixColumn:function(t,e){return this.fromArray(t.val,4*e)},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addScale:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t):(this.x=0,this.y=0,this.z=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,r=t.z-this.z||0;return Math.sqrt(e*e+i*i+r*r)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,r=t.z-this.z||0;return e*e+i*i+r*r},length:function(){var t=this.x,e=this.y,i=this.z;return Math.sqrt(t*t+e*e+i*i)},lengthSq:function(){var t=this.x,e=this.y,i=this.z;return t*t+e*e+i*i},normalize:function(){var t=this.x,e=this.y,i=this.z,r=t*t+e*e+i*i;return r>0&&(r=1/Math.sqrt(r),this.x=t*r,this.y=e*r,this.z=i*r),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},cross:function(t){var e=this.x,i=this.y,r=this.z,s=t.x,n=t.y,a=t.z;return this.x=i*a-r*n,this.y=r*s-e*a,this.z=e*n-i*s,this},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,r=this.y,s=this.z;return this.x=i+e*(t.x-i),this.y=r+e*(t.y-r),this.z=s+e*(t.z-s),this},applyMatrix3:function(t){var e=this.x,i=this.y,r=this.z,s=t.val;return this.x=s[0]*e+s[3]*i+s[6]*r,this.y=s[1]*e+s[4]*i+s[7]*r,this.z=s[2]*e+s[5]*i+s[8]*r,this},applyMatrix4:function(t){var e=this.x,i=this.y,r=this.z,s=t.val,n=1/(s[3]*e+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*e+s[4]*i+s[8]*r+s[12])*n,this.y=(s[1]*e+s[5]*i+s[9]*r+s[13])*n,this.z=(s[2]*e+s[6]*i+s[10]*r+s[14])*n,this},transformMat3:function(t){var e=this.x,i=this.y,r=this.z,s=t.val;return this.x=e*s[0]+i*s[3]+r*s[6],this.y=e*s[1]+i*s[4]+r*s[7],this.z=e*s[2]+i*s[5]+r*s[8],this},transformMat4:function(t){var e=this.x,i=this.y,r=this.z,s=t.val;return this.x=s[0]*e+s[4]*i+s[8]*r+s[12],this.y=s[1]*e+s[5]*i+s[9]*r+s[13],this.z=s[2]*e+s[6]*i+s[10]*r+s[14],this},transformCoordinates:function(t){var e=this.x,i=this.y,r=this.z,s=t.val,n=e*s[0]+i*s[4]+r*s[8]+s[12],a=e*s[1]+i*s[5]+r*s[9]+s[13],o=e*s[2]+i*s[6]+r*s[10]+s[14],h=e*s[3]+i*s[7]+r*s[11]+s[15];return this.x=n/h,this.y=a/h,this.z=o/h,this},transformQuat:function(t){var e=this.x,i=this.y,r=this.z,s=t.x,n=t.y,a=t.z,o=t.w,h=o*e+n*r-a*i,l=o*i+a*e-s*r,u=o*r+s*i-n*e,d=-s*e-n*i-a*r;return this.x=h*o+d*-s+l*-a-u*-n,this.y=l*o+d*-n+u*-s-h*-a,this.z=u*o+d*-a+h*-n-l*-s,this},project:function(t){var e=this.x,i=this.y,r=this.z,s=t.val,n=s[0],a=s[1],o=s[2],h=s[3],l=s[4],u=s[5],d=s[6],c=s[7],f=s[8],p=s[9],g=s[10],m=s[11],v=s[12],y=s[13],x=s[14],T=1/(e*h+i*c+r*m+s[15]);return this.x=(e*n+i*l+r*f+v)*T,this.y=(e*a+i*u+r*p+y)*T,this.z=(e*o+i*d+r*g+x)*T,this},projectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unprojectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unproject:function(t,e){var i=t.x,r=t.y,s=t.z,n=t.w,a=this.x-i,o=n-this.y-1-r,h=this.z;return this.x=2*a/s-1,this.y=2*o/n-1,this.z=2*h-1,this.project(e)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});r.ZERO=new r,r.RIGHT=new r(1,0,0),r.LEFT=new r(-1,0,0),r.UP=new r(0,-1,0),r.DOWN=new r(0,1,0),r.FORWARD=new r(0,0,1),r.BACK=new r(0,0,-1),r.ONE=new r(1,1,1),t.exports=r},61369(t,e,i){var r=new(i(83419))({initialize:function(t,e,i,r){this.x=0,this.y=0,this.z=0,this.w=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=r||0)},clone:function(){return new r(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this.w=t.w||0,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},set:function(t,e,i,r){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=r||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this.w+=t.w||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this.w-=t.w||0,this},scale:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},length:function(){var t=this.x,e=this.y,i=this.z,r=this.w;return Math.sqrt(t*t+e*e+i*i+r*r)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,r=this.w;return t*t+e*e+i*i+r*r},normalize:function(){var t=this.x,e=this.y,i=this.z,r=this.w,s=t*t+e*e+i*i+r*r;return s>0&&(s=1/Math.sqrt(s),this.x=t*s,this.y=e*s,this.z=i*s,this.w=r*s),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,r=this.y,s=this.z,n=this.w;return this.x=i+e*(t.x-i),this.y=r+e*(t.y-r),this.z=s+e*(t.z-s),this.w=n+e*(t.w-n),this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this.w*=t.w||1,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this.w/=t.w||1,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,r=t.z-this.z||0,s=t.w-this.w||0;return Math.sqrt(e*e+i*i+r*r+s*s)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,r=t.z-this.z||0,s=t.w-this.w||0;return e*e+i*i+r*r+s*s},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},transformMat4:function(t){var e=this.x,i=this.y,r=this.z,s=this.w,n=t.val;return this.x=n[0]*e+n[4]*i+n[8]*r+n[12]*s,this.y=n[1]*e+n[5]*i+n[9]*r+n[13]*s,this.z=n[2]*e+n[6]*i+n[10]*r+n[14]*s,this.w=n[3]*e+n[7]*i+n[11]*r+n[15]*s,this},transformQuat:function(t){var e=this.x,i=this.y,r=this.z,s=t.x,n=t.y,a=t.z,o=t.w,h=o*e+n*r-a*i,l=o*i+a*e-s*r,u=o*r+s*i-n*e,d=-s*e-n*i-a*r;return this.x=h*o+d*-s+l*-a-u*-n,this.y=l*o+d*-n+u*-s-h*-a,this.z=u*o+d*-a+h*-n-l*-s,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});r.prototype.sub=r.prototype.subtract,r.prototype.mul=r.prototype.multiply,r.prototype.div=r.prototype.divide,r.prototype.dist=r.prototype.distance,r.prototype.distSq=r.prototype.distanceSq,r.prototype.len=r.prototype.length,r.prototype.lenSq=r.prototype.lengthSq,t.exports=r},60417(t){t.exports=function(t,e,i){return Math.abs(t-e)<=i}},15994(t){t.exports=function(t,e,i){var r=i-e;return e+((t-e)%r+r)%r}},31040(t){t.exports=function(t,e,i,r){return Math.atan2(r-e,i-t)}},55495(t){t.exports=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}},128(t){t.exports=function(t,e){return Math.atan2(e.x-t.x,e.y-t.y)}},41273(t){t.exports=function(t,e,i,r){return Math.atan2(i-t,r-e)}},1432(t,e,i){var r=i(36383);t.exports=function(t){return t>Math.PI&&(t-=r.TAU),Math.abs(((t+r.PI_OVER_2)%r.TAU-r.TAU)%r.TAU)}},49127(t,e,i){var r=i(12407);t.exports=function(t,e){return r(e-t)}},52285(t,e,i){var r=i(36383),s=i(12407),n=r.TAU;t.exports=function(t,e){var i=s(e-t);return i>0&&(i-=n),i}},67317(t,e,i){var r=i(86554);t.exports=function(t,e){return r(e-t)}},12407(t){t.exports=function(t){return(t%=2*Math.PI)>=0?t:t+2*Math.PI}},53993(t,e,i){var r=i(99472);t.exports=function(){return r(-Math.PI,Math.PI)}},86564(t,e,i){var r=i(99472);t.exports=function(){return r(-180,180)}},90154(t,e,i){var r=i(12407);t.exports=function(t){return r(t+Math.PI)}},48736(t,e,i){var r=i(36383);t.exports=function(t,e,i){return void 0===i&&(i=.05),t===e||(Math.abs(e-t)<=i||Math.abs(e-t)>=r.TAU-i?t=e:(Math.abs(e-t)>Math.PI&&(et?t+=i:e=1?1:1/e*(1+(e*t|0))}},49752(t,e,i){t.exports=i(72251)},75698(t){t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.ceil(t-e)}},43855(t){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),Math.abs(t-e)e-i}},94977(t){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t1?t[i]-(r(s-i,t[i],t[i],t[i-1],t[i-1])-t[i]):r(s-n,t[n?n-1:0],t[n],t[i1?r(t[i],t[i-1],i-s):r(t[n],t[n+1>i?i:n+1],s-n)}},32112(t){t.exports=function(t,e,i,r){return function(t,e){var i=1-t;return i*i*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,i)+function(t,e){return t*t*e}(t,r)}},47235(t,e,i){var r=i(7602);t.exports=function(t,e,i){return e+(i-e)*r(t,0,1)}},50178(t,e,i){var r=i(54261);t.exports=function(t,e,i){return e+(i-e)*r(t,0,1)}},38289(t,e,i){t.exports={Bezier:i(89318),CatmullRom:i(77259),CubicBezier:i(36316),Linear:i(28392),QuadraticBezier:i(32112),SmoothStep:i(47235),SmootherStep:i(50178)}},98439(t){t.exports=function(t){var e=Math.log(t)/.6931471805599453;return 1<0&&!(t&t-1)&&e>0&&!(e&e-1)}},81230(t){t.exports=function(t){return t>0&&!(t&t-1)}},49001(t,e,i){t.exports={GetNext:i(98439),IsSize:i(50030),IsValue:i(81230)}},28453(t,e,i){var r=new(i(83419))({initialize:function(t){void 0===t&&(t=[(Date.now()*Math.random()).toString()]),this.c=1,this.s0=0,this.s1=0,this.s2=0,this.n=0,this.signs=[-1,1],t&&this.init(t)},rnd:function(){var t=2091639*this.s0+2.3283064365386963e-10*this.c;return this.c=0|t,this.s0=this.s1,this.s1=this.s2,this.s2=t-this.c,this.s2},hash:function(t){var e,i=this.n;t=t.toString();for(var r=0;r>>0,i=(e*=i)>>>0,i+=4294967296*(e-=i);return this.n=i,2.3283064365386963e-10*(i>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e0;e--){var i=Math.floor(this.frac()*(e+1)),r=t[i];t[i]=t[e],t[e]=r}return t}});t.exports=r},63448(t){t.exports=function(t,e,i,r){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.ceil(t/e),r?(i+t)/e:i+t)}},56583(t){t.exports=function(t,e,i,r){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.floor(t/e),r?(i+t)/e:i+t)}},77720(t){t.exports=function(t,e,i,r){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.round(t/e),r?(i+t)/e:i+t)}},73697(t,e,i){t.exports={Ceil:i(63448),Floor:i(56583),To:i(77720)}},71289(t,e,i){var r=i(83419),s=i(92209),n=i(88571),a=new r({Extends:n,Mixins:[s.Acceleration,s.Angular,s.Bounce,s.Collision,s.Debug,s.Drag,s.Enable,s.Friction,s.Gravity,s.Immovable,s.Mass,s.Pushable,s.Size,s.Velocity],initialize:function(t,e,i,r,s){n.call(this,t,e,i,r,s),this.body=null}});t.exports=a},86689(t,e,i){var r=i(83419),s=i(39506),n=i(20339),a=i(89774),o=i(66022),h=i(95540),l=i(46975),u=i(72441),d=i(47956),c=i(37277),f=i(44594),p=i(26099),g=i(82248),m=new r({initialize:function(t){this.scene=t,this.systems=t.sys,this.config=this.getConfig(),this.world,this.add,this._category=1,t.sys.events.once(f.BOOT,this.boot,this),t.sys.events.on(f.START,this.start,this)},boot:function(){this.world=new g(this.scene,this.config),this.add=new o(this.world),this.systems.events.once(f.DESTROY,this.destroy,this)},start:function(){this.world||(this.world=new g(this.scene,this.config),this.add=new o(this.world));var t=this.systems.events;h(this.config,"customUpdate",!1)||t.on(f.UPDATE,this.world.update,this.world),t.on(f.POST_UPDATE,this.world.postUpdate,this.world),t.once(f.SHUTDOWN,this.shutdown,this)},enableUpdate:function(){this.systems.events.on(f.UPDATE,this.world.update,this.world)},disableUpdate:function(){this.systems.events.off(f.UPDATE,this.world.update,this.world)},getConfig:function(){var t=this.systems.game.config.physics,e=this.systems.settings.physics;return l(h(e,"arcade",{}),h(t,"arcade",{}))},nextCategory:function(){return this._category=this._category<<1,this._category},overlap:function(t,e,i,r,s){return void 0===i&&(i=null),void 0===r&&(r=null),void 0===s&&(s=i),this.world.collideObjects(t,e,i,r,s,!0)},collide:function(t,e,i,r,s){return void 0===i&&(i=null),void 0===r&&(r=null),void 0===s&&(s=i),this.world.collideObjects(t,e,i,r,s,!1)},collideTiles:function(t,e,i,r,s){return this.world.collideTiles(t,e,i,r,s)},overlapTiles:function(t,e,i,r,s){return this.world.overlapTiles(t,e,i,r,s)},pause:function(){return this.world.pause()},resume:function(){return this.world.resume()},accelerateTo:function(t,e,i,r,s,n){void 0===r&&(r=60);var a=Math.atan2(i-t.y,e-t.x);return t.body.acceleration.setToPolar(a,r),void 0!==s&&void 0!==n&&t.body.maxVelocity.set(s,n),a},accelerateToObject:function(t,e,i,r,s){return this.accelerateTo(t,e.x,e.y,i,r,s)},closest:function(t,e){e||(e=Array.from(this.world.bodies));for(var i=Number.MAX_VALUE,r=null,s=t.x,n=t.y,o=e.length,h=0;hi&&(r=l,i=d)}}return r},moveTo:function(t,e,i,r,s){void 0===r&&(r=60),void 0===s&&(s=0);var a=Math.atan2(i-t.y,e-t.x);return s>0&&(r=n(t.x,t.y,e,i)/(s/1e3)),t.body.velocity.setToPolar(a,r),a},moveToObject:function(t,e,i,r){return this.moveTo(t,e.x,e.y,i,r)},velocityFromAngle:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new p),i.setToPolar(s(t),e)},velocityFromRotation:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new p),i.setToPolar(t,e)},overlapRect:function(t,e,i,r,s,n){return d(this.world,t,e,i,r,s,n)},overlapCirc:function(t,e,i,r,s){return u(this.world,t,e,i,r,s)},shutdown:function(){if(this.world){var t=this.systems.events;t.off(f.UPDATE,this.world.update,this.world),t.off(f.POST_UPDATE,this.world.postUpdate,this.world),t.off(f.SHUTDOWN,this.shutdown,this),this.add.destroy(),this.world.destroy(),this.add=null,this.world=null,this._category=1}},destroy:function(){this.shutdown(),this.scene.sys.events.off(f.START,this.start,this),this.scene=null,this.systems=null}});c.register("ArcadePhysics",m,"arcadePhysics"),t.exports=m},13759(t,e,i){var r=i(83419),s=i(92209),n=i(68287),a=new r({Extends:n,Mixins:[s.Acceleration,s.Angular,s.Bounce,s.Collision,s.Debug,s.Drag,s.Enable,s.Friction,s.Gravity,s.Immovable,s.Mass,s.Pushable,s.Size,s.Velocity],initialize:function(t,e,i,r,s){n.call(this,t,e,i,r,s),this.body=null}});t.exports=a},37742(t,e,i){var r=i(83419),s=i(78389),n=i(37747),a=i(63012),o=i(43396),h=i(87841),l=i(37303),u=i(95829),d=i(26099),c=new r({Mixins:[s],initialize:function(t,e){var i=64,r=64,s=void 0!==e;s&&e.displayWidth&&(i=e.displayWidth,r=e.displayHeight),s||(e={x:0,y:0,angle:0,rotation:0,scaleX:1,scaleY:1,displayOriginX:0,displayOriginY:0}),this.world=t,this.gameObject=s?e:void 0,this.isBody=!0,this.transform={x:e.x,y:e.y,rotation:e.angle,scaleX:e.scaleX,scaleY:e.scaleY,displayOriginX:e.displayOriginX,displayOriginY:e.displayOriginY},this.debugShowBody=t.defaults.debugShowBody,this.debugShowVelocity=t.defaults.debugShowVelocity,this.debugBodyColor=t.defaults.bodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new d,this.position=new d(e.x-e.scaleX*e.displayOriginX,e.y-e.scaleY*e.displayOriginY),this.prev=this.position.clone(),this.prevFrame=this.position.clone(),this.allowRotation=!0,this.rotation=e.angle,this.preRotation=e.angle,this.width=i,this.height=r,this.sourceWidth=i,this.sourceHeight=r,e.frame&&(this.sourceWidth=e.frame.realWidth,this.sourceHeight=e.frame.realHeight),this.halfWidth=Math.abs(i/2),this.halfHeight=Math.abs(r/2),this.center=new d(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=new d,this.newVelocity=new d,this.deltaMax=new d,this.acceleration=new d,this.allowDrag=!0,this.drag=new d,this.allowGravity=!0,this.gravity=new d,this.bounce=new d,this.worldBounce=null,this.customBoundsRectangle=t.bounds,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.maxVelocity=new d(1e4,1e4),this.maxSpeed=-1,this.friction=new d(1,0),this.useDamping=!1,this.angularVelocity=0,this.angularAcceleration=0,this.angularDrag=0,this.maxAngular=1e3,this.mass=1,this.angle=0,this.speed=0,this.facing=n.FACING_NONE,this.immovable=!1,this.pushable=!0,this.slideFactor=new d(1,1),this.moves=!0,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision=u(!1),this.touching=u(!0),this.wasTouching=u(!0),this.blocked=u(!0),this.syncBounds=!1,this.physicsType=n.DYNAMIC_BODY,this.collisionCategory=1,this.collisionMask=1,this._sx=e.scaleX,this._sy=e.scaleY,this._dx=0,this._dy=0,this._tx=0,this._ty=0,this._bounds=new h,this.directControl=!1,this.autoFrame=this.position.clone()},updateBounds:function(){var t=this.gameObject,e=this.transform;if(t.parentContainer){var i=t.getWorldTransformMatrix(this.world._tempMatrix,this.world._tempMatrix2);e.x=i.tx,e.y=i.ty,e.rotation=o(i.rotation),e.scaleX=i.scaleX,e.scaleY=i.scaleY,e.displayOriginX=t.displayOriginX,e.displayOriginY=t.displayOriginY}else e.x=t.x,e.y=t.y,e.rotation=t.angle,e.scaleX=t.scaleX,e.scaleY=t.scaleY,e.displayOriginX=t.displayOriginX,e.displayOriginY=t.displayOriginY;var r=!1;if(this.syncBounds){var s=t.getBounds(this._bounds);this.width=s.width,this.height=s.height,r=!0}else{var n=Math.abs(e.scaleX),a=Math.abs(e.scaleY);this._sx===n&&this._sy===a||(this.width=this.sourceWidth*n,this.height=this.sourceHeight*a,this._sx=n,this._sy=a,r=!0)}r&&(this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter())},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},updateFromGameObject:function(){this.updateBounds();var t=this.transform;this.position.x=t.x+t.scaleX*(this.offset.x-t.displayOriginX),this.position.y=t.y+t.scaleY*(this.offset.y-t.displayOriginY),this.updateCenter()},resetFlags:function(t){void 0===t&&(t=!1);var e=this.wasTouching,i=this.touching,r=this.blocked;t?u(!0,e):(e.none=i.none,e.up=i.up,e.down=i.down,e.left=i.left,e.right=i.right),u(!0,i),u(!0,r),this.overlapR=0,this.overlapX=0,this.overlapY=0,this.embedded=!1},preUpdate:function(t,e){if(t&&this.resetFlags(),this.gameObject&&this.updateFromGameObject(),this.rotation=this.transform.rotation,this.preRotation=this.rotation,this.moves){var i=this.position;this.prev.x=i.x,this.prev.y=i.y,this.prevFrame.x=i.x,this.prevFrame.y=i.y}t&&this.update(e)},update:function(t){var e=this.prev,i=this.position,r=this.velocity;if(e.set(i.x,i.y),!this.moves)return this._dx=i.x-e.x,void(this._dy=i.y-e.y);if(this.directControl){var s=this.autoFrame;r.set((i.x-s.x)/t,(i.y-s.y)/t),this.world.updateMotion(this,t),this._dx=i.x-s.x,this._dy=i.y-s.y}else this.world.updateMotion(this,t),this.newVelocity.set(r.x*t,r.y*t),i.add(this.newVelocity),this._dx=i.x-e.x,this._dy=i.y-e.y;var n=r.x,o=r.y;if(this.updateCenter(),this.angle=Math.atan2(o,n),this.speed=Math.sqrt(n*n+o*o),this.collideWorldBounds&&this.checkWorldBounds()&&this.onWorldBounds){var h=this.blocked;this.world.emit(a.WORLD_BOUNDS,this,h.up,h.down,h.left,h.right)}},postUpdate:function(){var t=this.position,e=t.x-this.prevFrame.x,i=t.y-this.prevFrame.y,r=this.gameObject;if(this.moves){var s=this.deltaMax.x,a=this.deltaMax.y;0!==s&&0!==e&&(e<0&&e<-s?e=-s:e>0&&e>s&&(e=s)),0!==a&&0!==i&&(i<0&&i<-a?i=-a:i>0&&i>a&&(i=a)),r&&(r.x+=e,r.y+=i)}e<0?this.facing=n.FACING_LEFT:e>0&&(this.facing=n.FACING_RIGHT),i<0?this.facing=n.FACING_UP:i>0&&(this.facing=n.FACING_DOWN),this.allowRotation&&r&&(r.angle+=this.deltaZ()),this._tx=e,this._ty=i,this.autoFrame.set(t.x,t.y)},setBoundsRectangle:function(t){return this.customBoundsRectangle=t||this.world.bounds,this},checkWorldBounds:function(){var t=this.position,e=this.velocity,i=this.blocked,r=this.customBoundsRectangle,s=this.world.checkCollision,n=this.worldBounce?-this.worldBounce.x:-this.bounce.x,a=this.worldBounce?-this.worldBounce.y:-this.bounce.y,o=!1;return t.xr.right&&s.right&&(t.x=r.right-this.width,e.x*=n,i.right=!0,o=!0),t.yr.bottom&&s.down&&(t.y=r.bottom-this.height,e.y*=a,i.down=!0,o=!0),o&&(this.blocked.none=!1,this.updateCenter()),o},setOffset:function(t,e){return void 0===e&&(e=t),this.offset.set(t,e),this},setGameObject:function(t,e){if(void 0===e&&(e=!0),!t||!t.hasTransformComponent)return this;var i=this.world;return this.gameObject&&this.gameObject.body&&(i.disable(this.gameObject),this.gameObject.body=null),t.body&&i.disable(t),this.gameObject=t,t.body=this,this.setSize(),this.enable=e,this},setSize:function(t,e,i){void 0===i&&(i=!0);var r=this.gameObject;if(r&&(!t&&r.frame&&(t=r.frame.realWidth),!e&&r.frame&&(e=r.frame.realHeight)),this.sourceWidth=t,this.sourceHeight=e,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter(),i&&r&&r.getCenter){var s=(r.width-t)/2,n=(r.height-e)/2;this.offset.set(s,n)}return this.isCircle=!1,this.radius=0,this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.isCircle=!0,this.radius=t,this.sourceWidth=2*t,this.sourceHeight=2*t,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter()):this.isCircle=!1,this},reset:function(t,e){this.stop();var i=this.gameObject;i&&(i.setPosition(t,e),this.rotation=i.angle,this.preRotation=i.angle);var r=this.position;i&&i.getTopLeft?i.getTopLeft(r):r.set(t,e),this.prev.copy(r),this.prevFrame.copy(r),this.autoFrame.copy(r),i&&this.updateBounds(),this.updateCenter(),this.collideWorldBounds&&this.checkWorldBounds(),this.resetFlags(!0)},stop:function(){return this.velocity.set(0),this.acceleration.set(0),this.speed=0,this.angularVelocity=0,this.angularAcceleration=0,this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?this.radius>0&&t>=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom&&(this.center.x-t)*(this.center.x-t)+(this.center.y-e)*(this.center.y-e)<=this.radius*this.radius:l(this,t,e)},onFloor:function(){return this.blocked.down},onCeiling:function(){return this.blocked.up},onWall:function(){return this.blocked.left||this.blocked.right},deltaAbsX:function(){return this._dx>0?this._dx:-this._dx},deltaAbsY:function(){return this._dy>0?this._dy:-this._dy},deltaX:function(){return this._dx},deltaY:function(){return this._dy},deltaXFinal:function(){return this._tx},deltaYFinal:function(){return this._ty},deltaZ:function(){return this.rotation-this.preRotation},destroy:function(){this.enable=!1,this.world&&this.world.pendingDestroy.add(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,r=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(t.defaultStrokeWidth,this.debugBodyColor),this.isCircle?t.strokeCircle(i,r,this.width/2):(this.checkCollision.up&&t.lineBetween(e.x,e.y,e.x+this.width,e.y),this.checkCollision.right&&t.lineBetween(e.x+this.width,e.y,e.x+this.width,e.y+this.height),this.checkCollision.down&&t.lineBetween(e.x,e.y+this.height,e.x+this.width,e.y+this.height),this.checkCollision.left&&t.lineBetween(e.x,e.y,e.x,e.y+this.height))),this.debugShowVelocity&&(t.lineStyle(t.defaultStrokeWidth,this.world.defaults.velocityDebugColor,1),t.lineBetween(i,r,i+this.velocity.x/2,r+this.velocity.y/2))},willDrawDebug:function(){return this.debugShowBody||this.debugShowVelocity},setDirectControl:function(t){return void 0===t&&(t=!0),this.directControl=t,this},setCollideWorldBounds:function(t,e,i,r){void 0===t&&(t=!0),this.collideWorldBounds=t;var s=void 0!==e,n=void 0!==i;return(s||n)&&(this.worldBounce||(this.worldBounce=new d),s&&(this.worldBounce.x=e),n&&(this.worldBounce.y=i)),void 0!==r&&(this.onWorldBounds=r),this},setVelocity:function(t,e){return this.velocity.set(t,e),t=this.velocity.x,e=this.velocity.y,this.speed=Math.sqrt(t*t+e*e),this},setVelocityX:function(t){return this.setVelocity(t,this.velocity.y)},setVelocityY:function(t){return this.setVelocity(this.velocity.x,t)},setMaxVelocity:function(t,e){return this.maxVelocity.set(t,e),this},setMaxVelocityX:function(t){return this.maxVelocity.x=t,this},setMaxVelocityY:function(t){return this.maxVelocity.y=t,this},setMaxSpeed:function(t){return this.maxSpeed=t,this},setSlideFactor:function(t,e){return this.slideFactor.set(t,e),this},setBounce:function(t,e){return this.bounce.set(t,e),this},setBounceX:function(t){return this.bounce.x=t,this},setBounceY:function(t){return this.bounce.y=t,this},setAcceleration:function(t,e){return this.acceleration.set(t,e),this},setAccelerationX:function(t){return this.acceleration.x=t,this},setAccelerationY:function(t){return this.acceleration.y=t,this},setAllowDrag:function(t){return void 0===t&&(t=!0),this.allowDrag=t,this},setAllowGravity:function(t){return void 0===t&&(t=!0),this.allowGravity=t,this},setAllowRotation:function(t){return void 0===t&&(t=!0),this.allowRotation=t,this},setDrag:function(t,e){return this.drag.set(t,e),this},setDamping:function(t){return this.useDamping=t,this},setDragX:function(t){return this.drag.x=t,this},setDragY:function(t){return this.drag.y=t,this},setGravity:function(t,e){return this.gravity.set(t,e),this},setGravityX:function(t){return this.gravity.x=t,this},setGravityY:function(t){return this.gravity.y=t,this},setFriction:function(t,e){return this.friction.set(t,e),this},setFrictionX:function(t){return this.friction.x=t,this},setFrictionY:function(t){return this.friction.y=t,this},setAngularVelocity:function(t){return this.angularVelocity=t,this},setAngularAcceleration:function(t){return this.angularAcceleration=t,this},setAngularDrag:function(t){return this.angularDrag=t,this},setMass:function(t){return this.mass=t,this},setImmovable:function(t){return void 0===t&&(t=!0),this.immovable=t,this},setEnable:function(t){return void 0===t&&(t=!0),this.enable=t,this},processX:function(t,e,i,r){this.x+=t,this.updateCenter(),null!==e&&(this.velocity.x=e*this.slideFactor.x);var s=this.blocked;i&&(s.left=!0,s.none=!1),r&&(s.right=!0,s.none=!1)},processY:function(t,e,i,r){this.y+=t,this.updateCenter(),null!==e&&(this.velocity.y=e*this.slideFactor.y);var s=this.blocked;i&&(s.up=!0,s.none=!1),r&&(s.down=!0,s.none=!1)},x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=c},79342(t,e,i){var r=new(i(83419))({initialize:function(t,e,i,r,s,n,a){this.world=t,this.name="",this.active=!0,this.overlapOnly=e,this.object1=i,this.object2=r,this.collideCallback=s,this.processCallback=n,this.callbackContext=a},setName:function(t){return this.name=t,this},update:function(){this.world.collideObjects(this.object1,this.object2,this.collideCallback,this.processCallback,this.callbackContext,this.overlapOnly)},destroy:function(){this.world.removeCollider(this),this.active=!1,this.world=null,this.object1=null,this.object2=null,this.collideCallback=null,this.processCallback=null,this.callbackContext=null}});t.exports=r},66022(t,e,i){var r=i(71289),s=i(13759),n=i(37742),a=i(83419),o=i(37747),h=i(60758),l=i(72624),u=i(71464),d=new a({initialize:function(t){this.world=t,this.scene=t.scene,this.sys=t.scene.sys},collider:function(t,e,i,r,s){return this.world.addCollider(t,e,i,r,s)},overlap:function(t,e,i,r,s){return this.world.addOverlap(t,e,i,r,s)},existing:function(t,e){var i=e?o.STATIC_BODY:o.DYNAMIC_BODY;return this.world.enableBody(t,i),t},staticImage:function(t,e,i,s){var n=new r(this.scene,t,e,i,s);return this.sys.displayList.add(n),this.world.enableBody(n,o.STATIC_BODY),n},image:function(t,e,i,s){var n=new r(this.scene,t,e,i,s);return this.sys.displayList.add(n),this.world.enableBody(n,o.DYNAMIC_BODY),n},staticSprite:function(t,e,i,r){var n=new s(this.scene,t,e,i,r);return this.sys.displayList.add(n),this.sys.updateList.add(n),this.world.enableBody(n,o.STATIC_BODY),n},sprite:function(t,e,i,r){var n=new s(this.scene,t,e,i,r);return this.sys.displayList.add(n),this.sys.updateList.add(n),this.world.enableBody(n,o.DYNAMIC_BODY),n},staticGroup:function(t,e){return this.sys.updateList.add(new u(this.world,this.world.scene,t,e))},group:function(t,e){return this.sys.updateList.add(new h(this.world,this.world.scene,t,e))},body:function(t,e,i,r){var s=new n(this.world);return s.position.set(t,e),i&&r&&s.setSize(i,r),this.world.add(s,o.DYNAMIC_BODY),s},staticBody:function(t,e,i,r){var s=new l(this.world);return s.position.set(t,e),i&&r&&s.setSize(i,r),this.world.add(s,o.STATIC_BODY),s},destroy:function(){this.world=null,this.scene=null,this.sys=null}});t.exports=d},79599(t){t.exports=function(t){var e=0;if(Array.isArray(t))for(var i=0;ie._dx?(n=t.right-e.x)>a&&!i||!1===t.checkCollision.right||!1===e.checkCollision.left?n=0:(t.touching.none=!1,t.touching.right=!0,e.touching.none=!1,e.touching.left=!0,e.physicsType!==r.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.right=!0),t.physicsType!==r.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.left=!0)):t._dxa&&!i||!1===t.checkCollision.left||!1===e.checkCollision.right?n=0:(t.touching.none=!1,t.touching.left=!0,e.touching.none=!1,e.touching.right=!0,e.physicsType!==r.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.left=!0),t.physicsType!==r.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.right=!0))),t.overlapX=n,e.overlapX=n,n}},45170(t,e,i){var r=i(37747);t.exports=function(t,e,i,s){var n=0,a=t.deltaAbsY()+e.deltaAbsY()+s;return 0===t._dy&&0===e._dy?(t.embedded=!0,e.embedded=!0):t._dy>e._dy?(n=t.bottom-e.y)>a&&!i||!1===t.checkCollision.down||!1===e.checkCollision.up?n=0:(t.touching.none=!1,t.touching.down=!0,e.touching.none=!1,e.touching.up=!0,e.physicsType!==r.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.down=!0),t.physicsType!==r.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.up=!0)):t._dya&&!i||!1===t.checkCollision.up||!1===e.checkCollision.down?n=0:(t.touching.none=!1,t.touching.up=!0,e.touching.none=!1,e.touching.down=!0,e.physicsType!==r.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.up=!0),t.physicsType!==r.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.down=!0))),t.overlapY=n,e.overlapY=n,n}},60758(t,e,i){var r=i(13759),s=i(83419),n=i(78389),a=i(37747),o=i(95540),h=i(26479),l=i(41212),u=new s({Extends:h,Mixins:[n],initialize:function(t,e,i,s){if(i||s)if(l(i))s=i,i=null,s.internalCreateCallback=this.createCallbackHandler,s.internalRemoveCallback=this.removeCallbackHandler;else if(Array.isArray(i)&&l(i[0])){var n=this;i.forEach(function(t){t.internalCreateCallback=n.createCallbackHandler,t.internalRemoveCallback=n.removeCallbackHandler,t.classType=o(t,"classType",r)}),s=null}else s={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler};else s={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler};this.world=t,s&&(s.classType=o(s,"classType",r)),this.physicsType=a.DYNAMIC_BODY,this.collisionCategory=1,this.collisionMask=2147483647,this.defaults={setCollideWorldBounds:o(s,"collideWorldBounds",!1),setBoundsRectangle:o(s,"customBoundsRectangle",null),setAccelerationX:o(s,"accelerationX",0),setAccelerationY:o(s,"accelerationY",0),setAllowDrag:o(s,"allowDrag",!0),setAllowGravity:o(s,"allowGravity",!0),setAllowRotation:o(s,"allowRotation",!0),setDamping:o(s,"useDamping",!1),setBounceX:o(s,"bounceX",0),setBounceY:o(s,"bounceY",0),setDragX:o(s,"dragX",0),setDragY:o(s,"dragY",0),setEnable:o(s,"enable",!0),setGravityX:o(s,"gravityX",0),setGravityY:o(s,"gravityY",0),setFrictionX:o(s,"frictionX",0),setFrictionY:o(s,"frictionY",0),setMaxSpeed:o(s,"maxSpeed",-1),setMaxVelocityX:o(s,"maxVelocityX",1e4),setMaxVelocityY:o(s,"maxVelocityY",1e4),setVelocityX:o(s,"velocityX",0),setVelocityY:o(s,"velocityY",0),setAngularVelocity:o(s,"angularVelocity",0),setAngularAcceleration:o(s,"angularAcceleration",0),setAngularDrag:o(s,"angularDrag",0),setMass:o(s,"mass",1),setImmovable:o(s,"immovable",!1)},h.call(this,e,i,s),this.type="PhysicsGroup"},createCallbackHandler:function(t){t.body&&t.body.physicsType===a.DYNAMIC_BODY||(t.body&&(t.body.destroy(),t.body=null),this.world.enableBody(t,a.DYNAMIC_BODY));var e=t.body;for(var i in this.defaults)e[i](this.defaults[i])},removeCallbackHandler:function(t){t.body&&this.world.disableBody(t)},setVelocity:function(t,e,i){void 0===i&&(i=0);for(var r=this.getChildren(),s=0;s0?1:-1),o=Math.sqrt(t*t*e.mass/i.mass)*(t>0?1:-1),h=.5*(s+o);return o-=h,n=h+(s-=h)*e.bounce.x,a=h+o*i.bounce.x,l&&m?x(0):c&&g?x(1):u&&g?x(2):!(!f||!m)&&x(3)},Set:function(t,n,a){i=n;var x=(e=t).velocity.x,T=i.velocity.x;return r=e.pushable,l=e._dx<0,u=e._dx>0,d=0===e._dx,g=Math.abs(e.right-i.x)<=Math.abs(i.right-e.x),o=T-x*e.bounce.x,s=i.pushable,c=i._dx<0,f=i._dx>0,p=0===i._dx,m=!g,h=x-T*i.bounce.x,v=Math.abs(a),y()},Run:x,RunImmovableBody1:function(t){if(1===t?i.velocity.x=0:g?i.processX(v,h,!0):i.processX(-v,h,!1,!0),e.moves){var r=e.directControl?e.y-e.autoFrame.y:e.y-e.prev.y;i.y+=r*e.friction.y,i._dy=i.y-i.prev.y}},RunImmovableBody2:function(t){if(2===t?e.velocity.x=0:m?e.processX(v,o,!0):e.processX(-v,o,!1,!0),i.moves){var r=i.directControl?i.y-i.autoFrame.y:i.y-i.prev.y;e.y+=r*i.friction.y,e._dy=e.y-e.prev.y}}}},47962(t){var e,i,r,s,n,a,o,h,l,u,d,c,f,p,g,m,v,y=function(){return u&&g&&i.blocked.down?(e.processY(-v,o,!1,!0),1):l&&m&&i.blocked.up?(e.processY(v,o,!0),1):f&&m&&e.blocked.down?(i.processY(-v,h,!1,!0),2):c&&g&&e.blocked.up?(i.processY(v,h,!0),2):0},x=function(t){if(r&&s)v*=.5,0===t||3===t?(e.processY(v,n),i.processY(-v,a)):(e.processY(-v,n),i.processY(v,a));else if(r&&!s)0===t||3===t?e.processY(v,o,!0):e.processY(-v,o,!1,!0);else if(!r&&s)0===t||3===t?i.processY(-v,h,!1,!0):i.processY(v,h,!0);else{var g=.5*v;0===t?p?(e.processY(v,0,!0),i.processY(0,null,!1,!0)):f?(e.processY(g,0,!0),i.processY(-g,0,!1,!0)):(e.processY(g,i.velocity.y,!0),i.processY(-g,null,!1,!0)):1===t?d?(e.processY(0,null,!1,!0),i.processY(v,0,!0)):u?(e.processY(-g,0,!1,!0),i.processY(g,0,!0)):(e.processY(-g,null,!1,!0),i.processY(g,e.velocity.y,!0)):2===t?p?(e.processY(-v,0,!1,!0),i.processY(0,null,!0)):c?(e.processY(-g,0,!1,!0),i.processY(g,0,!0)):(e.processY(-g,i.velocity.y,!1,!0),i.processY(g,null,!0)):3===t&&(d?(e.processY(0,null,!0),i.processY(-v,0,!1,!0)):l?(e.processY(g,0,!0),i.processY(-g,0,!1,!0)):(e.processY(g,i.velocity.y,!0),i.processY(-g,null,!1,!0)))}return!0};t.exports={BlockCheck:y,Check:function(){var t=e.velocity.y,r=i.velocity.y,s=Math.sqrt(r*r*i.mass/e.mass)*(r>0?1:-1),o=Math.sqrt(t*t*e.mass/i.mass)*(t>0?1:-1),h=.5*(s+o);return o-=h,n=h+(s-=h)*e.bounce.y,a=h+o*i.bounce.y,l&&m?x(0):c&&g?x(1):u&&g?x(2):!(!f||!m)&&x(3)},Set:function(t,n,a){i=n;var x=(e=t).velocity.y,T=i.velocity.y;return r=e.pushable,l=e._dy<0,u=e._dy>0,d=0===e._dy,g=Math.abs(e.bottom-i.y)<=Math.abs(i.bottom-e.y),o=T-x*e.bounce.y,s=i.pushable,c=i._dy<0,f=i._dy>0,p=0===i._dy,m=!g,h=x-T*i.bounce.y,v=Math.abs(a),y()},Run:x,RunImmovableBody1:function(t){if(1===t?i.velocity.y=0:g?i.processY(v,h,!0):i.processY(-v,h,!1,!0),e.moves){var r=e.directControl?e.x-e.autoFrame.x:e.x-e.prev.x;i.x+=r*e.friction.x,i._dx=i.x-i.prev.x}},RunImmovableBody2:function(t){if(2===t?e.velocity.y=0:m?e.processY(v,o,!0):e.processY(-v,o,!1,!0),i.moves){var r=i.directControl?i.x-i.autoFrame.x:i.x-i.prev.x;e.x+=r*i.friction.x,e._dx=e.x-e.prev.x}}}},14087(t,e,i){var r=i(64897),s=i(3017);t.exports=function(t,e,i,n,a){void 0===a&&(a=r(t,e,i,n));var o=t.immovable,h=e.immovable;if(i||0===a||o&&h||t.customSeparateX||e.customSeparateX)return 0!==a||t.embedded&&e.embedded;var l=s.Set(t,e,a);return o||h?(o?s.RunImmovableBody1(l):h&&s.RunImmovableBody2(l),!0):l>0||s.Check()}},89936(t,e,i){var r=i(45170),s=i(47962);t.exports=function(t,e,i,n,a){void 0===a&&(a=r(t,e,i,n));var o=t.immovable,h=e.immovable;if(i||0===a||o&&h||t.customSeparateY||e.customSeparateY)return 0!==a||t.embedded&&e.embedded;var l=s.Set(t,e,a);return o||h?(o?s.RunImmovableBody1(l):h&&s.RunImmovableBody2(l),!0):l>0||s.Check()}},95829(t){t.exports=function(t,e){return void 0===e&&(e={}),e.none=t,e.up=!1,e.down=!1,e.left=!1,e.right=!1,t||(e.up=!0,e.down=!0,e.left=!0,e.right=!0),e}},72624(t,e,i){var r=i(87902),s=i(83419),n=i(78389),a=i(37747),o=i(37303),h=i(95829),l=i(26099),u=new s({Mixins:[n],initialize:function(t,e){var i=64,r=64,s=void 0!==e;s&&e.displayWidth&&(i=e.displayWidth,r=e.displayHeight),s||(e={x:0,y:0,angle:0,rotation:0,scaleX:1,scaleY:1,displayOriginX:0,displayOriginY:0}),this.world=t,this.gameObject=s?e:void 0,this.isBody=!0,this.debugShowBody=t.defaults.debugShowStaticBody,this.debugBodyColor=t.defaults.staticBodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new l,this.position=new l(e.x-i*e.originX,e.y-r*e.originY),this.width=i,this.height=r,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center=new l(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=l.ZERO,this.allowGravity=!1,this.gravity=l.ZERO,this.bounce=l.ZERO,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.mass=1,this.immovable=!0,this.pushable=!1,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision=h(!1),this.touching=h(!0),this.wasTouching=h(!0),this.blocked=h(!0),this.physicsType=a.STATIC_BODY,this.collisionCategory=1,this.collisionMask=1,this._dx=0,this._dy=0},setGameObject:function(t,e,i){if(void 0===e&&(e=!0),void 0===i&&(i=!0),!t||!t.hasTransformComponent)return this;var r=this.world;return this.gameObject&&this.gameObject.body&&(r.disable(this.gameObject),this.gameObject.body=null),t.body&&r.disable(t),this.gameObject=t,t.body=this,this.setSize(),e&&this.updateFromGameObject(),this.enable=i,this},updateFromGameObject:function(){this.world.staticTree.remove(this);var t=this.gameObject;return t.getTopLeft(this.position),this.width=t.displayWidth,this.height=t.displayHeight,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.world.staticTree.insert(this),this},setOffset:function(t,e){return void 0===e&&(e=t),this.world.staticTree.remove(this),this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(t,e),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this),this},setSize:function(t,e,i){void 0===i&&(i=!0);var r=this.gameObject;if(r&&r.frame&&(t||(t=r.frame.realWidth),e||(e=r.frame.realHeight)),this.world.staticTree.remove(this),this.width=t,this.height=e,this.halfWidth=Math.floor(t/2),this.halfHeight=Math.floor(e/2),i&&r&&r.getCenter){var s=r.displayWidth/2,n=r.displayHeight/2;this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(s-this.halfWidth,n-this.halfHeight),this.position.x+=this.offset.x,this.position.y+=this.offset.y}return this.updateCenter(),this.isCircle=!1,this.radius=0,this.world.staticTree.insert(this),this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.world.staticTree.remove(this),this.isCircle=!0,this.radius=t,this.width=2*t,this.height=2*t,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter(),this.world.staticTree.insert(this)):this.isCircle=!1,this},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},reset:function(t,e){var i=this.gameObject;void 0===t&&(t=i.x),void 0===e&&(e=i.y),this.world.staticTree.remove(this),i.setPosition(t,e),i.getTopLeft(this.position),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this)},stop:function(){return this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?r(this,t,e):o(this,t,e)},postUpdate:function(){},deltaAbsX:function(){return 0},deltaAbsY:function(){return 0},deltaX:function(){return 0},deltaY:function(){return 0},deltaZ:function(){return 0},destroy:function(){this.enable=!1,this.world.pendingDestroy.add(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,r=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(t.defaultStrokeWidth,this.debugBodyColor,1),this.isCircle?t.strokeCircle(i,r,this.width/2):t.strokeRect(e.x,e.y,this.width,this.height))},willDrawDebug:function(){return this.debugShowBody},setMass:function(t){return t<=0&&(t=.1),this.mass=t,this},x:{get:function(){return this.position.x},set:function(t){this.world.staticTree.remove(this),this.position.x=t,this.world.staticTree.insert(this)}},y:{get:function(){return this.position.y},set:function(t){this.world.staticTree.remove(this),this.position.y=t,this.world.staticTree.insert(this)}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=u},71464(t,e,i){var r=i(13759),s=i(83419),n=i(78389),a=i(37747),o=i(95540),h=i(26479),l=i(41212),u=new s({Extends:h,Mixins:[n],initialize:function(t,e,i,s){i||s?l(i)?(s=i,i=null,s.internalCreateCallback=this.createCallbackHandler,s.internalRemoveCallback=this.removeCallbackHandler,s.createMultipleCallback=this.createMultipleCallbackHandler,s.classType=o(s,"classType",r)):Array.isArray(i)&&l(i[0])?(s=i,i=null,s.forEach(function(t){t.internalCreateCallback=this.createCallbackHandler,t.internalRemoveCallback=this.removeCallbackHandler,t.createMultipleCallback=this.createMultipleCallbackHandler,t.classType=o(t,"classType",r)},this)):s={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler}:s={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler,createMultipleCallback:this.createMultipleCallbackHandler,classType:r},this.world=t,this.physicsType=a.STATIC_BODY,this.collisionCategory=1,this.collisionMask=1,h.call(this,e,i,s),this.type="StaticPhysicsGroup"},createCallbackHandler:function(t){t.body&&t.body.physicsType===a.STATIC_BODY||(t.body&&(t.body.destroy(),t.body=null),this.world.enableBody(t,a.STATIC_BODY))},removeCallbackHandler:function(t){t.body&&this.world.disableBody(t)},createMultipleCallbackHandler:function(){this.refresh()},refresh:function(){for(var t=Array.from(this.children),e=0;e=r;if(this.fixedStep||(i=.001*e,n=!0,this._elapsed=0),s.forEach(function(t){t.enable&&t.preUpdate(n,i)}),n){this._elapsed-=r,this.stepsLastFrame=1,this.useTree&&(this.tree.clear(),this.tree.load(Array.from(s)));for(var a=this.colliders.update(),o=0;o=r;)this._elapsed-=r,this.step(i)}},step:function(t){var e=this.bodies;e.forEach(function(e){e.enable&&e.update(t)}),this.useTree&&(this.tree.clear(),this.tree.load(Array.from(e)));for(var i=this.colliders.update(),r=0;r0){var s=this.tree,n=this.staticTree;r.forEach(function(i){i.physicsType===h.DYNAMIC_BODY?(s.remove(i),t.delete(i)):i.physicsType===h.STATIC_BODY&&(n.remove(i),e.delete(i)),i.world=void 0,i.gameObject=void 0}),r.clear()}},updateMotion:function(t,e){t.allowRotation&&this.computeAngularVelocity(t,e),this.computeVelocity(t,e)},computeAngularVelocity:function(t,e){var i=t.angularVelocity,r=t.angularAcceleration,s=t.angularDrag,a=t.maxAngular;r?i+=r*e:t.allowDrag&&s&&(p(i-(s*=e),0,.1)?i-=s:g(i+s,0,.1)?i+=s:i=0);var o=(i=n(i,-a,a))-t.angularVelocity;t.angularVelocity+=o,t.rotation+=t.angularVelocity*e},computeVelocity:function(t,e){var i=t.velocity.x,r=t.acceleration.x,s=t.drag.x,a=t.maxVelocity.x,o=t.velocity.y,h=t.acceleration.y,l=t.drag.y,u=t.maxVelocity.y,d=t.speed,c=t.maxSpeed,m=t.allowDrag,v=t.useDamping;t.allowGravity&&(i+=(this.gravity.x+t.gravity.x)*e,o+=(this.gravity.y+t.gravity.y)*e),r?i+=r*e:m&&s&&(v?(i*=s=Math.pow(s,e),d=Math.sqrt(i*i+o*o),f(d,0,.001)&&(i=0)):p(i-(s*=e),0,.01)?i-=s:g(i+s,0,.01)?i+=s:i=0),h?o+=h*e:m&&l&&(v?(o*=l=Math.pow(l,e),d=Math.sqrt(i*i+o*o),f(d,0,.001)&&(o=0)):p(o-(l*=e),0,.01)?o-=l:g(o+l,0,.01)?o+=l:o=0),i=n(i,-a,a),o=n(o,-u,u),t.velocity.set(i,o),c>-1&&t.velocity.length()>c&&(t.velocity.normalize().scale(c),d=c),t.speed=d},separate:function(t,e,i,r,s){var n,a,o=!1,h=!0;if(!t.enable||!e.enable||t.checkCollision.none||e.checkCollision.none||!this.intersects(t,e)||0===(t.collisionMask&e.collisionCategory)||0===(e.collisionMask&t.collisionCategory))return o;if(i&&!1===i.call(r,t.gameObject||t,e.gameObject||e))return o;if(t.isCircle||e.isCircle){var l=this.separateCircle(t,e,s);l.result?(o=!0,h=!1):(n=l.x,a=l.y,h=!0)}if(h){var u=!1,d=!1,f=this.OVERLAP_BIAS;s?(u=A(t,e,s,f,n),d=_(t,e,s,f,a)):this.forceX||Math.abs(this.gravity.y+t.gravity.y)C&&(p=l(y,x,C,S)-w):x>E&&(yC&&(p=l(y,x,C,E)-w)),p*=-1}else p=t.halfWidth+e.halfWidth-u(a,o);t.overlapR=p,e.overlapR=p;var A=r(a,o),_=(p+T.EPSILON)*Math.cos(A),M=(p+T.EPSILON)*Math.sin(A),R={overlap:p,result:!1,x:_,y:M};if(i&&(!g||g&&0!==p))return R.result=!0,R;if(!g&&0===p||h&&d||t.customSeparateX||e.customSeparateX)return R.x=void 0,R.y=void 0,R;var P=!t.pushable&&!e.pushable;if(g){var O=a.x-o.x,L=a.y-o.y,F=Math.sqrt(Math.pow(O,2)+Math.pow(L,2)),D=(o.x-a.x)/F||0,I=(o.y-a.y)/F||0,N=2*(c.x*D+c.y*I-f.x*D-f.y*I)/(t.mass+e.mass);!h&&!d&&t.pushable&&e.pushable||(N*=2),!h&&t.pushable&&(c.x=c.x-N/t.mass*D,c.y=c.y-N/t.mass*I,c.multiply(t.bounce)),!d&&e.pushable&&(f.x=f.x+N/e.mass*D,f.y=f.y+N/e.mass*I,f.multiply(e.bounce)),h||d||(_*=.5,M*=.5),(!h||t.pushable||P)&&(t.x-=_,t.y-=M,t.updateCenter()),(!d||e.pushable||P)&&(e.x+=_,e.y+=M,e.updateCenter()),R.result=!0}else h||!t.pushable&&!P||(t.x-=_,t.y-=M,t.updateCenter()),(!d||e.pushable||P)&&(e.x+=_,e.y+=M,e.updateCenter()),R.x=void 0,R.y=void 0;return R},intersects:function(t,e){return t!==e&&(t.isCircle||e.isCircle?t.isCircle?e.isCircle?u(t.center,e.center)<=t.halfWidth+e.halfWidth:this.circleBodyIntersects(t,e):this.circleBodyIntersects(e,t):!(t.right<=e.left||t.bottom<=e.top||t.left>=e.right||t.top>=e.bottom))},circleBodyIntersects:function(t,e){var i=n(t.center.x,e.left,e.right),r=n(t.center.y,e.top,e.bottom);return(t.center.x-i)*(t.center.x-i)+(t.center.y-r)*(t.center.y-r)<=t.halfWidth*t.halfWidth},overlap:function(t,e,i,r,s){return void 0===i&&(i=null),void 0===r&&(r=null),void 0===s&&(s=i),this.collideObjects(t,e,i,r,s,!0)},collide:function(t,e,i,r,s){return void 0===i&&(i=null),void 0===r&&(r=null),void 0===s&&(s=i),this.collideObjects(t,e,i,r,s,!1)},collideObjects:function(t,e,i,r,s,n){var a,o;!t.isParent||void 0!==t.physicsType&&void 0!==e&&t!==e||(t=Array.from(t.children)),e&&e.isParent&&void 0===e.physicsType&&(e=Array.from(e.children));var h=Array.isArray(t),l=Array.isArray(e);if(this._total=0,h||l)if(!h&&l)for(a=0;a0},collideHandler:function(t,e,i,r,s,n){if(void 0===e&&t.isParent)return this.collideGroupVsGroup(t,t,i,r,s,n);if(!t||!e)return!1;if(t.body||t.isBody){if(e.body||e.isBody)return this.collideSpriteVsSprite(t,e,i,r,s,n);if(e.isParent)return this.collideSpriteVsGroup(t,e,i,r,s,n);if(e.isTilemap)return this.collideSpriteVsTilemapLayer(t,e,i,r,s,n)}else if(t.isParent){if(e.body||e.isBody)return this.collideSpriteVsGroup(e,t,i,r,s,n);if(e.isParent)return this.collideGroupVsGroup(t,e,i,r,s,n);if(e.isTilemap)return this.collideGroupVsTilemapLayer(t,e,i,r,s,n)}else if(t.isTilemap){if(e.body||e.isBody)return this.collideSpriteVsTilemapLayer(e,t,i,r,s,n);if(e.isParent)return this.collideGroupVsTilemapLayer(e,t,i,r,s,n)}},canCollide:function(t,e){return t&&e&&0!==(t.collisionMask&e.collisionCategory)&&0!==(e.collisionMask&t.collisionCategory)},collideSpriteVsSprite:function(t,e,i,r,s,n){var a=t.isBody?t:t.body,o=e.isBody?e:e.body;return!!this.canCollide(a,o)&&(this.separate(a,o,r,s,n)&&(i&&i.call(s,t,e),this._total++),!0)},collideSpriteVsGroup:function(t,e,i,r,s,n){var a,o,l,u=t.isBody?t:t.body;if(0!==e.getLength()&&u&&u.enable&&!u.checkCollision.none&&this.canCollide(u,e))if(this.useTree||e.physicsType===h.STATIC_BODY){var d=this.treeMinMax;d.minX=u.left,d.minY=u.top,d.maxX=u.right,d.maxY=u.bottom;var c=e.physicsType===h.DYNAMIC_BODY?this.tree.search(d):this.staticTree.search(d);for(o=c.length,a=0;a0&&(t.blocked.none=!1,t.blocked.right=!0),t.position.x-=e,t.updateCenter(),0===t.bounce.x?t.velocity.x=0:t.velocity.x=-t.velocity.x*t.bounce.x}},67013(t){t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.up=!0):e>0&&(t.blocked.none=!1,t.blocked.down=!0),t.position.y-=e,t.updateCenter(),0===t.bounce.y?t.velocity.y=0:t.velocity.y=-t.velocity.y*t.bounce.y}},40012(t,e,i){var r=i(21329),s=i(53442),n=i(2483);t.exports=function(t,e,i,a,o,h,l){var u=a.left,d=a.top,c=a.right,f=a.bottom,p=i.faceLeft||i.faceRight,g=i.faceTop||i.faceBottom;if(l||(p=!0,g=!0),!p&&!g)return!1;var m=0,v=0,y=0,x=1;if(e.deltaAbsX()>e.deltaAbsY()?y=-1:e.deltaAbsX()0&&u&&t.checkCollision.right&&h&&t.right>i&&(o=t.right-i)>n&&(o=0),0!==o&&(t.customSeparateX?t.overlapX=o:r(t,o)),o}},53442(t,e,i){var r=i(67013);t.exports=function(t,e,i,s,n,a){var o=0,h=e.faceTop,l=e.faceBottom,u=e.collideUp,d=e.collideDown;return a||(h=!0,l=!0,u=!0,d=!0),t.deltaY()<0&&d&&t.checkCollision.up?l&&t.y0&&u&&t.checkCollision.down&&h&&t.bottom>i&&(o=t.bottom-i)>n&&(o=0),0!==o&&(t.customSeparateY?t.overlapY=o:r(t,o)),o}},2483(t){t.exports=function(t,e){return!(e.right<=t.left||e.bottom<=t.top||e.position.x>=t.right||e.position.y>=t.bottom)}},55173(t,e,i){var r={ProcessTileCallbacks:i(96602),ProcessTileSeparationX:i(36294),ProcessTileSeparationY:i(67013),SeparateTile:i(40012),TileCheckX:i(21329),TileCheckY:i(53442),TileIntersectsBody:i(2483)};t.exports=r},44563(t,e,i){t.exports={Arcade:i(27064),Matter:i(3875)}},68174(t,e,i){var r=i(83419),s=i(26099),n=new r({initialize:function(){this.boundsCenter=new s,this.centerDiff=new s},parseBody:function(t){if(!(t=t.hasOwnProperty("body")?t.body:t).hasOwnProperty("bounds")||!t.hasOwnProperty("centerOfMass"))return!1;var e=this.boundsCenter,i=this.centerDiff,r=t.bounds.max.x-t.bounds.min.x,s=t.bounds.max.y-t.bounds.min.y,n=r*t.centerOfMass.x,a=s*t.centerOfMass.y;return e.set(r/2,s/2),i.set(n-e.x,a-e.y),!0},getTopLeft:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var r=this.boundsCenter,n=this.centerDiff;return new s(e+r.x+n.x,i+r.y+n.y)}return!1},getTopCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var r=this.boundsCenter,n=this.centerDiff;return new s(e+n.x,i+r.y+n.y)}return!1},getTopRight:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var r=this.boundsCenter,n=this.centerDiff;return new s(e-(r.x-n.x),i+r.y+n.y)}return!1},getLeftCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var r=this.boundsCenter,n=this.centerDiff;return new s(e+r.x+n.x,i+n.y)}return!1},getCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var r=this.centerDiff;return new s(e+r.x,i+r.y)}return!1},getRightCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var r=this.boundsCenter,n=this.centerDiff;return new s(e-(r.x-n.x),i+n.y)}return!1},getBottomLeft:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var r=this.boundsCenter,n=this.centerDiff;return new s(e+r.x+n.x,i-(r.y-n.y))}return!1},getBottomCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var r=this.boundsCenter,n=this.centerDiff;return new s(e+n.x,i-(r.y-n.y))}return!1},getBottomRight:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var r=this.boundsCenter,n=this.centerDiff;return new s(e-(r.x-n.x),i-(r.y-n.y))}return!1}});t.exports=n},19933(t,e,i){var r=i(6790);r.Body=i(22562),r.Composite=i(69351),r.World=i(4372),r.Collision=i(52284),r.Detector=i(81388),r.Pairs=i(99561),r.Pair=i(4506),r.Query=i(73296),r.Resolver=i(66272),r.Constraint=i(48140),r.Common=i(53402),r.Engine=i(48413),r.Events=i(35810),r.Sleeping=i(53614),r.Plugin=i(73832),r.Bodies=i(66280),r.Composites=i(74116),r.Axes=i(66615),r.Bounds=i(15647),r.Svg=i(74058),r.Vector=i(31725),r.Vertices=i(41598),r.World.add=r.Composite.add,r.World.remove=r.Composite.remove,r.World.addComposite=r.Composite.addComposite,r.World.addBody=r.Composite.addBody,r.World.addConstraint=r.Composite.addConstraint,r.World.clear=r.Composite.clear,t.exports=r},28137(t,e,i){var r=i(66280),s=i(83419),n=i(74116),a=i(48140),o=i(74058),h=i(75803),l=i(23181),u=i(34803),d=i(73834),c=i(19496),f=i(85791),p=i(98713),g=i(41598),m=new s({initialize:function(t){this.world=t,this.scene=t.scene,this.sys=t.scene.sys},rectangle:function(t,e,i,s,n){var a=r.rectangle(t,e,i,s,n);return this.world.add(a),a},trapezoid:function(t,e,i,s,n,a){var o=r.trapezoid(t,e,i,s,n,a);return this.world.add(o),o},circle:function(t,e,i,s,n){var a=r.circle(t,e,i,s,n);return this.world.add(a),a},polygon:function(t,e,i,s,n){var a=r.polygon(t,e,i,s,n);return this.world.add(a),a},fromVertices:function(t,e,i,s,n,a,o){"string"==typeof i&&(i=g.fromPath(i));var h=r.fromVertices(t,e,i,s,n,a,o);return this.world.add(h),h},fromPhysicsEditor:function(t,e,i,r,s){void 0===s&&(s=!0);var n=c.parseBody(t,e,i,r);return s&&!this.world.has(n)&&this.world.add(n),n},fromSVG:function(t,e,i,s,n,a){void 0===s&&(s=1),void 0===n&&(n={}),void 0===a&&(a=!0);for(var h=i.getElementsByTagName("path"),l=[],u=0;u0},intersectPoint:function(t,e,i){i=this.getMatterBodies(i);var r=M.create(t,e),s=[];return C.point(i,r).forEach(function(t){-1===s.indexOf(t)&&s.push(t)}),s},intersectRect:function(t,e,i,r,s,n){void 0===s&&(s=!1),n=this.getMatterBodies(n);var a={min:{x:t,y:e},max:{x:t+i,y:e+r}},o=[];return C.region(n,a,s).forEach(function(t){-1===o.indexOf(t)&&o.push(t)}),o},intersectRay:function(t,e,i,r,s,n){void 0===s&&(s=1),n=this.getMatterBodies(n);for(var a=[],o=C.ray(n,M.create(t,e),M.create(i,r),s),h=0;h0?this.setFromTileCollision(i):this.setFromTileRectangle(i),r=this.body}if(e.flipX||e.flipY){var o={x:e.getCenterX(),y:e.getCenterY()},u=e.flipX?-1:1,d=e.flipY?-1:1;s.scale(r,u,d,o)}},setFromTileRectangle:function(t){void 0===t&&(t={}),u(t,"isStatic")||(t.isStatic=!0),u(t,"addToWorld")||(t.addToWorld=!0);var e=this.tile.getBounds(),i=e.x+e.width/2,s=e.y+e.height/2,n=r.rectangle(i,s,e.width,e.height,t);return this.setBody(n,t.addToWorld),this},setFromTileCollision:function(t){void 0===t&&(t={}),u(t,"isStatic")||(t.isStatic=!0),u(t,"addToWorld")||(t.addToWorld=!0);for(var e=this.tile.tilemapLayer.scaleX,i=this.tile.tilemapLayer.scaleY,n=this.tile.getLeft(),a=this.tile.getTop(),h=this.tile.getCollisionGroup(),c=l(h,"objects",[]),f=[],p=0;p1){var C=o(t);C.parts=f,this.setBody(s.create(C),C.addToWorld)}return this},setBody:function(t,e){return void 0===e&&(e=!0),this.body&&this.removeBody(),this.body=t,this.body.gameObject=this,e&&this.world.add(this.body),this},removeBody:function(){return this.body&&(this.world.remove(this.body),this.body.gameObject=void 0,this.body=void 0),this},destroy:function(){this.removeBody(),this.tile.physics.matterBody=void 0,this.removeAllListeners()}});t.exports=c},19496(t,e,i){var r=i(66280),s=i(22562),n=i(53402),a=i(95540),o=i(41598),h={parseBody:function(t,e,i,r){void 0===r&&(r={});for(var o=a(i,"fixtures",[]),h=[],l=0;l1?1:0;s0&&s.map(function(t){i=t.bodyA,r=t.bodyB,i.gameObject&&i.gameObject.emit("collide",i,r,t),r.gameObject&&r.gameObject.emit("collide",r,i,t),p.trigger(i,"onCollide",{pair:t}),p.trigger(r,"onCollide",{pair:t}),i.onCollideCallback&&i.onCollideCallback(t),r.onCollideCallback&&r.onCollideCallback(t),i.onCollideWith[r.id]&&i.onCollideWith[r.id](r,t),r.onCollideWith[i.id]&&r.onCollideWith[i.id](i,t)}),t.emit(u.COLLISION_START,e,i,r)}),p.on(e,"collisionActive",function(e){var i,r,s=e.pairs;s.length>0&&s.map(function(t){i=t.bodyA,r=t.bodyB,i.gameObject&&i.gameObject.emit("collideActive",i,r,t),r.gameObject&&r.gameObject.emit("collideActive",r,i,t),p.trigger(i,"onCollideActive",{pair:t}),p.trigger(r,"onCollideActive",{pair:t}),i.onCollideActiveCallback&&i.onCollideActiveCallback(t),r.onCollideActiveCallback&&r.onCollideActiveCallback(t)}),t.emit(u.COLLISION_ACTIVE,e,i,r)}),p.on(e,"collisionEnd",function(e){var i,r,s=e.pairs;s.length>0&&s.map(function(t){i=t.bodyA,r=t.bodyB,i.gameObject&&i.gameObject.emit("collideEnd",i,r,t),r.gameObject&&r.gameObject.emit("collideEnd",r,i,t),p.trigger(i,"onCollideEnd",{pair:t}),p.trigger(r,"onCollideEnd",{pair:t}),i.onCollideEndCallback&&i.onCollideEndCallback(t),r.onCollideEndCallback&&r.onCollideEndCallback(t)}),t.emit(u.COLLISION_END,e,i,r)})},setBounds:function(t,e,i,r,s,n,a,o,h){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===r&&(r=this.scene.sys.scale.height),void 0===s&&(s=64),void 0===n&&(n=!0),void 0===a&&(a=!0),void 0===o&&(o=!0),void 0===h&&(h=!0),this.updateWall(n,"left",t-s,e-s,s,r+2*s),this.updateWall(a,"right",t+i,e-s,s,r+2*s),this.updateWall(o,"top",t,e-s,i,s),this.updateWall(h,"bottom",t,e+r,i,s),this},updateWall:function(t,e,i,r,s,n){var a=this.walls[e];t?(a&&m.remove(this.localWorld,a),i+=s/2,r+=n/2,this.walls[e]=this.create(i,r,s,n,{isStatic:!0,friction:0,frictionStatic:0})):(a&&m.remove(this.localWorld,a),this.walls[e]=null)},createDebugGraphic:function(){var t=this.scene.sys.add.graphics({x:0,y:0});return t.setDepth(Number.MAX_VALUE),this.debugGraphic=t,this.drawDebug=!0,t},disableGravity:function(){return this.localWorld.gravity.x=0,this.localWorld.gravity.y=0,this.localWorld.gravity.scale=0,this},setGravity:function(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=1),void 0===i&&(i=.001),this.localWorld.gravity.x=t,this.localWorld.gravity.y=e,this.localWorld.gravity.scale=i,this},create:function(t,e,i,s,n){var a=r.rectangle(t,e,i,s,n);return m.add(this.localWorld,a),a},add:function(t){return m.add(this.localWorld,t),this},remove:function(t,e){Array.isArray(t)||(t=[t]);for(var i=0;iMath.max(v._maxFrameDelta,i.maxFrameTime))&&(o=i.frameDelta||v._frameDeltaFallback),i.frameDeltaSmoothing){i.frameDeltaHistory.push(o),i.frameDeltaHistory=i.frameDeltaHistory.slice(-i.frameDeltaHistorySize);var l=i.frameDeltaHistory.slice(0).sort(),u=i.frameDeltaHistory.slice(l.length*v._smoothingLowerBound,l.length*v._smoothingUpperBound);o=v._mean(u)||o}i.frameDeltaSnapping&&(o=1e3/Math.round(1e3/o)),i.frameDelta=o,i.timeLastTick=t,i.timeBuffer+=i.frameDelta,i.timeBuffer=a.clamp(i.timeBuffer,0,i.frameDelta+s*v._timeBufferMargin),i.lastUpdatesDeferred=0;for(var d=i.maxUpdates||Math.ceil(i.maxFrameTime/s),c=a.now();s>0&&i.timeBuffer>=s*v._timeBufferMargin;){h.update(e,s),i.timeBuffer-=s,n+=1;var f=a.now()-r,p=a.now()-c,g=f+v._elapsedNextEstimate*p/n;if(n>=d||g>i.maxFrameTime){i.lastUpdatesDeferred=Math.round(Math.max(0,i.timeBuffer/s-v._timeBufferMargin));break}}}},step:function(t){h.update(this.engine,t)},update60Hz:function(){return 1e3/60},update30Hz:function(){return 1e3/30},has:function(t){var e=t.hasOwnProperty("body")?t.body:t;return null!==o.get(this.localWorld,e.id,e.type)},getAllBodies:function(){return o.allBodies(this.localWorld)},getAllConstraints:function(){return o.allConstraints(this.localWorld)},getAllComposites:function(){return o.allComposites(this.localWorld)},postUpdate:function(){if(this.drawDebug){var t=this.debugConfig,e=this.engine,i=this.debugGraphic,r=o.allBodies(this.localWorld);this.debugGraphic.clear(),t.showBroadphase&&e.broadphase.controller&&this.renderGrid(e.broadphase,i,t.broadphaseColor,.5),t.showBounds&&this.renderBodyBounds(r,i,t.boundsColor,.5),(t.showBody||t.showStaticBody)&&this.renderBodies(r),t.showJoint&&this.renderJoints(),(t.showAxes||t.showAngleIndicator)&&this.renderBodyAxes(r,i,t.showAxes,t.angleColor,.5),t.showVelocity&&this.renderBodyVelocity(r,i,t.velocityColor,1,2),t.showSeparations&&this.renderSeparations(e.pairs.list,i,t.separationColor),t.showCollisions&&this.renderCollisions(e.pairs.list,i,t.collisionColor)}},renderGrid:function(t,e,i,r){e.lineStyle(1,i,r);for(var s=a.keys(t.buckets),n=0;n0){var l=h[0].vertex.x,u=h[0].vertex.y;2===s.contactCount&&(l=(h[0].vertex.x+h[1].vertex.x)/2,u=(h[0].vertex.y+h[1].vertex.y)/2),o.bodyB===o.supports[0].body||o.bodyA.isStatic?e.lineBetween(l-8*o.normal.x,u-8*o.normal.y,l,u):e.lineBetween(l+8*o.normal.x,u+8*o.normal.y,l,u)}}return this},renderBodyBounds:function(t,e,i,r){e.lineStyle(1,i,r);for(var s=0;s1?1:0;h1?1:0;o1?1:0;o1&&this.renderConvexHull(g,e,f,y)}}},renderBody:function(t,e,i,r,s,n,a,o){void 0===r&&(r=null),void 0===s&&(s=null),void 0===n&&(n=1),void 0===a&&(a=null),void 0===o&&(o=null);for(var h=this.debugConfig,l=h.sensorFillColor,u=h.sensorLineColor,d=t.parts,c=d.length,f=c>1?1:0;f1){var s=t.vertices;e.lineStyle(r,i),e.beginPath(),e.moveTo(s[0].x,s[0].y);for(var n=1;n0&&(e.fillStyle(o),e.fillCircle(u.x,u.y,h),e.fillCircle(d.x,d.y,h)),this},resetCollisionIDs:function(){return s._nextCollidingGroupId=1,s._nextNonCollidingGroupId=-1,s._nextCategory=1,this},shutdown:function(){p.off(this.engine),this.removeAllListeners(),m.clear(this.localWorld,!1),h.clear(this.engine),this.drawDebug&&this.debugGraphic.destroy()},destroy:function(){this.shutdown()}});t.exports=x},70410(t){t.exports={setBounce:function(t){return this.body.restitution=t,this}}},66968(t){var e={setCollisionCategory:function(t){return this.body.collisionFilter.category=t,this},setCollisionGroup:function(t){return this.body.collisionFilter.group=t,this},setCollidesWith:function(t){var e=0;if(Array.isArray(t))for(var i=0;i0&&n.rotateAbout(o.position,r,t.position,o.position)}},r.setVelocity=function(t,e){var i=t.deltaTime/r._baseDelta;t.positionPrev.x=t.position.x-e.x*i,t.positionPrev.y=t.position.y-e.y*i,t.velocity.x=(t.position.x-t.positionPrev.x)/i,t.velocity.y=(t.position.y-t.positionPrev.y)/i,t.speed=n.magnitude(t.velocity)},r.getVelocity=function(t){var e=r._baseDelta/t.deltaTime;return{x:(t.position.x-t.positionPrev.x)*e,y:(t.position.y-t.positionPrev.y)*e}},r.getSpeed=function(t){return n.magnitude(r.getVelocity(t))},r.setSpeed=function(t,e){r.setVelocity(t,n.mult(n.normalise(r.getVelocity(t)),e))},r.setAngularVelocity=function(t,e){var i=t.deltaTime/r._baseDelta;t.anglePrev=t.angle-e*i,t.angularVelocity=(t.angle-t.anglePrev)/i,t.angularSpeed=Math.abs(t.angularVelocity)},r.getAngularVelocity=function(t){return(t.angle-t.anglePrev)*r._baseDelta/t.deltaTime},r.getAngularSpeed=function(t){return Math.abs(r.getAngularVelocity(t))},r.setAngularSpeed=function(t,e){r.setAngularVelocity(t,o.sign(r.getAngularVelocity(t))*e)},r.translate=function(t,e,i){r.setPosition(t,n.add(t.position,e),i)},r.rotate=function(t,e,i,s){if(i){var n=Math.cos(e),a=Math.sin(e),o=t.position.x-i.x,h=t.position.y-i.y;r.setPosition(t,{x:i.x+(o*n-h*a),y:i.y+(o*a+h*n)},s),r.setAngle(t,t.angle+e,s)}else r.setAngle(t,t.angle+e,s)},r.scale=function(t,e,i,n){var a=0,o=0;n=n||t.position;for(var u=t.inertia===1/0,d=0;d0&&(a+=c.area,o+=c.inertia),c.position.x=n.x+(c.position.x-n.x)*e,c.position.y=n.y+(c.position.y-n.y)*i,h.update(c.bounds,c.vertices,t.velocity)}t.parts.length>1&&(t.area=a,t.isStatic||(r.setMass(t,t.density*a),r.setInertia(t,o))),t.circleRadius&&(e===i?t.circleRadius*=e:t.circleRadius=null),u&&r.setInertia(t,1/0)},r.update=function(t,e){var i=(e=(void 0!==e?e:1e3/60)*t.timeScale)*e,a=r._timeCorrection?e/(t.deltaTime||e):1,u=1-t.frictionAir*(e/o._baseDelta),d=(t.position.x-t.positionPrev.x)*a,c=(t.position.y-t.positionPrev.y)*a;t.velocity.x=d*u+t.force.x/t.mass*i,t.velocity.y=c*u+t.force.y/t.mass*i,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.position.x+=t.velocity.x,t.position.y+=t.velocity.y,t.deltaTime=e,t.angularVelocity=(t.angle-t.anglePrev)*u*a+t.torque/t.inertia*i,t.anglePrev=t.angle,t.angle+=t.angularVelocity,t.speed=n.magnitude(t.velocity),t.angularSpeed=Math.abs(t.angularVelocity);for(var f=0;f0&&(p.position.x+=t.velocity.x,p.position.y+=t.velocity.y),0!==t.angularVelocity&&(s.rotate(p.vertices,t.angularVelocity,t.position),l.rotate(p.axes,t.angularVelocity),f>0&&n.rotateAbout(p.position,t.angularVelocity,t.position,p.position)),h.update(p.bounds,p.vertices,t.velocity)}},r.updateVelocities=function(t){var e=r._baseDelta/t.deltaTime,i=t.velocity;i.x=(t.position.x-t.positionPrev.x)*e,i.y=(t.position.y-t.positionPrev.y)*e,t.speed=Math.sqrt(i.x*i.x+i.y*i.y),t.angularVelocity=(t.angle-t.anglePrev)*e,t.angularSpeed=Math.abs(t.angularVelocity)},r.applyForce=function(t,e,i){var r=e.x-t.position.x,s=e.y-t.position.y;t.force.x+=i.x,t.force.y+=i.y,t.torque+=r*i.y-s*i.x},r._totalProperties=function(t){for(var e={mass:0,area:0,inertia:0,centre:{x:0,y:0}},i=1===t.parts.length?0:1;i=0&&(v=-v,y=-y),d.x=v,d.y=y,c.x=-y,c.y=v,f.x=v*g,f.y=y*g,s.depth=g;var x=r._findSupports(t,e,d,1),T=0;if(o.contains(t.vertices,x[0])&&(p[T++]=x[0]),o.contains(t.vertices,x[1])&&(p[T++]=x[1]),T<2){var w=r._findSupports(e,t,d,-1);o.contains(e.vertices,w[0])&&(p[T++]=w[0]),T<2&&o.contains(e.vertices,w[1])&&(p[T++]=w[1])}return 0===T&&(p[T++]=x[0]),s.supportCount=T,s},r._overlapAxes=function(t,e,i,r){var s,n,a,o,h,l,u=e.length,d=i.length,c=e[0].x,f=e[0].y,p=i[0].x,g=i[0].y,m=r.length,v=Number.MAX_VALUE,y=0;for(h=0;hC?C=o:oE?E=o:op)break;if(!(gM.max.y)&&(!v||!T.isStatic&&!T.isSleeping)&&h(c.collisionFilter,T.collisionFilter)){var w=T.parts.length;if(x&&1===w)(A=l(c,T,s))&&(u[d++]=A);else for(var b=w>1?1:0,S=y>1?1:0;SM.max.x||f.max.xM.max.y||(A=l(C,_,s))&&(u[d++]=A)}}}}return u.length!==d&&(u.length=d),u},r.canCollide=function(t,e){return t.group===e.group&&0!==t.group?t.group>0:0!==(t.mask&e.category)&&0!==(e.mask&t.category)},r._compareBoundsX=function(t,e){return t.bounds.min.x-e.bounds.min.x}},4506(t,e,i){var r={};t.exports=r;var s=i(43424);r.create=function(t,e){var i=t.bodyA,n=t.bodyB,a={id:r.id(i,n),bodyA:i,bodyB:n,collision:t,contacts:[s.create(),s.create()],contactCount:0,separation:0,isActive:!0,isSensor:i.isSensor||n.isSensor,timeCreated:e,timeUpdated:e,inverseMass:0,friction:0,frictionStatic:0,restitution:0,slop:0};return r.update(a,t,e),a},r.update=function(t,e,i){var r=e.supports,s=e.supportCount,n=t.contacts,a=e.parentA,o=e.parentB;t.isActive=!0,t.timeUpdated=i,t.collision=e,t.separation=e.depth,t.inverseMass=a.inverseMass+o.inverseMass,t.friction=a.frictiono.frictionStatic?a.frictionStatic:o.frictionStatic,t.restitution=a.restitution>o.restitution?a.restitution:o.restitution,t.slop=a.slop>o.slop?a.slop:o.slop,t.contactCount=s,e.pair=t;var h=r[0],l=n[0],u=r[1],d=n[1];d.vertex!==h&&l.vertex!==u||(n[1]=l,n[0]=l=d,d=n[1]),l.vertex=h,d.vertex=u},r.setActive=function(t,e,i){e?(t.isActive=!0,t.timeUpdated=i):(t.isActive=!1,t.contactCount=0)},r.id=function(t,e){return t.id=i?d[f++]=n:(l(n,!1,i),n.collision.bodyA.sleepCounter>0&&n.collision.bodyB.sleepCounter>0?d[f++]=n:(g[x++]=n,delete u[n.id]));d.length!==f&&(d.length=f),p.length!==y&&(p.length=y),g.length!==x&&(g.length=x),m.length!==T&&(m.length=T)},r.clear=function(t){return t.table={},t.list.length=0,t.collisionStart.length=0,t.collisionActive.length=0,t.collisionEnd.length=0,t}},73296(t,e,i){var r={};t.exports=r;var s=i(31725),n=i(52284),a=i(15647),o=i(66280),h=i(41598);r.collides=function(t,e){for(var i=[],r=e.length,s=t.bounds,o=n.collides,h=a.overlaps,l=0;lH?(s=W>0?W:-W,(i=g.friction*(W>0?1:-1)*l)<-s?i=-s:i>s&&(i=s)):(i=W,s=f);var j=N*T-B*x,q=k*T-U*x,K=_/(S+v.inverseInertia*j*j+y.inverseInertia*q*q),Z=(1+g.restitution)*X*K;if(i*=K,X0&&(D.normalImpulse=0),Z=D.normalImpulse-Q}if(W<-d||W>d)D.tangentImpulse=0;else{var J=D.tangentImpulse;D.tangentImpulse+=i,D.tangentImpulse<-s&&(D.tangentImpulse=-s),D.tangentImpulse>s&&(D.tangentImpulse=s),i=D.tangentImpulse-J}var $=x*Z+w*i,tt=T*Z+b*i;v.isStatic||v.isSleeping||(v.positionPrev.x+=$*v.inverseMass,v.positionPrev.y+=tt*v.inverseMass,v.anglePrev+=(N*tt-B*$)*v.inverseInertia),y.isStatic||y.isSleeping||(y.positionPrev.x-=$*y.inverseMass,y.positionPrev.y-=tt*y.inverseMass,y.anglePrev-=(k*tt-U*$)*y.inverseInertia)}}}}},48140(t,e,i){var r={};t.exports=r;var s=i(41598),n=i(31725),a=i(53614),o=i(15647),h=i(66615),l=i(53402);r._warming=.4,r._torqueDampen=1,r._minLength=1e-6,r.create=function(t){var e=t;e.bodyA&&!e.pointA&&(e.pointA={x:0,y:0}),e.bodyB&&!e.pointB&&(e.pointB={x:0,y:0});var i=e.bodyA?n.add(e.bodyA.position,e.pointA):e.pointA,r=e.bodyB?n.add(e.bodyB.position,e.pointB):e.pointB,s=n.magnitude(n.sub(i,r));e.length=void 0!==e.length?e.length:s,e.id=e.id||l.nextId(),e.label=e.label||"Constraint",e.type="constraint",e.stiffness=e.stiffness||(e.length>0?1:.7),e.damping=e.damping||0,e.angularStiffness=e.angularStiffness||0,e.angleA=e.bodyA?e.bodyA.angle:e.angleA,e.angleB=e.bodyB?e.bodyB.angle:e.angleB,e.plugin={};var a={visible:!0,type:"line",anchors:!0,lineColor:null,lineOpacity:null,lineThickness:null,pinSize:null,anchorColor:null,anchorSize:null};return 0===e.length&&e.stiffness>.1?(a.type="pin",a.anchors=!1):e.stiffness<.9&&(a.type="spring"),e.render=l.extend(a,e.render),e},r.preSolveAll=function(t){for(var e=0;e=1||0===t.length?t.stiffness*e:t.stiffness*e*e,x=t.damping*e,T=n.mult(u,v*y),w=(i?i.inverseMass:0)+(s?s.inverseMass:0),b=w+((i?i.inverseInertia:0)+(s?s.inverseInertia:0));if(x>0){var S=n.create();p=n.div(u,d),m=n.sub(s&&n.sub(s.position,s.positionPrev)||S,i&&n.sub(i.position,i.positionPrev)||S),g=n.dot(p,m)}i&&!i.isStatic&&(f=i.inverseMass/w,i.constraintImpulse.x-=T.x*f,i.constraintImpulse.y-=T.y*f,i.position.x-=T.x*f,i.position.y-=T.y*f,x>0&&(i.positionPrev.x-=x*p.x*g*f,i.positionPrev.y-=x*p.y*g*f),c=n.cross(a,T)/b*r._torqueDampen*i.inverseInertia*(1-t.angularStiffness),i.constraintImpulse.angle-=c,i.angle-=c),s&&!s.isStatic&&(f=s.inverseMass/w,s.constraintImpulse.x+=T.x*f,s.constraintImpulse.y+=T.y*f,s.position.x+=T.x*f,s.position.y+=T.y*f,x>0&&(s.positionPrev.x+=x*p.x*g*f,s.positionPrev.y+=x*p.y*g*f),c=n.cross(o,T)/b*r._torqueDampen*s.inverseInertia*(1-t.angularStiffness),s.constraintImpulse.angle+=c,s.angle+=c)}}},r.postSolveAll=function(t){for(var e=0;e0&&(d.position.x+=l.x,d.position.y+=l.y),0!==l.angle&&(s.rotate(d.vertices,l.angle,i.position),h.rotate(d.axes,l.angle),u>0&&n.rotateAbout(d.position,l.angle,i.position,d.position)),o.update(d.bounds,d.vertices,i.velocity)}l.angle*=r._warming,l.x*=r._warming,l.y*=r._warming}}},r.pointAWorld=function(t){return{x:(t.bodyA?t.bodyA.position.x:0)+(t.pointA?t.pointA.x:0),y:(t.bodyA?t.bodyA.position.y:0)+(t.pointA?t.pointA.y:0)}},r.pointBWorld=function(t){return{x:(t.bodyB?t.bodyB.position.x:0)+(t.pointB?t.pointB.x:0),y:(t.bodyB?t.bodyB.position.y:0)+(t.pointB?t.pointB.y:0)}},r.currentLength=function(t){var e=(t.bodyA?t.bodyA.position.x:0)+(t.pointA?t.pointA.x:0),i=(t.bodyA?t.bodyA.position.y:0)+(t.pointA?t.pointA.y:0),r=e-((t.bodyB?t.bodyB.position.x:0)+(t.pointB?t.pointB.x:0)),s=i-((t.bodyB?t.bodyB.position.y:0)+(t.pointB?t.pointB.y:0));return Math.sqrt(r*r+s*s)}},53402(t,e,i){var r={};t.exports=r,function(){r._baseDelta=1e3/60,r._nextId=0,r._seed=0,r._nowStartTime=+new Date,r._warnedOnce={},r._decomp=null,r.extend=function(t,e){var i,s;"boolean"==typeof e?(i=2,s=e):(i=1,s=!0);for(var n=i;n0;e--){var i=Math.floor(r.random()*(e+1)),s=t[e];t[e]=t[i],t[i]=s}return t},r.choose=function(t){return t[Math.floor(r.random()*t.length)]},r.isElement=function(t){return"undefined"!=typeof HTMLElement?t instanceof HTMLElement:!!(t&&t.nodeType&&t.nodeName)},r.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)},r.isFunction=function(t){return"function"==typeof t},r.isPlainObject=function(t){return"object"==typeof t&&t.constructor===Object},r.isString=function(t){return"[object String]"===toString.call(t)},r.clamp=function(t,e,i){return ti?i:t},r.sign=function(t){return t<0?-1:1},r.now=function(){if("undefined"!=typeof window&&window.performance){if(window.performance.now)return window.performance.now();if(window.performance.webkitNow)return window.performance.webkitNow()}return Date.now?Date.now():new Date-r._nowStartTime},r.random=function(e,i){return i=void 0!==i?i:1,(e=void 0!==e?e:0)+t()*(i-e)};var t=function(){return r._seed=(9301*r._seed+49297)%233280,r._seed/233280};r.colorToNumber=function(t){return 3==(t=t.replace("#","")).length&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)),parseInt(t,16)},r.logLevel=1,r.log=function(){console&&r.logLevel>0&&r.logLevel<=3&&console.log.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},r.info=function(){console&&r.logLevel>0&&r.logLevel<=2&&console.info.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},r.warn=function(){console&&r.logLevel>0&&r.logLevel<=3&&console.warn.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},r.warnOnce=function(){var t=Array.prototype.slice.call(arguments).join(" ");r._warnedOnce[t]||(r.warn(t),r._warnedOnce[t]=!0)},r.deprecated=function(t,e,i){t[e]=r.chain(function(){r.warnOnce("🔅 deprecated 🔅",i)},t[e])},r.nextId=function(){return r._nextId++},r.indexOf=function(t,e){if(t.indexOf)return t.indexOf(e);for(var i=0;ir._deltaMax&&d.warnOnce("Matter.Engine.update: delta argument is recommended to be less than or equal to",r._deltaMax.toFixed(3),"ms."),e=void 0!==e?e:d._baseDelta,e*=m.timeScale,m.timestamp+=e,m.lastDelta=e;var y={timestamp:m.timestamp,delta:e};h.trigger(t,"beforeUpdate",y);var x=l.allBodies(f),T=l.allConstraints(f),w=l.allComposites(f);for(f.isModified&&(a.setBodies(p,x),l.setModified(f,!1,!1,!0)),t.enableSleeping&&s.update(x,e),r._bodiesApplyGravity(x,t.gravity),r.wrap(x,w),r.attractors(x),e>0&&r._bodiesUpdate(x,e),h.trigger(t,"beforeSolve",y),u.preSolveAll(x),i=0;i0&&h.trigger(t,"collisionStart",{pairs:g.collisionStart,timestamp:m.timestamp,delta:e});var S=d.clamp(20/t.positionIterations,0,1);for(n.preSolvePosition(g.list),i=0;i0&&h.trigger(t,"collisionActive",{pairs:g.collisionActive,timestamp:m.timestamp,delta:e}),g.collisionEnd.length>0&&h.trigger(t,"collisionEnd",{pairs:g.collisionEnd,timestamp:m.timestamp,delta:e}),r._bodiesClearForces(x),h.trigger(t,"afterUpdate",y),t.timing.lastElapsed=d.now()-c,t},r.merge=function(t,e){if(d.extend(t,e),e.world){t.world=e.world,r.clear(t);for(var i=l.allBodies(t.world),n=0;n0)for(var s=0;s0){i||(i={}),r=e.split(" ");for(var l=0;ln?(s.warn("Plugin.register:",r.toString(e),"was upgraded to",r.toString(t)),r._registry[t.name]=t):i-1},r.isFor=function(t,e){var i=t.for&&r.dependencyParse(t.for);return!t.for||e.name===i.name&&r.versionSatisfies(e.version,i.range)},r.use=function(t,e){if(t.uses=(t.uses||[]).concat(e||[]),0!==t.uses.length){for(var i=r.dependencies(t),n=s.topologicalSort(i),a=[],o=0;o0&&!h.silent&&s.info(a.join(" "))}else s.warn("Plugin.use:",r.toString(t),"does not specify any dependencies to install.")},r.dependencies=function(t,e){var i=r.dependencyParse(t),n=i.name;if(!(n in(e=e||{}))){t=r.resolve(t)||t,e[n]=s.map(t.uses||[],function(e){r.isPlugin(e)&&r.register(e);var n=r.dependencyParse(e),a=r.resolve(e);return a&&!r.versionSatisfies(a.version,n.range)?(s.warn("Plugin.dependencies:",r.toString(a),"does not satisfy",r.toString(n),"used by",r.toString(i)+"."),a._warned=!0,t._warned=!0):a||(s.warn("Plugin.dependencies:",r.toString(e),"used by",r.toString(i),"could not be resolved."),t._warned=!0),n.name});for(var a=0;a=|>)?\s*((\d+)\.(\d+)\.(\d+))(-[0-9A-Za-z-+]+)?$/;e.test(t)||s.warn("Plugin.versionParse:",t,"is not a valid version or range.");var i=e.exec(t),r=Number(i[4]),n=Number(i[5]),a=Number(i[6]);return{isRange:Boolean(i[1]||i[2]),version:i[3],range:t,operator:i[1]||i[2]||"",major:r,minor:n,patch:a,parts:[r,n,a],prerelease:i[7],number:1e8*r+1e4*n+a}},r.versionSatisfies=function(t,e){e=e||"*";var i=r.versionParse(e),s=r.versionParse(t);if(i.isRange){if("*"===i.operator||"*"===t)return!0;if(">"===i.operator)return s.number>i.number;if(">="===i.operator)return s.number>=i.number;if("~"===i.operator)return s.major===i.major&&s.minor===i.minor&&s.patch>=i.patch;if("^"===i.operator)return i.major>0?s.major===i.major&&s.number>=i.number:i.minor>0?s.minor===i.minor&&s.patch>=i.patch:s.patch===i.patch}return t===e||"*"===t}},13037(t,e,i){var r={};t.exports=r;var s=i(35810),n=i(48413),a=i(53402);!function(){r._maxFrameDelta=1e3/15,r._frameDeltaFallback=1e3/60,r._timeBufferMargin=1.5,r._elapsedNextEstimate=1,r._smoothingLowerBound=.1,r._smoothingUpperBound=.9,r.create=function(t){var e=a.extend({delta:1e3/60,frameDelta:null,frameDeltaSmoothing:!0,frameDeltaSnapping:!0,frameDeltaHistory:[],frameDeltaHistorySize:100,frameRequestId:null,timeBuffer:0,timeLastTick:null,maxUpdates:null,maxFrameTime:1e3/30,lastUpdatesDeferred:0,enabled:!0},t);return e.fps=0,e},r.run=function(t,e){return t.timeBuffer=r._frameDeltaFallback,function i(s){t.frameRequestId=r._onNextFrame(t,i),s&&t.enabled&&r.tick(t,e,s)}(),t},r.tick=function(e,i,o){var h=a.now(),l=e.delta,u=0,d=o-e.timeLastTick;if((!d||!e.timeLastTick||d>Math.max(r._maxFrameDelta,e.maxFrameTime))&&(d=e.frameDelta||r._frameDeltaFallback),e.frameDeltaSmoothing){e.frameDeltaHistory.push(d),e.frameDeltaHistory=e.frameDeltaHistory.slice(-e.frameDeltaHistorySize);var c=e.frameDeltaHistory.slice(0).sort(),f=e.frameDeltaHistory.slice(c.length*r._smoothingLowerBound,c.length*r._smoothingUpperBound);d=t(f)||d}e.frameDeltaSnapping&&(d=1e3/Math.round(1e3/d)),e.frameDelta=d,e.timeLastTick=o,e.timeBuffer+=e.frameDelta,e.timeBuffer=a.clamp(e.timeBuffer,0,e.frameDelta+l*r._timeBufferMargin),e.lastUpdatesDeferred=0;var p=e.maxUpdates||Math.ceil(e.maxFrameTime/l),g={timestamp:i.timing.timestamp};s.trigger(e,"beforeTick",g),s.trigger(e,"tick",g);for(var m=a.now();l>0&&e.timeBuffer>=l*r._timeBufferMargin;){s.trigger(e,"beforeUpdate",g),n.update(i,l),s.trigger(e,"afterUpdate",g),e.timeBuffer-=l,u+=1;var v=a.now()-h,y=a.now()-m,x=v+r._elapsedNextEstimate*y/u;if(u>=p||x>e.maxFrameTime){e.lastUpdatesDeferred=Math.round(Math.max(0,e.timeBuffer/l-r._timeBufferMargin));break}}i.timing.lastUpdatesPerFrame=u,s.trigger(e,"afterTick",g),e.frameDeltaHistory.length>=100&&(e.lastUpdatesDeferred&&Math.round(e.frameDelta/l)>p?a.warnOnce("Matter.Runner: runner reached runner.maxUpdates, see docs."):e.lastUpdatesDeferred&&a.warnOnce("Matter.Runner: runner reached runner.maxFrameTime, see docs."),void 0!==e.isFixed&&a.warnOnce("Matter.Runner: runner.isFixed is now redundant, see docs."),(e.deltaMin||e.deltaMax)&&a.warnOnce("Matter.Runner: runner.deltaMin and runner.deltaMax were removed, see docs."),0!==e.fps&&a.warnOnce("Matter.Runner: runner.fps was replaced by runner.delta, see docs."))},r.stop=function(t){r._cancelNextFrame(t)},r._onNextFrame=function(t,e){if("undefined"==typeof window||!window.requestAnimationFrame)throw new Error("Matter.Runner: missing required global window.requestAnimationFrame.");return t.frameRequestId=window.requestAnimationFrame(e),t.frameRequestId},r._cancelNextFrame=function(t){if("undefined"==typeof window||!window.cancelAnimationFrame)throw new Error("Matter.Runner: missing required global window.cancelAnimationFrame.");window.cancelAnimationFrame(t.frameRequestId)};var t=function(t){for(var e=0,i=t.length,r=0;r0&&h.motion=h.sleepThreshold/i&&r.set(h,!0)):h.sleepCounter>0&&(h.sleepCounter-=1)}else r.set(h,!1)}},r.afterCollisions=function(t){for(var e=r._motionSleepThreshold,i=0;ie&&r.set(h,!1)}}}},r.set=function(t,e){var i=t.isSleeping;e?(t.isSleeping=!0,t.sleepCounter=t.sleepThreshold,t.positionImpulse.x=0,t.positionImpulse.y=0,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.anglePrev=t.angle,t.speed=0,t.angularSpeed=0,t.motion=0,i||n.trigger(t,"sleepStart")):(t.isSleeping=!1,t.sleepCounter=0,i&&n.trigger(t,"sleepEnd"))}},66280(t,e,i){var r={};t.exports=r;var s=i(41598),n=i(53402),a=i(22562),o=i(15647),h=i(31725);r.rectangle=function(t,e,i,r,o){o=o||{};var h={label:"Rectangle Body",position:{x:t,y:e},vertices:s.fromPath("L 0 0 L "+i+" 0 L "+i+" "+r+" L 0 "+r)};if(o.chamfer){var l=o.chamfer;h.vertices=s.chamfer(h.vertices,l.radius,l.quality,l.qualityMin,l.qualityMax),delete o.chamfer}return a.create(n.extend({},h,o))},r.trapezoid=function(t,e,i,r,o,h){h=h||{},o>=1&&n.warn("Bodies.trapezoid: slope parameter must be < 1.");var l,u=i*(o*=.5),d=u+(1-2*o)*i,c=d+u;l=o<.5?"L 0 0 L "+u+" "+-r+" L "+d+" "+-r+" L "+c+" 0":"L 0 0 L "+d+" "+-r+" L "+c+" 0";var f={label:"Trapezoid Body",position:{x:t,y:e},vertices:s.fromPath(l)};if(h.chamfer){var p=h.chamfer;f.vertices=s.chamfer(f.vertices,p.radius,p.quality,p.qualityMin,p.qualityMax),delete h.chamfer}return a.create(n.extend({},f,h))},r.circle=function(t,e,i,s,a){s=s||{};var o={label:"Circle Body",circleRadius:i};a=a||25;var h=Math.ceil(Math.max(10,Math.min(a,i)));return h%2==1&&(h+=1),r.polygon(t,e,h,i,n.extend({},o,s))},r.polygon=function(t,e,i,o,h){if(h=h||{},i<3)return r.circle(t,e,o,h);for(var l=2*Math.PI/i,u="",d=.5*l,c=0;c0&&s.area(A)1?(p=a.create(n.extend({parts:g.slice(0)},r)),a.setPosition(p,{x:t,y:e}),p):g[0]},r.flagCoincidentParts=function(t,e){void 0===e&&(e=5);for(var i=0;ig&&(g=y),o.translate(v,{x:.5*x,y:.5*y}),d=v.bounds.max.x+n,s.addBody(u,v),l=v,f+=1}else d+=n}c+=g+a,d=t}return u},r.chain=function(t,e,i,r,o,h){for(var l=t.bodies,u=1;u0)for(l=0;l0&&(c=f[l-1+(h-1)*e],s.addConstraint(t,n.create(a.extend({bodyA:c,bodyB:d},o)))),r&&lc||a<(l=c-l)||a>i-1-l))return 1===d&&o.translate(u,{x:(a+(i%2==1?1:-1))*f,y:0}),h(t+(u?a*f:0)+a*n,r,a,l,u,d)})},r.newtonsCradle=function(t,e,i,r,a){for(var o=s.create({label:"Newtons Cradle"}),l=0;lt.max.x&&(t.max.x=s.x),s.xt.max.y&&(t.max.y=s.y),s.y0?t.max.x+=i.x:t.min.x+=i.x,i.y>0?t.max.y+=i.y:t.min.y+=i.y)},e.contains=function(t,e){return e.x>=t.min.x&&e.x<=t.max.x&&e.y>=t.min.y&&e.y<=t.max.y},e.overlaps=function(t,e){return t.min.x<=e.max.x&&t.max.x>=e.min.x&&t.max.y>=e.min.y&&t.min.y<=e.max.y},e.translate=function(t,e){t.min.x+=e.x,t.max.x+=e.x,t.min.y+=e.y,t.max.y+=e.y},e.shift=function(t,e){var i=t.max.x-t.min.x,r=t.max.y-t.min.y;t.min.x=e.x,t.max.x=e.x+i,t.min.y=e.y,t.max.y=e.y+r},e.wrap=function(t,e,i){var r=null,s=null;if(void 0!==e.min.x&&void 0!==e.max.x&&(t.min.x>e.max.x?r=e.min.x-t.max.x:t.max.xe.max.y?s=e.min.y-t.max.y:t.max.y1;if(!c||t!=c.x||e!=c.y){c&&r?(f=c.x,p=c.y):(f=0,p=0);var s={x:f+t,y:p+e};!r&&c||(c=s),g.push(s),v=f+t,y=p+e}},T=function(t){var e=t.pathSegTypeAsLetter.toUpperCase();if("Z"!==e){switch(e){case"M":case"L":case"T":case"C":case"S":case"Q":v=t.x,y=t.y;break;case"H":v=t.x;break;case"V":y=t.y}x(v,y,t.pathSegType)}};for(r._svgPathToAbsolute(t),a=t.getTotalLength(),l=[],i=0;i0)return!1;a=i}return!0},r.scale=function(t,e,i,n){if(1===e&&1===i)return t;var a,o;n=n||r.centre(t);for(var h=0;h=0?h-1:t.length-1],u=t[h],d=t[(h+1)%t.length],c=e[h0&&(n|=2),3===n)return!1;return 0!==n||null},r.hull=function(t){var e,i,r=[],n=[];for((t=t.slice(0)).sort(function(t,e){var i=t.x-e.x;return 0!==i?i:t.y-e.y}),i=0;i=2&&s.cross3(n[n.length-2],n[n.length-1],e)<=0;)n.pop();n.push(e)}for(i=t.length-1;i>=0;i-=1){for(e=t[i];r.length>=2&&s.cross3(r[r.length-2],r[r.length-1],e)<=0;)r.pop();r.push(e)}return r.pop(),n.pop(),r.concat(n)}},55973(t){function e(t,e,i){i=i||0;var r,s,n,a,o,h,l,u=[0,0];return r=t[1][1]-t[0][1],s=t[0][0]-t[1][0],n=r*t[0][0]+s*t[0][1],a=e[1][1]-e[0][1],o=e[0][0]-e[1][0],h=a*e[0][0]+o*e[0][1],S(l=r*o-a*s,0,i)||(u[0]=(o*n-s*h)/l,u[1]=(r*h-a*n)/l),u}function i(t,e,i,r){var s=e[0]-t[0],n=e[1]-t[1],a=r[0]-i[0],o=r[1]-i[1];if(a*n-o*s===0)return!1;var h=(s*(i[1]-t[1])+n*(t[0]-i[0]))/(a*n-o*s),l=(a*(t[1]-i[1])+o*(i[0]-t[0]))/(o*s-a*n);return h>=0&&h<=1&&l>=0&&l<=1}function r(t,e,i){return(e[0]-t[0])*(i[1]-t[1])-(i[0]-t[0])*(e[1]-t[1])}function s(t,e,i){return r(t,e,i)>0}function n(t,e,i){return r(t,e,i)>=0}function a(t,e,i){return r(t,e,i)<0}function o(t,e,i){return r(t,e,i)<=0}t.exports={decomp:function(t){var e=T(t);return e.length>0?w(t,e):[t]},quickDecomp:function t(e,i,r,h,l,u,g){u=u||100,g=g||0,l=l||25,i=void 0!==i?i:[],r=r||[],h=h||[];var m=[0,0],v=[0,0],x=[0,0],T=0,w=0,S=0,C=0,E=0,A=0,_=0,M=[],R=[],P=e,O=e;if(O.length<3)return i;if(++g>u)return console.warn("quickDecomp: max level ("+u+") reached."),i;for(var L=0;LE&&(E+=e.length),C=Number.MAX_VALUE,E3&&r>=0;--r)u(c(t,r-1),c(t,r),c(t,r+1),e)&&(t.splice(r%t.length,1),i++);return i},removeDuplicatePoints:function(t,e){for(var i=t.length-1;i>=1;--i)for(var r=t[i],s=i-1;s>=0;--s)C(r,t[s],e)&&t.splice(i,1)},makeCCW:function(t){for(var e=0,i=t,r=1;ri[e][0])&&(e=r);return!s(c(t,e-1),c(t,e),c(t,e+1))&&(function(t){for(var e=[],i=t.length,r=0;r!==i;r++)e.push(t.pop());for(r=0;r!==i;r++)t[r]=e[r]}(t),!0)}};var h=[],l=[];function u(t,e,i,s){if(s){var n=h,a=l;n[0]=e[0]-t[0],n[1]=e[1]-t[1],a[0]=i[0]-e[0],a[1]=i[1]-e[1];var o=n[0]*a[0]+n[1]*a[1],u=Math.sqrt(n[0]*n[0]+n[1]*n[1]),d=Math.sqrt(a[0]*a[0]+a[1]*a[1]);return Math.acos(o/(u*d)){const o=this.getVideoPlaybackQuality(),h=this.mozPresentedFrames||this.mozPaintedFrames||o.totalVideoFrames-o.droppedVideoFrames;if(h>r){const r=this.mozFrameDelay||o.totalFrameDelay-i.totalFrameDelay||0,s=a-n;t(a,{presentationTime:a+1e3*r,expectedDisplayTime:a+s,width:this.videoWidth,height:this.videoHeight,mediaTime:Math.max(0,this.currentTime||0)+s/1e3,presentedFrames:h,processingDuration:r}),delete this._rvfcpolyfillmap[e]}else this._rvfcpolyfillmap[e]=requestAnimationFrame(t=>s(a,t))};return this._rvfcpolyfillmap[e]=requestAnimationFrame(t=>s(e,t)),e},HTMLVideoElement.prototype.cancelVideoFrameCallback=function(t){cancelAnimationFrame(this._rvfcpolyfillmap[t]),delete this._rvfcpolyfillmap[t]})},10312(t){t.exports={SKIP_CHECK:-1,NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16,ERASE:17,SOURCE_IN:18,SOURCE_OUT:19,SOURCE_ATOP:20,DESTINATION_OVER:21,DESTINATION_IN:22,DESTINATION_OUT:23,DESTINATION_ATOP:24,LIGHTER:25,COPY:26,XOR:27}},29795(t){t.exports={DEFAULT:0,LINEAR:0,NEAREST:1}},84322(t){t.exports={MULTIPLY:0,FILL:1,ADD:2,SCREEN:4,OVERLAY:5,HARD_LIGHT:6}},68627(t,e,i){var r=i(19715),s=i(32880),n=i(83419),a=i(8054),o=i(50792),h=i(92503),l=i(56373),u=i(97480),d=i(69442),c=i(8443),f=i(61340),p=new n({Extends:o,initialize:function(t){o.call(this);var e=t.config;this.config={clearBeforeRender:e.clearBeforeRender,backgroundColor:e.backgroundColor,antialias:e.antialias,roundPixels:e.roundPixels,transparent:e.transparent},this.game=t,this.type=a.CANVAS,this.drawCount=0,this.width=0,this.height=0,this.gameCanvas=t.canvas;var i={alpha:e.transparent,desynchronized:e.desynchronized,willReadFrequently:!1};this.gameContext=e.context?e.context:this.gameCanvas.getContext("2d",i),this.currentContext=this.gameContext,this.antialias=e.antialias,this.blendModes=l(),this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92},this._tempMatrix1=new f,this._tempMatrix2=new f,this._tempMatrix3=new f,this.isBooted=!1,this.init()},init:function(){var t=this.game;t.events.once(c.BOOT,function(){var t=this.config;if(!t.transparent){var e=this.gameContext,i=this.gameCanvas;e.fillStyle=t.backgroundColor.rgba,e.fillRect(0,0,i.width,i.height)}},this),t.textures.once(d.READY,this.boot,this)},boot:function(){var t=this.game,e=t.scale.baseSize;this.width=e.width,this.height=e.height,this.isBooted=!0,t.scale.on(u.RESIZE,this.onResize,this),this.resize(e.width,e.height)},onResize:function(t,e){e.width===this.width&&e.height===this.height||this.resize(e.width,e.height)},resize:function(t,e){this.width=t,this.height=e,this.emit(h.RESIZE,t,e)},resetTransform:function(){this.currentContext.setTransform(1,0,0,1,0,0)},setBlendMode:function(t){return this.currentContext.globalCompositeOperation=t,this},setContext:function(t){return this.currentContext=t||this.gameContext,this},setAlpha:function(t){return this.currentContext.globalAlpha=t,this},preRender:function(){var t=this.gameContext,e=this.config,i=this.width,r=this.height;t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),this.emit(h.PRE_RENDER_CLEAR),e.clearBeforeRender&&(t.clearRect(0,0,i,r),e.transparent||(t.fillStyle=e.backgroundColor.rgba,t.fillRect(0,0,i,r))),t.save(),this.drawCount=0,this.emit(h.PRE_RENDER)},render:function(t,e,i){var s=e.length;this.emit(h.RENDER,t,i);var n=i.x,a=i.y,o=i.width,l=i.height,u=i.renderToTexture?i.context:t.sys.context;u.save(),this.game.scene.customViewports&&(u.beginPath(),u.rect(n,a,o,l),u.clip()),i.emit(r.PRE_RENDER,i),this.currentContext=u;var d=i.mask;d&&d.preRenderCanvas(this,null,i._maskCamera),i.transparent||(u.fillStyle=i.backgroundColor.rgba,u.fillRect(n,a,o,l)),u.globalAlpha=i.alpha,u.globalCompositeOperation="source-over",this.drawCount+=s,i.renderToTexture&&i.emit(r.PRE_RENDER,i),i.matrix.copyToContext(u);for(var c=0;c=0?v=-(v+d):v<0&&(v=Math.abs(v)-d)),t.flipY&&(y>=0?y=-(y+c):y<0&&(y=Math.abs(y)-c))}var T=1,w=1;t.flipX&&(f||(v+=-e.realWidth+2*g),T=-1),t.flipY&&(f||(y+=-e.realHeight+2*m),w=-1);var b=t.x,S=t.y;if(i.roundPixels&&(b=Math.floor(b),S=Math.floor(S)),o.applyITRS(b,S,t.rotation,t.scaleX*T,t.scaleY*w),a.copyWithScrollFactorFrom(i.matrixCombined,i.scrollX,i.scrollY,t.scrollFactorX,t.scrollFactorY),r&&a.multiply(r),a.multiply(o),i.renderRoundPixels&&(a.e=Math.floor(a.e+.5),a.f=Math.floor(a.f+.5)),n.save(),a.setToContext(n),n.globalCompositeOperation=this.blendModes[t.blendMode],n.globalAlpha=s,n.imageSmoothingEnabled=!e.source.scaleMode,t.mask&&t.mask.preRenderCanvas(this,t,i),d>0&&c>0){var C=d/p,E=c/p;i.roundPixels&&(v=Math.floor(v+.5),y=Math.floor(y+.5),C+=.5,E+=.5),n.drawImage(e.source.image,l,u,d,c,v,y,C,E)}t.mask&&t.mask.postRenderCanvas(this,t,i),n.restore()}},destroy:function(){this.removeAllListeners(),this.game=null,this.gameCanvas=null,this.gameContext=null}});t.exports=p},55830(t,e,i){t.exports={CanvasRenderer:i(68627),GetBlendModes:i(56373),SetTransform:i(20926)}},56373(t,e,i){var r=i(10312),s=i(89289);t.exports=function(){var t=[],e=s.supportNewBlendModes,i="source-over";return t[r.NORMAL]=i,t[r.ADD]="lighter",t[r.MULTIPLY]=e?"multiply":i,t[r.SCREEN]=e?"screen":i,t[r.OVERLAY]=e?"overlay":i,t[r.DARKEN]=e?"darken":i,t[r.LIGHTEN]=e?"lighten":i,t[r.COLOR_DODGE]=e?"color-dodge":i,t[r.COLOR_BURN]=e?"color-burn":i,t[r.HARD_LIGHT]=e?"hard-light":i,t[r.SOFT_LIGHT]=e?"soft-light":i,t[r.DIFFERENCE]=e?"difference":i,t[r.EXCLUSION]=e?"exclusion":i,t[r.HUE]=e?"hue":i,t[r.SATURATION]=e?"saturation":i,t[r.COLOR]=e?"color":i,t[r.LUMINOSITY]=e?"luminosity":i,t[r.ERASE]="destination-out",t[r.SOURCE_IN]="source-in",t[r.SOURCE_OUT]="source-out",t[r.SOURCE_ATOP]="source-atop",t[r.DESTINATION_OVER]="destination-over",t[r.DESTINATION_IN]="destination-in",t[r.DESTINATION_OUT]="destination-out",t[r.DESTINATION_ATOP]="destination-atop",t[r.LIGHTER]="lighter",t[r.COPY]="copy",t[r.XOR]="xor",t}},20926(t,e,i){var r=i(91296);t.exports=function(t,e,i,s,n){var a=s.alpha*i.alpha;if(a<=0)return!1;var o=r(i,s,n).calc;return e.globalCompositeOperation=t.blendModes[i.blendMode],e.globalAlpha=a,e.save(),o.setToContext(e),e.imageSmoothingEnabled=i.frame?!i.frame.source.scaleMode:t.antialias,!0}},63899(t){t.exports="losewebgl"},6119(t){t.exports="postrender"},31124(t){t.exports="prerenderclear"},48070(t){t.exports="prerender"},15640(t){t.exports="render"},8912(t){t.exports="resize"},87124(t){t.exports="restorewebgl"},53998(t){t.exports="setparalleltextureunits"},92503(t,e,i){t.exports={LOSE_WEBGL:i(63899),POST_RENDER:i(6119),PRE_RENDER:i(48070),PRE_RENDER_CLEAR:i(31124),RENDER:i(15640),RESIZE:i(8912),RESTORE_WEBGL:i(87124),SET_PARALLEL_TEXTURE_UNITS:i(53998)}},36909(t,e,i){t.exports={Events:i(92503),Snapshot:i(89966)},t.exports.Canvas=i(55830),t.exports.WebGL=i(4159)},32880(t,e,i){var r=i(27919),s=i(40987),n=i(95540);t.exports=function(t,e){var i=n(e,"callback"),a=n(e,"type","image/png"),o=n(e,"encoder",.92),h=Math.abs(Math.round(n(e,"x",0))),l=Math.abs(Math.round(n(e,"y",0))),u=Math.floor(n(e,"width",t.width)),d=Math.floor(n(e,"height",t.height));if(n(e,"getPixel",!1)){var c=t.getContext("2d",{willReadFrequently:!1}).getImageData(h,l,1,1).data;i.call(null,new s(c[0],c[1],c[2],c[3]))}else if(0!==h||0!==l||u!==t.width||d!==t.height){var f=r.createWebGL(this,u,d),p=f.getContext("2d",{willReadFrequently:!0});u>0&&d>0&&p.drawImage(t,h,l,u,d,0,0,u,d);var g=new Image;g.onerror=function(){i.call(null),r.remove(f)},g.onload=function(){i.call(null,g),r.remove(f)},g.src=f.toDataURL(a,o)}else{var m=new Image;m.onerror=function(){i.call(null)},m.onload=function(){i.call(null,m)},m.src=t.toDataURL(a,o)}}},88815(t,e,i){var r=i(27919),s=i(40987),n=i(95540);t.exports=function(t,e){var i=t,a=n(e,"callback"),o=n(e,"type","image/png"),h=n(e,"encoder",.92),l=Math.abs(Math.round(n(e,"x",0))),u=Math.abs(Math.round(n(e,"y",0))),d=n(e,"getPixel",!1),c=n(e,"isFramebuffer",!1),f=c?n(e,"bufferWidth",1):i.drawingBufferWidth,p=c?n(e,"bufferHeight",1):i.drawingBufferHeight;if(d){var g=new Uint8Array(4),m=p-u-1;i.readPixels(l,m,1,1,i.RGBA,i.UNSIGNED_BYTE,g),a.call(null,new s(g[0],g[1],g[2],g[3]))}else{var v=Math.floor(n(e,"width",f)),y=Math.floor(n(e,"height",p)),x=new Uint8Array(v*y*4);i.readPixels(l,p-u-y,v,y,i.RGBA,i.UNSIGNED_BYTE,x);for(var T=r.createWebGL(this,v,y),w=T.getContext("2d",{willReadFrequently:!0}),b=w.getImageData(0,0,v,y),S=b.data,C=0;C0},beginDraw:function(){this.framebuffer&&this.renderer.glTextureUnits.unbindTexture(this.texture),this.renderer.glWrapper.update(this.state)},clear:function(t){this.beginDraw(),void 0===t&&(t=this.autoClear),this.renderer.renderNodes.finishBatch(),this.renderer.gl.clear(t)},destroy:function(){this.renderer.deleteTexture(this.texture),this.renderer.deleteFramebuffer(this.state.bindings.framebuffer),this.renderer=null,this.camera=null,this.state=null,this.framebuffer=null,this.texture=null}});t.exports=s},65656(t,e,i){var r=i(83419),s=i(87774),n=new r({initialize:function(t,e,i){this.renderer=t,this.maxAge=e,this.maxPoolSize=i,this.agePool=[],this.sizePool={}},add:function(t){if(-1===this.agePool.indexOf(t)){var e=t.width+"x"+t.height;this.sizePool[e]?this.sizePool[e].push(t):this.sizePool[e]=[t],this.agePool.push(t)}},get:function(t,e){var i,r,n=this.renderer;void 0===t&&(t=n.width),void 0===e&&(e=n.height);var a=n.getMaxTextureSize();t>a&&(t=a),e>a&&(e=a);var o=t+"x"+e,h=this.sizePool[o];if(h&&h.length>0)return i=h.pop(),r=this.agePool.indexOf(i),this.agePool.splice(r,1),i;if(this.agePool.length>0){var l=Date.now(),u=this.maxAge;if(l-(i=this.agePool[0]).lastUsed>u){this.agePool.shift();var d=i.width+"x"+i.height;return r=(h=this.sizePool[d]).indexOf(i),h.splice(r,1),i.resize(t,e),i}}return this.agePool.length0)for(var r=e.splice(0,i),s=0;s0){r+="_";for(var s=0;s0&&(r+="__",r+=i.sort().join("_")),r},createShaderProgram:function(t,e,i,r){var s=e.vertexShader,n=e.fragmentShader;if(s=s.replace(/\r/g,""),n=n.replace(/\r/g,""),i){for(var a,o,h={},l=0;l>>0},getTintAppendFloatAlpha:function(t,e){return((255*e&255)<<24|t)>>>0},getTintAppendFloatAlphaAndSwap:function(t,e){return((255*e&255)<<24|(255&t)<<16|(t>>8&255)<<8|t>>16&255)>>>0},getFloatsFromUintRGB:function(t){return[(t>>16&255)/255,(t>>8&255)/255,(255&t)/255]},checkShaderMax:function(t,e){var i=Math.min(16,t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS));return e&&-1!==e?Math.min(i,e):i},updateLightingUniforms:function(t,e,i,s,n,a,o,h){var l=e.camera,u=l.scene.sys.lights;if(u&&u.active){var d=u.getLights(l),c=d.length,f=u.ambientColor,p=e.height;if(t){i.setUniform("uNormSampler",s),i.setUniform("uCamera",[l.x,l.y,l.rotation,l.zoom]),i.setUniform("uAmbientLightColor",[f.r,f.g,f.b]),i.setUniform("uLightCount",c);for(var g=new r,m=0;m-1?t.getExtension(r):null,e.config.skipUnreadyShaders){var s="KHR_parallel_shader_compile";this.parallelShaderCompileExtension=i.indexOf(s)>-1?t.getExtension(s):null,this.parallelShaderCompileExtension||(e.config.skipUnreadyShaders=!1)}var n="OES_vertex_array_object";this.vaoExtension=i.indexOf(n)>-1?t.getExtension(n):null;var a="OES_standard_derivatives";if(this.standardDerivativesExtension=i.indexOf(a)>-1?t.getExtension(a):null,t instanceof WebGLRenderingContext){if(!this.instancedArraysExtension)throw new Error("ANGLE_instanced_arrays extension not supported. Required for rendering.");if(t.vertexAttribDivisor=this.instancedArraysExtension.vertexAttribDivisorANGLE.bind(this.instancedArraysExtension),t.drawArraysInstanced=this.instancedArraysExtension.drawArraysInstancedANGLE.bind(this.instancedArraysExtension),t.drawElementsInstanced=this.instancedArraysExtension.drawElementsInstancedANGLE.bind(this.instancedArraysExtension),!this.vaoExtension)throw new Error("OES_vertex_array_object extension not supported. Required for rendering.");if(t.createVertexArray=this.vaoExtension.createVertexArrayOES.bind(this.vaoExtension),t.bindVertexArray=this.vaoExtension.bindVertexArrayOES.bind(this.vaoExtension),t.deleteVertexArray=this.vaoExtension.deleteVertexArrayOES.bind(this.vaoExtension),t.isVertexArray=this.vaoExtension.isVertexArrayOES.bind(this.vaoExtension),this.standardDerivativesExtension)t.FRAGMENT_SHADER_DERIVATIVE_HINT=this.standardDerivativesExtension.FRAGMENT_SHADER_DERIVATIVE_HINT_OES;else if(e.config.smoothPixelArt)throw new Error("OES_standard_derivatives extension not supported. Cannot use smoothPixelArt.")}},setContextHandlers:function(t,e){this.previousContextLostHandler&&this.canvas.removeEventListener("webglcontextlost",this.previousContextLostHandler,!1),this.previousContextRestoredHandler&&this.canvas.removeEventListener("webglcontextrestored",this.previousContextRestoredHandler,!1),this.contextLostHandler="function"==typeof t?t.bind(this):this.dispatchContextLost.bind(this),this.contextRestoredHandler="function"==typeof e?e.bind(this):this.dispatchContextRestored.bind(this),this.canvas.addEventListener("webglcontextlost",this.contextLostHandler,!1),this.canvas.addEventListener("webglcontextrestored",this.contextRestoredHandler,!1),this.previousContextLostHandler=this.contextLostHandler,this.previousContextRestoredHandler=this.contextRestoredHandler},dispatchContextLost:function(t){this.contextLost=!0,console&&console.warn("WebGL Context lost. Renderer disabled"),this.emit(h.LOSE_WEBGL,this),t.preventDefault()},dispatchContextRestored:function(t){if(this.gl.isContextLost())console&&console.log("WebGL Context restored, but context is still lost");else{this.setExtensions(),this.glWrapper.update(A.getDefault(this),!0),this.glTextureUnits.init(),this.compression=this.getCompressedTextures();var e=function(t){t.createResource()};r(this.glTextureWrappers,e),r(this.glBufferWrappers,e),r(this.glFramebufferWrappers,e),r(this.glProgramWrappers,e),r(this.glVAOWrappers,e),this.glTextureUnits.bindUnits(this.glTextureUnits.units,!0),this.resize(this.game.scale.baseSize.width,this.game.scale.baseSize.height),this.contextLost=!1,console&&console.warn("WebGL Context restored. Renderer running again."),this.emit(h.RESTORE_WEBGL,this),t.preventDefault()}},captureFrame:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1)},captureNextFrame:function(){P},getFps:function(){P},log:function(){},startCapture:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=!1),void 0===i&&(i=!1)},stopCapture:function(){P},onCapture:function(t){},onResize:function(t,e){e.width===this.width&&e.height===this.height||this.resize(e.width,e.height)},resize:function(t,e){var i=this.gl;return this.width=t,this.height=e,this.setProjectionMatrix(t,e),this.drawingBufferHeight=i.drawingBufferHeight,this.glWrapper.update({scissor:{box:[0,i.drawingBufferHeight-e,t,e]},viewport:[0,0,t,e]}),this.emit(h.RESIZE,t,e),this},getCompressedTextures:function(){var t="WEBGL_compressed_texture_",e="WEBKIT_"+t,i=function(i,r){var s=i.getExtension(t+r)||i.getExtension(e+r)||i.getExtension("EXT_texture_compression_"+r);if(s){var n={};for(var a in s)n[s[a]]=a;return n}},r=this.gl;return{ETC:i(r,"etc"),ETC1:i(r,"etc1"),ATC:i(r,"atc"),ASTC:i(r,"astc"),BPTC:i(r,"bptc"),RGTC:i(r,"rgtc"),PVRTC:i(r,"pvrtc"),S3TC:i(r,"s3tc"),S3TCSRGB:i(r,"s3tc_srgb"),IMG:!0}},getCompressedTextureName:function(t,e){var i=this.compression[t.toUpperCase()];if(e in i)return i[e]},supportsCompressedTexture:function(t,e){var i=this.compression[t.toUpperCase()];return!!i&&(!e||e in i)},getAspectRatio:function(){return this.width/this.height},setProjectionMatrix:function(t,e,i){return t===this.projectionWidth&&e===this.projectionHeight&&i===this.projectionFlipY||(this.projectionWidth=t,this.projectionHeight=e,this.projectionFlipY=!!i,i?this.projectionMatrix.ortho(0,t,0,e,-1e3,1e3):this.projectionMatrix.ortho(0,t,e,0,-1e3,1e3)),this},setProjectionMatrixFromDrawingContext:function(t){return this.setProjectionMatrix(t.width,t.height,!1)},resetProjectionMatrix:function(){return this.setProjectionMatrix(this.width,this.height)},hasExtension:function(t){return!!this.supportedExtensions&&this.supportedExtensions.indexOf(t)},getExtension:function(t){return this.hasExtension(t)?(t in this.extensions||(this.extensions[t]=this.gl.getExtension(t)),this.extensions[t]):null},addBlendMode:function(t,e){return this.blendModes.push(E.createCombined(this,!0,void 0,e,t[0],t[1]))-1-1},updateBlendMode:function(t,e,i){if(t>17&&this.blendModes[t]){var r=this.blendModes[t];2===e.length?r.func=[e[0],e[1],e[0],e[1]]:r.func=[e[0],e[1],e[2],e[3]],r.equation="number"==typeof i?[i,i]:[i[0],i[1]]}return this},removeBlendMode:function(t){return t>17&&this.blendModes[t]&&this.blendModes.splice(t,1),this},clearFramebuffer:function(t,e,i){var r=this.gl,s=0;t&&(this.glWrapper.updateColorClearValue({colorClearValue:t}),s|=r.COLOR_BUFFER_BIT),void 0!==e&&(this.glWrapper.updateStencilClear({stencil:{clear:e}}),s|=r.STENCIL_BUFFER_BIT),void 0!==i&&(s|=r.DEPTH_BUFFER_BIT),r.clear(s)},createTextureFromSource:function(t,e,i,r,s,n){void 0===s&&(s=!1);var o=this.gl,h=o.NEAREST,u=o.NEAREST,d=o.CLAMP_TO_EDGE;e=t?t.width:e,i=t?t.height:i;var c=l(e,i);if(c&&!s&&(d=o.REPEAT),r===a.ScaleModes.LINEAR&&this.config.antialias){var f=t&&t.compressed,p=!f&&c||f&&t.mipmaps.length>1;h=this.mipmapFilter&&p?this.mipmapFilter:o.LINEAR,u=o.LINEAR}return t||"number"!=typeof e||"number"!=typeof i?this.createTexture2D(0,h,u,d,d,o.RGBA,t,void 0,void 0,void 0,void 0,n):this.createTexture2D(0,h,u,d,d,o.RGBA,null,e,i,void 0,void 0,n)},createTexture2D:function(t,e,i,r,s,n,a,o,h,l,u,d){"number"!=typeof o&&(o=a?a.width:1),"number"!=typeof h&&(h=a?a.height:1);var c=new w(this,t,e,i,r,s,n,a,o,h,l,u,d);return this.glTextureWrappers.push(c),c},createFramebuffer:function(t,e,i){Array.isArray(t)||null===t||(t=[t]);var r=new S(this,t,e,i);return this.glFramebufferWrappers.push(r),r},createProgram:function(t,e){var i=new x(this,t,e);return this.glProgramWrappers.push(i),i},createVertexBuffer:function(t,e){var i=this.gl,r=new v(this,t,i.ARRAY_BUFFER,e);return this.glBufferWrappers.push(r),r},createIndexBuffer:function(t,e){var i=this.gl,r=new v(this,t,i.ELEMENT_ARRAY_BUFFER,e);return this.glBufferWrappers.push(r),r},createVAO:function(t,e,i){var r=new C(this,t,e,i);return this.glVAOWrappers.push(r),r},deleteTexture:function(t){if(t)return s(this.glTextureWrappers,t),t.destroy(),this},deleteFramebuffer:function(t){return t?(s(this.glFramebufferWrappers,t),t.destroy(),this):this},deleteProgram:function(t){return t&&(s(this.glProgramWrappers,t),t.destroy()),this},deleteBuffer:function(t){return t?(s(this.glBufferWrappers,t),t.destroy(),this):this},preRender:function(){if(!this.contextLost){this.emit(h.PRE_RENDER_CLEAR);var t=this.baseDrawingContext;if(this.config.clearBeforeRender){var e=this.config.backgroundColor;t.setClearColor(e.redGL,e.greenGL,e.blueGL,e.alphaGL),t.setAutoClear(!0,!0,!0)}else t.setAutoClear(!1,!1,!1);t.use(),this.emit(h.PRE_RENDER)}},render:function(t,e,i){this.contextLost||(this.emit(h.RENDER,t,i),this.currentViewCamera=i,this.cameraRenderNode.run(this.baseDrawingContext,e,i),this.currentViewCamera=null)},postRender:function(){if(this.baseDrawingContext.release(),!this.contextLost){this.emit(h.POST_RENDER);var t=this.snapshotState;t.callback&&(m(this.gl,t),t.callback=null)}},drawElements:function(t,e,i,r,s,n,a){var o=this.gl;t.beginDraw(),i.bind(),r.bind(),this.glTextureUnits.bindUnits(e),o.drawElements(a||o.TRIANGLE_STRIP,s,o.UNSIGNED_SHORT,n)},drawInstancedArrays:function(t,e,i,r,s,n,a,o){var h=this.gl;t.beginDraw(),i.bind(),r.bind(),this.glTextureUnits.bindUnits(e),h.drawArraysInstanced(o||h.TRIANGLE_STRIP,s,n,a)},snapshot:function(t,e,i){return this.snapshotArea(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight,t,e,i)},snapshotArea:function(t,e,i,r,s,n,a){var o=this.snapshotState;return o.callback=s,o.type=n,o.encoder=a,o.getPixel=!1,o.x=t,o.y=e,o.width=i,o.height=r,o.unpremultiplyAlpha=this.game.config.premultipliedAlpha,this},snapshotPixel:function(t,e,i){return this.snapshotArea(t,e,1,1,i),this.snapshotState.getPixel=!0,this},snapshotFramebuffer:function(t,e,i,r,s,n,a,o,h,l,u){void 0===s&&(s=!1),void 0===n&&(n=0),void 0===a&&(a=0),void 0===o&&(o=e),void 0===h&&(h=i),"pixel"===l&&(s=!0,l="image/png"),this.snapshotArea(n,a,o,h,r,l,u);var d=this.snapshotState;return d.getPixel=s,d.isFramebuffer=!0,d.bufferWidth=e,d.bufferHeight=i,d.width=Math.min(d.width,e),d.height=Math.min(d.height,i),this.glWrapper.updateBindingsFramebuffer({bindings:{framebuffer:t}}),m(this.gl,d),d.callback=null,d.isFramebuffer=!1,this},canvasToTexture:function(t,e,i,r){void 0===i&&(i=!1),void 0===r&&(r=!0);var s=this.gl,n=s.NEAREST,a=s.NEAREST,o=t.width,h=t.height,u=s.CLAMP_TO_EDGE,d=l(o,h);return!i&&d&&(u=s.REPEAT),this.config.antialias&&(n=d&&this.mipmapFilter?this.mipmapFilter:s.LINEAR,a=s.LINEAR),e?(e.update(t,o,h,r,u,u,n,a,e.format),e):this.createTexture2D(0,n,a,u,u,s.RGBA,t,o,h,!0,!1,r)},createCanvasTexture:function(t,e,i){return void 0===e&&(e=!1),void 0===i&&(i=!0),this.canvasToTexture(t,null,e,i)},updateCanvasTexture:function(t,e,i,r){return void 0===i&&(i=!0),void 0===r&&(r=!1),this.canvasToTexture(t,e,r,i)},videoToTexture:function(t,e,i,r){void 0===i&&(i=!1),void 0===r&&(r=!0);var s=this.gl,n=s.NEAREST,a=s.NEAREST,o=t.videoWidth,h=t.videoHeight,u=s.CLAMP_TO_EDGE,d=l(o,h);return!i&&d&&(u=s.REPEAT),this.config.antialias&&(n=d&&this.mipmapFilter?this.mipmapFilter:s.LINEAR,a=s.LINEAR),e?(e.update(t,o,h,r,u,u,n,a,e.format),e):this.createTexture2D(0,n,a,u,u,s.RGBA,t,o,h,!0,!0,r)},createVideoTexture:function(t,e,i){return void 0===e&&(e=!1),void 0===i&&(i=!0),this.videoToTexture(t,null,e,i)},updateVideoTexture:function(t,e,i,r){return void 0===i&&(i=!0),void 0===r&&(r=!1),this.videoToTexture(t,e,r,i)},createUint8ArrayTexture:function(t,e,i,r,s){var n=this.gl,a=n.NEAREST,o=n.NEAREST,h=n.CLAMP_TO_EDGE;return l(e,i)&&(h=n.REPEAT),void 0===r&&(r=!0),void 0===s&&(s=!0),this.createTexture2D(0,a,o,h,h,n.RGBA,t,e,i,r,!1,s)},setTextureFilter:function(t,e){var i=this.gl,r=0===e?i.LINEAR:i.NEAREST,s=this.glTextureUnits,n=s.units[0];return s.bind(t,0),t.update(t.pixels,t.width,t.height,t.flipY,t.wrapS,t.wrapT,r,r,t.format),n&&s.bind(n,0),this},setTextureWrap:function(t,e,i){var r=this.gl;if(!l(t.width,t.height)&&(e!==r.CLAMP_TO_EDGE||i!==r.CLAMP_TO_EDGE))return this;var s=this.glTextureUnits,n=s.units[0];return s.bind(t,0),t.update(t.pixels,t.width,t.height,t.flipY,e,i,t.minFilter,t.magFilter,t.format),n&&s.bind(n,0),this},getMaxTextureSize:function(){return this.config.maxTextureSize},destroy:function(){this.off(h.RESIZE,this.baseDrawingContext.resize,this.baseDrawingContext),this.canvas.removeEventListener("webglcontextlost",this.contextLostHandler,!1),this.canvas.removeEventListener("webglcontextrestored",this.contextRestoredHandler,!1);var t=function(t){t.destroy()};r(this.glBufferWrappers,t),r(this.glFramebufferWrappers,t),r(this.glProgramWrappers,t),r(this.glTextureWrappers,t),this.removeAllListeners(),this.extensions={},this.gl=null,this.game=null,this.canvas=null,this.contextLost=!0}});t.exports=O},14500(t){t.exports={BYTE:{enum:5120,size:1},UNSIGNED_BYTE:{enum:5121,size:1},SHORT:{enum:5122,size:2},UNSIGNED_SHORT:{enum:5123,size:2},INT:{enum:5124,size:4},UNSIGNED_INT:{enum:5125,size:4},FLOAT:{enum:5126,size:4}}},4159(t,e,i){var r=i(14500),s=i(79291),n={Shaders:i(89350),ShaderAdditionMakers:i(83786),DrawingContext:i(87774),DrawingContextPool:i(65656),ProgramManager:i(56436),RenderNodes:i(54521),ShaderProgramFactory:i(18804),Utils:i(70554),WebGLRenderer:i(74797),Wrappers:i(31884)};n=s(!1,n,r),t.exports=n},47774(t){var e={createCombined:function(t,e,i,r,s,n){var a=t.gl;return void 0===e&&(e=!0),void 0===i&&(i=[0,0,0,0]),void 0===r&&(r=a.FUNC_ADD),void 0===s&&(s=a.ONE),void 0===n&&(n=a.ONE_MINUS_SRC_ALPHA),{enabled:e,color:i,equation:[r,r],func:[s,n,s,n]}},createSeparate:function(t,e,i,r,s,n,a,o,h){var l=t.gl;return void 0===e&&(e=!0),void 0===i&&(i=[0,0,0,0]),void 0===r&&(r=l.FUNC_ADD),void 0===s&&(s=l.FUNC_ADD),void 0===n&&(n=l.ONE),void 0===a&&(a=l.ONE_MINUS_SRC_ALPHA),void 0===o&&(o=l.ONE),void 0===h&&(h=l.ONE_MINUS_SRC_ALPHA),{enabled:e,color:i,equation:[r,s],func:[n,a,o,h]}}};t.exports=e},53314(t,e,i){var r=i(8054),s=i(62644),n=i(71623),a={getDefault:function(t){return{bindings:{activeTexture:0,arrayBuffer:null,elementArrayBuffer:null,framebuffer:null,program:null,renderbuffer:null},blend:s(t.blendModes[r.BlendModes.NORMAL]),colorClearValue:[0,0,0,1],colorWritemask:[!0,!0,!0,!0],cullFace:!1,depthTest:!1,scissor:{enable:!0,box:[0,0,0,0]},stencil:n.create(t),texturing:{flipY:!1,premultiplyAlpha:!1},vao:null,viewport:[0,0,0,0]}}};t.exports=a},71623(t){var e={create:function(t,e,i,r,s,n,a,o,h){var l=t.gl;return void 0===e&&(e=!1),void 0===i&&(i=l.ALWAYS),void 0===r&&(r=0),void 0===s&&(s=255),void 0===n&&(n=l.KEEP),void 0===a&&(a=l.KEEP),void 0===o&&(o=l.KEEP),void 0===h&&(h=0),{enabled:e,func:{func:i,ref:r,mask:s},op:{fail:n,zfail:a,zpass:o},clear:h}}};t.exports=e},13961(t,e,i){var r=i(83419),s=i(56436),n=i(40952),a=i(6141),o=i(36909),h=new r({Extends:a,initialize:function(t,e,i){var r=t.renderer,h=r.gl,l=(i=this._copyAndCompleteConfig(t,i||{},e)).name;if(!l)throw new Error("BatchHandler must have a name");a.call(this,l,t),this.instancesPerBatch=-1,this.verticesPerInstance=i.verticesPerInstance;var u=Math.floor(65536/this.verticesPerInstance),d=i.instancesPerBatch||r.config.batchSize||u;this.instancesPerBatch=Math.min(d,u),this.indicesPerInstance=i.indicesPerInstance,this.bytesPerIndexPerInstance=this.indicesPerInstance*Uint16Array.BYTES_PER_ELEMENT,this.maxTexturesPerBatch=1,this.manager.on(o.Events.SET_PARALLEL_TEXTURE_UNITS,this.updateTextureCount,this),r.glWrapper.updateVAO({vao:null}),this.indexBuffer=r.createIndexBuffer(this._generateElementIndices(this.instancesPerBatch),i.indexBufferDynamic?h.DYNAMIC_DRAW:h.STATIC_DRAW);var c=i.vertexBufferLayout;if(c.count=this.instancesPerBatch*this.verticesPerInstance,this.vertexBufferLayout=new n(r,c,null),this.programManager=new s(r,[this.vertexBufferLayout],this.indexBuffer),this.programManager.setBaseShader(i.shaderName,i.vertexSource,i.fragmentSource),i.shaderAdditions)for(var f=0;fthis.instancesPerBatch)throw new Error("BatchHandlerStrip: Vertex count exceeds maximum per batch ("+this.maxVerticesPerBatch+")");this.instanceCount+c>this.instancesPerBatch&&this.run(t),this.updateRenderOptions(u),this._renderOptionsChanged&&(this.run(t),this.updateShaderConfig());var f,g=this.batchTextures(r),m=this.instanceCount*this.floatsPerInstance,v=this.vertexBufferLayout.buffer,y=v.viewF32,x=v.viewU32,T=!1;if(this.instanceCount>0){var w=1+this.floatsPerInstance/this.verticesPerInstance;y[m++]=y[m-w],y[m++]=y[m-w],y[m++]=y[m-w],y[m++]=y[m-w],y[m++]=y[m-w],y[m++]=y[m-w],x[m++]=x[m-w],T=!0}d&&(f=[]);for(var b=i.a,S=i.b,C=i.c,E=i.d,A=i.e,_=i.f,M=s.length,R=0;R=u.length)&&(n++,this.run(t),d=this.instanceCount*this.indicesPerInstance,g=this.vertexCount*h/f.BYTES_PER_ELEMENT,v=0,x=0)}}});t.exports=c},61842(t,e,i){var r=i(19715),s=i(1e3),n=i(61340),a=i(87841),o=i(43855),h=i(83419),l=i(70554),u=i(6141);function d(t){return l.getTintAppendFloatAlpha(16777215,t)}var c=new h({Extends:u,initialize:function(t){u.call(this,"Camera",t),this.batchHandlerQuadSingleNode=t.getNode("BatchHandlerQuadSingle"),this.fillCameraNode=t.getNode("FillCamera"),this.listCompositorNode=t.getNode("ListCompositor"),this._parentTransformMatrix=new n},run:function(t,e,i,n,h,l){var u;this.onRunBegin(t);var c=t.renderer.drawingContextPool,f=this.manager,p=i.alpha,g=i.filters.internal.getActive(),m=i.filters.external.getActive(),v=h||i.forceComposite||g.length||m.length||p<1;n?i.matrixExternal.multiply(n,n):n=this._parentTransformMatrix.copyFrom(i.matrixExternal);var y=n.decomposeMatrix(),x=o(y.translateX,0)&&o(y.translateY,0)&&o(y.rotation,0)&&o(y.scaleX,1)&&o(y.scaleY,1),T=i.x,w=i.y,b=i.width,S=i.height,C=t.getClone();C.setCamera(i),v?((u=c.get(b,S)).setCamera(i),u.setScissorBox(0,0,b,S)):(u=C).setScissorBox(T,w,b,S),u.use();var E=this.fillCameraNode;if(i.backgroundColor.alphaGL>0){var A=i.backgroundColor,_=s(A.red,A.green,A.blue,A.alpha);E.run(u,_,v)}this.listCompositorNode.run(u,e,null,l);var M=i.flashEffect;M.postRenderWebGL()&&(_=s(M.red,M.green,M.blue,255*M.alpha),E.run(u,_,v));var R=i.fadeEffect;if(R.postRenderWebGL()&&(_=s(R.red,R.green,R.blue,255*R.alpha),E.run(u,_,v)),f.finishBatch(),v){var P,O,L,F,D={smoothPixelArt:f.renderer.game.config.smoothPixelArt},I=new a(0,0,u.width,u.height);for(P=0;P0,k=!B,U=new a(0,0,C.width,C.height);if(B){for(P=m.length-1;P>=0;P--)(O=m[P]).active&&(L=O.getPaddingCeil(),U.setTo(U.x+L.x,U.y+L.y,U.width+L.width,U.height+L.height));(k=U.width!==u.width||U.height!==u.height||!x)&&((u=c.get(U.width,U.height)).setScissorBox(0,0,U.width,U.height),u.setCamera(C.camera),u.use())}else u=C;if(k){var z,Y=U.x,X=U.y;n.setQuad(I.x,I.y,I.x+I.width,I.y+I.height),z=n.quad,F=B?4294967295:d(p),i.roundPixels&&(z[0]=Math.round(z[0]),z[1]=Math.round(z[1]),z[2]=Math.round(z[2]),z[3]=Math.round(z[3]),z[4]=Math.round(z[4]),z[5]=Math.round(z[5]),z[6]=Math.round(z[6]),z[7]=Math.round(z[7])),this.batchHandlerQuadSingleNode.batch(u,N.texture,z[0]-Y,z[1]-X,z[2]-Y,z[3]-X,z[6]-Y,z[7]-X,z[4]-Y,z[5]-X,0,1,1,-1,!1,F,F,F,F,D)}if(N!==u&&N.release(),B){var W=!1;for(N=null,L=new a,P=0;P0&&d2&&g>1&&(m=!0,s||(v=!0));for(var y,x,T,w,b,S,C,E,A=[],_=0,M=[],R=0,P=[],O=0,L=u*u,F=0;F0){var l=e,u=e;if(a.length>0){s=h;for(var d=0;d0)for(s=h,d=0;d0){var s=this.instanceBufferLayout.buffer,n=i.memberCount,a=Math.floor(n/i.bufferUpdateSegmentSize),o=!0;for(e=0;e<=a;e++)if(!(1<0&&e.addAddition(h(t.tileset.maxAnimationLength));for(var s=t.lighting,n=e.getAdditionsByTag("LIGHTING"),a=0;a0,T=[y,e.layerDataTexture];if(x&&(T[2]=v.getAnimationDataTexture(s)),e.lighting){var w=v.image.dataSource[0];w=w?w.glTexture:this.manager.renderer.normalTexture,T[3]=w}this.updateRenderOptions(e);var b=this.programManager,S=b.getCurrentProgramSuite();if(S){var C=S.program,E=S.vao;this.setupUniforms(t,e),b.applyUniforms(C),s.drawElements(t,T,C,E,4,0)}this.onRunEnd(t)}});t.exports=y},12913(t,e,i){var r=i(83419),s=i(6141),n=new r({Extends:s,initialize:function(t){s.call(this,"TexturerImage",t),this.frame=null,this.frameWidth=0,this.frameHeight=0,this.uvSource=null},run:function(t,e,i){this.onRunBegin(t);var r=e.frame;if(this.frame=r,this.frameWidth=r.cutWidth,this.frameHeight=r.cutHeight,this.uvSource=r,e.isCropped){var s=e._crop;this.uvSource=s,s.flipX===e.flipX&&s.flipY===e.flipY||e.frame.updateCropUVs(s,e.flipX,e.flipY),this.frameWidth=s.width,this.frameHeight=s.height}var n=r.source.resolution;this.frameWidth/=n,this.frameHeight/=n,this.onRunEnd(t)}});t.exports=n},22995(t,e,i){var r=i(61340),s=i(83419),n=i(6141),a=new s({Extends:n,initialize:function(t){n.call(this,"TexturerTileSprite",t),this.frame=null,this.uvMatrix=new r},run:function(t,e,i){this.onRunBegin(t);var r=e.frame;if(this.frame=r,e.isCropped){var s=e._crop;s.flipX===e.flipX&&s.flipY===e.flipY||e.frame.updateCropUVs(s,e.flipX,e.flipY)}this.uvMatrix.loadIdentity(),this.uvMatrix.scale(1/r.width,1/r.height),this.uvMatrix.translate(e.tilePositionX,e.tilePositionY),this.uvMatrix.scale(1/e.tileScaleX,1/e.tileScaleY),this.uvMatrix.rotate(-e.tileRotation),this.uvMatrix.setQuad(0,0,e.width,e.height),this.onRunEnd(t)}});t.exports=a},86081(t,e,i){var r=i(61340),s=i(83419),n=i(46975),a=i(6141),o=new s({Extends:a,initialize:function(t,e){e=n(e||{},this.defaultConfig),a.call(this,e.name,t),this.quad=new Float32Array(8),this._spriteMatrix=new r,this._calcMatrix=new r},defaultConfig:{name:"TransformerImage",role:"Transformer"},run:function(t,e,i,r,s){this.onRunBegin(t);var n=i.frame,a=i.uvSource,o=a.x,h=a.y,l=e.displayOriginX,u=e.displayOriginY,d=-l+o,c=-u+h,f=n.customPivot,p=1,g=1;e.flipX&&(f||(d+=-n.realWidth+2*l),p=-1),e.flipY&&(f||(c+=-n.realHeight+2*u),g=-1);var m=t.camera,v=this._spriteMatrix,y=this._calcMatrix.copyWithScrollFactorFrom(m.getViewMatrix(!t.useCanvas),m.scrollX,m.scrollY,e.scrollFactorX,e.scrollFactorY);r&&y.multiply(r),v.applyITRS(e.x,e.y,e.rotation,e.scaleX*p,e.scaleY*g),y.multiply(v),y.setQuad(d,c,d+i.frameWidth,c+i.frameHeight,this.quad);var x=y.matrix,T=1===x[0]&&0===x[1]&&0===x[2]&&1===x[3];if(e.willRoundVertices(m,T)){var w=this.quad;w[0]=Math.round(w[0]),w[1]=Math.round(w[1]),w[2]=Math.round(w[2]),w[3]=Math.round(w[3]),w[4]=Math.round(w[4]),w[5]=Math.round(w[5]),w[6]=Math.round(w[6]),w[7]=Math.round(w[7])}this.onRunEnd(t)}});t.exports=o},88383(t,e,i){var r=i(61340),s=i(83419),n=i(46975),a=i(6141),o=new s({Extends:a,initialize:function(t,e){e=n(e||{},this.defaultConfig),a.call(this,e.name,t),this._spriteMatrix=new r,this.quad=this._spriteMatrix.quad},defaultConfig:{name:"TransformerStamp",role:"Transformer"},run:function(t,e,i,r,s){this.onRunBegin(t);var n=i.frame,a=i.uvSource,o=a.x,h=a.y,l=e.displayOriginX,u=e.displayOriginY,d=-l+o,c=-u+h,f=n.customPivot,p=1,g=1;e.flipX&&(f||(d+=-n.realWidth+2*l),p=-1),e.flipY&&(f||(c+=-n.realHeight+2*u),g=-1);var m=e.x,v=e.y,y=this._spriteMatrix;y.applyITRS(m,v,e.rotation,e.scaleX*p,e.scaleY*g);var x=y.matrix;this.onlyTranslate=1===x[0]&&0===x[1]&&0===x[2]&&1===x[3],y.setQuad(d,c,d+i.frameWidth,c+i.frameHeight);var T=y.matrix,w=1===T[0]&&0===T[1]&&0===T[2]&&1===T[3];if(e.willRoundVertices(t.camera,w)){var b=this.quad;b[0]=Math.round(b[0]),b[1]=Math.round(b[1]),b[2]=Math.round(b[2]),b[3]=Math.round(b[3]),b[4]=Math.round(b[4]),b[5]=Math.round(b[5]),b[6]=Math.round(b[6]),b[7]=Math.round(b[7])}this.onRunEnd(t)}});t.exports=o},34454(t,e,i){var r=i(83419),s=i(86081),n=new r({Extends:s,initialize:function(t,e){s.call(this,t,e)},defaultConfig:{name:"TransformerTile",role:"Transformer"},run:function(t,e,i,r,s){this.onRunBegin(t);var n=t.camera,a=this._calcMatrix,o=this._spriteMatrix;a.copyWithScrollFactorFrom(n.getViewMatrix(!t.useCanvas),n.scrollX,n.scrollY,e.scrollFactorX,e.scrollFactorY),r&&a.multiply(r);var h=i.frameWidth,l=i.frameHeight,u=h,d=l,c=h/2,f=l/2,p=e.scaleX,g=e.scaleY,m=e.gidMap[s.index],v=m.tileOffset.x,y=m.tileOffset.y,x=e.x+s.pixelX*p+(c*p-v),T=e.y+s.pixelY*g+(f*g-y),w=-c,b=-f;s.flipX&&(u*=-1,w+=h),s.flipY&&(d*=-1,w+=l),o.applyITRS(x,T,s.rotation,p,g),a.multiply(o),a.setQuad(w,b,w+u,b+d,this.quad);var S=a.matrix,C=1===S[0]&&0===S[1]&&0===S[2]&&1===S[3];if(e.willRoundVertices(n,C)){var E=this.quad;E[0]=Math.round(E[0]),E[1]=Math.round(E[1]),E[2]=Math.round(E[2]),E[3]=Math.round(E[3]),E[4]=Math.round(E[4]),E[5]=Math.round(E[5]),E[6]=Math.round(E[6]),E[7]=Math.round(E[7])}this.onRunEnd(t)}});t.exports=n},46211(t,e,i){var r=i(83419),s=i(86081),n=new r({Extends:s,initialize:function(t,e){s.call(this,t,e)},defaultConfig:{name:"TransformerTileSprite",role:"Transformer"},run:function(t,e,i,r,s){this.onRunBegin(t);var n=e.width,a=e.height,o=e.displayOriginX,h=e.displayOriginY,l=-o,u=-h,d=1,c=1;e.flipX&&(l+=2*o-n,d=-1),e.flipY&&(u+=2*h-a,c=-1);var f=e.x,p=e.y,g=t.camera,m=this._calcMatrix,v=this._spriteMatrix;m.copyWithScrollFactorFrom(g.getViewMatrix(!t.useCanvas),g.scrollX,g.scrollY,e.scrollFactorX,e.scrollFactorY),r&&m.multiply(r),v.applyITRS(f,p,e.rotation,e.scaleX*d,e.scaleY*c),m.multiply(v),m.setQuad(l,u,l+n,u+a,this.quad);var y=m.matrix,x=1===y[0]&&0===y[1]&&0===y[2]&&1===y[3];if(e.willRoundVertices(g,x)){var T=this.quad;T[0]=Math.round(T[0]),T[1]=Math.round(T[1]),T[2]=Math.round(T[2]),T[3]=Math.round(T[3]),T[4]=Math.round(T[4]),T[5]=Math.round(T[5]),T[6]=Math.round(T[6]),T[7]=Math.round(T[7])}this.onRunEnd(t)}});t.exports=n},84547(t){t.exports=["vec4 applyLighting (vec4 fragColor, vec3 normal)","{"," vec4 lighting = getLighting(fragColor, normal);"," return fragColor * vec4(lighting.rgb * lighting.a, lighting.a);","}"].join("\n")},11104(t){t.exports=["vec4 applyTint(vec4 texture)","{"," vec3 unpremultTexture = texture.rgb / texture.a;"," float alpha = texture.a * outTint.a;"," vec3 color = vec3(unpremultTexture);"," if (outTintEffect == 0.0) {"," color *= outTint.bgr;"," }"," else if (outTintEffect == 1.0) {"," color = outTint.bgr;"," }"," else if (outTintEffect == 2.0) {"," color += outTint.bgr;"," }"," else if (outTintEffect == 4.0) {"," color = 1.0 - (1.0 - unpremultTexture) * (1.0 - outTint.bgr);"," }"," else if (outTintEffect == 5.0) {"," color = vec3("," unpremultTexture.r < 0.5 ? 2.0 * outTint.b * unpremultTexture.r : 1.0 - 2.0 * (1.0 - outTint.b) * (1.0 - unpremultTexture.r),"," unpremultTexture.g < 0.5 ? 2.0 * outTint.g * unpremultTexture.g : 1.0 - 2.0 * (1.0 - outTint.g) * (1.0 - unpremultTexture.g),"," unpremultTexture.b < 0.5 ? 2.0 * outTint.r * unpremultTexture.b : 1.0 - 2.0 * (1.0 - outTint.r) * (1.0 - unpremultTexture.b)"," );"," }"," else if (outTintEffect == 6.0) {"," color = vec3("," outTint.b < 0.5 ? 2.0 * outTint.b * unpremultTexture.r : 1.0 - 2.0 * (1.0 - outTint.b) * (1.0 - unpremultTexture.r),"," outTint.g < 0.5 ? 2.0 * outTint.g * unpremultTexture.g : 1.0 - 2.0 * (1.0 - outTint.g) * (1.0 - unpremultTexture.g),"," outTint.r < 0.5 ? 2.0 * outTint.r * unpremultTexture.b : 1.0 - 2.0 * (1.0 - outTint.r) * (1.0 - unpremultTexture.b)"," );"," }"," return vec4(color * alpha, alpha);","}"].join("\n")},81556(t){t.exports=["vec4 boundedSampler(sampler2D sampler, vec2 uv)","{"," if (clamp(uv, 0.0, 1.0) != uv)"," {"," return vec4(0.0, 0.0, 0.0, 0.0);"," }"," return texture2D(sampler, uv);","}"].join("\n")},96293(t){t.exports=["#define SHADER_NAME PHASER_COLORMATRIX_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform float uColorMatrix[20];","uniform float uAlpha;","varying vec2 outTexCoord;","void main ()","{"," vec4 c = texture2D(uMainSampler, outTexCoord);"," if (uAlpha == 0.0)"," {"," gl_FragColor = c;"," return;"," }"," if (c.a > 0.0)"," {"," c.rgb /= c.a;"," }"," vec4 result;"," result.r = (uColorMatrix[0] * c.r) + (uColorMatrix[1] * c.g) + (uColorMatrix[2] * c.b) + (uColorMatrix[3] * c.a) + uColorMatrix[4];"," result.g = (uColorMatrix[5] * c.r) + (uColorMatrix[6] * c.g) + (uColorMatrix[7] * c.b) + (uColorMatrix[8] * c.a) + uColorMatrix[9];"," result.b = (uColorMatrix[10] * c.r) + (uColorMatrix[11] * c.g) + (uColorMatrix[12] * c.b) + (uColorMatrix[13] * c.a) + uColorMatrix[14];"," result.a = (uColorMatrix[15] * c.r) + (uColorMatrix[16] * c.g) + (uColorMatrix[17] * c.b) + (uColorMatrix[18] * c.a) + uColorMatrix[19];"," c.rgb *= c.a;"," result.rgb *= result.a;"," gl_FragColor = mix(c, result, uAlpha);","}"].join("\n")},78390(t){t.exports=["vec2 v2len (vec2 a, vec2 b)","{"," return sqrt(a*a+b*b);","}","vec2 getBlockyTexCoord (vec2 texCoord, vec2 texRes) {"," texCoord *= texRes;"," vec2 seam = floor(texCoord + 0.5);"," texCoord = (texCoord - seam) / v2len(dFdx(texCoord), dFdy(texCoord)) + seam;"," texCoord = clamp(texCoord, seam-.5, seam+.5);"," return texCoord / texRes;","}"].join("\n")},11719(t){t.exports=["struct Light","{"," vec3 position;"," vec3 color;"," float intensity;"," float radius;","};","const int kMaxLights = LIGHT_COUNT;","uniform vec4 uCamera; /* x, y, rotation, zoom */","uniform sampler2D uNormSampler;","uniform vec3 uAmbientLightColor;","uniform Light uLights[kMaxLights];","uniform int uLightCount;","#ifdef FEATURE_SELFSHADOW","uniform float uDiffuseFlatThreshold;","uniform float uPenumbra;","#endif","vec4 getLighting (vec4 fragColor, vec3 normal)","{"," vec3 finalColor = vec3(0.0);"," vec2 res = vec2(min(uResolution.x, uResolution.y)) * uCamera.w;"," #ifdef FEATURE_SELFSHADOW"," vec3 unpremultipliedColor = fragColor.rgb / fragColor.a;"," float occlusionThreshold = 1.0 - ((unpremultipliedColor.r + unpremultipliedColor.g + unpremultipliedColor.b) / uDiffuseFlatThreshold);"," #endif"," for (int index = 0; index < kMaxLights; ++index)"," {"," if (index < uLightCount)"," {"," Light light = uLights[index];"," vec3 lightDir = vec3((light.position.xy / res) - (gl_FragCoord.xy / res), light.position.z / res.x);"," vec3 lightNormal = normalize(lightDir);"," float distToSurf = length(lightDir) * uCamera.w;"," float diffuseFactor = max(dot(normal, lightNormal), 0.0);"," float radius = (light.radius / res.x * uCamera.w) * uCamera.w;"," float attenuation = clamp(1.0 - distToSurf * distToSurf / (radius * radius), 0.0, 1.0);"," #ifdef FEATURE_SELFSHADOW"," float occluded = smoothstep(0.0, 1.0, (diffuseFactor - occlusionThreshold) / uPenumbra);"," vec3 diffuse = light.color * diffuseFactor * occluded;"," #else"," vec3 diffuse = light.color * diffuseFactor;"," #endif"," finalColor += (attenuation * diffuse) * light.intensity;"," }"," }"," vec4 colorOutput = vec4(uAmbientLightColor + finalColor, 1.0);"," return colorOutput;","}"].join("\n")},14030(t){t.exports=["vec2 clampTexCoordWithinFrame (vec2 texCoord)","{"," vec2 texRes = getTexRes();"," vec4 frameTexel = outFrame * texRes.xyxy;"," vec2 frameMin = frameTexel.xy + vec2(0.5, 0.5);"," vec2 frameMax = frameTexel.xy + frameTexel.zw - vec2(0.5, 0.5);"," return clamp(texCoord, frameMin / texRes, frameMax / texRes);","}"].join("\n")},10235(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform float amount;","varying vec2 outTexCoord;","#pragma phaserTemplate(fragmentHeader)","vec2 Distort(vec2 p)","{"," float theta = atan(p.y, p.x);"," float radius = length(p);"," radius = pow(radius, amount);"," p.x = radius * cos(theta);"," p.y = radius * sin(theta);"," return 0.5 * (p + 1.0);","}","void main()","{"," vec2 xy = 2.0 * outTexCoord - 1.0;"," vec2 texCoord = outTexCoord;"," if (length(xy) < 1.0)"," {"," texCoord = Distort(xy);"," }"," gl_FragColor = boundedSampler(uMainSampler, texCoord);","}"].join("\n")},65980(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uMainSampler2;","uniform float amount;","uniform vec4 color;","varying vec2 outTexCoord;","vec4 NORMAL (vec4 base, vec4 blend)","{"," return blend + base * (1.0 - blend.a);","}","vec4 ADD (vec4 base, vec4 blend)","{"," return base + blend;","}","vec4 MULTIPLY (vec4 base, vec4 blend)","{"," return base * blend;","}","vec4 SCREEN (vec4 base, vec4 blend)","{"," return 1.0 - (1.0 - base) * (1.0 - blend);","}","float overlayChannel (float base, float blend)","{"," return base < 0.5 ? 2.0 * base * blend : 1.0 - 2.0 * (1.0 - base) * (1.0 - blend);","}","vec4 OVERLAY (vec4 base, vec4 blend)","{"," return vec4("," overlayChannel(base.r, blend.r),"," overlayChannel(base.g, blend.g),"," overlayChannel(base.b, blend.b),"," overlayChannel(base.a, blend.a)"," );","}","vec4 DARKEN (vec4 base, vec4 blend)","{"," return min(base, blend);","}","vec4 LIGHTEN (vec4 base, vec4 blend)","{"," return max(base, blend);","}","float dodgeChannel (float base, float blend)","{"," return blend == 1.0 ? blend : min(1.0, base / (1.0 - blend));","}","vec4 COLOR_DODGE (vec4 base, vec4 blend)","{"," return vec4("," dodgeChannel(base.r, blend.r),"," dodgeChannel(base.g, blend.g),"," dodgeChannel(base.b, blend.b),"," dodgeChannel(base.a, blend.a)"," );","}","float burnChannel (float base, float blend)","{"," return blend == 0.0 ? blend : 1.0 - min(1.0, (1.0 - base) / blend);","}","vec4 COLOR_BURN (vec4 base, vec4 blend)","{"," return vec4("," burnChannel(base.r, blend.r),"," burnChannel(base.g, blend.g),"," burnChannel(base.b, blend.b),"," burnChannel(base.a, blend.a)"," );","}","float hardLightChannel (float base, float blend)","{"," return blend < 0.5 ? 2.0 * base * blend : 1.0 - 2.0 * (1.0 - base) * (1.0 - blend);","}","vec4 HARD_LIGHT (vec4 base, vec4 blend)","{"," return vec4("," hardLightChannel(base.r, blend.r),"," hardLightChannel(base.g, blend.g),"," hardLightChannel(base.b, blend.b),"," hardLightChannel(base.a, blend.a)"," );","}","float softLightChannel (float base, float blend)","{"," return blend < 0.5 ? (2.0 * base * blend + base * base * (1.0 - 2.0 * blend)) : (sqrt(base) * (2.0 * blend - 1.0) + 2.0 * base * (1.0 - blend));","}","vec4 SOFT_LIGHT (vec4 base, vec4 blend)","{"," return vec4("," softLightChannel(base.r, blend.r),"," softLightChannel(base.g, blend.g),"," softLightChannel(base.b, blend.b),"," softLightChannel(base.a, blend.a)"," );","}","vec4 DIFFERENCE (vec4 base, vec4 blend)","{"," return abs(base - blend);","}","vec4 EXCLUSION (vec4 base, vec4 blend)","{"," return base + blend - 2.0 * base * blend;","}","vec3 rgbToHsl (vec3 color)","{"," vec3 hsl = vec3(0.0);"," float fmin = min(min(color.r, color.g), color.b);"," float fmax = max(max(color.r, color.g), color.b);"," float delta = fmax - fmin;"," hsl.z = (fmax + fmin) / 2.0;"," if (delta == 0.0)"," {"," hsl.x = 0.0;"," hsl.y = 0.0;"," }"," else"," {"," if (hsl.z < 0.5)"," {"," hsl.y = delta / (fmax + fmin);"," }"," else"," {"," hsl.y = delta / (2.0 - fmax - fmin);"," }"," float deltaR = (((fmax - color.r) / 6.0) + (delta / 2.0)) / delta;"," float deltaG = (((fmax - color.g) / 6.0) + (delta / 2.0)) / delta;"," float deltaB = (((fmax - color.b) / 6.0) + (delta / 2.0)) / delta;"," if (color.r == fmax)"," {"," hsl.x = deltaB - deltaG;"," }"," else if (color.g == fmax)"," {"," hsl.x = (1.0 / 3.0) + deltaR - deltaB;"," }"," else if (color.b == fmax)"," {"," hsl.x = (2.0 / 3.0) + deltaG - deltaR;"," }"," if (hsl.x < 0.0)"," {"," hsl.x += 1.0;"," }"," else if (hsl.x > 1.0)"," {"," hsl.x -= 1.0;"," }"," }"," return hsl;","}","vec3 hslToRgb (vec3 hsl)","{"," float p = hsl.z * (1.0 - hsl.y);"," float q = hsl.z * (1.0 - hsl.y * hsl.x);"," float t = hsl.z * (1.0 - hsl.y * (1.0 - hsl.x));"," if (hsl.x < 1.0 / 6.0)"," {"," return vec3(hsl.z, t, p);"," }"," else if (hsl.x < 0.5)"," {"," return vec3(q, hsl.z, p);"," }"," else if (hsl.x < 2.0 / 3.0)"," {"," return vec3(p, hsl.z, t);"," }"," return vec3(p, q, hsl.z);","}","vec4 HUE (vec4 base, vec4 blend)","{"," vec3 baseHSL = rgbToHsl(base.rgb);"," vec3 blendHSL = rgbToHsl(blend.rgb);"," return vec4(hslToRgb(vec3(blendHSL.x, baseHSL.y, baseHSL.z)), base.a);","}","vec4 SATURATION (vec4 base, vec4 blend)","{"," vec3 baseHSL = rgbToHsl(base.rgb);"," vec3 blendHSL = rgbToHsl(blend.rgb);"," return vec4(hslToRgb(vec3(baseHSL.x, blendHSL.y, baseHSL.z)), base.a);","}","vec4 COLOR (vec4 base, vec4 blend)","{"," vec3 baseHSL = rgbToHsl(base.rgb);"," vec3 blendHSL = rgbToHsl(blend.rgb);"," return vec4(hslToRgb(vec3(blendHSL.x, blendHSL.y, baseHSL.z)), base.a);","}","vec4 LUMINOSITY (vec4 base, vec4 blend)","{"," vec3 baseHSL = rgbToHsl(base.rgb);"," vec3 blendHSL = rgbToHsl(blend.rgb);"," return vec4(hslToRgb(vec3(baseHSL.x, baseHSL.y, blendHSL.z)), base.a);","}","vec4 ERASE (vec4 base, vec4 blend)","{"," return base * (1.0 - blend.a);","}","vec4 SOURCE_IN (vec4 base, vec4 blend)","{"," return blend * base.a;","}","vec4 SOURCE_OUT (vec4 base, vec4 blend)","{"," return blend * (1.0 - base.a);","}","vec4 SOURCE_ATOP (vec4 base, vec4 blend)","{"," return base * (1.0 - blend.a) + blend * base.a;","}","vec4 DESTINATION_OVER (vec4 base, vec4 blend)","{"," return base + blend * (1.0 - base.a);","}","vec4 DESTINATION_IN (vec4 base, vec4 blend)","{"," return base * blend.a;","}","vec4 DESTINATION_OUT (vec4 base, vec4 blend)","{"," return base * (1.0 - blend.a);","}","vec4 DESTINATION_ATOP (vec4 base, vec4 blend)","{"," return base * blend.a + blend * (1.0 - base.a);","}","vec4 LIGHTER (vec4 base, vec4 blend)","{"," return ADD(base, blend);","}","vec4 COPY (vec4 base, vec4 blend)","{"," return blend;","}","vec4 XOR (vec4 base, vec4 blend)","{"," return base * (1.0 - blend.a) + blend * (1.0 - base.a);","}","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec4 base = boundedSampler(uMainSampler, outTexCoord);"," vec4 blend = boundedSampler(uMainSampler2, outTexCoord) * color;"," vec4 blended = BLEND(base, blend);"," gl_FragColor = mix(base, blended, amount);","}"].join("\n")},5899(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec4 uSizeAndOffset;","varying vec2 outTexCoord;","void main()","{"," vec2 gridCell = floor((outTexCoord * resolution + uSizeAndOffset.zw) / uSizeAndOffset.xy) * uSizeAndOffset.xy - uSizeAndOffset.zw;"," vec2 texCoord = gridCell / resolution;"," gl_FragColor = texture2D(uMainSampler, texCoord);","}"].join("\n")},20784(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec2 offset;","uniform float strength;","uniform vec3 color;","varying vec2 outTexCoord;","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec2 uv = outTexCoord;"," vec4 col = vec4(0.0);"," vec2 off1 = vec2(1.411764705882353) * offset * strength;"," vec2 off2 = vec2(3.2941176470588234) * offset * strength;"," vec2 off3 = vec2(5.176470588235294) * offset * strength;"," col += boundedSampler(uMainSampler, uv) * 0.1964825501511404;"," col += boundedSampler(uMainSampler, uv + (off1 / resolution)) * 0.2969069646728344;"," col += boundedSampler(uMainSampler, uv - (off1 / resolution)) * 0.2969069646728344;"," col += boundedSampler(uMainSampler, uv + (off2 / resolution)) * 0.09447039785044732;"," col += boundedSampler(uMainSampler, uv - (off2 / resolution)) * 0.09447039785044732;"," col += boundedSampler(uMainSampler, uv + (off3 / resolution)) * 0.010381362401148057;"," col += boundedSampler(uMainSampler, uv - (off3 / resolution)) * 0.010381362401148057;"," gl_FragColor = col * vec4(color, 1.0);","}"].join("\n")},65122(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec2 offset;","uniform float strength;","uniform vec3 color;","varying vec2 outTexCoord;","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec2 uv = outTexCoord;"," vec4 col = vec4(0.0);"," vec2 offset = vec2(1.333) * offset * strength;"," col += boundedSampler(uMainSampler, uv) * 0.29411764705882354;"," col += boundedSampler(uMainSampler, uv + (offset / resolution)) * 0.35294117647058826;"," col += boundedSampler(uMainSampler, uv - (offset / resolution)) * 0.35294117647058826;"," gl_FragColor = col * vec4(color, 1.0);","}"].join("\n")},60942(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec2 offset;","uniform float strength;","uniform vec3 color;","varying vec2 outTexCoord;","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec2 uv = outTexCoord;"," vec4 col = vec4(0.0);"," vec2 off1 = vec2(1.3846153846) * offset * strength;"," vec2 off2 = vec2(3.2307692308) * offset * strength;"," col += boundedSampler(uMainSampler, uv) * 0.2270270270;"," col += boundedSampler(uMainSampler, uv + (off1 / resolution)) * 0.3162162162;"," col += boundedSampler(uMainSampler, uv - (off1 / resolution)) * 0.3162162162;"," col += boundedSampler(uMainSampler, uv + (off2 / resolution)) * 0.0702702703;"," col += boundedSampler(uMainSampler, uv - (off2 / resolution)) * 0.0702702703;"," gl_FragColor = col * vec4(color, 1.0);","}"].join("\n")},43722(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","#define ITERATIONS 100.0","#define ONEOVER_ITR 1.0 / ITERATIONS","#define PI 3.141596","#define GOLDEN_ANGLE 2.39996323","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform float radius;","uniform float amount;","uniform float contrast;","uniform bool isTiltShift;","uniform float strength;","uniform vec2 blur;","varying vec2 outTexCoord;","vec2 Sample (in float theta, inout float r)","{"," r += 1.0 / r;"," return (r - 1.0) * vec2(cos(theta), sin(theta)) * 0.06;","}","#pragma phaserTemplate(fragmentHeader)","vec3 Bokeh (sampler2D tex, vec2 uv, float radius)","{"," vec3 acc = vec3(0.0);"," vec3 div = vec3(0.0);"," vec2 pixel = vec2(resolution.y / resolution.x, 1.0) * radius * .025;"," float r = 1.0;"," for (float j = 0.0; j < GOLDEN_ANGLE * ITERATIONS; j += GOLDEN_ANGLE)"," {"," vec3 col = boundedSampler(tex, uv + pixel * Sample(j, r)).xyz;"," col = contrast > 0.0 ? col * col * (1.0 + contrast) : col;"," vec3 bokeh = vec3(0.5) + pow(col, vec3(10.0)) * amount;"," acc += col * bokeh;"," div += bokeh;"," }"," return acc / div;","}","void main ()","{"," float shift = 1.0;"," if (isTiltShift)"," {"," vec2 uv = vec2(gl_FragCoord.xy / resolution + vec2(-0.5, -0.5)) * 2.0;"," float centerStrength = 1.0;"," shift = length(uv * blur * strength) * centerStrength;"," }"," gl_FragColor = vec4(Bokeh(uMainSampler, outTexCoord * vec2(1.0, 1.0), radius * shift), 0.0);","}"].join("\n")},19883(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform float uColorMatrix[20];","uniform float uAlpha;","varying vec2 outTexCoord;","void main ()","{"," vec4 c = texture2D(uMainSampler, outTexCoord);"," if (uAlpha == 0.0)"," {"," gl_FragColor = c;"," return;"," }"," if (c.a > 0.0)"," {"," c.rgb /= c.a;"," }"," vec4 result;"," result.r = (uColorMatrix[0] * c.r) + (uColorMatrix[1] * c.g) + (uColorMatrix[2] * c.b) + (uColorMatrix[3] * c.a) + uColorMatrix[4];"," result.g = (uColorMatrix[5] * c.r) + (uColorMatrix[6] * c.g) + (uColorMatrix[7] * c.b) + (uColorMatrix[8] * c.a) + uColorMatrix[9];"," result.b = (uColorMatrix[10] * c.r) + (uColorMatrix[11] * c.g) + (uColorMatrix[12] * c.b) + (uColorMatrix[13] * c.a) + uColorMatrix[14];"," result.a = (uColorMatrix[15] * c.r) + (uColorMatrix[16] * c.g) + (uColorMatrix[17] * c.b) + (uColorMatrix[18] * c.a) + uColorMatrix[19];"," vec3 rgb = mix(c.rgb, result.rgb, uAlpha);"," rgb *= result.a;"," gl_FragColor = vec4(rgb, result.a);","}"].join("\n")},32624(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uTransferSampler;","uniform float uColorMatrixSelf[20];","uniform float uColorMatrixTransfer[20];","uniform float uAlphaSelf;","uniform float uAlphaTransfer;","uniform vec4 uAdditions;","uniform vec4 uMultiplications;","varying vec2 outTexCoord;","#define S uColorMatrixSelf","#define T uColorMatrixTransfer","void main ()","{"," vec4 self = texture2D(uMainSampler, outTexCoord);"," if (uAlphaSelf == 0.0)"," {"," gl_FragColor = self;"," return;"," }"," if (self.a > 0.0)"," {"," self.rgb /= self.a;"," }"," vec4 resultSelf;"," resultSelf.r = (S[0] * self.r) + (S[1] * self.g) + (S[2] * self.b) + (S[3] * self.a) + S[4];"," resultSelf.g = (S[5] * self.r) + (S[6] * self.g) + (S[7] * self.b) + (S[8] * self.a) + S[9];"," resultSelf.b = (S[10] * self.r) + (S[11] * self.g) + (S[12] * self.b) + (S[13] * self.a) + S[14];"," resultSelf.a = (S[15] * self.r) + (S[16] * self.g) + (S[17] * self.b) + (S[18] * self.a) + S[19];"," if (uAlphaTransfer == 0.0)"," {"," self.rgb *= self.a;"," resultSelf.rgb *= resultSelf.a;"," gl_FragColor = mix(self, resultSelf, uAlphaSelf);"," return;"," }"," vec4 tex = texture2D(uTransferSampler, outTexCoord);"," if (tex.a > 0.0)"," {"," tex.rgb /= tex.a;"," }"," vec4 resultTransfer;"," resultTransfer.r = (T[0] * tex.r) + (T[1] * tex.g) + (T[2] * tex.b) + (T[3] * tex.a) + T[4];"," resultTransfer.g = (T[5] * tex.r) + (T[6] * tex.g) + (T[7] * tex.b) + (T[8] * tex.a) + T[9];"," resultTransfer.b = (T[10] * tex.r) + (T[11] * tex.g) + (T[12] * tex.b) + (T[13] * tex.a) + T[14];"," resultTransfer.a = (T[15] * tex.r) + (T[16] * tex.g) + (T[17] * tex.b) + (T[18] * tex.a) + T[19];"," vec4 combo = (resultSelf + resultTransfer) * uAdditions + (resultSelf * resultTransfer) * uMultiplications;"," self.rgb *= self.a;"," resultSelf.rgb *= resultSelf.a;"," combo.rgb *= combo.a;"," gl_FragColor = mix(self, mix(resultSelf, combo, uAlphaTransfer), uAlphaSelf);","}"].join("\n")},12886(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uDisplacementSampler;","uniform vec2 amount;","varying vec2 outTexCoord;","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec2 disp = (-vec2(0.5, 0.5) + texture2D(uDisplacementSampler, outTexCoord).rg) * amount;"," gl_FragColor = boundedSampler(uMainSampler, outTexCoord + disp).rgba;","}"].join("\n")},33016(t){t.exports=["#pragma phaserTemplate(shaderName)","#define DISTANCE 10.0","#define QUALITY 10.0","#pragma phaserTemplate(fragmentDefine)","precision mediump float;","uniform sampler2D uMainSampler;","varying vec2 outTexCoord;","uniform float outerStrength;","uniform float innerStrength;","uniform float scale;","uniform vec2 resolution;","uniform vec4 glowColor;","uniform bool knockout;","const float PI = 3.14159265358979323846264;","const float MAX_ALPHA = DISTANCE * (DISTANCE + 1.0) * QUALITY / 2.0;","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec2 px = vec2(1.0 / resolution.x, 1.0 / resolution.y) * scale;"," float totalAlpha = 0.0;"," float curAngle = 0.0;"," vec2 direction;"," vec2 displaced;"," vec4 color;"," for (float curDistance = 0.0; curDistance < DISTANCE; curDistance++)"," {"," curAngle += fract(sin(dot(vec2(curDistance, outTexCoord.x + outTexCoord.y), vec2(12.9898, 78.233))) * 43758.5453);"," for (float i = 0.0; i < QUALITY; i++)"," {"," curAngle += PI * 2.0 / (QUALITY);"," direction = vec2(cos(curAngle), sin(curAngle)) * px;"," displaced = outTexCoord + direction * (curDistance + 1.0);"," color = boundedSampler(uMainSampler, displaced);"," totalAlpha += (DISTANCE - curDistance) * color.a;"," }"," }"," color = boundedSampler(uMainSampler, outTexCoord);"," float alphaRatio = (totalAlpha / MAX_ALPHA);"," float innerGlowAlpha = (1.0 - alphaRatio) * innerStrength * color.a;"," float innerGlowStrength = min(1.0, innerGlowAlpha);"," vec4 innerColor = mix(color, glowColor, innerGlowStrength);"," float outerGlowAlpha = alphaRatio * outerStrength * (1.0 - color.a);"," float outerGlowStrength = min(1.0 - innerColor.a, outerGlowAlpha);"," if (knockout)"," {"," float resultAlpha = outerGlowStrength + innerGlowStrength;"," gl_FragColor = vec4(glowColor.rgb * resultAlpha, resultAlpha);"," }"," else"," {"," vec4 outerGlowColor = outerGlowStrength * glowColor.rgba;"," gl_FragColor = innerColor + outerGlowColor;"," }","}"].join("\n")},33179(t){t.exports=["#pragma phaserTemplate(shaderName)","precision highp float;","#pragma phaserTemplate(fragmentHeader)","uniform sampler2D uMainSampler;","uniform vec4 uColor;","uniform vec4 uColorFactor;","uniform bool uUnpremultiply;","uniform float uAlpha;","varying vec2 outTexCoord;","void main ()","{"," vec4 sample = texture2D(uMainSampler, outTexCoord);"," if (uUnpremultiply)"," {"," sample.rgb /= sample.a;"," }"," vec4 modulatedSample = sample * uColorFactor + uColor;"," float progress = modulatedSample.r + modulatedSample.g + modulatedSample.b + modulatedSample.a;"," vec4 rampColor = getRampAt(progress);"," rampColor.rgb *= rampColor.a;"," gl_FragColor = mix(sample, rampColor * sample.a, uAlpha);","}"].join("\n")},94526(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uEnvSampler;","uniform sampler2D uNormSampler;","uniform mat4 uViewMatrix;","uniform float uModelRotation;","uniform float uBulge;","uniform vec3 uColorFactor;","varying vec2 outTexCoord;","#define PI 3.14159265358979323846","void main()","{"," vec4 color = texture2D(uMainSampler, outTexCoord);"," vec3 normal = texture2D(uNormSampler, outTexCoord).rgb;"," vec3 normalN = normal * 2.0 - 1.0;"," float normalXYLength = length(normalN.xy);"," float angle = atan("," normalN.y,"," normalN.x"," ) - uModelRotation;"," normalN = vec3("," normalXYLength * cos(angle),"," normalXYLength * sin(angle),"," normalN.z"," );"," normalN = reflect(vec3(0.0, 0.0, -1.0), normalN);"," normalN = (uViewMatrix * vec4(normalN, 1.0)).xyz;"," float envX = atan(normalN.x, normalN.z) / PI;"," float envY = sin(normalN.y * PI / 2.0);"," vec2 uv = vec2(envX, envY) * 0.5 + 0.5;"," vec2 rotatedTexCoord = vec2("," cos(-uModelRotation) * outTexCoord.x - sin(-uModelRotation) * outTexCoord.y,"," sin(-uModelRotation) * outTexCoord.x + cos(- uModelRotation) * outTexCoord.y"," );"," uv += uBulge * (rotatedTexCoord - 0.5);"," if (uv.y < 0.0)"," {"," uv.y = abs(uv.y);"," uv.x += 0.5;"," }"," else if (uv.y > 1.0)"," {"," uv.y = 2.0 - uv.y;"," uv.x += 0.5;"," }"," vec3 environment = texture2D(uEnvSampler, uv).rgb;"," gl_FragColor = vec4(environment * color.rgb * uColorFactor, color.a);","}"].join("\n")},4488(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec4 uColor;","uniform vec4 uIsolateThresholdFeather;","varying vec2 outTexCoord;","void main()","{"," vec4 color = texture2D(uMainSampler, outTexCoord);"," vec3 unpremultipliedColor = color.rgb / color.a;"," float isolate = uIsolateThresholdFeather.x;"," float threshold = uIsolateThresholdFeather.y;"," float feather = uIsolateThresholdFeather.z;"," float match = distance(unpremultipliedColor, uColor.rgb);"," match = clamp(match - threshold, 0.0, 1.0);"," match = clamp(match / feather, 0.0, 1.0);"," if (isolate == 1.0)"," {"," match = 1.0 - match;"," }"," match = mix(1.0, match, uColor.a);"," gl_FragColor = color * match;","}"].join("\n")},39603(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uMaskSampler;","uniform bool invert;","varying vec2 outTexCoord;","void main ()","{"," vec4 color = texture2D(uMainSampler, outTexCoord);"," vec4 mask = texture2D(uMaskSampler, outTexCoord);"," float a = mask.a;"," color *= invert ? (1.0 - a) : a;"," gl_FragColor = color;","}"].join("\n")},60047(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","#pragma phaserTemplate(fragmentHeader)","uniform sampler2D uMainSampler;","uniform mat4 uViewMatrix;","#ifdef FACING_POWER","uniform float uFacingPower;","#endif","#ifdef OUTPUT_RATIO","uniform vec3 uRatioVector;","uniform float uRatioRadius;","#endif","varying vec2 outTexCoord;","void main()","{"," vec3 normal = texture2D(uMainSampler, outTexCoord).rgb * 2.0 - 1.0;"," normal = (uViewMatrix * vec4(normal, 1.0)).xyz;"," #ifdef FACING_POWER"," normal = normalize(normal * vec3(1.0, 1.0, uFacingPower));"," #endif"," #ifdef OUTPUT_RATIO"," float ratio = dot(normal, normalize(uRatioVector));"," ratio = (ratio - 1.0 + uRatioRadius) / uRatioRadius;"," if (ratio <= 0.0)"," {"," ratio = 0.0;"," }"," normal = vec3(ratio * 2.0 - 1.0);"," #endif"," gl_FragColor = vec4((normal + 1.0) * 0.5, 1.0);","}"].join("\n")},7529(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform float uRadius;","uniform float uPower;","varying vec2 outTexCoord;","#define PI 3.14159265358979323846","#pragma phaserTemplate(fragmentHeader)","#define STEP_X 1.0 / SAMPLES_X","#define STEP_Y 1.0 / SAMPLES_Y","vec3 uvPanoramaNormal(vec2 uv)","{"," float y = uv.y * 2.0 - 1.0;"," float angle = (uv.x * 2.0 - 1.0) * PI;"," float x = sin(angle);"," float z = cos(angle);"," vec2 xz = vec2(x, z);"," xz *= sqrt(1.0 - y * y);"," return normalize(vec3(xz.x, y, xz.y));","}","void main()","{"," vec3 acc = vec3(0.0);"," float div = 0.0;"," vec3 texelNormal = uvPanoramaNormal(outTexCoord);"," for (float y = STEP_Y / 2.0; y < 1.0; y += STEP_Y)"," {"," float yWeight = cos((y * 2.0 - 1.0) * PI / 2.0);"," for (float x = STEP_X / 2.0; x < 1.0; x += STEP_X)"," {"," vec2 uv = vec2(x, y);"," vec3 sampleNormal = uvPanoramaNormal(uv);"," float dotProduct = dot(sampleNormal, texelNormal);"," dotProduct = (dotProduct - 1.0 + uRadius) / uRadius;"," if (dotProduct <= 0.0)"," {"," continue;"," }"," vec3 color = texture2D(uMainSampler, uv).rgb;"," color *= pow(length(color), uPower);"," acc += color * dotProduct * yWeight;"," div += dotProduct * yWeight;"," }"," }"," gl_FragColor = vec4(acc / div, 1.0);","}"].join("\n")},99191(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform float amount;","varying vec2 outTexCoord;","void main ()","{"," float pixelSize = floor(2.0 + amount);"," vec2 center = pixelSize * floor(outTexCoord * resolution / pixelSize) + pixelSize * vec2(0.5, 0.5);"," vec2 corner1 = center + pixelSize * vec2(-0.5, -0.5);"," vec2 corner2 = center + pixelSize * vec2(+0.5, -0.5);"," vec2 corner3 = center + pixelSize * vec2(+0.5, +0.5);"," vec2 corner4 = center + pixelSize * vec2(-0.5, +0.5);"," vec4 pixel = 0.4 * texture2D(uMainSampler, center / resolution);"," pixel += 0.15 * texture2D(uMainSampler, corner1 / resolution);"," pixel += 0.15 * texture2D(uMainSampler, corner2 / resolution);"," pixel += 0.15 * texture2D(uMainSampler, corner3 / resolution);"," pixel += 0.15 * texture2D(uMainSampler, corner4 / resolution);"," gl_FragColor = pixel;","}"].join("\n")},88430(t){t.exports=["#pragma phaserTemplate(shaderName)","precision highp float;","uniform sampler2D uMainSampler;","uniform vec4 uSteps;","uniform vec4 uGamma;","uniform vec4 uOffset;","uniform int uMode;","uniform bool uDither;","varying vec2 outTexCoord;","vec4 rgbaToHsva(vec4 rgba)","{"," float r = rgba.r;"," float g = rgba.g;"," float b = rgba.b;"," float a = rgba.a;"," float min = min(min(r, g), b);"," float max = max(max(r, g), b);"," float d = max - min;"," float h = 0.0;"," float s = (max == 0.0) ? 0.0 : d / max;"," float v = max;"," if (max != min)"," {"," if (max == r)"," {"," h = (g - b) / d + ((g < b) ? 6.0 : 0.0);"," }"," else if (max == g)"," {"," h = (b - r) / d + 2.0;"," }"," else"," {"," h = (r - g) / d + 4.0;"," }"," h /= 6.0;"," }"," return vec4(h, s, v, a);","}","float hsvaToRgbaConvert(float n, vec4 hsva)","{"," float k = mod(n + hsva.x * 6.0, 6.0);"," float min = min(min(k, 4.0 - k), 1.0);"," return hsva.z - hsva.z * hsva.y * max(0.0, min);","}","vec4 hsvaToRgba(vec4 hsva)","{"," return vec4("," hsvaToRgbaConvert(5.0, hsva),"," hsvaToRgbaConvert(3.0, hsva),"," hsvaToRgbaConvert(1.0, hsva),"," hsva.a"," );","}","vec4 ditherIGN(vec4 value)","{"," value += fract(52.9829189 * fract(0.06711056 * gl_FragCoord.x + 0.00583715 * gl_FragCoord.y)) - 0.5;"," return value;","}","void main ()","{"," vec4 sample = texture2D(uMainSampler, outTexCoord);"," if (uMode == 1)"," {"," sample = rgbaToHsva(sample);"," }"," sample = pow(sample, uGamma);"," sample -= uOffset;"," vec4 steps = max(uSteps - 1.0, 1.0);"," sample *= steps;"," if (uDither)"," {"," sample = ditherIGN(sample);"," }"," sample = ceil(sample - 0.5);"," sample /= steps;"," sample += uOffset;"," sample = pow(sample, 1.0 / uGamma);"," if (uMode == 1)"," {"," sample.x = mod(sample.x, 1.0);"," sample = hsvaToRgba(clamp(sample, 0.0, 1.0));"," }"," gl_FragColor = sample;","}"].join("\n")},69355(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","varying vec2 outTexCoord;","uniform vec2 lightPosition;","uniform vec4 color;","uniform float decay;","uniform float power;","uniform float intensity;","uniform int samples;","const int MAX = 12;","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec4 texture = boundedSampler(uMainSampler, outTexCoord);"," vec2 pc = (lightPosition - outTexCoord) * intensity;"," float shadow = 0.0;"," float limit = max(float(MAX), float(samples));"," for (int i = 0; i < MAX; ++i)"," {"," if (i >= samples)"," {"," break;"," }"," shadow += boundedSampler(uMainSampler, outTexCoord + float(i) * decay / limit * pc).a * power;"," }"," float mask = 1.0 - texture.a;"," gl_FragColor = mix(texture, color, clamp(shadow * mask, 0.0, 1.0));","}"].join("\n")},92636(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec4 edge1;","uniform vec4 edge2;","uniform vec4 invert;","varying vec2 outTexCoord;","void main ()","{"," vec4 color = texture2D(uMainSampler, outTexCoord);"," color = clamp((color - edge1) / (edge2 - edge1), 0.0, 1.0);"," color = mix(color, 1.0 - color, invert);"," gl_FragColor = color;","}"].join("\n")},18185(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform float uRadius;","uniform float uStrength;","uniform vec2 uPosition;","uniform vec4 uColor;","uniform int uBlendMode;","varying vec2 outTexCoord;","void main ()","{"," float vignette = 1.0;"," vec2 position = vec2(uPosition.x, 1.0 - uPosition.y);"," float d = length(outTexCoord - position);"," if (d <= uRadius)"," {"," float g = d / uRadius;"," vignette = sin(g * 3.14 * uStrength);"," }"," vec4 color = uColor;"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," if (uBlendMode == 1)"," {"," color.rgb = texture.rgb + color.rgb;"," }"," else if (uBlendMode == 2)"," {"," color.rgb = texture.rgb * color.rgb;"," }"," else if (uBlendMode == 3)"," {"," color.rgb = 1.0 - ((1.0 - texture.rgb) * (1.0 - color.rgb));"," }"," gl_FragColor = mix(texture, color, vignette);","}"].join("\n")},99174(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uMainSampler2;","uniform vec4 uProgress_WipeWidth_Direction_Axis;","uniform float uReveal;","varying vec2 outTexCoord;","void main ()","{"," vec4 color0;"," vec4 color1;"," if (uReveal == 0.0)"," {"," color0 = texture2D(uMainSampler, outTexCoord);"," color1 = texture2D(uMainSampler2, outTexCoord);"," }"," else"," {"," color0 = texture2D(uMainSampler2, outTexCoord);"," color1 = texture2D(uMainSampler, outTexCoord);"," }"," float distance = uProgress_WipeWidth_Direction_Axis.x;"," float width = uProgress_WipeWidth_Direction_Axis.y;"," float direction = uProgress_WipeWidth_Direction_Axis.z;"," float axis = outTexCoord.x;"," if (uProgress_WipeWidth_Direction_Axis.w == 1.0)"," {"," axis = outTexCoord.y;"," }"," float adjust = mix(width, -width, distance);"," float value = smoothstep(distance - width, distance + width, abs(direction - axis) + adjust);"," gl_FragColor = mix(color1, color0, value);","}"].join("\n")},73416(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(fragmentDefine)","uniform vec2 uResolution;","varying vec4 outTint;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec4 fragColor = outTint;"," #pragma phaserTemplate(fragmentProcess)"," gl_FragColor = fragColor;","}"].join("\n")},91627(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(vertexDefine)","uniform mat4 uProjectionMatrix;","uniform vec2 uResolution;","attribute vec2 inPosition;","attribute vec4 inTint;","varying vec4 outTint;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(vertexHeader)","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);"," outTint = vec4(inTint.bgr * inTint.a, inTint.a);"," #pragma phaserTemplate(vertexProcess)","}"].join("\n")},84220(t){t.exports=["vec3 getNormalFromMap (vec2 texCoord)","{"," vec3 normalMap = texture2D(uNormSampler, texCoord).rgb;"," return normalize(outInverseRotationMatrix * vec3(normalMap * 2.0 - 1.0));","}"].join("\n")},2860(t){t.exports=["uniform vec2 uMainResolution[TEXTURE_COUNT];","vec2 getTexRes ()","{"," #if TEXTURE_COUNT == 1"," float texId = 0.0;"," #else"," float texId = outTexDatum;"," #endif"," #pragma phaserTemplate(texIdProcess)"," vec2 texRes = vec2(0.0);"," for (int i = 0; i < TEXTURE_COUNT; i++)"," {"," if (texId == float(i))"," {"," texRes = uMainResolution[i];"," break;"," }"," }"," return texRes;","}"].join("\n")},46432(t){t.exports=["uniform sampler2D uMainSampler[TEXTURE_COUNT];","vec4 getTexture (vec2 texCoord)","{"," #if TEXTURE_COUNT == 1"," return texture2D(uMainSampler[0], texCoord);"," #else"," if (outTexDatum == 0.0) return texture2D(uMainSampler[0], texCoord);"," #define ELSE_TEX_CASE(INDEX) else if (outTexDatum == float(INDEX)) return texture2D(uMainSampler[INDEX], texCoord);"," #pragma phaserTemplate(texIdProcess)"," else return vec4(0.0, 0.0, 0.0, 0.0);"," #endif","}"].join("\n")},41509(t){t.exports=["#pragma phaserTemplate(shaderName)","precision highp float;","#pragma phaserTemplate(fragmentHeader)","#define PI 3.14159265358979323846","uniform int uRepeatMode;","uniform float uOffset;","uniform int uShapeMode;","uniform vec2 uShape;","uniform vec2 uStart;","varying vec2 outTexCoord;","float linear()","{"," float len = length(uShape);"," return dot(uShape, outTexCoord - uStart) / len / len;","}","float bilinear()","{"," return abs(linear());","}","float radial()","{"," return distance(uStart, outTexCoord) / length(uShape);","}","float conicSymmetric()","{"," return dot(normalize(uShape), normalize(outTexCoord - uStart)) * 0.5 + 0.5;","}","float conicAsymmetric()","{"," vec2 fromStart = outTexCoord - uStart;"," float angleFromStart = atan(fromStart.y, fromStart.x);"," float shapeAngle = atan(uShape.y, uShape.x);"," float angle = (angleFromStart - shapeAngle) / PI / 2.0;"," if (angle < 0.0) angle += 1.0;"," return angle;","}","float repeat(float value)","{"," if (uRepeatMode == 1)"," {"," if (value < 0.0 || value > 1.0)"," {"," discard;"," }"," return value;"," }"," else if (uRepeatMode == 2)"," {"," return mod(value, 1.0);"," }"," else if (uRepeatMode == 3)"," {"," return 1.0 - abs(1.0 - mod(value, 2.0));"," }"," return clamp(value, 0.0, 1.0);","}","void main()","{"," float progress = 0.0;"," if (uShapeMode == 0)"," {"," progress = linear();"," }"," else if (uShapeMode == 1)"," {"," progress = bilinear();"," }"," else if (uShapeMode == 2)"," {"," progress = radial();"," }"," else if (uShapeMode == 3)"," {"," progress = conicSymmetric();"," }"," else if (uShapeMode == 4)"," {"," progress = conicAsymmetric();"," }"," progress -= uOffset;"," progress = repeat(progress);"," vec4 bandCol = getRampAt(progress);"," bandCol.rgb *= bandCol.a;"," gl_FragColor = bandCol;","}"].join("\n")},98840(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(fragmentDefine)","uniform vec2 uResolution;","varying vec2 outTexCoord;","varying float outTexDatum;","varying float outTintEffect;","varying vec4 outTint;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," #pragma phaserTemplate(fragmentProcess)"," gl_FragColor = fragColor;","}"].join("\n")},44667(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(vertexDefine)","uniform mat4 uProjectionMatrix;","uniform vec2 uResolution;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","attribute float inTexDatum;","attribute float inTintEffect;","attribute vec4 inTint;","varying vec2 outTexCoord;","varying float outTexDatum;","varying float outTintEffect;","varying vec4 outTint;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(vertexHeader)","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);"," outTexCoord = inTexCoord;"," outTexDatum = inTexDatum;"," outTint = inTint;"," outTintEffect = inTintEffect;"," #pragma phaserTemplate(vertexProcess)","}"].join("\n")},16421(t){t.exports=["#version 100","#pragma phaserTemplate(shaderName)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform vec2 uOffset;","uniform vec4 uColorStart;","uniform vec4 uColorEnd;","uniform float uPower;","uniform int uMode;","varying vec2 outTexCoord;","float trig(vec2 p)","{"," return fract(43757.5453*sin(dot(p, vec2(12.9898,78.233))));","}","void main ()","{"," float value = pow(trig(outTexCoord + uOffset), uPower);"," if (uMode == 0)"," {"," vec4 color = mix(uColorStart, uColorEnd, value);"," color.rgb *= color.a;"," gl_FragColor = color;"," }"," else if (uMode == 1)"," {"," float valueR = pow(trig(outTexCoord + uOffset + 32.1), uPower);"," float valueG = pow(trig(outTexCoord + uOffset + 11.1), uPower);"," float valueB = pow(trig(outTexCoord + uOffset + 23.4), uPower);"," vec4 color = vec4(valueR, valueG, valueB, 1.);"," color *= mix(uColorStart, uColorEnd, value);"," color.rgb *= color.a;"," gl_FragColor = color;"," }"," else if (uMode == 2)"," {"," float valueAngle = pow(trig(outTexCoord + uOffset), uPower) * 3.141592;"," float x = value * cos(valueAngle);"," float y = value * sin(valueAngle);"," vec4 color = vec4("," x,"," y,"," sqrt(1. - x * x - y * y),"," 1.0"," );"," gl_FragColor = color * 0.5 + 0.5;"," }","}"].join("\n")},83587(t){t.exports=["#version 100","#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(fragmentIterations)","#pragma phaserTemplate(fragmentNormalMap)","#ifndef ITERATION_COUNT","#define ITERATION_COUNT 1.0","#endif","#ifndef WARP_ITERATION_COUNT","#define WARP_ITERATION_COUNT 1.0","#endif","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform vec2 uCells;","uniform vec2 uPeriod;","uniform vec2 uOffset;","uniform float uFlow;","uniform float uDetailPower;","uniform float uFlowPower;","uniform float uContributionPower;","uniform float uWarpDetailPower;","uniform float uWarpFlowPower;","uniform float uWarpContributionPower;","uniform float uWarpAmount;","uniform vec4 uColorStart;","uniform vec4 uColorEnd;","uniform float uNormalScale;","uniform float uValueFactor;","uniform float uValueAdd;","uniform float uValuePower;","uniform vec2 uSeed;","varying vec2 outTexCoord;","float psrdnoise(vec2 x, vec2 period, float alpha)","{"," vec2 uv = vec2(x.x+x.y*0.5, x.y);"," vec2 i0 = floor(uv), f0 = fract(uv);"," float cmp = step(f0.y, f0.x);"," vec2 o1 = vec2(cmp, 1.0-cmp);"," vec2 i1 = i0 + o1, i2 = i0 + 1.0;"," vec2 v0 = vec2(i0.x - i0.y*0.5, i0.y);"," vec2 v1 = vec2(v0.x + o1.x - o1.y*0.5, v0.y + o1.y);"," vec2 v2 = vec2(v0.x + 0.5, v0.y + 1.0);"," vec2 x0 = x - v0, x1 = x - v1, x2 = x - v2;"," vec3 iu, iv, xw, yw;"," if(any(greaterThan(period, vec2(0.0)))) {"," xw = vec3(v0.x, v1.x, v2.x); yw = vec3(v0.y, v1.y, v2.y);"," if(period.x > 0.0)"," xw = mod(vec3(v0.x, v1.x, v2.x), period.x);"," if(period.y > 0.0)"," yw = mod(vec3(v0.y, v1.y, v2.y), period.y);"," iu = floor(xw + 0.5*yw + 0.5); iv = floor(yw + 0.5);"," } else {"," iu = vec3(i0.x, i1.x, i2.x); iv = vec3(i0.y, i1.y, i2.y);"," }"," iu += uSeed.xxx; iv += uSeed.yyy;"," vec3 hash = mod(iu, 289.0);"," hash = mod((hash*51.0 + 2.0)*hash + iv, 289.0);"," hash = mod((hash*34.0 + 10.0)*hash, 289.0);"," vec3 psi = hash*0.07482 + alpha;"," vec3 gx = cos(psi); vec3 gy = sin(psi);"," vec2 g0 = vec2(gx.x, gy.x);"," vec2 g1 = vec2(gx.y, gy.y);"," vec2 g2 = vec2(gx.z, gy.z);"," vec3 w = 0.8 - vec3(dot(x0, x0), dot(x1, x1), dot(x2, x2));"," w = max(w, 0.0); vec3 w2 = w*w; vec3 w4 = w2*w2;"," vec3 gdotx = vec3(dot(g0, x0), dot(g1, x1), dot(g2, x2));"," float n = dot(w4, gdotx);"," return 10.9*n;","}","float iterate (vec2 coord, float detailPower, float flowPower, float contributionPower)","{"," float value = 0.;"," float itValue = 0.;"," for (float iteration = 0.; iteration < ITERATION_COUNT; iteration++)"," {"," float detailScale = pow(detailPower, iteration);"," float flowScale = pow(flowPower, iteration);"," itValue = psrdnoise((coord + iteration) * detailScale, uPeriod * detailScale, uFlow * flowScale + iteration);"," value += itValue / pow(contributionPower, iteration);"," }"," return value;","}","float iterateWarp (vec2 coord, float detailPower, float flowPower, float contributionPower)","{"," float value = 0.;"," float itValue = 0.;"," for (float iteration = 0.; iteration < WARP_ITERATION_COUNT; iteration++)"," {"," float detailScale = pow(detailPower, iteration);"," float flowScale = pow(flowPower, iteration);"," itValue = psrdnoise((coord + iteration) * detailScale, uPeriod * detailScale, uFlow * flowScale + iteration);"," value += itValue / pow(contributionPower, iteration);"," }"," return value;","}","vec2 warp (vec2 coord)","{"," vec2 o2 = vec2(11.3, 23.7);"," float coord1 = iterateWarp(coord, uWarpDetailPower, uWarpFlowPower, uWarpContributionPower);"," float coord2 = iterateWarp(coord + o2, uWarpDetailPower, uWarpFlowPower, uWarpContributionPower);"," return vec2(coord1, coord2);","}","void main ()","{"," vec2 coord = outTexCoord * uCells + uOffset;"," if (uWarpAmount > 0.)"," {"," coord += warp(coord) * uWarpAmount;"," }"," float value = iterate(coord, uDetailPower, uFlowPower, uContributionPower) * uValueFactor + uValueAdd;"," value = pow(clamp(value, 0., 1.), uValuePower);"," #ifndef NORMAL_MAP"," vec4 color = mix(uColorStart, uColorEnd, value);"," color.rgb *= color.a;"," gl_FragColor = color;"," #else"," float dx = dFdx(value) * uNormalScale;"," float dy = dFdy(value) * uNormalScale;"," vec3 normal = vec3(dx, dy, 1.0 - sqrt(dx * dx + dy * dy)) * 0.5 + 0.5;"," gl_FragColor = vec4(normal, 1.0);"," #endif","}"].join("\n")},13460(t){t.exports=["#version 100","#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(fragmentIterations)","#pragma phaserTemplate(fragmentNormalMap)","#ifndef ITERATION_COUNT","#define ITERATION_COUNT 1.0","#endif","#ifndef WARP_ITERATION_COUNT","#define WARP_ITERATION_COUNT 1.0","#endif","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform vec3 uCells;","uniform vec3 uPeriod;","uniform vec3 uOffset;","uniform float uFlow;","uniform float uDetailPower;","uniform float uFlowPower;","uniform float uContributionPower;","uniform float uWarpDetailPower;","uniform float uWarpFlowPower;","uniform float uWarpContributionPower;","uniform float uWarpAmount;","uniform vec4 uColorStart;","uniform vec4 uColorEnd;","uniform float uNormalScale;","uniform float uValueFactor;","uniform float uValueAdd;","uniform float uValuePower;","uniform vec3 uSeed;","varying vec2 outTexCoord;","vec4 permute(vec4 i) {"," vec4 im = mod(i, 289.0);"," return mod(((im * 34.0) + 10.0) * im, 289.0);","}","float psrdnoise(vec3 x, vec3 period, float alpha) {"," const mat3 M = mat3(0.0, 1.0, 1.0, 1.0, 0.0, 1.0, 1.0, 1.0, 0.0);"," const mat3 Mi = mat3(-0.5, 0.5, 0.5, 0.5, -0.5, 0.5, 0.5, 0.5, -0.5);"," vec3 uvw = M * x;"," vec3 i0 = floor(uvw);"," vec3 f0 = fract(uvw);"," vec3 g_ = step(f0.xyx, f0.yzz);"," vec3 l_ = 1.0 - g_;"," vec3 g = vec3(l_.z, g_.xy);"," vec3 l = vec3(l_.xy, g_.z);"," vec3 o1 = min(g, l);"," vec3 o2 = max(g, l);"," vec3 i1 = i0 + o1, i2 = i0 + o2, i3 = i0 + 1.0;"," vec3 v0 = Mi * i0, v1 = Mi * i1, v2 = Mi * i2, v3 = Mi * i3;"," vec3 x0 = x - v0, x1 = x - v1, x2 = x - v2, x3 = x - v3;"," if(any(greaterThan(period, vec3(0.0)))) {"," vec4 vx = vec4(v0.x, v1.x, v2.x, v3.x);"," vec4 vy = vec4(v0.y, v1.y, v2.y, v3.y);"," vec4 vz = vec4(v0.z, v1.z, v2.z, v3.z);"," if(period.x > 0.0)"," vx = mod(vx, period.x);"," if(period.y > 0.0)"," vy = mod(vy, period.y);"," if(period.z > 0.0)"," vz = mod(vz, period.z);"," i0 = floor(M * vec3(vx.x, vy.x, vz.x) + 0.5);"," i1 = floor(M * vec3(vx.y, vy.y, vz.y) + 0.5);"," i2 = floor(M * vec3(vx.z, vy.z, vz.z) + 0.5);"," i3 = floor(M * vec3(vx.w, vy.w, vz.w) + 0.5);"," }"," i0 += uSeed; i1 += uSeed; i2 += uSeed; i3 += uSeed;"," vec4 hash = permute(permute(permute(vec4(i0.z, i1.z, i2.z, i3.z)) + vec4(i0.y, i1.y, i2.y, i3.y)) + vec4(i0.x, i1.x, i2.x, i3.x));"," vec4 theta = hash * 3.883222077;"," vec4 sz = 0.996539792 - 0.006920415 * hash;"," vec4 psi = hash * 0.108705628;"," vec4 Ct = cos(theta);"," vec4 St = sin(theta);"," vec4 sz_prime = sqrt(1.0 - sz * sz);"," vec4 gx, gy, gz;"," if(alpha != 0.0) {"," vec4 px = Ct * sz_prime;"," vec4 py = St * sz_prime;"," vec4 pz = sz;"," vec4 Sp = sin(psi);"," vec4 Cp = cos(psi);"," vec4 Ctp = St * Sp - Ct * Cp;"," vec4 qx = mix(Ctp * St, Sp, sz);"," vec4 qy = mix(-Ctp * Ct, Cp, sz);"," vec4 qz = -(py * Cp + px * Sp);"," vec4 Sa = vec4(sin(alpha));"," vec4 Ca = vec4(cos(alpha));"," gx = Ca * px + Sa * qx;"," gy = Ca * py + Sa * qy;"," gz = Ca * pz + Sa * qz;"," } else {"," gx = Ct * sz_prime;"," gy = St * sz_prime;"," gz = sz;"," }"," vec3 g0 = vec3(gx.x, gy.x, gz.x), g1 = vec3(gx.y, gy.y, gz.y);"," vec3 g2 = vec3(gx.z, gy.z, gz.z), g3 = vec3(gx.w, gy.w, gz.w);"," vec4 w = 0.5 - vec4(dot(x0, x0), dot(x1, x1), dot(x2, x2), dot(x3, x3));"," w = max(w, 0.0);"," vec4 w2 = w * w;"," vec4 w3 = w2 * w;"," vec4 gdotx = vec4(dot(g0, x0), dot(g1, x1), dot(g2, x2), dot(g3, x3));"," float n = dot(w3, gdotx);"," return 39.5 * n;","}","float iterate (vec3 coord, float detailPower, float flowPower, float contributionPower)","{"," float value = 0.;"," float itValue = 0.;"," for (float iteration = 0.; iteration < ITERATION_COUNT; iteration++)"," {"," float detailScale = pow(detailPower, iteration);"," float flowScale = pow(flowPower, iteration);"," itValue = psrdnoise((coord + iteration) * detailScale, uPeriod * detailScale, uFlow * flowScale + iteration);"," value += itValue / pow(contributionPower, iteration);"," }"," return value;","}","float iterateWarp (vec3 coord, float detailPower, float flowPower, float contributionPower)","{"," float value = 0.;"," float itValue = 0.;"," for (float iteration = 0.; iteration < WARP_ITERATION_COUNT; iteration++)"," {"," float detailScale = pow(detailPower, iteration);"," float flowScale = pow(flowPower, iteration);"," itValue = psrdnoise((coord + iteration) * detailScale, uPeriod * detailScale, uFlow * flowScale + iteration);"," value += itValue / pow(contributionPower, iteration);"," }"," return value;","}","vec3 warp (vec3 coord)","{"," vec3 o2 = vec3(11.3, 23.7, 13.1);"," vec3 o3 = vec3(29.9, 2.3, 31.7);"," float coord1 = iterateWarp(coord, uWarpDetailPower, uWarpFlowPower, uWarpContributionPower);"," float coord2 = iterateWarp(coord + o2, uWarpDetailPower, uWarpFlowPower, uWarpContributionPower);"," float coord3 = iterateWarp(coord + o3, uWarpDetailPower, uWarpFlowPower, uWarpContributionPower);"," return vec3(coord1, coord2, coord3);","}","void main ()","{"," vec3 coord = (vec3(outTexCoord, 0.0) * uCells) + uOffset;"," if (uWarpAmount > 0.)"," {"," coord += warp(coord) * uWarpAmount;"," }"," float value = iterate(coord, uDetailPower, uFlowPower, uContributionPower) * uValueFactor + uValueAdd;"," value = pow(clamp(value, 0., 1.), uValuePower);"," #ifndef NORMAL_MAP"," vec4 color = mix(uColorStart, uColorEnd, value);"," color.rgb *= color.a;"," gl_FragColor = color;"," #else"," float dx = dFdx(value) * uNormalScale;"," float dy = dFdy(value) * uNormalScale;"," vec3 normal = vec3(dx, dy, 1.0 - sqrt(dx * dx + dy * dy)) * 0.5 + 0.5;"," gl_FragColor = vec4(normal, 1.0);"," #endif","}"].join("\n")},17205(t){t.exports=["#version 100","#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(fragmentMode)","#pragma phaserTemplate(fragmentIterations)","#pragma phaserTemplate(fragmentNormalMap)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform vec2 uSeedX;","uniform vec2 uSeedY;","uniform vec2 uCells;","uniform vec2 uCellOffset;","uniform vec2 uVariation;","uniform vec2 uWrap;","uniform float uSmoothing;","uniform float uNormalScale;","uniform vec4 uColorStart;","uniform vec4 uColorEnd;","varying vec2 outTexCoord;","float trig(vec2 p)","{"," return fract(43757.5453*sin(dot(p, vec2(12.9898,78.233))));","}","vec2 bigCoord (vec2 coord, float scale)","{"," return (coord + uCellOffset) * scale * uCells;","}","vec2 hash2D (vec2 coord)","{"," return vec2("," trig(coord + uSeedX),"," trig(coord + uSeedY)"," ) * uVariation;","}","float worley2D (vec2 uv, float scale)","{"," vec2 coord = bigCoord(uv, scale);"," vec2 point = floor(coord);"," vec2 frac = fract(coord);"," float dist = 12.0;"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec2 cellNeighbor = vec2(i, j);"," vec2 jitter = hash2D(mod(point + cellNeighbor, uWrap * scale));"," vec2 diff = cellNeighbor - frac + jitter;"," float d = dot(diff, diff); // Squared length of diff."," if (d < dist)"," {"," dist = d;"," }"," }"," return sqrt(dist);","}","float worley2DIndex (vec2 uv, float scale)","{"," vec2 coord = bigCoord(uv, scale);"," vec2 point = floor(coord);"," vec2 frac = fract(coord);"," float dist = 12.0;"," float random = 0.0;"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec2 cellNeighbor = vec2(i, j);"," vec2 jitter = hash2D(mod(point + cellNeighbor, uWrap * scale));"," vec2 diff = cellNeighbor - frac + jitter;"," float d = dot(diff, diff); // Squared length of diff."," if (d < dist)"," {"," dist = d;"," random = jitter.x;"," }"," }"," return random;","}","float worley2DSmooth (vec2 uv, float scale)","{"," vec2 coord = bigCoord(uv, scale);"," vec2 point = floor(coord);"," vec2 frac = fract(coord);"," float value = 0.0;"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec2 cellNeighbor = vec2(i, j);"," vec2 jitter = hash2D(mod(point + cellNeighbor, uWrap * scale));"," vec2 diff = cellNeighbor - frac + jitter;"," float d = length(diff);"," value += exp2(-32.0 / uSmoothing * d); // Accumulate fast-decaying exponential of length."," }"," return -(1.0 / 32.0 * uSmoothing) * log2(value);","}","float iterateWorley2D (vec2 uv)","{"," float value = 0.0;"," float itValue = 0.0;"," for (float iteration = 0.0; iteration < ITERATION_COUNT; iteration++)"," {"," float scale = exp2(iteration);"," #ifdef MODE_DISTANCE"," itValue = worley2D(uv + iteration, scale);"," #endif"," #ifdef MODE_INDEX"," itValue = worley2DIndex(uv + iteration, scale);"," #endif"," #ifdef MODE_DISTANCE_SMOOTH"," itValue = worley2DSmooth(uv + iteration, scale);"," #endif"," value += (itValue - 0.5) / scale;"," }"," return value + 0.5;","}","void main ()","{"," float value = iterateWorley2D(outTexCoord);"," #ifndef NORMAL_MAP"," vec4 color = mix(uColorStart, uColorEnd, value);"," color.rgb *= color.a;"," gl_FragColor = color;"," #else"," float dx = dFdx(value) * uNormalScale;"," float dy = dFdy(value) * uNormalScale;"," vec3 normal = vec3(dx, dy, 1.0 - sqrt(dx * dx + dy * dy)) * 0.5 + 0.5;"," gl_FragColor = vec4(normal, 1.0);"," #endif","}"].join("\n")},79814(t){t.exports=["#version 100","#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(fragmentMode)","#pragma phaserTemplate(fragmentIterations)","#pragma phaserTemplate(fragmentNormalMap)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform vec3 uSeedX;","uniform vec3 uSeedY;","uniform vec3 uSeedZ;","uniform vec3 uCells;","uniform vec3 uCellOffset;","uniform vec3 uVariation;","uniform vec3 uWrap;","uniform float uSmoothing;","uniform float uNormalScale;","uniform vec4 uColorStart;","uniform vec4 uColorEnd;","varying vec2 outTexCoord;","float trig(vec3 p)","{"," return fract(43757.5453*sin(dot(p, vec3(12.9898,78.233, 9441.8953))));","}","vec3 bigCoord (vec3 coord, float scale)","{"," return (coord + uCellOffset) * scale * uCells;","}","vec3 hash3D (vec3 coord)","{"," return vec3("," trig(coord + uSeedX),"," trig(coord + uSeedY),"," trig(coord + uSeedZ)"," ) * uVariation;","}","float worley3D (vec3 uv, float scale)","{"," vec3 coord = bigCoord(uv, scale);"," vec3 point = floor(coord);"," vec3 frac = fract(coord);"," float dist = 12.0;"," for (float k = -1.0; k <= 1.0; k++)"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec3 cellNeighbor = vec3(i, j, k);"," vec3 jitter = hash3D(mod(point + cellNeighbor, uWrap * scale));"," vec3 diff = cellNeighbor - frac + jitter;"," float d = dot(diff, diff); // Squared length of diff."," if (d < dist)"," {"," dist = d;"," }"," }"," return sqrt(dist);","}","float worley3DIndex (vec3 uv, float scale)","{"," vec3 coord = bigCoord(uv, scale);"," vec3 point = floor(coord);"," vec3 frac = fract(coord);"," float dist = 12.0;"," float random = 0.0;"," for (float k = -1.0; k <= 1.0; k++)"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec3 cellNeighbor = vec3(i, j, k);"," vec3 jitter = hash3D(mod(point + cellNeighbor, uWrap * scale));"," vec3 diff = cellNeighbor - frac + jitter;"," float d = dot(diff, diff); // Squared length of diff."," if (d < dist)"," {"," dist = d;"," random = jitter.x;"," }"," }"," return random;","}","float worley3DSmooth (vec3 uv, float scale)","{"," vec3 coord = bigCoord(uv, scale);"," vec3 point = floor(coord);"," vec3 frac = fract(coord);"," float value = 0.0;"," for (float k = -1.0; k <= 1.0; k++)"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec3 cellNeighbor = vec3(i, j, k);"," vec3 jitter = hash3D(mod(point + cellNeighbor, uWrap * scale));"," vec3 diff = cellNeighbor - frac + jitter;"," float d = length(diff);"," value += exp2(-32.0 / uSmoothing * d); // Accumulate fast-decaying exponential of length."," }"," return -(1.0 / 32.0 * uSmoothing) * log2(value);","}","float iterateWorley3D (vec3 uv)","{"," float value = 0.0;"," float itValue = 0.0;"," for (float iteration = 0.0; iteration < ITERATION_COUNT; iteration++)"," {"," float scale = exp2(iteration);"," #ifdef MODE_DISTANCE"," itValue = worley3D(uv + iteration, scale);"," #endif"," #ifdef MODE_INDEX"," itValue = worley3DIndex(uv + iteration, scale);"," #endif"," #ifdef MODE_DISTANCE_SMOOTH"," itValue = worley3DSmooth(uv + iteration, scale);"," #endif"," value += (itValue - 0.5) / scale;"," }"," return value + 0.5;","}","void main ()","{"," vec3 uv = vec3(outTexCoord, 0.0);"," float value = iterateWorley3D(uv);"," #ifndef NORMAL_MAP"," vec4 color = mix(uColorStart, uColorEnd, value);"," color.rgb *= color.a;"," gl_FragColor = color;"," #else"," float dx = dFdx(value) * uNormalScale;"," float dy = dFdy(value) * uNormalScale;"," vec3 normal = vec3(dx, dy, 1.0 - sqrt(dx * dx + dy * dy)) * 0.5 + 0.5;"," gl_FragColor = vec4(normal, 1.0);"," #endif","}"].join("\n")},99595(t){t.exports=["#version 100","#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(fragmentMode)","#pragma phaserTemplate(fragmentIterations)","#pragma phaserTemplate(fragmentNormalMap)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform vec4 uSeedX;","uniform vec4 uSeedY;","uniform vec4 uSeedZ;","uniform vec4 uSeedW;","uniform vec4 uCells;","uniform vec4 uCellOffset;","uniform vec4 uVariation;","uniform vec4 uWrap;","uniform float uSmoothing;","uniform float uNormalScale;","uniform vec4 uColorStart;","uniform vec4 uColorEnd;","varying vec2 outTexCoord;","float trig(vec4 p)","{"," return fract(43757.5453*sin(dot(p, vec4(12.9898,78.233,9441.8953,61.99))));","}","vec4 bigCoord (vec4 coord, float scale)","{"," return (coord + uCellOffset) * scale * uCells;","}","vec4 hash4D (vec4 coord)","{"," return vec4("," trig(coord + uSeedX),"," trig(coord + uSeedY),"," trig(coord + uSeedZ),"," trig(coord + uSeedW)"," ) * uVariation;","}","float worley4D (vec4 uv, float scale)","{"," vec4 coord = bigCoord(uv, scale);"," vec4 point = floor(coord);"," vec4 frac = fract(coord);"," float dist = 16.0;"," for (float l = -1.0; l <= 1.0; l++)"," for (float k = -1.0; k <= 1.0; k++)"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec4 cellNeighbor = vec4(i, j, k, l);"," vec4 jitter = hash4D(mod(point + cellNeighbor, uWrap * scale));"," vec4 diff = cellNeighbor - frac + jitter;"," float d = dot(diff, diff); // Squared length of diff."," if (d < dist)"," {"," dist = d;"," }"," }"," return sqrt(dist);","}","float worley4DIndex (vec4 uv, float scale)","{"," vec4 coord = bigCoord(uv, scale);"," vec4 point = floor(coord);"," vec4 frac = fract(coord);"," float dist = 16.0;"," float random = 0.0;"," for (float l = -1.0; l <= 1.0; l++)"," for (float k = -1.0; k <= 1.0; k++)"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec4 cellNeighbor = vec4(i, j, k, l);"," vec4 jitter = hash4D(mod(point + cellNeighbor, uWrap * scale));"," vec4 diff = cellNeighbor - frac + jitter;"," float d = dot(diff, diff); // Squared length of diff."," if (d < dist)"," {"," dist = d;"," random = jitter.x;"," }"," }"," return random;","}","float worley4DSmooth (vec4 uv, float scale)","{"," vec4 coord = bigCoord(uv, scale);"," vec4 point = floor(coord);"," vec4 frac = fract(coord);"," float value = 0.0;"," for (float l = -1.0; l <= 1.0; l++)"," for (float k = -1.0; k <= 1.0; k++)"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec4 cellNeighbor = vec4(i, j, k, l);"," vec4 jitter = hash4D(mod(point + cellNeighbor, uWrap * scale));"," vec4 diff = cellNeighbor - frac + jitter;"," float d = length(diff);"," value += exp2(-32.0 / uSmoothing * d); // Accumulate fast-decaying exponential of length."," }"," return -(1.0 / 32.0 * uSmoothing) * log2(value);","}","float iterateWorley4D (vec4 uv)","{"," float value = 0.0;"," float itValue = 0.0;"," for (float iteration = 0.0; iteration < ITERATION_COUNT; iteration++)"," {"," float scale = exp2(iteration);"," #ifdef MODE_DISTANCE"," itValue = worley4D(uv + iteration, scale);"," #endif"," #ifdef MODE_INDEX"," itValue = worley4DIndex(uv + iteration, scale);"," #endif"," #ifdef MODE_DISTANCE_SMOOTH"," itValue = worley4DSmooth(uv + iteration, scale);"," #endif"," value += (itValue - 0.5) / scale;"," }"," return value + 0.5;","}","void main ()","{"," vec4 uv = vec4(outTexCoord, 0.0, 0.0);"," float value = iterateWorley4D(uv);"," #ifndef NORMAL_MAP"," vec4 color = mix(uColorStart, uColorEnd, value);"," color.rgb *= color.a;"," gl_FragColor = color;"," #else"," float dx = dFdx(value) * uNormalScale;"," float dy = dFdy(value) * uNormalScale;"," vec3 normal = vec3(dx, dy, 1.0 - sqrt(dx * dx + dy * dy)) * 0.5 + 0.5;"," gl_FragColor = vec4(normal, 1.0);"," #endif","}"].join("\n")},62807(t){t.exports=["float inverseRotation = -rotation - uCamera.z;","float irSine = sin(inverseRotation);","float irCosine = cos(inverseRotation);","outInverseRotationMatrix = mat3("," irCosine, irSine, 0.0,"," -irSine, irCosine, 0.0,"," 0.0, 0.0, 1.0",");"].join("\n")},4127(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","precision mediump float;","#pragma phaserTemplate(fragmentDefine)","uniform vec2 uResolution;","uniform float uCameraZoom;","varying vec4 lightPosition;","varying vec4 lightColor;","varying float lightRadius;","varying float lightAttenuation;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec2 center = (lightPosition.xy + 1.0) * (uResolution.xy * 0.5);"," float distToSurf = length(center - gl_FragCoord.xy);"," float radius = 1.0 - distToSurf / (lightRadius * uCameraZoom);"," float intensity = smoothstep(0.0, 1.0, radius * lightAttenuation);"," vec4 color = vec4(intensity, intensity, intensity, 0.0) * lightColor;"," #pragma phaserTemplate(fragmentProcess)"," gl_FragColor = vec4(color.rgb * lightColor.a, color.a);","}"].join("\n")},89924(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","precision mediump float;","#pragma phaserTemplate(vertexDefine)","uniform mat4 uProjectionMatrix;","attribute vec2 inPosition;","attribute vec2 inLightPosition;","attribute vec4 inLightColor;","attribute float inLightRadius;","attribute float inLightAttenuation;","varying vec4 lightPosition;","varying vec4 lightColor;","varying float lightRadius;","varying float lightAttenuation;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(vertexHeader)","void main ()","{"," lightColor = inLightColor;"," lightRadius = inLightRadius;"," lightAttenuation = inLightAttenuation;"," lightPosition = uProjectionMatrix * vec4(inLightPosition, 1.0, 1.0);"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);"," #pragma phaserTemplate(vertexProcess)","}"].join("\n")},68589(t){t.exports=["#extension GL_OES_standard_derivatives : enable","#define BAND_TREE_DEPTH 0.0","uniform sampler2D uRampTexture;","uniform vec2 uRampResolution;","uniform float uRampBandStart;","uniform bool uDither;","float decodeNumberSample(vec4 sample)","{"," return ("," sample.r * 255.0 +"," sample.g * 255.0 * 256.0 +"," sample.b * 255.0 * 256.0 * 256.0 +"," sample.a * 255.0 * 256.0 * 256.0 * 256.0"," ) / 256.0 / 256.0;","}","struct Band","{"," vec4 colorStart;"," vec4 colorEnd;"," float start;"," float end;"," int colorSpace;"," int interpolation;"," float middle;","};","Band getBand(float progress)","{"," vec2 rampStep = 1.0 / uRampResolution;"," vec2 c = rampStep / 2.0;"," float start = decodeNumberSample(texture2D(uRampTexture, c));"," float end = decodeNumberSample(texture2D(uRampTexture, vec2(1.0, 0.0) * rampStep + c));"," float TREE_OFFSET = 2.0; // Beginning of tree block."," float index = 0.0;"," float x, y;"," for (float i = 0.0; i < BAND_TREE_DEPTH; i++)"," {"," x = mod(index + TREE_OFFSET, uRampResolution.x);"," y = floor(x / uRampResolution.x);"," float pivot = decodeNumberSample(texture2D(uRampTexture, vec2(x, y) * rampStep + c));"," if (progress > pivot)"," {"," start = pivot;"," index = index * 2.0 + 2.0;"," }"," else"," {"," end = pivot;"," index = index * 2.0 + 1.0;"," }"," }"," float bandNumber = index - uRampBandStart + TREE_OFFSET;"," float bandIndex = bandNumber * 3.0 + uRampBandStart;"," x = mod(bandIndex, uRampResolution.x);"," y = floor(bandIndex / uRampResolution.x);"," vec4 colorStart = texture2D(uRampTexture, vec2(x, y) * rampStep + c);"," x = mod(bandIndex + 1.0, uRampResolution.x);"," y = floor(bandIndex / uRampResolution.x);"," vec4 colorEnd = texture2D(uRampTexture, vec2(x, y) * rampStep + c);"," x = mod(bandIndex + 2.0, uRampResolution.x);"," y = floor(bandIndex / uRampResolution.x);"," float bandData = decodeNumberSample(texture2D(uRampTexture, vec2(x, y) * rampStep + c));"," int colorSpace = int(floor(bandData / 255.0));"," int interpolation = int(floor(bandData)) - colorSpace * 255;"," return Band(colorStart, colorEnd, start, end, colorSpace, interpolation, fract(bandData) * 2.0);","}","float interpolate(float progress, int mode)","{"," if (mode == 1)"," {"," if ((progress *= 2.0) < 1.0)"," {"," return 0.5 * sqrt(1.0 - (--progress * progress));"," }"," progress = 1.0 - progress;"," return 1.0 - 0.5 * sqrt(1.0 - progress * progress);"," }"," if (mode == 2)"," {"," return sin((progress - 0.5) * 3.14159265358979323846) * 0.5 + 0.5;"," }"," if (mode == 3)"," {"," return sqrt(1.0 - (--progress * progress));"," }"," if (mode == 4)"," {"," return 1.0 - sqrt(1.0 - progress * progress);"," }"," return progress;","}","float ditherIGN(float value)","{"," float dx = dFdx(value);"," float dy = dFdy(value);"," float rateOfChange = sqrt(dx * dx + dy * dy);"," value += (fract(52.9829189 * fract(0.06711056 * gl_FragCoord.x + 0.00583715 * gl_FragCoord.y)) - 0.5) * rateOfChange;"," return value;","}","vec4 rgbaToHsva(vec4 rgba)","{"," float r = rgba.r;"," float g = rgba.g;"," float b = rgba.b;"," float a = rgba.a;"," float min = min(min(r, g), b);"," float max = max(max(r, g), b);"," float d = max - min;"," float h = 0.0;"," float s = (max == 0.0) ? 0.0 : d / max;"," float v = max;"," if (max != min)"," {"," if (max == r)"," {"," h = (g - b) / d + ((g < b) ? 6.0 : 0.0);"," }"," else if (max == g)"," {"," h = (b - r) / d + 2.0;"," }"," else"," {"," h = (r - g) / d + 4.0;"," }"," h /= 6.0;"," }"," return vec4(h, s, v, a);","}","float hsvaToRgbaConvert(float n, vec4 hsva)","{"," float k = mod(n + hsva.x * 6.0, 6.0);"," float min = min(min(k, 4.0 - k), 1.0);"," return hsva.z - hsva.z * hsva.y * max(0.0, min);","}","vec4 hsvaToRgba(vec4 hsva)","{"," return vec4("," hsvaToRgbaConvert(5.0, hsva),"," hsvaToRgbaConvert(3.0, hsva),"," hsvaToRgbaConvert(1.0, hsva),"," hsva.a"," );","}","vec4 mixBandColor(float progress, Band band)","{"," if (band.colorSpace == 0)"," {"," return mix(band.colorStart, band.colorEnd, progress);"," }"," vec4 hsvaStart = rgbaToHsva(band.colorStart);"," vec4 hsvaEnd = rgbaToHsva(band.colorEnd);"," if (band.colorSpace == 1)"," {"," float dH = hsvaStart.x - hsvaEnd.x;"," if (dH > 0.5)"," {"," hsvaStart.x -= 1.0;"," }"," else if (dH < -0.5)"," {"," hsvaStart.x += 1.0;"," }"," }"," else if (band.colorSpace == 2)"," {"," if (hsvaStart.x > hsvaEnd.x)"," {"," hsvaStart.x -= 1.0;"," }"," }"," else if (band.colorSpace == 3)"," {"," if (hsvaStart.x < hsvaEnd.x)"," {"," hsvaStart.x += 1.0;"," }"," }"," vec4 hsvaMix = mix(hsvaStart, hsvaEnd, progress);"," hsvaMix.x = mod(hsvaMix.x, 1.0);"," return hsvaToRgba(hsvaMix);","}","vec4 getRampAt(float progress)","{"," Band band = getBand(progress);"," float bandProgress = (progress - band.start) / (band.end - band.start);"," float gamma = log(0.5) / log(band.middle);"," bandProgress = pow(bandProgress, gamma);"," bandProgress = interpolate(bandProgress, band.interpolation);"," if (uDither)"," {"," bandProgress = ditherIGN(bandProgress);"," }"," return mixBandColor(bandProgress, band);","}"].join("\n")},72823(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(fragmentDefine)","varying vec2 outTexCoord;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec4 fragColor = vec4(outTexCoord.xyx, 1.0);"," #pragma phaserTemplate(fragmentProcess)"," gl_FragColor = fragColor;","}"].join("\n")},65884(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(vertexDefine)","uniform mat4 uProjectionMatrix;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","varying vec2 outTexCoord;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(vertexHeader)","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);"," outTexCoord = inTexCoord;"," #pragma phaserTemplate(vertexProcess)","}"].join("\n")},2807(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","varying vec2 outFragCoord;","varying vec2 outTexCoord;","void main ()","{"," outFragCoord = inPosition.xy * 0.5 + 0.5;"," outTexCoord = inTexCoord;"," gl_Position = vec4(inPosition, 0, 1);","}"].join("\n")},49119(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(fragmentDefine)","uniform vec2 uResolution;","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," #pragma phaserTemplate(fragmentProcess)"," gl_FragColor = fragColor;","}"].join("\n")},3524(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#define ROUND_BIAS 0.5001","#pragma phaserTemplate(vertexDefine)","uniform mat4 uProjectionMatrix;","uniform mat3 uViewMatrix;","uniform vec3 uCameraScrollAndAlpha;","uniform int uRoundPixels;","uniform vec2 uResolution;","uniform float uTime;","uniform vec2 uDiffuseResolution;","uniform vec2 uFrameDataResolution;","uniform sampler2D uFrameDataTexture;","uniform float uGravity;","attribute float inVertex;","attribute vec4 inPositionX;","attribute vec4 inPositionY;","attribute vec4 inRotation;","attribute vec4 inScaleX;","attribute vec4 inScaleY;","attribute vec4 inAlpha;","attribute vec4 inFrame;","attribute vec4 inTintBlend;","attribute vec4 inTintTL;","attribute vec4 inTintTR;","attribute vec4 inTintBL;","attribute vec4 inTintBR;","attribute vec4 inOriginAndTintModeAndCreationTime;","attribute vec2 inScrollFactor;","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(vertexHeader)","const float PI = 3.14159265359;","const float HALF_PI = PI / 2.0;","const float BOUNCE_OVERSHOOT = 1.70158;","const float BOUNCE_OVERSHOOT_PLUS = BOUNCE_OVERSHOOT + 1.0;","const float BOUNCE_OVERSHOOT_IN_OUT = BOUNCE_OVERSHOOT * 1.525;","const float BOUNCE_OVERSHOOT_IN_OUT_PLUS = BOUNCE_OVERSHOOT_IN_OUT + 1.0;","float animate (vec4 anim)","{"," float value = anim.x;"," float a = anim.y;"," float b = abs(anim.z);"," float c = abs(anim.w);"," bool yoyo = anim.z < 0.0;"," bool loop = anim.w > 0.0;"," int type = int(floor(c));"," if (type == 0|| b == 0.0)"," {"," return value;"," }"," float duration = b;"," float delay = mod(c, 1.0) * 2.0;"," float rawTime = ((uTime - inOriginAndTintModeAndCreationTime.w) / duration) - delay;"," float time = mod(rawTime, 1.0);"," if (yoyo && (mod(rawTime, 2.0) >= 1.0))"," {"," time = 1.0 - time;"," }"," float repeats = loop ? 0.0 : floor(a);"," float timeContinuous = loop ? time : rawTime;"," #ifdef FEATURE_LINEAR"," if (type == 1)"," {"," return value + a * timeContinuous;"," }"," #endif"," #ifdef FEATURE_GRAVITY"," if (type == 2)"," {"," float v = floor(a);"," float gravityFactor = (a - v) * 2.0 - 1.0;"," if (gravityFactor == 0.0)"," {"," gravityFactor = 1.0;"," }"," float seconds = timeContinuous * duration / 1000.0;"," float accel = uGravity * gravityFactor;"," return value + (v * seconds) + (0.5 * accel * seconds * seconds);"," }"," #endif"," #ifdef FEATURE_QUAD_EASEOUT"," if (type == 10)"," {"," return value + a * time * (2.0 - time)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUAD_EASEIN"," if (type == 11)"," {"," return value + a * time * time"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUAD_EASEINOUT"," if (type == 12)"," {"," time *= 2.0;"," if (time < 1.0)"," {"," return value + a * time * time * 0.5"," + repeats * a;"," }"," time -= 1.0;"," return value + a * -0.5 * (time * (time - 2.0) - 1.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_CUBIC_EASEOUT"," if (type == 20)"," {"," time -= 1.0;"," return value + a * (time * time * time + 1.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_CUBIC_EASEIN"," if (type == 21)"," {"," return value + a * time * time * time"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_CUBIC_EASEINOUT"," if (type == 22)"," {"," time *= 2.0;"," if (time < 1.0)"," {"," return value + a * time * time * time * 0.5"," + repeats * a;"," }"," time -= 2.0;"," return value + a * 0.5 * (time * time * time + 2.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUART_EASEOUT"," if (type == 30)"," {"," time -= 1.0;"," return value + a * (1.0 - time * time * time * time)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUART_EASEIN"," if (type == 31)"," {"," return value + a * time * time * time * time"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUART_EASEINOUT"," if (type == 32)"," {"," time *= 2.0;"," if (time < 1.0)"," {"," return value + a * time * time * time * time * 0.5"," + repeats * a;"," }"," time -= 2.0;"," return value + a * -0.5 * (time * time * time * time - 2.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUINT_EASEOUT"," if (type == 40)"," {"," time -= 1.0;"," return value + a * (time * time * time * time * time + 1.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUINT_EASEIN"," if (type == 41)"," {"," return value + a * time * time * time * time * time"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUINT_EASEINOUT"," if (type == 42)"," {"," time *= 2.0;"," if (time < 1.0)"," {"," return value + a * time * time * time * time * time * 0.5"," + repeats * a;"," }"," time -= 2.0;"," return value + a * 0.5 * (time * time * time * time * time + 2.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_SINE_EASEOUT"," if (type == 50)"," {"," return value + a * sin(time * HALF_PI)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_SINE_EASEIN"," if (type == 51)"," {"," return value + a * (1.0 - cos(time * HALF_PI))"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_SINE_EASEINOUT"," if (type == 52)"," {"," return value + a * 0.5 * (1.0 - cos(PI * time))"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_EXPO_EASEOUT"," if (type == 60)"," {"," return value + a * (1.0 - pow(2.0, -10.0 * time))"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_EXPO_EASEIN"," if (type == 61)"," {"," return value + a * pow(2.0, 10.0 * (time - 1.0) - 0.001)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_EXPO_EASEINOUT"," if (type == 62)"," {"," time *= 2.0;"," if (time < 1.0)"," {"," return value + a * 0.5 * pow(2.0, 10.0 * (time - 1.0))"," + repeats * a;"," }"," time -= 1.0;"," return value + a * 0.5 * (2.0 - pow(2.0, -10.0 * (time - 1.0)))"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_CIRC_EASEOUT"," if (type == 70)"," {"," time -= 1.0;"," return value + a * sqrt(1.0 - time * time)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_CIRC_EASEIN"," if (type == 71)"," {"," return value + a * (1.0 - sqrt(1.0 - time * time))"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_CIRC_EASEINOUT"," if (type == 72)"," {"," time *= 2.0;"," if (time < 1.0)"," {"," return value + a * -0.5 * (sqrt(1.0 - time * time) - 1.0)"," + repeats * a;"," }"," time -= 2.0;"," return value + a * 0.5 * (sqrt(1.0 - time * time) + 1.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_BACK_EASEOUT"," if (type == 90)"," {"," time -= 1.0;"," return value + a * (time * time * (BOUNCE_OVERSHOOT_PLUS * time + BOUNCE_OVERSHOOT) + 1.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_BACK_EASEIN"," if (type == 91)"," {"," return value + a * time * time * (BOUNCE_OVERSHOOT_PLUS * time - BOUNCE_OVERSHOOT)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_BACK_EASEINOUT"," if (type == 92)"," {"," time *= 2.0;"," if (time < 1.0)"," {"," return value + a * 0.5 * (time * time * (BOUNCE_OVERSHOOT_IN_OUT_PLUS * time - BOUNCE_OVERSHOOT_IN_OUT))"," + repeats * a;"," }"," time -= 2.0;"," return value + a * 0.5 * (time * time * (BOUNCE_OVERSHOOT_IN_OUT_PLUS * time + BOUNCE_OVERSHOOT_IN_OUT) + 2.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_BOUNCE_EASEOUT"," if (type == 100)"," {"," if (time < 1.0 / 2.75)"," {"," return value + a * (7.5625 * time * time)"," + repeats * a;"," }"," else if (time < 2.0 / 2.75)"," {"," time -= 1.5 / 2.75;"," return value + a * (7.5625 * time * time + 0.75)"," + repeats * a;"," }"," else if (time < 2.5 / 2.75)"," {"," time -= 2.25 / 2.75;"," return value + a * (7.5625 * time * time + 0.9375)"," + repeats * a;"," }"," else"," {"," time -= 2.625 / 2.75;"," return value + a * (7.5625 * time * time + 0.984375)"," + repeats * a;"," }"," }"," #endif"," #ifdef FEATURE_BOUNCE_EASEIN"," if (type == 101)"," {"," time = 1.0 - time;"," if (time < 1.0 / 2.75)"," {"," return value + a * (1.0 - 7.5625 * time * time)"," + repeats * a;"," }"," else if (time < 2.0 / 2.75)"," {"," time -= 1.5 / 2.75;"," return value + a * (1.0 - (7.5625 * time * time + 0.75))"," + repeats * a;"," }"," else if (time < 2.5 / 2.75)"," {"," time -= 2.25 / 2.75;"," return value + a * (1.0 - (7.5625 * time * time + 0.9375))"," + repeats * a;"," }"," else"," {"," time -= 2.625 / 2.75;"," return value + a * (1.0 - (7.5625 * time * time + 0.984375))"," + repeats * a;"," }"," }"," #endif"," #ifdef FEATURE_BOUNCE_EASEINOUT"," if (type == 102)"," {"," bool reverse = false;"," if (time < 0.5)"," {"," time = 1.0 - time * 2.0;"," reverse = true;"," }"," if (time < 1.0 / 2.75)"," {"," time = 7.5625 * time * time;"," }"," else if (time < 2.0 / 2.75)"," {"," time -= 1.5 / 2.75;"," time = 7.5625 * time * time + 0.75;"," }"," else if (time < 2.5 / 2.75)"," {"," time -= 2.25 / 2.75;"," time = 7.5625 * time * time + 0.9375;"," }"," else"," {"," time -= 2.625 / 2.75;"," time = 7.5625 * time * time + 0.984375;"," }"," if (reverse)"," {"," return value + a * (1.0 - time) * 0.5"," + repeats * a;"," }"," return value + a * time * 0.5 + 0.5"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_STEPPED"," if (type == 110)"," {"," return value + a * floor(time + 0.5)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_SMOOTHSTEP_EASEOUT"," if (type == 120)"," {"," return value + a * (smoothstep(0.0, 1.0, time / 2.0 + 0.5) * 2.0 - 1.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_SMOOTHSTEP_EASEIN"," if (type == 121)"," {"," return value + a * smoothstep(0.0, 1.0, time / 2.0) * 2.0"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_SMOOTHSTEP_EASEINOUT"," if (type == 122)"," {"," return value + a * smoothstep(0.0, 1.0, time)"," + repeats * a;"," }"," #endif"," return value;","}","struct Frame {"," vec2 position;"," vec2 size;"," vec2 offset;","};","Frame getFrame (float frame)","{"," float index1 = floor(frame) * 3.0;"," float index2 = index1 + 1.0;"," float index3 = index1 + 2.0;"," float width = uFrameDataResolution.x;"," float x = mod(index1, width);"," float y = floor(index1 / width);"," vec4 texelUV = texture2D("," uFrameDataTexture,"," vec2(x + 0.5, y + 0.5) / uFrameDataResolution"," );"," x = mod(index2, width);"," y = floor(index2 / width);"," vec4 texelWH = texture2D("," uFrameDataTexture,"," vec2(x + 0.5, y + 0.5) / uFrameDataResolution"," );"," x = mod(index3, width);"," y = floor(index3 / width);"," vec4 texelOrigin = texture2D("," uFrameDataTexture,"," vec2(x + 0.5, y + 0.5) / uFrameDataResolution"," );"," return Frame("," vec2("," texelUV.r + texelUV.g * 256.0,"," texelUV.b + texelUV.a * 256.0"," ) * 255.0,"," vec2("," texelWH.r + texelWH.g * 256.0,"," texelWH.b + texelWH.a * 256.0"," ) * 255.0,"," vec2("," texelOrigin.r + texelOrigin.g * 256.0,"," texelOrigin.b + texelOrigin.a * 256.0"," ) * 255.0 - 32768.0"," );","}","void main ()","{"," float positionX = animate(inPositionX);"," float positionY = animate(inPositionY);"," float rotation = animate(inRotation);"," float scaleX = animate(inScaleX);"," float scaleY = animate(inScaleY);"," float frame = animate(inFrame);"," float tintBlend = animate(inTintBlend);"," float alpha = animate(inAlpha);"," vec2 origin = inOriginAndTintModeAndCreationTime.xy;"," float tintMode = inOriginAndTintModeAndCreationTime.z;"," float scrollFactorX = inScrollFactor.x;"," float scrollFactorY = inScrollFactor.y;"," Frame frameData = getFrame(frame);"," vec2 uv = frameData.position / uDiffuseResolution;"," vec2 wh = frameData.size / uDiffuseResolution;"," float u = uv.s;"," float v = uv.t;"," float w = wh.s;"," float h = wh.t;"," float width = frameData.size.s;"," float height = frameData.size.t;"," vec4 tint = inTintTL;"," float x = -origin.x;"," float y = -origin.y;"," if (inVertex == 0.0)"," {"," y = 1.0 - origin.y;"," v += h;"," tint = inTintBL;"," }"," else if (inVertex == 2.0)"," {"," x = 1.0 - origin.x;"," y = 1.0 - origin.y;"," u += w;"," v += h;"," tint = inTintBR;"," }"," else if (inVertex == 3.0)"," {"," x = 1.0 - origin.x;"," u += w;"," tint = inTintTR;"," }"," vec3 position = vec3("," (x * width - frameData.offset.x) * scaleX,"," (y * height - frameData.offset.y) * scaleY,"," 1.0"," );"," mat3 viewMatrix = uViewMatrix * mat3("," 1.0, 0.0, 0.0,"," 0.0, 1.0, 0.0,"," uCameraScrollAndAlpha.x * (1.0 - scrollFactorX), uCameraScrollAndAlpha.y * (1.0 - scrollFactorY), 1.0"," );"," float sine = sin(rotation);"," float cosine = cos(rotation);"," mat3 transformMatrix = mat3("," cosine, sine, 0.0,"," -sine, cosine, 0.0,"," positionX, positionY, 1.0"," );"," position = viewMatrix * transformMatrix * position;"," alpha *= uCameraScrollAndAlpha.z;"," tint.a *= alpha;"," if (uRoundPixels == 1 && rotation == 0.0 && scaleX == 1.0 && scaleY == 1.0)"," {"," position.xy = floor(position.xy + ROUND_BIAS);"," }"," gl_Position = uProjectionMatrix * vec4(position.xy, 1.0, 1.0);"," outTexCoord = vec2(u, 1.0 - v);"," outTint = mix(vec4(1.0, 1.0, 1.0, tint.a), tint, tintBlend);"," outTintEffect = tintMode;"," #pragma phaserTemplate(vertexProcess)","}"].join("\n")},57532(t){t.exports=["#version 100","#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","/* Redefine MAX_ANIM_FRAMES to support animations with different frame numbers. */","#define MAX_ANIM_FRAMES 0","#pragma phaserTemplate(fragmentDefine)","uniform vec2 uResolution;","uniform sampler2D uMainSampler;","uniform sampler2D uLayerSampler;","uniform vec2 uMainResolution;","uniform vec2 uLayerResolution;","uniform float uTileColumns;","uniform vec4 uTileWidthHeightMarginSpacing;","uniform float uAlpha;","uniform float uTime;","#if MAX_ANIM_FRAMES > 0","uniform sampler2D uAnimSampler;","uniform vec2 uAnimResolution;","#endif","varying vec2 outTexCoord;","varying vec2 outTileStride;","#pragma phaserTemplate(outVariables)","vec2 getTexRes ()","{"," return uMainResolution;","}","float floatTexel (vec4 texel)","{"," return texel.r * 255.0 + (texel.g * 255.0 * 256.0) + (texel.b * 255.0 * 256.0 * 256.0) + (texel.a * 255.0 * 256.0 * 256.0 * 256.0);","}","struct Tile","{"," float index;"," vec2 uv; // In texels."," #if MAX_ANIM_FRAMES > 0"," bool animated;"," #endif"," bool empty;","};","Tile getLayerData (vec2 coord)","{"," vec2 texelCoord = coord * uLayerResolution;"," vec2 tile = floor(texelCoord);"," vec2 uv = fract(texelCoord);"," uv.y = 1.0 - uv.y;"," vec4 texel = texture2D(uLayerSampler, (tile + 0.5) / uLayerResolution) * 255.0;"," float flags = texel.a;"," /* Check for empty tile flag in bit 28. */"," if (flags == 16.0)"," {"," return Tile("," 0.0,"," vec2(0.0),"," #if MAX_ANIM_FRAMES > 0"," false,"," #endif"," true"," );"," }"," /* Bit 31 is flipX. */"," bool flipX = flags > 127.0;"," /* Bit 30 is flipY. */"," bool flipY = mod(flags, 128.0) > 63.0;"," #if MAX_ANIM_FRAMES > 0"," /* Bit 29 is animation. */"," bool animated = mod(flags, 64.0) > 31.0;"," #endif"," if (flipX)"," {"," uv.x = 1.0 - uv.x;"," }"," if (flipY)"," {"," uv.y = 1.0 - uv.y;"," }"," float index = texel.r + (texel.g * 256.0) + (texel.b * 256.0 * 256.0);"," return Tile("," index,"," uv * uTileWidthHeightMarginSpacing.xy,"," #if MAX_ANIM_FRAMES > 0"," animated,"," #endif"," false"," );","}","vec2 getFrameCorner (float index)","{"," float x = mod(index, uTileColumns);"," float y = floor(index / uTileColumns);"," vec2 xy = vec2(x, y);"," return xy * outTileStride + uTileWidthHeightMarginSpacing.zz;","}","#if MAX_ANIM_FRAMES > 0","float animationIndex (float index)","{"," float animTextureWidth = uAnimResolution.x;"," vec2 index2D = vec2(mod(index, animTextureWidth), floor(index / animTextureWidth));"," vec4 animDurationTexel = texture2D(uAnimSampler, (index2D + 0.5) / uAnimResolution);"," index2D = vec2(mod(index + 1.0, animTextureWidth), floor((index + 1.0) / animTextureWidth));"," vec4 animIndexTexel = texture2D(uAnimSampler, (index2D + 0.5) / uAnimResolution);"," float animDuration = floatTexel(animDurationTexel);"," float animIndex = floatTexel(animIndexTexel);"," float animTime = mod(uTime, animDuration);"," float animTimeAccum = 0.0;"," for (int i = 0; i < MAX_ANIM_FRAMES; i++)"," {"," index2D = vec2(mod(animIndex, animTextureWidth), floor(animIndex / animTextureWidth));"," animDurationTexel = texture2D(uAnimSampler, (index2D + 0.5) / uAnimResolution);"," float frameDuration = floatTexel(animDurationTexel);"," animTimeAccum += frameDuration;"," if (animTime <= animTimeAccum)"," {"," break;"," }"," animIndex += 2.0;"," }"," animIndex += 1.0;"," index2D = vec2(mod(animIndex, animTextureWidth), floor(animIndex / animTextureWidth));"," animIndexTexel = texture2D(uAnimSampler, (index2D + 0.5) / uAnimResolution);"," float animFrameIndex = floatTexel(animIndexTexel);"," return animFrameIndex;","}","#endif","vec2 getTileTexelCoord (Tile tile)","{"," if (tile.empty)"," {"," return vec2(0.0);"," }"," float index = tile.index;"," #if MAX_ANIM_FRAMES > 0"," if (tile.animated)"," {"," index = animationIndex(index);"," }"," #endif"," vec2 frameCorner = getFrameCorner(index);"," return frameCorner + tile.uv;","}","#pragma phaserTemplate(fragmentHeader)","struct Samples {"," vec4 color;"," #pragma phaserTemplate(defineSamples)","};","Samples getColorSamples (vec2 texCoord)","{"," Samples samples;"," samples.color = texture2D("," uMainSampler,"," vec2(texCoord.x, 1.0 - texCoord.y)"," );"," #pragma phaserTemplate(getSamples)"," return samples;","}","Samples mixSamples (Samples samples1, Samples samples2, float alpha)","{"," Samples samples;"," samples.color = mix(samples1.color, samples2.color, alpha);"," #pragma phaserTemplate(mixSamples)"," return samples;","}","Samples getFinalSamples (Tile tile, vec2 layerTexCoord)","{"," vec2 texelCoord = getTileTexelCoord(tile);"," vec2 texCoord = texelCoord / uMainResolution;"," #pragma phaserTemplate(texCoord)"," #ifndef FEATURE_BORDERFILTER"," return getColorSamples(texCoord);"," #else"," #pragma phaserTemplate(finalSamples)"," vec2 wh = uTileWidthHeightMarginSpacing.xy;"," vec2 frameCorner = getFrameCorner(tile.index);"," vec2 frameCornerOpposite = frameCorner + wh;"," vec2 texCoordClamped = clamp(texCoord, (frameCorner + 0.5) / uMainResolution, (frameCornerOpposite - 0.5) / uMainResolution);"," vec2 dTexelCoord = (texCoord - texCoordClamped) * uMainResolution;"," dTexelCoord.y = -dTexelCoord.y;"," vec2 offsets = sign(dTexelCoord);"," Samples samples0 = getColorSamples(texCoordClamped);"," if (offsets.x == 0.0)"," {"," if (offsets.y == 0.0)"," {"," return samples0;"," }"," Tile tileY = getLayerData(layerTexCoord + (offsets - dTexelCoord) / wh / uLayerResolution);"," vec2 texelCoordY = getTileTexelCoord(tileY);"," vec2 texCoordY = texelCoordY / uMainResolution;"," Samples samplesY = getColorSamples(texCoordY);"," return mixSamples(samples0, samplesY, abs(dTexelCoord.y));"," }"," else"," {"," if (offsets.y == 0.0)"," {"," Tile tileX = getLayerData(layerTexCoord + (offsets - dTexelCoord) / wh / uLayerResolution);"," vec2 texelCoordX = getTileTexelCoord(tileX);"," vec2 texCoordX = texelCoordX / uMainResolution;"," Samples samplesX = getColorSamples(texCoordX);"," return mixSamples(samples0, samplesX, abs(dTexelCoord.x));"," }"," Tile tileX = getLayerData(layerTexCoord + (offsets * vec2(1.0, 0.0) - dTexelCoord) / wh / uLayerResolution);"," vec2 texelCoordX = getTileTexelCoord(tileX);"," vec2 texCoordX = texelCoordX / uMainResolution;"," Samples samplesX = getColorSamples(texCoordX);"," Tile tileY = getLayerData(layerTexCoord + (offsets * vec2(0.0, 1.0) - dTexelCoord) / wh / uLayerResolution);"," vec2 texelCoordY = getTileTexelCoord(tileY);"," vec2 texCoordY = texelCoordY / uMainResolution;"," Samples samplesY = getColorSamples(texCoordY);"," Tile tileXY = getLayerData(layerTexCoord + (offsets - dTexelCoord) / wh / uLayerResolution);"," vec2 texelCoordXY = getTileTexelCoord(tileXY);"," vec2 texCoordXY = texelCoordXY / uMainResolution;"," Samples samplesXY = getColorSamples(texCoordXY);"," Samples samples1 = mixSamples(samples0, samplesX, abs(dTexelCoord.x));"," Samples samples2 = mixSamples(samplesY, samplesXY, abs(dTexelCoord.x));"," return mixSamples(samples1, samples2, abs(dTexelCoord.y));"," }"," #endif","}","void main ()","{"," vec2 layerTexCoord = outTexCoord;"," Tile tile = getLayerData(layerTexCoord);"," Samples samples = getFinalSamples(tile, layerTexCoord);"," vec4 fragColor = samples.color;"," #pragma phaserTemplate(declareSamples)"," #pragma phaserTemplate(fragmentProcess)"," fragColor *= uAlpha;"," gl_FragColor = fragColor;","}"].join("\n")},23879(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(vertexDefine)","uniform mat4 uProjectionMatrix;","uniform vec2 uResolution;","uniform vec4 uTileWidthHeightMarginSpacing;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","varying vec2 outTexCoord;","varying vec2 outTileStride;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(vertexHeader)","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);"," outTexCoord = inTexCoord;"," outTileStride = uTileWidthHeightMarginSpacing.xy + uTileWidthHeightMarginSpacing.zz;"," #pragma phaserTemplate(vertexProcess)","}"].join("\n")},84639(t){t.exports=function(t,e){return{name:t+"Anims",additions:{fragmentDefine:"#undef MAX_ANIM_FRAMES\n#define MAX_ANIM_FRAMES "+t},tags:["MAXANIMS"],disable:!!e}}},81084(t,e,i){var r=i(84547);t.exports=function(t){return{name:"ApplyLighting",additions:{fragmentHeader:r,fragmentProcess:"fragColor = applyLighting(fragColor, normal);"},tags:["LIGHTING"],disable:!!t}}},44349(t,e,i){var r=i(11104);t.exports=function(t){return{name:"Tint",additions:{fragmentHeader:r,fragmentProcess:"fragColor = applyTint(fragColor);"},tags:["TINT"],disable:!!t}}},99501(t,e,i){var r=i(81556);t.exports=function(t){return{name:"BoundedSampler",additions:{fragmentHeader:r},disable:!!t}}},6184(t,e,i){var r=i(11719);t.exports=function(t){return{name:"DefineLights",additions:{fragmentDefine:"#define LIGHT_COUNT 1",fragmentHeader:r},tags:["LIGHTING"],disable:!!t}}},11653(t){t.exports=function(t,e){return{name:t+"TexCount",additions:{fragmentDefine:"#define TEXTURE_COUNT "+t},tags:["TexCount"],disable:!!e}}},13198(t){t.exports=function(t){return{name:"FlatNormal",additions:{fragmentProcess:"vec3 normal = vec3(0.0, 0.0, 1.0);"},tags:["LIGHTING"],disable:!!t}}},40829(t,e,i){var r=i(84220);t.exports=function(t){return{name:"NormalMap",additions:{fragmentHeader:r,fragmentProcess:"vec3 normal = getNormalFromMap(texCoord);"},tags:["LIGHTING"],disable:!!t}}},42792(t){t.exports=function(t){return{name:"TexCoordOut",additions:{fragmentProcess:"vec2 texCoord = outTexCoord;\n#pragma phaserTemplate(texCoord)"},tags:["TEXCOORD"],disable:!!t}}},96049(t,e,i){var r=i(2860);t.exports=function(t){return{name:"GetTexRes",additions:{fragmentHeader:r},tags:["TEXRES"],disable:!!t}}},33997(t,e,i){var r=i(46432);t.exports=function(t,e){void 0===t&&(t=1);for(var i="",s=1;s1&&(d=u.baseType===i.FLOAT?new Float32Array(c):new Int32Array(c)),this.glUniforms.set(l.name,{location:i.getUniformLocation(t,l.name),size:l.size,type:l.type,value:d})}},setUniform:function(t,e){this.uniformRequests.set(t,e)},bind:function(){this.renderer.glWrapper.updateBindingsProgram(this.glState),this.uniformRequests.each(this._processUniformRequest.bind(this)),this.uniformRequests.clear()},_processUniformRequest:function(t,e){var i=this.renderer,r=i.gl,n=this.glUniforms.get(t);if(n){var a=n.value;if(a.length){for(var o=!1,h=0;h1)c.setV.call(r,l,a);else switch(c.size){case 1:c.set.call(r,l,e);break;case 2:c.set.call(r,l,e[0],e[1]);break;case 3:c.set.call(r,l,e[0],e[1],e[2]);break;case 4:c.set.call(r,l,e[0],e[1],e[2],e[3])}}},destroy:function(){if(this.webGLProgram){var t=this.renderer.gl;if(!t.isContextLost()){this._vertexShader&&t.deleteShader(this._vertexShader),this._fragmentShader&&t.deleteShader(this._fragmentShader),t.deleteProgram(this.webGLProgram);for(var e=0;e=0;i--)this.units[i]=void 0,this.renderer.glWrapper.updateBindingsActiveTexture({bindings:{activeTexture:i}}),t.bindTexture(t.TEXTURE_2D,e),this.unitIndices[i]=i;t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array([0,0,255,255]))},bind:function(t,e,i,r){var s=this.units[e]!==t;if((i||!1!==r||s)&&this.renderer.glWrapper.updateBindingsActiveTexture({bindings:{activeTexture:e}},i),s||i){this.units[e]=t;var n=t?t.webGLTexture:null,a=this.renderer.gl;a.bindTexture(a.TEXTURE_2D,n),t&&t.needsMipmapRegeneration&&t.generateMipmap()}},bindUnits:function(t,e){for(var i=Math.min(t.length,this.renderer.maxTextures)-1;i>=0;i--)void 0!==t[i]&&this.bind(t[i],i,e,!1)},unbindTexture:function(t){for(var e=this.units.length-1;e>=0;e--)this.units[e]===t&&this.bind(null,e,!0,!1)},unbindAllUnits:function(){for(var t=this.units.length-1;t>=0;t--)this.bind(null,t,!0,!1)}});t.exports=r},82751(t,e,i){var r=i(83419),s=i(50030),n=new r({initialize:function(t,e,i,r,s,n,a,o,h,l,u,d,c){void 0===c&&(c=!0),this.renderer=t,this.webGLTexture=null,this.isRenderTexture=!1,this.mipLevel=e,this.minFilter=i,this.magFilter=r,this.wrapT=s,this.wrapS=n,this.format=a,this.pixels=o,this.width=h,this.height=l,this.pma=null==u||u,this.forceSize=!!d,this.flipY=!!c,this.__SPECTOR_Metadata={},this.batchUnit=-1,this.needsMipmapRegeneration=!1,this.createResource()},createResource:function(){var t=this.renderer.gl;if(!t.isContextLost())if(this.pixels instanceof n)this.webGLTexture=this.pixels.webGLTexture;else{var e=t.createTexture();e.__SPECTOR_Metadata=this.__SPECTOR_Metadata,this.webGLTexture=e,this._processTexture()}},resize:function(t,e){if(this.width!==t||this.height!==e){this.width=t,this.height=e;var i=this.renderer,r=i.gl,n=s(t,e);n?(this.wrapS=r.REPEAT,this.wrapT=r.REPEAT):(this.wrapS=r.CLAMP_TO_EDGE,this.wrapT=r.CLAMP_TO_EDGE),n&&i.mipmapFilter&&(!this.isRenderTexture||i.config.mipmapRegeneration)?this.minFilter=i.mipmapFilter:i.config.antialias?this.minFilter=r.LINEAR:this.minFilter=r.NEAREST,this._processTexture()}},update:function(t,e,i,r,s,n,a,o,h){0!==e&&0!==i&&(this.pixels=t,this.width=e,this.height=i,this.flipY=r,this.wrapS=s,this.wrapT=n,this.minFilter=a,this.magFilter=o,this.format=h,this._processTexture())},_processTexture:function(){var t=this.renderer.gl;this.renderer.glTextureUnits.bind(this,0),this.renderer.glWrapper.updateTexturing({texturing:{flipY:this.flipY,premultiplyAlpha:this.pma}}),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,this.minFilter),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,this.magFilter),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,this.wrapS),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,this.wrapT);var e=this.pixels,i=this.mipLevel,r=this.width,s=this.height,n=this.format;if(null==e)t.texImage2D(t.TEXTURE_2D,i,n,r,s,0,n,t.UNSIGNED_BYTE,null),this.generateMipmap();else if(e.compressed){r=e.width,s=e.height;for(var a=0;a0&&this.parentSize.height>0&&this.displaySize.setParent(this.parentSize),this.refresh()),t.events.on(h.PRE_STEP,this.step,this),t.events.once(h.READY,this.refresh,this),t.events.once(h.DESTROY,this.destroy,this),this.startListeners()},parseConfig:function(t){this.getParent(t),this.getParentBounds();var e=t.width,i=t.height,s=t.scaleMode,n=t.zoom,a=t.autoRound;if("string"==typeof e)if("%"!==e.substr(-1))e=parseInt(e,10);else{var o=this.parentSize.width;0===o&&(o=window.innerWidth);var h=parseInt(e,10)/100;e=Math.floor(o*h)}if("string"==typeof i)if("%"!==i.substr(-1))i=parseInt(i,10);else{var l=this.parentSize.height;0===l&&(l=window.innerHeight);var u=parseInt(i,10)/100;i=Math.floor(l*u)}this.scaleMode=s,this.autoRound=a,this.autoCenter=t.autoCenter,this.resizeInterval=t.resizeInterval,a&&(e=Math.floor(e),i=Math.floor(i)),this.gameSize.setSize(e,i),n===r.ZOOM.MAX_ZOOM&&(n=this.getMaxZoom()),this.zoom=n,1!==n&&(this._resetZoom=!0),this.baseSize.setSize(e,i),a&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),t.minWidth>0&&this.displaySize.setMin(t.minWidth*n,t.minHeight*n),t.maxWidth>0&&this.displaySize.setMax(t.maxWidth*n,t.maxHeight*n),this.displaySize.setSize(e,i),(t.snapWidth>0||t.snapHeight>0)&&this.displaySize.setSnap(t.snapWidth,t.snapHeight),this.orientation=d(e,i)},getParent:function(t){var e=t.parent;if(null!==e){if(this.parent=u(e),this.parentIsWindow=this.parent===document.body,t.expandParent&&t.scaleMode!==r.SCALE_MODE.NONE){var i=this.parent.getBoundingClientRect();(this.parentIsWindow||0===i.height)&&(document.documentElement.style.height="100%",document.body.style.height="100%",i=this.parent.getBoundingClientRect(),this.parentIsWindow||0!==i.height||(this.parent.style.overflow="hidden",this.parent.style.width="100%",this.parent.style.height="100%"))}t.fullscreenTarget&&!this.fullscreenTarget&&(this.fullscreenTarget=u(t.fullscreenTarget))}},getParentBounds:function(){if(!this.parent)return!1;var t=this.parentSize,e=this.parent.getBoundingClientRect();this.parentIsWindow&&this.game.device.os.iOS&&(e.height=l(!0));var i=e.width,r=e.height;if(t.width!==i||t.height!==r)return t.setSize(i,r),!0;if(this.canvas){var s=this.canvasBounds,n=this.canvas.getBoundingClientRect();if(n.x!==s.x||n.y!==s.y)return!0}return!1},lockOrientation:function(t){var e=screen.lockOrientation||screen.mozLockOrientation||screen.msLockOrientation;return!!e&&e.call(screen,t)},setParentSize:function(t,e){return this.parentSize.setSize(t,e),this.refresh()},setGameSize:function(t,e){var i=this.autoRound;i&&(t=Math.floor(t),e=Math.floor(e));var r=this.width,s=this.height;return this.gameSize.resize(t,e),this.baseSize.resize(t,e),i&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setAspectRatio(t/e),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height,this.refresh(r,s)},resize:function(t,e){var i=this.zoom,r=this.autoRound;r&&(t=Math.floor(t),e=Math.floor(e));var s=this.width,n=this.height;this.gameSize.resize(t,e),this.baseSize.resize(t,e),r&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setSize(t*i,e*i),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height;var a=this.canvas.style,o=t*i,h=e*i;return r&&(o=Math.floor(o),h=Math.floor(h)),o===t&&h===e||(a.width=o+"px",a.height=h+"px"),this.refresh(s,n)},setZoom:function(t){return this.zoom=t,this._resetZoom=!0,this.refresh()},setMaxZoom:function(){return this.zoom=this.getMaxZoom(),this._resetZoom=!0,this.refresh()},setSnap:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.displaySize.setSnap(t,e),this.refresh()},refresh:function(t,e){void 0===t&&(t=this.width),void 0===e&&(e=this.height),this.updateScale(),this.updateBounds(),this.updateOrientation(),this.displayScale.set(this.baseSize.width/this.canvasBounds.width,this.baseSize.height/this.canvasBounds.height);var i=this.game.domContainer;if(i){this.baseSize.setCSS(i);var r=this.canvas.style,s=i.style;s.transform="scale("+this.displaySize.width/this.baseSize.width+","+this.displaySize.height/this.baseSize.height+")",s.marginLeft=r.marginLeft,s.marginTop=r.marginTop}return this.emit(o.RESIZE,this.gameSize,this.baseSize,this.displaySize,t,e),this},updateOrientation:function(){if(this._checkOrientation){this._checkOrientation=!1;var t=d(this.width,this.height);t!==this.orientation&&(this.orientation=t,this.emit(o.ORIENTATION_CHANGE,t))}},updateScale:function(){var t,e,i=this.canvas.style,s=this.gameSize.width,a=this.gameSize.height,o=this.zoom,h=this.autoRound;if(this.scaleMode===r.SCALE_MODE.NONE)this.displaySize.setSize(s*o,a*o),t=this.displaySize.width,e=this.displaySize.height,h&&(t=Math.floor(t),e=Math.floor(e)),this._resetZoom&&(i.width=t+"px",i.height=e+"px",this._resetZoom=!1);else if(this.scaleMode===r.SCALE_MODE.RESIZE)this.displaySize.setSize(this.parentSize.width,this.parentSize.height),this.gameSize.setSize(this.displaySize.width,this.displaySize.height),this.baseSize.setSize(this.displaySize.width,this.displaySize.height),t=this.displaySize.width,e=this.displaySize.height,h&&(t=Math.floor(t),e=Math.floor(e)),this.canvas.width=t,this.canvas.height=e;else if(this.scaleMode===r.SCALE_MODE.EXPAND){var l,u,d=this.game.config.width,c=this.game.config.height,f=this.parentSize.width,p=this.parentSize.height,g=f/d,m=p/c;g=0?0:-a.x*o.x,l=a.y>=0?0:-a.y*o.y;return i=n.width>=a.width?s.width:s.width-(a.width-n.width)*o.x,r=n.height>=a.height?s.height:s.height-(a.height-n.height)*o.y,e.setTo(h,l,i,r),t&&(e.width/=t.zoomX,e.height/=t.zoomY,e.centerX=t.centerX+t.scrollX,e.centerY=t.centerY+t.scrollY),e},step:function(t,e){this.parent&&(this._lastCheck+=e,(this.dirty||this._lastCheck>this.resizeInterval)&&(this.getParentBounds()&&this.refresh(),this.dirty=!1,this._lastCheck=0))},stopListeners:function(){var t=this.domlisteners;screen.orientation&&screen.orientation.addEventListener?screen.orientation.removeEventListener("change",t.orientationChange,!1):window.removeEventListener("orientationchange",t.orientationChange,!1),window.removeEventListener("resize",t.windowResize,!1);["webkit","moz",""].forEach(function(e){document.removeEventListener(e+"fullscreenchange",t.fullScreenChange,!1),document.removeEventListener(e+"fullscreenerror",t.fullScreenError,!1)}),document.removeEventListener("MSFullscreenChange",t.fullScreenChange,!1),document.removeEventListener("MSFullscreenError",t.fullScreenError,!1)},destroy:function(){this.removeAllListeners(),this.stopListeners(),this.game=null,this.canvas=null,this.canvasBounds=null,this.parent=null,this.fullscreenTarget=null,this.parentSize.destroy(),this.gameSize.destroy(),this.baseSize.destroy(),this.displaySize.destroy()},isFullscreen:{get:function(){return this.fullscreen.active}},width:{get:function(){return this.gameSize.width}},height:{get:function(){return this.gameSize.height}},isPortrait:{get:function(){return this.orientation===r.ORIENTATION.PORTRAIT}},isLandscape:{get:function(){return this.orientation===r.ORIENTATION.LANDSCAPE}},isGamePortrait:{get:function(){return this.height>this.width}},isGameLandscape:{get:function(){return this.width>this.height}}});t.exports=y},64743(t){t.exports={NO_CENTER:0,CENTER_BOTH:1,CENTER_HORIZONTALLY:2,CENTER_VERTICALLY:3}},39218(t){t.exports={LANDSCAPE:"landscape-primary",LANDSCAPE_SECONDARY:"landscape-secondary",PORTRAIT:"portrait-primary",PORTRAIT_SECONDARY:"portrait-secondary"}},81050(t){t.exports={NONE:0,WIDTH_CONTROLS_HEIGHT:1,HEIGHT_CONTROLS_WIDTH:2,FIT:3,ENVELOP:4,RESIZE:5,EXPAND:6}},80805(t){t.exports={NO_ZOOM:1,ZOOM_2X:2,ZOOM_4X:4,MAX_ZOOM:-1}},13560(t,e,i){var r={CENTER:i(64743),ORIENTATION:i(39218),SCALE_MODE:i(81050),ZOOM:i(80805)};t.exports=r},56139(t){t.exports="enterfullscreen"},2336(t){t.exports="fullscreenfailed"},47412(t){t.exports="fullscreenunsupported"},51452(t){t.exports="leavefullscreen"},20666(t){t.exports="orientationchange"},47945(t){t.exports="resize"},97480(t,e,i){t.exports={ENTER_FULLSCREEN:i(56139),FULLSCREEN_FAILED:i(2336),FULLSCREEN_UNSUPPORTED:i(47412),LEAVE_FULLSCREEN:i(51452),ORIENTATION_CHANGE:i(20666),RESIZE:i(47945)}},93364(t,e,i){var r=i(79291),s=i(13560),n={Center:i(64743),Events:i(97480),Orientation:i(39218),ScaleManager:i(76531),ScaleModes:i(81050),Zoom:i(80805)};n=r(!1,n,s.CENTER),n=r(!1,n,s.ORIENTATION),n=r(!1,n,s.SCALE_MODE),n=r(!1,n,s.ZOOM),t.exports=n},27397(t,e,i){var r=i(95540),s=i(35355);t.exports=function(t){var e=t.game.config.defaultPhysicsSystem,i=r(t.settings,"physics",!1);if(e||i){var n=[];if(e&&n.push(s(e+"Physics")),i)for(var a in i)a=s(a.concat("Physics")),-1===n.indexOf(a)&&n.push(a);return n}}},52106(t,e,i){var r=i(95540);t.exports=function(t){var e=t.plugins.getDefaultScenePlugins(),i=r(t.settings,"plugins",!1);return Array.isArray(i)?i:e||[]}},87033(t){t.exports={game:"game",renderer:"renderer",anims:"anims",cache:"cache",plugins:"plugins",registry:"registry",scale:"scale",sound:"sound",textures:"textures",events:"events",cameras:"cameras",add:"add",make:"make",scenePlugin:"scene",displayList:"children",lights:"lights",data:"data",input:"input",load:"load",time:"time",tweens:"tweens",arcadePhysics:"physics",matterPhysics:"matter"}},97482(t,e,i){var r=i(83419),s=i(2368),n=new r({initialize:function(t){this.sys=new s(this,t),this.game,this.anims,this.cache,this.registry,this.sound,this.textures,this.events,this.cameras,this.add,this.make,this.scene,this.children,this.lights,this.data,this.input,this.load,this.time,this.tweens,this.physics,this.matter,this.scale,this.plugins,this.renderer},update:function(){}});t.exports=n},60903(t,e,i){var r=i(83419),s=i(89993),n=i(44594),a=i(8443),o=i(35154),h=i(54899),l=i(29747),u=i(97482),d=i(2368),c=new r({initialize:function(t,e){if(this.game=t,this.keys={},this.scenes=[],this._pending=[],this._start=[],this._queue=[],this._data={},this.isProcessing=!1,this.isBooted=!1,this.customViewports=0,this.systemScene,e){Array.isArray(e)||(e=[e]);for(var i=0;i-1&&(delete this.keys[r],this.scenes.splice(i,1),this._start.indexOf(r)>-1&&(i=this._start.indexOf(r),this._start.splice(i,1)),e.sys.destroy()),this},bootScene:function(t){var e,i=t.sys,r=i.settings;i.sceneUpdate=l,t.init&&(t.init.call(t,r.data),r.status=s.INIT,r.isTransition&&i.events.emit(n.TRANSITION_INIT,r.transitionFrom,r.transitionDuration)),i.load&&(e=i.load).reset(),e&&t.preload?(t.preload.call(t),r.status=s.LOADING,e.once(h.COMPLETE,this.loadComplete,this),e.start()):this.create(t)},loadComplete:function(t){this.create(t.scene)},payloadComplete:function(t){this.bootScene(t.scene)},update:function(t,e){this.processQueue(),this.isProcessing=!0;for(var i=this.scenes.length-1;i>=0;i--){var r=this.scenes[i].sys;r.settings.status>s.START&&r.settings.status<=s.RUNNING&&r.step(t,e),r.scenePlugin&&r.scenePlugin._target&&r.scenePlugin.step(t,e)}},render:function(t){for(var e=0;e=s.LOADING&&i.settings.status=s.START&&a<=s.CREATING)return this;if(a>=s.RUNNING&&a<=s.SLEEPING)n.shutdown(),n.sceneUpdate=l,n.start(e);else if(n.sceneUpdate=l,n.start(e),n.load&&(r=n.load),r&&n.settings.hasOwnProperty("pack")&&(r.reset(),r.addPack({payload:n.settings.pack})))return n.settings.status=s.LOADING,r.once(h.COMPLETE,this.payloadComplete,this),r.start(),this;return this.bootScene(i),this},stop:function(t,e){var i=this.getScene(t);if(i&&!i.sys.isTransitioning()&&i.sys.settings.status!==s.SHUTDOWN){var r=i.sys.load;r&&(r.off(h.COMPLETE,this.loadComplete,this),r.off(h.COMPLETE,this.payloadComplete,this)),i.sys.shutdown(e)}return this},switch:function(t,e,i){var r=this.getScene(t),s=this.getScene(e);return r&&s&&r!==s&&(this.sleep(t),this.isSleeping(e)?this.wake(e,i):this.start(e,i)),this},getAt:function(t){return this.scenes[t]},getIndex:function(t){var e=this.getScene(t);return this.scenes.indexOf(e)},bringToTop:function(t){if(this.isProcessing)return this.queueOp("bringToTop",t);var e=this.getIndex(t),i=this.scenes;if(-1!==e&&e0){var i=this.getScene(t);this.scenes.splice(e,1),this.scenes.unshift(i)}return this},moveDown:function(t){if(this.isProcessing)return this.queueOp("moveDown",t);var e=this.getIndex(t);if(e>0){var i=e-1,r=this.getScene(t),s=this.getAt(i);this.scenes[e]=s,this.scenes[i]=r}return this},moveUp:function(t){if(this.isProcessing)return this.queueOp("moveUp",t);var e=this.getIndex(t);if(ei),0,s)}return this},moveBelow:function(t,e){if(t===e)return this;if(this.isProcessing)return this.queueOp("moveBelow",t,e);var i=this.getIndex(t),r=this.getIndex(e);if(-1!==i&&-1!==r&&r>i){var s=this.getAt(r);this.scenes.splice(r,1),0===i?this.scenes.unshift(s):this.scenes.splice(i-(r=this._duration&&this.transitionComplete()},transitionComplete:function(){var t=this._target.sys,e=this._target.sys.settings;t.events.emit(n.TRANSITION_COMPLETE,this.scene),e.isTransition=!1,e.transitionFrom=null,this._duration=0,this._target=null,this._onUpdate=null,this._onUpdateScope=null,this._willRemove?this.manager.remove(this.key):this._willSleep?this.systems.sleep():this.manager.stop(this.key)},add:function(t,e,i,r){return this.manager.add(t,e,i,r)},launch:function(t,e){return t&&t!==this.key&&this.manager.queueOp("start",t,e),this},run:function(t,e){return t&&t!==this.key&&this.manager.queueOp("run",t,e),this},pause:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("pause",t,e),this},resume:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("resume",t,e),this},sleep:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("sleep",t,e),this},wake:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("wake",t,e),this},switch:function(t,e){return t!==this.key&&this.manager.queueOp("switch",this.key,t,e),this},stop:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("stop",t,e),this},setActive:function(t,e,i){void 0===e&&(e=this.key);var r=this.manager.getScene(e);return r&&r.sys.setActive(t,i),this},setVisible:function(t,e){void 0===e&&(e=this.key);var i=this.manager.getScene(e);return i&&i.sys.setVisible(t),this},isSleeping:function(t){return void 0===t&&(t=this.key),this.manager.isSleeping(t)},isActive:function(t){return void 0===t&&(t=this.key),this.manager.isActive(t)},isPaused:function(t){return void 0===t&&(t=this.key),this.manager.isPaused(t)},isVisible:function(t){return void 0===t&&(t=this.key),this.manager.isVisible(t)},swapPosition:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.swapPosition(t,e),this},moveAbove:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveAbove(t,e),this},moveBelow:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveBelow(t,e),this},remove:function(t){return void 0===t&&(t=this.key),this.manager.remove(t),this},moveUp:function(t){return void 0===t&&(t=this.key),this.manager.moveUp(t),this},moveDown:function(t){return void 0===t&&(t=this.key),this.manager.moveDown(t),this},bringToTop:function(t){return void 0===t&&(t=this.key),this.manager.bringToTop(t),this},sendToBack:function(t){return void 0===t&&(t=this.key),this.manager.sendToBack(t),this},get:function(t){return this.manager.getScene(t)},getStatus:function(t){var e=this.manager.getScene(t);if(e)return e.sys.getStatus()},getIndex:function(t){return void 0===t&&(t=this.key),this.manager.getIndex(t)},shutdown:function(){var t=this.systems.events;t.off(n.SHUTDOWN,this.shutdown,this),t.off(n.TRANSITION_OUT)},destroy:function(){this.shutdown(),this.scene.sys.events.off(n.START,this.start,this),this.scene=null,this.systems=null,this.settings=null,this.manager=null}});o.register("ScenePlugin",h,"scenePlugin"),t.exports=h},55681(t,e,i){var r=i(89993),s=i(35154),n=i(46975),a=i(87033),o={create:function(t){return"string"==typeof t?t={key:t}:void 0===t&&(t={}),{status:r.PENDING,key:s(t,"key",""),active:s(t,"active",!1),visible:s(t,"visible",!0),isBooted:!1,isTransition:!1,transitionFrom:null,transitionDuration:0,transitionAllowInput:!0,data:{},pack:s(t,"pack",!1),cameras:s(t,"cameras",null),map:s(t,"map",n(a,s(t,"mapAdd",{}))),physics:s(t,"physics",{}),loader:s(t,"loader",{}),plugins:s(t,"plugins",!1),input:s(t,"input",{})}}};t.exports=o},2368(t,e,i){var r=i(83419),s=i(89993),n=i(42363),a=i(44594),o=i(27397),h=i(52106),l=i(29747),u=i(55681),d=new r({initialize:function(t,e){this.scene=t,this.game,this.renderer,this.config=e,this.settings=u.create(e),this.canvas,this.context,this.anims,this.cache,this.plugins,this.registry,this.scale,this.sound,this.textures,this.add,this.cameras,this.displayList,this.events,this.make,this.scenePlugin,this.updateList,this.sceneUpdate=l},init:function(t){this.settings.status=s.INIT,this.sceneUpdate=l,this.game=t,this.renderer=t.renderer,this.canvas=t.canvas,this.context=t.context;var e=t.plugins;this.plugins=e,e.addToScene(this,n.Global,[n.CoreScene,h(this),o(this)]),this.events.emit(a.BOOT,this),this.settings.isBooted=!0},step:function(t,e){var i=this.events;i.emit(a.PRE_UPDATE,t,e),i.emit(a.UPDATE,t,e),this.sceneUpdate.call(this.scene,t,e),i.emit(a.POST_UPDATE,t,e)},render:function(t){var e=this.displayList;e.depthSort(),this.events.emit(a.PRE_RENDER,t),this.cameras.render(t,e),this.events.emit(a.RENDER,t)},queueDepthSort:function(){this.displayList.queueDepthSort()},depthSort:function(){this.displayList.depthSort()},pause:function(t){var e=this.settings,i=this.getStatus();return i!==s.CREATING&&i!==s.RUNNING?console.warn("Cannot pause non-running Scene",e.key):this.settings.active&&(e.status=s.PAUSED,e.active=!1,this.events.emit(a.PAUSE,this,t)),this},resume:function(t){var e=this.events,i=this.settings;return this.settings.active||(i.status=s.RUNNING,i.active=!0,e.emit(a.RESUME,this,t)),this},sleep:function(t){var e=this.settings,i=this.getStatus();return i!==s.CREATING&&i!==s.RUNNING?console.warn("Cannot sleep non-running Scene",e.key):(e.status=s.SLEEPING,e.active=!1,e.visible=!1,this.events.emit(a.SLEEP,this,t)),this},wake:function(t){var e=this.events,i=this.settings;return i.status=s.RUNNING,i.active=!0,i.visible=!0,e.emit(a.WAKE,this,t),i.isTransition&&e.emit(a.TRANSITION_WAKE,i.transitionFrom,i.transitionDuration),this},getData:function(){return this.settings.data},getStatus:function(){return this.settings.status},canInput:function(){var t=this.settings.status;return t>s.PENDING&&t<=s.RUNNING},isSleeping:function(){return this.settings.status===s.SLEEPING},isActive:function(){return this.settings.status===s.RUNNING},isPaused:function(){return this.settings.status===s.PAUSED},isTransitioning:function(){return this.settings.isTransition||null!==this.scenePlugin._target},isTransitionOut:function(){return null!==this.scenePlugin._target&&this.scenePlugin._duration>0},isTransitionIn:function(){return this.settings.isTransition},isVisible:function(){return this.settings.visible},setVisible:function(t){return this.settings.visible=t,this},setActive:function(t,e){return t?this.resume(e):this.pause(e)},start:function(t){var e=this.events,i=this.settings;t&&(i.data=t),i.status=s.START,i.active=!0,i.visible=!0,e.emit(a.START,this),e.emit(a.READY,this,t)},shutdown:function(t){var e=this.events,i=this.settings;e.off(a.TRANSITION_INIT),e.off(a.TRANSITION_START),e.off(a.TRANSITION_COMPLETE),e.off(a.TRANSITION_OUT),i.status=s.SHUTDOWN,i.active=!1,i.visible=!1,e.emit(a.SHUTDOWN,this,t)},destroy:function(){var t=this.events,e=this.settings;e.status=s.DESTROYED,e.active=!1,e.visible=!1,t.emit(a.DESTROY,this),t.removeAllListeners();for(var i=["scene","game","anims","cache","plugins","registry","sound","textures","add","cameras","displayList","events","make","scenePlugin","updateList"],r=0;r=0;i--){var r=this.sounds[i];r.key===t&&(r.destroy(),this.sounds.splice(i,1),e++)}return e},pauseAll:function(){this.forEachActiveSound(function(t){t.pause()}),this.emit(a.PAUSE_ALL,this)},resumeAll:function(){this.forEachActiveSound(function(t){t.resume()}),this.emit(a.RESUME_ALL,this)},setListenerPosition:u,stopAll:function(){this.forEachActiveSound(function(t){t.stop()}),this.emit(a.STOP_ALL,this)},stopByKey:function(t){var e=0;return this.getAll(t).forEach(function(t){t.stop()&&e++}),e},isPlaying:function(t){var e,i=this.sounds.length-1;if(void 0===t){for(;i>=0;i--)if((e=this.sounds[i]).isPlaying)return!0}else for(;i>=0;i--)if((e=this.sounds[i]).key===t&&e.isPlaying)return!0;return!1},unlock:u,onBlur:u,onFocus:u,onGameBlur:function(){this.gameLostFocus=!0,this.pauseOnBlur&&this.onBlur()},onGameFocus:function(){this.gameLostFocus=!1,this.pauseOnBlur&&this.onFocus()},update:function(t,e){this.unlocked&&(this.unlocked=!1,this.locked=!1,this.emit(a.UNLOCKED,this));for(var i=this.sounds.length-1;i>=0;i--)this.sounds[i].pendingRemove&&this.sounds.splice(i,1);this.sounds.forEach(function(i){i.update(t,e)})},destroy:function(){this.game.events.off(o.BLUR,this.onGameBlur,this),this.game.events.off(o.FOCUS,this.onGameFocus,this),this.game.events.off(o.PRE_STEP,this.update,this),this.removeAllListeners(),this.removeAll(),this.sounds.length=0,this.sounds=null,this.listenerPosition=null,this.game=null},forEachActiveSound:function(t,e){var i=this;this.sounds.forEach(function(r,s){r&&!r.pendingRemove&&t.call(e||i,r,s,i.sounds)})},setRate:function(t){return this.rate=t,this},rate:{get:function(){return this._rate},set:function(t){this._rate=t,this.forEachActiveSound(function(t){t.calculateRate()}),this.emit(a.GLOBAL_RATE,this,t)}},setDetune:function(t){return this.detune=t,this},detune:{get:function(){return this._detune},set:function(t){this._detune=t,this.forEachActiveSound(function(t){t.calculateRate()}),this.emit(a.GLOBAL_DETUNE,this,t)}}});t.exports=c},14747(t,e,i){var r=i(33684),s=i(25960),n=i(57490),a={create:function(t){var e=t.config.audio,i=t.device.audio;return e.noAudio||!i.webAudio&&!i.audioData?new s(t):i.webAudio&&!e.disableWebAudio?new n(t):new r(t)}};t.exports=a},19723(t){t.exports="complete"},98882(t){t.exports="decodedall"},57506(t){t.exports="decoded"},73146(t){t.exports="destroy"},11305(t){t.exports="detune"},40577(t){t.exports="detune"},30333(t){t.exports="mute"},20394(t){t.exports="rate"},21802(t){t.exports="volume"},1299(t){t.exports="looped"},99190(t){t.exports="loop"},97125(t){t.exports="mute"},89259(t){t.exports="pan"},79986(t){t.exports="pauseall"},17586(t){t.exports="pause"},19618(t){t.exports="play"},42306(t){t.exports="rate"},10387(t){t.exports="resumeall"},48959(t){t.exports="resume"},9960(t){t.exports="seek"},19180(t){t.exports="stopall"},98328(t){t.exports="stop"},50401(t){t.exports="unlocked"},52498(t){t.exports="volume"},14463(t,e,i){t.exports={COMPLETE:i(19723),DECODED:i(57506),DECODED_ALL:i(98882),DESTROY:i(73146),DETUNE:i(11305),GLOBAL_DETUNE:i(40577),GLOBAL_MUTE:i(30333),GLOBAL_RATE:i(20394),GLOBAL_VOLUME:i(21802),LOOP:i(99190),LOOPED:i(1299),MUTE:i(97125),PAN:i(89259),PAUSE_ALL:i(79986),PAUSE:i(17586),PLAY:i(19618),RATE:i(42306),RESUME_ALL:i(10387),RESUME:i(48959),SEEK:i(9960),STOP_ALL:i(19180),STOP:i(98328),UNLOCKED:i(50401),VOLUME:i(52498)}},64895(t,e,i){var r=i(30341),s=i(83419),n=i(14463),a=i(45319),o=new s({Extends:r,initialize:function(t,e,i){if(void 0===i&&(i={}),this.tags=t.game.cache.audio.get(e),!this.tags)throw new Error('No cached audio asset with key "'+e);this.audio=null,this.startTime=0,this.previousTime=0,this.duration=this.tags[0].duration,this.totalDuration=this.tags[0].duration,r.call(this,t,e,i)},play:function(t,e){return!this.manager.isLocked(this,"play",[t,e])&&(!!r.prototype.play.call(this,t,e)&&(!!this.pickAndPlayAudioTag()&&(this.emit(n.PLAY,this),!0)))},pause:function(){return!this.manager.isLocked(this,"pause")&&(!(this.startTime>0)&&(!!r.prototype.pause.call(this)&&(this.currentConfig.seek=this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0),this.stopAndReleaseAudioTag(),this.emit(n.PAUSE,this),!0)))},resume:function(){return!this.manager.isLocked(this,"resume")&&(!(this.startTime>0)&&(!!r.prototype.resume.call(this)&&(!!this.pickAndPlayAudioTag()&&(this.emit(n.RESUME,this),!0))))},stop:function(){return!this.manager.isLocked(this,"stop")&&(!!r.prototype.stop.call(this)&&(this.stopAndReleaseAudioTag(),this.emit(n.STOP,this),!0))},pickAndPlayAudioTag:function(){if(!this.pickAudioTag())return this.reset(),!1;var t=this.currentConfig.seek,e=this.currentConfig.delay,i=(this.currentMarker?this.currentMarker.start:0)+t;return this.previousTime=i,this.audio.currentTime=i,this.applyConfig(),0===e?(this.startTime=0,this.audio.paused&&this.playCatchPromise()):(this.startTime=window.performance.now()+1e3*e,this.audio.paused||this.audio.pause()),this.resetConfig(),!0},pickAudioTag:function(){if(this.audio)return!0;for(var t=0;t0)this.startTime=i-this.manager.loopEndOffset?(this.audio.currentTime=e+Math.max(0,r-i),r=this.audio.currentTime):r=i)return this.reset(),this.stopAndReleaseAudioTag(),void this.emit(n.COMPLETE,this);this.previousTime=r}},destroy:function(){r.prototype.destroy.call(this),this.tags=null,this.audio&&this.stopAndReleaseAudioTag()},updateMute:function(){this.audio&&(this.audio.muted=this.currentConfig.mute||this.manager.mute)},updateVolume:function(){this.audio&&(this.audio.volume=a(this.currentConfig.volume*this.manager.volume,0,1))},calculateRate:function(){r.prototype.calculateRate.call(this),this.audio&&(this.audio.playbackRate=this.totalRate)},mute:{get:function(){return this.currentConfig.mute},set:function(t){this.currentConfig.mute=t,this.manager.isLocked(this,"mute",t)||(this.updateMute(),this.emit(n.MUTE,this,t))}},setMute:function(t){return this.mute=t,this},volume:{get:function(){return this.currentConfig.volume},set:function(t){this.currentConfig.volume=t,this.manager.isLocked(this,"volume",t)||(this.updateVolume(),this.emit(n.VOLUME,this,t))}},setVolume:function(t){return this.volume=t,this},rate:{get:function(){return this.currentConfig.rate},set:function(t){this.currentConfig.rate=t,this.manager.isLocked(this,n.RATE,t)||(this.calculateRate(),this.emit(n.RATE,this,t))}},setRate:function(t){return this.rate=t,this},detune:{get:function(){return this.currentConfig.detune},set:function(t){this.currentConfig.detune=t,this.manager.isLocked(this,n.DETUNE,t)||(this.calculateRate(),this.emit(n.DETUNE,this,t))}},setDetune:function(t){return this.detune=t,this},seek:{get:function(){return this.isPlaying?this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0):this.isPaused?this.currentConfig.seek:0},set:function(t){this.manager.isLocked(this,"seek",t)||this.startTime>0||(this.isPlaying||this.isPaused)&&(t=Math.min(Math.max(0,t),this.duration),this.isPlaying?(this.previousTime=t,this.audio.currentTime=t):this.isPaused&&(this.currentConfig.seek=t),this.emit(n.SEEK,this,t))}},setSeek:function(t){return this.seek=t,this},loop:{get:function(){return this.currentConfig.loop},set:function(t){this.currentConfig.loop=t,this.manager.isLocked(this,"loop",t)||(this.audio&&(this.audio.loop=t),this.emit(n.LOOP,this,t))}},setLoop:function(t){return this.loop=t,this},pan:{get:function(){return this.currentConfig.pan},set:function(t){this.currentConfig.pan=t,this.emit(n.PAN,this,t)}},setPan:function(t){return this.pan=t,this}});t.exports=o},33684(t,e,i){var r=i(85034),s=i(83419),n=i(14463),a=i(64895),o=new s({Extends:r,initialize:function(t){this.override=!0,this.audioPlayDelay=.1,this.loopEndOffset=.05,this.onBlurPausedSounds=[],this.locked="ontouchstart"in window,this.lockedActionsQueue=this.locked?[]:null,this._mute=!1,this._volume=1,r.call(this,t)},add:function(t,e){var i=new a(this,t,e);return this.sounds.push(i),i},unlock:function(){this.locked=!1;var t=this;if(this.game.cache.audio.entries.each(function(e,i){for(var r=0;r-1},setAll:function(t,e,i,s){return r.SetAll(this.list,t,e,i,s),this},each:function(t,e){for(var i=[null],r=2;r0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}}});t.exports=o},90330(t,e,i){var r=new(i(83419))({initialize:function(t){this.entries={},this.size=0,this.setAll(t)},setAll:function(t){if(Array.isArray(t))for(var e=0;e-1},isPending:function(t){return this._toProcess>0&&this._pending.indexOf(t)>-1},isDestroying:function(t){return this._destroy.indexOf(t)>-1},add:function(t){return this.checkQueue&&this.isActive(t)&&!this.isDestroying(t)||this.isPending(t)||(this._pending.push(t),this._toProcess++),t},remove:function(t){if(this.isPending(t)){var e=this._pending,i=e.indexOf(t);-1!==i&&e.splice(i,1)}else this.isActive(t)&&(this._destroy.push(t),this._toProcess++);return t},removeAll:function(){for(var t=this._active,e=this._destroy,i=t.length;i--;)e.push(t[i]),this._toProcess++;return this},update:function(){if(0===this._toProcess)return this._active;var t,e,i=this._destroy,r=this._active;for(t=0;t=t.minX&&e.maxY>=t.minY}function v(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(t,e,i,s,n){for(var a,o=[e,i];o.length;)(i=o.pop())-(e=o.pop())<=s||(a=e+Math.ceil((i-e)/s/2)*s,r(t,a,e,i,n),o.push(e,a,a,i))}s.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],r=this.toBBox;if(!m(t,e))return i;for(var s,n,a,o,h=[];e;){for(s=0,n=e.children.length;s=0&&n[e].children.length>this._maxEntries;)this._split(n,e),e--;this._adjustParentBBoxes(s,n,e)},_split:function(t,e){var i=t[e],r=i.children.length,s=this._minEntries;this._chooseSplitAxis(i,s,r);var n=this._chooseSplitIndex(i,s,r),o=v(i.children.splice(n,i.children.length-n));o.height=i.height,o.leaf=i.leaf,a(i,this.toBBox),a(o,this.toBBox),e?t[e-1].children.push(o):this._splitRoot(i,o)},_splitRoot:function(t,e){this.data=v([t,e]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var r,s,n,a,h,l,u,c;for(l=u=1/0,r=e;r<=i-e;r++)a=p(s=o(t,0,r,this.toBBox),n=o(t,r,i,this.toBBox)),h=d(s)+d(n),a=e;s--)n=t.children[s],h(u,t.leaf?a(n):n),d+=c(u);return d},_adjustParentBBoxes:function(t,e,i){for(var r=i;r>=0;r--)h(e[r],t)},_condense:function(t){for(var e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():a(t[i],this.toBBox)},compareMinX:function(t,e){return t.left-e.left},compareMinY:function(t,e){return t.top-e.top},toBBox:function(t){return{minX:t.left,minY:t.top,maxX:t.right,maxY:t.bottom}}},t.exports=s},86555(t,e,i){var r=i(45319),s=i(83419),n=i(56583),a=i(26099),o=new s({initialize:function(t,e,i,r){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===r&&(r=null),this._width=t,this._height=e,this._parent=r,this.aspectMode=i,this.aspectRatio=0===e?1:t/e,this.minWidth=0,this.minHeight=0,this.maxWidth=Number.MAX_VALUE,this.maxHeight=Number.MAX_VALUE,this.snapTo=new a},setAspectMode:function(t){return void 0===t&&(t=0),this.aspectMode=t,this.setSize(this._width,this._height)},setSnap:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.snapTo.set(t,e),this.setSize(this._width,this._height)},setParent:function(t){return this._parent=t,this.setSize(this._width,this._height)},setMin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.minWidth=r(t,0,this.maxWidth),this.minHeight=r(e,0,this.maxHeight),this.setSize(this._width,this._height)},setMax:function(t,e){return void 0===t&&(t=Number.MAX_VALUE),void 0===e&&(e=t),this.maxWidth=r(t,this.minWidth,Number.MAX_VALUE),this.maxHeight=r(e,this.minHeight,Number.MAX_VALUE),this.setSize(this._width,this._height)},setSize:function(t,e){switch(void 0===t&&(t=0),void 0===e&&(e=t),this.aspectMode){case o.NONE:this._width=this.getNewWidth(n(t,this.snapTo.x)),this._height=this.getNewHeight(n(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height;break;case o.WIDTH_CONTROLS_HEIGHT:this._width=this.getNewWidth(n(t,this.snapTo.x)),this._height=this.getNewHeight(this._width*(1/this.aspectRatio),!1);break;case o.HEIGHT_CONTROLS_WIDTH:this._height=this.getNewHeight(n(e,this.snapTo.y)),this._width=this.getNewWidth(this._height*this.aspectRatio,!1);break;case o.FIT:this.constrain(t,e,!0);break;case o.ENVELOP:this.constrain(t,e,!1)}return this},setAspectRatio:function(t){return this.aspectRatio=t,this.setSize(this._width,this._height)},resize:function(t,e){return this._width=this.getNewWidth(n(t,this.snapTo.x)),this._height=this.getNewHeight(n(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height,this},getNewWidth:function(t,e){return void 0===e&&(e=!0),t=r(t,this.minWidth,this.maxWidth),e&&this._parent&&t>this._parent.width&&(t=Math.max(this.minWidth,this._parent.width)),t},getNewHeight:function(t,e){return void 0===e&&(e=!0),t=r(t,this.minHeight,this.maxHeight),e&&this._parent&&t>this._parent.height&&(t=Math.max(this.minHeight,this._parent.height)),t},constrain:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=!0),t=this.getNewWidth(t),e=this.getNewHeight(e);var r=this.snapTo,s=0===e?1:t/e;return i&&this.aspectRatio>s||!i&&this.aspectRatio0&&(t=(e=n(e,r.y))*this.aspectRatio)):(i&&this.aspectRatios)&&(t=(e=n(e,r.y))*this.aspectRatio,r.x>0&&(e=(t=n(t,r.x))*(1/this.aspectRatio))),this._width=t,this._height=e,this},fitTo:function(t,e){return this.constrain(t,e,!0)},envelop:function(t,e){return this.constrain(t,e,!1)},setWidth:function(t){return this.setSize(t,this._height)},setHeight:function(t){return this.setSize(this._width,t)},toString:function(){return"[{ Size (width="+this._width+" height="+this._height+" aspectRatio="+this.aspectRatio+" aspectMode="+this.aspectMode+") }]"},setCSS:function(t){t&&t.style&&(t.style.width=this._width+"px",t.style.height=this._height+"px")},copy:function(t){return t.setAspectMode(this.aspectMode),t.aspectRatio=this.aspectRatio,t.setSize(this.width,this.height)},destroy:function(){this._parent=null,this.snapTo=null},width:{get:function(){return this._width},set:function(t){this.setSize(t,this._height)}},height:{get:function(){return this._height},set:function(t){this.setSize(this._width,t)}}});o.NONE=0,o.WIDTH_CONTROLS_HEIGHT=1,o.HEIGHT_CONTROLS_WIDTH=2,o.FIT=3,o.ENVELOP=4,t.exports=o},15238(t){t.exports="add"},56187(t){t.exports="remove"},82348(t,e,i){t.exports={PROCESS_QUEUE_ADD:i(15238),PROCESS_QUEUE_REMOVE:i(56187)}},41392(t,e,i){t.exports={Events:i(82348),List:i(73162),Map:i(90330),ProcessQueue:i(25774),RTree:i(59542),Size:i(86555)}},57382(t,e,i){var r=i(83419),s=i(45319),n=i(40987),a=i(8054),o=i(50030),h=i(79237),l=new r({Extends:h,initialize:function(t,e,i,r,s){h.call(this,t,e,i,r,s),this.add("__BASE",0,0,0,r,s),this._source=this.frames.__BASE.source,this.canvas=this._source.image,this.context=this.canvas.getContext("2d",{willReadFrequently:!0}),this.width=r,this.height=s,this.imageData=this.context.getImageData(0,0,r,s),this.data=null,this.imageData&&(this.data=this.imageData.data),this.pixels=null,this.buffer,this.data&&(this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data)},update:function(){return this.imageData=this.context.getImageData(0,0,this.width,this.height),this.data=this.imageData.data,this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data,this.manager.game.config.renderType===a.WEBGL&&this.refresh(),this},draw:function(t,e,i,r){return void 0===r&&(r=!0),this.context.drawImage(i,t,e),r&&this.update(),this},drawFrame:function(t,e,i,r,s){void 0===i&&(i=0),void 0===r&&(r=0),void 0===s&&(s=!0);var n=this.manager.getFrame(t,e);if(n){var a=n.canvasData,o=n.cutWidth,h=n.cutHeight,l=n.source.resolution;this.context.drawImage(n.source.image,a.x,a.y,o,h,i,r,o/l,h/l),s&&this.update()}return this},setPixel:function(t,e,i,r,s,n){if(void 0===n&&(n=255),t=Math.abs(Math.floor(t)),e=Math.abs(Math.floor(e)),this.getIndex(t,e)>-1){var a=this.context.getImageData(t,e,1,1);a.data[0]=i,a.data[1]=r,a.data[2]=s,a.data[3]=n,this.context.putImageData(a,t,e)}return this},putData:function(t,e,i,r,s,n,a){return void 0===r&&(r=0),void 0===s&&(s=0),void 0===n&&(n=t.width),void 0===a&&(a=t.height),this.context.putImageData(t,e,i,r,s,n,a),this},getData:function(t,e,i,r){return t=s(Math.floor(t),0,this.width-1),e=s(Math.floor(e),0,this.height-1),i=s(i,1,this.width-t),r=s(r,1,this.height-e),this.context.getImageData(t,e,i,r)},getPixel:function(t,e,i){i||(i=new n);var r=this.getIndex(t,e);if(r>-1){var s=this.data,a=s[r+0],o=s[r+1],h=s[r+2],l=s[r+3];i.setTo(a,o,h,l)}return i},getPixels:function(t,e,i,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===r&&(r=i),t=Math.abs(Math.round(t)),e=Math.abs(Math.round(e));for(var a=s(t,0,this.width),o=s(t+i,0,this.width),h=s(e,0,this.height),l=s(e+r,0,this.height),u=new n,d=[],c=h;ca.width&&(t=a.width-r.cutX),r.cutY+e>a.height&&(e=a.height-r.cutY),r.setSize(t,e,r.cutX,r.cutY)}return this},render:function(){if(0!==this.commandBuffer.length)return this.camera.preRender(),this.renderer.type===o.WEBGL&&this._renderWebGL(),this.renderer.type===o.CANVAS&&this._renderCanvas(),this},_renderWebGL:function(){this.renderer.renderNodes.getNode("DynamicTextureHandler").run(this)},_renderCanvas:function(){var t,e,i,s,n,a,o,h,l,u,d,c,p,g,m,v=this.camera,y=this.context,x=this.renderer,T=this.manager;x.setContext(y);for(var w=this.commandBuffer,b=w.length,S=!1,C=!1,E=0;E>24&255)/255;var _=A>>16&255,M=A>>8&255,R=255&A;y.save(),y.globalCompositeOperation="source-over",y.fillStyle="rgba("+_+","+M+","+R+","+t+")",y.fillRect(g,m,p,n),y.restore();break;case f.STAMP:a=w[++E],s=w[++E],g=w[++E],m=w[++E],t=w[++E],c=w[++E],l=w[++E],u=w[++E],d=w[++E],o=w[++E],h=w[++E],e=w[++E],C&&(e=r.ERASE);var P=T.resetStamp(t,c);P.setPosition(g,m).setRotation(l).setScale(u,d).setTexture(a,s).setOrigin(o,h).setBlendMode(e),P.renderCanvas(x,P,v,null);break;case f.REPEAT:a=w[++E],s=w[++E],g=w[++E],m=w[++E],t=w[++E],c=w[++E],l=w[++E],u=w[++E],d=w[++E],o=w[++E],h=w[++E],e=w[++E],p=w[++E],n=w[++E];var O=w[++E],L=w[++E],F=w[++E],D=w[++E],I=w[++E];C&&(e=r.ERASE);var N=T.resetTileSprite(t,c);N.setPosition(g,m).setRotation(l).setScale(u,d).setTexture(a,s).setSize(p,n).setOrigin(o,h).setBlendMode(e).setTilePosition(O,L).setTileRotation(F).setTileScale(D,I),N.renderCanvas(x,N,v,null);break;case f.DRAW:var B=w[++E];if(g=w[++E],m=w[++E],void 0!==g){var k=B.x;B.x=g}if(void 0!==m){var U=B.y;B.y=m}C&&(i=B.blendMode,B.blendMode=r.ERASE),B.renderCanvas(x,B,v,null),void 0!==g&&(B.x=k),void 0!==m&&(B.y=U),C&&(B.blendMode=i);break;case f.SET_ERASE:C=!!w[++E];break;case f.PRESERVE:S=w[++E];break;case f.CALLBACK:(0,w[++E])();break;case f.CAPTURE:B=w[++E];var z=w[++E],Y=this.startCapture(B,z);B.renderCanvas(x,B,z.camera||v,Y.transform),this.finishCapture(B,Y)}}S||(w.length=0),x.setContext()},fill:function(t,e,i,r,s,n){void 0===e&&(e=1),void 0===i&&(i=0),void 0===r&&(r=0),void 0===s&&(s=this.width),void 0===n&&(n=this.height);var a=t>>16&255,o=t>>8&255,h=255&t,l=c.getTintFromFloats(a/255,o/255,h/255,e);return this.commandBuffer.push(f.FILL,l,i,r,s,n),this},clear:function(t,e,i,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===r&&(r=this.height),this.commandBuffer.push(f.CLEAR,t,e,i,r),this},stamp:function(t,e,i,r,s){void 0===i&&(i=0),void 0===r&&(r=0);var n=u(s,"alpha",1),a=u(s,"tint",16777215),o=u(s,"angle",0),h=u(s,"rotation",0),l=u(s,"scale",1),d=u(s,"scaleX",l),c=u(s,"scaleY",l),p=u(s,"originX",.5),g=u(s,"originY",.5),m=u(s,"blendMode",0);return 0!==o&&(h=o*Math.PI/180),this.commandBuffer.push(f.STAMP,t,e,i,r,n,a,h,d,c,p,g,m),this},erase:function(t,e,i,r,s){var n=this.commandBuffer,a=n.length;return n[a-2]!==f.SET_ERASE||n[a-1]?n.push(f.SET_ERASE,!0):n.length-=2,this.draw(t,e,i,r,s),n.push(f.SET_ERASE,!1),this},draw:function(t,e,i,r,s){Array.isArray(t)||(t=[t]);for(var n=t.length,a=0;aT||x.y>w)){var b=Math.max(x.x,e),S=Math.max(x.y,i),C=Math.min(x.r,T)-b,E=Math.min(x.b,w)-S;m=C,v=E,p=a?h+(u-(b-x.x)-C):h+(b-x.x),g=o?l+(d-(S-x.y)-E):l+(S-x.y),e=b,i=S,r=C,n=E}else p=0,g=0,m=0,v=0}else a&&(p=h+(u-e-r)),o&&(g=l+(d-i-n));var A=this.source.width,_=this.source.height;return t.u0=Math.max(0,p/A),t.v0=1-Math.max(0,g/_),t.u1=Math.min(1,(p+m)/A),t.v1=1-Math.min(1,(g+v)/_),t.x=e,t.y=i,t.cx=p,t.cy=g,t.cw=m,t.ch=v,t.width=r,t.height=n,t.flipX=a,t.flipY=o,t},updateCropUVs:function(t,e,i){return this.setCropUVs(t,t.x,t.y,t.width,t.height,e,i)},setUVs:function(t,e,i,r,s,n){var a=this.data.drawImage;return a.width=t,a.height=e,this.u0=i,this.v0=r,this.u1=s,this.v1=n,this},updateUVs:function(){var t=this.cutX,e=this.cutY,i=this.cutWidth,r=this.cutHeight,s=this.data.drawImage;s.width=i,s.height=r;var n=this.source.width,a=this.source.height;return this.u0=t/n,this.v0=1-e/a,this.u1=(t+i)/n,this.v1=1-(e+r)/a,this},updateUVsInverted:function(){var t=this.source.width,e=this.source.height;return this.u0=(this.cutX+this.cutHeight)/t,this.v0=1-this.cutY/e,this.u1=this.cutX/t,this.v1=1-(this.cutY+this.cutWidth)/e,this},clone:function(){var t=new a(this.texture,this.name,this.sourceIndex);return t.cutX=this.cutX,t.cutY=this.cutY,t.cutWidth=this.cutWidth,t.cutHeight=this.cutHeight,t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t.halfWidth=this.halfWidth,t.halfHeight=this.halfHeight,t.centerX=this.centerX,t.centerY=this.centerY,t.rotated=this.rotated,t.data=n(!0,t.data,this.data),t.updateUVs(),t},destroy:function(){this.texture=null,this.source=null,this.customData=null,this.data=null},glTexture:{get:function(){return this.source.glTexture}},realWidth:{get:function(){return this.data.sourceSize.w}},realHeight:{get:function(){return this.data.sourceSize.h}},radius:{get:function(){return this.data.radius}},trimmed:{get:function(){return this.data.trim}},scale9:{get:function(){return this.data.scale9}},is3Slice:{get:function(){return this.data.is3Slice}},canvasData:{get:function(){return this.data.drawImage}}});t.exports=a},79237(t,e,i){var r=i(83419),s=i(4327),n=i(11876),a='Texture "%s" has no frame "%s"',o=new r({initialize:function(t,e,i,r,s){Array.isArray(i)||(i=[i]),this.manager=t,this.key=e,this.source=[],this.dataSource=[],this.frames={},this.customData={},this.firstFrame="__BASE",this.frameTotal=0,this.smoothPixelArt=null;for(var a=0;an&&(n=h.cutX+h.cutWidth),h.cutY+h.cutHeight>a&&(a=h.cutY+h.cutHeight)}return{x:r,y:s,width:n-r,height:a-s}},getFrameNames:function(t){void 0===t&&(t=!1);var e=Object.keys(this.frames);if(!t){var i=e.indexOf("__BASE");-1!==i&&e.splice(i,1)}return e},getSourceImage:function(t){null!=t&&1!==this.frameTotal||(t="__BASE");var e=this.frames[t];return e?e.source.image:(console.warn(a,this.key,t),this.frames.__BASE.source.image)},getDataSourceImage:function(t){null!=t&&1!==this.frameTotal||(t="__BASE");var e,i=this.frames[t];return i?e=i.sourceIndex:(console.warn(a,this.key,t),e=this.frames.__BASE.sourceIndex),this.dataSource[e].image},setSource:function(t,e,i,r,s){void 0===e&&(e=0),void 0===i&&(i=!1),Array.isArray(t)||(t=[t]);for(var a=0;a0&&o.height>0&&l.drawImage(a.source.image,o.x,o.y,o.width,o.height,0,0,o.width,o.height),n=h.toDataURL(i,s),r.remove(h)}return n},addImage:function(t,e,i){var r=null;return this.checkKey(t)&&(r=this.create(t,e),v.Image(r,0),i&&r.setDataSource(i),this.emit(u.ADD,t,r),this.emit(u.ADD_KEY+t,r)),r},addGLTexture:function(t,e){var i=null;if(this.checkKey(t)){var r=e.width,s=e.height;(i=this.create(t,e,r,s)).add("__BASE",0,0,0,r,s),this.emit(u.ADD,t,i),this.emit(u.ADD_KEY+t,i)}return i},addCompressedTexture:function(t,e,i){var r=null;if(this.checkKey(t)){if((r=this.create(t,e)).add("__BASE",0,0,0,e.width,e.height),i){var s=function(t,e,i){Array.isArray(i.textures)||Array.isArray(i.frames)?v.JSONArray(t,e,i):v.JSONHash(t,e,i)};if(Array.isArray(i))for(var n=0;n=h.x&&t=h.y&&e=o.x&&t=o.y&&e>1),g=Math.max(1,g>>1),f+=m}return{mipmaps:c,width:h,height:l,internalFormat:o,compressed:!0,generateMipmap:!1}}console.warn("KTXParser - Only compressed formats supported")}},41942(t){t.exports=function(t,e){if(e&&e.frames&&e.pages){var i=t.source[0];t.add("__BASE",0,0,0,i.width,i.height);var r=e.frames;for(var s in r)if(r.hasOwnProperty(s)){var n=r[s],a=0|n.page;if(a>=t.source.length)console.warn('PCT atlas frame "'+s+'" references missing page '+a);else{var o=t.add(n.key||s,a,n.x,n.y,n.w,n.h);o?(n.trimmed&&o.setTrim(n.sourceW,n.sourceH,n.trimX,n.trimY,n.w,n.h),n.rotated&&(o.rotated=!0,o.updateUVsInverted())):console.warn("Invalid PCT atlas, frame already exists: "+s)}}return t.customData.pct={pages:e.pages,folders:e.folders},t}console.warn("Invalid PCT atlas data given")}},39620(t){var e={1:".png",2:".webp",3:".jpg",4:".jpeg",5:".gif"},i=function(t,e){for(var i=String(t);i.length0&&function(t){if(0===t.length)return!1;for(var e=0;e57)return!1}return!0}(s.substring(0,a))&&(n=i[parseInt(s.substring(0,a),10)],s=s.substring(a+1));var o=/~([1-5])$/.exec(s);if(o){var h=e[parseInt(o[1],10)];s=s.substring(0,s.length-2)+h}else r&&(s+=r);return n?n+"/"+s:s},s=function(t,s){var n="",a=/~([1-5])$/.exec(t);a&&(n=e[parseInt(a[1],10)],t=t.substring(0,t.length-2));for(var o=[],h=t.split(","),l=0;l=0)for(var c=u.substring(0,d),f=u.substring(d+1),p=f.indexOf("-"),g=f.substring(0,p),m=f.substring(p+1),v=parseInt(g,10),y=parseInt(m,10),x=g.length>1&&"0"===g.charAt(0)?g.length:0,T=v;T<=y;T++){var w=x>0?i(T,x):String(T);o.push(r(c+w,s,n))}else o.push(r(u,s,n))}return o};t.exports=function(t){if("string"!=typeof t||0===t.length)return console.warn("Invalid PCT file: empty or not a string"),null;var e=t.split("\n"),i=e[0];if(13===i.charCodeAt(i.length-1)&&(i=i.substring(0,i.length-1)),!i||0!==i.indexOf("PCT:"))return console.warn("Not a PCT file: missing PCT: header"),null;var n=i.substring(4),a=n.split("."),o=parseInt(a[0],10);if(isNaN(o)||o>1)return console.warn("Unsupported PCT version: "+n),null;for(var h=[],l=[],u={},d=0,c=null,f=1;f1};if(x.trimmed){var T=v[1].split(",");x.sourceW=parseInt(T[0],10),x.sourceH=parseInt(T[1],10),x.trimX=parseInt(T[2],10),x.trimY=parseInt(T[3],10)}c=x}else if("A:"===g){var w=p.indexOf("=",2);if(-1===w)continue;var b=r(p.substring(2,w),l,""),S=s(p.substring(w+1),l),C=u[b];if(C)for(var E=0;E>1),g=Math.max(1,g>>1),f+=v}return{mipmaps:c,width:h,height:l,internalFormat:s,compressed:!0,generateMipmap:!1}}},75549(t,e,i){var r=i(95540);t.exports=function(t,e,i,s,n,a,o){var h=r(o,"frameWidth",null),l=r(o,"frameHeight",h);if(null===h)throw new Error("TextureManager.SpriteSheet: Invalid frameWidth given.");var u=t.source[e];t.add("__BASE",e,0,0,u.width,u.height);var d=r(o,"startFrame",0),c=r(o,"endFrame",-1),f=r(o,"margin",0),p=r(o,"spacing",0),g=Math.floor((n-f+p)/(h+p))*Math.floor((a-f+p)/(l+p));0===g&&console.warn("SpriteSheet frame dimensions will result in zero frames for texture:",t.key),(d>g||d<-g)&&(d=0),d<0&&(d=g+d),(-1===c||c>g||cn&&(y=b-n),S>a&&(x=S-a),w>=d&&w<=c&&(t.add(T,e,i+m,s+v,h-y,l-x),T++),(m+=h+p)+h>n&&(m=f,v+=l+p)}return t}},47534(t,e,i){var r=i(95540);t.exports=function(t,e,i){var s=r(i,"frameWidth",null),n=r(i,"frameHeight",s);if(!s)throw new Error("TextureManager.SpriteSheetFromAtlas: Invalid frameWidth given.");var a=t.source[0];t.add("__BASE",0,0,0,a.width,a.height);var o,h=r(i,"startFrame",0),l=r(i,"endFrame",-1),u=r(i,"margin",0),d=r(i,"spacing",0),c=e.cutX,f=e.cutY,p=e.cutWidth,g=e.cutHeight,m=e.realWidth,v=e.realHeight,y=Math.floor((m-u+d)/(s+d)),x=Math.floor((v-u+d)/(n+d)),T=y*x,w=e.x,b=s-w,S=s-(m-p-w),C=e.y,E=n-C,A=n-(v-g-C);(h>T||h<-T)&&(h=0),h<0&&(h=T+h),-1!==l&&(T=h+(l+1));for(var _=u,M=u,R=0,P=0;P=this.firstgid&&tthis.right||e>this.bottom)},copy:function(t){return this.index=t.index,this.alpha=t.alpha,this.properties=a(t.properties),this.visible=t.visible,this.setFlip(t.flipX,t.flipY),this.tint=t.tint,this.rotation=t.rotation,this.collideUp=t.collideUp,this.collideDown=t.collideDown,this.collideLeft=t.collideLeft,this.collideRight=t.collideRight,this.collisionCallback=t.collisionCallback,this.collisionCallbackContext=t.collisionCallbackContext,this},getCollisionGroup:function(){return this.tileset?this.tileset.getTileCollisionGroup(this.index):null},getTileData:function(){return this.tileset?this.tileset.getTileData(this.index):null},getLeft:function(t){var e=this.tilemapLayer;return e?e.tileToWorldXY(this.x,this.y,void 0,t).x:this.x*this.baseWidth},getRight:function(t){var e=this.tilemapLayer;return e?this.getLeft(t)+this.width*e.scaleX:this.getLeft(t)+this.width},getTop:function(t){var e=this.tilemapLayer;return e?e.tileToWorldXY(this.x,this.y,void 0,t).y:this.y*this.baseWidth-(this.height-this.baseHeight)},getBottom:function(t){var e=this.tilemapLayer;return e?this.getTop(t)+this.height*e.scaleY:this.getTop(t)+this.height},getBounds:function(t,e){return void 0===e&&(e=new o),e.x=this.getLeft(t),e.y=this.getTop(t),e.width=this.getRight(t)-e.x,e.height=this.getBottom(t)-e.y,e},getCenterX:function(t){return(this.getLeft(t)+this.getRight(t))/2},getCenterY:function(t){return(this.getTop(t)+this.getBottom(t))/2},intersects:function(t,e,i,r){return!(i<=this.pixelX||r<=this.pixelY||t>=this.right||e>=this.bottom)},isInteresting:function(t,e){return t&&e?this.canCollide||this.hasInterestingFace:t?this.collides:!!e&&this.hasInterestingFace},resetCollision:function(t){(void 0===t&&(t=!0),this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,t)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},resetFaces:function(){return this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this},setCollision:function(t,e,i,r,s){(void 0===e&&(e=t),void 0===i&&(i=t),void 0===r&&(r=t),void 0===s&&(s=!0),this.collideLeft=t,this.collideRight=e,this.collideUp=i,this.collideDown=r,this.faceLeft=t,this.faceRight=e,this.faceTop=i,this.faceBottom=r,s)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},setCollisionCallback:function(t,e){return null===t?(this.collisionCallback=void 0,this.collisionCallbackContext=void 0):(this.collisionCallback=t,this.collisionCallbackContext=e),this},setSize:function(t,e,i,r){return void 0!==t&&(this.width=t),void 0!==e&&(this.height=e),void 0!==i&&(this.baseWidth=i),void 0!==r&&(this.baseHeight=r),this.updatePixelXY(),this},updatePixelXY:function(){var t=this.layer.orientation;if(t===n.ORTHOGONAL)this.pixelX=this.x*this.baseWidth,this.pixelY=this.y*this.baseHeight;else if(t===n.ISOMETRIC)this.pixelX=(this.x-this.y)*this.baseWidth*.5,this.pixelY=(this.x+this.y)*this.baseHeight*.5;else if(t===n.STAGGERED)this.pixelX=this.x*this.baseWidth+this.y%2*(this.baseWidth/2),this.pixelY=this.y*(this.baseHeight/2);else if(t===n.HEXAGONAL){var e,i,r=this.layer.staggerAxis,s=this.layer.staggerIndex,a=this.layer.hexSideLength;"y"===r?(i=(this.baseHeight-a)/2+a,this.pixelX="odd"===s?this.x*this.baseWidth+this.y%2*(this.baseWidth/2):this.x*this.baseWidth-this.y%2*(this.baseWidth/2),this.pixelY=this.y*i):"x"===r&&(e=(this.baseWidth-a)/2+a,this.pixelX=this.x*e,this.pixelY="odd"===s?this.y*this.baseHeight+this.x%2*(this.baseHeight/2):this.y*this.baseHeight-this.x%2*(this.baseHeight/2))}return this.right=this.pixelX+this.baseWidth,this.bottom=this.pixelY+this.baseHeight,this},destroy:function(){this.collisionCallback=void 0,this.collisionCallbackContext=void 0,this.properties=void 0},canCollide:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown||void 0!==this.collisionCallback}},collides:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown}},hasInterestingFace:{get:function(){return this.faceTop||this.faceBottom||this.faceLeft||this.faceRight}},tileset:{get:function(){var t=this.layer.tilemapLayer;if(t){var e=t.gidMap[this.index];if(e)return e}return null}},tilemapLayer:{get:function(){return this.layer.tilemapLayer}},tilemap:{get:function(){var t=this.tilemapLayer;return t?t.tilemap:null}}});t.exports=l},49075(t,e,i){var r=i(84101),s=i(83419),n=i(39506),a=i(80341),o=i(95540),h=i(14977),l=i(27462),u=i(91907),d=i(36305),c=i(19133),f=i(68287),p=i(23029),g=i(81086),m=i(44731),v=i(53180),y=i(20442),x=i(33629),T=new s({initialize:function(t,e){this.scene=t,this.tileWidth=e.tileWidth,this.tileHeight=e.tileHeight,this.width=e.width,this.height=e.height,this.orientation=e.orientation,this.renderOrder=e.renderOrder,this.format=e.format,this.version=e.version,this.properties=e.properties,this.widthInPixels=e.widthInPixels,this.heightInPixels=e.heightInPixels,this.imageCollections=e.imageCollections,this.images=e.images,this.layers=e.layers,this.tiles=e.tiles,this.tilesets=e.tilesets,this.objects=e.objects,this.currentLayerIndex=0,this.hexSideLength=e.hexSideLength;var i=this.orientation;this._convert={WorldToTileXY:g.GetWorldToTileXYFunction(i),WorldToTileX:g.GetWorldToTileXFunction(i),WorldToTileY:g.GetWorldToTileYFunction(i),TileToWorldXY:g.GetTileToWorldXYFunction(i),TileToWorldX:g.GetTileToWorldXFunction(i),TileToWorldY:g.GetTileToWorldYFunction(i),GetTileCorners:g.GetTileCornersFunction(i)}},setRenderOrder:function(t){var e=["right-down","left-down","right-up","left-up"];return"number"==typeof t&&(t=e[t]),e.indexOf(t)>-1&&(this.renderOrder=t),this},addTilesetImage:function(t,e,i,s,n,o,h,l){if(void 0===t)return null;null==e&&(e=t);var u=this.scene.sys.textures;if(!u.exists(e))return console.warn('Texture key "%s" not found',e),null;var d=u.get(e),c=this.getTilesetIndex(t);if(null===c&&this.format===a.TILED_JSON)return console.warn('Tilemap has no tileset "%s". Its tilesets are %o',t,this.tilesets),null;var f=this.tilesets[c];return f?((i||s)&&f.setTileSize(i,s),(n||o)&&f.setSpacing(n,o),f.setImage(d),f):(void 0===i&&(i=this.tileWidth),void 0===s&&(s=this.tileHeight),void 0===n&&(n=0),void 0===o&&(o=0),void 0===h&&(h=0),void 0===l&&(l={x:0,y:0}),(f=new x(t,h,i,s,n,o,void 0,void 0,l)).setImage(d),this.tilesets.push(f),this.tiles=r(this),f)},copy:function(t,e,i,r,s,n,a,o){return null!==(o=this.getLayer(o))?(g.Copy(t,e,i,r,s,n,a,o),this):null},createBlankLayer:function(t,e,i,r,s,n,a,o){if(void 0===i&&(i=0),void 0===r&&(r=0),void 0===s&&(s=this.width),void 0===n&&(n=this.height),void 0===a&&(a=this.tileWidth),void 0===o&&(o=this.tileHeight),null!==this.getLayerIndex(t))return console.warn("Invalid Tilemap Layer ID: "+t),null;for(var l,u=new h({name:t,tileWidth:a,tileHeight:o,width:s,height:n,orientation:this.orientation,hexSideLength:this.hexSideLength}),d=0;d1&&console.warn("TilemapGPULayer can only use one tileset. Using the first item given."),e=e[0]),a=new v(this.scene,this,n,e,i,r)):(a=new y(this.scene,this,n,e,i,r)).setRenderOrder(this.renderOrder),this.scene.sys.displayList.add(a),a)},createFromObjects:function(t,e,i){void 0===i&&(i=!0);var r=[],s=this.getObjectLayer(t);if(!s)return console.warn("createFromObjects: Invalid objectLayerName given: "+t),r;var a=new l(i?this.tilesets:void 0);Array.isArray(e)||(e=[e]);var h=s.objects;e.sortByY&&h.sort(function(t,e){return t.y>e.y?1:-1});for(var c=0;c-1&&this.putTileAt(e,n.x,n.y,i,n.tilemapLayer)}return r},removeTileAt:function(t,e,i,r,s){return void 0===i&&(i=!0),void 0===r&&(r=!0),null===(s=this.getLayer(s))?null:g.RemoveTileAt(t,e,i,r,s)},removeTileAtWorldXY:function(t,e,i,r,s,n){return void 0===i&&(i=!0),void 0===r&&(r=!0),null===(n=this.getLayer(n))?null:g.RemoveTileAtWorldXY(t,e,i,r,s,n)},renderDebug:function(t,e,i){return null===(i=this.getLayer(i))?null:(this.orientation===u.ORTHOGONAL&&g.RenderDebug(t,e,i),this)},renderDebugFull:function(t,e){for(var i=this.layers,r=0;r=0&&t<4&&(this._renderOrder=t),this},cull:function(t){return this.cullCallback(this.layer,t,this.culledTiles,this._renderOrder)},setSkipCull:function(t){return void 0===t&&(t=!0),this.skipCull=t,this},setCullPadding:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=1),this.cullPaddingX=t,this.cullPaddingY=e,this},setTint:function(t,e,i,r,s,n){void 0===t&&(t=16777215);return this.forEachTile(function(e){e.tint=t},this,e,i,r,s,n)},setTintMode:function(t,e,i,r,s,n){void 0===t&&(t=h.MULTIPLY);return this.forEachTile(function(e){e.tintMode=t},this,e,i,r,s,n)},destroy:function(t){this.culledTiles.length=0,this.cullCallback=null,o.prototype.destroy.call(this,t)}});t.exports=l},44731(t,e,i){var r=i(83419),s=i(78389),n=i(31401),a=i(95643),o=i(81086),h=i(26099),l=new r({Extends:a,Mixins:[n.Alpha,n.BlendMode,n.ComputedSize,n.Depth,n.ElapseTimer,n.Flip,n.GetBounds,n.Lighting,n.Mask,n.Origin,n.RenderNodes,n.Transform,n.Visible,n.ScrollFactor,s],initialize:function(t,e,i,r,s,n){a.call(this,e,t),this.isTilemap=!0,this.tilemap=i,this.layerIndex=r,this.layer=i.layers[r],this.layer.tilemapLayer=this,this.gidMap=[],this.tempVec=new h,this.collisionCategory=1,this.collisionMask=1,this.setAlpha(this.layer.alpha),this.setPosition(s,n),this.setOrigin(0,0),this.setSize(i.tileWidth*this.layer.width,i.tileHeight*this.layer.height)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(t,e){this.updateTimer(t,e)},calculateFacesAt:function(t,e){return o.CalculateFacesAt(t,e,this.layer),this},calculateFacesWithin:function(t,e,i,r){return o.CalculateFacesWithin(t,e,i,r,this.layer),this},createFromTiles:function(t,e,i,r,s){return o.CreateFromTiles(t,e,i,r,s,this.layer)},copy:function(t,e,i,r,s,n,a){return o.Copy(t,e,i,r,s,n,a,this.layer),this},fill:function(t,e,i,r,s,n){return o.Fill(t,e,i,r,s,n,this.layer),this},filterTiles:function(t,e,i,r,s,n,a){return o.FilterTiles(t,e,i,r,s,n,a,this.layer)},findByIndex:function(t,e,i){return o.FindByIndex(t,e,i,this.layer)},findTile:function(t,e,i,r,s,n,a){return o.FindTile(t,e,i,r,s,n,a,this.layer)},forEachTile:function(t,e,i,r,s,n,a){return o.ForEachTile(t,e,i,r,s,n,a,this.layer),this},getTileAt:function(t,e,i){return o.GetTileAt(t,e,i,this.layer)},getTileAtWorldXY:function(t,e,i,r){return o.GetTileAtWorldXY(t,e,i,r,this.layer)},getIsoTileAtWorldXY:function(t,e,i,r,s){void 0===i&&(i=!0);var n=this.tempVec;return o.IsometricWorldToTileXY(t,e,!0,n,s,this.layer,i),this.getTileAt(n.x,n.y,r)},getTilesWithin:function(t,e,i,r,s){return o.GetTilesWithin(t,e,i,r,s,this.layer)},getTilesWithinShape:function(t,e,i){return o.GetTilesWithinShape(t,e,i,this.layer)},getTilesWithinWorldXY:function(t,e,i,r,s,n){return o.GetTilesWithinWorldXY(t,e,i,r,s,n,this.layer)},hasTileAt:function(t,e){return o.HasTileAt(t,e,this.layer)},hasTileAtWorldXY:function(t,e,i){return o.HasTileAtWorldXY(t,e,i,this.layer)},putTileAt:function(t,e,i,r){return o.PutTileAt(t,e,i,r,this.layer)},putTileAtWorldXY:function(t,e,i,r,s){return o.PutTileAtWorldXY(t,e,i,r,s,this.layer)},putTilesAt:function(t,e,i,r){return o.PutTilesAt(t,e,i,r,this.layer),this},randomize:function(t,e,i,r,s){return o.Randomize(t,e,i,r,s,this.layer),this},removeTileAt:function(t,e,i,r){return o.RemoveTileAt(t,e,i,r,this.layer)},removeTileAtWorldXY:function(t,e,i,r,s){return o.RemoveTileAtWorldXY(t,e,i,r,s,this.layer)},renderDebug:function(t,e){return o.RenderDebug(t,e,this.layer),this},replaceByIndex:function(t,e,i,r,s,n){return o.ReplaceByIndex(t,e,i,r,s,n,this.layer),this},setCollision:function(t,e,i,r){return o.SetCollision(t,e,i,this.layer,r),this},setCollisionBetween:function(t,e,i,r){return o.SetCollisionBetween(t,e,i,r,this.layer),this},setCollisionByProperty:function(t,e,i){return o.SetCollisionByProperty(t,e,i,this.layer),this},setCollisionByExclusion:function(t,e,i){return o.SetCollisionByExclusion(t,e,i,this.layer),this},setCollisionFromCollisionGroup:function(t,e){return o.SetCollisionFromCollisionGroup(t,e,this.layer),this},setTileIndexCallback:function(t,e,i){return o.SetTileIndexCallback(t,e,i,this.layer),this},setTileLocationCallback:function(t,e,i,r,s,n){return o.SetTileLocationCallback(t,e,i,r,s,n,this.layer),this},shuffle:function(t,e,i,r){return o.Shuffle(t,e,i,r,this.layer),this},swapByIndex:function(t,e,i,r,s,n){return o.SwapByIndex(t,e,i,r,s,n,this.layer),this},tileToWorldX:function(t,e){return this.tilemap.tileToWorldX(t,e,this)},tileToWorldY:function(t,e){return this.tilemap.tileToWorldY(t,e,this)},tileToWorldXY:function(t,e,i,r){return this.tilemap.tileToWorldXY(t,e,i,r,this)},getTileCorners:function(t,e,i){return this.tilemap.getTileCorners(t,e,i,this)},weightedRandomize:function(t,e,i,r,s){return o.WeightedRandomize(e,i,r,s,t,this.layer),this},worldToTileX:function(t,e,i){return this.tilemap.worldToTileX(t,e,i,this)},worldToTileY:function(t,e,i){return this.tilemap.worldToTileY(t,e,i,this)},worldToTileXY:function(t,e,i,r,s){return this.tilemap.worldToTileXY(t,e,i,r,s,this)},destroy:function(t){void 0===t&&(t=!0),this.tilemap&&(this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),t&&this.tilemap.removeLayer(this),this.tilemap=void 0,this.layer=void 0,this.gidMap=[],this.tileset=[],a.prototype.destroy.call(this))}});t.exports=l},16153(t,e,i){var r=i(61340),s=new r,n=new r,a=new r;t.exports=function(t,e,i,r){var o=e.cull(i),h=o.length,l=i.alpha*e.alpha;if(!(0===h||l<=0)){n.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var u=t.currentContext,d=e.gidMap;u.save(),s.copyWithScrollFactorFrom(i.matrixCombined,i.scrollX,i.scrollY,e.scrollFactorX,e.scrollFactorY),r&&s.multiply(r),s.multiply(n,a),a.setToContext(u),(!t.antialias||e.scaleX>1||e.scaleY>1)&&(u.imageSmoothingEnabled=!1);for(var c=0;c=this.firstgid&&t>>1]).startTime)<=e&&h+s.duration>e)return s.tileid+this.firstgid;hi.width||e.height>i.height?this.updateTileData(e.width,e.height):this.updateTileData(i.width,i.height,i.x,i.y),this},setTileSize:function(t,e){return void 0!==t&&(this.tileWidth=t),void 0!==e&&(this.tileHeight=e),this.image&&this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},setSpacing:function(t,e){return void 0!==t&&(this.tileMargin=t),void 0!==e&&(this.tileSpacing=e),this.image&&this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},updateTileData:function(t,e,i,r){void 0===i&&(i=0),void 0===r&&(r=0);var s=(e-2*this.tileMargin+this.tileSpacing)/(this.tileHeight+this.tileSpacing),n=(t-2*this.tileMargin+this.tileSpacing)/(this.tileWidth+this.tileSpacing);s%1==0&&n%1==0||console.warn("Image tile area not tile size multiple in: "+this.name),s=Math.floor(s),n=Math.floor(n),this.rows=s,this.columns=n,this.total=s*n,this.texCoordinates.length=0;for(var a=this.tileMargin+i,o=this.tileMargin+r,h=0;h8388608)throw new Error("Tileset._animationDataTexture: too many animations - total number of animations plus animation frames is max 8388608, got "+f);var p=2*f,g=Math.min(p,4096),m=Math.ceil(p/4096),v=new Uint32Array(g*m),y=0,x=r.length;for(o=0;os.worldView.x+n.scaleX*i.tileWidth*(-a-.5)&&h.xs.worldView.y+n.scaleY*i.tileHeight*(-o-1)&&h.y=0;n--)for(s=r.width-1;s>=0;s--)if((a=r.data[n][s])&&a.index===t){if(o===e)return a;o+=1}}else for(n=0;na.width&&(i=Math.max(a.width-t,0)),e+s>a.height&&(s=Math.max(a.height-e,0));for(var u=[],d=e;d-1}return!1}},24152(t,e,i){var r=i(45091),s=new(i(26099));t.exports=function(t,e,i,n){n.tilemapLayer.worldToTileXY(t,e,!0,s,i);var a=s.x,o=s.y;return r(a,o,n)}},90454(t,e,i){var r=i(63448),s=i(56583);t.exports=function(t,e){var i,n,a,o,h=t.tilemapLayer.tilemap,l=t.tilemapLayer,u=Math.floor(h.tileWidth*l.scaleX),d=Math.floor(h.tileHeight*l.scaleY),c=t.hexSideLength;if("y"===t.staggerAxis){var f=(d-c)/2+c;i=s(e.worldView.x-l.x,u,0,!0)-l.cullPaddingX,n=r(e.worldView.right-l.x,u,0,!0)+l.cullPaddingX,a=s(e.worldView.y-l.y,f,0,!0)-l.cullPaddingY,o=r(e.worldView.bottom-l.y,f,0,!0)+l.cullPaddingY}else{var p=(u-c)/2+c;i=s(e.worldView.x-l.x,p,0,!0)-l.cullPaddingX,n=r(e.worldView.right-l.x,p,0,!0)+l.cullPaddingX,a=s(e.worldView.y-l.y,d,0,!0)-l.cullPaddingY,o=r(e.worldView.bottom-l.y,d,0,!0)+l.cullPaddingY}return{left:i,right:n,top:a,bottom:o}}},9474(t,e,i){var r=i(90454),s=i(32483);t.exports=function(t,e,i,n){void 0===i&&(i=[]),void 0===n&&(n=0),i.length=0;var a=t.tilemapLayer,o=r(t,e);return a.skipCull&&1===a.scrollFactorX&&1===a.scrollFactorY&&(o.left=0,o.right=t.width,o.top=0,o.bottom=t.height),s(t,o,n,i),i}},27229(t,e,i){var r=i(19951),s=i(26099),n=new s;t.exports=function(t,e,i,a){var o=a.baseTileWidth,h=a.baseTileHeight,l=a.tilemapLayer;l&&(o*=l.scaleX,h*=l.scaleY);var u,d,c=r(t,e,n,i,a),f=[],p=.5773502691896257;"y"===a.staggerAxis?(u=p*o,d=h/2):(u=o/2,d=p*h);for(var g=0;g<6;g++){var m=2*Math.PI*(.5-g)/6;f.push(new s(c.x+u*Math.cos(m),c.y+d*Math.sin(m)))}return f}},19951(t,e,i){var r=i(26099);t.exports=function(t,e,i,s,n){i||(i=new r);var a=n.baseTileWidth,o=n.baseTileHeight,h=n.tilemapLayer,l=0,u=0;h&&(s||(s=h.scene.cameras.main),l=h.x+s.scrollX*(1-h.scrollFactorX),u=h.y+s.scrollY*(1-h.scrollFactorY),a*=h.scaleX,o*=h.scaleY);var d,c,f=a/2,p=o/2,g=n.staggerAxis,m=n.staggerIndex;return"y"===g?(d=l+a*t+a,c=u+1.5*e*p+p,e%2==0&&("odd"===m?d-=f:d+=f)):"x"===g&&"odd"===m&&(d=l+1.5*t*f+f,c=u+o*t+o,t%2==0&&("odd"===m?c-=p:c+=p)),i.set(d,c)}},86625(t,e,i){var r=i(26099);t.exports=function(t,e,i,s,n,a){s||(s=new r);var o=a.baseTileWidth,h=a.baseTileHeight,l=a.tilemapLayer;l&&(n||(n=l.scene.cameras.main),t-=l.x+n.scrollX*(1-l.scrollFactorX),e-=l.y+n.scrollY*(1-l.scrollFactorY),o*=l.scaleX,h*=l.scaleY);var u,d,c,f,p,g=.5773502691896257,m=-.3333333333333333,v=.6666666666666666,y=o/2,x=h/2;"y"===a.staggerAxis?(c=g*(u=(t-y)/(g*o))+m*(d=(e-x)/x),f=0*u+v*d):(c=m*(u=(t-y)/y)+g*(d=(e-x)/(g*h)),f=v*u+0*d),p=-c-f;var T,w=Math.round(c),b=Math.round(f),S=Math.round(p),C=Math.abs(w-c),E=Math.abs(b-f),A=Math.abs(S-p);C>E&&C>A?w=-b-S:E>A&&(b=-w-S);var _=b;return T="odd"===a.staggerIndex?_%2==0?b/2+w:b/2+w-.5:_%2==0?b/2+w:b/2+w+.5,s.set(T,_)}},62991(t){t.exports=function(t,e,i){return t>=0&&t=0&&e=0;n--)(o=l[a][n])&&-1!==o.index&&o.visible&&0!==o.alpha&&(c||r(n,a,t,e))&&i.push(o);else if(2===s)for(a=p;a>=0;a--)for(n=0;n=0;a--)for(n=f;n>=0;n--)(o=l[a][n])&&-1!==o.index&&o.visible&&0!==o.alpha&&(c||r(n,a,t,e))&&i.push(o);return h.tilesDrawn=i.length,h.tilesTotal=u*d,i}},14127(t,e,i){var r=i(26099);t.exports=function(t,e,i,s,n){i||(i=new r);var a=n.baseTileWidth,o=n.baseTileHeight,h=n.tilemapLayer,l=0,u=0;h&&(s||(s=h.scene.cameras.main),l=h.x+s.scrollX*(1-h.scrollFactorX),a*=h.scaleX,u=h.y+s.scrollY*(1-h.scrollFactorY),o*=h.scaleY);var d=l+a/2*(t-e),c=u+(t+e)*(o/2);return i.set(d,c)}},96897(t,e,i){var r=i(26099);t.exports=function(t,e,i,s,n,a,o){s||(s=new r);var h=a.baseTileWidth,l=a.baseTileHeight,u=a.tilemapLayer;u&&(n||(n=u.scene.cameras.main),e-=u.y+n.scrollY*(1-u.scrollFactorY),l*=u.scaleY,t-=u.x+n.scrollX*(1-u.scrollFactorX),h*=u.scaleX);var d=h/2,c=l/2;o||(e-=l);var f=.5*((t-=d)/d+e/c),p=.5*(-t/d+e/c);return i&&(f=Math.floor(f),p=Math.floor(p)),s.set(f,p)}},71558(t,e,i){var r=i(23029),s=i(62991),n=i(72023),a=i(20576);t.exports=function(t,e,i,o,h){if(void 0===o&&(o=!0),!s(e,i,h))return null;var l,u=h.data[i][e],d=u&&u.collides;t instanceof r?(null===h.data[i][e]&&(h.data[i][e]=new r(h,t.index,e,i,h.tileWidth,h.tileHeight)),h.data[i][e].copy(t)):(l=t,null===h.data[i][e]?h.data[i][e]=new r(h,l,e,i,h.tileWidth,h.tileHeight):h.data[i][e].index=l);var c=h.data[i][e],f=-1!==h.collideIndexes.indexOf(c.index);if(-1===(l=t instanceof r?t.index:t))c.width=h.tileWidth,c.height=h.tileHeight;else{var p=h.tilemapLayer.tilemap,g=p.tiles[l][2],m=p.tilesets[g];c.width=m.tileWidth,c.height=m.tileHeight}return a(c,f),o&&d!==c.collides&&n(e,i,h),c}},26303(t,e,i){var r=i(71558),s=new(i(26099));t.exports=function(t,e,i,n,a,o){return o.tilemapLayer.worldToTileXY(e,i,!0,s,a,o),r(t,s.x,s.y,n,o)}},14051(t,e,i){var r=i(42573),s=i(71558);t.exports=function(t,e,i,n,a){if(void 0===n&&(n=!0),!Array.isArray(t))return null;Array.isArray(t[0])||(t=[t]);for(var o=t.length,h=t[0].length,l=0;l=d;s--)(a=o[n][s])&&-1!==a.index&&a.visible&&0!==a.alpha&&r.push(a);else if(2===i)for(n=p;n>=f;n--)for(s=d;o[n]&&s=f;n--)for(s=c;o[n]&&s>=d;s--)(a=o[n][s])&&-1!==a.index&&a.visible&&0!==a.alpha&&r.push(a);return u.tilesDrawn=r.length,u.tilesTotal=h*l,r}},57068(t,e,i){var r=i(20576),s=i(42573),n=i(9589);t.exports=function(t,e,i,a,o){void 0===e&&(e=!0),void 0===i&&(i=!0),void 0===o&&(o=!0),Array.isArray(t)||(t=[t]);for(var h=0;he)){for(var l=t;l<=e;l++)n(l,i,o);if(h)for(var u=0;u=t&&c.index<=e&&r(c,i)}a&&s(0,0,o.width,o.height,o)}}},75661(t,e,i){var r=i(20576),s=i(42573),n=i(9589);t.exports=function(t,e,i,a){void 0===e&&(e=!0),void 0===i&&(i=!0),Array.isArray(t)||(t=[t]);for(var o=0;o0&&r(o,t)}}e&&s(0,0,i.width,i.height,i)}},9589(t){t.exports=function(t,e,i){var r=i.collideIndexes.indexOf(t);e&&-1===r?i.collideIndexes.push(t):e||-1===r||i.collideIndexes.splice(r,1)}},20576(t){t.exports=function(t,e){e?t.setCollision(!0,!0,!0,!0,!1):t.resetCollision(!1)}},79583(t){t.exports=function(t,e,i,r){if("number"==typeof t)r.callbacks[t]=null!==e?{callback:e,callbackContext:i}:void 0;else for(var s=0,n=t.length;s-1?new s(o,f,d,u,a.tilesize,a.tilesize):e?null:new s(o,-1,d,u,a.tilesize,a.tilesize),h.push(c)}l.push(h),h=[]}o.data=l,i.push(o)}return i}},96483(t,e,i){var r=i(33629);t.exports=function(t){for(var e=[],i=[],s=0;so&&(o=e.layer[l].width),e.layer[l].height>h&&(h=e.layer[l].height);var u=new s({width:o,height:h,name:t,tileWidth:e.layer[0].tilesize,tileHeight:e.layer[0].tilesize,format:r.WELTMEISTER});return u.layers=n(e,i),u.tilesets=a(e),u}},52833(t,e,i){t.exports={ParseTileLayers:i(6656),ParseTilesets:i(96483),ParseWeltmeister:i(87021)}},57442(t,e,i){t.exports={FromOrientationString:i(6641),Parse:i(46177),Parse2DArray:i(2342),ParseCSV:i(82593),Impact:i(52833),Tiled:i(96761)}},51233(t,e,i){var r=i(79291);t.exports=function(t){for(var e,i,s,n,a,o=0;o>>0;return r}},84101(t,e,i){var r=i(33629);t.exports=function(t){var e,i,s=[];for(e=0;e0;)if(n.i>=n.layers.length){if(i.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}n=i.pop()}else{var a=n.layers[n.i];if(n.i++,"imagelayer"===a.type){var o=r(a,"offsetx",0)+r(a,"startx",0),h=r(a,"offsety",0)+r(a,"starty",0);e.push({name:n.name+a.name,image:a.image,x:n.x+o+a.x,y:n.y+h+a.y,alpha:n.opacity*a.opacity,visible:n.visible&&a.visible,properties:r(a,"properties",{})})}else if("group"===a.type){var l=s(t,a,n);i.push(n),n=l}}return e}},46594(t,e,i){var r=i(51233),s=i(84101),n=i(91907),a=i(62644),o=i(80341),h=i(6641),l=i(87010),u=i(12635),d=i(22611),c=i(28200),f=i(24619);t.exports=function(t,e,i){var p=a(e),g=new l({width:p.width,height:p.height,name:t,tileWidth:p.tilewidth,tileHeight:p.tileheight,orientation:h(p.orientation),format:o.TILED_JSON,version:p.version,properties:p.properties,renderOrder:p.renderorder,infinite:p.infinite});if(g.orientation===n.HEXAGONAL)if(g.hexSideLength=p.hexsidelength,g.staggerAxis=p.staggeraxis,g.staggerIndex=p.staggerindex,"y"===g.staggerAxis){var m=(g.tileHeight-g.hexSideLength)/2;g.widthInPixels=g.tileWidth*(g.width+.5),g.heightInPixels=g.height*(g.hexSideLength+m)+m}else{var v=(g.tileWidth-g.hexSideLength)/2;g.widthInPixels=g.width*(g.hexSideLength+v)+v,g.heightInPixels=g.tileHeight*(g.height+.5)}g.layers=c(p,i),g.images=u(p);var y=f(p);return g.tilesets=y.tilesets,g.imageCollections=y.imageCollections,g.objects=d(p),g.tiles=s(g),r(g),g}},52205(t,e,i){var r=i(18254),s=i(29920),n=function(t){return{x:t.x,y:t.y}},a=["id","name","type","rotation","properties","visible","x","y","width","height"];t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=0);var o=r(t,a);if(o.x+=e,o.y+=i,t.gid){var h=s(t.gid);o.gid=h.gid,o.flippedHorizontal=h.flippedHorizontal,o.flippedVertical=h.flippedVertical,o.flippedAntiDiagonal=h.flippedAntiDiagonal}else t.polyline?o.polyline=t.polyline.map(n):t.polygon?o.polygon=t.polygon.map(n):t.ellipse?o.ellipse=t.ellipse:t.text?o.text=t.text:t.point?o.point=!0:o.rectangle=!0;return o}},22611(t,e,i){var r=i(95540),s=i(52205),n=i(48700),a=i(79677);t.exports=function(t){for(var e=[],i=[],o=a(t);o.i0;)if(o.i>=o.layers.length){if(i.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}o=i.pop()}else{var h=o.layers[o.i];if(o.i++,h.opacity*=o.opacity,h.visible=o.visible&&h.visible,"objectgroup"===h.type){h.name=o.name+h.name;for(var l=o.x+r(h,"startx",0)+r(h,"offsetx",0),u=o.y+r(h,"starty",0)+r(h,"offsety",0),d=[],c=0;c0;)if(f.i>=f.layers.length){if(c.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}f=c.pop()}else{var p=f.layers[f.i];if(f.i++,"tilelayer"===p.type)if(p.compression)console.warn("TilemapParser.parseTiledJSON - Layer compression is unsupported, skipping layer '"+p.name+"'");else{if(p.encoding&&"base64"===p.encoding){if(p.chunks)for(var g=0;g0?((y=new u(m,v.gid,D,I,t.tilewidth,t.tileheight)).rotation=v.rotation,y.flipX=v.flipped,b[I][D]=y):(x=e?null:new u(m,-1,D,I,t.tilewidth,t.tileheight),b[I][D]=x),++S===M.width&&(O++,S=0)}}else{(m=new h({name:f.name+p.name,id:p.id,x:f.x+o(p,"offsetx",0)+p.x,y:f.y+o(p,"offsety",0)+p.y,width:p.width,height:p.height,tileWidth:t.tilewidth,tileHeight:t.tileheight,alpha:f.opacity*p.opacity,visible:f.visible&&p.visible,properties:o(p,"properties",[]),orientation:a(t.orientation)})).orientation===s.HEXAGONAL&&(m.hexSideLength=t.hexsidelength,m.staggerAxis=t.staggeraxis,m.staggerIndex=t.staggerindex,"y"===m.staggerAxis?(T=(m.tileHeight-m.hexSideLength)/2,m.widthInPixels=m.tileWidth*(m.width+.5),m.heightInPixels=m.height*(m.hexSideLength+T)+T):(w=(m.tileWidth-m.hexSideLength)/2,m.widthInPixels=m.width*(m.hexSideLength+w)+w,m.heightInPixels=m.tileHeight*(m.height+.5)));for(var N=[],B=0,k=p.data.length;B0?((y=new u(m,v.gid,S,b.length,t.tilewidth,t.tileheight)).rotation=v.rotation,y.flipX=v.flipped,N.push(y)):(x=e?null:new u(m,-1,S,b.length,t.tilewidth,t.tileheight),N.push(x)),++S===p.width&&(b.push(N),S=0,N=[])}m.data=b,d.push(m)}else if("group"===p.type){var U=n(t,p,f);c.push(f),f=U}}return d}},24619(t,e,i){var r=i(33629),s=i(16536),n=i(52205),a=i(57880);t.exports=function(t){for(var e,i=[],o=[],h=null,l=0;l1){var c=void 0,f=void 0;if(Array.isArray(u.tiles)){c=c||{},f=f||{};for(var p=0;p0){var n,a,o,h={},l={};if(Array.isArray(r.edgecolors))for(n=0;n0)throw new Error("TimerEvent infinite loop created via zero delay")}else e=new a(t);return this._pendingInsertion.push(e),e},delayedCall:function(t,e,i,r){return this.addEvent({delay:t,callback:e,args:i,callbackScope:r})},clearPendingEvents:function(){return this._pendingInsertion=[],this},removeEvent:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e-1&&this._active.splice(s,1),r.destroy()}for(i=0;i=r.delay)){var s=r.elapsed-r.delay;if(r.elapsed=r.delay,!r.hasDispatched&&r.callback&&(r.hasDispatched=!0,r.callback.apply(r.callbackScope,r.args)),r.repeatCount>0){if(r.repeatCount--,s>=r.delay)for(;s>=r.delay&&r.repeatCount>0;)r.callback&&r.callback.apply(r.callbackScope,r.args),s-=r.delay,r.repeatCount--;r.elapsed=s,r.hasDispatched=!1}else r.hasDispatched&&this._pendingRemoval.push(r)}}}},shutdown:function(){var t;for(t=0;t0||this.totalComplete>0)&&(0!==this.loop&&(-1===this.loop||this.loop>this.iteration)?(this.iteration++,this.reset(!0)):this.complete=!0),this.complete&&this.emit(h.COMPLETE,this)}},play:function(t){return void 0===t&&(t=!0),this.paused=!1,this.complete=!1,this.totalComplete=0,t&&this.reset(),this},pause:function(){this.paused=!0;for(var t=this.events,e=0;e0&&(i=e[e.length-1].time);for(var r=0;r0)throw new Error("TimerEvent infinite loop created via zero delay");return this},getProgress:function(){return this.elapsed/this.delay},getOverallProgress:function(){if(this.repeat>0){var t=this.delay+this.delay*this.repeat;return(this.elapsed+this.delay*(this.repeat-this.repeatCount))/t}return this.getProgress()},getRepeatCount:function(){return this.repeatCount},getElapsed:function(){return this.elapsed},getElapsedSeconds:function(){return.001*this.elapsed},getRemaining:function(){return this.delay-this.elapsed},getRemainingSeconds:function(){return.001*this.getRemaining()},getOverallRemaining:function(){return this.delay*(1+this.repeatCount)-this.elapsed},getOverallRemainingSeconds:function(){return.001*this.getOverallRemaining()},remove:function(t){void 0===t&&(t=!1),this.elapsed=this.delay,this.hasDispatched=!t,this.repeatCount=0},destroy:function(){this.callback=void 0,this.callbackScope=void 0,this.args=[]}});t.exports=n},35945(t){t.exports="complete"},89809(t,e,i){t.exports={COMPLETE:i(35945)}},90291(t,e,i){t.exports={Clock:i(33385),Events:i(89809),Timeline:i(96120),TimerEvent:i(94880)}},40382(t,e,i){var r=i(72905),s=i(83419),n=i(43491),a=i(88032),o=i(37277),h=i(44594),l=i(93109),u=i(8462),d=i(8357),c=i(43960),f=i(26012),p=new s({initialize:function(t){this.scene=t,this.events=t.sys.events,this.timeScale=1,this.paused=!1,this.processing=!1,this.tweens=[],this.time=0,this.startTime=0,this.nextTime=0,this.prevTime=0,this.maxLag=500,this.lagSkip=33,this.gap=1e3/240,this.events.once(h.BOOT,this.boot,this),this.events.on(h.START,this.start,this)},boot:function(){this.events.once(h.DESTROY,this.destroy,this)},start:function(){this.timeScale=1,this.paused=!1,this.startTime=Date.now(),this.prevTime=this.startTime,this.nextTime=this.gap,this.events.on(h.UPDATE,this.update,this),this.events.once(h.SHUTDOWN,this.shutdown,this)},create:function(t){Array.isArray(t)||(t=[t]);for(var e=[],i=0;i-1},existing:function(t){return this.has(t)||this.tweens.push(t.reset()),this},addCounter:function(t){var e=a(this,t);return this.tweens.push(e.reset()),e},stagger:function(t,e){return l(t,e)},setLagSmooth:function(t,e){return void 0===t&&(t=1/1e-8),void 0===e&&(e=0),this.maxLag=t,this.lagSkip=Math.min(e,this.maxLag),this},setFps:function(t){return void 0===t&&(t=240),this.gap=1e3/t,this.nextTime=1e3*this.time+this.gap,this},getDelta:function(t){var e=Date.now()-this.prevTime;e>this.maxLag&&(this.startTime+=e-this.lagSkip),this.prevTime+=e;var i=this.prevTime-this.startTime,r=i-this.nextTime,s=i-1e3*this.time;return r>0||t?(i/=1e3,this.time=i,this.nextTime+=r+(r>=this.gap?4:this.gap-r)):s=0,s},tick:function(){return this.step(!0),this},update:function(){this.paused||this.step(!1)},step:function(t){void 0===t&&(t=!1);var e=this.getDelta(t);if(!(e<=0)){var i,r;this.processing=!0;var s=[],n=this.tweens;for(i=0;i0){for(i=0;i-1&&(r.isPendingRemove()||r.isDestroyed())&&(n.splice(o,1),r.destroy())}s.length=0}this.processing=!1}},remove:function(t){return this.processing?t.setPendingRemoveState():(r(this.tweens,t),t.setRemovedState()),this},reset:function(t){return this.existing(t),t.seek(),t.setActiveState(),this},makeActive:function(t){return this.existing(t),t.setActiveState(),this},each:function(t,e){var i,r=[null];for(i=1;iE&&(E=M),C[A][_]=M}}}var R=o?r(o):null;return i=h?function(t,e,i,r){var s,n=0,o=r%y,h=Math.floor(r/y);if(o>=0&&o=0&&ht&&(this.loopCounter=t),this},remove:function(){return this.parent&&this.parent.remove(this),this},stop:function(){return!this.parent||this.isRemoved()||this.isPendingRemove()||this.isDestroyed()||(this.dispatchEvent(n.TWEEN_STOP,"onStop"),this.setPendingRemoveState()),this},updateLoopCountdown:function(t){this.countdown-=t,this.countdown<=0&&(this.setActiveState(),this.dispatchEvent(n.TWEEN_LOOP,"onLoop"))},updateStartCountdown:function(t){return this.countdown-=t,this.countdown<=0&&(this.hasStarted=!0,this.setActiveState(),this.dispatchEvent(n.TWEEN_START,"onStart"),t=0),t},updateCompleteDelay:function(t){this.countdown-=t,this.countdown<=0&&this.onCompleteHandler()},setCallback:function(t,e,i){return void 0===i&&(i=[]),this.callbacks.hasOwnProperty(t)&&(this.callbacks[t]={func:e,params:i}),this},setPendingState:function(){this.state=a.PENDING},setActiveState:function(){this.state=a.ACTIVE,this.hasStarted=!1},setLoopDelayState:function(){this.state=a.LOOP_DELAY},setCompleteDelayState:function(){this.state=a.COMPLETE_DELAY},setStartDelayState:function(){this.state=a.START_DELAY,this.countdown=this.startDelay,this.hasStarted=!1},setPendingRemoveState:function(){this.state=a.PENDING_REMOVE},setRemovedState:function(){this.state=a.REMOVED},setFinishedState:function(){this.state=a.FINISHED},setDestroyedState:function(){this.state=a.DESTROYED},isPending:function(){return this.state===a.PENDING},isActive:function(){return this.state===a.ACTIVE},isLoopDelayed:function(){return this.state===a.LOOP_DELAY},isCompleteDelayed:function(){return this.state===a.COMPLETE_DELAY},isStartDelayed:function(){return this.state===a.START_DELAY},isPendingRemove:function(){return this.state===a.PENDING_REMOVE},isRemoved:function(){return this.state===a.REMOVED},isFinished:function(){return this.state===a.FINISHED},isDestroyed:function(){return this.state===a.DESTROYED},destroy:function(){this.data&&this.data.forEach(function(t){t.destroy()}),this.removeAllListeners(),this.callbacks=null,this.data=null,this.parent=null,this.setDestroyedState()}});o.TYPES=["onActive","onComplete","onLoop","onPause","onRepeat","onResume","onStart","onStop","onUpdate","onYoyo"],t.exports=o},95042(t,e,i){var r=i(83419),s=i(842),n=i(86353),a=new r({initialize:function(t,e,i,r,s,n,a,o,h,l){this.tween=t,this.targetIndex=e,this.duration=r<=0?.01:r,this.totalDuration=0,this.delay=0,this.getDelay=i,this.yoyo=s,this.hold=n,this.repeat=a,this.repeatDelay=o,this.repeatCounter=0,this.flipX=h,this.flipY=l,this.progress=0,this.elapsed=0,this.state=0,this.isCountdown=!1},getTarget:function(){return this.tween.targets[this.targetIndex]},setTargetValue:function(t){void 0===t&&(t=this.current),this.tween.targets[this.targetIndex][this.key]=t},setCreatedState:function(){this.state=n.CREATED,this.isCountdown=!1},setDelayState:function(){this.state=n.DELAY,this.isCountdown=!0},setPendingRenderState:function(){this.state=n.PENDING_RENDER,this.isCountdown=!1},setPlayingForwardState:function(){this.state=n.PLAYING_FORWARD,this.isCountdown=!1},setPlayingBackwardState:function(){this.state=n.PLAYING_BACKWARD,this.isCountdown=!1},setHoldState:function(){this.state=n.HOLD_DELAY,this.isCountdown=!0},setRepeatState:function(){this.state=n.REPEAT_DELAY,this.isCountdown=!0},setCompleteState:function(){this.state=n.COMPLETE,this.isCountdown=!1},isCreated:function(){return this.state===n.CREATED},isDelayed:function(){return this.state===n.DELAY},isPendingRender:function(){return this.state===n.PENDING_RENDER},isPlayingForward:function(){return this.state===n.PLAYING_FORWARD},isPlayingBackward:function(){return this.state===n.PLAYING_BACKWARD},isHolding:function(){return this.state===n.HOLD_DELAY},isRepeating:function(){return this.state===n.REPEAT_DELAY},isComplete:function(){return this.state===n.COMPLETE},setStateFromEnd:function(t){this.yoyo?this.onRepeat(t,!0,!0):this.repeatCounter>0?this.onRepeat(t,!0,!1):this.setCompleteState()},setStateFromStart:function(t){this.repeatCounter>0?this.onRepeat(t,!1):this.setCompleteState()},reset:function(){var t=this.tween,e=t.totalTargets,i=this.targetIndex,r=t.targets[i],s=this.key;this.progress=0,this.elapsed=0,this.delay=this.getDelay(r,s,0,i,e,t),this.repeatCounter=-1===this.repeat?n.MAX:this.repeat,this.setPendingRenderState();var a=this.duration+this.hold;this.yoyo&&(a+=this.duration);var o=a+this.repeatDelay;this.totalDuration=this.delay+a,-1===this.repeat?(this.totalDuration+=o*n.MAX,t.isInfinite=!0):this.repeat>0&&(this.totalDuration+=o*this.repeat),this.totalDuration>t.duration&&(t.duration=this.totalDuration),this.delay0&&(this.elapsed=this.delay,this.setDelayState())},onRepeat:function(t,e,i){var r=this.tween,n=r.totalTargets,a=this.targetIndex,o=r.targets[a],h=this.key,l="texture"!==h;if(this.elapsed=t,this.progress=t/this.duration,this.flipX&&o.toggleFlipX(),this.flipY&&o.toggleFlipY(),l&&(e||i)&&(this.start=this.getStartValue(o,h,this.start,a,n,r)),i)return this.setPlayingBackwardState(),void this.dispatchEvent(s.TWEEN_YOYO,"onYoyo");this.repeatCounter--,l&&(this.end=this.getEndValue(o,h,this.start,a,n,r)),this.repeatDelay>0?(this.elapsed=this.repeatDelay-t,l&&(this.current=this.start,o[h]=this.current),this.setRepeatState()):(this.setPlayingForwardState(),this.dispatchEvent(s.TWEEN_REPEAT,"onRepeat"))},destroy:function(){this.tween=null,this.getDelay=null,this.setCompleteState()}});t.exports=a},69902(t){t.exports={targets:null,delay:0,duration:1e3,ease:"Power0",easeParams:null,hold:0,repeat:0,repeatDelay:0,yoyo:!1,flipX:!1,flipY:!1,persist:!1,interpolation:null}},81076(t){t.exports=["callbackScope","completeDelay","delay","duration","ease","easeParams","flipX","flipY","hold","interpolation","loop","loopDelay","onActive","onActiveParams","onComplete","onCompleteParams","onLoop","onLoopParams","onPause","onPauseParams","onRepeat","onRepeatParams","onResume","onResumeParams","onStart","onStartParams","onStop","onStopParams","onUpdate","onUpdateParams","onYoyo","onYoyoParams","paused","persist","props","repeat","repeatDelay","targets","yoyo"]},8462(t,e,i){var r=i(70402),s=i(83419),n=i(842),a=i(44603),o=i(39429),h=i(36383),l=i(86353),u=i(48177),d=i(42220),c=new s({Extends:r,initialize:function(t,e){r.call(this,t),this.targets=e,this.totalTargets=e.length,this.isSeeking=!1,this.isInfinite=!1,this.elapsed=0,this.totalElapsed=0,this.duration=0,this.progress=0,this.totalDuration=0,this.totalProgress=0,this.isNumberTween=!1},add:function(t,e,i,r,s,n,a,o,h,l,d,c,f,p,g,m){var v=new u(this,t,e,i,r,s,n,a,o,h,l,d,c,f,p,g,m);return this.totalData=this.data.push(v),v},addFrame:function(t,e,i,r,s,n,a,o,h,l){var u=new d(this,t,e,i,r,s,n,a,o,h,l);return this.totalData=this.data.push(u),u},getValue:function(t){void 0===t&&(t=0);var e=null;return this.data&&(e=this.data[t].current),e},hasTarget:function(t){return this.targets&&-1!==this.targets.indexOf(t)},updateTo:function(t,e,i){if(void 0===i&&(i=!1),"texture"!==t)for(var r=0;r0)this.elapsed=0,this.progress=0,this.loopCounter--,this.initTweenData(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.setLoopDelayState()):(this.setActiveState(),this.dispatchEvent(n.TWEEN_LOOP,"onLoop"));else{if(!(this.completeDelay>0))return this.onCompleteHandler(),!0;this.countdown=this.completeDelay,this.setCompleteDelayState()}return!1},onCompleteHandler:function(){this.progress=1,this.totalProgress=1,r.prototype.onCompleteHandler.call(this)},play:function(){return this.isDestroyed()?(console.warn("Cannot play destroyed Tween",this),this):((this.isPendingRemove()||this.isFinished())&&this.seek(),this.paused=!1,this.setActiveState(),this)},seek:function(t,e,i){if(void 0===t&&(t=0),void 0===e&&(e=16.6),void 0===i&&(i=!1),this.isDestroyed())return console.warn("Cannot seek destroyed Tween",this),this;i||(this.isSeeking=!0),this.reset(!0),this.initTweenData(!0),this.setActiveState(),this.dispatchEvent(n.TWEEN_ACTIVE,"onActive");var r=this.paused;if(this.paused=!1,t>0){for(var s=Math.floor(t/e),a=t-s*e,o=0;o0&&this.update(a)}return this.paused=r,this.isSeeking=!1,this},initTweenData:function(t){void 0===t&&(t=!1),this.duration=0,this.startDelay=h.MAX_SAFE_INTEGER;for(var e=this.data,i=0;i0?r+s+(r+a)*n:r+s},reset:function(t){return void 0===t&&(t=!1),this.elapsed=0,this.totalElapsed=0,this.progress=0,this.totalProgress=0,this.loopCounter=this.loop,-1===this.loop&&(this.isInfinite=!0,this.loopCounter=l.MAX),t||(this.initTweenData(),this.setActiveState(),this.dispatchEvent(n.TWEEN_ACTIVE,"onActive")),this},update:function(t){if(this.isPendingRemove()||this.isDestroyed())return!this.persist||(this.setFinishedState(),!1);if(this.paused||this.isFinished())return!1;if(t*=this.timeScale*this.parent.timeScale,this.isLoopDelayed())return this.updateLoopCountdown(t),!1;if(this.isCompleteDelayed())return this.updateCompleteDelay(t),!1;this.hasStarted||(this.startDelay-=t,this.startDelay<=0&&(this.hasStarted=!0,this.dispatchEvent(n.TWEEN_START,"onStart"),t=0));var e=!1;if(this.isActive())for(var i=this.data,r=0;r0&&!this.isStartDelayed()?this.setStartDelayState():this.setActiveState(),this},add:function(t){var e=this.parent.create(t);Array.isArray(e)||(e=[e]);for(var i=this.data,r=0;r0)this.loopCounter--,this.resetTweens(),this.loopDelay>0?(this.countdown=this.loopDelay,this.setLoopDelayState()):(this.setActiveState(),this.dispatchEvent(a.TWEEN_LOOP,"onLoop"));else{if(!(this.completeDelay>0))return this.onCompleteHandler(),!0;this.countdown=this.completeDelay,this.setCompleteDelayState()}return!1},play:function(){return this.isDestroyed()?(console.warn("Cannot play destroyed TweenChain",this),this):((this.isPendingRemove()||this.isPending())&&this.resetTweens(),this.paused=!1,this.startDelay>0&&!this.isStartDelayed()?this.setStartDelayState():this.setActiveState(),this)},resetTweens:function(){for(var t=this.data,e=this.totalData,i=0;i=d?(c=u-d,u=d,f=!0):u<0&&(u=0);var p=s(u/d,0,1);this.elapsed=u,this.progress=p,this.previous=this.current,h||(p=1-p);var g=this.ease(p);this.interpolation?this.current=this.interpolation(this.interpolationData,g):this.current=this.start+(this.end-this.start)*g,n[o]=this.current,f&&(h?(e.isNumberTween&&(this.current=this.end,n[o]=this.current),this.hold>0?(this.elapsed=this.hold,this.setHoldState()):this.setStateFromEnd(c)):(e.isNumberTween&&(this.current=this.start,n[o]=this.current),this.setStateFromStart(c))),this.dispatchEvent(a.TWEEN_UPDATE,"onUpdate")}return!this.isComplete()},dispatchEvent:function(t,e){var i=this.tween;if(!i.isSeeking){var r=i.targets[this.targetIndex],s=this.key,n=this.current,a=this.previous;i.emit(t,i,s,r,n,a);var o=i.callbacks[e];o&&o.func.apply(i.callbackScope,[i,r,s,n,a].concat(o.params))}},destroy:function(){r.prototype.destroy.call(this),this.getActiveValue=null,this.getEndValue=null,this.getStartValue=null,this.ease=null}});t.exports=o},42220(t,e,i){var r=i(95042),s=i(45319),n=i(83419),a=i(842),o=new n({Extends:r,initialize:function(t,e,i,s,n,a,o,h,l,u,d){r.call(this,t,e,n,a,!1,o,h,l,u,d),this.key="texture",this.startTexture=null,this.endTexture=i,this.startFrame=null,this.endFrame=s,this.yoyo=0!==h},reset:function(t){r.prototype.reset.call(this);var e=this.tween.targets[this.targetIndex];this.startTexture||(this.startTexture=e.texture.key,this.startFrame=e.frame.name),t&&e.setTexture(this.startTexture,this.startFrame)},update:function(t){var e=this.tween,i=this.targetIndex,r=e.targets[i];if(!r)return this.setCompleteState(),!1;if(this.isCountdown&&(this.elapsed-=t,this.elapsed<=0&&(this.elapsed=0,t=0,this.isDelayed()?this.setPendingRenderState():this.isRepeating()?(this.setPlayingForwardState(),this.dispatchEvent(a.TWEEN_REPEAT,"onRepeat")):this.isHolding()&&this.setStateFromEnd(0))),this.isPendingRender())return this.startTexture&&r.setTexture(this.startTexture,this.startFrame),this.setPlayingForwardState(),!0;var n=this.isPlayingForward(),o=this.isPlayingBackward();if(n||o){var h=this.elapsed,l=this.duration,u=0,d=!1;(h+=t)>=l?(u=h-l,h=l,d=!0):h<0&&(h=0);var c=s(h/l,0,1);this.elapsed=h,this.progress=c,d&&(n?(r.setTexture(this.endTexture,this.endFrame),this.hold>0?(this.elapsed=this.hold,this.setHoldState()):this.setStateFromEnd(u)):(r.setTexture(this.startTexture,this.startFrame),this.setStateFromStart(u))),this.dispatchEvent(a.TWEEN_UPDATE,"onUpdate")}return!this.isComplete()},dispatchEvent:function(t,e){var i=this.tween;if(!i.isSeeking){var r=i.targets[this.targetIndex],s=this.key;i.emit(t,i,s,r);var n=i.callbacks[e];n&&n.func.apply(i.callbackScope,[i,r,s].concat(n.params))}},destroy:function(){r.prototype.destroy.call(this),this.startTexture=null,this.endTexture=null,this.startFrame=null,this.endFrame=null}});t.exports=o},86353(t){t.exports={CREATED:0,DELAY:2,PENDING_RENDER:4,PLAYING_FORWARD:5,PLAYING_BACKWARD:6,HOLD_DELAY:7,REPEAT_DELAY:8,COMPLETE:9,PENDING:20,ACTIVE:21,LOOP_DELAY:22,COMPLETE_DELAY:23,START_DELAY:24,PENDING_REMOVE:25,REMOVED:26,FINISHED:27,DESTROYED:28,MAX:999999999999}},83419(t){function e(t,e,i){var r=i?t[e]:Object.getOwnPropertyDescriptor(t,e);return!i&&r.value&&"object"==typeof r.value&&(r=r.value),!(!r||!function(t){return!!t.get&&"function"==typeof t.get||!!t.set&&"function"==typeof t.set}(r))&&(void 0===r.enumerable&&(r.enumerable=!0),void 0===r.configurable&&(r.configurable=!0),r)}function i(t,e){var i=Object.getOwnPropertyDescriptor(t,e);return!!i&&(i.value&&"object"==typeof i.value&&(i=i.value),!1===i.configurable)}function r(t,r,s,a){for(var o in r)if(r.hasOwnProperty(o)){var h=e(r,o,s);if(!1!==h){if(i((a||t).prototype,o)){if(n.ignoreFinals)continue;throw new Error("cannot override final property '"+o+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,o,h)}else t.prototype[o]=r[o]}}function s(t,e){if(e){Array.isArray(e)||(e=[e]);for(var i=0;i0){var n=i-t.length;if(n<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.push(e),r&&r.call(s,e),e):null;for(var a=e.length-1;a>=0;)-1!==t.indexOf(e[a])&&e.splice(a,1),a--;if(0===(a=e.length))return null;i>0&&a>n&&(e.splice(n),a=n);for(var o=0;o0){var a=r-t.length;if(a<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.splice(i,0,e),s&&s.call(n,e),e):null;for(var o=e.length-1;o>=0;)-1!==t.indexOf(e[o])&&e.pop(),o--;if(0===(o=e.length))return null;r>0&&o>a&&(e.splice(a),o=a);for(var h=o-1;h>=0;h--){var l=e[h];t.splice(i,0,l),s&&s.call(n,l)}return e}},66905(t){t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&ie.length&&(n=e.length),i?(r=e[n-1][i],(s=e[n][i])-t<=t-r?e[n]:e[n-1]):(r=e[n-1],(s=e[n])-t<=t-r?s:r)}},43491(t){var e=function(t,i){void 0===i&&(i=[]);for(var r=0;r=0;a--)if(o=t[a],!e||e&&void 0===i&&o.hasOwnProperty(e)||e&&void 0!==i&&o[e]===i)return o;return null}},26546(t){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var r=e+Math.floor(Math.random()*(i-e));return void 0===t[r]?null:t[r]}},85835(t){t.exports=function(t,e,i){if(e===i)return t;var r=t.indexOf(e),s=t.indexOf(i);if(r<0||s<0)throw new Error("Supplied items must be elements of the same array");return r>s||(t.splice(r,1),s=t.indexOf(i),t.splice(s+1,0,e)),t}},83371(t){t.exports=function(t,e,i){if(e===i)return t;var r=t.indexOf(e),s=t.indexOf(i);if(r<0||s<0)throw new Error("Supplied items must be elements of the same array");return r0){var r=t[i-1],s=t.indexOf(r);t[i]=r,t[s]=e}return t}},69693(t){t.exports=function(t,e,i){var r=t.indexOf(e);if(-1===r||i<0||i>=t.length)throw new Error("Supplied index out of bounds");return r!==i&&(t.splice(r,1),t.splice(i,0,e)),e}},40853(t){t.exports=function(t,e){var i=t.indexOf(e);if(-1!==i&&i=e;s--)a?n.push(i+s.toString()+r):n.push(s);else for(s=t;s<=e;s++)a?n.push(i+s.toString()+r):n.push(s);return n}},593(t,e,i){var r=i(2284);t.exports=function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=null),void 0===i&&(i=1),null===e&&(e=t,t=0);for(var s=[],n=Math.max(r((e-t)/(i||1)),0),a=0;ae?1:0}var r=function(t,s,n,a,o){for(void 0===n&&(n=0),void 0===a&&(a=t.length-1),void 0===o&&(o=i);a>n;){if(a-n>600){var h=a-n+1,l=s-n+1,u=Math.log(h),d=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*d*(h-d)/h)*(l-h/2<0?-1:1),f=Math.max(n,Math.floor(s-l*d/h+c)),p=Math.min(a,Math.floor(s+(h-l)*d/h+c));r(t,s,f,p,o)}var g=t[s],m=n,v=a;for(e(t,n,s),o(t[a],g)>0&&e(t,n,a);m0;)v--}0===o(t[n],g)?e(t,n,v):e(t,++v,a),v<=s&&(n=v+1),s<=v&&(a=v-1)}};t.exports=r},88492(t,e,i){var r=i(35154),s=i(33680),n=function(t,e,i){for(var r=[],s=0;s=0;){var h=e[a];-1!==(n=t.indexOf(h))&&(r(t,n),o.push(h),i&&i.call(s,h)),a--}return o}},60248(t,e,i){var r=i(19133);t.exports=function(t,e,i,s){if(void 0===s&&(s=t),e<0||e>t.length-1)throw new Error("Index out of bounds");var n=r(t,e);return i&&i.call(s,n),n}},81409(t,e,i){var r=i(82011);t.exports=function(t,e,i,s,n){if(void 0===e&&(e=0),void 0===i&&(i=t.length),void 0===n&&(n=t),r(t,e,i)){var a=i-e,o=t.splice(e,a);if(s)for(var h=0;h=s||e>=i||i>s){if(r)throw new Error("Range Error: Values outside acceptable range");return!1}return!0}},89545(t){t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i>0&&(t.splice(i,1),t.unshift(e)),e}},17810(t,e,i){var r=i(82011);t.exports=function(t,e,i,s,n){if(void 0===s&&(s=0),void 0===n&&(n=t.length),r(t,s,n))for(var a=s;a0;e--){var i=Math.floor(Math.random()*(e+1)),r=t[e];t[e]=t[i],t[i]=r}return t}},90126(t){t.exports=function(t){var e=/\D/g;return t.sort(function(t,i){return parseInt(t.replace(e,""),10)-parseInt(i.replace(e,""),10)}),t}},19133(t){t.exports=function(t,e){if(!(e>=t.length)){for(var i=t.length-1,r=t[e],s=e;sl&&(n=l),a>l&&(a=l),o=s,h=n;;)if(o-1;n--)r[s][n]=t[n][s]}return r}},54915(t,e,i){t.exports={CheckMatrix:i(86922),MatrixToString:i(63362),ReverseColumns:i(92598),ReverseRows:i(21224),Rotate180:i(98717),RotateLeft:i(44657),RotateMatrix:i(37829),RotateRight:i(92632),Translate:i(69512),TransposeMatrix:i(2429)}},71334(t){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";t.exports=function(t,i){for(var r=new Uint8Array(t),s=r.length,n=i?"data:"+i+";base64,":"",a=0;a>2],n+=e[(3&r[a])<<4|r[a+1]>>4],n+=e[(15&r[a+1])<<2|r[a+2]>>6],n+=e[63&r[a+2]];return s%3==2?n=n.substring(0,n.length-1)+"=":s%3==1&&(n=n.substring(0,n.length-2)+"=="),n}},53134(t){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=new Uint8Array(256),r=0;r<64;r++)i[e.charCodeAt(r)]=r;t.exports=function(t){var e,r,s,n,a=(t=t.substr(t.indexOf(",")+1)).length,o=.75*a,h=0;"="===t[a-1]&&(o--,"="===t[a-2]&&o--);for(var l=new ArrayBuffer(o),u=new Uint8Array(l),d=0;d>4,u[h++]=(15&r)<<4|s>>2,u[h++]=(3&s)<<6|63&n;return l}},65839(t,e,i){t.exports={ArrayBufferToBase64:i(71334),Base64ToArrayBuffer:i(53134)}},91799(t,e,i){t.exports={Array:i(37105),Base64:i(65839),Objects:i(1183),String:i(31749),NOOP:i(29747),NULL:i(20242)}},41786(t){t.exports=function(t){var e={};for(var i in t)Array.isArray(t[i])?e[i]=t[i].slice(0):e[i]=t[i];return e}},62644(t){var e=function(t){var i,r,s;if("object"!=typeof t||null===t)return t;for(s in i=Array.isArray(t)?[]:{},t)r=t[s],i[s]=e(r);return i};t.exports=e},79291(t,e,i){var r=i(41212),s=function(){var t,e,i,n,a,o,h=arguments[0]||{},l=1,u=arguments.length,d=!1;for("boolean"==typeof h&&(d=h,h=arguments[1]||{},l=2),u===l&&(h=this,--l);l=(t=t.toString()).length)switch(r){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var n=Math.ceil((s=e-t.length)/2);t=new Array(s-n+1).join(i)+t+new Array(n+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t}},33628(t){t.exports=function(t,e){return 0===e?t.slice(1):t.slice(0,e)+t.slice(e+1)}},27671(t){t.exports=function(t){return t.split("").reverse().join("")}},45650(t){t.exports=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})}},35355(t){t.exports=function(t){return t&&t[0].toUpperCase()+t.slice(1)}},31749(t,e,i){t.exports={Format:i(27902),Pad:i(41836),RemoveAt:i(33628),Reverse:i(27671),UppercaseFirst:i(35355),UUID:i(45650)}}},e={};function i(r){var s=e[r];if(void 0!==s)return s.exports;var n=e[r]={exports:{}};return t[r](n,n.exports,i),n.exports}i.d=(t,e)=>{for(var r in e)i.o(e,r)&&!i.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var r={};i.d(r,{A4:()=>A,AB:()=>L,AQ:()=>C,Ae:()=>z,Aq:()=>k,Ay:()=>Q,B_:()=>f,CB:()=>W,Cu:()=>v,D7:()=>F,Dh:()=>T,En:()=>n,FE:()=>_,Fu:()=>B,M3:()=>j,NS:()=>q,O1:()=>D,PX:()=>Z,Q8:()=>Y,Qw:()=>a,SY:()=>V,Tm:()=>l,UP:()=>K,XT:()=>c,Xs:()=>d,Z5:()=>R,Zt:()=>y,_k:()=>P,aH:()=>b,dv:()=>g,gX:()=>I,gd:()=>o,ho:()=>O,iJ:()=>u,j$:()=>X,l2:()=>h,nl:()=>p,pd:()=>w,qt:()=>G,ry:()=>E,sV:()=>m,sx:()=>N,x3:()=>H,xS:()=>x,xv:()=>U,zA:()=>M,zU:()=>S}),i(63595);var s=i(8054);const n=i(61061),a=i(60421),o=i(10312),h=i(83388),l=i(26638),u=i(42857),d=i(83419),c=i(25410),f=i(44965),p=i(27460),g=i(84902),m=i(93055),v=i(11889),y=i(50127),x=i(77856),T=i(55738),w=i(14350),b=i(57777),S=i(75508),C=i(44563),E=i(18922),A=i(36909),_=i(93364),M=i(29795),R=i(97482),P=i(62194),O=i(41392),L=i(23717),F=i(27458),D=i(62501),I=i(90291),N=i(84322),B=i(43066),k=i(91799),U=s.VERSION,z=s.LOG_VERSION,Y=s.AUTO,X=s.CANVAS,W=s.WEBGL,G=s.HEADLESS,V=s.FOREVER,H=s.NONE,j=s.LEFT,q=s.RIGHT,K=s.UP,Z=s.DOWN,Q={Actions:n,Animations:a,BlendModes:o,Cache:h,Cameras:l,Core:u,Class:d,Curves:c,Data:f,Display:p,DOM:g,Events:m,Filters:v,Game:y,GameObjects:x,Geom:T,Input:w,Loader:b,Math:S,Physics:C,Plugins:E,Renderer:A,Scale:_,ScaleModes:M,Scene:R,Scenes:P,Structs:O,Sound:L,Textures:F,Tilemaps:D,Time:I,TintModes:N,Tweens:B,Utils:k,VERSION:U,LOG_VERSION:z,AUTO:Y,CANVAS:X,WEBGL:W,HEADLESS:G,FOREVER:V,NONE:H,LEFT:j,RIGHT:q,UP:K,DOWN:Z},J=r.Q8,$=r.En,tt=r.Qw,et=r.gd,it=r.j$,rt=r.l2,st=r.Tm,nt=r.Xs,at=r.iJ,ot=r.XT,ht=r.dv,lt=r.PX,ut=r.B_,dt=r.nl,ct=r.sV,ft=r.SY,pt=r.Cu,gt=r.Zt,mt=r.xS,vt=r.Dh,yt=r.qt,xt=r.pd,Tt=r.M3,wt=r.Ae,bt=r.aH,St=r.zU,Ct=r.x3,Et=r.AQ,At=r.ry,_t=r.NS,Mt=r.A4,Rt=r.FE,Pt=r.zA,Ot=r.Z5,Lt=r._k,Ft=r.AB,Dt=r.ho,It=r.D7,Nt=r.O1,Bt=r.gX,kt=r.sx,Ut=r.Fu,zt=r.UP,Yt=r.Aq,Xt=r.xv,Wt=r.CB,Gt=r.Ay;export{J as AUTO,$ as Actions,tt as Animations,et as BlendModes,it as CANVAS,rt as Cache,st as Cameras,nt as Class,at as Core,ot as Curves,ht as DOM,lt as DOWN,ut as Data,dt as Display,ct as Events,ft as FOREVER,pt as Filters,gt as Game,mt as GameObjects,vt as Geom,yt as HEADLESS,xt as Input,Tt as LEFT,wt as LOG_VERSION,bt as Loader,St as Math,Ct as NONE,Et as Physics,At as Plugins,_t as RIGHT,Mt as Renderer,Rt as Scale,Pt as ScaleModes,Ot as Scene,Lt as Scenes,Ft as Sound,Dt as Structs,It as Textures,Nt as Tilemaps,Bt as Time,kt as TintModes,Ut as Tweens,zt as UP,Yt as Utils,Xt as VERSION,Wt as WEBGL,Gt as default}; \ No newline at end of file +var t={7889(t,e,i){i.r(e),i.d(e,{Depth:()=>o,DepthDescriptors:()=>a,default:()=>h});var s=i(42969),r=i(37105),n=i.n(r);const a={_depth:0,depth:{get:function(){return this._depth},set:function(t){this.displayList&&this.displayList.queueDepthSort(),this._depth=t}},setDepth:function(t){return void 0===t&&(t=0),this.depth=t,this},setToTop:function(){const t=this.getDisplayList();return t&&n().BringToTop(t,this),this},setToBack:function(){const t=this.getDisplayList();return t&&n().SendToBack(t,this),this},setAbove:function(t){const e=this.getDisplayList();return e&&t&&n().MoveAbove(e,this,t),this},setBelow:function(t){const e=this.getDisplayList();return e&&t&&n().MoveBelow(e,this,t),this}},o=(0,s.lv)()(function(t){return(0,s.AD)(t,a),t}),h=o},36626(t,e,i){i.r(e),i.d(e,{Visible:()=>n,VisibleDescriptors:()=>r,default:()=>a});var s=i(42969);const r={_visible:!0,visible:{get:function(){return this._visible},set:function(t){t?(this._visible=!0,this.renderFlags|=1):(this._visible=!1,this.renderFlags&=-2)}},setVisible:function(t){return this.visible=t,this}},n=(0,s.lv)()(function(t){return(0,s.AD)(t,r),t}),a=n},18134(t,e,i){i.d(e,{default:()=>n});var s=i(70038);class r extends s.default{constructor(t,e,i,s){super(t,e),this.vx=0,this.vy=0,this.u=i,this.v=s}setUVs(t,e){return this.u=t,this.v=e,this}resize(t,e,i,s,r,n){return this.x=t,this.y=e,this.vx=this.x*i,this.vy=-this.y*s,r<.5?this.vx+=i*(.5-r):r>.5&&(this.vx-=i*(r-.5)),n<.5?this.vy+=s*(.5-n):n>.5&&(this.vy-=s*(n-.5)),this}}const n=r},58715(t,e,i){i.d(e,{default:()=>T});var s=i(10312),r=i.n(s),n=i(96503),a=i.n(n),o=i(87902),h=i.n(o),l=i(31401),u=i.n(l),d=i(59428),c=i(72488),f=i(36626),p=i(7889),g=i(42969),m=i(95643);const v=i.n(m)(),y=(0,g.fP)(f.Visible,p.Depth)(v);class x extends y{constructor(t,e,i,s=1,n=s){super(t,"Zone"),this.setPosition(e,i),this.width=s,this.height=n,this.blendMode=r().NORMAL,this.updateDisplayOrigin()}get displayWidth(){return this.scaleX*this.width}set displayWidth(t){this.scaleX=t/this.width}get displayHeight(){return this.scaleY*this.height}set displayHeight(t){this.scaleY=t/this.height}setSize(t,e,i=!0){this.width=t,this.height=e,this.updateDisplayOrigin();const s=this.input;return i&&s&&!s.customHitArea&&(s.hitArea.width=t,s.hitArea.height=e),this}setDisplaySize(t,e){return this.displayWidth=t,this.displayHeight=e,this}setCircleDropZone(t){return this.setDropZone(new(a())(0,0,t),h())}setRectangleDropZone(t,e){return this.setDropZone(new d.Rectangle(0,0,t,e),c.Contains)}setDropZone(t,e){return this.input||this.setInteractive(t,e,!0),this}setAlpha(){}setBlendMode(){}renderCanvas(t,e,i){i.addToRenderList(e)}renderWebGL(t,e,i){i.camera.addToRenderList(e)}}(0,g.AD)(x,u().GetBounds),(0,g.AD)(x,u().Origin),(0,g.AD)(x,u().ScrollFactor),(0,g.AD)(x,u().Transform);const T=x},72488(t,e,i){function s(t,e,i){return!(t.width<=0||t.height<=0)&&(t.x<=e&&t.x+t.width>=e&&t.y<=i&&t.y+t.height>=i)}i.r(e),i.d(e,{Contains:()=>s,default:()=>r});const r=s},59428(t,e,i){i.r(e),i.d(e,{Rectangle:()=>p,default:()=>g});var s=i(72488),r=i(20812),n=i.n(r),a=i(34819),o=i.n(a),h=i(23777),l=i.n(h),u=i(23031),d=i.n(u),c=i(26597),f=i.n(c);class p{constructor(t=0,e=0,i=0,s=0){this.type=l().RECTANGLE,this.x=t,this.y=e,this.width=i,this.height=s}contains(t,e){return(0,s.default)(this,t,e)}getPoint(t,e){return n()(this,t,e)}getPoints(t,e,i){return o()(this,t,e,i)}getRandomPoint(t){return f()(this,t)}setTo(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this}setEmpty(){return this.setTo(0,0,0,0)}setPosition(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this}setSize(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this}isEmpty(){return this.width<=0||this.height<=0}getLineA(t){return void 0===t&&(t=new(d())),t.setTo(this.x,this.y,this.right,this.y),t}getLineB(t){return void 0===t&&(t=new(d())),t.setTo(this.right,this.y,this.right,this.bottom),t}getLineC(t){return void 0===t&&(t=new(d())),t.setTo(this.right,this.bottom,this.x,this.bottom),t}getLineD(t){return void 0===t&&(t=new(d())),t.setTo(this.x,this.bottom,this.x,this.y),t}get left(){return this.x}set left(t){t>=this.right?this.width=0:this.width=this.right-t,this.x=t}get right(){return this.x+this.width}set right(t){t<=this.x?this.width=0:this.width=t-this.x}get top(){return this.y}set top(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}get bottom(){return this.y+this.height}set bottom(t){t<=this.y?this.height=0:this.height=t-this.y}get centerX(){return this.x+this.width/2}set centerX(t){this.x=t-this.width/2}get centerY(){return this.y+this.height/2}set centerY(t){this.y=t-this.height/2}}const g=p},350(t,e,i){i.d(e,{default:()=>s});const s=function(t,e,i){return Math.max(e,Math.min(i,t))}},70038(t,e,i){i.d(e,{default:()=>n});var s=i(30010);const r=class t{constructor(t,e){this.x=0,this.y=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0):(void 0===e&&(e=t),this.x=t||0,this.y=e||0)}clone(){return new t(this.x,this.y)}copy(t){return this.x=t.x||0,this.y=t.y||0,this}setFromObject(t){return this.x=t.x||0,this.y=t.y||0,this}set(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this}setTo(t,e){return this.set(t,e)}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}invert(){return this.set(this.y,this.x)}setToPolar(t,e){return null==e&&(e=1),this.x=Math.cos(t)*e,this.y=Math.sin(t)*e,this}equals(t){return this.x===t.x&&this.y===t.y}fuzzyEquals(t,e){return(0,s.default)(this.x,t.x,e)&&(0,s.default)(this.y,t.y,e)}angle(){let t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t}setAngle(t){return this.setToPolar(t,this.length())}add(t){return this.x+=t.x,this.y+=t.y,this}subtract(t){return this.x-=t.x,this.y-=t.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}scale(t){return isFinite(t)?(this.x*=t,this.y*=t):(this.x=0,this.y=0),this}divide(t){return this.x/=t.x,this.y/=t.y,this}negate(){return this.x=-this.x,this.y=-this.y,this}distance(t){const e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)}distanceSq(t){const e=t.x-this.x,i=t.y-this.y;return e*e+i*i}length(){const t=this.x,e=this.y;return Math.sqrt(t*t+e*e)}setLength(t){return this.normalize().scale(t)}lengthSq(){const t=this.x,e=this.y;return t*t+e*e}normalize(){const t=this.x,e=this.y;let i=t*t+e*e;return i>0&&(i=1/Math.sqrt(i),this.x=t*i,this.y=e*i),this}normalizeRightHand(){const t=this.x;return this.x=-1*this.y,this.y=t,this}normalizeLeftHand(){const t=this.x;return this.x=this.y,this.y=-1*t,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lerp(t,e=0){const i=this.x,s=this.y;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this}transformMat3(t){const e=this.x,i=this.y,s=t.val;return this.x=s[0]*e+s[3]*i+s[6],this.y=s[1]*e+s[4]*i+s[7],this}transformMat4(t){const e=this.x,i=this.y,s=t.val;return this.x=s[0]*e+s[4]*i+s[12],this.y=s[1]*e+s[5]*i+s[13],this}reset(){return this.x=0,this.y=0,this}limit(t){const e=this.length();return e&&e>t&&this.scale(t/e),this}reflect(t){const e=t.clone().normalize();return this.subtract(e.scale(2*this.dot(e)))}mirror(t){return this.reflect(t).negate()}rotate(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e*this.x-i*this.y,i*this.x+e*this.y)}project(t){const e=this.dot(t)/t.dot(t);return this.copy(t).scale(e)}projectUnit(e,i){void 0===i&&(i=new t);const s=this.x*e.x+this.y*e.y;return 0!==s&&(i.x=s*e.x,i.y=s*e.y),i}};r.ZERO=new r,r.RIGHT=new r(1,0),r.LEFT=new r(-1,0),r.UP=new r(0,-1),r.DOWN=new r(0,1),r.ONE=new r(1,1);const n=r},68077(t,e,i){i.d(e,{default:()=>s});const s=function(t,e,i){const s=i-e;return e+((t-e)%s+s)%s}},30010(t,e,i){i.d(e,{default:()=>s});const s=function(t,e,i=1e-4){return Math.abs(t-e)r});const r=class{constructor(t){this.entries={},this.size=0,this.setAll(t)}setAll(t){if(Array.isArray(t))for(let e=0;et.reduce((t,e)=>e(t),e)}i.d(e,{AD:()=>r,fP:()=>a,lv:()=>n})},50792(t){var e=Object.prototype.hasOwnProperty,i="~";function s(){}function r(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function n(t,e,s,n,a){if("function"!=typeof s)throw new TypeError("The listener must be a function");var o=new r(s,n||t,a),h=i?i+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],o]:t._events[h].push(o):(t._events[h]=o,t._eventsCount++),t}function a(t,e){0===--t._eventsCount?t._events=new s:delete t._events[e]}function o(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),(new s).__proto__||(i=!1)),o.prototype.eventNames=function(){var t,s,r=[];if(0===this._eventsCount)return r;for(s in t=this._events)e.call(t,s)&&r.push(i?s.slice(1):s);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},o.prototype.listeners=function(t){var e=i?i+t:t,s=this._events[e];if(!s)return[];if(s.fn)return[s.fn];for(var r=0,n=s.length,a=new Array(n);r3*Math.PI/2?p.y=1:l>Math.PI?(p.x=1,p.y=1):l>Math.PI/2&&(p.x=1);for(var g=[],m=0;m0&&u.enableFilters().filters.external.addBlur(e.blurQuality,e.blurRadius,e.blurRadius,1,void 0,e.blurSteps),d instanceof s&&d.enableFilters();var f=(e.useInternal?d.filters.internal:d.filters.external).addMask(u,e.invert);h.push(f)}return h}},11517(t,e,i){var s=i(38829);t.exports=function(t,e,i,r){for(var n=t[0],a=1;a=i;s--){var r=t[s],n=!0;for(var a in e)r[a]!==e[a]&&(n=!1);if(n)return r}return null}},94420(t,e,i){var s=i(11879),r=i(60461),n=i(95540),a=i(29747),o=new(i(41481))({sys:{queueDepthSort:a,events:{once:a}}},0,0,1,1).setOrigin(0,0);t.exports=function(t,e){void 0===e&&(e={});var i=e.hasOwnProperty("width"),a=e.hasOwnProperty("height"),h=n(e,"width",-1),l=n(e,"height",-1),u=n(e,"cellWidth",1),d=n(e,"cellHeight",u),c=n(e,"position",r.TOP_LEFT),f=n(e,"x",0),p=n(e,"y",0),g=0,m=0,v=h*u,y=l*d;o.setPosition(f,p),o.setSize(u,d);for(var x=0;x0?r(a,i):i<0&&n(a,Math.abs(i));for(var o=0;o=0;a--)t[a][e]+=i+o*s,o++;return t}},43967(t){t.exports=function(t,e,i,s,r,n){var a;void 0===s&&(s=0),void 0===r&&(r=0),void 0===n&&(n=1);var o=0,h=t.length;if(1===n)for(a=r;a=0;a--)t[a][e]=i+o*s,o++;return t}},88926(t,e,i){var s=i(28176);t.exports=function(t,e){for(var i=0;i=h||-1===l)){var c=t[l],f=c.x,p=c.y;c.x=a,c.y=o,a=f,o=p,0===r?l--:l++}}return n.x=a,n.y=o,n}},8628(t,e,i){var s=i(33680);t.exports=function(t){return s(t)}},21837(t,e,i){var s=i(7602);t.exports=function(t,e,i,r,n){void 0===n&&(n=!1);var a,o=Math.abs(r-i)/t.length;if(n)for(a=0;a0){if(0===t)this.frames=i.concat(this.frames);else if(t===this.frames.length)this.frames=this.frames.concat(i);else{var s=this.frames.slice(0,t),r=this.frames.slice(t);this.frames=s.concat(i,r)}this.updateFrameSequence()}return this},checkFrame:function(t){return t>=0&&t0){n.isLast=!0,n.nextFrame=d[0],d[0].prevFrame=n;var y=1/(d.length-1);for(a=0;a0?t.inReverse&&t.forward?t.forward=!1:this.repeatAnimation(t):t.complete():this.updateAndGetNextTick(t,e.nextFrame)},handleYoyoFrame:function(t,e){if(e||(e=!1),t.inReverse===!e&&t.repeatCounter>0)return(0===t.repeatDelay||t.pendingRepeat)&&(t.forward=e),void this.repeatAnimation(t);if(t.inReverse===e||0!==t.repeatCounter){t.forward=e;var i=e?t.currentFrame.nextFrame:t.currentFrame.prevFrame;this.updateAndGetNextTick(t,i)}else t.complete()},getLastFrame:function(){return this.frames[this.frames.length-1]},previousFrame:function(t){var e=t.currentFrame;e.isFirst?t.yoyo?this.handleYoyoFrame(t,!0):t.repeatCounter>0?(t.inReverse&&!t.forward||(t.forward=!0),this.repeatAnimation(t)):t.complete():this.updateAndGetNextTick(t,e.prevFrame)},updateAndGetNextTick:function(t,e){t.setCurrentFrame(e),this.getNextTick(t)},removeFrame:function(t){var e=this.frames.indexOf(t);return-1!==e&&this.removeFrameAt(e),this},removeFrameAt:function(t){return this.frames.splice(t,1),this.updateFrameSequence(),this},repeatAnimation:function(t){if(2===t._pendingStop){if(0===t._pendingStopValue)return t.stop();t._pendingStopValue--}t.repeatDelay>0&&!t.pendingRepeat?(t.pendingRepeat=!0,t.accumulator-=t.nextTick,t.nextTick+=t.repeatDelay):(t.repeatCounter--,t.forward?t.setCurrentFrame(t.currentFrame.nextFrame):t.setCurrentFrame(t.currentFrame.prevFrame),t.isPlaying&&(this.getNextTick(t),t.handleRepeat()))},toJSON:function(){var t={key:this.key,type:this.type,frames:[],frameRate:this.frameRate,duration:this.duration,skipMissedFrames:this.skipMissedFrames,delay:this.delay,repeat:this.repeat,repeatDelay:this.repeatDelay,yoyo:this.yoyo,showBeforeDelay:this.showBeforeDelay,showOnStart:this.showOnStart,randomFrame:this.randomFrame,hideOnComplete:this.hideOnComplete};return this.frames.forEach(function(e){t.frames.push(e.toJSON())}),t},updateFrameSequence:function(){for(var t,e=this.frames.length,i=1/(e-1),s=0;s1?(t.isLast=!0,t.prevFrame=this.frames[e-2],t.nextFrame=this.frames[0]):e>1&&(t.prevFrame=this.frames[s-1],t.nextFrame=this.frames[s+1]);return this},pause:function(){return this.paused=!0,this},resume:function(){return this.paused=!1,this},destroy:function(){this.manager.off&&(this.manager.off(n.PAUSE_ALL,this.pause,this),this.manager.off(n.RESUME_ALL,this.resume,this)),this.manager.remove(this.key);for(var t=0;t-1)){for(var p=0,g=u;g<=c;g++){var m=g.toString(),v=o[m];if(v){var y=l(v,"duration",d.MAX_SAFE_INTEGER);a.push({key:t,frame:m,duration:y}),p+=y}}"reverse"===f&&(a=a.reverse());var x,T={key:h,frames:a,duration:p,yoyo:"pingpong"===f};i?i.anims&&(x=i.anims.create(T)):x=n.create(T),x&&s.push(x)}});return s},create:function(t){var e=t.key,i=!1;return e&&((i=this.get(e))?console.warn("AnimationManager key already exists: "+e):(i=new s(this,e,t),this.anims.set(e,i),this.emit(o.ADD_ANIMATION,e,i))),i},fromJSON:function(t,e){void 0===e&&(e=!1),e&&this.anims.clear(),"string"==typeof t&&(t=JSON.parse(t));var i=[];if(t.hasOwnProperty("anims")&&Array.isArray(t.anims)){for(var s=0;sn&&(l=0),this.randomFrame&&(l=r(0,n-1));var u=s.frames[l];0!==l||this.forward||(u=s.getLastFrame()),this.currentFrame=u}else console.warn("Missing animation: "+i);return this.parent},pause:function(t){return this._paused||(this._paused=!0,this._wasPlaying=this.isPlaying,this.isPlaying=!1),void 0!==t&&this.setCurrentFrame(t),this.parent},resume:function(t){return this._paused&&(this._paused=!1,this.isPlaying=this._wasPlaying),void 0!==t&&this.setCurrentFrame(t),this.parent},playAfterDelay:function(t,e){if(this.isPlaying){var i=this.nextAnim,s=this.nextAnimsQueue;i&&s.unshift(i),this.nextAnim=t,this._pendingStop=1,this._pendingStopValue=e}else this.delayCounter=e,this.play(t,!0);return this.parent},playAfterRepeat:function(t,e){if(void 0===e&&(e=1),this.isPlaying){var i=this.nextAnim,s=this.nextAnimsQueue;i&&s.unshift(i),-1!==this.repeatCounter&&e>this.repeatCounter&&(e=this.repeatCounter),this.nextAnim=t,this._pendingStop=2,this._pendingStopValue=e}else this.play(t);return this.parent},play:function(t,e){void 0===e&&(e=!1);var i=this.currentAnim,s=this.parent,r="string"==typeof t?t:t.key;if(e&&this.isPlaying&&i.key===r)return s;if(i&&this.isPlaying){var n=this.animationManager.getMix(i.key,t);if(n>0)return this.playAfterDelay(t,n)}return this.forward=!0,this.inReverse=!1,this._paused=!1,this._wasPlaying=!0,this.startAnimation(t)},playReverse:function(t,e){void 0===e&&(e=!1);var i="string"==typeof t?t:t.key;return e&&this.isPlaying&&this.currentAnim.key===i?this.parent:(this.forward=!1,this.inReverse=!0,this._paused=!1,this._wasPlaying=!0,this.startAnimation(t))},startAnimation:function(t){this.load(t);var e=this.currentAnim,i=this.parent;return e?(this.repeatCounter=-1===this.repeat?Number.MAX_VALUE:this.repeat,e.getFirstTick(this),this.isPlaying=!0,this.pendingRepeat=!1,this.hasStarted=!1,this._pendingStop=0,this._pendingStopValue=0,this._paused=!1,this.delayCounter+=this.delay,0===this.delayCounter?this.handleStart():this.showBeforeDelay&&this.setCurrentFrame(this.currentFrame),i):i},handleStart:function(){this.showOnStart&&this.parent.setVisible(!0),this.setCurrentFrame(this.currentFrame),this.hasStarted=!0,this.emitEvents(o.ANIMATION_START)},handleRepeat:function(){this.pendingRepeat=!1,this.emitEvents(o.ANIMATION_REPEAT)},handleStop:function(){this._pendingStop=0,this.isPlaying=!1,this.emitEvents(o.ANIMATION_STOP)},handleComplete:function(){this._pendingStop=0,this.isPlaying=!1,this.hideOnComplete&&this.parent.setVisible(!1),this.emitEvents(o.ANIMATION_COMPLETE,o.ANIMATION_COMPLETE_KEY)},emitEvents:function(t,e){var i=this.currentAnim;if(i){var s=this.currentFrame,r=this.parent,n=s.textureFrame;r.emit(t,i,s,r,n),e&&r.emit(e+i.key,i,s,r,n)}},reverse:function(){return this.isPlaying&&(this.inReverse=!this.inReverse,this.forward=!this.forward),this.parent},getProgress:function(){var t=this.currentFrame;if(!t)return 0;var e=t.progress;return this.inReverse&&(e*=-1),e},setProgress:function(t){return this.forward||(t=1-t),this.setCurrentFrame(this.currentAnim.getFrameByProgress(t)),this.parent},setRepeat:function(t){return this.repeatCounter=-1===t?Number.MAX_VALUE:t,this.parent},globalRemove:function(t,e){void 0===e&&(e=this.currentAnim),this.isPlaying&&e.key===this.currentAnim.key&&(this.stop(),this.setCurrentFrame(this.currentAnim.frames[0]))},restart:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1);var i=this.currentAnim,s=this.parent;return i?(e&&(this.repeatCounter=-1===this.repeat?Number.MAX_VALUE:this.repeat),i.getFirstTick(this),this.emitEvents(o.ANIMATION_RESTART),this.isPlaying=!0,this.pendingRepeat=!1,this.hasStarted=!t,this._pendingStop=0,this._pendingStopValue=0,this._paused=!1,this.setCurrentFrame(i.frames[0]),this.parent):s},complete:function(){if(this._pendingStop=0,this.isPlaying=!1,this.currentAnim&&this.handleComplete(),this.nextAnim){var t=this.nextAnim;this.nextAnim=this.nextAnimsQueue.length>0?this.nextAnimsQueue.shift():null,this.play(t)}return this.parent},stop:function(){if(this._pendingStop=0,this.isPlaying=!1,this.delayCounter=0,this.currentAnim&&this.handleStop(),this.nextAnim){var t=this.nextAnim;this.nextAnim=this.nextAnimsQueue.shift(),this.play(t)}return this.parent},stopAfterDelay:function(t){return this._pendingStop=1,this._pendingStopValue=t,this.parent},stopAfterRepeat:function(t){return void 0===t&&(t=1),-1!==this.repeatCounter&&t>this.repeatCounter&&(t=this.repeatCounter),this._pendingStop=2,this._pendingStopValue=t,this.parent},stopOnFrame:function(t){return this._pendingStop=3,this._pendingStopValue=t,this.parent},getTotalFrames:function(){return this.currentAnim?this.currentAnim.getTotalFrames():0},update:function(t,e){var i=this.currentAnim;if(this.isPlaying&&i&&!i.paused){if(this.accumulator+=e*this.timeScale*this.animationManager.globalTimeScale,1===this._pendingStop&&(this._pendingStopValue-=e,this._pendingStopValue<=0))return this.stop();if(this.hasStarted){if(this.accumulator>=this.nextTick&&(this.forward?i.nextFrame(this):i.previousFrame(this),this.isPlaying&&0===this._pendingStop&&this.skipMissedFrames&&this.accumulator>this.nextTick)){var s=0;do{this.forward?i.nextFrame(this):i.previousFrame(this),s++}while(this.isPlaying&&this.accumulator>this.nextTick&&s<60)}}else this.accumulator>=this.delayCounter&&(this.accumulator-=this.delayCounter,this.handleStart())}},setCurrentFrame:function(t){var e=this.parent;return this.currentFrame=t,e.texture=t.frame.texture,e.frame=t.frame,e.isCropped&&e.frame.updateCropUVs(e._crop,e.flipX,e.flipY),t.setAlpha&&(e.alpha=t.alpha),e.setSizeToFrame(),e._originComponent&&(t.frame.customPivot?e.setOrigin(t.frame.pivotX,t.frame.pivotY):e.updateDisplayOrigin()),this.isPlaying&&this.hasStarted&&(this.emitEvents(o.ANIMATION_UPDATE),3===this._pendingStop&&this._pendingStopValue===t&&this.stop()),e},nextFrame:function(){return this.currentAnim&&this.currentAnim.nextFrame(this),this.parent},previousFrame:function(){return this.currentAnim&&this.currentAnim.previousFrame(this),this.parent},get:function(t){return this.anims?this.anims.get(t):null},exists:function(t){return!!this.anims&&this.anims.has(t)},create:function(t){var e=t.key,i=!1;return e&&((i=this.get(e))?console.warn("Animation key already exists: "+e):(i=new s(this,e,t),this.anims||(this.anims=new a),this.anims.set(e,i))),i},createFromAseprite:function(t,e){return this.animationManager.createFromAseprite(t,e,this.parent)},generateFrameNames:function(t,e){return this.animationManager.generateFrameNames(t,e)},generateFrameNumbers:function(t,e){return this.animationManager.generateFrameNumbers(t,e)},remove:function(t){var e=this.get(t);return e&&(this.currentAnim===e&&this.stop(),this.anims.delete(t)),e},destroy:function(){this.animationManager.off(o.REMOVE_ANIMATION,this.globalRemove,this),this.anims&&this.anims.clear(),this.animationManager=null,this.parent=null,this.nextAnim=null,this.nextAnimsQueue.length=0,this.currentAnim=null,this.currentFrame=null},isPaused:{get:function(){return this._paused}}});t.exports=l},57090(t){t.exports="add"},25312(t){t.exports="animationcomplete"},89580(t){t.exports="animationcomplete-"},52860(t){t.exports="animationrepeat"},63850(t){t.exports="animationrestart"},99085(t){t.exports="animationstart"},28087(t){t.exports="animationstop"},1794(t){t.exports="animationupdate"},52562(t){t.exports="pauseall"},57953(t){t.exports="remove"},68339(t){t.exports="resumeall"},74943(t,e,i){t.exports={ADD_ANIMATION:i(57090),ANIMATION_COMPLETE:i(25312),ANIMATION_COMPLETE_KEY:i(89580),ANIMATION_REPEAT:i(52860),ANIMATION_RESTART:i(63850),ANIMATION_START:i(99085),ANIMATION_STOP:i(28087),ANIMATION_UPDATE:i(1794),PAUSE_ALL:i(52562),REMOVE_ANIMATION:i(57953),RESUME_ALL:i(68339)}},60421(t,e,i){t.exports={Animation:i(42099),AnimationFrame:i(41138),AnimationManager:i(60848),AnimationState:i(9674),Events:i(74943)}},2161(t,e,i){var s=i(83419),r=i(90330),n=i(50792),a=i(24736),o=new s({initialize:function(){this.entries=new r,this.events=new n},add:function(t,e){return this.entries.set(t,e),this.events.emit(a.ADD,this,t,e),this},has:function(t){return this.entries.has(t)},exists:function(t){return this.entries.has(t)},get:function(t){return this.entries.get(t)},remove:function(t){var e=this.get(t);return e&&(this.entries.delete(t),this.events.emit(a.REMOVE,this,t,e.data)),this},getKeys:function(){return this.entries.keys()},destroy:function(){this.entries.clear(),this.events.removeAllListeners(),this.entries=null,this.events=null}});t.exports=o},24047(t,e,i){var s=i(2161),r=i(83419),n=i(8443),a=new r({initialize:function(t){this.game=t,this.binary=new s,this.bitmapFont=new s,this.json=new s,this.physics=new s,this.shader=new s,this.audio=new s,this.video=new s,this.text=new s,this.html=new s,this.tilemap=new s,this.xml=new s,this.atlas=new s,this.custom={},this.game.events.once(n.DESTROY,this.destroy,this)},addCustom:function(t){return this.custom.hasOwnProperty(t)||(this.custom[t]=new s),this.custom[t]},destroy:function(){for(var t=["binary","bitmapFont","json","physics","shader","audio","video","text","html","tilemap","xml","atlas"],e=0;ef&&w*i+b*rd&&w*s+b*nr&&(t=r),t},clampY:function(t){var e=this._bounds,i=this.displayHeight,s=e.y+(i-this.height)/2,r=Math.max(s,s+e.height-i);return tr&&(t=r),t},removeBounds:function(){return this.useBounds=!1,this.dirty=!0,this._bounds.setEmpty(),this},setAngle:function(t){return void 0===t&&(t=0),this.rotation=r(t),this},setBackgroundColor:function(t){return void 0===t&&(t="rgba(0,0,0,0)"),this.backgroundColor=d(t),this.transparent=0===this.backgroundColor.alpha,this},setBounds:function(t,e,i,s,r){return void 0===r&&(r=!1),this._bounds.setTo(t,e,i,s),this.dirty=!0,this.useBounds=!0,r?this.centerToBounds():(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},setForceComposite:function(t){return this.forceComposite=t,this},getBounds:function(t){void 0===t&&(t=new o);var e=this._bounds;return t.setTo(e.x,e.y,e.width,e.height),t},setName:function(t){return void 0===t&&(t=""),this.name=t,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setRoundPixels:function(t){return this.roundPixels=t,this},setScene:function(t,e){void 0===e&&(e=!0),this.scene&&this._customViewport&&this.sceneManager.customViewports--,this.scene=t,this.isSceneCamera=e;var i=t.sys;return this.sceneManager=i.game.scene,this.scaleManager=i.scale,this.cameraManager=i.cameras,this.updateSystem(),this},setScroll:function(t,e){return void 0===e&&(e=t),this.scrollX=t,this.scrollY=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},setViewport:function(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this},setZoom:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),0===t&&(t=.001),0===e&&(e=.001),this.zoomX=t,this.zoomY=e,this},setMask:function(t,e){return void 0===e&&(e=!0),this.mask=t,this._maskCamera=e?this.cameraManager.default:this,this},clearMask:function(t){return void 0===t&&(t=!1),t&&this.mask&&this.mask.destroy(),this.mask=null,this},toJSON:function(){var t={name:this.name,x:this.x,y:this.y,width:this.width,height:this.height,zoom:this.zoom,rotation:this.rotation,roundPixels:this.roundPixels,scrollX:this.scrollX,scrollY:this.scrollY,backgroundColor:this.backgroundColor.rgba};return this.useBounds&&(t.bounds={x:this._bounds.x,y:this._bounds.y,width:this._bounds.width,height:this._bounds.height}),t},update:function(){},setIsSceneCamera:function(t){return this.isSceneCamera=t,this},updateSystem:function(){if(this.scaleManager&&this.isSceneCamera){var t=0!==this._x||0!==this._y||this.scaleManager.width!==this._width||this.scaleManager.height!==this._height,e=this.sceneManager;t&&!this._customViewport?e.customViewports++:!t&&this._customViewport&&e.customViewports--,this.dirty=!0,this._customViewport=t}},destroy:function(){this.emit(a.DESTROY,this),this.removeAllListeners(),this.matrix.destroy(),this.matrixCombined.destroy(),this.matrixExternal.destroy(),this.culledObjects=[],this._customViewport&&this.sceneManager.customViewports--,this.renderList=[],this._bounds=null,this.scene=null,this.scaleManager=null,this.sceneManager=null,this.cameraManager=null},x:{get:function(){return this._x},set:function(t){this._x=t,this.updateSystem()}},y:{get:function(){return this._y},set:function(t){this._y=t,this.updateSystem()}},width:{get:function(){return this._width},set:function(t){this._width=t,this.updateSystem()}},height:{get:function(){return this._height},set:function(t){this._height=t,this.updateSystem()}},scrollX:{get:function(){return this._scrollX},set:function(t){t!==this._scrollX&&(this._scrollX=t,this.dirty=!0)}},scrollY:{get:function(){return this._scrollY},set:function(t){t!==this._scrollY&&(this._scrollY=t,this.dirty=!0)}},zoom:{get:function(){return(this._zoomX+this._zoomY)/2},set:function(t){this._zoomX=t,this._zoomY=t,this.dirty=!0}},zoomX:{get:function(){return this._zoomX},set:function(t){this._zoomX=t,this.dirty=!0}},zoomY:{get:function(){return this._zoomY},set:function(t){this._zoomY=t,this.dirty=!0}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=t,this.dirty=!0}},centerX:{get:function(){return this.x+.5*this.width}},centerY:{get:function(){return this.y+.5*this.height}},displayWidth:{get:function(){return this.width/this.zoomX}},displayHeight:{get:function(){return this.height/this.zoomY}}});t.exports=f},38058(t,e,i){var s=i(71911),r=i(67502),n=i(45319),a=i(83419),o=i(31401),h=i(20052),l=i(19715),u=i(28915),d=i(87841),c=i(26099),f=new a({Extends:s,initialize:function(t,e,i,r){s.call(this,t,e,i,r),this.filters={internal:new o.FilterList(this),external:new o.FilterList(this)},this.isObjectInversion=!1,this.inputEnabled=!0,this.fadeEffect=new h.Fade(this),this.flashEffect=new h.Flash(this),this.shakeEffect=new h.Shake(this),this.panEffect=new h.Pan(this),this.rotateToEffect=new h.RotateTo(this),this.zoomEffect=new h.Zoom(this),this.lerp=new c(1,1),this.followOffset=new c,this.deadzone=null,this._follow=null},setDeadzone:function(t,e){if(void 0===t)this.deadzone=null;else{if(this.deadzone?(this.deadzone.width=t,this.deadzone.height=e):this.deadzone=new d(0,0,t,e),this._follow){var i=this.width/2,s=this.height/2,n=this._follow.x-this.followOffset.x,a=this._follow.y-this.followOffset.y;this.midPoint.set(n,a),this.scrollX=n-i,this.scrollY=a-s}r(this.deadzone,this.midPoint.x,this.midPoint.y)}return this},fadeIn:function(t,e,i,s,r,n){return this.fadeEffect.start(!1,t,e,i,s,!0,r,n)},fadeOut:function(t,e,i,s,r,n){return this.fadeEffect.start(!0,t,e,i,s,!0,r,n)},fadeFrom:function(t,e,i,s,r,n,a){return this.fadeEffect.start(!1,t,e,i,s,r,n,a)},fade:function(t,e,i,s,r,n,a){return this.fadeEffect.start(!0,t,e,i,s,r,n,a)},flash:function(t,e,i,s,r,n,a){return this.flashEffect.start(t,e,i,s,r,n,a)},shake:function(t,e,i,s,r){return this.shakeEffect.start(t,e,i,s,r)},pan:function(t,e,i,s,r,n,a){return this.panEffect.start(t,e,i,s,r,n,a)},rotateTo:function(t,e,i,s,r,n,a){return this.rotateToEffect.start(t,e,i,s,r,n,a)},zoomTo:function(t,e,i,s,r,n){return this.zoomEffect.start(t,e,i,s,r,n)},preRender:function(){this.renderList.length=0;var t=this.width,e=this.height,i=.5*t,s=.5*e,n=this.zoomX,a=this.zoomY;this.renderRoundPixels=this.roundPixels&&Number.isInteger(n)&&Number.isInteger(a);var o=t*this.originX,h=e*this.originY,d=this._follow,c=this.deadzone,f=this.scrollX,p=this.scrollY;c&&r(c,this.midPoint.x,this.midPoint.y);var g=!1;if(d&&!this.panEffect.isRunning){var m=this.lerp,v=d.x-this.followOffset.x,y=d.y-this.followOffset.y;c?(vc.right&&(f=u(f,f+(v-c.right),m.x)),yc.bottom&&(p=u(p,p+(y-c.bottom),m.y))):(f=u(f,v-o,m.x),p=u(p,y-h,m.y)),g=!0}this.useBounds&&(f=this.clampX(f),p=this.clampY(p)),this.scrollX=f,this.scrollY=p;var x=f+i,T=p+s;this.midPoint.set(x,T);var w=t/n,b=e/a,S=x-w/2,C=T-b/2;this.worldView.setTo(S,C,w,b);var E=this.matrix,A=this.matrixExternal;this.isObjectInversion?(E.loadIdentity(),E.translate(o,h),E.scale(n,a),E.rotate(this.rotation),E.translate(-f-o,-p-h)):(E.applyITRS(o,h,this.rotation,n,a),E.translate(-f-o,-p-h)),A.applyITRS(this.x,this.y,0,1,1),this.shakeEffect.preRender(),A.multiply(E,this.matrixCombined),g&&this.emit(l.FOLLOW_UPDATE,this,d)},getViewMatrix:function(t){return t||this.forceComposite||this.filters.external.length>0||this.filters.internal.length>0?this.matrix:this.matrixCombined},getPaddingWrapper:function(t){var e={padding:0},i=new Proxy(this,{get:function(t,i){switch(i){case"padding":return e.padding;case"x":case"y":case"scrollX":case"scrollY":return t[i]+e.padding;case"width":case"height":return t[i]-2*e.padding;default:return t[i]}},set:function(i,s,r){switch(s){case"padding":var n=e.padding;e.padding=r;var a=e.padding-n;return i.x-=a,i.y-=a,i.width+=2*a,i.height+=2*a,i.scrollX-=a,i.scrollY-=a,t;case"x":case"y":case"scrollX":case"scrollY":return i[s]=r-e.padding;case"width":case"height":return i[s]=r+2*e.padding;default:return i[s]=r}}});return i.padding=t||0,i},setLerp:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.lerp.set(t,e),this},setFollowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),this.followOffset.set(t,e),this},startFollow:function(t,e,i,s,r,a){void 0===e&&(e=!1),void 0===i&&(i=1),void 0===s&&(s=i),void 0===r&&(r=0),void 0===a&&(a=r),this._follow=t,this.roundPixels=e,i=n(i,0,1),s=n(s,0,1),this.lerp.set(i,s),this.followOffset.set(r,a);var o=this.width/2,h=this.height/2,l=t.x-r,u=t.y-a;return this.midPoint.set(l,u),this.scrollX=l-o,this.scrollY=u-h,this.useBounds&&(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},stopFollow:function(){return this._follow=null,this},resetFX:function(){return this.rotateToEffect.reset(),this.panEffect.reset(),this.shakeEffect.reset(),this.flashEffect.reset(),this.fadeEffect.reset(),this},update:function(t,e){this.visible&&(this.rotateToEffect.update(t,e),this.panEffect.update(t,e),this.zoomEffect.update(t,e),this.shakeEffect.update(t,e),this.flashEffect.update(t,e),this.fadeEffect.update(t,e))},destroy:function(){this.resetFX(),this.filters.internal.destroy(),this.filters.external.destroy(),s.prototype.destroy.call(this),this._follow=null,this.deadzone=null}});t.exports=f},32743(t,e,i){var s=i(38058),r=i(83419),n=i(95540),a=i(37277),o=i(37303),h=i(97480),l=i(44594),u=new r({initialize:function(t){this.scene=t,this.systems=t.sys,this.roundPixels=t.sys.game.config.roundPixels,this.cameras=[],this.main,this.default,t.sys.events.once(l.BOOT,this.boot,this),t.sys.events.on(l.START,this.start,this)},boot:function(){var t=this.systems;t.settings.cameras?this.fromJSON(t.settings.cameras):this.add(),this.main=this.cameras[0],this.default=new s(0,0,t.scale.width,t.scale.height).setScene(this.scene),t.game.scale.on(h.RESIZE,this.onResize,this),this.systems.events.once(l.DESTROY,this.destroy,this)},start:function(){if(!this.main){var t=this.systems;t.settings.cameras?this.fromJSON(t.settings.cameras):this.add(),this.main=this.cameras[0]}var e=this.systems.events;e.on(l.UPDATE,this.update,this),e.once(l.SHUTDOWN,this.shutdown,this)},add:function(t,e,i,r,n,a){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===r&&(r=this.scene.sys.scale.height),void 0===n&&(n=!1),void 0===a&&(a="");var o=new s(t,e,i,r);return o.setName(a),o.setScene(this.scene),o.setRoundPixels(this.roundPixels),o.id=this.getNextID(),this.cameras.push(o),n&&(this.main=o),o},addExisting:function(t,e){return void 0===e&&(e=!1),-1===this.cameras.indexOf(t)?(t.id=this.getNextID(),t.setRoundPixels(this.roundPixels),this.cameras.push(t),e&&(this.main=t),t):null},getNextID:function(){for(var t=this.cameras,e=1,i=0;i<32;i++){for(var s=!1,r=0;r0){n.preRender();var a=this.getVisibleChildren(e.getChildren(),n);t.render(i,a,n)}}},getVisibleChildren:function(t,e){return t.filter(function(t){return t.willRender(e)})},resetAll:function(){for(var t=0;t=0}else this.clockwise=this.destination>=this.source;return this.camera.emit(n.ROTATE_START,this.camera,this,i,this.destination),u},update:function(t,e){if(this.isRunning){this._elapsed+=e;var i=s(this._elapsed/this.duration,0,1);this.progress=i;var r=this.camera;if(this._elapsedthis.maxZoom&&(e.zoom=this.maxZoom))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=n},58818(t,e,i){var s=i(83419),r=i(35154),n=new s({initialize:function(t){this.camera=r(t,"camera",null),this.left=r(t,"left",null),this.right=r(t,"right",null),this.up=r(t,"up",null),this.down=r(t,"down",null),this.zoomIn=r(t,"zoomIn",null),this.zoomOut=r(t,"zoomOut",null),this.zoomSpeed=r(t,"zoomSpeed",.01),this.minZoom=r(t,"minZoom",.001),this.maxZoom=r(t,"maxZoom",1e3),this.accelX=0,this.accelY=0;var e=r(t,"acceleration",null);"number"==typeof e?(this.accelX=e,this.accelY=e):(this.accelX=r(t,"acceleration.x",0),this.accelY=r(t,"acceleration.y",0)),this.dragX=0,this.dragY=0;var i=r(t,"drag",null);"number"==typeof i?(this.dragX=i,this.dragY=i):(this.dragX=r(t,"drag.x",0),this.dragY=r(t,"drag.y",0)),this.maxSpeedX=0,this.maxSpeedY=0;var s=r(t,"maxSpeed",null);"number"==typeof s?(this.maxSpeedX=s,this.maxSpeedY=s):(this.maxSpeedX=r(t,"maxSpeed.x",0),this.maxSpeedY=r(t,"maxSpeed.y",0)),this._speedX=0,this._speedY=0,this._zoom=0,this.active=null!==this.camera},start:function(){return this.active=null!==this.camera,this},stop:function(){return this.active=!1,this},setCamera:function(t){return this.camera=t,this},update:function(t){if(this.active){void 0===t&&(t=1);var e=this.camera;this._speedX>0?(this._speedX-=this.dragX*t,this._speedX<0&&(this._speedX=0)):this._speedX<0&&(this._speedX+=this.dragX*t,this._speedX>0&&(this._speedX=0)),this._speedY>0?(this._speedY-=this.dragY*t,this._speedY<0&&(this._speedY=0)):this._speedY<0&&(this._speedY+=this.dragY*t,this._speedY>0&&(this._speedY=0)),this.up&&this.up.isDown?(this._speedY+=this.accelY,this._speedY>this.maxSpeedY&&(this._speedY=this.maxSpeedY)):this.down&&this.down.isDown&&(this._speedY-=this.accelY,this._speedY<-this.maxSpeedY&&(this._speedY=-this.maxSpeedY)),this.left&&this.left.isDown?(this._speedX+=this.accelX,this._speedX>this.maxSpeedX&&(this._speedX=this.maxSpeedX)):this.right&&this.right.isDown&&(this._speedX-=this.accelX,this._speedX<-this.maxSpeedX&&(this._speedX=-this.maxSpeedX)),this.zoomIn&&this.zoomIn.isDown?this._zoom=-this.zoomSpeed:this.zoomOut&&this.zoomOut.isDown?this._zoom=this.zoomSpeed:this._zoom=0,0!==this._speedX&&(e.scrollX-=this._speedX*t|0),0!==this._speedY&&(e.scrollY-=this._speedY*t|0),0!==this._zoom&&(e.zoom+=this._zoom,e.zoomthis.maxZoom&&(e.zoom=this.maxZoom))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=n},38865(t,e,i){t.exports={FixedKeyControl:i(63091),SmoothedKeyControl:i(58818)}},26638(t,e,i){t.exports={Controls:i(38865),Scene2D:i(87969)}},8054(t,e,i){var s={VERSION:"4.1.0",LOG_VERSION:"v401",BlendModes:i(10312),ScaleModes:i(29795),AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,FOREVER:-1,NONE:4,UP:5,DOWN:6,LEFT:7,RIGHT:8};t.exports=s},69547(t,e,i){var s=i(83419),r=i(8054),n=i(42363),a=i(82264),o=i(95540),h=i(35154),l=i(41212),u=i(29747),d=i(75508),c=i(80333),f=new s({initialize:function(t){void 0===t&&(t={});var e=h(t,"scale",null);this.width=h(e,"width",1024,t),this.height=h(e,"height",768,t),this.zoom=h(e,"zoom",1,t),this.parent=h(e,"parent",void 0,t),this.scaleMode=h(e,e?"mode":"scaleMode",0,t),this.expandParent=h(e,"expandParent",!0,t),this.autoRound=h(e,"autoRound",!1,t),this.autoCenter=h(e,"autoCenter",0,t),this.resizeInterval=h(e,"resizeInterval",500,t),this.fullscreenTarget=h(e,"fullscreenTarget",null,t),this.minWidth=h(e,"min.width",0,t),this.maxWidth=h(e,"max.width",0,t),this.minHeight=h(e,"min.height",0,t),this.maxHeight=h(e,"max.height",0,t),this.snapWidth=h(e,"snap.width",0,t),this.snapHeight=h(e,"snap.height",0,t),this.renderType=h(t,"type",r.AUTO),this.canvas=h(t,"canvas",null),this.context=h(t,"context",null),this.canvasStyle=h(t,"canvasStyle",null),this.customEnvironment=h(t,"customEnvironment",!1),this.sceneConfig=h(t,"scene",null),this.seed=h(t,"seed",[(Date.now()*Math.random()).toString()]),d.RND=new d.RandomDataGenerator(this.seed),this.gameTitle=h(t,"title",""),this.gameURL=h(t,"url","https://phaser.io/"+r.LOG_VERSION),this.gameVersion=h(t,"version",""),this.autoFocus=h(t,"autoFocus",!0),this.stableSort=h(t,"stableSort",-1),-1===this.stableSort&&(this.stableSort=a.browser.es2019?1:0),a.features.stableSort=this.stableSort,this.domCreateContainer=h(t,"dom.createContainer",!1),this.domPointerEvents=h(t,"dom.pointerEvents","none"),this.inputKeyboard=h(t,"input.keyboard",!0),this.inputKeyboardEventTarget=h(t,"input.keyboard.target",window),this.inputKeyboardCapture=h(t,"input.keyboard.capture",[]),this.inputMouse=h(t,"input.mouse",!0),this.inputMouseEventTarget=h(t,"input.mouse.target",null),this.inputMousePreventDefaultDown=h(t,"input.mouse.preventDefaultDown",!0),this.inputMousePreventDefaultUp=h(t,"input.mouse.preventDefaultUp",!0),this.inputMousePreventDefaultMove=h(t,"input.mouse.preventDefaultMove",!0),this.inputMousePreventDefaultWheel=h(t,"input.mouse.preventDefaultWheel",!0),this.inputTouch=h(t,"input.touch",a.input.touch),this.inputTouchEventTarget=h(t,"input.touch.target",null),this.inputTouchCapture=h(t,"input.touch.capture",!0),this.inputActivePointers=h(t,"input.activePointers",1),this.inputSmoothFactor=h(t,"input.smoothFactor",0),this.inputWindowEvents=h(t,"input.windowEvents",!0),this.inputGamepad=h(t,"input.gamepad",!1),this.inputGamepadEventTarget=h(t,"input.gamepad.target",window),this.disableContextMenu=h(t,"disableContextMenu",!1),this.audio=h(t,"audio",{}),this.hideBanner=!1===h(t,"banner",null),this.hidePhaser=h(t,"banner.hidePhaser",!1),this.bannerTextColor=h(t,"banner.text","#ffffff"),this.bannerBackgroundColor=h(t,"banner.background",["#000814","#001d3d","#003566"]),""===this.gameTitle&&this.hidePhaser&&(this.hideBanner=!0),this.fps=h(t,"fps",null);var i=h(t,"render",null);this.autoMobileTextures=h(i,"autoMobileTextures",!0,t),this.antialias=h(i,"antialias",!0,t),this.antialiasGL=h(i,"antialiasGL",!0,t),this.mipmapFilter=h(i,"mipmapFilter","",t),this.mipmapRegeneration=h(i,"mipmapRegeneration",!1,t),this.desynchronized=h(i,"desynchronized",!1,t),this.roundPixels=h(i,"roundPixels",!1,t),this.selfShadow=h(i,"selfShadow",!1,t),this.pathDetailThreshold=h(i,"pathDetailThreshold",1,t),this.pixelArt=h(i,"pixelArt",!1,t),this.pixelArt&&(this.antialias=!1,this.antialiasGL=!1,this.roundPixels=!0),this.smoothPixelArt=h(i,"smoothPixelArt",!1,t),this.smoothPixelArt&&(this.antialias=!0,this.antialiasGL=!0,this.pixelArt=!1),this.transparent=h(i,"transparent",!1,t),this.clearBeforeRender=h(i,"clearBeforeRender",!0,t),this.preserveDrawingBuffer=h(i,"preserveDrawingBuffer",!1,t),this.premultipliedAlpha=h(i,"premultipliedAlpha",!0,t),this.skipUnreadyShaders=h(i,"skipUnreadyShaders",!1,t),this.failIfMajorPerformanceCaveat=h(i,"failIfMajorPerformanceCaveat",!1,t),this.powerPreference=h(i,"powerPreference","default",t),this.batchSize=h(i,"batchSize",16384,t),this.maxTextures=h(i,"maxTextures",-1,t),this.maxLights=h(i,"maxLights",10,t),this.renderNodes=h(i,"renderNodes",{},t);var s=h(t,"backgroundColor",0);this.backgroundColor=c(s),this.transparent&&(this.backgroundColor=c(0),this.backgroundColor.alpha=0),this.preBoot=h(t,"callbacks.preBoot",u),this.postBoot=h(t,"callbacks.postBoot",u),this.physics=h(t,"physics",{}),this.defaultPhysicsSystem=h(this.physics,"default",!1),this.loaderBaseURL=h(t,"loader.baseURL",""),this.loaderPath=h(t,"loader.path",""),this.loaderMaxParallelDownloads=h(t,"loader.maxParallelDownloads",a.os.android?6:32),this.loaderCrossOrigin=h(t,"loader.crossOrigin",void 0),this.loaderResponseType=h(t,"loader.responseType",""),this.loaderAsync=h(t,"loader.async",!0),this.loaderUser=h(t,"loader.user",""),this.loaderPassword=h(t,"loader.password",""),this.loaderTimeout=h(t,"loader.timeout",0),this.loaderMaxRetries=h(t,"loader.maxRetries",2),this.loaderWithCredentials=h(t,"loader.withCredentials",!1),this.loaderImageLoadType=h(t,"loader.imageLoadType","XHR"),this.loaderLocalScheme=h(t,"loader.localScheme",["file://","capacitor://"]),this.glowQuality=h(t,"filters.glow.quality",10),this.glowDistance=h(t,"filters.glow.distance",10),this.installGlobalPlugins=[],this.installScenePlugins=[];var f=h(t,"plugins",null),p=n.DefaultScene;f&&(Array.isArray(f)?this.defaultPlugins=f:l(f)&&(this.installGlobalPlugins=o(f,"global",[]),this.installScenePlugins=o(f,"scene",[]),Array.isArray(f.default)?p=f.default:Array.isArray(f.defaultMerge)&&(p=p.concat(f.defaultMerge)))),this.defaultPlugins=p;var g="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg";this.defaultImage=h(t,"images.default",g+"AQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg=="),this.missingImage=h(t,"images.missing",g+"CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg=="),this.whiteImage=h(t,"images.white","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABdJREFUeNpi/P//PwMMMDEgAdwcgAADAJZuAwXJYZOzAAAAAElFTkSuQmCC"),window&&(window.FORCE_WEBGL?this.renderType=r.WEBGL:window.FORCE_CANVAS&&(this.renderType=r.CANVAS))}});t.exports=f},86054(t,e,i){var s=i(20623),r=i(27919),n=i(8054),a=i(89357);t.exports=function(t){var e=t.config;if((e.customEnvironment||e.canvas)&&e.renderType===n.AUTO)throw new Error("Must set explicit renderType in custom environment");if(!e.customEnvironment&&!e.canvas&&e.renderType!==n.HEADLESS)if(e.renderType===n.AUTO&&(e.renderType=a.webGL?n.WEBGL:n.CANVAS),e.renderType===n.WEBGL){if(!a.webGL)throw new Error("Cannot create WebGL context, aborting.")}else{if(e.renderType!==n.CANVAS)throw new Error("Unknown value for renderer type: "+e.renderType);if(!a.canvas)throw new Error("Cannot create Canvas context, aborting.")}e.antialias||r.disableSmoothing();var o,h,l=t.scale.baseSize,u=l.width,d=l.height;(e.canvas?(t.canvas=e.canvas,t.canvas.width=u,t.canvas.height=d):t.canvas=r.create(t,u,d,e.renderType),e.canvasStyle&&(t.canvas.style=e.canvasStyle),e.antialias||s.setCrisp(t.canvas),e.renderType!==n.HEADLESS)&&(o=i(68627),h=i(74797),e.renderType===n.WEBGL?t.renderer=new h(t):(t.renderer=new o(t),t.context=t.renderer.gameContext))}},96391(t,e,i){var s=i(8054);t.exports=function(t){var e=t.config;if(!e.hideBanner){var i="WebGL";e.renderType===s.CANVAS?i="Canvas":e.renderType===s.HEADLESS&&(i="Headless");var r,n=e.audio,a=t.device.audio;if(r=a.webAudio&&!n.disableWebAudio?"Web Audio":n.noAudio||!a.webAudio&&!a.audioData?"No Audio":"HTML5 Audio",t.device.browser.ie)window.console&&console.log("Phaser v"+s.VERSION+" / https://phaser.io");else{var o="color: "+e.bannerTextColor+";",h=Array.isArray(e.bannerBackgroundColor)?e.bannerBackgroundColor:[e.bannerBackgroundColor];1===h.length&&(h=[h[0],h[0]]),o+=' background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAOCAYAAAAmL5yKAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAARBJREFUeNpi/P//P0OHsPB/BiCoePuWkYFEwALSXJElzMBgLwE2CNkQxgWr/yMr/p8QimlBu5DQ//+8vBBco/ofzAe6imH+qv/53/6jYJAYSA4ZoxoANYTPKhiuCQZwGcJU+e4dqpMmvsDq14krV2MPAxDha2CMKvoXoiE/PBQUDgQD8j82UFae9B9bOIC8B9UD9gIjjIMN7Ns6lWHn4XMoYu62RgxO3tkMjIyMII2MYAOAtmFVhA+ADHf2ycGMRhANjUq8YO+WKWCvgAORIV8CkpDCrzIwsLIymC1qAtuAD4Bsh3sBmqAY3qcGwL2AC4DCpKtzHlgzOLWihwEuzTCN0GhDJHeYC4gByBphACDAAH2dDIxdjr+VAAAAAElFTkSuQmCC"), '+("linear-gradient(to bottom, "+h.join(", ")+")")+";",o+=" background-repeat: no-repeat;",o+=" background-position: 4px center, 0 0;";var l="%c",u=[null,o+=" padding: 2px 6px 2px 24px;"];u.push("background: transparent"),e.gameTitle&&(l=l.concat(e.gameTitle),e.gameVersion&&(l=l.concat(" v"+e.gameVersion)),e.hidePhaser||(l=l.concat(" / "))),e.hidePhaser||(l=l.concat("Phaser v"+s.VERSION+" ("+i+" | "+r+")")),l=l.concat("%c "+e.gameURL),u[0]=l,console.log.apply(console,u)}}}},50127(t,e,i){var s=i(40366),r=i(60848),n=i(24047),a=i(27919),o=i(83419),h=i(69547),l=i(83719),u=i(86054),d=i(45893),c=i(96391),f=i(82264),p=i(57264),g=i(50792),m=i(8443),v=i(7003),y=i(37277),x=i(77332),T=i(76531),w=i(60903),b=i(69442),S=i(17130),C=i(65898),E=i(51085),A=i(14747),_=new o({initialize:function(t){this.config=new h(t),this.renderer=null,this.domContainer=null,this.canvas=null,this.context=null,this.isBooted=!1,this.isRunning=!1,this.events=new g,this.anims=new r(this),this.textures=new S(this),this.cache=new n(this),this.registry=new d(this,new g),this.input=new v(this,this.config),this.scene=new w(this,this.config.sceneConfig),this.device=f,this.scale=new T(this,this.config),this.sound=null,this.sound=A.create(this),this.loop=new C(this,this.config.fps),this.plugins=new x(this,this.config),this.pendingDestroy=!1,this.removeCanvas=!1,this.noReturn=!1,this.hasFocus=!1,this.isPaused=!1,p(this.boot.bind(this))},boot:function(){y.hasCore("EventEmitter")?(this.isBooted=!0,this.config.preBoot(this),this.scale.preBoot(),u(this),l(this),c(this),s(this.canvas,this.config.parent),this.textures.once(b.READY,this.texturesReady,this),this.events.emit(m.BOOT)):console.warn("Aborting. Core Plugins missing.")},texturesReady:function(){this.events.emit(m.READY),this.start()},start:function(){this.isRunning=!0,this.config.postBoot(this),this.renderer?this.loop.start(this.step.bind(this)):this.loop.start(this.headlessStep.bind(this)),E(this);var t=this.events;t.on(m.HIDDEN,this.onHidden,this),t.on(m.VISIBLE,this.onVisible,this),t.on(m.BLUR,this.onBlur,this),t.on(m.FOCUS,this.onFocus,this)},step:function(t,e){if(this.pendingDestroy)return this.runDestroy();if(!this.isPaused){var i=this.events;i.emit(m.PRE_STEP,t,e),i.emit(m.STEP,t,e),this.scene.update(t,e),i.emit(m.POST_STEP,t,e);var s=this.renderer;s.preRender(),i.emit(m.PRE_RENDER,s,t,e),this.scene.render(s),s.postRender(),i.emit(m.POST_RENDER,s,t,e)}},headlessStep:function(t,e){if(this.pendingDestroy)return this.runDestroy();if(!this.isPaused){var i=this.events;i.emit(m.PRE_STEP,t,e),i.emit(m.STEP,t,e),this.scene.update(t,e),i.emit(m.POST_STEP,t,e),this.scene.isProcessing=!1,i.emit(m.PRE_RENDER,null,t,e),i.emit(m.POST_RENDER,null,t,e)}},onHidden:function(){this.loop.pause(),this.events.emit(m.PAUSE)},pause:function(){var t=this.isPaused;this.isPaused=!0,t||this.events.emit(m.PAUSE)},onVisible:function(){this.loop.resume(),this.events.emit(m.RESUME,this.loop.pauseDuration)},resume:function(){var t=this.isPaused;this.isPaused=!1,t&&this.events.emit(m.RESUME,0)},onBlur:function(){this.hasFocus=!1,this.loop.blur()},onFocus:function(){this.hasFocus=!0,this.loop.focus()},getFrame:function(){return this.loop.frame},getTime:function(){return this.loop.now},destroy:function(t,e){void 0===e&&(e=!1),this.pendingDestroy=!0,this.removeCanvas=t,this.noReturn=e},runDestroy:function(){this.scene.destroy(),this.events.emit(m.DESTROY),this.events.removeAllListeners(),this.renderer&&this.renderer.destroy(),this.removeCanvas&&this.canvas&&(a.remove(this.canvas),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)),this.domContainer&&this.domContainer.parentNode&&this.domContainer.parentNode.removeChild(this.domContainer),this.loop.destroy(),this.pendingDestroy=!1}});t.exports=_},65898(t,e,i){var s=i(83419),r=i(35154),n=i(29747),a=i(43092),o=new s({initialize:function(t,e){this.game=t,this.raf=new a,this.started=!1,this.running=!1,this.minFps=r(e,"min",5),this.targetFps=r(e,"target",60),this.fpsLimit=r(e,"limit",0),this.hasFpsLimit=this.fpsLimit>0,this._limitRate=this.hasFpsLimit?1e3/this.fpsLimit:0,this._min=1e3/this.minFps,this._target=1e3/this.targetFps,this.actualFps=this.targetFps,this.nextFpsUpdate=0,this.framesThisSecond=0,this.callback=n,this.forceSetTimeOut=r(e,"forceSetTimeOut",!1),this.time=0,this.startTime=0,this.lastTime=0,this.frame=0,this.inFocus=!0,this.pauseDuration=0,this._pauseTime=0,this._coolDown=0,this.delta=0,this.deltaIndex=0,this.deltaHistory=[],this.deltaSmoothingMax=r(e,"deltaHistory",10),this.panicMax=r(e,"panicMax",120),this.rawDelta=0,this.now=0,this.smoothStep=r(e,"smoothStep",!0)},blur:function(){this.inFocus=!1},focus:function(){this.inFocus=!0,this.resetDelta()},pause:function(){this._pauseTime=window.performance.now()},resume:function(){this.resetDelta(),this.pauseDuration=this.time-this._pauseTime,this.startTime+=this.pauseDuration},resetDelta:function(){var t=window.performance.now();this.time=t,this.lastTime=t,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0;for(var e=0;e0||!this.inFocus)&&(this._coolDown--,t=Math.min(t,this._target)),t>this._min&&(t=i[e],t=Math.min(t,this._min)),i[e]=t,this.deltaIndex++,this.deltaIndex>=s&&(this.deltaIndex=0);for(var r=0,n=0;n=this.nextFpsUpdate&&this.updateFPS(t),this.framesThisSecond++,this.delta>=this._limitRate&&(this.callback(t,this.delta),this.delta%=this._limitRate),this.lastTime=t,this.frame++},step:function(t){this.now=t;var e=Math.max(0,t-this.lastTime);this.rawDelta=e,this.time+=this.rawDelta,this.smoothStep&&(e=this.smoothDelta(e)),this.delta=e,t>=this.nextFpsUpdate&&this.updateFPS(t),this.framesThisSecond++,this.callback(t,e),this.lastTime=t,this.frame++},tick:function(){var t=window.performance.now();this.hasFpsLimit?this.stepLimitFPS(t):this.step(t)},sleep:function(){this.running&&(this.raf.stop(),this.running=!1)},wake:function(t){void 0===t&&(t=!1);var e=window.performance.now();if(!this.running){t&&(this.startTime+=-this.lastTime+(this.lastTime+e));var i=this.hasFpsLimit?this.stepLimitFPS.bind(this):this.step.bind(this);this.raf.start(i,this.forceSetTimeOut,this._target),this.running=!0,this.nextFpsUpdate=e+1e3,this.framesThisSecond=0,this.fpsLimitTriggered=!1,this.tick()}},getDuration:function(){return Math.round(this.lastTime-this.startTime)/1e3},getDurationMS:function(){return Math.round(this.lastTime-this.startTime)},stop:function(){return this.running=!1,this.started=!1,this.raf.stop(),this},destroy:function(){this.stop(),this.raf.destroy(),this.raf=null,this.game=null,this.callback=null}});t.exports=o},51085(t,e,i){var s=i(8443);t.exports=function(t){var e,i=t.events;if(void 0!==document.hidden)e="visibilitychange";else{["webkit","moz","ms"].forEach(function(t){void 0!==document[t+"Hidden"]&&(document.hidden=function(){return document[t+"Hidden"]},e=t+"visibilitychange")})}e&&document.addEventListener(e,function(t){document.hidden||"pause"===t.type?i.emit(s.HIDDEN):i.emit(s.VISIBLE)},!1),window.onblur=function(){i.emit(s.BLUR)},window.onfocus=function(){i.emit(s.FOCUS)},window.focus&&t.config.autoFocus&&window.focus()}},97217(t){t.exports="blur"},47548(t){t.exports="boot"},19814(t){t.exports="contextlost"},68446(t){t.exports="destroy"},41700(t){t.exports="focus"},25432(t){t.exports="hidden"},65942(t){t.exports="pause"},59211(t){t.exports="postrender"},47789(t){t.exports="poststep"},39066(t){t.exports="prerender"},460(t){t.exports="prestep"},16175(t){t.exports="ready"},42331(t){t.exports="resume"},11966(t){t.exports="step"},32969(t){t.exports="systemready"},94830(t){t.exports="visible"},8443(t,e,i){t.exports={BLUR:i(97217),BOOT:i(47548),CONTEXT_LOST:i(19814),DESTROY:i(68446),FOCUS:i(41700),HIDDEN:i(25432),PAUSE:i(65942),POST_RENDER:i(59211),POST_STEP:i(47789),PRE_RENDER:i(39066),PRE_STEP:i(460),READY:i(16175),RESUME:i(42331),STEP:i(11966),SYSTEM_READY:i(32969),VISIBLE:i(94830)}},42857(t,e,i){t.exports={Config:i(69547),CreateRenderer:i(86054),DebugHeader:i(96391),Events:i(8443),TimeStep:i(65898),VisibilityHandler:i(51085)}},46728(t,e,i){var s=i(83419),r=i(36316),n=i(80021),a=i(26099),o=new s({Extends:n,initialize:function(t,e,i,s){n.call(this,"CubicBezierCurve"),Array.isArray(t)&&(s=new a(t[6],t[7]),i=new a(t[4],t[5]),e=new a(t[2],t[3]),t=new a(t[0],t[1])),this.p0=t,this.p1=e,this.p2=i,this.p3=s},getStartPoint:function(t){return void 0===t&&(t=new a),t.copy(this.p0)},getResolution:function(t){return t},getPoint:function(t,e){void 0===e&&(e=new a);var i=this.p0,s=this.p1,n=this.p2,o=this.p3;return e.set(r(t,i.x,s.x,n.x,o.x),r(t,i.y,s.y,n.y,o.y))},draw:function(t,e){void 0===e&&(e=32);var i=this.getPoints(e);t.beginPath(),t.moveTo(this.p0.x,this.p0.y);for(var s=1;si&&(e=i/2);var s=Math.max(1,Math.round(i/e));return r(this.getSpacedPoints(s),t)},getDistancePoints:function(t){var e=this.getLength(),i=Math.max(1,e/t);return this.getSpacedPoints(i)},getEndPoint:function(t){return void 0===t&&(t=new a),this.getPointAt(1,t)},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,i=[],s=this.getPoint(0,this._tmpVec2A),r=0;i.push(0);for(var n=1;n<=t;n++)r+=(e=this.getPoint(n/t,this._tmpVec2B)).distance(s),i.push(r),s.copy(e);return this.cacheArcLengths=i,i},getPointAt:function(t,e){var i=this.getUtoTmapping(t);return this.getPoint(i,e)},getPoints:function(t,e,i){void 0===i&&(i=[]),t||(t=e?this.getLength()/e:this.defaultDivisions);for(var s=0;s<=t;s++)i.push(this.getPoint(s/t));return i},getRandomPoint:function(t){return void 0===t&&(t=new a),this.getPoint(Math.random(),t)},getSpacedPoints:function(t,e,i){void 0===i&&(i=[]),t||(t=e?this.getLength()/e:this.defaultDivisions);for(var s=0;s<=t;s++){var r=this.getUtoTmapping(s/t,null,t);i.push(this.getPoint(r))}return i},getStartPoint:function(t){return void 0===t&&(t=new a),this.getPointAt(0,t)},getTangent:function(t,e){void 0===e&&(e=new a);var i=1e-4,s=t-i,r=t+i;return s<0&&(s=0),r>1&&(r=1),this.getPoint(s,this._tmpVec2A),this.getPoint(r,e),e.subtract(this._tmpVec2A).normalize()},getTangentAt:function(t,e){var i=this.getUtoTmapping(t);return this.getTangent(i,e)},getTFromDistance:function(t,e){return t<=0?0:this.getUtoTmapping(0,t,e)},getUtoTmapping:function(t,e,i){var s,r=this.getLengths(i),n=0,a=r.length;s=e?Math.min(e,r[a-1]):t*r[a-1];for(var o,h=0,l=a-1;h<=l;)if((o=r[n=Math.floor(h+(l-h)/2)]-s)<0)h=n+1;else{if(!(o>0)){l=n;break}l=n-1}if(r[n=l]===s)return n/(a-1);var u=r[n];return(n+(s-u)/(r[n+1]-u))/(a-1)},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()}});t.exports=o},73825(t,e,i){var s=i(83419),r=i(80021),n=i(39506),a=i(35154),o=i(43396),h=i(26099),l=new s({Extends:r,initialize:function(t,e,i,s,o,l,u,d){if("object"==typeof t){var c=t;t=a(c,"x",0),e=a(c,"y",0),i=a(c,"xRadius",0),s=a(c,"yRadius",i),o=a(c,"startAngle",0),l=a(c,"endAngle",360),u=a(c,"clockwise",!1),d=a(c,"rotation",0)}else void 0===s&&(s=i),void 0===o&&(o=0),void 0===l&&(l=360),void 0===u&&(u=!1),void 0===d&&(d=0);r.call(this,"EllipseCurve"),this.p0=new h(t,e),this._xRadius=i,this._yRadius=s,this._startAngle=n(o),this._endAngle=n(l),this._clockwise=u,this._rotation=n(d)},getStartPoint:function(t){return void 0===t&&(t=new h),this.getPoint(0,t)},getResolution:function(t){return 2*t},getPoint:function(t,e){void 0===e&&(e=new h);for(var i=2*Math.PI,s=this._endAngle-this._startAngle,r=Math.abs(s)i;)s-=i;si.length-2?i.length-1:n+1],d=i[n>i.length-3?i.length-1:n+2];return e.set(s(o,h.x,l.x,u.x,d.x),s(o,h.y,l.y,u.y,d.y))},toJSON:function(){for(var t=[],e=0;e=e)return this.curves[s];s++}return null},getEndPoint:function(t){return void 0===t&&(t=new c),this.curves.length>0?this.curves[this.curves.length-1].getPoint(1,t):t.copy(this.startPoint),t},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},getPoint:function(t,e){void 0===e&&(e=new c);for(var i=t*this.getLength(),s=this.getCurveLengths(),r=0;r=i){var n=s[r]-i,a=this.curves[r],o=a.getLength(),h=0===o?0:1-n/o;return a.getPointAt(h,e)}r++}return null},getPoints:function(t,e){t||e||(t=this.defaultDivisions);for(var i,s=[],r=0;r1&&!s[s.length-1].equals(s[0])&&s.push(s[0]),s},getRandomPoint:function(t){return void 0===t&&(t=new c),this.getPoint(Math.random(),t)},getSpacedPoints:function(t){void 0===t&&(t=40);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e},getStartPoint:function(t){return void 0===t&&(t=new c),t.copy(this.startPoint)},getTangent:function(t,e){void 0===e&&(e=new c);for(var i=t*this.getLength(),s=this.getCurveLengths(),r=0;r=i){var n=s[r]-i,a=this.curves[r],o=a.getLength(),h=0===o?0:1-n/o;return a.getTangentAt(h,e)}r++}return null},lineTo:function(t,e){t instanceof c?this._tmpVec2B.copy(t):"object"==typeof t?this._tmpVec2B.setFromObject(t):this._tmpVec2B.set(t,e);var i=this.getEndPoint(this._tmpVec2A);return this.add(new o([i.x,i.y,this._tmpVec2B.x,this._tmpVec2B.y]))},splineTo:function(t){return t.unshift(this.getEndPoint()),this.add(new d(t))},moveTo:function(t,e){return t instanceof c?this.add(new h(t.x,t.y)):this.add(new h(t,e))},toJSON:function(){for(var t=[],e=0;e=9&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){var n=parseInt(RegExp.$1,10),a=parseInt(RegExp.$2,10);(10===n&&a>=11||n>10)&&(r.dolby=!0)}}}catch(t){}return r}()},84148(t,e,i){var s,r=i(25892),n={chrome:!1,chromeVersion:0,edge:!1,firefox:!1,firefoxVersion:0,ie:!1,ieVersion:0,mobileSafari:!1,opera:!1,safari:!1,safariVersion:0,silk:!1,trident:!1,tridentVersion:0,es2019:!1};t.exports=(s=navigator.userAgent,/Edg\/\d+/.test(s)?(n.edge=!0,n.es2019=!0):/OPR/.test(s)?(n.opera=!0,n.es2019=!0):/Chrome\/(\d+)/.test(s)&&!r.windowsPhone?(n.chrome=!0,n.chromeVersion=parseInt(RegExp.$1,10),n.es2019=n.chromeVersion>69):/Firefox\D+(\d+)/.test(s)?(n.firefox=!0,n.firefoxVersion=parseInt(RegExp.$1,10),n.es2019=n.firefoxVersion>10):/AppleWebKit\/(?!.*CriOS)/.test(s)&&r.iOS?(n.mobileSafari=!0,n.es2019=!0):/MSIE (\d+\.\d+);/.test(s)?(n.ie=!0,n.ieVersion=parseInt(RegExp.$1,10)):/Version\/(\d+\.\d+(\.\d+)?) Safari/.test(s)&&!r.windowsPhone?(n.safari=!0,n.safariVersion=parseInt(RegExp.$1,10),n.es2019=n.safariVersion>10):/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(s)&&(n.ie=!0,n.trident=!0,n.tridentVersion=parseInt(RegExp.$1,10),n.ieVersion=parseInt(RegExp.$3,10)),/Silk/.test(s)&&(n.silk=!0),n)},89289(t,e,i){var s,r,n,a=i(27919),o={supportInverseAlpha:!1,supportNewBlendModes:!1};t.exports=("function"!=typeof importScripts&&void 0!==document&&(o.supportNewBlendModes=(s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",r="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",(n=new Image).onload=function(){var t=new Image;t.onload=function(){var e=a.create2D(t,6).getContext("2d",{willReadFrequently:!0});if(e.globalCompositeOperation="multiply",e.drawImage(n,0,0),e.drawImage(t,2,0),!e.getImageData(2,0,1,1))return!1;var i=e.getImageData(2,0,1,1).data;a.remove(t),o.supportNewBlendModes=255===i[0]&&0===i[1]&&0===i[2]},t.src=s+"/wCKxvRF"+r},n.src=s+"AP804Oa6"+r,!1),o.supportInverseAlpha=function(){var t=a.create2D(this,2).getContext("2d",{willReadFrequently:!0});t.fillStyle="rgba(10, 20, 30, 0.5)",t.fillRect(0,0,1,1);var e=t.getImageData(0,0,1,1);if(null===e)return!1;t.putImageData(e,1,0);var i=t.getImageData(1,0,1,1),s=i.data[0]===e.data[0]&&i.data[1]===e.data[1]&&i.data[2]===e.data[2]&&i.data[3]===e.data[3];return a.remove(this),s}()),o)},89357(t,e,i){var s=i(25892),r=i(84148),n=i(27919),a={canvas:!1,canvasBitBltShift:null,file:!1,fileSystem:!1,getUserMedia:!0,littleEndian:!1,localStorage:!1,pointerLock:!1,stableSort:!1,support32bit:!1,vibration:!1,webGL:!1,worker:!1};t.exports=function(){if("function"==typeof importScripts)return a;a.canvas=!!window.CanvasRenderingContext2D;try{a.localStorage=!!localStorage.getItem}catch(t){a.localStorage=!1}a.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),a.fileSystem=!!window.requestFileSystem;var t,e,i,o=!1;return a.webGL=function(){if(window.WebGLRenderingContext)try{var t=n.createWebGL(this),e=t.getContext("webgl")||t.getContext("experimental-webgl"),i=n.create2D(this),s=i.getContext("2d",{willReadFrequently:!0}).createImageData(1,1);return o=s.data instanceof Uint8ClampedArray,n.remove(t),n.remove(i),!!e}catch(t){return!1}return!1}(),a.worker=!!window.Worker,a.pointerLock="pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||navigator.oGetUserMedia,window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,a.getUserMedia=a.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,r.firefox&&r.firefoxVersion<21&&(a.getUserMedia=!1),!s.iOS&&(r.ie||r.firefox||r.chrome)&&(a.canvasBitBltShift=!0),(r.safari||r.mobileSafari)&&(a.canvasBitBltShift=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(a.vibration=!0),"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint32Array&&(a.littleEndian=(t=new ArrayBuffer(4),e=new Uint8Array(t),i=new Uint32Array(t),e[0]=161,e[1]=178,e[2]=195,e[3]=212,3569595041===i[0]||2712847316!==i[0]&&null)),a.support32bit="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof Int32Array&&null!==a.littleEndian&&o,a}()},91639(t){var e={available:!1,cancel:"",keyboard:!1,request:""};t.exports=function(){if("function"==typeof importScripts)return e;var t,i="Fullscreen",s="FullScreen",r=["request"+i,"request"+s,"webkitRequest"+i,"webkitRequest"+s,"msRequest"+i,"msRequest"+s,"mozRequest"+s,"mozRequest"+i];for(t=0;t=1)&&(r.touch=!0),(navigator.msPointerEnabled||navigator.pointerEnabled)&&(r.mspointer=!0),navigator.getGamepads&&(r.gamepads=!0),"onwheel"in window||s.ie&&"WheelEvent"in window?r.wheelEvent="wheel":"onmousewheel"in window?r.wheelEvent="mousewheel":s.firefox&&"MouseScrollEvent"in window&&(r.wheelEvent="DOMMouseScroll")),r)},25892(t){var e={android:!1,chromeOS:!1,cordova:!1,crosswalk:!1,desktop:!1,ejecta:!1,electron:!1,iOS:!1,iOSVersion:0,iPad:!1,iPhone:!1,kindle:!1,linux:!1,macOS:!1,node:!1,nodeWebkit:!1,pixelRatio:1,webApp:!1,windows:!1,windowsPhone:!1};t.exports=function(){if("function"==typeof importScripts)return e;var t=navigator.userAgent;/Windows/.test(t)?e.windows=!0:/Mac OS/.test(t)&&!/like Mac OS/.test(t)?navigator.maxTouchPoints&&navigator.maxTouchPoints>2?(e.iOS=!0,e.iPad=!0,navigator.appVersion.match(/Version\/(\d+)/),e.iOSVersion=parseInt(RegExp.$1,10)):e.macOS=!0:/Android/.test(t)?e.android=!0:/Linux/.test(t)?e.linux=!0:/iP[ao]d|iPhone/i.test(t)?(e.iOS=!0,navigator.appVersion.match(/OS (\d+)/),e.iOSVersion=parseInt(RegExp.$1,10),e.iPhone=-1!==t.toLowerCase().indexOf("iphone"),e.iPad=-1!==t.toLowerCase().indexOf("ipad")):/Kindle/.test(t)||/\bKF[A-Z][A-Z]+/.test(t)||/Silk.*Mobile Safari/.test(t)?e.kindle=!0:/CrOS/.test(t)&&(e.chromeOS=!0),(/Windows Phone/i.test(t)||/IEMobile/i.test(t))&&(e.android=!1,e.iOS=!1,e.macOS=!1,e.windows=!0,e.windowsPhone=!0);var i=/Silk/.test(t);return(e.windows||e.macOS||e.linux&&!i||e.chromeOS)&&(e.desktop=!0),(e.windowsPhone||/Windows NT/i.test(t)&&/Touch/i.test(t))&&(e.desktop=!1),navigator.standalone&&(e.webApp=!0),"function"!=typeof importScripts&&(void 0!==window.cordova&&(e.cordova=!0),void 0!==window.ejecta&&(e.ejecta=!0)),"undefined"!=typeof process&&process.versions&&process.versions.node&&(e.node=!0),e.node&&"object"==typeof process.versions&&(e.nodeWebkit=!!process.versions["node-webkit"],e.electron=!!process.versions.electron),/Crosswalk/.test(t)&&(e.crosswalk=!0),e.pixelRatio=window.devicePixelRatio||1,e}()},43267(t,e,i){var s=i(95540),r={h264:!1,hls:!1,mov:!1,mp4:!1,m4v:!1,ogg:!1,vp9:!1,webm:!1,hasRequestVideoFrame:!1};t.exports=function(){if("function"==typeof importScripts)return r;var t=document.createElement("video"),e=!!t.canPlayType,i=/^no$/;try{e&&(t.canPlayType('video/ogg; codecs="theora"').replace(i,"")&&(r.ogg=!0),t.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(i,"")&&(r.h264=!0,r.mp4=!0),t.canPlayType('video/quicktime4; codecs="avc1.42E01E"').replace(i,"")&&(r.mov=!0),t.canPlayType("video/x-m4v").replace(i,"")&&(r.m4v=!0),t.canPlayType('video/webm; codecs="vp8, vorbis"').replace(i,"")&&(r.webm=!0),t.canPlayType('video/webm; codecs="vp9"').replace(i,"")&&(r.vp9=!0),t.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(i,"")&&(r.hls=!0))}catch(t){}return t.parentNode&&t.parentNode.removeChild(t),r.getVideoURL=function(t){Array.isArray(t)||(t=[t]);for(var e=0;e4096&&(r=Math.ceil(s/4096),s=4096),this.dataTextureResolution[0]=s,this.dataTextureResolution[1]=r;var n=new ArrayBuffer(s*r*4),o=new Uint32Array(n),l=new Uint8Array(n),u=0,d=65536;o[u++]=Math.round(this.bands[0].start*d),o[u++]=Math.round(this.bands[this.bands.length-1].end*d);for(var c=0;c<=e;c++)for(var f=Math.pow(2,c),p=1;po.end&&(o.end=o.start)}return i&&(this.bands=r.filter(function(t){return t.start=t){e=s;break}}return e?(t=(t-e.start)/(e.end-e.start),e.getColor(t)):{r:0,g:0,b:0,a:0,color:0}},destroy:function(){this.scene=null,this.dataTexture&&this.dataTexture.destroy()}});t.exports=l},51767(t,e,i){var s=i(83419),r=i(29747),n=new s({initialize:function(t,e,i){this._rgb=[0,0,0],this.onChangeCallback=r,this.dirty=!1,this.set(t,e,i)},set:function(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this._rgb=[t,e,i],this.onChange(),this},equals:function(t,e,i){var s=this._rgb;return s[0]===t&&s[1]===e&&s[2]===i},onChange:function(){this.dirty=!0;var t=this._rgb;this.onChangeCallback.call(this,t[0],t[1],t[2])},r:{get:function(){return this._rgb[0]},set:function(t){this._rgb[0]=t,this.onChange()}},g:{get:function(){return this._rgb[1]},set:function(t){this._rgb[1]=t,this.onChange()}},b:{get:function(){return this._rgb[2]},set:function(t){this._rgb[2]=t,this.onChange()}},destroy:function(){this.onChangeCallback=null}});t.exports=n},60461(t){t.exports={TOP_LEFT:0,TOP_CENTER:1,TOP_RIGHT:2,LEFT_TOP:3,LEFT_CENTER:4,LEFT_BOTTOM:5,CENTER:6,RIGHT_TOP:7,RIGHT_CENTER:8,RIGHT_BOTTOM:9,BOTTOM_LEFT:10,BOTTOM_CENTER:11,BOTTOM_RIGHT:12}},54312(t,e,i){var s=i(62235),r=i(35893),n=i(86327),a=i(88417);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,r(e)+i),n(t,s(e)+o),t}},46768(t,e,i){var s=i(62235),r=i(26541),n=i(86327),a=i(385);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,r(e)-i),n(t,s(e)+o),t}},35827(t,e,i){var s=i(62235),r=i(54380),n=i(86327),a=i(40136);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,r(e)+i),n(t,s(e)+o),t}},46871(t,e,i){var s=i(66786),r=i(35893),n=i(7702);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),s(t,r(e)+i,n(e)+a),t}},5198(t,e,i){var s=i(7702),r=i(26541),n=i(20786),a=i(385);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,r(e)-i),n(t,s(e)+o),t}},11879(t,e,i){var s=i(60461),r=[];r[s.BOTTOM_CENTER]=i(54312),r[s.BOTTOM_LEFT]=i(46768),r[s.BOTTOM_RIGHT]=i(35827),r[s.CENTER]=i(46871),r[s.LEFT_CENTER]=i(5198),r[s.RIGHT_CENTER]=i(80503),r[s.TOP_CENTER]=i(89698),r[s.TOP_LEFT]=i(922),r[s.TOP_RIGHT]=i(21373),r[s.LEFT_BOTTOM]=r[s.BOTTOM_LEFT],r[s.LEFT_TOP]=r[s.TOP_LEFT],r[s.RIGHT_BOTTOM]=r[s.BOTTOM_RIGHT],r[s.RIGHT_TOP]=r[s.TOP_RIGHT];t.exports=function(t,e,i,s,n){return r[i](t,e,s,n)}},80503(t,e,i){var s=i(7702),r=i(54380),n=i(20786),a=i(40136);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,r(e)+i),n(t,s(e)+o),t}},89698(t,e,i){var s=i(35893),r=i(17717),n=i(88417),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,s(e)+i),a(t,r(e)-o),t}},922(t,e,i){var s=i(26541),r=i(17717),n=i(385),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,s(e)-i),a(t,r(e)-o),t}},21373(t,e,i){var s=i(54380),r=i(17717),n=i(40136),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,s(e)+i),a(t,r(e)-o),t}},91660(t,e,i){t.exports={BottomCenter:i(54312),BottomLeft:i(46768),BottomRight:i(35827),Center:i(46871),LeftCenter:i(5198),QuickSet:i(11879),RightCenter:i(80503),TopCenter:i(89698),TopLeft:i(922),TopRight:i(21373)}},71926(t,e,i){var s=i(60461),r=i(79291),n={In:i(91660),To:i(16694)};n=r(!1,n,s),t.exports=n},21578(t,e,i){var s=i(62235),r=i(35893),n=i(88417),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,r(e)+i),a(t,s(e)+o),t}},10210(t,e,i){var s=i(62235),r=i(26541),n=i(385),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,r(e)-i),a(t,s(e)+o),t}},82341(t,e,i){var s=i(62235),r=i(54380),n=i(40136),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,r(e)+i),a(t,s(e)+o),t}},87958(t,e,i){var s=i(62235),r=i(26541),n=i(86327),a=i(40136);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,r(e)-i),n(t,s(e)+o),t}},40080(t,e,i){var s=i(7702),r=i(26541),n=i(20786),a=i(40136);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,r(e)-i),n(t,s(e)+o),t}},88466(t,e,i){var s=i(26541),r=i(17717),n=i(40136),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,s(e)-i),a(t,r(e)-o),t}},38829(t,e,i){var s=i(60461),r=[];r[s.BOTTOM_CENTER]=i(21578),r[s.BOTTOM_LEFT]=i(10210),r[s.BOTTOM_RIGHT]=i(82341),r[s.LEFT_BOTTOM]=i(87958),r[s.LEFT_CENTER]=i(40080),r[s.LEFT_TOP]=i(88466),r[s.RIGHT_BOTTOM]=i(19211),r[s.RIGHT_CENTER]=i(34609),r[s.RIGHT_TOP]=i(48741),r[s.TOP_CENTER]=i(49440),r[s.TOP_LEFT]=i(81288),r[s.TOP_RIGHT]=i(61323);t.exports=function(t,e,i,s,n){return r[i](t,e,s,n)}},19211(t,e,i){var s=i(62235),r=i(54380),n=i(86327),a=i(385);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,r(e)+i),n(t,s(e)+o),t}},34609(t,e,i){var s=i(7702),r=i(54380),n=i(20786),a=i(385);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,r(e)+i),n(t,s(e)+o),t}},48741(t,e,i){var s=i(54380),r=i(17717),n=i(385),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,s(e)+i),a(t,r(e)-o),t}},49440(t,e,i){var s=i(35893),r=i(17717),n=i(86327),a=i(88417);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)+i),n(t,r(e)-o),t}},81288(t,e,i){var s=i(26541),r=i(17717),n=i(86327),a=i(385);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)-i),n(t,r(e)-o),t}},61323(t,e,i){var s=i(54380),r=i(17717),n=i(86327),a=i(40136);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)+i),n(t,r(e)-o),t}},16694(t,e,i){t.exports={BottomCenter:i(21578),BottomLeft:i(10210),BottomRight:i(82341),LeftBottom:i(87958),LeftCenter:i(40080),LeftTop:i(88466),QuickSet:i(38829),RightBottom:i(19211),RightCenter:i(34609),RightTop:i(48741),TopCenter:i(49440),TopLeft:i(81288),TopRight:i(61323)}},66786(t,e,i){var s=i(88417),r=i(20786);t.exports=function(t,e,i){return s(t,e),r(t,i)}},62235(t){t.exports=function(t){return t.y+t.height-t.height*t.originY}},72873(t,e,i){var s=i(62235),r=i(26541),n=i(54380),a=i(17717),o=i(87841);t.exports=function(t,e){void 0===e&&(e=new o);var i=r(t),h=a(t);return e.x=i,e.y=h,e.width=n(t)-i,e.height=s(t)-h,e}},35893(t){t.exports=function(t){return t.x-t.width*t.originX+.5*t.width}},7702(t){t.exports=function(t){return t.y-t.height*t.originY+.5*t.height}},26541(t){t.exports=function(t){return t.x-t.width*t.originX}},87431(t){t.exports=function(t){return t.width*t.originX}},46928(t){t.exports=function(t){return t.height*t.originY}},54380(t){t.exports=function(t){return t.x+t.width-t.width*t.originX}},17717(t){t.exports=function(t){return t.y-t.height*t.originY}},86327(t){t.exports=function(t,e){return t.y=e-t.height+t.height*t.originY,t}},88417(t){t.exports=function(t,e){var i=t.width*t.originX;return t.x=e+i-.5*t.width,t}},20786(t){t.exports=function(t,e){var i=t.height*t.originY;return t.y=e+i-.5*t.height,t}},385(t){t.exports=function(t,e){return t.x=e+t.width*t.originX,t}},40136(t){t.exports=function(t,e){return t.x=e-t.width+t.width*t.originX,t}},66737(t){t.exports=function(t,e){return t.y=e+t.height*t.originY,t}},58724(t,e,i){t.exports={CenterOn:i(66786),GetBottom:i(62235),GetBounds:i(72873),GetCenterX:i(35893),GetCenterY:i(7702),GetLeft:i(26541),GetOffsetX:i(87431),GetOffsetY:i(46928),GetRight:i(54380),GetTop:i(17717),SetBottom:i(86327),SetCenterX:i(88417),SetCenterY:i(20786),SetLeft:i(385),SetRight:i(40136),SetTop:i(66737)}},20623(t){t.exports={setCrisp:function(t){return["optimizeSpeed","-moz-crisp-edges","-o-crisp-edges","-webkit-optimize-contrast","optimize-contrast","crisp-edges","pixelated"].forEach(function(e){t.style["image-rendering"]=e}),t.style.msInterpolationMode="nearest-neighbor",t},setBicubic:function(t){return t.style["image-rendering"]="auto",t.style.msInterpolationMode="bicubic",t}}},27919(t,e,i){var s,r,n,a=i(8054),o=i(68703),h=[],l=!1;t.exports=(n=function(){var t=0;return h.forEach(function(e){e.parent&&t++}),t},{create2D:function(t,e,i){return s(t,e,i,a.CANVAS)},create:s=function(t,e,i,s,n){var u;void 0===e&&(e=1),void 0===i&&(i=1),void 0===s&&(s=a.CANVAS),void 0===n&&(n=!1);var d=r(s);return null===d?(d={parent:t,canvas:document.createElement("canvas"),type:s},s===a.CANVAS&&h.push(d),u=d.canvas):(d.parent=t,u=d.canvas),n&&(d.parent=u),u.width=e,u.height=i,l&&s===a.CANVAS&&o.disable(u.getContext("2d",{willReadFrequently:!1})),u},createWebGL:function(t,e,i){return s(t,e,i,a.WEBGL)},disableSmoothing:function(){l=!0},enableSmoothing:function(){l=!1},first:r=function(t){if(void 0===t&&(t=a.CANVAS),t===a.WEBGL)return null;for(var e=0;e=0;e--)i.push({r:e,g:a,b:o,color:s(e,a,o)});for(n=0,e=0;e<=r;e++,a--)i.push({r:n,g:a,b:e,color:s(n,a,e)});for(a=0,o=255,e=0;e<=r;e++,o--,n++)i.push({r:n,g:a,b:o,color:s(n,a,o)});if(1024===t)return i;var h=[],l=0,u=1024/t;for(e=0;e>16&255,g:t>>8&255,b:255&t,a:255};return t>16777215&&(e.a=t>>>24),e}},62957(t){t.exports=function(t){var e=t.toString(16);return 1===e.length?"0"+e:e}},37589(t){t.exports=function(t,e,i){return t<<16|e<<8|i}},1e3(t){t.exports=function(t,e,i,s){return s<<24|t<<16|e<<8|i}},62183(t,e,i){var s=i(40987),r=i(89528);t.exports=function(t,e,i,n){n||(n=new s);var a=i,o=i,h=i;if(0!==e){var l=i<.5?i*(1+e):i+e-i*e,u=2*i-l;a=r(u,l,t+1/3),o=r(u,l,t),h=r(u,l,t-1/3)}return n.setGLTo(a,o,h,1)}},27939(t,e,i){var s=i(7537);t.exports=function(t,e){void 0===t&&(t=1),void 0===e&&(e=1);for(var i=[],r=0;r<=359;r++)i.push(s(r/359,t,e));return i}},7537(t,e,i){var s=i(37589);function r(t,e,i,s){var r=(t+6*e)%6,n=Math.min(r,4-r,1);return Math.round(255*(s-s*i*Math.max(0,n)))}t.exports=function(t,e,i,n){void 0===e&&(e=1),void 0===i&&(i=1);var a=r(5,t,e,i),o=r(3,t,e,i),h=r(1,t,e,i);return n?n.setTo?n.setTo(a,o,h,n.alpha,!0):(n.r=a,n.g=o,n.b=h,n.color=s(a,o,h),n):{r:a,g:o,b:h,color:s(a,o,h)}}},70238(t,e,i){var s=i(40987);t.exports=function(t,e){e||(e=new s),t=t.replace(/^(?:#|0x)?([a-f\d])([a-f\d])([a-f\d])$/i,function(t,e,i,s){return e+e+i+i+s+s});var i=/^(?:#|0x)?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);if(i){var r=parseInt(i[1],16),n=parseInt(i[2],16),a=parseInt(i[3],16);e.setTo(r,n,a)}return e}},89528(t){t.exports=function(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}},30100(t,e,i){var s=i(40987),r=i(90664);t.exports=function(t,e){var i=r(t);return e?e.setTo(i.r,i.g,i.b,i.a):new s(i.r,i.g,i.b,i.a)}},90664(t){t.exports=function(t){return t>16777215?{a:t>>>24,r:t>>16&255,g:t>>8&255,b:255&t}:{a:255,r:t>>16&255,g:t>>8&255,b:255&t}}},13699(t,e,i){var s=i(28915),r=i(37589),n=i(7537),a=function(t,e,i,n,a,o,h,l){void 0===h&&(h=100),void 0===l&&(l=0);var u=l/h,d=s(t,n,u),c=s(e,a,u),f=s(i,o,u);return{r:d,g:c,b:f,a:255,color:r(d,c,f)}},o=function(t,e,i,r,a,o,h,l,u){if(void 0===u&&(u=0),0===u){var d=t-r;d>.5?t-=1:d<-.5&&(t+=1)}else u>0?t>r&&(t-=1):tt?s.ORIENTATION.PORTRAIT:s.ORIENTATION.LANDSCAPE}},74403(t){t.exports=function(t){var e;return""!==t&&("string"==typeof t?e=document.getElementById(t):t&&1===t.nodeType&&(e=t)),e||(e=document.body),e}},56836(t){t.exports=function(t){var e="";try{if(window.DOMParser)e=(new DOMParser).parseFromString(t,"text/xml");else(e=new ActiveXObject("Microsoft.XMLDOM")).loadXML(t)}catch(t){e=null}return e&&e.documentElement&&!e.getElementsByTagName("parsererror").length?e:null}},35846(t){t.exports=function(t){t.parentNode&&t.parentNode.removeChild(t)}},43092(t,e,i){var s=i(83419),r=i(29747),n=new s({initialize:function(){this.isRunning=!1,this.callback=r,this.isSetTimeOut=!1,this.timeOutID=null,this.delay=0;var t=this;this.step=function e(i){t.callback(i),t.isRunning&&(t.timeOutID=window.requestAnimationFrame(e))},this.stepTimeout=function e(){t.isRunning&&(t.timeOutID=window.setTimeout(e,t.delay)),t.callback(window.performance.now())}},start:function(t,e,i){this.isRunning||(this.callback=t,this.isSetTimeOut=e,this.delay=i,this.isRunning=!0,this.timeOutID=e?window.setTimeout(this.stepTimeout,0):window.requestAnimationFrame(this.step))},stop:function(){this.isRunning=!1,this.isSetTimeOut?clearTimeout(this.timeOutID):window.cancelAnimationFrame(this.timeOutID)},destroy:function(){this.stop(),this.callback=r}});t.exports=n},84902(t,e,i){var s={AddToDOM:i(40366),DOMContentLoaded:i(57264),GetInnerHeight:i(57811),GetScreenOrientation:i(45818),GetTarget:i(74403),ParseXML:i(56836),RemoveFromDOM:i(35846),RequestAnimationFrame:i(43092)};t.exports=s},47565(t,e,i){var s=i(83419),r=i(50792),n=i(37277),a=new s({Extends:r,initialize:function(){r.call(this)},shutdown:function(){this.removeAllListeners()},destroy:function(){this.removeAllListeners()}});n.register("EventEmitter",a,"events"),t.exports=a},93055(t,e,i){t.exports={EventEmitter:i(47565)}},10189(t,e,i){var s=i(83419),r=i(13045),n=new s({Extends:r,initialize:function(t,e){void 0===e&&(e=1),r.call(this,t,"FilterBarrel"),this.amount=e}});t.exports=n},16762(t,e,i){var s=i(83419),r=i(13045),n=new s({Extends:r,initialize:function(t,e,i,s,n){void 0===e&&(e="__WHITE"),void 0===i&&(i=0),void 0===s&&(s=1),void 0===n&&(n=[1,1,1,1]),r.call(this,t,"FilterBlend"),this.glTexture,this.blendMode=i,this.amount=s,this.color=n,this.setTexture(e)},setTexture:function(t){var e=this.camera.scene.sys.textures.getFrame(t);return e&&(this.glTexture=e.glTexture),this}});t.exports=n},37597(t,e,i){var s=i(83419),r=i(13045),n=new s({Extends:r,initialize:function(t,e){r.call(this,t,"FilterBlocky"),this.size={x:4,y:4},this.offset={x:0,y:0},e&&(void 0!==e.size&&("number"==typeof e.size?(this.size.x=e.size,this.size.y=e.size):(this.size.x=e.size.x,this.size.y=e.size.y)),void 0!==e.offset&&("number"==typeof e.offset?(this.offset.x=e.offset,this.offset.y=e.offset):(this.offset.x=e.offset.x,this.offset.y=e.offset.y)))}});t.exports=n},88344(t,e,i){var s=i(83419),r=i(13045),n=new s({Extends:r,initialize:function(t,e,i,s,n,a,o){void 0===e&&(e=0),void 0===i&&(i=2),void 0===s&&(s=2),void 0===n&&(n=1),void 0===o&&(o=4),r.call(this,t,"FilterBlur"),this.quality=e,this.x=i,this.y=s,this.strength=n,this.glcolor=[1,1,1],null!=a&&(this.color=a),this.steps=o},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}},getPadding:function(){var t=this.paddingOverride;if(t)return this.currentPadding.setTo(t.x,t.y,t.width,t.height),t;var e=this.quality,i=0===e?1.333:1===e?3.2307692308:5.176470588235294,s=this.steps*this.strength*i,r=Math.ceil(this.x*s),n=Math.ceil(this.y*s);return this.currentPadding.setTo(-r,-n,2*r,2*n),this.currentPadding}});t.exports=n},47564(t,e,i){var s=i(83419),r=i(13045),n=new s({Extends:r,initialize:function(t,e,i,s,n,a,o,h){void 0===e&&(e=.5),void 0===i&&(i=1),void 0===s&&(s=.2),void 0===n&&(n=!1),void 0===a&&(a=1),void 0===o&&(o=1),void 0===h&&(h=1),r.call(this,t,"FilterBokeh"),this.radius=e,this.amount=i,this.contrast=s,this.isTiltShift=n,this.blurX=a,this.blurY=o,this.strength=h},getPadding:function(){var t=this.paddingOverride;if(t)return this.currentPadding.setTo(t.x,t.y,t.width,t.height),t;var e=Math.ceil(this.camera.height*this.radius*.021426096060426905);return this.currentPadding.setTo(-e,-e,2*e,2*e),this.currentPadding}});t.exports=n},77011(t,e,i){var s=i(83419),r=i(13045),n=i(89422),a=new s({Extends:r,initialize:function(t){r.call(this,t,"FilterColorMatrix"),this.colorMatrix=new n},destroy:function(){this.colorMatrix=null,r.prototype.destroy.call(this)}});t.exports=a},95200(t,e,i){var s=i(83419),r=i(13045),n=i(89422),a=new s({Extends:r,initialize:function(t,e){r.call(this,t,"FilterCombineColorMatrix"),this.glTexture,this.colorMatrixSelf=new n,this.colorMatrixTransfer=new n,this.additions=[1,1,1,0],this.multiplications=[0,0,0,1],this.setTexture(e||"__WHITE")},setTexture:function(t){var e=t instanceof Phaser.Textures.Texture?t:this.camera.scene.sys.textures.getFrame(t);return e&&(this.glTexture=e.glTexture),this},setupAlphaTransfer:function(t,e,i,s,r,n){var a=this.colorMatrixSelf,o=this.colorMatrixTransfer;a.reset(),o.reset(),this.additions=[1,1,1,0],this.multiplications=[0,0,0,1],t||a.black(),e||o.black(),r?a.brightnessToAlphaInverse(!0):i&&a.brightnessToAlpha(!0),n?o.brightnessToAlphaInverse(!0):s&&o.brightnessToAlpha(!0)},destroy:function(){this.colorMatrixSelf=null,this.colorMatrixTransfer=null,r.prototype.destroy.call(this)}});t.exports=a},13045(t,e,i){var s=i(83419),r=i(87841),n=new s({initialize:function(t,e){this.active=!0,this.camera=t,this.renderNode=e,this.paddingOverride=new r,this.currentPadding=new r,this.allowBaseDraw=!0,this.ignoreDestroy=!1},getPadding:function(){return this.paddingOverride||this.currentPadding},getPaddingCeil:function(){var t=this.getPadding(),e=new r(Math.ceil(t.x),Math.ceil(t.y),Math.ceil(t.width),Math.ceil(t.height));return this.currentPadding.setTo(e.x,e.y,e.width,e.height),e},setPaddingOverride:function(t,e,i,s){return null===t?(this.paddingOverride=null,this):(void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.paddingOverride=new r(t,e,i-t,s-e),this)},setActive:function(t){return this.active=t,this},destroy:function(){this.active=!1,this.renderNode=null,this.camera=null}});t.exports=n},16898(t,e,i){var s=i(83419),r=i(13045),n=new s({Extends:r,initialize:function(t,e,i,s){void 0===e&&(e="__WHITE"),void 0===i&&(i=.005),void 0===s&&(s=.005),r.call(this,t,"FilterDisplacement"),this.x=i,this.y=s,this.glTexture,this.setTexture(e)},setTexture:function(t){var e=this.camera.scene.sys.textures.getFrame(t);return e&&(this.glTexture=e.glTexture),this},getPadding:function(){var t=this.paddingOverride;if(t)return this.currentPadding.setTo(t.x,t.y,t.width,t.height),t;var e=this.camera,i=Math.ceil(e.width*this.x*.5),s=Math.ceil(e.height*this.y*.5);return this.currentPadding.setTo(-i,-s,2*i,2*s),this.currentPadding}});t.exports=n},42652(t,e,i){var s=i(83419),r=i(13045),n=new s({Extends:r,initialize:function(t,e,i,s,n,a,o,h){void 0===i&&(i=4),void 0===s&&(s=0),void 0===n&&(n=1),void 0===a&&(a=!1),void 0===o&&(o=t.scene.sys.game.config.glowQuality),void 0===h&&(h=t.scene.sys.game.config.glowDistance),r.call(this,t,"FilterGlow"),this.outerStrength=i,this.innerStrength=s,this.scale=n,this.knockout=a,this._quality=Math.max(Math.round(o),1),this._distance=Math.max(Math.round(h),1),this.glcolor=[1,1,1,1],void 0!==e&&(this.color=e)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}},distance:{get:function(){return this._distance}},quality:{get:function(){return this._quality}},getPadding:function(){var t=this.paddingOverride;if(t)return this.currentPadding.setTo(t.x,t.y,t.width,t.height),t;var e=this.currentPadding,i=Math.ceil(this.distance*this.scale);return e.left=-i,e.top=-i,e.right=i,e.bottom=i,e}});t.exports=n},43927(t,e,i){var s=i(83419),r=i(13045),n=i(73043),a=new s({Extends:r,initialize:function(t,e){e||(e={});var i=t.scene;r.call(this,t,"FilterGradientMap");var s=e.ramp;s||(s={colorStart:0,colorEnd:16777215}),s instanceof n||(s=new n(i,s,!0)),this.ramp=s,this.dither=!!e.dither,this.color=[0,0,0,0],e.color&&(this.color[0]=e.color[0]||0,this.color[1]=e.color[1]||0,this.color[2]=e.color[2]||0,this.color[3]=e.color[3]||0),this.colorFactor=[.3,.6,.1,0],e.colorFactor&&(this.colorFactor[0]=e.colorFactor[0]||0,this.colorFactor[1]=e.colorFactor[1]||0,this.colorFactor[2]=e.colorFactor[2]||0,this.colorFactor[3]=e.colorFactor[3]||0),this.unpremultiply=void 0===e.unpremultiply||e.unpremultiply,this.alpha=void 0===e.alpha?1:e.alpha}});t.exports=a},84714(t,e,i){var s=i(83419),r=i(13045),n=i(37867),a=i(61340),o=new s({Extends:r,initialize:function(t,e){r.call(this,t,"FilterImageLight"),this.normalGlTexture,this.environmentGlTexture,this.viewMatrix=new n,this.modelRotation=e.modelRotation||0,this.modelRotationSource=e.modelRotationSource||null,this.bulge=e.bulge||0,this.colorFactor=e.colorFactor||[1,1,1],this._tempMatrix=new a,this._tempParentMatrix=new a,this.setEnvironmentMap(e.environmentMap||"__WHITE"),this.setNormalMap(e.normalMap||"__NORMAL"),e.viewMatrix&&this.viewMatrix.set(e.viewMatrix)},setEnvironmentMap:function(t){var e=t instanceof Phaser.Textures.Texture?t:this.camera.scene.sys.textures.getFrame(t);return e&&(this.environmentGlTexture=e.glTexture),this},setNormalMap:function(t){var e=t instanceof Phaser.Textures.Texture?t:this.camera.scene.sys.textures.getFrame(t);return e&&(this.normalGlTexture=e.glTexture),this},setNormalMapFromGameObject:function(t){var e=t.texture.dataSource[0];return e&&(this.normalGlTexture=e.glTexture),this},getModelRotation:function(){return this.modelRotationSource?"function"==typeof this.modelRotationSource?this.modelRotationSource():this.modelRotationSource.hasTransformComponent?this.modelRotationSource.getWorldTransformMatrix(this._tempMatrix,this._tempParentMatrix).rotationNormalized:this.modelRotation:this.modelRotation}});t.exports=o},51890(t,e,i){var s=i(83419),r=i(13045),n=i(40987),a=new s({Extends:r,initialize:function(t,e){void 0===e&&(e={}),r.call(this,t,"FilterKey"),this.color=[1,1,1,1],void 0!==e.color&&this.setColor(e.color),void 0!==e.alpha&&this.setAlpha(e.alpha),this.isolate=!1,void 0!==e.isolate&&(this.isolate=e.isolate),this.threshold=.0625,void 0!==e.threshold&&(this.threshold=e.threshold),this.feather=0,void 0!==e.feather&&(this.feather=e.feather)},setAlpha:function(t){return this.color[3]=t,this},setColor:function(t){var e=this.color[3];if("number"==typeof t){var i=n.IntegerToRGB(t);this.color=[i.r/255,i.g/255,i.b/255,e]}else if("string"==typeof t){var s=n.HexStringToColor(t);this.color=[s.redGL,s.greenGL,s.blueGL,e]}else Array.isArray(t)?this.color=[t[0],t[1],t[2],e]:t instanceof n&&(this.color=[t.redGL,t.greenGL,t.blueGL,e]);return this}});t.exports=a},97797(t,e,i){var s=i(83419),r=i(45650),n=i(13045),a=new s({Extends:n,initialize:function(t,e,i,s,r,a){void 0===e&&(e="__WHITE"),void 0===i&&(i=!1),void 0===a&&(a=1),n.call(this,t,"FilterMask"),this.glTexture,this._dynamicTexture=null,this.maskGameObject=null,this.invert=i,this.autoUpdate=!0,this.needsUpdate=!1,this.viewTransform=r||"world",this.viewCamera=s,this.scaleFactor=a,"string"==typeof e?this.setTexture(e):this.setGameObject(e)},updateDynamicTexture:function(t,e){var i=this.scaleFactor,s=t*i,n=e*i,a=this.maskGameObject;if(a){if(this._dynamicTexture)this._dynamicTexture.width!==s||this._dynamicTexture.height!==n?this._dynamicTexture.setSize(s,n,!1):this._dynamicTexture.clear();else{var o=this.camera.scene.sys.textures;this._dynamicTexture=o.addDynamicTexture(r(),s,n,!1)}this.glTexture=this._dynamicTexture.get().glTexture;var h=this.viewCamera||a.scene.renderer.currentViewCamera;this._dynamicTexture.capture(a,{transform:this.viewTransform,camera:h}),this._dynamicTexture.render(),this.needsUpdate=!1}},setGameObject:function(t){return this.maskGameObject=t,this.needsUpdate=!0,this},setTexture:function(t){var e=this.camera.scene.sys.textures.getFrame(t);return e&&(this.maskGameObject=null,this.glTexture=e.glTexture),this},destroy:function(){this._dynamicTexture&&this._dynamicTexture.destroy(),this.maskGameObject=null,this._dynamicTexture=null,n.prototype.destroy.call(this)}});t.exports=a},37911(t,e,i){var s=i(83419),r=i(13045),n=i(37867),a=i(25836),o=new s({Extends:r,initialize:function(t,e){e=e||{},r.call(this,t,"FilterNormalTools"),this._rotation=0,this.viewMatrix=new n,this.setRotation(e.rotation||0),this.rotationSource=e.rotationSource||null,this.facingPower=e.facingPower||1,this.outputRatio=e.outputRatio||!1,this.ratioVector=new a(0,0,1),e.ratioVector&&this.ratioVector.set(e.ratioVector[0],e.ratioVector[1],e.ratioVector[2]),this.ratioRadius=e.ratioRadius||1},getRotation:function(){if(this.rotationSource){if("function"==typeof this.rotationSource)return this.rotationSource();if(this.rotationSource.hasTransformComponent)return this.rotationSource.getWorldTransformMatrix().rotationNormalized}return this._rotation},setRotation:function(t){return this.viewMatrix.identity().rotateZ(t),this._rotation=t,this},updateRotation:function(){if(this.rotationSource){var t=this.getRotation();this.viewMatrix.identity().rotateZ(t),this._rotation=t}return this}});t.exports=o},6379(t,e,i){var s=i(83419),r=i(13045),n=new s({Extends:r,initialize:function(t,e){void 0===e&&(e={}),r.call(this,t,"FilterPanoramaBlur"),this.radius=e.radius||1,this.samplesX=e.samplesX||32,this.samplesY=e.samplesY||16,this.power=e.power||1}});t.exports=n},2195(t,e,i){var s=i(83419),r=i(53427),n=i(13045),a=i(16762),o=new s({Extends:n,initialize:function(t){n.call(this,t,"FilterParallelFilters"),this.top=new r(t),this.bottom=new r(t),this.blend=new a(t)}});r.prototype.addParallelFilters=function(){return this.add(new o(this.camera))},t.exports=o},29861(t,e,i){var s=i(83419),r=i(13045),n=new s({Extends:r,initialize:function(t,e){void 0===e&&(e=1),r.call(this,t,"FilterPixelate"),this.amount=e}});t.exports=n},14366(t,e,i){var s=i(83419),r=i(13045),n=new s({Extends:r,initialize:function(t,e){e||(e={}),r.call(this,t,"FilterQuantize"),this.steps=[8,8,8,8],e.steps&&(this.steps[0]=e.steps[0],this.steps[1]=e.steps[1],this.steps[2]=e.steps[2],this.steps[3]=e.steps[3]),this.gamma=[1,1,1,1],e.gamma&&(this.gamma[0]=e.gamma[0],this.gamma[1]=e.gamma[1],this.gamma[2]=e.gamma[2],this.gamma[3]=e.gamma[3]),this.offset=[0,0,0,0],e.offset&&(this.offset[0]=e.offset[0],this.offset[1]=e.offset[1],this.offset[2]=e.offset[2],this.offset[3]=e.offset[3]),this.mode=e.mode||0,this.dither=!!e.dither}});t.exports=n},63785(t,e,i){var s=i(83419),r=i(13045),n=new s({Extends:r,initialize:function(t,e,i){void 0===i&&(i=null),r.call(this,t,"FilterSampler"),this.allowBaseDraw=!1,this.callback=e,this.region=i}});t.exports=n},62229(t,e,i){var s=i(83419),r=i(13045),n=new s({Extends:r,initialize:function(t,e,i,s,n,a,o,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=.1),void 0===n&&(n=1),void 0===o&&(o=6),void 0===h&&(h=1),r.call(this,t,"FilterShadow"),this.x=e,this.y=i,this.decay=s,this.power=n,this.glcolor=[0,0,0,1],this.samples=o,this.intensity=h,void 0!==a&&(this.color=a)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}},getPadding:function(){var t=this.paddingOverride;if(t)return this.currentPadding.setTo(t.x,t.y,t.width,t.height),t;var e=this.camera,i=this.decay*this.intensity,s=Math.ceil(Math.abs(this.x)*e.width*i),r=Math.ceil(Math.abs(this.y)*e.height*i);return this.currentPadding.setTo(-s,-r,2*s,2*r),this.currentPadding}});t.exports=n},99534(t,e,i){var s=i(83419),r=i(13045),n=new s({Extends:r,initialize:function(t,e,i,s){r.call(this,t,"FilterThreshold"),this.edge1=[.5,.5,.5,.5],this.edge2=[.5,.5,.5,.5],this.invert=[!1,!1,!1,!1],this.setEdge(e,i),this.setInvert(s)},setEdge:function(t,e){void 0===t&&(t=.5),"number"==typeof t&&(t=[t,t,t,t]),this.edge1[0]=t[0],this.edge1[1]=t[1],this.edge1[2]=t[2],this.edge1[3]=t[3],void 0===e&&(e=t),"number"==typeof e&&(e=[e,e,e,e]),this.edge2[0]=e[0],this.edge2[1]=e[1],this.edge2[2]=e[2],this.edge2[3]=e[3];for(var i=0;i<4;i++)if(this.edge1[i]>this.edge2[i]){var s=this.edge1[i];this.edge1[i]=this.edge2[i],this.edge2[i]=s}return this},setInvert:function(t){return void 0===t&&(t=!1),"boolean"==typeof t&&(t=[t,t,t,t]),this.invert[0]=t[0],this.invert[1]=t[1],this.invert[2]=t[2],this.invert[3]=t[3],this}});t.exports=n},20263(t,e,i){var s=i(83419),r=i(13045),n=i(40987),a=new s({Extends:r,initialize:function(t,e,i,s,a,o,h){void 0===e&&(e=.5),void 0===i&&(i=.5),void 0===s&&(s=.5),void 0===a&&(a=.5),void 0===o&&(o=0),void 0===h&&(h=0),r.call(this,t,"FilterVignette"),this.x=e,this.y=i,this.radius=s,this.strength=a,this.color=new n,this.blendMode=h,this.setColor(o)},setColor:function(t){return"number"==typeof t?n.IntegerToColor(t,this.color):"string"==typeof t?n.HexStringToColor(t,this.color):t.setTo?this.color.setTo(t.red,t.green,t.blue,t.alpha):t?this.color.setTo(t.r||0,t.g||0,t.b||0,t.a||255):this.color.setTo(0,0,0,255),this}});t.exports=a},90002(t,e,i){var s=i(83419),r=i(13045),n=i(79237),a=new s({Extends:r,initialize:function(t,e,i,s,n,a){void 0===e&&(e=.1),r.call(this,t,"FilterWipe"),this.progress=0,this.wipeWidth=e,this.direction=i||0,this.axis=s||0,this.reveal=n||0,this.wipeTexture=null,this.setTexture(a)},setWipeWidth:function(t){return void 0===t&&(t=.1),this.wipeWidth=t,this},setLeftToRight:function(){return this.direction=0,this.axis=0,this},setRightToLeft:function(){return this.direction=1,this.axis=0,this},setTopToBottom:function(){return this.direction=1,this.axis=1,this},setBottomToTop:function(){return this.direction=0,this.axis=1,this},setWipeEffect:function(){return this.reveal=0,this.progress=0,this},setRevealEffect:function(){return this.setTexture(),this.reveal=1,this.progress=0,this},setTexture:function(t){return void 0===t&&(t="__DEFAULT"),this.wipeTexture=t instanceof n?t:this.camera.scene.sys.textures.get(t)||this.camera.scene.sys.textures.get("__DEFAULT"),this},setProgress:function(t){return this.progress=t,this}});t.exports=a},11889(t,e,i){var s={Controller:i(13045),Barrel:i(10189),Blend:i(16762),Blocky:i(37597),Blur:i(88344),Bokeh:i(47564),ColorMatrix:i(77011),CombineColorMatrix:i(95200),Displacement:i(16898),Glow:i(42652),GradientMap:i(43927),ImageLight:i(84714),Key:i(51890),Mask:i(97797),NormalTools:i(37911),PanoramaBlur:i(6379),ParallelFilters:i(2195),Pixelate:i(29861),Quantize:i(14366),Sampler:i(63785),Shadow:i(62229),Threshold:i(99534),Vignette:i(20263),Wipe:i(90002)};t.exports=s},25305(t,e,i){var s=i(10312),r=i(23568);t.exports=function(t,e,i){e.x=r(i,"x",0),e.y=r(i,"y",0),e.depth=r(i,"depth",0),e.flipX=r(i,"flipX",!1),e.flipY=r(i,"flipY",!1);var n=r(i,"scale",null);"number"==typeof n?e.setScale(n):null!==n&&(e.scaleX=r(n,"x",1),e.scaleY=r(n,"y",1));var a=r(i,"scrollFactor",null);"number"==typeof a?e.setScrollFactor(a):null!==a&&(e.scrollFactorX=r(a,"x",1),e.scrollFactorY=r(a,"y",1)),e.rotation=r(i,"rotation",0);var o=r(i,"angle",null);null!==o&&(e.angle=o),e.alpha=r(i,"alpha",1);var h=r(i,"origin",null);if("number"==typeof h)e.setOrigin(h);else if(null!==h){var l=r(h,"x",.5),u=r(h,"y",.5);e.setOrigin(l,u)}return e.blendMode=r(i,"blendMode",s.NORMAL),e.visible=r(i,"visible",!0),r(i,"add",!0)&&t.sys.displayList.add(e),e.preUpdate&&t.sys.updateList.add(e),e}},13059(t,e,i){var s=i(23568);t.exports=function(t,e){var i=s(e,"anims",null);if(null===i)return t;if("string"==typeof i)t.anims.play(i);else if("object"==typeof i){var r=t.anims,n=s(i,"key",void 0);if(n){var a=s(i,"startFrame",void 0),o=s(i,"delay",0),h=s(i,"repeat",0),l=s(i,"repeatDelay",0),u=s(i,"yoyo",!1),d=s(i,"play",!1),c=s(i,"delayedPlay",0),f={key:n,delay:o,repeat:h,repeatDelay:l,yoyo:u,startFrame:a};d?r.play(f):c>0?r.playAfterDelay(f,c):r.load(f)}}return t}},8050(t,e,i){var s=i(83419),r=i(73162),n=i(37277),a=i(51708),o=i(44594),h=i(19186),l=new s({Extends:r,initialize:function(t){r.call(this,t),this.sortChildrenFlag=!1,this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.addCallback=this.addChildCallback,this.removeCallback=this.removeChildCallback,this.events.once(o.BOOT,this.boot,this),this.events.on(o.START,this.start,this)},boot:function(){this.events.once(o.DESTROY,this.destroy,this)},addChildCallback:function(t){t.displayList&&t.displayList!==this&&t.removeFromDisplayList(),t.parentContainer&&t.parentContainer.remove(t),t.displayList||(this.queueDepthSort(),t.displayList=this,t.emit(a.ADDED_TO_SCENE,t,this.scene),this.events.emit(o.ADDED_TO_SCENE,t,this.scene))},removeChildCallback:function(t){this.queueDepthSort(),t.displayList=null,t.emit(a.REMOVED_FROM_SCENE,t,this.scene),this.events.emit(o.REMOVED_FROM_SCENE,t,this.scene)},start:function(){this.events.once(o.SHUTDOWN,this.shutdown,this)},queueDepthSort:function(){this.sortChildrenFlag=!0},depthSort:function(){this.sortChildrenFlag&&(h(this.list,this.sortByDepth),this.sortChildrenFlag=!1)},sortByDepth:function(t,e){return t._depth-e._depth},getChildren:function(){return this.list},shutdown:function(){for(var t=this.list,e=t.length;e--;)t[e]&&t[e].destroy(!0);t.length=0,this.events.off(o.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(o.START,this.start,this),this.scene=null,this.systems=null,this.events=null}});n.register("DisplayList",l,"displayList"),t.exports=l},95643(t,e,i){var s=i(83419),r=i(31401),n=i(53774),a=i(45893),o=i(50792),h=i(51708),l=i(44594),u=new s({Extends:o,Mixins:[r.Filters,r.RenderSteps],initialize:function(t,e){o.call(this),this.scene=t,this.displayList=null,this.type=e,this.state=0,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.vertexRoundMode="safeAuto",this.input=null,this.body=null,this.ignoreDestroy=!1,this.isDestroyed=!1,this.addRenderStep&&this.addRenderStep(this.renderWebGL),this.on(h.ADDED_TO_SCENE,this.addedToScene,this),this.on(h.REMOVED_FROM_SCENE,this.removedFromScene,this),t.sys.queueDepthSort()},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},setState:function(t){return this.state=t,this},setDataEnabled:function(){return this.data||(this.data=new a(this)),this},setData:function(t,e){return this.data||(this.data=new a(this)),this.data.set(t,e),this},incData:function(t,e){return this.data||(this.data=new a(this)),this.data.inc(t,e),this},toggleData:function(t){return this.data||(this.data=new a(this)),this.data.toggle(t),this},getData:function(t){return this.data||(this.data=new a(this)),this.data.get(t)},setInteractive:function(t,e,i){return this.scene.sys.input.enable(this,t,e,i),this},disableInteractive:function(t){return void 0===t&&(t=!1),this.scene.sys.input.disable(this,t),this},removeInteractive:function(t){return void 0===t&&(t=!1),this.scene.sys.input.clear(this),t&&this.scene.sys.input.resetCursor(),this.input=void 0,this},addedToScene:function(){},removedFromScene:function(){},update:function(){},toJSON:function(){return n(this)},willRender:function(t){return!(!(!this.displayList||!this.displayList.active||this.displayList.willRender(t))||u.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},willRoundVertices:function(t,e){switch(this.vertexRoundMode){case"safe":return e;case"safeAuto":return e&&t.roundPixels;case"full":return!0;case"fullAuto":return t.roundPixels;default:return!1}},setVertexRoundMode:function(t){return this.vertexRoundMode=t,this},getIndexList:function(){for(var t=this,e=this.parentContainer,i=[];e&&(i.unshift(e.getIndex(t)),t=e,e.parentContainer);)e=e.parentContainer;return this.displayList?i.unshift(this.displayList.getIndex(t)):i.unshift(this.scene.sys.displayList.getIndex(t)),i},addToDisplayList:function(t){return void 0===t&&(t=this.scene.sys.displayList),this.displayList&&this.displayList!==t&&this.removeFromDisplayList(),t.exists(this)||(this.displayList=t,t.add(this,!0),t.queueDepthSort(),this.emit(h.ADDED_TO_SCENE,this,this.scene),t.events.emit(l.ADDED_TO_SCENE,this,this.scene)),this},addToUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.add(this),this},removeFromDisplayList:function(){var t=this.displayList||this.scene.sys.displayList;return t&&t.exists(this)&&(t.remove(this,!0),t.queueDepthSort(),this.displayList=null,this.emit(h.REMOVED_FROM_SCENE,this,this.scene),t.events.emit(l.REMOVED_FROM_SCENE,this,this.scene)),this},removeFromUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.remove(this),this},getDisplayList:function(){var t=null;return this.parentContainer?t=this.parentContainer.list:this.displayList&&(t=this.displayList.list),t},destroy:function(t){this.scene&&!this.ignoreDestroy&&(void 0===t&&(t=!1),this.isDestroyed=!0,this.preDestroy&&this.preDestroy.call(this),this.emit(h.DESTROY,this,t),this.removeAllListeners(),this.removeFromDisplayList(),this.removeFromUpdateList(),this.input&&(this.scene.sys.input.clear(this),this.input=void 0),this.data&&(this.data.destroy(),this.data=void 0),this.body&&(this.body.destroy(),this.body=void 0),this.filterCamera&&(this.filterCamera.destroy(),this.filterCamera=void 0),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0)}});u.RENDER_MASK=15,t.exports=u},44603(t,e,i){var s=i(83419),r=i(37277),n=i(44594),a=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.displayList,this.updateList,this.events.once(n.BOOT,this.boot,this),this.events.on(n.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(n.DESTROY,this.destroy,this)},start:function(){this.events.once(n.SHUTDOWN,this.shutdown,this)},shutdown:function(){this.events.off(n.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(n.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});a.register=function(t,e){a.prototype.hasOwnProperty(t)||(a.prototype[t]=e)},a.remove=function(t){a.prototype.hasOwnProperty(t)&&delete a.prototype[t]},r.register("GameObjectCreator",a,"make"),t.exports=a},39429(t,e,i){var s=i(83419),r=i(37277),n=i(44594),a=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.displayList,this.updateList,this.events.once(n.BOOT,this.boot,this),this.events.on(n.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(n.DESTROY,this.destroy,this)},start:function(){this.events.once(n.SHUTDOWN,this.shutdown,this)},existing:function(t){return(t.renderCanvas||t.renderWebGL)&&this.displayList.add(t),t.preUpdate&&this.updateList.add(t),t},shutdown:function(){this.events.off(n.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(n.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});a.register=function(t,e){a.prototype.hasOwnProperty(t)||(a.prototype[t]=e)},a.remove=function(t){a.prototype.hasOwnProperty(t)&&delete a.prototype[t]},r.register("GameObjectFactory",a,"add"),t.exports=a},91296(t,e,i){var s=i(61340),r=new s,n=new s,a=new s,o=new s,h={camera:r,sprite:n,calc:a,cameraExternal:o};t.exports=function(t,e,i,s){return s?o.loadIdentity():o.copyFrom(e.matrixExternal),r.copyWithScrollFactorFrom(s?e.matrix:e.matrixCombined,e.scrollX,e.scrollY,t.scrollFactorX,t.scrollFactorY),a.copyFrom(r),i&&a.multiply(i),n.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),a.multiply(n),h}},45027(t,e,i){var s=i(83419),r=i(25774),n=i(37277),a=i(44594),o=new s({Extends:r,initialize:function(t){r.call(this),this.checkQueue=!0,this.scene=t,this.systems=t.sys,t.sys.events.once(a.BOOT,this.boot,this),t.sys.events.on(a.START,this.start,this)},boot:function(){this.systems.events.once(a.DESTROY,this.destroy,this)},start:function(){var t=this.systems.events;t.on(a.PRE_UPDATE,this.update,this),t.on(a.UPDATE,this.sceneUpdate,this),t.once(a.SHUTDOWN,this.shutdown,this)},sceneUpdate:function(t,e){for(var i=this._active,s=i.length,r=0;r0){a=o.split("\n");var z=[];for(r=0;rC&&(d=C),c>E&&(c=E);var q=C+b.xAdvance,K=E+m;fD&&(D=I),ID&&(D=I),I0)for(var Q=0;Qo.length&&(x=o.length);for(var T=p,w=g,b={retroFont:!0,font:h,size:i,lineHeight:r+y,chars:{}},S=0,C=0;C?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",TEXT_SET2:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET3:"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",TEXT_SET4:"ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789",TEXT_SET5:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789",TEXT_SET6:"ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' ",TEXT_SET7:"AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39",TEXT_SET8:"0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET9:"ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?!",TEXT_SET10:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET11:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789"}},2638(t,e,i){var s=i(22186),r=i(83419),n=i(12310),a=new r({Extends:s,Mixins:[n],initialize:function(t,e,i,r,n,a,o){s.call(this,t,e,i,r,n,a,o),this.type="DynamicBitmapText",this.scrollX=0,this.scrollY=0,this.cropWidth=0,this.cropHeight=0,this.displayCallback,this.callbackData={parent:this,color:0,tint:{topLeft:0,topRight:0,bottomLeft:0,bottomRight:0},index:0,charCode:0,x:0,y:0,scale:0,rotation:0,data:0}},setSize:function(t,e){return this.cropWidth=t,this.cropHeight=e,this},setDisplayCallback:function(t){return this.displayCallback=t,this},setScrollX:function(t){return this.scrollX=t,this},setScrollY:function(t){return this.scrollY=t,this}});t.exports=a},86741(t,e,i){var s=i(20926);t.exports=function(t,e,i,r){var n=e._text,a=n.length,o=t.currentContext;if(0!==a&&s(t,o,e,i,r)){i.addToRenderList(e);var h=e.fromAtlas?e.frame:e.texture.frames.__BASE,l=e.displayCallback,u=e.callbackData,d=e.fontData.chars,c=e.fontData.lineHeight,f=e._letterSpacing,p=0,g=0,m=0,v=null,y=0,x=0,T=0,w=0,b=0,S=0,C=null,E=0,A=e.frame.source.image,_=h.cutX,M=h.cutY,R=0,P=0,O=e._fontSize/e.fontData.size,L=e._align,D=0,F=0;e.getTextBounds(!1);var I=e._bounds.lines;1===L?F=(I.longest-I.lengths[0])/2:2===L&&(F=I.longest-I.lengths[0]),o.translate(-e.displayOriginX,-e.displayOriginY);var N=i.roundPixels;e.cropWidth>0&&e.cropHeight>0&&(o.beginPath(),o.rect(0,0,e.cropWidth,e.cropHeight),o.clip());for(var B=0;B0||e.cropHeight>0;x&&((f=i.getClone()).setScissorEnable(!0),f.setScissorBox(v.tx,v.ty,e.cropWidth*v.scaleX,e.cropHeight*v.scaleY),f.use()),h.frame=e.frame;var T,w,b=r.MULTIPLY,S=a.getTintAppendFloatAlpha(e.tintTopLeft,e._alphaTL),C=a.getTintAppendFloatAlpha(e.tintTopRight,e._alphaTR),E=a.getTintAppendFloatAlpha(e.tintBottomLeft,e._alphaBL),A=a.getTintAppendFloatAlpha(e.tintBottomRight,e._alphaBR),_=0,M=0,R=0,P=0,O=e.letterSpacing,L=0,D=0,F=e.scrollX,I=e.scrollY,N=e.fontData,B=N.chars,k=N.lineHeight,U=e.fontSize/N.size,z=0,Y=e._align,X=0,W=0,G=e.getTextBounds(!1);e.maxWidth>0&&(d=(u=G.wrappedText).length);var V=e._bounds.lines;1===Y?W=(V.longest-V.lengths[0])/2:2===Y&&(W=V.longest-V.lengths[0]);for(var H=e.displayCallback,j=e.callbackData,q=0;q0&&(a=(n=L.wrappedText).length);var D=e._bounds.lines;1===R?O=(D.longest-D.lengths[0])/2:2===R&&(O=D.longest-D.lengths[0]),o.translate(-e.displayOriginX,-e.displayOriginY);for(var F=i.roundPixels,I=0;I0},getRenderList:function(){return this.dirty&&(this.renderList=this.children.list.filter(this.childCanRender,this),this.dirty=!1),this.renderList},clear:function(){this.children.removeAll(),this.dirty=!0},preDestroy:function(){this.children.destroy(),this.renderList=[]}});t.exports=d},72396(t){t.exports=function(t,e,i,s){var r=e.getRenderList();if(0!==r.length){var n=t.currentContext,a=i.alpha*e.alpha;if(0!==a){i.addToRenderList(e),n.globalCompositeOperation=t.blendModes[e.blendMode],n.imageSmoothingEnabled=!e.frame.source.scaleMode;var o=e.x-i.scrollX*e.scrollFactorX,h=e.y-i.scrollY*e.scrollFactorY;n.save(),s&&s.copyToContext(n);for(var l=i.roundPixels,u=0;u0&&p.height>0&&(n.save(),n.translate(d.x+o,d.y+h),n.scale(v,y),n.drawImage(f.source.image,p.x,p.y,p.width,p.height,g,m,p.width,p.height),n.restore())):(l&&(g=Math.round(g),m=Math.round(m)),p.width>0&&p.height>0&&n.drawImage(f.source.image,p.x,p.y,p.width,p.height,g+d.x+o,m+d.y+h,p.width,p.height)))}n.restore()}}}},9403(t,e,i){var s=i(6107),r=i(25305),n=i(44603),a=i(23568);n.register("blitter",function(t,e){void 0===t&&(t={});var i=a(t,"key",null),n=a(t,"frame",null),o=new s(this.scene,0,0,i,n);return void 0!==e&&(t.add=e),r(this.scene,o,t),o})},12709(t,e,i){var s=i(6107);i(39429).register("blitter",function(t,e,i,r){return this.displayList.add(new s(this.scene,t,e,i,r))})},48011(t,e,i){var s=i(29747),r=s,n=s;r=i(99485),n=i(72396),t.exports={renderWebGL:r,renderCanvas:n}},99485(t,e,i){var s=i(61340),r=i(70554),n=new s,a={quad:new Float32Array(8)},o={},h={};t.exports=function(t,e,i,s){var l=e.getRenderList(),u=i.camera,d=e.alpha;if(0!==l.length&&0!==d){u.addToRenderList(e);var c=n.copyWithScrollFactorFrom(u.getViewMatrix(!i.useCanvas),u.scrollX,u.scrollY,e.scrollFactorX,e.scrollFactorY);s&&c.multiply(s);for(var f=e.x,p=e.y,g=e.customRenderNodes,m=e.defaultRenderNodes,v=0;v0!=t>0,this._alpha=t}}});t.exports=n},43451(t,e,i){var s=i(87774),r=i(30529),n=i(83419),a=i(31401),o=i(95643),h=i(36683),l=new n({Extends:o,Mixins:[a.BlendMode,a.Depth,a.RenderNodes,a.Visible,h],initialize:function(t,e){o.call(this,t,"CaptureFrame");var i=t.renderer;this.drawingContext=new s(i,{width:i.width,height:i.height}),this.captureTexture=t.sys.textures.addGLTexture(e,this.drawingContext.texture),this.initRenderNodes(this._defaultRenderNodesMap)},_defaultRenderNodesMap:{get:function(){return r}},setAlpha:function(t){return this},setScrollFactor:function(t,e){return this}});t.exports=l},23675(t,e,i){var s=i(44603),r=i(23568),n=i(43451);s.register("captureFrame",function(t,e){void 0===t&&(t={});var i=r(t,"depth",0),s=r(t,"key",null),a=r(t,"visible",!0),o=new n(this.scene,s);return void 0!==e&&(t.add=e),o.setDepth(i).setVisible(a),t.add&&this.scene.sys.displayList.add(o),o})},20421(t,e,i){var s=i(43451);i(39429).register("captureFrame",function(t){return this.displayList.add(new s(this.scene,t))})},36683(t,e,i){var s=i(29747),r=s,n=s;r=i(82237),t.exports={renderWebGL:r,renderCanvas:n}},82237(t){var e=!1;t.exports=function(t,i,s){if(s.useCanvas)e||(e=!0,console.warn("CaptureFrame: Cannot capture from main canvas. Activate `forceComposite` on the camera to use this feature. This warning will now mute."));else{s.camera.addToRenderList(i);var r=s.width,n=s.height,a=i.customRenderNodes,o=i.defaultRenderNodes;i.drawingContext.resize(r,n),i.drawingContext.use(),(a.BatchHandler||o.BatchHandler).batch(i.drawingContext,s.texture,0,n,0,0,r,n,r,0,0,0,1,1,!1,4294967295,4294967295,4294967295,4294967295,{}),i.drawingContext.release()}}},16005(t,e,i){var s=i(45319),r={_alpha:1,_alphaTL:1,_alphaTR:1,_alphaBL:1,_alphaBR:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t,e,i,r){return void 0===t&&(t=1),void 0===e?this.alpha=t:(this._alphaTL=s(t,0,1),this._alphaTR=s(e,0,1),this._alphaBL=s(i,0,1),this._alphaBR=s(r,0,1)),this},alpha:{get:function(){return this._alpha},set:function(t){var e=s(t,0,1);this._alpha=e,this._alphaTL=e,this._alphaTR=e,this._alphaBL=e,this._alphaBR=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}},alphaTopLeft:{get:function(){return this._alphaTL},set:function(t){var e=s(t,0,1);this._alphaTL=e,0!==e&&(this.renderFlags|=2)}},alphaTopRight:{get:function(){return this._alphaTR},set:function(t){var e=s(t,0,1);this._alphaTR=e,0!==e&&(this.renderFlags|=2)}},alphaBottomLeft:{get:function(){return this._alphaBL},set:function(t){var e=s(t,0,1);this._alphaBL=e,0!==e&&(this.renderFlags|=2)}},alphaBottomRight:{get:function(){return this._alphaBR},set:function(t){var e=s(t,0,1);this._alphaBR=e,0!==e&&(this.renderFlags|=2)}}};t.exports=r},88509(t,e,i){var s=i(45319),r={_alpha:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t){return void 0===t&&(t=1),this.alpha=t,this},alpha:{get:function(){return this._alpha},set:function(t){var e=s(t,0,1);this._alpha=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}}};t.exports=r},90065(t,e,i){var s=i(10312),r={_blendMode:s.NORMAL,blendMode:{get:function(){return this._blendMode},set:function(t){"string"==typeof t&&(t=s[t]),(t|=0)>=-1&&(this._blendMode=t)}},setBlendMode:function(t){return this.blendMode=t,this}};t.exports=r},94215(t){t.exports={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}}},61683(t){var e={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,s){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,s,this.flipX,this.flipY);else{var r=t;this.frame.setCropUVs(this._crop,r.x,r.y,r.width,r.height,this.flipX,this.flipY)}this.isCropped=!0}return this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=e},89272(t,e,i){const s=i(7889);t.exports=s.DepthDescriptors,Object.defineProperty(t.exports,"Depth",{value:s.Depth})},3248(t){var e={timeElapsed:0,timeElapsedResetPeriod:36e5,timePaused:!1,setTimerResetPeriod:function(t){return this.timeElapsedResetPeriod=t,this},setTimerPaused:function(t){return this.timePaused=!!t,this},resetTimer:function(t){return void 0===t&&(t=0),this.timeElapsed=t,this},updateTimer:function(t,e){return this.timePaused||(this.timeElapsed+=e,this.timeElapsed>=this.timeElapsedResetPeriod&&(this.timeElapsed-=this.timeElapsedResetPeriod)),this}};t.exports=e},53427(t,e,i){var s=i(83419),r=i(10189),n=i(16762),a=i(37597),o=i(88344),h=i(47564),l=i(77011),u=i(95200),d=i(16898),c=i(42652),f=i(43927),p=i(84714),g=i(51890),m=i(97797),v=i(37911),y=i(6379),x=i(29861),T=i(14366),w=i(63785),b=i(62229),S=i(99534),C=i(20263),E=i(90002),A=new s({initialize:function(t){this.camera=t,this.list=[]},clear:function(){for(var t=0;t0||this.filters.external.getActive().length>0||this.filtersForceComposite)},enableFilters:function(){if(this.filterCamera||!this.scene.renderer.gl)return this;var t=this.scene;if(s||(s=i(38058)),this.filterCamera=new s(0,0,1,1).setScene(t,!1),this.filterCamera.isObjectInversion=!0,t.game.config.roundPixels&&(this.filterCamera.roundPixels=!0),!this.maxFilterSize){var e=t.renderer.getMaxTextureSize();this.maxFilterSize=new r(e,e)}return this._filtersMatrix=new n,this._filtersViewMatrix=new n,this.getBounds&&void 0!==this.width&&void 0!==this.height&&0!==this.width&&0!==this.height||(this.filtersFocusContext=!0),this.addRenderStep(this.renderWebGLFilters,0),this},renderWebGLFilters:function(t,e,i,s,r){if(e.willRenderFilters()){var n=i.camera,a=e.filtersAutoFocus,o=e.filtersFocusContext;a&&(o?e.focusFiltersOnCamera(n):e.focusFilters());var h=e.filterCamera;h.preRender();var l=h.roundPixels;if(h.roundPixels=e.willRoundVertices(h,e.rotation%(2*Math.PI)==0&&(e.scaleX,1===e.scaleY)),a&&o){var u=e.parentContainer;if(u){var d=u.getWorldTransformMatrix();h.matrix.multiply(d)}}var c=e._filtersMatrix,f=e._filtersViewMatrix.copyWithScrollFactorFrom(n.getViewMatrix(!i.useCanvas),n.scrollX,n.scrollY,e.scrollFactorX,e.scrollFactorY);if(s&&f.multiply(s),o)c.loadIdentity();else{if("Layer"===e.type)c.loadIdentity();else{var p=e.flipX?-1:1,g=e.flipY?-1:1;c.applyITRS(e.x,e.y,e.rotation,e.scaleX*p,e.scaleY*g)}var m=h.width,v=h.height;c.translate(-m*h.originX,-v*h.originY),f.multiply(c,c)}var y=e.scrollFactorX,x=e.scrollFactorY;e.scrollFactorX=1,e.scrollFactorY=1,t.cameraRenderNode.run(i,[e],h,c,!0,r+1),e.scrollFactorX=y,e.scrollFactorY=x,h.roundPixels=l;for(var T=h.renderList.length,w=0;w0?Math.acos(e/this.scaleX):-Math.acos(e/this.scaleX):s||n?r.PI_OVER_2-(n>0?Math.acos(-s/this.scaleY):-Math.acos(s/this.scaleY)):0}},scaleX:{get:function(){return Math.sqrt(this.a*this.a+this.b*this.b)}},scaleY:{get:function(){return Math.sqrt(this.c*this.c+this.d*this.d)}},loadIdentity:function(){var t=this.matrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,this},translate:function(t,e){var i=this.matrix;return i[4]=i[0]*t+i[2]*e+i[4],i[5]=i[1]*t+i[3]*e+i[5],this},scale:function(t,e){var i=this.matrix;return i[0]*=t,i[1]*=t,i[2]*=e,i[3]*=e,this},rotate:function(t){var e=Math.sin(t),i=Math.cos(t),s=this.matrix,r=s[0],n=s[1],a=s[2],o=s[3];return s[0]=r*i+a*e,s[1]=n*i+o*e,s[2]=r*-e+a*i,s[3]=n*-e+o*i,this},multiply:function(t,e){var i=this.matrix,s=t.matrix,r=i[0],n=i[1],a=i[2],o=i[3],h=i[4],l=i[5],u=s[0],d=s[1],c=s[2],f=s[3],p=s[4],g=s[5],m=void 0===e?i:e.matrix;return m[0]=u*r+d*a,m[1]=u*n+d*o,m[2]=c*r+f*a,m[3]=c*n+f*o,m[4]=p*r+g*a+h,m[5]=p*n+g*o+l,m},multiplyWithOffset:function(t,e,i){var s=this.matrix,r=t.matrix,n=s[0],a=s[1],o=s[2],h=s[3],l=e*n+i*o+s[4],u=e*a+i*h+s[5],d=r[0],c=r[1],f=r[2],p=r[3],g=r[4],m=r[5];return s[0]=d*n+c*o,s[1]=d*a+c*h,s[2]=f*n+p*o,s[3]=f*a+p*h,s[4]=g*n+m*o+l,s[5]=g*a+m*h+u,this},transform:function(t,e,i,s,r,n){var a=this.matrix,o=a[0],h=a[1],l=a[2],u=a[3],d=a[4],c=a[5];return a[0]=t*o+e*l,a[1]=t*h+e*u,a[2]=i*o+s*l,a[3]=i*h+s*u,a[4]=r*o+n*l+d,a[5]=r*h+n*u+c,this},transformPoint:function(t,e,i){void 0===i&&(i={x:0,y:0});var s=this.matrix,r=s[0],n=s[1],a=s[2],o=s[3],h=s[4],l=s[5];return i.x=t*r+e*a+h,i.y=t*n+e*o+l,i},invert:function(){var t=this.matrix,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=e*r-i*s;return t[0]=r/o,t[1]=-i/o,t[2]=-s/o,t[3]=e/o,t[4]=(s*a-r*n)/o,t[5]=-(e*a-i*n)/o,this},copyFrom:function(t){var e=this.matrix;return e[0]=t.a,e[1]=t.b,e[2]=t.c,e[3]=t.d,e[4]=t.e,e[5]=t.f,this},copyFromArray:function(t){var e=this.matrix;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],this},copyWithScrollFactorFrom:function(t,e,i,s,r){var n=this.matrix;n[0]=t.a,n[1]=t.b,n[2]=t.c,n[3]=t.d;var a=e*(1-s),o=i*(1-r);return n[4]=t.a*a+t.c*o+t.e,n[5]=t.b*a+t.d*o+t.f,this},copyToContext:function(t){var e=this.matrix;return t.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t},setToContext:function(t){return t.setTransform(this.a,this.b,this.c,this.d,this.e,this.f),t},copyToArray:function(t){var e=this.matrix;return void 0===t?t=[e[0],e[1],e[2],e[3],e[4],e[5]]:(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5]),t},setTransform:function(t,e,i,s,r,n){var a=this.matrix;return a[0]=t,a[1]=e,a[2]=i,a[3]=s,a[4]=r,a[5]=n,this},decomposeMatrix:function(){var t=this.decomposedMatrix,e=this.matrix,i=e[0],s=e[1],r=e[2],n=e[3],a=i*n-s*r;if(t.translateX=e[4],t.translateY=e[5],i||s){var o=Math.sqrt(i*i+s*s);t.rotation=s>0?Math.acos(i/o):-Math.acos(i/o),t.scaleX=o,t.scaleY=a/o}else if(r||n){var h=Math.sqrt(r*r+n*n);t.rotation=.5*Math.PI-(n>0?Math.acos(-r/h):-Math.acos(r/h)),t.scaleX=a/h,t.scaleY=h}else t.rotation=0,t.scaleX=0,t.scaleY=0;return t},applyITRS:function(t,e,i,s,r){var n=this.matrix,a=Math.sin(i),o=Math.cos(i);return n[4]=t,n[5]=e,n[0]=o*s,n[1]=a*s,n[2]=-a*r,n[3]=o*r,this},applyInverse:function(t,e,i){void 0===i&&(i=new n);var s=this.matrix,r=s[0],a=s[1],o=s[2],h=s[3],l=s[4],u=s[5],d=1/(r*h+o*-a);return i.x=h*d*t+-o*d*e+(u*o-l*h)*d,i.y=r*d*e+-a*d*t+(-u*r+l*a)*d,i},setQuad:function(t,e,i,s,r){void 0===r&&(r=this.quad);var n=this.matrix,a=n[0],o=n[1],h=n[2],l=n[3],u=n[4],d=n[5];return r[0]=t*a+e*h+u,r[1]=t*o+e*l+d,r[2]=t*a+s*h+u,r[3]=t*o+s*l+d,r[4]=i*a+s*h+u,r[5]=i*o+s*l+d,r[6]=i*a+e*h+u,r[7]=i*o+e*l+d,r},getX:function(t,e){return t*this.a+e*this.c+this.e},getY:function(t,e){return t*this.b+e*this.d+this.f},getXRound:function(t,e,i){var s=this.getX(t,e);return i&&(s=Math.floor(s+.5)),s},getYRound:function(t,e,i){var s=this.getY(t,e);return i&&(s=Math.floor(s+.5)),s},getCSSMatrix:function(){var t=this.matrix;return"matrix("+t[0]+","+t[1]+","+t[2]+","+t[3]+","+t[4]+","+t[5]+")"},destroy:function(){this.matrix=null,this.quad=null,this.decomposedMatrix=null}});t.exports=a},59715(t,e,i){const s=i(36626);t.exports=s.VisibleDescriptors,Object.defineProperty(t.exports,"Visible",{value:s.Visible})},31401(t,e,i){t.exports={Alpha:i(16005),AlphaSingle:i(88509),BlendMode:i(90065),ComputedSize:i(94215),Crop:i(61683),Depth:i(89272),ElapseTimer:i(3248),FilterList:i(53427),Filters:i(43102),Flip:i(54434),GetBounds:i(8004),Lighting:i(73629),Mask:i(8573),Origin:i(27387),PathFollower:i(37640),RenderNodes:i(68680),RenderSteps:i(86038),ScrollFactor:i(80227),Size:i(16736),Texture:i(37726),TextureCrop:i(79812),Tint:i(27472),ToJSON:i(53774),Transform:i(16901),TransformMatrix:i(61340),Visible:i(59715)}},31559(t,e,i){var s=i(37105),r=i(10312),n=i(83419),a=i(31401),o=i(51708),h=i(95643),l=i(87841),u=i(29959),d=i(36899),c=i(26099),f=i(93595),p=new a.TransformMatrix,g=new n({Extends:h,Mixins:[a.AlphaSingle,a.BlendMode,a.ComputedSize,a.Depth,a.Mask,a.Transform,a.Visible,u],initialize:function(t,e,i,s){h.call(this,t,"Container"),this.list=[],this.exclusive=!0,this.maxSize=-1,this.position=0,this.localTransform=new a.TransformMatrix,this._sortKey="",this._sysEvents=t.sys.events,this.scrollFactorX=1,this.scrollFactorY=1,this.setPosition(e,i),this.setBlendMode(r.SKIP_CHECK),s&&this.add(s)},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return.5*this.width}},displayOriginY:{get:function(){return.5*this.height}},setExclusive:function(t){return void 0===t&&(t=!0),this.exclusive=t,this},getBounds:function(t){if(void 0===t&&(t=new l),t.setTo(this.x,this.y,0,0),this.parentContainer){var e=this.parentContainer.getBoundsTransformMatrix().transformPoint(this.x,this.y);t.setTo(e.x,e.y,0,0)}if(this.list.length>0){var i=this.list,s=new l,r=!1;t.setEmpty();for(var n=0;n-1},setAll:function(t,e,i,r){return s.SetAll(this.list,t,e,i,r),this},each:function(t,e){var i,s=[null],r=this.list.slice(),n=r.length;for(i=2;i0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.list=[]},onChildDestroyed:function(t){s.Remove(this.list,t),this.exclusive&&(t.parentContainer=null,t.removedFromScene())}});t.exports=g},53584(t){t.exports=function(t,e,i,s){i.addToRenderList(e);var r=e.list;if(0!==r.length){var n=e.localTransform;s?(n.loadIdentity(),n.multiply(s),n.translate(e.x,e.y),n.rotate(e.rotation),n.scale(e.scaleX,e.scaleY)):n.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var a=-1!==e.blendMode;a||t.setBlendMode(0);var o=e._alpha,h=e.scrollFactorX,l=e.scrollFactorY;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var u=0;u=0,d=a>=0,f=o>=0,p=h>=0;return n=Math.abs(n),a=Math.abs(a),o=Math.abs(o),h=Math.abs(h),this.beginPath(),this.moveTo(t+n,e),this.lineTo(t+i-a,e),d?this.arc(t+i-a,e+a,a,-c.PI_OVER_2,0):this.arc(t+i,e,a,Math.PI,c.PI_OVER_2,!0),this.lineTo(t+i,e+s-h),p?this.arc(t+i-h,e+s-h,h,0,c.PI_OVER_2):this.arc(t+i,e+s,h,-c.PI_OVER_2,Math.PI,!0),this.lineTo(t+o,e+s),f?this.arc(t+o,e+s-o,o,c.PI_OVER_2,Math.PI):this.arc(t,e+s,o,0,-c.PI_OVER_2,!0),this.lineTo(t,e+n),l?this.arc(t+n,e+n,n,-Math.PI,-c.PI_OVER_2):this.arc(t,e,n,c.PI_OVER_2,0,!0),this.fillPath(),this},strokeRoundedRect:function(t,e,i,s,r){void 0===r&&(r=20);var n=r,a=r,o=r,h=r,l=Math.min(i,s)/2;"number"!=typeof r&&(n=u(r,"tl",20),a=u(r,"tr",20),o=u(r,"bl",20),h=u(r,"br",20));var d=n>=0,f=a>=0,p=o>=0,g=h>=0;return n=Math.min(Math.abs(n),l),a=Math.min(Math.abs(a),l),o=Math.min(Math.abs(o),l),h=Math.min(Math.abs(h),l),this.beginPath(),this.moveTo(t+n,e),this.lineTo(t+i-a,e),this.moveTo(t+i-a,e),f?this.arc(t+i-a,e+a,a,-c.PI_OVER_2,0):this.arc(t+i,e,a,Math.PI,c.PI_OVER_2,!0),this.lineTo(t+i,e+s-h),this.moveTo(t+i,e+s-h),g?this.arc(t+i-h,e+s-h,h,0,c.PI_OVER_2):this.arc(t+i,e+s,h,-c.PI_OVER_2,Math.PI,!0),this.lineTo(t+o,e+s),this.moveTo(t+o,e+s),p?this.arc(t+o,e+s-o,o,c.PI_OVER_2,Math.PI):this.arc(t,e+s,o,0,-c.PI_OVER_2,!0),this.lineTo(t,e+n),this.moveTo(t,e+n),d?this.arc(t+n,e+n,n,-Math.PI,-c.PI_OVER_2):this.arc(t,e,n,c.PI_OVER_2,0,!0),this.strokePath(),this},fillPointShape:function(t,e){return this.fillPoint(t.x,t.y,e)},fillPoint:function(t,e,i){return!i||i<1?i=1:(t-=i/2,e-=i/2),this.commandBuffer.push(n.FILL_RECT,t,e,i,i),this},fillTriangleShape:function(t){return this.fillTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},strokeTriangleShape:function(t){return this.strokeTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},fillTriangle:function(t,e,i,s,r,a){return this.commandBuffer.push(n.FILL_TRIANGLE,t,e,i,s,r,a),this},strokeTriangle:function(t,e,i,s,r,a){return this.commandBuffer.push(n.STROKE_TRIANGLE,t,e,i,s,r,a),this},strokeLineShape:function(t){return this.lineBetween(t.x1,t.y1,t.x2,t.y2)},lineBetween:function(t,e,i,s){return this.beginPath(),this.moveTo(t,e),this.lineTo(i,s),this.strokePath(),this},lineTo:function(t,e){return this.commandBuffer.push(n.LINE_TO,t,e),this},moveTo:function(t,e){return this.commandBuffer.push(n.MOVE_TO,t,e),this},strokePoints:function(t,e,i,s){void 0===e&&(e=!1),void 0===i&&(i=!1),void 0===s&&(s=t.length),this.beginPath(),this.moveTo(t[0].x,t[0].y);for(var r=1;r-1&&this.fillStyle(this.defaultFillColor,this.defaultFillAlpha),this.defaultStrokeColor>-1&&this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha),this},generateTexture:function(t,e,i){var s,r,n=this.scene.sys,a=n.game.renderer;void 0===e&&(e=n.scale.width),void 0===i&&(i=n.scale.height),p.TargetCamera.setScene(this.scene),p.TargetCamera.setViewport(0,0,e,i),p.TargetCamera.scrollX=this.x,p.TargetCamera.scrollY=this.y;var o={willReadFrequently:!0};if("string"==typeof t)if(n.textures.exists(t)){var h=(s=n.textures.get(t)).getSourceImage();h instanceof HTMLCanvasElement&&(r=h.getContext("2d",o))}else r=(s=n.textures.createCanvas(t,e,i)).getSourceImage().getContext("2d",o);else t instanceof HTMLCanvasElement&&(r=t.getContext("2d",o));return r&&(this.renderCanvas(a,this,p.TargetCamera,null,r,!1),s&&s.refresh()),this},preDestroy:function(){this.commandBuffer=[]}});p.TargetCamera=new s,t.exports=p},32768(t,e,i){var s=i(85592),r=i(20926);t.exports=function(t,e,i,n,a,o){var h=e.commandBuffer,l=h.length,u=a||t.currentContext;if(0!==l&&r(t,u,e,i,n)){i.addToRenderList(e);var d=1,c=1,f=0,p=0,g=1,m=0,v=0,y=0;u.beginPath();for(var x=0;x>>16,v=(65280&f)>>>8,y=255&f,u.strokeStyle="rgba("+m+","+v+","+y+","+d+")",u.lineWidth=g,x+=3;break;case s.FILL_STYLE:p=h[x+1],c=h[x+2],m=(16711680&p)>>>16,v=(65280&p)>>>8,y=255&p,u.fillStyle="rgba("+m+","+v+","+y+","+c+")",x+=2;break;case s.BEGIN_PATH:u.beginPath();break;case s.CLOSE_PATH:u.closePath();break;case s.FILL_PATH:o||u.fill();break;case s.STROKE_PATH:o||u.stroke();break;case s.FILL_RECT:o?u.rect(h[x+1],h[x+2],h[x+3],h[x+4]):u.fillRect(h[x+1],h[x+2],h[x+3],h[x+4]),x+=4;break;case s.FILL_TRIANGLE:u.beginPath(),u.moveTo(h[x+1],h[x+2]),u.lineTo(h[x+3],h[x+4]),u.lineTo(h[x+5],h[x+6]),u.closePath(),o||u.fill(),x+=6;break;case s.STROKE_TRIANGLE:u.beginPath(),u.moveTo(h[x+1],h[x+2]),u.lineTo(h[x+3],h[x+4]),u.lineTo(h[x+5],h[x+6]),u.closePath(),o||u.stroke(),x+=6;break;case s.LINE_TO:u.lineTo(h[x+1],h[x+2]),x+=2;break;case s.MOVE_TO:u.moveTo(h[x+1],h[x+2]),x+=2;break;case s.LINE_FX_TO:u.lineTo(h[x+1],h[x+2]),x+=5;break;case s.MOVE_FX_TO:u.moveTo(h[x+1],h[x+2]),x+=5;break;case s.SAVE:u.save();break;case s.RESTORE:u.restore();break;case s.TRANSLATE:u.translate(h[x+1],h[x+2]),x+=2;break;case s.SCALE:u.scale(h[x+1],h[x+2]),x+=2;break;case s.ROTATE:u.rotate(h[x+1]),x+=1;break;case s.GRADIENT_FILL_STYLE:x+=5;break;case s.GRADIENT_LINE_STYLE:x+=6}}u.restore()}}},87079(t,e,i){var s=i(44603),r=i(43831);s.register("graphics",function(t,e){void 0===t&&(t={}),void 0!==e&&(t.add=e);var i=new r(this.scene,t);return t.add&&this.scene.sys.displayList.add(i),i})},1201(t,e,i){var s=i(43831);i(39429).register("graphics",function(t){return this.displayList.add(new s(this.scene,t))})},84503(t,e,i){var s=i(29747),r=s,n=s;r=i(77545),n=i(32768),n=i(32768),t.exports={renderWebGL:r,renderCanvas:n}},77545(t,e,i){var s=i(85592),r=i(91296),n=i(70554),a=i(61340),o=function(t,e,i){this.x=t,this.y=e,this.width=i},h=function(t,e,i){this.points=[],this.points[0]=new o(t,e,i),this.addPoint=function(t,e,i){var s=this.points[this.points.length-1];s.x===t&&s.y===e||this.points.push(new o(t,e,i))}},l=[],u=new a,d=new a,c={TL:0,TR:0,BL:0,BR:0},f={TL:0,TR:0,BL:0,BR:0},p=[{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0}];t.exports=function(t,e,i,a){if(0!==e.commandBuffer.length){var o=e.customRenderNodes,g=e.defaultRenderNodes,m=o.Submitter||g.Submitter,v=e.lighting,y=i,x=y.camera;x.addToRenderList(e);for(var T=r(e,x,a,!i.useCanvas).calc,w=u.loadIdentity(),b=e.commandBuffer,S=e.alpha,C=Math.max(e.pathDetailThreshold,t.config.pathDetailThreshold,0),E=1,A=0,_=0,M=0,R=2*Math.PI,P=[],O=0,L=!0,D=null,F=n.getTintAppendFloatAlpha,I=0;I0&&(q=q%R-R):q>R?q=R:q<0&&(q=R+q%R),null===D&&(D=new h(G+Math.cos(j)*H,V+Math.sin(j)*H,E),P.push(D),W+=.01);W<1+Z;)M=q*W+j,A=G+Math.cos(M)*H,_=V+Math.sin(M)*H,D.addPoint(A,_,E),W+=.01;M=q+j,A=G+Math.cos(M)*H,_=V+Math.sin(M)*H,D.addPoint(A,_,E);break;case s.FILL_RECT:T.multiply(w,d),(o.FillRect||g.FillRect).run(y,d,m,b[++I],b[++I],b[++I],b[++I],c.TL,c.TR,c.BL,c.BR,v);break;case s.FILL_TRIANGLE:T.multiply(w,d),(o.FillTri||g.FillTri).run(y,d,m,b[++I],b[++I],b[++I],b[++I],b[++I],b[++I],c.TL,c.TR,c.BL,v);break;case s.STROKE_TRIANGLE:T.multiply(w,d),p[0].x=b[++I],p[0].y=b[++I],p[0].width=E,p[1].x=b[++I],p[1].y=b[++I],p[1].width=E,p[2].x=b[++I],p[2].y=b[++I],p[2].width=E,p[3].x=p[0].x,p[3].y=p[0].y,p[3].width=E,(o.StrokePath||g.StrokePath).run(y,m,p,E,!1,d,f.TL,f.TR,f.BL,f.BR,v);break;case s.LINE_TO:G=b[++I],V=b[++I],null!==D?D.addPoint(G,V,E):(D=new h(G,V,E),P.push(D));break;case s.MOVE_TO:D=new h(b[++I],b[++I],E),P.push(D);break;case s.SAVE:l.push(w.copyToArray());break;case s.RESTORE:w.copyFromArray(l.pop());break;case s.TRANSLATE:G=b[++I],V=b[++I],w.translate(G,V);break;case s.SCALE:G=b[++I],V=b[++I],w.scale(G,V);break;case s.ROTATE:w.rotate(b[++I])}}}},26479(t,e,i){var s=i(61061),r=i(83419),n=i(51708),a=i(50792),o=i(46710),h=i(95540),l=i(35154),u=i(97022),d=i(41212),c=i(88492),f=i(68287),p=new r({Extends:a,initialize:function(t,e,i){a.call(this),i?e&&!Array.isArray(e)&&(e=[e]):Array.isArray(e)?d(e[0])&&(i=e,e=null):d(e)&&(i=e,e=null),this.scene=t,this.children=new Set,this.isParent=!0,this.type="Group",this.classType=h(i,"classType",f),this.name=h(i,"name",""),this.active=h(i,"active",!0),this.maxSize=h(i,"maxSize",-1),this.defaultKey=h(i,"defaultKey",null),this.defaultFrame=h(i,"defaultFrame",null),this.runChildUpdate=h(i,"runChildUpdate",!1),this.createCallback=h(i,"createCallback",null),this.removeCallback=h(i,"removeCallback",null),this.createMultipleCallback=h(i,"createMultipleCallback",null),this.internalCreateCallback=h(i,"internalCreateCallback",null),this.internalRemoveCallback=h(i,"internalRemoveCallback",null),e&&this.addMultiple(e),i&&this.createMultiple(i),this.on(n.ADDED_TO_SCENE,this.addedToScene,this),this.on(n.REMOVED_FROM_SCENE,this.removedFromScene,this)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},create:function(t,e,i,s,r,n){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.defaultKey),void 0===s&&(s=this.defaultFrame),void 0===r&&(r=!0),void 0===n&&(n=!0),this.isFull())return null;var a=new this.classType(this.scene,t,e,i,s);return a.addToDisplayList(this.scene.sys.displayList),a.addToUpdateList(),a.visible=r,a.setActive(n),this.add(a),a},createMultiple:function(t){if(this.isFull())return[];Array.isArray(t)||(t=[t]);var e=[];if(t[0].key)for(var i=0;i=0;u--)if((l=c[u]).active===i){if(++d===e)break}else l=null;return l?("number"==typeof r&&(l.x=r),"number"==typeof n&&(l.y=n),l):s?this.create(r,n,a,o,h):null},get:function(t,e,i,s,r){return this.getFirst(!1,!0,t,e,i,s,r)},getFirstAlive:function(t,e,i,s,r,n){return this.getFirst(!0,t,e,i,s,r,n)},getFirstDead:function(t,e,i,s,r,n){return this.getFirst(!1,t,e,i,s,r,n)},playAnimation:function(t,e){return s.PlayAnimation(Array.from(this.children),t,e),this},isFull:function(){return-1!==this.maxSize&&this.children.size>=this.maxSize},countActive:function(t){void 0===t&&(t=!0);var e=0;return this.children.forEach(function(i){i.active===t&&e++}),e},getTotalUsed:function(){return this.countActive()},getTotalFree:function(){var t=this.getTotalUsed();return(-1===this.maxSize?999999999999:this.maxSize)-t},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},propertyValueSet:function(t,e,i,r,n){return s.PropertyValueSet(Array.from(this.children),t,e,i,r,n),this},propertyValueInc:function(t,e,i,r,n){return s.PropertyValueInc(Array.from(this.children),t,e,i,r,n),this},setX:function(t,e){return s.SetX(Array.from(this.children),t,e),this},setY:function(t,e){return s.SetY(Array.from(this.children),t,e),this},setXY:function(t,e,i,r){return s.SetXY(Array.from(this.children),t,e,i,r),this},incX:function(t,e){return s.IncX(Array.from(this.children),t,e),this},incY:function(t,e){return s.IncY(Array.from(this.children),t,e),this},incXY:function(t,e,i,r){return s.IncXY(Array.from(this.children),t,e,i,r),this},shiftPosition:function(t,e,i){return s.ShiftPosition(Array.from(this.children),t,e,i),this},angle:function(t,e){return s.Angle(Array.from(this.children),t,e),this},rotate:function(t,e){return s.Rotate(Array.from(this.children),t,e),this},rotateAround:function(t,e){return s.RotateAround(Array.from(this.children),t,e),this},rotateAroundDistance:function(t,e,i){return s.RotateAroundDistance(Array.from(this.children),t,e,i),this},setAlpha:function(t,e){return s.SetAlpha(Array.from(this.children),t,e),this},setTint:function(t,e,i,r){return s.SetTint(Array.from(this.children),t,e,i,r),this},setOrigin:function(t,e,i,r){return s.SetOrigin(Array.from(this.children),t,e,i,r),this},scaleX:function(t,e){return s.ScaleX(Array.from(this.children),t,e),this},scaleY:function(t,e){return s.ScaleY(Array.from(this.children),t,e),this},scaleXY:function(t,e,i,r){return s.ScaleXY(Array.from(this.children),t,e,i,r),this},setDepth:function(t,e){return s.SetDepth(Array.from(this.children),t,e),this},setBlendMode:function(t){return s.SetBlendMode(Array.from(this.children),t),this},setHitArea:function(t,e){return s.SetHitArea(Array.from(this.children),t,e),this},shuffle:function(){return s.Shuffle(Array.from(this.children)),this},kill:function(t){this.children.has(t)&&t.setActive(!1)},killAndHide:function(t){this.children.has(t)&&(t.setActive(!1),t.setVisible(!1))},setVisible:function(t,e,i){return s.SetVisible(Array.from(this.children),t,e,i),this},toggleVisible:function(){return s.ToggleVisible(Array.from(this.children)),this},destroy:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1),this.scene&&!this.ignoreDestroy&&(this.emit(n.DESTROY,this),this.removeAllListeners(),this.scene.sys.updateList.remove(this),this.clear(e,t),this.scene=void 0,this.children=void 0)}});t.exports=p},94975(t,e,i){var s=i(44603),r=i(26479);s.register("group",function(t){return new r(this.scene,null,t)})},3385(t,e,i){var s=i(26479);i(39429).register("group",function(t,e){return this.updateList.add(new s(this.scene,t,e))})},88571(t,e,i){var s=i(40939),r=i(83419),n=i(31401),a=i(95643),o=i(59819),h=new r({Extends:a,Mixins:[n.Alpha,n.BlendMode,n.Depth,n.Flip,n.GetBounds,n.Lighting,n.Mask,n.Origin,n.RenderNodes,n.ScrollFactor,n.Size,n.TextureCrop,n.Tint,n.Transform,n.Visible,o],initialize:function(t,e,i,s,r){a.call(this,t,"Image"),this._crop=this.resetCropObject(),this.setTexture(s,r),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initRenderNodes(this._defaultRenderNodesMap)},_defaultRenderNodesMap:{get:function(){return s}}});t.exports=h},40652(t){t.exports=function(t,e,i,s){i.addToRenderList(e),t.batchSprite(e,e.frame,i,s)}},82459(t,e,i){var s=i(25305),r=i(44603),n=i(23568),a=i(88571);r.register("image",function(t,e){void 0===t&&(t={});var i=n(t,"key",null),r=n(t,"frame",null),o=new a(this.scene,0,0,i,r);return void 0!==e&&(t.add=e),s(this.scene,o,t),o})},2117(t,e,i){var s=i(88571);i(39429).register("image",function(t,e,i,r){return this.displayList.add(new s(this.scene,t,e,i,r))})},59819(t,e,i){var s=i(29747),r=s,n=s;r=i(99517),n=i(40652),t.exports={renderWebGL:r,renderCanvas:n}},99517(t){t.exports=function(t,e,i,s){i.camera.addToRenderList(e);var r=e.customRenderNodes,n=e.defaultRenderNodes;(r.Submitter||n.Submitter).run(i,e,s,0,r.Texturer||n.Texturer,r.Transformer||n.Transformer)}},77856(t,e,i){var s={Events:i(51708),DisplayList:i(8050),GameObjectCreator:i(44603),GameObjectFactory:i(39429),UpdateList:i(45027),Components:i(31401),GetCalcMatrix:i(91296),BuildGameObject:i(25305),BuildGameObjectAnimation:i(13059),GameObject:i(95643),BitmapText:i(22186),Blitter:i(6107),Bob:i(46590),Container:i(31559),DOMElement:i(3069),DynamicBitmapText:i(2638),Extern:i(42421),Graphics:i(43831),Group:i(26479),Image:i(88571),Layer:i(93595),Particles:i(18404),PathFollower:i(1159),RenderTexture:i(591),RetroFont:i(196),Rope:i(77757),Sprite:i(68287),Stamp:i(14727),Text:i(50171),GetTextSize:i(14220),MeasureText:i(79557),TextStyle:i(35762),TileSprite:i(20839),Zone:i(41481),Video:i(18471),Shape:i(17803),Arc:i(23629),Curve:i(89),Ellipse:i(19921),Grid:i(30479),IsoBox:i(61475),IsoTriangle:i(16933),Line:i(57847),Polygon:i(24949),Rectangle:i(74561),Star:i(55911),Triangle:i(36931),Factories:{Blitter:i(12709),Container:i(24961),DOMElement:i(2611),DynamicBitmapText:i(72566),Extern:i(56315),Graphics:i(1201),Group:i(3385),Image:i(2117),Layer:i(20005),Particles:i(676),PathFollower:i(90145),RenderTexture:i(60505),Rope:i(96819),Sprite:i(46409),Stamp:i(85326),StaticBitmapText:i(34914),Text:i(68005),TileSprite:i(91681),Zone:i(84175),Video:i(89025),Arc:i(42563),Curve:i(40511),Ellipse:i(1543),Grid:i(34137),IsoBox:i(3933),IsoTriangle:i(49803),Line:i(2481),Polygon:i(64827),Rectangle:i(87959),Star:i(93697),Triangle:i(45245)},Creators:{Blitter:i(9403),Container:i(77143),DynamicBitmapText:i(11164),Graphics:i(87079),Group:i(94975),Image:i(82459),Layer:i(25179),Particles:i(92730),RenderTexture:i(34495),Rope:i(26209),Sprite:i(15567),Stamp:i(31479),StaticBitmapText:i(57336),Text:i(71259),TileSprite:i(14167),Zone:i(95261),Video:i(11511)}};s.CaptureFrame=i(43451),s.Gradient=i(34637),s.Noise=i(35387),s.NoiseCell2D=i(51513),s.NoiseCell3D=i(15686),s.NoiseCell4D=i(41946),s.NoiseSimplex2D=i(1792),s.NoiseSimplex3D=i(51098),s.Shader=i(20071),s.NineSlice=i(28103),s.PointLight=i(80321),s.SpriteGPULayer=i(76573),s.Factories.CaptureFrame=i(20421),s.Factories.Gradient=i(69315),s.Factories.Noise=i(34757),s.Factories.NoiseCell2D=i(26590),s.Factories.NoiseCell3D=i(89918),s.Factories.NoiseCell4D=i(65874),s.Factories.NoiseSimplex2D=i(80308),s.Factories.NoiseSimplex3D=i(73810),s.Factories.Shader=i(74177),s.Factories.NineSlice=i(47521),s.Factories.PointLight=i(71255),s.Factories.SpriteGPULayer=i(96019),s.Creators.CaptureFrame=i(23675),s.Creators.Gradient=i(26353),s.Creators.Noise=i(39931),s.Creators.NoiseCell2D=i(98292),s.Creators.NoiseCell3D=i(97044),s.Creators.NoiseCell4D=i(20136),s.Creators.NoiseSimplex2D=i(51754),s.Creators.NoiseSimplex3D=i(71112),s.Creators.Shader=i(54935),s.Creators.NineSlice=i(28279),s.Creators.PointLight=i(39829),s.Creators.SpriteGPULayer=i(16193),s.Light=i(41432),s.LightsManager=i(61356),s.LightsPlugin=i(88992),t.exports=s},93595(t,e,i){var s=i(10312),r=i(83419),n=i(31401),a=i(50792),o=i(95643),h=i(51708),l=i(73162),u=i(33963),d=i(44594),c=i(19186),f=new r({Extends:l,Mixins:[a,o,n.AlphaSingle,n.BlendMode,n.Depth,n.Mask,n.Visible,u],initialize:function(t,e){l.call(this,t),a.call(this),o.call(this,t,"Layer"),this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.sortChildrenFlag=!1,this.addCallback=this.addChildCallback,this.removeCallback=this.removeChildCallback,this.clearAlpha(),this.setBlendMode(s.SKIP_CHECK),e&&this.add(e),this.addRenderStep&&this.addRenderStep(this.renderWebGL),t.sys.queueDepthSort()},setInteractive:function(){return this},disableInteractive:function(){return this},removeInteractive:function(){return this},willRender:function(t){return!(15!==this.renderFlags||0===this.list.length||0!==this.cameraFilter&&this.cameraFilter&t.id)},addChildCallback:function(t){var e=t.displayList;e&&e!==this&&t.removeFromDisplayList(),t.displayList||(this.queueDepthSort(),t.displayList=this,t.emit(h.ADDED_TO_SCENE,t,this.scene),this.events.emit(d.ADDED_TO_SCENE,t,this.scene))},removeChildCallback:function(t){this.queueDepthSort(),t.displayList=null,t.emit(h.REMOVED_FROM_SCENE,t,this.scene),this.events.emit(d.REMOVED_FROM_SCENE,t,this.scene)},queueDepthSort:function(){this.sortChildrenFlag=!0},depthSort:function(){this.sortChildrenFlag&&(c(this.list,this.sortByDepth),this.sortChildrenFlag=!1)},sortByDepth:function(t,e){return t._depth-e._depth},getChildren:function(){return this.list},destroy:function(t){if(this.scene&&!this.ignoreDestroy){o.prototype.destroy.call(this,t);for(var e=this.list;e.length;)e[0].destroy(t);this.list=void 0,this.systems=void 0,this.events=void 0}}});t.exports=f},2956(t){t.exports=function(t,e,i){var s=e.list;if(0!==s.length){e.depthSort();var r=-1!==e.blendMode;r||t.setBlendMode(0);var n=e._alpha;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var a=0;athis.maxLights&&(u(r,this.sortByDistance),r=r.slice(0,this.maxLights)),this.visibleLights=r.length,r},sortByDistance:function(t,e){return t.distance>=e.distance},setAmbientColor:function(t){var e=d.getFloatsFromUintRGB(t);return this.ambientColor.set(e[0],e[1],e[2]),this},getMaxVisibleLights:function(){return this.maxLights},getLightCount:function(){return this.lights.length},addLight:function(t,e,i,s,r,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=128),void 0===s&&(s=16777215),void 0===r&&(r=1),void 0===n&&(n=.1*i);var o=d.getFloatsFromUintRGB(s),h=new a(t,e,i,o[0],o[1],o[2],r,n);return this.lights.push(h),h},removeLight:function(t){var e=this.lights.indexOf(t);return e>=0&&l(this.lights,e),this},shutdown:function(){this.lights.length=0},destroy:function(){this.shutdown()}});t.exports=c},88992(t,e,i){var s=i(83419),r=i(61356),n=i(37277),a=i(44594),o=new s({Extends:r,initialize:function(t){this.scene=t,this.systems=t.sys,t.sys.settings.isBooted||t.sys.events.once(a.BOOT,this.boot,this),r.call(this)},boot:function(){var t=this.systems.events;t.on(a.SHUTDOWN,this.shutdown,this),t.on(a.DESTROY,this.destroy,this)},destroy:function(){this.shutdown(),this.scene=void 0,this.systems=void 0}});n.register("LightsPlugin",o,"lights"),t.exports=o},28103(t,e,i){var s=i(30529),r=i(83419),n=i(31401),a=i(95643),o=i(78023),h=i(84322),l=i(82513),u=new r({Extends:a,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.GetBounds,n.Mask,n.Origin,n.RenderNodes,n.ScrollFactor,n.Texture,n.Transform,n.Visible,o],initialize:function(t,e,i,s,r,n,o,u,d,c,f,p,g){a.call(this,t,"NineSlice"),this._width,this._height,this._originX=.5,this._originY=.5,this._sizeComponent=!0,this.vertices=[],this.leftWidth,this.rightWidth,this.topHeight,this.bottomHeight,this.tileX=p||!1,this.tileY=g||!1,this._repeatCountX=1,this._repeatCountY=1,this.tint=16777215,this.tintMode=h.MULTIPLY;var m=t.textures.getFrame(s,r);this.is3Slice=!c&&!f,m&&m.scale9&&(this.is3Slice=m.is3Slice);for(var v=this.is3Slice?18:54,y=0;y0?Math.max(1,Math.floor(t/e)):1},_rebuildVertexArray:function(t,e){if(t===this._repeatCountX&&e===this._repeatCountY)return!1;this._repeatCountX=t,this._repeatCountY=e;var i=(t+2)*(this.is3Slice?1:e+2)*6,s=this.vertices;if(s.length!==i){s.length=0;for(var r=0;r=0&&(e=t);break;case 4:var i=(this.end-this.start)/this.steps;e=u(t,i),this.counter=e;break;case 5:case 6:case 7:e=r(t,this.start,this.end);break;case 9:e=this.start[0]}return this.current=e,this},getMethod:function(){var t=this.propertyValue;if(null===t)return 0;var e=typeof t;if("number"===e)return 1;if(Array.isArray(t))return 2;if("function"===e)return 3;if("object"===e){if(this.hasBoth(t,"start","end"))return this.has(t,"steps")?4:5;if(this.hasBoth(t,"min","max"))return 6;if(this.has(t,"random"))return 7;if(this.hasEither(t,"onEmit","onUpdate"))return 8;if(this.hasEither(t,"values","interpolation"))return 9}return 0},setMethods:function(){var t=this.propertyValue,e=t,i=this.defaultEmit,s=this.defaultUpdate;switch(this.method){case 1:i=this.staticValueEmit;break;case 2:i=this.randomStaticValueEmit,e=t[0];break;case 3:this._onEmit=t,i=this.proxyEmit,e=this.defaultValue;break;case 4:this.start=t.start,this.end=t.end,this.steps=t.steps,this.counter=this.start,this.yoyo=!!this.has(t,"yoyo")&&t.yoyo,this.direction=0,i=this.steppedEmit,e=this.start;break;case 5:this.start=t.start,this.end=t.end;var r=this.has(t,"ease")?t.ease:"Linear";this.ease=o(r,t.easeParams),i=this.has(t,"random")&&t.random?this.randomRangedValueEmit:this.easedValueEmit,s=this.easeValueUpdate,e=this.start;break;case 6:this.start=t.min,this.end=t.max,i=this.has(t,"int")&&t.int?this.randomRangedIntEmit:this.randomRangedValueEmit,e=this.start;break;case 7:var n=t.random;Array.isArray(n)&&(this.start=n[0],this.end=n[1]),i=this.randomRangedIntEmit,e=this.start;break;case 8:this._onEmit=this.has(t,"onEmit")?t.onEmit:this.defaultEmit,this._onUpdate=this.has(t,"onUpdate")?t.onUpdate:this.defaultUpdate,i=this.proxyEmit,s=this.proxyUpdate,e=this.defaultValue;break;case 9:this.start=t.values;var a=this.has(t,"ease")?t.ease:"Linear";this.ease=o(a,t.easeParams),this.interpolation=l(t.interpolation),i=this.easedValueEmit,s=this.easeValueUpdate,e=this.start[0]}return this.onEmit=i,this.onUpdate=s,this.current=e,this},has:function(t,e){return t.hasOwnProperty(e)},hasBoth:function(t,e,i){return t.hasOwnProperty(e)&&t.hasOwnProperty(i)},hasEither:function(t,e,i){return t.hasOwnProperty(e)||t.hasOwnProperty(i)},defaultEmit:function(){return this.defaultValue},defaultUpdate:function(t,e,i,s){return s},proxyEmit:function(t,e,i){var s=this._onEmit(t,e,i);return this.current=s,s},proxyUpdate:function(t,e,i,s){var r=this._onUpdate(t,e,i,s);return this.current=r,r},staticValueEmit:function(){return this.current},staticValueUpdate:function(){return this.current},randomStaticValueEmit:function(){var t=Math.floor(Math.random()*this.propertyValue.length);return this.current=this.propertyValue[t],this.current},randomRangedValueEmit:function(t,e){var i=a(this.start,this.end);return t&&t.data[e]&&(t.data[e].min=i,t.data[e].max=this.end),this.current=i,i},randomRangedIntEmit:function(t,e){var i=s(this.start,this.end);return t&&t.data[e]&&(t.data[e].min=i,t.data[e].max=this.end),this.current=i,i},steppedEmit:function(){var t,e=this.counter,i=e,s=(this.end-this.start)/this.steps;this.yoyo?(0===this.direction?(i+=s)>=this.end&&(t=i-this.end,i=this.end-t,this.direction=1):(i-=s)<=this.start&&(t=this.start-i,i=this.start+t,this.direction=0),this.counter=i):this.counter=d(i+s,this.start,this.end);return this.current=e,e},easedValueEmit:function(t,e){if(t&&t.data[e]){var i=t.data[e];i.min=this.start,i.max=this.end}return this.current=this.start,this.start},easeValueUpdate:function(t,e,i){var s,r=t.data[e],n=this.ease(i);return s=this.interpolation?this.interpolation(this.start,n):(r.max-r.min)*n+r.min,this.current=s,s},destroy:function(){this.propertyValue=null,this.defaultValue=null,this.ease=null,this.interpolation=null,this._onEmit=null,this._onUpdate=null}});t.exports=c},24502(t,e,i){var s=i(83419),r=i(95540),n=i(20286),a=new s({Extends:n,initialize:function(t,e,i,s,a){if("object"==typeof t){var o=t;t=r(o,"x",0),e=r(o,"y",0),i=r(o,"power",0),s=r(o,"epsilon",100),a=r(o,"gravity",50)}else void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=100),void 0===a&&(a=50);n.call(this,t,e,!0),this._gravity=a,this._power=i*a,this._epsilon=s*s},update:function(t,e){var i=this.x-t.x,s=this.y-t.y,r=i*i+s*s;if(0!==r){var n=Math.sqrt(r);r0&&(this.anims=new s(this)),this.bounds=new o},emit:function(t,e,i,s,r,n){return this.emitter.emit(t,e,i,s,r,n)},isAlive:function(){return this.lifeCurrent>0},kill:function(){this.lifeCurrent=0},setPosition:function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=t,this.y=e},fire:function(t,e){var i=this.emitter,s=i.ops,r=i.getAnim();if(r?this.anims.play(r):(this.frame=i.getFrame(),this.texture=this.frame.texture),!this.frame)throw new Error("Particle has no texture frame");if(i.getEmitZone(this),void 0===t?this.x+=s.x.onEmit(this,"x"):s.x.steps>0?this.x+=t+s.x.onEmit(this,"x"):this.x+=t,void 0===e?this.y+=s.y.onEmit(this,"y"):s.y.steps>0?this.y+=e+s.y.onEmit(this,"y"):this.y+=e,this.life=s.lifespan.onEmit(this,"lifespan"),this.lifeCurrent=this.life,this.lifeT=0,this.delayCurrent=s.delay.onEmit(this,"delay"),this.holdCurrent=s.hold.onEmit(this,"hold"),this.scaleX=s.scaleX.onEmit(this,"scaleX"),this.scaleY=s.scaleY.active?s.scaleY.onEmit(this,"scaleY"):this.scaleX,this.angle=s.rotate.onEmit(this,"rotate"),this.rotation=a(this.angle),i.worldMatrix.transformPoint(this.x,this.y,this.worldPosition),0===this.delayCurrent&&i.getDeathZone(this))return this.lifeCurrent=0,!1;var n=s.speedX.onEmit(this,"speedX"),o=s.speedY.active?s.speedY.onEmit(this,"speedY"):n;if(i.radial){var h=a(s.angle.onEmit(this,"angle"));this.velocityX=Math.cos(h)*Math.abs(n),this.velocityY=Math.sin(h)*Math.abs(o)}else if(i.moveTo){var l=s.moveToX.onEmit(this,"moveToX"),u=s.moveToY.onEmit(this,"moveToY"),d=this.life/1e3;this.velocityX=(l-this.x)/d,this.velocityY=(u-this.y)/d}else this.velocityX=n,this.velocityY=o;return i.acceleration&&(this.accelerationX=s.accelerationX.onEmit(this,"accelerationX"),this.accelerationY=s.accelerationY.onEmit(this,"accelerationY")),this.maxVelocityX=s.maxVelocityX.onEmit(this,"maxVelocityX"),this.maxVelocityY=s.maxVelocityY.onEmit(this,"maxVelocityY"),this.bounce=s.bounce.onEmit(this,"bounce"),this.alpha=s.alpha.onEmit(this,"alpha"),s.color.active?this.tint=s.color.onEmit(this,"tint"):this.tint=s.tint.onEmit(this,"tint"),!0},update:function(t,e,i){if(this.lifeCurrent<=0)return!(this.holdCurrent>0)||(this.holdCurrent-=t,this.holdCurrent<=0);if(this.delayCurrent>0)return this.delayCurrent-=t,!1;this.anims&&this.anims.update(0,t);var s=this.emitter,n=s.ops,o=1-this.lifeCurrent/this.life;if(this.lifeT=o,this.x=n.x.onUpdate(this,"x",o,this.x),this.y=n.y.onUpdate(this,"y",o,this.y),s.moveTo){var h=n.moveToX.onUpdate(this,"moveToX",o,s.moveToX),l=n.moveToY.onUpdate(this,"moveToY",o,s.moveToY),u=this.lifeCurrent/1e3;this.velocityX=(h-this.x)/u,this.velocityY=(l-this.y)/u}return this.computeVelocity(s,t,e,i,o),this.scaleX=n.scaleX.onUpdate(this,"scaleX",o,this.scaleX),n.scaleY.active?this.scaleY=n.scaleY.onUpdate(this,"scaleY",o,this.scaleY):this.scaleY=this.scaleX,this.angle=n.rotate.onUpdate(this,"rotate",o,this.angle),this.rotation=a(this.angle),s.getDeathZone(this)?(this.lifeCurrent=0,!0):(this.alpha=r(n.alpha.onUpdate(this,"alpha",o,this.alpha),0,1),n.color.active?this.tint=n.color.onUpdate(this,"color",o,this.tint):this.tint=n.tint.onUpdate(this,"tint",o,this.tint),this.lifeCurrent-=t,this.lifeCurrent<=0&&this.holdCurrent<=0)},computeVelocity:function(t,e,i,s,n){var a=t.ops,o=this.velocityX,h=this.velocityY,l=a.accelerationX.onUpdate(this,"accelerationX",n,this.accelerationX),u=a.accelerationY.onUpdate(this,"accelerationY",n,this.accelerationY),d=a.maxVelocityX.onUpdate(this,"maxVelocityX",n,this.maxVelocityX),c=a.maxVelocityY.onUpdate(this,"maxVelocityY",n,this.maxVelocityY);this.bounce=a.bounce.onUpdate(this,"bounce",n,this.bounce),o+=t.gravityX*i+l*i,h+=t.gravityY*i+u*i,o=r(o,-d,d),h=r(h,-c,c),this.velocityX=o,this.velocityY=h,this.x+=o*i,this.y+=h*i,t.worldMatrix.transformPoint(this.x,this.y,this.worldPosition);for(var f=0;fe.right&&this.collideRight&&(t.x-=s.x-e.right,t.velocityX*=i),s.ye.bottom&&this.collideBottom&&(t.y-=s.y-e.bottom,t.velocityY*=i)}});t.exports=a},31600(t,e,i){var s=i(68668),r=i(83419),n=i(31401),a=i(53774),o=i(43459),h=i(26388),l=i(19909),u=i(76472),d=i(44777),c=i(20696),f=i(95643),p=i(95540),g=i(26546),m=i(24502),v=i(69036),y=i(1985),x=i(97022),T=i(86091),w=i(73162),b=i(20074),S=i(269),C=i(56480),E=i(69601),A=i(68875),_=i(87841),M=i(59996),R=i(72905),P=i(90668),O=i(19186),L=i(84322),D=i(61340),F=i(26099),I=i(15994),N=["active","advance","blendMode","colorEase","deathCallback","deathCallbackScope","duration","emitCallback","emitCallbackScope","follow","frequency","gravityX","gravityY","maxAliveParticles","maxParticles","name","emitting","particleBringToTop","particleClass","radial","sortCallback","sortOrderAsc","sortProperty","stopAfter","tintMode","timeScale","trackVisible","visible"],B=["accelerationX","accelerationY","alpha","angle","bounce","color","delay","hold","lifespan","maxVelocityX","maxVelocityY","moveToX","moveToY","quantity","rotate","scaleX","scaleY","speedX","speedY","tint","x","y"],k=new r({Extends:f,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.Lighting,n.Mask,n.RenderNodes,n.ScrollFactor,n.Texture,n.Transform,n.Visible,P],initialize:function(t,e,i,s,r){f.call(this,t,"ParticleEmitter"),this.particleClass=C,this.config=null,this.ops={accelerationX:new d("accelerationX",0),accelerationY:new d("accelerationY",0),alpha:new d("alpha",1),angle:new d("angle",{min:0,max:360},!0),bounce:new d("bounce",0),color:new u("color"),delay:new d("delay",0,!0),hold:new d("hold",0,!0),lifespan:new d("lifespan",1e3,!0),maxVelocityX:new d("maxVelocityX",1e4),maxVelocityY:new d("maxVelocityY",1e4),moveToX:new d("moveToX",0),moveToY:new d("moveToY",0),quantity:new d("quantity",1,!0),rotate:new d("rotate",0),scaleX:new d("scaleX",1),scaleY:new d("scaleY",1),speedX:new d("speedX",0,!0),speedY:new d("speedY",0,!0),tint:new d("tint",16777215),x:new d("x",0),y:new d("y",0)},this.radial=!0,this.gravityX=0,this.gravityY=0,this.acceleration=!1,this.moveTo=!1,this.emitCallback=null,this.emitCallbackScope=null,this.deathCallback=null,this.deathCallbackScope=null,this.maxParticles=0,this.maxAliveParticles=0,this.stopAfter=0,this.duration=0,this.frequency=0,this.emitting=!0,this.particleBringToTop=!0,this.timeScale=1,this.emitZones=[],this.deathZones=[],this.viewBounds=null,this.follow=null,this.followOffset=new F,this.trackVisible=!1,this.frames=[],this.randomFrame=!0,this.frameQuantity=1,this.anims=[],this.randomAnim=!0,this.animQuantity=1,this.dead=[],this.alive=[],this.counters=new Float32Array(10),this.skipping=!1,this.worldMatrix=new D,this.sortProperty="",this.sortOrderAsc=!0,this.sortCallback=this.depthSortCallback,this.processors=new w(this),this.tintMode=L.MULTIPLY,this.initRenderNodes(this._defaultRenderNodesMap),this.setPosition(e,i),this.setTexture(s),r&&this.setConfig(r)},_defaultRenderNodesMap:{get:function(){return s}},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},setConfig:function(t){if(!t)return this;this.config=t;var e=0,i="",s=this.ops;for(e=0;e=this.animQuantity&&(this.animCounter=0,this.currentAnim=I(this.currentAnim+1,0,e)),i},setAnim:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=1),this.randomAnim=e,this.animQuantity=i,this.currentAnim=0;var s=typeof t;if(this.anims.length=0,Array.isArray(t))this.anims=this.anims.concat(t);else if("string"===s)this.anims.push(t);else if("object"===s){var r=t;(t=p(r,"anims",null))&&(this.anims=this.anims.concat(t));var n=p(r,"cycle",!1);this.randomAnim=!n,this.animQuantity=p(r,"quantity",i)}return 1===this.anims.length&&(this.animQuantity=1,this.randomAnim=!1),this},setRadial:function(t){return void 0===t&&(t=!0),this.radial=t,this},addParticleBounds:function(t,e,i,s,r,n,a,o){if("object"==typeof t){var h=t;t=h.x,e=h.y,i=x(h,"w")?h.w:h.width,s=x(h,"h")?h.h:h.height}return this.addParticleProcessor(new E(t,e,i,s,r,n,a,o))},setParticleSpeed:function(t,e){return void 0===e&&(e=t),this.ops.speedX.onChange(t),t===e?this.ops.speedY.active=!1:this.ops.speedY.onChange(e),this.radial=!0,this},setParticleScale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.ops.scaleX.onChange(t),this.ops.scaleY.onChange(e),this},setParticleGravity:function(t,e){return this.gravityX=t,this.gravityY=e,this},setParticleAlpha:function(t){return this.ops.alpha.onChange(t),this},setParticleTint:function(t){return this.ops.tint.onChange(t),this},setEmitterAngle:function(t){return this.ops.angle.onChange(t),this},setParticleLifespan:function(t){return this.ops.lifespan.onChange(t),this},setQuantity:function(t){return this.quantity=t,this},setFrequency:function(t,e){return this.frequency=t,this.flowCounter=t>0?t:0,e&&(this.quantity=e),this},addDeathZone:function(t){var e;Array.isArray(t)||(t=[t]);for(var i=[],s=0;s-1&&(this.zoneTotal++,this.zoneTotal===s.total&&(this.zoneTotal=0,this.zoneIndex++,this.zoneIndex===i&&(this.zoneIndex=0)))}},getDeathZone:function(t){for(var e=this.deathZones,i=0;i=0&&(this.zoneIndex=e),this},addParticleProcessor:function(t){return this.processors.exists(t)||(t.emitter&&t.emitter.removeParticleProcessor(t),this.processors.add(t),t.emitter=this),t},removeParticleProcessor:function(t){return this.processors.exists(t)&&(this.processors.remove(t,!0),t.emitter=null),t},getProcessors:function(){return this.processors.getAll("active",!0)},createGravityWell:function(t){return this.addParticleProcessor(new m(t))},reserve:function(t){var e=this.dead;if(this.maxParticles>0){var i=this.getParticleCount();i+t>this.maxParticles&&(t=this.maxParticles-(i+t))}for(var s=0;s0&&this.getParticleCount()>=this.maxParticles||this.maxAliveParticles>0&&this.getAliveParticleCount()>=this.maxAliveParticles},onParticleEmit:function(t,e){return void 0===t?(this.emitCallback=null,this.emitCallbackScope=null):"function"==typeof t&&(this.emitCallback=t,e&&(this.emitCallbackScope=e)),this},onParticleDeath:function(t,e){return void 0===t?(this.deathCallback=null,this.deathCallbackScope=null):"function"==typeof t&&(this.deathCallback=t,e&&(this.deathCallbackScope=e)),this},killAll:function(){for(var t=this.dead,e=this.alive;e.length>0;)t.push(e.pop());return this},forEachAlive:function(t,e){for(var i=this.alive,s=i.length,r=0;r0&&this.fastForward(t),this.emitting=!0,this.resetCounters(this.frequency,!0),void 0!==e&&(this.duration=Math.abs(e)),this.emit(c.START,this)),this},stop:function(t){return void 0===t&&(t=!1),this.emitting&&(this.emitting=!1,t&&this.killAll(),this.emit(c.STOP,this)),this},pause:function(){return this.active=!1,this},resume:function(){return this.active=!0,this},setSortProperty:function(t,e){return void 0===t&&(t=""),void 0===e&&(e=this.true),this.sortProperty=t,this.sortOrderAsc=e,this.sortCallback=this.depthSortCallback,this},setSortCallback:function(t){return t=""!==this.sortProperty?this.depthSortCallback:null,this.sortCallback=t,this},depthSort:function(){return O(this.alive,this.sortCallback.bind(this)),this},depthSortCallback:function(t,e){var i=this.sortProperty;return this.sortOrderAsc?t[i]-e[i]:e[i]-t[i]},flow:function(t,e,i){return void 0===e&&(e=1),this.emitting=!1,this.frequency=t,this.quantity=e,void 0!==i&&(this.stopAfter=i),this.start()},explode:function(t,e,i){this.frequency=-1,this.resetCounters(-1,!0);var s=this.emitParticle(t,e,i);return this.emit(c.EXPLODE,this,s),s},emitParticleAt:function(t,e,i){return this.emitParticle(i,t,e)},emitParticle:function(t,e,i){if(!this.atLimit()){void 0===t&&(t=this.ops.quantity.onEmit());for(var s=this.dead,r=this.stopAfter,n=this.follow?this.follow.x+this.followOffset.x:e,a=this.follow?this.follow.y+this.followOffset.y:i,o=0;o0&&(this.stopCounter++,this.stopCounter>=r))break;if(this.atLimit())break}return h}},fastForward:function(t,e){void 0===e&&(e=1e3/60);var i=0;for(this.skipping=!0;i0){var u=this.deathCallback,d=this.deathCallbackScope;for(a=h-1;a>=0;a--){var f=o[a];r.splice(f.index,1),n.push(f.particle),u&&u.call(d,f.particle),f.particle.setPosition()}}if(this.emitting||this.skipping){if(0===this.frequency)this.emitParticle();else if(this.frequency>0)for(this.flowCounter-=e;this.flowCounter<=0;)this.emitParticle(),this.flowCounter+=this.frequency;this.skipping||(this.duration>0&&(this.elapsed+=e,this.elapsed>=this.duration&&this.stop()),this.stopAfter>0&&this.stopCounter>=this.stopAfter&&this.stop())}else 1===this.completeFlag&&0===r.length&&(this.completeFlag=0,this.emit(c.COMPLETE,this))},overlap:function(t){for(var e=this.getWorldTransformMatrix(),i=this.alive,s=i.length,r=[],n=0;n0){var u=0;for(this.skipping=!0;u0&&T(s,t,t),s},createEmitter:function(){throw new Error("createEmitter removed. See ParticleEmitter docs for info")},particleX:{get:function(){return this.ops.x.current},set:function(t){this.ops.x.onChange(t)}},particleY:{get:function(){return this.ops.y.current},set:function(t){this.ops.y.onChange(t)}},accelerationX:{get:function(){return this.ops.accelerationX.current},set:function(t){this.ops.accelerationX.onChange(t)}},accelerationY:{get:function(){return this.ops.accelerationY.current},set:function(t){this.ops.accelerationY.onChange(t)}},maxVelocityX:{get:function(){return this.ops.maxVelocityX.current},set:function(t){this.ops.maxVelocityX.onChange(t)}},maxVelocityY:{get:function(){return this.ops.maxVelocityY.current},set:function(t){this.ops.maxVelocityY.onChange(t)}},speed:{get:function(){return this.ops.speedX.current},set:function(t){this.ops.speedX.onChange(t),this.ops.speedY.onChange(t)}},speedX:{get:function(){return this.ops.speedX.current},set:function(t){this.ops.speedX.onChange(t)}},speedY:{get:function(){return this.ops.speedY.current},set:function(t){this.ops.speedY.onChange(t)}},moveToX:{get:function(){return this.ops.moveToX.current},set:function(t){this.ops.moveToX.onChange(t)}},moveToY:{get:function(){return this.ops.moveToY.current},set:function(t){this.ops.moveToY.onChange(t)}},bounce:{get:function(){return this.ops.bounce.current},set:function(t){this.ops.bounce.onChange(t)}},particleScaleX:{get:function(){return this.ops.scaleX.current},set:function(t){this.ops.scaleX.onChange(t)}},particleScaleY:{get:function(){return this.ops.scaleY.current},set:function(t){this.ops.scaleY.onChange(t)}},particleColor:{get:function(){return this.ops.color.current},set:function(t){this.ops.color.onChange(t)}},colorEase:{get:function(){return this.ops.color.easeName},set:function(t){this.ops.color.setEase(t)}},particleTint:{get:function(){return this.ops.tint.current},set:function(t){this.ops.tint.onChange(t)}},particleAlpha:{get:function(){return this.ops.alpha.current},set:function(t){this.ops.alpha.onChange(t)}},lifespan:{get:function(){return this.ops.lifespan.current},set:function(t){this.ops.lifespan.onChange(t)}},particleAngle:{get:function(){return this.ops.angle.current},set:function(t){this.ops.angle.onChange(t)}},particleRotate:{get:function(){return this.ops.rotate.current},set:function(t){this.ops.rotate.onChange(t)}},quantity:{get:function(){return this.ops.quantity.current},set:function(t){this.ops.quantity.onChange(t)}},delay:{get:function(){return this.ops.delay.current},set:function(t){this.ops.delay.onChange(t)}},hold:{get:function(){return this.ops.hold.current},set:function(t){this.ops.hold.onChange(t)}},flowCounter:{get:function(){return this.counters[0]},set:function(t){this.counters[0]=t}},frameCounter:{get:function(){return this.counters[1]},set:function(t){this.counters[1]=t}},animCounter:{get:function(){return this.counters[2]},set:function(t){this.counters[2]=t}},elapsed:{get:function(){return this.counters[3]},set:function(t){this.counters[3]=t}},stopCounter:{get:function(){return this.counters[4]},set:function(t){this.counters[4]=t}},completeFlag:{get:function(){return this.counters[5]},set:function(t){this.counters[5]=t}},zoneIndex:{get:function(){return this.counters[6]},set:function(t){this.counters[6]=t}},zoneTotal:{get:function(){return this.counters[7]},set:function(t){this.counters[7]=t}},currentFrame:{get:function(){return this.counters[8]},set:function(t){this.counters[8]=t}},currentAnim:{get:function(){return this.counters[9]},set:function(t){this.counters[9]=t}},preDestroy:function(){var t;this.texture=null,this.frames=null,this.anims=null,this.emitCallback=null,this.emitCallbackScope=null,this.deathCallback=null,this.deathCallbackScope=null,this.emitZones=null,this.deathZones=null,this.bounds=null,this.follow=null,this.counters=null;var e=this.ops;for(t=0;t0&&T.height>0){var w=-x.halfWidth,b=-x.halfHeight;l.globalAlpha=y,l.save(),a.setToContext(l),u&&(w=Math.round(w),b=Math.round(b)),l.imageSmoothingEnabled=!x.source.scaleMode,l.drawImage(x.source.image,T.x,T.y,T.width,T.height,w,b,T.width,T.height),l.restore()}}}l.restore()}}},92730(t,e,i){var s=i(25305),r=i(44603),n=i(23568),a=i(95540),o=i(31600);r.register("particles",function(t,e){void 0===t&&(t={});var i=n(t,"key",null),r=a(t,"config",null),h=new o(this.scene,0,0,i);return void 0!==e&&(t.add=e),s(this.scene,h,t),r&&h.setConfig(r),h})},676(t,e,i){var s=i(39429),r=i(31600);s.register("particles",function(t,e,i,s){return void 0!==t&&"string"==typeof t&&console.warn("ParticleEmitterManager was removed in Phaser 3.60. See documentation for details"),this.displayList.add(new r(this.scene,t,e,i,s))})},90668(t,e,i){var s=i(29747),r=s,n=s;r=i(21188),n=i(9871),t.exports={renderWebGL:r,renderCanvas:n}},21188(t,e,i){var s=i(59996),r=i(61340),n=i(70554),a=new r,o=new r,h=new r,l=new r,u={},d={},c={quad:new Float32Array(8)};t.exports=function(t,e,i,r){var f=i.camera;f.addToRenderList(e),a.copyWithScrollFactorFrom(f.getViewMatrix(!i.useCanvas),f.scrollX,f.scrollY,e.scrollFactorX,e.scrollFactorY),r&&a.multiply(r),l.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),a.multiply(l);var p=n.getTintAppendFloatAlpha,g=e.alpha,m=e.alive,v=m.length,y=e.viewBounds;if(0!==v&&(!y||s(y,f.worldView))){e.sortCallback&&e.depthSort();for(var x=e.tintMode,T=0;Tthis._length&&(this.counter=this._length-1),this},changeSource:function(t){return this.source=t,this.updateSource()},getPoint:function(t){0===this._direction?(this.counter++,this.counter>=this._length&&(this.yoyo?(this._direction=1,this.counter=this._length-1):this.counter=0)):(this.counter--,-1===this.counter&&(this.yoyo?(this._direction=0,this.counter=0):this.counter=this._length-1));var e=this.points[this.counter];e&&(t.x=e.x,t.y=e.y)}});t.exports=s},68875(t,e,i){var s=i(83419),r=i(26099),n=new s({initialize:function(t){this.source=t,this._tempVec=new r,this.total=-1},getPoint:function(t){var e=this._tempVec;this.source.getRandomPoint(e),t.x=e.x,t.y=e.y}});t.exports=n},21024(t,e,i){t.exports={DeathZone:i(26388),EdgeZone:i(19909),RandomZone:i(68875)}},1159(t,e,i){var s=i(83419),r=i(31401),n=i(68287),a=new s({Extends:n,Mixins:[r.PathFollower],initialize:function(t,e,i,s,r,a){n.call(this,t,i,s,r,a),this.path=e},preUpdate:function(t,e){this.anims.update(t,e),this.pathUpdate(t)}});t.exports=a},90145(t,e,i){var s=i(39429),r=i(1159);s.register("follower",function(t,e,i,s,n){var a=new r(this.scene,t,e,i,s,n);return this.displayList.add(a),this.updateList.add(a),a})},80321(t,e,i){var s=i(43246),r=i(83419),n=i(31401),a=i(95643),o=i(30100),h=i(67277),l=new r({Extends:a,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.Mask,n.RenderNodes,n.ScrollFactor,n.Transform,n.Visible,h],initialize:function(t,e,i,s,r,n,h){void 0===s&&(s=16777215),void 0===r&&(r=128),void 0===n&&(n=1),void 0===h&&(h=.1),a.call(this,t,"PointLight"),this.initRenderNodes(this._defaultRenderNodesMap),this.setPosition(e,i),this.color=o(s),this.intensity=n,this.attenuation=h,this.width=2*r,this.height=2*r,this._radius=r},_defaultRenderNodesMap:{get:function(){return s}},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this.width=2*t,this.height=2*t}},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return this._radius}},displayOriginY:{get:function(){return this._radius}}});t.exports=l},39829(t,e,i){var s=i(25305),r=i(44603),n=i(23568),a=i(80321);r.register("pointlight",function(t,e){void 0===t&&(t={});var i=n(t,"color",16777215),r=n(t,"radius",128),o=n(t,"intensity",1),h=n(t,"attenuation",.1),l=new a(this.scene,0,0,i,r,o,h);return void 0!==e&&(t.add=e),s(this.scene,l,t),l})},71255(t,e,i){var s=i(39429),r=i(80321);s.register("pointlight",function(t,e,i,s,n,a){return this.displayList.add(new r(this.scene,t,e,i,s,n,a))})},67277(t,e,i){var s=i(29747),r=s,n=s;r=i(57787),t.exports={renderWebGL:r,renderCanvas:n}},57787(t,e,i){var s=i(91296);t.exports=function(t,e,i,r){var n=i.camera;n.addToRenderList(e);var a=s(e,n,r,!i.useCanvas).calc,o=e.width,h=e.height,l=-e._radius,u=-e._radius,d=l+o,c=u+h,f=a.getX(0,0),p=a.getY(0,0),g=a.getX(l,u),m=a.getY(l,u),v=a.getX(l,c),y=a.getY(l,c),x=a.getX(d,c),T=a.getY(d,c),w=a.getX(d,u),b=a.getY(d,u);(e.customRenderNodes.BatchHandler||e.defaultRenderNodes.BatchHandler).batch(i,e,g,m,v,y,w,b,x,T,f,p)}},591(t,e,i){var s=i(83419),r=i(45650),n=i(88571),a=i(83999),o=i(58855),h=new s({Extends:n,Mixins:[a],initialize:function(t,e,i,s,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=32),void 0===a&&(a=32),void 0===h&&(h=!0);var l=t.sys.textures.addDynamicTexture(r(),s,a,h);n.call(this,t,e,i,l),this.type="RenderTexture",this.camera=this.texture.camera,this._saved=!1,this.renderMode=o.RENDER,this.isCurrentlyRendering=!1},setSize:function(t,e){this.width=t,this.height=e,this.updateDisplayOrigin();var i=this.input;return i&&!i.customHitArea&&(i.hitArea.width=t,i.hitArea.height=e),this},resize:function(t,e,i){return this.texture.setSize(t,e,i),this.setSize(this.texture.width,this.texture.height),this},saveTexture:function(t){var e=this.texture,i=e.key,s=e.manager;return s.exists(i)&&s.get(i)===e?(s.renameTexture(i,t),this._saved=!0):(e.key=t,e.manager.addDynamicTexture(e)&&(this._saved=!0)),e},setRenderMode:function(t,e){return this.renderMode=t,e&&this.texture.preserve(!0),this},render:function(){return this.texture.render(),this},fill:function(t,e,i,s,r,n){return this.texture.fill(t,e,i,s,r,n),this},clear:function(t,e,i,s){return this.texture.clear(t,e,i,s),this},stamp:function(t,e,i,s,r){return this.texture.stamp(t,e,i,s,r),this},erase:function(t,e,i){return this.texture.erase(t,e,i),this},draw:function(t,e,i,s,r){return this.texture.draw(t,e,i,s,r),this},capture:function(t,e){return this.texture.capture(t,e),this},repeat:function(t,e,i,s,r,n,a){return this.texture.repeat(t,e,i,s,r,n,a),this},preserve:function(t){return this.texture.preserve(t),this},callback:function(t){return this.texture.callback(t),this},snapshotArea:function(t,e,i,s,r,n,a){return this.texture.snapshotArea(t,e,i,s,r,n,a),this},snapshot:function(t,e,i){return this.texture.snapshot(t,e,i)},snapshotPixel:function(t,e,i){return this.texture.snapshotPixel(t,e,i)},preDestroy:function(){this.camera=null,this._saved||this.texture.destroy()}});t.exports=h},97272(t,e,i){var s=i(40652),r=i(58855);t.exports=function(t,e,i,n){var a=!0,o=!0;e.renderMode===r.REDRAW?o=!1:e.renderMode===r.RENDER&&(a=!1),a&&e.render(),o&&s(t,e,i,n)}},34495(t,e,i){var s=i(25305),r=i(44603),n=i(23568),a=i(591);r.register("renderTexture",function(t,e){void 0===t&&(t={});var i=n(t,"x",0),r=n(t,"y",0),o=n(t,"width",32),h=n(t,"height",32),l=new a(this.scene,i,r,o,h);return void 0!==e&&(t.add=e),s(this.scene,l,t),l})},60505(t,e,i){var s=i(39429),r=i(591);s.register("renderTexture",function(t,e,i,s){return this.displayList.add(new r(this.scene,t,e,i,s))})},83999(t,e,i){var s=i(29747),r=s,n=s;r=i(53937),n=i(97272),t.exports={renderWebGL:r,renderCanvas:n}},58855(t){t.exports={RENDER:"render",REDRAW:"redraw",ALL:"all"}},53937(t,e,i){var s=i(99517),r=i(58855);t.exports=function(t,e,i,n){if(!e.isCurrentlyRendering){e.isCurrentlyRendering=!0;var a=!0,o=!0;e.renderMode===r.REDRAW?o=!1:e.renderMode===r.RENDER&&(a=!1),a&&e.render(),o&&s(t,e,i,n),e.isCurrentlyRendering=!1}}},77757(t,e,i){var s=i(9674),r=i(85760),n=i(83419),a=i(31401),o=i(95643),h=i(38745),l=i(84322),u=i(26099),d=new n({Extends:o,Mixins:[a.AlphaSingle,a.BlendMode,a.Depth,a.Flip,a.Mask,a.RenderNodes,a.Size,a.Texture,a.Transform,a.Visible,a.ScrollFactor,h],initialize:function(t,e,i,r,n,a,h,d,c){void 0===r&&(r="__DEFAULT"),void 0===a&&(a=2),void 0===h&&(h=!0),o.call(this,t,"Rope"),this.anims=new s(this),this.points=a,this.vertices,this.uv,this.colors,this.alphas,this.tintMode="__DEFAULT"===r?l.FILL:l.MULTIPLY,this.dirty=!1,this.horizontal=h,this._flipX=!1,this._flipY=!1,this._perp=new u,this.debugCallback=null,this.debugGraphic=null,this.setTexture(r,n),this.setPosition(e,i),this.setSizeToFrame(),this.initRenderNodes(this._defaultRenderNodesMap),Array.isArray(a)&&this.resizeArrays(a.length),this.setPoints(a,d,c),this.updateVertices()},_defaultRenderNodesMap:{get:function(){return r}},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(t,e){var i=this.anims.currentFrame;this.anims.update(t,e),this.anims.currentFrame!==i&&(this.updateUVs(),this.updateVertices())},play:function(t,e,i){return this.anims.play(t,e,i),this},setDirty:function(){return this.dirty=!0,this},setHorizontal:function(t,e,i){return void 0===t&&(t=this.points.length),this.horizontal?this:(this.horizontal=!0,this.setPoints(t,e,i))},setVertical:function(t,e,i){return void 0===t&&(t=this.points.length),this.horizontal?(this.horizontal=!1,this.setPoints(t,e,i)):this},setTintMode:function(t){return void 0===t&&(t=l.MULTIPLY),this.tintMode=t,this},setAlphas:function(t,e){var i=this.points.length;if(i<1)return this;var s,r=this.alphas;void 0===t?t=[1]:Array.isArray(t)||void 0!==e||(t=[t]);var n=0;if(void 0!==e)for(s=0;sn&&(a=t[n]),r[n]=a,t.length>n+1&&(a=t[n+1]),r[n+1]=a}return this},setColors:function(t){var e=this.points.length;if(e<1)return this;var i,s=this.colors;void 0===t?t=[16777215]:Array.isArray(t)||(t=[t]);var r=0;if(t.length===e)for(i=0;ir&&(n=t[r]),s[r]=n,t.length>r+1&&(n=t[r+1]),s[r+1]=n}return this},setPoints:function(t,e,i){if(void 0===t&&(t=2),"number"==typeof t){var s,r,n,a=t;if(a<2&&(a=2),t=[],this.horizontal)for(n=-this.frame.halfWidth,r=this.frame.width/(a-1),s=0;s>>16,o=(65280&r)>>>8,h=255&r;t.fillStyle="rgba("+a+","+o+","+h+","+n+")"}},75177(t){t.exports=function(t,e,i,s){var r=i||e.strokeColor,n=s||e.strokeAlpha,a=(16711680&r)>>>16,o=(65280&r)>>>8,h=255&r;t.strokeStyle="rgba("+a+","+o+","+h+","+n+")",t.lineWidth=e.lineWidth}},17803(t,e,i){var s=i(87891),r=i(83419),n=i(31401),a=i(95643),o=i(23031),h=new r({Extends:a,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.GetBounds,n.Lighting,n.Mask,n.Origin,n.RenderNodes,n.ScrollFactor,n.Transform,n.Visible],initialize:function(t,e,i){void 0===e&&(e="Shape"),a.call(this,t,e),this.geom=i,this.pathData=[],this.pathIndexes=[],this.fillColor=16777215,this.fillAlpha=1,this.strokeColor=16777215,this.strokeAlpha=1,this.lineWidth=1,this.isFilled=!1,this.isStroked=!1,this.closePath=!0,this._tempLine=new o,this.width=0,this.height=0,this.enableFilters&&(this.filtersFocusContext=!0),this.initRenderNodes(this._defaultRenderNodesMap)},_defaultRenderNodesMap:{get:function(){return s}},setFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.isFilled=!1:(this.fillColor=t,this.fillAlpha=e,this.isFilled=!0),this},setStrokeStyle:function(t,e,i){return void 0===i&&(i=1),void 0===t?this.isStroked=!1:(this.lineWidth=t,this.strokeColor=e,this.strokeAlpha=i,this.isStroked=!0),this},setClosePath:function(t){return this.closePath=t,this},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this},preDestroy:function(){this.geom=null,this._tempLine=null,this.pathData=[],this.pathIndexes=[]},displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}}});t.exports=h},34682(t,e,i){var s=i(70554);t.exports=function(t,e,i,r,n,a,o){var h=s.getTintAppendFloatAlpha(r.strokeColor,r.strokeAlpha*n),l=r.pathData,u=l.length-1,d=r.lineWidth,c=!r.closePath,f=r.customRenderNodes.StrokePath||r.defaultRenderNodes.StrokePath,p=[];c&&(u-=2);for(var g=0;g0&&m===l[g-2]&&v===l[g-1]||p.push({x:m,y:v,width:d})}f.run(t,e,p,d,c,i,h,h,h,h,void 0,r.lighting)}},23629(t,e,i){var s=i(13609),r=i(83419),n=i(39506),a=i(94811),o=i(96503),h=i(36383),l=i(17803),u=new r({Extends:l,Mixins:[s],initialize:function(t,e,i,s,r,n,a,h,u){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=128),void 0===r&&(r=0),void 0===n&&(n=360),void 0===a&&(a=!1),l.call(this,t,"Arc",new o(0,0,s)),this._startAngle=r,this._endAngle=n,this._anticlockwise=a,this._iterations=.01,this.setPosition(e,i);var d=2*this.geom.radius;this.setSize(d,d),void 0!==h&&this.setFillStyle(h,u),this.updateDisplayOrigin(),this.updateData()},iterations:{get:function(){return this._iterations},set:function(t){this._iterations=t,this.updateData()}},radius:{get:function(){return this.geom.radius},set:function(t){this.geom.radius=t;var e=2*t;this.setSize(e,e),this.updateDisplayOrigin(),this.updateData()}},startAngle:{get:function(){return this._startAngle},set:function(t){this._startAngle=t,this.updateData()}},endAngle:{get:function(){return this._endAngle},set:function(t){this._endAngle=t,this.updateData()}},anticlockwise:{get:function(){return this._anticlockwise},set:function(t){this._anticlockwise=t,this.updateData()}},setRadius:function(t){return this.radius=t,this},setIterations:function(t){return void 0===t&&(t=.01),this.iterations=t,this},setStartAngle:function(t,e){return this._startAngle=t,void 0!==e&&(this._anticlockwise=e),this.updateData()},setEndAngle:function(t,e){return this._endAngle=t,void 0!==e&&(this._anticlockwise=e),this.updateData()},updateData:function(){var t=this._iterations,e=t,i=this.geom.radius,s=n(this._startAngle),r=n(this._endAngle),o=i,l=i;r-=s,this._anticlockwise?r<-h.TAU?r=-h.TAU:r>0&&(r=-h.TAU+r%h.TAU):r>h.TAU?r=h.TAU:r<0&&(r=h.TAU+r%h.TAU);for(var u,d=[o+Math.cos(s)*i,l+Math.sin(s)*i];e<1;)u=r*e+s,d.push(o+Math.cos(u)*i,l+Math.sin(u)*i),e+=t;return u=r+s,d.push(o+Math.cos(u)*i,l+Math.sin(u)*i),d.push(o+Math.cos(s)*i,l+Math.sin(s)*i),this.pathIndexes=a(d),this.pathData=d,this}});t.exports=u},42542(t,e,i){var s=i(39506),r=i(65960),n=i(75177),a=i(20926);t.exports=function(t,e,i,o){i.addToRenderList(e);var h=t.currentContext;if(a(t,h,e,i,o)){var l=e.radius;h.beginPath(),h.arc(l-e.originX*(2*l),l-e.originY*(2*l),l,s(e._startAngle),s(e._endAngle),e.anticlockwise),e.closePath&&h.closePath(),e.isFilled&&(r(h,e),h.fill()),e.isStroked&&(n(h,e),h.stroke()),h.restore()}}},42563(t,e,i){var s=i(23629),r=i(39429);r.register("arc",function(t,e,i,r,n,a,o,h){return this.displayList.add(new s(this.scene,t,e,i,r,n,a,o,h))}),r.register("circle",function(t,e,i,r,n){return this.displayList.add(new s(this.scene,t,e,i,0,360,!1,r,n))})},13609(t,e,i){var s=i(29747),r=s,n=s;r=i(41447),n=i(42542),t.exports={renderWebGL:r,renderCanvas:n}},41447(t,e,i){var s=i(91296),r=i(10441),n=i(34682);t.exports=function(t,e,i,a){var o=i.camera;o.addToRenderList(e);var h=s(e,o,a,!i.useCanvas).calc,l=e._displayOriginX,u=e._displayOriginY,d=e.alpha,c=e.customRenderNodes.Submitter||e.defaultRenderNodes.Submitter;e.isFilled&&r(i,c,h,e,d,l,u),e.isStroked&&n(i,c,h,e,d,l,u)}},89(t,e,i){var s=i(83419),r=i(33141),n=i(94811),a=i(87841),o=i(17803),h=new s({Extends:o,Mixins:[r],initialize:function(t,e,i,s,r,n){void 0===e&&(e=0),void 0===i&&(i=0),o.call(this,t,"Curve",s),this._smoothness=32,this._curveBounds=new a,this.closePath=!1,this.setPosition(e,i),void 0!==r&&this.setFillStyle(r,n),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(t){this._smoothness=t,this.updateData()}},setSmoothness:function(t){return this._smoothness=t,this.updateData()},updateData:function(){var t=this._curveBounds,e=this._smoothness;this.geom.getBounds(t,e),this.setSize(t.width,t.height),this.updateDisplayOrigin();for(var i=[],s=this.geom.getPoints(e),r=0;r0)for(s(o,e),_=0;_0&&P>0&&o.fillRect(h+A*f+C,l+_*p+C,R,P));if(b&&e.altFillAlpha>0)for(s(o,e,e.altFillColor,e.altFillAlpha*u),_=0;_0&&P>0&&o.fillRect(h+A*f+C,l+_*p+C,R,P)):M=1;if(S&&e.strokeAlpha>0){r(o,e,e.strokeColor,e.strokeAlpha*u);var O=e.strokeOutside?0:1;for(A=O;AE&&(o.beginPath(),o.moveTo(d+h,l),o.lineTo(d+h,c+l),o.stroke()),c>E&&(o.beginPath(),o.moveTo(h,c+l),o.lineTo(d+h,c+l),o.stroke()))}o.restore()}}},34137(t,e,i){var s=i(39429),r=i(30479);s.register("grid",function(t,e,i,s,n,a,o,h,l,u){return this.displayList.add(new r(this.scene,t,e,i,s,n,a,o,h,l,u))})},26015(t,e,i){var s=i(29747),r=s,n=s;r=i(46161),n=i(49912),t.exports={renderWebGL:r,renderCanvas:n}},46161(t,e,i){var s=i(91296),r=i(70554);t.exports=function(t,e,i,n){var a=i.camera;a.addToRenderList(e);var o=e.customRenderNodes.FillRect||e.defaultRenderNodes.FillRect,h=e.customRenderNodes.Submitter||e.defaultRenderNodes.Submitter,l=s(e,a,n,!i.useCanvas).calc;l.translate(-e._displayOriginX,-e._displayOriginY);var u,d=e.alpha,c=e.width,f=e.height,p=e.cellWidth,g=e.cellHeight,m=Math.ceil(c/p),v=Math.ceil(f/g),y=p,x=g,T=p-(m*p-c),w=g-(v*g-f),b=e.isFilled,S=e.showAltCells,C=e.isStroked,E=e.cellPadding,A=e.lineWidth,_=A/2,M=0,R=0,P=0,O=0,L=0;if(E&&(y-=2*E,x-=2*E,T-=2*E,w-=2*E),b&&e.fillAlpha>0)for(u=r.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*d),R=0;R0&&L>0&&o.run(i,l,h,M*p+E,R*g+E,O,L,u,u,u,u,e.lighting));if(S&&e.altFillAlpha>0)for(u=r.getTintAppendFloatAlpha(e.altFillColor,e.altFillAlpha*d),R=0;R0&&L>0&&o.run(i,l,h,M*p+E,R*g+E,O,L,u,u,u,u)):P=1;if(C&&e.strokeAlpha>0){var D=r.getTintAppendFloatAlpha(e.strokeColor,e.strokeAlpha*d),F=e.strokeOutside?0:1;for(M=F;M_&&o.run(i,l,h,c-_,0,A,f,D,D,D,D),f>_&&o.run(i,l,h,0,f-_,c,A,D,D,D,D))}}},61475(t,e,i){var s=i(99651),r=i(83419),n=i(17803),a=new r({Extends:n,Mixins:[s],initialize:function(t,e,i,s,r,a,o,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=48),void 0===r&&(r=32),void 0===a&&(a=15658734),void 0===o&&(o=10066329),void 0===h&&(h=13421772),n.call(this,t,"IsoBox",null),this.projection=4,this.fillTop=a,this.fillLeft=o,this.fillRight=h,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isFilled=!0,this.setPosition(e,i),this.setSize(s,r),this.updateDisplayOrigin()},setProjection:function(t){return this.projection=t,this},setFaces:function(t,e,i){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),this.showTop=t,this.showLeft=e,this.showRight=i,this},setFillStyle:function(t,e,i){return this.fillTop=t,this.fillLeft=e,this.fillRight=i,this.isFilled=!0,this}});t.exports=a},11508(t,e,i){var s=i(65960),r=i(20926);t.exports=function(t,e,i,n){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,n)&&e.isFilled){var o=e.width,h=e.height,l=o/2,u=o/e.projection;e.showTop&&(s(a,e,e.fillTop),a.beginPath(),a.moveTo(-l,-h),a.lineTo(0,-u-h),a.lineTo(l,-h),a.lineTo(l,-1),a.lineTo(0,u-1),a.lineTo(-l,-1),a.lineTo(-l,-h),a.fill()),e.showLeft&&(s(a,e,e.fillLeft),a.beginPath(),a.moveTo(-l,0),a.lineTo(0,u),a.lineTo(0,u-h),a.lineTo(-l,-h),a.lineTo(-l,0),a.fill()),e.showRight&&(s(a,e,e.fillRight),a.beginPath(),a.moveTo(l,0),a.lineTo(0,u),a.lineTo(0,u-h),a.lineTo(l,-h),a.lineTo(l,0),a.fill()),a.restore()}}},3933(t,e,i){var s=i(39429),r=i(61475);s.register("isobox",function(t,e,i,s,n,a,o){return this.displayList.add(new r(this.scene,t,e,i,s,n,a,o))})},99651(t,e,i){var s=i(29747),r=s,n=s;r=i(68149),n=i(11508),t.exports={renderWebGL:r,renderCanvas:n}},68149(t,e,i){var s=i(91296),r=i(70554);t.exports=function(t,e,i,n){if(e.isFilled){var a=i.camera;a.addToRenderList(e);var o,h,l,u,d,c,f,p,g,m=e.customRenderNodes.FillTri||e.defaultRenderNodes.FillTri,v=e.customRenderNodes.Submitter||e.defaultRenderNodes.Submitter,y=s(e,a,n,!i.useCanvas).calc,x=e.width,T=e.height,w=x/2,b=x/e.projection,S=e.alpha,C=e.lighting;e.showTop&&(o=r.getTintAppendFloatAlpha(e.fillTop,S),h=-w,l=-T,u=0,d=-b-T,c=w,f=-T,p=0,g=b-T,m.run(i,y,v,h,l,u,d,c,f,o,o,o,C),m.run(i,y,v,c,f,p,g,h,l,o,o,o,C)),e.showLeft&&(o=r.getTintAppendFloatAlpha(e.fillLeft,S),h=-w,l=0,u=0,d=b,c=0,f=b-T,p=-w,g=-T,m.run(i,y,v,h,l,u,d,c,f,o,o,o,C),m.run(i,y,v,c,f,p,g,h,l,o,o,o,C)),e.showRight&&(o=r.getTintAppendFloatAlpha(e.fillRight,S),h=w,l=0,u=0,d=b,c=0,f=b-T,p=w,g=-T,m.run(i,y,v,h,l,u,d,c,f,o,o,o,C),m.run(i,y,v,c,f,p,g,h,l,o,o,o,C))}}},16933(t,e,i){var s=i(83419),r=i(60561),n=i(17803),a=new s({Extends:n,Mixins:[r],initialize:function(t,e,i,s,r,a,o,h,l){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=48),void 0===r&&(r=32),void 0===a&&(a=!1),void 0===o&&(o=15658734),void 0===h&&(h=10066329),void 0===l&&(l=13421772),n.call(this,t,"IsoTriangle",null),this.projection=4,this.fillTop=o,this.fillLeft=h,this.fillRight=l,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isReversed=a,this.isFilled=!0,this.setPosition(e,i),this.setSize(s,r),this.updateDisplayOrigin()},setProjection:function(t){return this.projection=t,this},setReversed:function(t){return this.isReversed=t,this},setFaces:function(t,e,i){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),this.showTop=t,this.showLeft=e,this.showRight=i,this},setFillStyle:function(t,e,i){return this.fillTop=t,this.fillLeft=e,this.fillRight=i,this.isFilled=!0,this}});t.exports=a},79590(t,e,i){var s=i(65960),r=i(20926);t.exports=function(t,e,i,n){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,n)&&e.isFilled){var o=e.width,h=e.height,l=o/2,u=o/e.projection,d=e.isReversed;e.showTop&&d&&(s(a,e,e.fillTop),a.beginPath(),a.moveTo(-l,-h),a.lineTo(0,-u-h),a.lineTo(l,-h),a.lineTo(0,u-h),a.fill()),e.showLeft&&(s(a,e,e.fillLeft),a.beginPath(),d?(a.moveTo(-l,-h),a.lineTo(0,u),a.lineTo(0,u-h)):(a.moveTo(-l,0),a.lineTo(0,u),a.lineTo(0,u-h)),a.fill()),e.showRight&&(s(a,e,e.fillRight),a.beginPath(),d?(a.moveTo(l,-h),a.lineTo(0,u),a.lineTo(0,u-h)):(a.moveTo(l,0),a.lineTo(0,u),a.lineTo(0,u-h)),a.fill()),a.restore()}}},49803(t,e,i){var s=i(39429),r=i(16933);s.register("isotriangle",function(t,e,i,s,n,a,o,h){return this.displayList.add(new r(this.scene,t,e,i,s,n,a,o,h))})},60561(t,e,i){var s=i(29747),r=s,n=s;r=i(51503),n=i(79590),t.exports={renderWebGL:r,renderCanvas:n}},51503(t,e,i){var s=i(91296),r=i(70554);t.exports=function(t,e,i,n){if(e.isFilled){var a=i.camera;a.addToRenderList(e);var o,h,l,u,d,c,f,p=e.customRenderNodes.FillTri||e.defaultRenderNodes.FillTri,g=e.customRenderNodes.Submitter||e.defaultRenderNodes.Submitter,m=s(e,a,n,!i.useCanvas).calc,v=e.width,y=e.height,x=v/2,T=v/e.projection,w=e.isReversed,b=e.alpha,S=e.lighting;if(e.showTop&&w){o=r.getTintAppendFloatAlpha(e.fillTop,b),h=-x,l=-y,u=0,d=-T-y,c=x,f=-y;var C=T-y;p.run(i,m,g,h,l,u,d,c,f,o,o,o,S),p.run(i,m,g,c,f,0,C,h,l,o,o,o,S)}e.showLeft&&(o=r.getTintAppendFloatAlpha(e.fillLeft,b),w?(h=-x,l=-y,u=0,d=T,c=0,f=T-y):(h=-x,l=0,u=0,d=T,c=0,f=T-y),p.run(i,m,g,h,l,u,d,c,f,o,o,o,S)),e.showRight&&(o=r.getTintAppendFloatAlpha(e.fillRight,b),w?(h=x,l=-y,u=0,d=T,c=0,f=T-y):(h=x,l=0,u=0,d=T,c=0,f=T-y),p.run(i,m,g,h,l,u,d,c,f,o,o,o,S))}}},57847(t,e,i){var s=i(83419),r=i(17803),n=i(23031),a=i(36823),o=new s({Extends:r,Mixins:[a],initialize:function(t,e,i,s,a,o,h,l,u){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===a&&(a=0),void 0===o&&(o=128),void 0===h&&(h=0),r.call(this,t,"Line",new n(s,a,o,h));var d=Math.max(1,this.geom.right-this.geom.left),c=Math.max(1,this.geom.bottom-this.geom.top);this.lineWidth=1,this._startWidth=1,this._endWidth=1,this.setPosition(e,i),this.setSize(d,c),void 0!==l&&this.setStrokeStyle(1,l,u),this.updateDisplayOrigin()},setLineWidth:function(t,e){return void 0===e&&(e=t),this._startWidth=t,this._endWidth=e,this.lineWidth=t,this},setTo:function(t,e,i,s){return this.geom.setTo(t,e,i,s),this}});t.exports=o},17440(t,e,i){var s=i(75177),r=i(20926);t.exports=function(t,e,i,n){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,n)){var o=e._displayOriginX,h=e._displayOriginY;e.isStroked&&(s(a,e),a.beginPath(),a.moveTo(e.geom.x1-o,e.geom.y1-h),a.lineTo(e.geom.x2-o,e.geom.y2-h),a.stroke()),a.restore()}}},2481(t,e,i){var s=i(39429),r=i(57847);s.register("line",function(t,e,i,s,n,a,o,h){return this.displayList.add(new r(this.scene,t,e,i,s,n,a,o,h))})},36823(t,e,i){var s=i(29747),r=s,n=s;r=i(77385),n=i(17440),t.exports={renderWebGL:r,renderCanvas:n}},77385(t,e,i){var s=i(91296),r=i(70554),n=[{x:0,y:0,width:0},{x:0,y:0,width:0}];t.exports=function(t,e,i,a){var o=i.camera;o.addToRenderList(e);var h=s(e,o,a,!i.useCanvas).calc,l=e._displayOriginX,u=e._displayOriginY,d=e.alpha;if(e.isStroked){var c=r.getTintAppendFloatAlpha(e.strokeColor,e.strokeAlpha*d);n[0].x=e.geom.x1-l,n[0].y=e.geom.y1-u,n[0].width=e._startWidth,n[1].x=e.geom.x2-l,n[1].y=e.geom.y2-u,n[1].width=e._endWidth,(e.customRenderNodes.StrokePath||e.defaultRenderNodes.StrokePath).run(i,e.customRenderNodes.Submitter||e.defaultRenderNodes.Submitter,n,1,!0,h,c,c,c,c,void 0,e.lighting)}}},24949(t,e,i){var s=i(90273),r=i(83419),n=i(94811),a=i(13829),o=i(25717),h=i(17803),l=i(5469),u=new r({Extends:h,Mixins:[s],initialize:function(t,e,i,s,r,n){void 0===e&&(e=0),void 0===i&&(i=0),h.call(this,t,"Polygon",new o(s));var l=a(this.geom);this.setPosition(e,i),this.setSize(l.width,l.height),void 0!==r&&this.setFillStyle(r,n),this.updateDisplayOrigin(),this.updateData()},smooth:function(t){void 0===t&&(t=1);for(var e=0;e0,this.updateRoundedData()},setSize:function(t,e){this.width=t,this.height=e,this.geom.setSize(t,e),this.updateData(),this.updateDisplayOrigin();var i=this.input;return i&&!i.customHitArea&&(i.hitArea.width=t,i.hitArea.height=e),this},updateData:function(){if(this.isRounded)return this.updateRoundedData();var t=[],e=this.geom,i=this._tempLine;return e.getLineA(i),t.push(i.x1,i.y1,i.x2,i.y2),e.getLineB(i),t.push(i.x2,i.y2),e.getLineC(i),t.push(i.x2,i.y2),e.getLineD(i),t.push(i.x2,i.y2),this.pathData=t,this},updateRoundedData:function(){var t=[],e=this.width/2,i=this.height/2,s=Math.min(e,i),n=Math.min(this.radius,s),a=e,o=i,h=Math.max(4,Math.min(16,Math.ceil(n/2)));return this.arcTo(t,a-e+n,o-i+n,n,Math.PI,1.5*Math.PI,h),t.push(a+e-n,o-i),this.arcTo(t,a+e-n,o-i+n,n,1.5*Math.PI,2*Math.PI,h),t.push(a+e,o+i-n),this.arcTo(t,a+e-n,o+i-n,n,0,.5*Math.PI,h),t.push(a-e+n,o+i),this.arcTo(t,a-e+n,o+i-n,n,.5*Math.PI,Math.PI,h),t.push(a-e,o-i+n),this.pathIndexes=r(t),this.pathData=t,this},arcTo:function(t,e,i,s,r,n,a){for(var o=(n-r)/a,h=0;h<=a;h++){var l=r+o*h;t.push(e+Math.cos(l)*s,i+Math.sin(l)*s)}}});t.exports=h},48682(t,e,i){var s=i(65960),r=i(75177),n=i(20926),a=function(t,e,i,s,r,n){var a=Math.min(s/2,r/2),o=Math.min(n,a);0!==o?(t.moveTo(e+o,i),t.lineTo(e+s-o,i),t.arcTo(e+s,i,e+s,i+o,o),t.lineTo(e+s,i+r-o),t.arcTo(e+s,i+r,e+s-o,i+r,o),t.lineTo(e+o,i+r),t.arcTo(e,i+r,e,i+r-o,o),t.lineTo(e,i+o),t.arcTo(e,i,e+o,i,o),t.closePath()):t.rect(e,i,s,r)};t.exports=function(t,e,i,o){i.addToRenderList(e);var h=t.currentContext;if(n(t,h,e,i,o)){var l=e._displayOriginX,u=e._displayOriginY;e.isFilled&&(s(h,e),e.isRounded?(h.beginPath(),a(h,-l,-u,e.width,e.height,e.radius),h.fill()):h.fillRect(-l,-u,e.width,e.height)),e.isStroked&&(r(h,e),h.beginPath(),e.isRounded?a(h,-l,-u,e.width,e.height,e.radius):h.rect(-l,-u,e.width,e.height),h.stroke()),h.restore()}}},87959(t,e,i){var s=i(39429),r=i(74561);s.register("rectangle",function(t,e,i,s,n,a){return this.displayList.add(new r(this.scene,t,e,i,s,n,a))})},95597(t,e,i){var s=i(29747),r=s,n=s;r=i(52059),n=i(48682),t.exports={renderWebGL:r,renderCanvas:n}},52059(t,e,i){var s=i(10441),r=i(91296),n=i(34682),a=i(70554);t.exports=function(t,e,i,o){var h=i.camera;h.addToRenderList(e);var l=r(e,h,o,!i.useCanvas).calc,u=e._displayOriginX,d=e._displayOriginY,c=e.alpha,f=e.customRenderNodes,p=e.defaultRenderNodes,g=f.Submitter||p.Submitter;if(e.isFilled)if(e.isRounded)s(i,g,l,e,c,u,d);else{var m=a.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*c);(f.FillRect||p.FillRect).run(i,l,g,-u,-d,e.width,e.height,m,m,m,m,e.lighting)}e.isStroked&&n(i,g,l,e,c,u,d)}},55911(t,e,i){var s=i(81991),r=i(83419),n=i(94811),a=i(17803),o=new r({Extends:a,Mixins:[s],initialize:function(t,e,i,s,r,n,o,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=5),void 0===r&&(r=32),void 0===n&&(n=64),a.call(this,t,"Star",null),this._points=s,this._innerRadius=r,this._outerRadius=n,this.setPosition(e,i),this.setSize(2*n,2*n),void 0!==o&&this.setFillStyle(o,h),this.updateDisplayOrigin(),this.updateData()},setPoints:function(t){return this._points=t,this.updateData()},setInnerRadius:function(t){return this._innerRadius=t,this.updateData()},setOuterRadius:function(t){return this._outerRadius=t,this.updateData()},points:{get:function(){return this._points},set:function(t){this._points=t,this.updateData()}},innerRadius:{get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this.updateData()}},outerRadius:{get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this.updateData()}},updateData:function(){var t=[],e=this._points,i=this._innerRadius,s=this._outerRadius,r=Math.PI/2*3,a=Math.PI/e,o=s,h=s;t.push(o,h+-s);for(var l=0;l=this.size||this.bufferUpdateSegments===this.MAX_BUFFER_UPDATE_SEGMENTS_FULL)){var e=Math.floor(t/this.bufferUpdateSegmentSize);this.bufferUpdateSegments|=1<=this.size)return this;var e=this.submitterNode.instanceBufferLayout,i=e.buffer.viewF32,s=this.memberCount*e.layout.stride;return i.set(t,s/i.BYTES_PER_ELEMENT),this.setSegmentNeedsUpdate(this.memberCount),this.memberCount++,this},addMember:function(t){if(this.memberCount>=this.size)return this;var e=this.nextMemberF32,i=this.nextMemberU32;t||(t={});var s=this.frame;if(void 0!==t.frame&&(s=t.frame.base?t.frame.base:t.frame),"string"==typeof s&&!(s=this.texture.get(s)))return this;var r=0;this._setAnimatedValue(t.x,r),r+=4,this._setAnimatedValue(t.y,r),r+=4,this._setAnimatedValue(t.rotation,r),r+=4,this._setAnimatedValue(t.scaleX,r,1),r+=4,this._setAnimatedValue(t.scaleY,r,1),r+=4,this._setAnimatedValue(t.alpha,r,1),r+=4;var n=t.animation;if(n){var a;if("string"==typeof n||"number"==typeof n)a="string"==typeof n?this.animationDataNames[n]:this.animationDataIndices[n],this._setAnimatedValue({base:a.index,amplitude:a.frameCount,duration:a.duration,ease:h.Linear,yoyo:!1},r);else{var o=n.base;a="string"==typeof o?this.animationDataNames[o]:"number"==typeof o?this.animationDataIndices[o]:this.animationData[0],this._setAnimatedValue({base:a.index,amplitude:"number"==typeof n.amplitude?n.amplitude:a.frameCount,duration:n.duration||a.duration,delay:n.delay||0,ease:n.ease||h.Linear,yoyo:!!n.yoyo},r)}}else{var l=this.frameDataIndices[s.name],u=t.frame;u&&void 0!==u.base?this._setAnimatedValue({base:l,amplitude:u.amplitude,duration:u.duration,delay:u.delay,ease:u.ease,yoyo:u.yoyo},r):this._setAnimatedValue(l,r)}r+=4,this._setAnimatedValue(t.tintBlend,r,1),r+=4;var c=void 0===t.tintBottomLeft?16777215:t.tintBottomLeft,f=void 0===t.tintTopLeft?16777215:t.tintTopLeft,p=void 0===t.tintBottomRight?16777215:t.tintBottomRight,g=void 0===t.tintTopRight?16777215:t.tintTopRight,m=void 0===t.alphaBottomLeft?1:t.alphaBottomLeft,v=void 0===t.alphaTopLeft?1:t.alphaTopLeft,y=void 0===t.alphaBottomRight?1:t.alphaBottomRight,x=void 0===t.alphaTopRight?1:t.alphaTopRight;return i[r++]=d(c,m),i[r++]=d(f,v),i[r++]=d(p,y),i[r++]=d(g,x),e[r++]=void 0===t.originX?.5:t.originX,e[r++]=void 0===t.originY?.5:t.originY,e[r++]=t.tintMode||0,e[r++]=void 0===t.creationTime?this.timeElapsed:t.creationTime,e[r++]=void 0===t.scrollFactorX?1:t.scrollFactorX,e[r++]=void 0===t.scrollFactorY?1:t.scrollFactorY,this.addData(this.nextMemberF32),this},editMember:function(t,e){if(t<0||t>=this.memberCount)return this;var i=this.memberCount;return this.memberCount=t,this.addMember(e),this.memberCount=i,this},patchMember:function(t,e,i){if(!(t<0||t>=this.memberCount)){var s=this.submitterNode.instanceBufferLayout,r=s.buffer,n=t*s.layout.stride,a=r.viewU32,o=n/4;if(i)for(var h=0;h=this.memberCount)return null;var e=this.submitterNode.instanceBufferLayout,i=e.buffer,s=t*e.layout.stride,r=i.viewF32,n=i.viewU32,a={},o=s/r.BYTES_PER_ELEMENT;a.x=this._getAnimatedValue(o),o+=4,a.y=this._getAnimatedValue(o),o+=4,a.rotation=this._getAnimatedValue(o),o+=4,a.scaleX=this._getAnimatedValue(o),o+=4,a.scaleY=this._getAnimatedValue(o),o+=4,a.alpha=this._getAnimatedValue(o),o+=4;var h=this._getAnimatedValue(o);o+=4,"number"!=typeof h&&(h=h.base);var l=this.frameDataIndicesInv[h];if(void 0===l){var u=this.animationDataIndices[h];u&&(a.animation=u.name)}else a.frame=l;return a.tintBlend=this._getAnimatedValue(o),o+=4,a.tintBottomLeft=n[o++],a.tintTopLeft=n[o++],a.tintBottomRight=n[o++],a.tintTopRight=n[o++],a.alphaBottomLeft=(a.tintBottomLeft>>>24)/255,a.alphaTopLeft=(a.tintTopLeft>>>24)/255,a.alphaBottomRight=(a.tintBottomRight>>>24)/255,a.alphaTopRight=(a.tintTopRight>>>24)/255,a.tintBottomLeft&=16777215,a.tintTopLeft&=16777215,a.tintBottomRight&=16777215,a.tintTopRight&=16777215,a.originX=r[o++],a.originY=r[o++],a.tintMode=r[o++],a.creationTime=r[o++],a.scrollFactorX=r[o++],a.scrollFactorY=r[o++],a},getMemberData:function(t,e){if(t<0||t>=this.memberCount)return null;var i=this.submitterNode.instanceBufferLayout,s=i.buffer,r=i.layout.stride,n=t*r;e||(e=this.nextMemberU32);var a=s.viewU32,o=a.BYTES_PER_ELEMENT;return e.set(a.subarray(n/o,n/o+r/o)),e},removeMembers:function(t,e){if(t<0||t>=this.memberCount)return this;void 0===e&&(e=1),e=Math.min(e,this.memberCount-t);var i=this.submitterNode.instanceBufferLayout,s=i.layout.stride,r=t*s,n=e*s,a=i.buffer.viewU8;a.set(a.subarray(r+n),r);for(var o=t;othis.memberCount)return this;Array.isArray(e)||(e=[e]);var i=this.memberCount,s=this.submitterNode.instanceBufferLayout,r=s.layout.stride,n=t*r,a=e.length*r;s.buffer.viewU8.copyWithin(n+a,n,i*r),this.memberCount=t;for(var o=0;othis.memberCount)return this;var i=e.length*e.BYTES_PER_ELEMENT,s=this.submitterNode.instanceBufferLayout,r=s.layout.stride,n=t*r;s.buffer.viewU8.copyWithin(n+i,n,this.memberCount*r),s.buffer.viewU32.set(e,n/e.BYTES_PER_ELEMENT),this.memberCount=Math.min(this.size,this.memberCount+i/r);for(var a=t;a=1?p=0:p<-1&&(p=-.999),p=(p+1)/2,a=Math.floor(f)+p}(l=o>0?l/o%2:0)<0&&(l+=2),l/=2,l+=n,u&&(o=-o),d||(l=-l),s[e++]=r,s[e++]=a,s[e++]=o,s[e]=l}},_getAnimatedValue:function(t){var e=this.submitterNode.instanceBufferLayout.buffer.viewF32,i=e[t++],s=e[t++],r=e[t++],n=e[t];if(0===s||0===r||0===o)return i;n>0||(n=-n);var a=r<0;a&&(r=-r);var o=Math.floor(n);if(n=(n-=o)*r*2%r,o===h.Gravity){var l=Math.floor(s),u=2*(s-l)-1;return 0===u&&(u=1),{base:i,ease:o,duration:r,delay:n,yoyo:a,velocity:l,gravityFactor:u}}return{base:i,ease:o,amplitude:s,duration:r,delay:n,yoyo:a}},setAnimationEnabled:function(t,e){return this._animationsEnabled[t]=!!e,this},preDestroy:function(){this.frameDataTexture.destroy()}});t.exports=c},16193(t,e,i){var s=i(10312),r=i(44603),n=i(23568),a=i(76573);r.register("spriteGPULayer",function(t,e){void 0===t&&(t={});var i=n(t,"key",null),r=n(t,"size",1),o=new a(this.scene,i,r);return void 0!==e&&(t.add=e),o.alpha=n(t,"alpha",1),o.blendMode=n(t,"blendMode",s.NORMAL),o.visible=n(t,"visible",!0),e&&this.scene.sys.displayList.add(o),o})},96019(t,e,i){var s=i(76573);i(39429).register("spriteGPULayer",function(t,e){return this.displayList.add(new s(this.scene,t,e))})},71238(t,e,i){var s=i(29747),r=i(97591),n=s;t.exports={renderWebGL:r,renderCanvas:n}},97591(t){t.exports=function(t,e,i,s){i.camera.addToRenderList(e);var r=e.customRenderNodes,n=e.defaultRenderNodes;(r.Submitter||n.Submitter).run(i)}},14727(t,e,i){var s=i(78705),r=i(83419),n=i(88571),a=i(74759),o=new r({Extends:n,Mixins:[a],initialize:function(t,e,i,s,r){n.call(this,t,e,i,s,r),this.type="Stamp"},_defaultRenderNodesMap:{get:function(){return s}}});t.exports=o},656(t,e,i){var s=new(i(61340));t.exports=function(t,e,i){i.addToRenderList(e),s.copyFrom(i.matrix),i.matrix.loadIdentity();var r=i.scrollX,n=i.scrollY;i.scrollX=0,i.scrollY=0,t.batchSprite(e,e.frame,i),i.scrollX=r,i.scrollY=n,i.matrix.copyFrom(s)}},31479(t,e,i){var s=i(25305),r=i(44603),n=i(23568),a=i(14727);r.register("stamp",function(t,e){void 0===t&&(t={});var i=n(t,"key",null),r=n(t,"frame",null),o=new a(this.scene,0,0,i,r);return void 0!==e&&(t.add=e),s(this.scene,o,t),o})},85326(t,e,i){var s=i(14727);i(39429).register("stamp",function(t,e,i,r){return this.displayList.add(new s(this.scene,t,e,i,r))})},74759(t,e,i){var s=i(29747);s=i(656),t.exports={renderCanvas:s}},14220(t){t.exports=function(t,e,i){var s=t.canvas,r=t.context,n=t.style,a=[],o=0,h=i.length;n.maxLines>0&&n.maxLines1&&(d+=l*(c.length-1))}n.wordWrap&&(d-=r.measureText(" ").width),a[u]=Math.ceil(d),o=Math.max(o,a[u])}var p=e.fontSize+n.strokeThickness,g=p*h,m=t.lineSpacing;return h>1&&(g+=m*(h-1)),{width:o,height:g,lines:h,lineWidths:a,lineSpacing:m,lineHeight:p}}},79557(t,e,i){var s=i(27919);t.exports=function(t){var e=s.create(this),i=e.getContext("2d",{willReadFrequently:!0});t.syncFont(e,i);var r=i.measureText(t.testString);if("actualBoundingBoxAscent"in r){var n=r.actualBoundingBoxAscent,a=r.actualBoundingBoxDescent;return s.remove(e),{ascent:n,descent:a,fontSize:n+a}}var o=Math.ceil(r.width*t.baselineX),h=o,l=2*h;h=h*t.baselineY|0,e.width=o,e.height=l,i.fillStyle="#f00",i.fillRect(0,0,o,l),i.font=t._font,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(t.testString,0,h);var u={ascent:0,descent:0,fontSize:0},d=i.getImageData(0,0,o,l);if(!d)return u.ascent=h,u.descent=h+6,u.fontSize=u.ascent+u.descent,s.remove(e),u;var c,f,p=d.data,g=p.length,m=4*o,v=0,y=!1;for(c=0;ch;c--){for(f=0;fu){if(0===c){for(var v=p;v.length;){var y=(v=v.slice(0,-1)).length*this.letterSpacing;if((m=e.measureText(v).width+y)<=u)break}if(!v.length)throw new Error("wordWrapWidth < a single character");var x=f.substr(v.length);d[c]=x,h+=v}var T=d[c].length?c:c+1,w=d.slice(T).join(" ").replace(/[ \n]*$/gi,"");r.splice(a+1,0,w),n=r.length;break}h+=p,u-=m}s+=h.replace(/[ \n]*$/gi,"")+"\n"}}return s=s.replace(/[\s|\n]*$/gi,"")},basicWordWrap:function(t,e,i){for(var s="",r=t.split(this.splitRegExp),n=r.length-1,a=e.measureText(" ").width,o=0;o<=n;o++){for(var h=i,l=r[o].split(" "),u=l.length-1,d=0;d<=u;d++){var c=l[d],f=c.length*this.letterSpacing,p=e.measureText(c).width+f,g=p;dh&&d>0&&(s+="\n",h=i),s+=c,d0&&(c+=h.lineSpacing*g),i.rtl)d=f-d-u.left-u.right;else if("right"===i.align)d+=a-h.lineWidths[g];else if("center"===i.align)d+=(a-h.lineWidths[g])/2;else if("justify"===i.align){if(h.lineWidths[g]/h.width>=.85){var m=h.width-h.lineWidths[g],v=e.measureText(" ").width,y=o[g].trim(),x=y.split(" ");m+=(o[g].length-y.length)*v;for(var T=Math.floor(m/v),w=0;T>0;)x[w]+=" ",w=(w+1)%(x.length-1||1),--T;o[g]=x.join(" ")}}this.autoRound&&(d=Math.round(d),c=Math.round(c));var b=this.letterSpacing;if(i.strokeThickness&&0===b&&(i.syncShadow(e,i.shadowStroke),e.strokeText(o[g],d,c)),i.color)if(i.syncShadow(e,i.shadowFill),0!==b)for(var S=0,C=o[g].split(""),E=0;E2?a[o++]:"",s=a[o++]||"16px",i=a[o++]||"Courier"}return i===this.fontFamily&&s===this.fontSize&&r===this.fontStyle||(this.fontFamily=i,this.fontSize=s,this.fontStyle=r,e&&this.update(!0)),this.parent},setFontFamily:function(t){return this.fontFamily!==t&&(this.fontFamily=t,this.update(!0)),this.parent},setFontStyle:function(t){return this.fontStyle!==t&&(this.fontStyle=t,this.update(!0)),this.parent},setFontSize:function(t){return"number"==typeof t&&(t=t.toString()+"px"),this.fontSize!==t&&(this.fontSize=t,this.update(!0)),this.parent},setTestString:function(t){return this.testString=t,this.update(!0)},setFixedSize:function(t,e){return this.fixedWidth=t,this.fixedHeight=e,t&&(this.parent.width=t),e&&(this.parent.height=e),this.update(!1)},setBackgroundColor:function(t){return this.backgroundColor=t,this.update(!1)},setFill:function(t){return this.color=t,this.update(!1)},setColor:function(t){return this.color=t,this.update(!1)},setResolution:function(t){return this.resolution=t,this.update(!1)},setStroke:function(t,e){return void 0===e&&(e=this.strokeThickness),void 0===t&&0!==this.strokeThickness?(this.strokeThickness=0,this.update(!0)):this.stroke===t&&this.strokeThickness===e||(this.stroke=t,this.strokeThickness=e,this.update(!0)),this.parent},setShadow:function(t,e,i,s,r,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i="#000"),void 0===s&&(s=0),void 0===r&&(r=!1),void 0===n&&(n=!0),this.shadowOffsetX=t,this.shadowOffsetY=e,this.shadowColor=i,this.shadowBlur=s,this.shadowStroke=r,this.shadowFill=n,this.update(!1)},setShadowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.shadowOffsetX=t,this.shadowOffsetY=e,this.update(!1)},setShadowColor:function(t){return void 0===t&&(t="#000"),this.shadowColor=t,this.update(!1)},setShadowBlur:function(t){return void 0===t&&(t=0),this.shadowBlur=t,this.update(!1)},setShadowStroke:function(t){return this.shadowStroke=t,this.update(!1)},setShadowFill:function(t){return this.shadowFill=t,this.update(!1)},setWordWrapWidth:function(t,e){return void 0===e&&(e=!1),this.wordWrapWidth=t,this.wordWrapUseAdvanced=e,this.update(!1)},setWordWrapCallback:function(t,e){return void 0===e&&(e=null),this.wordWrapCallback=t,this.wordWrapCallbackScope=e,this.update(!1)},setAlign:function(t){return void 0===t&&(t="left"),this.align=t,this.update(!1)},setMaxLines:function(t){return void 0===t&&(t=0),this.maxLines=t,this.update(!1)},getTextMetrics:function(){var t=this.metrics;return{ascent:t.ascent,descent:t.descent,fontSize:t.fontSize}},toJSON:function(){var t={};for(var e in o)t[e]=this[e];return t.metrics=this.getTextMetrics(),t},destroy:function(){this.parent=void 0}});t.exports=h},34397(t){t.exports=function(t,e,i,s){if(0!==e.width&&0!==e.height){i.camera.addToRenderList(e);var r=e.customRenderNodes,n=e.defaultRenderNodes;(r.Submitter||n.Submitter).run(i,e,s,0,r.Texturer||n.Texturer,r.Transformer||n.Transformer)}}},20839(t,e,i){var s=i(9674),r=i(27919),n=i(41571),a=i(83419),o=i(31401),h=i(95643),l=i(68703),u=i(56295),d=i(45650),c=i(26099),f=new a({Extends:h,Mixins:[o.Alpha,o.BlendMode,o.ComputedSize,o.Depth,o.Flip,o.GetBounds,o.Lighting,o.Mask,o.Origin,o.RenderNodes,o.ScrollFactor,o.Texture,o.Tint,o.Transform,o.Visible,u],initialize:function(t,e,i,n,a,o,l){var u=t.sys.renderer,f=u&&!u.gl;h.call(this,t,"TileSprite");var p=t.sys.textures.get(o).get(l);n=n?Math.floor(n):p.width,a=a?Math.floor(a):p.height,this._tilePosition=new c,this._tileScale=new c(1,1),this._tileRotation=0,this.dirty=!1,this.renderer=u,this.canvas=f?r.create(this,n,a):null,this.context=f?this.canvas.getContext("2d",{willReadFrequently:!1}):null,this._displayTextureKey=d(),this.displayTexture=f?t.sys.textures.addCanvas(this._displayTextureKey,this.canvas):null,this.displayFrame=this.displayTexture?this.displayTexture.get():null,this.currentFrame=null,this.fillCanvas=f?r.create2D(this,p.width,this.displayFrame.height):null,this.fillContext=this.fillCanvas?this.fillCanvas.getContext("2d",{willReadFrequently:!1}):null,this.fillPattern=null,this.anims=new s(this),this.setTexture(o,l),this.setPosition(e,i),this.setSize(n,a),this.setOrigin(.5,.5),this.initRenderNodes(this._defaultRenderNodesMap)},_defaultRenderNodesMap:{get:function(){return n}},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(t,e){this.anims.update(t,e)},setFrame:function(t){var e=this.texture.get(t);return e.cutWidth&&e.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this.frame=e,this.dirty=!0,this},setSizeToFrame:function(){return this},setTilePosition:function(t,e){return void 0!==t&&(this.tilePositionX=t),void 0!==e&&(this.tilePositionY=e),this},setTileRotation:function(t){return void 0===t&&(t=0),this.tileRotation=t,this},setTileScale:function(t,e){return void 0===t&&(t=this.tileScaleX),void 0===e&&(e=t),this.tileScaleX=t,this.tileScaleY=e,this},updateTileTexture:function(){if(this.renderer&&!this.renderer.gl){var t=this.frame,e=this.fillContext,i=this.fillCanvas,s=t.cutWidth,r=t.cutHeight;e.clearRect(0,0,s,r),i.width=s,i.height=r,e.drawImage(t.source.image,t.cutX,t.cutY,t.cutWidth,t.cutHeight,0,0,s,r),this.fillPattern=e.createPattern(i,"repeat"),this.currentFrame=t}},updateCanvas:function(){var t=this.canvas,e=this.width,i=this.height,s=this.currentFrame!==this.frame;if((t.width!==e||t.height!==i||s)&&(t.width=e,t.height=i,this.displayFrame.setSize(e,i),this.updateDisplayOrigin(),s&&this.updateTileTexture(),this.dirty=!0),!this.dirty||this.renderer&&this.renderer.gl)this.dirty=!1;else{var r=this.context;this.scene.sys.game.config.antialias||l.disable(r);var n=this._tileScale.x,a=this._tileScale.y,o=this._tilePosition.x,h=this._tilePosition.y;r.clearRect(0,0,e,i),r.save(),r.rotate(this._tileRotation),r.scale(n,a),r.translate(-o,-h),r.fillStyle=this.fillPattern;var u=Math.max(e,Math.abs(e/n)),d=Math.max(i,Math.abs(i/a)),c=Math.sqrt(u*u+d*d);r.fillRect(o-c,h-c,2*c,2*c),r.restore(),this.dirty=!1}},setSize:function(t,e){this.width=t,this.height=e,this.updateDisplayOrigin();var i=this.input;return i&&!i.customHitArea&&(i.hitArea.width=t,i.hitArea.height=e),this},preDestroy:function(){this.canvas&&r.remove(this.canvas),this.fillCanvas&&r.remove(this.fillCanvas),this.fillPattern=null,this.fillContext=null,this.fillCanvas=null,this.displayTexture=null,this.displayFrame=null,this.renderer=null,this.anims.destroy(),this.anims=void 0},tilePositionX:{get:function(){return this._tilePosition.x},set:function(t){this._tilePosition.x=t,this.dirty=!0}},tilePositionY:{get:function(){return this._tilePosition.y},set:function(t){this._tilePosition.y=t,this.dirty=!0}},tileRotation:{get:function(){return this._tileRotation},set:function(t){this._tileRotation=t,this.dirty=!0}},tileScaleX:{get:function(){return this._tileScale.x},set:function(t){this._tileScale.x=t,this.dirty=!0}},tileScaleY:{get:function(){return this._tileScale.y},set:function(t){this._tileScale.y=t,this.dirty=!0}}});t.exports=f},46992(t){t.exports=function(t,e,i,s){e.updateCanvas(),i.addToRenderList(e),t.batchSprite(e,e.displayFrame,i,s)}},14167(t,e,i){var s=i(25305),r=i(44603),n=i(23568),a=i(20839);r.register("tileSprite",function(t,e){void 0===t&&(t={});var i=n(t,"x",0),r=n(t,"y",0),o=n(t,"width",512),h=n(t,"height",512),l=n(t,"key",""),u=n(t,"frame",""),d=new a(this.scene,i,r,o,h,l,u);return void 0!==e&&(t.add=e),s(this.scene,d,t),d})},91681(t,e,i){var s=i(20839);i(39429).register("tileSprite",function(t,e,i,r,n,a){return this.displayList.add(new s(this.scene,t,e,i,r,n,a))})},56295(t,e,i){var s=i(29747),r=s,n=s;r=i(18553),n=i(46992),t.exports={renderWebGL:r,renderCanvas:n}},18553(t){t.exports=function(t,e,i,s){var r=e.width,n=e.height;if(0!==r&&0!==n){i.camera.addToRenderList(e);var a=e.customRenderNodes,o=e.defaultRenderNodes;(a.Submitter||o.Submitter).run(i,e,s,0,a.Texturer||o.Texturer,a.Transformer||o.Transformer)}}},18471(t,e,i){var s=i(45319),r=i(40939),n=i(83419),a=i(31401),o=i(51708),h=i(8443),l=i(95643),u=i(36383),d=i(14463),c=i(45650),f=i(10247),p=new n({Extends:l,Mixins:[a.Alpha,a.BlendMode,a.ComputedSize,a.Depth,a.Flip,a.GetBounds,a.Lighting,a.Mask,a.Origin,a.RenderNodes,a.ScrollFactor,a.TextureCrop,a.Tint,a.Transform,a.Visible,f],initialize:function(t,e,i,s){l.call(this,t,"Video"),this.video,this.videoTexture,this.videoTextureSource,this.snapshotTexture,this.glFlipY=!0,this._key=c(),this.touchLocked=!1,this.playWhenUnlocked=!1,this.frameReady=!1,this.isStalled=!1,this.failedPlayAttempts=0,this.metadata,this.retry=0,this.retryInterval=500,this._systemMuted=!1,this._codeMuted=!1,this._systemPaused=!1,this._codePaused=!1,this._callbacks={ended:this.completeHandler.bind(this),legacy:this.legacyPlayHandler.bind(this),playing:this.playingHandler.bind(this),seeked:this.seekedHandler.bind(this),seeking:this.seekingHandler.bind(this),stalled:this.stalledHandler.bind(this),suspend:this.stalledHandler.bind(this),waiting:this.stalledHandler.bind(this)},this._loadCallbackHandler=this.loadErrorHandler.bind(this),this._metadataCallbackHandler=this.metadataHandler.bind(this),this._crop=this.resetCropObject(),this.markers={},this._markerIn=0,this._markerOut=0,this._playingMarker=!1,this._lastUpdate=0,this.cacheKey="",this.isSeeking=!1,this._playCalled=!1,this._getFrame=!1,this._rfvCallbackId=0;var r=t.sys.game;this._device=r.device.video,this.setPosition(e,i),this.setSize(256,256),this.initRenderNodes(this._defaultRenderNodesMap),r.events.on(h.PAUSE,this.globalPause,this),r.events.on(h.RESUME,this.globalResume,this);var n=t.sys.sound;n&&n.on(d.GLOBAL_MUTE,this.globalMute,this),s&&this.load(s)},_defaultRenderNodesMap:{get:function(){return r}},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},load:function(t){var e=this.scene.sys.cache.video.get(t);return e?(this.cacheKey=t,this.loadHandler(e.url,e.noAudio,e.crossOrigin)):console.warn("No video in cache for key: "+t),this},changeSource:function(t,e,i,s,r){void 0===e&&(e=!0),void 0===i&&(i=!1),this.cacheKey!==t&&(this.load(t),e&&this.play(i,s,r))},getVideoKey:function(){return this.cacheKey},loadURL:function(t,e,i){void 0===e&&(e=!1);var s=this._device.getVideoURL(t);return s?(this.cacheKey="",this.loadHandler(s.url,e,i)):console.warn("No supported video format found for "+t),this},loadMediaStream:function(t,e,i){return this.loadHandler(null,e,i,t)},loadHandler:function(t,e,i,s){e||(e=!1);var r=this.video;if(r?(this.removeLoadEventHandlers(),this.stop()):((r=document.createElement("video")).controls=!1,r.setAttribute("playsinline","playsinline"),r.setAttribute("preload","auto"),r.setAttribute("disablePictureInPicture","true")),e?(r.muted=!0,r.defaultMuted=!0,r.setAttribute("autoplay","autoplay")):(r.muted=!1,r.defaultMuted=!1,r.removeAttribute("autoplay")),i?r.setAttribute("crossorigin",i):r.removeAttribute("crossorigin"),s)if("srcObject"in r)try{r.srcObject=s}catch(t){if("TypeError"!==t.name)throw t;r.src=URL.createObjectURL(s)}else r.src=URL.createObjectURL(s);else r.src=t;this.retry=0,this.video=r,this._playCalled=!1,r.load(),this.addLoadEventHandlers();var n=this.scene.sys.textures.get(this._key);return this.setTexture(n),this},requestVideoFrame:function(t,e){var i=this.video;if(i){var s=e.width,r=e.height,n=this.videoTexture,a=this.videoTextureSource,h=!n||a.source!==i;h?(this._codePaused=i.paused,this._codeMuted=i.muted,n?(a.source=i,a.width=s,a.height=r,n.get().setSize(s,r)):((n=this.scene.sys.textures.create(this._key,i,s,r)).add("__BASE",0,0,0,s,r),this.setTexture(n),this.videoTexture=n,this.videoTextureSource=n.source[0],this.videoTextureSource.setFlipY(this.glFlipY),this.emit(o.VIDEO_TEXTURE,this,n)),this.setSizeToFrame(),this.updateDisplayOrigin()):a.update(),this.isStalled=!1,this.metadata=e;var l=e.mediaTime;h&&(this._lastUpdate=l,this.emit(o.VIDEO_CREATED,this,s,r),this.frameReady||(this.frameReady=!0,this.emit(o.VIDEO_PLAY,this))),this._playingMarker?l>=this._markerOut&&(i.loop?(i.currentTime=this._markerIn,this.emit(o.VIDEO_LOOP,this)):(this.stop(!1),this.emit(o.VIDEO_COMPLETE,this))):l-1&&i>e&&i=0&&!isNaN(i)&&i>e&&(this.markers[t]=[e,i]),this},playMarker:function(t,e){var i=this.markers[t];return i&&this.play(e,i[0],i[1]),this},removeMarker:function(t){return delete this.markers[t],this},snapshot:function(t,e){return void 0===t&&(t=this.width),void 0===e&&(e=this.height),this.snapshotArea(0,0,this.width,this.height,t,e)},snapshotArea:function(t,e,i,s,r,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===s&&(s=this.height),void 0===r&&(r=i),void 0===n&&(n=s);var a=this.video,o=this.snapshotTexture;return o?(o.setSize(r,n),a&&o.context.drawImage(a,t,e,i,s,0,0,r,n)):(o=this.scene.sys.textures.createCanvas(c(),r,n),this.snapshotTexture=o,a&&o.context.drawImage(a,t,e,i,s,0,0,r,n)),o.update()},saveSnapshotTexture:function(t){return this.snapshotTexture?this.scene.sys.textures.renameTexture(this.snapshotTexture.key,t):this.snapshotTexture=this.scene.sys.textures.createCanvas(t,this.width,this.height),this.snapshotTexture},playSuccess:function(){if(this._playCalled){this.addEventHandlers(),this._codePaused=!1,this.touchLocked&&(this.touchLocked=!1,this.emit(o.VIDEO_UNLOCKED,this));var t=this.scene.sys.sound;t&&t.mute&&this.setMute(!0),this._markerIn>-1&&(this.video.currentTime=this._markerIn)}},playError:function(t){var e=t.name;"NotAllowedError"===e?(this.touchLocked=!0,this.playWhenUnlocked=!0,this.failedPlayAttempts=1,this.emit(o.VIDEO_LOCKED,this)):"NotSupportedError"===e?(this.stop(!1),this.emit(o.VIDEO_UNSUPPORTED,this,t)):(this.stop(!1),this.emit(o.VIDEO_ERROR,this,t))},legacyPlayHandler:function(){var t=this.video;t&&(this.playSuccess(),t.removeEventListener("playing",this._callbacks.legacy))},playingHandler:function(){this.isStalled=!1,this.emit(o.VIDEO_PLAYING,this)},loadErrorHandler:function(t){this.stop(!1),this.emit(o.VIDEO_ERROR,this,t)},metadataHandler:function(t){this.emit(o.VIDEO_METADATA,this,t)},setSizeToFrame:function(t){t||(t=this.frame),this.width=t.realWidth,this.height=t.realHeight,1!==this.scaleX&&(this.scaleX=this.displayWidth/this.width),1!==this.scaleY&&(this.scaleY=this.displayHeight/this.height);var e=this.input;return e&&!e.customHitArea&&(e.hitArea.width=this.width,e.hitArea.height=this.height),this},stalledHandler:function(t){this.isStalled=!0,this.emit(o.VIDEO_STALLED,this,t)},completeHandler:function(){this._playCalled=!1,this.emit(o.VIDEO_COMPLETE,this)},preUpdate:function(t,e){this.video&&this._playCalled&&this.touchLocked&&this.playWhenUnlocked&&(this.retry+=e,this.retry>=this.retryInterval&&(this.createPlayPromise(!1),this.retry=0))},seekTo:function(t){var e=this.video;if(e){var i=e.duration;if(i!==1/0&&!isNaN(i)){var s=i*t;this.setCurrentTime(s)}}return this},getCurrentTime:function(){return this.video?this.video.currentTime:0},setCurrentTime:function(t){var e=this.video;if(e){if("string"==typeof t){var i=t[0],s=parseFloat(t.substr(1));"+"===i?t=e.currentTime+s:"-"===i&&(t=e.currentTime-s)}e.currentTime=t}return this},seekingHandler:function(){this.isSeeking=!0,this.emit(o.VIDEO_SEEKING,this)},seekedHandler:function(){this.isSeeking=!1,this.emit(o.VIDEO_SEEKED,this)},getProgress:function(){var t=this.video;if(t){var e=t.duration;if(e!==1/0&&!isNaN(e))return t.currentTime/e}return-1},getDuration:function(){return this.video?this.video.duration:0},setMute:function(t){void 0===t&&(t=!0),this._codeMuted=t;var e=this.video;return e&&(e.muted=!!this._systemMuted||t),this},isMuted:function(){return this._codeMuted},globalMute:function(t,e){this._systemMuted=e;var i=this.video;i&&(i.muted=!!this._codeMuted||e)},globalPause:function(){this._systemPaused=!0,this.video&&!this.video.ended&&(this.removeEventHandlers(),this.video.pause())},globalResume:function(){this._systemPaused=!1,!this.video||this._codePaused||this.video.ended||this.createPlayPromise()},setPaused:function(t){void 0===t&&(t=!0);var e=this.video;return this._codePaused=t,e&&!e.ended&&(t?e.paused||(this.removeEventHandlers(),e.pause()):t||(this._playCalled?e.paused&&!this._systemPaused&&this.createPlayPromise():this.play())),this},pause:function(){return this.setPaused(!0)},resume:function(){return this.setPaused(!1)},getVolume:function(){return this.video?this.video.volume:1},setVolume:function(t){return void 0===t&&(t=1),this.video&&(this.video.volume=s(t,0,1)),this},getPlaybackRate:function(){return this.video?this.video.playbackRate:1},setPlaybackRate:function(t){return this.video&&(this.video.playbackRate=t),this},getLoop:function(){return!!this.video&&this.video.loop},setLoop:function(t){return void 0===t&&(t=!0),this.video&&(this.video.loop=t),this},isPlaying:function(){return!!this.video&&!(this.video.paused||this.video.ended)},isPaused:function(){return this.video&&this._playCalled&&this.video.paused||this._codePaused||this._systemPaused},saveTexture:function(t,e){return void 0===e&&(e=!0),this.videoTexture&&(this.scene.sys.textures.renameTexture(this._key,t),this.videoTextureSource.setFlipY(e)),this._key=t,this.glFlipY=e,!!this.videoTexture},stop:function(t){void 0===t&&(t=!0);var e=this.video;return e&&(this.removeEventHandlers(),e.cancelVideoFrameCallback(this._rfvCallbackId),e.pause()),this.retry=0,this._playCalled=!1,t&&this.emit(o.VIDEO_STOP,this),this},removeVideoElement:function(){var t=this.video;if(t){for(t.parentNode&&t.parentNode.removeChild(t);t.hasChildNodes();)t.removeChild(t.firstChild);t.removeAttribute("autoplay"),t.removeAttribute("src"),this.video=null}},preDestroy:function(){this.stop(!1),this.removeLoadEventHandlers(),this.removeVideoElement();var t=this.scene.sys.game.events;t.off(h.PAUSE,this.globalPause,this),t.off(h.RESUME,this.globalResume,this);var e=this.scene.sys.sound;e&&e.off(d.GLOBAL_MUTE,this.globalMute,this)}});t.exports=p},58352(t){t.exports=function(t,e,i,s){e.videoTexture&&(i.addToRenderList(e),t.batchSprite(e,e.frame,i,s))}},11511(t,e,i){var s=i(25305),r=i(44603),n=i(23568),a=i(18471);r.register("video",function(t,e){void 0===t&&(t={});var i=n(t,"key",null),r=new a(this.scene,0,0,i);return void 0!==e&&(t.add=e),s(this.scene,r,t),r})},89025(t,e,i){var s=i(18471);i(39429).register("video",function(t,e,i){return this.displayList.add(new s(this.scene,t,e,i))})},10247(t,e,i){var s=i(29747),r=s,n=s;r=i(29849),n=i(58352),t.exports={renderWebGL:r,renderCanvas:n}},29849(t){t.exports=function(t,e,i,s){if(e.videoTexture){i.camera.addToRenderList(e);var r=e.customRenderNodes,n=e.defaultRenderNodes;(r.Submitter||n.Submitter).run(i,e,s,0,r.Texturer||n.Texturer,r.Transformer||n.Transformer)}}},41481(t,e,i){t.exports=i(58715).default},95261(t,e,i){var s=i(44603),r=i(23568),n=i(41481);s.register("zone",function(t){var e=r(t,"x",0),i=r(t,"y",0),s=r(t,"width",1),a=r(t,"height",s);return new n(this.scene,e,i,s,a)})},84175(t,e,i){var s=i(41481);i(39429).register("zone",function(t,e,i,r){return this.displayList.add(new s(this.scene,t,e,i,r))})},95166(t){t.exports=function(t){return t.radius>0?Math.PI*t.radius*t.radius:0}},96503(t,e,i){var s=i(83419),r=i(87902),n=i(26241),a=i(79124),o=i(23777),h=i(28176),l=new s({initialize:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this.type=o.CIRCLE,this.x=t,this.y=e,this._radius=i,this._diameter=2*i},contains:function(t,e){return r(this,t,e)},getPoint:function(t,e){return n(this,t,e)},getPoints:function(t,e,i){return a(this,t,e,i)},getRandomPoint:function(t){return h(this,t)},setTo:function(t,e,i){return this.x=t,this.y=e,this._radius=i,this._diameter=2*i,this},setEmpty:function(){return this._radius=0,this._diameter=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},isEmpty:function(){return this._radius<=0},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this._diameter=2*t}},diameter:{get:function(){return this._diameter},set:function(t){this._diameter=t,this._radius=.5*t}},left:{get:function(){return this.x-this._radius},set:function(t){this.x=t+this._radius}},right:{get:function(){return this.x+this._radius},set:function(t){this.x=t-this._radius}},top:{get:function(){return this.y-this._radius},set:function(t){this.y=t+this._radius}},bottom:{get:function(){return this.y+this._radius},set:function(t){this.y=t-this._radius}}});t.exports=l},71562(t){t.exports=function(t){return Math.PI*t.radius*2}},92110(t,e,i){var s=i(26099);t.exports=function(t,e,i){return void 0===i&&(i=new s),i.x=t.x+t.radius*Math.cos(e),i.y=t.y+t.radius*Math.sin(e),i}},42250(t,e,i){var s=i(96503);t.exports=function(t){return new s(t.x,t.y,t.radius)}},87902(t){t.exports=function(t,e,i){return t.radius>0&&e>=t.left&&e<=t.right&&i>=t.top&&i<=t.bottom&&(t.x-e)*(t.x-e)+(t.y-i)*(t.y-i)<=t.radius*t.radius}},5698(t,e,i){var s=i(87902);t.exports=function(t,e){return s(t,e.x,e.y)}},70588(t,e,i){var s=i(87902);t.exports=function(t,e){return s(t,e.x,e.y)&&s(t,e.right,e.y)&&s(t,e.x,e.bottom)&&s(t,e.right,e.bottom)}},26394(t){t.exports=function(t,e){return e.setTo(t.x,t.y,t.radius)}},76278(t){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.radius===e.radius}},2074(t,e,i){var s=i(87841);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.left,e.y=t.top,e.width=t.diameter,e.height=t.diameter,e}},26241(t,e,i){var s=i(92110),r=i(62945),n=i(36383),a=i(26099);t.exports=function(t,e,i){void 0===i&&(i=new a);var o=r(e,0,n.TAU);return s(t,o,i)}},79124(t,e,i){var s=i(71562),r=i(92110),n=i(62945),a=i(36383);t.exports=function(t,e,i,o){void 0===o&&(o=[]),!e&&i>0&&(e=s(t)/i);for(var h=0;h1?2-r:r,a=n*Math.cos(i),o=n*Math.sin(i);return e.x=t.x+a*t.radius,e.y=t.y+o*t.radius,e}},88911(t,e,i){var s=i(96503);s.Area=i(95166),s.Circumference=i(71562),s.CircumferencePoint=i(92110),s.Clone=i(42250),s.Contains=i(87902),s.ContainsPoint=i(5698),s.ContainsRect=i(70588),s.CopyFrom=i(26394),s.Equals=i(76278),s.GetBounds=i(2074),s.GetPoint=i(26241),s.GetPoints=i(79124),s.Offset=i(50884),s.OffsetPoint=i(39212),s.Random=i(28176),t.exports=s},23777(t){t.exports={CIRCLE:0,ELLIPSE:1,LINE:2,POINT:3,POLYGON:4,RECTANGLE:5,TRIANGLE:6}},78874(t){t.exports=function(t){return t.isEmpty()?0:t.getMajorRadius()*t.getMinorRadius()*Math.PI}},92990(t){t.exports=function(t){var e=t.width/2,i=t.height/2,s=Math.pow(e-i,2)/Math.pow(e+i,2);return Math.PI*(e+i)*(1+3*s/(10+Math.sqrt(4-3*s)))}},79522(t,e,i){var s=i(26099);t.exports=function(t,e,i){void 0===i&&(i=new s);var r=t.width/2,n=t.height/2;return i.x=t.x+r*Math.cos(e),i.y=t.y+n*Math.sin(e),i}},58102(t,e,i){var s=i(8497);t.exports=function(t){return new s(t.x,t.y,t.width,t.height)}},81154(t){t.exports=function(t,e,i){if(t.width<=0||t.height<=0)return!1;var s=(e-t.x)/t.width,r=(i-t.y)/t.height;return(s*=s)+(r*=r)<.25}},46662(t,e,i){var s=i(81154);t.exports=function(t,e){return s(t,e.x,e.y)}},1632(t,e,i){var s=i(81154);t.exports=function(t,e){return s(t,e.x,e.y)&&s(t,e.right,e.y)&&s(t,e.x,e.bottom)&&s(t,e.right,e.bottom)}},65534(t){t.exports=function(t,e){return e.setTo(t.x,t.y,t.width,t.height)}},8497(t,e,i){var s=i(83419),r=i(81154),n=i(90549),a=i(48320),o=i(23777),h=i(24820),l=new s({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.type=o.ELLIPSE,this.x=t,this.y=e,this.width=i,this.height=s},contains:function(t,e){return r(this,t,e)},getPoint:function(t,e){return n(this,t,e)},getPoints:function(t,e,i){return a(this,t,e,i)},getRandomPoint:function(t){return h(this,t)},setTo:function(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this},setEmpty:function(){return this.width=0,this.height=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getMinorRadius:function(){return Math.min(this.width,this.height)/2},getMajorRadius:function(){return Math.max(this.width,this.height)/2},left:{get:function(){return this.x-this.width/2},set:function(t){this.x=t+this.width/2}},right:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},top:{get:function(){return this.y-this.height/2},set:function(t){this.y=t+this.height/2}},bottom:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=l},36146(t){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}},23694(t,e,i){var s=i(87841);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.left,e.y=t.top,e.width=t.width,e.height=t.height,e}},90549(t,e,i){var s=i(79522),r=i(62945),n=i(36383),a=i(26099);t.exports=function(t,e,i){void 0===i&&(i=new a);var o=r(e,0,n.TAU);return s(t,o,i)}},48320(t,e,i){var s=i(92990),r=i(79522),n=i(62945),a=i(36383);t.exports=function(t,e,i,o){void 0===o&&(o=[]),!e&&i>0&&(e=s(t)/i);for(var h=0;ha||n>o)return!1;if(r<=i||n<=s)return!0;var h=r-i,l=n-s;return h*h+l*l<=t.radius*t.radius}},63376(t,e,i){var s=i(26099),r=i(2044);t.exports=function(t,e,i){if(void 0===i&&(i=[]),r(t,e)){var n,a,o,h,l=t.x,u=t.y,d=t.radius,c=e.x,f=e.y,p=e.radius;if(u===f)0===(o=(a=-2*f)*a-4*(n=1)*(c*c+(h=(p*p-d*d-c*c+l*l)/(2*(l-c)))*h-2*c*h+f*f-p*p))?i.push(new s(h,-a/(2*n))):o>0&&(i.push(new s(h,(-a+Math.sqrt(o))/(2*n))),i.push(new s(h,(-a-Math.sqrt(o))/(2*n))));else{var g=(l-c)/(u-f),m=(p*p-d*d-c*c+l*l-f*f+u*u)/(2*(u-f));0===(o=(a=2*u*g-2*m*g-2*l)*a-4*(n=g*g+1)*(l*l+u*u+m*m-d*d-2*u*m))?(h=-a/(2*n),i.push(new s(h,m-h*g))):o>0&&(h=(-a+Math.sqrt(o))/(2*n),i.push(new s(h,m-h*g)),h=(-a-Math.sqrt(o))/(2*n),i.push(new s(h,m-h*g)))}}return i}},97439(t,e,i){var s=i(4042),r=i(81491);t.exports=function(t,e,i){if(void 0===i&&(i=[]),r(t,e)){var n=e.getLineA(),a=e.getLineB(),o=e.getLineC(),h=e.getLineD();s(n,t,i),s(a,t,i),s(o,t,i),s(h,t,i)}return i}},4042(t,e,i){var s=i(26099),r=i(80462);t.exports=function(t,e,i){if(void 0===i&&(i=[]),r(t,e)){var n,a,o=t.x1,h=t.y1,l=t.x2,u=t.y2,d=e.x,c=e.y,f=e.radius,p=l-o,g=u-h,m=o-d,v=h-c,y=p*p+g*g,x=2*(p*m+g*v),T=x*x-4*y*(m*m+v*v-f*f);if(0===T){var w=-x/(2*y);n=o+w*p,a=h+w*g,w>=0&&w<=1&&i.push(new s(n,a))}else if(T>0){var b=(-x-Math.sqrt(T))/(2*y);n=o+b*p,a=h+b*g,b>=0&&b<=1&&i.push(new s(n,a));var S=(-x+Math.sqrt(T))/(2*y);n=o+S*p,a=h+S*g,S>=0&&S<=1&&i.push(new s(n,a))}}return i}},36100(t,e,i){var s=i(25836);t.exports=function(t,e,i,r){void 0===i&&(i=!1);var n,a,o,h=t.x1,l=t.y1,u=t.x2,d=t.y2,c=e.x1,f=e.y1,p=u-h,g=d-l,m=e.x2-c,v=e.y2-f,y=p*v-g*m;if(0===y)return null;if(i){if(n=(p*(f-l)+g*(h-c))/(m*g-v*p),0!==p)a=(c+m*n-h)/p;else{if(0===g)return null;a=(f+v*n-l)/g}if(a<0||n<0||n>1)return null;o=a}else{if(a=((l-f)*p-(h-c)*g)/y,(n=((c-h)*v-(f-l)*m)/y)<0||n>1||a<0||a>1)return null;o=n}return void 0===r&&(r=new s),r.set(h+p*o,l+g*o,o)}},3073(t,e,i){var s=i(36100),r=i(23031),n=i(25836),a=new r,o=new n;t.exports=function(t,e,i,r){void 0===i&&(i=!1),void 0===r&&(r=new n);var h=!1;r.set(),o.set();for(var l=e[e.length-1],u=0;u0){var c=(o*n+h*a)/l;u*=c,d*=c}return i.x=t.x1+u,i.y=t.y1+d,u*u+d*d<=l&&u*n+d*a>=0&&s(e,i.x,i.y)}},76112(t){t.exports=function(t,e,i){var s=t.x1,r=t.y1,n=t.x2,a=t.y2,o=e.x1,h=e.y1,l=e.x2,u=e.y2;if(s===n&&r===a||o===l&&h===u)return!1;var d=(u-h)*(n-s)-(l-o)*(a-r);if(0===d)return!1;var c=((l-o)*(r-h)-(u-h)*(s-o))/d,f=((n-s)*(r-h)-(a-r)*(s-o))/d;return!(c<0||c>1||f<0||f>1)&&(i&&(i.x=s+c*(n-s),i.y=r+c*(a-r)),!0)}},92773(t){t.exports=function(t,e){var i=t.x1,s=t.y1,r=t.x2,n=t.y2,a=e.x,o=e.y,h=e.right,l=e.bottom,u=0;if(i>=a&&i<=h&&s>=o&&s<=l||r>=a&&r<=h&&n>=o&&n<=l)return!0;if(i=a){if((u=s+(n-s)*(a-i)/(r-i))>o&&u<=l)return!0}else if(i>h&&r<=h&&(u=s+(n-s)*(h-i)/(r-i))>=o&&u<=l)return!0;if(s=o){if((u=i+(r-i)*(o-s)/(n-s))>=a&&u<=h)return!0}else if(s>l&&n<=l&&(u=i+(r-i)*(l-s)/(n-s))>=a&&u<=h)return!0;return!1}},16204(t){t.exports=function(t,e,i){void 0===i&&(i=1);var s=e.x1,r=e.y1,n=e.x2,a=e.y2,o=t.x,h=t.y,l=(n-s)*(n-s)+(a-r)*(a-r);if(0===l)return!1;var u=((o-s)*(n-s)+(h-r)*(a-r))/l;if(u<0)return Math.sqrt((s-o)*(s-o)+(r-h)*(r-h))<=i;if(u>=0&&u<=1){var d=((r-h)*(n-s)-(s-o)*(a-r))/l;return Math.abs(d)*Math.sqrt(l)<=i}return Math.sqrt((n-o)*(n-o)+(a-h)*(a-h))<=i}},14199(t,e,i){var s=i(16204);t.exports=function(t,e){if(!s(t,e))return!1;var i=Math.min(e.x1,e.x2),r=Math.max(e.x1,e.x2),n=Math.min(e.y1,e.y2),a=Math.max(e.y1,e.y2);return t.x>=i&&t.x<=r&&t.y>=n&&t.y<=a}},59996(t){t.exports=function(t,e){return!(t.width<=0||t.height<=0||e.width<=0||e.height<=0)&&!(t.righte.right||t.y>e.bottom)}},89265(t,e,i){var s=i(76112),r=i(37303),n=i(48653),a=i(77493);t.exports=function(t,e){if(e.left>t.right||e.rightt.bottom||e.bottom0}},84411(t){t.exports=function(t,e,i,s,r,n){return void 0===n&&(n=0),!(e>t.right+n||it.bottom+n||re.right||t.righte.bottom||t.bottome.right||t.righte.bottom||t.bottom0||(d=r(e),(c=s(t,d,!0)).length>0)}},91865(t,e,i){t.exports={CircleToCircle:i(2044),CircleToRectangle:i(81491),GetCircleToCircle:i(63376),GetCircleToRectangle:i(97439),GetLineToCircle:i(4042),GetLineToLine:i(36100),GetLineToPoints:i(3073),GetLineToPolygon:i(56362),GetLineToRectangle:i(60646),GetRaysFromPointToPolygon:i(71147),GetRectangleIntersection:i(68389),GetRectangleToRectangle:i(52784),GetRectangleToTriangle:i(26341),GetTriangleToCircle:i(38720),GetTriangleToLine:i(13882),GetTriangleToTriangle:i(75636),LineToCircle:i(80462),LineToLine:i(76112),LineToRectangle:i(92773),PointToLine:i(16204),PointToLineSegment:i(14199),RectangleToRectangle:i(59996),RectangleToTriangle:i(89265),RectangleToValues:i(84411),TriangleToCircle:i(67636),TriangleToLine:i(2822),TriangleToTriangle:i(82944)}},91938(t){t.exports=function(t){return Math.atan2(t.y2-t.y1,t.x2-t.x1)}},84993(t){t.exports=function(t,e,i){void 0===e&&(e=1),void 0===i&&(i=[]);var s=Math.round(t.x1),r=Math.round(t.y1),n=Math.round(t.x2),a=Math.round(t.y2),o=Math.abs(n-s),h=Math.abs(a-r),l=s-h&&(d-=h,s+=l),f0){var v=u[0],y=[v];for(h=1;h=a&&(y.push(x),v=x)}var T=u[u.length-1];return s(v,T)0&&(e=s(t)/i);for(var a=t.x1,o=t.y1,h=t.x2,l=t.y2,u=0;uthis.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=l},64795(t,e,i){var s=i(36383),r=i(15994),n=i(91938);t.exports=function(t){var e=n(t)-s.PI_OVER_2;return r(e,-Math.PI,Math.PI)}},52616(t,e,i){var s=i(36383),r=i(91938);t.exports=function(t){return Math.cos(r(t)-s.PI_OVER_2)}},87231(t,e,i){var s=i(36383),r=i(91938);t.exports=function(t){return Math.sin(r(t)-s.PI_OVER_2)}},89662(t){t.exports=function(t,e,i){return t.x1+=e,t.y1+=i,t.x2+=e,t.y2+=i,t}},71165(t){t.exports=function(t){return-(t.x2-t.x1)/(t.y2-t.y1)}},65822(t,e,i){var s=i(26099);t.exports=function(t,e){void 0===e&&(e=new s);var i=Math.random();return e.x=t.x1+i*(t.x2-t.x1),e.y=t.y1+i*(t.y2-t.y1),e}},69777(t,e,i){var s=i(91938),r=i(64795);t.exports=function(t,e){return 2*r(e)-Math.PI-s(t)}},39706(t,e,i){var s=i(64400);t.exports=function(t,e){var i=(t.x1+t.x2)/2,r=(t.y1+t.y2)/2;return s(t,i,r,e)}},82585(t,e,i){var s=i(64400);t.exports=function(t,e,i){return s(t,e.x,e.y,i)}},64400(t){t.exports=function(t,e,i,s){var r=Math.cos(s),n=Math.sin(s),a=t.x1-e,o=t.y1-i;return t.x1=a*r-o*n+e,t.y1=a*n+o*r+i,a=t.x2-e,o=t.y2-i,t.x2=a*r-o*n+e,t.y2=a*n+o*r+i,t}},62377(t){t.exports=function(t,e,i,s,r){return t.x1=e,t.y1=i,t.x2=e+Math.cos(s)*r,t.y2=i+Math.sin(s)*r,t}},71366(t){t.exports=function(t){return(t.y2-t.y1)/(t.x2-t.x1)}},10809(t){t.exports=function(t){return Math.abs(t.x1-t.x2)}},2529(t,e,i){var s=i(23031);s.Angle=i(91938),s.BresenhamPoints=i(84993),s.CenterOn=i(36469),s.Clone=i(31116),s.CopyFrom=i(59944),s.Equals=i(59220),s.Extend=i(78177),s.GetEasedPoints=i(26708),s.GetMidPoint=i(32125),s.GetNearestPoint=i(99569),s.GetNormal=i(34638),s.GetPoint=i(13151),s.GetPoints=i(15258),s.GetShortestDistance=i(26408),s.Height=i(98770),s.Length=i(35001),s.NormalAngle=i(64795),s.NormalX=i(52616),s.NormalY=i(87231),s.Offset=i(89662),s.PerpSlope=i(71165),s.Random=i(65822),s.ReflectAngle=i(69777),s.Rotate=i(39706),s.RotateAroundPoint=i(82585),s.RotateAroundXY=i(64400),s.SetToAngle=i(62377),s.Slope=i(71366),s.Width=i(10809),t.exports=s},12306(t,e,i){var s=i(25717);t.exports=function(t){return new s(t.points)}},63814(t){t.exports=function(t,e,i){for(var s=!1,r=-1,n=t.points.length-1;++r80*s){n=o=t[0],a=h=t[1];for(var x=s;xo&&(o=d),c>h&&(h=c);p=0!==(p=Math.max(o-n,h-a))?32767/p:0}return r(v,y,s,n,a,p,0),y}function i(t,e,i,s,r){var n,a;if(r===A(t,e,i,s)>0)for(n=e;n=e;n-=s)a=S(n,t[n],t[n+1],a);return a&&v(a,a.next)&&(C(a),a=a.next),a}function s(t,e){if(!t)return t;e||(e=t);var i,s=t;do{if(i=!1,s.steiner||!v(s,s.next)&&0!==m(s.prev,s,s.next))s=s.next;else{if(C(s),(s=e=s.prev)===s.next)break;i=!0}}while(i||s!==e);return e}function r(t,e,i,l,u,d,f){if(t){!f&&d&&function(t,e,i,s){var r=t;do{0===r.z&&(r.z=c(r.x,r.y,e,i,s)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){var e,i,s,r,n,a,o,h,l=1;do{for(i=t,t=null,n=null,a=0;i;){for(a++,s=i,o=0,e=0;e0||h>0&&s;)0!==o&&(0===h||!s||i.z<=s.z)?(r=i,i=i.nextZ,o--):(r=s,s=s.nextZ,h--),n?n.nextZ=r:t=r,r.prevZ=n,n=r;i=s}n.nextZ=null,l*=2}while(a>1)}(r)}(t,l,u,d);for(var p,g,m=t;t.prev!==t.next;)if(p=t.prev,g=t.next,d?a(t,l,u,d):n(t))e.push(p.i/i|0),e.push(t.i/i|0),e.push(g.i/i|0),C(t),t=g.next,m=g.next;else if((t=g)===m){f?1===f?r(t=o(s(t),e,i),e,i,l,u,d,2):2===f&&h(t,e,i,l,u,d):r(s(t),e,i,l,u,d,1);break}}}function n(t){var e=t.prev,i=t,s=t.next;if(m(e,i,s)>=0)return!1;for(var r=e.x,n=i.x,a=s.x,o=e.y,h=i.y,l=s.y,u=rn?r>a?r:a:n>a?n:a,f=o>h?o>l?o:l:h>l?h:l,g=s.next;g!==e;){if(g.x>=u&&g.x<=c&&g.y>=d&&g.y<=f&&p(r,o,n,h,a,l,g.x,g.y)&&m(g.prev,g,g.next)>=0)return!1;g=g.next}return!0}function a(t,e,i,s){var r=t.prev,n=t,a=t.next;if(m(r,n,a)>=0)return!1;for(var o=r.x,h=n.x,l=a.x,u=r.y,d=n.y,f=a.y,g=oh?o>l?o:l:h>l?h:l,x=u>d?u>f?u:f:d>f?d:f,T=c(g,v,e,i,s),w=c(y,x,e,i,s),b=t.prevZ,S=t.nextZ;b&&b.z>=T&&S&&S.z<=w;){if(b.x>=g&&b.x<=y&&b.y>=v&&b.y<=x&&b!==r&&b!==a&&p(o,u,h,d,l,f,b.x,b.y)&&m(b.prev,b,b.next)>=0)return!1;if(b=b.prevZ,S.x>=g&&S.x<=y&&S.y>=v&&S.y<=x&&S!==r&&S!==a&&p(o,u,h,d,l,f,S.x,S.y)&&m(S.prev,S,S.next)>=0)return!1;S=S.nextZ}for(;b&&b.z>=T;){if(b.x>=g&&b.x<=y&&b.y>=v&&b.y<=x&&b!==r&&b!==a&&p(o,u,h,d,l,f,b.x,b.y)&&m(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;S&&S.z<=w;){if(S.x>=g&&S.x<=y&&S.y>=v&&S.y<=x&&S!==r&&S!==a&&p(o,u,h,d,l,f,S.x,S.y)&&m(S.prev,S,S.next)>=0)return!1;S=S.nextZ}return!0}function o(t,e,i){var r=t;do{var n=r.prev,a=r.next.next;!v(n,a)&&y(n,r,r.next,a)&&w(n,a)&&w(a,n)&&(e.push(n.i/i|0),e.push(r.i/i|0),e.push(a.i/i|0),C(r),C(r.next),r=t=a),r=r.next}while(r!==t);return s(r)}function h(t,e,i,n,a,o){var h=t;do{for(var l=h.next.next;l!==h.prev;){if(h.i!==l.i&&g(h,l)){var u=b(h,l);return h=s(h,h.next),u=s(u,u.next),r(h,e,i,n,a,o,0),void r(u,e,i,n,a,o,0)}l=l.next}h=h.next}while(h!==t)}function l(t,e){return t.x-e.x}function u(t,e){var i=function(t,e){var i,s=e,r=t.x,n=t.y,a=-1/0;do{if(n<=s.y&&n>=s.next.y&&s.next.y!==s.y){var o=s.x+(n-s.y)*(s.next.x-s.x)/(s.next.y-s.y);if(o<=r&&o>a&&(a=o,i=s.x=s.x&&s.x>=u&&r!==s.x&&p(ni.x||s.x===i.x&&d(i,s)))&&(i=s,f=h)),s=s.next}while(s!==l);return i}(t,e);if(!i)return e;var r=b(i,t);return s(r,r.next),s(i,i.next)}function d(t,e){return m(t.prev,t,e.prev)<0&&m(e.next,t,t.next)<0}function c(t,e,i,s,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-s)*r|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function f(t){var e=t,i=t;do{(e.x=(t-a)*(n-o)&&(t-a)*(s-o)>=(i-a)*(e-o)&&(i-a)*(n-o)>=(r-a)*(s-o)}function g(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&y(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(w(t,e)&&w(e,t)&&function(t,e){var i=t,s=!1,r=(t.x+e.x)/2,n=(t.y+e.y)/2;do{i.y>n!=i.next.y>n&&i.next.y!==i.y&&r<(i.next.x-i.x)*(n-i.y)/(i.next.y-i.y)+i.x&&(s=!s),i=i.next}while(i!==t);return s}(t,e)&&(m(t.prev,t,e.prev)||m(t,e.prev,e))||v(t,e)&&m(t.prev,t,t.next)>0&&m(e.prev,e,e.next)>0)}function m(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function v(t,e){return t.x===e.x&&t.y===e.y}function y(t,e,i,s){var r=T(m(t,e,i)),n=T(m(t,e,s)),a=T(m(i,s,t)),o=T(m(i,s,e));return r!==n&&a!==o||(!(0!==r||!x(t,i,e))||(!(0!==n||!x(t,s,e))||(!(0!==a||!x(i,t,s))||!(0!==o||!x(i,e,s)))))}function x(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function T(t){return t>0?1:t<0?-1:0}function w(t,e){return m(t.prev,t,t.next)<0?m(t,e,t.next)>=0&&m(t,t.prev,e)>=0:m(t,e,t.prev)<0||m(t,t.next,e)<0}function b(t,e){var i=new E(t.i,t.x,t.y),s=new E(e.i,e.x,e.y),r=t.next,n=e.prev;return t.next=e,e.prev=t,i.next=r,r.prev=i,s.next=i,i.prev=s,n.next=s,s.prev=n,s}function S(t,e,i,s){var r=new E(t,e,i);return s?(r.next=s.next,r.prev=s,s.next.prev=r,s.next=r):(r.prev=r,r.next=r),r}function C(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function E(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function A(t,e,i,s){for(var r=0,n=e,a=i-s;n0&&(s+=t[r-1].length,i.holes.push(s))}return i},t.exports=e},13829(t,e,i){var s=i(87841);t.exports=function(t,e){void 0===e&&(e=new s);for(var i,r=1/0,n=1/0,a=-r,o=-n,h=0;h0&&(e=h/i);for(var l=0;ld+m)){var v=g.getPoint((u-d)/m);a.push(v);break}d+=m}return a}},30052(t,e,i){var s=i(35001),r=i(23031);t.exports=function(t){for(var e=t.points,i=0,n=0;n1?(s=i.x,r=i.y):o>0&&(s+=n*o,r+=a*o)}return(n=t.x-s)*n+(a=t.y-r)*a}function s(t,e,r,n,a){for(var o,h=n,l=e+1;lh&&(o=l,h=u)}h>n&&(o-e>1&&s(t,e,o,n,a),a.push(t[o]),r-o>1&&s(t,o,r,n,a))}function r(t,e){var i=t.length-1,r=[t[0]];return s(t,0,i,e,r),r.push(t[i]),r}t.exports=function(t,i,s){void 0===i&&(i=1),void 0===s&&(s=!1);var n=t.points;if(n.length>2){var a=i*i;s||(n=function(t,i){for(var s,r=t[0],n=[r],a=1,o=t.length;ai&&(n.push(s),r=s);return r!==s&&n.push(s),n}(n,a)),t.setTo(r(n,a))}return t}},5469(t){var e=function(t,e){return t[0]=e[0],t[1]=e[1],t};t.exports=function(t){var i,s=[],r=t.points;for(i=0;i0&&n.push(e([0,0],s[0])),i=0;i1&&n.push(e([0,0],s[s.length-1])),t.setTo(n)}},24709(t){t.exports=function(t,e,i){for(var s=t.points,r=0;rt.width*t.height)&&(e.x>t.x&&e.xt.x&&e.rightt.y&&e.yt.y&&e.bottoms(e)?t.setSize(e.height*i,e.height):t.setSize(e.width,e.width/i),t.setPosition(e.centerX-t.width/2,e.centerY-t.height/2)}},80774(t){t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t}},83859(t){t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t.width=Math.floor(t.width),t.height=Math.floor(t.height),t}},19217(t,e,i){var s=i(87841),r=i(36383);t.exports=function(t,e){if(void 0===e&&(e=new s),0===t.length)return e;for(var i,n,a,o=Number.MAX_VALUE,h=Number.MAX_VALUE,l=r.MIN_SAFE_INTEGER,u=r.MIN_SAFE_INTEGER,d=0;d=1)return i.x=t.x,i.y=t.y,i;var n=s(t)*e;return e>.5?(n-=t.width+t.height)<=t.width?(i.x=t.right-n,i.y=t.bottom):(i.x=t.x,i.y=t.bottom-(n-t.width)):n<=t.width?(i.x=t.x+n,i.y=t.y):(i.x=t.right,i.y=t.y+(n-t.width)),i}},34819(t,e,i){var s=i(20812),r=i(13019);t.exports=function(t,e,i,n){void 0===n&&(n=[]),!e&&i>0&&(e=r(t)/i);for(var a=0;a=t.right&&(h=1,o+=a-t.right,a=t.right);break;case 1:(o+=e)>=t.bottom&&(h=2,a-=o-t.bottom,o=t.bottom);break;case 2:(a-=e)<=t.left&&(h=3,o-=t.left-a,a=t.left);break;case 3:(o-=e)<=t.top&&(h=0,o=t.top)}return n}},33595(t){t.exports=function(t,e){for(var i=t.x,s=t.right,r=t.y,n=t.bottom,a=0;ae.x&&t.ye.y}},13019(t){t.exports=function(t){return 2*(t.width+t.height)}},85133(t,e,i){var s=i(26099),r=i(39506);t.exports=function(t,e,i){void 0===i&&(i=new s),e=r(e);var n=Math.sin(e),a=Math.cos(e),o=a>0?t.width/2:t.width/-2,h=n>0?t.height/2:t.height/-2;return Math.abs(o*n)=0&&v>=0&&m+v<1}},48653(t){t.exports=function(t,e,i,s){void 0===i&&(i=!1),void 0===s&&(s=[]);for(var r,n,a,o,h,l,u=t.x3-t.x1,d=t.y3-t.y1,c=t.x2-t.x1,f=t.y2-t.y1,p=u*u+d*d,g=u*c+d*f,m=c*c+f*f,v=p*m-g*g,y=0===v?0:1/v,x=t.x1,T=t.y1,w=0;w=0&&n>=0&&r+n<1&&(s.push({x:e[w].x,y:e[w].y}),i)));w++);return s}},96006(t,e,i){var s=i(10690);t.exports=function(t,e){return s(t,e.x,e.y)}},71326(t){t.exports=function(t,e){return e.setTo(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)}},71694(t){t.exports=function(t,e){return void 0===e&&(e=[]),e.push({x:t.x1,y:t.y1}),e.push({x:t.x2,y:t.y2}),e.push({x:t.x3,y:t.y3}),e}},33522(t){t.exports=function(t,e){return t.x1===e.x1&&t.y1===e.y1&&t.x2===e.x2&&t.y2===e.y2&&t.x3===e.x3&&t.y3===e.y3}},20437(t,e,i){var s=i(26099),r=i(35001);t.exports=function(t,e,i){void 0===i&&(i=new s);var n=t.getLineA(),a=t.getLineB(),o=t.getLineC();if(e<=0||e>=1)return i.x=n.x1,i.y=n.y1,i;var h=r(n),l=r(a),u=r(o),d=(h+l+u)*e,c=0;return dh+l?(c=(d-=h+l)/u,i.x=o.x1+(o.x2-o.x1)*c,i.y=o.y1+(o.y2-o.y1)*c):(c=(d-=h)/l,i.x=a.x1+(a.x2-a.x1)*c,i.y=a.y1+(a.y2-a.y1)*c),i}},80672(t,e,i){var s=i(35001),r=i(26099);t.exports=function(t,e,i,n){void 0===n&&(n=[]);var a=t.getLineA(),o=t.getLineB(),h=t.getLineC(),l=s(a),u=s(o),d=s(h),c=l+u+d;!e&&i>0&&(e=c/i);for(var f=0;fl+u?(g=(p-=l+u)/d,m.x=h.x1+(h.x2-h.x1)*g,m.y=h.y1+(h.y2-h.y1)*g):(g=(p-=l)/u,m.x=o.x1+(o.x2-o.x1)*g,m.y=o.y1+(o.y2-o.y1)*g),n.push(m)}return n}},39757(t,e,i){var s=i(26099);function r(t,e,i,s){var r=t-i,n=e-s,a=r*r+n*n;return Math.sqrt(a)}t.exports=function(t,e){void 0===e&&(e=new s);var i=t.x1,n=t.y1,a=t.x2,o=t.y2,h=t.x3,l=t.y3,u=r(h,l,a,o),d=r(i,n,h,l),c=r(a,o,i,n),f=u+d+c;return e.x=(i*u+a*d+h*c)/f,e.y=(n*u+o*d+l*c)/f,e}},13584(t){t.exports=function(t,e,i){return t.x1+=e,t.y1+=i,t.x2+=e,t.y2+=i,t.x3+=e,t.y3+=i,t}},1376(t,e,i){var s=i(35001);t.exports=function(t){var e=t.getLineA(),i=t.getLineB(),r=t.getLineC();return s(e)+s(i)+s(r)}},90260(t,e,i){var s=i(26099);t.exports=function(t,e){void 0===e&&(e=new s);var i=t.x2-t.x1,r=t.y2-t.y1,n=t.x3-t.x1,a=t.y3-t.y1,o=Math.random(),h=Math.random();return o+h>=1&&(o=1-o,h=1-h),e.x=t.x1+(i*o+n*h),e.y=t.y1+(r*o+a*h),e}},52172(t,e,i){var s=i(99614),r=i(39757);t.exports=function(t,e){var i=r(t);return s(t,i.x,i.y,e)}},49907(t,e,i){var s=i(99614);t.exports=function(t,e,i){return s(t,e.x,e.y,i)}},99614(t){t.exports=function(t,e,i,s){var r=Math.cos(s),n=Math.sin(s),a=t.x1-e,o=t.y1-i;return t.x1=a*r-o*n+e,t.y1=a*n+o*r+i,a=t.x2-e,o=t.y2-i,t.x2=a*r-o*n+e,t.y2=a*n+o*r+i,a=t.x3-e,o=t.y3-i,t.x3=a*r-o*n+e,t.y3=a*n+o*r+i,t}},16483(t,e,i){var s=i(83419),r=i(10690),n=i(20437),a=i(80672),o=i(23777),h=i(23031),l=i(90260),u=new s({initialize:function(t,e,i,s,r,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===r&&(r=0),void 0===n&&(n=0),this.type=o.TRIANGLE,this.x1=t,this.y1=e,this.x2=i,this.y2=s,this.x3=r,this.y3=n},contains:function(t,e){return r(this,t,e)},getPoint:function(t,e){return n(this,t,e)},getPoints:function(t,e,i){return a(this,t,e,i)},getRandomPoint:function(t){return l(this,t)},setTo:function(t,e,i,s,r,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===r&&(r=0),void 0===n&&(n=0),this.x1=t,this.y1=e,this.x2=i,this.y2=s,this.x3=r,this.y3=n,this},getLineA:function(t){return void 0===t&&(t=new h),t.setTo(this.x1,this.y1,this.x2,this.y2),t},getLineB:function(t){return void 0===t&&(t=new h),t.setTo(this.x2,this.y2,this.x3,this.y3),t},getLineC:function(t){return void 0===t&&(t=new h),t.setTo(this.x3,this.y3,this.x1,this.y1),t},left:{get:function(){return Math.min(this.x1,this.x2,this.x3)},set:function(t){var e=0;e=this.x1<=this.x2&&this.x1<=this.x3?this.x1-t:this.x2<=this.x1&&this.x2<=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},right:{get:function(){return Math.max(this.x1,this.x2,this.x3)},set:function(t){var e=0;e=this.x1>=this.x2&&this.x1>=this.x3?this.x1-t:this.x2>=this.x1&&this.x2>=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},top:{get:function(){return Math.min(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1<=this.y2&&this.y1<=this.y3?this.y1-t:this.y2<=this.y1&&this.y2<=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}},bottom:{get:function(){return Math.max(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1>=this.y2&&this.y1>=this.y3?this.y1-t:this.y2>=this.y1&&this.y2>=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}}});t.exports=u},84435(t,e,i){var s=i(16483);s.Area=i(41658),s.BuildEquilateral=i(39208),s.BuildFromPolygon=i(39545),s.BuildRight=i(90301),s.CenterOn=i(23707),s.Centroid=i(97523),s.CircumCenter=i(24951),s.CircumCircle=i(85614),s.Clone=i(74422),s.Contains=i(10690),s.ContainsArray=i(48653),s.ContainsPoint=i(96006),s.CopyFrom=i(71326),s.Decompose=i(71694),s.Equals=i(33522),s.GetPoint=i(20437),s.GetPoints=i(80672),s.InCenter=i(39757),s.Perimeter=i(1376),s.Offset=i(13584),s.Random=i(90260),s.Rotate=i(52172),s.RotateAroundPoint=i(49907),s.RotateAroundXY=i(99614),t.exports=s},74457(t){t.exports=function(t,e,i){return{gameObject:t,enabled:!0,draggable:!1,dropZone:!1,cursor:!1,target:null,camera:null,hitArea:e,hitAreaCallback:i,hitAreaDebug:null,customHitArea:!1,localX:0,localY:0,dragState:0,dragStartX:0,dragStartY:0,dragStartXGlobal:0,dragStartYGlobal:0,dragStartCamera:null,dragX:0,dragY:0}}},84409(t){t.exports=function(t,e){return function(i,s,r,n){var a=t.getPixelAlpha(s,r,n.texture.key,n.frame.name);return a&&a>=e}}},7003(t,e,i){var s=i(83419),r=i(93301),n=i(50792),a=i(8214),o=i(8443),h=i(78970),l=i(85098),u=i(42515),d=i(36210),c=i(61340),f=i(85955),p=new s({initialize:function(t,e){this.game=t,this.scaleManager,this.canvas,this.config=e,this.enabled=!0,this.events=new n,this.isOver=!0,this.defaultCursor="",this.keyboard=e.inputKeyboard?new h(this):null,this.mouse=e.inputMouse?new l(this):null,this.touch=e.inputTouch?new d(this):null,this.pointers=[],this.pointersTotal=e.inputActivePointers;for(var i=0;i<=this.pointersTotal;i++){var s=new u(this,i);s.smoothFactor=e.inputSmoothFactor,this.pointers.push(s)}this.mousePointer=e.inputMouse?this.pointers[0]:null,this.activePointer=this.pointers[0],this.globalTopOnly=!0,this.time=0,this._tempPoint={x:0,y:0},this._tempHitTest=[],this._tempMatrix=new c,this._tempMatrix2=new c,this._tempSkip=!1,this.mousePointerContainer=[this.mousePointer],t.events.once(o.BOOT,this.boot,this)},boot:function(){var t=this.game,e=t.events;this.canvas=t.canvas,this.scaleManager=t.scale,this.events.emit(a.MANAGER_BOOT),e.on(o.PRE_RENDER,this.preRender,this),e.once(o.DESTROY,this.destroy,this)},setCanvasOver:function(t){this.isOver=!0,this.events.emit(a.GAME_OVER,t)},setCanvasOut:function(t){this.isOver=!1,this.events.emit(a.GAME_OUT,t)},preRender:function(){var t=this.game.loop.now,e=this.game.loop.delta,i=this.game.scene.getScenes(!0,!0);this.time=t,this.events.emit(a.MANAGER_UPDATE);for(var s=0;s10&&(t=10-this.pointersTotal);for(var i=0;i-1&&(r.splice(o,1),this.clear(a,!0))}this._pendingRemoval.length=0,this._list=r.concat(e.splice(0))}},isActive:function(){return this.manager&&this.manager.enabled&&this.enabled&&this.scene.sys.canInput()},setCursor:function(t){this.manager&&this.manager.setCursor(t)},resetCursor:function(){this.manager&&this.manager.resetCursor(null,!0)},updatePoll:function(t,e){if(!this.isActive())return!1;if(this.pluginEvents.emit(c.UPDATE,t,e),this._updatedThisFrame)return this._updatedThisFrame=!1,!1;var i,s=this.manager.pointers;for(i=0;i0){if(this._pollTimer-=e,!(this._pollTimer<0))return!1;this._pollTimer=this.pollRate}var n=!1;for(i=0;i0&&(n=!0)}return n},update:function(t,e){if(!this.isActive())return!1;for(var i=!1,s=0;s0&&(i=!0)}return this._updatedThisFrame=!0,i},clear:function(t,e){void 0===e&&(e=!1),this.disable(t);var i=t.input;i&&(this.removeDebug(t),this.manager.resetCursor(i),i.gameObject=void 0,i.target=void 0,i.hitArea=void 0,i.hitAreaCallback=void 0,i.callbackContext=void 0,t.input=null),e||this.queueForRemoval(t);var s=this._draggable.indexOf(t);return s>-1&&this._draggable.splice(s,1),t},disable:function(t,e){void 0===e&&(e=!1);var i=t.input;i&&(i.enabled=!1,i.dragState=0);for(var s,r=this._drag,n=this._over,a=this.manager,o=0;o-1&&r[o].splice(s,1),(s=n[o].indexOf(t))>-1&&n[o].splice(s,1);return e&&this.resetCursor(),this},enable:function(t,e,i,s){return void 0===s&&(s=!1),t.input?t.input.enabled=!0:this.setHitArea(t,e,i),t.input&&s&&!t.input.dropZone&&(t.input.dropZone=s),this},hitTestPointer:function(t){for(var e=this.cameras.getCamerasBelowPointer(t),i=0;i0)return t.camera=s,r}return t.camera=e[0],[]},processDownEvents:function(t){var e=0,i=this._temp,s=this._eventData,r=this._eventContainer;s.cancelled=!1;for(var n=0;n0&&l(t.x,t.y,t.downX,t.downY)>=r||s>0&&e>=t.downTime+s)&&(i=!0),i)return this.setDragState(t,3),this.processDragStartList(t)},processDragStartList:function(t){if(3!==this.getDragState(t))return 0;var e=this._drag[t.id];e.length>1&&(e=e.slice(0));for(var i=0;i1&&(this.sortGameObjects(i,t),this.topOnly&&i.splice(1)),this._drag[t.id]=i,0===this.dragDistanceThreshold&&0===this.dragTimeThreshold?(this.setDragState(t,3),this.processDragStartList(t)):(this.setDragState(t,2),0))},processDragMoveEvent:function(t){if(2===this.getDragState(t)&&this.processDragThresholdEvent(t,this.manager.game.loop.now),4!==this.getDragState(t))return 0;var e=this._tempZones,i=this._drag[t.id];i.length>1&&(i=i.slice(0));for(var s=0;s0?(a.emit(c.GAMEOBJECT_DRAG_LEAVE,t,h),this.emit(c.DRAG_LEAVE,t,a,h),o.target=e[0],h=o.target,a.emit(c.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(c.DRAG_ENTER,t,a,h)):(a.emit(c.GAMEOBJECT_DRAG_LEAVE,t,h),this.emit(c.DRAG_LEAVE,t,a,h),e[0]?(o.target=e[0],h=o.target,a.emit(c.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(c.DRAG_ENTER,t,a,h)):o.target=null)}else!h&&e[0]&&(o.target=e[0],h=o.target,a.emit(c.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(c.DRAG_ENTER,t,a,h));var u=t.positionToCamera(o.dragStartCamera);if(a.parentContainer){var d=u.x-o.dragStartXGlobal,f=u.y-o.dragStartYGlobal,p=a.getParentRotation(),g=d*Math.cos(p)+f*Math.sin(p),m=f*Math.cos(p)-d*Math.sin(p);g*=1/a.parentContainer.scaleX,m*=1/a.parentContainer.scaleY,r=g+o.dragStartX,n=m+o.dragStartY}else r=u.x-o.dragX,n=u.y-o.dragY;a.emit(c.GAMEOBJECT_DRAG,t,r,n),this.emit(c.DRAG,t,a,r,n)}return i.length},processDragUpEvent:function(t){var e=this._drag[t.id];e.length>1&&(e=e.slice(0));for(var i=0;i0){var n=this.manager,a=this._eventData,o=this._eventContainer;a.cancelled=!1;for(var h=0;h0){var r=this.manager,n=this._eventData,a=this._eventContainer;n.cancelled=!1,this.sortGameObjects(e,t);for(var o=0;o0){for(this.sortGameObjects(r,t),e=0;e0){for(this.sortGameObjects(n,t),e=0;e-1&&this._draggable.splice(r,1)}return this},makePixelPerfect:function(t){void 0===t&&(t=1);var e=this.systems.textures;return h(e,t)},setHitArea:function(t,e,i){if(void 0===e)return this.setHitAreaFromTexture(t);Array.isArray(t)||(t=[t]);var s=!1,r=!1,n=!1,a=!1,h=!1,l=!0;if(v(e)&&Object.keys(e).length){var u=e;e=p(u,"hitArea",null),i=p(u,"hitAreaCallback",null),h=p(u,"pixelPerfect",!1);var d=p(u,"alphaTolerance",1);h&&(e={},i=this.makePixelPerfect(d)),s=p(u,"draggable",!1),r=p(u,"dropZone",!1),n=p(u,"cursor",!1),a=p(u,"useHandCursor",!1),e&&i||(this.setHitAreaFromTexture(t),l=!1)}else"function"!=typeof e||i||(i=e,e={});for(var c=0;c=this.threshold?this.pressed||(this.pressed=!0,this.events.emit(r.BUTTON_DOWN,e,this,t),this.pad.emit(r.GAMEPAD_BUTTON_DOWN,i,t,this)):this.pressed&&(this.pressed=!1,this.events.emit(r.BUTTON_UP,e,this,t),this.pad.emit(r.GAMEPAD_BUTTON_UP,i,t,this))},destroy:function(){this.pad=null,this.events=null}});t.exports=n},99125(t,e,i){var s=i(97421),r=i(28884),n=i(83419),a=i(50792),o=i(26099),h=new n({Extends:a,initialize:function(t,e){a.call(this),this.manager=t,this.pad=e,this.id=e.id,this.index=e.index;for(var i=[],n=0;n=.5));this.buttons=i;var h=[];for(n=0;n=2&&(this.leftStick.set(n[0].getValue(),n[1].getValue()),r>=4&&this.rightStick.set(n[2].getValue(),n[3].getValue()))}},destroy:function(){var t;for(this.removeAllListeners(),this.manager=null,this.pad=null,t=0;t-1&&e.preventDefault()}},this.onKeyUp=function(e){if(!e.defaultPrevented&&t.enabled&&t.manager){t.queue.push(e),t.manager.events.emit(a.MANAGER_PROCESS);var i=e.altKey||e.ctrlKey||e.shiftKey||e.metaKey;t.preventDefault&&!i&&t.captures.indexOf(e.keyCode)>-1&&e.preventDefault()}};var e=this.target;e&&(e.addEventListener("keydown",this.onKeyDown,!1),e.addEventListener("keyup",this.onKeyUp,!1),this.enabled=!0)},stopListeners:function(){var t=this.target;t.removeEventListener("keydown",this.onKeyDown,!1),t.removeEventListener("keyup",this.onKeyUp,!1),this.enabled=!1},postUpdate:function(){this.queue=[]},addCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i0},removeCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i0},clearCaptures:function(){this.captures=[],this.preventDefault=!1},destroy:function(){this.stopListeners(),this.clearCaptures(),this.queue=[],this.manager.game.events.off(n.POST_STEP,this.postUpdate,this),this.target=null,this.enabled=!1,this.manager=null}});t.exports=l},28846(t,e,i){var s=i(83419),r=i(50792),n=i(95922),a=i(8443),o=i(35154),h=i(8214),l=i(89639),u=i(30472),d=i(46032),c=i(87960),f=i(74600),p=i(44594),g=i(56583),m=new s({Extends:r,initialize:function(t){r.call(this),this.game=t.systems.game,this.scene=t.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=t,this.manager=t.manager.keyboard,this.enabled=!0,this.keys=[],this.combos=[],this.prevCode=null,this.prevTime=0,this.prevType=null,t.pluginEvents.once(h.BOOT,this.boot,this),t.pluginEvents.on(h.START,this.start,this)},boot:function(){var t=this.settings.input;this.enabled=o(t,"keyboard",!0);var e=o(t,"keyboard.capture",null);e&&this.addCaptures(e),this.sceneInputPlugin.pluginEvents.once(h.DESTROY,this.destroy,this)},start:function(){this.sceneInputPlugin.manager.events.on(h.MANAGER_PROCESS,this.update,this),this.sceneInputPlugin.pluginEvents.once(h.SHUTDOWN,this.shutdown,this),this.game.events.on(a.BLUR,this.resetKeys,this),this.scene.sys.events.on(p.PAUSE,this.resetKeys,this),this.scene.sys.events.on(p.SLEEP,this.resetKeys,this)},isActive:function(){return this.enabled&&this.scene.sys.canInput()},addCapture:function(t){return this.manager.addCapture(t),this},removeCapture:function(t){return this.manager.removeCapture(t),this},getCaptures:function(){return this.manager.captures},enableGlobalCapture:function(){return this.manager.preventDefault=!0,this},disableGlobalCapture:function(){return this.manager.preventDefault=!1,this},clearCaptures:function(){return this.manager.clearCaptures(),this},createCursorKeys:function(){return this.addKeys({up:d.UP,down:d.DOWN,left:d.LEFT,right:d.RIGHT,space:d.SPACE,shift:d.SHIFT})},addKeys:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!1);var s={};if("string"==typeof t){t=t.split(",");for(var r=0;r-1?s[r]=t:s[t.keyCode]=t,e&&this.addCapture(t.keyCode),t.setEmitOnRepeat(i),t}return"string"==typeof t&&(t=d[t.toUpperCase()]),s[t]||(s[t]=new u(this,t),e&&this.addCapture(t),s[t].setEmitOnRepeat(i)),s[t]},removeKey:function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var s,r=this.keys;if(t instanceof u){var n=r.indexOf(t);n>-1&&(s=this.keys[n],this.keys[n]=void 0)}else"string"==typeof t&&(t=d[t.toUpperCase()]);return r[t]&&(s=r[t],r[t]=void 0),s&&(s.plugin=null,i&&this.removeCapture(s.keyCode),e&&s.destroy()),this},removeAllKeys:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1);for(var i=this.keys,s=0;st._tick)return t._tick=i,!0}return!1},update:function(){var t=this.manager.queue,e=t.length;if(this.isActive()&&0!==e)for(var i=this.keys,s=0;s0&&e.maxKeyDelay>0){var n=e.timeLastMatched+e.maxKeyDelay;t.timeStamp<=n&&(r=!0,i=s(t,e))}else r=!0,i=s(t,e);return!r&&e.resetOnWrongKey&&(e.index=0,e.current=e.keyCodes[0]),i&&(e.timeLastMatched=t.timeStamp,e.matched=!0,e.timeMatched=t.timeStamp),i}},92803(t){t.exports=function(t){return t.current=t.keyCodes[0],t.index=0,t.timeLastMatched=0,t.matched=!1,t.timeMatched=0,t}},92612(t){t.exports="keydown"},23345(t){t.exports="keyup"},21957(t){t.exports="keycombomatch"},44743(t){t.exports="down"},3771(t){t.exports="keydown-"},46358(t){t.exports="keyup-"},75674(t){t.exports="up"},95922(t,e,i){t.exports={ANY_KEY_DOWN:i(92612),ANY_KEY_UP:i(23345),COMBO_MATCH:i(21957),DOWN:i(44743),KEY_DOWN:i(3771),KEY_UP:i(46358),UP:i(75674)}},51442(t,e,i){t.exports={Events:i(95922),KeyboardManager:i(78970),KeyboardPlugin:i(28846),Key:i(30472),KeyCodes:i(46032),KeyCombo:i(87960),AdvanceKeyCombo:i(66970),ProcessKeyCombo:i(68769),ResetKeyCombo:i(92803),JustDown:i(90229),JustUp:i(38796),DownDuration:i(37015),UpDuration:i(41170)}},37015(t){t.exports=function(t,e){void 0===e&&(e=50);var i=t.plugin.game.loop.time-t.timeDown;return t.isDown&&i=400&&t.status<=599&&(s=!1),this.state=r.FILE_LOADED,this.resetXHR(),this.loader.nextFile(this,s)},onBase64Load:function(t){this.xhrLoader=t,this.state=r.FILE_LOADED,this.percentComplete=1,this.loader.emit(n.FILE_PROGRESS,this,this.percentComplete),this.loader.nextFile(this,!0)},onError:function(){this.resetXHR(),this.retryAttempts>0?(this.retryAttempts--,this.load()):this.loader.nextFile(this,!1)},onProgress:function(t){t.lengthComputable&&(this.bytesLoaded=t.loaded,this.bytesTotal=t.total,this.percentComplete=Math.min(this.bytesLoaded/this.bytesTotal,1),this.loader.emit(n.FILE_PROGRESS,this,this.percentComplete))},onProcess:function(){this.state=r.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=r.FILE_COMPLETE,this.multiFile&&this.multiFile.onFileComplete(this),this.loader.fileProcessComplete(this)},onProcessError:function(){console.error('Failed to process file: %s "%s"',this.type,this.key),this.state=r.FILE_ERRORED,this.multiFile&&this.multiFile.onFileFailed(this),this.loader.fileProcessComplete(this)},hasCacheConflict:function(){return this.cache&&this.cache.exists(this.key)},addToCache:function(){this.cache&&this.data&&this.cache.add(this.key,this.data)},pendingDestroy:function(t){if(this.state!==r.FILE_PENDING_DESTROY){void 0===t&&(t=this.data);var e=this.key,i=this.type;this.loader.emit(n.FILE_COMPLETE,e,i,t),this.loader.emit(n.FILE_KEY_COMPLETE+i+"-"+e,e,i,t),this.loader.flagForRemoval(this),this.state=r.FILE_PENDING_DESTROY}},destroy:function(){this.loader=null,this.cache=null,this.xhrSettings=null,this.multiFile=null,this.linkFile=null,this.data=null}});d.createObjectURL=function(t,e,i){if("function"==typeof URL)t.src=URL.createObjectURL(e);else{var s=new FileReader;s.onload=function(){t.removeAttribute("crossOrigin"),t.src="data:"+(e.type||i)+";base64,"+s.result.split(",")[1]},s.onerror=t.onerror,s.readAsDataURL(e)}},d.revokeObjectURL=function(t){"function"==typeof URL&&URL.revokeObjectURL(t.src)},t.exports=d},74099(t){var e={},i={install:function(t){for(var i in e)t[i]=e[i]},register:function(t,i){e[t]=i},destroy:function(){e={}}};t.exports=i},98356(t){t.exports=function(t,e){return!!t.url&&(t.url.match(/^(?:blob:|data:|capacitor:\/\/|file:\/\/|http:\/\/|https:\/\/|\/\/)/)?t.url:e+t.url)}},74261(t,e,i){var s=i(83419),r=i(23906),n=i(50792),a=i(54899),o=i(74099),h=i(95540),l=i(35154),u=i(41212),d=i(37277),c=i(44594),f=i(92638),p=new s({Extends:n,initialize:function(t){n.call(this);var e=t.sys.game.config,i=t.sys.settings.loader;this.scene=t,this.systems=t.sys,this.cacheManager=t.sys.cache,this.textureManager=t.sys.textures,this.sceneManager=t.sys.game.scene,o.install(this),this.prefix="",this.path="",this.baseURL="",this.setBaseURL(h(i,"baseURL",e.loaderBaseURL)),this.setPath(h(i,"path",e.loaderPath)),this.setPrefix(h(i,"prefix",e.loaderPrefix)),this.maxParallelDownloads=h(i,"maxParallelDownloads",e.loaderMaxParallelDownloads),this.xhr=f(h(i,"responseType",e.loaderResponseType),h(i,"async",e.loaderAsync),h(i,"user",e.loaderUser),h(i,"password",e.loaderPassword),h(i,"timeout",e.loaderTimeout),h(i,"withCredentials",e.loaderWithCredentials)),this.crossOrigin=h(i,"crossOrigin",e.loaderCrossOrigin),this.imageLoadType=h(i,"imageLoadType",e.loaderImageLoadType),this.localSchemes=h(i,"localScheme",e.loaderLocalScheme),this.totalToLoad=0,this.progress=0,this.list=new Set,this.inflight=new Set,this.queue=new Set,this._deleteQueue=new Set,this.totalFailed=0,this.totalComplete=0,this.state=r.LOADER_IDLE,this.multiKeyIndex=0,this.maxRetries=h(i,"maxRetries",e.loaderMaxRetries),t.sys.events.once(c.BOOT,this.boot,this),t.sys.events.on(c.START,this.pluginStart,this)},boot:function(){this.systems.events.once(c.DESTROY,this.destroy,this)},pluginStart:function(){this.systems.events.once(c.SHUTDOWN,this.shutdown,this)},setBaseURL:function(t){return void 0===t&&(t=""),""!==t&&"/"!==t.substr(-1)&&(t=t.concat("/")),this.baseURL=t,this},setPath:function(t){return void 0===t&&(t=""),""!==t&&"/"!==t.substr(-1)&&(t=t.concat("/")),this.path=t,this},setPrefix:function(t){return void 0===t&&(t=""),this.prefix=t,this},setCORS:function(t){return this.crossOrigin=t,this},addFile:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e0},removePack:function(t,e){var i,s=this.systems.anims,r=this.cacheManager,n=this.textureManager,a={animation:"json",aseprite:"json",audio:"audio",audioSprite:"audio",binary:"binary",bitmapFont:"bitmapFont",css:null,glsl:"shader",html:"html",json:"json",obj:"obj",plugin:null,scenePlugin:null,script:null,spine:"json",text:"text",tilemapCSV:"tilemap",tilemapImpact:"tilemap",tilemapTiledJSON:"tilemap",video:"video",xml:"xml"};if(u(t))i=t;else if(!(i=r.json.get(t)))return void console.warn("Asset Pack not found in JSON cache:",t);for(var o in e&&(i={_:i[e]}),i){var l=i[o],d=h(l,"prefix",""),c=h(l,"files"),f=h(l,"defaultType");if(Array.isArray(c))for(var p=0;p0&&this.inflight.size'),i.push(''),i.push(''),i.push(this.xhrLoader.responseText),i.push(""),i.push(""),i.push("");var s=[i.join("\n")],a=this;try{var o=new window.Blob(s,{type:"image/svg+xml;charset=utf-8"})}catch(t){return a.state=r.FILE_ERRORED,void a.onProcessComplete()}this.data=new Image,this.data.crossOrigin=this.crossOrigin,this.data.onload=function(){n.revokeObjectURL(a.data),a.onProcessComplete()},this.data.onerror=function(){n.revokeObjectURL(a.data),a.onProcessError()},n.createObjectURL(this.data,o,"image/svg+xml")},addToCache:function(){this.cache.addImage(this.key,this.data)}});a.register("htmlTexture",function(t,e,i,s,r){if(Array.isArray(t))for(var n=0;n=r.FILE_COMPLETE&&("spritesheet"===t.type?t.addToCache():"normalMap"===this.type?this.cache.addImage(this.key,t.data,this.data):this.cache.addImage(this.key,this.data,t.data)):this.cache.addImage(this.key,this.data)}});a.register("image",function(t,e,i){if(Array.isArray(t))for(var s=0;s=0?a.substring(o+i.length):a]=n.data}for(var h=[],l=0;l=r.FILE_COMPLETE&&("normalMap"===this.type?this.cache.addSpriteSheet(this.key,t.data,this.config,this.data):this.cache.addSpriteSheet(this.key,this.data,this.config,t.data)):this.cache.addSpriteSheet(this.key,this.data,this.config)}});n.register("spritesheet",function(t,e,i,s){if(Array.isArray(t))for(var r=0;ri&&(i=h.x),h.xn&&(n=h.y),h.y>>0)+2891336453,r=277803737*(s>>>(s>>>28)+4^s),n=(r>>>22^r)>>>0;return n/=f};t.exports=function(t,e){switch("number"==typeof t&&(t=[t]),e){case 2:return p(t,!0);case 1:return p(t);default:return c(t)}}},84854(t,e,i){var s=i(72958),r=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16],n=Array(4),a=Array(4),o=Array(4),h=Array(4),l=Array(4),u=Array(4),d=function(t,e,i){var s,r,h,l,u=e.noiseMode||0,d=void 0===e.noiseSmoothing?1:e.noiseSmoothing,p=Math.max(1,Math.min(t.length,4)),g=e.noiseCells||[32,32,32,32].slice(0,p);for(s=0;s1&&(o[1]=Math.floor(l/3)%3-1,p>2&&(o[2]=Math.floor(l/9)%3-1,p>3&&(o[3]=Math.floor(l/27)%3-1))),r=c(p,n,o,e,i),h=f(p,o,a,r),u){case 0:h0||e[1]>0)for(j[0]=U.x,j[1]=z.x,j[2]=Y.x,q[0]=U.y,q[1]=z.y,q[2]=Y.y,e[0]>0&&(j[0]=(U.x%e[0]+e[0])%e[0],j[1]=(z.x%e[0]+e[0])%e[0],j[2]=(Y.x%e[0]+e[0])%e[0]),e[1]>0&&(q[0]=(U.y%e[1]+e[1])%e[1],q[1]=(z.y%e[1]+e[1])%e[1],q[2]=(Y.y%e[1]+e[1])%e[1]),s=0;s<3;s++)V[s]=Math.floor(j[s]+.5*q[s]+.5),H[s]=Math.floor(q[s]+.5);else V[0]=n.x,V[1]=B.x,V[2]=k.x,H[0]=n.y,H[1]=B.y,H[2]=k.y;for(V[0]+=a[0],V[1]+=a[0],V[2]+=a[0],H[0]+=a[1],H[1]+=a[1],H[2]+=a[1],s=0;s<3;s++)K[s]=V[s]%289,K[s]<0&&(K[s]+=289);for(s=0;s<3;s++)K[s]=((51*K[s]+2)*K[s]+H[s])%289;for(s=0;s<3;s++)K[s]=(34*K[s]+10)*K[s]%289;for(s=0;s<3;s++)Z[s]=.07482*K[s]+i,Q[s]=Math.cos(Z[s]),J[s]=Math.sin(Z[s]);for($.x=Q[0],$.y=J[0],tt.x=Q[1],tt.y=J[1],et.x=Q[2],et.y=J[2],it[0]=.8-I(X,X),it[1]=.8-I(W,W),it[2]=.8-I(G,G),s=0;s<3;s++)it[s]=Math.max(it[s],0),st[s]=it[s]*it[s],rt[s]=st[s]*st[s];return nt[0]=I($,X),nt[1]=I(tt,W),nt[2]=I(et,G),10.9*(rt[0]*nt[0]+rt[1]*nt[1]+rt[2]*nt[2])},B=[0,0,0],k=[0,0,0],U=[0,0,0],z=[0,0,0],Y=[0,0,0],X=[0,0,0],W=[0,0,0],G=[0,0,0],V=[0,0,0],H=[0,0,0],j=[0,0,0],q=[0,0,0],K=[0,0,0],Z=[0,0,0],Q=[0,0,0],J=[0,0,0],$=[0,0,0],tt=[0,0,0],et=[0,0,0],it=[0,0,0],st=[0,0,0,0],rt=[0,0,0,0],nt=[0,0,0,0],at=[0,0,0,0],ot=[0,0,0,0],ht=[0,0,0,0],lt=[0,0,0,0],ut=[0,0,0,0],dt=[0,0,0,0],ct=[0,0,0,0],ft=[0,0,0,0],pt=[0,0,0,0],gt=[0,0,0,0],mt=[0,0,0,0],vt=[0,0,0,0],yt=[0,0,0,0],xt=[0,0,0,0],Tt=[0,0,0,0],wt=[0,0,0,0],bt=[0,0,0,0],St=[0,0,0,0],Ct=[0,0,0,0],Et=[0,0,0,0],At=[0,0,0,0],_t=[0,0,0,0],Mt=[0,0,0,0],Rt=[0,0,0,0],Pt=[0,0,0,0],Ot=function(t,e){for(var i=0;i<4;i++){var s=t[i]%289;s<0&&(s+=289),e[i]=(34*s+10)*s%289}},Lt=function(t,e,i){var s=B,r=k,n=U,o=z,h=Y,l=X,u=W,d=G,c=V,f=H,p=j,g=q,m=K,v=Z,y=Q,x=J,T=$,w=tt,b=et,S=it,C=st,E=rt,A=nt,_=at,M=ot,R=ht,P=lt,O=ut,L=dt,D=ct,F=ft,I=pt,N=gt,Lt=mt,Dt=vt,Ft=yt,It=xt,Nt=Tt,Bt=wt,kt=bt,Ut=St,zt=Ct,Yt=Et,Xt=At,Wt=_t,Gt=Mt,Vt=Rt,Ht=Pt;s[0]=0*t[0]+1*t[1]+1*t[2],s[1]=1*t[0]+0*t[1]+1*t[2],s[2]=1*t[0]+1*t[1]+0*t[2];for(var jt=0;jt<3;jt++)r[jt]=Math.floor(s[jt]),n[jt]=s[jt]-r[jt];for(o[0]=n[0]>n[1]?0:1,o[1]=n[1]>n[2]?0:1,o[2]=n[0]>n[2]?0:1,h[0]=1-o[0],h[1]=1-o[1],h[2]=1-o[2],l[0]=h[2],l[1]=o[0],l[2]=o[1],u[0]=h[0],u[1]=h[1],u[2]=o[2],jt=0;jt<3;jt++)d[jt]=Math.min(l[jt],u[jt]),c[jt]=Math.max(l[jt],u[jt]);for(jt=0;jt<3;jt++)f[jt]=r[jt]+d[jt],p[jt]=r[jt]+c[jt],g[jt]=r[jt]+1;var qt=r[0],Kt=r[1],Zt=r[2],Qt=f[0],Jt=f[1],$t=f[2],te=p[0],ee=p[1],ie=p[2],se=g[0],re=g[1],ne=g[2];for(m[0]=-.5*qt+.5*Kt+.5*Zt,m[1]=.5*qt-.5*Kt+.5*Zt,m[2]=.5*qt+.5*Kt-.5*Zt,v[0]=-.5*Qt+.5*Jt+.5*$t,v[1]=.5*Qt-.5*Jt+.5*$t,v[2]=.5*Qt+.5*Jt-.5*$t,y[0]=-.5*te+.5*ee+.5*ie,y[1]=.5*te-.5*ee+.5*ie,y[2]=.5*te+.5*ee-.5*ie,x[0]=-.5*se+.5*re+.5*ne,x[1]=.5*se-.5*re+.5*ne,x[2]=.5*se+.5*re-.5*ne,jt=0;jt<3;jt++)T[jt]=t[jt]-m[jt],w[jt]=t[jt]-v[jt],b[jt]=t[jt]-y[jt],S[jt]=t[jt]-x[jt];if(e[0]>0||e[1]>0||e[2]>0){if(C[0]=m[0],C[1]=v[0],C[2]=y[0],C[3]=x[0],E[0]=m[1],E[1]=v[1],E[2]=y[1],E[3]=x[1],A[0]=m[2],A[1]=v[2],A[2]=y[2],A[3]=x[2],e[0]>0)for(jt=0;jt<4;jt++)C[jt]=(C[jt]%e[0]+e[0])%e[0];if(e[1]>0)for(jt=0;jt<4;jt++)E[jt]=(E[jt]%e[1]+e[1])%e[1];if(e[2]>0)for(jt=0;jt<4;jt++)A[jt]=(A[jt]%e[2]+e[2])%e[2];var ae=C[0],oe=E[0],he=A[0],le=C[1],ue=E[1],de=A[1],ce=C[2],fe=E[2],pe=A[2],ge=C[3],me=E[3],ve=A[3];r[0]=Math.floor(0*ae+1*oe+1*he+.5),r[1]=Math.floor(1*ae+0*oe+1*he+.5),r[2]=Math.floor(1*ae+1*oe+0*he+.5),f[0]=Math.floor(0*le+1*ue+1*de+.5),f[1]=Math.floor(1*le+0*ue+1*de+.5),f[2]=Math.floor(1*le+1*ue+0*de+.5),p[0]=Math.floor(0*ce+1*fe+1*pe+.5),p[1]=Math.floor(1*ce+0*fe+1*pe+.5),p[2]=Math.floor(1*ce+1*fe+0*pe+.5),g[0]=Math.floor(0*ge+1*me+1*ve+.5),g[1]=Math.floor(1*ge+0*me+1*ve+.5),g[2]=Math.floor(1*ge+1*me+0*ve+.5)}r[0]+=a[0],r[1]+=a[1],r[2]+=a[2],f[0]+=a[0],f[1]+=a[1],f[2]+=a[2],p[0]+=a[0],p[1]+=a[1],p[2]+=a[2],g[0]+=a[0],g[1]+=a[1],g[2]+=a[2];var ye=st,xe=rt;for(ye[0]=r[2],ye[1]=f[2],ye[2]=p[2],ye[3]=g[2],Ot(ye,xe),xe[0]+=r[1],xe[1]+=f[1],xe[2]+=p[1],xe[3]+=g[1],Ot(xe,ye),ye[0]+=r[0],ye[1]+=f[0],ye[2]+=p[0],ye[3]+=g[0],Ot(ye,_),jt=0;jt<4;jt++)M[jt]=3.883222077*_[jt],R[jt]=.996539792-.006920415*_[jt],P[jt]=.108705628*_[jt],O[jt]=Math.cos(M[jt]),L[jt]=Math.sin(M[jt]),D[jt]=Math.sqrt(Math.max(0,1-R[jt]*R[jt]));if(0!==i)for(jt=0;jt<4;jt++)Lt[jt]=O[jt]*D[jt],Dt[jt]=L[jt]*D[jt],Ft[jt]=R[jt],It[jt]=Math.sin(P[jt]),Nt[jt]=Math.cos(P[jt]),Bt[jt]=L[jt]*It[jt]-O[jt]*Nt[jt],kt[jt]=(1-R[jt])*(Bt[jt]*L[jt])+R[jt]*It[jt],Ut[jt]=(1-R[jt])*(-Bt[jt]*O[jt])+R[jt]*Nt[jt],zt[jt]=-(Dt[jt]*Nt[jt]+Lt[jt]*It[jt]),Yt[jt]=Math.sin(i),Xt[jt]=Math.cos(i),F[jt]=Xt[jt]*Lt[jt]+Yt[jt]*kt[jt],I[jt]=Xt[jt]*Dt[jt]+Yt[jt]*Ut[jt],N[jt]=Xt[jt]*Ft[jt]+Yt[jt]*zt[jt];else for(jt=0;jt<4;jt++)F[jt]=O[jt]*D[jt],I[jt]=L[jt]*D[jt],N[jt]=R[jt];for(jt=0;jt<4;jt++){var Te=0===jt?T[0]:1===jt?w[0]:2===jt?b[0]:S[0],we=0===jt?T[1]:1===jt?w[1]:2===jt?b[1]:S[1],be=0===jt?T[2]:1===jt?w[2]:2===jt?b[2]:S[2],Se=Te*Te+we*we+be*be;Wt[jt]=.5-Se,Wt[jt]<0&&(Wt[jt]=0),Gt[jt]=Wt[jt]*Wt[jt],Vt[jt]=Gt[jt]*Wt[jt]}for(jt=0;jt<4;jt++){var Ce=F[jt],Ee=I[jt],Ae=N[jt],_e=0===jt?T[0]:1===jt?w[0]:2===jt?b[0]:S[0],Me=0===jt?T[1]:1===jt?w[1]:2===jt?b[1]:S[1],Re=0===jt?T[2]:1===jt?w[2]:2===jt?b[2]:S[2];Ht[jt]=Ce*_e+Ee*Me+Ae*Re}var Pe=0;for(jt=0;jt<4;jt++)Pe+=Vt[jt]*Ht[jt];return 39.5*Pe};t.exports=function(t,s){"number"==typeof t&&(t=[t]),s||(s={});for(var h=Math.min(3,t.length);h<2;)t.push(0),h++;var l=s.noiseIterations||1,u=s.noiseWarpIterations||1,d=s.noiseDetailPower||2,c=s.noiseFlowPower||2,f=s.noiseContributionPower||2,p=s.noiseWarpDetailPower||2,g=s.noiseWarpFlowPower||2,m=s.noiseWarpContributionPower||2,v=s.noiseCells||[32,32,32],y=s.noiseOffset||[0,0,0],x=s.noiseWarpAmount||0;if(s.noiseSeed)for(var T=[1,2,3],w=0;w0&&u>0&&h>=2)if(2===h){var b=o(u,2,e,s,p,g,m);i[0]=e[0]+r[0],i[1]=e[1]+r[1];var S=o(u,2,i,s,p,g,m);e[0]+=b*x,e[1]+=S*x}else if(3===h){var C=o(u,3,e,s,p,g,m);i[0]=e[0]+r[0],i[1]=e[1]+r[1],i[2]=e[2]+r[2];var E=o(u,3,i,s,p,g,m);i[0]=e[0]+n[0],i[1]=e[1]+n[1],i[2]=e[2]+n[2];var A=o(u,3,i,s,p,g,m);e[0]+=C*x,e[1]+=E*x,e[2]+=A*x}return o(l,h,e,s,d,c,f)}},78702(t){t.exports=function(t){return t==parseFloat(t)?!(t%2):void 0}},94883(t){t.exports=function(t){return t===parseFloat(t)?!(t%2):void 0}},28915(t){t.exports=function(t,e,i){return(e-t)*i+t}},94908(t){t.exports=function(t,e,i){return void 0===i&&(i=0),t.clone().lerp(e,i)}},94434(t,e,i){var s=new(i(83419))({initialize:function(t){this.val=new Float32Array(9),t?this.copy(t):this.identity()},clone:function(){return new s(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this},fromMat4:function(t){var e=t.val,i=this.val;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[4],i[4]=e[5],i[5]=e[6],i[6]=e[8],i[7]=e[9],i[8]=e[10],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],s=t[5];return t[1]=t[3],t[2]=t[6],t[3]=e,t[5]=t[7],t[6]=i,t[7]=s,this},invert:function(){var t=this.val,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=l*n-a*h,d=-l*r+a*o,c=h*r-n*o,f=e*u+i*d+s*c;return f?(f=1/f,t[0]=u*f,t[1]=(-l*i+s*h)*f,t[2]=(a*i-s*n)*f,t[3]=d*f,t[4]=(l*e-s*o)*f,t[5]=(-a*e+s*r)*f,t[6]=c*f,t[7]=(-h*e+i*o)*f,t[8]=(n*e-i*r)*f,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return t[0]=n*l-a*h,t[1]=s*h-i*l,t[2]=i*a-s*n,t[3]=a*o-r*l,t[4]=e*l-s*o,t[5]=s*r-e*a,t[6]=r*h-n*o,t[7]=i*o-e*h,t[8]=e*n-i*r,this},determinant:function(){var t=this.val,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return e*(l*n-a*h)+i*(-l*r+a*o)+s*(h*r-n*o)},multiply:function(t){var e=this.val,i=e[0],s=e[1],r=e[2],n=e[3],a=e[4],o=e[5],h=e[6],l=e[7],u=e[8],d=t.val,c=d[0],f=d[1],p=d[2],g=d[3],m=d[4],v=d[5],y=d[6],x=d[7],T=d[8];return e[0]=c*i+f*n+p*h,e[1]=c*s+f*a+p*l,e[2]=c*r+f*o+p*u,e[3]=g*i+m*n+v*h,e[4]=g*s+m*a+v*l,e[5]=g*r+m*o+v*u,e[6]=y*i+x*n+T*h,e[7]=y*s+x*a+T*l,e[8]=y*r+x*o+T*u,this},translate:function(t){var e=this.val,i=t.x,s=t.y;return e[6]=i*e[0]+s*e[3]+e[6],e[7]=i*e[1]+s*e[4]+e[7],e[8]=i*e[2]+s*e[5]+e[8],this},rotate:function(t){var e=this.val,i=e[0],s=e[1],r=e[2],n=e[3],a=e[4],o=e[5],h=Math.sin(t),l=Math.cos(t);return e[0]=l*i+h*n,e[1]=l*s+h*a,e[2]=l*r+h*o,e[3]=l*n-h*i,e[4]=l*a-h*s,e[5]=l*o-h*r,this},scale:function(t){var e=this.val,i=t.x,s=t.y;return e[0]=i*e[0],e[1]=i*e[1],e[2]=i*e[2],e[3]=s*e[3],e[4]=s*e[4],e[5]=s*e[5],this},fromQuat:function(t){var e=t.x,i=t.y,s=t.z,r=t.w,n=e+e,a=i+i,o=s+s,h=e*n,l=e*a,u=e*o,d=i*a,c=i*o,f=s*o,p=r*n,g=r*a,m=r*o,v=this.val;return v[0]=1-(d+f),v[3]=l+m,v[6]=u-g,v[1]=l-m,v[4]=1-(h+f),v[7]=c+p,v[2]=u+g,v[5]=c-p,v[8]=1-(h+d),this},normalFromMat4:function(t){var e=t.val,i=this.val,s=e[0],r=e[1],n=e[2],a=e[3],o=e[4],h=e[5],l=e[6],u=e[7],d=e[8],c=e[9],f=e[10],p=e[11],g=e[12],m=e[13],v=e[14],y=e[15],x=s*h-r*o,T=s*l-n*o,w=s*u-a*o,b=r*l-n*h,S=r*u-a*h,C=n*u-a*l,E=d*m-c*g,A=d*v-f*g,_=d*y-p*g,M=c*v-f*m,R=c*y-p*m,P=f*y-p*v,O=x*P-T*R+w*M+b*_-S*A+C*E;return O?(O=1/O,i[0]=(h*P-l*R+u*M)*O,i[1]=(l*_-o*P-u*A)*O,i[2]=(o*R-h*_+u*E)*O,i[3]=(n*R-r*P-a*M)*O,i[4]=(s*P-n*_+a*A)*O,i[5]=(r*_-s*R-a*E)*O,i[6]=(m*C-v*S+y*b)*O,i[7]=(v*w-g*C-y*T)*O,i[8]=(g*S-m*w+y*x)*O,this):null}});t.exports=s},37867(t,e,i){var s=i(83419),r=i(25836),n=1e-6,a=new s({initialize:function(t){this.val=new Float32Array(16),t?this.copy(t):this.identity()},clone:function(){return new a(this)},set:function(t){return this.copy(t)},setValues:function(t,e,i,s,r,n,a,o,h,l,u,d,c,f,p,g){var m=this.val;return m[0]=t,m[1]=e,m[2]=i,m[3]=s,m[4]=r,m[5]=n,m[6]=a,m[7]=o,m[8]=h,m[9]=l,m[10]=u,m[11]=d,m[12]=c,m[13]=f,m[14]=p,m[15]=g,this},copy:function(t){var e=t.val;return this.setValues(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},fromArray:function(t){return this.setValues(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},zero:function(){return this.setValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)},transform:function(t,e,i){var s=o.fromQuat(i).val,r=e.x,n=e.y,a=e.z;return this.setValues(s[0]*r,s[1]*r,s[2]*r,0,s[4]*n,s[5]*n,s[6]*n,0,s[8]*a,s[9]*a,s[10]*a,0,t.x,t.y,t.z,1)},xyz:function(t,e,i){this.identity();var s=this.val;return s[12]=t,s[13]=e,s[14]=i,this},scaling:function(t,e,i){this.zero();var s=this.val;return s[0]=t,s[5]=e,s[10]=i,s[15]=1,this},identity:function(){return this.setValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)},transpose:function(){var t=this.val,e=t[1],i=t[2],s=t[3],r=t[6],n=t[7],a=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=e,t[6]=t[9],t[7]=t[13],t[8]=i,t[9]=r,t[11]=t[14],t[12]=s,t[13]=n,t[14]=a,this},getInverse:function(t){return this.copy(t),this.invert()},invert:function(){var t=this.val,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],d=t[10],c=t[11],f=t[12],p=t[13],g=t[14],m=t[15],v=e*a-i*n,y=e*o-s*n,x=e*h-r*n,T=i*o-s*a,w=i*h-r*a,b=s*h-r*o,S=l*p-u*f,C=l*g-d*f,E=l*m-c*f,A=u*g-d*p,_=u*m-c*p,M=d*m-c*g,R=v*M-y*_+x*A+T*E-w*C+b*S;return R?(R=1/R,this.setValues((a*M-o*_+h*A)*R,(s*_-i*M-r*A)*R,(p*b-g*w+m*T)*R,(d*w-u*b-c*T)*R,(o*E-n*M-h*C)*R,(e*M-s*E+r*C)*R,(g*x-f*b-m*y)*R,(l*b-d*x+c*y)*R,(n*_-a*E+h*S)*R,(i*E-e*_-r*S)*R,(f*w-p*x+m*v)*R,(u*x-l*w-c*v)*R,(a*C-n*A-o*S)*R,(e*A-i*C+s*S)*R,(p*y-f*T-g*v)*R,(l*T-u*y+d*v)*R)):this},adjoint:function(){var t=this.val,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],d=t[10],c=t[11],f=t[12],p=t[13],g=t[14],m=t[15];return this.setValues(a*(d*m-c*g)-u*(o*m-h*g)+p*(o*c-h*d),-(i*(d*m-c*g)-u*(s*m-r*g)+p*(s*c-r*d)),i*(o*m-h*g)-a*(s*m-r*g)+p*(s*h-r*o),-(i*(o*c-h*d)-a*(s*c-r*d)+u*(s*h-r*o)),-(n*(d*m-c*g)-l*(o*m-h*g)+f*(o*c-h*d)),e*(d*m-c*g)-l*(s*m-r*g)+f*(s*c-r*d),-(e*(o*m-h*g)-n*(s*m-r*g)+f*(s*h-r*o)),e*(o*c-h*d)-n*(s*c-r*d)+l*(s*h-r*o),n*(u*m-c*p)-l*(a*m-h*p)+f*(a*c-h*u),-(e*(u*m-c*p)-l*(i*m-r*p)+f*(i*c-r*u)),e*(a*m-h*p)-n*(i*m-r*p)+f*(i*h-r*a),-(e*(a*c-h*u)-n*(i*c-r*u)+l*(i*h-r*a)),-(n*(u*g-d*p)-l*(a*g-o*p)+f*(a*d-o*u)),e*(u*g-d*p)-l*(i*g-s*p)+f*(i*d-s*u),-(e*(a*g-o*p)-n*(i*g-s*p)+f*(i*o-s*a)),e*(a*d-o*u)-n*(i*d-s*u)+l*(i*o-s*a))},determinant:function(){var t=this.val,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],d=t[10],c=t[11],f=t[12],p=t[13],g=t[14],m=t[15];return(e*a-i*n)*(d*m-c*g)-(e*o-s*n)*(u*m-c*p)+(e*h-r*n)*(u*g-d*p)+(i*o-s*a)*(l*m-c*f)-(i*h-r*a)*(l*g-d*f)+(s*h-r*o)*(l*p-u*f)},multiply:function(t){var e=this.val,i=e[0],s=e[1],r=e[2],n=e[3],a=e[4],o=e[5],h=e[6],l=e[7],u=e[8],d=e[9],c=e[10],f=e[11],p=e[12],g=e[13],m=e[14],v=e[15],y=t.val,x=y[0],T=y[1],w=y[2],b=y[3];return e[0]=x*i+T*a+w*u+b*p,e[1]=x*s+T*o+w*d+b*g,e[2]=x*r+T*h+w*c+b*m,e[3]=x*n+T*l+w*f+b*v,x=y[4],T=y[5],w=y[6],b=y[7],e[4]=x*i+T*a+w*u+b*p,e[5]=x*s+T*o+w*d+b*g,e[6]=x*r+T*h+w*c+b*m,e[7]=x*n+T*l+w*f+b*v,x=y[8],T=y[9],w=y[10],b=y[11],e[8]=x*i+T*a+w*u+b*p,e[9]=x*s+T*o+w*d+b*g,e[10]=x*r+T*h+w*c+b*m,e[11]=x*n+T*l+w*f+b*v,x=y[12],T=y[13],w=y[14],b=y[15],e[12]=x*i+T*a+w*u+b*p,e[13]=x*s+T*o+w*d+b*g,e[14]=x*r+T*h+w*c+b*m,e[15]=x*n+T*l+w*f+b*v,this},multiplyLocal:function(t){var e=this.val,i=t.val;return this.setValues(e[0]*i[0]+e[1]*i[4]+e[2]*i[8]+e[3]*i[12],e[0]*i[1]+e[1]*i[5]+e[2]*i[9]+e[3]*i[13],e[0]*i[2]+e[1]*i[6]+e[2]*i[10]+e[3]*i[14],e[0]*i[3]+e[1]*i[7]+e[2]*i[11]+e[3]*i[15],e[4]*i[0]+e[5]*i[4]+e[6]*i[8]+e[7]*i[12],e[4]*i[1]+e[5]*i[5]+e[6]*i[9]+e[7]*i[13],e[4]*i[2]+e[5]*i[6]+e[6]*i[10]+e[7]*i[14],e[4]*i[3]+e[5]*i[7]+e[6]*i[11]+e[7]*i[15],e[8]*i[0]+e[9]*i[4]+e[10]*i[8]+e[11]*i[12],e[8]*i[1]+e[9]*i[5]+e[10]*i[9]+e[11]*i[13],e[8]*i[2]+e[9]*i[6]+e[10]*i[10]+e[11]*i[14],e[8]*i[3]+e[9]*i[7]+e[10]*i[11]+e[11]*i[15],e[12]*i[0]+e[13]*i[4]+e[14]*i[8]+e[15]*i[12],e[12]*i[1]+e[13]*i[5]+e[14]*i[9]+e[15]*i[13],e[12]*i[2]+e[13]*i[6]+e[14]*i[10]+e[15]*i[14],e[12]*i[3]+e[13]*i[7]+e[14]*i[11]+e[15]*i[15])},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var i=t.val,s=e.val,r=i[0],n=i[4],a=i[8],o=i[12],h=i[1],l=i[5],u=i[9],d=i[13],c=i[2],f=i[6],p=i[10],g=i[14],m=i[3],v=i[7],y=i[11],x=i[15],T=s[0],w=s[4],b=s[8],S=s[12],C=s[1],E=s[5],A=s[9],_=s[13],M=s[2],R=s[6],P=s[10],O=s[14],L=s[3],D=s[7],F=s[11],I=s[15];return this.setValues(r*T+n*C+a*M+o*L,h*T+l*C+u*M+d*L,c*T+f*C+p*M+g*L,m*T+v*C+y*M+x*L,r*w+n*E+a*R+o*D,h*w+l*E+u*R+d*D,c*w+f*E+p*R+g*D,m*w+v*E+y*R+x*D,r*b+n*A+a*P+o*F,h*b+l*A+u*P+d*F,c*b+f*A+p*P+g*F,m*b+v*A+y*P+x*F,r*S+n*_+a*O+o*I,h*S+l*_+u*O+d*I,c*S+f*_+p*O+g*I,m*S+v*_+y*O+x*I)},translate:function(t){return this.translateXYZ(t.x,t.y,t.z)},translateXYZ:function(t,e,i){var s=this.val;return s[12]=s[0]*t+s[4]*e+s[8]*i+s[12],s[13]=s[1]*t+s[5]*e+s[9]*i+s[13],s[14]=s[2]*t+s[6]*e+s[10]*i+s[14],s[15]=s[3]*t+s[7]*e+s[11]*i+s[15],this},scale:function(t){return this.scaleXYZ(t.x,t.y,t.z)},scaleXYZ:function(t,e,i){var s=this.val;return s[0]=s[0]*t,s[1]=s[1]*t,s[2]=s[2]*t,s[3]=s[3]*t,s[4]=s[4]*e,s[5]=s[5]*e,s[6]=s[6]*e,s[7]=s[7]*e,s[8]=s[8]*i,s[9]=s[9]*i,s[10]=s[10]*i,s[11]=s[11]*i,this},makeRotationAxis:function(t,e){var i=Math.cos(e),s=Math.sin(e),r=1-i,n=t.x,a=t.y,o=t.z,h=r*n,l=r*a;return this.setValues(h*n+i,h*a-s*o,h*o+s*a,0,h*a+s*o,l*a+i,l*o-s*n,0,h*o-s*a,l*o+s*n,r*o*o+i,0,0,0,0,1)},rotate:function(t,e){var i=this.val,s=e.x,r=e.y,a=e.z,o=Math.sqrt(s*s+r*r+a*a);if(Math.abs(o)1?void 0!==s?(r=(s-t)/(s-i))<0&&(r=0):r=1:r<0&&(r=0),r}},15746(t,e,i){var s=i(83419),r=i(94434),n=i(29747),a=i(25836),o=1e-6,h=new Int8Array([1,2,0]),l=new Float32Array([0,0,0]),u=new a(1,0,0),d=new a(0,1,0),c=new a,f=new r,p=new s({initialize:function(t,e,i,s){this.onChangeCallback=n,this.set(t,e,i,s)},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},w:{get:function(){return this._w},set:function(t){this._w=t,this.onChangeCallback(this)}},copy:function(t){return this.set(t)},set:function(t,e,i,s,r){return void 0===r&&(r=!0),"object"==typeof t?(this._x=t.x||0,this._y=t.y||0,this._z=t.z||0,this._w=t.w||0):(this._x=t||0,this._y=e||0,this._z=i||0,this._w=s||0),r&&this.onChangeCallback(this),this},add:function(t){return this._x+=t.x,this._y+=t.y,this._z+=t.z,this._w+=t.w,this.onChangeCallback(this),this},subtract:function(t){return this._x-=t.x,this._y-=t.y,this._z-=t.z,this._w-=t.w,this.onChangeCallback(this),this},scale:function(t){return this._x*=t,this._y*=t,this._z*=t,this._w*=t,this.onChangeCallback(this),this},length:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return Math.sqrt(t*t+e*e+i*i+s*s)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return t*t+e*e+i*i+s*s},normalize:function(){var t=this.x,e=this.y,i=this.z,s=this.w,r=t*t+e*e+i*i+s*s;return r>0&&(r=1/Math.sqrt(r),this._x=t*r,this._y=e*r,this._z=i*r,this._w=s*r),this.onChangeCallback(this),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,r=this.z,n=this.w;return this.set(i+e*(t.x-i),s+e*(t.y-s),r+e*(t.z-r),n+e*(t.w-n))},rotationTo:function(t,e){var i=t.x*e.x+t.y*e.y+t.z*e.z;return i<-.999999?(c.copy(u).cross(t).length().999999?this.set(0,0,0,1):(c.copy(t).cross(e),this._x=c.x,this._y=c.y,this._z=c.z,this._w=1+i,this.normalize())},setAxes:function(t,e,i){var s=f.val;return s[0]=e.x,s[3]=e.y,s[6]=e.z,s[1]=i.x,s[4]=i.y,s[7]=i.z,s[2]=-t.x,s[5]=-t.y,s[8]=-t.z,this.fromMat3(f).normalize()},identity:function(){return this.set(0,0,0,1)},setAxisAngle:function(t,e){e*=.5;var i=Math.sin(e);return this.set(i*t.x,i*t.y,i*t.z,Math.cos(e))},multiply:function(t){var e=this.x,i=this.y,s=this.z,r=this.w,n=t.x,a=t.y,o=t.z,h=t.w;return this.set(e*h+r*n+i*o-s*a,i*h+r*a+s*n-e*o,s*h+r*o+e*a-i*n,r*h-e*n-i*a-s*o)},slerp:function(t,e){var i=this.x,s=this.y,r=this.z,n=this.w,a=t.x,h=t.y,l=t.z,u=t.w,d=i*a+s*h+r*l+n*u;d<0&&(d=-d,a=-a,h=-h,l=-l,u=-u);var c=1-e,f=e;if(1-d>o){var p=Math.acos(d),g=Math.sin(p);c=Math.sin((1-e)*p)/g,f=Math.sin(e*p)/g}return this.set(c*i+f*a,c*s+f*h,c*r+f*l,c*n+f*u)},invert:function(){var t=this.x,e=this.y,i=this.z,s=this.w,r=t*t+e*e+i*i+s*s,n=r?1/r:0;return this.set(-t*n,-e*n,-i*n,s*n)},conjugate:function(){return this._x=-this.x,this._y=-this.y,this._z=-this.z,this.onChangeCallback(this),this},rotateX:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,r=this.w,n=Math.sin(t),a=Math.cos(t);return this.set(e*a+r*n,i*a+s*n,s*a-i*n,r*a-e*n)},rotateY:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,r=this.w,n=Math.sin(t),a=Math.cos(t);return this.set(e*a-s*n,i*a+r*n,s*a+e*n,r*a-i*n)},rotateZ:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,r=this.w,n=Math.sin(t),a=Math.cos(t);return this.set(e*a+i*n,i*a-e*n,s*a+r*n,r*a-s*n)},calculateW:function(){var t=this.x,e=this.y,i=this.z;return this.w=-Math.sqrt(1-t*t-e*e-i*i),this},setFromEuler:function(t,e){var i=t.x/2,s=t.y/2,r=t.z/2,n=Math.cos(i),a=Math.cos(s),o=Math.cos(r),h=Math.sin(i),l=Math.sin(s),u=Math.sin(r);switch(t.order){case"XYZ":this.set(h*a*o+n*l*u,n*l*o-h*a*u,n*a*u+h*l*o,n*a*o-h*l*u,e);break;case"YXZ":this.set(h*a*o+n*l*u,n*l*o-h*a*u,n*a*u-h*l*o,n*a*o+h*l*u,e);break;case"ZXY":this.set(h*a*o-n*l*u,n*l*o+h*a*u,n*a*u+h*l*o,n*a*o-h*l*u,e);break;case"ZYX":this.set(h*a*o-n*l*u,n*l*o+h*a*u,n*a*u-h*l*o,n*a*o+h*l*u,e);break;case"YZX":this.set(h*a*o+n*l*u,n*l*o+h*a*u,n*a*u-h*l*o,n*a*o-h*l*u,e);break;case"XZY":this.set(h*a*o-n*l*u,n*l*o-h*a*u,n*a*u+h*l*o,n*a*o+h*l*u,e)}return this},setFromRotationMatrix:function(t){var e,i=t.val,s=i[0],r=i[4],n=i[8],a=i[1],o=i[5],h=i[9],l=i[2],u=i[6],d=i[10],c=s+o+d;return c>0?(e=.5/Math.sqrt(c+1),this.set((u-h)*e,(n-l)*e,(a-r)*e,.25/e)):s>o&&s>d?(e=2*Math.sqrt(1+s-o-d),this.set(.25*e,(r+a)/e,(n+l)/e,(u-h)/e)):o>d?(e=2*Math.sqrt(1+o-s-d),this.set((r+a)/e,.25*e,(h+u)/e,(n-l)/e)):(e=2*Math.sqrt(1+d-s-o),this.set((n+l)/e,(h+u)/e,.25*e,(a-r)/e)),this},fromMat3:function(t){var e,i=t.val,s=i[0]+i[4]+i[8];if(s>0)e=Math.sqrt(s+1),this.w=.5*e,e=.5/e,this._x=(i[7]-i[5])*e,this._y=(i[2]-i[6])*e,this._z=(i[3]-i[1])*e;else{var r=0;i[4]>i[0]&&(r=1),i[8]>i[3*r+r]&&(r=2);var n=h[r],a=h[n];e=Math.sqrt(i[3*r+r]-i[3*n+n]-i[3*a+a]+1),l[r]=.5*e,e=.5/e,l[n]=(i[3*n+r]+i[3*r+n])*e,l[a]=(i[3*a+r]+i[3*r+a])*e,this._x=l[0],this._y=l[1],this._z=l[2],this._w=(i[3*a+n]-i[3*n+a])*e}return this.onChangeCallback(this),this}});t.exports=p},43396(t,e,i){var s=i(36383);t.exports=function(t){return t*s.RAD_TO_DEG}},74362(t){t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI;return t.x=Math.cos(i)*e,t.y=Math.sin(i)*e,t}},60706(t){t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI,s=2*Math.random()-1,r=Math.sqrt(1-s*s)*e;return t.x=Math.cos(i)*r,t.y=Math.sin(i)*r,t.z=s*e,t}},67421(t){t.exports=function(t,e){return void 0===e&&(e=1),t.x=(2*Math.random()-1)*e,t.y=(2*Math.random()-1)*e,t.z=(2*Math.random()-1)*e,t.w=(2*Math.random()-1)*e,t}},36305(t){t.exports=function(t,e){var i=t.x,s=t.y;return t.x=i*Math.cos(e)-s*Math.sin(e),t.y=i*Math.sin(e)+s*Math.cos(e),t}},11520(t){t.exports=function(t,e,i,s){var r=Math.cos(s),n=Math.sin(s),a=t.x-e,o=t.y-i;return t.x=a*r-o*n+e,t.y=a*n+o*r+i,t}},1163(t){t.exports=function(t,e,i,s,r){var n=s+Math.atan2(t.y-i,t.x-e);return t.x=e+r*Math.cos(n),t.y=i+r*Math.sin(n),t}},70336(t){t.exports=function(t,e,i,s,r){return t.x=e+r*Math.cos(s),t.y=i+r*Math.sin(s),t}},72678(t,e,i){var s=i(25836),r=i(37867),n=i(15746),a=new r,o=new n,h=new s;t.exports=function(t,e,i){return o.setAxisAngle(e,i),a.fromRotationTranslation(o,h.set(0,0,0)),t.transformMat4(a)}},2284(t){t.exports=function(t){return t>0?Math.ceil(t):Math.floor(t)}},41013(t){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.round(t*s)/s}},7602(t){t.exports=function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)}},54261(t){t.exports=function(t,e,i){return(t=Math.max(0,Math.min(1,(t-e)/(i-e))))*t*t*(t*(6*t-15)+10)}},44408(t,e,i){var s=i(26099);t.exports=function(t,e,i,r){void 0===r&&(r=new s);var n=0,a=0;return t>0&&t<=e*i&&(n=t>e-1?t-(a=Math.floor(t/e))*e:t),r.set(n,a)}},85955(t,e,i){var s=i(26099);t.exports=function(t,e,i,r,n,a,o,h){void 0===h&&(h=new s);var l=Math.sin(n),u=Math.cos(n),d=u*a,c=l*a,f=-l*o,p=u*o,g=1/(d*p+f*-c);return h.x=p*g*t+-f*g*e+(r*f-i*p)*g,h.y=d*g*e+-c*g*t+(-r*d+i*c)*g,h}},26099(t,e,i){t.exports=i(70038).default},25836(t,e,i){var s=new(i(83419))({initialize:function(t,e,i){this.x=0,this.y=0,this.z=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0)},up:function(){return this.x=0,this.y=1,this.z=0,this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clone:function(){return new s(this.x,this.y,this.z)},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},crossVectors:function(t,e){var i=t.x,s=t.y,r=t.z,n=e.x,a=e.y,o=e.z;return this.x=s*o-r*a,this.y=r*n-i*o,this.z=i*a-s*n,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this},set:function(t,e,i){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0),this},setFromMatrixPosition:function(t){return this.fromArray(t.val,12)},setFromMatrixColumn:function(t,e){return this.fromArray(t.val,4*e)},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addScale:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t):(this.x=0,this.y=0,this.z=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0;return Math.sqrt(e*e+i*i+s*s)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0;return e*e+i*i+s*s},length:function(){var t=this.x,e=this.y,i=this.z;return Math.sqrt(t*t+e*e+i*i)},lengthSq:function(){var t=this.x,e=this.y,i=this.z;return t*t+e*e+i*i},normalize:function(){var t=this.x,e=this.y,i=this.z,s=t*t+e*e+i*i;return s>0&&(s=1/Math.sqrt(s),this.x=t*s,this.y=e*s,this.z=i*s),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},cross:function(t){var e=this.x,i=this.y,s=this.z,r=t.x,n=t.y,a=t.z;return this.x=i*a-s*n,this.y=s*r-e*a,this.z=e*n-i*r,this},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,r=this.z;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this.z=r+e*(t.z-r),this},applyMatrix3:function(t){var e=this.x,i=this.y,s=this.z,r=t.val;return this.x=r[0]*e+r[3]*i+r[6]*s,this.y=r[1]*e+r[4]*i+r[7]*s,this.z=r[2]*e+r[5]*i+r[8]*s,this},applyMatrix4:function(t){var e=this.x,i=this.y,s=this.z,r=t.val,n=1/(r[3]*e+r[7]*i+r[11]*s+r[15]);return this.x=(r[0]*e+r[4]*i+r[8]*s+r[12])*n,this.y=(r[1]*e+r[5]*i+r[9]*s+r[13])*n,this.z=(r[2]*e+r[6]*i+r[10]*s+r[14])*n,this},transformMat3:function(t){var e=this.x,i=this.y,s=this.z,r=t.val;return this.x=e*r[0]+i*r[3]+s*r[6],this.y=e*r[1]+i*r[4]+s*r[7],this.z=e*r[2]+i*r[5]+s*r[8],this},transformMat4:function(t){var e=this.x,i=this.y,s=this.z,r=t.val;return this.x=r[0]*e+r[4]*i+r[8]*s+r[12],this.y=r[1]*e+r[5]*i+r[9]*s+r[13],this.z=r[2]*e+r[6]*i+r[10]*s+r[14],this},transformCoordinates:function(t){var e=this.x,i=this.y,s=this.z,r=t.val,n=e*r[0]+i*r[4]+s*r[8]+r[12],a=e*r[1]+i*r[5]+s*r[9]+r[13],o=e*r[2]+i*r[6]+s*r[10]+r[14],h=e*r[3]+i*r[7]+s*r[11]+r[15];return this.x=n/h,this.y=a/h,this.z=o/h,this},transformQuat:function(t){var e=this.x,i=this.y,s=this.z,r=t.x,n=t.y,a=t.z,o=t.w,h=o*e+n*s-a*i,l=o*i+a*e-r*s,u=o*s+r*i-n*e,d=-r*e-n*i-a*s;return this.x=h*o+d*-r+l*-a-u*-n,this.y=l*o+d*-n+u*-r-h*-a,this.z=u*o+d*-a+h*-n-l*-r,this},project:function(t){var e=this.x,i=this.y,s=this.z,r=t.val,n=r[0],a=r[1],o=r[2],h=r[3],l=r[4],u=r[5],d=r[6],c=r[7],f=r[8],p=r[9],g=r[10],m=r[11],v=r[12],y=r[13],x=r[14],T=1/(e*h+i*c+s*m+r[15]);return this.x=(e*n+i*l+s*f+v)*T,this.y=(e*a+i*u+s*p+y)*T,this.z=(e*o+i*d+s*g+x)*T,this},projectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unprojectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unproject:function(t,e){var i=t.x,s=t.y,r=t.z,n=t.w,a=this.x-i,o=n-this.y-1-s,h=this.z;return this.x=2*a/r-1,this.y=2*o/n-1,this.z=2*h-1,this.project(e)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});s.ZERO=new s,s.RIGHT=new s(1,0,0),s.LEFT=new s(-1,0,0),s.UP=new s(0,-1,0),s.DOWN=new s(0,1,0),s.FORWARD=new s(0,0,1),s.BACK=new s(0,0,-1),s.ONE=new s(1,1,1),t.exports=s},61369(t,e,i){var s=new(i(83419))({initialize:function(t,e,i,s){this.x=0,this.y=0,this.z=0,this.w=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=s||0)},clone:function(){return new s(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this.w=t.w||0,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},set:function(t,e,i,s){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=s||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this.w+=t.w||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this.w-=t.w||0,this},scale:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},length:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return Math.sqrt(t*t+e*e+i*i+s*s)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return t*t+e*e+i*i+s*s},normalize:function(){var t=this.x,e=this.y,i=this.z,s=this.w,r=t*t+e*e+i*i+s*s;return r>0&&(r=1/Math.sqrt(r),this.x=t*r,this.y=e*r,this.z=i*r,this.w=s*r),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,r=this.z,n=this.w;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this.z=r+e*(t.z-r),this.w=n+e*(t.w-n),this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this.w*=t.w||1,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this.w/=t.w||1,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0,r=t.w-this.w||0;return Math.sqrt(e*e+i*i+s*s+r*r)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0,r=t.w-this.w||0;return e*e+i*i+s*s+r*r},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},transformMat4:function(t){var e=this.x,i=this.y,s=this.z,r=this.w,n=t.val;return this.x=n[0]*e+n[4]*i+n[8]*s+n[12]*r,this.y=n[1]*e+n[5]*i+n[9]*s+n[13]*r,this.z=n[2]*e+n[6]*i+n[10]*s+n[14]*r,this.w=n[3]*e+n[7]*i+n[11]*s+n[15]*r,this},transformQuat:function(t){var e=this.x,i=this.y,s=this.z,r=t.x,n=t.y,a=t.z,o=t.w,h=o*e+n*s-a*i,l=o*i+a*e-r*s,u=o*s+r*i-n*e,d=-r*e-n*i-a*s;return this.x=h*o+d*-r+l*-a-u*-n,this.y=l*o+d*-n+u*-r-h*-a,this.z=u*o+d*-a+h*-n-l*-r,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});s.prototype.sub=s.prototype.subtract,s.prototype.mul=s.prototype.multiply,s.prototype.div=s.prototype.divide,s.prototype.dist=s.prototype.distance,s.prototype.distSq=s.prototype.distanceSq,s.prototype.len=s.prototype.length,s.prototype.lenSq=s.prototype.lengthSq,t.exports=s},60417(t){t.exports=function(t,e,i){return Math.abs(t-e)<=i}},15994(t,e,i){t.exports=i(68077).default},31040(t){t.exports=function(t,e,i,s){return Math.atan2(s-e,i-t)}},55495(t){t.exports=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}},128(t){t.exports=function(t,e){return Math.atan2(e.x-t.x,e.y-t.y)}},41273(t){t.exports=function(t,e,i,s){return Math.atan2(i-t,s-e)}},1432(t,e,i){var s=i(36383);t.exports=function(t){return t>Math.PI&&(t-=s.TAU),Math.abs(((t+s.PI_OVER_2)%s.TAU-s.TAU)%s.TAU)}},49127(t,e,i){var s=i(12407);t.exports=function(t,e){return s(e-t)}},52285(t,e,i){var s=i(36383),r=i(12407),n=s.TAU;t.exports=function(t,e){var i=r(e-t);return i>0&&(i-=n),i}},67317(t,e,i){var s=i(86554);t.exports=function(t,e){return s(e-t)}},12407(t){t.exports=function(t){return(t%=2*Math.PI)>=0?t:t+2*Math.PI}},53993(t,e,i){var s=i(99472);t.exports=function(){return s(-Math.PI,Math.PI)}},86564(t,e,i){var s=i(99472);t.exports=function(){return s(-180,180)}},90154(t,e,i){var s=i(12407);t.exports=function(t){return s(t+Math.PI)}},48736(t,e,i){var s=i(36383);t.exports=function(t,e,i){return void 0===i&&(i=.05),t===e||(Math.abs(e-t)<=i||Math.abs(e-t)>=s.TAU-i?t=e:(Math.abs(e-t)>Math.PI&&(et?t+=i:e=1?1:1/e*(1+(e*t|0))}},49752(t,e,i){t.exports=i(72251)},75698(t){t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.ceil(t-e)}},43855(t,e,i){t.exports=i(30010).default},25777(t){t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.floor(t+e)}},5470(t){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t>e-i}},94977(t){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t1?t[i]-(s(r-i,t[i],t[i],t[i-1],t[i-1])-t[i]):s(r-n,t[n?n-1:0],t[n],t[i1?s(t[i],t[i-1],i-r):s(t[n],t[n+1>i?i:n+1],r-n)}},32112(t){t.exports=function(t,e,i,s){return function(t,e){var i=1-t;return i*i*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,i)+function(t,e){return t*t*e}(t,s)}},47235(t,e,i){var s=i(7602);t.exports=function(t,e,i){return e+(i-e)*s(t,0,1)}},50178(t,e,i){var s=i(54261);t.exports=function(t,e,i){return e+(i-e)*s(t,0,1)}},38289(t,e,i){t.exports={Bezier:i(89318),CatmullRom:i(77259),CubicBezier:i(36316),Linear:i(28392),QuadraticBezier:i(32112),SmoothStep:i(47235),SmootherStep:i(50178)}},98439(t){t.exports=function(t){var e=Math.log(t)/.6931471805599453;return 1<0&&!(t&t-1)&&e>0&&!(e&e-1)}},81230(t){t.exports=function(t){return t>0&&!(t&t-1)}},49001(t,e,i){t.exports={GetNext:i(98439),IsSize:i(50030),IsValue:i(81230)}},28453(t,e,i){var s=new(i(83419))({initialize:function(t){void 0===t&&(t=[(Date.now()*Math.random()).toString()]),this.c=1,this.s0=0,this.s1=0,this.s2=0,this.n=0,this.signs=[-1,1],t&&this.init(t)},rnd:function(){var t=2091639*this.s0+2.3283064365386963e-10*this.c;return this.c=0|t,this.s0=this.s1,this.s1=this.s2,this.s2=t-this.c,this.s2},hash:function(t){var e,i=this.n;t=t.toString();for(var s=0;s>>0,i=(e*=i)>>>0,i+=4294967296*(e-=i);return this.n=i,2.3283064365386963e-10*(i>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e0;e--){var i=Math.floor(this.frac()*(e+1)),s=t[i];t[i]=t[e],t[e]=s}return t}});t.exports=s},63448(t){t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.ceil(t/e),s?(i+t)/e:i+t)}},56583(t){t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.floor(t/e),s?(i+t)/e:i+t)}},77720(t){t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.round(t/e),s?(i+t)/e:i+t)}},73697(t,e,i){t.exports={Ceil:i(63448),Floor:i(56583),To:i(77720)}},71289(t,e,i){var s=i(83419),r=i(92209),n=i(88571),a=new s({Extends:n,Mixins:[r.Acceleration,r.Angular,r.Bounce,r.Collision,r.Debug,r.Drag,r.Enable,r.Friction,r.Gravity,r.Immovable,r.Mass,r.Pushable,r.Size,r.Velocity],initialize:function(t,e,i,s,r){n.call(this,t,e,i,s,r),this.body=null}});t.exports=a},86689(t,e,i){var s=i(83419),r=i(39506),n=i(20339),a=i(89774),o=i(66022),h=i(95540),l=i(46975),u=i(72441),d=i(47956),c=i(37277),f=i(44594),p=i(26099),g=i(82248),m=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.config=this.getConfig(),this.world,this.add,this._category=1,t.sys.events.once(f.BOOT,this.boot,this),t.sys.events.on(f.START,this.start,this)},boot:function(){this.world=new g(this.scene,this.config),this.add=new o(this.world),this.systems.events.once(f.DESTROY,this.destroy,this)},start:function(){this.world||(this.world=new g(this.scene,this.config),this.add=new o(this.world));var t=this.systems.events;h(this.config,"customUpdate",!1)||t.on(f.UPDATE,this.world.update,this.world),t.on(f.POST_UPDATE,this.world.postUpdate,this.world),t.once(f.SHUTDOWN,this.shutdown,this)},enableUpdate:function(){this.systems.events.on(f.UPDATE,this.world.update,this.world)},disableUpdate:function(){this.systems.events.off(f.UPDATE,this.world.update,this.world)},getConfig:function(){var t=this.systems.game.config.physics,e=this.systems.settings.physics;return l(h(e,"arcade",{}),h(t,"arcade",{}))},nextCategory:function(){return this._category=this._category<<1,this._category},overlap:function(t,e,i,s,r){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===r&&(r=i),this.world.collideObjects(t,e,i,s,r,!0)},collide:function(t,e,i,s,r){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===r&&(r=i),this.world.collideObjects(t,e,i,s,r,!1)},collideTiles:function(t,e,i,s,r){return this.world.collideTiles(t,e,i,s,r)},overlapTiles:function(t,e,i,s,r){return this.world.overlapTiles(t,e,i,s,r)},pause:function(){return this.world.pause()},resume:function(){return this.world.resume()},accelerateTo:function(t,e,i,s,r,n){void 0===s&&(s=60);var a=Math.atan2(i-t.y,e-t.x);return t.body.acceleration.setToPolar(a,s),void 0!==r&&void 0!==n&&t.body.maxVelocity.set(r,n),a},accelerateToObject:function(t,e,i,s,r){return this.accelerateTo(t,e.x,e.y,i,s,r)},closest:function(t,e){e||(e=Array.from(this.world.bodies));for(var i=Number.MAX_VALUE,s=null,r=t.x,n=t.y,o=e.length,h=0;hi&&(s=l,i=d)}}return s},moveTo:function(t,e,i,s,r){void 0===s&&(s=60),void 0===r&&(r=0);var a=Math.atan2(i-t.y,e-t.x);return r>0&&(s=n(t.x,t.y,e,i)/(r/1e3)),t.body.velocity.setToPolar(a,s),a},moveToObject:function(t,e,i,s){return this.moveTo(t,e.x,e.y,i,s)},velocityFromAngle:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new p),i.setToPolar(r(t),e)},velocityFromRotation:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new p),i.setToPolar(t,e)},overlapRect:function(t,e,i,s,r,n){return d(this.world,t,e,i,s,r,n)},overlapCirc:function(t,e,i,s,r){return u(this.world,t,e,i,s,r)},shutdown:function(){if(this.world){var t=this.systems.events;t.off(f.UPDATE,this.world.update,this.world),t.off(f.POST_UPDATE,this.world.postUpdate,this.world),t.off(f.SHUTDOWN,this.shutdown,this),this.add.destroy(),this.world.destroy(),this.add=null,this.world=null,this._category=1}},destroy:function(){this.shutdown(),this.scene.sys.events.off(f.START,this.start,this),this.scene=null,this.systems=null}});c.register("ArcadePhysics",m,"arcadePhysics"),t.exports=m},13759(t,e,i){var s=i(83419),r=i(92209),n=i(68287),a=new s({Extends:n,Mixins:[r.Acceleration,r.Angular,r.Bounce,r.Collision,r.Debug,r.Drag,r.Enable,r.Friction,r.Gravity,r.Immovable,r.Mass,r.Pushable,r.Size,r.Velocity],initialize:function(t,e,i,s,r){n.call(this,t,e,i,s,r),this.body=null}});t.exports=a},37742(t,e,i){var s=i(83419),r=i(78389),n=i(37747),a=i(63012),o=i(43396),h=i(87841),l=i(37303),u=i(95829),d=i(26099),c=new s({Mixins:[r],initialize:function(t,e){var i=64,s=64,r=void 0!==e;r&&e.displayWidth&&(i=e.displayWidth,s=e.displayHeight),r||(e={x:0,y:0,angle:0,rotation:0,scaleX:1,scaleY:1,displayOriginX:0,displayOriginY:0}),this.world=t,this.gameObject=r?e:void 0,this.isBody=!0,this.transform={x:e.x,y:e.y,rotation:e.angle,scaleX:e.scaleX,scaleY:e.scaleY,displayOriginX:e.displayOriginX,displayOriginY:e.displayOriginY},this.debugShowBody=t.defaults.debugShowBody,this.debugShowVelocity=t.defaults.debugShowVelocity,this.debugBodyColor=t.defaults.bodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new d,this.position=new d(e.x-e.scaleX*e.displayOriginX,e.y-e.scaleY*e.displayOriginY),this.prev=this.position.clone(),this.prevFrame=this.position.clone(),this.allowRotation=!0,this.rotation=e.angle,this.preRotation=e.angle,this.width=i,this.height=s,this.sourceWidth=i,this.sourceHeight=s,e.frame&&(this.sourceWidth=e.frame.realWidth,this.sourceHeight=e.frame.realHeight),this.halfWidth=Math.abs(i/2),this.halfHeight=Math.abs(s/2),this.center=new d(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=new d,this.newVelocity=new d,this.deltaMax=new d,this.acceleration=new d,this.allowDrag=!0,this.drag=new d,this.allowGravity=!0,this.gravity=new d,this.bounce=new d,this.worldBounce=null,this.customBoundsRectangle=t.bounds,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.maxVelocity=new d(1e4,1e4),this.maxSpeed=-1,this.friction=new d(1,0),this.useDamping=!1,this.angularVelocity=0,this.angularAcceleration=0,this.angularDrag=0,this.maxAngular=1e3,this.mass=1,this.angle=0,this.speed=0,this.facing=n.FACING_NONE,this.immovable=!1,this.pushable=!0,this.slideFactor=new d(1,1),this.moves=!0,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision=u(!1),this.touching=u(!0),this.wasTouching=u(!0),this.blocked=u(!0),this.syncBounds=!1,this.physicsType=n.DYNAMIC_BODY,this.collisionCategory=1,this.collisionMask=1,this._sx=e.scaleX,this._sy=e.scaleY,this._dx=0,this._dy=0,this._tx=0,this._ty=0,this._bounds=new h,this.directControl=!1,this.autoFrame=this.position.clone()},updateBounds:function(){var t=this.gameObject,e=this.transform;if(t.parentContainer){var i=t.getWorldTransformMatrix(this.world._tempMatrix,this.world._tempMatrix2);e.x=i.tx,e.y=i.ty,e.rotation=o(i.rotation),e.scaleX=i.scaleX,e.scaleY=i.scaleY,e.displayOriginX=t.displayOriginX,e.displayOriginY=t.displayOriginY}else e.x=t.x,e.y=t.y,e.rotation=t.angle,e.scaleX=t.scaleX,e.scaleY=t.scaleY,e.displayOriginX=t.displayOriginX,e.displayOriginY=t.displayOriginY;var s=!1;if(this.syncBounds){var r=t.getBounds(this._bounds);this.width=r.width,this.height=r.height,s=!0}else{var n=Math.abs(e.scaleX),a=Math.abs(e.scaleY);this._sx===n&&this._sy===a||(this.width=this.sourceWidth*n,this.height=this.sourceHeight*a,this._sx=n,this._sy=a,s=!0)}s&&(this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter())},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},updateFromGameObject:function(){this.updateBounds();var t=this.transform;this.position.x=t.x+t.scaleX*(this.offset.x-t.displayOriginX),this.position.y=t.y+t.scaleY*(this.offset.y-t.displayOriginY),this.updateCenter()},resetFlags:function(t){void 0===t&&(t=!1);var e=this.wasTouching,i=this.touching,s=this.blocked;t?u(!0,e):(e.none=i.none,e.up=i.up,e.down=i.down,e.left=i.left,e.right=i.right),u(!0,i),u(!0,s),this.overlapR=0,this.overlapX=0,this.overlapY=0,this.embedded=!1},preUpdate:function(t,e){if(t&&this.resetFlags(),this.gameObject&&this.updateFromGameObject(),this.rotation=this.transform.rotation,this.preRotation=this.rotation,this.moves){var i=this.position;this.prev.x=i.x,this.prev.y=i.y,this.prevFrame.x=i.x,this.prevFrame.y=i.y}t&&this.update(e)},update:function(t){var e=this.prev,i=this.position,s=this.velocity;if(e.set(i.x,i.y),!this.moves)return this._dx=i.x-e.x,void(this._dy=i.y-e.y);if(this.directControl){var r=this.autoFrame;s.set((i.x-r.x)/t,(i.y-r.y)/t),this.world.updateMotion(this,t),this._dx=i.x-r.x,this._dy=i.y-r.y}else this.world.updateMotion(this,t),this.newVelocity.set(s.x*t,s.y*t),i.add(this.newVelocity),this._dx=i.x-e.x,this._dy=i.y-e.y;var n=s.x,o=s.y;if(this.updateCenter(),this.angle=Math.atan2(o,n),this.speed=Math.sqrt(n*n+o*o),this.collideWorldBounds&&this.checkWorldBounds()&&this.onWorldBounds){var h=this.blocked;this.world.emit(a.WORLD_BOUNDS,this,h.up,h.down,h.left,h.right)}},postUpdate:function(){var t=this.position,e=t.x-this.prevFrame.x,i=t.y-this.prevFrame.y,s=this.gameObject;if(this.moves){var r=this.deltaMax.x,a=this.deltaMax.y;0!==r&&0!==e&&(e<0&&e<-r?e=-r:e>0&&e>r&&(e=r)),0!==a&&0!==i&&(i<0&&i<-a?i=-a:i>0&&i>a&&(i=a)),s&&(s.x+=e,s.y+=i)}e<0?this.facing=n.FACING_LEFT:e>0&&(this.facing=n.FACING_RIGHT),i<0?this.facing=n.FACING_UP:i>0&&(this.facing=n.FACING_DOWN),this.allowRotation&&s&&(s.angle+=this.deltaZ()),this._tx=e,this._ty=i,this.autoFrame.set(t.x,t.y)},setBoundsRectangle:function(t){return this.customBoundsRectangle=t||this.world.bounds,this},checkWorldBounds:function(){var t=this.position,e=this.velocity,i=this.blocked,s=this.customBoundsRectangle,r=this.world.checkCollision,n=this.worldBounce?-this.worldBounce.x:-this.bounce.x,a=this.worldBounce?-this.worldBounce.y:-this.bounce.y,o=!1;return t.xs.right&&r.right&&(t.x=s.right-this.width,e.x*=n,i.right=!0,o=!0),t.ys.bottom&&r.down&&(t.y=s.bottom-this.height,e.y*=a,i.down=!0,o=!0),o&&(this.blocked.none=!1,this.updateCenter()),o},setOffset:function(t,e){return void 0===e&&(e=t),this.offset.set(t,e),this},setGameObject:function(t,e){if(void 0===e&&(e=!0),!t||!t.hasTransformComponent)return this;var i=this.world;return this.gameObject&&this.gameObject.body&&(i.disable(this.gameObject),this.gameObject.body=null),t.body&&i.disable(t),this.gameObject=t,t.body=this,this.setSize(),this.enable=e,this},setSize:function(t,e,i){void 0===i&&(i=!0);var s=this.gameObject;if(s&&(!t&&s.frame&&(t=s.frame.realWidth),!e&&s.frame&&(e=s.frame.realHeight)),this.sourceWidth=t,this.sourceHeight=e,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter(),i&&s&&s.getCenter){var r=(s.width-t)/2,n=(s.height-e)/2;this.offset.set(r,n)}return this.isCircle=!1,this.radius=0,this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.isCircle=!0,this.radius=t,this.sourceWidth=2*t,this.sourceHeight=2*t,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter()):this.isCircle=!1,this},reset:function(t,e){this.stop();var i=this.gameObject;i&&(i.setPosition(t,e),this.rotation=i.angle,this.preRotation=i.angle);var s=this.position;i&&i.getTopLeft?i.getTopLeft(s):s.set(t,e),this.prev.copy(s),this.prevFrame.copy(s),this.autoFrame.copy(s),i&&this.updateBounds(),this.updateCenter(),this.collideWorldBounds&&this.checkWorldBounds(),this.resetFlags(!0)},stop:function(){return this.velocity.set(0),this.acceleration.set(0),this.speed=0,this.angularVelocity=0,this.angularAcceleration=0,this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?this.radius>0&&t>=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom&&(this.center.x-t)*(this.center.x-t)+(this.center.y-e)*(this.center.y-e)<=this.radius*this.radius:l(this,t,e)},onFloor:function(){return this.blocked.down},onCeiling:function(){return this.blocked.up},onWall:function(){return this.blocked.left||this.blocked.right},deltaAbsX:function(){return this._dx>0?this._dx:-this._dx},deltaAbsY:function(){return this._dy>0?this._dy:-this._dy},deltaX:function(){return this._dx},deltaY:function(){return this._dy},deltaXFinal:function(){return this._tx},deltaYFinal:function(){return this._ty},deltaZ:function(){return this.rotation-this.preRotation},destroy:function(){this.enable=!1,this.world&&this.world.pendingDestroy.add(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,s=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(t.defaultStrokeWidth,this.debugBodyColor),this.isCircle?t.strokeCircle(i,s,this.width/2):(this.checkCollision.up&&t.lineBetween(e.x,e.y,e.x+this.width,e.y),this.checkCollision.right&&t.lineBetween(e.x+this.width,e.y,e.x+this.width,e.y+this.height),this.checkCollision.down&&t.lineBetween(e.x,e.y+this.height,e.x+this.width,e.y+this.height),this.checkCollision.left&&t.lineBetween(e.x,e.y,e.x,e.y+this.height))),this.debugShowVelocity&&(t.lineStyle(t.defaultStrokeWidth,this.world.defaults.velocityDebugColor,1),t.lineBetween(i,s,i+this.velocity.x/2,s+this.velocity.y/2))},willDrawDebug:function(){return this.debugShowBody||this.debugShowVelocity},setDirectControl:function(t){return void 0===t&&(t=!0),this.directControl=t,this},setCollideWorldBounds:function(t,e,i,s){void 0===t&&(t=!0),this.collideWorldBounds=t;var r=void 0!==e,n=void 0!==i;return(r||n)&&(this.worldBounce||(this.worldBounce=new d),r&&(this.worldBounce.x=e),n&&(this.worldBounce.y=i)),void 0!==s&&(this.onWorldBounds=s),this},setVelocity:function(t,e){return this.velocity.set(t,e),t=this.velocity.x,e=this.velocity.y,this.speed=Math.sqrt(t*t+e*e),this},setVelocityX:function(t){return this.setVelocity(t,this.velocity.y)},setVelocityY:function(t){return this.setVelocity(this.velocity.x,t)},setMaxVelocity:function(t,e){return this.maxVelocity.set(t,e),this},setMaxVelocityX:function(t){return this.maxVelocity.x=t,this},setMaxVelocityY:function(t){return this.maxVelocity.y=t,this},setMaxSpeed:function(t){return this.maxSpeed=t,this},setSlideFactor:function(t,e){return this.slideFactor.set(t,e),this},setBounce:function(t,e){return this.bounce.set(t,e),this},setBounceX:function(t){return this.bounce.x=t,this},setBounceY:function(t){return this.bounce.y=t,this},setAcceleration:function(t,e){return this.acceleration.set(t,e),this},setAccelerationX:function(t){return this.acceleration.x=t,this},setAccelerationY:function(t){return this.acceleration.y=t,this},setAllowDrag:function(t){return void 0===t&&(t=!0),this.allowDrag=t,this},setAllowGravity:function(t){return void 0===t&&(t=!0),this.allowGravity=t,this},setAllowRotation:function(t){return void 0===t&&(t=!0),this.allowRotation=t,this},setDrag:function(t,e){return this.drag.set(t,e),this},setDamping:function(t){return this.useDamping=t,this},setDragX:function(t){return this.drag.x=t,this},setDragY:function(t){return this.drag.y=t,this},setGravity:function(t,e){return this.gravity.set(t,e),this},setGravityX:function(t){return this.gravity.x=t,this},setGravityY:function(t){return this.gravity.y=t,this},setFriction:function(t,e){return this.friction.set(t,e),this},setFrictionX:function(t){return this.friction.x=t,this},setFrictionY:function(t){return this.friction.y=t,this},setAngularVelocity:function(t){return this.angularVelocity=t,this},setAngularAcceleration:function(t){return this.angularAcceleration=t,this},setAngularDrag:function(t){return this.angularDrag=t,this},setMass:function(t){return this.mass=t,this},setImmovable:function(t){return void 0===t&&(t=!0),this.immovable=t,this},setEnable:function(t){return void 0===t&&(t=!0),this.enable=t,this},processX:function(t,e,i,s){this.x+=t,this.updateCenter(),null!==e&&(this.velocity.x=e*this.slideFactor.x);var r=this.blocked;i&&(r.left=!0,r.none=!1),s&&(r.right=!0,r.none=!1)},processY:function(t,e,i,s){this.y+=t,this.updateCenter(),null!==e&&(this.velocity.y=e*this.slideFactor.y);var r=this.blocked;i&&(r.up=!0,r.none=!1),s&&(r.down=!0,r.none=!1)},x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=c},79342(t,e,i){var s=new(i(83419))({initialize:function(t,e,i,s,r,n,a){this.world=t,this.name="",this.active=!0,this.overlapOnly=e,this.object1=i,this.object2=s,this.collideCallback=r,this.processCallback=n,this.callbackContext=a},setName:function(t){return this.name=t,this},update:function(){this.world.collideObjects(this.object1,this.object2,this.collideCallback,this.processCallback,this.callbackContext,this.overlapOnly)},destroy:function(){this.world.removeCollider(this),this.active=!1,this.world=null,this.object1=null,this.object2=null,this.collideCallback=null,this.processCallback=null,this.callbackContext=null}});t.exports=s},66022(t,e,i){var s=i(71289),r=i(13759),n=i(37742),a=i(83419),o=i(37747),h=i(60758),l=i(72624),u=i(71464),d=new a({initialize:function(t){this.world=t,this.scene=t.scene,this.sys=t.scene.sys},collider:function(t,e,i,s,r){return this.world.addCollider(t,e,i,s,r)},overlap:function(t,e,i,s,r){return this.world.addOverlap(t,e,i,s,r)},existing:function(t,e){var i=e?o.STATIC_BODY:o.DYNAMIC_BODY;return this.world.enableBody(t,i),t},staticImage:function(t,e,i,r){var n=new s(this.scene,t,e,i,r);return this.sys.displayList.add(n),this.world.enableBody(n,o.STATIC_BODY),n},image:function(t,e,i,r){var n=new s(this.scene,t,e,i,r);return this.sys.displayList.add(n),this.world.enableBody(n,o.DYNAMIC_BODY),n},staticSprite:function(t,e,i,s){var n=new r(this.scene,t,e,i,s);return this.sys.displayList.add(n),this.sys.updateList.add(n),this.world.enableBody(n,o.STATIC_BODY),n},sprite:function(t,e,i,s){var n=new r(this.scene,t,e,i,s);return this.sys.displayList.add(n),this.sys.updateList.add(n),this.world.enableBody(n,o.DYNAMIC_BODY),n},staticGroup:function(t,e){return this.sys.updateList.add(new u(this.world,this.world.scene,t,e))},group:function(t,e){return this.sys.updateList.add(new h(this.world,this.world.scene,t,e))},body:function(t,e,i,s){var r=new n(this.world);return r.position.set(t,e),i&&s&&r.setSize(i,s),this.world.add(r,o.DYNAMIC_BODY),r},staticBody:function(t,e,i,s){var r=new l(this.world);return r.position.set(t,e),i&&s&&r.setSize(i,s),this.world.add(r,o.STATIC_BODY),r},destroy:function(){this.world=null,this.scene=null,this.sys=null}});t.exports=d},79599(t){t.exports=function(t){var e=0;if(Array.isArray(t))for(var i=0;ie._dx?(n=t.right-e.x)>a&&!i||!1===t.checkCollision.right||!1===e.checkCollision.left?n=0:(t.touching.none=!1,t.touching.right=!0,e.touching.none=!1,e.touching.left=!0,e.physicsType!==s.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.right=!0),t.physicsType!==s.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.left=!0)):t._dxa&&!i||!1===t.checkCollision.left||!1===e.checkCollision.right?n=0:(t.touching.none=!1,t.touching.left=!0,e.touching.none=!1,e.touching.right=!0,e.physicsType!==s.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.left=!0),t.physicsType!==s.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.right=!0))),t.overlapX=n,e.overlapX=n,n}},45170(t,e,i){var s=i(37747);t.exports=function(t,e,i,r){var n=0,a=t.deltaAbsY()+e.deltaAbsY()+r;return 0===t._dy&&0===e._dy?(t.embedded=!0,e.embedded=!0):t._dy>e._dy?(n=t.bottom-e.y)>a&&!i||!1===t.checkCollision.down||!1===e.checkCollision.up?n=0:(t.touching.none=!1,t.touching.down=!0,e.touching.none=!1,e.touching.up=!0,e.physicsType!==s.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.down=!0),t.physicsType!==s.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.up=!0)):t._dya&&!i||!1===t.checkCollision.up||!1===e.checkCollision.down?n=0:(t.touching.none=!1,t.touching.up=!0,e.touching.none=!1,e.touching.down=!0,e.physicsType!==s.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.up=!0),t.physicsType!==s.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.down=!0))),t.overlapY=n,e.overlapY=n,n}},60758(t,e,i){var s=i(13759),r=i(83419),n=i(78389),a=i(37747),o=i(95540),h=i(26479),l=i(41212),u=new r({Extends:h,Mixins:[n],initialize:function(t,e,i,r){if(i||r)if(l(i))r=i,i=null,r.internalCreateCallback=this.createCallbackHandler,r.internalRemoveCallback=this.removeCallbackHandler;else if(Array.isArray(i)&&l(i[0])){var n=this;i.forEach(function(t){t.internalCreateCallback=n.createCallbackHandler,t.internalRemoveCallback=n.removeCallbackHandler,t.classType=o(t,"classType",s)}),r=null}else r={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler};else r={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler};this.world=t,r&&(r.classType=o(r,"classType",s)),this.physicsType=a.DYNAMIC_BODY,this.collisionCategory=1,this.collisionMask=2147483647,this.defaults={setCollideWorldBounds:o(r,"collideWorldBounds",!1),setBoundsRectangle:o(r,"customBoundsRectangle",null),setAccelerationX:o(r,"accelerationX",0),setAccelerationY:o(r,"accelerationY",0),setAllowDrag:o(r,"allowDrag",!0),setAllowGravity:o(r,"allowGravity",!0),setAllowRotation:o(r,"allowRotation",!0),setDamping:o(r,"useDamping",!1),setBounceX:o(r,"bounceX",0),setBounceY:o(r,"bounceY",0),setDragX:o(r,"dragX",0),setDragY:o(r,"dragY",0),setEnable:o(r,"enable",!0),setGravityX:o(r,"gravityX",0),setGravityY:o(r,"gravityY",0),setFrictionX:o(r,"frictionX",0),setFrictionY:o(r,"frictionY",0),setMaxSpeed:o(r,"maxSpeed",-1),setMaxVelocityX:o(r,"maxVelocityX",1e4),setMaxVelocityY:o(r,"maxVelocityY",1e4),setVelocityX:o(r,"velocityX",0),setVelocityY:o(r,"velocityY",0),setAngularVelocity:o(r,"angularVelocity",0),setAngularAcceleration:o(r,"angularAcceleration",0),setAngularDrag:o(r,"angularDrag",0),setMass:o(r,"mass",1),setImmovable:o(r,"immovable",!1)},h.call(this,e,i,r),this.type="PhysicsGroup"},createCallbackHandler:function(t){t.body&&t.body.physicsType===a.DYNAMIC_BODY||(t.body&&(t.body.destroy(),t.body=null),this.world.enableBody(t,a.DYNAMIC_BODY));var e=t.body;for(var i in this.defaults)e[i](this.defaults[i])},removeCallbackHandler:function(t){t.body&&this.world.disableBody(t)},setVelocity:function(t,e,i){void 0===i&&(i=0);for(var s=this.getChildren(),r=0;r0?1:-1),o=Math.sqrt(t*t*e.mass/i.mass)*(t>0?1:-1),h=.5*(r+o);return o-=h,n=h+(r-=h)*e.bounce.x,a=h+o*i.bounce.x,l&&m?x(0):c&&g?x(1):u&&g?x(2):!(!f||!m)&&x(3)},Set:function(t,n,a){i=n;var x=(e=t).velocity.x,T=i.velocity.x;return s=e.pushable,l=e._dx<0,u=e._dx>0,d=0===e._dx,g=Math.abs(e.right-i.x)<=Math.abs(i.right-e.x),o=T-x*e.bounce.x,r=i.pushable,c=i._dx<0,f=i._dx>0,p=0===i._dx,m=!g,h=x-T*i.bounce.x,v=Math.abs(a),y()},Run:x,RunImmovableBody1:function(t){if(1===t?i.velocity.x=0:g?i.processX(v,h,!0):i.processX(-v,h,!1,!0),e.moves){var s=e.directControl?e.y-e.autoFrame.y:e.y-e.prev.y;i.y+=s*e.friction.y,i._dy=i.y-i.prev.y}},RunImmovableBody2:function(t){if(2===t?e.velocity.x=0:m?e.processX(v,o,!0):e.processX(-v,o,!1,!0),i.moves){var s=i.directControl?i.y-i.autoFrame.y:i.y-i.prev.y;e.y+=s*i.friction.y,e._dy=e.y-e.prev.y}}}},47962(t){var e,i,s,r,n,a,o,h,l,u,d,c,f,p,g,m,v,y=function(){return u&&g&&i.blocked.down?(e.processY(-v,o,!1,!0),1):l&&m&&i.blocked.up?(e.processY(v,o,!0),1):f&&m&&e.blocked.down?(i.processY(-v,h,!1,!0),2):c&&g&&e.blocked.up?(i.processY(v,h,!0),2):0},x=function(t){if(s&&r)v*=.5,0===t||3===t?(e.processY(v,n),i.processY(-v,a)):(e.processY(-v,n),i.processY(v,a));else if(s&&!r)0===t||3===t?e.processY(v,o,!0):e.processY(-v,o,!1,!0);else if(!s&&r)0===t||3===t?i.processY(-v,h,!1,!0):i.processY(v,h,!0);else{var g=.5*v;0===t?p?(e.processY(v,0,!0),i.processY(0,null,!1,!0)):f?(e.processY(g,0,!0),i.processY(-g,0,!1,!0)):(e.processY(g,i.velocity.y,!0),i.processY(-g,null,!1,!0)):1===t?d?(e.processY(0,null,!1,!0),i.processY(v,0,!0)):u?(e.processY(-g,0,!1,!0),i.processY(g,0,!0)):(e.processY(-g,null,!1,!0),i.processY(g,e.velocity.y,!0)):2===t?p?(e.processY(-v,0,!1,!0),i.processY(0,null,!0)):c?(e.processY(-g,0,!1,!0),i.processY(g,0,!0)):(e.processY(-g,i.velocity.y,!1,!0),i.processY(g,null,!0)):3===t&&(d?(e.processY(0,null,!0),i.processY(-v,0,!1,!0)):l?(e.processY(g,0,!0),i.processY(-g,0,!1,!0)):(e.processY(g,i.velocity.y,!0),i.processY(-g,null,!1,!0)))}return!0};t.exports={BlockCheck:y,Check:function(){var t=e.velocity.y,s=i.velocity.y,r=Math.sqrt(s*s*i.mass/e.mass)*(s>0?1:-1),o=Math.sqrt(t*t*e.mass/i.mass)*(t>0?1:-1),h=.5*(r+o);return o-=h,n=h+(r-=h)*e.bounce.y,a=h+o*i.bounce.y,l&&m?x(0):c&&g?x(1):u&&g?x(2):!(!f||!m)&&x(3)},Set:function(t,n,a){i=n;var x=(e=t).velocity.y,T=i.velocity.y;return s=e.pushable,l=e._dy<0,u=e._dy>0,d=0===e._dy,g=Math.abs(e.bottom-i.y)<=Math.abs(i.bottom-e.y),o=T-x*e.bounce.y,r=i.pushable,c=i._dy<0,f=i._dy>0,p=0===i._dy,m=!g,h=x-T*i.bounce.y,v=Math.abs(a),y()},Run:x,RunImmovableBody1:function(t){if(1===t?i.velocity.y=0:g?i.processY(v,h,!0):i.processY(-v,h,!1,!0),e.moves){var s=e.directControl?e.x-e.autoFrame.x:e.x-e.prev.x;i.x+=s*e.friction.x,i._dx=i.x-i.prev.x}},RunImmovableBody2:function(t){if(2===t?e.velocity.y=0:m?e.processY(v,o,!0):e.processY(-v,o,!1,!0),i.moves){var s=i.directControl?i.x-i.autoFrame.x:i.x-i.prev.x;e.x+=s*i.friction.x,e._dx=e.x-e.prev.x}}}},14087(t,e,i){var s=i(64897),r=i(3017);t.exports=function(t,e,i,n,a){void 0===a&&(a=s(t,e,i,n));var o=t.immovable,h=e.immovable;if(i||0===a||o&&h||t.customSeparateX||e.customSeparateX)return 0!==a||t.embedded&&e.embedded;var l=r.Set(t,e,a);return o||h?(o?r.RunImmovableBody1(l):h&&r.RunImmovableBody2(l),!0):l>0||r.Check()}},89936(t,e,i){var s=i(45170),r=i(47962);t.exports=function(t,e,i,n,a){void 0===a&&(a=s(t,e,i,n));var o=t.immovable,h=e.immovable;if(i||0===a||o&&h||t.customSeparateY||e.customSeparateY)return 0!==a||t.embedded&&e.embedded;var l=r.Set(t,e,a);return o||h?(o?r.RunImmovableBody1(l):h&&r.RunImmovableBody2(l),!0):l>0||r.Check()}},95829(t){t.exports=function(t,e){return void 0===e&&(e={}),e.none=t,e.up=!1,e.down=!1,e.left=!1,e.right=!1,t||(e.up=!0,e.down=!0,e.left=!0,e.right=!0),e}},72624(t,e,i){var s=i(87902),r=i(83419),n=i(78389),a=i(37747),o=i(37303),h=i(95829),l=i(26099),u=new r({Mixins:[n],initialize:function(t,e){var i=64,s=64,r=void 0!==e;r&&e.displayWidth&&(i=e.displayWidth,s=e.displayHeight),r||(e={x:0,y:0,angle:0,rotation:0,scaleX:1,scaleY:1,displayOriginX:0,displayOriginY:0}),this.world=t,this.gameObject=r?e:void 0,this.isBody=!0,this.debugShowBody=t.defaults.debugShowStaticBody,this.debugBodyColor=t.defaults.staticBodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new l,this.position=new l(e.x-i*e.originX,e.y-s*e.originY),this.width=i,this.height=s,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center=new l(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=l.ZERO,this.allowGravity=!1,this.gravity=l.ZERO,this.bounce=l.ZERO,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.mass=1,this.immovable=!0,this.pushable=!1,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision=h(!1),this.touching=h(!0),this.wasTouching=h(!0),this.blocked=h(!0),this.physicsType=a.STATIC_BODY,this.collisionCategory=1,this.collisionMask=1,this._dx=0,this._dy=0},setGameObject:function(t,e,i){if(void 0===e&&(e=!0),void 0===i&&(i=!0),!t||!t.hasTransformComponent)return this;var s=this.world;return this.gameObject&&this.gameObject.body&&(s.disable(this.gameObject),this.gameObject.body=null),t.body&&s.disable(t),this.gameObject=t,t.body=this,this.setSize(),e&&this.updateFromGameObject(),this.enable=i,this},updateFromGameObject:function(){this.world.staticTree.remove(this);var t=this.gameObject;return t.getTopLeft(this.position),this.width=t.displayWidth,this.height=t.displayHeight,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.world.staticTree.insert(this),this},setOffset:function(t,e){return void 0===e&&(e=t),this.world.staticTree.remove(this),this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(t,e),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this),this},setSize:function(t,e,i){void 0===i&&(i=!0);var s=this.gameObject;if(s&&s.frame&&(t||(t=s.frame.realWidth),e||(e=s.frame.realHeight)),this.world.staticTree.remove(this),this.width=t,this.height=e,this.halfWidth=Math.floor(t/2),this.halfHeight=Math.floor(e/2),i&&s&&s.getCenter){var r=s.displayWidth/2,n=s.displayHeight/2;this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(r-this.halfWidth,n-this.halfHeight),this.position.x+=this.offset.x,this.position.y+=this.offset.y}return this.updateCenter(),this.isCircle=!1,this.radius=0,this.world.staticTree.insert(this),this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.world.staticTree.remove(this),this.isCircle=!0,this.radius=t,this.width=2*t,this.height=2*t,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter(),this.world.staticTree.insert(this)):this.isCircle=!1,this},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},reset:function(t,e){var i=this.gameObject;void 0===t&&(t=i.x),void 0===e&&(e=i.y),this.world.staticTree.remove(this),i.setPosition(t,e),i.getTopLeft(this.position),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this)},stop:function(){return this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?s(this,t,e):o(this,t,e)},postUpdate:function(){},deltaAbsX:function(){return 0},deltaAbsY:function(){return 0},deltaX:function(){return 0},deltaY:function(){return 0},deltaZ:function(){return 0},destroy:function(){this.enable=!1,this.world.pendingDestroy.add(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,s=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(t.defaultStrokeWidth,this.debugBodyColor,1),this.isCircle?t.strokeCircle(i,s,this.width/2):t.strokeRect(e.x,e.y,this.width,this.height))},willDrawDebug:function(){return this.debugShowBody},setMass:function(t){return t<=0&&(t=.1),this.mass=t,this},x:{get:function(){return this.position.x},set:function(t){this.world.staticTree.remove(this),this.position.x=t,this.world.staticTree.insert(this)}},y:{get:function(){return this.position.y},set:function(t){this.world.staticTree.remove(this),this.position.y=t,this.world.staticTree.insert(this)}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=u},71464(t,e,i){var s=i(13759),r=i(83419),n=i(78389),a=i(37747),o=i(95540),h=i(26479),l=i(41212),u=new r({Extends:h,Mixins:[n],initialize:function(t,e,i,r){i||r?l(i)?(r=i,i=null,r.internalCreateCallback=this.createCallbackHandler,r.internalRemoveCallback=this.removeCallbackHandler,r.createMultipleCallback=this.createMultipleCallbackHandler,r.classType=o(r,"classType",s)):Array.isArray(i)&&l(i[0])?(r=i,i=null,r.forEach(function(t){t.internalCreateCallback=this.createCallbackHandler,t.internalRemoveCallback=this.removeCallbackHandler,t.createMultipleCallback=this.createMultipleCallbackHandler,t.classType=o(t,"classType",s)},this)):r={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler}:r={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler,createMultipleCallback:this.createMultipleCallbackHandler,classType:s},this.world=t,this.physicsType=a.STATIC_BODY,this.collisionCategory=1,this.collisionMask=1,h.call(this,e,i,r),this.type="StaticPhysicsGroup"},createCallbackHandler:function(t){t.body&&t.body.physicsType===a.STATIC_BODY||(t.body&&(t.body.destroy(),t.body=null),this.world.enableBody(t,a.STATIC_BODY))},removeCallbackHandler:function(t){t.body&&this.world.disableBody(t)},createMultipleCallbackHandler:function(){this.refresh()},refresh:function(){for(var t=Array.from(this.children),e=0;e=s;if(this.fixedStep||(i=.001*e,n=!0,this._elapsed=0),r.forEach(function(t){t.enable&&t.preUpdate(n,i)}),n){this._elapsed-=s,this.stepsLastFrame=1,this.useTree&&(this.tree.clear(),this.tree.load(Array.from(r)));for(var a=this.colliders.update(),o=0;o=s;)this._elapsed-=s,this.step(i)}},step:function(t){var e=this.bodies;e.forEach(function(e){e.enable&&e.update(t)}),this.useTree&&(this.tree.clear(),this.tree.load(Array.from(e)));for(var i=this.colliders.update(),s=0;s0){var r=this.tree,n=this.staticTree;s.forEach(function(i){i.physicsType===h.DYNAMIC_BODY?(r.remove(i),t.delete(i)):i.physicsType===h.STATIC_BODY&&(n.remove(i),e.delete(i)),i.world=void 0,i.gameObject=void 0}),s.clear()}},updateMotion:function(t,e){t.allowRotation&&this.computeAngularVelocity(t,e),this.computeVelocity(t,e)},computeAngularVelocity:function(t,e){var i=t.angularVelocity,s=t.angularAcceleration,r=t.angularDrag,a=t.maxAngular;s?i+=s*e:t.allowDrag&&r&&(p(i-(r*=e),0,.1)?i-=r:g(i+r,0,.1)?i+=r:i=0);var o=(i=n(i,-a,a))-t.angularVelocity;t.angularVelocity+=o,t.rotation+=t.angularVelocity*e},computeVelocity:function(t,e){var i=t.velocity.x,s=t.acceleration.x,r=t.drag.x,a=t.maxVelocity.x,o=t.velocity.y,h=t.acceleration.y,l=t.drag.y,u=t.maxVelocity.y,d=t.speed,c=t.maxSpeed,m=t.allowDrag,v=t.useDamping;t.allowGravity&&(i+=(this.gravity.x+t.gravity.x)*e,o+=(this.gravity.y+t.gravity.y)*e),s?i+=s*e:m&&r&&(v?(i*=r=Math.pow(r,e),d=Math.sqrt(i*i+o*o),f(d,0,.001)&&(i=0)):p(i-(r*=e),0,.01)?i-=r:g(i+r,0,.01)?i+=r:i=0),h?o+=h*e:m&&l&&(v?(o*=l=Math.pow(l,e),d=Math.sqrt(i*i+o*o),f(d,0,.001)&&(o=0)):p(o-(l*=e),0,.01)?o-=l:g(o+l,0,.01)?o+=l:o=0),i=n(i,-a,a),o=n(o,-u,u),t.velocity.set(i,o),c>-1&&t.velocity.length()>c&&(t.velocity.normalize().scale(c),d=c),t.speed=d},separate:function(t,e,i,s,r){var n,a,o=!1,h=!0;if(!t.enable||!e.enable||t.checkCollision.none||e.checkCollision.none||!this.intersects(t,e)||0===(t.collisionMask&e.collisionCategory)||0===(e.collisionMask&t.collisionCategory))return o;if(i&&!1===i.call(s,t.gameObject||t,e.gameObject||e))return o;if(t.isCircle||e.isCircle){var l=this.separateCircle(t,e,r);l.result?(o=!0,h=!1):(n=l.x,a=l.y,h=!0)}if(h){var u=!1,d=!1,f=this.OVERLAP_BIAS;r?(u=A(t,e,r,f,n),d=_(t,e,r,f,a)):this.forceX||Math.abs(this.gravity.y+t.gravity.y)C&&(p=l(y,x,C,S)-w):x>E&&(yC&&(p=l(y,x,C,E)-w)),p*=-1}else p=t.halfWidth+e.halfWidth-u(a,o);t.overlapR=p,e.overlapR=p;var A=s(a,o),_=(p+T.EPSILON)*Math.cos(A),M=(p+T.EPSILON)*Math.sin(A),R={overlap:p,result:!1,x:_,y:M};if(i&&(!g||g&&0!==p))return R.result=!0,R;if(!g&&0===p||h&&d||t.customSeparateX||e.customSeparateX)return R.x=void 0,R.y=void 0,R;var P=!t.pushable&&!e.pushable;if(g){var O=a.x-o.x,L=a.y-o.y,D=Math.sqrt(Math.pow(O,2)+Math.pow(L,2)),F=(o.x-a.x)/D||0,I=(o.y-a.y)/D||0,N=2*(c.x*F+c.y*I-f.x*F-f.y*I)/(t.mass+e.mass);!h&&!d&&t.pushable&&e.pushable||(N*=2),!h&&t.pushable&&(c.x=c.x-N/t.mass*F,c.y=c.y-N/t.mass*I,c.multiply(t.bounce)),!d&&e.pushable&&(f.x=f.x+N/e.mass*F,f.y=f.y+N/e.mass*I,f.multiply(e.bounce)),h||d||(_*=.5,M*=.5),(!h||t.pushable||P)&&(t.x-=_,t.y-=M,t.updateCenter()),(!d||e.pushable||P)&&(e.x+=_,e.y+=M,e.updateCenter()),R.result=!0}else h||!t.pushable&&!P||(t.x-=_,t.y-=M,t.updateCenter()),(!d||e.pushable||P)&&(e.x+=_,e.y+=M,e.updateCenter()),R.x=void 0,R.y=void 0;return R},intersects:function(t,e){return t!==e&&(t.isCircle||e.isCircle?t.isCircle?e.isCircle?u(t.center,e.center)<=t.halfWidth+e.halfWidth:this.circleBodyIntersects(t,e):this.circleBodyIntersects(e,t):!(t.right<=e.left||t.bottom<=e.top||t.left>=e.right||t.top>=e.bottom))},circleBodyIntersects:function(t,e){var i=n(t.center.x,e.left,e.right),s=n(t.center.y,e.top,e.bottom);return(t.center.x-i)*(t.center.x-i)+(t.center.y-s)*(t.center.y-s)<=t.halfWidth*t.halfWidth},overlap:function(t,e,i,s,r){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===r&&(r=i),this.collideObjects(t,e,i,s,r,!0)},collide:function(t,e,i,s,r){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===r&&(r=i),this.collideObjects(t,e,i,s,r,!1)},collideObjects:function(t,e,i,s,r,n){var a,o;!t.isParent||void 0!==t.physicsType&&void 0!==e&&t!==e||(t=Array.from(t.children)),e&&e.isParent&&void 0===e.physicsType&&(e=Array.from(e.children));var h=Array.isArray(t),l=Array.isArray(e);if(this._total=0,h||l)if(!h&&l)for(a=0;a0},collideHandler:function(t,e,i,s,r,n){if(void 0===e&&t.isParent)return this.collideGroupVsGroup(t,t,i,s,r,n);if(!t||!e)return!1;if(t.body||t.isBody){if(e.body||e.isBody)return this.collideSpriteVsSprite(t,e,i,s,r,n);if(e.isParent)return this.collideSpriteVsGroup(t,e,i,s,r,n);if(e.isTilemap)return this.collideSpriteVsTilemapLayer(t,e,i,s,r,n)}else if(t.isParent){if(e.body||e.isBody)return this.collideSpriteVsGroup(e,t,i,s,r,n);if(e.isParent)return this.collideGroupVsGroup(t,e,i,s,r,n);if(e.isTilemap)return this.collideGroupVsTilemapLayer(t,e,i,s,r,n)}else if(t.isTilemap){if(e.body||e.isBody)return this.collideSpriteVsTilemapLayer(e,t,i,s,r,n);if(e.isParent)return this.collideGroupVsTilemapLayer(e,t,i,s,r,n)}},canCollide:function(t,e){return t&&e&&0!==(t.collisionMask&e.collisionCategory)&&0!==(e.collisionMask&t.collisionCategory)},collideSpriteVsSprite:function(t,e,i,s,r,n){var a=t.isBody?t:t.body,o=e.isBody?e:e.body;return!!this.canCollide(a,o)&&(this.separate(a,o,s,r,n)&&(i&&i.call(r,t,e),this._total++),!0)},collideSpriteVsGroup:function(t,e,i,s,r,n){var a,o,l,u=t.isBody?t:t.body;if(0!==e.getLength()&&u&&u.enable&&!u.checkCollision.none&&this.canCollide(u,e))if(this.useTree||e.physicsType===h.STATIC_BODY){var d=this.treeMinMax;d.minX=u.left,d.minY=u.top,d.maxX=u.right,d.maxY=u.bottom;var c=e.physicsType===h.DYNAMIC_BODY?this.tree.search(d):this.staticTree.search(d);for(o=c.length,a=0;a0&&(t.blocked.none=!1,t.blocked.right=!0),t.position.x-=e,t.updateCenter(),0===t.bounce.x?t.velocity.x=0:t.velocity.x=-t.velocity.x*t.bounce.x}},67013(t){t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.up=!0):e>0&&(t.blocked.none=!1,t.blocked.down=!0),t.position.y-=e,t.updateCenter(),0===t.bounce.y?t.velocity.y=0:t.velocity.y=-t.velocity.y*t.bounce.y}},40012(t,e,i){var s=i(21329),r=i(53442),n=i(2483);t.exports=function(t,e,i,a,o,h,l){var u=a.left,d=a.top,c=a.right,f=a.bottom,p=i.faceLeft||i.faceRight,g=i.faceTop||i.faceBottom;if(l||(p=!0,g=!0),!p&&!g)return!1;var m=0,v=0,y=0,x=1;if(e.deltaAbsX()>e.deltaAbsY()?y=-1:e.deltaAbsX()0&&u&&t.checkCollision.right&&h&&t.right>i&&(o=t.right-i)>n&&(o=0),0!==o&&(t.customSeparateX?t.overlapX=o:s(t,o)),o}},53442(t,e,i){var s=i(67013);t.exports=function(t,e,i,r,n,a){var o=0,h=e.faceTop,l=e.faceBottom,u=e.collideUp,d=e.collideDown;return a||(h=!0,l=!0,u=!0,d=!0),t.deltaY()<0&&d&&t.checkCollision.up?l&&t.y0&&u&&t.checkCollision.down&&h&&t.bottom>i&&(o=t.bottom-i)>n&&(o=0),0!==o&&(t.customSeparateY?t.overlapY=o:s(t,o)),o}},2483(t){t.exports=function(t,e){return!(e.right<=t.left||e.bottom<=t.top||e.position.x>=t.right||e.position.y>=t.bottom)}},55173(t,e,i){var s={ProcessTileCallbacks:i(96602),ProcessTileSeparationX:i(36294),ProcessTileSeparationY:i(67013),SeparateTile:i(40012),TileCheckX:i(21329),TileCheckY:i(53442),TileIntersectsBody:i(2483)};t.exports=s},44563(t,e,i){t.exports={Arcade:i(27064),Matter:i(3875)}},68174(t,e,i){var s=i(83419),r=i(26099),n=new s({initialize:function(){this.boundsCenter=new r,this.centerDiff=new r},parseBody:function(t){if(!(t=t.hasOwnProperty("body")?t.body:t).hasOwnProperty("bounds")||!t.hasOwnProperty("centerOfMass"))return!1;var e=this.boundsCenter,i=this.centerDiff,s=t.bounds.max.x-t.bounds.min.x,r=t.bounds.max.y-t.bounds.min.y,n=s*t.centerOfMass.x,a=r*t.centerOfMass.y;return e.set(s/2,r/2),i.set(n-e.x,a-e.y),!0},getTopLeft:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,n=this.centerDiff;return new r(e+s.x+n.x,i+s.y+n.y)}return!1},getTopCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,n=this.centerDiff;return new r(e+n.x,i+s.y+n.y)}return!1},getTopRight:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,n=this.centerDiff;return new r(e-(s.x-n.x),i+s.y+n.y)}return!1},getLeftCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,n=this.centerDiff;return new r(e+s.x+n.x,i+n.y)}return!1},getCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.centerDiff;return new r(e+s.x,i+s.y)}return!1},getRightCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,n=this.centerDiff;return new r(e-(s.x-n.x),i+n.y)}return!1},getBottomLeft:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,n=this.centerDiff;return new r(e+s.x+n.x,i-(s.y-n.y))}return!1},getBottomCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,n=this.centerDiff;return new r(e+n.x,i-(s.y-n.y))}return!1},getBottomRight:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,n=this.centerDiff;return new r(e-(s.x-n.x),i-(s.y-n.y))}return!1}});t.exports=n},19933(t,e,i){var s=i(6790);s.Body=i(22562),s.Composite=i(69351),s.World=i(4372),s.Collision=i(52284),s.Detector=i(81388),s.Pairs=i(99561),s.Pair=i(4506),s.Query=i(73296),s.Resolver=i(66272),s.Constraint=i(48140),s.Common=i(53402),s.Engine=i(48413),s.Events=i(35810),s.Sleeping=i(53614),s.Plugin=i(73832),s.Bodies=i(66280),s.Composites=i(74116),s.Axes=i(66615),s.Bounds=i(15647),s.Svg=i(74058),s.Vector=i(31725),s.Vertices=i(41598),s.World.add=s.Composite.add,s.World.remove=s.Composite.remove,s.World.addComposite=s.Composite.addComposite,s.World.addBody=s.Composite.addBody,s.World.addConstraint=s.Composite.addConstraint,s.World.clear=s.Composite.clear,t.exports=s},28137(t,e,i){var s=i(66280),r=i(83419),n=i(74116),a=i(48140),o=i(74058),h=i(75803),l=i(23181),u=i(34803),d=i(73834),c=i(19496),f=i(85791),p=i(98713),g=i(41598),m=new r({initialize:function(t){this.world=t,this.scene=t.scene,this.sys=t.scene.sys},rectangle:function(t,e,i,r,n){var a=s.rectangle(t,e,i,r,n);return this.world.add(a),a},trapezoid:function(t,e,i,r,n,a){var o=s.trapezoid(t,e,i,r,n,a);return this.world.add(o),o},circle:function(t,e,i,r,n){var a=s.circle(t,e,i,r,n);return this.world.add(a),a},polygon:function(t,e,i,r,n){var a=s.polygon(t,e,i,r,n);return this.world.add(a),a},fromVertices:function(t,e,i,r,n,a,o){"string"==typeof i&&(i=g.fromPath(i));var h=s.fromVertices(t,e,i,r,n,a,o);return this.world.add(h),h},fromPhysicsEditor:function(t,e,i,s,r){void 0===r&&(r=!0);var n=c.parseBody(t,e,i,s);return r&&!this.world.has(n)&&this.world.add(n),n},fromSVG:function(t,e,i,r,n,a){void 0===r&&(r=1),void 0===n&&(n={}),void 0===a&&(a=!0);for(var h=i.getElementsByTagName("path"),l=[],u=0;u0},intersectPoint:function(t,e,i){i=this.getMatterBodies(i);var s=M.create(t,e),r=[];return C.point(i,s).forEach(function(t){-1===r.indexOf(t)&&r.push(t)}),r},intersectRect:function(t,e,i,s,r,n){void 0===r&&(r=!1),n=this.getMatterBodies(n);var a={min:{x:t,y:e},max:{x:t+i,y:e+s}},o=[];return C.region(n,a,r).forEach(function(t){-1===o.indexOf(t)&&o.push(t)}),o},intersectRay:function(t,e,i,s,r,n){void 0===r&&(r=1),n=this.getMatterBodies(n);for(var a=[],o=C.ray(n,M.create(t,e),M.create(i,s),r),h=0;h0?this.setFromTileCollision(i):this.setFromTileRectangle(i),s=this.body}if(e.flipX||e.flipY){var o={x:e.getCenterX(),y:e.getCenterY()},u=e.flipX?-1:1,d=e.flipY?-1:1;r.scale(s,u,d,o)}},setFromTileRectangle:function(t){void 0===t&&(t={}),u(t,"isStatic")||(t.isStatic=!0),u(t,"addToWorld")||(t.addToWorld=!0);var e=this.tile.getBounds(),i=e.x+e.width/2,r=e.y+e.height/2,n=s.rectangle(i,r,e.width,e.height,t);return this.setBody(n,t.addToWorld),this},setFromTileCollision:function(t){void 0===t&&(t={}),u(t,"isStatic")||(t.isStatic=!0),u(t,"addToWorld")||(t.addToWorld=!0);for(var e=this.tile.tilemapLayer.scaleX,i=this.tile.tilemapLayer.scaleY,n=this.tile.getLeft(),a=this.tile.getTop(),h=this.tile.getCollisionGroup(),c=l(h,"objects",[]),f=[],p=0;p1){var C=o(t);C.parts=f,this.setBody(r.create(C),C.addToWorld)}return this},setBody:function(t,e){return void 0===e&&(e=!0),this.body&&this.removeBody(),this.body=t,this.body.gameObject=this,e&&this.world.add(this.body),this},removeBody:function(){return this.body&&(this.world.remove(this.body),this.body.gameObject=void 0,this.body=void 0),this},destroy:function(){this.removeBody(),this.tile.physics.matterBody=void 0,this.removeAllListeners()}});t.exports=c},19496(t,e,i){var s=i(66280),r=i(22562),n=i(53402),a=i(95540),o=i(41598),h={parseBody:function(t,e,i,s){void 0===s&&(s={});for(var o=a(i,"fixtures",[]),h=[],l=0;l1?1:0;r0&&r.map(function(t){i=t.bodyA,s=t.bodyB,i.gameObject&&i.gameObject.emit("collide",i,s,t),s.gameObject&&s.gameObject.emit("collide",s,i,t),p.trigger(i,"onCollide",{pair:t}),p.trigger(s,"onCollide",{pair:t}),i.onCollideCallback&&i.onCollideCallback(t),s.onCollideCallback&&s.onCollideCallback(t),i.onCollideWith[s.id]&&i.onCollideWith[s.id](s,t),s.onCollideWith[i.id]&&s.onCollideWith[i.id](i,t)}),t.emit(u.COLLISION_START,e,i,s)}),p.on(e,"collisionActive",function(e){var i,s,r=e.pairs;r.length>0&&r.map(function(t){i=t.bodyA,s=t.bodyB,i.gameObject&&i.gameObject.emit("collideActive",i,s,t),s.gameObject&&s.gameObject.emit("collideActive",s,i,t),p.trigger(i,"onCollideActive",{pair:t}),p.trigger(s,"onCollideActive",{pair:t}),i.onCollideActiveCallback&&i.onCollideActiveCallback(t),s.onCollideActiveCallback&&s.onCollideActiveCallback(t)}),t.emit(u.COLLISION_ACTIVE,e,i,s)}),p.on(e,"collisionEnd",function(e){var i,s,r=e.pairs;r.length>0&&r.map(function(t){i=t.bodyA,s=t.bodyB,i.gameObject&&i.gameObject.emit("collideEnd",i,s,t),s.gameObject&&s.gameObject.emit("collideEnd",s,i,t),p.trigger(i,"onCollideEnd",{pair:t}),p.trigger(s,"onCollideEnd",{pair:t}),i.onCollideEndCallback&&i.onCollideEndCallback(t),s.onCollideEndCallback&&s.onCollideEndCallback(t)}),t.emit(u.COLLISION_END,e,i,s)})},setBounds:function(t,e,i,s,r,n,a,o,h){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===s&&(s=this.scene.sys.scale.height),void 0===r&&(r=64),void 0===n&&(n=!0),void 0===a&&(a=!0),void 0===o&&(o=!0),void 0===h&&(h=!0),this.updateWall(n,"left",t-r,e-r,r,s+2*r),this.updateWall(a,"right",t+i,e-r,r,s+2*r),this.updateWall(o,"top",t,e-r,i,r),this.updateWall(h,"bottom",t,e+s,i,r),this},updateWall:function(t,e,i,s,r,n){var a=this.walls[e];t?(a&&m.remove(this.localWorld,a),i+=r/2,s+=n/2,this.walls[e]=this.create(i,s,r,n,{isStatic:!0,friction:0,frictionStatic:0})):(a&&m.remove(this.localWorld,a),this.walls[e]=null)},createDebugGraphic:function(){var t=this.scene.sys.add.graphics({x:0,y:0});return t.setDepth(Number.MAX_VALUE),this.debugGraphic=t,this.drawDebug=!0,t},disableGravity:function(){return this.localWorld.gravity.x=0,this.localWorld.gravity.y=0,this.localWorld.gravity.scale=0,this},setGravity:function(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=1),void 0===i&&(i=.001),this.localWorld.gravity.x=t,this.localWorld.gravity.y=e,this.localWorld.gravity.scale=i,this},create:function(t,e,i,r,n){var a=s.rectangle(t,e,i,r,n);return m.add(this.localWorld,a),a},add:function(t){return m.add(this.localWorld,t),this},remove:function(t,e){Array.isArray(t)||(t=[t]);for(var i=0;iMath.max(v._maxFrameDelta,i.maxFrameTime))&&(o=i.frameDelta||v._frameDeltaFallback),i.frameDeltaSmoothing){i.frameDeltaHistory.push(o),i.frameDeltaHistory=i.frameDeltaHistory.slice(-i.frameDeltaHistorySize);var l=i.frameDeltaHistory.slice(0).sort(),u=i.frameDeltaHistory.slice(l.length*v._smoothingLowerBound,l.length*v._smoothingUpperBound);o=v._mean(u)||o}i.frameDeltaSnapping&&(o=1e3/Math.round(1e3/o)),i.frameDelta=o,i.timeLastTick=t,i.timeBuffer+=i.frameDelta,i.timeBuffer=a.clamp(i.timeBuffer,0,i.frameDelta+r*v._timeBufferMargin),i.lastUpdatesDeferred=0;for(var d=i.maxUpdates||Math.ceil(i.maxFrameTime/r),c=a.now();r>0&&i.timeBuffer>=r*v._timeBufferMargin;){h.update(e,r),i.timeBuffer-=r,n+=1;var f=a.now()-s,p=a.now()-c,g=f+v._elapsedNextEstimate*p/n;if(n>=d||g>i.maxFrameTime){i.lastUpdatesDeferred=Math.round(Math.max(0,i.timeBuffer/r-v._timeBufferMargin));break}}}},step:function(t){h.update(this.engine,t)},update60Hz:function(){return 1e3/60},update30Hz:function(){return 1e3/30},has:function(t){var e=t.hasOwnProperty("body")?t.body:t;return null!==o.get(this.localWorld,e.id,e.type)},getAllBodies:function(){return o.allBodies(this.localWorld)},getAllConstraints:function(){return o.allConstraints(this.localWorld)},getAllComposites:function(){return o.allComposites(this.localWorld)},postUpdate:function(){if(this.drawDebug){var t=this.debugConfig,e=this.engine,i=this.debugGraphic,s=o.allBodies(this.localWorld);this.debugGraphic.clear(),t.showBroadphase&&e.broadphase.controller&&this.renderGrid(e.broadphase,i,t.broadphaseColor,.5),t.showBounds&&this.renderBodyBounds(s,i,t.boundsColor,.5),(t.showBody||t.showStaticBody)&&this.renderBodies(s),t.showJoint&&this.renderJoints(),(t.showAxes||t.showAngleIndicator)&&this.renderBodyAxes(s,i,t.showAxes,t.angleColor,.5),t.showVelocity&&this.renderBodyVelocity(s,i,t.velocityColor,1,2),t.showSeparations&&this.renderSeparations(e.pairs.list,i,t.separationColor),t.showCollisions&&this.renderCollisions(e.pairs.list,i,t.collisionColor)}},renderGrid:function(t,e,i,s){e.lineStyle(1,i,s);for(var r=a.keys(t.buckets),n=0;n0){var l=h[0].vertex.x,u=h[0].vertex.y;2===r.contactCount&&(l=(h[0].vertex.x+h[1].vertex.x)/2,u=(h[0].vertex.y+h[1].vertex.y)/2),o.bodyB===o.supports[0].body||o.bodyA.isStatic?e.lineBetween(l-8*o.normal.x,u-8*o.normal.y,l,u):e.lineBetween(l+8*o.normal.x,u+8*o.normal.y,l,u)}}return this},renderBodyBounds:function(t,e,i,s){e.lineStyle(1,i,s);for(var r=0;r1?1:0;h1?1:0;o1?1:0;o1&&this.renderConvexHull(g,e,f,y)}}},renderBody:function(t,e,i,s,r,n,a,o){void 0===s&&(s=null),void 0===r&&(r=null),void 0===n&&(n=1),void 0===a&&(a=null),void 0===o&&(o=null);for(var h=this.debugConfig,l=h.sensorFillColor,u=h.sensorLineColor,d=t.parts,c=d.length,f=c>1?1:0;f1){var r=t.vertices;e.lineStyle(s,i),e.beginPath(),e.moveTo(r[0].x,r[0].y);for(var n=1;n0&&(e.fillStyle(o),e.fillCircle(u.x,u.y,h),e.fillCircle(d.x,d.y,h)),this},resetCollisionIDs:function(){return r._nextCollidingGroupId=1,r._nextNonCollidingGroupId=-1,r._nextCategory=1,this},shutdown:function(){p.off(this.engine),this.removeAllListeners(),m.clear(this.localWorld,!1),h.clear(this.engine),this.drawDebug&&this.debugGraphic.destroy()},destroy:function(){this.shutdown()}});t.exports=x},70410(t){t.exports={setBounce:function(t){return this.body.restitution=t,this}}},66968(t){var e={setCollisionCategory:function(t){return this.body.collisionFilter.category=t,this},setCollisionGroup:function(t){return this.body.collisionFilter.group=t,this},setCollidesWith:function(t){var e=0;if(Array.isArray(t))for(var i=0;i0&&n.rotateAbout(o.position,s,t.position,o.position)}},s.setVelocity=function(t,e){var i=t.deltaTime/s._baseDelta;t.positionPrev.x=t.position.x-e.x*i,t.positionPrev.y=t.position.y-e.y*i,t.velocity.x=(t.position.x-t.positionPrev.x)/i,t.velocity.y=(t.position.y-t.positionPrev.y)/i,t.speed=n.magnitude(t.velocity)},s.getVelocity=function(t){var e=s._baseDelta/t.deltaTime;return{x:(t.position.x-t.positionPrev.x)*e,y:(t.position.y-t.positionPrev.y)*e}},s.getSpeed=function(t){return n.magnitude(s.getVelocity(t))},s.setSpeed=function(t,e){s.setVelocity(t,n.mult(n.normalise(s.getVelocity(t)),e))},s.setAngularVelocity=function(t,e){var i=t.deltaTime/s._baseDelta;t.anglePrev=t.angle-e*i,t.angularVelocity=(t.angle-t.anglePrev)/i,t.angularSpeed=Math.abs(t.angularVelocity)},s.getAngularVelocity=function(t){return(t.angle-t.anglePrev)*s._baseDelta/t.deltaTime},s.getAngularSpeed=function(t){return Math.abs(s.getAngularVelocity(t))},s.setAngularSpeed=function(t,e){s.setAngularVelocity(t,o.sign(s.getAngularVelocity(t))*e)},s.translate=function(t,e,i){s.setPosition(t,n.add(t.position,e),i)},s.rotate=function(t,e,i,r){if(i){var n=Math.cos(e),a=Math.sin(e),o=t.position.x-i.x,h=t.position.y-i.y;s.setPosition(t,{x:i.x+(o*n-h*a),y:i.y+(o*a+h*n)},r),s.setAngle(t,t.angle+e,r)}else s.setAngle(t,t.angle+e,r)},s.scale=function(t,e,i,n){var a=0,o=0;n=n||t.position;for(var u=t.inertia===1/0,d=0;d0&&(a+=c.area,o+=c.inertia),c.position.x=n.x+(c.position.x-n.x)*e,c.position.y=n.y+(c.position.y-n.y)*i,h.update(c.bounds,c.vertices,t.velocity)}t.parts.length>1&&(t.area=a,t.isStatic||(s.setMass(t,t.density*a),s.setInertia(t,o))),t.circleRadius&&(e===i?t.circleRadius*=e:t.circleRadius=null),u&&s.setInertia(t,1/0)},s.update=function(t,e){var i=(e=(void 0!==e?e:1e3/60)*t.timeScale)*e,a=s._timeCorrection?e/(t.deltaTime||e):1,u=1-t.frictionAir*(e/o._baseDelta),d=(t.position.x-t.positionPrev.x)*a,c=(t.position.y-t.positionPrev.y)*a;t.velocity.x=d*u+t.force.x/t.mass*i,t.velocity.y=c*u+t.force.y/t.mass*i,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.position.x+=t.velocity.x,t.position.y+=t.velocity.y,t.deltaTime=e,t.angularVelocity=(t.angle-t.anglePrev)*u*a+t.torque/t.inertia*i,t.anglePrev=t.angle,t.angle+=t.angularVelocity,t.speed=n.magnitude(t.velocity),t.angularSpeed=Math.abs(t.angularVelocity);for(var f=0;f0&&(p.position.x+=t.velocity.x,p.position.y+=t.velocity.y),0!==t.angularVelocity&&(r.rotate(p.vertices,t.angularVelocity,t.position),l.rotate(p.axes,t.angularVelocity),f>0&&n.rotateAbout(p.position,t.angularVelocity,t.position,p.position)),h.update(p.bounds,p.vertices,t.velocity)}},s.updateVelocities=function(t){var e=s._baseDelta/t.deltaTime,i=t.velocity;i.x=(t.position.x-t.positionPrev.x)*e,i.y=(t.position.y-t.positionPrev.y)*e,t.speed=Math.sqrt(i.x*i.x+i.y*i.y),t.angularVelocity=(t.angle-t.anglePrev)*e,t.angularSpeed=Math.abs(t.angularVelocity)},s.applyForce=function(t,e,i){var s=e.x-t.position.x,r=e.y-t.position.y;t.force.x+=i.x,t.force.y+=i.y,t.torque+=s*i.y-r*i.x},s._totalProperties=function(t){for(var e={mass:0,area:0,inertia:0,centre:{x:0,y:0}},i=1===t.parts.length?0:1;i=0&&(v=-v,y=-y),d.x=v,d.y=y,c.x=-y,c.y=v,f.x=v*g,f.y=y*g,r.depth=g;var x=s._findSupports(t,e,d,1),T=0;if(o.contains(t.vertices,x[0])&&(p[T++]=x[0]),o.contains(t.vertices,x[1])&&(p[T++]=x[1]),T<2){var w=s._findSupports(e,t,d,-1);o.contains(e.vertices,w[0])&&(p[T++]=w[0]),T<2&&o.contains(e.vertices,w[1])&&(p[T++]=w[1])}return 0===T&&(p[T++]=x[0]),r.supportCount=T,r},s._overlapAxes=function(t,e,i,s){var r,n,a,o,h,l,u=e.length,d=i.length,c=e[0].x,f=e[0].y,p=i[0].x,g=i[0].y,m=s.length,v=Number.MAX_VALUE,y=0;for(h=0;hC?C=o:oE?E=o:op)break;if(!(gM.max.y)&&(!v||!T.isStatic&&!T.isSleeping)&&h(c.collisionFilter,T.collisionFilter)){var w=T.parts.length;if(x&&1===w)(A=l(c,T,r))&&(u[d++]=A);else for(var b=w>1?1:0,S=y>1?1:0;SM.max.x||f.max.xM.max.y||(A=l(C,_,r))&&(u[d++]=A)}}}}return u.length!==d&&(u.length=d),u},s.canCollide=function(t,e){return t.group===e.group&&0!==t.group?t.group>0:0!==(t.mask&e.category)&&0!==(e.mask&t.category)},s._compareBoundsX=function(t,e){return t.bounds.min.x-e.bounds.min.x}},4506(t,e,i){var s={};t.exports=s;var r=i(43424);s.create=function(t,e){var i=t.bodyA,n=t.bodyB,a={id:s.id(i,n),bodyA:i,bodyB:n,collision:t,contacts:[r.create(),r.create()],contactCount:0,separation:0,isActive:!0,isSensor:i.isSensor||n.isSensor,timeCreated:e,timeUpdated:e,inverseMass:0,friction:0,frictionStatic:0,restitution:0,slop:0};return s.update(a,t,e),a},s.update=function(t,e,i){var s=e.supports,r=e.supportCount,n=t.contacts,a=e.parentA,o=e.parentB;t.isActive=!0,t.timeUpdated=i,t.collision=e,t.separation=e.depth,t.inverseMass=a.inverseMass+o.inverseMass,t.friction=a.frictiono.frictionStatic?a.frictionStatic:o.frictionStatic,t.restitution=a.restitution>o.restitution?a.restitution:o.restitution,t.slop=a.slop>o.slop?a.slop:o.slop,t.contactCount=r,e.pair=t;var h=s[0],l=n[0],u=s[1],d=n[1];d.vertex!==h&&l.vertex!==u||(n[1]=l,n[0]=l=d,d=n[1]),l.vertex=h,d.vertex=u},s.setActive=function(t,e,i){e?(t.isActive=!0,t.timeUpdated=i):(t.isActive=!1,t.contactCount=0)},s.id=function(t,e){return t.id=i?d[f++]=n:(l(n,!1,i),n.collision.bodyA.sleepCounter>0&&n.collision.bodyB.sleepCounter>0?d[f++]=n:(g[x++]=n,delete u[n.id]));d.length!==f&&(d.length=f),p.length!==y&&(p.length=y),g.length!==x&&(g.length=x),m.length!==T&&(m.length=T)},s.clear=function(t){return t.table={},t.list.length=0,t.collisionStart.length=0,t.collisionActive.length=0,t.collisionEnd.length=0,t}},73296(t,e,i){var s={};t.exports=s;var r=i(31725),n=i(52284),a=i(15647),o=i(66280),h=i(41598);s.collides=function(t,e){for(var i=[],s=e.length,r=t.bounds,o=n.collides,h=a.overlaps,l=0;lH?(r=W>0?W:-W,(i=g.friction*(W>0?1:-1)*l)<-r?i=-r:i>r&&(i=r)):(i=W,r=f);var j=N*T-B*x,q=k*T-U*x,K=_/(S+v.inverseInertia*j*j+y.inverseInertia*q*q),Z=(1+g.restitution)*X*K;if(i*=K,X0&&(F.normalImpulse=0),Z=F.normalImpulse-Q}if(W<-d||W>d)F.tangentImpulse=0;else{var J=F.tangentImpulse;F.tangentImpulse+=i,F.tangentImpulse<-r&&(F.tangentImpulse=-r),F.tangentImpulse>r&&(F.tangentImpulse=r),i=F.tangentImpulse-J}var $=x*Z+w*i,tt=T*Z+b*i;v.isStatic||v.isSleeping||(v.positionPrev.x+=$*v.inverseMass,v.positionPrev.y+=tt*v.inverseMass,v.anglePrev+=(N*tt-B*$)*v.inverseInertia),y.isStatic||y.isSleeping||(y.positionPrev.x-=$*y.inverseMass,y.positionPrev.y-=tt*y.inverseMass,y.anglePrev-=(k*tt-U*$)*y.inverseInertia)}}}}},48140(t,e,i){var s={};t.exports=s;var r=i(41598),n=i(31725),a=i(53614),o=i(15647),h=i(66615),l=i(53402);s._warming=.4,s._torqueDampen=1,s._minLength=1e-6,s.create=function(t){var e=t;e.bodyA&&!e.pointA&&(e.pointA={x:0,y:0}),e.bodyB&&!e.pointB&&(e.pointB={x:0,y:0});var i=e.bodyA?n.add(e.bodyA.position,e.pointA):e.pointA,s=e.bodyB?n.add(e.bodyB.position,e.pointB):e.pointB,r=n.magnitude(n.sub(i,s));e.length=void 0!==e.length?e.length:r,e.id=e.id||l.nextId(),e.label=e.label||"Constraint",e.type="constraint",e.stiffness=e.stiffness||(e.length>0?1:.7),e.damping=e.damping||0,e.angularStiffness=e.angularStiffness||0,e.angleA=e.bodyA?e.bodyA.angle:e.angleA,e.angleB=e.bodyB?e.bodyB.angle:e.angleB,e.plugin={};var a={visible:!0,type:"line",anchors:!0,lineColor:null,lineOpacity:null,lineThickness:null,pinSize:null,anchorColor:null,anchorSize:null};return 0===e.length&&e.stiffness>.1?(a.type="pin",a.anchors=!1):e.stiffness<.9&&(a.type="spring"),e.render=l.extend(a,e.render),e},s.preSolveAll=function(t){for(var e=0;e=1||0===t.length?t.stiffness*e:t.stiffness*e*e,x=t.damping*e,T=n.mult(u,v*y),w=(i?i.inverseMass:0)+(r?r.inverseMass:0),b=w+((i?i.inverseInertia:0)+(r?r.inverseInertia:0));if(x>0){var S=n.create();p=n.div(u,d),m=n.sub(r&&n.sub(r.position,r.positionPrev)||S,i&&n.sub(i.position,i.positionPrev)||S),g=n.dot(p,m)}i&&!i.isStatic&&(f=i.inverseMass/w,i.constraintImpulse.x-=T.x*f,i.constraintImpulse.y-=T.y*f,i.position.x-=T.x*f,i.position.y-=T.y*f,x>0&&(i.positionPrev.x-=x*p.x*g*f,i.positionPrev.y-=x*p.y*g*f),c=n.cross(a,T)/b*s._torqueDampen*i.inverseInertia*(1-t.angularStiffness),i.constraintImpulse.angle-=c,i.angle-=c),r&&!r.isStatic&&(f=r.inverseMass/w,r.constraintImpulse.x+=T.x*f,r.constraintImpulse.y+=T.y*f,r.position.x+=T.x*f,r.position.y+=T.y*f,x>0&&(r.positionPrev.x+=x*p.x*g*f,r.positionPrev.y+=x*p.y*g*f),c=n.cross(o,T)/b*s._torqueDampen*r.inverseInertia*(1-t.angularStiffness),r.constraintImpulse.angle+=c,r.angle+=c)}}},s.postSolveAll=function(t){for(var e=0;e0&&(d.position.x+=l.x,d.position.y+=l.y),0!==l.angle&&(r.rotate(d.vertices,l.angle,i.position),h.rotate(d.axes,l.angle),u>0&&n.rotateAbout(d.position,l.angle,i.position,d.position)),o.update(d.bounds,d.vertices,i.velocity)}l.angle*=s._warming,l.x*=s._warming,l.y*=s._warming}}},s.pointAWorld=function(t){return{x:(t.bodyA?t.bodyA.position.x:0)+(t.pointA?t.pointA.x:0),y:(t.bodyA?t.bodyA.position.y:0)+(t.pointA?t.pointA.y:0)}},s.pointBWorld=function(t){return{x:(t.bodyB?t.bodyB.position.x:0)+(t.pointB?t.pointB.x:0),y:(t.bodyB?t.bodyB.position.y:0)+(t.pointB?t.pointB.y:0)}},s.currentLength=function(t){var e=(t.bodyA?t.bodyA.position.x:0)+(t.pointA?t.pointA.x:0),i=(t.bodyA?t.bodyA.position.y:0)+(t.pointA?t.pointA.y:0),s=e-((t.bodyB?t.bodyB.position.x:0)+(t.pointB?t.pointB.x:0)),r=i-((t.bodyB?t.bodyB.position.y:0)+(t.pointB?t.pointB.y:0));return Math.sqrt(s*s+r*r)}},53402(t,e,i){var s={};t.exports=s,function(){s._baseDelta=1e3/60,s._nextId=0,s._seed=0,s._nowStartTime=+new Date,s._warnedOnce={},s._decomp=null,s.extend=function(t,e){var i,r;"boolean"==typeof e?(i=2,r=e):(i=1,r=!0);for(var n=i;n0;e--){var i=Math.floor(s.random()*(e+1)),r=t[e];t[e]=t[i],t[i]=r}return t},s.choose=function(t){return t[Math.floor(s.random()*t.length)]},s.isElement=function(t){return"undefined"!=typeof HTMLElement?t instanceof HTMLElement:!!(t&&t.nodeType&&t.nodeName)},s.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)},s.isFunction=function(t){return"function"==typeof t},s.isPlainObject=function(t){return"object"==typeof t&&t.constructor===Object},s.isString=function(t){return"[object String]"===toString.call(t)},s.clamp=function(t,e,i){return ti?i:t},s.sign=function(t){return t<0?-1:1},s.now=function(){if("undefined"!=typeof window&&window.performance){if(window.performance.now)return window.performance.now();if(window.performance.webkitNow)return window.performance.webkitNow()}return Date.now?Date.now():new Date-s._nowStartTime},s.random=function(e,i){return i=void 0!==i?i:1,(e=void 0!==e?e:0)+t()*(i-e)};var t=function(){return s._seed=(9301*s._seed+49297)%233280,s._seed/233280};s.colorToNumber=function(t){return 3==(t=t.replace("#","")).length&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)),parseInt(t,16)},s.logLevel=1,s.log=function(){console&&s.logLevel>0&&s.logLevel<=3&&console.log.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},s.info=function(){console&&s.logLevel>0&&s.logLevel<=2&&console.info.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},s.warn=function(){console&&s.logLevel>0&&s.logLevel<=3&&console.warn.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},s.warnOnce=function(){var t=Array.prototype.slice.call(arguments).join(" ");s._warnedOnce[t]||(s.warn(t),s._warnedOnce[t]=!0)},s.deprecated=function(t,e,i){t[e]=s.chain(function(){s.warnOnce("🔅 deprecated 🔅",i)},t[e])},s.nextId=function(){return s._nextId++},s.indexOf=function(t,e){if(t.indexOf)return t.indexOf(e);for(var i=0;is._deltaMax&&d.warnOnce("Matter.Engine.update: delta argument is recommended to be less than or equal to",s._deltaMax.toFixed(3),"ms."),e=void 0!==e?e:d._baseDelta,e*=m.timeScale,m.timestamp+=e,m.lastDelta=e;var y={timestamp:m.timestamp,delta:e};h.trigger(t,"beforeUpdate",y);var x=l.allBodies(f),T=l.allConstraints(f),w=l.allComposites(f);for(f.isModified&&(a.setBodies(p,x),l.setModified(f,!1,!1,!0)),t.enableSleeping&&r.update(x,e),s._bodiesApplyGravity(x,t.gravity),s.wrap(x,w),s.attractors(x),e>0&&s._bodiesUpdate(x,e),h.trigger(t,"beforeSolve",y),u.preSolveAll(x),i=0;i0&&h.trigger(t,"collisionStart",{pairs:g.collisionStart,timestamp:m.timestamp,delta:e});var S=d.clamp(20/t.positionIterations,0,1);for(n.preSolvePosition(g.list),i=0;i0&&h.trigger(t,"collisionActive",{pairs:g.collisionActive,timestamp:m.timestamp,delta:e}),g.collisionEnd.length>0&&h.trigger(t,"collisionEnd",{pairs:g.collisionEnd,timestamp:m.timestamp,delta:e}),s._bodiesClearForces(x),h.trigger(t,"afterUpdate",y),t.timing.lastElapsed=d.now()-c,t},s.merge=function(t,e){if(d.extend(t,e),e.world){t.world=e.world,s.clear(t);for(var i=l.allBodies(t.world),n=0;n0)for(var r=0;r0){i||(i={}),s=e.split(" ");for(var l=0;ln?(r.warn("Plugin.register:",s.toString(e),"was upgraded to",s.toString(t)),s._registry[t.name]=t):i-1},s.isFor=function(t,e){var i=t.for&&s.dependencyParse(t.for);return!t.for||e.name===i.name&&s.versionSatisfies(e.version,i.range)},s.use=function(t,e){if(t.uses=(t.uses||[]).concat(e||[]),0!==t.uses.length){for(var i=s.dependencies(t),n=r.topologicalSort(i),a=[],o=0;o0&&!h.silent&&r.info(a.join(" "))}else r.warn("Plugin.use:",s.toString(t),"does not specify any dependencies to install.")},s.dependencies=function(t,e){var i=s.dependencyParse(t),n=i.name;if(!(n in(e=e||{}))){t=s.resolve(t)||t,e[n]=r.map(t.uses||[],function(e){s.isPlugin(e)&&s.register(e);var n=s.dependencyParse(e),a=s.resolve(e);return a&&!s.versionSatisfies(a.version,n.range)?(r.warn("Plugin.dependencies:",s.toString(a),"does not satisfy",s.toString(n),"used by",s.toString(i)+"."),a._warned=!0,t._warned=!0):a||(r.warn("Plugin.dependencies:",s.toString(e),"used by",s.toString(i),"could not be resolved."),t._warned=!0),n.name});for(var a=0;a=|>)?\s*((\d+)\.(\d+)\.(\d+))(-[0-9A-Za-z-+]+)?$/;e.test(t)||r.warn("Plugin.versionParse:",t,"is not a valid version or range.");var i=e.exec(t),s=Number(i[4]),n=Number(i[5]),a=Number(i[6]);return{isRange:Boolean(i[1]||i[2]),version:i[3],range:t,operator:i[1]||i[2]||"",major:s,minor:n,patch:a,parts:[s,n,a],prerelease:i[7],number:1e8*s+1e4*n+a}},s.versionSatisfies=function(t,e){e=e||"*";var i=s.versionParse(e),r=s.versionParse(t);if(i.isRange){if("*"===i.operator||"*"===t)return!0;if(">"===i.operator)return r.number>i.number;if(">="===i.operator)return r.number>=i.number;if("~"===i.operator)return r.major===i.major&&r.minor===i.minor&&r.patch>=i.patch;if("^"===i.operator)return i.major>0?r.major===i.major&&r.number>=i.number:i.minor>0?r.minor===i.minor&&r.patch>=i.patch:r.patch===i.patch}return t===e||"*"===t}},13037(t,e,i){var s={};t.exports=s;var r=i(35810),n=i(48413),a=i(53402);!function(){s._maxFrameDelta=1e3/15,s._frameDeltaFallback=1e3/60,s._timeBufferMargin=1.5,s._elapsedNextEstimate=1,s._smoothingLowerBound=.1,s._smoothingUpperBound=.9,s.create=function(t){var e=a.extend({delta:1e3/60,frameDelta:null,frameDeltaSmoothing:!0,frameDeltaSnapping:!0,frameDeltaHistory:[],frameDeltaHistorySize:100,frameRequestId:null,timeBuffer:0,timeLastTick:null,maxUpdates:null,maxFrameTime:1e3/30,lastUpdatesDeferred:0,enabled:!0},t);return e.fps=0,e},s.run=function(t,e){return t.timeBuffer=s._frameDeltaFallback,function i(r){t.frameRequestId=s._onNextFrame(t,i),r&&t.enabled&&s.tick(t,e,r)}(),t},s.tick=function(e,i,o){var h=a.now(),l=e.delta,u=0,d=o-e.timeLastTick;if((!d||!e.timeLastTick||d>Math.max(s._maxFrameDelta,e.maxFrameTime))&&(d=e.frameDelta||s._frameDeltaFallback),e.frameDeltaSmoothing){e.frameDeltaHistory.push(d),e.frameDeltaHistory=e.frameDeltaHistory.slice(-e.frameDeltaHistorySize);var c=e.frameDeltaHistory.slice(0).sort(),f=e.frameDeltaHistory.slice(c.length*s._smoothingLowerBound,c.length*s._smoothingUpperBound);d=t(f)||d}e.frameDeltaSnapping&&(d=1e3/Math.round(1e3/d)),e.frameDelta=d,e.timeLastTick=o,e.timeBuffer+=e.frameDelta,e.timeBuffer=a.clamp(e.timeBuffer,0,e.frameDelta+l*s._timeBufferMargin),e.lastUpdatesDeferred=0;var p=e.maxUpdates||Math.ceil(e.maxFrameTime/l),g={timestamp:i.timing.timestamp};r.trigger(e,"beforeTick",g),r.trigger(e,"tick",g);for(var m=a.now();l>0&&e.timeBuffer>=l*s._timeBufferMargin;){r.trigger(e,"beforeUpdate",g),n.update(i,l),r.trigger(e,"afterUpdate",g),e.timeBuffer-=l,u+=1;var v=a.now()-h,y=a.now()-m,x=v+s._elapsedNextEstimate*y/u;if(u>=p||x>e.maxFrameTime){e.lastUpdatesDeferred=Math.round(Math.max(0,e.timeBuffer/l-s._timeBufferMargin));break}}i.timing.lastUpdatesPerFrame=u,r.trigger(e,"afterTick",g),e.frameDeltaHistory.length>=100&&(e.lastUpdatesDeferred&&Math.round(e.frameDelta/l)>p?a.warnOnce("Matter.Runner: runner reached runner.maxUpdates, see docs."):e.lastUpdatesDeferred&&a.warnOnce("Matter.Runner: runner reached runner.maxFrameTime, see docs."),void 0!==e.isFixed&&a.warnOnce("Matter.Runner: runner.isFixed is now redundant, see docs."),(e.deltaMin||e.deltaMax)&&a.warnOnce("Matter.Runner: runner.deltaMin and runner.deltaMax were removed, see docs."),0!==e.fps&&a.warnOnce("Matter.Runner: runner.fps was replaced by runner.delta, see docs."))},s.stop=function(t){s._cancelNextFrame(t)},s._onNextFrame=function(t,e){if("undefined"==typeof window||!window.requestAnimationFrame)throw new Error("Matter.Runner: missing required global window.requestAnimationFrame.");return t.frameRequestId=window.requestAnimationFrame(e),t.frameRequestId},s._cancelNextFrame=function(t){if("undefined"==typeof window||!window.cancelAnimationFrame)throw new Error("Matter.Runner: missing required global window.cancelAnimationFrame.");window.cancelAnimationFrame(t.frameRequestId)};var t=function(t){for(var e=0,i=t.length,s=0;s0&&h.motion=h.sleepThreshold/i&&s.set(h,!0)):h.sleepCounter>0&&(h.sleepCounter-=1)}else s.set(h,!1)}},s.afterCollisions=function(t){for(var e=s._motionSleepThreshold,i=0;ie&&s.set(h,!1)}}}},s.set=function(t,e){var i=t.isSleeping;e?(t.isSleeping=!0,t.sleepCounter=t.sleepThreshold,t.positionImpulse.x=0,t.positionImpulse.y=0,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.anglePrev=t.angle,t.speed=0,t.angularSpeed=0,t.motion=0,i||n.trigger(t,"sleepStart")):(t.isSleeping=!1,t.sleepCounter=0,i&&n.trigger(t,"sleepEnd"))}},66280(t,e,i){var s={};t.exports=s;var r=i(41598),n=i(53402),a=i(22562),o=i(15647),h=i(31725);s.rectangle=function(t,e,i,s,o){o=o||{};var h={label:"Rectangle Body",position:{x:t,y:e},vertices:r.fromPath("L 0 0 L "+i+" 0 L "+i+" "+s+" L 0 "+s)};if(o.chamfer){var l=o.chamfer;h.vertices=r.chamfer(h.vertices,l.radius,l.quality,l.qualityMin,l.qualityMax),delete o.chamfer}return a.create(n.extend({},h,o))},s.trapezoid=function(t,e,i,s,o,h){h=h||{},o>=1&&n.warn("Bodies.trapezoid: slope parameter must be < 1.");var l,u=i*(o*=.5),d=u+(1-2*o)*i,c=d+u;l=o<.5?"L 0 0 L "+u+" "+-s+" L "+d+" "+-s+" L "+c+" 0":"L 0 0 L "+d+" "+-s+" L "+c+" 0";var f={label:"Trapezoid Body",position:{x:t,y:e},vertices:r.fromPath(l)};if(h.chamfer){var p=h.chamfer;f.vertices=r.chamfer(f.vertices,p.radius,p.quality,p.qualityMin,p.qualityMax),delete h.chamfer}return a.create(n.extend({},f,h))},s.circle=function(t,e,i,r,a){r=r||{};var o={label:"Circle Body",circleRadius:i};a=a||25;var h=Math.ceil(Math.max(10,Math.min(a,i)));return h%2==1&&(h+=1),s.polygon(t,e,h,i,n.extend({},o,r))},s.polygon=function(t,e,i,o,h){if(h=h||{},i<3)return s.circle(t,e,o,h);for(var l=2*Math.PI/i,u="",d=.5*l,c=0;c0&&r.area(A)1?(p=a.create(n.extend({parts:g.slice(0)},s)),a.setPosition(p,{x:t,y:e}),p):g[0]},s.flagCoincidentParts=function(t,e){void 0===e&&(e=5);for(var i=0;ig&&(g=y),o.translate(v,{x:.5*x,y:.5*y}),d=v.bounds.max.x+n,r.addBody(u,v),l=v,f+=1}else d+=n}c+=g+a,d=t}return u},s.chain=function(t,e,i,s,o,h){for(var l=t.bodies,u=1;u0)for(l=0;l0&&(c=f[l-1+(h-1)*e],r.addConstraint(t,n.create(a.extend({bodyA:c,bodyB:d},o)))),s&&lc||a<(l=c-l)||a>i-1-l))return 1===d&&o.translate(u,{x:(a+(i%2==1?1:-1))*f,y:0}),h(t+(u?a*f:0)+a*n,s,a,l,u,d)})},s.newtonsCradle=function(t,e,i,s,a){for(var o=r.create({label:"Newtons Cradle"}),l=0;lt.max.x&&(t.max.x=r.x),r.xt.max.y&&(t.max.y=r.y),r.y0?t.max.x+=i.x:t.min.x+=i.x,i.y>0?t.max.y+=i.y:t.min.y+=i.y)},e.contains=function(t,e){return e.x>=t.min.x&&e.x<=t.max.x&&e.y>=t.min.y&&e.y<=t.max.y},e.overlaps=function(t,e){return t.min.x<=e.max.x&&t.max.x>=e.min.x&&t.max.y>=e.min.y&&t.min.y<=e.max.y},e.translate=function(t,e){t.min.x+=e.x,t.max.x+=e.x,t.min.y+=e.y,t.max.y+=e.y},e.shift=function(t,e){var i=t.max.x-t.min.x,s=t.max.y-t.min.y;t.min.x=e.x,t.max.x=e.x+i,t.min.y=e.y,t.max.y=e.y+s},e.wrap=function(t,e,i){var s=null,r=null;if(void 0!==e.min.x&&void 0!==e.max.x&&(t.min.x>e.max.x?s=e.min.x-t.max.x:t.max.xe.max.y?r=e.min.y-t.max.y:t.max.y1;if(!c||t!=c.x||e!=c.y){c&&s?(f=c.x,p=c.y):(f=0,p=0);var r={x:f+t,y:p+e};!s&&c||(c=r),g.push(r),v=f+t,y=p+e}},T=function(t){var e=t.pathSegTypeAsLetter.toUpperCase();if("Z"!==e){switch(e){case"M":case"L":case"T":case"C":case"S":case"Q":v=t.x,y=t.y;break;case"H":v=t.x;break;case"V":y=t.y}x(v,y,t.pathSegType)}};for(s._svgPathToAbsolute(t),a=t.getTotalLength(),l=[],i=0;i0)return!1;a=i}return!0},s.scale=function(t,e,i,n){if(1===e&&1===i)return t;var a,o;n=n||s.centre(t);for(var h=0;h=0?h-1:t.length-1],u=t[h],d=t[(h+1)%t.length],c=e[h0&&(n|=2),3===n)return!1;return 0!==n||null},s.hull=function(t){var e,i,s=[],n=[];for((t=t.slice(0)).sort(function(t,e){var i=t.x-e.x;return 0!==i?i:t.y-e.y}),i=0;i=2&&r.cross3(n[n.length-2],n[n.length-1],e)<=0;)n.pop();n.push(e)}for(i=t.length-1;i>=0;i-=1){for(e=t[i];s.length>=2&&r.cross3(s[s.length-2],s[s.length-1],e)<=0;)s.pop();s.push(e)}return s.pop(),n.pop(),s.concat(n)}},55973(t){function e(t,e,i){i=i||0;var s,r,n,a,o,h,l,u=[0,0];return s=t[1][1]-t[0][1],r=t[0][0]-t[1][0],n=s*t[0][0]+r*t[0][1],a=e[1][1]-e[0][1],o=e[0][0]-e[1][0],h=a*e[0][0]+o*e[0][1],S(l=s*o-a*r,0,i)||(u[0]=(o*n-r*h)/l,u[1]=(s*h-a*n)/l),u}function i(t,e,i,s){var r=e[0]-t[0],n=e[1]-t[1],a=s[0]-i[0],o=s[1]-i[1];if(a*n-o*r===0)return!1;var h=(r*(i[1]-t[1])+n*(t[0]-i[0]))/(a*n-o*r),l=(a*(t[1]-i[1])+o*(i[0]-t[0]))/(o*r-a*n);return h>=0&&h<=1&&l>=0&&l<=1}function s(t,e,i){return(e[0]-t[0])*(i[1]-t[1])-(i[0]-t[0])*(e[1]-t[1])}function r(t,e,i){return s(t,e,i)>0}function n(t,e,i){return s(t,e,i)>=0}function a(t,e,i){return s(t,e,i)<0}function o(t,e,i){return s(t,e,i)<=0}t.exports={decomp:function(t){var e=T(t);return e.length>0?w(t,e):[t]},quickDecomp:function t(e,i,s,h,l,u,g){u=u||100,g=g||0,l=l||25,i=void 0!==i?i:[],s=s||[],h=h||[];var m=[0,0],v=[0,0],x=[0,0],T=0,w=0,S=0,C=0,E=0,A=0,_=0,M=[],R=[],P=e,O=e;if(O.length<3)return i;if(++g>u)return console.warn("quickDecomp: max level ("+u+") reached."),i;for(var L=0;LE&&(E+=e.length),C=Number.MAX_VALUE,E3&&s>=0;--s)u(c(t,s-1),c(t,s),c(t,s+1),e)&&(t.splice(s%t.length,1),i++);return i},removeDuplicatePoints:function(t,e){for(var i=t.length-1;i>=1;--i)for(var s=t[i],r=i-1;r>=0;--r)C(s,t[r],e)&&t.splice(i,1)},makeCCW:function(t){for(var e=0,i=t,s=1;si[e][0])&&(e=s);return!r(c(t,e-1),c(t,e),c(t,e+1))&&(function(t){for(var e=[],i=t.length,s=0;s!==i;s++)e.push(t.pop());for(s=0;s!==i;s++)t[s]=e[s]}(t),!0)}};var h=[],l=[];function u(t,e,i,r){if(r){var n=h,a=l;n[0]=e[0]-t[0],n[1]=e[1]-t[1],a[0]=i[0]-e[0],a[1]=i[1]-e[1];var o=n[0]*a[0]+n[1]*a[1],u=Math.sqrt(n[0]*n[0]+n[1]*n[1]),d=Math.sqrt(a[0]*a[0]+a[1]*a[1]);return Math.acos(o/(u*d)){const o=this.getVideoPlaybackQuality(),h=this.mozPresentedFrames||this.mozPaintedFrames||o.totalVideoFrames-o.droppedVideoFrames;if(h>s){const s=this.mozFrameDelay||o.totalFrameDelay-i.totalFrameDelay||0,r=a-n;t(a,{presentationTime:a+1e3*s,expectedDisplayTime:a+r,width:this.videoWidth,height:this.videoHeight,mediaTime:Math.max(0,this.currentTime||0)+r/1e3,presentedFrames:h,processingDuration:s}),delete this._rvfcpolyfillmap[e]}else this._rvfcpolyfillmap[e]=requestAnimationFrame(t=>r(a,t))};return this._rvfcpolyfillmap[e]=requestAnimationFrame(t=>r(e,t)),e},HTMLVideoElement.prototype.cancelVideoFrameCallback=function(t){cancelAnimationFrame(this._rvfcpolyfillmap[t]),delete this._rvfcpolyfillmap[t]})},10312(t){t.exports={SKIP_CHECK:-1,NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16,ERASE:17,SOURCE_IN:18,SOURCE_OUT:19,SOURCE_ATOP:20,DESTINATION_OVER:21,DESTINATION_IN:22,DESTINATION_OUT:23,DESTINATION_ATOP:24,LIGHTER:25,COPY:26,XOR:27}},29795(t){t.exports={DEFAULT:0,LINEAR:0,NEAREST:1}},84322(t){t.exports={MULTIPLY:0,FILL:1,ADD:2,SCREEN:4,OVERLAY:5,HARD_LIGHT:6}},68627(t,e,i){var s=i(19715),r=i(32880),n=i(83419),a=i(8054),o=i(50792),h=i(92503),l=i(56373),u=i(97480),d=i(69442),c=i(8443),f=i(61340),p=new n({Extends:o,initialize:function(t){o.call(this);var e=t.config;this.config={clearBeforeRender:e.clearBeforeRender,backgroundColor:e.backgroundColor,antialias:e.antialias,roundPixels:e.roundPixels,transparent:e.transparent},this.game=t,this.type=a.CANVAS,this.drawCount=0,this.width=0,this.height=0,this.gameCanvas=t.canvas;var i={alpha:e.transparent,desynchronized:e.desynchronized,willReadFrequently:!1};this.gameContext=e.context?e.context:this.gameCanvas.getContext("2d",i),this.currentContext=this.gameContext,this.antialias=e.antialias,this.blendModes=l(),this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92},this._tempMatrix1=new f,this._tempMatrix2=new f,this._tempMatrix3=new f,this.isBooted=!1,this.init()},init:function(){var t=this.game;t.events.once(c.BOOT,function(){var t=this.config;if(!t.transparent){var e=this.gameContext,i=this.gameCanvas;e.fillStyle=t.backgroundColor.rgba,e.fillRect(0,0,i.width,i.height)}},this),t.textures.once(d.READY,this.boot,this)},boot:function(){var t=this.game,e=t.scale.baseSize;this.width=e.width,this.height=e.height,this.isBooted=!0,t.scale.on(u.RESIZE,this.onResize,this),this.resize(e.width,e.height)},onResize:function(t,e){e.width===this.width&&e.height===this.height||this.resize(e.width,e.height)},resize:function(t,e){this.width=t,this.height=e,this.emit(h.RESIZE,t,e)},resetTransform:function(){this.currentContext.setTransform(1,0,0,1,0,0)},setBlendMode:function(t){return this.currentContext.globalCompositeOperation=t,this},setContext:function(t){return this.currentContext=t||this.gameContext,this},setAlpha:function(t){return this.currentContext.globalAlpha=t,this},preRender:function(){var t=this.gameContext,e=this.config,i=this.width,s=this.height;t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),this.emit(h.PRE_RENDER_CLEAR),e.clearBeforeRender&&(t.clearRect(0,0,i,s),e.transparent||(t.fillStyle=e.backgroundColor.rgba,t.fillRect(0,0,i,s))),t.save(),this.drawCount=0,this.emit(h.PRE_RENDER)},render:function(t,e,i){var r=e.length;this.emit(h.RENDER,t,i);var n=i.x,a=i.y,o=i.width,l=i.height,u=i.renderToTexture?i.context:t.sys.context;u.save(),this.game.scene.customViewports&&(u.beginPath(),u.rect(n,a,o,l),u.clip()),i.emit(s.PRE_RENDER,i),this.currentContext=u;var d=i.mask;d&&d.preRenderCanvas(this,null,i._maskCamera),i.transparent||(u.fillStyle=i.backgroundColor.rgba,u.fillRect(n,a,o,l)),u.globalAlpha=i.alpha,u.globalCompositeOperation="source-over",this.drawCount+=r,i.renderToTexture&&i.emit(s.PRE_RENDER,i),i.matrix.copyToContext(u);for(var c=0;c=0?v=-(v+d):v<0&&(v=Math.abs(v)-d)),t.flipY&&(y>=0?y=-(y+c):y<0&&(y=Math.abs(y)-c))}var T=1,w=1;t.flipX&&(f||(v+=-e.realWidth+2*g),T=-1),t.flipY&&(f||(y+=-e.realHeight+2*m),w=-1);var b=t.x,S=t.y;if(i.roundPixels&&(b=Math.floor(b),S=Math.floor(S)),o.applyITRS(b,S,t.rotation,t.scaleX*T,t.scaleY*w),a.copyWithScrollFactorFrom(i.matrixCombined,i.scrollX,i.scrollY,t.scrollFactorX,t.scrollFactorY),s&&a.multiply(s),a.multiply(o),i.renderRoundPixels&&(a.e=Math.floor(a.e+.5),a.f=Math.floor(a.f+.5)),n.save(),a.setToContext(n),n.globalCompositeOperation=this.blendModes[t.blendMode],n.globalAlpha=r,n.imageSmoothingEnabled=!e.source.scaleMode,t.mask&&t.mask.preRenderCanvas(this,t,i),d>0&&c>0){var C=d/p,E=c/p;i.roundPixels&&(v=Math.floor(v+.5),y=Math.floor(y+.5),C+=.5,E+=.5),n.drawImage(e.source.image,l,u,d,c,v,y,C,E)}t.mask&&t.mask.postRenderCanvas(this,t,i),n.restore()}},destroy:function(){this.removeAllListeners(),this.game=null,this.gameCanvas=null,this.gameContext=null}});t.exports=p},55830(t,e,i){t.exports={CanvasRenderer:i(68627),GetBlendModes:i(56373),SetTransform:i(20926)}},56373(t,e,i){var s=i(10312),r=i(89289);t.exports=function(){var t=[],e=r.supportNewBlendModes,i="source-over";return t[s.NORMAL]=i,t[s.ADD]="lighter",t[s.MULTIPLY]=e?"multiply":i,t[s.SCREEN]=e?"screen":i,t[s.OVERLAY]=e?"overlay":i,t[s.DARKEN]=e?"darken":i,t[s.LIGHTEN]=e?"lighten":i,t[s.COLOR_DODGE]=e?"color-dodge":i,t[s.COLOR_BURN]=e?"color-burn":i,t[s.HARD_LIGHT]=e?"hard-light":i,t[s.SOFT_LIGHT]=e?"soft-light":i,t[s.DIFFERENCE]=e?"difference":i,t[s.EXCLUSION]=e?"exclusion":i,t[s.HUE]=e?"hue":i,t[s.SATURATION]=e?"saturation":i,t[s.COLOR]=e?"color":i,t[s.LUMINOSITY]=e?"luminosity":i,t[s.ERASE]="destination-out",t[s.SOURCE_IN]="source-in",t[s.SOURCE_OUT]="source-out",t[s.SOURCE_ATOP]="source-atop",t[s.DESTINATION_OVER]="destination-over",t[s.DESTINATION_IN]="destination-in",t[s.DESTINATION_OUT]="destination-out",t[s.DESTINATION_ATOP]="destination-atop",t[s.LIGHTER]="lighter",t[s.COPY]="copy",t[s.XOR]="xor",t}},20926(t,e,i){var s=i(91296);t.exports=function(t,e,i,r,n){var a=r.alpha*i.alpha;if(a<=0)return!1;var o=s(i,r,n).calc;return e.globalCompositeOperation=t.blendModes[i.blendMode],e.globalAlpha=a,e.save(),o.setToContext(e),e.imageSmoothingEnabled=i.frame?!i.frame.source.scaleMode:t.antialias,!0}},63899(t){t.exports="losewebgl"},6119(t){t.exports="postrender"},31124(t){t.exports="prerenderclear"},48070(t){t.exports="prerender"},15640(t){t.exports="render"},8912(t){t.exports="resize"},87124(t){t.exports="restorewebgl"},53998(t){t.exports="setparalleltextureunits"},92503(t,e,i){t.exports={LOSE_WEBGL:i(63899),POST_RENDER:i(6119),PRE_RENDER:i(48070),PRE_RENDER_CLEAR:i(31124),RENDER:i(15640),RESIZE:i(8912),RESTORE_WEBGL:i(87124),SET_PARALLEL_TEXTURE_UNITS:i(53998)}},36909(t,e,i){t.exports={Events:i(92503),Snapshot:i(89966)},t.exports.Canvas=i(55830),t.exports.WebGL=i(4159)},32880(t,e,i){var s=i(27919),r=i(40987),n=i(95540);t.exports=function(t,e){var i=n(e,"callback"),a=n(e,"type","image/png"),o=n(e,"encoder",.92),h=Math.abs(Math.round(n(e,"x",0))),l=Math.abs(Math.round(n(e,"y",0))),u=Math.floor(n(e,"width",t.width)),d=Math.floor(n(e,"height",t.height));if(n(e,"getPixel",!1)){var c=t.getContext("2d",{willReadFrequently:!1}).getImageData(h,l,1,1).data;i.call(null,new r(c[0],c[1],c[2],c[3]))}else if(0!==h||0!==l||u!==t.width||d!==t.height){var f=s.createWebGL(this,u,d),p=f.getContext("2d",{willReadFrequently:!0});u>0&&d>0&&p.drawImage(t,h,l,u,d,0,0,u,d);var g=new Image;g.onerror=function(){i.call(null),s.remove(f)},g.onload=function(){i.call(null,g),s.remove(f)},g.src=f.toDataURL(a,o)}else{var m=new Image;m.onerror=function(){i.call(null)},m.onload=function(){i.call(null,m)},m.src=t.toDataURL(a,o)}}},88815(t,e,i){var s=i(27919),r=i(40987),n=i(95540);t.exports=function(t,e){var i=t,a=n(e,"callback"),o=n(e,"type","image/png"),h=n(e,"encoder",.92),l=Math.abs(Math.round(n(e,"x",0))),u=Math.abs(Math.round(n(e,"y",0))),d=n(e,"getPixel",!1),c=n(e,"isFramebuffer",!1),f=c?n(e,"bufferWidth",1):i.drawingBufferWidth,p=c?n(e,"bufferHeight",1):i.drawingBufferHeight;if(d){var g=new Uint8Array(4),m=p-u-1;i.readPixels(l,m,1,1,i.RGBA,i.UNSIGNED_BYTE,g),a.call(null,new r(g[0],g[1],g[2],g[3]))}else{var v=Math.floor(n(e,"width",f)),y=Math.floor(n(e,"height",p)),x=new Uint8Array(v*y*4);i.readPixels(l,p-u-y,v,y,i.RGBA,i.UNSIGNED_BYTE,x);for(var T=s.createWebGL(this,v,y),w=T.getContext("2d",{willReadFrequently:!0}),b=w.getImageData(0,0,v,y),S=b.data,C=0;C0},beginDraw:function(){this.framebuffer&&this.renderer.glTextureUnits.unbindTexture(this.texture),this.renderer.glWrapper.update(this.state)},clear:function(t){this.beginDraw(),void 0===t&&(t=this.autoClear),this.renderer.renderNodes.finishBatch(),this.renderer.gl.clear(t)},destroy:function(){this.renderer.deleteTexture(this.texture),this.renderer.deleteFramebuffer(this.state.bindings.framebuffer),this.renderer=null,this.camera=null,this.state=null,this.framebuffer=null,this.texture=null}});t.exports=r},65656(t,e,i){var s=i(83419),r=i(87774),n=new s({initialize:function(t,e,i){this.renderer=t,this.maxAge=e,this.maxPoolSize=i,this.agePool=[],this.sizePool={}},add:function(t){if(-1===this.agePool.indexOf(t)){var e=t.width+"x"+t.height;this.sizePool[e]?this.sizePool[e].push(t):this.sizePool[e]=[t],this.agePool.push(t)}},get:function(t,e){var i,s,n=this.renderer;void 0===t&&(t=n.width),void 0===e&&(e=n.height);var a=n.getMaxTextureSize();t>a&&(t=a),e>a&&(e=a);var o=t+"x"+e,h=this.sizePool[o];if(h&&h.length>0)return i=h.pop(),s=this.agePool.indexOf(i),this.agePool.splice(s,1),i;if(this.agePool.length>0){var l=Date.now(),u=this.maxAge;if(l-(i=this.agePool[0]).lastUsed>u){this.agePool.shift();var d=i.width+"x"+i.height;return s=(h=this.sizePool[d]).indexOf(i),h.splice(s,1),i.resize(t,e),i}}return this.agePool.length0)for(var s=e.splice(0,i),r=0;r0){s+="_";for(var r=0;r0&&(s+="__",s+=i.sort().join("_")),s},createShaderProgram:function(t,e,i,s){var r=e.vertexShader,n=e.fragmentShader;if(r=r.replace(/\r/g,""),n=n.replace(/\r/g,""),i){for(var a,o,h={},l=0;l>>0},getTintAppendFloatAlpha:function(t,e){return((255*e&255)<<24|t)>>>0},getTintAppendFloatAlphaAndSwap:function(t,e){return((255*e&255)<<24|(255&t)<<16|(t>>8&255)<<8|t>>16&255)>>>0},getFloatsFromUintRGB:function(t){return[(t>>16&255)/255,(t>>8&255)/255,(255&t)/255]},checkShaderMax:function(t,e){var i=Math.min(16,t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS));return e&&-1!==e?Math.min(i,e):i},updateLightingUniforms:function(t,e,i,r,n,a,o,h){var l=e.camera,u=l.scene.sys.lights;if(u&&u.active){var d=u.getLights(l),c=d.length,f=u.ambientColor,p=e.height;if(t){i.setUniform("uNormSampler",r),i.setUniform("uCamera",[l.x,l.y,l.rotation,l.zoom]),i.setUniform("uAmbientLightColor",[f.r,f.g,f.b]),i.setUniform("uLightCount",c);for(var g=new s,m=0;m-1?t.getExtension(s):null,e.config.skipUnreadyShaders){var r="KHR_parallel_shader_compile";this.parallelShaderCompileExtension=i.indexOf(r)>-1?t.getExtension(r):null,this.parallelShaderCompileExtension||(e.config.skipUnreadyShaders=!1)}var n="OES_vertex_array_object";this.vaoExtension=i.indexOf(n)>-1?t.getExtension(n):null;var a="OES_standard_derivatives";if(this.standardDerivativesExtension=i.indexOf(a)>-1?t.getExtension(a):null,t instanceof WebGLRenderingContext){if(!this.instancedArraysExtension)throw new Error("ANGLE_instanced_arrays extension not supported. Required for rendering.");if(t.vertexAttribDivisor=this.instancedArraysExtension.vertexAttribDivisorANGLE.bind(this.instancedArraysExtension),t.drawArraysInstanced=this.instancedArraysExtension.drawArraysInstancedANGLE.bind(this.instancedArraysExtension),t.drawElementsInstanced=this.instancedArraysExtension.drawElementsInstancedANGLE.bind(this.instancedArraysExtension),!this.vaoExtension)throw new Error("OES_vertex_array_object extension not supported. Required for rendering.");if(t.createVertexArray=this.vaoExtension.createVertexArrayOES.bind(this.vaoExtension),t.bindVertexArray=this.vaoExtension.bindVertexArrayOES.bind(this.vaoExtension),t.deleteVertexArray=this.vaoExtension.deleteVertexArrayOES.bind(this.vaoExtension),t.isVertexArray=this.vaoExtension.isVertexArrayOES.bind(this.vaoExtension),this.standardDerivativesExtension)t.FRAGMENT_SHADER_DERIVATIVE_HINT=this.standardDerivativesExtension.FRAGMENT_SHADER_DERIVATIVE_HINT_OES;else if(e.config.smoothPixelArt)throw new Error("OES_standard_derivatives extension not supported. Cannot use smoothPixelArt.")}},setContextHandlers:function(t,e){this.previousContextLostHandler&&this.canvas.removeEventListener("webglcontextlost",this.previousContextLostHandler,!1),this.previousContextRestoredHandler&&this.canvas.removeEventListener("webglcontextrestored",this.previousContextRestoredHandler,!1),this.contextLostHandler="function"==typeof t?t.bind(this):this.dispatchContextLost.bind(this),this.contextRestoredHandler="function"==typeof e?e.bind(this):this.dispatchContextRestored.bind(this),this.canvas.addEventListener("webglcontextlost",this.contextLostHandler,!1),this.canvas.addEventListener("webglcontextrestored",this.contextRestoredHandler,!1),this.previousContextLostHandler=this.contextLostHandler,this.previousContextRestoredHandler=this.contextRestoredHandler},dispatchContextLost:function(t){this.contextLost=!0,console&&console.warn("WebGL Context lost. Renderer disabled"),this.emit(h.LOSE_WEBGL,this),t.preventDefault()},dispatchContextRestored:function(t){if(this.gl.isContextLost())console&&console.log("WebGL Context restored, but context is still lost");else{this.setExtensions(),this.glWrapper.update(A.getDefault(this),!0),this.glTextureUnits.init(),this.compression=this.getCompressedTextures();var e=function(t){t.createResource()};s(this.glTextureWrappers,e),s(this.glBufferWrappers,e),s(this.glFramebufferWrappers,e),s(this.glProgramWrappers,e),s(this.glVAOWrappers,e),this.glTextureUnits.bindUnits(this.glTextureUnits.units,!0),this.resize(this.game.scale.baseSize.width,this.game.scale.baseSize.height),this.contextLost=!1,console&&console.warn("WebGL Context restored. Renderer running again."),this.emit(h.RESTORE_WEBGL,this),t.preventDefault()}},captureFrame:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1)},captureNextFrame:function(){P},getFps:function(){P},log:function(){},startCapture:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=!1),void 0===i&&(i=!1)},stopCapture:function(){P},onCapture:function(t){},onResize:function(t,e){e.width===this.width&&e.height===this.height||this.resize(e.width,e.height)},resize:function(t,e){var i=this.gl;return this.width=t,this.height=e,this.setProjectionMatrix(t,e),this.drawingBufferHeight=i.drawingBufferHeight,this.glWrapper.update({scissor:{box:[0,i.drawingBufferHeight-e,t,e]},viewport:[0,0,t,e]}),this.emit(h.RESIZE,t,e),this},getCompressedTextures:function(){var t="WEBGL_compressed_texture_",e="WEBKIT_"+t,i=function(i,s){var r=i.getExtension(t+s)||i.getExtension(e+s)||i.getExtension("EXT_texture_compression_"+s);if(r){var n={};for(var a in r)n[r[a]]=a;return n}},s=this.gl;return{ETC:i(s,"etc"),ETC1:i(s,"etc1"),ATC:i(s,"atc"),ASTC:i(s,"astc"),BPTC:i(s,"bptc"),RGTC:i(s,"rgtc"),PVRTC:i(s,"pvrtc"),S3TC:i(s,"s3tc"),S3TCSRGB:i(s,"s3tc_srgb"),IMG:!0}},getCompressedTextureName:function(t,e){var i=this.compression[t.toUpperCase()];if(e in i)return i[e]},supportsCompressedTexture:function(t,e){var i=this.compression[t.toUpperCase()];return!!i&&(!e||e in i)},getAspectRatio:function(){return this.width/this.height},setProjectionMatrix:function(t,e,i){return t===this.projectionWidth&&e===this.projectionHeight&&i===this.projectionFlipY||(this.projectionWidth=t,this.projectionHeight=e,this.projectionFlipY=!!i,i?this.projectionMatrix.ortho(0,t,0,e,-1e3,1e3):this.projectionMatrix.ortho(0,t,e,0,-1e3,1e3)),this},setProjectionMatrixFromDrawingContext:function(t){return this.setProjectionMatrix(t.width,t.height,!1)},resetProjectionMatrix:function(){return this.setProjectionMatrix(this.width,this.height)},hasExtension:function(t){return!!this.supportedExtensions&&this.supportedExtensions.indexOf(t)},getExtension:function(t){return this.hasExtension(t)?(t in this.extensions||(this.extensions[t]=this.gl.getExtension(t)),this.extensions[t]):null},addBlendMode:function(t,e){return this.blendModes.push(E.createCombined(this,!0,void 0,e,t[0],t[1]))-1-1},updateBlendMode:function(t,e,i){if(t>17&&this.blendModes[t]){var s=this.blendModes[t];2===e.length?s.func=[e[0],e[1],e[0],e[1]]:s.func=[e[0],e[1],e[2],e[3]],s.equation="number"==typeof i?[i,i]:[i[0],i[1]]}return this},removeBlendMode:function(t){return t>17&&this.blendModes[t]&&this.blendModes.splice(t,1),this},clearFramebuffer:function(t,e,i){var s=this.gl,r=0;t&&(this.glWrapper.updateColorClearValue({colorClearValue:t}),r|=s.COLOR_BUFFER_BIT),void 0!==e&&(this.glWrapper.updateStencilClear({stencil:{clear:e}}),r|=s.STENCIL_BUFFER_BIT),void 0!==i&&(r|=s.DEPTH_BUFFER_BIT),s.clear(r)},createTextureFromSource:function(t,e,i,s,r,n){void 0===r&&(r=!1);var o=this.gl,h=o.NEAREST,u=o.NEAREST,d=o.CLAMP_TO_EDGE;e=t?t.width:e,i=t?t.height:i;var c=l(e,i);if(c&&!r&&(d=o.REPEAT),s===a.ScaleModes.LINEAR&&this.config.antialias){var f=t&&t.compressed,p=!f&&c||f&&t.mipmaps.length>1;h=this.mipmapFilter&&p?this.mipmapFilter:o.LINEAR,u=o.LINEAR}return t||"number"!=typeof e||"number"!=typeof i?this.createTexture2D(0,h,u,d,d,o.RGBA,t,void 0,void 0,void 0,void 0,n):this.createTexture2D(0,h,u,d,d,o.RGBA,null,e,i,void 0,void 0,n)},createTexture2D:function(t,e,i,s,r,n,a,o,h,l,u,d){"number"!=typeof o&&(o=a?a.width:1),"number"!=typeof h&&(h=a?a.height:1);var c=new w(this,t,e,i,s,r,n,a,o,h,l,u,d);return this.glTextureWrappers.push(c),c},createFramebuffer:function(t,e,i){Array.isArray(t)||null===t||(t=[t]);var s=new S(this,t,e,i);return this.glFramebufferWrappers.push(s),s},createProgram:function(t,e){var i=new x(this,t,e);return this.glProgramWrappers.push(i),i},createVertexBuffer:function(t,e){var i=this.gl,s=new v(this,t,i.ARRAY_BUFFER,e);return this.glBufferWrappers.push(s),s},createIndexBuffer:function(t,e){var i=this.gl,s=new v(this,t,i.ELEMENT_ARRAY_BUFFER,e);return this.glBufferWrappers.push(s),s},createVAO:function(t,e,i){var s=new C(this,t,e,i);return this.glVAOWrappers.push(s),s},deleteTexture:function(t){if(t)return r(this.glTextureWrappers,t),t.destroy(),this},deleteFramebuffer:function(t){return t?(r(this.glFramebufferWrappers,t),t.destroy(),this):this},deleteProgram:function(t){return t&&(r(this.glProgramWrappers,t),t.destroy()),this},deleteBuffer:function(t){return t?(r(this.glBufferWrappers,t),t.destroy(),this):this},preRender:function(){if(!this.contextLost){this.emit(h.PRE_RENDER_CLEAR);var t=this.baseDrawingContext;if(this.config.clearBeforeRender){var e=this.config.backgroundColor;t.setClearColor(e.redGL,e.greenGL,e.blueGL,e.alphaGL),t.setAutoClear(!0,!0,!0)}else t.setAutoClear(!1,!1,!1);t.use(),this.emit(h.PRE_RENDER)}},render:function(t,e,i){this.contextLost||(this.emit(h.RENDER,t,i),this.currentViewCamera=i,this.cameraRenderNode.run(this.baseDrawingContext,e,i),this.currentViewCamera=null)},postRender:function(){if(this.baseDrawingContext.release(),!this.contextLost){this.emit(h.POST_RENDER);var t=this.snapshotState;t.callback&&(m(this.gl,t),t.callback=null)}},drawElements:function(t,e,i,s,r,n,a){var o=this.gl;t.beginDraw(),i.bind(),s.bind(),this.glTextureUnits.bindUnits(e),o.drawElements(a||o.TRIANGLE_STRIP,r,o.UNSIGNED_SHORT,n)},drawInstancedArrays:function(t,e,i,s,r,n,a,o){var h=this.gl;t.beginDraw(),i.bind(),s.bind(),this.glTextureUnits.bindUnits(e),h.drawArraysInstanced(o||h.TRIANGLE_STRIP,r,n,a)},snapshot:function(t,e,i){return this.snapshotArea(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight,t,e,i)},snapshotArea:function(t,e,i,s,r,n,a){var o=this.snapshotState;return o.callback=r,o.type=n,o.encoder=a,o.getPixel=!1,o.x=t,o.y=e,o.width=i,o.height=s,o.unpremultiplyAlpha=this.game.config.premultipliedAlpha,this},snapshotPixel:function(t,e,i){return this.snapshotArea(t,e,1,1,i),this.snapshotState.getPixel=!0,this},snapshotFramebuffer:function(t,e,i,s,r,n,a,o,h,l,u){void 0===r&&(r=!1),void 0===n&&(n=0),void 0===a&&(a=0),void 0===o&&(o=e),void 0===h&&(h=i),"pixel"===l&&(r=!0,l="image/png"),this.snapshotArea(n,a,o,h,s,l,u);var d=this.snapshotState;return d.getPixel=r,d.isFramebuffer=!0,d.bufferWidth=e,d.bufferHeight=i,d.width=Math.min(d.width,e),d.height=Math.min(d.height,i),this.glWrapper.updateBindingsFramebuffer({bindings:{framebuffer:t}}),m(this.gl,d),d.callback=null,d.isFramebuffer=!1,this},canvasToTexture:function(t,e,i,s){void 0===i&&(i=!1),void 0===s&&(s=!0);var r=this.gl,n=r.NEAREST,a=r.NEAREST,o=t.width,h=t.height,u=r.CLAMP_TO_EDGE,d=l(o,h);return!i&&d&&(u=r.REPEAT),this.config.antialias&&(n=d&&this.mipmapFilter?this.mipmapFilter:r.LINEAR,a=r.LINEAR),e?(e.update(t,o,h,s,u,u,n,a,e.format),e):this.createTexture2D(0,n,a,u,u,r.RGBA,t,o,h,!0,!1,s)},createCanvasTexture:function(t,e,i){return void 0===e&&(e=!1),void 0===i&&(i=!0),this.canvasToTexture(t,null,e,i)},updateCanvasTexture:function(t,e,i,s){return void 0===i&&(i=!0),void 0===s&&(s=!1),this.canvasToTexture(t,e,s,i)},videoToTexture:function(t,e,i,s){void 0===i&&(i=!1),void 0===s&&(s=!0);var r=this.gl,n=r.NEAREST,a=r.NEAREST,o=t.videoWidth,h=t.videoHeight,u=r.CLAMP_TO_EDGE,d=l(o,h);return!i&&d&&(u=r.REPEAT),this.config.antialias&&(n=d&&this.mipmapFilter?this.mipmapFilter:r.LINEAR,a=r.LINEAR),e?(e.update(t,o,h,s,u,u,n,a,e.format),e):this.createTexture2D(0,n,a,u,u,r.RGBA,t,o,h,!0,!0,s)},createVideoTexture:function(t,e,i){return void 0===e&&(e=!1),void 0===i&&(i=!0),this.videoToTexture(t,null,e,i)},updateVideoTexture:function(t,e,i,s){return void 0===i&&(i=!0),void 0===s&&(s=!1),this.videoToTexture(t,e,s,i)},createUint8ArrayTexture:function(t,e,i,s,r){var n=this.gl,a=n.NEAREST,o=n.NEAREST,h=n.CLAMP_TO_EDGE;return l(e,i)&&(h=n.REPEAT),void 0===s&&(s=!0),void 0===r&&(r=!0),this.createTexture2D(0,a,o,h,h,n.RGBA,t,e,i,s,!1,r)},setTextureFilter:function(t,e){var i=this.gl,s=0===e?i.LINEAR:i.NEAREST,r=this.glTextureUnits,n=r.units[0];return r.bind(t,0),t.update(t.pixels,t.width,t.height,t.flipY,t.wrapS,t.wrapT,s,s,t.format),n&&r.bind(n,0),this},setTextureWrap:function(t,e,i){var s=this.gl;if(!l(t.width,t.height)&&(e!==s.CLAMP_TO_EDGE||i!==s.CLAMP_TO_EDGE))return this;var r=this.glTextureUnits,n=r.units[0];return r.bind(t,0),t.update(t.pixels,t.width,t.height,t.flipY,e,i,t.minFilter,t.magFilter,t.format),n&&r.bind(n,0),this},getMaxTextureSize:function(){return this.config.maxTextureSize},destroy:function(){this.off(h.RESIZE,this.baseDrawingContext.resize,this.baseDrawingContext),this.canvas.removeEventListener("webglcontextlost",this.contextLostHandler,!1),this.canvas.removeEventListener("webglcontextrestored",this.contextRestoredHandler,!1);var t=function(t){t.destroy()};s(this.glBufferWrappers,t),s(this.glFramebufferWrappers,t),s(this.glProgramWrappers,t),s(this.glTextureWrappers,t),this.removeAllListeners(),this.extensions={},this.gl=null,this.game=null,this.canvas=null,this.contextLost=!0}});t.exports=O},14500(t){t.exports={BYTE:{enum:5120,size:1},UNSIGNED_BYTE:{enum:5121,size:1},SHORT:{enum:5122,size:2},UNSIGNED_SHORT:{enum:5123,size:2},INT:{enum:5124,size:4},UNSIGNED_INT:{enum:5125,size:4},FLOAT:{enum:5126,size:4}}},4159(t,e,i){var s=i(14500),r=i(79291),n={Shaders:i(89350),ShaderAdditionMakers:i(83786),DrawingContext:i(87774),DrawingContextPool:i(65656),ProgramManager:i(56436),RenderNodes:i(54521),ShaderProgramFactory:i(18804),Utils:i(70554),WebGLRenderer:i(74797),Wrappers:i(31884)};n=r(!1,n,s),t.exports=n},47774(t){var e={createCombined:function(t,e,i,s,r,n){var a=t.gl;return void 0===e&&(e=!0),void 0===i&&(i=[0,0,0,0]),void 0===s&&(s=a.FUNC_ADD),void 0===r&&(r=a.ONE),void 0===n&&(n=a.ONE_MINUS_SRC_ALPHA),{enabled:e,color:i,equation:[s,s],func:[r,n,r,n]}},createSeparate:function(t,e,i,s,r,n,a,o,h){var l=t.gl;return void 0===e&&(e=!0),void 0===i&&(i=[0,0,0,0]),void 0===s&&(s=l.FUNC_ADD),void 0===r&&(r=l.FUNC_ADD),void 0===n&&(n=l.ONE),void 0===a&&(a=l.ONE_MINUS_SRC_ALPHA),void 0===o&&(o=l.ONE),void 0===h&&(h=l.ONE_MINUS_SRC_ALPHA),{enabled:e,color:i,equation:[s,r],func:[n,a,o,h]}}};t.exports=e},53314(t,e,i){var s=i(8054),r=i(62644),n=i(71623),a={getDefault:function(t){return{bindings:{activeTexture:0,arrayBuffer:null,elementArrayBuffer:null,framebuffer:null,program:null,renderbuffer:null},blend:r(t.blendModes[s.BlendModes.NORMAL]),colorClearValue:[0,0,0,1],colorWritemask:[!0,!0,!0,!0],cullFace:!1,depthTest:!1,scissor:{enable:!0,box:[0,0,0,0]},stencil:n.create(t),texturing:{flipY:!1,premultiplyAlpha:!1},vao:null,viewport:[0,0,0,0]}}};t.exports=a},71623(t){var e={create:function(t,e,i,s,r,n,a,o,h){var l=t.gl;return void 0===e&&(e=!1),void 0===i&&(i=l.ALWAYS),void 0===s&&(s=0),void 0===r&&(r=255),void 0===n&&(n=l.KEEP),void 0===a&&(a=l.KEEP),void 0===o&&(o=l.KEEP),void 0===h&&(h=0),{enabled:e,func:{func:i,ref:s,mask:r},op:{fail:n,zfail:a,zpass:o},clear:h}}};t.exports=e},13961(t,e,i){var s=i(83419),r=i(56436),n=i(40952),a=i(6141),o=i(36909),h=new s({Extends:a,initialize:function(t,e,i){var s=t.renderer,h=s.gl,l=(i=this._copyAndCompleteConfig(t,i||{},e)).name;if(!l)throw new Error("BatchHandler must have a name");a.call(this,l,t),this.instancesPerBatch=-1,this.verticesPerInstance=i.verticesPerInstance;var u=Math.floor(65536/this.verticesPerInstance),d=i.instancesPerBatch||s.config.batchSize||u;this.instancesPerBatch=Math.min(d,u),this.indicesPerInstance=i.indicesPerInstance,this.bytesPerIndexPerInstance=this.indicesPerInstance*Uint16Array.BYTES_PER_ELEMENT,this.maxTexturesPerBatch=1,this.manager.on(o.Events.SET_PARALLEL_TEXTURE_UNITS,this.updateTextureCount,this),s.glWrapper.updateVAO({vao:null}),this.indexBuffer=s.createIndexBuffer(this._generateElementIndices(this.instancesPerBatch),i.indexBufferDynamic?h.DYNAMIC_DRAW:h.STATIC_DRAW);var c=i.vertexBufferLayout;if(c.count=this.instancesPerBatch*this.verticesPerInstance,this.vertexBufferLayout=new n(s,c,null),this.programManager=new r(s,[this.vertexBufferLayout],this.indexBuffer),this.programManager.setBaseShader(i.shaderName,i.vertexSource,i.fragmentSource),i.shaderAdditions)for(var f=0;fthis.instancesPerBatch)throw new Error("BatchHandlerStrip: Vertex count exceeds maximum per batch ("+this.maxVerticesPerBatch+")");this.instanceCount+c>this.instancesPerBatch&&this.run(t),this.updateRenderOptions(u),this._renderOptionsChanged&&(this.run(t),this.updateShaderConfig());var f,g=this.batchTextures(s),m=this.instanceCount*this.floatsPerInstance,v=this.vertexBufferLayout.buffer,y=v.viewF32,x=v.viewU32,T=!1;if(this.instanceCount>0){var w=1+this.floatsPerInstance/this.verticesPerInstance;y[m++]=y[m-w],y[m++]=y[m-w],y[m++]=y[m-w],y[m++]=y[m-w],y[m++]=y[m-w],y[m++]=y[m-w],x[m++]=x[m-w],T=!0}d&&(f=[]);for(var b=i.a,S=i.b,C=i.c,E=i.d,A=i.e,_=i.f,M=r.length,R=0;R=u.length)&&(n++,this.run(t),d=this.instanceCount*this.indicesPerInstance,g=this.vertexCount*h/f.BYTES_PER_ELEMENT,v=0,x=0)}}});t.exports=c},61842(t,e,i){var s=i(19715),r=i(1e3),n=i(61340),a=i(87841),o=i(43855),h=i(83419),l=i(70554),u=i(6141);function d(t){return l.getTintAppendFloatAlpha(16777215,t)}var c=new h({Extends:u,initialize:function(t){u.call(this,"Camera",t),this.batchHandlerQuadSingleNode=t.getNode("BatchHandlerQuadSingle"),this.fillCameraNode=t.getNode("FillCamera"),this.listCompositorNode=t.getNode("ListCompositor"),this._parentTransformMatrix=new n},run:function(t,e,i,n,h,l){var u;this.onRunBegin(t);var c=t.renderer.drawingContextPool,f=this.manager,p=i.alpha,g=i.filters.internal.getActive(),m=i.filters.external.getActive(),v=h||i.forceComposite||g.length||m.length||p<1;n?i.matrixExternal.multiply(n,n):n=this._parentTransformMatrix.copyFrom(i.matrixExternal);var y=n.decomposeMatrix(),x=o(y.translateX,0)&&o(y.translateY,0)&&o(y.rotation,0)&&o(y.scaleX,1)&&o(y.scaleY,1),T=i.x,w=i.y,b=i.width,S=i.height,C=t.getClone();C.setCamera(i),v?((u=c.get(b,S)).setCamera(i),u.setScissorBox(0,0,b,S)):(u=C).setScissorBox(T,w,b,S),u.use();var E=this.fillCameraNode;if(i.backgroundColor.alphaGL>0){var A=i.backgroundColor,_=r(A.red,A.green,A.blue,A.alpha);E.run(u,_,v)}this.listCompositorNode.run(u,e,null,l);var M=i.flashEffect;M.postRenderWebGL()&&(_=r(M.red,M.green,M.blue,255*M.alpha),E.run(u,_,v));var R=i.fadeEffect;if(R.postRenderWebGL()&&(_=r(R.red,R.green,R.blue,255*R.alpha),E.run(u,_,v)),f.finishBatch(),v){var P,O,L,D,F={smoothPixelArt:f.renderer.game.config.smoothPixelArt},I=new a(0,0,u.width,u.height);for(P=0;P0,k=!B,U=new a(0,0,C.width,C.height);if(B){for(P=m.length-1;P>=0;P--)(O=m[P]).active&&(L=O.getPaddingCeil(),U.setTo(U.x+L.x,U.y+L.y,U.width+L.width,U.height+L.height));(k=U.width!==u.width||U.height!==u.height||!x)&&((u=c.get(U.width,U.height)).setScissorBox(0,0,U.width,U.height),u.setCamera(C.camera),u.use())}else u=C;if(k){var z,Y=U.x,X=U.y;n.setQuad(I.x,I.y,I.x+I.width,I.y+I.height),z=n.quad,D=B?4294967295:d(p),i.roundPixels&&(z[0]=Math.round(z[0]),z[1]=Math.round(z[1]),z[2]=Math.round(z[2]),z[3]=Math.round(z[3]),z[4]=Math.round(z[4]),z[5]=Math.round(z[5]),z[6]=Math.round(z[6]),z[7]=Math.round(z[7])),this.batchHandlerQuadSingleNode.batch(u,N.texture,z[0]-Y,z[1]-X,z[2]-Y,z[3]-X,z[6]-Y,z[7]-X,z[4]-Y,z[5]-X,0,1,1,-1,!1,D,D,D,D,F)}if(N!==u&&N.release(),B){var W=!1;for(N=null,L=new a,P=0;P0&&d2&&g>1&&(m=!0,r||(v=!0));for(var y,x,T,w,b,S,C,E,A=[],_=0,M=[],R=0,P=[],O=0,L=u*u,D=0;D0){var l=e,u=e;if(a.length>0){r=h;for(var d=0;d0)for(r=h,d=0;d0){var r=this.instanceBufferLayout.buffer,n=i.memberCount,a=Math.floor(n/i.bufferUpdateSegmentSize),o=!0;for(e=0;e<=a;e++)if(!(1<0&&e.addAddition(h(t.tileset.maxAnimationLength));for(var r=t.lighting,n=e.getAdditionsByTag("LIGHTING"),a=0;a0,T=[y,e.layerDataTexture];if(x&&(T[2]=v.getAnimationDataTexture(r)),e.lighting){var w=v.image.dataSource[0];w=w?w.glTexture:this.manager.renderer.normalTexture,T[3]=w}this.updateRenderOptions(e);var b=this.programManager,S=b.getCurrentProgramSuite();if(S){var C=S.program,E=S.vao;this.setupUniforms(t,e),b.applyUniforms(C),r.drawElements(t,T,C,E,4,0)}this.onRunEnd(t)}});t.exports=y},12913(t,e,i){var s=i(83419),r=i(6141),n=new s({Extends:r,initialize:function(t){r.call(this,"TexturerImage",t),this.frame=null,this.frameWidth=0,this.frameHeight=0,this.uvSource=null},run:function(t,e,i){this.onRunBegin(t);var s=e.frame;if(this.frame=s,this.frameWidth=s.cutWidth,this.frameHeight=s.cutHeight,this.uvSource=s,e.isCropped){var r=e._crop;this.uvSource=r,r.flipX===e.flipX&&r.flipY===e.flipY||e.frame.updateCropUVs(r,e.flipX,e.flipY),this.frameWidth=r.width,this.frameHeight=r.height}var n=s.source.resolution;this.frameWidth/=n,this.frameHeight/=n,this.onRunEnd(t)}});t.exports=n},22995(t,e,i){var s=i(61340),r=i(83419),n=i(6141),a=new r({Extends:n,initialize:function(t){n.call(this,"TexturerTileSprite",t),this.frame=null,this.uvMatrix=new s},run:function(t,e,i){this.onRunBegin(t);var s=e.frame;if(this.frame=s,e.isCropped){var r=e._crop;r.flipX===e.flipX&&r.flipY===e.flipY||e.frame.updateCropUVs(r,e.flipX,e.flipY)}this.uvMatrix.loadIdentity(),this.uvMatrix.scale(1/s.width,1/s.height),this.uvMatrix.translate(e.tilePositionX,e.tilePositionY),this.uvMatrix.scale(1/e.tileScaleX,1/e.tileScaleY),this.uvMatrix.rotate(-e.tileRotation),this.uvMatrix.setQuad(0,0,e.width,e.height),this.onRunEnd(t)}});t.exports=a},86081(t,e,i){var s=i(61340),r=i(83419),n=i(46975),a=i(6141),o=new r({Extends:a,initialize:function(t,e){e=n(e||{},this.defaultConfig),a.call(this,e.name,t),this.quad=new Float32Array(8),this._spriteMatrix=new s,this._calcMatrix=new s},defaultConfig:{name:"TransformerImage",role:"Transformer"},run:function(t,e,i,s,r){this.onRunBegin(t);var n=i.frame,a=i.uvSource,o=a.x,h=a.y,l=e.displayOriginX,u=e.displayOriginY,d=-l+o,c=-u+h,f=n.customPivot,p=1,g=1;e.flipX&&(f||(d+=-n.realWidth+2*l),p=-1),e.flipY&&(f||(c+=-n.realHeight+2*u),g=-1);var m=t.camera,v=this._spriteMatrix,y=this._calcMatrix.copyWithScrollFactorFrom(m.getViewMatrix(!t.useCanvas),m.scrollX,m.scrollY,e.scrollFactorX,e.scrollFactorY);s&&y.multiply(s),v.applyITRS(e.x,e.y,e.rotation,e.scaleX*p,e.scaleY*g),y.multiply(v),y.setQuad(d,c,d+i.frameWidth,c+i.frameHeight,this.quad);var x=y.matrix,T=1===x[0]&&0===x[1]&&0===x[2]&&1===x[3];if(e.willRoundVertices(m,T)){var w=this.quad;w[0]=Math.round(w[0]),w[1]=Math.round(w[1]),w[2]=Math.round(w[2]),w[3]=Math.round(w[3]),w[4]=Math.round(w[4]),w[5]=Math.round(w[5]),w[6]=Math.round(w[6]),w[7]=Math.round(w[7])}this.onRunEnd(t)}});t.exports=o},88383(t,e,i){var s=i(61340),r=i(83419),n=i(46975),a=i(6141),o=new r({Extends:a,initialize:function(t,e){e=n(e||{},this.defaultConfig),a.call(this,e.name,t),this._spriteMatrix=new s,this.quad=this._spriteMatrix.quad},defaultConfig:{name:"TransformerStamp",role:"Transformer"},run:function(t,e,i,s,r){this.onRunBegin(t);var n=i.frame,a=i.uvSource,o=a.x,h=a.y,l=e.displayOriginX,u=e.displayOriginY,d=-l+o,c=-u+h,f=n.customPivot,p=1,g=1;e.flipX&&(f||(d+=-n.realWidth+2*l),p=-1),e.flipY&&(f||(c+=-n.realHeight+2*u),g=-1);var m=e.x,v=e.y,y=this._spriteMatrix;y.applyITRS(m,v,e.rotation,e.scaleX*p,e.scaleY*g);var x=y.matrix;this.onlyTranslate=1===x[0]&&0===x[1]&&0===x[2]&&1===x[3],y.setQuad(d,c,d+i.frameWidth,c+i.frameHeight);var T=y.matrix,w=1===T[0]&&0===T[1]&&0===T[2]&&1===T[3];if(e.willRoundVertices(t.camera,w)){var b=this.quad;b[0]=Math.round(b[0]),b[1]=Math.round(b[1]),b[2]=Math.round(b[2]),b[3]=Math.round(b[3]),b[4]=Math.round(b[4]),b[5]=Math.round(b[5]),b[6]=Math.round(b[6]),b[7]=Math.round(b[7])}this.onRunEnd(t)}});t.exports=o},34454(t,e,i){var s=i(83419),r=i(86081),n=new s({Extends:r,initialize:function(t,e){r.call(this,t,e)},defaultConfig:{name:"TransformerTile",role:"Transformer"},run:function(t,e,i,s,r){this.onRunBegin(t);var n=t.camera,a=this._calcMatrix,o=this._spriteMatrix;a.copyWithScrollFactorFrom(n.getViewMatrix(!t.useCanvas),n.scrollX,n.scrollY,e.scrollFactorX,e.scrollFactorY),s&&a.multiply(s);var h=i.frameWidth,l=i.frameHeight,u=h,d=l,c=h/2,f=l/2,p=e.scaleX,g=e.scaleY,m=e.gidMap[r.index],v=m.tileOffset.x,y=m.tileOffset.y,x=e.x+r.pixelX*p+(c*p-v),T=e.y+r.pixelY*g+(f*g-y),w=-c,b=-f;r.flipX&&(u*=-1,w+=h),r.flipY&&(d*=-1,w+=l),o.applyITRS(x,T,r.rotation,p,g),a.multiply(o),a.setQuad(w,b,w+u,b+d,this.quad);var S=a.matrix,C=1===S[0]&&0===S[1]&&0===S[2]&&1===S[3];if(e.willRoundVertices(n,C)){var E=this.quad;E[0]=Math.round(E[0]),E[1]=Math.round(E[1]),E[2]=Math.round(E[2]),E[3]=Math.round(E[3]),E[4]=Math.round(E[4]),E[5]=Math.round(E[5]),E[6]=Math.round(E[6]),E[7]=Math.round(E[7])}this.onRunEnd(t)}});t.exports=n},46211(t,e,i){var s=i(83419),r=i(86081),n=new s({Extends:r,initialize:function(t,e){r.call(this,t,e)},defaultConfig:{name:"TransformerTileSprite",role:"Transformer"},run:function(t,e,i,s,r){this.onRunBegin(t);var n=e.width,a=e.height,o=e.displayOriginX,h=e.displayOriginY,l=-o,u=-h,d=1,c=1;e.flipX&&(l+=2*o-n,d=-1),e.flipY&&(u+=2*h-a,c=-1);var f=e.x,p=e.y,g=t.camera,m=this._calcMatrix,v=this._spriteMatrix;m.copyWithScrollFactorFrom(g.getViewMatrix(!t.useCanvas),g.scrollX,g.scrollY,e.scrollFactorX,e.scrollFactorY),s&&m.multiply(s),v.applyITRS(f,p,e.rotation,e.scaleX*d,e.scaleY*c),m.multiply(v),m.setQuad(l,u,l+n,u+a,this.quad);var y=m.matrix,x=1===y[0]&&0===y[1]&&0===y[2]&&1===y[3];if(e.willRoundVertices(g,x)){var T=this.quad;T[0]=Math.round(T[0]),T[1]=Math.round(T[1]),T[2]=Math.round(T[2]),T[3]=Math.round(T[3]),T[4]=Math.round(T[4]),T[5]=Math.round(T[5]),T[6]=Math.round(T[6]),T[7]=Math.round(T[7])}this.onRunEnd(t)}});t.exports=n},84547(t){t.exports=["vec4 applyLighting (vec4 fragColor, vec3 normal)","{"," vec4 lighting = getLighting(fragColor, normal);"," return fragColor * vec4(lighting.rgb * lighting.a, lighting.a);","}"].join("\n")},11104(t){t.exports=["vec4 applyTint(vec4 texture)","{"," vec3 unpremultTexture = texture.rgb / texture.a;"," float alpha = texture.a * outTint.a;"," vec3 color = vec3(unpremultTexture);"," if (outTintEffect == 0.0) {"," color *= outTint.bgr;"," }"," else if (outTintEffect == 1.0) {"," color = outTint.bgr;"," }"," else if (outTintEffect == 2.0) {"," color += outTint.bgr;"," }"," else if (outTintEffect == 4.0) {"," color = 1.0 - (1.0 - unpremultTexture) * (1.0 - outTint.bgr);"," }"," else if (outTintEffect == 5.0) {"," color = vec3("," unpremultTexture.r < 0.5 ? 2.0 * outTint.b * unpremultTexture.r : 1.0 - 2.0 * (1.0 - outTint.b) * (1.0 - unpremultTexture.r),"," unpremultTexture.g < 0.5 ? 2.0 * outTint.g * unpremultTexture.g : 1.0 - 2.0 * (1.0 - outTint.g) * (1.0 - unpremultTexture.g),"," unpremultTexture.b < 0.5 ? 2.0 * outTint.r * unpremultTexture.b : 1.0 - 2.0 * (1.0 - outTint.r) * (1.0 - unpremultTexture.b)"," );"," }"," else if (outTintEffect == 6.0) {"," color = vec3("," outTint.b < 0.5 ? 2.0 * outTint.b * unpremultTexture.r : 1.0 - 2.0 * (1.0 - outTint.b) * (1.0 - unpremultTexture.r),"," outTint.g < 0.5 ? 2.0 * outTint.g * unpremultTexture.g : 1.0 - 2.0 * (1.0 - outTint.g) * (1.0 - unpremultTexture.g),"," outTint.r < 0.5 ? 2.0 * outTint.r * unpremultTexture.b : 1.0 - 2.0 * (1.0 - outTint.r) * (1.0 - unpremultTexture.b)"," );"," }"," return vec4(color * alpha, alpha);","}"].join("\n")},81556(t){t.exports=["vec4 boundedSampler(sampler2D sampler, vec2 uv)","{"," if (clamp(uv, 0.0, 1.0) != uv)"," {"," return vec4(0.0, 0.0, 0.0, 0.0);"," }"," return texture2D(sampler, uv);","}"].join("\n")},96293(t){t.exports=["#define SHADER_NAME PHASER_COLORMATRIX_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform float uColorMatrix[20];","uniform float uAlpha;","varying vec2 outTexCoord;","void main ()","{"," vec4 c = texture2D(uMainSampler, outTexCoord);"," if (uAlpha == 0.0)"," {"," gl_FragColor = c;"," return;"," }"," if (c.a > 0.0)"," {"," c.rgb /= c.a;"," }"," vec4 result;"," result.r = (uColorMatrix[0] * c.r) + (uColorMatrix[1] * c.g) + (uColorMatrix[2] * c.b) + (uColorMatrix[3] * c.a) + uColorMatrix[4];"," result.g = (uColorMatrix[5] * c.r) + (uColorMatrix[6] * c.g) + (uColorMatrix[7] * c.b) + (uColorMatrix[8] * c.a) + uColorMatrix[9];"," result.b = (uColorMatrix[10] * c.r) + (uColorMatrix[11] * c.g) + (uColorMatrix[12] * c.b) + (uColorMatrix[13] * c.a) + uColorMatrix[14];"," result.a = (uColorMatrix[15] * c.r) + (uColorMatrix[16] * c.g) + (uColorMatrix[17] * c.b) + (uColorMatrix[18] * c.a) + uColorMatrix[19];"," c.rgb *= c.a;"," result.rgb *= result.a;"," gl_FragColor = mix(c, result, uAlpha);","}"].join("\n")},78390(t){t.exports=["vec2 v2len (vec2 a, vec2 b)","{"," return sqrt(a*a+b*b);","}","vec2 getBlockyTexCoord (vec2 texCoord, vec2 texRes) {"," texCoord *= texRes;"," vec2 seam = floor(texCoord + 0.5);"," texCoord = (texCoord - seam) / v2len(dFdx(texCoord), dFdy(texCoord)) + seam;"," texCoord = clamp(texCoord, seam-.5, seam+.5);"," return texCoord / texRes;","}"].join("\n")},11719(t){t.exports=["struct Light","{"," vec3 position;"," vec3 color;"," float intensity;"," float radius;","};","const int kMaxLights = LIGHT_COUNT;","uniform vec4 uCamera; /* x, y, rotation, zoom */","uniform sampler2D uNormSampler;","uniform vec3 uAmbientLightColor;","uniform Light uLights[kMaxLights];","uniform int uLightCount;","#ifdef FEATURE_SELFSHADOW","uniform float uDiffuseFlatThreshold;","uniform float uPenumbra;","#endif","vec4 getLighting (vec4 fragColor, vec3 normal)","{"," vec3 finalColor = vec3(0.0);"," vec2 res = vec2(min(uResolution.x, uResolution.y)) * uCamera.w;"," #ifdef FEATURE_SELFSHADOW"," vec3 unpremultipliedColor = fragColor.rgb / fragColor.a;"," float occlusionThreshold = 1.0 - ((unpremultipliedColor.r + unpremultipliedColor.g + unpremultipliedColor.b) / uDiffuseFlatThreshold);"," #endif"," for (int index = 0; index < kMaxLights; ++index)"," {"," if (index < uLightCount)"," {"," Light light = uLights[index];"," vec3 lightDir = vec3((light.position.xy / res) - (gl_FragCoord.xy / res), light.position.z / res.x);"," vec3 lightNormal = normalize(lightDir);"," float distToSurf = length(lightDir) * uCamera.w;"," float diffuseFactor = max(dot(normal, lightNormal), 0.0);"," float radius = (light.radius / res.x * uCamera.w) * uCamera.w;"," float attenuation = clamp(1.0 - distToSurf * distToSurf / (radius * radius), 0.0, 1.0);"," #ifdef FEATURE_SELFSHADOW"," float occluded = smoothstep(0.0, 1.0, (diffuseFactor - occlusionThreshold) / uPenumbra);"," vec3 diffuse = light.color * diffuseFactor * occluded;"," #else"," vec3 diffuse = light.color * diffuseFactor;"," #endif"," finalColor += (attenuation * diffuse) * light.intensity;"," }"," }"," vec4 colorOutput = vec4(uAmbientLightColor + finalColor, 1.0);"," return colorOutput;","}"].join("\n")},14030(t){t.exports=["vec2 clampTexCoordWithinFrame (vec2 texCoord)","{"," vec2 texRes = getTexRes();"," vec4 frameTexel = outFrame * texRes.xyxy;"," vec2 frameMin = frameTexel.xy + vec2(0.5, 0.5);"," vec2 frameMax = frameTexel.xy + frameTexel.zw - vec2(0.5, 0.5);"," return clamp(texCoord, frameMin / texRes, frameMax / texRes);","}"].join("\n")},10235(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform float amount;","varying vec2 outTexCoord;","#pragma phaserTemplate(fragmentHeader)","vec2 Distort(vec2 p)","{"," float theta = atan(p.y, p.x);"," float radius = length(p);"," radius = pow(radius, amount);"," p.x = radius * cos(theta);"," p.y = radius * sin(theta);"," return 0.5 * (p + 1.0);","}","void main()","{"," vec2 xy = 2.0 * outTexCoord - 1.0;"," vec2 texCoord = outTexCoord;"," if (length(xy) < 1.0)"," {"," texCoord = Distort(xy);"," }"," gl_FragColor = boundedSampler(uMainSampler, texCoord);","}"].join("\n")},65980(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uMainSampler2;","uniform float amount;","uniform vec4 color;","varying vec2 outTexCoord;","vec4 NORMAL (vec4 base, vec4 blend)","{"," return blend + base * (1.0 - blend.a);","}","vec4 ADD (vec4 base, vec4 blend)","{"," return base + blend;","}","vec4 MULTIPLY (vec4 base, vec4 blend)","{"," return base * blend;","}","vec4 SCREEN (vec4 base, vec4 blend)","{"," return 1.0 - (1.0 - base) * (1.0 - blend);","}","float overlayChannel (float base, float blend)","{"," return base < 0.5 ? 2.0 * base * blend : 1.0 - 2.0 * (1.0 - base) * (1.0 - blend);","}","vec4 OVERLAY (vec4 base, vec4 blend)","{"," return vec4("," overlayChannel(base.r, blend.r),"," overlayChannel(base.g, blend.g),"," overlayChannel(base.b, blend.b),"," overlayChannel(base.a, blend.a)"," );","}","vec4 DARKEN (vec4 base, vec4 blend)","{"," return min(base, blend);","}","vec4 LIGHTEN (vec4 base, vec4 blend)","{"," return max(base, blend);","}","float dodgeChannel (float base, float blend)","{"," return blend == 1.0 ? blend : min(1.0, base / (1.0 - blend));","}","vec4 COLOR_DODGE (vec4 base, vec4 blend)","{"," return vec4("," dodgeChannel(base.r, blend.r),"," dodgeChannel(base.g, blend.g),"," dodgeChannel(base.b, blend.b),"," dodgeChannel(base.a, blend.a)"," );","}","float burnChannel (float base, float blend)","{"," return blend == 0.0 ? blend : 1.0 - min(1.0, (1.0 - base) / blend);","}","vec4 COLOR_BURN (vec4 base, vec4 blend)","{"," return vec4("," burnChannel(base.r, blend.r),"," burnChannel(base.g, blend.g),"," burnChannel(base.b, blend.b),"," burnChannel(base.a, blend.a)"," );","}","float hardLightChannel (float base, float blend)","{"," return blend < 0.5 ? 2.0 * base * blend : 1.0 - 2.0 * (1.0 - base) * (1.0 - blend);","}","vec4 HARD_LIGHT (vec4 base, vec4 blend)","{"," return vec4("," hardLightChannel(base.r, blend.r),"," hardLightChannel(base.g, blend.g),"," hardLightChannel(base.b, blend.b),"," hardLightChannel(base.a, blend.a)"," );","}","float softLightChannel (float base, float blend)","{"," return blend < 0.5 ? (2.0 * base * blend + base * base * (1.0 - 2.0 * blend)) : (sqrt(base) * (2.0 * blend - 1.0) + 2.0 * base * (1.0 - blend));","}","vec4 SOFT_LIGHT (vec4 base, vec4 blend)","{"," return vec4("," softLightChannel(base.r, blend.r),"," softLightChannel(base.g, blend.g),"," softLightChannel(base.b, blend.b),"," softLightChannel(base.a, blend.a)"," );","}","vec4 DIFFERENCE (vec4 base, vec4 blend)","{"," return abs(base - blend);","}","vec4 EXCLUSION (vec4 base, vec4 blend)","{"," return base + blend - 2.0 * base * blend;","}","vec3 rgbToHsl (vec3 color)","{"," vec3 hsl = vec3(0.0);"," float fmin = min(min(color.r, color.g), color.b);"," float fmax = max(max(color.r, color.g), color.b);"," float delta = fmax - fmin;"," hsl.z = (fmax + fmin) / 2.0;"," if (delta == 0.0)"," {"," hsl.x = 0.0;"," hsl.y = 0.0;"," }"," else"," {"," if (hsl.z < 0.5)"," {"," hsl.y = delta / (fmax + fmin);"," }"," else"," {"," hsl.y = delta / (2.0 - fmax - fmin);"," }"," float deltaR = (((fmax - color.r) / 6.0) + (delta / 2.0)) / delta;"," float deltaG = (((fmax - color.g) / 6.0) + (delta / 2.0)) / delta;"," float deltaB = (((fmax - color.b) / 6.0) + (delta / 2.0)) / delta;"," if (color.r == fmax)"," {"," hsl.x = deltaB - deltaG;"," }"," else if (color.g == fmax)"," {"," hsl.x = (1.0 / 3.0) + deltaR - deltaB;"," }"," else if (color.b == fmax)"," {"," hsl.x = (2.0 / 3.0) + deltaG - deltaR;"," }"," if (hsl.x < 0.0)"," {"," hsl.x += 1.0;"," }"," else if (hsl.x > 1.0)"," {"," hsl.x -= 1.0;"," }"," }"," return hsl;","}","vec3 hslToRgb (vec3 hsl)","{"," float p = hsl.z * (1.0 - hsl.y);"," float q = hsl.z * (1.0 - hsl.y * hsl.x);"," float t = hsl.z * (1.0 - hsl.y * (1.0 - hsl.x));"," if (hsl.x < 1.0 / 6.0)"," {"," return vec3(hsl.z, t, p);"," }"," else if (hsl.x < 0.5)"," {"," return vec3(q, hsl.z, p);"," }"," else if (hsl.x < 2.0 / 3.0)"," {"," return vec3(p, hsl.z, t);"," }"," return vec3(p, q, hsl.z);","}","vec4 HUE (vec4 base, vec4 blend)","{"," vec3 baseHSL = rgbToHsl(base.rgb);"," vec3 blendHSL = rgbToHsl(blend.rgb);"," return vec4(hslToRgb(vec3(blendHSL.x, baseHSL.y, baseHSL.z)), base.a);","}","vec4 SATURATION (vec4 base, vec4 blend)","{"," vec3 baseHSL = rgbToHsl(base.rgb);"," vec3 blendHSL = rgbToHsl(blend.rgb);"," return vec4(hslToRgb(vec3(baseHSL.x, blendHSL.y, baseHSL.z)), base.a);","}","vec4 COLOR (vec4 base, vec4 blend)","{"," vec3 baseHSL = rgbToHsl(base.rgb);"," vec3 blendHSL = rgbToHsl(blend.rgb);"," return vec4(hslToRgb(vec3(blendHSL.x, blendHSL.y, baseHSL.z)), base.a);","}","vec4 LUMINOSITY (vec4 base, vec4 blend)","{"," vec3 baseHSL = rgbToHsl(base.rgb);"," vec3 blendHSL = rgbToHsl(blend.rgb);"," return vec4(hslToRgb(vec3(baseHSL.x, baseHSL.y, blendHSL.z)), base.a);","}","vec4 ERASE (vec4 base, vec4 blend)","{"," return base * (1.0 - blend.a);","}","vec4 SOURCE_IN (vec4 base, vec4 blend)","{"," return blend * base.a;","}","vec4 SOURCE_OUT (vec4 base, vec4 blend)","{"," return blend * (1.0 - base.a);","}","vec4 SOURCE_ATOP (vec4 base, vec4 blend)","{"," return base * (1.0 - blend.a) + blend * base.a;","}","vec4 DESTINATION_OVER (vec4 base, vec4 blend)","{"," return base + blend * (1.0 - base.a);","}","vec4 DESTINATION_IN (vec4 base, vec4 blend)","{"," return base * blend.a;","}","vec4 DESTINATION_OUT (vec4 base, vec4 blend)","{"," return base * (1.0 - blend.a);","}","vec4 DESTINATION_ATOP (vec4 base, vec4 blend)","{"," return base * blend.a + blend * (1.0 - base.a);","}","vec4 LIGHTER (vec4 base, vec4 blend)","{"," return ADD(base, blend);","}","vec4 COPY (vec4 base, vec4 blend)","{"," return blend;","}","vec4 XOR (vec4 base, vec4 blend)","{"," return base * (1.0 - blend.a) + blend * (1.0 - base.a);","}","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec4 base = boundedSampler(uMainSampler, outTexCoord);"," vec4 blend = boundedSampler(uMainSampler2, outTexCoord) * color;"," vec4 blended = BLEND(base, blend);"," gl_FragColor = mix(base, blended, amount);","}"].join("\n")},5899(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec4 uSizeAndOffset;","varying vec2 outTexCoord;","void main()","{"," vec2 gridCell = floor((outTexCoord * resolution + uSizeAndOffset.zw) / uSizeAndOffset.xy) * uSizeAndOffset.xy - uSizeAndOffset.zw;"," vec2 texCoord = gridCell / resolution;"," gl_FragColor = texture2D(uMainSampler, texCoord);","}"].join("\n")},20784(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec2 offset;","uniform float strength;","uniform vec3 color;","varying vec2 outTexCoord;","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec2 uv = outTexCoord;"," vec4 col = vec4(0.0);"," vec2 off1 = vec2(1.411764705882353) * offset * strength;"," vec2 off2 = vec2(3.2941176470588234) * offset * strength;"," vec2 off3 = vec2(5.176470588235294) * offset * strength;"," col += boundedSampler(uMainSampler, uv) * 0.1964825501511404;"," col += boundedSampler(uMainSampler, uv + (off1 / resolution)) * 0.2969069646728344;"," col += boundedSampler(uMainSampler, uv - (off1 / resolution)) * 0.2969069646728344;"," col += boundedSampler(uMainSampler, uv + (off2 / resolution)) * 0.09447039785044732;"," col += boundedSampler(uMainSampler, uv - (off2 / resolution)) * 0.09447039785044732;"," col += boundedSampler(uMainSampler, uv + (off3 / resolution)) * 0.010381362401148057;"," col += boundedSampler(uMainSampler, uv - (off3 / resolution)) * 0.010381362401148057;"," gl_FragColor = col * vec4(color, 1.0);","}"].join("\n")},65122(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec2 offset;","uniform float strength;","uniform vec3 color;","varying vec2 outTexCoord;","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec2 uv = outTexCoord;"," vec4 col = vec4(0.0);"," vec2 offset = vec2(1.333) * offset * strength;"," col += boundedSampler(uMainSampler, uv) * 0.29411764705882354;"," col += boundedSampler(uMainSampler, uv + (offset / resolution)) * 0.35294117647058826;"," col += boundedSampler(uMainSampler, uv - (offset / resolution)) * 0.35294117647058826;"," gl_FragColor = col * vec4(color, 1.0);","}"].join("\n")},60942(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec2 offset;","uniform float strength;","uniform vec3 color;","varying vec2 outTexCoord;","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec2 uv = outTexCoord;"," vec4 col = vec4(0.0);"," vec2 off1 = vec2(1.3846153846) * offset * strength;"," vec2 off2 = vec2(3.2307692308) * offset * strength;"," col += boundedSampler(uMainSampler, uv) * 0.2270270270;"," col += boundedSampler(uMainSampler, uv + (off1 / resolution)) * 0.3162162162;"," col += boundedSampler(uMainSampler, uv - (off1 / resolution)) * 0.3162162162;"," col += boundedSampler(uMainSampler, uv + (off2 / resolution)) * 0.0702702703;"," col += boundedSampler(uMainSampler, uv - (off2 / resolution)) * 0.0702702703;"," gl_FragColor = col * vec4(color, 1.0);","}"].join("\n")},43722(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","#define ITERATIONS 100.0","#define ONEOVER_ITR 1.0 / ITERATIONS","#define PI 3.141596","#define GOLDEN_ANGLE 2.39996323","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform float radius;","uniform float amount;","uniform float contrast;","uniform bool isTiltShift;","uniform float strength;","uniform vec2 blur;","varying vec2 outTexCoord;","vec2 Sample (in float theta, inout float r)","{"," r += 1.0 / r;"," return (r - 1.0) * vec2(cos(theta), sin(theta)) * 0.06;","}","#pragma phaserTemplate(fragmentHeader)","vec3 Bokeh (sampler2D tex, vec2 uv, float radius)","{"," vec3 acc = vec3(0.0);"," vec3 div = vec3(0.0);"," vec2 pixel = vec2(resolution.y / resolution.x, 1.0) * radius * .025;"," float r = 1.0;"," for (float j = 0.0; j < GOLDEN_ANGLE * ITERATIONS; j += GOLDEN_ANGLE)"," {"," vec3 col = boundedSampler(tex, uv + pixel * Sample(j, r)).xyz;"," col = contrast > 0.0 ? col * col * (1.0 + contrast) : col;"," vec3 bokeh = vec3(0.5) + pow(col, vec3(10.0)) * amount;"," acc += col * bokeh;"," div += bokeh;"," }"," return acc / div;","}","void main ()","{"," float shift = 1.0;"," if (isTiltShift)"," {"," vec2 uv = vec2(gl_FragCoord.xy / resolution + vec2(-0.5, -0.5)) * 2.0;"," float centerStrength = 1.0;"," shift = length(uv * blur * strength) * centerStrength;"," }"," gl_FragColor = vec4(Bokeh(uMainSampler, outTexCoord * vec2(1.0, 1.0), radius * shift), 0.0);","}"].join("\n")},19883(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform float uColorMatrix[20];","uniform float uAlpha;","varying vec2 outTexCoord;","void main ()","{"," vec4 c = texture2D(uMainSampler, outTexCoord);"," if (uAlpha == 0.0)"," {"," gl_FragColor = c;"," return;"," }"," if (c.a > 0.0)"," {"," c.rgb /= c.a;"," }"," vec4 result;"," result.r = (uColorMatrix[0] * c.r) + (uColorMatrix[1] * c.g) + (uColorMatrix[2] * c.b) + (uColorMatrix[3] * c.a) + uColorMatrix[4];"," result.g = (uColorMatrix[5] * c.r) + (uColorMatrix[6] * c.g) + (uColorMatrix[7] * c.b) + (uColorMatrix[8] * c.a) + uColorMatrix[9];"," result.b = (uColorMatrix[10] * c.r) + (uColorMatrix[11] * c.g) + (uColorMatrix[12] * c.b) + (uColorMatrix[13] * c.a) + uColorMatrix[14];"," result.a = (uColorMatrix[15] * c.r) + (uColorMatrix[16] * c.g) + (uColorMatrix[17] * c.b) + (uColorMatrix[18] * c.a) + uColorMatrix[19];"," vec3 rgb = mix(c.rgb, result.rgb, uAlpha);"," rgb *= result.a;"," gl_FragColor = vec4(rgb, result.a);","}"].join("\n")},32624(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uTransferSampler;","uniform float uColorMatrixSelf[20];","uniform float uColorMatrixTransfer[20];","uniform float uAlphaSelf;","uniform float uAlphaTransfer;","uniform vec4 uAdditions;","uniform vec4 uMultiplications;","varying vec2 outTexCoord;","#define S uColorMatrixSelf","#define T uColorMatrixTransfer","void main ()","{"," vec4 self = texture2D(uMainSampler, outTexCoord);"," if (uAlphaSelf == 0.0)"," {"," gl_FragColor = self;"," return;"," }"," if (self.a > 0.0)"," {"," self.rgb /= self.a;"," }"," vec4 resultSelf;"," resultSelf.r = (S[0] * self.r) + (S[1] * self.g) + (S[2] * self.b) + (S[3] * self.a) + S[4];"," resultSelf.g = (S[5] * self.r) + (S[6] * self.g) + (S[7] * self.b) + (S[8] * self.a) + S[9];"," resultSelf.b = (S[10] * self.r) + (S[11] * self.g) + (S[12] * self.b) + (S[13] * self.a) + S[14];"," resultSelf.a = (S[15] * self.r) + (S[16] * self.g) + (S[17] * self.b) + (S[18] * self.a) + S[19];"," if (uAlphaTransfer == 0.0)"," {"," self.rgb *= self.a;"," resultSelf.rgb *= resultSelf.a;"," gl_FragColor = mix(self, resultSelf, uAlphaSelf);"," return;"," }"," vec4 tex = texture2D(uTransferSampler, outTexCoord);"," if (tex.a > 0.0)"," {"," tex.rgb /= tex.a;"," }"," vec4 resultTransfer;"," resultTransfer.r = (T[0] * tex.r) + (T[1] * tex.g) + (T[2] * tex.b) + (T[3] * tex.a) + T[4];"," resultTransfer.g = (T[5] * tex.r) + (T[6] * tex.g) + (T[7] * tex.b) + (T[8] * tex.a) + T[9];"," resultTransfer.b = (T[10] * tex.r) + (T[11] * tex.g) + (T[12] * tex.b) + (T[13] * tex.a) + T[14];"," resultTransfer.a = (T[15] * tex.r) + (T[16] * tex.g) + (T[17] * tex.b) + (T[18] * tex.a) + T[19];"," vec4 combo = (resultSelf + resultTransfer) * uAdditions + (resultSelf * resultTransfer) * uMultiplications;"," self.rgb *= self.a;"," resultSelf.rgb *= resultSelf.a;"," combo.rgb *= combo.a;"," gl_FragColor = mix(self, mix(resultSelf, combo, uAlphaTransfer), uAlphaSelf);","}"].join("\n")},12886(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uDisplacementSampler;","uniform vec2 amount;","varying vec2 outTexCoord;","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec2 disp = (-vec2(0.5, 0.5) + texture2D(uDisplacementSampler, outTexCoord).rg) * amount;"," gl_FragColor = boundedSampler(uMainSampler, outTexCoord + disp).rgba;","}"].join("\n")},33016(t){t.exports=["#pragma phaserTemplate(shaderName)","#define DISTANCE 10.0","#define QUALITY 10.0","#pragma phaserTemplate(fragmentDefine)","precision mediump float;","uniform sampler2D uMainSampler;","varying vec2 outTexCoord;","uniform float outerStrength;","uniform float innerStrength;","uniform float scale;","uniform vec2 resolution;","uniform vec4 glowColor;","uniform bool knockout;","const float PI = 3.14159265358979323846264;","const float MAX_ALPHA = DISTANCE * (DISTANCE + 1.0) * QUALITY / 2.0;","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec2 px = vec2(1.0 / resolution.x, 1.0 / resolution.y) * scale;"," float totalAlpha = 0.0;"," float curAngle = 0.0;"," vec2 direction;"," vec2 displaced;"," vec4 color;"," for (float curDistance = 0.0; curDistance < DISTANCE; curDistance++)"," {"," curAngle += fract(sin(dot(vec2(curDistance, outTexCoord.x + outTexCoord.y), vec2(12.9898, 78.233))) * 43758.5453);"," for (float i = 0.0; i < QUALITY; i++)"," {"," curAngle += PI * 2.0 / (QUALITY);"," direction = vec2(cos(curAngle), sin(curAngle)) * px;"," displaced = outTexCoord + direction * (curDistance + 1.0);"," color = boundedSampler(uMainSampler, displaced);"," totalAlpha += (DISTANCE - curDistance) * color.a;"," }"," }"," color = boundedSampler(uMainSampler, outTexCoord);"," float alphaRatio = (totalAlpha / MAX_ALPHA);"," float innerGlowAlpha = (1.0 - alphaRatio) * innerStrength * color.a;"," float innerGlowStrength = min(1.0, innerGlowAlpha);"," vec4 innerColor = mix(color, glowColor, innerGlowStrength);"," float outerGlowAlpha = alphaRatio * outerStrength * (1.0 - color.a);"," float outerGlowStrength = min(1.0 - innerColor.a, outerGlowAlpha);"," if (knockout)"," {"," float resultAlpha = outerGlowStrength + innerGlowStrength;"," gl_FragColor = vec4(glowColor.rgb * resultAlpha, resultAlpha);"," }"," else"," {"," vec4 outerGlowColor = outerGlowStrength * glowColor.rgba;"," gl_FragColor = innerColor + outerGlowColor;"," }","}"].join("\n")},33179(t){t.exports=["#pragma phaserTemplate(shaderName)","precision highp float;","#pragma phaserTemplate(fragmentHeader)","uniform sampler2D uMainSampler;","uniform vec4 uColor;","uniform vec4 uColorFactor;","uniform bool uUnpremultiply;","uniform float uAlpha;","varying vec2 outTexCoord;","void main ()","{"," vec4 sample = texture2D(uMainSampler, outTexCoord);"," if (uUnpremultiply)"," {"," sample.rgb /= sample.a;"," }"," vec4 modulatedSample = sample * uColorFactor + uColor;"," float progress = modulatedSample.r + modulatedSample.g + modulatedSample.b + modulatedSample.a;"," vec4 rampColor = getRampAt(progress);"," rampColor.rgb *= rampColor.a;"," gl_FragColor = mix(sample, rampColor * sample.a, uAlpha);","}"].join("\n")},94526(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uEnvSampler;","uniform sampler2D uNormSampler;","uniform mat4 uViewMatrix;","uniform float uModelRotation;","uniform float uBulge;","uniform vec3 uColorFactor;","varying vec2 outTexCoord;","#define PI 3.14159265358979323846","void main()","{"," vec4 color = texture2D(uMainSampler, outTexCoord);"," vec3 normal = texture2D(uNormSampler, outTexCoord).rgb;"," vec3 normalN = normal * 2.0 - 1.0;"," float normalXYLength = length(normalN.xy);"," float angle = atan("," normalN.y,"," normalN.x"," ) - uModelRotation;"," normalN = vec3("," normalXYLength * cos(angle),"," normalXYLength * sin(angle),"," normalN.z"," );"," normalN = reflect(vec3(0.0, 0.0, -1.0), normalN);"," normalN = (uViewMatrix * vec4(normalN, 1.0)).xyz;"," float envX = atan(normalN.x, normalN.z) / PI;"," float envY = sin(normalN.y * PI / 2.0);"," vec2 uv = vec2(envX, envY) * 0.5 + 0.5;"," vec2 rotatedTexCoord = vec2("," cos(-uModelRotation) * outTexCoord.x - sin(-uModelRotation) * outTexCoord.y,"," sin(-uModelRotation) * outTexCoord.x + cos(- uModelRotation) * outTexCoord.y"," );"," uv += uBulge * (rotatedTexCoord - 0.5);"," if (uv.y < 0.0)"," {"," uv.y = abs(uv.y);"," uv.x += 0.5;"," }"," else if (uv.y > 1.0)"," {"," uv.y = 2.0 - uv.y;"," uv.x += 0.5;"," }"," vec3 environment = texture2D(uEnvSampler, uv).rgb;"," gl_FragColor = vec4(environment * color.rgb * uColorFactor, color.a);","}"].join("\n")},4488(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec4 uColor;","uniform vec4 uIsolateThresholdFeather;","varying vec2 outTexCoord;","void main()","{"," vec4 color = texture2D(uMainSampler, outTexCoord);"," vec3 unpremultipliedColor = color.rgb / color.a;"," float isolate = uIsolateThresholdFeather.x;"," float threshold = uIsolateThresholdFeather.y;"," float feather = uIsolateThresholdFeather.z;"," float match = distance(unpremultipliedColor, uColor.rgb);"," match = clamp(match - threshold, 0.0, 1.0);"," match = clamp(match / feather, 0.0, 1.0);"," if (isolate == 1.0)"," {"," match = 1.0 - match;"," }"," match = mix(1.0, match, uColor.a);"," gl_FragColor = color * match;","}"].join("\n")},39603(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uMaskSampler;","uniform bool invert;","varying vec2 outTexCoord;","void main ()","{"," vec4 color = texture2D(uMainSampler, outTexCoord);"," vec4 mask = texture2D(uMaskSampler, outTexCoord);"," float a = mask.a;"," color *= invert ? (1.0 - a) : a;"," gl_FragColor = color;","}"].join("\n")},60047(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","#pragma phaserTemplate(fragmentHeader)","uniform sampler2D uMainSampler;","uniform mat4 uViewMatrix;","#ifdef FACING_POWER","uniform float uFacingPower;","#endif","#ifdef OUTPUT_RATIO","uniform vec3 uRatioVector;","uniform float uRatioRadius;","#endif","varying vec2 outTexCoord;","void main()","{"," vec3 normal = texture2D(uMainSampler, outTexCoord).rgb * 2.0 - 1.0;"," normal = (uViewMatrix * vec4(normal, 1.0)).xyz;"," #ifdef FACING_POWER"," normal = normalize(normal * vec3(1.0, 1.0, uFacingPower));"," #endif"," #ifdef OUTPUT_RATIO"," float ratio = dot(normal, normalize(uRatioVector));"," ratio = (ratio - 1.0 + uRatioRadius) / uRatioRadius;"," if (ratio <= 0.0)"," {"," ratio = 0.0;"," }"," normal = vec3(ratio * 2.0 - 1.0);"," #endif"," gl_FragColor = vec4((normal + 1.0) * 0.5, 1.0);","}"].join("\n")},7529(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform float uRadius;","uniform float uPower;","varying vec2 outTexCoord;","#define PI 3.14159265358979323846","#pragma phaserTemplate(fragmentHeader)","#define STEP_X 1.0 / SAMPLES_X","#define STEP_Y 1.0 / SAMPLES_Y","vec3 uvPanoramaNormal(vec2 uv)","{"," float y = uv.y * 2.0 - 1.0;"," float angle = (uv.x * 2.0 - 1.0) * PI;"," float x = sin(angle);"," float z = cos(angle);"," vec2 xz = vec2(x, z);"," xz *= sqrt(1.0 - y * y);"," return normalize(vec3(xz.x, y, xz.y));","}","void main()","{"," vec3 acc = vec3(0.0);"," float div = 0.0;"," vec3 texelNormal = uvPanoramaNormal(outTexCoord);"," for (float y = STEP_Y / 2.0; y < 1.0; y += STEP_Y)"," {"," float yWeight = cos((y * 2.0 - 1.0) * PI / 2.0);"," for (float x = STEP_X / 2.0; x < 1.0; x += STEP_X)"," {"," vec2 uv = vec2(x, y);"," vec3 sampleNormal = uvPanoramaNormal(uv);"," float dotProduct = dot(sampleNormal, texelNormal);"," dotProduct = (dotProduct - 1.0 + uRadius) / uRadius;"," if (dotProduct <= 0.0)"," {"," continue;"," }"," vec3 color = texture2D(uMainSampler, uv).rgb;"," color *= pow(length(color), uPower);"," acc += color * dotProduct * yWeight;"," div += dotProduct * yWeight;"," }"," }"," gl_FragColor = vec4(acc / div, 1.0);","}"].join("\n")},99191(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform float amount;","varying vec2 outTexCoord;","void main ()","{"," float pixelSize = floor(2.0 + amount);"," vec2 center = pixelSize * floor(outTexCoord * resolution / pixelSize) + pixelSize * vec2(0.5, 0.5);"," vec2 corner1 = center + pixelSize * vec2(-0.5, -0.5);"," vec2 corner2 = center + pixelSize * vec2(+0.5, -0.5);"," vec2 corner3 = center + pixelSize * vec2(+0.5, +0.5);"," vec2 corner4 = center + pixelSize * vec2(-0.5, +0.5);"," vec4 pixel = 0.4 * texture2D(uMainSampler, center / resolution);"," pixel += 0.15 * texture2D(uMainSampler, corner1 / resolution);"," pixel += 0.15 * texture2D(uMainSampler, corner2 / resolution);"," pixel += 0.15 * texture2D(uMainSampler, corner3 / resolution);"," pixel += 0.15 * texture2D(uMainSampler, corner4 / resolution);"," gl_FragColor = pixel;","}"].join("\n")},88430(t){t.exports=["#pragma phaserTemplate(shaderName)","precision highp float;","uniform sampler2D uMainSampler;","uniform vec4 uSteps;","uniform vec4 uGamma;","uniform vec4 uOffset;","uniform int uMode;","uniform bool uDither;","varying vec2 outTexCoord;","vec4 rgbaToHsva(vec4 rgba)","{"," float r = rgba.r;"," float g = rgba.g;"," float b = rgba.b;"," float a = rgba.a;"," float min = min(min(r, g), b);"," float max = max(max(r, g), b);"," float d = max - min;"," float h = 0.0;"," float s = (max == 0.0) ? 0.0 : d / max;"," float v = max;"," if (max != min)"," {"," if (max == r)"," {"," h = (g - b) / d + ((g < b) ? 6.0 : 0.0);"," }"," else if (max == g)"," {"," h = (b - r) / d + 2.0;"," }"," else"," {"," h = (r - g) / d + 4.0;"," }"," h /= 6.0;"," }"," return vec4(h, s, v, a);","}","float hsvaToRgbaConvert(float n, vec4 hsva)","{"," float k = mod(n + hsva.x * 6.0, 6.0);"," float min = min(min(k, 4.0 - k), 1.0);"," return hsva.z - hsva.z * hsva.y * max(0.0, min);","}","vec4 hsvaToRgba(vec4 hsva)","{"," return vec4("," hsvaToRgbaConvert(5.0, hsva),"," hsvaToRgbaConvert(3.0, hsva),"," hsvaToRgbaConvert(1.0, hsva),"," hsva.a"," );","}","vec4 ditherIGN(vec4 value)","{"," value += fract(52.9829189 * fract(0.06711056 * gl_FragCoord.x + 0.00583715 * gl_FragCoord.y)) - 0.5;"," return value;","}","void main ()","{"," vec4 sample = texture2D(uMainSampler, outTexCoord);"," if (uMode == 1)"," {"," sample = rgbaToHsva(sample);"," }"," sample = pow(sample, uGamma);"," sample -= uOffset;"," vec4 steps = max(uSteps - 1.0, 1.0);"," sample *= steps;"," if (uDither)"," {"," sample = ditherIGN(sample);"," }"," sample = ceil(sample - 0.5);"," sample /= steps;"," sample += uOffset;"," sample = pow(sample, 1.0 / uGamma);"," if (uMode == 1)"," {"," sample.x = mod(sample.x, 1.0);"," sample = hsvaToRgba(clamp(sample, 0.0, 1.0));"," }"," gl_FragColor = sample;","}"].join("\n")},69355(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","varying vec2 outTexCoord;","uniform vec2 lightPosition;","uniform vec4 color;","uniform float decay;","uniform float power;","uniform float intensity;","uniform int samples;","const int MAX = 12;","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec4 texture = boundedSampler(uMainSampler, outTexCoord);"," vec2 pc = (lightPosition - outTexCoord) * intensity;"," float shadow = 0.0;"," float limit = max(float(MAX), float(samples));"," for (int i = 0; i < MAX; ++i)"," {"," if (i >= samples)"," {"," break;"," }"," shadow += boundedSampler(uMainSampler, outTexCoord + float(i) * decay / limit * pc).a * power;"," }"," float mask = 1.0 - texture.a;"," gl_FragColor = mix(texture, color, clamp(shadow * mask, 0.0, 1.0));","}"].join("\n")},92636(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec4 edge1;","uniform vec4 edge2;","uniform vec4 invert;","varying vec2 outTexCoord;","void main ()","{"," vec4 color = texture2D(uMainSampler, outTexCoord);"," color = clamp((color - edge1) / (edge2 - edge1), 0.0, 1.0);"," color = mix(color, 1.0 - color, invert);"," gl_FragColor = color;","}"].join("\n")},18185(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform float uRadius;","uniform float uStrength;","uniform vec2 uPosition;","uniform vec4 uColor;","uniform int uBlendMode;","varying vec2 outTexCoord;","void main ()","{"," float vignette = 1.0;"," vec2 position = vec2(uPosition.x, 1.0 - uPosition.y);"," float d = length(outTexCoord - position);"," if (d <= uRadius)"," {"," float g = d / uRadius;"," vignette = sin(g * 3.14 * uStrength);"," }"," vec4 color = uColor;"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," if (uBlendMode == 1)"," {"," color.rgb = texture.rgb + color.rgb;"," }"," else if (uBlendMode == 2)"," {"," color.rgb = texture.rgb * color.rgb;"," }"," else if (uBlendMode == 3)"," {"," color.rgb = 1.0 - ((1.0 - texture.rgb) * (1.0 - color.rgb));"," }"," gl_FragColor = mix(texture, color, vignette);","}"].join("\n")},99174(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uMainSampler2;","uniform vec4 uProgress_WipeWidth_Direction_Axis;","uniform float uReveal;","varying vec2 outTexCoord;","void main ()","{"," vec4 color0;"," vec4 color1;"," if (uReveal == 0.0)"," {"," color0 = texture2D(uMainSampler, outTexCoord);"," color1 = texture2D(uMainSampler2, outTexCoord);"," }"," else"," {"," color0 = texture2D(uMainSampler2, outTexCoord);"," color1 = texture2D(uMainSampler, outTexCoord);"," }"," float distance = uProgress_WipeWidth_Direction_Axis.x;"," float width = uProgress_WipeWidth_Direction_Axis.y;"," float direction = uProgress_WipeWidth_Direction_Axis.z;"," float axis = outTexCoord.x;"," if (uProgress_WipeWidth_Direction_Axis.w == 1.0)"," {"," axis = outTexCoord.y;"," }"," float adjust = mix(width, -width, distance);"," float value = smoothstep(distance - width, distance + width, abs(direction - axis) + adjust);"," gl_FragColor = mix(color1, color0, value);","}"].join("\n")},73416(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(fragmentDefine)","uniform vec2 uResolution;","varying vec4 outTint;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec4 fragColor = outTint;"," #pragma phaserTemplate(fragmentProcess)"," gl_FragColor = fragColor;","}"].join("\n")},91627(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(vertexDefine)","uniform mat4 uProjectionMatrix;","uniform vec2 uResolution;","attribute vec2 inPosition;","attribute vec4 inTint;","varying vec4 outTint;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(vertexHeader)","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);"," outTint = vec4(inTint.bgr * inTint.a, inTint.a);"," #pragma phaserTemplate(vertexProcess)","}"].join("\n")},84220(t){t.exports=["vec3 getNormalFromMap (vec2 texCoord)","{"," vec3 normalMap = texture2D(uNormSampler, texCoord).rgb;"," return normalize(outInverseRotationMatrix * vec3(normalMap * 2.0 - 1.0));","}"].join("\n")},2860(t){t.exports=["uniform vec2 uMainResolution[TEXTURE_COUNT];","vec2 getTexRes ()","{"," #if TEXTURE_COUNT == 1"," float texId = 0.0;"," #else"," float texId = outTexDatum;"," #endif"," #pragma phaserTemplate(texIdProcess)"," vec2 texRes = vec2(0.0);"," for (int i = 0; i < TEXTURE_COUNT; i++)"," {"," if (texId == float(i))"," {"," texRes = uMainResolution[i];"," break;"," }"," }"," return texRes;","}"].join("\n")},46432(t){t.exports=["uniform sampler2D uMainSampler[TEXTURE_COUNT];","vec4 getTexture (vec2 texCoord)","{"," #if TEXTURE_COUNT == 1"," return texture2D(uMainSampler[0], texCoord);"," #else"," if (outTexDatum == 0.0) return texture2D(uMainSampler[0], texCoord);"," #define ELSE_TEX_CASE(INDEX) else if (outTexDatum == float(INDEX)) return texture2D(uMainSampler[INDEX], texCoord);"," #pragma phaserTemplate(texIdProcess)"," else return vec4(0.0, 0.0, 0.0, 0.0);"," #endif","}"].join("\n")},41509(t){t.exports=["#pragma phaserTemplate(shaderName)","precision highp float;","#pragma phaserTemplate(fragmentHeader)","#define PI 3.14159265358979323846","uniform int uRepeatMode;","uniform float uOffset;","uniform int uShapeMode;","uniform vec2 uShape;","uniform vec2 uStart;","varying vec2 outTexCoord;","float linear()","{"," float len = length(uShape);"," return dot(uShape, outTexCoord - uStart) / len / len;","}","float bilinear()","{"," return abs(linear());","}","float radial()","{"," return distance(uStart, outTexCoord) / length(uShape);","}","float conicSymmetric()","{"," return dot(normalize(uShape), normalize(outTexCoord - uStart)) * 0.5 + 0.5;","}","float conicAsymmetric()","{"," vec2 fromStart = outTexCoord - uStart;"," float angleFromStart = atan(fromStart.y, fromStart.x);"," float shapeAngle = atan(uShape.y, uShape.x);"," float angle = (angleFromStart - shapeAngle) / PI / 2.0;"," if (angle < 0.0) angle += 1.0;"," return angle;","}","float repeat(float value)","{"," if (uRepeatMode == 1)"," {"," if (value < 0.0 || value > 1.0)"," {"," discard;"," }"," return value;"," }"," else if (uRepeatMode == 2)"," {"," return mod(value, 1.0);"," }"," else if (uRepeatMode == 3)"," {"," return 1.0 - abs(1.0 - mod(value, 2.0));"," }"," return clamp(value, 0.0, 1.0);","}","void main()","{"," float progress = 0.0;"," if (uShapeMode == 0)"," {"," progress = linear();"," }"," else if (uShapeMode == 1)"," {"," progress = bilinear();"," }"," else if (uShapeMode == 2)"," {"," progress = radial();"," }"," else if (uShapeMode == 3)"," {"," progress = conicSymmetric();"," }"," else if (uShapeMode == 4)"," {"," progress = conicAsymmetric();"," }"," progress -= uOffset;"," progress = repeat(progress);"," vec4 bandCol = getRampAt(progress);"," bandCol.rgb *= bandCol.a;"," gl_FragColor = bandCol;","}"].join("\n")},98840(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(fragmentDefine)","uniform vec2 uResolution;","varying vec2 outTexCoord;","varying float outTexDatum;","varying float outTintEffect;","varying vec4 outTint;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," #pragma phaserTemplate(fragmentProcess)"," gl_FragColor = fragColor;","}"].join("\n")},44667(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(vertexDefine)","uniform mat4 uProjectionMatrix;","uniform vec2 uResolution;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","attribute float inTexDatum;","attribute float inTintEffect;","attribute vec4 inTint;","varying vec2 outTexCoord;","varying float outTexDatum;","varying float outTintEffect;","varying vec4 outTint;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(vertexHeader)","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);"," outTexCoord = inTexCoord;"," outTexDatum = inTexDatum;"," outTint = inTint;"," outTintEffect = inTintEffect;"," #pragma phaserTemplate(vertexProcess)","}"].join("\n")},16421(t){t.exports=["#version 100","#pragma phaserTemplate(shaderName)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform vec2 uOffset;","uniform vec4 uColorStart;","uniform vec4 uColorEnd;","uniform float uPower;","uniform int uMode;","varying vec2 outTexCoord;","float trig(vec2 p)","{"," return fract(43757.5453*sin(dot(p, vec2(12.9898,78.233))));","}","void main ()","{"," float value = pow(trig(outTexCoord + uOffset), uPower);"," if (uMode == 0)"," {"," vec4 color = mix(uColorStart, uColorEnd, value);"," color.rgb *= color.a;"," gl_FragColor = color;"," }"," else if (uMode == 1)"," {"," float valueR = pow(trig(outTexCoord + uOffset + 32.1), uPower);"," float valueG = pow(trig(outTexCoord + uOffset + 11.1), uPower);"," float valueB = pow(trig(outTexCoord + uOffset + 23.4), uPower);"," vec4 color = vec4(valueR, valueG, valueB, 1.);"," color *= mix(uColorStart, uColorEnd, value);"," color.rgb *= color.a;"," gl_FragColor = color;"," }"," else if (uMode == 2)"," {"," float valueAngle = pow(trig(outTexCoord + uOffset), uPower) * 3.141592;"," float x = value * cos(valueAngle);"," float y = value * sin(valueAngle);"," vec4 color = vec4("," x,"," y,"," sqrt(1. - x * x - y * y),"," 1.0"," );"," gl_FragColor = color * 0.5 + 0.5;"," }","}"].join("\n")},83587(t){t.exports=["#version 100","#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(fragmentIterations)","#pragma phaserTemplate(fragmentNormalMap)","#ifndef ITERATION_COUNT","#define ITERATION_COUNT 1.0","#endif","#ifndef WARP_ITERATION_COUNT","#define WARP_ITERATION_COUNT 1.0","#endif","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform vec2 uCells;","uniform vec2 uPeriod;","uniform vec2 uOffset;","uniform float uFlow;","uniform float uDetailPower;","uniform float uFlowPower;","uniform float uContributionPower;","uniform float uWarpDetailPower;","uniform float uWarpFlowPower;","uniform float uWarpContributionPower;","uniform float uWarpAmount;","uniform vec4 uColorStart;","uniform vec4 uColorEnd;","uniform float uNormalScale;","uniform float uValueFactor;","uniform float uValueAdd;","uniform float uValuePower;","uniform vec2 uSeed;","varying vec2 outTexCoord;","float psrdnoise(vec2 x, vec2 period, float alpha)","{"," vec2 uv = vec2(x.x+x.y*0.5, x.y);"," vec2 i0 = floor(uv), f0 = fract(uv);"," float cmp = step(f0.y, f0.x);"," vec2 o1 = vec2(cmp, 1.0-cmp);"," vec2 i1 = i0 + o1, i2 = i0 + 1.0;"," vec2 v0 = vec2(i0.x - i0.y*0.5, i0.y);"," vec2 v1 = vec2(v0.x + o1.x - o1.y*0.5, v0.y + o1.y);"," vec2 v2 = vec2(v0.x + 0.5, v0.y + 1.0);"," vec2 x0 = x - v0, x1 = x - v1, x2 = x - v2;"," vec3 iu, iv, xw, yw;"," if(any(greaterThan(period, vec2(0.0)))) {"," xw = vec3(v0.x, v1.x, v2.x); yw = vec3(v0.y, v1.y, v2.y);"," if(period.x > 0.0)"," xw = mod(vec3(v0.x, v1.x, v2.x), period.x);"," if(period.y > 0.0)"," yw = mod(vec3(v0.y, v1.y, v2.y), period.y);"," iu = floor(xw + 0.5*yw + 0.5); iv = floor(yw + 0.5);"," } else {"," iu = vec3(i0.x, i1.x, i2.x); iv = vec3(i0.y, i1.y, i2.y);"," }"," iu += uSeed.xxx; iv += uSeed.yyy;"," vec3 hash = mod(iu, 289.0);"," hash = mod((hash*51.0 + 2.0)*hash + iv, 289.0);"," hash = mod((hash*34.0 + 10.0)*hash, 289.0);"," vec3 psi = hash*0.07482 + alpha;"," vec3 gx = cos(psi); vec3 gy = sin(psi);"," vec2 g0 = vec2(gx.x, gy.x);"," vec2 g1 = vec2(gx.y, gy.y);"," vec2 g2 = vec2(gx.z, gy.z);"," vec3 w = 0.8 - vec3(dot(x0, x0), dot(x1, x1), dot(x2, x2));"," w = max(w, 0.0); vec3 w2 = w*w; vec3 w4 = w2*w2;"," vec3 gdotx = vec3(dot(g0, x0), dot(g1, x1), dot(g2, x2));"," float n = dot(w4, gdotx);"," return 10.9*n;","}","float iterate (vec2 coord, float detailPower, float flowPower, float contributionPower)","{"," float value = 0.;"," float itValue = 0.;"," for (float iteration = 0.; iteration < ITERATION_COUNT; iteration++)"," {"," float detailScale = pow(detailPower, iteration);"," float flowScale = pow(flowPower, iteration);"," itValue = psrdnoise((coord + iteration) * detailScale, uPeriod * detailScale, uFlow * flowScale + iteration);"," value += itValue / pow(contributionPower, iteration);"," }"," return value;","}","float iterateWarp (vec2 coord, float detailPower, float flowPower, float contributionPower)","{"," float value = 0.;"," float itValue = 0.;"," for (float iteration = 0.; iteration < WARP_ITERATION_COUNT; iteration++)"," {"," float detailScale = pow(detailPower, iteration);"," float flowScale = pow(flowPower, iteration);"," itValue = psrdnoise((coord + iteration) * detailScale, uPeriod * detailScale, uFlow * flowScale + iteration);"," value += itValue / pow(contributionPower, iteration);"," }"," return value;","}","vec2 warp (vec2 coord)","{"," vec2 o2 = vec2(11.3, 23.7);"," float coord1 = iterateWarp(coord, uWarpDetailPower, uWarpFlowPower, uWarpContributionPower);"," float coord2 = iterateWarp(coord + o2, uWarpDetailPower, uWarpFlowPower, uWarpContributionPower);"," return vec2(coord1, coord2);","}","void main ()","{"," vec2 coord = outTexCoord * uCells + uOffset;"," if (uWarpAmount > 0.)"," {"," coord += warp(coord) * uWarpAmount;"," }"," float value = iterate(coord, uDetailPower, uFlowPower, uContributionPower) * uValueFactor + uValueAdd;"," value = pow(clamp(value, 0., 1.), uValuePower);"," #ifndef NORMAL_MAP"," vec4 color = mix(uColorStart, uColorEnd, value);"," color.rgb *= color.a;"," gl_FragColor = color;"," #else"," float dx = dFdx(value) * uNormalScale;"," float dy = dFdy(value) * uNormalScale;"," vec3 normal = vec3(dx, dy, 1.0 - sqrt(dx * dx + dy * dy)) * 0.5 + 0.5;"," gl_FragColor = vec4(normal, 1.0);"," #endif","}"].join("\n")},13460(t){t.exports=["#version 100","#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(fragmentIterations)","#pragma phaserTemplate(fragmentNormalMap)","#ifndef ITERATION_COUNT","#define ITERATION_COUNT 1.0","#endif","#ifndef WARP_ITERATION_COUNT","#define WARP_ITERATION_COUNT 1.0","#endif","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform vec3 uCells;","uniform vec3 uPeriod;","uniform vec3 uOffset;","uniform float uFlow;","uniform float uDetailPower;","uniform float uFlowPower;","uniform float uContributionPower;","uniform float uWarpDetailPower;","uniform float uWarpFlowPower;","uniform float uWarpContributionPower;","uniform float uWarpAmount;","uniform vec4 uColorStart;","uniform vec4 uColorEnd;","uniform float uNormalScale;","uniform float uValueFactor;","uniform float uValueAdd;","uniform float uValuePower;","uniform vec3 uSeed;","varying vec2 outTexCoord;","vec4 permute(vec4 i) {"," vec4 im = mod(i, 289.0);"," return mod(((im * 34.0) + 10.0) * im, 289.0);","}","float psrdnoise(vec3 x, vec3 period, float alpha) {"," const mat3 M = mat3(0.0, 1.0, 1.0, 1.0, 0.0, 1.0, 1.0, 1.0, 0.0);"," const mat3 Mi = mat3(-0.5, 0.5, 0.5, 0.5, -0.5, 0.5, 0.5, 0.5, -0.5);"," vec3 uvw = M * x;"," vec3 i0 = floor(uvw);"," vec3 f0 = fract(uvw);"," vec3 g_ = step(f0.xyx, f0.yzz);"," vec3 l_ = 1.0 - g_;"," vec3 g = vec3(l_.z, g_.xy);"," vec3 l = vec3(l_.xy, g_.z);"," vec3 o1 = min(g, l);"," vec3 o2 = max(g, l);"," vec3 i1 = i0 + o1, i2 = i0 + o2, i3 = i0 + 1.0;"," vec3 v0 = Mi * i0, v1 = Mi * i1, v2 = Mi * i2, v3 = Mi * i3;"," vec3 x0 = x - v0, x1 = x - v1, x2 = x - v2, x3 = x - v3;"," if(any(greaterThan(period, vec3(0.0)))) {"," vec4 vx = vec4(v0.x, v1.x, v2.x, v3.x);"," vec4 vy = vec4(v0.y, v1.y, v2.y, v3.y);"," vec4 vz = vec4(v0.z, v1.z, v2.z, v3.z);"," if(period.x > 0.0)"," vx = mod(vx, period.x);"," if(period.y > 0.0)"," vy = mod(vy, period.y);"," if(period.z > 0.0)"," vz = mod(vz, period.z);"," i0 = floor(M * vec3(vx.x, vy.x, vz.x) + 0.5);"," i1 = floor(M * vec3(vx.y, vy.y, vz.y) + 0.5);"," i2 = floor(M * vec3(vx.z, vy.z, vz.z) + 0.5);"," i3 = floor(M * vec3(vx.w, vy.w, vz.w) + 0.5);"," }"," i0 += uSeed; i1 += uSeed; i2 += uSeed; i3 += uSeed;"," vec4 hash = permute(permute(permute(vec4(i0.z, i1.z, i2.z, i3.z)) + vec4(i0.y, i1.y, i2.y, i3.y)) + vec4(i0.x, i1.x, i2.x, i3.x));"," vec4 theta = hash * 3.883222077;"," vec4 sz = 0.996539792 - 0.006920415 * hash;"," vec4 psi = hash * 0.108705628;"," vec4 Ct = cos(theta);"," vec4 St = sin(theta);"," vec4 sz_prime = sqrt(1.0 - sz * sz);"," vec4 gx, gy, gz;"," if(alpha != 0.0) {"," vec4 px = Ct * sz_prime;"," vec4 py = St * sz_prime;"," vec4 pz = sz;"," vec4 Sp = sin(psi);"," vec4 Cp = cos(psi);"," vec4 Ctp = St * Sp - Ct * Cp;"," vec4 qx = mix(Ctp * St, Sp, sz);"," vec4 qy = mix(-Ctp * Ct, Cp, sz);"," vec4 qz = -(py * Cp + px * Sp);"," vec4 Sa = vec4(sin(alpha));"," vec4 Ca = vec4(cos(alpha));"," gx = Ca * px + Sa * qx;"," gy = Ca * py + Sa * qy;"," gz = Ca * pz + Sa * qz;"," } else {"," gx = Ct * sz_prime;"," gy = St * sz_prime;"," gz = sz;"," }"," vec3 g0 = vec3(gx.x, gy.x, gz.x), g1 = vec3(gx.y, gy.y, gz.y);"," vec3 g2 = vec3(gx.z, gy.z, gz.z), g3 = vec3(gx.w, gy.w, gz.w);"," vec4 w = 0.5 - vec4(dot(x0, x0), dot(x1, x1), dot(x2, x2), dot(x3, x3));"," w = max(w, 0.0);"," vec4 w2 = w * w;"," vec4 w3 = w2 * w;"," vec4 gdotx = vec4(dot(g0, x0), dot(g1, x1), dot(g2, x2), dot(g3, x3));"," float n = dot(w3, gdotx);"," return 39.5 * n;","}","float iterate (vec3 coord, float detailPower, float flowPower, float contributionPower)","{"," float value = 0.;"," float itValue = 0.;"," for (float iteration = 0.; iteration < ITERATION_COUNT; iteration++)"," {"," float detailScale = pow(detailPower, iteration);"," float flowScale = pow(flowPower, iteration);"," itValue = psrdnoise((coord + iteration) * detailScale, uPeriod * detailScale, uFlow * flowScale + iteration);"," value += itValue / pow(contributionPower, iteration);"," }"," return value;","}","float iterateWarp (vec3 coord, float detailPower, float flowPower, float contributionPower)","{"," float value = 0.;"," float itValue = 0.;"," for (float iteration = 0.; iteration < WARP_ITERATION_COUNT; iteration++)"," {"," float detailScale = pow(detailPower, iteration);"," float flowScale = pow(flowPower, iteration);"," itValue = psrdnoise((coord + iteration) * detailScale, uPeriod * detailScale, uFlow * flowScale + iteration);"," value += itValue / pow(contributionPower, iteration);"," }"," return value;","}","vec3 warp (vec3 coord)","{"," vec3 o2 = vec3(11.3, 23.7, 13.1);"," vec3 o3 = vec3(29.9, 2.3, 31.7);"," float coord1 = iterateWarp(coord, uWarpDetailPower, uWarpFlowPower, uWarpContributionPower);"," float coord2 = iterateWarp(coord + o2, uWarpDetailPower, uWarpFlowPower, uWarpContributionPower);"," float coord3 = iterateWarp(coord + o3, uWarpDetailPower, uWarpFlowPower, uWarpContributionPower);"," return vec3(coord1, coord2, coord3);","}","void main ()","{"," vec3 coord = (vec3(outTexCoord, 0.0) * uCells) + uOffset;"," if (uWarpAmount > 0.)"," {"," coord += warp(coord) * uWarpAmount;"," }"," float value = iterate(coord, uDetailPower, uFlowPower, uContributionPower) * uValueFactor + uValueAdd;"," value = pow(clamp(value, 0., 1.), uValuePower);"," #ifndef NORMAL_MAP"," vec4 color = mix(uColorStart, uColorEnd, value);"," color.rgb *= color.a;"," gl_FragColor = color;"," #else"," float dx = dFdx(value) * uNormalScale;"," float dy = dFdy(value) * uNormalScale;"," vec3 normal = vec3(dx, dy, 1.0 - sqrt(dx * dx + dy * dy)) * 0.5 + 0.5;"," gl_FragColor = vec4(normal, 1.0);"," #endif","}"].join("\n")},17205(t){t.exports=["#version 100","#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(fragmentMode)","#pragma phaserTemplate(fragmentIterations)","#pragma phaserTemplate(fragmentNormalMap)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform vec2 uSeedX;","uniform vec2 uSeedY;","uniform vec2 uCells;","uniform vec2 uCellOffset;","uniform vec2 uVariation;","uniform vec2 uWrap;","uniform float uSmoothing;","uniform float uNormalScale;","uniform vec4 uColorStart;","uniform vec4 uColorEnd;","varying vec2 outTexCoord;","float trig(vec2 p)","{"," return fract(43757.5453*sin(dot(p, vec2(12.9898,78.233))));","}","vec2 bigCoord (vec2 coord, float scale)","{"," return (coord + uCellOffset) * scale * uCells;","}","vec2 hash2D (vec2 coord)","{"," return vec2("," trig(coord + uSeedX),"," trig(coord + uSeedY)"," ) * uVariation;","}","float worley2D (vec2 uv, float scale)","{"," vec2 coord = bigCoord(uv, scale);"," vec2 point = floor(coord);"," vec2 frac = fract(coord);"," float dist = 12.0;"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec2 cellNeighbor = vec2(i, j);"," vec2 jitter = hash2D(mod(point + cellNeighbor, uWrap * scale));"," vec2 diff = cellNeighbor - frac + jitter;"," float d = dot(diff, diff); // Squared length of diff."," if (d < dist)"," {"," dist = d;"," }"," }"," return sqrt(dist);","}","float worley2DIndex (vec2 uv, float scale)","{"," vec2 coord = bigCoord(uv, scale);"," vec2 point = floor(coord);"," vec2 frac = fract(coord);"," float dist = 12.0;"," float random = 0.0;"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec2 cellNeighbor = vec2(i, j);"," vec2 jitter = hash2D(mod(point + cellNeighbor, uWrap * scale));"," vec2 diff = cellNeighbor - frac + jitter;"," float d = dot(diff, diff); // Squared length of diff."," if (d < dist)"," {"," dist = d;"," random = jitter.x;"," }"," }"," return random;","}","float worley2DSmooth (vec2 uv, float scale)","{"," vec2 coord = bigCoord(uv, scale);"," vec2 point = floor(coord);"," vec2 frac = fract(coord);"," float value = 0.0;"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec2 cellNeighbor = vec2(i, j);"," vec2 jitter = hash2D(mod(point + cellNeighbor, uWrap * scale));"," vec2 diff = cellNeighbor - frac + jitter;"," float d = length(diff);"," value += exp2(-32.0 / uSmoothing * d); // Accumulate fast-decaying exponential of length."," }"," return -(1.0 / 32.0 * uSmoothing) * log2(value);","}","float iterateWorley2D (vec2 uv)","{"," float value = 0.0;"," float itValue = 0.0;"," for (float iteration = 0.0; iteration < ITERATION_COUNT; iteration++)"," {"," float scale = exp2(iteration);"," #ifdef MODE_DISTANCE"," itValue = worley2D(uv + iteration, scale);"," #endif"," #ifdef MODE_INDEX"," itValue = worley2DIndex(uv + iteration, scale);"," #endif"," #ifdef MODE_DISTANCE_SMOOTH"," itValue = worley2DSmooth(uv + iteration, scale);"," #endif"," value += (itValue - 0.5) / scale;"," }"," return value + 0.5;","}","void main ()","{"," float value = iterateWorley2D(outTexCoord);"," #ifndef NORMAL_MAP"," vec4 color = mix(uColorStart, uColorEnd, value);"," color.rgb *= color.a;"," gl_FragColor = color;"," #else"," float dx = dFdx(value) * uNormalScale;"," float dy = dFdy(value) * uNormalScale;"," vec3 normal = vec3(dx, dy, 1.0 - sqrt(dx * dx + dy * dy)) * 0.5 + 0.5;"," gl_FragColor = vec4(normal, 1.0);"," #endif","}"].join("\n")},79814(t){t.exports=["#version 100","#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(fragmentMode)","#pragma phaserTemplate(fragmentIterations)","#pragma phaserTemplate(fragmentNormalMap)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform vec3 uSeedX;","uniform vec3 uSeedY;","uniform vec3 uSeedZ;","uniform vec3 uCells;","uniform vec3 uCellOffset;","uniform vec3 uVariation;","uniform vec3 uWrap;","uniform float uSmoothing;","uniform float uNormalScale;","uniform vec4 uColorStart;","uniform vec4 uColorEnd;","varying vec2 outTexCoord;","float trig(vec3 p)","{"," return fract(43757.5453*sin(dot(p, vec3(12.9898,78.233, 9441.8953))));","}","vec3 bigCoord (vec3 coord, float scale)","{"," return (coord + uCellOffset) * scale * uCells;","}","vec3 hash3D (vec3 coord)","{"," return vec3("," trig(coord + uSeedX),"," trig(coord + uSeedY),"," trig(coord + uSeedZ)"," ) * uVariation;","}","float worley3D (vec3 uv, float scale)","{"," vec3 coord = bigCoord(uv, scale);"," vec3 point = floor(coord);"," vec3 frac = fract(coord);"," float dist = 12.0;"," for (float k = -1.0; k <= 1.0; k++)"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec3 cellNeighbor = vec3(i, j, k);"," vec3 jitter = hash3D(mod(point + cellNeighbor, uWrap * scale));"," vec3 diff = cellNeighbor - frac + jitter;"," float d = dot(diff, diff); // Squared length of diff."," if (d < dist)"," {"," dist = d;"," }"," }"," return sqrt(dist);","}","float worley3DIndex (vec3 uv, float scale)","{"," vec3 coord = bigCoord(uv, scale);"," vec3 point = floor(coord);"," vec3 frac = fract(coord);"," float dist = 12.0;"," float random = 0.0;"," for (float k = -1.0; k <= 1.0; k++)"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec3 cellNeighbor = vec3(i, j, k);"," vec3 jitter = hash3D(mod(point + cellNeighbor, uWrap * scale));"," vec3 diff = cellNeighbor - frac + jitter;"," float d = dot(diff, diff); // Squared length of diff."," if (d < dist)"," {"," dist = d;"," random = jitter.x;"," }"," }"," return random;","}","float worley3DSmooth (vec3 uv, float scale)","{"," vec3 coord = bigCoord(uv, scale);"," vec3 point = floor(coord);"," vec3 frac = fract(coord);"," float value = 0.0;"," for (float k = -1.0; k <= 1.0; k++)"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec3 cellNeighbor = vec3(i, j, k);"," vec3 jitter = hash3D(mod(point + cellNeighbor, uWrap * scale));"," vec3 diff = cellNeighbor - frac + jitter;"," float d = length(diff);"," value += exp2(-32.0 / uSmoothing * d); // Accumulate fast-decaying exponential of length."," }"," return -(1.0 / 32.0 * uSmoothing) * log2(value);","}","float iterateWorley3D (vec3 uv)","{"," float value = 0.0;"," float itValue = 0.0;"," for (float iteration = 0.0; iteration < ITERATION_COUNT; iteration++)"," {"," float scale = exp2(iteration);"," #ifdef MODE_DISTANCE"," itValue = worley3D(uv + iteration, scale);"," #endif"," #ifdef MODE_INDEX"," itValue = worley3DIndex(uv + iteration, scale);"," #endif"," #ifdef MODE_DISTANCE_SMOOTH"," itValue = worley3DSmooth(uv + iteration, scale);"," #endif"," value += (itValue - 0.5) / scale;"," }"," return value + 0.5;","}","void main ()","{"," vec3 uv = vec3(outTexCoord, 0.0);"," float value = iterateWorley3D(uv);"," #ifndef NORMAL_MAP"," vec4 color = mix(uColorStart, uColorEnd, value);"," color.rgb *= color.a;"," gl_FragColor = color;"," #else"," float dx = dFdx(value) * uNormalScale;"," float dy = dFdy(value) * uNormalScale;"," vec3 normal = vec3(dx, dy, 1.0 - sqrt(dx * dx + dy * dy)) * 0.5 + 0.5;"," gl_FragColor = vec4(normal, 1.0);"," #endif","}"].join("\n")},99595(t){t.exports=["#version 100","#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(fragmentMode)","#pragma phaserTemplate(fragmentIterations)","#pragma phaserTemplate(fragmentNormalMap)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform vec4 uSeedX;","uniform vec4 uSeedY;","uniform vec4 uSeedZ;","uniform vec4 uSeedW;","uniform vec4 uCells;","uniform vec4 uCellOffset;","uniform vec4 uVariation;","uniform vec4 uWrap;","uniform float uSmoothing;","uniform float uNormalScale;","uniform vec4 uColorStart;","uniform vec4 uColorEnd;","varying vec2 outTexCoord;","float trig(vec4 p)","{"," return fract(43757.5453*sin(dot(p, vec4(12.9898,78.233,9441.8953,61.99))));","}","vec4 bigCoord (vec4 coord, float scale)","{"," return (coord + uCellOffset) * scale * uCells;","}","vec4 hash4D (vec4 coord)","{"," return vec4("," trig(coord + uSeedX),"," trig(coord + uSeedY),"," trig(coord + uSeedZ),"," trig(coord + uSeedW)"," ) * uVariation;","}","float worley4D (vec4 uv, float scale)","{"," vec4 coord = bigCoord(uv, scale);"," vec4 point = floor(coord);"," vec4 frac = fract(coord);"," float dist = 16.0;"," for (float l = -1.0; l <= 1.0; l++)"," for (float k = -1.0; k <= 1.0; k++)"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec4 cellNeighbor = vec4(i, j, k, l);"," vec4 jitter = hash4D(mod(point + cellNeighbor, uWrap * scale));"," vec4 diff = cellNeighbor - frac + jitter;"," float d = dot(diff, diff); // Squared length of diff."," if (d < dist)"," {"," dist = d;"," }"," }"," return sqrt(dist);","}","float worley4DIndex (vec4 uv, float scale)","{"," vec4 coord = bigCoord(uv, scale);"," vec4 point = floor(coord);"," vec4 frac = fract(coord);"," float dist = 16.0;"," float random = 0.0;"," for (float l = -1.0; l <= 1.0; l++)"," for (float k = -1.0; k <= 1.0; k++)"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec4 cellNeighbor = vec4(i, j, k, l);"," vec4 jitter = hash4D(mod(point + cellNeighbor, uWrap * scale));"," vec4 diff = cellNeighbor - frac + jitter;"," float d = dot(diff, diff); // Squared length of diff."," if (d < dist)"," {"," dist = d;"," random = jitter.x;"," }"," }"," return random;","}","float worley4DSmooth (vec4 uv, float scale)","{"," vec4 coord = bigCoord(uv, scale);"," vec4 point = floor(coord);"," vec4 frac = fract(coord);"," float value = 0.0;"," for (float l = -1.0; l <= 1.0; l++)"," for (float k = -1.0; k <= 1.0; k++)"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec4 cellNeighbor = vec4(i, j, k, l);"," vec4 jitter = hash4D(mod(point + cellNeighbor, uWrap * scale));"," vec4 diff = cellNeighbor - frac + jitter;"," float d = length(diff);"," value += exp2(-32.0 / uSmoothing * d); // Accumulate fast-decaying exponential of length."," }"," return -(1.0 / 32.0 * uSmoothing) * log2(value);","}","float iterateWorley4D (vec4 uv)","{"," float value = 0.0;"," float itValue = 0.0;"," for (float iteration = 0.0; iteration < ITERATION_COUNT; iteration++)"," {"," float scale = exp2(iteration);"," #ifdef MODE_DISTANCE"," itValue = worley4D(uv + iteration, scale);"," #endif"," #ifdef MODE_INDEX"," itValue = worley4DIndex(uv + iteration, scale);"," #endif"," #ifdef MODE_DISTANCE_SMOOTH"," itValue = worley4DSmooth(uv + iteration, scale);"," #endif"," value += (itValue - 0.5) / scale;"," }"," return value + 0.5;","}","void main ()","{"," vec4 uv = vec4(outTexCoord, 0.0, 0.0);"," float value = iterateWorley4D(uv);"," #ifndef NORMAL_MAP"," vec4 color = mix(uColorStart, uColorEnd, value);"," color.rgb *= color.a;"," gl_FragColor = color;"," #else"," float dx = dFdx(value) * uNormalScale;"," float dy = dFdy(value) * uNormalScale;"," vec3 normal = vec3(dx, dy, 1.0 - sqrt(dx * dx + dy * dy)) * 0.5 + 0.5;"," gl_FragColor = vec4(normal, 1.0);"," #endif","}"].join("\n")},62807(t){t.exports=["float inverseRotation = -rotation - uCamera.z;","float irSine = sin(inverseRotation);","float irCosine = cos(inverseRotation);","outInverseRotationMatrix = mat3("," irCosine, irSine, 0.0,"," -irSine, irCosine, 0.0,"," 0.0, 0.0, 1.0",");"].join("\n")},4127(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","precision mediump float;","#pragma phaserTemplate(fragmentDefine)","uniform vec2 uResolution;","uniform float uCameraZoom;","varying vec4 lightPosition;","varying vec4 lightColor;","varying float lightRadius;","varying float lightAttenuation;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec2 center = (lightPosition.xy + 1.0) * (uResolution.xy * 0.5);"," float distToSurf = length(center - gl_FragCoord.xy);"," float radius = 1.0 - distToSurf / (lightRadius * uCameraZoom);"," float intensity = smoothstep(0.0, 1.0, radius * lightAttenuation);"," vec4 color = vec4(intensity, intensity, intensity, 0.0) * lightColor;"," #pragma phaserTemplate(fragmentProcess)"," gl_FragColor = vec4(color.rgb * lightColor.a, color.a);","}"].join("\n")},89924(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","precision mediump float;","#pragma phaserTemplate(vertexDefine)","uniform mat4 uProjectionMatrix;","attribute vec2 inPosition;","attribute vec2 inLightPosition;","attribute vec4 inLightColor;","attribute float inLightRadius;","attribute float inLightAttenuation;","varying vec4 lightPosition;","varying vec4 lightColor;","varying float lightRadius;","varying float lightAttenuation;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(vertexHeader)","void main ()","{"," lightColor = inLightColor;"," lightRadius = inLightRadius;"," lightAttenuation = inLightAttenuation;"," lightPosition = uProjectionMatrix * vec4(inLightPosition, 1.0, 1.0);"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);"," #pragma phaserTemplate(vertexProcess)","}"].join("\n")},68589(t){t.exports=["#extension GL_OES_standard_derivatives : enable","#define BAND_TREE_DEPTH 0.0","uniform sampler2D uRampTexture;","uniform vec2 uRampResolution;","uniform float uRampBandStart;","uniform bool uDither;","float decodeNumberSample(vec4 sample)","{"," return ("," sample.r * 255.0 +"," sample.g * 255.0 * 256.0 +"," sample.b * 255.0 * 256.0 * 256.0 +"," sample.a * 255.0 * 256.0 * 256.0 * 256.0"," ) / 256.0 / 256.0;","}","struct Band","{"," vec4 colorStart;"," vec4 colorEnd;"," float start;"," float end;"," int colorSpace;"," int interpolation;"," float middle;","};","Band getBand(float progress)","{"," vec2 rampStep = 1.0 / uRampResolution;"," vec2 c = rampStep / 2.0;"," float start = decodeNumberSample(texture2D(uRampTexture, c));"," float end = decodeNumberSample(texture2D(uRampTexture, vec2(1.0, 0.0) * rampStep + c));"," float TREE_OFFSET = 2.0; // Beginning of tree block."," float index = 0.0;"," float x, y;"," for (float i = 0.0; i < BAND_TREE_DEPTH; i++)"," {"," x = mod(index + TREE_OFFSET, uRampResolution.x);"," y = floor(x / uRampResolution.x);"," float pivot = decodeNumberSample(texture2D(uRampTexture, vec2(x, y) * rampStep + c));"," if (progress > pivot)"," {"," start = pivot;"," index = index * 2.0 + 2.0;"," }"," else"," {"," end = pivot;"," index = index * 2.0 + 1.0;"," }"," }"," float bandNumber = index - uRampBandStart + TREE_OFFSET;"," float bandIndex = bandNumber * 3.0 + uRampBandStart;"," x = mod(bandIndex, uRampResolution.x);"," y = floor(bandIndex / uRampResolution.x);"," vec4 colorStart = texture2D(uRampTexture, vec2(x, y) * rampStep + c);"," x = mod(bandIndex + 1.0, uRampResolution.x);"," y = floor(bandIndex / uRampResolution.x);"," vec4 colorEnd = texture2D(uRampTexture, vec2(x, y) * rampStep + c);"," x = mod(bandIndex + 2.0, uRampResolution.x);"," y = floor(bandIndex / uRampResolution.x);"," float bandData = decodeNumberSample(texture2D(uRampTexture, vec2(x, y) * rampStep + c));"," int colorSpace = int(floor(bandData / 255.0));"," int interpolation = int(floor(bandData)) - colorSpace * 255;"," return Band(colorStart, colorEnd, start, end, colorSpace, interpolation, fract(bandData) * 2.0);","}","float interpolate(float progress, int mode)","{"," if (mode == 1)"," {"," if ((progress *= 2.0) < 1.0)"," {"," return 0.5 * sqrt(1.0 - (--progress * progress));"," }"," progress = 1.0 - progress;"," return 1.0 - 0.5 * sqrt(1.0 - progress * progress);"," }"," if (mode == 2)"," {"," return sin((progress - 0.5) * 3.14159265358979323846) * 0.5 + 0.5;"," }"," if (mode == 3)"," {"," return sqrt(1.0 - (--progress * progress));"," }"," if (mode == 4)"," {"," return 1.0 - sqrt(1.0 - progress * progress);"," }"," return progress;","}","float ditherIGN(float value)","{"," float dx = dFdx(value);"," float dy = dFdy(value);"," float rateOfChange = sqrt(dx * dx + dy * dy);"," value += (fract(52.9829189 * fract(0.06711056 * gl_FragCoord.x + 0.00583715 * gl_FragCoord.y)) - 0.5) * rateOfChange;"," return value;","}","vec4 rgbaToHsva(vec4 rgba)","{"," float r = rgba.r;"," float g = rgba.g;"," float b = rgba.b;"," float a = rgba.a;"," float min = min(min(r, g), b);"," float max = max(max(r, g), b);"," float d = max - min;"," float h = 0.0;"," float s = (max == 0.0) ? 0.0 : d / max;"," float v = max;"," if (max != min)"," {"," if (max == r)"," {"," h = (g - b) / d + ((g < b) ? 6.0 : 0.0);"," }"," else if (max == g)"," {"," h = (b - r) / d + 2.0;"," }"," else"," {"," h = (r - g) / d + 4.0;"," }"," h /= 6.0;"," }"," return vec4(h, s, v, a);","}","float hsvaToRgbaConvert(float n, vec4 hsva)","{"," float k = mod(n + hsva.x * 6.0, 6.0);"," float min = min(min(k, 4.0 - k), 1.0);"," return hsva.z - hsva.z * hsva.y * max(0.0, min);","}","vec4 hsvaToRgba(vec4 hsva)","{"," return vec4("," hsvaToRgbaConvert(5.0, hsva),"," hsvaToRgbaConvert(3.0, hsva),"," hsvaToRgbaConvert(1.0, hsva),"," hsva.a"," );","}","vec4 mixBandColor(float progress, Band band)","{"," if (band.colorSpace == 0)"," {"," return mix(band.colorStart, band.colorEnd, progress);"," }"," vec4 hsvaStart = rgbaToHsva(band.colorStart);"," vec4 hsvaEnd = rgbaToHsva(band.colorEnd);"," if (band.colorSpace == 1)"," {"," float dH = hsvaStart.x - hsvaEnd.x;"," if (dH > 0.5)"," {"," hsvaStart.x -= 1.0;"," }"," else if (dH < -0.5)"," {"," hsvaStart.x += 1.0;"," }"," }"," else if (band.colorSpace == 2)"," {"," if (hsvaStart.x > hsvaEnd.x)"," {"," hsvaStart.x -= 1.0;"," }"," }"," else if (band.colorSpace == 3)"," {"," if (hsvaStart.x < hsvaEnd.x)"," {"," hsvaStart.x += 1.0;"," }"," }"," vec4 hsvaMix = mix(hsvaStart, hsvaEnd, progress);"," hsvaMix.x = mod(hsvaMix.x, 1.0);"," return hsvaToRgba(hsvaMix);","}","vec4 getRampAt(float progress)","{"," Band band = getBand(progress);"," float bandProgress = (progress - band.start) / (band.end - band.start);"," float gamma = log(0.5) / log(band.middle);"," bandProgress = pow(bandProgress, gamma);"," bandProgress = interpolate(bandProgress, band.interpolation);"," if (uDither)"," {"," bandProgress = ditherIGN(bandProgress);"," }"," return mixBandColor(bandProgress, band);","}"].join("\n")},72823(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(fragmentDefine)","varying vec2 outTexCoord;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec4 fragColor = vec4(outTexCoord.xyx, 1.0);"," #pragma phaserTemplate(fragmentProcess)"," gl_FragColor = fragColor;","}"].join("\n")},65884(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(vertexDefine)","uniform mat4 uProjectionMatrix;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","varying vec2 outTexCoord;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(vertexHeader)","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);"," outTexCoord = inTexCoord;"," #pragma phaserTemplate(vertexProcess)","}"].join("\n")},2807(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","varying vec2 outFragCoord;","varying vec2 outTexCoord;","void main ()","{"," outFragCoord = inPosition.xy * 0.5 + 0.5;"," outTexCoord = inTexCoord;"," gl_Position = vec4(inPosition, 0, 1);","}"].join("\n")},49119(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(fragmentDefine)","uniform vec2 uResolution;","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," #pragma phaserTemplate(fragmentProcess)"," gl_FragColor = fragColor;","}"].join("\n")},3524(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#define ROUND_BIAS 0.5001","#pragma phaserTemplate(vertexDefine)","uniform mat4 uProjectionMatrix;","uniform mat3 uViewMatrix;","uniform vec3 uCameraScrollAndAlpha;","uniform int uRoundPixels;","uniform vec2 uResolution;","uniform float uTime;","uniform vec2 uDiffuseResolution;","uniform vec2 uFrameDataResolution;","uniform sampler2D uFrameDataTexture;","uniform float uGravity;","attribute float inVertex;","attribute vec4 inPositionX;","attribute vec4 inPositionY;","attribute vec4 inRotation;","attribute vec4 inScaleX;","attribute vec4 inScaleY;","attribute vec4 inAlpha;","attribute vec4 inFrame;","attribute vec4 inTintBlend;","attribute vec4 inTintTL;","attribute vec4 inTintTR;","attribute vec4 inTintBL;","attribute vec4 inTintBR;","attribute vec4 inOriginAndTintModeAndCreationTime;","attribute vec2 inScrollFactor;","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(vertexHeader)","const float PI = 3.14159265359;","const float HALF_PI = PI / 2.0;","const float BOUNCE_OVERSHOOT = 1.70158;","const float BOUNCE_OVERSHOOT_PLUS = BOUNCE_OVERSHOOT + 1.0;","const float BOUNCE_OVERSHOOT_IN_OUT = BOUNCE_OVERSHOOT * 1.525;","const float BOUNCE_OVERSHOOT_IN_OUT_PLUS = BOUNCE_OVERSHOOT_IN_OUT + 1.0;","float animate (vec4 anim)","{"," float value = anim.x;"," float a = anim.y;"," float b = abs(anim.z);"," float c = abs(anim.w);"," bool yoyo = anim.z < 0.0;"," bool loop = anim.w > 0.0;"," int type = int(floor(c));"," if (type == 0|| b == 0.0)"," {"," return value;"," }"," float duration = b;"," float delay = mod(c, 1.0) * 2.0;"," float rawTime = ((uTime - inOriginAndTintModeAndCreationTime.w) / duration) - delay;"," float time = mod(rawTime, 1.0);"," if (yoyo && (mod(rawTime, 2.0) >= 1.0))"," {"," time = 1.0 - time;"," }"," float repeats = loop ? 0.0 : floor(a);"," float timeContinuous = loop ? time : rawTime;"," #ifdef FEATURE_LINEAR"," if (type == 1)"," {"," return value + a * timeContinuous;"," }"," #endif"," #ifdef FEATURE_GRAVITY"," if (type == 2)"," {"," float v = floor(a);"," float gravityFactor = (a - v) * 2.0 - 1.0;"," if (gravityFactor == 0.0)"," {"," gravityFactor = 1.0;"," }"," float seconds = timeContinuous * duration / 1000.0;"," float accel = uGravity * gravityFactor;"," return value + (v * seconds) + (0.5 * accel * seconds * seconds);"," }"," #endif"," #ifdef FEATURE_QUAD_EASEOUT"," if (type == 10)"," {"," return value + a * time * (2.0 - time)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUAD_EASEIN"," if (type == 11)"," {"," return value + a * time * time"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUAD_EASEINOUT"," if (type == 12)"," {"," time *= 2.0;"," if (time < 1.0)"," {"," return value + a * time * time * 0.5"," + repeats * a;"," }"," time -= 1.0;"," return value + a * -0.5 * (time * (time - 2.0) - 1.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_CUBIC_EASEOUT"," if (type == 20)"," {"," time -= 1.0;"," return value + a * (time * time * time + 1.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_CUBIC_EASEIN"," if (type == 21)"," {"," return value + a * time * time * time"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_CUBIC_EASEINOUT"," if (type == 22)"," {"," time *= 2.0;"," if (time < 1.0)"," {"," return value + a * time * time * time * 0.5"," + repeats * a;"," }"," time -= 2.0;"," return value + a * 0.5 * (time * time * time + 2.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUART_EASEOUT"," if (type == 30)"," {"," time -= 1.0;"," return value + a * (1.0 - time * time * time * time)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUART_EASEIN"," if (type == 31)"," {"," return value + a * time * time * time * time"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUART_EASEINOUT"," if (type == 32)"," {"," time *= 2.0;"," if (time < 1.0)"," {"," return value + a * time * time * time * time * 0.5"," + repeats * a;"," }"," time -= 2.0;"," return value + a * -0.5 * (time * time * time * time - 2.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUINT_EASEOUT"," if (type == 40)"," {"," time -= 1.0;"," return value + a * (time * time * time * time * time + 1.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUINT_EASEIN"," if (type == 41)"," {"," return value + a * time * time * time * time * time"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUINT_EASEINOUT"," if (type == 42)"," {"," time *= 2.0;"," if (time < 1.0)"," {"," return value + a * time * time * time * time * time * 0.5"," + repeats * a;"," }"," time -= 2.0;"," return value + a * 0.5 * (time * time * time * time * time + 2.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_SINE_EASEOUT"," if (type == 50)"," {"," return value + a * sin(time * HALF_PI)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_SINE_EASEIN"," if (type == 51)"," {"," return value + a * (1.0 - cos(time * HALF_PI))"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_SINE_EASEINOUT"," if (type == 52)"," {"," return value + a * 0.5 * (1.0 - cos(PI * time))"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_EXPO_EASEOUT"," if (type == 60)"," {"," return value + a * (1.0 - pow(2.0, -10.0 * time))"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_EXPO_EASEIN"," if (type == 61)"," {"," return value + a * pow(2.0, 10.0 * (time - 1.0) - 0.001)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_EXPO_EASEINOUT"," if (type == 62)"," {"," time *= 2.0;"," if (time < 1.0)"," {"," return value + a * 0.5 * pow(2.0, 10.0 * (time - 1.0))"," + repeats * a;"," }"," time -= 1.0;"," return value + a * 0.5 * (2.0 - pow(2.0, -10.0 * (time - 1.0)))"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_CIRC_EASEOUT"," if (type == 70)"," {"," time -= 1.0;"," return value + a * sqrt(1.0 - time * time)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_CIRC_EASEIN"," if (type == 71)"," {"," return value + a * (1.0 - sqrt(1.0 - time * time))"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_CIRC_EASEINOUT"," if (type == 72)"," {"," time *= 2.0;"," if (time < 1.0)"," {"," return value + a * -0.5 * (sqrt(1.0 - time * time) - 1.0)"," + repeats * a;"," }"," time -= 2.0;"," return value + a * 0.5 * (sqrt(1.0 - time * time) + 1.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_BACK_EASEOUT"," if (type == 90)"," {"," time -= 1.0;"," return value + a * (time * time * (BOUNCE_OVERSHOOT_PLUS * time + BOUNCE_OVERSHOOT) + 1.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_BACK_EASEIN"," if (type == 91)"," {"," return value + a * time * time * (BOUNCE_OVERSHOOT_PLUS * time - BOUNCE_OVERSHOOT)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_BACK_EASEINOUT"," if (type == 92)"," {"," time *= 2.0;"," if (time < 1.0)"," {"," return value + a * 0.5 * (time * time * (BOUNCE_OVERSHOOT_IN_OUT_PLUS * time - BOUNCE_OVERSHOOT_IN_OUT))"," + repeats * a;"," }"," time -= 2.0;"," return value + a * 0.5 * (time * time * (BOUNCE_OVERSHOOT_IN_OUT_PLUS * time + BOUNCE_OVERSHOOT_IN_OUT) + 2.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_BOUNCE_EASEOUT"," if (type == 100)"," {"," if (time < 1.0 / 2.75)"," {"," return value + a * (7.5625 * time * time)"," + repeats * a;"," }"," else if (time < 2.0 / 2.75)"," {"," time -= 1.5 / 2.75;"," return value + a * (7.5625 * time * time + 0.75)"," + repeats * a;"," }"," else if (time < 2.5 / 2.75)"," {"," time -= 2.25 / 2.75;"," return value + a * (7.5625 * time * time + 0.9375)"," + repeats * a;"," }"," else"," {"," time -= 2.625 / 2.75;"," return value + a * (7.5625 * time * time + 0.984375)"," + repeats * a;"," }"," }"," #endif"," #ifdef FEATURE_BOUNCE_EASEIN"," if (type == 101)"," {"," time = 1.0 - time;"," if (time < 1.0 / 2.75)"," {"," return value + a * (1.0 - 7.5625 * time * time)"," + repeats * a;"," }"," else if (time < 2.0 / 2.75)"," {"," time -= 1.5 / 2.75;"," return value + a * (1.0 - (7.5625 * time * time + 0.75))"," + repeats * a;"," }"," else if (time < 2.5 / 2.75)"," {"," time -= 2.25 / 2.75;"," return value + a * (1.0 - (7.5625 * time * time + 0.9375))"," + repeats * a;"," }"," else"," {"," time -= 2.625 / 2.75;"," return value + a * (1.0 - (7.5625 * time * time + 0.984375))"," + repeats * a;"," }"," }"," #endif"," #ifdef FEATURE_BOUNCE_EASEINOUT"," if (type == 102)"," {"," bool reverse = false;"," if (time < 0.5)"," {"," time = 1.0 - time * 2.0;"," reverse = true;"," }"," if (time < 1.0 / 2.75)"," {"," time = 7.5625 * time * time;"," }"," else if (time < 2.0 / 2.75)"," {"," time -= 1.5 / 2.75;"," time = 7.5625 * time * time + 0.75;"," }"," else if (time < 2.5 / 2.75)"," {"," time -= 2.25 / 2.75;"," time = 7.5625 * time * time + 0.9375;"," }"," else"," {"," time -= 2.625 / 2.75;"," time = 7.5625 * time * time + 0.984375;"," }"," if (reverse)"," {"," return value + a * (1.0 - time) * 0.5"," + repeats * a;"," }"," return value + a * time * 0.5 + 0.5"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_STEPPED"," if (type == 110)"," {"," return value + a * floor(time + 0.5)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_SMOOTHSTEP_EASEOUT"," if (type == 120)"," {"," return value + a * (smoothstep(0.0, 1.0, time / 2.0 + 0.5) * 2.0 - 1.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_SMOOTHSTEP_EASEIN"," if (type == 121)"," {"," return value + a * smoothstep(0.0, 1.0, time / 2.0) * 2.0"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_SMOOTHSTEP_EASEINOUT"," if (type == 122)"," {"," return value + a * smoothstep(0.0, 1.0, time)"," + repeats * a;"," }"," #endif"," return value;","}","struct Frame {"," vec2 position;"," vec2 size;"," vec2 offset;","};","Frame getFrame (float frame)","{"," float index1 = floor(frame) * 3.0;"," float index2 = index1 + 1.0;"," float index3 = index1 + 2.0;"," float width = uFrameDataResolution.x;"," float x = mod(index1, width);"," float y = floor(index1 / width);"," vec4 texelUV = texture2D("," uFrameDataTexture,"," vec2(x + 0.5, y + 0.5) / uFrameDataResolution"," );"," x = mod(index2, width);"," y = floor(index2 / width);"," vec4 texelWH = texture2D("," uFrameDataTexture,"," vec2(x + 0.5, y + 0.5) / uFrameDataResolution"," );"," x = mod(index3, width);"," y = floor(index3 / width);"," vec4 texelOrigin = texture2D("," uFrameDataTexture,"," vec2(x + 0.5, y + 0.5) / uFrameDataResolution"," );"," return Frame("," vec2("," texelUV.r + texelUV.g * 256.0,"," texelUV.b + texelUV.a * 256.0"," ) * 255.0,"," vec2("," texelWH.r + texelWH.g * 256.0,"," texelWH.b + texelWH.a * 256.0"," ) * 255.0,"," vec2("," texelOrigin.r + texelOrigin.g * 256.0,"," texelOrigin.b + texelOrigin.a * 256.0"," ) * 255.0 - 32768.0"," );","}","void main ()","{"," float positionX = animate(inPositionX);"," float positionY = animate(inPositionY);"," float rotation = animate(inRotation);"," float scaleX = animate(inScaleX);"," float scaleY = animate(inScaleY);"," float frame = animate(inFrame);"," float tintBlend = animate(inTintBlend);"," float alpha = animate(inAlpha);"," vec2 origin = inOriginAndTintModeAndCreationTime.xy;"," float tintMode = inOriginAndTintModeAndCreationTime.z;"," float scrollFactorX = inScrollFactor.x;"," float scrollFactorY = inScrollFactor.y;"," Frame frameData = getFrame(frame);"," vec2 uv = frameData.position / uDiffuseResolution;"," vec2 wh = frameData.size / uDiffuseResolution;"," float u = uv.s;"," float v = uv.t;"," float w = wh.s;"," float h = wh.t;"," float width = frameData.size.s;"," float height = frameData.size.t;"," vec4 tint = inTintTL;"," float x = -origin.x;"," float y = -origin.y;"," if (inVertex == 0.0)"," {"," y = 1.0 - origin.y;"," v += h;"," tint = inTintBL;"," }"," else if (inVertex == 2.0)"," {"," x = 1.0 - origin.x;"," y = 1.0 - origin.y;"," u += w;"," v += h;"," tint = inTintBR;"," }"," else if (inVertex == 3.0)"," {"," x = 1.0 - origin.x;"," u += w;"," tint = inTintTR;"," }"," vec3 position = vec3("," (x * width - frameData.offset.x) * scaleX,"," (y * height - frameData.offset.y) * scaleY,"," 1.0"," );"," mat3 viewMatrix = uViewMatrix * mat3("," 1.0, 0.0, 0.0,"," 0.0, 1.0, 0.0,"," uCameraScrollAndAlpha.x * (1.0 - scrollFactorX), uCameraScrollAndAlpha.y * (1.0 - scrollFactorY), 1.0"," );"," float sine = sin(rotation);"," float cosine = cos(rotation);"," mat3 transformMatrix = mat3("," cosine, sine, 0.0,"," -sine, cosine, 0.0,"," positionX, positionY, 1.0"," );"," position = viewMatrix * transformMatrix * position;"," alpha *= uCameraScrollAndAlpha.z;"," tint.a *= alpha;"," if (uRoundPixels == 1 && rotation == 0.0 && scaleX == 1.0 && scaleY == 1.0)"," {"," position.xy = floor(position.xy + ROUND_BIAS);"," }"," gl_Position = uProjectionMatrix * vec4(position.xy, 1.0, 1.0);"," outTexCoord = vec2(u, 1.0 - v);"," outTint = mix(vec4(1.0, 1.0, 1.0, tint.a), tint, tintBlend);"," outTintEffect = tintMode;"," #pragma phaserTemplate(vertexProcess)","}"].join("\n")},57532(t){t.exports=["#version 100","#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","/* Redefine MAX_ANIM_FRAMES to support animations with different frame numbers. */","#define MAX_ANIM_FRAMES 0","#pragma phaserTemplate(fragmentDefine)","uniform vec2 uResolution;","uniform sampler2D uMainSampler;","uniform sampler2D uLayerSampler;","uniform vec2 uMainResolution;","uniform vec2 uLayerResolution;","uniform float uTileColumns;","uniform vec4 uTileWidthHeightMarginSpacing;","uniform float uAlpha;","uniform float uTime;","#if MAX_ANIM_FRAMES > 0","uniform sampler2D uAnimSampler;","uniform vec2 uAnimResolution;","#endif","varying vec2 outTexCoord;","varying vec2 outTileStride;","#pragma phaserTemplate(outVariables)","vec2 getTexRes ()","{"," return uMainResolution;","}","float floatTexel (vec4 texel)","{"," return texel.r * 255.0 + (texel.g * 255.0 * 256.0) + (texel.b * 255.0 * 256.0 * 256.0) + (texel.a * 255.0 * 256.0 * 256.0 * 256.0);","}","struct Tile","{"," float index;"," vec2 uv; // In texels."," #if MAX_ANIM_FRAMES > 0"," bool animated;"," #endif"," bool empty;","};","Tile getLayerData (vec2 coord)","{"," vec2 texelCoord = coord * uLayerResolution;"," vec2 tile = floor(texelCoord);"," vec2 uv = fract(texelCoord);"," uv.y = 1.0 - uv.y;"," vec4 texel = texture2D(uLayerSampler, (tile + 0.5) / uLayerResolution) * 255.0;"," float flags = texel.a;"," /* Check for empty tile flag in bit 28. */"," if (flags == 16.0)"," {"," return Tile("," 0.0,"," vec2(0.0),"," #if MAX_ANIM_FRAMES > 0"," false,"," #endif"," true"," );"," }"," /* Bit 31 is flipX. */"," bool flipX = flags > 127.0;"," /* Bit 30 is flipY. */"," bool flipY = mod(flags, 128.0) > 63.0;"," #if MAX_ANIM_FRAMES > 0"," /* Bit 29 is animation. */"," bool animated = mod(flags, 64.0) > 31.0;"," #endif"," if (flipX)"," {"," uv.x = 1.0 - uv.x;"," }"," if (flipY)"," {"," uv.y = 1.0 - uv.y;"," }"," float index = texel.r + (texel.g * 256.0) + (texel.b * 256.0 * 256.0);"," return Tile("," index,"," uv * uTileWidthHeightMarginSpacing.xy,"," #if MAX_ANIM_FRAMES > 0"," animated,"," #endif"," false"," );","}","vec2 getFrameCorner (float index)","{"," float x = mod(index, uTileColumns);"," float y = floor(index / uTileColumns);"," vec2 xy = vec2(x, y);"," return xy * outTileStride + uTileWidthHeightMarginSpacing.zz;","}","#if MAX_ANIM_FRAMES > 0","float animationIndex (float index)","{"," float animTextureWidth = uAnimResolution.x;"," vec2 index2D = vec2(mod(index, animTextureWidth), floor(index / animTextureWidth));"," vec4 animDurationTexel = texture2D(uAnimSampler, (index2D + 0.5) / uAnimResolution);"," index2D = vec2(mod(index + 1.0, animTextureWidth), floor((index + 1.0) / animTextureWidth));"," vec4 animIndexTexel = texture2D(uAnimSampler, (index2D + 0.5) / uAnimResolution);"," float animDuration = floatTexel(animDurationTexel);"," float animIndex = floatTexel(animIndexTexel);"," float animTime = mod(uTime, animDuration);"," float animTimeAccum = 0.0;"," for (int i = 0; i < MAX_ANIM_FRAMES; i++)"," {"," index2D = vec2(mod(animIndex, animTextureWidth), floor(animIndex / animTextureWidth));"," animDurationTexel = texture2D(uAnimSampler, (index2D + 0.5) / uAnimResolution);"," float frameDuration = floatTexel(animDurationTexel);"," animTimeAccum += frameDuration;"," if (animTime <= animTimeAccum)"," {"," break;"," }"," animIndex += 2.0;"," }"," animIndex += 1.0;"," index2D = vec2(mod(animIndex, animTextureWidth), floor(animIndex / animTextureWidth));"," animIndexTexel = texture2D(uAnimSampler, (index2D + 0.5) / uAnimResolution);"," float animFrameIndex = floatTexel(animIndexTexel);"," return animFrameIndex;","}","#endif","vec2 getTileTexelCoord (Tile tile)","{"," if (tile.empty)"," {"," return vec2(0.0);"," }"," float index = tile.index;"," #if MAX_ANIM_FRAMES > 0"," if (tile.animated)"," {"," index = animationIndex(index);"," }"," #endif"," vec2 frameCorner = getFrameCorner(index);"," return frameCorner + tile.uv;","}","#pragma phaserTemplate(fragmentHeader)","struct Samples {"," vec4 color;"," #pragma phaserTemplate(defineSamples)","};","Samples getColorSamples (vec2 texCoord)","{"," Samples samples;"," samples.color = texture2D("," uMainSampler,"," vec2(texCoord.x, 1.0 - texCoord.y)"," );"," #pragma phaserTemplate(getSamples)"," return samples;","}","Samples mixSamples (Samples samples1, Samples samples2, float alpha)","{"," Samples samples;"," samples.color = mix(samples1.color, samples2.color, alpha);"," #pragma phaserTemplate(mixSamples)"," return samples;","}","Samples getFinalSamples (Tile tile, vec2 layerTexCoord)","{"," vec2 texelCoord = getTileTexelCoord(tile);"," vec2 texCoord = texelCoord / uMainResolution;"," #pragma phaserTemplate(texCoord)"," #ifndef FEATURE_BORDERFILTER"," return getColorSamples(texCoord);"," #else"," #pragma phaserTemplate(finalSamples)"," vec2 wh = uTileWidthHeightMarginSpacing.xy;"," vec2 frameCorner = getFrameCorner(tile.index);"," vec2 frameCornerOpposite = frameCorner + wh;"," vec2 texCoordClamped = clamp(texCoord, (frameCorner + 0.5) / uMainResolution, (frameCornerOpposite - 0.5) / uMainResolution);"," vec2 dTexelCoord = (texCoord - texCoordClamped) * uMainResolution;"," dTexelCoord.y = -dTexelCoord.y;"," vec2 offsets = sign(dTexelCoord);"," Samples samples0 = getColorSamples(texCoordClamped);"," if (offsets.x == 0.0)"," {"," if (offsets.y == 0.0)"," {"," return samples0;"," }"," Tile tileY = getLayerData(layerTexCoord + (offsets - dTexelCoord) / wh / uLayerResolution);"," vec2 texelCoordY = getTileTexelCoord(tileY);"," vec2 texCoordY = texelCoordY / uMainResolution;"," Samples samplesY = getColorSamples(texCoordY);"," return mixSamples(samples0, samplesY, abs(dTexelCoord.y));"," }"," else"," {"," if (offsets.y == 0.0)"," {"," Tile tileX = getLayerData(layerTexCoord + (offsets - dTexelCoord) / wh / uLayerResolution);"," vec2 texelCoordX = getTileTexelCoord(tileX);"," vec2 texCoordX = texelCoordX / uMainResolution;"," Samples samplesX = getColorSamples(texCoordX);"," return mixSamples(samples0, samplesX, abs(dTexelCoord.x));"," }"," Tile tileX = getLayerData(layerTexCoord + (offsets * vec2(1.0, 0.0) - dTexelCoord) / wh / uLayerResolution);"," vec2 texelCoordX = getTileTexelCoord(tileX);"," vec2 texCoordX = texelCoordX / uMainResolution;"," Samples samplesX = getColorSamples(texCoordX);"," Tile tileY = getLayerData(layerTexCoord + (offsets * vec2(0.0, 1.0) - dTexelCoord) / wh / uLayerResolution);"," vec2 texelCoordY = getTileTexelCoord(tileY);"," vec2 texCoordY = texelCoordY / uMainResolution;"," Samples samplesY = getColorSamples(texCoordY);"," Tile tileXY = getLayerData(layerTexCoord + (offsets - dTexelCoord) / wh / uLayerResolution);"," vec2 texelCoordXY = getTileTexelCoord(tileXY);"," vec2 texCoordXY = texelCoordXY / uMainResolution;"," Samples samplesXY = getColorSamples(texCoordXY);"," Samples samples1 = mixSamples(samples0, samplesX, abs(dTexelCoord.x));"," Samples samples2 = mixSamples(samplesY, samplesXY, abs(dTexelCoord.x));"," return mixSamples(samples1, samples2, abs(dTexelCoord.y));"," }"," #endif","}","void main ()","{"," vec2 layerTexCoord = outTexCoord;"," Tile tile = getLayerData(layerTexCoord);"," Samples samples = getFinalSamples(tile, layerTexCoord);"," vec4 fragColor = samples.color;"," #pragma phaserTemplate(declareSamples)"," #pragma phaserTemplate(fragmentProcess)"," fragColor *= uAlpha;"," gl_FragColor = fragColor;","}"].join("\n")},23879(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(vertexDefine)","uniform mat4 uProjectionMatrix;","uniform vec2 uResolution;","uniform vec4 uTileWidthHeightMarginSpacing;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","varying vec2 outTexCoord;","varying vec2 outTileStride;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(vertexHeader)","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);"," outTexCoord = inTexCoord;"," outTileStride = uTileWidthHeightMarginSpacing.xy + uTileWidthHeightMarginSpacing.zz;"," #pragma phaserTemplate(vertexProcess)","}"].join("\n")},84639(t){t.exports=function(t,e){return{name:t+"Anims",additions:{fragmentDefine:"#undef MAX_ANIM_FRAMES\n#define MAX_ANIM_FRAMES "+t},tags:["MAXANIMS"],disable:!!e}}},81084(t,e,i){var s=i(84547);t.exports=function(t){return{name:"ApplyLighting",additions:{fragmentHeader:s,fragmentProcess:"fragColor = applyLighting(fragColor, normal);"},tags:["LIGHTING"],disable:!!t}}},44349(t,e,i){var s=i(11104);t.exports=function(t){return{name:"Tint",additions:{fragmentHeader:s,fragmentProcess:"fragColor = applyTint(fragColor);"},tags:["TINT"],disable:!!t}}},99501(t,e,i){var s=i(81556);t.exports=function(t){return{name:"BoundedSampler",additions:{fragmentHeader:s},disable:!!t}}},6184(t,e,i){var s=i(11719);t.exports=function(t){return{name:"DefineLights",additions:{fragmentDefine:"#define LIGHT_COUNT 1",fragmentHeader:s},tags:["LIGHTING"],disable:!!t}}},11653(t){t.exports=function(t,e){return{name:t+"TexCount",additions:{fragmentDefine:"#define TEXTURE_COUNT "+t},tags:["TexCount"],disable:!!e}}},13198(t){t.exports=function(t){return{name:"FlatNormal",additions:{fragmentProcess:"vec3 normal = vec3(0.0, 0.0, 1.0);"},tags:["LIGHTING"],disable:!!t}}},40829(t,e,i){var s=i(84220);t.exports=function(t){return{name:"NormalMap",additions:{fragmentHeader:s,fragmentProcess:"vec3 normal = getNormalFromMap(texCoord);"},tags:["LIGHTING"],disable:!!t}}},42792(t){t.exports=function(t){return{name:"TexCoordOut",additions:{fragmentProcess:"vec2 texCoord = outTexCoord;\n#pragma phaserTemplate(texCoord)"},tags:["TEXCOORD"],disable:!!t}}},96049(t,e,i){var s=i(2860);t.exports=function(t){return{name:"GetTexRes",additions:{fragmentHeader:s},tags:["TEXRES"],disable:!!t}}},33997(t,e,i){var s=i(46432);t.exports=function(t,e){void 0===t&&(t=1);for(var i="",r=1;r1&&(d=u.baseType===i.FLOAT?new Float32Array(c):new Int32Array(c)),this.glUniforms.set(l.name,{location:i.getUniformLocation(t,l.name),size:l.size,type:l.type,value:d})}},setUniform:function(t,e){this.uniformRequests.set(t,e)},bind:function(){this.renderer.glWrapper.updateBindingsProgram(this.glState),this.uniformRequests.each(this._processUniformRequest.bind(this)),this.uniformRequests.clear()},_processUniformRequest:function(t,e){var i=this.renderer,s=i.gl,n=this.glUniforms.get(t);if(n){var a=n.value;if(a.length){for(var o=!1,h=0;h1)c.setV.call(s,l,a);else switch(c.size){case 1:c.set.call(s,l,e);break;case 2:c.set.call(s,l,e[0],e[1]);break;case 3:c.set.call(s,l,e[0],e[1],e[2]);break;case 4:c.set.call(s,l,e[0],e[1],e[2],e[3])}}},destroy:function(){if(this.webGLProgram){var t=this.renderer.gl;if(!t.isContextLost()){this._vertexShader&&t.deleteShader(this._vertexShader),this._fragmentShader&&t.deleteShader(this._fragmentShader),t.deleteProgram(this.webGLProgram);for(var e=0;e=0;i--)this.units[i]=void 0,this.renderer.glWrapper.updateBindingsActiveTexture({bindings:{activeTexture:i}}),t.bindTexture(t.TEXTURE_2D,e),this.unitIndices[i]=i;t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array([0,0,255,255]))},bind:function(t,e,i,s){var r=this.units[e]!==t;if((i||!1!==s||r)&&this.renderer.glWrapper.updateBindingsActiveTexture({bindings:{activeTexture:e}},i),r||i){this.units[e]=t;var n=t?t.webGLTexture:null,a=this.renderer.gl;a.bindTexture(a.TEXTURE_2D,n),t&&t.needsMipmapRegeneration&&t.generateMipmap()}},bindUnits:function(t,e){for(var i=Math.min(t.length,this.renderer.maxTextures)-1;i>=0;i--)void 0!==t[i]&&this.bind(t[i],i,e,!1)},unbindTexture:function(t){for(var e=this.units.length-1;e>=0;e--)this.units[e]===t&&this.bind(null,e,!0,!1)},unbindAllUnits:function(){for(var t=this.units.length-1;t>=0;t--)this.bind(null,t,!0,!1)}});t.exports=s},82751(t,e,i){var s=i(83419),r=i(50030),n=new s({initialize:function(t,e,i,s,r,n,a,o,h,l,u,d,c){void 0===c&&(c=!0),this.renderer=t,this.webGLTexture=null,this.isRenderTexture=!1,this.mipLevel=e,this.minFilter=i,this.magFilter=s,this.wrapT=r,this.wrapS=n,this.format=a,this.pixels=o,this.width=h,this.height=l,this.pma=null==u||u,this.forceSize=!!d,this.flipY=!!c,this.__SPECTOR_Metadata={},this.batchUnit=-1,this.needsMipmapRegeneration=!1,this.createResource()},createResource:function(){var t=this.renderer.gl;if(!t.isContextLost())if(this.pixels instanceof n)this.webGLTexture=this.pixels.webGLTexture;else{var e=t.createTexture();e.__SPECTOR_Metadata=this.__SPECTOR_Metadata,this.webGLTexture=e,this._processTexture()}},resize:function(t,e){if(this.width!==t||this.height!==e){this.width=t,this.height=e;var i=this.renderer,s=i.gl,n=r(t,e);n?(this.wrapS=s.REPEAT,this.wrapT=s.REPEAT):(this.wrapS=s.CLAMP_TO_EDGE,this.wrapT=s.CLAMP_TO_EDGE),n&&i.mipmapFilter&&(!this.isRenderTexture||i.config.mipmapRegeneration)?this.minFilter=i.mipmapFilter:i.config.antialias?this.minFilter=s.LINEAR:this.minFilter=s.NEAREST,this._processTexture()}},update:function(t,e,i,s,r,n,a,o,h){0!==e&&0!==i&&(this.pixels=t,this.width=e,this.height=i,this.flipY=s,this.wrapS=r,this.wrapT=n,this.minFilter=a,this.magFilter=o,this.format=h,this._processTexture())},_processTexture:function(){var t=this.renderer.gl;this.renderer.glTextureUnits.bind(this,0),this.renderer.glWrapper.updateTexturing({texturing:{flipY:this.flipY,premultiplyAlpha:this.pma}}),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,this.minFilter),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,this.magFilter),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,this.wrapS),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,this.wrapT);var e=this.pixels,i=this.mipLevel,s=this.width,r=this.height,n=this.format;if(null==e)t.texImage2D(t.TEXTURE_2D,i,n,s,r,0,n,t.UNSIGNED_BYTE,null),this.generateMipmap();else if(e.compressed){s=e.width,r=e.height;for(var a=0;a0&&this.parentSize.height>0&&this.displaySize.setParent(this.parentSize),this.refresh()),t.events.on(h.PRE_STEP,this.step,this),t.events.once(h.READY,this.refresh,this),t.events.once(h.DESTROY,this.destroy,this),this.startListeners()},parseConfig:function(t){this.getParent(t),this.getParentBounds();var e=t.width,i=t.height,r=t.scaleMode,n=t.zoom,a=t.autoRound;if("string"==typeof e)if("%"!==e.substr(-1))e=parseInt(e,10);else{var o=this.parentSize.width;0===o&&(o=window.innerWidth);var h=parseInt(e,10)/100;e=Math.floor(o*h)}if("string"==typeof i)if("%"!==i.substr(-1))i=parseInt(i,10);else{var l=this.parentSize.height;0===l&&(l=window.innerHeight);var u=parseInt(i,10)/100;i=Math.floor(l*u)}this.scaleMode=r,this.autoRound=a,this.autoCenter=t.autoCenter,this.resizeInterval=t.resizeInterval,a&&(e=Math.floor(e),i=Math.floor(i)),this.gameSize.setSize(e,i),n===s.ZOOM.MAX_ZOOM&&(n=this.getMaxZoom()),this.zoom=n,1!==n&&(this._resetZoom=!0),this.baseSize.setSize(e,i),a&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),t.minWidth>0&&this.displaySize.setMin(t.minWidth*n,t.minHeight*n),t.maxWidth>0&&this.displaySize.setMax(t.maxWidth*n,t.maxHeight*n),this.displaySize.setSize(e,i),(t.snapWidth>0||t.snapHeight>0)&&this.displaySize.setSnap(t.snapWidth,t.snapHeight),this.orientation=d(e,i)},getParent:function(t){var e=t.parent;if(null!==e){if(this.parent=u(e),this.parentIsWindow=this.parent===document.body,t.expandParent&&t.scaleMode!==s.SCALE_MODE.NONE){var i=this.parent.getBoundingClientRect();(this.parentIsWindow||0===i.height)&&(document.documentElement.style.height="100%",document.body.style.height="100%",i=this.parent.getBoundingClientRect(),this.parentIsWindow||0!==i.height||(this.parent.style.overflow="hidden",this.parent.style.width="100%",this.parent.style.height="100%"))}t.fullscreenTarget&&!this.fullscreenTarget&&(this.fullscreenTarget=u(t.fullscreenTarget))}},getParentBounds:function(){if(!this.parent)return!1;var t=this.parentSize,e=this.parent.getBoundingClientRect();this.parentIsWindow&&this.game.device.os.iOS&&(e.height=l(!0));var i=e.width,s=e.height;if(t.width!==i||t.height!==s)return t.setSize(i,s),!0;if(this.canvas){var r=this.canvasBounds,n=this.canvas.getBoundingClientRect();if(n.x!==r.x||n.y!==r.y)return!0}return!1},lockOrientation:function(t){var e=screen.lockOrientation||screen.mozLockOrientation||screen.msLockOrientation;return!!e&&e.call(screen,t)},setParentSize:function(t,e){return this.parentSize.setSize(t,e),this.refresh()},setGameSize:function(t,e){var i=this.autoRound;i&&(t=Math.floor(t),e=Math.floor(e));var s=this.width,r=this.height;return this.gameSize.resize(t,e),this.baseSize.resize(t,e),i&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setAspectRatio(t/e),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height,this.refresh(s,r)},resize:function(t,e){var i=this.zoom,s=this.autoRound;s&&(t=Math.floor(t),e=Math.floor(e));var r=this.width,n=this.height;this.gameSize.resize(t,e),this.baseSize.resize(t,e),s&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setSize(t*i,e*i),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height;var a=this.canvas.style,o=t*i,h=e*i;return s&&(o=Math.floor(o),h=Math.floor(h)),o===t&&h===e||(a.width=o+"px",a.height=h+"px"),this.refresh(r,n)},setZoom:function(t){return this.zoom=t,this._resetZoom=!0,this.refresh()},setMaxZoom:function(){return this.zoom=this.getMaxZoom(),this._resetZoom=!0,this.refresh()},setSnap:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.displaySize.setSnap(t,e),this.refresh()},refresh:function(t,e){void 0===t&&(t=this.width),void 0===e&&(e=this.height),this.updateScale(),this.updateBounds(),this.updateOrientation(),this.displayScale.set(this.baseSize.width/this.canvasBounds.width,this.baseSize.height/this.canvasBounds.height);var i=this.game.domContainer;if(i){this.baseSize.setCSS(i);var s=this.canvas.style,r=i.style;r.transform="scale("+this.displaySize.width/this.baseSize.width+","+this.displaySize.height/this.baseSize.height+")",r.marginLeft=s.marginLeft,r.marginTop=s.marginTop}return this.emit(o.RESIZE,this.gameSize,this.baseSize,this.displaySize,t,e),this},updateOrientation:function(){if(this._checkOrientation){this._checkOrientation=!1;var t=d(this.width,this.height);t!==this.orientation&&(this.orientation=t,this.emit(o.ORIENTATION_CHANGE,t))}},updateScale:function(){var t,e,i=this.canvas.style,r=this.gameSize.width,a=this.gameSize.height,o=this.zoom,h=this.autoRound;if(this.scaleMode===s.SCALE_MODE.NONE)this.displaySize.setSize(r*o,a*o),t=this.displaySize.width,e=this.displaySize.height,h&&(t=Math.floor(t),e=Math.floor(e)),this._resetZoom&&(i.width=t+"px",i.height=e+"px",this._resetZoom=!1);else if(this.scaleMode===s.SCALE_MODE.RESIZE)this.displaySize.setSize(this.parentSize.width,this.parentSize.height),this.gameSize.setSize(this.displaySize.width,this.displaySize.height),this.baseSize.setSize(this.displaySize.width,this.displaySize.height),t=this.displaySize.width,e=this.displaySize.height,h&&(t=Math.floor(t),e=Math.floor(e)),this.canvas.width=t,this.canvas.height=e;else if(this.scaleMode===s.SCALE_MODE.EXPAND){var l,u,d=this.game.config.width,c=this.game.config.height,f=this.parentSize.width,p=this.parentSize.height,g=f/d,m=p/c;g=0?0:-a.x*o.x,l=a.y>=0?0:-a.y*o.y;return i=n.width>=a.width?r.width:r.width-(a.width-n.width)*o.x,s=n.height>=a.height?r.height:r.height-(a.height-n.height)*o.y,e.setTo(h,l,i,s),t&&(e.width/=t.zoomX,e.height/=t.zoomY,e.centerX=t.centerX+t.scrollX,e.centerY=t.centerY+t.scrollY),e},step:function(t,e){this.parent&&(this._lastCheck+=e,(this.dirty||this._lastCheck>this.resizeInterval)&&(this.getParentBounds()&&this.refresh(),this.dirty=!1,this._lastCheck=0))},stopListeners:function(){var t=this.domlisteners;screen.orientation&&screen.orientation.addEventListener?screen.orientation.removeEventListener("change",t.orientationChange,!1):window.removeEventListener("orientationchange",t.orientationChange,!1),window.removeEventListener("resize",t.windowResize,!1);["webkit","moz",""].forEach(function(e){document.removeEventListener(e+"fullscreenchange",t.fullScreenChange,!1),document.removeEventListener(e+"fullscreenerror",t.fullScreenError,!1)}),document.removeEventListener("MSFullscreenChange",t.fullScreenChange,!1),document.removeEventListener("MSFullscreenError",t.fullScreenError,!1)},destroy:function(){this.removeAllListeners(),this.stopListeners(),this.game=null,this.canvas=null,this.canvasBounds=null,this.parent=null,this.fullscreenTarget=null,this.parentSize.destroy(),this.gameSize.destroy(),this.baseSize.destroy(),this.displaySize.destroy()},isFullscreen:{get:function(){return this.fullscreen.active}},width:{get:function(){return this.gameSize.width}},height:{get:function(){return this.gameSize.height}},isPortrait:{get:function(){return this.orientation===s.ORIENTATION.PORTRAIT}},isLandscape:{get:function(){return this.orientation===s.ORIENTATION.LANDSCAPE}},isGamePortrait:{get:function(){return this.height>this.width}},isGameLandscape:{get:function(){return this.width>this.height}}});t.exports=y},64743(t){t.exports={NO_CENTER:0,CENTER_BOTH:1,CENTER_HORIZONTALLY:2,CENTER_VERTICALLY:3}},39218(t){t.exports={LANDSCAPE:"landscape-primary",LANDSCAPE_SECONDARY:"landscape-secondary",PORTRAIT:"portrait-primary",PORTRAIT_SECONDARY:"portrait-secondary"}},81050(t){t.exports={NONE:0,WIDTH_CONTROLS_HEIGHT:1,HEIGHT_CONTROLS_WIDTH:2,FIT:3,ENVELOP:4,RESIZE:5,EXPAND:6}},80805(t){t.exports={NO_ZOOM:1,ZOOM_2X:2,ZOOM_4X:4,MAX_ZOOM:-1}},13560(t,e,i){var s={CENTER:i(64743),ORIENTATION:i(39218),SCALE_MODE:i(81050),ZOOM:i(80805)};t.exports=s},56139(t){t.exports="enterfullscreen"},2336(t){t.exports="fullscreenfailed"},47412(t){t.exports="fullscreenunsupported"},51452(t){t.exports="leavefullscreen"},20666(t){t.exports="orientationchange"},47945(t){t.exports="resize"},97480(t,e,i){t.exports={ENTER_FULLSCREEN:i(56139),FULLSCREEN_FAILED:i(2336),FULLSCREEN_UNSUPPORTED:i(47412),LEAVE_FULLSCREEN:i(51452),ORIENTATION_CHANGE:i(20666),RESIZE:i(47945)}},93364(t,e,i){var s=i(79291),r=i(13560),n={Center:i(64743),Events:i(97480),Orientation:i(39218),ScaleManager:i(76531),ScaleModes:i(81050),Zoom:i(80805)};n=s(!1,n,r.CENTER),n=s(!1,n,r.ORIENTATION),n=s(!1,n,r.SCALE_MODE),n=s(!1,n,r.ZOOM),t.exports=n},27397(t,e,i){var s=i(95540),r=i(35355);t.exports=function(t){var e=t.game.config.defaultPhysicsSystem,i=s(t.settings,"physics",!1);if(e||i){var n=[];if(e&&n.push(r(e+"Physics")),i)for(var a in i)a=r(a.concat("Physics")),-1===n.indexOf(a)&&n.push(a);return n}}},52106(t,e,i){var s=i(95540);t.exports=function(t){var e=t.plugins.getDefaultScenePlugins(),i=s(t.settings,"plugins",!1);return Array.isArray(i)?i:e||[]}},87033(t){t.exports={game:"game",renderer:"renderer",anims:"anims",cache:"cache",plugins:"plugins",registry:"registry",scale:"scale",sound:"sound",textures:"textures",events:"events",cameras:"cameras",add:"add",make:"make",scenePlugin:"scene",displayList:"children",lights:"lights",data:"data",input:"input",load:"load",time:"time",tweens:"tweens",arcadePhysics:"physics",matterPhysics:"matter"}},97482(t,e,i){var s=i(83419),r=i(2368),n=new s({initialize:function(t){this.sys=new r(this,t),this.game,this.anims,this.cache,this.registry,this.sound,this.textures,this.events,this.cameras,this.add,this.make,this.scene,this.children,this.lights,this.data,this.input,this.load,this.time,this.tweens,this.physics,this.matter,this.scale,this.plugins,this.renderer},update:function(){}});t.exports=n},60903(t,e,i){var s=i(83419),r=i(89993),n=i(44594),a=i(8443),o=i(35154),h=i(54899),l=i(29747),u=i(97482),d=i(2368),c=new s({initialize:function(t,e){if(this.game=t,this.keys={},this.scenes=[],this._pending=[],this._start=[],this._queue=[],this._data={},this.isProcessing=!1,this.isBooted=!1,this.customViewports=0,this.systemScene,e){Array.isArray(e)||(e=[e]);for(var i=0;i-1&&(delete this.keys[s],this.scenes.splice(i,1),this._start.indexOf(s)>-1&&(i=this._start.indexOf(s),this._start.splice(i,1)),e.sys.destroy()),this},bootScene:function(t){var e,i=t.sys,s=i.settings;i.sceneUpdate=l,t.init&&(t.init.call(t,s.data),s.status=r.INIT,s.isTransition&&i.events.emit(n.TRANSITION_INIT,s.transitionFrom,s.transitionDuration)),i.load&&(e=i.load).reset(),e&&t.preload?(t.preload.call(t),s.status=r.LOADING,e.once(h.COMPLETE,this.loadComplete,this),e.start()):this.create(t)},loadComplete:function(t){this.create(t.scene)},payloadComplete:function(t){this.bootScene(t.scene)},update:function(t,e){this.processQueue(),this.isProcessing=!0;for(var i=this.scenes.length-1;i>=0;i--){var s=this.scenes[i].sys;s.settings.status>r.START&&s.settings.status<=r.RUNNING&&s.step(t,e),s.scenePlugin&&s.scenePlugin._target&&s.scenePlugin.step(t,e)}},render:function(t){for(var e=0;e=r.LOADING&&i.settings.status=r.START&&a<=r.CREATING)return this;if(a>=r.RUNNING&&a<=r.SLEEPING)n.shutdown(),n.sceneUpdate=l,n.start(e);else if(n.sceneUpdate=l,n.start(e),n.load&&(s=n.load),s&&n.settings.hasOwnProperty("pack")&&(s.reset(),s.addPack({payload:n.settings.pack})))return n.settings.status=r.LOADING,s.once(h.COMPLETE,this.payloadComplete,this),s.start(),this;return this.bootScene(i),this},stop:function(t,e){var i=this.getScene(t);if(i&&!i.sys.isTransitioning()&&i.sys.settings.status!==r.SHUTDOWN){var s=i.sys.load;s&&(s.off(h.COMPLETE,this.loadComplete,this),s.off(h.COMPLETE,this.payloadComplete,this)),i.sys.shutdown(e)}return this},switch:function(t,e,i){var s=this.getScene(t),r=this.getScene(e);return s&&r&&s!==r&&(this.sleep(t),this.isSleeping(e)?this.wake(e,i):this.start(e,i)),this},getAt:function(t){return this.scenes[t]},getIndex:function(t){var e=this.getScene(t);return this.scenes.indexOf(e)},bringToTop:function(t){if(this.isProcessing)return this.queueOp("bringToTop",t);var e=this.getIndex(t),i=this.scenes;if(-1!==e&&e0){var i=this.getScene(t);this.scenes.splice(e,1),this.scenes.unshift(i)}return this},moveDown:function(t){if(this.isProcessing)return this.queueOp("moveDown",t);var e=this.getIndex(t);if(e>0){var i=e-1,s=this.getScene(t),r=this.getAt(i);this.scenes[e]=r,this.scenes[i]=s}return this},moveUp:function(t){if(this.isProcessing)return this.queueOp("moveUp",t);var e=this.getIndex(t);if(ei),0,r)}return this},moveBelow:function(t,e){if(t===e)return this;if(this.isProcessing)return this.queueOp("moveBelow",t,e);var i=this.getIndex(t),s=this.getIndex(e);if(-1!==i&&-1!==s&&s>i){var r=this.getAt(s);this.scenes.splice(s,1),0===i?this.scenes.unshift(r):this.scenes.splice(i-(s=this._duration&&this.transitionComplete()},transitionComplete:function(){var t=this._target.sys,e=this._target.sys.settings;t.events.emit(n.TRANSITION_COMPLETE,this.scene),e.isTransition=!1,e.transitionFrom=null,this._duration=0,this._target=null,this._onUpdate=null,this._onUpdateScope=null,this._willRemove?this.manager.remove(this.key):this._willSleep?this.systems.sleep():this.manager.stop(this.key)},add:function(t,e,i,s){return this.manager.add(t,e,i,s)},launch:function(t,e){return t&&t!==this.key&&this.manager.queueOp("start",t,e),this},run:function(t,e){return t&&t!==this.key&&this.manager.queueOp("run",t,e),this},pause:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("pause",t,e),this},resume:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("resume",t,e),this},sleep:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("sleep",t,e),this},wake:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("wake",t,e),this},switch:function(t,e){return t!==this.key&&this.manager.queueOp("switch",this.key,t,e),this},stop:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("stop",t,e),this},setActive:function(t,e,i){void 0===e&&(e=this.key);var s=this.manager.getScene(e);return s&&s.sys.setActive(t,i),this},setVisible:function(t,e){void 0===e&&(e=this.key);var i=this.manager.getScene(e);return i&&i.sys.setVisible(t),this},isSleeping:function(t){return void 0===t&&(t=this.key),this.manager.isSleeping(t)},isActive:function(t){return void 0===t&&(t=this.key),this.manager.isActive(t)},isPaused:function(t){return void 0===t&&(t=this.key),this.manager.isPaused(t)},isVisible:function(t){return void 0===t&&(t=this.key),this.manager.isVisible(t)},swapPosition:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.swapPosition(t,e),this},moveAbove:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveAbove(t,e),this},moveBelow:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveBelow(t,e),this},remove:function(t){return void 0===t&&(t=this.key),this.manager.remove(t),this},moveUp:function(t){return void 0===t&&(t=this.key),this.manager.moveUp(t),this},moveDown:function(t){return void 0===t&&(t=this.key),this.manager.moveDown(t),this},bringToTop:function(t){return void 0===t&&(t=this.key),this.manager.bringToTop(t),this},sendToBack:function(t){return void 0===t&&(t=this.key),this.manager.sendToBack(t),this},get:function(t){return this.manager.getScene(t)},getStatus:function(t){var e=this.manager.getScene(t);if(e)return e.sys.getStatus()},getIndex:function(t){return void 0===t&&(t=this.key),this.manager.getIndex(t)},shutdown:function(){var t=this.systems.events;t.off(n.SHUTDOWN,this.shutdown,this),t.off(n.TRANSITION_OUT)},destroy:function(){this.shutdown(),this.scene.sys.events.off(n.START,this.start,this),this.scene=null,this.systems=null,this.settings=null,this.manager=null}});o.register("ScenePlugin",h,"scenePlugin"),t.exports=h},55681(t,e,i){var s=i(89993),r=i(35154),n=i(46975),a=i(87033),o={create:function(t){return"string"==typeof t?t={key:t}:void 0===t&&(t={}),{status:s.PENDING,key:r(t,"key",""),active:r(t,"active",!1),visible:r(t,"visible",!0),isBooted:!1,isTransition:!1,transitionFrom:null,transitionDuration:0,transitionAllowInput:!0,data:{},pack:r(t,"pack",!1),cameras:r(t,"cameras",null),map:r(t,"map",n(a,r(t,"mapAdd",{}))),physics:r(t,"physics",{}),loader:r(t,"loader",{}),plugins:r(t,"plugins",!1),input:r(t,"input",{})}}};t.exports=o},2368(t,e,i){var s=i(83419),r=i(89993),n=i(42363),a=i(44594),o=i(27397),h=i(52106),l=i(29747),u=i(55681),d=new s({initialize:function(t,e){this.scene=t,this.game,this.renderer,this.config=e,this.settings=u.create(e),this.canvas,this.context,this.anims,this.cache,this.plugins,this.registry,this.scale,this.sound,this.textures,this.add,this.cameras,this.displayList,this.events,this.make,this.scenePlugin,this.updateList,this.sceneUpdate=l},init:function(t){this.settings.status=r.INIT,this.sceneUpdate=l,this.game=t,this.renderer=t.renderer,this.canvas=t.canvas,this.context=t.context;var e=t.plugins;this.plugins=e,e.addToScene(this,n.Global,[n.CoreScene,h(this),o(this)]),this.events.emit(a.BOOT,this),this.settings.isBooted=!0},step:function(t,e){var i=this.events;i.emit(a.PRE_UPDATE,t,e),i.emit(a.UPDATE,t,e),this.sceneUpdate.call(this.scene,t,e),i.emit(a.POST_UPDATE,t,e)},render:function(t){var e=this.displayList;e.depthSort(),this.events.emit(a.PRE_RENDER,t),this.cameras.render(t,e),this.events.emit(a.RENDER,t)},queueDepthSort:function(){this.displayList.queueDepthSort()},depthSort:function(){this.displayList.depthSort()},pause:function(t){var e=this.settings,i=this.getStatus();return i!==r.CREATING&&i!==r.RUNNING?console.warn("Cannot pause non-running Scene",e.key):this.settings.active&&(e.status=r.PAUSED,e.active=!1,this.events.emit(a.PAUSE,this,t)),this},resume:function(t){var e=this.events,i=this.settings;return this.settings.active||(i.status=r.RUNNING,i.active=!0,e.emit(a.RESUME,this,t)),this},sleep:function(t){var e=this.settings,i=this.getStatus();return i!==r.CREATING&&i!==r.RUNNING?console.warn("Cannot sleep non-running Scene",e.key):(e.status=r.SLEEPING,e.active=!1,e.visible=!1,this.events.emit(a.SLEEP,this,t)),this},wake:function(t){var e=this.events,i=this.settings;return i.status=r.RUNNING,i.active=!0,i.visible=!0,e.emit(a.WAKE,this,t),i.isTransition&&e.emit(a.TRANSITION_WAKE,i.transitionFrom,i.transitionDuration),this},getData:function(){return this.settings.data},getStatus:function(){return this.settings.status},canInput:function(){var t=this.settings.status;return t>r.PENDING&&t<=r.RUNNING},isSleeping:function(){return this.settings.status===r.SLEEPING},isActive:function(){return this.settings.status===r.RUNNING},isPaused:function(){return this.settings.status===r.PAUSED},isTransitioning:function(){return this.settings.isTransition||null!==this.scenePlugin._target},isTransitionOut:function(){return null!==this.scenePlugin._target&&this.scenePlugin._duration>0},isTransitionIn:function(){return this.settings.isTransition},isVisible:function(){return this.settings.visible},setVisible:function(t){return this.settings.visible=t,this},setActive:function(t,e){return t?this.resume(e):this.pause(e)},start:function(t){var e=this.events,i=this.settings;t&&(i.data=t),i.status=r.START,i.active=!0,i.visible=!0,e.emit(a.START,this),e.emit(a.READY,this,t)},shutdown:function(t){var e=this.events,i=this.settings;e.off(a.TRANSITION_INIT),e.off(a.TRANSITION_START),e.off(a.TRANSITION_COMPLETE),e.off(a.TRANSITION_OUT),i.status=r.SHUTDOWN,i.active=!1,i.visible=!1,e.emit(a.SHUTDOWN,this,t)},destroy:function(){var t=this.events,e=this.settings;e.status=r.DESTROYED,e.active=!1,e.visible=!1,t.emit(a.DESTROY,this),t.removeAllListeners();for(var i=["scene","game","anims","cache","plugins","registry","sound","textures","add","cameras","displayList","events","make","scenePlugin","updateList"],s=0;s=0;i--){var s=this.sounds[i];s.key===t&&(s.destroy(),this.sounds.splice(i,1),e++)}return e},pauseAll:function(){this.forEachActiveSound(function(t){t.pause()}),this.emit(a.PAUSE_ALL,this)},resumeAll:function(){this.forEachActiveSound(function(t){t.resume()}),this.emit(a.RESUME_ALL,this)},setListenerPosition:u,stopAll:function(){this.forEachActiveSound(function(t){t.stop()}),this.emit(a.STOP_ALL,this)},stopByKey:function(t){var e=0;return this.getAll(t).forEach(function(t){t.stop()&&e++}),e},isPlaying:function(t){var e,i=this.sounds.length-1;if(void 0===t){for(;i>=0;i--)if((e=this.sounds[i]).isPlaying)return!0}else for(;i>=0;i--)if((e=this.sounds[i]).key===t&&e.isPlaying)return!0;return!1},unlock:u,onBlur:u,onFocus:u,onGameBlur:function(){this.gameLostFocus=!0,this.pauseOnBlur&&this.onBlur()},onGameFocus:function(){this.gameLostFocus=!1,this.pauseOnBlur&&this.onFocus()},update:function(t,e){this.unlocked&&(this.unlocked=!1,this.locked=!1,this.emit(a.UNLOCKED,this));for(var i=this.sounds.length-1;i>=0;i--)this.sounds[i].pendingRemove&&this.sounds.splice(i,1);this.sounds.forEach(function(i){i.update(t,e)})},destroy:function(){this.game.events.off(o.BLUR,this.onGameBlur,this),this.game.events.off(o.FOCUS,this.onGameFocus,this),this.game.events.off(o.PRE_STEP,this.update,this),this.removeAllListeners(),this.removeAll(),this.sounds.length=0,this.sounds=null,this.listenerPosition=null,this.game=null},forEachActiveSound:function(t,e){var i=this;this.sounds.forEach(function(s,r){s&&!s.pendingRemove&&t.call(e||i,s,r,i.sounds)})},setRate:function(t){return this.rate=t,this},rate:{get:function(){return this._rate},set:function(t){this._rate=t,this.forEachActiveSound(function(t){t.calculateRate()}),this.emit(a.GLOBAL_RATE,this,t)}},setDetune:function(t){return this.detune=t,this},detune:{get:function(){return this._detune},set:function(t){this._detune=t,this.forEachActiveSound(function(t){t.calculateRate()}),this.emit(a.GLOBAL_DETUNE,this,t)}}});t.exports=c},14747(t,e,i){var s=i(33684),r=i(25960),n=i(57490),a={create:function(t){var e=t.config.audio,i=t.device.audio;return e.noAudio||!i.webAudio&&!i.audioData?new r(t):i.webAudio&&!e.disableWebAudio?new n(t):new s(t)}};t.exports=a},19723(t){t.exports="complete"},98882(t){t.exports="decodedall"},57506(t){t.exports="decoded"},73146(t){t.exports="destroy"},11305(t){t.exports="detune"},40577(t){t.exports="detune"},30333(t){t.exports="mute"},20394(t){t.exports="rate"},21802(t){t.exports="volume"},1299(t){t.exports="looped"},99190(t){t.exports="loop"},97125(t){t.exports="mute"},89259(t){t.exports="pan"},79986(t){t.exports="pauseall"},17586(t){t.exports="pause"},19618(t){t.exports="play"},42306(t){t.exports="rate"},10387(t){t.exports="resumeall"},48959(t){t.exports="resume"},9960(t){t.exports="seek"},19180(t){t.exports="stopall"},98328(t){t.exports="stop"},50401(t){t.exports="unlocked"},52498(t){t.exports="volume"},14463(t,e,i){t.exports={COMPLETE:i(19723),DECODED:i(57506),DECODED_ALL:i(98882),DESTROY:i(73146),DETUNE:i(11305),GLOBAL_DETUNE:i(40577),GLOBAL_MUTE:i(30333),GLOBAL_RATE:i(20394),GLOBAL_VOLUME:i(21802),LOOP:i(99190),LOOPED:i(1299),MUTE:i(97125),PAN:i(89259),PAUSE_ALL:i(79986),PAUSE:i(17586),PLAY:i(19618),RATE:i(42306),RESUME_ALL:i(10387),RESUME:i(48959),SEEK:i(9960),STOP_ALL:i(19180),STOP:i(98328),UNLOCKED:i(50401),VOLUME:i(52498)}},64895(t,e,i){var s=i(30341),r=i(83419),n=i(14463),a=i(45319),o=new r({Extends:s,initialize:function(t,e,i){if(void 0===i&&(i={}),this.tags=t.game.cache.audio.get(e),!this.tags)throw new Error('No cached audio asset with key "'+e);this.audio=null,this.startTime=0,this.previousTime=0,this.duration=this.tags[0].duration,this.totalDuration=this.tags[0].duration,s.call(this,t,e,i)},play:function(t,e){return!this.manager.isLocked(this,"play",[t,e])&&(!!s.prototype.play.call(this,t,e)&&(!!this.pickAndPlayAudioTag()&&(this.emit(n.PLAY,this),!0)))},pause:function(){return!this.manager.isLocked(this,"pause")&&(!(this.startTime>0)&&(!!s.prototype.pause.call(this)&&(this.currentConfig.seek=this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0),this.stopAndReleaseAudioTag(),this.emit(n.PAUSE,this),!0)))},resume:function(){return!this.manager.isLocked(this,"resume")&&(!(this.startTime>0)&&(!!s.prototype.resume.call(this)&&(!!this.pickAndPlayAudioTag()&&(this.emit(n.RESUME,this),!0))))},stop:function(){return!this.manager.isLocked(this,"stop")&&(!!s.prototype.stop.call(this)&&(this.stopAndReleaseAudioTag(),this.emit(n.STOP,this),!0))},pickAndPlayAudioTag:function(){if(!this.pickAudioTag())return this.reset(),!1;var t=this.currentConfig.seek,e=this.currentConfig.delay,i=(this.currentMarker?this.currentMarker.start:0)+t;return this.previousTime=i,this.audio.currentTime=i,this.applyConfig(),0===e?(this.startTime=0,this.audio.paused&&this.playCatchPromise()):(this.startTime=window.performance.now()+1e3*e,this.audio.paused||this.audio.pause()),this.resetConfig(),!0},pickAudioTag:function(){if(this.audio)return!0;for(var t=0;t0)this.startTime=i-this.manager.loopEndOffset?(this.audio.currentTime=e+Math.max(0,s-i),s=this.audio.currentTime):s=i)return this.reset(),this.stopAndReleaseAudioTag(),void this.emit(n.COMPLETE,this);this.previousTime=s}},destroy:function(){s.prototype.destroy.call(this),this.tags=null,this.audio&&this.stopAndReleaseAudioTag()},updateMute:function(){this.audio&&(this.audio.muted=this.currentConfig.mute||this.manager.mute)},updateVolume:function(){this.audio&&(this.audio.volume=a(this.currentConfig.volume*this.manager.volume,0,1))},calculateRate:function(){s.prototype.calculateRate.call(this),this.audio&&(this.audio.playbackRate=this.totalRate)},mute:{get:function(){return this.currentConfig.mute},set:function(t){this.currentConfig.mute=t,this.manager.isLocked(this,"mute",t)||(this.updateMute(),this.emit(n.MUTE,this,t))}},setMute:function(t){return this.mute=t,this},volume:{get:function(){return this.currentConfig.volume},set:function(t){this.currentConfig.volume=t,this.manager.isLocked(this,"volume",t)||(this.updateVolume(),this.emit(n.VOLUME,this,t))}},setVolume:function(t){return this.volume=t,this},rate:{get:function(){return this.currentConfig.rate},set:function(t){this.currentConfig.rate=t,this.manager.isLocked(this,n.RATE,t)||(this.calculateRate(),this.emit(n.RATE,this,t))}},setRate:function(t){return this.rate=t,this},detune:{get:function(){return this.currentConfig.detune},set:function(t){this.currentConfig.detune=t,this.manager.isLocked(this,n.DETUNE,t)||(this.calculateRate(),this.emit(n.DETUNE,this,t))}},setDetune:function(t){return this.detune=t,this},seek:{get:function(){return this.isPlaying?this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0):this.isPaused?this.currentConfig.seek:0},set:function(t){this.manager.isLocked(this,"seek",t)||this.startTime>0||(this.isPlaying||this.isPaused)&&(t=Math.min(Math.max(0,t),this.duration),this.isPlaying?(this.previousTime=t,this.audio.currentTime=t):this.isPaused&&(this.currentConfig.seek=t),this.emit(n.SEEK,this,t))}},setSeek:function(t){return this.seek=t,this},loop:{get:function(){return this.currentConfig.loop},set:function(t){this.currentConfig.loop=t,this.manager.isLocked(this,"loop",t)||(this.audio&&(this.audio.loop=t),this.emit(n.LOOP,this,t))}},setLoop:function(t){return this.loop=t,this},pan:{get:function(){return this.currentConfig.pan},set:function(t){this.currentConfig.pan=t,this.emit(n.PAN,this,t)}},setPan:function(t){return this.pan=t,this}});t.exports=o},33684(t,e,i){var s=i(85034),r=i(83419),n=i(14463),a=i(64895),o=new r({Extends:s,initialize:function(t){this.override=!0,this.audioPlayDelay=.1,this.loopEndOffset=.05,this.onBlurPausedSounds=[],this.locked="ontouchstart"in window,this.lockedActionsQueue=this.locked?[]:null,this._mute=!1,this._volume=1,s.call(this,t)},add:function(t,e){var i=new a(this,t,e);return this.sounds.push(i),i},unlock:function(){this.locked=!1;var t=this;if(this.game.cache.audio.entries.each(function(e,i){for(var s=0;s-1},setAll:function(t,e,i,r){return s.SetAll(this.list,t,e,i,r),this},each:function(t,e){for(var i=[null],s=2;s0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}}});t.exports=o},90330(t,e,i){t.exports=i(60269).default},25774(t,e,i){var s=i(83419),r=i(50792),n=i(82348),a=new s({Extends:r,initialize:function(){r.call(this),this._pending=[],this._active=[],this._destroy=[],this._toProcess=0,this.checkQueue=!1},isActive:function(t){return this._active.indexOf(t)>-1},isPending:function(t){return this._toProcess>0&&this._pending.indexOf(t)>-1},isDestroying:function(t){return this._destroy.indexOf(t)>-1},add:function(t){return this.checkQueue&&this.isActive(t)&&!this.isDestroying(t)||this.isPending(t)||(this._pending.push(t),this._toProcess++),t},remove:function(t){if(this.isPending(t)){var e=this._pending,i=e.indexOf(t);-1!==i&&e.splice(i,1)}else this.isActive(t)&&(this._destroy.push(t),this._toProcess++);return t},removeAll:function(){for(var t=this._active,e=this._destroy,i=t.length;i--;)e.push(t[i]),this._toProcess++;return this},update:function(){if(0===this._toProcess)return this._active;var t,e,i=this._destroy,s=this._active;for(t=0;t=t.minX&&e.maxY>=t.minY}function v(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(t,e,i,r,n){for(var a,o=[e,i];o.length;)(i=o.pop())-(e=o.pop())<=r||(a=e+Math.ceil((i-e)/r/2)*r,s(t,a,e,i,n),o.push(e,a,a,i))}r.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],s=this.toBBox;if(!m(t,e))return i;for(var r,n,a,o,h=[];e;){for(r=0,n=e.children.length;r=0&&n[e].children.length>this._maxEntries;)this._split(n,e),e--;this._adjustParentBBoxes(r,n,e)},_split:function(t,e){var i=t[e],s=i.children.length,r=this._minEntries;this._chooseSplitAxis(i,r,s);var n=this._chooseSplitIndex(i,r,s),o=v(i.children.splice(n,i.children.length-n));o.height=i.height,o.leaf=i.leaf,a(i,this.toBBox),a(o,this.toBBox),e?t[e-1].children.push(o):this._splitRoot(i,o)},_splitRoot:function(t,e){this.data=v([t,e]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var s,r,n,a,h,l,u,c;for(l=u=1/0,s=e;s<=i-e;s++)a=p(r=o(t,0,s,this.toBBox),n=o(t,s,i,this.toBBox)),h=d(r)+d(n),a=e;r--)n=t.children[r],h(u,t.leaf?a(n):n),d+=c(u);return d},_adjustParentBBoxes:function(t,e,i){for(var s=i;s>=0;s--)h(e[s],t)},_condense:function(t){for(var e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():a(t[i],this.toBBox)},compareMinX:function(t,e){return t.left-e.left},compareMinY:function(t,e){return t.top-e.top},toBBox:function(t){return{minX:t.left,minY:t.top,maxX:t.right,maxY:t.bottom}}},t.exports=r},86555(t,e,i){var s=i(45319),r=i(83419),n=i(56583),a=i(26099),o=new r({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===s&&(s=null),this._width=t,this._height=e,this._parent=s,this.aspectMode=i,this.aspectRatio=0===e?1:t/e,this.minWidth=0,this.minHeight=0,this.maxWidth=Number.MAX_VALUE,this.maxHeight=Number.MAX_VALUE,this.snapTo=new a},setAspectMode:function(t){return void 0===t&&(t=0),this.aspectMode=t,this.setSize(this._width,this._height)},setSnap:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.snapTo.set(t,e),this.setSize(this._width,this._height)},setParent:function(t){return this._parent=t,this.setSize(this._width,this._height)},setMin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.minWidth=s(t,0,this.maxWidth),this.minHeight=s(e,0,this.maxHeight),this.setSize(this._width,this._height)},setMax:function(t,e){return void 0===t&&(t=Number.MAX_VALUE),void 0===e&&(e=t),this.maxWidth=s(t,this.minWidth,Number.MAX_VALUE),this.maxHeight=s(e,this.minHeight,Number.MAX_VALUE),this.setSize(this._width,this._height)},setSize:function(t,e){switch(void 0===t&&(t=0),void 0===e&&(e=t),this.aspectMode){case o.NONE:this._width=this.getNewWidth(n(t,this.snapTo.x)),this._height=this.getNewHeight(n(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height;break;case o.WIDTH_CONTROLS_HEIGHT:this._width=this.getNewWidth(n(t,this.snapTo.x)),this._height=this.getNewHeight(this._width*(1/this.aspectRatio),!1);break;case o.HEIGHT_CONTROLS_WIDTH:this._height=this.getNewHeight(n(e,this.snapTo.y)),this._width=this.getNewWidth(this._height*this.aspectRatio,!1);break;case o.FIT:this.constrain(t,e,!0);break;case o.ENVELOP:this.constrain(t,e,!1)}return this},setAspectRatio:function(t){return this.aspectRatio=t,this.setSize(this._width,this._height)},resize:function(t,e){return this._width=this.getNewWidth(n(t,this.snapTo.x)),this._height=this.getNewHeight(n(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height,this},getNewWidth:function(t,e){return void 0===e&&(e=!0),t=s(t,this.minWidth,this.maxWidth),e&&this._parent&&t>this._parent.width&&(t=Math.max(this.minWidth,this._parent.width)),t},getNewHeight:function(t,e){return void 0===e&&(e=!0),t=s(t,this.minHeight,this.maxHeight),e&&this._parent&&t>this._parent.height&&(t=Math.max(this.minHeight,this._parent.height)),t},constrain:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=!0),t=this.getNewWidth(t),e=this.getNewHeight(e);var s=this.snapTo,r=0===e?1:t/e;return i&&this.aspectRatio>r||!i&&this.aspectRatio0&&(t=(e=n(e,s.y))*this.aspectRatio)):(i&&this.aspectRatior)&&(t=(e=n(e,s.y))*this.aspectRatio,s.x>0&&(e=(t=n(t,s.x))*(1/this.aspectRatio))),this._width=t,this._height=e,this},fitTo:function(t,e){return this.constrain(t,e,!0)},envelop:function(t,e){return this.constrain(t,e,!1)},setWidth:function(t){return this.setSize(t,this._height)},setHeight:function(t){return this.setSize(this._width,t)},toString:function(){return"[{ Size (width="+this._width+" height="+this._height+" aspectRatio="+this.aspectRatio+" aspectMode="+this.aspectMode+") }]"},setCSS:function(t){t&&t.style&&(t.style.width=this._width+"px",t.style.height=this._height+"px")},copy:function(t){return t.setAspectMode(this.aspectMode),t.aspectRatio=this.aspectRatio,t.setSize(this.width,this.height)},destroy:function(){this._parent=null,this.snapTo=null},width:{get:function(){return this._width},set:function(t){this.setSize(t,this._height)}},height:{get:function(){return this._height},set:function(t){this.setSize(this._width,t)}}});o.NONE=0,o.WIDTH_CONTROLS_HEIGHT=1,o.HEIGHT_CONTROLS_WIDTH=2,o.FIT=3,o.ENVELOP=4,t.exports=o},15238(t){t.exports="add"},56187(t){t.exports="remove"},82348(t,e,i){t.exports={PROCESS_QUEUE_ADD:i(15238),PROCESS_QUEUE_REMOVE:i(56187)}},41392(t,e,i){t.exports={Events:i(82348),List:i(73162),Map:i(90330),ProcessQueue:i(25774),RTree:i(59542),Size:i(86555)}},57382(t,e,i){var s=i(83419),r=i(45319),n=i(40987),a=i(8054),o=i(50030),h=i(79237),l=new s({Extends:h,initialize:function(t,e,i,s,r){h.call(this,t,e,i,s,r),this.add("__BASE",0,0,0,s,r),this._source=this.frames.__BASE.source,this.canvas=this._source.image,this.context=this.canvas.getContext("2d",{willReadFrequently:!0}),this.width=s,this.height=r,this.imageData=this.context.getImageData(0,0,s,r),this.data=null,this.imageData&&(this.data=this.imageData.data),this.pixels=null,this.buffer,this.data&&(this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data)},update:function(){return this.imageData=this.context.getImageData(0,0,this.width,this.height),this.data=this.imageData.data,this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data,this.manager.game.config.renderType===a.WEBGL&&this.refresh(),this},draw:function(t,e,i,s){return void 0===s&&(s=!0),this.context.drawImage(i,t,e),s&&this.update(),this},drawFrame:function(t,e,i,s,r){void 0===i&&(i=0),void 0===s&&(s=0),void 0===r&&(r=!0);var n=this.manager.getFrame(t,e);if(n){var a=n.canvasData,o=n.cutWidth,h=n.cutHeight,l=n.source.resolution;this.context.drawImage(n.source.image,a.x,a.y,o,h,i,s,o/l,h/l),r&&this.update()}return this},setPixel:function(t,e,i,s,r,n){if(void 0===n&&(n=255),t=Math.abs(Math.floor(t)),e=Math.abs(Math.floor(e)),this.getIndex(t,e)>-1){var a=this.context.getImageData(t,e,1,1);a.data[0]=i,a.data[1]=s,a.data[2]=r,a.data[3]=n,this.context.putImageData(a,t,e)}return this},putData:function(t,e,i,s,r,n,a){return void 0===s&&(s=0),void 0===r&&(r=0),void 0===n&&(n=t.width),void 0===a&&(a=t.height),this.context.putImageData(t,e,i,s,r,n,a),this},getData:function(t,e,i,s){return t=r(Math.floor(t),0,this.width-1),e=r(Math.floor(e),0,this.height-1),i=r(i,1,this.width-t),s=r(s,1,this.height-e),this.context.getImageData(t,e,i,s)},getPixel:function(t,e,i){i||(i=new n);var s=this.getIndex(t,e);if(s>-1){var r=this.data,a=r[s+0],o=r[s+1],h=r[s+2],l=r[s+3];i.setTo(a,o,h,l)}return i},getPixels:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===s&&(s=i),t=Math.abs(Math.round(t)),e=Math.abs(Math.round(e));for(var a=r(t,0,this.width),o=r(t+i,0,this.width),h=r(e,0,this.height),l=r(e+s,0,this.height),u=new n,d=[],c=h;ca.width&&(t=a.width-s.cutX),s.cutY+e>a.height&&(e=a.height-s.cutY),s.setSize(t,e,s.cutX,s.cutY)}return this},render:function(){if(0!==this.commandBuffer.length)return this.camera.preRender(),this.renderer.type===o.WEBGL&&this._renderWebGL(),this.renderer.type===o.CANVAS&&this._renderCanvas(),this},_renderWebGL:function(){this.renderer.renderNodes.getNode("DynamicTextureHandler").run(this)},_renderCanvas:function(){var t,e,i,r,n,a,o,h,l,u,d,c,p,g,m,v=this.camera,y=this.context,x=this.renderer,T=this.manager;x.setContext(y);for(var w=this.commandBuffer,b=w.length,S=!1,C=!1,E=0;E>24&255)/255;var _=A>>16&255,M=A>>8&255,R=255&A;y.save(),y.globalCompositeOperation="source-over",y.fillStyle="rgba("+_+","+M+","+R+","+t+")",y.fillRect(g,m,p,n),y.restore();break;case f.STAMP:a=w[++E],r=w[++E],g=w[++E],m=w[++E],t=w[++E],c=w[++E],l=w[++E],u=w[++E],d=w[++E],o=w[++E],h=w[++E],e=w[++E],C&&(e=s.ERASE);var P=T.resetStamp(t,c);P.setPosition(g,m).setRotation(l).setScale(u,d).setTexture(a,r).setOrigin(o,h).setBlendMode(e),P.renderCanvas(x,P,v,null);break;case f.REPEAT:a=w[++E],r=w[++E],g=w[++E],m=w[++E],t=w[++E],c=w[++E],l=w[++E],u=w[++E],d=w[++E],o=w[++E],h=w[++E],e=w[++E],p=w[++E],n=w[++E];var O=w[++E],L=w[++E],D=w[++E],F=w[++E],I=w[++E];C&&(e=s.ERASE);var N=T.resetTileSprite(t,c);N.setPosition(g,m).setRotation(l).setScale(u,d).setTexture(a,r).setSize(p,n).setOrigin(o,h).setBlendMode(e).setTilePosition(O,L).setTileRotation(D).setTileScale(F,I),N.renderCanvas(x,N,v,null);break;case f.DRAW:var B=w[++E];if(g=w[++E],m=w[++E],void 0!==g){var k=B.x;B.x=g}if(void 0!==m){var U=B.y;B.y=m}C&&(i=B.blendMode,B.blendMode=s.ERASE),B.renderCanvas(x,B,v,null),void 0!==g&&(B.x=k),void 0!==m&&(B.y=U),C&&(B.blendMode=i);break;case f.SET_ERASE:C=!!w[++E];break;case f.PRESERVE:S=w[++E];break;case f.CALLBACK:(0,w[++E])();break;case f.CAPTURE:B=w[++E];var z=w[++E],Y=this.startCapture(B,z);B.renderCanvas(x,B,z.camera||v,Y.transform),this.finishCapture(B,Y)}}S||(w.length=0),x.setContext()},fill:function(t,e,i,s,r,n){void 0===e&&(e=1),void 0===i&&(i=0),void 0===s&&(s=0),void 0===r&&(r=this.width),void 0===n&&(n=this.height);var a=t>>16&255,o=t>>8&255,h=255&t,l=c.getTintFromFloats(a/255,o/255,h/255,e);return this.commandBuffer.push(f.FILL,l,i,s,r,n),this},clear:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===s&&(s=this.height),this.commandBuffer.push(f.CLEAR,t,e,i,s),this},stamp:function(t,e,i,s,r){void 0===i&&(i=0),void 0===s&&(s=0);var n=u(r,"alpha",1),a=u(r,"tint",16777215),o=u(r,"angle",0),h=u(r,"rotation",0),l=u(r,"scale",1),d=u(r,"scaleX",l),c=u(r,"scaleY",l),p=u(r,"originX",.5),g=u(r,"originY",.5),m=u(r,"blendMode",0);return 0!==o&&(h=o*Math.PI/180),this.commandBuffer.push(f.STAMP,t,e,i,s,n,a,h,d,c,p,g,m),this},erase:function(t,e,i,s,r){var n=this.commandBuffer,a=n.length;return n[a-2]!==f.SET_ERASE||n[a-1]?n.push(f.SET_ERASE,!0):n.length-=2,this.draw(t,e,i,s,r),n.push(f.SET_ERASE,!1),this},draw:function(t,e,i,s,r){Array.isArray(t)||(t=[t]);for(var n=t.length,a=0;aT||x.y>w)){var b=Math.max(x.x,e),S=Math.max(x.y,i),C=Math.min(x.r,T)-b,E=Math.min(x.b,w)-S;m=C,v=E,p=a?h+(u-(b-x.x)-C):h+(b-x.x),g=o?l+(d-(S-x.y)-E):l+(S-x.y),e=b,i=S,s=C,n=E}else p=0,g=0,m=0,v=0}else a&&(p=h+(u-e-s)),o&&(g=l+(d-i-n));var A=this.source.width,_=this.source.height;return t.u0=Math.max(0,p/A),t.v0=1-Math.max(0,g/_),t.u1=Math.min(1,(p+m)/A),t.v1=1-Math.min(1,(g+v)/_),t.x=e,t.y=i,t.cx=p,t.cy=g,t.cw=m,t.ch=v,t.width=s,t.height=n,t.flipX=a,t.flipY=o,t},updateCropUVs:function(t,e,i){return this.setCropUVs(t,t.x,t.y,t.width,t.height,e,i)},setUVs:function(t,e,i,s,r,n){var a=this.data.drawImage;return a.width=t,a.height=e,this.u0=i,this.v0=s,this.u1=r,this.v1=n,this},updateUVs:function(){var t=this.cutX,e=this.cutY,i=this.cutWidth,s=this.cutHeight,r=this.data.drawImage;r.width=i,r.height=s;var n=this.source.width,a=this.source.height;return this.u0=t/n,this.v0=1-e/a,this.u1=(t+i)/n,this.v1=1-(e+s)/a,this},updateUVsInverted:function(){var t=this.source.width,e=this.source.height;return this.u0=(this.cutX+this.cutHeight)/t,this.v0=1-this.cutY/e,this.u1=this.cutX/t,this.v1=1-(this.cutY+this.cutWidth)/e,this},clone:function(){var t=new a(this.texture,this.name,this.sourceIndex);return t.cutX=this.cutX,t.cutY=this.cutY,t.cutWidth=this.cutWidth,t.cutHeight=this.cutHeight,t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t.halfWidth=this.halfWidth,t.halfHeight=this.halfHeight,t.centerX=this.centerX,t.centerY=this.centerY,t.rotated=this.rotated,t.data=n(!0,t.data,this.data),t.updateUVs(),t},destroy:function(){this.texture=null,this.source=null,this.customData=null,this.data=null},glTexture:{get:function(){return this.source.glTexture}},realWidth:{get:function(){return this.data.sourceSize.w}},realHeight:{get:function(){return this.data.sourceSize.h}},radius:{get:function(){return this.data.radius}},trimmed:{get:function(){return this.data.trim}},scale9:{get:function(){return this.data.scale9}},is3Slice:{get:function(){return this.data.is3Slice}},canvasData:{get:function(){return this.data.drawImage}}});t.exports=a},79237(t,e,i){var s=i(83419),r=i(4327),n=i(11876),a='Texture "%s" has no frame "%s"',o=new s({initialize:function(t,e,i,s,r){Array.isArray(i)||(i=[i]),this.manager=t,this.key=e,this.source=[],this.dataSource=[],this.frames={},this.customData={},this.firstFrame="__BASE",this.frameTotal=0,this.smoothPixelArt=null;for(var a=0;an&&(n=h.cutX+h.cutWidth),h.cutY+h.cutHeight>a&&(a=h.cutY+h.cutHeight)}return{x:s,y:r,width:n-s,height:a-r}},getFrameNames:function(t){void 0===t&&(t=!1);var e=Object.keys(this.frames);if(!t){var i=e.indexOf("__BASE");-1!==i&&e.splice(i,1)}return e},getSourceImage:function(t){null!=t&&1!==this.frameTotal||(t="__BASE");var e=this.frames[t];return e?e.source.image:(console.warn(a,this.key,t),this.frames.__BASE.source.image)},getDataSourceImage:function(t){null!=t&&1!==this.frameTotal||(t="__BASE");var e,i=this.frames[t];return i?e=i.sourceIndex:(console.warn(a,this.key,t),e=this.frames.__BASE.sourceIndex),this.dataSource[e].image},setSource:function(t,e,i,s,r){void 0===e&&(e=0),void 0===i&&(i=!1),Array.isArray(t)||(t=[t]);for(var a=0;a0&&o.height>0&&l.drawImage(a.source.image,o.x,o.y,o.width,o.height,0,0,o.width,o.height),n=h.toDataURL(i,r),s.remove(h)}return n},addImage:function(t,e,i){var s=null;return this.checkKey(t)&&(s=this.create(t,e),v.Image(s,0),i&&s.setDataSource(i),this.emit(u.ADD,t,s),this.emit(u.ADD_KEY+t,s)),s},addGLTexture:function(t,e){var i=null;if(this.checkKey(t)){var s=e.width,r=e.height;(i=this.create(t,e,s,r)).add("__BASE",0,0,0,s,r),this.emit(u.ADD,t,i),this.emit(u.ADD_KEY+t,i)}return i},addCompressedTexture:function(t,e,i){var s=null;if(this.checkKey(t)){if((s=this.create(t,e)).add("__BASE",0,0,0,e.width,e.height),i){var r=function(t,e,i){Array.isArray(i.textures)||Array.isArray(i.frames)?v.JSONArray(t,e,i):v.JSONHash(t,e,i)};if(Array.isArray(i))for(var n=0;n=h.x&&t=h.y&&e=o.x&&t=o.y&&e>1),g=Math.max(1,g>>1),f+=m}return{mipmaps:c,width:h,height:l,internalFormat:o,compressed:!0,generateMipmap:!1}}console.warn("KTXParser - Only compressed formats supported")}},41942(t){t.exports=function(t,e){if(e&&e.frames&&e.pages){var i=t.source[0];t.add("__BASE",0,0,0,i.width,i.height);var s=e.frames;for(var r in s)if(s.hasOwnProperty(r)){var n=s[r],a=0|n.page;if(a>=t.source.length)console.warn('PCT atlas frame "'+r+'" references missing page '+a);else{var o=t.add(n.key||r,a,n.x,n.y,n.w,n.h);o?(n.trimmed&&o.setTrim(n.sourceW,n.sourceH,n.trimX,n.trimY,n.w,n.h),n.rotated&&(o.rotated=!0,o.updateUVsInverted())):console.warn("Invalid PCT atlas, frame already exists: "+r)}}return t.customData.pct={pages:e.pages,folders:e.folders},t}console.warn("Invalid PCT atlas data given")}},39620(t){var e={1:".png",2:".webp",3:".jpg",4:".jpeg",5:".gif"},i=function(t,e){for(var i=String(t);i.length0&&function(t){if(0===t.length)return!1;for(var e=0;e57)return!1}return!0}(r.substring(0,a))&&(n=i[parseInt(r.substring(0,a),10)],r=r.substring(a+1));var o=/~([1-5])$/.exec(r);if(o){var h=e[parseInt(o[1],10)];r=r.substring(0,r.length-2)+h}else s&&(r+=s);return n?n+"/"+r:r},r=function(t,r){var n="",a=/~([1-5])$/.exec(t);a&&(n=e[parseInt(a[1],10)],t=t.substring(0,t.length-2));for(var o=[],h=t.split(","),l=0;l=0)for(var c=u.substring(0,d),f=u.substring(d+1),p=f.indexOf("-"),g=f.substring(0,p),m=f.substring(p+1),v=parseInt(g,10),y=parseInt(m,10),x=g.length>1&&"0"===g.charAt(0)?g.length:0,T=v;T<=y;T++){var w=x>0?i(T,x):String(T);o.push(s(c+w,r,n))}else o.push(s(u,r,n))}return o};t.exports=function(t){if("string"!=typeof t||0===t.length)return console.warn("Invalid PCT file: empty or not a string"),null;var e=t.split("\n"),i=e[0];if(13===i.charCodeAt(i.length-1)&&(i=i.substring(0,i.length-1)),!i||0!==i.indexOf("PCT:"))return console.warn("Not a PCT file: missing PCT: header"),null;var n=i.substring(4),a=n.split("."),o=parseInt(a[0],10);if(isNaN(o)||o>1)return console.warn("Unsupported PCT version: "+n),null;for(var h=[],l=[],u={},d=0,c=null,f=1;f1};if(x.trimmed){var T=v[1].split(",");x.sourceW=parseInt(T[0],10),x.sourceH=parseInt(T[1],10),x.trimX=parseInt(T[2],10),x.trimY=parseInt(T[3],10)}c=x}else if("A:"===g){var w=p.indexOf("=",2);if(-1===w)continue;var b=s(p.substring(2,w),l,""),S=r(p.substring(w+1),l),C=u[b];if(C)for(var E=0;E>1),g=Math.max(1,g>>1),f+=v}return{mipmaps:c,width:h,height:l,internalFormat:r,compressed:!0,generateMipmap:!1}}},75549(t,e,i){var s=i(95540);t.exports=function(t,e,i,r,n,a,o){var h=s(o,"frameWidth",null),l=s(o,"frameHeight",h);if(null===h)throw new Error("TextureManager.SpriteSheet: Invalid frameWidth given.");var u=t.source[e];t.add("__BASE",e,0,0,u.width,u.height);var d=s(o,"startFrame",0),c=s(o,"endFrame",-1),f=s(o,"margin",0),p=s(o,"spacing",0),g=Math.floor((n-f+p)/(h+p))*Math.floor((a-f+p)/(l+p));0===g&&console.warn("SpriteSheet frame dimensions will result in zero frames for texture:",t.key),(d>g||d<-g)&&(d=0),d<0&&(d=g+d),(-1===c||c>g||cn&&(y=b-n),S>a&&(x=S-a),w>=d&&w<=c&&(t.add(T,e,i+m,r+v,h-y,l-x),T++),(m+=h+p)+h>n&&(m=f,v+=l+p)}return t}},47534(t,e,i){var s=i(95540);t.exports=function(t,e,i){var r=s(i,"frameWidth",null),n=s(i,"frameHeight",r);if(!r)throw new Error("TextureManager.SpriteSheetFromAtlas: Invalid frameWidth given.");var a=t.source[0];t.add("__BASE",0,0,0,a.width,a.height);var o,h=s(i,"startFrame",0),l=s(i,"endFrame",-1),u=s(i,"margin",0),d=s(i,"spacing",0),c=e.cutX,f=e.cutY,p=e.cutWidth,g=e.cutHeight,m=e.realWidth,v=e.realHeight,y=Math.floor((m-u+d)/(r+d)),x=Math.floor((v-u+d)/(n+d)),T=y*x,w=e.x,b=r-w,S=r-(m-p-w),C=e.y,E=n-C,A=n-(v-g-C);(h>T||h<-T)&&(h=0),h<0&&(h=T+h),-1!==l&&(T=h+(l+1));for(var _=u,M=u,R=0,P=0;P=this.firstgid&&tthis.right||e>this.bottom)},copy:function(t){return this.index=t.index,this.alpha=t.alpha,this.properties=a(t.properties),this.visible=t.visible,this.setFlip(t.flipX,t.flipY),this.tint=t.tint,this.rotation=t.rotation,this.collideUp=t.collideUp,this.collideDown=t.collideDown,this.collideLeft=t.collideLeft,this.collideRight=t.collideRight,this.collisionCallback=t.collisionCallback,this.collisionCallbackContext=t.collisionCallbackContext,this},getCollisionGroup:function(){return this.tileset?this.tileset.getTileCollisionGroup(this.index):null},getTileData:function(){return this.tileset?this.tileset.getTileData(this.index):null},getLeft:function(t){var e=this.tilemapLayer;return e?e.tileToWorldXY(this.x,this.y,void 0,t).x:this.x*this.baseWidth},getRight:function(t){var e=this.tilemapLayer;return e?this.getLeft(t)+this.width*e.scaleX:this.getLeft(t)+this.width},getTop:function(t){var e=this.tilemapLayer;return e?e.tileToWorldXY(this.x,this.y,void 0,t).y:this.y*this.baseWidth-(this.height-this.baseHeight)},getBottom:function(t){var e=this.tilemapLayer;return e?this.getTop(t)+this.height*e.scaleY:this.getTop(t)+this.height},getBounds:function(t,e){return void 0===e&&(e=new o),e.x=this.getLeft(t),e.y=this.getTop(t),e.width=this.getRight(t)-e.x,e.height=this.getBottom(t)-e.y,e},getCenterX:function(t){return(this.getLeft(t)+this.getRight(t))/2},getCenterY:function(t){return(this.getTop(t)+this.getBottom(t))/2},intersects:function(t,e,i,s){return!(i<=this.pixelX||s<=this.pixelY||t>=this.right||e>=this.bottom)},isInteresting:function(t,e){return t&&e?this.canCollide||this.hasInterestingFace:t?this.collides:!!e&&this.hasInterestingFace},resetCollision:function(t){(void 0===t&&(t=!0),this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,t)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},resetFaces:function(){return this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this},setCollision:function(t,e,i,s,r){(void 0===e&&(e=t),void 0===i&&(i=t),void 0===s&&(s=t),void 0===r&&(r=!0),this.collideLeft=t,this.collideRight=e,this.collideUp=i,this.collideDown=s,this.faceLeft=t,this.faceRight=e,this.faceTop=i,this.faceBottom=s,r)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},setCollisionCallback:function(t,e){return null===t?(this.collisionCallback=void 0,this.collisionCallbackContext=void 0):(this.collisionCallback=t,this.collisionCallbackContext=e),this},setSize:function(t,e,i,s){return void 0!==t&&(this.width=t),void 0!==e&&(this.height=e),void 0!==i&&(this.baseWidth=i),void 0!==s&&(this.baseHeight=s),this.updatePixelXY(),this},updatePixelXY:function(){var t=this.layer.orientation;if(t===n.ORTHOGONAL)this.pixelX=this.x*this.baseWidth,this.pixelY=this.y*this.baseHeight;else if(t===n.ISOMETRIC)this.pixelX=(this.x-this.y)*this.baseWidth*.5,this.pixelY=(this.x+this.y)*this.baseHeight*.5;else if(t===n.STAGGERED)this.pixelX=this.x*this.baseWidth+this.y%2*(this.baseWidth/2),this.pixelY=this.y*(this.baseHeight/2);else if(t===n.HEXAGONAL){var e,i,s=this.layer.staggerAxis,r=this.layer.staggerIndex,a=this.layer.hexSideLength;"y"===s?(i=(this.baseHeight-a)/2+a,this.pixelX="odd"===r?this.x*this.baseWidth+this.y%2*(this.baseWidth/2):this.x*this.baseWidth-this.y%2*(this.baseWidth/2),this.pixelY=this.y*i):"x"===s&&(e=(this.baseWidth-a)/2+a,this.pixelX=this.x*e,this.pixelY="odd"===r?this.y*this.baseHeight+this.x%2*(this.baseHeight/2):this.y*this.baseHeight-this.x%2*(this.baseHeight/2))}return this.right=this.pixelX+this.baseWidth,this.bottom=this.pixelY+this.baseHeight,this},destroy:function(){this.collisionCallback=void 0,this.collisionCallbackContext=void 0,this.properties=void 0},canCollide:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown||void 0!==this.collisionCallback}},collides:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown}},hasInterestingFace:{get:function(){return this.faceTop||this.faceBottom||this.faceLeft||this.faceRight}},tileset:{get:function(){var t=this.layer.tilemapLayer;if(t){var e=t.gidMap[this.index];if(e)return e}return null}},tilemapLayer:{get:function(){return this.layer.tilemapLayer}},tilemap:{get:function(){var t=this.tilemapLayer;return t?t.tilemap:null}}});t.exports=l},49075(t,e,i){var s=i(84101),r=i(83419),n=i(39506),a=i(80341),o=i(95540),h=i(14977),l=i(27462),u=i(91907),d=i(36305),c=i(19133),f=i(68287),p=i(23029),g=i(81086),m=i(44731),v=i(53180),y=i(20442),x=i(33629),T=new r({initialize:function(t,e){this.scene=t,this.tileWidth=e.tileWidth,this.tileHeight=e.tileHeight,this.width=e.width,this.height=e.height,this.orientation=e.orientation,this.renderOrder=e.renderOrder,this.format=e.format,this.version=e.version,this.properties=e.properties,this.widthInPixels=e.widthInPixels,this.heightInPixels=e.heightInPixels,this.imageCollections=e.imageCollections,this.images=e.images,this.layers=e.layers,this.tiles=e.tiles,this.tilesets=e.tilesets,this.objects=e.objects,this.currentLayerIndex=0,this.hexSideLength=e.hexSideLength;var i=this.orientation;this._convert={WorldToTileXY:g.GetWorldToTileXYFunction(i),WorldToTileX:g.GetWorldToTileXFunction(i),WorldToTileY:g.GetWorldToTileYFunction(i),TileToWorldXY:g.GetTileToWorldXYFunction(i),TileToWorldX:g.GetTileToWorldXFunction(i),TileToWorldY:g.GetTileToWorldYFunction(i),GetTileCorners:g.GetTileCornersFunction(i)}},setRenderOrder:function(t){var e=["right-down","left-down","right-up","left-up"];return"number"==typeof t&&(t=e[t]),e.indexOf(t)>-1&&(this.renderOrder=t),this},addTilesetImage:function(t,e,i,r,n,o,h,l){if(void 0===t)return null;null==e&&(e=t);var u=this.scene.sys.textures;if(!u.exists(e))return console.warn('Texture key "%s" not found',e),null;var d=u.get(e),c=this.getTilesetIndex(t);if(null===c&&this.format===a.TILED_JSON)return console.warn('Tilemap has no tileset "%s". Its tilesets are %o',t,this.tilesets),null;var f=this.tilesets[c];return f?((i||r)&&f.setTileSize(i,r),(n||o)&&f.setSpacing(n,o),f.setImage(d),f):(void 0===i&&(i=this.tileWidth),void 0===r&&(r=this.tileHeight),void 0===n&&(n=0),void 0===o&&(o=0),void 0===h&&(h=0),void 0===l&&(l={x:0,y:0}),(f=new x(t,h,i,r,n,o,void 0,void 0,l)).setImage(d),this.tilesets.push(f),this.tiles=s(this),f)},copy:function(t,e,i,s,r,n,a,o){return null!==(o=this.getLayer(o))?(g.Copy(t,e,i,s,r,n,a,o),this):null},createBlankLayer:function(t,e,i,s,r,n,a,o){if(void 0===i&&(i=0),void 0===s&&(s=0),void 0===r&&(r=this.width),void 0===n&&(n=this.height),void 0===a&&(a=this.tileWidth),void 0===o&&(o=this.tileHeight),null!==this.getLayerIndex(t))return console.warn("Invalid Tilemap Layer ID: "+t),null;for(var l,u=new h({name:t,tileWidth:a,tileHeight:o,width:r,height:n,orientation:this.orientation,hexSideLength:this.hexSideLength}),d=0;d1&&console.warn("TilemapGPULayer can only use one tileset. Using the first item given."),e=e[0]),a=new v(this.scene,this,n,e,i,s)):(a=new y(this.scene,this,n,e,i,s)).setRenderOrder(this.renderOrder),this.scene.sys.displayList.add(a),a)},createFromObjects:function(t,e,i){void 0===i&&(i=!0);var s=[],r=this.getObjectLayer(t);if(!r)return console.warn("createFromObjects: Invalid objectLayerName given: "+t),s;var a=new l(i?this.tilesets:void 0);Array.isArray(e)||(e=[e]);var h=r.objects;e.sortByY&&h.sort(function(t,e){return t.y>e.y?1:-1});for(var c=0;c-1&&this.putTileAt(e,n.x,n.y,i,n.tilemapLayer)}return s},removeTileAt:function(t,e,i,s,r){return void 0===i&&(i=!0),void 0===s&&(s=!0),null===(r=this.getLayer(r))?null:g.RemoveTileAt(t,e,i,s,r)},removeTileAtWorldXY:function(t,e,i,s,r,n){return void 0===i&&(i=!0),void 0===s&&(s=!0),null===(n=this.getLayer(n))?null:g.RemoveTileAtWorldXY(t,e,i,s,r,n)},renderDebug:function(t,e,i){return null===(i=this.getLayer(i))?null:(this.orientation===u.ORTHOGONAL&&g.RenderDebug(t,e,i),this)},renderDebugFull:function(t,e){for(var i=this.layers,s=0;s=0&&t<4&&(this._renderOrder=t),this},cull:function(t){return this.cullCallback(this.layer,t,this.culledTiles,this._renderOrder)},setSkipCull:function(t){return void 0===t&&(t=!0),this.skipCull=t,this},setCullPadding:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=1),this.cullPaddingX=t,this.cullPaddingY=e,this},setTint:function(t,e,i,s,r,n){void 0===t&&(t=16777215);return this.forEachTile(function(e){e.tint=t},this,e,i,s,r,n)},setTintMode:function(t,e,i,s,r,n){void 0===t&&(t=h.MULTIPLY);return this.forEachTile(function(e){e.tintMode=t},this,e,i,s,r,n)},destroy:function(t){this.culledTiles.length=0,this.cullCallback=null,o.prototype.destroy.call(this,t)}});t.exports=l},44731(t,e,i){var s=i(83419),r=i(78389),n=i(31401),a=i(95643),o=i(81086),h=i(26099),l=new s({Extends:a,Mixins:[n.Alpha,n.BlendMode,n.ComputedSize,n.Depth,n.ElapseTimer,n.Flip,n.GetBounds,n.Lighting,n.Mask,n.Origin,n.RenderNodes,n.Transform,n.Visible,n.ScrollFactor,r],initialize:function(t,e,i,s,r,n){a.call(this,e,t),this.isTilemap=!0,this.tilemap=i,this.layerIndex=s,this.layer=i.layers[s],this.layer.tilemapLayer=this,this.gidMap=[],this.tempVec=new h,this.collisionCategory=1,this.collisionMask=1,this.setAlpha(this.layer.alpha),this.setPosition(r,n),this.setOrigin(0,0),this.setSize(i.tileWidth*this.layer.width,i.tileHeight*this.layer.height)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(t,e){this.updateTimer(t,e)},calculateFacesAt:function(t,e){return o.CalculateFacesAt(t,e,this.layer),this},calculateFacesWithin:function(t,e,i,s){return o.CalculateFacesWithin(t,e,i,s,this.layer),this},createFromTiles:function(t,e,i,s,r){return o.CreateFromTiles(t,e,i,s,r,this.layer)},copy:function(t,e,i,s,r,n,a){return o.Copy(t,e,i,s,r,n,a,this.layer),this},fill:function(t,e,i,s,r,n){return o.Fill(t,e,i,s,r,n,this.layer),this},filterTiles:function(t,e,i,s,r,n,a){return o.FilterTiles(t,e,i,s,r,n,a,this.layer)},findByIndex:function(t,e,i){return o.FindByIndex(t,e,i,this.layer)},findTile:function(t,e,i,s,r,n,a){return o.FindTile(t,e,i,s,r,n,a,this.layer)},forEachTile:function(t,e,i,s,r,n,a){return o.ForEachTile(t,e,i,s,r,n,a,this.layer),this},getTileAt:function(t,e,i){return o.GetTileAt(t,e,i,this.layer)},getTileAtWorldXY:function(t,e,i,s){return o.GetTileAtWorldXY(t,e,i,s,this.layer)},getIsoTileAtWorldXY:function(t,e,i,s,r){void 0===i&&(i=!0);var n=this.tempVec;return o.IsometricWorldToTileXY(t,e,!0,n,r,this.layer,i),this.getTileAt(n.x,n.y,s)},getTilesWithin:function(t,e,i,s,r){return o.GetTilesWithin(t,e,i,s,r,this.layer)},getTilesWithinShape:function(t,e,i){return o.GetTilesWithinShape(t,e,i,this.layer)},getTilesWithinWorldXY:function(t,e,i,s,r,n){return o.GetTilesWithinWorldXY(t,e,i,s,r,n,this.layer)},hasTileAt:function(t,e){return o.HasTileAt(t,e,this.layer)},hasTileAtWorldXY:function(t,e,i){return o.HasTileAtWorldXY(t,e,i,this.layer)},putTileAt:function(t,e,i,s){return o.PutTileAt(t,e,i,s,this.layer)},putTileAtWorldXY:function(t,e,i,s,r){return o.PutTileAtWorldXY(t,e,i,s,r,this.layer)},putTilesAt:function(t,e,i,s){return o.PutTilesAt(t,e,i,s,this.layer),this},randomize:function(t,e,i,s,r){return o.Randomize(t,e,i,s,r,this.layer),this},removeTileAt:function(t,e,i,s){return o.RemoveTileAt(t,e,i,s,this.layer)},removeTileAtWorldXY:function(t,e,i,s,r){return o.RemoveTileAtWorldXY(t,e,i,s,r,this.layer)},renderDebug:function(t,e){return o.RenderDebug(t,e,this.layer),this},replaceByIndex:function(t,e,i,s,r,n){return o.ReplaceByIndex(t,e,i,s,r,n,this.layer),this},setCollision:function(t,e,i,s){return o.SetCollision(t,e,i,this.layer,s),this},setCollisionBetween:function(t,e,i,s){return o.SetCollisionBetween(t,e,i,s,this.layer),this},setCollisionByProperty:function(t,e,i){return o.SetCollisionByProperty(t,e,i,this.layer),this},setCollisionByExclusion:function(t,e,i){return o.SetCollisionByExclusion(t,e,i,this.layer),this},setCollisionFromCollisionGroup:function(t,e){return o.SetCollisionFromCollisionGroup(t,e,this.layer),this},setTileIndexCallback:function(t,e,i){return o.SetTileIndexCallback(t,e,i,this.layer),this},setTileLocationCallback:function(t,e,i,s,r,n){return o.SetTileLocationCallback(t,e,i,s,r,n,this.layer),this},shuffle:function(t,e,i,s){return o.Shuffle(t,e,i,s,this.layer),this},swapByIndex:function(t,e,i,s,r,n){return o.SwapByIndex(t,e,i,s,r,n,this.layer),this},tileToWorldX:function(t,e){return this.tilemap.tileToWorldX(t,e,this)},tileToWorldY:function(t,e){return this.tilemap.tileToWorldY(t,e,this)},tileToWorldXY:function(t,e,i,s){return this.tilemap.tileToWorldXY(t,e,i,s,this)},getTileCorners:function(t,e,i){return this.tilemap.getTileCorners(t,e,i,this)},weightedRandomize:function(t,e,i,s,r){return o.WeightedRandomize(e,i,s,r,t,this.layer),this},worldToTileX:function(t,e,i){return this.tilemap.worldToTileX(t,e,i,this)},worldToTileY:function(t,e,i){return this.tilemap.worldToTileY(t,e,i,this)},worldToTileXY:function(t,e,i,s,r){return this.tilemap.worldToTileXY(t,e,i,s,r,this)},destroy:function(t){void 0===t&&(t=!0),this.tilemap&&(this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),t&&this.tilemap.removeLayer(this),this.tilemap=void 0,this.layer=void 0,this.gidMap=[],this.tileset=[],a.prototype.destroy.call(this))}});t.exports=l},16153(t,e,i){var s=i(61340),r=new s,n=new s,a=new s;t.exports=function(t,e,i,s){var o=e.cull(i),h=o.length,l=i.alpha*e.alpha;if(!(0===h||l<=0)){n.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var u=t.currentContext,d=e.gidMap;u.save(),r.copyWithScrollFactorFrom(i.matrixCombined,i.scrollX,i.scrollY,e.scrollFactorX,e.scrollFactorY),s&&r.multiply(s),r.multiply(n,a),a.setToContext(u),(!t.antialias||e.scaleX>1||e.scaleY>1)&&(u.imageSmoothingEnabled=!1);for(var c=0;c=this.firstgid&&t>>1]).startTime)<=e&&h+r.duration>e)return r.tileid+this.firstgid;hi.width||e.height>i.height?this.updateTileData(e.width,e.height):this.updateTileData(i.width,i.height,i.x,i.y),this},setTileSize:function(t,e){return void 0!==t&&(this.tileWidth=t),void 0!==e&&(this.tileHeight=e),this.image&&this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},setSpacing:function(t,e){return void 0!==t&&(this.tileMargin=t),void 0!==e&&(this.tileSpacing=e),this.image&&this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},updateTileData:function(t,e,i,s){void 0===i&&(i=0),void 0===s&&(s=0);var r=(e-2*this.tileMargin+this.tileSpacing)/(this.tileHeight+this.tileSpacing),n=(t-2*this.tileMargin+this.tileSpacing)/(this.tileWidth+this.tileSpacing);r%1==0&&n%1==0||console.warn("Image tile area not tile size multiple in: "+this.name),r=Math.floor(r),n=Math.floor(n),this.rows=r,this.columns=n,this.total=r*n,this.texCoordinates.length=0;for(var a=this.tileMargin+i,o=this.tileMargin+s,h=0;h8388608)throw new Error("Tileset._animationDataTexture: too many animations - total number of animations plus animation frames is max 8388608, got "+f);var p=2*f,g=Math.min(p,4096),m=Math.ceil(p/4096),v=new Uint32Array(g*m),y=0,x=s.length;for(o=0;or.worldView.x+n.scaleX*i.tileWidth*(-a-.5)&&h.xr.worldView.y+n.scaleY*i.tileHeight*(-o-1)&&h.y=0;n--)for(r=s.width-1;r>=0;r--)if((a=s.data[n][r])&&a.index===t){if(o===e)return a;o+=1}}else for(n=0;na.width&&(i=Math.max(a.width-t,0)),e+r>a.height&&(r=Math.max(a.height-e,0));for(var u=[],d=e;d-1}return!1}},24152(t,e,i){var s=i(45091),r=new(i(26099));t.exports=function(t,e,i,n){n.tilemapLayer.worldToTileXY(t,e,!0,r,i);var a=r.x,o=r.y;return s(a,o,n)}},90454(t,e,i){var s=i(63448),r=i(56583);t.exports=function(t,e){var i,n,a,o,h=t.tilemapLayer.tilemap,l=t.tilemapLayer,u=Math.floor(h.tileWidth*l.scaleX),d=Math.floor(h.tileHeight*l.scaleY),c=t.hexSideLength;if("y"===t.staggerAxis){var f=(d-c)/2+c;i=r(e.worldView.x-l.x,u,0,!0)-l.cullPaddingX,n=s(e.worldView.right-l.x,u,0,!0)+l.cullPaddingX,a=r(e.worldView.y-l.y,f,0,!0)-l.cullPaddingY,o=s(e.worldView.bottom-l.y,f,0,!0)+l.cullPaddingY}else{var p=(u-c)/2+c;i=r(e.worldView.x-l.x,p,0,!0)-l.cullPaddingX,n=s(e.worldView.right-l.x,p,0,!0)+l.cullPaddingX,a=r(e.worldView.y-l.y,d,0,!0)-l.cullPaddingY,o=s(e.worldView.bottom-l.y,d,0,!0)+l.cullPaddingY}return{left:i,right:n,top:a,bottom:o}}},9474(t,e,i){var s=i(90454),r=i(32483);t.exports=function(t,e,i,n){void 0===i&&(i=[]),void 0===n&&(n=0),i.length=0;var a=t.tilemapLayer,o=s(t,e);return a.skipCull&&1===a.scrollFactorX&&1===a.scrollFactorY&&(o.left=0,o.right=t.width,o.top=0,o.bottom=t.height),r(t,o,n,i),i}},27229(t,e,i){var s=i(19951),r=i(26099),n=new r;t.exports=function(t,e,i,a){var o=a.baseTileWidth,h=a.baseTileHeight,l=a.tilemapLayer;l&&(o*=l.scaleX,h*=l.scaleY);var u,d,c=s(t,e,n,i,a),f=[],p=.5773502691896257;"y"===a.staggerAxis?(u=p*o,d=h/2):(u=o/2,d=p*h);for(var g=0;g<6;g++){var m=2*Math.PI*(.5-g)/6;f.push(new r(c.x+u*Math.cos(m),c.y+d*Math.sin(m)))}return f}},19951(t,e,i){var s=i(26099);t.exports=function(t,e,i,r,n){i||(i=new s);var a=n.baseTileWidth,o=n.baseTileHeight,h=n.tilemapLayer,l=0,u=0;h&&(r||(r=h.scene.cameras.main),l=h.x+r.scrollX*(1-h.scrollFactorX),u=h.y+r.scrollY*(1-h.scrollFactorY),a*=h.scaleX,o*=h.scaleY);var d,c,f=a/2,p=o/2,g=n.staggerAxis,m=n.staggerIndex;return"y"===g?(d=l+a*t+a,c=u+1.5*e*p+p,e%2==0&&("odd"===m?d-=f:d+=f)):"x"===g&&"odd"===m&&(d=l+1.5*t*f+f,c=u+o*t+o,t%2==0&&("odd"===m?c-=p:c+=p)),i.set(d,c)}},86625(t,e,i){var s=i(26099);t.exports=function(t,e,i,r,n,a){r||(r=new s);var o=a.baseTileWidth,h=a.baseTileHeight,l=a.tilemapLayer;l&&(n||(n=l.scene.cameras.main),t-=l.x+n.scrollX*(1-l.scrollFactorX),e-=l.y+n.scrollY*(1-l.scrollFactorY),o*=l.scaleX,h*=l.scaleY);var u,d,c,f,p,g=.5773502691896257,m=-.3333333333333333,v=.6666666666666666,y=o/2,x=h/2;"y"===a.staggerAxis?(c=g*(u=(t-y)/(g*o))+m*(d=(e-x)/x),f=0*u+v*d):(c=m*(u=(t-y)/y)+g*(d=(e-x)/(g*h)),f=v*u+0*d),p=-c-f;var T,w=Math.round(c),b=Math.round(f),S=Math.round(p),C=Math.abs(w-c),E=Math.abs(b-f),A=Math.abs(S-p);C>E&&C>A?w=-b-S:E>A&&(b=-w-S);var _=b;return T="odd"===a.staggerIndex?_%2==0?b/2+w:b/2+w-.5:_%2==0?b/2+w:b/2+w+.5,r.set(T,_)}},62991(t){t.exports=function(t,e,i){return t>=0&&t=0&&e=0;n--)(o=l[a][n])&&-1!==o.index&&o.visible&&0!==o.alpha&&(c||s(n,a,t,e))&&i.push(o);else if(2===r)for(a=p;a>=0;a--)for(n=0;n=0;a--)for(n=f;n>=0;n--)(o=l[a][n])&&-1!==o.index&&o.visible&&0!==o.alpha&&(c||s(n,a,t,e))&&i.push(o);return h.tilesDrawn=i.length,h.tilesTotal=u*d,i}},14127(t,e,i){var s=i(26099);t.exports=function(t,e,i,r,n){i||(i=new s);var a=n.baseTileWidth,o=n.baseTileHeight,h=n.tilemapLayer,l=0,u=0;h&&(r||(r=h.scene.cameras.main),l=h.x+r.scrollX*(1-h.scrollFactorX),a*=h.scaleX,u=h.y+r.scrollY*(1-h.scrollFactorY),o*=h.scaleY);var d=l+a/2*(t-e),c=u+(t+e)*(o/2);return i.set(d,c)}},96897(t,e,i){var s=i(26099);t.exports=function(t,e,i,r,n,a,o){r||(r=new s);var h=a.baseTileWidth,l=a.baseTileHeight,u=a.tilemapLayer;u&&(n||(n=u.scene.cameras.main),e-=u.y+n.scrollY*(1-u.scrollFactorY),l*=u.scaleY,t-=u.x+n.scrollX*(1-u.scrollFactorX),h*=u.scaleX);var d=h/2,c=l/2;o||(e-=l);var f=.5*((t-=d)/d+e/c),p=.5*(-t/d+e/c);return i&&(f=Math.floor(f),p=Math.floor(p)),r.set(f,p)}},71558(t,e,i){var s=i(23029),r=i(62991),n=i(72023),a=i(20576);t.exports=function(t,e,i,o,h){if(void 0===o&&(o=!0),!r(e,i,h))return null;var l,u=h.data[i][e],d=u&&u.collides;t instanceof s?(null===h.data[i][e]&&(h.data[i][e]=new s(h,t.index,e,i,h.tileWidth,h.tileHeight)),h.data[i][e].copy(t)):(l=t,null===h.data[i][e]?h.data[i][e]=new s(h,l,e,i,h.tileWidth,h.tileHeight):h.data[i][e].index=l);var c=h.data[i][e],f=-1!==h.collideIndexes.indexOf(c.index);if(-1===(l=t instanceof s?t.index:t))c.width=h.tileWidth,c.height=h.tileHeight;else{var p=h.tilemapLayer.tilemap,g=p.tiles[l][2],m=p.tilesets[g];c.width=m.tileWidth,c.height=m.tileHeight}return a(c,f),o&&d!==c.collides&&n(e,i,h),c}},26303(t,e,i){var s=i(71558),r=new(i(26099));t.exports=function(t,e,i,n,a,o){return o.tilemapLayer.worldToTileXY(e,i,!0,r,a,o),s(t,r.x,r.y,n,o)}},14051(t,e,i){var s=i(42573),r=i(71558);t.exports=function(t,e,i,n,a){if(void 0===n&&(n=!0),!Array.isArray(t))return null;Array.isArray(t[0])||(t=[t]);for(var o=t.length,h=t[0].length,l=0;l=d;r--)(a=o[n][r])&&-1!==a.index&&a.visible&&0!==a.alpha&&s.push(a);else if(2===i)for(n=p;n>=f;n--)for(r=d;o[n]&&r=f;n--)for(r=c;o[n]&&r>=d;r--)(a=o[n][r])&&-1!==a.index&&a.visible&&0!==a.alpha&&s.push(a);return u.tilesDrawn=s.length,u.tilesTotal=h*l,s}},57068(t,e,i){var s=i(20576),r=i(42573),n=i(9589);t.exports=function(t,e,i,a,o){void 0===e&&(e=!0),void 0===i&&(i=!0),void 0===o&&(o=!0),Array.isArray(t)||(t=[t]);for(var h=0;he)){for(var l=t;l<=e;l++)n(l,i,o);if(h)for(var u=0;u=t&&c.index<=e&&s(c,i)}a&&r(0,0,o.width,o.height,o)}}},75661(t,e,i){var s=i(20576),r=i(42573),n=i(9589);t.exports=function(t,e,i,a){void 0===e&&(e=!0),void 0===i&&(i=!0),Array.isArray(t)||(t=[t]);for(var o=0;o0&&s(o,t)}}e&&r(0,0,i.width,i.height,i)}},9589(t){t.exports=function(t,e,i){var s=i.collideIndexes.indexOf(t);e&&-1===s?i.collideIndexes.push(t):e||-1===s||i.collideIndexes.splice(s,1)}},20576(t){t.exports=function(t,e){e?t.setCollision(!0,!0,!0,!0,!1):t.resetCollision(!1)}},79583(t){t.exports=function(t,e,i,s){if("number"==typeof t)s.callbacks[t]=null!==e?{callback:e,callbackContext:i}:void 0;else for(var r=0,n=t.length;r-1?new r(o,f,d,u,a.tilesize,a.tilesize):e?null:new r(o,-1,d,u,a.tilesize,a.tilesize),h.push(c)}l.push(h),h=[]}o.data=l,i.push(o)}return i}},96483(t,e,i){var s=i(33629);t.exports=function(t){for(var e=[],i=[],r=0;ro&&(o=e.layer[l].width),e.layer[l].height>h&&(h=e.layer[l].height);var u=new r({width:o,height:h,name:t,tileWidth:e.layer[0].tilesize,tileHeight:e.layer[0].tilesize,format:s.WELTMEISTER});return u.layers=n(e,i),u.tilesets=a(e),u}},52833(t,e,i){t.exports={ParseTileLayers:i(6656),ParseTilesets:i(96483),ParseWeltmeister:i(87021)}},57442(t,e,i){t.exports={FromOrientationString:i(6641),Parse:i(46177),Parse2DArray:i(2342),ParseCSV:i(82593),Impact:i(52833),Tiled:i(96761)}},51233(t,e,i){var s=i(79291);t.exports=function(t){for(var e,i,r,n,a,o=0;o>>0;return s}},84101(t,e,i){var s=i(33629);t.exports=function(t){var e,i,r=[];for(e=0;e0;)if(n.i>=n.layers.length){if(i.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}n=i.pop()}else{var a=n.layers[n.i];if(n.i++,"imagelayer"===a.type){var o=s(a,"offsetx",0)+s(a,"startx",0),h=s(a,"offsety",0)+s(a,"starty",0);e.push({name:n.name+a.name,image:a.image,x:n.x+o+a.x,y:n.y+h+a.y,alpha:n.opacity*a.opacity,visible:n.visible&&a.visible,properties:s(a,"properties",{})})}else if("group"===a.type){var l=r(t,a,n);i.push(n),n=l}}return e}},46594(t,e,i){var s=i(51233),r=i(84101),n=i(91907),a=i(62644),o=i(80341),h=i(6641),l=i(87010),u=i(12635),d=i(22611),c=i(28200),f=i(24619);t.exports=function(t,e,i){var p=a(e),g=new l({width:p.width,height:p.height,name:t,tileWidth:p.tilewidth,tileHeight:p.tileheight,orientation:h(p.orientation),format:o.TILED_JSON,version:p.version,properties:p.properties,renderOrder:p.renderorder,infinite:p.infinite});if(g.orientation===n.HEXAGONAL)if(g.hexSideLength=p.hexsidelength,g.staggerAxis=p.staggeraxis,g.staggerIndex=p.staggerindex,"y"===g.staggerAxis){var m=(g.tileHeight-g.hexSideLength)/2;g.widthInPixels=g.tileWidth*(g.width+.5),g.heightInPixels=g.height*(g.hexSideLength+m)+m}else{var v=(g.tileWidth-g.hexSideLength)/2;g.widthInPixels=g.width*(g.hexSideLength+v)+v,g.heightInPixels=g.tileHeight*(g.height+.5)}g.layers=c(p,i),g.images=u(p);var y=f(p);return g.tilesets=y.tilesets,g.imageCollections=y.imageCollections,g.objects=d(p),g.tiles=r(g),s(g),g}},52205(t,e,i){var s=i(18254),r=i(29920),n=function(t){return{x:t.x,y:t.y}},a=["id","name","type","rotation","properties","visible","x","y","width","height"];t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=0);var o=s(t,a);if(o.x+=e,o.y+=i,t.gid){var h=r(t.gid);o.gid=h.gid,o.flippedHorizontal=h.flippedHorizontal,o.flippedVertical=h.flippedVertical,o.flippedAntiDiagonal=h.flippedAntiDiagonal}else t.polyline?o.polyline=t.polyline.map(n):t.polygon?o.polygon=t.polygon.map(n):t.ellipse?o.ellipse=t.ellipse:t.text?o.text=t.text:t.point?o.point=!0:o.rectangle=!0;return o}},22611(t,e,i){var s=i(95540),r=i(52205),n=i(48700),a=i(79677);t.exports=function(t){for(var e=[],i=[],o=a(t);o.i0;)if(o.i>=o.layers.length){if(i.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}o=i.pop()}else{var h=o.layers[o.i];if(o.i++,h.opacity*=o.opacity,h.visible=o.visible&&h.visible,"objectgroup"===h.type){h.name=o.name+h.name;for(var l=o.x+s(h,"startx",0)+s(h,"offsetx",0),u=o.y+s(h,"starty",0)+s(h,"offsety",0),d=[],c=0;c0;)if(f.i>=f.layers.length){if(c.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}f=c.pop()}else{var p=f.layers[f.i];if(f.i++,"tilelayer"===p.type)if(p.compression)console.warn("TilemapParser.parseTiledJSON - Layer compression is unsupported, skipping layer '"+p.name+"'");else{if(p.encoding&&"base64"===p.encoding){if(p.chunks)for(var g=0;g0?((y=new u(m,v.gid,F,I,t.tilewidth,t.tileheight)).rotation=v.rotation,y.flipX=v.flipped,b[I][F]=y):(x=e?null:new u(m,-1,F,I,t.tilewidth,t.tileheight),b[I][F]=x),++S===M.width&&(O++,S=0)}}else{(m=new h({name:f.name+p.name,id:p.id,x:f.x+o(p,"offsetx",0)+p.x,y:f.y+o(p,"offsety",0)+p.y,width:p.width,height:p.height,tileWidth:t.tilewidth,tileHeight:t.tileheight,alpha:f.opacity*p.opacity,visible:f.visible&&p.visible,properties:o(p,"properties",[]),orientation:a(t.orientation)})).orientation===r.HEXAGONAL&&(m.hexSideLength=t.hexsidelength,m.staggerAxis=t.staggeraxis,m.staggerIndex=t.staggerindex,"y"===m.staggerAxis?(T=(m.tileHeight-m.hexSideLength)/2,m.widthInPixels=m.tileWidth*(m.width+.5),m.heightInPixels=m.height*(m.hexSideLength+T)+T):(w=(m.tileWidth-m.hexSideLength)/2,m.widthInPixels=m.width*(m.hexSideLength+w)+w,m.heightInPixels=m.tileHeight*(m.height+.5)));for(var N=[],B=0,k=p.data.length;B0?((y=new u(m,v.gid,S,b.length,t.tilewidth,t.tileheight)).rotation=v.rotation,y.flipX=v.flipped,N.push(y)):(x=e?null:new u(m,-1,S,b.length,t.tilewidth,t.tileheight),N.push(x)),++S===p.width&&(b.push(N),S=0,N=[])}m.data=b,d.push(m)}else if("group"===p.type){var U=n(t,p,f);c.push(f),f=U}}return d}},24619(t,e,i){var s=i(33629),r=i(16536),n=i(52205),a=i(57880);t.exports=function(t){for(var e,i=[],o=[],h=null,l=0;l1){var c=void 0,f=void 0;if(Array.isArray(u.tiles)){c=c||{},f=f||{};for(var p=0;p0){var n,a,o,h={},l={};if(Array.isArray(s.edgecolors))for(n=0;n0)throw new Error("TimerEvent infinite loop created via zero delay")}else e=new a(t);return this._pendingInsertion.push(e),e},delayedCall:function(t,e,i,s){return this.addEvent({delay:t,callback:e,args:i,callbackScope:s})},clearPendingEvents:function(){return this._pendingInsertion=[],this},removeEvent:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e-1&&this._active.splice(r,1),s.destroy()}for(i=0;i=s.delay)){var r=s.elapsed-s.delay;if(s.elapsed=s.delay,!s.hasDispatched&&s.callback&&(s.hasDispatched=!0,s.callback.apply(s.callbackScope,s.args)),s.repeatCount>0){if(s.repeatCount--,r>=s.delay)for(;r>=s.delay&&s.repeatCount>0;)s.callback&&s.callback.apply(s.callbackScope,s.args),r-=s.delay,s.repeatCount--;s.elapsed=r,s.hasDispatched=!1}else s.hasDispatched&&this._pendingRemoval.push(s)}}}},shutdown:function(){var t;for(t=0;t0||this.totalComplete>0)&&(0!==this.loop&&(-1===this.loop||this.loop>this.iteration)?(this.iteration++,this.reset(!0)):this.complete=!0),this.complete&&this.emit(h.COMPLETE,this)}},play:function(t){return void 0===t&&(t=!0),this.paused=!1,this.complete=!1,this.totalComplete=0,t&&this.reset(),this},pause:function(){this.paused=!0;for(var t=this.events,e=0;e0&&(i=e[e.length-1].time);for(var s=0;s0)throw new Error("TimerEvent infinite loop created via zero delay");return this},getProgress:function(){return this.elapsed/this.delay},getOverallProgress:function(){if(this.repeat>0){var t=this.delay+this.delay*this.repeat;return(this.elapsed+this.delay*(this.repeat-this.repeatCount))/t}return this.getProgress()},getRepeatCount:function(){return this.repeatCount},getElapsed:function(){return this.elapsed},getElapsedSeconds:function(){return.001*this.elapsed},getRemaining:function(){return this.delay-this.elapsed},getRemainingSeconds:function(){return.001*this.getRemaining()},getOverallRemaining:function(){return this.delay*(1+this.repeatCount)-this.elapsed},getOverallRemainingSeconds:function(){return.001*this.getOverallRemaining()},remove:function(t){void 0===t&&(t=!1),this.elapsed=this.delay,this.hasDispatched=!t,this.repeatCount=0},destroy:function(){this.callback=void 0,this.callbackScope=void 0,this.args=[]}});t.exports=n},35945(t){t.exports="complete"},89809(t,e,i){t.exports={COMPLETE:i(35945)}},90291(t,e,i){t.exports={Clock:i(33385),Events:i(89809),Timeline:i(96120),TimerEvent:i(94880)}},40382(t,e,i){var s=i(72905),r=i(83419),n=i(43491),a=i(88032),o=i(37277),h=i(44594),l=i(93109),u=i(8462),d=i(8357),c=i(43960),f=i(26012),p=new r({initialize:function(t){this.scene=t,this.events=t.sys.events,this.timeScale=1,this.paused=!1,this.processing=!1,this.tweens=[],this.time=0,this.startTime=0,this.nextTime=0,this.prevTime=0,this.maxLag=500,this.lagSkip=33,this.gap=1e3/240,this.events.once(h.BOOT,this.boot,this),this.events.on(h.START,this.start,this)},boot:function(){this.events.once(h.DESTROY,this.destroy,this)},start:function(){this.timeScale=1,this.paused=!1,this.startTime=Date.now(),this.prevTime=this.startTime,this.nextTime=this.gap,this.events.on(h.UPDATE,this.update,this),this.events.once(h.SHUTDOWN,this.shutdown,this)},create:function(t){Array.isArray(t)||(t=[t]);for(var e=[],i=0;i-1},existing:function(t){return this.has(t)||this.tweens.push(t.reset()),this},addCounter:function(t){var e=a(this,t);return this.tweens.push(e.reset()),e},stagger:function(t,e){return l(t,e)},setLagSmooth:function(t,e){return void 0===t&&(t=1/1e-8),void 0===e&&(e=0),this.maxLag=t,this.lagSkip=Math.min(e,this.maxLag),this},setFps:function(t){return void 0===t&&(t=240),this.gap=1e3/t,this.nextTime=1e3*this.time+this.gap,this},getDelta:function(t){var e=Date.now()-this.prevTime;e>this.maxLag&&(this.startTime+=e-this.lagSkip),this.prevTime+=e;var i=this.prevTime-this.startTime,s=i-this.nextTime,r=i-1e3*this.time;return s>0||t?(i/=1e3,this.time=i,this.nextTime+=s+(s>=this.gap?4:this.gap-s)):r=0,r},tick:function(){return this.step(!0),this},update:function(){this.paused||this.step(!1)},step:function(t){void 0===t&&(t=!1);var e=this.getDelta(t);if(!(e<=0)){var i,s;this.processing=!0;var r=[],n=this.tweens;for(i=0;i0){for(i=0;i-1&&(s.isPendingRemove()||s.isDestroyed())&&(n.splice(o,1),s.destroy())}r.length=0}this.processing=!1}},remove:function(t){return this.processing?t.setPendingRemoveState():(s(this.tweens,t),t.setRemovedState()),this},reset:function(t){return this.existing(t),t.seek(),t.setActiveState(),this},makeActive:function(t){return this.existing(t),t.setActiveState(),this},each:function(t,e){var i,s=[null];for(i=1;iE&&(E=M),C[A][_]=M}}}var R=o?s(o):null;return i=h?function(t,e,i,s){var r,n=0,o=s%y,h=Math.floor(s/y);if(o>=0&&o=0&&ht&&(this.loopCounter=t),this},remove:function(){return this.parent&&this.parent.remove(this),this},stop:function(){return!this.parent||this.isRemoved()||this.isPendingRemove()||this.isDestroyed()||(this.dispatchEvent(n.TWEEN_STOP,"onStop"),this.setPendingRemoveState()),this},updateLoopCountdown:function(t){this.countdown-=t,this.countdown<=0&&(this.setActiveState(),this.dispatchEvent(n.TWEEN_LOOP,"onLoop"))},updateStartCountdown:function(t){return this.countdown-=t,this.countdown<=0&&(this.hasStarted=!0,this.setActiveState(),this.dispatchEvent(n.TWEEN_START,"onStart"),t=0),t},updateCompleteDelay:function(t){this.countdown-=t,this.countdown<=0&&this.onCompleteHandler()},setCallback:function(t,e,i){return void 0===i&&(i=[]),this.callbacks.hasOwnProperty(t)&&(this.callbacks[t]={func:e,params:i}),this},setPendingState:function(){this.state=a.PENDING},setActiveState:function(){this.state=a.ACTIVE,this.hasStarted=!1},setLoopDelayState:function(){this.state=a.LOOP_DELAY},setCompleteDelayState:function(){this.state=a.COMPLETE_DELAY},setStartDelayState:function(){this.state=a.START_DELAY,this.countdown=this.startDelay,this.hasStarted=!1},setPendingRemoveState:function(){this.state=a.PENDING_REMOVE},setRemovedState:function(){this.state=a.REMOVED},setFinishedState:function(){this.state=a.FINISHED},setDestroyedState:function(){this.state=a.DESTROYED},isPending:function(){return this.state===a.PENDING},isActive:function(){return this.state===a.ACTIVE},isLoopDelayed:function(){return this.state===a.LOOP_DELAY},isCompleteDelayed:function(){return this.state===a.COMPLETE_DELAY},isStartDelayed:function(){return this.state===a.START_DELAY},isPendingRemove:function(){return this.state===a.PENDING_REMOVE},isRemoved:function(){return this.state===a.REMOVED},isFinished:function(){return this.state===a.FINISHED},isDestroyed:function(){return this.state===a.DESTROYED},destroy:function(){this.data&&this.data.forEach(function(t){t.destroy()}),this.removeAllListeners(),this.callbacks=null,this.data=null,this.parent=null,this.setDestroyedState()}});o.TYPES=["onActive","onComplete","onLoop","onPause","onRepeat","onResume","onStart","onStop","onUpdate","onYoyo"],t.exports=o},95042(t,e,i){var s=i(83419),r=i(842),n=i(86353),a=new s({initialize:function(t,e,i,s,r,n,a,o,h,l){this.tween=t,this.targetIndex=e,this.duration=s<=0?.01:s,this.totalDuration=0,this.delay=0,this.getDelay=i,this.yoyo=r,this.hold=n,this.repeat=a,this.repeatDelay=o,this.repeatCounter=0,this.flipX=h,this.flipY=l,this.progress=0,this.elapsed=0,this.state=0,this.isCountdown=!1},getTarget:function(){return this.tween.targets[this.targetIndex]},setTargetValue:function(t){void 0===t&&(t=this.current),this.tween.targets[this.targetIndex][this.key]=t},setCreatedState:function(){this.state=n.CREATED,this.isCountdown=!1},setDelayState:function(){this.state=n.DELAY,this.isCountdown=!0},setPendingRenderState:function(){this.state=n.PENDING_RENDER,this.isCountdown=!1},setPlayingForwardState:function(){this.state=n.PLAYING_FORWARD,this.isCountdown=!1},setPlayingBackwardState:function(){this.state=n.PLAYING_BACKWARD,this.isCountdown=!1},setHoldState:function(){this.state=n.HOLD_DELAY,this.isCountdown=!0},setRepeatState:function(){this.state=n.REPEAT_DELAY,this.isCountdown=!0},setCompleteState:function(){this.state=n.COMPLETE,this.isCountdown=!1},isCreated:function(){return this.state===n.CREATED},isDelayed:function(){return this.state===n.DELAY},isPendingRender:function(){return this.state===n.PENDING_RENDER},isPlayingForward:function(){return this.state===n.PLAYING_FORWARD},isPlayingBackward:function(){return this.state===n.PLAYING_BACKWARD},isHolding:function(){return this.state===n.HOLD_DELAY},isRepeating:function(){return this.state===n.REPEAT_DELAY},isComplete:function(){return this.state===n.COMPLETE},setStateFromEnd:function(t){this.yoyo?this.onRepeat(t,!0,!0):this.repeatCounter>0?this.onRepeat(t,!0,!1):this.setCompleteState()},setStateFromStart:function(t){this.repeatCounter>0?this.onRepeat(t,!1):this.setCompleteState()},reset:function(){var t=this.tween,e=t.totalTargets,i=this.targetIndex,s=t.targets[i],r=this.key;this.progress=0,this.elapsed=0,this.delay=this.getDelay(s,r,0,i,e,t),this.repeatCounter=-1===this.repeat?n.MAX:this.repeat,this.setPendingRenderState();var a=this.duration+this.hold;this.yoyo&&(a+=this.duration);var o=a+this.repeatDelay;this.totalDuration=this.delay+a,-1===this.repeat?(this.totalDuration+=o*n.MAX,t.isInfinite=!0):this.repeat>0&&(this.totalDuration+=o*this.repeat),this.totalDuration>t.duration&&(t.duration=this.totalDuration),this.delay0&&(this.elapsed=this.delay,this.setDelayState())},onRepeat:function(t,e,i){var s=this.tween,n=s.totalTargets,a=this.targetIndex,o=s.targets[a],h=this.key,l="texture"!==h;if(this.elapsed=t,this.progress=t/this.duration,this.flipX&&o.toggleFlipX(),this.flipY&&o.toggleFlipY(),l&&(e||i)&&(this.start=this.getStartValue(o,h,this.start,a,n,s)),i)return this.setPlayingBackwardState(),void this.dispatchEvent(r.TWEEN_YOYO,"onYoyo");this.repeatCounter--,l&&(this.end=this.getEndValue(o,h,this.start,a,n,s)),this.repeatDelay>0?(this.elapsed=this.repeatDelay-t,l&&(this.current=this.start,o[h]=this.current),this.setRepeatState()):(this.setPlayingForwardState(),this.dispatchEvent(r.TWEEN_REPEAT,"onRepeat"))},destroy:function(){this.tween=null,this.getDelay=null,this.setCompleteState()}});t.exports=a},69902(t){t.exports={targets:null,delay:0,duration:1e3,ease:"Power0",easeParams:null,hold:0,repeat:0,repeatDelay:0,yoyo:!1,flipX:!1,flipY:!1,persist:!1,interpolation:null}},81076(t){t.exports=["callbackScope","completeDelay","delay","duration","ease","easeParams","flipX","flipY","hold","interpolation","loop","loopDelay","onActive","onActiveParams","onComplete","onCompleteParams","onLoop","onLoopParams","onPause","onPauseParams","onRepeat","onRepeatParams","onResume","onResumeParams","onStart","onStartParams","onStop","onStopParams","onUpdate","onUpdateParams","onYoyo","onYoyoParams","paused","persist","props","repeat","repeatDelay","targets","yoyo"]},8462(t,e,i){var s=i(70402),r=i(83419),n=i(842),a=i(44603),o=i(39429),h=i(36383),l=i(86353),u=i(48177),d=i(42220),c=new r({Extends:s,initialize:function(t,e){s.call(this,t),this.targets=e,this.totalTargets=e.length,this.isSeeking=!1,this.isInfinite=!1,this.elapsed=0,this.totalElapsed=0,this.duration=0,this.progress=0,this.totalDuration=0,this.totalProgress=0,this.isNumberTween=!1},add:function(t,e,i,s,r,n,a,o,h,l,d,c,f,p,g,m){var v=new u(this,t,e,i,s,r,n,a,o,h,l,d,c,f,p,g,m);return this.totalData=this.data.push(v),v},addFrame:function(t,e,i,s,r,n,a,o,h,l){var u=new d(this,t,e,i,s,r,n,a,o,h,l);return this.totalData=this.data.push(u),u},getValue:function(t){void 0===t&&(t=0);var e=null;return this.data&&(e=this.data[t].current),e},hasTarget:function(t){return this.targets&&-1!==this.targets.indexOf(t)},updateTo:function(t,e,i){if(void 0===i&&(i=!1),"texture"!==t)for(var s=0;s0)this.elapsed=0,this.progress=0,this.loopCounter--,this.initTweenData(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.setLoopDelayState()):(this.setActiveState(),this.dispatchEvent(n.TWEEN_LOOP,"onLoop"));else{if(!(this.completeDelay>0))return this.onCompleteHandler(),!0;this.countdown=this.completeDelay,this.setCompleteDelayState()}return!1},onCompleteHandler:function(){this.progress=1,this.totalProgress=1,s.prototype.onCompleteHandler.call(this)},play:function(){return this.isDestroyed()?(console.warn("Cannot play destroyed Tween",this),this):((this.isPendingRemove()||this.isFinished())&&this.seek(),this.paused=!1,this.setActiveState(),this)},seek:function(t,e,i){if(void 0===t&&(t=0),void 0===e&&(e=16.6),void 0===i&&(i=!1),this.isDestroyed())return console.warn("Cannot seek destroyed Tween",this),this;i||(this.isSeeking=!0),this.reset(!0),this.initTweenData(!0),this.setActiveState(),this.dispatchEvent(n.TWEEN_ACTIVE,"onActive");var s=this.paused;if(this.paused=!1,t>0){for(var r=Math.floor(t/e),a=t-r*e,o=0;o0&&this.update(a)}return this.paused=s,this.isSeeking=!1,this},initTweenData:function(t){void 0===t&&(t=!1),this.duration=0,this.startDelay=h.MAX_SAFE_INTEGER;for(var e=this.data,i=0;i0?s+r+(s+a)*n:s+r},reset:function(t){return void 0===t&&(t=!1),this.elapsed=0,this.totalElapsed=0,this.progress=0,this.totalProgress=0,this.loopCounter=this.loop,-1===this.loop&&(this.isInfinite=!0,this.loopCounter=l.MAX),t||(this.initTweenData(),this.setActiveState(),this.dispatchEvent(n.TWEEN_ACTIVE,"onActive")),this},update:function(t){if(this.isPendingRemove()||this.isDestroyed())return!this.persist||(this.setFinishedState(),!1);if(this.paused||this.isFinished())return!1;if(t*=this.timeScale*this.parent.timeScale,this.isLoopDelayed())return this.updateLoopCountdown(t),!1;if(this.isCompleteDelayed())return this.updateCompleteDelay(t),!1;this.hasStarted||(this.startDelay-=t,this.startDelay<=0&&(this.hasStarted=!0,this.dispatchEvent(n.TWEEN_START,"onStart"),t=0));var e=!1;if(this.isActive())for(var i=this.data,s=0;s0&&!this.isStartDelayed()?this.setStartDelayState():this.setActiveState(),this},add:function(t){var e=this.parent.create(t);Array.isArray(e)||(e=[e]);for(var i=this.data,s=0;s0)this.loopCounter--,this.resetTweens(),this.loopDelay>0?(this.countdown=this.loopDelay,this.setLoopDelayState()):(this.setActiveState(),this.dispatchEvent(a.TWEEN_LOOP,"onLoop"));else{if(!(this.completeDelay>0))return this.onCompleteHandler(),!0;this.countdown=this.completeDelay,this.setCompleteDelayState()}return!1},play:function(){return this.isDestroyed()?(console.warn("Cannot play destroyed TweenChain",this),this):((this.isPendingRemove()||this.isPending())&&this.resetTweens(),this.paused=!1,this.startDelay>0&&!this.isStartDelayed()?this.setStartDelayState():this.setActiveState(),this)},resetTweens:function(){for(var t=this.data,e=this.totalData,i=0;i=d?(c=u-d,u=d,f=!0):u<0&&(u=0);var p=r(u/d,0,1);this.elapsed=u,this.progress=p,this.previous=this.current,h||(p=1-p);var g=this.ease(p);this.interpolation?this.current=this.interpolation(this.interpolationData,g):this.current=this.start+(this.end-this.start)*g,n[o]=this.current,f&&(h?(e.isNumberTween&&(this.current=this.end,n[o]=this.current),this.hold>0?(this.elapsed=this.hold,this.setHoldState()):this.setStateFromEnd(c)):(e.isNumberTween&&(this.current=this.start,n[o]=this.current),this.setStateFromStart(c))),this.dispatchEvent(a.TWEEN_UPDATE,"onUpdate")}return!this.isComplete()},dispatchEvent:function(t,e){var i=this.tween;if(!i.isSeeking){var s=i.targets[this.targetIndex],r=this.key,n=this.current,a=this.previous;i.emit(t,i,r,s,n,a);var o=i.callbacks[e];o&&o.func.apply(i.callbackScope,[i,s,r,n,a].concat(o.params))}},destroy:function(){s.prototype.destroy.call(this),this.getActiveValue=null,this.getEndValue=null,this.getStartValue=null,this.ease=null}});t.exports=o},42220(t,e,i){var s=i(95042),r=i(45319),n=i(83419),a=i(842),o=new n({Extends:s,initialize:function(t,e,i,r,n,a,o,h,l,u,d){s.call(this,t,e,n,a,!1,o,h,l,u,d),this.key="texture",this.startTexture=null,this.endTexture=i,this.startFrame=null,this.endFrame=r,this.yoyo=0!==h},reset:function(t){s.prototype.reset.call(this);var e=this.tween.targets[this.targetIndex];this.startTexture||(this.startTexture=e.texture.key,this.startFrame=e.frame.name),t&&e.setTexture(this.startTexture,this.startFrame)},update:function(t){var e=this.tween,i=this.targetIndex,s=e.targets[i];if(!s)return this.setCompleteState(),!1;if(this.isCountdown&&(this.elapsed-=t,this.elapsed<=0&&(this.elapsed=0,t=0,this.isDelayed()?this.setPendingRenderState():this.isRepeating()?(this.setPlayingForwardState(),this.dispatchEvent(a.TWEEN_REPEAT,"onRepeat")):this.isHolding()&&this.setStateFromEnd(0))),this.isPendingRender())return this.startTexture&&s.setTexture(this.startTexture,this.startFrame),this.setPlayingForwardState(),!0;var n=this.isPlayingForward(),o=this.isPlayingBackward();if(n||o){var h=this.elapsed,l=this.duration,u=0,d=!1;(h+=t)>=l?(u=h-l,h=l,d=!0):h<0&&(h=0);var c=r(h/l,0,1);this.elapsed=h,this.progress=c,d&&(n?(s.setTexture(this.endTexture,this.endFrame),this.hold>0?(this.elapsed=this.hold,this.setHoldState()):this.setStateFromEnd(u)):(s.setTexture(this.startTexture,this.startFrame),this.setStateFromStart(u))),this.dispatchEvent(a.TWEEN_UPDATE,"onUpdate")}return!this.isComplete()},dispatchEvent:function(t,e){var i=this.tween;if(!i.isSeeking){var s=i.targets[this.targetIndex],r=this.key;i.emit(t,i,r,s);var n=i.callbacks[e];n&&n.func.apply(i.callbackScope,[i,s,r].concat(n.params))}},destroy:function(){s.prototype.destroy.call(this),this.startTexture=null,this.endTexture=null,this.startFrame=null,this.endFrame=null}});t.exports=o},86353(t){t.exports={CREATED:0,DELAY:2,PENDING_RENDER:4,PLAYING_FORWARD:5,PLAYING_BACKWARD:6,HOLD_DELAY:7,REPEAT_DELAY:8,COMPLETE:9,PENDING:20,ACTIVE:21,LOOP_DELAY:22,COMPLETE_DELAY:23,START_DELAY:24,PENDING_REMOVE:25,REMOVED:26,FINISHED:27,DESTROYED:28,MAX:999999999999}},83419(t){function e(t,e,i){var s=i?t[e]:Object.getOwnPropertyDescriptor(t,e);return!i&&s.value&&"object"==typeof s.value&&(s=s.value),!(!s||!function(t){return!!t.get&&"function"==typeof t.get||!!t.set&&"function"==typeof t.set}(s))&&(void 0===s.enumerable&&(s.enumerable=!0),void 0===s.configurable&&(s.configurable=!0),s)}function i(t,e){var i=Object.getOwnPropertyDescriptor(t,e);return!!i&&(i.value&&"object"==typeof i.value&&(i=i.value),!1===i.configurable)}function s(t,s,r,a){for(var o in s)if(s.hasOwnProperty(o)){var h=e(s,o,r);if(!1!==h){if(i((a||t).prototype,o)){if(n.ignoreFinals)continue;throw new Error("cannot override final property '"+o+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,o,h)}else t.prototype[o]=s[o]}}function r(t,e){if(e){Array.isArray(e)||(e=[e]);for(var i=0;i0){var n=i-t.length;if(n<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.push(e),s&&s.call(r,e),e):null;for(var a=e.length-1;a>=0;)-1!==t.indexOf(e[a])&&e.splice(a,1),a--;if(0===(a=e.length))return null;i>0&&a>n&&(e.splice(n),a=n);for(var o=0;o0){var a=s-t.length;if(a<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.splice(i,0,e),r&&r.call(n,e),e):null;for(var o=e.length-1;o>=0;)-1!==t.indexOf(e[o])&&e.pop(),o--;if(0===(o=e.length))return null;s>0&&o>a&&(e.splice(a),o=a);for(var h=o-1;h>=0;h--){var l=e[h];t.splice(i,0,l),r&&r.call(n,l)}return e}},66905(t){t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&ie.length&&(n=e.length),i?(s=e[n-1][i],(r=e[n][i])-t<=t-s?e[n]:e[n-1]):(s=e[n-1],(r=e[n])-t<=t-s?r:s)}},43491(t){var e=function(t,i){void 0===i&&(i=[]);for(var s=0;s=0;a--)if(o=t[a],!e||e&&void 0===i&&o.hasOwnProperty(e)||e&&void 0!==i&&o[e]===i)return o;return null}},26546(t){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var s=e+Math.floor(Math.random()*(i-e));return void 0===t[s]?null:t[s]}},85835(t){t.exports=function(t,e,i){if(e===i)return t;var s=t.indexOf(e),r=t.indexOf(i);if(s<0||r<0)throw new Error("Supplied items must be elements of the same array");return s>r||(t.splice(s,1),r=t.indexOf(i),t.splice(r+1,0,e)),t}},83371(t){t.exports=function(t,e,i){if(e===i)return t;var s=t.indexOf(e),r=t.indexOf(i);if(s<0||r<0)throw new Error("Supplied items must be elements of the same array");return s0){var s=t[i-1],r=t.indexOf(s);t[i]=s,t[r]=e}return t}},69693(t){t.exports=function(t,e,i){var s=t.indexOf(e);if(-1===s||i<0||i>=t.length)throw new Error("Supplied index out of bounds");return s!==i&&(t.splice(s,1),t.splice(i,0,e)),e}},40853(t){t.exports=function(t,e){var i=t.indexOf(e);if(-1!==i&&i=e;r--)a?n.push(i+r.toString()+s):n.push(r);else for(r=t;r<=e;r++)a?n.push(i+r.toString()+s):n.push(r);return n}},593(t,e,i){var s=i(2284);t.exports=function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=null),void 0===i&&(i=1),null===e&&(e=t,t=0);for(var r=[],n=Math.max(s((e-t)/(i||1)),0),a=0;ae?1:0}var s=function(t,r,n,a,o){for(void 0===n&&(n=0),void 0===a&&(a=t.length-1),void 0===o&&(o=i);a>n;){if(a-n>600){var h=a-n+1,l=r-n+1,u=Math.log(h),d=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*d*(h-d)/h)*(l-h/2<0?-1:1),f=Math.max(n,Math.floor(r-l*d/h+c)),p=Math.min(a,Math.floor(r+(h-l)*d/h+c));s(t,r,f,p,o)}var g=t[r],m=n,v=a;for(e(t,n,r),o(t[a],g)>0&&e(t,n,a);m0;)v--}0===o(t[n],g)?e(t,n,v):e(t,++v,a),v<=r&&(n=v+1),r<=v&&(a=v-1)}};t.exports=s},88492(t,e,i){var s=i(35154),r=i(33680),n=function(t,e,i){for(var s=[],r=0;r=0;){var h=e[a];-1!==(n=t.indexOf(h))&&(s(t,n),o.push(h),i&&i.call(r,h)),a--}return o}},60248(t,e,i){var s=i(19133);t.exports=function(t,e,i,r){if(void 0===r&&(r=t),e<0||e>t.length-1)throw new Error("Index out of bounds");var n=s(t,e);return i&&i.call(r,n),n}},81409(t,e,i){var s=i(82011);t.exports=function(t,e,i,r,n){if(void 0===e&&(e=0),void 0===i&&(i=t.length),void 0===n&&(n=t),s(t,e,i)){var a=i-e,o=t.splice(e,a);if(r)for(var h=0;h=r||e>=i||i>r){if(s)throw new Error("Range Error: Values outside acceptable range");return!1}return!0}},89545(t){t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i>0&&(t.splice(i,1),t.unshift(e)),e}},17810(t,e,i){var s=i(82011);t.exports=function(t,e,i,r,n){if(void 0===r&&(r=0),void 0===n&&(n=t.length),s(t,r,n))for(var a=r;a0;e--){var i=Math.floor(Math.random()*(e+1)),s=t[e];t[e]=t[i],t[i]=s}return t}},90126(t){t.exports=function(t){var e=/\D/g;return t.sort(function(t,i){return parseInt(t.replace(e,""),10)-parseInt(i.replace(e,""),10)}),t}},19133(t){t.exports=function(t,e){if(!(e>=t.length)){for(var i=t.length-1,s=t[e],r=e;rl&&(n=l),a>l&&(a=l),o=r,h=n;;)if(o-1;n--)s[r][n]=t[n][r]}return s}},54915(t,e,i){t.exports={CheckMatrix:i(86922),MatrixToString:i(63362),ReverseColumns:i(92598),ReverseRows:i(21224),Rotate180:i(98717),RotateLeft:i(44657),RotateMatrix:i(37829),RotateRight:i(92632),Translate:i(69512),TransposeMatrix:i(2429)}},71334(t){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";t.exports=function(t,i){for(var s=new Uint8Array(t),r=s.length,n=i?"data:"+i+";base64,":"",a=0;a>2],n+=e[(3&s[a])<<4|s[a+1]>>4],n+=e[(15&s[a+1])<<2|s[a+2]>>6],n+=e[63&s[a+2]];return r%3==2?n=n.substring(0,n.length-1)+"=":r%3==1&&(n=n.substring(0,n.length-2)+"=="),n}},53134(t){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=new Uint8Array(256),s=0;s<64;s++)i[e.charCodeAt(s)]=s;t.exports=function(t){var e,s,r,n,a=(t=t.substr(t.indexOf(",")+1)).length,o=.75*a,h=0;"="===t[a-1]&&(o--,"="===t[a-2]&&o--);for(var l=new ArrayBuffer(o),u=new Uint8Array(l),d=0;d>4,u[h++]=(15&s)<<4|r>>2,u[h++]=(3&r)<<6|63&n;return l}},65839(t,e,i){t.exports={ArrayBufferToBase64:i(71334),Base64ToArrayBuffer:i(53134)}},91799(t,e,i){t.exports={Array:i(37105),Base64:i(65839),Objects:i(1183),String:i(31749),NOOP:i(29747),NULL:i(20242)}},41786(t){t.exports=function(t){var e={};for(var i in t)Array.isArray(t[i])?e[i]=t[i].slice(0):e[i]=t[i];return e}},62644(t){var e=function(t){var i,s,r;if("object"!=typeof t||null===t)return t;for(r in i=Array.isArray(t)?[]:{},t)s=t[r],i[r]=e(s);return i};t.exports=e},79291(t,e,i){var s=i(41212),r=function(){var t,e,i,n,a,o,h=arguments[0]||{},l=1,u=arguments.length,d=!1;for("boolean"==typeof h&&(d=h,h=arguments[1]||{},l=2),u===l&&(h=this,--l);l=(t=t.toString()).length)switch(s){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var n=Math.ceil((r=e-t.length)/2);t=new Array(r-n+1).join(i)+t+new Array(n+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t}},33628(t){t.exports=function(t,e){return 0===e?t.slice(1):t.slice(0,e)+t.slice(e+1)}},27671(t){t.exports=function(t){return t.split("").reverse().join("")}},45650(t){t.exports=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})}},35355(t){t.exports=function(t){return t&&t[0].toUpperCase()+t.slice(1)}},31749(t,e,i){t.exports={Format:i(27902),Pad:i(41836),RemoveAt:i(33628),Reverse:i(27671),UppercaseFirst:i(35355),UUID:i(45650)}}},e={};function i(s){var r=e[s];if(void 0!==r)return r.exports;var n=e[s]={exports:{}};return t[s](n,n.exports,i),n.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var s in e)i.o(e,s)&&!i.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var s={};i.d(s,{A4:()=>A,AB:()=>L,AQ:()=>C,Ae:()=>z,Aq:()=>k,Ay:()=>Q,B_:()=>f,CB:()=>W,Cu:()=>v,D7:()=>D,Dh:()=>T,En:()=>n,FE:()=>_,Fu:()=>B,M3:()=>j,NS:()=>q,O1:()=>F,PX:()=>Z,Q8:()=>Y,Qw:()=>a,SY:()=>V,Tm:()=>l,UP:()=>K,XT:()=>c,Xs:()=>d,Z5:()=>R,Zt:()=>y,_k:()=>P,aH:()=>b,dv:()=>g,gX:()=>I,gd:()=>o,ho:()=>O,iJ:()=>u,j$:()=>X,l2:()=>h,nl:()=>p,pd:()=>w,qt:()=>G,ry:()=>E,sV:()=>m,sx:()=>N,x3:()=>H,xS:()=>x,xv:()=>U,zA:()=>M,zU:()=>S}),i(63595);var r=i(8054);const n=i(61061),a=i(60421),o=i(10312),h=i(83388),l=i(26638),u=i(42857),d=i(83419),c=i(25410),f=i(44965),p=i(27460),g=i(84902),m=i(93055),v=i(11889),y=i(50127),x=i(77856),T=i(55738),w=i(14350),b=i(57777),S=i(75508),C=i(44563),E=i(18922),A=i(36909),_=i(93364),M=i(29795),R=i(97482),P=i(62194),O=i(41392),L=i(23717),D=i(27458),F=i(62501),I=i(90291),N=i(84322),B=i(43066),k=i(91799),U=r.VERSION,z=r.LOG_VERSION,Y=r.AUTO,X=r.CANVAS,W=r.WEBGL,G=r.HEADLESS,V=r.FOREVER,H=r.NONE,j=r.LEFT,q=r.RIGHT,K=r.UP,Z=r.DOWN,Q={Actions:n,Animations:a,BlendModes:o,Cache:h,Cameras:l,Core:u,Class:d,Curves:c,Data:f,Display:p,DOM:g,Events:m,Filters:v,Game:y,GameObjects:x,Geom:T,Input:w,Loader:b,Math:S,Physics:C,Plugins:E,Renderer:A,Scale:_,ScaleModes:M,Scene:R,Scenes:P,Structs:O,Sound:L,Textures:D,Tilemaps:F,Time:I,TintModes:N,Tweens:B,Utils:k,VERSION:U,LOG_VERSION:z,AUTO:Y,CANVAS:X,WEBGL:W,HEADLESS:G,FOREVER:V,NONE:H,LEFT:j,RIGHT:q,UP:K,DOWN:Z},J=s.Q8,$=s.En,tt=s.Qw,et=s.gd,it=s.j$,st=s.l2,rt=s.Tm,nt=s.Xs,at=s.iJ,ot=s.XT,ht=s.dv,lt=s.PX,ut=s.B_,dt=s.nl,ct=s.sV,ft=s.SY,pt=s.Cu,gt=s.Zt,mt=s.xS,vt=s.Dh,yt=s.qt,xt=s.pd,Tt=s.M3,wt=s.Ae,bt=s.aH,St=s.zU,Ct=s.x3,Et=s.AQ,At=s.ry,_t=s.NS,Mt=s.A4,Rt=s.FE,Pt=s.zA,Ot=s.Z5,Lt=s._k,Dt=s.AB,Ft=s.ho,It=s.D7,Nt=s.O1,Bt=s.gX,kt=s.sx,Ut=s.Fu,zt=s.UP,Yt=s.Aq,Xt=s.xv,Wt=s.CB,Gt=s.Ay;export{J as AUTO,$ as Actions,tt as Animations,et as BlendModes,it as CANVAS,st as Cache,rt as Cameras,nt as Class,at as Core,ot as Curves,ht as DOM,lt as DOWN,ut as Data,dt as Display,ct as Events,ft as FOREVER,pt as Filters,gt as Game,mt as GameObjects,vt as Geom,yt as HEADLESS,xt as Input,Tt as LEFT,wt as LOG_VERSION,bt as Loader,St as Math,Ct as NONE,Et as Physics,At as Plugins,_t as RIGHT,Mt as Renderer,Rt as Scale,Pt as ScaleModes,Ot as Scene,Lt as Scenes,Dt as Sound,Ft as Structs,It as Textures,Nt as Tilemaps,Bt as Time,kt as TintModes,Ut as Tweens,zt as UP,Yt as Utils,Xt as VERSION,Wt as WEBGL,Gt as default}; \ No newline at end of file diff --git a/dist/phaser.js b/dist/phaser.js index 875acb20c8..46768651b8 100644 --- a/dist/phaser.js +++ b/dist/phaser.js @@ -11,6 +11,1816 @@ return /******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ +/***/ 7889 +(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Depth: () => (/* binding */ Depth), +/* harmony export */ DepthDescriptors: () => (/* binding */ DepthDescriptors), +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_Mixin_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(42969); +/* harmony import */ var _utils_array_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(37105); +/* harmony import */ var _utils_array_index_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_utils_array_index_js__WEBPACK_IMPORTED_MODULE_1__); + +/** + * @author Richard Davey + * @copyright 2013-2026 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + + +const DepthDescriptors = { + _depth: 0, + depth: { + get: function() { + return this._depth; + }, + set: function(value) { + if (this.displayList) { + this.displayList.queueDepthSort(); + } + this._depth = value; + } + }, + setDepth: function(value) { + if (value === void 0) { + value = 0; + } + this.depth = value; + return this; + }, + setToTop: function() { + const list = this.getDisplayList(); + if (list) { + _utils_array_index_js__WEBPACK_IMPORTED_MODULE_1___default().BringToTop(list, this); + } + return this; + }, + setToBack: function() { + const list = this.getDisplayList(); + if (list) { + _utils_array_index_js__WEBPACK_IMPORTED_MODULE_1___default().SendToBack(list, this); + } + return this; + }, + setAbove: function(gameObject) { + const list = this.getDisplayList(); + if (list && gameObject) { + _utils_array_index_js__WEBPACK_IMPORTED_MODULE_1___default().MoveAbove(list, this, gameObject); + } + return this; + }, + setBelow: function(gameObject) { + const list = this.getDisplayList(); + if (list && gameObject) { + _utils_array_index_js__WEBPACK_IMPORTED_MODULE_1___default().MoveBelow(list, this, gameObject); + } + return this; + } +}; +const Depth = (0,_utils_Mixin_js__WEBPACK_IMPORTED_MODULE_0__/* .defineMixin */ .lv)()(function Depth2(Base) { + (0,_utils_Mixin_js__WEBPACK_IMPORTED_MODULE_0__/* .applyMixin */ .AD)(Base, DepthDescriptors); + return Base; +}); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Depth); + + +/***/ }, + +/***/ 36626 +(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Visible: () => (/* binding */ Visible), +/* harmony export */ VisibleDescriptors: () => (/* binding */ VisibleDescriptors), +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _utils_Mixin_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(42969); + +/** + * @author Richard Davey + * @copyright 2013-2026 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +const _FLAG = 1; +const VisibleDescriptors = { + _visible: true, + visible: { + get: function() { + return this._visible; + }, + set: function(value) { + if (value) { + this._visible = true; + this.renderFlags |= _FLAG; + } else { + this._visible = false; + this.renderFlags &= ~_FLAG; + } + } + }, + setVisible: function(value) { + this.visible = value; + return this; + } +}; +const Visible = (0,_utils_Mixin_js__WEBPACK_IMPORTED_MODULE_0__/* .defineMixin */ .lv)()(function Visible2(Base) { + (0,_utils_Mixin_js__WEBPACK_IMPORTED_MODULE_0__/* .applyMixin */ .AD)(Base, VisibleDescriptors); + return Base; +}); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Visible); + + +/***/ }, + +/***/ 18134 +(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* unused harmony export NineSliceVertex */ +/* harmony import */ var _math_Vector2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(70038); + +/** + * @author Richard Davey + * @copyright 2013-2026 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +class NineSliceVertex extends _math_Vector2_js__WEBPACK_IMPORTED_MODULE_0__["default"] { + /** + * @param x - The x position of the vertex. + * @param y - The y position of the vertex. + * @param u - The UV u coordinate of the vertex. + * @param v - The UV v coordinate of the vertex. + */ + constructor(x, y, u, v) { + super(x, y); + this.vx = 0; + this.vy = 0; + this.u = u; + this.v = v; + } + /** + * Sets the UV texture coordinates of this vertex. + * + * @since 4.0.0 + * + * @param u - The UV u coordinate of the vertex. + * @param v - The UV v coordinate of the vertex. + * + * @return This Vertex. + */ + setUVs(u, v) { + this.u = u; + this.v = v; + return this; + } + /** + * Updates this vertex's position and calculates its projected screen-space coordinates. + * + * Sets the normalized `x` and `y` position, then scales them by the parent object's + * `width` and `height` to produce the projected `vx` and `vy` values. The origin + * offset of the parent object is then factored in, shifting `vx` and `vy` so that the + * mesh is correctly aligned relative to the object's origin point. + * + * @since 4.0.0 + * + * @param x - The x position of the vertex. + * @param y - The y position of the vertex. + * @param width - The width of the parent object. + * @param height - The height of the parent object. + * @param originX - The originX of the parent object. + * @param originY - The originY of the parent object. + * + * @return This Vertex. + */ + resize(x, y, width, height, originX, originY) { + this.x = x; + this.y = y; + this.vx = this.x * width; + this.vy = -this.y * height; + if (originX < 0.5) { + this.vx += width * (0.5 - originX); + } else if (originX > 0.5) { + this.vx -= width * (originX - 0.5); + } + if (originY < 0.5) { + this.vy += height * (0.5 - originY); + } else if (originY > 0.5) { + this.vy -= height * (originY - 0.5); + } + return this; + } +} +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (NineSliceVertex); + + +/***/ }, + +/***/ 58715 +(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; + +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + "default": () => (/* binding */ zone_Zone) +}); + +// UNUSED EXPORTS: Zone + +// EXTERNAL MODULE: ./renderer/BlendModes.js +var BlendModes = __webpack_require__(10312); +var BlendModes_default = /*#__PURE__*/__webpack_require__.n(BlendModes); +// EXTERNAL MODULE: ./geom/circle/Circle.js +var Circle = __webpack_require__(96503); +var Circle_default = /*#__PURE__*/__webpack_require__.n(Circle); +// EXTERNAL MODULE: ./geom/circle/Contains.js +var Contains = __webpack_require__(87902); +var Contains_default = /*#__PURE__*/__webpack_require__.n(Contains); +// EXTERNAL MODULE: ./gameobjects/components/index.js +var components = __webpack_require__(31401); +var components_default = /*#__PURE__*/__webpack_require__.n(components); +// EXTERNAL MODULE: ./geom/rectangle/Rectangle.ts +var Rectangle = __webpack_require__(59428); +// EXTERNAL MODULE: ./geom/rectangle/Contains.ts +var rectangle_Contains = __webpack_require__(72488); +// EXTERNAL MODULE: ./gameobjects/components/Visible.ts +var Visible = __webpack_require__(36626); +// EXTERNAL MODULE: ./gameobjects/components/Depth.ts +var Depth = __webpack_require__(7889); +// EXTERNAL MODULE: ./utils/Mixin.ts +var Mixin = __webpack_require__(42969); +// EXTERNAL MODULE: ./gameobjects/GameObject.js +var GameObject = __webpack_require__(95643); +var GameObject_default = /*#__PURE__*/__webpack_require__.n(GameObject); +;// ./utils/migrationPlaceholders.ts + + +const TODO_MIGRATE_GameObjectCtor = (GameObject_default()); + +;// ./gameobjects/zone/Zone.ts + +/** + * @author Richard Davey + * @copyright 2013-2026 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + + + + + + + + + + +const ZoneBase = (0,Mixin/* composeMixins */.fP)(Visible.Visible, Depth.Depth)(TODO_MIGRATE_GameObjectCtor); +class Zone extends ZoneBase { + /** + * @since 3.0.0 + */ + constructor(scene, x, y, width = 1, height = width) { + super(scene, "Zone"); + this.setPosition(x, y); + this.width = width; + this.height = height; + this.blendMode = (BlendModes_default()).NORMAL; + this.updateDisplayOrigin(); + } + /** + * The displayed width of this Game Object. + * This value takes into account the scale factor. + * + * @name Phaser.GameObjects.Zone#displayWidth + * @since 3.0.0 + */ + get displayWidth() { + return this.scaleX * this.width; + } + set displayWidth(value) { + this.scaleX = value / this.width; + } + /** + * The displayed height of this Game Object. + * This value takes into account the scale factor. + * + * @since 3.0.0 + */ + get displayHeight() { + return this.scaleY * this.height; + } + set displayHeight(value) { + this.scaleY = value / this.height; + } + /** + * Sets the native (un-scaled) width and height of this Zone. Also updates the display origin + * and, by default, resizes any non-custom input hit area associated with this Zone. + * + * @since 3.0.0 + * + * @param width - The width of this Game Object. + * @param height - The height of this Game Object. + * @param [resizeInput=true] - If this Zone has a Rectangle for a hit area this argument will resize the hit area as well. + * + * @return This Game Object. + */ + setSize(width, height, resizeInput = true) { + this.width = width; + this.height = height; + this.updateDisplayOrigin(); + const input = this.input; + if (resizeInput && input && !input.customHitArea) { + input.hitArea.width = width; + input.hitArea.height = height; + } + return this; + } + /** + * Sets the display size of this Game Object. + * Calling this will adjust the scale. + * + * @since 3.0.0 + * + * @param width - The width of this Game Object. + * @param height - The height of this Game Object. + * + * @return This Game Object. + */ + setDisplaySize(width, height) { + this.displayWidth = width; + this.displayHeight = height; + return this; + } + /** + * Sets this Zone to be a Circular Drop Zone. + * The circle is centered on this Zone's `x` and `y` coordinates. + * + * @since 3.0.0 + * + * @param radius - The radius of the Circle that will form the Drop Zone. + * + * @return This Game Object. + */ + setCircleDropZone(radius) { + return this.setDropZone(new (Circle_default())(0, 0, radius), (Contains_default())); + } + /** + * Sets this Zone to be a Rectangle Drop Zone. + * The rectangle is centered on this Zone's `x` and `y` coordinates. + * + * @since 3.0.0 + * + * @param width - The width of the rectangle drop zone. + * @param height - The height of the rectangle drop zone. + * + * @return This Game Object. + */ + setRectangleDropZone(width, height) { + return this.setDropZone(new Rectangle.Rectangle(0, 0, width, height), rectangle_Contains.Contains); + } + /** + * Enables this Zone as an interactive Drop Zone by calling `setInteractive` with the given + * hit area shape and callback. You can pass any Phaser geometry shape, or a custom shape with + * a matching hit-test callback. If no arguments are provided, a Rectangle matching the size of + * this Zone will be used automatically. Has no effect if this Zone is already interactive. + * + * @since 3.0.0 + * + * @param [hitArea] - A Geometry shape instance, such as Phaser.Geom.Ellipse, or your own custom shape. + * @param [hitAreaCallback] - A function that will return `true` if the given x/y coords it is sent are within the shape. + * + * @return This Game Object. + */ + setDropZone(hitArea, hitAreaCallback) { + if (!this.input) { + this.setInteractive(hitArea, hitAreaCallback, true); + } + return this; + } + /** + * A NOOP method so you can pass a Zone to a Container. + * Calling this method will do nothing. It is intentionally empty. + * + * @method Phaser.GameObjects.Zone#setAlpha + * @private + * @since 3.11.0 + */ + setAlpha() { + } + /** + * A NOOP method so you can pass a Zone to a Container in Canvas. + * Calling this method will do nothing. It is intentionally empty. + * + * @method Phaser.GameObjects.Zone#setBlendMode + * @private + * @since 3.16.2 + */ + setBlendMode() { + } + /** + * A Zone does not render. + * + * @method Phaser.GameObjects.Zone#renderCanvas + * @private + * @since 3.53.0 + * + * @param renderer - A reference to the current active Canvas renderer. + * @param src - The Game Object being rendered in this call. + * @param camera - The Camera that is rendering the Game Object. + */ + renderCanvas(_renderer, src, camera) { + camera.addToRenderList(src); + } + /** + * A Zone does not render. + * + * @method Phaser.GameObjects.Zone#renderWebGL + * @private + * @since 3.53.0 + * + * @param renderer - A reference to the current active WebGL renderer. + * @param src - The Game Object being rendered in this call. + * @param drawingContext - The current drawing context. + */ + renderWebGL(_renderer, src, drawingContext) { + drawingContext.camera.addToRenderList(src); + } +} +(0,Mixin/* applyMixin */.AD)(Zone, (components_default()).GetBounds); +(0,Mixin/* applyMixin */.AD)(Zone, (components_default()).Origin); +(0,Mixin/* applyMixin */.AD)(Zone, (components_default()).ScrollFactor); +(0,Mixin/* applyMixin */.AD)(Zone, (components_default()).Transform); +/* harmony default export */ const zone_Zone = (Zone); + + +/***/ }, + +/***/ 72488 +(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Contains: () => (/* binding */ Contains), +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); + +/** + * @author Richard Davey + * @copyright 2013-2026 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ +function Contains(rect, x, y) { + if (rect.width <= 0 || rect.height <= 0) { + return false; + } + return rect.x <= x && rect.x + rect.width >= x && rect.y <= y && rect.y + rect.height >= y; +} +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Contains); + + +/***/ }, + +/***/ 59428 +(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Rectangle: () => (/* binding */ Rectangle), +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _Contains_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(72488); +/* harmony import */ var _GetPoint_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20812); +/* harmony import */ var _GetPoint_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_GetPoint_js__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _GetPoints_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(34819); +/* harmony import */ var _GetPoints_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_GetPoints_js__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _const_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(23777); +/* harmony import */ var _const_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_const_js__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var _line_Line_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(23031); +/* harmony import */ var _line_Line_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_line_Line_js__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var _Random_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(26597); +/* harmony import */ var _Random_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_Random_js__WEBPACK_IMPORTED_MODULE_5__); + +/** + * @author Richard Davey + * @copyright 2013-2026 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + + + + + + +class Rectangle { + /** + * @param x - The X coordinate of the top left corner of the Rectangle. + * @param y - The Y coordinate of the top left corner of the Rectangle. + * @param width - The width of the Rectangle. + * @param height - The height of the Rectangle. + */ + constructor(x = 0, y = 0, width = 0, height = 0) { + this.type = (_const_js__WEBPACK_IMPORTED_MODULE_3___default().RECTANGLE); + this.x = x; + this.y = y; + this.width = width; + this.height = height; + } + /** + * Checks if the given point is inside the Rectangle's bounds. + * + * @since 3.0.0 + * + * @param x - The X coordinate of the point to check. + * @param y - The Y coordinate of the point to check. + * + * @returns `true` if the point is within the Rectangle's bounds, otherwise `false`. + */ + contains(x, y) { + return (0,_Contains_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, x, y); + } + /** + * Calculates the coordinates of a point at a certain `position` on the Rectangle's perimeter. + * + * The `position` is a fraction between 0 and 1 which defines how far into the perimeter the point is. + * + * A value of 0 or 1 returns the point at the top left corner of the rectangle, while a value of 0.5 + * returns the point at the bottom right corner of the rectangle. Values between 0 and 0.5 are on the + * top or the right side and values between 0.5 and 1 are on the bottom or the left side. + * + * @since 3.0.0 + * + * @param position - The normalized distance into the Rectangle's perimeter to return. + * @param output - A Vector2 instance to update with the `x` and `y` coordinates of the point. + * + * @returns The updated `output` object, or a new Vector2 if no `output` object was given. + */ + getPoint(position, output) { + return _GetPoint_js__WEBPACK_IMPORTED_MODULE_1___default()(this, position, output); + } + /** + * Returns an array of points from the perimeter of the Rectangle, each spaced out based + * on the quantity or step required. + * + * @since 3.0.0 + * + * @param quantity - The number of points to return. Set to `false` or 0 to return an arbitrary + * number of points (`perimeter / stepRate`) evenly spaced around the Rectangle based on the `stepRate`. + * @param stepRate - If `quantity` is 0, determines the normalized distance between each returned point. + * @param output - An array to which to append the points. + * + * @returns The modified `output` array, or a new array if none was provided. + */ + getPoints(quantity, stepRate, output) { + return _GetPoints_js__WEBPACK_IMPORTED_MODULE_2___default()(this, quantity, stepRate, output); + } + /** + * Returns a random point within the Rectangle's bounds. + * + * @since 3.0.0 + * + * @param vec - The object in which to store the `x` and `y` coordinates of the point. + * + * @returns The updated `vec`, or a new Vector2 if none was provided. + */ + getRandomPoint(vec) { + return _Random_js__WEBPACK_IMPORTED_MODULE_5___default()(this, vec); + } + /** + * Sets the position, width, and height of the Rectangle. + * + * @since 3.0.0 + * + * @param x - The X coordinate of the top left corner of the Rectangle. + * @param y - The Y coordinate of the top left corner of the Rectangle. + * @param width - The width of the Rectangle. + * @param height - The height of the Rectangle. + * + * @returns This Rectangle object. + */ + setTo(x, y, width, height) { + this.x = x; + this.y = y; + this.width = width; + this.height = height; + return this; + } + /** + * Resets the position, width, and height of the Rectangle to 0. + * + * @since 3.0.0 + * + * @returns This Rectangle object. + */ + setEmpty() { + return this.setTo(0, 0, 0, 0); + } + /** + * Sets the position of the Rectangle. + * + * @since 3.0.0 + * + * @param x - The X coordinate of the top left corner of the Rectangle. + * @param y - The Y coordinate of the top left corner of the Rectangle. + * + * @returns This Rectangle object. + */ + setPosition(x, y) { + if (y === void 0) { + y = x; + } + this.x = x; + this.y = y; + return this; + } + /** + * Sets the width and height of the Rectangle. + * + * @since 3.0.0 + * + * @param width - The width to set the Rectangle to. + * @param height - The height to set the Rectangle to. + * + * @returns This Rectangle object. + */ + setSize(width, height) { + if (height === void 0) { + height = width; + } + this.width = width; + this.height = height; + return this; + } + /** + * Determines if the Rectangle is empty. A Rectangle is empty if its width or height is less than or equal to 0. + * + * @since 3.0.0 + * + * @returns `true` if the Rectangle is empty, otherwise `false`. + */ + isEmpty() { + return this.width <= 0 || this.height <= 0; + } + /** + * Returns a Line object that corresponds to the top of this Rectangle. + * + * @since 3.0.0 + * + * @param line - A Line object to set the results in. If `undefined` a new Line will be created. + * + * @returns A Line object that corresponds to the top of this Rectangle. + */ + // @ts-expect-error - Line is a JS Class() factory value, not a TypeScript type + getLineA(line) { + if (line === void 0) { + line = new (_line_Line_js__WEBPACK_IMPORTED_MODULE_4___default())(); + } + line.setTo(this.x, this.y, this.right, this.y); + return line; + } + /** + * Returns a Line object that corresponds to the right of this Rectangle. + * + * @since 3.0.0 + * + * @param line - A Line object to set the results in. If `undefined` a new Line will be created. + * + * @returns A Line object that corresponds to the right of this Rectangle. + */ + // @ts-expect-error - Line is a JS Class() factory value, not a TypeScript type + getLineB(line) { + if (line === void 0) { + line = new (_line_Line_js__WEBPACK_IMPORTED_MODULE_4___default())(); + } + line.setTo(this.right, this.y, this.right, this.bottom); + return line; + } + /** + * Returns a Line object that corresponds to the bottom of this Rectangle. + * + * @since 3.0.0 + * + * @param line - A Line object to set the results in. If `undefined` a new Line will be created. + * + * @returns A Line object that corresponds to the bottom of this Rectangle. + */ + // @ts-expect-error - Line is a JS Class() factory value, not a TypeScript type + getLineC(line) { + if (line === void 0) { + line = new (_line_Line_js__WEBPACK_IMPORTED_MODULE_4___default())(); + } + line.setTo(this.right, this.bottom, this.x, this.bottom); + return line; + } + /** + * Returns a Line object that corresponds to the left of this Rectangle. + * + * @since 3.0.0 + * + * @param line - A Line object to set the results in. If `undefined` a new Line will be created. + * + * @returns A Line object that corresponds to the left of this Rectangle. + */ + // @ts-expect-error - Line is a JS Class() factory value, not a TypeScript type + getLineD(line) { + if (line === void 0) { + line = new (_line_Line_js__WEBPACK_IMPORTED_MODULE_4___default())(); + } + line.setTo(this.x, this.bottom, this.x, this.y); + return line; + } + /** + * The x coordinate of the left of the Rectangle. + * Changing the left property of a Rectangle object has no effect on the y and height properties. + * However it does affect the width property, whereas changing the x value does not affect the width property. + * + * @since 3.0.0 + */ + get left() { + return this.x; + } + set left(value) { + if (value >= this.right) { + this.width = 0; + } else { + this.width = this.right - value; + } + this.x = value; + } + /** + * The sum of the x and width properties. + * Changing the right property of a Rectangle object has no effect on the x, y and height properties, + * however it does affect the width property. + * + * @since 3.0.0 + */ + get right() { + return this.x + this.width; + } + set right(value) { + if (value <= this.x) { + this.width = 0; + } else { + this.width = value - this.x; + } + } + /** + * The y coordinate of the top of the Rectangle. Changing the top property of a Rectangle object has no + * effect on the x and width properties. However it does affect the height property, whereas changing + * the y value does not affect the height property. + * + * @since 3.0.0 + */ + get top() { + return this.y; + } + set top(value) { + if (value >= this.bottom) { + this.height = 0; + } else { + this.height = this.bottom - value; + } + this.y = value; + } + /** + * The sum of the y and height properties. + * Changing the bottom property of a Rectangle object has no effect on the x, y and width properties, + * but does change the height property. + * + * @since 3.0.0 + */ + get bottom() { + return this.y + this.height; + } + set bottom(value) { + if (value <= this.y) { + this.height = 0; + } else { + this.height = value - this.y; + } + } + /** + * The x coordinate of the center of the Rectangle. + * + * @since 3.0.0 + */ + get centerX() { + return this.x + this.width / 2; + } + set centerX(value) { + this.x = value - this.width / 2; + } + /** + * The y coordinate of the center of the Rectangle. + * + * @since 3.0.0 + */ + get centerY() { + return this.y + this.height / 2; + } + set centerY(value) { + this.y = value - this.height / 2; + } +} +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Rectangle); + + +/***/ }, + +/***/ 350 +(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* unused harmony export Clamp */ + +/** + * @author Richard Davey + * @copyright 2013-2026 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ +function Clamp(value, min, max) { + return Math.max(min, Math.min(max, value)); +} +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Clamp); + + +/***/ }, + +/***/ 70038 +(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* unused harmony export Vector2 */ +/* harmony import */ var _fuzzy_Equal_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(30010); + +/** + * @author Richard Davey + * @copyright 2013-2026 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +const _Vector2 = class _Vector2 { + /** + * @param x - The x component, or an object with `x` and `y` properties. + * @param y - The y component. + */ + constructor(x, y) { + this.x = 0; + this.y = 0; + if (typeof x === "object") { + this.x = x.x || 0; + this.y = x.y || 0; + } else { + if (y === void 0) { + y = x; + } + this.x = x || 0; + this.y = y || 0; + } + } + /** + * Make a clone of this Vector2. + * + * @since 3.0.0 + * + * @returns A clone of this Vector2. + */ + clone() { + return new _Vector2(this.x, this.y); + } + /** + * Copy the components of a given Vector into this Vector. + * + * @since 3.0.0 + * + * @param src - The Vector to copy the components from. + * @returns This Vector2. + */ + copy(src) { + this.x = src.x || 0; + this.y = src.y || 0; + return this; + } + /** + * Set the component values of this Vector from a given Vector2Like object. + * + * @since 3.0.0 + * + * @param obj - The object containing the component values to set for this Vector. + * @returns This Vector2. + */ + setFromObject(obj) { + this.x = obj.x || 0; + this.y = obj.y || 0; + return this; + } + /** + * Set the `x` and `y` components of this Vector to the given `x` and `y` values. + * + * @since 3.0.0 + * + * @param x - The x value to set for this Vector. + * @param y - The y value to set for this Vector. + * @returns This Vector2. + */ + set(x, y) { + if (y === void 0) { + y = x; + } + this.x = x; + this.y = y; + return this; + } + /** + * This method is an alias for `Vector2.set`. + * + * @since 3.4.0 + * + * @param x - The x value to set for this Vector. + * @param y - The y value to set for this Vector. + * @returns This Vector2. + */ + setTo(x, y) { + return this.set(x, y); + } + /** + * Runs the x and y components of this Vector2 through Math.ceil and then sets them. + * + * @since 4.0.0 + * + * @returns This Vector2. + */ + ceil() { + this.x = Math.ceil(this.x); + this.y = Math.ceil(this.y); + return this; + } + /** + * Runs the x and y components of this Vector2 through Math.floor and then sets them. + * + * @since 4.0.0 + * + * @returns This Vector2. + */ + floor() { + this.x = Math.floor(this.x); + this.y = Math.floor(this.y); + return this; + } + /** + * Swaps the x and y components of this Vector2. + * + * @since 4.0.0 + * + * @returns This Vector2. + */ + invert() { + return this.set(this.y, this.x); + } + /** + * Sets the x and y components of this Vector from the given angle and length. + * + * @since 3.0.0 + * + * @param angle - The angle from the positive x-axis, in radians. + * @param length - The distance from the origin. + * @returns This Vector2. + */ + setToPolar(angle, length) { + if (length === null || length === void 0) { + length = 1; + } + this.x = Math.cos(angle) * length; + this.y = Math.sin(angle) * length; + return this; + } + /** + * Check whether this Vector is equal to a given Vector. + * + * Performs a strict equality check against each Vector's components. + * + * @since 3.0.0 + * + * @param v - The vector to compare with this Vector. + * @returns Whether the given Vector is equal to this Vector. + */ + equals(v) { + return this.x === v.x && this.y === v.y; + } + /** + * Check whether this Vector is approximately equal to a given Vector. + * + * @since 3.23.0 + * + * @param v - The vector to compare with this Vector. + * @param epsilon - The tolerance value. + * @returns Whether both absolute differences of the x and y components are smaller than `epsilon`. + */ + fuzzyEquals(v, epsilon) { + return (0,_fuzzy_Equal_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this.x, v.x, epsilon) && (0,_fuzzy_Equal_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this.y, v.y, epsilon); + } + /** + * Calculate the angle between this Vector and the positive x-axis, in radians. + * + * @since 3.0.0 + * + * @returns The angle between this Vector, and the positive x-axis, given in radians. + */ + angle() { + let angle = Math.atan2(this.y, this.x); + if (angle < 0) { + angle += 2 * Math.PI; + } + return angle; + } + /** + * Set the angle of this Vector. + * + * @since 3.23.0 + * + * @param angle - The angle, in radians. + * @returns This Vector2. + */ + setAngle(angle) { + return this.setToPolar(angle, this.length()); + } + /** + * Add a given Vector to this Vector. Addition is component-wise. + * + * @since 3.0.0 + * + * @param src - The Vector to add to this Vector. + * @returns This Vector2. + */ + add(src) { + this.x += src.x; + this.y += src.y; + return this; + } + /** + * Subtract the given Vector from this Vector. Subtraction is component-wise. + * + * @since 3.0.0 + * + * @param src - The Vector to subtract from this Vector. + * @returns This Vector2. + */ + subtract(src) { + this.x -= src.x; + this.y -= src.y; + return this; + } + /** + * Perform a component-wise multiplication between this Vector and the given Vector. + * + * Multiplies this Vector by the given Vector. + * + * @since 3.0.0 + * + * @param src - The Vector to multiply this Vector by. + * @returns This Vector2. + */ + multiply(src) { + this.x *= src.x; + this.y *= src.y; + return this; + } + /** + * Scale this Vector by the given value. + * + * @since 3.0.0 + * + * @param value - The value to scale this Vector by. + * @returns This Vector2. + */ + scale(value) { + if (isFinite(value)) { + this.x *= value; + this.y *= value; + } else { + this.x = 0; + this.y = 0; + } + return this; + } + /** + * Perform a component-wise division between this Vector and the given Vector. + * + * Divides this Vector by the given Vector. + * + * @since 3.0.0 + * + * @param src - The Vector to divide this Vector by. + * @returns This Vector2. + */ + divide(src) { + this.x /= src.x; + this.y /= src.y; + return this; + } + /** + * Negate the `x` and `y` components of this Vector. + * + * @since 3.0.0 + * + * @returns This Vector2. + */ + negate() { + this.x = -this.x; + this.y = -this.y; + return this; + } + /** + * Calculate the distance between this Vector and the given Vector. + * + * @since 3.0.0 + * + * @param src - The Vector to calculate the distance to. + * @returns The distance from this Vector to the given Vector. + */ + distance(src) { + const dx = src.x - this.x; + const dy = src.y - this.y; + return Math.sqrt(dx * dx + dy * dy); + } + /** + * Calculate the distance between this Vector and the given Vector, squared. + * + * @since 3.0.0 + * + * @param src - The Vector to calculate the distance to. + * @returns The distance from this Vector to the given Vector, squared. + */ + distanceSq(src) { + const dx = src.x - this.x; + const dy = src.y - this.y; + return dx * dx + dy * dy; + } + /** + * Calculate the length (or magnitude) of this Vector. + * + * @since 3.0.0 + * + * @returns The length of this Vector. + */ + length() { + const x = this.x; + const y = this.y; + return Math.sqrt(x * x + y * y); + } + /** + * Set the length (or magnitude) of this Vector. + * + * @since 3.23.0 + * + * @param length - The new magnitude of this Vector. + * @returns This Vector2. + */ + setLength(length) { + return this.normalize().scale(length); + } + /** + * Calculate the length of this Vector squared. + * + * @since 3.0.0 + * + * @returns The length of this Vector, squared. + */ + lengthSq() { + const x = this.x; + const y = this.y; + return x * x + y * y; + } + /** + * Normalize this Vector. + * + * Makes the vector a unit length vector (magnitude of 1) in the same direction. + * + * @since 3.0.0 + * + * @returns This Vector2. + */ + normalize() { + const x = this.x; + const y = this.y; + let len = x * x + y * y; + if (len > 0) { + len = 1 / Math.sqrt(len); + this.x = x * len; + this.y = y * len; + } + return this; + } + /** + * Rotate this Vector to its perpendicular, in the positive direction. + * + * @since 3.0.0 + * + * @returns This Vector2. + */ + normalizeRightHand() { + const x = this.x; + this.x = this.y * -1; + this.y = x; + return this; + } + /** + * Rotate this Vector to its perpendicular, in the negative direction. + * + * @since 3.23.0 + * + * @returns This Vector2. + */ + normalizeLeftHand() { + const x = this.x; + this.x = this.y; + this.y = x * -1; + return this; + } + /** + * Calculate the dot product of this Vector and the given Vector. + * + * @since 3.0.0 + * + * @param src - The Vector2 to dot product with this Vector2. + * @returns The dot product of this Vector and the given Vector. + */ + dot(src) { + return this.x * src.x + this.y * src.y; + } + /** + * Calculate the cross product of this Vector and the given Vector. + * + * @since 3.0.0 + * + * @param src - The Vector2 to cross with this Vector2. + * @returns The cross product of this Vector and the given Vector. + */ + cross(src) { + return this.x * src.y - this.y * src.x; + } + /** + * Linearly interpolate between this Vector and the given Vector. + * + * Interpolates this Vector towards the given Vector. + * + * @since 3.0.0 + * + * @param src - The Vector2 to interpolate towards. + * @param t - The interpolation percentage, between 0 and 1. + * @returns This Vector2. + */ + lerp(src, t = 0) { + const ax = this.x; + const ay = this.y; + this.x = ax + t * (src.x - ax); + this.y = ay + t * (src.y - ay); + return this; + } + /** + * Transform this Vector with the given Matrix3. + * + * @since 3.0.0 + * + * @param mat - The Matrix3 to transform this Vector2 with. + * @returns This Vector2. + */ + transformMat3(mat) { + const x = this.x; + const y = this.y; + const m = mat.val; + this.x = m[0] * x + m[3] * y + m[6]; + this.y = m[1] * x + m[4] * y + m[7]; + return this; + } + /** + * Transform this Vector with the given Matrix4. + * + * @since 3.0.0 + * + * @param mat - The Matrix4 to transform this Vector2 with. + * @returns This Vector2. + */ + transformMat4(mat) { + const x = this.x; + const y = this.y; + const m = mat.val; + this.x = m[0] * x + m[4] * y + m[12]; + this.y = m[1] * x + m[5] * y + m[13]; + return this; + } + /** + * Make this Vector the zero vector (0, 0). + * + * @since 3.0.0 + * + * @returns This Vector2. + */ + reset() { + this.x = 0; + this.y = 0; + return this; + } + /** + * Limit the length (or magnitude) of this Vector. + * + * @since 3.23.0 + * + * @param max - The maximum length. + * @returns This Vector2. + */ + limit(max) { + const len = this.length(); + if (len && len > max) { + this.scale(max / len); + } + return this; + } + /** + * Reflect this Vector off a line defined by a normal. + * + * @since 3.23.0 + * + * @param normal - A vector perpendicular to the line. + * @returns This Vector2. + */ + reflect(normal) { + const n = normal.clone().normalize(); + return this.subtract(n.scale(2 * this.dot(n))); + } + /** + * Reflect this Vector across another. + * + * @since 3.23.0 + * + * @param axis - A vector to reflect across. + * @returns This Vector2. + */ + mirror(axis) { + return this.reflect(axis).negate(); + } + /** + * Rotate this Vector by an angle amount. + * + * @since 3.23.0 + * + * @param delta - The angle to rotate by, in radians. + * @returns This Vector2. + */ + rotate(delta) { + const cos = Math.cos(delta); + const sin = Math.sin(delta); + return this.set(cos * this.x - sin * this.y, sin * this.x + cos * this.y); + } + /** + * Project this Vector onto another. + * + * @since 3.60.0 + * + * @param src - The vector to project onto. + * @returns This Vector2. + */ + project(src) { + const scalar = this.dot(src) / src.dot(src); + return this.copy(src).scale(scalar); + } + /** + * Calculates the vector projection of this Vector2 onto the non-zero `vecB`. This is the + * orthogonal projection of this vector onto a straight line parallel to `vecB`. + * + * @since 4.0.0 + * + * @param vecB - The vector to project onto. + * @param out - The Vector2 object to store the position in. If not given, a new Vector2 instance is created. + * @returns The `out` Vector2 containing the projected values. + */ + projectUnit(vecB, out) { + if (out === void 0) { + out = new _Vector2(); + } + const amt = this.x * vecB.x + this.y * vecB.y; + if (amt !== 0) { + out.x = amt * vecB.x; + out.y = amt * vecB.y; + } + return out; + } +}; +/** + * A static zero Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @since 3.1.0 + */ +_Vector2.ZERO = new _Vector2(); +/** + * A static right Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @since 3.16.0 + */ +_Vector2.RIGHT = new _Vector2(1, 0); +/** + * A static left Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @since 3.16.0 + */ +_Vector2.LEFT = new _Vector2(-1, 0); +/** + * A static up Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @since 3.16.0 + */ +_Vector2.UP = new _Vector2(0, -1); +/** + * A static down Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @since 3.16.0 + */ +_Vector2.DOWN = new _Vector2(0, 1); +/** + * A static one Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @since 3.16.0 + */ +_Vector2.ONE = new _Vector2(1, 1); +let Vector2 = _Vector2; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Vector2); + + +/***/ }, + +/***/ 68077 +(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* unused harmony export Wrap */ + +/** + * @author Richard Davey + * @copyright 2013-2026 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ +function Wrap(value, min, max) { + const range = max - min; + return min + ((value - min) % range + range) % range; +} +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Wrap); + + +/***/ }, + +/***/ 30010 +(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* unused harmony export Equal */ + +/** + * @author Richard Davey + * @copyright 2013-2026 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ +function Equal(a, b, epsilon = 1e-4) { + return Math.abs(a - b) < epsilon; +} +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Equal); + + +/***/ }, + +/***/ 60269 +(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; + +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + "default": () => (/* binding */ structs_Map) +}); + +// UNUSED EXPORTS: Map + +;// ./utils/object/TypedObjectUtils.ts + +function objectKeys(obj) { + return Object.keys(obj); +} + +;// ./structs/Map.ts + +/** + * @author Richard Davey + * @copyright 2013-2026 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +class Map { + /** + * @param elements - An optional array of key-value pairs to populate this Map with. + */ + constructor(elements) { + this.entries = {}; + this.size = 0; + this.setAll(elements); + } + /** + * Adds all the elements in the given array to this Map. + * + * If the key already exists, the value will be replaced. + * + * @since 3.70.0 + * + * @param elements - An array of key-value pairs to populate this Map with. + * @returns This Map object. + */ + setAll(elements) { + if (Array.isArray(elements)) { + for (let i = 0; i < elements.length; i++) { + this.set(elements[i][0], elements[i][1]); + } + } + return this; + } + /** + * Adds an element with a specified `key` and `value` to this Map. + * + * If the `key` already exists, the value will be replaced. + * + * If you wish to add multiple elements in a single call, use the `setAll` method instead. + * + * @since 3.0.0 + * + * @param key - The key of the element to be added to this Map. + * @param value - The value of the element to be added to this Map. + * @returns This Map object. + */ + set(key, value) { + if (!this.has(key)) { + this.size++; + } + this.entries[key] = value; + return this; + } + /** + * Returns the value associated to the `key`, or `undefined` if there is none. + * + * @since 3.0.0 + * + * @param key - The key of the element to return from the `Map` object. + * @returns The element associated with the specified key or `undefined` if the key can't be found in this Map object. + */ + get(key) { + if (this.has(key)) { + return this.entries[key]; + } + } + /** + * Returns an `Array` of all the values stored in this Map. + * + * @since 3.0.0 + * + * @returns An array of the values stored in this Map. + */ + getArray() { + const output = []; + const entries = this.entries; + for (const key of objectKeys(entries)) { + output.push(entries[key]); + } + return output; + } + /** + * Returns a boolean indicating whether an element with the specified key exists or not. + * + * @since 3.0.0 + * + * @param key - The key of the element to test for presence of in this Map. + * @returns Returns `true` if an element with the specified key exists in this Map, otherwise `false`. + */ + has(key) { + return this.entries.hasOwnProperty(key); + } + /** + * Delete the specified element from this Map. + * + * @since 3.0.0 + * + * @param key - The key of the element to delete from this Map. + * @returns This Map object. + */ + delete(key) { + if (this.has(key)) { + delete this.entries[key]; + this.size--; + } + return this; + } + /** + * Delete all entries from this Map. + * + * @since 3.0.0 + * + * @returns This Map object. + */ + clear() { + for (const prop of objectKeys(this.entries)) { + delete this.entries[prop]; + } + this.size = 0; + return this; + } + /** + * Returns an array of all entry keys in this Map. + * + * @since 3.0.0 + * + * @returns Array containing entries' keys. + */ + keys() { + return objectKeys(this.entries); + } + /** + * Returns an `Array` of all values stored in this Map. + * + * @since 3.0.0 + * + * @returns An `Array` of values. + */ + values() { + const output = []; + const entries = this.entries; + for (const key of objectKeys(entries)) { + output.push(entries[key]); + } + return output; + } + /** + * Dumps the contents of this Map to the console via `console.group`. + * + * @since 3.0.0 + */ + dump() { + const entries = this.entries; + console.group("Map"); + for (const key of objectKeys(entries)) { + console.log(key, entries[key]); + } + console.groupEnd(); + } + /** + * Iterates through all entries in this Map, passing each one to the given callback. + * + * If the callback returns `false`, the iteration will break. + * + * @since 3.0.0 + * + * @param callback - The callback which will receive the keys and entries held in this Map. + * @returns This Map object. + */ + each(callback) { + const entries = this.entries; + for (const key of objectKeys(entries)) { + if (callback(key, entries[key]) === false) { + break; + } + } + return this; + } + /** + * Returns `true` if the value exists within this Map. Otherwise, returns `false`. + * + * @since 3.0.0 + * + * @param value - The value to search for. + * @returns `true` if the value is found, otherwise `false`. + */ + contains(value) { + const entries = this.entries; + for (const key of objectKeys(entries)) { + if (entries[key] === value) { + return true; + } + } + return false; + } + /** + * Merges all new keys from the given Map into this one. + * If it encounters a key that already exists it will be skipped unless override is set to `true`. + * + * @since 3.0.0 + * + * @param map - The Map to merge in to this Map. + * @param override - Set to `true` to replace values in this Map with those from the source map, or `false` to skip them. + * @returns This Map object. + */ + merge(map, override = false) { + const local = this.entries; + const source = map.entries; + for (const key of objectKeys(source)) { + if (local.hasOwnProperty(key) && override) { + local[key] = source[key]; + } else { + this.set(key, source[key]); + } + } + return this; + } +} +/* harmony default export */ const structs_Map = (Map); + + +/***/ }, + +/***/ 42969 +(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ AD: () => (/* binding */ applyMixin), +/* harmony export */ fP: () => (/* binding */ composeMixins), +/* harmony export */ lv: () => (/* binding */ defineMixin) +/* harmony export */ }); + +function isAccessorDescriptor(value) { + if (value === null || typeof value !== "object") { + return false; + } + const record = value; + return typeof record.get === "function" || typeof record.set === "function"; +} +function applyMixin(target, mixin) { + for (const key of Object.keys(mixin)) { + const value = mixin[key]; + if (isAccessorDescriptor(value)) { + Object.defineProperty(target.prototype, key, { + get: value.get, + set: value.set, + enumerable: true, + configurable: true + }); + } else { + Object.defineProperty(target.prototype, key, { + value, + writable: true, + enumerable: false, + configurable: true + }); + } + } +} +function defineMixin() { + return function(fn) { + return fn; + }; +} +function composeMixins(...mixins) { + return ((Base) => mixins.reduce((Current, mixin) => mixin(Current), Base)); +} + + +/***/ }, + /***/ 50792 (module) { @@ -33325,8 +35135,6 @@ var Blur = new Class({ Controller.call(this, camera, 'FilterBlur'); - // TODO: @GN suggests altering `boundedSampler` to better support full-screen effects where we don't want transparent borders. - /** * The quality of the blur effect. * @@ -42781,7 +44589,7 @@ var BitmapText = new Class({ */ displayWidth: { - set: function(value) + set: function (value) { this.setScaleX(1); @@ -42813,7 +44621,7 @@ var BitmapText = new Class({ */ displayHeight: { - set: function(value) + set: function (value) { this.setScaleY(1); @@ -45852,196 +47660,11 @@ module.exports = Crop; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -/** - * Provides methods used for setting the depth of a Game Object. - * Should be applied as a mixin and not used directly. - * - * @namespace Phaser.GameObjects.Components.Depth - * @since 3.0.0 - */ - -var ArrayUtils = __webpack_require__(37105); - -var Depth = { - - /** - * Private internal value. Holds the depth of the Game Object. - * - * @name Phaser.GameObjects.Components.Depth#_depth - * @type {number} - * @private - * @default 0 - * @since 3.0.0 - */ - _depth: 0, - - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * - * @name Phaser.GameObjects.Components.Depth#depth - * @type {number} - * @since 3.0.0 - */ - depth: { - - get: function () - { - return this._depth; - }, - - set: function (value) - { - if (this.displayList) - { - this.displayList.queueDepthSort(); - } - - this._depth = value; - } - - }, - - /** - * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * A Game Object with a higher depth value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * - * @method Phaser.GameObjects.Components.Depth#setDepth - * @since 3.0.0 - * - * @param {number} value - The depth of this Game Object. Ensure this value is only ever a number data-type. - * - * @return {this} This Game Object instance. - */ - setDepth: function (value) - { - if (value === undefined) { value = 0; } - - this.depth = value; - - return this; - }, - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * - * @method Phaser.GameObjects.Components.Depth#setToTop - * @since 3.85.0 - * - * @return {this} This Game Object instance. - */ - setToTop: function () - { - var list = this.getDisplayList(); - - if (list) - { - ArrayUtils.BringToTop(list, this); - } - - return this; - }, - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * - * @method Phaser.GameObjects.Components.Depth#setToBack - * @since 3.85.0 - * - * @return {this} This Game Object instance. - */ - setToBack: function () - { - var list = this.getDisplayList(); - - if (list) - { - ArrayUtils.SendToBack(list, this); - } - - return this; - }, - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * - * @method Phaser.GameObjects.Components.Depth#setAbove - * @since 3.85.0 - * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that this Game Object will be moved to be above. - * - * @return {this} This Game Object instance. - */ - setAbove: function (gameObject) - { - var list = this.getDisplayList(); - - if (list && gameObject) - { - ArrayUtils.MoveAbove(list, this, gameObject); - } - - return this; - }, - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * - * @method Phaser.GameObjects.Components.Depth#setBelow - * @since 3.85.0 - * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that this Game Object will be moved to be below. - * - * @return {this} This Game Object instance. - */ - setBelow: function (gameObject) - { - var list = this.getDisplayList(); - - if (list && gameObject) - { - ArrayUtils.MoveBelow(list, this, gameObject); - } - - return this; - } - -}; - -module.exports = Depth; +// CJS compatibility wrapper — consumed by Class() factory Mixins arrays during the +// hybrid JS/TS migration period. Remove once all callers are TypeScript. +const mod = __webpack_require__(7889); +module.exports = mod.DepthDescriptors; +Object.defineProperty(module.exports, "Depth", ({ value: mod.Depth })); /***/ }, @@ -52501,7 +54124,7 @@ module.exports = TransformMatrix; /***/ }, /***/ 59715 -(module) { +(module, __unused_webpack_exports, __webpack_require__) { /** * @author Richard Davey @@ -52509,87 +54132,11 @@ module.exports = TransformMatrix; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -// bitmask flag for GameObject.renderMask -var _FLAG = 1; // 0001 - -/** - * Provides methods used for setting the visibility of a Game Object. - * The Visible component is mixed into Game Objects to give them a `visible` boolean property - * and a `setVisible` method. Visibility is tracked via a bitmask flag on `renderFlags`, so - * toggling it is a fast bitwise operation. An invisible Game Object is excluded from the - * render pass entirely, but its `update` logic continues to run normally each frame. - * Should be applied as a mixin and not used directly. - * - * @namespace Phaser.GameObjects.Components.Visible - * @since 3.0.0 - */ - -var Visible = { - - /** - * Private internal value. Holds the visible value. - * - * @name Phaser.GameObjects.Components.Visible#_visible - * @type {boolean} - * @private - * @default true - * @since 3.0.0 - */ - _visible: true, - - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * - * @name Phaser.GameObjects.Components.Visible#visible - * @type {boolean} - * @since 3.0.0 - */ - visible: { - - get: function () - { - return this._visible; - }, - - set: function (value) - { - if (value) - { - this._visible = true; - this.renderFlags |= _FLAG; - } - else - { - this._visible = false; - this.renderFlags &= ~_FLAG; - } - } - - }, - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * - * @method Phaser.GameObjects.Components.Visible#setVisible - * @since 3.0.0 - * - * @param {boolean} value - The visible state of the Game Object. - * - * @return {this} This Game Object instance. - */ - setVisible: function (value) - { - this.visible = value; - - return this; - } -}; - -module.exports = Visible; +// CJS compatibility wrapper — consumed by Class() factory Mixins arrays during the +// hybrid JS/TS migration period. Remove once all callers are TypeScript. +const mod = __webpack_require__(36626); +module.exports = mod.VisibleDescriptors; +Object.defineProperty(module.exports, "Visible", ({ value: mod.Visible })); /***/ }, @@ -52608,7 +54155,6 @@ module.exports = Visible; */ module.exports = { - Alpha: __webpack_require__(16005), AlphaSingle: __webpack_require__(88509), BlendMode: __webpack_require__(90065), @@ -65598,155 +67144,7 @@ module.exports = { /***/ 82513 (module, __unused_webpack_exports, __webpack_require__) { -/** - * @author Richard Davey - * @copyright 2013-2026 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(83419); -var Vector2 = __webpack_require__(26099); - -/** - * @classdesc - * Represents a single vertex within a NineSlice Game Object. - * - * A NineSlice Game Object is divided into a 3x3 grid of regions, each defined by a mesh - * of vertices. This class stores all the data needed for one vertex: its normalized position - * (x, y inherited from Vector2), its projected screen-space position (vx, vy), and its - * UV texture coordinates (u, v) used during rendering. - * - * You do not typically create NineSliceVertex instances directly. They are created and - * managed internally by the NineSlice Game Object. - * - * @class NineSliceVertex - * @memberof Phaser.GameObjects - * @constructor - * @extends Phaser.Math.Vector2 - * @since 4.0.0 - * - * @param {number} x - The x position of the vertex. - * @param {number} y - The y position of the vertex. - * @param {number} u - The UV u coordinate of the vertex. - * @param {number} v - The UV v coordinate of the vertex. - */ -var Vertex = new Class({ - - Extends: Vector2, - - initialize: - - function Vertex (x, y, u, v) - { - Vector2.call(this, x, y); - - /** - * The projected x coordinate of this vertex. - * - * @name Phaser.GameObjects.NineSliceVertex#vx - * @type {number} - * @since 4.0.0 - */ - this.vx = 0; - - /** - * The projected y coordinate of this vertex. - * - * @name Phaser.GameObjects.NineSliceVertex#vy - * @type {number} - * @since 4.0.0 - */ - this.vy = 0; - - /** - * UV u coordinate of this vertex. - * - * @name Phaser.GameObjects.NineSliceVertex#u - * @type {number} - * @since 4.0.0 - */ - this.u = u; - - /** - * UV v coordinate of this vertex. - * - * @name Phaser.GameObjects.NineSliceVertex#v - * @type {number} - * @since 4.0.0 - */ - this.v = v; - }, - - /** - * Sets the UV texture coordinates of this vertex. - * - * @method Phaser.GameObjects.NineSliceVertex#setUVs - * @since 4.0.0 - * - * @param {number} u - The UV u coordinate of the vertex. - * @param {number} v - The UV v coordinate of the vertex. - * - * @return {this} This Vertex. - */ - setUVs: function (u, v) - { - this.u = u; - this.v = v; - - return this; - }, - - /** - * Updates this vertex's position and calculates its projected screen-space coordinates. - * - * Sets the normalized `x` and `y` position, then scales them by the parent object's - * `width` and `height` to produce the projected `vx` and `vy` values. The origin - * offset of the parent object is then factored in, shifting `vx` and `vy` so that the - * mesh is correctly aligned relative to the object's origin point. - * - * @method Phaser.GameObjects.NineSliceVertex#resize - * @since 4.0.0 - * - * @param {number} x - The x position of the vertex. - * @param {number} y - The y position of the vertex. - * @param {number} width - The width of the parent object. - * @param {number} height - The height of the parent object. - * @param {number} originX - The originX of the parent object. - * @param {number} originY - The originY of the parent object. - * - * @return {this} This Vertex. - */ - resize: function (x, y, width, height, originX, originY) - { - this.x = x; - this.y = y; - - this.vx = this.x * width; - this.vy = -this.y * height; - - if (originX < 0.5) - { - this.vx += width * (0.5 - originX); - } - else if (originX > 0.5) - { - this.vx -= width * (originX - 0.5); - } - - if (originY < 0.5) - { - this.vy += height * (0.5 - originY); - } - else if (originY > 0.5) - { - this.vy -= height * (originY - 0.5); - } - - return this; - } -}); - -module.exports = Vertex; +module.exports = __webpack_require__(18134)["default"]; /***/ }, @@ -97327,316 +98725,10 @@ module.exports = VideoWebGLRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BlendModes = __webpack_require__(10312); -var Circle = __webpack_require__(96503); -var CircleContains = __webpack_require__(87902); -var Class = __webpack_require__(83419); -var Components = __webpack_require__(31401); -var GameObject = __webpack_require__(95643); -var Rectangle = __webpack_require__(87841); -var RectangleContains = __webpack_require__(37303); - -/** - * @classdesc - * A Zone is a non-rendering rectangular Game Object that has a position and size but no texture. - * It never displays visually, but it does live on the display list and can be moved, scaled, - * and rotated like any other Game Object. - * - * Its primary use is for creating Drop Zones and Input Hit Areas. It provides helper methods for - * both circular and rectangular drop zones, and can also accept custom geometry shapes. Zones are - * also useful for object overlap checks, or as a base class for your own non-displaying Game Objects. - * - * The default origin is 0.5, placing it at the center of the Zone, consistent with other Game Objects. - * - * @class Zone - * @extends Phaser.GameObjects.GameObject - * @memberof Phaser.GameObjects - * @constructor - * @since 3.0.0 - * - * @extends Phaser.GameObjects.Components.Depth - * @extends Phaser.GameObjects.Components.GetBounds - * @extends Phaser.GameObjects.Components.Origin - * @extends Phaser.GameObjects.Components.Transform - * @extends Phaser.GameObjects.Components.ScrollFactor - * @extends Phaser.GameObjects.Components.Visible - * - * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. - * @param {number} x - The horizontal position of this Game Object in the world. - * @param {number} y - The vertical position of this Game Object in the world. - * @param {number} [width=1] - The width of the Game Object. - * @param {number} [height=1] - The height of the Game Object. - */ -var Zone = new Class({ - - Extends: GameObject, - - Mixins: [ - Components.Depth, - Components.GetBounds, - Components.Origin, - Components.Transform, - Components.ScrollFactor, - Components.Visible - ], - - initialize: - - function Zone (scene, x, y, width, height) - { - if (width === undefined) { width = 1; } - if (height === undefined) { height = width; } - - GameObject.call(this, scene, 'Zone'); - - this.setPosition(x, y); - - /** - * The native (un-scaled) width of this Game Object. - * - * @name Phaser.GameObjects.Zone#width - * @type {number} - * @since 3.0.0 - */ - this.width = width; - - /** - * The native (un-scaled) height of this Game Object. - * - * @name Phaser.GameObjects.Zone#height - * @type {number} - * @since 3.0.0 - */ - this.height = height; - - /** - * The Blend Mode of the Game Object. - * Although a Zone never renders, it still has a blend mode to allow it to fit seamlessly into - * display lists without causing a batch flush. - * - * @name Phaser.GameObjects.Zone#blendMode - * @type {number} - * @since 3.0.0 - */ - this.blendMode = BlendModes.NORMAL; - - this.updateDisplayOrigin(); - }, - - /** - * The displayed width of this Game Object. - * This value takes into account the scale factor. - * - * @name Phaser.GameObjects.Zone#displayWidth - * @type {number} - * @since 3.0.0 - */ - displayWidth: { - - get: function () - { - return this.scaleX * this.width; - }, - - set: function (value) - { - this.scaleX = value / this.width; - } - - }, - - /** - * The displayed height of this Game Object. - * This value takes into account the scale factor. - * - * @name Phaser.GameObjects.Zone#displayHeight - * @type {number} - * @since 3.0.0 - */ - displayHeight: { - - get: function () - { - return this.scaleY * this.height; - }, - - set: function (value) - { - this.scaleY = value / this.height; - } - - }, - - /** - * Sets the native (un-scaled) width and height of this Zone. Also updates the display origin - * and, by default, resizes any non-custom input hit area associated with this Zone. - * - * @method Phaser.GameObjects.Zone#setSize - * @since 3.0.0 - * - * @param {number} width - The width of this Game Object. - * @param {number} height - The height of this Game Object. - * @param {boolean} [resizeInput=true] - If this Zone has a Rectangle for a hit area this argument will resize the hit area as well. - * - * @return {this} This Game Object. - */ - setSize: function (width, height, resizeInput) - { - if (resizeInput === undefined) { resizeInput = true; } - - this.width = width; - this.height = height; - - this.updateDisplayOrigin(); - - var input = this.input; - - if (resizeInput && input && !input.customHitArea) - { - input.hitArea.width = width; - input.hitArea.height = height; - } - - return this; - }, - - /** - * Sets the display size of this Game Object. - * Calling this will adjust the scale. - * - * @method Phaser.GameObjects.Zone#setDisplaySize - * @since 3.0.0 - * - * @param {number} width - The width of this Game Object. - * @param {number} height - The height of this Game Object. - * - * @return {this} This Game Object. - */ - setDisplaySize: function (width, height) - { - this.displayWidth = width; - this.displayHeight = height; - - return this; - }, - - /** - * Sets this Zone to be a Circular Drop Zone. - * The circle is centered on this Zone's `x` and `y` coordinates. - * - * @method Phaser.GameObjects.Zone#setCircleDropZone - * @since 3.0.0 - * - * @param {number} radius - The radius of the Circle that will form the Drop Zone. - * - * @return {this} This Game Object. - */ - setCircleDropZone: function (radius) - { - return this.setDropZone(new Circle(0, 0, radius), CircleContains); - }, - - /** - * Sets this Zone to be a Rectangle Drop Zone. - * The rectangle is centered on this Zone's `x` and `y` coordinates. - * - * @method Phaser.GameObjects.Zone#setRectangleDropZone - * @since 3.0.0 - * - * @param {number} width - The width of the rectangle drop zone. - * @param {number} height - The height of the rectangle drop zone. - * - * @return {this} This Game Object. - */ - setRectangleDropZone: function (width, height) - { - return this.setDropZone(new Rectangle(0, 0, width, height), RectangleContains); - }, - - /** - * Enables this Zone as an interactive Drop Zone by calling `setInteractive` with the given - * hit area shape and callback. You can pass any Phaser geometry shape, or a custom shape with - * a matching hit-test callback. If no arguments are provided, a Rectangle matching the size of - * this Zone will be used automatically. Has no effect if this Zone is already interactive. - * - * @method Phaser.GameObjects.Zone#setDropZone - * @since 3.0.0 - * - * @param {object} [hitArea] - A Geometry shape instance, such as Phaser.Geom.Ellipse, or your own custom shape. If not given it will try to create a Rectangle based on the size of this zone. - * @param {Phaser.Types.Input.HitAreaCallback} [hitAreaCallback] - A function that will return `true` if the given x/y coords it is sent are within the shape. If you provide a shape you must also provide a callback. - * - * @return {this} This Game Object. - */ - setDropZone: function (hitArea, hitAreaCallback) - { - if (!this.input) - { - this.setInteractive(hitArea, hitAreaCallback, true); - } - - return this; - }, - - /** - * A NOOP method so you can pass a Zone to a Container. - * Calling this method will do nothing. It is intentionally empty. - * - * @method Phaser.GameObjects.Zone#setAlpha - * @private - * @since 3.11.0 - */ - setAlpha: function () - { - }, - - /** - * A NOOP method so you can pass a Zone to a Container in Canvas. - * Calling this method will do nothing. It is intentionally empty. - * - * @method Phaser.GameObjects.Zone#setBlendMode - * @private - * @since 3.16.2 - */ - setBlendMode: function () - { - }, - - /** - * A Zone does not render. - * - * @method Phaser.GameObjects.Zone#renderCanvas - * @private - * @since 3.53.0 - * - * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. - * @param {Phaser.GameObjects.Image} src - The Game Object being rendered in this call. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested - */ - renderCanvas: function (renderer, src, camera) - { - camera.addToRenderList(src); - }, - - /** - * A Zone does not render. - * - * @method Phaser.GameObjects.Zone#renderWebGL - * @private - * @since 3.53.0 - * - * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. - * @param {Phaser.GameObjects.Image} src - The Game Object being rendered in this call. - * @param {Phaser.Renderer.WebGL.DrawingContext} drawingContext - The current drawing context. - */ - renderWebGL: function (renderer, src, drawingContext) - { - drawingContext.camera.addToRenderList(src); - } - -}); - -module.exports = Zone; +// CJS compatibility wrapper — consumed by the hybrid build pipeline and any +// remaining JS callers during the migration period. Remove once all callers +// are TypeScript. +module.exports = __webpack_require__(58715)["default"]; /***/ }, @@ -105301,37 +106393,11 @@ module.exports = Clone; /***/ }, /***/ 37303 -(module) { - -/** - * @author Richard Davey - * @copyright 2013-2026 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Checks if a given point is inside a Rectangle's bounds. - * - * @function Phaser.Geom.Rectangle.Contains - * @since 3.0.0 - * - * @param {Phaser.Geom.Rectangle} rect - The Rectangle to check. - * @param {number} x - The X coordinate of the point to check. - * @param {number} y - The Y coordinate of the point to check. - * - * @return {boolean} `true` if the point is within the Rectangle's bounds, otherwise `false`. - */ -var Contains = function (rect, x, y) -{ - if (rect.width <= 0 || rect.height <= 0) - { - return false; - } - - return (rect.x <= x && rect.x + rect.width >= x && rect.y <= y && rect.y + rect.height >= y); -}; +(module, __unused_webpack_exports, __webpack_require__) { -module.exports = Contains; +const mod = __webpack_require__(72488); +module.exports = mod.default; +module.exports.Contains = mod.Contains; /***/ }, @@ -106739,518 +107805,9 @@ module.exports = RandomOutside; /***/ 87841 (module, __unused_webpack_exports, __webpack_require__) { -/** - * @author Richard Davey - * @copyright 2013-2026 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(83419); -var Contains = __webpack_require__(37303); -var GetPoint = __webpack_require__(20812); -var GetPoints = __webpack_require__(34819); -var GEOM_CONST = __webpack_require__(23777); -var Line = __webpack_require__(23031); -var Random = __webpack_require__(26597); - -/** - * @classdesc - * A Rectangle is an axis-aligned region of 2D space defined by its top-left corner position (`x`, `y`) and its - * dimensions (`width`, `height`). It is one of the core geometric primitives in Phaser and is used extensively - * throughout the framework for bounds checking, camera viewports, hit areas, culling regions, and UI layout. - * - * Rectangles support containment tests, perimeter point sampling, and many other geometric operations available - * via the `Phaser.Geom.Rectangle` static methods. The `left`, `right`, `top`, `bottom`, `centerX`, and `centerY` - * properties provide convenient access to derived positional values and can be set directly to reposition or - * resize the Rectangle. - * - * @class Rectangle - * @memberof Phaser.Geom - * @constructor - * @since 3.0.0 - * - * @param {number} [x=0] - The X coordinate of the top left corner of the Rectangle. - * @param {number} [y=0] - The Y coordinate of the top left corner of the Rectangle. - * @param {number} [width=0] - The width of the Rectangle. - * @param {number} [height=0] - The height of the Rectangle. - */ -var Rectangle = new Class({ - - initialize: - - function Rectangle (x, y, width, height) - { - if (x === undefined) { x = 0; } - if (y === undefined) { y = 0; } - if (width === undefined) { width = 0; } - if (height === undefined) { height = 0; } - - /** - * The geometry constant type of this object: `GEOM_CONST.RECTANGLE`. - * Used for fast type comparisons. - * - * @name Phaser.Geom.Rectangle#type - * @type {number} - * @readonly - * @since 3.19.0 - */ - this.type = GEOM_CONST.RECTANGLE; - - /** - * The X coordinate of the top left corner of the Rectangle. - * - * @name Phaser.Geom.Rectangle#x - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.x = x; - - /** - * The Y coordinate of the top left corner of the Rectangle. - * - * @name Phaser.Geom.Rectangle#y - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.y = y; - - /** - * The width of the Rectangle, i.e. the distance between its left side (defined by `x`) and its right side. - * - * @name Phaser.Geom.Rectangle#width - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.width = width; - - /** - * The height of the Rectangle, i.e. the distance between its top side (defined by `y`) and its bottom side. - * - * @name Phaser.Geom.Rectangle#height - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.height = height; - }, - - /** - * Checks if the given point is inside the Rectangle's bounds. - * - * @method Phaser.Geom.Rectangle#contains - * @since 3.0.0 - * - * @param {number} x - The X coordinate of the point to check. - * @param {number} y - The Y coordinate of the point to check. - * - * @return {boolean} `true` if the point is within the Rectangle's bounds, otherwise `false`. - */ - contains: function (x, y) - { - return Contains(this, x, y); - }, - - /** - * Calculates the coordinates of a point at a certain `position` on the Rectangle's perimeter. - * - * The `position` is a fraction between 0 and 1 which defines how far into the perimeter the point is. - * - * A value of 0 or 1 returns the point at the top left corner of the rectangle, while a value of 0.5 returns the point at the bottom right corner of the rectangle. Values between 0 and 0.5 are on the top or the right side and values between 0.5 and 1 are on the bottom or the left side. - * - * @method Phaser.Geom.Rectangle#getPoint - * @since 3.0.0 - * - * @generic {Phaser.Math.Vector2} O - [output,$return] - * - * @param {number} position - The normalized distance into the Rectangle's perimeter to return. - * @param {Phaser.Math.Vector2} [output] - A Vector2 instance to update with the `x` and `y` coordinates of the point. - * - * @return {Phaser.Math.Vector2} The updated `output` object, or a new Vector2 if no `output` object was given. - */ - getPoint: function (position, output) - { - return GetPoint(this, position, output); - }, - - /** - * Returns an array of points from the perimeter of the Rectangle, each spaced out based on the quantity or step required. - * - * @method Phaser.Geom.Rectangle#getPoints - * @since 3.0.0 - * - * @generic {Phaser.Math.Vector2[]} O - [output,$return] - * - * @param {number} quantity - The number of points to return. Set to `false` or 0 to return an arbitrary number of points (`perimeter / stepRate`) evenly spaced around the Rectangle based on the `stepRate`. - * @param {number} [stepRate] - If `quantity` is 0, determines the normalized distance between each returned point. - * @param {Phaser.Math.Vector2[]} [output] - An array to which to append the points. - * - * @return {Phaser.Math.Vector2[]} The modified `output` array, or a new array if none was provided. - */ - getPoints: function (quantity, stepRate, output) - { - return GetPoints(this, quantity, stepRate, output); - }, - - /** - * Returns a random point within the Rectangle's bounds. - * - * @method Phaser.Geom.Rectangle#getRandomPoint - * @since 3.0.0 - * - * @generic {Phaser.Math.Vector2} O - [point,$return] - * - * @param {Phaser.Math.Vector2} [vec] - The object in which to store the `x` and `y` coordinates of the point. - * - * @return {Phaser.Math.Vector2} The updated `vec`, or a new Vector2 if none was provided. - */ - getRandomPoint: function (vec) - { - return Random(this, vec); - }, - - /** - * Sets the position, width, and height of the Rectangle. - * - * @method Phaser.Geom.Rectangle#setTo - * @since 3.0.0 - * - * @param {number} x - The X coordinate of the top left corner of the Rectangle. - * @param {number} y - The Y coordinate of the top left corner of the Rectangle. - * @param {number} width - The width of the Rectangle. - * @param {number} height - The height of the Rectangle. - * - * @return {this} This Rectangle object. - */ - setTo: function (x, y, width, height) - { - this.x = x; - this.y = y; - this.width = width; - this.height = height; - - return this; - }, - - /** - * Resets the position, width, and height of the Rectangle to 0. - * - * @method Phaser.Geom.Rectangle#setEmpty - * @since 3.0.0 - * - * @return {this} This Rectangle object. - */ - setEmpty: function () - { - return this.setTo(0, 0, 0, 0); - }, - - /** - * Sets the position of the Rectangle. - * - * @method Phaser.Geom.Rectangle#setPosition - * @since 3.0.0 - * - * @param {number} x - The X coordinate of the top left corner of the Rectangle. - * @param {number} [y=x] - The Y coordinate of the top left corner of the Rectangle. - * - * @return {this} This Rectangle object. - */ - setPosition: function (x, y) - { - if (y === undefined) { y = x; } - - this.x = x; - this.y = y; - - return this; - }, - - /** - * Sets the width and height of the Rectangle. - * - * @method Phaser.Geom.Rectangle#setSize - * @since 3.0.0 - * - * @param {number} width - The width to set the Rectangle to. - * @param {number} [height=width] - The height to set the Rectangle to. - * - * @return {this} This Rectangle object. - */ - setSize: function (width, height) - { - if (height === undefined) { height = width; } - - this.width = width; - this.height = height; - - return this; - }, - - /** - * Determines if the Rectangle is empty. A Rectangle is empty if its width or height is less than or equal to 0. - * - * @method Phaser.Geom.Rectangle#isEmpty - * @since 3.0.0 - * - * @return {boolean} `true` if the Rectangle is empty, otherwise `false`. - */ - isEmpty: function () - { - return (this.width <= 0 || this.height <= 0); - }, - - /** - * Returns a Line object that corresponds to the top of this Rectangle. - * - * @method Phaser.Geom.Rectangle#getLineA - * @since 3.0.0 - * - * @generic {Phaser.Geom.Line} O - [line,$return] - * - * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. - * - * @return {Phaser.Geom.Line} A Line object that corresponds to the top of this Rectangle. - */ - getLineA: function (line) - { - if (line === undefined) { line = new Line(); } - - line.setTo(this.x, this.y, this.right, this.y); - - return line; - }, - - /** - * Returns a Line object that corresponds to the right of this Rectangle. - * - * @method Phaser.Geom.Rectangle#getLineB - * @since 3.0.0 - * - * @generic {Phaser.Geom.Line} O - [line,$return] - * - * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. - * - * @return {Phaser.Geom.Line} A Line object that corresponds to the right of this Rectangle. - */ - getLineB: function (line) - { - if (line === undefined) { line = new Line(); } - - line.setTo(this.right, this.y, this.right, this.bottom); - - return line; - }, - - /** - * Returns a Line object that corresponds to the bottom of this Rectangle. - * - * @method Phaser.Geom.Rectangle#getLineC - * @since 3.0.0 - * - * @generic {Phaser.Geom.Line} O - [line,$return] - * - * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. - * - * @return {Phaser.Geom.Line} A Line object that corresponds to the bottom of this Rectangle. - */ - getLineC: function (line) - { - if (line === undefined) { line = new Line(); } - - line.setTo(this.right, this.bottom, this.x, this.bottom); - - return line; - }, - - /** - * Returns a Line object that corresponds to the left of this Rectangle. - * - * @method Phaser.Geom.Rectangle#getLineD - * @since 3.0.0 - * - * @generic {Phaser.Geom.Line} O - [line,$return] - * - * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. - * - * @return {Phaser.Geom.Line} A Line object that corresponds to the left of this Rectangle. - */ - getLineD: function (line) - { - if (line === undefined) { line = new Line(); } - - line.setTo(this.x, this.bottom, this.x, this.y); - - return line; - }, - - /** - * The x coordinate of the left of the Rectangle. - * Changing the left property of a Rectangle object has no effect on the y and height properties. However it does affect the width property, whereas changing the x value does not affect the width property. - * - * @name Phaser.Geom.Rectangle#left - * @type {number} - * @since 3.0.0 - */ - left: { - - get: function () - { - return this.x; - }, - - set: function (value) - { - if (value >= this.right) - { - this.width = 0; - } - else - { - this.width = this.right - value; - } - - this.x = value; - } - - }, - - /** - * The sum of the x and width properties. - * Changing the right property of a Rectangle object has no effect on the x, y and height properties, however it does affect the width property. - * - * @name Phaser.Geom.Rectangle#right - * @type {number} - * @since 3.0.0 - */ - right: { - - get: function () - { - return this.x + this.width; - }, - - set: function (value) - { - if (value <= this.x) - { - this.width = 0; - } - else - { - this.width = value - this.x; - } - } - - }, - - /** - * The y coordinate of the top of the Rectangle. Changing the top property of a Rectangle object has no effect on the x and width properties. - * However it does affect the height property, whereas changing the y value does not affect the height property. - * - * @name Phaser.Geom.Rectangle#top - * @type {number} - * @since 3.0.0 - */ - top: { - - get: function () - { - return this.y; - }, - - set: function (value) - { - if (value >= this.bottom) - { - this.height = 0; - } - else - { - this.height = (this.bottom - value); - } - - this.y = value; - } - - }, - - /** - * The sum of the y and height properties. - * Changing the bottom property of a Rectangle object has no effect on the x, y and width properties, but does change the height property. - * - * @name Phaser.Geom.Rectangle#bottom - * @type {number} - * @since 3.0.0 - */ - bottom: { - - get: function () - { - return this.y + this.height; - }, - - set: function (value) - { - if (value <= this.y) - { - this.height = 0; - } - else - { - this.height = value - this.y; - } - } - - }, - - /** - * The x coordinate of the center of the Rectangle. - * - * @name Phaser.Geom.Rectangle#centerX - * @type {number} - * @since 3.0.0 - */ - centerX: { - - get: function () - { - return this.x + (this.width / 2); - }, - - set: function (value) - { - this.x = value - (this.width / 2); - } - - }, - - /** - * The y coordinate of the center of the Rectangle. - * - * @name Phaser.Geom.Rectangle#centerY - * @type {number} - * @since 3.0.0 - */ - centerY: { - - get: function () - { - return this.y + (this.height / 2); - }, - - set: function (value) - { - this.y = value - (this.height / 2); - } - - } - -}); - -module.exports = Rectangle; +const mod = __webpack_require__(59428); +module.exports = mod.default; +module.exports.Rectangle = mod.Rectangle; /***/ }, @@ -124035,13 +124592,11 @@ module.exports = MouseManager; * @namespace Phaser.Input.Mouse */ -/* eslint-disable */ module.exports = { MouseManager: __webpack_require__(85098) }; -/* eslint-enable */ /***/ }, @@ -124467,13 +125022,11 @@ module.exports = TouchManager; * @namespace Phaser.Input.Touch */ -/* eslint-disable */ module.exports = { TouchManager: __webpack_require__(36210) }; -/* eslint-enable */ /***/ }, @@ -136330,32 +136883,9 @@ module.exports = CeilTo; /***/ }, /***/ 45319 -(module) { - -/** - * @author Richard Davey - * @copyright 2013-2026 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Force a value within the boundaries by clamping it to the range `min`, `max`. - * - * @function Phaser.Math.Clamp - * @since 3.0.0 - * - * @param {number} value - The value to be clamped. - * @param {number} min - The minimum bounds. - * @param {number} max - The maximum bounds. - * - * @return {number} The clamped value. - */ -var Clamp = function (value, min, max) -{ - return Math.max(min, Math.min(max, value)); -}; +(module, __unused_webpack_exports, __webpack_require__) { -module.exports = Clamp; +module.exports = __webpack_require__(350)["default"]; /***/ }, @@ -142720,870 +143250,7 @@ module.exports = TransformXY; /***/ 26099 (module, __unused_webpack_exports, __webpack_require__) { -/** - * @author Richard Davey - * @copyright 2013-2026 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji -// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl - -var Class = __webpack_require__(83419); -var FuzzyEqual = __webpack_require__(43855); - -/** - * @classdesc - * A representation of a vector in 2D space, defined by an `x` and `y` component. - * - * Vector2 is used throughout Phaser for positions, directions, velocities, and other - * quantities that have both magnitude and direction. It provides methods for common - * vector operations such as addition, subtraction, scaling, normalization, dot and - * cross products, linear interpolation, and rotation. Many Phaser APIs accept a - * `Vector2Like` object (any object with `x` and `y` number properties), making - * Vector2 easy to integrate across the framework. - * - * @class Vector2 - * @memberof Phaser.Math - * @constructor - * @since 3.0.0 - * - * @param {number|Phaser.Types.Math.Vector2Like} [x=0] - The x component, or an object with `x` and `y` properties. - * @param {number} [y=x] - The y component. - */ -var Vector2 = new Class({ - - initialize: - - function Vector2 (x, y) - { - /** - * The x component of this Vector. - * - * @name Phaser.Math.Vector2#x - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.x = 0; - - /** - * The y component of this Vector. - * - * @name Phaser.Math.Vector2#y - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.y = 0; - - if (typeof x === 'object') - { - this.x = x.x || 0; - this.y = x.y || 0; - } - else - { - if (y === undefined) { y = x; } - - this.x = x || 0; - this.y = y || 0; - } - }, - - /** - * Make a clone of this Vector2. - * - * @method Phaser.Math.Vector2#clone - * @since 3.0.0 - * - * @return {Phaser.Math.Vector2} A clone of this Vector2. - */ - clone: function () - { - return new Vector2(this.x, this.y); - }, - - /** - * Copy the components of a given Vector into this Vector. - * - * @method Phaser.Math.Vector2#copy - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector to copy the components from. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - copy: function (src) - { - this.x = src.x || 0; - this.y = src.y || 0; - - return this; - }, - - /** - * Set the component values of this Vector from a given Vector2Like object. - * - * @method Phaser.Math.Vector2#setFromObject - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} obj - The object containing the component values to set for this Vector. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - setFromObject: function (obj) - { - this.x = obj.x || 0; - this.y = obj.y || 0; - - return this; - }, - - /** - * Set the `x` and `y` components of this Vector to the given `x` and `y` values. - * - * @method Phaser.Math.Vector2#set - * @since 3.0.0 - * - * @param {number} x - The x value to set for this Vector. - * @param {number} [y=x] - The y value to set for this Vector. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - set: function (x, y) - { - if (y === undefined) { y = x; } - - this.x = x; - this.y = y; - - return this; - }, - - /** - * This method is an alias for `Vector2.set`. - * - * @method Phaser.Math.Vector2#setTo - * @since 3.4.0 - * - * @param {number} x - The x value to set for this Vector. - * @param {number} [y=x] - The y value to set for this Vector. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - setTo: function (x, y) - { - return this.set(x, y); - }, - - /** - * Runs the x and y components of this Vector2 through Math.ceil and then sets them. - * - * @method Phaser.Math.Vector2#ceil - * @since 4.0.0 - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - ceil: function () - { - this.x = Math.ceil(this.x); - this.y = Math.ceil(this.y); - - return this; - }, - - /** - * Runs the x and y components of this Vector2 through Math.floor and then sets them. - * - * @method Phaser.Math.Vector2#floor - * @since 4.0.0 - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - floor: function () - { - this.x = Math.floor(this.x); - this.y = Math.floor(this.y); - - return this; - }, - - /** - * Swaps the x and y components of this Vector2. - * - * @method Phaser.Math.Vector2#invert - * @since 4.0.0 - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - invert: function () - { - return this.set(this.y, this.x); - }, - - /** - * Sets the x and y components of this Vector from the given angle and length. - * - * @method Phaser.Math.Vector2#setToPolar - * @since 3.0.0 - * - * @param {number} angle - The angle from the positive x-axis, in radians. - * @param {number} [length=1] - The distance from the origin. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - setToPolar: function (angle, length) - { - if (length == null) { length = 1; } - - this.x = Math.cos(angle) * length; - this.y = Math.sin(angle) * length; - - return this; - }, - - /** - * Check whether this Vector is equal to a given Vector. - * - * Performs a strict equality check against each Vector's components. - * - * @method Phaser.Math.Vector2#equals - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} v - The vector to compare with this Vector. - * - * @return {boolean} Whether the given Vector is equal to this Vector. - */ - equals: function (v) - { - return ((this.x === v.x) && (this.y === v.y)); - }, - - /** - * Check whether this Vector is approximately equal to a given Vector. - * - * @method Phaser.Math.Vector2#fuzzyEquals - * @since 3.23.0 - * - * @param {Phaser.Types.Math.Vector2Like} v - The vector to compare with this Vector. - * @param {number} [epsilon=0.0001] - The tolerance value. - * - * @return {boolean} Whether both absolute differences of the x and y components are smaller than `epsilon`. - */ - fuzzyEquals: function (v, epsilon) - { - return (FuzzyEqual(this.x, v.x, epsilon) && FuzzyEqual(this.y, v.y, epsilon)); - }, - - /** - * Calculate the angle between this Vector and the positive x-axis, in radians. - * - * @method Phaser.Math.Vector2#angle - * @since 3.0.0 - * - * @return {number} The angle between this Vector, and the positive x-axis, given in radians. - */ - angle: function () - { - // computes the angle in radians with respect to the positive x-axis - - var angle = Math.atan2(this.y, this.x); - - if (angle < 0) - { - angle += 2 * Math.PI; - } - - return angle; - }, - - /** - * Set the angle of this Vector. - * - * @method Phaser.Math.Vector2#setAngle - * @since 3.23.0 - * - * @param {number} angle - The angle, in radians. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - setAngle: function (angle) - { - return this.setToPolar(angle, this.length()); - }, - - /** - * Add a given Vector to this Vector. Addition is component-wise. - * - * @method Phaser.Math.Vector2#add - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector to add to this Vector. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - add: function (src) - { - this.x += src.x; - this.y += src.y; - - return this; - }, - - /** - * Subtract the given Vector from this Vector. Subtraction is component-wise. - * - * @method Phaser.Math.Vector2#subtract - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector to subtract from this Vector. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - subtract: function (src) - { - this.x -= src.x; - this.y -= src.y; - - return this; - }, - - /** - * Perform a component-wise multiplication between this Vector and the given Vector. - * - * Multiplies this Vector by the given Vector. - * - * @method Phaser.Math.Vector2#multiply - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector to multiply this Vector by. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - multiply: function (src) - { - this.x *= src.x; - this.y *= src.y; - - return this; - }, - - /** - * Scale this Vector by the given value. - * - * @method Phaser.Math.Vector2#scale - * @since 3.0.0 - * - * @param {number} value - The value to scale this Vector by. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - scale: function (value) - { - if (isFinite(value)) - { - this.x *= value; - this.y *= value; - } - else - { - this.x = 0; - this.y = 0; - } - - return this; - }, - - /** - * Perform a component-wise division between this Vector and the given Vector. - * - * Divides this Vector by the given Vector. - * - * @method Phaser.Math.Vector2#divide - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector to divide this Vector by. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - divide: function (src) - { - this.x /= src.x; - this.y /= src.y; - - return this; - }, - - /** - * Negate the `x` and `y` components of this Vector. - * - * @method Phaser.Math.Vector2#negate - * @since 3.0.0 - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - negate: function () - { - this.x = -this.x; - this.y = -this.y; - - return this; - }, - - /** - * Calculate the distance between this Vector and the given Vector. - * - * @method Phaser.Math.Vector2#distance - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector to calculate the distance to. - * - * @return {number} The distance from this Vector to the given Vector. - */ - distance: function (src) - { - var dx = src.x - this.x; - var dy = src.y - this.y; - - return Math.sqrt(dx * dx + dy * dy); - }, - - /** - * Calculate the distance between this Vector and the given Vector, squared. - * - * @method Phaser.Math.Vector2#distanceSq - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector to calculate the distance to. - * - * @return {number} The distance from this Vector to the given Vector, squared. - */ - distanceSq: function (src) - { - var dx = src.x - this.x; - var dy = src.y - this.y; - - return dx * dx + dy * dy; - }, - - /** - * Calculate the length (or magnitude) of this Vector. - * - * @method Phaser.Math.Vector2#length - * @since 3.0.0 - * - * @return {number} The length of this Vector. - */ - length: function () - { - var x = this.x; - var y = this.y; - - return Math.sqrt(x * x + y * y); - }, - - /** - * Set the length (or magnitude) of this Vector. - * - * @method Phaser.Math.Vector2#setLength - * @since 3.23.0 - * - * @param {number} length - The new magnitude of this Vector. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - setLength: function (length) - { - return this.normalize().scale(length); - }, - - /** - * Calculate the length of this Vector squared. - * - * @method Phaser.Math.Vector2#lengthSq - * @since 3.0.0 - * - * @return {number} The length of this Vector, squared. - */ - lengthSq: function () - { - var x = this.x; - var y = this.y; - - return x * x + y * y; - }, - - /** - * Normalize this Vector. - * - * Makes the vector a unit length vector (magnitude of 1) in the same direction. - * - * @method Phaser.Math.Vector2#normalize - * @since 3.0.0 - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - normalize: function () - { - var x = this.x; - var y = this.y; - var len = x * x + y * y; - - if (len > 0) - { - len = 1 / Math.sqrt(len); - - this.x = x * len; - this.y = y * len; - } - - return this; - }, - - /** - * Rotate this Vector to its perpendicular, in the positive direction. - * - * @method Phaser.Math.Vector2#normalizeRightHand - * @since 3.0.0 - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - normalizeRightHand: function () - { - var x = this.x; - - this.x = this.y * -1; - this.y = x; - - return this; - }, - - /** - * Rotate this Vector to its perpendicular, in the negative direction. - * - * @method Phaser.Math.Vector2#normalizeLeftHand - * @since 3.23.0 - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - normalizeLeftHand: function () - { - var x = this.x; - - this.x = this.y; - this.y = x * -1; - - return this; - }, - - /** - * Calculate the dot product of this Vector and the given Vector. - * - * @method Phaser.Math.Vector2#dot - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector2 to dot product with this Vector2. - * - * @return {number} The dot product of this Vector and the given Vector. - */ - dot: function (src) - { - return this.x * src.x + this.y * src.y; - }, - - /** - * Calculate the cross product of this Vector and the given Vector. - * - * @method Phaser.Math.Vector2#cross - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector2 to cross with this Vector2. - * - * @return {number} The cross product of this Vector and the given Vector. - */ - cross: function (src) - { - return this.x * src.y - this.y * src.x; - }, - - /** - * Linearly interpolate between this Vector and the given Vector. - * - * Interpolates this Vector towards the given Vector. - * - * @method Phaser.Math.Vector2#lerp - * @since 3.0.0 - * - * @param {Phaser.Types.Math.Vector2Like} src - The Vector2 to interpolate towards. - * @param {number} [t=0] - The interpolation percentage, between 0 and 1. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - lerp: function (src, t) - { - if (t === undefined) { t = 0; } - - var ax = this.x; - var ay = this.y; - - this.x = ax + t * (src.x - ax); - this.y = ay + t * (src.y - ay); - - return this; - }, - - /** - * Transform this Vector with the given Matrix3. - * - * @method Phaser.Math.Vector2#transformMat3 - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix3} mat - The Matrix3 to transform this Vector2 with. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - transformMat3: function (mat) - { - var x = this.x; - var y = this.y; - var m = mat.val; - - this.x = m[0] * x + m[3] * y + m[6]; - this.y = m[1] * x + m[4] * y + m[7]; - - return this; - }, - - /** - * Transform this Vector with the given Matrix4. - * - * @method Phaser.Math.Vector2#transformMat4 - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector2 with. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - transformMat4: function (mat) - { - var x = this.x; - var y = this.y; - var m = mat.val; - - this.x = m[0] * x + m[4] * y + m[12]; - this.y = m[1] * x + m[5] * y + m[13]; - - return this; - }, - - /** - * Make this Vector the zero vector (0, 0). - * - * @method Phaser.Math.Vector2#reset - * @since 3.0.0 - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - reset: function () - { - this.x = 0; - this.y = 0; - - return this; - }, - - /** - * Limit the length (or magnitude) of this Vector. - * - * @method Phaser.Math.Vector2#limit - * @since 3.23.0 - * - * @param {number} max - The maximum length. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - limit: function (max) - { - var len = this.length(); - - if (len && len > max) - { - this.scale(max / len); - } - - return this; - }, - - /** - * Reflect this Vector off a line defined by a normal. - * - * @method Phaser.Math.Vector2#reflect - * @since 3.23.0 - * - * @param {Phaser.Math.Vector2} normal - A vector perpendicular to the line. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - reflect: function (normal) - { - normal = normal.clone().normalize(); - - return this.subtract(normal.scale(2 * this.dot(normal))); - }, - - /** - * Reflect this Vector across another. - * - * @method Phaser.Math.Vector2#mirror - * @since 3.23.0 - * - * @param {Phaser.Math.Vector2} axis - A vector to reflect across. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - mirror: function (axis) - { - return this.reflect(axis).negate(); - }, - - /** - * Rotate this Vector by an angle amount. - * - * @method Phaser.Math.Vector2#rotate - * @since 3.23.0 - * - * @param {number} delta - The angle to rotate by, in radians. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - rotate: function (delta) - { - var cos = Math.cos(delta); - var sin = Math.sin(delta); - - return this.set(cos * this.x - sin * this.y, sin * this.x + cos * this.y); - }, - - /** - * Project this Vector onto another. - * - * @method Phaser.Math.Vector2#project - * @since 3.60.0 - * - * @param {Phaser.Math.Vector2} src - The vector to project onto. - * - * @return {Phaser.Math.Vector2} This Vector2. - */ - project: function (src) - { - var scalar = this.dot(src) / src.dot(src); - - return this.copy(src).scale(scalar); - }, - - /** - * Calculates the vector projection of this Vector2 onto the non-zero `vecB`. This is the - * orthogonal projection of this vector onto a straight line parallel to `vecB`. - * - * @method Phaser.Math.Vector2#projectUnit - * @since 4.0.0 - * - * @param {Phaser.Math.Vector2} vecB - The vector to project onto. - * @param {Phaser.Math.Vector2} [out] - The Vector2 object to store the position in. If not given, a new Vector2 instance is created. - * - * @return {Phaser.Math.Vector2} The `out` Vector2 containing the projected values. - */ - projectUnit: function (vecB, out) - { - if (out === undefined) { out = new Vector2(); } - - var amt = ((this.x * vecB.x) + (this.y * vecB.y)); - - if (amt !== 0) - { - out.x = amt * vecB.x; - out.y = amt * vecB.y; - } - - return out; - } - -}); - -/** - * A static zero Vector2 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector2.ZERO - * @type {Phaser.Math.Vector2} - * @since 3.1.0 - */ -Vector2.ZERO = new Vector2(); - -/** - * A static right Vector2 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector2.RIGHT - * @type {Phaser.Math.Vector2} - * @since 3.16.0 - */ -Vector2.RIGHT = new Vector2(1, 0); - -/** - * A static left Vector2 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector2.LEFT - * @type {Phaser.Math.Vector2} - * @since 3.16.0 - */ -Vector2.LEFT = new Vector2(-1, 0); - -/** - * A static up Vector2 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector2.UP - * @type {Phaser.Math.Vector2} - * @since 3.16.0 - */ -Vector2.UP = new Vector2(0, -1); - -/** - * A static down Vector2 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector2.DOWN - * @type {Phaser.Math.Vector2} - * @since 3.16.0 - */ -Vector2.DOWN = new Vector2(0, 1); - -/** - * A static one Vector2 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector2.ONE - * @type {Phaser.Math.Vector2} - * @since 3.16.0 - */ -Vector2.ONE = new Vector2(1, 1); - -module.exports = Vector2; +module.exports = __webpack_require__(70038)["default"]; /***/ }, @@ -145245,39 +144912,9 @@ module.exports = Within; /***/ }, /***/ 15994 -(module) { - -/** - * @author Richard Davey - * @copyright 2013-2026 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Wrap the given `value` between `min` (inclusive) and `max` (exclusive). - * - * When the value exceeds `max` it wraps back around to `min`, and when it falls - * below `min` it wraps around to just below `max`. This is useful for cycling - * through a range, such as keeping an angle within 0–360 degrees or looping a - * tile index within a tileset. - * - * @function Phaser.Math.Wrap - * @since 3.0.0 - * - * @param {number} value - The value to wrap. - * @param {number} min - The minimum bound of the range (inclusive). - * @param {number} max - The maximum bound of the range (exclusive). - * - * @return {number} The wrapped value, guaranteed to be within `[min, max)`. - */ -var Wrap = function (value, min, max) -{ - var range = max - min; - - return (min + ((((value - min) % range) + range) % range)); -}; +(module, __unused_webpack_exports, __webpack_require__) { -module.exports = Wrap; +module.exports = __webpack_require__(68077)["default"]; /***/ }, @@ -147984,36 +147621,9 @@ module.exports = Ceil; /***/ }, /***/ 43855 -(module) { - -/** - * @author Richard Davey - * @copyright 2013-2026 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Check whether the given values are fuzzily equal. - * - * Two numbers are fuzzily equal if their difference is less than `epsilon`. - * - * @function Phaser.Math.Fuzzy.Equal - * @since 3.0.0 - * - * @param {number} a - The first value. - * @param {number} b - The second value. - * @param {number} [epsilon=0.0001] - The maximum absolute difference below which the two values are considered equal. - * - * @return {boolean} `true` if the values are fuzzily equal, otherwise `false`. - */ -var Equal = function (a, b, epsilon) -{ - if (epsilon === undefined) { epsilon = 0.0001; } - - return Math.abs(a - b) < epsilon; -}; +(module, __unused_webpack_exports, __webpack_require__) { -module.exports = Equal; +module.exports = __webpack_require__(30010)["default"]; /***/ }, @@ -149110,7 +148720,7 @@ var RandomDataGenerator = new Class({ for (b = a = ''; a++ < 36; b += ~a % 5 | a * 3 & 4 ? (a ^ 15 ? 8 ^ this.frac() * (a ^ 20 ? 16 : 4) : 4).toString(16) : '-') { - // eslint-disable-next-line no-empty + // noop } return b; @@ -191896,9 +191506,6 @@ var Camera = new Class({ { var index, filter, padding, renderNode, tint; - // // Mipmap. - // currentContext.texture.needsMipmapRegeneration = true; - // Set up render options. var renderOptions = { smoothPixelArt: manager.renderer.game.config.smoothPixelArt @@ -191922,9 +191529,6 @@ var Camera = new Class({ coverageInternal.width + padding.width, coverageInternal.height + padding.height ); - - // // Mipmap. - // currentContext.texture.needsMipmapRegeneration = true; } var outputContext = currentContext; @@ -192004,9 +191608,6 @@ var Camera = new Class({ quad[7] = Math.round(quad[7]); } - // // Mipmap. - // outputContext.texture.needsMipmapRegeneration = true; - this.batchHandlerQuadSingleNode.batch( currentContext, @@ -192086,9 +191687,6 @@ var Camera = new Class({ padding.y = -padding.y; padding.width = -padding.width; padding.height = -padding.height; - - // // Mipmap. - // currentContext.texture.needsMipmapRegeneration = true; } if (!skipDrawOut) @@ -217262,7 +216860,6 @@ var BaseSound = new Class({ if (!this.markers[marker.name]) { - // eslint-disable-next-line no-console console.warn('Audio Marker: ' + marker.name + ' missing in Sound: ' + this.key); return false; @@ -217336,7 +216933,6 @@ var BaseSound = new Class({ { if (!this.markers[markerName]) { - // eslint-disable-next-line no-console console.warn('Marker: ' + markerName + ' missing in Sound: ' + this.key); return false; @@ -219645,7 +219241,6 @@ var HTML5AudioSound = new Class({ if (playPromise) { - // eslint-disable-next-line no-unused-vars playPromise.catch(function (reason) { console.warn(reason); @@ -221409,7 +221004,6 @@ var NoAudioSoundManager = new Class({ * * @return {boolean} Always 'false' for the No Audio Sound Manager. */ - // eslint-disable-next-line no-unused-vars play: function (key, extra) { return false; @@ -221428,7 +221022,6 @@ var NoAudioSoundManager = new Class({ * * @return {boolean} Always 'false' for the No Audio Sound Manager. */ - // eslint-disable-next-line no-unused-vars playAudioSprite: function (key, spriteName, config) { return false; @@ -224313,404 +223906,7 @@ module.exports = List; /***/ 90330 (module, __unused_webpack_exports, __webpack_require__) { -/** - * @author Richard Davey - * @copyright 2013-2026 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(83419); - -/** - * @callback EachMapCallback - * - * @param {string} key - The key of the Map entry. - * @param {E} entry - The value of the Map entry. - * - * @return {?boolean} The callback result. - */ - -/** - * @classdesc - * A custom Map implementation that stores entries as key-value pairs with ordered iteration. - * Unlike a native JavaScript Map, it also maintains an internal array of entries for efficient - * indexed access and iteration. Supports filtering, merging, and contains/size operations. - * Used internally by various Phaser systems for managing collections. - * - * ```javascript - * var map = new Map([ - * [ 1, 'one' ], - * [ 2, 'two' ], - * [ 3, 'three' ] - * ]); - * ``` - * - * @class Map - * @memberof Phaser.Structs - * @constructor - * @since 3.0.0 - * - * @generic K - * @generic V - * @genericUse {V[]} - [elements] - * - * @param {Array.<*>} elements - An optional array of key-value pairs to populate this Map with. - */ -var Map = new Class({ - - initialize: - - function Map (elements) - { - /** - * The entries in this Map. - * - * @genericUse {Object.} - [$type] - * - * @name Phaser.Structs.Map#entries - * @type {Object.} - * @default {} - * @since 3.0.0 - */ - this.entries = {}; - - /** - * The number of key / value pairs in this Map. - * - * @name Phaser.Structs.Map#size - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.size = 0; - - this.setAll(elements); - }, - - /** - * Adds all the elements in the given array to this Map. - * - * If the key already exists, the value will be replaced. - * - * @method Phaser.Structs.Map#setAll - * @since 3.70.0 - * - * @generic K - * @generic V - * @genericUse {V[]} - [elements] - * - * @param {Array.<*>} elements - An array of key-value pairs to populate this Map with. - * - * @return {this} This Map object. - */ - setAll: function (elements) - { - if (Array.isArray(elements)) - { - for (var i = 0; i < elements.length; i++) - { - this.set(elements[i][0], elements[i][1]); - } - } - - return this; - }, - - /** - * Adds an element with a specified `key` and `value` to this Map. - * - * If the `key` already exists, the value will be replaced. - * - * If you wish to add multiple elements in a single call, use the `setAll` method instead. - * - * @method Phaser.Structs.Map#set - * @since 3.0.0 - * - * @genericUse {K} - [key] - * @genericUse {V} - [value] - * @genericUse {Phaser.Structs.Map.} - [$return] - * - * @param {string} key - The key of the element to be added to this Map. - * @param {*} value - The value of the element to be added to this Map. - * - * @return {this} This Map object. - */ - set: function (key, value) - { - if (!this.has(key)) - { - this.size++; - } - - this.entries[key] = value; - - return this; - }, - - /** - * Returns the value associated to the `key`, or `undefined` if there is none. - * - * @method Phaser.Structs.Map#get - * @since 3.0.0 - * - * @genericUse {K} - [key] - * @genericUse {V} - [$return] - * - * @param {string} key - The key of the element to return from the `Map` object. - * - * @return {*} The element associated with the specified key or `undefined` if the key can't be found in this Map object. - */ - get: function (key) - { - if (this.has(key)) - { - return this.entries[key]; - } - }, - - /** - * Returns an `Array` of all the values stored in this Map. - * - * @method Phaser.Structs.Map#getArray - * @since 3.0.0 - * - * @genericUse {V[]} - [$return] - * - * @return {Array.<*>} An array of the values stored in this Map. - */ - getArray: function () - { - var output = []; - var entries = this.entries; - - for (var key in entries) - { - output.push(entries[key]); - } - - return output; - }, - - /** - * Returns a boolean indicating whether an element with the specified key exists or not. - * - * @method Phaser.Structs.Map#has - * @since 3.0.0 - * - * @genericUse {K} - [key] - * - * @param {string} key - The key of the element to test for presence of in this Map. - * - * @return {boolean} Returns `true` if an element with the specified key exists in this Map, otherwise `false`. - */ - has: function (key) - { - return (this.entries.hasOwnProperty(key)); - }, - - /** - * Delete the specified element from this Map. - * - * @method Phaser.Structs.Map#delete - * @since 3.0.0 - * - * @genericUse {K} - [key] - * @genericUse {Phaser.Structs.Map.} - [$return] - * - * @param {string} key - The key of the element to delete from this Map. - * - * @return {this} This Map object. - */ - delete: function (key) - { - if (this.has(key)) - { - delete this.entries[key]; - this.size--; - } - - return this; - }, - - /** - * Delete all entries from this Map. - * - * @method Phaser.Structs.Map#clear - * @since 3.0.0 - * - * @genericUse {Phaser.Structs.Map.} - [$return] - * - * @return {this} This Map object. - */ - clear: function () - { - Object.keys(this.entries).forEach(function (prop) - { - delete this.entries[prop]; - - }, this); - - this.size = 0; - - return this; - }, - - /** - * Returns an array of all entry keys in this Map. - * - * @method Phaser.Structs.Map#keys - * @since 3.0.0 - * - * @genericUse {K[]} - [$return] - * - * @return {string[]} Array containing entries' keys. - */ - keys: function () - { - return Object.keys(this.entries); - }, - - /** - * Returns an `Array` of all values stored in this Map. - * - * @method Phaser.Structs.Map#values - * @since 3.0.0 - * - * @genericUse {V[]} - [$return] - * - * @return {Array.<*>} An `Array` of values. - */ - values: function () - { - var output = []; - var entries = this.entries; - - for (var key in entries) - { - output.push(entries[key]); - } - - return output; - }, - - /** - * Dumps the contents of this Map to the console via `console.group`. - * - * @method Phaser.Structs.Map#dump - * @since 3.0.0 - */ - dump: function () - { - var entries = this.entries; - - // eslint-disable-next-line no-console - console.group('Map'); - - for (var key in entries) - { - console.log(key, entries[key]); - } - - // eslint-disable-next-line no-console - console.groupEnd(); - }, - - /** - * Iterates through all entries in this Map, passing each one to the given callback. - * - * If the callback returns `false`, the iteration will break. - * - * @method Phaser.Structs.Map#each - * @since 3.0.0 - * - * @genericUse {EachMapCallback.} - [callback] - * @genericUse {Phaser.Structs.Map.} - [$return] - * - * @param {EachMapCallback} callback - The callback which will receive the keys and entries held in this Map. - * - * @return {this} This Map object. - */ - each: function (callback) - { - var entries = this.entries; - - for (var key in entries) - { - if (callback(key, entries[key]) === false) - { - break; - } - } - - return this; - }, - - /** - * Returns `true` if the value exists within this Map. Otherwise, returns `false`. - * - * @method Phaser.Structs.Map#contains - * @since 3.0.0 - * - * @genericUse {V} - [value] - * - * @param {*} value - The value to search for. - * - * @return {boolean} `true` if the value is found, otherwise `false`. - */ - contains: function (value) - { - var entries = this.entries; - - for (var key in entries) - { - if (entries[key] === value) - { - return true; - } - } - - return false; - }, - - /** - * Merges all new keys from the given Map into this one. - * If it encounters a key that already exists it will be skipped unless override is set to `true`. - * - * @method Phaser.Structs.Map#merge - * @since 3.0.0 - * - * @genericUse {Phaser.Structs.Map.} - [map,$return] - * - * @param {Phaser.Structs.Map} map - The Map to merge in to this Map. - * @param {boolean} [override=false] - Set to `true` to replace values in this Map with those from the source map, or `false` to skip them. - * - * @return {this} This Map object. - */ - merge: function (map, override) - { - if (override === undefined) { override = false; } - - var local = this.entries; - var source = map.entries; - - for (var key in source) - { - if (local.hasOwnProperty(key) && override) - { - local[key] = source[key]; - } - else - { - this.set(key, source[key]); - } - } - - return this; - } - -}); - -module.exports = Map; +module.exports = __webpack_require__(60269)["default"]; /***/ }, @@ -233845,7 +233041,7 @@ var resolveFullName = function (raw, folders, extSuffix) } // Extension index: "name~N" (per-name, overrides line-level) - var extMatch = /~([1-5])$/.exec(name); + var extMatch = (/~([1-5])$/).exec(name); if (extMatch) { @@ -233870,7 +233066,7 @@ var expandNames = function (line, folders) { // Check for trailing extension suffix: ~N at very end var extSuffix = ''; - var extMatch = /~([1-5])$/.exec(line); + var extMatch = (/~([1-5])$/).exec(line); if (extMatch) { @@ -237302,7 +236498,7 @@ var Tilemap = new Class({ if (typeof renderOrder === 'number') { - renderOrder = orders[ renderOrder ]; + renderOrder = orders[renderOrder]; } if (orders.indexOf(renderOrder) > -1) @@ -237365,7 +236561,7 @@ var Tilemap = new Class({ return null; } - var tileset = this.tilesets[ index ]; + var tileset = this.tilesets[index]; if (tileset) { @@ -237554,7 +236750,7 @@ var Tilemap = new Class({ return null; } - var layerData = this.layers[ index ]; + var layerData = this.layers[index]; // Check for an associated tilemap layer if (layerData.tilemapLayer) @@ -237778,7 +236974,7 @@ var Tilemap = new Class({ for (var c = 0; c < config.length; c++) { - var singleConfig = config[ c ]; + var singleConfig = config[c]; var id = GetFastValue(singleConfig, 'id', null); var gid = GetFastValue(singleConfig, 'gid', null); @@ -237792,7 +236988,7 @@ var Tilemap = new Class({ // Sweep to get all the objects we want to convert in this pass for (var s = 0; s < objects.length; s++) { - obj = objects[ s ]; + obj = objects[s]; if ( (id === null && gid === null && name === null && type === null) || @@ -237816,7 +237012,7 @@ var Tilemap = new Class({ for (var i = 0; i < toConvert.length; i++) { - obj = toConvert[ i ]; + obj = toConvert[i]; var sprite = new classType(scene); @@ -238206,7 +237402,7 @@ var Tilemap = new Class({ { for (var i = 0; i < location.length; i++) { - if (location[ i ].name === name) + if (location[i].name === name) { return i; } @@ -238229,7 +237425,7 @@ var Tilemap = new Class({ { var index = this.getLayerIndex(layer); - return (index !== null) ? this.layers[ index ] : null; + return (index !== null) ? this.layers[index] : null; }, /** @@ -238246,7 +237442,7 @@ var Tilemap = new Class({ { var index = this.getIndex(this.objects, name); - return (index !== null) ? this.objects[ index ] : null; + return (index !== null) ? this.objects[index] : null; }, /** @@ -238483,7 +237679,7 @@ var Tilemap = new Class({ { var index = this.getIndex(this.tilesets, name); - return (index !== null) ? this.tilesets[ index ] : null; + return (index !== null) ? this.tilesets[index] : null; }, /** @@ -238562,7 +237758,7 @@ var Tilemap = new Class({ layer: { get: function () { - return this.layers[ this.currentLayerIndex ]; + return this.layers[this.currentLayerIndex]; }, set: function (layer) @@ -238775,9 +237971,9 @@ var Tilemap = new Class({ for (var i = index; i < this.layers.length; i++) { - if (this.layers[ i ].tilemapLayer) + if (this.layers[i].tilemapLayer) { - this.layers[ i ].tilemapLayer.layerIndex--; + this.layers[i].tilemapLayer.layerIndex--; } } @@ -238812,7 +238008,7 @@ var Tilemap = new Class({ if (index !== null) { - layer = this.layers[ index ]; + layer = this.layers[index]; layer.tilemapLayer.destroy(); @@ -238845,9 +238041,9 @@ var Tilemap = new Class({ for (var i = 0; i < layers.length; i++) { - if (layers[ i ].tilemapLayer) + if (layers[i].tilemapLayer) { - layers[ i ].tilemapLayer.destroy(false); + layers[i].tilemapLayer.destroy(false); } } @@ -238885,7 +238081,7 @@ var Tilemap = new Class({ for (var i = 0; i < tiles.length; i++) { - var tile = tiles[ i ]; + var tile = tiles[i]; removed.push(this.removeTileAt(tile.x, tile.y, true, recalculateFaces, tile.tilemapLayer)); @@ -239009,7 +238205,7 @@ var Tilemap = new Class({ for (var i = 0; i < layers.length; i++) { - TilemapComponents.RenderDebug(graphics, styleConfig, layers[ i ]); + TilemapComponents.RenderDebug(graphics, styleConfig, layers[i]); } return this; @@ -239313,18 +238509,18 @@ var Tilemap = new Class({ // Update the base tile size on all layers & tiles for (var i = 0; i < this.layers.length; i++) { - this.layers[ i ].baseTileWidth = tileWidth; - this.layers[ i ].baseTileHeight = tileHeight; + this.layers[i].baseTileWidth = tileWidth; + this.layers[i].baseTileHeight = tileHeight; - var mapData = this.layers[ i ].data; - var mapWidth = this.layers[ i ].width; - var mapHeight = this.layers[ i ].height; + var mapData = this.layers[i].data; + var mapWidth = this.layers[i].width; + var mapHeight = this.layers[i].height; for (var row = 0; row < mapHeight; row++) { for (var col = 0; col < mapWidth; col++) { - var tile = mapData[ row ][ col ]; + var tile = mapData[row][col]; if (tile !== null) { @@ -239368,7 +238564,7 @@ var Tilemap = new Class({ { for (var col = 0; col < mapWidth; col++) { - var tile = mapData[ row ][ col ]; + var tile = mapData[row][col]; if (tile !== null) { @@ -264382,6 +263578,30 @@ module.exports = { /******/ } /******/ /************************************************************************/ +/******/ /* webpack/runtime/compat get default export */ +/******/ (() => { +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = (module) => { +/******/ var getter = module && module.__esModule ? +/******/ () => (module['default']) : +/******/ () => (module); +/******/ __webpack_require__.d(getter, { a: getter }); +/******/ return getter; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ /******/ /* webpack/runtime/global */ /******/ (() => { /******/ __webpack_require__.g = (function() { @@ -264394,6 +263614,22 @@ module.exports = { /******/ })(); /******/ })(); /******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ /************************************************************************/ /******/ /******/ // startup diff --git a/dist/phaser.min.js b/dist/phaser.min.js index 348523f3ce..b85cf01f56 100644 --- a/dist/phaser.min.js +++ b/dist/phaser.min.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Phaser",[],e):"object"==typeof exports?exports.Phaser=e():t.Phaser=e()}(this,()=>(()=>{var t={50792(t){"use strict";var e=Object.prototype.hasOwnProperty,i="~";function r(){}function s(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function n(t,e,r,n,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var o=new s(r,n||t,a),h=i?i+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],o]:t._events[h].push(o):(t._events[h]=o,t._eventsCount++),t}function a(t,e){0===--t._eventsCount?t._events=new r:delete t._events[e]}function o(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(i=!1)),o.prototype.eventNames=function(){var t,r,s=[];if(0===this._eventsCount)return s;for(r in t=this._events)e.call(t,r)&&s.push(i?r.slice(1):r);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(t)):s},o.prototype.listeners=function(t){var e=i?i+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var s=0,n=r.length,a=new Array(n);s3*Math.PI/2?p.y=1:l>Math.PI?(p.x=1,p.y=1):l>Math.PI/2&&(p.x=1);for(var g=[],m=0;m0&&u.enableFilters().filters.external.addBlur(e.blurQuality,e.blurRadius,e.blurRadius,1,void 0,e.blurSteps),d instanceof r&&d.enableFilters();var f=(e.useInternal?d.filters.internal:d.filters.external).addMask(u,e.invert);h.push(f)}return h}},11517(t,e,i){var r=i(38829);t.exports=function(t,e,i,s){for(var n=t[0],a=1;a=i;r--){var s=t[r],n=!0;for(var a in e)s[a]!==e[a]&&(n=!1);if(n)return s}return null}},94420(t,e,i){var r=i(11879),s=i(60461),n=i(95540),a=i(29747),o=new(i(41481))({sys:{queueDepthSort:a,events:{once:a}}},0,0,1,1).setOrigin(0,0);t.exports=function(t,e){void 0===e&&(e={});var i=e.hasOwnProperty("width"),a=e.hasOwnProperty("height"),h=n(e,"width",-1),l=n(e,"height",-1),u=n(e,"cellWidth",1),d=n(e,"cellHeight",u),c=n(e,"position",s.TOP_LEFT),f=n(e,"x",0),p=n(e,"y",0),g=0,m=0,v=h*u,y=l*d;o.setPosition(f,p),o.setSize(u,d);for(var x=0;x0?s(a,i):i<0&&n(a,Math.abs(i));for(var o=0;o=0;a--)t[a][e]+=i+o*r,o++;return t}},43967(t){t.exports=function(t,e,i,r,s,n){var a;void 0===r&&(r=0),void 0===s&&(s=0),void 0===n&&(n=1);var o=0,h=t.length;if(1===n)for(a=s;a=0;a--)t[a][e]=i+o*r,o++;return t}},88926(t,e,i){var r=i(28176);t.exports=function(t,e){for(var i=0;i=h||-1===l)){var c=t[l],f=c.x,p=c.y;c.x=a,c.y=o,a=f,o=p,0===s?l--:l++}}return n.x=a,n.y=o,n}},8628(t,e,i){var r=i(33680);t.exports=function(t){return r(t)}},21837(t,e,i){var r=i(7602);t.exports=function(t,e,i,s,n){void 0===n&&(n=!1);var a,o=Math.abs(s-i)/t.length;if(n)for(a=0;a0){if(0===t)this.frames=i.concat(this.frames);else if(t===this.frames.length)this.frames=this.frames.concat(i);else{var r=this.frames.slice(0,t),s=this.frames.slice(t);this.frames=r.concat(i,s)}this.updateFrameSequence()}return this},checkFrame:function(t){return t>=0&&t0){n.isLast=!0,n.nextFrame=d[0],d[0].prevFrame=n;var y=1/(d.length-1);for(a=0;a0?t.inReverse&&t.forward?t.forward=!1:this.repeatAnimation(t):t.complete():this.updateAndGetNextTick(t,e.nextFrame)},handleYoyoFrame:function(t,e){if(e||(e=!1),t.inReverse===!e&&t.repeatCounter>0)return(0===t.repeatDelay||t.pendingRepeat)&&(t.forward=e),void this.repeatAnimation(t);if(t.inReverse===e||0!==t.repeatCounter){t.forward=e;var i=e?t.currentFrame.nextFrame:t.currentFrame.prevFrame;this.updateAndGetNextTick(t,i)}else t.complete()},getLastFrame:function(){return this.frames[this.frames.length-1]},previousFrame:function(t){var e=t.currentFrame;e.isFirst?t.yoyo?this.handleYoyoFrame(t,!0):t.repeatCounter>0?(t.inReverse&&!t.forward||(t.forward=!0),this.repeatAnimation(t)):t.complete():this.updateAndGetNextTick(t,e.prevFrame)},updateAndGetNextTick:function(t,e){t.setCurrentFrame(e),this.getNextTick(t)},removeFrame:function(t){var e=this.frames.indexOf(t);return-1!==e&&this.removeFrameAt(e),this},removeFrameAt:function(t){return this.frames.splice(t,1),this.updateFrameSequence(),this},repeatAnimation:function(t){if(2===t._pendingStop){if(0===t._pendingStopValue)return t.stop();t._pendingStopValue--}t.repeatDelay>0&&!t.pendingRepeat?(t.pendingRepeat=!0,t.accumulator-=t.nextTick,t.nextTick+=t.repeatDelay):(t.repeatCounter--,t.forward?t.setCurrentFrame(t.currentFrame.nextFrame):t.setCurrentFrame(t.currentFrame.prevFrame),t.isPlaying&&(this.getNextTick(t),t.handleRepeat()))},toJSON:function(){var t={key:this.key,type:this.type,frames:[],frameRate:this.frameRate,duration:this.duration,skipMissedFrames:this.skipMissedFrames,delay:this.delay,repeat:this.repeat,repeatDelay:this.repeatDelay,yoyo:this.yoyo,showBeforeDelay:this.showBeforeDelay,showOnStart:this.showOnStart,randomFrame:this.randomFrame,hideOnComplete:this.hideOnComplete};return this.frames.forEach(function(e){t.frames.push(e.toJSON())}),t},updateFrameSequence:function(){for(var t,e=this.frames.length,i=1/(e-1),r=0;r1?(t.isLast=!0,t.prevFrame=this.frames[e-2],t.nextFrame=this.frames[0]):e>1&&(t.prevFrame=this.frames[r-1],t.nextFrame=this.frames[r+1]);return this},pause:function(){return this.paused=!0,this},resume:function(){return this.paused=!1,this},destroy:function(){this.manager.off&&(this.manager.off(n.PAUSE_ALL,this.pause,this),this.manager.off(n.RESUME_ALL,this.resume,this)),this.manager.remove(this.key);for(var t=0;t-1)){for(var p=0,g=u;g<=c;g++){var m=g.toString(),v=o[m];if(v){var y=l(v,"duration",d.MAX_SAFE_INTEGER);a.push({key:t,frame:m,duration:y}),p+=y}}"reverse"===f&&(a=a.reverse());var x,T={key:h,frames:a,duration:p,yoyo:"pingpong"===f};i?i.anims&&(x=i.anims.create(T)):x=n.create(T),x&&r.push(x)}});return r},create:function(t){var e=t.key,i=!1;return e&&((i=this.get(e))?console.warn("AnimationManager key already exists: "+e):(i=new r(this,e,t),this.anims.set(e,i),this.emit(o.ADD_ANIMATION,e,i))),i},fromJSON:function(t,e){void 0===e&&(e=!1),e&&this.anims.clear(),"string"==typeof t&&(t=JSON.parse(t));var i=[];if(t.hasOwnProperty("anims")&&Array.isArray(t.anims)){for(var r=0;rn&&(l=0),this.randomFrame&&(l=s(0,n-1));var u=r.frames[l];0!==l||this.forward||(u=r.getLastFrame()),this.currentFrame=u}else console.warn("Missing animation: "+i);return this.parent},pause:function(t){return this._paused||(this._paused=!0,this._wasPlaying=this.isPlaying,this.isPlaying=!1),void 0!==t&&this.setCurrentFrame(t),this.parent},resume:function(t){return this._paused&&(this._paused=!1,this.isPlaying=this._wasPlaying),void 0!==t&&this.setCurrentFrame(t),this.parent},playAfterDelay:function(t,e){if(this.isPlaying){var i=this.nextAnim,r=this.nextAnimsQueue;i&&r.unshift(i),this.nextAnim=t,this._pendingStop=1,this._pendingStopValue=e}else this.delayCounter=e,this.play(t,!0);return this.parent},playAfterRepeat:function(t,e){if(void 0===e&&(e=1),this.isPlaying){var i=this.nextAnim,r=this.nextAnimsQueue;i&&r.unshift(i),-1!==this.repeatCounter&&e>this.repeatCounter&&(e=this.repeatCounter),this.nextAnim=t,this._pendingStop=2,this._pendingStopValue=e}else this.play(t);return this.parent},play:function(t,e){void 0===e&&(e=!1);var i=this.currentAnim,r=this.parent,s="string"==typeof t?t:t.key;if(e&&this.isPlaying&&i.key===s)return r;if(i&&this.isPlaying){var n=this.animationManager.getMix(i.key,t);if(n>0)return this.playAfterDelay(t,n)}return this.forward=!0,this.inReverse=!1,this._paused=!1,this._wasPlaying=!0,this.startAnimation(t)},playReverse:function(t,e){void 0===e&&(e=!1);var i="string"==typeof t?t:t.key;return e&&this.isPlaying&&this.currentAnim.key===i?this.parent:(this.forward=!1,this.inReverse=!0,this._paused=!1,this._wasPlaying=!0,this.startAnimation(t))},startAnimation:function(t){this.load(t);var e=this.currentAnim,i=this.parent;return e?(this.repeatCounter=-1===this.repeat?Number.MAX_VALUE:this.repeat,e.getFirstTick(this),this.isPlaying=!0,this.pendingRepeat=!1,this.hasStarted=!1,this._pendingStop=0,this._pendingStopValue=0,this._paused=!1,this.delayCounter+=this.delay,0===this.delayCounter?this.handleStart():this.showBeforeDelay&&this.setCurrentFrame(this.currentFrame),i):i},handleStart:function(){this.showOnStart&&this.parent.setVisible(!0),this.setCurrentFrame(this.currentFrame),this.hasStarted=!0,this.emitEvents(o.ANIMATION_START)},handleRepeat:function(){this.pendingRepeat=!1,this.emitEvents(o.ANIMATION_REPEAT)},handleStop:function(){this._pendingStop=0,this.isPlaying=!1,this.emitEvents(o.ANIMATION_STOP)},handleComplete:function(){this._pendingStop=0,this.isPlaying=!1,this.hideOnComplete&&this.parent.setVisible(!1),this.emitEvents(o.ANIMATION_COMPLETE,o.ANIMATION_COMPLETE_KEY)},emitEvents:function(t,e){var i=this.currentAnim;if(i){var r=this.currentFrame,s=this.parent,n=r.textureFrame;s.emit(t,i,r,s,n),e&&s.emit(e+i.key,i,r,s,n)}},reverse:function(){return this.isPlaying&&(this.inReverse=!this.inReverse,this.forward=!this.forward),this.parent},getProgress:function(){var t=this.currentFrame;if(!t)return 0;var e=t.progress;return this.inReverse&&(e*=-1),e},setProgress:function(t){return this.forward||(t=1-t),this.setCurrentFrame(this.currentAnim.getFrameByProgress(t)),this.parent},setRepeat:function(t){return this.repeatCounter=-1===t?Number.MAX_VALUE:t,this.parent},globalRemove:function(t,e){void 0===e&&(e=this.currentAnim),this.isPlaying&&e.key===this.currentAnim.key&&(this.stop(),this.setCurrentFrame(this.currentAnim.frames[0]))},restart:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1);var i=this.currentAnim,r=this.parent;return i?(e&&(this.repeatCounter=-1===this.repeat?Number.MAX_VALUE:this.repeat),i.getFirstTick(this),this.emitEvents(o.ANIMATION_RESTART),this.isPlaying=!0,this.pendingRepeat=!1,this.hasStarted=!t,this._pendingStop=0,this._pendingStopValue=0,this._paused=!1,this.setCurrentFrame(i.frames[0]),this.parent):r},complete:function(){if(this._pendingStop=0,this.isPlaying=!1,this.currentAnim&&this.handleComplete(),this.nextAnim){var t=this.nextAnim;this.nextAnim=this.nextAnimsQueue.length>0?this.nextAnimsQueue.shift():null,this.play(t)}return this.parent},stop:function(){if(this._pendingStop=0,this.isPlaying=!1,this.delayCounter=0,this.currentAnim&&this.handleStop(),this.nextAnim){var t=this.nextAnim;this.nextAnim=this.nextAnimsQueue.shift(),this.play(t)}return this.parent},stopAfterDelay:function(t){return this._pendingStop=1,this._pendingStopValue=t,this.parent},stopAfterRepeat:function(t){return void 0===t&&(t=1),-1!==this.repeatCounter&&t>this.repeatCounter&&(t=this.repeatCounter),this._pendingStop=2,this._pendingStopValue=t,this.parent},stopOnFrame:function(t){return this._pendingStop=3,this._pendingStopValue=t,this.parent},getTotalFrames:function(){return this.currentAnim?this.currentAnim.getTotalFrames():0},update:function(t,e){var i=this.currentAnim;if(this.isPlaying&&i&&!i.paused){if(this.accumulator+=e*this.timeScale*this.animationManager.globalTimeScale,1===this._pendingStop&&(this._pendingStopValue-=e,this._pendingStopValue<=0))return this.stop();if(this.hasStarted){if(this.accumulator>=this.nextTick&&(this.forward?i.nextFrame(this):i.previousFrame(this),this.isPlaying&&0===this._pendingStop&&this.skipMissedFrames&&this.accumulator>this.nextTick)){var r=0;do{this.forward?i.nextFrame(this):i.previousFrame(this),r++}while(this.isPlaying&&this.accumulator>this.nextTick&&r<60)}}else this.accumulator>=this.delayCounter&&(this.accumulator-=this.delayCounter,this.handleStart())}},setCurrentFrame:function(t){var e=this.parent;return this.currentFrame=t,e.texture=t.frame.texture,e.frame=t.frame,e.isCropped&&e.frame.updateCropUVs(e._crop,e.flipX,e.flipY),t.setAlpha&&(e.alpha=t.alpha),e.setSizeToFrame(),e._originComponent&&(t.frame.customPivot?e.setOrigin(t.frame.pivotX,t.frame.pivotY):e.updateDisplayOrigin()),this.isPlaying&&this.hasStarted&&(this.emitEvents(o.ANIMATION_UPDATE),3===this._pendingStop&&this._pendingStopValue===t&&this.stop()),e},nextFrame:function(){return this.currentAnim&&this.currentAnim.nextFrame(this),this.parent},previousFrame:function(){return this.currentAnim&&this.currentAnim.previousFrame(this),this.parent},get:function(t){return this.anims?this.anims.get(t):null},exists:function(t){return!!this.anims&&this.anims.has(t)},create:function(t){var e=t.key,i=!1;return e&&((i=this.get(e))?console.warn("Animation key already exists: "+e):(i=new r(this,e,t),this.anims||(this.anims=new a),this.anims.set(e,i))),i},createFromAseprite:function(t,e){return this.animationManager.createFromAseprite(t,e,this.parent)},generateFrameNames:function(t,e){return this.animationManager.generateFrameNames(t,e)},generateFrameNumbers:function(t,e){return this.animationManager.generateFrameNumbers(t,e)},remove:function(t){var e=this.get(t);return e&&(this.currentAnim===e&&this.stop(),this.anims.delete(t)),e},destroy:function(){this.animationManager.off(o.REMOVE_ANIMATION,this.globalRemove,this),this.anims&&this.anims.clear(),this.animationManager=null,this.parent=null,this.nextAnim=null,this.nextAnimsQueue.length=0,this.currentAnim=null,this.currentFrame=null},isPaused:{get:function(){return this._paused}}});t.exports=l},57090(t){t.exports="add"},25312(t){t.exports="animationcomplete"},89580(t){t.exports="animationcomplete-"},52860(t){t.exports="animationrepeat"},63850(t){t.exports="animationrestart"},99085(t){t.exports="animationstart"},28087(t){t.exports="animationstop"},1794(t){t.exports="animationupdate"},52562(t){t.exports="pauseall"},57953(t){t.exports="remove"},68339(t){t.exports="resumeall"},74943(t,e,i){t.exports={ADD_ANIMATION:i(57090),ANIMATION_COMPLETE:i(25312),ANIMATION_COMPLETE_KEY:i(89580),ANIMATION_REPEAT:i(52860),ANIMATION_RESTART:i(63850),ANIMATION_START:i(99085),ANIMATION_STOP:i(28087),ANIMATION_UPDATE:i(1794),PAUSE_ALL:i(52562),REMOVE_ANIMATION:i(57953),RESUME_ALL:i(68339)}},60421(t,e,i){t.exports={Animation:i(42099),AnimationFrame:i(41138),AnimationManager:i(60848),AnimationState:i(9674),Events:i(74943)}},2161(t,e,i){var r=i(83419),s=i(90330),n=i(50792),a=i(24736),o=new r({initialize:function(){this.entries=new s,this.events=new n},add:function(t,e){return this.entries.set(t,e),this.events.emit(a.ADD,this,t,e),this},has:function(t){return this.entries.has(t)},exists:function(t){return this.entries.has(t)},get:function(t){return this.entries.get(t)},remove:function(t){var e=this.get(t);return e&&(this.entries.delete(t),this.events.emit(a.REMOVE,this,t,e.data)),this},getKeys:function(){return this.entries.keys()},destroy:function(){this.entries.clear(),this.events.removeAllListeners(),this.entries=null,this.events=null}});t.exports=o},24047(t,e,i){var r=i(2161),s=i(83419),n=i(8443),a=new s({initialize:function(t){this.game=t,this.binary=new r,this.bitmapFont=new r,this.json=new r,this.physics=new r,this.shader=new r,this.audio=new r,this.video=new r,this.text=new r,this.html=new r,this.tilemap=new r,this.xml=new r,this.atlas=new r,this.custom={},this.game.events.once(n.DESTROY,this.destroy,this)},addCustom:function(t){return this.custom.hasOwnProperty(t)||(this.custom[t]=new r),this.custom[t]},destroy:function(){for(var t=["binary","bitmapFont","json","physics","shader","audio","video","text","html","tilemap","xml","atlas"],e=0;ef&&w*i+b*sd&&w*r+b*ns&&(t=s),t},clampY:function(t){var e=this._bounds,i=this.displayHeight,r=e.y+(i-this.height)/2,s=Math.max(r,r+e.height-i);return ts&&(t=s),t},removeBounds:function(){return this.useBounds=!1,this.dirty=!0,this._bounds.setEmpty(),this},setAngle:function(t){return void 0===t&&(t=0),this.rotation=s(t),this},setBackgroundColor:function(t){return void 0===t&&(t="rgba(0,0,0,0)"),this.backgroundColor=d(t),this.transparent=0===this.backgroundColor.alpha,this},setBounds:function(t,e,i,r,s){return void 0===s&&(s=!1),this._bounds.setTo(t,e,i,r),this.dirty=!0,this.useBounds=!0,s?this.centerToBounds():(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},setForceComposite:function(t){return this.forceComposite=t,this},getBounds:function(t){void 0===t&&(t=new o);var e=this._bounds;return t.setTo(e.x,e.y,e.width,e.height),t},setName:function(t){return void 0===t&&(t=""),this.name=t,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setRoundPixels:function(t){return this.roundPixels=t,this},setScene:function(t,e){void 0===e&&(e=!0),this.scene&&this._customViewport&&this.sceneManager.customViewports--,this.scene=t,this.isSceneCamera=e;var i=t.sys;return this.sceneManager=i.game.scene,this.scaleManager=i.scale,this.cameraManager=i.cameras,this.updateSystem(),this},setScroll:function(t,e){return void 0===e&&(e=t),this.scrollX=t,this.scrollY=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},setViewport:function(t,e,i,r){return this.x=t,this.y=e,this.width=i,this.height=r,this},setZoom:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),0===t&&(t=.001),0===e&&(e=.001),this.zoomX=t,this.zoomY=e,this},setMask:function(t,e){return void 0===e&&(e=!0),this.mask=t,this._maskCamera=e?this.cameraManager.default:this,this},clearMask:function(t){return void 0===t&&(t=!1),t&&this.mask&&this.mask.destroy(),this.mask=null,this},toJSON:function(){var t={name:this.name,x:this.x,y:this.y,width:this.width,height:this.height,zoom:this.zoom,rotation:this.rotation,roundPixels:this.roundPixels,scrollX:this.scrollX,scrollY:this.scrollY,backgroundColor:this.backgroundColor.rgba};return this.useBounds&&(t.bounds={x:this._bounds.x,y:this._bounds.y,width:this._bounds.width,height:this._bounds.height}),t},update:function(){},setIsSceneCamera:function(t){return this.isSceneCamera=t,this},updateSystem:function(){if(this.scaleManager&&this.isSceneCamera){var t=0!==this._x||0!==this._y||this.scaleManager.width!==this._width||this.scaleManager.height!==this._height,e=this.sceneManager;t&&!this._customViewport?e.customViewports++:!t&&this._customViewport&&e.customViewports--,this.dirty=!0,this._customViewport=t}},destroy:function(){this.emit(a.DESTROY,this),this.removeAllListeners(),this.matrix.destroy(),this.matrixCombined.destroy(),this.matrixExternal.destroy(),this.culledObjects=[],this._customViewport&&this.sceneManager.customViewports--,this.renderList=[],this._bounds=null,this.scene=null,this.scaleManager=null,this.sceneManager=null,this.cameraManager=null},x:{get:function(){return this._x},set:function(t){this._x=t,this.updateSystem()}},y:{get:function(){return this._y},set:function(t){this._y=t,this.updateSystem()}},width:{get:function(){return this._width},set:function(t){this._width=t,this.updateSystem()}},height:{get:function(){return this._height},set:function(t){this._height=t,this.updateSystem()}},scrollX:{get:function(){return this._scrollX},set:function(t){t!==this._scrollX&&(this._scrollX=t,this.dirty=!0)}},scrollY:{get:function(){return this._scrollY},set:function(t){t!==this._scrollY&&(this._scrollY=t,this.dirty=!0)}},zoom:{get:function(){return(this._zoomX+this._zoomY)/2},set:function(t){this._zoomX=t,this._zoomY=t,this.dirty=!0}},zoomX:{get:function(){return this._zoomX},set:function(t){this._zoomX=t,this.dirty=!0}},zoomY:{get:function(){return this._zoomY},set:function(t){this._zoomY=t,this.dirty=!0}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=t,this.dirty=!0}},centerX:{get:function(){return this.x+.5*this.width}},centerY:{get:function(){return this.y+.5*this.height}},displayWidth:{get:function(){return this.width/this.zoomX}},displayHeight:{get:function(){return this.height/this.zoomY}}});t.exports=f},38058(t,e,i){var r=i(71911),s=i(67502),n=i(45319),a=i(83419),o=i(31401),h=i(20052),l=i(19715),u=i(28915),d=i(87841),c=i(26099),f=new a({Extends:r,initialize:function(t,e,i,s){r.call(this,t,e,i,s),this.filters={internal:new o.FilterList(this),external:new o.FilterList(this)},this.isObjectInversion=!1,this.inputEnabled=!0,this.fadeEffect=new h.Fade(this),this.flashEffect=new h.Flash(this),this.shakeEffect=new h.Shake(this),this.panEffect=new h.Pan(this),this.rotateToEffect=new h.RotateTo(this),this.zoomEffect=new h.Zoom(this),this.lerp=new c(1,1),this.followOffset=new c,this.deadzone=null,this._follow=null},setDeadzone:function(t,e){if(void 0===t)this.deadzone=null;else{if(this.deadzone?(this.deadzone.width=t,this.deadzone.height=e):this.deadzone=new d(0,0,t,e),this._follow){var i=this.width/2,r=this.height/2,n=this._follow.x-this.followOffset.x,a=this._follow.y-this.followOffset.y;this.midPoint.set(n,a),this.scrollX=n-i,this.scrollY=a-r}s(this.deadzone,this.midPoint.x,this.midPoint.y)}return this},fadeIn:function(t,e,i,r,s,n){return this.fadeEffect.start(!1,t,e,i,r,!0,s,n)},fadeOut:function(t,e,i,r,s,n){return this.fadeEffect.start(!0,t,e,i,r,!0,s,n)},fadeFrom:function(t,e,i,r,s,n,a){return this.fadeEffect.start(!1,t,e,i,r,s,n,a)},fade:function(t,e,i,r,s,n,a){return this.fadeEffect.start(!0,t,e,i,r,s,n,a)},flash:function(t,e,i,r,s,n,a){return this.flashEffect.start(t,e,i,r,s,n,a)},shake:function(t,e,i,r,s){return this.shakeEffect.start(t,e,i,r,s)},pan:function(t,e,i,r,s,n,a){return this.panEffect.start(t,e,i,r,s,n,a)},rotateTo:function(t,e,i,r,s,n,a){return this.rotateToEffect.start(t,e,i,r,s,n,a)},zoomTo:function(t,e,i,r,s,n){return this.zoomEffect.start(t,e,i,r,s,n)},preRender:function(){this.renderList.length=0;var t=this.width,e=this.height,i=.5*t,r=.5*e,n=this.zoomX,a=this.zoomY;this.renderRoundPixels=this.roundPixels&&Number.isInteger(n)&&Number.isInteger(a);var o=t*this.originX,h=e*this.originY,d=this._follow,c=this.deadzone,f=this.scrollX,p=this.scrollY;c&&s(c,this.midPoint.x,this.midPoint.y);var g=!1;if(d&&!this.panEffect.isRunning){var m=this.lerp,v=d.x-this.followOffset.x,y=d.y-this.followOffset.y;c?(vc.right&&(f=u(f,f+(v-c.right),m.x)),yc.bottom&&(p=u(p,p+(y-c.bottom),m.y))):(f=u(f,v-o,m.x),p=u(p,y-h,m.y)),g=!0}this.useBounds&&(f=this.clampX(f),p=this.clampY(p)),this.scrollX=f,this.scrollY=p;var x=f+i,T=p+r;this.midPoint.set(x,T);var w=t/n,b=e/a,S=x-w/2,C=T-b/2;this.worldView.setTo(S,C,w,b);var E=this.matrix,A=this.matrixExternal;this.isObjectInversion?(E.loadIdentity(),E.translate(o,h),E.scale(n,a),E.rotate(this.rotation),E.translate(-f-o,-p-h)):(E.applyITRS(o,h,this.rotation,n,a),E.translate(-f-o,-p-h)),A.applyITRS(this.x,this.y,0,1,1),this.shakeEffect.preRender(),A.multiply(E,this.matrixCombined),g&&this.emit(l.FOLLOW_UPDATE,this,d)},getViewMatrix:function(t){return t||this.forceComposite||this.filters.external.length>0||this.filters.internal.length>0?this.matrix:this.matrixCombined},getPaddingWrapper:function(t){var e={padding:0},i=new Proxy(this,{get:function(t,i){switch(i){case"padding":return e.padding;case"x":case"y":case"scrollX":case"scrollY":return t[i]+e.padding;case"width":case"height":return t[i]-2*e.padding;default:return t[i]}},set:function(i,r,s){switch(r){case"padding":var n=e.padding;e.padding=s;var a=e.padding-n;return i.x-=a,i.y-=a,i.width+=2*a,i.height+=2*a,i.scrollX-=a,i.scrollY-=a,t;case"x":case"y":case"scrollX":case"scrollY":return i[r]=s-e.padding;case"width":case"height":return i[r]=s+2*e.padding;default:return i[r]=s}}});return i.padding=t||0,i},setLerp:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.lerp.set(t,e),this},setFollowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),this.followOffset.set(t,e),this},startFollow:function(t,e,i,r,s,a){void 0===e&&(e=!1),void 0===i&&(i=1),void 0===r&&(r=i),void 0===s&&(s=0),void 0===a&&(a=s),this._follow=t,this.roundPixels=e,i=n(i,0,1),r=n(r,0,1),this.lerp.set(i,r),this.followOffset.set(s,a);var o=this.width/2,h=this.height/2,l=t.x-s,u=t.y-a;return this.midPoint.set(l,u),this.scrollX=l-o,this.scrollY=u-h,this.useBounds&&(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},stopFollow:function(){return this._follow=null,this},resetFX:function(){return this.rotateToEffect.reset(),this.panEffect.reset(),this.shakeEffect.reset(),this.flashEffect.reset(),this.fadeEffect.reset(),this},update:function(t,e){this.visible&&(this.rotateToEffect.update(t,e),this.panEffect.update(t,e),this.zoomEffect.update(t,e),this.shakeEffect.update(t,e),this.flashEffect.update(t,e),this.fadeEffect.update(t,e))},destroy:function(){this.resetFX(),this.filters.internal.destroy(),this.filters.external.destroy(),r.prototype.destroy.call(this),this._follow=null,this.deadzone=null}});t.exports=f},32743(t,e,i){var r=i(38058),s=i(83419),n=i(95540),a=i(37277),o=i(37303),h=i(97480),l=i(44594),u=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.roundPixels=t.sys.game.config.roundPixels,this.cameras=[],this.main,this.default,t.sys.events.once(l.BOOT,this.boot,this),t.sys.events.on(l.START,this.start,this)},boot:function(){var t=this.systems;t.settings.cameras?this.fromJSON(t.settings.cameras):this.add(),this.main=this.cameras[0],this.default=new r(0,0,t.scale.width,t.scale.height).setScene(this.scene),t.game.scale.on(h.RESIZE,this.onResize,this),this.systems.events.once(l.DESTROY,this.destroy,this)},start:function(){if(!this.main){var t=this.systems;t.settings.cameras?this.fromJSON(t.settings.cameras):this.add(),this.main=this.cameras[0]}var e=this.systems.events;e.on(l.UPDATE,this.update,this),e.once(l.SHUTDOWN,this.shutdown,this)},add:function(t,e,i,s,n,a){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===s&&(s=this.scene.sys.scale.height),void 0===n&&(n=!1),void 0===a&&(a="");var o=new r(t,e,i,s);return o.setName(a),o.setScene(this.scene),o.setRoundPixels(this.roundPixels),o.id=this.getNextID(),this.cameras.push(o),n&&(this.main=o),o},addExisting:function(t,e){return void 0===e&&(e=!1),-1===this.cameras.indexOf(t)?(t.id=this.getNextID(),t.setRoundPixels(this.roundPixels),this.cameras.push(t),e&&(this.main=t),t):null},getNextID:function(){for(var t=this.cameras,e=1,i=0;i<32;i++){for(var r=!1,s=0;s0){n.preRender();var a=this.getVisibleChildren(e.getChildren(),n);t.render(i,a,n)}}},getVisibleChildren:function(t,e){return t.filter(function(t){return t.willRender(e)})},resetAll:function(){for(var t=0;t=0}else this.clockwise=this.destination>=this.source;return this.camera.emit(n.ROTATE_START,this.camera,this,i,this.destination),u},update:function(t,e){if(this.isRunning){this._elapsed+=e;var i=r(this._elapsed/this.duration,0,1);this.progress=i;var s=this.camera;if(this._elapsedthis.maxZoom&&(e.zoom=this.maxZoom))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=n},58818(t,e,i){var r=i(83419),s=i(35154),n=new r({initialize:function(t){this.camera=s(t,"camera",null),this.left=s(t,"left",null),this.right=s(t,"right",null),this.up=s(t,"up",null),this.down=s(t,"down",null),this.zoomIn=s(t,"zoomIn",null),this.zoomOut=s(t,"zoomOut",null),this.zoomSpeed=s(t,"zoomSpeed",.01),this.minZoom=s(t,"minZoom",.001),this.maxZoom=s(t,"maxZoom",1e3),this.accelX=0,this.accelY=0;var e=s(t,"acceleration",null);"number"==typeof e?(this.accelX=e,this.accelY=e):(this.accelX=s(t,"acceleration.x",0),this.accelY=s(t,"acceleration.y",0)),this.dragX=0,this.dragY=0;var i=s(t,"drag",null);"number"==typeof i?(this.dragX=i,this.dragY=i):(this.dragX=s(t,"drag.x",0),this.dragY=s(t,"drag.y",0)),this.maxSpeedX=0,this.maxSpeedY=0;var r=s(t,"maxSpeed",null);"number"==typeof r?(this.maxSpeedX=r,this.maxSpeedY=r):(this.maxSpeedX=s(t,"maxSpeed.x",0),this.maxSpeedY=s(t,"maxSpeed.y",0)),this._speedX=0,this._speedY=0,this._zoom=0,this.active=null!==this.camera},start:function(){return this.active=null!==this.camera,this},stop:function(){return this.active=!1,this},setCamera:function(t){return this.camera=t,this},update:function(t){if(this.active){void 0===t&&(t=1);var e=this.camera;this._speedX>0?(this._speedX-=this.dragX*t,this._speedX<0&&(this._speedX=0)):this._speedX<0&&(this._speedX+=this.dragX*t,this._speedX>0&&(this._speedX=0)),this._speedY>0?(this._speedY-=this.dragY*t,this._speedY<0&&(this._speedY=0)):this._speedY<0&&(this._speedY+=this.dragY*t,this._speedY>0&&(this._speedY=0)),this.up&&this.up.isDown?(this._speedY+=this.accelY,this._speedY>this.maxSpeedY&&(this._speedY=this.maxSpeedY)):this.down&&this.down.isDown&&(this._speedY-=this.accelY,this._speedY<-this.maxSpeedY&&(this._speedY=-this.maxSpeedY)),this.left&&this.left.isDown?(this._speedX+=this.accelX,this._speedX>this.maxSpeedX&&(this._speedX=this.maxSpeedX)):this.right&&this.right.isDown&&(this._speedX-=this.accelX,this._speedX<-this.maxSpeedX&&(this._speedX=-this.maxSpeedX)),this.zoomIn&&this.zoomIn.isDown?this._zoom=-this.zoomSpeed:this.zoomOut&&this.zoomOut.isDown?this._zoom=this.zoomSpeed:this._zoom=0,0!==this._speedX&&(e.scrollX-=this._speedX*t|0),0!==this._speedY&&(e.scrollY-=this._speedY*t|0),0!==this._zoom&&(e.zoom+=this._zoom,e.zoomthis.maxZoom&&(e.zoom=this.maxZoom))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=n},38865(t,e,i){t.exports={FixedKeyControl:i(63091),SmoothedKeyControl:i(58818)}},26638(t,e,i){t.exports={Controls:i(38865),Scene2D:i(87969)}},8054(t,e,i){var r={VERSION:"4.1.0",LOG_VERSION:"v401",BlendModes:i(10312),ScaleModes:i(29795),AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,FOREVER:-1,NONE:4,UP:5,DOWN:6,LEFT:7,RIGHT:8};t.exports=r},69547(t,e,i){var r=i(83419),s=i(8054),n=i(42363),a=i(82264),o=i(95540),h=i(35154),l=i(41212),u=i(29747),d=i(75508),c=i(80333),f=new r({initialize:function(t){void 0===t&&(t={});var e=h(t,"scale",null);this.width=h(e,"width",1024,t),this.height=h(e,"height",768,t),this.zoom=h(e,"zoom",1,t),this.parent=h(e,"parent",void 0,t),this.scaleMode=h(e,e?"mode":"scaleMode",0,t),this.expandParent=h(e,"expandParent",!0,t),this.autoRound=h(e,"autoRound",!1,t),this.autoCenter=h(e,"autoCenter",0,t),this.resizeInterval=h(e,"resizeInterval",500,t),this.fullscreenTarget=h(e,"fullscreenTarget",null,t),this.minWidth=h(e,"min.width",0,t),this.maxWidth=h(e,"max.width",0,t),this.minHeight=h(e,"min.height",0,t),this.maxHeight=h(e,"max.height",0,t),this.snapWidth=h(e,"snap.width",0,t),this.snapHeight=h(e,"snap.height",0,t),this.renderType=h(t,"type",s.AUTO),this.canvas=h(t,"canvas",null),this.context=h(t,"context",null),this.canvasStyle=h(t,"canvasStyle",null),this.customEnvironment=h(t,"customEnvironment",!1),this.sceneConfig=h(t,"scene",null),this.seed=h(t,"seed",[(Date.now()*Math.random()).toString()]),d.RND=new d.RandomDataGenerator(this.seed),this.gameTitle=h(t,"title",""),this.gameURL=h(t,"url","https://phaser.io/"+s.LOG_VERSION),this.gameVersion=h(t,"version",""),this.autoFocus=h(t,"autoFocus",!0),this.stableSort=h(t,"stableSort",-1),-1===this.stableSort&&(this.stableSort=a.browser.es2019?1:0),a.features.stableSort=this.stableSort,this.domCreateContainer=h(t,"dom.createContainer",!1),this.domPointerEvents=h(t,"dom.pointerEvents","none"),this.inputKeyboard=h(t,"input.keyboard",!0),this.inputKeyboardEventTarget=h(t,"input.keyboard.target",window),this.inputKeyboardCapture=h(t,"input.keyboard.capture",[]),this.inputMouse=h(t,"input.mouse",!0),this.inputMouseEventTarget=h(t,"input.mouse.target",null),this.inputMousePreventDefaultDown=h(t,"input.mouse.preventDefaultDown",!0),this.inputMousePreventDefaultUp=h(t,"input.mouse.preventDefaultUp",!0),this.inputMousePreventDefaultMove=h(t,"input.mouse.preventDefaultMove",!0),this.inputMousePreventDefaultWheel=h(t,"input.mouse.preventDefaultWheel",!0),this.inputTouch=h(t,"input.touch",a.input.touch),this.inputTouchEventTarget=h(t,"input.touch.target",null),this.inputTouchCapture=h(t,"input.touch.capture",!0),this.inputActivePointers=h(t,"input.activePointers",1),this.inputSmoothFactor=h(t,"input.smoothFactor",0),this.inputWindowEvents=h(t,"input.windowEvents",!0),this.inputGamepad=h(t,"input.gamepad",!1),this.inputGamepadEventTarget=h(t,"input.gamepad.target",window),this.disableContextMenu=h(t,"disableContextMenu",!1),this.audio=h(t,"audio",{}),this.hideBanner=!1===h(t,"banner",null),this.hidePhaser=h(t,"banner.hidePhaser",!1),this.bannerTextColor=h(t,"banner.text","#ffffff"),this.bannerBackgroundColor=h(t,"banner.background",["#000814","#001d3d","#003566"]),""===this.gameTitle&&this.hidePhaser&&(this.hideBanner=!0),this.fps=h(t,"fps",null);var i=h(t,"render",null);this.autoMobileTextures=h(i,"autoMobileTextures",!0,t),this.antialias=h(i,"antialias",!0,t),this.antialiasGL=h(i,"antialiasGL",!0,t),this.mipmapFilter=h(i,"mipmapFilter","",t),this.mipmapRegeneration=h(i,"mipmapRegeneration",!1,t),this.desynchronized=h(i,"desynchronized",!1,t),this.roundPixels=h(i,"roundPixels",!1,t),this.selfShadow=h(i,"selfShadow",!1,t),this.pathDetailThreshold=h(i,"pathDetailThreshold",1,t),this.pixelArt=h(i,"pixelArt",!1,t),this.pixelArt&&(this.antialias=!1,this.antialiasGL=!1,this.roundPixels=!0),this.smoothPixelArt=h(i,"smoothPixelArt",!1,t),this.smoothPixelArt&&(this.antialias=!0,this.antialiasGL=!0,this.pixelArt=!1),this.transparent=h(i,"transparent",!1,t),this.clearBeforeRender=h(i,"clearBeforeRender",!0,t),this.preserveDrawingBuffer=h(i,"preserveDrawingBuffer",!1,t),this.premultipliedAlpha=h(i,"premultipliedAlpha",!0,t),this.skipUnreadyShaders=h(i,"skipUnreadyShaders",!1,t),this.failIfMajorPerformanceCaveat=h(i,"failIfMajorPerformanceCaveat",!1,t),this.powerPreference=h(i,"powerPreference","default",t),this.batchSize=h(i,"batchSize",16384,t),this.maxTextures=h(i,"maxTextures",-1,t),this.maxLights=h(i,"maxLights",10,t),this.renderNodes=h(i,"renderNodes",{},t);var r=h(t,"backgroundColor",0);this.backgroundColor=c(r),this.transparent&&(this.backgroundColor=c(0),this.backgroundColor.alpha=0),this.preBoot=h(t,"callbacks.preBoot",u),this.postBoot=h(t,"callbacks.postBoot",u),this.physics=h(t,"physics",{}),this.defaultPhysicsSystem=h(this.physics,"default",!1),this.loaderBaseURL=h(t,"loader.baseURL",""),this.loaderPath=h(t,"loader.path",""),this.loaderMaxParallelDownloads=h(t,"loader.maxParallelDownloads",a.os.android?6:32),this.loaderCrossOrigin=h(t,"loader.crossOrigin",void 0),this.loaderResponseType=h(t,"loader.responseType",""),this.loaderAsync=h(t,"loader.async",!0),this.loaderUser=h(t,"loader.user",""),this.loaderPassword=h(t,"loader.password",""),this.loaderTimeout=h(t,"loader.timeout",0),this.loaderMaxRetries=h(t,"loader.maxRetries",2),this.loaderWithCredentials=h(t,"loader.withCredentials",!1),this.loaderImageLoadType=h(t,"loader.imageLoadType","XHR"),this.loaderLocalScheme=h(t,"loader.localScheme",["file://","capacitor://"]),this.glowQuality=h(t,"filters.glow.quality",10),this.glowDistance=h(t,"filters.glow.distance",10),this.installGlobalPlugins=[],this.installScenePlugins=[];var f=h(t,"plugins",null),p=n.DefaultScene;f&&(Array.isArray(f)?this.defaultPlugins=f:l(f)&&(this.installGlobalPlugins=o(f,"global",[]),this.installScenePlugins=o(f,"scene",[]),Array.isArray(f.default)?p=f.default:Array.isArray(f.defaultMerge)&&(p=p.concat(f.defaultMerge)))),this.defaultPlugins=p;var g="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg";this.defaultImage=h(t,"images.default",g+"AQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg=="),this.missingImage=h(t,"images.missing",g+"CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg=="),this.whiteImage=h(t,"images.white","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABdJREFUeNpi/P//PwMMMDEgAdwcgAADAJZuAwXJYZOzAAAAAElFTkSuQmCC"),window&&(window.FORCE_WEBGL?this.renderType=s.WEBGL:window.FORCE_CANVAS&&(this.renderType=s.CANVAS))}});t.exports=f},86054(t,e,i){var r=i(20623),s=i(27919),n=i(8054),a=i(89357);t.exports=function(t){var e=t.config;if((e.customEnvironment||e.canvas)&&e.renderType===n.AUTO)throw new Error("Must set explicit renderType in custom environment");if(!e.customEnvironment&&!e.canvas&&e.renderType!==n.HEADLESS)if(e.renderType===n.AUTO&&(e.renderType=a.webGL?n.WEBGL:n.CANVAS),e.renderType===n.WEBGL){if(!a.webGL)throw new Error("Cannot create WebGL context, aborting.")}else{if(e.renderType!==n.CANVAS)throw new Error("Unknown value for renderer type: "+e.renderType);if(!a.canvas)throw new Error("Cannot create Canvas context, aborting.")}e.antialias||s.disableSmoothing();var o,h,l=t.scale.baseSize,u=l.width,d=l.height;(e.canvas?(t.canvas=e.canvas,t.canvas.width=u,t.canvas.height=d):t.canvas=s.create(t,u,d,e.renderType),e.canvasStyle&&(t.canvas.style=e.canvasStyle),e.antialias||r.setCrisp(t.canvas),e.renderType!==n.HEADLESS)&&(o=i(68627),h=i(74797),e.renderType===n.WEBGL?t.renderer=new h(t):(t.renderer=new o(t),t.context=t.renderer.gameContext))}},96391(t,e,i){var r=i(8054);t.exports=function(t){var e=t.config;if(!e.hideBanner){var i="WebGL";e.renderType===r.CANVAS?i="Canvas":e.renderType===r.HEADLESS&&(i="Headless");var s,n=e.audio,a=t.device.audio;if(s=a.webAudio&&!n.disableWebAudio?"Web Audio":n.noAudio||!a.webAudio&&!a.audioData?"No Audio":"HTML5 Audio",t.device.browser.ie)window.console&&console.log("Phaser v"+r.VERSION+" / https://phaser.io");else{var o="color: "+e.bannerTextColor+";",h=Array.isArray(e.bannerBackgroundColor)?e.bannerBackgroundColor:[e.bannerBackgroundColor];1===h.length&&(h=[h[0],h[0]]),o+=' background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAOCAYAAAAmL5yKAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAARBJREFUeNpi/P//P0OHsPB/BiCoePuWkYFEwALSXJElzMBgLwE2CNkQxgWr/yMr/p8QimlBu5DQ//+8vBBco/ofzAe6imH+qv/53/6jYJAYSA4ZoxoANYTPKhiuCQZwGcJU+e4dqpMmvsDq14krV2MPAxDha2CMKvoXoiE/PBQUDgQD8j82UFae9B9bOIC8B9UD9gIjjIMN7Ns6lWHn4XMoYu62RgxO3tkMjIyMII2MYAOAtmFVhA+ADHf2ycGMRhANjUq8YO+WKWCvgAORIV8CkpDCrzIwsLIymC1qAtuAD4Bsh3sBmqAY3qcGwL2AC4DCpKtzHlgzOLWihwEuzTCN0GhDJHeYC4gByBphACDAAH2dDIxdjr+VAAAAAElFTkSuQmCC"), '+("linear-gradient(to bottom, "+h.join(", ")+")")+";",o+=" background-repeat: no-repeat;",o+=" background-position: 4px center, 0 0;";var l="%c",u=[null,o+=" padding: 2px 6px 2px 24px;"];u.push("background: transparent"),e.gameTitle&&(l=l.concat(e.gameTitle),e.gameVersion&&(l=l.concat(" v"+e.gameVersion)),e.hidePhaser||(l=l.concat(" / "))),e.hidePhaser||(l=l.concat("Phaser v"+r.VERSION+" ("+i+" | "+s+")")),l=l.concat("%c "+e.gameURL),u[0]=l,console.log.apply(console,u)}}}},50127(t,e,i){var r=i(40366),s=i(60848),n=i(24047),a=i(27919),o=i(83419),h=i(69547),l=i(83719),u=i(86054),d=i(45893),c=i(96391),f=i(82264),p=i(57264),g=i(50792),m=i(8443),v=i(7003),y=i(37277),x=i(77332),T=i(76531),w=i(60903),b=i(69442),S=i(17130),C=i(65898),E=i(51085),A=i(14747),_=new o({initialize:function(t){this.config=new h(t),this.renderer=null,this.domContainer=null,this.canvas=null,this.context=null,this.isBooted=!1,this.isRunning=!1,this.events=new g,this.anims=new s(this),this.textures=new S(this),this.cache=new n(this),this.registry=new d(this,new g),this.input=new v(this,this.config),this.scene=new w(this,this.config.sceneConfig),this.device=f,this.scale=new T(this,this.config),this.sound=null,this.sound=A.create(this),this.loop=new C(this,this.config.fps),this.plugins=new x(this,this.config),this.pendingDestroy=!1,this.removeCanvas=!1,this.noReturn=!1,this.hasFocus=!1,this.isPaused=!1,p(this.boot.bind(this))},boot:function(){y.hasCore("EventEmitter")?(this.isBooted=!0,this.config.preBoot(this),this.scale.preBoot(),u(this),l(this),c(this),r(this.canvas,this.config.parent),this.textures.once(b.READY,this.texturesReady,this),this.events.emit(m.BOOT)):console.warn("Aborting. Core Plugins missing.")},texturesReady:function(){this.events.emit(m.READY),this.start()},start:function(){this.isRunning=!0,this.config.postBoot(this),this.renderer?this.loop.start(this.step.bind(this)):this.loop.start(this.headlessStep.bind(this)),E(this);var t=this.events;t.on(m.HIDDEN,this.onHidden,this),t.on(m.VISIBLE,this.onVisible,this),t.on(m.BLUR,this.onBlur,this),t.on(m.FOCUS,this.onFocus,this)},step:function(t,e){if(this.pendingDestroy)return this.runDestroy();if(!this.isPaused){var i=this.events;i.emit(m.PRE_STEP,t,e),i.emit(m.STEP,t,e),this.scene.update(t,e),i.emit(m.POST_STEP,t,e);var r=this.renderer;r.preRender(),i.emit(m.PRE_RENDER,r,t,e),this.scene.render(r),r.postRender(),i.emit(m.POST_RENDER,r,t,e)}},headlessStep:function(t,e){if(this.pendingDestroy)return this.runDestroy();if(!this.isPaused){var i=this.events;i.emit(m.PRE_STEP,t,e),i.emit(m.STEP,t,e),this.scene.update(t,e),i.emit(m.POST_STEP,t,e),this.scene.isProcessing=!1,i.emit(m.PRE_RENDER,null,t,e),i.emit(m.POST_RENDER,null,t,e)}},onHidden:function(){this.loop.pause(),this.events.emit(m.PAUSE)},pause:function(){var t=this.isPaused;this.isPaused=!0,t||this.events.emit(m.PAUSE)},onVisible:function(){this.loop.resume(),this.events.emit(m.RESUME,this.loop.pauseDuration)},resume:function(){var t=this.isPaused;this.isPaused=!1,t&&this.events.emit(m.RESUME,0)},onBlur:function(){this.hasFocus=!1,this.loop.blur()},onFocus:function(){this.hasFocus=!0,this.loop.focus()},getFrame:function(){return this.loop.frame},getTime:function(){return this.loop.now},destroy:function(t,e){void 0===e&&(e=!1),this.pendingDestroy=!0,this.removeCanvas=t,this.noReturn=e},runDestroy:function(){this.scene.destroy(),this.events.emit(m.DESTROY),this.events.removeAllListeners(),this.renderer&&this.renderer.destroy(),this.removeCanvas&&this.canvas&&(a.remove(this.canvas),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)),this.domContainer&&this.domContainer.parentNode&&this.domContainer.parentNode.removeChild(this.domContainer),this.loop.destroy(),this.pendingDestroy=!1}});t.exports=_},65898(t,e,i){var r=i(83419),s=i(35154),n=i(29747),a=i(43092),o=new r({initialize:function(t,e){this.game=t,this.raf=new a,this.started=!1,this.running=!1,this.minFps=s(e,"min",5),this.targetFps=s(e,"target",60),this.fpsLimit=s(e,"limit",0),this.hasFpsLimit=this.fpsLimit>0,this._limitRate=this.hasFpsLimit?1e3/this.fpsLimit:0,this._min=1e3/this.minFps,this._target=1e3/this.targetFps,this.actualFps=this.targetFps,this.nextFpsUpdate=0,this.framesThisSecond=0,this.callback=n,this.forceSetTimeOut=s(e,"forceSetTimeOut",!1),this.time=0,this.startTime=0,this.lastTime=0,this.frame=0,this.inFocus=!0,this.pauseDuration=0,this._pauseTime=0,this._coolDown=0,this.delta=0,this.deltaIndex=0,this.deltaHistory=[],this.deltaSmoothingMax=s(e,"deltaHistory",10),this.panicMax=s(e,"panicMax",120),this.rawDelta=0,this.now=0,this.smoothStep=s(e,"smoothStep",!0)},blur:function(){this.inFocus=!1},focus:function(){this.inFocus=!0,this.resetDelta()},pause:function(){this._pauseTime=window.performance.now()},resume:function(){this.resetDelta(),this.pauseDuration=this.time-this._pauseTime,this.startTime+=this.pauseDuration},resetDelta:function(){var t=window.performance.now();this.time=t,this.lastTime=t,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0;for(var e=0;e0||!this.inFocus)&&(this._coolDown--,t=Math.min(t,this._target)),t>this._min&&(t=i[e],t=Math.min(t,this._min)),i[e]=t,this.deltaIndex++,this.deltaIndex>=r&&(this.deltaIndex=0);for(var s=0,n=0;n=this.nextFpsUpdate&&this.updateFPS(t),this.framesThisSecond++,this.delta>=this._limitRate&&(this.callback(t,this.delta),this.delta%=this._limitRate),this.lastTime=t,this.frame++},step:function(t){this.now=t;var e=Math.max(0,t-this.lastTime);this.rawDelta=e,this.time+=this.rawDelta,this.smoothStep&&(e=this.smoothDelta(e)),this.delta=e,t>=this.nextFpsUpdate&&this.updateFPS(t),this.framesThisSecond++,this.callback(t,e),this.lastTime=t,this.frame++},tick:function(){var t=window.performance.now();this.hasFpsLimit?this.stepLimitFPS(t):this.step(t)},sleep:function(){this.running&&(this.raf.stop(),this.running=!1)},wake:function(t){void 0===t&&(t=!1);var e=window.performance.now();if(!this.running){t&&(this.startTime+=-this.lastTime+(this.lastTime+e));var i=this.hasFpsLimit?this.stepLimitFPS.bind(this):this.step.bind(this);this.raf.start(i,this.forceSetTimeOut,this._target),this.running=!0,this.nextFpsUpdate=e+1e3,this.framesThisSecond=0,this.fpsLimitTriggered=!1,this.tick()}},getDuration:function(){return Math.round(this.lastTime-this.startTime)/1e3},getDurationMS:function(){return Math.round(this.lastTime-this.startTime)},stop:function(){return this.running=!1,this.started=!1,this.raf.stop(),this},destroy:function(){this.stop(),this.raf.destroy(),this.raf=null,this.game=null,this.callback=null}});t.exports=o},51085(t,e,i){var r=i(8443);t.exports=function(t){var e,i=t.events;if(void 0!==document.hidden)e="visibilitychange";else{["webkit","moz","ms"].forEach(function(t){void 0!==document[t+"Hidden"]&&(document.hidden=function(){return document[t+"Hidden"]},e=t+"visibilitychange")})}e&&document.addEventListener(e,function(t){document.hidden||"pause"===t.type?i.emit(r.HIDDEN):i.emit(r.VISIBLE)},!1),window.onblur=function(){i.emit(r.BLUR)},window.onfocus=function(){i.emit(r.FOCUS)},window.focus&&t.config.autoFocus&&window.focus()}},97217(t){t.exports="blur"},47548(t){t.exports="boot"},19814(t){t.exports="contextlost"},68446(t){t.exports="destroy"},41700(t){t.exports="focus"},25432(t){t.exports="hidden"},65942(t){t.exports="pause"},59211(t){t.exports="postrender"},47789(t){t.exports="poststep"},39066(t){t.exports="prerender"},460(t){t.exports="prestep"},16175(t){t.exports="ready"},42331(t){t.exports="resume"},11966(t){t.exports="step"},32969(t){t.exports="systemready"},94830(t){t.exports="visible"},8443(t,e,i){t.exports={BLUR:i(97217),BOOT:i(47548),CONTEXT_LOST:i(19814),DESTROY:i(68446),FOCUS:i(41700),HIDDEN:i(25432),PAUSE:i(65942),POST_RENDER:i(59211),POST_STEP:i(47789),PRE_RENDER:i(39066),PRE_STEP:i(460),READY:i(16175),RESUME:i(42331),STEP:i(11966),SYSTEM_READY:i(32969),VISIBLE:i(94830)}},42857(t,e,i){t.exports={Config:i(69547),CreateRenderer:i(86054),DebugHeader:i(96391),Events:i(8443),TimeStep:i(65898),VisibilityHandler:i(51085)}},46728(t,e,i){var r=i(83419),s=i(36316),n=i(80021),a=i(26099),o=new r({Extends:n,initialize:function(t,e,i,r){n.call(this,"CubicBezierCurve"),Array.isArray(t)&&(r=new a(t[6],t[7]),i=new a(t[4],t[5]),e=new a(t[2],t[3]),t=new a(t[0],t[1])),this.p0=t,this.p1=e,this.p2=i,this.p3=r},getStartPoint:function(t){return void 0===t&&(t=new a),t.copy(this.p0)},getResolution:function(t){return t},getPoint:function(t,e){void 0===e&&(e=new a);var i=this.p0,r=this.p1,n=this.p2,o=this.p3;return e.set(s(t,i.x,r.x,n.x,o.x),s(t,i.y,r.y,n.y,o.y))},draw:function(t,e){void 0===e&&(e=32);var i=this.getPoints(e);t.beginPath(),t.moveTo(this.p0.x,this.p0.y);for(var r=1;ri&&(e=i/2);var r=Math.max(1,Math.round(i/e));return s(this.getSpacedPoints(r),t)},getDistancePoints:function(t){var e=this.getLength(),i=Math.max(1,e/t);return this.getSpacedPoints(i)},getEndPoint:function(t){return void 0===t&&(t=new a),this.getPointAt(1,t)},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,i=[],r=this.getPoint(0,this._tmpVec2A),s=0;i.push(0);for(var n=1;n<=t;n++)s+=(e=this.getPoint(n/t,this._tmpVec2B)).distance(r),i.push(s),r.copy(e);return this.cacheArcLengths=i,i},getPointAt:function(t,e){var i=this.getUtoTmapping(t);return this.getPoint(i,e)},getPoints:function(t,e,i){void 0===i&&(i=[]),t||(t=e?this.getLength()/e:this.defaultDivisions);for(var r=0;r<=t;r++)i.push(this.getPoint(r/t));return i},getRandomPoint:function(t){return void 0===t&&(t=new a),this.getPoint(Math.random(),t)},getSpacedPoints:function(t,e,i){void 0===i&&(i=[]),t||(t=e?this.getLength()/e:this.defaultDivisions);for(var r=0;r<=t;r++){var s=this.getUtoTmapping(r/t,null,t);i.push(this.getPoint(s))}return i},getStartPoint:function(t){return void 0===t&&(t=new a),this.getPointAt(0,t)},getTangent:function(t,e){void 0===e&&(e=new a);var i=1e-4,r=t-i,s=t+i;return r<0&&(r=0),s>1&&(s=1),this.getPoint(r,this._tmpVec2A),this.getPoint(s,e),e.subtract(this._tmpVec2A).normalize()},getTangentAt:function(t,e){var i=this.getUtoTmapping(t);return this.getTangent(i,e)},getTFromDistance:function(t,e){return t<=0?0:this.getUtoTmapping(0,t,e)},getUtoTmapping:function(t,e,i){var r,s=this.getLengths(i),n=0,a=s.length;r=e?Math.min(e,s[a-1]):t*s[a-1];for(var o,h=0,l=a-1;h<=l;)if((o=s[n=Math.floor(h+(l-h)/2)]-r)<0)h=n+1;else{if(!(o>0)){l=n;break}l=n-1}if(s[n=l]===r)return n/(a-1);var u=s[n];return(n+(r-u)/(s[n+1]-u))/(a-1)},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()}});t.exports=o},73825(t,e,i){var r=i(83419),s=i(80021),n=i(39506),a=i(35154),o=i(43396),h=i(26099),l=new r({Extends:s,initialize:function(t,e,i,r,o,l,u,d){if("object"==typeof t){var c=t;t=a(c,"x",0),e=a(c,"y",0),i=a(c,"xRadius",0),r=a(c,"yRadius",i),o=a(c,"startAngle",0),l=a(c,"endAngle",360),u=a(c,"clockwise",!1),d=a(c,"rotation",0)}else void 0===r&&(r=i),void 0===o&&(o=0),void 0===l&&(l=360),void 0===u&&(u=!1),void 0===d&&(d=0);s.call(this,"EllipseCurve"),this.p0=new h(t,e),this._xRadius=i,this._yRadius=r,this._startAngle=n(o),this._endAngle=n(l),this._clockwise=u,this._rotation=n(d)},getStartPoint:function(t){return void 0===t&&(t=new h),this.getPoint(0,t)},getResolution:function(t){return 2*t},getPoint:function(t,e){void 0===e&&(e=new h);for(var i=2*Math.PI,r=this._endAngle-this._startAngle,s=Math.abs(r)i;)r-=i;ri.length-2?i.length-1:n+1],d=i[n>i.length-3?i.length-1:n+2];return e.set(r(o,h.x,l.x,u.x,d.x),r(o,h.y,l.y,u.y,d.y))},toJSON:function(){for(var t=[],e=0;e=e)return this.curves[r];r++}return null},getEndPoint:function(t){return void 0===t&&(t=new c),this.curves.length>0?this.curves[this.curves.length-1].getPoint(1,t):t.copy(this.startPoint),t},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},getPoint:function(t,e){void 0===e&&(e=new c);for(var i=t*this.getLength(),r=this.getCurveLengths(),s=0;s=i){var n=r[s]-i,a=this.curves[s],o=a.getLength(),h=0===o?0:1-n/o;return a.getPointAt(h,e)}s++}return null},getPoints:function(t,e){t||e||(t=this.defaultDivisions);for(var i,r=[],s=0;s1&&!r[r.length-1].equals(r[0])&&r.push(r[0]),r},getRandomPoint:function(t){return void 0===t&&(t=new c),this.getPoint(Math.random(),t)},getSpacedPoints:function(t){void 0===t&&(t=40);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e},getStartPoint:function(t){return void 0===t&&(t=new c),t.copy(this.startPoint)},getTangent:function(t,e){void 0===e&&(e=new c);for(var i=t*this.getLength(),r=this.getCurveLengths(),s=0;s=i){var n=r[s]-i,a=this.curves[s],o=a.getLength(),h=0===o?0:1-n/o;return a.getTangentAt(h,e)}s++}return null},lineTo:function(t,e){t instanceof c?this._tmpVec2B.copy(t):"object"==typeof t?this._tmpVec2B.setFromObject(t):this._tmpVec2B.set(t,e);var i=this.getEndPoint(this._tmpVec2A);return this.add(new o([i.x,i.y,this._tmpVec2B.x,this._tmpVec2B.y]))},splineTo:function(t){return t.unshift(this.getEndPoint()),this.add(new d(t))},moveTo:function(t,e){return t instanceof c?this.add(new h(t.x,t.y)):this.add(new h(t,e))},toJSON:function(){for(var t=[],e=0;e=9&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){var n=parseInt(RegExp.$1,10),a=parseInt(RegExp.$2,10);(10===n&&a>=11||n>10)&&(s.dolby=!0)}}}catch(t){}return s}()},84148(t,e,i){var r,s=i(25892),n={chrome:!1,chromeVersion:0,edge:!1,firefox:!1,firefoxVersion:0,ie:!1,ieVersion:0,mobileSafari:!1,opera:!1,safari:!1,safariVersion:0,silk:!1,trident:!1,tridentVersion:0,es2019:!1};t.exports=(r=navigator.userAgent,/Edg\/\d+/.test(r)?(n.edge=!0,n.es2019=!0):/OPR/.test(r)?(n.opera=!0,n.es2019=!0):/Chrome\/(\d+)/.test(r)&&!s.windowsPhone?(n.chrome=!0,n.chromeVersion=parseInt(RegExp.$1,10),n.es2019=n.chromeVersion>69):/Firefox\D+(\d+)/.test(r)?(n.firefox=!0,n.firefoxVersion=parseInt(RegExp.$1,10),n.es2019=n.firefoxVersion>10):/AppleWebKit\/(?!.*CriOS)/.test(r)&&s.iOS?(n.mobileSafari=!0,n.es2019=!0):/MSIE (\d+\.\d+);/.test(r)?(n.ie=!0,n.ieVersion=parseInt(RegExp.$1,10)):/Version\/(\d+\.\d+(\.\d+)?) Safari/.test(r)&&!s.windowsPhone?(n.safari=!0,n.safariVersion=parseInt(RegExp.$1,10),n.es2019=n.safariVersion>10):/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(r)&&(n.ie=!0,n.trident=!0,n.tridentVersion=parseInt(RegExp.$1,10),n.ieVersion=parseInt(RegExp.$3,10)),/Silk/.test(r)&&(n.silk=!0),n)},89289(t,e,i){var r,s,n,a=i(27919),o={supportInverseAlpha:!1,supportNewBlendModes:!1};t.exports=("function"!=typeof importScripts&&void 0!==document&&(o.supportNewBlendModes=(r="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",s="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",(n=new Image).onload=function(){var t=new Image;t.onload=function(){var e=a.create2D(t,6).getContext("2d",{willReadFrequently:!0});if(e.globalCompositeOperation="multiply",e.drawImage(n,0,0),e.drawImage(t,2,0),!e.getImageData(2,0,1,1))return!1;var i=e.getImageData(2,0,1,1).data;a.remove(t),o.supportNewBlendModes=255===i[0]&&0===i[1]&&0===i[2]},t.src=r+"/wCKxvRF"+s},n.src=r+"AP804Oa6"+s,!1),o.supportInverseAlpha=function(){var t=a.create2D(this,2).getContext("2d",{willReadFrequently:!0});t.fillStyle="rgba(10, 20, 30, 0.5)",t.fillRect(0,0,1,1);var e=t.getImageData(0,0,1,1);if(null===e)return!1;t.putImageData(e,1,0);var i=t.getImageData(1,0,1,1),r=i.data[0]===e.data[0]&&i.data[1]===e.data[1]&&i.data[2]===e.data[2]&&i.data[3]===e.data[3];return a.remove(this),r}()),o)},89357(t,e,i){var r=i(25892),s=i(84148),n=i(27919),a={canvas:!1,canvasBitBltShift:null,file:!1,fileSystem:!1,getUserMedia:!0,littleEndian:!1,localStorage:!1,pointerLock:!1,stableSort:!1,support32bit:!1,vibration:!1,webGL:!1,worker:!1};t.exports=function(){if("function"==typeof importScripts)return a;a.canvas=!!window.CanvasRenderingContext2D;try{a.localStorage=!!localStorage.getItem}catch(t){a.localStorage=!1}a.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),a.fileSystem=!!window.requestFileSystem;var t,e,i,o=!1;return a.webGL=function(){if(window.WebGLRenderingContext)try{var t=n.createWebGL(this),e=t.getContext("webgl")||t.getContext("experimental-webgl"),i=n.create2D(this),r=i.getContext("2d",{willReadFrequently:!0}).createImageData(1,1);return o=r.data instanceof Uint8ClampedArray,n.remove(t),n.remove(i),!!e}catch(t){return!1}return!1}(),a.worker=!!window.Worker,a.pointerLock="pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||navigator.oGetUserMedia,window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,a.getUserMedia=a.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,s.firefox&&s.firefoxVersion<21&&(a.getUserMedia=!1),!r.iOS&&(s.ie||s.firefox||s.chrome)&&(a.canvasBitBltShift=!0),(s.safari||s.mobileSafari)&&(a.canvasBitBltShift=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(a.vibration=!0),"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint32Array&&(a.littleEndian=(t=new ArrayBuffer(4),e=new Uint8Array(t),i=new Uint32Array(t),e[0]=161,e[1]=178,e[2]=195,e[3]=212,3569595041===i[0]||2712847316!==i[0]&&null)),a.support32bit="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof Int32Array&&null!==a.littleEndian&&o,a}()},91639(t){var e={available:!1,cancel:"",keyboard:!1,request:""};t.exports=function(){if("function"==typeof importScripts)return e;var t,i="Fullscreen",r="FullScreen",s=["request"+i,"request"+r,"webkitRequest"+i,"webkitRequest"+r,"msRequest"+i,"msRequest"+r,"mozRequest"+r,"mozRequest"+i];for(t=0;t=1)&&(s.touch=!0),(navigator.msPointerEnabled||navigator.pointerEnabled)&&(s.mspointer=!0),navigator.getGamepads&&(s.gamepads=!0),"onwheel"in window||r.ie&&"WheelEvent"in window?s.wheelEvent="wheel":"onmousewheel"in window?s.wheelEvent="mousewheel":r.firefox&&"MouseScrollEvent"in window&&(s.wheelEvent="DOMMouseScroll")),s)},25892(t){var e={android:!1,chromeOS:!1,cordova:!1,crosswalk:!1,desktop:!1,ejecta:!1,electron:!1,iOS:!1,iOSVersion:0,iPad:!1,iPhone:!1,kindle:!1,linux:!1,macOS:!1,node:!1,nodeWebkit:!1,pixelRatio:1,webApp:!1,windows:!1,windowsPhone:!1};t.exports=function(){if("function"==typeof importScripts)return e;var t=navigator.userAgent;/Windows/.test(t)?e.windows=!0:/Mac OS/.test(t)&&!/like Mac OS/.test(t)?navigator.maxTouchPoints&&navigator.maxTouchPoints>2?(e.iOS=!0,e.iPad=!0,navigator.appVersion.match(/Version\/(\d+)/),e.iOSVersion=parseInt(RegExp.$1,10)):e.macOS=!0:/Android/.test(t)?e.android=!0:/Linux/.test(t)?e.linux=!0:/iP[ao]d|iPhone/i.test(t)?(e.iOS=!0,navigator.appVersion.match(/OS (\d+)/),e.iOSVersion=parseInt(RegExp.$1,10),e.iPhone=-1!==t.toLowerCase().indexOf("iphone"),e.iPad=-1!==t.toLowerCase().indexOf("ipad")):/Kindle/.test(t)||/\bKF[A-Z][A-Z]+/.test(t)||/Silk.*Mobile Safari/.test(t)?e.kindle=!0:/CrOS/.test(t)&&(e.chromeOS=!0),(/Windows Phone/i.test(t)||/IEMobile/i.test(t))&&(e.android=!1,e.iOS=!1,e.macOS=!1,e.windows=!0,e.windowsPhone=!0);var i=/Silk/.test(t);return(e.windows||e.macOS||e.linux&&!i||e.chromeOS)&&(e.desktop=!0),(e.windowsPhone||/Windows NT/i.test(t)&&/Touch/i.test(t))&&(e.desktop=!1),navigator.standalone&&(e.webApp=!0),"function"!=typeof importScripts&&(void 0!==window.cordova&&(e.cordova=!0),void 0!==window.ejecta&&(e.ejecta=!0)),"undefined"!=typeof process&&process.versions&&process.versions.node&&(e.node=!0),e.node&&"object"==typeof process.versions&&(e.nodeWebkit=!!process.versions["node-webkit"],e.electron=!!process.versions.electron),/Crosswalk/.test(t)&&(e.crosswalk=!0),e.pixelRatio=window.devicePixelRatio||1,e}()},43267(t,e,i){var r=i(95540),s={h264:!1,hls:!1,mov:!1,mp4:!1,m4v:!1,ogg:!1,vp9:!1,webm:!1,hasRequestVideoFrame:!1};t.exports=function(){if("function"==typeof importScripts)return s;var t=document.createElement("video"),e=!!t.canPlayType,i=/^no$/;try{e&&(t.canPlayType('video/ogg; codecs="theora"').replace(i,"")&&(s.ogg=!0),t.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(i,"")&&(s.h264=!0,s.mp4=!0),t.canPlayType('video/quicktime4; codecs="avc1.42E01E"').replace(i,"")&&(s.mov=!0),t.canPlayType("video/x-m4v").replace(i,"")&&(s.m4v=!0),t.canPlayType('video/webm; codecs="vp8, vorbis"').replace(i,"")&&(s.webm=!0),t.canPlayType('video/webm; codecs="vp9"').replace(i,"")&&(s.vp9=!0),t.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(i,"")&&(s.hls=!0))}catch(t){}return t.parentNode&&t.parentNode.removeChild(t),s.getVideoURL=function(t){Array.isArray(t)||(t=[t]);for(var e=0;e4096&&(s=Math.ceil(r/4096),r=4096),this.dataTextureResolution[0]=r,this.dataTextureResolution[1]=s;var n=new ArrayBuffer(r*s*4),o=new Uint32Array(n),l=new Uint8Array(n),u=0,d=65536;o[u++]=Math.round(this.bands[0].start*d),o[u++]=Math.round(this.bands[this.bands.length-1].end*d);for(var c=0;c<=e;c++)for(var f=Math.pow(2,c),p=1;po.end&&(o.end=o.start)}return i&&(this.bands=s.filter(function(t){return t.start=t){e=r;break}}return e?(t=(t-e.start)/(e.end-e.start),e.getColor(t)):{r:0,g:0,b:0,a:0,color:0}},destroy:function(){this.scene=null,this.dataTexture&&this.dataTexture.destroy()}});t.exports=l},51767(t,e,i){var r=i(83419),s=i(29747),n=new r({initialize:function(t,e,i){this._rgb=[0,0,0],this.onChangeCallback=s,this.dirty=!1,this.set(t,e,i)},set:function(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this._rgb=[t,e,i],this.onChange(),this},equals:function(t,e,i){var r=this._rgb;return r[0]===t&&r[1]===e&&r[2]===i},onChange:function(){this.dirty=!0;var t=this._rgb;this.onChangeCallback.call(this,t[0],t[1],t[2])},r:{get:function(){return this._rgb[0]},set:function(t){this._rgb[0]=t,this.onChange()}},g:{get:function(){return this._rgb[1]},set:function(t){this._rgb[1]=t,this.onChange()}},b:{get:function(){return this._rgb[2]},set:function(t){this._rgb[2]=t,this.onChange()}},destroy:function(){this.onChangeCallback=null}});t.exports=n},60461(t){t.exports={TOP_LEFT:0,TOP_CENTER:1,TOP_RIGHT:2,LEFT_TOP:3,LEFT_CENTER:4,LEFT_BOTTOM:5,CENTER:6,RIGHT_TOP:7,RIGHT_CENTER:8,RIGHT_BOTTOM:9,BOTTOM_LEFT:10,BOTTOM_CENTER:11,BOTTOM_RIGHT:12}},54312(t,e,i){var r=i(62235),s=i(35893),n=i(86327),a=i(88417);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)+i),n(t,r(e)+o),t}},46768(t,e,i){var r=i(62235),s=i(26541),n=i(86327),a=i(385);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)-i),n(t,r(e)+o),t}},35827(t,e,i){var r=i(62235),s=i(54380),n=i(86327),a=i(40136);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)+i),n(t,r(e)+o),t}},46871(t,e,i){var r=i(66786),s=i(35893),n=i(7702);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)+i,n(e)+a),t}},5198(t,e,i){var r=i(7702),s=i(26541),n=i(20786),a=i(385);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)-i),n(t,r(e)+o),t}},11879(t,e,i){var r=i(60461),s=[];s[r.BOTTOM_CENTER]=i(54312),s[r.BOTTOM_LEFT]=i(46768),s[r.BOTTOM_RIGHT]=i(35827),s[r.CENTER]=i(46871),s[r.LEFT_CENTER]=i(5198),s[r.RIGHT_CENTER]=i(80503),s[r.TOP_CENTER]=i(89698),s[r.TOP_LEFT]=i(922),s[r.TOP_RIGHT]=i(21373),s[r.LEFT_BOTTOM]=s[r.BOTTOM_LEFT],s[r.LEFT_TOP]=s[r.TOP_LEFT],s[r.RIGHT_BOTTOM]=s[r.BOTTOM_RIGHT],s[r.RIGHT_TOP]=s[r.TOP_RIGHT];t.exports=function(t,e,i,r,n){return s[i](t,e,r,n)}},80503(t,e,i){var r=i(7702),s=i(54380),n=i(20786),a=i(40136);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)+i),n(t,r(e)+o),t}},89698(t,e,i){var r=i(35893),s=i(17717),n=i(88417),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,r(e)+i),a(t,s(e)-o),t}},922(t,e,i){var r=i(26541),s=i(17717),n=i(385),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,r(e)-i),a(t,s(e)-o),t}},21373(t,e,i){var r=i(54380),s=i(17717),n=i(40136),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,r(e)+i),a(t,s(e)-o),t}},91660(t,e,i){t.exports={BottomCenter:i(54312),BottomLeft:i(46768),BottomRight:i(35827),Center:i(46871),LeftCenter:i(5198),QuickSet:i(11879),RightCenter:i(80503),TopCenter:i(89698),TopLeft:i(922),TopRight:i(21373)}},71926(t,e,i){var r=i(60461),s=i(79291),n={In:i(91660),To:i(16694)};n=s(!1,n,r),t.exports=n},21578(t,e,i){var r=i(62235),s=i(35893),n=i(88417),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,s(e)+i),a(t,r(e)+o),t}},10210(t,e,i){var r=i(62235),s=i(26541),n=i(385),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,s(e)-i),a(t,r(e)+o),t}},82341(t,e,i){var r=i(62235),s=i(54380),n=i(40136),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,s(e)+i),a(t,r(e)+o),t}},87958(t,e,i){var r=i(62235),s=i(26541),n=i(86327),a=i(40136);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)-i),n(t,r(e)+o),t}},40080(t,e,i){var r=i(7702),s=i(26541),n=i(20786),a=i(40136);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)-i),n(t,r(e)+o),t}},88466(t,e,i){var r=i(26541),s=i(17717),n=i(40136),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,r(e)-i),a(t,s(e)-o),t}},38829(t,e,i){var r=i(60461),s=[];s[r.BOTTOM_CENTER]=i(21578),s[r.BOTTOM_LEFT]=i(10210),s[r.BOTTOM_RIGHT]=i(82341),s[r.LEFT_BOTTOM]=i(87958),s[r.LEFT_CENTER]=i(40080),s[r.LEFT_TOP]=i(88466),s[r.RIGHT_BOTTOM]=i(19211),s[r.RIGHT_CENTER]=i(34609),s[r.RIGHT_TOP]=i(48741),s[r.TOP_CENTER]=i(49440),s[r.TOP_LEFT]=i(81288),s[r.TOP_RIGHT]=i(61323);t.exports=function(t,e,i,r,n){return s[i](t,e,r,n)}},19211(t,e,i){var r=i(62235),s=i(54380),n=i(86327),a=i(385);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)+i),n(t,r(e)+o),t}},34609(t,e,i){var r=i(7702),s=i(54380),n=i(20786),a=i(385);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)+i),n(t,r(e)+o),t}},48741(t,e,i){var r=i(54380),s=i(17717),n=i(385),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,r(e)+i),a(t,s(e)-o),t}},49440(t,e,i){var r=i(35893),s=i(17717),n=i(86327),a=i(88417);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,r(e)+i),n(t,s(e)-o),t}},81288(t,e,i){var r=i(26541),s=i(17717),n=i(86327),a=i(385);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,r(e)-i),n(t,s(e)-o),t}},61323(t,e,i){var r=i(54380),s=i(17717),n=i(86327),a=i(40136);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,r(e)+i),n(t,s(e)-o),t}},16694(t,e,i){t.exports={BottomCenter:i(21578),BottomLeft:i(10210),BottomRight:i(82341),LeftBottom:i(87958),LeftCenter:i(40080),LeftTop:i(88466),QuickSet:i(38829),RightBottom:i(19211),RightCenter:i(34609),RightTop:i(48741),TopCenter:i(49440),TopLeft:i(81288),TopRight:i(61323)}},66786(t,e,i){var r=i(88417),s=i(20786);t.exports=function(t,e,i){return r(t,e),s(t,i)}},62235(t){t.exports=function(t){return t.y+t.height-t.height*t.originY}},72873(t,e,i){var r=i(62235),s=i(26541),n=i(54380),a=i(17717),o=i(87841);t.exports=function(t,e){void 0===e&&(e=new o);var i=s(t),h=a(t);return e.x=i,e.y=h,e.width=n(t)-i,e.height=r(t)-h,e}},35893(t){t.exports=function(t){return t.x-t.width*t.originX+.5*t.width}},7702(t){t.exports=function(t){return t.y-t.height*t.originY+.5*t.height}},26541(t){t.exports=function(t){return t.x-t.width*t.originX}},87431(t){t.exports=function(t){return t.width*t.originX}},46928(t){t.exports=function(t){return t.height*t.originY}},54380(t){t.exports=function(t){return t.x+t.width-t.width*t.originX}},17717(t){t.exports=function(t){return t.y-t.height*t.originY}},86327(t){t.exports=function(t,e){return t.y=e-t.height+t.height*t.originY,t}},88417(t){t.exports=function(t,e){var i=t.width*t.originX;return t.x=e+i-.5*t.width,t}},20786(t){t.exports=function(t,e){var i=t.height*t.originY;return t.y=e+i-.5*t.height,t}},385(t){t.exports=function(t,e){return t.x=e+t.width*t.originX,t}},40136(t){t.exports=function(t,e){return t.x=e-t.width+t.width*t.originX,t}},66737(t){t.exports=function(t,e){return t.y=e+t.height*t.originY,t}},58724(t,e,i){t.exports={CenterOn:i(66786),GetBottom:i(62235),GetBounds:i(72873),GetCenterX:i(35893),GetCenterY:i(7702),GetLeft:i(26541),GetOffsetX:i(87431),GetOffsetY:i(46928),GetRight:i(54380),GetTop:i(17717),SetBottom:i(86327),SetCenterX:i(88417),SetCenterY:i(20786),SetLeft:i(385),SetRight:i(40136),SetTop:i(66737)}},20623(t){t.exports={setCrisp:function(t){return["optimizeSpeed","-moz-crisp-edges","-o-crisp-edges","-webkit-optimize-contrast","optimize-contrast","crisp-edges","pixelated"].forEach(function(e){t.style["image-rendering"]=e}),t.style.msInterpolationMode="nearest-neighbor",t},setBicubic:function(t){return t.style["image-rendering"]="auto",t.style.msInterpolationMode="bicubic",t}}},27919(t,e,i){var r,s,n,a=i(8054),o=i(68703),h=[],l=!1;t.exports=(n=function(){var t=0;return h.forEach(function(e){e.parent&&t++}),t},{create2D:function(t,e,i){return r(t,e,i,a.CANVAS)},create:r=function(t,e,i,r,n){var u;void 0===e&&(e=1),void 0===i&&(i=1),void 0===r&&(r=a.CANVAS),void 0===n&&(n=!1);var d=s(r);return null===d?(d={parent:t,canvas:document.createElement("canvas"),type:r},r===a.CANVAS&&h.push(d),u=d.canvas):(d.parent=t,u=d.canvas),n&&(d.parent=u),u.width=e,u.height=i,l&&r===a.CANVAS&&o.disable(u.getContext("2d",{willReadFrequently:!1})),u},createWebGL:function(t,e,i){return r(t,e,i,a.WEBGL)},disableSmoothing:function(){l=!0},enableSmoothing:function(){l=!1},first:s=function(t){if(void 0===t&&(t=a.CANVAS),t===a.WEBGL)return null;for(var e=0;e=0;e--)i.push({r:e,g:a,b:o,color:r(e,a,o)});for(n=0,e=0;e<=s;e++,a--)i.push({r:n,g:a,b:e,color:r(n,a,e)});for(a=0,o=255,e=0;e<=s;e++,o--,n++)i.push({r:n,g:a,b:o,color:r(n,a,o)});if(1024===t)return i;var h=[],l=0,u=1024/t;for(e=0;e>16&255,g:t>>8&255,b:255&t,a:255};return t>16777215&&(e.a=t>>>24),e}},62957(t){t.exports=function(t){var e=t.toString(16);return 1===e.length?"0"+e:e}},37589(t){t.exports=function(t,e,i){return t<<16|e<<8|i}},1e3(t){t.exports=function(t,e,i,r){return r<<24|t<<16|e<<8|i}},62183(t,e,i){var r=i(40987),s=i(89528);t.exports=function(t,e,i,n){n||(n=new r);var a=i,o=i,h=i;if(0!==e){var l=i<.5?i*(1+e):i+e-i*e,u=2*i-l;a=s(u,l,t+1/3),o=s(u,l,t),h=s(u,l,t-1/3)}return n.setGLTo(a,o,h,1)}},27939(t,e,i){var r=i(7537);t.exports=function(t,e){void 0===t&&(t=1),void 0===e&&(e=1);for(var i=[],s=0;s<=359;s++)i.push(r(s/359,t,e));return i}},7537(t,e,i){var r=i(37589);function s(t,e,i,r){var s=(t+6*e)%6,n=Math.min(s,4-s,1);return Math.round(255*(r-r*i*Math.max(0,n)))}t.exports=function(t,e,i,n){void 0===e&&(e=1),void 0===i&&(i=1);var a=s(5,t,e,i),o=s(3,t,e,i),h=s(1,t,e,i);return n?n.setTo?n.setTo(a,o,h,n.alpha,!0):(n.r=a,n.g=o,n.b=h,n.color=r(a,o,h),n):{r:a,g:o,b:h,color:r(a,o,h)}}},70238(t,e,i){var r=i(40987);t.exports=function(t,e){e||(e=new r),t=t.replace(/^(?:#|0x)?([a-f\d])([a-f\d])([a-f\d])$/i,function(t,e,i,r){return e+e+i+i+r+r});var i=/^(?:#|0x)?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);if(i){var s=parseInt(i[1],16),n=parseInt(i[2],16),a=parseInt(i[3],16);e.setTo(s,n,a)}return e}},89528(t){t.exports=function(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}},30100(t,e,i){var r=i(40987),s=i(90664);t.exports=function(t,e){var i=s(t);return e?e.setTo(i.r,i.g,i.b,i.a):new r(i.r,i.g,i.b,i.a)}},90664(t){t.exports=function(t){return t>16777215?{a:t>>>24,r:t>>16&255,g:t>>8&255,b:255&t}:{a:255,r:t>>16&255,g:t>>8&255,b:255&t}}},13699(t,e,i){var r=i(28915),s=i(37589),n=i(7537),a=function(t,e,i,n,a,o,h,l){void 0===h&&(h=100),void 0===l&&(l=0);var u=l/h,d=r(t,n,u),c=r(e,a,u),f=r(i,o,u);return{r:d,g:c,b:f,a:255,color:s(d,c,f)}},o=function(t,e,i,s,a,o,h,l,u){if(void 0===u&&(u=0),0===u){var d=t-s;d>.5?t-=1:d<-.5&&(t+=1)}else u>0?t>s&&(t-=1):tt?r.ORIENTATION.PORTRAIT:r.ORIENTATION.LANDSCAPE}},74403(t){t.exports=function(t){var e;return""!==t&&("string"==typeof t?e=document.getElementById(t):t&&1===t.nodeType&&(e=t)),e||(e=document.body),e}},56836(t){t.exports=function(t){var e="";try{if(window.DOMParser)e=(new DOMParser).parseFromString(t,"text/xml");else(e=new ActiveXObject("Microsoft.XMLDOM")).loadXML(t)}catch(t){e=null}return e&&e.documentElement&&!e.getElementsByTagName("parsererror").length?e:null}},35846(t){t.exports=function(t){t.parentNode&&t.parentNode.removeChild(t)}},43092(t,e,i){var r=i(83419),s=i(29747),n=new r({initialize:function(){this.isRunning=!1,this.callback=s,this.isSetTimeOut=!1,this.timeOutID=null,this.delay=0;var t=this;this.step=function e(i){t.callback(i),t.isRunning&&(t.timeOutID=window.requestAnimationFrame(e))},this.stepTimeout=function e(){t.isRunning&&(t.timeOutID=window.setTimeout(e,t.delay)),t.callback(window.performance.now())}},start:function(t,e,i){this.isRunning||(this.callback=t,this.isSetTimeOut=e,this.delay=i,this.isRunning=!0,this.timeOutID=e?window.setTimeout(this.stepTimeout,0):window.requestAnimationFrame(this.step))},stop:function(){this.isRunning=!1,this.isSetTimeOut?clearTimeout(this.timeOutID):window.cancelAnimationFrame(this.timeOutID)},destroy:function(){this.stop(),this.callback=s}});t.exports=n},84902(t,e,i){var r={AddToDOM:i(40366),DOMContentLoaded:i(57264),GetInnerHeight:i(57811),GetScreenOrientation:i(45818),GetTarget:i(74403),ParseXML:i(56836),RemoveFromDOM:i(35846),RequestAnimationFrame:i(43092)};t.exports=r},47565(t,e,i){var r=i(83419),s=i(50792),n=i(37277),a=new r({Extends:s,initialize:function(){s.call(this)},shutdown:function(){this.removeAllListeners()},destroy:function(){this.removeAllListeners()}});n.register("EventEmitter",a,"events"),t.exports=a},93055(t,e,i){t.exports={EventEmitter:i(47565)}},10189(t,e,i){var r=i(83419),s=i(13045),n=new r({Extends:s,initialize:function(t,e){void 0===e&&(e=1),s.call(this,t,"FilterBarrel"),this.amount=e}});t.exports=n},16762(t,e,i){var r=i(83419),s=i(13045),n=new r({Extends:s,initialize:function(t,e,i,r,n){void 0===e&&(e="__WHITE"),void 0===i&&(i=0),void 0===r&&(r=1),void 0===n&&(n=[1,1,1,1]),s.call(this,t,"FilterBlend"),this.glTexture,this.blendMode=i,this.amount=r,this.color=n,this.setTexture(e)},setTexture:function(t){var e=this.camera.scene.sys.textures.getFrame(t);return e&&(this.glTexture=e.glTexture),this}});t.exports=n},37597(t,e,i){var r=i(83419),s=i(13045),n=new r({Extends:s,initialize:function(t,e){s.call(this,t,"FilterBlocky"),this.size={x:4,y:4},this.offset={x:0,y:0},e&&(void 0!==e.size&&("number"==typeof e.size?(this.size.x=e.size,this.size.y=e.size):(this.size.x=e.size.x,this.size.y=e.size.y)),void 0!==e.offset&&("number"==typeof e.offset?(this.offset.x=e.offset,this.offset.y=e.offset):(this.offset.x=e.offset.x,this.offset.y=e.offset.y)))}});t.exports=n},88344(t,e,i){var r=i(83419),s=i(13045),n=new r({Extends:s,initialize:function(t,e,i,r,n,a,o){void 0===e&&(e=0),void 0===i&&(i=2),void 0===r&&(r=2),void 0===n&&(n=1),void 0===o&&(o=4),s.call(this,t,"FilterBlur"),this.quality=e,this.x=i,this.y=r,this.strength=n,this.glcolor=[1,1,1],null!=a&&(this.color=a),this.steps=o},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}},getPadding:function(){var t=this.paddingOverride;if(t)return this.currentPadding.setTo(t.x,t.y,t.width,t.height),t;var e=this.quality,i=0===e?1.333:1===e?3.2307692308:5.176470588235294,r=this.steps*this.strength*i,s=Math.ceil(this.x*r),n=Math.ceil(this.y*r);return this.currentPadding.setTo(-s,-n,2*s,2*n),this.currentPadding}});t.exports=n},47564(t,e,i){var r=i(83419),s=i(13045),n=new r({Extends:s,initialize:function(t,e,i,r,n,a,o,h){void 0===e&&(e=.5),void 0===i&&(i=1),void 0===r&&(r=.2),void 0===n&&(n=!1),void 0===a&&(a=1),void 0===o&&(o=1),void 0===h&&(h=1),s.call(this,t,"FilterBokeh"),this.radius=e,this.amount=i,this.contrast=r,this.isTiltShift=n,this.blurX=a,this.blurY=o,this.strength=h},getPadding:function(){var t=this.paddingOverride;if(t)return this.currentPadding.setTo(t.x,t.y,t.width,t.height),t;var e=Math.ceil(this.camera.height*this.radius*.021426096060426905);return this.currentPadding.setTo(-e,-e,2*e,2*e),this.currentPadding}});t.exports=n},77011(t,e,i){var r=i(83419),s=i(13045),n=i(89422),a=new r({Extends:s,initialize:function(t){s.call(this,t,"FilterColorMatrix"),this.colorMatrix=new n},destroy:function(){this.colorMatrix=null,s.prototype.destroy.call(this)}});t.exports=a},95200(t,e,i){var r=i(83419),s=i(13045),n=i(89422),a=new r({Extends:s,initialize:function(t,e){s.call(this,t,"FilterCombineColorMatrix"),this.glTexture,this.colorMatrixSelf=new n,this.colorMatrixTransfer=new n,this.additions=[1,1,1,0],this.multiplications=[0,0,0,1],this.setTexture(e||"__WHITE")},setTexture:function(t){var e=t instanceof Phaser.Textures.Texture?t:this.camera.scene.sys.textures.getFrame(t);return e&&(this.glTexture=e.glTexture),this},setupAlphaTransfer:function(t,e,i,r,s,n){var a=this.colorMatrixSelf,o=this.colorMatrixTransfer;a.reset(),o.reset(),this.additions=[1,1,1,0],this.multiplications=[0,0,0,1],t||a.black(),e||o.black(),s?a.brightnessToAlphaInverse(!0):i&&a.brightnessToAlpha(!0),n?o.brightnessToAlphaInverse(!0):r&&o.brightnessToAlpha(!0)},destroy:function(){this.colorMatrixSelf=null,this.colorMatrixTransfer=null,s.prototype.destroy.call(this)}});t.exports=a},13045(t,e,i){var r=i(83419),s=i(87841),n=new r({initialize:function(t,e){this.active=!0,this.camera=t,this.renderNode=e,this.paddingOverride=new s,this.currentPadding=new s,this.allowBaseDraw=!0,this.ignoreDestroy=!1},getPadding:function(){return this.paddingOverride||this.currentPadding},getPaddingCeil:function(){var t=this.getPadding(),e=new s(Math.ceil(t.x),Math.ceil(t.y),Math.ceil(t.width),Math.ceil(t.height));return this.currentPadding.setTo(e.x,e.y,e.width,e.height),e},setPaddingOverride:function(t,e,i,r){return null===t?(this.paddingOverride=null,this):(void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),this.paddingOverride=new s(t,e,i-t,r-e),this)},setActive:function(t){return this.active=t,this},destroy:function(){this.active=!1,this.renderNode=null,this.camera=null}});t.exports=n},16898(t,e,i){var r=i(83419),s=i(13045),n=new r({Extends:s,initialize:function(t,e,i,r){void 0===e&&(e="__WHITE"),void 0===i&&(i=.005),void 0===r&&(r=.005),s.call(this,t,"FilterDisplacement"),this.x=i,this.y=r,this.glTexture,this.setTexture(e)},setTexture:function(t){var e=this.camera.scene.sys.textures.getFrame(t);return e&&(this.glTexture=e.glTexture),this},getPadding:function(){var t=this.paddingOverride;if(t)return this.currentPadding.setTo(t.x,t.y,t.width,t.height),t;var e=this.camera,i=Math.ceil(e.width*this.x*.5),r=Math.ceil(e.height*this.y*.5);return this.currentPadding.setTo(-i,-r,2*i,2*r),this.currentPadding}});t.exports=n},42652(t,e,i){var r=i(83419),s=i(13045),n=new r({Extends:s,initialize:function(t,e,i,r,n,a,o,h){void 0===i&&(i=4),void 0===r&&(r=0),void 0===n&&(n=1),void 0===a&&(a=!1),void 0===o&&(o=t.scene.sys.game.config.glowQuality),void 0===h&&(h=t.scene.sys.game.config.glowDistance),s.call(this,t,"FilterGlow"),this.outerStrength=i,this.innerStrength=r,this.scale=n,this.knockout=a,this._quality=Math.max(Math.round(o),1),this._distance=Math.max(Math.round(h),1),this.glcolor=[1,1,1,1],void 0!==e&&(this.color=e)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}},distance:{get:function(){return this._distance}},quality:{get:function(){return this._quality}},getPadding:function(){var t=this.paddingOverride;if(t)return this.currentPadding.setTo(t.x,t.y,t.width,t.height),t;var e=this.currentPadding,i=Math.ceil(this.distance*this.scale);return e.left=-i,e.top=-i,e.right=i,e.bottom=i,e}});t.exports=n},43927(t,e,i){var r=i(83419),s=i(13045),n=i(73043),a=new r({Extends:s,initialize:function(t,e){e||(e={});var i=t.scene;s.call(this,t,"FilterGradientMap");var r=e.ramp;r||(r={colorStart:0,colorEnd:16777215}),r instanceof n||(r=new n(i,r,!0)),this.ramp=r,this.dither=!!e.dither,this.color=[0,0,0,0],e.color&&(this.color[0]=e.color[0]||0,this.color[1]=e.color[1]||0,this.color[2]=e.color[2]||0,this.color[3]=e.color[3]||0),this.colorFactor=[.3,.6,.1,0],e.colorFactor&&(this.colorFactor[0]=e.colorFactor[0]||0,this.colorFactor[1]=e.colorFactor[1]||0,this.colorFactor[2]=e.colorFactor[2]||0,this.colorFactor[3]=e.colorFactor[3]||0),this.unpremultiply=void 0===e.unpremultiply||e.unpremultiply,this.alpha=void 0===e.alpha?1:e.alpha}});t.exports=a},84714(t,e,i){var r=i(83419),s=i(13045),n=i(37867),a=i(61340),o=new r({Extends:s,initialize:function(t,e){s.call(this,t,"FilterImageLight"),this.normalGlTexture,this.environmentGlTexture,this.viewMatrix=new n,this.modelRotation=e.modelRotation||0,this.modelRotationSource=e.modelRotationSource||null,this.bulge=e.bulge||0,this.colorFactor=e.colorFactor||[1,1,1],this._tempMatrix=new a,this._tempParentMatrix=new a,this.setEnvironmentMap(e.environmentMap||"__WHITE"),this.setNormalMap(e.normalMap||"__NORMAL"),e.viewMatrix&&this.viewMatrix.set(e.viewMatrix)},setEnvironmentMap:function(t){var e=t instanceof Phaser.Textures.Texture?t:this.camera.scene.sys.textures.getFrame(t);return e&&(this.environmentGlTexture=e.glTexture),this},setNormalMap:function(t){var e=t instanceof Phaser.Textures.Texture?t:this.camera.scene.sys.textures.getFrame(t);return e&&(this.normalGlTexture=e.glTexture),this},setNormalMapFromGameObject:function(t){var e=t.texture.dataSource[0];return e&&(this.normalGlTexture=e.glTexture),this},getModelRotation:function(){return this.modelRotationSource?"function"==typeof this.modelRotationSource?this.modelRotationSource():this.modelRotationSource.hasTransformComponent?this.modelRotationSource.getWorldTransformMatrix(this._tempMatrix,this._tempParentMatrix).rotationNormalized:this.modelRotation:this.modelRotation}});t.exports=o},51890(t,e,i){var r=i(83419),s=i(13045),n=i(40987),a=new r({Extends:s,initialize:function(t,e){void 0===e&&(e={}),s.call(this,t,"FilterKey"),this.color=[1,1,1,1],void 0!==e.color&&this.setColor(e.color),void 0!==e.alpha&&this.setAlpha(e.alpha),this.isolate=!1,void 0!==e.isolate&&(this.isolate=e.isolate),this.threshold=.0625,void 0!==e.threshold&&(this.threshold=e.threshold),this.feather=0,void 0!==e.feather&&(this.feather=e.feather)},setAlpha:function(t){return this.color[3]=t,this},setColor:function(t){var e=this.color[3];if("number"==typeof t){var i=n.IntegerToRGB(t);this.color=[i.r/255,i.g/255,i.b/255,e]}else if("string"==typeof t){var r=n.HexStringToColor(t);this.color=[r.redGL,r.greenGL,r.blueGL,e]}else Array.isArray(t)?this.color=[t[0],t[1],t[2],e]:t instanceof n&&(this.color=[t.redGL,t.greenGL,t.blueGL,e]);return this}});t.exports=a},97797(t,e,i){var r=i(83419),s=i(45650),n=i(13045),a=new r({Extends:n,initialize:function(t,e,i,r,s,a){void 0===e&&(e="__WHITE"),void 0===i&&(i=!1),void 0===a&&(a=1),n.call(this,t,"FilterMask"),this.glTexture,this._dynamicTexture=null,this.maskGameObject=null,this.invert=i,this.autoUpdate=!0,this.needsUpdate=!1,this.viewTransform=s||"world",this.viewCamera=r,this.scaleFactor=a,"string"==typeof e?this.setTexture(e):this.setGameObject(e)},updateDynamicTexture:function(t,e){var i=this.scaleFactor,r=t*i,n=e*i,a=this.maskGameObject;if(a){if(this._dynamicTexture)this._dynamicTexture.width!==r||this._dynamicTexture.height!==n?this._dynamicTexture.setSize(r,n,!1):this._dynamicTexture.clear();else{var o=this.camera.scene.sys.textures;this._dynamicTexture=o.addDynamicTexture(s(),r,n,!1)}this.glTexture=this._dynamicTexture.get().glTexture;var h=this.viewCamera||a.scene.renderer.currentViewCamera;this._dynamicTexture.capture(a,{transform:this.viewTransform,camera:h}),this._dynamicTexture.render(),this.needsUpdate=!1}},setGameObject:function(t){return this.maskGameObject=t,this.needsUpdate=!0,this},setTexture:function(t){var e=this.camera.scene.sys.textures.getFrame(t);return e&&(this.maskGameObject=null,this.glTexture=e.glTexture),this},destroy:function(){this._dynamicTexture&&this._dynamicTexture.destroy(),this.maskGameObject=null,this._dynamicTexture=null,n.prototype.destroy.call(this)}});t.exports=a},37911(t,e,i){var r=i(83419),s=i(13045),n=i(37867),a=i(25836),o=new r({Extends:s,initialize:function(t,e){e=e||{},s.call(this,t,"FilterNormalTools"),this._rotation=0,this.viewMatrix=new n,this.setRotation(e.rotation||0),this.rotationSource=e.rotationSource||null,this.facingPower=e.facingPower||1,this.outputRatio=e.outputRatio||!1,this.ratioVector=new a(0,0,1),e.ratioVector&&this.ratioVector.set(e.ratioVector[0],e.ratioVector[1],e.ratioVector[2]),this.ratioRadius=e.ratioRadius||1},getRotation:function(){if(this.rotationSource){if("function"==typeof this.rotationSource)return this.rotationSource();if(this.rotationSource.hasTransformComponent)return this.rotationSource.getWorldTransformMatrix().rotationNormalized}return this._rotation},setRotation:function(t){return this.viewMatrix.identity().rotateZ(t),this._rotation=t,this},updateRotation:function(){if(this.rotationSource){var t=this.getRotation();this.viewMatrix.identity().rotateZ(t),this._rotation=t}return this}});t.exports=o},6379(t,e,i){var r=i(83419),s=i(13045),n=new r({Extends:s,initialize:function(t,e){void 0===e&&(e={}),s.call(this,t,"FilterPanoramaBlur"),this.radius=e.radius||1,this.samplesX=e.samplesX||32,this.samplesY=e.samplesY||16,this.power=e.power||1}});t.exports=n},2195(t,e,i){var r=i(83419),s=i(53427),n=i(13045),a=i(16762),o=new r({Extends:n,initialize:function(t){n.call(this,t,"FilterParallelFilters"),this.top=new s(t),this.bottom=new s(t),this.blend=new a(t)}});s.prototype.addParallelFilters=function(){return this.add(new o(this.camera))},t.exports=o},29861(t,e,i){var r=i(83419),s=i(13045),n=new r({Extends:s,initialize:function(t,e){void 0===e&&(e=1),s.call(this,t,"FilterPixelate"),this.amount=e}});t.exports=n},14366(t,e,i){var r=i(83419),s=i(13045),n=new r({Extends:s,initialize:function(t,e){e||(e={}),s.call(this,t,"FilterQuantize"),this.steps=[8,8,8,8],e.steps&&(this.steps[0]=e.steps[0],this.steps[1]=e.steps[1],this.steps[2]=e.steps[2],this.steps[3]=e.steps[3]),this.gamma=[1,1,1,1],e.gamma&&(this.gamma[0]=e.gamma[0],this.gamma[1]=e.gamma[1],this.gamma[2]=e.gamma[2],this.gamma[3]=e.gamma[3]),this.offset=[0,0,0,0],e.offset&&(this.offset[0]=e.offset[0],this.offset[1]=e.offset[1],this.offset[2]=e.offset[2],this.offset[3]=e.offset[3]),this.mode=e.mode||0,this.dither=!!e.dither}});t.exports=n},63785(t,e,i){var r=i(83419),s=i(13045),n=new r({Extends:s,initialize:function(t,e,i){void 0===i&&(i=null),s.call(this,t,"FilterSampler"),this.allowBaseDraw=!1,this.callback=e,this.region=i}});t.exports=n},62229(t,e,i){var r=i(83419),s=i(13045),n=new r({Extends:s,initialize:function(t,e,i,r,n,a,o,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=.1),void 0===n&&(n=1),void 0===o&&(o=6),void 0===h&&(h=1),s.call(this,t,"FilterShadow"),this.x=e,this.y=i,this.decay=r,this.power=n,this.glcolor=[0,0,0,1],this.samples=o,this.intensity=h,void 0!==a&&(this.color=a)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}},getPadding:function(){var t=this.paddingOverride;if(t)return this.currentPadding.setTo(t.x,t.y,t.width,t.height),t;var e=this.camera,i=this.decay*this.intensity,r=Math.ceil(Math.abs(this.x)*e.width*i),s=Math.ceil(Math.abs(this.y)*e.height*i);return this.currentPadding.setTo(-r,-s,2*r,2*s),this.currentPadding}});t.exports=n},99534(t,e,i){var r=i(83419),s=i(13045),n=new r({Extends:s,initialize:function(t,e,i,r){s.call(this,t,"FilterThreshold"),this.edge1=[.5,.5,.5,.5],this.edge2=[.5,.5,.5,.5],this.invert=[!1,!1,!1,!1],this.setEdge(e,i),this.setInvert(r)},setEdge:function(t,e){void 0===t&&(t=.5),"number"==typeof t&&(t=[t,t,t,t]),this.edge1[0]=t[0],this.edge1[1]=t[1],this.edge1[2]=t[2],this.edge1[3]=t[3],void 0===e&&(e=t),"number"==typeof e&&(e=[e,e,e,e]),this.edge2[0]=e[0],this.edge2[1]=e[1],this.edge2[2]=e[2],this.edge2[3]=e[3];for(var i=0;i<4;i++)if(this.edge1[i]>this.edge2[i]){var r=this.edge1[i];this.edge1[i]=this.edge2[i],this.edge2[i]=r}return this},setInvert:function(t){return void 0===t&&(t=!1),"boolean"==typeof t&&(t=[t,t,t,t]),this.invert[0]=t[0],this.invert[1]=t[1],this.invert[2]=t[2],this.invert[3]=t[3],this}});t.exports=n},20263(t,e,i){var r=i(83419),s=i(13045),n=i(40987),a=new r({Extends:s,initialize:function(t,e,i,r,a,o,h){void 0===e&&(e=.5),void 0===i&&(i=.5),void 0===r&&(r=.5),void 0===a&&(a=.5),void 0===o&&(o=0),void 0===h&&(h=0),s.call(this,t,"FilterVignette"),this.x=e,this.y=i,this.radius=r,this.strength=a,this.color=new n,this.blendMode=h,this.setColor(o)},setColor:function(t){return"number"==typeof t?n.IntegerToColor(t,this.color):"string"==typeof t?n.HexStringToColor(t,this.color):t.setTo?this.color.setTo(t.red,t.green,t.blue,t.alpha):t?this.color.setTo(t.r||0,t.g||0,t.b||0,t.a||255):this.color.setTo(0,0,0,255),this}});t.exports=a},90002(t,e,i){var r=i(83419),s=i(13045),n=i(79237),a=new r({Extends:s,initialize:function(t,e,i,r,n,a){void 0===e&&(e=.1),s.call(this,t,"FilterWipe"),this.progress=0,this.wipeWidth=e,this.direction=i||0,this.axis=r||0,this.reveal=n||0,this.wipeTexture=null,this.setTexture(a)},setWipeWidth:function(t){return void 0===t&&(t=.1),this.wipeWidth=t,this},setLeftToRight:function(){return this.direction=0,this.axis=0,this},setRightToLeft:function(){return this.direction=1,this.axis=0,this},setTopToBottom:function(){return this.direction=1,this.axis=1,this},setBottomToTop:function(){return this.direction=0,this.axis=1,this},setWipeEffect:function(){return this.reveal=0,this.progress=0,this},setRevealEffect:function(){return this.setTexture(),this.reveal=1,this.progress=0,this},setTexture:function(t){return void 0===t&&(t="__DEFAULT"),this.wipeTexture=t instanceof n?t:this.camera.scene.sys.textures.get(t)||this.camera.scene.sys.textures.get("__DEFAULT"),this},setProgress:function(t){return this.progress=t,this}});t.exports=a},11889(t,e,i){var r={Controller:i(13045),Barrel:i(10189),Blend:i(16762),Blocky:i(37597),Blur:i(88344),Bokeh:i(47564),ColorMatrix:i(77011),CombineColorMatrix:i(95200),Displacement:i(16898),Glow:i(42652),GradientMap:i(43927),ImageLight:i(84714),Key:i(51890),Mask:i(97797),NormalTools:i(37911),PanoramaBlur:i(6379),ParallelFilters:i(2195),Pixelate:i(29861),Quantize:i(14366),Sampler:i(63785),Shadow:i(62229),Threshold:i(99534),Vignette:i(20263),Wipe:i(90002)};t.exports=r},25305(t,e,i){var r=i(10312),s=i(23568);t.exports=function(t,e,i){e.x=s(i,"x",0),e.y=s(i,"y",0),e.depth=s(i,"depth",0),e.flipX=s(i,"flipX",!1),e.flipY=s(i,"flipY",!1);var n=s(i,"scale",null);"number"==typeof n?e.setScale(n):null!==n&&(e.scaleX=s(n,"x",1),e.scaleY=s(n,"y",1));var a=s(i,"scrollFactor",null);"number"==typeof a?e.setScrollFactor(a):null!==a&&(e.scrollFactorX=s(a,"x",1),e.scrollFactorY=s(a,"y",1)),e.rotation=s(i,"rotation",0);var o=s(i,"angle",null);null!==o&&(e.angle=o),e.alpha=s(i,"alpha",1);var h=s(i,"origin",null);if("number"==typeof h)e.setOrigin(h);else if(null!==h){var l=s(h,"x",.5),u=s(h,"y",.5);e.setOrigin(l,u)}return e.blendMode=s(i,"blendMode",r.NORMAL),e.visible=s(i,"visible",!0),s(i,"add",!0)&&t.sys.displayList.add(e),e.preUpdate&&t.sys.updateList.add(e),e}},13059(t,e,i){var r=i(23568);t.exports=function(t,e){var i=r(e,"anims",null);if(null===i)return t;if("string"==typeof i)t.anims.play(i);else if("object"==typeof i){var s=t.anims,n=r(i,"key",void 0);if(n){var a=r(i,"startFrame",void 0),o=r(i,"delay",0),h=r(i,"repeat",0),l=r(i,"repeatDelay",0),u=r(i,"yoyo",!1),d=r(i,"play",!1),c=r(i,"delayedPlay",0),f={key:n,delay:o,repeat:h,repeatDelay:l,yoyo:u,startFrame:a};d?s.play(f):c>0?s.playAfterDelay(f,c):s.load(f)}}return t}},8050(t,e,i){var r=i(83419),s=i(73162),n=i(37277),a=i(51708),o=i(44594),h=i(19186),l=new r({Extends:s,initialize:function(t){s.call(this,t),this.sortChildrenFlag=!1,this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.addCallback=this.addChildCallback,this.removeCallback=this.removeChildCallback,this.events.once(o.BOOT,this.boot,this),this.events.on(o.START,this.start,this)},boot:function(){this.events.once(o.DESTROY,this.destroy,this)},addChildCallback:function(t){t.displayList&&t.displayList!==this&&t.removeFromDisplayList(),t.parentContainer&&t.parentContainer.remove(t),t.displayList||(this.queueDepthSort(),t.displayList=this,t.emit(a.ADDED_TO_SCENE,t,this.scene),this.events.emit(o.ADDED_TO_SCENE,t,this.scene))},removeChildCallback:function(t){this.queueDepthSort(),t.displayList=null,t.emit(a.REMOVED_FROM_SCENE,t,this.scene),this.events.emit(o.REMOVED_FROM_SCENE,t,this.scene)},start:function(){this.events.once(o.SHUTDOWN,this.shutdown,this)},queueDepthSort:function(){this.sortChildrenFlag=!0},depthSort:function(){this.sortChildrenFlag&&(h(this.list,this.sortByDepth),this.sortChildrenFlag=!1)},sortByDepth:function(t,e){return t._depth-e._depth},getChildren:function(){return this.list},shutdown:function(){for(var t=this.list,e=t.length;e--;)t[e]&&t[e].destroy(!0);t.length=0,this.events.off(o.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(o.START,this.start,this),this.scene=null,this.systems=null,this.events=null}});n.register("DisplayList",l,"displayList"),t.exports=l},95643(t,e,i){var r=i(83419),s=i(31401),n=i(53774),a=i(45893),o=i(50792),h=i(51708),l=i(44594),u=new r({Extends:o,Mixins:[s.Filters,s.RenderSteps],initialize:function(t,e){o.call(this),this.scene=t,this.displayList=null,this.type=e,this.state=0,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.vertexRoundMode="safeAuto",this.input=null,this.body=null,this.ignoreDestroy=!1,this.isDestroyed=!1,this.addRenderStep&&this.addRenderStep(this.renderWebGL),this.on(h.ADDED_TO_SCENE,this.addedToScene,this),this.on(h.REMOVED_FROM_SCENE,this.removedFromScene,this),t.sys.queueDepthSort()},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},setState:function(t){return this.state=t,this},setDataEnabled:function(){return this.data||(this.data=new a(this)),this},setData:function(t,e){return this.data||(this.data=new a(this)),this.data.set(t,e),this},incData:function(t,e){return this.data||(this.data=new a(this)),this.data.inc(t,e),this},toggleData:function(t){return this.data||(this.data=new a(this)),this.data.toggle(t),this},getData:function(t){return this.data||(this.data=new a(this)),this.data.get(t)},setInteractive:function(t,e,i){return this.scene.sys.input.enable(this,t,e,i),this},disableInteractive:function(t){return void 0===t&&(t=!1),this.scene.sys.input.disable(this,t),this},removeInteractive:function(t){return void 0===t&&(t=!1),this.scene.sys.input.clear(this),t&&this.scene.sys.input.resetCursor(),this.input=void 0,this},addedToScene:function(){},removedFromScene:function(){},update:function(){},toJSON:function(){return n(this)},willRender:function(t){return!(!(!this.displayList||!this.displayList.active||this.displayList.willRender(t))||u.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},willRoundVertices:function(t,e){switch(this.vertexRoundMode){case"safe":return e;case"safeAuto":return e&&t.roundPixels;case"full":return!0;case"fullAuto":return t.roundPixels;default:return!1}},setVertexRoundMode:function(t){return this.vertexRoundMode=t,this},getIndexList:function(){for(var t=this,e=this.parentContainer,i=[];e&&(i.unshift(e.getIndex(t)),t=e,e.parentContainer);)e=e.parentContainer;return this.displayList?i.unshift(this.displayList.getIndex(t)):i.unshift(this.scene.sys.displayList.getIndex(t)),i},addToDisplayList:function(t){return void 0===t&&(t=this.scene.sys.displayList),this.displayList&&this.displayList!==t&&this.removeFromDisplayList(),t.exists(this)||(this.displayList=t,t.add(this,!0),t.queueDepthSort(),this.emit(h.ADDED_TO_SCENE,this,this.scene),t.events.emit(l.ADDED_TO_SCENE,this,this.scene)),this},addToUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.add(this),this},removeFromDisplayList:function(){var t=this.displayList||this.scene.sys.displayList;return t&&t.exists(this)&&(t.remove(this,!0),t.queueDepthSort(),this.displayList=null,this.emit(h.REMOVED_FROM_SCENE,this,this.scene),t.events.emit(l.REMOVED_FROM_SCENE,this,this.scene)),this},removeFromUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.remove(this),this},getDisplayList:function(){var t=null;return this.parentContainer?t=this.parentContainer.list:this.displayList&&(t=this.displayList.list),t},destroy:function(t){this.scene&&!this.ignoreDestroy&&(void 0===t&&(t=!1),this.isDestroyed=!0,this.preDestroy&&this.preDestroy.call(this),this.emit(h.DESTROY,this,t),this.removeAllListeners(),this.removeFromDisplayList(),this.removeFromUpdateList(),this.input&&(this.scene.sys.input.clear(this),this.input=void 0),this.data&&(this.data.destroy(),this.data=void 0),this.body&&(this.body.destroy(),this.body=void 0),this.filterCamera&&(this.filterCamera.destroy(),this.filterCamera=void 0),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0)}});u.RENDER_MASK=15,t.exports=u},44603(t,e,i){var r=i(83419),s=i(37277),n=i(44594),a=new r({initialize:function(t){this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.displayList,this.updateList,this.events.once(n.BOOT,this.boot,this),this.events.on(n.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(n.DESTROY,this.destroy,this)},start:function(){this.events.once(n.SHUTDOWN,this.shutdown,this)},shutdown:function(){this.events.off(n.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(n.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});a.register=function(t,e){a.prototype.hasOwnProperty(t)||(a.prototype[t]=e)},a.remove=function(t){a.prototype.hasOwnProperty(t)&&delete a.prototype[t]},s.register("GameObjectCreator",a,"make"),t.exports=a},39429(t,e,i){var r=i(83419),s=i(37277),n=i(44594),a=new r({initialize:function(t){this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.displayList,this.updateList,this.events.once(n.BOOT,this.boot,this),this.events.on(n.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(n.DESTROY,this.destroy,this)},start:function(){this.events.once(n.SHUTDOWN,this.shutdown,this)},existing:function(t){return(t.renderCanvas||t.renderWebGL)&&this.displayList.add(t),t.preUpdate&&this.updateList.add(t),t},shutdown:function(){this.events.off(n.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(n.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});a.register=function(t,e){a.prototype.hasOwnProperty(t)||(a.prototype[t]=e)},a.remove=function(t){a.prototype.hasOwnProperty(t)&&delete a.prototype[t]},s.register("GameObjectFactory",a,"add"),t.exports=a},91296(t,e,i){var r=i(61340),s=new r,n=new r,a=new r,o=new r,h={camera:s,sprite:n,calc:a,cameraExternal:o};t.exports=function(t,e,i,r){return r?o.loadIdentity():o.copyFrom(e.matrixExternal),s.copyWithScrollFactorFrom(r?e.matrix:e.matrixCombined,e.scrollX,e.scrollY,t.scrollFactorX,t.scrollFactorY),a.copyFrom(s),i&&a.multiply(i),n.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),a.multiply(n),h}},45027(t,e,i){var r=i(83419),s=i(25774),n=i(37277),a=i(44594),o=new r({Extends:s,initialize:function(t){s.call(this),this.checkQueue=!0,this.scene=t,this.systems=t.sys,t.sys.events.once(a.BOOT,this.boot,this),t.sys.events.on(a.START,this.start,this)},boot:function(){this.systems.events.once(a.DESTROY,this.destroy,this)},start:function(){var t=this.systems.events;t.on(a.PRE_UPDATE,this.update,this),t.on(a.UPDATE,this.sceneUpdate,this),t.once(a.SHUTDOWN,this.shutdown,this)},sceneUpdate:function(t,e){for(var i=this._active,r=i.length,s=0;s0){a=o.split("\n");var z=[];for(s=0;sC&&(d=C),c>E&&(c=E);var q=C+b.xAdvance,K=E+m;fF&&(F=I),IF&&(F=I),I0)for(var Q=0;Qo.length&&(x=o.length);for(var T=p,w=g,b={retroFont:!0,font:h,size:i,lineHeight:s+y,chars:{}},S=0,C=0;C?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",TEXT_SET2:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET3:"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",TEXT_SET4:"ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789",TEXT_SET5:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789",TEXT_SET6:"ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' ",TEXT_SET7:"AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39",TEXT_SET8:"0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET9:"ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?!",TEXT_SET10:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET11:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789"}},2638(t,e,i){var r=i(22186),s=i(83419),n=i(12310),a=new s({Extends:r,Mixins:[n],initialize:function(t,e,i,s,n,a,o){r.call(this,t,e,i,s,n,a,o),this.type="DynamicBitmapText",this.scrollX=0,this.scrollY=0,this.cropWidth=0,this.cropHeight=0,this.displayCallback,this.callbackData={parent:this,color:0,tint:{topLeft:0,topRight:0,bottomLeft:0,bottomRight:0},index:0,charCode:0,x:0,y:0,scale:0,rotation:0,data:0}},setSize:function(t,e){return this.cropWidth=t,this.cropHeight=e,this},setDisplayCallback:function(t){return this.displayCallback=t,this},setScrollX:function(t){return this.scrollX=t,this},setScrollY:function(t){return this.scrollY=t,this}});t.exports=a},86741(t,e,i){var r=i(20926);t.exports=function(t,e,i,s){var n=e._text,a=n.length,o=t.currentContext;if(0!==a&&r(t,o,e,i,s)){i.addToRenderList(e);var h=e.fromAtlas?e.frame:e.texture.frames.__BASE,l=e.displayCallback,u=e.callbackData,d=e.fontData.chars,c=e.fontData.lineHeight,f=e._letterSpacing,p=0,g=0,m=0,v=null,y=0,x=0,T=0,w=0,b=0,S=0,C=null,E=0,A=e.frame.source.image,_=h.cutX,M=h.cutY,R=0,P=0,O=e._fontSize/e.fontData.size,L=e._align,F=0,D=0;e.getTextBounds(!1);var I=e._bounds.lines;1===L?D=(I.longest-I.lengths[0])/2:2===L&&(D=I.longest-I.lengths[0]),o.translate(-e.displayOriginX,-e.displayOriginY);var N=i.roundPixels;e.cropWidth>0&&e.cropHeight>0&&(o.beginPath(),o.rect(0,0,e.cropWidth,e.cropHeight),o.clip());for(var B=0;B0||e.cropHeight>0;x&&((f=i.getClone()).setScissorEnable(!0),f.setScissorBox(v.tx,v.ty,e.cropWidth*v.scaleX,e.cropHeight*v.scaleY),f.use()),h.frame=e.frame;var T,w,b=s.MULTIPLY,S=a.getTintAppendFloatAlpha(e.tintTopLeft,e._alphaTL),C=a.getTintAppendFloatAlpha(e.tintTopRight,e._alphaTR),E=a.getTintAppendFloatAlpha(e.tintBottomLeft,e._alphaBL),A=a.getTintAppendFloatAlpha(e.tintBottomRight,e._alphaBR),_=0,M=0,R=0,P=0,O=e.letterSpacing,L=0,F=0,D=e.scrollX,I=e.scrollY,N=e.fontData,B=N.chars,k=N.lineHeight,U=e.fontSize/N.size,z=0,Y=e._align,X=0,W=0,G=e.getTextBounds(!1);e.maxWidth>0&&(d=(u=G.wrappedText).length);var V=e._bounds.lines;1===Y?W=(V.longest-V.lengths[0])/2:2===Y&&(W=V.longest-V.lengths[0]);for(var H=e.displayCallback,j=e.callbackData,q=0;q0&&(a=(n=L.wrappedText).length);var F=e._bounds.lines;1===R?O=(F.longest-F.lengths[0])/2:2===R&&(O=F.longest-F.lengths[0]),o.translate(-e.displayOriginX,-e.displayOriginY);for(var D=i.roundPixels,I=0;I0},getRenderList:function(){return this.dirty&&(this.renderList=this.children.list.filter(this.childCanRender,this),this.dirty=!1),this.renderList},clear:function(){this.children.removeAll(),this.dirty=!0},preDestroy:function(){this.children.destroy(),this.renderList=[]}});t.exports=d},72396(t){t.exports=function(t,e,i,r){var s=e.getRenderList();if(0!==s.length){var n=t.currentContext,a=i.alpha*e.alpha;if(0!==a){i.addToRenderList(e),n.globalCompositeOperation=t.blendModes[e.blendMode],n.imageSmoothingEnabled=!e.frame.source.scaleMode;var o=e.x-i.scrollX*e.scrollFactorX,h=e.y-i.scrollY*e.scrollFactorY;n.save(),r&&r.copyToContext(n);for(var l=i.roundPixels,u=0;u0&&p.height>0&&(n.save(),n.translate(d.x+o,d.y+h),n.scale(v,y),n.drawImage(f.source.image,p.x,p.y,p.width,p.height,g,m,p.width,p.height),n.restore())):(l&&(g=Math.round(g),m=Math.round(m)),p.width>0&&p.height>0&&n.drawImage(f.source.image,p.x,p.y,p.width,p.height,g+d.x+o,m+d.y+h,p.width,p.height)))}n.restore()}}}},9403(t,e,i){var r=i(6107),s=i(25305),n=i(44603),a=i(23568);n.register("blitter",function(t,e){void 0===t&&(t={});var i=a(t,"key",null),n=a(t,"frame",null),o=new r(this.scene,0,0,i,n);return void 0!==e&&(t.add=e),s(this.scene,o,t),o})},12709(t,e,i){var r=i(6107);i(39429).register("blitter",function(t,e,i,s){return this.displayList.add(new r(this.scene,t,e,i,s))})},48011(t,e,i){var r=i(29747),s=r,n=r;s=i(99485),n=i(72396),t.exports={renderWebGL:s,renderCanvas:n}},99485(t,e,i){var r=i(61340),s=i(70554),n=new r,a={quad:new Float32Array(8)},o={},h={};t.exports=function(t,e,i,r){var l=e.getRenderList(),u=i.camera,d=e.alpha;if(0!==l.length&&0!==d){u.addToRenderList(e);var c=n.copyWithScrollFactorFrom(u.getViewMatrix(!i.useCanvas),u.scrollX,u.scrollY,e.scrollFactorX,e.scrollFactorY);r&&c.multiply(r);for(var f=e.x,p=e.y,g=e.customRenderNodes,m=e.defaultRenderNodes,v=0;v0!=t>0,this._alpha=t}}});t.exports=n},43451(t,e,i){var r=i(87774),s=i(30529),n=i(83419),a=i(31401),o=i(95643),h=i(36683),l=new n({Extends:o,Mixins:[a.BlendMode,a.Depth,a.RenderNodes,a.Visible,h],initialize:function(t,e){o.call(this,t,"CaptureFrame");var i=t.renderer;this.drawingContext=new r(i,{width:i.width,height:i.height}),this.captureTexture=t.sys.textures.addGLTexture(e,this.drawingContext.texture),this.initRenderNodes(this._defaultRenderNodesMap)},_defaultRenderNodesMap:{get:function(){return s}},setAlpha:function(t){return this},setScrollFactor:function(t,e){return this}});t.exports=l},23675(t,e,i){var r=i(44603),s=i(23568),n=i(43451);r.register("captureFrame",function(t,e){void 0===t&&(t={});var i=s(t,"depth",0),r=s(t,"key",null),a=s(t,"visible",!0),o=new n(this.scene,r);return void 0!==e&&(t.add=e),o.setDepth(i).setVisible(a),t.add&&this.scene.sys.displayList.add(o),o})},20421(t,e,i){var r=i(43451);i(39429).register("captureFrame",function(t){return this.displayList.add(new r(this.scene,t))})},36683(t,e,i){var r=i(29747),s=r,n=r;s=i(82237),t.exports={renderWebGL:s,renderCanvas:n}},82237(t){var e=!1;t.exports=function(t,i,r){if(r.useCanvas)e||(e=!0,console.warn("CaptureFrame: Cannot capture from main canvas. Activate `forceComposite` on the camera to use this feature. This warning will now mute."));else{r.camera.addToRenderList(i);var s=r.width,n=r.height,a=i.customRenderNodes,o=i.defaultRenderNodes;i.drawingContext.resize(s,n),i.drawingContext.use(),(a.BatchHandler||o.BatchHandler).batch(i.drawingContext,r.texture,0,n,0,0,s,n,s,0,0,0,1,1,!1,4294967295,4294967295,4294967295,4294967295,{}),i.drawingContext.release()}}},16005(t,e,i){var r=i(45319),s={_alpha:1,_alphaTL:1,_alphaTR:1,_alphaBL:1,_alphaBR:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t,e,i,s){return void 0===t&&(t=1),void 0===e?this.alpha=t:(this._alphaTL=r(t,0,1),this._alphaTR=r(e,0,1),this._alphaBL=r(i,0,1),this._alphaBR=r(s,0,1)),this},alpha:{get:function(){return this._alpha},set:function(t){var e=r(t,0,1);this._alpha=e,this._alphaTL=e,this._alphaTR=e,this._alphaBL=e,this._alphaBR=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}},alphaTopLeft:{get:function(){return this._alphaTL},set:function(t){var e=r(t,0,1);this._alphaTL=e,0!==e&&(this.renderFlags|=2)}},alphaTopRight:{get:function(){return this._alphaTR},set:function(t){var e=r(t,0,1);this._alphaTR=e,0!==e&&(this.renderFlags|=2)}},alphaBottomLeft:{get:function(){return this._alphaBL},set:function(t){var e=r(t,0,1);this._alphaBL=e,0!==e&&(this.renderFlags|=2)}},alphaBottomRight:{get:function(){return this._alphaBR},set:function(t){var e=r(t,0,1);this._alphaBR=e,0!==e&&(this.renderFlags|=2)}}};t.exports=s},88509(t,e,i){var r=i(45319),s={_alpha:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t){return void 0===t&&(t=1),this.alpha=t,this},alpha:{get:function(){return this._alpha},set:function(t){var e=r(t,0,1);this._alpha=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}}};t.exports=s},90065(t,e,i){var r=i(10312),s={_blendMode:r.NORMAL,blendMode:{get:function(){return this._blendMode},set:function(t){"string"==typeof t&&(t=r[t]),(t|=0)>=-1&&(this._blendMode=t)}},setBlendMode:function(t){return this.blendMode=t,this}};t.exports=s},94215(t){t.exports={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}}},61683(t){var e={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,r){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,r,this.flipX,this.flipY);else{var s=t;this.frame.setCropUVs(this._crop,s.x,s.y,s.width,s.height,this.flipX,this.flipY)}this.isCropped=!0}return this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=e},89272(t,e,i){var r=i(37105),s={_depth:0,depth:{get:function(){return this._depth},set:function(t){this.displayList&&this.displayList.queueDepthSort(),this._depth=t}},setDepth:function(t){return void 0===t&&(t=0),this.depth=t,this},setToTop:function(){var t=this.getDisplayList();return t&&r.BringToTop(t,this),this},setToBack:function(){var t=this.getDisplayList();return t&&r.SendToBack(t,this),this},setAbove:function(t){var e=this.getDisplayList();return e&&t&&r.MoveAbove(e,this,t),this},setBelow:function(t){var e=this.getDisplayList();return e&&t&&r.MoveBelow(e,this,t),this}};t.exports=s},3248(t){var e={timeElapsed:0,timeElapsedResetPeriod:36e5,timePaused:!1,setTimerResetPeriod:function(t){return this.timeElapsedResetPeriod=t,this},setTimerPaused:function(t){return this.timePaused=!!t,this},resetTimer:function(t){return void 0===t&&(t=0),this.timeElapsed=t,this},updateTimer:function(t,e){return this.timePaused||(this.timeElapsed+=e,this.timeElapsed>=this.timeElapsedResetPeriod&&(this.timeElapsed-=this.timeElapsedResetPeriod)),this}};t.exports=e},53427(t,e,i){var r=i(83419),s=i(10189),n=i(16762),a=i(37597),o=i(88344),h=i(47564),l=i(77011),u=i(95200),d=i(16898),c=i(42652),f=i(43927),p=i(84714),g=i(51890),m=i(97797),v=i(37911),y=i(6379),x=i(29861),T=i(14366),w=i(63785),b=i(62229),S=i(99534),C=i(20263),E=i(90002),A=new r({initialize:function(t){this.camera=t,this.list=[]},clear:function(){for(var t=0;t0||this.filters.external.getActive().length>0||this.filtersForceComposite)},enableFilters:function(){if(this.filterCamera||!this.scene.renderer.gl)return this;var t=this.scene;if(r||(r=i(38058)),this.filterCamera=new r(0,0,1,1).setScene(t,!1),this.filterCamera.isObjectInversion=!0,t.game.config.roundPixels&&(this.filterCamera.roundPixels=!0),!this.maxFilterSize){var e=t.renderer.getMaxTextureSize();this.maxFilterSize=new s(e,e)}return this._filtersMatrix=new n,this._filtersViewMatrix=new n,this.getBounds&&void 0!==this.width&&void 0!==this.height&&0!==this.width&&0!==this.height||(this.filtersFocusContext=!0),this.addRenderStep(this.renderWebGLFilters,0),this},renderWebGLFilters:function(t,e,i,r,s){if(e.willRenderFilters()){var n=i.camera,a=e.filtersAutoFocus,o=e.filtersFocusContext;a&&(o?e.focusFiltersOnCamera(n):e.focusFilters());var h=e.filterCamera;h.preRender();var l=h.roundPixels;if(h.roundPixels=e.willRoundVertices(h,e.rotation%(2*Math.PI)==0&&(e.scaleX,1===e.scaleY)),a&&o){var u=e.parentContainer;if(u){var d=u.getWorldTransformMatrix();h.matrix.multiply(d)}}var c=e._filtersMatrix,f=e._filtersViewMatrix.copyWithScrollFactorFrom(n.getViewMatrix(!i.useCanvas),n.scrollX,n.scrollY,e.scrollFactorX,e.scrollFactorY);if(r&&f.multiply(r),o)c.loadIdentity();else{if("Layer"===e.type)c.loadIdentity();else{var p=e.flipX?-1:1,g=e.flipY?-1:1;c.applyITRS(e.x,e.y,e.rotation,e.scaleX*p,e.scaleY*g)}var m=h.width,v=h.height;c.translate(-m*h.originX,-v*h.originY),f.multiply(c,c)}var y=e.scrollFactorX,x=e.scrollFactorY;e.scrollFactorX=1,e.scrollFactorY=1,t.cameraRenderNode.run(i,[e],h,c,!0,s+1),e.scrollFactorX=y,e.scrollFactorY=x,h.roundPixels=l;for(var T=h.renderList.length,w=0;w0?Math.acos(e/this.scaleX):-Math.acos(e/this.scaleX):r||n?s.PI_OVER_2-(n>0?Math.acos(-r/this.scaleY):-Math.acos(r/this.scaleY)):0}},scaleX:{get:function(){return Math.sqrt(this.a*this.a+this.b*this.b)}},scaleY:{get:function(){return Math.sqrt(this.c*this.c+this.d*this.d)}},loadIdentity:function(){var t=this.matrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,this},translate:function(t,e){var i=this.matrix;return i[4]=i[0]*t+i[2]*e+i[4],i[5]=i[1]*t+i[3]*e+i[5],this},scale:function(t,e){var i=this.matrix;return i[0]*=t,i[1]*=t,i[2]*=e,i[3]*=e,this},rotate:function(t){var e=Math.sin(t),i=Math.cos(t),r=this.matrix,s=r[0],n=r[1],a=r[2],o=r[3];return r[0]=s*i+a*e,r[1]=n*i+o*e,r[2]=s*-e+a*i,r[3]=n*-e+o*i,this},multiply:function(t,e){var i=this.matrix,r=t.matrix,s=i[0],n=i[1],a=i[2],o=i[3],h=i[4],l=i[5],u=r[0],d=r[1],c=r[2],f=r[3],p=r[4],g=r[5],m=void 0===e?i:e.matrix;return m[0]=u*s+d*a,m[1]=u*n+d*o,m[2]=c*s+f*a,m[3]=c*n+f*o,m[4]=p*s+g*a+h,m[5]=p*n+g*o+l,m},multiplyWithOffset:function(t,e,i){var r=this.matrix,s=t.matrix,n=r[0],a=r[1],o=r[2],h=r[3],l=e*n+i*o+r[4],u=e*a+i*h+r[5],d=s[0],c=s[1],f=s[2],p=s[3],g=s[4],m=s[5];return r[0]=d*n+c*o,r[1]=d*a+c*h,r[2]=f*n+p*o,r[3]=f*a+p*h,r[4]=g*n+m*o+l,r[5]=g*a+m*h+u,this},transform:function(t,e,i,r,s,n){var a=this.matrix,o=a[0],h=a[1],l=a[2],u=a[3],d=a[4],c=a[5];return a[0]=t*o+e*l,a[1]=t*h+e*u,a[2]=i*o+r*l,a[3]=i*h+r*u,a[4]=s*o+n*l+d,a[5]=s*h+n*u+c,this},transformPoint:function(t,e,i){void 0===i&&(i={x:0,y:0});var r=this.matrix,s=r[0],n=r[1],a=r[2],o=r[3],h=r[4],l=r[5];return i.x=t*s+e*a+h,i.y=t*n+e*o+l,i},invert:function(){var t=this.matrix,e=t[0],i=t[1],r=t[2],s=t[3],n=t[4],a=t[5],o=e*s-i*r;return t[0]=s/o,t[1]=-i/o,t[2]=-r/o,t[3]=e/o,t[4]=(r*a-s*n)/o,t[5]=-(e*a-i*n)/o,this},copyFrom:function(t){var e=this.matrix;return e[0]=t.a,e[1]=t.b,e[2]=t.c,e[3]=t.d,e[4]=t.e,e[5]=t.f,this},copyFromArray:function(t){var e=this.matrix;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],this},copyWithScrollFactorFrom:function(t,e,i,r,s){var n=this.matrix;n[0]=t.a,n[1]=t.b,n[2]=t.c,n[3]=t.d;var a=e*(1-r),o=i*(1-s);return n[4]=t.a*a+t.c*o+t.e,n[5]=t.b*a+t.d*o+t.f,this},copyToContext:function(t){var e=this.matrix;return t.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t},setToContext:function(t){return t.setTransform(this.a,this.b,this.c,this.d,this.e,this.f),t},copyToArray:function(t){var e=this.matrix;return void 0===t?t=[e[0],e[1],e[2],e[3],e[4],e[5]]:(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5]),t},setTransform:function(t,e,i,r,s,n){var a=this.matrix;return a[0]=t,a[1]=e,a[2]=i,a[3]=r,a[4]=s,a[5]=n,this},decomposeMatrix:function(){var t=this.decomposedMatrix,e=this.matrix,i=e[0],r=e[1],s=e[2],n=e[3],a=i*n-r*s;if(t.translateX=e[4],t.translateY=e[5],i||r){var o=Math.sqrt(i*i+r*r);t.rotation=r>0?Math.acos(i/o):-Math.acos(i/o),t.scaleX=o,t.scaleY=a/o}else if(s||n){var h=Math.sqrt(s*s+n*n);t.rotation=.5*Math.PI-(n>0?Math.acos(-s/h):-Math.acos(s/h)),t.scaleX=a/h,t.scaleY=h}else t.rotation=0,t.scaleX=0,t.scaleY=0;return t},applyITRS:function(t,e,i,r,s){var n=this.matrix,a=Math.sin(i),o=Math.cos(i);return n[4]=t,n[5]=e,n[0]=o*r,n[1]=a*r,n[2]=-a*s,n[3]=o*s,this},applyInverse:function(t,e,i){void 0===i&&(i=new n);var r=this.matrix,s=r[0],a=r[1],o=r[2],h=r[3],l=r[4],u=r[5],d=1/(s*h+o*-a);return i.x=h*d*t+-o*d*e+(u*o-l*h)*d,i.y=s*d*e+-a*d*t+(-u*s+l*a)*d,i},setQuad:function(t,e,i,r,s){void 0===s&&(s=this.quad);var n=this.matrix,a=n[0],o=n[1],h=n[2],l=n[3],u=n[4],d=n[5];return s[0]=t*a+e*h+u,s[1]=t*o+e*l+d,s[2]=t*a+r*h+u,s[3]=t*o+r*l+d,s[4]=i*a+r*h+u,s[5]=i*o+r*l+d,s[6]=i*a+e*h+u,s[7]=i*o+e*l+d,s},getX:function(t,e){return t*this.a+e*this.c+this.e},getY:function(t,e){return t*this.b+e*this.d+this.f},getXRound:function(t,e,i){var r=this.getX(t,e);return i&&(r=Math.floor(r+.5)),r},getYRound:function(t,e,i){var r=this.getY(t,e);return i&&(r=Math.floor(r+.5)),r},getCSSMatrix:function(){var t=this.matrix;return"matrix("+t[0]+","+t[1]+","+t[2]+","+t[3]+","+t[4]+","+t[5]+")"},destroy:function(){this.matrix=null,this.quad=null,this.decomposedMatrix=null}});t.exports=a},59715(t){var e={_visible:!0,visible:{get:function(){return this._visible},set:function(t){t?(this._visible=!0,this.renderFlags|=1):(this._visible=!1,this.renderFlags&=-2)}},setVisible:function(t){return this.visible=t,this}};t.exports=e},31401(t,e,i){t.exports={Alpha:i(16005),AlphaSingle:i(88509),BlendMode:i(90065),ComputedSize:i(94215),Crop:i(61683),Depth:i(89272),ElapseTimer:i(3248),FilterList:i(53427),Filters:i(43102),Flip:i(54434),GetBounds:i(8004),Lighting:i(73629),Mask:i(8573),Origin:i(27387),PathFollower:i(37640),RenderNodes:i(68680),RenderSteps:i(86038),ScrollFactor:i(80227),Size:i(16736),Texture:i(37726),TextureCrop:i(79812),Tint:i(27472),ToJSON:i(53774),Transform:i(16901),TransformMatrix:i(61340),Visible:i(59715)}},31559(t,e,i){var r=i(37105),s=i(10312),n=i(83419),a=i(31401),o=i(51708),h=i(95643),l=i(87841),u=i(29959),d=i(36899),c=i(26099),f=i(93595),p=new a.TransformMatrix,g=new n({Extends:h,Mixins:[a.AlphaSingle,a.BlendMode,a.ComputedSize,a.Depth,a.Mask,a.Transform,a.Visible,u],initialize:function(t,e,i,r){h.call(this,t,"Container"),this.list=[],this.exclusive=!0,this.maxSize=-1,this.position=0,this.localTransform=new a.TransformMatrix,this._sortKey="",this._sysEvents=t.sys.events,this.scrollFactorX=1,this.scrollFactorY=1,this.setPosition(e,i),this.setBlendMode(s.SKIP_CHECK),r&&this.add(r)},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return.5*this.width}},displayOriginY:{get:function(){return.5*this.height}},setExclusive:function(t){return void 0===t&&(t=!0),this.exclusive=t,this},getBounds:function(t){if(void 0===t&&(t=new l),t.setTo(this.x,this.y,0,0),this.parentContainer){var e=this.parentContainer.getBoundsTransformMatrix().transformPoint(this.x,this.y);t.setTo(e.x,e.y,0,0)}if(this.list.length>0){var i=this.list,r=new l,s=!1;t.setEmpty();for(var n=0;n-1},setAll:function(t,e,i,s){return r.SetAll(this.list,t,e,i,s),this},each:function(t,e){var i,r=[null],s=this.list.slice(),n=s.length;for(i=2;i0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.list=[]},onChildDestroyed:function(t){r.Remove(this.list,t),this.exclusive&&(t.parentContainer=null,t.removedFromScene())}});t.exports=g},53584(t){t.exports=function(t,e,i,r){i.addToRenderList(e);var s=e.list;if(0!==s.length){var n=e.localTransform;r?(n.loadIdentity(),n.multiply(r),n.translate(e.x,e.y),n.rotate(e.rotation),n.scale(e.scaleX,e.scaleY)):n.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var a=-1!==e.blendMode;a||t.setBlendMode(0);var o=e._alpha,h=e.scrollFactorX,l=e.scrollFactorY;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var u=0;u=0,d=a>=0,f=o>=0,p=h>=0;return n=Math.abs(n),a=Math.abs(a),o=Math.abs(o),h=Math.abs(h),this.beginPath(),this.moveTo(t+n,e),this.lineTo(t+i-a,e),d?this.arc(t+i-a,e+a,a,-c.PI_OVER_2,0):this.arc(t+i,e,a,Math.PI,c.PI_OVER_2,!0),this.lineTo(t+i,e+r-h),p?this.arc(t+i-h,e+r-h,h,0,c.PI_OVER_2):this.arc(t+i,e+r,h,-c.PI_OVER_2,Math.PI,!0),this.lineTo(t+o,e+r),f?this.arc(t+o,e+r-o,o,c.PI_OVER_2,Math.PI):this.arc(t,e+r,o,0,-c.PI_OVER_2,!0),this.lineTo(t,e+n),l?this.arc(t+n,e+n,n,-Math.PI,-c.PI_OVER_2):this.arc(t,e,n,c.PI_OVER_2,0,!0),this.fillPath(),this},strokeRoundedRect:function(t,e,i,r,s){void 0===s&&(s=20);var n=s,a=s,o=s,h=s,l=Math.min(i,r)/2;"number"!=typeof s&&(n=u(s,"tl",20),a=u(s,"tr",20),o=u(s,"bl",20),h=u(s,"br",20));var d=n>=0,f=a>=0,p=o>=0,g=h>=0;return n=Math.min(Math.abs(n),l),a=Math.min(Math.abs(a),l),o=Math.min(Math.abs(o),l),h=Math.min(Math.abs(h),l),this.beginPath(),this.moveTo(t+n,e),this.lineTo(t+i-a,e),this.moveTo(t+i-a,e),f?this.arc(t+i-a,e+a,a,-c.PI_OVER_2,0):this.arc(t+i,e,a,Math.PI,c.PI_OVER_2,!0),this.lineTo(t+i,e+r-h),this.moveTo(t+i,e+r-h),g?this.arc(t+i-h,e+r-h,h,0,c.PI_OVER_2):this.arc(t+i,e+r,h,-c.PI_OVER_2,Math.PI,!0),this.lineTo(t+o,e+r),this.moveTo(t+o,e+r),p?this.arc(t+o,e+r-o,o,c.PI_OVER_2,Math.PI):this.arc(t,e+r,o,0,-c.PI_OVER_2,!0),this.lineTo(t,e+n),this.moveTo(t,e+n),d?this.arc(t+n,e+n,n,-Math.PI,-c.PI_OVER_2):this.arc(t,e,n,c.PI_OVER_2,0,!0),this.strokePath(),this},fillPointShape:function(t,e){return this.fillPoint(t.x,t.y,e)},fillPoint:function(t,e,i){return!i||i<1?i=1:(t-=i/2,e-=i/2),this.commandBuffer.push(n.FILL_RECT,t,e,i,i),this},fillTriangleShape:function(t){return this.fillTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},strokeTriangleShape:function(t){return this.strokeTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},fillTriangle:function(t,e,i,r,s,a){return this.commandBuffer.push(n.FILL_TRIANGLE,t,e,i,r,s,a),this},strokeTriangle:function(t,e,i,r,s,a){return this.commandBuffer.push(n.STROKE_TRIANGLE,t,e,i,r,s,a),this},strokeLineShape:function(t){return this.lineBetween(t.x1,t.y1,t.x2,t.y2)},lineBetween:function(t,e,i,r){return this.beginPath(),this.moveTo(t,e),this.lineTo(i,r),this.strokePath(),this},lineTo:function(t,e){return this.commandBuffer.push(n.LINE_TO,t,e),this},moveTo:function(t,e){return this.commandBuffer.push(n.MOVE_TO,t,e),this},strokePoints:function(t,e,i,r){void 0===e&&(e=!1),void 0===i&&(i=!1),void 0===r&&(r=t.length),this.beginPath(),this.moveTo(t[0].x,t[0].y);for(var s=1;s-1&&this.fillStyle(this.defaultFillColor,this.defaultFillAlpha),this.defaultStrokeColor>-1&&this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha),this},generateTexture:function(t,e,i){var r,s,n=this.scene.sys,a=n.game.renderer;void 0===e&&(e=n.scale.width),void 0===i&&(i=n.scale.height),p.TargetCamera.setScene(this.scene),p.TargetCamera.setViewport(0,0,e,i),p.TargetCamera.scrollX=this.x,p.TargetCamera.scrollY=this.y;var o={willReadFrequently:!0};if("string"==typeof t)if(n.textures.exists(t)){var h=(r=n.textures.get(t)).getSourceImage();h instanceof HTMLCanvasElement&&(s=h.getContext("2d",o))}else s=(r=n.textures.createCanvas(t,e,i)).getSourceImage().getContext("2d",o);else t instanceof HTMLCanvasElement&&(s=t.getContext("2d",o));return s&&(this.renderCanvas(a,this,p.TargetCamera,null,s,!1),r&&r.refresh()),this},preDestroy:function(){this.commandBuffer=[]}});p.TargetCamera=new r,t.exports=p},32768(t,e,i){var r=i(85592),s=i(20926);t.exports=function(t,e,i,n,a,o){var h=e.commandBuffer,l=h.length,u=a||t.currentContext;if(0!==l&&s(t,u,e,i,n)){i.addToRenderList(e);var d=1,c=1,f=0,p=0,g=1,m=0,v=0,y=0;u.beginPath();for(var x=0;x>>16,v=(65280&f)>>>8,y=255&f,u.strokeStyle="rgba("+m+","+v+","+y+","+d+")",u.lineWidth=g,x+=3;break;case r.FILL_STYLE:p=h[x+1],c=h[x+2],m=(16711680&p)>>>16,v=(65280&p)>>>8,y=255&p,u.fillStyle="rgba("+m+","+v+","+y+","+c+")",x+=2;break;case r.BEGIN_PATH:u.beginPath();break;case r.CLOSE_PATH:u.closePath();break;case r.FILL_PATH:o||u.fill();break;case r.STROKE_PATH:o||u.stroke();break;case r.FILL_RECT:o?u.rect(h[x+1],h[x+2],h[x+3],h[x+4]):u.fillRect(h[x+1],h[x+2],h[x+3],h[x+4]),x+=4;break;case r.FILL_TRIANGLE:u.beginPath(),u.moveTo(h[x+1],h[x+2]),u.lineTo(h[x+3],h[x+4]),u.lineTo(h[x+5],h[x+6]),u.closePath(),o||u.fill(),x+=6;break;case r.STROKE_TRIANGLE:u.beginPath(),u.moveTo(h[x+1],h[x+2]),u.lineTo(h[x+3],h[x+4]),u.lineTo(h[x+5],h[x+6]),u.closePath(),o||u.stroke(),x+=6;break;case r.LINE_TO:u.lineTo(h[x+1],h[x+2]),x+=2;break;case r.MOVE_TO:u.moveTo(h[x+1],h[x+2]),x+=2;break;case r.LINE_FX_TO:u.lineTo(h[x+1],h[x+2]),x+=5;break;case r.MOVE_FX_TO:u.moveTo(h[x+1],h[x+2]),x+=5;break;case r.SAVE:u.save();break;case r.RESTORE:u.restore();break;case r.TRANSLATE:u.translate(h[x+1],h[x+2]),x+=2;break;case r.SCALE:u.scale(h[x+1],h[x+2]),x+=2;break;case r.ROTATE:u.rotate(h[x+1]),x+=1;break;case r.GRADIENT_FILL_STYLE:x+=5;break;case r.GRADIENT_LINE_STYLE:x+=6}}u.restore()}}},87079(t,e,i){var r=i(44603),s=i(43831);r.register("graphics",function(t,e){void 0===t&&(t={}),void 0!==e&&(t.add=e);var i=new s(this.scene,t);return t.add&&this.scene.sys.displayList.add(i),i})},1201(t,e,i){var r=i(43831);i(39429).register("graphics",function(t){return this.displayList.add(new r(this.scene,t))})},84503(t,e,i){var r=i(29747),s=r,n=r;s=i(77545),n=i(32768),n=i(32768),t.exports={renderWebGL:s,renderCanvas:n}},77545(t,e,i){var r=i(85592),s=i(91296),n=i(70554),a=i(61340),o=function(t,e,i){this.x=t,this.y=e,this.width=i},h=function(t,e,i){this.points=[],this.points[0]=new o(t,e,i),this.addPoint=function(t,e,i){var r=this.points[this.points.length-1];r.x===t&&r.y===e||this.points.push(new o(t,e,i))}},l=[],u=new a,d=new a,c={TL:0,TR:0,BL:0,BR:0},f={TL:0,TR:0,BL:0,BR:0},p=[{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0}];t.exports=function(t,e,i,a){if(0!==e.commandBuffer.length){var o=e.customRenderNodes,g=e.defaultRenderNodes,m=o.Submitter||g.Submitter,v=e.lighting,y=i,x=y.camera;x.addToRenderList(e);for(var T=s(e,x,a,!i.useCanvas).calc,w=u.loadIdentity(),b=e.commandBuffer,S=e.alpha,C=Math.max(e.pathDetailThreshold,t.config.pathDetailThreshold,0),E=1,A=0,_=0,M=0,R=2*Math.PI,P=[],O=0,L=!0,F=null,D=n.getTintAppendFloatAlpha,I=0;I0&&(q=q%R-R):q>R?q=R:q<0&&(q=R+q%R),null===F&&(F=new h(G+Math.cos(j)*H,V+Math.sin(j)*H,E),P.push(F),W+=.01);W<1+Z;)M=q*W+j,A=G+Math.cos(M)*H,_=V+Math.sin(M)*H,F.addPoint(A,_,E),W+=.01;M=q+j,A=G+Math.cos(M)*H,_=V+Math.sin(M)*H,F.addPoint(A,_,E);break;case r.FILL_RECT:T.multiply(w,d),(o.FillRect||g.FillRect).run(y,d,m,b[++I],b[++I],b[++I],b[++I],c.TL,c.TR,c.BL,c.BR,v);break;case r.FILL_TRIANGLE:T.multiply(w,d),(o.FillTri||g.FillTri).run(y,d,m,b[++I],b[++I],b[++I],b[++I],b[++I],b[++I],c.TL,c.TR,c.BL,v);break;case r.STROKE_TRIANGLE:T.multiply(w,d),p[0].x=b[++I],p[0].y=b[++I],p[0].width=E,p[1].x=b[++I],p[1].y=b[++I],p[1].width=E,p[2].x=b[++I],p[2].y=b[++I],p[2].width=E,p[3].x=p[0].x,p[3].y=p[0].y,p[3].width=E,(o.StrokePath||g.StrokePath).run(y,m,p,E,!1,d,f.TL,f.TR,f.BL,f.BR,v);break;case r.LINE_TO:G=b[++I],V=b[++I],null!==F?F.addPoint(G,V,E):(F=new h(G,V,E),P.push(F));break;case r.MOVE_TO:F=new h(b[++I],b[++I],E),P.push(F);break;case r.SAVE:l.push(w.copyToArray());break;case r.RESTORE:w.copyFromArray(l.pop());break;case r.TRANSLATE:G=b[++I],V=b[++I],w.translate(G,V);break;case r.SCALE:G=b[++I],V=b[++I],w.scale(G,V);break;case r.ROTATE:w.rotate(b[++I])}}}},26479(t,e,i){var r=i(61061),s=i(83419),n=i(51708),a=i(50792),o=i(46710),h=i(95540),l=i(35154),u=i(97022),d=i(41212),c=i(88492),f=i(68287),p=new s({Extends:a,initialize:function(t,e,i){a.call(this),i?e&&!Array.isArray(e)&&(e=[e]):Array.isArray(e)?d(e[0])&&(i=e,e=null):d(e)&&(i=e,e=null),this.scene=t,this.children=new Set,this.isParent=!0,this.type="Group",this.classType=h(i,"classType",f),this.name=h(i,"name",""),this.active=h(i,"active",!0),this.maxSize=h(i,"maxSize",-1),this.defaultKey=h(i,"defaultKey",null),this.defaultFrame=h(i,"defaultFrame",null),this.runChildUpdate=h(i,"runChildUpdate",!1),this.createCallback=h(i,"createCallback",null),this.removeCallback=h(i,"removeCallback",null),this.createMultipleCallback=h(i,"createMultipleCallback",null),this.internalCreateCallback=h(i,"internalCreateCallback",null),this.internalRemoveCallback=h(i,"internalRemoveCallback",null),e&&this.addMultiple(e),i&&this.createMultiple(i),this.on(n.ADDED_TO_SCENE,this.addedToScene,this),this.on(n.REMOVED_FROM_SCENE,this.removedFromScene,this)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},create:function(t,e,i,r,s,n){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.defaultKey),void 0===r&&(r=this.defaultFrame),void 0===s&&(s=!0),void 0===n&&(n=!0),this.isFull())return null;var a=new this.classType(this.scene,t,e,i,r);return a.addToDisplayList(this.scene.sys.displayList),a.addToUpdateList(),a.visible=s,a.setActive(n),this.add(a),a},createMultiple:function(t){if(this.isFull())return[];Array.isArray(t)||(t=[t]);var e=[];if(t[0].key)for(var i=0;i=0;u--)if((l=c[u]).active===i){if(++d===e)break}else l=null;return l?("number"==typeof s&&(l.x=s),"number"==typeof n&&(l.y=n),l):r?this.create(s,n,a,o,h):null},get:function(t,e,i,r,s){return this.getFirst(!1,!0,t,e,i,r,s)},getFirstAlive:function(t,e,i,r,s,n){return this.getFirst(!0,t,e,i,r,s,n)},getFirstDead:function(t,e,i,r,s,n){return this.getFirst(!1,t,e,i,r,s,n)},playAnimation:function(t,e){return r.PlayAnimation(Array.from(this.children),t,e),this},isFull:function(){return-1!==this.maxSize&&this.children.size>=this.maxSize},countActive:function(t){void 0===t&&(t=!0);var e=0;return this.children.forEach(function(i){i.active===t&&e++}),e},getTotalUsed:function(){return this.countActive()},getTotalFree:function(){var t=this.getTotalUsed();return(-1===this.maxSize?999999999999:this.maxSize)-t},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},propertyValueSet:function(t,e,i,s,n){return r.PropertyValueSet(Array.from(this.children),t,e,i,s,n),this},propertyValueInc:function(t,e,i,s,n){return r.PropertyValueInc(Array.from(this.children),t,e,i,s,n),this},setX:function(t,e){return r.SetX(Array.from(this.children),t,e),this},setY:function(t,e){return r.SetY(Array.from(this.children),t,e),this},setXY:function(t,e,i,s){return r.SetXY(Array.from(this.children),t,e,i,s),this},incX:function(t,e){return r.IncX(Array.from(this.children),t,e),this},incY:function(t,e){return r.IncY(Array.from(this.children),t,e),this},incXY:function(t,e,i,s){return r.IncXY(Array.from(this.children),t,e,i,s),this},shiftPosition:function(t,e,i){return r.ShiftPosition(Array.from(this.children),t,e,i),this},angle:function(t,e){return r.Angle(Array.from(this.children),t,e),this},rotate:function(t,e){return r.Rotate(Array.from(this.children),t,e),this},rotateAround:function(t,e){return r.RotateAround(Array.from(this.children),t,e),this},rotateAroundDistance:function(t,e,i){return r.RotateAroundDistance(Array.from(this.children),t,e,i),this},setAlpha:function(t,e){return r.SetAlpha(Array.from(this.children),t,e),this},setTint:function(t,e,i,s){return r.SetTint(Array.from(this.children),t,e,i,s),this},setOrigin:function(t,e,i,s){return r.SetOrigin(Array.from(this.children),t,e,i,s),this},scaleX:function(t,e){return r.ScaleX(Array.from(this.children),t,e),this},scaleY:function(t,e){return r.ScaleY(Array.from(this.children),t,e),this},scaleXY:function(t,e,i,s){return r.ScaleXY(Array.from(this.children),t,e,i,s),this},setDepth:function(t,e){return r.SetDepth(Array.from(this.children),t,e),this},setBlendMode:function(t){return r.SetBlendMode(Array.from(this.children),t),this},setHitArea:function(t,e){return r.SetHitArea(Array.from(this.children),t,e),this},shuffle:function(){return r.Shuffle(Array.from(this.children)),this},kill:function(t){this.children.has(t)&&t.setActive(!1)},killAndHide:function(t){this.children.has(t)&&(t.setActive(!1),t.setVisible(!1))},setVisible:function(t,e,i){return r.SetVisible(Array.from(this.children),t,e,i),this},toggleVisible:function(){return r.ToggleVisible(Array.from(this.children)),this},destroy:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1),this.scene&&!this.ignoreDestroy&&(this.emit(n.DESTROY,this),this.removeAllListeners(),this.scene.sys.updateList.remove(this),this.clear(e,t),this.scene=void 0,this.children=void 0)}});t.exports=p},94975(t,e,i){var r=i(44603),s=i(26479);r.register("group",function(t){return new s(this.scene,null,t)})},3385(t,e,i){var r=i(26479);i(39429).register("group",function(t,e){return this.updateList.add(new r(this.scene,t,e))})},88571(t,e,i){var r=i(40939),s=i(83419),n=i(31401),a=i(95643),o=i(59819),h=new s({Extends:a,Mixins:[n.Alpha,n.BlendMode,n.Depth,n.Flip,n.GetBounds,n.Lighting,n.Mask,n.Origin,n.RenderNodes,n.ScrollFactor,n.Size,n.TextureCrop,n.Tint,n.Transform,n.Visible,o],initialize:function(t,e,i,r,s){a.call(this,t,"Image"),this._crop=this.resetCropObject(),this.setTexture(r,s),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initRenderNodes(this._defaultRenderNodesMap)},_defaultRenderNodesMap:{get:function(){return r}}});t.exports=h},40652(t){t.exports=function(t,e,i,r){i.addToRenderList(e),t.batchSprite(e,e.frame,i,r)}},82459(t,e,i){var r=i(25305),s=i(44603),n=i(23568),a=i(88571);s.register("image",function(t,e){void 0===t&&(t={});var i=n(t,"key",null),s=n(t,"frame",null),o=new a(this.scene,0,0,i,s);return void 0!==e&&(t.add=e),r(this.scene,o,t),o})},2117(t,e,i){var r=i(88571);i(39429).register("image",function(t,e,i,s){return this.displayList.add(new r(this.scene,t,e,i,s))})},59819(t,e,i){var r=i(29747),s=r,n=r;s=i(99517),n=i(40652),t.exports={renderWebGL:s,renderCanvas:n}},99517(t){t.exports=function(t,e,i,r){i.camera.addToRenderList(e);var s=e.customRenderNodes,n=e.defaultRenderNodes;(s.Submitter||n.Submitter).run(i,e,r,0,s.Texturer||n.Texturer,s.Transformer||n.Transformer)}},77856(t,e,i){var r={Events:i(51708),DisplayList:i(8050),GameObjectCreator:i(44603),GameObjectFactory:i(39429),UpdateList:i(45027),Components:i(31401),GetCalcMatrix:i(91296),BuildGameObject:i(25305),BuildGameObjectAnimation:i(13059),GameObject:i(95643),BitmapText:i(22186),Blitter:i(6107),Bob:i(46590),Container:i(31559),DOMElement:i(3069),DynamicBitmapText:i(2638),Extern:i(42421),Graphics:i(43831),Group:i(26479),Image:i(88571),Layer:i(93595),Particles:i(18404),PathFollower:i(1159),RenderTexture:i(591),RetroFont:i(196),Rope:i(77757),Sprite:i(68287),Stamp:i(14727),Text:i(50171),GetTextSize:i(14220),MeasureText:i(79557),TextStyle:i(35762),TileSprite:i(20839),Zone:i(41481),Video:i(18471),Shape:i(17803),Arc:i(23629),Curve:i(89),Ellipse:i(19921),Grid:i(30479),IsoBox:i(61475),IsoTriangle:i(16933),Line:i(57847),Polygon:i(24949),Rectangle:i(74561),Star:i(55911),Triangle:i(36931),Factories:{Blitter:i(12709),Container:i(24961),DOMElement:i(2611),DynamicBitmapText:i(72566),Extern:i(56315),Graphics:i(1201),Group:i(3385),Image:i(2117),Layer:i(20005),Particles:i(676),PathFollower:i(90145),RenderTexture:i(60505),Rope:i(96819),Sprite:i(46409),Stamp:i(85326),StaticBitmapText:i(34914),Text:i(68005),TileSprite:i(91681),Zone:i(84175),Video:i(89025),Arc:i(42563),Curve:i(40511),Ellipse:i(1543),Grid:i(34137),IsoBox:i(3933),IsoTriangle:i(49803),Line:i(2481),Polygon:i(64827),Rectangle:i(87959),Star:i(93697),Triangle:i(45245)},Creators:{Blitter:i(9403),Container:i(77143),DynamicBitmapText:i(11164),Graphics:i(87079),Group:i(94975),Image:i(82459),Layer:i(25179),Particles:i(92730),RenderTexture:i(34495),Rope:i(26209),Sprite:i(15567),Stamp:i(31479),StaticBitmapText:i(57336),Text:i(71259),TileSprite:i(14167),Zone:i(95261),Video:i(11511)}};r.CaptureFrame=i(43451),r.Gradient=i(34637),r.Noise=i(35387),r.NoiseCell2D=i(51513),r.NoiseCell3D=i(15686),r.NoiseCell4D=i(41946),r.NoiseSimplex2D=i(1792),r.NoiseSimplex3D=i(51098),r.Shader=i(20071),r.NineSlice=i(28103),r.PointLight=i(80321),r.SpriteGPULayer=i(76573),r.Factories.CaptureFrame=i(20421),r.Factories.Gradient=i(69315),r.Factories.Noise=i(34757),r.Factories.NoiseCell2D=i(26590),r.Factories.NoiseCell3D=i(89918),r.Factories.NoiseCell4D=i(65874),r.Factories.NoiseSimplex2D=i(80308),r.Factories.NoiseSimplex3D=i(73810),r.Factories.Shader=i(74177),r.Factories.NineSlice=i(47521),r.Factories.PointLight=i(71255),r.Factories.SpriteGPULayer=i(96019),r.Creators.CaptureFrame=i(23675),r.Creators.Gradient=i(26353),r.Creators.Noise=i(39931),r.Creators.NoiseCell2D=i(98292),r.Creators.NoiseCell3D=i(97044),r.Creators.NoiseCell4D=i(20136),r.Creators.NoiseSimplex2D=i(51754),r.Creators.NoiseSimplex3D=i(71112),r.Creators.Shader=i(54935),r.Creators.NineSlice=i(28279),r.Creators.PointLight=i(39829),r.Creators.SpriteGPULayer=i(16193),r.Light=i(41432),r.LightsManager=i(61356),r.LightsPlugin=i(88992),t.exports=r},93595(t,e,i){var r=i(10312),s=i(83419),n=i(31401),a=i(50792),o=i(95643),h=i(51708),l=i(73162),u=i(33963),d=i(44594),c=i(19186),f=new s({Extends:l,Mixins:[a,o,n.AlphaSingle,n.BlendMode,n.Depth,n.Mask,n.Visible,u],initialize:function(t,e){l.call(this,t),a.call(this),o.call(this,t,"Layer"),this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.sortChildrenFlag=!1,this.addCallback=this.addChildCallback,this.removeCallback=this.removeChildCallback,this.clearAlpha(),this.setBlendMode(r.SKIP_CHECK),e&&this.add(e),this.addRenderStep&&this.addRenderStep(this.renderWebGL),t.sys.queueDepthSort()},setInteractive:function(){return this},disableInteractive:function(){return this},removeInteractive:function(){return this},willRender:function(t){return!(15!==this.renderFlags||0===this.list.length||0!==this.cameraFilter&&this.cameraFilter&t.id)},addChildCallback:function(t){var e=t.displayList;e&&e!==this&&t.removeFromDisplayList(),t.displayList||(this.queueDepthSort(),t.displayList=this,t.emit(h.ADDED_TO_SCENE,t,this.scene),this.events.emit(d.ADDED_TO_SCENE,t,this.scene))},removeChildCallback:function(t){this.queueDepthSort(),t.displayList=null,t.emit(h.REMOVED_FROM_SCENE,t,this.scene),this.events.emit(d.REMOVED_FROM_SCENE,t,this.scene)},queueDepthSort:function(){this.sortChildrenFlag=!0},depthSort:function(){this.sortChildrenFlag&&(c(this.list,this.sortByDepth),this.sortChildrenFlag=!1)},sortByDepth:function(t,e){return t._depth-e._depth},getChildren:function(){return this.list},destroy:function(t){if(this.scene&&!this.ignoreDestroy){o.prototype.destroy.call(this,t);for(var e=this.list;e.length;)e[0].destroy(t);this.list=void 0,this.systems=void 0,this.events=void 0}}});t.exports=f},2956(t){t.exports=function(t,e,i){var r=e.list;if(0!==r.length){e.depthSort();var s=-1!==e.blendMode;s||t.setBlendMode(0);var n=e._alpha;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var a=0;athis.maxLights&&(u(s,this.sortByDistance),s=s.slice(0,this.maxLights)),this.visibleLights=s.length,s},sortByDistance:function(t,e){return t.distance>=e.distance},setAmbientColor:function(t){var e=d.getFloatsFromUintRGB(t);return this.ambientColor.set(e[0],e[1],e[2]),this},getMaxVisibleLights:function(){return this.maxLights},getLightCount:function(){return this.lights.length},addLight:function(t,e,i,r,s,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=128),void 0===r&&(r=16777215),void 0===s&&(s=1),void 0===n&&(n=.1*i);var o=d.getFloatsFromUintRGB(r),h=new a(t,e,i,o[0],o[1],o[2],s,n);return this.lights.push(h),h},removeLight:function(t){var e=this.lights.indexOf(t);return e>=0&&l(this.lights,e),this},shutdown:function(){this.lights.length=0},destroy:function(){this.shutdown()}});t.exports=c},88992(t,e,i){var r=i(83419),s=i(61356),n=i(37277),a=i(44594),o=new r({Extends:s,initialize:function(t){this.scene=t,this.systems=t.sys,t.sys.settings.isBooted||t.sys.events.once(a.BOOT,this.boot,this),s.call(this)},boot:function(){var t=this.systems.events;t.on(a.SHUTDOWN,this.shutdown,this),t.on(a.DESTROY,this.destroy,this)},destroy:function(){this.shutdown(),this.scene=void 0,this.systems=void 0}});n.register("LightsPlugin",o,"lights"),t.exports=o},28103(t,e,i){var r=i(30529),s=i(83419),n=i(31401),a=i(95643),o=i(78023),h=i(84322),l=i(82513),u=new s({Extends:a,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.GetBounds,n.Mask,n.Origin,n.RenderNodes,n.ScrollFactor,n.Texture,n.Transform,n.Visible,o],initialize:function(t,e,i,r,s,n,o,u,d,c,f,p,g){a.call(this,t,"NineSlice"),this._width,this._height,this._originX=.5,this._originY=.5,this._sizeComponent=!0,this.vertices=[],this.leftWidth,this.rightWidth,this.topHeight,this.bottomHeight,this.tileX=p||!1,this.tileY=g||!1,this._repeatCountX=1,this._repeatCountY=1,this.tint=16777215,this.tintMode=h.MULTIPLY;var m=t.textures.getFrame(r,s);this.is3Slice=!c&&!f,m&&m.scale9&&(this.is3Slice=m.is3Slice);for(var v=this.is3Slice?18:54,y=0;y0?Math.max(1,Math.floor(t/e)):1},_rebuildVertexArray:function(t,e){if(t===this._repeatCountX&&e===this._repeatCountY)return!1;this._repeatCountX=t,this._repeatCountY=e;var i=(t+2)*(this.is3Slice?1:e+2)*6,r=this.vertices;if(r.length!==i){r.length=0;for(var s=0;s.5&&(this.vx-=i*(s-.5)),n<.5?this.vy+=r*(.5-n):n>.5&&(this.vy-=r*(n-.5)),this}});t.exports=n},52230(t,e,i){var r=i(91296),s=i(70554),n={multiTexturing:!0};t.exports=function(t,e,i,a){var o=e.vertices,h=o.length;if(0!==h){var l=i.camera;l.addToRenderList(e);for(var u,d,c,f=e.alpha,p=e.customRenderNodes.BatchHandler||e.defaultRenderNodes.BatchHandler,g=r(e,l,a,!i.useCanvas).calc,m=s.getTintAppendFloatAlpha(e.tint,f),v=e.frame.source.glTexture,y=e.tintMode,x=0;x=0&&(e=t);break;case 4:var i=(this.end-this.start)/this.steps;e=u(t,i),this.counter=e;break;case 5:case 6:case 7:e=s(t,this.start,this.end);break;case 9:e=this.start[0]}return this.current=e,this},getMethod:function(){var t=this.propertyValue;if(null===t)return 0;var e=typeof t;if("number"===e)return 1;if(Array.isArray(t))return 2;if("function"===e)return 3;if("object"===e){if(this.hasBoth(t,"start","end"))return this.has(t,"steps")?4:5;if(this.hasBoth(t,"min","max"))return 6;if(this.has(t,"random"))return 7;if(this.hasEither(t,"onEmit","onUpdate"))return 8;if(this.hasEither(t,"values","interpolation"))return 9}return 0},setMethods:function(){var t=this.propertyValue,e=t,i=this.defaultEmit,r=this.defaultUpdate;switch(this.method){case 1:i=this.staticValueEmit;break;case 2:i=this.randomStaticValueEmit,e=t[0];break;case 3:this._onEmit=t,i=this.proxyEmit,e=this.defaultValue;break;case 4:this.start=t.start,this.end=t.end,this.steps=t.steps,this.counter=this.start,this.yoyo=!!this.has(t,"yoyo")&&t.yoyo,this.direction=0,i=this.steppedEmit,e=this.start;break;case 5:this.start=t.start,this.end=t.end;var s=this.has(t,"ease")?t.ease:"Linear";this.ease=o(s,t.easeParams),i=this.has(t,"random")&&t.random?this.randomRangedValueEmit:this.easedValueEmit,r=this.easeValueUpdate,e=this.start;break;case 6:this.start=t.min,this.end=t.max,i=this.has(t,"int")&&t.int?this.randomRangedIntEmit:this.randomRangedValueEmit,e=this.start;break;case 7:var n=t.random;Array.isArray(n)&&(this.start=n[0],this.end=n[1]),i=this.randomRangedIntEmit,e=this.start;break;case 8:this._onEmit=this.has(t,"onEmit")?t.onEmit:this.defaultEmit,this._onUpdate=this.has(t,"onUpdate")?t.onUpdate:this.defaultUpdate,i=this.proxyEmit,r=this.proxyUpdate,e=this.defaultValue;break;case 9:this.start=t.values;var a=this.has(t,"ease")?t.ease:"Linear";this.ease=o(a,t.easeParams),this.interpolation=l(t.interpolation),i=this.easedValueEmit,r=this.easeValueUpdate,e=this.start[0]}return this.onEmit=i,this.onUpdate=r,this.current=e,this},has:function(t,e){return t.hasOwnProperty(e)},hasBoth:function(t,e,i){return t.hasOwnProperty(e)&&t.hasOwnProperty(i)},hasEither:function(t,e,i){return t.hasOwnProperty(e)||t.hasOwnProperty(i)},defaultEmit:function(){return this.defaultValue},defaultUpdate:function(t,e,i,r){return r},proxyEmit:function(t,e,i){var r=this._onEmit(t,e,i);return this.current=r,r},proxyUpdate:function(t,e,i,r){var s=this._onUpdate(t,e,i,r);return this.current=s,s},staticValueEmit:function(){return this.current},staticValueUpdate:function(){return this.current},randomStaticValueEmit:function(){var t=Math.floor(Math.random()*this.propertyValue.length);return this.current=this.propertyValue[t],this.current},randomRangedValueEmit:function(t,e){var i=a(this.start,this.end);return t&&t.data[e]&&(t.data[e].min=i,t.data[e].max=this.end),this.current=i,i},randomRangedIntEmit:function(t,e){var i=r(this.start,this.end);return t&&t.data[e]&&(t.data[e].min=i,t.data[e].max=this.end),this.current=i,i},steppedEmit:function(){var t,e=this.counter,i=e,r=(this.end-this.start)/this.steps;this.yoyo?(0===this.direction?(i+=r)>=this.end&&(t=i-this.end,i=this.end-t,this.direction=1):(i-=r)<=this.start&&(t=this.start-i,i=this.start+t,this.direction=0),this.counter=i):this.counter=d(i+r,this.start,this.end);return this.current=e,e},easedValueEmit:function(t,e){if(t&&t.data[e]){var i=t.data[e];i.min=this.start,i.max=this.end}return this.current=this.start,this.start},easeValueUpdate:function(t,e,i){var r,s=t.data[e],n=this.ease(i);return r=this.interpolation?this.interpolation(this.start,n):(s.max-s.min)*n+s.min,this.current=r,r},destroy:function(){this.propertyValue=null,this.defaultValue=null,this.ease=null,this.interpolation=null,this._onEmit=null,this._onUpdate=null}});t.exports=c},24502(t,e,i){var r=i(83419),s=i(95540),n=i(20286),a=new r({Extends:n,initialize:function(t,e,i,r,a){if("object"==typeof t){var o=t;t=s(o,"x",0),e=s(o,"y",0),i=s(o,"power",0),r=s(o,"epsilon",100),a=s(o,"gravity",50)}else void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=100),void 0===a&&(a=50);n.call(this,t,e,!0),this._gravity=a,this._power=i*a,this._epsilon=r*r},update:function(t,e){var i=this.x-t.x,r=this.y-t.y,s=i*i+r*r;if(0!==s){var n=Math.sqrt(s);s0&&(this.anims=new r(this)),this.bounds=new o},emit:function(t,e,i,r,s,n){return this.emitter.emit(t,e,i,r,s,n)},isAlive:function(){return this.lifeCurrent>0},kill:function(){this.lifeCurrent=0},setPosition:function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=t,this.y=e},fire:function(t,e){var i=this.emitter,r=i.ops,s=i.getAnim();if(s?this.anims.play(s):(this.frame=i.getFrame(),this.texture=this.frame.texture),!this.frame)throw new Error("Particle has no texture frame");if(i.getEmitZone(this),void 0===t?this.x+=r.x.onEmit(this,"x"):r.x.steps>0?this.x+=t+r.x.onEmit(this,"x"):this.x+=t,void 0===e?this.y+=r.y.onEmit(this,"y"):r.y.steps>0?this.y+=e+r.y.onEmit(this,"y"):this.y+=e,this.life=r.lifespan.onEmit(this,"lifespan"),this.lifeCurrent=this.life,this.lifeT=0,this.delayCurrent=r.delay.onEmit(this,"delay"),this.holdCurrent=r.hold.onEmit(this,"hold"),this.scaleX=r.scaleX.onEmit(this,"scaleX"),this.scaleY=r.scaleY.active?r.scaleY.onEmit(this,"scaleY"):this.scaleX,this.angle=r.rotate.onEmit(this,"rotate"),this.rotation=a(this.angle),i.worldMatrix.transformPoint(this.x,this.y,this.worldPosition),0===this.delayCurrent&&i.getDeathZone(this))return this.lifeCurrent=0,!1;var n=r.speedX.onEmit(this,"speedX"),o=r.speedY.active?r.speedY.onEmit(this,"speedY"):n;if(i.radial){var h=a(r.angle.onEmit(this,"angle"));this.velocityX=Math.cos(h)*Math.abs(n),this.velocityY=Math.sin(h)*Math.abs(o)}else if(i.moveTo){var l=r.moveToX.onEmit(this,"moveToX"),u=r.moveToY.onEmit(this,"moveToY"),d=this.life/1e3;this.velocityX=(l-this.x)/d,this.velocityY=(u-this.y)/d}else this.velocityX=n,this.velocityY=o;return i.acceleration&&(this.accelerationX=r.accelerationX.onEmit(this,"accelerationX"),this.accelerationY=r.accelerationY.onEmit(this,"accelerationY")),this.maxVelocityX=r.maxVelocityX.onEmit(this,"maxVelocityX"),this.maxVelocityY=r.maxVelocityY.onEmit(this,"maxVelocityY"),this.bounce=r.bounce.onEmit(this,"bounce"),this.alpha=r.alpha.onEmit(this,"alpha"),r.color.active?this.tint=r.color.onEmit(this,"tint"):this.tint=r.tint.onEmit(this,"tint"),!0},update:function(t,e,i){if(this.lifeCurrent<=0)return!(this.holdCurrent>0)||(this.holdCurrent-=t,this.holdCurrent<=0);if(this.delayCurrent>0)return this.delayCurrent-=t,!1;this.anims&&this.anims.update(0,t);var r=this.emitter,n=r.ops,o=1-this.lifeCurrent/this.life;if(this.lifeT=o,this.x=n.x.onUpdate(this,"x",o,this.x),this.y=n.y.onUpdate(this,"y",o,this.y),r.moveTo){var h=n.moveToX.onUpdate(this,"moveToX",o,r.moveToX),l=n.moveToY.onUpdate(this,"moveToY",o,r.moveToY),u=this.lifeCurrent/1e3;this.velocityX=(h-this.x)/u,this.velocityY=(l-this.y)/u}return this.computeVelocity(r,t,e,i,o),this.scaleX=n.scaleX.onUpdate(this,"scaleX",o,this.scaleX),n.scaleY.active?this.scaleY=n.scaleY.onUpdate(this,"scaleY",o,this.scaleY):this.scaleY=this.scaleX,this.angle=n.rotate.onUpdate(this,"rotate",o,this.angle),this.rotation=a(this.angle),r.getDeathZone(this)?(this.lifeCurrent=0,!0):(this.alpha=s(n.alpha.onUpdate(this,"alpha",o,this.alpha),0,1),n.color.active?this.tint=n.color.onUpdate(this,"color",o,this.tint):this.tint=n.tint.onUpdate(this,"tint",o,this.tint),this.lifeCurrent-=t,this.lifeCurrent<=0&&this.holdCurrent<=0)},computeVelocity:function(t,e,i,r,n){var a=t.ops,o=this.velocityX,h=this.velocityY,l=a.accelerationX.onUpdate(this,"accelerationX",n,this.accelerationX),u=a.accelerationY.onUpdate(this,"accelerationY",n,this.accelerationY),d=a.maxVelocityX.onUpdate(this,"maxVelocityX",n,this.maxVelocityX),c=a.maxVelocityY.onUpdate(this,"maxVelocityY",n,this.maxVelocityY);this.bounce=a.bounce.onUpdate(this,"bounce",n,this.bounce),o+=t.gravityX*i+l*i,h+=t.gravityY*i+u*i,o=s(o,-d,d),h=s(h,-c,c),this.velocityX=o,this.velocityY=h,this.x+=o*i,this.y+=h*i,t.worldMatrix.transformPoint(this.x,this.y,this.worldPosition);for(var f=0;fe.right&&this.collideRight&&(t.x-=r.x-e.right,t.velocityX*=i),r.ye.bottom&&this.collideBottom&&(t.y-=r.y-e.bottom,t.velocityY*=i)}});t.exports=a},31600(t,e,i){var r=i(68668),s=i(83419),n=i(31401),a=i(53774),o=i(43459),h=i(26388),l=i(19909),u=i(76472),d=i(44777),c=i(20696),f=i(95643),p=i(95540),g=i(26546),m=i(24502),v=i(69036),y=i(1985),x=i(97022),T=i(86091),w=i(73162),b=i(20074),S=i(269),C=i(56480),E=i(69601),A=i(68875),_=i(87841),M=i(59996),R=i(72905),P=i(90668),O=i(19186),L=i(84322),F=i(61340),D=i(26099),I=i(15994),N=["active","advance","blendMode","colorEase","deathCallback","deathCallbackScope","duration","emitCallback","emitCallbackScope","follow","frequency","gravityX","gravityY","maxAliveParticles","maxParticles","name","emitting","particleBringToTop","particleClass","radial","sortCallback","sortOrderAsc","sortProperty","stopAfter","tintMode","timeScale","trackVisible","visible"],B=["accelerationX","accelerationY","alpha","angle","bounce","color","delay","hold","lifespan","maxVelocityX","maxVelocityY","moveToX","moveToY","quantity","rotate","scaleX","scaleY","speedX","speedY","tint","x","y"],k=new s({Extends:f,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.Lighting,n.Mask,n.RenderNodes,n.ScrollFactor,n.Texture,n.Transform,n.Visible,P],initialize:function(t,e,i,r,s){f.call(this,t,"ParticleEmitter"),this.particleClass=C,this.config=null,this.ops={accelerationX:new d("accelerationX",0),accelerationY:new d("accelerationY",0),alpha:new d("alpha",1),angle:new d("angle",{min:0,max:360},!0),bounce:new d("bounce",0),color:new u("color"),delay:new d("delay",0,!0),hold:new d("hold",0,!0),lifespan:new d("lifespan",1e3,!0),maxVelocityX:new d("maxVelocityX",1e4),maxVelocityY:new d("maxVelocityY",1e4),moveToX:new d("moveToX",0),moveToY:new d("moveToY",0),quantity:new d("quantity",1,!0),rotate:new d("rotate",0),scaleX:new d("scaleX",1),scaleY:new d("scaleY",1),speedX:new d("speedX",0,!0),speedY:new d("speedY",0,!0),tint:new d("tint",16777215),x:new d("x",0),y:new d("y",0)},this.radial=!0,this.gravityX=0,this.gravityY=0,this.acceleration=!1,this.moveTo=!1,this.emitCallback=null,this.emitCallbackScope=null,this.deathCallback=null,this.deathCallbackScope=null,this.maxParticles=0,this.maxAliveParticles=0,this.stopAfter=0,this.duration=0,this.frequency=0,this.emitting=!0,this.particleBringToTop=!0,this.timeScale=1,this.emitZones=[],this.deathZones=[],this.viewBounds=null,this.follow=null,this.followOffset=new D,this.trackVisible=!1,this.frames=[],this.randomFrame=!0,this.frameQuantity=1,this.anims=[],this.randomAnim=!0,this.animQuantity=1,this.dead=[],this.alive=[],this.counters=new Float32Array(10),this.skipping=!1,this.worldMatrix=new F,this.sortProperty="",this.sortOrderAsc=!0,this.sortCallback=this.depthSortCallback,this.processors=new w(this),this.tintMode=L.MULTIPLY,this.initRenderNodes(this._defaultRenderNodesMap),this.setPosition(e,i),this.setTexture(r),s&&this.setConfig(s)},_defaultRenderNodesMap:{get:function(){return r}},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},setConfig:function(t){if(!t)return this;this.config=t;var e=0,i="",r=this.ops;for(e=0;e=this.animQuantity&&(this.animCounter=0,this.currentAnim=I(this.currentAnim+1,0,e)),i},setAnim:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=1),this.randomAnim=e,this.animQuantity=i,this.currentAnim=0;var r=typeof t;if(this.anims.length=0,Array.isArray(t))this.anims=this.anims.concat(t);else if("string"===r)this.anims.push(t);else if("object"===r){var s=t;(t=p(s,"anims",null))&&(this.anims=this.anims.concat(t));var n=p(s,"cycle",!1);this.randomAnim=!n,this.animQuantity=p(s,"quantity",i)}return 1===this.anims.length&&(this.animQuantity=1,this.randomAnim=!1),this},setRadial:function(t){return void 0===t&&(t=!0),this.radial=t,this},addParticleBounds:function(t,e,i,r,s,n,a,o){if("object"==typeof t){var h=t;t=h.x,e=h.y,i=x(h,"w")?h.w:h.width,r=x(h,"h")?h.h:h.height}return this.addParticleProcessor(new E(t,e,i,r,s,n,a,o))},setParticleSpeed:function(t,e){return void 0===e&&(e=t),this.ops.speedX.onChange(t),t===e?this.ops.speedY.active=!1:this.ops.speedY.onChange(e),this.radial=!0,this},setParticleScale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.ops.scaleX.onChange(t),this.ops.scaleY.onChange(e),this},setParticleGravity:function(t,e){return this.gravityX=t,this.gravityY=e,this},setParticleAlpha:function(t){return this.ops.alpha.onChange(t),this},setParticleTint:function(t){return this.ops.tint.onChange(t),this},setEmitterAngle:function(t){return this.ops.angle.onChange(t),this},setParticleLifespan:function(t){return this.ops.lifespan.onChange(t),this},setQuantity:function(t){return this.quantity=t,this},setFrequency:function(t,e){return this.frequency=t,this.flowCounter=t>0?t:0,e&&(this.quantity=e),this},addDeathZone:function(t){var e;Array.isArray(t)||(t=[t]);for(var i=[],r=0;r-1&&(this.zoneTotal++,this.zoneTotal===r.total&&(this.zoneTotal=0,this.zoneIndex++,this.zoneIndex===i&&(this.zoneIndex=0)))}},getDeathZone:function(t){for(var e=this.deathZones,i=0;i=0&&(this.zoneIndex=e),this},addParticleProcessor:function(t){return this.processors.exists(t)||(t.emitter&&t.emitter.removeParticleProcessor(t),this.processors.add(t),t.emitter=this),t},removeParticleProcessor:function(t){return this.processors.exists(t)&&(this.processors.remove(t,!0),t.emitter=null),t},getProcessors:function(){return this.processors.getAll("active",!0)},createGravityWell:function(t){return this.addParticleProcessor(new m(t))},reserve:function(t){var e=this.dead;if(this.maxParticles>0){var i=this.getParticleCount();i+t>this.maxParticles&&(t=this.maxParticles-(i+t))}for(var r=0;r0&&this.getParticleCount()>=this.maxParticles||this.maxAliveParticles>0&&this.getAliveParticleCount()>=this.maxAliveParticles},onParticleEmit:function(t,e){return void 0===t?(this.emitCallback=null,this.emitCallbackScope=null):"function"==typeof t&&(this.emitCallback=t,e&&(this.emitCallbackScope=e)),this},onParticleDeath:function(t,e){return void 0===t?(this.deathCallback=null,this.deathCallbackScope=null):"function"==typeof t&&(this.deathCallback=t,e&&(this.deathCallbackScope=e)),this},killAll:function(){for(var t=this.dead,e=this.alive;e.length>0;)t.push(e.pop());return this},forEachAlive:function(t,e){for(var i=this.alive,r=i.length,s=0;s0&&this.fastForward(t),this.emitting=!0,this.resetCounters(this.frequency,!0),void 0!==e&&(this.duration=Math.abs(e)),this.emit(c.START,this)),this},stop:function(t){return void 0===t&&(t=!1),this.emitting&&(this.emitting=!1,t&&this.killAll(),this.emit(c.STOP,this)),this},pause:function(){return this.active=!1,this},resume:function(){return this.active=!0,this},setSortProperty:function(t,e){return void 0===t&&(t=""),void 0===e&&(e=this.true),this.sortProperty=t,this.sortOrderAsc=e,this.sortCallback=this.depthSortCallback,this},setSortCallback:function(t){return t=""!==this.sortProperty?this.depthSortCallback:null,this.sortCallback=t,this},depthSort:function(){return O(this.alive,this.sortCallback.bind(this)),this},depthSortCallback:function(t,e){var i=this.sortProperty;return this.sortOrderAsc?t[i]-e[i]:e[i]-t[i]},flow:function(t,e,i){return void 0===e&&(e=1),this.emitting=!1,this.frequency=t,this.quantity=e,void 0!==i&&(this.stopAfter=i),this.start()},explode:function(t,e,i){this.frequency=-1,this.resetCounters(-1,!0);var r=this.emitParticle(t,e,i);return this.emit(c.EXPLODE,this,r),r},emitParticleAt:function(t,e,i){return this.emitParticle(i,t,e)},emitParticle:function(t,e,i){if(!this.atLimit()){void 0===t&&(t=this.ops.quantity.onEmit());for(var r=this.dead,s=this.stopAfter,n=this.follow?this.follow.x+this.followOffset.x:e,a=this.follow?this.follow.y+this.followOffset.y:i,o=0;o0&&(this.stopCounter++,this.stopCounter>=s))break;if(this.atLimit())break}return h}},fastForward:function(t,e){void 0===e&&(e=1e3/60);var i=0;for(this.skipping=!0;i0){var u=this.deathCallback,d=this.deathCallbackScope;for(a=h-1;a>=0;a--){var f=o[a];s.splice(f.index,1),n.push(f.particle),u&&u.call(d,f.particle),f.particle.setPosition()}}if(this.emitting||this.skipping){if(0===this.frequency)this.emitParticle();else if(this.frequency>0)for(this.flowCounter-=e;this.flowCounter<=0;)this.emitParticle(),this.flowCounter+=this.frequency;this.skipping||(this.duration>0&&(this.elapsed+=e,this.elapsed>=this.duration&&this.stop()),this.stopAfter>0&&this.stopCounter>=this.stopAfter&&this.stop())}else 1===this.completeFlag&&0===s.length&&(this.completeFlag=0,this.emit(c.COMPLETE,this))},overlap:function(t){for(var e=this.getWorldTransformMatrix(),i=this.alive,r=i.length,s=[],n=0;n0){var u=0;for(this.skipping=!0;u0&&T(r,t,t),r},createEmitter:function(){throw new Error("createEmitter removed. See ParticleEmitter docs for info")},particleX:{get:function(){return this.ops.x.current},set:function(t){this.ops.x.onChange(t)}},particleY:{get:function(){return this.ops.y.current},set:function(t){this.ops.y.onChange(t)}},accelerationX:{get:function(){return this.ops.accelerationX.current},set:function(t){this.ops.accelerationX.onChange(t)}},accelerationY:{get:function(){return this.ops.accelerationY.current},set:function(t){this.ops.accelerationY.onChange(t)}},maxVelocityX:{get:function(){return this.ops.maxVelocityX.current},set:function(t){this.ops.maxVelocityX.onChange(t)}},maxVelocityY:{get:function(){return this.ops.maxVelocityY.current},set:function(t){this.ops.maxVelocityY.onChange(t)}},speed:{get:function(){return this.ops.speedX.current},set:function(t){this.ops.speedX.onChange(t),this.ops.speedY.onChange(t)}},speedX:{get:function(){return this.ops.speedX.current},set:function(t){this.ops.speedX.onChange(t)}},speedY:{get:function(){return this.ops.speedY.current},set:function(t){this.ops.speedY.onChange(t)}},moveToX:{get:function(){return this.ops.moveToX.current},set:function(t){this.ops.moveToX.onChange(t)}},moveToY:{get:function(){return this.ops.moveToY.current},set:function(t){this.ops.moveToY.onChange(t)}},bounce:{get:function(){return this.ops.bounce.current},set:function(t){this.ops.bounce.onChange(t)}},particleScaleX:{get:function(){return this.ops.scaleX.current},set:function(t){this.ops.scaleX.onChange(t)}},particleScaleY:{get:function(){return this.ops.scaleY.current},set:function(t){this.ops.scaleY.onChange(t)}},particleColor:{get:function(){return this.ops.color.current},set:function(t){this.ops.color.onChange(t)}},colorEase:{get:function(){return this.ops.color.easeName},set:function(t){this.ops.color.setEase(t)}},particleTint:{get:function(){return this.ops.tint.current},set:function(t){this.ops.tint.onChange(t)}},particleAlpha:{get:function(){return this.ops.alpha.current},set:function(t){this.ops.alpha.onChange(t)}},lifespan:{get:function(){return this.ops.lifespan.current},set:function(t){this.ops.lifespan.onChange(t)}},particleAngle:{get:function(){return this.ops.angle.current},set:function(t){this.ops.angle.onChange(t)}},particleRotate:{get:function(){return this.ops.rotate.current},set:function(t){this.ops.rotate.onChange(t)}},quantity:{get:function(){return this.ops.quantity.current},set:function(t){this.ops.quantity.onChange(t)}},delay:{get:function(){return this.ops.delay.current},set:function(t){this.ops.delay.onChange(t)}},hold:{get:function(){return this.ops.hold.current},set:function(t){this.ops.hold.onChange(t)}},flowCounter:{get:function(){return this.counters[0]},set:function(t){this.counters[0]=t}},frameCounter:{get:function(){return this.counters[1]},set:function(t){this.counters[1]=t}},animCounter:{get:function(){return this.counters[2]},set:function(t){this.counters[2]=t}},elapsed:{get:function(){return this.counters[3]},set:function(t){this.counters[3]=t}},stopCounter:{get:function(){return this.counters[4]},set:function(t){this.counters[4]=t}},completeFlag:{get:function(){return this.counters[5]},set:function(t){this.counters[5]=t}},zoneIndex:{get:function(){return this.counters[6]},set:function(t){this.counters[6]=t}},zoneTotal:{get:function(){return this.counters[7]},set:function(t){this.counters[7]=t}},currentFrame:{get:function(){return this.counters[8]},set:function(t){this.counters[8]=t}},currentAnim:{get:function(){return this.counters[9]},set:function(t){this.counters[9]=t}},preDestroy:function(){var t;this.texture=null,this.frames=null,this.anims=null,this.emitCallback=null,this.emitCallbackScope=null,this.deathCallback=null,this.deathCallbackScope=null,this.emitZones=null,this.deathZones=null,this.bounds=null,this.follow=null,this.counters=null;var e=this.ops;for(t=0;t0&&T.height>0){var w=-x.halfWidth,b=-x.halfHeight;l.globalAlpha=y,l.save(),a.setToContext(l),u&&(w=Math.round(w),b=Math.round(b)),l.imageSmoothingEnabled=!x.source.scaleMode,l.drawImage(x.source.image,T.x,T.y,T.width,T.height,w,b,T.width,T.height),l.restore()}}}l.restore()}}},92730(t,e,i){var r=i(25305),s=i(44603),n=i(23568),a=i(95540),o=i(31600);s.register("particles",function(t,e){void 0===t&&(t={});var i=n(t,"key",null),s=a(t,"config",null),h=new o(this.scene,0,0,i);return void 0!==e&&(t.add=e),r(this.scene,h,t),s&&h.setConfig(s),h})},676(t,e,i){var r=i(39429),s=i(31600);r.register("particles",function(t,e,i,r){return void 0!==t&&"string"==typeof t&&console.warn("ParticleEmitterManager was removed in Phaser 3.60. See documentation for details"),this.displayList.add(new s(this.scene,t,e,i,r))})},90668(t,e,i){var r=i(29747),s=r,n=r;s=i(21188),n=i(9871),t.exports={renderWebGL:s,renderCanvas:n}},21188(t,e,i){var r=i(59996),s=i(61340),n=i(70554),a=new s,o=new s,h=new s,l=new s,u={},d={},c={quad:new Float32Array(8)};t.exports=function(t,e,i,s){var f=i.camera;f.addToRenderList(e),a.copyWithScrollFactorFrom(f.getViewMatrix(!i.useCanvas),f.scrollX,f.scrollY,e.scrollFactorX,e.scrollFactorY),s&&a.multiply(s),l.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),a.multiply(l);var p=n.getTintAppendFloatAlpha,g=e.alpha,m=e.alive,v=m.length,y=e.viewBounds;if(0!==v&&(!y||r(y,f.worldView))){e.sortCallback&&e.depthSort();for(var x=e.tintMode,T=0;Tthis._length&&(this.counter=this._length-1),this},changeSource:function(t){return this.source=t,this.updateSource()},getPoint:function(t){0===this._direction?(this.counter++,this.counter>=this._length&&(this.yoyo?(this._direction=1,this.counter=this._length-1):this.counter=0)):(this.counter--,-1===this.counter&&(this.yoyo?(this._direction=0,this.counter=0):this.counter=this._length-1));var e=this.points[this.counter];e&&(t.x=e.x,t.y=e.y)}});t.exports=r},68875(t,e,i){var r=i(83419),s=i(26099),n=new r({initialize:function(t){this.source=t,this._tempVec=new s,this.total=-1},getPoint:function(t){var e=this._tempVec;this.source.getRandomPoint(e),t.x=e.x,t.y=e.y}});t.exports=n},21024(t,e,i){t.exports={DeathZone:i(26388),EdgeZone:i(19909),RandomZone:i(68875)}},1159(t,e,i){var r=i(83419),s=i(31401),n=i(68287),a=new r({Extends:n,Mixins:[s.PathFollower],initialize:function(t,e,i,r,s,a){n.call(this,t,i,r,s,a),this.path=e},preUpdate:function(t,e){this.anims.update(t,e),this.pathUpdate(t)}});t.exports=a},90145(t,e,i){var r=i(39429),s=i(1159);r.register("follower",function(t,e,i,r,n){var a=new s(this.scene,t,e,i,r,n);return this.displayList.add(a),this.updateList.add(a),a})},80321(t,e,i){var r=i(43246),s=i(83419),n=i(31401),a=i(95643),o=i(30100),h=i(67277),l=new s({Extends:a,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.Mask,n.RenderNodes,n.ScrollFactor,n.Transform,n.Visible,h],initialize:function(t,e,i,r,s,n,h){void 0===r&&(r=16777215),void 0===s&&(s=128),void 0===n&&(n=1),void 0===h&&(h=.1),a.call(this,t,"PointLight"),this.initRenderNodes(this._defaultRenderNodesMap),this.setPosition(e,i),this.color=o(r),this.intensity=n,this.attenuation=h,this.width=2*s,this.height=2*s,this._radius=s},_defaultRenderNodesMap:{get:function(){return r}},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this.width=2*t,this.height=2*t}},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return this._radius}},displayOriginY:{get:function(){return this._radius}}});t.exports=l},39829(t,e,i){var r=i(25305),s=i(44603),n=i(23568),a=i(80321);s.register("pointlight",function(t,e){void 0===t&&(t={});var i=n(t,"color",16777215),s=n(t,"radius",128),o=n(t,"intensity",1),h=n(t,"attenuation",.1),l=new a(this.scene,0,0,i,s,o,h);return void 0!==e&&(t.add=e),r(this.scene,l,t),l})},71255(t,e,i){var r=i(39429),s=i(80321);r.register("pointlight",function(t,e,i,r,n,a){return this.displayList.add(new s(this.scene,t,e,i,r,n,a))})},67277(t,e,i){var r=i(29747),s=r,n=r;s=i(57787),t.exports={renderWebGL:s,renderCanvas:n}},57787(t,e,i){var r=i(91296);t.exports=function(t,e,i,s){var n=i.camera;n.addToRenderList(e);var a=r(e,n,s,!i.useCanvas).calc,o=e.width,h=e.height,l=-e._radius,u=-e._radius,d=l+o,c=u+h,f=a.getX(0,0),p=a.getY(0,0),g=a.getX(l,u),m=a.getY(l,u),v=a.getX(l,c),y=a.getY(l,c),x=a.getX(d,c),T=a.getY(d,c),w=a.getX(d,u),b=a.getY(d,u);(e.customRenderNodes.BatchHandler||e.defaultRenderNodes.BatchHandler).batch(i,e,g,m,v,y,w,b,x,T,f,p)}},591(t,e,i){var r=i(83419),s=i(45650),n=i(88571),a=i(83999),o=i(58855),h=new r({Extends:n,Mixins:[a],initialize:function(t,e,i,r,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=32),void 0===a&&(a=32),void 0===h&&(h=!0);var l=t.sys.textures.addDynamicTexture(s(),r,a,h);n.call(this,t,e,i,l),this.type="RenderTexture",this.camera=this.texture.camera,this._saved=!1,this.renderMode=o.RENDER,this.isCurrentlyRendering=!1},setSize:function(t,e){this.width=t,this.height=e,this.updateDisplayOrigin();var i=this.input;return i&&!i.customHitArea&&(i.hitArea.width=t,i.hitArea.height=e),this},resize:function(t,e,i){return this.texture.setSize(t,e,i),this.setSize(this.texture.width,this.texture.height),this},saveTexture:function(t){var e=this.texture,i=e.key,r=e.manager;return r.exists(i)&&r.get(i)===e?(r.renameTexture(i,t),this._saved=!0):(e.key=t,e.manager.addDynamicTexture(e)&&(this._saved=!0)),e},setRenderMode:function(t,e){return this.renderMode=t,e&&this.texture.preserve(!0),this},render:function(){return this.texture.render(),this},fill:function(t,e,i,r,s,n){return this.texture.fill(t,e,i,r,s,n),this},clear:function(t,e,i,r){return this.texture.clear(t,e,i,r),this},stamp:function(t,e,i,r,s){return this.texture.stamp(t,e,i,r,s),this},erase:function(t,e,i){return this.texture.erase(t,e,i),this},draw:function(t,e,i,r,s){return this.texture.draw(t,e,i,r,s),this},capture:function(t,e){return this.texture.capture(t,e),this},repeat:function(t,e,i,r,s,n,a){return this.texture.repeat(t,e,i,r,s,n,a),this},preserve:function(t){return this.texture.preserve(t),this},callback:function(t){return this.texture.callback(t),this},snapshotArea:function(t,e,i,r,s,n,a){return this.texture.snapshotArea(t,e,i,r,s,n,a),this},snapshot:function(t,e,i){return this.texture.snapshot(t,e,i)},snapshotPixel:function(t,e,i){return this.texture.snapshotPixel(t,e,i)},preDestroy:function(){this.camera=null,this._saved||this.texture.destroy()}});t.exports=h},97272(t,e,i){var r=i(40652),s=i(58855);t.exports=function(t,e,i,n){var a=!0,o=!0;e.renderMode===s.REDRAW?o=!1:e.renderMode===s.RENDER&&(a=!1),a&&e.render(),o&&r(t,e,i,n)}},34495(t,e,i){var r=i(25305),s=i(44603),n=i(23568),a=i(591);s.register("renderTexture",function(t,e){void 0===t&&(t={});var i=n(t,"x",0),s=n(t,"y",0),o=n(t,"width",32),h=n(t,"height",32),l=new a(this.scene,i,s,o,h);return void 0!==e&&(t.add=e),r(this.scene,l,t),l})},60505(t,e,i){var r=i(39429),s=i(591);r.register("renderTexture",function(t,e,i,r){return this.displayList.add(new s(this.scene,t,e,i,r))})},83999(t,e,i){var r=i(29747),s=r,n=r;s=i(53937),n=i(97272),t.exports={renderWebGL:s,renderCanvas:n}},58855(t){t.exports={RENDER:"render",REDRAW:"redraw",ALL:"all"}},53937(t,e,i){var r=i(99517),s=i(58855);t.exports=function(t,e,i,n){if(!e.isCurrentlyRendering){e.isCurrentlyRendering=!0;var a=!0,o=!0;e.renderMode===s.REDRAW?o=!1:e.renderMode===s.RENDER&&(a=!1),a&&e.render(),o&&r(t,e,i,n),e.isCurrentlyRendering=!1}}},77757(t,e,i){var r=i(9674),s=i(85760),n=i(83419),a=i(31401),o=i(95643),h=i(38745),l=i(84322),u=i(26099),d=new n({Extends:o,Mixins:[a.AlphaSingle,a.BlendMode,a.Depth,a.Flip,a.Mask,a.RenderNodes,a.Size,a.Texture,a.Transform,a.Visible,a.ScrollFactor,h],initialize:function(t,e,i,s,n,a,h,d,c){void 0===s&&(s="__DEFAULT"),void 0===a&&(a=2),void 0===h&&(h=!0),o.call(this,t,"Rope"),this.anims=new r(this),this.points=a,this.vertices,this.uv,this.colors,this.alphas,this.tintMode="__DEFAULT"===s?l.FILL:l.MULTIPLY,this.dirty=!1,this.horizontal=h,this._flipX=!1,this._flipY=!1,this._perp=new u,this.debugCallback=null,this.debugGraphic=null,this.setTexture(s,n),this.setPosition(e,i),this.setSizeToFrame(),this.initRenderNodes(this._defaultRenderNodesMap),Array.isArray(a)&&this.resizeArrays(a.length),this.setPoints(a,d,c),this.updateVertices()},_defaultRenderNodesMap:{get:function(){return s}},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(t,e){var i=this.anims.currentFrame;this.anims.update(t,e),this.anims.currentFrame!==i&&(this.updateUVs(),this.updateVertices())},play:function(t,e,i){return this.anims.play(t,e,i),this},setDirty:function(){return this.dirty=!0,this},setHorizontal:function(t,e,i){return void 0===t&&(t=this.points.length),this.horizontal?this:(this.horizontal=!0,this.setPoints(t,e,i))},setVertical:function(t,e,i){return void 0===t&&(t=this.points.length),this.horizontal?(this.horizontal=!1,this.setPoints(t,e,i)):this},setTintMode:function(t){return void 0===t&&(t=l.MULTIPLY),this.tintMode=t,this},setAlphas:function(t,e){var i=this.points.length;if(i<1)return this;var r,s=this.alphas;void 0===t?t=[1]:Array.isArray(t)||void 0!==e||(t=[t]);var n=0;if(void 0!==e)for(r=0;rn&&(a=t[n]),s[n]=a,t.length>n+1&&(a=t[n+1]),s[n+1]=a}return this},setColors:function(t){var e=this.points.length;if(e<1)return this;var i,r=this.colors;void 0===t?t=[16777215]:Array.isArray(t)||(t=[t]);var s=0;if(t.length===e)for(i=0;is&&(n=t[s]),r[s]=n,t.length>s+1&&(n=t[s+1]),r[s+1]=n}return this},setPoints:function(t,e,i){if(void 0===t&&(t=2),"number"==typeof t){var r,s,n,a=t;if(a<2&&(a=2),t=[],this.horizontal)for(n=-this.frame.halfWidth,s=this.frame.width/(a-1),r=0;r>>16,o=(65280&s)>>>8,h=255&s;t.fillStyle="rgba("+a+","+o+","+h+","+n+")"}},75177(t){t.exports=function(t,e,i,r){var s=i||e.strokeColor,n=r||e.strokeAlpha,a=(16711680&s)>>>16,o=(65280&s)>>>8,h=255&s;t.strokeStyle="rgba("+a+","+o+","+h+","+n+")",t.lineWidth=e.lineWidth}},17803(t,e,i){var r=i(87891),s=i(83419),n=i(31401),a=i(95643),o=i(23031),h=new s({Extends:a,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.GetBounds,n.Lighting,n.Mask,n.Origin,n.RenderNodes,n.ScrollFactor,n.Transform,n.Visible],initialize:function(t,e,i){void 0===e&&(e="Shape"),a.call(this,t,e),this.geom=i,this.pathData=[],this.pathIndexes=[],this.fillColor=16777215,this.fillAlpha=1,this.strokeColor=16777215,this.strokeAlpha=1,this.lineWidth=1,this.isFilled=!1,this.isStroked=!1,this.closePath=!0,this._tempLine=new o,this.width=0,this.height=0,this.enableFilters&&(this.filtersFocusContext=!0),this.initRenderNodes(this._defaultRenderNodesMap)},_defaultRenderNodesMap:{get:function(){return r}},setFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.isFilled=!1:(this.fillColor=t,this.fillAlpha=e,this.isFilled=!0),this},setStrokeStyle:function(t,e,i){return void 0===i&&(i=1),void 0===t?this.isStroked=!1:(this.lineWidth=t,this.strokeColor=e,this.strokeAlpha=i,this.isStroked=!0),this},setClosePath:function(t){return this.closePath=t,this},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this},preDestroy:function(){this.geom=null,this._tempLine=null,this.pathData=[],this.pathIndexes=[]},displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}}});t.exports=h},34682(t,e,i){var r=i(70554);t.exports=function(t,e,i,s,n,a,o){var h=r.getTintAppendFloatAlpha(s.strokeColor,s.strokeAlpha*n),l=s.pathData,u=l.length-1,d=s.lineWidth,c=!s.closePath,f=s.customRenderNodes.StrokePath||s.defaultRenderNodes.StrokePath,p=[];c&&(u-=2);for(var g=0;g0&&m===l[g-2]&&v===l[g-1]||p.push({x:m,y:v,width:d})}f.run(t,e,p,d,c,i,h,h,h,h,void 0,s.lighting)}},23629(t,e,i){var r=i(13609),s=i(83419),n=i(39506),a=i(94811),o=i(96503),h=i(36383),l=i(17803),u=new s({Extends:l,Mixins:[r],initialize:function(t,e,i,r,s,n,a,h,u){void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=128),void 0===s&&(s=0),void 0===n&&(n=360),void 0===a&&(a=!1),l.call(this,t,"Arc",new o(0,0,r)),this._startAngle=s,this._endAngle=n,this._anticlockwise=a,this._iterations=.01,this.setPosition(e,i);var d=2*this.geom.radius;this.setSize(d,d),void 0!==h&&this.setFillStyle(h,u),this.updateDisplayOrigin(),this.updateData()},iterations:{get:function(){return this._iterations},set:function(t){this._iterations=t,this.updateData()}},radius:{get:function(){return this.geom.radius},set:function(t){this.geom.radius=t;var e=2*t;this.setSize(e,e),this.updateDisplayOrigin(),this.updateData()}},startAngle:{get:function(){return this._startAngle},set:function(t){this._startAngle=t,this.updateData()}},endAngle:{get:function(){return this._endAngle},set:function(t){this._endAngle=t,this.updateData()}},anticlockwise:{get:function(){return this._anticlockwise},set:function(t){this._anticlockwise=t,this.updateData()}},setRadius:function(t){return this.radius=t,this},setIterations:function(t){return void 0===t&&(t=.01),this.iterations=t,this},setStartAngle:function(t,e){return this._startAngle=t,void 0!==e&&(this._anticlockwise=e),this.updateData()},setEndAngle:function(t,e){return this._endAngle=t,void 0!==e&&(this._anticlockwise=e),this.updateData()},updateData:function(){var t=this._iterations,e=t,i=this.geom.radius,r=n(this._startAngle),s=n(this._endAngle),o=i,l=i;s-=r,this._anticlockwise?s<-h.TAU?s=-h.TAU:s>0&&(s=-h.TAU+s%h.TAU):s>h.TAU?s=h.TAU:s<0&&(s=h.TAU+s%h.TAU);for(var u,d=[o+Math.cos(r)*i,l+Math.sin(r)*i];e<1;)u=s*e+r,d.push(o+Math.cos(u)*i,l+Math.sin(u)*i),e+=t;return u=s+r,d.push(o+Math.cos(u)*i,l+Math.sin(u)*i),d.push(o+Math.cos(r)*i,l+Math.sin(r)*i),this.pathIndexes=a(d),this.pathData=d,this}});t.exports=u},42542(t,e,i){var r=i(39506),s=i(65960),n=i(75177),a=i(20926);t.exports=function(t,e,i,o){i.addToRenderList(e);var h=t.currentContext;if(a(t,h,e,i,o)){var l=e.radius;h.beginPath(),h.arc(l-e.originX*(2*l),l-e.originY*(2*l),l,r(e._startAngle),r(e._endAngle),e.anticlockwise),e.closePath&&h.closePath(),e.isFilled&&(s(h,e),h.fill()),e.isStroked&&(n(h,e),h.stroke()),h.restore()}}},42563(t,e,i){var r=i(23629),s=i(39429);s.register("arc",function(t,e,i,s,n,a,o,h){return this.displayList.add(new r(this.scene,t,e,i,s,n,a,o,h))}),s.register("circle",function(t,e,i,s,n){return this.displayList.add(new r(this.scene,t,e,i,0,360,!1,s,n))})},13609(t,e,i){var r=i(29747),s=r,n=r;s=i(41447),n=i(42542),t.exports={renderWebGL:s,renderCanvas:n}},41447(t,e,i){var r=i(91296),s=i(10441),n=i(34682);t.exports=function(t,e,i,a){var o=i.camera;o.addToRenderList(e);var h=r(e,o,a,!i.useCanvas).calc,l=e._displayOriginX,u=e._displayOriginY,d=e.alpha,c=e.customRenderNodes.Submitter||e.defaultRenderNodes.Submitter;e.isFilled&&s(i,c,h,e,d,l,u),e.isStroked&&n(i,c,h,e,d,l,u)}},89(t,e,i){var r=i(83419),s=i(33141),n=i(94811),a=i(87841),o=i(17803),h=new r({Extends:o,Mixins:[s],initialize:function(t,e,i,r,s,n){void 0===e&&(e=0),void 0===i&&(i=0),o.call(this,t,"Curve",r),this._smoothness=32,this._curveBounds=new a,this.closePath=!1,this.setPosition(e,i),void 0!==s&&this.setFillStyle(s,n),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(t){this._smoothness=t,this.updateData()}},setSmoothness:function(t){return this._smoothness=t,this.updateData()},updateData:function(){var t=this._curveBounds,e=this._smoothness;this.geom.getBounds(t,e),this.setSize(t.width,t.height),this.updateDisplayOrigin();for(var i=[],r=this.geom.getPoints(e),s=0;s0)for(r(o,e),_=0;_0&&P>0&&o.fillRect(h+A*f+C,l+_*p+C,R,P));if(b&&e.altFillAlpha>0)for(r(o,e,e.altFillColor,e.altFillAlpha*u),_=0;_0&&P>0&&o.fillRect(h+A*f+C,l+_*p+C,R,P)):M=1;if(S&&e.strokeAlpha>0){s(o,e,e.strokeColor,e.strokeAlpha*u);var O=e.strokeOutside?0:1;for(A=O;AE&&(o.beginPath(),o.moveTo(d+h,l),o.lineTo(d+h,c+l),o.stroke()),c>E&&(o.beginPath(),o.moveTo(h,c+l),o.lineTo(d+h,c+l),o.stroke()))}o.restore()}}},34137(t,e,i){var r=i(39429),s=i(30479);r.register("grid",function(t,e,i,r,n,a,o,h,l,u){return this.displayList.add(new s(this.scene,t,e,i,r,n,a,o,h,l,u))})},26015(t,e,i){var r=i(29747),s=r,n=r;s=i(46161),n=i(49912),t.exports={renderWebGL:s,renderCanvas:n}},46161(t,e,i){var r=i(91296),s=i(70554);t.exports=function(t,e,i,n){var a=i.camera;a.addToRenderList(e);var o=e.customRenderNodes.FillRect||e.defaultRenderNodes.FillRect,h=e.customRenderNodes.Submitter||e.defaultRenderNodes.Submitter,l=r(e,a,n,!i.useCanvas).calc;l.translate(-e._displayOriginX,-e._displayOriginY);var u,d=e.alpha,c=e.width,f=e.height,p=e.cellWidth,g=e.cellHeight,m=Math.ceil(c/p),v=Math.ceil(f/g),y=p,x=g,T=p-(m*p-c),w=g-(v*g-f),b=e.isFilled,S=e.showAltCells,C=e.isStroked,E=e.cellPadding,A=e.lineWidth,_=A/2,M=0,R=0,P=0,O=0,L=0;if(E&&(y-=2*E,x-=2*E,T-=2*E,w-=2*E),b&&e.fillAlpha>0)for(u=s.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*d),R=0;R0&&L>0&&o.run(i,l,h,M*p+E,R*g+E,O,L,u,u,u,u,e.lighting));if(S&&e.altFillAlpha>0)for(u=s.getTintAppendFloatAlpha(e.altFillColor,e.altFillAlpha*d),R=0;R0&&L>0&&o.run(i,l,h,M*p+E,R*g+E,O,L,u,u,u,u)):P=1;if(C&&e.strokeAlpha>0){var F=s.getTintAppendFloatAlpha(e.strokeColor,e.strokeAlpha*d),D=e.strokeOutside?0:1;for(M=D;M_&&o.run(i,l,h,c-_,0,A,f,F,F,F,F),f>_&&o.run(i,l,h,0,f-_,c,A,F,F,F,F))}}},61475(t,e,i){var r=i(99651),s=i(83419),n=i(17803),a=new s({Extends:n,Mixins:[r],initialize:function(t,e,i,r,s,a,o,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=48),void 0===s&&(s=32),void 0===a&&(a=15658734),void 0===o&&(o=10066329),void 0===h&&(h=13421772),n.call(this,t,"IsoBox",null),this.projection=4,this.fillTop=a,this.fillLeft=o,this.fillRight=h,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isFilled=!0,this.setPosition(e,i),this.setSize(r,s),this.updateDisplayOrigin()},setProjection:function(t){return this.projection=t,this},setFaces:function(t,e,i){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),this.showTop=t,this.showLeft=e,this.showRight=i,this},setFillStyle:function(t,e,i){return this.fillTop=t,this.fillLeft=e,this.fillRight=i,this.isFilled=!0,this}});t.exports=a},11508(t,e,i){var r=i(65960),s=i(20926);t.exports=function(t,e,i,n){i.addToRenderList(e);var a=t.currentContext;if(s(t,a,e,i,n)&&e.isFilled){var o=e.width,h=e.height,l=o/2,u=o/e.projection;e.showTop&&(r(a,e,e.fillTop),a.beginPath(),a.moveTo(-l,-h),a.lineTo(0,-u-h),a.lineTo(l,-h),a.lineTo(l,-1),a.lineTo(0,u-1),a.lineTo(-l,-1),a.lineTo(-l,-h),a.fill()),e.showLeft&&(r(a,e,e.fillLeft),a.beginPath(),a.moveTo(-l,0),a.lineTo(0,u),a.lineTo(0,u-h),a.lineTo(-l,-h),a.lineTo(-l,0),a.fill()),e.showRight&&(r(a,e,e.fillRight),a.beginPath(),a.moveTo(l,0),a.lineTo(0,u),a.lineTo(0,u-h),a.lineTo(l,-h),a.lineTo(l,0),a.fill()),a.restore()}}},3933(t,e,i){var r=i(39429),s=i(61475);r.register("isobox",function(t,e,i,r,n,a,o){return this.displayList.add(new s(this.scene,t,e,i,r,n,a,o))})},99651(t,e,i){var r=i(29747),s=r,n=r;s=i(68149),n=i(11508),t.exports={renderWebGL:s,renderCanvas:n}},68149(t,e,i){var r=i(91296),s=i(70554);t.exports=function(t,e,i,n){if(e.isFilled){var a=i.camera;a.addToRenderList(e);var o,h,l,u,d,c,f,p,g,m=e.customRenderNodes.FillTri||e.defaultRenderNodes.FillTri,v=e.customRenderNodes.Submitter||e.defaultRenderNodes.Submitter,y=r(e,a,n,!i.useCanvas).calc,x=e.width,T=e.height,w=x/2,b=x/e.projection,S=e.alpha,C=e.lighting;e.showTop&&(o=s.getTintAppendFloatAlpha(e.fillTop,S),h=-w,l=-T,u=0,d=-b-T,c=w,f=-T,p=0,g=b-T,m.run(i,y,v,h,l,u,d,c,f,o,o,o,C),m.run(i,y,v,c,f,p,g,h,l,o,o,o,C)),e.showLeft&&(o=s.getTintAppendFloatAlpha(e.fillLeft,S),h=-w,l=0,u=0,d=b,c=0,f=b-T,p=-w,g=-T,m.run(i,y,v,h,l,u,d,c,f,o,o,o,C),m.run(i,y,v,c,f,p,g,h,l,o,o,o,C)),e.showRight&&(o=s.getTintAppendFloatAlpha(e.fillRight,S),h=w,l=0,u=0,d=b,c=0,f=b-T,p=w,g=-T,m.run(i,y,v,h,l,u,d,c,f,o,o,o,C),m.run(i,y,v,c,f,p,g,h,l,o,o,o,C))}}},16933(t,e,i){var r=i(83419),s=i(60561),n=i(17803),a=new r({Extends:n,Mixins:[s],initialize:function(t,e,i,r,s,a,o,h,l){void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=48),void 0===s&&(s=32),void 0===a&&(a=!1),void 0===o&&(o=15658734),void 0===h&&(h=10066329),void 0===l&&(l=13421772),n.call(this,t,"IsoTriangle",null),this.projection=4,this.fillTop=o,this.fillLeft=h,this.fillRight=l,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isReversed=a,this.isFilled=!0,this.setPosition(e,i),this.setSize(r,s),this.updateDisplayOrigin()},setProjection:function(t){return this.projection=t,this},setReversed:function(t){return this.isReversed=t,this},setFaces:function(t,e,i){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),this.showTop=t,this.showLeft=e,this.showRight=i,this},setFillStyle:function(t,e,i){return this.fillTop=t,this.fillLeft=e,this.fillRight=i,this.isFilled=!0,this}});t.exports=a},79590(t,e,i){var r=i(65960),s=i(20926);t.exports=function(t,e,i,n){i.addToRenderList(e);var a=t.currentContext;if(s(t,a,e,i,n)&&e.isFilled){var o=e.width,h=e.height,l=o/2,u=o/e.projection,d=e.isReversed;e.showTop&&d&&(r(a,e,e.fillTop),a.beginPath(),a.moveTo(-l,-h),a.lineTo(0,-u-h),a.lineTo(l,-h),a.lineTo(0,u-h),a.fill()),e.showLeft&&(r(a,e,e.fillLeft),a.beginPath(),d?(a.moveTo(-l,-h),a.lineTo(0,u),a.lineTo(0,u-h)):(a.moveTo(-l,0),a.lineTo(0,u),a.lineTo(0,u-h)),a.fill()),e.showRight&&(r(a,e,e.fillRight),a.beginPath(),d?(a.moveTo(l,-h),a.lineTo(0,u),a.lineTo(0,u-h)):(a.moveTo(l,0),a.lineTo(0,u),a.lineTo(0,u-h)),a.fill()),a.restore()}}},49803(t,e,i){var r=i(39429),s=i(16933);r.register("isotriangle",function(t,e,i,r,n,a,o,h){return this.displayList.add(new s(this.scene,t,e,i,r,n,a,o,h))})},60561(t,e,i){var r=i(29747),s=r,n=r;s=i(51503),n=i(79590),t.exports={renderWebGL:s,renderCanvas:n}},51503(t,e,i){var r=i(91296),s=i(70554);t.exports=function(t,e,i,n){if(e.isFilled){var a=i.camera;a.addToRenderList(e);var o,h,l,u,d,c,f,p=e.customRenderNodes.FillTri||e.defaultRenderNodes.FillTri,g=e.customRenderNodes.Submitter||e.defaultRenderNodes.Submitter,m=r(e,a,n,!i.useCanvas).calc,v=e.width,y=e.height,x=v/2,T=v/e.projection,w=e.isReversed,b=e.alpha,S=e.lighting;if(e.showTop&&w){o=s.getTintAppendFloatAlpha(e.fillTop,b),h=-x,l=-y,u=0,d=-T-y,c=x,f=-y;var C=T-y;p.run(i,m,g,h,l,u,d,c,f,o,o,o,S),p.run(i,m,g,c,f,0,C,h,l,o,o,o,S)}e.showLeft&&(o=s.getTintAppendFloatAlpha(e.fillLeft,b),w?(h=-x,l=-y,u=0,d=T,c=0,f=T-y):(h=-x,l=0,u=0,d=T,c=0,f=T-y),p.run(i,m,g,h,l,u,d,c,f,o,o,o,S)),e.showRight&&(o=s.getTintAppendFloatAlpha(e.fillRight,b),w?(h=x,l=-y,u=0,d=T,c=0,f=T-y):(h=x,l=0,u=0,d=T,c=0,f=T-y),p.run(i,m,g,h,l,u,d,c,f,o,o,o,S))}}},57847(t,e,i){var r=i(83419),s=i(17803),n=i(23031),a=i(36823),o=new r({Extends:s,Mixins:[a],initialize:function(t,e,i,r,a,o,h,l,u){void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===a&&(a=0),void 0===o&&(o=128),void 0===h&&(h=0),s.call(this,t,"Line",new n(r,a,o,h));var d=Math.max(1,this.geom.right-this.geom.left),c=Math.max(1,this.geom.bottom-this.geom.top);this.lineWidth=1,this._startWidth=1,this._endWidth=1,this.setPosition(e,i),this.setSize(d,c),void 0!==l&&this.setStrokeStyle(1,l,u),this.updateDisplayOrigin()},setLineWidth:function(t,e){return void 0===e&&(e=t),this._startWidth=t,this._endWidth=e,this.lineWidth=t,this},setTo:function(t,e,i,r){return this.geom.setTo(t,e,i,r),this}});t.exports=o},17440(t,e,i){var r=i(75177),s=i(20926);t.exports=function(t,e,i,n){i.addToRenderList(e);var a=t.currentContext;if(s(t,a,e,i,n)){var o=e._displayOriginX,h=e._displayOriginY;e.isStroked&&(r(a,e),a.beginPath(),a.moveTo(e.geom.x1-o,e.geom.y1-h),a.lineTo(e.geom.x2-o,e.geom.y2-h),a.stroke()),a.restore()}}},2481(t,e,i){var r=i(39429),s=i(57847);r.register("line",function(t,e,i,r,n,a,o,h){return this.displayList.add(new s(this.scene,t,e,i,r,n,a,o,h))})},36823(t,e,i){var r=i(29747),s=r,n=r;s=i(77385),n=i(17440),t.exports={renderWebGL:s,renderCanvas:n}},77385(t,e,i){var r=i(91296),s=i(70554),n=[{x:0,y:0,width:0},{x:0,y:0,width:0}];t.exports=function(t,e,i,a){var o=i.camera;o.addToRenderList(e);var h=r(e,o,a,!i.useCanvas).calc,l=e._displayOriginX,u=e._displayOriginY,d=e.alpha;if(e.isStroked){var c=s.getTintAppendFloatAlpha(e.strokeColor,e.strokeAlpha*d);n[0].x=e.geom.x1-l,n[0].y=e.geom.y1-u,n[0].width=e._startWidth,n[1].x=e.geom.x2-l,n[1].y=e.geom.y2-u,n[1].width=e._endWidth,(e.customRenderNodes.StrokePath||e.defaultRenderNodes.StrokePath).run(i,e.customRenderNodes.Submitter||e.defaultRenderNodes.Submitter,n,1,!0,h,c,c,c,c,void 0,e.lighting)}}},24949(t,e,i){var r=i(90273),s=i(83419),n=i(94811),a=i(13829),o=i(25717),h=i(17803),l=i(5469),u=new s({Extends:h,Mixins:[r],initialize:function(t,e,i,r,s,n){void 0===e&&(e=0),void 0===i&&(i=0),h.call(this,t,"Polygon",new o(r));var l=a(this.geom);this.setPosition(e,i),this.setSize(l.width,l.height),void 0!==s&&this.setFillStyle(s,n),this.updateDisplayOrigin(),this.updateData()},smooth:function(t){void 0===t&&(t=1);for(var e=0;e0,this.updateRoundedData()},setSize:function(t,e){this.width=t,this.height=e,this.geom.setSize(t,e),this.updateData(),this.updateDisplayOrigin();var i=this.input;return i&&!i.customHitArea&&(i.hitArea.width=t,i.hitArea.height=e),this},updateData:function(){if(this.isRounded)return this.updateRoundedData();var t=[],e=this.geom,i=this._tempLine;return e.getLineA(i),t.push(i.x1,i.y1,i.x2,i.y2),e.getLineB(i),t.push(i.x2,i.y2),e.getLineC(i),t.push(i.x2,i.y2),e.getLineD(i),t.push(i.x2,i.y2),this.pathData=t,this},updateRoundedData:function(){var t=[],e=this.width/2,i=this.height/2,r=Math.min(e,i),n=Math.min(this.radius,r),a=e,o=i,h=Math.max(4,Math.min(16,Math.ceil(n/2)));return this.arcTo(t,a-e+n,o-i+n,n,Math.PI,1.5*Math.PI,h),t.push(a+e-n,o-i),this.arcTo(t,a+e-n,o-i+n,n,1.5*Math.PI,2*Math.PI,h),t.push(a+e,o+i-n),this.arcTo(t,a+e-n,o+i-n,n,0,.5*Math.PI,h),t.push(a-e+n,o+i),this.arcTo(t,a-e+n,o+i-n,n,.5*Math.PI,Math.PI,h),t.push(a-e,o-i+n),this.pathIndexes=s(t),this.pathData=t,this},arcTo:function(t,e,i,r,s,n,a){for(var o=(n-s)/a,h=0;h<=a;h++){var l=s+o*h;t.push(e+Math.cos(l)*r,i+Math.sin(l)*r)}}});t.exports=h},48682(t,e,i){var r=i(65960),s=i(75177),n=i(20926),a=function(t,e,i,r,s,n){var a=Math.min(r/2,s/2),o=Math.min(n,a);0!==o?(t.moveTo(e+o,i),t.lineTo(e+r-o,i),t.arcTo(e+r,i,e+r,i+o,o),t.lineTo(e+r,i+s-o),t.arcTo(e+r,i+s,e+r-o,i+s,o),t.lineTo(e+o,i+s),t.arcTo(e,i+s,e,i+s-o,o),t.lineTo(e,i+o),t.arcTo(e,i,e+o,i,o),t.closePath()):t.rect(e,i,r,s)};t.exports=function(t,e,i,o){i.addToRenderList(e);var h=t.currentContext;if(n(t,h,e,i,o)){var l=e._displayOriginX,u=e._displayOriginY;e.isFilled&&(r(h,e),e.isRounded?(h.beginPath(),a(h,-l,-u,e.width,e.height,e.radius),h.fill()):h.fillRect(-l,-u,e.width,e.height)),e.isStroked&&(s(h,e),h.beginPath(),e.isRounded?a(h,-l,-u,e.width,e.height,e.radius):h.rect(-l,-u,e.width,e.height),h.stroke()),h.restore()}}},87959(t,e,i){var r=i(39429),s=i(74561);r.register("rectangle",function(t,e,i,r,n,a){return this.displayList.add(new s(this.scene,t,e,i,r,n,a))})},95597(t,e,i){var r=i(29747),s=r,n=r;s=i(52059),n=i(48682),t.exports={renderWebGL:s,renderCanvas:n}},52059(t,e,i){var r=i(10441),s=i(91296),n=i(34682),a=i(70554);t.exports=function(t,e,i,o){var h=i.camera;h.addToRenderList(e);var l=s(e,h,o,!i.useCanvas).calc,u=e._displayOriginX,d=e._displayOriginY,c=e.alpha,f=e.customRenderNodes,p=e.defaultRenderNodes,g=f.Submitter||p.Submitter;if(e.isFilled)if(e.isRounded)r(i,g,l,e,c,u,d);else{var m=a.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*c);(f.FillRect||p.FillRect).run(i,l,g,-u,-d,e.width,e.height,m,m,m,m,e.lighting)}e.isStroked&&n(i,g,l,e,c,u,d)}},55911(t,e,i){var r=i(81991),s=i(83419),n=i(94811),a=i(17803),o=new s({Extends:a,Mixins:[r],initialize:function(t,e,i,r,s,n,o,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=5),void 0===s&&(s=32),void 0===n&&(n=64),a.call(this,t,"Star",null),this._points=r,this._innerRadius=s,this._outerRadius=n,this.setPosition(e,i),this.setSize(2*n,2*n),void 0!==o&&this.setFillStyle(o,h),this.updateDisplayOrigin(),this.updateData()},setPoints:function(t){return this._points=t,this.updateData()},setInnerRadius:function(t){return this._innerRadius=t,this.updateData()},setOuterRadius:function(t){return this._outerRadius=t,this.updateData()},points:{get:function(){return this._points},set:function(t){this._points=t,this.updateData()}},innerRadius:{get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this.updateData()}},outerRadius:{get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this.updateData()}},updateData:function(){var t=[],e=this._points,i=this._innerRadius,r=this._outerRadius,s=Math.PI/2*3,a=Math.PI/e,o=r,h=r;t.push(o,h+-r);for(var l=0;l=this.size||this.bufferUpdateSegments===this.MAX_BUFFER_UPDATE_SEGMENTS_FULL)){var e=Math.floor(t/this.bufferUpdateSegmentSize);this.bufferUpdateSegments|=1<=this.size)return this;var e=this.submitterNode.instanceBufferLayout,i=e.buffer.viewF32,r=this.memberCount*e.layout.stride;return i.set(t,r/i.BYTES_PER_ELEMENT),this.setSegmentNeedsUpdate(this.memberCount),this.memberCount++,this},addMember:function(t){if(this.memberCount>=this.size)return this;var e=this.nextMemberF32,i=this.nextMemberU32;t||(t={});var r=this.frame;if(void 0!==t.frame&&(r=t.frame.base?t.frame.base:t.frame),"string"==typeof r&&!(r=this.texture.get(r)))return this;var s=0;this._setAnimatedValue(t.x,s),s+=4,this._setAnimatedValue(t.y,s),s+=4,this._setAnimatedValue(t.rotation,s),s+=4,this._setAnimatedValue(t.scaleX,s,1),s+=4,this._setAnimatedValue(t.scaleY,s,1),s+=4,this._setAnimatedValue(t.alpha,s,1),s+=4;var n=t.animation;if(n){var a;if("string"==typeof n||"number"==typeof n)a="string"==typeof n?this.animationDataNames[n]:this.animationDataIndices[n],this._setAnimatedValue({base:a.index,amplitude:a.frameCount,duration:a.duration,ease:h.Linear,yoyo:!1},s);else{var o=n.base;a="string"==typeof o?this.animationDataNames[o]:"number"==typeof o?this.animationDataIndices[o]:this.animationData[0],this._setAnimatedValue({base:a.index,amplitude:"number"==typeof n.amplitude?n.amplitude:a.frameCount,duration:n.duration||a.duration,delay:n.delay||0,ease:n.ease||h.Linear,yoyo:!!n.yoyo},s)}}else{var l=this.frameDataIndices[r.name],u=t.frame;u&&void 0!==u.base?this._setAnimatedValue({base:l,amplitude:u.amplitude,duration:u.duration,delay:u.delay,ease:u.ease,yoyo:u.yoyo},s):this._setAnimatedValue(l,s)}s+=4,this._setAnimatedValue(t.tintBlend,s,1),s+=4;var c=void 0===t.tintBottomLeft?16777215:t.tintBottomLeft,f=void 0===t.tintTopLeft?16777215:t.tintTopLeft,p=void 0===t.tintBottomRight?16777215:t.tintBottomRight,g=void 0===t.tintTopRight?16777215:t.tintTopRight,m=void 0===t.alphaBottomLeft?1:t.alphaBottomLeft,v=void 0===t.alphaTopLeft?1:t.alphaTopLeft,y=void 0===t.alphaBottomRight?1:t.alphaBottomRight,x=void 0===t.alphaTopRight?1:t.alphaTopRight;return i[s++]=d(c,m),i[s++]=d(f,v),i[s++]=d(p,y),i[s++]=d(g,x),e[s++]=void 0===t.originX?.5:t.originX,e[s++]=void 0===t.originY?.5:t.originY,e[s++]=t.tintMode||0,e[s++]=void 0===t.creationTime?this.timeElapsed:t.creationTime,e[s++]=void 0===t.scrollFactorX?1:t.scrollFactorX,e[s++]=void 0===t.scrollFactorY?1:t.scrollFactorY,this.addData(this.nextMemberF32),this},editMember:function(t,e){if(t<0||t>=this.memberCount)return this;var i=this.memberCount;return this.memberCount=t,this.addMember(e),this.memberCount=i,this},patchMember:function(t,e,i){if(!(t<0||t>=this.memberCount)){var r=this.submitterNode.instanceBufferLayout,s=r.buffer,n=t*r.layout.stride,a=s.viewU32,o=n/4;if(i)for(var h=0;h=this.memberCount)return null;var e=this.submitterNode.instanceBufferLayout,i=e.buffer,r=t*e.layout.stride,s=i.viewF32,n=i.viewU32,a={},o=r/s.BYTES_PER_ELEMENT;a.x=this._getAnimatedValue(o),o+=4,a.y=this._getAnimatedValue(o),o+=4,a.rotation=this._getAnimatedValue(o),o+=4,a.scaleX=this._getAnimatedValue(o),o+=4,a.scaleY=this._getAnimatedValue(o),o+=4,a.alpha=this._getAnimatedValue(o),o+=4;var h=this._getAnimatedValue(o);o+=4,"number"!=typeof h&&(h=h.base);var l=this.frameDataIndicesInv[h];if(void 0===l){var u=this.animationDataIndices[h];u&&(a.animation=u.name)}else a.frame=l;return a.tintBlend=this._getAnimatedValue(o),o+=4,a.tintBottomLeft=n[o++],a.tintTopLeft=n[o++],a.tintBottomRight=n[o++],a.tintTopRight=n[o++],a.alphaBottomLeft=(a.tintBottomLeft>>>24)/255,a.alphaTopLeft=(a.tintTopLeft>>>24)/255,a.alphaBottomRight=(a.tintBottomRight>>>24)/255,a.alphaTopRight=(a.tintTopRight>>>24)/255,a.tintBottomLeft&=16777215,a.tintTopLeft&=16777215,a.tintBottomRight&=16777215,a.tintTopRight&=16777215,a.originX=s[o++],a.originY=s[o++],a.tintMode=s[o++],a.creationTime=s[o++],a.scrollFactorX=s[o++],a.scrollFactorY=s[o++],a},getMemberData:function(t,e){if(t<0||t>=this.memberCount)return null;var i=this.submitterNode.instanceBufferLayout,r=i.buffer,s=i.layout.stride,n=t*s;e||(e=this.nextMemberU32);var a=r.viewU32,o=a.BYTES_PER_ELEMENT;return e.set(a.subarray(n/o,n/o+s/o)),e},removeMembers:function(t,e){if(t<0||t>=this.memberCount)return this;void 0===e&&(e=1),e=Math.min(e,this.memberCount-t);var i=this.submitterNode.instanceBufferLayout,r=i.layout.stride,s=t*r,n=e*r,a=i.buffer.viewU8;a.set(a.subarray(s+n),s);for(var o=t;othis.memberCount)return this;Array.isArray(e)||(e=[e]);var i=this.memberCount,r=this.submitterNode.instanceBufferLayout,s=r.layout.stride,n=t*s,a=e.length*s;r.buffer.viewU8.copyWithin(n+a,n,i*s),this.memberCount=t;for(var o=0;othis.memberCount)return this;var i=e.length*e.BYTES_PER_ELEMENT,r=this.submitterNode.instanceBufferLayout,s=r.layout.stride,n=t*s;r.buffer.viewU8.copyWithin(n+i,n,this.memberCount*s),r.buffer.viewU32.set(e,n/e.BYTES_PER_ELEMENT),this.memberCount=Math.min(this.size,this.memberCount+i/s);for(var a=t;a=1?p=0:p<-1&&(p=-.999),p=(p+1)/2,a=Math.floor(f)+p}(l=o>0?l/o%2:0)<0&&(l+=2),l/=2,l+=n,u&&(o=-o),d||(l=-l),r[e++]=s,r[e++]=a,r[e++]=o,r[e]=l}},_getAnimatedValue:function(t){var e=this.submitterNode.instanceBufferLayout.buffer.viewF32,i=e[t++],r=e[t++],s=e[t++],n=e[t];if(0===r||0===s||0===o)return i;n>0||(n=-n);var a=s<0;a&&(s=-s);var o=Math.floor(n);if(n=(n-=o)*s*2%s,o===h.Gravity){var l=Math.floor(r),u=2*(r-l)-1;return 0===u&&(u=1),{base:i,ease:o,duration:s,delay:n,yoyo:a,velocity:l,gravityFactor:u}}return{base:i,ease:o,amplitude:r,duration:s,delay:n,yoyo:a}},setAnimationEnabled:function(t,e){return this._animationsEnabled[t]=!!e,this},preDestroy:function(){this.frameDataTexture.destroy()}});t.exports=c},16193(t,e,i){var r=i(10312),s=i(44603),n=i(23568),a=i(76573);s.register("spriteGPULayer",function(t,e){void 0===t&&(t={});var i=n(t,"key",null),s=n(t,"size",1),o=new a(this.scene,i,s);return void 0!==e&&(t.add=e),o.alpha=n(t,"alpha",1),o.blendMode=n(t,"blendMode",r.NORMAL),o.visible=n(t,"visible",!0),e&&this.scene.sys.displayList.add(o),o})},96019(t,e,i){var r=i(76573);i(39429).register("spriteGPULayer",function(t,e){return this.displayList.add(new r(this.scene,t,e))})},71238(t,e,i){var r=i(29747),s=i(97591),n=r;t.exports={renderWebGL:s,renderCanvas:n}},97591(t){t.exports=function(t,e,i,r){i.camera.addToRenderList(e);var s=e.customRenderNodes,n=e.defaultRenderNodes;(s.Submitter||n.Submitter).run(i)}},14727(t,e,i){var r=i(78705),s=i(83419),n=i(88571),a=i(74759),o=new s({Extends:n,Mixins:[a],initialize:function(t,e,i,r,s){n.call(this,t,e,i,r,s),this.type="Stamp"},_defaultRenderNodesMap:{get:function(){return r}}});t.exports=o},656(t,e,i){var r=new(i(61340));t.exports=function(t,e,i){i.addToRenderList(e),r.copyFrom(i.matrix),i.matrix.loadIdentity();var s=i.scrollX,n=i.scrollY;i.scrollX=0,i.scrollY=0,t.batchSprite(e,e.frame,i),i.scrollX=s,i.scrollY=n,i.matrix.copyFrom(r)}},31479(t,e,i){var r=i(25305),s=i(44603),n=i(23568),a=i(14727);s.register("stamp",function(t,e){void 0===t&&(t={});var i=n(t,"key",null),s=n(t,"frame",null),o=new a(this.scene,0,0,i,s);return void 0!==e&&(t.add=e),r(this.scene,o,t),o})},85326(t,e,i){var r=i(14727);i(39429).register("stamp",function(t,e,i,s){return this.displayList.add(new r(this.scene,t,e,i,s))})},74759(t,e,i){var r=i(29747);r=i(656),t.exports={renderCanvas:r}},14220(t){t.exports=function(t,e,i){var r=t.canvas,s=t.context,n=t.style,a=[],o=0,h=i.length;n.maxLines>0&&n.maxLines1&&(d+=l*(c.length-1))}n.wordWrap&&(d-=s.measureText(" ").width),a[u]=Math.ceil(d),o=Math.max(o,a[u])}var p=e.fontSize+n.strokeThickness,g=p*h,m=t.lineSpacing;return h>1&&(g+=m*(h-1)),{width:o,height:g,lines:h,lineWidths:a,lineSpacing:m,lineHeight:p}}},79557(t,e,i){var r=i(27919);t.exports=function(t){var e=r.create(this),i=e.getContext("2d",{willReadFrequently:!0});t.syncFont(e,i);var s=i.measureText(t.testString);if("actualBoundingBoxAscent"in s){var n=s.actualBoundingBoxAscent,a=s.actualBoundingBoxDescent;return r.remove(e),{ascent:n,descent:a,fontSize:n+a}}var o=Math.ceil(s.width*t.baselineX),h=o,l=2*h;h=h*t.baselineY|0,e.width=o,e.height=l,i.fillStyle="#f00",i.fillRect(0,0,o,l),i.font=t._font,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(t.testString,0,h);var u={ascent:0,descent:0,fontSize:0},d=i.getImageData(0,0,o,l);if(!d)return u.ascent=h,u.descent=h+6,u.fontSize=u.ascent+u.descent,r.remove(e),u;var c,f,p=d.data,g=p.length,m=4*o,v=0,y=!1;for(c=0;ch;c--){for(f=0;fu){if(0===c){for(var v=p;v.length;){var y=(v=v.slice(0,-1)).length*this.letterSpacing;if((m=e.measureText(v).width+y)<=u)break}if(!v.length)throw new Error("wordWrapWidth < a single character");var x=f.substr(v.length);d[c]=x,h+=v}var T=d[c].length?c:c+1,w=d.slice(T).join(" ").replace(/[ \n]*$/gi,"");s.splice(a+1,0,w),n=s.length;break}h+=p,u-=m}r+=h.replace(/[ \n]*$/gi,"")+"\n"}}return r=r.replace(/[\s|\n]*$/gi,"")},basicWordWrap:function(t,e,i){for(var r="",s=t.split(this.splitRegExp),n=s.length-1,a=e.measureText(" ").width,o=0;o<=n;o++){for(var h=i,l=s[o].split(" "),u=l.length-1,d=0;d<=u;d++){var c=l[d],f=c.length*this.letterSpacing,p=e.measureText(c).width+f,g=p;dh&&d>0&&(r+="\n",h=i),r+=c,d0&&(c+=h.lineSpacing*g),i.rtl)d=f-d-u.left-u.right;else if("right"===i.align)d+=a-h.lineWidths[g];else if("center"===i.align)d+=(a-h.lineWidths[g])/2;else if("justify"===i.align){if(h.lineWidths[g]/h.width>=.85){var m=h.width-h.lineWidths[g],v=e.measureText(" ").width,y=o[g].trim(),x=y.split(" ");m+=(o[g].length-y.length)*v;for(var T=Math.floor(m/v),w=0;T>0;)x[w]+=" ",w=(w+1)%(x.length-1||1),--T;o[g]=x.join(" ")}}this.autoRound&&(d=Math.round(d),c=Math.round(c));var b=this.letterSpacing;if(i.strokeThickness&&0===b&&(i.syncShadow(e,i.shadowStroke),e.strokeText(o[g],d,c)),i.color)if(i.syncShadow(e,i.shadowFill),0!==b)for(var S=0,C=o[g].split(""),E=0;E2?a[o++]:"",r=a[o++]||"16px",i=a[o++]||"Courier"}return i===this.fontFamily&&r===this.fontSize&&s===this.fontStyle||(this.fontFamily=i,this.fontSize=r,this.fontStyle=s,e&&this.update(!0)),this.parent},setFontFamily:function(t){return this.fontFamily!==t&&(this.fontFamily=t,this.update(!0)),this.parent},setFontStyle:function(t){return this.fontStyle!==t&&(this.fontStyle=t,this.update(!0)),this.parent},setFontSize:function(t){return"number"==typeof t&&(t=t.toString()+"px"),this.fontSize!==t&&(this.fontSize=t,this.update(!0)),this.parent},setTestString:function(t){return this.testString=t,this.update(!0)},setFixedSize:function(t,e){return this.fixedWidth=t,this.fixedHeight=e,t&&(this.parent.width=t),e&&(this.parent.height=e),this.update(!1)},setBackgroundColor:function(t){return this.backgroundColor=t,this.update(!1)},setFill:function(t){return this.color=t,this.update(!1)},setColor:function(t){return this.color=t,this.update(!1)},setResolution:function(t){return this.resolution=t,this.update(!1)},setStroke:function(t,e){return void 0===e&&(e=this.strokeThickness),void 0===t&&0!==this.strokeThickness?(this.strokeThickness=0,this.update(!0)):this.stroke===t&&this.strokeThickness===e||(this.stroke=t,this.strokeThickness=e,this.update(!0)),this.parent},setShadow:function(t,e,i,r,s,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i="#000"),void 0===r&&(r=0),void 0===s&&(s=!1),void 0===n&&(n=!0),this.shadowOffsetX=t,this.shadowOffsetY=e,this.shadowColor=i,this.shadowBlur=r,this.shadowStroke=s,this.shadowFill=n,this.update(!1)},setShadowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.shadowOffsetX=t,this.shadowOffsetY=e,this.update(!1)},setShadowColor:function(t){return void 0===t&&(t="#000"),this.shadowColor=t,this.update(!1)},setShadowBlur:function(t){return void 0===t&&(t=0),this.shadowBlur=t,this.update(!1)},setShadowStroke:function(t){return this.shadowStroke=t,this.update(!1)},setShadowFill:function(t){return this.shadowFill=t,this.update(!1)},setWordWrapWidth:function(t,e){return void 0===e&&(e=!1),this.wordWrapWidth=t,this.wordWrapUseAdvanced=e,this.update(!1)},setWordWrapCallback:function(t,e){return void 0===e&&(e=null),this.wordWrapCallback=t,this.wordWrapCallbackScope=e,this.update(!1)},setAlign:function(t){return void 0===t&&(t="left"),this.align=t,this.update(!1)},setMaxLines:function(t){return void 0===t&&(t=0),this.maxLines=t,this.update(!1)},getTextMetrics:function(){var t=this.metrics;return{ascent:t.ascent,descent:t.descent,fontSize:t.fontSize}},toJSON:function(){var t={};for(var e in o)t[e]=this[e];return t.metrics=this.getTextMetrics(),t},destroy:function(){this.parent=void 0}});t.exports=h},34397(t){t.exports=function(t,e,i,r){if(0!==e.width&&0!==e.height){i.camera.addToRenderList(e);var s=e.customRenderNodes,n=e.defaultRenderNodes;(s.Submitter||n.Submitter).run(i,e,r,0,s.Texturer||n.Texturer,s.Transformer||n.Transformer)}}},20839(t,e,i){var r=i(9674),s=i(27919),n=i(41571),a=i(83419),o=i(31401),h=i(95643),l=i(68703),u=i(56295),d=i(45650),c=i(26099),f=new a({Extends:h,Mixins:[o.Alpha,o.BlendMode,o.ComputedSize,o.Depth,o.Flip,o.GetBounds,o.Lighting,o.Mask,o.Origin,o.RenderNodes,o.ScrollFactor,o.Texture,o.Tint,o.Transform,o.Visible,u],initialize:function(t,e,i,n,a,o,l){var u=t.sys.renderer,f=u&&!u.gl;h.call(this,t,"TileSprite");var p=t.sys.textures.get(o).get(l);n=n?Math.floor(n):p.width,a=a?Math.floor(a):p.height,this._tilePosition=new c,this._tileScale=new c(1,1),this._tileRotation=0,this.dirty=!1,this.renderer=u,this.canvas=f?s.create(this,n,a):null,this.context=f?this.canvas.getContext("2d",{willReadFrequently:!1}):null,this._displayTextureKey=d(),this.displayTexture=f?t.sys.textures.addCanvas(this._displayTextureKey,this.canvas):null,this.displayFrame=this.displayTexture?this.displayTexture.get():null,this.currentFrame=null,this.fillCanvas=f?s.create2D(this,p.width,this.displayFrame.height):null,this.fillContext=this.fillCanvas?this.fillCanvas.getContext("2d",{willReadFrequently:!1}):null,this.fillPattern=null,this.anims=new r(this),this.setTexture(o,l),this.setPosition(e,i),this.setSize(n,a),this.setOrigin(.5,.5),this.initRenderNodes(this._defaultRenderNodesMap)},_defaultRenderNodesMap:{get:function(){return n}},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(t,e){this.anims.update(t,e)},setFrame:function(t){var e=this.texture.get(t);return e.cutWidth&&e.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this.frame=e,this.dirty=!0,this},setSizeToFrame:function(){return this},setTilePosition:function(t,e){return void 0!==t&&(this.tilePositionX=t),void 0!==e&&(this.tilePositionY=e),this},setTileRotation:function(t){return void 0===t&&(t=0),this.tileRotation=t,this},setTileScale:function(t,e){return void 0===t&&(t=this.tileScaleX),void 0===e&&(e=t),this.tileScaleX=t,this.tileScaleY=e,this},updateTileTexture:function(){if(this.renderer&&!this.renderer.gl){var t=this.frame,e=this.fillContext,i=this.fillCanvas,r=t.cutWidth,s=t.cutHeight;e.clearRect(0,0,r,s),i.width=r,i.height=s,e.drawImage(t.source.image,t.cutX,t.cutY,t.cutWidth,t.cutHeight,0,0,r,s),this.fillPattern=e.createPattern(i,"repeat"),this.currentFrame=t}},updateCanvas:function(){var t=this.canvas,e=this.width,i=this.height,r=this.currentFrame!==this.frame;if((t.width!==e||t.height!==i||r)&&(t.width=e,t.height=i,this.displayFrame.setSize(e,i),this.updateDisplayOrigin(),r&&this.updateTileTexture(),this.dirty=!0),!this.dirty||this.renderer&&this.renderer.gl)this.dirty=!1;else{var s=this.context;this.scene.sys.game.config.antialias||l.disable(s);var n=this._tileScale.x,a=this._tileScale.y,o=this._tilePosition.x,h=this._tilePosition.y;s.clearRect(0,0,e,i),s.save(),s.rotate(this._tileRotation),s.scale(n,a),s.translate(-o,-h),s.fillStyle=this.fillPattern;var u=Math.max(e,Math.abs(e/n)),d=Math.max(i,Math.abs(i/a)),c=Math.sqrt(u*u+d*d);s.fillRect(o-c,h-c,2*c,2*c),s.restore(),this.dirty=!1}},setSize:function(t,e){this.width=t,this.height=e,this.updateDisplayOrigin();var i=this.input;return i&&!i.customHitArea&&(i.hitArea.width=t,i.hitArea.height=e),this},preDestroy:function(){this.canvas&&s.remove(this.canvas),this.fillCanvas&&s.remove(this.fillCanvas),this.fillPattern=null,this.fillContext=null,this.fillCanvas=null,this.displayTexture=null,this.displayFrame=null,this.renderer=null,this.anims.destroy(),this.anims=void 0},tilePositionX:{get:function(){return this._tilePosition.x},set:function(t){this._tilePosition.x=t,this.dirty=!0}},tilePositionY:{get:function(){return this._tilePosition.y},set:function(t){this._tilePosition.y=t,this.dirty=!0}},tileRotation:{get:function(){return this._tileRotation},set:function(t){this._tileRotation=t,this.dirty=!0}},tileScaleX:{get:function(){return this._tileScale.x},set:function(t){this._tileScale.x=t,this.dirty=!0}},tileScaleY:{get:function(){return this._tileScale.y},set:function(t){this._tileScale.y=t,this.dirty=!0}}});t.exports=f},46992(t){t.exports=function(t,e,i,r){e.updateCanvas(),i.addToRenderList(e),t.batchSprite(e,e.displayFrame,i,r)}},14167(t,e,i){var r=i(25305),s=i(44603),n=i(23568),a=i(20839);s.register("tileSprite",function(t,e){void 0===t&&(t={});var i=n(t,"x",0),s=n(t,"y",0),o=n(t,"width",512),h=n(t,"height",512),l=n(t,"key",""),u=n(t,"frame",""),d=new a(this.scene,i,s,o,h,l,u);return void 0!==e&&(t.add=e),r(this.scene,d,t),d})},91681(t,e,i){var r=i(20839);i(39429).register("tileSprite",function(t,e,i,s,n,a){return this.displayList.add(new r(this.scene,t,e,i,s,n,a))})},56295(t,e,i){var r=i(29747),s=r,n=r;s=i(18553),n=i(46992),t.exports={renderWebGL:s,renderCanvas:n}},18553(t){t.exports=function(t,e,i,r){var s=e.width,n=e.height;if(0!==s&&0!==n){i.camera.addToRenderList(e);var a=e.customRenderNodes,o=e.defaultRenderNodes;(a.Submitter||o.Submitter).run(i,e,r,0,a.Texturer||o.Texturer,a.Transformer||o.Transformer)}}},18471(t,e,i){var r=i(45319),s=i(40939),n=i(83419),a=i(31401),o=i(51708),h=i(8443),l=i(95643),u=i(36383),d=i(14463),c=i(45650),f=i(10247),p=new n({Extends:l,Mixins:[a.Alpha,a.BlendMode,a.ComputedSize,a.Depth,a.Flip,a.GetBounds,a.Lighting,a.Mask,a.Origin,a.RenderNodes,a.ScrollFactor,a.TextureCrop,a.Tint,a.Transform,a.Visible,f],initialize:function(t,e,i,r){l.call(this,t,"Video"),this.video,this.videoTexture,this.videoTextureSource,this.snapshotTexture,this.glFlipY=!0,this._key=c(),this.touchLocked=!1,this.playWhenUnlocked=!1,this.frameReady=!1,this.isStalled=!1,this.failedPlayAttempts=0,this.metadata,this.retry=0,this.retryInterval=500,this._systemMuted=!1,this._codeMuted=!1,this._systemPaused=!1,this._codePaused=!1,this._callbacks={ended:this.completeHandler.bind(this),legacy:this.legacyPlayHandler.bind(this),playing:this.playingHandler.bind(this),seeked:this.seekedHandler.bind(this),seeking:this.seekingHandler.bind(this),stalled:this.stalledHandler.bind(this),suspend:this.stalledHandler.bind(this),waiting:this.stalledHandler.bind(this)},this._loadCallbackHandler=this.loadErrorHandler.bind(this),this._metadataCallbackHandler=this.metadataHandler.bind(this),this._crop=this.resetCropObject(),this.markers={},this._markerIn=0,this._markerOut=0,this._playingMarker=!1,this._lastUpdate=0,this.cacheKey="",this.isSeeking=!1,this._playCalled=!1,this._getFrame=!1,this._rfvCallbackId=0;var s=t.sys.game;this._device=s.device.video,this.setPosition(e,i),this.setSize(256,256),this.initRenderNodes(this._defaultRenderNodesMap),s.events.on(h.PAUSE,this.globalPause,this),s.events.on(h.RESUME,this.globalResume,this);var n=t.sys.sound;n&&n.on(d.GLOBAL_MUTE,this.globalMute,this),r&&this.load(r)},_defaultRenderNodesMap:{get:function(){return s}},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},load:function(t){var e=this.scene.sys.cache.video.get(t);return e?(this.cacheKey=t,this.loadHandler(e.url,e.noAudio,e.crossOrigin)):console.warn("No video in cache for key: "+t),this},changeSource:function(t,e,i,r,s){void 0===e&&(e=!0),void 0===i&&(i=!1),this.cacheKey!==t&&(this.load(t),e&&this.play(i,r,s))},getVideoKey:function(){return this.cacheKey},loadURL:function(t,e,i){void 0===e&&(e=!1);var r=this._device.getVideoURL(t);return r?(this.cacheKey="",this.loadHandler(r.url,e,i)):console.warn("No supported video format found for "+t),this},loadMediaStream:function(t,e,i){return this.loadHandler(null,e,i,t)},loadHandler:function(t,e,i,r){e||(e=!1);var s=this.video;if(s?(this.removeLoadEventHandlers(),this.stop()):((s=document.createElement("video")).controls=!1,s.setAttribute("playsinline","playsinline"),s.setAttribute("preload","auto"),s.setAttribute("disablePictureInPicture","true")),e?(s.muted=!0,s.defaultMuted=!0,s.setAttribute("autoplay","autoplay")):(s.muted=!1,s.defaultMuted=!1,s.removeAttribute("autoplay")),i?s.setAttribute("crossorigin",i):s.removeAttribute("crossorigin"),r)if("srcObject"in s)try{s.srcObject=r}catch(t){if("TypeError"!==t.name)throw t;s.src=URL.createObjectURL(r)}else s.src=URL.createObjectURL(r);else s.src=t;this.retry=0,this.video=s,this._playCalled=!1,s.load(),this.addLoadEventHandlers();var n=this.scene.sys.textures.get(this._key);return this.setTexture(n),this},requestVideoFrame:function(t,e){var i=this.video;if(i){var r=e.width,s=e.height,n=this.videoTexture,a=this.videoTextureSource,h=!n||a.source!==i;h?(this._codePaused=i.paused,this._codeMuted=i.muted,n?(a.source=i,a.width=r,a.height=s,n.get().setSize(r,s)):((n=this.scene.sys.textures.create(this._key,i,r,s)).add("__BASE",0,0,0,r,s),this.setTexture(n),this.videoTexture=n,this.videoTextureSource=n.source[0],this.videoTextureSource.setFlipY(this.glFlipY),this.emit(o.VIDEO_TEXTURE,this,n)),this.setSizeToFrame(),this.updateDisplayOrigin()):a.update(),this.isStalled=!1,this.metadata=e;var l=e.mediaTime;h&&(this._lastUpdate=l,this.emit(o.VIDEO_CREATED,this,r,s),this.frameReady||(this.frameReady=!0,this.emit(o.VIDEO_PLAY,this))),this._playingMarker?l>=this._markerOut&&(i.loop?(i.currentTime=this._markerIn,this.emit(o.VIDEO_LOOP,this)):(this.stop(!1),this.emit(o.VIDEO_COMPLETE,this))):l-1&&i>e&&i=0&&!isNaN(i)&&i>e&&(this.markers[t]=[e,i]),this},playMarker:function(t,e){var i=this.markers[t];return i&&this.play(e,i[0],i[1]),this},removeMarker:function(t){return delete this.markers[t],this},snapshot:function(t,e){return void 0===t&&(t=this.width),void 0===e&&(e=this.height),this.snapshotArea(0,0,this.width,this.height,t,e)},snapshotArea:function(t,e,i,r,s,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===r&&(r=this.height),void 0===s&&(s=i),void 0===n&&(n=r);var a=this.video,o=this.snapshotTexture;return o?(o.setSize(s,n),a&&o.context.drawImage(a,t,e,i,r,0,0,s,n)):(o=this.scene.sys.textures.createCanvas(c(),s,n),this.snapshotTexture=o,a&&o.context.drawImage(a,t,e,i,r,0,0,s,n)),o.update()},saveSnapshotTexture:function(t){return this.snapshotTexture?this.scene.sys.textures.renameTexture(this.snapshotTexture.key,t):this.snapshotTexture=this.scene.sys.textures.createCanvas(t,this.width,this.height),this.snapshotTexture},playSuccess:function(){if(this._playCalled){this.addEventHandlers(),this._codePaused=!1,this.touchLocked&&(this.touchLocked=!1,this.emit(o.VIDEO_UNLOCKED,this));var t=this.scene.sys.sound;t&&t.mute&&this.setMute(!0),this._markerIn>-1&&(this.video.currentTime=this._markerIn)}},playError:function(t){var e=t.name;"NotAllowedError"===e?(this.touchLocked=!0,this.playWhenUnlocked=!0,this.failedPlayAttempts=1,this.emit(o.VIDEO_LOCKED,this)):"NotSupportedError"===e?(this.stop(!1),this.emit(o.VIDEO_UNSUPPORTED,this,t)):(this.stop(!1),this.emit(o.VIDEO_ERROR,this,t))},legacyPlayHandler:function(){var t=this.video;t&&(this.playSuccess(),t.removeEventListener("playing",this._callbacks.legacy))},playingHandler:function(){this.isStalled=!1,this.emit(o.VIDEO_PLAYING,this)},loadErrorHandler:function(t){this.stop(!1),this.emit(o.VIDEO_ERROR,this,t)},metadataHandler:function(t){this.emit(o.VIDEO_METADATA,this,t)},setSizeToFrame:function(t){t||(t=this.frame),this.width=t.realWidth,this.height=t.realHeight,1!==this.scaleX&&(this.scaleX=this.displayWidth/this.width),1!==this.scaleY&&(this.scaleY=this.displayHeight/this.height);var e=this.input;return e&&!e.customHitArea&&(e.hitArea.width=this.width,e.hitArea.height=this.height),this},stalledHandler:function(t){this.isStalled=!0,this.emit(o.VIDEO_STALLED,this,t)},completeHandler:function(){this._playCalled=!1,this.emit(o.VIDEO_COMPLETE,this)},preUpdate:function(t,e){this.video&&this._playCalled&&this.touchLocked&&this.playWhenUnlocked&&(this.retry+=e,this.retry>=this.retryInterval&&(this.createPlayPromise(!1),this.retry=0))},seekTo:function(t){var e=this.video;if(e){var i=e.duration;if(i!==1/0&&!isNaN(i)){var r=i*t;this.setCurrentTime(r)}}return this},getCurrentTime:function(){return this.video?this.video.currentTime:0},setCurrentTime:function(t){var e=this.video;if(e){if("string"==typeof t){var i=t[0],r=parseFloat(t.substr(1));"+"===i?t=e.currentTime+r:"-"===i&&(t=e.currentTime-r)}e.currentTime=t}return this},seekingHandler:function(){this.isSeeking=!0,this.emit(o.VIDEO_SEEKING,this)},seekedHandler:function(){this.isSeeking=!1,this.emit(o.VIDEO_SEEKED,this)},getProgress:function(){var t=this.video;if(t){var e=t.duration;if(e!==1/0&&!isNaN(e))return t.currentTime/e}return-1},getDuration:function(){return this.video?this.video.duration:0},setMute:function(t){void 0===t&&(t=!0),this._codeMuted=t;var e=this.video;return e&&(e.muted=!!this._systemMuted||t),this},isMuted:function(){return this._codeMuted},globalMute:function(t,e){this._systemMuted=e;var i=this.video;i&&(i.muted=!!this._codeMuted||e)},globalPause:function(){this._systemPaused=!0,this.video&&!this.video.ended&&(this.removeEventHandlers(),this.video.pause())},globalResume:function(){this._systemPaused=!1,!this.video||this._codePaused||this.video.ended||this.createPlayPromise()},setPaused:function(t){void 0===t&&(t=!0);var e=this.video;return this._codePaused=t,e&&!e.ended&&(t?e.paused||(this.removeEventHandlers(),e.pause()):t||(this._playCalled?e.paused&&!this._systemPaused&&this.createPlayPromise():this.play())),this},pause:function(){return this.setPaused(!0)},resume:function(){return this.setPaused(!1)},getVolume:function(){return this.video?this.video.volume:1},setVolume:function(t){return void 0===t&&(t=1),this.video&&(this.video.volume=r(t,0,1)),this},getPlaybackRate:function(){return this.video?this.video.playbackRate:1},setPlaybackRate:function(t){return this.video&&(this.video.playbackRate=t),this},getLoop:function(){return!!this.video&&this.video.loop},setLoop:function(t){return void 0===t&&(t=!0),this.video&&(this.video.loop=t),this},isPlaying:function(){return!!this.video&&!(this.video.paused||this.video.ended)},isPaused:function(){return this.video&&this._playCalled&&this.video.paused||this._codePaused||this._systemPaused},saveTexture:function(t,e){return void 0===e&&(e=!0),this.videoTexture&&(this.scene.sys.textures.renameTexture(this._key,t),this.videoTextureSource.setFlipY(e)),this._key=t,this.glFlipY=e,!!this.videoTexture},stop:function(t){void 0===t&&(t=!0);var e=this.video;return e&&(this.removeEventHandlers(),e.cancelVideoFrameCallback(this._rfvCallbackId),e.pause()),this.retry=0,this._playCalled=!1,t&&this.emit(o.VIDEO_STOP,this),this},removeVideoElement:function(){var t=this.video;if(t){for(t.parentNode&&t.parentNode.removeChild(t);t.hasChildNodes();)t.removeChild(t.firstChild);t.removeAttribute("autoplay"),t.removeAttribute("src"),this.video=null}},preDestroy:function(){this.stop(!1),this.removeLoadEventHandlers(),this.removeVideoElement();var t=this.scene.sys.game.events;t.off(h.PAUSE,this.globalPause,this),t.off(h.RESUME,this.globalResume,this);var e=this.scene.sys.sound;e&&e.off(d.GLOBAL_MUTE,this.globalMute,this)}});t.exports=p},58352(t){t.exports=function(t,e,i,r){e.videoTexture&&(i.addToRenderList(e),t.batchSprite(e,e.frame,i,r))}},11511(t,e,i){var r=i(25305),s=i(44603),n=i(23568),a=i(18471);s.register("video",function(t,e){void 0===t&&(t={});var i=n(t,"key",null),s=new a(this.scene,0,0,i);return void 0!==e&&(t.add=e),r(this.scene,s,t),s})},89025(t,e,i){var r=i(18471);i(39429).register("video",function(t,e,i){return this.displayList.add(new r(this.scene,t,e,i))})},10247(t,e,i){var r=i(29747),s=r,n=r;s=i(29849),n=i(58352),t.exports={renderWebGL:s,renderCanvas:n}},29849(t){t.exports=function(t,e,i,r){if(e.videoTexture){i.camera.addToRenderList(e);var s=e.customRenderNodes,n=e.defaultRenderNodes;(s.Submitter||n.Submitter).run(i,e,r,0,s.Texturer||n.Texturer,s.Transformer||n.Transformer)}}},41481(t,e,i){var r=i(10312),s=i(96503),n=i(87902),a=i(83419),o=i(31401),h=i(95643),l=i(87841),u=i(37303),d=new a({Extends:h,Mixins:[o.Depth,o.GetBounds,o.Origin,o.Transform,o.ScrollFactor,o.Visible],initialize:function(t,e,i,s,n){void 0===s&&(s=1),void 0===n&&(n=s),h.call(this,t,"Zone"),this.setPosition(e,i),this.width=s,this.height=n,this.blendMode=r.NORMAL,this.updateDisplayOrigin()},displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e,i){void 0===i&&(i=!0),this.width=t,this.height=e,this.updateDisplayOrigin();var r=this.input;return i&&r&&!r.customHitArea&&(r.hitArea.width=t,r.hitArea.height=e),this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this},setCircleDropZone:function(t){return this.setDropZone(new s(0,0,t),n)},setRectangleDropZone:function(t,e){return this.setDropZone(new l(0,0,t,e),u)},setDropZone:function(t,e){return this.input||this.setInteractive(t,e,!0),this},setAlpha:function(){},setBlendMode:function(){},renderCanvas:function(t,e,i){i.addToRenderList(e)},renderWebGL:function(t,e,i){i.camera.addToRenderList(e)}});t.exports=d},95261(t,e,i){var r=i(44603),s=i(23568),n=i(41481);r.register("zone",function(t){var e=s(t,"x",0),i=s(t,"y",0),r=s(t,"width",1),a=s(t,"height",r);return new n(this.scene,e,i,r,a)})},84175(t,e,i){var r=i(41481);i(39429).register("zone",function(t,e,i,s){return this.displayList.add(new r(this.scene,t,e,i,s))})},95166(t){t.exports=function(t){return t.radius>0?Math.PI*t.radius*t.radius:0}},96503(t,e,i){var r=i(83419),s=i(87902),n=i(26241),a=i(79124),o=i(23777),h=i(28176),l=new r({initialize:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this.type=o.CIRCLE,this.x=t,this.y=e,this._radius=i,this._diameter=2*i},contains:function(t,e){return s(this,t,e)},getPoint:function(t,e){return n(this,t,e)},getPoints:function(t,e,i){return a(this,t,e,i)},getRandomPoint:function(t){return h(this,t)},setTo:function(t,e,i){return this.x=t,this.y=e,this._radius=i,this._diameter=2*i,this},setEmpty:function(){return this._radius=0,this._diameter=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},isEmpty:function(){return this._radius<=0},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this._diameter=2*t}},diameter:{get:function(){return this._diameter},set:function(t){this._diameter=t,this._radius=.5*t}},left:{get:function(){return this.x-this._radius},set:function(t){this.x=t+this._radius}},right:{get:function(){return this.x+this._radius},set:function(t){this.x=t-this._radius}},top:{get:function(){return this.y-this._radius},set:function(t){this.y=t+this._radius}},bottom:{get:function(){return this.y+this._radius},set:function(t){this.y=t-this._radius}}});t.exports=l},71562(t){t.exports=function(t){return Math.PI*t.radius*2}},92110(t,e,i){var r=i(26099);t.exports=function(t,e,i){return void 0===i&&(i=new r),i.x=t.x+t.radius*Math.cos(e),i.y=t.y+t.radius*Math.sin(e),i}},42250(t,e,i){var r=i(96503);t.exports=function(t){return new r(t.x,t.y,t.radius)}},87902(t){t.exports=function(t,e,i){return t.radius>0&&e>=t.left&&e<=t.right&&i>=t.top&&i<=t.bottom&&(t.x-e)*(t.x-e)+(t.y-i)*(t.y-i)<=t.radius*t.radius}},5698(t,e,i){var r=i(87902);t.exports=function(t,e){return r(t,e.x,e.y)}},70588(t,e,i){var r=i(87902);t.exports=function(t,e){return r(t,e.x,e.y)&&r(t,e.right,e.y)&&r(t,e.x,e.bottom)&&r(t,e.right,e.bottom)}},26394(t){t.exports=function(t,e){return e.setTo(t.x,t.y,t.radius)}},76278(t){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.radius===e.radius}},2074(t,e,i){var r=i(87841);t.exports=function(t,e){return void 0===e&&(e=new r),e.x=t.left,e.y=t.top,e.width=t.diameter,e.height=t.diameter,e}},26241(t,e,i){var r=i(92110),s=i(62945),n=i(36383),a=i(26099);t.exports=function(t,e,i){void 0===i&&(i=new a);var o=s(e,0,n.TAU);return r(t,o,i)}},79124(t,e,i){var r=i(71562),s=i(92110),n=i(62945),a=i(36383);t.exports=function(t,e,i,o){void 0===o&&(o=[]),!e&&i>0&&(e=r(t)/i);for(var h=0;h1?2-s:s,a=n*Math.cos(i),o=n*Math.sin(i);return e.x=t.x+a*t.radius,e.y=t.y+o*t.radius,e}},88911(t,e,i){var r=i(96503);r.Area=i(95166),r.Circumference=i(71562),r.CircumferencePoint=i(92110),r.Clone=i(42250),r.Contains=i(87902),r.ContainsPoint=i(5698),r.ContainsRect=i(70588),r.CopyFrom=i(26394),r.Equals=i(76278),r.GetBounds=i(2074),r.GetPoint=i(26241),r.GetPoints=i(79124),r.Offset=i(50884),r.OffsetPoint=i(39212),r.Random=i(28176),t.exports=r},23777(t){t.exports={CIRCLE:0,ELLIPSE:1,LINE:2,POINT:3,POLYGON:4,RECTANGLE:5,TRIANGLE:6}},78874(t){t.exports=function(t){return t.isEmpty()?0:t.getMajorRadius()*t.getMinorRadius()*Math.PI}},92990(t){t.exports=function(t){var e=t.width/2,i=t.height/2,r=Math.pow(e-i,2)/Math.pow(e+i,2);return Math.PI*(e+i)*(1+3*r/(10+Math.sqrt(4-3*r)))}},79522(t,e,i){var r=i(26099);t.exports=function(t,e,i){void 0===i&&(i=new r);var s=t.width/2,n=t.height/2;return i.x=t.x+s*Math.cos(e),i.y=t.y+n*Math.sin(e),i}},58102(t,e,i){var r=i(8497);t.exports=function(t){return new r(t.x,t.y,t.width,t.height)}},81154(t){t.exports=function(t,e,i){if(t.width<=0||t.height<=0)return!1;var r=(e-t.x)/t.width,s=(i-t.y)/t.height;return(r*=r)+(s*=s)<.25}},46662(t,e,i){var r=i(81154);t.exports=function(t,e){return r(t,e.x,e.y)}},1632(t,e,i){var r=i(81154);t.exports=function(t,e){return r(t,e.x,e.y)&&r(t,e.right,e.y)&&r(t,e.x,e.bottom)&&r(t,e.right,e.bottom)}},65534(t){t.exports=function(t,e){return e.setTo(t.x,t.y,t.width,t.height)}},8497(t,e,i){var r=i(83419),s=i(81154),n=i(90549),a=i(48320),o=i(23777),h=i(24820),l=new r({initialize:function(t,e,i,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),this.type=o.ELLIPSE,this.x=t,this.y=e,this.width=i,this.height=r},contains:function(t,e){return s(this,t,e)},getPoint:function(t,e){return n(this,t,e)},getPoints:function(t,e,i){return a(this,t,e,i)},getRandomPoint:function(t){return h(this,t)},setTo:function(t,e,i,r){return this.x=t,this.y=e,this.width=i,this.height=r,this},setEmpty:function(){return this.width=0,this.height=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getMinorRadius:function(){return Math.min(this.width,this.height)/2},getMajorRadius:function(){return Math.max(this.width,this.height)/2},left:{get:function(){return this.x-this.width/2},set:function(t){this.x=t+this.width/2}},right:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},top:{get:function(){return this.y-this.height/2},set:function(t){this.y=t+this.height/2}},bottom:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=l},36146(t){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}},23694(t,e,i){var r=i(87841);t.exports=function(t,e){return void 0===e&&(e=new r),e.x=t.left,e.y=t.top,e.width=t.width,e.height=t.height,e}},90549(t,e,i){var r=i(79522),s=i(62945),n=i(36383),a=i(26099);t.exports=function(t,e,i){void 0===i&&(i=new a);var o=s(e,0,n.TAU);return r(t,o,i)}},48320(t,e,i){var r=i(92990),s=i(79522),n=i(62945),a=i(36383);t.exports=function(t,e,i,o){void 0===o&&(o=[]),!e&&i>0&&(e=r(t)/i);for(var h=0;ha||n>o)return!1;if(s<=i||n<=r)return!0;var h=s-i,l=n-r;return h*h+l*l<=t.radius*t.radius}},63376(t,e,i){var r=i(26099),s=i(2044);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var n,a,o,h,l=t.x,u=t.y,d=t.radius,c=e.x,f=e.y,p=e.radius;if(u===f)0===(o=(a=-2*f)*a-4*(n=1)*(c*c+(h=(p*p-d*d-c*c+l*l)/(2*(l-c)))*h-2*c*h+f*f-p*p))?i.push(new r(h,-a/(2*n))):o>0&&(i.push(new r(h,(-a+Math.sqrt(o))/(2*n))),i.push(new r(h,(-a-Math.sqrt(o))/(2*n))));else{var g=(l-c)/(u-f),m=(p*p-d*d-c*c+l*l-f*f+u*u)/(2*(u-f));0===(o=(a=2*u*g-2*m*g-2*l)*a-4*(n=g*g+1)*(l*l+u*u+m*m-d*d-2*u*m))?(h=-a/(2*n),i.push(new r(h,m-h*g))):o>0&&(h=(-a+Math.sqrt(o))/(2*n),i.push(new r(h,m-h*g)),h=(-a-Math.sqrt(o))/(2*n),i.push(new r(h,m-h*g)))}}return i}},97439(t,e,i){var r=i(4042),s=i(81491);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var n=e.getLineA(),a=e.getLineB(),o=e.getLineC(),h=e.getLineD();r(n,t,i),r(a,t,i),r(o,t,i),r(h,t,i)}return i}},4042(t,e,i){var r=i(26099),s=i(80462);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var n,a,o=t.x1,h=t.y1,l=t.x2,u=t.y2,d=e.x,c=e.y,f=e.radius,p=l-o,g=u-h,m=o-d,v=h-c,y=p*p+g*g,x=2*(p*m+g*v),T=x*x-4*y*(m*m+v*v-f*f);if(0===T){var w=-x/(2*y);n=o+w*p,a=h+w*g,w>=0&&w<=1&&i.push(new r(n,a))}else if(T>0){var b=(-x-Math.sqrt(T))/(2*y);n=o+b*p,a=h+b*g,b>=0&&b<=1&&i.push(new r(n,a));var S=(-x+Math.sqrt(T))/(2*y);n=o+S*p,a=h+S*g,S>=0&&S<=1&&i.push(new r(n,a))}}return i}},36100(t,e,i){var r=i(25836);t.exports=function(t,e,i,s){void 0===i&&(i=!1);var n,a,o,h=t.x1,l=t.y1,u=t.x2,d=t.y2,c=e.x1,f=e.y1,p=u-h,g=d-l,m=e.x2-c,v=e.y2-f,y=p*v-g*m;if(0===y)return null;if(i){if(n=(p*(f-l)+g*(h-c))/(m*g-v*p),0!==p)a=(c+m*n-h)/p;else{if(0===g)return null;a=(f+v*n-l)/g}if(a<0||n<0||n>1)return null;o=a}else{if(a=((l-f)*p-(h-c)*g)/y,(n=((c-h)*v-(f-l)*m)/y)<0||n>1||a<0||a>1)return null;o=n}return void 0===s&&(s=new r),s.set(h+p*o,l+g*o,o)}},3073(t,e,i){var r=i(36100),s=i(23031),n=i(25836),a=new s,o=new n;t.exports=function(t,e,i,s){void 0===i&&(i=!1),void 0===s&&(s=new n);var h=!1;s.set(),o.set();for(var l=e[e.length-1],u=0;u0){var c=(o*n+h*a)/l;u*=c,d*=c}return i.x=t.x1+u,i.y=t.y1+d,u*u+d*d<=l&&u*n+d*a>=0&&r(e,i.x,i.y)}},76112(t){t.exports=function(t,e,i){var r=t.x1,s=t.y1,n=t.x2,a=t.y2,o=e.x1,h=e.y1,l=e.x2,u=e.y2;if(r===n&&s===a||o===l&&h===u)return!1;var d=(u-h)*(n-r)-(l-o)*(a-s);if(0===d)return!1;var c=((l-o)*(s-h)-(u-h)*(r-o))/d,f=((n-r)*(s-h)-(a-s)*(r-o))/d;return!(c<0||c>1||f<0||f>1)&&(i&&(i.x=r+c*(n-r),i.y=s+c*(a-s)),!0)}},92773(t){t.exports=function(t,e){var i=t.x1,r=t.y1,s=t.x2,n=t.y2,a=e.x,o=e.y,h=e.right,l=e.bottom,u=0;if(i>=a&&i<=h&&r>=o&&r<=l||s>=a&&s<=h&&n>=o&&n<=l)return!0;if(i=a){if((u=r+(n-r)*(a-i)/(s-i))>o&&u<=l)return!0}else if(i>h&&s<=h&&(u=r+(n-r)*(h-i)/(s-i))>=o&&u<=l)return!0;if(r=o){if((u=i+(s-i)*(o-r)/(n-r))>=a&&u<=h)return!0}else if(r>l&&n<=l&&(u=i+(s-i)*(l-r)/(n-r))>=a&&u<=h)return!0;return!1}},16204(t){t.exports=function(t,e,i){void 0===i&&(i=1);var r=e.x1,s=e.y1,n=e.x2,a=e.y2,o=t.x,h=t.y,l=(n-r)*(n-r)+(a-s)*(a-s);if(0===l)return!1;var u=((o-r)*(n-r)+(h-s)*(a-s))/l;if(u<0)return Math.sqrt((r-o)*(r-o)+(s-h)*(s-h))<=i;if(u>=0&&u<=1){var d=((s-h)*(n-r)-(r-o)*(a-s))/l;return Math.abs(d)*Math.sqrt(l)<=i}return Math.sqrt((n-o)*(n-o)+(a-h)*(a-h))<=i}},14199(t,e,i){var r=i(16204);t.exports=function(t,e){if(!r(t,e))return!1;var i=Math.min(e.x1,e.x2),s=Math.max(e.x1,e.x2),n=Math.min(e.y1,e.y2),a=Math.max(e.y1,e.y2);return t.x>=i&&t.x<=s&&t.y>=n&&t.y<=a}},59996(t){t.exports=function(t,e){return!(t.width<=0||t.height<=0||e.width<=0||e.height<=0)&&!(t.righte.right||t.y>e.bottom)}},89265(t,e,i){var r=i(76112),s=i(37303),n=i(48653),a=i(77493);t.exports=function(t,e){if(e.left>t.right||e.rightt.bottom||e.bottom0}},84411(t){t.exports=function(t,e,i,r,s,n){return void 0===n&&(n=0),!(e>t.right+n||it.bottom+n||se.right||t.righte.bottom||t.bottome.right||t.righte.bottom||t.bottom0||(d=s(e),(c=r(t,d,!0)).length>0)}},91865(t,e,i){t.exports={CircleToCircle:i(2044),CircleToRectangle:i(81491),GetCircleToCircle:i(63376),GetCircleToRectangle:i(97439),GetLineToCircle:i(4042),GetLineToLine:i(36100),GetLineToPoints:i(3073),GetLineToPolygon:i(56362),GetLineToRectangle:i(60646),GetRaysFromPointToPolygon:i(71147),GetRectangleIntersection:i(68389),GetRectangleToRectangle:i(52784),GetRectangleToTriangle:i(26341),GetTriangleToCircle:i(38720),GetTriangleToLine:i(13882),GetTriangleToTriangle:i(75636),LineToCircle:i(80462),LineToLine:i(76112),LineToRectangle:i(92773),PointToLine:i(16204),PointToLineSegment:i(14199),RectangleToRectangle:i(59996),RectangleToTriangle:i(89265),RectangleToValues:i(84411),TriangleToCircle:i(67636),TriangleToLine:i(2822),TriangleToTriangle:i(82944)}},91938(t){t.exports=function(t){return Math.atan2(t.y2-t.y1,t.x2-t.x1)}},84993(t){t.exports=function(t,e,i){void 0===e&&(e=1),void 0===i&&(i=[]);var r=Math.round(t.x1),s=Math.round(t.y1),n=Math.round(t.x2),a=Math.round(t.y2),o=Math.abs(n-r),h=Math.abs(a-s),l=r-h&&(d-=h,r+=l),f0){var v=u[0],y=[v];for(h=1;h=a&&(y.push(x),v=x)}var T=u[u.length-1];return r(v,T)0&&(e=r(t)/i);for(var a=t.x1,o=t.y1,h=t.x2,l=t.y2,u=0;uthis.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=l},64795(t,e,i){var r=i(36383),s=i(15994),n=i(91938);t.exports=function(t){var e=n(t)-r.PI_OVER_2;return s(e,-Math.PI,Math.PI)}},52616(t,e,i){var r=i(36383),s=i(91938);t.exports=function(t){return Math.cos(s(t)-r.PI_OVER_2)}},87231(t,e,i){var r=i(36383),s=i(91938);t.exports=function(t){return Math.sin(s(t)-r.PI_OVER_2)}},89662(t){t.exports=function(t,e,i){return t.x1+=e,t.y1+=i,t.x2+=e,t.y2+=i,t}},71165(t){t.exports=function(t){return-(t.x2-t.x1)/(t.y2-t.y1)}},65822(t,e,i){var r=i(26099);t.exports=function(t,e){void 0===e&&(e=new r);var i=Math.random();return e.x=t.x1+i*(t.x2-t.x1),e.y=t.y1+i*(t.y2-t.y1),e}},69777(t,e,i){var r=i(91938),s=i(64795);t.exports=function(t,e){return 2*s(e)-Math.PI-r(t)}},39706(t,e,i){var r=i(64400);t.exports=function(t,e){var i=(t.x1+t.x2)/2,s=(t.y1+t.y2)/2;return r(t,i,s,e)}},82585(t,e,i){var r=i(64400);t.exports=function(t,e,i){return r(t,e.x,e.y,i)}},64400(t){t.exports=function(t,e,i,r){var s=Math.cos(r),n=Math.sin(r),a=t.x1-e,o=t.y1-i;return t.x1=a*s-o*n+e,t.y1=a*n+o*s+i,a=t.x2-e,o=t.y2-i,t.x2=a*s-o*n+e,t.y2=a*n+o*s+i,t}},62377(t){t.exports=function(t,e,i,r,s){return t.x1=e,t.y1=i,t.x2=e+Math.cos(r)*s,t.y2=i+Math.sin(r)*s,t}},71366(t){t.exports=function(t){return(t.y2-t.y1)/(t.x2-t.x1)}},10809(t){t.exports=function(t){return Math.abs(t.x1-t.x2)}},2529(t,e,i){var r=i(23031);r.Angle=i(91938),r.BresenhamPoints=i(84993),r.CenterOn=i(36469),r.Clone=i(31116),r.CopyFrom=i(59944),r.Equals=i(59220),r.Extend=i(78177),r.GetEasedPoints=i(26708),r.GetMidPoint=i(32125),r.GetNearestPoint=i(99569),r.GetNormal=i(34638),r.GetPoint=i(13151),r.GetPoints=i(15258),r.GetShortestDistance=i(26408),r.Height=i(98770),r.Length=i(35001),r.NormalAngle=i(64795),r.NormalX=i(52616),r.NormalY=i(87231),r.Offset=i(89662),r.PerpSlope=i(71165),r.Random=i(65822),r.ReflectAngle=i(69777),r.Rotate=i(39706),r.RotateAroundPoint=i(82585),r.RotateAroundXY=i(64400),r.SetToAngle=i(62377),r.Slope=i(71366),r.Width=i(10809),t.exports=r},12306(t,e,i){var r=i(25717);t.exports=function(t){return new r(t.points)}},63814(t){t.exports=function(t,e,i){for(var r=!1,s=-1,n=t.points.length-1;++s80*r){n=o=t[0],a=h=t[1];for(var x=r;xo&&(o=d),c>h&&(h=c);p=0!==(p=Math.max(o-n,h-a))?32767/p:0}return s(v,y,r,n,a,p,0),y}function i(t,e,i,r,s){var n,a;if(s===A(t,e,i,r)>0)for(n=e;n=e;n-=r)a=S(n,t[n],t[n+1],a);return a&&v(a,a.next)&&(C(a),a=a.next),a}function r(t,e){if(!t)return t;e||(e=t);var i,r=t;do{if(i=!1,r.steiner||!v(r,r.next)&&0!==m(r.prev,r,r.next))r=r.next;else{if(C(r),(r=e=r.prev)===r.next)break;i=!0}}while(i||r!==e);return e}function s(t,e,i,l,u,d,f){if(t){!f&&d&&function(t,e,i,r){var s=t;do{0===s.z&&(s.z=c(s.x,s.y,e,i,r)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next}while(s!==t);s.prevZ.nextZ=null,s.prevZ=null,function(t){var e,i,r,s,n,a,o,h,l=1;do{for(i=t,t=null,n=null,a=0;i;){for(a++,r=i,o=0,e=0;e0||h>0&&r;)0!==o&&(0===h||!r||i.z<=r.z)?(s=i,i=i.nextZ,o--):(s=r,r=r.nextZ,h--),n?n.nextZ=s:t=s,s.prevZ=n,n=s;i=r}n.nextZ=null,l*=2}while(a>1)}(s)}(t,l,u,d);for(var p,g,m=t;t.prev!==t.next;)if(p=t.prev,g=t.next,d?a(t,l,u,d):n(t))e.push(p.i/i|0),e.push(t.i/i|0),e.push(g.i/i|0),C(t),t=g.next,m=g.next;else if((t=g)===m){f?1===f?s(t=o(r(t),e,i),e,i,l,u,d,2):2===f&&h(t,e,i,l,u,d):s(r(t),e,i,l,u,d,1);break}}}function n(t){var e=t.prev,i=t,r=t.next;if(m(e,i,r)>=0)return!1;for(var s=e.x,n=i.x,a=r.x,o=e.y,h=i.y,l=r.y,u=sn?s>a?s:a:n>a?n:a,f=o>h?o>l?o:l:h>l?h:l,g=r.next;g!==e;){if(g.x>=u&&g.x<=c&&g.y>=d&&g.y<=f&&p(s,o,n,h,a,l,g.x,g.y)&&m(g.prev,g,g.next)>=0)return!1;g=g.next}return!0}function a(t,e,i,r){var s=t.prev,n=t,a=t.next;if(m(s,n,a)>=0)return!1;for(var o=s.x,h=n.x,l=a.x,u=s.y,d=n.y,f=a.y,g=oh?o>l?o:l:h>l?h:l,x=u>d?u>f?u:f:d>f?d:f,T=c(g,v,e,i,r),w=c(y,x,e,i,r),b=t.prevZ,S=t.nextZ;b&&b.z>=T&&S&&S.z<=w;){if(b.x>=g&&b.x<=y&&b.y>=v&&b.y<=x&&b!==s&&b!==a&&p(o,u,h,d,l,f,b.x,b.y)&&m(b.prev,b,b.next)>=0)return!1;if(b=b.prevZ,S.x>=g&&S.x<=y&&S.y>=v&&S.y<=x&&S!==s&&S!==a&&p(o,u,h,d,l,f,S.x,S.y)&&m(S.prev,S,S.next)>=0)return!1;S=S.nextZ}for(;b&&b.z>=T;){if(b.x>=g&&b.x<=y&&b.y>=v&&b.y<=x&&b!==s&&b!==a&&p(o,u,h,d,l,f,b.x,b.y)&&m(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;S&&S.z<=w;){if(S.x>=g&&S.x<=y&&S.y>=v&&S.y<=x&&S!==s&&S!==a&&p(o,u,h,d,l,f,S.x,S.y)&&m(S.prev,S,S.next)>=0)return!1;S=S.nextZ}return!0}function o(t,e,i){var s=t;do{var n=s.prev,a=s.next.next;!v(n,a)&&y(n,s,s.next,a)&&w(n,a)&&w(a,n)&&(e.push(n.i/i|0),e.push(s.i/i|0),e.push(a.i/i|0),C(s),C(s.next),s=t=a),s=s.next}while(s!==t);return r(s)}function h(t,e,i,n,a,o){var h=t;do{for(var l=h.next.next;l!==h.prev;){if(h.i!==l.i&&g(h,l)){var u=b(h,l);return h=r(h,h.next),u=r(u,u.next),s(h,e,i,n,a,o,0),void s(u,e,i,n,a,o,0)}l=l.next}h=h.next}while(h!==t)}function l(t,e){return t.x-e.x}function u(t,e){var i=function(t,e){var i,r=e,s=t.x,n=t.y,a=-1/0;do{if(n<=r.y&&n>=r.next.y&&r.next.y!==r.y){var o=r.x+(n-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(o<=s&&o>a&&(a=o,i=r.x=r.x&&r.x>=u&&s!==r.x&&p(ni.x||r.x===i.x&&d(i,r)))&&(i=r,f=h)),r=r.next}while(r!==l);return i}(t,e);if(!i)return e;var s=b(i,t);return r(s,s.next),r(i,i.next)}function d(t,e){return m(t.prev,t,e.prev)<0&&m(e.next,t,t.next)<0}function c(t,e,i,r,s){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*s|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*s|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function f(t){var e=t,i=t;do{(e.x=(t-a)*(n-o)&&(t-a)*(r-o)>=(i-a)*(e-o)&&(i-a)*(n-o)>=(s-a)*(r-o)}function g(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&y(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(w(t,e)&&w(e,t)&&function(t,e){var i=t,r=!1,s=(t.x+e.x)/2,n=(t.y+e.y)/2;do{i.y>n!=i.next.y>n&&i.next.y!==i.y&&s<(i.next.x-i.x)*(n-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next}while(i!==t);return r}(t,e)&&(m(t.prev,t,e.prev)||m(t,e.prev,e))||v(t,e)&&m(t.prev,t,t.next)>0&&m(e.prev,e,e.next)>0)}function m(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function v(t,e){return t.x===e.x&&t.y===e.y}function y(t,e,i,r){var s=T(m(t,e,i)),n=T(m(t,e,r)),a=T(m(i,r,t)),o=T(m(i,r,e));return s!==n&&a!==o||(!(0!==s||!x(t,i,e))||(!(0!==n||!x(t,r,e))||(!(0!==a||!x(i,t,r))||!(0!==o||!x(i,e,r)))))}function x(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function T(t){return t>0?1:t<0?-1:0}function w(t,e){return m(t.prev,t,t.next)<0?m(t,e,t.next)>=0&&m(t,t.prev,e)>=0:m(t,e,t.prev)<0||m(t,t.next,e)<0}function b(t,e){var i=new E(t.i,t.x,t.y),r=new E(e.i,e.x,e.y),s=t.next,n=e.prev;return t.next=e,e.prev=t,i.next=s,s.prev=i,r.next=i,i.prev=r,n.next=r,r.prev=n,r}function S(t,e,i,r){var s=new E(t,e,i);return r?(s.next=r.next,s.prev=r,r.next.prev=s,r.next=s):(s.prev=s,s.next=s),s}function C(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function E(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function A(t,e,i,r){for(var s=0,n=e,a=i-r;n0&&(r+=t[s-1].length,i.holes.push(r))}return i},t.exports=e},13829(t,e,i){var r=i(87841);t.exports=function(t,e){void 0===e&&(e=new r);for(var i,s=1/0,n=1/0,a=-s,o=-n,h=0;h0&&(e=h/i);for(var l=0;ld+m)){var v=g.getPoint((u-d)/m);a.push(v);break}d+=m}return a}},30052(t,e,i){var r=i(35001),s=i(23031);t.exports=function(t){for(var e=t.points,i=0,n=0;n1?(r=i.x,s=i.y):o>0&&(r+=n*o,s+=a*o)}return(n=t.x-r)*n+(a=t.y-s)*a}function r(t,e,s,n,a){for(var o,h=n,l=e+1;lh&&(o=l,h=u)}h>n&&(o-e>1&&r(t,e,o,n,a),a.push(t[o]),s-o>1&&r(t,o,s,n,a))}function s(t,e){var i=t.length-1,s=[t[0]];return r(t,0,i,e,s),s.push(t[i]),s}t.exports=function(t,i,r){void 0===i&&(i=1),void 0===r&&(r=!1);var n=t.points;if(n.length>2){var a=i*i;r||(n=function(t,i){for(var r,s=t[0],n=[s],a=1,o=t.length;ai&&(n.push(r),s=r);return s!==r&&n.push(r),n}(n,a)),t.setTo(s(n,a))}return t}},5469(t){var e=function(t,e){return t[0]=e[0],t[1]=e[1],t};t.exports=function(t){var i,r=[],s=t.points;for(i=0;i0&&n.push(e([0,0],r[0])),i=0;i1&&n.push(e([0,0],r[r.length-1])),t.setTo(n)}},24709(t){t.exports=function(t,e,i){for(var r=t.points,s=0;s=e&&t.y<=i&&t.y+t.height>=i)}},96553(t,e,i){var r=i(37303);t.exports=function(t,e){return r(t,e.x,e.y)}},70273(t){t.exports=function(t,e){return!(e.width*e.height>t.width*t.height)&&(e.x>t.x&&e.xt.x&&e.rightt.y&&e.yt.y&&e.bottomr(e)?t.setSize(e.height*i,e.height):t.setSize(e.width,e.width/i),t.setPosition(e.centerX-t.width/2,e.centerY-t.height/2)}},80774(t){t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t}},83859(t){t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t.width=Math.floor(t.width),t.height=Math.floor(t.height),t}},19217(t,e,i){var r=i(87841),s=i(36383);t.exports=function(t,e){if(void 0===e&&(e=new r),0===t.length)return e;for(var i,n,a,o=Number.MAX_VALUE,h=Number.MAX_VALUE,l=s.MIN_SAFE_INTEGER,u=s.MIN_SAFE_INTEGER,d=0;d=1)return i.x=t.x,i.y=t.y,i;var n=r(t)*e;return e>.5?(n-=t.width+t.height)<=t.width?(i.x=t.right-n,i.y=t.bottom):(i.x=t.x,i.y=t.bottom-(n-t.width)):n<=t.width?(i.x=t.x+n,i.y=t.y):(i.x=t.right,i.y=t.y+(n-t.width)),i}},34819(t,e,i){var r=i(20812),s=i(13019);t.exports=function(t,e,i,n){void 0===n&&(n=[]),!e&&i>0&&(e=s(t)/i);for(var a=0;a=t.right&&(h=1,o+=a-t.right,a=t.right);break;case 1:(o+=e)>=t.bottom&&(h=2,a-=o-t.bottom,o=t.bottom);break;case 2:(a-=e)<=t.left&&(h=3,o-=t.left-a,a=t.left);break;case 3:(o-=e)<=t.top&&(h=0,o=t.top)}return n}},33595(t){t.exports=function(t,e){for(var i=t.x,r=t.right,s=t.y,n=t.bottom,a=0;ae.x&&t.ye.y}},13019(t){t.exports=function(t){return 2*(t.width+t.height)}},85133(t,e,i){var r=i(26099),s=i(39506);t.exports=function(t,e,i){void 0===i&&(i=new r),e=s(e);var n=Math.sin(e),a=Math.cos(e),o=a>0?t.width/2:t.width/-2,h=n>0?t.height/2:t.height/-2;return Math.abs(o*n)=this.right?this.width=0:this.width=this.right-t,this.x=t}},right:{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}},top:{get:function(){return this.y},set:function(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}},bottom:{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=u},94845(t){t.exports=function(t,e){return t.width===e.width&&t.height===e.height}},31730(t){t.exports=function(t,e,i){return void 0===i&&(i=e),t.width*=e,t.height*=i,t}},36899(t,e,i){var r=i(87841);t.exports=function(t,e,i){void 0===i&&(i=new r);var s=Math.min(t.x,e.x),n=Math.min(t.y,e.y),a=Math.max(t.right,e.right)-s,o=Math.max(t.bottom,e.bottom)-n;return i.setTo(s,n,a,o)}},93232(t,e,i){var r=i(87841);r.Area=i(39843),r.Ceil=i(98615),r.CeilAll=i(31688),r.CenterOn=i(67502),r.Clone=i(65085),r.Contains=i(37303),r.ContainsPoint=i(96553),r.ContainsRect=i(70273),r.CopyFrom=i(43459),r.Decompose=i(77493),r.Equals=i(9219),r.FitInside=i(53751),r.FitOutside=i(16088),r.Floor=i(80774),r.FloorAll=i(83859),r.FromPoints=i(19217),r.FromXY=i(9477),r.GetAspectRatio=i(8249),r.GetCenter=i(27165),r.GetPoint=i(20812),r.GetPoints=i(34819),r.GetSize=i(51313),r.Inflate=i(86091),r.Intersection=i(53951),r.MarchingAnts=i(14649),r.MergePoints=i(33595),r.MergeRect=i(20074),r.MergeXY=i(92171),r.Offset=i(42981),r.OffsetPoint=i(46907),r.Overlaps=i(60170),r.Perimeter=i(13019),r.PerimeterPoint=i(85133),r.Random=i(26597),r.RandomOutside=i(86470),r.SameDimensions=i(94845),r.Scale=i(31730),r.Union=i(36899),t.exports=r},41658(t){t.exports=function(t){var e=t.x1,i=t.y1,r=t.x2,s=t.y2,n=t.x3,a=t.y3;return Math.abs(((n-e)*(s-i)-(r-e)*(a-i))/2)}},39208(t,e,i){var r=i(16483);t.exports=function(t,e,i){var s=i*(Math.sqrt(3)/2);return new r(t,e,t+i/2,e+s,t-i/2,e+s)}},39545(t,e,i){var r=i(94811),s=i(16483);t.exports=function(t,e,i,n,a){void 0===e&&(e=null),void 0===i&&(i=1),void 0===n&&(n=1),void 0===a&&(a=[]);for(var o,h,l,u,d,c,f,p,g,m=r(t,e),v=0;v=0&&v>=0&&m+v<1}},48653(t){t.exports=function(t,e,i,r){void 0===i&&(i=!1),void 0===r&&(r=[]);for(var s,n,a,o,h,l,u=t.x3-t.x1,d=t.y3-t.y1,c=t.x2-t.x1,f=t.y2-t.y1,p=u*u+d*d,g=u*c+d*f,m=c*c+f*f,v=p*m-g*g,y=0===v?0:1/v,x=t.x1,T=t.y1,w=0;w=0&&n>=0&&s+n<1&&(r.push({x:e[w].x,y:e[w].y}),i)));w++);return r}},96006(t,e,i){var r=i(10690);t.exports=function(t,e){return r(t,e.x,e.y)}},71326(t){t.exports=function(t,e){return e.setTo(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)}},71694(t){t.exports=function(t,e){return void 0===e&&(e=[]),e.push({x:t.x1,y:t.y1}),e.push({x:t.x2,y:t.y2}),e.push({x:t.x3,y:t.y3}),e}},33522(t){t.exports=function(t,e){return t.x1===e.x1&&t.y1===e.y1&&t.x2===e.x2&&t.y2===e.y2&&t.x3===e.x3&&t.y3===e.y3}},20437(t,e,i){var r=i(26099),s=i(35001);t.exports=function(t,e,i){void 0===i&&(i=new r);var n=t.getLineA(),a=t.getLineB(),o=t.getLineC();if(e<=0||e>=1)return i.x=n.x1,i.y=n.y1,i;var h=s(n),l=s(a),u=s(o),d=(h+l+u)*e,c=0;return dh+l?(c=(d-=h+l)/u,i.x=o.x1+(o.x2-o.x1)*c,i.y=o.y1+(o.y2-o.y1)*c):(c=(d-=h)/l,i.x=a.x1+(a.x2-a.x1)*c,i.y=a.y1+(a.y2-a.y1)*c),i}},80672(t,e,i){var r=i(35001),s=i(26099);t.exports=function(t,e,i,n){void 0===n&&(n=[]);var a=t.getLineA(),o=t.getLineB(),h=t.getLineC(),l=r(a),u=r(o),d=r(h),c=l+u+d;!e&&i>0&&(e=c/i);for(var f=0;fl+u?(g=(p-=l+u)/d,m.x=h.x1+(h.x2-h.x1)*g,m.y=h.y1+(h.y2-h.y1)*g):(g=(p-=l)/u,m.x=o.x1+(o.x2-o.x1)*g,m.y=o.y1+(o.y2-o.y1)*g),n.push(m)}return n}},39757(t,e,i){var r=i(26099);function s(t,e,i,r){var s=t-i,n=e-r,a=s*s+n*n;return Math.sqrt(a)}t.exports=function(t,e){void 0===e&&(e=new r);var i=t.x1,n=t.y1,a=t.x2,o=t.y2,h=t.x3,l=t.y3,u=s(h,l,a,o),d=s(i,n,h,l),c=s(a,o,i,n),f=u+d+c;return e.x=(i*u+a*d+h*c)/f,e.y=(n*u+o*d+l*c)/f,e}},13584(t){t.exports=function(t,e,i){return t.x1+=e,t.y1+=i,t.x2+=e,t.y2+=i,t.x3+=e,t.y3+=i,t}},1376(t,e,i){var r=i(35001);t.exports=function(t){var e=t.getLineA(),i=t.getLineB(),s=t.getLineC();return r(e)+r(i)+r(s)}},90260(t,e,i){var r=i(26099);t.exports=function(t,e){void 0===e&&(e=new r);var i=t.x2-t.x1,s=t.y2-t.y1,n=t.x3-t.x1,a=t.y3-t.y1,o=Math.random(),h=Math.random();return o+h>=1&&(o=1-o,h=1-h),e.x=t.x1+(i*o+n*h),e.y=t.y1+(s*o+a*h),e}},52172(t,e,i){var r=i(99614),s=i(39757);t.exports=function(t,e){var i=s(t);return r(t,i.x,i.y,e)}},49907(t,e,i){var r=i(99614);t.exports=function(t,e,i){return r(t,e.x,e.y,i)}},99614(t){t.exports=function(t,e,i,r){var s=Math.cos(r),n=Math.sin(r),a=t.x1-e,o=t.y1-i;return t.x1=a*s-o*n+e,t.y1=a*n+o*s+i,a=t.x2-e,o=t.y2-i,t.x2=a*s-o*n+e,t.y2=a*n+o*s+i,a=t.x3-e,o=t.y3-i,t.x3=a*s-o*n+e,t.y3=a*n+o*s+i,t}},16483(t,e,i){var r=i(83419),s=i(10690),n=i(20437),a=i(80672),o=i(23777),h=i(23031),l=i(90260),u=new r({initialize:function(t,e,i,r,s,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===s&&(s=0),void 0===n&&(n=0),this.type=o.TRIANGLE,this.x1=t,this.y1=e,this.x2=i,this.y2=r,this.x3=s,this.y3=n},contains:function(t,e){return s(this,t,e)},getPoint:function(t,e){return n(this,t,e)},getPoints:function(t,e,i){return a(this,t,e,i)},getRandomPoint:function(t){return l(this,t)},setTo:function(t,e,i,r,s,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===s&&(s=0),void 0===n&&(n=0),this.x1=t,this.y1=e,this.x2=i,this.y2=r,this.x3=s,this.y3=n,this},getLineA:function(t){return void 0===t&&(t=new h),t.setTo(this.x1,this.y1,this.x2,this.y2),t},getLineB:function(t){return void 0===t&&(t=new h),t.setTo(this.x2,this.y2,this.x3,this.y3),t},getLineC:function(t){return void 0===t&&(t=new h),t.setTo(this.x3,this.y3,this.x1,this.y1),t},left:{get:function(){return Math.min(this.x1,this.x2,this.x3)},set:function(t){var e=0;e=this.x1<=this.x2&&this.x1<=this.x3?this.x1-t:this.x2<=this.x1&&this.x2<=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},right:{get:function(){return Math.max(this.x1,this.x2,this.x3)},set:function(t){var e=0;e=this.x1>=this.x2&&this.x1>=this.x3?this.x1-t:this.x2>=this.x1&&this.x2>=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},top:{get:function(){return Math.min(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1<=this.y2&&this.y1<=this.y3?this.y1-t:this.y2<=this.y1&&this.y2<=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}},bottom:{get:function(){return Math.max(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1>=this.y2&&this.y1>=this.y3?this.y1-t:this.y2>=this.y1&&this.y2>=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}}});t.exports=u},84435(t,e,i){var r=i(16483);r.Area=i(41658),r.BuildEquilateral=i(39208),r.BuildFromPolygon=i(39545),r.BuildRight=i(90301),r.CenterOn=i(23707),r.Centroid=i(97523),r.CircumCenter=i(24951),r.CircumCircle=i(85614),r.Clone=i(74422),r.Contains=i(10690),r.ContainsArray=i(48653),r.ContainsPoint=i(96006),r.CopyFrom=i(71326),r.Decompose=i(71694),r.Equals=i(33522),r.GetPoint=i(20437),r.GetPoints=i(80672),r.InCenter=i(39757),r.Perimeter=i(1376),r.Offset=i(13584),r.Random=i(90260),r.Rotate=i(52172),r.RotateAroundPoint=i(49907),r.RotateAroundXY=i(99614),t.exports=r},74457(t){t.exports=function(t,e,i){return{gameObject:t,enabled:!0,draggable:!1,dropZone:!1,cursor:!1,target:null,camera:null,hitArea:e,hitAreaCallback:i,hitAreaDebug:null,customHitArea:!1,localX:0,localY:0,dragState:0,dragStartX:0,dragStartY:0,dragStartXGlobal:0,dragStartYGlobal:0,dragStartCamera:null,dragX:0,dragY:0}}},84409(t){t.exports=function(t,e){return function(i,r,s,n){var a=t.getPixelAlpha(r,s,n.texture.key,n.frame.name);return a&&a>=e}}},7003(t,e,i){var r=i(83419),s=i(93301),n=i(50792),a=i(8214),o=i(8443),h=i(78970),l=i(85098),u=i(42515),d=i(36210),c=i(61340),f=i(85955),p=new r({initialize:function(t,e){this.game=t,this.scaleManager,this.canvas,this.config=e,this.enabled=!0,this.events=new n,this.isOver=!0,this.defaultCursor="",this.keyboard=e.inputKeyboard?new h(this):null,this.mouse=e.inputMouse?new l(this):null,this.touch=e.inputTouch?new d(this):null,this.pointers=[],this.pointersTotal=e.inputActivePointers;for(var i=0;i<=this.pointersTotal;i++){var r=new u(this,i);r.smoothFactor=e.inputSmoothFactor,this.pointers.push(r)}this.mousePointer=e.inputMouse?this.pointers[0]:null,this.activePointer=this.pointers[0],this.globalTopOnly=!0,this.time=0,this._tempPoint={x:0,y:0},this._tempHitTest=[],this._tempMatrix=new c,this._tempMatrix2=new c,this._tempSkip=!1,this.mousePointerContainer=[this.mousePointer],t.events.once(o.BOOT,this.boot,this)},boot:function(){var t=this.game,e=t.events;this.canvas=t.canvas,this.scaleManager=t.scale,this.events.emit(a.MANAGER_BOOT),e.on(o.PRE_RENDER,this.preRender,this),e.once(o.DESTROY,this.destroy,this)},setCanvasOver:function(t){this.isOver=!0,this.events.emit(a.GAME_OVER,t)},setCanvasOut:function(t){this.isOver=!1,this.events.emit(a.GAME_OUT,t)},preRender:function(){var t=this.game.loop.now,e=this.game.loop.delta,i=this.game.scene.getScenes(!0,!0);this.time=t,this.events.emit(a.MANAGER_UPDATE);for(var r=0;r10&&(t=10-this.pointersTotal);for(var i=0;i-1&&(s.splice(o,1),this.clear(a,!0))}this._pendingRemoval.length=0,this._list=s.concat(e.splice(0))}},isActive:function(){return this.manager&&this.manager.enabled&&this.enabled&&this.scene.sys.canInput()},setCursor:function(t){this.manager&&this.manager.setCursor(t)},resetCursor:function(){this.manager&&this.manager.resetCursor(null,!0)},updatePoll:function(t,e){if(!this.isActive())return!1;if(this.pluginEvents.emit(c.UPDATE,t,e),this._updatedThisFrame)return this._updatedThisFrame=!1,!1;var i,r=this.manager.pointers;for(i=0;i0){if(this._pollTimer-=e,!(this._pollTimer<0))return!1;this._pollTimer=this.pollRate}var n=!1;for(i=0;i0&&(n=!0)}return n},update:function(t,e){if(!this.isActive())return!1;for(var i=!1,r=0;r0&&(i=!0)}return this._updatedThisFrame=!0,i},clear:function(t,e){void 0===e&&(e=!1),this.disable(t);var i=t.input;i&&(this.removeDebug(t),this.manager.resetCursor(i),i.gameObject=void 0,i.target=void 0,i.hitArea=void 0,i.hitAreaCallback=void 0,i.callbackContext=void 0,t.input=null),e||this.queueForRemoval(t);var r=this._draggable.indexOf(t);return r>-1&&this._draggable.splice(r,1),t},disable:function(t,e){void 0===e&&(e=!1);var i=t.input;i&&(i.enabled=!1,i.dragState=0);for(var r,s=this._drag,n=this._over,a=this.manager,o=0;o-1&&s[o].splice(r,1),(r=n[o].indexOf(t))>-1&&n[o].splice(r,1);return e&&this.resetCursor(),this},enable:function(t,e,i,r){return void 0===r&&(r=!1),t.input?t.input.enabled=!0:this.setHitArea(t,e,i),t.input&&r&&!t.input.dropZone&&(t.input.dropZone=r),this},hitTestPointer:function(t){for(var e=this.cameras.getCamerasBelowPointer(t),i=0;i0)return t.camera=r,s}return t.camera=e[0],[]},processDownEvents:function(t){var e=0,i=this._temp,r=this._eventData,s=this._eventContainer;r.cancelled=!1;for(var n=0;n0&&l(t.x,t.y,t.downX,t.downY)>=s||r>0&&e>=t.downTime+r)&&(i=!0),i)return this.setDragState(t,3),this.processDragStartList(t)},processDragStartList:function(t){if(3!==this.getDragState(t))return 0;var e=this._drag[t.id];e.length>1&&(e=e.slice(0));for(var i=0;i1&&(this.sortGameObjects(i,t),this.topOnly&&i.splice(1)),this._drag[t.id]=i,0===this.dragDistanceThreshold&&0===this.dragTimeThreshold?(this.setDragState(t,3),this.processDragStartList(t)):(this.setDragState(t,2),0))},processDragMoveEvent:function(t){if(2===this.getDragState(t)&&this.processDragThresholdEvent(t,this.manager.game.loop.now),4!==this.getDragState(t))return 0;var e=this._tempZones,i=this._drag[t.id];i.length>1&&(i=i.slice(0));for(var r=0;r0?(a.emit(c.GAMEOBJECT_DRAG_LEAVE,t,h),this.emit(c.DRAG_LEAVE,t,a,h),o.target=e[0],h=o.target,a.emit(c.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(c.DRAG_ENTER,t,a,h)):(a.emit(c.GAMEOBJECT_DRAG_LEAVE,t,h),this.emit(c.DRAG_LEAVE,t,a,h),e[0]?(o.target=e[0],h=o.target,a.emit(c.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(c.DRAG_ENTER,t,a,h)):o.target=null)}else!h&&e[0]&&(o.target=e[0],h=o.target,a.emit(c.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(c.DRAG_ENTER,t,a,h));var u=t.positionToCamera(o.dragStartCamera);if(a.parentContainer){var d=u.x-o.dragStartXGlobal,f=u.y-o.dragStartYGlobal,p=a.getParentRotation(),g=d*Math.cos(p)+f*Math.sin(p),m=f*Math.cos(p)-d*Math.sin(p);g*=1/a.parentContainer.scaleX,m*=1/a.parentContainer.scaleY,s=g+o.dragStartX,n=m+o.dragStartY}else s=u.x-o.dragX,n=u.y-o.dragY;a.emit(c.GAMEOBJECT_DRAG,t,s,n),this.emit(c.DRAG,t,a,s,n)}return i.length},processDragUpEvent:function(t){var e=this._drag[t.id];e.length>1&&(e=e.slice(0));for(var i=0;i0){var n=this.manager,a=this._eventData,o=this._eventContainer;a.cancelled=!1;for(var h=0;h0){var s=this.manager,n=this._eventData,a=this._eventContainer;n.cancelled=!1,this.sortGameObjects(e,t);for(var o=0;o0){for(this.sortGameObjects(s,t),e=0;e0){for(this.sortGameObjects(n,t),e=0;e-1&&this._draggable.splice(s,1)}return this},makePixelPerfect:function(t){void 0===t&&(t=1);var e=this.systems.textures;return h(e,t)},setHitArea:function(t,e,i){if(void 0===e)return this.setHitAreaFromTexture(t);Array.isArray(t)||(t=[t]);var r=!1,s=!1,n=!1,a=!1,h=!1,l=!0;if(v(e)&&Object.keys(e).length){var u=e;e=p(u,"hitArea",null),i=p(u,"hitAreaCallback",null),h=p(u,"pixelPerfect",!1);var d=p(u,"alphaTolerance",1);h&&(e={},i=this.makePixelPerfect(d)),r=p(u,"draggable",!1),s=p(u,"dropZone",!1),n=p(u,"cursor",!1),a=p(u,"useHandCursor",!1),e&&i||(this.setHitAreaFromTexture(t),l=!1)}else"function"!=typeof e||i||(i=e,e={});for(var c=0;c=this.threshold?this.pressed||(this.pressed=!0,this.events.emit(s.BUTTON_DOWN,e,this,t),this.pad.emit(s.GAMEPAD_BUTTON_DOWN,i,t,this)):this.pressed&&(this.pressed=!1,this.events.emit(s.BUTTON_UP,e,this,t),this.pad.emit(s.GAMEPAD_BUTTON_UP,i,t,this))},destroy:function(){this.pad=null,this.events=null}});t.exports=n},99125(t,e,i){var r=i(97421),s=i(28884),n=i(83419),a=i(50792),o=i(26099),h=new n({Extends:a,initialize:function(t,e){a.call(this),this.manager=t,this.pad=e,this.id=e.id,this.index=e.index;for(var i=[],n=0;n=.5));this.buttons=i;var h=[];for(n=0;n=2&&(this.leftStick.set(n[0].getValue(),n[1].getValue()),s>=4&&this.rightStick.set(n[2].getValue(),n[3].getValue()))}},destroy:function(){var t;for(this.removeAllListeners(),this.manager=null,this.pad=null,t=0;t-1&&e.preventDefault()}},this.onKeyUp=function(e){if(!e.defaultPrevented&&t.enabled&&t.manager){t.queue.push(e),t.manager.events.emit(a.MANAGER_PROCESS);var i=e.altKey||e.ctrlKey||e.shiftKey||e.metaKey;t.preventDefault&&!i&&t.captures.indexOf(e.keyCode)>-1&&e.preventDefault()}};var e=this.target;e&&(e.addEventListener("keydown",this.onKeyDown,!1),e.addEventListener("keyup",this.onKeyUp,!1),this.enabled=!0)},stopListeners:function(){var t=this.target;t.removeEventListener("keydown",this.onKeyDown,!1),t.removeEventListener("keyup",this.onKeyUp,!1),this.enabled=!1},postUpdate:function(){this.queue=[]},addCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i0},removeCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i0},clearCaptures:function(){this.captures=[],this.preventDefault=!1},destroy:function(){this.stopListeners(),this.clearCaptures(),this.queue=[],this.manager.game.events.off(n.POST_STEP,this.postUpdate,this),this.target=null,this.enabled=!1,this.manager=null}});t.exports=l},28846(t,e,i){var r=i(83419),s=i(50792),n=i(95922),a=i(8443),o=i(35154),h=i(8214),l=i(89639),u=i(30472),d=i(46032),c=i(87960),f=i(74600),p=i(44594),g=i(56583),m=new r({Extends:s,initialize:function(t){s.call(this),this.game=t.systems.game,this.scene=t.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=t,this.manager=t.manager.keyboard,this.enabled=!0,this.keys=[],this.combos=[],this.prevCode=null,this.prevTime=0,this.prevType=null,t.pluginEvents.once(h.BOOT,this.boot,this),t.pluginEvents.on(h.START,this.start,this)},boot:function(){var t=this.settings.input;this.enabled=o(t,"keyboard",!0);var e=o(t,"keyboard.capture",null);e&&this.addCaptures(e),this.sceneInputPlugin.pluginEvents.once(h.DESTROY,this.destroy,this)},start:function(){this.sceneInputPlugin.manager.events.on(h.MANAGER_PROCESS,this.update,this),this.sceneInputPlugin.pluginEvents.once(h.SHUTDOWN,this.shutdown,this),this.game.events.on(a.BLUR,this.resetKeys,this),this.scene.sys.events.on(p.PAUSE,this.resetKeys,this),this.scene.sys.events.on(p.SLEEP,this.resetKeys,this)},isActive:function(){return this.enabled&&this.scene.sys.canInput()},addCapture:function(t){return this.manager.addCapture(t),this},removeCapture:function(t){return this.manager.removeCapture(t),this},getCaptures:function(){return this.manager.captures},enableGlobalCapture:function(){return this.manager.preventDefault=!0,this},disableGlobalCapture:function(){return this.manager.preventDefault=!1,this},clearCaptures:function(){return this.manager.clearCaptures(),this},createCursorKeys:function(){return this.addKeys({up:d.UP,down:d.DOWN,left:d.LEFT,right:d.RIGHT,space:d.SPACE,shift:d.SHIFT})},addKeys:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!1);var r={};if("string"==typeof t){t=t.split(",");for(var s=0;s-1?r[s]=t:r[t.keyCode]=t,e&&this.addCapture(t.keyCode),t.setEmitOnRepeat(i),t}return"string"==typeof t&&(t=d[t.toUpperCase()]),r[t]||(r[t]=new u(this,t),e&&this.addCapture(t),r[t].setEmitOnRepeat(i)),r[t]},removeKey:function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var r,s=this.keys;if(t instanceof u){var n=s.indexOf(t);n>-1&&(r=this.keys[n],this.keys[n]=void 0)}else"string"==typeof t&&(t=d[t.toUpperCase()]);return s[t]&&(r=s[t],s[t]=void 0),r&&(r.plugin=null,i&&this.removeCapture(r.keyCode),e&&r.destroy()),this},removeAllKeys:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1);for(var i=this.keys,r=0;rt._tick)return t._tick=i,!0}return!1},update:function(){var t=this.manager.queue,e=t.length;if(this.isActive()&&0!==e)for(var i=this.keys,r=0;r0&&e.maxKeyDelay>0){var n=e.timeLastMatched+e.maxKeyDelay;t.timeStamp<=n&&(s=!0,i=r(t,e))}else s=!0,i=r(t,e);return!s&&e.resetOnWrongKey&&(e.index=0,e.current=e.keyCodes[0]),i&&(e.timeLastMatched=t.timeStamp,e.matched=!0,e.timeMatched=t.timeStamp),i}},92803(t){t.exports=function(t){return t.current=t.keyCodes[0],t.index=0,t.timeLastMatched=0,t.matched=!1,t.timeMatched=0,t}},92612(t){t.exports="keydown"},23345(t){t.exports="keyup"},21957(t){t.exports="keycombomatch"},44743(t){t.exports="down"},3771(t){t.exports="keydown-"},46358(t){t.exports="keyup-"},75674(t){t.exports="up"},95922(t,e,i){t.exports={ANY_KEY_DOWN:i(92612),ANY_KEY_UP:i(23345),COMBO_MATCH:i(21957),DOWN:i(44743),KEY_DOWN:i(3771),KEY_UP:i(46358),UP:i(75674)}},51442(t,e,i){t.exports={Events:i(95922),KeyboardManager:i(78970),KeyboardPlugin:i(28846),Key:i(30472),KeyCodes:i(46032),KeyCombo:i(87960),AdvanceKeyCombo:i(66970),ProcessKeyCombo:i(68769),ResetKeyCombo:i(92803),JustDown:i(90229),JustUp:i(38796),DownDuration:i(37015),UpDuration:i(41170)}},37015(t){t.exports=function(t,e){void 0===e&&(e=50);var i=t.plugin.game.loop.time-t.timeDown;return t.isDown&&i=400&&t.status<=599&&(r=!1),this.state=s.FILE_LOADED,this.resetXHR(),this.loader.nextFile(this,r)},onBase64Load:function(t){this.xhrLoader=t,this.state=s.FILE_LOADED,this.percentComplete=1,this.loader.emit(n.FILE_PROGRESS,this,this.percentComplete),this.loader.nextFile(this,!0)},onError:function(){this.resetXHR(),this.retryAttempts>0?(this.retryAttempts--,this.load()):this.loader.nextFile(this,!1)},onProgress:function(t){t.lengthComputable&&(this.bytesLoaded=t.loaded,this.bytesTotal=t.total,this.percentComplete=Math.min(this.bytesLoaded/this.bytesTotal,1),this.loader.emit(n.FILE_PROGRESS,this,this.percentComplete))},onProcess:function(){this.state=s.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=s.FILE_COMPLETE,this.multiFile&&this.multiFile.onFileComplete(this),this.loader.fileProcessComplete(this)},onProcessError:function(){console.error('Failed to process file: %s "%s"',this.type,this.key),this.state=s.FILE_ERRORED,this.multiFile&&this.multiFile.onFileFailed(this),this.loader.fileProcessComplete(this)},hasCacheConflict:function(){return this.cache&&this.cache.exists(this.key)},addToCache:function(){this.cache&&this.data&&this.cache.add(this.key,this.data)},pendingDestroy:function(t){if(this.state!==s.FILE_PENDING_DESTROY){void 0===t&&(t=this.data);var e=this.key,i=this.type;this.loader.emit(n.FILE_COMPLETE,e,i,t),this.loader.emit(n.FILE_KEY_COMPLETE+i+"-"+e,e,i,t),this.loader.flagForRemoval(this),this.state=s.FILE_PENDING_DESTROY}},destroy:function(){this.loader=null,this.cache=null,this.xhrSettings=null,this.multiFile=null,this.linkFile=null,this.data=null}});d.createObjectURL=function(t,e,i){if("function"==typeof URL)t.src=URL.createObjectURL(e);else{var r=new FileReader;r.onload=function(){t.removeAttribute("crossOrigin"),t.src="data:"+(e.type||i)+";base64,"+r.result.split(",")[1]},r.onerror=t.onerror,r.readAsDataURL(e)}},d.revokeObjectURL=function(t){"function"==typeof URL&&URL.revokeObjectURL(t.src)},t.exports=d},74099(t){var e={},i={install:function(t){for(var i in e)t[i]=e[i]},register:function(t,i){e[t]=i},destroy:function(){e={}}};t.exports=i},98356(t){t.exports=function(t,e){return!!t.url&&(t.url.match(/^(?:blob:|data:|capacitor:\/\/|file:\/\/|http:\/\/|https:\/\/|\/\/)/)?t.url:e+t.url)}},74261(t,e,i){var r=i(83419),s=i(23906),n=i(50792),a=i(54899),o=i(74099),h=i(95540),l=i(35154),u=i(41212),d=i(37277),c=i(44594),f=i(92638),p=new r({Extends:n,initialize:function(t){n.call(this);var e=t.sys.game.config,i=t.sys.settings.loader;this.scene=t,this.systems=t.sys,this.cacheManager=t.sys.cache,this.textureManager=t.sys.textures,this.sceneManager=t.sys.game.scene,o.install(this),this.prefix="",this.path="",this.baseURL="",this.setBaseURL(h(i,"baseURL",e.loaderBaseURL)),this.setPath(h(i,"path",e.loaderPath)),this.setPrefix(h(i,"prefix",e.loaderPrefix)),this.maxParallelDownloads=h(i,"maxParallelDownloads",e.loaderMaxParallelDownloads),this.xhr=f(h(i,"responseType",e.loaderResponseType),h(i,"async",e.loaderAsync),h(i,"user",e.loaderUser),h(i,"password",e.loaderPassword),h(i,"timeout",e.loaderTimeout),h(i,"withCredentials",e.loaderWithCredentials)),this.crossOrigin=h(i,"crossOrigin",e.loaderCrossOrigin),this.imageLoadType=h(i,"imageLoadType",e.loaderImageLoadType),this.localSchemes=h(i,"localScheme",e.loaderLocalScheme),this.totalToLoad=0,this.progress=0,this.list=new Set,this.inflight=new Set,this.queue=new Set,this._deleteQueue=new Set,this.totalFailed=0,this.totalComplete=0,this.state=s.LOADER_IDLE,this.multiKeyIndex=0,this.maxRetries=h(i,"maxRetries",e.loaderMaxRetries),t.sys.events.once(c.BOOT,this.boot,this),t.sys.events.on(c.START,this.pluginStart,this)},boot:function(){this.systems.events.once(c.DESTROY,this.destroy,this)},pluginStart:function(){this.systems.events.once(c.SHUTDOWN,this.shutdown,this)},setBaseURL:function(t){return void 0===t&&(t=""),""!==t&&"/"!==t.substr(-1)&&(t=t.concat("/")),this.baseURL=t,this},setPath:function(t){return void 0===t&&(t=""),""!==t&&"/"!==t.substr(-1)&&(t=t.concat("/")),this.path=t,this},setPrefix:function(t){return void 0===t&&(t=""),this.prefix=t,this},setCORS:function(t){return this.crossOrigin=t,this},addFile:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e0},removePack:function(t,e){var i,r=this.systems.anims,s=this.cacheManager,n=this.textureManager,a={animation:"json",aseprite:"json",audio:"audio",audioSprite:"audio",binary:"binary",bitmapFont:"bitmapFont",css:null,glsl:"shader",html:"html",json:"json",obj:"obj",plugin:null,scenePlugin:null,script:null,spine:"json",text:"text",tilemapCSV:"tilemap",tilemapImpact:"tilemap",tilemapTiledJSON:"tilemap",video:"video",xml:"xml"};if(u(t))i=t;else if(!(i=s.json.get(t)))return void console.warn("Asset Pack not found in JSON cache:",t);for(var o in e&&(i={_:i[e]}),i){var l=i[o],d=h(l,"prefix",""),c=h(l,"files"),f=h(l,"defaultType");if(Array.isArray(c))for(var p=0;p0&&this.inflight.size'),i.push(''),i.push(''),i.push(this.xhrLoader.responseText),i.push(""),i.push(""),i.push("");var r=[i.join("\n")],a=this;try{var o=new window.Blob(r,{type:"image/svg+xml;charset=utf-8"})}catch(t){return a.state=s.FILE_ERRORED,void a.onProcessComplete()}this.data=new Image,this.data.crossOrigin=this.crossOrigin,this.data.onload=function(){n.revokeObjectURL(a.data),a.onProcessComplete()},this.data.onerror=function(){n.revokeObjectURL(a.data),a.onProcessError()},n.createObjectURL(this.data,o,"image/svg+xml")},addToCache:function(){this.cache.addImage(this.key,this.data)}});a.register("htmlTexture",function(t,e,i,r,s){if(Array.isArray(t))for(var n=0;n=s.FILE_COMPLETE&&("spritesheet"===t.type?t.addToCache():"normalMap"===this.type?this.cache.addImage(this.key,t.data,this.data):this.cache.addImage(this.key,this.data,t.data)):this.cache.addImage(this.key,this.data)}});a.register("image",function(t,e,i){if(Array.isArray(t))for(var r=0;r=0?a.substring(o+i.length):a]=n.data}for(var h=[],l=0;l=s.FILE_COMPLETE&&("normalMap"===this.type?this.cache.addSpriteSheet(this.key,t.data,this.config,this.data):this.cache.addSpriteSheet(this.key,this.data,this.config,t.data)):this.cache.addSpriteSheet(this.key,this.data,this.config)}});n.register("spritesheet",function(t,e,i,r){if(Array.isArray(t))for(var s=0;si&&(i=h.x),h.xn&&(n=h.y),h.y>>0)+2891336453,s=277803737*(r>>>(r>>>28)+4^r),n=(s>>>22^s)>>>0;return n/=f};t.exports=function(t,e){switch("number"==typeof t&&(t=[t]),e){case 2:return p(t,!0);case 1:return p(t);default:return c(t)}}},84854(t,e,i){var r=i(72958),s=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16],n=Array(4),a=Array(4),o=Array(4),h=Array(4),l=Array(4),u=Array(4),d=function(t,e,i){var r,s,h,l,u=e.noiseMode||0,d=void 0===e.noiseSmoothing?1:e.noiseSmoothing,p=Math.max(1,Math.min(t.length,4)),g=e.noiseCells||[32,32,32,32].slice(0,p);for(r=0;r1&&(o[1]=Math.floor(l/3)%3-1,p>2&&(o[2]=Math.floor(l/9)%3-1,p>3&&(o[3]=Math.floor(l/27)%3-1))),s=c(p,n,o,e,i),h=f(p,o,a,s),u){case 0:h0||e[1]>0)for(j[0]=U.x,j[1]=z.x,j[2]=Y.x,q[0]=U.y,q[1]=z.y,q[2]=Y.y,e[0]>0&&(j[0]=(U.x%e[0]+e[0])%e[0],j[1]=(z.x%e[0]+e[0])%e[0],j[2]=(Y.x%e[0]+e[0])%e[0]),e[1]>0&&(q[0]=(U.y%e[1]+e[1])%e[1],q[1]=(z.y%e[1]+e[1])%e[1],q[2]=(Y.y%e[1]+e[1])%e[1]),r=0;r<3;r++)V[r]=Math.floor(j[r]+.5*q[r]+.5),H[r]=Math.floor(q[r]+.5);else V[0]=n.x,V[1]=B.x,V[2]=k.x,H[0]=n.y,H[1]=B.y,H[2]=k.y;for(V[0]+=a[0],V[1]+=a[0],V[2]+=a[0],H[0]+=a[1],H[1]+=a[1],H[2]+=a[1],r=0;r<3;r++)K[r]=V[r]%289,K[r]<0&&(K[r]+=289);for(r=0;r<3;r++)K[r]=((51*K[r]+2)*K[r]+H[r])%289;for(r=0;r<3;r++)K[r]=(34*K[r]+10)*K[r]%289;for(r=0;r<3;r++)Z[r]=.07482*K[r]+i,Q[r]=Math.cos(Z[r]),J[r]=Math.sin(Z[r]);for($.x=Q[0],$.y=J[0],tt.x=Q[1],tt.y=J[1],et.x=Q[2],et.y=J[2],it[0]=.8-I(X,X),it[1]=.8-I(W,W),it[2]=.8-I(G,G),r=0;r<3;r++)it[r]=Math.max(it[r],0),rt[r]=it[r]*it[r],st[r]=rt[r]*rt[r];return nt[0]=I($,X),nt[1]=I(tt,W),nt[2]=I(et,G),10.9*(st[0]*nt[0]+st[1]*nt[1]+st[2]*nt[2])},B=[0,0,0],k=[0,0,0],U=[0,0,0],z=[0,0,0],Y=[0,0,0],X=[0,0,0],W=[0,0,0],G=[0,0,0],V=[0,0,0],H=[0,0,0],j=[0,0,0],q=[0,0,0],K=[0,0,0],Z=[0,0,0],Q=[0,0,0],J=[0,0,0],$=[0,0,0],tt=[0,0,0],et=[0,0,0],it=[0,0,0],rt=[0,0,0,0],st=[0,0,0,0],nt=[0,0,0,0],at=[0,0,0,0],ot=[0,0,0,0],ht=[0,0,0,0],lt=[0,0,0,0],ut=[0,0,0,0],dt=[0,0,0,0],ct=[0,0,0,0],ft=[0,0,0,0],pt=[0,0,0,0],gt=[0,0,0,0],mt=[0,0,0,0],vt=[0,0,0,0],yt=[0,0,0,0],xt=[0,0,0,0],Tt=[0,0,0,0],wt=[0,0,0,0],bt=[0,0,0,0],St=[0,0,0,0],Ct=[0,0,0,0],Et=[0,0,0,0],At=[0,0,0,0],_t=[0,0,0,0],Mt=[0,0,0,0],Rt=[0,0,0,0],Pt=[0,0,0,0],Ot=function(t,e){for(var i=0;i<4;i++){var r=t[i]%289;r<0&&(r+=289),e[i]=(34*r+10)*r%289}},Lt=function(t,e,i){var r=B,s=k,n=U,o=z,h=Y,l=X,u=W,d=G,c=V,f=H,p=j,g=q,m=K,v=Z,y=Q,x=J,T=$,w=tt,b=et,S=it,C=rt,E=st,A=nt,_=at,M=ot,R=ht,P=lt,O=ut,L=dt,F=ct,D=ft,I=pt,N=gt,Lt=mt,Ft=vt,Dt=yt,It=xt,Nt=Tt,Bt=wt,kt=bt,Ut=St,zt=Ct,Yt=Et,Xt=At,Wt=_t,Gt=Mt,Vt=Rt,Ht=Pt;r[0]=0*t[0]+1*t[1]+1*t[2],r[1]=1*t[0]+0*t[1]+1*t[2],r[2]=1*t[0]+1*t[1]+0*t[2];for(var jt=0;jt<3;jt++)s[jt]=Math.floor(r[jt]),n[jt]=r[jt]-s[jt];for(o[0]=n[0]>n[1]?0:1,o[1]=n[1]>n[2]?0:1,o[2]=n[0]>n[2]?0:1,h[0]=1-o[0],h[1]=1-o[1],h[2]=1-o[2],l[0]=h[2],l[1]=o[0],l[2]=o[1],u[0]=h[0],u[1]=h[1],u[2]=o[2],jt=0;jt<3;jt++)d[jt]=Math.min(l[jt],u[jt]),c[jt]=Math.max(l[jt],u[jt]);for(jt=0;jt<3;jt++)f[jt]=s[jt]+d[jt],p[jt]=s[jt]+c[jt],g[jt]=s[jt]+1;var qt=s[0],Kt=s[1],Zt=s[2],Qt=f[0],Jt=f[1],$t=f[2],te=p[0],ee=p[1],ie=p[2],re=g[0],se=g[1],ne=g[2];for(m[0]=-.5*qt+.5*Kt+.5*Zt,m[1]=.5*qt-.5*Kt+.5*Zt,m[2]=.5*qt+.5*Kt-.5*Zt,v[0]=-.5*Qt+.5*Jt+.5*$t,v[1]=.5*Qt-.5*Jt+.5*$t,v[2]=.5*Qt+.5*Jt-.5*$t,y[0]=-.5*te+.5*ee+.5*ie,y[1]=.5*te-.5*ee+.5*ie,y[2]=.5*te+.5*ee-.5*ie,x[0]=-.5*re+.5*se+.5*ne,x[1]=.5*re-.5*se+.5*ne,x[2]=.5*re+.5*se-.5*ne,jt=0;jt<3;jt++)T[jt]=t[jt]-m[jt],w[jt]=t[jt]-v[jt],b[jt]=t[jt]-y[jt],S[jt]=t[jt]-x[jt];if(e[0]>0||e[1]>0||e[2]>0){if(C[0]=m[0],C[1]=v[0],C[2]=y[0],C[3]=x[0],E[0]=m[1],E[1]=v[1],E[2]=y[1],E[3]=x[1],A[0]=m[2],A[1]=v[2],A[2]=y[2],A[3]=x[2],e[0]>0)for(jt=0;jt<4;jt++)C[jt]=(C[jt]%e[0]+e[0])%e[0];if(e[1]>0)for(jt=0;jt<4;jt++)E[jt]=(E[jt]%e[1]+e[1])%e[1];if(e[2]>0)for(jt=0;jt<4;jt++)A[jt]=(A[jt]%e[2]+e[2])%e[2];var ae=C[0],oe=E[0],he=A[0],le=C[1],ue=E[1],de=A[1],ce=C[2],fe=E[2],pe=A[2],ge=C[3],me=E[3],ve=A[3];s[0]=Math.floor(0*ae+1*oe+1*he+.5),s[1]=Math.floor(1*ae+0*oe+1*he+.5),s[2]=Math.floor(1*ae+1*oe+0*he+.5),f[0]=Math.floor(0*le+1*ue+1*de+.5),f[1]=Math.floor(1*le+0*ue+1*de+.5),f[2]=Math.floor(1*le+1*ue+0*de+.5),p[0]=Math.floor(0*ce+1*fe+1*pe+.5),p[1]=Math.floor(1*ce+0*fe+1*pe+.5),p[2]=Math.floor(1*ce+1*fe+0*pe+.5),g[0]=Math.floor(0*ge+1*me+1*ve+.5),g[1]=Math.floor(1*ge+0*me+1*ve+.5),g[2]=Math.floor(1*ge+1*me+0*ve+.5)}s[0]+=a[0],s[1]+=a[1],s[2]+=a[2],f[0]+=a[0],f[1]+=a[1],f[2]+=a[2],p[0]+=a[0],p[1]+=a[1],p[2]+=a[2],g[0]+=a[0],g[1]+=a[1],g[2]+=a[2];var ye=rt,xe=st;for(ye[0]=s[2],ye[1]=f[2],ye[2]=p[2],ye[3]=g[2],Ot(ye,xe),xe[0]+=s[1],xe[1]+=f[1],xe[2]+=p[1],xe[3]+=g[1],Ot(xe,ye),ye[0]+=s[0],ye[1]+=f[0],ye[2]+=p[0],ye[3]+=g[0],Ot(ye,_),jt=0;jt<4;jt++)M[jt]=3.883222077*_[jt],R[jt]=.996539792-.006920415*_[jt],P[jt]=.108705628*_[jt],O[jt]=Math.cos(M[jt]),L[jt]=Math.sin(M[jt]),F[jt]=Math.sqrt(Math.max(0,1-R[jt]*R[jt]));if(0!==i)for(jt=0;jt<4;jt++)Lt[jt]=O[jt]*F[jt],Ft[jt]=L[jt]*F[jt],Dt[jt]=R[jt],It[jt]=Math.sin(P[jt]),Nt[jt]=Math.cos(P[jt]),Bt[jt]=L[jt]*It[jt]-O[jt]*Nt[jt],kt[jt]=(1-R[jt])*(Bt[jt]*L[jt])+R[jt]*It[jt],Ut[jt]=(1-R[jt])*(-Bt[jt]*O[jt])+R[jt]*Nt[jt],zt[jt]=-(Ft[jt]*Nt[jt]+Lt[jt]*It[jt]),Yt[jt]=Math.sin(i),Xt[jt]=Math.cos(i),D[jt]=Xt[jt]*Lt[jt]+Yt[jt]*kt[jt],I[jt]=Xt[jt]*Ft[jt]+Yt[jt]*Ut[jt],N[jt]=Xt[jt]*Dt[jt]+Yt[jt]*zt[jt];else for(jt=0;jt<4;jt++)D[jt]=O[jt]*F[jt],I[jt]=L[jt]*F[jt],N[jt]=R[jt];for(jt=0;jt<4;jt++){var Te=0===jt?T[0]:1===jt?w[0]:2===jt?b[0]:S[0],we=0===jt?T[1]:1===jt?w[1]:2===jt?b[1]:S[1],be=0===jt?T[2]:1===jt?w[2]:2===jt?b[2]:S[2],Se=Te*Te+we*we+be*be;Wt[jt]=.5-Se,Wt[jt]<0&&(Wt[jt]=0),Gt[jt]=Wt[jt]*Wt[jt],Vt[jt]=Gt[jt]*Wt[jt]}for(jt=0;jt<4;jt++){var Ce=D[jt],Ee=I[jt],Ae=N[jt],_e=0===jt?T[0]:1===jt?w[0]:2===jt?b[0]:S[0],Me=0===jt?T[1]:1===jt?w[1]:2===jt?b[1]:S[1],Re=0===jt?T[2]:1===jt?w[2]:2===jt?b[2]:S[2];Ht[jt]=Ce*_e+Ee*Me+Ae*Re}var Pe=0;for(jt=0;jt<4;jt++)Pe+=Vt[jt]*Ht[jt];return 39.5*Pe};t.exports=function(t,r){"number"==typeof t&&(t=[t]),r||(r={});for(var h=Math.min(3,t.length);h<2;)t.push(0),h++;var l=r.noiseIterations||1,u=r.noiseWarpIterations||1,d=r.noiseDetailPower||2,c=r.noiseFlowPower||2,f=r.noiseContributionPower||2,p=r.noiseWarpDetailPower||2,g=r.noiseWarpFlowPower||2,m=r.noiseWarpContributionPower||2,v=r.noiseCells||[32,32,32],y=r.noiseOffset||[0,0,0],x=r.noiseWarpAmount||0;if(r.noiseSeed)for(var T=[1,2,3],w=0;w0&&u>0&&h>=2)if(2===h){var b=o(u,2,e,r,p,g,m);i[0]=e[0]+s[0],i[1]=e[1]+s[1];var S=o(u,2,i,r,p,g,m);e[0]+=b*x,e[1]+=S*x}else if(3===h){var C=o(u,3,e,r,p,g,m);i[0]=e[0]+s[0],i[1]=e[1]+s[1],i[2]=e[2]+s[2];var E=o(u,3,i,r,p,g,m);i[0]=e[0]+n[0],i[1]=e[1]+n[1],i[2]=e[2]+n[2];var A=o(u,3,i,r,p,g,m);e[0]+=C*x,e[1]+=E*x,e[2]+=A*x}return o(l,h,e,r,d,c,f)}},78702(t){t.exports=function(t){return t==parseFloat(t)?!(t%2):void 0}},94883(t){t.exports=function(t){return t===parseFloat(t)?!(t%2):void 0}},28915(t){t.exports=function(t,e,i){return(e-t)*i+t}},94908(t){t.exports=function(t,e,i){return void 0===i&&(i=0),t.clone().lerp(e,i)}},94434(t,e,i){var r=new(i(83419))({initialize:function(t){this.val=new Float32Array(9),t?this.copy(t):this.identity()},clone:function(){return new r(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this},fromMat4:function(t){var e=t.val,i=this.val;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[4],i[4]=e[5],i[5]=e[6],i[6]=e[8],i[7]=e[9],i[8]=e[10],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],r=t[5];return t[1]=t[3],t[2]=t[6],t[3]=e,t[5]=t[7],t[6]=i,t[7]=r,this},invert:function(){var t=this.val,e=t[0],i=t[1],r=t[2],s=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=l*n-a*h,d=-l*s+a*o,c=h*s-n*o,f=e*u+i*d+r*c;return f?(f=1/f,t[0]=u*f,t[1]=(-l*i+r*h)*f,t[2]=(a*i-r*n)*f,t[3]=d*f,t[4]=(l*e-r*o)*f,t[5]=(-a*e+r*s)*f,t[6]=c*f,t[7]=(-h*e+i*o)*f,t[8]=(n*e-i*s)*f,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],r=t[2],s=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return t[0]=n*l-a*h,t[1]=r*h-i*l,t[2]=i*a-r*n,t[3]=a*o-s*l,t[4]=e*l-r*o,t[5]=r*s-e*a,t[6]=s*h-n*o,t[7]=i*o-e*h,t[8]=e*n-i*s,this},determinant:function(){var t=this.val,e=t[0],i=t[1],r=t[2],s=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return e*(l*n-a*h)+i*(-l*s+a*o)+r*(h*s-n*o)},multiply:function(t){var e=this.val,i=e[0],r=e[1],s=e[2],n=e[3],a=e[4],o=e[5],h=e[6],l=e[7],u=e[8],d=t.val,c=d[0],f=d[1],p=d[2],g=d[3],m=d[4],v=d[5],y=d[6],x=d[7],T=d[8];return e[0]=c*i+f*n+p*h,e[1]=c*r+f*a+p*l,e[2]=c*s+f*o+p*u,e[3]=g*i+m*n+v*h,e[4]=g*r+m*a+v*l,e[5]=g*s+m*o+v*u,e[6]=y*i+x*n+T*h,e[7]=y*r+x*a+T*l,e[8]=y*s+x*o+T*u,this},translate:function(t){var e=this.val,i=t.x,r=t.y;return e[6]=i*e[0]+r*e[3]+e[6],e[7]=i*e[1]+r*e[4]+e[7],e[8]=i*e[2]+r*e[5]+e[8],this},rotate:function(t){var e=this.val,i=e[0],r=e[1],s=e[2],n=e[3],a=e[4],o=e[5],h=Math.sin(t),l=Math.cos(t);return e[0]=l*i+h*n,e[1]=l*r+h*a,e[2]=l*s+h*o,e[3]=l*n-h*i,e[4]=l*a-h*r,e[5]=l*o-h*s,this},scale:function(t){var e=this.val,i=t.x,r=t.y;return e[0]=i*e[0],e[1]=i*e[1],e[2]=i*e[2],e[3]=r*e[3],e[4]=r*e[4],e[5]=r*e[5],this},fromQuat:function(t){var e=t.x,i=t.y,r=t.z,s=t.w,n=e+e,a=i+i,o=r+r,h=e*n,l=e*a,u=e*o,d=i*a,c=i*o,f=r*o,p=s*n,g=s*a,m=s*o,v=this.val;return v[0]=1-(d+f),v[3]=l+m,v[6]=u-g,v[1]=l-m,v[4]=1-(h+f),v[7]=c+p,v[2]=u+g,v[5]=c-p,v[8]=1-(h+d),this},normalFromMat4:function(t){var e=t.val,i=this.val,r=e[0],s=e[1],n=e[2],a=e[3],o=e[4],h=e[5],l=e[6],u=e[7],d=e[8],c=e[9],f=e[10],p=e[11],g=e[12],m=e[13],v=e[14],y=e[15],x=r*h-s*o,T=r*l-n*o,w=r*u-a*o,b=s*l-n*h,S=s*u-a*h,C=n*u-a*l,E=d*m-c*g,A=d*v-f*g,_=d*y-p*g,M=c*v-f*m,R=c*y-p*m,P=f*y-p*v,O=x*P-T*R+w*M+b*_-S*A+C*E;return O?(O=1/O,i[0]=(h*P-l*R+u*M)*O,i[1]=(l*_-o*P-u*A)*O,i[2]=(o*R-h*_+u*E)*O,i[3]=(n*R-s*P-a*M)*O,i[4]=(r*P-n*_+a*A)*O,i[5]=(s*_-r*R-a*E)*O,i[6]=(m*C-v*S+y*b)*O,i[7]=(v*w-g*C-y*T)*O,i[8]=(g*S-m*w+y*x)*O,this):null}});t.exports=r},37867(t,e,i){var r=i(83419),s=i(25836),n=1e-6,a=new r({initialize:function(t){this.val=new Float32Array(16),t?this.copy(t):this.identity()},clone:function(){return new a(this)},set:function(t){return this.copy(t)},setValues:function(t,e,i,r,s,n,a,o,h,l,u,d,c,f,p,g){var m=this.val;return m[0]=t,m[1]=e,m[2]=i,m[3]=r,m[4]=s,m[5]=n,m[6]=a,m[7]=o,m[8]=h,m[9]=l,m[10]=u,m[11]=d,m[12]=c,m[13]=f,m[14]=p,m[15]=g,this},copy:function(t){var e=t.val;return this.setValues(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},fromArray:function(t){return this.setValues(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},zero:function(){return this.setValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)},transform:function(t,e,i){var r=o.fromQuat(i).val,s=e.x,n=e.y,a=e.z;return this.setValues(r[0]*s,r[1]*s,r[2]*s,0,r[4]*n,r[5]*n,r[6]*n,0,r[8]*a,r[9]*a,r[10]*a,0,t.x,t.y,t.z,1)},xyz:function(t,e,i){this.identity();var r=this.val;return r[12]=t,r[13]=e,r[14]=i,this},scaling:function(t,e,i){this.zero();var r=this.val;return r[0]=t,r[5]=e,r[10]=i,r[15]=1,this},identity:function(){return this.setValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)},transpose:function(){var t=this.val,e=t[1],i=t[2],r=t[3],s=t[6],n=t[7],a=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=e,t[6]=t[9],t[7]=t[13],t[8]=i,t[9]=s,t[11]=t[14],t[12]=r,t[13]=n,t[14]=a,this},getInverse:function(t){return this.copy(t),this.invert()},invert:function(){var t=this.val,e=t[0],i=t[1],r=t[2],s=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],d=t[10],c=t[11],f=t[12],p=t[13],g=t[14],m=t[15],v=e*a-i*n,y=e*o-r*n,x=e*h-s*n,T=i*o-r*a,w=i*h-s*a,b=r*h-s*o,S=l*p-u*f,C=l*g-d*f,E=l*m-c*f,A=u*g-d*p,_=u*m-c*p,M=d*m-c*g,R=v*M-y*_+x*A+T*E-w*C+b*S;return R?(R=1/R,this.setValues((a*M-o*_+h*A)*R,(r*_-i*M-s*A)*R,(p*b-g*w+m*T)*R,(d*w-u*b-c*T)*R,(o*E-n*M-h*C)*R,(e*M-r*E+s*C)*R,(g*x-f*b-m*y)*R,(l*b-d*x+c*y)*R,(n*_-a*E+h*S)*R,(i*E-e*_-s*S)*R,(f*w-p*x+m*v)*R,(u*x-l*w-c*v)*R,(a*C-n*A-o*S)*R,(e*A-i*C+r*S)*R,(p*y-f*T-g*v)*R,(l*T-u*y+d*v)*R)):this},adjoint:function(){var t=this.val,e=t[0],i=t[1],r=t[2],s=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],d=t[10],c=t[11],f=t[12],p=t[13],g=t[14],m=t[15];return this.setValues(a*(d*m-c*g)-u*(o*m-h*g)+p*(o*c-h*d),-(i*(d*m-c*g)-u*(r*m-s*g)+p*(r*c-s*d)),i*(o*m-h*g)-a*(r*m-s*g)+p*(r*h-s*o),-(i*(o*c-h*d)-a*(r*c-s*d)+u*(r*h-s*o)),-(n*(d*m-c*g)-l*(o*m-h*g)+f*(o*c-h*d)),e*(d*m-c*g)-l*(r*m-s*g)+f*(r*c-s*d),-(e*(o*m-h*g)-n*(r*m-s*g)+f*(r*h-s*o)),e*(o*c-h*d)-n*(r*c-s*d)+l*(r*h-s*o),n*(u*m-c*p)-l*(a*m-h*p)+f*(a*c-h*u),-(e*(u*m-c*p)-l*(i*m-s*p)+f*(i*c-s*u)),e*(a*m-h*p)-n*(i*m-s*p)+f*(i*h-s*a),-(e*(a*c-h*u)-n*(i*c-s*u)+l*(i*h-s*a)),-(n*(u*g-d*p)-l*(a*g-o*p)+f*(a*d-o*u)),e*(u*g-d*p)-l*(i*g-r*p)+f*(i*d-r*u),-(e*(a*g-o*p)-n*(i*g-r*p)+f*(i*o-r*a)),e*(a*d-o*u)-n*(i*d-r*u)+l*(i*o-r*a))},determinant:function(){var t=this.val,e=t[0],i=t[1],r=t[2],s=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],d=t[10],c=t[11],f=t[12],p=t[13],g=t[14],m=t[15];return(e*a-i*n)*(d*m-c*g)-(e*o-r*n)*(u*m-c*p)+(e*h-s*n)*(u*g-d*p)+(i*o-r*a)*(l*m-c*f)-(i*h-s*a)*(l*g-d*f)+(r*h-s*o)*(l*p-u*f)},multiply:function(t){var e=this.val,i=e[0],r=e[1],s=e[2],n=e[3],a=e[4],o=e[5],h=e[6],l=e[7],u=e[8],d=e[9],c=e[10],f=e[11],p=e[12],g=e[13],m=e[14],v=e[15],y=t.val,x=y[0],T=y[1],w=y[2],b=y[3];return e[0]=x*i+T*a+w*u+b*p,e[1]=x*r+T*o+w*d+b*g,e[2]=x*s+T*h+w*c+b*m,e[3]=x*n+T*l+w*f+b*v,x=y[4],T=y[5],w=y[6],b=y[7],e[4]=x*i+T*a+w*u+b*p,e[5]=x*r+T*o+w*d+b*g,e[6]=x*s+T*h+w*c+b*m,e[7]=x*n+T*l+w*f+b*v,x=y[8],T=y[9],w=y[10],b=y[11],e[8]=x*i+T*a+w*u+b*p,e[9]=x*r+T*o+w*d+b*g,e[10]=x*s+T*h+w*c+b*m,e[11]=x*n+T*l+w*f+b*v,x=y[12],T=y[13],w=y[14],b=y[15],e[12]=x*i+T*a+w*u+b*p,e[13]=x*r+T*o+w*d+b*g,e[14]=x*s+T*h+w*c+b*m,e[15]=x*n+T*l+w*f+b*v,this},multiplyLocal:function(t){var e=this.val,i=t.val;return this.setValues(e[0]*i[0]+e[1]*i[4]+e[2]*i[8]+e[3]*i[12],e[0]*i[1]+e[1]*i[5]+e[2]*i[9]+e[3]*i[13],e[0]*i[2]+e[1]*i[6]+e[2]*i[10]+e[3]*i[14],e[0]*i[3]+e[1]*i[7]+e[2]*i[11]+e[3]*i[15],e[4]*i[0]+e[5]*i[4]+e[6]*i[8]+e[7]*i[12],e[4]*i[1]+e[5]*i[5]+e[6]*i[9]+e[7]*i[13],e[4]*i[2]+e[5]*i[6]+e[6]*i[10]+e[7]*i[14],e[4]*i[3]+e[5]*i[7]+e[6]*i[11]+e[7]*i[15],e[8]*i[0]+e[9]*i[4]+e[10]*i[8]+e[11]*i[12],e[8]*i[1]+e[9]*i[5]+e[10]*i[9]+e[11]*i[13],e[8]*i[2]+e[9]*i[6]+e[10]*i[10]+e[11]*i[14],e[8]*i[3]+e[9]*i[7]+e[10]*i[11]+e[11]*i[15],e[12]*i[0]+e[13]*i[4]+e[14]*i[8]+e[15]*i[12],e[12]*i[1]+e[13]*i[5]+e[14]*i[9]+e[15]*i[13],e[12]*i[2]+e[13]*i[6]+e[14]*i[10]+e[15]*i[14],e[12]*i[3]+e[13]*i[7]+e[14]*i[11]+e[15]*i[15])},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var i=t.val,r=e.val,s=i[0],n=i[4],a=i[8],o=i[12],h=i[1],l=i[5],u=i[9],d=i[13],c=i[2],f=i[6],p=i[10],g=i[14],m=i[3],v=i[7],y=i[11],x=i[15],T=r[0],w=r[4],b=r[8],S=r[12],C=r[1],E=r[5],A=r[9],_=r[13],M=r[2],R=r[6],P=r[10],O=r[14],L=r[3],F=r[7],D=r[11],I=r[15];return this.setValues(s*T+n*C+a*M+o*L,h*T+l*C+u*M+d*L,c*T+f*C+p*M+g*L,m*T+v*C+y*M+x*L,s*w+n*E+a*R+o*F,h*w+l*E+u*R+d*F,c*w+f*E+p*R+g*F,m*w+v*E+y*R+x*F,s*b+n*A+a*P+o*D,h*b+l*A+u*P+d*D,c*b+f*A+p*P+g*D,m*b+v*A+y*P+x*D,s*S+n*_+a*O+o*I,h*S+l*_+u*O+d*I,c*S+f*_+p*O+g*I,m*S+v*_+y*O+x*I)},translate:function(t){return this.translateXYZ(t.x,t.y,t.z)},translateXYZ:function(t,e,i){var r=this.val;return r[12]=r[0]*t+r[4]*e+r[8]*i+r[12],r[13]=r[1]*t+r[5]*e+r[9]*i+r[13],r[14]=r[2]*t+r[6]*e+r[10]*i+r[14],r[15]=r[3]*t+r[7]*e+r[11]*i+r[15],this},scale:function(t){return this.scaleXYZ(t.x,t.y,t.z)},scaleXYZ:function(t,e,i){var r=this.val;return r[0]=r[0]*t,r[1]=r[1]*t,r[2]=r[2]*t,r[3]=r[3]*t,r[4]=r[4]*e,r[5]=r[5]*e,r[6]=r[6]*e,r[7]=r[7]*e,r[8]=r[8]*i,r[9]=r[9]*i,r[10]=r[10]*i,r[11]=r[11]*i,this},makeRotationAxis:function(t,e){var i=Math.cos(e),r=Math.sin(e),s=1-i,n=t.x,a=t.y,o=t.z,h=s*n,l=s*a;return this.setValues(h*n+i,h*a-r*o,h*o+r*a,0,h*a+r*o,l*a+i,l*o-r*n,0,h*o-r*a,l*o+r*n,s*o*o+i,0,0,0,0,1)},rotate:function(t,e){var i=this.val,r=e.x,s=e.y,a=e.z,o=Math.sqrt(r*r+s*s+a*a);if(Math.abs(o)1?void 0!==r?(s=(r-t)/(r-i))<0&&(s=0):s=1:s<0&&(s=0),s}},15746(t,e,i){var r=i(83419),s=i(94434),n=i(29747),a=i(25836),o=1e-6,h=new Int8Array([1,2,0]),l=new Float32Array([0,0,0]),u=new a(1,0,0),d=new a(0,1,0),c=new a,f=new s,p=new r({initialize:function(t,e,i,r){this.onChangeCallback=n,this.set(t,e,i,r)},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},w:{get:function(){return this._w},set:function(t){this._w=t,this.onChangeCallback(this)}},copy:function(t){return this.set(t)},set:function(t,e,i,r,s){return void 0===s&&(s=!0),"object"==typeof t?(this._x=t.x||0,this._y=t.y||0,this._z=t.z||0,this._w=t.w||0):(this._x=t||0,this._y=e||0,this._z=i||0,this._w=r||0),s&&this.onChangeCallback(this),this},add:function(t){return this._x+=t.x,this._y+=t.y,this._z+=t.z,this._w+=t.w,this.onChangeCallback(this),this},subtract:function(t){return this._x-=t.x,this._y-=t.y,this._z-=t.z,this._w-=t.w,this.onChangeCallback(this),this},scale:function(t){return this._x*=t,this._y*=t,this._z*=t,this._w*=t,this.onChangeCallback(this),this},length:function(){var t=this.x,e=this.y,i=this.z,r=this.w;return Math.sqrt(t*t+e*e+i*i+r*r)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,r=this.w;return t*t+e*e+i*i+r*r},normalize:function(){var t=this.x,e=this.y,i=this.z,r=this.w,s=t*t+e*e+i*i+r*r;return s>0&&(s=1/Math.sqrt(s),this._x=t*s,this._y=e*s,this._z=i*s,this._w=r*s),this.onChangeCallback(this),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,r=this.y,s=this.z,n=this.w;return this.set(i+e*(t.x-i),r+e*(t.y-r),s+e*(t.z-s),n+e*(t.w-n))},rotationTo:function(t,e){var i=t.x*e.x+t.y*e.y+t.z*e.z;return i<-.999999?(c.copy(u).cross(t).length().999999?this.set(0,0,0,1):(c.copy(t).cross(e),this._x=c.x,this._y=c.y,this._z=c.z,this._w=1+i,this.normalize())},setAxes:function(t,e,i){var r=f.val;return r[0]=e.x,r[3]=e.y,r[6]=e.z,r[1]=i.x,r[4]=i.y,r[7]=i.z,r[2]=-t.x,r[5]=-t.y,r[8]=-t.z,this.fromMat3(f).normalize()},identity:function(){return this.set(0,0,0,1)},setAxisAngle:function(t,e){e*=.5;var i=Math.sin(e);return this.set(i*t.x,i*t.y,i*t.z,Math.cos(e))},multiply:function(t){var e=this.x,i=this.y,r=this.z,s=this.w,n=t.x,a=t.y,o=t.z,h=t.w;return this.set(e*h+s*n+i*o-r*a,i*h+s*a+r*n-e*o,r*h+s*o+e*a-i*n,s*h-e*n-i*a-r*o)},slerp:function(t,e){var i=this.x,r=this.y,s=this.z,n=this.w,a=t.x,h=t.y,l=t.z,u=t.w,d=i*a+r*h+s*l+n*u;d<0&&(d=-d,a=-a,h=-h,l=-l,u=-u);var c=1-e,f=e;if(1-d>o){var p=Math.acos(d),g=Math.sin(p);c=Math.sin((1-e)*p)/g,f=Math.sin(e*p)/g}return this.set(c*i+f*a,c*r+f*h,c*s+f*l,c*n+f*u)},invert:function(){var t=this.x,e=this.y,i=this.z,r=this.w,s=t*t+e*e+i*i+r*r,n=s?1/s:0;return this.set(-t*n,-e*n,-i*n,r*n)},conjugate:function(){return this._x=-this.x,this._y=-this.y,this._z=-this.z,this.onChangeCallback(this),this},rotateX:function(t){t*=.5;var e=this.x,i=this.y,r=this.z,s=this.w,n=Math.sin(t),a=Math.cos(t);return this.set(e*a+s*n,i*a+r*n,r*a-i*n,s*a-e*n)},rotateY:function(t){t*=.5;var e=this.x,i=this.y,r=this.z,s=this.w,n=Math.sin(t),a=Math.cos(t);return this.set(e*a-r*n,i*a+s*n,r*a+e*n,s*a-i*n)},rotateZ:function(t){t*=.5;var e=this.x,i=this.y,r=this.z,s=this.w,n=Math.sin(t),a=Math.cos(t);return this.set(e*a+i*n,i*a-e*n,r*a+s*n,s*a-r*n)},calculateW:function(){var t=this.x,e=this.y,i=this.z;return this.w=-Math.sqrt(1-t*t-e*e-i*i),this},setFromEuler:function(t,e){var i=t.x/2,r=t.y/2,s=t.z/2,n=Math.cos(i),a=Math.cos(r),o=Math.cos(s),h=Math.sin(i),l=Math.sin(r),u=Math.sin(s);switch(t.order){case"XYZ":this.set(h*a*o+n*l*u,n*l*o-h*a*u,n*a*u+h*l*o,n*a*o-h*l*u,e);break;case"YXZ":this.set(h*a*o+n*l*u,n*l*o-h*a*u,n*a*u-h*l*o,n*a*o+h*l*u,e);break;case"ZXY":this.set(h*a*o-n*l*u,n*l*o+h*a*u,n*a*u+h*l*o,n*a*o-h*l*u,e);break;case"ZYX":this.set(h*a*o-n*l*u,n*l*o+h*a*u,n*a*u-h*l*o,n*a*o+h*l*u,e);break;case"YZX":this.set(h*a*o+n*l*u,n*l*o+h*a*u,n*a*u-h*l*o,n*a*o-h*l*u,e);break;case"XZY":this.set(h*a*o-n*l*u,n*l*o-h*a*u,n*a*u+h*l*o,n*a*o+h*l*u,e)}return this},setFromRotationMatrix:function(t){var e,i=t.val,r=i[0],s=i[4],n=i[8],a=i[1],o=i[5],h=i[9],l=i[2],u=i[6],d=i[10],c=r+o+d;return c>0?(e=.5/Math.sqrt(c+1),this.set((u-h)*e,(n-l)*e,(a-s)*e,.25/e)):r>o&&r>d?(e=2*Math.sqrt(1+r-o-d),this.set(.25*e,(s+a)/e,(n+l)/e,(u-h)/e)):o>d?(e=2*Math.sqrt(1+o-r-d),this.set((s+a)/e,.25*e,(h+u)/e,(n-l)/e)):(e=2*Math.sqrt(1+d-r-o),this.set((n+l)/e,(h+u)/e,.25*e,(a-s)/e)),this},fromMat3:function(t){var e,i=t.val,r=i[0]+i[4]+i[8];if(r>0)e=Math.sqrt(r+1),this.w=.5*e,e=.5/e,this._x=(i[7]-i[5])*e,this._y=(i[2]-i[6])*e,this._z=(i[3]-i[1])*e;else{var s=0;i[4]>i[0]&&(s=1),i[8]>i[3*s+s]&&(s=2);var n=h[s],a=h[n];e=Math.sqrt(i[3*s+s]-i[3*n+n]-i[3*a+a]+1),l[s]=.5*e,e=.5/e,l[n]=(i[3*n+s]+i[3*s+n])*e,l[a]=(i[3*a+s]+i[3*s+a])*e,this._x=l[0],this._y=l[1],this._z=l[2],this._w=(i[3*a+n]-i[3*n+a])*e}return this.onChangeCallback(this),this}});t.exports=p},43396(t,e,i){var r=i(36383);t.exports=function(t){return t*r.RAD_TO_DEG}},74362(t){t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI;return t.x=Math.cos(i)*e,t.y=Math.sin(i)*e,t}},60706(t){t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI,r=2*Math.random()-1,s=Math.sqrt(1-r*r)*e;return t.x=Math.cos(i)*s,t.y=Math.sin(i)*s,t.z=r*e,t}},67421(t){t.exports=function(t,e){return void 0===e&&(e=1),t.x=(2*Math.random()-1)*e,t.y=(2*Math.random()-1)*e,t.z=(2*Math.random()-1)*e,t.w=(2*Math.random()-1)*e,t}},36305(t){t.exports=function(t,e){var i=t.x,r=t.y;return t.x=i*Math.cos(e)-r*Math.sin(e),t.y=i*Math.sin(e)+r*Math.cos(e),t}},11520(t){t.exports=function(t,e,i,r){var s=Math.cos(r),n=Math.sin(r),a=t.x-e,o=t.y-i;return t.x=a*s-o*n+e,t.y=a*n+o*s+i,t}},1163(t){t.exports=function(t,e,i,r,s){var n=r+Math.atan2(t.y-i,t.x-e);return t.x=e+s*Math.cos(n),t.y=i+s*Math.sin(n),t}},70336(t){t.exports=function(t,e,i,r,s){return t.x=e+s*Math.cos(r),t.y=i+s*Math.sin(r),t}},72678(t,e,i){var r=i(25836),s=i(37867),n=i(15746),a=new s,o=new n,h=new r;t.exports=function(t,e,i){return o.setAxisAngle(e,i),a.fromRotationTranslation(o,h.set(0,0,0)),t.transformMat4(a)}},2284(t){t.exports=function(t){return t>0?Math.ceil(t):Math.floor(t)}},41013(t){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var r=Math.pow(i,-e);return Math.round(t*r)/r}},7602(t){t.exports=function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)}},54261(t){t.exports=function(t,e,i){return(t=Math.max(0,Math.min(1,(t-e)/(i-e))))*t*t*(t*(6*t-15)+10)}},44408(t,e,i){var r=i(26099);t.exports=function(t,e,i,s){void 0===s&&(s=new r);var n=0,a=0;return t>0&&t<=e*i&&(n=t>e-1?t-(a=Math.floor(t/e))*e:t),s.set(n,a)}},85955(t,e,i){var r=i(26099);t.exports=function(t,e,i,s,n,a,o,h){void 0===h&&(h=new r);var l=Math.sin(n),u=Math.cos(n),d=u*a,c=l*a,f=-l*o,p=u*o,g=1/(d*p+f*-c);return h.x=p*g*t+-f*g*e+(s*f-i*p)*g,h.y=d*g*e+-c*g*t+(-s*d+i*c)*g,h}},26099(t,e,i){var r=i(83419),s=i(43855),n=new r({initialize:function(t,e){this.x=0,this.y=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0):(void 0===e&&(e=t),this.x=t||0,this.y=e||0)},clone:function(){return new n(this.x,this.y)},copy:function(t){return this.x=t.x||0,this.y=t.y||0,this},setFromObject:function(t){return this.x=t.x||0,this.y=t.y||0,this},set:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setTo:function(t,e){return this.set(t,e)},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},invert:function(){return this.set(this.y,this.x)},setToPolar:function(t,e){return null==e&&(e=1),this.x=Math.cos(t)*e,this.y=Math.sin(t)*e,this},equals:function(t){return this.x===t.x&&this.y===t.y},fuzzyEquals:function(t,e){return s(this.x,t.x,e)&&s(this.y,t.y,e)},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},setAngle:function(t){return this.setToPolar(t,this.length())},add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t):(this.x=0,this.y=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},negate:function(){return this.x=-this.x,this.y=-this.y,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},length:function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)},setLength:function(t){return this.normalize().scale(t)},lengthSq:function(){var t=this.x,e=this.y;return t*t+e*e},normalize:function(){var t=this.x,e=this.y,i=t*t+e*e;return i>0&&(i=1/Math.sqrt(i),this.x=t*i,this.y=e*i),this},normalizeRightHand:function(){var t=this.x;return this.x=-1*this.y,this.y=t,this},normalizeLeftHand:function(){var t=this.x;return this.x=this.y,this.y=-1*t,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,r=this.y;return this.x=i+e*(t.x-i),this.y=r+e*(t.y-r),this},transformMat3:function(t){var e=this.x,i=this.y,r=t.val;return this.x=r[0]*e+r[3]*i+r[6],this.y=r[1]*e+r[4]*i+r[7],this},transformMat4:function(t){var e=this.x,i=this.y,r=t.val;return this.x=r[0]*e+r[4]*i+r[12],this.y=r[1]*e+r[5]*i+r[13],this},reset:function(){return this.x=0,this.y=0,this},limit:function(t){var e=this.length();return e&&e>t&&this.scale(t/e),this},reflect:function(t){return t=t.clone().normalize(),this.subtract(t.scale(2*this.dot(t)))},mirror:function(t){return this.reflect(t).negate()},rotate:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e*this.x-i*this.y,i*this.x+e*this.y)},project:function(t){var e=this.dot(t)/t.dot(t);return this.copy(t).scale(e)},projectUnit:function(t,e){void 0===e&&(e=new n);var i=this.x*t.x+this.y*t.y;return 0!==i&&(e.x=i*t.x,e.y=i*t.y),e}});n.ZERO=new n,n.RIGHT=new n(1,0),n.LEFT=new n(-1,0),n.UP=new n(0,-1),n.DOWN=new n(0,1),n.ONE=new n(1,1),t.exports=n},25836(t,e,i){var r=new(i(83419))({initialize:function(t,e,i){this.x=0,this.y=0,this.z=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0)},up:function(){return this.x=0,this.y=1,this.z=0,this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clone:function(){return new r(this.x,this.y,this.z)},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},crossVectors:function(t,e){var i=t.x,r=t.y,s=t.z,n=e.x,a=e.y,o=e.z;return this.x=r*o-s*a,this.y=s*n-i*o,this.z=i*a-r*n,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this},set:function(t,e,i){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0),this},setFromMatrixPosition:function(t){return this.fromArray(t.val,12)},setFromMatrixColumn:function(t,e){return this.fromArray(t.val,4*e)},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addScale:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t):(this.x=0,this.y=0,this.z=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,r=t.z-this.z||0;return Math.sqrt(e*e+i*i+r*r)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,r=t.z-this.z||0;return e*e+i*i+r*r},length:function(){var t=this.x,e=this.y,i=this.z;return Math.sqrt(t*t+e*e+i*i)},lengthSq:function(){var t=this.x,e=this.y,i=this.z;return t*t+e*e+i*i},normalize:function(){var t=this.x,e=this.y,i=this.z,r=t*t+e*e+i*i;return r>0&&(r=1/Math.sqrt(r),this.x=t*r,this.y=e*r,this.z=i*r),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},cross:function(t){var e=this.x,i=this.y,r=this.z,s=t.x,n=t.y,a=t.z;return this.x=i*a-r*n,this.y=r*s-e*a,this.z=e*n-i*s,this},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,r=this.y,s=this.z;return this.x=i+e*(t.x-i),this.y=r+e*(t.y-r),this.z=s+e*(t.z-s),this},applyMatrix3:function(t){var e=this.x,i=this.y,r=this.z,s=t.val;return this.x=s[0]*e+s[3]*i+s[6]*r,this.y=s[1]*e+s[4]*i+s[7]*r,this.z=s[2]*e+s[5]*i+s[8]*r,this},applyMatrix4:function(t){var e=this.x,i=this.y,r=this.z,s=t.val,n=1/(s[3]*e+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*e+s[4]*i+s[8]*r+s[12])*n,this.y=(s[1]*e+s[5]*i+s[9]*r+s[13])*n,this.z=(s[2]*e+s[6]*i+s[10]*r+s[14])*n,this},transformMat3:function(t){var e=this.x,i=this.y,r=this.z,s=t.val;return this.x=e*s[0]+i*s[3]+r*s[6],this.y=e*s[1]+i*s[4]+r*s[7],this.z=e*s[2]+i*s[5]+r*s[8],this},transformMat4:function(t){var e=this.x,i=this.y,r=this.z,s=t.val;return this.x=s[0]*e+s[4]*i+s[8]*r+s[12],this.y=s[1]*e+s[5]*i+s[9]*r+s[13],this.z=s[2]*e+s[6]*i+s[10]*r+s[14],this},transformCoordinates:function(t){var e=this.x,i=this.y,r=this.z,s=t.val,n=e*s[0]+i*s[4]+r*s[8]+s[12],a=e*s[1]+i*s[5]+r*s[9]+s[13],o=e*s[2]+i*s[6]+r*s[10]+s[14],h=e*s[3]+i*s[7]+r*s[11]+s[15];return this.x=n/h,this.y=a/h,this.z=o/h,this},transformQuat:function(t){var e=this.x,i=this.y,r=this.z,s=t.x,n=t.y,a=t.z,o=t.w,h=o*e+n*r-a*i,l=o*i+a*e-s*r,u=o*r+s*i-n*e,d=-s*e-n*i-a*r;return this.x=h*o+d*-s+l*-a-u*-n,this.y=l*o+d*-n+u*-s-h*-a,this.z=u*o+d*-a+h*-n-l*-s,this},project:function(t){var e=this.x,i=this.y,r=this.z,s=t.val,n=s[0],a=s[1],o=s[2],h=s[3],l=s[4],u=s[5],d=s[6],c=s[7],f=s[8],p=s[9],g=s[10],m=s[11],v=s[12],y=s[13],x=s[14],T=1/(e*h+i*c+r*m+s[15]);return this.x=(e*n+i*l+r*f+v)*T,this.y=(e*a+i*u+r*p+y)*T,this.z=(e*o+i*d+r*g+x)*T,this},projectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unprojectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unproject:function(t,e){var i=t.x,r=t.y,s=t.z,n=t.w,a=this.x-i,o=n-this.y-1-r,h=this.z;return this.x=2*a/s-1,this.y=2*o/n-1,this.z=2*h-1,this.project(e)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});r.ZERO=new r,r.RIGHT=new r(1,0,0),r.LEFT=new r(-1,0,0),r.UP=new r(0,-1,0),r.DOWN=new r(0,1,0),r.FORWARD=new r(0,0,1),r.BACK=new r(0,0,-1),r.ONE=new r(1,1,1),t.exports=r},61369(t,e,i){var r=new(i(83419))({initialize:function(t,e,i,r){this.x=0,this.y=0,this.z=0,this.w=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=r||0)},clone:function(){return new r(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this.w=t.w||0,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},set:function(t,e,i,r){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=r||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this.w+=t.w||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this.w-=t.w||0,this},scale:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},length:function(){var t=this.x,e=this.y,i=this.z,r=this.w;return Math.sqrt(t*t+e*e+i*i+r*r)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,r=this.w;return t*t+e*e+i*i+r*r},normalize:function(){var t=this.x,e=this.y,i=this.z,r=this.w,s=t*t+e*e+i*i+r*r;return s>0&&(s=1/Math.sqrt(s),this.x=t*s,this.y=e*s,this.z=i*s,this.w=r*s),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,r=this.y,s=this.z,n=this.w;return this.x=i+e*(t.x-i),this.y=r+e*(t.y-r),this.z=s+e*(t.z-s),this.w=n+e*(t.w-n),this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this.w*=t.w||1,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this.w/=t.w||1,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,r=t.z-this.z||0,s=t.w-this.w||0;return Math.sqrt(e*e+i*i+r*r+s*s)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,r=t.z-this.z||0,s=t.w-this.w||0;return e*e+i*i+r*r+s*s},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},transformMat4:function(t){var e=this.x,i=this.y,r=this.z,s=this.w,n=t.val;return this.x=n[0]*e+n[4]*i+n[8]*r+n[12]*s,this.y=n[1]*e+n[5]*i+n[9]*r+n[13]*s,this.z=n[2]*e+n[6]*i+n[10]*r+n[14]*s,this.w=n[3]*e+n[7]*i+n[11]*r+n[15]*s,this},transformQuat:function(t){var e=this.x,i=this.y,r=this.z,s=t.x,n=t.y,a=t.z,o=t.w,h=o*e+n*r-a*i,l=o*i+a*e-s*r,u=o*r+s*i-n*e,d=-s*e-n*i-a*r;return this.x=h*o+d*-s+l*-a-u*-n,this.y=l*o+d*-n+u*-s-h*-a,this.z=u*o+d*-a+h*-n-l*-s,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});r.prototype.sub=r.prototype.subtract,r.prototype.mul=r.prototype.multiply,r.prototype.div=r.prototype.divide,r.prototype.dist=r.prototype.distance,r.prototype.distSq=r.prototype.distanceSq,r.prototype.len=r.prototype.length,r.prototype.lenSq=r.prototype.lengthSq,t.exports=r},60417(t){t.exports=function(t,e,i){return Math.abs(t-e)<=i}},15994(t){t.exports=function(t,e,i){var r=i-e;return e+((t-e)%r+r)%r}},31040(t){t.exports=function(t,e,i,r){return Math.atan2(r-e,i-t)}},55495(t){t.exports=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}},128(t){t.exports=function(t,e){return Math.atan2(e.x-t.x,e.y-t.y)}},41273(t){t.exports=function(t,e,i,r){return Math.atan2(i-t,r-e)}},1432(t,e,i){var r=i(36383);t.exports=function(t){return t>Math.PI&&(t-=r.TAU),Math.abs(((t+r.PI_OVER_2)%r.TAU-r.TAU)%r.TAU)}},49127(t,e,i){var r=i(12407);t.exports=function(t,e){return r(e-t)}},52285(t,e,i){var r=i(36383),s=i(12407),n=r.TAU;t.exports=function(t,e){var i=s(e-t);return i>0&&(i-=n),i}},67317(t,e,i){var r=i(86554);t.exports=function(t,e){return r(e-t)}},12407(t){t.exports=function(t){return(t%=2*Math.PI)>=0?t:t+2*Math.PI}},53993(t,e,i){var r=i(99472);t.exports=function(){return r(-Math.PI,Math.PI)}},86564(t,e,i){var r=i(99472);t.exports=function(){return r(-180,180)}},90154(t,e,i){var r=i(12407);t.exports=function(t){return r(t+Math.PI)}},48736(t,e,i){var r=i(36383);t.exports=function(t,e,i){return void 0===i&&(i=.05),t===e||(Math.abs(e-t)<=i||Math.abs(e-t)>=r.TAU-i?t=e:(Math.abs(e-t)>Math.PI&&(et?t+=i:e=1?1:1/e*(1+(e*t|0))}},49752(t,e,i){t.exports=i(72251)},75698(t){t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.ceil(t-e)}},43855(t){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),Math.abs(t-e)e-i}},94977(t){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t1?t[i]-(r(s-i,t[i],t[i],t[i-1],t[i-1])-t[i]):r(s-n,t[n?n-1:0],t[n],t[i1?r(t[i],t[i-1],i-s):r(t[n],t[n+1>i?i:n+1],s-n)}},32112(t){t.exports=function(t,e,i,r){return function(t,e){var i=1-t;return i*i*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,i)+function(t,e){return t*t*e}(t,r)}},47235(t,e,i){var r=i(7602);t.exports=function(t,e,i){return e+(i-e)*r(t,0,1)}},50178(t,e,i){var r=i(54261);t.exports=function(t,e,i){return e+(i-e)*r(t,0,1)}},38289(t,e,i){t.exports={Bezier:i(89318),CatmullRom:i(77259),CubicBezier:i(36316),Linear:i(28392),QuadraticBezier:i(32112),SmoothStep:i(47235),SmootherStep:i(50178)}},98439(t){t.exports=function(t){var e=Math.log(t)/.6931471805599453;return 1<0&&!(t&t-1)&&e>0&&!(e&e-1)}},81230(t){t.exports=function(t){return t>0&&!(t&t-1)}},49001(t,e,i){t.exports={GetNext:i(98439),IsSize:i(50030),IsValue:i(81230)}},28453(t,e,i){var r=new(i(83419))({initialize:function(t){void 0===t&&(t=[(Date.now()*Math.random()).toString()]),this.c=1,this.s0=0,this.s1=0,this.s2=0,this.n=0,this.signs=[-1,1],t&&this.init(t)},rnd:function(){var t=2091639*this.s0+2.3283064365386963e-10*this.c;return this.c=0|t,this.s0=this.s1,this.s1=this.s2,this.s2=t-this.c,this.s2},hash:function(t){var e,i=this.n;t=t.toString();for(var r=0;r>>0,i=(e*=i)>>>0,i+=4294967296*(e-=i);return this.n=i,2.3283064365386963e-10*(i>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e0;e--){var i=Math.floor(this.frac()*(e+1)),r=t[i];t[i]=t[e],t[e]=r}return t}});t.exports=r},63448(t){t.exports=function(t,e,i,r){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.ceil(t/e),r?(i+t)/e:i+t)}},56583(t){t.exports=function(t,e,i,r){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.floor(t/e),r?(i+t)/e:i+t)}},77720(t){t.exports=function(t,e,i,r){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.round(t/e),r?(i+t)/e:i+t)}},73697(t,e,i){t.exports={Ceil:i(63448),Floor:i(56583),To:i(77720)}},85454(t,e,i){i(63595);var r=i(8054),s=i(79291),n={Actions:i(61061),Animations:i(60421),BlendModes:i(10312),Cache:i(83388),Cameras:i(26638),Core:i(42857),Class:i(83419),Curves:i(25410),Data:i(44965),Display:i(27460),DOM:i(84902),Events:i(93055),Filters:i(11889),Game:i(50127),GameObjects:i(77856),Geom:i(55738),Input:i(14350),Loader:i(57777),Math:i(75508),Physics:i(44563),Plugins:i(18922),Renderer:i(36909),Scale:i(93364),ScaleModes:i(29795),Scene:i(97482),Scenes:i(62194),Structs:i(41392),Textures:i(27458),Tilemaps:i(62501),Time:i(90291),TintModes:i(84322),Tweens:i(43066),Utils:i(91799)};n.Sound=i(23717),n=s(!1,n,r),t.exports=n,i.g.Phaser=n},71289(t,e,i){var r=i(83419),s=i(92209),n=i(88571),a=new r({Extends:n,Mixins:[s.Acceleration,s.Angular,s.Bounce,s.Collision,s.Debug,s.Drag,s.Enable,s.Friction,s.Gravity,s.Immovable,s.Mass,s.Pushable,s.Size,s.Velocity],initialize:function(t,e,i,r,s){n.call(this,t,e,i,r,s),this.body=null}});t.exports=a},86689(t,e,i){var r=i(83419),s=i(39506),n=i(20339),a=i(89774),o=i(66022),h=i(95540),l=i(46975),u=i(72441),d=i(47956),c=i(37277),f=i(44594),p=i(26099),g=i(82248),m=new r({initialize:function(t){this.scene=t,this.systems=t.sys,this.config=this.getConfig(),this.world,this.add,this._category=1,t.sys.events.once(f.BOOT,this.boot,this),t.sys.events.on(f.START,this.start,this)},boot:function(){this.world=new g(this.scene,this.config),this.add=new o(this.world),this.systems.events.once(f.DESTROY,this.destroy,this)},start:function(){this.world||(this.world=new g(this.scene,this.config),this.add=new o(this.world));var t=this.systems.events;h(this.config,"customUpdate",!1)||t.on(f.UPDATE,this.world.update,this.world),t.on(f.POST_UPDATE,this.world.postUpdate,this.world),t.once(f.SHUTDOWN,this.shutdown,this)},enableUpdate:function(){this.systems.events.on(f.UPDATE,this.world.update,this.world)},disableUpdate:function(){this.systems.events.off(f.UPDATE,this.world.update,this.world)},getConfig:function(){var t=this.systems.game.config.physics,e=this.systems.settings.physics;return l(h(e,"arcade",{}),h(t,"arcade",{}))},nextCategory:function(){return this._category=this._category<<1,this._category},overlap:function(t,e,i,r,s){return void 0===i&&(i=null),void 0===r&&(r=null),void 0===s&&(s=i),this.world.collideObjects(t,e,i,r,s,!0)},collide:function(t,e,i,r,s){return void 0===i&&(i=null),void 0===r&&(r=null),void 0===s&&(s=i),this.world.collideObjects(t,e,i,r,s,!1)},collideTiles:function(t,e,i,r,s){return this.world.collideTiles(t,e,i,r,s)},overlapTiles:function(t,e,i,r,s){return this.world.overlapTiles(t,e,i,r,s)},pause:function(){return this.world.pause()},resume:function(){return this.world.resume()},accelerateTo:function(t,e,i,r,s,n){void 0===r&&(r=60);var a=Math.atan2(i-t.y,e-t.x);return t.body.acceleration.setToPolar(a,r),void 0!==s&&void 0!==n&&t.body.maxVelocity.set(s,n),a},accelerateToObject:function(t,e,i,r,s){return this.accelerateTo(t,e.x,e.y,i,r,s)},closest:function(t,e){e||(e=Array.from(this.world.bodies));for(var i=Number.MAX_VALUE,r=null,s=t.x,n=t.y,o=e.length,h=0;hi&&(r=l,i=d)}}return r},moveTo:function(t,e,i,r,s){void 0===r&&(r=60),void 0===s&&(s=0);var a=Math.atan2(i-t.y,e-t.x);return s>0&&(r=n(t.x,t.y,e,i)/(s/1e3)),t.body.velocity.setToPolar(a,r),a},moveToObject:function(t,e,i,r){return this.moveTo(t,e.x,e.y,i,r)},velocityFromAngle:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new p),i.setToPolar(s(t),e)},velocityFromRotation:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new p),i.setToPolar(t,e)},overlapRect:function(t,e,i,r,s,n){return d(this.world,t,e,i,r,s,n)},overlapCirc:function(t,e,i,r,s){return u(this.world,t,e,i,r,s)},shutdown:function(){if(this.world){var t=this.systems.events;t.off(f.UPDATE,this.world.update,this.world),t.off(f.POST_UPDATE,this.world.postUpdate,this.world),t.off(f.SHUTDOWN,this.shutdown,this),this.add.destroy(),this.world.destroy(),this.add=null,this.world=null,this._category=1}},destroy:function(){this.shutdown(),this.scene.sys.events.off(f.START,this.start,this),this.scene=null,this.systems=null}});c.register("ArcadePhysics",m,"arcadePhysics"),t.exports=m},13759(t,e,i){var r=i(83419),s=i(92209),n=i(68287),a=new r({Extends:n,Mixins:[s.Acceleration,s.Angular,s.Bounce,s.Collision,s.Debug,s.Drag,s.Enable,s.Friction,s.Gravity,s.Immovable,s.Mass,s.Pushable,s.Size,s.Velocity],initialize:function(t,e,i,r,s){n.call(this,t,e,i,r,s),this.body=null}});t.exports=a},37742(t,e,i){var r=i(83419),s=i(78389),n=i(37747),a=i(63012),o=i(43396),h=i(87841),l=i(37303),u=i(95829),d=i(26099),c=new r({Mixins:[s],initialize:function(t,e){var i=64,r=64,s=void 0!==e;s&&e.displayWidth&&(i=e.displayWidth,r=e.displayHeight),s||(e={x:0,y:0,angle:0,rotation:0,scaleX:1,scaleY:1,displayOriginX:0,displayOriginY:0}),this.world=t,this.gameObject=s?e:void 0,this.isBody=!0,this.transform={x:e.x,y:e.y,rotation:e.angle,scaleX:e.scaleX,scaleY:e.scaleY,displayOriginX:e.displayOriginX,displayOriginY:e.displayOriginY},this.debugShowBody=t.defaults.debugShowBody,this.debugShowVelocity=t.defaults.debugShowVelocity,this.debugBodyColor=t.defaults.bodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new d,this.position=new d(e.x-e.scaleX*e.displayOriginX,e.y-e.scaleY*e.displayOriginY),this.prev=this.position.clone(),this.prevFrame=this.position.clone(),this.allowRotation=!0,this.rotation=e.angle,this.preRotation=e.angle,this.width=i,this.height=r,this.sourceWidth=i,this.sourceHeight=r,e.frame&&(this.sourceWidth=e.frame.realWidth,this.sourceHeight=e.frame.realHeight),this.halfWidth=Math.abs(i/2),this.halfHeight=Math.abs(r/2),this.center=new d(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=new d,this.newVelocity=new d,this.deltaMax=new d,this.acceleration=new d,this.allowDrag=!0,this.drag=new d,this.allowGravity=!0,this.gravity=new d,this.bounce=new d,this.worldBounce=null,this.customBoundsRectangle=t.bounds,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.maxVelocity=new d(1e4,1e4),this.maxSpeed=-1,this.friction=new d(1,0),this.useDamping=!1,this.angularVelocity=0,this.angularAcceleration=0,this.angularDrag=0,this.maxAngular=1e3,this.mass=1,this.angle=0,this.speed=0,this.facing=n.FACING_NONE,this.immovable=!1,this.pushable=!0,this.slideFactor=new d(1,1),this.moves=!0,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision=u(!1),this.touching=u(!0),this.wasTouching=u(!0),this.blocked=u(!0),this.syncBounds=!1,this.physicsType=n.DYNAMIC_BODY,this.collisionCategory=1,this.collisionMask=1,this._sx=e.scaleX,this._sy=e.scaleY,this._dx=0,this._dy=0,this._tx=0,this._ty=0,this._bounds=new h,this.directControl=!1,this.autoFrame=this.position.clone()},updateBounds:function(){var t=this.gameObject,e=this.transform;if(t.parentContainer){var i=t.getWorldTransformMatrix(this.world._tempMatrix,this.world._tempMatrix2);e.x=i.tx,e.y=i.ty,e.rotation=o(i.rotation),e.scaleX=i.scaleX,e.scaleY=i.scaleY,e.displayOriginX=t.displayOriginX,e.displayOriginY=t.displayOriginY}else e.x=t.x,e.y=t.y,e.rotation=t.angle,e.scaleX=t.scaleX,e.scaleY=t.scaleY,e.displayOriginX=t.displayOriginX,e.displayOriginY=t.displayOriginY;var r=!1;if(this.syncBounds){var s=t.getBounds(this._bounds);this.width=s.width,this.height=s.height,r=!0}else{var n=Math.abs(e.scaleX),a=Math.abs(e.scaleY);this._sx===n&&this._sy===a||(this.width=this.sourceWidth*n,this.height=this.sourceHeight*a,this._sx=n,this._sy=a,r=!0)}r&&(this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter())},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},updateFromGameObject:function(){this.updateBounds();var t=this.transform;this.position.x=t.x+t.scaleX*(this.offset.x-t.displayOriginX),this.position.y=t.y+t.scaleY*(this.offset.y-t.displayOriginY),this.updateCenter()},resetFlags:function(t){void 0===t&&(t=!1);var e=this.wasTouching,i=this.touching,r=this.blocked;t?u(!0,e):(e.none=i.none,e.up=i.up,e.down=i.down,e.left=i.left,e.right=i.right),u(!0,i),u(!0,r),this.overlapR=0,this.overlapX=0,this.overlapY=0,this.embedded=!1},preUpdate:function(t,e){if(t&&this.resetFlags(),this.gameObject&&this.updateFromGameObject(),this.rotation=this.transform.rotation,this.preRotation=this.rotation,this.moves){var i=this.position;this.prev.x=i.x,this.prev.y=i.y,this.prevFrame.x=i.x,this.prevFrame.y=i.y}t&&this.update(e)},update:function(t){var e=this.prev,i=this.position,r=this.velocity;if(e.set(i.x,i.y),!this.moves)return this._dx=i.x-e.x,void(this._dy=i.y-e.y);if(this.directControl){var s=this.autoFrame;r.set((i.x-s.x)/t,(i.y-s.y)/t),this.world.updateMotion(this,t),this._dx=i.x-s.x,this._dy=i.y-s.y}else this.world.updateMotion(this,t),this.newVelocity.set(r.x*t,r.y*t),i.add(this.newVelocity),this._dx=i.x-e.x,this._dy=i.y-e.y;var n=r.x,o=r.y;if(this.updateCenter(),this.angle=Math.atan2(o,n),this.speed=Math.sqrt(n*n+o*o),this.collideWorldBounds&&this.checkWorldBounds()&&this.onWorldBounds){var h=this.blocked;this.world.emit(a.WORLD_BOUNDS,this,h.up,h.down,h.left,h.right)}},postUpdate:function(){var t=this.position,e=t.x-this.prevFrame.x,i=t.y-this.prevFrame.y,r=this.gameObject;if(this.moves){var s=this.deltaMax.x,a=this.deltaMax.y;0!==s&&0!==e&&(e<0&&e<-s?e=-s:e>0&&e>s&&(e=s)),0!==a&&0!==i&&(i<0&&i<-a?i=-a:i>0&&i>a&&(i=a)),r&&(r.x+=e,r.y+=i)}e<0?this.facing=n.FACING_LEFT:e>0&&(this.facing=n.FACING_RIGHT),i<0?this.facing=n.FACING_UP:i>0&&(this.facing=n.FACING_DOWN),this.allowRotation&&r&&(r.angle+=this.deltaZ()),this._tx=e,this._ty=i,this.autoFrame.set(t.x,t.y)},setBoundsRectangle:function(t){return this.customBoundsRectangle=t||this.world.bounds,this},checkWorldBounds:function(){var t=this.position,e=this.velocity,i=this.blocked,r=this.customBoundsRectangle,s=this.world.checkCollision,n=this.worldBounce?-this.worldBounce.x:-this.bounce.x,a=this.worldBounce?-this.worldBounce.y:-this.bounce.y,o=!1;return t.xr.right&&s.right&&(t.x=r.right-this.width,e.x*=n,i.right=!0,o=!0),t.yr.bottom&&s.down&&(t.y=r.bottom-this.height,e.y*=a,i.down=!0,o=!0),o&&(this.blocked.none=!1,this.updateCenter()),o},setOffset:function(t,e){return void 0===e&&(e=t),this.offset.set(t,e),this},setGameObject:function(t,e){if(void 0===e&&(e=!0),!t||!t.hasTransformComponent)return this;var i=this.world;return this.gameObject&&this.gameObject.body&&(i.disable(this.gameObject),this.gameObject.body=null),t.body&&i.disable(t),this.gameObject=t,t.body=this,this.setSize(),this.enable=e,this},setSize:function(t,e,i){void 0===i&&(i=!0);var r=this.gameObject;if(r&&(!t&&r.frame&&(t=r.frame.realWidth),!e&&r.frame&&(e=r.frame.realHeight)),this.sourceWidth=t,this.sourceHeight=e,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter(),i&&r&&r.getCenter){var s=(r.width-t)/2,n=(r.height-e)/2;this.offset.set(s,n)}return this.isCircle=!1,this.radius=0,this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.isCircle=!0,this.radius=t,this.sourceWidth=2*t,this.sourceHeight=2*t,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter()):this.isCircle=!1,this},reset:function(t,e){this.stop();var i=this.gameObject;i&&(i.setPosition(t,e),this.rotation=i.angle,this.preRotation=i.angle);var r=this.position;i&&i.getTopLeft?i.getTopLeft(r):r.set(t,e),this.prev.copy(r),this.prevFrame.copy(r),this.autoFrame.copy(r),i&&this.updateBounds(),this.updateCenter(),this.collideWorldBounds&&this.checkWorldBounds(),this.resetFlags(!0)},stop:function(){return this.velocity.set(0),this.acceleration.set(0),this.speed=0,this.angularVelocity=0,this.angularAcceleration=0,this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?this.radius>0&&t>=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom&&(this.center.x-t)*(this.center.x-t)+(this.center.y-e)*(this.center.y-e)<=this.radius*this.radius:l(this,t,e)},onFloor:function(){return this.blocked.down},onCeiling:function(){return this.blocked.up},onWall:function(){return this.blocked.left||this.blocked.right},deltaAbsX:function(){return this._dx>0?this._dx:-this._dx},deltaAbsY:function(){return this._dy>0?this._dy:-this._dy},deltaX:function(){return this._dx},deltaY:function(){return this._dy},deltaXFinal:function(){return this._tx},deltaYFinal:function(){return this._ty},deltaZ:function(){return this.rotation-this.preRotation},destroy:function(){this.enable=!1,this.world&&this.world.pendingDestroy.add(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,r=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(t.defaultStrokeWidth,this.debugBodyColor),this.isCircle?t.strokeCircle(i,r,this.width/2):(this.checkCollision.up&&t.lineBetween(e.x,e.y,e.x+this.width,e.y),this.checkCollision.right&&t.lineBetween(e.x+this.width,e.y,e.x+this.width,e.y+this.height),this.checkCollision.down&&t.lineBetween(e.x,e.y+this.height,e.x+this.width,e.y+this.height),this.checkCollision.left&&t.lineBetween(e.x,e.y,e.x,e.y+this.height))),this.debugShowVelocity&&(t.lineStyle(t.defaultStrokeWidth,this.world.defaults.velocityDebugColor,1),t.lineBetween(i,r,i+this.velocity.x/2,r+this.velocity.y/2))},willDrawDebug:function(){return this.debugShowBody||this.debugShowVelocity},setDirectControl:function(t){return void 0===t&&(t=!0),this.directControl=t,this},setCollideWorldBounds:function(t,e,i,r){void 0===t&&(t=!0),this.collideWorldBounds=t;var s=void 0!==e,n=void 0!==i;return(s||n)&&(this.worldBounce||(this.worldBounce=new d),s&&(this.worldBounce.x=e),n&&(this.worldBounce.y=i)),void 0!==r&&(this.onWorldBounds=r),this},setVelocity:function(t,e){return this.velocity.set(t,e),t=this.velocity.x,e=this.velocity.y,this.speed=Math.sqrt(t*t+e*e),this},setVelocityX:function(t){return this.setVelocity(t,this.velocity.y)},setVelocityY:function(t){return this.setVelocity(this.velocity.x,t)},setMaxVelocity:function(t,e){return this.maxVelocity.set(t,e),this},setMaxVelocityX:function(t){return this.maxVelocity.x=t,this},setMaxVelocityY:function(t){return this.maxVelocity.y=t,this},setMaxSpeed:function(t){return this.maxSpeed=t,this},setSlideFactor:function(t,e){return this.slideFactor.set(t,e),this},setBounce:function(t,e){return this.bounce.set(t,e),this},setBounceX:function(t){return this.bounce.x=t,this},setBounceY:function(t){return this.bounce.y=t,this},setAcceleration:function(t,e){return this.acceleration.set(t,e),this},setAccelerationX:function(t){return this.acceleration.x=t,this},setAccelerationY:function(t){return this.acceleration.y=t,this},setAllowDrag:function(t){return void 0===t&&(t=!0),this.allowDrag=t,this},setAllowGravity:function(t){return void 0===t&&(t=!0),this.allowGravity=t,this},setAllowRotation:function(t){return void 0===t&&(t=!0),this.allowRotation=t,this},setDrag:function(t,e){return this.drag.set(t,e),this},setDamping:function(t){return this.useDamping=t,this},setDragX:function(t){return this.drag.x=t,this},setDragY:function(t){return this.drag.y=t,this},setGravity:function(t,e){return this.gravity.set(t,e),this},setGravityX:function(t){return this.gravity.x=t,this},setGravityY:function(t){return this.gravity.y=t,this},setFriction:function(t,e){return this.friction.set(t,e),this},setFrictionX:function(t){return this.friction.x=t,this},setFrictionY:function(t){return this.friction.y=t,this},setAngularVelocity:function(t){return this.angularVelocity=t,this},setAngularAcceleration:function(t){return this.angularAcceleration=t,this},setAngularDrag:function(t){return this.angularDrag=t,this},setMass:function(t){return this.mass=t,this},setImmovable:function(t){return void 0===t&&(t=!0),this.immovable=t,this},setEnable:function(t){return void 0===t&&(t=!0),this.enable=t,this},processX:function(t,e,i,r){this.x+=t,this.updateCenter(),null!==e&&(this.velocity.x=e*this.slideFactor.x);var s=this.blocked;i&&(s.left=!0,s.none=!1),r&&(s.right=!0,s.none=!1)},processY:function(t,e,i,r){this.y+=t,this.updateCenter(),null!==e&&(this.velocity.y=e*this.slideFactor.y);var s=this.blocked;i&&(s.up=!0,s.none=!1),r&&(s.down=!0,s.none=!1)},x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=c},79342(t,e,i){var r=new(i(83419))({initialize:function(t,e,i,r,s,n,a){this.world=t,this.name="",this.active=!0,this.overlapOnly=e,this.object1=i,this.object2=r,this.collideCallback=s,this.processCallback=n,this.callbackContext=a},setName:function(t){return this.name=t,this},update:function(){this.world.collideObjects(this.object1,this.object2,this.collideCallback,this.processCallback,this.callbackContext,this.overlapOnly)},destroy:function(){this.world.removeCollider(this),this.active=!1,this.world=null,this.object1=null,this.object2=null,this.collideCallback=null,this.processCallback=null,this.callbackContext=null}});t.exports=r},66022(t,e,i){var r=i(71289),s=i(13759),n=i(37742),a=i(83419),o=i(37747),h=i(60758),l=i(72624),u=i(71464),d=new a({initialize:function(t){this.world=t,this.scene=t.scene,this.sys=t.scene.sys},collider:function(t,e,i,r,s){return this.world.addCollider(t,e,i,r,s)},overlap:function(t,e,i,r,s){return this.world.addOverlap(t,e,i,r,s)},existing:function(t,e){var i=e?o.STATIC_BODY:o.DYNAMIC_BODY;return this.world.enableBody(t,i),t},staticImage:function(t,e,i,s){var n=new r(this.scene,t,e,i,s);return this.sys.displayList.add(n),this.world.enableBody(n,o.STATIC_BODY),n},image:function(t,e,i,s){var n=new r(this.scene,t,e,i,s);return this.sys.displayList.add(n),this.world.enableBody(n,o.DYNAMIC_BODY),n},staticSprite:function(t,e,i,r){var n=new s(this.scene,t,e,i,r);return this.sys.displayList.add(n),this.sys.updateList.add(n),this.world.enableBody(n,o.STATIC_BODY),n},sprite:function(t,e,i,r){var n=new s(this.scene,t,e,i,r);return this.sys.displayList.add(n),this.sys.updateList.add(n),this.world.enableBody(n,o.DYNAMIC_BODY),n},staticGroup:function(t,e){return this.sys.updateList.add(new u(this.world,this.world.scene,t,e))},group:function(t,e){return this.sys.updateList.add(new h(this.world,this.world.scene,t,e))},body:function(t,e,i,r){var s=new n(this.world);return s.position.set(t,e),i&&r&&s.setSize(i,r),this.world.add(s,o.DYNAMIC_BODY),s},staticBody:function(t,e,i,r){var s=new l(this.world);return s.position.set(t,e),i&&r&&s.setSize(i,r),this.world.add(s,o.STATIC_BODY),s},destroy:function(){this.world=null,this.scene=null,this.sys=null}});t.exports=d},79599(t){t.exports=function(t){var e=0;if(Array.isArray(t))for(var i=0;ie._dx?(n=t.right-e.x)>a&&!i||!1===t.checkCollision.right||!1===e.checkCollision.left?n=0:(t.touching.none=!1,t.touching.right=!0,e.touching.none=!1,e.touching.left=!0,e.physicsType!==r.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.right=!0),t.physicsType!==r.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.left=!0)):t._dxa&&!i||!1===t.checkCollision.left||!1===e.checkCollision.right?n=0:(t.touching.none=!1,t.touching.left=!0,e.touching.none=!1,e.touching.right=!0,e.physicsType!==r.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.left=!0),t.physicsType!==r.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.right=!0))),t.overlapX=n,e.overlapX=n,n}},45170(t,e,i){var r=i(37747);t.exports=function(t,e,i,s){var n=0,a=t.deltaAbsY()+e.deltaAbsY()+s;return 0===t._dy&&0===e._dy?(t.embedded=!0,e.embedded=!0):t._dy>e._dy?(n=t.bottom-e.y)>a&&!i||!1===t.checkCollision.down||!1===e.checkCollision.up?n=0:(t.touching.none=!1,t.touching.down=!0,e.touching.none=!1,e.touching.up=!0,e.physicsType!==r.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.down=!0),t.physicsType!==r.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.up=!0)):t._dya&&!i||!1===t.checkCollision.up||!1===e.checkCollision.down?n=0:(t.touching.none=!1,t.touching.up=!0,e.touching.none=!1,e.touching.down=!0,e.physicsType!==r.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.up=!0),t.physicsType!==r.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.down=!0))),t.overlapY=n,e.overlapY=n,n}},60758(t,e,i){var r=i(13759),s=i(83419),n=i(78389),a=i(37747),o=i(95540),h=i(26479),l=i(41212),u=new s({Extends:h,Mixins:[n],initialize:function(t,e,i,s){if(i||s)if(l(i))s=i,i=null,s.internalCreateCallback=this.createCallbackHandler,s.internalRemoveCallback=this.removeCallbackHandler;else if(Array.isArray(i)&&l(i[0])){var n=this;i.forEach(function(t){t.internalCreateCallback=n.createCallbackHandler,t.internalRemoveCallback=n.removeCallbackHandler,t.classType=o(t,"classType",r)}),s=null}else s={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler};else s={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler};this.world=t,s&&(s.classType=o(s,"classType",r)),this.physicsType=a.DYNAMIC_BODY,this.collisionCategory=1,this.collisionMask=2147483647,this.defaults={setCollideWorldBounds:o(s,"collideWorldBounds",!1),setBoundsRectangle:o(s,"customBoundsRectangle",null),setAccelerationX:o(s,"accelerationX",0),setAccelerationY:o(s,"accelerationY",0),setAllowDrag:o(s,"allowDrag",!0),setAllowGravity:o(s,"allowGravity",!0),setAllowRotation:o(s,"allowRotation",!0),setDamping:o(s,"useDamping",!1),setBounceX:o(s,"bounceX",0),setBounceY:o(s,"bounceY",0),setDragX:o(s,"dragX",0),setDragY:o(s,"dragY",0),setEnable:o(s,"enable",!0),setGravityX:o(s,"gravityX",0),setGravityY:o(s,"gravityY",0),setFrictionX:o(s,"frictionX",0),setFrictionY:o(s,"frictionY",0),setMaxSpeed:o(s,"maxSpeed",-1),setMaxVelocityX:o(s,"maxVelocityX",1e4),setMaxVelocityY:o(s,"maxVelocityY",1e4),setVelocityX:o(s,"velocityX",0),setVelocityY:o(s,"velocityY",0),setAngularVelocity:o(s,"angularVelocity",0),setAngularAcceleration:o(s,"angularAcceleration",0),setAngularDrag:o(s,"angularDrag",0),setMass:o(s,"mass",1),setImmovable:o(s,"immovable",!1)},h.call(this,e,i,s),this.type="PhysicsGroup"},createCallbackHandler:function(t){t.body&&t.body.physicsType===a.DYNAMIC_BODY||(t.body&&(t.body.destroy(),t.body=null),this.world.enableBody(t,a.DYNAMIC_BODY));var e=t.body;for(var i in this.defaults)e[i](this.defaults[i])},removeCallbackHandler:function(t){t.body&&this.world.disableBody(t)},setVelocity:function(t,e,i){void 0===i&&(i=0);for(var r=this.getChildren(),s=0;s0?1:-1),o=Math.sqrt(t*t*e.mass/i.mass)*(t>0?1:-1),h=.5*(s+o);return o-=h,n=h+(s-=h)*e.bounce.x,a=h+o*i.bounce.x,l&&m?x(0):c&&g?x(1):u&&g?x(2):!(!f||!m)&&x(3)},Set:function(t,n,a){i=n;var x=(e=t).velocity.x,T=i.velocity.x;return r=e.pushable,l=e._dx<0,u=e._dx>0,d=0===e._dx,g=Math.abs(e.right-i.x)<=Math.abs(i.right-e.x),o=T-x*e.bounce.x,s=i.pushable,c=i._dx<0,f=i._dx>0,p=0===i._dx,m=!g,h=x-T*i.bounce.x,v=Math.abs(a),y()},Run:x,RunImmovableBody1:function(t){if(1===t?i.velocity.x=0:g?i.processX(v,h,!0):i.processX(-v,h,!1,!0),e.moves){var r=e.directControl?e.y-e.autoFrame.y:e.y-e.prev.y;i.y+=r*e.friction.y,i._dy=i.y-i.prev.y}},RunImmovableBody2:function(t){if(2===t?e.velocity.x=0:m?e.processX(v,o,!0):e.processX(-v,o,!1,!0),i.moves){var r=i.directControl?i.y-i.autoFrame.y:i.y-i.prev.y;e.y+=r*i.friction.y,e._dy=e.y-e.prev.y}}}},47962(t){var e,i,r,s,n,a,o,h,l,u,d,c,f,p,g,m,v,y=function(){return u&&g&&i.blocked.down?(e.processY(-v,o,!1,!0),1):l&&m&&i.blocked.up?(e.processY(v,o,!0),1):f&&m&&e.blocked.down?(i.processY(-v,h,!1,!0),2):c&&g&&e.blocked.up?(i.processY(v,h,!0),2):0},x=function(t){if(r&&s)v*=.5,0===t||3===t?(e.processY(v,n),i.processY(-v,a)):(e.processY(-v,n),i.processY(v,a));else if(r&&!s)0===t||3===t?e.processY(v,o,!0):e.processY(-v,o,!1,!0);else if(!r&&s)0===t||3===t?i.processY(-v,h,!1,!0):i.processY(v,h,!0);else{var g=.5*v;0===t?p?(e.processY(v,0,!0),i.processY(0,null,!1,!0)):f?(e.processY(g,0,!0),i.processY(-g,0,!1,!0)):(e.processY(g,i.velocity.y,!0),i.processY(-g,null,!1,!0)):1===t?d?(e.processY(0,null,!1,!0),i.processY(v,0,!0)):u?(e.processY(-g,0,!1,!0),i.processY(g,0,!0)):(e.processY(-g,null,!1,!0),i.processY(g,e.velocity.y,!0)):2===t?p?(e.processY(-v,0,!1,!0),i.processY(0,null,!0)):c?(e.processY(-g,0,!1,!0),i.processY(g,0,!0)):(e.processY(-g,i.velocity.y,!1,!0),i.processY(g,null,!0)):3===t&&(d?(e.processY(0,null,!0),i.processY(-v,0,!1,!0)):l?(e.processY(g,0,!0),i.processY(-g,0,!1,!0)):(e.processY(g,i.velocity.y,!0),i.processY(-g,null,!1,!0)))}return!0};t.exports={BlockCheck:y,Check:function(){var t=e.velocity.y,r=i.velocity.y,s=Math.sqrt(r*r*i.mass/e.mass)*(r>0?1:-1),o=Math.sqrt(t*t*e.mass/i.mass)*(t>0?1:-1),h=.5*(s+o);return o-=h,n=h+(s-=h)*e.bounce.y,a=h+o*i.bounce.y,l&&m?x(0):c&&g?x(1):u&&g?x(2):!(!f||!m)&&x(3)},Set:function(t,n,a){i=n;var x=(e=t).velocity.y,T=i.velocity.y;return r=e.pushable,l=e._dy<0,u=e._dy>0,d=0===e._dy,g=Math.abs(e.bottom-i.y)<=Math.abs(i.bottom-e.y),o=T-x*e.bounce.y,s=i.pushable,c=i._dy<0,f=i._dy>0,p=0===i._dy,m=!g,h=x-T*i.bounce.y,v=Math.abs(a),y()},Run:x,RunImmovableBody1:function(t){if(1===t?i.velocity.y=0:g?i.processY(v,h,!0):i.processY(-v,h,!1,!0),e.moves){var r=e.directControl?e.x-e.autoFrame.x:e.x-e.prev.x;i.x+=r*e.friction.x,i._dx=i.x-i.prev.x}},RunImmovableBody2:function(t){if(2===t?e.velocity.y=0:m?e.processY(v,o,!0):e.processY(-v,o,!1,!0),i.moves){var r=i.directControl?i.x-i.autoFrame.x:i.x-i.prev.x;e.x+=r*i.friction.x,e._dx=e.x-e.prev.x}}}},14087(t,e,i){var r=i(64897),s=i(3017);t.exports=function(t,e,i,n,a){void 0===a&&(a=r(t,e,i,n));var o=t.immovable,h=e.immovable;if(i||0===a||o&&h||t.customSeparateX||e.customSeparateX)return 0!==a||t.embedded&&e.embedded;var l=s.Set(t,e,a);return o||h?(o?s.RunImmovableBody1(l):h&&s.RunImmovableBody2(l),!0):l>0||s.Check()}},89936(t,e,i){var r=i(45170),s=i(47962);t.exports=function(t,e,i,n,a){void 0===a&&(a=r(t,e,i,n));var o=t.immovable,h=e.immovable;if(i||0===a||o&&h||t.customSeparateY||e.customSeparateY)return 0!==a||t.embedded&&e.embedded;var l=s.Set(t,e,a);return o||h?(o?s.RunImmovableBody1(l):h&&s.RunImmovableBody2(l),!0):l>0||s.Check()}},95829(t){t.exports=function(t,e){return void 0===e&&(e={}),e.none=t,e.up=!1,e.down=!1,e.left=!1,e.right=!1,t||(e.up=!0,e.down=!0,e.left=!0,e.right=!0),e}},72624(t,e,i){var r=i(87902),s=i(83419),n=i(78389),a=i(37747),o=i(37303),h=i(95829),l=i(26099),u=new s({Mixins:[n],initialize:function(t,e){var i=64,r=64,s=void 0!==e;s&&e.displayWidth&&(i=e.displayWidth,r=e.displayHeight),s||(e={x:0,y:0,angle:0,rotation:0,scaleX:1,scaleY:1,displayOriginX:0,displayOriginY:0}),this.world=t,this.gameObject=s?e:void 0,this.isBody=!0,this.debugShowBody=t.defaults.debugShowStaticBody,this.debugBodyColor=t.defaults.staticBodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new l,this.position=new l(e.x-i*e.originX,e.y-r*e.originY),this.width=i,this.height=r,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center=new l(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=l.ZERO,this.allowGravity=!1,this.gravity=l.ZERO,this.bounce=l.ZERO,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.mass=1,this.immovable=!0,this.pushable=!1,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision=h(!1),this.touching=h(!0),this.wasTouching=h(!0),this.blocked=h(!0),this.physicsType=a.STATIC_BODY,this.collisionCategory=1,this.collisionMask=1,this._dx=0,this._dy=0},setGameObject:function(t,e,i){if(void 0===e&&(e=!0),void 0===i&&(i=!0),!t||!t.hasTransformComponent)return this;var r=this.world;return this.gameObject&&this.gameObject.body&&(r.disable(this.gameObject),this.gameObject.body=null),t.body&&r.disable(t),this.gameObject=t,t.body=this,this.setSize(),e&&this.updateFromGameObject(),this.enable=i,this},updateFromGameObject:function(){this.world.staticTree.remove(this);var t=this.gameObject;return t.getTopLeft(this.position),this.width=t.displayWidth,this.height=t.displayHeight,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.world.staticTree.insert(this),this},setOffset:function(t,e){return void 0===e&&(e=t),this.world.staticTree.remove(this),this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(t,e),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this),this},setSize:function(t,e,i){void 0===i&&(i=!0);var r=this.gameObject;if(r&&r.frame&&(t||(t=r.frame.realWidth),e||(e=r.frame.realHeight)),this.world.staticTree.remove(this),this.width=t,this.height=e,this.halfWidth=Math.floor(t/2),this.halfHeight=Math.floor(e/2),i&&r&&r.getCenter){var s=r.displayWidth/2,n=r.displayHeight/2;this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(s-this.halfWidth,n-this.halfHeight),this.position.x+=this.offset.x,this.position.y+=this.offset.y}return this.updateCenter(),this.isCircle=!1,this.radius=0,this.world.staticTree.insert(this),this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.world.staticTree.remove(this),this.isCircle=!0,this.radius=t,this.width=2*t,this.height=2*t,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter(),this.world.staticTree.insert(this)):this.isCircle=!1,this},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},reset:function(t,e){var i=this.gameObject;void 0===t&&(t=i.x),void 0===e&&(e=i.y),this.world.staticTree.remove(this),i.setPosition(t,e),i.getTopLeft(this.position),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this)},stop:function(){return this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?r(this,t,e):o(this,t,e)},postUpdate:function(){},deltaAbsX:function(){return 0},deltaAbsY:function(){return 0},deltaX:function(){return 0},deltaY:function(){return 0},deltaZ:function(){return 0},destroy:function(){this.enable=!1,this.world.pendingDestroy.add(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,r=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(t.defaultStrokeWidth,this.debugBodyColor,1),this.isCircle?t.strokeCircle(i,r,this.width/2):t.strokeRect(e.x,e.y,this.width,this.height))},willDrawDebug:function(){return this.debugShowBody},setMass:function(t){return t<=0&&(t=.1),this.mass=t,this},x:{get:function(){return this.position.x},set:function(t){this.world.staticTree.remove(this),this.position.x=t,this.world.staticTree.insert(this)}},y:{get:function(){return this.position.y},set:function(t){this.world.staticTree.remove(this),this.position.y=t,this.world.staticTree.insert(this)}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=u},71464(t,e,i){var r=i(13759),s=i(83419),n=i(78389),a=i(37747),o=i(95540),h=i(26479),l=i(41212),u=new s({Extends:h,Mixins:[n],initialize:function(t,e,i,s){i||s?l(i)?(s=i,i=null,s.internalCreateCallback=this.createCallbackHandler,s.internalRemoveCallback=this.removeCallbackHandler,s.createMultipleCallback=this.createMultipleCallbackHandler,s.classType=o(s,"classType",r)):Array.isArray(i)&&l(i[0])?(s=i,i=null,s.forEach(function(t){t.internalCreateCallback=this.createCallbackHandler,t.internalRemoveCallback=this.removeCallbackHandler,t.createMultipleCallback=this.createMultipleCallbackHandler,t.classType=o(t,"classType",r)},this)):s={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler}:s={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler,createMultipleCallback:this.createMultipleCallbackHandler,classType:r},this.world=t,this.physicsType=a.STATIC_BODY,this.collisionCategory=1,this.collisionMask=1,h.call(this,e,i,s),this.type="StaticPhysicsGroup"},createCallbackHandler:function(t){t.body&&t.body.physicsType===a.STATIC_BODY||(t.body&&(t.body.destroy(),t.body=null),this.world.enableBody(t,a.STATIC_BODY))},removeCallbackHandler:function(t){t.body&&this.world.disableBody(t)},createMultipleCallbackHandler:function(){this.refresh()},refresh:function(){for(var t=Array.from(this.children),e=0;e=r;if(this.fixedStep||(i=.001*e,n=!0,this._elapsed=0),s.forEach(function(t){t.enable&&t.preUpdate(n,i)}),n){this._elapsed-=r,this.stepsLastFrame=1,this.useTree&&(this.tree.clear(),this.tree.load(Array.from(s)));for(var a=this.colliders.update(),o=0;o=r;)this._elapsed-=r,this.step(i)}},step:function(t){var e=this.bodies;e.forEach(function(e){e.enable&&e.update(t)}),this.useTree&&(this.tree.clear(),this.tree.load(Array.from(e)));for(var i=this.colliders.update(),r=0;r0){var s=this.tree,n=this.staticTree;r.forEach(function(i){i.physicsType===h.DYNAMIC_BODY?(s.remove(i),t.delete(i)):i.physicsType===h.STATIC_BODY&&(n.remove(i),e.delete(i)),i.world=void 0,i.gameObject=void 0}),r.clear()}},updateMotion:function(t,e){t.allowRotation&&this.computeAngularVelocity(t,e),this.computeVelocity(t,e)},computeAngularVelocity:function(t,e){var i=t.angularVelocity,r=t.angularAcceleration,s=t.angularDrag,a=t.maxAngular;r?i+=r*e:t.allowDrag&&s&&(p(i-(s*=e),0,.1)?i-=s:g(i+s,0,.1)?i+=s:i=0);var o=(i=n(i,-a,a))-t.angularVelocity;t.angularVelocity+=o,t.rotation+=t.angularVelocity*e},computeVelocity:function(t,e){var i=t.velocity.x,r=t.acceleration.x,s=t.drag.x,a=t.maxVelocity.x,o=t.velocity.y,h=t.acceleration.y,l=t.drag.y,u=t.maxVelocity.y,d=t.speed,c=t.maxSpeed,m=t.allowDrag,v=t.useDamping;t.allowGravity&&(i+=(this.gravity.x+t.gravity.x)*e,o+=(this.gravity.y+t.gravity.y)*e),r?i+=r*e:m&&s&&(v?(i*=s=Math.pow(s,e),d=Math.sqrt(i*i+o*o),f(d,0,.001)&&(i=0)):p(i-(s*=e),0,.01)?i-=s:g(i+s,0,.01)?i+=s:i=0),h?o+=h*e:m&&l&&(v?(o*=l=Math.pow(l,e),d=Math.sqrt(i*i+o*o),f(d,0,.001)&&(o=0)):p(o-(l*=e),0,.01)?o-=l:g(o+l,0,.01)?o+=l:o=0),i=n(i,-a,a),o=n(o,-u,u),t.velocity.set(i,o),c>-1&&t.velocity.length()>c&&(t.velocity.normalize().scale(c),d=c),t.speed=d},separate:function(t,e,i,r,s){var n,a,o=!1,h=!0;if(!t.enable||!e.enable||t.checkCollision.none||e.checkCollision.none||!this.intersects(t,e)||0===(t.collisionMask&e.collisionCategory)||0===(e.collisionMask&t.collisionCategory))return o;if(i&&!1===i.call(r,t.gameObject||t,e.gameObject||e))return o;if(t.isCircle||e.isCircle){var l=this.separateCircle(t,e,s);l.result?(o=!0,h=!1):(n=l.x,a=l.y,h=!0)}if(h){var u=!1,d=!1,f=this.OVERLAP_BIAS;s?(u=A(t,e,s,f,n),d=_(t,e,s,f,a)):this.forceX||Math.abs(this.gravity.y+t.gravity.y)C&&(p=l(y,x,C,S)-w):x>E&&(yC&&(p=l(y,x,C,E)-w)),p*=-1}else p=t.halfWidth+e.halfWidth-u(a,o);t.overlapR=p,e.overlapR=p;var A=r(a,o),_=(p+T.EPSILON)*Math.cos(A),M=(p+T.EPSILON)*Math.sin(A),R={overlap:p,result:!1,x:_,y:M};if(i&&(!g||g&&0!==p))return R.result=!0,R;if(!g&&0===p||h&&d||t.customSeparateX||e.customSeparateX)return R.x=void 0,R.y=void 0,R;var P=!t.pushable&&!e.pushable;if(g){var O=a.x-o.x,L=a.y-o.y,F=Math.sqrt(Math.pow(O,2)+Math.pow(L,2)),D=(o.x-a.x)/F||0,I=(o.y-a.y)/F||0,N=2*(c.x*D+c.y*I-f.x*D-f.y*I)/(t.mass+e.mass);!h&&!d&&t.pushable&&e.pushable||(N*=2),!h&&t.pushable&&(c.x=c.x-N/t.mass*D,c.y=c.y-N/t.mass*I,c.multiply(t.bounce)),!d&&e.pushable&&(f.x=f.x+N/e.mass*D,f.y=f.y+N/e.mass*I,f.multiply(e.bounce)),h||d||(_*=.5,M*=.5),(!h||t.pushable||P)&&(t.x-=_,t.y-=M,t.updateCenter()),(!d||e.pushable||P)&&(e.x+=_,e.y+=M,e.updateCenter()),R.result=!0}else h||!t.pushable&&!P||(t.x-=_,t.y-=M,t.updateCenter()),(!d||e.pushable||P)&&(e.x+=_,e.y+=M,e.updateCenter()),R.x=void 0,R.y=void 0;return R},intersects:function(t,e){return t!==e&&(t.isCircle||e.isCircle?t.isCircle?e.isCircle?u(t.center,e.center)<=t.halfWidth+e.halfWidth:this.circleBodyIntersects(t,e):this.circleBodyIntersects(e,t):!(t.right<=e.left||t.bottom<=e.top||t.left>=e.right||t.top>=e.bottom))},circleBodyIntersects:function(t,e){var i=n(t.center.x,e.left,e.right),r=n(t.center.y,e.top,e.bottom);return(t.center.x-i)*(t.center.x-i)+(t.center.y-r)*(t.center.y-r)<=t.halfWidth*t.halfWidth},overlap:function(t,e,i,r,s){return void 0===i&&(i=null),void 0===r&&(r=null),void 0===s&&(s=i),this.collideObjects(t,e,i,r,s,!0)},collide:function(t,e,i,r,s){return void 0===i&&(i=null),void 0===r&&(r=null),void 0===s&&(s=i),this.collideObjects(t,e,i,r,s,!1)},collideObjects:function(t,e,i,r,s,n){var a,o;!t.isParent||void 0!==t.physicsType&&void 0!==e&&t!==e||(t=Array.from(t.children)),e&&e.isParent&&void 0===e.physicsType&&(e=Array.from(e.children));var h=Array.isArray(t),l=Array.isArray(e);if(this._total=0,h||l)if(!h&&l)for(a=0;a0},collideHandler:function(t,e,i,r,s,n){if(void 0===e&&t.isParent)return this.collideGroupVsGroup(t,t,i,r,s,n);if(!t||!e)return!1;if(t.body||t.isBody){if(e.body||e.isBody)return this.collideSpriteVsSprite(t,e,i,r,s,n);if(e.isParent)return this.collideSpriteVsGroup(t,e,i,r,s,n);if(e.isTilemap)return this.collideSpriteVsTilemapLayer(t,e,i,r,s,n)}else if(t.isParent){if(e.body||e.isBody)return this.collideSpriteVsGroup(e,t,i,r,s,n);if(e.isParent)return this.collideGroupVsGroup(t,e,i,r,s,n);if(e.isTilemap)return this.collideGroupVsTilemapLayer(t,e,i,r,s,n)}else if(t.isTilemap){if(e.body||e.isBody)return this.collideSpriteVsTilemapLayer(e,t,i,r,s,n);if(e.isParent)return this.collideGroupVsTilemapLayer(e,t,i,r,s,n)}},canCollide:function(t,e){return t&&e&&0!==(t.collisionMask&e.collisionCategory)&&0!==(e.collisionMask&t.collisionCategory)},collideSpriteVsSprite:function(t,e,i,r,s,n){var a=t.isBody?t:t.body,o=e.isBody?e:e.body;return!!this.canCollide(a,o)&&(this.separate(a,o,r,s,n)&&(i&&i.call(s,t,e),this._total++),!0)},collideSpriteVsGroup:function(t,e,i,r,s,n){var a,o,l,u=t.isBody?t:t.body;if(0!==e.getLength()&&u&&u.enable&&!u.checkCollision.none&&this.canCollide(u,e))if(this.useTree||e.physicsType===h.STATIC_BODY){var d=this.treeMinMax;d.minX=u.left,d.minY=u.top,d.maxX=u.right,d.maxY=u.bottom;var c=e.physicsType===h.DYNAMIC_BODY?this.tree.search(d):this.staticTree.search(d);for(o=c.length,a=0;a0&&(t.blocked.none=!1,t.blocked.right=!0),t.position.x-=e,t.updateCenter(),0===t.bounce.x?t.velocity.x=0:t.velocity.x=-t.velocity.x*t.bounce.x}},67013(t){t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.up=!0):e>0&&(t.blocked.none=!1,t.blocked.down=!0),t.position.y-=e,t.updateCenter(),0===t.bounce.y?t.velocity.y=0:t.velocity.y=-t.velocity.y*t.bounce.y}},40012(t,e,i){var r=i(21329),s=i(53442),n=i(2483);t.exports=function(t,e,i,a,o,h,l){var u=a.left,d=a.top,c=a.right,f=a.bottom,p=i.faceLeft||i.faceRight,g=i.faceTop||i.faceBottom;if(l||(p=!0,g=!0),!p&&!g)return!1;var m=0,v=0,y=0,x=1;if(e.deltaAbsX()>e.deltaAbsY()?y=-1:e.deltaAbsX()0&&u&&t.checkCollision.right&&h&&t.right>i&&(o=t.right-i)>n&&(o=0),0!==o&&(t.customSeparateX?t.overlapX=o:r(t,o)),o}},53442(t,e,i){var r=i(67013);t.exports=function(t,e,i,s,n,a){var o=0,h=e.faceTop,l=e.faceBottom,u=e.collideUp,d=e.collideDown;return a||(h=!0,l=!0,u=!0,d=!0),t.deltaY()<0&&d&&t.checkCollision.up?l&&t.y0&&u&&t.checkCollision.down&&h&&t.bottom>i&&(o=t.bottom-i)>n&&(o=0),0!==o&&(t.customSeparateY?t.overlapY=o:r(t,o)),o}},2483(t){t.exports=function(t,e){return!(e.right<=t.left||e.bottom<=t.top||e.position.x>=t.right||e.position.y>=t.bottom)}},55173(t,e,i){var r={ProcessTileCallbacks:i(96602),ProcessTileSeparationX:i(36294),ProcessTileSeparationY:i(67013),SeparateTile:i(40012),TileCheckX:i(21329),TileCheckY:i(53442),TileIntersectsBody:i(2483)};t.exports=r},44563(t,e,i){t.exports={Arcade:i(27064),Matter:i(3875)}},68174(t,e,i){var r=i(83419),s=i(26099),n=new r({initialize:function(){this.boundsCenter=new s,this.centerDiff=new s},parseBody:function(t){if(!(t=t.hasOwnProperty("body")?t.body:t).hasOwnProperty("bounds")||!t.hasOwnProperty("centerOfMass"))return!1;var e=this.boundsCenter,i=this.centerDiff,r=t.bounds.max.x-t.bounds.min.x,s=t.bounds.max.y-t.bounds.min.y,n=r*t.centerOfMass.x,a=s*t.centerOfMass.y;return e.set(r/2,s/2),i.set(n-e.x,a-e.y),!0},getTopLeft:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var r=this.boundsCenter,n=this.centerDiff;return new s(e+r.x+n.x,i+r.y+n.y)}return!1},getTopCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var r=this.boundsCenter,n=this.centerDiff;return new s(e+n.x,i+r.y+n.y)}return!1},getTopRight:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var r=this.boundsCenter,n=this.centerDiff;return new s(e-(r.x-n.x),i+r.y+n.y)}return!1},getLeftCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var r=this.boundsCenter,n=this.centerDiff;return new s(e+r.x+n.x,i+n.y)}return!1},getCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var r=this.centerDiff;return new s(e+r.x,i+r.y)}return!1},getRightCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var r=this.boundsCenter,n=this.centerDiff;return new s(e-(r.x-n.x),i+n.y)}return!1},getBottomLeft:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var r=this.boundsCenter,n=this.centerDiff;return new s(e+r.x+n.x,i-(r.y-n.y))}return!1},getBottomCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var r=this.boundsCenter,n=this.centerDiff;return new s(e+n.x,i-(r.y-n.y))}return!1},getBottomRight:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var r=this.boundsCenter,n=this.centerDiff;return new s(e-(r.x-n.x),i-(r.y-n.y))}return!1}});t.exports=n},19933(t,e,i){var r=i(6790);r.Body=i(22562),r.Composite=i(69351),r.World=i(4372),r.Collision=i(52284),r.Detector=i(81388),r.Pairs=i(99561),r.Pair=i(4506),r.Query=i(73296),r.Resolver=i(66272),r.Constraint=i(48140),r.Common=i(53402),r.Engine=i(48413),r.Events=i(35810),r.Sleeping=i(53614),r.Plugin=i(73832),r.Bodies=i(66280),r.Composites=i(74116),r.Axes=i(66615),r.Bounds=i(15647),r.Svg=i(74058),r.Vector=i(31725),r.Vertices=i(41598),r.World.add=r.Composite.add,r.World.remove=r.Composite.remove,r.World.addComposite=r.Composite.addComposite,r.World.addBody=r.Composite.addBody,r.World.addConstraint=r.Composite.addConstraint,r.World.clear=r.Composite.clear,t.exports=r},28137(t,e,i){var r=i(66280),s=i(83419),n=i(74116),a=i(48140),o=i(74058),h=i(75803),l=i(23181),u=i(34803),d=i(73834),c=i(19496),f=i(85791),p=i(98713),g=i(41598),m=new s({initialize:function(t){this.world=t,this.scene=t.scene,this.sys=t.scene.sys},rectangle:function(t,e,i,s,n){var a=r.rectangle(t,e,i,s,n);return this.world.add(a),a},trapezoid:function(t,e,i,s,n,a){var o=r.trapezoid(t,e,i,s,n,a);return this.world.add(o),o},circle:function(t,e,i,s,n){var a=r.circle(t,e,i,s,n);return this.world.add(a),a},polygon:function(t,e,i,s,n){var a=r.polygon(t,e,i,s,n);return this.world.add(a),a},fromVertices:function(t,e,i,s,n,a,o){"string"==typeof i&&(i=g.fromPath(i));var h=r.fromVertices(t,e,i,s,n,a,o);return this.world.add(h),h},fromPhysicsEditor:function(t,e,i,r,s){void 0===s&&(s=!0);var n=c.parseBody(t,e,i,r);return s&&!this.world.has(n)&&this.world.add(n),n},fromSVG:function(t,e,i,s,n,a){void 0===s&&(s=1),void 0===n&&(n={}),void 0===a&&(a=!0);for(var h=i.getElementsByTagName("path"),l=[],u=0;u0},intersectPoint:function(t,e,i){i=this.getMatterBodies(i);var r=M.create(t,e),s=[];return C.point(i,r).forEach(function(t){-1===s.indexOf(t)&&s.push(t)}),s},intersectRect:function(t,e,i,r,s,n){void 0===s&&(s=!1),n=this.getMatterBodies(n);var a={min:{x:t,y:e},max:{x:t+i,y:e+r}},o=[];return C.region(n,a,s).forEach(function(t){-1===o.indexOf(t)&&o.push(t)}),o},intersectRay:function(t,e,i,r,s,n){void 0===s&&(s=1),n=this.getMatterBodies(n);for(var a=[],o=C.ray(n,M.create(t,e),M.create(i,r),s),h=0;h0?this.setFromTileCollision(i):this.setFromTileRectangle(i),r=this.body}if(e.flipX||e.flipY){var o={x:e.getCenterX(),y:e.getCenterY()},u=e.flipX?-1:1,d=e.flipY?-1:1;s.scale(r,u,d,o)}},setFromTileRectangle:function(t){void 0===t&&(t={}),u(t,"isStatic")||(t.isStatic=!0),u(t,"addToWorld")||(t.addToWorld=!0);var e=this.tile.getBounds(),i=e.x+e.width/2,s=e.y+e.height/2,n=r.rectangle(i,s,e.width,e.height,t);return this.setBody(n,t.addToWorld),this},setFromTileCollision:function(t){void 0===t&&(t={}),u(t,"isStatic")||(t.isStatic=!0),u(t,"addToWorld")||(t.addToWorld=!0);for(var e=this.tile.tilemapLayer.scaleX,i=this.tile.tilemapLayer.scaleY,n=this.tile.getLeft(),a=this.tile.getTop(),h=this.tile.getCollisionGroup(),c=l(h,"objects",[]),f=[],p=0;p1){var C=o(t);C.parts=f,this.setBody(s.create(C),C.addToWorld)}return this},setBody:function(t,e){return void 0===e&&(e=!0),this.body&&this.removeBody(),this.body=t,this.body.gameObject=this,e&&this.world.add(this.body),this},removeBody:function(){return this.body&&(this.world.remove(this.body),this.body.gameObject=void 0,this.body=void 0),this},destroy:function(){this.removeBody(),this.tile.physics.matterBody=void 0,this.removeAllListeners()}});t.exports=c},19496(t,e,i){var r=i(66280),s=i(22562),n=i(53402),a=i(95540),o=i(41598),h={parseBody:function(t,e,i,r){void 0===r&&(r={});for(var o=a(i,"fixtures",[]),h=[],l=0;l1?1:0;s0&&s.map(function(t){i=t.bodyA,r=t.bodyB,i.gameObject&&i.gameObject.emit("collide",i,r,t),r.gameObject&&r.gameObject.emit("collide",r,i,t),p.trigger(i,"onCollide",{pair:t}),p.trigger(r,"onCollide",{pair:t}),i.onCollideCallback&&i.onCollideCallback(t),r.onCollideCallback&&r.onCollideCallback(t),i.onCollideWith[r.id]&&i.onCollideWith[r.id](r,t),r.onCollideWith[i.id]&&r.onCollideWith[i.id](i,t)}),t.emit(u.COLLISION_START,e,i,r)}),p.on(e,"collisionActive",function(e){var i,r,s=e.pairs;s.length>0&&s.map(function(t){i=t.bodyA,r=t.bodyB,i.gameObject&&i.gameObject.emit("collideActive",i,r,t),r.gameObject&&r.gameObject.emit("collideActive",r,i,t),p.trigger(i,"onCollideActive",{pair:t}),p.trigger(r,"onCollideActive",{pair:t}),i.onCollideActiveCallback&&i.onCollideActiveCallback(t),r.onCollideActiveCallback&&r.onCollideActiveCallback(t)}),t.emit(u.COLLISION_ACTIVE,e,i,r)}),p.on(e,"collisionEnd",function(e){var i,r,s=e.pairs;s.length>0&&s.map(function(t){i=t.bodyA,r=t.bodyB,i.gameObject&&i.gameObject.emit("collideEnd",i,r,t),r.gameObject&&r.gameObject.emit("collideEnd",r,i,t),p.trigger(i,"onCollideEnd",{pair:t}),p.trigger(r,"onCollideEnd",{pair:t}),i.onCollideEndCallback&&i.onCollideEndCallback(t),r.onCollideEndCallback&&r.onCollideEndCallback(t)}),t.emit(u.COLLISION_END,e,i,r)})},setBounds:function(t,e,i,r,s,n,a,o,h){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===r&&(r=this.scene.sys.scale.height),void 0===s&&(s=64),void 0===n&&(n=!0),void 0===a&&(a=!0),void 0===o&&(o=!0),void 0===h&&(h=!0),this.updateWall(n,"left",t-s,e-s,s,r+2*s),this.updateWall(a,"right",t+i,e-s,s,r+2*s),this.updateWall(o,"top",t,e-s,i,s),this.updateWall(h,"bottom",t,e+r,i,s),this},updateWall:function(t,e,i,r,s,n){var a=this.walls[e];t?(a&&m.remove(this.localWorld,a),i+=s/2,r+=n/2,this.walls[e]=this.create(i,r,s,n,{isStatic:!0,friction:0,frictionStatic:0})):(a&&m.remove(this.localWorld,a),this.walls[e]=null)},createDebugGraphic:function(){var t=this.scene.sys.add.graphics({x:0,y:0});return t.setDepth(Number.MAX_VALUE),this.debugGraphic=t,this.drawDebug=!0,t},disableGravity:function(){return this.localWorld.gravity.x=0,this.localWorld.gravity.y=0,this.localWorld.gravity.scale=0,this},setGravity:function(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=1),void 0===i&&(i=.001),this.localWorld.gravity.x=t,this.localWorld.gravity.y=e,this.localWorld.gravity.scale=i,this},create:function(t,e,i,s,n){var a=r.rectangle(t,e,i,s,n);return m.add(this.localWorld,a),a},add:function(t){return m.add(this.localWorld,t),this},remove:function(t,e){Array.isArray(t)||(t=[t]);for(var i=0;iMath.max(v._maxFrameDelta,i.maxFrameTime))&&(o=i.frameDelta||v._frameDeltaFallback),i.frameDeltaSmoothing){i.frameDeltaHistory.push(o),i.frameDeltaHistory=i.frameDeltaHistory.slice(-i.frameDeltaHistorySize);var l=i.frameDeltaHistory.slice(0).sort(),u=i.frameDeltaHistory.slice(l.length*v._smoothingLowerBound,l.length*v._smoothingUpperBound);o=v._mean(u)||o}i.frameDeltaSnapping&&(o=1e3/Math.round(1e3/o)),i.frameDelta=o,i.timeLastTick=t,i.timeBuffer+=i.frameDelta,i.timeBuffer=a.clamp(i.timeBuffer,0,i.frameDelta+s*v._timeBufferMargin),i.lastUpdatesDeferred=0;for(var d=i.maxUpdates||Math.ceil(i.maxFrameTime/s),c=a.now();s>0&&i.timeBuffer>=s*v._timeBufferMargin;){h.update(e,s),i.timeBuffer-=s,n+=1;var f=a.now()-r,p=a.now()-c,g=f+v._elapsedNextEstimate*p/n;if(n>=d||g>i.maxFrameTime){i.lastUpdatesDeferred=Math.round(Math.max(0,i.timeBuffer/s-v._timeBufferMargin));break}}}},step:function(t){h.update(this.engine,t)},update60Hz:function(){return 1e3/60},update30Hz:function(){return 1e3/30},has:function(t){var e=t.hasOwnProperty("body")?t.body:t;return null!==o.get(this.localWorld,e.id,e.type)},getAllBodies:function(){return o.allBodies(this.localWorld)},getAllConstraints:function(){return o.allConstraints(this.localWorld)},getAllComposites:function(){return o.allComposites(this.localWorld)},postUpdate:function(){if(this.drawDebug){var t=this.debugConfig,e=this.engine,i=this.debugGraphic,r=o.allBodies(this.localWorld);this.debugGraphic.clear(),t.showBroadphase&&e.broadphase.controller&&this.renderGrid(e.broadphase,i,t.broadphaseColor,.5),t.showBounds&&this.renderBodyBounds(r,i,t.boundsColor,.5),(t.showBody||t.showStaticBody)&&this.renderBodies(r),t.showJoint&&this.renderJoints(),(t.showAxes||t.showAngleIndicator)&&this.renderBodyAxes(r,i,t.showAxes,t.angleColor,.5),t.showVelocity&&this.renderBodyVelocity(r,i,t.velocityColor,1,2),t.showSeparations&&this.renderSeparations(e.pairs.list,i,t.separationColor),t.showCollisions&&this.renderCollisions(e.pairs.list,i,t.collisionColor)}},renderGrid:function(t,e,i,r){e.lineStyle(1,i,r);for(var s=a.keys(t.buckets),n=0;n0){var l=h[0].vertex.x,u=h[0].vertex.y;2===s.contactCount&&(l=(h[0].vertex.x+h[1].vertex.x)/2,u=(h[0].vertex.y+h[1].vertex.y)/2),o.bodyB===o.supports[0].body||o.bodyA.isStatic?e.lineBetween(l-8*o.normal.x,u-8*o.normal.y,l,u):e.lineBetween(l+8*o.normal.x,u+8*o.normal.y,l,u)}}return this},renderBodyBounds:function(t,e,i,r){e.lineStyle(1,i,r);for(var s=0;s1?1:0;h1?1:0;o1?1:0;o1&&this.renderConvexHull(g,e,f,y)}}},renderBody:function(t,e,i,r,s,n,a,o){void 0===r&&(r=null),void 0===s&&(s=null),void 0===n&&(n=1),void 0===a&&(a=null),void 0===o&&(o=null);for(var h=this.debugConfig,l=h.sensorFillColor,u=h.sensorLineColor,d=t.parts,c=d.length,f=c>1?1:0;f1){var s=t.vertices;e.lineStyle(r,i),e.beginPath(),e.moveTo(s[0].x,s[0].y);for(var n=1;n0&&(e.fillStyle(o),e.fillCircle(u.x,u.y,h),e.fillCircle(d.x,d.y,h)),this},resetCollisionIDs:function(){return s._nextCollidingGroupId=1,s._nextNonCollidingGroupId=-1,s._nextCategory=1,this},shutdown:function(){p.off(this.engine),this.removeAllListeners(),m.clear(this.localWorld,!1),h.clear(this.engine),this.drawDebug&&this.debugGraphic.destroy()},destroy:function(){this.shutdown()}});t.exports=x},70410(t){t.exports={setBounce:function(t){return this.body.restitution=t,this}}},66968(t){var e={setCollisionCategory:function(t){return this.body.collisionFilter.category=t,this},setCollisionGroup:function(t){return this.body.collisionFilter.group=t,this},setCollidesWith:function(t){var e=0;if(Array.isArray(t))for(var i=0;i0&&n.rotateAbout(o.position,r,t.position,o.position)}},r.setVelocity=function(t,e){var i=t.deltaTime/r._baseDelta;t.positionPrev.x=t.position.x-e.x*i,t.positionPrev.y=t.position.y-e.y*i,t.velocity.x=(t.position.x-t.positionPrev.x)/i,t.velocity.y=(t.position.y-t.positionPrev.y)/i,t.speed=n.magnitude(t.velocity)},r.getVelocity=function(t){var e=r._baseDelta/t.deltaTime;return{x:(t.position.x-t.positionPrev.x)*e,y:(t.position.y-t.positionPrev.y)*e}},r.getSpeed=function(t){return n.magnitude(r.getVelocity(t))},r.setSpeed=function(t,e){r.setVelocity(t,n.mult(n.normalise(r.getVelocity(t)),e))},r.setAngularVelocity=function(t,e){var i=t.deltaTime/r._baseDelta;t.anglePrev=t.angle-e*i,t.angularVelocity=(t.angle-t.anglePrev)/i,t.angularSpeed=Math.abs(t.angularVelocity)},r.getAngularVelocity=function(t){return(t.angle-t.anglePrev)*r._baseDelta/t.deltaTime},r.getAngularSpeed=function(t){return Math.abs(r.getAngularVelocity(t))},r.setAngularSpeed=function(t,e){r.setAngularVelocity(t,o.sign(r.getAngularVelocity(t))*e)},r.translate=function(t,e,i){r.setPosition(t,n.add(t.position,e),i)},r.rotate=function(t,e,i,s){if(i){var n=Math.cos(e),a=Math.sin(e),o=t.position.x-i.x,h=t.position.y-i.y;r.setPosition(t,{x:i.x+(o*n-h*a),y:i.y+(o*a+h*n)},s),r.setAngle(t,t.angle+e,s)}else r.setAngle(t,t.angle+e,s)},r.scale=function(t,e,i,n){var a=0,o=0;n=n||t.position;for(var u=t.inertia===1/0,d=0;d0&&(a+=c.area,o+=c.inertia),c.position.x=n.x+(c.position.x-n.x)*e,c.position.y=n.y+(c.position.y-n.y)*i,h.update(c.bounds,c.vertices,t.velocity)}t.parts.length>1&&(t.area=a,t.isStatic||(r.setMass(t,t.density*a),r.setInertia(t,o))),t.circleRadius&&(e===i?t.circleRadius*=e:t.circleRadius=null),u&&r.setInertia(t,1/0)},r.update=function(t,e){var i=(e=(void 0!==e?e:1e3/60)*t.timeScale)*e,a=r._timeCorrection?e/(t.deltaTime||e):1,u=1-t.frictionAir*(e/o._baseDelta),d=(t.position.x-t.positionPrev.x)*a,c=(t.position.y-t.positionPrev.y)*a;t.velocity.x=d*u+t.force.x/t.mass*i,t.velocity.y=c*u+t.force.y/t.mass*i,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.position.x+=t.velocity.x,t.position.y+=t.velocity.y,t.deltaTime=e,t.angularVelocity=(t.angle-t.anglePrev)*u*a+t.torque/t.inertia*i,t.anglePrev=t.angle,t.angle+=t.angularVelocity,t.speed=n.magnitude(t.velocity),t.angularSpeed=Math.abs(t.angularVelocity);for(var f=0;f0&&(p.position.x+=t.velocity.x,p.position.y+=t.velocity.y),0!==t.angularVelocity&&(s.rotate(p.vertices,t.angularVelocity,t.position),l.rotate(p.axes,t.angularVelocity),f>0&&n.rotateAbout(p.position,t.angularVelocity,t.position,p.position)),h.update(p.bounds,p.vertices,t.velocity)}},r.updateVelocities=function(t){var e=r._baseDelta/t.deltaTime,i=t.velocity;i.x=(t.position.x-t.positionPrev.x)*e,i.y=(t.position.y-t.positionPrev.y)*e,t.speed=Math.sqrt(i.x*i.x+i.y*i.y),t.angularVelocity=(t.angle-t.anglePrev)*e,t.angularSpeed=Math.abs(t.angularVelocity)},r.applyForce=function(t,e,i){var r=e.x-t.position.x,s=e.y-t.position.y;t.force.x+=i.x,t.force.y+=i.y,t.torque+=r*i.y-s*i.x},r._totalProperties=function(t){for(var e={mass:0,area:0,inertia:0,centre:{x:0,y:0}},i=1===t.parts.length?0:1;i=0&&(v=-v,y=-y),d.x=v,d.y=y,c.x=-y,c.y=v,f.x=v*g,f.y=y*g,s.depth=g;var x=r._findSupports(t,e,d,1),T=0;if(o.contains(t.vertices,x[0])&&(p[T++]=x[0]),o.contains(t.vertices,x[1])&&(p[T++]=x[1]),T<2){var w=r._findSupports(e,t,d,-1);o.contains(e.vertices,w[0])&&(p[T++]=w[0]),T<2&&o.contains(e.vertices,w[1])&&(p[T++]=w[1])}return 0===T&&(p[T++]=x[0]),s.supportCount=T,s},r._overlapAxes=function(t,e,i,r){var s,n,a,o,h,l,u=e.length,d=i.length,c=e[0].x,f=e[0].y,p=i[0].x,g=i[0].y,m=r.length,v=Number.MAX_VALUE,y=0;for(h=0;hC?C=o:oE?E=o:op)break;if(!(gM.max.y)&&(!v||!T.isStatic&&!T.isSleeping)&&h(c.collisionFilter,T.collisionFilter)){var w=T.parts.length;if(x&&1===w)(A=l(c,T,s))&&(u[d++]=A);else for(var b=w>1?1:0,S=y>1?1:0;SM.max.x||f.max.xM.max.y||(A=l(C,_,s))&&(u[d++]=A)}}}}return u.length!==d&&(u.length=d),u},r.canCollide=function(t,e){return t.group===e.group&&0!==t.group?t.group>0:0!==(t.mask&e.category)&&0!==(e.mask&t.category)},r._compareBoundsX=function(t,e){return t.bounds.min.x-e.bounds.min.x}},4506(t,e,i){var r={};t.exports=r;var s=i(43424);r.create=function(t,e){var i=t.bodyA,n=t.bodyB,a={id:r.id(i,n),bodyA:i,bodyB:n,collision:t,contacts:[s.create(),s.create()],contactCount:0,separation:0,isActive:!0,isSensor:i.isSensor||n.isSensor,timeCreated:e,timeUpdated:e,inverseMass:0,friction:0,frictionStatic:0,restitution:0,slop:0};return r.update(a,t,e),a},r.update=function(t,e,i){var r=e.supports,s=e.supportCount,n=t.contacts,a=e.parentA,o=e.parentB;t.isActive=!0,t.timeUpdated=i,t.collision=e,t.separation=e.depth,t.inverseMass=a.inverseMass+o.inverseMass,t.friction=a.frictiono.frictionStatic?a.frictionStatic:o.frictionStatic,t.restitution=a.restitution>o.restitution?a.restitution:o.restitution,t.slop=a.slop>o.slop?a.slop:o.slop,t.contactCount=s,e.pair=t;var h=r[0],l=n[0],u=r[1],d=n[1];d.vertex!==h&&l.vertex!==u||(n[1]=l,n[0]=l=d,d=n[1]),l.vertex=h,d.vertex=u},r.setActive=function(t,e,i){e?(t.isActive=!0,t.timeUpdated=i):(t.isActive=!1,t.contactCount=0)},r.id=function(t,e){return t.id=i?d[f++]=n:(l(n,!1,i),n.collision.bodyA.sleepCounter>0&&n.collision.bodyB.sleepCounter>0?d[f++]=n:(g[x++]=n,delete u[n.id]));d.length!==f&&(d.length=f),p.length!==y&&(p.length=y),g.length!==x&&(g.length=x),m.length!==T&&(m.length=T)},r.clear=function(t){return t.table={},t.list.length=0,t.collisionStart.length=0,t.collisionActive.length=0,t.collisionEnd.length=0,t}},73296(t,e,i){var r={};t.exports=r;var s=i(31725),n=i(52284),a=i(15647),o=i(66280),h=i(41598);r.collides=function(t,e){for(var i=[],r=e.length,s=t.bounds,o=n.collides,h=a.overlaps,l=0;lH?(s=W>0?W:-W,(i=g.friction*(W>0?1:-1)*l)<-s?i=-s:i>s&&(i=s)):(i=W,s=f);var j=N*T-B*x,q=k*T-U*x,K=_/(S+v.inverseInertia*j*j+y.inverseInertia*q*q),Z=(1+g.restitution)*X*K;if(i*=K,X0&&(D.normalImpulse=0),Z=D.normalImpulse-Q}if(W<-d||W>d)D.tangentImpulse=0;else{var J=D.tangentImpulse;D.tangentImpulse+=i,D.tangentImpulse<-s&&(D.tangentImpulse=-s),D.tangentImpulse>s&&(D.tangentImpulse=s),i=D.tangentImpulse-J}var $=x*Z+w*i,tt=T*Z+b*i;v.isStatic||v.isSleeping||(v.positionPrev.x+=$*v.inverseMass,v.positionPrev.y+=tt*v.inverseMass,v.anglePrev+=(N*tt-B*$)*v.inverseInertia),y.isStatic||y.isSleeping||(y.positionPrev.x-=$*y.inverseMass,y.positionPrev.y-=tt*y.inverseMass,y.anglePrev-=(k*tt-U*$)*y.inverseInertia)}}}}},48140(t,e,i){var r={};t.exports=r;var s=i(41598),n=i(31725),a=i(53614),o=i(15647),h=i(66615),l=i(53402);r._warming=.4,r._torqueDampen=1,r._minLength=1e-6,r.create=function(t){var e=t;e.bodyA&&!e.pointA&&(e.pointA={x:0,y:0}),e.bodyB&&!e.pointB&&(e.pointB={x:0,y:0});var i=e.bodyA?n.add(e.bodyA.position,e.pointA):e.pointA,r=e.bodyB?n.add(e.bodyB.position,e.pointB):e.pointB,s=n.magnitude(n.sub(i,r));e.length=void 0!==e.length?e.length:s,e.id=e.id||l.nextId(),e.label=e.label||"Constraint",e.type="constraint",e.stiffness=e.stiffness||(e.length>0?1:.7),e.damping=e.damping||0,e.angularStiffness=e.angularStiffness||0,e.angleA=e.bodyA?e.bodyA.angle:e.angleA,e.angleB=e.bodyB?e.bodyB.angle:e.angleB,e.plugin={};var a={visible:!0,type:"line",anchors:!0,lineColor:null,lineOpacity:null,lineThickness:null,pinSize:null,anchorColor:null,anchorSize:null};return 0===e.length&&e.stiffness>.1?(a.type="pin",a.anchors=!1):e.stiffness<.9&&(a.type="spring"),e.render=l.extend(a,e.render),e},r.preSolveAll=function(t){for(var e=0;e=1||0===t.length?t.stiffness*e:t.stiffness*e*e,x=t.damping*e,T=n.mult(u,v*y),w=(i?i.inverseMass:0)+(s?s.inverseMass:0),b=w+((i?i.inverseInertia:0)+(s?s.inverseInertia:0));if(x>0){var S=n.create();p=n.div(u,d),m=n.sub(s&&n.sub(s.position,s.positionPrev)||S,i&&n.sub(i.position,i.positionPrev)||S),g=n.dot(p,m)}i&&!i.isStatic&&(f=i.inverseMass/w,i.constraintImpulse.x-=T.x*f,i.constraintImpulse.y-=T.y*f,i.position.x-=T.x*f,i.position.y-=T.y*f,x>0&&(i.positionPrev.x-=x*p.x*g*f,i.positionPrev.y-=x*p.y*g*f),c=n.cross(a,T)/b*r._torqueDampen*i.inverseInertia*(1-t.angularStiffness),i.constraintImpulse.angle-=c,i.angle-=c),s&&!s.isStatic&&(f=s.inverseMass/w,s.constraintImpulse.x+=T.x*f,s.constraintImpulse.y+=T.y*f,s.position.x+=T.x*f,s.position.y+=T.y*f,x>0&&(s.positionPrev.x+=x*p.x*g*f,s.positionPrev.y+=x*p.y*g*f),c=n.cross(o,T)/b*r._torqueDampen*s.inverseInertia*(1-t.angularStiffness),s.constraintImpulse.angle+=c,s.angle+=c)}}},r.postSolveAll=function(t){for(var e=0;e0&&(d.position.x+=l.x,d.position.y+=l.y),0!==l.angle&&(s.rotate(d.vertices,l.angle,i.position),h.rotate(d.axes,l.angle),u>0&&n.rotateAbout(d.position,l.angle,i.position,d.position)),o.update(d.bounds,d.vertices,i.velocity)}l.angle*=r._warming,l.x*=r._warming,l.y*=r._warming}}},r.pointAWorld=function(t){return{x:(t.bodyA?t.bodyA.position.x:0)+(t.pointA?t.pointA.x:0),y:(t.bodyA?t.bodyA.position.y:0)+(t.pointA?t.pointA.y:0)}},r.pointBWorld=function(t){return{x:(t.bodyB?t.bodyB.position.x:0)+(t.pointB?t.pointB.x:0),y:(t.bodyB?t.bodyB.position.y:0)+(t.pointB?t.pointB.y:0)}},r.currentLength=function(t){var e=(t.bodyA?t.bodyA.position.x:0)+(t.pointA?t.pointA.x:0),i=(t.bodyA?t.bodyA.position.y:0)+(t.pointA?t.pointA.y:0),r=e-((t.bodyB?t.bodyB.position.x:0)+(t.pointB?t.pointB.x:0)),s=i-((t.bodyB?t.bodyB.position.y:0)+(t.pointB?t.pointB.y:0));return Math.sqrt(r*r+s*s)}},53402(t,e,i){var r={};t.exports=r,function(){r._baseDelta=1e3/60,r._nextId=0,r._seed=0,r._nowStartTime=+new Date,r._warnedOnce={},r._decomp=null,r.extend=function(t,e){var i,s;"boolean"==typeof e?(i=2,s=e):(i=1,s=!0);for(var n=i;n0;e--){var i=Math.floor(r.random()*(e+1)),s=t[e];t[e]=t[i],t[i]=s}return t},r.choose=function(t){return t[Math.floor(r.random()*t.length)]},r.isElement=function(t){return"undefined"!=typeof HTMLElement?t instanceof HTMLElement:!!(t&&t.nodeType&&t.nodeName)},r.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)},r.isFunction=function(t){return"function"==typeof t},r.isPlainObject=function(t){return"object"==typeof t&&t.constructor===Object},r.isString=function(t){return"[object String]"===toString.call(t)},r.clamp=function(t,e,i){return ti?i:t},r.sign=function(t){return t<0?-1:1},r.now=function(){if("undefined"!=typeof window&&window.performance){if(window.performance.now)return window.performance.now();if(window.performance.webkitNow)return window.performance.webkitNow()}return Date.now?Date.now():new Date-r._nowStartTime},r.random=function(e,i){return i=void 0!==i?i:1,(e=void 0!==e?e:0)+t()*(i-e)};var t=function(){return r._seed=(9301*r._seed+49297)%233280,r._seed/233280};r.colorToNumber=function(t){return 3==(t=t.replace("#","")).length&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)),parseInt(t,16)},r.logLevel=1,r.log=function(){console&&r.logLevel>0&&r.logLevel<=3&&console.log.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},r.info=function(){console&&r.logLevel>0&&r.logLevel<=2&&console.info.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},r.warn=function(){console&&r.logLevel>0&&r.logLevel<=3&&console.warn.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},r.warnOnce=function(){var t=Array.prototype.slice.call(arguments).join(" ");r._warnedOnce[t]||(r.warn(t),r._warnedOnce[t]=!0)},r.deprecated=function(t,e,i){t[e]=r.chain(function(){r.warnOnce("🔅 deprecated 🔅",i)},t[e])},r.nextId=function(){return r._nextId++},r.indexOf=function(t,e){if(t.indexOf)return t.indexOf(e);for(var i=0;ir._deltaMax&&d.warnOnce("Matter.Engine.update: delta argument is recommended to be less than or equal to",r._deltaMax.toFixed(3),"ms."),e=void 0!==e?e:d._baseDelta,e*=m.timeScale,m.timestamp+=e,m.lastDelta=e;var y={timestamp:m.timestamp,delta:e};h.trigger(t,"beforeUpdate",y);var x=l.allBodies(f),T=l.allConstraints(f),w=l.allComposites(f);for(f.isModified&&(a.setBodies(p,x),l.setModified(f,!1,!1,!0)),t.enableSleeping&&s.update(x,e),r._bodiesApplyGravity(x,t.gravity),r.wrap(x,w),r.attractors(x),e>0&&r._bodiesUpdate(x,e),h.trigger(t,"beforeSolve",y),u.preSolveAll(x),i=0;i0&&h.trigger(t,"collisionStart",{pairs:g.collisionStart,timestamp:m.timestamp,delta:e});var S=d.clamp(20/t.positionIterations,0,1);for(n.preSolvePosition(g.list),i=0;i0&&h.trigger(t,"collisionActive",{pairs:g.collisionActive,timestamp:m.timestamp,delta:e}),g.collisionEnd.length>0&&h.trigger(t,"collisionEnd",{pairs:g.collisionEnd,timestamp:m.timestamp,delta:e}),r._bodiesClearForces(x),h.trigger(t,"afterUpdate",y),t.timing.lastElapsed=d.now()-c,t},r.merge=function(t,e){if(d.extend(t,e),e.world){t.world=e.world,r.clear(t);for(var i=l.allBodies(t.world),n=0;n0)for(var s=0;s0){i||(i={}),r=e.split(" ");for(var l=0;ln?(s.warn("Plugin.register:",r.toString(e),"was upgraded to",r.toString(t)),r._registry[t.name]=t):i-1},r.isFor=function(t,e){var i=t.for&&r.dependencyParse(t.for);return!t.for||e.name===i.name&&r.versionSatisfies(e.version,i.range)},r.use=function(t,e){if(t.uses=(t.uses||[]).concat(e||[]),0!==t.uses.length){for(var i=r.dependencies(t),n=s.topologicalSort(i),a=[],o=0;o0&&!h.silent&&s.info(a.join(" "))}else s.warn("Plugin.use:",r.toString(t),"does not specify any dependencies to install.")},r.dependencies=function(t,e){var i=r.dependencyParse(t),n=i.name;if(!(n in(e=e||{}))){t=r.resolve(t)||t,e[n]=s.map(t.uses||[],function(e){r.isPlugin(e)&&r.register(e);var n=r.dependencyParse(e),a=r.resolve(e);return a&&!r.versionSatisfies(a.version,n.range)?(s.warn("Plugin.dependencies:",r.toString(a),"does not satisfy",r.toString(n),"used by",r.toString(i)+"."),a._warned=!0,t._warned=!0):a||(s.warn("Plugin.dependencies:",r.toString(e),"used by",r.toString(i),"could not be resolved."),t._warned=!0),n.name});for(var a=0;a=|>)?\s*((\d+)\.(\d+)\.(\d+))(-[0-9A-Za-z-+]+)?$/;e.test(t)||s.warn("Plugin.versionParse:",t,"is not a valid version or range.");var i=e.exec(t),r=Number(i[4]),n=Number(i[5]),a=Number(i[6]);return{isRange:Boolean(i[1]||i[2]),version:i[3],range:t,operator:i[1]||i[2]||"",major:r,minor:n,patch:a,parts:[r,n,a],prerelease:i[7],number:1e8*r+1e4*n+a}},r.versionSatisfies=function(t,e){e=e||"*";var i=r.versionParse(e),s=r.versionParse(t);if(i.isRange){if("*"===i.operator||"*"===t)return!0;if(">"===i.operator)return s.number>i.number;if(">="===i.operator)return s.number>=i.number;if("~"===i.operator)return s.major===i.major&&s.minor===i.minor&&s.patch>=i.patch;if("^"===i.operator)return i.major>0?s.major===i.major&&s.number>=i.number:i.minor>0?s.minor===i.minor&&s.patch>=i.patch:s.patch===i.patch}return t===e||"*"===t}},13037(t,e,i){var r={};t.exports=r;var s=i(35810),n=i(48413),a=i(53402);!function(){r._maxFrameDelta=1e3/15,r._frameDeltaFallback=1e3/60,r._timeBufferMargin=1.5,r._elapsedNextEstimate=1,r._smoothingLowerBound=.1,r._smoothingUpperBound=.9,r.create=function(t){var e=a.extend({delta:1e3/60,frameDelta:null,frameDeltaSmoothing:!0,frameDeltaSnapping:!0,frameDeltaHistory:[],frameDeltaHistorySize:100,frameRequestId:null,timeBuffer:0,timeLastTick:null,maxUpdates:null,maxFrameTime:1e3/30,lastUpdatesDeferred:0,enabled:!0},t);return e.fps=0,e},r.run=function(t,e){return t.timeBuffer=r._frameDeltaFallback,function i(s){t.frameRequestId=r._onNextFrame(t,i),s&&t.enabled&&r.tick(t,e,s)}(),t},r.tick=function(e,i,o){var h=a.now(),l=e.delta,u=0,d=o-e.timeLastTick;if((!d||!e.timeLastTick||d>Math.max(r._maxFrameDelta,e.maxFrameTime))&&(d=e.frameDelta||r._frameDeltaFallback),e.frameDeltaSmoothing){e.frameDeltaHistory.push(d),e.frameDeltaHistory=e.frameDeltaHistory.slice(-e.frameDeltaHistorySize);var c=e.frameDeltaHistory.slice(0).sort(),f=e.frameDeltaHistory.slice(c.length*r._smoothingLowerBound,c.length*r._smoothingUpperBound);d=t(f)||d}e.frameDeltaSnapping&&(d=1e3/Math.round(1e3/d)),e.frameDelta=d,e.timeLastTick=o,e.timeBuffer+=e.frameDelta,e.timeBuffer=a.clamp(e.timeBuffer,0,e.frameDelta+l*r._timeBufferMargin),e.lastUpdatesDeferred=0;var p=e.maxUpdates||Math.ceil(e.maxFrameTime/l),g={timestamp:i.timing.timestamp};s.trigger(e,"beforeTick",g),s.trigger(e,"tick",g);for(var m=a.now();l>0&&e.timeBuffer>=l*r._timeBufferMargin;){s.trigger(e,"beforeUpdate",g),n.update(i,l),s.trigger(e,"afterUpdate",g),e.timeBuffer-=l,u+=1;var v=a.now()-h,y=a.now()-m,x=v+r._elapsedNextEstimate*y/u;if(u>=p||x>e.maxFrameTime){e.lastUpdatesDeferred=Math.round(Math.max(0,e.timeBuffer/l-r._timeBufferMargin));break}}i.timing.lastUpdatesPerFrame=u,s.trigger(e,"afterTick",g),e.frameDeltaHistory.length>=100&&(e.lastUpdatesDeferred&&Math.round(e.frameDelta/l)>p?a.warnOnce("Matter.Runner: runner reached runner.maxUpdates, see docs."):e.lastUpdatesDeferred&&a.warnOnce("Matter.Runner: runner reached runner.maxFrameTime, see docs."),void 0!==e.isFixed&&a.warnOnce("Matter.Runner: runner.isFixed is now redundant, see docs."),(e.deltaMin||e.deltaMax)&&a.warnOnce("Matter.Runner: runner.deltaMin and runner.deltaMax were removed, see docs."),0!==e.fps&&a.warnOnce("Matter.Runner: runner.fps was replaced by runner.delta, see docs."))},r.stop=function(t){r._cancelNextFrame(t)},r._onNextFrame=function(t,e){if("undefined"==typeof window||!window.requestAnimationFrame)throw new Error("Matter.Runner: missing required global window.requestAnimationFrame.");return t.frameRequestId=window.requestAnimationFrame(e),t.frameRequestId},r._cancelNextFrame=function(t){if("undefined"==typeof window||!window.cancelAnimationFrame)throw new Error("Matter.Runner: missing required global window.cancelAnimationFrame.");window.cancelAnimationFrame(t.frameRequestId)};var t=function(t){for(var e=0,i=t.length,r=0;r0&&h.motion=h.sleepThreshold/i&&r.set(h,!0)):h.sleepCounter>0&&(h.sleepCounter-=1)}else r.set(h,!1)}},r.afterCollisions=function(t){for(var e=r._motionSleepThreshold,i=0;ie&&r.set(h,!1)}}}},r.set=function(t,e){var i=t.isSleeping;e?(t.isSleeping=!0,t.sleepCounter=t.sleepThreshold,t.positionImpulse.x=0,t.positionImpulse.y=0,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.anglePrev=t.angle,t.speed=0,t.angularSpeed=0,t.motion=0,i||n.trigger(t,"sleepStart")):(t.isSleeping=!1,t.sleepCounter=0,i&&n.trigger(t,"sleepEnd"))}},66280(t,e,i){var r={};t.exports=r;var s=i(41598),n=i(53402),a=i(22562),o=i(15647),h=i(31725);r.rectangle=function(t,e,i,r,o){o=o||{};var h={label:"Rectangle Body",position:{x:t,y:e},vertices:s.fromPath("L 0 0 L "+i+" 0 L "+i+" "+r+" L 0 "+r)};if(o.chamfer){var l=o.chamfer;h.vertices=s.chamfer(h.vertices,l.radius,l.quality,l.qualityMin,l.qualityMax),delete o.chamfer}return a.create(n.extend({},h,o))},r.trapezoid=function(t,e,i,r,o,h){h=h||{},o>=1&&n.warn("Bodies.trapezoid: slope parameter must be < 1.");var l,u=i*(o*=.5),d=u+(1-2*o)*i,c=d+u;l=o<.5?"L 0 0 L "+u+" "+-r+" L "+d+" "+-r+" L "+c+" 0":"L 0 0 L "+d+" "+-r+" L "+c+" 0";var f={label:"Trapezoid Body",position:{x:t,y:e},vertices:s.fromPath(l)};if(h.chamfer){var p=h.chamfer;f.vertices=s.chamfer(f.vertices,p.radius,p.quality,p.qualityMin,p.qualityMax),delete h.chamfer}return a.create(n.extend({},f,h))},r.circle=function(t,e,i,s,a){s=s||{};var o={label:"Circle Body",circleRadius:i};a=a||25;var h=Math.ceil(Math.max(10,Math.min(a,i)));return h%2==1&&(h+=1),r.polygon(t,e,h,i,n.extend({},o,s))},r.polygon=function(t,e,i,o,h){if(h=h||{},i<3)return r.circle(t,e,o,h);for(var l=2*Math.PI/i,u="",d=.5*l,c=0;c0&&s.area(A)1?(p=a.create(n.extend({parts:g.slice(0)},r)),a.setPosition(p,{x:t,y:e}),p):g[0]},r.flagCoincidentParts=function(t,e){void 0===e&&(e=5);for(var i=0;ig&&(g=y),o.translate(v,{x:.5*x,y:.5*y}),d=v.bounds.max.x+n,s.addBody(u,v),l=v,f+=1}else d+=n}c+=g+a,d=t}return u},r.chain=function(t,e,i,r,o,h){for(var l=t.bodies,u=1;u0)for(l=0;l0&&(c=f[l-1+(h-1)*e],s.addConstraint(t,n.create(a.extend({bodyA:c,bodyB:d},o)))),r&&lc||a<(l=c-l)||a>i-1-l))return 1===d&&o.translate(u,{x:(a+(i%2==1?1:-1))*f,y:0}),h(t+(u?a*f:0)+a*n,r,a,l,u,d)})},r.newtonsCradle=function(t,e,i,r,a){for(var o=s.create({label:"Newtons Cradle"}),l=0;lt.max.x&&(t.max.x=s.x),s.xt.max.y&&(t.max.y=s.y),s.y0?t.max.x+=i.x:t.min.x+=i.x,i.y>0?t.max.y+=i.y:t.min.y+=i.y)},e.contains=function(t,e){return e.x>=t.min.x&&e.x<=t.max.x&&e.y>=t.min.y&&e.y<=t.max.y},e.overlaps=function(t,e){return t.min.x<=e.max.x&&t.max.x>=e.min.x&&t.max.y>=e.min.y&&t.min.y<=e.max.y},e.translate=function(t,e){t.min.x+=e.x,t.max.x+=e.x,t.min.y+=e.y,t.max.y+=e.y},e.shift=function(t,e){var i=t.max.x-t.min.x,r=t.max.y-t.min.y;t.min.x=e.x,t.max.x=e.x+i,t.min.y=e.y,t.max.y=e.y+r},e.wrap=function(t,e,i){var r=null,s=null;if(void 0!==e.min.x&&void 0!==e.max.x&&(t.min.x>e.max.x?r=e.min.x-t.max.x:t.max.xe.max.y?s=e.min.y-t.max.y:t.max.y1;if(!c||t!=c.x||e!=c.y){c&&r?(f=c.x,p=c.y):(f=0,p=0);var s={x:f+t,y:p+e};!r&&c||(c=s),g.push(s),v=f+t,y=p+e}},T=function(t){var e=t.pathSegTypeAsLetter.toUpperCase();if("Z"!==e){switch(e){case"M":case"L":case"T":case"C":case"S":case"Q":v=t.x,y=t.y;break;case"H":v=t.x;break;case"V":y=t.y}x(v,y,t.pathSegType)}};for(r._svgPathToAbsolute(t),a=t.getTotalLength(),l=[],i=0;i0)return!1;a=i}return!0},r.scale=function(t,e,i,n){if(1===e&&1===i)return t;var a,o;n=n||r.centre(t);for(var h=0;h=0?h-1:t.length-1],u=t[h],d=t[(h+1)%t.length],c=e[h0&&(n|=2),3===n)return!1;return 0!==n||null},r.hull=function(t){var e,i,r=[],n=[];for((t=t.slice(0)).sort(function(t,e){var i=t.x-e.x;return 0!==i?i:t.y-e.y}),i=0;i=2&&s.cross3(n[n.length-2],n[n.length-1],e)<=0;)n.pop();n.push(e)}for(i=t.length-1;i>=0;i-=1){for(e=t[i];r.length>=2&&s.cross3(r[r.length-2],r[r.length-1],e)<=0;)r.pop();r.push(e)}return r.pop(),n.pop(),r.concat(n)}},55973(t){function e(t,e,i){i=i||0;var r,s,n,a,o,h,l,u=[0,0];return r=t[1][1]-t[0][1],s=t[0][0]-t[1][0],n=r*t[0][0]+s*t[0][1],a=e[1][1]-e[0][1],o=e[0][0]-e[1][0],h=a*e[0][0]+o*e[0][1],S(l=r*o-a*s,0,i)||(u[0]=(o*n-s*h)/l,u[1]=(r*h-a*n)/l),u}function i(t,e,i,r){var s=e[0]-t[0],n=e[1]-t[1],a=r[0]-i[0],o=r[1]-i[1];if(a*n-o*s===0)return!1;var h=(s*(i[1]-t[1])+n*(t[0]-i[0]))/(a*n-o*s),l=(a*(t[1]-i[1])+o*(i[0]-t[0]))/(o*s-a*n);return h>=0&&h<=1&&l>=0&&l<=1}function r(t,e,i){return(e[0]-t[0])*(i[1]-t[1])-(i[0]-t[0])*(e[1]-t[1])}function s(t,e,i){return r(t,e,i)>0}function n(t,e,i){return r(t,e,i)>=0}function a(t,e,i){return r(t,e,i)<0}function o(t,e,i){return r(t,e,i)<=0}t.exports={decomp:function(t){var e=T(t);return e.length>0?w(t,e):[t]},quickDecomp:function t(e,i,r,h,l,u,g){u=u||100,g=g||0,l=l||25,i=void 0!==i?i:[],r=r||[],h=h||[];var m=[0,0],v=[0,0],x=[0,0],T=0,w=0,S=0,C=0,E=0,A=0,_=0,M=[],R=[],P=e,O=e;if(O.length<3)return i;if(++g>u)return console.warn("quickDecomp: max level ("+u+") reached."),i;for(var L=0;LE&&(E+=e.length),C=Number.MAX_VALUE,E3&&r>=0;--r)u(c(t,r-1),c(t,r),c(t,r+1),e)&&(t.splice(r%t.length,1),i++);return i},removeDuplicatePoints:function(t,e){for(var i=t.length-1;i>=1;--i)for(var r=t[i],s=i-1;s>=0;--s)C(r,t[s],e)&&t.splice(i,1)},makeCCW:function(t){for(var e=0,i=t,r=1;ri[e][0])&&(e=r);return!s(c(t,e-1),c(t,e),c(t,e+1))&&(function(t){for(var e=[],i=t.length,r=0;r!==i;r++)e.push(t.pop());for(r=0;r!==i;r++)t[r]=e[r]}(t),!0)}};var h=[],l=[];function u(t,e,i,s){if(s){var n=h,a=l;n[0]=e[0]-t[0],n[1]=e[1]-t[1],a[0]=i[0]-e[0],a[1]=i[1]-e[1];var o=n[0]*a[0]+n[1]*a[1],u=Math.sqrt(n[0]*n[0]+n[1]*n[1]),d=Math.sqrt(a[0]*a[0]+a[1]*a[1]);return Math.acos(o/(u*d)){const o=this.getVideoPlaybackQuality(),h=this.mozPresentedFrames||this.mozPaintedFrames||o.totalVideoFrames-o.droppedVideoFrames;if(h>r){const r=this.mozFrameDelay||o.totalFrameDelay-i.totalFrameDelay||0,s=a-n;t(a,{presentationTime:a+1e3*r,expectedDisplayTime:a+s,width:this.videoWidth,height:this.videoHeight,mediaTime:Math.max(0,this.currentTime||0)+s/1e3,presentedFrames:h,processingDuration:r}),delete this._rvfcpolyfillmap[e]}else this._rvfcpolyfillmap[e]=requestAnimationFrame(t=>s(a,t))};return this._rvfcpolyfillmap[e]=requestAnimationFrame(t=>s(e,t)),e},HTMLVideoElement.prototype.cancelVideoFrameCallback=function(t){cancelAnimationFrame(this._rvfcpolyfillmap[t]),delete this._rvfcpolyfillmap[t]})},10312(t){t.exports={SKIP_CHECK:-1,NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16,ERASE:17,SOURCE_IN:18,SOURCE_OUT:19,SOURCE_ATOP:20,DESTINATION_OVER:21,DESTINATION_IN:22,DESTINATION_OUT:23,DESTINATION_ATOP:24,LIGHTER:25,COPY:26,XOR:27}},29795(t){t.exports={DEFAULT:0,LINEAR:0,NEAREST:1}},84322(t){t.exports={MULTIPLY:0,FILL:1,ADD:2,SCREEN:4,OVERLAY:5,HARD_LIGHT:6}},68627(t,e,i){var r=i(19715),s=i(32880),n=i(83419),a=i(8054),o=i(50792),h=i(92503),l=i(56373),u=i(97480),d=i(69442),c=i(8443),f=i(61340),p=new n({Extends:o,initialize:function(t){o.call(this);var e=t.config;this.config={clearBeforeRender:e.clearBeforeRender,backgroundColor:e.backgroundColor,antialias:e.antialias,roundPixels:e.roundPixels,transparent:e.transparent},this.game=t,this.type=a.CANVAS,this.drawCount=0,this.width=0,this.height=0,this.gameCanvas=t.canvas;var i={alpha:e.transparent,desynchronized:e.desynchronized,willReadFrequently:!1};this.gameContext=e.context?e.context:this.gameCanvas.getContext("2d",i),this.currentContext=this.gameContext,this.antialias=e.antialias,this.blendModes=l(),this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92},this._tempMatrix1=new f,this._tempMatrix2=new f,this._tempMatrix3=new f,this.isBooted=!1,this.init()},init:function(){var t=this.game;t.events.once(c.BOOT,function(){var t=this.config;if(!t.transparent){var e=this.gameContext,i=this.gameCanvas;e.fillStyle=t.backgroundColor.rgba,e.fillRect(0,0,i.width,i.height)}},this),t.textures.once(d.READY,this.boot,this)},boot:function(){var t=this.game,e=t.scale.baseSize;this.width=e.width,this.height=e.height,this.isBooted=!0,t.scale.on(u.RESIZE,this.onResize,this),this.resize(e.width,e.height)},onResize:function(t,e){e.width===this.width&&e.height===this.height||this.resize(e.width,e.height)},resize:function(t,e){this.width=t,this.height=e,this.emit(h.RESIZE,t,e)},resetTransform:function(){this.currentContext.setTransform(1,0,0,1,0,0)},setBlendMode:function(t){return this.currentContext.globalCompositeOperation=t,this},setContext:function(t){return this.currentContext=t||this.gameContext,this},setAlpha:function(t){return this.currentContext.globalAlpha=t,this},preRender:function(){var t=this.gameContext,e=this.config,i=this.width,r=this.height;t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),this.emit(h.PRE_RENDER_CLEAR),e.clearBeforeRender&&(t.clearRect(0,0,i,r),e.transparent||(t.fillStyle=e.backgroundColor.rgba,t.fillRect(0,0,i,r))),t.save(),this.drawCount=0,this.emit(h.PRE_RENDER)},render:function(t,e,i){var s=e.length;this.emit(h.RENDER,t,i);var n=i.x,a=i.y,o=i.width,l=i.height,u=i.renderToTexture?i.context:t.sys.context;u.save(),this.game.scene.customViewports&&(u.beginPath(),u.rect(n,a,o,l),u.clip()),i.emit(r.PRE_RENDER,i),this.currentContext=u;var d=i.mask;d&&d.preRenderCanvas(this,null,i._maskCamera),i.transparent||(u.fillStyle=i.backgroundColor.rgba,u.fillRect(n,a,o,l)),u.globalAlpha=i.alpha,u.globalCompositeOperation="source-over",this.drawCount+=s,i.renderToTexture&&i.emit(r.PRE_RENDER,i),i.matrix.copyToContext(u);for(var c=0;c=0?v=-(v+d):v<0&&(v=Math.abs(v)-d)),t.flipY&&(y>=0?y=-(y+c):y<0&&(y=Math.abs(y)-c))}var T=1,w=1;t.flipX&&(f||(v+=-e.realWidth+2*g),T=-1),t.flipY&&(f||(y+=-e.realHeight+2*m),w=-1);var b=t.x,S=t.y;if(i.roundPixels&&(b=Math.floor(b),S=Math.floor(S)),o.applyITRS(b,S,t.rotation,t.scaleX*T,t.scaleY*w),a.copyWithScrollFactorFrom(i.matrixCombined,i.scrollX,i.scrollY,t.scrollFactorX,t.scrollFactorY),r&&a.multiply(r),a.multiply(o),i.renderRoundPixels&&(a.e=Math.floor(a.e+.5),a.f=Math.floor(a.f+.5)),n.save(),a.setToContext(n),n.globalCompositeOperation=this.blendModes[t.blendMode],n.globalAlpha=s,n.imageSmoothingEnabled=!e.source.scaleMode,t.mask&&t.mask.preRenderCanvas(this,t,i),d>0&&c>0){var C=d/p,E=c/p;i.roundPixels&&(v=Math.floor(v+.5),y=Math.floor(y+.5),C+=.5,E+=.5),n.drawImage(e.source.image,l,u,d,c,v,y,C,E)}t.mask&&t.mask.postRenderCanvas(this,t,i),n.restore()}},destroy:function(){this.removeAllListeners(),this.game=null,this.gameCanvas=null,this.gameContext=null}});t.exports=p},55830(t,e,i){t.exports={CanvasRenderer:i(68627),GetBlendModes:i(56373),SetTransform:i(20926)}},56373(t,e,i){var r=i(10312),s=i(89289);t.exports=function(){var t=[],e=s.supportNewBlendModes,i="source-over";return t[r.NORMAL]=i,t[r.ADD]="lighter",t[r.MULTIPLY]=e?"multiply":i,t[r.SCREEN]=e?"screen":i,t[r.OVERLAY]=e?"overlay":i,t[r.DARKEN]=e?"darken":i,t[r.LIGHTEN]=e?"lighten":i,t[r.COLOR_DODGE]=e?"color-dodge":i,t[r.COLOR_BURN]=e?"color-burn":i,t[r.HARD_LIGHT]=e?"hard-light":i,t[r.SOFT_LIGHT]=e?"soft-light":i,t[r.DIFFERENCE]=e?"difference":i,t[r.EXCLUSION]=e?"exclusion":i,t[r.HUE]=e?"hue":i,t[r.SATURATION]=e?"saturation":i,t[r.COLOR]=e?"color":i,t[r.LUMINOSITY]=e?"luminosity":i,t[r.ERASE]="destination-out",t[r.SOURCE_IN]="source-in",t[r.SOURCE_OUT]="source-out",t[r.SOURCE_ATOP]="source-atop",t[r.DESTINATION_OVER]="destination-over",t[r.DESTINATION_IN]="destination-in",t[r.DESTINATION_OUT]="destination-out",t[r.DESTINATION_ATOP]="destination-atop",t[r.LIGHTER]="lighter",t[r.COPY]="copy",t[r.XOR]="xor",t}},20926(t,e,i){var r=i(91296);t.exports=function(t,e,i,s,n){var a=s.alpha*i.alpha;if(a<=0)return!1;var o=r(i,s,n).calc;return e.globalCompositeOperation=t.blendModes[i.blendMode],e.globalAlpha=a,e.save(),o.setToContext(e),e.imageSmoothingEnabled=i.frame?!i.frame.source.scaleMode:t.antialias,!0}},63899(t){t.exports="losewebgl"},6119(t){t.exports="postrender"},31124(t){t.exports="prerenderclear"},48070(t){t.exports="prerender"},15640(t){t.exports="render"},8912(t){t.exports="resize"},87124(t){t.exports="restorewebgl"},53998(t){t.exports="setparalleltextureunits"},92503(t,e,i){t.exports={LOSE_WEBGL:i(63899),POST_RENDER:i(6119),PRE_RENDER:i(48070),PRE_RENDER_CLEAR:i(31124),RENDER:i(15640),RESIZE:i(8912),RESTORE_WEBGL:i(87124),SET_PARALLEL_TEXTURE_UNITS:i(53998)}},36909(t,e,i){t.exports={Events:i(92503),Snapshot:i(89966)},t.exports.Canvas=i(55830),t.exports.WebGL=i(4159)},32880(t,e,i){var r=i(27919),s=i(40987),n=i(95540);t.exports=function(t,e){var i=n(e,"callback"),a=n(e,"type","image/png"),o=n(e,"encoder",.92),h=Math.abs(Math.round(n(e,"x",0))),l=Math.abs(Math.round(n(e,"y",0))),u=Math.floor(n(e,"width",t.width)),d=Math.floor(n(e,"height",t.height));if(n(e,"getPixel",!1)){var c=t.getContext("2d",{willReadFrequently:!1}).getImageData(h,l,1,1).data;i.call(null,new s(c[0],c[1],c[2],c[3]))}else if(0!==h||0!==l||u!==t.width||d!==t.height){var f=r.createWebGL(this,u,d),p=f.getContext("2d",{willReadFrequently:!0});u>0&&d>0&&p.drawImage(t,h,l,u,d,0,0,u,d);var g=new Image;g.onerror=function(){i.call(null),r.remove(f)},g.onload=function(){i.call(null,g),r.remove(f)},g.src=f.toDataURL(a,o)}else{var m=new Image;m.onerror=function(){i.call(null)},m.onload=function(){i.call(null,m)},m.src=t.toDataURL(a,o)}}},88815(t,e,i){var r=i(27919),s=i(40987),n=i(95540);t.exports=function(t,e){var i=t,a=n(e,"callback"),o=n(e,"type","image/png"),h=n(e,"encoder",.92),l=Math.abs(Math.round(n(e,"x",0))),u=Math.abs(Math.round(n(e,"y",0))),d=n(e,"getPixel",!1),c=n(e,"isFramebuffer",!1),f=c?n(e,"bufferWidth",1):i.drawingBufferWidth,p=c?n(e,"bufferHeight",1):i.drawingBufferHeight;if(d){var g=new Uint8Array(4),m=p-u-1;i.readPixels(l,m,1,1,i.RGBA,i.UNSIGNED_BYTE,g),a.call(null,new s(g[0],g[1],g[2],g[3]))}else{var v=Math.floor(n(e,"width",f)),y=Math.floor(n(e,"height",p)),x=new Uint8Array(v*y*4);i.readPixels(l,p-u-y,v,y,i.RGBA,i.UNSIGNED_BYTE,x);for(var T=r.createWebGL(this,v,y),w=T.getContext("2d",{willReadFrequently:!0}),b=w.getImageData(0,0,v,y),S=b.data,C=0;C0},beginDraw:function(){this.framebuffer&&this.renderer.glTextureUnits.unbindTexture(this.texture),this.renderer.glWrapper.update(this.state)},clear:function(t){this.beginDraw(),void 0===t&&(t=this.autoClear),this.renderer.renderNodes.finishBatch(),this.renderer.gl.clear(t)},destroy:function(){this.renderer.deleteTexture(this.texture),this.renderer.deleteFramebuffer(this.state.bindings.framebuffer),this.renderer=null,this.camera=null,this.state=null,this.framebuffer=null,this.texture=null}});t.exports=s},65656(t,e,i){var r=i(83419),s=i(87774),n=new r({initialize:function(t,e,i){this.renderer=t,this.maxAge=e,this.maxPoolSize=i,this.agePool=[],this.sizePool={}},add:function(t){if(-1===this.agePool.indexOf(t)){var e=t.width+"x"+t.height;this.sizePool[e]?this.sizePool[e].push(t):this.sizePool[e]=[t],this.agePool.push(t)}},get:function(t,e){var i,r,n=this.renderer;void 0===t&&(t=n.width),void 0===e&&(e=n.height);var a=n.getMaxTextureSize();t>a&&(t=a),e>a&&(e=a);var o=t+"x"+e,h=this.sizePool[o];if(h&&h.length>0)return i=h.pop(),r=this.agePool.indexOf(i),this.agePool.splice(r,1),i;if(this.agePool.length>0){var l=Date.now(),u=this.maxAge;if(l-(i=this.agePool[0]).lastUsed>u){this.agePool.shift();var d=i.width+"x"+i.height;return r=(h=this.sizePool[d]).indexOf(i),h.splice(r,1),i.resize(t,e),i}}return this.agePool.length0)for(var r=e.splice(0,i),s=0;s0){r+="_";for(var s=0;s0&&(r+="__",r+=i.sort().join("_")),r},createShaderProgram:function(t,e,i,r){var s=e.vertexShader,n=e.fragmentShader;if(s=s.replace(/\r/g,""),n=n.replace(/\r/g,""),i){for(var a,o,h={},l=0;l>>0},getTintAppendFloatAlpha:function(t,e){return((255*e&255)<<24|t)>>>0},getTintAppendFloatAlphaAndSwap:function(t,e){return((255*e&255)<<24|(255&t)<<16|(t>>8&255)<<8|t>>16&255)>>>0},getFloatsFromUintRGB:function(t){return[(t>>16&255)/255,(t>>8&255)/255,(255&t)/255]},checkShaderMax:function(t,e){var i=Math.min(16,t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS));return e&&-1!==e?Math.min(i,e):i},updateLightingUniforms:function(t,e,i,s,n,a,o,h){var l=e.camera,u=l.scene.sys.lights;if(u&&u.active){var d=u.getLights(l),c=d.length,f=u.ambientColor,p=e.height;if(t){i.setUniform("uNormSampler",s),i.setUniform("uCamera",[l.x,l.y,l.rotation,l.zoom]),i.setUniform("uAmbientLightColor",[f.r,f.g,f.b]),i.setUniform("uLightCount",c);for(var g=new r,m=0;m-1?t.getExtension(r):null,e.config.skipUnreadyShaders){var s="KHR_parallel_shader_compile";this.parallelShaderCompileExtension=i.indexOf(s)>-1?t.getExtension(s):null,this.parallelShaderCompileExtension||(e.config.skipUnreadyShaders=!1)}var n="OES_vertex_array_object";this.vaoExtension=i.indexOf(n)>-1?t.getExtension(n):null;var a="OES_standard_derivatives";if(this.standardDerivativesExtension=i.indexOf(a)>-1?t.getExtension(a):null,t instanceof WebGLRenderingContext){if(!this.instancedArraysExtension)throw new Error("ANGLE_instanced_arrays extension not supported. Required for rendering.");if(t.vertexAttribDivisor=this.instancedArraysExtension.vertexAttribDivisorANGLE.bind(this.instancedArraysExtension),t.drawArraysInstanced=this.instancedArraysExtension.drawArraysInstancedANGLE.bind(this.instancedArraysExtension),t.drawElementsInstanced=this.instancedArraysExtension.drawElementsInstancedANGLE.bind(this.instancedArraysExtension),!this.vaoExtension)throw new Error("OES_vertex_array_object extension not supported. Required for rendering.");if(t.createVertexArray=this.vaoExtension.createVertexArrayOES.bind(this.vaoExtension),t.bindVertexArray=this.vaoExtension.bindVertexArrayOES.bind(this.vaoExtension),t.deleteVertexArray=this.vaoExtension.deleteVertexArrayOES.bind(this.vaoExtension),t.isVertexArray=this.vaoExtension.isVertexArrayOES.bind(this.vaoExtension),this.standardDerivativesExtension)t.FRAGMENT_SHADER_DERIVATIVE_HINT=this.standardDerivativesExtension.FRAGMENT_SHADER_DERIVATIVE_HINT_OES;else if(e.config.smoothPixelArt)throw new Error("OES_standard_derivatives extension not supported. Cannot use smoothPixelArt.")}},setContextHandlers:function(t,e){this.previousContextLostHandler&&this.canvas.removeEventListener("webglcontextlost",this.previousContextLostHandler,!1),this.previousContextRestoredHandler&&this.canvas.removeEventListener("webglcontextrestored",this.previousContextRestoredHandler,!1),this.contextLostHandler="function"==typeof t?t.bind(this):this.dispatchContextLost.bind(this),this.contextRestoredHandler="function"==typeof e?e.bind(this):this.dispatchContextRestored.bind(this),this.canvas.addEventListener("webglcontextlost",this.contextLostHandler,!1),this.canvas.addEventListener("webglcontextrestored",this.contextRestoredHandler,!1),this.previousContextLostHandler=this.contextLostHandler,this.previousContextRestoredHandler=this.contextRestoredHandler},dispatchContextLost:function(t){this.contextLost=!0,console&&console.warn("WebGL Context lost. Renderer disabled"),this.emit(h.LOSE_WEBGL,this),t.preventDefault()},dispatchContextRestored:function(t){if(this.gl.isContextLost())console&&console.log("WebGL Context restored, but context is still lost");else{this.setExtensions(),this.glWrapper.update(A.getDefault(this),!0),this.glTextureUnits.init(),this.compression=this.getCompressedTextures();var e=function(t){t.createResource()};r(this.glTextureWrappers,e),r(this.glBufferWrappers,e),r(this.glFramebufferWrappers,e),r(this.glProgramWrappers,e),r(this.glVAOWrappers,e),this.glTextureUnits.bindUnits(this.glTextureUnits.units,!0),this.resize(this.game.scale.baseSize.width,this.game.scale.baseSize.height),this.contextLost=!1,console&&console.warn("WebGL Context restored. Renderer running again."),this.emit(h.RESTORE_WEBGL,this),t.preventDefault()}},captureFrame:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1)},captureNextFrame:function(){P},getFps:function(){P},log:function(){},startCapture:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=!1),void 0===i&&(i=!1)},stopCapture:function(){P},onCapture:function(t){},onResize:function(t,e){e.width===this.width&&e.height===this.height||this.resize(e.width,e.height)},resize:function(t,e){var i=this.gl;return this.width=t,this.height=e,this.setProjectionMatrix(t,e),this.drawingBufferHeight=i.drawingBufferHeight,this.glWrapper.update({scissor:{box:[0,i.drawingBufferHeight-e,t,e]},viewport:[0,0,t,e]}),this.emit(h.RESIZE,t,e),this},getCompressedTextures:function(){var t="WEBGL_compressed_texture_",e="WEBKIT_"+t,i=function(i,r){var s=i.getExtension(t+r)||i.getExtension(e+r)||i.getExtension("EXT_texture_compression_"+r);if(s){var n={};for(var a in s)n[s[a]]=a;return n}},r=this.gl;return{ETC:i(r,"etc"),ETC1:i(r,"etc1"),ATC:i(r,"atc"),ASTC:i(r,"astc"),BPTC:i(r,"bptc"),RGTC:i(r,"rgtc"),PVRTC:i(r,"pvrtc"),S3TC:i(r,"s3tc"),S3TCSRGB:i(r,"s3tc_srgb"),IMG:!0}},getCompressedTextureName:function(t,e){var i=this.compression[t.toUpperCase()];if(e in i)return i[e]},supportsCompressedTexture:function(t,e){var i=this.compression[t.toUpperCase()];return!!i&&(!e||e in i)},getAspectRatio:function(){return this.width/this.height},setProjectionMatrix:function(t,e,i){return t===this.projectionWidth&&e===this.projectionHeight&&i===this.projectionFlipY||(this.projectionWidth=t,this.projectionHeight=e,this.projectionFlipY=!!i,i?this.projectionMatrix.ortho(0,t,0,e,-1e3,1e3):this.projectionMatrix.ortho(0,t,e,0,-1e3,1e3)),this},setProjectionMatrixFromDrawingContext:function(t){return this.setProjectionMatrix(t.width,t.height,!1)},resetProjectionMatrix:function(){return this.setProjectionMatrix(this.width,this.height)},hasExtension:function(t){return!!this.supportedExtensions&&this.supportedExtensions.indexOf(t)},getExtension:function(t){return this.hasExtension(t)?(t in this.extensions||(this.extensions[t]=this.gl.getExtension(t)),this.extensions[t]):null},addBlendMode:function(t,e){return this.blendModes.push(E.createCombined(this,!0,void 0,e,t[0],t[1]))-1-1},updateBlendMode:function(t,e,i){if(t>17&&this.blendModes[t]){var r=this.blendModes[t];2===e.length?r.func=[e[0],e[1],e[0],e[1]]:r.func=[e[0],e[1],e[2],e[3]],r.equation="number"==typeof i?[i,i]:[i[0],i[1]]}return this},removeBlendMode:function(t){return t>17&&this.blendModes[t]&&this.blendModes.splice(t,1),this},clearFramebuffer:function(t,e,i){var r=this.gl,s=0;t&&(this.glWrapper.updateColorClearValue({colorClearValue:t}),s|=r.COLOR_BUFFER_BIT),void 0!==e&&(this.glWrapper.updateStencilClear({stencil:{clear:e}}),s|=r.STENCIL_BUFFER_BIT),void 0!==i&&(s|=r.DEPTH_BUFFER_BIT),r.clear(s)},createTextureFromSource:function(t,e,i,r,s,n){void 0===s&&(s=!1);var o=this.gl,h=o.NEAREST,u=o.NEAREST,d=o.CLAMP_TO_EDGE;e=t?t.width:e,i=t?t.height:i;var c=l(e,i);if(c&&!s&&(d=o.REPEAT),r===a.ScaleModes.LINEAR&&this.config.antialias){var f=t&&t.compressed,p=!f&&c||f&&t.mipmaps.length>1;h=this.mipmapFilter&&p?this.mipmapFilter:o.LINEAR,u=o.LINEAR}return t||"number"!=typeof e||"number"!=typeof i?this.createTexture2D(0,h,u,d,d,o.RGBA,t,void 0,void 0,void 0,void 0,n):this.createTexture2D(0,h,u,d,d,o.RGBA,null,e,i,void 0,void 0,n)},createTexture2D:function(t,e,i,r,s,n,a,o,h,l,u,d){"number"!=typeof o&&(o=a?a.width:1),"number"!=typeof h&&(h=a?a.height:1);var c=new w(this,t,e,i,r,s,n,a,o,h,l,u,d);return this.glTextureWrappers.push(c),c},createFramebuffer:function(t,e,i){Array.isArray(t)||null===t||(t=[t]);var r=new S(this,t,e,i);return this.glFramebufferWrappers.push(r),r},createProgram:function(t,e){var i=new x(this,t,e);return this.glProgramWrappers.push(i),i},createVertexBuffer:function(t,e){var i=this.gl,r=new v(this,t,i.ARRAY_BUFFER,e);return this.glBufferWrappers.push(r),r},createIndexBuffer:function(t,e){var i=this.gl,r=new v(this,t,i.ELEMENT_ARRAY_BUFFER,e);return this.glBufferWrappers.push(r),r},createVAO:function(t,e,i){var r=new C(this,t,e,i);return this.glVAOWrappers.push(r),r},deleteTexture:function(t){if(t)return s(this.glTextureWrappers,t),t.destroy(),this},deleteFramebuffer:function(t){return t?(s(this.glFramebufferWrappers,t),t.destroy(),this):this},deleteProgram:function(t){return t&&(s(this.glProgramWrappers,t),t.destroy()),this},deleteBuffer:function(t){return t?(s(this.glBufferWrappers,t),t.destroy(),this):this},preRender:function(){if(!this.contextLost){this.emit(h.PRE_RENDER_CLEAR);var t=this.baseDrawingContext;if(this.config.clearBeforeRender){var e=this.config.backgroundColor;t.setClearColor(e.redGL,e.greenGL,e.blueGL,e.alphaGL),t.setAutoClear(!0,!0,!0)}else t.setAutoClear(!1,!1,!1);t.use(),this.emit(h.PRE_RENDER)}},render:function(t,e,i){this.contextLost||(this.emit(h.RENDER,t,i),this.currentViewCamera=i,this.cameraRenderNode.run(this.baseDrawingContext,e,i),this.currentViewCamera=null)},postRender:function(){if(this.baseDrawingContext.release(),!this.contextLost){this.emit(h.POST_RENDER);var t=this.snapshotState;t.callback&&(m(this.gl,t),t.callback=null)}},drawElements:function(t,e,i,r,s,n,a){var o=this.gl;t.beginDraw(),i.bind(),r.bind(),this.glTextureUnits.bindUnits(e),o.drawElements(a||o.TRIANGLE_STRIP,s,o.UNSIGNED_SHORT,n)},drawInstancedArrays:function(t,e,i,r,s,n,a,o){var h=this.gl;t.beginDraw(),i.bind(),r.bind(),this.glTextureUnits.bindUnits(e),h.drawArraysInstanced(o||h.TRIANGLE_STRIP,s,n,a)},snapshot:function(t,e,i){return this.snapshotArea(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight,t,e,i)},snapshotArea:function(t,e,i,r,s,n,a){var o=this.snapshotState;return o.callback=s,o.type=n,o.encoder=a,o.getPixel=!1,o.x=t,o.y=e,o.width=i,o.height=r,o.unpremultiplyAlpha=this.game.config.premultipliedAlpha,this},snapshotPixel:function(t,e,i){return this.snapshotArea(t,e,1,1,i),this.snapshotState.getPixel=!0,this},snapshotFramebuffer:function(t,e,i,r,s,n,a,o,h,l,u){void 0===s&&(s=!1),void 0===n&&(n=0),void 0===a&&(a=0),void 0===o&&(o=e),void 0===h&&(h=i),"pixel"===l&&(s=!0,l="image/png"),this.snapshotArea(n,a,o,h,r,l,u);var d=this.snapshotState;return d.getPixel=s,d.isFramebuffer=!0,d.bufferWidth=e,d.bufferHeight=i,d.width=Math.min(d.width,e),d.height=Math.min(d.height,i),this.glWrapper.updateBindingsFramebuffer({bindings:{framebuffer:t}}),m(this.gl,d),d.callback=null,d.isFramebuffer=!1,this},canvasToTexture:function(t,e,i,r){void 0===i&&(i=!1),void 0===r&&(r=!0);var s=this.gl,n=s.NEAREST,a=s.NEAREST,o=t.width,h=t.height,u=s.CLAMP_TO_EDGE,d=l(o,h);return!i&&d&&(u=s.REPEAT),this.config.antialias&&(n=d&&this.mipmapFilter?this.mipmapFilter:s.LINEAR,a=s.LINEAR),e?(e.update(t,o,h,r,u,u,n,a,e.format),e):this.createTexture2D(0,n,a,u,u,s.RGBA,t,o,h,!0,!1,r)},createCanvasTexture:function(t,e,i){return void 0===e&&(e=!1),void 0===i&&(i=!0),this.canvasToTexture(t,null,e,i)},updateCanvasTexture:function(t,e,i,r){return void 0===i&&(i=!0),void 0===r&&(r=!1),this.canvasToTexture(t,e,r,i)},videoToTexture:function(t,e,i,r){void 0===i&&(i=!1),void 0===r&&(r=!0);var s=this.gl,n=s.NEAREST,a=s.NEAREST,o=t.videoWidth,h=t.videoHeight,u=s.CLAMP_TO_EDGE,d=l(o,h);return!i&&d&&(u=s.REPEAT),this.config.antialias&&(n=d&&this.mipmapFilter?this.mipmapFilter:s.LINEAR,a=s.LINEAR),e?(e.update(t,o,h,r,u,u,n,a,e.format),e):this.createTexture2D(0,n,a,u,u,s.RGBA,t,o,h,!0,!0,r)},createVideoTexture:function(t,e,i){return void 0===e&&(e=!1),void 0===i&&(i=!0),this.videoToTexture(t,null,e,i)},updateVideoTexture:function(t,e,i,r){return void 0===i&&(i=!0),void 0===r&&(r=!1),this.videoToTexture(t,e,r,i)},createUint8ArrayTexture:function(t,e,i,r,s){var n=this.gl,a=n.NEAREST,o=n.NEAREST,h=n.CLAMP_TO_EDGE;return l(e,i)&&(h=n.REPEAT),void 0===r&&(r=!0),void 0===s&&(s=!0),this.createTexture2D(0,a,o,h,h,n.RGBA,t,e,i,r,!1,s)},setTextureFilter:function(t,e){var i=this.gl,r=0===e?i.LINEAR:i.NEAREST,s=this.glTextureUnits,n=s.units[0];return s.bind(t,0),t.update(t.pixels,t.width,t.height,t.flipY,t.wrapS,t.wrapT,r,r,t.format),n&&s.bind(n,0),this},setTextureWrap:function(t,e,i){var r=this.gl;if(!l(t.width,t.height)&&(e!==r.CLAMP_TO_EDGE||i!==r.CLAMP_TO_EDGE))return this;var s=this.glTextureUnits,n=s.units[0];return s.bind(t,0),t.update(t.pixels,t.width,t.height,t.flipY,e,i,t.minFilter,t.magFilter,t.format),n&&s.bind(n,0),this},getMaxTextureSize:function(){return this.config.maxTextureSize},destroy:function(){this.off(h.RESIZE,this.baseDrawingContext.resize,this.baseDrawingContext),this.canvas.removeEventListener("webglcontextlost",this.contextLostHandler,!1),this.canvas.removeEventListener("webglcontextrestored",this.contextRestoredHandler,!1);var t=function(t){t.destroy()};r(this.glBufferWrappers,t),r(this.glFramebufferWrappers,t),r(this.glProgramWrappers,t),r(this.glTextureWrappers,t),this.removeAllListeners(),this.extensions={},this.gl=null,this.game=null,this.canvas=null,this.contextLost=!0}});t.exports=O},14500(t){t.exports={BYTE:{enum:5120,size:1},UNSIGNED_BYTE:{enum:5121,size:1},SHORT:{enum:5122,size:2},UNSIGNED_SHORT:{enum:5123,size:2},INT:{enum:5124,size:4},UNSIGNED_INT:{enum:5125,size:4},FLOAT:{enum:5126,size:4}}},4159(t,e,i){var r=i(14500),s=i(79291),n={Shaders:i(89350),ShaderAdditionMakers:i(83786),DrawingContext:i(87774),DrawingContextPool:i(65656),ProgramManager:i(56436),RenderNodes:i(54521),ShaderProgramFactory:i(18804),Utils:i(70554),WebGLRenderer:i(74797),Wrappers:i(31884)};n=s(!1,n,r),t.exports=n},47774(t){var e={createCombined:function(t,e,i,r,s,n){var a=t.gl;return void 0===e&&(e=!0),void 0===i&&(i=[0,0,0,0]),void 0===r&&(r=a.FUNC_ADD),void 0===s&&(s=a.ONE),void 0===n&&(n=a.ONE_MINUS_SRC_ALPHA),{enabled:e,color:i,equation:[r,r],func:[s,n,s,n]}},createSeparate:function(t,e,i,r,s,n,a,o,h){var l=t.gl;return void 0===e&&(e=!0),void 0===i&&(i=[0,0,0,0]),void 0===r&&(r=l.FUNC_ADD),void 0===s&&(s=l.FUNC_ADD),void 0===n&&(n=l.ONE),void 0===a&&(a=l.ONE_MINUS_SRC_ALPHA),void 0===o&&(o=l.ONE),void 0===h&&(h=l.ONE_MINUS_SRC_ALPHA),{enabled:e,color:i,equation:[r,s],func:[n,a,o,h]}}};t.exports=e},53314(t,e,i){var r=i(8054),s=i(62644),n=i(71623),a={getDefault:function(t){return{bindings:{activeTexture:0,arrayBuffer:null,elementArrayBuffer:null,framebuffer:null,program:null,renderbuffer:null},blend:s(t.blendModes[r.BlendModes.NORMAL]),colorClearValue:[0,0,0,1],colorWritemask:[!0,!0,!0,!0],cullFace:!1,depthTest:!1,scissor:{enable:!0,box:[0,0,0,0]},stencil:n.create(t),texturing:{flipY:!1,premultiplyAlpha:!1},vao:null,viewport:[0,0,0,0]}}};t.exports=a},71623(t){var e={create:function(t,e,i,r,s,n,a,o,h){var l=t.gl;return void 0===e&&(e=!1),void 0===i&&(i=l.ALWAYS),void 0===r&&(r=0),void 0===s&&(s=255),void 0===n&&(n=l.KEEP),void 0===a&&(a=l.KEEP),void 0===o&&(o=l.KEEP),void 0===h&&(h=0),{enabled:e,func:{func:i,ref:r,mask:s},op:{fail:n,zfail:a,zpass:o},clear:h}}};t.exports=e},13961(t,e,i){var r=i(83419),s=i(56436),n=i(40952),a=i(6141),o=i(36909),h=new r({Extends:a,initialize:function(t,e,i){var r=t.renderer,h=r.gl,l=(i=this._copyAndCompleteConfig(t,i||{},e)).name;if(!l)throw new Error("BatchHandler must have a name");a.call(this,l,t),this.instancesPerBatch=-1,this.verticesPerInstance=i.verticesPerInstance;var u=Math.floor(65536/this.verticesPerInstance),d=i.instancesPerBatch||r.config.batchSize||u;this.instancesPerBatch=Math.min(d,u),this.indicesPerInstance=i.indicesPerInstance,this.bytesPerIndexPerInstance=this.indicesPerInstance*Uint16Array.BYTES_PER_ELEMENT,this.maxTexturesPerBatch=1,this.manager.on(o.Events.SET_PARALLEL_TEXTURE_UNITS,this.updateTextureCount,this),r.glWrapper.updateVAO({vao:null}),this.indexBuffer=r.createIndexBuffer(this._generateElementIndices(this.instancesPerBatch),i.indexBufferDynamic?h.DYNAMIC_DRAW:h.STATIC_DRAW);var c=i.vertexBufferLayout;if(c.count=this.instancesPerBatch*this.verticesPerInstance,this.vertexBufferLayout=new n(r,c,null),this.programManager=new s(r,[this.vertexBufferLayout],this.indexBuffer),this.programManager.setBaseShader(i.shaderName,i.vertexSource,i.fragmentSource),i.shaderAdditions)for(var f=0;fthis.instancesPerBatch)throw new Error("BatchHandlerStrip: Vertex count exceeds maximum per batch ("+this.maxVerticesPerBatch+")");this.instanceCount+c>this.instancesPerBatch&&this.run(t),this.updateRenderOptions(u),this._renderOptionsChanged&&(this.run(t),this.updateShaderConfig());var f,g=this.batchTextures(r),m=this.instanceCount*this.floatsPerInstance,v=this.vertexBufferLayout.buffer,y=v.viewF32,x=v.viewU32,T=!1;if(this.instanceCount>0){var w=1+this.floatsPerInstance/this.verticesPerInstance;y[m++]=y[m-w],y[m++]=y[m-w],y[m++]=y[m-w],y[m++]=y[m-w],y[m++]=y[m-w],y[m++]=y[m-w],x[m++]=x[m-w],T=!0}d&&(f=[]);for(var b=i.a,S=i.b,C=i.c,E=i.d,A=i.e,_=i.f,M=s.length,R=0;R=u.length)&&(n++,this.run(t),d=this.instanceCount*this.indicesPerInstance,g=this.vertexCount*h/f.BYTES_PER_ELEMENT,v=0,x=0)}}});t.exports=c},61842(t,e,i){var r=i(19715),s=i(1e3),n=i(61340),a=i(87841),o=i(43855),h=i(83419),l=i(70554),u=i(6141);function d(t){return l.getTintAppendFloatAlpha(16777215,t)}var c=new h({Extends:u,initialize:function(t){u.call(this,"Camera",t),this.batchHandlerQuadSingleNode=t.getNode("BatchHandlerQuadSingle"),this.fillCameraNode=t.getNode("FillCamera"),this.listCompositorNode=t.getNode("ListCompositor"),this._parentTransformMatrix=new n},run:function(t,e,i,n,h,l){var u;this.onRunBegin(t);var c=t.renderer.drawingContextPool,f=this.manager,p=i.alpha,g=i.filters.internal.getActive(),m=i.filters.external.getActive(),v=h||i.forceComposite||g.length||m.length||p<1;n?i.matrixExternal.multiply(n,n):n=this._parentTransformMatrix.copyFrom(i.matrixExternal);var y=n.decomposeMatrix(),x=o(y.translateX,0)&&o(y.translateY,0)&&o(y.rotation,0)&&o(y.scaleX,1)&&o(y.scaleY,1),T=i.x,w=i.y,b=i.width,S=i.height,C=t.getClone();C.setCamera(i),v?((u=c.get(b,S)).setCamera(i),u.setScissorBox(0,0,b,S)):(u=C).setScissorBox(T,w,b,S),u.use();var E=this.fillCameraNode;if(i.backgroundColor.alphaGL>0){var A=i.backgroundColor,_=s(A.red,A.green,A.blue,A.alpha);E.run(u,_,v)}this.listCompositorNode.run(u,e,null,l);var M=i.flashEffect;M.postRenderWebGL()&&(_=s(M.red,M.green,M.blue,255*M.alpha),E.run(u,_,v));var R=i.fadeEffect;if(R.postRenderWebGL()&&(_=s(R.red,R.green,R.blue,255*R.alpha),E.run(u,_,v)),f.finishBatch(),v){var P,O,L,F,D={smoothPixelArt:f.renderer.game.config.smoothPixelArt},I=new a(0,0,u.width,u.height);for(P=0;P0,k=!B,U=new a(0,0,C.width,C.height);if(B){for(P=m.length-1;P>=0;P--)(O=m[P]).active&&(L=O.getPaddingCeil(),U.setTo(U.x+L.x,U.y+L.y,U.width+L.width,U.height+L.height));(k=U.width!==u.width||U.height!==u.height||!x)&&((u=c.get(U.width,U.height)).setScissorBox(0,0,U.width,U.height),u.setCamera(C.camera),u.use())}else u=C;if(k){var z,Y=U.x,X=U.y;n.setQuad(I.x,I.y,I.x+I.width,I.y+I.height),z=n.quad,F=B?4294967295:d(p),i.roundPixels&&(z[0]=Math.round(z[0]),z[1]=Math.round(z[1]),z[2]=Math.round(z[2]),z[3]=Math.round(z[3]),z[4]=Math.round(z[4]),z[5]=Math.round(z[5]),z[6]=Math.round(z[6]),z[7]=Math.round(z[7])),this.batchHandlerQuadSingleNode.batch(u,N.texture,z[0]-Y,z[1]-X,z[2]-Y,z[3]-X,z[6]-Y,z[7]-X,z[4]-Y,z[5]-X,0,1,1,-1,!1,F,F,F,F,D)}if(N!==u&&N.release(),B){var W=!1;for(N=null,L=new a,P=0;P0&&d2&&g>1&&(m=!0,s||(v=!0));for(var y,x,T,w,b,S,C,E,A=[],_=0,M=[],R=0,P=[],O=0,L=u*u,F=0;F0){var l=e,u=e;if(a.length>0){s=h;for(var d=0;d0)for(s=h,d=0;d0){var s=this.instanceBufferLayout.buffer,n=i.memberCount,a=Math.floor(n/i.bufferUpdateSegmentSize),o=!0;for(e=0;e<=a;e++)if(!(1<0&&e.addAddition(h(t.tileset.maxAnimationLength));for(var s=t.lighting,n=e.getAdditionsByTag("LIGHTING"),a=0;a0,T=[y,e.layerDataTexture];if(x&&(T[2]=v.getAnimationDataTexture(s)),e.lighting){var w=v.image.dataSource[0];w=w?w.glTexture:this.manager.renderer.normalTexture,T[3]=w}this.updateRenderOptions(e);var b=this.programManager,S=b.getCurrentProgramSuite();if(S){var C=S.program,E=S.vao;this.setupUniforms(t,e),b.applyUniforms(C),s.drawElements(t,T,C,E,4,0)}this.onRunEnd(t)}});t.exports=y},12913(t,e,i){var r=i(83419),s=i(6141),n=new r({Extends:s,initialize:function(t){s.call(this,"TexturerImage",t),this.frame=null,this.frameWidth=0,this.frameHeight=0,this.uvSource=null},run:function(t,e,i){this.onRunBegin(t);var r=e.frame;if(this.frame=r,this.frameWidth=r.cutWidth,this.frameHeight=r.cutHeight,this.uvSource=r,e.isCropped){var s=e._crop;this.uvSource=s,s.flipX===e.flipX&&s.flipY===e.flipY||e.frame.updateCropUVs(s,e.flipX,e.flipY),this.frameWidth=s.width,this.frameHeight=s.height}var n=r.source.resolution;this.frameWidth/=n,this.frameHeight/=n,this.onRunEnd(t)}});t.exports=n},22995(t,e,i){var r=i(61340),s=i(83419),n=i(6141),a=new s({Extends:n,initialize:function(t){n.call(this,"TexturerTileSprite",t),this.frame=null,this.uvMatrix=new r},run:function(t,e,i){this.onRunBegin(t);var r=e.frame;if(this.frame=r,e.isCropped){var s=e._crop;s.flipX===e.flipX&&s.flipY===e.flipY||e.frame.updateCropUVs(s,e.flipX,e.flipY)}this.uvMatrix.loadIdentity(),this.uvMatrix.scale(1/r.width,1/r.height),this.uvMatrix.translate(e.tilePositionX,e.tilePositionY),this.uvMatrix.scale(1/e.tileScaleX,1/e.tileScaleY),this.uvMatrix.rotate(-e.tileRotation),this.uvMatrix.setQuad(0,0,e.width,e.height),this.onRunEnd(t)}});t.exports=a},86081(t,e,i){var r=i(61340),s=i(83419),n=i(46975),a=i(6141),o=new s({Extends:a,initialize:function(t,e){e=n(e||{},this.defaultConfig),a.call(this,e.name,t),this.quad=new Float32Array(8),this._spriteMatrix=new r,this._calcMatrix=new r},defaultConfig:{name:"TransformerImage",role:"Transformer"},run:function(t,e,i,r,s){this.onRunBegin(t);var n=i.frame,a=i.uvSource,o=a.x,h=a.y,l=e.displayOriginX,u=e.displayOriginY,d=-l+o,c=-u+h,f=n.customPivot,p=1,g=1;e.flipX&&(f||(d+=-n.realWidth+2*l),p=-1),e.flipY&&(f||(c+=-n.realHeight+2*u),g=-1);var m=t.camera,v=this._spriteMatrix,y=this._calcMatrix.copyWithScrollFactorFrom(m.getViewMatrix(!t.useCanvas),m.scrollX,m.scrollY,e.scrollFactorX,e.scrollFactorY);r&&y.multiply(r),v.applyITRS(e.x,e.y,e.rotation,e.scaleX*p,e.scaleY*g),y.multiply(v),y.setQuad(d,c,d+i.frameWidth,c+i.frameHeight,this.quad);var x=y.matrix,T=1===x[0]&&0===x[1]&&0===x[2]&&1===x[3];if(e.willRoundVertices(m,T)){var w=this.quad;w[0]=Math.round(w[0]),w[1]=Math.round(w[1]),w[2]=Math.round(w[2]),w[3]=Math.round(w[3]),w[4]=Math.round(w[4]),w[5]=Math.round(w[5]),w[6]=Math.round(w[6]),w[7]=Math.round(w[7])}this.onRunEnd(t)}});t.exports=o},88383(t,e,i){var r=i(61340),s=i(83419),n=i(46975),a=i(6141),o=new s({Extends:a,initialize:function(t,e){e=n(e||{},this.defaultConfig),a.call(this,e.name,t),this._spriteMatrix=new r,this.quad=this._spriteMatrix.quad},defaultConfig:{name:"TransformerStamp",role:"Transformer"},run:function(t,e,i,r,s){this.onRunBegin(t);var n=i.frame,a=i.uvSource,o=a.x,h=a.y,l=e.displayOriginX,u=e.displayOriginY,d=-l+o,c=-u+h,f=n.customPivot,p=1,g=1;e.flipX&&(f||(d+=-n.realWidth+2*l),p=-1),e.flipY&&(f||(c+=-n.realHeight+2*u),g=-1);var m=e.x,v=e.y,y=this._spriteMatrix;y.applyITRS(m,v,e.rotation,e.scaleX*p,e.scaleY*g);var x=y.matrix;this.onlyTranslate=1===x[0]&&0===x[1]&&0===x[2]&&1===x[3],y.setQuad(d,c,d+i.frameWidth,c+i.frameHeight);var T=y.matrix,w=1===T[0]&&0===T[1]&&0===T[2]&&1===T[3];if(e.willRoundVertices(t.camera,w)){var b=this.quad;b[0]=Math.round(b[0]),b[1]=Math.round(b[1]),b[2]=Math.round(b[2]),b[3]=Math.round(b[3]),b[4]=Math.round(b[4]),b[5]=Math.round(b[5]),b[6]=Math.round(b[6]),b[7]=Math.round(b[7])}this.onRunEnd(t)}});t.exports=o},34454(t,e,i){var r=i(83419),s=i(86081),n=new r({Extends:s,initialize:function(t,e){s.call(this,t,e)},defaultConfig:{name:"TransformerTile",role:"Transformer"},run:function(t,e,i,r,s){this.onRunBegin(t);var n=t.camera,a=this._calcMatrix,o=this._spriteMatrix;a.copyWithScrollFactorFrom(n.getViewMatrix(!t.useCanvas),n.scrollX,n.scrollY,e.scrollFactorX,e.scrollFactorY),r&&a.multiply(r);var h=i.frameWidth,l=i.frameHeight,u=h,d=l,c=h/2,f=l/2,p=e.scaleX,g=e.scaleY,m=e.gidMap[s.index],v=m.tileOffset.x,y=m.tileOffset.y,x=e.x+s.pixelX*p+(c*p-v),T=e.y+s.pixelY*g+(f*g-y),w=-c,b=-f;s.flipX&&(u*=-1,w+=h),s.flipY&&(d*=-1,w+=l),o.applyITRS(x,T,s.rotation,p,g),a.multiply(o),a.setQuad(w,b,w+u,b+d,this.quad);var S=a.matrix,C=1===S[0]&&0===S[1]&&0===S[2]&&1===S[3];if(e.willRoundVertices(n,C)){var E=this.quad;E[0]=Math.round(E[0]),E[1]=Math.round(E[1]),E[2]=Math.round(E[2]),E[3]=Math.round(E[3]),E[4]=Math.round(E[4]),E[5]=Math.round(E[5]),E[6]=Math.round(E[6]),E[7]=Math.round(E[7])}this.onRunEnd(t)}});t.exports=n},46211(t,e,i){var r=i(83419),s=i(86081),n=new r({Extends:s,initialize:function(t,e){s.call(this,t,e)},defaultConfig:{name:"TransformerTileSprite",role:"Transformer"},run:function(t,e,i,r,s){this.onRunBegin(t);var n=e.width,a=e.height,o=e.displayOriginX,h=e.displayOriginY,l=-o,u=-h,d=1,c=1;e.flipX&&(l+=2*o-n,d=-1),e.flipY&&(u+=2*h-a,c=-1);var f=e.x,p=e.y,g=t.camera,m=this._calcMatrix,v=this._spriteMatrix;m.copyWithScrollFactorFrom(g.getViewMatrix(!t.useCanvas),g.scrollX,g.scrollY,e.scrollFactorX,e.scrollFactorY),r&&m.multiply(r),v.applyITRS(f,p,e.rotation,e.scaleX*d,e.scaleY*c),m.multiply(v),m.setQuad(l,u,l+n,u+a,this.quad);var y=m.matrix,x=1===y[0]&&0===y[1]&&0===y[2]&&1===y[3];if(e.willRoundVertices(g,x)){var T=this.quad;T[0]=Math.round(T[0]),T[1]=Math.round(T[1]),T[2]=Math.round(T[2]),T[3]=Math.round(T[3]),T[4]=Math.round(T[4]),T[5]=Math.round(T[5]),T[6]=Math.round(T[6]),T[7]=Math.round(T[7])}this.onRunEnd(t)}});t.exports=n},84547(t){t.exports=["vec4 applyLighting (vec4 fragColor, vec3 normal)","{"," vec4 lighting = getLighting(fragColor, normal);"," return fragColor * vec4(lighting.rgb * lighting.a, lighting.a);","}"].join("\n")},11104(t){t.exports=["vec4 applyTint(vec4 texture)","{"," vec3 unpremultTexture = texture.rgb / texture.a;"," float alpha = texture.a * outTint.a;"," vec3 color = vec3(unpremultTexture);"," if (outTintEffect == 0.0) {"," color *= outTint.bgr;"," }"," else if (outTintEffect == 1.0) {"," color = outTint.bgr;"," }"," else if (outTintEffect == 2.0) {"," color += outTint.bgr;"," }"," else if (outTintEffect == 4.0) {"," color = 1.0 - (1.0 - unpremultTexture) * (1.0 - outTint.bgr);"," }"," else if (outTintEffect == 5.0) {"," color = vec3("," unpremultTexture.r < 0.5 ? 2.0 * outTint.b * unpremultTexture.r : 1.0 - 2.0 * (1.0 - outTint.b) * (1.0 - unpremultTexture.r),"," unpremultTexture.g < 0.5 ? 2.0 * outTint.g * unpremultTexture.g : 1.0 - 2.0 * (1.0 - outTint.g) * (1.0 - unpremultTexture.g),"," unpremultTexture.b < 0.5 ? 2.0 * outTint.r * unpremultTexture.b : 1.0 - 2.0 * (1.0 - outTint.r) * (1.0 - unpremultTexture.b)"," );"," }"," else if (outTintEffect == 6.0) {"," color = vec3("," outTint.b < 0.5 ? 2.0 * outTint.b * unpremultTexture.r : 1.0 - 2.0 * (1.0 - outTint.b) * (1.0 - unpremultTexture.r),"," outTint.g < 0.5 ? 2.0 * outTint.g * unpremultTexture.g : 1.0 - 2.0 * (1.0 - outTint.g) * (1.0 - unpremultTexture.g),"," outTint.r < 0.5 ? 2.0 * outTint.r * unpremultTexture.b : 1.0 - 2.0 * (1.0 - outTint.r) * (1.0 - unpremultTexture.b)"," );"," }"," return vec4(color * alpha, alpha);","}"].join("\n")},81556(t){t.exports=["vec4 boundedSampler(sampler2D sampler, vec2 uv)","{"," if (clamp(uv, 0.0, 1.0) != uv)"," {"," return vec4(0.0, 0.0, 0.0, 0.0);"," }"," return texture2D(sampler, uv);","}"].join("\n")},96293(t){t.exports=["#define SHADER_NAME PHASER_COLORMATRIX_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform float uColorMatrix[20];","uniform float uAlpha;","varying vec2 outTexCoord;","void main ()","{"," vec4 c = texture2D(uMainSampler, outTexCoord);"," if (uAlpha == 0.0)"," {"," gl_FragColor = c;"," return;"," }"," if (c.a > 0.0)"," {"," c.rgb /= c.a;"," }"," vec4 result;"," result.r = (uColorMatrix[0] * c.r) + (uColorMatrix[1] * c.g) + (uColorMatrix[2] * c.b) + (uColorMatrix[3] * c.a) + uColorMatrix[4];"," result.g = (uColorMatrix[5] * c.r) + (uColorMatrix[6] * c.g) + (uColorMatrix[7] * c.b) + (uColorMatrix[8] * c.a) + uColorMatrix[9];"," result.b = (uColorMatrix[10] * c.r) + (uColorMatrix[11] * c.g) + (uColorMatrix[12] * c.b) + (uColorMatrix[13] * c.a) + uColorMatrix[14];"," result.a = (uColorMatrix[15] * c.r) + (uColorMatrix[16] * c.g) + (uColorMatrix[17] * c.b) + (uColorMatrix[18] * c.a) + uColorMatrix[19];"," c.rgb *= c.a;"," result.rgb *= result.a;"," gl_FragColor = mix(c, result, uAlpha);","}"].join("\n")},78390(t){t.exports=["vec2 v2len (vec2 a, vec2 b)","{"," return sqrt(a*a+b*b);","}","vec2 getBlockyTexCoord (vec2 texCoord, vec2 texRes) {"," texCoord *= texRes;"," vec2 seam = floor(texCoord + 0.5);"," texCoord = (texCoord - seam) / v2len(dFdx(texCoord), dFdy(texCoord)) + seam;"," texCoord = clamp(texCoord, seam-.5, seam+.5);"," return texCoord / texRes;","}"].join("\n")},11719(t){t.exports=["struct Light","{"," vec3 position;"," vec3 color;"," float intensity;"," float radius;","};","const int kMaxLights = LIGHT_COUNT;","uniform vec4 uCamera; /* x, y, rotation, zoom */","uniform sampler2D uNormSampler;","uniform vec3 uAmbientLightColor;","uniform Light uLights[kMaxLights];","uniform int uLightCount;","#ifdef FEATURE_SELFSHADOW","uniform float uDiffuseFlatThreshold;","uniform float uPenumbra;","#endif","vec4 getLighting (vec4 fragColor, vec3 normal)","{"," vec3 finalColor = vec3(0.0);"," vec2 res = vec2(min(uResolution.x, uResolution.y)) * uCamera.w;"," #ifdef FEATURE_SELFSHADOW"," vec3 unpremultipliedColor = fragColor.rgb / fragColor.a;"," float occlusionThreshold = 1.0 - ((unpremultipliedColor.r + unpremultipliedColor.g + unpremultipliedColor.b) / uDiffuseFlatThreshold);"," #endif"," for (int index = 0; index < kMaxLights; ++index)"," {"," if (index < uLightCount)"," {"," Light light = uLights[index];"," vec3 lightDir = vec3((light.position.xy / res) - (gl_FragCoord.xy / res), light.position.z / res.x);"," vec3 lightNormal = normalize(lightDir);"," float distToSurf = length(lightDir) * uCamera.w;"," float diffuseFactor = max(dot(normal, lightNormal), 0.0);"," float radius = (light.radius / res.x * uCamera.w) * uCamera.w;"," float attenuation = clamp(1.0 - distToSurf * distToSurf / (radius * radius), 0.0, 1.0);"," #ifdef FEATURE_SELFSHADOW"," float occluded = smoothstep(0.0, 1.0, (diffuseFactor - occlusionThreshold) / uPenumbra);"," vec3 diffuse = light.color * diffuseFactor * occluded;"," #else"," vec3 diffuse = light.color * diffuseFactor;"," #endif"," finalColor += (attenuation * diffuse) * light.intensity;"," }"," }"," vec4 colorOutput = vec4(uAmbientLightColor + finalColor, 1.0);"," return colorOutput;","}"].join("\n")},14030(t){t.exports=["vec2 clampTexCoordWithinFrame (vec2 texCoord)","{"," vec2 texRes = getTexRes();"," vec4 frameTexel = outFrame * texRes.xyxy;"," vec2 frameMin = frameTexel.xy + vec2(0.5, 0.5);"," vec2 frameMax = frameTexel.xy + frameTexel.zw - vec2(0.5, 0.5);"," return clamp(texCoord, frameMin / texRes, frameMax / texRes);","}"].join("\n")},10235(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform float amount;","varying vec2 outTexCoord;","#pragma phaserTemplate(fragmentHeader)","vec2 Distort(vec2 p)","{"," float theta = atan(p.y, p.x);"," float radius = length(p);"," radius = pow(radius, amount);"," p.x = radius * cos(theta);"," p.y = radius * sin(theta);"," return 0.5 * (p + 1.0);","}","void main()","{"," vec2 xy = 2.0 * outTexCoord - 1.0;"," vec2 texCoord = outTexCoord;"," if (length(xy) < 1.0)"," {"," texCoord = Distort(xy);"," }"," gl_FragColor = boundedSampler(uMainSampler, texCoord);","}"].join("\n")},65980(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uMainSampler2;","uniform float amount;","uniform vec4 color;","varying vec2 outTexCoord;","vec4 NORMAL (vec4 base, vec4 blend)","{"," return blend + base * (1.0 - blend.a);","}","vec4 ADD (vec4 base, vec4 blend)","{"," return base + blend;","}","vec4 MULTIPLY (vec4 base, vec4 blend)","{"," return base * blend;","}","vec4 SCREEN (vec4 base, vec4 blend)","{"," return 1.0 - (1.0 - base) * (1.0 - blend);","}","float overlayChannel (float base, float blend)","{"," return base < 0.5 ? 2.0 * base * blend : 1.0 - 2.0 * (1.0 - base) * (1.0 - blend);","}","vec4 OVERLAY (vec4 base, vec4 blend)","{"," return vec4("," overlayChannel(base.r, blend.r),"," overlayChannel(base.g, blend.g),"," overlayChannel(base.b, blend.b),"," overlayChannel(base.a, blend.a)"," );","}","vec4 DARKEN (vec4 base, vec4 blend)","{"," return min(base, blend);","}","vec4 LIGHTEN (vec4 base, vec4 blend)","{"," return max(base, blend);","}","float dodgeChannel (float base, float blend)","{"," return blend == 1.0 ? blend : min(1.0, base / (1.0 - blend));","}","vec4 COLOR_DODGE (vec4 base, vec4 blend)","{"," return vec4("," dodgeChannel(base.r, blend.r),"," dodgeChannel(base.g, blend.g),"," dodgeChannel(base.b, blend.b),"," dodgeChannel(base.a, blend.a)"," );","}","float burnChannel (float base, float blend)","{"," return blend == 0.0 ? blend : 1.0 - min(1.0, (1.0 - base) / blend);","}","vec4 COLOR_BURN (vec4 base, vec4 blend)","{"," return vec4("," burnChannel(base.r, blend.r),"," burnChannel(base.g, blend.g),"," burnChannel(base.b, blend.b),"," burnChannel(base.a, blend.a)"," );","}","float hardLightChannel (float base, float blend)","{"," return blend < 0.5 ? 2.0 * base * blend : 1.0 - 2.0 * (1.0 - base) * (1.0 - blend);","}","vec4 HARD_LIGHT (vec4 base, vec4 blend)","{"," return vec4("," hardLightChannel(base.r, blend.r),"," hardLightChannel(base.g, blend.g),"," hardLightChannel(base.b, blend.b),"," hardLightChannel(base.a, blend.a)"," );","}","float softLightChannel (float base, float blend)","{"," return blend < 0.5 ? (2.0 * base * blend + base * base * (1.0 - 2.0 * blend)) : (sqrt(base) * (2.0 * blend - 1.0) + 2.0 * base * (1.0 - blend));","}","vec4 SOFT_LIGHT (vec4 base, vec4 blend)","{"," return vec4("," softLightChannel(base.r, blend.r),"," softLightChannel(base.g, blend.g),"," softLightChannel(base.b, blend.b),"," softLightChannel(base.a, blend.a)"," );","}","vec4 DIFFERENCE (vec4 base, vec4 blend)","{"," return abs(base - blend);","}","vec4 EXCLUSION (vec4 base, vec4 blend)","{"," return base + blend - 2.0 * base * blend;","}","vec3 rgbToHsl (vec3 color)","{"," vec3 hsl = vec3(0.0);"," float fmin = min(min(color.r, color.g), color.b);"," float fmax = max(max(color.r, color.g), color.b);"," float delta = fmax - fmin;"," hsl.z = (fmax + fmin) / 2.0;"," if (delta == 0.0)"," {"," hsl.x = 0.0;"," hsl.y = 0.0;"," }"," else"," {"," if (hsl.z < 0.5)"," {"," hsl.y = delta / (fmax + fmin);"," }"," else"," {"," hsl.y = delta / (2.0 - fmax - fmin);"," }"," float deltaR = (((fmax - color.r) / 6.0) + (delta / 2.0)) / delta;"," float deltaG = (((fmax - color.g) / 6.0) + (delta / 2.0)) / delta;"," float deltaB = (((fmax - color.b) / 6.0) + (delta / 2.0)) / delta;"," if (color.r == fmax)"," {"," hsl.x = deltaB - deltaG;"," }"," else if (color.g == fmax)"," {"," hsl.x = (1.0 / 3.0) + deltaR - deltaB;"," }"," else if (color.b == fmax)"," {"," hsl.x = (2.0 / 3.0) + deltaG - deltaR;"," }"," if (hsl.x < 0.0)"," {"," hsl.x += 1.0;"," }"," else if (hsl.x > 1.0)"," {"," hsl.x -= 1.0;"," }"," }"," return hsl;","}","vec3 hslToRgb (vec3 hsl)","{"," float p = hsl.z * (1.0 - hsl.y);"," float q = hsl.z * (1.0 - hsl.y * hsl.x);"," float t = hsl.z * (1.0 - hsl.y * (1.0 - hsl.x));"," if (hsl.x < 1.0 / 6.0)"," {"," return vec3(hsl.z, t, p);"," }"," else if (hsl.x < 0.5)"," {"," return vec3(q, hsl.z, p);"," }"," else if (hsl.x < 2.0 / 3.0)"," {"," return vec3(p, hsl.z, t);"," }"," return vec3(p, q, hsl.z);","}","vec4 HUE (vec4 base, vec4 blend)","{"," vec3 baseHSL = rgbToHsl(base.rgb);"," vec3 blendHSL = rgbToHsl(blend.rgb);"," return vec4(hslToRgb(vec3(blendHSL.x, baseHSL.y, baseHSL.z)), base.a);","}","vec4 SATURATION (vec4 base, vec4 blend)","{"," vec3 baseHSL = rgbToHsl(base.rgb);"," vec3 blendHSL = rgbToHsl(blend.rgb);"," return vec4(hslToRgb(vec3(baseHSL.x, blendHSL.y, baseHSL.z)), base.a);","}","vec4 COLOR (vec4 base, vec4 blend)","{"," vec3 baseHSL = rgbToHsl(base.rgb);"," vec3 blendHSL = rgbToHsl(blend.rgb);"," return vec4(hslToRgb(vec3(blendHSL.x, blendHSL.y, baseHSL.z)), base.a);","}","vec4 LUMINOSITY (vec4 base, vec4 blend)","{"," vec3 baseHSL = rgbToHsl(base.rgb);"," vec3 blendHSL = rgbToHsl(blend.rgb);"," return vec4(hslToRgb(vec3(baseHSL.x, baseHSL.y, blendHSL.z)), base.a);","}","vec4 ERASE (vec4 base, vec4 blend)","{"," return base * (1.0 - blend.a);","}","vec4 SOURCE_IN (vec4 base, vec4 blend)","{"," return blend * base.a;","}","vec4 SOURCE_OUT (vec4 base, vec4 blend)","{"," return blend * (1.0 - base.a);","}","vec4 SOURCE_ATOP (vec4 base, vec4 blend)","{"," return base * (1.0 - blend.a) + blend * base.a;","}","vec4 DESTINATION_OVER (vec4 base, vec4 blend)","{"," return base + blend * (1.0 - base.a);","}","vec4 DESTINATION_IN (vec4 base, vec4 blend)","{"," return base * blend.a;","}","vec4 DESTINATION_OUT (vec4 base, vec4 blend)","{"," return base * (1.0 - blend.a);","}","vec4 DESTINATION_ATOP (vec4 base, vec4 blend)","{"," return base * blend.a + blend * (1.0 - base.a);","}","vec4 LIGHTER (vec4 base, vec4 blend)","{"," return ADD(base, blend);","}","vec4 COPY (vec4 base, vec4 blend)","{"," return blend;","}","vec4 XOR (vec4 base, vec4 blend)","{"," return base * (1.0 - blend.a) + blend * (1.0 - base.a);","}","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec4 base = boundedSampler(uMainSampler, outTexCoord);"," vec4 blend = boundedSampler(uMainSampler2, outTexCoord) * color;"," vec4 blended = BLEND(base, blend);"," gl_FragColor = mix(base, blended, amount);","}"].join("\n")},5899(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec4 uSizeAndOffset;","varying vec2 outTexCoord;","void main()","{"," vec2 gridCell = floor((outTexCoord * resolution + uSizeAndOffset.zw) / uSizeAndOffset.xy) * uSizeAndOffset.xy - uSizeAndOffset.zw;"," vec2 texCoord = gridCell / resolution;"," gl_FragColor = texture2D(uMainSampler, texCoord);","}"].join("\n")},20784(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec2 offset;","uniform float strength;","uniform vec3 color;","varying vec2 outTexCoord;","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec2 uv = outTexCoord;"," vec4 col = vec4(0.0);"," vec2 off1 = vec2(1.411764705882353) * offset * strength;"," vec2 off2 = vec2(3.2941176470588234) * offset * strength;"," vec2 off3 = vec2(5.176470588235294) * offset * strength;"," col += boundedSampler(uMainSampler, uv) * 0.1964825501511404;"," col += boundedSampler(uMainSampler, uv + (off1 / resolution)) * 0.2969069646728344;"," col += boundedSampler(uMainSampler, uv - (off1 / resolution)) * 0.2969069646728344;"," col += boundedSampler(uMainSampler, uv + (off2 / resolution)) * 0.09447039785044732;"," col += boundedSampler(uMainSampler, uv - (off2 / resolution)) * 0.09447039785044732;"," col += boundedSampler(uMainSampler, uv + (off3 / resolution)) * 0.010381362401148057;"," col += boundedSampler(uMainSampler, uv - (off3 / resolution)) * 0.010381362401148057;"," gl_FragColor = col * vec4(color, 1.0);","}"].join("\n")},65122(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec2 offset;","uniform float strength;","uniform vec3 color;","varying vec2 outTexCoord;","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec2 uv = outTexCoord;"," vec4 col = vec4(0.0);"," vec2 offset = vec2(1.333) * offset * strength;"," col += boundedSampler(uMainSampler, uv) * 0.29411764705882354;"," col += boundedSampler(uMainSampler, uv + (offset / resolution)) * 0.35294117647058826;"," col += boundedSampler(uMainSampler, uv - (offset / resolution)) * 0.35294117647058826;"," gl_FragColor = col * vec4(color, 1.0);","}"].join("\n")},60942(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec2 offset;","uniform float strength;","uniform vec3 color;","varying vec2 outTexCoord;","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec2 uv = outTexCoord;"," vec4 col = vec4(0.0);"," vec2 off1 = vec2(1.3846153846) * offset * strength;"," vec2 off2 = vec2(3.2307692308) * offset * strength;"," col += boundedSampler(uMainSampler, uv) * 0.2270270270;"," col += boundedSampler(uMainSampler, uv + (off1 / resolution)) * 0.3162162162;"," col += boundedSampler(uMainSampler, uv - (off1 / resolution)) * 0.3162162162;"," col += boundedSampler(uMainSampler, uv + (off2 / resolution)) * 0.0702702703;"," col += boundedSampler(uMainSampler, uv - (off2 / resolution)) * 0.0702702703;"," gl_FragColor = col * vec4(color, 1.0);","}"].join("\n")},43722(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","#define ITERATIONS 100.0","#define ONEOVER_ITR 1.0 / ITERATIONS","#define PI 3.141596","#define GOLDEN_ANGLE 2.39996323","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform float radius;","uniform float amount;","uniform float contrast;","uniform bool isTiltShift;","uniform float strength;","uniform vec2 blur;","varying vec2 outTexCoord;","vec2 Sample (in float theta, inout float r)","{"," r += 1.0 / r;"," return (r - 1.0) * vec2(cos(theta), sin(theta)) * 0.06;","}","#pragma phaserTemplate(fragmentHeader)","vec3 Bokeh (sampler2D tex, vec2 uv, float radius)","{"," vec3 acc = vec3(0.0);"," vec3 div = vec3(0.0);"," vec2 pixel = vec2(resolution.y / resolution.x, 1.0) * radius * .025;"," float r = 1.0;"," for (float j = 0.0; j < GOLDEN_ANGLE * ITERATIONS; j += GOLDEN_ANGLE)"," {"," vec3 col = boundedSampler(tex, uv + pixel * Sample(j, r)).xyz;"," col = contrast > 0.0 ? col * col * (1.0 + contrast) : col;"," vec3 bokeh = vec3(0.5) + pow(col, vec3(10.0)) * amount;"," acc += col * bokeh;"," div += bokeh;"," }"," return acc / div;","}","void main ()","{"," float shift = 1.0;"," if (isTiltShift)"," {"," vec2 uv = vec2(gl_FragCoord.xy / resolution + vec2(-0.5, -0.5)) * 2.0;"," float centerStrength = 1.0;"," shift = length(uv * blur * strength) * centerStrength;"," }"," gl_FragColor = vec4(Bokeh(uMainSampler, outTexCoord * vec2(1.0, 1.0), radius * shift), 0.0);","}"].join("\n")},19883(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform float uColorMatrix[20];","uniform float uAlpha;","varying vec2 outTexCoord;","void main ()","{"," vec4 c = texture2D(uMainSampler, outTexCoord);"," if (uAlpha == 0.0)"," {"," gl_FragColor = c;"," return;"," }"," if (c.a > 0.0)"," {"," c.rgb /= c.a;"," }"," vec4 result;"," result.r = (uColorMatrix[0] * c.r) + (uColorMatrix[1] * c.g) + (uColorMatrix[2] * c.b) + (uColorMatrix[3] * c.a) + uColorMatrix[4];"," result.g = (uColorMatrix[5] * c.r) + (uColorMatrix[6] * c.g) + (uColorMatrix[7] * c.b) + (uColorMatrix[8] * c.a) + uColorMatrix[9];"," result.b = (uColorMatrix[10] * c.r) + (uColorMatrix[11] * c.g) + (uColorMatrix[12] * c.b) + (uColorMatrix[13] * c.a) + uColorMatrix[14];"," result.a = (uColorMatrix[15] * c.r) + (uColorMatrix[16] * c.g) + (uColorMatrix[17] * c.b) + (uColorMatrix[18] * c.a) + uColorMatrix[19];"," vec3 rgb = mix(c.rgb, result.rgb, uAlpha);"," rgb *= result.a;"," gl_FragColor = vec4(rgb, result.a);","}"].join("\n")},32624(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uTransferSampler;","uniform float uColorMatrixSelf[20];","uniform float uColorMatrixTransfer[20];","uniform float uAlphaSelf;","uniform float uAlphaTransfer;","uniform vec4 uAdditions;","uniform vec4 uMultiplications;","varying vec2 outTexCoord;","#define S uColorMatrixSelf","#define T uColorMatrixTransfer","void main ()","{"," vec4 self = texture2D(uMainSampler, outTexCoord);"," if (uAlphaSelf == 0.0)"," {"," gl_FragColor = self;"," return;"," }"," if (self.a > 0.0)"," {"," self.rgb /= self.a;"," }"," vec4 resultSelf;"," resultSelf.r = (S[0] * self.r) + (S[1] * self.g) + (S[2] * self.b) + (S[3] * self.a) + S[4];"," resultSelf.g = (S[5] * self.r) + (S[6] * self.g) + (S[7] * self.b) + (S[8] * self.a) + S[9];"," resultSelf.b = (S[10] * self.r) + (S[11] * self.g) + (S[12] * self.b) + (S[13] * self.a) + S[14];"," resultSelf.a = (S[15] * self.r) + (S[16] * self.g) + (S[17] * self.b) + (S[18] * self.a) + S[19];"," if (uAlphaTransfer == 0.0)"," {"," self.rgb *= self.a;"," resultSelf.rgb *= resultSelf.a;"," gl_FragColor = mix(self, resultSelf, uAlphaSelf);"," return;"," }"," vec4 tex = texture2D(uTransferSampler, outTexCoord);"," if (tex.a > 0.0)"," {"," tex.rgb /= tex.a;"," }"," vec4 resultTransfer;"," resultTransfer.r = (T[0] * tex.r) + (T[1] * tex.g) + (T[2] * tex.b) + (T[3] * tex.a) + T[4];"," resultTransfer.g = (T[5] * tex.r) + (T[6] * tex.g) + (T[7] * tex.b) + (T[8] * tex.a) + T[9];"," resultTransfer.b = (T[10] * tex.r) + (T[11] * tex.g) + (T[12] * tex.b) + (T[13] * tex.a) + T[14];"," resultTransfer.a = (T[15] * tex.r) + (T[16] * tex.g) + (T[17] * tex.b) + (T[18] * tex.a) + T[19];"," vec4 combo = (resultSelf + resultTransfer) * uAdditions + (resultSelf * resultTransfer) * uMultiplications;"," self.rgb *= self.a;"," resultSelf.rgb *= resultSelf.a;"," combo.rgb *= combo.a;"," gl_FragColor = mix(self, mix(resultSelf, combo, uAlphaTransfer), uAlphaSelf);","}"].join("\n")},12886(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uDisplacementSampler;","uniform vec2 amount;","varying vec2 outTexCoord;","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec2 disp = (-vec2(0.5, 0.5) + texture2D(uDisplacementSampler, outTexCoord).rg) * amount;"," gl_FragColor = boundedSampler(uMainSampler, outTexCoord + disp).rgba;","}"].join("\n")},33016(t){t.exports=["#pragma phaserTemplate(shaderName)","#define DISTANCE 10.0","#define QUALITY 10.0","#pragma phaserTemplate(fragmentDefine)","precision mediump float;","uniform sampler2D uMainSampler;","varying vec2 outTexCoord;","uniform float outerStrength;","uniform float innerStrength;","uniform float scale;","uniform vec2 resolution;","uniform vec4 glowColor;","uniform bool knockout;","const float PI = 3.14159265358979323846264;","const float MAX_ALPHA = DISTANCE * (DISTANCE + 1.0) * QUALITY / 2.0;","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec2 px = vec2(1.0 / resolution.x, 1.0 / resolution.y) * scale;"," float totalAlpha = 0.0;"," float curAngle = 0.0;"," vec2 direction;"," vec2 displaced;"," vec4 color;"," for (float curDistance = 0.0; curDistance < DISTANCE; curDistance++)"," {"," curAngle += fract(sin(dot(vec2(curDistance, outTexCoord.x + outTexCoord.y), vec2(12.9898, 78.233))) * 43758.5453);"," for (float i = 0.0; i < QUALITY; i++)"," {"," curAngle += PI * 2.0 / (QUALITY);"," direction = vec2(cos(curAngle), sin(curAngle)) * px;"," displaced = outTexCoord + direction * (curDistance + 1.0);"," color = boundedSampler(uMainSampler, displaced);"," totalAlpha += (DISTANCE - curDistance) * color.a;"," }"," }"," color = boundedSampler(uMainSampler, outTexCoord);"," float alphaRatio = (totalAlpha / MAX_ALPHA);"," float innerGlowAlpha = (1.0 - alphaRatio) * innerStrength * color.a;"," float innerGlowStrength = min(1.0, innerGlowAlpha);"," vec4 innerColor = mix(color, glowColor, innerGlowStrength);"," float outerGlowAlpha = alphaRatio * outerStrength * (1.0 - color.a);"," float outerGlowStrength = min(1.0 - innerColor.a, outerGlowAlpha);"," if (knockout)"," {"," float resultAlpha = outerGlowStrength + innerGlowStrength;"," gl_FragColor = vec4(glowColor.rgb * resultAlpha, resultAlpha);"," }"," else"," {"," vec4 outerGlowColor = outerGlowStrength * glowColor.rgba;"," gl_FragColor = innerColor + outerGlowColor;"," }","}"].join("\n")},33179(t){t.exports=["#pragma phaserTemplate(shaderName)","precision highp float;","#pragma phaserTemplate(fragmentHeader)","uniform sampler2D uMainSampler;","uniform vec4 uColor;","uniform vec4 uColorFactor;","uniform bool uUnpremultiply;","uniform float uAlpha;","varying vec2 outTexCoord;","void main ()","{"," vec4 sample = texture2D(uMainSampler, outTexCoord);"," if (uUnpremultiply)"," {"," sample.rgb /= sample.a;"," }"," vec4 modulatedSample = sample * uColorFactor + uColor;"," float progress = modulatedSample.r + modulatedSample.g + modulatedSample.b + modulatedSample.a;"," vec4 rampColor = getRampAt(progress);"," rampColor.rgb *= rampColor.a;"," gl_FragColor = mix(sample, rampColor * sample.a, uAlpha);","}"].join("\n")},94526(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uEnvSampler;","uniform sampler2D uNormSampler;","uniform mat4 uViewMatrix;","uniform float uModelRotation;","uniform float uBulge;","uniform vec3 uColorFactor;","varying vec2 outTexCoord;","#define PI 3.14159265358979323846","void main()","{"," vec4 color = texture2D(uMainSampler, outTexCoord);"," vec3 normal = texture2D(uNormSampler, outTexCoord).rgb;"," vec3 normalN = normal * 2.0 - 1.0;"," float normalXYLength = length(normalN.xy);"," float angle = atan("," normalN.y,"," normalN.x"," ) - uModelRotation;"," normalN = vec3("," normalXYLength * cos(angle),"," normalXYLength * sin(angle),"," normalN.z"," );"," normalN = reflect(vec3(0.0, 0.0, -1.0), normalN);"," normalN = (uViewMatrix * vec4(normalN, 1.0)).xyz;"," float envX = atan(normalN.x, normalN.z) / PI;"," float envY = sin(normalN.y * PI / 2.0);"," vec2 uv = vec2(envX, envY) * 0.5 + 0.5;"," vec2 rotatedTexCoord = vec2("," cos(-uModelRotation) * outTexCoord.x - sin(-uModelRotation) * outTexCoord.y,"," sin(-uModelRotation) * outTexCoord.x + cos(- uModelRotation) * outTexCoord.y"," );"," uv += uBulge * (rotatedTexCoord - 0.5);"," if (uv.y < 0.0)"," {"," uv.y = abs(uv.y);"," uv.x += 0.5;"," }"," else if (uv.y > 1.0)"," {"," uv.y = 2.0 - uv.y;"," uv.x += 0.5;"," }"," vec3 environment = texture2D(uEnvSampler, uv).rgb;"," gl_FragColor = vec4(environment * color.rgb * uColorFactor, color.a);","}"].join("\n")},4488(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec4 uColor;","uniform vec4 uIsolateThresholdFeather;","varying vec2 outTexCoord;","void main()","{"," vec4 color = texture2D(uMainSampler, outTexCoord);"," vec3 unpremultipliedColor = color.rgb / color.a;"," float isolate = uIsolateThresholdFeather.x;"," float threshold = uIsolateThresholdFeather.y;"," float feather = uIsolateThresholdFeather.z;"," float match = distance(unpremultipliedColor, uColor.rgb);"," match = clamp(match - threshold, 0.0, 1.0);"," match = clamp(match / feather, 0.0, 1.0);"," if (isolate == 1.0)"," {"," match = 1.0 - match;"," }"," match = mix(1.0, match, uColor.a);"," gl_FragColor = color * match;","}"].join("\n")},39603(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uMaskSampler;","uniform bool invert;","varying vec2 outTexCoord;","void main ()","{"," vec4 color = texture2D(uMainSampler, outTexCoord);"," vec4 mask = texture2D(uMaskSampler, outTexCoord);"," float a = mask.a;"," color *= invert ? (1.0 - a) : a;"," gl_FragColor = color;","}"].join("\n")},60047(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","#pragma phaserTemplate(fragmentHeader)","uniform sampler2D uMainSampler;","uniform mat4 uViewMatrix;","#ifdef FACING_POWER","uniform float uFacingPower;","#endif","#ifdef OUTPUT_RATIO","uniform vec3 uRatioVector;","uniform float uRatioRadius;","#endif","varying vec2 outTexCoord;","void main()","{"," vec3 normal = texture2D(uMainSampler, outTexCoord).rgb * 2.0 - 1.0;"," normal = (uViewMatrix * vec4(normal, 1.0)).xyz;"," #ifdef FACING_POWER"," normal = normalize(normal * vec3(1.0, 1.0, uFacingPower));"," #endif"," #ifdef OUTPUT_RATIO"," float ratio = dot(normal, normalize(uRatioVector));"," ratio = (ratio - 1.0 + uRatioRadius) / uRatioRadius;"," if (ratio <= 0.0)"," {"," ratio = 0.0;"," }"," normal = vec3(ratio * 2.0 - 1.0);"," #endif"," gl_FragColor = vec4((normal + 1.0) * 0.5, 1.0);","}"].join("\n")},7529(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform float uRadius;","uniform float uPower;","varying vec2 outTexCoord;","#define PI 3.14159265358979323846","#pragma phaserTemplate(fragmentHeader)","#define STEP_X 1.0 / SAMPLES_X","#define STEP_Y 1.0 / SAMPLES_Y","vec3 uvPanoramaNormal(vec2 uv)","{"," float y = uv.y * 2.0 - 1.0;"," float angle = (uv.x * 2.0 - 1.0) * PI;"," float x = sin(angle);"," float z = cos(angle);"," vec2 xz = vec2(x, z);"," xz *= sqrt(1.0 - y * y);"," return normalize(vec3(xz.x, y, xz.y));","}","void main()","{"," vec3 acc = vec3(0.0);"," float div = 0.0;"," vec3 texelNormal = uvPanoramaNormal(outTexCoord);"," for (float y = STEP_Y / 2.0; y < 1.0; y += STEP_Y)"," {"," float yWeight = cos((y * 2.0 - 1.0) * PI / 2.0);"," for (float x = STEP_X / 2.0; x < 1.0; x += STEP_X)"," {"," vec2 uv = vec2(x, y);"," vec3 sampleNormal = uvPanoramaNormal(uv);"," float dotProduct = dot(sampleNormal, texelNormal);"," dotProduct = (dotProduct - 1.0 + uRadius) / uRadius;"," if (dotProduct <= 0.0)"," {"," continue;"," }"," vec3 color = texture2D(uMainSampler, uv).rgb;"," color *= pow(length(color), uPower);"," acc += color * dotProduct * yWeight;"," div += dotProduct * yWeight;"," }"," }"," gl_FragColor = vec4(acc / div, 1.0);","}"].join("\n")},99191(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform float amount;","varying vec2 outTexCoord;","void main ()","{"," float pixelSize = floor(2.0 + amount);"," vec2 center = pixelSize * floor(outTexCoord * resolution / pixelSize) + pixelSize * vec2(0.5, 0.5);"," vec2 corner1 = center + pixelSize * vec2(-0.5, -0.5);"," vec2 corner2 = center + pixelSize * vec2(+0.5, -0.5);"," vec2 corner3 = center + pixelSize * vec2(+0.5, +0.5);"," vec2 corner4 = center + pixelSize * vec2(-0.5, +0.5);"," vec4 pixel = 0.4 * texture2D(uMainSampler, center / resolution);"," pixel += 0.15 * texture2D(uMainSampler, corner1 / resolution);"," pixel += 0.15 * texture2D(uMainSampler, corner2 / resolution);"," pixel += 0.15 * texture2D(uMainSampler, corner3 / resolution);"," pixel += 0.15 * texture2D(uMainSampler, corner4 / resolution);"," gl_FragColor = pixel;","}"].join("\n")},88430(t){t.exports=["#pragma phaserTemplate(shaderName)","precision highp float;","uniform sampler2D uMainSampler;","uniform vec4 uSteps;","uniform vec4 uGamma;","uniform vec4 uOffset;","uniform int uMode;","uniform bool uDither;","varying vec2 outTexCoord;","vec4 rgbaToHsva(vec4 rgba)","{"," float r = rgba.r;"," float g = rgba.g;"," float b = rgba.b;"," float a = rgba.a;"," float min = min(min(r, g), b);"," float max = max(max(r, g), b);"," float d = max - min;"," float h = 0.0;"," float s = (max == 0.0) ? 0.0 : d / max;"," float v = max;"," if (max != min)"," {"," if (max == r)"," {"," h = (g - b) / d + ((g < b) ? 6.0 : 0.0);"," }"," else if (max == g)"," {"," h = (b - r) / d + 2.0;"," }"," else"," {"," h = (r - g) / d + 4.0;"," }"," h /= 6.0;"," }"," return vec4(h, s, v, a);","}","float hsvaToRgbaConvert(float n, vec4 hsva)","{"," float k = mod(n + hsva.x * 6.0, 6.0);"," float min = min(min(k, 4.0 - k), 1.0);"," return hsva.z - hsva.z * hsva.y * max(0.0, min);","}","vec4 hsvaToRgba(vec4 hsva)","{"," return vec4("," hsvaToRgbaConvert(5.0, hsva),"," hsvaToRgbaConvert(3.0, hsva),"," hsvaToRgbaConvert(1.0, hsva),"," hsva.a"," );","}","vec4 ditherIGN(vec4 value)","{"," value += fract(52.9829189 * fract(0.06711056 * gl_FragCoord.x + 0.00583715 * gl_FragCoord.y)) - 0.5;"," return value;","}","void main ()","{"," vec4 sample = texture2D(uMainSampler, outTexCoord);"," if (uMode == 1)"," {"," sample = rgbaToHsva(sample);"," }"," sample = pow(sample, uGamma);"," sample -= uOffset;"," vec4 steps = max(uSteps - 1.0, 1.0);"," sample *= steps;"," if (uDither)"," {"," sample = ditherIGN(sample);"," }"," sample = ceil(sample - 0.5);"," sample /= steps;"," sample += uOffset;"," sample = pow(sample, 1.0 / uGamma);"," if (uMode == 1)"," {"," sample.x = mod(sample.x, 1.0);"," sample = hsvaToRgba(clamp(sample, 0.0, 1.0));"," }"," gl_FragColor = sample;","}"].join("\n")},69355(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","varying vec2 outTexCoord;","uniform vec2 lightPosition;","uniform vec4 color;","uniform float decay;","uniform float power;","uniform float intensity;","uniform int samples;","const int MAX = 12;","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec4 texture = boundedSampler(uMainSampler, outTexCoord);"," vec2 pc = (lightPosition - outTexCoord) * intensity;"," float shadow = 0.0;"," float limit = max(float(MAX), float(samples));"," for (int i = 0; i < MAX; ++i)"," {"," if (i >= samples)"," {"," break;"," }"," shadow += boundedSampler(uMainSampler, outTexCoord + float(i) * decay / limit * pc).a * power;"," }"," float mask = 1.0 - texture.a;"," gl_FragColor = mix(texture, color, clamp(shadow * mask, 0.0, 1.0));","}"].join("\n")},92636(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec4 edge1;","uniform vec4 edge2;","uniform vec4 invert;","varying vec2 outTexCoord;","void main ()","{"," vec4 color = texture2D(uMainSampler, outTexCoord);"," color = clamp((color - edge1) / (edge2 - edge1), 0.0, 1.0);"," color = mix(color, 1.0 - color, invert);"," gl_FragColor = color;","}"].join("\n")},18185(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform float uRadius;","uniform float uStrength;","uniform vec2 uPosition;","uniform vec4 uColor;","uniform int uBlendMode;","varying vec2 outTexCoord;","void main ()","{"," float vignette = 1.0;"," vec2 position = vec2(uPosition.x, 1.0 - uPosition.y);"," float d = length(outTexCoord - position);"," if (d <= uRadius)"," {"," float g = d / uRadius;"," vignette = sin(g * 3.14 * uStrength);"," }"," vec4 color = uColor;"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," if (uBlendMode == 1)"," {"," color.rgb = texture.rgb + color.rgb;"," }"," else if (uBlendMode == 2)"," {"," color.rgb = texture.rgb * color.rgb;"," }"," else if (uBlendMode == 3)"," {"," color.rgb = 1.0 - ((1.0 - texture.rgb) * (1.0 - color.rgb));"," }"," gl_FragColor = mix(texture, color, vignette);","}"].join("\n")},99174(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uMainSampler2;","uniform vec4 uProgress_WipeWidth_Direction_Axis;","uniform float uReveal;","varying vec2 outTexCoord;","void main ()","{"," vec4 color0;"," vec4 color1;"," if (uReveal == 0.0)"," {"," color0 = texture2D(uMainSampler, outTexCoord);"," color1 = texture2D(uMainSampler2, outTexCoord);"," }"," else"," {"," color0 = texture2D(uMainSampler2, outTexCoord);"," color1 = texture2D(uMainSampler, outTexCoord);"," }"," float distance = uProgress_WipeWidth_Direction_Axis.x;"," float width = uProgress_WipeWidth_Direction_Axis.y;"," float direction = uProgress_WipeWidth_Direction_Axis.z;"," float axis = outTexCoord.x;"," if (uProgress_WipeWidth_Direction_Axis.w == 1.0)"," {"," axis = outTexCoord.y;"," }"," float adjust = mix(width, -width, distance);"," float value = smoothstep(distance - width, distance + width, abs(direction - axis) + adjust);"," gl_FragColor = mix(color1, color0, value);","}"].join("\n")},73416(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(fragmentDefine)","uniform vec2 uResolution;","varying vec4 outTint;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec4 fragColor = outTint;"," #pragma phaserTemplate(fragmentProcess)"," gl_FragColor = fragColor;","}"].join("\n")},91627(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(vertexDefine)","uniform mat4 uProjectionMatrix;","uniform vec2 uResolution;","attribute vec2 inPosition;","attribute vec4 inTint;","varying vec4 outTint;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(vertexHeader)","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);"," outTint = vec4(inTint.bgr * inTint.a, inTint.a);"," #pragma phaserTemplate(vertexProcess)","}"].join("\n")},84220(t){t.exports=["vec3 getNormalFromMap (vec2 texCoord)","{"," vec3 normalMap = texture2D(uNormSampler, texCoord).rgb;"," return normalize(outInverseRotationMatrix * vec3(normalMap * 2.0 - 1.0));","}"].join("\n")},2860(t){t.exports=["uniform vec2 uMainResolution[TEXTURE_COUNT];","vec2 getTexRes ()","{"," #if TEXTURE_COUNT == 1"," float texId = 0.0;"," #else"," float texId = outTexDatum;"," #endif"," #pragma phaserTemplate(texIdProcess)"," vec2 texRes = vec2(0.0);"," for (int i = 0; i < TEXTURE_COUNT; i++)"," {"," if (texId == float(i))"," {"," texRes = uMainResolution[i];"," break;"," }"," }"," return texRes;","}"].join("\n")},46432(t){t.exports=["uniform sampler2D uMainSampler[TEXTURE_COUNT];","vec4 getTexture (vec2 texCoord)","{"," #if TEXTURE_COUNT == 1"," return texture2D(uMainSampler[0], texCoord);"," #else"," if (outTexDatum == 0.0) return texture2D(uMainSampler[0], texCoord);"," #define ELSE_TEX_CASE(INDEX) else if (outTexDatum == float(INDEX)) return texture2D(uMainSampler[INDEX], texCoord);"," #pragma phaserTemplate(texIdProcess)"," else return vec4(0.0, 0.0, 0.0, 0.0);"," #endif","}"].join("\n")},41509(t){t.exports=["#pragma phaserTemplate(shaderName)","precision highp float;","#pragma phaserTemplate(fragmentHeader)","#define PI 3.14159265358979323846","uniform int uRepeatMode;","uniform float uOffset;","uniform int uShapeMode;","uniform vec2 uShape;","uniform vec2 uStart;","varying vec2 outTexCoord;","float linear()","{"," float len = length(uShape);"," return dot(uShape, outTexCoord - uStart) / len / len;","}","float bilinear()","{"," return abs(linear());","}","float radial()","{"," return distance(uStart, outTexCoord) / length(uShape);","}","float conicSymmetric()","{"," return dot(normalize(uShape), normalize(outTexCoord - uStart)) * 0.5 + 0.5;","}","float conicAsymmetric()","{"," vec2 fromStart = outTexCoord - uStart;"," float angleFromStart = atan(fromStart.y, fromStart.x);"," float shapeAngle = atan(uShape.y, uShape.x);"," float angle = (angleFromStart - shapeAngle) / PI / 2.0;"," if (angle < 0.0) angle += 1.0;"," return angle;","}","float repeat(float value)","{"," if (uRepeatMode == 1)"," {"," if (value < 0.0 || value > 1.0)"," {"," discard;"," }"," return value;"," }"," else if (uRepeatMode == 2)"," {"," return mod(value, 1.0);"," }"," else if (uRepeatMode == 3)"," {"," return 1.0 - abs(1.0 - mod(value, 2.0));"," }"," return clamp(value, 0.0, 1.0);","}","void main()","{"," float progress = 0.0;"," if (uShapeMode == 0)"," {"," progress = linear();"," }"," else if (uShapeMode == 1)"," {"," progress = bilinear();"," }"," else if (uShapeMode == 2)"," {"," progress = radial();"," }"," else if (uShapeMode == 3)"," {"," progress = conicSymmetric();"," }"," else if (uShapeMode == 4)"," {"," progress = conicAsymmetric();"," }"," progress -= uOffset;"," progress = repeat(progress);"," vec4 bandCol = getRampAt(progress);"," bandCol.rgb *= bandCol.a;"," gl_FragColor = bandCol;","}"].join("\n")},98840(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(fragmentDefine)","uniform vec2 uResolution;","varying vec2 outTexCoord;","varying float outTexDatum;","varying float outTintEffect;","varying vec4 outTint;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," #pragma phaserTemplate(fragmentProcess)"," gl_FragColor = fragColor;","}"].join("\n")},44667(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(vertexDefine)","uniform mat4 uProjectionMatrix;","uniform vec2 uResolution;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","attribute float inTexDatum;","attribute float inTintEffect;","attribute vec4 inTint;","varying vec2 outTexCoord;","varying float outTexDatum;","varying float outTintEffect;","varying vec4 outTint;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(vertexHeader)","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);"," outTexCoord = inTexCoord;"," outTexDatum = inTexDatum;"," outTint = inTint;"," outTintEffect = inTintEffect;"," #pragma phaserTemplate(vertexProcess)","}"].join("\n")},16421(t){t.exports=["#version 100","#pragma phaserTemplate(shaderName)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform vec2 uOffset;","uniform vec4 uColorStart;","uniform vec4 uColorEnd;","uniform float uPower;","uniform int uMode;","varying vec2 outTexCoord;","float trig(vec2 p)","{"," return fract(43757.5453*sin(dot(p, vec2(12.9898,78.233))));","}","void main ()","{"," float value = pow(trig(outTexCoord + uOffset), uPower);"," if (uMode == 0)"," {"," vec4 color = mix(uColorStart, uColorEnd, value);"," color.rgb *= color.a;"," gl_FragColor = color;"," }"," else if (uMode == 1)"," {"," float valueR = pow(trig(outTexCoord + uOffset + 32.1), uPower);"," float valueG = pow(trig(outTexCoord + uOffset + 11.1), uPower);"," float valueB = pow(trig(outTexCoord + uOffset + 23.4), uPower);"," vec4 color = vec4(valueR, valueG, valueB, 1.);"," color *= mix(uColorStart, uColorEnd, value);"," color.rgb *= color.a;"," gl_FragColor = color;"," }"," else if (uMode == 2)"," {"," float valueAngle = pow(trig(outTexCoord + uOffset), uPower) * 3.141592;"," float x = value * cos(valueAngle);"," float y = value * sin(valueAngle);"," vec4 color = vec4("," x,"," y,"," sqrt(1. - x * x - y * y),"," 1.0"," );"," gl_FragColor = color * 0.5 + 0.5;"," }","}"].join("\n")},83587(t){t.exports=["#version 100","#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(fragmentIterations)","#pragma phaserTemplate(fragmentNormalMap)","#ifndef ITERATION_COUNT","#define ITERATION_COUNT 1.0","#endif","#ifndef WARP_ITERATION_COUNT","#define WARP_ITERATION_COUNT 1.0","#endif","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform vec2 uCells;","uniform vec2 uPeriod;","uniform vec2 uOffset;","uniform float uFlow;","uniform float uDetailPower;","uniform float uFlowPower;","uniform float uContributionPower;","uniform float uWarpDetailPower;","uniform float uWarpFlowPower;","uniform float uWarpContributionPower;","uniform float uWarpAmount;","uniform vec4 uColorStart;","uniform vec4 uColorEnd;","uniform float uNormalScale;","uniform float uValueFactor;","uniform float uValueAdd;","uniform float uValuePower;","uniform vec2 uSeed;","varying vec2 outTexCoord;","float psrdnoise(vec2 x, vec2 period, float alpha)","{"," vec2 uv = vec2(x.x+x.y*0.5, x.y);"," vec2 i0 = floor(uv), f0 = fract(uv);"," float cmp = step(f0.y, f0.x);"," vec2 o1 = vec2(cmp, 1.0-cmp);"," vec2 i1 = i0 + o1, i2 = i0 + 1.0;"," vec2 v0 = vec2(i0.x - i0.y*0.5, i0.y);"," vec2 v1 = vec2(v0.x + o1.x - o1.y*0.5, v0.y + o1.y);"," vec2 v2 = vec2(v0.x + 0.5, v0.y + 1.0);"," vec2 x0 = x - v0, x1 = x - v1, x2 = x - v2;"," vec3 iu, iv, xw, yw;"," if(any(greaterThan(period, vec2(0.0)))) {"," xw = vec3(v0.x, v1.x, v2.x); yw = vec3(v0.y, v1.y, v2.y);"," if(period.x > 0.0)"," xw = mod(vec3(v0.x, v1.x, v2.x), period.x);"," if(period.y > 0.0)"," yw = mod(vec3(v0.y, v1.y, v2.y), period.y);"," iu = floor(xw + 0.5*yw + 0.5); iv = floor(yw + 0.5);"," } else {"," iu = vec3(i0.x, i1.x, i2.x); iv = vec3(i0.y, i1.y, i2.y);"," }"," iu += uSeed.xxx; iv += uSeed.yyy;"," vec3 hash = mod(iu, 289.0);"," hash = mod((hash*51.0 + 2.0)*hash + iv, 289.0);"," hash = mod((hash*34.0 + 10.0)*hash, 289.0);"," vec3 psi = hash*0.07482 + alpha;"," vec3 gx = cos(psi); vec3 gy = sin(psi);"," vec2 g0 = vec2(gx.x, gy.x);"," vec2 g1 = vec2(gx.y, gy.y);"," vec2 g2 = vec2(gx.z, gy.z);"," vec3 w = 0.8 - vec3(dot(x0, x0), dot(x1, x1), dot(x2, x2));"," w = max(w, 0.0); vec3 w2 = w*w; vec3 w4 = w2*w2;"," vec3 gdotx = vec3(dot(g0, x0), dot(g1, x1), dot(g2, x2));"," float n = dot(w4, gdotx);"," return 10.9*n;","}","float iterate (vec2 coord, float detailPower, float flowPower, float contributionPower)","{"," float value = 0.;"," float itValue = 0.;"," for (float iteration = 0.; iteration < ITERATION_COUNT; iteration++)"," {"," float detailScale = pow(detailPower, iteration);"," float flowScale = pow(flowPower, iteration);"," itValue = psrdnoise((coord + iteration) * detailScale, uPeriod * detailScale, uFlow * flowScale + iteration);"," value += itValue / pow(contributionPower, iteration);"," }"," return value;","}","float iterateWarp (vec2 coord, float detailPower, float flowPower, float contributionPower)","{"," float value = 0.;"," float itValue = 0.;"," for (float iteration = 0.; iteration < WARP_ITERATION_COUNT; iteration++)"," {"," float detailScale = pow(detailPower, iteration);"," float flowScale = pow(flowPower, iteration);"," itValue = psrdnoise((coord + iteration) * detailScale, uPeriod * detailScale, uFlow * flowScale + iteration);"," value += itValue / pow(contributionPower, iteration);"," }"," return value;","}","vec2 warp (vec2 coord)","{"," vec2 o2 = vec2(11.3, 23.7);"," float coord1 = iterateWarp(coord, uWarpDetailPower, uWarpFlowPower, uWarpContributionPower);"," float coord2 = iterateWarp(coord + o2, uWarpDetailPower, uWarpFlowPower, uWarpContributionPower);"," return vec2(coord1, coord2);","}","void main ()","{"," vec2 coord = outTexCoord * uCells + uOffset;"," if (uWarpAmount > 0.)"," {"," coord += warp(coord) * uWarpAmount;"," }"," float value = iterate(coord, uDetailPower, uFlowPower, uContributionPower) * uValueFactor + uValueAdd;"," value = pow(clamp(value, 0., 1.), uValuePower);"," #ifndef NORMAL_MAP"," vec4 color = mix(uColorStart, uColorEnd, value);"," color.rgb *= color.a;"," gl_FragColor = color;"," #else"," float dx = dFdx(value) * uNormalScale;"," float dy = dFdy(value) * uNormalScale;"," vec3 normal = vec3(dx, dy, 1.0 - sqrt(dx * dx + dy * dy)) * 0.5 + 0.5;"," gl_FragColor = vec4(normal, 1.0);"," #endif","}"].join("\n")},13460(t){t.exports=["#version 100","#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(fragmentIterations)","#pragma phaserTemplate(fragmentNormalMap)","#ifndef ITERATION_COUNT","#define ITERATION_COUNT 1.0","#endif","#ifndef WARP_ITERATION_COUNT","#define WARP_ITERATION_COUNT 1.0","#endif","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform vec3 uCells;","uniform vec3 uPeriod;","uniform vec3 uOffset;","uniform float uFlow;","uniform float uDetailPower;","uniform float uFlowPower;","uniform float uContributionPower;","uniform float uWarpDetailPower;","uniform float uWarpFlowPower;","uniform float uWarpContributionPower;","uniform float uWarpAmount;","uniform vec4 uColorStart;","uniform vec4 uColorEnd;","uniform float uNormalScale;","uniform float uValueFactor;","uniform float uValueAdd;","uniform float uValuePower;","uniform vec3 uSeed;","varying vec2 outTexCoord;","vec4 permute(vec4 i) {"," vec4 im = mod(i, 289.0);"," return mod(((im * 34.0) + 10.0) * im, 289.0);","}","float psrdnoise(vec3 x, vec3 period, float alpha) {"," const mat3 M = mat3(0.0, 1.0, 1.0, 1.0, 0.0, 1.0, 1.0, 1.0, 0.0);"," const mat3 Mi = mat3(-0.5, 0.5, 0.5, 0.5, -0.5, 0.5, 0.5, 0.5, -0.5);"," vec3 uvw = M * x;"," vec3 i0 = floor(uvw);"," vec3 f0 = fract(uvw);"," vec3 g_ = step(f0.xyx, f0.yzz);"," vec3 l_ = 1.0 - g_;"," vec3 g = vec3(l_.z, g_.xy);"," vec3 l = vec3(l_.xy, g_.z);"," vec3 o1 = min(g, l);"," vec3 o2 = max(g, l);"," vec3 i1 = i0 + o1, i2 = i0 + o2, i3 = i0 + 1.0;"," vec3 v0 = Mi * i0, v1 = Mi * i1, v2 = Mi * i2, v3 = Mi * i3;"," vec3 x0 = x - v0, x1 = x - v1, x2 = x - v2, x3 = x - v3;"," if(any(greaterThan(period, vec3(0.0)))) {"," vec4 vx = vec4(v0.x, v1.x, v2.x, v3.x);"," vec4 vy = vec4(v0.y, v1.y, v2.y, v3.y);"," vec4 vz = vec4(v0.z, v1.z, v2.z, v3.z);"," if(period.x > 0.0)"," vx = mod(vx, period.x);"," if(period.y > 0.0)"," vy = mod(vy, period.y);"," if(period.z > 0.0)"," vz = mod(vz, period.z);"," i0 = floor(M * vec3(vx.x, vy.x, vz.x) + 0.5);"," i1 = floor(M * vec3(vx.y, vy.y, vz.y) + 0.5);"," i2 = floor(M * vec3(vx.z, vy.z, vz.z) + 0.5);"," i3 = floor(M * vec3(vx.w, vy.w, vz.w) + 0.5);"," }"," i0 += uSeed; i1 += uSeed; i2 += uSeed; i3 += uSeed;"," vec4 hash = permute(permute(permute(vec4(i0.z, i1.z, i2.z, i3.z)) + vec4(i0.y, i1.y, i2.y, i3.y)) + vec4(i0.x, i1.x, i2.x, i3.x));"," vec4 theta = hash * 3.883222077;"," vec4 sz = 0.996539792 - 0.006920415 * hash;"," vec4 psi = hash * 0.108705628;"," vec4 Ct = cos(theta);"," vec4 St = sin(theta);"," vec4 sz_prime = sqrt(1.0 - sz * sz);"," vec4 gx, gy, gz;"," if(alpha != 0.0) {"," vec4 px = Ct * sz_prime;"," vec4 py = St * sz_prime;"," vec4 pz = sz;"," vec4 Sp = sin(psi);"," vec4 Cp = cos(psi);"," vec4 Ctp = St * Sp - Ct * Cp;"," vec4 qx = mix(Ctp * St, Sp, sz);"," vec4 qy = mix(-Ctp * Ct, Cp, sz);"," vec4 qz = -(py * Cp + px * Sp);"," vec4 Sa = vec4(sin(alpha));"," vec4 Ca = vec4(cos(alpha));"," gx = Ca * px + Sa * qx;"," gy = Ca * py + Sa * qy;"," gz = Ca * pz + Sa * qz;"," } else {"," gx = Ct * sz_prime;"," gy = St * sz_prime;"," gz = sz;"," }"," vec3 g0 = vec3(gx.x, gy.x, gz.x), g1 = vec3(gx.y, gy.y, gz.y);"," vec3 g2 = vec3(gx.z, gy.z, gz.z), g3 = vec3(gx.w, gy.w, gz.w);"," vec4 w = 0.5 - vec4(dot(x0, x0), dot(x1, x1), dot(x2, x2), dot(x3, x3));"," w = max(w, 0.0);"," vec4 w2 = w * w;"," vec4 w3 = w2 * w;"," vec4 gdotx = vec4(dot(g0, x0), dot(g1, x1), dot(g2, x2), dot(g3, x3));"," float n = dot(w3, gdotx);"," return 39.5 * n;","}","float iterate (vec3 coord, float detailPower, float flowPower, float contributionPower)","{"," float value = 0.;"," float itValue = 0.;"," for (float iteration = 0.; iteration < ITERATION_COUNT; iteration++)"," {"," float detailScale = pow(detailPower, iteration);"," float flowScale = pow(flowPower, iteration);"," itValue = psrdnoise((coord + iteration) * detailScale, uPeriod * detailScale, uFlow * flowScale + iteration);"," value += itValue / pow(contributionPower, iteration);"," }"," return value;","}","float iterateWarp (vec3 coord, float detailPower, float flowPower, float contributionPower)","{"," float value = 0.;"," float itValue = 0.;"," for (float iteration = 0.; iteration < WARP_ITERATION_COUNT; iteration++)"," {"," float detailScale = pow(detailPower, iteration);"," float flowScale = pow(flowPower, iteration);"," itValue = psrdnoise((coord + iteration) * detailScale, uPeriod * detailScale, uFlow * flowScale + iteration);"," value += itValue / pow(contributionPower, iteration);"," }"," return value;","}","vec3 warp (vec3 coord)","{"," vec3 o2 = vec3(11.3, 23.7, 13.1);"," vec3 o3 = vec3(29.9, 2.3, 31.7);"," float coord1 = iterateWarp(coord, uWarpDetailPower, uWarpFlowPower, uWarpContributionPower);"," float coord2 = iterateWarp(coord + o2, uWarpDetailPower, uWarpFlowPower, uWarpContributionPower);"," float coord3 = iterateWarp(coord + o3, uWarpDetailPower, uWarpFlowPower, uWarpContributionPower);"," return vec3(coord1, coord2, coord3);","}","void main ()","{"," vec3 coord = (vec3(outTexCoord, 0.0) * uCells) + uOffset;"," if (uWarpAmount > 0.)"," {"," coord += warp(coord) * uWarpAmount;"," }"," float value = iterate(coord, uDetailPower, uFlowPower, uContributionPower) * uValueFactor + uValueAdd;"," value = pow(clamp(value, 0., 1.), uValuePower);"," #ifndef NORMAL_MAP"," vec4 color = mix(uColorStart, uColorEnd, value);"," color.rgb *= color.a;"," gl_FragColor = color;"," #else"," float dx = dFdx(value) * uNormalScale;"," float dy = dFdy(value) * uNormalScale;"," vec3 normal = vec3(dx, dy, 1.0 - sqrt(dx * dx + dy * dy)) * 0.5 + 0.5;"," gl_FragColor = vec4(normal, 1.0);"," #endif","}"].join("\n")},17205(t){t.exports=["#version 100","#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(fragmentMode)","#pragma phaserTemplate(fragmentIterations)","#pragma phaserTemplate(fragmentNormalMap)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform vec2 uSeedX;","uniform vec2 uSeedY;","uniform vec2 uCells;","uniform vec2 uCellOffset;","uniform vec2 uVariation;","uniform vec2 uWrap;","uniform float uSmoothing;","uniform float uNormalScale;","uniform vec4 uColorStart;","uniform vec4 uColorEnd;","varying vec2 outTexCoord;","float trig(vec2 p)","{"," return fract(43757.5453*sin(dot(p, vec2(12.9898,78.233))));","}","vec2 bigCoord (vec2 coord, float scale)","{"," return (coord + uCellOffset) * scale * uCells;","}","vec2 hash2D (vec2 coord)","{"," return vec2("," trig(coord + uSeedX),"," trig(coord + uSeedY)"," ) * uVariation;","}","float worley2D (vec2 uv, float scale)","{"," vec2 coord = bigCoord(uv, scale);"," vec2 point = floor(coord);"," vec2 frac = fract(coord);"," float dist = 12.0;"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec2 cellNeighbor = vec2(i, j);"," vec2 jitter = hash2D(mod(point + cellNeighbor, uWrap * scale));"," vec2 diff = cellNeighbor - frac + jitter;"," float d = dot(diff, diff); // Squared length of diff."," if (d < dist)"," {"," dist = d;"," }"," }"," return sqrt(dist);","}","float worley2DIndex (vec2 uv, float scale)","{"," vec2 coord = bigCoord(uv, scale);"," vec2 point = floor(coord);"," vec2 frac = fract(coord);"," float dist = 12.0;"," float random = 0.0;"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec2 cellNeighbor = vec2(i, j);"," vec2 jitter = hash2D(mod(point + cellNeighbor, uWrap * scale));"," vec2 diff = cellNeighbor - frac + jitter;"," float d = dot(diff, diff); // Squared length of diff."," if (d < dist)"," {"," dist = d;"," random = jitter.x;"," }"," }"," return random;","}","float worley2DSmooth (vec2 uv, float scale)","{"," vec2 coord = bigCoord(uv, scale);"," vec2 point = floor(coord);"," vec2 frac = fract(coord);"," float value = 0.0;"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec2 cellNeighbor = vec2(i, j);"," vec2 jitter = hash2D(mod(point + cellNeighbor, uWrap * scale));"," vec2 diff = cellNeighbor - frac + jitter;"," float d = length(diff);"," value += exp2(-32.0 / uSmoothing * d); // Accumulate fast-decaying exponential of length."," }"," return -(1.0 / 32.0 * uSmoothing) * log2(value);","}","float iterateWorley2D (vec2 uv)","{"," float value = 0.0;"," float itValue = 0.0;"," for (float iteration = 0.0; iteration < ITERATION_COUNT; iteration++)"," {"," float scale = exp2(iteration);"," #ifdef MODE_DISTANCE"," itValue = worley2D(uv + iteration, scale);"," #endif"," #ifdef MODE_INDEX"," itValue = worley2DIndex(uv + iteration, scale);"," #endif"," #ifdef MODE_DISTANCE_SMOOTH"," itValue = worley2DSmooth(uv + iteration, scale);"," #endif"," value += (itValue - 0.5) / scale;"," }"," return value + 0.5;","}","void main ()","{"," float value = iterateWorley2D(outTexCoord);"," #ifndef NORMAL_MAP"," vec4 color = mix(uColorStart, uColorEnd, value);"," color.rgb *= color.a;"," gl_FragColor = color;"," #else"," float dx = dFdx(value) * uNormalScale;"," float dy = dFdy(value) * uNormalScale;"," vec3 normal = vec3(dx, dy, 1.0 - sqrt(dx * dx + dy * dy)) * 0.5 + 0.5;"," gl_FragColor = vec4(normal, 1.0);"," #endif","}"].join("\n")},79814(t){t.exports=["#version 100","#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(fragmentMode)","#pragma phaserTemplate(fragmentIterations)","#pragma phaserTemplate(fragmentNormalMap)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform vec3 uSeedX;","uniform vec3 uSeedY;","uniform vec3 uSeedZ;","uniform vec3 uCells;","uniform vec3 uCellOffset;","uniform vec3 uVariation;","uniform vec3 uWrap;","uniform float uSmoothing;","uniform float uNormalScale;","uniform vec4 uColorStart;","uniform vec4 uColorEnd;","varying vec2 outTexCoord;","float trig(vec3 p)","{"," return fract(43757.5453*sin(dot(p, vec3(12.9898,78.233, 9441.8953))));","}","vec3 bigCoord (vec3 coord, float scale)","{"," return (coord + uCellOffset) * scale * uCells;","}","vec3 hash3D (vec3 coord)","{"," return vec3("," trig(coord + uSeedX),"," trig(coord + uSeedY),"," trig(coord + uSeedZ)"," ) * uVariation;","}","float worley3D (vec3 uv, float scale)","{"," vec3 coord = bigCoord(uv, scale);"," vec3 point = floor(coord);"," vec3 frac = fract(coord);"," float dist = 12.0;"," for (float k = -1.0; k <= 1.0; k++)"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec3 cellNeighbor = vec3(i, j, k);"," vec3 jitter = hash3D(mod(point + cellNeighbor, uWrap * scale));"," vec3 diff = cellNeighbor - frac + jitter;"," float d = dot(diff, diff); // Squared length of diff."," if (d < dist)"," {"," dist = d;"," }"," }"," return sqrt(dist);","}","float worley3DIndex (vec3 uv, float scale)","{"," vec3 coord = bigCoord(uv, scale);"," vec3 point = floor(coord);"," vec3 frac = fract(coord);"," float dist = 12.0;"," float random = 0.0;"," for (float k = -1.0; k <= 1.0; k++)"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec3 cellNeighbor = vec3(i, j, k);"," vec3 jitter = hash3D(mod(point + cellNeighbor, uWrap * scale));"," vec3 diff = cellNeighbor - frac + jitter;"," float d = dot(diff, diff); // Squared length of diff."," if (d < dist)"," {"," dist = d;"," random = jitter.x;"," }"," }"," return random;","}","float worley3DSmooth (vec3 uv, float scale)","{"," vec3 coord = bigCoord(uv, scale);"," vec3 point = floor(coord);"," vec3 frac = fract(coord);"," float value = 0.0;"," for (float k = -1.0; k <= 1.0; k++)"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec3 cellNeighbor = vec3(i, j, k);"," vec3 jitter = hash3D(mod(point + cellNeighbor, uWrap * scale));"," vec3 diff = cellNeighbor - frac + jitter;"," float d = length(diff);"," value += exp2(-32.0 / uSmoothing * d); // Accumulate fast-decaying exponential of length."," }"," return -(1.0 / 32.0 * uSmoothing) * log2(value);","}","float iterateWorley3D (vec3 uv)","{"," float value = 0.0;"," float itValue = 0.0;"," for (float iteration = 0.0; iteration < ITERATION_COUNT; iteration++)"," {"," float scale = exp2(iteration);"," #ifdef MODE_DISTANCE"," itValue = worley3D(uv + iteration, scale);"," #endif"," #ifdef MODE_INDEX"," itValue = worley3DIndex(uv + iteration, scale);"," #endif"," #ifdef MODE_DISTANCE_SMOOTH"," itValue = worley3DSmooth(uv + iteration, scale);"," #endif"," value += (itValue - 0.5) / scale;"," }"," return value + 0.5;","}","void main ()","{"," vec3 uv = vec3(outTexCoord, 0.0);"," float value = iterateWorley3D(uv);"," #ifndef NORMAL_MAP"," vec4 color = mix(uColorStart, uColorEnd, value);"," color.rgb *= color.a;"," gl_FragColor = color;"," #else"," float dx = dFdx(value) * uNormalScale;"," float dy = dFdy(value) * uNormalScale;"," vec3 normal = vec3(dx, dy, 1.0 - sqrt(dx * dx + dy * dy)) * 0.5 + 0.5;"," gl_FragColor = vec4(normal, 1.0);"," #endif","}"].join("\n")},99595(t){t.exports=["#version 100","#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(fragmentMode)","#pragma phaserTemplate(fragmentIterations)","#pragma phaserTemplate(fragmentNormalMap)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform vec4 uSeedX;","uniform vec4 uSeedY;","uniform vec4 uSeedZ;","uniform vec4 uSeedW;","uniform vec4 uCells;","uniform vec4 uCellOffset;","uniform vec4 uVariation;","uniform vec4 uWrap;","uniform float uSmoothing;","uniform float uNormalScale;","uniform vec4 uColorStart;","uniform vec4 uColorEnd;","varying vec2 outTexCoord;","float trig(vec4 p)","{"," return fract(43757.5453*sin(dot(p, vec4(12.9898,78.233,9441.8953,61.99))));","}","vec4 bigCoord (vec4 coord, float scale)","{"," return (coord + uCellOffset) * scale * uCells;","}","vec4 hash4D (vec4 coord)","{"," return vec4("," trig(coord + uSeedX),"," trig(coord + uSeedY),"," trig(coord + uSeedZ),"," trig(coord + uSeedW)"," ) * uVariation;","}","float worley4D (vec4 uv, float scale)","{"," vec4 coord = bigCoord(uv, scale);"," vec4 point = floor(coord);"," vec4 frac = fract(coord);"," float dist = 16.0;"," for (float l = -1.0; l <= 1.0; l++)"," for (float k = -1.0; k <= 1.0; k++)"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec4 cellNeighbor = vec4(i, j, k, l);"," vec4 jitter = hash4D(mod(point + cellNeighbor, uWrap * scale));"," vec4 diff = cellNeighbor - frac + jitter;"," float d = dot(diff, diff); // Squared length of diff."," if (d < dist)"," {"," dist = d;"," }"," }"," return sqrt(dist);","}","float worley4DIndex (vec4 uv, float scale)","{"," vec4 coord = bigCoord(uv, scale);"," vec4 point = floor(coord);"," vec4 frac = fract(coord);"," float dist = 16.0;"," float random = 0.0;"," for (float l = -1.0; l <= 1.0; l++)"," for (float k = -1.0; k <= 1.0; k++)"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec4 cellNeighbor = vec4(i, j, k, l);"," vec4 jitter = hash4D(mod(point + cellNeighbor, uWrap * scale));"," vec4 diff = cellNeighbor - frac + jitter;"," float d = dot(diff, diff); // Squared length of diff."," if (d < dist)"," {"," dist = d;"," random = jitter.x;"," }"," }"," return random;","}","float worley4DSmooth (vec4 uv, float scale)","{"," vec4 coord = bigCoord(uv, scale);"," vec4 point = floor(coord);"," vec4 frac = fract(coord);"," float value = 0.0;"," for (float l = -1.0; l <= 1.0; l++)"," for (float k = -1.0; k <= 1.0; k++)"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec4 cellNeighbor = vec4(i, j, k, l);"," vec4 jitter = hash4D(mod(point + cellNeighbor, uWrap * scale));"," vec4 diff = cellNeighbor - frac + jitter;"," float d = length(diff);"," value += exp2(-32.0 / uSmoothing * d); // Accumulate fast-decaying exponential of length."," }"," return -(1.0 / 32.0 * uSmoothing) * log2(value);","}","float iterateWorley4D (vec4 uv)","{"," float value = 0.0;"," float itValue = 0.0;"," for (float iteration = 0.0; iteration < ITERATION_COUNT; iteration++)"," {"," float scale = exp2(iteration);"," #ifdef MODE_DISTANCE"," itValue = worley4D(uv + iteration, scale);"," #endif"," #ifdef MODE_INDEX"," itValue = worley4DIndex(uv + iteration, scale);"," #endif"," #ifdef MODE_DISTANCE_SMOOTH"," itValue = worley4DSmooth(uv + iteration, scale);"," #endif"," value += (itValue - 0.5) / scale;"," }"," return value + 0.5;","}","void main ()","{"," vec4 uv = vec4(outTexCoord, 0.0, 0.0);"," float value = iterateWorley4D(uv);"," #ifndef NORMAL_MAP"," vec4 color = mix(uColorStart, uColorEnd, value);"," color.rgb *= color.a;"," gl_FragColor = color;"," #else"," float dx = dFdx(value) * uNormalScale;"," float dy = dFdy(value) * uNormalScale;"," vec3 normal = vec3(dx, dy, 1.0 - sqrt(dx * dx + dy * dy)) * 0.5 + 0.5;"," gl_FragColor = vec4(normal, 1.0);"," #endif","}"].join("\n")},62807(t){t.exports=["float inverseRotation = -rotation - uCamera.z;","float irSine = sin(inverseRotation);","float irCosine = cos(inverseRotation);","outInverseRotationMatrix = mat3("," irCosine, irSine, 0.0,"," -irSine, irCosine, 0.0,"," 0.0, 0.0, 1.0",");"].join("\n")},4127(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","precision mediump float;","#pragma phaserTemplate(fragmentDefine)","uniform vec2 uResolution;","uniform float uCameraZoom;","varying vec4 lightPosition;","varying vec4 lightColor;","varying float lightRadius;","varying float lightAttenuation;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec2 center = (lightPosition.xy + 1.0) * (uResolution.xy * 0.5);"," float distToSurf = length(center - gl_FragCoord.xy);"," float radius = 1.0 - distToSurf / (lightRadius * uCameraZoom);"," float intensity = smoothstep(0.0, 1.0, radius * lightAttenuation);"," vec4 color = vec4(intensity, intensity, intensity, 0.0) * lightColor;"," #pragma phaserTemplate(fragmentProcess)"," gl_FragColor = vec4(color.rgb * lightColor.a, color.a);","}"].join("\n")},89924(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","precision mediump float;","#pragma phaserTemplate(vertexDefine)","uniform mat4 uProjectionMatrix;","attribute vec2 inPosition;","attribute vec2 inLightPosition;","attribute vec4 inLightColor;","attribute float inLightRadius;","attribute float inLightAttenuation;","varying vec4 lightPosition;","varying vec4 lightColor;","varying float lightRadius;","varying float lightAttenuation;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(vertexHeader)","void main ()","{"," lightColor = inLightColor;"," lightRadius = inLightRadius;"," lightAttenuation = inLightAttenuation;"," lightPosition = uProjectionMatrix * vec4(inLightPosition, 1.0, 1.0);"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);"," #pragma phaserTemplate(vertexProcess)","}"].join("\n")},68589(t){t.exports=["#extension GL_OES_standard_derivatives : enable","#define BAND_TREE_DEPTH 0.0","uniform sampler2D uRampTexture;","uniform vec2 uRampResolution;","uniform float uRampBandStart;","uniform bool uDither;","float decodeNumberSample(vec4 sample)","{"," return ("," sample.r * 255.0 +"," sample.g * 255.0 * 256.0 +"," sample.b * 255.0 * 256.0 * 256.0 +"," sample.a * 255.0 * 256.0 * 256.0 * 256.0"," ) / 256.0 / 256.0;","}","struct Band","{"," vec4 colorStart;"," vec4 colorEnd;"," float start;"," float end;"," int colorSpace;"," int interpolation;"," float middle;","};","Band getBand(float progress)","{"," vec2 rampStep = 1.0 / uRampResolution;"," vec2 c = rampStep / 2.0;"," float start = decodeNumberSample(texture2D(uRampTexture, c));"," float end = decodeNumberSample(texture2D(uRampTexture, vec2(1.0, 0.0) * rampStep + c));"," float TREE_OFFSET = 2.0; // Beginning of tree block."," float index = 0.0;"," float x, y;"," for (float i = 0.0; i < BAND_TREE_DEPTH; i++)"," {"," x = mod(index + TREE_OFFSET, uRampResolution.x);"," y = floor(x / uRampResolution.x);"," float pivot = decodeNumberSample(texture2D(uRampTexture, vec2(x, y) * rampStep + c));"," if (progress > pivot)"," {"," start = pivot;"," index = index * 2.0 + 2.0;"," }"," else"," {"," end = pivot;"," index = index * 2.0 + 1.0;"," }"," }"," float bandNumber = index - uRampBandStart + TREE_OFFSET;"," float bandIndex = bandNumber * 3.0 + uRampBandStart;"," x = mod(bandIndex, uRampResolution.x);"," y = floor(bandIndex / uRampResolution.x);"," vec4 colorStart = texture2D(uRampTexture, vec2(x, y) * rampStep + c);"," x = mod(bandIndex + 1.0, uRampResolution.x);"," y = floor(bandIndex / uRampResolution.x);"," vec4 colorEnd = texture2D(uRampTexture, vec2(x, y) * rampStep + c);"," x = mod(bandIndex + 2.0, uRampResolution.x);"," y = floor(bandIndex / uRampResolution.x);"," float bandData = decodeNumberSample(texture2D(uRampTexture, vec2(x, y) * rampStep + c));"," int colorSpace = int(floor(bandData / 255.0));"," int interpolation = int(floor(bandData)) - colorSpace * 255;"," return Band(colorStart, colorEnd, start, end, colorSpace, interpolation, fract(bandData) * 2.0);","}","float interpolate(float progress, int mode)","{"," if (mode == 1)"," {"," if ((progress *= 2.0) < 1.0)"," {"," return 0.5 * sqrt(1.0 - (--progress * progress));"," }"," progress = 1.0 - progress;"," return 1.0 - 0.5 * sqrt(1.0 - progress * progress);"," }"," if (mode == 2)"," {"," return sin((progress - 0.5) * 3.14159265358979323846) * 0.5 + 0.5;"," }"," if (mode == 3)"," {"," return sqrt(1.0 - (--progress * progress));"," }"," if (mode == 4)"," {"," return 1.0 - sqrt(1.0 - progress * progress);"," }"," return progress;","}","float ditherIGN(float value)","{"," float dx = dFdx(value);"," float dy = dFdy(value);"," float rateOfChange = sqrt(dx * dx + dy * dy);"," value += (fract(52.9829189 * fract(0.06711056 * gl_FragCoord.x + 0.00583715 * gl_FragCoord.y)) - 0.5) * rateOfChange;"," return value;","}","vec4 rgbaToHsva(vec4 rgba)","{"," float r = rgba.r;"," float g = rgba.g;"," float b = rgba.b;"," float a = rgba.a;"," float min = min(min(r, g), b);"," float max = max(max(r, g), b);"," float d = max - min;"," float h = 0.0;"," float s = (max == 0.0) ? 0.0 : d / max;"," float v = max;"," if (max != min)"," {"," if (max == r)"," {"," h = (g - b) / d + ((g < b) ? 6.0 : 0.0);"," }"," else if (max == g)"," {"," h = (b - r) / d + 2.0;"," }"," else"," {"," h = (r - g) / d + 4.0;"," }"," h /= 6.0;"," }"," return vec4(h, s, v, a);","}","float hsvaToRgbaConvert(float n, vec4 hsva)","{"," float k = mod(n + hsva.x * 6.0, 6.0);"," float min = min(min(k, 4.0 - k), 1.0);"," return hsva.z - hsva.z * hsva.y * max(0.0, min);","}","vec4 hsvaToRgba(vec4 hsva)","{"," return vec4("," hsvaToRgbaConvert(5.0, hsva),"," hsvaToRgbaConvert(3.0, hsva),"," hsvaToRgbaConvert(1.0, hsva),"," hsva.a"," );","}","vec4 mixBandColor(float progress, Band band)","{"," if (band.colorSpace == 0)"," {"," return mix(band.colorStart, band.colorEnd, progress);"," }"," vec4 hsvaStart = rgbaToHsva(band.colorStart);"," vec4 hsvaEnd = rgbaToHsva(band.colorEnd);"," if (band.colorSpace == 1)"," {"," float dH = hsvaStart.x - hsvaEnd.x;"," if (dH > 0.5)"," {"," hsvaStart.x -= 1.0;"," }"," else if (dH < -0.5)"," {"," hsvaStart.x += 1.0;"," }"," }"," else if (band.colorSpace == 2)"," {"," if (hsvaStart.x > hsvaEnd.x)"," {"," hsvaStart.x -= 1.0;"," }"," }"," else if (band.colorSpace == 3)"," {"," if (hsvaStart.x < hsvaEnd.x)"," {"," hsvaStart.x += 1.0;"," }"," }"," vec4 hsvaMix = mix(hsvaStart, hsvaEnd, progress);"," hsvaMix.x = mod(hsvaMix.x, 1.0);"," return hsvaToRgba(hsvaMix);","}","vec4 getRampAt(float progress)","{"," Band band = getBand(progress);"," float bandProgress = (progress - band.start) / (band.end - band.start);"," float gamma = log(0.5) / log(band.middle);"," bandProgress = pow(bandProgress, gamma);"," bandProgress = interpolate(bandProgress, band.interpolation);"," if (uDither)"," {"," bandProgress = ditherIGN(bandProgress);"," }"," return mixBandColor(bandProgress, band);","}"].join("\n")},72823(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(fragmentDefine)","varying vec2 outTexCoord;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec4 fragColor = vec4(outTexCoord.xyx, 1.0);"," #pragma phaserTemplate(fragmentProcess)"," gl_FragColor = fragColor;","}"].join("\n")},65884(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(vertexDefine)","uniform mat4 uProjectionMatrix;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","varying vec2 outTexCoord;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(vertexHeader)","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);"," outTexCoord = inTexCoord;"," #pragma phaserTemplate(vertexProcess)","}"].join("\n")},2807(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","varying vec2 outFragCoord;","varying vec2 outTexCoord;","void main ()","{"," outFragCoord = inPosition.xy * 0.5 + 0.5;"," outTexCoord = inTexCoord;"," gl_Position = vec4(inPosition, 0, 1);","}"].join("\n")},49119(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(fragmentDefine)","uniform vec2 uResolution;","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," #pragma phaserTemplate(fragmentProcess)"," gl_FragColor = fragColor;","}"].join("\n")},3524(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#define ROUND_BIAS 0.5001","#pragma phaserTemplate(vertexDefine)","uniform mat4 uProjectionMatrix;","uniform mat3 uViewMatrix;","uniform vec3 uCameraScrollAndAlpha;","uniform int uRoundPixels;","uniform vec2 uResolution;","uniform float uTime;","uniform vec2 uDiffuseResolution;","uniform vec2 uFrameDataResolution;","uniform sampler2D uFrameDataTexture;","uniform float uGravity;","attribute float inVertex;","attribute vec4 inPositionX;","attribute vec4 inPositionY;","attribute vec4 inRotation;","attribute vec4 inScaleX;","attribute vec4 inScaleY;","attribute vec4 inAlpha;","attribute vec4 inFrame;","attribute vec4 inTintBlend;","attribute vec4 inTintTL;","attribute vec4 inTintTR;","attribute vec4 inTintBL;","attribute vec4 inTintBR;","attribute vec4 inOriginAndTintModeAndCreationTime;","attribute vec2 inScrollFactor;","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(vertexHeader)","const float PI = 3.14159265359;","const float HALF_PI = PI / 2.0;","const float BOUNCE_OVERSHOOT = 1.70158;","const float BOUNCE_OVERSHOOT_PLUS = BOUNCE_OVERSHOOT + 1.0;","const float BOUNCE_OVERSHOOT_IN_OUT = BOUNCE_OVERSHOOT * 1.525;","const float BOUNCE_OVERSHOOT_IN_OUT_PLUS = BOUNCE_OVERSHOOT_IN_OUT + 1.0;","float animate (vec4 anim)","{"," float value = anim.x;"," float a = anim.y;"," float b = abs(anim.z);"," float c = abs(anim.w);"," bool yoyo = anim.z < 0.0;"," bool loop = anim.w > 0.0;"," int type = int(floor(c));"," if (type == 0|| b == 0.0)"," {"," return value;"," }"," float duration = b;"," float delay = mod(c, 1.0) * 2.0;"," float rawTime = ((uTime - inOriginAndTintModeAndCreationTime.w) / duration) - delay;"," float time = mod(rawTime, 1.0);"," if (yoyo && (mod(rawTime, 2.0) >= 1.0))"," {"," time = 1.0 - time;"," }"," float repeats = loop ? 0.0 : floor(a);"," float timeContinuous = loop ? time : rawTime;"," #ifdef FEATURE_LINEAR"," if (type == 1)"," {"," return value + a * timeContinuous;"," }"," #endif"," #ifdef FEATURE_GRAVITY"," if (type == 2)"," {"," float v = floor(a);"," float gravityFactor = (a - v) * 2.0 - 1.0;"," if (gravityFactor == 0.0)"," {"," gravityFactor = 1.0;"," }"," float seconds = timeContinuous * duration / 1000.0;"," float accel = uGravity * gravityFactor;"," return value + (v * seconds) + (0.5 * accel * seconds * seconds);"," }"," #endif"," #ifdef FEATURE_QUAD_EASEOUT"," if (type == 10)"," {"," return value + a * time * (2.0 - time)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUAD_EASEIN"," if (type == 11)"," {"," return value + a * time * time"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUAD_EASEINOUT"," if (type == 12)"," {"," time *= 2.0;"," if (time < 1.0)"," {"," return value + a * time * time * 0.5"," + repeats * a;"," }"," time -= 1.0;"," return value + a * -0.5 * (time * (time - 2.0) - 1.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_CUBIC_EASEOUT"," if (type == 20)"," {"," time -= 1.0;"," return value + a * (time * time * time + 1.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_CUBIC_EASEIN"," if (type == 21)"," {"," return value + a * time * time * time"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_CUBIC_EASEINOUT"," if (type == 22)"," {"," time *= 2.0;"," if (time < 1.0)"," {"," return value + a * time * time * time * 0.5"," + repeats * a;"," }"," time -= 2.0;"," return value + a * 0.5 * (time * time * time + 2.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUART_EASEOUT"," if (type == 30)"," {"," time -= 1.0;"," return value + a * (1.0 - time * time * time * time)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUART_EASEIN"," if (type == 31)"," {"," return value + a * time * time * time * time"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUART_EASEINOUT"," if (type == 32)"," {"," time *= 2.0;"," if (time < 1.0)"," {"," return value + a * time * time * time * time * 0.5"," + repeats * a;"," }"," time -= 2.0;"," return value + a * -0.5 * (time * time * time * time - 2.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUINT_EASEOUT"," if (type == 40)"," {"," time -= 1.0;"," return value + a * (time * time * time * time * time + 1.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUINT_EASEIN"," if (type == 41)"," {"," return value + a * time * time * time * time * time"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUINT_EASEINOUT"," if (type == 42)"," {"," time *= 2.0;"," if (time < 1.0)"," {"," return value + a * time * time * time * time * time * 0.5"," + repeats * a;"," }"," time -= 2.0;"," return value + a * 0.5 * (time * time * time * time * time + 2.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_SINE_EASEOUT"," if (type == 50)"," {"," return value + a * sin(time * HALF_PI)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_SINE_EASEIN"," if (type == 51)"," {"," return value + a * (1.0 - cos(time * HALF_PI))"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_SINE_EASEINOUT"," if (type == 52)"," {"," return value + a * 0.5 * (1.0 - cos(PI * time))"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_EXPO_EASEOUT"," if (type == 60)"," {"," return value + a * (1.0 - pow(2.0, -10.0 * time))"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_EXPO_EASEIN"," if (type == 61)"," {"," return value + a * pow(2.0, 10.0 * (time - 1.0) - 0.001)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_EXPO_EASEINOUT"," if (type == 62)"," {"," time *= 2.0;"," if (time < 1.0)"," {"," return value + a * 0.5 * pow(2.0, 10.0 * (time - 1.0))"," + repeats * a;"," }"," time -= 1.0;"," return value + a * 0.5 * (2.0 - pow(2.0, -10.0 * (time - 1.0)))"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_CIRC_EASEOUT"," if (type == 70)"," {"," time -= 1.0;"," return value + a * sqrt(1.0 - time * time)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_CIRC_EASEIN"," if (type == 71)"," {"," return value + a * (1.0 - sqrt(1.0 - time * time))"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_CIRC_EASEINOUT"," if (type == 72)"," {"," time *= 2.0;"," if (time < 1.0)"," {"," return value + a * -0.5 * (sqrt(1.0 - time * time) - 1.0)"," + repeats * a;"," }"," time -= 2.0;"," return value + a * 0.5 * (sqrt(1.0 - time * time) + 1.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_BACK_EASEOUT"," if (type == 90)"," {"," time -= 1.0;"," return value + a * (time * time * (BOUNCE_OVERSHOOT_PLUS * time + BOUNCE_OVERSHOOT) + 1.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_BACK_EASEIN"," if (type == 91)"," {"," return value + a * time * time * (BOUNCE_OVERSHOOT_PLUS * time - BOUNCE_OVERSHOOT)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_BACK_EASEINOUT"," if (type == 92)"," {"," time *= 2.0;"," if (time < 1.0)"," {"," return value + a * 0.5 * (time * time * (BOUNCE_OVERSHOOT_IN_OUT_PLUS * time - BOUNCE_OVERSHOOT_IN_OUT))"," + repeats * a;"," }"," time -= 2.0;"," return value + a * 0.5 * (time * time * (BOUNCE_OVERSHOOT_IN_OUT_PLUS * time + BOUNCE_OVERSHOOT_IN_OUT) + 2.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_BOUNCE_EASEOUT"," if (type == 100)"," {"," if (time < 1.0 / 2.75)"," {"," return value + a * (7.5625 * time * time)"," + repeats * a;"," }"," else if (time < 2.0 / 2.75)"," {"," time -= 1.5 / 2.75;"," return value + a * (7.5625 * time * time + 0.75)"," + repeats * a;"," }"," else if (time < 2.5 / 2.75)"," {"," time -= 2.25 / 2.75;"," return value + a * (7.5625 * time * time + 0.9375)"," + repeats * a;"," }"," else"," {"," time -= 2.625 / 2.75;"," return value + a * (7.5625 * time * time + 0.984375)"," + repeats * a;"," }"," }"," #endif"," #ifdef FEATURE_BOUNCE_EASEIN"," if (type == 101)"," {"," time = 1.0 - time;"," if (time < 1.0 / 2.75)"," {"," return value + a * (1.0 - 7.5625 * time * time)"," + repeats * a;"," }"," else if (time < 2.0 / 2.75)"," {"," time -= 1.5 / 2.75;"," return value + a * (1.0 - (7.5625 * time * time + 0.75))"," + repeats * a;"," }"," else if (time < 2.5 / 2.75)"," {"," time -= 2.25 / 2.75;"," return value + a * (1.0 - (7.5625 * time * time + 0.9375))"," + repeats * a;"," }"," else"," {"," time -= 2.625 / 2.75;"," return value + a * (1.0 - (7.5625 * time * time + 0.984375))"," + repeats * a;"," }"," }"," #endif"," #ifdef FEATURE_BOUNCE_EASEINOUT"," if (type == 102)"," {"," bool reverse = false;"," if (time < 0.5)"," {"," time = 1.0 - time * 2.0;"," reverse = true;"," }"," if (time < 1.0 / 2.75)"," {"," time = 7.5625 * time * time;"," }"," else if (time < 2.0 / 2.75)"," {"," time -= 1.5 / 2.75;"," time = 7.5625 * time * time + 0.75;"," }"," else if (time < 2.5 / 2.75)"," {"," time -= 2.25 / 2.75;"," time = 7.5625 * time * time + 0.9375;"," }"," else"," {"," time -= 2.625 / 2.75;"," time = 7.5625 * time * time + 0.984375;"," }"," if (reverse)"," {"," return value + a * (1.0 - time) * 0.5"," + repeats * a;"," }"," return value + a * time * 0.5 + 0.5"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_STEPPED"," if (type == 110)"," {"," return value + a * floor(time + 0.5)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_SMOOTHSTEP_EASEOUT"," if (type == 120)"," {"," return value + a * (smoothstep(0.0, 1.0, time / 2.0 + 0.5) * 2.0 - 1.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_SMOOTHSTEP_EASEIN"," if (type == 121)"," {"," return value + a * smoothstep(0.0, 1.0, time / 2.0) * 2.0"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_SMOOTHSTEP_EASEINOUT"," if (type == 122)"," {"," return value + a * smoothstep(0.0, 1.0, time)"," + repeats * a;"," }"," #endif"," return value;","}","struct Frame {"," vec2 position;"," vec2 size;"," vec2 offset;","};","Frame getFrame (float frame)","{"," float index1 = floor(frame) * 3.0;"," float index2 = index1 + 1.0;"," float index3 = index1 + 2.0;"," float width = uFrameDataResolution.x;"," float x = mod(index1, width);"," float y = floor(index1 / width);"," vec4 texelUV = texture2D("," uFrameDataTexture,"," vec2(x + 0.5, y + 0.5) / uFrameDataResolution"," );"," x = mod(index2, width);"," y = floor(index2 / width);"," vec4 texelWH = texture2D("," uFrameDataTexture,"," vec2(x + 0.5, y + 0.5) / uFrameDataResolution"," );"," x = mod(index3, width);"," y = floor(index3 / width);"," vec4 texelOrigin = texture2D("," uFrameDataTexture,"," vec2(x + 0.5, y + 0.5) / uFrameDataResolution"," );"," return Frame("," vec2("," texelUV.r + texelUV.g * 256.0,"," texelUV.b + texelUV.a * 256.0"," ) * 255.0,"," vec2("," texelWH.r + texelWH.g * 256.0,"," texelWH.b + texelWH.a * 256.0"," ) * 255.0,"," vec2("," texelOrigin.r + texelOrigin.g * 256.0,"," texelOrigin.b + texelOrigin.a * 256.0"," ) * 255.0 - 32768.0"," );","}","void main ()","{"," float positionX = animate(inPositionX);"," float positionY = animate(inPositionY);"," float rotation = animate(inRotation);"," float scaleX = animate(inScaleX);"," float scaleY = animate(inScaleY);"," float frame = animate(inFrame);"," float tintBlend = animate(inTintBlend);"," float alpha = animate(inAlpha);"," vec2 origin = inOriginAndTintModeAndCreationTime.xy;"," float tintMode = inOriginAndTintModeAndCreationTime.z;"," float scrollFactorX = inScrollFactor.x;"," float scrollFactorY = inScrollFactor.y;"," Frame frameData = getFrame(frame);"," vec2 uv = frameData.position / uDiffuseResolution;"," vec2 wh = frameData.size / uDiffuseResolution;"," float u = uv.s;"," float v = uv.t;"," float w = wh.s;"," float h = wh.t;"," float width = frameData.size.s;"," float height = frameData.size.t;"," vec4 tint = inTintTL;"," float x = -origin.x;"," float y = -origin.y;"," if (inVertex == 0.0)"," {"," y = 1.0 - origin.y;"," v += h;"," tint = inTintBL;"," }"," else if (inVertex == 2.0)"," {"," x = 1.0 - origin.x;"," y = 1.0 - origin.y;"," u += w;"," v += h;"," tint = inTintBR;"," }"," else if (inVertex == 3.0)"," {"," x = 1.0 - origin.x;"," u += w;"," tint = inTintTR;"," }"," vec3 position = vec3("," (x * width - frameData.offset.x) * scaleX,"," (y * height - frameData.offset.y) * scaleY,"," 1.0"," );"," mat3 viewMatrix = uViewMatrix * mat3("," 1.0, 0.0, 0.0,"," 0.0, 1.0, 0.0,"," uCameraScrollAndAlpha.x * (1.0 - scrollFactorX), uCameraScrollAndAlpha.y * (1.0 - scrollFactorY), 1.0"," );"," float sine = sin(rotation);"," float cosine = cos(rotation);"," mat3 transformMatrix = mat3("," cosine, sine, 0.0,"," -sine, cosine, 0.0,"," positionX, positionY, 1.0"," );"," position = viewMatrix * transformMatrix * position;"," alpha *= uCameraScrollAndAlpha.z;"," tint.a *= alpha;"," if (uRoundPixels == 1 && rotation == 0.0 && scaleX == 1.0 && scaleY == 1.0)"," {"," position.xy = floor(position.xy + ROUND_BIAS);"," }"," gl_Position = uProjectionMatrix * vec4(position.xy, 1.0, 1.0);"," outTexCoord = vec2(u, 1.0 - v);"," outTint = mix(vec4(1.0, 1.0, 1.0, tint.a), tint, tintBlend);"," outTintEffect = tintMode;"," #pragma phaserTemplate(vertexProcess)","}"].join("\n")},57532(t){t.exports=["#version 100","#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","/* Redefine MAX_ANIM_FRAMES to support animations with different frame numbers. */","#define MAX_ANIM_FRAMES 0","#pragma phaserTemplate(fragmentDefine)","uniform vec2 uResolution;","uniform sampler2D uMainSampler;","uniform sampler2D uLayerSampler;","uniform vec2 uMainResolution;","uniform vec2 uLayerResolution;","uniform float uTileColumns;","uniform vec4 uTileWidthHeightMarginSpacing;","uniform float uAlpha;","uniform float uTime;","#if MAX_ANIM_FRAMES > 0","uniform sampler2D uAnimSampler;","uniform vec2 uAnimResolution;","#endif","varying vec2 outTexCoord;","varying vec2 outTileStride;","#pragma phaserTemplate(outVariables)","vec2 getTexRes ()","{"," return uMainResolution;","}","float floatTexel (vec4 texel)","{"," return texel.r * 255.0 + (texel.g * 255.0 * 256.0) + (texel.b * 255.0 * 256.0 * 256.0) + (texel.a * 255.0 * 256.0 * 256.0 * 256.0);","}","struct Tile","{"," float index;"," vec2 uv; // In texels."," #if MAX_ANIM_FRAMES > 0"," bool animated;"," #endif"," bool empty;","};","Tile getLayerData (vec2 coord)","{"," vec2 texelCoord = coord * uLayerResolution;"," vec2 tile = floor(texelCoord);"," vec2 uv = fract(texelCoord);"," uv.y = 1.0 - uv.y;"," vec4 texel = texture2D(uLayerSampler, (tile + 0.5) / uLayerResolution) * 255.0;"," float flags = texel.a;"," /* Check for empty tile flag in bit 28. */"," if (flags == 16.0)"," {"," return Tile("," 0.0,"," vec2(0.0),"," #if MAX_ANIM_FRAMES > 0"," false,"," #endif"," true"," );"," }"," /* Bit 31 is flipX. */"," bool flipX = flags > 127.0;"," /* Bit 30 is flipY. */"," bool flipY = mod(flags, 128.0) > 63.0;"," #if MAX_ANIM_FRAMES > 0"," /* Bit 29 is animation. */"," bool animated = mod(flags, 64.0) > 31.0;"," #endif"," if (flipX)"," {"," uv.x = 1.0 - uv.x;"," }"," if (flipY)"," {"," uv.y = 1.0 - uv.y;"," }"," float index = texel.r + (texel.g * 256.0) + (texel.b * 256.0 * 256.0);"," return Tile("," index,"," uv * uTileWidthHeightMarginSpacing.xy,"," #if MAX_ANIM_FRAMES > 0"," animated,"," #endif"," false"," );","}","vec2 getFrameCorner (float index)","{"," float x = mod(index, uTileColumns);"," float y = floor(index / uTileColumns);"," vec2 xy = vec2(x, y);"," return xy * outTileStride + uTileWidthHeightMarginSpacing.zz;","}","#if MAX_ANIM_FRAMES > 0","float animationIndex (float index)","{"," float animTextureWidth = uAnimResolution.x;"," vec2 index2D = vec2(mod(index, animTextureWidth), floor(index / animTextureWidth));"," vec4 animDurationTexel = texture2D(uAnimSampler, (index2D + 0.5) / uAnimResolution);"," index2D = vec2(mod(index + 1.0, animTextureWidth), floor((index + 1.0) / animTextureWidth));"," vec4 animIndexTexel = texture2D(uAnimSampler, (index2D + 0.5) / uAnimResolution);"," float animDuration = floatTexel(animDurationTexel);"," float animIndex = floatTexel(animIndexTexel);"," float animTime = mod(uTime, animDuration);"," float animTimeAccum = 0.0;"," for (int i = 0; i < MAX_ANIM_FRAMES; i++)"," {"," index2D = vec2(mod(animIndex, animTextureWidth), floor(animIndex / animTextureWidth));"," animDurationTexel = texture2D(uAnimSampler, (index2D + 0.5) / uAnimResolution);"," float frameDuration = floatTexel(animDurationTexel);"," animTimeAccum += frameDuration;"," if (animTime <= animTimeAccum)"," {"," break;"," }"," animIndex += 2.0;"," }"," animIndex += 1.0;"," index2D = vec2(mod(animIndex, animTextureWidth), floor(animIndex / animTextureWidth));"," animIndexTexel = texture2D(uAnimSampler, (index2D + 0.5) / uAnimResolution);"," float animFrameIndex = floatTexel(animIndexTexel);"," return animFrameIndex;","}","#endif","vec2 getTileTexelCoord (Tile tile)","{"," if (tile.empty)"," {"," return vec2(0.0);"," }"," float index = tile.index;"," #if MAX_ANIM_FRAMES > 0"," if (tile.animated)"," {"," index = animationIndex(index);"," }"," #endif"," vec2 frameCorner = getFrameCorner(index);"," return frameCorner + tile.uv;","}","#pragma phaserTemplate(fragmentHeader)","struct Samples {"," vec4 color;"," #pragma phaserTemplate(defineSamples)","};","Samples getColorSamples (vec2 texCoord)","{"," Samples samples;"," samples.color = texture2D("," uMainSampler,"," vec2(texCoord.x, 1.0 - texCoord.y)"," );"," #pragma phaserTemplate(getSamples)"," return samples;","}","Samples mixSamples (Samples samples1, Samples samples2, float alpha)","{"," Samples samples;"," samples.color = mix(samples1.color, samples2.color, alpha);"," #pragma phaserTemplate(mixSamples)"," return samples;","}","Samples getFinalSamples (Tile tile, vec2 layerTexCoord)","{"," vec2 texelCoord = getTileTexelCoord(tile);"," vec2 texCoord = texelCoord / uMainResolution;"," #pragma phaserTemplate(texCoord)"," #ifndef FEATURE_BORDERFILTER"," return getColorSamples(texCoord);"," #else"," #pragma phaserTemplate(finalSamples)"," vec2 wh = uTileWidthHeightMarginSpacing.xy;"," vec2 frameCorner = getFrameCorner(tile.index);"," vec2 frameCornerOpposite = frameCorner + wh;"," vec2 texCoordClamped = clamp(texCoord, (frameCorner + 0.5) / uMainResolution, (frameCornerOpposite - 0.5) / uMainResolution);"," vec2 dTexelCoord = (texCoord - texCoordClamped) * uMainResolution;"," dTexelCoord.y = -dTexelCoord.y;"," vec2 offsets = sign(dTexelCoord);"," Samples samples0 = getColorSamples(texCoordClamped);"," if (offsets.x == 0.0)"," {"," if (offsets.y == 0.0)"," {"," return samples0;"," }"," Tile tileY = getLayerData(layerTexCoord + (offsets - dTexelCoord) / wh / uLayerResolution);"," vec2 texelCoordY = getTileTexelCoord(tileY);"," vec2 texCoordY = texelCoordY / uMainResolution;"," Samples samplesY = getColorSamples(texCoordY);"," return mixSamples(samples0, samplesY, abs(dTexelCoord.y));"," }"," else"," {"," if (offsets.y == 0.0)"," {"," Tile tileX = getLayerData(layerTexCoord + (offsets - dTexelCoord) / wh / uLayerResolution);"," vec2 texelCoordX = getTileTexelCoord(tileX);"," vec2 texCoordX = texelCoordX / uMainResolution;"," Samples samplesX = getColorSamples(texCoordX);"," return mixSamples(samples0, samplesX, abs(dTexelCoord.x));"," }"," Tile tileX = getLayerData(layerTexCoord + (offsets * vec2(1.0, 0.0) - dTexelCoord) / wh / uLayerResolution);"," vec2 texelCoordX = getTileTexelCoord(tileX);"," vec2 texCoordX = texelCoordX / uMainResolution;"," Samples samplesX = getColorSamples(texCoordX);"," Tile tileY = getLayerData(layerTexCoord + (offsets * vec2(0.0, 1.0) - dTexelCoord) / wh / uLayerResolution);"," vec2 texelCoordY = getTileTexelCoord(tileY);"," vec2 texCoordY = texelCoordY / uMainResolution;"," Samples samplesY = getColorSamples(texCoordY);"," Tile tileXY = getLayerData(layerTexCoord + (offsets - dTexelCoord) / wh / uLayerResolution);"," vec2 texelCoordXY = getTileTexelCoord(tileXY);"," vec2 texCoordXY = texelCoordXY / uMainResolution;"," Samples samplesXY = getColorSamples(texCoordXY);"," Samples samples1 = mixSamples(samples0, samplesX, abs(dTexelCoord.x));"," Samples samples2 = mixSamples(samplesY, samplesXY, abs(dTexelCoord.x));"," return mixSamples(samples1, samples2, abs(dTexelCoord.y));"," }"," #endif","}","void main ()","{"," vec2 layerTexCoord = outTexCoord;"," Tile tile = getLayerData(layerTexCoord);"," Samples samples = getFinalSamples(tile, layerTexCoord);"," vec4 fragColor = samples.color;"," #pragma phaserTemplate(declareSamples)"," #pragma phaserTemplate(fragmentProcess)"," fragColor *= uAlpha;"," gl_FragColor = fragColor;","}"].join("\n")},23879(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(vertexDefine)","uniform mat4 uProjectionMatrix;","uniform vec2 uResolution;","uniform vec4 uTileWidthHeightMarginSpacing;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","varying vec2 outTexCoord;","varying vec2 outTileStride;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(vertexHeader)","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);"," outTexCoord = inTexCoord;"," outTileStride = uTileWidthHeightMarginSpacing.xy + uTileWidthHeightMarginSpacing.zz;"," #pragma phaserTemplate(vertexProcess)","}"].join("\n")},84639(t){t.exports=function(t,e){return{name:t+"Anims",additions:{fragmentDefine:"#undef MAX_ANIM_FRAMES\n#define MAX_ANIM_FRAMES "+t},tags:["MAXANIMS"],disable:!!e}}},81084(t,e,i){var r=i(84547);t.exports=function(t){return{name:"ApplyLighting",additions:{fragmentHeader:r,fragmentProcess:"fragColor = applyLighting(fragColor, normal);"},tags:["LIGHTING"],disable:!!t}}},44349(t,e,i){var r=i(11104);t.exports=function(t){return{name:"Tint",additions:{fragmentHeader:r,fragmentProcess:"fragColor = applyTint(fragColor);"},tags:["TINT"],disable:!!t}}},99501(t,e,i){var r=i(81556);t.exports=function(t){return{name:"BoundedSampler",additions:{fragmentHeader:r},disable:!!t}}},6184(t,e,i){var r=i(11719);t.exports=function(t){return{name:"DefineLights",additions:{fragmentDefine:"#define LIGHT_COUNT 1",fragmentHeader:r},tags:["LIGHTING"],disable:!!t}}},11653(t){t.exports=function(t,e){return{name:t+"TexCount",additions:{fragmentDefine:"#define TEXTURE_COUNT "+t},tags:["TexCount"],disable:!!e}}},13198(t){t.exports=function(t){return{name:"FlatNormal",additions:{fragmentProcess:"vec3 normal = vec3(0.0, 0.0, 1.0);"},tags:["LIGHTING"],disable:!!t}}},40829(t,e,i){var r=i(84220);t.exports=function(t){return{name:"NormalMap",additions:{fragmentHeader:r,fragmentProcess:"vec3 normal = getNormalFromMap(texCoord);"},tags:["LIGHTING"],disable:!!t}}},42792(t){t.exports=function(t){return{name:"TexCoordOut",additions:{fragmentProcess:"vec2 texCoord = outTexCoord;\n#pragma phaserTemplate(texCoord)"},tags:["TEXCOORD"],disable:!!t}}},96049(t,e,i){var r=i(2860);t.exports=function(t){return{name:"GetTexRes",additions:{fragmentHeader:r},tags:["TEXRES"],disable:!!t}}},33997(t,e,i){var r=i(46432);t.exports=function(t,e){void 0===t&&(t=1);for(var i="",s=1;s1&&(d=u.baseType===i.FLOAT?new Float32Array(c):new Int32Array(c)),this.glUniforms.set(l.name,{location:i.getUniformLocation(t,l.name),size:l.size,type:l.type,value:d})}},setUniform:function(t,e){this.uniformRequests.set(t,e)},bind:function(){this.renderer.glWrapper.updateBindingsProgram(this.glState),this.uniformRequests.each(this._processUniformRequest.bind(this)),this.uniformRequests.clear()},_processUniformRequest:function(t,e){var i=this.renderer,r=i.gl,n=this.glUniforms.get(t);if(n){var a=n.value;if(a.length){for(var o=!1,h=0;h1)c.setV.call(r,l,a);else switch(c.size){case 1:c.set.call(r,l,e);break;case 2:c.set.call(r,l,e[0],e[1]);break;case 3:c.set.call(r,l,e[0],e[1],e[2]);break;case 4:c.set.call(r,l,e[0],e[1],e[2],e[3])}}},destroy:function(){if(this.webGLProgram){var t=this.renderer.gl;if(!t.isContextLost()){this._vertexShader&&t.deleteShader(this._vertexShader),this._fragmentShader&&t.deleteShader(this._fragmentShader),t.deleteProgram(this.webGLProgram);for(var e=0;e=0;i--)this.units[i]=void 0,this.renderer.glWrapper.updateBindingsActiveTexture({bindings:{activeTexture:i}}),t.bindTexture(t.TEXTURE_2D,e),this.unitIndices[i]=i;t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array([0,0,255,255]))},bind:function(t,e,i,r){var s=this.units[e]!==t;if((i||!1!==r||s)&&this.renderer.glWrapper.updateBindingsActiveTexture({bindings:{activeTexture:e}},i),s||i){this.units[e]=t;var n=t?t.webGLTexture:null,a=this.renderer.gl;a.bindTexture(a.TEXTURE_2D,n),t&&t.needsMipmapRegeneration&&t.generateMipmap()}},bindUnits:function(t,e){for(var i=Math.min(t.length,this.renderer.maxTextures)-1;i>=0;i--)void 0!==t[i]&&this.bind(t[i],i,e,!1)},unbindTexture:function(t){for(var e=this.units.length-1;e>=0;e--)this.units[e]===t&&this.bind(null,e,!0,!1)},unbindAllUnits:function(){for(var t=this.units.length-1;t>=0;t--)this.bind(null,t,!0,!1)}});t.exports=r},82751(t,e,i){var r=i(83419),s=i(50030),n=new r({initialize:function(t,e,i,r,s,n,a,o,h,l,u,d,c){void 0===c&&(c=!0),this.renderer=t,this.webGLTexture=null,this.isRenderTexture=!1,this.mipLevel=e,this.minFilter=i,this.magFilter=r,this.wrapT=s,this.wrapS=n,this.format=a,this.pixels=o,this.width=h,this.height=l,this.pma=null==u||u,this.forceSize=!!d,this.flipY=!!c,this.__SPECTOR_Metadata={},this.batchUnit=-1,this.needsMipmapRegeneration=!1,this.createResource()},createResource:function(){var t=this.renderer.gl;if(!t.isContextLost())if(this.pixels instanceof n)this.webGLTexture=this.pixels.webGLTexture;else{var e=t.createTexture();e.__SPECTOR_Metadata=this.__SPECTOR_Metadata,this.webGLTexture=e,this._processTexture()}},resize:function(t,e){if(this.width!==t||this.height!==e){this.width=t,this.height=e;var i=this.renderer,r=i.gl,n=s(t,e);n?(this.wrapS=r.REPEAT,this.wrapT=r.REPEAT):(this.wrapS=r.CLAMP_TO_EDGE,this.wrapT=r.CLAMP_TO_EDGE),n&&i.mipmapFilter&&(!this.isRenderTexture||i.config.mipmapRegeneration)?this.minFilter=i.mipmapFilter:i.config.antialias?this.minFilter=r.LINEAR:this.minFilter=r.NEAREST,this._processTexture()}},update:function(t,e,i,r,s,n,a,o,h){0!==e&&0!==i&&(this.pixels=t,this.width=e,this.height=i,this.flipY=r,this.wrapS=s,this.wrapT=n,this.minFilter=a,this.magFilter=o,this.format=h,this._processTexture())},_processTexture:function(){var t=this.renderer.gl;this.renderer.glTextureUnits.bind(this,0),this.renderer.glWrapper.updateTexturing({texturing:{flipY:this.flipY,premultiplyAlpha:this.pma}}),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,this.minFilter),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,this.magFilter),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,this.wrapS),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,this.wrapT);var e=this.pixels,i=this.mipLevel,r=this.width,s=this.height,n=this.format;if(null==e)t.texImage2D(t.TEXTURE_2D,i,n,r,s,0,n,t.UNSIGNED_BYTE,null),this.generateMipmap();else if(e.compressed){r=e.width,s=e.height;for(var a=0;a0&&this.parentSize.height>0&&this.displaySize.setParent(this.parentSize),this.refresh()),t.events.on(h.PRE_STEP,this.step,this),t.events.once(h.READY,this.refresh,this),t.events.once(h.DESTROY,this.destroy,this),this.startListeners()},parseConfig:function(t){this.getParent(t),this.getParentBounds();var e=t.width,i=t.height,s=t.scaleMode,n=t.zoom,a=t.autoRound;if("string"==typeof e)if("%"!==e.substr(-1))e=parseInt(e,10);else{var o=this.parentSize.width;0===o&&(o=window.innerWidth);var h=parseInt(e,10)/100;e=Math.floor(o*h)}if("string"==typeof i)if("%"!==i.substr(-1))i=parseInt(i,10);else{var l=this.parentSize.height;0===l&&(l=window.innerHeight);var u=parseInt(i,10)/100;i=Math.floor(l*u)}this.scaleMode=s,this.autoRound=a,this.autoCenter=t.autoCenter,this.resizeInterval=t.resizeInterval,a&&(e=Math.floor(e),i=Math.floor(i)),this.gameSize.setSize(e,i),n===r.ZOOM.MAX_ZOOM&&(n=this.getMaxZoom()),this.zoom=n,1!==n&&(this._resetZoom=!0),this.baseSize.setSize(e,i),a&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),t.minWidth>0&&this.displaySize.setMin(t.minWidth*n,t.minHeight*n),t.maxWidth>0&&this.displaySize.setMax(t.maxWidth*n,t.maxHeight*n),this.displaySize.setSize(e,i),(t.snapWidth>0||t.snapHeight>0)&&this.displaySize.setSnap(t.snapWidth,t.snapHeight),this.orientation=d(e,i)},getParent:function(t){var e=t.parent;if(null!==e){if(this.parent=u(e),this.parentIsWindow=this.parent===document.body,t.expandParent&&t.scaleMode!==r.SCALE_MODE.NONE){var i=this.parent.getBoundingClientRect();(this.parentIsWindow||0===i.height)&&(document.documentElement.style.height="100%",document.body.style.height="100%",i=this.parent.getBoundingClientRect(),this.parentIsWindow||0!==i.height||(this.parent.style.overflow="hidden",this.parent.style.width="100%",this.parent.style.height="100%"))}t.fullscreenTarget&&!this.fullscreenTarget&&(this.fullscreenTarget=u(t.fullscreenTarget))}},getParentBounds:function(){if(!this.parent)return!1;var t=this.parentSize,e=this.parent.getBoundingClientRect();this.parentIsWindow&&this.game.device.os.iOS&&(e.height=l(!0));var i=e.width,r=e.height;if(t.width!==i||t.height!==r)return t.setSize(i,r),!0;if(this.canvas){var s=this.canvasBounds,n=this.canvas.getBoundingClientRect();if(n.x!==s.x||n.y!==s.y)return!0}return!1},lockOrientation:function(t){var e=screen.lockOrientation||screen.mozLockOrientation||screen.msLockOrientation;return!!e&&e.call(screen,t)},setParentSize:function(t,e){return this.parentSize.setSize(t,e),this.refresh()},setGameSize:function(t,e){var i=this.autoRound;i&&(t=Math.floor(t),e=Math.floor(e));var r=this.width,s=this.height;return this.gameSize.resize(t,e),this.baseSize.resize(t,e),i&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setAspectRatio(t/e),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height,this.refresh(r,s)},resize:function(t,e){var i=this.zoom,r=this.autoRound;r&&(t=Math.floor(t),e=Math.floor(e));var s=this.width,n=this.height;this.gameSize.resize(t,e),this.baseSize.resize(t,e),r&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setSize(t*i,e*i),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height;var a=this.canvas.style,o=t*i,h=e*i;return r&&(o=Math.floor(o),h=Math.floor(h)),o===t&&h===e||(a.width=o+"px",a.height=h+"px"),this.refresh(s,n)},setZoom:function(t){return this.zoom=t,this._resetZoom=!0,this.refresh()},setMaxZoom:function(){return this.zoom=this.getMaxZoom(),this._resetZoom=!0,this.refresh()},setSnap:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.displaySize.setSnap(t,e),this.refresh()},refresh:function(t,e){void 0===t&&(t=this.width),void 0===e&&(e=this.height),this.updateScale(),this.updateBounds(),this.updateOrientation(),this.displayScale.set(this.baseSize.width/this.canvasBounds.width,this.baseSize.height/this.canvasBounds.height);var i=this.game.domContainer;if(i){this.baseSize.setCSS(i);var r=this.canvas.style,s=i.style;s.transform="scale("+this.displaySize.width/this.baseSize.width+","+this.displaySize.height/this.baseSize.height+")",s.marginLeft=r.marginLeft,s.marginTop=r.marginTop}return this.emit(o.RESIZE,this.gameSize,this.baseSize,this.displaySize,t,e),this},updateOrientation:function(){if(this._checkOrientation){this._checkOrientation=!1;var t=d(this.width,this.height);t!==this.orientation&&(this.orientation=t,this.emit(o.ORIENTATION_CHANGE,t))}},updateScale:function(){var t,e,i=this.canvas.style,s=this.gameSize.width,a=this.gameSize.height,o=this.zoom,h=this.autoRound;if(this.scaleMode===r.SCALE_MODE.NONE)this.displaySize.setSize(s*o,a*o),t=this.displaySize.width,e=this.displaySize.height,h&&(t=Math.floor(t),e=Math.floor(e)),this._resetZoom&&(i.width=t+"px",i.height=e+"px",this._resetZoom=!1);else if(this.scaleMode===r.SCALE_MODE.RESIZE)this.displaySize.setSize(this.parentSize.width,this.parentSize.height),this.gameSize.setSize(this.displaySize.width,this.displaySize.height),this.baseSize.setSize(this.displaySize.width,this.displaySize.height),t=this.displaySize.width,e=this.displaySize.height,h&&(t=Math.floor(t),e=Math.floor(e)),this.canvas.width=t,this.canvas.height=e;else if(this.scaleMode===r.SCALE_MODE.EXPAND){var l,u,d=this.game.config.width,c=this.game.config.height,f=this.parentSize.width,p=this.parentSize.height,g=f/d,m=p/c;g=0?0:-a.x*o.x,l=a.y>=0?0:-a.y*o.y;return i=n.width>=a.width?s.width:s.width-(a.width-n.width)*o.x,r=n.height>=a.height?s.height:s.height-(a.height-n.height)*o.y,e.setTo(h,l,i,r),t&&(e.width/=t.zoomX,e.height/=t.zoomY,e.centerX=t.centerX+t.scrollX,e.centerY=t.centerY+t.scrollY),e},step:function(t,e){this.parent&&(this._lastCheck+=e,(this.dirty||this._lastCheck>this.resizeInterval)&&(this.getParentBounds()&&this.refresh(),this.dirty=!1,this._lastCheck=0))},stopListeners:function(){var t=this.domlisteners;screen.orientation&&screen.orientation.addEventListener?screen.orientation.removeEventListener("change",t.orientationChange,!1):window.removeEventListener("orientationchange",t.orientationChange,!1),window.removeEventListener("resize",t.windowResize,!1);["webkit","moz",""].forEach(function(e){document.removeEventListener(e+"fullscreenchange",t.fullScreenChange,!1),document.removeEventListener(e+"fullscreenerror",t.fullScreenError,!1)}),document.removeEventListener("MSFullscreenChange",t.fullScreenChange,!1),document.removeEventListener("MSFullscreenError",t.fullScreenError,!1)},destroy:function(){this.removeAllListeners(),this.stopListeners(),this.game=null,this.canvas=null,this.canvasBounds=null,this.parent=null,this.fullscreenTarget=null,this.parentSize.destroy(),this.gameSize.destroy(),this.baseSize.destroy(),this.displaySize.destroy()},isFullscreen:{get:function(){return this.fullscreen.active}},width:{get:function(){return this.gameSize.width}},height:{get:function(){return this.gameSize.height}},isPortrait:{get:function(){return this.orientation===r.ORIENTATION.PORTRAIT}},isLandscape:{get:function(){return this.orientation===r.ORIENTATION.LANDSCAPE}},isGamePortrait:{get:function(){return this.height>this.width}},isGameLandscape:{get:function(){return this.width>this.height}}});t.exports=y},64743(t){t.exports={NO_CENTER:0,CENTER_BOTH:1,CENTER_HORIZONTALLY:2,CENTER_VERTICALLY:3}},39218(t){t.exports={LANDSCAPE:"landscape-primary",LANDSCAPE_SECONDARY:"landscape-secondary",PORTRAIT:"portrait-primary",PORTRAIT_SECONDARY:"portrait-secondary"}},81050(t){t.exports={NONE:0,WIDTH_CONTROLS_HEIGHT:1,HEIGHT_CONTROLS_WIDTH:2,FIT:3,ENVELOP:4,RESIZE:5,EXPAND:6}},80805(t){t.exports={NO_ZOOM:1,ZOOM_2X:2,ZOOM_4X:4,MAX_ZOOM:-1}},13560(t,e,i){var r={CENTER:i(64743),ORIENTATION:i(39218),SCALE_MODE:i(81050),ZOOM:i(80805)};t.exports=r},56139(t){t.exports="enterfullscreen"},2336(t){t.exports="fullscreenfailed"},47412(t){t.exports="fullscreenunsupported"},51452(t){t.exports="leavefullscreen"},20666(t){t.exports="orientationchange"},47945(t){t.exports="resize"},97480(t,e,i){t.exports={ENTER_FULLSCREEN:i(56139),FULLSCREEN_FAILED:i(2336),FULLSCREEN_UNSUPPORTED:i(47412),LEAVE_FULLSCREEN:i(51452),ORIENTATION_CHANGE:i(20666),RESIZE:i(47945)}},93364(t,e,i){var r=i(79291),s=i(13560),n={Center:i(64743),Events:i(97480),Orientation:i(39218),ScaleManager:i(76531),ScaleModes:i(81050),Zoom:i(80805)};n=r(!1,n,s.CENTER),n=r(!1,n,s.ORIENTATION),n=r(!1,n,s.SCALE_MODE),n=r(!1,n,s.ZOOM),t.exports=n},27397(t,e,i){var r=i(95540),s=i(35355);t.exports=function(t){var e=t.game.config.defaultPhysicsSystem,i=r(t.settings,"physics",!1);if(e||i){var n=[];if(e&&n.push(s(e+"Physics")),i)for(var a in i)a=s(a.concat("Physics")),-1===n.indexOf(a)&&n.push(a);return n}}},52106(t,e,i){var r=i(95540);t.exports=function(t){var e=t.plugins.getDefaultScenePlugins(),i=r(t.settings,"plugins",!1);return Array.isArray(i)?i:e||[]}},87033(t){t.exports={game:"game",renderer:"renderer",anims:"anims",cache:"cache",plugins:"plugins",registry:"registry",scale:"scale",sound:"sound",textures:"textures",events:"events",cameras:"cameras",add:"add",make:"make",scenePlugin:"scene",displayList:"children",lights:"lights",data:"data",input:"input",load:"load",time:"time",tweens:"tweens",arcadePhysics:"physics",matterPhysics:"matter"}},97482(t,e,i){var r=i(83419),s=i(2368),n=new r({initialize:function(t){this.sys=new s(this,t),this.game,this.anims,this.cache,this.registry,this.sound,this.textures,this.events,this.cameras,this.add,this.make,this.scene,this.children,this.lights,this.data,this.input,this.load,this.time,this.tweens,this.physics,this.matter,this.scale,this.plugins,this.renderer},update:function(){}});t.exports=n},60903(t,e,i){var r=i(83419),s=i(89993),n=i(44594),a=i(8443),o=i(35154),h=i(54899),l=i(29747),u=i(97482),d=i(2368),c=new r({initialize:function(t,e){if(this.game=t,this.keys={},this.scenes=[],this._pending=[],this._start=[],this._queue=[],this._data={},this.isProcessing=!1,this.isBooted=!1,this.customViewports=0,this.systemScene,e){Array.isArray(e)||(e=[e]);for(var i=0;i-1&&(delete this.keys[r],this.scenes.splice(i,1),this._start.indexOf(r)>-1&&(i=this._start.indexOf(r),this._start.splice(i,1)),e.sys.destroy()),this},bootScene:function(t){var e,i=t.sys,r=i.settings;i.sceneUpdate=l,t.init&&(t.init.call(t,r.data),r.status=s.INIT,r.isTransition&&i.events.emit(n.TRANSITION_INIT,r.transitionFrom,r.transitionDuration)),i.load&&(e=i.load).reset(),e&&t.preload?(t.preload.call(t),r.status=s.LOADING,e.once(h.COMPLETE,this.loadComplete,this),e.start()):this.create(t)},loadComplete:function(t){this.create(t.scene)},payloadComplete:function(t){this.bootScene(t.scene)},update:function(t,e){this.processQueue(),this.isProcessing=!0;for(var i=this.scenes.length-1;i>=0;i--){var r=this.scenes[i].sys;r.settings.status>s.START&&r.settings.status<=s.RUNNING&&r.step(t,e),r.scenePlugin&&r.scenePlugin._target&&r.scenePlugin.step(t,e)}},render:function(t){for(var e=0;e=s.LOADING&&i.settings.status=s.START&&a<=s.CREATING)return this;if(a>=s.RUNNING&&a<=s.SLEEPING)n.shutdown(),n.sceneUpdate=l,n.start(e);else if(n.sceneUpdate=l,n.start(e),n.load&&(r=n.load),r&&n.settings.hasOwnProperty("pack")&&(r.reset(),r.addPack({payload:n.settings.pack})))return n.settings.status=s.LOADING,r.once(h.COMPLETE,this.payloadComplete,this),r.start(),this;return this.bootScene(i),this},stop:function(t,e){var i=this.getScene(t);if(i&&!i.sys.isTransitioning()&&i.sys.settings.status!==s.SHUTDOWN){var r=i.sys.load;r&&(r.off(h.COMPLETE,this.loadComplete,this),r.off(h.COMPLETE,this.payloadComplete,this)),i.sys.shutdown(e)}return this},switch:function(t,e,i){var r=this.getScene(t),s=this.getScene(e);return r&&s&&r!==s&&(this.sleep(t),this.isSleeping(e)?this.wake(e,i):this.start(e,i)),this},getAt:function(t){return this.scenes[t]},getIndex:function(t){var e=this.getScene(t);return this.scenes.indexOf(e)},bringToTop:function(t){if(this.isProcessing)return this.queueOp("bringToTop",t);var e=this.getIndex(t),i=this.scenes;if(-1!==e&&e0){var i=this.getScene(t);this.scenes.splice(e,1),this.scenes.unshift(i)}return this},moveDown:function(t){if(this.isProcessing)return this.queueOp("moveDown",t);var e=this.getIndex(t);if(e>0){var i=e-1,r=this.getScene(t),s=this.getAt(i);this.scenes[e]=s,this.scenes[i]=r}return this},moveUp:function(t){if(this.isProcessing)return this.queueOp("moveUp",t);var e=this.getIndex(t);if(ei),0,s)}return this},moveBelow:function(t,e){if(t===e)return this;if(this.isProcessing)return this.queueOp("moveBelow",t,e);var i=this.getIndex(t),r=this.getIndex(e);if(-1!==i&&-1!==r&&r>i){var s=this.getAt(r);this.scenes.splice(r,1),0===i?this.scenes.unshift(s):this.scenes.splice(i-(r=this._duration&&this.transitionComplete()},transitionComplete:function(){var t=this._target.sys,e=this._target.sys.settings;t.events.emit(n.TRANSITION_COMPLETE,this.scene),e.isTransition=!1,e.transitionFrom=null,this._duration=0,this._target=null,this._onUpdate=null,this._onUpdateScope=null,this._willRemove?this.manager.remove(this.key):this._willSleep?this.systems.sleep():this.manager.stop(this.key)},add:function(t,e,i,r){return this.manager.add(t,e,i,r)},launch:function(t,e){return t&&t!==this.key&&this.manager.queueOp("start",t,e),this},run:function(t,e){return t&&t!==this.key&&this.manager.queueOp("run",t,e),this},pause:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("pause",t,e),this},resume:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("resume",t,e),this},sleep:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("sleep",t,e),this},wake:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("wake",t,e),this},switch:function(t,e){return t!==this.key&&this.manager.queueOp("switch",this.key,t,e),this},stop:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("stop",t,e),this},setActive:function(t,e,i){void 0===e&&(e=this.key);var r=this.manager.getScene(e);return r&&r.sys.setActive(t,i),this},setVisible:function(t,e){void 0===e&&(e=this.key);var i=this.manager.getScene(e);return i&&i.sys.setVisible(t),this},isSleeping:function(t){return void 0===t&&(t=this.key),this.manager.isSleeping(t)},isActive:function(t){return void 0===t&&(t=this.key),this.manager.isActive(t)},isPaused:function(t){return void 0===t&&(t=this.key),this.manager.isPaused(t)},isVisible:function(t){return void 0===t&&(t=this.key),this.manager.isVisible(t)},swapPosition:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.swapPosition(t,e),this},moveAbove:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveAbove(t,e),this},moveBelow:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveBelow(t,e),this},remove:function(t){return void 0===t&&(t=this.key),this.manager.remove(t),this},moveUp:function(t){return void 0===t&&(t=this.key),this.manager.moveUp(t),this},moveDown:function(t){return void 0===t&&(t=this.key),this.manager.moveDown(t),this},bringToTop:function(t){return void 0===t&&(t=this.key),this.manager.bringToTop(t),this},sendToBack:function(t){return void 0===t&&(t=this.key),this.manager.sendToBack(t),this},get:function(t){return this.manager.getScene(t)},getStatus:function(t){var e=this.manager.getScene(t);if(e)return e.sys.getStatus()},getIndex:function(t){return void 0===t&&(t=this.key),this.manager.getIndex(t)},shutdown:function(){var t=this.systems.events;t.off(n.SHUTDOWN,this.shutdown,this),t.off(n.TRANSITION_OUT)},destroy:function(){this.shutdown(),this.scene.sys.events.off(n.START,this.start,this),this.scene=null,this.systems=null,this.settings=null,this.manager=null}});o.register("ScenePlugin",h,"scenePlugin"),t.exports=h},55681(t,e,i){var r=i(89993),s=i(35154),n=i(46975),a=i(87033),o={create:function(t){return"string"==typeof t?t={key:t}:void 0===t&&(t={}),{status:r.PENDING,key:s(t,"key",""),active:s(t,"active",!1),visible:s(t,"visible",!0),isBooted:!1,isTransition:!1,transitionFrom:null,transitionDuration:0,transitionAllowInput:!0,data:{},pack:s(t,"pack",!1),cameras:s(t,"cameras",null),map:s(t,"map",n(a,s(t,"mapAdd",{}))),physics:s(t,"physics",{}),loader:s(t,"loader",{}),plugins:s(t,"plugins",!1),input:s(t,"input",{})}}};t.exports=o},2368(t,e,i){var r=i(83419),s=i(89993),n=i(42363),a=i(44594),o=i(27397),h=i(52106),l=i(29747),u=i(55681),d=new r({initialize:function(t,e){this.scene=t,this.game,this.renderer,this.config=e,this.settings=u.create(e),this.canvas,this.context,this.anims,this.cache,this.plugins,this.registry,this.scale,this.sound,this.textures,this.add,this.cameras,this.displayList,this.events,this.make,this.scenePlugin,this.updateList,this.sceneUpdate=l},init:function(t){this.settings.status=s.INIT,this.sceneUpdate=l,this.game=t,this.renderer=t.renderer,this.canvas=t.canvas,this.context=t.context;var e=t.plugins;this.plugins=e,e.addToScene(this,n.Global,[n.CoreScene,h(this),o(this)]),this.events.emit(a.BOOT,this),this.settings.isBooted=!0},step:function(t,e){var i=this.events;i.emit(a.PRE_UPDATE,t,e),i.emit(a.UPDATE,t,e),this.sceneUpdate.call(this.scene,t,e),i.emit(a.POST_UPDATE,t,e)},render:function(t){var e=this.displayList;e.depthSort(),this.events.emit(a.PRE_RENDER,t),this.cameras.render(t,e),this.events.emit(a.RENDER,t)},queueDepthSort:function(){this.displayList.queueDepthSort()},depthSort:function(){this.displayList.depthSort()},pause:function(t){var e=this.settings,i=this.getStatus();return i!==s.CREATING&&i!==s.RUNNING?console.warn("Cannot pause non-running Scene",e.key):this.settings.active&&(e.status=s.PAUSED,e.active=!1,this.events.emit(a.PAUSE,this,t)),this},resume:function(t){var e=this.events,i=this.settings;return this.settings.active||(i.status=s.RUNNING,i.active=!0,e.emit(a.RESUME,this,t)),this},sleep:function(t){var e=this.settings,i=this.getStatus();return i!==s.CREATING&&i!==s.RUNNING?console.warn("Cannot sleep non-running Scene",e.key):(e.status=s.SLEEPING,e.active=!1,e.visible=!1,this.events.emit(a.SLEEP,this,t)),this},wake:function(t){var e=this.events,i=this.settings;return i.status=s.RUNNING,i.active=!0,i.visible=!0,e.emit(a.WAKE,this,t),i.isTransition&&e.emit(a.TRANSITION_WAKE,i.transitionFrom,i.transitionDuration),this},getData:function(){return this.settings.data},getStatus:function(){return this.settings.status},canInput:function(){var t=this.settings.status;return t>s.PENDING&&t<=s.RUNNING},isSleeping:function(){return this.settings.status===s.SLEEPING},isActive:function(){return this.settings.status===s.RUNNING},isPaused:function(){return this.settings.status===s.PAUSED},isTransitioning:function(){return this.settings.isTransition||null!==this.scenePlugin._target},isTransitionOut:function(){return null!==this.scenePlugin._target&&this.scenePlugin._duration>0},isTransitionIn:function(){return this.settings.isTransition},isVisible:function(){return this.settings.visible},setVisible:function(t){return this.settings.visible=t,this},setActive:function(t,e){return t?this.resume(e):this.pause(e)},start:function(t){var e=this.events,i=this.settings;t&&(i.data=t),i.status=s.START,i.active=!0,i.visible=!0,e.emit(a.START,this),e.emit(a.READY,this,t)},shutdown:function(t){var e=this.events,i=this.settings;e.off(a.TRANSITION_INIT),e.off(a.TRANSITION_START),e.off(a.TRANSITION_COMPLETE),e.off(a.TRANSITION_OUT),i.status=s.SHUTDOWN,i.active=!1,i.visible=!1,e.emit(a.SHUTDOWN,this,t)},destroy:function(){var t=this.events,e=this.settings;e.status=s.DESTROYED,e.active=!1,e.visible=!1,t.emit(a.DESTROY,this),t.removeAllListeners();for(var i=["scene","game","anims","cache","plugins","registry","sound","textures","add","cameras","displayList","events","make","scenePlugin","updateList"],r=0;r=0;i--){var r=this.sounds[i];r.key===t&&(r.destroy(),this.sounds.splice(i,1),e++)}return e},pauseAll:function(){this.forEachActiveSound(function(t){t.pause()}),this.emit(a.PAUSE_ALL,this)},resumeAll:function(){this.forEachActiveSound(function(t){t.resume()}),this.emit(a.RESUME_ALL,this)},setListenerPosition:u,stopAll:function(){this.forEachActiveSound(function(t){t.stop()}),this.emit(a.STOP_ALL,this)},stopByKey:function(t){var e=0;return this.getAll(t).forEach(function(t){t.stop()&&e++}),e},isPlaying:function(t){var e,i=this.sounds.length-1;if(void 0===t){for(;i>=0;i--)if((e=this.sounds[i]).isPlaying)return!0}else for(;i>=0;i--)if((e=this.sounds[i]).key===t&&e.isPlaying)return!0;return!1},unlock:u,onBlur:u,onFocus:u,onGameBlur:function(){this.gameLostFocus=!0,this.pauseOnBlur&&this.onBlur()},onGameFocus:function(){this.gameLostFocus=!1,this.pauseOnBlur&&this.onFocus()},update:function(t,e){this.unlocked&&(this.unlocked=!1,this.locked=!1,this.emit(a.UNLOCKED,this));for(var i=this.sounds.length-1;i>=0;i--)this.sounds[i].pendingRemove&&this.sounds.splice(i,1);this.sounds.forEach(function(i){i.update(t,e)})},destroy:function(){this.game.events.off(o.BLUR,this.onGameBlur,this),this.game.events.off(o.FOCUS,this.onGameFocus,this),this.game.events.off(o.PRE_STEP,this.update,this),this.removeAllListeners(),this.removeAll(),this.sounds.length=0,this.sounds=null,this.listenerPosition=null,this.game=null},forEachActiveSound:function(t,e){var i=this;this.sounds.forEach(function(r,s){r&&!r.pendingRemove&&t.call(e||i,r,s,i.sounds)})},setRate:function(t){return this.rate=t,this},rate:{get:function(){return this._rate},set:function(t){this._rate=t,this.forEachActiveSound(function(t){t.calculateRate()}),this.emit(a.GLOBAL_RATE,this,t)}},setDetune:function(t){return this.detune=t,this},detune:{get:function(){return this._detune},set:function(t){this._detune=t,this.forEachActiveSound(function(t){t.calculateRate()}),this.emit(a.GLOBAL_DETUNE,this,t)}}});t.exports=c},14747(t,e,i){var r=i(33684),s=i(25960),n=i(57490),a={create:function(t){var e=t.config.audio,i=t.device.audio;return e.noAudio||!i.webAudio&&!i.audioData?new s(t):i.webAudio&&!e.disableWebAudio?new n(t):new r(t)}};t.exports=a},19723(t){t.exports="complete"},98882(t){t.exports="decodedall"},57506(t){t.exports="decoded"},73146(t){t.exports="destroy"},11305(t){t.exports="detune"},40577(t){t.exports="detune"},30333(t){t.exports="mute"},20394(t){t.exports="rate"},21802(t){t.exports="volume"},1299(t){t.exports="looped"},99190(t){t.exports="loop"},97125(t){t.exports="mute"},89259(t){t.exports="pan"},79986(t){t.exports="pauseall"},17586(t){t.exports="pause"},19618(t){t.exports="play"},42306(t){t.exports="rate"},10387(t){t.exports="resumeall"},48959(t){t.exports="resume"},9960(t){t.exports="seek"},19180(t){t.exports="stopall"},98328(t){t.exports="stop"},50401(t){t.exports="unlocked"},52498(t){t.exports="volume"},14463(t,e,i){t.exports={COMPLETE:i(19723),DECODED:i(57506),DECODED_ALL:i(98882),DESTROY:i(73146),DETUNE:i(11305),GLOBAL_DETUNE:i(40577),GLOBAL_MUTE:i(30333),GLOBAL_RATE:i(20394),GLOBAL_VOLUME:i(21802),LOOP:i(99190),LOOPED:i(1299),MUTE:i(97125),PAN:i(89259),PAUSE_ALL:i(79986),PAUSE:i(17586),PLAY:i(19618),RATE:i(42306),RESUME_ALL:i(10387),RESUME:i(48959),SEEK:i(9960),STOP_ALL:i(19180),STOP:i(98328),UNLOCKED:i(50401),VOLUME:i(52498)}},64895(t,e,i){var r=i(30341),s=i(83419),n=i(14463),a=i(45319),o=new s({Extends:r,initialize:function(t,e,i){if(void 0===i&&(i={}),this.tags=t.game.cache.audio.get(e),!this.tags)throw new Error('No cached audio asset with key "'+e);this.audio=null,this.startTime=0,this.previousTime=0,this.duration=this.tags[0].duration,this.totalDuration=this.tags[0].duration,r.call(this,t,e,i)},play:function(t,e){return!this.manager.isLocked(this,"play",[t,e])&&(!!r.prototype.play.call(this,t,e)&&(!!this.pickAndPlayAudioTag()&&(this.emit(n.PLAY,this),!0)))},pause:function(){return!this.manager.isLocked(this,"pause")&&(!(this.startTime>0)&&(!!r.prototype.pause.call(this)&&(this.currentConfig.seek=this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0),this.stopAndReleaseAudioTag(),this.emit(n.PAUSE,this),!0)))},resume:function(){return!this.manager.isLocked(this,"resume")&&(!(this.startTime>0)&&(!!r.prototype.resume.call(this)&&(!!this.pickAndPlayAudioTag()&&(this.emit(n.RESUME,this),!0))))},stop:function(){return!this.manager.isLocked(this,"stop")&&(!!r.prototype.stop.call(this)&&(this.stopAndReleaseAudioTag(),this.emit(n.STOP,this),!0))},pickAndPlayAudioTag:function(){if(!this.pickAudioTag())return this.reset(),!1;var t=this.currentConfig.seek,e=this.currentConfig.delay,i=(this.currentMarker?this.currentMarker.start:0)+t;return this.previousTime=i,this.audio.currentTime=i,this.applyConfig(),0===e?(this.startTime=0,this.audio.paused&&this.playCatchPromise()):(this.startTime=window.performance.now()+1e3*e,this.audio.paused||this.audio.pause()),this.resetConfig(),!0},pickAudioTag:function(){if(this.audio)return!0;for(var t=0;t0)this.startTime=i-this.manager.loopEndOffset?(this.audio.currentTime=e+Math.max(0,r-i),r=this.audio.currentTime):r=i)return this.reset(),this.stopAndReleaseAudioTag(),void this.emit(n.COMPLETE,this);this.previousTime=r}},destroy:function(){r.prototype.destroy.call(this),this.tags=null,this.audio&&this.stopAndReleaseAudioTag()},updateMute:function(){this.audio&&(this.audio.muted=this.currentConfig.mute||this.manager.mute)},updateVolume:function(){this.audio&&(this.audio.volume=a(this.currentConfig.volume*this.manager.volume,0,1))},calculateRate:function(){r.prototype.calculateRate.call(this),this.audio&&(this.audio.playbackRate=this.totalRate)},mute:{get:function(){return this.currentConfig.mute},set:function(t){this.currentConfig.mute=t,this.manager.isLocked(this,"mute",t)||(this.updateMute(),this.emit(n.MUTE,this,t))}},setMute:function(t){return this.mute=t,this},volume:{get:function(){return this.currentConfig.volume},set:function(t){this.currentConfig.volume=t,this.manager.isLocked(this,"volume",t)||(this.updateVolume(),this.emit(n.VOLUME,this,t))}},setVolume:function(t){return this.volume=t,this},rate:{get:function(){return this.currentConfig.rate},set:function(t){this.currentConfig.rate=t,this.manager.isLocked(this,n.RATE,t)||(this.calculateRate(),this.emit(n.RATE,this,t))}},setRate:function(t){return this.rate=t,this},detune:{get:function(){return this.currentConfig.detune},set:function(t){this.currentConfig.detune=t,this.manager.isLocked(this,n.DETUNE,t)||(this.calculateRate(),this.emit(n.DETUNE,this,t))}},setDetune:function(t){return this.detune=t,this},seek:{get:function(){return this.isPlaying?this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0):this.isPaused?this.currentConfig.seek:0},set:function(t){this.manager.isLocked(this,"seek",t)||this.startTime>0||(this.isPlaying||this.isPaused)&&(t=Math.min(Math.max(0,t),this.duration),this.isPlaying?(this.previousTime=t,this.audio.currentTime=t):this.isPaused&&(this.currentConfig.seek=t),this.emit(n.SEEK,this,t))}},setSeek:function(t){return this.seek=t,this},loop:{get:function(){return this.currentConfig.loop},set:function(t){this.currentConfig.loop=t,this.manager.isLocked(this,"loop",t)||(this.audio&&(this.audio.loop=t),this.emit(n.LOOP,this,t))}},setLoop:function(t){return this.loop=t,this},pan:{get:function(){return this.currentConfig.pan},set:function(t){this.currentConfig.pan=t,this.emit(n.PAN,this,t)}},setPan:function(t){return this.pan=t,this}});t.exports=o},33684(t,e,i){var r=i(85034),s=i(83419),n=i(14463),a=i(64895),o=new s({Extends:r,initialize:function(t){this.override=!0,this.audioPlayDelay=.1,this.loopEndOffset=.05,this.onBlurPausedSounds=[],this.locked="ontouchstart"in window,this.lockedActionsQueue=this.locked?[]:null,this._mute=!1,this._volume=1,r.call(this,t)},add:function(t,e){var i=new a(this,t,e);return this.sounds.push(i),i},unlock:function(){this.locked=!1;var t=this;if(this.game.cache.audio.entries.each(function(e,i){for(var r=0;r-1},setAll:function(t,e,i,s){return r.SetAll(this.list,t,e,i,s),this},each:function(t,e){for(var i=[null],r=2;r0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}}});t.exports=o},90330(t,e,i){var r=new(i(83419))({initialize:function(t){this.entries={},this.size=0,this.setAll(t)},setAll:function(t){if(Array.isArray(t))for(var e=0;e-1},isPending:function(t){return this._toProcess>0&&this._pending.indexOf(t)>-1},isDestroying:function(t){return this._destroy.indexOf(t)>-1},add:function(t){return this.checkQueue&&this.isActive(t)&&!this.isDestroying(t)||this.isPending(t)||(this._pending.push(t),this._toProcess++),t},remove:function(t){if(this.isPending(t)){var e=this._pending,i=e.indexOf(t);-1!==i&&e.splice(i,1)}else this.isActive(t)&&(this._destroy.push(t),this._toProcess++);return t},removeAll:function(){for(var t=this._active,e=this._destroy,i=t.length;i--;)e.push(t[i]),this._toProcess++;return this},update:function(){if(0===this._toProcess)return this._active;var t,e,i=this._destroy,r=this._active;for(t=0;t=t.minX&&e.maxY>=t.minY}function v(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(t,e,i,s,n){for(var a,o=[e,i];o.length;)(i=o.pop())-(e=o.pop())<=s||(a=e+Math.ceil((i-e)/s/2)*s,r(t,a,e,i,n),o.push(e,a,a,i))}s.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],r=this.toBBox;if(!m(t,e))return i;for(var s,n,a,o,h=[];e;){for(s=0,n=e.children.length;s=0&&n[e].children.length>this._maxEntries;)this._split(n,e),e--;this._adjustParentBBoxes(s,n,e)},_split:function(t,e){var i=t[e],r=i.children.length,s=this._minEntries;this._chooseSplitAxis(i,s,r);var n=this._chooseSplitIndex(i,s,r),o=v(i.children.splice(n,i.children.length-n));o.height=i.height,o.leaf=i.leaf,a(i,this.toBBox),a(o,this.toBBox),e?t[e-1].children.push(o):this._splitRoot(i,o)},_splitRoot:function(t,e){this.data=v([t,e]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var r,s,n,a,h,l,u,c;for(l=u=1/0,r=e;r<=i-e;r++)a=p(s=o(t,0,r,this.toBBox),n=o(t,r,i,this.toBBox)),h=d(s)+d(n),a=e;s--)n=t.children[s],h(u,t.leaf?a(n):n),d+=c(u);return d},_adjustParentBBoxes:function(t,e,i){for(var r=i;r>=0;r--)h(e[r],t)},_condense:function(t){for(var e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():a(t[i],this.toBBox)},compareMinX:function(t,e){return t.left-e.left},compareMinY:function(t,e){return t.top-e.top},toBBox:function(t){return{minX:t.left,minY:t.top,maxX:t.right,maxY:t.bottom}}},t.exports=s},86555(t,e,i){var r=i(45319),s=i(83419),n=i(56583),a=i(26099),o=new s({initialize:function(t,e,i,r){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===r&&(r=null),this._width=t,this._height=e,this._parent=r,this.aspectMode=i,this.aspectRatio=0===e?1:t/e,this.minWidth=0,this.minHeight=0,this.maxWidth=Number.MAX_VALUE,this.maxHeight=Number.MAX_VALUE,this.snapTo=new a},setAspectMode:function(t){return void 0===t&&(t=0),this.aspectMode=t,this.setSize(this._width,this._height)},setSnap:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.snapTo.set(t,e),this.setSize(this._width,this._height)},setParent:function(t){return this._parent=t,this.setSize(this._width,this._height)},setMin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.minWidth=r(t,0,this.maxWidth),this.minHeight=r(e,0,this.maxHeight),this.setSize(this._width,this._height)},setMax:function(t,e){return void 0===t&&(t=Number.MAX_VALUE),void 0===e&&(e=t),this.maxWidth=r(t,this.minWidth,Number.MAX_VALUE),this.maxHeight=r(e,this.minHeight,Number.MAX_VALUE),this.setSize(this._width,this._height)},setSize:function(t,e){switch(void 0===t&&(t=0),void 0===e&&(e=t),this.aspectMode){case o.NONE:this._width=this.getNewWidth(n(t,this.snapTo.x)),this._height=this.getNewHeight(n(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height;break;case o.WIDTH_CONTROLS_HEIGHT:this._width=this.getNewWidth(n(t,this.snapTo.x)),this._height=this.getNewHeight(this._width*(1/this.aspectRatio),!1);break;case o.HEIGHT_CONTROLS_WIDTH:this._height=this.getNewHeight(n(e,this.snapTo.y)),this._width=this.getNewWidth(this._height*this.aspectRatio,!1);break;case o.FIT:this.constrain(t,e,!0);break;case o.ENVELOP:this.constrain(t,e,!1)}return this},setAspectRatio:function(t){return this.aspectRatio=t,this.setSize(this._width,this._height)},resize:function(t,e){return this._width=this.getNewWidth(n(t,this.snapTo.x)),this._height=this.getNewHeight(n(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height,this},getNewWidth:function(t,e){return void 0===e&&(e=!0),t=r(t,this.minWidth,this.maxWidth),e&&this._parent&&t>this._parent.width&&(t=Math.max(this.minWidth,this._parent.width)),t},getNewHeight:function(t,e){return void 0===e&&(e=!0),t=r(t,this.minHeight,this.maxHeight),e&&this._parent&&t>this._parent.height&&(t=Math.max(this.minHeight,this._parent.height)),t},constrain:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=!0),t=this.getNewWidth(t),e=this.getNewHeight(e);var r=this.snapTo,s=0===e?1:t/e;return i&&this.aspectRatio>s||!i&&this.aspectRatio0&&(t=(e=n(e,r.y))*this.aspectRatio)):(i&&this.aspectRatios)&&(t=(e=n(e,r.y))*this.aspectRatio,r.x>0&&(e=(t=n(t,r.x))*(1/this.aspectRatio))),this._width=t,this._height=e,this},fitTo:function(t,e){return this.constrain(t,e,!0)},envelop:function(t,e){return this.constrain(t,e,!1)},setWidth:function(t){return this.setSize(t,this._height)},setHeight:function(t){return this.setSize(this._width,t)},toString:function(){return"[{ Size (width="+this._width+" height="+this._height+" aspectRatio="+this.aspectRatio+" aspectMode="+this.aspectMode+") }]"},setCSS:function(t){t&&t.style&&(t.style.width=this._width+"px",t.style.height=this._height+"px")},copy:function(t){return t.setAspectMode(this.aspectMode),t.aspectRatio=this.aspectRatio,t.setSize(this.width,this.height)},destroy:function(){this._parent=null,this.snapTo=null},width:{get:function(){return this._width},set:function(t){this.setSize(t,this._height)}},height:{get:function(){return this._height},set:function(t){this.setSize(this._width,t)}}});o.NONE=0,o.WIDTH_CONTROLS_HEIGHT=1,o.HEIGHT_CONTROLS_WIDTH=2,o.FIT=3,o.ENVELOP=4,t.exports=o},15238(t){t.exports="add"},56187(t){t.exports="remove"},82348(t,e,i){t.exports={PROCESS_QUEUE_ADD:i(15238),PROCESS_QUEUE_REMOVE:i(56187)}},41392(t,e,i){t.exports={Events:i(82348),List:i(73162),Map:i(90330),ProcessQueue:i(25774),RTree:i(59542),Size:i(86555)}},57382(t,e,i){var r=i(83419),s=i(45319),n=i(40987),a=i(8054),o=i(50030),h=i(79237),l=new r({Extends:h,initialize:function(t,e,i,r,s){h.call(this,t,e,i,r,s),this.add("__BASE",0,0,0,r,s),this._source=this.frames.__BASE.source,this.canvas=this._source.image,this.context=this.canvas.getContext("2d",{willReadFrequently:!0}),this.width=r,this.height=s,this.imageData=this.context.getImageData(0,0,r,s),this.data=null,this.imageData&&(this.data=this.imageData.data),this.pixels=null,this.buffer,this.data&&(this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data)},update:function(){return this.imageData=this.context.getImageData(0,0,this.width,this.height),this.data=this.imageData.data,this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data,this.manager.game.config.renderType===a.WEBGL&&this.refresh(),this},draw:function(t,e,i,r){return void 0===r&&(r=!0),this.context.drawImage(i,t,e),r&&this.update(),this},drawFrame:function(t,e,i,r,s){void 0===i&&(i=0),void 0===r&&(r=0),void 0===s&&(s=!0);var n=this.manager.getFrame(t,e);if(n){var a=n.canvasData,o=n.cutWidth,h=n.cutHeight,l=n.source.resolution;this.context.drawImage(n.source.image,a.x,a.y,o,h,i,r,o/l,h/l),s&&this.update()}return this},setPixel:function(t,e,i,r,s,n){if(void 0===n&&(n=255),t=Math.abs(Math.floor(t)),e=Math.abs(Math.floor(e)),this.getIndex(t,e)>-1){var a=this.context.getImageData(t,e,1,1);a.data[0]=i,a.data[1]=r,a.data[2]=s,a.data[3]=n,this.context.putImageData(a,t,e)}return this},putData:function(t,e,i,r,s,n,a){return void 0===r&&(r=0),void 0===s&&(s=0),void 0===n&&(n=t.width),void 0===a&&(a=t.height),this.context.putImageData(t,e,i,r,s,n,a),this},getData:function(t,e,i,r){return t=s(Math.floor(t),0,this.width-1),e=s(Math.floor(e),0,this.height-1),i=s(i,1,this.width-t),r=s(r,1,this.height-e),this.context.getImageData(t,e,i,r)},getPixel:function(t,e,i){i||(i=new n);var r=this.getIndex(t,e);if(r>-1){var s=this.data,a=s[r+0],o=s[r+1],h=s[r+2],l=s[r+3];i.setTo(a,o,h,l)}return i},getPixels:function(t,e,i,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===r&&(r=i),t=Math.abs(Math.round(t)),e=Math.abs(Math.round(e));for(var a=s(t,0,this.width),o=s(t+i,0,this.width),h=s(e,0,this.height),l=s(e+r,0,this.height),u=new n,d=[],c=h;ca.width&&(t=a.width-r.cutX),r.cutY+e>a.height&&(e=a.height-r.cutY),r.setSize(t,e,r.cutX,r.cutY)}return this},render:function(){if(0!==this.commandBuffer.length)return this.camera.preRender(),this.renderer.type===o.WEBGL&&this._renderWebGL(),this.renderer.type===o.CANVAS&&this._renderCanvas(),this},_renderWebGL:function(){this.renderer.renderNodes.getNode("DynamicTextureHandler").run(this)},_renderCanvas:function(){var t,e,i,s,n,a,o,h,l,u,d,c,p,g,m,v=this.camera,y=this.context,x=this.renderer,T=this.manager;x.setContext(y);for(var w=this.commandBuffer,b=w.length,S=!1,C=!1,E=0;E>24&255)/255;var _=A>>16&255,M=A>>8&255,R=255&A;y.save(),y.globalCompositeOperation="source-over",y.fillStyle="rgba("+_+","+M+","+R+","+t+")",y.fillRect(g,m,p,n),y.restore();break;case f.STAMP:a=w[++E],s=w[++E],g=w[++E],m=w[++E],t=w[++E],c=w[++E],l=w[++E],u=w[++E],d=w[++E],o=w[++E],h=w[++E],e=w[++E],C&&(e=r.ERASE);var P=T.resetStamp(t,c);P.setPosition(g,m).setRotation(l).setScale(u,d).setTexture(a,s).setOrigin(o,h).setBlendMode(e),P.renderCanvas(x,P,v,null);break;case f.REPEAT:a=w[++E],s=w[++E],g=w[++E],m=w[++E],t=w[++E],c=w[++E],l=w[++E],u=w[++E],d=w[++E],o=w[++E],h=w[++E],e=w[++E],p=w[++E],n=w[++E];var O=w[++E],L=w[++E],F=w[++E],D=w[++E],I=w[++E];C&&(e=r.ERASE);var N=T.resetTileSprite(t,c);N.setPosition(g,m).setRotation(l).setScale(u,d).setTexture(a,s).setSize(p,n).setOrigin(o,h).setBlendMode(e).setTilePosition(O,L).setTileRotation(F).setTileScale(D,I),N.renderCanvas(x,N,v,null);break;case f.DRAW:var B=w[++E];if(g=w[++E],m=w[++E],void 0!==g){var k=B.x;B.x=g}if(void 0!==m){var U=B.y;B.y=m}C&&(i=B.blendMode,B.blendMode=r.ERASE),B.renderCanvas(x,B,v,null),void 0!==g&&(B.x=k),void 0!==m&&(B.y=U),C&&(B.blendMode=i);break;case f.SET_ERASE:C=!!w[++E];break;case f.PRESERVE:S=w[++E];break;case f.CALLBACK:(0,w[++E])();break;case f.CAPTURE:B=w[++E];var z=w[++E],Y=this.startCapture(B,z);B.renderCanvas(x,B,z.camera||v,Y.transform),this.finishCapture(B,Y)}}S||(w.length=0),x.setContext()},fill:function(t,e,i,r,s,n){void 0===e&&(e=1),void 0===i&&(i=0),void 0===r&&(r=0),void 0===s&&(s=this.width),void 0===n&&(n=this.height);var a=t>>16&255,o=t>>8&255,h=255&t,l=c.getTintFromFloats(a/255,o/255,h/255,e);return this.commandBuffer.push(f.FILL,l,i,r,s,n),this},clear:function(t,e,i,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===r&&(r=this.height),this.commandBuffer.push(f.CLEAR,t,e,i,r),this},stamp:function(t,e,i,r,s){void 0===i&&(i=0),void 0===r&&(r=0);var n=u(s,"alpha",1),a=u(s,"tint",16777215),o=u(s,"angle",0),h=u(s,"rotation",0),l=u(s,"scale",1),d=u(s,"scaleX",l),c=u(s,"scaleY",l),p=u(s,"originX",.5),g=u(s,"originY",.5),m=u(s,"blendMode",0);return 0!==o&&(h=o*Math.PI/180),this.commandBuffer.push(f.STAMP,t,e,i,r,n,a,h,d,c,p,g,m),this},erase:function(t,e,i,r,s){var n=this.commandBuffer,a=n.length;return n[a-2]!==f.SET_ERASE||n[a-1]?n.push(f.SET_ERASE,!0):n.length-=2,this.draw(t,e,i,r,s),n.push(f.SET_ERASE,!1),this},draw:function(t,e,i,r,s){Array.isArray(t)||(t=[t]);for(var n=t.length,a=0;aT||x.y>w)){var b=Math.max(x.x,e),S=Math.max(x.y,i),C=Math.min(x.r,T)-b,E=Math.min(x.b,w)-S;m=C,v=E,p=a?h+(u-(b-x.x)-C):h+(b-x.x),g=o?l+(d-(S-x.y)-E):l+(S-x.y),e=b,i=S,r=C,n=E}else p=0,g=0,m=0,v=0}else a&&(p=h+(u-e-r)),o&&(g=l+(d-i-n));var A=this.source.width,_=this.source.height;return t.u0=Math.max(0,p/A),t.v0=1-Math.max(0,g/_),t.u1=Math.min(1,(p+m)/A),t.v1=1-Math.min(1,(g+v)/_),t.x=e,t.y=i,t.cx=p,t.cy=g,t.cw=m,t.ch=v,t.width=r,t.height=n,t.flipX=a,t.flipY=o,t},updateCropUVs:function(t,e,i){return this.setCropUVs(t,t.x,t.y,t.width,t.height,e,i)},setUVs:function(t,e,i,r,s,n){var a=this.data.drawImage;return a.width=t,a.height=e,this.u0=i,this.v0=r,this.u1=s,this.v1=n,this},updateUVs:function(){var t=this.cutX,e=this.cutY,i=this.cutWidth,r=this.cutHeight,s=this.data.drawImage;s.width=i,s.height=r;var n=this.source.width,a=this.source.height;return this.u0=t/n,this.v0=1-e/a,this.u1=(t+i)/n,this.v1=1-(e+r)/a,this},updateUVsInverted:function(){var t=this.source.width,e=this.source.height;return this.u0=(this.cutX+this.cutHeight)/t,this.v0=1-this.cutY/e,this.u1=this.cutX/t,this.v1=1-(this.cutY+this.cutWidth)/e,this},clone:function(){var t=new a(this.texture,this.name,this.sourceIndex);return t.cutX=this.cutX,t.cutY=this.cutY,t.cutWidth=this.cutWidth,t.cutHeight=this.cutHeight,t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t.halfWidth=this.halfWidth,t.halfHeight=this.halfHeight,t.centerX=this.centerX,t.centerY=this.centerY,t.rotated=this.rotated,t.data=n(!0,t.data,this.data),t.updateUVs(),t},destroy:function(){this.texture=null,this.source=null,this.customData=null,this.data=null},glTexture:{get:function(){return this.source.glTexture}},realWidth:{get:function(){return this.data.sourceSize.w}},realHeight:{get:function(){return this.data.sourceSize.h}},radius:{get:function(){return this.data.radius}},trimmed:{get:function(){return this.data.trim}},scale9:{get:function(){return this.data.scale9}},is3Slice:{get:function(){return this.data.is3Slice}},canvasData:{get:function(){return this.data.drawImage}}});t.exports=a},79237(t,e,i){var r=i(83419),s=i(4327),n=i(11876),a='Texture "%s" has no frame "%s"',o=new r({initialize:function(t,e,i,r,s){Array.isArray(i)||(i=[i]),this.manager=t,this.key=e,this.source=[],this.dataSource=[],this.frames={},this.customData={},this.firstFrame="__BASE",this.frameTotal=0,this.smoothPixelArt=null;for(var a=0;an&&(n=h.cutX+h.cutWidth),h.cutY+h.cutHeight>a&&(a=h.cutY+h.cutHeight)}return{x:r,y:s,width:n-r,height:a-s}},getFrameNames:function(t){void 0===t&&(t=!1);var e=Object.keys(this.frames);if(!t){var i=e.indexOf("__BASE");-1!==i&&e.splice(i,1)}return e},getSourceImage:function(t){null!=t&&1!==this.frameTotal||(t="__BASE");var e=this.frames[t];return e?e.source.image:(console.warn(a,this.key,t),this.frames.__BASE.source.image)},getDataSourceImage:function(t){null!=t&&1!==this.frameTotal||(t="__BASE");var e,i=this.frames[t];return i?e=i.sourceIndex:(console.warn(a,this.key,t),e=this.frames.__BASE.sourceIndex),this.dataSource[e].image},setSource:function(t,e,i,r,s){void 0===e&&(e=0),void 0===i&&(i=!1),Array.isArray(t)||(t=[t]);for(var a=0;a0&&o.height>0&&l.drawImage(a.source.image,o.x,o.y,o.width,o.height,0,0,o.width,o.height),n=h.toDataURL(i,s),r.remove(h)}return n},addImage:function(t,e,i){var r=null;return this.checkKey(t)&&(r=this.create(t,e),v.Image(r,0),i&&r.setDataSource(i),this.emit(u.ADD,t,r),this.emit(u.ADD_KEY+t,r)),r},addGLTexture:function(t,e){var i=null;if(this.checkKey(t)){var r=e.width,s=e.height;(i=this.create(t,e,r,s)).add("__BASE",0,0,0,r,s),this.emit(u.ADD,t,i),this.emit(u.ADD_KEY+t,i)}return i},addCompressedTexture:function(t,e,i){var r=null;if(this.checkKey(t)){if((r=this.create(t,e)).add("__BASE",0,0,0,e.width,e.height),i){var s=function(t,e,i){Array.isArray(i.textures)||Array.isArray(i.frames)?v.JSONArray(t,e,i):v.JSONHash(t,e,i)};if(Array.isArray(i))for(var n=0;n=h.x&&t=h.y&&e=o.x&&t=o.y&&e>1),g=Math.max(1,g>>1),f+=m}return{mipmaps:c,width:h,height:l,internalFormat:o,compressed:!0,generateMipmap:!1}}console.warn("KTXParser - Only compressed formats supported")}},41942(t){t.exports=function(t,e){if(e&&e.frames&&e.pages){var i=t.source[0];t.add("__BASE",0,0,0,i.width,i.height);var r=e.frames;for(var s in r)if(r.hasOwnProperty(s)){var n=r[s],a=0|n.page;if(a>=t.source.length)console.warn('PCT atlas frame "'+s+'" references missing page '+a);else{var o=t.add(n.key||s,a,n.x,n.y,n.w,n.h);o?(n.trimmed&&o.setTrim(n.sourceW,n.sourceH,n.trimX,n.trimY,n.w,n.h),n.rotated&&(o.rotated=!0,o.updateUVsInverted())):console.warn("Invalid PCT atlas, frame already exists: "+s)}}return t.customData.pct={pages:e.pages,folders:e.folders},t}console.warn("Invalid PCT atlas data given")}},39620(t){var e={1:".png",2:".webp",3:".jpg",4:".jpeg",5:".gif"},i=function(t,e){for(var i=String(t);i.length0&&function(t){if(0===t.length)return!1;for(var e=0;e57)return!1}return!0}(s.substring(0,a))&&(n=i[parseInt(s.substring(0,a),10)],s=s.substring(a+1));var o=/~([1-5])$/.exec(s);if(o){var h=e[parseInt(o[1],10)];s=s.substring(0,s.length-2)+h}else r&&(s+=r);return n?n+"/"+s:s},s=function(t,s){var n="",a=/~([1-5])$/.exec(t);a&&(n=e[parseInt(a[1],10)],t=t.substring(0,t.length-2));for(var o=[],h=t.split(","),l=0;l=0)for(var c=u.substring(0,d),f=u.substring(d+1),p=f.indexOf("-"),g=f.substring(0,p),m=f.substring(p+1),v=parseInt(g,10),y=parseInt(m,10),x=g.length>1&&"0"===g.charAt(0)?g.length:0,T=v;T<=y;T++){var w=x>0?i(T,x):String(T);o.push(r(c+w,s,n))}else o.push(r(u,s,n))}return o};t.exports=function(t){if("string"!=typeof t||0===t.length)return console.warn("Invalid PCT file: empty or not a string"),null;var e=t.split("\n"),i=e[0];if(13===i.charCodeAt(i.length-1)&&(i=i.substring(0,i.length-1)),!i||0!==i.indexOf("PCT:"))return console.warn("Not a PCT file: missing PCT: header"),null;var n=i.substring(4),a=n.split("."),o=parseInt(a[0],10);if(isNaN(o)||o>1)return console.warn("Unsupported PCT version: "+n),null;for(var h=[],l=[],u={},d=0,c=null,f=1;f1};if(x.trimmed){var T=v[1].split(",");x.sourceW=parseInt(T[0],10),x.sourceH=parseInt(T[1],10),x.trimX=parseInt(T[2],10),x.trimY=parseInt(T[3],10)}c=x}else if("A:"===g){var w=p.indexOf("=",2);if(-1===w)continue;var b=r(p.substring(2,w),l,""),S=s(p.substring(w+1),l),C=u[b];if(C)for(var E=0;E>1),g=Math.max(1,g>>1),f+=v}return{mipmaps:c,width:h,height:l,internalFormat:s,compressed:!0,generateMipmap:!1}}},75549(t,e,i){var r=i(95540);t.exports=function(t,e,i,s,n,a,o){var h=r(o,"frameWidth",null),l=r(o,"frameHeight",h);if(null===h)throw new Error("TextureManager.SpriteSheet: Invalid frameWidth given.");var u=t.source[e];t.add("__BASE",e,0,0,u.width,u.height);var d=r(o,"startFrame",0),c=r(o,"endFrame",-1),f=r(o,"margin",0),p=r(o,"spacing",0),g=Math.floor((n-f+p)/(h+p))*Math.floor((a-f+p)/(l+p));0===g&&console.warn("SpriteSheet frame dimensions will result in zero frames for texture:",t.key),(d>g||d<-g)&&(d=0),d<0&&(d=g+d),(-1===c||c>g||cn&&(y=b-n),S>a&&(x=S-a),w>=d&&w<=c&&(t.add(T,e,i+m,s+v,h-y,l-x),T++),(m+=h+p)+h>n&&(m=f,v+=l+p)}return t}},47534(t,e,i){var r=i(95540);t.exports=function(t,e,i){var s=r(i,"frameWidth",null),n=r(i,"frameHeight",s);if(!s)throw new Error("TextureManager.SpriteSheetFromAtlas: Invalid frameWidth given.");var a=t.source[0];t.add("__BASE",0,0,0,a.width,a.height);var o,h=r(i,"startFrame",0),l=r(i,"endFrame",-1),u=r(i,"margin",0),d=r(i,"spacing",0),c=e.cutX,f=e.cutY,p=e.cutWidth,g=e.cutHeight,m=e.realWidth,v=e.realHeight,y=Math.floor((m-u+d)/(s+d)),x=Math.floor((v-u+d)/(n+d)),T=y*x,w=e.x,b=s-w,S=s-(m-p-w),C=e.y,E=n-C,A=n-(v-g-C);(h>T||h<-T)&&(h=0),h<0&&(h=T+h),-1!==l&&(T=h+(l+1));for(var _=u,M=u,R=0,P=0;P=this.firstgid&&tthis.right||e>this.bottom)},copy:function(t){return this.index=t.index,this.alpha=t.alpha,this.properties=a(t.properties),this.visible=t.visible,this.setFlip(t.flipX,t.flipY),this.tint=t.tint,this.rotation=t.rotation,this.collideUp=t.collideUp,this.collideDown=t.collideDown,this.collideLeft=t.collideLeft,this.collideRight=t.collideRight,this.collisionCallback=t.collisionCallback,this.collisionCallbackContext=t.collisionCallbackContext,this},getCollisionGroup:function(){return this.tileset?this.tileset.getTileCollisionGroup(this.index):null},getTileData:function(){return this.tileset?this.tileset.getTileData(this.index):null},getLeft:function(t){var e=this.tilemapLayer;return e?e.tileToWorldXY(this.x,this.y,void 0,t).x:this.x*this.baseWidth},getRight:function(t){var e=this.tilemapLayer;return e?this.getLeft(t)+this.width*e.scaleX:this.getLeft(t)+this.width},getTop:function(t){var e=this.tilemapLayer;return e?e.tileToWorldXY(this.x,this.y,void 0,t).y:this.y*this.baseWidth-(this.height-this.baseHeight)},getBottom:function(t){var e=this.tilemapLayer;return e?this.getTop(t)+this.height*e.scaleY:this.getTop(t)+this.height},getBounds:function(t,e){return void 0===e&&(e=new o),e.x=this.getLeft(t),e.y=this.getTop(t),e.width=this.getRight(t)-e.x,e.height=this.getBottom(t)-e.y,e},getCenterX:function(t){return(this.getLeft(t)+this.getRight(t))/2},getCenterY:function(t){return(this.getTop(t)+this.getBottom(t))/2},intersects:function(t,e,i,r){return!(i<=this.pixelX||r<=this.pixelY||t>=this.right||e>=this.bottom)},isInteresting:function(t,e){return t&&e?this.canCollide||this.hasInterestingFace:t?this.collides:!!e&&this.hasInterestingFace},resetCollision:function(t){(void 0===t&&(t=!0),this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,t)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},resetFaces:function(){return this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this},setCollision:function(t,e,i,r,s){(void 0===e&&(e=t),void 0===i&&(i=t),void 0===r&&(r=t),void 0===s&&(s=!0),this.collideLeft=t,this.collideRight=e,this.collideUp=i,this.collideDown=r,this.faceLeft=t,this.faceRight=e,this.faceTop=i,this.faceBottom=r,s)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},setCollisionCallback:function(t,e){return null===t?(this.collisionCallback=void 0,this.collisionCallbackContext=void 0):(this.collisionCallback=t,this.collisionCallbackContext=e),this},setSize:function(t,e,i,r){return void 0!==t&&(this.width=t),void 0!==e&&(this.height=e),void 0!==i&&(this.baseWidth=i),void 0!==r&&(this.baseHeight=r),this.updatePixelXY(),this},updatePixelXY:function(){var t=this.layer.orientation;if(t===n.ORTHOGONAL)this.pixelX=this.x*this.baseWidth,this.pixelY=this.y*this.baseHeight;else if(t===n.ISOMETRIC)this.pixelX=(this.x-this.y)*this.baseWidth*.5,this.pixelY=(this.x+this.y)*this.baseHeight*.5;else if(t===n.STAGGERED)this.pixelX=this.x*this.baseWidth+this.y%2*(this.baseWidth/2),this.pixelY=this.y*(this.baseHeight/2);else if(t===n.HEXAGONAL){var e,i,r=this.layer.staggerAxis,s=this.layer.staggerIndex,a=this.layer.hexSideLength;"y"===r?(i=(this.baseHeight-a)/2+a,this.pixelX="odd"===s?this.x*this.baseWidth+this.y%2*(this.baseWidth/2):this.x*this.baseWidth-this.y%2*(this.baseWidth/2),this.pixelY=this.y*i):"x"===r&&(e=(this.baseWidth-a)/2+a,this.pixelX=this.x*e,this.pixelY="odd"===s?this.y*this.baseHeight+this.x%2*(this.baseHeight/2):this.y*this.baseHeight-this.x%2*(this.baseHeight/2))}return this.right=this.pixelX+this.baseWidth,this.bottom=this.pixelY+this.baseHeight,this},destroy:function(){this.collisionCallback=void 0,this.collisionCallbackContext=void 0,this.properties=void 0},canCollide:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown||void 0!==this.collisionCallback}},collides:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown}},hasInterestingFace:{get:function(){return this.faceTop||this.faceBottom||this.faceLeft||this.faceRight}},tileset:{get:function(){var t=this.layer.tilemapLayer;if(t){var e=t.gidMap[this.index];if(e)return e}return null}},tilemapLayer:{get:function(){return this.layer.tilemapLayer}},tilemap:{get:function(){var t=this.tilemapLayer;return t?t.tilemap:null}}});t.exports=l},49075(t,e,i){var r=i(84101),s=i(83419),n=i(39506),a=i(80341),o=i(95540),h=i(14977),l=i(27462),u=i(91907),d=i(36305),c=i(19133),f=i(68287),p=i(23029),g=i(81086),m=i(44731),v=i(53180),y=i(20442),x=i(33629),T=new s({initialize:function(t,e){this.scene=t,this.tileWidth=e.tileWidth,this.tileHeight=e.tileHeight,this.width=e.width,this.height=e.height,this.orientation=e.orientation,this.renderOrder=e.renderOrder,this.format=e.format,this.version=e.version,this.properties=e.properties,this.widthInPixels=e.widthInPixels,this.heightInPixels=e.heightInPixels,this.imageCollections=e.imageCollections,this.images=e.images,this.layers=e.layers,this.tiles=e.tiles,this.tilesets=e.tilesets,this.objects=e.objects,this.currentLayerIndex=0,this.hexSideLength=e.hexSideLength;var i=this.orientation;this._convert={WorldToTileXY:g.GetWorldToTileXYFunction(i),WorldToTileX:g.GetWorldToTileXFunction(i),WorldToTileY:g.GetWorldToTileYFunction(i),TileToWorldXY:g.GetTileToWorldXYFunction(i),TileToWorldX:g.GetTileToWorldXFunction(i),TileToWorldY:g.GetTileToWorldYFunction(i),GetTileCorners:g.GetTileCornersFunction(i)}},setRenderOrder:function(t){var e=["right-down","left-down","right-up","left-up"];return"number"==typeof t&&(t=e[t]),e.indexOf(t)>-1&&(this.renderOrder=t),this},addTilesetImage:function(t,e,i,s,n,o,h,l){if(void 0===t)return null;null==e&&(e=t);var u=this.scene.sys.textures;if(!u.exists(e))return console.warn('Texture key "%s" not found',e),null;var d=u.get(e),c=this.getTilesetIndex(t);if(null===c&&this.format===a.TILED_JSON)return console.warn('Tilemap has no tileset "%s". Its tilesets are %o',t,this.tilesets),null;var f=this.tilesets[c];return f?((i||s)&&f.setTileSize(i,s),(n||o)&&f.setSpacing(n,o),f.setImage(d),f):(void 0===i&&(i=this.tileWidth),void 0===s&&(s=this.tileHeight),void 0===n&&(n=0),void 0===o&&(o=0),void 0===h&&(h=0),void 0===l&&(l={x:0,y:0}),(f=new x(t,h,i,s,n,o,void 0,void 0,l)).setImage(d),this.tilesets.push(f),this.tiles=r(this),f)},copy:function(t,e,i,r,s,n,a,o){return null!==(o=this.getLayer(o))?(g.Copy(t,e,i,r,s,n,a,o),this):null},createBlankLayer:function(t,e,i,r,s,n,a,o){if(void 0===i&&(i=0),void 0===r&&(r=0),void 0===s&&(s=this.width),void 0===n&&(n=this.height),void 0===a&&(a=this.tileWidth),void 0===o&&(o=this.tileHeight),null!==this.getLayerIndex(t))return console.warn("Invalid Tilemap Layer ID: "+t),null;for(var l,u=new h({name:t,tileWidth:a,tileHeight:o,width:s,height:n,orientation:this.orientation,hexSideLength:this.hexSideLength}),d=0;d1&&console.warn("TilemapGPULayer can only use one tileset. Using the first item given."),e=e[0]),a=new v(this.scene,this,n,e,i,r)):(a=new y(this.scene,this,n,e,i,r)).setRenderOrder(this.renderOrder),this.scene.sys.displayList.add(a),a)},createFromObjects:function(t,e,i){void 0===i&&(i=!0);var r=[],s=this.getObjectLayer(t);if(!s)return console.warn("createFromObjects: Invalid objectLayerName given: "+t),r;var a=new l(i?this.tilesets:void 0);Array.isArray(e)||(e=[e]);var h=s.objects;e.sortByY&&h.sort(function(t,e){return t.y>e.y?1:-1});for(var c=0;c-1&&this.putTileAt(e,n.x,n.y,i,n.tilemapLayer)}return r},removeTileAt:function(t,e,i,r,s){return void 0===i&&(i=!0),void 0===r&&(r=!0),null===(s=this.getLayer(s))?null:g.RemoveTileAt(t,e,i,r,s)},removeTileAtWorldXY:function(t,e,i,r,s,n){return void 0===i&&(i=!0),void 0===r&&(r=!0),null===(n=this.getLayer(n))?null:g.RemoveTileAtWorldXY(t,e,i,r,s,n)},renderDebug:function(t,e,i){return null===(i=this.getLayer(i))?null:(this.orientation===u.ORTHOGONAL&&g.RenderDebug(t,e,i),this)},renderDebugFull:function(t,e){for(var i=this.layers,r=0;r=0&&t<4&&(this._renderOrder=t),this},cull:function(t){return this.cullCallback(this.layer,t,this.culledTiles,this._renderOrder)},setSkipCull:function(t){return void 0===t&&(t=!0),this.skipCull=t,this},setCullPadding:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=1),this.cullPaddingX=t,this.cullPaddingY=e,this},setTint:function(t,e,i,r,s,n){void 0===t&&(t=16777215);return this.forEachTile(function(e){e.tint=t},this,e,i,r,s,n)},setTintMode:function(t,e,i,r,s,n){void 0===t&&(t=h.MULTIPLY);return this.forEachTile(function(e){e.tintMode=t},this,e,i,r,s,n)},destroy:function(t){this.culledTiles.length=0,this.cullCallback=null,o.prototype.destroy.call(this,t)}});t.exports=l},44731(t,e,i){var r=i(83419),s=i(78389),n=i(31401),a=i(95643),o=i(81086),h=i(26099),l=new r({Extends:a,Mixins:[n.Alpha,n.BlendMode,n.ComputedSize,n.Depth,n.ElapseTimer,n.Flip,n.GetBounds,n.Lighting,n.Mask,n.Origin,n.RenderNodes,n.Transform,n.Visible,n.ScrollFactor,s],initialize:function(t,e,i,r,s,n){a.call(this,e,t),this.isTilemap=!0,this.tilemap=i,this.layerIndex=r,this.layer=i.layers[r],this.layer.tilemapLayer=this,this.gidMap=[],this.tempVec=new h,this.collisionCategory=1,this.collisionMask=1,this.setAlpha(this.layer.alpha),this.setPosition(s,n),this.setOrigin(0,0),this.setSize(i.tileWidth*this.layer.width,i.tileHeight*this.layer.height)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(t,e){this.updateTimer(t,e)},calculateFacesAt:function(t,e){return o.CalculateFacesAt(t,e,this.layer),this},calculateFacesWithin:function(t,e,i,r){return o.CalculateFacesWithin(t,e,i,r,this.layer),this},createFromTiles:function(t,e,i,r,s){return o.CreateFromTiles(t,e,i,r,s,this.layer)},copy:function(t,e,i,r,s,n,a){return o.Copy(t,e,i,r,s,n,a,this.layer),this},fill:function(t,e,i,r,s,n){return o.Fill(t,e,i,r,s,n,this.layer),this},filterTiles:function(t,e,i,r,s,n,a){return o.FilterTiles(t,e,i,r,s,n,a,this.layer)},findByIndex:function(t,e,i){return o.FindByIndex(t,e,i,this.layer)},findTile:function(t,e,i,r,s,n,a){return o.FindTile(t,e,i,r,s,n,a,this.layer)},forEachTile:function(t,e,i,r,s,n,a){return o.ForEachTile(t,e,i,r,s,n,a,this.layer),this},getTileAt:function(t,e,i){return o.GetTileAt(t,e,i,this.layer)},getTileAtWorldXY:function(t,e,i,r){return o.GetTileAtWorldXY(t,e,i,r,this.layer)},getIsoTileAtWorldXY:function(t,e,i,r,s){void 0===i&&(i=!0);var n=this.tempVec;return o.IsometricWorldToTileXY(t,e,!0,n,s,this.layer,i),this.getTileAt(n.x,n.y,r)},getTilesWithin:function(t,e,i,r,s){return o.GetTilesWithin(t,e,i,r,s,this.layer)},getTilesWithinShape:function(t,e,i){return o.GetTilesWithinShape(t,e,i,this.layer)},getTilesWithinWorldXY:function(t,e,i,r,s,n){return o.GetTilesWithinWorldXY(t,e,i,r,s,n,this.layer)},hasTileAt:function(t,e){return o.HasTileAt(t,e,this.layer)},hasTileAtWorldXY:function(t,e,i){return o.HasTileAtWorldXY(t,e,i,this.layer)},putTileAt:function(t,e,i,r){return o.PutTileAt(t,e,i,r,this.layer)},putTileAtWorldXY:function(t,e,i,r,s){return o.PutTileAtWorldXY(t,e,i,r,s,this.layer)},putTilesAt:function(t,e,i,r){return o.PutTilesAt(t,e,i,r,this.layer),this},randomize:function(t,e,i,r,s){return o.Randomize(t,e,i,r,s,this.layer),this},removeTileAt:function(t,e,i,r){return o.RemoveTileAt(t,e,i,r,this.layer)},removeTileAtWorldXY:function(t,e,i,r,s){return o.RemoveTileAtWorldXY(t,e,i,r,s,this.layer)},renderDebug:function(t,e){return o.RenderDebug(t,e,this.layer),this},replaceByIndex:function(t,e,i,r,s,n){return o.ReplaceByIndex(t,e,i,r,s,n,this.layer),this},setCollision:function(t,e,i,r){return o.SetCollision(t,e,i,this.layer,r),this},setCollisionBetween:function(t,e,i,r){return o.SetCollisionBetween(t,e,i,r,this.layer),this},setCollisionByProperty:function(t,e,i){return o.SetCollisionByProperty(t,e,i,this.layer),this},setCollisionByExclusion:function(t,e,i){return o.SetCollisionByExclusion(t,e,i,this.layer),this},setCollisionFromCollisionGroup:function(t,e){return o.SetCollisionFromCollisionGroup(t,e,this.layer),this},setTileIndexCallback:function(t,e,i){return o.SetTileIndexCallback(t,e,i,this.layer),this},setTileLocationCallback:function(t,e,i,r,s,n){return o.SetTileLocationCallback(t,e,i,r,s,n,this.layer),this},shuffle:function(t,e,i,r){return o.Shuffle(t,e,i,r,this.layer),this},swapByIndex:function(t,e,i,r,s,n){return o.SwapByIndex(t,e,i,r,s,n,this.layer),this},tileToWorldX:function(t,e){return this.tilemap.tileToWorldX(t,e,this)},tileToWorldY:function(t,e){return this.tilemap.tileToWorldY(t,e,this)},tileToWorldXY:function(t,e,i,r){return this.tilemap.tileToWorldXY(t,e,i,r,this)},getTileCorners:function(t,e,i){return this.tilemap.getTileCorners(t,e,i,this)},weightedRandomize:function(t,e,i,r,s){return o.WeightedRandomize(e,i,r,s,t,this.layer),this},worldToTileX:function(t,e,i){return this.tilemap.worldToTileX(t,e,i,this)},worldToTileY:function(t,e,i){return this.tilemap.worldToTileY(t,e,i,this)},worldToTileXY:function(t,e,i,r,s){return this.tilemap.worldToTileXY(t,e,i,r,s,this)},destroy:function(t){void 0===t&&(t=!0),this.tilemap&&(this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),t&&this.tilemap.removeLayer(this),this.tilemap=void 0,this.layer=void 0,this.gidMap=[],this.tileset=[],a.prototype.destroy.call(this))}});t.exports=l},16153(t,e,i){var r=i(61340),s=new r,n=new r,a=new r;t.exports=function(t,e,i,r){var o=e.cull(i),h=o.length,l=i.alpha*e.alpha;if(!(0===h||l<=0)){n.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var u=t.currentContext,d=e.gidMap;u.save(),s.copyWithScrollFactorFrom(i.matrixCombined,i.scrollX,i.scrollY,e.scrollFactorX,e.scrollFactorY),r&&s.multiply(r),s.multiply(n,a),a.setToContext(u),(!t.antialias||e.scaleX>1||e.scaleY>1)&&(u.imageSmoothingEnabled=!1);for(var c=0;c=this.firstgid&&t>>1]).startTime)<=e&&h+s.duration>e)return s.tileid+this.firstgid;hi.width||e.height>i.height?this.updateTileData(e.width,e.height):this.updateTileData(i.width,i.height,i.x,i.y),this},setTileSize:function(t,e){return void 0!==t&&(this.tileWidth=t),void 0!==e&&(this.tileHeight=e),this.image&&this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},setSpacing:function(t,e){return void 0!==t&&(this.tileMargin=t),void 0!==e&&(this.tileSpacing=e),this.image&&this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},updateTileData:function(t,e,i,r){void 0===i&&(i=0),void 0===r&&(r=0);var s=(e-2*this.tileMargin+this.tileSpacing)/(this.tileHeight+this.tileSpacing),n=(t-2*this.tileMargin+this.tileSpacing)/(this.tileWidth+this.tileSpacing);s%1==0&&n%1==0||console.warn("Image tile area not tile size multiple in: "+this.name),s=Math.floor(s),n=Math.floor(n),this.rows=s,this.columns=n,this.total=s*n,this.texCoordinates.length=0;for(var a=this.tileMargin+i,o=this.tileMargin+r,h=0;h8388608)throw new Error("Tileset._animationDataTexture: too many animations - total number of animations plus animation frames is max 8388608, got "+f);var p=2*f,g=Math.min(p,4096),m=Math.ceil(p/4096),v=new Uint32Array(g*m),y=0,x=r.length;for(o=0;os.worldView.x+n.scaleX*i.tileWidth*(-a-.5)&&h.xs.worldView.y+n.scaleY*i.tileHeight*(-o-1)&&h.y=0;n--)for(s=r.width-1;s>=0;s--)if((a=r.data[n][s])&&a.index===t){if(o===e)return a;o+=1}}else for(n=0;na.width&&(i=Math.max(a.width-t,0)),e+s>a.height&&(s=Math.max(a.height-e,0));for(var u=[],d=e;d-1}return!1}},24152(t,e,i){var r=i(45091),s=new(i(26099));t.exports=function(t,e,i,n){n.tilemapLayer.worldToTileXY(t,e,!0,s,i);var a=s.x,o=s.y;return r(a,o,n)}},90454(t,e,i){var r=i(63448),s=i(56583);t.exports=function(t,e){var i,n,a,o,h=t.tilemapLayer.tilemap,l=t.tilemapLayer,u=Math.floor(h.tileWidth*l.scaleX),d=Math.floor(h.tileHeight*l.scaleY),c=t.hexSideLength;if("y"===t.staggerAxis){var f=(d-c)/2+c;i=s(e.worldView.x-l.x,u,0,!0)-l.cullPaddingX,n=r(e.worldView.right-l.x,u,0,!0)+l.cullPaddingX,a=s(e.worldView.y-l.y,f,0,!0)-l.cullPaddingY,o=r(e.worldView.bottom-l.y,f,0,!0)+l.cullPaddingY}else{var p=(u-c)/2+c;i=s(e.worldView.x-l.x,p,0,!0)-l.cullPaddingX,n=r(e.worldView.right-l.x,p,0,!0)+l.cullPaddingX,a=s(e.worldView.y-l.y,d,0,!0)-l.cullPaddingY,o=r(e.worldView.bottom-l.y,d,0,!0)+l.cullPaddingY}return{left:i,right:n,top:a,bottom:o}}},9474(t,e,i){var r=i(90454),s=i(32483);t.exports=function(t,e,i,n){void 0===i&&(i=[]),void 0===n&&(n=0),i.length=0;var a=t.tilemapLayer,o=r(t,e);return a.skipCull&&1===a.scrollFactorX&&1===a.scrollFactorY&&(o.left=0,o.right=t.width,o.top=0,o.bottom=t.height),s(t,o,n,i),i}},27229(t,e,i){var r=i(19951),s=i(26099),n=new s;t.exports=function(t,e,i,a){var o=a.baseTileWidth,h=a.baseTileHeight,l=a.tilemapLayer;l&&(o*=l.scaleX,h*=l.scaleY);var u,d,c=r(t,e,n,i,a),f=[],p=.5773502691896257;"y"===a.staggerAxis?(u=p*o,d=h/2):(u=o/2,d=p*h);for(var g=0;g<6;g++){var m=2*Math.PI*(.5-g)/6;f.push(new s(c.x+u*Math.cos(m),c.y+d*Math.sin(m)))}return f}},19951(t,e,i){var r=i(26099);t.exports=function(t,e,i,s,n){i||(i=new r);var a=n.baseTileWidth,o=n.baseTileHeight,h=n.tilemapLayer,l=0,u=0;h&&(s||(s=h.scene.cameras.main),l=h.x+s.scrollX*(1-h.scrollFactorX),u=h.y+s.scrollY*(1-h.scrollFactorY),a*=h.scaleX,o*=h.scaleY);var d,c,f=a/2,p=o/2,g=n.staggerAxis,m=n.staggerIndex;return"y"===g?(d=l+a*t+a,c=u+1.5*e*p+p,e%2==0&&("odd"===m?d-=f:d+=f)):"x"===g&&"odd"===m&&(d=l+1.5*t*f+f,c=u+o*t+o,t%2==0&&("odd"===m?c-=p:c+=p)),i.set(d,c)}},86625(t,e,i){var r=i(26099);t.exports=function(t,e,i,s,n,a){s||(s=new r);var o=a.baseTileWidth,h=a.baseTileHeight,l=a.tilemapLayer;l&&(n||(n=l.scene.cameras.main),t-=l.x+n.scrollX*(1-l.scrollFactorX),e-=l.y+n.scrollY*(1-l.scrollFactorY),o*=l.scaleX,h*=l.scaleY);var u,d,c,f,p,g=.5773502691896257,m=-.3333333333333333,v=.6666666666666666,y=o/2,x=h/2;"y"===a.staggerAxis?(c=g*(u=(t-y)/(g*o))+m*(d=(e-x)/x),f=0*u+v*d):(c=m*(u=(t-y)/y)+g*(d=(e-x)/(g*h)),f=v*u+0*d),p=-c-f;var T,w=Math.round(c),b=Math.round(f),S=Math.round(p),C=Math.abs(w-c),E=Math.abs(b-f),A=Math.abs(S-p);C>E&&C>A?w=-b-S:E>A&&(b=-w-S);var _=b;return T="odd"===a.staggerIndex?_%2==0?b/2+w:b/2+w-.5:_%2==0?b/2+w:b/2+w+.5,s.set(T,_)}},62991(t){t.exports=function(t,e,i){return t>=0&&t=0&&e=0;n--)(o=l[a][n])&&-1!==o.index&&o.visible&&0!==o.alpha&&(c||r(n,a,t,e))&&i.push(o);else if(2===s)for(a=p;a>=0;a--)for(n=0;n=0;a--)for(n=f;n>=0;n--)(o=l[a][n])&&-1!==o.index&&o.visible&&0!==o.alpha&&(c||r(n,a,t,e))&&i.push(o);return h.tilesDrawn=i.length,h.tilesTotal=u*d,i}},14127(t,e,i){var r=i(26099);t.exports=function(t,e,i,s,n){i||(i=new r);var a=n.baseTileWidth,o=n.baseTileHeight,h=n.tilemapLayer,l=0,u=0;h&&(s||(s=h.scene.cameras.main),l=h.x+s.scrollX*(1-h.scrollFactorX),a*=h.scaleX,u=h.y+s.scrollY*(1-h.scrollFactorY),o*=h.scaleY);var d=l+a/2*(t-e),c=u+(t+e)*(o/2);return i.set(d,c)}},96897(t,e,i){var r=i(26099);t.exports=function(t,e,i,s,n,a,o){s||(s=new r);var h=a.baseTileWidth,l=a.baseTileHeight,u=a.tilemapLayer;u&&(n||(n=u.scene.cameras.main),e-=u.y+n.scrollY*(1-u.scrollFactorY),l*=u.scaleY,t-=u.x+n.scrollX*(1-u.scrollFactorX),h*=u.scaleX);var d=h/2,c=l/2;o||(e-=l);var f=.5*((t-=d)/d+e/c),p=.5*(-t/d+e/c);return i&&(f=Math.floor(f),p=Math.floor(p)),s.set(f,p)}},71558(t,e,i){var r=i(23029),s=i(62991),n=i(72023),a=i(20576);t.exports=function(t,e,i,o,h){if(void 0===o&&(o=!0),!s(e,i,h))return null;var l,u=h.data[i][e],d=u&&u.collides;t instanceof r?(null===h.data[i][e]&&(h.data[i][e]=new r(h,t.index,e,i,h.tileWidth,h.tileHeight)),h.data[i][e].copy(t)):(l=t,null===h.data[i][e]?h.data[i][e]=new r(h,l,e,i,h.tileWidth,h.tileHeight):h.data[i][e].index=l);var c=h.data[i][e],f=-1!==h.collideIndexes.indexOf(c.index);if(-1===(l=t instanceof r?t.index:t))c.width=h.tileWidth,c.height=h.tileHeight;else{var p=h.tilemapLayer.tilemap,g=p.tiles[l][2],m=p.tilesets[g];c.width=m.tileWidth,c.height=m.tileHeight}return a(c,f),o&&d!==c.collides&&n(e,i,h),c}},26303(t,e,i){var r=i(71558),s=new(i(26099));t.exports=function(t,e,i,n,a,o){return o.tilemapLayer.worldToTileXY(e,i,!0,s,a,o),r(t,s.x,s.y,n,o)}},14051(t,e,i){var r=i(42573),s=i(71558);t.exports=function(t,e,i,n,a){if(void 0===n&&(n=!0),!Array.isArray(t))return null;Array.isArray(t[0])||(t=[t]);for(var o=t.length,h=t[0].length,l=0;l=d;s--)(a=o[n][s])&&-1!==a.index&&a.visible&&0!==a.alpha&&r.push(a);else if(2===i)for(n=p;n>=f;n--)for(s=d;o[n]&&s=f;n--)for(s=c;o[n]&&s>=d;s--)(a=o[n][s])&&-1!==a.index&&a.visible&&0!==a.alpha&&r.push(a);return u.tilesDrawn=r.length,u.tilesTotal=h*l,r}},57068(t,e,i){var r=i(20576),s=i(42573),n=i(9589);t.exports=function(t,e,i,a,o){void 0===e&&(e=!0),void 0===i&&(i=!0),void 0===o&&(o=!0),Array.isArray(t)||(t=[t]);for(var h=0;he)){for(var l=t;l<=e;l++)n(l,i,o);if(h)for(var u=0;u=t&&c.index<=e&&r(c,i)}a&&s(0,0,o.width,o.height,o)}}},75661(t,e,i){var r=i(20576),s=i(42573),n=i(9589);t.exports=function(t,e,i,a){void 0===e&&(e=!0),void 0===i&&(i=!0),Array.isArray(t)||(t=[t]);for(var o=0;o0&&r(o,t)}}e&&s(0,0,i.width,i.height,i)}},9589(t){t.exports=function(t,e,i){var r=i.collideIndexes.indexOf(t);e&&-1===r?i.collideIndexes.push(t):e||-1===r||i.collideIndexes.splice(r,1)}},20576(t){t.exports=function(t,e){e?t.setCollision(!0,!0,!0,!0,!1):t.resetCollision(!1)}},79583(t){t.exports=function(t,e,i,r){if("number"==typeof t)r.callbacks[t]=null!==e?{callback:e,callbackContext:i}:void 0;else for(var s=0,n=t.length;s-1?new s(o,f,d,u,a.tilesize,a.tilesize):e?null:new s(o,-1,d,u,a.tilesize,a.tilesize),h.push(c)}l.push(h),h=[]}o.data=l,i.push(o)}return i}},96483(t,e,i){var r=i(33629);t.exports=function(t){for(var e=[],i=[],s=0;so&&(o=e.layer[l].width),e.layer[l].height>h&&(h=e.layer[l].height);var u=new s({width:o,height:h,name:t,tileWidth:e.layer[0].tilesize,tileHeight:e.layer[0].tilesize,format:r.WELTMEISTER});return u.layers=n(e,i),u.tilesets=a(e),u}},52833(t,e,i){t.exports={ParseTileLayers:i(6656),ParseTilesets:i(96483),ParseWeltmeister:i(87021)}},57442(t,e,i){t.exports={FromOrientationString:i(6641),Parse:i(46177),Parse2DArray:i(2342),ParseCSV:i(82593),Impact:i(52833),Tiled:i(96761)}},51233(t,e,i){var r=i(79291);t.exports=function(t){for(var e,i,s,n,a,o=0;o>>0;return r}},84101(t,e,i){var r=i(33629);t.exports=function(t){var e,i,s=[];for(e=0;e0;)if(n.i>=n.layers.length){if(i.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}n=i.pop()}else{var a=n.layers[n.i];if(n.i++,"imagelayer"===a.type){var o=r(a,"offsetx",0)+r(a,"startx",0),h=r(a,"offsety",0)+r(a,"starty",0);e.push({name:n.name+a.name,image:a.image,x:n.x+o+a.x,y:n.y+h+a.y,alpha:n.opacity*a.opacity,visible:n.visible&&a.visible,properties:r(a,"properties",{})})}else if("group"===a.type){var l=s(t,a,n);i.push(n),n=l}}return e}},46594(t,e,i){var r=i(51233),s=i(84101),n=i(91907),a=i(62644),o=i(80341),h=i(6641),l=i(87010),u=i(12635),d=i(22611),c=i(28200),f=i(24619);t.exports=function(t,e,i){var p=a(e),g=new l({width:p.width,height:p.height,name:t,tileWidth:p.tilewidth,tileHeight:p.tileheight,orientation:h(p.orientation),format:o.TILED_JSON,version:p.version,properties:p.properties,renderOrder:p.renderorder,infinite:p.infinite});if(g.orientation===n.HEXAGONAL)if(g.hexSideLength=p.hexsidelength,g.staggerAxis=p.staggeraxis,g.staggerIndex=p.staggerindex,"y"===g.staggerAxis){var m=(g.tileHeight-g.hexSideLength)/2;g.widthInPixels=g.tileWidth*(g.width+.5),g.heightInPixels=g.height*(g.hexSideLength+m)+m}else{var v=(g.tileWidth-g.hexSideLength)/2;g.widthInPixels=g.width*(g.hexSideLength+v)+v,g.heightInPixels=g.tileHeight*(g.height+.5)}g.layers=c(p,i),g.images=u(p);var y=f(p);return g.tilesets=y.tilesets,g.imageCollections=y.imageCollections,g.objects=d(p),g.tiles=s(g),r(g),g}},52205(t,e,i){var r=i(18254),s=i(29920),n=function(t){return{x:t.x,y:t.y}},a=["id","name","type","rotation","properties","visible","x","y","width","height"];t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=0);var o=r(t,a);if(o.x+=e,o.y+=i,t.gid){var h=s(t.gid);o.gid=h.gid,o.flippedHorizontal=h.flippedHorizontal,o.flippedVertical=h.flippedVertical,o.flippedAntiDiagonal=h.flippedAntiDiagonal}else t.polyline?o.polyline=t.polyline.map(n):t.polygon?o.polygon=t.polygon.map(n):t.ellipse?o.ellipse=t.ellipse:t.text?o.text=t.text:t.point?o.point=!0:o.rectangle=!0;return o}},22611(t,e,i){var r=i(95540),s=i(52205),n=i(48700),a=i(79677);t.exports=function(t){for(var e=[],i=[],o=a(t);o.i0;)if(o.i>=o.layers.length){if(i.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}o=i.pop()}else{var h=o.layers[o.i];if(o.i++,h.opacity*=o.opacity,h.visible=o.visible&&h.visible,"objectgroup"===h.type){h.name=o.name+h.name;for(var l=o.x+r(h,"startx",0)+r(h,"offsetx",0),u=o.y+r(h,"starty",0)+r(h,"offsety",0),d=[],c=0;c0;)if(f.i>=f.layers.length){if(c.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}f=c.pop()}else{var p=f.layers[f.i];if(f.i++,"tilelayer"===p.type)if(p.compression)console.warn("TilemapParser.parseTiledJSON - Layer compression is unsupported, skipping layer '"+p.name+"'");else{if(p.encoding&&"base64"===p.encoding){if(p.chunks)for(var g=0;g0?((y=new u(m,v.gid,D,I,t.tilewidth,t.tileheight)).rotation=v.rotation,y.flipX=v.flipped,b[I][D]=y):(x=e?null:new u(m,-1,D,I,t.tilewidth,t.tileheight),b[I][D]=x),++S===M.width&&(O++,S=0)}}else{(m=new h({name:f.name+p.name,id:p.id,x:f.x+o(p,"offsetx",0)+p.x,y:f.y+o(p,"offsety",0)+p.y,width:p.width,height:p.height,tileWidth:t.tilewidth,tileHeight:t.tileheight,alpha:f.opacity*p.opacity,visible:f.visible&&p.visible,properties:o(p,"properties",[]),orientation:a(t.orientation)})).orientation===s.HEXAGONAL&&(m.hexSideLength=t.hexsidelength,m.staggerAxis=t.staggeraxis,m.staggerIndex=t.staggerindex,"y"===m.staggerAxis?(T=(m.tileHeight-m.hexSideLength)/2,m.widthInPixels=m.tileWidth*(m.width+.5),m.heightInPixels=m.height*(m.hexSideLength+T)+T):(w=(m.tileWidth-m.hexSideLength)/2,m.widthInPixels=m.width*(m.hexSideLength+w)+w,m.heightInPixels=m.tileHeight*(m.height+.5)));for(var N=[],B=0,k=p.data.length;B0?((y=new u(m,v.gid,S,b.length,t.tilewidth,t.tileheight)).rotation=v.rotation,y.flipX=v.flipped,N.push(y)):(x=e?null:new u(m,-1,S,b.length,t.tilewidth,t.tileheight),N.push(x)),++S===p.width&&(b.push(N),S=0,N=[])}m.data=b,d.push(m)}else if("group"===p.type){var U=n(t,p,f);c.push(f),f=U}}return d}},24619(t,e,i){var r=i(33629),s=i(16536),n=i(52205),a=i(57880);t.exports=function(t){for(var e,i=[],o=[],h=null,l=0;l1){var c=void 0,f=void 0;if(Array.isArray(u.tiles)){c=c||{},f=f||{};for(var p=0;p0){var n,a,o,h={},l={};if(Array.isArray(r.edgecolors))for(n=0;n0)throw new Error("TimerEvent infinite loop created via zero delay")}else e=new a(t);return this._pendingInsertion.push(e),e},delayedCall:function(t,e,i,r){return this.addEvent({delay:t,callback:e,args:i,callbackScope:r})},clearPendingEvents:function(){return this._pendingInsertion=[],this},removeEvent:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e-1&&this._active.splice(s,1),r.destroy()}for(i=0;i=r.delay)){var s=r.elapsed-r.delay;if(r.elapsed=r.delay,!r.hasDispatched&&r.callback&&(r.hasDispatched=!0,r.callback.apply(r.callbackScope,r.args)),r.repeatCount>0){if(r.repeatCount--,s>=r.delay)for(;s>=r.delay&&r.repeatCount>0;)r.callback&&r.callback.apply(r.callbackScope,r.args),s-=r.delay,r.repeatCount--;r.elapsed=s,r.hasDispatched=!1}else r.hasDispatched&&this._pendingRemoval.push(r)}}}},shutdown:function(){var t;for(t=0;t0||this.totalComplete>0)&&(0!==this.loop&&(-1===this.loop||this.loop>this.iteration)?(this.iteration++,this.reset(!0)):this.complete=!0),this.complete&&this.emit(h.COMPLETE,this)}},play:function(t){return void 0===t&&(t=!0),this.paused=!1,this.complete=!1,this.totalComplete=0,t&&this.reset(),this},pause:function(){this.paused=!0;for(var t=this.events,e=0;e0&&(i=e[e.length-1].time);for(var r=0;r0)throw new Error("TimerEvent infinite loop created via zero delay");return this},getProgress:function(){return this.elapsed/this.delay},getOverallProgress:function(){if(this.repeat>0){var t=this.delay+this.delay*this.repeat;return(this.elapsed+this.delay*(this.repeat-this.repeatCount))/t}return this.getProgress()},getRepeatCount:function(){return this.repeatCount},getElapsed:function(){return this.elapsed},getElapsedSeconds:function(){return.001*this.elapsed},getRemaining:function(){return this.delay-this.elapsed},getRemainingSeconds:function(){return.001*this.getRemaining()},getOverallRemaining:function(){return this.delay*(1+this.repeatCount)-this.elapsed},getOverallRemainingSeconds:function(){return.001*this.getOverallRemaining()},remove:function(t){void 0===t&&(t=!1),this.elapsed=this.delay,this.hasDispatched=!t,this.repeatCount=0},destroy:function(){this.callback=void 0,this.callbackScope=void 0,this.args=[]}});t.exports=n},35945(t){t.exports="complete"},89809(t,e,i){t.exports={COMPLETE:i(35945)}},90291(t,e,i){t.exports={Clock:i(33385),Events:i(89809),Timeline:i(96120),TimerEvent:i(94880)}},40382(t,e,i){var r=i(72905),s=i(83419),n=i(43491),a=i(88032),o=i(37277),h=i(44594),l=i(93109),u=i(8462),d=i(8357),c=i(43960),f=i(26012),p=new s({initialize:function(t){this.scene=t,this.events=t.sys.events,this.timeScale=1,this.paused=!1,this.processing=!1,this.tweens=[],this.time=0,this.startTime=0,this.nextTime=0,this.prevTime=0,this.maxLag=500,this.lagSkip=33,this.gap=1e3/240,this.events.once(h.BOOT,this.boot,this),this.events.on(h.START,this.start,this)},boot:function(){this.events.once(h.DESTROY,this.destroy,this)},start:function(){this.timeScale=1,this.paused=!1,this.startTime=Date.now(),this.prevTime=this.startTime,this.nextTime=this.gap,this.events.on(h.UPDATE,this.update,this),this.events.once(h.SHUTDOWN,this.shutdown,this)},create:function(t){Array.isArray(t)||(t=[t]);for(var e=[],i=0;i-1},existing:function(t){return this.has(t)||this.tweens.push(t.reset()),this},addCounter:function(t){var e=a(this,t);return this.tweens.push(e.reset()),e},stagger:function(t,e){return l(t,e)},setLagSmooth:function(t,e){return void 0===t&&(t=1/1e-8),void 0===e&&(e=0),this.maxLag=t,this.lagSkip=Math.min(e,this.maxLag),this},setFps:function(t){return void 0===t&&(t=240),this.gap=1e3/t,this.nextTime=1e3*this.time+this.gap,this},getDelta:function(t){var e=Date.now()-this.prevTime;e>this.maxLag&&(this.startTime+=e-this.lagSkip),this.prevTime+=e;var i=this.prevTime-this.startTime,r=i-this.nextTime,s=i-1e3*this.time;return r>0||t?(i/=1e3,this.time=i,this.nextTime+=r+(r>=this.gap?4:this.gap-r)):s=0,s},tick:function(){return this.step(!0),this},update:function(){this.paused||this.step(!1)},step:function(t){void 0===t&&(t=!1);var e=this.getDelta(t);if(!(e<=0)){var i,r;this.processing=!0;var s=[],n=this.tweens;for(i=0;i0){for(i=0;i-1&&(r.isPendingRemove()||r.isDestroyed())&&(n.splice(o,1),r.destroy())}s.length=0}this.processing=!1}},remove:function(t){return this.processing?t.setPendingRemoveState():(r(this.tweens,t),t.setRemovedState()),this},reset:function(t){return this.existing(t),t.seek(),t.setActiveState(),this},makeActive:function(t){return this.existing(t),t.setActiveState(),this},each:function(t,e){var i,r=[null];for(i=1;iE&&(E=M),C[A][_]=M}}}var R=o?r(o):null;return i=h?function(t,e,i,r){var s,n=0,o=r%y,h=Math.floor(r/y);if(o>=0&&o=0&&ht&&(this.loopCounter=t),this},remove:function(){return this.parent&&this.parent.remove(this),this},stop:function(){return!this.parent||this.isRemoved()||this.isPendingRemove()||this.isDestroyed()||(this.dispatchEvent(n.TWEEN_STOP,"onStop"),this.setPendingRemoveState()),this},updateLoopCountdown:function(t){this.countdown-=t,this.countdown<=0&&(this.setActiveState(),this.dispatchEvent(n.TWEEN_LOOP,"onLoop"))},updateStartCountdown:function(t){return this.countdown-=t,this.countdown<=0&&(this.hasStarted=!0,this.setActiveState(),this.dispatchEvent(n.TWEEN_START,"onStart"),t=0),t},updateCompleteDelay:function(t){this.countdown-=t,this.countdown<=0&&this.onCompleteHandler()},setCallback:function(t,e,i){return void 0===i&&(i=[]),this.callbacks.hasOwnProperty(t)&&(this.callbacks[t]={func:e,params:i}),this},setPendingState:function(){this.state=a.PENDING},setActiveState:function(){this.state=a.ACTIVE,this.hasStarted=!1},setLoopDelayState:function(){this.state=a.LOOP_DELAY},setCompleteDelayState:function(){this.state=a.COMPLETE_DELAY},setStartDelayState:function(){this.state=a.START_DELAY,this.countdown=this.startDelay,this.hasStarted=!1},setPendingRemoveState:function(){this.state=a.PENDING_REMOVE},setRemovedState:function(){this.state=a.REMOVED},setFinishedState:function(){this.state=a.FINISHED},setDestroyedState:function(){this.state=a.DESTROYED},isPending:function(){return this.state===a.PENDING},isActive:function(){return this.state===a.ACTIVE},isLoopDelayed:function(){return this.state===a.LOOP_DELAY},isCompleteDelayed:function(){return this.state===a.COMPLETE_DELAY},isStartDelayed:function(){return this.state===a.START_DELAY},isPendingRemove:function(){return this.state===a.PENDING_REMOVE},isRemoved:function(){return this.state===a.REMOVED},isFinished:function(){return this.state===a.FINISHED},isDestroyed:function(){return this.state===a.DESTROYED},destroy:function(){this.data&&this.data.forEach(function(t){t.destroy()}),this.removeAllListeners(),this.callbacks=null,this.data=null,this.parent=null,this.setDestroyedState()}});o.TYPES=["onActive","onComplete","onLoop","onPause","onRepeat","onResume","onStart","onStop","onUpdate","onYoyo"],t.exports=o},95042(t,e,i){var r=i(83419),s=i(842),n=i(86353),a=new r({initialize:function(t,e,i,r,s,n,a,o,h,l){this.tween=t,this.targetIndex=e,this.duration=r<=0?.01:r,this.totalDuration=0,this.delay=0,this.getDelay=i,this.yoyo=s,this.hold=n,this.repeat=a,this.repeatDelay=o,this.repeatCounter=0,this.flipX=h,this.flipY=l,this.progress=0,this.elapsed=0,this.state=0,this.isCountdown=!1},getTarget:function(){return this.tween.targets[this.targetIndex]},setTargetValue:function(t){void 0===t&&(t=this.current),this.tween.targets[this.targetIndex][this.key]=t},setCreatedState:function(){this.state=n.CREATED,this.isCountdown=!1},setDelayState:function(){this.state=n.DELAY,this.isCountdown=!0},setPendingRenderState:function(){this.state=n.PENDING_RENDER,this.isCountdown=!1},setPlayingForwardState:function(){this.state=n.PLAYING_FORWARD,this.isCountdown=!1},setPlayingBackwardState:function(){this.state=n.PLAYING_BACKWARD,this.isCountdown=!1},setHoldState:function(){this.state=n.HOLD_DELAY,this.isCountdown=!0},setRepeatState:function(){this.state=n.REPEAT_DELAY,this.isCountdown=!0},setCompleteState:function(){this.state=n.COMPLETE,this.isCountdown=!1},isCreated:function(){return this.state===n.CREATED},isDelayed:function(){return this.state===n.DELAY},isPendingRender:function(){return this.state===n.PENDING_RENDER},isPlayingForward:function(){return this.state===n.PLAYING_FORWARD},isPlayingBackward:function(){return this.state===n.PLAYING_BACKWARD},isHolding:function(){return this.state===n.HOLD_DELAY},isRepeating:function(){return this.state===n.REPEAT_DELAY},isComplete:function(){return this.state===n.COMPLETE},setStateFromEnd:function(t){this.yoyo?this.onRepeat(t,!0,!0):this.repeatCounter>0?this.onRepeat(t,!0,!1):this.setCompleteState()},setStateFromStart:function(t){this.repeatCounter>0?this.onRepeat(t,!1):this.setCompleteState()},reset:function(){var t=this.tween,e=t.totalTargets,i=this.targetIndex,r=t.targets[i],s=this.key;this.progress=0,this.elapsed=0,this.delay=this.getDelay(r,s,0,i,e,t),this.repeatCounter=-1===this.repeat?n.MAX:this.repeat,this.setPendingRenderState();var a=this.duration+this.hold;this.yoyo&&(a+=this.duration);var o=a+this.repeatDelay;this.totalDuration=this.delay+a,-1===this.repeat?(this.totalDuration+=o*n.MAX,t.isInfinite=!0):this.repeat>0&&(this.totalDuration+=o*this.repeat),this.totalDuration>t.duration&&(t.duration=this.totalDuration),this.delay0&&(this.elapsed=this.delay,this.setDelayState())},onRepeat:function(t,e,i){var r=this.tween,n=r.totalTargets,a=this.targetIndex,o=r.targets[a],h=this.key,l="texture"!==h;if(this.elapsed=t,this.progress=t/this.duration,this.flipX&&o.toggleFlipX(),this.flipY&&o.toggleFlipY(),l&&(e||i)&&(this.start=this.getStartValue(o,h,this.start,a,n,r)),i)return this.setPlayingBackwardState(),void this.dispatchEvent(s.TWEEN_YOYO,"onYoyo");this.repeatCounter--,l&&(this.end=this.getEndValue(o,h,this.start,a,n,r)),this.repeatDelay>0?(this.elapsed=this.repeatDelay-t,l&&(this.current=this.start,o[h]=this.current),this.setRepeatState()):(this.setPlayingForwardState(),this.dispatchEvent(s.TWEEN_REPEAT,"onRepeat"))},destroy:function(){this.tween=null,this.getDelay=null,this.setCompleteState()}});t.exports=a},69902(t){t.exports={targets:null,delay:0,duration:1e3,ease:"Power0",easeParams:null,hold:0,repeat:0,repeatDelay:0,yoyo:!1,flipX:!1,flipY:!1,persist:!1,interpolation:null}},81076(t){t.exports=["callbackScope","completeDelay","delay","duration","ease","easeParams","flipX","flipY","hold","interpolation","loop","loopDelay","onActive","onActiveParams","onComplete","onCompleteParams","onLoop","onLoopParams","onPause","onPauseParams","onRepeat","onRepeatParams","onResume","onResumeParams","onStart","onStartParams","onStop","onStopParams","onUpdate","onUpdateParams","onYoyo","onYoyoParams","paused","persist","props","repeat","repeatDelay","targets","yoyo"]},8462(t,e,i){var r=i(70402),s=i(83419),n=i(842),a=i(44603),o=i(39429),h=i(36383),l=i(86353),u=i(48177),d=i(42220),c=new s({Extends:r,initialize:function(t,e){r.call(this,t),this.targets=e,this.totalTargets=e.length,this.isSeeking=!1,this.isInfinite=!1,this.elapsed=0,this.totalElapsed=0,this.duration=0,this.progress=0,this.totalDuration=0,this.totalProgress=0,this.isNumberTween=!1},add:function(t,e,i,r,s,n,a,o,h,l,d,c,f,p,g,m){var v=new u(this,t,e,i,r,s,n,a,o,h,l,d,c,f,p,g,m);return this.totalData=this.data.push(v),v},addFrame:function(t,e,i,r,s,n,a,o,h,l){var u=new d(this,t,e,i,r,s,n,a,o,h,l);return this.totalData=this.data.push(u),u},getValue:function(t){void 0===t&&(t=0);var e=null;return this.data&&(e=this.data[t].current),e},hasTarget:function(t){return this.targets&&-1!==this.targets.indexOf(t)},updateTo:function(t,e,i){if(void 0===i&&(i=!1),"texture"!==t)for(var r=0;r0)this.elapsed=0,this.progress=0,this.loopCounter--,this.initTweenData(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.setLoopDelayState()):(this.setActiveState(),this.dispatchEvent(n.TWEEN_LOOP,"onLoop"));else{if(!(this.completeDelay>0))return this.onCompleteHandler(),!0;this.countdown=this.completeDelay,this.setCompleteDelayState()}return!1},onCompleteHandler:function(){this.progress=1,this.totalProgress=1,r.prototype.onCompleteHandler.call(this)},play:function(){return this.isDestroyed()?(console.warn("Cannot play destroyed Tween",this),this):((this.isPendingRemove()||this.isFinished())&&this.seek(),this.paused=!1,this.setActiveState(),this)},seek:function(t,e,i){if(void 0===t&&(t=0),void 0===e&&(e=16.6),void 0===i&&(i=!1),this.isDestroyed())return console.warn("Cannot seek destroyed Tween",this),this;i||(this.isSeeking=!0),this.reset(!0),this.initTweenData(!0),this.setActiveState(),this.dispatchEvent(n.TWEEN_ACTIVE,"onActive");var r=this.paused;if(this.paused=!1,t>0){for(var s=Math.floor(t/e),a=t-s*e,o=0;o0&&this.update(a)}return this.paused=r,this.isSeeking=!1,this},initTweenData:function(t){void 0===t&&(t=!1),this.duration=0,this.startDelay=h.MAX_SAFE_INTEGER;for(var e=this.data,i=0;i0?r+s+(r+a)*n:r+s},reset:function(t){return void 0===t&&(t=!1),this.elapsed=0,this.totalElapsed=0,this.progress=0,this.totalProgress=0,this.loopCounter=this.loop,-1===this.loop&&(this.isInfinite=!0,this.loopCounter=l.MAX),t||(this.initTweenData(),this.setActiveState(),this.dispatchEvent(n.TWEEN_ACTIVE,"onActive")),this},update:function(t){if(this.isPendingRemove()||this.isDestroyed())return!this.persist||(this.setFinishedState(),!1);if(this.paused||this.isFinished())return!1;if(t*=this.timeScale*this.parent.timeScale,this.isLoopDelayed())return this.updateLoopCountdown(t),!1;if(this.isCompleteDelayed())return this.updateCompleteDelay(t),!1;this.hasStarted||(this.startDelay-=t,this.startDelay<=0&&(this.hasStarted=!0,this.dispatchEvent(n.TWEEN_START,"onStart"),t=0));var e=!1;if(this.isActive())for(var i=this.data,r=0;r0&&!this.isStartDelayed()?this.setStartDelayState():this.setActiveState(),this},add:function(t){var e=this.parent.create(t);Array.isArray(e)||(e=[e]);for(var i=this.data,r=0;r0)this.loopCounter--,this.resetTweens(),this.loopDelay>0?(this.countdown=this.loopDelay,this.setLoopDelayState()):(this.setActiveState(),this.dispatchEvent(a.TWEEN_LOOP,"onLoop"));else{if(!(this.completeDelay>0))return this.onCompleteHandler(),!0;this.countdown=this.completeDelay,this.setCompleteDelayState()}return!1},play:function(){return this.isDestroyed()?(console.warn("Cannot play destroyed TweenChain",this),this):((this.isPendingRemove()||this.isPending())&&this.resetTweens(),this.paused=!1,this.startDelay>0&&!this.isStartDelayed()?this.setStartDelayState():this.setActiveState(),this)},resetTweens:function(){for(var t=this.data,e=this.totalData,i=0;i=d?(c=u-d,u=d,f=!0):u<0&&(u=0);var p=s(u/d,0,1);this.elapsed=u,this.progress=p,this.previous=this.current,h||(p=1-p);var g=this.ease(p);this.interpolation?this.current=this.interpolation(this.interpolationData,g):this.current=this.start+(this.end-this.start)*g,n[o]=this.current,f&&(h?(e.isNumberTween&&(this.current=this.end,n[o]=this.current),this.hold>0?(this.elapsed=this.hold,this.setHoldState()):this.setStateFromEnd(c)):(e.isNumberTween&&(this.current=this.start,n[o]=this.current),this.setStateFromStart(c))),this.dispatchEvent(a.TWEEN_UPDATE,"onUpdate")}return!this.isComplete()},dispatchEvent:function(t,e){var i=this.tween;if(!i.isSeeking){var r=i.targets[this.targetIndex],s=this.key,n=this.current,a=this.previous;i.emit(t,i,s,r,n,a);var o=i.callbacks[e];o&&o.func.apply(i.callbackScope,[i,r,s,n,a].concat(o.params))}},destroy:function(){r.prototype.destroy.call(this),this.getActiveValue=null,this.getEndValue=null,this.getStartValue=null,this.ease=null}});t.exports=o},42220(t,e,i){var r=i(95042),s=i(45319),n=i(83419),a=i(842),o=new n({Extends:r,initialize:function(t,e,i,s,n,a,o,h,l,u,d){r.call(this,t,e,n,a,!1,o,h,l,u,d),this.key="texture",this.startTexture=null,this.endTexture=i,this.startFrame=null,this.endFrame=s,this.yoyo=0!==h},reset:function(t){r.prototype.reset.call(this);var e=this.tween.targets[this.targetIndex];this.startTexture||(this.startTexture=e.texture.key,this.startFrame=e.frame.name),t&&e.setTexture(this.startTexture,this.startFrame)},update:function(t){var e=this.tween,i=this.targetIndex,r=e.targets[i];if(!r)return this.setCompleteState(),!1;if(this.isCountdown&&(this.elapsed-=t,this.elapsed<=0&&(this.elapsed=0,t=0,this.isDelayed()?this.setPendingRenderState():this.isRepeating()?(this.setPlayingForwardState(),this.dispatchEvent(a.TWEEN_REPEAT,"onRepeat")):this.isHolding()&&this.setStateFromEnd(0))),this.isPendingRender())return this.startTexture&&r.setTexture(this.startTexture,this.startFrame),this.setPlayingForwardState(),!0;var n=this.isPlayingForward(),o=this.isPlayingBackward();if(n||o){var h=this.elapsed,l=this.duration,u=0,d=!1;(h+=t)>=l?(u=h-l,h=l,d=!0):h<0&&(h=0);var c=s(h/l,0,1);this.elapsed=h,this.progress=c,d&&(n?(r.setTexture(this.endTexture,this.endFrame),this.hold>0?(this.elapsed=this.hold,this.setHoldState()):this.setStateFromEnd(u)):(r.setTexture(this.startTexture,this.startFrame),this.setStateFromStart(u))),this.dispatchEvent(a.TWEEN_UPDATE,"onUpdate")}return!this.isComplete()},dispatchEvent:function(t,e){var i=this.tween;if(!i.isSeeking){var r=i.targets[this.targetIndex],s=this.key;i.emit(t,i,s,r);var n=i.callbacks[e];n&&n.func.apply(i.callbackScope,[i,r,s].concat(n.params))}},destroy:function(){r.prototype.destroy.call(this),this.startTexture=null,this.endTexture=null,this.startFrame=null,this.endFrame=null}});t.exports=o},86353(t){t.exports={CREATED:0,DELAY:2,PENDING_RENDER:4,PLAYING_FORWARD:5,PLAYING_BACKWARD:6,HOLD_DELAY:7,REPEAT_DELAY:8,COMPLETE:9,PENDING:20,ACTIVE:21,LOOP_DELAY:22,COMPLETE_DELAY:23,START_DELAY:24,PENDING_REMOVE:25,REMOVED:26,FINISHED:27,DESTROYED:28,MAX:999999999999}},83419(t){function e(t,e,i){var r=i?t[e]:Object.getOwnPropertyDescriptor(t,e);return!i&&r.value&&"object"==typeof r.value&&(r=r.value),!(!r||!function(t){return!!t.get&&"function"==typeof t.get||!!t.set&&"function"==typeof t.set}(r))&&(void 0===r.enumerable&&(r.enumerable=!0),void 0===r.configurable&&(r.configurable=!0),r)}function i(t,e){var i=Object.getOwnPropertyDescriptor(t,e);return!!i&&(i.value&&"object"==typeof i.value&&(i=i.value),!1===i.configurable)}function r(t,r,s,a){for(var o in r)if(r.hasOwnProperty(o)){var h=e(r,o,s);if(!1!==h){if(i((a||t).prototype,o)){if(n.ignoreFinals)continue;throw new Error("cannot override final property '"+o+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,o,h)}else t.prototype[o]=r[o]}}function s(t,e){if(e){Array.isArray(e)||(e=[e]);for(var i=0;i0){var n=i-t.length;if(n<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.push(e),r&&r.call(s,e),e):null;for(var a=e.length-1;a>=0;)-1!==t.indexOf(e[a])&&e.splice(a,1),a--;if(0===(a=e.length))return null;i>0&&a>n&&(e.splice(n),a=n);for(var o=0;o0){var a=r-t.length;if(a<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.splice(i,0,e),s&&s.call(n,e),e):null;for(var o=e.length-1;o>=0;)-1!==t.indexOf(e[o])&&e.pop(),o--;if(0===(o=e.length))return null;r>0&&o>a&&(e.splice(a),o=a);for(var h=o-1;h>=0;h--){var l=e[h];t.splice(i,0,l),s&&s.call(n,l)}return e}},66905(t){t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&ie.length&&(n=e.length),i?(r=e[n-1][i],(s=e[n][i])-t<=t-r?e[n]:e[n-1]):(r=e[n-1],(s=e[n])-t<=t-r?s:r)}},43491(t){var e=function(t,i){void 0===i&&(i=[]);for(var r=0;r=0;a--)if(o=t[a],!e||e&&void 0===i&&o.hasOwnProperty(e)||e&&void 0!==i&&o[e]===i)return o;return null}},26546(t){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var r=e+Math.floor(Math.random()*(i-e));return void 0===t[r]?null:t[r]}},85835(t){t.exports=function(t,e,i){if(e===i)return t;var r=t.indexOf(e),s=t.indexOf(i);if(r<0||s<0)throw new Error("Supplied items must be elements of the same array");return r>s||(t.splice(r,1),s=t.indexOf(i),t.splice(s+1,0,e)),t}},83371(t){t.exports=function(t,e,i){if(e===i)return t;var r=t.indexOf(e),s=t.indexOf(i);if(r<0||s<0)throw new Error("Supplied items must be elements of the same array");return r0){var r=t[i-1],s=t.indexOf(r);t[i]=r,t[s]=e}return t}},69693(t){t.exports=function(t,e,i){var r=t.indexOf(e);if(-1===r||i<0||i>=t.length)throw new Error("Supplied index out of bounds");return r!==i&&(t.splice(r,1),t.splice(i,0,e)),e}},40853(t){t.exports=function(t,e){var i=t.indexOf(e);if(-1!==i&&i=e;s--)a?n.push(i+s.toString()+r):n.push(s);else for(s=t;s<=e;s++)a?n.push(i+s.toString()+r):n.push(s);return n}},593(t,e,i){var r=i(2284);t.exports=function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=null),void 0===i&&(i=1),null===e&&(e=t,t=0);for(var s=[],n=Math.max(r((e-t)/(i||1)),0),a=0;ae?1:0}var r=function(t,s,n,a,o){for(void 0===n&&(n=0),void 0===a&&(a=t.length-1),void 0===o&&(o=i);a>n;){if(a-n>600){var h=a-n+1,l=s-n+1,u=Math.log(h),d=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*d*(h-d)/h)*(l-h/2<0?-1:1),f=Math.max(n,Math.floor(s-l*d/h+c)),p=Math.min(a,Math.floor(s+(h-l)*d/h+c));r(t,s,f,p,o)}var g=t[s],m=n,v=a;for(e(t,n,s),o(t[a],g)>0&&e(t,n,a);m0;)v--}0===o(t[n],g)?e(t,n,v):e(t,++v,a),v<=s&&(n=v+1),s<=v&&(a=v-1)}};t.exports=r},88492(t,e,i){var r=i(35154),s=i(33680),n=function(t,e,i){for(var r=[],s=0;s=0;){var h=e[a];-1!==(n=t.indexOf(h))&&(r(t,n),o.push(h),i&&i.call(s,h)),a--}return o}},60248(t,e,i){var r=i(19133);t.exports=function(t,e,i,s){if(void 0===s&&(s=t),e<0||e>t.length-1)throw new Error("Index out of bounds");var n=r(t,e);return i&&i.call(s,n),n}},81409(t,e,i){var r=i(82011);t.exports=function(t,e,i,s,n){if(void 0===e&&(e=0),void 0===i&&(i=t.length),void 0===n&&(n=t),r(t,e,i)){var a=i-e,o=t.splice(e,a);if(s)for(var h=0;h=s||e>=i||i>s){if(r)throw new Error("Range Error: Values outside acceptable range");return!1}return!0}},89545(t){t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i>0&&(t.splice(i,1),t.unshift(e)),e}},17810(t,e,i){var r=i(82011);t.exports=function(t,e,i,s,n){if(void 0===s&&(s=0),void 0===n&&(n=t.length),r(t,s,n))for(var a=s;a0;e--){var i=Math.floor(Math.random()*(e+1)),r=t[e];t[e]=t[i],t[i]=r}return t}},90126(t){t.exports=function(t){var e=/\D/g;return t.sort(function(t,i){return parseInt(t.replace(e,""),10)-parseInt(i.replace(e,""),10)}),t}},19133(t){t.exports=function(t,e){if(!(e>=t.length)){for(var i=t.length-1,r=t[e],s=e;sl&&(n=l),a>l&&(a=l),o=s,h=n;;)if(o-1;n--)r[s][n]=t[n][s]}return r}},54915(t,e,i){t.exports={CheckMatrix:i(86922),MatrixToString:i(63362),ReverseColumns:i(92598),ReverseRows:i(21224),Rotate180:i(98717),RotateLeft:i(44657),RotateMatrix:i(37829),RotateRight:i(92632),Translate:i(69512),TransposeMatrix:i(2429)}},71334(t){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";t.exports=function(t,i){for(var r=new Uint8Array(t),s=r.length,n=i?"data:"+i+";base64,":"",a=0;a>2],n+=e[(3&r[a])<<4|r[a+1]>>4],n+=e[(15&r[a+1])<<2|r[a+2]>>6],n+=e[63&r[a+2]];return s%3==2?n=n.substring(0,n.length-1)+"=":s%3==1&&(n=n.substring(0,n.length-2)+"=="),n}},53134(t){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=new Uint8Array(256),r=0;r<64;r++)i[e.charCodeAt(r)]=r;t.exports=function(t){var e,r,s,n,a=(t=t.substr(t.indexOf(",")+1)).length,o=.75*a,h=0;"="===t[a-1]&&(o--,"="===t[a-2]&&o--);for(var l=new ArrayBuffer(o),u=new Uint8Array(l),d=0;d>4,u[h++]=(15&r)<<4|s>>2,u[h++]=(3&s)<<6|63&n;return l}},65839(t,e,i){t.exports={ArrayBufferToBase64:i(71334),Base64ToArrayBuffer:i(53134)}},91799(t,e,i){t.exports={Array:i(37105),Base64:i(65839),Objects:i(1183),String:i(31749),NOOP:i(29747),NULL:i(20242)}},41786(t){t.exports=function(t){var e={};for(var i in t)Array.isArray(t[i])?e[i]=t[i].slice(0):e[i]=t[i];return e}},62644(t){var e=function(t){var i,r,s;if("object"!=typeof t||null===t)return t;for(s in i=Array.isArray(t)?[]:{},t)r=t[s],i[s]=e(r);return i};t.exports=e},79291(t,e,i){var r=i(41212),s=function(){var t,e,i,n,a,o,h=arguments[0]||{},l=1,u=arguments.length,d=!1;for("boolean"==typeof h&&(d=h,h=arguments[1]||{},l=2),u===l&&(h=this,--l);l=(t=t.toString()).length)switch(r){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var n=Math.ceil((s=e-t.length)/2);t=new Array(s-n+1).join(i)+t+new Array(n+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t}},33628(t){t.exports=function(t,e){return 0===e?t.slice(1):t.slice(0,e)+t.slice(e+1)}},27671(t){t.exports=function(t){return t.split("").reverse().join("")}},45650(t){t.exports=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})}},35355(t){t.exports=function(t){return t&&t[0].toUpperCase()+t.slice(1)}},31749(t,e,i){t.exports={Format:i(27902),Pad:i(41836),RemoveAt:i(33628),Reverse:i(27671),UppercaseFirst:i(35355),UUID:i(45650)}}},e={};function i(r){var s=e[r];if(void 0!==s)return s.exports;var n=e[r]={exports:{}};return t[r](n,n.exports,i),n.exports}return i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i(85454)})()); \ No newline at end of file +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Phaser",[],e):"object"==typeof exports?exports.Phaser=e():t.Phaser=e()}(this,()=>(()=>{var t={7889(t,e,i){"use strict";i.r(e),i.d(e,{Depth:()=>o,DepthDescriptors:()=>a,default:()=>h});var r=i(42969),s=i(37105),n=i.n(s);const a={_depth:0,depth:{get:function(){return this._depth},set:function(t){this.displayList&&this.displayList.queueDepthSort(),this._depth=t}},setDepth:function(t){return void 0===t&&(t=0),this.depth=t,this},setToTop:function(){const t=this.getDisplayList();return t&&n().BringToTop(t,this),this},setToBack:function(){const t=this.getDisplayList();return t&&n().SendToBack(t,this),this},setAbove:function(t){const e=this.getDisplayList();return e&&t&&n().MoveAbove(e,this,t),this},setBelow:function(t){const e=this.getDisplayList();return e&&t&&n().MoveBelow(e,this,t),this}},o=(0,r.lv)()(function(t){return(0,r.AD)(t,a),t}),h=o},36626(t,e,i){"use strict";i.r(e),i.d(e,{Visible:()=>n,VisibleDescriptors:()=>s,default:()=>a});var r=i(42969);const s={_visible:!0,visible:{get:function(){return this._visible},set:function(t){t?(this._visible=!0,this.renderFlags|=1):(this._visible=!1,this.renderFlags&=-2)}},setVisible:function(t){return this.visible=t,this}},n=(0,r.lv)()(function(t){return(0,r.AD)(t,s),t}),a=n},18134(t,e,i){"use strict";i.d(e,{default:()=>n});var r=i(70038);class s extends r.default{constructor(t,e,i,r){super(t,e),this.vx=0,this.vy=0,this.u=i,this.v=r}setUVs(t,e){return this.u=t,this.v=e,this}resize(t,e,i,r,s,n){return this.x=t,this.y=e,this.vx=this.x*i,this.vy=-this.y*r,s<.5?this.vx+=i*(.5-s):s>.5&&(this.vx-=i*(s-.5)),n<.5?this.vy+=r*(.5-n):n>.5&&(this.vy-=r*(n-.5)),this}}const n=s},58715(t,e,i){"use strict";i.d(e,{default:()=>T});var r=i(10312),s=i.n(r),n=i(96503),a=i.n(n),o=i(87902),h=i.n(o),l=i(31401),u=i.n(l),d=i(59428),c=i(72488),f=i(36626),p=i(7889),g=i(42969),m=i(95643);const v=i.n(m)(),y=(0,g.fP)(f.Visible,p.Depth)(v);class x extends y{constructor(t,e,i,r=1,n=r){super(t,"Zone"),this.setPosition(e,i),this.width=r,this.height=n,this.blendMode=s().NORMAL,this.updateDisplayOrigin()}get displayWidth(){return this.scaleX*this.width}set displayWidth(t){this.scaleX=t/this.width}get displayHeight(){return this.scaleY*this.height}set displayHeight(t){this.scaleY=t/this.height}setSize(t,e,i=!0){this.width=t,this.height=e,this.updateDisplayOrigin();const r=this.input;return i&&r&&!r.customHitArea&&(r.hitArea.width=t,r.hitArea.height=e),this}setDisplaySize(t,e){return this.displayWidth=t,this.displayHeight=e,this}setCircleDropZone(t){return this.setDropZone(new(a())(0,0,t),h())}setRectangleDropZone(t,e){return this.setDropZone(new d.Rectangle(0,0,t,e),c.Contains)}setDropZone(t,e){return this.input||this.setInteractive(t,e,!0),this}setAlpha(){}setBlendMode(){}renderCanvas(t,e,i){i.addToRenderList(e)}renderWebGL(t,e,i){i.camera.addToRenderList(e)}}(0,g.AD)(x,u().GetBounds),(0,g.AD)(x,u().Origin),(0,g.AD)(x,u().ScrollFactor),(0,g.AD)(x,u().Transform);const T=x},72488(t,e,i){"use strict";function r(t,e,i){return!(t.width<=0||t.height<=0)&&(t.x<=e&&t.x+t.width>=e&&t.y<=i&&t.y+t.height>=i)}i.r(e),i.d(e,{Contains:()=>r,default:()=>s});const s=r},59428(t,e,i){"use strict";i.r(e),i.d(e,{Rectangle:()=>p,default:()=>g});var r=i(72488),s=i(20812),n=i.n(s),a=i(34819),o=i.n(a),h=i(23777),l=i.n(h),u=i(23031),d=i.n(u),c=i(26597),f=i.n(c);class p{constructor(t=0,e=0,i=0,r=0){this.type=l().RECTANGLE,this.x=t,this.y=e,this.width=i,this.height=r}contains(t,e){return(0,r.default)(this,t,e)}getPoint(t,e){return n()(this,t,e)}getPoints(t,e,i){return o()(this,t,e,i)}getRandomPoint(t){return f()(this,t)}setTo(t,e,i,r){return this.x=t,this.y=e,this.width=i,this.height=r,this}setEmpty(){return this.setTo(0,0,0,0)}setPosition(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this}setSize(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this}isEmpty(){return this.width<=0||this.height<=0}getLineA(t){return void 0===t&&(t=new(d())),t.setTo(this.x,this.y,this.right,this.y),t}getLineB(t){return void 0===t&&(t=new(d())),t.setTo(this.right,this.y,this.right,this.bottom),t}getLineC(t){return void 0===t&&(t=new(d())),t.setTo(this.right,this.bottom,this.x,this.bottom),t}getLineD(t){return void 0===t&&(t=new(d())),t.setTo(this.x,this.bottom,this.x,this.y),t}get left(){return this.x}set left(t){t>=this.right?this.width=0:this.width=this.right-t,this.x=t}get right(){return this.x+this.width}set right(t){t<=this.x?this.width=0:this.width=t-this.x}get top(){return this.y}set top(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}get bottom(){return this.y+this.height}set bottom(t){t<=this.y?this.height=0:this.height=t-this.y}get centerX(){return this.x+this.width/2}set centerX(t){this.x=t-this.width/2}get centerY(){return this.y+this.height/2}set centerY(t){this.y=t-this.height/2}}const g=p},350(t,e,i){"use strict";i.d(e,{default:()=>r});const r=function(t,e,i){return Math.max(e,Math.min(i,t))}},70038(t,e,i){"use strict";i.d(e,{default:()=>n});var r=i(30010);const s=class t{constructor(t,e){this.x=0,this.y=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0):(void 0===e&&(e=t),this.x=t||0,this.y=e||0)}clone(){return new t(this.x,this.y)}copy(t){return this.x=t.x||0,this.y=t.y||0,this}setFromObject(t){return this.x=t.x||0,this.y=t.y||0,this}set(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this}setTo(t,e){return this.set(t,e)}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}invert(){return this.set(this.y,this.x)}setToPolar(t,e){return null==e&&(e=1),this.x=Math.cos(t)*e,this.y=Math.sin(t)*e,this}equals(t){return this.x===t.x&&this.y===t.y}fuzzyEquals(t,e){return(0,r.default)(this.x,t.x,e)&&(0,r.default)(this.y,t.y,e)}angle(){let t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t}setAngle(t){return this.setToPolar(t,this.length())}add(t){return this.x+=t.x,this.y+=t.y,this}subtract(t){return this.x-=t.x,this.y-=t.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}scale(t){return isFinite(t)?(this.x*=t,this.y*=t):(this.x=0,this.y=0),this}divide(t){return this.x/=t.x,this.y/=t.y,this}negate(){return this.x=-this.x,this.y=-this.y,this}distance(t){const e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)}distanceSq(t){const e=t.x-this.x,i=t.y-this.y;return e*e+i*i}length(){const t=this.x,e=this.y;return Math.sqrt(t*t+e*e)}setLength(t){return this.normalize().scale(t)}lengthSq(){const t=this.x,e=this.y;return t*t+e*e}normalize(){const t=this.x,e=this.y;let i=t*t+e*e;return i>0&&(i=1/Math.sqrt(i),this.x=t*i,this.y=e*i),this}normalizeRightHand(){const t=this.x;return this.x=-1*this.y,this.y=t,this}normalizeLeftHand(){const t=this.x;return this.x=this.y,this.y=-1*t,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lerp(t,e=0){const i=this.x,r=this.y;return this.x=i+e*(t.x-i),this.y=r+e*(t.y-r),this}transformMat3(t){const e=this.x,i=this.y,r=t.val;return this.x=r[0]*e+r[3]*i+r[6],this.y=r[1]*e+r[4]*i+r[7],this}transformMat4(t){const e=this.x,i=this.y,r=t.val;return this.x=r[0]*e+r[4]*i+r[12],this.y=r[1]*e+r[5]*i+r[13],this}reset(){return this.x=0,this.y=0,this}limit(t){const e=this.length();return e&&e>t&&this.scale(t/e),this}reflect(t){const e=t.clone().normalize();return this.subtract(e.scale(2*this.dot(e)))}mirror(t){return this.reflect(t).negate()}rotate(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e*this.x-i*this.y,i*this.x+e*this.y)}project(t){const e=this.dot(t)/t.dot(t);return this.copy(t).scale(e)}projectUnit(e,i){void 0===i&&(i=new t);const r=this.x*e.x+this.y*e.y;return 0!==r&&(i.x=r*e.x,i.y=r*e.y),i}};s.ZERO=new s,s.RIGHT=new s(1,0),s.LEFT=new s(-1,0),s.UP=new s(0,-1),s.DOWN=new s(0,1),s.ONE=new s(1,1);const n=s},68077(t,e,i){"use strict";i.d(e,{default:()=>r});const r=function(t,e,i){const r=i-e;return e+((t-e)%r+r)%r}},30010(t,e,i){"use strict";i.d(e,{default:()=>r});const r=function(t,e,i=1e-4){return Math.abs(t-e)s});const s=class{constructor(t){this.entries={},this.size=0,this.setAll(t)}setAll(t){if(Array.isArray(t))for(let e=0;et.reduce((t,e)=>e(t),e)}i.d(e,{AD:()=>s,fP:()=>a,lv:()=>n})},50792(t){"use strict";var e=Object.prototype.hasOwnProperty,i="~";function r(){}function s(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function n(t,e,r,n,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var o=new s(r,n||t,a),h=i?i+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],o]:t._events[h].push(o):(t._events[h]=o,t._eventsCount++),t}function a(t,e){0===--t._eventsCount?t._events=new r:delete t._events[e]}function o(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(i=!1)),o.prototype.eventNames=function(){var t,r,s=[];if(0===this._eventsCount)return s;for(r in t=this._events)e.call(t,r)&&s.push(i?r.slice(1):r);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(t)):s},o.prototype.listeners=function(t){var e=i?i+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var s=0,n=r.length,a=new Array(n);s3*Math.PI/2?p.y=1:l>Math.PI?(p.x=1,p.y=1):l>Math.PI/2&&(p.x=1);for(var g=[],m=0;m0&&u.enableFilters().filters.external.addBlur(e.blurQuality,e.blurRadius,e.blurRadius,1,void 0,e.blurSteps),d instanceof r&&d.enableFilters();var f=(e.useInternal?d.filters.internal:d.filters.external).addMask(u,e.invert);h.push(f)}return h}},11517(t,e,i){var r=i(38829);t.exports=function(t,e,i,s){for(var n=t[0],a=1;a=i;r--){var s=t[r],n=!0;for(var a in e)s[a]!==e[a]&&(n=!1);if(n)return s}return null}},94420(t,e,i){var r=i(11879),s=i(60461),n=i(95540),a=i(29747),o=new(i(41481))({sys:{queueDepthSort:a,events:{once:a}}},0,0,1,1).setOrigin(0,0);t.exports=function(t,e){void 0===e&&(e={});var i=e.hasOwnProperty("width"),a=e.hasOwnProperty("height"),h=n(e,"width",-1),l=n(e,"height",-1),u=n(e,"cellWidth",1),d=n(e,"cellHeight",u),c=n(e,"position",s.TOP_LEFT),f=n(e,"x",0),p=n(e,"y",0),g=0,m=0,v=h*u,y=l*d;o.setPosition(f,p),o.setSize(u,d);for(var x=0;x0?s(a,i):i<0&&n(a,Math.abs(i));for(var o=0;o=0;a--)t[a][e]+=i+o*r,o++;return t}},43967(t){t.exports=function(t,e,i,r,s,n){var a;void 0===r&&(r=0),void 0===s&&(s=0),void 0===n&&(n=1);var o=0,h=t.length;if(1===n)for(a=s;a=0;a--)t[a][e]=i+o*r,o++;return t}},88926(t,e,i){var r=i(28176);t.exports=function(t,e){for(var i=0;i=h||-1===l)){var c=t[l],f=c.x,p=c.y;c.x=a,c.y=o,a=f,o=p,0===s?l--:l++}}return n.x=a,n.y=o,n}},8628(t,e,i){var r=i(33680);t.exports=function(t){return r(t)}},21837(t,e,i){var r=i(7602);t.exports=function(t,e,i,s,n){void 0===n&&(n=!1);var a,o=Math.abs(s-i)/t.length;if(n)for(a=0;a0){if(0===t)this.frames=i.concat(this.frames);else if(t===this.frames.length)this.frames=this.frames.concat(i);else{var r=this.frames.slice(0,t),s=this.frames.slice(t);this.frames=r.concat(i,s)}this.updateFrameSequence()}return this},checkFrame:function(t){return t>=0&&t0){n.isLast=!0,n.nextFrame=d[0],d[0].prevFrame=n;var y=1/(d.length-1);for(a=0;a0?t.inReverse&&t.forward?t.forward=!1:this.repeatAnimation(t):t.complete():this.updateAndGetNextTick(t,e.nextFrame)},handleYoyoFrame:function(t,e){if(e||(e=!1),t.inReverse===!e&&t.repeatCounter>0)return(0===t.repeatDelay||t.pendingRepeat)&&(t.forward=e),void this.repeatAnimation(t);if(t.inReverse===e||0!==t.repeatCounter){t.forward=e;var i=e?t.currentFrame.nextFrame:t.currentFrame.prevFrame;this.updateAndGetNextTick(t,i)}else t.complete()},getLastFrame:function(){return this.frames[this.frames.length-1]},previousFrame:function(t){var e=t.currentFrame;e.isFirst?t.yoyo?this.handleYoyoFrame(t,!0):t.repeatCounter>0?(t.inReverse&&!t.forward||(t.forward=!0),this.repeatAnimation(t)):t.complete():this.updateAndGetNextTick(t,e.prevFrame)},updateAndGetNextTick:function(t,e){t.setCurrentFrame(e),this.getNextTick(t)},removeFrame:function(t){var e=this.frames.indexOf(t);return-1!==e&&this.removeFrameAt(e),this},removeFrameAt:function(t){return this.frames.splice(t,1),this.updateFrameSequence(),this},repeatAnimation:function(t){if(2===t._pendingStop){if(0===t._pendingStopValue)return t.stop();t._pendingStopValue--}t.repeatDelay>0&&!t.pendingRepeat?(t.pendingRepeat=!0,t.accumulator-=t.nextTick,t.nextTick+=t.repeatDelay):(t.repeatCounter--,t.forward?t.setCurrentFrame(t.currentFrame.nextFrame):t.setCurrentFrame(t.currentFrame.prevFrame),t.isPlaying&&(this.getNextTick(t),t.handleRepeat()))},toJSON:function(){var t={key:this.key,type:this.type,frames:[],frameRate:this.frameRate,duration:this.duration,skipMissedFrames:this.skipMissedFrames,delay:this.delay,repeat:this.repeat,repeatDelay:this.repeatDelay,yoyo:this.yoyo,showBeforeDelay:this.showBeforeDelay,showOnStart:this.showOnStart,randomFrame:this.randomFrame,hideOnComplete:this.hideOnComplete};return this.frames.forEach(function(e){t.frames.push(e.toJSON())}),t},updateFrameSequence:function(){for(var t,e=this.frames.length,i=1/(e-1),r=0;r1?(t.isLast=!0,t.prevFrame=this.frames[e-2],t.nextFrame=this.frames[0]):e>1&&(t.prevFrame=this.frames[r-1],t.nextFrame=this.frames[r+1]);return this},pause:function(){return this.paused=!0,this},resume:function(){return this.paused=!1,this},destroy:function(){this.manager.off&&(this.manager.off(n.PAUSE_ALL,this.pause,this),this.manager.off(n.RESUME_ALL,this.resume,this)),this.manager.remove(this.key);for(var t=0;t-1)){for(var p=0,g=u;g<=c;g++){var m=g.toString(),v=o[m];if(v){var y=l(v,"duration",d.MAX_SAFE_INTEGER);a.push({key:t,frame:m,duration:y}),p+=y}}"reverse"===f&&(a=a.reverse());var x,T={key:h,frames:a,duration:p,yoyo:"pingpong"===f};i?i.anims&&(x=i.anims.create(T)):x=n.create(T),x&&r.push(x)}});return r},create:function(t){var e=t.key,i=!1;return e&&((i=this.get(e))?console.warn("AnimationManager key already exists: "+e):(i=new r(this,e,t),this.anims.set(e,i),this.emit(o.ADD_ANIMATION,e,i))),i},fromJSON:function(t,e){void 0===e&&(e=!1),e&&this.anims.clear(),"string"==typeof t&&(t=JSON.parse(t));var i=[];if(t.hasOwnProperty("anims")&&Array.isArray(t.anims)){for(var r=0;rn&&(l=0),this.randomFrame&&(l=s(0,n-1));var u=r.frames[l];0!==l||this.forward||(u=r.getLastFrame()),this.currentFrame=u}else console.warn("Missing animation: "+i);return this.parent},pause:function(t){return this._paused||(this._paused=!0,this._wasPlaying=this.isPlaying,this.isPlaying=!1),void 0!==t&&this.setCurrentFrame(t),this.parent},resume:function(t){return this._paused&&(this._paused=!1,this.isPlaying=this._wasPlaying),void 0!==t&&this.setCurrentFrame(t),this.parent},playAfterDelay:function(t,e){if(this.isPlaying){var i=this.nextAnim,r=this.nextAnimsQueue;i&&r.unshift(i),this.nextAnim=t,this._pendingStop=1,this._pendingStopValue=e}else this.delayCounter=e,this.play(t,!0);return this.parent},playAfterRepeat:function(t,e){if(void 0===e&&(e=1),this.isPlaying){var i=this.nextAnim,r=this.nextAnimsQueue;i&&r.unshift(i),-1!==this.repeatCounter&&e>this.repeatCounter&&(e=this.repeatCounter),this.nextAnim=t,this._pendingStop=2,this._pendingStopValue=e}else this.play(t);return this.parent},play:function(t,e){void 0===e&&(e=!1);var i=this.currentAnim,r=this.parent,s="string"==typeof t?t:t.key;if(e&&this.isPlaying&&i.key===s)return r;if(i&&this.isPlaying){var n=this.animationManager.getMix(i.key,t);if(n>0)return this.playAfterDelay(t,n)}return this.forward=!0,this.inReverse=!1,this._paused=!1,this._wasPlaying=!0,this.startAnimation(t)},playReverse:function(t,e){void 0===e&&(e=!1);var i="string"==typeof t?t:t.key;return e&&this.isPlaying&&this.currentAnim.key===i?this.parent:(this.forward=!1,this.inReverse=!0,this._paused=!1,this._wasPlaying=!0,this.startAnimation(t))},startAnimation:function(t){this.load(t);var e=this.currentAnim,i=this.parent;return e?(this.repeatCounter=-1===this.repeat?Number.MAX_VALUE:this.repeat,e.getFirstTick(this),this.isPlaying=!0,this.pendingRepeat=!1,this.hasStarted=!1,this._pendingStop=0,this._pendingStopValue=0,this._paused=!1,this.delayCounter+=this.delay,0===this.delayCounter?this.handleStart():this.showBeforeDelay&&this.setCurrentFrame(this.currentFrame),i):i},handleStart:function(){this.showOnStart&&this.parent.setVisible(!0),this.setCurrentFrame(this.currentFrame),this.hasStarted=!0,this.emitEvents(o.ANIMATION_START)},handleRepeat:function(){this.pendingRepeat=!1,this.emitEvents(o.ANIMATION_REPEAT)},handleStop:function(){this._pendingStop=0,this.isPlaying=!1,this.emitEvents(o.ANIMATION_STOP)},handleComplete:function(){this._pendingStop=0,this.isPlaying=!1,this.hideOnComplete&&this.parent.setVisible(!1),this.emitEvents(o.ANIMATION_COMPLETE,o.ANIMATION_COMPLETE_KEY)},emitEvents:function(t,e){var i=this.currentAnim;if(i){var r=this.currentFrame,s=this.parent,n=r.textureFrame;s.emit(t,i,r,s,n),e&&s.emit(e+i.key,i,r,s,n)}},reverse:function(){return this.isPlaying&&(this.inReverse=!this.inReverse,this.forward=!this.forward),this.parent},getProgress:function(){var t=this.currentFrame;if(!t)return 0;var e=t.progress;return this.inReverse&&(e*=-1),e},setProgress:function(t){return this.forward||(t=1-t),this.setCurrentFrame(this.currentAnim.getFrameByProgress(t)),this.parent},setRepeat:function(t){return this.repeatCounter=-1===t?Number.MAX_VALUE:t,this.parent},globalRemove:function(t,e){void 0===e&&(e=this.currentAnim),this.isPlaying&&e.key===this.currentAnim.key&&(this.stop(),this.setCurrentFrame(this.currentAnim.frames[0]))},restart:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1);var i=this.currentAnim,r=this.parent;return i?(e&&(this.repeatCounter=-1===this.repeat?Number.MAX_VALUE:this.repeat),i.getFirstTick(this),this.emitEvents(o.ANIMATION_RESTART),this.isPlaying=!0,this.pendingRepeat=!1,this.hasStarted=!t,this._pendingStop=0,this._pendingStopValue=0,this._paused=!1,this.setCurrentFrame(i.frames[0]),this.parent):r},complete:function(){if(this._pendingStop=0,this.isPlaying=!1,this.currentAnim&&this.handleComplete(),this.nextAnim){var t=this.nextAnim;this.nextAnim=this.nextAnimsQueue.length>0?this.nextAnimsQueue.shift():null,this.play(t)}return this.parent},stop:function(){if(this._pendingStop=0,this.isPlaying=!1,this.delayCounter=0,this.currentAnim&&this.handleStop(),this.nextAnim){var t=this.nextAnim;this.nextAnim=this.nextAnimsQueue.shift(),this.play(t)}return this.parent},stopAfterDelay:function(t){return this._pendingStop=1,this._pendingStopValue=t,this.parent},stopAfterRepeat:function(t){return void 0===t&&(t=1),-1!==this.repeatCounter&&t>this.repeatCounter&&(t=this.repeatCounter),this._pendingStop=2,this._pendingStopValue=t,this.parent},stopOnFrame:function(t){return this._pendingStop=3,this._pendingStopValue=t,this.parent},getTotalFrames:function(){return this.currentAnim?this.currentAnim.getTotalFrames():0},update:function(t,e){var i=this.currentAnim;if(this.isPlaying&&i&&!i.paused){if(this.accumulator+=e*this.timeScale*this.animationManager.globalTimeScale,1===this._pendingStop&&(this._pendingStopValue-=e,this._pendingStopValue<=0))return this.stop();if(this.hasStarted){if(this.accumulator>=this.nextTick&&(this.forward?i.nextFrame(this):i.previousFrame(this),this.isPlaying&&0===this._pendingStop&&this.skipMissedFrames&&this.accumulator>this.nextTick)){var r=0;do{this.forward?i.nextFrame(this):i.previousFrame(this),r++}while(this.isPlaying&&this.accumulator>this.nextTick&&r<60)}}else this.accumulator>=this.delayCounter&&(this.accumulator-=this.delayCounter,this.handleStart())}},setCurrentFrame:function(t){var e=this.parent;return this.currentFrame=t,e.texture=t.frame.texture,e.frame=t.frame,e.isCropped&&e.frame.updateCropUVs(e._crop,e.flipX,e.flipY),t.setAlpha&&(e.alpha=t.alpha),e.setSizeToFrame(),e._originComponent&&(t.frame.customPivot?e.setOrigin(t.frame.pivotX,t.frame.pivotY):e.updateDisplayOrigin()),this.isPlaying&&this.hasStarted&&(this.emitEvents(o.ANIMATION_UPDATE),3===this._pendingStop&&this._pendingStopValue===t&&this.stop()),e},nextFrame:function(){return this.currentAnim&&this.currentAnim.nextFrame(this),this.parent},previousFrame:function(){return this.currentAnim&&this.currentAnim.previousFrame(this),this.parent},get:function(t){return this.anims?this.anims.get(t):null},exists:function(t){return!!this.anims&&this.anims.has(t)},create:function(t){var e=t.key,i=!1;return e&&((i=this.get(e))?console.warn("Animation key already exists: "+e):(i=new r(this,e,t),this.anims||(this.anims=new a),this.anims.set(e,i))),i},createFromAseprite:function(t,e){return this.animationManager.createFromAseprite(t,e,this.parent)},generateFrameNames:function(t,e){return this.animationManager.generateFrameNames(t,e)},generateFrameNumbers:function(t,e){return this.animationManager.generateFrameNumbers(t,e)},remove:function(t){var e=this.get(t);return e&&(this.currentAnim===e&&this.stop(),this.anims.delete(t)),e},destroy:function(){this.animationManager.off(o.REMOVE_ANIMATION,this.globalRemove,this),this.anims&&this.anims.clear(),this.animationManager=null,this.parent=null,this.nextAnim=null,this.nextAnimsQueue.length=0,this.currentAnim=null,this.currentFrame=null},isPaused:{get:function(){return this._paused}}});t.exports=l},57090(t){t.exports="add"},25312(t){t.exports="animationcomplete"},89580(t){t.exports="animationcomplete-"},52860(t){t.exports="animationrepeat"},63850(t){t.exports="animationrestart"},99085(t){t.exports="animationstart"},28087(t){t.exports="animationstop"},1794(t){t.exports="animationupdate"},52562(t){t.exports="pauseall"},57953(t){t.exports="remove"},68339(t){t.exports="resumeall"},74943(t,e,i){t.exports={ADD_ANIMATION:i(57090),ANIMATION_COMPLETE:i(25312),ANIMATION_COMPLETE_KEY:i(89580),ANIMATION_REPEAT:i(52860),ANIMATION_RESTART:i(63850),ANIMATION_START:i(99085),ANIMATION_STOP:i(28087),ANIMATION_UPDATE:i(1794),PAUSE_ALL:i(52562),REMOVE_ANIMATION:i(57953),RESUME_ALL:i(68339)}},60421(t,e,i){t.exports={Animation:i(42099),AnimationFrame:i(41138),AnimationManager:i(60848),AnimationState:i(9674),Events:i(74943)}},2161(t,e,i){var r=i(83419),s=i(90330),n=i(50792),a=i(24736),o=new r({initialize:function(){this.entries=new s,this.events=new n},add:function(t,e){return this.entries.set(t,e),this.events.emit(a.ADD,this,t,e),this},has:function(t){return this.entries.has(t)},exists:function(t){return this.entries.has(t)},get:function(t){return this.entries.get(t)},remove:function(t){var e=this.get(t);return e&&(this.entries.delete(t),this.events.emit(a.REMOVE,this,t,e.data)),this},getKeys:function(){return this.entries.keys()},destroy:function(){this.entries.clear(),this.events.removeAllListeners(),this.entries=null,this.events=null}});t.exports=o},24047(t,e,i){var r=i(2161),s=i(83419),n=i(8443),a=new s({initialize:function(t){this.game=t,this.binary=new r,this.bitmapFont=new r,this.json=new r,this.physics=new r,this.shader=new r,this.audio=new r,this.video=new r,this.text=new r,this.html=new r,this.tilemap=new r,this.xml=new r,this.atlas=new r,this.custom={},this.game.events.once(n.DESTROY,this.destroy,this)},addCustom:function(t){return this.custom.hasOwnProperty(t)||(this.custom[t]=new r),this.custom[t]},destroy:function(){for(var t=["binary","bitmapFont","json","physics","shader","audio","video","text","html","tilemap","xml","atlas"],e=0;ef&&w*i+b*sd&&w*r+b*ns&&(t=s),t},clampY:function(t){var e=this._bounds,i=this.displayHeight,r=e.y+(i-this.height)/2,s=Math.max(r,r+e.height-i);return ts&&(t=s),t},removeBounds:function(){return this.useBounds=!1,this.dirty=!0,this._bounds.setEmpty(),this},setAngle:function(t){return void 0===t&&(t=0),this.rotation=s(t),this},setBackgroundColor:function(t){return void 0===t&&(t="rgba(0,0,0,0)"),this.backgroundColor=d(t),this.transparent=0===this.backgroundColor.alpha,this},setBounds:function(t,e,i,r,s){return void 0===s&&(s=!1),this._bounds.setTo(t,e,i,r),this.dirty=!0,this.useBounds=!0,s?this.centerToBounds():(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},setForceComposite:function(t){return this.forceComposite=t,this},getBounds:function(t){void 0===t&&(t=new o);var e=this._bounds;return t.setTo(e.x,e.y,e.width,e.height),t},setName:function(t){return void 0===t&&(t=""),this.name=t,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setRoundPixels:function(t){return this.roundPixels=t,this},setScene:function(t,e){void 0===e&&(e=!0),this.scene&&this._customViewport&&this.sceneManager.customViewports--,this.scene=t,this.isSceneCamera=e;var i=t.sys;return this.sceneManager=i.game.scene,this.scaleManager=i.scale,this.cameraManager=i.cameras,this.updateSystem(),this},setScroll:function(t,e){return void 0===e&&(e=t),this.scrollX=t,this.scrollY=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},setViewport:function(t,e,i,r){return this.x=t,this.y=e,this.width=i,this.height=r,this},setZoom:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),0===t&&(t=.001),0===e&&(e=.001),this.zoomX=t,this.zoomY=e,this},setMask:function(t,e){return void 0===e&&(e=!0),this.mask=t,this._maskCamera=e?this.cameraManager.default:this,this},clearMask:function(t){return void 0===t&&(t=!1),t&&this.mask&&this.mask.destroy(),this.mask=null,this},toJSON:function(){var t={name:this.name,x:this.x,y:this.y,width:this.width,height:this.height,zoom:this.zoom,rotation:this.rotation,roundPixels:this.roundPixels,scrollX:this.scrollX,scrollY:this.scrollY,backgroundColor:this.backgroundColor.rgba};return this.useBounds&&(t.bounds={x:this._bounds.x,y:this._bounds.y,width:this._bounds.width,height:this._bounds.height}),t},update:function(){},setIsSceneCamera:function(t){return this.isSceneCamera=t,this},updateSystem:function(){if(this.scaleManager&&this.isSceneCamera){var t=0!==this._x||0!==this._y||this.scaleManager.width!==this._width||this.scaleManager.height!==this._height,e=this.sceneManager;t&&!this._customViewport?e.customViewports++:!t&&this._customViewport&&e.customViewports--,this.dirty=!0,this._customViewport=t}},destroy:function(){this.emit(a.DESTROY,this),this.removeAllListeners(),this.matrix.destroy(),this.matrixCombined.destroy(),this.matrixExternal.destroy(),this.culledObjects=[],this._customViewport&&this.sceneManager.customViewports--,this.renderList=[],this._bounds=null,this.scene=null,this.scaleManager=null,this.sceneManager=null,this.cameraManager=null},x:{get:function(){return this._x},set:function(t){this._x=t,this.updateSystem()}},y:{get:function(){return this._y},set:function(t){this._y=t,this.updateSystem()}},width:{get:function(){return this._width},set:function(t){this._width=t,this.updateSystem()}},height:{get:function(){return this._height},set:function(t){this._height=t,this.updateSystem()}},scrollX:{get:function(){return this._scrollX},set:function(t){t!==this._scrollX&&(this._scrollX=t,this.dirty=!0)}},scrollY:{get:function(){return this._scrollY},set:function(t){t!==this._scrollY&&(this._scrollY=t,this.dirty=!0)}},zoom:{get:function(){return(this._zoomX+this._zoomY)/2},set:function(t){this._zoomX=t,this._zoomY=t,this.dirty=!0}},zoomX:{get:function(){return this._zoomX},set:function(t){this._zoomX=t,this.dirty=!0}},zoomY:{get:function(){return this._zoomY},set:function(t){this._zoomY=t,this.dirty=!0}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=t,this.dirty=!0}},centerX:{get:function(){return this.x+.5*this.width}},centerY:{get:function(){return this.y+.5*this.height}},displayWidth:{get:function(){return this.width/this.zoomX}},displayHeight:{get:function(){return this.height/this.zoomY}}});t.exports=f},38058(t,e,i){var r=i(71911),s=i(67502),n=i(45319),a=i(83419),o=i(31401),h=i(20052),l=i(19715),u=i(28915),d=i(87841),c=i(26099),f=new a({Extends:r,initialize:function(t,e,i,s){r.call(this,t,e,i,s),this.filters={internal:new o.FilterList(this),external:new o.FilterList(this)},this.isObjectInversion=!1,this.inputEnabled=!0,this.fadeEffect=new h.Fade(this),this.flashEffect=new h.Flash(this),this.shakeEffect=new h.Shake(this),this.panEffect=new h.Pan(this),this.rotateToEffect=new h.RotateTo(this),this.zoomEffect=new h.Zoom(this),this.lerp=new c(1,1),this.followOffset=new c,this.deadzone=null,this._follow=null},setDeadzone:function(t,e){if(void 0===t)this.deadzone=null;else{if(this.deadzone?(this.deadzone.width=t,this.deadzone.height=e):this.deadzone=new d(0,0,t,e),this._follow){var i=this.width/2,r=this.height/2,n=this._follow.x-this.followOffset.x,a=this._follow.y-this.followOffset.y;this.midPoint.set(n,a),this.scrollX=n-i,this.scrollY=a-r}s(this.deadzone,this.midPoint.x,this.midPoint.y)}return this},fadeIn:function(t,e,i,r,s,n){return this.fadeEffect.start(!1,t,e,i,r,!0,s,n)},fadeOut:function(t,e,i,r,s,n){return this.fadeEffect.start(!0,t,e,i,r,!0,s,n)},fadeFrom:function(t,e,i,r,s,n,a){return this.fadeEffect.start(!1,t,e,i,r,s,n,a)},fade:function(t,e,i,r,s,n,a){return this.fadeEffect.start(!0,t,e,i,r,s,n,a)},flash:function(t,e,i,r,s,n,a){return this.flashEffect.start(t,e,i,r,s,n,a)},shake:function(t,e,i,r,s){return this.shakeEffect.start(t,e,i,r,s)},pan:function(t,e,i,r,s,n,a){return this.panEffect.start(t,e,i,r,s,n,a)},rotateTo:function(t,e,i,r,s,n,a){return this.rotateToEffect.start(t,e,i,r,s,n,a)},zoomTo:function(t,e,i,r,s,n){return this.zoomEffect.start(t,e,i,r,s,n)},preRender:function(){this.renderList.length=0;var t=this.width,e=this.height,i=.5*t,r=.5*e,n=this.zoomX,a=this.zoomY;this.renderRoundPixels=this.roundPixels&&Number.isInteger(n)&&Number.isInteger(a);var o=t*this.originX,h=e*this.originY,d=this._follow,c=this.deadzone,f=this.scrollX,p=this.scrollY;c&&s(c,this.midPoint.x,this.midPoint.y);var g=!1;if(d&&!this.panEffect.isRunning){var m=this.lerp,v=d.x-this.followOffset.x,y=d.y-this.followOffset.y;c?(vc.right&&(f=u(f,f+(v-c.right),m.x)),yc.bottom&&(p=u(p,p+(y-c.bottom),m.y))):(f=u(f,v-o,m.x),p=u(p,y-h,m.y)),g=!0}this.useBounds&&(f=this.clampX(f),p=this.clampY(p)),this.scrollX=f,this.scrollY=p;var x=f+i,T=p+r;this.midPoint.set(x,T);var w=t/n,b=e/a,S=x-w/2,C=T-b/2;this.worldView.setTo(S,C,w,b);var E=this.matrix,A=this.matrixExternal;this.isObjectInversion?(E.loadIdentity(),E.translate(o,h),E.scale(n,a),E.rotate(this.rotation),E.translate(-f-o,-p-h)):(E.applyITRS(o,h,this.rotation,n,a),E.translate(-f-o,-p-h)),A.applyITRS(this.x,this.y,0,1,1),this.shakeEffect.preRender(),A.multiply(E,this.matrixCombined),g&&this.emit(l.FOLLOW_UPDATE,this,d)},getViewMatrix:function(t){return t||this.forceComposite||this.filters.external.length>0||this.filters.internal.length>0?this.matrix:this.matrixCombined},getPaddingWrapper:function(t){var e={padding:0},i=new Proxy(this,{get:function(t,i){switch(i){case"padding":return e.padding;case"x":case"y":case"scrollX":case"scrollY":return t[i]+e.padding;case"width":case"height":return t[i]-2*e.padding;default:return t[i]}},set:function(i,r,s){switch(r){case"padding":var n=e.padding;e.padding=s;var a=e.padding-n;return i.x-=a,i.y-=a,i.width+=2*a,i.height+=2*a,i.scrollX-=a,i.scrollY-=a,t;case"x":case"y":case"scrollX":case"scrollY":return i[r]=s-e.padding;case"width":case"height":return i[r]=s+2*e.padding;default:return i[r]=s}}});return i.padding=t||0,i},setLerp:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.lerp.set(t,e),this},setFollowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),this.followOffset.set(t,e),this},startFollow:function(t,e,i,r,s,a){void 0===e&&(e=!1),void 0===i&&(i=1),void 0===r&&(r=i),void 0===s&&(s=0),void 0===a&&(a=s),this._follow=t,this.roundPixels=e,i=n(i,0,1),r=n(r,0,1),this.lerp.set(i,r),this.followOffset.set(s,a);var o=this.width/2,h=this.height/2,l=t.x-s,u=t.y-a;return this.midPoint.set(l,u),this.scrollX=l-o,this.scrollY=u-h,this.useBounds&&(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},stopFollow:function(){return this._follow=null,this},resetFX:function(){return this.rotateToEffect.reset(),this.panEffect.reset(),this.shakeEffect.reset(),this.flashEffect.reset(),this.fadeEffect.reset(),this},update:function(t,e){this.visible&&(this.rotateToEffect.update(t,e),this.panEffect.update(t,e),this.zoomEffect.update(t,e),this.shakeEffect.update(t,e),this.flashEffect.update(t,e),this.fadeEffect.update(t,e))},destroy:function(){this.resetFX(),this.filters.internal.destroy(),this.filters.external.destroy(),r.prototype.destroy.call(this),this._follow=null,this.deadzone=null}});t.exports=f},32743(t,e,i){var r=i(38058),s=i(83419),n=i(95540),a=i(37277),o=i(37303),h=i(97480),l=i(44594),u=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.roundPixels=t.sys.game.config.roundPixels,this.cameras=[],this.main,this.default,t.sys.events.once(l.BOOT,this.boot,this),t.sys.events.on(l.START,this.start,this)},boot:function(){var t=this.systems;t.settings.cameras?this.fromJSON(t.settings.cameras):this.add(),this.main=this.cameras[0],this.default=new r(0,0,t.scale.width,t.scale.height).setScene(this.scene),t.game.scale.on(h.RESIZE,this.onResize,this),this.systems.events.once(l.DESTROY,this.destroy,this)},start:function(){if(!this.main){var t=this.systems;t.settings.cameras?this.fromJSON(t.settings.cameras):this.add(),this.main=this.cameras[0]}var e=this.systems.events;e.on(l.UPDATE,this.update,this),e.once(l.SHUTDOWN,this.shutdown,this)},add:function(t,e,i,s,n,a){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===s&&(s=this.scene.sys.scale.height),void 0===n&&(n=!1),void 0===a&&(a="");var o=new r(t,e,i,s);return o.setName(a),o.setScene(this.scene),o.setRoundPixels(this.roundPixels),o.id=this.getNextID(),this.cameras.push(o),n&&(this.main=o),o},addExisting:function(t,e){return void 0===e&&(e=!1),-1===this.cameras.indexOf(t)?(t.id=this.getNextID(),t.setRoundPixels(this.roundPixels),this.cameras.push(t),e&&(this.main=t),t):null},getNextID:function(){for(var t=this.cameras,e=1,i=0;i<32;i++){for(var r=!1,s=0;s0){n.preRender();var a=this.getVisibleChildren(e.getChildren(),n);t.render(i,a,n)}}},getVisibleChildren:function(t,e){return t.filter(function(t){return t.willRender(e)})},resetAll:function(){for(var t=0;t=0}else this.clockwise=this.destination>=this.source;return this.camera.emit(n.ROTATE_START,this.camera,this,i,this.destination),u},update:function(t,e){if(this.isRunning){this._elapsed+=e;var i=r(this._elapsed/this.duration,0,1);this.progress=i;var s=this.camera;if(this._elapsedthis.maxZoom&&(e.zoom=this.maxZoom))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=n},58818(t,e,i){var r=i(83419),s=i(35154),n=new r({initialize:function(t){this.camera=s(t,"camera",null),this.left=s(t,"left",null),this.right=s(t,"right",null),this.up=s(t,"up",null),this.down=s(t,"down",null),this.zoomIn=s(t,"zoomIn",null),this.zoomOut=s(t,"zoomOut",null),this.zoomSpeed=s(t,"zoomSpeed",.01),this.minZoom=s(t,"minZoom",.001),this.maxZoom=s(t,"maxZoom",1e3),this.accelX=0,this.accelY=0;var e=s(t,"acceleration",null);"number"==typeof e?(this.accelX=e,this.accelY=e):(this.accelX=s(t,"acceleration.x",0),this.accelY=s(t,"acceleration.y",0)),this.dragX=0,this.dragY=0;var i=s(t,"drag",null);"number"==typeof i?(this.dragX=i,this.dragY=i):(this.dragX=s(t,"drag.x",0),this.dragY=s(t,"drag.y",0)),this.maxSpeedX=0,this.maxSpeedY=0;var r=s(t,"maxSpeed",null);"number"==typeof r?(this.maxSpeedX=r,this.maxSpeedY=r):(this.maxSpeedX=s(t,"maxSpeed.x",0),this.maxSpeedY=s(t,"maxSpeed.y",0)),this._speedX=0,this._speedY=0,this._zoom=0,this.active=null!==this.camera},start:function(){return this.active=null!==this.camera,this},stop:function(){return this.active=!1,this},setCamera:function(t){return this.camera=t,this},update:function(t){if(this.active){void 0===t&&(t=1);var e=this.camera;this._speedX>0?(this._speedX-=this.dragX*t,this._speedX<0&&(this._speedX=0)):this._speedX<0&&(this._speedX+=this.dragX*t,this._speedX>0&&(this._speedX=0)),this._speedY>0?(this._speedY-=this.dragY*t,this._speedY<0&&(this._speedY=0)):this._speedY<0&&(this._speedY+=this.dragY*t,this._speedY>0&&(this._speedY=0)),this.up&&this.up.isDown?(this._speedY+=this.accelY,this._speedY>this.maxSpeedY&&(this._speedY=this.maxSpeedY)):this.down&&this.down.isDown&&(this._speedY-=this.accelY,this._speedY<-this.maxSpeedY&&(this._speedY=-this.maxSpeedY)),this.left&&this.left.isDown?(this._speedX+=this.accelX,this._speedX>this.maxSpeedX&&(this._speedX=this.maxSpeedX)):this.right&&this.right.isDown&&(this._speedX-=this.accelX,this._speedX<-this.maxSpeedX&&(this._speedX=-this.maxSpeedX)),this.zoomIn&&this.zoomIn.isDown?this._zoom=-this.zoomSpeed:this.zoomOut&&this.zoomOut.isDown?this._zoom=this.zoomSpeed:this._zoom=0,0!==this._speedX&&(e.scrollX-=this._speedX*t|0),0!==this._speedY&&(e.scrollY-=this._speedY*t|0),0!==this._zoom&&(e.zoom+=this._zoom,e.zoomthis.maxZoom&&(e.zoom=this.maxZoom))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=n},38865(t,e,i){t.exports={FixedKeyControl:i(63091),SmoothedKeyControl:i(58818)}},26638(t,e,i){t.exports={Controls:i(38865),Scene2D:i(87969)}},8054(t,e,i){var r={VERSION:"4.1.0",LOG_VERSION:"v401",BlendModes:i(10312),ScaleModes:i(29795),AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,FOREVER:-1,NONE:4,UP:5,DOWN:6,LEFT:7,RIGHT:8};t.exports=r},69547(t,e,i){var r=i(83419),s=i(8054),n=i(42363),a=i(82264),o=i(95540),h=i(35154),l=i(41212),u=i(29747),d=i(75508),c=i(80333),f=new r({initialize:function(t){void 0===t&&(t={});var e=h(t,"scale",null);this.width=h(e,"width",1024,t),this.height=h(e,"height",768,t),this.zoom=h(e,"zoom",1,t),this.parent=h(e,"parent",void 0,t),this.scaleMode=h(e,e?"mode":"scaleMode",0,t),this.expandParent=h(e,"expandParent",!0,t),this.autoRound=h(e,"autoRound",!1,t),this.autoCenter=h(e,"autoCenter",0,t),this.resizeInterval=h(e,"resizeInterval",500,t),this.fullscreenTarget=h(e,"fullscreenTarget",null,t),this.minWidth=h(e,"min.width",0,t),this.maxWidth=h(e,"max.width",0,t),this.minHeight=h(e,"min.height",0,t),this.maxHeight=h(e,"max.height",0,t),this.snapWidth=h(e,"snap.width",0,t),this.snapHeight=h(e,"snap.height",0,t),this.renderType=h(t,"type",s.AUTO),this.canvas=h(t,"canvas",null),this.context=h(t,"context",null),this.canvasStyle=h(t,"canvasStyle",null),this.customEnvironment=h(t,"customEnvironment",!1),this.sceneConfig=h(t,"scene",null),this.seed=h(t,"seed",[(Date.now()*Math.random()).toString()]),d.RND=new d.RandomDataGenerator(this.seed),this.gameTitle=h(t,"title",""),this.gameURL=h(t,"url","https://phaser.io/"+s.LOG_VERSION),this.gameVersion=h(t,"version",""),this.autoFocus=h(t,"autoFocus",!0),this.stableSort=h(t,"stableSort",-1),-1===this.stableSort&&(this.stableSort=a.browser.es2019?1:0),a.features.stableSort=this.stableSort,this.domCreateContainer=h(t,"dom.createContainer",!1),this.domPointerEvents=h(t,"dom.pointerEvents","none"),this.inputKeyboard=h(t,"input.keyboard",!0),this.inputKeyboardEventTarget=h(t,"input.keyboard.target",window),this.inputKeyboardCapture=h(t,"input.keyboard.capture",[]),this.inputMouse=h(t,"input.mouse",!0),this.inputMouseEventTarget=h(t,"input.mouse.target",null),this.inputMousePreventDefaultDown=h(t,"input.mouse.preventDefaultDown",!0),this.inputMousePreventDefaultUp=h(t,"input.mouse.preventDefaultUp",!0),this.inputMousePreventDefaultMove=h(t,"input.mouse.preventDefaultMove",!0),this.inputMousePreventDefaultWheel=h(t,"input.mouse.preventDefaultWheel",!0),this.inputTouch=h(t,"input.touch",a.input.touch),this.inputTouchEventTarget=h(t,"input.touch.target",null),this.inputTouchCapture=h(t,"input.touch.capture",!0),this.inputActivePointers=h(t,"input.activePointers",1),this.inputSmoothFactor=h(t,"input.smoothFactor",0),this.inputWindowEvents=h(t,"input.windowEvents",!0),this.inputGamepad=h(t,"input.gamepad",!1),this.inputGamepadEventTarget=h(t,"input.gamepad.target",window),this.disableContextMenu=h(t,"disableContextMenu",!1),this.audio=h(t,"audio",{}),this.hideBanner=!1===h(t,"banner",null),this.hidePhaser=h(t,"banner.hidePhaser",!1),this.bannerTextColor=h(t,"banner.text","#ffffff"),this.bannerBackgroundColor=h(t,"banner.background",["#000814","#001d3d","#003566"]),""===this.gameTitle&&this.hidePhaser&&(this.hideBanner=!0),this.fps=h(t,"fps",null);var i=h(t,"render",null);this.autoMobileTextures=h(i,"autoMobileTextures",!0,t),this.antialias=h(i,"antialias",!0,t),this.antialiasGL=h(i,"antialiasGL",!0,t),this.mipmapFilter=h(i,"mipmapFilter","",t),this.mipmapRegeneration=h(i,"mipmapRegeneration",!1,t),this.desynchronized=h(i,"desynchronized",!1,t),this.roundPixels=h(i,"roundPixels",!1,t),this.selfShadow=h(i,"selfShadow",!1,t),this.pathDetailThreshold=h(i,"pathDetailThreshold",1,t),this.pixelArt=h(i,"pixelArt",!1,t),this.pixelArt&&(this.antialias=!1,this.antialiasGL=!1,this.roundPixels=!0),this.smoothPixelArt=h(i,"smoothPixelArt",!1,t),this.smoothPixelArt&&(this.antialias=!0,this.antialiasGL=!0,this.pixelArt=!1),this.transparent=h(i,"transparent",!1,t),this.clearBeforeRender=h(i,"clearBeforeRender",!0,t),this.preserveDrawingBuffer=h(i,"preserveDrawingBuffer",!1,t),this.premultipliedAlpha=h(i,"premultipliedAlpha",!0,t),this.skipUnreadyShaders=h(i,"skipUnreadyShaders",!1,t),this.failIfMajorPerformanceCaveat=h(i,"failIfMajorPerformanceCaveat",!1,t),this.powerPreference=h(i,"powerPreference","default",t),this.batchSize=h(i,"batchSize",16384,t),this.maxTextures=h(i,"maxTextures",-1,t),this.maxLights=h(i,"maxLights",10,t),this.renderNodes=h(i,"renderNodes",{},t);var r=h(t,"backgroundColor",0);this.backgroundColor=c(r),this.transparent&&(this.backgroundColor=c(0),this.backgroundColor.alpha=0),this.preBoot=h(t,"callbacks.preBoot",u),this.postBoot=h(t,"callbacks.postBoot",u),this.physics=h(t,"physics",{}),this.defaultPhysicsSystem=h(this.physics,"default",!1),this.loaderBaseURL=h(t,"loader.baseURL",""),this.loaderPath=h(t,"loader.path",""),this.loaderMaxParallelDownloads=h(t,"loader.maxParallelDownloads",a.os.android?6:32),this.loaderCrossOrigin=h(t,"loader.crossOrigin",void 0),this.loaderResponseType=h(t,"loader.responseType",""),this.loaderAsync=h(t,"loader.async",!0),this.loaderUser=h(t,"loader.user",""),this.loaderPassword=h(t,"loader.password",""),this.loaderTimeout=h(t,"loader.timeout",0),this.loaderMaxRetries=h(t,"loader.maxRetries",2),this.loaderWithCredentials=h(t,"loader.withCredentials",!1),this.loaderImageLoadType=h(t,"loader.imageLoadType","XHR"),this.loaderLocalScheme=h(t,"loader.localScheme",["file://","capacitor://"]),this.glowQuality=h(t,"filters.glow.quality",10),this.glowDistance=h(t,"filters.glow.distance",10),this.installGlobalPlugins=[],this.installScenePlugins=[];var f=h(t,"plugins",null),p=n.DefaultScene;f&&(Array.isArray(f)?this.defaultPlugins=f:l(f)&&(this.installGlobalPlugins=o(f,"global",[]),this.installScenePlugins=o(f,"scene",[]),Array.isArray(f.default)?p=f.default:Array.isArray(f.defaultMerge)&&(p=p.concat(f.defaultMerge)))),this.defaultPlugins=p;var g="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg";this.defaultImage=h(t,"images.default",g+"AQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg=="),this.missingImage=h(t,"images.missing",g+"CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg=="),this.whiteImage=h(t,"images.white","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABdJREFUeNpi/P//PwMMMDEgAdwcgAADAJZuAwXJYZOzAAAAAElFTkSuQmCC"),window&&(window.FORCE_WEBGL?this.renderType=s.WEBGL:window.FORCE_CANVAS&&(this.renderType=s.CANVAS))}});t.exports=f},86054(t,e,i){var r=i(20623),s=i(27919),n=i(8054),a=i(89357);t.exports=function(t){var e=t.config;if((e.customEnvironment||e.canvas)&&e.renderType===n.AUTO)throw new Error("Must set explicit renderType in custom environment");if(!e.customEnvironment&&!e.canvas&&e.renderType!==n.HEADLESS)if(e.renderType===n.AUTO&&(e.renderType=a.webGL?n.WEBGL:n.CANVAS),e.renderType===n.WEBGL){if(!a.webGL)throw new Error("Cannot create WebGL context, aborting.")}else{if(e.renderType!==n.CANVAS)throw new Error("Unknown value for renderer type: "+e.renderType);if(!a.canvas)throw new Error("Cannot create Canvas context, aborting.")}e.antialias||s.disableSmoothing();var o,h,l=t.scale.baseSize,u=l.width,d=l.height;(e.canvas?(t.canvas=e.canvas,t.canvas.width=u,t.canvas.height=d):t.canvas=s.create(t,u,d,e.renderType),e.canvasStyle&&(t.canvas.style=e.canvasStyle),e.antialias||r.setCrisp(t.canvas),e.renderType!==n.HEADLESS)&&(o=i(68627),h=i(74797),e.renderType===n.WEBGL?t.renderer=new h(t):(t.renderer=new o(t),t.context=t.renderer.gameContext))}},96391(t,e,i){var r=i(8054);t.exports=function(t){var e=t.config;if(!e.hideBanner){var i="WebGL";e.renderType===r.CANVAS?i="Canvas":e.renderType===r.HEADLESS&&(i="Headless");var s,n=e.audio,a=t.device.audio;if(s=a.webAudio&&!n.disableWebAudio?"Web Audio":n.noAudio||!a.webAudio&&!a.audioData?"No Audio":"HTML5 Audio",t.device.browser.ie)window.console&&console.log("Phaser v"+r.VERSION+" / https://phaser.io");else{var o="color: "+e.bannerTextColor+";",h=Array.isArray(e.bannerBackgroundColor)?e.bannerBackgroundColor:[e.bannerBackgroundColor];1===h.length&&(h=[h[0],h[0]]),o+=' background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAOCAYAAAAmL5yKAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAARBJREFUeNpi/P//P0OHsPB/BiCoePuWkYFEwALSXJElzMBgLwE2CNkQxgWr/yMr/p8QimlBu5DQ//+8vBBco/ofzAe6imH+qv/53/6jYJAYSA4ZoxoANYTPKhiuCQZwGcJU+e4dqpMmvsDq14krV2MPAxDha2CMKvoXoiE/PBQUDgQD8j82UFae9B9bOIC8B9UD9gIjjIMN7Ns6lWHn4XMoYu62RgxO3tkMjIyMII2MYAOAtmFVhA+ADHf2ycGMRhANjUq8YO+WKWCvgAORIV8CkpDCrzIwsLIymC1qAtuAD4Bsh3sBmqAY3qcGwL2AC4DCpKtzHlgzOLWihwEuzTCN0GhDJHeYC4gByBphACDAAH2dDIxdjr+VAAAAAElFTkSuQmCC"), '+("linear-gradient(to bottom, "+h.join(", ")+")")+";",o+=" background-repeat: no-repeat;",o+=" background-position: 4px center, 0 0;";var l="%c",u=[null,o+=" padding: 2px 6px 2px 24px;"];u.push("background: transparent"),e.gameTitle&&(l=l.concat(e.gameTitle),e.gameVersion&&(l=l.concat(" v"+e.gameVersion)),e.hidePhaser||(l=l.concat(" / "))),e.hidePhaser||(l=l.concat("Phaser v"+r.VERSION+" ("+i+" | "+s+")")),l=l.concat("%c "+e.gameURL),u[0]=l,console.log.apply(console,u)}}}},50127(t,e,i){var r=i(40366),s=i(60848),n=i(24047),a=i(27919),o=i(83419),h=i(69547),l=i(83719),u=i(86054),d=i(45893),c=i(96391),f=i(82264),p=i(57264),g=i(50792),m=i(8443),v=i(7003),y=i(37277),x=i(77332),T=i(76531),w=i(60903),b=i(69442),S=i(17130),C=i(65898),E=i(51085),A=i(14747),_=new o({initialize:function(t){this.config=new h(t),this.renderer=null,this.domContainer=null,this.canvas=null,this.context=null,this.isBooted=!1,this.isRunning=!1,this.events=new g,this.anims=new s(this),this.textures=new S(this),this.cache=new n(this),this.registry=new d(this,new g),this.input=new v(this,this.config),this.scene=new w(this,this.config.sceneConfig),this.device=f,this.scale=new T(this,this.config),this.sound=null,this.sound=A.create(this),this.loop=new C(this,this.config.fps),this.plugins=new x(this,this.config),this.pendingDestroy=!1,this.removeCanvas=!1,this.noReturn=!1,this.hasFocus=!1,this.isPaused=!1,p(this.boot.bind(this))},boot:function(){y.hasCore("EventEmitter")?(this.isBooted=!0,this.config.preBoot(this),this.scale.preBoot(),u(this),l(this),c(this),r(this.canvas,this.config.parent),this.textures.once(b.READY,this.texturesReady,this),this.events.emit(m.BOOT)):console.warn("Aborting. Core Plugins missing.")},texturesReady:function(){this.events.emit(m.READY),this.start()},start:function(){this.isRunning=!0,this.config.postBoot(this),this.renderer?this.loop.start(this.step.bind(this)):this.loop.start(this.headlessStep.bind(this)),E(this);var t=this.events;t.on(m.HIDDEN,this.onHidden,this),t.on(m.VISIBLE,this.onVisible,this),t.on(m.BLUR,this.onBlur,this),t.on(m.FOCUS,this.onFocus,this)},step:function(t,e){if(this.pendingDestroy)return this.runDestroy();if(!this.isPaused){var i=this.events;i.emit(m.PRE_STEP,t,e),i.emit(m.STEP,t,e),this.scene.update(t,e),i.emit(m.POST_STEP,t,e);var r=this.renderer;r.preRender(),i.emit(m.PRE_RENDER,r,t,e),this.scene.render(r),r.postRender(),i.emit(m.POST_RENDER,r,t,e)}},headlessStep:function(t,e){if(this.pendingDestroy)return this.runDestroy();if(!this.isPaused){var i=this.events;i.emit(m.PRE_STEP,t,e),i.emit(m.STEP,t,e),this.scene.update(t,e),i.emit(m.POST_STEP,t,e),this.scene.isProcessing=!1,i.emit(m.PRE_RENDER,null,t,e),i.emit(m.POST_RENDER,null,t,e)}},onHidden:function(){this.loop.pause(),this.events.emit(m.PAUSE)},pause:function(){var t=this.isPaused;this.isPaused=!0,t||this.events.emit(m.PAUSE)},onVisible:function(){this.loop.resume(),this.events.emit(m.RESUME,this.loop.pauseDuration)},resume:function(){var t=this.isPaused;this.isPaused=!1,t&&this.events.emit(m.RESUME,0)},onBlur:function(){this.hasFocus=!1,this.loop.blur()},onFocus:function(){this.hasFocus=!0,this.loop.focus()},getFrame:function(){return this.loop.frame},getTime:function(){return this.loop.now},destroy:function(t,e){void 0===e&&(e=!1),this.pendingDestroy=!0,this.removeCanvas=t,this.noReturn=e},runDestroy:function(){this.scene.destroy(),this.events.emit(m.DESTROY),this.events.removeAllListeners(),this.renderer&&this.renderer.destroy(),this.removeCanvas&&this.canvas&&(a.remove(this.canvas),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)),this.domContainer&&this.domContainer.parentNode&&this.domContainer.parentNode.removeChild(this.domContainer),this.loop.destroy(),this.pendingDestroy=!1}});t.exports=_},65898(t,e,i){var r=i(83419),s=i(35154),n=i(29747),a=i(43092),o=new r({initialize:function(t,e){this.game=t,this.raf=new a,this.started=!1,this.running=!1,this.minFps=s(e,"min",5),this.targetFps=s(e,"target",60),this.fpsLimit=s(e,"limit",0),this.hasFpsLimit=this.fpsLimit>0,this._limitRate=this.hasFpsLimit?1e3/this.fpsLimit:0,this._min=1e3/this.minFps,this._target=1e3/this.targetFps,this.actualFps=this.targetFps,this.nextFpsUpdate=0,this.framesThisSecond=0,this.callback=n,this.forceSetTimeOut=s(e,"forceSetTimeOut",!1),this.time=0,this.startTime=0,this.lastTime=0,this.frame=0,this.inFocus=!0,this.pauseDuration=0,this._pauseTime=0,this._coolDown=0,this.delta=0,this.deltaIndex=0,this.deltaHistory=[],this.deltaSmoothingMax=s(e,"deltaHistory",10),this.panicMax=s(e,"panicMax",120),this.rawDelta=0,this.now=0,this.smoothStep=s(e,"smoothStep",!0)},blur:function(){this.inFocus=!1},focus:function(){this.inFocus=!0,this.resetDelta()},pause:function(){this._pauseTime=window.performance.now()},resume:function(){this.resetDelta(),this.pauseDuration=this.time-this._pauseTime,this.startTime+=this.pauseDuration},resetDelta:function(){var t=window.performance.now();this.time=t,this.lastTime=t,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0;for(var e=0;e0||!this.inFocus)&&(this._coolDown--,t=Math.min(t,this._target)),t>this._min&&(t=i[e],t=Math.min(t,this._min)),i[e]=t,this.deltaIndex++,this.deltaIndex>=r&&(this.deltaIndex=0);for(var s=0,n=0;n=this.nextFpsUpdate&&this.updateFPS(t),this.framesThisSecond++,this.delta>=this._limitRate&&(this.callback(t,this.delta),this.delta%=this._limitRate),this.lastTime=t,this.frame++},step:function(t){this.now=t;var e=Math.max(0,t-this.lastTime);this.rawDelta=e,this.time+=this.rawDelta,this.smoothStep&&(e=this.smoothDelta(e)),this.delta=e,t>=this.nextFpsUpdate&&this.updateFPS(t),this.framesThisSecond++,this.callback(t,e),this.lastTime=t,this.frame++},tick:function(){var t=window.performance.now();this.hasFpsLimit?this.stepLimitFPS(t):this.step(t)},sleep:function(){this.running&&(this.raf.stop(),this.running=!1)},wake:function(t){void 0===t&&(t=!1);var e=window.performance.now();if(!this.running){t&&(this.startTime+=-this.lastTime+(this.lastTime+e));var i=this.hasFpsLimit?this.stepLimitFPS.bind(this):this.step.bind(this);this.raf.start(i,this.forceSetTimeOut,this._target),this.running=!0,this.nextFpsUpdate=e+1e3,this.framesThisSecond=0,this.fpsLimitTriggered=!1,this.tick()}},getDuration:function(){return Math.round(this.lastTime-this.startTime)/1e3},getDurationMS:function(){return Math.round(this.lastTime-this.startTime)},stop:function(){return this.running=!1,this.started=!1,this.raf.stop(),this},destroy:function(){this.stop(),this.raf.destroy(),this.raf=null,this.game=null,this.callback=null}});t.exports=o},51085(t,e,i){var r=i(8443);t.exports=function(t){var e,i=t.events;if(void 0!==document.hidden)e="visibilitychange";else{["webkit","moz","ms"].forEach(function(t){void 0!==document[t+"Hidden"]&&(document.hidden=function(){return document[t+"Hidden"]},e=t+"visibilitychange")})}e&&document.addEventListener(e,function(t){document.hidden||"pause"===t.type?i.emit(r.HIDDEN):i.emit(r.VISIBLE)},!1),window.onblur=function(){i.emit(r.BLUR)},window.onfocus=function(){i.emit(r.FOCUS)},window.focus&&t.config.autoFocus&&window.focus()}},97217(t){t.exports="blur"},47548(t){t.exports="boot"},19814(t){t.exports="contextlost"},68446(t){t.exports="destroy"},41700(t){t.exports="focus"},25432(t){t.exports="hidden"},65942(t){t.exports="pause"},59211(t){t.exports="postrender"},47789(t){t.exports="poststep"},39066(t){t.exports="prerender"},460(t){t.exports="prestep"},16175(t){t.exports="ready"},42331(t){t.exports="resume"},11966(t){t.exports="step"},32969(t){t.exports="systemready"},94830(t){t.exports="visible"},8443(t,e,i){t.exports={BLUR:i(97217),BOOT:i(47548),CONTEXT_LOST:i(19814),DESTROY:i(68446),FOCUS:i(41700),HIDDEN:i(25432),PAUSE:i(65942),POST_RENDER:i(59211),POST_STEP:i(47789),PRE_RENDER:i(39066),PRE_STEP:i(460),READY:i(16175),RESUME:i(42331),STEP:i(11966),SYSTEM_READY:i(32969),VISIBLE:i(94830)}},42857(t,e,i){t.exports={Config:i(69547),CreateRenderer:i(86054),DebugHeader:i(96391),Events:i(8443),TimeStep:i(65898),VisibilityHandler:i(51085)}},46728(t,e,i){var r=i(83419),s=i(36316),n=i(80021),a=i(26099),o=new r({Extends:n,initialize:function(t,e,i,r){n.call(this,"CubicBezierCurve"),Array.isArray(t)&&(r=new a(t[6],t[7]),i=new a(t[4],t[5]),e=new a(t[2],t[3]),t=new a(t[0],t[1])),this.p0=t,this.p1=e,this.p2=i,this.p3=r},getStartPoint:function(t){return void 0===t&&(t=new a),t.copy(this.p0)},getResolution:function(t){return t},getPoint:function(t,e){void 0===e&&(e=new a);var i=this.p0,r=this.p1,n=this.p2,o=this.p3;return e.set(s(t,i.x,r.x,n.x,o.x),s(t,i.y,r.y,n.y,o.y))},draw:function(t,e){void 0===e&&(e=32);var i=this.getPoints(e);t.beginPath(),t.moveTo(this.p0.x,this.p0.y);for(var r=1;ri&&(e=i/2);var r=Math.max(1,Math.round(i/e));return s(this.getSpacedPoints(r),t)},getDistancePoints:function(t){var e=this.getLength(),i=Math.max(1,e/t);return this.getSpacedPoints(i)},getEndPoint:function(t){return void 0===t&&(t=new a),this.getPointAt(1,t)},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,i=[],r=this.getPoint(0,this._tmpVec2A),s=0;i.push(0);for(var n=1;n<=t;n++)s+=(e=this.getPoint(n/t,this._tmpVec2B)).distance(r),i.push(s),r.copy(e);return this.cacheArcLengths=i,i},getPointAt:function(t,e){var i=this.getUtoTmapping(t);return this.getPoint(i,e)},getPoints:function(t,e,i){void 0===i&&(i=[]),t||(t=e?this.getLength()/e:this.defaultDivisions);for(var r=0;r<=t;r++)i.push(this.getPoint(r/t));return i},getRandomPoint:function(t){return void 0===t&&(t=new a),this.getPoint(Math.random(),t)},getSpacedPoints:function(t,e,i){void 0===i&&(i=[]),t||(t=e?this.getLength()/e:this.defaultDivisions);for(var r=0;r<=t;r++){var s=this.getUtoTmapping(r/t,null,t);i.push(this.getPoint(s))}return i},getStartPoint:function(t){return void 0===t&&(t=new a),this.getPointAt(0,t)},getTangent:function(t,e){void 0===e&&(e=new a);var i=1e-4,r=t-i,s=t+i;return r<0&&(r=0),s>1&&(s=1),this.getPoint(r,this._tmpVec2A),this.getPoint(s,e),e.subtract(this._tmpVec2A).normalize()},getTangentAt:function(t,e){var i=this.getUtoTmapping(t);return this.getTangent(i,e)},getTFromDistance:function(t,e){return t<=0?0:this.getUtoTmapping(0,t,e)},getUtoTmapping:function(t,e,i){var r,s=this.getLengths(i),n=0,a=s.length;r=e?Math.min(e,s[a-1]):t*s[a-1];for(var o,h=0,l=a-1;h<=l;)if((o=s[n=Math.floor(h+(l-h)/2)]-r)<0)h=n+1;else{if(!(o>0)){l=n;break}l=n-1}if(s[n=l]===r)return n/(a-1);var u=s[n];return(n+(r-u)/(s[n+1]-u))/(a-1)},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()}});t.exports=o},73825(t,e,i){var r=i(83419),s=i(80021),n=i(39506),a=i(35154),o=i(43396),h=i(26099),l=new r({Extends:s,initialize:function(t,e,i,r,o,l,u,d){if("object"==typeof t){var c=t;t=a(c,"x",0),e=a(c,"y",0),i=a(c,"xRadius",0),r=a(c,"yRadius",i),o=a(c,"startAngle",0),l=a(c,"endAngle",360),u=a(c,"clockwise",!1),d=a(c,"rotation",0)}else void 0===r&&(r=i),void 0===o&&(o=0),void 0===l&&(l=360),void 0===u&&(u=!1),void 0===d&&(d=0);s.call(this,"EllipseCurve"),this.p0=new h(t,e),this._xRadius=i,this._yRadius=r,this._startAngle=n(o),this._endAngle=n(l),this._clockwise=u,this._rotation=n(d)},getStartPoint:function(t){return void 0===t&&(t=new h),this.getPoint(0,t)},getResolution:function(t){return 2*t},getPoint:function(t,e){void 0===e&&(e=new h);for(var i=2*Math.PI,r=this._endAngle-this._startAngle,s=Math.abs(r)i;)r-=i;ri.length-2?i.length-1:n+1],d=i[n>i.length-3?i.length-1:n+2];return e.set(r(o,h.x,l.x,u.x,d.x),r(o,h.y,l.y,u.y,d.y))},toJSON:function(){for(var t=[],e=0;e=e)return this.curves[r];r++}return null},getEndPoint:function(t){return void 0===t&&(t=new c),this.curves.length>0?this.curves[this.curves.length-1].getPoint(1,t):t.copy(this.startPoint),t},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},getPoint:function(t,e){void 0===e&&(e=new c);for(var i=t*this.getLength(),r=this.getCurveLengths(),s=0;s=i){var n=r[s]-i,a=this.curves[s],o=a.getLength(),h=0===o?0:1-n/o;return a.getPointAt(h,e)}s++}return null},getPoints:function(t,e){t||e||(t=this.defaultDivisions);for(var i,r=[],s=0;s1&&!r[r.length-1].equals(r[0])&&r.push(r[0]),r},getRandomPoint:function(t){return void 0===t&&(t=new c),this.getPoint(Math.random(),t)},getSpacedPoints:function(t){void 0===t&&(t=40);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e},getStartPoint:function(t){return void 0===t&&(t=new c),t.copy(this.startPoint)},getTangent:function(t,e){void 0===e&&(e=new c);for(var i=t*this.getLength(),r=this.getCurveLengths(),s=0;s=i){var n=r[s]-i,a=this.curves[s],o=a.getLength(),h=0===o?0:1-n/o;return a.getTangentAt(h,e)}s++}return null},lineTo:function(t,e){t instanceof c?this._tmpVec2B.copy(t):"object"==typeof t?this._tmpVec2B.setFromObject(t):this._tmpVec2B.set(t,e);var i=this.getEndPoint(this._tmpVec2A);return this.add(new o([i.x,i.y,this._tmpVec2B.x,this._tmpVec2B.y]))},splineTo:function(t){return t.unshift(this.getEndPoint()),this.add(new d(t))},moveTo:function(t,e){return t instanceof c?this.add(new h(t.x,t.y)):this.add(new h(t,e))},toJSON:function(){for(var t=[],e=0;e=9&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){var n=parseInt(RegExp.$1,10),a=parseInt(RegExp.$2,10);(10===n&&a>=11||n>10)&&(s.dolby=!0)}}}catch(t){}return s}()},84148(t,e,i){var r,s=i(25892),n={chrome:!1,chromeVersion:0,edge:!1,firefox:!1,firefoxVersion:0,ie:!1,ieVersion:0,mobileSafari:!1,opera:!1,safari:!1,safariVersion:0,silk:!1,trident:!1,tridentVersion:0,es2019:!1};t.exports=(r=navigator.userAgent,/Edg\/\d+/.test(r)?(n.edge=!0,n.es2019=!0):/OPR/.test(r)?(n.opera=!0,n.es2019=!0):/Chrome\/(\d+)/.test(r)&&!s.windowsPhone?(n.chrome=!0,n.chromeVersion=parseInt(RegExp.$1,10),n.es2019=n.chromeVersion>69):/Firefox\D+(\d+)/.test(r)?(n.firefox=!0,n.firefoxVersion=parseInt(RegExp.$1,10),n.es2019=n.firefoxVersion>10):/AppleWebKit\/(?!.*CriOS)/.test(r)&&s.iOS?(n.mobileSafari=!0,n.es2019=!0):/MSIE (\d+\.\d+);/.test(r)?(n.ie=!0,n.ieVersion=parseInt(RegExp.$1,10)):/Version\/(\d+\.\d+(\.\d+)?) Safari/.test(r)&&!s.windowsPhone?(n.safari=!0,n.safariVersion=parseInt(RegExp.$1,10),n.es2019=n.safariVersion>10):/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(r)&&(n.ie=!0,n.trident=!0,n.tridentVersion=parseInt(RegExp.$1,10),n.ieVersion=parseInt(RegExp.$3,10)),/Silk/.test(r)&&(n.silk=!0),n)},89289(t,e,i){var r,s,n,a=i(27919),o={supportInverseAlpha:!1,supportNewBlendModes:!1};t.exports=("function"!=typeof importScripts&&void 0!==document&&(o.supportNewBlendModes=(r="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",s="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",(n=new Image).onload=function(){var t=new Image;t.onload=function(){var e=a.create2D(t,6).getContext("2d",{willReadFrequently:!0});if(e.globalCompositeOperation="multiply",e.drawImage(n,0,0),e.drawImage(t,2,0),!e.getImageData(2,0,1,1))return!1;var i=e.getImageData(2,0,1,1).data;a.remove(t),o.supportNewBlendModes=255===i[0]&&0===i[1]&&0===i[2]},t.src=r+"/wCKxvRF"+s},n.src=r+"AP804Oa6"+s,!1),o.supportInverseAlpha=function(){var t=a.create2D(this,2).getContext("2d",{willReadFrequently:!0});t.fillStyle="rgba(10, 20, 30, 0.5)",t.fillRect(0,0,1,1);var e=t.getImageData(0,0,1,1);if(null===e)return!1;t.putImageData(e,1,0);var i=t.getImageData(1,0,1,1),r=i.data[0]===e.data[0]&&i.data[1]===e.data[1]&&i.data[2]===e.data[2]&&i.data[3]===e.data[3];return a.remove(this),r}()),o)},89357(t,e,i){var r=i(25892),s=i(84148),n=i(27919),a={canvas:!1,canvasBitBltShift:null,file:!1,fileSystem:!1,getUserMedia:!0,littleEndian:!1,localStorage:!1,pointerLock:!1,stableSort:!1,support32bit:!1,vibration:!1,webGL:!1,worker:!1};t.exports=function(){if("function"==typeof importScripts)return a;a.canvas=!!window.CanvasRenderingContext2D;try{a.localStorage=!!localStorage.getItem}catch(t){a.localStorage=!1}a.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),a.fileSystem=!!window.requestFileSystem;var t,e,i,o=!1;return a.webGL=function(){if(window.WebGLRenderingContext)try{var t=n.createWebGL(this),e=t.getContext("webgl")||t.getContext("experimental-webgl"),i=n.create2D(this),r=i.getContext("2d",{willReadFrequently:!0}).createImageData(1,1);return o=r.data instanceof Uint8ClampedArray,n.remove(t),n.remove(i),!!e}catch(t){return!1}return!1}(),a.worker=!!window.Worker,a.pointerLock="pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||navigator.oGetUserMedia,window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,a.getUserMedia=a.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,s.firefox&&s.firefoxVersion<21&&(a.getUserMedia=!1),!r.iOS&&(s.ie||s.firefox||s.chrome)&&(a.canvasBitBltShift=!0),(s.safari||s.mobileSafari)&&(a.canvasBitBltShift=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(a.vibration=!0),"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint32Array&&(a.littleEndian=(t=new ArrayBuffer(4),e=new Uint8Array(t),i=new Uint32Array(t),e[0]=161,e[1]=178,e[2]=195,e[3]=212,3569595041===i[0]||2712847316!==i[0]&&null)),a.support32bit="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof Int32Array&&null!==a.littleEndian&&o,a}()},91639(t){var e={available:!1,cancel:"",keyboard:!1,request:""};t.exports=function(){if("function"==typeof importScripts)return e;var t,i="Fullscreen",r="FullScreen",s=["request"+i,"request"+r,"webkitRequest"+i,"webkitRequest"+r,"msRequest"+i,"msRequest"+r,"mozRequest"+r,"mozRequest"+i];for(t=0;t=1)&&(s.touch=!0),(navigator.msPointerEnabled||navigator.pointerEnabled)&&(s.mspointer=!0),navigator.getGamepads&&(s.gamepads=!0),"onwheel"in window||r.ie&&"WheelEvent"in window?s.wheelEvent="wheel":"onmousewheel"in window?s.wheelEvent="mousewheel":r.firefox&&"MouseScrollEvent"in window&&(s.wheelEvent="DOMMouseScroll")),s)},25892(t){var e={android:!1,chromeOS:!1,cordova:!1,crosswalk:!1,desktop:!1,ejecta:!1,electron:!1,iOS:!1,iOSVersion:0,iPad:!1,iPhone:!1,kindle:!1,linux:!1,macOS:!1,node:!1,nodeWebkit:!1,pixelRatio:1,webApp:!1,windows:!1,windowsPhone:!1};t.exports=function(){if("function"==typeof importScripts)return e;var t=navigator.userAgent;/Windows/.test(t)?e.windows=!0:/Mac OS/.test(t)&&!/like Mac OS/.test(t)?navigator.maxTouchPoints&&navigator.maxTouchPoints>2?(e.iOS=!0,e.iPad=!0,navigator.appVersion.match(/Version\/(\d+)/),e.iOSVersion=parseInt(RegExp.$1,10)):e.macOS=!0:/Android/.test(t)?e.android=!0:/Linux/.test(t)?e.linux=!0:/iP[ao]d|iPhone/i.test(t)?(e.iOS=!0,navigator.appVersion.match(/OS (\d+)/),e.iOSVersion=parseInt(RegExp.$1,10),e.iPhone=-1!==t.toLowerCase().indexOf("iphone"),e.iPad=-1!==t.toLowerCase().indexOf("ipad")):/Kindle/.test(t)||/\bKF[A-Z][A-Z]+/.test(t)||/Silk.*Mobile Safari/.test(t)?e.kindle=!0:/CrOS/.test(t)&&(e.chromeOS=!0),(/Windows Phone/i.test(t)||/IEMobile/i.test(t))&&(e.android=!1,e.iOS=!1,e.macOS=!1,e.windows=!0,e.windowsPhone=!0);var i=/Silk/.test(t);return(e.windows||e.macOS||e.linux&&!i||e.chromeOS)&&(e.desktop=!0),(e.windowsPhone||/Windows NT/i.test(t)&&/Touch/i.test(t))&&(e.desktop=!1),navigator.standalone&&(e.webApp=!0),"function"!=typeof importScripts&&(void 0!==window.cordova&&(e.cordova=!0),void 0!==window.ejecta&&(e.ejecta=!0)),"undefined"!=typeof process&&process.versions&&process.versions.node&&(e.node=!0),e.node&&"object"==typeof process.versions&&(e.nodeWebkit=!!process.versions["node-webkit"],e.electron=!!process.versions.electron),/Crosswalk/.test(t)&&(e.crosswalk=!0),e.pixelRatio=window.devicePixelRatio||1,e}()},43267(t,e,i){var r=i(95540),s={h264:!1,hls:!1,mov:!1,mp4:!1,m4v:!1,ogg:!1,vp9:!1,webm:!1,hasRequestVideoFrame:!1};t.exports=function(){if("function"==typeof importScripts)return s;var t=document.createElement("video"),e=!!t.canPlayType,i=/^no$/;try{e&&(t.canPlayType('video/ogg; codecs="theora"').replace(i,"")&&(s.ogg=!0),t.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(i,"")&&(s.h264=!0,s.mp4=!0),t.canPlayType('video/quicktime4; codecs="avc1.42E01E"').replace(i,"")&&(s.mov=!0),t.canPlayType("video/x-m4v").replace(i,"")&&(s.m4v=!0),t.canPlayType('video/webm; codecs="vp8, vorbis"').replace(i,"")&&(s.webm=!0),t.canPlayType('video/webm; codecs="vp9"').replace(i,"")&&(s.vp9=!0),t.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(i,"")&&(s.hls=!0))}catch(t){}return t.parentNode&&t.parentNode.removeChild(t),s.getVideoURL=function(t){Array.isArray(t)||(t=[t]);for(var e=0;e4096&&(s=Math.ceil(r/4096),r=4096),this.dataTextureResolution[0]=r,this.dataTextureResolution[1]=s;var n=new ArrayBuffer(r*s*4),o=new Uint32Array(n),l=new Uint8Array(n),u=0,d=65536;o[u++]=Math.round(this.bands[0].start*d),o[u++]=Math.round(this.bands[this.bands.length-1].end*d);for(var c=0;c<=e;c++)for(var f=Math.pow(2,c),p=1;po.end&&(o.end=o.start)}return i&&(this.bands=s.filter(function(t){return t.start=t){e=r;break}}return e?(t=(t-e.start)/(e.end-e.start),e.getColor(t)):{r:0,g:0,b:0,a:0,color:0}},destroy:function(){this.scene=null,this.dataTexture&&this.dataTexture.destroy()}});t.exports=l},51767(t,e,i){var r=i(83419),s=i(29747),n=new r({initialize:function(t,e,i){this._rgb=[0,0,0],this.onChangeCallback=s,this.dirty=!1,this.set(t,e,i)},set:function(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this._rgb=[t,e,i],this.onChange(),this},equals:function(t,e,i){var r=this._rgb;return r[0]===t&&r[1]===e&&r[2]===i},onChange:function(){this.dirty=!0;var t=this._rgb;this.onChangeCallback.call(this,t[0],t[1],t[2])},r:{get:function(){return this._rgb[0]},set:function(t){this._rgb[0]=t,this.onChange()}},g:{get:function(){return this._rgb[1]},set:function(t){this._rgb[1]=t,this.onChange()}},b:{get:function(){return this._rgb[2]},set:function(t){this._rgb[2]=t,this.onChange()}},destroy:function(){this.onChangeCallback=null}});t.exports=n},60461(t){t.exports={TOP_LEFT:0,TOP_CENTER:1,TOP_RIGHT:2,LEFT_TOP:3,LEFT_CENTER:4,LEFT_BOTTOM:5,CENTER:6,RIGHT_TOP:7,RIGHT_CENTER:8,RIGHT_BOTTOM:9,BOTTOM_LEFT:10,BOTTOM_CENTER:11,BOTTOM_RIGHT:12}},54312(t,e,i){var r=i(62235),s=i(35893),n=i(86327),a=i(88417);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)+i),n(t,r(e)+o),t}},46768(t,e,i){var r=i(62235),s=i(26541),n=i(86327),a=i(385);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)-i),n(t,r(e)+o),t}},35827(t,e,i){var r=i(62235),s=i(54380),n=i(86327),a=i(40136);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)+i),n(t,r(e)+o),t}},46871(t,e,i){var r=i(66786),s=i(35893),n=i(7702);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)+i,n(e)+a),t}},5198(t,e,i){var r=i(7702),s=i(26541),n=i(20786),a=i(385);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)-i),n(t,r(e)+o),t}},11879(t,e,i){var r=i(60461),s=[];s[r.BOTTOM_CENTER]=i(54312),s[r.BOTTOM_LEFT]=i(46768),s[r.BOTTOM_RIGHT]=i(35827),s[r.CENTER]=i(46871),s[r.LEFT_CENTER]=i(5198),s[r.RIGHT_CENTER]=i(80503),s[r.TOP_CENTER]=i(89698),s[r.TOP_LEFT]=i(922),s[r.TOP_RIGHT]=i(21373),s[r.LEFT_BOTTOM]=s[r.BOTTOM_LEFT],s[r.LEFT_TOP]=s[r.TOP_LEFT],s[r.RIGHT_BOTTOM]=s[r.BOTTOM_RIGHT],s[r.RIGHT_TOP]=s[r.TOP_RIGHT];t.exports=function(t,e,i,r,n){return s[i](t,e,r,n)}},80503(t,e,i){var r=i(7702),s=i(54380),n=i(20786),a=i(40136);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)+i),n(t,r(e)+o),t}},89698(t,e,i){var r=i(35893),s=i(17717),n=i(88417),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,r(e)+i),a(t,s(e)-o),t}},922(t,e,i){var r=i(26541),s=i(17717),n=i(385),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,r(e)-i),a(t,s(e)-o),t}},21373(t,e,i){var r=i(54380),s=i(17717),n=i(40136),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,r(e)+i),a(t,s(e)-o),t}},91660(t,e,i){t.exports={BottomCenter:i(54312),BottomLeft:i(46768),BottomRight:i(35827),Center:i(46871),LeftCenter:i(5198),QuickSet:i(11879),RightCenter:i(80503),TopCenter:i(89698),TopLeft:i(922),TopRight:i(21373)}},71926(t,e,i){var r=i(60461),s=i(79291),n={In:i(91660),To:i(16694)};n=s(!1,n,r),t.exports=n},21578(t,e,i){var r=i(62235),s=i(35893),n=i(88417),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,s(e)+i),a(t,r(e)+o),t}},10210(t,e,i){var r=i(62235),s=i(26541),n=i(385),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,s(e)-i),a(t,r(e)+o),t}},82341(t,e,i){var r=i(62235),s=i(54380),n=i(40136),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,s(e)+i),a(t,r(e)+o),t}},87958(t,e,i){var r=i(62235),s=i(26541),n=i(86327),a=i(40136);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)-i),n(t,r(e)+o),t}},40080(t,e,i){var r=i(7702),s=i(26541),n=i(20786),a=i(40136);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)-i),n(t,r(e)+o),t}},88466(t,e,i){var r=i(26541),s=i(17717),n=i(40136),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,r(e)-i),a(t,s(e)-o),t}},38829(t,e,i){var r=i(60461),s=[];s[r.BOTTOM_CENTER]=i(21578),s[r.BOTTOM_LEFT]=i(10210),s[r.BOTTOM_RIGHT]=i(82341),s[r.LEFT_BOTTOM]=i(87958),s[r.LEFT_CENTER]=i(40080),s[r.LEFT_TOP]=i(88466),s[r.RIGHT_BOTTOM]=i(19211),s[r.RIGHT_CENTER]=i(34609),s[r.RIGHT_TOP]=i(48741),s[r.TOP_CENTER]=i(49440),s[r.TOP_LEFT]=i(81288),s[r.TOP_RIGHT]=i(61323);t.exports=function(t,e,i,r,n){return s[i](t,e,r,n)}},19211(t,e,i){var r=i(62235),s=i(54380),n=i(86327),a=i(385);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)+i),n(t,r(e)+o),t}},34609(t,e,i){var r=i(7702),s=i(54380),n=i(20786),a=i(385);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)+i),n(t,r(e)+o),t}},48741(t,e,i){var r=i(54380),s=i(17717),n=i(385),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,r(e)+i),a(t,s(e)-o),t}},49440(t,e,i){var r=i(35893),s=i(17717),n=i(86327),a=i(88417);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,r(e)+i),n(t,s(e)-o),t}},81288(t,e,i){var r=i(26541),s=i(17717),n=i(86327),a=i(385);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,r(e)-i),n(t,s(e)-o),t}},61323(t,e,i){var r=i(54380),s=i(17717),n=i(86327),a=i(40136);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,r(e)+i),n(t,s(e)-o),t}},16694(t,e,i){t.exports={BottomCenter:i(21578),BottomLeft:i(10210),BottomRight:i(82341),LeftBottom:i(87958),LeftCenter:i(40080),LeftTop:i(88466),QuickSet:i(38829),RightBottom:i(19211),RightCenter:i(34609),RightTop:i(48741),TopCenter:i(49440),TopLeft:i(81288),TopRight:i(61323)}},66786(t,e,i){var r=i(88417),s=i(20786);t.exports=function(t,e,i){return r(t,e),s(t,i)}},62235(t){t.exports=function(t){return t.y+t.height-t.height*t.originY}},72873(t,e,i){var r=i(62235),s=i(26541),n=i(54380),a=i(17717),o=i(87841);t.exports=function(t,e){void 0===e&&(e=new o);var i=s(t),h=a(t);return e.x=i,e.y=h,e.width=n(t)-i,e.height=r(t)-h,e}},35893(t){t.exports=function(t){return t.x-t.width*t.originX+.5*t.width}},7702(t){t.exports=function(t){return t.y-t.height*t.originY+.5*t.height}},26541(t){t.exports=function(t){return t.x-t.width*t.originX}},87431(t){t.exports=function(t){return t.width*t.originX}},46928(t){t.exports=function(t){return t.height*t.originY}},54380(t){t.exports=function(t){return t.x+t.width-t.width*t.originX}},17717(t){t.exports=function(t){return t.y-t.height*t.originY}},86327(t){t.exports=function(t,e){return t.y=e-t.height+t.height*t.originY,t}},88417(t){t.exports=function(t,e){var i=t.width*t.originX;return t.x=e+i-.5*t.width,t}},20786(t){t.exports=function(t,e){var i=t.height*t.originY;return t.y=e+i-.5*t.height,t}},385(t){t.exports=function(t,e){return t.x=e+t.width*t.originX,t}},40136(t){t.exports=function(t,e){return t.x=e-t.width+t.width*t.originX,t}},66737(t){t.exports=function(t,e){return t.y=e+t.height*t.originY,t}},58724(t,e,i){t.exports={CenterOn:i(66786),GetBottom:i(62235),GetBounds:i(72873),GetCenterX:i(35893),GetCenterY:i(7702),GetLeft:i(26541),GetOffsetX:i(87431),GetOffsetY:i(46928),GetRight:i(54380),GetTop:i(17717),SetBottom:i(86327),SetCenterX:i(88417),SetCenterY:i(20786),SetLeft:i(385),SetRight:i(40136),SetTop:i(66737)}},20623(t){t.exports={setCrisp:function(t){return["optimizeSpeed","-moz-crisp-edges","-o-crisp-edges","-webkit-optimize-contrast","optimize-contrast","crisp-edges","pixelated"].forEach(function(e){t.style["image-rendering"]=e}),t.style.msInterpolationMode="nearest-neighbor",t},setBicubic:function(t){return t.style["image-rendering"]="auto",t.style.msInterpolationMode="bicubic",t}}},27919(t,e,i){var r,s,n,a=i(8054),o=i(68703),h=[],l=!1;t.exports=(n=function(){var t=0;return h.forEach(function(e){e.parent&&t++}),t},{create2D:function(t,e,i){return r(t,e,i,a.CANVAS)},create:r=function(t,e,i,r,n){var u;void 0===e&&(e=1),void 0===i&&(i=1),void 0===r&&(r=a.CANVAS),void 0===n&&(n=!1);var d=s(r);return null===d?(d={parent:t,canvas:document.createElement("canvas"),type:r},r===a.CANVAS&&h.push(d),u=d.canvas):(d.parent=t,u=d.canvas),n&&(d.parent=u),u.width=e,u.height=i,l&&r===a.CANVAS&&o.disable(u.getContext("2d",{willReadFrequently:!1})),u},createWebGL:function(t,e,i){return r(t,e,i,a.WEBGL)},disableSmoothing:function(){l=!0},enableSmoothing:function(){l=!1},first:s=function(t){if(void 0===t&&(t=a.CANVAS),t===a.WEBGL)return null;for(var e=0;e=0;e--)i.push({r:e,g:a,b:o,color:r(e,a,o)});for(n=0,e=0;e<=s;e++,a--)i.push({r:n,g:a,b:e,color:r(n,a,e)});for(a=0,o=255,e=0;e<=s;e++,o--,n++)i.push({r:n,g:a,b:o,color:r(n,a,o)});if(1024===t)return i;var h=[],l=0,u=1024/t;for(e=0;e>16&255,g:t>>8&255,b:255&t,a:255};return t>16777215&&(e.a=t>>>24),e}},62957(t){t.exports=function(t){var e=t.toString(16);return 1===e.length?"0"+e:e}},37589(t){t.exports=function(t,e,i){return t<<16|e<<8|i}},1e3(t){t.exports=function(t,e,i,r){return r<<24|t<<16|e<<8|i}},62183(t,e,i){var r=i(40987),s=i(89528);t.exports=function(t,e,i,n){n||(n=new r);var a=i,o=i,h=i;if(0!==e){var l=i<.5?i*(1+e):i+e-i*e,u=2*i-l;a=s(u,l,t+1/3),o=s(u,l,t),h=s(u,l,t-1/3)}return n.setGLTo(a,o,h,1)}},27939(t,e,i){var r=i(7537);t.exports=function(t,e){void 0===t&&(t=1),void 0===e&&(e=1);for(var i=[],s=0;s<=359;s++)i.push(r(s/359,t,e));return i}},7537(t,e,i){var r=i(37589);function s(t,e,i,r){var s=(t+6*e)%6,n=Math.min(s,4-s,1);return Math.round(255*(r-r*i*Math.max(0,n)))}t.exports=function(t,e,i,n){void 0===e&&(e=1),void 0===i&&(i=1);var a=s(5,t,e,i),o=s(3,t,e,i),h=s(1,t,e,i);return n?n.setTo?n.setTo(a,o,h,n.alpha,!0):(n.r=a,n.g=o,n.b=h,n.color=r(a,o,h),n):{r:a,g:o,b:h,color:r(a,o,h)}}},70238(t,e,i){var r=i(40987);t.exports=function(t,e){e||(e=new r),t=t.replace(/^(?:#|0x)?([a-f\d])([a-f\d])([a-f\d])$/i,function(t,e,i,r){return e+e+i+i+r+r});var i=/^(?:#|0x)?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);if(i){var s=parseInt(i[1],16),n=parseInt(i[2],16),a=parseInt(i[3],16);e.setTo(s,n,a)}return e}},89528(t){t.exports=function(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}},30100(t,e,i){var r=i(40987),s=i(90664);t.exports=function(t,e){var i=s(t);return e?e.setTo(i.r,i.g,i.b,i.a):new r(i.r,i.g,i.b,i.a)}},90664(t){t.exports=function(t){return t>16777215?{a:t>>>24,r:t>>16&255,g:t>>8&255,b:255&t}:{a:255,r:t>>16&255,g:t>>8&255,b:255&t}}},13699(t,e,i){var r=i(28915),s=i(37589),n=i(7537),a=function(t,e,i,n,a,o,h,l){void 0===h&&(h=100),void 0===l&&(l=0);var u=l/h,d=r(t,n,u),c=r(e,a,u),f=r(i,o,u);return{r:d,g:c,b:f,a:255,color:s(d,c,f)}},o=function(t,e,i,s,a,o,h,l,u){if(void 0===u&&(u=0),0===u){var d=t-s;d>.5?t-=1:d<-.5&&(t+=1)}else u>0?t>s&&(t-=1):tt?r.ORIENTATION.PORTRAIT:r.ORIENTATION.LANDSCAPE}},74403(t){t.exports=function(t){var e;return""!==t&&("string"==typeof t?e=document.getElementById(t):t&&1===t.nodeType&&(e=t)),e||(e=document.body),e}},56836(t){t.exports=function(t){var e="";try{if(window.DOMParser)e=(new DOMParser).parseFromString(t,"text/xml");else(e=new ActiveXObject("Microsoft.XMLDOM")).loadXML(t)}catch(t){e=null}return e&&e.documentElement&&!e.getElementsByTagName("parsererror").length?e:null}},35846(t){t.exports=function(t){t.parentNode&&t.parentNode.removeChild(t)}},43092(t,e,i){var r=i(83419),s=i(29747),n=new r({initialize:function(){this.isRunning=!1,this.callback=s,this.isSetTimeOut=!1,this.timeOutID=null,this.delay=0;var t=this;this.step=function e(i){t.callback(i),t.isRunning&&(t.timeOutID=window.requestAnimationFrame(e))},this.stepTimeout=function e(){t.isRunning&&(t.timeOutID=window.setTimeout(e,t.delay)),t.callback(window.performance.now())}},start:function(t,e,i){this.isRunning||(this.callback=t,this.isSetTimeOut=e,this.delay=i,this.isRunning=!0,this.timeOutID=e?window.setTimeout(this.stepTimeout,0):window.requestAnimationFrame(this.step))},stop:function(){this.isRunning=!1,this.isSetTimeOut?clearTimeout(this.timeOutID):window.cancelAnimationFrame(this.timeOutID)},destroy:function(){this.stop(),this.callback=s}});t.exports=n},84902(t,e,i){var r={AddToDOM:i(40366),DOMContentLoaded:i(57264),GetInnerHeight:i(57811),GetScreenOrientation:i(45818),GetTarget:i(74403),ParseXML:i(56836),RemoveFromDOM:i(35846),RequestAnimationFrame:i(43092)};t.exports=r},47565(t,e,i){var r=i(83419),s=i(50792),n=i(37277),a=new r({Extends:s,initialize:function(){s.call(this)},shutdown:function(){this.removeAllListeners()},destroy:function(){this.removeAllListeners()}});n.register("EventEmitter",a,"events"),t.exports=a},93055(t,e,i){t.exports={EventEmitter:i(47565)}},10189(t,e,i){var r=i(83419),s=i(13045),n=new r({Extends:s,initialize:function(t,e){void 0===e&&(e=1),s.call(this,t,"FilterBarrel"),this.amount=e}});t.exports=n},16762(t,e,i){var r=i(83419),s=i(13045),n=new r({Extends:s,initialize:function(t,e,i,r,n){void 0===e&&(e="__WHITE"),void 0===i&&(i=0),void 0===r&&(r=1),void 0===n&&(n=[1,1,1,1]),s.call(this,t,"FilterBlend"),this.glTexture,this.blendMode=i,this.amount=r,this.color=n,this.setTexture(e)},setTexture:function(t){var e=this.camera.scene.sys.textures.getFrame(t);return e&&(this.glTexture=e.glTexture),this}});t.exports=n},37597(t,e,i){var r=i(83419),s=i(13045),n=new r({Extends:s,initialize:function(t,e){s.call(this,t,"FilterBlocky"),this.size={x:4,y:4},this.offset={x:0,y:0},e&&(void 0!==e.size&&("number"==typeof e.size?(this.size.x=e.size,this.size.y=e.size):(this.size.x=e.size.x,this.size.y=e.size.y)),void 0!==e.offset&&("number"==typeof e.offset?(this.offset.x=e.offset,this.offset.y=e.offset):(this.offset.x=e.offset.x,this.offset.y=e.offset.y)))}});t.exports=n},88344(t,e,i){var r=i(83419),s=i(13045),n=new r({Extends:s,initialize:function(t,e,i,r,n,a,o){void 0===e&&(e=0),void 0===i&&(i=2),void 0===r&&(r=2),void 0===n&&(n=1),void 0===o&&(o=4),s.call(this,t,"FilterBlur"),this.quality=e,this.x=i,this.y=r,this.strength=n,this.glcolor=[1,1,1],null!=a&&(this.color=a),this.steps=o},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}},getPadding:function(){var t=this.paddingOverride;if(t)return this.currentPadding.setTo(t.x,t.y,t.width,t.height),t;var e=this.quality,i=0===e?1.333:1===e?3.2307692308:5.176470588235294,r=this.steps*this.strength*i,s=Math.ceil(this.x*r),n=Math.ceil(this.y*r);return this.currentPadding.setTo(-s,-n,2*s,2*n),this.currentPadding}});t.exports=n},47564(t,e,i){var r=i(83419),s=i(13045),n=new r({Extends:s,initialize:function(t,e,i,r,n,a,o,h){void 0===e&&(e=.5),void 0===i&&(i=1),void 0===r&&(r=.2),void 0===n&&(n=!1),void 0===a&&(a=1),void 0===o&&(o=1),void 0===h&&(h=1),s.call(this,t,"FilterBokeh"),this.radius=e,this.amount=i,this.contrast=r,this.isTiltShift=n,this.blurX=a,this.blurY=o,this.strength=h},getPadding:function(){var t=this.paddingOverride;if(t)return this.currentPadding.setTo(t.x,t.y,t.width,t.height),t;var e=Math.ceil(this.camera.height*this.radius*.021426096060426905);return this.currentPadding.setTo(-e,-e,2*e,2*e),this.currentPadding}});t.exports=n},77011(t,e,i){var r=i(83419),s=i(13045),n=i(89422),a=new r({Extends:s,initialize:function(t){s.call(this,t,"FilterColorMatrix"),this.colorMatrix=new n},destroy:function(){this.colorMatrix=null,s.prototype.destroy.call(this)}});t.exports=a},95200(t,e,i){var r=i(83419),s=i(13045),n=i(89422),a=new r({Extends:s,initialize:function(t,e){s.call(this,t,"FilterCombineColorMatrix"),this.glTexture,this.colorMatrixSelf=new n,this.colorMatrixTransfer=new n,this.additions=[1,1,1,0],this.multiplications=[0,0,0,1],this.setTexture(e||"__WHITE")},setTexture:function(t){var e=t instanceof Phaser.Textures.Texture?t:this.camera.scene.sys.textures.getFrame(t);return e&&(this.glTexture=e.glTexture),this},setupAlphaTransfer:function(t,e,i,r,s,n){var a=this.colorMatrixSelf,o=this.colorMatrixTransfer;a.reset(),o.reset(),this.additions=[1,1,1,0],this.multiplications=[0,0,0,1],t||a.black(),e||o.black(),s?a.brightnessToAlphaInverse(!0):i&&a.brightnessToAlpha(!0),n?o.brightnessToAlphaInverse(!0):r&&o.brightnessToAlpha(!0)},destroy:function(){this.colorMatrixSelf=null,this.colorMatrixTransfer=null,s.prototype.destroy.call(this)}});t.exports=a},13045(t,e,i){var r=i(83419),s=i(87841),n=new r({initialize:function(t,e){this.active=!0,this.camera=t,this.renderNode=e,this.paddingOverride=new s,this.currentPadding=new s,this.allowBaseDraw=!0,this.ignoreDestroy=!1},getPadding:function(){return this.paddingOverride||this.currentPadding},getPaddingCeil:function(){var t=this.getPadding(),e=new s(Math.ceil(t.x),Math.ceil(t.y),Math.ceil(t.width),Math.ceil(t.height));return this.currentPadding.setTo(e.x,e.y,e.width,e.height),e},setPaddingOverride:function(t,e,i,r){return null===t?(this.paddingOverride=null,this):(void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),this.paddingOverride=new s(t,e,i-t,r-e),this)},setActive:function(t){return this.active=t,this},destroy:function(){this.active=!1,this.renderNode=null,this.camera=null}});t.exports=n},16898(t,e,i){var r=i(83419),s=i(13045),n=new r({Extends:s,initialize:function(t,e,i,r){void 0===e&&(e="__WHITE"),void 0===i&&(i=.005),void 0===r&&(r=.005),s.call(this,t,"FilterDisplacement"),this.x=i,this.y=r,this.glTexture,this.setTexture(e)},setTexture:function(t){var e=this.camera.scene.sys.textures.getFrame(t);return e&&(this.glTexture=e.glTexture),this},getPadding:function(){var t=this.paddingOverride;if(t)return this.currentPadding.setTo(t.x,t.y,t.width,t.height),t;var e=this.camera,i=Math.ceil(e.width*this.x*.5),r=Math.ceil(e.height*this.y*.5);return this.currentPadding.setTo(-i,-r,2*i,2*r),this.currentPadding}});t.exports=n},42652(t,e,i){var r=i(83419),s=i(13045),n=new r({Extends:s,initialize:function(t,e,i,r,n,a,o,h){void 0===i&&(i=4),void 0===r&&(r=0),void 0===n&&(n=1),void 0===a&&(a=!1),void 0===o&&(o=t.scene.sys.game.config.glowQuality),void 0===h&&(h=t.scene.sys.game.config.glowDistance),s.call(this,t,"FilterGlow"),this.outerStrength=i,this.innerStrength=r,this.scale=n,this.knockout=a,this._quality=Math.max(Math.round(o),1),this._distance=Math.max(Math.round(h),1),this.glcolor=[1,1,1,1],void 0!==e&&(this.color=e)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}},distance:{get:function(){return this._distance}},quality:{get:function(){return this._quality}},getPadding:function(){var t=this.paddingOverride;if(t)return this.currentPadding.setTo(t.x,t.y,t.width,t.height),t;var e=this.currentPadding,i=Math.ceil(this.distance*this.scale);return e.left=-i,e.top=-i,e.right=i,e.bottom=i,e}});t.exports=n},43927(t,e,i){var r=i(83419),s=i(13045),n=i(73043),a=new r({Extends:s,initialize:function(t,e){e||(e={});var i=t.scene;s.call(this,t,"FilterGradientMap");var r=e.ramp;r||(r={colorStart:0,colorEnd:16777215}),r instanceof n||(r=new n(i,r,!0)),this.ramp=r,this.dither=!!e.dither,this.color=[0,0,0,0],e.color&&(this.color[0]=e.color[0]||0,this.color[1]=e.color[1]||0,this.color[2]=e.color[2]||0,this.color[3]=e.color[3]||0),this.colorFactor=[.3,.6,.1,0],e.colorFactor&&(this.colorFactor[0]=e.colorFactor[0]||0,this.colorFactor[1]=e.colorFactor[1]||0,this.colorFactor[2]=e.colorFactor[2]||0,this.colorFactor[3]=e.colorFactor[3]||0),this.unpremultiply=void 0===e.unpremultiply||e.unpremultiply,this.alpha=void 0===e.alpha?1:e.alpha}});t.exports=a},84714(t,e,i){var r=i(83419),s=i(13045),n=i(37867),a=i(61340),o=new r({Extends:s,initialize:function(t,e){s.call(this,t,"FilterImageLight"),this.normalGlTexture,this.environmentGlTexture,this.viewMatrix=new n,this.modelRotation=e.modelRotation||0,this.modelRotationSource=e.modelRotationSource||null,this.bulge=e.bulge||0,this.colorFactor=e.colorFactor||[1,1,1],this._tempMatrix=new a,this._tempParentMatrix=new a,this.setEnvironmentMap(e.environmentMap||"__WHITE"),this.setNormalMap(e.normalMap||"__NORMAL"),e.viewMatrix&&this.viewMatrix.set(e.viewMatrix)},setEnvironmentMap:function(t){var e=t instanceof Phaser.Textures.Texture?t:this.camera.scene.sys.textures.getFrame(t);return e&&(this.environmentGlTexture=e.glTexture),this},setNormalMap:function(t){var e=t instanceof Phaser.Textures.Texture?t:this.camera.scene.sys.textures.getFrame(t);return e&&(this.normalGlTexture=e.glTexture),this},setNormalMapFromGameObject:function(t){var e=t.texture.dataSource[0];return e&&(this.normalGlTexture=e.glTexture),this},getModelRotation:function(){return this.modelRotationSource?"function"==typeof this.modelRotationSource?this.modelRotationSource():this.modelRotationSource.hasTransformComponent?this.modelRotationSource.getWorldTransformMatrix(this._tempMatrix,this._tempParentMatrix).rotationNormalized:this.modelRotation:this.modelRotation}});t.exports=o},51890(t,e,i){var r=i(83419),s=i(13045),n=i(40987),a=new r({Extends:s,initialize:function(t,e){void 0===e&&(e={}),s.call(this,t,"FilterKey"),this.color=[1,1,1,1],void 0!==e.color&&this.setColor(e.color),void 0!==e.alpha&&this.setAlpha(e.alpha),this.isolate=!1,void 0!==e.isolate&&(this.isolate=e.isolate),this.threshold=.0625,void 0!==e.threshold&&(this.threshold=e.threshold),this.feather=0,void 0!==e.feather&&(this.feather=e.feather)},setAlpha:function(t){return this.color[3]=t,this},setColor:function(t){var e=this.color[3];if("number"==typeof t){var i=n.IntegerToRGB(t);this.color=[i.r/255,i.g/255,i.b/255,e]}else if("string"==typeof t){var r=n.HexStringToColor(t);this.color=[r.redGL,r.greenGL,r.blueGL,e]}else Array.isArray(t)?this.color=[t[0],t[1],t[2],e]:t instanceof n&&(this.color=[t.redGL,t.greenGL,t.blueGL,e]);return this}});t.exports=a},97797(t,e,i){var r=i(83419),s=i(45650),n=i(13045),a=new r({Extends:n,initialize:function(t,e,i,r,s,a){void 0===e&&(e="__WHITE"),void 0===i&&(i=!1),void 0===a&&(a=1),n.call(this,t,"FilterMask"),this.glTexture,this._dynamicTexture=null,this.maskGameObject=null,this.invert=i,this.autoUpdate=!0,this.needsUpdate=!1,this.viewTransform=s||"world",this.viewCamera=r,this.scaleFactor=a,"string"==typeof e?this.setTexture(e):this.setGameObject(e)},updateDynamicTexture:function(t,e){var i=this.scaleFactor,r=t*i,n=e*i,a=this.maskGameObject;if(a){if(this._dynamicTexture)this._dynamicTexture.width!==r||this._dynamicTexture.height!==n?this._dynamicTexture.setSize(r,n,!1):this._dynamicTexture.clear();else{var o=this.camera.scene.sys.textures;this._dynamicTexture=o.addDynamicTexture(s(),r,n,!1)}this.glTexture=this._dynamicTexture.get().glTexture;var h=this.viewCamera||a.scene.renderer.currentViewCamera;this._dynamicTexture.capture(a,{transform:this.viewTransform,camera:h}),this._dynamicTexture.render(),this.needsUpdate=!1}},setGameObject:function(t){return this.maskGameObject=t,this.needsUpdate=!0,this},setTexture:function(t){var e=this.camera.scene.sys.textures.getFrame(t);return e&&(this.maskGameObject=null,this.glTexture=e.glTexture),this},destroy:function(){this._dynamicTexture&&this._dynamicTexture.destroy(),this.maskGameObject=null,this._dynamicTexture=null,n.prototype.destroy.call(this)}});t.exports=a},37911(t,e,i){var r=i(83419),s=i(13045),n=i(37867),a=i(25836),o=new r({Extends:s,initialize:function(t,e){e=e||{},s.call(this,t,"FilterNormalTools"),this._rotation=0,this.viewMatrix=new n,this.setRotation(e.rotation||0),this.rotationSource=e.rotationSource||null,this.facingPower=e.facingPower||1,this.outputRatio=e.outputRatio||!1,this.ratioVector=new a(0,0,1),e.ratioVector&&this.ratioVector.set(e.ratioVector[0],e.ratioVector[1],e.ratioVector[2]),this.ratioRadius=e.ratioRadius||1},getRotation:function(){if(this.rotationSource){if("function"==typeof this.rotationSource)return this.rotationSource();if(this.rotationSource.hasTransformComponent)return this.rotationSource.getWorldTransformMatrix().rotationNormalized}return this._rotation},setRotation:function(t){return this.viewMatrix.identity().rotateZ(t),this._rotation=t,this},updateRotation:function(){if(this.rotationSource){var t=this.getRotation();this.viewMatrix.identity().rotateZ(t),this._rotation=t}return this}});t.exports=o},6379(t,e,i){var r=i(83419),s=i(13045),n=new r({Extends:s,initialize:function(t,e){void 0===e&&(e={}),s.call(this,t,"FilterPanoramaBlur"),this.radius=e.radius||1,this.samplesX=e.samplesX||32,this.samplesY=e.samplesY||16,this.power=e.power||1}});t.exports=n},2195(t,e,i){var r=i(83419),s=i(53427),n=i(13045),a=i(16762),o=new r({Extends:n,initialize:function(t){n.call(this,t,"FilterParallelFilters"),this.top=new s(t),this.bottom=new s(t),this.blend=new a(t)}});s.prototype.addParallelFilters=function(){return this.add(new o(this.camera))},t.exports=o},29861(t,e,i){var r=i(83419),s=i(13045),n=new r({Extends:s,initialize:function(t,e){void 0===e&&(e=1),s.call(this,t,"FilterPixelate"),this.amount=e}});t.exports=n},14366(t,e,i){var r=i(83419),s=i(13045),n=new r({Extends:s,initialize:function(t,e){e||(e={}),s.call(this,t,"FilterQuantize"),this.steps=[8,8,8,8],e.steps&&(this.steps[0]=e.steps[0],this.steps[1]=e.steps[1],this.steps[2]=e.steps[2],this.steps[3]=e.steps[3]),this.gamma=[1,1,1,1],e.gamma&&(this.gamma[0]=e.gamma[0],this.gamma[1]=e.gamma[1],this.gamma[2]=e.gamma[2],this.gamma[3]=e.gamma[3]),this.offset=[0,0,0,0],e.offset&&(this.offset[0]=e.offset[0],this.offset[1]=e.offset[1],this.offset[2]=e.offset[2],this.offset[3]=e.offset[3]),this.mode=e.mode||0,this.dither=!!e.dither}});t.exports=n},63785(t,e,i){var r=i(83419),s=i(13045),n=new r({Extends:s,initialize:function(t,e,i){void 0===i&&(i=null),s.call(this,t,"FilterSampler"),this.allowBaseDraw=!1,this.callback=e,this.region=i}});t.exports=n},62229(t,e,i){var r=i(83419),s=i(13045),n=new r({Extends:s,initialize:function(t,e,i,r,n,a,o,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=.1),void 0===n&&(n=1),void 0===o&&(o=6),void 0===h&&(h=1),s.call(this,t,"FilterShadow"),this.x=e,this.y=i,this.decay=r,this.power=n,this.glcolor=[0,0,0,1],this.samples=o,this.intensity=h,void 0!==a&&(this.color=a)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}},getPadding:function(){var t=this.paddingOverride;if(t)return this.currentPadding.setTo(t.x,t.y,t.width,t.height),t;var e=this.camera,i=this.decay*this.intensity,r=Math.ceil(Math.abs(this.x)*e.width*i),s=Math.ceil(Math.abs(this.y)*e.height*i);return this.currentPadding.setTo(-r,-s,2*r,2*s),this.currentPadding}});t.exports=n},99534(t,e,i){var r=i(83419),s=i(13045),n=new r({Extends:s,initialize:function(t,e,i,r){s.call(this,t,"FilterThreshold"),this.edge1=[.5,.5,.5,.5],this.edge2=[.5,.5,.5,.5],this.invert=[!1,!1,!1,!1],this.setEdge(e,i),this.setInvert(r)},setEdge:function(t,e){void 0===t&&(t=.5),"number"==typeof t&&(t=[t,t,t,t]),this.edge1[0]=t[0],this.edge1[1]=t[1],this.edge1[2]=t[2],this.edge1[3]=t[3],void 0===e&&(e=t),"number"==typeof e&&(e=[e,e,e,e]),this.edge2[0]=e[0],this.edge2[1]=e[1],this.edge2[2]=e[2],this.edge2[3]=e[3];for(var i=0;i<4;i++)if(this.edge1[i]>this.edge2[i]){var r=this.edge1[i];this.edge1[i]=this.edge2[i],this.edge2[i]=r}return this},setInvert:function(t){return void 0===t&&(t=!1),"boolean"==typeof t&&(t=[t,t,t,t]),this.invert[0]=t[0],this.invert[1]=t[1],this.invert[2]=t[2],this.invert[3]=t[3],this}});t.exports=n},20263(t,e,i){var r=i(83419),s=i(13045),n=i(40987),a=new r({Extends:s,initialize:function(t,e,i,r,a,o,h){void 0===e&&(e=.5),void 0===i&&(i=.5),void 0===r&&(r=.5),void 0===a&&(a=.5),void 0===o&&(o=0),void 0===h&&(h=0),s.call(this,t,"FilterVignette"),this.x=e,this.y=i,this.radius=r,this.strength=a,this.color=new n,this.blendMode=h,this.setColor(o)},setColor:function(t){return"number"==typeof t?n.IntegerToColor(t,this.color):"string"==typeof t?n.HexStringToColor(t,this.color):t.setTo?this.color.setTo(t.red,t.green,t.blue,t.alpha):t?this.color.setTo(t.r||0,t.g||0,t.b||0,t.a||255):this.color.setTo(0,0,0,255),this}});t.exports=a},90002(t,e,i){var r=i(83419),s=i(13045),n=i(79237),a=new r({Extends:s,initialize:function(t,e,i,r,n,a){void 0===e&&(e=.1),s.call(this,t,"FilterWipe"),this.progress=0,this.wipeWidth=e,this.direction=i||0,this.axis=r||0,this.reveal=n||0,this.wipeTexture=null,this.setTexture(a)},setWipeWidth:function(t){return void 0===t&&(t=.1),this.wipeWidth=t,this},setLeftToRight:function(){return this.direction=0,this.axis=0,this},setRightToLeft:function(){return this.direction=1,this.axis=0,this},setTopToBottom:function(){return this.direction=1,this.axis=1,this},setBottomToTop:function(){return this.direction=0,this.axis=1,this},setWipeEffect:function(){return this.reveal=0,this.progress=0,this},setRevealEffect:function(){return this.setTexture(),this.reveal=1,this.progress=0,this},setTexture:function(t){return void 0===t&&(t="__DEFAULT"),this.wipeTexture=t instanceof n?t:this.camera.scene.sys.textures.get(t)||this.camera.scene.sys.textures.get("__DEFAULT"),this},setProgress:function(t){return this.progress=t,this}});t.exports=a},11889(t,e,i){var r={Controller:i(13045),Barrel:i(10189),Blend:i(16762),Blocky:i(37597),Blur:i(88344),Bokeh:i(47564),ColorMatrix:i(77011),CombineColorMatrix:i(95200),Displacement:i(16898),Glow:i(42652),GradientMap:i(43927),ImageLight:i(84714),Key:i(51890),Mask:i(97797),NormalTools:i(37911),PanoramaBlur:i(6379),ParallelFilters:i(2195),Pixelate:i(29861),Quantize:i(14366),Sampler:i(63785),Shadow:i(62229),Threshold:i(99534),Vignette:i(20263),Wipe:i(90002)};t.exports=r},25305(t,e,i){var r=i(10312),s=i(23568);t.exports=function(t,e,i){e.x=s(i,"x",0),e.y=s(i,"y",0),e.depth=s(i,"depth",0),e.flipX=s(i,"flipX",!1),e.flipY=s(i,"flipY",!1);var n=s(i,"scale",null);"number"==typeof n?e.setScale(n):null!==n&&(e.scaleX=s(n,"x",1),e.scaleY=s(n,"y",1));var a=s(i,"scrollFactor",null);"number"==typeof a?e.setScrollFactor(a):null!==a&&(e.scrollFactorX=s(a,"x",1),e.scrollFactorY=s(a,"y",1)),e.rotation=s(i,"rotation",0);var o=s(i,"angle",null);null!==o&&(e.angle=o),e.alpha=s(i,"alpha",1);var h=s(i,"origin",null);if("number"==typeof h)e.setOrigin(h);else if(null!==h){var l=s(h,"x",.5),u=s(h,"y",.5);e.setOrigin(l,u)}return e.blendMode=s(i,"blendMode",r.NORMAL),e.visible=s(i,"visible",!0),s(i,"add",!0)&&t.sys.displayList.add(e),e.preUpdate&&t.sys.updateList.add(e),e}},13059(t,e,i){var r=i(23568);t.exports=function(t,e){var i=r(e,"anims",null);if(null===i)return t;if("string"==typeof i)t.anims.play(i);else if("object"==typeof i){var s=t.anims,n=r(i,"key",void 0);if(n){var a=r(i,"startFrame",void 0),o=r(i,"delay",0),h=r(i,"repeat",0),l=r(i,"repeatDelay",0),u=r(i,"yoyo",!1),d=r(i,"play",!1),c=r(i,"delayedPlay",0),f={key:n,delay:o,repeat:h,repeatDelay:l,yoyo:u,startFrame:a};d?s.play(f):c>0?s.playAfterDelay(f,c):s.load(f)}}return t}},8050(t,e,i){var r=i(83419),s=i(73162),n=i(37277),a=i(51708),o=i(44594),h=i(19186),l=new r({Extends:s,initialize:function(t){s.call(this,t),this.sortChildrenFlag=!1,this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.addCallback=this.addChildCallback,this.removeCallback=this.removeChildCallback,this.events.once(o.BOOT,this.boot,this),this.events.on(o.START,this.start,this)},boot:function(){this.events.once(o.DESTROY,this.destroy,this)},addChildCallback:function(t){t.displayList&&t.displayList!==this&&t.removeFromDisplayList(),t.parentContainer&&t.parentContainer.remove(t),t.displayList||(this.queueDepthSort(),t.displayList=this,t.emit(a.ADDED_TO_SCENE,t,this.scene),this.events.emit(o.ADDED_TO_SCENE,t,this.scene))},removeChildCallback:function(t){this.queueDepthSort(),t.displayList=null,t.emit(a.REMOVED_FROM_SCENE,t,this.scene),this.events.emit(o.REMOVED_FROM_SCENE,t,this.scene)},start:function(){this.events.once(o.SHUTDOWN,this.shutdown,this)},queueDepthSort:function(){this.sortChildrenFlag=!0},depthSort:function(){this.sortChildrenFlag&&(h(this.list,this.sortByDepth),this.sortChildrenFlag=!1)},sortByDepth:function(t,e){return t._depth-e._depth},getChildren:function(){return this.list},shutdown:function(){for(var t=this.list,e=t.length;e--;)t[e]&&t[e].destroy(!0);t.length=0,this.events.off(o.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(o.START,this.start,this),this.scene=null,this.systems=null,this.events=null}});n.register("DisplayList",l,"displayList"),t.exports=l},95643(t,e,i){var r=i(83419),s=i(31401),n=i(53774),a=i(45893),o=i(50792),h=i(51708),l=i(44594),u=new r({Extends:o,Mixins:[s.Filters,s.RenderSteps],initialize:function(t,e){o.call(this),this.scene=t,this.displayList=null,this.type=e,this.state=0,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.vertexRoundMode="safeAuto",this.input=null,this.body=null,this.ignoreDestroy=!1,this.isDestroyed=!1,this.addRenderStep&&this.addRenderStep(this.renderWebGL),this.on(h.ADDED_TO_SCENE,this.addedToScene,this),this.on(h.REMOVED_FROM_SCENE,this.removedFromScene,this),t.sys.queueDepthSort()},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},setState:function(t){return this.state=t,this},setDataEnabled:function(){return this.data||(this.data=new a(this)),this},setData:function(t,e){return this.data||(this.data=new a(this)),this.data.set(t,e),this},incData:function(t,e){return this.data||(this.data=new a(this)),this.data.inc(t,e),this},toggleData:function(t){return this.data||(this.data=new a(this)),this.data.toggle(t),this},getData:function(t){return this.data||(this.data=new a(this)),this.data.get(t)},setInteractive:function(t,e,i){return this.scene.sys.input.enable(this,t,e,i),this},disableInteractive:function(t){return void 0===t&&(t=!1),this.scene.sys.input.disable(this,t),this},removeInteractive:function(t){return void 0===t&&(t=!1),this.scene.sys.input.clear(this),t&&this.scene.sys.input.resetCursor(),this.input=void 0,this},addedToScene:function(){},removedFromScene:function(){},update:function(){},toJSON:function(){return n(this)},willRender:function(t){return!(!(!this.displayList||!this.displayList.active||this.displayList.willRender(t))||u.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},willRoundVertices:function(t,e){switch(this.vertexRoundMode){case"safe":return e;case"safeAuto":return e&&t.roundPixels;case"full":return!0;case"fullAuto":return t.roundPixels;default:return!1}},setVertexRoundMode:function(t){return this.vertexRoundMode=t,this},getIndexList:function(){for(var t=this,e=this.parentContainer,i=[];e&&(i.unshift(e.getIndex(t)),t=e,e.parentContainer);)e=e.parentContainer;return this.displayList?i.unshift(this.displayList.getIndex(t)):i.unshift(this.scene.sys.displayList.getIndex(t)),i},addToDisplayList:function(t){return void 0===t&&(t=this.scene.sys.displayList),this.displayList&&this.displayList!==t&&this.removeFromDisplayList(),t.exists(this)||(this.displayList=t,t.add(this,!0),t.queueDepthSort(),this.emit(h.ADDED_TO_SCENE,this,this.scene),t.events.emit(l.ADDED_TO_SCENE,this,this.scene)),this},addToUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.add(this),this},removeFromDisplayList:function(){var t=this.displayList||this.scene.sys.displayList;return t&&t.exists(this)&&(t.remove(this,!0),t.queueDepthSort(),this.displayList=null,this.emit(h.REMOVED_FROM_SCENE,this,this.scene),t.events.emit(l.REMOVED_FROM_SCENE,this,this.scene)),this},removeFromUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.remove(this),this},getDisplayList:function(){var t=null;return this.parentContainer?t=this.parentContainer.list:this.displayList&&(t=this.displayList.list),t},destroy:function(t){this.scene&&!this.ignoreDestroy&&(void 0===t&&(t=!1),this.isDestroyed=!0,this.preDestroy&&this.preDestroy.call(this),this.emit(h.DESTROY,this,t),this.removeAllListeners(),this.removeFromDisplayList(),this.removeFromUpdateList(),this.input&&(this.scene.sys.input.clear(this),this.input=void 0),this.data&&(this.data.destroy(),this.data=void 0),this.body&&(this.body.destroy(),this.body=void 0),this.filterCamera&&(this.filterCamera.destroy(),this.filterCamera=void 0),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0)}});u.RENDER_MASK=15,t.exports=u},44603(t,e,i){var r=i(83419),s=i(37277),n=i(44594),a=new r({initialize:function(t){this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.displayList,this.updateList,this.events.once(n.BOOT,this.boot,this),this.events.on(n.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(n.DESTROY,this.destroy,this)},start:function(){this.events.once(n.SHUTDOWN,this.shutdown,this)},shutdown:function(){this.events.off(n.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(n.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});a.register=function(t,e){a.prototype.hasOwnProperty(t)||(a.prototype[t]=e)},a.remove=function(t){a.prototype.hasOwnProperty(t)&&delete a.prototype[t]},s.register("GameObjectCreator",a,"make"),t.exports=a},39429(t,e,i){var r=i(83419),s=i(37277),n=i(44594),a=new r({initialize:function(t){this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.displayList,this.updateList,this.events.once(n.BOOT,this.boot,this),this.events.on(n.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(n.DESTROY,this.destroy,this)},start:function(){this.events.once(n.SHUTDOWN,this.shutdown,this)},existing:function(t){return(t.renderCanvas||t.renderWebGL)&&this.displayList.add(t),t.preUpdate&&this.updateList.add(t),t},shutdown:function(){this.events.off(n.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(n.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});a.register=function(t,e){a.prototype.hasOwnProperty(t)||(a.prototype[t]=e)},a.remove=function(t){a.prototype.hasOwnProperty(t)&&delete a.prototype[t]},s.register("GameObjectFactory",a,"add"),t.exports=a},91296(t,e,i){var r=i(61340),s=new r,n=new r,a=new r,o=new r,h={camera:s,sprite:n,calc:a,cameraExternal:o};t.exports=function(t,e,i,r){return r?o.loadIdentity():o.copyFrom(e.matrixExternal),s.copyWithScrollFactorFrom(r?e.matrix:e.matrixCombined,e.scrollX,e.scrollY,t.scrollFactorX,t.scrollFactorY),a.copyFrom(s),i&&a.multiply(i),n.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),a.multiply(n),h}},45027(t,e,i){var r=i(83419),s=i(25774),n=i(37277),a=i(44594),o=new r({Extends:s,initialize:function(t){s.call(this),this.checkQueue=!0,this.scene=t,this.systems=t.sys,t.sys.events.once(a.BOOT,this.boot,this),t.sys.events.on(a.START,this.start,this)},boot:function(){this.systems.events.once(a.DESTROY,this.destroy,this)},start:function(){var t=this.systems.events;t.on(a.PRE_UPDATE,this.update,this),t.on(a.UPDATE,this.sceneUpdate,this),t.once(a.SHUTDOWN,this.shutdown,this)},sceneUpdate:function(t,e){for(var i=this._active,r=i.length,s=0;s0){a=o.split("\n");var z=[];for(s=0;sC&&(d=C),c>E&&(c=E);var q=C+b.xAdvance,K=E+m;fD&&(D=I),ID&&(D=I),I0)for(var Q=0;Qo.length&&(x=o.length);for(var T=p,w=g,b={retroFont:!0,font:h,size:i,lineHeight:s+y,chars:{}},S=0,C=0;C?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",TEXT_SET2:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET3:"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",TEXT_SET4:"ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789",TEXT_SET5:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789",TEXT_SET6:"ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' ",TEXT_SET7:"AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39",TEXT_SET8:"0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET9:"ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?!",TEXT_SET10:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET11:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789"}},2638(t,e,i){var r=i(22186),s=i(83419),n=i(12310),a=new s({Extends:r,Mixins:[n],initialize:function(t,e,i,s,n,a,o){r.call(this,t,e,i,s,n,a,o),this.type="DynamicBitmapText",this.scrollX=0,this.scrollY=0,this.cropWidth=0,this.cropHeight=0,this.displayCallback,this.callbackData={parent:this,color:0,tint:{topLeft:0,topRight:0,bottomLeft:0,bottomRight:0},index:0,charCode:0,x:0,y:0,scale:0,rotation:0,data:0}},setSize:function(t,e){return this.cropWidth=t,this.cropHeight=e,this},setDisplayCallback:function(t){return this.displayCallback=t,this},setScrollX:function(t){return this.scrollX=t,this},setScrollY:function(t){return this.scrollY=t,this}});t.exports=a},86741(t,e,i){var r=i(20926);t.exports=function(t,e,i,s){var n=e._text,a=n.length,o=t.currentContext;if(0!==a&&r(t,o,e,i,s)){i.addToRenderList(e);var h=e.fromAtlas?e.frame:e.texture.frames.__BASE,l=e.displayCallback,u=e.callbackData,d=e.fontData.chars,c=e.fontData.lineHeight,f=e._letterSpacing,p=0,g=0,m=0,v=null,y=0,x=0,T=0,w=0,b=0,S=0,C=null,E=0,A=e.frame.source.image,_=h.cutX,M=h.cutY,R=0,P=0,O=e._fontSize/e.fontData.size,L=e._align,D=0,F=0;e.getTextBounds(!1);var I=e._bounds.lines;1===L?F=(I.longest-I.lengths[0])/2:2===L&&(F=I.longest-I.lengths[0]),o.translate(-e.displayOriginX,-e.displayOriginY);var N=i.roundPixels;e.cropWidth>0&&e.cropHeight>0&&(o.beginPath(),o.rect(0,0,e.cropWidth,e.cropHeight),o.clip());for(var B=0;B0||e.cropHeight>0;x&&((f=i.getClone()).setScissorEnable(!0),f.setScissorBox(v.tx,v.ty,e.cropWidth*v.scaleX,e.cropHeight*v.scaleY),f.use()),h.frame=e.frame;var T,w,b=s.MULTIPLY,S=a.getTintAppendFloatAlpha(e.tintTopLeft,e._alphaTL),C=a.getTintAppendFloatAlpha(e.tintTopRight,e._alphaTR),E=a.getTintAppendFloatAlpha(e.tintBottomLeft,e._alphaBL),A=a.getTintAppendFloatAlpha(e.tintBottomRight,e._alphaBR),_=0,M=0,R=0,P=0,O=e.letterSpacing,L=0,D=0,F=e.scrollX,I=e.scrollY,N=e.fontData,B=N.chars,k=N.lineHeight,U=e.fontSize/N.size,z=0,Y=e._align,X=0,W=0,G=e.getTextBounds(!1);e.maxWidth>0&&(d=(u=G.wrappedText).length);var V=e._bounds.lines;1===Y?W=(V.longest-V.lengths[0])/2:2===Y&&(W=V.longest-V.lengths[0]);for(var H=e.displayCallback,j=e.callbackData,q=0;q0&&(a=(n=L.wrappedText).length);var D=e._bounds.lines;1===R?O=(D.longest-D.lengths[0])/2:2===R&&(O=D.longest-D.lengths[0]),o.translate(-e.displayOriginX,-e.displayOriginY);for(var F=i.roundPixels,I=0;I0},getRenderList:function(){return this.dirty&&(this.renderList=this.children.list.filter(this.childCanRender,this),this.dirty=!1),this.renderList},clear:function(){this.children.removeAll(),this.dirty=!0},preDestroy:function(){this.children.destroy(),this.renderList=[]}});t.exports=d},72396(t){t.exports=function(t,e,i,r){var s=e.getRenderList();if(0!==s.length){var n=t.currentContext,a=i.alpha*e.alpha;if(0!==a){i.addToRenderList(e),n.globalCompositeOperation=t.blendModes[e.blendMode],n.imageSmoothingEnabled=!e.frame.source.scaleMode;var o=e.x-i.scrollX*e.scrollFactorX,h=e.y-i.scrollY*e.scrollFactorY;n.save(),r&&r.copyToContext(n);for(var l=i.roundPixels,u=0;u0&&p.height>0&&(n.save(),n.translate(d.x+o,d.y+h),n.scale(v,y),n.drawImage(f.source.image,p.x,p.y,p.width,p.height,g,m,p.width,p.height),n.restore())):(l&&(g=Math.round(g),m=Math.round(m)),p.width>0&&p.height>0&&n.drawImage(f.source.image,p.x,p.y,p.width,p.height,g+d.x+o,m+d.y+h,p.width,p.height)))}n.restore()}}}},9403(t,e,i){var r=i(6107),s=i(25305),n=i(44603),a=i(23568);n.register("blitter",function(t,e){void 0===t&&(t={});var i=a(t,"key",null),n=a(t,"frame",null),o=new r(this.scene,0,0,i,n);return void 0!==e&&(t.add=e),s(this.scene,o,t),o})},12709(t,e,i){var r=i(6107);i(39429).register("blitter",function(t,e,i,s){return this.displayList.add(new r(this.scene,t,e,i,s))})},48011(t,e,i){var r=i(29747),s=r,n=r;s=i(99485),n=i(72396),t.exports={renderWebGL:s,renderCanvas:n}},99485(t,e,i){var r=i(61340),s=i(70554),n=new r,a={quad:new Float32Array(8)},o={},h={};t.exports=function(t,e,i,r){var l=e.getRenderList(),u=i.camera,d=e.alpha;if(0!==l.length&&0!==d){u.addToRenderList(e);var c=n.copyWithScrollFactorFrom(u.getViewMatrix(!i.useCanvas),u.scrollX,u.scrollY,e.scrollFactorX,e.scrollFactorY);r&&c.multiply(r);for(var f=e.x,p=e.y,g=e.customRenderNodes,m=e.defaultRenderNodes,v=0;v0!=t>0,this._alpha=t}}});t.exports=n},43451(t,e,i){var r=i(87774),s=i(30529),n=i(83419),a=i(31401),o=i(95643),h=i(36683),l=new n({Extends:o,Mixins:[a.BlendMode,a.Depth,a.RenderNodes,a.Visible,h],initialize:function(t,e){o.call(this,t,"CaptureFrame");var i=t.renderer;this.drawingContext=new r(i,{width:i.width,height:i.height}),this.captureTexture=t.sys.textures.addGLTexture(e,this.drawingContext.texture),this.initRenderNodes(this._defaultRenderNodesMap)},_defaultRenderNodesMap:{get:function(){return s}},setAlpha:function(t){return this},setScrollFactor:function(t,e){return this}});t.exports=l},23675(t,e,i){var r=i(44603),s=i(23568),n=i(43451);r.register("captureFrame",function(t,e){void 0===t&&(t={});var i=s(t,"depth",0),r=s(t,"key",null),a=s(t,"visible",!0),o=new n(this.scene,r);return void 0!==e&&(t.add=e),o.setDepth(i).setVisible(a),t.add&&this.scene.sys.displayList.add(o),o})},20421(t,e,i){var r=i(43451);i(39429).register("captureFrame",function(t){return this.displayList.add(new r(this.scene,t))})},36683(t,e,i){var r=i(29747),s=r,n=r;s=i(82237),t.exports={renderWebGL:s,renderCanvas:n}},82237(t){var e=!1;t.exports=function(t,i,r){if(r.useCanvas)e||(e=!0,console.warn("CaptureFrame: Cannot capture from main canvas. Activate `forceComposite` on the camera to use this feature. This warning will now mute."));else{r.camera.addToRenderList(i);var s=r.width,n=r.height,a=i.customRenderNodes,o=i.defaultRenderNodes;i.drawingContext.resize(s,n),i.drawingContext.use(),(a.BatchHandler||o.BatchHandler).batch(i.drawingContext,r.texture,0,n,0,0,s,n,s,0,0,0,1,1,!1,4294967295,4294967295,4294967295,4294967295,{}),i.drawingContext.release()}}},16005(t,e,i){var r=i(45319),s={_alpha:1,_alphaTL:1,_alphaTR:1,_alphaBL:1,_alphaBR:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t,e,i,s){return void 0===t&&(t=1),void 0===e?this.alpha=t:(this._alphaTL=r(t,0,1),this._alphaTR=r(e,0,1),this._alphaBL=r(i,0,1),this._alphaBR=r(s,0,1)),this},alpha:{get:function(){return this._alpha},set:function(t){var e=r(t,0,1);this._alpha=e,this._alphaTL=e,this._alphaTR=e,this._alphaBL=e,this._alphaBR=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}},alphaTopLeft:{get:function(){return this._alphaTL},set:function(t){var e=r(t,0,1);this._alphaTL=e,0!==e&&(this.renderFlags|=2)}},alphaTopRight:{get:function(){return this._alphaTR},set:function(t){var e=r(t,0,1);this._alphaTR=e,0!==e&&(this.renderFlags|=2)}},alphaBottomLeft:{get:function(){return this._alphaBL},set:function(t){var e=r(t,0,1);this._alphaBL=e,0!==e&&(this.renderFlags|=2)}},alphaBottomRight:{get:function(){return this._alphaBR},set:function(t){var e=r(t,0,1);this._alphaBR=e,0!==e&&(this.renderFlags|=2)}}};t.exports=s},88509(t,e,i){var r=i(45319),s={_alpha:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t){return void 0===t&&(t=1),this.alpha=t,this},alpha:{get:function(){return this._alpha},set:function(t){var e=r(t,0,1);this._alpha=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}}};t.exports=s},90065(t,e,i){var r=i(10312),s={_blendMode:r.NORMAL,blendMode:{get:function(){return this._blendMode},set:function(t){"string"==typeof t&&(t=r[t]),(t|=0)>=-1&&(this._blendMode=t)}},setBlendMode:function(t){return this.blendMode=t,this}};t.exports=s},94215(t){t.exports={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}}},61683(t){var e={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,r){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,r,this.flipX,this.flipY);else{var s=t;this.frame.setCropUVs(this._crop,s.x,s.y,s.width,s.height,this.flipX,this.flipY)}this.isCropped=!0}return this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=e},89272(t,e,i){const r=i(7889);t.exports=r.DepthDescriptors,Object.defineProperty(t.exports,"Depth",{value:r.Depth})},3248(t){var e={timeElapsed:0,timeElapsedResetPeriod:36e5,timePaused:!1,setTimerResetPeriod:function(t){return this.timeElapsedResetPeriod=t,this},setTimerPaused:function(t){return this.timePaused=!!t,this},resetTimer:function(t){return void 0===t&&(t=0),this.timeElapsed=t,this},updateTimer:function(t,e){return this.timePaused||(this.timeElapsed+=e,this.timeElapsed>=this.timeElapsedResetPeriod&&(this.timeElapsed-=this.timeElapsedResetPeriod)),this}};t.exports=e},53427(t,e,i){var r=i(83419),s=i(10189),n=i(16762),a=i(37597),o=i(88344),h=i(47564),l=i(77011),u=i(95200),d=i(16898),c=i(42652),f=i(43927),p=i(84714),g=i(51890),m=i(97797),v=i(37911),y=i(6379),x=i(29861),T=i(14366),w=i(63785),b=i(62229),S=i(99534),C=i(20263),E=i(90002),A=new r({initialize:function(t){this.camera=t,this.list=[]},clear:function(){for(var t=0;t0||this.filters.external.getActive().length>0||this.filtersForceComposite)},enableFilters:function(){if(this.filterCamera||!this.scene.renderer.gl)return this;var t=this.scene;if(r||(r=i(38058)),this.filterCamera=new r(0,0,1,1).setScene(t,!1),this.filterCamera.isObjectInversion=!0,t.game.config.roundPixels&&(this.filterCamera.roundPixels=!0),!this.maxFilterSize){var e=t.renderer.getMaxTextureSize();this.maxFilterSize=new s(e,e)}return this._filtersMatrix=new n,this._filtersViewMatrix=new n,this.getBounds&&void 0!==this.width&&void 0!==this.height&&0!==this.width&&0!==this.height||(this.filtersFocusContext=!0),this.addRenderStep(this.renderWebGLFilters,0),this},renderWebGLFilters:function(t,e,i,r,s){if(e.willRenderFilters()){var n=i.camera,a=e.filtersAutoFocus,o=e.filtersFocusContext;a&&(o?e.focusFiltersOnCamera(n):e.focusFilters());var h=e.filterCamera;h.preRender();var l=h.roundPixels;if(h.roundPixels=e.willRoundVertices(h,e.rotation%(2*Math.PI)==0&&(e.scaleX,1===e.scaleY)),a&&o){var u=e.parentContainer;if(u){var d=u.getWorldTransformMatrix();h.matrix.multiply(d)}}var c=e._filtersMatrix,f=e._filtersViewMatrix.copyWithScrollFactorFrom(n.getViewMatrix(!i.useCanvas),n.scrollX,n.scrollY,e.scrollFactorX,e.scrollFactorY);if(r&&f.multiply(r),o)c.loadIdentity();else{if("Layer"===e.type)c.loadIdentity();else{var p=e.flipX?-1:1,g=e.flipY?-1:1;c.applyITRS(e.x,e.y,e.rotation,e.scaleX*p,e.scaleY*g)}var m=h.width,v=h.height;c.translate(-m*h.originX,-v*h.originY),f.multiply(c,c)}var y=e.scrollFactorX,x=e.scrollFactorY;e.scrollFactorX=1,e.scrollFactorY=1,t.cameraRenderNode.run(i,[e],h,c,!0,s+1),e.scrollFactorX=y,e.scrollFactorY=x,h.roundPixels=l;for(var T=h.renderList.length,w=0;w0?Math.acos(e/this.scaleX):-Math.acos(e/this.scaleX):r||n?s.PI_OVER_2-(n>0?Math.acos(-r/this.scaleY):-Math.acos(r/this.scaleY)):0}},scaleX:{get:function(){return Math.sqrt(this.a*this.a+this.b*this.b)}},scaleY:{get:function(){return Math.sqrt(this.c*this.c+this.d*this.d)}},loadIdentity:function(){var t=this.matrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,this},translate:function(t,e){var i=this.matrix;return i[4]=i[0]*t+i[2]*e+i[4],i[5]=i[1]*t+i[3]*e+i[5],this},scale:function(t,e){var i=this.matrix;return i[0]*=t,i[1]*=t,i[2]*=e,i[3]*=e,this},rotate:function(t){var e=Math.sin(t),i=Math.cos(t),r=this.matrix,s=r[0],n=r[1],a=r[2],o=r[3];return r[0]=s*i+a*e,r[1]=n*i+o*e,r[2]=s*-e+a*i,r[3]=n*-e+o*i,this},multiply:function(t,e){var i=this.matrix,r=t.matrix,s=i[0],n=i[1],a=i[2],o=i[3],h=i[4],l=i[5],u=r[0],d=r[1],c=r[2],f=r[3],p=r[4],g=r[5],m=void 0===e?i:e.matrix;return m[0]=u*s+d*a,m[1]=u*n+d*o,m[2]=c*s+f*a,m[3]=c*n+f*o,m[4]=p*s+g*a+h,m[5]=p*n+g*o+l,m},multiplyWithOffset:function(t,e,i){var r=this.matrix,s=t.matrix,n=r[0],a=r[1],o=r[2],h=r[3],l=e*n+i*o+r[4],u=e*a+i*h+r[5],d=s[0],c=s[1],f=s[2],p=s[3],g=s[4],m=s[5];return r[0]=d*n+c*o,r[1]=d*a+c*h,r[2]=f*n+p*o,r[3]=f*a+p*h,r[4]=g*n+m*o+l,r[5]=g*a+m*h+u,this},transform:function(t,e,i,r,s,n){var a=this.matrix,o=a[0],h=a[1],l=a[2],u=a[3],d=a[4],c=a[5];return a[0]=t*o+e*l,a[1]=t*h+e*u,a[2]=i*o+r*l,a[3]=i*h+r*u,a[4]=s*o+n*l+d,a[5]=s*h+n*u+c,this},transformPoint:function(t,e,i){void 0===i&&(i={x:0,y:0});var r=this.matrix,s=r[0],n=r[1],a=r[2],o=r[3],h=r[4],l=r[5];return i.x=t*s+e*a+h,i.y=t*n+e*o+l,i},invert:function(){var t=this.matrix,e=t[0],i=t[1],r=t[2],s=t[3],n=t[4],a=t[5],o=e*s-i*r;return t[0]=s/o,t[1]=-i/o,t[2]=-r/o,t[3]=e/o,t[4]=(r*a-s*n)/o,t[5]=-(e*a-i*n)/o,this},copyFrom:function(t){var e=this.matrix;return e[0]=t.a,e[1]=t.b,e[2]=t.c,e[3]=t.d,e[4]=t.e,e[5]=t.f,this},copyFromArray:function(t){var e=this.matrix;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],this},copyWithScrollFactorFrom:function(t,e,i,r,s){var n=this.matrix;n[0]=t.a,n[1]=t.b,n[2]=t.c,n[3]=t.d;var a=e*(1-r),o=i*(1-s);return n[4]=t.a*a+t.c*o+t.e,n[5]=t.b*a+t.d*o+t.f,this},copyToContext:function(t){var e=this.matrix;return t.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t},setToContext:function(t){return t.setTransform(this.a,this.b,this.c,this.d,this.e,this.f),t},copyToArray:function(t){var e=this.matrix;return void 0===t?t=[e[0],e[1],e[2],e[3],e[4],e[5]]:(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5]),t},setTransform:function(t,e,i,r,s,n){var a=this.matrix;return a[0]=t,a[1]=e,a[2]=i,a[3]=r,a[4]=s,a[5]=n,this},decomposeMatrix:function(){var t=this.decomposedMatrix,e=this.matrix,i=e[0],r=e[1],s=e[2],n=e[3],a=i*n-r*s;if(t.translateX=e[4],t.translateY=e[5],i||r){var o=Math.sqrt(i*i+r*r);t.rotation=r>0?Math.acos(i/o):-Math.acos(i/o),t.scaleX=o,t.scaleY=a/o}else if(s||n){var h=Math.sqrt(s*s+n*n);t.rotation=.5*Math.PI-(n>0?Math.acos(-s/h):-Math.acos(s/h)),t.scaleX=a/h,t.scaleY=h}else t.rotation=0,t.scaleX=0,t.scaleY=0;return t},applyITRS:function(t,e,i,r,s){var n=this.matrix,a=Math.sin(i),o=Math.cos(i);return n[4]=t,n[5]=e,n[0]=o*r,n[1]=a*r,n[2]=-a*s,n[3]=o*s,this},applyInverse:function(t,e,i){void 0===i&&(i=new n);var r=this.matrix,s=r[0],a=r[1],o=r[2],h=r[3],l=r[4],u=r[5],d=1/(s*h+o*-a);return i.x=h*d*t+-o*d*e+(u*o-l*h)*d,i.y=s*d*e+-a*d*t+(-u*s+l*a)*d,i},setQuad:function(t,e,i,r,s){void 0===s&&(s=this.quad);var n=this.matrix,a=n[0],o=n[1],h=n[2],l=n[3],u=n[4],d=n[5];return s[0]=t*a+e*h+u,s[1]=t*o+e*l+d,s[2]=t*a+r*h+u,s[3]=t*o+r*l+d,s[4]=i*a+r*h+u,s[5]=i*o+r*l+d,s[6]=i*a+e*h+u,s[7]=i*o+e*l+d,s},getX:function(t,e){return t*this.a+e*this.c+this.e},getY:function(t,e){return t*this.b+e*this.d+this.f},getXRound:function(t,e,i){var r=this.getX(t,e);return i&&(r=Math.floor(r+.5)),r},getYRound:function(t,e,i){var r=this.getY(t,e);return i&&(r=Math.floor(r+.5)),r},getCSSMatrix:function(){var t=this.matrix;return"matrix("+t[0]+","+t[1]+","+t[2]+","+t[3]+","+t[4]+","+t[5]+")"},destroy:function(){this.matrix=null,this.quad=null,this.decomposedMatrix=null}});t.exports=a},59715(t,e,i){const r=i(36626);t.exports=r.VisibleDescriptors,Object.defineProperty(t.exports,"Visible",{value:r.Visible})},31401(t,e,i){t.exports={Alpha:i(16005),AlphaSingle:i(88509),BlendMode:i(90065),ComputedSize:i(94215),Crop:i(61683),Depth:i(89272),ElapseTimer:i(3248),FilterList:i(53427),Filters:i(43102),Flip:i(54434),GetBounds:i(8004),Lighting:i(73629),Mask:i(8573),Origin:i(27387),PathFollower:i(37640),RenderNodes:i(68680),RenderSteps:i(86038),ScrollFactor:i(80227),Size:i(16736),Texture:i(37726),TextureCrop:i(79812),Tint:i(27472),ToJSON:i(53774),Transform:i(16901),TransformMatrix:i(61340),Visible:i(59715)}},31559(t,e,i){var r=i(37105),s=i(10312),n=i(83419),a=i(31401),o=i(51708),h=i(95643),l=i(87841),u=i(29959),d=i(36899),c=i(26099),f=i(93595),p=new a.TransformMatrix,g=new n({Extends:h,Mixins:[a.AlphaSingle,a.BlendMode,a.ComputedSize,a.Depth,a.Mask,a.Transform,a.Visible,u],initialize:function(t,e,i,r){h.call(this,t,"Container"),this.list=[],this.exclusive=!0,this.maxSize=-1,this.position=0,this.localTransform=new a.TransformMatrix,this._sortKey="",this._sysEvents=t.sys.events,this.scrollFactorX=1,this.scrollFactorY=1,this.setPosition(e,i),this.setBlendMode(s.SKIP_CHECK),r&&this.add(r)},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return.5*this.width}},displayOriginY:{get:function(){return.5*this.height}},setExclusive:function(t){return void 0===t&&(t=!0),this.exclusive=t,this},getBounds:function(t){if(void 0===t&&(t=new l),t.setTo(this.x,this.y,0,0),this.parentContainer){var e=this.parentContainer.getBoundsTransformMatrix().transformPoint(this.x,this.y);t.setTo(e.x,e.y,0,0)}if(this.list.length>0){var i=this.list,r=new l,s=!1;t.setEmpty();for(var n=0;n-1},setAll:function(t,e,i,s){return r.SetAll(this.list,t,e,i,s),this},each:function(t,e){var i,r=[null],s=this.list.slice(),n=s.length;for(i=2;i0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.list=[]},onChildDestroyed:function(t){r.Remove(this.list,t),this.exclusive&&(t.parentContainer=null,t.removedFromScene())}});t.exports=g},53584(t){t.exports=function(t,e,i,r){i.addToRenderList(e);var s=e.list;if(0!==s.length){var n=e.localTransform;r?(n.loadIdentity(),n.multiply(r),n.translate(e.x,e.y),n.rotate(e.rotation),n.scale(e.scaleX,e.scaleY)):n.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var a=-1!==e.blendMode;a||t.setBlendMode(0);var o=e._alpha,h=e.scrollFactorX,l=e.scrollFactorY;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var u=0;u=0,d=a>=0,f=o>=0,p=h>=0;return n=Math.abs(n),a=Math.abs(a),o=Math.abs(o),h=Math.abs(h),this.beginPath(),this.moveTo(t+n,e),this.lineTo(t+i-a,e),d?this.arc(t+i-a,e+a,a,-c.PI_OVER_2,0):this.arc(t+i,e,a,Math.PI,c.PI_OVER_2,!0),this.lineTo(t+i,e+r-h),p?this.arc(t+i-h,e+r-h,h,0,c.PI_OVER_2):this.arc(t+i,e+r,h,-c.PI_OVER_2,Math.PI,!0),this.lineTo(t+o,e+r),f?this.arc(t+o,e+r-o,o,c.PI_OVER_2,Math.PI):this.arc(t,e+r,o,0,-c.PI_OVER_2,!0),this.lineTo(t,e+n),l?this.arc(t+n,e+n,n,-Math.PI,-c.PI_OVER_2):this.arc(t,e,n,c.PI_OVER_2,0,!0),this.fillPath(),this},strokeRoundedRect:function(t,e,i,r,s){void 0===s&&(s=20);var n=s,a=s,o=s,h=s,l=Math.min(i,r)/2;"number"!=typeof s&&(n=u(s,"tl",20),a=u(s,"tr",20),o=u(s,"bl",20),h=u(s,"br",20));var d=n>=0,f=a>=0,p=o>=0,g=h>=0;return n=Math.min(Math.abs(n),l),a=Math.min(Math.abs(a),l),o=Math.min(Math.abs(o),l),h=Math.min(Math.abs(h),l),this.beginPath(),this.moveTo(t+n,e),this.lineTo(t+i-a,e),this.moveTo(t+i-a,e),f?this.arc(t+i-a,e+a,a,-c.PI_OVER_2,0):this.arc(t+i,e,a,Math.PI,c.PI_OVER_2,!0),this.lineTo(t+i,e+r-h),this.moveTo(t+i,e+r-h),g?this.arc(t+i-h,e+r-h,h,0,c.PI_OVER_2):this.arc(t+i,e+r,h,-c.PI_OVER_2,Math.PI,!0),this.lineTo(t+o,e+r),this.moveTo(t+o,e+r),p?this.arc(t+o,e+r-o,o,c.PI_OVER_2,Math.PI):this.arc(t,e+r,o,0,-c.PI_OVER_2,!0),this.lineTo(t,e+n),this.moveTo(t,e+n),d?this.arc(t+n,e+n,n,-Math.PI,-c.PI_OVER_2):this.arc(t,e,n,c.PI_OVER_2,0,!0),this.strokePath(),this},fillPointShape:function(t,e){return this.fillPoint(t.x,t.y,e)},fillPoint:function(t,e,i){return!i||i<1?i=1:(t-=i/2,e-=i/2),this.commandBuffer.push(n.FILL_RECT,t,e,i,i),this},fillTriangleShape:function(t){return this.fillTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},strokeTriangleShape:function(t){return this.strokeTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},fillTriangle:function(t,e,i,r,s,a){return this.commandBuffer.push(n.FILL_TRIANGLE,t,e,i,r,s,a),this},strokeTriangle:function(t,e,i,r,s,a){return this.commandBuffer.push(n.STROKE_TRIANGLE,t,e,i,r,s,a),this},strokeLineShape:function(t){return this.lineBetween(t.x1,t.y1,t.x2,t.y2)},lineBetween:function(t,e,i,r){return this.beginPath(),this.moveTo(t,e),this.lineTo(i,r),this.strokePath(),this},lineTo:function(t,e){return this.commandBuffer.push(n.LINE_TO,t,e),this},moveTo:function(t,e){return this.commandBuffer.push(n.MOVE_TO,t,e),this},strokePoints:function(t,e,i,r){void 0===e&&(e=!1),void 0===i&&(i=!1),void 0===r&&(r=t.length),this.beginPath(),this.moveTo(t[0].x,t[0].y);for(var s=1;s-1&&this.fillStyle(this.defaultFillColor,this.defaultFillAlpha),this.defaultStrokeColor>-1&&this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha),this},generateTexture:function(t,e,i){var r,s,n=this.scene.sys,a=n.game.renderer;void 0===e&&(e=n.scale.width),void 0===i&&(i=n.scale.height),p.TargetCamera.setScene(this.scene),p.TargetCamera.setViewport(0,0,e,i),p.TargetCamera.scrollX=this.x,p.TargetCamera.scrollY=this.y;var o={willReadFrequently:!0};if("string"==typeof t)if(n.textures.exists(t)){var h=(r=n.textures.get(t)).getSourceImage();h instanceof HTMLCanvasElement&&(s=h.getContext("2d",o))}else s=(r=n.textures.createCanvas(t,e,i)).getSourceImage().getContext("2d",o);else t instanceof HTMLCanvasElement&&(s=t.getContext("2d",o));return s&&(this.renderCanvas(a,this,p.TargetCamera,null,s,!1),r&&r.refresh()),this},preDestroy:function(){this.commandBuffer=[]}});p.TargetCamera=new r,t.exports=p},32768(t,e,i){var r=i(85592),s=i(20926);t.exports=function(t,e,i,n,a,o){var h=e.commandBuffer,l=h.length,u=a||t.currentContext;if(0!==l&&s(t,u,e,i,n)){i.addToRenderList(e);var d=1,c=1,f=0,p=0,g=1,m=0,v=0,y=0;u.beginPath();for(var x=0;x>>16,v=(65280&f)>>>8,y=255&f,u.strokeStyle="rgba("+m+","+v+","+y+","+d+")",u.lineWidth=g,x+=3;break;case r.FILL_STYLE:p=h[x+1],c=h[x+2],m=(16711680&p)>>>16,v=(65280&p)>>>8,y=255&p,u.fillStyle="rgba("+m+","+v+","+y+","+c+")",x+=2;break;case r.BEGIN_PATH:u.beginPath();break;case r.CLOSE_PATH:u.closePath();break;case r.FILL_PATH:o||u.fill();break;case r.STROKE_PATH:o||u.stroke();break;case r.FILL_RECT:o?u.rect(h[x+1],h[x+2],h[x+3],h[x+4]):u.fillRect(h[x+1],h[x+2],h[x+3],h[x+4]),x+=4;break;case r.FILL_TRIANGLE:u.beginPath(),u.moveTo(h[x+1],h[x+2]),u.lineTo(h[x+3],h[x+4]),u.lineTo(h[x+5],h[x+6]),u.closePath(),o||u.fill(),x+=6;break;case r.STROKE_TRIANGLE:u.beginPath(),u.moveTo(h[x+1],h[x+2]),u.lineTo(h[x+3],h[x+4]),u.lineTo(h[x+5],h[x+6]),u.closePath(),o||u.stroke(),x+=6;break;case r.LINE_TO:u.lineTo(h[x+1],h[x+2]),x+=2;break;case r.MOVE_TO:u.moveTo(h[x+1],h[x+2]),x+=2;break;case r.LINE_FX_TO:u.lineTo(h[x+1],h[x+2]),x+=5;break;case r.MOVE_FX_TO:u.moveTo(h[x+1],h[x+2]),x+=5;break;case r.SAVE:u.save();break;case r.RESTORE:u.restore();break;case r.TRANSLATE:u.translate(h[x+1],h[x+2]),x+=2;break;case r.SCALE:u.scale(h[x+1],h[x+2]),x+=2;break;case r.ROTATE:u.rotate(h[x+1]),x+=1;break;case r.GRADIENT_FILL_STYLE:x+=5;break;case r.GRADIENT_LINE_STYLE:x+=6}}u.restore()}}},87079(t,e,i){var r=i(44603),s=i(43831);r.register("graphics",function(t,e){void 0===t&&(t={}),void 0!==e&&(t.add=e);var i=new s(this.scene,t);return t.add&&this.scene.sys.displayList.add(i),i})},1201(t,e,i){var r=i(43831);i(39429).register("graphics",function(t){return this.displayList.add(new r(this.scene,t))})},84503(t,e,i){var r=i(29747),s=r,n=r;s=i(77545),n=i(32768),n=i(32768),t.exports={renderWebGL:s,renderCanvas:n}},77545(t,e,i){var r=i(85592),s=i(91296),n=i(70554),a=i(61340),o=function(t,e,i){this.x=t,this.y=e,this.width=i},h=function(t,e,i){this.points=[],this.points[0]=new o(t,e,i),this.addPoint=function(t,e,i){var r=this.points[this.points.length-1];r.x===t&&r.y===e||this.points.push(new o(t,e,i))}},l=[],u=new a,d=new a,c={TL:0,TR:0,BL:0,BR:0},f={TL:0,TR:0,BL:0,BR:0},p=[{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0}];t.exports=function(t,e,i,a){if(0!==e.commandBuffer.length){var o=e.customRenderNodes,g=e.defaultRenderNodes,m=o.Submitter||g.Submitter,v=e.lighting,y=i,x=y.camera;x.addToRenderList(e);for(var T=s(e,x,a,!i.useCanvas).calc,w=u.loadIdentity(),b=e.commandBuffer,S=e.alpha,C=Math.max(e.pathDetailThreshold,t.config.pathDetailThreshold,0),E=1,A=0,_=0,M=0,R=2*Math.PI,P=[],O=0,L=!0,D=null,F=n.getTintAppendFloatAlpha,I=0;I0&&(q=q%R-R):q>R?q=R:q<0&&(q=R+q%R),null===D&&(D=new h(G+Math.cos(j)*H,V+Math.sin(j)*H,E),P.push(D),W+=.01);W<1+Z;)M=q*W+j,A=G+Math.cos(M)*H,_=V+Math.sin(M)*H,D.addPoint(A,_,E),W+=.01;M=q+j,A=G+Math.cos(M)*H,_=V+Math.sin(M)*H,D.addPoint(A,_,E);break;case r.FILL_RECT:T.multiply(w,d),(o.FillRect||g.FillRect).run(y,d,m,b[++I],b[++I],b[++I],b[++I],c.TL,c.TR,c.BL,c.BR,v);break;case r.FILL_TRIANGLE:T.multiply(w,d),(o.FillTri||g.FillTri).run(y,d,m,b[++I],b[++I],b[++I],b[++I],b[++I],b[++I],c.TL,c.TR,c.BL,v);break;case r.STROKE_TRIANGLE:T.multiply(w,d),p[0].x=b[++I],p[0].y=b[++I],p[0].width=E,p[1].x=b[++I],p[1].y=b[++I],p[1].width=E,p[2].x=b[++I],p[2].y=b[++I],p[2].width=E,p[3].x=p[0].x,p[3].y=p[0].y,p[3].width=E,(o.StrokePath||g.StrokePath).run(y,m,p,E,!1,d,f.TL,f.TR,f.BL,f.BR,v);break;case r.LINE_TO:G=b[++I],V=b[++I],null!==D?D.addPoint(G,V,E):(D=new h(G,V,E),P.push(D));break;case r.MOVE_TO:D=new h(b[++I],b[++I],E),P.push(D);break;case r.SAVE:l.push(w.copyToArray());break;case r.RESTORE:w.copyFromArray(l.pop());break;case r.TRANSLATE:G=b[++I],V=b[++I],w.translate(G,V);break;case r.SCALE:G=b[++I],V=b[++I],w.scale(G,V);break;case r.ROTATE:w.rotate(b[++I])}}}},26479(t,e,i){var r=i(61061),s=i(83419),n=i(51708),a=i(50792),o=i(46710),h=i(95540),l=i(35154),u=i(97022),d=i(41212),c=i(88492),f=i(68287),p=new s({Extends:a,initialize:function(t,e,i){a.call(this),i?e&&!Array.isArray(e)&&(e=[e]):Array.isArray(e)?d(e[0])&&(i=e,e=null):d(e)&&(i=e,e=null),this.scene=t,this.children=new Set,this.isParent=!0,this.type="Group",this.classType=h(i,"classType",f),this.name=h(i,"name",""),this.active=h(i,"active",!0),this.maxSize=h(i,"maxSize",-1),this.defaultKey=h(i,"defaultKey",null),this.defaultFrame=h(i,"defaultFrame",null),this.runChildUpdate=h(i,"runChildUpdate",!1),this.createCallback=h(i,"createCallback",null),this.removeCallback=h(i,"removeCallback",null),this.createMultipleCallback=h(i,"createMultipleCallback",null),this.internalCreateCallback=h(i,"internalCreateCallback",null),this.internalRemoveCallback=h(i,"internalRemoveCallback",null),e&&this.addMultiple(e),i&&this.createMultiple(i),this.on(n.ADDED_TO_SCENE,this.addedToScene,this),this.on(n.REMOVED_FROM_SCENE,this.removedFromScene,this)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},create:function(t,e,i,r,s,n){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.defaultKey),void 0===r&&(r=this.defaultFrame),void 0===s&&(s=!0),void 0===n&&(n=!0),this.isFull())return null;var a=new this.classType(this.scene,t,e,i,r);return a.addToDisplayList(this.scene.sys.displayList),a.addToUpdateList(),a.visible=s,a.setActive(n),this.add(a),a},createMultiple:function(t){if(this.isFull())return[];Array.isArray(t)||(t=[t]);var e=[];if(t[0].key)for(var i=0;i=0;u--)if((l=c[u]).active===i){if(++d===e)break}else l=null;return l?("number"==typeof s&&(l.x=s),"number"==typeof n&&(l.y=n),l):r?this.create(s,n,a,o,h):null},get:function(t,e,i,r,s){return this.getFirst(!1,!0,t,e,i,r,s)},getFirstAlive:function(t,e,i,r,s,n){return this.getFirst(!0,t,e,i,r,s,n)},getFirstDead:function(t,e,i,r,s,n){return this.getFirst(!1,t,e,i,r,s,n)},playAnimation:function(t,e){return r.PlayAnimation(Array.from(this.children),t,e),this},isFull:function(){return-1!==this.maxSize&&this.children.size>=this.maxSize},countActive:function(t){void 0===t&&(t=!0);var e=0;return this.children.forEach(function(i){i.active===t&&e++}),e},getTotalUsed:function(){return this.countActive()},getTotalFree:function(){var t=this.getTotalUsed();return(-1===this.maxSize?999999999999:this.maxSize)-t},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},propertyValueSet:function(t,e,i,s,n){return r.PropertyValueSet(Array.from(this.children),t,e,i,s,n),this},propertyValueInc:function(t,e,i,s,n){return r.PropertyValueInc(Array.from(this.children),t,e,i,s,n),this},setX:function(t,e){return r.SetX(Array.from(this.children),t,e),this},setY:function(t,e){return r.SetY(Array.from(this.children),t,e),this},setXY:function(t,e,i,s){return r.SetXY(Array.from(this.children),t,e,i,s),this},incX:function(t,e){return r.IncX(Array.from(this.children),t,e),this},incY:function(t,e){return r.IncY(Array.from(this.children),t,e),this},incXY:function(t,e,i,s){return r.IncXY(Array.from(this.children),t,e,i,s),this},shiftPosition:function(t,e,i){return r.ShiftPosition(Array.from(this.children),t,e,i),this},angle:function(t,e){return r.Angle(Array.from(this.children),t,e),this},rotate:function(t,e){return r.Rotate(Array.from(this.children),t,e),this},rotateAround:function(t,e){return r.RotateAround(Array.from(this.children),t,e),this},rotateAroundDistance:function(t,e,i){return r.RotateAroundDistance(Array.from(this.children),t,e,i),this},setAlpha:function(t,e){return r.SetAlpha(Array.from(this.children),t,e),this},setTint:function(t,e,i,s){return r.SetTint(Array.from(this.children),t,e,i,s),this},setOrigin:function(t,e,i,s){return r.SetOrigin(Array.from(this.children),t,e,i,s),this},scaleX:function(t,e){return r.ScaleX(Array.from(this.children),t,e),this},scaleY:function(t,e){return r.ScaleY(Array.from(this.children),t,e),this},scaleXY:function(t,e,i,s){return r.ScaleXY(Array.from(this.children),t,e,i,s),this},setDepth:function(t,e){return r.SetDepth(Array.from(this.children),t,e),this},setBlendMode:function(t){return r.SetBlendMode(Array.from(this.children),t),this},setHitArea:function(t,e){return r.SetHitArea(Array.from(this.children),t,e),this},shuffle:function(){return r.Shuffle(Array.from(this.children)),this},kill:function(t){this.children.has(t)&&t.setActive(!1)},killAndHide:function(t){this.children.has(t)&&(t.setActive(!1),t.setVisible(!1))},setVisible:function(t,e,i){return r.SetVisible(Array.from(this.children),t,e,i),this},toggleVisible:function(){return r.ToggleVisible(Array.from(this.children)),this},destroy:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1),this.scene&&!this.ignoreDestroy&&(this.emit(n.DESTROY,this),this.removeAllListeners(),this.scene.sys.updateList.remove(this),this.clear(e,t),this.scene=void 0,this.children=void 0)}});t.exports=p},94975(t,e,i){var r=i(44603),s=i(26479);r.register("group",function(t){return new s(this.scene,null,t)})},3385(t,e,i){var r=i(26479);i(39429).register("group",function(t,e){return this.updateList.add(new r(this.scene,t,e))})},88571(t,e,i){var r=i(40939),s=i(83419),n=i(31401),a=i(95643),o=i(59819),h=new s({Extends:a,Mixins:[n.Alpha,n.BlendMode,n.Depth,n.Flip,n.GetBounds,n.Lighting,n.Mask,n.Origin,n.RenderNodes,n.ScrollFactor,n.Size,n.TextureCrop,n.Tint,n.Transform,n.Visible,o],initialize:function(t,e,i,r,s){a.call(this,t,"Image"),this._crop=this.resetCropObject(),this.setTexture(r,s),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initRenderNodes(this._defaultRenderNodesMap)},_defaultRenderNodesMap:{get:function(){return r}}});t.exports=h},40652(t){t.exports=function(t,e,i,r){i.addToRenderList(e),t.batchSprite(e,e.frame,i,r)}},82459(t,e,i){var r=i(25305),s=i(44603),n=i(23568),a=i(88571);s.register("image",function(t,e){void 0===t&&(t={});var i=n(t,"key",null),s=n(t,"frame",null),o=new a(this.scene,0,0,i,s);return void 0!==e&&(t.add=e),r(this.scene,o,t),o})},2117(t,e,i){var r=i(88571);i(39429).register("image",function(t,e,i,s){return this.displayList.add(new r(this.scene,t,e,i,s))})},59819(t,e,i){var r=i(29747),s=r,n=r;s=i(99517),n=i(40652),t.exports={renderWebGL:s,renderCanvas:n}},99517(t){t.exports=function(t,e,i,r){i.camera.addToRenderList(e);var s=e.customRenderNodes,n=e.defaultRenderNodes;(s.Submitter||n.Submitter).run(i,e,r,0,s.Texturer||n.Texturer,s.Transformer||n.Transformer)}},77856(t,e,i){var r={Events:i(51708),DisplayList:i(8050),GameObjectCreator:i(44603),GameObjectFactory:i(39429),UpdateList:i(45027),Components:i(31401),GetCalcMatrix:i(91296),BuildGameObject:i(25305),BuildGameObjectAnimation:i(13059),GameObject:i(95643),BitmapText:i(22186),Blitter:i(6107),Bob:i(46590),Container:i(31559),DOMElement:i(3069),DynamicBitmapText:i(2638),Extern:i(42421),Graphics:i(43831),Group:i(26479),Image:i(88571),Layer:i(93595),Particles:i(18404),PathFollower:i(1159),RenderTexture:i(591),RetroFont:i(196),Rope:i(77757),Sprite:i(68287),Stamp:i(14727),Text:i(50171),GetTextSize:i(14220),MeasureText:i(79557),TextStyle:i(35762),TileSprite:i(20839),Zone:i(41481),Video:i(18471),Shape:i(17803),Arc:i(23629),Curve:i(89),Ellipse:i(19921),Grid:i(30479),IsoBox:i(61475),IsoTriangle:i(16933),Line:i(57847),Polygon:i(24949),Rectangle:i(74561),Star:i(55911),Triangle:i(36931),Factories:{Blitter:i(12709),Container:i(24961),DOMElement:i(2611),DynamicBitmapText:i(72566),Extern:i(56315),Graphics:i(1201),Group:i(3385),Image:i(2117),Layer:i(20005),Particles:i(676),PathFollower:i(90145),RenderTexture:i(60505),Rope:i(96819),Sprite:i(46409),Stamp:i(85326),StaticBitmapText:i(34914),Text:i(68005),TileSprite:i(91681),Zone:i(84175),Video:i(89025),Arc:i(42563),Curve:i(40511),Ellipse:i(1543),Grid:i(34137),IsoBox:i(3933),IsoTriangle:i(49803),Line:i(2481),Polygon:i(64827),Rectangle:i(87959),Star:i(93697),Triangle:i(45245)},Creators:{Blitter:i(9403),Container:i(77143),DynamicBitmapText:i(11164),Graphics:i(87079),Group:i(94975),Image:i(82459),Layer:i(25179),Particles:i(92730),RenderTexture:i(34495),Rope:i(26209),Sprite:i(15567),Stamp:i(31479),StaticBitmapText:i(57336),Text:i(71259),TileSprite:i(14167),Zone:i(95261),Video:i(11511)}};r.CaptureFrame=i(43451),r.Gradient=i(34637),r.Noise=i(35387),r.NoiseCell2D=i(51513),r.NoiseCell3D=i(15686),r.NoiseCell4D=i(41946),r.NoiseSimplex2D=i(1792),r.NoiseSimplex3D=i(51098),r.Shader=i(20071),r.NineSlice=i(28103),r.PointLight=i(80321),r.SpriteGPULayer=i(76573),r.Factories.CaptureFrame=i(20421),r.Factories.Gradient=i(69315),r.Factories.Noise=i(34757),r.Factories.NoiseCell2D=i(26590),r.Factories.NoiseCell3D=i(89918),r.Factories.NoiseCell4D=i(65874),r.Factories.NoiseSimplex2D=i(80308),r.Factories.NoiseSimplex3D=i(73810),r.Factories.Shader=i(74177),r.Factories.NineSlice=i(47521),r.Factories.PointLight=i(71255),r.Factories.SpriteGPULayer=i(96019),r.Creators.CaptureFrame=i(23675),r.Creators.Gradient=i(26353),r.Creators.Noise=i(39931),r.Creators.NoiseCell2D=i(98292),r.Creators.NoiseCell3D=i(97044),r.Creators.NoiseCell4D=i(20136),r.Creators.NoiseSimplex2D=i(51754),r.Creators.NoiseSimplex3D=i(71112),r.Creators.Shader=i(54935),r.Creators.NineSlice=i(28279),r.Creators.PointLight=i(39829),r.Creators.SpriteGPULayer=i(16193),r.Light=i(41432),r.LightsManager=i(61356),r.LightsPlugin=i(88992),t.exports=r},93595(t,e,i){var r=i(10312),s=i(83419),n=i(31401),a=i(50792),o=i(95643),h=i(51708),l=i(73162),u=i(33963),d=i(44594),c=i(19186),f=new s({Extends:l,Mixins:[a,o,n.AlphaSingle,n.BlendMode,n.Depth,n.Mask,n.Visible,u],initialize:function(t,e){l.call(this,t),a.call(this),o.call(this,t,"Layer"),this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.sortChildrenFlag=!1,this.addCallback=this.addChildCallback,this.removeCallback=this.removeChildCallback,this.clearAlpha(),this.setBlendMode(r.SKIP_CHECK),e&&this.add(e),this.addRenderStep&&this.addRenderStep(this.renderWebGL),t.sys.queueDepthSort()},setInteractive:function(){return this},disableInteractive:function(){return this},removeInteractive:function(){return this},willRender:function(t){return!(15!==this.renderFlags||0===this.list.length||0!==this.cameraFilter&&this.cameraFilter&t.id)},addChildCallback:function(t){var e=t.displayList;e&&e!==this&&t.removeFromDisplayList(),t.displayList||(this.queueDepthSort(),t.displayList=this,t.emit(h.ADDED_TO_SCENE,t,this.scene),this.events.emit(d.ADDED_TO_SCENE,t,this.scene))},removeChildCallback:function(t){this.queueDepthSort(),t.displayList=null,t.emit(h.REMOVED_FROM_SCENE,t,this.scene),this.events.emit(d.REMOVED_FROM_SCENE,t,this.scene)},queueDepthSort:function(){this.sortChildrenFlag=!0},depthSort:function(){this.sortChildrenFlag&&(c(this.list,this.sortByDepth),this.sortChildrenFlag=!1)},sortByDepth:function(t,e){return t._depth-e._depth},getChildren:function(){return this.list},destroy:function(t){if(this.scene&&!this.ignoreDestroy){o.prototype.destroy.call(this,t);for(var e=this.list;e.length;)e[0].destroy(t);this.list=void 0,this.systems=void 0,this.events=void 0}}});t.exports=f},2956(t){t.exports=function(t,e,i){var r=e.list;if(0!==r.length){e.depthSort();var s=-1!==e.blendMode;s||t.setBlendMode(0);var n=e._alpha;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var a=0;athis.maxLights&&(u(s,this.sortByDistance),s=s.slice(0,this.maxLights)),this.visibleLights=s.length,s},sortByDistance:function(t,e){return t.distance>=e.distance},setAmbientColor:function(t){var e=d.getFloatsFromUintRGB(t);return this.ambientColor.set(e[0],e[1],e[2]),this},getMaxVisibleLights:function(){return this.maxLights},getLightCount:function(){return this.lights.length},addLight:function(t,e,i,r,s,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=128),void 0===r&&(r=16777215),void 0===s&&(s=1),void 0===n&&(n=.1*i);var o=d.getFloatsFromUintRGB(r),h=new a(t,e,i,o[0],o[1],o[2],s,n);return this.lights.push(h),h},removeLight:function(t){var e=this.lights.indexOf(t);return e>=0&&l(this.lights,e),this},shutdown:function(){this.lights.length=0},destroy:function(){this.shutdown()}});t.exports=c},88992(t,e,i){var r=i(83419),s=i(61356),n=i(37277),a=i(44594),o=new r({Extends:s,initialize:function(t){this.scene=t,this.systems=t.sys,t.sys.settings.isBooted||t.sys.events.once(a.BOOT,this.boot,this),s.call(this)},boot:function(){var t=this.systems.events;t.on(a.SHUTDOWN,this.shutdown,this),t.on(a.DESTROY,this.destroy,this)},destroy:function(){this.shutdown(),this.scene=void 0,this.systems=void 0}});n.register("LightsPlugin",o,"lights"),t.exports=o},28103(t,e,i){var r=i(30529),s=i(83419),n=i(31401),a=i(95643),o=i(78023),h=i(84322),l=i(82513),u=new s({Extends:a,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.GetBounds,n.Mask,n.Origin,n.RenderNodes,n.ScrollFactor,n.Texture,n.Transform,n.Visible,o],initialize:function(t,e,i,r,s,n,o,u,d,c,f,p,g){a.call(this,t,"NineSlice"),this._width,this._height,this._originX=.5,this._originY=.5,this._sizeComponent=!0,this.vertices=[],this.leftWidth,this.rightWidth,this.topHeight,this.bottomHeight,this.tileX=p||!1,this.tileY=g||!1,this._repeatCountX=1,this._repeatCountY=1,this.tint=16777215,this.tintMode=h.MULTIPLY;var m=t.textures.getFrame(r,s);this.is3Slice=!c&&!f,m&&m.scale9&&(this.is3Slice=m.is3Slice);for(var v=this.is3Slice?18:54,y=0;y0?Math.max(1,Math.floor(t/e)):1},_rebuildVertexArray:function(t,e){if(t===this._repeatCountX&&e===this._repeatCountY)return!1;this._repeatCountX=t,this._repeatCountY=e;var i=(t+2)*(this.is3Slice?1:e+2)*6,r=this.vertices;if(r.length!==i){r.length=0;for(var s=0;s=0&&(e=t);break;case 4:var i=(this.end-this.start)/this.steps;e=u(t,i),this.counter=e;break;case 5:case 6:case 7:e=s(t,this.start,this.end);break;case 9:e=this.start[0]}return this.current=e,this},getMethod:function(){var t=this.propertyValue;if(null===t)return 0;var e=typeof t;if("number"===e)return 1;if(Array.isArray(t))return 2;if("function"===e)return 3;if("object"===e){if(this.hasBoth(t,"start","end"))return this.has(t,"steps")?4:5;if(this.hasBoth(t,"min","max"))return 6;if(this.has(t,"random"))return 7;if(this.hasEither(t,"onEmit","onUpdate"))return 8;if(this.hasEither(t,"values","interpolation"))return 9}return 0},setMethods:function(){var t=this.propertyValue,e=t,i=this.defaultEmit,r=this.defaultUpdate;switch(this.method){case 1:i=this.staticValueEmit;break;case 2:i=this.randomStaticValueEmit,e=t[0];break;case 3:this._onEmit=t,i=this.proxyEmit,e=this.defaultValue;break;case 4:this.start=t.start,this.end=t.end,this.steps=t.steps,this.counter=this.start,this.yoyo=!!this.has(t,"yoyo")&&t.yoyo,this.direction=0,i=this.steppedEmit,e=this.start;break;case 5:this.start=t.start,this.end=t.end;var s=this.has(t,"ease")?t.ease:"Linear";this.ease=o(s,t.easeParams),i=this.has(t,"random")&&t.random?this.randomRangedValueEmit:this.easedValueEmit,r=this.easeValueUpdate,e=this.start;break;case 6:this.start=t.min,this.end=t.max,i=this.has(t,"int")&&t.int?this.randomRangedIntEmit:this.randomRangedValueEmit,e=this.start;break;case 7:var n=t.random;Array.isArray(n)&&(this.start=n[0],this.end=n[1]),i=this.randomRangedIntEmit,e=this.start;break;case 8:this._onEmit=this.has(t,"onEmit")?t.onEmit:this.defaultEmit,this._onUpdate=this.has(t,"onUpdate")?t.onUpdate:this.defaultUpdate,i=this.proxyEmit,r=this.proxyUpdate,e=this.defaultValue;break;case 9:this.start=t.values;var a=this.has(t,"ease")?t.ease:"Linear";this.ease=o(a,t.easeParams),this.interpolation=l(t.interpolation),i=this.easedValueEmit,r=this.easeValueUpdate,e=this.start[0]}return this.onEmit=i,this.onUpdate=r,this.current=e,this},has:function(t,e){return t.hasOwnProperty(e)},hasBoth:function(t,e,i){return t.hasOwnProperty(e)&&t.hasOwnProperty(i)},hasEither:function(t,e,i){return t.hasOwnProperty(e)||t.hasOwnProperty(i)},defaultEmit:function(){return this.defaultValue},defaultUpdate:function(t,e,i,r){return r},proxyEmit:function(t,e,i){var r=this._onEmit(t,e,i);return this.current=r,r},proxyUpdate:function(t,e,i,r){var s=this._onUpdate(t,e,i,r);return this.current=s,s},staticValueEmit:function(){return this.current},staticValueUpdate:function(){return this.current},randomStaticValueEmit:function(){var t=Math.floor(Math.random()*this.propertyValue.length);return this.current=this.propertyValue[t],this.current},randomRangedValueEmit:function(t,e){var i=a(this.start,this.end);return t&&t.data[e]&&(t.data[e].min=i,t.data[e].max=this.end),this.current=i,i},randomRangedIntEmit:function(t,e){var i=r(this.start,this.end);return t&&t.data[e]&&(t.data[e].min=i,t.data[e].max=this.end),this.current=i,i},steppedEmit:function(){var t,e=this.counter,i=e,r=(this.end-this.start)/this.steps;this.yoyo?(0===this.direction?(i+=r)>=this.end&&(t=i-this.end,i=this.end-t,this.direction=1):(i-=r)<=this.start&&(t=this.start-i,i=this.start+t,this.direction=0),this.counter=i):this.counter=d(i+r,this.start,this.end);return this.current=e,e},easedValueEmit:function(t,e){if(t&&t.data[e]){var i=t.data[e];i.min=this.start,i.max=this.end}return this.current=this.start,this.start},easeValueUpdate:function(t,e,i){var r,s=t.data[e],n=this.ease(i);return r=this.interpolation?this.interpolation(this.start,n):(s.max-s.min)*n+s.min,this.current=r,r},destroy:function(){this.propertyValue=null,this.defaultValue=null,this.ease=null,this.interpolation=null,this._onEmit=null,this._onUpdate=null}});t.exports=c},24502(t,e,i){var r=i(83419),s=i(95540),n=i(20286),a=new r({Extends:n,initialize:function(t,e,i,r,a){if("object"==typeof t){var o=t;t=s(o,"x",0),e=s(o,"y",0),i=s(o,"power",0),r=s(o,"epsilon",100),a=s(o,"gravity",50)}else void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=100),void 0===a&&(a=50);n.call(this,t,e,!0),this._gravity=a,this._power=i*a,this._epsilon=r*r},update:function(t,e){var i=this.x-t.x,r=this.y-t.y,s=i*i+r*r;if(0!==s){var n=Math.sqrt(s);s0&&(this.anims=new r(this)),this.bounds=new o},emit:function(t,e,i,r,s,n){return this.emitter.emit(t,e,i,r,s,n)},isAlive:function(){return this.lifeCurrent>0},kill:function(){this.lifeCurrent=0},setPosition:function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=t,this.y=e},fire:function(t,e){var i=this.emitter,r=i.ops,s=i.getAnim();if(s?this.anims.play(s):(this.frame=i.getFrame(),this.texture=this.frame.texture),!this.frame)throw new Error("Particle has no texture frame");if(i.getEmitZone(this),void 0===t?this.x+=r.x.onEmit(this,"x"):r.x.steps>0?this.x+=t+r.x.onEmit(this,"x"):this.x+=t,void 0===e?this.y+=r.y.onEmit(this,"y"):r.y.steps>0?this.y+=e+r.y.onEmit(this,"y"):this.y+=e,this.life=r.lifespan.onEmit(this,"lifespan"),this.lifeCurrent=this.life,this.lifeT=0,this.delayCurrent=r.delay.onEmit(this,"delay"),this.holdCurrent=r.hold.onEmit(this,"hold"),this.scaleX=r.scaleX.onEmit(this,"scaleX"),this.scaleY=r.scaleY.active?r.scaleY.onEmit(this,"scaleY"):this.scaleX,this.angle=r.rotate.onEmit(this,"rotate"),this.rotation=a(this.angle),i.worldMatrix.transformPoint(this.x,this.y,this.worldPosition),0===this.delayCurrent&&i.getDeathZone(this))return this.lifeCurrent=0,!1;var n=r.speedX.onEmit(this,"speedX"),o=r.speedY.active?r.speedY.onEmit(this,"speedY"):n;if(i.radial){var h=a(r.angle.onEmit(this,"angle"));this.velocityX=Math.cos(h)*Math.abs(n),this.velocityY=Math.sin(h)*Math.abs(o)}else if(i.moveTo){var l=r.moveToX.onEmit(this,"moveToX"),u=r.moveToY.onEmit(this,"moveToY"),d=this.life/1e3;this.velocityX=(l-this.x)/d,this.velocityY=(u-this.y)/d}else this.velocityX=n,this.velocityY=o;return i.acceleration&&(this.accelerationX=r.accelerationX.onEmit(this,"accelerationX"),this.accelerationY=r.accelerationY.onEmit(this,"accelerationY")),this.maxVelocityX=r.maxVelocityX.onEmit(this,"maxVelocityX"),this.maxVelocityY=r.maxVelocityY.onEmit(this,"maxVelocityY"),this.bounce=r.bounce.onEmit(this,"bounce"),this.alpha=r.alpha.onEmit(this,"alpha"),r.color.active?this.tint=r.color.onEmit(this,"tint"):this.tint=r.tint.onEmit(this,"tint"),!0},update:function(t,e,i){if(this.lifeCurrent<=0)return!(this.holdCurrent>0)||(this.holdCurrent-=t,this.holdCurrent<=0);if(this.delayCurrent>0)return this.delayCurrent-=t,!1;this.anims&&this.anims.update(0,t);var r=this.emitter,n=r.ops,o=1-this.lifeCurrent/this.life;if(this.lifeT=o,this.x=n.x.onUpdate(this,"x",o,this.x),this.y=n.y.onUpdate(this,"y",o,this.y),r.moveTo){var h=n.moveToX.onUpdate(this,"moveToX",o,r.moveToX),l=n.moveToY.onUpdate(this,"moveToY",o,r.moveToY),u=this.lifeCurrent/1e3;this.velocityX=(h-this.x)/u,this.velocityY=(l-this.y)/u}return this.computeVelocity(r,t,e,i,o),this.scaleX=n.scaleX.onUpdate(this,"scaleX",o,this.scaleX),n.scaleY.active?this.scaleY=n.scaleY.onUpdate(this,"scaleY",o,this.scaleY):this.scaleY=this.scaleX,this.angle=n.rotate.onUpdate(this,"rotate",o,this.angle),this.rotation=a(this.angle),r.getDeathZone(this)?(this.lifeCurrent=0,!0):(this.alpha=s(n.alpha.onUpdate(this,"alpha",o,this.alpha),0,1),n.color.active?this.tint=n.color.onUpdate(this,"color",o,this.tint):this.tint=n.tint.onUpdate(this,"tint",o,this.tint),this.lifeCurrent-=t,this.lifeCurrent<=0&&this.holdCurrent<=0)},computeVelocity:function(t,e,i,r,n){var a=t.ops,o=this.velocityX,h=this.velocityY,l=a.accelerationX.onUpdate(this,"accelerationX",n,this.accelerationX),u=a.accelerationY.onUpdate(this,"accelerationY",n,this.accelerationY),d=a.maxVelocityX.onUpdate(this,"maxVelocityX",n,this.maxVelocityX),c=a.maxVelocityY.onUpdate(this,"maxVelocityY",n,this.maxVelocityY);this.bounce=a.bounce.onUpdate(this,"bounce",n,this.bounce),o+=t.gravityX*i+l*i,h+=t.gravityY*i+u*i,o=s(o,-d,d),h=s(h,-c,c),this.velocityX=o,this.velocityY=h,this.x+=o*i,this.y+=h*i,t.worldMatrix.transformPoint(this.x,this.y,this.worldPosition);for(var f=0;fe.right&&this.collideRight&&(t.x-=r.x-e.right,t.velocityX*=i),r.ye.bottom&&this.collideBottom&&(t.y-=r.y-e.bottom,t.velocityY*=i)}});t.exports=a},31600(t,e,i){var r=i(68668),s=i(83419),n=i(31401),a=i(53774),o=i(43459),h=i(26388),l=i(19909),u=i(76472),d=i(44777),c=i(20696),f=i(95643),p=i(95540),g=i(26546),m=i(24502),v=i(69036),y=i(1985),x=i(97022),T=i(86091),w=i(73162),b=i(20074),S=i(269),C=i(56480),E=i(69601),A=i(68875),_=i(87841),M=i(59996),R=i(72905),P=i(90668),O=i(19186),L=i(84322),D=i(61340),F=i(26099),I=i(15994),N=["active","advance","blendMode","colorEase","deathCallback","deathCallbackScope","duration","emitCallback","emitCallbackScope","follow","frequency","gravityX","gravityY","maxAliveParticles","maxParticles","name","emitting","particleBringToTop","particleClass","radial","sortCallback","sortOrderAsc","sortProperty","stopAfter","tintMode","timeScale","trackVisible","visible"],B=["accelerationX","accelerationY","alpha","angle","bounce","color","delay","hold","lifespan","maxVelocityX","maxVelocityY","moveToX","moveToY","quantity","rotate","scaleX","scaleY","speedX","speedY","tint","x","y"],k=new s({Extends:f,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.Lighting,n.Mask,n.RenderNodes,n.ScrollFactor,n.Texture,n.Transform,n.Visible,P],initialize:function(t,e,i,r,s){f.call(this,t,"ParticleEmitter"),this.particleClass=C,this.config=null,this.ops={accelerationX:new d("accelerationX",0),accelerationY:new d("accelerationY",0),alpha:new d("alpha",1),angle:new d("angle",{min:0,max:360},!0),bounce:new d("bounce",0),color:new u("color"),delay:new d("delay",0,!0),hold:new d("hold",0,!0),lifespan:new d("lifespan",1e3,!0),maxVelocityX:new d("maxVelocityX",1e4),maxVelocityY:new d("maxVelocityY",1e4),moveToX:new d("moveToX",0),moveToY:new d("moveToY",0),quantity:new d("quantity",1,!0),rotate:new d("rotate",0),scaleX:new d("scaleX",1),scaleY:new d("scaleY",1),speedX:new d("speedX",0,!0),speedY:new d("speedY",0,!0),tint:new d("tint",16777215),x:new d("x",0),y:new d("y",0)},this.radial=!0,this.gravityX=0,this.gravityY=0,this.acceleration=!1,this.moveTo=!1,this.emitCallback=null,this.emitCallbackScope=null,this.deathCallback=null,this.deathCallbackScope=null,this.maxParticles=0,this.maxAliveParticles=0,this.stopAfter=0,this.duration=0,this.frequency=0,this.emitting=!0,this.particleBringToTop=!0,this.timeScale=1,this.emitZones=[],this.deathZones=[],this.viewBounds=null,this.follow=null,this.followOffset=new F,this.trackVisible=!1,this.frames=[],this.randomFrame=!0,this.frameQuantity=1,this.anims=[],this.randomAnim=!0,this.animQuantity=1,this.dead=[],this.alive=[],this.counters=new Float32Array(10),this.skipping=!1,this.worldMatrix=new D,this.sortProperty="",this.sortOrderAsc=!0,this.sortCallback=this.depthSortCallback,this.processors=new w(this),this.tintMode=L.MULTIPLY,this.initRenderNodes(this._defaultRenderNodesMap),this.setPosition(e,i),this.setTexture(r),s&&this.setConfig(s)},_defaultRenderNodesMap:{get:function(){return r}},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},setConfig:function(t){if(!t)return this;this.config=t;var e=0,i="",r=this.ops;for(e=0;e=this.animQuantity&&(this.animCounter=0,this.currentAnim=I(this.currentAnim+1,0,e)),i},setAnim:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=1),this.randomAnim=e,this.animQuantity=i,this.currentAnim=0;var r=typeof t;if(this.anims.length=0,Array.isArray(t))this.anims=this.anims.concat(t);else if("string"===r)this.anims.push(t);else if("object"===r){var s=t;(t=p(s,"anims",null))&&(this.anims=this.anims.concat(t));var n=p(s,"cycle",!1);this.randomAnim=!n,this.animQuantity=p(s,"quantity",i)}return 1===this.anims.length&&(this.animQuantity=1,this.randomAnim=!1),this},setRadial:function(t){return void 0===t&&(t=!0),this.radial=t,this},addParticleBounds:function(t,e,i,r,s,n,a,o){if("object"==typeof t){var h=t;t=h.x,e=h.y,i=x(h,"w")?h.w:h.width,r=x(h,"h")?h.h:h.height}return this.addParticleProcessor(new E(t,e,i,r,s,n,a,o))},setParticleSpeed:function(t,e){return void 0===e&&(e=t),this.ops.speedX.onChange(t),t===e?this.ops.speedY.active=!1:this.ops.speedY.onChange(e),this.radial=!0,this},setParticleScale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.ops.scaleX.onChange(t),this.ops.scaleY.onChange(e),this},setParticleGravity:function(t,e){return this.gravityX=t,this.gravityY=e,this},setParticleAlpha:function(t){return this.ops.alpha.onChange(t),this},setParticleTint:function(t){return this.ops.tint.onChange(t),this},setEmitterAngle:function(t){return this.ops.angle.onChange(t),this},setParticleLifespan:function(t){return this.ops.lifespan.onChange(t),this},setQuantity:function(t){return this.quantity=t,this},setFrequency:function(t,e){return this.frequency=t,this.flowCounter=t>0?t:0,e&&(this.quantity=e),this},addDeathZone:function(t){var e;Array.isArray(t)||(t=[t]);for(var i=[],r=0;r-1&&(this.zoneTotal++,this.zoneTotal===r.total&&(this.zoneTotal=0,this.zoneIndex++,this.zoneIndex===i&&(this.zoneIndex=0)))}},getDeathZone:function(t){for(var e=this.deathZones,i=0;i=0&&(this.zoneIndex=e),this},addParticleProcessor:function(t){return this.processors.exists(t)||(t.emitter&&t.emitter.removeParticleProcessor(t),this.processors.add(t),t.emitter=this),t},removeParticleProcessor:function(t){return this.processors.exists(t)&&(this.processors.remove(t,!0),t.emitter=null),t},getProcessors:function(){return this.processors.getAll("active",!0)},createGravityWell:function(t){return this.addParticleProcessor(new m(t))},reserve:function(t){var e=this.dead;if(this.maxParticles>0){var i=this.getParticleCount();i+t>this.maxParticles&&(t=this.maxParticles-(i+t))}for(var r=0;r0&&this.getParticleCount()>=this.maxParticles||this.maxAliveParticles>0&&this.getAliveParticleCount()>=this.maxAliveParticles},onParticleEmit:function(t,e){return void 0===t?(this.emitCallback=null,this.emitCallbackScope=null):"function"==typeof t&&(this.emitCallback=t,e&&(this.emitCallbackScope=e)),this},onParticleDeath:function(t,e){return void 0===t?(this.deathCallback=null,this.deathCallbackScope=null):"function"==typeof t&&(this.deathCallback=t,e&&(this.deathCallbackScope=e)),this},killAll:function(){for(var t=this.dead,e=this.alive;e.length>0;)t.push(e.pop());return this},forEachAlive:function(t,e){for(var i=this.alive,r=i.length,s=0;s0&&this.fastForward(t),this.emitting=!0,this.resetCounters(this.frequency,!0),void 0!==e&&(this.duration=Math.abs(e)),this.emit(c.START,this)),this},stop:function(t){return void 0===t&&(t=!1),this.emitting&&(this.emitting=!1,t&&this.killAll(),this.emit(c.STOP,this)),this},pause:function(){return this.active=!1,this},resume:function(){return this.active=!0,this},setSortProperty:function(t,e){return void 0===t&&(t=""),void 0===e&&(e=this.true),this.sortProperty=t,this.sortOrderAsc=e,this.sortCallback=this.depthSortCallback,this},setSortCallback:function(t){return t=""!==this.sortProperty?this.depthSortCallback:null,this.sortCallback=t,this},depthSort:function(){return O(this.alive,this.sortCallback.bind(this)),this},depthSortCallback:function(t,e){var i=this.sortProperty;return this.sortOrderAsc?t[i]-e[i]:e[i]-t[i]},flow:function(t,e,i){return void 0===e&&(e=1),this.emitting=!1,this.frequency=t,this.quantity=e,void 0!==i&&(this.stopAfter=i),this.start()},explode:function(t,e,i){this.frequency=-1,this.resetCounters(-1,!0);var r=this.emitParticle(t,e,i);return this.emit(c.EXPLODE,this,r),r},emitParticleAt:function(t,e,i){return this.emitParticle(i,t,e)},emitParticle:function(t,e,i){if(!this.atLimit()){void 0===t&&(t=this.ops.quantity.onEmit());for(var r=this.dead,s=this.stopAfter,n=this.follow?this.follow.x+this.followOffset.x:e,a=this.follow?this.follow.y+this.followOffset.y:i,o=0;o0&&(this.stopCounter++,this.stopCounter>=s))break;if(this.atLimit())break}return h}},fastForward:function(t,e){void 0===e&&(e=1e3/60);var i=0;for(this.skipping=!0;i0){var u=this.deathCallback,d=this.deathCallbackScope;for(a=h-1;a>=0;a--){var f=o[a];s.splice(f.index,1),n.push(f.particle),u&&u.call(d,f.particle),f.particle.setPosition()}}if(this.emitting||this.skipping){if(0===this.frequency)this.emitParticle();else if(this.frequency>0)for(this.flowCounter-=e;this.flowCounter<=0;)this.emitParticle(),this.flowCounter+=this.frequency;this.skipping||(this.duration>0&&(this.elapsed+=e,this.elapsed>=this.duration&&this.stop()),this.stopAfter>0&&this.stopCounter>=this.stopAfter&&this.stop())}else 1===this.completeFlag&&0===s.length&&(this.completeFlag=0,this.emit(c.COMPLETE,this))},overlap:function(t){for(var e=this.getWorldTransformMatrix(),i=this.alive,r=i.length,s=[],n=0;n0){var u=0;for(this.skipping=!0;u0&&T(r,t,t),r},createEmitter:function(){throw new Error("createEmitter removed. See ParticleEmitter docs for info")},particleX:{get:function(){return this.ops.x.current},set:function(t){this.ops.x.onChange(t)}},particleY:{get:function(){return this.ops.y.current},set:function(t){this.ops.y.onChange(t)}},accelerationX:{get:function(){return this.ops.accelerationX.current},set:function(t){this.ops.accelerationX.onChange(t)}},accelerationY:{get:function(){return this.ops.accelerationY.current},set:function(t){this.ops.accelerationY.onChange(t)}},maxVelocityX:{get:function(){return this.ops.maxVelocityX.current},set:function(t){this.ops.maxVelocityX.onChange(t)}},maxVelocityY:{get:function(){return this.ops.maxVelocityY.current},set:function(t){this.ops.maxVelocityY.onChange(t)}},speed:{get:function(){return this.ops.speedX.current},set:function(t){this.ops.speedX.onChange(t),this.ops.speedY.onChange(t)}},speedX:{get:function(){return this.ops.speedX.current},set:function(t){this.ops.speedX.onChange(t)}},speedY:{get:function(){return this.ops.speedY.current},set:function(t){this.ops.speedY.onChange(t)}},moveToX:{get:function(){return this.ops.moveToX.current},set:function(t){this.ops.moveToX.onChange(t)}},moveToY:{get:function(){return this.ops.moveToY.current},set:function(t){this.ops.moveToY.onChange(t)}},bounce:{get:function(){return this.ops.bounce.current},set:function(t){this.ops.bounce.onChange(t)}},particleScaleX:{get:function(){return this.ops.scaleX.current},set:function(t){this.ops.scaleX.onChange(t)}},particleScaleY:{get:function(){return this.ops.scaleY.current},set:function(t){this.ops.scaleY.onChange(t)}},particleColor:{get:function(){return this.ops.color.current},set:function(t){this.ops.color.onChange(t)}},colorEase:{get:function(){return this.ops.color.easeName},set:function(t){this.ops.color.setEase(t)}},particleTint:{get:function(){return this.ops.tint.current},set:function(t){this.ops.tint.onChange(t)}},particleAlpha:{get:function(){return this.ops.alpha.current},set:function(t){this.ops.alpha.onChange(t)}},lifespan:{get:function(){return this.ops.lifespan.current},set:function(t){this.ops.lifespan.onChange(t)}},particleAngle:{get:function(){return this.ops.angle.current},set:function(t){this.ops.angle.onChange(t)}},particleRotate:{get:function(){return this.ops.rotate.current},set:function(t){this.ops.rotate.onChange(t)}},quantity:{get:function(){return this.ops.quantity.current},set:function(t){this.ops.quantity.onChange(t)}},delay:{get:function(){return this.ops.delay.current},set:function(t){this.ops.delay.onChange(t)}},hold:{get:function(){return this.ops.hold.current},set:function(t){this.ops.hold.onChange(t)}},flowCounter:{get:function(){return this.counters[0]},set:function(t){this.counters[0]=t}},frameCounter:{get:function(){return this.counters[1]},set:function(t){this.counters[1]=t}},animCounter:{get:function(){return this.counters[2]},set:function(t){this.counters[2]=t}},elapsed:{get:function(){return this.counters[3]},set:function(t){this.counters[3]=t}},stopCounter:{get:function(){return this.counters[4]},set:function(t){this.counters[4]=t}},completeFlag:{get:function(){return this.counters[5]},set:function(t){this.counters[5]=t}},zoneIndex:{get:function(){return this.counters[6]},set:function(t){this.counters[6]=t}},zoneTotal:{get:function(){return this.counters[7]},set:function(t){this.counters[7]=t}},currentFrame:{get:function(){return this.counters[8]},set:function(t){this.counters[8]=t}},currentAnim:{get:function(){return this.counters[9]},set:function(t){this.counters[9]=t}},preDestroy:function(){var t;this.texture=null,this.frames=null,this.anims=null,this.emitCallback=null,this.emitCallbackScope=null,this.deathCallback=null,this.deathCallbackScope=null,this.emitZones=null,this.deathZones=null,this.bounds=null,this.follow=null,this.counters=null;var e=this.ops;for(t=0;t0&&T.height>0){var w=-x.halfWidth,b=-x.halfHeight;l.globalAlpha=y,l.save(),a.setToContext(l),u&&(w=Math.round(w),b=Math.round(b)),l.imageSmoothingEnabled=!x.source.scaleMode,l.drawImage(x.source.image,T.x,T.y,T.width,T.height,w,b,T.width,T.height),l.restore()}}}l.restore()}}},92730(t,e,i){var r=i(25305),s=i(44603),n=i(23568),a=i(95540),o=i(31600);s.register("particles",function(t,e){void 0===t&&(t={});var i=n(t,"key",null),s=a(t,"config",null),h=new o(this.scene,0,0,i);return void 0!==e&&(t.add=e),r(this.scene,h,t),s&&h.setConfig(s),h})},676(t,e,i){var r=i(39429),s=i(31600);r.register("particles",function(t,e,i,r){return void 0!==t&&"string"==typeof t&&console.warn("ParticleEmitterManager was removed in Phaser 3.60. See documentation for details"),this.displayList.add(new s(this.scene,t,e,i,r))})},90668(t,e,i){var r=i(29747),s=r,n=r;s=i(21188),n=i(9871),t.exports={renderWebGL:s,renderCanvas:n}},21188(t,e,i){var r=i(59996),s=i(61340),n=i(70554),a=new s,o=new s,h=new s,l=new s,u={},d={},c={quad:new Float32Array(8)};t.exports=function(t,e,i,s){var f=i.camera;f.addToRenderList(e),a.copyWithScrollFactorFrom(f.getViewMatrix(!i.useCanvas),f.scrollX,f.scrollY,e.scrollFactorX,e.scrollFactorY),s&&a.multiply(s),l.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),a.multiply(l);var p=n.getTintAppendFloatAlpha,g=e.alpha,m=e.alive,v=m.length,y=e.viewBounds;if(0!==v&&(!y||r(y,f.worldView))){e.sortCallback&&e.depthSort();for(var x=e.tintMode,T=0;Tthis._length&&(this.counter=this._length-1),this},changeSource:function(t){return this.source=t,this.updateSource()},getPoint:function(t){0===this._direction?(this.counter++,this.counter>=this._length&&(this.yoyo?(this._direction=1,this.counter=this._length-1):this.counter=0)):(this.counter--,-1===this.counter&&(this.yoyo?(this._direction=0,this.counter=0):this.counter=this._length-1));var e=this.points[this.counter];e&&(t.x=e.x,t.y=e.y)}});t.exports=r},68875(t,e,i){var r=i(83419),s=i(26099),n=new r({initialize:function(t){this.source=t,this._tempVec=new s,this.total=-1},getPoint:function(t){var e=this._tempVec;this.source.getRandomPoint(e),t.x=e.x,t.y=e.y}});t.exports=n},21024(t,e,i){t.exports={DeathZone:i(26388),EdgeZone:i(19909),RandomZone:i(68875)}},1159(t,e,i){var r=i(83419),s=i(31401),n=i(68287),a=new r({Extends:n,Mixins:[s.PathFollower],initialize:function(t,e,i,r,s,a){n.call(this,t,i,r,s,a),this.path=e},preUpdate:function(t,e){this.anims.update(t,e),this.pathUpdate(t)}});t.exports=a},90145(t,e,i){var r=i(39429),s=i(1159);r.register("follower",function(t,e,i,r,n){var a=new s(this.scene,t,e,i,r,n);return this.displayList.add(a),this.updateList.add(a),a})},80321(t,e,i){var r=i(43246),s=i(83419),n=i(31401),a=i(95643),o=i(30100),h=i(67277),l=new s({Extends:a,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.Mask,n.RenderNodes,n.ScrollFactor,n.Transform,n.Visible,h],initialize:function(t,e,i,r,s,n,h){void 0===r&&(r=16777215),void 0===s&&(s=128),void 0===n&&(n=1),void 0===h&&(h=.1),a.call(this,t,"PointLight"),this.initRenderNodes(this._defaultRenderNodesMap),this.setPosition(e,i),this.color=o(r),this.intensity=n,this.attenuation=h,this.width=2*s,this.height=2*s,this._radius=s},_defaultRenderNodesMap:{get:function(){return r}},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this.width=2*t,this.height=2*t}},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return this._radius}},displayOriginY:{get:function(){return this._radius}}});t.exports=l},39829(t,e,i){var r=i(25305),s=i(44603),n=i(23568),a=i(80321);s.register("pointlight",function(t,e){void 0===t&&(t={});var i=n(t,"color",16777215),s=n(t,"radius",128),o=n(t,"intensity",1),h=n(t,"attenuation",.1),l=new a(this.scene,0,0,i,s,o,h);return void 0!==e&&(t.add=e),r(this.scene,l,t),l})},71255(t,e,i){var r=i(39429),s=i(80321);r.register("pointlight",function(t,e,i,r,n,a){return this.displayList.add(new s(this.scene,t,e,i,r,n,a))})},67277(t,e,i){var r=i(29747),s=r,n=r;s=i(57787),t.exports={renderWebGL:s,renderCanvas:n}},57787(t,e,i){var r=i(91296);t.exports=function(t,e,i,s){var n=i.camera;n.addToRenderList(e);var a=r(e,n,s,!i.useCanvas).calc,o=e.width,h=e.height,l=-e._radius,u=-e._radius,d=l+o,c=u+h,f=a.getX(0,0),p=a.getY(0,0),g=a.getX(l,u),m=a.getY(l,u),v=a.getX(l,c),y=a.getY(l,c),x=a.getX(d,c),T=a.getY(d,c),w=a.getX(d,u),b=a.getY(d,u);(e.customRenderNodes.BatchHandler||e.defaultRenderNodes.BatchHandler).batch(i,e,g,m,v,y,w,b,x,T,f,p)}},591(t,e,i){var r=i(83419),s=i(45650),n=i(88571),a=i(83999),o=i(58855),h=new r({Extends:n,Mixins:[a],initialize:function(t,e,i,r,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=32),void 0===a&&(a=32),void 0===h&&(h=!0);var l=t.sys.textures.addDynamicTexture(s(),r,a,h);n.call(this,t,e,i,l),this.type="RenderTexture",this.camera=this.texture.camera,this._saved=!1,this.renderMode=o.RENDER,this.isCurrentlyRendering=!1},setSize:function(t,e){this.width=t,this.height=e,this.updateDisplayOrigin();var i=this.input;return i&&!i.customHitArea&&(i.hitArea.width=t,i.hitArea.height=e),this},resize:function(t,e,i){return this.texture.setSize(t,e,i),this.setSize(this.texture.width,this.texture.height),this},saveTexture:function(t){var e=this.texture,i=e.key,r=e.manager;return r.exists(i)&&r.get(i)===e?(r.renameTexture(i,t),this._saved=!0):(e.key=t,e.manager.addDynamicTexture(e)&&(this._saved=!0)),e},setRenderMode:function(t,e){return this.renderMode=t,e&&this.texture.preserve(!0),this},render:function(){return this.texture.render(),this},fill:function(t,e,i,r,s,n){return this.texture.fill(t,e,i,r,s,n),this},clear:function(t,e,i,r){return this.texture.clear(t,e,i,r),this},stamp:function(t,e,i,r,s){return this.texture.stamp(t,e,i,r,s),this},erase:function(t,e,i){return this.texture.erase(t,e,i),this},draw:function(t,e,i,r,s){return this.texture.draw(t,e,i,r,s),this},capture:function(t,e){return this.texture.capture(t,e),this},repeat:function(t,e,i,r,s,n,a){return this.texture.repeat(t,e,i,r,s,n,a),this},preserve:function(t){return this.texture.preserve(t),this},callback:function(t){return this.texture.callback(t),this},snapshotArea:function(t,e,i,r,s,n,a){return this.texture.snapshotArea(t,e,i,r,s,n,a),this},snapshot:function(t,e,i){return this.texture.snapshot(t,e,i)},snapshotPixel:function(t,e,i){return this.texture.snapshotPixel(t,e,i)},preDestroy:function(){this.camera=null,this._saved||this.texture.destroy()}});t.exports=h},97272(t,e,i){var r=i(40652),s=i(58855);t.exports=function(t,e,i,n){var a=!0,o=!0;e.renderMode===s.REDRAW?o=!1:e.renderMode===s.RENDER&&(a=!1),a&&e.render(),o&&r(t,e,i,n)}},34495(t,e,i){var r=i(25305),s=i(44603),n=i(23568),a=i(591);s.register("renderTexture",function(t,e){void 0===t&&(t={});var i=n(t,"x",0),s=n(t,"y",0),o=n(t,"width",32),h=n(t,"height",32),l=new a(this.scene,i,s,o,h);return void 0!==e&&(t.add=e),r(this.scene,l,t),l})},60505(t,e,i){var r=i(39429),s=i(591);r.register("renderTexture",function(t,e,i,r){return this.displayList.add(new s(this.scene,t,e,i,r))})},83999(t,e,i){var r=i(29747),s=r,n=r;s=i(53937),n=i(97272),t.exports={renderWebGL:s,renderCanvas:n}},58855(t){t.exports={RENDER:"render",REDRAW:"redraw",ALL:"all"}},53937(t,e,i){var r=i(99517),s=i(58855);t.exports=function(t,e,i,n){if(!e.isCurrentlyRendering){e.isCurrentlyRendering=!0;var a=!0,o=!0;e.renderMode===s.REDRAW?o=!1:e.renderMode===s.RENDER&&(a=!1),a&&e.render(),o&&r(t,e,i,n),e.isCurrentlyRendering=!1}}},77757(t,e,i){var r=i(9674),s=i(85760),n=i(83419),a=i(31401),o=i(95643),h=i(38745),l=i(84322),u=i(26099),d=new n({Extends:o,Mixins:[a.AlphaSingle,a.BlendMode,a.Depth,a.Flip,a.Mask,a.RenderNodes,a.Size,a.Texture,a.Transform,a.Visible,a.ScrollFactor,h],initialize:function(t,e,i,s,n,a,h,d,c){void 0===s&&(s="__DEFAULT"),void 0===a&&(a=2),void 0===h&&(h=!0),o.call(this,t,"Rope"),this.anims=new r(this),this.points=a,this.vertices,this.uv,this.colors,this.alphas,this.tintMode="__DEFAULT"===s?l.FILL:l.MULTIPLY,this.dirty=!1,this.horizontal=h,this._flipX=!1,this._flipY=!1,this._perp=new u,this.debugCallback=null,this.debugGraphic=null,this.setTexture(s,n),this.setPosition(e,i),this.setSizeToFrame(),this.initRenderNodes(this._defaultRenderNodesMap),Array.isArray(a)&&this.resizeArrays(a.length),this.setPoints(a,d,c),this.updateVertices()},_defaultRenderNodesMap:{get:function(){return s}},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(t,e){var i=this.anims.currentFrame;this.anims.update(t,e),this.anims.currentFrame!==i&&(this.updateUVs(),this.updateVertices())},play:function(t,e,i){return this.anims.play(t,e,i),this},setDirty:function(){return this.dirty=!0,this},setHorizontal:function(t,e,i){return void 0===t&&(t=this.points.length),this.horizontal?this:(this.horizontal=!0,this.setPoints(t,e,i))},setVertical:function(t,e,i){return void 0===t&&(t=this.points.length),this.horizontal?(this.horizontal=!1,this.setPoints(t,e,i)):this},setTintMode:function(t){return void 0===t&&(t=l.MULTIPLY),this.tintMode=t,this},setAlphas:function(t,e){var i=this.points.length;if(i<1)return this;var r,s=this.alphas;void 0===t?t=[1]:Array.isArray(t)||void 0!==e||(t=[t]);var n=0;if(void 0!==e)for(r=0;rn&&(a=t[n]),s[n]=a,t.length>n+1&&(a=t[n+1]),s[n+1]=a}return this},setColors:function(t){var e=this.points.length;if(e<1)return this;var i,r=this.colors;void 0===t?t=[16777215]:Array.isArray(t)||(t=[t]);var s=0;if(t.length===e)for(i=0;is&&(n=t[s]),r[s]=n,t.length>s+1&&(n=t[s+1]),r[s+1]=n}return this},setPoints:function(t,e,i){if(void 0===t&&(t=2),"number"==typeof t){var r,s,n,a=t;if(a<2&&(a=2),t=[],this.horizontal)for(n=-this.frame.halfWidth,s=this.frame.width/(a-1),r=0;r>>16,o=(65280&s)>>>8,h=255&s;t.fillStyle="rgba("+a+","+o+","+h+","+n+")"}},75177(t){t.exports=function(t,e,i,r){var s=i||e.strokeColor,n=r||e.strokeAlpha,a=(16711680&s)>>>16,o=(65280&s)>>>8,h=255&s;t.strokeStyle="rgba("+a+","+o+","+h+","+n+")",t.lineWidth=e.lineWidth}},17803(t,e,i){var r=i(87891),s=i(83419),n=i(31401),a=i(95643),o=i(23031),h=new s({Extends:a,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.GetBounds,n.Lighting,n.Mask,n.Origin,n.RenderNodes,n.ScrollFactor,n.Transform,n.Visible],initialize:function(t,e,i){void 0===e&&(e="Shape"),a.call(this,t,e),this.geom=i,this.pathData=[],this.pathIndexes=[],this.fillColor=16777215,this.fillAlpha=1,this.strokeColor=16777215,this.strokeAlpha=1,this.lineWidth=1,this.isFilled=!1,this.isStroked=!1,this.closePath=!0,this._tempLine=new o,this.width=0,this.height=0,this.enableFilters&&(this.filtersFocusContext=!0),this.initRenderNodes(this._defaultRenderNodesMap)},_defaultRenderNodesMap:{get:function(){return r}},setFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.isFilled=!1:(this.fillColor=t,this.fillAlpha=e,this.isFilled=!0),this},setStrokeStyle:function(t,e,i){return void 0===i&&(i=1),void 0===t?this.isStroked=!1:(this.lineWidth=t,this.strokeColor=e,this.strokeAlpha=i,this.isStroked=!0),this},setClosePath:function(t){return this.closePath=t,this},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this},preDestroy:function(){this.geom=null,this._tempLine=null,this.pathData=[],this.pathIndexes=[]},displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}}});t.exports=h},34682(t,e,i){var r=i(70554);t.exports=function(t,e,i,s,n,a,o){var h=r.getTintAppendFloatAlpha(s.strokeColor,s.strokeAlpha*n),l=s.pathData,u=l.length-1,d=s.lineWidth,c=!s.closePath,f=s.customRenderNodes.StrokePath||s.defaultRenderNodes.StrokePath,p=[];c&&(u-=2);for(var g=0;g0&&m===l[g-2]&&v===l[g-1]||p.push({x:m,y:v,width:d})}f.run(t,e,p,d,c,i,h,h,h,h,void 0,s.lighting)}},23629(t,e,i){var r=i(13609),s=i(83419),n=i(39506),a=i(94811),o=i(96503),h=i(36383),l=i(17803),u=new s({Extends:l,Mixins:[r],initialize:function(t,e,i,r,s,n,a,h,u){void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=128),void 0===s&&(s=0),void 0===n&&(n=360),void 0===a&&(a=!1),l.call(this,t,"Arc",new o(0,0,r)),this._startAngle=s,this._endAngle=n,this._anticlockwise=a,this._iterations=.01,this.setPosition(e,i);var d=2*this.geom.radius;this.setSize(d,d),void 0!==h&&this.setFillStyle(h,u),this.updateDisplayOrigin(),this.updateData()},iterations:{get:function(){return this._iterations},set:function(t){this._iterations=t,this.updateData()}},radius:{get:function(){return this.geom.radius},set:function(t){this.geom.radius=t;var e=2*t;this.setSize(e,e),this.updateDisplayOrigin(),this.updateData()}},startAngle:{get:function(){return this._startAngle},set:function(t){this._startAngle=t,this.updateData()}},endAngle:{get:function(){return this._endAngle},set:function(t){this._endAngle=t,this.updateData()}},anticlockwise:{get:function(){return this._anticlockwise},set:function(t){this._anticlockwise=t,this.updateData()}},setRadius:function(t){return this.radius=t,this},setIterations:function(t){return void 0===t&&(t=.01),this.iterations=t,this},setStartAngle:function(t,e){return this._startAngle=t,void 0!==e&&(this._anticlockwise=e),this.updateData()},setEndAngle:function(t,e){return this._endAngle=t,void 0!==e&&(this._anticlockwise=e),this.updateData()},updateData:function(){var t=this._iterations,e=t,i=this.geom.radius,r=n(this._startAngle),s=n(this._endAngle),o=i,l=i;s-=r,this._anticlockwise?s<-h.TAU?s=-h.TAU:s>0&&(s=-h.TAU+s%h.TAU):s>h.TAU?s=h.TAU:s<0&&(s=h.TAU+s%h.TAU);for(var u,d=[o+Math.cos(r)*i,l+Math.sin(r)*i];e<1;)u=s*e+r,d.push(o+Math.cos(u)*i,l+Math.sin(u)*i),e+=t;return u=s+r,d.push(o+Math.cos(u)*i,l+Math.sin(u)*i),d.push(o+Math.cos(r)*i,l+Math.sin(r)*i),this.pathIndexes=a(d),this.pathData=d,this}});t.exports=u},42542(t,e,i){var r=i(39506),s=i(65960),n=i(75177),a=i(20926);t.exports=function(t,e,i,o){i.addToRenderList(e);var h=t.currentContext;if(a(t,h,e,i,o)){var l=e.radius;h.beginPath(),h.arc(l-e.originX*(2*l),l-e.originY*(2*l),l,r(e._startAngle),r(e._endAngle),e.anticlockwise),e.closePath&&h.closePath(),e.isFilled&&(s(h,e),h.fill()),e.isStroked&&(n(h,e),h.stroke()),h.restore()}}},42563(t,e,i){var r=i(23629),s=i(39429);s.register("arc",function(t,e,i,s,n,a,o,h){return this.displayList.add(new r(this.scene,t,e,i,s,n,a,o,h))}),s.register("circle",function(t,e,i,s,n){return this.displayList.add(new r(this.scene,t,e,i,0,360,!1,s,n))})},13609(t,e,i){var r=i(29747),s=r,n=r;s=i(41447),n=i(42542),t.exports={renderWebGL:s,renderCanvas:n}},41447(t,e,i){var r=i(91296),s=i(10441),n=i(34682);t.exports=function(t,e,i,a){var o=i.camera;o.addToRenderList(e);var h=r(e,o,a,!i.useCanvas).calc,l=e._displayOriginX,u=e._displayOriginY,d=e.alpha,c=e.customRenderNodes.Submitter||e.defaultRenderNodes.Submitter;e.isFilled&&s(i,c,h,e,d,l,u),e.isStroked&&n(i,c,h,e,d,l,u)}},89(t,e,i){var r=i(83419),s=i(33141),n=i(94811),a=i(87841),o=i(17803),h=new r({Extends:o,Mixins:[s],initialize:function(t,e,i,r,s,n){void 0===e&&(e=0),void 0===i&&(i=0),o.call(this,t,"Curve",r),this._smoothness=32,this._curveBounds=new a,this.closePath=!1,this.setPosition(e,i),void 0!==s&&this.setFillStyle(s,n),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(t){this._smoothness=t,this.updateData()}},setSmoothness:function(t){return this._smoothness=t,this.updateData()},updateData:function(){var t=this._curveBounds,e=this._smoothness;this.geom.getBounds(t,e),this.setSize(t.width,t.height),this.updateDisplayOrigin();for(var i=[],r=this.geom.getPoints(e),s=0;s0)for(r(o,e),_=0;_0&&P>0&&o.fillRect(h+A*f+C,l+_*p+C,R,P));if(b&&e.altFillAlpha>0)for(r(o,e,e.altFillColor,e.altFillAlpha*u),_=0;_0&&P>0&&o.fillRect(h+A*f+C,l+_*p+C,R,P)):M=1;if(S&&e.strokeAlpha>0){s(o,e,e.strokeColor,e.strokeAlpha*u);var O=e.strokeOutside?0:1;for(A=O;AE&&(o.beginPath(),o.moveTo(d+h,l),o.lineTo(d+h,c+l),o.stroke()),c>E&&(o.beginPath(),o.moveTo(h,c+l),o.lineTo(d+h,c+l),o.stroke()))}o.restore()}}},34137(t,e,i){var r=i(39429),s=i(30479);r.register("grid",function(t,e,i,r,n,a,o,h,l,u){return this.displayList.add(new s(this.scene,t,e,i,r,n,a,o,h,l,u))})},26015(t,e,i){var r=i(29747),s=r,n=r;s=i(46161),n=i(49912),t.exports={renderWebGL:s,renderCanvas:n}},46161(t,e,i){var r=i(91296),s=i(70554);t.exports=function(t,e,i,n){var a=i.camera;a.addToRenderList(e);var o=e.customRenderNodes.FillRect||e.defaultRenderNodes.FillRect,h=e.customRenderNodes.Submitter||e.defaultRenderNodes.Submitter,l=r(e,a,n,!i.useCanvas).calc;l.translate(-e._displayOriginX,-e._displayOriginY);var u,d=e.alpha,c=e.width,f=e.height,p=e.cellWidth,g=e.cellHeight,m=Math.ceil(c/p),v=Math.ceil(f/g),y=p,x=g,T=p-(m*p-c),w=g-(v*g-f),b=e.isFilled,S=e.showAltCells,C=e.isStroked,E=e.cellPadding,A=e.lineWidth,_=A/2,M=0,R=0,P=0,O=0,L=0;if(E&&(y-=2*E,x-=2*E,T-=2*E,w-=2*E),b&&e.fillAlpha>0)for(u=s.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*d),R=0;R0&&L>0&&o.run(i,l,h,M*p+E,R*g+E,O,L,u,u,u,u,e.lighting));if(S&&e.altFillAlpha>0)for(u=s.getTintAppendFloatAlpha(e.altFillColor,e.altFillAlpha*d),R=0;R0&&L>0&&o.run(i,l,h,M*p+E,R*g+E,O,L,u,u,u,u)):P=1;if(C&&e.strokeAlpha>0){var D=s.getTintAppendFloatAlpha(e.strokeColor,e.strokeAlpha*d),F=e.strokeOutside?0:1;for(M=F;M_&&o.run(i,l,h,c-_,0,A,f,D,D,D,D),f>_&&o.run(i,l,h,0,f-_,c,A,D,D,D,D))}}},61475(t,e,i){var r=i(99651),s=i(83419),n=i(17803),a=new s({Extends:n,Mixins:[r],initialize:function(t,e,i,r,s,a,o,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=48),void 0===s&&(s=32),void 0===a&&(a=15658734),void 0===o&&(o=10066329),void 0===h&&(h=13421772),n.call(this,t,"IsoBox",null),this.projection=4,this.fillTop=a,this.fillLeft=o,this.fillRight=h,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isFilled=!0,this.setPosition(e,i),this.setSize(r,s),this.updateDisplayOrigin()},setProjection:function(t){return this.projection=t,this},setFaces:function(t,e,i){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),this.showTop=t,this.showLeft=e,this.showRight=i,this},setFillStyle:function(t,e,i){return this.fillTop=t,this.fillLeft=e,this.fillRight=i,this.isFilled=!0,this}});t.exports=a},11508(t,e,i){var r=i(65960),s=i(20926);t.exports=function(t,e,i,n){i.addToRenderList(e);var a=t.currentContext;if(s(t,a,e,i,n)&&e.isFilled){var o=e.width,h=e.height,l=o/2,u=o/e.projection;e.showTop&&(r(a,e,e.fillTop),a.beginPath(),a.moveTo(-l,-h),a.lineTo(0,-u-h),a.lineTo(l,-h),a.lineTo(l,-1),a.lineTo(0,u-1),a.lineTo(-l,-1),a.lineTo(-l,-h),a.fill()),e.showLeft&&(r(a,e,e.fillLeft),a.beginPath(),a.moveTo(-l,0),a.lineTo(0,u),a.lineTo(0,u-h),a.lineTo(-l,-h),a.lineTo(-l,0),a.fill()),e.showRight&&(r(a,e,e.fillRight),a.beginPath(),a.moveTo(l,0),a.lineTo(0,u),a.lineTo(0,u-h),a.lineTo(l,-h),a.lineTo(l,0),a.fill()),a.restore()}}},3933(t,e,i){var r=i(39429),s=i(61475);r.register("isobox",function(t,e,i,r,n,a,o){return this.displayList.add(new s(this.scene,t,e,i,r,n,a,o))})},99651(t,e,i){var r=i(29747),s=r,n=r;s=i(68149),n=i(11508),t.exports={renderWebGL:s,renderCanvas:n}},68149(t,e,i){var r=i(91296),s=i(70554);t.exports=function(t,e,i,n){if(e.isFilled){var a=i.camera;a.addToRenderList(e);var o,h,l,u,d,c,f,p,g,m=e.customRenderNodes.FillTri||e.defaultRenderNodes.FillTri,v=e.customRenderNodes.Submitter||e.defaultRenderNodes.Submitter,y=r(e,a,n,!i.useCanvas).calc,x=e.width,T=e.height,w=x/2,b=x/e.projection,S=e.alpha,C=e.lighting;e.showTop&&(o=s.getTintAppendFloatAlpha(e.fillTop,S),h=-w,l=-T,u=0,d=-b-T,c=w,f=-T,p=0,g=b-T,m.run(i,y,v,h,l,u,d,c,f,o,o,o,C),m.run(i,y,v,c,f,p,g,h,l,o,o,o,C)),e.showLeft&&(o=s.getTintAppendFloatAlpha(e.fillLeft,S),h=-w,l=0,u=0,d=b,c=0,f=b-T,p=-w,g=-T,m.run(i,y,v,h,l,u,d,c,f,o,o,o,C),m.run(i,y,v,c,f,p,g,h,l,o,o,o,C)),e.showRight&&(o=s.getTintAppendFloatAlpha(e.fillRight,S),h=w,l=0,u=0,d=b,c=0,f=b-T,p=w,g=-T,m.run(i,y,v,h,l,u,d,c,f,o,o,o,C),m.run(i,y,v,c,f,p,g,h,l,o,o,o,C))}}},16933(t,e,i){var r=i(83419),s=i(60561),n=i(17803),a=new r({Extends:n,Mixins:[s],initialize:function(t,e,i,r,s,a,o,h,l){void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=48),void 0===s&&(s=32),void 0===a&&(a=!1),void 0===o&&(o=15658734),void 0===h&&(h=10066329),void 0===l&&(l=13421772),n.call(this,t,"IsoTriangle",null),this.projection=4,this.fillTop=o,this.fillLeft=h,this.fillRight=l,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isReversed=a,this.isFilled=!0,this.setPosition(e,i),this.setSize(r,s),this.updateDisplayOrigin()},setProjection:function(t){return this.projection=t,this},setReversed:function(t){return this.isReversed=t,this},setFaces:function(t,e,i){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),this.showTop=t,this.showLeft=e,this.showRight=i,this},setFillStyle:function(t,e,i){return this.fillTop=t,this.fillLeft=e,this.fillRight=i,this.isFilled=!0,this}});t.exports=a},79590(t,e,i){var r=i(65960),s=i(20926);t.exports=function(t,e,i,n){i.addToRenderList(e);var a=t.currentContext;if(s(t,a,e,i,n)&&e.isFilled){var o=e.width,h=e.height,l=o/2,u=o/e.projection,d=e.isReversed;e.showTop&&d&&(r(a,e,e.fillTop),a.beginPath(),a.moveTo(-l,-h),a.lineTo(0,-u-h),a.lineTo(l,-h),a.lineTo(0,u-h),a.fill()),e.showLeft&&(r(a,e,e.fillLeft),a.beginPath(),d?(a.moveTo(-l,-h),a.lineTo(0,u),a.lineTo(0,u-h)):(a.moveTo(-l,0),a.lineTo(0,u),a.lineTo(0,u-h)),a.fill()),e.showRight&&(r(a,e,e.fillRight),a.beginPath(),d?(a.moveTo(l,-h),a.lineTo(0,u),a.lineTo(0,u-h)):(a.moveTo(l,0),a.lineTo(0,u),a.lineTo(0,u-h)),a.fill()),a.restore()}}},49803(t,e,i){var r=i(39429),s=i(16933);r.register("isotriangle",function(t,e,i,r,n,a,o,h){return this.displayList.add(new s(this.scene,t,e,i,r,n,a,o,h))})},60561(t,e,i){var r=i(29747),s=r,n=r;s=i(51503),n=i(79590),t.exports={renderWebGL:s,renderCanvas:n}},51503(t,e,i){var r=i(91296),s=i(70554);t.exports=function(t,e,i,n){if(e.isFilled){var a=i.camera;a.addToRenderList(e);var o,h,l,u,d,c,f,p=e.customRenderNodes.FillTri||e.defaultRenderNodes.FillTri,g=e.customRenderNodes.Submitter||e.defaultRenderNodes.Submitter,m=r(e,a,n,!i.useCanvas).calc,v=e.width,y=e.height,x=v/2,T=v/e.projection,w=e.isReversed,b=e.alpha,S=e.lighting;if(e.showTop&&w){o=s.getTintAppendFloatAlpha(e.fillTop,b),h=-x,l=-y,u=0,d=-T-y,c=x,f=-y;var C=T-y;p.run(i,m,g,h,l,u,d,c,f,o,o,o,S),p.run(i,m,g,c,f,0,C,h,l,o,o,o,S)}e.showLeft&&(o=s.getTintAppendFloatAlpha(e.fillLeft,b),w?(h=-x,l=-y,u=0,d=T,c=0,f=T-y):(h=-x,l=0,u=0,d=T,c=0,f=T-y),p.run(i,m,g,h,l,u,d,c,f,o,o,o,S)),e.showRight&&(o=s.getTintAppendFloatAlpha(e.fillRight,b),w?(h=x,l=-y,u=0,d=T,c=0,f=T-y):(h=x,l=0,u=0,d=T,c=0,f=T-y),p.run(i,m,g,h,l,u,d,c,f,o,o,o,S))}}},57847(t,e,i){var r=i(83419),s=i(17803),n=i(23031),a=i(36823),o=new r({Extends:s,Mixins:[a],initialize:function(t,e,i,r,a,o,h,l,u){void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===a&&(a=0),void 0===o&&(o=128),void 0===h&&(h=0),s.call(this,t,"Line",new n(r,a,o,h));var d=Math.max(1,this.geom.right-this.geom.left),c=Math.max(1,this.geom.bottom-this.geom.top);this.lineWidth=1,this._startWidth=1,this._endWidth=1,this.setPosition(e,i),this.setSize(d,c),void 0!==l&&this.setStrokeStyle(1,l,u),this.updateDisplayOrigin()},setLineWidth:function(t,e){return void 0===e&&(e=t),this._startWidth=t,this._endWidth=e,this.lineWidth=t,this},setTo:function(t,e,i,r){return this.geom.setTo(t,e,i,r),this}});t.exports=o},17440(t,e,i){var r=i(75177),s=i(20926);t.exports=function(t,e,i,n){i.addToRenderList(e);var a=t.currentContext;if(s(t,a,e,i,n)){var o=e._displayOriginX,h=e._displayOriginY;e.isStroked&&(r(a,e),a.beginPath(),a.moveTo(e.geom.x1-o,e.geom.y1-h),a.lineTo(e.geom.x2-o,e.geom.y2-h),a.stroke()),a.restore()}}},2481(t,e,i){var r=i(39429),s=i(57847);r.register("line",function(t,e,i,r,n,a,o,h){return this.displayList.add(new s(this.scene,t,e,i,r,n,a,o,h))})},36823(t,e,i){var r=i(29747),s=r,n=r;s=i(77385),n=i(17440),t.exports={renderWebGL:s,renderCanvas:n}},77385(t,e,i){var r=i(91296),s=i(70554),n=[{x:0,y:0,width:0},{x:0,y:0,width:0}];t.exports=function(t,e,i,a){var o=i.camera;o.addToRenderList(e);var h=r(e,o,a,!i.useCanvas).calc,l=e._displayOriginX,u=e._displayOriginY,d=e.alpha;if(e.isStroked){var c=s.getTintAppendFloatAlpha(e.strokeColor,e.strokeAlpha*d);n[0].x=e.geom.x1-l,n[0].y=e.geom.y1-u,n[0].width=e._startWidth,n[1].x=e.geom.x2-l,n[1].y=e.geom.y2-u,n[1].width=e._endWidth,(e.customRenderNodes.StrokePath||e.defaultRenderNodes.StrokePath).run(i,e.customRenderNodes.Submitter||e.defaultRenderNodes.Submitter,n,1,!0,h,c,c,c,c,void 0,e.lighting)}}},24949(t,e,i){var r=i(90273),s=i(83419),n=i(94811),a=i(13829),o=i(25717),h=i(17803),l=i(5469),u=new s({Extends:h,Mixins:[r],initialize:function(t,e,i,r,s,n){void 0===e&&(e=0),void 0===i&&(i=0),h.call(this,t,"Polygon",new o(r));var l=a(this.geom);this.setPosition(e,i),this.setSize(l.width,l.height),void 0!==s&&this.setFillStyle(s,n),this.updateDisplayOrigin(),this.updateData()},smooth:function(t){void 0===t&&(t=1);for(var e=0;e0,this.updateRoundedData()},setSize:function(t,e){this.width=t,this.height=e,this.geom.setSize(t,e),this.updateData(),this.updateDisplayOrigin();var i=this.input;return i&&!i.customHitArea&&(i.hitArea.width=t,i.hitArea.height=e),this},updateData:function(){if(this.isRounded)return this.updateRoundedData();var t=[],e=this.geom,i=this._tempLine;return e.getLineA(i),t.push(i.x1,i.y1,i.x2,i.y2),e.getLineB(i),t.push(i.x2,i.y2),e.getLineC(i),t.push(i.x2,i.y2),e.getLineD(i),t.push(i.x2,i.y2),this.pathData=t,this},updateRoundedData:function(){var t=[],e=this.width/2,i=this.height/2,r=Math.min(e,i),n=Math.min(this.radius,r),a=e,o=i,h=Math.max(4,Math.min(16,Math.ceil(n/2)));return this.arcTo(t,a-e+n,o-i+n,n,Math.PI,1.5*Math.PI,h),t.push(a+e-n,o-i),this.arcTo(t,a+e-n,o-i+n,n,1.5*Math.PI,2*Math.PI,h),t.push(a+e,o+i-n),this.arcTo(t,a+e-n,o+i-n,n,0,.5*Math.PI,h),t.push(a-e+n,o+i),this.arcTo(t,a-e+n,o+i-n,n,.5*Math.PI,Math.PI,h),t.push(a-e,o-i+n),this.pathIndexes=s(t),this.pathData=t,this},arcTo:function(t,e,i,r,s,n,a){for(var o=(n-s)/a,h=0;h<=a;h++){var l=s+o*h;t.push(e+Math.cos(l)*r,i+Math.sin(l)*r)}}});t.exports=h},48682(t,e,i){var r=i(65960),s=i(75177),n=i(20926),a=function(t,e,i,r,s,n){var a=Math.min(r/2,s/2),o=Math.min(n,a);0!==o?(t.moveTo(e+o,i),t.lineTo(e+r-o,i),t.arcTo(e+r,i,e+r,i+o,o),t.lineTo(e+r,i+s-o),t.arcTo(e+r,i+s,e+r-o,i+s,o),t.lineTo(e+o,i+s),t.arcTo(e,i+s,e,i+s-o,o),t.lineTo(e,i+o),t.arcTo(e,i,e+o,i,o),t.closePath()):t.rect(e,i,r,s)};t.exports=function(t,e,i,o){i.addToRenderList(e);var h=t.currentContext;if(n(t,h,e,i,o)){var l=e._displayOriginX,u=e._displayOriginY;e.isFilled&&(r(h,e),e.isRounded?(h.beginPath(),a(h,-l,-u,e.width,e.height,e.radius),h.fill()):h.fillRect(-l,-u,e.width,e.height)),e.isStroked&&(s(h,e),h.beginPath(),e.isRounded?a(h,-l,-u,e.width,e.height,e.radius):h.rect(-l,-u,e.width,e.height),h.stroke()),h.restore()}}},87959(t,e,i){var r=i(39429),s=i(74561);r.register("rectangle",function(t,e,i,r,n,a){return this.displayList.add(new s(this.scene,t,e,i,r,n,a))})},95597(t,e,i){var r=i(29747),s=r,n=r;s=i(52059),n=i(48682),t.exports={renderWebGL:s,renderCanvas:n}},52059(t,e,i){var r=i(10441),s=i(91296),n=i(34682),a=i(70554);t.exports=function(t,e,i,o){var h=i.camera;h.addToRenderList(e);var l=s(e,h,o,!i.useCanvas).calc,u=e._displayOriginX,d=e._displayOriginY,c=e.alpha,f=e.customRenderNodes,p=e.defaultRenderNodes,g=f.Submitter||p.Submitter;if(e.isFilled)if(e.isRounded)r(i,g,l,e,c,u,d);else{var m=a.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*c);(f.FillRect||p.FillRect).run(i,l,g,-u,-d,e.width,e.height,m,m,m,m,e.lighting)}e.isStroked&&n(i,g,l,e,c,u,d)}},55911(t,e,i){var r=i(81991),s=i(83419),n=i(94811),a=i(17803),o=new s({Extends:a,Mixins:[r],initialize:function(t,e,i,r,s,n,o,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=5),void 0===s&&(s=32),void 0===n&&(n=64),a.call(this,t,"Star",null),this._points=r,this._innerRadius=s,this._outerRadius=n,this.setPosition(e,i),this.setSize(2*n,2*n),void 0!==o&&this.setFillStyle(o,h),this.updateDisplayOrigin(),this.updateData()},setPoints:function(t){return this._points=t,this.updateData()},setInnerRadius:function(t){return this._innerRadius=t,this.updateData()},setOuterRadius:function(t){return this._outerRadius=t,this.updateData()},points:{get:function(){return this._points},set:function(t){this._points=t,this.updateData()}},innerRadius:{get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this.updateData()}},outerRadius:{get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this.updateData()}},updateData:function(){var t=[],e=this._points,i=this._innerRadius,r=this._outerRadius,s=Math.PI/2*3,a=Math.PI/e,o=r,h=r;t.push(o,h+-r);for(var l=0;l=this.size||this.bufferUpdateSegments===this.MAX_BUFFER_UPDATE_SEGMENTS_FULL)){var e=Math.floor(t/this.bufferUpdateSegmentSize);this.bufferUpdateSegments|=1<=this.size)return this;var e=this.submitterNode.instanceBufferLayout,i=e.buffer.viewF32,r=this.memberCount*e.layout.stride;return i.set(t,r/i.BYTES_PER_ELEMENT),this.setSegmentNeedsUpdate(this.memberCount),this.memberCount++,this},addMember:function(t){if(this.memberCount>=this.size)return this;var e=this.nextMemberF32,i=this.nextMemberU32;t||(t={});var r=this.frame;if(void 0!==t.frame&&(r=t.frame.base?t.frame.base:t.frame),"string"==typeof r&&!(r=this.texture.get(r)))return this;var s=0;this._setAnimatedValue(t.x,s),s+=4,this._setAnimatedValue(t.y,s),s+=4,this._setAnimatedValue(t.rotation,s),s+=4,this._setAnimatedValue(t.scaleX,s,1),s+=4,this._setAnimatedValue(t.scaleY,s,1),s+=4,this._setAnimatedValue(t.alpha,s,1),s+=4;var n=t.animation;if(n){var a;if("string"==typeof n||"number"==typeof n)a="string"==typeof n?this.animationDataNames[n]:this.animationDataIndices[n],this._setAnimatedValue({base:a.index,amplitude:a.frameCount,duration:a.duration,ease:h.Linear,yoyo:!1},s);else{var o=n.base;a="string"==typeof o?this.animationDataNames[o]:"number"==typeof o?this.animationDataIndices[o]:this.animationData[0],this._setAnimatedValue({base:a.index,amplitude:"number"==typeof n.amplitude?n.amplitude:a.frameCount,duration:n.duration||a.duration,delay:n.delay||0,ease:n.ease||h.Linear,yoyo:!!n.yoyo},s)}}else{var l=this.frameDataIndices[r.name],u=t.frame;u&&void 0!==u.base?this._setAnimatedValue({base:l,amplitude:u.amplitude,duration:u.duration,delay:u.delay,ease:u.ease,yoyo:u.yoyo},s):this._setAnimatedValue(l,s)}s+=4,this._setAnimatedValue(t.tintBlend,s,1),s+=4;var c=void 0===t.tintBottomLeft?16777215:t.tintBottomLeft,f=void 0===t.tintTopLeft?16777215:t.tintTopLeft,p=void 0===t.tintBottomRight?16777215:t.tintBottomRight,g=void 0===t.tintTopRight?16777215:t.tintTopRight,m=void 0===t.alphaBottomLeft?1:t.alphaBottomLeft,v=void 0===t.alphaTopLeft?1:t.alphaTopLeft,y=void 0===t.alphaBottomRight?1:t.alphaBottomRight,x=void 0===t.alphaTopRight?1:t.alphaTopRight;return i[s++]=d(c,m),i[s++]=d(f,v),i[s++]=d(p,y),i[s++]=d(g,x),e[s++]=void 0===t.originX?.5:t.originX,e[s++]=void 0===t.originY?.5:t.originY,e[s++]=t.tintMode||0,e[s++]=void 0===t.creationTime?this.timeElapsed:t.creationTime,e[s++]=void 0===t.scrollFactorX?1:t.scrollFactorX,e[s++]=void 0===t.scrollFactorY?1:t.scrollFactorY,this.addData(this.nextMemberF32),this},editMember:function(t,e){if(t<0||t>=this.memberCount)return this;var i=this.memberCount;return this.memberCount=t,this.addMember(e),this.memberCount=i,this},patchMember:function(t,e,i){if(!(t<0||t>=this.memberCount)){var r=this.submitterNode.instanceBufferLayout,s=r.buffer,n=t*r.layout.stride,a=s.viewU32,o=n/4;if(i)for(var h=0;h=this.memberCount)return null;var e=this.submitterNode.instanceBufferLayout,i=e.buffer,r=t*e.layout.stride,s=i.viewF32,n=i.viewU32,a={},o=r/s.BYTES_PER_ELEMENT;a.x=this._getAnimatedValue(o),o+=4,a.y=this._getAnimatedValue(o),o+=4,a.rotation=this._getAnimatedValue(o),o+=4,a.scaleX=this._getAnimatedValue(o),o+=4,a.scaleY=this._getAnimatedValue(o),o+=4,a.alpha=this._getAnimatedValue(o),o+=4;var h=this._getAnimatedValue(o);o+=4,"number"!=typeof h&&(h=h.base);var l=this.frameDataIndicesInv[h];if(void 0===l){var u=this.animationDataIndices[h];u&&(a.animation=u.name)}else a.frame=l;return a.tintBlend=this._getAnimatedValue(o),o+=4,a.tintBottomLeft=n[o++],a.tintTopLeft=n[o++],a.tintBottomRight=n[o++],a.tintTopRight=n[o++],a.alphaBottomLeft=(a.tintBottomLeft>>>24)/255,a.alphaTopLeft=(a.tintTopLeft>>>24)/255,a.alphaBottomRight=(a.tintBottomRight>>>24)/255,a.alphaTopRight=(a.tintTopRight>>>24)/255,a.tintBottomLeft&=16777215,a.tintTopLeft&=16777215,a.tintBottomRight&=16777215,a.tintTopRight&=16777215,a.originX=s[o++],a.originY=s[o++],a.tintMode=s[o++],a.creationTime=s[o++],a.scrollFactorX=s[o++],a.scrollFactorY=s[o++],a},getMemberData:function(t,e){if(t<0||t>=this.memberCount)return null;var i=this.submitterNode.instanceBufferLayout,r=i.buffer,s=i.layout.stride,n=t*s;e||(e=this.nextMemberU32);var a=r.viewU32,o=a.BYTES_PER_ELEMENT;return e.set(a.subarray(n/o,n/o+s/o)),e},removeMembers:function(t,e){if(t<0||t>=this.memberCount)return this;void 0===e&&(e=1),e=Math.min(e,this.memberCount-t);var i=this.submitterNode.instanceBufferLayout,r=i.layout.stride,s=t*r,n=e*r,a=i.buffer.viewU8;a.set(a.subarray(s+n),s);for(var o=t;othis.memberCount)return this;Array.isArray(e)||(e=[e]);var i=this.memberCount,r=this.submitterNode.instanceBufferLayout,s=r.layout.stride,n=t*s,a=e.length*s;r.buffer.viewU8.copyWithin(n+a,n,i*s),this.memberCount=t;for(var o=0;othis.memberCount)return this;var i=e.length*e.BYTES_PER_ELEMENT,r=this.submitterNode.instanceBufferLayout,s=r.layout.stride,n=t*s;r.buffer.viewU8.copyWithin(n+i,n,this.memberCount*s),r.buffer.viewU32.set(e,n/e.BYTES_PER_ELEMENT),this.memberCount=Math.min(this.size,this.memberCount+i/s);for(var a=t;a=1?p=0:p<-1&&(p=-.999),p=(p+1)/2,a=Math.floor(f)+p}(l=o>0?l/o%2:0)<0&&(l+=2),l/=2,l+=n,u&&(o=-o),d||(l=-l),r[e++]=s,r[e++]=a,r[e++]=o,r[e]=l}},_getAnimatedValue:function(t){var e=this.submitterNode.instanceBufferLayout.buffer.viewF32,i=e[t++],r=e[t++],s=e[t++],n=e[t];if(0===r||0===s||0===o)return i;n>0||(n=-n);var a=s<0;a&&(s=-s);var o=Math.floor(n);if(n=(n-=o)*s*2%s,o===h.Gravity){var l=Math.floor(r),u=2*(r-l)-1;return 0===u&&(u=1),{base:i,ease:o,duration:s,delay:n,yoyo:a,velocity:l,gravityFactor:u}}return{base:i,ease:o,amplitude:r,duration:s,delay:n,yoyo:a}},setAnimationEnabled:function(t,e){return this._animationsEnabled[t]=!!e,this},preDestroy:function(){this.frameDataTexture.destroy()}});t.exports=c},16193(t,e,i){var r=i(10312),s=i(44603),n=i(23568),a=i(76573);s.register("spriteGPULayer",function(t,e){void 0===t&&(t={});var i=n(t,"key",null),s=n(t,"size",1),o=new a(this.scene,i,s);return void 0!==e&&(t.add=e),o.alpha=n(t,"alpha",1),o.blendMode=n(t,"blendMode",r.NORMAL),o.visible=n(t,"visible",!0),e&&this.scene.sys.displayList.add(o),o})},96019(t,e,i){var r=i(76573);i(39429).register("spriteGPULayer",function(t,e){return this.displayList.add(new r(this.scene,t,e))})},71238(t,e,i){var r=i(29747),s=i(97591),n=r;t.exports={renderWebGL:s,renderCanvas:n}},97591(t){t.exports=function(t,e,i,r){i.camera.addToRenderList(e);var s=e.customRenderNodes,n=e.defaultRenderNodes;(s.Submitter||n.Submitter).run(i)}},14727(t,e,i){var r=i(78705),s=i(83419),n=i(88571),a=i(74759),o=new s({Extends:n,Mixins:[a],initialize:function(t,e,i,r,s){n.call(this,t,e,i,r,s),this.type="Stamp"},_defaultRenderNodesMap:{get:function(){return r}}});t.exports=o},656(t,e,i){var r=new(i(61340));t.exports=function(t,e,i){i.addToRenderList(e),r.copyFrom(i.matrix),i.matrix.loadIdentity();var s=i.scrollX,n=i.scrollY;i.scrollX=0,i.scrollY=0,t.batchSprite(e,e.frame,i),i.scrollX=s,i.scrollY=n,i.matrix.copyFrom(r)}},31479(t,e,i){var r=i(25305),s=i(44603),n=i(23568),a=i(14727);s.register("stamp",function(t,e){void 0===t&&(t={});var i=n(t,"key",null),s=n(t,"frame",null),o=new a(this.scene,0,0,i,s);return void 0!==e&&(t.add=e),r(this.scene,o,t),o})},85326(t,e,i){var r=i(14727);i(39429).register("stamp",function(t,e,i,s){return this.displayList.add(new r(this.scene,t,e,i,s))})},74759(t,e,i){var r=i(29747);r=i(656),t.exports={renderCanvas:r}},14220(t){t.exports=function(t,e,i){var r=t.canvas,s=t.context,n=t.style,a=[],o=0,h=i.length;n.maxLines>0&&n.maxLines1&&(d+=l*(c.length-1))}n.wordWrap&&(d-=s.measureText(" ").width),a[u]=Math.ceil(d),o=Math.max(o,a[u])}var p=e.fontSize+n.strokeThickness,g=p*h,m=t.lineSpacing;return h>1&&(g+=m*(h-1)),{width:o,height:g,lines:h,lineWidths:a,lineSpacing:m,lineHeight:p}}},79557(t,e,i){var r=i(27919);t.exports=function(t){var e=r.create(this),i=e.getContext("2d",{willReadFrequently:!0});t.syncFont(e,i);var s=i.measureText(t.testString);if("actualBoundingBoxAscent"in s){var n=s.actualBoundingBoxAscent,a=s.actualBoundingBoxDescent;return r.remove(e),{ascent:n,descent:a,fontSize:n+a}}var o=Math.ceil(s.width*t.baselineX),h=o,l=2*h;h=h*t.baselineY|0,e.width=o,e.height=l,i.fillStyle="#f00",i.fillRect(0,0,o,l),i.font=t._font,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(t.testString,0,h);var u={ascent:0,descent:0,fontSize:0},d=i.getImageData(0,0,o,l);if(!d)return u.ascent=h,u.descent=h+6,u.fontSize=u.ascent+u.descent,r.remove(e),u;var c,f,p=d.data,g=p.length,m=4*o,v=0,y=!1;for(c=0;ch;c--){for(f=0;fu){if(0===c){for(var v=p;v.length;){var y=(v=v.slice(0,-1)).length*this.letterSpacing;if((m=e.measureText(v).width+y)<=u)break}if(!v.length)throw new Error("wordWrapWidth < a single character");var x=f.substr(v.length);d[c]=x,h+=v}var T=d[c].length?c:c+1,w=d.slice(T).join(" ").replace(/[ \n]*$/gi,"");s.splice(a+1,0,w),n=s.length;break}h+=p,u-=m}r+=h.replace(/[ \n]*$/gi,"")+"\n"}}return r=r.replace(/[\s|\n]*$/gi,"")},basicWordWrap:function(t,e,i){for(var r="",s=t.split(this.splitRegExp),n=s.length-1,a=e.measureText(" ").width,o=0;o<=n;o++){for(var h=i,l=s[o].split(" "),u=l.length-1,d=0;d<=u;d++){var c=l[d],f=c.length*this.letterSpacing,p=e.measureText(c).width+f,g=p;dh&&d>0&&(r+="\n",h=i),r+=c,d0&&(c+=h.lineSpacing*g),i.rtl)d=f-d-u.left-u.right;else if("right"===i.align)d+=a-h.lineWidths[g];else if("center"===i.align)d+=(a-h.lineWidths[g])/2;else if("justify"===i.align){if(h.lineWidths[g]/h.width>=.85){var m=h.width-h.lineWidths[g],v=e.measureText(" ").width,y=o[g].trim(),x=y.split(" ");m+=(o[g].length-y.length)*v;for(var T=Math.floor(m/v),w=0;T>0;)x[w]+=" ",w=(w+1)%(x.length-1||1),--T;o[g]=x.join(" ")}}this.autoRound&&(d=Math.round(d),c=Math.round(c));var b=this.letterSpacing;if(i.strokeThickness&&0===b&&(i.syncShadow(e,i.shadowStroke),e.strokeText(o[g],d,c)),i.color)if(i.syncShadow(e,i.shadowFill),0!==b)for(var S=0,C=o[g].split(""),E=0;E2?a[o++]:"",r=a[o++]||"16px",i=a[o++]||"Courier"}return i===this.fontFamily&&r===this.fontSize&&s===this.fontStyle||(this.fontFamily=i,this.fontSize=r,this.fontStyle=s,e&&this.update(!0)),this.parent},setFontFamily:function(t){return this.fontFamily!==t&&(this.fontFamily=t,this.update(!0)),this.parent},setFontStyle:function(t){return this.fontStyle!==t&&(this.fontStyle=t,this.update(!0)),this.parent},setFontSize:function(t){return"number"==typeof t&&(t=t.toString()+"px"),this.fontSize!==t&&(this.fontSize=t,this.update(!0)),this.parent},setTestString:function(t){return this.testString=t,this.update(!0)},setFixedSize:function(t,e){return this.fixedWidth=t,this.fixedHeight=e,t&&(this.parent.width=t),e&&(this.parent.height=e),this.update(!1)},setBackgroundColor:function(t){return this.backgroundColor=t,this.update(!1)},setFill:function(t){return this.color=t,this.update(!1)},setColor:function(t){return this.color=t,this.update(!1)},setResolution:function(t){return this.resolution=t,this.update(!1)},setStroke:function(t,e){return void 0===e&&(e=this.strokeThickness),void 0===t&&0!==this.strokeThickness?(this.strokeThickness=0,this.update(!0)):this.stroke===t&&this.strokeThickness===e||(this.stroke=t,this.strokeThickness=e,this.update(!0)),this.parent},setShadow:function(t,e,i,r,s,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i="#000"),void 0===r&&(r=0),void 0===s&&(s=!1),void 0===n&&(n=!0),this.shadowOffsetX=t,this.shadowOffsetY=e,this.shadowColor=i,this.shadowBlur=r,this.shadowStroke=s,this.shadowFill=n,this.update(!1)},setShadowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.shadowOffsetX=t,this.shadowOffsetY=e,this.update(!1)},setShadowColor:function(t){return void 0===t&&(t="#000"),this.shadowColor=t,this.update(!1)},setShadowBlur:function(t){return void 0===t&&(t=0),this.shadowBlur=t,this.update(!1)},setShadowStroke:function(t){return this.shadowStroke=t,this.update(!1)},setShadowFill:function(t){return this.shadowFill=t,this.update(!1)},setWordWrapWidth:function(t,e){return void 0===e&&(e=!1),this.wordWrapWidth=t,this.wordWrapUseAdvanced=e,this.update(!1)},setWordWrapCallback:function(t,e){return void 0===e&&(e=null),this.wordWrapCallback=t,this.wordWrapCallbackScope=e,this.update(!1)},setAlign:function(t){return void 0===t&&(t="left"),this.align=t,this.update(!1)},setMaxLines:function(t){return void 0===t&&(t=0),this.maxLines=t,this.update(!1)},getTextMetrics:function(){var t=this.metrics;return{ascent:t.ascent,descent:t.descent,fontSize:t.fontSize}},toJSON:function(){var t={};for(var e in o)t[e]=this[e];return t.metrics=this.getTextMetrics(),t},destroy:function(){this.parent=void 0}});t.exports=h},34397(t){t.exports=function(t,e,i,r){if(0!==e.width&&0!==e.height){i.camera.addToRenderList(e);var s=e.customRenderNodes,n=e.defaultRenderNodes;(s.Submitter||n.Submitter).run(i,e,r,0,s.Texturer||n.Texturer,s.Transformer||n.Transformer)}}},20839(t,e,i){var r=i(9674),s=i(27919),n=i(41571),a=i(83419),o=i(31401),h=i(95643),l=i(68703),u=i(56295),d=i(45650),c=i(26099),f=new a({Extends:h,Mixins:[o.Alpha,o.BlendMode,o.ComputedSize,o.Depth,o.Flip,o.GetBounds,o.Lighting,o.Mask,o.Origin,o.RenderNodes,o.ScrollFactor,o.Texture,o.Tint,o.Transform,o.Visible,u],initialize:function(t,e,i,n,a,o,l){var u=t.sys.renderer,f=u&&!u.gl;h.call(this,t,"TileSprite");var p=t.sys.textures.get(o).get(l);n=n?Math.floor(n):p.width,a=a?Math.floor(a):p.height,this._tilePosition=new c,this._tileScale=new c(1,1),this._tileRotation=0,this.dirty=!1,this.renderer=u,this.canvas=f?s.create(this,n,a):null,this.context=f?this.canvas.getContext("2d",{willReadFrequently:!1}):null,this._displayTextureKey=d(),this.displayTexture=f?t.sys.textures.addCanvas(this._displayTextureKey,this.canvas):null,this.displayFrame=this.displayTexture?this.displayTexture.get():null,this.currentFrame=null,this.fillCanvas=f?s.create2D(this,p.width,this.displayFrame.height):null,this.fillContext=this.fillCanvas?this.fillCanvas.getContext("2d",{willReadFrequently:!1}):null,this.fillPattern=null,this.anims=new r(this),this.setTexture(o,l),this.setPosition(e,i),this.setSize(n,a),this.setOrigin(.5,.5),this.initRenderNodes(this._defaultRenderNodesMap)},_defaultRenderNodesMap:{get:function(){return n}},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(t,e){this.anims.update(t,e)},setFrame:function(t){var e=this.texture.get(t);return e.cutWidth&&e.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this.frame=e,this.dirty=!0,this},setSizeToFrame:function(){return this},setTilePosition:function(t,e){return void 0!==t&&(this.tilePositionX=t),void 0!==e&&(this.tilePositionY=e),this},setTileRotation:function(t){return void 0===t&&(t=0),this.tileRotation=t,this},setTileScale:function(t,e){return void 0===t&&(t=this.tileScaleX),void 0===e&&(e=t),this.tileScaleX=t,this.tileScaleY=e,this},updateTileTexture:function(){if(this.renderer&&!this.renderer.gl){var t=this.frame,e=this.fillContext,i=this.fillCanvas,r=t.cutWidth,s=t.cutHeight;e.clearRect(0,0,r,s),i.width=r,i.height=s,e.drawImage(t.source.image,t.cutX,t.cutY,t.cutWidth,t.cutHeight,0,0,r,s),this.fillPattern=e.createPattern(i,"repeat"),this.currentFrame=t}},updateCanvas:function(){var t=this.canvas,e=this.width,i=this.height,r=this.currentFrame!==this.frame;if((t.width!==e||t.height!==i||r)&&(t.width=e,t.height=i,this.displayFrame.setSize(e,i),this.updateDisplayOrigin(),r&&this.updateTileTexture(),this.dirty=!0),!this.dirty||this.renderer&&this.renderer.gl)this.dirty=!1;else{var s=this.context;this.scene.sys.game.config.antialias||l.disable(s);var n=this._tileScale.x,a=this._tileScale.y,o=this._tilePosition.x,h=this._tilePosition.y;s.clearRect(0,0,e,i),s.save(),s.rotate(this._tileRotation),s.scale(n,a),s.translate(-o,-h),s.fillStyle=this.fillPattern;var u=Math.max(e,Math.abs(e/n)),d=Math.max(i,Math.abs(i/a)),c=Math.sqrt(u*u+d*d);s.fillRect(o-c,h-c,2*c,2*c),s.restore(),this.dirty=!1}},setSize:function(t,e){this.width=t,this.height=e,this.updateDisplayOrigin();var i=this.input;return i&&!i.customHitArea&&(i.hitArea.width=t,i.hitArea.height=e),this},preDestroy:function(){this.canvas&&s.remove(this.canvas),this.fillCanvas&&s.remove(this.fillCanvas),this.fillPattern=null,this.fillContext=null,this.fillCanvas=null,this.displayTexture=null,this.displayFrame=null,this.renderer=null,this.anims.destroy(),this.anims=void 0},tilePositionX:{get:function(){return this._tilePosition.x},set:function(t){this._tilePosition.x=t,this.dirty=!0}},tilePositionY:{get:function(){return this._tilePosition.y},set:function(t){this._tilePosition.y=t,this.dirty=!0}},tileRotation:{get:function(){return this._tileRotation},set:function(t){this._tileRotation=t,this.dirty=!0}},tileScaleX:{get:function(){return this._tileScale.x},set:function(t){this._tileScale.x=t,this.dirty=!0}},tileScaleY:{get:function(){return this._tileScale.y},set:function(t){this._tileScale.y=t,this.dirty=!0}}});t.exports=f},46992(t){t.exports=function(t,e,i,r){e.updateCanvas(),i.addToRenderList(e),t.batchSprite(e,e.displayFrame,i,r)}},14167(t,e,i){var r=i(25305),s=i(44603),n=i(23568),a=i(20839);s.register("tileSprite",function(t,e){void 0===t&&(t={});var i=n(t,"x",0),s=n(t,"y",0),o=n(t,"width",512),h=n(t,"height",512),l=n(t,"key",""),u=n(t,"frame",""),d=new a(this.scene,i,s,o,h,l,u);return void 0!==e&&(t.add=e),r(this.scene,d,t),d})},91681(t,e,i){var r=i(20839);i(39429).register("tileSprite",function(t,e,i,s,n,a){return this.displayList.add(new r(this.scene,t,e,i,s,n,a))})},56295(t,e,i){var r=i(29747),s=r,n=r;s=i(18553),n=i(46992),t.exports={renderWebGL:s,renderCanvas:n}},18553(t){t.exports=function(t,e,i,r){var s=e.width,n=e.height;if(0!==s&&0!==n){i.camera.addToRenderList(e);var a=e.customRenderNodes,o=e.defaultRenderNodes;(a.Submitter||o.Submitter).run(i,e,r,0,a.Texturer||o.Texturer,a.Transformer||o.Transformer)}}},18471(t,e,i){var r=i(45319),s=i(40939),n=i(83419),a=i(31401),o=i(51708),h=i(8443),l=i(95643),u=i(36383),d=i(14463),c=i(45650),f=i(10247),p=new n({Extends:l,Mixins:[a.Alpha,a.BlendMode,a.ComputedSize,a.Depth,a.Flip,a.GetBounds,a.Lighting,a.Mask,a.Origin,a.RenderNodes,a.ScrollFactor,a.TextureCrop,a.Tint,a.Transform,a.Visible,f],initialize:function(t,e,i,r){l.call(this,t,"Video"),this.video,this.videoTexture,this.videoTextureSource,this.snapshotTexture,this.glFlipY=!0,this._key=c(),this.touchLocked=!1,this.playWhenUnlocked=!1,this.frameReady=!1,this.isStalled=!1,this.failedPlayAttempts=0,this.metadata,this.retry=0,this.retryInterval=500,this._systemMuted=!1,this._codeMuted=!1,this._systemPaused=!1,this._codePaused=!1,this._callbacks={ended:this.completeHandler.bind(this),legacy:this.legacyPlayHandler.bind(this),playing:this.playingHandler.bind(this),seeked:this.seekedHandler.bind(this),seeking:this.seekingHandler.bind(this),stalled:this.stalledHandler.bind(this),suspend:this.stalledHandler.bind(this),waiting:this.stalledHandler.bind(this)},this._loadCallbackHandler=this.loadErrorHandler.bind(this),this._metadataCallbackHandler=this.metadataHandler.bind(this),this._crop=this.resetCropObject(),this.markers={},this._markerIn=0,this._markerOut=0,this._playingMarker=!1,this._lastUpdate=0,this.cacheKey="",this.isSeeking=!1,this._playCalled=!1,this._getFrame=!1,this._rfvCallbackId=0;var s=t.sys.game;this._device=s.device.video,this.setPosition(e,i),this.setSize(256,256),this.initRenderNodes(this._defaultRenderNodesMap),s.events.on(h.PAUSE,this.globalPause,this),s.events.on(h.RESUME,this.globalResume,this);var n=t.sys.sound;n&&n.on(d.GLOBAL_MUTE,this.globalMute,this),r&&this.load(r)},_defaultRenderNodesMap:{get:function(){return s}},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},load:function(t){var e=this.scene.sys.cache.video.get(t);return e?(this.cacheKey=t,this.loadHandler(e.url,e.noAudio,e.crossOrigin)):console.warn("No video in cache for key: "+t),this},changeSource:function(t,e,i,r,s){void 0===e&&(e=!0),void 0===i&&(i=!1),this.cacheKey!==t&&(this.load(t),e&&this.play(i,r,s))},getVideoKey:function(){return this.cacheKey},loadURL:function(t,e,i){void 0===e&&(e=!1);var r=this._device.getVideoURL(t);return r?(this.cacheKey="",this.loadHandler(r.url,e,i)):console.warn("No supported video format found for "+t),this},loadMediaStream:function(t,e,i){return this.loadHandler(null,e,i,t)},loadHandler:function(t,e,i,r){e||(e=!1);var s=this.video;if(s?(this.removeLoadEventHandlers(),this.stop()):((s=document.createElement("video")).controls=!1,s.setAttribute("playsinline","playsinline"),s.setAttribute("preload","auto"),s.setAttribute("disablePictureInPicture","true")),e?(s.muted=!0,s.defaultMuted=!0,s.setAttribute("autoplay","autoplay")):(s.muted=!1,s.defaultMuted=!1,s.removeAttribute("autoplay")),i?s.setAttribute("crossorigin",i):s.removeAttribute("crossorigin"),r)if("srcObject"in s)try{s.srcObject=r}catch(t){if("TypeError"!==t.name)throw t;s.src=URL.createObjectURL(r)}else s.src=URL.createObjectURL(r);else s.src=t;this.retry=0,this.video=s,this._playCalled=!1,s.load(),this.addLoadEventHandlers();var n=this.scene.sys.textures.get(this._key);return this.setTexture(n),this},requestVideoFrame:function(t,e){var i=this.video;if(i){var r=e.width,s=e.height,n=this.videoTexture,a=this.videoTextureSource,h=!n||a.source!==i;h?(this._codePaused=i.paused,this._codeMuted=i.muted,n?(a.source=i,a.width=r,a.height=s,n.get().setSize(r,s)):((n=this.scene.sys.textures.create(this._key,i,r,s)).add("__BASE",0,0,0,r,s),this.setTexture(n),this.videoTexture=n,this.videoTextureSource=n.source[0],this.videoTextureSource.setFlipY(this.glFlipY),this.emit(o.VIDEO_TEXTURE,this,n)),this.setSizeToFrame(),this.updateDisplayOrigin()):a.update(),this.isStalled=!1,this.metadata=e;var l=e.mediaTime;h&&(this._lastUpdate=l,this.emit(o.VIDEO_CREATED,this,r,s),this.frameReady||(this.frameReady=!0,this.emit(o.VIDEO_PLAY,this))),this._playingMarker?l>=this._markerOut&&(i.loop?(i.currentTime=this._markerIn,this.emit(o.VIDEO_LOOP,this)):(this.stop(!1),this.emit(o.VIDEO_COMPLETE,this))):l-1&&i>e&&i=0&&!isNaN(i)&&i>e&&(this.markers[t]=[e,i]),this},playMarker:function(t,e){var i=this.markers[t];return i&&this.play(e,i[0],i[1]),this},removeMarker:function(t){return delete this.markers[t],this},snapshot:function(t,e){return void 0===t&&(t=this.width),void 0===e&&(e=this.height),this.snapshotArea(0,0,this.width,this.height,t,e)},snapshotArea:function(t,e,i,r,s,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===r&&(r=this.height),void 0===s&&(s=i),void 0===n&&(n=r);var a=this.video,o=this.snapshotTexture;return o?(o.setSize(s,n),a&&o.context.drawImage(a,t,e,i,r,0,0,s,n)):(o=this.scene.sys.textures.createCanvas(c(),s,n),this.snapshotTexture=o,a&&o.context.drawImage(a,t,e,i,r,0,0,s,n)),o.update()},saveSnapshotTexture:function(t){return this.snapshotTexture?this.scene.sys.textures.renameTexture(this.snapshotTexture.key,t):this.snapshotTexture=this.scene.sys.textures.createCanvas(t,this.width,this.height),this.snapshotTexture},playSuccess:function(){if(this._playCalled){this.addEventHandlers(),this._codePaused=!1,this.touchLocked&&(this.touchLocked=!1,this.emit(o.VIDEO_UNLOCKED,this));var t=this.scene.sys.sound;t&&t.mute&&this.setMute(!0),this._markerIn>-1&&(this.video.currentTime=this._markerIn)}},playError:function(t){var e=t.name;"NotAllowedError"===e?(this.touchLocked=!0,this.playWhenUnlocked=!0,this.failedPlayAttempts=1,this.emit(o.VIDEO_LOCKED,this)):"NotSupportedError"===e?(this.stop(!1),this.emit(o.VIDEO_UNSUPPORTED,this,t)):(this.stop(!1),this.emit(o.VIDEO_ERROR,this,t))},legacyPlayHandler:function(){var t=this.video;t&&(this.playSuccess(),t.removeEventListener("playing",this._callbacks.legacy))},playingHandler:function(){this.isStalled=!1,this.emit(o.VIDEO_PLAYING,this)},loadErrorHandler:function(t){this.stop(!1),this.emit(o.VIDEO_ERROR,this,t)},metadataHandler:function(t){this.emit(o.VIDEO_METADATA,this,t)},setSizeToFrame:function(t){t||(t=this.frame),this.width=t.realWidth,this.height=t.realHeight,1!==this.scaleX&&(this.scaleX=this.displayWidth/this.width),1!==this.scaleY&&(this.scaleY=this.displayHeight/this.height);var e=this.input;return e&&!e.customHitArea&&(e.hitArea.width=this.width,e.hitArea.height=this.height),this},stalledHandler:function(t){this.isStalled=!0,this.emit(o.VIDEO_STALLED,this,t)},completeHandler:function(){this._playCalled=!1,this.emit(o.VIDEO_COMPLETE,this)},preUpdate:function(t,e){this.video&&this._playCalled&&this.touchLocked&&this.playWhenUnlocked&&(this.retry+=e,this.retry>=this.retryInterval&&(this.createPlayPromise(!1),this.retry=0))},seekTo:function(t){var e=this.video;if(e){var i=e.duration;if(i!==1/0&&!isNaN(i)){var r=i*t;this.setCurrentTime(r)}}return this},getCurrentTime:function(){return this.video?this.video.currentTime:0},setCurrentTime:function(t){var e=this.video;if(e){if("string"==typeof t){var i=t[0],r=parseFloat(t.substr(1));"+"===i?t=e.currentTime+r:"-"===i&&(t=e.currentTime-r)}e.currentTime=t}return this},seekingHandler:function(){this.isSeeking=!0,this.emit(o.VIDEO_SEEKING,this)},seekedHandler:function(){this.isSeeking=!1,this.emit(o.VIDEO_SEEKED,this)},getProgress:function(){var t=this.video;if(t){var e=t.duration;if(e!==1/0&&!isNaN(e))return t.currentTime/e}return-1},getDuration:function(){return this.video?this.video.duration:0},setMute:function(t){void 0===t&&(t=!0),this._codeMuted=t;var e=this.video;return e&&(e.muted=!!this._systemMuted||t),this},isMuted:function(){return this._codeMuted},globalMute:function(t,e){this._systemMuted=e;var i=this.video;i&&(i.muted=!!this._codeMuted||e)},globalPause:function(){this._systemPaused=!0,this.video&&!this.video.ended&&(this.removeEventHandlers(),this.video.pause())},globalResume:function(){this._systemPaused=!1,!this.video||this._codePaused||this.video.ended||this.createPlayPromise()},setPaused:function(t){void 0===t&&(t=!0);var e=this.video;return this._codePaused=t,e&&!e.ended&&(t?e.paused||(this.removeEventHandlers(),e.pause()):t||(this._playCalled?e.paused&&!this._systemPaused&&this.createPlayPromise():this.play())),this},pause:function(){return this.setPaused(!0)},resume:function(){return this.setPaused(!1)},getVolume:function(){return this.video?this.video.volume:1},setVolume:function(t){return void 0===t&&(t=1),this.video&&(this.video.volume=r(t,0,1)),this},getPlaybackRate:function(){return this.video?this.video.playbackRate:1},setPlaybackRate:function(t){return this.video&&(this.video.playbackRate=t),this},getLoop:function(){return!!this.video&&this.video.loop},setLoop:function(t){return void 0===t&&(t=!0),this.video&&(this.video.loop=t),this},isPlaying:function(){return!!this.video&&!(this.video.paused||this.video.ended)},isPaused:function(){return this.video&&this._playCalled&&this.video.paused||this._codePaused||this._systemPaused},saveTexture:function(t,e){return void 0===e&&(e=!0),this.videoTexture&&(this.scene.sys.textures.renameTexture(this._key,t),this.videoTextureSource.setFlipY(e)),this._key=t,this.glFlipY=e,!!this.videoTexture},stop:function(t){void 0===t&&(t=!0);var e=this.video;return e&&(this.removeEventHandlers(),e.cancelVideoFrameCallback(this._rfvCallbackId),e.pause()),this.retry=0,this._playCalled=!1,t&&this.emit(o.VIDEO_STOP,this),this},removeVideoElement:function(){var t=this.video;if(t){for(t.parentNode&&t.parentNode.removeChild(t);t.hasChildNodes();)t.removeChild(t.firstChild);t.removeAttribute("autoplay"),t.removeAttribute("src"),this.video=null}},preDestroy:function(){this.stop(!1),this.removeLoadEventHandlers(),this.removeVideoElement();var t=this.scene.sys.game.events;t.off(h.PAUSE,this.globalPause,this),t.off(h.RESUME,this.globalResume,this);var e=this.scene.sys.sound;e&&e.off(d.GLOBAL_MUTE,this.globalMute,this)}});t.exports=p},58352(t){t.exports=function(t,e,i,r){e.videoTexture&&(i.addToRenderList(e),t.batchSprite(e,e.frame,i,r))}},11511(t,e,i){var r=i(25305),s=i(44603),n=i(23568),a=i(18471);s.register("video",function(t,e){void 0===t&&(t={});var i=n(t,"key",null),s=new a(this.scene,0,0,i);return void 0!==e&&(t.add=e),r(this.scene,s,t),s})},89025(t,e,i){var r=i(18471);i(39429).register("video",function(t,e,i){return this.displayList.add(new r(this.scene,t,e,i))})},10247(t,e,i){var r=i(29747),s=r,n=r;s=i(29849),n=i(58352),t.exports={renderWebGL:s,renderCanvas:n}},29849(t){t.exports=function(t,e,i,r){if(e.videoTexture){i.camera.addToRenderList(e);var s=e.customRenderNodes,n=e.defaultRenderNodes;(s.Submitter||n.Submitter).run(i,e,r,0,s.Texturer||n.Texturer,s.Transformer||n.Transformer)}}},41481(t,e,i){t.exports=i(58715).default},95261(t,e,i){var r=i(44603),s=i(23568),n=i(41481);r.register("zone",function(t){var e=s(t,"x",0),i=s(t,"y",0),r=s(t,"width",1),a=s(t,"height",r);return new n(this.scene,e,i,r,a)})},84175(t,e,i){var r=i(41481);i(39429).register("zone",function(t,e,i,s){return this.displayList.add(new r(this.scene,t,e,i,s))})},95166(t){t.exports=function(t){return t.radius>0?Math.PI*t.radius*t.radius:0}},96503(t,e,i){var r=i(83419),s=i(87902),n=i(26241),a=i(79124),o=i(23777),h=i(28176),l=new r({initialize:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this.type=o.CIRCLE,this.x=t,this.y=e,this._radius=i,this._diameter=2*i},contains:function(t,e){return s(this,t,e)},getPoint:function(t,e){return n(this,t,e)},getPoints:function(t,e,i){return a(this,t,e,i)},getRandomPoint:function(t){return h(this,t)},setTo:function(t,e,i){return this.x=t,this.y=e,this._radius=i,this._diameter=2*i,this},setEmpty:function(){return this._radius=0,this._diameter=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},isEmpty:function(){return this._radius<=0},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this._diameter=2*t}},diameter:{get:function(){return this._diameter},set:function(t){this._diameter=t,this._radius=.5*t}},left:{get:function(){return this.x-this._radius},set:function(t){this.x=t+this._radius}},right:{get:function(){return this.x+this._radius},set:function(t){this.x=t-this._radius}},top:{get:function(){return this.y-this._radius},set:function(t){this.y=t+this._radius}},bottom:{get:function(){return this.y+this._radius},set:function(t){this.y=t-this._radius}}});t.exports=l},71562(t){t.exports=function(t){return Math.PI*t.radius*2}},92110(t,e,i){var r=i(26099);t.exports=function(t,e,i){return void 0===i&&(i=new r),i.x=t.x+t.radius*Math.cos(e),i.y=t.y+t.radius*Math.sin(e),i}},42250(t,e,i){var r=i(96503);t.exports=function(t){return new r(t.x,t.y,t.radius)}},87902(t){t.exports=function(t,e,i){return t.radius>0&&e>=t.left&&e<=t.right&&i>=t.top&&i<=t.bottom&&(t.x-e)*(t.x-e)+(t.y-i)*(t.y-i)<=t.radius*t.radius}},5698(t,e,i){var r=i(87902);t.exports=function(t,e){return r(t,e.x,e.y)}},70588(t,e,i){var r=i(87902);t.exports=function(t,e){return r(t,e.x,e.y)&&r(t,e.right,e.y)&&r(t,e.x,e.bottom)&&r(t,e.right,e.bottom)}},26394(t){t.exports=function(t,e){return e.setTo(t.x,t.y,t.radius)}},76278(t){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.radius===e.radius}},2074(t,e,i){var r=i(87841);t.exports=function(t,e){return void 0===e&&(e=new r),e.x=t.left,e.y=t.top,e.width=t.diameter,e.height=t.diameter,e}},26241(t,e,i){var r=i(92110),s=i(62945),n=i(36383),a=i(26099);t.exports=function(t,e,i){void 0===i&&(i=new a);var o=s(e,0,n.TAU);return r(t,o,i)}},79124(t,e,i){var r=i(71562),s=i(92110),n=i(62945),a=i(36383);t.exports=function(t,e,i,o){void 0===o&&(o=[]),!e&&i>0&&(e=r(t)/i);for(var h=0;h1?2-s:s,a=n*Math.cos(i),o=n*Math.sin(i);return e.x=t.x+a*t.radius,e.y=t.y+o*t.radius,e}},88911(t,e,i){var r=i(96503);r.Area=i(95166),r.Circumference=i(71562),r.CircumferencePoint=i(92110),r.Clone=i(42250),r.Contains=i(87902),r.ContainsPoint=i(5698),r.ContainsRect=i(70588),r.CopyFrom=i(26394),r.Equals=i(76278),r.GetBounds=i(2074),r.GetPoint=i(26241),r.GetPoints=i(79124),r.Offset=i(50884),r.OffsetPoint=i(39212),r.Random=i(28176),t.exports=r},23777(t){t.exports={CIRCLE:0,ELLIPSE:1,LINE:2,POINT:3,POLYGON:4,RECTANGLE:5,TRIANGLE:6}},78874(t){t.exports=function(t){return t.isEmpty()?0:t.getMajorRadius()*t.getMinorRadius()*Math.PI}},92990(t){t.exports=function(t){var e=t.width/2,i=t.height/2,r=Math.pow(e-i,2)/Math.pow(e+i,2);return Math.PI*(e+i)*(1+3*r/(10+Math.sqrt(4-3*r)))}},79522(t,e,i){var r=i(26099);t.exports=function(t,e,i){void 0===i&&(i=new r);var s=t.width/2,n=t.height/2;return i.x=t.x+s*Math.cos(e),i.y=t.y+n*Math.sin(e),i}},58102(t,e,i){var r=i(8497);t.exports=function(t){return new r(t.x,t.y,t.width,t.height)}},81154(t){t.exports=function(t,e,i){if(t.width<=0||t.height<=0)return!1;var r=(e-t.x)/t.width,s=(i-t.y)/t.height;return(r*=r)+(s*=s)<.25}},46662(t,e,i){var r=i(81154);t.exports=function(t,e){return r(t,e.x,e.y)}},1632(t,e,i){var r=i(81154);t.exports=function(t,e){return r(t,e.x,e.y)&&r(t,e.right,e.y)&&r(t,e.x,e.bottom)&&r(t,e.right,e.bottom)}},65534(t){t.exports=function(t,e){return e.setTo(t.x,t.y,t.width,t.height)}},8497(t,e,i){var r=i(83419),s=i(81154),n=i(90549),a=i(48320),o=i(23777),h=i(24820),l=new r({initialize:function(t,e,i,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),this.type=o.ELLIPSE,this.x=t,this.y=e,this.width=i,this.height=r},contains:function(t,e){return s(this,t,e)},getPoint:function(t,e){return n(this,t,e)},getPoints:function(t,e,i){return a(this,t,e,i)},getRandomPoint:function(t){return h(this,t)},setTo:function(t,e,i,r){return this.x=t,this.y=e,this.width=i,this.height=r,this},setEmpty:function(){return this.width=0,this.height=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getMinorRadius:function(){return Math.min(this.width,this.height)/2},getMajorRadius:function(){return Math.max(this.width,this.height)/2},left:{get:function(){return this.x-this.width/2},set:function(t){this.x=t+this.width/2}},right:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},top:{get:function(){return this.y-this.height/2},set:function(t){this.y=t+this.height/2}},bottom:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=l},36146(t){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}},23694(t,e,i){var r=i(87841);t.exports=function(t,e){return void 0===e&&(e=new r),e.x=t.left,e.y=t.top,e.width=t.width,e.height=t.height,e}},90549(t,e,i){var r=i(79522),s=i(62945),n=i(36383),a=i(26099);t.exports=function(t,e,i){void 0===i&&(i=new a);var o=s(e,0,n.TAU);return r(t,o,i)}},48320(t,e,i){var r=i(92990),s=i(79522),n=i(62945),a=i(36383);t.exports=function(t,e,i,o){void 0===o&&(o=[]),!e&&i>0&&(e=r(t)/i);for(var h=0;ha||n>o)return!1;if(s<=i||n<=r)return!0;var h=s-i,l=n-r;return h*h+l*l<=t.radius*t.radius}},63376(t,e,i){var r=i(26099),s=i(2044);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var n,a,o,h,l=t.x,u=t.y,d=t.radius,c=e.x,f=e.y,p=e.radius;if(u===f)0===(o=(a=-2*f)*a-4*(n=1)*(c*c+(h=(p*p-d*d-c*c+l*l)/(2*(l-c)))*h-2*c*h+f*f-p*p))?i.push(new r(h,-a/(2*n))):o>0&&(i.push(new r(h,(-a+Math.sqrt(o))/(2*n))),i.push(new r(h,(-a-Math.sqrt(o))/(2*n))));else{var g=(l-c)/(u-f),m=(p*p-d*d-c*c+l*l-f*f+u*u)/(2*(u-f));0===(o=(a=2*u*g-2*m*g-2*l)*a-4*(n=g*g+1)*(l*l+u*u+m*m-d*d-2*u*m))?(h=-a/(2*n),i.push(new r(h,m-h*g))):o>0&&(h=(-a+Math.sqrt(o))/(2*n),i.push(new r(h,m-h*g)),h=(-a-Math.sqrt(o))/(2*n),i.push(new r(h,m-h*g)))}}return i}},97439(t,e,i){var r=i(4042),s=i(81491);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var n=e.getLineA(),a=e.getLineB(),o=e.getLineC(),h=e.getLineD();r(n,t,i),r(a,t,i),r(o,t,i),r(h,t,i)}return i}},4042(t,e,i){var r=i(26099),s=i(80462);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var n,a,o=t.x1,h=t.y1,l=t.x2,u=t.y2,d=e.x,c=e.y,f=e.radius,p=l-o,g=u-h,m=o-d,v=h-c,y=p*p+g*g,x=2*(p*m+g*v),T=x*x-4*y*(m*m+v*v-f*f);if(0===T){var w=-x/(2*y);n=o+w*p,a=h+w*g,w>=0&&w<=1&&i.push(new r(n,a))}else if(T>0){var b=(-x-Math.sqrt(T))/(2*y);n=o+b*p,a=h+b*g,b>=0&&b<=1&&i.push(new r(n,a));var S=(-x+Math.sqrt(T))/(2*y);n=o+S*p,a=h+S*g,S>=0&&S<=1&&i.push(new r(n,a))}}return i}},36100(t,e,i){var r=i(25836);t.exports=function(t,e,i,s){void 0===i&&(i=!1);var n,a,o,h=t.x1,l=t.y1,u=t.x2,d=t.y2,c=e.x1,f=e.y1,p=u-h,g=d-l,m=e.x2-c,v=e.y2-f,y=p*v-g*m;if(0===y)return null;if(i){if(n=(p*(f-l)+g*(h-c))/(m*g-v*p),0!==p)a=(c+m*n-h)/p;else{if(0===g)return null;a=(f+v*n-l)/g}if(a<0||n<0||n>1)return null;o=a}else{if(a=((l-f)*p-(h-c)*g)/y,(n=((c-h)*v-(f-l)*m)/y)<0||n>1||a<0||a>1)return null;o=n}return void 0===s&&(s=new r),s.set(h+p*o,l+g*o,o)}},3073(t,e,i){var r=i(36100),s=i(23031),n=i(25836),a=new s,o=new n;t.exports=function(t,e,i,s){void 0===i&&(i=!1),void 0===s&&(s=new n);var h=!1;s.set(),o.set();for(var l=e[e.length-1],u=0;u0){var c=(o*n+h*a)/l;u*=c,d*=c}return i.x=t.x1+u,i.y=t.y1+d,u*u+d*d<=l&&u*n+d*a>=0&&r(e,i.x,i.y)}},76112(t){t.exports=function(t,e,i){var r=t.x1,s=t.y1,n=t.x2,a=t.y2,o=e.x1,h=e.y1,l=e.x2,u=e.y2;if(r===n&&s===a||o===l&&h===u)return!1;var d=(u-h)*(n-r)-(l-o)*(a-s);if(0===d)return!1;var c=((l-o)*(s-h)-(u-h)*(r-o))/d,f=((n-r)*(s-h)-(a-s)*(r-o))/d;return!(c<0||c>1||f<0||f>1)&&(i&&(i.x=r+c*(n-r),i.y=s+c*(a-s)),!0)}},92773(t){t.exports=function(t,e){var i=t.x1,r=t.y1,s=t.x2,n=t.y2,a=e.x,o=e.y,h=e.right,l=e.bottom,u=0;if(i>=a&&i<=h&&r>=o&&r<=l||s>=a&&s<=h&&n>=o&&n<=l)return!0;if(i=a){if((u=r+(n-r)*(a-i)/(s-i))>o&&u<=l)return!0}else if(i>h&&s<=h&&(u=r+(n-r)*(h-i)/(s-i))>=o&&u<=l)return!0;if(r=o){if((u=i+(s-i)*(o-r)/(n-r))>=a&&u<=h)return!0}else if(r>l&&n<=l&&(u=i+(s-i)*(l-r)/(n-r))>=a&&u<=h)return!0;return!1}},16204(t){t.exports=function(t,e,i){void 0===i&&(i=1);var r=e.x1,s=e.y1,n=e.x2,a=e.y2,o=t.x,h=t.y,l=(n-r)*(n-r)+(a-s)*(a-s);if(0===l)return!1;var u=((o-r)*(n-r)+(h-s)*(a-s))/l;if(u<0)return Math.sqrt((r-o)*(r-o)+(s-h)*(s-h))<=i;if(u>=0&&u<=1){var d=((s-h)*(n-r)-(r-o)*(a-s))/l;return Math.abs(d)*Math.sqrt(l)<=i}return Math.sqrt((n-o)*(n-o)+(a-h)*(a-h))<=i}},14199(t,e,i){var r=i(16204);t.exports=function(t,e){if(!r(t,e))return!1;var i=Math.min(e.x1,e.x2),s=Math.max(e.x1,e.x2),n=Math.min(e.y1,e.y2),a=Math.max(e.y1,e.y2);return t.x>=i&&t.x<=s&&t.y>=n&&t.y<=a}},59996(t){t.exports=function(t,e){return!(t.width<=0||t.height<=0||e.width<=0||e.height<=0)&&!(t.righte.right||t.y>e.bottom)}},89265(t,e,i){var r=i(76112),s=i(37303),n=i(48653),a=i(77493);t.exports=function(t,e){if(e.left>t.right||e.rightt.bottom||e.bottom0}},84411(t){t.exports=function(t,e,i,r,s,n){return void 0===n&&(n=0),!(e>t.right+n||it.bottom+n||se.right||t.righte.bottom||t.bottome.right||t.righte.bottom||t.bottom0||(d=s(e),(c=r(t,d,!0)).length>0)}},91865(t,e,i){t.exports={CircleToCircle:i(2044),CircleToRectangle:i(81491),GetCircleToCircle:i(63376),GetCircleToRectangle:i(97439),GetLineToCircle:i(4042),GetLineToLine:i(36100),GetLineToPoints:i(3073),GetLineToPolygon:i(56362),GetLineToRectangle:i(60646),GetRaysFromPointToPolygon:i(71147),GetRectangleIntersection:i(68389),GetRectangleToRectangle:i(52784),GetRectangleToTriangle:i(26341),GetTriangleToCircle:i(38720),GetTriangleToLine:i(13882),GetTriangleToTriangle:i(75636),LineToCircle:i(80462),LineToLine:i(76112),LineToRectangle:i(92773),PointToLine:i(16204),PointToLineSegment:i(14199),RectangleToRectangle:i(59996),RectangleToTriangle:i(89265),RectangleToValues:i(84411),TriangleToCircle:i(67636),TriangleToLine:i(2822),TriangleToTriangle:i(82944)}},91938(t){t.exports=function(t){return Math.atan2(t.y2-t.y1,t.x2-t.x1)}},84993(t){t.exports=function(t,e,i){void 0===e&&(e=1),void 0===i&&(i=[]);var r=Math.round(t.x1),s=Math.round(t.y1),n=Math.round(t.x2),a=Math.round(t.y2),o=Math.abs(n-r),h=Math.abs(a-s),l=r-h&&(d-=h,r+=l),f0){var v=u[0],y=[v];for(h=1;h=a&&(y.push(x),v=x)}var T=u[u.length-1];return r(v,T)0&&(e=r(t)/i);for(var a=t.x1,o=t.y1,h=t.x2,l=t.y2,u=0;uthis.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=l},64795(t,e,i){var r=i(36383),s=i(15994),n=i(91938);t.exports=function(t){var e=n(t)-r.PI_OVER_2;return s(e,-Math.PI,Math.PI)}},52616(t,e,i){var r=i(36383),s=i(91938);t.exports=function(t){return Math.cos(s(t)-r.PI_OVER_2)}},87231(t,e,i){var r=i(36383),s=i(91938);t.exports=function(t){return Math.sin(s(t)-r.PI_OVER_2)}},89662(t){t.exports=function(t,e,i){return t.x1+=e,t.y1+=i,t.x2+=e,t.y2+=i,t}},71165(t){t.exports=function(t){return-(t.x2-t.x1)/(t.y2-t.y1)}},65822(t,e,i){var r=i(26099);t.exports=function(t,e){void 0===e&&(e=new r);var i=Math.random();return e.x=t.x1+i*(t.x2-t.x1),e.y=t.y1+i*(t.y2-t.y1),e}},69777(t,e,i){var r=i(91938),s=i(64795);t.exports=function(t,e){return 2*s(e)-Math.PI-r(t)}},39706(t,e,i){var r=i(64400);t.exports=function(t,e){var i=(t.x1+t.x2)/2,s=(t.y1+t.y2)/2;return r(t,i,s,e)}},82585(t,e,i){var r=i(64400);t.exports=function(t,e,i){return r(t,e.x,e.y,i)}},64400(t){t.exports=function(t,e,i,r){var s=Math.cos(r),n=Math.sin(r),a=t.x1-e,o=t.y1-i;return t.x1=a*s-o*n+e,t.y1=a*n+o*s+i,a=t.x2-e,o=t.y2-i,t.x2=a*s-o*n+e,t.y2=a*n+o*s+i,t}},62377(t){t.exports=function(t,e,i,r,s){return t.x1=e,t.y1=i,t.x2=e+Math.cos(r)*s,t.y2=i+Math.sin(r)*s,t}},71366(t){t.exports=function(t){return(t.y2-t.y1)/(t.x2-t.x1)}},10809(t){t.exports=function(t){return Math.abs(t.x1-t.x2)}},2529(t,e,i){var r=i(23031);r.Angle=i(91938),r.BresenhamPoints=i(84993),r.CenterOn=i(36469),r.Clone=i(31116),r.CopyFrom=i(59944),r.Equals=i(59220),r.Extend=i(78177),r.GetEasedPoints=i(26708),r.GetMidPoint=i(32125),r.GetNearestPoint=i(99569),r.GetNormal=i(34638),r.GetPoint=i(13151),r.GetPoints=i(15258),r.GetShortestDistance=i(26408),r.Height=i(98770),r.Length=i(35001),r.NormalAngle=i(64795),r.NormalX=i(52616),r.NormalY=i(87231),r.Offset=i(89662),r.PerpSlope=i(71165),r.Random=i(65822),r.ReflectAngle=i(69777),r.Rotate=i(39706),r.RotateAroundPoint=i(82585),r.RotateAroundXY=i(64400),r.SetToAngle=i(62377),r.Slope=i(71366),r.Width=i(10809),t.exports=r},12306(t,e,i){var r=i(25717);t.exports=function(t){return new r(t.points)}},63814(t){t.exports=function(t,e,i){for(var r=!1,s=-1,n=t.points.length-1;++s80*r){n=o=t[0],a=h=t[1];for(var x=r;xo&&(o=d),c>h&&(h=c);p=0!==(p=Math.max(o-n,h-a))?32767/p:0}return s(v,y,r,n,a,p,0),y}function i(t,e,i,r,s){var n,a;if(s===A(t,e,i,r)>0)for(n=e;n=e;n-=r)a=S(n,t[n],t[n+1],a);return a&&v(a,a.next)&&(C(a),a=a.next),a}function r(t,e){if(!t)return t;e||(e=t);var i,r=t;do{if(i=!1,r.steiner||!v(r,r.next)&&0!==m(r.prev,r,r.next))r=r.next;else{if(C(r),(r=e=r.prev)===r.next)break;i=!0}}while(i||r!==e);return e}function s(t,e,i,l,u,d,f){if(t){!f&&d&&function(t,e,i,r){var s=t;do{0===s.z&&(s.z=c(s.x,s.y,e,i,r)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next}while(s!==t);s.prevZ.nextZ=null,s.prevZ=null,function(t){var e,i,r,s,n,a,o,h,l=1;do{for(i=t,t=null,n=null,a=0;i;){for(a++,r=i,o=0,e=0;e0||h>0&&r;)0!==o&&(0===h||!r||i.z<=r.z)?(s=i,i=i.nextZ,o--):(s=r,r=r.nextZ,h--),n?n.nextZ=s:t=s,s.prevZ=n,n=s;i=r}n.nextZ=null,l*=2}while(a>1)}(s)}(t,l,u,d);for(var p,g,m=t;t.prev!==t.next;)if(p=t.prev,g=t.next,d?a(t,l,u,d):n(t))e.push(p.i/i|0),e.push(t.i/i|0),e.push(g.i/i|0),C(t),t=g.next,m=g.next;else if((t=g)===m){f?1===f?s(t=o(r(t),e,i),e,i,l,u,d,2):2===f&&h(t,e,i,l,u,d):s(r(t),e,i,l,u,d,1);break}}}function n(t){var e=t.prev,i=t,r=t.next;if(m(e,i,r)>=0)return!1;for(var s=e.x,n=i.x,a=r.x,o=e.y,h=i.y,l=r.y,u=sn?s>a?s:a:n>a?n:a,f=o>h?o>l?o:l:h>l?h:l,g=r.next;g!==e;){if(g.x>=u&&g.x<=c&&g.y>=d&&g.y<=f&&p(s,o,n,h,a,l,g.x,g.y)&&m(g.prev,g,g.next)>=0)return!1;g=g.next}return!0}function a(t,e,i,r){var s=t.prev,n=t,a=t.next;if(m(s,n,a)>=0)return!1;for(var o=s.x,h=n.x,l=a.x,u=s.y,d=n.y,f=a.y,g=oh?o>l?o:l:h>l?h:l,x=u>d?u>f?u:f:d>f?d:f,T=c(g,v,e,i,r),w=c(y,x,e,i,r),b=t.prevZ,S=t.nextZ;b&&b.z>=T&&S&&S.z<=w;){if(b.x>=g&&b.x<=y&&b.y>=v&&b.y<=x&&b!==s&&b!==a&&p(o,u,h,d,l,f,b.x,b.y)&&m(b.prev,b,b.next)>=0)return!1;if(b=b.prevZ,S.x>=g&&S.x<=y&&S.y>=v&&S.y<=x&&S!==s&&S!==a&&p(o,u,h,d,l,f,S.x,S.y)&&m(S.prev,S,S.next)>=0)return!1;S=S.nextZ}for(;b&&b.z>=T;){if(b.x>=g&&b.x<=y&&b.y>=v&&b.y<=x&&b!==s&&b!==a&&p(o,u,h,d,l,f,b.x,b.y)&&m(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;S&&S.z<=w;){if(S.x>=g&&S.x<=y&&S.y>=v&&S.y<=x&&S!==s&&S!==a&&p(o,u,h,d,l,f,S.x,S.y)&&m(S.prev,S,S.next)>=0)return!1;S=S.nextZ}return!0}function o(t,e,i){var s=t;do{var n=s.prev,a=s.next.next;!v(n,a)&&y(n,s,s.next,a)&&w(n,a)&&w(a,n)&&(e.push(n.i/i|0),e.push(s.i/i|0),e.push(a.i/i|0),C(s),C(s.next),s=t=a),s=s.next}while(s!==t);return r(s)}function h(t,e,i,n,a,o){var h=t;do{for(var l=h.next.next;l!==h.prev;){if(h.i!==l.i&&g(h,l)){var u=b(h,l);return h=r(h,h.next),u=r(u,u.next),s(h,e,i,n,a,o,0),void s(u,e,i,n,a,o,0)}l=l.next}h=h.next}while(h!==t)}function l(t,e){return t.x-e.x}function u(t,e){var i=function(t,e){var i,r=e,s=t.x,n=t.y,a=-1/0;do{if(n<=r.y&&n>=r.next.y&&r.next.y!==r.y){var o=r.x+(n-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(o<=s&&o>a&&(a=o,i=r.x=r.x&&r.x>=u&&s!==r.x&&p(ni.x||r.x===i.x&&d(i,r)))&&(i=r,f=h)),r=r.next}while(r!==l);return i}(t,e);if(!i)return e;var s=b(i,t);return r(s,s.next),r(i,i.next)}function d(t,e){return m(t.prev,t,e.prev)<0&&m(e.next,t,t.next)<0}function c(t,e,i,r,s){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*s|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*s|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function f(t){var e=t,i=t;do{(e.x=(t-a)*(n-o)&&(t-a)*(r-o)>=(i-a)*(e-o)&&(i-a)*(n-o)>=(s-a)*(r-o)}function g(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&y(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(w(t,e)&&w(e,t)&&function(t,e){var i=t,r=!1,s=(t.x+e.x)/2,n=(t.y+e.y)/2;do{i.y>n!=i.next.y>n&&i.next.y!==i.y&&s<(i.next.x-i.x)*(n-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next}while(i!==t);return r}(t,e)&&(m(t.prev,t,e.prev)||m(t,e.prev,e))||v(t,e)&&m(t.prev,t,t.next)>0&&m(e.prev,e,e.next)>0)}function m(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function v(t,e){return t.x===e.x&&t.y===e.y}function y(t,e,i,r){var s=T(m(t,e,i)),n=T(m(t,e,r)),a=T(m(i,r,t)),o=T(m(i,r,e));return s!==n&&a!==o||(!(0!==s||!x(t,i,e))||(!(0!==n||!x(t,r,e))||(!(0!==a||!x(i,t,r))||!(0!==o||!x(i,e,r)))))}function x(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function T(t){return t>0?1:t<0?-1:0}function w(t,e){return m(t.prev,t,t.next)<0?m(t,e,t.next)>=0&&m(t,t.prev,e)>=0:m(t,e,t.prev)<0||m(t,t.next,e)<0}function b(t,e){var i=new E(t.i,t.x,t.y),r=new E(e.i,e.x,e.y),s=t.next,n=e.prev;return t.next=e,e.prev=t,i.next=s,s.prev=i,r.next=i,i.prev=r,n.next=r,r.prev=n,r}function S(t,e,i,r){var s=new E(t,e,i);return r?(s.next=r.next,s.prev=r,r.next.prev=s,r.next=s):(s.prev=s,s.next=s),s}function C(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function E(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function A(t,e,i,r){for(var s=0,n=e,a=i-r;n0&&(r+=t[s-1].length,i.holes.push(r))}return i},t.exports=e},13829(t,e,i){var r=i(87841);t.exports=function(t,e){void 0===e&&(e=new r);for(var i,s=1/0,n=1/0,a=-s,o=-n,h=0;h0&&(e=h/i);for(var l=0;ld+m)){var v=g.getPoint((u-d)/m);a.push(v);break}d+=m}return a}},30052(t,e,i){var r=i(35001),s=i(23031);t.exports=function(t){for(var e=t.points,i=0,n=0;n1?(r=i.x,s=i.y):o>0&&(r+=n*o,s+=a*o)}return(n=t.x-r)*n+(a=t.y-s)*a}function r(t,e,s,n,a){for(var o,h=n,l=e+1;lh&&(o=l,h=u)}h>n&&(o-e>1&&r(t,e,o,n,a),a.push(t[o]),s-o>1&&r(t,o,s,n,a))}function s(t,e){var i=t.length-1,s=[t[0]];return r(t,0,i,e,s),s.push(t[i]),s}t.exports=function(t,i,r){void 0===i&&(i=1),void 0===r&&(r=!1);var n=t.points;if(n.length>2){var a=i*i;r||(n=function(t,i){for(var r,s=t[0],n=[s],a=1,o=t.length;ai&&(n.push(r),s=r);return s!==r&&n.push(r),n}(n,a)),t.setTo(s(n,a))}return t}},5469(t){var e=function(t,e){return t[0]=e[0],t[1]=e[1],t};t.exports=function(t){var i,r=[],s=t.points;for(i=0;i0&&n.push(e([0,0],r[0])),i=0;i1&&n.push(e([0,0],r[r.length-1])),t.setTo(n)}},24709(t){t.exports=function(t,e,i){for(var r=t.points,s=0;st.width*t.height)&&(e.x>t.x&&e.xt.x&&e.rightt.y&&e.yt.y&&e.bottomr(e)?t.setSize(e.height*i,e.height):t.setSize(e.width,e.width/i),t.setPosition(e.centerX-t.width/2,e.centerY-t.height/2)}},80774(t){t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t}},83859(t){t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t.width=Math.floor(t.width),t.height=Math.floor(t.height),t}},19217(t,e,i){var r=i(87841),s=i(36383);t.exports=function(t,e){if(void 0===e&&(e=new r),0===t.length)return e;for(var i,n,a,o=Number.MAX_VALUE,h=Number.MAX_VALUE,l=s.MIN_SAFE_INTEGER,u=s.MIN_SAFE_INTEGER,d=0;d=1)return i.x=t.x,i.y=t.y,i;var n=r(t)*e;return e>.5?(n-=t.width+t.height)<=t.width?(i.x=t.right-n,i.y=t.bottom):(i.x=t.x,i.y=t.bottom-(n-t.width)):n<=t.width?(i.x=t.x+n,i.y=t.y):(i.x=t.right,i.y=t.y+(n-t.width)),i}},34819(t,e,i){var r=i(20812),s=i(13019);t.exports=function(t,e,i,n){void 0===n&&(n=[]),!e&&i>0&&(e=s(t)/i);for(var a=0;a=t.right&&(h=1,o+=a-t.right,a=t.right);break;case 1:(o+=e)>=t.bottom&&(h=2,a-=o-t.bottom,o=t.bottom);break;case 2:(a-=e)<=t.left&&(h=3,o-=t.left-a,a=t.left);break;case 3:(o-=e)<=t.top&&(h=0,o=t.top)}return n}},33595(t){t.exports=function(t,e){for(var i=t.x,r=t.right,s=t.y,n=t.bottom,a=0;ae.x&&t.ye.y}},13019(t){t.exports=function(t){return 2*(t.width+t.height)}},85133(t,e,i){var r=i(26099),s=i(39506);t.exports=function(t,e,i){void 0===i&&(i=new r),e=s(e);var n=Math.sin(e),a=Math.cos(e),o=a>0?t.width/2:t.width/-2,h=n>0?t.height/2:t.height/-2;return Math.abs(o*n)=0&&v>=0&&m+v<1}},48653(t){t.exports=function(t,e,i,r){void 0===i&&(i=!1),void 0===r&&(r=[]);for(var s,n,a,o,h,l,u=t.x3-t.x1,d=t.y3-t.y1,c=t.x2-t.x1,f=t.y2-t.y1,p=u*u+d*d,g=u*c+d*f,m=c*c+f*f,v=p*m-g*g,y=0===v?0:1/v,x=t.x1,T=t.y1,w=0;w=0&&n>=0&&s+n<1&&(r.push({x:e[w].x,y:e[w].y}),i)));w++);return r}},96006(t,e,i){var r=i(10690);t.exports=function(t,e){return r(t,e.x,e.y)}},71326(t){t.exports=function(t,e){return e.setTo(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)}},71694(t){t.exports=function(t,e){return void 0===e&&(e=[]),e.push({x:t.x1,y:t.y1}),e.push({x:t.x2,y:t.y2}),e.push({x:t.x3,y:t.y3}),e}},33522(t){t.exports=function(t,e){return t.x1===e.x1&&t.y1===e.y1&&t.x2===e.x2&&t.y2===e.y2&&t.x3===e.x3&&t.y3===e.y3}},20437(t,e,i){var r=i(26099),s=i(35001);t.exports=function(t,e,i){void 0===i&&(i=new r);var n=t.getLineA(),a=t.getLineB(),o=t.getLineC();if(e<=0||e>=1)return i.x=n.x1,i.y=n.y1,i;var h=s(n),l=s(a),u=s(o),d=(h+l+u)*e,c=0;return dh+l?(c=(d-=h+l)/u,i.x=o.x1+(o.x2-o.x1)*c,i.y=o.y1+(o.y2-o.y1)*c):(c=(d-=h)/l,i.x=a.x1+(a.x2-a.x1)*c,i.y=a.y1+(a.y2-a.y1)*c),i}},80672(t,e,i){var r=i(35001),s=i(26099);t.exports=function(t,e,i,n){void 0===n&&(n=[]);var a=t.getLineA(),o=t.getLineB(),h=t.getLineC(),l=r(a),u=r(o),d=r(h),c=l+u+d;!e&&i>0&&(e=c/i);for(var f=0;fl+u?(g=(p-=l+u)/d,m.x=h.x1+(h.x2-h.x1)*g,m.y=h.y1+(h.y2-h.y1)*g):(g=(p-=l)/u,m.x=o.x1+(o.x2-o.x1)*g,m.y=o.y1+(o.y2-o.y1)*g),n.push(m)}return n}},39757(t,e,i){var r=i(26099);function s(t,e,i,r){var s=t-i,n=e-r,a=s*s+n*n;return Math.sqrt(a)}t.exports=function(t,e){void 0===e&&(e=new r);var i=t.x1,n=t.y1,a=t.x2,o=t.y2,h=t.x3,l=t.y3,u=s(h,l,a,o),d=s(i,n,h,l),c=s(a,o,i,n),f=u+d+c;return e.x=(i*u+a*d+h*c)/f,e.y=(n*u+o*d+l*c)/f,e}},13584(t){t.exports=function(t,e,i){return t.x1+=e,t.y1+=i,t.x2+=e,t.y2+=i,t.x3+=e,t.y3+=i,t}},1376(t,e,i){var r=i(35001);t.exports=function(t){var e=t.getLineA(),i=t.getLineB(),s=t.getLineC();return r(e)+r(i)+r(s)}},90260(t,e,i){var r=i(26099);t.exports=function(t,e){void 0===e&&(e=new r);var i=t.x2-t.x1,s=t.y2-t.y1,n=t.x3-t.x1,a=t.y3-t.y1,o=Math.random(),h=Math.random();return o+h>=1&&(o=1-o,h=1-h),e.x=t.x1+(i*o+n*h),e.y=t.y1+(s*o+a*h),e}},52172(t,e,i){var r=i(99614),s=i(39757);t.exports=function(t,e){var i=s(t);return r(t,i.x,i.y,e)}},49907(t,e,i){var r=i(99614);t.exports=function(t,e,i){return r(t,e.x,e.y,i)}},99614(t){t.exports=function(t,e,i,r){var s=Math.cos(r),n=Math.sin(r),a=t.x1-e,o=t.y1-i;return t.x1=a*s-o*n+e,t.y1=a*n+o*s+i,a=t.x2-e,o=t.y2-i,t.x2=a*s-o*n+e,t.y2=a*n+o*s+i,a=t.x3-e,o=t.y3-i,t.x3=a*s-o*n+e,t.y3=a*n+o*s+i,t}},16483(t,e,i){var r=i(83419),s=i(10690),n=i(20437),a=i(80672),o=i(23777),h=i(23031),l=i(90260),u=new r({initialize:function(t,e,i,r,s,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===s&&(s=0),void 0===n&&(n=0),this.type=o.TRIANGLE,this.x1=t,this.y1=e,this.x2=i,this.y2=r,this.x3=s,this.y3=n},contains:function(t,e){return s(this,t,e)},getPoint:function(t,e){return n(this,t,e)},getPoints:function(t,e,i){return a(this,t,e,i)},getRandomPoint:function(t){return l(this,t)},setTo:function(t,e,i,r,s,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===s&&(s=0),void 0===n&&(n=0),this.x1=t,this.y1=e,this.x2=i,this.y2=r,this.x3=s,this.y3=n,this},getLineA:function(t){return void 0===t&&(t=new h),t.setTo(this.x1,this.y1,this.x2,this.y2),t},getLineB:function(t){return void 0===t&&(t=new h),t.setTo(this.x2,this.y2,this.x3,this.y3),t},getLineC:function(t){return void 0===t&&(t=new h),t.setTo(this.x3,this.y3,this.x1,this.y1),t},left:{get:function(){return Math.min(this.x1,this.x2,this.x3)},set:function(t){var e=0;e=this.x1<=this.x2&&this.x1<=this.x3?this.x1-t:this.x2<=this.x1&&this.x2<=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},right:{get:function(){return Math.max(this.x1,this.x2,this.x3)},set:function(t){var e=0;e=this.x1>=this.x2&&this.x1>=this.x3?this.x1-t:this.x2>=this.x1&&this.x2>=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},top:{get:function(){return Math.min(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1<=this.y2&&this.y1<=this.y3?this.y1-t:this.y2<=this.y1&&this.y2<=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}},bottom:{get:function(){return Math.max(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1>=this.y2&&this.y1>=this.y3?this.y1-t:this.y2>=this.y1&&this.y2>=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}}});t.exports=u},84435(t,e,i){var r=i(16483);r.Area=i(41658),r.BuildEquilateral=i(39208),r.BuildFromPolygon=i(39545),r.BuildRight=i(90301),r.CenterOn=i(23707),r.Centroid=i(97523),r.CircumCenter=i(24951),r.CircumCircle=i(85614),r.Clone=i(74422),r.Contains=i(10690),r.ContainsArray=i(48653),r.ContainsPoint=i(96006),r.CopyFrom=i(71326),r.Decompose=i(71694),r.Equals=i(33522),r.GetPoint=i(20437),r.GetPoints=i(80672),r.InCenter=i(39757),r.Perimeter=i(1376),r.Offset=i(13584),r.Random=i(90260),r.Rotate=i(52172),r.RotateAroundPoint=i(49907),r.RotateAroundXY=i(99614),t.exports=r},74457(t){t.exports=function(t,e,i){return{gameObject:t,enabled:!0,draggable:!1,dropZone:!1,cursor:!1,target:null,camera:null,hitArea:e,hitAreaCallback:i,hitAreaDebug:null,customHitArea:!1,localX:0,localY:0,dragState:0,dragStartX:0,dragStartY:0,dragStartXGlobal:0,dragStartYGlobal:0,dragStartCamera:null,dragX:0,dragY:0}}},84409(t){t.exports=function(t,e){return function(i,r,s,n){var a=t.getPixelAlpha(r,s,n.texture.key,n.frame.name);return a&&a>=e}}},7003(t,e,i){var r=i(83419),s=i(93301),n=i(50792),a=i(8214),o=i(8443),h=i(78970),l=i(85098),u=i(42515),d=i(36210),c=i(61340),f=i(85955),p=new r({initialize:function(t,e){this.game=t,this.scaleManager,this.canvas,this.config=e,this.enabled=!0,this.events=new n,this.isOver=!0,this.defaultCursor="",this.keyboard=e.inputKeyboard?new h(this):null,this.mouse=e.inputMouse?new l(this):null,this.touch=e.inputTouch?new d(this):null,this.pointers=[],this.pointersTotal=e.inputActivePointers;for(var i=0;i<=this.pointersTotal;i++){var r=new u(this,i);r.smoothFactor=e.inputSmoothFactor,this.pointers.push(r)}this.mousePointer=e.inputMouse?this.pointers[0]:null,this.activePointer=this.pointers[0],this.globalTopOnly=!0,this.time=0,this._tempPoint={x:0,y:0},this._tempHitTest=[],this._tempMatrix=new c,this._tempMatrix2=new c,this._tempSkip=!1,this.mousePointerContainer=[this.mousePointer],t.events.once(o.BOOT,this.boot,this)},boot:function(){var t=this.game,e=t.events;this.canvas=t.canvas,this.scaleManager=t.scale,this.events.emit(a.MANAGER_BOOT),e.on(o.PRE_RENDER,this.preRender,this),e.once(o.DESTROY,this.destroy,this)},setCanvasOver:function(t){this.isOver=!0,this.events.emit(a.GAME_OVER,t)},setCanvasOut:function(t){this.isOver=!1,this.events.emit(a.GAME_OUT,t)},preRender:function(){var t=this.game.loop.now,e=this.game.loop.delta,i=this.game.scene.getScenes(!0,!0);this.time=t,this.events.emit(a.MANAGER_UPDATE);for(var r=0;r10&&(t=10-this.pointersTotal);for(var i=0;i-1&&(s.splice(o,1),this.clear(a,!0))}this._pendingRemoval.length=0,this._list=s.concat(e.splice(0))}},isActive:function(){return this.manager&&this.manager.enabled&&this.enabled&&this.scene.sys.canInput()},setCursor:function(t){this.manager&&this.manager.setCursor(t)},resetCursor:function(){this.manager&&this.manager.resetCursor(null,!0)},updatePoll:function(t,e){if(!this.isActive())return!1;if(this.pluginEvents.emit(c.UPDATE,t,e),this._updatedThisFrame)return this._updatedThisFrame=!1,!1;var i,r=this.manager.pointers;for(i=0;i0){if(this._pollTimer-=e,!(this._pollTimer<0))return!1;this._pollTimer=this.pollRate}var n=!1;for(i=0;i0&&(n=!0)}return n},update:function(t,e){if(!this.isActive())return!1;for(var i=!1,r=0;r0&&(i=!0)}return this._updatedThisFrame=!0,i},clear:function(t,e){void 0===e&&(e=!1),this.disable(t);var i=t.input;i&&(this.removeDebug(t),this.manager.resetCursor(i),i.gameObject=void 0,i.target=void 0,i.hitArea=void 0,i.hitAreaCallback=void 0,i.callbackContext=void 0,t.input=null),e||this.queueForRemoval(t);var r=this._draggable.indexOf(t);return r>-1&&this._draggable.splice(r,1),t},disable:function(t,e){void 0===e&&(e=!1);var i=t.input;i&&(i.enabled=!1,i.dragState=0);for(var r,s=this._drag,n=this._over,a=this.manager,o=0;o-1&&s[o].splice(r,1),(r=n[o].indexOf(t))>-1&&n[o].splice(r,1);return e&&this.resetCursor(),this},enable:function(t,e,i,r){return void 0===r&&(r=!1),t.input?t.input.enabled=!0:this.setHitArea(t,e,i),t.input&&r&&!t.input.dropZone&&(t.input.dropZone=r),this},hitTestPointer:function(t){for(var e=this.cameras.getCamerasBelowPointer(t),i=0;i0)return t.camera=r,s}return t.camera=e[0],[]},processDownEvents:function(t){var e=0,i=this._temp,r=this._eventData,s=this._eventContainer;r.cancelled=!1;for(var n=0;n0&&l(t.x,t.y,t.downX,t.downY)>=s||r>0&&e>=t.downTime+r)&&(i=!0),i)return this.setDragState(t,3),this.processDragStartList(t)},processDragStartList:function(t){if(3!==this.getDragState(t))return 0;var e=this._drag[t.id];e.length>1&&(e=e.slice(0));for(var i=0;i1&&(this.sortGameObjects(i,t),this.topOnly&&i.splice(1)),this._drag[t.id]=i,0===this.dragDistanceThreshold&&0===this.dragTimeThreshold?(this.setDragState(t,3),this.processDragStartList(t)):(this.setDragState(t,2),0))},processDragMoveEvent:function(t){if(2===this.getDragState(t)&&this.processDragThresholdEvent(t,this.manager.game.loop.now),4!==this.getDragState(t))return 0;var e=this._tempZones,i=this._drag[t.id];i.length>1&&(i=i.slice(0));for(var r=0;r0?(a.emit(c.GAMEOBJECT_DRAG_LEAVE,t,h),this.emit(c.DRAG_LEAVE,t,a,h),o.target=e[0],h=o.target,a.emit(c.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(c.DRAG_ENTER,t,a,h)):(a.emit(c.GAMEOBJECT_DRAG_LEAVE,t,h),this.emit(c.DRAG_LEAVE,t,a,h),e[0]?(o.target=e[0],h=o.target,a.emit(c.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(c.DRAG_ENTER,t,a,h)):o.target=null)}else!h&&e[0]&&(o.target=e[0],h=o.target,a.emit(c.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(c.DRAG_ENTER,t,a,h));var u=t.positionToCamera(o.dragStartCamera);if(a.parentContainer){var d=u.x-o.dragStartXGlobal,f=u.y-o.dragStartYGlobal,p=a.getParentRotation(),g=d*Math.cos(p)+f*Math.sin(p),m=f*Math.cos(p)-d*Math.sin(p);g*=1/a.parentContainer.scaleX,m*=1/a.parentContainer.scaleY,s=g+o.dragStartX,n=m+o.dragStartY}else s=u.x-o.dragX,n=u.y-o.dragY;a.emit(c.GAMEOBJECT_DRAG,t,s,n),this.emit(c.DRAG,t,a,s,n)}return i.length},processDragUpEvent:function(t){var e=this._drag[t.id];e.length>1&&(e=e.slice(0));for(var i=0;i0){var n=this.manager,a=this._eventData,o=this._eventContainer;a.cancelled=!1;for(var h=0;h0){var s=this.manager,n=this._eventData,a=this._eventContainer;n.cancelled=!1,this.sortGameObjects(e,t);for(var o=0;o0){for(this.sortGameObjects(s,t),e=0;e0){for(this.sortGameObjects(n,t),e=0;e-1&&this._draggable.splice(s,1)}return this},makePixelPerfect:function(t){void 0===t&&(t=1);var e=this.systems.textures;return h(e,t)},setHitArea:function(t,e,i){if(void 0===e)return this.setHitAreaFromTexture(t);Array.isArray(t)||(t=[t]);var r=!1,s=!1,n=!1,a=!1,h=!1,l=!0;if(v(e)&&Object.keys(e).length){var u=e;e=p(u,"hitArea",null),i=p(u,"hitAreaCallback",null),h=p(u,"pixelPerfect",!1);var d=p(u,"alphaTolerance",1);h&&(e={},i=this.makePixelPerfect(d)),r=p(u,"draggable",!1),s=p(u,"dropZone",!1),n=p(u,"cursor",!1),a=p(u,"useHandCursor",!1),e&&i||(this.setHitAreaFromTexture(t),l=!1)}else"function"!=typeof e||i||(i=e,e={});for(var c=0;c=this.threshold?this.pressed||(this.pressed=!0,this.events.emit(s.BUTTON_DOWN,e,this,t),this.pad.emit(s.GAMEPAD_BUTTON_DOWN,i,t,this)):this.pressed&&(this.pressed=!1,this.events.emit(s.BUTTON_UP,e,this,t),this.pad.emit(s.GAMEPAD_BUTTON_UP,i,t,this))},destroy:function(){this.pad=null,this.events=null}});t.exports=n},99125(t,e,i){var r=i(97421),s=i(28884),n=i(83419),a=i(50792),o=i(26099),h=new n({Extends:a,initialize:function(t,e){a.call(this),this.manager=t,this.pad=e,this.id=e.id,this.index=e.index;for(var i=[],n=0;n=.5));this.buttons=i;var h=[];for(n=0;n=2&&(this.leftStick.set(n[0].getValue(),n[1].getValue()),s>=4&&this.rightStick.set(n[2].getValue(),n[3].getValue()))}},destroy:function(){var t;for(this.removeAllListeners(),this.manager=null,this.pad=null,t=0;t-1&&e.preventDefault()}},this.onKeyUp=function(e){if(!e.defaultPrevented&&t.enabled&&t.manager){t.queue.push(e),t.manager.events.emit(a.MANAGER_PROCESS);var i=e.altKey||e.ctrlKey||e.shiftKey||e.metaKey;t.preventDefault&&!i&&t.captures.indexOf(e.keyCode)>-1&&e.preventDefault()}};var e=this.target;e&&(e.addEventListener("keydown",this.onKeyDown,!1),e.addEventListener("keyup",this.onKeyUp,!1),this.enabled=!0)},stopListeners:function(){var t=this.target;t.removeEventListener("keydown",this.onKeyDown,!1),t.removeEventListener("keyup",this.onKeyUp,!1),this.enabled=!1},postUpdate:function(){this.queue=[]},addCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i0},removeCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i0},clearCaptures:function(){this.captures=[],this.preventDefault=!1},destroy:function(){this.stopListeners(),this.clearCaptures(),this.queue=[],this.manager.game.events.off(n.POST_STEP,this.postUpdate,this),this.target=null,this.enabled=!1,this.manager=null}});t.exports=l},28846(t,e,i){var r=i(83419),s=i(50792),n=i(95922),a=i(8443),o=i(35154),h=i(8214),l=i(89639),u=i(30472),d=i(46032),c=i(87960),f=i(74600),p=i(44594),g=i(56583),m=new r({Extends:s,initialize:function(t){s.call(this),this.game=t.systems.game,this.scene=t.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=t,this.manager=t.manager.keyboard,this.enabled=!0,this.keys=[],this.combos=[],this.prevCode=null,this.prevTime=0,this.prevType=null,t.pluginEvents.once(h.BOOT,this.boot,this),t.pluginEvents.on(h.START,this.start,this)},boot:function(){var t=this.settings.input;this.enabled=o(t,"keyboard",!0);var e=o(t,"keyboard.capture",null);e&&this.addCaptures(e),this.sceneInputPlugin.pluginEvents.once(h.DESTROY,this.destroy,this)},start:function(){this.sceneInputPlugin.manager.events.on(h.MANAGER_PROCESS,this.update,this),this.sceneInputPlugin.pluginEvents.once(h.SHUTDOWN,this.shutdown,this),this.game.events.on(a.BLUR,this.resetKeys,this),this.scene.sys.events.on(p.PAUSE,this.resetKeys,this),this.scene.sys.events.on(p.SLEEP,this.resetKeys,this)},isActive:function(){return this.enabled&&this.scene.sys.canInput()},addCapture:function(t){return this.manager.addCapture(t),this},removeCapture:function(t){return this.manager.removeCapture(t),this},getCaptures:function(){return this.manager.captures},enableGlobalCapture:function(){return this.manager.preventDefault=!0,this},disableGlobalCapture:function(){return this.manager.preventDefault=!1,this},clearCaptures:function(){return this.manager.clearCaptures(),this},createCursorKeys:function(){return this.addKeys({up:d.UP,down:d.DOWN,left:d.LEFT,right:d.RIGHT,space:d.SPACE,shift:d.SHIFT})},addKeys:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!1);var r={};if("string"==typeof t){t=t.split(",");for(var s=0;s-1?r[s]=t:r[t.keyCode]=t,e&&this.addCapture(t.keyCode),t.setEmitOnRepeat(i),t}return"string"==typeof t&&(t=d[t.toUpperCase()]),r[t]||(r[t]=new u(this,t),e&&this.addCapture(t),r[t].setEmitOnRepeat(i)),r[t]},removeKey:function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var r,s=this.keys;if(t instanceof u){var n=s.indexOf(t);n>-1&&(r=this.keys[n],this.keys[n]=void 0)}else"string"==typeof t&&(t=d[t.toUpperCase()]);return s[t]&&(r=s[t],s[t]=void 0),r&&(r.plugin=null,i&&this.removeCapture(r.keyCode),e&&r.destroy()),this},removeAllKeys:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1);for(var i=this.keys,r=0;rt._tick)return t._tick=i,!0}return!1},update:function(){var t=this.manager.queue,e=t.length;if(this.isActive()&&0!==e)for(var i=this.keys,r=0;r0&&e.maxKeyDelay>0){var n=e.timeLastMatched+e.maxKeyDelay;t.timeStamp<=n&&(s=!0,i=r(t,e))}else s=!0,i=r(t,e);return!s&&e.resetOnWrongKey&&(e.index=0,e.current=e.keyCodes[0]),i&&(e.timeLastMatched=t.timeStamp,e.matched=!0,e.timeMatched=t.timeStamp),i}},92803(t){t.exports=function(t){return t.current=t.keyCodes[0],t.index=0,t.timeLastMatched=0,t.matched=!1,t.timeMatched=0,t}},92612(t){t.exports="keydown"},23345(t){t.exports="keyup"},21957(t){t.exports="keycombomatch"},44743(t){t.exports="down"},3771(t){t.exports="keydown-"},46358(t){t.exports="keyup-"},75674(t){t.exports="up"},95922(t,e,i){t.exports={ANY_KEY_DOWN:i(92612),ANY_KEY_UP:i(23345),COMBO_MATCH:i(21957),DOWN:i(44743),KEY_DOWN:i(3771),KEY_UP:i(46358),UP:i(75674)}},51442(t,e,i){t.exports={Events:i(95922),KeyboardManager:i(78970),KeyboardPlugin:i(28846),Key:i(30472),KeyCodes:i(46032),KeyCombo:i(87960),AdvanceKeyCombo:i(66970),ProcessKeyCombo:i(68769),ResetKeyCombo:i(92803),JustDown:i(90229),JustUp:i(38796),DownDuration:i(37015),UpDuration:i(41170)}},37015(t){t.exports=function(t,e){void 0===e&&(e=50);var i=t.plugin.game.loop.time-t.timeDown;return t.isDown&&i=400&&t.status<=599&&(r=!1),this.state=s.FILE_LOADED,this.resetXHR(),this.loader.nextFile(this,r)},onBase64Load:function(t){this.xhrLoader=t,this.state=s.FILE_LOADED,this.percentComplete=1,this.loader.emit(n.FILE_PROGRESS,this,this.percentComplete),this.loader.nextFile(this,!0)},onError:function(){this.resetXHR(),this.retryAttempts>0?(this.retryAttempts--,this.load()):this.loader.nextFile(this,!1)},onProgress:function(t){t.lengthComputable&&(this.bytesLoaded=t.loaded,this.bytesTotal=t.total,this.percentComplete=Math.min(this.bytesLoaded/this.bytesTotal,1),this.loader.emit(n.FILE_PROGRESS,this,this.percentComplete))},onProcess:function(){this.state=s.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=s.FILE_COMPLETE,this.multiFile&&this.multiFile.onFileComplete(this),this.loader.fileProcessComplete(this)},onProcessError:function(){console.error('Failed to process file: %s "%s"',this.type,this.key),this.state=s.FILE_ERRORED,this.multiFile&&this.multiFile.onFileFailed(this),this.loader.fileProcessComplete(this)},hasCacheConflict:function(){return this.cache&&this.cache.exists(this.key)},addToCache:function(){this.cache&&this.data&&this.cache.add(this.key,this.data)},pendingDestroy:function(t){if(this.state!==s.FILE_PENDING_DESTROY){void 0===t&&(t=this.data);var e=this.key,i=this.type;this.loader.emit(n.FILE_COMPLETE,e,i,t),this.loader.emit(n.FILE_KEY_COMPLETE+i+"-"+e,e,i,t),this.loader.flagForRemoval(this),this.state=s.FILE_PENDING_DESTROY}},destroy:function(){this.loader=null,this.cache=null,this.xhrSettings=null,this.multiFile=null,this.linkFile=null,this.data=null}});d.createObjectURL=function(t,e,i){if("function"==typeof URL)t.src=URL.createObjectURL(e);else{var r=new FileReader;r.onload=function(){t.removeAttribute("crossOrigin"),t.src="data:"+(e.type||i)+";base64,"+r.result.split(",")[1]},r.onerror=t.onerror,r.readAsDataURL(e)}},d.revokeObjectURL=function(t){"function"==typeof URL&&URL.revokeObjectURL(t.src)},t.exports=d},74099(t){var e={},i={install:function(t){for(var i in e)t[i]=e[i]},register:function(t,i){e[t]=i},destroy:function(){e={}}};t.exports=i},98356(t){t.exports=function(t,e){return!!t.url&&(t.url.match(/^(?:blob:|data:|capacitor:\/\/|file:\/\/|http:\/\/|https:\/\/|\/\/)/)?t.url:e+t.url)}},74261(t,e,i){var r=i(83419),s=i(23906),n=i(50792),a=i(54899),o=i(74099),h=i(95540),l=i(35154),u=i(41212),d=i(37277),c=i(44594),f=i(92638),p=new r({Extends:n,initialize:function(t){n.call(this);var e=t.sys.game.config,i=t.sys.settings.loader;this.scene=t,this.systems=t.sys,this.cacheManager=t.sys.cache,this.textureManager=t.sys.textures,this.sceneManager=t.sys.game.scene,o.install(this),this.prefix="",this.path="",this.baseURL="",this.setBaseURL(h(i,"baseURL",e.loaderBaseURL)),this.setPath(h(i,"path",e.loaderPath)),this.setPrefix(h(i,"prefix",e.loaderPrefix)),this.maxParallelDownloads=h(i,"maxParallelDownloads",e.loaderMaxParallelDownloads),this.xhr=f(h(i,"responseType",e.loaderResponseType),h(i,"async",e.loaderAsync),h(i,"user",e.loaderUser),h(i,"password",e.loaderPassword),h(i,"timeout",e.loaderTimeout),h(i,"withCredentials",e.loaderWithCredentials)),this.crossOrigin=h(i,"crossOrigin",e.loaderCrossOrigin),this.imageLoadType=h(i,"imageLoadType",e.loaderImageLoadType),this.localSchemes=h(i,"localScheme",e.loaderLocalScheme),this.totalToLoad=0,this.progress=0,this.list=new Set,this.inflight=new Set,this.queue=new Set,this._deleteQueue=new Set,this.totalFailed=0,this.totalComplete=0,this.state=s.LOADER_IDLE,this.multiKeyIndex=0,this.maxRetries=h(i,"maxRetries",e.loaderMaxRetries),t.sys.events.once(c.BOOT,this.boot,this),t.sys.events.on(c.START,this.pluginStart,this)},boot:function(){this.systems.events.once(c.DESTROY,this.destroy,this)},pluginStart:function(){this.systems.events.once(c.SHUTDOWN,this.shutdown,this)},setBaseURL:function(t){return void 0===t&&(t=""),""!==t&&"/"!==t.substr(-1)&&(t=t.concat("/")),this.baseURL=t,this},setPath:function(t){return void 0===t&&(t=""),""!==t&&"/"!==t.substr(-1)&&(t=t.concat("/")),this.path=t,this},setPrefix:function(t){return void 0===t&&(t=""),this.prefix=t,this},setCORS:function(t){return this.crossOrigin=t,this},addFile:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e0},removePack:function(t,e){var i,r=this.systems.anims,s=this.cacheManager,n=this.textureManager,a={animation:"json",aseprite:"json",audio:"audio",audioSprite:"audio",binary:"binary",bitmapFont:"bitmapFont",css:null,glsl:"shader",html:"html",json:"json",obj:"obj",plugin:null,scenePlugin:null,script:null,spine:"json",text:"text",tilemapCSV:"tilemap",tilemapImpact:"tilemap",tilemapTiledJSON:"tilemap",video:"video",xml:"xml"};if(u(t))i=t;else if(!(i=s.json.get(t)))return void console.warn("Asset Pack not found in JSON cache:",t);for(var o in e&&(i={_:i[e]}),i){var l=i[o],d=h(l,"prefix",""),c=h(l,"files"),f=h(l,"defaultType");if(Array.isArray(c))for(var p=0;p0&&this.inflight.size'),i.push(''),i.push(''),i.push(this.xhrLoader.responseText),i.push(""),i.push(""),i.push("");var r=[i.join("\n")],a=this;try{var o=new window.Blob(r,{type:"image/svg+xml;charset=utf-8"})}catch(t){return a.state=s.FILE_ERRORED,void a.onProcessComplete()}this.data=new Image,this.data.crossOrigin=this.crossOrigin,this.data.onload=function(){n.revokeObjectURL(a.data),a.onProcessComplete()},this.data.onerror=function(){n.revokeObjectURL(a.data),a.onProcessError()},n.createObjectURL(this.data,o,"image/svg+xml")},addToCache:function(){this.cache.addImage(this.key,this.data)}});a.register("htmlTexture",function(t,e,i,r,s){if(Array.isArray(t))for(var n=0;n=s.FILE_COMPLETE&&("spritesheet"===t.type?t.addToCache():"normalMap"===this.type?this.cache.addImage(this.key,t.data,this.data):this.cache.addImage(this.key,this.data,t.data)):this.cache.addImage(this.key,this.data)}});a.register("image",function(t,e,i){if(Array.isArray(t))for(var r=0;r=0?a.substring(o+i.length):a]=n.data}for(var h=[],l=0;l=s.FILE_COMPLETE&&("normalMap"===this.type?this.cache.addSpriteSheet(this.key,t.data,this.config,this.data):this.cache.addSpriteSheet(this.key,this.data,this.config,t.data)):this.cache.addSpriteSheet(this.key,this.data,this.config)}});n.register("spritesheet",function(t,e,i,r){if(Array.isArray(t))for(var s=0;si&&(i=h.x),h.xn&&(n=h.y),h.y>>0)+2891336453,s=277803737*(r>>>(r>>>28)+4^r),n=(s>>>22^s)>>>0;return n/=f};t.exports=function(t,e){switch("number"==typeof t&&(t=[t]),e){case 2:return p(t,!0);case 1:return p(t);default:return c(t)}}},84854(t,e,i){var r=i(72958),s=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16],n=Array(4),a=Array(4),o=Array(4),h=Array(4),l=Array(4),u=Array(4),d=function(t,e,i){var r,s,h,l,u=e.noiseMode||0,d=void 0===e.noiseSmoothing?1:e.noiseSmoothing,p=Math.max(1,Math.min(t.length,4)),g=e.noiseCells||[32,32,32,32].slice(0,p);for(r=0;r1&&(o[1]=Math.floor(l/3)%3-1,p>2&&(o[2]=Math.floor(l/9)%3-1,p>3&&(o[3]=Math.floor(l/27)%3-1))),s=c(p,n,o,e,i),h=f(p,o,a,s),u){case 0:h0||e[1]>0)for(j[0]=U.x,j[1]=z.x,j[2]=Y.x,q[0]=U.y,q[1]=z.y,q[2]=Y.y,e[0]>0&&(j[0]=(U.x%e[0]+e[0])%e[0],j[1]=(z.x%e[0]+e[0])%e[0],j[2]=(Y.x%e[0]+e[0])%e[0]),e[1]>0&&(q[0]=(U.y%e[1]+e[1])%e[1],q[1]=(z.y%e[1]+e[1])%e[1],q[2]=(Y.y%e[1]+e[1])%e[1]),r=0;r<3;r++)V[r]=Math.floor(j[r]+.5*q[r]+.5),H[r]=Math.floor(q[r]+.5);else V[0]=n.x,V[1]=B.x,V[2]=k.x,H[0]=n.y,H[1]=B.y,H[2]=k.y;for(V[0]+=a[0],V[1]+=a[0],V[2]+=a[0],H[0]+=a[1],H[1]+=a[1],H[2]+=a[1],r=0;r<3;r++)K[r]=V[r]%289,K[r]<0&&(K[r]+=289);for(r=0;r<3;r++)K[r]=((51*K[r]+2)*K[r]+H[r])%289;for(r=0;r<3;r++)K[r]=(34*K[r]+10)*K[r]%289;for(r=0;r<3;r++)Z[r]=.07482*K[r]+i,Q[r]=Math.cos(Z[r]),J[r]=Math.sin(Z[r]);for($.x=Q[0],$.y=J[0],tt.x=Q[1],tt.y=J[1],et.x=Q[2],et.y=J[2],it[0]=.8-I(X,X),it[1]=.8-I(W,W),it[2]=.8-I(G,G),r=0;r<3;r++)it[r]=Math.max(it[r],0),rt[r]=it[r]*it[r],st[r]=rt[r]*rt[r];return nt[0]=I($,X),nt[1]=I(tt,W),nt[2]=I(et,G),10.9*(st[0]*nt[0]+st[1]*nt[1]+st[2]*nt[2])},B=[0,0,0],k=[0,0,0],U=[0,0,0],z=[0,0,0],Y=[0,0,0],X=[0,0,0],W=[0,0,0],G=[0,0,0],V=[0,0,0],H=[0,0,0],j=[0,0,0],q=[0,0,0],K=[0,0,0],Z=[0,0,0],Q=[0,0,0],J=[0,0,0],$=[0,0,0],tt=[0,0,0],et=[0,0,0],it=[0,0,0],rt=[0,0,0,0],st=[0,0,0,0],nt=[0,0,0,0],at=[0,0,0,0],ot=[0,0,0,0],ht=[0,0,0,0],lt=[0,0,0,0],ut=[0,0,0,0],dt=[0,0,0,0],ct=[0,0,0,0],ft=[0,0,0,0],pt=[0,0,0,0],gt=[0,0,0,0],mt=[0,0,0,0],vt=[0,0,0,0],yt=[0,0,0,0],xt=[0,0,0,0],Tt=[0,0,0,0],wt=[0,0,0,0],bt=[0,0,0,0],St=[0,0,0,0],Ct=[0,0,0,0],Et=[0,0,0,0],At=[0,0,0,0],_t=[0,0,0,0],Mt=[0,0,0,0],Rt=[0,0,0,0],Pt=[0,0,0,0],Ot=function(t,e){for(var i=0;i<4;i++){var r=t[i]%289;r<0&&(r+=289),e[i]=(34*r+10)*r%289}},Lt=function(t,e,i){var r=B,s=k,n=U,o=z,h=Y,l=X,u=W,d=G,c=V,f=H,p=j,g=q,m=K,v=Z,y=Q,x=J,T=$,w=tt,b=et,S=it,C=rt,E=st,A=nt,_=at,M=ot,R=ht,P=lt,O=ut,L=dt,D=ct,F=ft,I=pt,N=gt,Lt=mt,Dt=vt,Ft=yt,It=xt,Nt=Tt,Bt=wt,kt=bt,Ut=St,zt=Ct,Yt=Et,Xt=At,Wt=_t,Gt=Mt,Vt=Rt,Ht=Pt;r[0]=0*t[0]+1*t[1]+1*t[2],r[1]=1*t[0]+0*t[1]+1*t[2],r[2]=1*t[0]+1*t[1]+0*t[2];for(var jt=0;jt<3;jt++)s[jt]=Math.floor(r[jt]),n[jt]=r[jt]-s[jt];for(o[0]=n[0]>n[1]?0:1,o[1]=n[1]>n[2]?0:1,o[2]=n[0]>n[2]?0:1,h[0]=1-o[0],h[1]=1-o[1],h[2]=1-o[2],l[0]=h[2],l[1]=o[0],l[2]=o[1],u[0]=h[0],u[1]=h[1],u[2]=o[2],jt=0;jt<3;jt++)d[jt]=Math.min(l[jt],u[jt]),c[jt]=Math.max(l[jt],u[jt]);for(jt=0;jt<3;jt++)f[jt]=s[jt]+d[jt],p[jt]=s[jt]+c[jt],g[jt]=s[jt]+1;var qt=s[0],Kt=s[1],Zt=s[2],Qt=f[0],Jt=f[1],$t=f[2],te=p[0],ee=p[1],ie=p[2],re=g[0],se=g[1],ne=g[2];for(m[0]=-.5*qt+.5*Kt+.5*Zt,m[1]=.5*qt-.5*Kt+.5*Zt,m[2]=.5*qt+.5*Kt-.5*Zt,v[0]=-.5*Qt+.5*Jt+.5*$t,v[1]=.5*Qt-.5*Jt+.5*$t,v[2]=.5*Qt+.5*Jt-.5*$t,y[0]=-.5*te+.5*ee+.5*ie,y[1]=.5*te-.5*ee+.5*ie,y[2]=.5*te+.5*ee-.5*ie,x[0]=-.5*re+.5*se+.5*ne,x[1]=.5*re-.5*se+.5*ne,x[2]=.5*re+.5*se-.5*ne,jt=0;jt<3;jt++)T[jt]=t[jt]-m[jt],w[jt]=t[jt]-v[jt],b[jt]=t[jt]-y[jt],S[jt]=t[jt]-x[jt];if(e[0]>0||e[1]>0||e[2]>0){if(C[0]=m[0],C[1]=v[0],C[2]=y[0],C[3]=x[0],E[0]=m[1],E[1]=v[1],E[2]=y[1],E[3]=x[1],A[0]=m[2],A[1]=v[2],A[2]=y[2],A[3]=x[2],e[0]>0)for(jt=0;jt<4;jt++)C[jt]=(C[jt]%e[0]+e[0])%e[0];if(e[1]>0)for(jt=0;jt<4;jt++)E[jt]=(E[jt]%e[1]+e[1])%e[1];if(e[2]>0)for(jt=0;jt<4;jt++)A[jt]=(A[jt]%e[2]+e[2])%e[2];var ae=C[0],oe=E[0],he=A[0],le=C[1],ue=E[1],de=A[1],ce=C[2],fe=E[2],pe=A[2],ge=C[3],me=E[3],ve=A[3];s[0]=Math.floor(0*ae+1*oe+1*he+.5),s[1]=Math.floor(1*ae+0*oe+1*he+.5),s[2]=Math.floor(1*ae+1*oe+0*he+.5),f[0]=Math.floor(0*le+1*ue+1*de+.5),f[1]=Math.floor(1*le+0*ue+1*de+.5),f[2]=Math.floor(1*le+1*ue+0*de+.5),p[0]=Math.floor(0*ce+1*fe+1*pe+.5),p[1]=Math.floor(1*ce+0*fe+1*pe+.5),p[2]=Math.floor(1*ce+1*fe+0*pe+.5),g[0]=Math.floor(0*ge+1*me+1*ve+.5),g[1]=Math.floor(1*ge+0*me+1*ve+.5),g[2]=Math.floor(1*ge+1*me+0*ve+.5)}s[0]+=a[0],s[1]+=a[1],s[2]+=a[2],f[0]+=a[0],f[1]+=a[1],f[2]+=a[2],p[0]+=a[0],p[1]+=a[1],p[2]+=a[2],g[0]+=a[0],g[1]+=a[1],g[2]+=a[2];var ye=rt,xe=st;for(ye[0]=s[2],ye[1]=f[2],ye[2]=p[2],ye[3]=g[2],Ot(ye,xe),xe[0]+=s[1],xe[1]+=f[1],xe[2]+=p[1],xe[3]+=g[1],Ot(xe,ye),ye[0]+=s[0],ye[1]+=f[0],ye[2]+=p[0],ye[3]+=g[0],Ot(ye,_),jt=0;jt<4;jt++)M[jt]=3.883222077*_[jt],R[jt]=.996539792-.006920415*_[jt],P[jt]=.108705628*_[jt],O[jt]=Math.cos(M[jt]),L[jt]=Math.sin(M[jt]),D[jt]=Math.sqrt(Math.max(0,1-R[jt]*R[jt]));if(0!==i)for(jt=0;jt<4;jt++)Lt[jt]=O[jt]*D[jt],Dt[jt]=L[jt]*D[jt],Ft[jt]=R[jt],It[jt]=Math.sin(P[jt]),Nt[jt]=Math.cos(P[jt]),Bt[jt]=L[jt]*It[jt]-O[jt]*Nt[jt],kt[jt]=(1-R[jt])*(Bt[jt]*L[jt])+R[jt]*It[jt],Ut[jt]=(1-R[jt])*(-Bt[jt]*O[jt])+R[jt]*Nt[jt],zt[jt]=-(Dt[jt]*Nt[jt]+Lt[jt]*It[jt]),Yt[jt]=Math.sin(i),Xt[jt]=Math.cos(i),F[jt]=Xt[jt]*Lt[jt]+Yt[jt]*kt[jt],I[jt]=Xt[jt]*Dt[jt]+Yt[jt]*Ut[jt],N[jt]=Xt[jt]*Ft[jt]+Yt[jt]*zt[jt];else for(jt=0;jt<4;jt++)F[jt]=O[jt]*D[jt],I[jt]=L[jt]*D[jt],N[jt]=R[jt];for(jt=0;jt<4;jt++){var Te=0===jt?T[0]:1===jt?w[0]:2===jt?b[0]:S[0],we=0===jt?T[1]:1===jt?w[1]:2===jt?b[1]:S[1],be=0===jt?T[2]:1===jt?w[2]:2===jt?b[2]:S[2],Se=Te*Te+we*we+be*be;Wt[jt]=.5-Se,Wt[jt]<0&&(Wt[jt]=0),Gt[jt]=Wt[jt]*Wt[jt],Vt[jt]=Gt[jt]*Wt[jt]}for(jt=0;jt<4;jt++){var Ce=F[jt],Ee=I[jt],Ae=N[jt],_e=0===jt?T[0]:1===jt?w[0]:2===jt?b[0]:S[0],Me=0===jt?T[1]:1===jt?w[1]:2===jt?b[1]:S[1],Re=0===jt?T[2]:1===jt?w[2]:2===jt?b[2]:S[2];Ht[jt]=Ce*_e+Ee*Me+Ae*Re}var Pe=0;for(jt=0;jt<4;jt++)Pe+=Vt[jt]*Ht[jt];return 39.5*Pe};t.exports=function(t,r){"number"==typeof t&&(t=[t]),r||(r={});for(var h=Math.min(3,t.length);h<2;)t.push(0),h++;var l=r.noiseIterations||1,u=r.noiseWarpIterations||1,d=r.noiseDetailPower||2,c=r.noiseFlowPower||2,f=r.noiseContributionPower||2,p=r.noiseWarpDetailPower||2,g=r.noiseWarpFlowPower||2,m=r.noiseWarpContributionPower||2,v=r.noiseCells||[32,32,32],y=r.noiseOffset||[0,0,0],x=r.noiseWarpAmount||0;if(r.noiseSeed)for(var T=[1,2,3],w=0;w0&&u>0&&h>=2)if(2===h){var b=o(u,2,e,r,p,g,m);i[0]=e[0]+s[0],i[1]=e[1]+s[1];var S=o(u,2,i,r,p,g,m);e[0]+=b*x,e[1]+=S*x}else if(3===h){var C=o(u,3,e,r,p,g,m);i[0]=e[0]+s[0],i[1]=e[1]+s[1],i[2]=e[2]+s[2];var E=o(u,3,i,r,p,g,m);i[0]=e[0]+n[0],i[1]=e[1]+n[1],i[2]=e[2]+n[2];var A=o(u,3,i,r,p,g,m);e[0]+=C*x,e[1]+=E*x,e[2]+=A*x}return o(l,h,e,r,d,c,f)}},78702(t){t.exports=function(t){return t==parseFloat(t)?!(t%2):void 0}},94883(t){t.exports=function(t){return t===parseFloat(t)?!(t%2):void 0}},28915(t){t.exports=function(t,e,i){return(e-t)*i+t}},94908(t){t.exports=function(t,e,i){return void 0===i&&(i=0),t.clone().lerp(e,i)}},94434(t,e,i){var r=new(i(83419))({initialize:function(t){this.val=new Float32Array(9),t?this.copy(t):this.identity()},clone:function(){return new r(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this},fromMat4:function(t){var e=t.val,i=this.val;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[4],i[4]=e[5],i[5]=e[6],i[6]=e[8],i[7]=e[9],i[8]=e[10],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],r=t[5];return t[1]=t[3],t[2]=t[6],t[3]=e,t[5]=t[7],t[6]=i,t[7]=r,this},invert:function(){var t=this.val,e=t[0],i=t[1],r=t[2],s=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=l*n-a*h,d=-l*s+a*o,c=h*s-n*o,f=e*u+i*d+r*c;return f?(f=1/f,t[0]=u*f,t[1]=(-l*i+r*h)*f,t[2]=(a*i-r*n)*f,t[3]=d*f,t[4]=(l*e-r*o)*f,t[5]=(-a*e+r*s)*f,t[6]=c*f,t[7]=(-h*e+i*o)*f,t[8]=(n*e-i*s)*f,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],r=t[2],s=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return t[0]=n*l-a*h,t[1]=r*h-i*l,t[2]=i*a-r*n,t[3]=a*o-s*l,t[4]=e*l-r*o,t[5]=r*s-e*a,t[6]=s*h-n*o,t[7]=i*o-e*h,t[8]=e*n-i*s,this},determinant:function(){var t=this.val,e=t[0],i=t[1],r=t[2],s=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return e*(l*n-a*h)+i*(-l*s+a*o)+r*(h*s-n*o)},multiply:function(t){var e=this.val,i=e[0],r=e[1],s=e[2],n=e[3],a=e[4],o=e[5],h=e[6],l=e[7],u=e[8],d=t.val,c=d[0],f=d[1],p=d[2],g=d[3],m=d[4],v=d[5],y=d[6],x=d[7],T=d[8];return e[0]=c*i+f*n+p*h,e[1]=c*r+f*a+p*l,e[2]=c*s+f*o+p*u,e[3]=g*i+m*n+v*h,e[4]=g*r+m*a+v*l,e[5]=g*s+m*o+v*u,e[6]=y*i+x*n+T*h,e[7]=y*r+x*a+T*l,e[8]=y*s+x*o+T*u,this},translate:function(t){var e=this.val,i=t.x,r=t.y;return e[6]=i*e[0]+r*e[3]+e[6],e[7]=i*e[1]+r*e[4]+e[7],e[8]=i*e[2]+r*e[5]+e[8],this},rotate:function(t){var e=this.val,i=e[0],r=e[1],s=e[2],n=e[3],a=e[4],o=e[5],h=Math.sin(t),l=Math.cos(t);return e[0]=l*i+h*n,e[1]=l*r+h*a,e[2]=l*s+h*o,e[3]=l*n-h*i,e[4]=l*a-h*r,e[5]=l*o-h*s,this},scale:function(t){var e=this.val,i=t.x,r=t.y;return e[0]=i*e[0],e[1]=i*e[1],e[2]=i*e[2],e[3]=r*e[3],e[4]=r*e[4],e[5]=r*e[5],this},fromQuat:function(t){var e=t.x,i=t.y,r=t.z,s=t.w,n=e+e,a=i+i,o=r+r,h=e*n,l=e*a,u=e*o,d=i*a,c=i*o,f=r*o,p=s*n,g=s*a,m=s*o,v=this.val;return v[0]=1-(d+f),v[3]=l+m,v[6]=u-g,v[1]=l-m,v[4]=1-(h+f),v[7]=c+p,v[2]=u+g,v[5]=c-p,v[8]=1-(h+d),this},normalFromMat4:function(t){var e=t.val,i=this.val,r=e[0],s=e[1],n=e[2],a=e[3],o=e[4],h=e[5],l=e[6],u=e[7],d=e[8],c=e[9],f=e[10],p=e[11],g=e[12],m=e[13],v=e[14],y=e[15],x=r*h-s*o,T=r*l-n*o,w=r*u-a*o,b=s*l-n*h,S=s*u-a*h,C=n*u-a*l,E=d*m-c*g,A=d*v-f*g,_=d*y-p*g,M=c*v-f*m,R=c*y-p*m,P=f*y-p*v,O=x*P-T*R+w*M+b*_-S*A+C*E;return O?(O=1/O,i[0]=(h*P-l*R+u*M)*O,i[1]=(l*_-o*P-u*A)*O,i[2]=(o*R-h*_+u*E)*O,i[3]=(n*R-s*P-a*M)*O,i[4]=(r*P-n*_+a*A)*O,i[5]=(s*_-r*R-a*E)*O,i[6]=(m*C-v*S+y*b)*O,i[7]=(v*w-g*C-y*T)*O,i[8]=(g*S-m*w+y*x)*O,this):null}});t.exports=r},37867(t,e,i){var r=i(83419),s=i(25836),n=1e-6,a=new r({initialize:function(t){this.val=new Float32Array(16),t?this.copy(t):this.identity()},clone:function(){return new a(this)},set:function(t){return this.copy(t)},setValues:function(t,e,i,r,s,n,a,o,h,l,u,d,c,f,p,g){var m=this.val;return m[0]=t,m[1]=e,m[2]=i,m[3]=r,m[4]=s,m[5]=n,m[6]=a,m[7]=o,m[8]=h,m[9]=l,m[10]=u,m[11]=d,m[12]=c,m[13]=f,m[14]=p,m[15]=g,this},copy:function(t){var e=t.val;return this.setValues(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},fromArray:function(t){return this.setValues(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},zero:function(){return this.setValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)},transform:function(t,e,i){var r=o.fromQuat(i).val,s=e.x,n=e.y,a=e.z;return this.setValues(r[0]*s,r[1]*s,r[2]*s,0,r[4]*n,r[5]*n,r[6]*n,0,r[8]*a,r[9]*a,r[10]*a,0,t.x,t.y,t.z,1)},xyz:function(t,e,i){this.identity();var r=this.val;return r[12]=t,r[13]=e,r[14]=i,this},scaling:function(t,e,i){this.zero();var r=this.val;return r[0]=t,r[5]=e,r[10]=i,r[15]=1,this},identity:function(){return this.setValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)},transpose:function(){var t=this.val,e=t[1],i=t[2],r=t[3],s=t[6],n=t[7],a=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=e,t[6]=t[9],t[7]=t[13],t[8]=i,t[9]=s,t[11]=t[14],t[12]=r,t[13]=n,t[14]=a,this},getInverse:function(t){return this.copy(t),this.invert()},invert:function(){var t=this.val,e=t[0],i=t[1],r=t[2],s=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],d=t[10],c=t[11],f=t[12],p=t[13],g=t[14],m=t[15],v=e*a-i*n,y=e*o-r*n,x=e*h-s*n,T=i*o-r*a,w=i*h-s*a,b=r*h-s*o,S=l*p-u*f,C=l*g-d*f,E=l*m-c*f,A=u*g-d*p,_=u*m-c*p,M=d*m-c*g,R=v*M-y*_+x*A+T*E-w*C+b*S;return R?(R=1/R,this.setValues((a*M-o*_+h*A)*R,(r*_-i*M-s*A)*R,(p*b-g*w+m*T)*R,(d*w-u*b-c*T)*R,(o*E-n*M-h*C)*R,(e*M-r*E+s*C)*R,(g*x-f*b-m*y)*R,(l*b-d*x+c*y)*R,(n*_-a*E+h*S)*R,(i*E-e*_-s*S)*R,(f*w-p*x+m*v)*R,(u*x-l*w-c*v)*R,(a*C-n*A-o*S)*R,(e*A-i*C+r*S)*R,(p*y-f*T-g*v)*R,(l*T-u*y+d*v)*R)):this},adjoint:function(){var t=this.val,e=t[0],i=t[1],r=t[2],s=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],d=t[10],c=t[11],f=t[12],p=t[13],g=t[14],m=t[15];return this.setValues(a*(d*m-c*g)-u*(o*m-h*g)+p*(o*c-h*d),-(i*(d*m-c*g)-u*(r*m-s*g)+p*(r*c-s*d)),i*(o*m-h*g)-a*(r*m-s*g)+p*(r*h-s*o),-(i*(o*c-h*d)-a*(r*c-s*d)+u*(r*h-s*o)),-(n*(d*m-c*g)-l*(o*m-h*g)+f*(o*c-h*d)),e*(d*m-c*g)-l*(r*m-s*g)+f*(r*c-s*d),-(e*(o*m-h*g)-n*(r*m-s*g)+f*(r*h-s*o)),e*(o*c-h*d)-n*(r*c-s*d)+l*(r*h-s*o),n*(u*m-c*p)-l*(a*m-h*p)+f*(a*c-h*u),-(e*(u*m-c*p)-l*(i*m-s*p)+f*(i*c-s*u)),e*(a*m-h*p)-n*(i*m-s*p)+f*(i*h-s*a),-(e*(a*c-h*u)-n*(i*c-s*u)+l*(i*h-s*a)),-(n*(u*g-d*p)-l*(a*g-o*p)+f*(a*d-o*u)),e*(u*g-d*p)-l*(i*g-r*p)+f*(i*d-r*u),-(e*(a*g-o*p)-n*(i*g-r*p)+f*(i*o-r*a)),e*(a*d-o*u)-n*(i*d-r*u)+l*(i*o-r*a))},determinant:function(){var t=this.val,e=t[0],i=t[1],r=t[2],s=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],d=t[10],c=t[11],f=t[12],p=t[13],g=t[14],m=t[15];return(e*a-i*n)*(d*m-c*g)-(e*o-r*n)*(u*m-c*p)+(e*h-s*n)*(u*g-d*p)+(i*o-r*a)*(l*m-c*f)-(i*h-s*a)*(l*g-d*f)+(r*h-s*o)*(l*p-u*f)},multiply:function(t){var e=this.val,i=e[0],r=e[1],s=e[2],n=e[3],a=e[4],o=e[5],h=e[6],l=e[7],u=e[8],d=e[9],c=e[10],f=e[11],p=e[12],g=e[13],m=e[14],v=e[15],y=t.val,x=y[0],T=y[1],w=y[2],b=y[3];return e[0]=x*i+T*a+w*u+b*p,e[1]=x*r+T*o+w*d+b*g,e[2]=x*s+T*h+w*c+b*m,e[3]=x*n+T*l+w*f+b*v,x=y[4],T=y[5],w=y[6],b=y[7],e[4]=x*i+T*a+w*u+b*p,e[5]=x*r+T*o+w*d+b*g,e[6]=x*s+T*h+w*c+b*m,e[7]=x*n+T*l+w*f+b*v,x=y[8],T=y[9],w=y[10],b=y[11],e[8]=x*i+T*a+w*u+b*p,e[9]=x*r+T*o+w*d+b*g,e[10]=x*s+T*h+w*c+b*m,e[11]=x*n+T*l+w*f+b*v,x=y[12],T=y[13],w=y[14],b=y[15],e[12]=x*i+T*a+w*u+b*p,e[13]=x*r+T*o+w*d+b*g,e[14]=x*s+T*h+w*c+b*m,e[15]=x*n+T*l+w*f+b*v,this},multiplyLocal:function(t){var e=this.val,i=t.val;return this.setValues(e[0]*i[0]+e[1]*i[4]+e[2]*i[8]+e[3]*i[12],e[0]*i[1]+e[1]*i[5]+e[2]*i[9]+e[3]*i[13],e[0]*i[2]+e[1]*i[6]+e[2]*i[10]+e[3]*i[14],e[0]*i[3]+e[1]*i[7]+e[2]*i[11]+e[3]*i[15],e[4]*i[0]+e[5]*i[4]+e[6]*i[8]+e[7]*i[12],e[4]*i[1]+e[5]*i[5]+e[6]*i[9]+e[7]*i[13],e[4]*i[2]+e[5]*i[6]+e[6]*i[10]+e[7]*i[14],e[4]*i[3]+e[5]*i[7]+e[6]*i[11]+e[7]*i[15],e[8]*i[0]+e[9]*i[4]+e[10]*i[8]+e[11]*i[12],e[8]*i[1]+e[9]*i[5]+e[10]*i[9]+e[11]*i[13],e[8]*i[2]+e[9]*i[6]+e[10]*i[10]+e[11]*i[14],e[8]*i[3]+e[9]*i[7]+e[10]*i[11]+e[11]*i[15],e[12]*i[0]+e[13]*i[4]+e[14]*i[8]+e[15]*i[12],e[12]*i[1]+e[13]*i[5]+e[14]*i[9]+e[15]*i[13],e[12]*i[2]+e[13]*i[6]+e[14]*i[10]+e[15]*i[14],e[12]*i[3]+e[13]*i[7]+e[14]*i[11]+e[15]*i[15])},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var i=t.val,r=e.val,s=i[0],n=i[4],a=i[8],o=i[12],h=i[1],l=i[5],u=i[9],d=i[13],c=i[2],f=i[6],p=i[10],g=i[14],m=i[3],v=i[7],y=i[11],x=i[15],T=r[0],w=r[4],b=r[8],S=r[12],C=r[1],E=r[5],A=r[9],_=r[13],M=r[2],R=r[6],P=r[10],O=r[14],L=r[3],D=r[7],F=r[11],I=r[15];return this.setValues(s*T+n*C+a*M+o*L,h*T+l*C+u*M+d*L,c*T+f*C+p*M+g*L,m*T+v*C+y*M+x*L,s*w+n*E+a*R+o*D,h*w+l*E+u*R+d*D,c*w+f*E+p*R+g*D,m*w+v*E+y*R+x*D,s*b+n*A+a*P+o*F,h*b+l*A+u*P+d*F,c*b+f*A+p*P+g*F,m*b+v*A+y*P+x*F,s*S+n*_+a*O+o*I,h*S+l*_+u*O+d*I,c*S+f*_+p*O+g*I,m*S+v*_+y*O+x*I)},translate:function(t){return this.translateXYZ(t.x,t.y,t.z)},translateXYZ:function(t,e,i){var r=this.val;return r[12]=r[0]*t+r[4]*e+r[8]*i+r[12],r[13]=r[1]*t+r[5]*e+r[9]*i+r[13],r[14]=r[2]*t+r[6]*e+r[10]*i+r[14],r[15]=r[3]*t+r[7]*e+r[11]*i+r[15],this},scale:function(t){return this.scaleXYZ(t.x,t.y,t.z)},scaleXYZ:function(t,e,i){var r=this.val;return r[0]=r[0]*t,r[1]=r[1]*t,r[2]=r[2]*t,r[3]=r[3]*t,r[4]=r[4]*e,r[5]=r[5]*e,r[6]=r[6]*e,r[7]=r[7]*e,r[8]=r[8]*i,r[9]=r[9]*i,r[10]=r[10]*i,r[11]=r[11]*i,this},makeRotationAxis:function(t,e){var i=Math.cos(e),r=Math.sin(e),s=1-i,n=t.x,a=t.y,o=t.z,h=s*n,l=s*a;return this.setValues(h*n+i,h*a-r*o,h*o+r*a,0,h*a+r*o,l*a+i,l*o-r*n,0,h*o-r*a,l*o+r*n,s*o*o+i,0,0,0,0,1)},rotate:function(t,e){var i=this.val,r=e.x,s=e.y,a=e.z,o=Math.sqrt(r*r+s*s+a*a);if(Math.abs(o)1?void 0!==r?(s=(r-t)/(r-i))<0&&(s=0):s=1:s<0&&(s=0),s}},15746(t,e,i){var r=i(83419),s=i(94434),n=i(29747),a=i(25836),o=1e-6,h=new Int8Array([1,2,0]),l=new Float32Array([0,0,0]),u=new a(1,0,0),d=new a(0,1,0),c=new a,f=new s,p=new r({initialize:function(t,e,i,r){this.onChangeCallback=n,this.set(t,e,i,r)},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},w:{get:function(){return this._w},set:function(t){this._w=t,this.onChangeCallback(this)}},copy:function(t){return this.set(t)},set:function(t,e,i,r,s){return void 0===s&&(s=!0),"object"==typeof t?(this._x=t.x||0,this._y=t.y||0,this._z=t.z||0,this._w=t.w||0):(this._x=t||0,this._y=e||0,this._z=i||0,this._w=r||0),s&&this.onChangeCallback(this),this},add:function(t){return this._x+=t.x,this._y+=t.y,this._z+=t.z,this._w+=t.w,this.onChangeCallback(this),this},subtract:function(t){return this._x-=t.x,this._y-=t.y,this._z-=t.z,this._w-=t.w,this.onChangeCallback(this),this},scale:function(t){return this._x*=t,this._y*=t,this._z*=t,this._w*=t,this.onChangeCallback(this),this},length:function(){var t=this.x,e=this.y,i=this.z,r=this.w;return Math.sqrt(t*t+e*e+i*i+r*r)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,r=this.w;return t*t+e*e+i*i+r*r},normalize:function(){var t=this.x,e=this.y,i=this.z,r=this.w,s=t*t+e*e+i*i+r*r;return s>0&&(s=1/Math.sqrt(s),this._x=t*s,this._y=e*s,this._z=i*s,this._w=r*s),this.onChangeCallback(this),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,r=this.y,s=this.z,n=this.w;return this.set(i+e*(t.x-i),r+e*(t.y-r),s+e*(t.z-s),n+e*(t.w-n))},rotationTo:function(t,e){var i=t.x*e.x+t.y*e.y+t.z*e.z;return i<-.999999?(c.copy(u).cross(t).length().999999?this.set(0,0,0,1):(c.copy(t).cross(e),this._x=c.x,this._y=c.y,this._z=c.z,this._w=1+i,this.normalize())},setAxes:function(t,e,i){var r=f.val;return r[0]=e.x,r[3]=e.y,r[6]=e.z,r[1]=i.x,r[4]=i.y,r[7]=i.z,r[2]=-t.x,r[5]=-t.y,r[8]=-t.z,this.fromMat3(f).normalize()},identity:function(){return this.set(0,0,0,1)},setAxisAngle:function(t,e){e*=.5;var i=Math.sin(e);return this.set(i*t.x,i*t.y,i*t.z,Math.cos(e))},multiply:function(t){var e=this.x,i=this.y,r=this.z,s=this.w,n=t.x,a=t.y,o=t.z,h=t.w;return this.set(e*h+s*n+i*o-r*a,i*h+s*a+r*n-e*o,r*h+s*o+e*a-i*n,s*h-e*n-i*a-r*o)},slerp:function(t,e){var i=this.x,r=this.y,s=this.z,n=this.w,a=t.x,h=t.y,l=t.z,u=t.w,d=i*a+r*h+s*l+n*u;d<0&&(d=-d,a=-a,h=-h,l=-l,u=-u);var c=1-e,f=e;if(1-d>o){var p=Math.acos(d),g=Math.sin(p);c=Math.sin((1-e)*p)/g,f=Math.sin(e*p)/g}return this.set(c*i+f*a,c*r+f*h,c*s+f*l,c*n+f*u)},invert:function(){var t=this.x,e=this.y,i=this.z,r=this.w,s=t*t+e*e+i*i+r*r,n=s?1/s:0;return this.set(-t*n,-e*n,-i*n,r*n)},conjugate:function(){return this._x=-this.x,this._y=-this.y,this._z=-this.z,this.onChangeCallback(this),this},rotateX:function(t){t*=.5;var e=this.x,i=this.y,r=this.z,s=this.w,n=Math.sin(t),a=Math.cos(t);return this.set(e*a+s*n,i*a+r*n,r*a-i*n,s*a-e*n)},rotateY:function(t){t*=.5;var e=this.x,i=this.y,r=this.z,s=this.w,n=Math.sin(t),a=Math.cos(t);return this.set(e*a-r*n,i*a+s*n,r*a+e*n,s*a-i*n)},rotateZ:function(t){t*=.5;var e=this.x,i=this.y,r=this.z,s=this.w,n=Math.sin(t),a=Math.cos(t);return this.set(e*a+i*n,i*a-e*n,r*a+s*n,s*a-r*n)},calculateW:function(){var t=this.x,e=this.y,i=this.z;return this.w=-Math.sqrt(1-t*t-e*e-i*i),this},setFromEuler:function(t,e){var i=t.x/2,r=t.y/2,s=t.z/2,n=Math.cos(i),a=Math.cos(r),o=Math.cos(s),h=Math.sin(i),l=Math.sin(r),u=Math.sin(s);switch(t.order){case"XYZ":this.set(h*a*o+n*l*u,n*l*o-h*a*u,n*a*u+h*l*o,n*a*o-h*l*u,e);break;case"YXZ":this.set(h*a*o+n*l*u,n*l*o-h*a*u,n*a*u-h*l*o,n*a*o+h*l*u,e);break;case"ZXY":this.set(h*a*o-n*l*u,n*l*o+h*a*u,n*a*u+h*l*o,n*a*o-h*l*u,e);break;case"ZYX":this.set(h*a*o-n*l*u,n*l*o+h*a*u,n*a*u-h*l*o,n*a*o+h*l*u,e);break;case"YZX":this.set(h*a*o+n*l*u,n*l*o+h*a*u,n*a*u-h*l*o,n*a*o-h*l*u,e);break;case"XZY":this.set(h*a*o-n*l*u,n*l*o-h*a*u,n*a*u+h*l*o,n*a*o+h*l*u,e)}return this},setFromRotationMatrix:function(t){var e,i=t.val,r=i[0],s=i[4],n=i[8],a=i[1],o=i[5],h=i[9],l=i[2],u=i[6],d=i[10],c=r+o+d;return c>0?(e=.5/Math.sqrt(c+1),this.set((u-h)*e,(n-l)*e,(a-s)*e,.25/e)):r>o&&r>d?(e=2*Math.sqrt(1+r-o-d),this.set(.25*e,(s+a)/e,(n+l)/e,(u-h)/e)):o>d?(e=2*Math.sqrt(1+o-r-d),this.set((s+a)/e,.25*e,(h+u)/e,(n-l)/e)):(e=2*Math.sqrt(1+d-r-o),this.set((n+l)/e,(h+u)/e,.25*e,(a-s)/e)),this},fromMat3:function(t){var e,i=t.val,r=i[0]+i[4]+i[8];if(r>0)e=Math.sqrt(r+1),this.w=.5*e,e=.5/e,this._x=(i[7]-i[5])*e,this._y=(i[2]-i[6])*e,this._z=(i[3]-i[1])*e;else{var s=0;i[4]>i[0]&&(s=1),i[8]>i[3*s+s]&&(s=2);var n=h[s],a=h[n];e=Math.sqrt(i[3*s+s]-i[3*n+n]-i[3*a+a]+1),l[s]=.5*e,e=.5/e,l[n]=(i[3*n+s]+i[3*s+n])*e,l[a]=(i[3*a+s]+i[3*s+a])*e,this._x=l[0],this._y=l[1],this._z=l[2],this._w=(i[3*a+n]-i[3*n+a])*e}return this.onChangeCallback(this),this}});t.exports=p},43396(t,e,i){var r=i(36383);t.exports=function(t){return t*r.RAD_TO_DEG}},74362(t){t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI;return t.x=Math.cos(i)*e,t.y=Math.sin(i)*e,t}},60706(t){t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI,r=2*Math.random()-1,s=Math.sqrt(1-r*r)*e;return t.x=Math.cos(i)*s,t.y=Math.sin(i)*s,t.z=r*e,t}},67421(t){t.exports=function(t,e){return void 0===e&&(e=1),t.x=(2*Math.random()-1)*e,t.y=(2*Math.random()-1)*e,t.z=(2*Math.random()-1)*e,t.w=(2*Math.random()-1)*e,t}},36305(t){t.exports=function(t,e){var i=t.x,r=t.y;return t.x=i*Math.cos(e)-r*Math.sin(e),t.y=i*Math.sin(e)+r*Math.cos(e),t}},11520(t){t.exports=function(t,e,i,r){var s=Math.cos(r),n=Math.sin(r),a=t.x-e,o=t.y-i;return t.x=a*s-o*n+e,t.y=a*n+o*s+i,t}},1163(t){t.exports=function(t,e,i,r,s){var n=r+Math.atan2(t.y-i,t.x-e);return t.x=e+s*Math.cos(n),t.y=i+s*Math.sin(n),t}},70336(t){t.exports=function(t,e,i,r,s){return t.x=e+s*Math.cos(r),t.y=i+s*Math.sin(r),t}},72678(t,e,i){var r=i(25836),s=i(37867),n=i(15746),a=new s,o=new n,h=new r;t.exports=function(t,e,i){return o.setAxisAngle(e,i),a.fromRotationTranslation(o,h.set(0,0,0)),t.transformMat4(a)}},2284(t){t.exports=function(t){return t>0?Math.ceil(t):Math.floor(t)}},41013(t){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var r=Math.pow(i,-e);return Math.round(t*r)/r}},7602(t){t.exports=function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)}},54261(t){t.exports=function(t,e,i){return(t=Math.max(0,Math.min(1,(t-e)/(i-e))))*t*t*(t*(6*t-15)+10)}},44408(t,e,i){var r=i(26099);t.exports=function(t,e,i,s){void 0===s&&(s=new r);var n=0,a=0;return t>0&&t<=e*i&&(n=t>e-1?t-(a=Math.floor(t/e))*e:t),s.set(n,a)}},85955(t,e,i){var r=i(26099);t.exports=function(t,e,i,s,n,a,o,h){void 0===h&&(h=new r);var l=Math.sin(n),u=Math.cos(n),d=u*a,c=l*a,f=-l*o,p=u*o,g=1/(d*p+f*-c);return h.x=p*g*t+-f*g*e+(s*f-i*p)*g,h.y=d*g*e+-c*g*t+(-s*d+i*c)*g,h}},26099(t,e,i){t.exports=i(70038).default},25836(t,e,i){var r=new(i(83419))({initialize:function(t,e,i){this.x=0,this.y=0,this.z=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0)},up:function(){return this.x=0,this.y=1,this.z=0,this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clone:function(){return new r(this.x,this.y,this.z)},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},crossVectors:function(t,e){var i=t.x,r=t.y,s=t.z,n=e.x,a=e.y,o=e.z;return this.x=r*o-s*a,this.y=s*n-i*o,this.z=i*a-r*n,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this},set:function(t,e,i){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0),this},setFromMatrixPosition:function(t){return this.fromArray(t.val,12)},setFromMatrixColumn:function(t,e){return this.fromArray(t.val,4*e)},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addScale:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t):(this.x=0,this.y=0,this.z=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,r=t.z-this.z||0;return Math.sqrt(e*e+i*i+r*r)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,r=t.z-this.z||0;return e*e+i*i+r*r},length:function(){var t=this.x,e=this.y,i=this.z;return Math.sqrt(t*t+e*e+i*i)},lengthSq:function(){var t=this.x,e=this.y,i=this.z;return t*t+e*e+i*i},normalize:function(){var t=this.x,e=this.y,i=this.z,r=t*t+e*e+i*i;return r>0&&(r=1/Math.sqrt(r),this.x=t*r,this.y=e*r,this.z=i*r),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},cross:function(t){var e=this.x,i=this.y,r=this.z,s=t.x,n=t.y,a=t.z;return this.x=i*a-r*n,this.y=r*s-e*a,this.z=e*n-i*s,this},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,r=this.y,s=this.z;return this.x=i+e*(t.x-i),this.y=r+e*(t.y-r),this.z=s+e*(t.z-s),this},applyMatrix3:function(t){var e=this.x,i=this.y,r=this.z,s=t.val;return this.x=s[0]*e+s[3]*i+s[6]*r,this.y=s[1]*e+s[4]*i+s[7]*r,this.z=s[2]*e+s[5]*i+s[8]*r,this},applyMatrix4:function(t){var e=this.x,i=this.y,r=this.z,s=t.val,n=1/(s[3]*e+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*e+s[4]*i+s[8]*r+s[12])*n,this.y=(s[1]*e+s[5]*i+s[9]*r+s[13])*n,this.z=(s[2]*e+s[6]*i+s[10]*r+s[14])*n,this},transformMat3:function(t){var e=this.x,i=this.y,r=this.z,s=t.val;return this.x=e*s[0]+i*s[3]+r*s[6],this.y=e*s[1]+i*s[4]+r*s[7],this.z=e*s[2]+i*s[5]+r*s[8],this},transformMat4:function(t){var e=this.x,i=this.y,r=this.z,s=t.val;return this.x=s[0]*e+s[4]*i+s[8]*r+s[12],this.y=s[1]*e+s[5]*i+s[9]*r+s[13],this.z=s[2]*e+s[6]*i+s[10]*r+s[14],this},transformCoordinates:function(t){var e=this.x,i=this.y,r=this.z,s=t.val,n=e*s[0]+i*s[4]+r*s[8]+s[12],a=e*s[1]+i*s[5]+r*s[9]+s[13],o=e*s[2]+i*s[6]+r*s[10]+s[14],h=e*s[3]+i*s[7]+r*s[11]+s[15];return this.x=n/h,this.y=a/h,this.z=o/h,this},transformQuat:function(t){var e=this.x,i=this.y,r=this.z,s=t.x,n=t.y,a=t.z,o=t.w,h=o*e+n*r-a*i,l=o*i+a*e-s*r,u=o*r+s*i-n*e,d=-s*e-n*i-a*r;return this.x=h*o+d*-s+l*-a-u*-n,this.y=l*o+d*-n+u*-s-h*-a,this.z=u*o+d*-a+h*-n-l*-s,this},project:function(t){var e=this.x,i=this.y,r=this.z,s=t.val,n=s[0],a=s[1],o=s[2],h=s[3],l=s[4],u=s[5],d=s[6],c=s[7],f=s[8],p=s[9],g=s[10],m=s[11],v=s[12],y=s[13],x=s[14],T=1/(e*h+i*c+r*m+s[15]);return this.x=(e*n+i*l+r*f+v)*T,this.y=(e*a+i*u+r*p+y)*T,this.z=(e*o+i*d+r*g+x)*T,this},projectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unprojectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unproject:function(t,e){var i=t.x,r=t.y,s=t.z,n=t.w,a=this.x-i,o=n-this.y-1-r,h=this.z;return this.x=2*a/s-1,this.y=2*o/n-1,this.z=2*h-1,this.project(e)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});r.ZERO=new r,r.RIGHT=new r(1,0,0),r.LEFT=new r(-1,0,0),r.UP=new r(0,-1,0),r.DOWN=new r(0,1,0),r.FORWARD=new r(0,0,1),r.BACK=new r(0,0,-1),r.ONE=new r(1,1,1),t.exports=r},61369(t,e,i){var r=new(i(83419))({initialize:function(t,e,i,r){this.x=0,this.y=0,this.z=0,this.w=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=r||0)},clone:function(){return new r(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this.w=t.w||0,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},set:function(t,e,i,r){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=r||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this.w+=t.w||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this.w-=t.w||0,this},scale:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},length:function(){var t=this.x,e=this.y,i=this.z,r=this.w;return Math.sqrt(t*t+e*e+i*i+r*r)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,r=this.w;return t*t+e*e+i*i+r*r},normalize:function(){var t=this.x,e=this.y,i=this.z,r=this.w,s=t*t+e*e+i*i+r*r;return s>0&&(s=1/Math.sqrt(s),this.x=t*s,this.y=e*s,this.z=i*s,this.w=r*s),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,r=this.y,s=this.z,n=this.w;return this.x=i+e*(t.x-i),this.y=r+e*(t.y-r),this.z=s+e*(t.z-s),this.w=n+e*(t.w-n),this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this.w*=t.w||1,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this.w/=t.w||1,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,r=t.z-this.z||0,s=t.w-this.w||0;return Math.sqrt(e*e+i*i+r*r+s*s)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,r=t.z-this.z||0,s=t.w-this.w||0;return e*e+i*i+r*r+s*s},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},transformMat4:function(t){var e=this.x,i=this.y,r=this.z,s=this.w,n=t.val;return this.x=n[0]*e+n[4]*i+n[8]*r+n[12]*s,this.y=n[1]*e+n[5]*i+n[9]*r+n[13]*s,this.z=n[2]*e+n[6]*i+n[10]*r+n[14]*s,this.w=n[3]*e+n[7]*i+n[11]*r+n[15]*s,this},transformQuat:function(t){var e=this.x,i=this.y,r=this.z,s=t.x,n=t.y,a=t.z,o=t.w,h=o*e+n*r-a*i,l=o*i+a*e-s*r,u=o*r+s*i-n*e,d=-s*e-n*i-a*r;return this.x=h*o+d*-s+l*-a-u*-n,this.y=l*o+d*-n+u*-s-h*-a,this.z=u*o+d*-a+h*-n-l*-s,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});r.prototype.sub=r.prototype.subtract,r.prototype.mul=r.prototype.multiply,r.prototype.div=r.prototype.divide,r.prototype.dist=r.prototype.distance,r.prototype.distSq=r.prototype.distanceSq,r.prototype.len=r.prototype.length,r.prototype.lenSq=r.prototype.lengthSq,t.exports=r},60417(t){t.exports=function(t,e,i){return Math.abs(t-e)<=i}},15994(t,e,i){t.exports=i(68077).default},31040(t){t.exports=function(t,e,i,r){return Math.atan2(r-e,i-t)}},55495(t){t.exports=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}},128(t){t.exports=function(t,e){return Math.atan2(e.x-t.x,e.y-t.y)}},41273(t){t.exports=function(t,e,i,r){return Math.atan2(i-t,r-e)}},1432(t,e,i){var r=i(36383);t.exports=function(t){return t>Math.PI&&(t-=r.TAU),Math.abs(((t+r.PI_OVER_2)%r.TAU-r.TAU)%r.TAU)}},49127(t,e,i){var r=i(12407);t.exports=function(t,e){return r(e-t)}},52285(t,e,i){var r=i(36383),s=i(12407),n=r.TAU;t.exports=function(t,e){var i=s(e-t);return i>0&&(i-=n),i}},67317(t,e,i){var r=i(86554);t.exports=function(t,e){return r(e-t)}},12407(t){t.exports=function(t){return(t%=2*Math.PI)>=0?t:t+2*Math.PI}},53993(t,e,i){var r=i(99472);t.exports=function(){return r(-Math.PI,Math.PI)}},86564(t,e,i){var r=i(99472);t.exports=function(){return r(-180,180)}},90154(t,e,i){var r=i(12407);t.exports=function(t){return r(t+Math.PI)}},48736(t,e,i){var r=i(36383);t.exports=function(t,e,i){return void 0===i&&(i=.05),t===e||(Math.abs(e-t)<=i||Math.abs(e-t)>=r.TAU-i?t=e:(Math.abs(e-t)>Math.PI&&(et?t+=i:e=1?1:1/e*(1+(e*t|0))}},49752(t,e,i){t.exports=i(72251)},75698(t){t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.ceil(t-e)}},43855(t,e,i){t.exports=i(30010).default},25777(t){t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.floor(t+e)}},5470(t){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t>e-i}},94977(t){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t1?t[i]-(r(s-i,t[i],t[i],t[i-1],t[i-1])-t[i]):r(s-n,t[n?n-1:0],t[n],t[i1?r(t[i],t[i-1],i-s):r(t[n],t[n+1>i?i:n+1],s-n)}},32112(t){t.exports=function(t,e,i,r){return function(t,e){var i=1-t;return i*i*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,i)+function(t,e){return t*t*e}(t,r)}},47235(t,e,i){var r=i(7602);t.exports=function(t,e,i){return e+(i-e)*r(t,0,1)}},50178(t,e,i){var r=i(54261);t.exports=function(t,e,i){return e+(i-e)*r(t,0,1)}},38289(t,e,i){t.exports={Bezier:i(89318),CatmullRom:i(77259),CubicBezier:i(36316),Linear:i(28392),QuadraticBezier:i(32112),SmoothStep:i(47235),SmootherStep:i(50178)}},98439(t){t.exports=function(t){var e=Math.log(t)/.6931471805599453;return 1<0&&!(t&t-1)&&e>0&&!(e&e-1)}},81230(t){t.exports=function(t){return t>0&&!(t&t-1)}},49001(t,e,i){t.exports={GetNext:i(98439),IsSize:i(50030),IsValue:i(81230)}},28453(t,e,i){var r=new(i(83419))({initialize:function(t){void 0===t&&(t=[(Date.now()*Math.random()).toString()]),this.c=1,this.s0=0,this.s1=0,this.s2=0,this.n=0,this.signs=[-1,1],t&&this.init(t)},rnd:function(){var t=2091639*this.s0+2.3283064365386963e-10*this.c;return this.c=0|t,this.s0=this.s1,this.s1=this.s2,this.s2=t-this.c,this.s2},hash:function(t){var e,i=this.n;t=t.toString();for(var r=0;r>>0,i=(e*=i)>>>0,i+=4294967296*(e-=i);return this.n=i,2.3283064365386963e-10*(i>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e0;e--){var i=Math.floor(this.frac()*(e+1)),r=t[i];t[i]=t[e],t[e]=r}return t}});t.exports=r},63448(t){t.exports=function(t,e,i,r){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.ceil(t/e),r?(i+t)/e:i+t)}},56583(t){t.exports=function(t,e,i,r){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.floor(t/e),r?(i+t)/e:i+t)}},77720(t){t.exports=function(t,e,i,r){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.round(t/e),r?(i+t)/e:i+t)}},73697(t,e,i){t.exports={Ceil:i(63448),Floor:i(56583),To:i(77720)}},85454(t,e,i){i(63595);var r=i(8054),s=i(79291),n={Actions:i(61061),Animations:i(60421),BlendModes:i(10312),Cache:i(83388),Cameras:i(26638),Core:i(42857),Class:i(83419),Curves:i(25410),Data:i(44965),Display:i(27460),DOM:i(84902),Events:i(93055),Filters:i(11889),Game:i(50127),GameObjects:i(77856),Geom:i(55738),Input:i(14350),Loader:i(57777),Math:i(75508),Physics:i(44563),Plugins:i(18922),Renderer:i(36909),Scale:i(93364),ScaleModes:i(29795),Scene:i(97482),Scenes:i(62194),Structs:i(41392),Textures:i(27458),Tilemaps:i(62501),Time:i(90291),TintModes:i(84322),Tweens:i(43066),Utils:i(91799)};n.Sound=i(23717),n=s(!1,n,r),t.exports=n,i.g.Phaser=n},71289(t,e,i){var r=i(83419),s=i(92209),n=i(88571),a=new r({Extends:n,Mixins:[s.Acceleration,s.Angular,s.Bounce,s.Collision,s.Debug,s.Drag,s.Enable,s.Friction,s.Gravity,s.Immovable,s.Mass,s.Pushable,s.Size,s.Velocity],initialize:function(t,e,i,r,s){n.call(this,t,e,i,r,s),this.body=null}});t.exports=a},86689(t,e,i){var r=i(83419),s=i(39506),n=i(20339),a=i(89774),o=i(66022),h=i(95540),l=i(46975),u=i(72441),d=i(47956),c=i(37277),f=i(44594),p=i(26099),g=i(82248),m=new r({initialize:function(t){this.scene=t,this.systems=t.sys,this.config=this.getConfig(),this.world,this.add,this._category=1,t.sys.events.once(f.BOOT,this.boot,this),t.sys.events.on(f.START,this.start,this)},boot:function(){this.world=new g(this.scene,this.config),this.add=new o(this.world),this.systems.events.once(f.DESTROY,this.destroy,this)},start:function(){this.world||(this.world=new g(this.scene,this.config),this.add=new o(this.world));var t=this.systems.events;h(this.config,"customUpdate",!1)||t.on(f.UPDATE,this.world.update,this.world),t.on(f.POST_UPDATE,this.world.postUpdate,this.world),t.once(f.SHUTDOWN,this.shutdown,this)},enableUpdate:function(){this.systems.events.on(f.UPDATE,this.world.update,this.world)},disableUpdate:function(){this.systems.events.off(f.UPDATE,this.world.update,this.world)},getConfig:function(){var t=this.systems.game.config.physics,e=this.systems.settings.physics;return l(h(e,"arcade",{}),h(t,"arcade",{}))},nextCategory:function(){return this._category=this._category<<1,this._category},overlap:function(t,e,i,r,s){return void 0===i&&(i=null),void 0===r&&(r=null),void 0===s&&(s=i),this.world.collideObjects(t,e,i,r,s,!0)},collide:function(t,e,i,r,s){return void 0===i&&(i=null),void 0===r&&(r=null),void 0===s&&(s=i),this.world.collideObjects(t,e,i,r,s,!1)},collideTiles:function(t,e,i,r,s){return this.world.collideTiles(t,e,i,r,s)},overlapTiles:function(t,e,i,r,s){return this.world.overlapTiles(t,e,i,r,s)},pause:function(){return this.world.pause()},resume:function(){return this.world.resume()},accelerateTo:function(t,e,i,r,s,n){void 0===r&&(r=60);var a=Math.atan2(i-t.y,e-t.x);return t.body.acceleration.setToPolar(a,r),void 0!==s&&void 0!==n&&t.body.maxVelocity.set(s,n),a},accelerateToObject:function(t,e,i,r,s){return this.accelerateTo(t,e.x,e.y,i,r,s)},closest:function(t,e){e||(e=Array.from(this.world.bodies));for(var i=Number.MAX_VALUE,r=null,s=t.x,n=t.y,o=e.length,h=0;hi&&(r=l,i=d)}}return r},moveTo:function(t,e,i,r,s){void 0===r&&(r=60),void 0===s&&(s=0);var a=Math.atan2(i-t.y,e-t.x);return s>0&&(r=n(t.x,t.y,e,i)/(s/1e3)),t.body.velocity.setToPolar(a,r),a},moveToObject:function(t,e,i,r){return this.moveTo(t,e.x,e.y,i,r)},velocityFromAngle:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new p),i.setToPolar(s(t),e)},velocityFromRotation:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new p),i.setToPolar(t,e)},overlapRect:function(t,e,i,r,s,n){return d(this.world,t,e,i,r,s,n)},overlapCirc:function(t,e,i,r,s){return u(this.world,t,e,i,r,s)},shutdown:function(){if(this.world){var t=this.systems.events;t.off(f.UPDATE,this.world.update,this.world),t.off(f.POST_UPDATE,this.world.postUpdate,this.world),t.off(f.SHUTDOWN,this.shutdown,this),this.add.destroy(),this.world.destroy(),this.add=null,this.world=null,this._category=1}},destroy:function(){this.shutdown(),this.scene.sys.events.off(f.START,this.start,this),this.scene=null,this.systems=null}});c.register("ArcadePhysics",m,"arcadePhysics"),t.exports=m},13759(t,e,i){var r=i(83419),s=i(92209),n=i(68287),a=new r({Extends:n,Mixins:[s.Acceleration,s.Angular,s.Bounce,s.Collision,s.Debug,s.Drag,s.Enable,s.Friction,s.Gravity,s.Immovable,s.Mass,s.Pushable,s.Size,s.Velocity],initialize:function(t,e,i,r,s){n.call(this,t,e,i,r,s),this.body=null}});t.exports=a},37742(t,e,i){var r=i(83419),s=i(78389),n=i(37747),a=i(63012),o=i(43396),h=i(87841),l=i(37303),u=i(95829),d=i(26099),c=new r({Mixins:[s],initialize:function(t,e){var i=64,r=64,s=void 0!==e;s&&e.displayWidth&&(i=e.displayWidth,r=e.displayHeight),s||(e={x:0,y:0,angle:0,rotation:0,scaleX:1,scaleY:1,displayOriginX:0,displayOriginY:0}),this.world=t,this.gameObject=s?e:void 0,this.isBody=!0,this.transform={x:e.x,y:e.y,rotation:e.angle,scaleX:e.scaleX,scaleY:e.scaleY,displayOriginX:e.displayOriginX,displayOriginY:e.displayOriginY},this.debugShowBody=t.defaults.debugShowBody,this.debugShowVelocity=t.defaults.debugShowVelocity,this.debugBodyColor=t.defaults.bodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new d,this.position=new d(e.x-e.scaleX*e.displayOriginX,e.y-e.scaleY*e.displayOriginY),this.prev=this.position.clone(),this.prevFrame=this.position.clone(),this.allowRotation=!0,this.rotation=e.angle,this.preRotation=e.angle,this.width=i,this.height=r,this.sourceWidth=i,this.sourceHeight=r,e.frame&&(this.sourceWidth=e.frame.realWidth,this.sourceHeight=e.frame.realHeight),this.halfWidth=Math.abs(i/2),this.halfHeight=Math.abs(r/2),this.center=new d(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=new d,this.newVelocity=new d,this.deltaMax=new d,this.acceleration=new d,this.allowDrag=!0,this.drag=new d,this.allowGravity=!0,this.gravity=new d,this.bounce=new d,this.worldBounce=null,this.customBoundsRectangle=t.bounds,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.maxVelocity=new d(1e4,1e4),this.maxSpeed=-1,this.friction=new d(1,0),this.useDamping=!1,this.angularVelocity=0,this.angularAcceleration=0,this.angularDrag=0,this.maxAngular=1e3,this.mass=1,this.angle=0,this.speed=0,this.facing=n.FACING_NONE,this.immovable=!1,this.pushable=!0,this.slideFactor=new d(1,1),this.moves=!0,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision=u(!1),this.touching=u(!0),this.wasTouching=u(!0),this.blocked=u(!0),this.syncBounds=!1,this.physicsType=n.DYNAMIC_BODY,this.collisionCategory=1,this.collisionMask=1,this._sx=e.scaleX,this._sy=e.scaleY,this._dx=0,this._dy=0,this._tx=0,this._ty=0,this._bounds=new h,this.directControl=!1,this.autoFrame=this.position.clone()},updateBounds:function(){var t=this.gameObject,e=this.transform;if(t.parentContainer){var i=t.getWorldTransformMatrix(this.world._tempMatrix,this.world._tempMatrix2);e.x=i.tx,e.y=i.ty,e.rotation=o(i.rotation),e.scaleX=i.scaleX,e.scaleY=i.scaleY,e.displayOriginX=t.displayOriginX,e.displayOriginY=t.displayOriginY}else e.x=t.x,e.y=t.y,e.rotation=t.angle,e.scaleX=t.scaleX,e.scaleY=t.scaleY,e.displayOriginX=t.displayOriginX,e.displayOriginY=t.displayOriginY;var r=!1;if(this.syncBounds){var s=t.getBounds(this._bounds);this.width=s.width,this.height=s.height,r=!0}else{var n=Math.abs(e.scaleX),a=Math.abs(e.scaleY);this._sx===n&&this._sy===a||(this.width=this.sourceWidth*n,this.height=this.sourceHeight*a,this._sx=n,this._sy=a,r=!0)}r&&(this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter())},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},updateFromGameObject:function(){this.updateBounds();var t=this.transform;this.position.x=t.x+t.scaleX*(this.offset.x-t.displayOriginX),this.position.y=t.y+t.scaleY*(this.offset.y-t.displayOriginY),this.updateCenter()},resetFlags:function(t){void 0===t&&(t=!1);var e=this.wasTouching,i=this.touching,r=this.blocked;t?u(!0,e):(e.none=i.none,e.up=i.up,e.down=i.down,e.left=i.left,e.right=i.right),u(!0,i),u(!0,r),this.overlapR=0,this.overlapX=0,this.overlapY=0,this.embedded=!1},preUpdate:function(t,e){if(t&&this.resetFlags(),this.gameObject&&this.updateFromGameObject(),this.rotation=this.transform.rotation,this.preRotation=this.rotation,this.moves){var i=this.position;this.prev.x=i.x,this.prev.y=i.y,this.prevFrame.x=i.x,this.prevFrame.y=i.y}t&&this.update(e)},update:function(t){var e=this.prev,i=this.position,r=this.velocity;if(e.set(i.x,i.y),!this.moves)return this._dx=i.x-e.x,void(this._dy=i.y-e.y);if(this.directControl){var s=this.autoFrame;r.set((i.x-s.x)/t,(i.y-s.y)/t),this.world.updateMotion(this,t),this._dx=i.x-s.x,this._dy=i.y-s.y}else this.world.updateMotion(this,t),this.newVelocity.set(r.x*t,r.y*t),i.add(this.newVelocity),this._dx=i.x-e.x,this._dy=i.y-e.y;var n=r.x,o=r.y;if(this.updateCenter(),this.angle=Math.atan2(o,n),this.speed=Math.sqrt(n*n+o*o),this.collideWorldBounds&&this.checkWorldBounds()&&this.onWorldBounds){var h=this.blocked;this.world.emit(a.WORLD_BOUNDS,this,h.up,h.down,h.left,h.right)}},postUpdate:function(){var t=this.position,e=t.x-this.prevFrame.x,i=t.y-this.prevFrame.y,r=this.gameObject;if(this.moves){var s=this.deltaMax.x,a=this.deltaMax.y;0!==s&&0!==e&&(e<0&&e<-s?e=-s:e>0&&e>s&&(e=s)),0!==a&&0!==i&&(i<0&&i<-a?i=-a:i>0&&i>a&&(i=a)),r&&(r.x+=e,r.y+=i)}e<0?this.facing=n.FACING_LEFT:e>0&&(this.facing=n.FACING_RIGHT),i<0?this.facing=n.FACING_UP:i>0&&(this.facing=n.FACING_DOWN),this.allowRotation&&r&&(r.angle+=this.deltaZ()),this._tx=e,this._ty=i,this.autoFrame.set(t.x,t.y)},setBoundsRectangle:function(t){return this.customBoundsRectangle=t||this.world.bounds,this},checkWorldBounds:function(){var t=this.position,e=this.velocity,i=this.blocked,r=this.customBoundsRectangle,s=this.world.checkCollision,n=this.worldBounce?-this.worldBounce.x:-this.bounce.x,a=this.worldBounce?-this.worldBounce.y:-this.bounce.y,o=!1;return t.xr.right&&s.right&&(t.x=r.right-this.width,e.x*=n,i.right=!0,o=!0),t.yr.bottom&&s.down&&(t.y=r.bottom-this.height,e.y*=a,i.down=!0,o=!0),o&&(this.blocked.none=!1,this.updateCenter()),o},setOffset:function(t,e){return void 0===e&&(e=t),this.offset.set(t,e),this},setGameObject:function(t,e){if(void 0===e&&(e=!0),!t||!t.hasTransformComponent)return this;var i=this.world;return this.gameObject&&this.gameObject.body&&(i.disable(this.gameObject),this.gameObject.body=null),t.body&&i.disable(t),this.gameObject=t,t.body=this,this.setSize(),this.enable=e,this},setSize:function(t,e,i){void 0===i&&(i=!0);var r=this.gameObject;if(r&&(!t&&r.frame&&(t=r.frame.realWidth),!e&&r.frame&&(e=r.frame.realHeight)),this.sourceWidth=t,this.sourceHeight=e,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter(),i&&r&&r.getCenter){var s=(r.width-t)/2,n=(r.height-e)/2;this.offset.set(s,n)}return this.isCircle=!1,this.radius=0,this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.isCircle=!0,this.radius=t,this.sourceWidth=2*t,this.sourceHeight=2*t,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter()):this.isCircle=!1,this},reset:function(t,e){this.stop();var i=this.gameObject;i&&(i.setPosition(t,e),this.rotation=i.angle,this.preRotation=i.angle);var r=this.position;i&&i.getTopLeft?i.getTopLeft(r):r.set(t,e),this.prev.copy(r),this.prevFrame.copy(r),this.autoFrame.copy(r),i&&this.updateBounds(),this.updateCenter(),this.collideWorldBounds&&this.checkWorldBounds(),this.resetFlags(!0)},stop:function(){return this.velocity.set(0),this.acceleration.set(0),this.speed=0,this.angularVelocity=0,this.angularAcceleration=0,this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?this.radius>0&&t>=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom&&(this.center.x-t)*(this.center.x-t)+(this.center.y-e)*(this.center.y-e)<=this.radius*this.radius:l(this,t,e)},onFloor:function(){return this.blocked.down},onCeiling:function(){return this.blocked.up},onWall:function(){return this.blocked.left||this.blocked.right},deltaAbsX:function(){return this._dx>0?this._dx:-this._dx},deltaAbsY:function(){return this._dy>0?this._dy:-this._dy},deltaX:function(){return this._dx},deltaY:function(){return this._dy},deltaXFinal:function(){return this._tx},deltaYFinal:function(){return this._ty},deltaZ:function(){return this.rotation-this.preRotation},destroy:function(){this.enable=!1,this.world&&this.world.pendingDestroy.add(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,r=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(t.defaultStrokeWidth,this.debugBodyColor),this.isCircle?t.strokeCircle(i,r,this.width/2):(this.checkCollision.up&&t.lineBetween(e.x,e.y,e.x+this.width,e.y),this.checkCollision.right&&t.lineBetween(e.x+this.width,e.y,e.x+this.width,e.y+this.height),this.checkCollision.down&&t.lineBetween(e.x,e.y+this.height,e.x+this.width,e.y+this.height),this.checkCollision.left&&t.lineBetween(e.x,e.y,e.x,e.y+this.height))),this.debugShowVelocity&&(t.lineStyle(t.defaultStrokeWidth,this.world.defaults.velocityDebugColor,1),t.lineBetween(i,r,i+this.velocity.x/2,r+this.velocity.y/2))},willDrawDebug:function(){return this.debugShowBody||this.debugShowVelocity},setDirectControl:function(t){return void 0===t&&(t=!0),this.directControl=t,this},setCollideWorldBounds:function(t,e,i,r){void 0===t&&(t=!0),this.collideWorldBounds=t;var s=void 0!==e,n=void 0!==i;return(s||n)&&(this.worldBounce||(this.worldBounce=new d),s&&(this.worldBounce.x=e),n&&(this.worldBounce.y=i)),void 0!==r&&(this.onWorldBounds=r),this},setVelocity:function(t,e){return this.velocity.set(t,e),t=this.velocity.x,e=this.velocity.y,this.speed=Math.sqrt(t*t+e*e),this},setVelocityX:function(t){return this.setVelocity(t,this.velocity.y)},setVelocityY:function(t){return this.setVelocity(this.velocity.x,t)},setMaxVelocity:function(t,e){return this.maxVelocity.set(t,e),this},setMaxVelocityX:function(t){return this.maxVelocity.x=t,this},setMaxVelocityY:function(t){return this.maxVelocity.y=t,this},setMaxSpeed:function(t){return this.maxSpeed=t,this},setSlideFactor:function(t,e){return this.slideFactor.set(t,e),this},setBounce:function(t,e){return this.bounce.set(t,e),this},setBounceX:function(t){return this.bounce.x=t,this},setBounceY:function(t){return this.bounce.y=t,this},setAcceleration:function(t,e){return this.acceleration.set(t,e),this},setAccelerationX:function(t){return this.acceleration.x=t,this},setAccelerationY:function(t){return this.acceleration.y=t,this},setAllowDrag:function(t){return void 0===t&&(t=!0),this.allowDrag=t,this},setAllowGravity:function(t){return void 0===t&&(t=!0),this.allowGravity=t,this},setAllowRotation:function(t){return void 0===t&&(t=!0),this.allowRotation=t,this},setDrag:function(t,e){return this.drag.set(t,e),this},setDamping:function(t){return this.useDamping=t,this},setDragX:function(t){return this.drag.x=t,this},setDragY:function(t){return this.drag.y=t,this},setGravity:function(t,e){return this.gravity.set(t,e),this},setGravityX:function(t){return this.gravity.x=t,this},setGravityY:function(t){return this.gravity.y=t,this},setFriction:function(t,e){return this.friction.set(t,e),this},setFrictionX:function(t){return this.friction.x=t,this},setFrictionY:function(t){return this.friction.y=t,this},setAngularVelocity:function(t){return this.angularVelocity=t,this},setAngularAcceleration:function(t){return this.angularAcceleration=t,this},setAngularDrag:function(t){return this.angularDrag=t,this},setMass:function(t){return this.mass=t,this},setImmovable:function(t){return void 0===t&&(t=!0),this.immovable=t,this},setEnable:function(t){return void 0===t&&(t=!0),this.enable=t,this},processX:function(t,e,i,r){this.x+=t,this.updateCenter(),null!==e&&(this.velocity.x=e*this.slideFactor.x);var s=this.blocked;i&&(s.left=!0,s.none=!1),r&&(s.right=!0,s.none=!1)},processY:function(t,e,i,r){this.y+=t,this.updateCenter(),null!==e&&(this.velocity.y=e*this.slideFactor.y);var s=this.blocked;i&&(s.up=!0,s.none=!1),r&&(s.down=!0,s.none=!1)},x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=c},79342(t,e,i){var r=new(i(83419))({initialize:function(t,e,i,r,s,n,a){this.world=t,this.name="",this.active=!0,this.overlapOnly=e,this.object1=i,this.object2=r,this.collideCallback=s,this.processCallback=n,this.callbackContext=a},setName:function(t){return this.name=t,this},update:function(){this.world.collideObjects(this.object1,this.object2,this.collideCallback,this.processCallback,this.callbackContext,this.overlapOnly)},destroy:function(){this.world.removeCollider(this),this.active=!1,this.world=null,this.object1=null,this.object2=null,this.collideCallback=null,this.processCallback=null,this.callbackContext=null}});t.exports=r},66022(t,e,i){var r=i(71289),s=i(13759),n=i(37742),a=i(83419),o=i(37747),h=i(60758),l=i(72624),u=i(71464),d=new a({initialize:function(t){this.world=t,this.scene=t.scene,this.sys=t.scene.sys},collider:function(t,e,i,r,s){return this.world.addCollider(t,e,i,r,s)},overlap:function(t,e,i,r,s){return this.world.addOverlap(t,e,i,r,s)},existing:function(t,e){var i=e?o.STATIC_BODY:o.DYNAMIC_BODY;return this.world.enableBody(t,i),t},staticImage:function(t,e,i,s){var n=new r(this.scene,t,e,i,s);return this.sys.displayList.add(n),this.world.enableBody(n,o.STATIC_BODY),n},image:function(t,e,i,s){var n=new r(this.scene,t,e,i,s);return this.sys.displayList.add(n),this.world.enableBody(n,o.DYNAMIC_BODY),n},staticSprite:function(t,e,i,r){var n=new s(this.scene,t,e,i,r);return this.sys.displayList.add(n),this.sys.updateList.add(n),this.world.enableBody(n,o.STATIC_BODY),n},sprite:function(t,e,i,r){var n=new s(this.scene,t,e,i,r);return this.sys.displayList.add(n),this.sys.updateList.add(n),this.world.enableBody(n,o.DYNAMIC_BODY),n},staticGroup:function(t,e){return this.sys.updateList.add(new u(this.world,this.world.scene,t,e))},group:function(t,e){return this.sys.updateList.add(new h(this.world,this.world.scene,t,e))},body:function(t,e,i,r){var s=new n(this.world);return s.position.set(t,e),i&&r&&s.setSize(i,r),this.world.add(s,o.DYNAMIC_BODY),s},staticBody:function(t,e,i,r){var s=new l(this.world);return s.position.set(t,e),i&&r&&s.setSize(i,r),this.world.add(s,o.STATIC_BODY),s},destroy:function(){this.world=null,this.scene=null,this.sys=null}});t.exports=d},79599(t){t.exports=function(t){var e=0;if(Array.isArray(t))for(var i=0;ie._dx?(n=t.right-e.x)>a&&!i||!1===t.checkCollision.right||!1===e.checkCollision.left?n=0:(t.touching.none=!1,t.touching.right=!0,e.touching.none=!1,e.touching.left=!0,e.physicsType!==r.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.right=!0),t.physicsType!==r.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.left=!0)):t._dxa&&!i||!1===t.checkCollision.left||!1===e.checkCollision.right?n=0:(t.touching.none=!1,t.touching.left=!0,e.touching.none=!1,e.touching.right=!0,e.physicsType!==r.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.left=!0),t.physicsType!==r.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.right=!0))),t.overlapX=n,e.overlapX=n,n}},45170(t,e,i){var r=i(37747);t.exports=function(t,e,i,s){var n=0,a=t.deltaAbsY()+e.deltaAbsY()+s;return 0===t._dy&&0===e._dy?(t.embedded=!0,e.embedded=!0):t._dy>e._dy?(n=t.bottom-e.y)>a&&!i||!1===t.checkCollision.down||!1===e.checkCollision.up?n=0:(t.touching.none=!1,t.touching.down=!0,e.touching.none=!1,e.touching.up=!0,e.physicsType!==r.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.down=!0),t.physicsType!==r.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.up=!0)):t._dya&&!i||!1===t.checkCollision.up||!1===e.checkCollision.down?n=0:(t.touching.none=!1,t.touching.up=!0,e.touching.none=!1,e.touching.down=!0,e.physicsType!==r.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.up=!0),t.physicsType!==r.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.down=!0))),t.overlapY=n,e.overlapY=n,n}},60758(t,e,i){var r=i(13759),s=i(83419),n=i(78389),a=i(37747),o=i(95540),h=i(26479),l=i(41212),u=new s({Extends:h,Mixins:[n],initialize:function(t,e,i,s){if(i||s)if(l(i))s=i,i=null,s.internalCreateCallback=this.createCallbackHandler,s.internalRemoveCallback=this.removeCallbackHandler;else if(Array.isArray(i)&&l(i[0])){var n=this;i.forEach(function(t){t.internalCreateCallback=n.createCallbackHandler,t.internalRemoveCallback=n.removeCallbackHandler,t.classType=o(t,"classType",r)}),s=null}else s={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler};else s={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler};this.world=t,s&&(s.classType=o(s,"classType",r)),this.physicsType=a.DYNAMIC_BODY,this.collisionCategory=1,this.collisionMask=2147483647,this.defaults={setCollideWorldBounds:o(s,"collideWorldBounds",!1),setBoundsRectangle:o(s,"customBoundsRectangle",null),setAccelerationX:o(s,"accelerationX",0),setAccelerationY:o(s,"accelerationY",0),setAllowDrag:o(s,"allowDrag",!0),setAllowGravity:o(s,"allowGravity",!0),setAllowRotation:o(s,"allowRotation",!0),setDamping:o(s,"useDamping",!1),setBounceX:o(s,"bounceX",0),setBounceY:o(s,"bounceY",0),setDragX:o(s,"dragX",0),setDragY:o(s,"dragY",0),setEnable:o(s,"enable",!0),setGravityX:o(s,"gravityX",0),setGravityY:o(s,"gravityY",0),setFrictionX:o(s,"frictionX",0),setFrictionY:o(s,"frictionY",0),setMaxSpeed:o(s,"maxSpeed",-1),setMaxVelocityX:o(s,"maxVelocityX",1e4),setMaxVelocityY:o(s,"maxVelocityY",1e4),setVelocityX:o(s,"velocityX",0),setVelocityY:o(s,"velocityY",0),setAngularVelocity:o(s,"angularVelocity",0),setAngularAcceleration:o(s,"angularAcceleration",0),setAngularDrag:o(s,"angularDrag",0),setMass:o(s,"mass",1),setImmovable:o(s,"immovable",!1)},h.call(this,e,i,s),this.type="PhysicsGroup"},createCallbackHandler:function(t){t.body&&t.body.physicsType===a.DYNAMIC_BODY||(t.body&&(t.body.destroy(),t.body=null),this.world.enableBody(t,a.DYNAMIC_BODY));var e=t.body;for(var i in this.defaults)e[i](this.defaults[i])},removeCallbackHandler:function(t){t.body&&this.world.disableBody(t)},setVelocity:function(t,e,i){void 0===i&&(i=0);for(var r=this.getChildren(),s=0;s0?1:-1),o=Math.sqrt(t*t*e.mass/i.mass)*(t>0?1:-1),h=.5*(s+o);return o-=h,n=h+(s-=h)*e.bounce.x,a=h+o*i.bounce.x,l&&m?x(0):c&&g?x(1):u&&g?x(2):!(!f||!m)&&x(3)},Set:function(t,n,a){i=n;var x=(e=t).velocity.x,T=i.velocity.x;return r=e.pushable,l=e._dx<0,u=e._dx>0,d=0===e._dx,g=Math.abs(e.right-i.x)<=Math.abs(i.right-e.x),o=T-x*e.bounce.x,s=i.pushable,c=i._dx<0,f=i._dx>0,p=0===i._dx,m=!g,h=x-T*i.bounce.x,v=Math.abs(a),y()},Run:x,RunImmovableBody1:function(t){if(1===t?i.velocity.x=0:g?i.processX(v,h,!0):i.processX(-v,h,!1,!0),e.moves){var r=e.directControl?e.y-e.autoFrame.y:e.y-e.prev.y;i.y+=r*e.friction.y,i._dy=i.y-i.prev.y}},RunImmovableBody2:function(t){if(2===t?e.velocity.x=0:m?e.processX(v,o,!0):e.processX(-v,o,!1,!0),i.moves){var r=i.directControl?i.y-i.autoFrame.y:i.y-i.prev.y;e.y+=r*i.friction.y,e._dy=e.y-e.prev.y}}}},47962(t){var e,i,r,s,n,a,o,h,l,u,d,c,f,p,g,m,v,y=function(){return u&&g&&i.blocked.down?(e.processY(-v,o,!1,!0),1):l&&m&&i.blocked.up?(e.processY(v,o,!0),1):f&&m&&e.blocked.down?(i.processY(-v,h,!1,!0),2):c&&g&&e.blocked.up?(i.processY(v,h,!0),2):0},x=function(t){if(r&&s)v*=.5,0===t||3===t?(e.processY(v,n),i.processY(-v,a)):(e.processY(-v,n),i.processY(v,a));else if(r&&!s)0===t||3===t?e.processY(v,o,!0):e.processY(-v,o,!1,!0);else if(!r&&s)0===t||3===t?i.processY(-v,h,!1,!0):i.processY(v,h,!0);else{var g=.5*v;0===t?p?(e.processY(v,0,!0),i.processY(0,null,!1,!0)):f?(e.processY(g,0,!0),i.processY(-g,0,!1,!0)):(e.processY(g,i.velocity.y,!0),i.processY(-g,null,!1,!0)):1===t?d?(e.processY(0,null,!1,!0),i.processY(v,0,!0)):u?(e.processY(-g,0,!1,!0),i.processY(g,0,!0)):(e.processY(-g,null,!1,!0),i.processY(g,e.velocity.y,!0)):2===t?p?(e.processY(-v,0,!1,!0),i.processY(0,null,!0)):c?(e.processY(-g,0,!1,!0),i.processY(g,0,!0)):(e.processY(-g,i.velocity.y,!1,!0),i.processY(g,null,!0)):3===t&&(d?(e.processY(0,null,!0),i.processY(-v,0,!1,!0)):l?(e.processY(g,0,!0),i.processY(-g,0,!1,!0)):(e.processY(g,i.velocity.y,!0),i.processY(-g,null,!1,!0)))}return!0};t.exports={BlockCheck:y,Check:function(){var t=e.velocity.y,r=i.velocity.y,s=Math.sqrt(r*r*i.mass/e.mass)*(r>0?1:-1),o=Math.sqrt(t*t*e.mass/i.mass)*(t>0?1:-1),h=.5*(s+o);return o-=h,n=h+(s-=h)*e.bounce.y,a=h+o*i.bounce.y,l&&m?x(0):c&&g?x(1):u&&g?x(2):!(!f||!m)&&x(3)},Set:function(t,n,a){i=n;var x=(e=t).velocity.y,T=i.velocity.y;return r=e.pushable,l=e._dy<0,u=e._dy>0,d=0===e._dy,g=Math.abs(e.bottom-i.y)<=Math.abs(i.bottom-e.y),o=T-x*e.bounce.y,s=i.pushable,c=i._dy<0,f=i._dy>0,p=0===i._dy,m=!g,h=x-T*i.bounce.y,v=Math.abs(a),y()},Run:x,RunImmovableBody1:function(t){if(1===t?i.velocity.y=0:g?i.processY(v,h,!0):i.processY(-v,h,!1,!0),e.moves){var r=e.directControl?e.x-e.autoFrame.x:e.x-e.prev.x;i.x+=r*e.friction.x,i._dx=i.x-i.prev.x}},RunImmovableBody2:function(t){if(2===t?e.velocity.y=0:m?e.processY(v,o,!0):e.processY(-v,o,!1,!0),i.moves){var r=i.directControl?i.x-i.autoFrame.x:i.x-i.prev.x;e.x+=r*i.friction.x,e._dx=e.x-e.prev.x}}}},14087(t,e,i){var r=i(64897),s=i(3017);t.exports=function(t,e,i,n,a){void 0===a&&(a=r(t,e,i,n));var o=t.immovable,h=e.immovable;if(i||0===a||o&&h||t.customSeparateX||e.customSeparateX)return 0!==a||t.embedded&&e.embedded;var l=s.Set(t,e,a);return o||h?(o?s.RunImmovableBody1(l):h&&s.RunImmovableBody2(l),!0):l>0||s.Check()}},89936(t,e,i){var r=i(45170),s=i(47962);t.exports=function(t,e,i,n,a){void 0===a&&(a=r(t,e,i,n));var o=t.immovable,h=e.immovable;if(i||0===a||o&&h||t.customSeparateY||e.customSeparateY)return 0!==a||t.embedded&&e.embedded;var l=s.Set(t,e,a);return o||h?(o?s.RunImmovableBody1(l):h&&s.RunImmovableBody2(l),!0):l>0||s.Check()}},95829(t){t.exports=function(t,e){return void 0===e&&(e={}),e.none=t,e.up=!1,e.down=!1,e.left=!1,e.right=!1,t||(e.up=!0,e.down=!0,e.left=!0,e.right=!0),e}},72624(t,e,i){var r=i(87902),s=i(83419),n=i(78389),a=i(37747),o=i(37303),h=i(95829),l=i(26099),u=new s({Mixins:[n],initialize:function(t,e){var i=64,r=64,s=void 0!==e;s&&e.displayWidth&&(i=e.displayWidth,r=e.displayHeight),s||(e={x:0,y:0,angle:0,rotation:0,scaleX:1,scaleY:1,displayOriginX:0,displayOriginY:0}),this.world=t,this.gameObject=s?e:void 0,this.isBody=!0,this.debugShowBody=t.defaults.debugShowStaticBody,this.debugBodyColor=t.defaults.staticBodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new l,this.position=new l(e.x-i*e.originX,e.y-r*e.originY),this.width=i,this.height=r,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center=new l(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=l.ZERO,this.allowGravity=!1,this.gravity=l.ZERO,this.bounce=l.ZERO,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.mass=1,this.immovable=!0,this.pushable=!1,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision=h(!1),this.touching=h(!0),this.wasTouching=h(!0),this.blocked=h(!0),this.physicsType=a.STATIC_BODY,this.collisionCategory=1,this.collisionMask=1,this._dx=0,this._dy=0},setGameObject:function(t,e,i){if(void 0===e&&(e=!0),void 0===i&&(i=!0),!t||!t.hasTransformComponent)return this;var r=this.world;return this.gameObject&&this.gameObject.body&&(r.disable(this.gameObject),this.gameObject.body=null),t.body&&r.disable(t),this.gameObject=t,t.body=this,this.setSize(),e&&this.updateFromGameObject(),this.enable=i,this},updateFromGameObject:function(){this.world.staticTree.remove(this);var t=this.gameObject;return t.getTopLeft(this.position),this.width=t.displayWidth,this.height=t.displayHeight,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.world.staticTree.insert(this),this},setOffset:function(t,e){return void 0===e&&(e=t),this.world.staticTree.remove(this),this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(t,e),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this),this},setSize:function(t,e,i){void 0===i&&(i=!0);var r=this.gameObject;if(r&&r.frame&&(t||(t=r.frame.realWidth),e||(e=r.frame.realHeight)),this.world.staticTree.remove(this),this.width=t,this.height=e,this.halfWidth=Math.floor(t/2),this.halfHeight=Math.floor(e/2),i&&r&&r.getCenter){var s=r.displayWidth/2,n=r.displayHeight/2;this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(s-this.halfWidth,n-this.halfHeight),this.position.x+=this.offset.x,this.position.y+=this.offset.y}return this.updateCenter(),this.isCircle=!1,this.radius=0,this.world.staticTree.insert(this),this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.world.staticTree.remove(this),this.isCircle=!0,this.radius=t,this.width=2*t,this.height=2*t,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter(),this.world.staticTree.insert(this)):this.isCircle=!1,this},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},reset:function(t,e){var i=this.gameObject;void 0===t&&(t=i.x),void 0===e&&(e=i.y),this.world.staticTree.remove(this),i.setPosition(t,e),i.getTopLeft(this.position),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this)},stop:function(){return this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?r(this,t,e):o(this,t,e)},postUpdate:function(){},deltaAbsX:function(){return 0},deltaAbsY:function(){return 0},deltaX:function(){return 0},deltaY:function(){return 0},deltaZ:function(){return 0},destroy:function(){this.enable=!1,this.world.pendingDestroy.add(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,r=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(t.defaultStrokeWidth,this.debugBodyColor,1),this.isCircle?t.strokeCircle(i,r,this.width/2):t.strokeRect(e.x,e.y,this.width,this.height))},willDrawDebug:function(){return this.debugShowBody},setMass:function(t){return t<=0&&(t=.1),this.mass=t,this},x:{get:function(){return this.position.x},set:function(t){this.world.staticTree.remove(this),this.position.x=t,this.world.staticTree.insert(this)}},y:{get:function(){return this.position.y},set:function(t){this.world.staticTree.remove(this),this.position.y=t,this.world.staticTree.insert(this)}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=u},71464(t,e,i){var r=i(13759),s=i(83419),n=i(78389),a=i(37747),o=i(95540),h=i(26479),l=i(41212),u=new s({Extends:h,Mixins:[n],initialize:function(t,e,i,s){i||s?l(i)?(s=i,i=null,s.internalCreateCallback=this.createCallbackHandler,s.internalRemoveCallback=this.removeCallbackHandler,s.createMultipleCallback=this.createMultipleCallbackHandler,s.classType=o(s,"classType",r)):Array.isArray(i)&&l(i[0])?(s=i,i=null,s.forEach(function(t){t.internalCreateCallback=this.createCallbackHandler,t.internalRemoveCallback=this.removeCallbackHandler,t.createMultipleCallback=this.createMultipleCallbackHandler,t.classType=o(t,"classType",r)},this)):s={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler}:s={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler,createMultipleCallback:this.createMultipleCallbackHandler,classType:r},this.world=t,this.physicsType=a.STATIC_BODY,this.collisionCategory=1,this.collisionMask=1,h.call(this,e,i,s),this.type="StaticPhysicsGroup"},createCallbackHandler:function(t){t.body&&t.body.physicsType===a.STATIC_BODY||(t.body&&(t.body.destroy(),t.body=null),this.world.enableBody(t,a.STATIC_BODY))},removeCallbackHandler:function(t){t.body&&this.world.disableBody(t)},createMultipleCallbackHandler:function(){this.refresh()},refresh:function(){for(var t=Array.from(this.children),e=0;e=r;if(this.fixedStep||(i=.001*e,n=!0,this._elapsed=0),s.forEach(function(t){t.enable&&t.preUpdate(n,i)}),n){this._elapsed-=r,this.stepsLastFrame=1,this.useTree&&(this.tree.clear(),this.tree.load(Array.from(s)));for(var a=this.colliders.update(),o=0;o=r;)this._elapsed-=r,this.step(i)}},step:function(t){var e=this.bodies;e.forEach(function(e){e.enable&&e.update(t)}),this.useTree&&(this.tree.clear(),this.tree.load(Array.from(e)));for(var i=this.colliders.update(),r=0;r0){var s=this.tree,n=this.staticTree;r.forEach(function(i){i.physicsType===h.DYNAMIC_BODY?(s.remove(i),t.delete(i)):i.physicsType===h.STATIC_BODY&&(n.remove(i),e.delete(i)),i.world=void 0,i.gameObject=void 0}),r.clear()}},updateMotion:function(t,e){t.allowRotation&&this.computeAngularVelocity(t,e),this.computeVelocity(t,e)},computeAngularVelocity:function(t,e){var i=t.angularVelocity,r=t.angularAcceleration,s=t.angularDrag,a=t.maxAngular;r?i+=r*e:t.allowDrag&&s&&(p(i-(s*=e),0,.1)?i-=s:g(i+s,0,.1)?i+=s:i=0);var o=(i=n(i,-a,a))-t.angularVelocity;t.angularVelocity+=o,t.rotation+=t.angularVelocity*e},computeVelocity:function(t,e){var i=t.velocity.x,r=t.acceleration.x,s=t.drag.x,a=t.maxVelocity.x,o=t.velocity.y,h=t.acceleration.y,l=t.drag.y,u=t.maxVelocity.y,d=t.speed,c=t.maxSpeed,m=t.allowDrag,v=t.useDamping;t.allowGravity&&(i+=(this.gravity.x+t.gravity.x)*e,o+=(this.gravity.y+t.gravity.y)*e),r?i+=r*e:m&&s&&(v?(i*=s=Math.pow(s,e),d=Math.sqrt(i*i+o*o),f(d,0,.001)&&(i=0)):p(i-(s*=e),0,.01)?i-=s:g(i+s,0,.01)?i+=s:i=0),h?o+=h*e:m&&l&&(v?(o*=l=Math.pow(l,e),d=Math.sqrt(i*i+o*o),f(d,0,.001)&&(o=0)):p(o-(l*=e),0,.01)?o-=l:g(o+l,0,.01)?o+=l:o=0),i=n(i,-a,a),o=n(o,-u,u),t.velocity.set(i,o),c>-1&&t.velocity.length()>c&&(t.velocity.normalize().scale(c),d=c),t.speed=d},separate:function(t,e,i,r,s){var n,a,o=!1,h=!0;if(!t.enable||!e.enable||t.checkCollision.none||e.checkCollision.none||!this.intersects(t,e)||0===(t.collisionMask&e.collisionCategory)||0===(e.collisionMask&t.collisionCategory))return o;if(i&&!1===i.call(r,t.gameObject||t,e.gameObject||e))return o;if(t.isCircle||e.isCircle){var l=this.separateCircle(t,e,s);l.result?(o=!0,h=!1):(n=l.x,a=l.y,h=!0)}if(h){var u=!1,d=!1,f=this.OVERLAP_BIAS;s?(u=A(t,e,s,f,n),d=_(t,e,s,f,a)):this.forceX||Math.abs(this.gravity.y+t.gravity.y)C&&(p=l(y,x,C,S)-w):x>E&&(yC&&(p=l(y,x,C,E)-w)),p*=-1}else p=t.halfWidth+e.halfWidth-u(a,o);t.overlapR=p,e.overlapR=p;var A=r(a,o),_=(p+T.EPSILON)*Math.cos(A),M=(p+T.EPSILON)*Math.sin(A),R={overlap:p,result:!1,x:_,y:M};if(i&&(!g||g&&0!==p))return R.result=!0,R;if(!g&&0===p||h&&d||t.customSeparateX||e.customSeparateX)return R.x=void 0,R.y=void 0,R;var P=!t.pushable&&!e.pushable;if(g){var O=a.x-o.x,L=a.y-o.y,D=Math.sqrt(Math.pow(O,2)+Math.pow(L,2)),F=(o.x-a.x)/D||0,I=(o.y-a.y)/D||0,N=2*(c.x*F+c.y*I-f.x*F-f.y*I)/(t.mass+e.mass);!h&&!d&&t.pushable&&e.pushable||(N*=2),!h&&t.pushable&&(c.x=c.x-N/t.mass*F,c.y=c.y-N/t.mass*I,c.multiply(t.bounce)),!d&&e.pushable&&(f.x=f.x+N/e.mass*F,f.y=f.y+N/e.mass*I,f.multiply(e.bounce)),h||d||(_*=.5,M*=.5),(!h||t.pushable||P)&&(t.x-=_,t.y-=M,t.updateCenter()),(!d||e.pushable||P)&&(e.x+=_,e.y+=M,e.updateCenter()),R.result=!0}else h||!t.pushable&&!P||(t.x-=_,t.y-=M,t.updateCenter()),(!d||e.pushable||P)&&(e.x+=_,e.y+=M,e.updateCenter()),R.x=void 0,R.y=void 0;return R},intersects:function(t,e){return t!==e&&(t.isCircle||e.isCircle?t.isCircle?e.isCircle?u(t.center,e.center)<=t.halfWidth+e.halfWidth:this.circleBodyIntersects(t,e):this.circleBodyIntersects(e,t):!(t.right<=e.left||t.bottom<=e.top||t.left>=e.right||t.top>=e.bottom))},circleBodyIntersects:function(t,e){var i=n(t.center.x,e.left,e.right),r=n(t.center.y,e.top,e.bottom);return(t.center.x-i)*(t.center.x-i)+(t.center.y-r)*(t.center.y-r)<=t.halfWidth*t.halfWidth},overlap:function(t,e,i,r,s){return void 0===i&&(i=null),void 0===r&&(r=null),void 0===s&&(s=i),this.collideObjects(t,e,i,r,s,!0)},collide:function(t,e,i,r,s){return void 0===i&&(i=null),void 0===r&&(r=null),void 0===s&&(s=i),this.collideObjects(t,e,i,r,s,!1)},collideObjects:function(t,e,i,r,s,n){var a,o;!t.isParent||void 0!==t.physicsType&&void 0!==e&&t!==e||(t=Array.from(t.children)),e&&e.isParent&&void 0===e.physicsType&&(e=Array.from(e.children));var h=Array.isArray(t),l=Array.isArray(e);if(this._total=0,h||l)if(!h&&l)for(a=0;a0},collideHandler:function(t,e,i,r,s,n){if(void 0===e&&t.isParent)return this.collideGroupVsGroup(t,t,i,r,s,n);if(!t||!e)return!1;if(t.body||t.isBody){if(e.body||e.isBody)return this.collideSpriteVsSprite(t,e,i,r,s,n);if(e.isParent)return this.collideSpriteVsGroup(t,e,i,r,s,n);if(e.isTilemap)return this.collideSpriteVsTilemapLayer(t,e,i,r,s,n)}else if(t.isParent){if(e.body||e.isBody)return this.collideSpriteVsGroup(e,t,i,r,s,n);if(e.isParent)return this.collideGroupVsGroup(t,e,i,r,s,n);if(e.isTilemap)return this.collideGroupVsTilemapLayer(t,e,i,r,s,n)}else if(t.isTilemap){if(e.body||e.isBody)return this.collideSpriteVsTilemapLayer(e,t,i,r,s,n);if(e.isParent)return this.collideGroupVsTilemapLayer(e,t,i,r,s,n)}},canCollide:function(t,e){return t&&e&&0!==(t.collisionMask&e.collisionCategory)&&0!==(e.collisionMask&t.collisionCategory)},collideSpriteVsSprite:function(t,e,i,r,s,n){var a=t.isBody?t:t.body,o=e.isBody?e:e.body;return!!this.canCollide(a,o)&&(this.separate(a,o,r,s,n)&&(i&&i.call(s,t,e),this._total++),!0)},collideSpriteVsGroup:function(t,e,i,r,s,n){var a,o,l,u=t.isBody?t:t.body;if(0!==e.getLength()&&u&&u.enable&&!u.checkCollision.none&&this.canCollide(u,e))if(this.useTree||e.physicsType===h.STATIC_BODY){var d=this.treeMinMax;d.minX=u.left,d.minY=u.top,d.maxX=u.right,d.maxY=u.bottom;var c=e.physicsType===h.DYNAMIC_BODY?this.tree.search(d):this.staticTree.search(d);for(o=c.length,a=0;a0&&(t.blocked.none=!1,t.blocked.right=!0),t.position.x-=e,t.updateCenter(),0===t.bounce.x?t.velocity.x=0:t.velocity.x=-t.velocity.x*t.bounce.x}},67013(t){t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.up=!0):e>0&&(t.blocked.none=!1,t.blocked.down=!0),t.position.y-=e,t.updateCenter(),0===t.bounce.y?t.velocity.y=0:t.velocity.y=-t.velocity.y*t.bounce.y}},40012(t,e,i){var r=i(21329),s=i(53442),n=i(2483);t.exports=function(t,e,i,a,o,h,l){var u=a.left,d=a.top,c=a.right,f=a.bottom,p=i.faceLeft||i.faceRight,g=i.faceTop||i.faceBottom;if(l||(p=!0,g=!0),!p&&!g)return!1;var m=0,v=0,y=0,x=1;if(e.deltaAbsX()>e.deltaAbsY()?y=-1:e.deltaAbsX()0&&u&&t.checkCollision.right&&h&&t.right>i&&(o=t.right-i)>n&&(o=0),0!==o&&(t.customSeparateX?t.overlapX=o:r(t,o)),o}},53442(t,e,i){var r=i(67013);t.exports=function(t,e,i,s,n,a){var o=0,h=e.faceTop,l=e.faceBottom,u=e.collideUp,d=e.collideDown;return a||(h=!0,l=!0,u=!0,d=!0),t.deltaY()<0&&d&&t.checkCollision.up?l&&t.y0&&u&&t.checkCollision.down&&h&&t.bottom>i&&(o=t.bottom-i)>n&&(o=0),0!==o&&(t.customSeparateY?t.overlapY=o:r(t,o)),o}},2483(t){t.exports=function(t,e){return!(e.right<=t.left||e.bottom<=t.top||e.position.x>=t.right||e.position.y>=t.bottom)}},55173(t,e,i){var r={ProcessTileCallbacks:i(96602),ProcessTileSeparationX:i(36294),ProcessTileSeparationY:i(67013),SeparateTile:i(40012),TileCheckX:i(21329),TileCheckY:i(53442),TileIntersectsBody:i(2483)};t.exports=r},44563(t,e,i){t.exports={Arcade:i(27064),Matter:i(3875)}},68174(t,e,i){var r=i(83419),s=i(26099),n=new r({initialize:function(){this.boundsCenter=new s,this.centerDiff=new s},parseBody:function(t){if(!(t=t.hasOwnProperty("body")?t.body:t).hasOwnProperty("bounds")||!t.hasOwnProperty("centerOfMass"))return!1;var e=this.boundsCenter,i=this.centerDiff,r=t.bounds.max.x-t.bounds.min.x,s=t.bounds.max.y-t.bounds.min.y,n=r*t.centerOfMass.x,a=s*t.centerOfMass.y;return e.set(r/2,s/2),i.set(n-e.x,a-e.y),!0},getTopLeft:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var r=this.boundsCenter,n=this.centerDiff;return new s(e+r.x+n.x,i+r.y+n.y)}return!1},getTopCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var r=this.boundsCenter,n=this.centerDiff;return new s(e+n.x,i+r.y+n.y)}return!1},getTopRight:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var r=this.boundsCenter,n=this.centerDiff;return new s(e-(r.x-n.x),i+r.y+n.y)}return!1},getLeftCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var r=this.boundsCenter,n=this.centerDiff;return new s(e+r.x+n.x,i+n.y)}return!1},getCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var r=this.centerDiff;return new s(e+r.x,i+r.y)}return!1},getRightCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var r=this.boundsCenter,n=this.centerDiff;return new s(e-(r.x-n.x),i+n.y)}return!1},getBottomLeft:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var r=this.boundsCenter,n=this.centerDiff;return new s(e+r.x+n.x,i-(r.y-n.y))}return!1},getBottomCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var r=this.boundsCenter,n=this.centerDiff;return new s(e+n.x,i-(r.y-n.y))}return!1},getBottomRight:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var r=this.boundsCenter,n=this.centerDiff;return new s(e-(r.x-n.x),i-(r.y-n.y))}return!1}});t.exports=n},19933(t,e,i){var r=i(6790);r.Body=i(22562),r.Composite=i(69351),r.World=i(4372),r.Collision=i(52284),r.Detector=i(81388),r.Pairs=i(99561),r.Pair=i(4506),r.Query=i(73296),r.Resolver=i(66272),r.Constraint=i(48140),r.Common=i(53402),r.Engine=i(48413),r.Events=i(35810),r.Sleeping=i(53614),r.Plugin=i(73832),r.Bodies=i(66280),r.Composites=i(74116),r.Axes=i(66615),r.Bounds=i(15647),r.Svg=i(74058),r.Vector=i(31725),r.Vertices=i(41598),r.World.add=r.Composite.add,r.World.remove=r.Composite.remove,r.World.addComposite=r.Composite.addComposite,r.World.addBody=r.Composite.addBody,r.World.addConstraint=r.Composite.addConstraint,r.World.clear=r.Composite.clear,t.exports=r},28137(t,e,i){var r=i(66280),s=i(83419),n=i(74116),a=i(48140),o=i(74058),h=i(75803),l=i(23181),u=i(34803),d=i(73834),c=i(19496),f=i(85791),p=i(98713),g=i(41598),m=new s({initialize:function(t){this.world=t,this.scene=t.scene,this.sys=t.scene.sys},rectangle:function(t,e,i,s,n){var a=r.rectangle(t,e,i,s,n);return this.world.add(a),a},trapezoid:function(t,e,i,s,n,a){var o=r.trapezoid(t,e,i,s,n,a);return this.world.add(o),o},circle:function(t,e,i,s,n){var a=r.circle(t,e,i,s,n);return this.world.add(a),a},polygon:function(t,e,i,s,n){var a=r.polygon(t,e,i,s,n);return this.world.add(a),a},fromVertices:function(t,e,i,s,n,a,o){"string"==typeof i&&(i=g.fromPath(i));var h=r.fromVertices(t,e,i,s,n,a,o);return this.world.add(h),h},fromPhysicsEditor:function(t,e,i,r,s){void 0===s&&(s=!0);var n=c.parseBody(t,e,i,r);return s&&!this.world.has(n)&&this.world.add(n),n},fromSVG:function(t,e,i,s,n,a){void 0===s&&(s=1),void 0===n&&(n={}),void 0===a&&(a=!0);for(var h=i.getElementsByTagName("path"),l=[],u=0;u0},intersectPoint:function(t,e,i){i=this.getMatterBodies(i);var r=M.create(t,e),s=[];return C.point(i,r).forEach(function(t){-1===s.indexOf(t)&&s.push(t)}),s},intersectRect:function(t,e,i,r,s,n){void 0===s&&(s=!1),n=this.getMatterBodies(n);var a={min:{x:t,y:e},max:{x:t+i,y:e+r}},o=[];return C.region(n,a,s).forEach(function(t){-1===o.indexOf(t)&&o.push(t)}),o},intersectRay:function(t,e,i,r,s,n){void 0===s&&(s=1),n=this.getMatterBodies(n);for(var a=[],o=C.ray(n,M.create(t,e),M.create(i,r),s),h=0;h0?this.setFromTileCollision(i):this.setFromTileRectangle(i),r=this.body}if(e.flipX||e.flipY){var o={x:e.getCenterX(),y:e.getCenterY()},u=e.flipX?-1:1,d=e.flipY?-1:1;s.scale(r,u,d,o)}},setFromTileRectangle:function(t){void 0===t&&(t={}),u(t,"isStatic")||(t.isStatic=!0),u(t,"addToWorld")||(t.addToWorld=!0);var e=this.tile.getBounds(),i=e.x+e.width/2,s=e.y+e.height/2,n=r.rectangle(i,s,e.width,e.height,t);return this.setBody(n,t.addToWorld),this},setFromTileCollision:function(t){void 0===t&&(t={}),u(t,"isStatic")||(t.isStatic=!0),u(t,"addToWorld")||(t.addToWorld=!0);for(var e=this.tile.tilemapLayer.scaleX,i=this.tile.tilemapLayer.scaleY,n=this.tile.getLeft(),a=this.tile.getTop(),h=this.tile.getCollisionGroup(),c=l(h,"objects",[]),f=[],p=0;p1){var C=o(t);C.parts=f,this.setBody(s.create(C),C.addToWorld)}return this},setBody:function(t,e){return void 0===e&&(e=!0),this.body&&this.removeBody(),this.body=t,this.body.gameObject=this,e&&this.world.add(this.body),this},removeBody:function(){return this.body&&(this.world.remove(this.body),this.body.gameObject=void 0,this.body=void 0),this},destroy:function(){this.removeBody(),this.tile.physics.matterBody=void 0,this.removeAllListeners()}});t.exports=c},19496(t,e,i){var r=i(66280),s=i(22562),n=i(53402),a=i(95540),o=i(41598),h={parseBody:function(t,e,i,r){void 0===r&&(r={});for(var o=a(i,"fixtures",[]),h=[],l=0;l1?1:0;s0&&s.map(function(t){i=t.bodyA,r=t.bodyB,i.gameObject&&i.gameObject.emit("collide",i,r,t),r.gameObject&&r.gameObject.emit("collide",r,i,t),p.trigger(i,"onCollide",{pair:t}),p.trigger(r,"onCollide",{pair:t}),i.onCollideCallback&&i.onCollideCallback(t),r.onCollideCallback&&r.onCollideCallback(t),i.onCollideWith[r.id]&&i.onCollideWith[r.id](r,t),r.onCollideWith[i.id]&&r.onCollideWith[i.id](i,t)}),t.emit(u.COLLISION_START,e,i,r)}),p.on(e,"collisionActive",function(e){var i,r,s=e.pairs;s.length>0&&s.map(function(t){i=t.bodyA,r=t.bodyB,i.gameObject&&i.gameObject.emit("collideActive",i,r,t),r.gameObject&&r.gameObject.emit("collideActive",r,i,t),p.trigger(i,"onCollideActive",{pair:t}),p.trigger(r,"onCollideActive",{pair:t}),i.onCollideActiveCallback&&i.onCollideActiveCallback(t),r.onCollideActiveCallback&&r.onCollideActiveCallback(t)}),t.emit(u.COLLISION_ACTIVE,e,i,r)}),p.on(e,"collisionEnd",function(e){var i,r,s=e.pairs;s.length>0&&s.map(function(t){i=t.bodyA,r=t.bodyB,i.gameObject&&i.gameObject.emit("collideEnd",i,r,t),r.gameObject&&r.gameObject.emit("collideEnd",r,i,t),p.trigger(i,"onCollideEnd",{pair:t}),p.trigger(r,"onCollideEnd",{pair:t}),i.onCollideEndCallback&&i.onCollideEndCallback(t),r.onCollideEndCallback&&r.onCollideEndCallback(t)}),t.emit(u.COLLISION_END,e,i,r)})},setBounds:function(t,e,i,r,s,n,a,o,h){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===r&&(r=this.scene.sys.scale.height),void 0===s&&(s=64),void 0===n&&(n=!0),void 0===a&&(a=!0),void 0===o&&(o=!0),void 0===h&&(h=!0),this.updateWall(n,"left",t-s,e-s,s,r+2*s),this.updateWall(a,"right",t+i,e-s,s,r+2*s),this.updateWall(o,"top",t,e-s,i,s),this.updateWall(h,"bottom",t,e+r,i,s),this},updateWall:function(t,e,i,r,s,n){var a=this.walls[e];t?(a&&m.remove(this.localWorld,a),i+=s/2,r+=n/2,this.walls[e]=this.create(i,r,s,n,{isStatic:!0,friction:0,frictionStatic:0})):(a&&m.remove(this.localWorld,a),this.walls[e]=null)},createDebugGraphic:function(){var t=this.scene.sys.add.graphics({x:0,y:0});return t.setDepth(Number.MAX_VALUE),this.debugGraphic=t,this.drawDebug=!0,t},disableGravity:function(){return this.localWorld.gravity.x=0,this.localWorld.gravity.y=0,this.localWorld.gravity.scale=0,this},setGravity:function(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=1),void 0===i&&(i=.001),this.localWorld.gravity.x=t,this.localWorld.gravity.y=e,this.localWorld.gravity.scale=i,this},create:function(t,e,i,s,n){var a=r.rectangle(t,e,i,s,n);return m.add(this.localWorld,a),a},add:function(t){return m.add(this.localWorld,t),this},remove:function(t,e){Array.isArray(t)||(t=[t]);for(var i=0;iMath.max(v._maxFrameDelta,i.maxFrameTime))&&(o=i.frameDelta||v._frameDeltaFallback),i.frameDeltaSmoothing){i.frameDeltaHistory.push(o),i.frameDeltaHistory=i.frameDeltaHistory.slice(-i.frameDeltaHistorySize);var l=i.frameDeltaHistory.slice(0).sort(),u=i.frameDeltaHistory.slice(l.length*v._smoothingLowerBound,l.length*v._smoothingUpperBound);o=v._mean(u)||o}i.frameDeltaSnapping&&(o=1e3/Math.round(1e3/o)),i.frameDelta=o,i.timeLastTick=t,i.timeBuffer+=i.frameDelta,i.timeBuffer=a.clamp(i.timeBuffer,0,i.frameDelta+s*v._timeBufferMargin),i.lastUpdatesDeferred=0;for(var d=i.maxUpdates||Math.ceil(i.maxFrameTime/s),c=a.now();s>0&&i.timeBuffer>=s*v._timeBufferMargin;){h.update(e,s),i.timeBuffer-=s,n+=1;var f=a.now()-r,p=a.now()-c,g=f+v._elapsedNextEstimate*p/n;if(n>=d||g>i.maxFrameTime){i.lastUpdatesDeferred=Math.round(Math.max(0,i.timeBuffer/s-v._timeBufferMargin));break}}}},step:function(t){h.update(this.engine,t)},update60Hz:function(){return 1e3/60},update30Hz:function(){return 1e3/30},has:function(t){var e=t.hasOwnProperty("body")?t.body:t;return null!==o.get(this.localWorld,e.id,e.type)},getAllBodies:function(){return o.allBodies(this.localWorld)},getAllConstraints:function(){return o.allConstraints(this.localWorld)},getAllComposites:function(){return o.allComposites(this.localWorld)},postUpdate:function(){if(this.drawDebug){var t=this.debugConfig,e=this.engine,i=this.debugGraphic,r=o.allBodies(this.localWorld);this.debugGraphic.clear(),t.showBroadphase&&e.broadphase.controller&&this.renderGrid(e.broadphase,i,t.broadphaseColor,.5),t.showBounds&&this.renderBodyBounds(r,i,t.boundsColor,.5),(t.showBody||t.showStaticBody)&&this.renderBodies(r),t.showJoint&&this.renderJoints(),(t.showAxes||t.showAngleIndicator)&&this.renderBodyAxes(r,i,t.showAxes,t.angleColor,.5),t.showVelocity&&this.renderBodyVelocity(r,i,t.velocityColor,1,2),t.showSeparations&&this.renderSeparations(e.pairs.list,i,t.separationColor),t.showCollisions&&this.renderCollisions(e.pairs.list,i,t.collisionColor)}},renderGrid:function(t,e,i,r){e.lineStyle(1,i,r);for(var s=a.keys(t.buckets),n=0;n0){var l=h[0].vertex.x,u=h[0].vertex.y;2===s.contactCount&&(l=(h[0].vertex.x+h[1].vertex.x)/2,u=(h[0].vertex.y+h[1].vertex.y)/2),o.bodyB===o.supports[0].body||o.bodyA.isStatic?e.lineBetween(l-8*o.normal.x,u-8*o.normal.y,l,u):e.lineBetween(l+8*o.normal.x,u+8*o.normal.y,l,u)}}return this},renderBodyBounds:function(t,e,i,r){e.lineStyle(1,i,r);for(var s=0;s1?1:0;h1?1:0;o1?1:0;o1&&this.renderConvexHull(g,e,f,y)}}},renderBody:function(t,e,i,r,s,n,a,o){void 0===r&&(r=null),void 0===s&&(s=null),void 0===n&&(n=1),void 0===a&&(a=null),void 0===o&&(o=null);for(var h=this.debugConfig,l=h.sensorFillColor,u=h.sensorLineColor,d=t.parts,c=d.length,f=c>1?1:0;f1){var s=t.vertices;e.lineStyle(r,i),e.beginPath(),e.moveTo(s[0].x,s[0].y);for(var n=1;n0&&(e.fillStyle(o),e.fillCircle(u.x,u.y,h),e.fillCircle(d.x,d.y,h)),this},resetCollisionIDs:function(){return s._nextCollidingGroupId=1,s._nextNonCollidingGroupId=-1,s._nextCategory=1,this},shutdown:function(){p.off(this.engine),this.removeAllListeners(),m.clear(this.localWorld,!1),h.clear(this.engine),this.drawDebug&&this.debugGraphic.destroy()},destroy:function(){this.shutdown()}});t.exports=x},70410(t){t.exports={setBounce:function(t){return this.body.restitution=t,this}}},66968(t){var e={setCollisionCategory:function(t){return this.body.collisionFilter.category=t,this},setCollisionGroup:function(t){return this.body.collisionFilter.group=t,this},setCollidesWith:function(t){var e=0;if(Array.isArray(t))for(var i=0;i0&&n.rotateAbout(o.position,r,t.position,o.position)}},r.setVelocity=function(t,e){var i=t.deltaTime/r._baseDelta;t.positionPrev.x=t.position.x-e.x*i,t.positionPrev.y=t.position.y-e.y*i,t.velocity.x=(t.position.x-t.positionPrev.x)/i,t.velocity.y=(t.position.y-t.positionPrev.y)/i,t.speed=n.magnitude(t.velocity)},r.getVelocity=function(t){var e=r._baseDelta/t.deltaTime;return{x:(t.position.x-t.positionPrev.x)*e,y:(t.position.y-t.positionPrev.y)*e}},r.getSpeed=function(t){return n.magnitude(r.getVelocity(t))},r.setSpeed=function(t,e){r.setVelocity(t,n.mult(n.normalise(r.getVelocity(t)),e))},r.setAngularVelocity=function(t,e){var i=t.deltaTime/r._baseDelta;t.anglePrev=t.angle-e*i,t.angularVelocity=(t.angle-t.anglePrev)/i,t.angularSpeed=Math.abs(t.angularVelocity)},r.getAngularVelocity=function(t){return(t.angle-t.anglePrev)*r._baseDelta/t.deltaTime},r.getAngularSpeed=function(t){return Math.abs(r.getAngularVelocity(t))},r.setAngularSpeed=function(t,e){r.setAngularVelocity(t,o.sign(r.getAngularVelocity(t))*e)},r.translate=function(t,e,i){r.setPosition(t,n.add(t.position,e),i)},r.rotate=function(t,e,i,s){if(i){var n=Math.cos(e),a=Math.sin(e),o=t.position.x-i.x,h=t.position.y-i.y;r.setPosition(t,{x:i.x+(o*n-h*a),y:i.y+(o*a+h*n)},s),r.setAngle(t,t.angle+e,s)}else r.setAngle(t,t.angle+e,s)},r.scale=function(t,e,i,n){var a=0,o=0;n=n||t.position;for(var u=t.inertia===1/0,d=0;d0&&(a+=c.area,o+=c.inertia),c.position.x=n.x+(c.position.x-n.x)*e,c.position.y=n.y+(c.position.y-n.y)*i,h.update(c.bounds,c.vertices,t.velocity)}t.parts.length>1&&(t.area=a,t.isStatic||(r.setMass(t,t.density*a),r.setInertia(t,o))),t.circleRadius&&(e===i?t.circleRadius*=e:t.circleRadius=null),u&&r.setInertia(t,1/0)},r.update=function(t,e){var i=(e=(void 0!==e?e:1e3/60)*t.timeScale)*e,a=r._timeCorrection?e/(t.deltaTime||e):1,u=1-t.frictionAir*(e/o._baseDelta),d=(t.position.x-t.positionPrev.x)*a,c=(t.position.y-t.positionPrev.y)*a;t.velocity.x=d*u+t.force.x/t.mass*i,t.velocity.y=c*u+t.force.y/t.mass*i,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.position.x+=t.velocity.x,t.position.y+=t.velocity.y,t.deltaTime=e,t.angularVelocity=(t.angle-t.anglePrev)*u*a+t.torque/t.inertia*i,t.anglePrev=t.angle,t.angle+=t.angularVelocity,t.speed=n.magnitude(t.velocity),t.angularSpeed=Math.abs(t.angularVelocity);for(var f=0;f0&&(p.position.x+=t.velocity.x,p.position.y+=t.velocity.y),0!==t.angularVelocity&&(s.rotate(p.vertices,t.angularVelocity,t.position),l.rotate(p.axes,t.angularVelocity),f>0&&n.rotateAbout(p.position,t.angularVelocity,t.position,p.position)),h.update(p.bounds,p.vertices,t.velocity)}},r.updateVelocities=function(t){var e=r._baseDelta/t.deltaTime,i=t.velocity;i.x=(t.position.x-t.positionPrev.x)*e,i.y=(t.position.y-t.positionPrev.y)*e,t.speed=Math.sqrt(i.x*i.x+i.y*i.y),t.angularVelocity=(t.angle-t.anglePrev)*e,t.angularSpeed=Math.abs(t.angularVelocity)},r.applyForce=function(t,e,i){var r=e.x-t.position.x,s=e.y-t.position.y;t.force.x+=i.x,t.force.y+=i.y,t.torque+=r*i.y-s*i.x},r._totalProperties=function(t){for(var e={mass:0,area:0,inertia:0,centre:{x:0,y:0}},i=1===t.parts.length?0:1;i=0&&(v=-v,y=-y),d.x=v,d.y=y,c.x=-y,c.y=v,f.x=v*g,f.y=y*g,s.depth=g;var x=r._findSupports(t,e,d,1),T=0;if(o.contains(t.vertices,x[0])&&(p[T++]=x[0]),o.contains(t.vertices,x[1])&&(p[T++]=x[1]),T<2){var w=r._findSupports(e,t,d,-1);o.contains(e.vertices,w[0])&&(p[T++]=w[0]),T<2&&o.contains(e.vertices,w[1])&&(p[T++]=w[1])}return 0===T&&(p[T++]=x[0]),s.supportCount=T,s},r._overlapAxes=function(t,e,i,r){var s,n,a,o,h,l,u=e.length,d=i.length,c=e[0].x,f=e[0].y,p=i[0].x,g=i[0].y,m=r.length,v=Number.MAX_VALUE,y=0;for(h=0;hC?C=o:oE?E=o:op)break;if(!(gM.max.y)&&(!v||!T.isStatic&&!T.isSleeping)&&h(c.collisionFilter,T.collisionFilter)){var w=T.parts.length;if(x&&1===w)(A=l(c,T,s))&&(u[d++]=A);else for(var b=w>1?1:0,S=y>1?1:0;SM.max.x||f.max.xM.max.y||(A=l(C,_,s))&&(u[d++]=A)}}}}return u.length!==d&&(u.length=d),u},r.canCollide=function(t,e){return t.group===e.group&&0!==t.group?t.group>0:0!==(t.mask&e.category)&&0!==(e.mask&t.category)},r._compareBoundsX=function(t,e){return t.bounds.min.x-e.bounds.min.x}},4506(t,e,i){var r={};t.exports=r;var s=i(43424);r.create=function(t,e){var i=t.bodyA,n=t.bodyB,a={id:r.id(i,n),bodyA:i,bodyB:n,collision:t,contacts:[s.create(),s.create()],contactCount:0,separation:0,isActive:!0,isSensor:i.isSensor||n.isSensor,timeCreated:e,timeUpdated:e,inverseMass:0,friction:0,frictionStatic:0,restitution:0,slop:0};return r.update(a,t,e),a},r.update=function(t,e,i){var r=e.supports,s=e.supportCount,n=t.contacts,a=e.parentA,o=e.parentB;t.isActive=!0,t.timeUpdated=i,t.collision=e,t.separation=e.depth,t.inverseMass=a.inverseMass+o.inverseMass,t.friction=a.frictiono.frictionStatic?a.frictionStatic:o.frictionStatic,t.restitution=a.restitution>o.restitution?a.restitution:o.restitution,t.slop=a.slop>o.slop?a.slop:o.slop,t.contactCount=s,e.pair=t;var h=r[0],l=n[0],u=r[1],d=n[1];d.vertex!==h&&l.vertex!==u||(n[1]=l,n[0]=l=d,d=n[1]),l.vertex=h,d.vertex=u},r.setActive=function(t,e,i){e?(t.isActive=!0,t.timeUpdated=i):(t.isActive=!1,t.contactCount=0)},r.id=function(t,e){return t.id=i?d[f++]=n:(l(n,!1,i),n.collision.bodyA.sleepCounter>0&&n.collision.bodyB.sleepCounter>0?d[f++]=n:(g[x++]=n,delete u[n.id]));d.length!==f&&(d.length=f),p.length!==y&&(p.length=y),g.length!==x&&(g.length=x),m.length!==T&&(m.length=T)},r.clear=function(t){return t.table={},t.list.length=0,t.collisionStart.length=0,t.collisionActive.length=0,t.collisionEnd.length=0,t}},73296(t,e,i){var r={};t.exports=r;var s=i(31725),n=i(52284),a=i(15647),o=i(66280),h=i(41598);r.collides=function(t,e){for(var i=[],r=e.length,s=t.bounds,o=n.collides,h=a.overlaps,l=0;lH?(s=W>0?W:-W,(i=g.friction*(W>0?1:-1)*l)<-s?i=-s:i>s&&(i=s)):(i=W,s=f);var j=N*T-B*x,q=k*T-U*x,K=_/(S+v.inverseInertia*j*j+y.inverseInertia*q*q),Z=(1+g.restitution)*X*K;if(i*=K,X0&&(F.normalImpulse=0),Z=F.normalImpulse-Q}if(W<-d||W>d)F.tangentImpulse=0;else{var J=F.tangentImpulse;F.tangentImpulse+=i,F.tangentImpulse<-s&&(F.tangentImpulse=-s),F.tangentImpulse>s&&(F.tangentImpulse=s),i=F.tangentImpulse-J}var $=x*Z+w*i,tt=T*Z+b*i;v.isStatic||v.isSleeping||(v.positionPrev.x+=$*v.inverseMass,v.positionPrev.y+=tt*v.inverseMass,v.anglePrev+=(N*tt-B*$)*v.inverseInertia),y.isStatic||y.isSleeping||(y.positionPrev.x-=$*y.inverseMass,y.positionPrev.y-=tt*y.inverseMass,y.anglePrev-=(k*tt-U*$)*y.inverseInertia)}}}}},48140(t,e,i){var r={};t.exports=r;var s=i(41598),n=i(31725),a=i(53614),o=i(15647),h=i(66615),l=i(53402);r._warming=.4,r._torqueDampen=1,r._minLength=1e-6,r.create=function(t){var e=t;e.bodyA&&!e.pointA&&(e.pointA={x:0,y:0}),e.bodyB&&!e.pointB&&(e.pointB={x:0,y:0});var i=e.bodyA?n.add(e.bodyA.position,e.pointA):e.pointA,r=e.bodyB?n.add(e.bodyB.position,e.pointB):e.pointB,s=n.magnitude(n.sub(i,r));e.length=void 0!==e.length?e.length:s,e.id=e.id||l.nextId(),e.label=e.label||"Constraint",e.type="constraint",e.stiffness=e.stiffness||(e.length>0?1:.7),e.damping=e.damping||0,e.angularStiffness=e.angularStiffness||0,e.angleA=e.bodyA?e.bodyA.angle:e.angleA,e.angleB=e.bodyB?e.bodyB.angle:e.angleB,e.plugin={};var a={visible:!0,type:"line",anchors:!0,lineColor:null,lineOpacity:null,lineThickness:null,pinSize:null,anchorColor:null,anchorSize:null};return 0===e.length&&e.stiffness>.1?(a.type="pin",a.anchors=!1):e.stiffness<.9&&(a.type="spring"),e.render=l.extend(a,e.render),e},r.preSolveAll=function(t){for(var e=0;e=1||0===t.length?t.stiffness*e:t.stiffness*e*e,x=t.damping*e,T=n.mult(u,v*y),w=(i?i.inverseMass:0)+(s?s.inverseMass:0),b=w+((i?i.inverseInertia:0)+(s?s.inverseInertia:0));if(x>0){var S=n.create();p=n.div(u,d),m=n.sub(s&&n.sub(s.position,s.positionPrev)||S,i&&n.sub(i.position,i.positionPrev)||S),g=n.dot(p,m)}i&&!i.isStatic&&(f=i.inverseMass/w,i.constraintImpulse.x-=T.x*f,i.constraintImpulse.y-=T.y*f,i.position.x-=T.x*f,i.position.y-=T.y*f,x>0&&(i.positionPrev.x-=x*p.x*g*f,i.positionPrev.y-=x*p.y*g*f),c=n.cross(a,T)/b*r._torqueDampen*i.inverseInertia*(1-t.angularStiffness),i.constraintImpulse.angle-=c,i.angle-=c),s&&!s.isStatic&&(f=s.inverseMass/w,s.constraintImpulse.x+=T.x*f,s.constraintImpulse.y+=T.y*f,s.position.x+=T.x*f,s.position.y+=T.y*f,x>0&&(s.positionPrev.x+=x*p.x*g*f,s.positionPrev.y+=x*p.y*g*f),c=n.cross(o,T)/b*r._torqueDampen*s.inverseInertia*(1-t.angularStiffness),s.constraintImpulse.angle+=c,s.angle+=c)}}},r.postSolveAll=function(t){for(var e=0;e0&&(d.position.x+=l.x,d.position.y+=l.y),0!==l.angle&&(s.rotate(d.vertices,l.angle,i.position),h.rotate(d.axes,l.angle),u>0&&n.rotateAbout(d.position,l.angle,i.position,d.position)),o.update(d.bounds,d.vertices,i.velocity)}l.angle*=r._warming,l.x*=r._warming,l.y*=r._warming}}},r.pointAWorld=function(t){return{x:(t.bodyA?t.bodyA.position.x:0)+(t.pointA?t.pointA.x:0),y:(t.bodyA?t.bodyA.position.y:0)+(t.pointA?t.pointA.y:0)}},r.pointBWorld=function(t){return{x:(t.bodyB?t.bodyB.position.x:0)+(t.pointB?t.pointB.x:0),y:(t.bodyB?t.bodyB.position.y:0)+(t.pointB?t.pointB.y:0)}},r.currentLength=function(t){var e=(t.bodyA?t.bodyA.position.x:0)+(t.pointA?t.pointA.x:0),i=(t.bodyA?t.bodyA.position.y:0)+(t.pointA?t.pointA.y:0),r=e-((t.bodyB?t.bodyB.position.x:0)+(t.pointB?t.pointB.x:0)),s=i-((t.bodyB?t.bodyB.position.y:0)+(t.pointB?t.pointB.y:0));return Math.sqrt(r*r+s*s)}},53402(t,e,i){var r={};t.exports=r,function(){r._baseDelta=1e3/60,r._nextId=0,r._seed=0,r._nowStartTime=+new Date,r._warnedOnce={},r._decomp=null,r.extend=function(t,e){var i,s;"boolean"==typeof e?(i=2,s=e):(i=1,s=!0);for(var n=i;n0;e--){var i=Math.floor(r.random()*(e+1)),s=t[e];t[e]=t[i],t[i]=s}return t},r.choose=function(t){return t[Math.floor(r.random()*t.length)]},r.isElement=function(t){return"undefined"!=typeof HTMLElement?t instanceof HTMLElement:!!(t&&t.nodeType&&t.nodeName)},r.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)},r.isFunction=function(t){return"function"==typeof t},r.isPlainObject=function(t){return"object"==typeof t&&t.constructor===Object},r.isString=function(t){return"[object String]"===toString.call(t)},r.clamp=function(t,e,i){return ti?i:t},r.sign=function(t){return t<0?-1:1},r.now=function(){if("undefined"!=typeof window&&window.performance){if(window.performance.now)return window.performance.now();if(window.performance.webkitNow)return window.performance.webkitNow()}return Date.now?Date.now():new Date-r._nowStartTime},r.random=function(e,i){return i=void 0!==i?i:1,(e=void 0!==e?e:0)+t()*(i-e)};var t=function(){return r._seed=(9301*r._seed+49297)%233280,r._seed/233280};r.colorToNumber=function(t){return 3==(t=t.replace("#","")).length&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)),parseInt(t,16)},r.logLevel=1,r.log=function(){console&&r.logLevel>0&&r.logLevel<=3&&console.log.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},r.info=function(){console&&r.logLevel>0&&r.logLevel<=2&&console.info.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},r.warn=function(){console&&r.logLevel>0&&r.logLevel<=3&&console.warn.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},r.warnOnce=function(){var t=Array.prototype.slice.call(arguments).join(" ");r._warnedOnce[t]||(r.warn(t),r._warnedOnce[t]=!0)},r.deprecated=function(t,e,i){t[e]=r.chain(function(){r.warnOnce("🔅 deprecated 🔅",i)},t[e])},r.nextId=function(){return r._nextId++},r.indexOf=function(t,e){if(t.indexOf)return t.indexOf(e);for(var i=0;ir._deltaMax&&d.warnOnce("Matter.Engine.update: delta argument is recommended to be less than or equal to",r._deltaMax.toFixed(3),"ms."),e=void 0!==e?e:d._baseDelta,e*=m.timeScale,m.timestamp+=e,m.lastDelta=e;var y={timestamp:m.timestamp,delta:e};h.trigger(t,"beforeUpdate",y);var x=l.allBodies(f),T=l.allConstraints(f),w=l.allComposites(f);for(f.isModified&&(a.setBodies(p,x),l.setModified(f,!1,!1,!0)),t.enableSleeping&&s.update(x,e),r._bodiesApplyGravity(x,t.gravity),r.wrap(x,w),r.attractors(x),e>0&&r._bodiesUpdate(x,e),h.trigger(t,"beforeSolve",y),u.preSolveAll(x),i=0;i0&&h.trigger(t,"collisionStart",{pairs:g.collisionStart,timestamp:m.timestamp,delta:e});var S=d.clamp(20/t.positionIterations,0,1);for(n.preSolvePosition(g.list),i=0;i0&&h.trigger(t,"collisionActive",{pairs:g.collisionActive,timestamp:m.timestamp,delta:e}),g.collisionEnd.length>0&&h.trigger(t,"collisionEnd",{pairs:g.collisionEnd,timestamp:m.timestamp,delta:e}),r._bodiesClearForces(x),h.trigger(t,"afterUpdate",y),t.timing.lastElapsed=d.now()-c,t},r.merge=function(t,e){if(d.extend(t,e),e.world){t.world=e.world,r.clear(t);for(var i=l.allBodies(t.world),n=0;n0)for(var s=0;s0){i||(i={}),r=e.split(" ");for(var l=0;ln?(s.warn("Plugin.register:",r.toString(e),"was upgraded to",r.toString(t)),r._registry[t.name]=t):i-1},r.isFor=function(t,e){var i=t.for&&r.dependencyParse(t.for);return!t.for||e.name===i.name&&r.versionSatisfies(e.version,i.range)},r.use=function(t,e){if(t.uses=(t.uses||[]).concat(e||[]),0!==t.uses.length){for(var i=r.dependencies(t),n=s.topologicalSort(i),a=[],o=0;o0&&!h.silent&&s.info(a.join(" "))}else s.warn("Plugin.use:",r.toString(t),"does not specify any dependencies to install.")},r.dependencies=function(t,e){var i=r.dependencyParse(t),n=i.name;if(!(n in(e=e||{}))){t=r.resolve(t)||t,e[n]=s.map(t.uses||[],function(e){r.isPlugin(e)&&r.register(e);var n=r.dependencyParse(e),a=r.resolve(e);return a&&!r.versionSatisfies(a.version,n.range)?(s.warn("Plugin.dependencies:",r.toString(a),"does not satisfy",r.toString(n),"used by",r.toString(i)+"."),a._warned=!0,t._warned=!0):a||(s.warn("Plugin.dependencies:",r.toString(e),"used by",r.toString(i),"could not be resolved."),t._warned=!0),n.name});for(var a=0;a=|>)?\s*((\d+)\.(\d+)\.(\d+))(-[0-9A-Za-z-+]+)?$/;e.test(t)||s.warn("Plugin.versionParse:",t,"is not a valid version or range.");var i=e.exec(t),r=Number(i[4]),n=Number(i[5]),a=Number(i[6]);return{isRange:Boolean(i[1]||i[2]),version:i[3],range:t,operator:i[1]||i[2]||"",major:r,minor:n,patch:a,parts:[r,n,a],prerelease:i[7],number:1e8*r+1e4*n+a}},r.versionSatisfies=function(t,e){e=e||"*";var i=r.versionParse(e),s=r.versionParse(t);if(i.isRange){if("*"===i.operator||"*"===t)return!0;if(">"===i.operator)return s.number>i.number;if(">="===i.operator)return s.number>=i.number;if("~"===i.operator)return s.major===i.major&&s.minor===i.minor&&s.patch>=i.patch;if("^"===i.operator)return i.major>0?s.major===i.major&&s.number>=i.number:i.minor>0?s.minor===i.minor&&s.patch>=i.patch:s.patch===i.patch}return t===e||"*"===t}},13037(t,e,i){var r={};t.exports=r;var s=i(35810),n=i(48413),a=i(53402);!function(){r._maxFrameDelta=1e3/15,r._frameDeltaFallback=1e3/60,r._timeBufferMargin=1.5,r._elapsedNextEstimate=1,r._smoothingLowerBound=.1,r._smoothingUpperBound=.9,r.create=function(t){var e=a.extend({delta:1e3/60,frameDelta:null,frameDeltaSmoothing:!0,frameDeltaSnapping:!0,frameDeltaHistory:[],frameDeltaHistorySize:100,frameRequestId:null,timeBuffer:0,timeLastTick:null,maxUpdates:null,maxFrameTime:1e3/30,lastUpdatesDeferred:0,enabled:!0},t);return e.fps=0,e},r.run=function(t,e){return t.timeBuffer=r._frameDeltaFallback,function i(s){t.frameRequestId=r._onNextFrame(t,i),s&&t.enabled&&r.tick(t,e,s)}(),t},r.tick=function(e,i,o){var h=a.now(),l=e.delta,u=0,d=o-e.timeLastTick;if((!d||!e.timeLastTick||d>Math.max(r._maxFrameDelta,e.maxFrameTime))&&(d=e.frameDelta||r._frameDeltaFallback),e.frameDeltaSmoothing){e.frameDeltaHistory.push(d),e.frameDeltaHistory=e.frameDeltaHistory.slice(-e.frameDeltaHistorySize);var c=e.frameDeltaHistory.slice(0).sort(),f=e.frameDeltaHistory.slice(c.length*r._smoothingLowerBound,c.length*r._smoothingUpperBound);d=t(f)||d}e.frameDeltaSnapping&&(d=1e3/Math.round(1e3/d)),e.frameDelta=d,e.timeLastTick=o,e.timeBuffer+=e.frameDelta,e.timeBuffer=a.clamp(e.timeBuffer,0,e.frameDelta+l*r._timeBufferMargin),e.lastUpdatesDeferred=0;var p=e.maxUpdates||Math.ceil(e.maxFrameTime/l),g={timestamp:i.timing.timestamp};s.trigger(e,"beforeTick",g),s.trigger(e,"tick",g);for(var m=a.now();l>0&&e.timeBuffer>=l*r._timeBufferMargin;){s.trigger(e,"beforeUpdate",g),n.update(i,l),s.trigger(e,"afterUpdate",g),e.timeBuffer-=l,u+=1;var v=a.now()-h,y=a.now()-m,x=v+r._elapsedNextEstimate*y/u;if(u>=p||x>e.maxFrameTime){e.lastUpdatesDeferred=Math.round(Math.max(0,e.timeBuffer/l-r._timeBufferMargin));break}}i.timing.lastUpdatesPerFrame=u,s.trigger(e,"afterTick",g),e.frameDeltaHistory.length>=100&&(e.lastUpdatesDeferred&&Math.round(e.frameDelta/l)>p?a.warnOnce("Matter.Runner: runner reached runner.maxUpdates, see docs."):e.lastUpdatesDeferred&&a.warnOnce("Matter.Runner: runner reached runner.maxFrameTime, see docs."),void 0!==e.isFixed&&a.warnOnce("Matter.Runner: runner.isFixed is now redundant, see docs."),(e.deltaMin||e.deltaMax)&&a.warnOnce("Matter.Runner: runner.deltaMin and runner.deltaMax were removed, see docs."),0!==e.fps&&a.warnOnce("Matter.Runner: runner.fps was replaced by runner.delta, see docs."))},r.stop=function(t){r._cancelNextFrame(t)},r._onNextFrame=function(t,e){if("undefined"==typeof window||!window.requestAnimationFrame)throw new Error("Matter.Runner: missing required global window.requestAnimationFrame.");return t.frameRequestId=window.requestAnimationFrame(e),t.frameRequestId},r._cancelNextFrame=function(t){if("undefined"==typeof window||!window.cancelAnimationFrame)throw new Error("Matter.Runner: missing required global window.cancelAnimationFrame.");window.cancelAnimationFrame(t.frameRequestId)};var t=function(t){for(var e=0,i=t.length,r=0;r0&&h.motion=h.sleepThreshold/i&&r.set(h,!0)):h.sleepCounter>0&&(h.sleepCounter-=1)}else r.set(h,!1)}},r.afterCollisions=function(t){for(var e=r._motionSleepThreshold,i=0;ie&&r.set(h,!1)}}}},r.set=function(t,e){var i=t.isSleeping;e?(t.isSleeping=!0,t.sleepCounter=t.sleepThreshold,t.positionImpulse.x=0,t.positionImpulse.y=0,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.anglePrev=t.angle,t.speed=0,t.angularSpeed=0,t.motion=0,i||n.trigger(t,"sleepStart")):(t.isSleeping=!1,t.sleepCounter=0,i&&n.trigger(t,"sleepEnd"))}},66280(t,e,i){var r={};t.exports=r;var s=i(41598),n=i(53402),a=i(22562),o=i(15647),h=i(31725);r.rectangle=function(t,e,i,r,o){o=o||{};var h={label:"Rectangle Body",position:{x:t,y:e},vertices:s.fromPath("L 0 0 L "+i+" 0 L "+i+" "+r+" L 0 "+r)};if(o.chamfer){var l=o.chamfer;h.vertices=s.chamfer(h.vertices,l.radius,l.quality,l.qualityMin,l.qualityMax),delete o.chamfer}return a.create(n.extend({},h,o))},r.trapezoid=function(t,e,i,r,o,h){h=h||{},o>=1&&n.warn("Bodies.trapezoid: slope parameter must be < 1.");var l,u=i*(o*=.5),d=u+(1-2*o)*i,c=d+u;l=o<.5?"L 0 0 L "+u+" "+-r+" L "+d+" "+-r+" L "+c+" 0":"L 0 0 L "+d+" "+-r+" L "+c+" 0";var f={label:"Trapezoid Body",position:{x:t,y:e},vertices:s.fromPath(l)};if(h.chamfer){var p=h.chamfer;f.vertices=s.chamfer(f.vertices,p.radius,p.quality,p.qualityMin,p.qualityMax),delete h.chamfer}return a.create(n.extend({},f,h))},r.circle=function(t,e,i,s,a){s=s||{};var o={label:"Circle Body",circleRadius:i};a=a||25;var h=Math.ceil(Math.max(10,Math.min(a,i)));return h%2==1&&(h+=1),r.polygon(t,e,h,i,n.extend({},o,s))},r.polygon=function(t,e,i,o,h){if(h=h||{},i<3)return r.circle(t,e,o,h);for(var l=2*Math.PI/i,u="",d=.5*l,c=0;c0&&s.area(A)1?(p=a.create(n.extend({parts:g.slice(0)},r)),a.setPosition(p,{x:t,y:e}),p):g[0]},r.flagCoincidentParts=function(t,e){void 0===e&&(e=5);for(var i=0;ig&&(g=y),o.translate(v,{x:.5*x,y:.5*y}),d=v.bounds.max.x+n,s.addBody(u,v),l=v,f+=1}else d+=n}c+=g+a,d=t}return u},r.chain=function(t,e,i,r,o,h){for(var l=t.bodies,u=1;u0)for(l=0;l0&&(c=f[l-1+(h-1)*e],s.addConstraint(t,n.create(a.extend({bodyA:c,bodyB:d},o)))),r&&lc||a<(l=c-l)||a>i-1-l))return 1===d&&o.translate(u,{x:(a+(i%2==1?1:-1))*f,y:0}),h(t+(u?a*f:0)+a*n,r,a,l,u,d)})},r.newtonsCradle=function(t,e,i,r,a){for(var o=s.create({label:"Newtons Cradle"}),l=0;lt.max.x&&(t.max.x=s.x),s.xt.max.y&&(t.max.y=s.y),s.y0?t.max.x+=i.x:t.min.x+=i.x,i.y>0?t.max.y+=i.y:t.min.y+=i.y)},e.contains=function(t,e){return e.x>=t.min.x&&e.x<=t.max.x&&e.y>=t.min.y&&e.y<=t.max.y},e.overlaps=function(t,e){return t.min.x<=e.max.x&&t.max.x>=e.min.x&&t.max.y>=e.min.y&&t.min.y<=e.max.y},e.translate=function(t,e){t.min.x+=e.x,t.max.x+=e.x,t.min.y+=e.y,t.max.y+=e.y},e.shift=function(t,e){var i=t.max.x-t.min.x,r=t.max.y-t.min.y;t.min.x=e.x,t.max.x=e.x+i,t.min.y=e.y,t.max.y=e.y+r},e.wrap=function(t,e,i){var r=null,s=null;if(void 0!==e.min.x&&void 0!==e.max.x&&(t.min.x>e.max.x?r=e.min.x-t.max.x:t.max.xe.max.y?s=e.min.y-t.max.y:t.max.y1;if(!c||t!=c.x||e!=c.y){c&&r?(f=c.x,p=c.y):(f=0,p=0);var s={x:f+t,y:p+e};!r&&c||(c=s),g.push(s),v=f+t,y=p+e}},T=function(t){var e=t.pathSegTypeAsLetter.toUpperCase();if("Z"!==e){switch(e){case"M":case"L":case"T":case"C":case"S":case"Q":v=t.x,y=t.y;break;case"H":v=t.x;break;case"V":y=t.y}x(v,y,t.pathSegType)}};for(r._svgPathToAbsolute(t),a=t.getTotalLength(),l=[],i=0;i0)return!1;a=i}return!0},r.scale=function(t,e,i,n){if(1===e&&1===i)return t;var a,o;n=n||r.centre(t);for(var h=0;h=0?h-1:t.length-1],u=t[h],d=t[(h+1)%t.length],c=e[h0&&(n|=2),3===n)return!1;return 0!==n||null},r.hull=function(t){var e,i,r=[],n=[];for((t=t.slice(0)).sort(function(t,e){var i=t.x-e.x;return 0!==i?i:t.y-e.y}),i=0;i=2&&s.cross3(n[n.length-2],n[n.length-1],e)<=0;)n.pop();n.push(e)}for(i=t.length-1;i>=0;i-=1){for(e=t[i];r.length>=2&&s.cross3(r[r.length-2],r[r.length-1],e)<=0;)r.pop();r.push(e)}return r.pop(),n.pop(),r.concat(n)}},55973(t){function e(t,e,i){i=i||0;var r,s,n,a,o,h,l,u=[0,0];return r=t[1][1]-t[0][1],s=t[0][0]-t[1][0],n=r*t[0][0]+s*t[0][1],a=e[1][1]-e[0][1],o=e[0][0]-e[1][0],h=a*e[0][0]+o*e[0][1],S(l=r*o-a*s,0,i)||(u[0]=(o*n-s*h)/l,u[1]=(r*h-a*n)/l),u}function i(t,e,i,r){var s=e[0]-t[0],n=e[1]-t[1],a=r[0]-i[0],o=r[1]-i[1];if(a*n-o*s===0)return!1;var h=(s*(i[1]-t[1])+n*(t[0]-i[0]))/(a*n-o*s),l=(a*(t[1]-i[1])+o*(i[0]-t[0]))/(o*s-a*n);return h>=0&&h<=1&&l>=0&&l<=1}function r(t,e,i){return(e[0]-t[0])*(i[1]-t[1])-(i[0]-t[0])*(e[1]-t[1])}function s(t,e,i){return r(t,e,i)>0}function n(t,e,i){return r(t,e,i)>=0}function a(t,e,i){return r(t,e,i)<0}function o(t,e,i){return r(t,e,i)<=0}t.exports={decomp:function(t){var e=T(t);return e.length>0?w(t,e):[t]},quickDecomp:function t(e,i,r,h,l,u,g){u=u||100,g=g||0,l=l||25,i=void 0!==i?i:[],r=r||[],h=h||[];var m=[0,0],v=[0,0],x=[0,0],T=0,w=0,S=0,C=0,E=0,A=0,_=0,M=[],R=[],P=e,O=e;if(O.length<3)return i;if(++g>u)return console.warn("quickDecomp: max level ("+u+") reached."),i;for(var L=0;LE&&(E+=e.length),C=Number.MAX_VALUE,E3&&r>=0;--r)u(c(t,r-1),c(t,r),c(t,r+1),e)&&(t.splice(r%t.length,1),i++);return i},removeDuplicatePoints:function(t,e){for(var i=t.length-1;i>=1;--i)for(var r=t[i],s=i-1;s>=0;--s)C(r,t[s],e)&&t.splice(i,1)},makeCCW:function(t){for(var e=0,i=t,r=1;ri[e][0])&&(e=r);return!s(c(t,e-1),c(t,e),c(t,e+1))&&(function(t){for(var e=[],i=t.length,r=0;r!==i;r++)e.push(t.pop());for(r=0;r!==i;r++)t[r]=e[r]}(t),!0)}};var h=[],l=[];function u(t,e,i,s){if(s){var n=h,a=l;n[0]=e[0]-t[0],n[1]=e[1]-t[1],a[0]=i[0]-e[0],a[1]=i[1]-e[1];var o=n[0]*a[0]+n[1]*a[1],u=Math.sqrt(n[0]*n[0]+n[1]*n[1]),d=Math.sqrt(a[0]*a[0]+a[1]*a[1]);return Math.acos(o/(u*d)){const o=this.getVideoPlaybackQuality(),h=this.mozPresentedFrames||this.mozPaintedFrames||o.totalVideoFrames-o.droppedVideoFrames;if(h>r){const r=this.mozFrameDelay||o.totalFrameDelay-i.totalFrameDelay||0,s=a-n;t(a,{presentationTime:a+1e3*r,expectedDisplayTime:a+s,width:this.videoWidth,height:this.videoHeight,mediaTime:Math.max(0,this.currentTime||0)+s/1e3,presentedFrames:h,processingDuration:r}),delete this._rvfcpolyfillmap[e]}else this._rvfcpolyfillmap[e]=requestAnimationFrame(t=>s(a,t))};return this._rvfcpolyfillmap[e]=requestAnimationFrame(t=>s(e,t)),e},HTMLVideoElement.prototype.cancelVideoFrameCallback=function(t){cancelAnimationFrame(this._rvfcpolyfillmap[t]),delete this._rvfcpolyfillmap[t]})},10312(t){t.exports={SKIP_CHECK:-1,NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16,ERASE:17,SOURCE_IN:18,SOURCE_OUT:19,SOURCE_ATOP:20,DESTINATION_OVER:21,DESTINATION_IN:22,DESTINATION_OUT:23,DESTINATION_ATOP:24,LIGHTER:25,COPY:26,XOR:27}},29795(t){t.exports={DEFAULT:0,LINEAR:0,NEAREST:1}},84322(t){t.exports={MULTIPLY:0,FILL:1,ADD:2,SCREEN:4,OVERLAY:5,HARD_LIGHT:6}},68627(t,e,i){var r=i(19715),s=i(32880),n=i(83419),a=i(8054),o=i(50792),h=i(92503),l=i(56373),u=i(97480),d=i(69442),c=i(8443),f=i(61340),p=new n({Extends:o,initialize:function(t){o.call(this);var e=t.config;this.config={clearBeforeRender:e.clearBeforeRender,backgroundColor:e.backgroundColor,antialias:e.antialias,roundPixels:e.roundPixels,transparent:e.transparent},this.game=t,this.type=a.CANVAS,this.drawCount=0,this.width=0,this.height=0,this.gameCanvas=t.canvas;var i={alpha:e.transparent,desynchronized:e.desynchronized,willReadFrequently:!1};this.gameContext=e.context?e.context:this.gameCanvas.getContext("2d",i),this.currentContext=this.gameContext,this.antialias=e.antialias,this.blendModes=l(),this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92},this._tempMatrix1=new f,this._tempMatrix2=new f,this._tempMatrix3=new f,this.isBooted=!1,this.init()},init:function(){var t=this.game;t.events.once(c.BOOT,function(){var t=this.config;if(!t.transparent){var e=this.gameContext,i=this.gameCanvas;e.fillStyle=t.backgroundColor.rgba,e.fillRect(0,0,i.width,i.height)}},this),t.textures.once(d.READY,this.boot,this)},boot:function(){var t=this.game,e=t.scale.baseSize;this.width=e.width,this.height=e.height,this.isBooted=!0,t.scale.on(u.RESIZE,this.onResize,this),this.resize(e.width,e.height)},onResize:function(t,e){e.width===this.width&&e.height===this.height||this.resize(e.width,e.height)},resize:function(t,e){this.width=t,this.height=e,this.emit(h.RESIZE,t,e)},resetTransform:function(){this.currentContext.setTransform(1,0,0,1,0,0)},setBlendMode:function(t){return this.currentContext.globalCompositeOperation=t,this},setContext:function(t){return this.currentContext=t||this.gameContext,this},setAlpha:function(t){return this.currentContext.globalAlpha=t,this},preRender:function(){var t=this.gameContext,e=this.config,i=this.width,r=this.height;t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),this.emit(h.PRE_RENDER_CLEAR),e.clearBeforeRender&&(t.clearRect(0,0,i,r),e.transparent||(t.fillStyle=e.backgroundColor.rgba,t.fillRect(0,0,i,r))),t.save(),this.drawCount=0,this.emit(h.PRE_RENDER)},render:function(t,e,i){var s=e.length;this.emit(h.RENDER,t,i);var n=i.x,a=i.y,o=i.width,l=i.height,u=i.renderToTexture?i.context:t.sys.context;u.save(),this.game.scene.customViewports&&(u.beginPath(),u.rect(n,a,o,l),u.clip()),i.emit(r.PRE_RENDER,i),this.currentContext=u;var d=i.mask;d&&d.preRenderCanvas(this,null,i._maskCamera),i.transparent||(u.fillStyle=i.backgroundColor.rgba,u.fillRect(n,a,o,l)),u.globalAlpha=i.alpha,u.globalCompositeOperation="source-over",this.drawCount+=s,i.renderToTexture&&i.emit(r.PRE_RENDER,i),i.matrix.copyToContext(u);for(var c=0;c=0?v=-(v+d):v<0&&(v=Math.abs(v)-d)),t.flipY&&(y>=0?y=-(y+c):y<0&&(y=Math.abs(y)-c))}var T=1,w=1;t.flipX&&(f||(v+=-e.realWidth+2*g),T=-1),t.flipY&&(f||(y+=-e.realHeight+2*m),w=-1);var b=t.x,S=t.y;if(i.roundPixels&&(b=Math.floor(b),S=Math.floor(S)),o.applyITRS(b,S,t.rotation,t.scaleX*T,t.scaleY*w),a.copyWithScrollFactorFrom(i.matrixCombined,i.scrollX,i.scrollY,t.scrollFactorX,t.scrollFactorY),r&&a.multiply(r),a.multiply(o),i.renderRoundPixels&&(a.e=Math.floor(a.e+.5),a.f=Math.floor(a.f+.5)),n.save(),a.setToContext(n),n.globalCompositeOperation=this.blendModes[t.blendMode],n.globalAlpha=s,n.imageSmoothingEnabled=!e.source.scaleMode,t.mask&&t.mask.preRenderCanvas(this,t,i),d>0&&c>0){var C=d/p,E=c/p;i.roundPixels&&(v=Math.floor(v+.5),y=Math.floor(y+.5),C+=.5,E+=.5),n.drawImage(e.source.image,l,u,d,c,v,y,C,E)}t.mask&&t.mask.postRenderCanvas(this,t,i),n.restore()}},destroy:function(){this.removeAllListeners(),this.game=null,this.gameCanvas=null,this.gameContext=null}});t.exports=p},55830(t,e,i){t.exports={CanvasRenderer:i(68627),GetBlendModes:i(56373),SetTransform:i(20926)}},56373(t,e,i){var r=i(10312),s=i(89289);t.exports=function(){var t=[],e=s.supportNewBlendModes,i="source-over";return t[r.NORMAL]=i,t[r.ADD]="lighter",t[r.MULTIPLY]=e?"multiply":i,t[r.SCREEN]=e?"screen":i,t[r.OVERLAY]=e?"overlay":i,t[r.DARKEN]=e?"darken":i,t[r.LIGHTEN]=e?"lighten":i,t[r.COLOR_DODGE]=e?"color-dodge":i,t[r.COLOR_BURN]=e?"color-burn":i,t[r.HARD_LIGHT]=e?"hard-light":i,t[r.SOFT_LIGHT]=e?"soft-light":i,t[r.DIFFERENCE]=e?"difference":i,t[r.EXCLUSION]=e?"exclusion":i,t[r.HUE]=e?"hue":i,t[r.SATURATION]=e?"saturation":i,t[r.COLOR]=e?"color":i,t[r.LUMINOSITY]=e?"luminosity":i,t[r.ERASE]="destination-out",t[r.SOURCE_IN]="source-in",t[r.SOURCE_OUT]="source-out",t[r.SOURCE_ATOP]="source-atop",t[r.DESTINATION_OVER]="destination-over",t[r.DESTINATION_IN]="destination-in",t[r.DESTINATION_OUT]="destination-out",t[r.DESTINATION_ATOP]="destination-atop",t[r.LIGHTER]="lighter",t[r.COPY]="copy",t[r.XOR]="xor",t}},20926(t,e,i){var r=i(91296);t.exports=function(t,e,i,s,n){var a=s.alpha*i.alpha;if(a<=0)return!1;var o=r(i,s,n).calc;return e.globalCompositeOperation=t.blendModes[i.blendMode],e.globalAlpha=a,e.save(),o.setToContext(e),e.imageSmoothingEnabled=i.frame?!i.frame.source.scaleMode:t.antialias,!0}},63899(t){t.exports="losewebgl"},6119(t){t.exports="postrender"},31124(t){t.exports="prerenderclear"},48070(t){t.exports="prerender"},15640(t){t.exports="render"},8912(t){t.exports="resize"},87124(t){t.exports="restorewebgl"},53998(t){t.exports="setparalleltextureunits"},92503(t,e,i){t.exports={LOSE_WEBGL:i(63899),POST_RENDER:i(6119),PRE_RENDER:i(48070),PRE_RENDER_CLEAR:i(31124),RENDER:i(15640),RESIZE:i(8912),RESTORE_WEBGL:i(87124),SET_PARALLEL_TEXTURE_UNITS:i(53998)}},36909(t,e,i){t.exports={Events:i(92503),Snapshot:i(89966)},t.exports.Canvas=i(55830),t.exports.WebGL=i(4159)},32880(t,e,i){var r=i(27919),s=i(40987),n=i(95540);t.exports=function(t,e){var i=n(e,"callback"),a=n(e,"type","image/png"),o=n(e,"encoder",.92),h=Math.abs(Math.round(n(e,"x",0))),l=Math.abs(Math.round(n(e,"y",0))),u=Math.floor(n(e,"width",t.width)),d=Math.floor(n(e,"height",t.height));if(n(e,"getPixel",!1)){var c=t.getContext("2d",{willReadFrequently:!1}).getImageData(h,l,1,1).data;i.call(null,new s(c[0],c[1],c[2],c[3]))}else if(0!==h||0!==l||u!==t.width||d!==t.height){var f=r.createWebGL(this,u,d),p=f.getContext("2d",{willReadFrequently:!0});u>0&&d>0&&p.drawImage(t,h,l,u,d,0,0,u,d);var g=new Image;g.onerror=function(){i.call(null),r.remove(f)},g.onload=function(){i.call(null,g),r.remove(f)},g.src=f.toDataURL(a,o)}else{var m=new Image;m.onerror=function(){i.call(null)},m.onload=function(){i.call(null,m)},m.src=t.toDataURL(a,o)}}},88815(t,e,i){var r=i(27919),s=i(40987),n=i(95540);t.exports=function(t,e){var i=t,a=n(e,"callback"),o=n(e,"type","image/png"),h=n(e,"encoder",.92),l=Math.abs(Math.round(n(e,"x",0))),u=Math.abs(Math.round(n(e,"y",0))),d=n(e,"getPixel",!1),c=n(e,"isFramebuffer",!1),f=c?n(e,"bufferWidth",1):i.drawingBufferWidth,p=c?n(e,"bufferHeight",1):i.drawingBufferHeight;if(d){var g=new Uint8Array(4),m=p-u-1;i.readPixels(l,m,1,1,i.RGBA,i.UNSIGNED_BYTE,g),a.call(null,new s(g[0],g[1],g[2],g[3]))}else{var v=Math.floor(n(e,"width",f)),y=Math.floor(n(e,"height",p)),x=new Uint8Array(v*y*4);i.readPixels(l,p-u-y,v,y,i.RGBA,i.UNSIGNED_BYTE,x);for(var T=r.createWebGL(this,v,y),w=T.getContext("2d",{willReadFrequently:!0}),b=w.getImageData(0,0,v,y),S=b.data,C=0;C0},beginDraw:function(){this.framebuffer&&this.renderer.glTextureUnits.unbindTexture(this.texture),this.renderer.glWrapper.update(this.state)},clear:function(t){this.beginDraw(),void 0===t&&(t=this.autoClear),this.renderer.renderNodes.finishBatch(),this.renderer.gl.clear(t)},destroy:function(){this.renderer.deleteTexture(this.texture),this.renderer.deleteFramebuffer(this.state.bindings.framebuffer),this.renderer=null,this.camera=null,this.state=null,this.framebuffer=null,this.texture=null}});t.exports=s},65656(t,e,i){var r=i(83419),s=i(87774),n=new r({initialize:function(t,e,i){this.renderer=t,this.maxAge=e,this.maxPoolSize=i,this.agePool=[],this.sizePool={}},add:function(t){if(-1===this.agePool.indexOf(t)){var e=t.width+"x"+t.height;this.sizePool[e]?this.sizePool[e].push(t):this.sizePool[e]=[t],this.agePool.push(t)}},get:function(t,e){var i,r,n=this.renderer;void 0===t&&(t=n.width),void 0===e&&(e=n.height);var a=n.getMaxTextureSize();t>a&&(t=a),e>a&&(e=a);var o=t+"x"+e,h=this.sizePool[o];if(h&&h.length>0)return i=h.pop(),r=this.agePool.indexOf(i),this.agePool.splice(r,1),i;if(this.agePool.length>0){var l=Date.now(),u=this.maxAge;if(l-(i=this.agePool[0]).lastUsed>u){this.agePool.shift();var d=i.width+"x"+i.height;return r=(h=this.sizePool[d]).indexOf(i),h.splice(r,1),i.resize(t,e),i}}return this.agePool.length0)for(var r=e.splice(0,i),s=0;s0){r+="_";for(var s=0;s0&&(r+="__",r+=i.sort().join("_")),r},createShaderProgram:function(t,e,i,r){var s=e.vertexShader,n=e.fragmentShader;if(s=s.replace(/\r/g,""),n=n.replace(/\r/g,""),i){for(var a,o,h={},l=0;l>>0},getTintAppendFloatAlpha:function(t,e){return((255*e&255)<<24|t)>>>0},getTintAppendFloatAlphaAndSwap:function(t,e){return((255*e&255)<<24|(255&t)<<16|(t>>8&255)<<8|t>>16&255)>>>0},getFloatsFromUintRGB:function(t){return[(t>>16&255)/255,(t>>8&255)/255,(255&t)/255]},checkShaderMax:function(t,e){var i=Math.min(16,t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS));return e&&-1!==e?Math.min(i,e):i},updateLightingUniforms:function(t,e,i,s,n,a,o,h){var l=e.camera,u=l.scene.sys.lights;if(u&&u.active){var d=u.getLights(l),c=d.length,f=u.ambientColor,p=e.height;if(t){i.setUniform("uNormSampler",s),i.setUniform("uCamera",[l.x,l.y,l.rotation,l.zoom]),i.setUniform("uAmbientLightColor",[f.r,f.g,f.b]),i.setUniform("uLightCount",c);for(var g=new r,m=0;m-1?t.getExtension(r):null,e.config.skipUnreadyShaders){var s="KHR_parallel_shader_compile";this.parallelShaderCompileExtension=i.indexOf(s)>-1?t.getExtension(s):null,this.parallelShaderCompileExtension||(e.config.skipUnreadyShaders=!1)}var n="OES_vertex_array_object";this.vaoExtension=i.indexOf(n)>-1?t.getExtension(n):null;var a="OES_standard_derivatives";if(this.standardDerivativesExtension=i.indexOf(a)>-1?t.getExtension(a):null,t instanceof WebGLRenderingContext){if(!this.instancedArraysExtension)throw new Error("ANGLE_instanced_arrays extension not supported. Required for rendering.");if(t.vertexAttribDivisor=this.instancedArraysExtension.vertexAttribDivisorANGLE.bind(this.instancedArraysExtension),t.drawArraysInstanced=this.instancedArraysExtension.drawArraysInstancedANGLE.bind(this.instancedArraysExtension),t.drawElementsInstanced=this.instancedArraysExtension.drawElementsInstancedANGLE.bind(this.instancedArraysExtension),!this.vaoExtension)throw new Error("OES_vertex_array_object extension not supported. Required for rendering.");if(t.createVertexArray=this.vaoExtension.createVertexArrayOES.bind(this.vaoExtension),t.bindVertexArray=this.vaoExtension.bindVertexArrayOES.bind(this.vaoExtension),t.deleteVertexArray=this.vaoExtension.deleteVertexArrayOES.bind(this.vaoExtension),t.isVertexArray=this.vaoExtension.isVertexArrayOES.bind(this.vaoExtension),this.standardDerivativesExtension)t.FRAGMENT_SHADER_DERIVATIVE_HINT=this.standardDerivativesExtension.FRAGMENT_SHADER_DERIVATIVE_HINT_OES;else if(e.config.smoothPixelArt)throw new Error("OES_standard_derivatives extension not supported. Cannot use smoothPixelArt.")}},setContextHandlers:function(t,e){this.previousContextLostHandler&&this.canvas.removeEventListener("webglcontextlost",this.previousContextLostHandler,!1),this.previousContextRestoredHandler&&this.canvas.removeEventListener("webglcontextrestored",this.previousContextRestoredHandler,!1),this.contextLostHandler="function"==typeof t?t.bind(this):this.dispatchContextLost.bind(this),this.contextRestoredHandler="function"==typeof e?e.bind(this):this.dispatchContextRestored.bind(this),this.canvas.addEventListener("webglcontextlost",this.contextLostHandler,!1),this.canvas.addEventListener("webglcontextrestored",this.contextRestoredHandler,!1),this.previousContextLostHandler=this.contextLostHandler,this.previousContextRestoredHandler=this.contextRestoredHandler},dispatchContextLost:function(t){this.contextLost=!0,console&&console.warn("WebGL Context lost. Renderer disabled"),this.emit(h.LOSE_WEBGL,this),t.preventDefault()},dispatchContextRestored:function(t){if(this.gl.isContextLost())console&&console.log("WebGL Context restored, but context is still lost");else{this.setExtensions(),this.glWrapper.update(A.getDefault(this),!0),this.glTextureUnits.init(),this.compression=this.getCompressedTextures();var e=function(t){t.createResource()};r(this.glTextureWrappers,e),r(this.glBufferWrappers,e),r(this.glFramebufferWrappers,e),r(this.glProgramWrappers,e),r(this.glVAOWrappers,e),this.glTextureUnits.bindUnits(this.glTextureUnits.units,!0),this.resize(this.game.scale.baseSize.width,this.game.scale.baseSize.height),this.contextLost=!1,console&&console.warn("WebGL Context restored. Renderer running again."),this.emit(h.RESTORE_WEBGL,this),t.preventDefault()}},captureFrame:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1)},captureNextFrame:function(){P},getFps:function(){P},log:function(){},startCapture:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=!1),void 0===i&&(i=!1)},stopCapture:function(){P},onCapture:function(t){},onResize:function(t,e){e.width===this.width&&e.height===this.height||this.resize(e.width,e.height)},resize:function(t,e){var i=this.gl;return this.width=t,this.height=e,this.setProjectionMatrix(t,e),this.drawingBufferHeight=i.drawingBufferHeight,this.glWrapper.update({scissor:{box:[0,i.drawingBufferHeight-e,t,e]},viewport:[0,0,t,e]}),this.emit(h.RESIZE,t,e),this},getCompressedTextures:function(){var t="WEBGL_compressed_texture_",e="WEBKIT_"+t,i=function(i,r){var s=i.getExtension(t+r)||i.getExtension(e+r)||i.getExtension("EXT_texture_compression_"+r);if(s){var n={};for(var a in s)n[s[a]]=a;return n}},r=this.gl;return{ETC:i(r,"etc"),ETC1:i(r,"etc1"),ATC:i(r,"atc"),ASTC:i(r,"astc"),BPTC:i(r,"bptc"),RGTC:i(r,"rgtc"),PVRTC:i(r,"pvrtc"),S3TC:i(r,"s3tc"),S3TCSRGB:i(r,"s3tc_srgb"),IMG:!0}},getCompressedTextureName:function(t,e){var i=this.compression[t.toUpperCase()];if(e in i)return i[e]},supportsCompressedTexture:function(t,e){var i=this.compression[t.toUpperCase()];return!!i&&(!e||e in i)},getAspectRatio:function(){return this.width/this.height},setProjectionMatrix:function(t,e,i){return t===this.projectionWidth&&e===this.projectionHeight&&i===this.projectionFlipY||(this.projectionWidth=t,this.projectionHeight=e,this.projectionFlipY=!!i,i?this.projectionMatrix.ortho(0,t,0,e,-1e3,1e3):this.projectionMatrix.ortho(0,t,e,0,-1e3,1e3)),this},setProjectionMatrixFromDrawingContext:function(t){return this.setProjectionMatrix(t.width,t.height,!1)},resetProjectionMatrix:function(){return this.setProjectionMatrix(this.width,this.height)},hasExtension:function(t){return!!this.supportedExtensions&&this.supportedExtensions.indexOf(t)},getExtension:function(t){return this.hasExtension(t)?(t in this.extensions||(this.extensions[t]=this.gl.getExtension(t)),this.extensions[t]):null},addBlendMode:function(t,e){return this.blendModes.push(E.createCombined(this,!0,void 0,e,t[0],t[1]))-1-1},updateBlendMode:function(t,e,i){if(t>17&&this.blendModes[t]){var r=this.blendModes[t];2===e.length?r.func=[e[0],e[1],e[0],e[1]]:r.func=[e[0],e[1],e[2],e[3]],r.equation="number"==typeof i?[i,i]:[i[0],i[1]]}return this},removeBlendMode:function(t){return t>17&&this.blendModes[t]&&this.blendModes.splice(t,1),this},clearFramebuffer:function(t,e,i){var r=this.gl,s=0;t&&(this.glWrapper.updateColorClearValue({colorClearValue:t}),s|=r.COLOR_BUFFER_BIT),void 0!==e&&(this.glWrapper.updateStencilClear({stencil:{clear:e}}),s|=r.STENCIL_BUFFER_BIT),void 0!==i&&(s|=r.DEPTH_BUFFER_BIT),r.clear(s)},createTextureFromSource:function(t,e,i,r,s,n){void 0===s&&(s=!1);var o=this.gl,h=o.NEAREST,u=o.NEAREST,d=o.CLAMP_TO_EDGE;e=t?t.width:e,i=t?t.height:i;var c=l(e,i);if(c&&!s&&(d=o.REPEAT),r===a.ScaleModes.LINEAR&&this.config.antialias){var f=t&&t.compressed,p=!f&&c||f&&t.mipmaps.length>1;h=this.mipmapFilter&&p?this.mipmapFilter:o.LINEAR,u=o.LINEAR}return t||"number"!=typeof e||"number"!=typeof i?this.createTexture2D(0,h,u,d,d,o.RGBA,t,void 0,void 0,void 0,void 0,n):this.createTexture2D(0,h,u,d,d,o.RGBA,null,e,i,void 0,void 0,n)},createTexture2D:function(t,e,i,r,s,n,a,o,h,l,u,d){"number"!=typeof o&&(o=a?a.width:1),"number"!=typeof h&&(h=a?a.height:1);var c=new w(this,t,e,i,r,s,n,a,o,h,l,u,d);return this.glTextureWrappers.push(c),c},createFramebuffer:function(t,e,i){Array.isArray(t)||null===t||(t=[t]);var r=new S(this,t,e,i);return this.glFramebufferWrappers.push(r),r},createProgram:function(t,e){var i=new x(this,t,e);return this.glProgramWrappers.push(i),i},createVertexBuffer:function(t,e){var i=this.gl,r=new v(this,t,i.ARRAY_BUFFER,e);return this.glBufferWrappers.push(r),r},createIndexBuffer:function(t,e){var i=this.gl,r=new v(this,t,i.ELEMENT_ARRAY_BUFFER,e);return this.glBufferWrappers.push(r),r},createVAO:function(t,e,i){var r=new C(this,t,e,i);return this.glVAOWrappers.push(r),r},deleteTexture:function(t){if(t)return s(this.glTextureWrappers,t),t.destroy(),this},deleteFramebuffer:function(t){return t?(s(this.glFramebufferWrappers,t),t.destroy(),this):this},deleteProgram:function(t){return t&&(s(this.glProgramWrappers,t),t.destroy()),this},deleteBuffer:function(t){return t?(s(this.glBufferWrappers,t),t.destroy(),this):this},preRender:function(){if(!this.contextLost){this.emit(h.PRE_RENDER_CLEAR);var t=this.baseDrawingContext;if(this.config.clearBeforeRender){var e=this.config.backgroundColor;t.setClearColor(e.redGL,e.greenGL,e.blueGL,e.alphaGL),t.setAutoClear(!0,!0,!0)}else t.setAutoClear(!1,!1,!1);t.use(),this.emit(h.PRE_RENDER)}},render:function(t,e,i){this.contextLost||(this.emit(h.RENDER,t,i),this.currentViewCamera=i,this.cameraRenderNode.run(this.baseDrawingContext,e,i),this.currentViewCamera=null)},postRender:function(){if(this.baseDrawingContext.release(),!this.contextLost){this.emit(h.POST_RENDER);var t=this.snapshotState;t.callback&&(m(this.gl,t),t.callback=null)}},drawElements:function(t,e,i,r,s,n,a){var o=this.gl;t.beginDraw(),i.bind(),r.bind(),this.glTextureUnits.bindUnits(e),o.drawElements(a||o.TRIANGLE_STRIP,s,o.UNSIGNED_SHORT,n)},drawInstancedArrays:function(t,e,i,r,s,n,a,o){var h=this.gl;t.beginDraw(),i.bind(),r.bind(),this.glTextureUnits.bindUnits(e),h.drawArraysInstanced(o||h.TRIANGLE_STRIP,s,n,a)},snapshot:function(t,e,i){return this.snapshotArea(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight,t,e,i)},snapshotArea:function(t,e,i,r,s,n,a){var o=this.snapshotState;return o.callback=s,o.type=n,o.encoder=a,o.getPixel=!1,o.x=t,o.y=e,o.width=i,o.height=r,o.unpremultiplyAlpha=this.game.config.premultipliedAlpha,this},snapshotPixel:function(t,e,i){return this.snapshotArea(t,e,1,1,i),this.snapshotState.getPixel=!0,this},snapshotFramebuffer:function(t,e,i,r,s,n,a,o,h,l,u){void 0===s&&(s=!1),void 0===n&&(n=0),void 0===a&&(a=0),void 0===o&&(o=e),void 0===h&&(h=i),"pixel"===l&&(s=!0,l="image/png"),this.snapshotArea(n,a,o,h,r,l,u);var d=this.snapshotState;return d.getPixel=s,d.isFramebuffer=!0,d.bufferWidth=e,d.bufferHeight=i,d.width=Math.min(d.width,e),d.height=Math.min(d.height,i),this.glWrapper.updateBindingsFramebuffer({bindings:{framebuffer:t}}),m(this.gl,d),d.callback=null,d.isFramebuffer=!1,this},canvasToTexture:function(t,e,i,r){void 0===i&&(i=!1),void 0===r&&(r=!0);var s=this.gl,n=s.NEAREST,a=s.NEAREST,o=t.width,h=t.height,u=s.CLAMP_TO_EDGE,d=l(o,h);return!i&&d&&(u=s.REPEAT),this.config.antialias&&(n=d&&this.mipmapFilter?this.mipmapFilter:s.LINEAR,a=s.LINEAR),e?(e.update(t,o,h,r,u,u,n,a,e.format),e):this.createTexture2D(0,n,a,u,u,s.RGBA,t,o,h,!0,!1,r)},createCanvasTexture:function(t,e,i){return void 0===e&&(e=!1),void 0===i&&(i=!0),this.canvasToTexture(t,null,e,i)},updateCanvasTexture:function(t,e,i,r){return void 0===i&&(i=!0),void 0===r&&(r=!1),this.canvasToTexture(t,e,r,i)},videoToTexture:function(t,e,i,r){void 0===i&&(i=!1),void 0===r&&(r=!0);var s=this.gl,n=s.NEAREST,a=s.NEAREST,o=t.videoWidth,h=t.videoHeight,u=s.CLAMP_TO_EDGE,d=l(o,h);return!i&&d&&(u=s.REPEAT),this.config.antialias&&(n=d&&this.mipmapFilter?this.mipmapFilter:s.LINEAR,a=s.LINEAR),e?(e.update(t,o,h,r,u,u,n,a,e.format),e):this.createTexture2D(0,n,a,u,u,s.RGBA,t,o,h,!0,!0,r)},createVideoTexture:function(t,e,i){return void 0===e&&(e=!1),void 0===i&&(i=!0),this.videoToTexture(t,null,e,i)},updateVideoTexture:function(t,e,i,r){return void 0===i&&(i=!0),void 0===r&&(r=!1),this.videoToTexture(t,e,r,i)},createUint8ArrayTexture:function(t,e,i,r,s){var n=this.gl,a=n.NEAREST,o=n.NEAREST,h=n.CLAMP_TO_EDGE;return l(e,i)&&(h=n.REPEAT),void 0===r&&(r=!0),void 0===s&&(s=!0),this.createTexture2D(0,a,o,h,h,n.RGBA,t,e,i,r,!1,s)},setTextureFilter:function(t,e){var i=this.gl,r=0===e?i.LINEAR:i.NEAREST,s=this.glTextureUnits,n=s.units[0];return s.bind(t,0),t.update(t.pixels,t.width,t.height,t.flipY,t.wrapS,t.wrapT,r,r,t.format),n&&s.bind(n,0),this},setTextureWrap:function(t,e,i){var r=this.gl;if(!l(t.width,t.height)&&(e!==r.CLAMP_TO_EDGE||i!==r.CLAMP_TO_EDGE))return this;var s=this.glTextureUnits,n=s.units[0];return s.bind(t,0),t.update(t.pixels,t.width,t.height,t.flipY,e,i,t.minFilter,t.magFilter,t.format),n&&s.bind(n,0),this},getMaxTextureSize:function(){return this.config.maxTextureSize},destroy:function(){this.off(h.RESIZE,this.baseDrawingContext.resize,this.baseDrawingContext),this.canvas.removeEventListener("webglcontextlost",this.contextLostHandler,!1),this.canvas.removeEventListener("webglcontextrestored",this.contextRestoredHandler,!1);var t=function(t){t.destroy()};r(this.glBufferWrappers,t),r(this.glFramebufferWrappers,t),r(this.glProgramWrappers,t),r(this.glTextureWrappers,t),this.removeAllListeners(),this.extensions={},this.gl=null,this.game=null,this.canvas=null,this.contextLost=!0}});t.exports=O},14500(t){t.exports={BYTE:{enum:5120,size:1},UNSIGNED_BYTE:{enum:5121,size:1},SHORT:{enum:5122,size:2},UNSIGNED_SHORT:{enum:5123,size:2},INT:{enum:5124,size:4},UNSIGNED_INT:{enum:5125,size:4},FLOAT:{enum:5126,size:4}}},4159(t,e,i){var r=i(14500),s=i(79291),n={Shaders:i(89350),ShaderAdditionMakers:i(83786),DrawingContext:i(87774),DrawingContextPool:i(65656),ProgramManager:i(56436),RenderNodes:i(54521),ShaderProgramFactory:i(18804),Utils:i(70554),WebGLRenderer:i(74797),Wrappers:i(31884)};n=s(!1,n,r),t.exports=n},47774(t){var e={createCombined:function(t,e,i,r,s,n){var a=t.gl;return void 0===e&&(e=!0),void 0===i&&(i=[0,0,0,0]),void 0===r&&(r=a.FUNC_ADD),void 0===s&&(s=a.ONE),void 0===n&&(n=a.ONE_MINUS_SRC_ALPHA),{enabled:e,color:i,equation:[r,r],func:[s,n,s,n]}},createSeparate:function(t,e,i,r,s,n,a,o,h){var l=t.gl;return void 0===e&&(e=!0),void 0===i&&(i=[0,0,0,0]),void 0===r&&(r=l.FUNC_ADD),void 0===s&&(s=l.FUNC_ADD),void 0===n&&(n=l.ONE),void 0===a&&(a=l.ONE_MINUS_SRC_ALPHA),void 0===o&&(o=l.ONE),void 0===h&&(h=l.ONE_MINUS_SRC_ALPHA),{enabled:e,color:i,equation:[r,s],func:[n,a,o,h]}}};t.exports=e},53314(t,e,i){var r=i(8054),s=i(62644),n=i(71623),a={getDefault:function(t){return{bindings:{activeTexture:0,arrayBuffer:null,elementArrayBuffer:null,framebuffer:null,program:null,renderbuffer:null},blend:s(t.blendModes[r.BlendModes.NORMAL]),colorClearValue:[0,0,0,1],colorWritemask:[!0,!0,!0,!0],cullFace:!1,depthTest:!1,scissor:{enable:!0,box:[0,0,0,0]},stencil:n.create(t),texturing:{flipY:!1,premultiplyAlpha:!1},vao:null,viewport:[0,0,0,0]}}};t.exports=a},71623(t){var e={create:function(t,e,i,r,s,n,a,o,h){var l=t.gl;return void 0===e&&(e=!1),void 0===i&&(i=l.ALWAYS),void 0===r&&(r=0),void 0===s&&(s=255),void 0===n&&(n=l.KEEP),void 0===a&&(a=l.KEEP),void 0===o&&(o=l.KEEP),void 0===h&&(h=0),{enabled:e,func:{func:i,ref:r,mask:s},op:{fail:n,zfail:a,zpass:o},clear:h}}};t.exports=e},13961(t,e,i){var r=i(83419),s=i(56436),n=i(40952),a=i(6141),o=i(36909),h=new r({Extends:a,initialize:function(t,e,i){var r=t.renderer,h=r.gl,l=(i=this._copyAndCompleteConfig(t,i||{},e)).name;if(!l)throw new Error("BatchHandler must have a name");a.call(this,l,t),this.instancesPerBatch=-1,this.verticesPerInstance=i.verticesPerInstance;var u=Math.floor(65536/this.verticesPerInstance),d=i.instancesPerBatch||r.config.batchSize||u;this.instancesPerBatch=Math.min(d,u),this.indicesPerInstance=i.indicesPerInstance,this.bytesPerIndexPerInstance=this.indicesPerInstance*Uint16Array.BYTES_PER_ELEMENT,this.maxTexturesPerBatch=1,this.manager.on(o.Events.SET_PARALLEL_TEXTURE_UNITS,this.updateTextureCount,this),r.glWrapper.updateVAO({vao:null}),this.indexBuffer=r.createIndexBuffer(this._generateElementIndices(this.instancesPerBatch),i.indexBufferDynamic?h.DYNAMIC_DRAW:h.STATIC_DRAW);var c=i.vertexBufferLayout;if(c.count=this.instancesPerBatch*this.verticesPerInstance,this.vertexBufferLayout=new n(r,c,null),this.programManager=new s(r,[this.vertexBufferLayout],this.indexBuffer),this.programManager.setBaseShader(i.shaderName,i.vertexSource,i.fragmentSource),i.shaderAdditions)for(var f=0;fthis.instancesPerBatch)throw new Error("BatchHandlerStrip: Vertex count exceeds maximum per batch ("+this.maxVerticesPerBatch+")");this.instanceCount+c>this.instancesPerBatch&&this.run(t),this.updateRenderOptions(u),this._renderOptionsChanged&&(this.run(t),this.updateShaderConfig());var f,g=this.batchTextures(r),m=this.instanceCount*this.floatsPerInstance,v=this.vertexBufferLayout.buffer,y=v.viewF32,x=v.viewU32,T=!1;if(this.instanceCount>0){var w=1+this.floatsPerInstance/this.verticesPerInstance;y[m++]=y[m-w],y[m++]=y[m-w],y[m++]=y[m-w],y[m++]=y[m-w],y[m++]=y[m-w],y[m++]=y[m-w],x[m++]=x[m-w],T=!0}d&&(f=[]);for(var b=i.a,S=i.b,C=i.c,E=i.d,A=i.e,_=i.f,M=s.length,R=0;R=u.length)&&(n++,this.run(t),d=this.instanceCount*this.indicesPerInstance,g=this.vertexCount*h/f.BYTES_PER_ELEMENT,v=0,x=0)}}});t.exports=c},61842(t,e,i){var r=i(19715),s=i(1e3),n=i(61340),a=i(87841),o=i(43855),h=i(83419),l=i(70554),u=i(6141);function d(t){return l.getTintAppendFloatAlpha(16777215,t)}var c=new h({Extends:u,initialize:function(t){u.call(this,"Camera",t),this.batchHandlerQuadSingleNode=t.getNode("BatchHandlerQuadSingle"),this.fillCameraNode=t.getNode("FillCamera"),this.listCompositorNode=t.getNode("ListCompositor"),this._parentTransformMatrix=new n},run:function(t,e,i,n,h,l){var u;this.onRunBegin(t);var c=t.renderer.drawingContextPool,f=this.manager,p=i.alpha,g=i.filters.internal.getActive(),m=i.filters.external.getActive(),v=h||i.forceComposite||g.length||m.length||p<1;n?i.matrixExternal.multiply(n,n):n=this._parentTransformMatrix.copyFrom(i.matrixExternal);var y=n.decomposeMatrix(),x=o(y.translateX,0)&&o(y.translateY,0)&&o(y.rotation,0)&&o(y.scaleX,1)&&o(y.scaleY,1),T=i.x,w=i.y,b=i.width,S=i.height,C=t.getClone();C.setCamera(i),v?((u=c.get(b,S)).setCamera(i),u.setScissorBox(0,0,b,S)):(u=C).setScissorBox(T,w,b,S),u.use();var E=this.fillCameraNode;if(i.backgroundColor.alphaGL>0){var A=i.backgroundColor,_=s(A.red,A.green,A.blue,A.alpha);E.run(u,_,v)}this.listCompositorNode.run(u,e,null,l);var M=i.flashEffect;M.postRenderWebGL()&&(_=s(M.red,M.green,M.blue,255*M.alpha),E.run(u,_,v));var R=i.fadeEffect;if(R.postRenderWebGL()&&(_=s(R.red,R.green,R.blue,255*R.alpha),E.run(u,_,v)),f.finishBatch(),v){var P,O,L,D,F={smoothPixelArt:f.renderer.game.config.smoothPixelArt},I=new a(0,0,u.width,u.height);for(P=0;P0,k=!B,U=new a(0,0,C.width,C.height);if(B){for(P=m.length-1;P>=0;P--)(O=m[P]).active&&(L=O.getPaddingCeil(),U.setTo(U.x+L.x,U.y+L.y,U.width+L.width,U.height+L.height));(k=U.width!==u.width||U.height!==u.height||!x)&&((u=c.get(U.width,U.height)).setScissorBox(0,0,U.width,U.height),u.setCamera(C.camera),u.use())}else u=C;if(k){var z,Y=U.x,X=U.y;n.setQuad(I.x,I.y,I.x+I.width,I.y+I.height),z=n.quad,D=B?4294967295:d(p),i.roundPixels&&(z[0]=Math.round(z[0]),z[1]=Math.round(z[1]),z[2]=Math.round(z[2]),z[3]=Math.round(z[3]),z[4]=Math.round(z[4]),z[5]=Math.round(z[5]),z[6]=Math.round(z[6]),z[7]=Math.round(z[7])),this.batchHandlerQuadSingleNode.batch(u,N.texture,z[0]-Y,z[1]-X,z[2]-Y,z[3]-X,z[6]-Y,z[7]-X,z[4]-Y,z[5]-X,0,1,1,-1,!1,D,D,D,D,F)}if(N!==u&&N.release(),B){var W=!1;for(N=null,L=new a,P=0;P0&&d2&&g>1&&(m=!0,s||(v=!0));for(var y,x,T,w,b,S,C,E,A=[],_=0,M=[],R=0,P=[],O=0,L=u*u,D=0;D0){var l=e,u=e;if(a.length>0){s=h;for(var d=0;d0)for(s=h,d=0;d0){var s=this.instanceBufferLayout.buffer,n=i.memberCount,a=Math.floor(n/i.bufferUpdateSegmentSize),o=!0;for(e=0;e<=a;e++)if(!(1<0&&e.addAddition(h(t.tileset.maxAnimationLength));for(var s=t.lighting,n=e.getAdditionsByTag("LIGHTING"),a=0;a0,T=[y,e.layerDataTexture];if(x&&(T[2]=v.getAnimationDataTexture(s)),e.lighting){var w=v.image.dataSource[0];w=w?w.glTexture:this.manager.renderer.normalTexture,T[3]=w}this.updateRenderOptions(e);var b=this.programManager,S=b.getCurrentProgramSuite();if(S){var C=S.program,E=S.vao;this.setupUniforms(t,e),b.applyUniforms(C),s.drawElements(t,T,C,E,4,0)}this.onRunEnd(t)}});t.exports=y},12913(t,e,i){var r=i(83419),s=i(6141),n=new r({Extends:s,initialize:function(t){s.call(this,"TexturerImage",t),this.frame=null,this.frameWidth=0,this.frameHeight=0,this.uvSource=null},run:function(t,e,i){this.onRunBegin(t);var r=e.frame;if(this.frame=r,this.frameWidth=r.cutWidth,this.frameHeight=r.cutHeight,this.uvSource=r,e.isCropped){var s=e._crop;this.uvSource=s,s.flipX===e.flipX&&s.flipY===e.flipY||e.frame.updateCropUVs(s,e.flipX,e.flipY),this.frameWidth=s.width,this.frameHeight=s.height}var n=r.source.resolution;this.frameWidth/=n,this.frameHeight/=n,this.onRunEnd(t)}});t.exports=n},22995(t,e,i){var r=i(61340),s=i(83419),n=i(6141),a=new s({Extends:n,initialize:function(t){n.call(this,"TexturerTileSprite",t),this.frame=null,this.uvMatrix=new r},run:function(t,e,i){this.onRunBegin(t);var r=e.frame;if(this.frame=r,e.isCropped){var s=e._crop;s.flipX===e.flipX&&s.flipY===e.flipY||e.frame.updateCropUVs(s,e.flipX,e.flipY)}this.uvMatrix.loadIdentity(),this.uvMatrix.scale(1/r.width,1/r.height),this.uvMatrix.translate(e.tilePositionX,e.tilePositionY),this.uvMatrix.scale(1/e.tileScaleX,1/e.tileScaleY),this.uvMatrix.rotate(-e.tileRotation),this.uvMatrix.setQuad(0,0,e.width,e.height),this.onRunEnd(t)}});t.exports=a},86081(t,e,i){var r=i(61340),s=i(83419),n=i(46975),a=i(6141),o=new s({Extends:a,initialize:function(t,e){e=n(e||{},this.defaultConfig),a.call(this,e.name,t),this.quad=new Float32Array(8),this._spriteMatrix=new r,this._calcMatrix=new r},defaultConfig:{name:"TransformerImage",role:"Transformer"},run:function(t,e,i,r,s){this.onRunBegin(t);var n=i.frame,a=i.uvSource,o=a.x,h=a.y,l=e.displayOriginX,u=e.displayOriginY,d=-l+o,c=-u+h,f=n.customPivot,p=1,g=1;e.flipX&&(f||(d+=-n.realWidth+2*l),p=-1),e.flipY&&(f||(c+=-n.realHeight+2*u),g=-1);var m=t.camera,v=this._spriteMatrix,y=this._calcMatrix.copyWithScrollFactorFrom(m.getViewMatrix(!t.useCanvas),m.scrollX,m.scrollY,e.scrollFactorX,e.scrollFactorY);r&&y.multiply(r),v.applyITRS(e.x,e.y,e.rotation,e.scaleX*p,e.scaleY*g),y.multiply(v),y.setQuad(d,c,d+i.frameWidth,c+i.frameHeight,this.quad);var x=y.matrix,T=1===x[0]&&0===x[1]&&0===x[2]&&1===x[3];if(e.willRoundVertices(m,T)){var w=this.quad;w[0]=Math.round(w[0]),w[1]=Math.round(w[1]),w[2]=Math.round(w[2]),w[3]=Math.round(w[3]),w[4]=Math.round(w[4]),w[5]=Math.round(w[5]),w[6]=Math.round(w[6]),w[7]=Math.round(w[7])}this.onRunEnd(t)}});t.exports=o},88383(t,e,i){var r=i(61340),s=i(83419),n=i(46975),a=i(6141),o=new s({Extends:a,initialize:function(t,e){e=n(e||{},this.defaultConfig),a.call(this,e.name,t),this._spriteMatrix=new r,this.quad=this._spriteMatrix.quad},defaultConfig:{name:"TransformerStamp",role:"Transformer"},run:function(t,e,i,r,s){this.onRunBegin(t);var n=i.frame,a=i.uvSource,o=a.x,h=a.y,l=e.displayOriginX,u=e.displayOriginY,d=-l+o,c=-u+h,f=n.customPivot,p=1,g=1;e.flipX&&(f||(d+=-n.realWidth+2*l),p=-1),e.flipY&&(f||(c+=-n.realHeight+2*u),g=-1);var m=e.x,v=e.y,y=this._spriteMatrix;y.applyITRS(m,v,e.rotation,e.scaleX*p,e.scaleY*g);var x=y.matrix;this.onlyTranslate=1===x[0]&&0===x[1]&&0===x[2]&&1===x[3],y.setQuad(d,c,d+i.frameWidth,c+i.frameHeight);var T=y.matrix,w=1===T[0]&&0===T[1]&&0===T[2]&&1===T[3];if(e.willRoundVertices(t.camera,w)){var b=this.quad;b[0]=Math.round(b[0]),b[1]=Math.round(b[1]),b[2]=Math.round(b[2]),b[3]=Math.round(b[3]),b[4]=Math.round(b[4]),b[5]=Math.round(b[5]),b[6]=Math.round(b[6]),b[7]=Math.round(b[7])}this.onRunEnd(t)}});t.exports=o},34454(t,e,i){var r=i(83419),s=i(86081),n=new r({Extends:s,initialize:function(t,e){s.call(this,t,e)},defaultConfig:{name:"TransformerTile",role:"Transformer"},run:function(t,e,i,r,s){this.onRunBegin(t);var n=t.camera,a=this._calcMatrix,o=this._spriteMatrix;a.copyWithScrollFactorFrom(n.getViewMatrix(!t.useCanvas),n.scrollX,n.scrollY,e.scrollFactorX,e.scrollFactorY),r&&a.multiply(r);var h=i.frameWidth,l=i.frameHeight,u=h,d=l,c=h/2,f=l/2,p=e.scaleX,g=e.scaleY,m=e.gidMap[s.index],v=m.tileOffset.x,y=m.tileOffset.y,x=e.x+s.pixelX*p+(c*p-v),T=e.y+s.pixelY*g+(f*g-y),w=-c,b=-f;s.flipX&&(u*=-1,w+=h),s.flipY&&(d*=-1,w+=l),o.applyITRS(x,T,s.rotation,p,g),a.multiply(o),a.setQuad(w,b,w+u,b+d,this.quad);var S=a.matrix,C=1===S[0]&&0===S[1]&&0===S[2]&&1===S[3];if(e.willRoundVertices(n,C)){var E=this.quad;E[0]=Math.round(E[0]),E[1]=Math.round(E[1]),E[2]=Math.round(E[2]),E[3]=Math.round(E[3]),E[4]=Math.round(E[4]),E[5]=Math.round(E[5]),E[6]=Math.round(E[6]),E[7]=Math.round(E[7])}this.onRunEnd(t)}});t.exports=n},46211(t,e,i){var r=i(83419),s=i(86081),n=new r({Extends:s,initialize:function(t,e){s.call(this,t,e)},defaultConfig:{name:"TransformerTileSprite",role:"Transformer"},run:function(t,e,i,r,s){this.onRunBegin(t);var n=e.width,a=e.height,o=e.displayOriginX,h=e.displayOriginY,l=-o,u=-h,d=1,c=1;e.flipX&&(l+=2*o-n,d=-1),e.flipY&&(u+=2*h-a,c=-1);var f=e.x,p=e.y,g=t.camera,m=this._calcMatrix,v=this._spriteMatrix;m.copyWithScrollFactorFrom(g.getViewMatrix(!t.useCanvas),g.scrollX,g.scrollY,e.scrollFactorX,e.scrollFactorY),r&&m.multiply(r),v.applyITRS(f,p,e.rotation,e.scaleX*d,e.scaleY*c),m.multiply(v),m.setQuad(l,u,l+n,u+a,this.quad);var y=m.matrix,x=1===y[0]&&0===y[1]&&0===y[2]&&1===y[3];if(e.willRoundVertices(g,x)){var T=this.quad;T[0]=Math.round(T[0]),T[1]=Math.round(T[1]),T[2]=Math.round(T[2]),T[3]=Math.round(T[3]),T[4]=Math.round(T[4]),T[5]=Math.round(T[5]),T[6]=Math.round(T[6]),T[7]=Math.round(T[7])}this.onRunEnd(t)}});t.exports=n},84547(t){t.exports=["vec4 applyLighting (vec4 fragColor, vec3 normal)","{"," vec4 lighting = getLighting(fragColor, normal);"," return fragColor * vec4(lighting.rgb * lighting.a, lighting.a);","}"].join("\n")},11104(t){t.exports=["vec4 applyTint(vec4 texture)","{"," vec3 unpremultTexture = texture.rgb / texture.a;"," float alpha = texture.a * outTint.a;"," vec3 color = vec3(unpremultTexture);"," if (outTintEffect == 0.0) {"," color *= outTint.bgr;"," }"," else if (outTintEffect == 1.0) {"," color = outTint.bgr;"," }"," else if (outTintEffect == 2.0) {"," color += outTint.bgr;"," }"," else if (outTintEffect == 4.0) {"," color = 1.0 - (1.0 - unpremultTexture) * (1.0 - outTint.bgr);"," }"," else if (outTintEffect == 5.0) {"," color = vec3("," unpremultTexture.r < 0.5 ? 2.0 * outTint.b * unpremultTexture.r : 1.0 - 2.0 * (1.0 - outTint.b) * (1.0 - unpremultTexture.r),"," unpremultTexture.g < 0.5 ? 2.0 * outTint.g * unpremultTexture.g : 1.0 - 2.0 * (1.0 - outTint.g) * (1.0 - unpremultTexture.g),"," unpremultTexture.b < 0.5 ? 2.0 * outTint.r * unpremultTexture.b : 1.0 - 2.0 * (1.0 - outTint.r) * (1.0 - unpremultTexture.b)"," );"," }"," else if (outTintEffect == 6.0) {"," color = vec3("," outTint.b < 0.5 ? 2.0 * outTint.b * unpremultTexture.r : 1.0 - 2.0 * (1.0 - outTint.b) * (1.0 - unpremultTexture.r),"," outTint.g < 0.5 ? 2.0 * outTint.g * unpremultTexture.g : 1.0 - 2.0 * (1.0 - outTint.g) * (1.0 - unpremultTexture.g),"," outTint.r < 0.5 ? 2.0 * outTint.r * unpremultTexture.b : 1.0 - 2.0 * (1.0 - outTint.r) * (1.0 - unpremultTexture.b)"," );"," }"," return vec4(color * alpha, alpha);","}"].join("\n")},81556(t){t.exports=["vec4 boundedSampler(sampler2D sampler, vec2 uv)","{"," if (clamp(uv, 0.0, 1.0) != uv)"," {"," return vec4(0.0, 0.0, 0.0, 0.0);"," }"," return texture2D(sampler, uv);","}"].join("\n")},96293(t){t.exports=["#define SHADER_NAME PHASER_COLORMATRIX_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform float uColorMatrix[20];","uniform float uAlpha;","varying vec2 outTexCoord;","void main ()","{"," vec4 c = texture2D(uMainSampler, outTexCoord);"," if (uAlpha == 0.0)"," {"," gl_FragColor = c;"," return;"," }"," if (c.a > 0.0)"," {"," c.rgb /= c.a;"," }"," vec4 result;"," result.r = (uColorMatrix[0] * c.r) + (uColorMatrix[1] * c.g) + (uColorMatrix[2] * c.b) + (uColorMatrix[3] * c.a) + uColorMatrix[4];"," result.g = (uColorMatrix[5] * c.r) + (uColorMatrix[6] * c.g) + (uColorMatrix[7] * c.b) + (uColorMatrix[8] * c.a) + uColorMatrix[9];"," result.b = (uColorMatrix[10] * c.r) + (uColorMatrix[11] * c.g) + (uColorMatrix[12] * c.b) + (uColorMatrix[13] * c.a) + uColorMatrix[14];"," result.a = (uColorMatrix[15] * c.r) + (uColorMatrix[16] * c.g) + (uColorMatrix[17] * c.b) + (uColorMatrix[18] * c.a) + uColorMatrix[19];"," c.rgb *= c.a;"," result.rgb *= result.a;"," gl_FragColor = mix(c, result, uAlpha);","}"].join("\n")},78390(t){t.exports=["vec2 v2len (vec2 a, vec2 b)","{"," return sqrt(a*a+b*b);","}","vec2 getBlockyTexCoord (vec2 texCoord, vec2 texRes) {"," texCoord *= texRes;"," vec2 seam = floor(texCoord + 0.5);"," texCoord = (texCoord - seam) / v2len(dFdx(texCoord), dFdy(texCoord)) + seam;"," texCoord = clamp(texCoord, seam-.5, seam+.5);"," return texCoord / texRes;","}"].join("\n")},11719(t){t.exports=["struct Light","{"," vec3 position;"," vec3 color;"," float intensity;"," float radius;","};","const int kMaxLights = LIGHT_COUNT;","uniform vec4 uCamera; /* x, y, rotation, zoom */","uniform sampler2D uNormSampler;","uniform vec3 uAmbientLightColor;","uniform Light uLights[kMaxLights];","uniform int uLightCount;","#ifdef FEATURE_SELFSHADOW","uniform float uDiffuseFlatThreshold;","uniform float uPenumbra;","#endif","vec4 getLighting (vec4 fragColor, vec3 normal)","{"," vec3 finalColor = vec3(0.0);"," vec2 res = vec2(min(uResolution.x, uResolution.y)) * uCamera.w;"," #ifdef FEATURE_SELFSHADOW"," vec3 unpremultipliedColor = fragColor.rgb / fragColor.a;"," float occlusionThreshold = 1.0 - ((unpremultipliedColor.r + unpremultipliedColor.g + unpremultipliedColor.b) / uDiffuseFlatThreshold);"," #endif"," for (int index = 0; index < kMaxLights; ++index)"," {"," if (index < uLightCount)"," {"," Light light = uLights[index];"," vec3 lightDir = vec3((light.position.xy / res) - (gl_FragCoord.xy / res), light.position.z / res.x);"," vec3 lightNormal = normalize(lightDir);"," float distToSurf = length(lightDir) * uCamera.w;"," float diffuseFactor = max(dot(normal, lightNormal), 0.0);"," float radius = (light.radius / res.x * uCamera.w) * uCamera.w;"," float attenuation = clamp(1.0 - distToSurf * distToSurf / (radius * radius), 0.0, 1.0);"," #ifdef FEATURE_SELFSHADOW"," float occluded = smoothstep(0.0, 1.0, (diffuseFactor - occlusionThreshold) / uPenumbra);"," vec3 diffuse = light.color * diffuseFactor * occluded;"," #else"," vec3 diffuse = light.color * diffuseFactor;"," #endif"," finalColor += (attenuation * diffuse) * light.intensity;"," }"," }"," vec4 colorOutput = vec4(uAmbientLightColor + finalColor, 1.0);"," return colorOutput;","}"].join("\n")},14030(t){t.exports=["vec2 clampTexCoordWithinFrame (vec2 texCoord)","{"," vec2 texRes = getTexRes();"," vec4 frameTexel = outFrame * texRes.xyxy;"," vec2 frameMin = frameTexel.xy + vec2(0.5, 0.5);"," vec2 frameMax = frameTexel.xy + frameTexel.zw - vec2(0.5, 0.5);"," return clamp(texCoord, frameMin / texRes, frameMax / texRes);","}"].join("\n")},10235(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform float amount;","varying vec2 outTexCoord;","#pragma phaserTemplate(fragmentHeader)","vec2 Distort(vec2 p)","{"," float theta = atan(p.y, p.x);"," float radius = length(p);"," radius = pow(radius, amount);"," p.x = radius * cos(theta);"," p.y = radius * sin(theta);"," return 0.5 * (p + 1.0);","}","void main()","{"," vec2 xy = 2.0 * outTexCoord - 1.0;"," vec2 texCoord = outTexCoord;"," if (length(xy) < 1.0)"," {"," texCoord = Distort(xy);"," }"," gl_FragColor = boundedSampler(uMainSampler, texCoord);","}"].join("\n")},65980(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uMainSampler2;","uniform float amount;","uniform vec4 color;","varying vec2 outTexCoord;","vec4 NORMAL (vec4 base, vec4 blend)","{"," return blend + base * (1.0 - blend.a);","}","vec4 ADD (vec4 base, vec4 blend)","{"," return base + blend;","}","vec4 MULTIPLY (vec4 base, vec4 blend)","{"," return base * blend;","}","vec4 SCREEN (vec4 base, vec4 blend)","{"," return 1.0 - (1.0 - base) * (1.0 - blend);","}","float overlayChannel (float base, float blend)","{"," return base < 0.5 ? 2.0 * base * blend : 1.0 - 2.0 * (1.0 - base) * (1.0 - blend);","}","vec4 OVERLAY (vec4 base, vec4 blend)","{"," return vec4("," overlayChannel(base.r, blend.r),"," overlayChannel(base.g, blend.g),"," overlayChannel(base.b, blend.b),"," overlayChannel(base.a, blend.a)"," );","}","vec4 DARKEN (vec4 base, vec4 blend)","{"," return min(base, blend);","}","vec4 LIGHTEN (vec4 base, vec4 blend)","{"," return max(base, blend);","}","float dodgeChannel (float base, float blend)","{"," return blend == 1.0 ? blend : min(1.0, base / (1.0 - blend));","}","vec4 COLOR_DODGE (vec4 base, vec4 blend)","{"," return vec4("," dodgeChannel(base.r, blend.r),"," dodgeChannel(base.g, blend.g),"," dodgeChannel(base.b, blend.b),"," dodgeChannel(base.a, blend.a)"," );","}","float burnChannel (float base, float blend)","{"," return blend == 0.0 ? blend : 1.0 - min(1.0, (1.0 - base) / blend);","}","vec4 COLOR_BURN (vec4 base, vec4 blend)","{"," return vec4("," burnChannel(base.r, blend.r),"," burnChannel(base.g, blend.g),"," burnChannel(base.b, blend.b),"," burnChannel(base.a, blend.a)"," );","}","float hardLightChannel (float base, float blend)","{"," return blend < 0.5 ? 2.0 * base * blend : 1.0 - 2.0 * (1.0 - base) * (1.0 - blend);","}","vec4 HARD_LIGHT (vec4 base, vec4 blend)","{"," return vec4("," hardLightChannel(base.r, blend.r),"," hardLightChannel(base.g, blend.g),"," hardLightChannel(base.b, blend.b),"," hardLightChannel(base.a, blend.a)"," );","}","float softLightChannel (float base, float blend)","{"," return blend < 0.5 ? (2.0 * base * blend + base * base * (1.0 - 2.0 * blend)) : (sqrt(base) * (2.0 * blend - 1.0) + 2.0 * base * (1.0 - blend));","}","vec4 SOFT_LIGHT (vec4 base, vec4 blend)","{"," return vec4("," softLightChannel(base.r, blend.r),"," softLightChannel(base.g, blend.g),"," softLightChannel(base.b, blend.b),"," softLightChannel(base.a, blend.a)"," );","}","vec4 DIFFERENCE (vec4 base, vec4 blend)","{"," return abs(base - blend);","}","vec4 EXCLUSION (vec4 base, vec4 blend)","{"," return base + blend - 2.0 * base * blend;","}","vec3 rgbToHsl (vec3 color)","{"," vec3 hsl = vec3(0.0);"," float fmin = min(min(color.r, color.g), color.b);"," float fmax = max(max(color.r, color.g), color.b);"," float delta = fmax - fmin;"," hsl.z = (fmax + fmin) / 2.0;"," if (delta == 0.0)"," {"," hsl.x = 0.0;"," hsl.y = 0.0;"," }"," else"," {"," if (hsl.z < 0.5)"," {"," hsl.y = delta / (fmax + fmin);"," }"," else"," {"," hsl.y = delta / (2.0 - fmax - fmin);"," }"," float deltaR = (((fmax - color.r) / 6.0) + (delta / 2.0)) / delta;"," float deltaG = (((fmax - color.g) / 6.0) + (delta / 2.0)) / delta;"," float deltaB = (((fmax - color.b) / 6.0) + (delta / 2.0)) / delta;"," if (color.r == fmax)"," {"," hsl.x = deltaB - deltaG;"," }"," else if (color.g == fmax)"," {"," hsl.x = (1.0 / 3.0) + deltaR - deltaB;"," }"," else if (color.b == fmax)"," {"," hsl.x = (2.0 / 3.0) + deltaG - deltaR;"," }"," if (hsl.x < 0.0)"," {"," hsl.x += 1.0;"," }"," else if (hsl.x > 1.0)"," {"," hsl.x -= 1.0;"," }"," }"," return hsl;","}","vec3 hslToRgb (vec3 hsl)","{"," float p = hsl.z * (1.0 - hsl.y);"," float q = hsl.z * (1.0 - hsl.y * hsl.x);"," float t = hsl.z * (1.0 - hsl.y * (1.0 - hsl.x));"," if (hsl.x < 1.0 / 6.0)"," {"," return vec3(hsl.z, t, p);"," }"," else if (hsl.x < 0.5)"," {"," return vec3(q, hsl.z, p);"," }"," else if (hsl.x < 2.0 / 3.0)"," {"," return vec3(p, hsl.z, t);"," }"," return vec3(p, q, hsl.z);","}","vec4 HUE (vec4 base, vec4 blend)","{"," vec3 baseHSL = rgbToHsl(base.rgb);"," vec3 blendHSL = rgbToHsl(blend.rgb);"," return vec4(hslToRgb(vec3(blendHSL.x, baseHSL.y, baseHSL.z)), base.a);","}","vec4 SATURATION (vec4 base, vec4 blend)","{"," vec3 baseHSL = rgbToHsl(base.rgb);"," vec3 blendHSL = rgbToHsl(blend.rgb);"," return vec4(hslToRgb(vec3(baseHSL.x, blendHSL.y, baseHSL.z)), base.a);","}","vec4 COLOR (vec4 base, vec4 blend)","{"," vec3 baseHSL = rgbToHsl(base.rgb);"," vec3 blendHSL = rgbToHsl(blend.rgb);"," return vec4(hslToRgb(vec3(blendHSL.x, blendHSL.y, baseHSL.z)), base.a);","}","vec4 LUMINOSITY (vec4 base, vec4 blend)","{"," vec3 baseHSL = rgbToHsl(base.rgb);"," vec3 blendHSL = rgbToHsl(blend.rgb);"," return vec4(hslToRgb(vec3(baseHSL.x, baseHSL.y, blendHSL.z)), base.a);","}","vec4 ERASE (vec4 base, vec4 blend)","{"," return base * (1.0 - blend.a);","}","vec4 SOURCE_IN (vec4 base, vec4 blend)","{"," return blend * base.a;","}","vec4 SOURCE_OUT (vec4 base, vec4 blend)","{"," return blend * (1.0 - base.a);","}","vec4 SOURCE_ATOP (vec4 base, vec4 blend)","{"," return base * (1.0 - blend.a) + blend * base.a;","}","vec4 DESTINATION_OVER (vec4 base, vec4 blend)","{"," return base + blend * (1.0 - base.a);","}","vec4 DESTINATION_IN (vec4 base, vec4 blend)","{"," return base * blend.a;","}","vec4 DESTINATION_OUT (vec4 base, vec4 blend)","{"," return base * (1.0 - blend.a);","}","vec4 DESTINATION_ATOP (vec4 base, vec4 blend)","{"," return base * blend.a + blend * (1.0 - base.a);","}","vec4 LIGHTER (vec4 base, vec4 blend)","{"," return ADD(base, blend);","}","vec4 COPY (vec4 base, vec4 blend)","{"," return blend;","}","vec4 XOR (vec4 base, vec4 blend)","{"," return base * (1.0 - blend.a) + blend * (1.0 - base.a);","}","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec4 base = boundedSampler(uMainSampler, outTexCoord);"," vec4 blend = boundedSampler(uMainSampler2, outTexCoord) * color;"," vec4 blended = BLEND(base, blend);"," gl_FragColor = mix(base, blended, amount);","}"].join("\n")},5899(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec4 uSizeAndOffset;","varying vec2 outTexCoord;","void main()","{"," vec2 gridCell = floor((outTexCoord * resolution + uSizeAndOffset.zw) / uSizeAndOffset.xy) * uSizeAndOffset.xy - uSizeAndOffset.zw;"," vec2 texCoord = gridCell / resolution;"," gl_FragColor = texture2D(uMainSampler, texCoord);","}"].join("\n")},20784(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec2 offset;","uniform float strength;","uniform vec3 color;","varying vec2 outTexCoord;","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec2 uv = outTexCoord;"," vec4 col = vec4(0.0);"," vec2 off1 = vec2(1.411764705882353) * offset * strength;"," vec2 off2 = vec2(3.2941176470588234) * offset * strength;"," vec2 off3 = vec2(5.176470588235294) * offset * strength;"," col += boundedSampler(uMainSampler, uv) * 0.1964825501511404;"," col += boundedSampler(uMainSampler, uv + (off1 / resolution)) * 0.2969069646728344;"," col += boundedSampler(uMainSampler, uv - (off1 / resolution)) * 0.2969069646728344;"," col += boundedSampler(uMainSampler, uv + (off2 / resolution)) * 0.09447039785044732;"," col += boundedSampler(uMainSampler, uv - (off2 / resolution)) * 0.09447039785044732;"," col += boundedSampler(uMainSampler, uv + (off3 / resolution)) * 0.010381362401148057;"," col += boundedSampler(uMainSampler, uv - (off3 / resolution)) * 0.010381362401148057;"," gl_FragColor = col * vec4(color, 1.0);","}"].join("\n")},65122(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec2 offset;","uniform float strength;","uniform vec3 color;","varying vec2 outTexCoord;","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec2 uv = outTexCoord;"," vec4 col = vec4(0.0);"," vec2 offset = vec2(1.333) * offset * strength;"," col += boundedSampler(uMainSampler, uv) * 0.29411764705882354;"," col += boundedSampler(uMainSampler, uv + (offset / resolution)) * 0.35294117647058826;"," col += boundedSampler(uMainSampler, uv - (offset / resolution)) * 0.35294117647058826;"," gl_FragColor = col * vec4(color, 1.0);","}"].join("\n")},60942(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec2 offset;","uniform float strength;","uniform vec3 color;","varying vec2 outTexCoord;","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec2 uv = outTexCoord;"," vec4 col = vec4(0.0);"," vec2 off1 = vec2(1.3846153846) * offset * strength;"," vec2 off2 = vec2(3.2307692308) * offset * strength;"," col += boundedSampler(uMainSampler, uv) * 0.2270270270;"," col += boundedSampler(uMainSampler, uv + (off1 / resolution)) * 0.3162162162;"," col += boundedSampler(uMainSampler, uv - (off1 / resolution)) * 0.3162162162;"," col += boundedSampler(uMainSampler, uv + (off2 / resolution)) * 0.0702702703;"," col += boundedSampler(uMainSampler, uv - (off2 / resolution)) * 0.0702702703;"," gl_FragColor = col * vec4(color, 1.0);","}"].join("\n")},43722(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","#define ITERATIONS 100.0","#define ONEOVER_ITR 1.0 / ITERATIONS","#define PI 3.141596","#define GOLDEN_ANGLE 2.39996323","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform float radius;","uniform float amount;","uniform float contrast;","uniform bool isTiltShift;","uniform float strength;","uniform vec2 blur;","varying vec2 outTexCoord;","vec2 Sample (in float theta, inout float r)","{"," r += 1.0 / r;"," return (r - 1.0) * vec2(cos(theta), sin(theta)) * 0.06;","}","#pragma phaserTemplate(fragmentHeader)","vec3 Bokeh (sampler2D tex, vec2 uv, float radius)","{"," vec3 acc = vec3(0.0);"," vec3 div = vec3(0.0);"," vec2 pixel = vec2(resolution.y / resolution.x, 1.0) * radius * .025;"," float r = 1.0;"," for (float j = 0.0; j < GOLDEN_ANGLE * ITERATIONS; j += GOLDEN_ANGLE)"," {"," vec3 col = boundedSampler(tex, uv + pixel * Sample(j, r)).xyz;"," col = contrast > 0.0 ? col * col * (1.0 + contrast) : col;"," vec3 bokeh = vec3(0.5) + pow(col, vec3(10.0)) * amount;"," acc += col * bokeh;"," div += bokeh;"," }"," return acc / div;","}","void main ()","{"," float shift = 1.0;"," if (isTiltShift)"," {"," vec2 uv = vec2(gl_FragCoord.xy / resolution + vec2(-0.5, -0.5)) * 2.0;"," float centerStrength = 1.0;"," shift = length(uv * blur * strength) * centerStrength;"," }"," gl_FragColor = vec4(Bokeh(uMainSampler, outTexCoord * vec2(1.0, 1.0), radius * shift), 0.0);","}"].join("\n")},19883(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform float uColorMatrix[20];","uniform float uAlpha;","varying vec2 outTexCoord;","void main ()","{"," vec4 c = texture2D(uMainSampler, outTexCoord);"," if (uAlpha == 0.0)"," {"," gl_FragColor = c;"," return;"," }"," if (c.a > 0.0)"," {"," c.rgb /= c.a;"," }"," vec4 result;"," result.r = (uColorMatrix[0] * c.r) + (uColorMatrix[1] * c.g) + (uColorMatrix[2] * c.b) + (uColorMatrix[3] * c.a) + uColorMatrix[4];"," result.g = (uColorMatrix[5] * c.r) + (uColorMatrix[6] * c.g) + (uColorMatrix[7] * c.b) + (uColorMatrix[8] * c.a) + uColorMatrix[9];"," result.b = (uColorMatrix[10] * c.r) + (uColorMatrix[11] * c.g) + (uColorMatrix[12] * c.b) + (uColorMatrix[13] * c.a) + uColorMatrix[14];"," result.a = (uColorMatrix[15] * c.r) + (uColorMatrix[16] * c.g) + (uColorMatrix[17] * c.b) + (uColorMatrix[18] * c.a) + uColorMatrix[19];"," vec3 rgb = mix(c.rgb, result.rgb, uAlpha);"," rgb *= result.a;"," gl_FragColor = vec4(rgb, result.a);","}"].join("\n")},32624(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uTransferSampler;","uniform float uColorMatrixSelf[20];","uniform float uColorMatrixTransfer[20];","uniform float uAlphaSelf;","uniform float uAlphaTransfer;","uniform vec4 uAdditions;","uniform vec4 uMultiplications;","varying vec2 outTexCoord;","#define S uColorMatrixSelf","#define T uColorMatrixTransfer","void main ()","{"," vec4 self = texture2D(uMainSampler, outTexCoord);"," if (uAlphaSelf == 0.0)"," {"," gl_FragColor = self;"," return;"," }"," if (self.a > 0.0)"," {"," self.rgb /= self.a;"," }"," vec4 resultSelf;"," resultSelf.r = (S[0] * self.r) + (S[1] * self.g) + (S[2] * self.b) + (S[3] * self.a) + S[4];"," resultSelf.g = (S[5] * self.r) + (S[6] * self.g) + (S[7] * self.b) + (S[8] * self.a) + S[9];"," resultSelf.b = (S[10] * self.r) + (S[11] * self.g) + (S[12] * self.b) + (S[13] * self.a) + S[14];"," resultSelf.a = (S[15] * self.r) + (S[16] * self.g) + (S[17] * self.b) + (S[18] * self.a) + S[19];"," if (uAlphaTransfer == 0.0)"," {"," self.rgb *= self.a;"," resultSelf.rgb *= resultSelf.a;"," gl_FragColor = mix(self, resultSelf, uAlphaSelf);"," return;"," }"," vec4 tex = texture2D(uTransferSampler, outTexCoord);"," if (tex.a > 0.0)"," {"," tex.rgb /= tex.a;"," }"," vec4 resultTransfer;"," resultTransfer.r = (T[0] * tex.r) + (T[1] * tex.g) + (T[2] * tex.b) + (T[3] * tex.a) + T[4];"," resultTransfer.g = (T[5] * tex.r) + (T[6] * tex.g) + (T[7] * tex.b) + (T[8] * tex.a) + T[9];"," resultTransfer.b = (T[10] * tex.r) + (T[11] * tex.g) + (T[12] * tex.b) + (T[13] * tex.a) + T[14];"," resultTransfer.a = (T[15] * tex.r) + (T[16] * tex.g) + (T[17] * tex.b) + (T[18] * tex.a) + T[19];"," vec4 combo = (resultSelf + resultTransfer) * uAdditions + (resultSelf * resultTransfer) * uMultiplications;"," self.rgb *= self.a;"," resultSelf.rgb *= resultSelf.a;"," combo.rgb *= combo.a;"," gl_FragColor = mix(self, mix(resultSelf, combo, uAlphaTransfer), uAlphaSelf);","}"].join("\n")},12886(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uDisplacementSampler;","uniform vec2 amount;","varying vec2 outTexCoord;","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec2 disp = (-vec2(0.5, 0.5) + texture2D(uDisplacementSampler, outTexCoord).rg) * amount;"," gl_FragColor = boundedSampler(uMainSampler, outTexCoord + disp).rgba;","}"].join("\n")},33016(t){t.exports=["#pragma phaserTemplate(shaderName)","#define DISTANCE 10.0","#define QUALITY 10.0","#pragma phaserTemplate(fragmentDefine)","precision mediump float;","uniform sampler2D uMainSampler;","varying vec2 outTexCoord;","uniform float outerStrength;","uniform float innerStrength;","uniform float scale;","uniform vec2 resolution;","uniform vec4 glowColor;","uniform bool knockout;","const float PI = 3.14159265358979323846264;","const float MAX_ALPHA = DISTANCE * (DISTANCE + 1.0) * QUALITY / 2.0;","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec2 px = vec2(1.0 / resolution.x, 1.0 / resolution.y) * scale;"," float totalAlpha = 0.0;"," float curAngle = 0.0;"," vec2 direction;"," vec2 displaced;"," vec4 color;"," for (float curDistance = 0.0; curDistance < DISTANCE; curDistance++)"," {"," curAngle += fract(sin(dot(vec2(curDistance, outTexCoord.x + outTexCoord.y), vec2(12.9898, 78.233))) * 43758.5453);"," for (float i = 0.0; i < QUALITY; i++)"," {"," curAngle += PI * 2.0 / (QUALITY);"," direction = vec2(cos(curAngle), sin(curAngle)) * px;"," displaced = outTexCoord + direction * (curDistance + 1.0);"," color = boundedSampler(uMainSampler, displaced);"," totalAlpha += (DISTANCE - curDistance) * color.a;"," }"," }"," color = boundedSampler(uMainSampler, outTexCoord);"," float alphaRatio = (totalAlpha / MAX_ALPHA);"," float innerGlowAlpha = (1.0 - alphaRatio) * innerStrength * color.a;"," float innerGlowStrength = min(1.0, innerGlowAlpha);"," vec4 innerColor = mix(color, glowColor, innerGlowStrength);"," float outerGlowAlpha = alphaRatio * outerStrength * (1.0 - color.a);"," float outerGlowStrength = min(1.0 - innerColor.a, outerGlowAlpha);"," if (knockout)"," {"," float resultAlpha = outerGlowStrength + innerGlowStrength;"," gl_FragColor = vec4(glowColor.rgb * resultAlpha, resultAlpha);"," }"," else"," {"," vec4 outerGlowColor = outerGlowStrength * glowColor.rgba;"," gl_FragColor = innerColor + outerGlowColor;"," }","}"].join("\n")},33179(t){t.exports=["#pragma phaserTemplate(shaderName)","precision highp float;","#pragma phaserTemplate(fragmentHeader)","uniform sampler2D uMainSampler;","uniform vec4 uColor;","uniform vec4 uColorFactor;","uniform bool uUnpremultiply;","uniform float uAlpha;","varying vec2 outTexCoord;","void main ()","{"," vec4 sample = texture2D(uMainSampler, outTexCoord);"," if (uUnpremultiply)"," {"," sample.rgb /= sample.a;"," }"," vec4 modulatedSample = sample * uColorFactor + uColor;"," float progress = modulatedSample.r + modulatedSample.g + modulatedSample.b + modulatedSample.a;"," vec4 rampColor = getRampAt(progress);"," rampColor.rgb *= rampColor.a;"," gl_FragColor = mix(sample, rampColor * sample.a, uAlpha);","}"].join("\n")},94526(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uEnvSampler;","uniform sampler2D uNormSampler;","uniform mat4 uViewMatrix;","uniform float uModelRotation;","uniform float uBulge;","uniform vec3 uColorFactor;","varying vec2 outTexCoord;","#define PI 3.14159265358979323846","void main()","{"," vec4 color = texture2D(uMainSampler, outTexCoord);"," vec3 normal = texture2D(uNormSampler, outTexCoord).rgb;"," vec3 normalN = normal * 2.0 - 1.0;"," float normalXYLength = length(normalN.xy);"," float angle = atan("," normalN.y,"," normalN.x"," ) - uModelRotation;"," normalN = vec3("," normalXYLength * cos(angle),"," normalXYLength * sin(angle),"," normalN.z"," );"," normalN = reflect(vec3(0.0, 0.0, -1.0), normalN);"," normalN = (uViewMatrix * vec4(normalN, 1.0)).xyz;"," float envX = atan(normalN.x, normalN.z) / PI;"," float envY = sin(normalN.y * PI / 2.0);"," vec2 uv = vec2(envX, envY) * 0.5 + 0.5;"," vec2 rotatedTexCoord = vec2("," cos(-uModelRotation) * outTexCoord.x - sin(-uModelRotation) * outTexCoord.y,"," sin(-uModelRotation) * outTexCoord.x + cos(- uModelRotation) * outTexCoord.y"," );"," uv += uBulge * (rotatedTexCoord - 0.5);"," if (uv.y < 0.0)"," {"," uv.y = abs(uv.y);"," uv.x += 0.5;"," }"," else if (uv.y > 1.0)"," {"," uv.y = 2.0 - uv.y;"," uv.x += 0.5;"," }"," vec3 environment = texture2D(uEnvSampler, uv).rgb;"," gl_FragColor = vec4(environment * color.rgb * uColorFactor, color.a);","}"].join("\n")},4488(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec4 uColor;","uniform vec4 uIsolateThresholdFeather;","varying vec2 outTexCoord;","void main()","{"," vec4 color = texture2D(uMainSampler, outTexCoord);"," vec3 unpremultipliedColor = color.rgb / color.a;"," float isolate = uIsolateThresholdFeather.x;"," float threshold = uIsolateThresholdFeather.y;"," float feather = uIsolateThresholdFeather.z;"," float match = distance(unpremultipliedColor, uColor.rgb);"," match = clamp(match - threshold, 0.0, 1.0);"," match = clamp(match / feather, 0.0, 1.0);"," if (isolate == 1.0)"," {"," match = 1.0 - match;"," }"," match = mix(1.0, match, uColor.a);"," gl_FragColor = color * match;","}"].join("\n")},39603(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uMaskSampler;","uniform bool invert;","varying vec2 outTexCoord;","void main ()","{"," vec4 color = texture2D(uMainSampler, outTexCoord);"," vec4 mask = texture2D(uMaskSampler, outTexCoord);"," float a = mask.a;"," color *= invert ? (1.0 - a) : a;"," gl_FragColor = color;","}"].join("\n")},60047(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","#pragma phaserTemplate(fragmentHeader)","uniform sampler2D uMainSampler;","uniform mat4 uViewMatrix;","#ifdef FACING_POWER","uniform float uFacingPower;","#endif","#ifdef OUTPUT_RATIO","uniform vec3 uRatioVector;","uniform float uRatioRadius;","#endif","varying vec2 outTexCoord;","void main()","{"," vec3 normal = texture2D(uMainSampler, outTexCoord).rgb * 2.0 - 1.0;"," normal = (uViewMatrix * vec4(normal, 1.0)).xyz;"," #ifdef FACING_POWER"," normal = normalize(normal * vec3(1.0, 1.0, uFacingPower));"," #endif"," #ifdef OUTPUT_RATIO"," float ratio = dot(normal, normalize(uRatioVector));"," ratio = (ratio - 1.0 + uRatioRadius) / uRatioRadius;"," if (ratio <= 0.0)"," {"," ratio = 0.0;"," }"," normal = vec3(ratio * 2.0 - 1.0);"," #endif"," gl_FragColor = vec4((normal + 1.0) * 0.5, 1.0);","}"].join("\n")},7529(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform float uRadius;","uniform float uPower;","varying vec2 outTexCoord;","#define PI 3.14159265358979323846","#pragma phaserTemplate(fragmentHeader)","#define STEP_X 1.0 / SAMPLES_X","#define STEP_Y 1.0 / SAMPLES_Y","vec3 uvPanoramaNormal(vec2 uv)","{"," float y = uv.y * 2.0 - 1.0;"," float angle = (uv.x * 2.0 - 1.0) * PI;"," float x = sin(angle);"," float z = cos(angle);"," vec2 xz = vec2(x, z);"," xz *= sqrt(1.0 - y * y);"," return normalize(vec3(xz.x, y, xz.y));","}","void main()","{"," vec3 acc = vec3(0.0);"," float div = 0.0;"," vec3 texelNormal = uvPanoramaNormal(outTexCoord);"," for (float y = STEP_Y / 2.0; y < 1.0; y += STEP_Y)"," {"," float yWeight = cos((y * 2.0 - 1.0) * PI / 2.0);"," for (float x = STEP_X / 2.0; x < 1.0; x += STEP_X)"," {"," vec2 uv = vec2(x, y);"," vec3 sampleNormal = uvPanoramaNormal(uv);"," float dotProduct = dot(sampleNormal, texelNormal);"," dotProduct = (dotProduct - 1.0 + uRadius) / uRadius;"," if (dotProduct <= 0.0)"," {"," continue;"," }"," vec3 color = texture2D(uMainSampler, uv).rgb;"," color *= pow(length(color), uPower);"," acc += color * dotProduct * yWeight;"," div += dotProduct * yWeight;"," }"," }"," gl_FragColor = vec4(acc / div, 1.0);","}"].join("\n")},99191(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform float amount;","varying vec2 outTexCoord;","void main ()","{"," float pixelSize = floor(2.0 + amount);"," vec2 center = pixelSize * floor(outTexCoord * resolution / pixelSize) + pixelSize * vec2(0.5, 0.5);"," vec2 corner1 = center + pixelSize * vec2(-0.5, -0.5);"," vec2 corner2 = center + pixelSize * vec2(+0.5, -0.5);"," vec2 corner3 = center + pixelSize * vec2(+0.5, +0.5);"," vec2 corner4 = center + pixelSize * vec2(-0.5, +0.5);"," vec4 pixel = 0.4 * texture2D(uMainSampler, center / resolution);"," pixel += 0.15 * texture2D(uMainSampler, corner1 / resolution);"," pixel += 0.15 * texture2D(uMainSampler, corner2 / resolution);"," pixel += 0.15 * texture2D(uMainSampler, corner3 / resolution);"," pixel += 0.15 * texture2D(uMainSampler, corner4 / resolution);"," gl_FragColor = pixel;","}"].join("\n")},88430(t){t.exports=["#pragma phaserTemplate(shaderName)","precision highp float;","uniform sampler2D uMainSampler;","uniform vec4 uSteps;","uniform vec4 uGamma;","uniform vec4 uOffset;","uniform int uMode;","uniform bool uDither;","varying vec2 outTexCoord;","vec4 rgbaToHsva(vec4 rgba)","{"," float r = rgba.r;"," float g = rgba.g;"," float b = rgba.b;"," float a = rgba.a;"," float min = min(min(r, g), b);"," float max = max(max(r, g), b);"," float d = max - min;"," float h = 0.0;"," float s = (max == 0.0) ? 0.0 : d / max;"," float v = max;"," if (max != min)"," {"," if (max == r)"," {"," h = (g - b) / d + ((g < b) ? 6.0 : 0.0);"," }"," else if (max == g)"," {"," h = (b - r) / d + 2.0;"," }"," else"," {"," h = (r - g) / d + 4.0;"," }"," h /= 6.0;"," }"," return vec4(h, s, v, a);","}","float hsvaToRgbaConvert(float n, vec4 hsva)","{"," float k = mod(n + hsva.x * 6.0, 6.0);"," float min = min(min(k, 4.0 - k), 1.0);"," return hsva.z - hsva.z * hsva.y * max(0.0, min);","}","vec4 hsvaToRgba(vec4 hsva)","{"," return vec4("," hsvaToRgbaConvert(5.0, hsva),"," hsvaToRgbaConvert(3.0, hsva),"," hsvaToRgbaConvert(1.0, hsva),"," hsva.a"," );","}","vec4 ditherIGN(vec4 value)","{"," value += fract(52.9829189 * fract(0.06711056 * gl_FragCoord.x + 0.00583715 * gl_FragCoord.y)) - 0.5;"," return value;","}","void main ()","{"," vec4 sample = texture2D(uMainSampler, outTexCoord);"," if (uMode == 1)"," {"," sample = rgbaToHsva(sample);"," }"," sample = pow(sample, uGamma);"," sample -= uOffset;"," vec4 steps = max(uSteps - 1.0, 1.0);"," sample *= steps;"," if (uDither)"," {"," sample = ditherIGN(sample);"," }"," sample = ceil(sample - 0.5);"," sample /= steps;"," sample += uOffset;"," sample = pow(sample, 1.0 / uGamma);"," if (uMode == 1)"," {"," sample.x = mod(sample.x, 1.0);"," sample = hsvaToRgba(clamp(sample, 0.0, 1.0));"," }"," gl_FragColor = sample;","}"].join("\n")},69355(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","varying vec2 outTexCoord;","uniform vec2 lightPosition;","uniform vec4 color;","uniform float decay;","uniform float power;","uniform float intensity;","uniform int samples;","const int MAX = 12;","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec4 texture = boundedSampler(uMainSampler, outTexCoord);"," vec2 pc = (lightPosition - outTexCoord) * intensity;"," float shadow = 0.0;"," float limit = max(float(MAX), float(samples));"," for (int i = 0; i < MAX; ++i)"," {"," if (i >= samples)"," {"," break;"," }"," shadow += boundedSampler(uMainSampler, outTexCoord + float(i) * decay / limit * pc).a * power;"," }"," float mask = 1.0 - texture.a;"," gl_FragColor = mix(texture, color, clamp(shadow * mask, 0.0, 1.0));","}"].join("\n")},92636(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec4 edge1;","uniform vec4 edge2;","uniform vec4 invert;","varying vec2 outTexCoord;","void main ()","{"," vec4 color = texture2D(uMainSampler, outTexCoord);"," color = clamp((color - edge1) / (edge2 - edge1), 0.0, 1.0);"," color = mix(color, 1.0 - color, invert);"," gl_FragColor = color;","}"].join("\n")},18185(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform float uRadius;","uniform float uStrength;","uniform vec2 uPosition;","uniform vec4 uColor;","uniform int uBlendMode;","varying vec2 outTexCoord;","void main ()","{"," float vignette = 1.0;"," vec2 position = vec2(uPosition.x, 1.0 - uPosition.y);"," float d = length(outTexCoord - position);"," if (d <= uRadius)"," {"," float g = d / uRadius;"," vignette = sin(g * 3.14 * uStrength);"," }"," vec4 color = uColor;"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," if (uBlendMode == 1)"," {"," color.rgb = texture.rgb + color.rgb;"," }"," else if (uBlendMode == 2)"," {"," color.rgb = texture.rgb * color.rgb;"," }"," else if (uBlendMode == 3)"," {"," color.rgb = 1.0 - ((1.0 - texture.rgb) * (1.0 - color.rgb));"," }"," gl_FragColor = mix(texture, color, vignette);","}"].join("\n")},99174(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uMainSampler2;","uniform vec4 uProgress_WipeWidth_Direction_Axis;","uniform float uReveal;","varying vec2 outTexCoord;","void main ()","{"," vec4 color0;"," vec4 color1;"," if (uReveal == 0.0)"," {"," color0 = texture2D(uMainSampler, outTexCoord);"," color1 = texture2D(uMainSampler2, outTexCoord);"," }"," else"," {"," color0 = texture2D(uMainSampler2, outTexCoord);"," color1 = texture2D(uMainSampler, outTexCoord);"," }"," float distance = uProgress_WipeWidth_Direction_Axis.x;"," float width = uProgress_WipeWidth_Direction_Axis.y;"," float direction = uProgress_WipeWidth_Direction_Axis.z;"," float axis = outTexCoord.x;"," if (uProgress_WipeWidth_Direction_Axis.w == 1.0)"," {"," axis = outTexCoord.y;"," }"," float adjust = mix(width, -width, distance);"," float value = smoothstep(distance - width, distance + width, abs(direction - axis) + adjust);"," gl_FragColor = mix(color1, color0, value);","}"].join("\n")},73416(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(fragmentDefine)","uniform vec2 uResolution;","varying vec4 outTint;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec4 fragColor = outTint;"," #pragma phaserTemplate(fragmentProcess)"," gl_FragColor = fragColor;","}"].join("\n")},91627(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(vertexDefine)","uniform mat4 uProjectionMatrix;","uniform vec2 uResolution;","attribute vec2 inPosition;","attribute vec4 inTint;","varying vec4 outTint;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(vertexHeader)","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);"," outTint = vec4(inTint.bgr * inTint.a, inTint.a);"," #pragma phaserTemplate(vertexProcess)","}"].join("\n")},84220(t){t.exports=["vec3 getNormalFromMap (vec2 texCoord)","{"," vec3 normalMap = texture2D(uNormSampler, texCoord).rgb;"," return normalize(outInverseRotationMatrix * vec3(normalMap * 2.0 - 1.0));","}"].join("\n")},2860(t){t.exports=["uniform vec2 uMainResolution[TEXTURE_COUNT];","vec2 getTexRes ()","{"," #if TEXTURE_COUNT == 1"," float texId = 0.0;"," #else"," float texId = outTexDatum;"," #endif"," #pragma phaserTemplate(texIdProcess)"," vec2 texRes = vec2(0.0);"," for (int i = 0; i < TEXTURE_COUNT; i++)"," {"," if (texId == float(i))"," {"," texRes = uMainResolution[i];"," break;"," }"," }"," return texRes;","}"].join("\n")},46432(t){t.exports=["uniform sampler2D uMainSampler[TEXTURE_COUNT];","vec4 getTexture (vec2 texCoord)","{"," #if TEXTURE_COUNT == 1"," return texture2D(uMainSampler[0], texCoord);"," #else"," if (outTexDatum == 0.0) return texture2D(uMainSampler[0], texCoord);"," #define ELSE_TEX_CASE(INDEX) else if (outTexDatum == float(INDEX)) return texture2D(uMainSampler[INDEX], texCoord);"," #pragma phaserTemplate(texIdProcess)"," else return vec4(0.0, 0.0, 0.0, 0.0);"," #endif","}"].join("\n")},41509(t){t.exports=["#pragma phaserTemplate(shaderName)","precision highp float;","#pragma phaserTemplate(fragmentHeader)","#define PI 3.14159265358979323846","uniform int uRepeatMode;","uniform float uOffset;","uniform int uShapeMode;","uniform vec2 uShape;","uniform vec2 uStart;","varying vec2 outTexCoord;","float linear()","{"," float len = length(uShape);"," return dot(uShape, outTexCoord - uStart) / len / len;","}","float bilinear()","{"," return abs(linear());","}","float radial()","{"," return distance(uStart, outTexCoord) / length(uShape);","}","float conicSymmetric()","{"," return dot(normalize(uShape), normalize(outTexCoord - uStart)) * 0.5 + 0.5;","}","float conicAsymmetric()","{"," vec2 fromStart = outTexCoord - uStart;"," float angleFromStart = atan(fromStart.y, fromStart.x);"," float shapeAngle = atan(uShape.y, uShape.x);"," float angle = (angleFromStart - shapeAngle) / PI / 2.0;"," if (angle < 0.0) angle += 1.0;"," return angle;","}","float repeat(float value)","{"," if (uRepeatMode == 1)"," {"," if (value < 0.0 || value > 1.0)"," {"," discard;"," }"," return value;"," }"," else if (uRepeatMode == 2)"," {"," return mod(value, 1.0);"," }"," else if (uRepeatMode == 3)"," {"," return 1.0 - abs(1.0 - mod(value, 2.0));"," }"," return clamp(value, 0.0, 1.0);","}","void main()","{"," float progress = 0.0;"," if (uShapeMode == 0)"," {"," progress = linear();"," }"," else if (uShapeMode == 1)"," {"," progress = bilinear();"," }"," else if (uShapeMode == 2)"," {"," progress = radial();"," }"," else if (uShapeMode == 3)"," {"," progress = conicSymmetric();"," }"," else if (uShapeMode == 4)"," {"," progress = conicAsymmetric();"," }"," progress -= uOffset;"," progress = repeat(progress);"," vec4 bandCol = getRampAt(progress);"," bandCol.rgb *= bandCol.a;"," gl_FragColor = bandCol;","}"].join("\n")},98840(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(fragmentDefine)","uniform vec2 uResolution;","varying vec2 outTexCoord;","varying float outTexDatum;","varying float outTintEffect;","varying vec4 outTint;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," #pragma phaserTemplate(fragmentProcess)"," gl_FragColor = fragColor;","}"].join("\n")},44667(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(vertexDefine)","uniform mat4 uProjectionMatrix;","uniform vec2 uResolution;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","attribute float inTexDatum;","attribute float inTintEffect;","attribute vec4 inTint;","varying vec2 outTexCoord;","varying float outTexDatum;","varying float outTintEffect;","varying vec4 outTint;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(vertexHeader)","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);"," outTexCoord = inTexCoord;"," outTexDatum = inTexDatum;"," outTint = inTint;"," outTintEffect = inTintEffect;"," #pragma phaserTemplate(vertexProcess)","}"].join("\n")},16421(t){t.exports=["#version 100","#pragma phaserTemplate(shaderName)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform vec2 uOffset;","uniform vec4 uColorStart;","uniform vec4 uColorEnd;","uniform float uPower;","uniform int uMode;","varying vec2 outTexCoord;","float trig(vec2 p)","{"," return fract(43757.5453*sin(dot(p, vec2(12.9898,78.233))));","}","void main ()","{"," float value = pow(trig(outTexCoord + uOffset), uPower);"," if (uMode == 0)"," {"," vec4 color = mix(uColorStart, uColorEnd, value);"," color.rgb *= color.a;"," gl_FragColor = color;"," }"," else if (uMode == 1)"," {"," float valueR = pow(trig(outTexCoord + uOffset + 32.1), uPower);"," float valueG = pow(trig(outTexCoord + uOffset + 11.1), uPower);"," float valueB = pow(trig(outTexCoord + uOffset + 23.4), uPower);"," vec4 color = vec4(valueR, valueG, valueB, 1.);"," color *= mix(uColorStart, uColorEnd, value);"," color.rgb *= color.a;"," gl_FragColor = color;"," }"," else if (uMode == 2)"," {"," float valueAngle = pow(trig(outTexCoord + uOffset), uPower) * 3.141592;"," float x = value * cos(valueAngle);"," float y = value * sin(valueAngle);"," vec4 color = vec4("," x,"," y,"," sqrt(1. - x * x - y * y),"," 1.0"," );"," gl_FragColor = color * 0.5 + 0.5;"," }","}"].join("\n")},83587(t){t.exports=["#version 100","#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(fragmentIterations)","#pragma phaserTemplate(fragmentNormalMap)","#ifndef ITERATION_COUNT","#define ITERATION_COUNT 1.0","#endif","#ifndef WARP_ITERATION_COUNT","#define WARP_ITERATION_COUNT 1.0","#endif","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform vec2 uCells;","uniform vec2 uPeriod;","uniform vec2 uOffset;","uniform float uFlow;","uniform float uDetailPower;","uniform float uFlowPower;","uniform float uContributionPower;","uniform float uWarpDetailPower;","uniform float uWarpFlowPower;","uniform float uWarpContributionPower;","uniform float uWarpAmount;","uniform vec4 uColorStart;","uniform vec4 uColorEnd;","uniform float uNormalScale;","uniform float uValueFactor;","uniform float uValueAdd;","uniform float uValuePower;","uniform vec2 uSeed;","varying vec2 outTexCoord;","float psrdnoise(vec2 x, vec2 period, float alpha)","{"," vec2 uv = vec2(x.x+x.y*0.5, x.y);"," vec2 i0 = floor(uv), f0 = fract(uv);"," float cmp = step(f0.y, f0.x);"," vec2 o1 = vec2(cmp, 1.0-cmp);"," vec2 i1 = i0 + o1, i2 = i0 + 1.0;"," vec2 v0 = vec2(i0.x - i0.y*0.5, i0.y);"," vec2 v1 = vec2(v0.x + o1.x - o1.y*0.5, v0.y + o1.y);"," vec2 v2 = vec2(v0.x + 0.5, v0.y + 1.0);"," vec2 x0 = x - v0, x1 = x - v1, x2 = x - v2;"," vec3 iu, iv, xw, yw;"," if(any(greaterThan(period, vec2(0.0)))) {"," xw = vec3(v0.x, v1.x, v2.x); yw = vec3(v0.y, v1.y, v2.y);"," if(period.x > 0.0)"," xw = mod(vec3(v0.x, v1.x, v2.x), period.x);"," if(period.y > 0.0)"," yw = mod(vec3(v0.y, v1.y, v2.y), period.y);"," iu = floor(xw + 0.5*yw + 0.5); iv = floor(yw + 0.5);"," } else {"," iu = vec3(i0.x, i1.x, i2.x); iv = vec3(i0.y, i1.y, i2.y);"," }"," iu += uSeed.xxx; iv += uSeed.yyy;"," vec3 hash = mod(iu, 289.0);"," hash = mod((hash*51.0 + 2.0)*hash + iv, 289.0);"," hash = mod((hash*34.0 + 10.0)*hash, 289.0);"," vec3 psi = hash*0.07482 + alpha;"," vec3 gx = cos(psi); vec3 gy = sin(psi);"," vec2 g0 = vec2(gx.x, gy.x);"," vec2 g1 = vec2(gx.y, gy.y);"," vec2 g2 = vec2(gx.z, gy.z);"," vec3 w = 0.8 - vec3(dot(x0, x0), dot(x1, x1), dot(x2, x2));"," w = max(w, 0.0); vec3 w2 = w*w; vec3 w4 = w2*w2;"," vec3 gdotx = vec3(dot(g0, x0), dot(g1, x1), dot(g2, x2));"," float n = dot(w4, gdotx);"," return 10.9*n;","}","float iterate (vec2 coord, float detailPower, float flowPower, float contributionPower)","{"," float value = 0.;"," float itValue = 0.;"," for (float iteration = 0.; iteration < ITERATION_COUNT; iteration++)"," {"," float detailScale = pow(detailPower, iteration);"," float flowScale = pow(flowPower, iteration);"," itValue = psrdnoise((coord + iteration) * detailScale, uPeriod * detailScale, uFlow * flowScale + iteration);"," value += itValue / pow(contributionPower, iteration);"," }"," return value;","}","float iterateWarp (vec2 coord, float detailPower, float flowPower, float contributionPower)","{"," float value = 0.;"," float itValue = 0.;"," for (float iteration = 0.; iteration < WARP_ITERATION_COUNT; iteration++)"," {"," float detailScale = pow(detailPower, iteration);"," float flowScale = pow(flowPower, iteration);"," itValue = psrdnoise((coord + iteration) * detailScale, uPeriod * detailScale, uFlow * flowScale + iteration);"," value += itValue / pow(contributionPower, iteration);"," }"," return value;","}","vec2 warp (vec2 coord)","{"," vec2 o2 = vec2(11.3, 23.7);"," float coord1 = iterateWarp(coord, uWarpDetailPower, uWarpFlowPower, uWarpContributionPower);"," float coord2 = iterateWarp(coord + o2, uWarpDetailPower, uWarpFlowPower, uWarpContributionPower);"," return vec2(coord1, coord2);","}","void main ()","{"," vec2 coord = outTexCoord * uCells + uOffset;"," if (uWarpAmount > 0.)"," {"," coord += warp(coord) * uWarpAmount;"," }"," float value = iterate(coord, uDetailPower, uFlowPower, uContributionPower) * uValueFactor + uValueAdd;"," value = pow(clamp(value, 0., 1.), uValuePower);"," #ifndef NORMAL_MAP"," vec4 color = mix(uColorStart, uColorEnd, value);"," color.rgb *= color.a;"," gl_FragColor = color;"," #else"," float dx = dFdx(value) * uNormalScale;"," float dy = dFdy(value) * uNormalScale;"," vec3 normal = vec3(dx, dy, 1.0 - sqrt(dx * dx + dy * dy)) * 0.5 + 0.5;"," gl_FragColor = vec4(normal, 1.0);"," #endif","}"].join("\n")},13460(t){t.exports=["#version 100","#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(fragmentIterations)","#pragma phaserTemplate(fragmentNormalMap)","#ifndef ITERATION_COUNT","#define ITERATION_COUNT 1.0","#endif","#ifndef WARP_ITERATION_COUNT","#define WARP_ITERATION_COUNT 1.0","#endif","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform vec3 uCells;","uniform vec3 uPeriod;","uniform vec3 uOffset;","uniform float uFlow;","uniform float uDetailPower;","uniform float uFlowPower;","uniform float uContributionPower;","uniform float uWarpDetailPower;","uniform float uWarpFlowPower;","uniform float uWarpContributionPower;","uniform float uWarpAmount;","uniform vec4 uColorStart;","uniform vec4 uColorEnd;","uniform float uNormalScale;","uniform float uValueFactor;","uniform float uValueAdd;","uniform float uValuePower;","uniform vec3 uSeed;","varying vec2 outTexCoord;","vec4 permute(vec4 i) {"," vec4 im = mod(i, 289.0);"," return mod(((im * 34.0) + 10.0) * im, 289.0);","}","float psrdnoise(vec3 x, vec3 period, float alpha) {"," const mat3 M = mat3(0.0, 1.0, 1.0, 1.0, 0.0, 1.0, 1.0, 1.0, 0.0);"," const mat3 Mi = mat3(-0.5, 0.5, 0.5, 0.5, -0.5, 0.5, 0.5, 0.5, -0.5);"," vec3 uvw = M * x;"," vec3 i0 = floor(uvw);"," vec3 f0 = fract(uvw);"," vec3 g_ = step(f0.xyx, f0.yzz);"," vec3 l_ = 1.0 - g_;"," vec3 g = vec3(l_.z, g_.xy);"," vec3 l = vec3(l_.xy, g_.z);"," vec3 o1 = min(g, l);"," vec3 o2 = max(g, l);"," vec3 i1 = i0 + o1, i2 = i0 + o2, i3 = i0 + 1.0;"," vec3 v0 = Mi * i0, v1 = Mi * i1, v2 = Mi * i2, v3 = Mi * i3;"," vec3 x0 = x - v0, x1 = x - v1, x2 = x - v2, x3 = x - v3;"," if(any(greaterThan(period, vec3(0.0)))) {"," vec4 vx = vec4(v0.x, v1.x, v2.x, v3.x);"," vec4 vy = vec4(v0.y, v1.y, v2.y, v3.y);"," vec4 vz = vec4(v0.z, v1.z, v2.z, v3.z);"," if(period.x > 0.0)"," vx = mod(vx, period.x);"," if(period.y > 0.0)"," vy = mod(vy, period.y);"," if(period.z > 0.0)"," vz = mod(vz, period.z);"," i0 = floor(M * vec3(vx.x, vy.x, vz.x) + 0.5);"," i1 = floor(M * vec3(vx.y, vy.y, vz.y) + 0.5);"," i2 = floor(M * vec3(vx.z, vy.z, vz.z) + 0.5);"," i3 = floor(M * vec3(vx.w, vy.w, vz.w) + 0.5);"," }"," i0 += uSeed; i1 += uSeed; i2 += uSeed; i3 += uSeed;"," vec4 hash = permute(permute(permute(vec4(i0.z, i1.z, i2.z, i3.z)) + vec4(i0.y, i1.y, i2.y, i3.y)) + vec4(i0.x, i1.x, i2.x, i3.x));"," vec4 theta = hash * 3.883222077;"," vec4 sz = 0.996539792 - 0.006920415 * hash;"," vec4 psi = hash * 0.108705628;"," vec4 Ct = cos(theta);"," vec4 St = sin(theta);"," vec4 sz_prime = sqrt(1.0 - sz * sz);"," vec4 gx, gy, gz;"," if(alpha != 0.0) {"," vec4 px = Ct * sz_prime;"," vec4 py = St * sz_prime;"," vec4 pz = sz;"," vec4 Sp = sin(psi);"," vec4 Cp = cos(psi);"," vec4 Ctp = St * Sp - Ct * Cp;"," vec4 qx = mix(Ctp * St, Sp, sz);"," vec4 qy = mix(-Ctp * Ct, Cp, sz);"," vec4 qz = -(py * Cp + px * Sp);"," vec4 Sa = vec4(sin(alpha));"," vec4 Ca = vec4(cos(alpha));"," gx = Ca * px + Sa * qx;"," gy = Ca * py + Sa * qy;"," gz = Ca * pz + Sa * qz;"," } else {"," gx = Ct * sz_prime;"," gy = St * sz_prime;"," gz = sz;"," }"," vec3 g0 = vec3(gx.x, gy.x, gz.x), g1 = vec3(gx.y, gy.y, gz.y);"," vec3 g2 = vec3(gx.z, gy.z, gz.z), g3 = vec3(gx.w, gy.w, gz.w);"," vec4 w = 0.5 - vec4(dot(x0, x0), dot(x1, x1), dot(x2, x2), dot(x3, x3));"," w = max(w, 0.0);"," vec4 w2 = w * w;"," vec4 w3 = w2 * w;"," vec4 gdotx = vec4(dot(g0, x0), dot(g1, x1), dot(g2, x2), dot(g3, x3));"," float n = dot(w3, gdotx);"," return 39.5 * n;","}","float iterate (vec3 coord, float detailPower, float flowPower, float contributionPower)","{"," float value = 0.;"," float itValue = 0.;"," for (float iteration = 0.; iteration < ITERATION_COUNT; iteration++)"," {"," float detailScale = pow(detailPower, iteration);"," float flowScale = pow(flowPower, iteration);"," itValue = psrdnoise((coord + iteration) * detailScale, uPeriod * detailScale, uFlow * flowScale + iteration);"," value += itValue / pow(contributionPower, iteration);"," }"," return value;","}","float iterateWarp (vec3 coord, float detailPower, float flowPower, float contributionPower)","{"," float value = 0.;"," float itValue = 0.;"," for (float iteration = 0.; iteration < WARP_ITERATION_COUNT; iteration++)"," {"," float detailScale = pow(detailPower, iteration);"," float flowScale = pow(flowPower, iteration);"," itValue = psrdnoise((coord + iteration) * detailScale, uPeriod * detailScale, uFlow * flowScale + iteration);"," value += itValue / pow(contributionPower, iteration);"," }"," return value;","}","vec3 warp (vec3 coord)","{"," vec3 o2 = vec3(11.3, 23.7, 13.1);"," vec3 o3 = vec3(29.9, 2.3, 31.7);"," float coord1 = iterateWarp(coord, uWarpDetailPower, uWarpFlowPower, uWarpContributionPower);"," float coord2 = iterateWarp(coord + o2, uWarpDetailPower, uWarpFlowPower, uWarpContributionPower);"," float coord3 = iterateWarp(coord + o3, uWarpDetailPower, uWarpFlowPower, uWarpContributionPower);"," return vec3(coord1, coord2, coord3);","}","void main ()","{"," vec3 coord = (vec3(outTexCoord, 0.0) * uCells) + uOffset;"," if (uWarpAmount > 0.)"," {"," coord += warp(coord) * uWarpAmount;"," }"," float value = iterate(coord, uDetailPower, uFlowPower, uContributionPower) * uValueFactor + uValueAdd;"," value = pow(clamp(value, 0., 1.), uValuePower);"," #ifndef NORMAL_MAP"," vec4 color = mix(uColorStart, uColorEnd, value);"," color.rgb *= color.a;"," gl_FragColor = color;"," #else"," float dx = dFdx(value) * uNormalScale;"," float dy = dFdy(value) * uNormalScale;"," vec3 normal = vec3(dx, dy, 1.0 - sqrt(dx * dx + dy * dy)) * 0.5 + 0.5;"," gl_FragColor = vec4(normal, 1.0);"," #endif","}"].join("\n")},17205(t){t.exports=["#version 100","#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(fragmentMode)","#pragma phaserTemplate(fragmentIterations)","#pragma phaserTemplate(fragmentNormalMap)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform vec2 uSeedX;","uniform vec2 uSeedY;","uniform vec2 uCells;","uniform vec2 uCellOffset;","uniform vec2 uVariation;","uniform vec2 uWrap;","uniform float uSmoothing;","uniform float uNormalScale;","uniform vec4 uColorStart;","uniform vec4 uColorEnd;","varying vec2 outTexCoord;","float trig(vec2 p)","{"," return fract(43757.5453*sin(dot(p, vec2(12.9898,78.233))));","}","vec2 bigCoord (vec2 coord, float scale)","{"," return (coord + uCellOffset) * scale * uCells;","}","vec2 hash2D (vec2 coord)","{"," return vec2("," trig(coord + uSeedX),"," trig(coord + uSeedY)"," ) * uVariation;","}","float worley2D (vec2 uv, float scale)","{"," vec2 coord = bigCoord(uv, scale);"," vec2 point = floor(coord);"," vec2 frac = fract(coord);"," float dist = 12.0;"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec2 cellNeighbor = vec2(i, j);"," vec2 jitter = hash2D(mod(point + cellNeighbor, uWrap * scale));"," vec2 diff = cellNeighbor - frac + jitter;"," float d = dot(diff, diff); // Squared length of diff."," if (d < dist)"," {"," dist = d;"," }"," }"," return sqrt(dist);","}","float worley2DIndex (vec2 uv, float scale)","{"," vec2 coord = bigCoord(uv, scale);"," vec2 point = floor(coord);"," vec2 frac = fract(coord);"," float dist = 12.0;"," float random = 0.0;"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec2 cellNeighbor = vec2(i, j);"," vec2 jitter = hash2D(mod(point + cellNeighbor, uWrap * scale));"," vec2 diff = cellNeighbor - frac + jitter;"," float d = dot(diff, diff); // Squared length of diff."," if (d < dist)"," {"," dist = d;"," random = jitter.x;"," }"," }"," return random;","}","float worley2DSmooth (vec2 uv, float scale)","{"," vec2 coord = bigCoord(uv, scale);"," vec2 point = floor(coord);"," vec2 frac = fract(coord);"," float value = 0.0;"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec2 cellNeighbor = vec2(i, j);"," vec2 jitter = hash2D(mod(point + cellNeighbor, uWrap * scale));"," vec2 diff = cellNeighbor - frac + jitter;"," float d = length(diff);"," value += exp2(-32.0 / uSmoothing * d); // Accumulate fast-decaying exponential of length."," }"," return -(1.0 / 32.0 * uSmoothing) * log2(value);","}","float iterateWorley2D (vec2 uv)","{"," float value = 0.0;"," float itValue = 0.0;"," for (float iteration = 0.0; iteration < ITERATION_COUNT; iteration++)"," {"," float scale = exp2(iteration);"," #ifdef MODE_DISTANCE"," itValue = worley2D(uv + iteration, scale);"," #endif"," #ifdef MODE_INDEX"," itValue = worley2DIndex(uv + iteration, scale);"," #endif"," #ifdef MODE_DISTANCE_SMOOTH"," itValue = worley2DSmooth(uv + iteration, scale);"," #endif"," value += (itValue - 0.5) / scale;"," }"," return value + 0.5;","}","void main ()","{"," float value = iterateWorley2D(outTexCoord);"," #ifndef NORMAL_MAP"," vec4 color = mix(uColorStart, uColorEnd, value);"," color.rgb *= color.a;"," gl_FragColor = color;"," #else"," float dx = dFdx(value) * uNormalScale;"," float dy = dFdy(value) * uNormalScale;"," vec3 normal = vec3(dx, dy, 1.0 - sqrt(dx * dx + dy * dy)) * 0.5 + 0.5;"," gl_FragColor = vec4(normal, 1.0);"," #endif","}"].join("\n")},79814(t){t.exports=["#version 100","#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(fragmentMode)","#pragma phaserTemplate(fragmentIterations)","#pragma phaserTemplate(fragmentNormalMap)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform vec3 uSeedX;","uniform vec3 uSeedY;","uniform vec3 uSeedZ;","uniform vec3 uCells;","uniform vec3 uCellOffset;","uniform vec3 uVariation;","uniform vec3 uWrap;","uniform float uSmoothing;","uniform float uNormalScale;","uniform vec4 uColorStart;","uniform vec4 uColorEnd;","varying vec2 outTexCoord;","float trig(vec3 p)","{"," return fract(43757.5453*sin(dot(p, vec3(12.9898,78.233, 9441.8953))));","}","vec3 bigCoord (vec3 coord, float scale)","{"," return (coord + uCellOffset) * scale * uCells;","}","vec3 hash3D (vec3 coord)","{"," return vec3("," trig(coord + uSeedX),"," trig(coord + uSeedY),"," trig(coord + uSeedZ)"," ) * uVariation;","}","float worley3D (vec3 uv, float scale)","{"," vec3 coord = bigCoord(uv, scale);"," vec3 point = floor(coord);"," vec3 frac = fract(coord);"," float dist = 12.0;"," for (float k = -1.0; k <= 1.0; k++)"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec3 cellNeighbor = vec3(i, j, k);"," vec3 jitter = hash3D(mod(point + cellNeighbor, uWrap * scale));"," vec3 diff = cellNeighbor - frac + jitter;"," float d = dot(diff, diff); // Squared length of diff."," if (d < dist)"," {"," dist = d;"," }"," }"," return sqrt(dist);","}","float worley3DIndex (vec3 uv, float scale)","{"," vec3 coord = bigCoord(uv, scale);"," vec3 point = floor(coord);"," vec3 frac = fract(coord);"," float dist = 12.0;"," float random = 0.0;"," for (float k = -1.0; k <= 1.0; k++)"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec3 cellNeighbor = vec3(i, j, k);"," vec3 jitter = hash3D(mod(point + cellNeighbor, uWrap * scale));"," vec3 diff = cellNeighbor - frac + jitter;"," float d = dot(diff, diff); // Squared length of diff."," if (d < dist)"," {"," dist = d;"," random = jitter.x;"," }"," }"," return random;","}","float worley3DSmooth (vec3 uv, float scale)","{"," vec3 coord = bigCoord(uv, scale);"," vec3 point = floor(coord);"," vec3 frac = fract(coord);"," float value = 0.0;"," for (float k = -1.0; k <= 1.0; k++)"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec3 cellNeighbor = vec3(i, j, k);"," vec3 jitter = hash3D(mod(point + cellNeighbor, uWrap * scale));"," vec3 diff = cellNeighbor - frac + jitter;"," float d = length(diff);"," value += exp2(-32.0 / uSmoothing * d); // Accumulate fast-decaying exponential of length."," }"," return -(1.0 / 32.0 * uSmoothing) * log2(value);","}","float iterateWorley3D (vec3 uv)","{"," float value = 0.0;"," float itValue = 0.0;"," for (float iteration = 0.0; iteration < ITERATION_COUNT; iteration++)"," {"," float scale = exp2(iteration);"," #ifdef MODE_DISTANCE"," itValue = worley3D(uv + iteration, scale);"," #endif"," #ifdef MODE_INDEX"," itValue = worley3DIndex(uv + iteration, scale);"," #endif"," #ifdef MODE_DISTANCE_SMOOTH"," itValue = worley3DSmooth(uv + iteration, scale);"," #endif"," value += (itValue - 0.5) / scale;"," }"," return value + 0.5;","}","void main ()","{"," vec3 uv = vec3(outTexCoord, 0.0);"," float value = iterateWorley3D(uv);"," #ifndef NORMAL_MAP"," vec4 color = mix(uColorStart, uColorEnd, value);"," color.rgb *= color.a;"," gl_FragColor = color;"," #else"," float dx = dFdx(value) * uNormalScale;"," float dy = dFdy(value) * uNormalScale;"," vec3 normal = vec3(dx, dy, 1.0 - sqrt(dx * dx + dy * dy)) * 0.5 + 0.5;"," gl_FragColor = vec4(normal, 1.0);"," #endif","}"].join("\n")},99595(t){t.exports=["#version 100","#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(fragmentMode)","#pragma phaserTemplate(fragmentIterations)","#pragma phaserTemplate(fragmentNormalMap)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform vec4 uSeedX;","uniform vec4 uSeedY;","uniform vec4 uSeedZ;","uniform vec4 uSeedW;","uniform vec4 uCells;","uniform vec4 uCellOffset;","uniform vec4 uVariation;","uniform vec4 uWrap;","uniform float uSmoothing;","uniform float uNormalScale;","uniform vec4 uColorStart;","uniform vec4 uColorEnd;","varying vec2 outTexCoord;","float trig(vec4 p)","{"," return fract(43757.5453*sin(dot(p, vec4(12.9898,78.233,9441.8953,61.99))));","}","vec4 bigCoord (vec4 coord, float scale)","{"," return (coord + uCellOffset) * scale * uCells;","}","vec4 hash4D (vec4 coord)","{"," return vec4("," trig(coord + uSeedX),"," trig(coord + uSeedY),"," trig(coord + uSeedZ),"," trig(coord + uSeedW)"," ) * uVariation;","}","float worley4D (vec4 uv, float scale)","{"," vec4 coord = bigCoord(uv, scale);"," vec4 point = floor(coord);"," vec4 frac = fract(coord);"," float dist = 16.0;"," for (float l = -1.0; l <= 1.0; l++)"," for (float k = -1.0; k <= 1.0; k++)"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec4 cellNeighbor = vec4(i, j, k, l);"," vec4 jitter = hash4D(mod(point + cellNeighbor, uWrap * scale));"," vec4 diff = cellNeighbor - frac + jitter;"," float d = dot(diff, diff); // Squared length of diff."," if (d < dist)"," {"," dist = d;"," }"," }"," return sqrt(dist);","}","float worley4DIndex (vec4 uv, float scale)","{"," vec4 coord = bigCoord(uv, scale);"," vec4 point = floor(coord);"," vec4 frac = fract(coord);"," float dist = 16.0;"," float random = 0.0;"," for (float l = -1.0; l <= 1.0; l++)"," for (float k = -1.0; k <= 1.0; k++)"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec4 cellNeighbor = vec4(i, j, k, l);"," vec4 jitter = hash4D(mod(point + cellNeighbor, uWrap * scale));"," vec4 diff = cellNeighbor - frac + jitter;"," float d = dot(diff, diff); // Squared length of diff."," if (d < dist)"," {"," dist = d;"," random = jitter.x;"," }"," }"," return random;","}","float worley4DSmooth (vec4 uv, float scale)","{"," vec4 coord = bigCoord(uv, scale);"," vec4 point = floor(coord);"," vec4 frac = fract(coord);"," float value = 0.0;"," for (float l = -1.0; l <= 1.0; l++)"," for (float k = -1.0; k <= 1.0; k++)"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec4 cellNeighbor = vec4(i, j, k, l);"," vec4 jitter = hash4D(mod(point + cellNeighbor, uWrap * scale));"," vec4 diff = cellNeighbor - frac + jitter;"," float d = length(diff);"," value += exp2(-32.0 / uSmoothing * d); // Accumulate fast-decaying exponential of length."," }"," return -(1.0 / 32.0 * uSmoothing) * log2(value);","}","float iterateWorley4D (vec4 uv)","{"," float value = 0.0;"," float itValue = 0.0;"," for (float iteration = 0.0; iteration < ITERATION_COUNT; iteration++)"," {"," float scale = exp2(iteration);"," #ifdef MODE_DISTANCE"," itValue = worley4D(uv + iteration, scale);"," #endif"," #ifdef MODE_INDEX"," itValue = worley4DIndex(uv + iteration, scale);"," #endif"," #ifdef MODE_DISTANCE_SMOOTH"," itValue = worley4DSmooth(uv + iteration, scale);"," #endif"," value += (itValue - 0.5) / scale;"," }"," return value + 0.5;","}","void main ()","{"," vec4 uv = vec4(outTexCoord, 0.0, 0.0);"," float value = iterateWorley4D(uv);"," #ifndef NORMAL_MAP"," vec4 color = mix(uColorStart, uColorEnd, value);"," color.rgb *= color.a;"," gl_FragColor = color;"," #else"," float dx = dFdx(value) * uNormalScale;"," float dy = dFdy(value) * uNormalScale;"," vec3 normal = vec3(dx, dy, 1.0 - sqrt(dx * dx + dy * dy)) * 0.5 + 0.5;"," gl_FragColor = vec4(normal, 1.0);"," #endif","}"].join("\n")},62807(t){t.exports=["float inverseRotation = -rotation - uCamera.z;","float irSine = sin(inverseRotation);","float irCosine = cos(inverseRotation);","outInverseRotationMatrix = mat3("," irCosine, irSine, 0.0,"," -irSine, irCosine, 0.0,"," 0.0, 0.0, 1.0",");"].join("\n")},4127(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","precision mediump float;","#pragma phaserTemplate(fragmentDefine)","uniform vec2 uResolution;","uniform float uCameraZoom;","varying vec4 lightPosition;","varying vec4 lightColor;","varying float lightRadius;","varying float lightAttenuation;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec2 center = (lightPosition.xy + 1.0) * (uResolution.xy * 0.5);"," float distToSurf = length(center - gl_FragCoord.xy);"," float radius = 1.0 - distToSurf / (lightRadius * uCameraZoom);"," float intensity = smoothstep(0.0, 1.0, radius * lightAttenuation);"," vec4 color = vec4(intensity, intensity, intensity, 0.0) * lightColor;"," #pragma phaserTemplate(fragmentProcess)"," gl_FragColor = vec4(color.rgb * lightColor.a, color.a);","}"].join("\n")},89924(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","precision mediump float;","#pragma phaserTemplate(vertexDefine)","uniform mat4 uProjectionMatrix;","attribute vec2 inPosition;","attribute vec2 inLightPosition;","attribute vec4 inLightColor;","attribute float inLightRadius;","attribute float inLightAttenuation;","varying vec4 lightPosition;","varying vec4 lightColor;","varying float lightRadius;","varying float lightAttenuation;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(vertexHeader)","void main ()","{"," lightColor = inLightColor;"," lightRadius = inLightRadius;"," lightAttenuation = inLightAttenuation;"," lightPosition = uProjectionMatrix * vec4(inLightPosition, 1.0, 1.0);"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);"," #pragma phaserTemplate(vertexProcess)","}"].join("\n")},68589(t){t.exports=["#extension GL_OES_standard_derivatives : enable","#define BAND_TREE_DEPTH 0.0","uniform sampler2D uRampTexture;","uniform vec2 uRampResolution;","uniform float uRampBandStart;","uniform bool uDither;","float decodeNumberSample(vec4 sample)","{"," return ("," sample.r * 255.0 +"," sample.g * 255.0 * 256.0 +"," sample.b * 255.0 * 256.0 * 256.0 +"," sample.a * 255.0 * 256.0 * 256.0 * 256.0"," ) / 256.0 / 256.0;","}","struct Band","{"," vec4 colorStart;"," vec4 colorEnd;"," float start;"," float end;"," int colorSpace;"," int interpolation;"," float middle;","};","Band getBand(float progress)","{"," vec2 rampStep = 1.0 / uRampResolution;"," vec2 c = rampStep / 2.0;"," float start = decodeNumberSample(texture2D(uRampTexture, c));"," float end = decodeNumberSample(texture2D(uRampTexture, vec2(1.0, 0.0) * rampStep + c));"," float TREE_OFFSET = 2.0; // Beginning of tree block."," float index = 0.0;"," float x, y;"," for (float i = 0.0; i < BAND_TREE_DEPTH; i++)"," {"," x = mod(index + TREE_OFFSET, uRampResolution.x);"," y = floor(x / uRampResolution.x);"," float pivot = decodeNumberSample(texture2D(uRampTexture, vec2(x, y) * rampStep + c));"," if (progress > pivot)"," {"," start = pivot;"," index = index * 2.0 + 2.0;"," }"," else"," {"," end = pivot;"," index = index * 2.0 + 1.0;"," }"," }"," float bandNumber = index - uRampBandStart + TREE_OFFSET;"," float bandIndex = bandNumber * 3.0 + uRampBandStart;"," x = mod(bandIndex, uRampResolution.x);"," y = floor(bandIndex / uRampResolution.x);"," vec4 colorStart = texture2D(uRampTexture, vec2(x, y) * rampStep + c);"," x = mod(bandIndex + 1.0, uRampResolution.x);"," y = floor(bandIndex / uRampResolution.x);"," vec4 colorEnd = texture2D(uRampTexture, vec2(x, y) * rampStep + c);"," x = mod(bandIndex + 2.0, uRampResolution.x);"," y = floor(bandIndex / uRampResolution.x);"," float bandData = decodeNumberSample(texture2D(uRampTexture, vec2(x, y) * rampStep + c));"," int colorSpace = int(floor(bandData / 255.0));"," int interpolation = int(floor(bandData)) - colorSpace * 255;"," return Band(colorStart, colorEnd, start, end, colorSpace, interpolation, fract(bandData) * 2.0);","}","float interpolate(float progress, int mode)","{"," if (mode == 1)"," {"," if ((progress *= 2.0) < 1.0)"," {"," return 0.5 * sqrt(1.0 - (--progress * progress));"," }"," progress = 1.0 - progress;"," return 1.0 - 0.5 * sqrt(1.0 - progress * progress);"," }"," if (mode == 2)"," {"," return sin((progress - 0.5) * 3.14159265358979323846) * 0.5 + 0.5;"," }"," if (mode == 3)"," {"," return sqrt(1.0 - (--progress * progress));"," }"," if (mode == 4)"," {"," return 1.0 - sqrt(1.0 - progress * progress);"," }"," return progress;","}","float ditherIGN(float value)","{"," float dx = dFdx(value);"," float dy = dFdy(value);"," float rateOfChange = sqrt(dx * dx + dy * dy);"," value += (fract(52.9829189 * fract(0.06711056 * gl_FragCoord.x + 0.00583715 * gl_FragCoord.y)) - 0.5) * rateOfChange;"," return value;","}","vec4 rgbaToHsva(vec4 rgba)","{"," float r = rgba.r;"," float g = rgba.g;"," float b = rgba.b;"," float a = rgba.a;"," float min = min(min(r, g), b);"," float max = max(max(r, g), b);"," float d = max - min;"," float h = 0.0;"," float s = (max == 0.0) ? 0.0 : d / max;"," float v = max;"," if (max != min)"," {"," if (max == r)"," {"," h = (g - b) / d + ((g < b) ? 6.0 : 0.0);"," }"," else if (max == g)"," {"," h = (b - r) / d + 2.0;"," }"," else"," {"," h = (r - g) / d + 4.0;"," }"," h /= 6.0;"," }"," return vec4(h, s, v, a);","}","float hsvaToRgbaConvert(float n, vec4 hsva)","{"," float k = mod(n + hsva.x * 6.0, 6.0);"," float min = min(min(k, 4.0 - k), 1.0);"," return hsva.z - hsva.z * hsva.y * max(0.0, min);","}","vec4 hsvaToRgba(vec4 hsva)","{"," return vec4("," hsvaToRgbaConvert(5.0, hsva),"," hsvaToRgbaConvert(3.0, hsva),"," hsvaToRgbaConvert(1.0, hsva),"," hsva.a"," );","}","vec4 mixBandColor(float progress, Band band)","{"," if (band.colorSpace == 0)"," {"," return mix(band.colorStart, band.colorEnd, progress);"," }"," vec4 hsvaStart = rgbaToHsva(band.colorStart);"," vec4 hsvaEnd = rgbaToHsva(band.colorEnd);"," if (band.colorSpace == 1)"," {"," float dH = hsvaStart.x - hsvaEnd.x;"," if (dH > 0.5)"," {"," hsvaStart.x -= 1.0;"," }"," else if (dH < -0.5)"," {"," hsvaStart.x += 1.0;"," }"," }"," else if (band.colorSpace == 2)"," {"," if (hsvaStart.x > hsvaEnd.x)"," {"," hsvaStart.x -= 1.0;"," }"," }"," else if (band.colorSpace == 3)"," {"," if (hsvaStart.x < hsvaEnd.x)"," {"," hsvaStart.x += 1.0;"," }"," }"," vec4 hsvaMix = mix(hsvaStart, hsvaEnd, progress);"," hsvaMix.x = mod(hsvaMix.x, 1.0);"," return hsvaToRgba(hsvaMix);","}","vec4 getRampAt(float progress)","{"," Band band = getBand(progress);"," float bandProgress = (progress - band.start) / (band.end - band.start);"," float gamma = log(0.5) / log(band.middle);"," bandProgress = pow(bandProgress, gamma);"," bandProgress = interpolate(bandProgress, band.interpolation);"," if (uDither)"," {"," bandProgress = ditherIGN(bandProgress);"," }"," return mixBandColor(bandProgress, band);","}"].join("\n")},72823(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(fragmentDefine)","varying vec2 outTexCoord;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec4 fragColor = vec4(outTexCoord.xyx, 1.0);"," #pragma phaserTemplate(fragmentProcess)"," gl_FragColor = fragColor;","}"].join("\n")},65884(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(vertexDefine)","uniform mat4 uProjectionMatrix;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","varying vec2 outTexCoord;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(vertexHeader)","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);"," outTexCoord = inTexCoord;"," #pragma phaserTemplate(vertexProcess)","}"].join("\n")},2807(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","varying vec2 outFragCoord;","varying vec2 outTexCoord;","void main ()","{"," outFragCoord = inPosition.xy * 0.5 + 0.5;"," outTexCoord = inTexCoord;"," gl_Position = vec4(inPosition, 0, 1);","}"].join("\n")},49119(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(fragmentDefine)","uniform vec2 uResolution;","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," #pragma phaserTemplate(fragmentProcess)"," gl_FragColor = fragColor;","}"].join("\n")},3524(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#define ROUND_BIAS 0.5001","#pragma phaserTemplate(vertexDefine)","uniform mat4 uProjectionMatrix;","uniform mat3 uViewMatrix;","uniform vec3 uCameraScrollAndAlpha;","uniform int uRoundPixels;","uniform vec2 uResolution;","uniform float uTime;","uniform vec2 uDiffuseResolution;","uniform vec2 uFrameDataResolution;","uniform sampler2D uFrameDataTexture;","uniform float uGravity;","attribute float inVertex;","attribute vec4 inPositionX;","attribute vec4 inPositionY;","attribute vec4 inRotation;","attribute vec4 inScaleX;","attribute vec4 inScaleY;","attribute vec4 inAlpha;","attribute vec4 inFrame;","attribute vec4 inTintBlend;","attribute vec4 inTintTL;","attribute vec4 inTintTR;","attribute vec4 inTintBL;","attribute vec4 inTintBR;","attribute vec4 inOriginAndTintModeAndCreationTime;","attribute vec2 inScrollFactor;","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(vertexHeader)","const float PI = 3.14159265359;","const float HALF_PI = PI / 2.0;","const float BOUNCE_OVERSHOOT = 1.70158;","const float BOUNCE_OVERSHOOT_PLUS = BOUNCE_OVERSHOOT + 1.0;","const float BOUNCE_OVERSHOOT_IN_OUT = BOUNCE_OVERSHOOT * 1.525;","const float BOUNCE_OVERSHOOT_IN_OUT_PLUS = BOUNCE_OVERSHOOT_IN_OUT + 1.0;","float animate (vec4 anim)","{"," float value = anim.x;"," float a = anim.y;"," float b = abs(anim.z);"," float c = abs(anim.w);"," bool yoyo = anim.z < 0.0;"," bool loop = anim.w > 0.0;"," int type = int(floor(c));"," if (type == 0|| b == 0.0)"," {"," return value;"," }"," float duration = b;"," float delay = mod(c, 1.0) * 2.0;"," float rawTime = ((uTime - inOriginAndTintModeAndCreationTime.w) / duration) - delay;"," float time = mod(rawTime, 1.0);"," if (yoyo && (mod(rawTime, 2.0) >= 1.0))"," {"," time = 1.0 - time;"," }"," float repeats = loop ? 0.0 : floor(a);"," float timeContinuous = loop ? time : rawTime;"," #ifdef FEATURE_LINEAR"," if (type == 1)"," {"," return value + a * timeContinuous;"," }"," #endif"," #ifdef FEATURE_GRAVITY"," if (type == 2)"," {"," float v = floor(a);"," float gravityFactor = (a - v) * 2.0 - 1.0;"," if (gravityFactor == 0.0)"," {"," gravityFactor = 1.0;"," }"," float seconds = timeContinuous * duration / 1000.0;"," float accel = uGravity * gravityFactor;"," return value + (v * seconds) + (0.5 * accel * seconds * seconds);"," }"," #endif"," #ifdef FEATURE_QUAD_EASEOUT"," if (type == 10)"," {"," return value + a * time * (2.0 - time)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUAD_EASEIN"," if (type == 11)"," {"," return value + a * time * time"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUAD_EASEINOUT"," if (type == 12)"," {"," time *= 2.0;"," if (time < 1.0)"," {"," return value + a * time * time * 0.5"," + repeats * a;"," }"," time -= 1.0;"," return value + a * -0.5 * (time * (time - 2.0) - 1.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_CUBIC_EASEOUT"," if (type == 20)"," {"," time -= 1.0;"," return value + a * (time * time * time + 1.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_CUBIC_EASEIN"," if (type == 21)"," {"," return value + a * time * time * time"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_CUBIC_EASEINOUT"," if (type == 22)"," {"," time *= 2.0;"," if (time < 1.0)"," {"," return value + a * time * time * time * 0.5"," + repeats * a;"," }"," time -= 2.0;"," return value + a * 0.5 * (time * time * time + 2.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUART_EASEOUT"," if (type == 30)"," {"," time -= 1.0;"," return value + a * (1.0 - time * time * time * time)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUART_EASEIN"," if (type == 31)"," {"," return value + a * time * time * time * time"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUART_EASEINOUT"," if (type == 32)"," {"," time *= 2.0;"," if (time < 1.0)"," {"," return value + a * time * time * time * time * 0.5"," + repeats * a;"," }"," time -= 2.0;"," return value + a * -0.5 * (time * time * time * time - 2.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUINT_EASEOUT"," if (type == 40)"," {"," time -= 1.0;"," return value + a * (time * time * time * time * time + 1.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUINT_EASEIN"," if (type == 41)"," {"," return value + a * time * time * time * time * time"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUINT_EASEINOUT"," if (type == 42)"," {"," time *= 2.0;"," if (time < 1.0)"," {"," return value + a * time * time * time * time * time * 0.5"," + repeats * a;"," }"," time -= 2.0;"," return value + a * 0.5 * (time * time * time * time * time + 2.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_SINE_EASEOUT"," if (type == 50)"," {"," return value + a * sin(time * HALF_PI)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_SINE_EASEIN"," if (type == 51)"," {"," return value + a * (1.0 - cos(time * HALF_PI))"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_SINE_EASEINOUT"," if (type == 52)"," {"," return value + a * 0.5 * (1.0 - cos(PI * time))"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_EXPO_EASEOUT"," if (type == 60)"," {"," return value + a * (1.0 - pow(2.0, -10.0 * time))"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_EXPO_EASEIN"," if (type == 61)"," {"," return value + a * pow(2.0, 10.0 * (time - 1.0) - 0.001)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_EXPO_EASEINOUT"," if (type == 62)"," {"," time *= 2.0;"," if (time < 1.0)"," {"," return value + a * 0.5 * pow(2.0, 10.0 * (time - 1.0))"," + repeats * a;"," }"," time -= 1.0;"," return value + a * 0.5 * (2.0 - pow(2.0, -10.0 * (time - 1.0)))"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_CIRC_EASEOUT"," if (type == 70)"," {"," time -= 1.0;"," return value + a * sqrt(1.0 - time * time)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_CIRC_EASEIN"," if (type == 71)"," {"," return value + a * (1.0 - sqrt(1.0 - time * time))"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_CIRC_EASEINOUT"," if (type == 72)"," {"," time *= 2.0;"," if (time < 1.0)"," {"," return value + a * -0.5 * (sqrt(1.0 - time * time) - 1.0)"," + repeats * a;"," }"," time -= 2.0;"," return value + a * 0.5 * (sqrt(1.0 - time * time) + 1.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_BACK_EASEOUT"," if (type == 90)"," {"," time -= 1.0;"," return value + a * (time * time * (BOUNCE_OVERSHOOT_PLUS * time + BOUNCE_OVERSHOOT) + 1.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_BACK_EASEIN"," if (type == 91)"," {"," return value + a * time * time * (BOUNCE_OVERSHOOT_PLUS * time - BOUNCE_OVERSHOOT)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_BACK_EASEINOUT"," if (type == 92)"," {"," time *= 2.0;"," if (time < 1.0)"," {"," return value + a * 0.5 * (time * time * (BOUNCE_OVERSHOOT_IN_OUT_PLUS * time - BOUNCE_OVERSHOOT_IN_OUT))"," + repeats * a;"," }"," time -= 2.0;"," return value + a * 0.5 * (time * time * (BOUNCE_OVERSHOOT_IN_OUT_PLUS * time + BOUNCE_OVERSHOOT_IN_OUT) + 2.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_BOUNCE_EASEOUT"," if (type == 100)"," {"," if (time < 1.0 / 2.75)"," {"," return value + a * (7.5625 * time * time)"," + repeats * a;"," }"," else if (time < 2.0 / 2.75)"," {"," time -= 1.5 / 2.75;"," return value + a * (7.5625 * time * time + 0.75)"," + repeats * a;"," }"," else if (time < 2.5 / 2.75)"," {"," time -= 2.25 / 2.75;"," return value + a * (7.5625 * time * time + 0.9375)"," + repeats * a;"," }"," else"," {"," time -= 2.625 / 2.75;"," return value + a * (7.5625 * time * time + 0.984375)"," + repeats * a;"," }"," }"," #endif"," #ifdef FEATURE_BOUNCE_EASEIN"," if (type == 101)"," {"," time = 1.0 - time;"," if (time < 1.0 / 2.75)"," {"," return value + a * (1.0 - 7.5625 * time * time)"," + repeats * a;"," }"," else if (time < 2.0 / 2.75)"," {"," time -= 1.5 / 2.75;"," return value + a * (1.0 - (7.5625 * time * time + 0.75))"," + repeats * a;"," }"," else if (time < 2.5 / 2.75)"," {"," time -= 2.25 / 2.75;"," return value + a * (1.0 - (7.5625 * time * time + 0.9375))"," + repeats * a;"," }"," else"," {"," time -= 2.625 / 2.75;"," return value + a * (1.0 - (7.5625 * time * time + 0.984375))"," + repeats * a;"," }"," }"," #endif"," #ifdef FEATURE_BOUNCE_EASEINOUT"," if (type == 102)"," {"," bool reverse = false;"," if (time < 0.5)"," {"," time = 1.0 - time * 2.0;"," reverse = true;"," }"," if (time < 1.0 / 2.75)"," {"," time = 7.5625 * time * time;"," }"," else if (time < 2.0 / 2.75)"," {"," time -= 1.5 / 2.75;"," time = 7.5625 * time * time + 0.75;"," }"," else if (time < 2.5 / 2.75)"," {"," time -= 2.25 / 2.75;"," time = 7.5625 * time * time + 0.9375;"," }"," else"," {"," time -= 2.625 / 2.75;"," time = 7.5625 * time * time + 0.984375;"," }"," if (reverse)"," {"," return value + a * (1.0 - time) * 0.5"," + repeats * a;"," }"," return value + a * time * 0.5 + 0.5"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_STEPPED"," if (type == 110)"," {"," return value + a * floor(time + 0.5)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_SMOOTHSTEP_EASEOUT"," if (type == 120)"," {"," return value + a * (smoothstep(0.0, 1.0, time / 2.0 + 0.5) * 2.0 - 1.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_SMOOTHSTEP_EASEIN"," if (type == 121)"," {"," return value + a * smoothstep(0.0, 1.0, time / 2.0) * 2.0"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_SMOOTHSTEP_EASEINOUT"," if (type == 122)"," {"," return value + a * smoothstep(0.0, 1.0, time)"," + repeats * a;"," }"," #endif"," return value;","}","struct Frame {"," vec2 position;"," vec2 size;"," vec2 offset;","};","Frame getFrame (float frame)","{"," float index1 = floor(frame) * 3.0;"," float index2 = index1 + 1.0;"," float index3 = index1 + 2.0;"," float width = uFrameDataResolution.x;"," float x = mod(index1, width);"," float y = floor(index1 / width);"," vec4 texelUV = texture2D("," uFrameDataTexture,"," vec2(x + 0.5, y + 0.5) / uFrameDataResolution"," );"," x = mod(index2, width);"," y = floor(index2 / width);"," vec4 texelWH = texture2D("," uFrameDataTexture,"," vec2(x + 0.5, y + 0.5) / uFrameDataResolution"," );"," x = mod(index3, width);"," y = floor(index3 / width);"," vec4 texelOrigin = texture2D("," uFrameDataTexture,"," vec2(x + 0.5, y + 0.5) / uFrameDataResolution"," );"," return Frame("," vec2("," texelUV.r + texelUV.g * 256.0,"," texelUV.b + texelUV.a * 256.0"," ) * 255.0,"," vec2("," texelWH.r + texelWH.g * 256.0,"," texelWH.b + texelWH.a * 256.0"," ) * 255.0,"," vec2("," texelOrigin.r + texelOrigin.g * 256.0,"," texelOrigin.b + texelOrigin.a * 256.0"," ) * 255.0 - 32768.0"," );","}","void main ()","{"," float positionX = animate(inPositionX);"," float positionY = animate(inPositionY);"," float rotation = animate(inRotation);"," float scaleX = animate(inScaleX);"," float scaleY = animate(inScaleY);"," float frame = animate(inFrame);"," float tintBlend = animate(inTintBlend);"," float alpha = animate(inAlpha);"," vec2 origin = inOriginAndTintModeAndCreationTime.xy;"," float tintMode = inOriginAndTintModeAndCreationTime.z;"," float scrollFactorX = inScrollFactor.x;"," float scrollFactorY = inScrollFactor.y;"," Frame frameData = getFrame(frame);"," vec2 uv = frameData.position / uDiffuseResolution;"," vec2 wh = frameData.size / uDiffuseResolution;"," float u = uv.s;"," float v = uv.t;"," float w = wh.s;"," float h = wh.t;"," float width = frameData.size.s;"," float height = frameData.size.t;"," vec4 tint = inTintTL;"," float x = -origin.x;"," float y = -origin.y;"," if (inVertex == 0.0)"," {"," y = 1.0 - origin.y;"," v += h;"," tint = inTintBL;"," }"," else if (inVertex == 2.0)"," {"," x = 1.0 - origin.x;"," y = 1.0 - origin.y;"," u += w;"," v += h;"," tint = inTintBR;"," }"," else if (inVertex == 3.0)"," {"," x = 1.0 - origin.x;"," u += w;"," tint = inTintTR;"," }"," vec3 position = vec3("," (x * width - frameData.offset.x) * scaleX,"," (y * height - frameData.offset.y) * scaleY,"," 1.0"," );"," mat3 viewMatrix = uViewMatrix * mat3("," 1.0, 0.0, 0.0,"," 0.0, 1.0, 0.0,"," uCameraScrollAndAlpha.x * (1.0 - scrollFactorX), uCameraScrollAndAlpha.y * (1.0 - scrollFactorY), 1.0"," );"," float sine = sin(rotation);"," float cosine = cos(rotation);"," mat3 transformMatrix = mat3("," cosine, sine, 0.0,"," -sine, cosine, 0.0,"," positionX, positionY, 1.0"," );"," position = viewMatrix * transformMatrix * position;"," alpha *= uCameraScrollAndAlpha.z;"," tint.a *= alpha;"," if (uRoundPixels == 1 && rotation == 0.0 && scaleX == 1.0 && scaleY == 1.0)"," {"," position.xy = floor(position.xy + ROUND_BIAS);"," }"," gl_Position = uProjectionMatrix * vec4(position.xy, 1.0, 1.0);"," outTexCoord = vec2(u, 1.0 - v);"," outTint = mix(vec4(1.0, 1.0, 1.0, tint.a), tint, tintBlend);"," outTintEffect = tintMode;"," #pragma phaserTemplate(vertexProcess)","}"].join("\n")},57532(t){t.exports=["#version 100","#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","/* Redefine MAX_ANIM_FRAMES to support animations with different frame numbers. */","#define MAX_ANIM_FRAMES 0","#pragma phaserTemplate(fragmentDefine)","uniform vec2 uResolution;","uniform sampler2D uMainSampler;","uniform sampler2D uLayerSampler;","uniform vec2 uMainResolution;","uniform vec2 uLayerResolution;","uniform float uTileColumns;","uniform vec4 uTileWidthHeightMarginSpacing;","uniform float uAlpha;","uniform float uTime;","#if MAX_ANIM_FRAMES > 0","uniform sampler2D uAnimSampler;","uniform vec2 uAnimResolution;","#endif","varying vec2 outTexCoord;","varying vec2 outTileStride;","#pragma phaserTemplate(outVariables)","vec2 getTexRes ()","{"," return uMainResolution;","}","float floatTexel (vec4 texel)","{"," return texel.r * 255.0 + (texel.g * 255.0 * 256.0) + (texel.b * 255.0 * 256.0 * 256.0) + (texel.a * 255.0 * 256.0 * 256.0 * 256.0);","}","struct Tile","{"," float index;"," vec2 uv; // In texels."," #if MAX_ANIM_FRAMES > 0"," bool animated;"," #endif"," bool empty;","};","Tile getLayerData (vec2 coord)","{"," vec2 texelCoord = coord * uLayerResolution;"," vec2 tile = floor(texelCoord);"," vec2 uv = fract(texelCoord);"," uv.y = 1.0 - uv.y;"," vec4 texel = texture2D(uLayerSampler, (tile + 0.5) / uLayerResolution) * 255.0;"," float flags = texel.a;"," /* Check for empty tile flag in bit 28. */"," if (flags == 16.0)"," {"," return Tile("," 0.0,"," vec2(0.0),"," #if MAX_ANIM_FRAMES > 0"," false,"," #endif"," true"," );"," }"," /* Bit 31 is flipX. */"," bool flipX = flags > 127.0;"," /* Bit 30 is flipY. */"," bool flipY = mod(flags, 128.0) > 63.0;"," #if MAX_ANIM_FRAMES > 0"," /* Bit 29 is animation. */"," bool animated = mod(flags, 64.0) > 31.0;"," #endif"," if (flipX)"," {"," uv.x = 1.0 - uv.x;"," }"," if (flipY)"," {"," uv.y = 1.0 - uv.y;"," }"," float index = texel.r + (texel.g * 256.0) + (texel.b * 256.0 * 256.0);"," return Tile("," index,"," uv * uTileWidthHeightMarginSpacing.xy,"," #if MAX_ANIM_FRAMES > 0"," animated,"," #endif"," false"," );","}","vec2 getFrameCorner (float index)","{"," float x = mod(index, uTileColumns);"," float y = floor(index / uTileColumns);"," vec2 xy = vec2(x, y);"," return xy * outTileStride + uTileWidthHeightMarginSpacing.zz;","}","#if MAX_ANIM_FRAMES > 0","float animationIndex (float index)","{"," float animTextureWidth = uAnimResolution.x;"," vec2 index2D = vec2(mod(index, animTextureWidth), floor(index / animTextureWidth));"," vec4 animDurationTexel = texture2D(uAnimSampler, (index2D + 0.5) / uAnimResolution);"," index2D = vec2(mod(index + 1.0, animTextureWidth), floor((index + 1.0) / animTextureWidth));"," vec4 animIndexTexel = texture2D(uAnimSampler, (index2D + 0.5) / uAnimResolution);"," float animDuration = floatTexel(animDurationTexel);"," float animIndex = floatTexel(animIndexTexel);"," float animTime = mod(uTime, animDuration);"," float animTimeAccum = 0.0;"," for (int i = 0; i < MAX_ANIM_FRAMES; i++)"," {"," index2D = vec2(mod(animIndex, animTextureWidth), floor(animIndex / animTextureWidth));"," animDurationTexel = texture2D(uAnimSampler, (index2D + 0.5) / uAnimResolution);"," float frameDuration = floatTexel(animDurationTexel);"," animTimeAccum += frameDuration;"," if (animTime <= animTimeAccum)"," {"," break;"," }"," animIndex += 2.0;"," }"," animIndex += 1.0;"," index2D = vec2(mod(animIndex, animTextureWidth), floor(animIndex / animTextureWidth));"," animIndexTexel = texture2D(uAnimSampler, (index2D + 0.5) / uAnimResolution);"," float animFrameIndex = floatTexel(animIndexTexel);"," return animFrameIndex;","}","#endif","vec2 getTileTexelCoord (Tile tile)","{"," if (tile.empty)"," {"," return vec2(0.0);"," }"," float index = tile.index;"," #if MAX_ANIM_FRAMES > 0"," if (tile.animated)"," {"," index = animationIndex(index);"," }"," #endif"," vec2 frameCorner = getFrameCorner(index);"," return frameCorner + tile.uv;","}","#pragma phaserTemplate(fragmentHeader)","struct Samples {"," vec4 color;"," #pragma phaserTemplate(defineSamples)","};","Samples getColorSamples (vec2 texCoord)","{"," Samples samples;"," samples.color = texture2D("," uMainSampler,"," vec2(texCoord.x, 1.0 - texCoord.y)"," );"," #pragma phaserTemplate(getSamples)"," return samples;","}","Samples mixSamples (Samples samples1, Samples samples2, float alpha)","{"," Samples samples;"," samples.color = mix(samples1.color, samples2.color, alpha);"," #pragma phaserTemplate(mixSamples)"," return samples;","}","Samples getFinalSamples (Tile tile, vec2 layerTexCoord)","{"," vec2 texelCoord = getTileTexelCoord(tile);"," vec2 texCoord = texelCoord / uMainResolution;"," #pragma phaserTemplate(texCoord)"," #ifndef FEATURE_BORDERFILTER"," return getColorSamples(texCoord);"," #else"," #pragma phaserTemplate(finalSamples)"," vec2 wh = uTileWidthHeightMarginSpacing.xy;"," vec2 frameCorner = getFrameCorner(tile.index);"," vec2 frameCornerOpposite = frameCorner + wh;"," vec2 texCoordClamped = clamp(texCoord, (frameCorner + 0.5) / uMainResolution, (frameCornerOpposite - 0.5) / uMainResolution);"," vec2 dTexelCoord = (texCoord - texCoordClamped) * uMainResolution;"," dTexelCoord.y = -dTexelCoord.y;"," vec2 offsets = sign(dTexelCoord);"," Samples samples0 = getColorSamples(texCoordClamped);"," if (offsets.x == 0.0)"," {"," if (offsets.y == 0.0)"," {"," return samples0;"," }"," Tile tileY = getLayerData(layerTexCoord + (offsets - dTexelCoord) / wh / uLayerResolution);"," vec2 texelCoordY = getTileTexelCoord(tileY);"," vec2 texCoordY = texelCoordY / uMainResolution;"," Samples samplesY = getColorSamples(texCoordY);"," return mixSamples(samples0, samplesY, abs(dTexelCoord.y));"," }"," else"," {"," if (offsets.y == 0.0)"," {"," Tile tileX = getLayerData(layerTexCoord + (offsets - dTexelCoord) / wh / uLayerResolution);"," vec2 texelCoordX = getTileTexelCoord(tileX);"," vec2 texCoordX = texelCoordX / uMainResolution;"," Samples samplesX = getColorSamples(texCoordX);"," return mixSamples(samples0, samplesX, abs(dTexelCoord.x));"," }"," Tile tileX = getLayerData(layerTexCoord + (offsets * vec2(1.0, 0.0) - dTexelCoord) / wh / uLayerResolution);"," vec2 texelCoordX = getTileTexelCoord(tileX);"," vec2 texCoordX = texelCoordX / uMainResolution;"," Samples samplesX = getColorSamples(texCoordX);"," Tile tileY = getLayerData(layerTexCoord + (offsets * vec2(0.0, 1.0) - dTexelCoord) / wh / uLayerResolution);"," vec2 texelCoordY = getTileTexelCoord(tileY);"," vec2 texCoordY = texelCoordY / uMainResolution;"," Samples samplesY = getColorSamples(texCoordY);"," Tile tileXY = getLayerData(layerTexCoord + (offsets - dTexelCoord) / wh / uLayerResolution);"," vec2 texelCoordXY = getTileTexelCoord(tileXY);"," vec2 texCoordXY = texelCoordXY / uMainResolution;"," Samples samplesXY = getColorSamples(texCoordXY);"," Samples samples1 = mixSamples(samples0, samplesX, abs(dTexelCoord.x));"," Samples samples2 = mixSamples(samplesY, samplesXY, abs(dTexelCoord.x));"," return mixSamples(samples1, samples2, abs(dTexelCoord.y));"," }"," #endif","}","void main ()","{"," vec2 layerTexCoord = outTexCoord;"," Tile tile = getLayerData(layerTexCoord);"," Samples samples = getFinalSamples(tile, layerTexCoord);"," vec4 fragColor = samples.color;"," #pragma phaserTemplate(declareSamples)"," #pragma phaserTemplate(fragmentProcess)"," fragColor *= uAlpha;"," gl_FragColor = fragColor;","}"].join("\n")},23879(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(vertexDefine)","uniform mat4 uProjectionMatrix;","uniform vec2 uResolution;","uniform vec4 uTileWidthHeightMarginSpacing;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","varying vec2 outTexCoord;","varying vec2 outTileStride;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(vertexHeader)","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);"," outTexCoord = inTexCoord;"," outTileStride = uTileWidthHeightMarginSpacing.xy + uTileWidthHeightMarginSpacing.zz;"," #pragma phaserTemplate(vertexProcess)","}"].join("\n")},84639(t){t.exports=function(t,e){return{name:t+"Anims",additions:{fragmentDefine:"#undef MAX_ANIM_FRAMES\n#define MAX_ANIM_FRAMES "+t},tags:["MAXANIMS"],disable:!!e}}},81084(t,e,i){var r=i(84547);t.exports=function(t){return{name:"ApplyLighting",additions:{fragmentHeader:r,fragmentProcess:"fragColor = applyLighting(fragColor, normal);"},tags:["LIGHTING"],disable:!!t}}},44349(t,e,i){var r=i(11104);t.exports=function(t){return{name:"Tint",additions:{fragmentHeader:r,fragmentProcess:"fragColor = applyTint(fragColor);"},tags:["TINT"],disable:!!t}}},99501(t,e,i){var r=i(81556);t.exports=function(t){return{name:"BoundedSampler",additions:{fragmentHeader:r},disable:!!t}}},6184(t,e,i){var r=i(11719);t.exports=function(t){return{name:"DefineLights",additions:{fragmentDefine:"#define LIGHT_COUNT 1",fragmentHeader:r},tags:["LIGHTING"],disable:!!t}}},11653(t){t.exports=function(t,e){return{name:t+"TexCount",additions:{fragmentDefine:"#define TEXTURE_COUNT "+t},tags:["TexCount"],disable:!!e}}},13198(t){t.exports=function(t){return{name:"FlatNormal",additions:{fragmentProcess:"vec3 normal = vec3(0.0, 0.0, 1.0);"},tags:["LIGHTING"],disable:!!t}}},40829(t,e,i){var r=i(84220);t.exports=function(t){return{name:"NormalMap",additions:{fragmentHeader:r,fragmentProcess:"vec3 normal = getNormalFromMap(texCoord);"},tags:["LIGHTING"],disable:!!t}}},42792(t){t.exports=function(t){return{name:"TexCoordOut",additions:{fragmentProcess:"vec2 texCoord = outTexCoord;\n#pragma phaserTemplate(texCoord)"},tags:["TEXCOORD"],disable:!!t}}},96049(t,e,i){var r=i(2860);t.exports=function(t){return{name:"GetTexRes",additions:{fragmentHeader:r},tags:["TEXRES"],disable:!!t}}},33997(t,e,i){var r=i(46432);t.exports=function(t,e){void 0===t&&(t=1);for(var i="",s=1;s1&&(d=u.baseType===i.FLOAT?new Float32Array(c):new Int32Array(c)),this.glUniforms.set(l.name,{location:i.getUniformLocation(t,l.name),size:l.size,type:l.type,value:d})}},setUniform:function(t,e){this.uniformRequests.set(t,e)},bind:function(){this.renderer.glWrapper.updateBindingsProgram(this.glState),this.uniformRequests.each(this._processUniformRequest.bind(this)),this.uniformRequests.clear()},_processUniformRequest:function(t,e){var i=this.renderer,r=i.gl,n=this.glUniforms.get(t);if(n){var a=n.value;if(a.length){for(var o=!1,h=0;h1)c.setV.call(r,l,a);else switch(c.size){case 1:c.set.call(r,l,e);break;case 2:c.set.call(r,l,e[0],e[1]);break;case 3:c.set.call(r,l,e[0],e[1],e[2]);break;case 4:c.set.call(r,l,e[0],e[1],e[2],e[3])}}},destroy:function(){if(this.webGLProgram){var t=this.renderer.gl;if(!t.isContextLost()){this._vertexShader&&t.deleteShader(this._vertexShader),this._fragmentShader&&t.deleteShader(this._fragmentShader),t.deleteProgram(this.webGLProgram);for(var e=0;e=0;i--)this.units[i]=void 0,this.renderer.glWrapper.updateBindingsActiveTexture({bindings:{activeTexture:i}}),t.bindTexture(t.TEXTURE_2D,e),this.unitIndices[i]=i;t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array([0,0,255,255]))},bind:function(t,e,i,r){var s=this.units[e]!==t;if((i||!1!==r||s)&&this.renderer.glWrapper.updateBindingsActiveTexture({bindings:{activeTexture:e}},i),s||i){this.units[e]=t;var n=t?t.webGLTexture:null,a=this.renderer.gl;a.bindTexture(a.TEXTURE_2D,n),t&&t.needsMipmapRegeneration&&t.generateMipmap()}},bindUnits:function(t,e){for(var i=Math.min(t.length,this.renderer.maxTextures)-1;i>=0;i--)void 0!==t[i]&&this.bind(t[i],i,e,!1)},unbindTexture:function(t){for(var e=this.units.length-1;e>=0;e--)this.units[e]===t&&this.bind(null,e,!0,!1)},unbindAllUnits:function(){for(var t=this.units.length-1;t>=0;t--)this.bind(null,t,!0,!1)}});t.exports=r},82751(t,e,i){var r=i(83419),s=i(50030),n=new r({initialize:function(t,e,i,r,s,n,a,o,h,l,u,d,c){void 0===c&&(c=!0),this.renderer=t,this.webGLTexture=null,this.isRenderTexture=!1,this.mipLevel=e,this.minFilter=i,this.magFilter=r,this.wrapT=s,this.wrapS=n,this.format=a,this.pixels=o,this.width=h,this.height=l,this.pma=null==u||u,this.forceSize=!!d,this.flipY=!!c,this.__SPECTOR_Metadata={},this.batchUnit=-1,this.needsMipmapRegeneration=!1,this.createResource()},createResource:function(){var t=this.renderer.gl;if(!t.isContextLost())if(this.pixels instanceof n)this.webGLTexture=this.pixels.webGLTexture;else{var e=t.createTexture();e.__SPECTOR_Metadata=this.__SPECTOR_Metadata,this.webGLTexture=e,this._processTexture()}},resize:function(t,e){if(this.width!==t||this.height!==e){this.width=t,this.height=e;var i=this.renderer,r=i.gl,n=s(t,e);n?(this.wrapS=r.REPEAT,this.wrapT=r.REPEAT):(this.wrapS=r.CLAMP_TO_EDGE,this.wrapT=r.CLAMP_TO_EDGE),n&&i.mipmapFilter&&(!this.isRenderTexture||i.config.mipmapRegeneration)?this.minFilter=i.mipmapFilter:i.config.antialias?this.minFilter=r.LINEAR:this.minFilter=r.NEAREST,this._processTexture()}},update:function(t,e,i,r,s,n,a,o,h){0!==e&&0!==i&&(this.pixels=t,this.width=e,this.height=i,this.flipY=r,this.wrapS=s,this.wrapT=n,this.minFilter=a,this.magFilter=o,this.format=h,this._processTexture())},_processTexture:function(){var t=this.renderer.gl;this.renderer.glTextureUnits.bind(this,0),this.renderer.glWrapper.updateTexturing({texturing:{flipY:this.flipY,premultiplyAlpha:this.pma}}),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,this.minFilter),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,this.magFilter),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,this.wrapS),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,this.wrapT);var e=this.pixels,i=this.mipLevel,r=this.width,s=this.height,n=this.format;if(null==e)t.texImage2D(t.TEXTURE_2D,i,n,r,s,0,n,t.UNSIGNED_BYTE,null),this.generateMipmap();else if(e.compressed){r=e.width,s=e.height;for(var a=0;a0&&this.parentSize.height>0&&this.displaySize.setParent(this.parentSize),this.refresh()),t.events.on(h.PRE_STEP,this.step,this),t.events.once(h.READY,this.refresh,this),t.events.once(h.DESTROY,this.destroy,this),this.startListeners()},parseConfig:function(t){this.getParent(t),this.getParentBounds();var e=t.width,i=t.height,s=t.scaleMode,n=t.zoom,a=t.autoRound;if("string"==typeof e)if("%"!==e.substr(-1))e=parseInt(e,10);else{var o=this.parentSize.width;0===o&&(o=window.innerWidth);var h=parseInt(e,10)/100;e=Math.floor(o*h)}if("string"==typeof i)if("%"!==i.substr(-1))i=parseInt(i,10);else{var l=this.parentSize.height;0===l&&(l=window.innerHeight);var u=parseInt(i,10)/100;i=Math.floor(l*u)}this.scaleMode=s,this.autoRound=a,this.autoCenter=t.autoCenter,this.resizeInterval=t.resizeInterval,a&&(e=Math.floor(e),i=Math.floor(i)),this.gameSize.setSize(e,i),n===r.ZOOM.MAX_ZOOM&&(n=this.getMaxZoom()),this.zoom=n,1!==n&&(this._resetZoom=!0),this.baseSize.setSize(e,i),a&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),t.minWidth>0&&this.displaySize.setMin(t.minWidth*n,t.minHeight*n),t.maxWidth>0&&this.displaySize.setMax(t.maxWidth*n,t.maxHeight*n),this.displaySize.setSize(e,i),(t.snapWidth>0||t.snapHeight>0)&&this.displaySize.setSnap(t.snapWidth,t.snapHeight),this.orientation=d(e,i)},getParent:function(t){var e=t.parent;if(null!==e){if(this.parent=u(e),this.parentIsWindow=this.parent===document.body,t.expandParent&&t.scaleMode!==r.SCALE_MODE.NONE){var i=this.parent.getBoundingClientRect();(this.parentIsWindow||0===i.height)&&(document.documentElement.style.height="100%",document.body.style.height="100%",i=this.parent.getBoundingClientRect(),this.parentIsWindow||0!==i.height||(this.parent.style.overflow="hidden",this.parent.style.width="100%",this.parent.style.height="100%"))}t.fullscreenTarget&&!this.fullscreenTarget&&(this.fullscreenTarget=u(t.fullscreenTarget))}},getParentBounds:function(){if(!this.parent)return!1;var t=this.parentSize,e=this.parent.getBoundingClientRect();this.parentIsWindow&&this.game.device.os.iOS&&(e.height=l(!0));var i=e.width,r=e.height;if(t.width!==i||t.height!==r)return t.setSize(i,r),!0;if(this.canvas){var s=this.canvasBounds,n=this.canvas.getBoundingClientRect();if(n.x!==s.x||n.y!==s.y)return!0}return!1},lockOrientation:function(t){var e=screen.lockOrientation||screen.mozLockOrientation||screen.msLockOrientation;return!!e&&e.call(screen,t)},setParentSize:function(t,e){return this.parentSize.setSize(t,e),this.refresh()},setGameSize:function(t,e){var i=this.autoRound;i&&(t=Math.floor(t),e=Math.floor(e));var r=this.width,s=this.height;return this.gameSize.resize(t,e),this.baseSize.resize(t,e),i&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setAspectRatio(t/e),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height,this.refresh(r,s)},resize:function(t,e){var i=this.zoom,r=this.autoRound;r&&(t=Math.floor(t),e=Math.floor(e));var s=this.width,n=this.height;this.gameSize.resize(t,e),this.baseSize.resize(t,e),r&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setSize(t*i,e*i),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height;var a=this.canvas.style,o=t*i,h=e*i;return r&&(o=Math.floor(o),h=Math.floor(h)),o===t&&h===e||(a.width=o+"px",a.height=h+"px"),this.refresh(s,n)},setZoom:function(t){return this.zoom=t,this._resetZoom=!0,this.refresh()},setMaxZoom:function(){return this.zoom=this.getMaxZoom(),this._resetZoom=!0,this.refresh()},setSnap:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.displaySize.setSnap(t,e),this.refresh()},refresh:function(t,e){void 0===t&&(t=this.width),void 0===e&&(e=this.height),this.updateScale(),this.updateBounds(),this.updateOrientation(),this.displayScale.set(this.baseSize.width/this.canvasBounds.width,this.baseSize.height/this.canvasBounds.height);var i=this.game.domContainer;if(i){this.baseSize.setCSS(i);var r=this.canvas.style,s=i.style;s.transform="scale("+this.displaySize.width/this.baseSize.width+","+this.displaySize.height/this.baseSize.height+")",s.marginLeft=r.marginLeft,s.marginTop=r.marginTop}return this.emit(o.RESIZE,this.gameSize,this.baseSize,this.displaySize,t,e),this},updateOrientation:function(){if(this._checkOrientation){this._checkOrientation=!1;var t=d(this.width,this.height);t!==this.orientation&&(this.orientation=t,this.emit(o.ORIENTATION_CHANGE,t))}},updateScale:function(){var t,e,i=this.canvas.style,s=this.gameSize.width,a=this.gameSize.height,o=this.zoom,h=this.autoRound;if(this.scaleMode===r.SCALE_MODE.NONE)this.displaySize.setSize(s*o,a*o),t=this.displaySize.width,e=this.displaySize.height,h&&(t=Math.floor(t),e=Math.floor(e)),this._resetZoom&&(i.width=t+"px",i.height=e+"px",this._resetZoom=!1);else if(this.scaleMode===r.SCALE_MODE.RESIZE)this.displaySize.setSize(this.parentSize.width,this.parentSize.height),this.gameSize.setSize(this.displaySize.width,this.displaySize.height),this.baseSize.setSize(this.displaySize.width,this.displaySize.height),t=this.displaySize.width,e=this.displaySize.height,h&&(t=Math.floor(t),e=Math.floor(e)),this.canvas.width=t,this.canvas.height=e;else if(this.scaleMode===r.SCALE_MODE.EXPAND){var l,u,d=this.game.config.width,c=this.game.config.height,f=this.parentSize.width,p=this.parentSize.height,g=f/d,m=p/c;g=0?0:-a.x*o.x,l=a.y>=0?0:-a.y*o.y;return i=n.width>=a.width?s.width:s.width-(a.width-n.width)*o.x,r=n.height>=a.height?s.height:s.height-(a.height-n.height)*o.y,e.setTo(h,l,i,r),t&&(e.width/=t.zoomX,e.height/=t.zoomY,e.centerX=t.centerX+t.scrollX,e.centerY=t.centerY+t.scrollY),e},step:function(t,e){this.parent&&(this._lastCheck+=e,(this.dirty||this._lastCheck>this.resizeInterval)&&(this.getParentBounds()&&this.refresh(),this.dirty=!1,this._lastCheck=0))},stopListeners:function(){var t=this.domlisteners;screen.orientation&&screen.orientation.addEventListener?screen.orientation.removeEventListener("change",t.orientationChange,!1):window.removeEventListener("orientationchange",t.orientationChange,!1),window.removeEventListener("resize",t.windowResize,!1);["webkit","moz",""].forEach(function(e){document.removeEventListener(e+"fullscreenchange",t.fullScreenChange,!1),document.removeEventListener(e+"fullscreenerror",t.fullScreenError,!1)}),document.removeEventListener("MSFullscreenChange",t.fullScreenChange,!1),document.removeEventListener("MSFullscreenError",t.fullScreenError,!1)},destroy:function(){this.removeAllListeners(),this.stopListeners(),this.game=null,this.canvas=null,this.canvasBounds=null,this.parent=null,this.fullscreenTarget=null,this.parentSize.destroy(),this.gameSize.destroy(),this.baseSize.destroy(),this.displaySize.destroy()},isFullscreen:{get:function(){return this.fullscreen.active}},width:{get:function(){return this.gameSize.width}},height:{get:function(){return this.gameSize.height}},isPortrait:{get:function(){return this.orientation===r.ORIENTATION.PORTRAIT}},isLandscape:{get:function(){return this.orientation===r.ORIENTATION.LANDSCAPE}},isGamePortrait:{get:function(){return this.height>this.width}},isGameLandscape:{get:function(){return this.width>this.height}}});t.exports=y},64743(t){t.exports={NO_CENTER:0,CENTER_BOTH:1,CENTER_HORIZONTALLY:2,CENTER_VERTICALLY:3}},39218(t){t.exports={LANDSCAPE:"landscape-primary",LANDSCAPE_SECONDARY:"landscape-secondary",PORTRAIT:"portrait-primary",PORTRAIT_SECONDARY:"portrait-secondary"}},81050(t){t.exports={NONE:0,WIDTH_CONTROLS_HEIGHT:1,HEIGHT_CONTROLS_WIDTH:2,FIT:3,ENVELOP:4,RESIZE:5,EXPAND:6}},80805(t){t.exports={NO_ZOOM:1,ZOOM_2X:2,ZOOM_4X:4,MAX_ZOOM:-1}},13560(t,e,i){var r={CENTER:i(64743),ORIENTATION:i(39218),SCALE_MODE:i(81050),ZOOM:i(80805)};t.exports=r},56139(t){t.exports="enterfullscreen"},2336(t){t.exports="fullscreenfailed"},47412(t){t.exports="fullscreenunsupported"},51452(t){t.exports="leavefullscreen"},20666(t){t.exports="orientationchange"},47945(t){t.exports="resize"},97480(t,e,i){t.exports={ENTER_FULLSCREEN:i(56139),FULLSCREEN_FAILED:i(2336),FULLSCREEN_UNSUPPORTED:i(47412),LEAVE_FULLSCREEN:i(51452),ORIENTATION_CHANGE:i(20666),RESIZE:i(47945)}},93364(t,e,i){var r=i(79291),s=i(13560),n={Center:i(64743),Events:i(97480),Orientation:i(39218),ScaleManager:i(76531),ScaleModes:i(81050),Zoom:i(80805)};n=r(!1,n,s.CENTER),n=r(!1,n,s.ORIENTATION),n=r(!1,n,s.SCALE_MODE),n=r(!1,n,s.ZOOM),t.exports=n},27397(t,e,i){var r=i(95540),s=i(35355);t.exports=function(t){var e=t.game.config.defaultPhysicsSystem,i=r(t.settings,"physics",!1);if(e||i){var n=[];if(e&&n.push(s(e+"Physics")),i)for(var a in i)a=s(a.concat("Physics")),-1===n.indexOf(a)&&n.push(a);return n}}},52106(t,e,i){var r=i(95540);t.exports=function(t){var e=t.plugins.getDefaultScenePlugins(),i=r(t.settings,"plugins",!1);return Array.isArray(i)?i:e||[]}},87033(t){t.exports={game:"game",renderer:"renderer",anims:"anims",cache:"cache",plugins:"plugins",registry:"registry",scale:"scale",sound:"sound",textures:"textures",events:"events",cameras:"cameras",add:"add",make:"make",scenePlugin:"scene",displayList:"children",lights:"lights",data:"data",input:"input",load:"load",time:"time",tweens:"tweens",arcadePhysics:"physics",matterPhysics:"matter"}},97482(t,e,i){var r=i(83419),s=i(2368),n=new r({initialize:function(t){this.sys=new s(this,t),this.game,this.anims,this.cache,this.registry,this.sound,this.textures,this.events,this.cameras,this.add,this.make,this.scene,this.children,this.lights,this.data,this.input,this.load,this.time,this.tweens,this.physics,this.matter,this.scale,this.plugins,this.renderer},update:function(){}});t.exports=n},60903(t,e,i){var r=i(83419),s=i(89993),n=i(44594),a=i(8443),o=i(35154),h=i(54899),l=i(29747),u=i(97482),d=i(2368),c=new r({initialize:function(t,e){if(this.game=t,this.keys={},this.scenes=[],this._pending=[],this._start=[],this._queue=[],this._data={},this.isProcessing=!1,this.isBooted=!1,this.customViewports=0,this.systemScene,e){Array.isArray(e)||(e=[e]);for(var i=0;i-1&&(delete this.keys[r],this.scenes.splice(i,1),this._start.indexOf(r)>-1&&(i=this._start.indexOf(r),this._start.splice(i,1)),e.sys.destroy()),this},bootScene:function(t){var e,i=t.sys,r=i.settings;i.sceneUpdate=l,t.init&&(t.init.call(t,r.data),r.status=s.INIT,r.isTransition&&i.events.emit(n.TRANSITION_INIT,r.transitionFrom,r.transitionDuration)),i.load&&(e=i.load).reset(),e&&t.preload?(t.preload.call(t),r.status=s.LOADING,e.once(h.COMPLETE,this.loadComplete,this),e.start()):this.create(t)},loadComplete:function(t){this.create(t.scene)},payloadComplete:function(t){this.bootScene(t.scene)},update:function(t,e){this.processQueue(),this.isProcessing=!0;for(var i=this.scenes.length-1;i>=0;i--){var r=this.scenes[i].sys;r.settings.status>s.START&&r.settings.status<=s.RUNNING&&r.step(t,e),r.scenePlugin&&r.scenePlugin._target&&r.scenePlugin.step(t,e)}},render:function(t){for(var e=0;e=s.LOADING&&i.settings.status=s.START&&a<=s.CREATING)return this;if(a>=s.RUNNING&&a<=s.SLEEPING)n.shutdown(),n.sceneUpdate=l,n.start(e);else if(n.sceneUpdate=l,n.start(e),n.load&&(r=n.load),r&&n.settings.hasOwnProperty("pack")&&(r.reset(),r.addPack({payload:n.settings.pack})))return n.settings.status=s.LOADING,r.once(h.COMPLETE,this.payloadComplete,this),r.start(),this;return this.bootScene(i),this},stop:function(t,e){var i=this.getScene(t);if(i&&!i.sys.isTransitioning()&&i.sys.settings.status!==s.SHUTDOWN){var r=i.sys.load;r&&(r.off(h.COMPLETE,this.loadComplete,this),r.off(h.COMPLETE,this.payloadComplete,this)),i.sys.shutdown(e)}return this},switch:function(t,e,i){var r=this.getScene(t),s=this.getScene(e);return r&&s&&r!==s&&(this.sleep(t),this.isSleeping(e)?this.wake(e,i):this.start(e,i)),this},getAt:function(t){return this.scenes[t]},getIndex:function(t){var e=this.getScene(t);return this.scenes.indexOf(e)},bringToTop:function(t){if(this.isProcessing)return this.queueOp("bringToTop",t);var e=this.getIndex(t),i=this.scenes;if(-1!==e&&e0){var i=this.getScene(t);this.scenes.splice(e,1),this.scenes.unshift(i)}return this},moveDown:function(t){if(this.isProcessing)return this.queueOp("moveDown",t);var e=this.getIndex(t);if(e>0){var i=e-1,r=this.getScene(t),s=this.getAt(i);this.scenes[e]=s,this.scenes[i]=r}return this},moveUp:function(t){if(this.isProcessing)return this.queueOp("moveUp",t);var e=this.getIndex(t);if(ei),0,s)}return this},moveBelow:function(t,e){if(t===e)return this;if(this.isProcessing)return this.queueOp("moveBelow",t,e);var i=this.getIndex(t),r=this.getIndex(e);if(-1!==i&&-1!==r&&r>i){var s=this.getAt(r);this.scenes.splice(r,1),0===i?this.scenes.unshift(s):this.scenes.splice(i-(r=this._duration&&this.transitionComplete()},transitionComplete:function(){var t=this._target.sys,e=this._target.sys.settings;t.events.emit(n.TRANSITION_COMPLETE,this.scene),e.isTransition=!1,e.transitionFrom=null,this._duration=0,this._target=null,this._onUpdate=null,this._onUpdateScope=null,this._willRemove?this.manager.remove(this.key):this._willSleep?this.systems.sleep():this.manager.stop(this.key)},add:function(t,e,i,r){return this.manager.add(t,e,i,r)},launch:function(t,e){return t&&t!==this.key&&this.manager.queueOp("start",t,e),this},run:function(t,e){return t&&t!==this.key&&this.manager.queueOp("run",t,e),this},pause:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("pause",t,e),this},resume:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("resume",t,e),this},sleep:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("sleep",t,e),this},wake:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("wake",t,e),this},switch:function(t,e){return t!==this.key&&this.manager.queueOp("switch",this.key,t,e),this},stop:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("stop",t,e),this},setActive:function(t,e,i){void 0===e&&(e=this.key);var r=this.manager.getScene(e);return r&&r.sys.setActive(t,i),this},setVisible:function(t,e){void 0===e&&(e=this.key);var i=this.manager.getScene(e);return i&&i.sys.setVisible(t),this},isSleeping:function(t){return void 0===t&&(t=this.key),this.manager.isSleeping(t)},isActive:function(t){return void 0===t&&(t=this.key),this.manager.isActive(t)},isPaused:function(t){return void 0===t&&(t=this.key),this.manager.isPaused(t)},isVisible:function(t){return void 0===t&&(t=this.key),this.manager.isVisible(t)},swapPosition:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.swapPosition(t,e),this},moveAbove:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveAbove(t,e),this},moveBelow:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveBelow(t,e),this},remove:function(t){return void 0===t&&(t=this.key),this.manager.remove(t),this},moveUp:function(t){return void 0===t&&(t=this.key),this.manager.moveUp(t),this},moveDown:function(t){return void 0===t&&(t=this.key),this.manager.moveDown(t),this},bringToTop:function(t){return void 0===t&&(t=this.key),this.manager.bringToTop(t),this},sendToBack:function(t){return void 0===t&&(t=this.key),this.manager.sendToBack(t),this},get:function(t){return this.manager.getScene(t)},getStatus:function(t){var e=this.manager.getScene(t);if(e)return e.sys.getStatus()},getIndex:function(t){return void 0===t&&(t=this.key),this.manager.getIndex(t)},shutdown:function(){var t=this.systems.events;t.off(n.SHUTDOWN,this.shutdown,this),t.off(n.TRANSITION_OUT)},destroy:function(){this.shutdown(),this.scene.sys.events.off(n.START,this.start,this),this.scene=null,this.systems=null,this.settings=null,this.manager=null}});o.register("ScenePlugin",h,"scenePlugin"),t.exports=h},55681(t,e,i){var r=i(89993),s=i(35154),n=i(46975),a=i(87033),o={create:function(t){return"string"==typeof t?t={key:t}:void 0===t&&(t={}),{status:r.PENDING,key:s(t,"key",""),active:s(t,"active",!1),visible:s(t,"visible",!0),isBooted:!1,isTransition:!1,transitionFrom:null,transitionDuration:0,transitionAllowInput:!0,data:{},pack:s(t,"pack",!1),cameras:s(t,"cameras",null),map:s(t,"map",n(a,s(t,"mapAdd",{}))),physics:s(t,"physics",{}),loader:s(t,"loader",{}),plugins:s(t,"plugins",!1),input:s(t,"input",{})}}};t.exports=o},2368(t,e,i){var r=i(83419),s=i(89993),n=i(42363),a=i(44594),o=i(27397),h=i(52106),l=i(29747),u=i(55681),d=new r({initialize:function(t,e){this.scene=t,this.game,this.renderer,this.config=e,this.settings=u.create(e),this.canvas,this.context,this.anims,this.cache,this.plugins,this.registry,this.scale,this.sound,this.textures,this.add,this.cameras,this.displayList,this.events,this.make,this.scenePlugin,this.updateList,this.sceneUpdate=l},init:function(t){this.settings.status=s.INIT,this.sceneUpdate=l,this.game=t,this.renderer=t.renderer,this.canvas=t.canvas,this.context=t.context;var e=t.plugins;this.plugins=e,e.addToScene(this,n.Global,[n.CoreScene,h(this),o(this)]),this.events.emit(a.BOOT,this),this.settings.isBooted=!0},step:function(t,e){var i=this.events;i.emit(a.PRE_UPDATE,t,e),i.emit(a.UPDATE,t,e),this.sceneUpdate.call(this.scene,t,e),i.emit(a.POST_UPDATE,t,e)},render:function(t){var e=this.displayList;e.depthSort(),this.events.emit(a.PRE_RENDER,t),this.cameras.render(t,e),this.events.emit(a.RENDER,t)},queueDepthSort:function(){this.displayList.queueDepthSort()},depthSort:function(){this.displayList.depthSort()},pause:function(t){var e=this.settings,i=this.getStatus();return i!==s.CREATING&&i!==s.RUNNING?console.warn("Cannot pause non-running Scene",e.key):this.settings.active&&(e.status=s.PAUSED,e.active=!1,this.events.emit(a.PAUSE,this,t)),this},resume:function(t){var e=this.events,i=this.settings;return this.settings.active||(i.status=s.RUNNING,i.active=!0,e.emit(a.RESUME,this,t)),this},sleep:function(t){var e=this.settings,i=this.getStatus();return i!==s.CREATING&&i!==s.RUNNING?console.warn("Cannot sleep non-running Scene",e.key):(e.status=s.SLEEPING,e.active=!1,e.visible=!1,this.events.emit(a.SLEEP,this,t)),this},wake:function(t){var e=this.events,i=this.settings;return i.status=s.RUNNING,i.active=!0,i.visible=!0,e.emit(a.WAKE,this,t),i.isTransition&&e.emit(a.TRANSITION_WAKE,i.transitionFrom,i.transitionDuration),this},getData:function(){return this.settings.data},getStatus:function(){return this.settings.status},canInput:function(){var t=this.settings.status;return t>s.PENDING&&t<=s.RUNNING},isSleeping:function(){return this.settings.status===s.SLEEPING},isActive:function(){return this.settings.status===s.RUNNING},isPaused:function(){return this.settings.status===s.PAUSED},isTransitioning:function(){return this.settings.isTransition||null!==this.scenePlugin._target},isTransitionOut:function(){return null!==this.scenePlugin._target&&this.scenePlugin._duration>0},isTransitionIn:function(){return this.settings.isTransition},isVisible:function(){return this.settings.visible},setVisible:function(t){return this.settings.visible=t,this},setActive:function(t,e){return t?this.resume(e):this.pause(e)},start:function(t){var e=this.events,i=this.settings;t&&(i.data=t),i.status=s.START,i.active=!0,i.visible=!0,e.emit(a.START,this),e.emit(a.READY,this,t)},shutdown:function(t){var e=this.events,i=this.settings;e.off(a.TRANSITION_INIT),e.off(a.TRANSITION_START),e.off(a.TRANSITION_COMPLETE),e.off(a.TRANSITION_OUT),i.status=s.SHUTDOWN,i.active=!1,i.visible=!1,e.emit(a.SHUTDOWN,this,t)},destroy:function(){var t=this.events,e=this.settings;e.status=s.DESTROYED,e.active=!1,e.visible=!1,t.emit(a.DESTROY,this),t.removeAllListeners();for(var i=["scene","game","anims","cache","plugins","registry","sound","textures","add","cameras","displayList","events","make","scenePlugin","updateList"],r=0;r=0;i--){var r=this.sounds[i];r.key===t&&(r.destroy(),this.sounds.splice(i,1),e++)}return e},pauseAll:function(){this.forEachActiveSound(function(t){t.pause()}),this.emit(a.PAUSE_ALL,this)},resumeAll:function(){this.forEachActiveSound(function(t){t.resume()}),this.emit(a.RESUME_ALL,this)},setListenerPosition:u,stopAll:function(){this.forEachActiveSound(function(t){t.stop()}),this.emit(a.STOP_ALL,this)},stopByKey:function(t){var e=0;return this.getAll(t).forEach(function(t){t.stop()&&e++}),e},isPlaying:function(t){var e,i=this.sounds.length-1;if(void 0===t){for(;i>=0;i--)if((e=this.sounds[i]).isPlaying)return!0}else for(;i>=0;i--)if((e=this.sounds[i]).key===t&&e.isPlaying)return!0;return!1},unlock:u,onBlur:u,onFocus:u,onGameBlur:function(){this.gameLostFocus=!0,this.pauseOnBlur&&this.onBlur()},onGameFocus:function(){this.gameLostFocus=!1,this.pauseOnBlur&&this.onFocus()},update:function(t,e){this.unlocked&&(this.unlocked=!1,this.locked=!1,this.emit(a.UNLOCKED,this));for(var i=this.sounds.length-1;i>=0;i--)this.sounds[i].pendingRemove&&this.sounds.splice(i,1);this.sounds.forEach(function(i){i.update(t,e)})},destroy:function(){this.game.events.off(o.BLUR,this.onGameBlur,this),this.game.events.off(o.FOCUS,this.onGameFocus,this),this.game.events.off(o.PRE_STEP,this.update,this),this.removeAllListeners(),this.removeAll(),this.sounds.length=0,this.sounds=null,this.listenerPosition=null,this.game=null},forEachActiveSound:function(t,e){var i=this;this.sounds.forEach(function(r,s){r&&!r.pendingRemove&&t.call(e||i,r,s,i.sounds)})},setRate:function(t){return this.rate=t,this},rate:{get:function(){return this._rate},set:function(t){this._rate=t,this.forEachActiveSound(function(t){t.calculateRate()}),this.emit(a.GLOBAL_RATE,this,t)}},setDetune:function(t){return this.detune=t,this},detune:{get:function(){return this._detune},set:function(t){this._detune=t,this.forEachActiveSound(function(t){t.calculateRate()}),this.emit(a.GLOBAL_DETUNE,this,t)}}});t.exports=c},14747(t,e,i){var r=i(33684),s=i(25960),n=i(57490),a={create:function(t){var e=t.config.audio,i=t.device.audio;return e.noAudio||!i.webAudio&&!i.audioData?new s(t):i.webAudio&&!e.disableWebAudio?new n(t):new r(t)}};t.exports=a},19723(t){t.exports="complete"},98882(t){t.exports="decodedall"},57506(t){t.exports="decoded"},73146(t){t.exports="destroy"},11305(t){t.exports="detune"},40577(t){t.exports="detune"},30333(t){t.exports="mute"},20394(t){t.exports="rate"},21802(t){t.exports="volume"},1299(t){t.exports="looped"},99190(t){t.exports="loop"},97125(t){t.exports="mute"},89259(t){t.exports="pan"},79986(t){t.exports="pauseall"},17586(t){t.exports="pause"},19618(t){t.exports="play"},42306(t){t.exports="rate"},10387(t){t.exports="resumeall"},48959(t){t.exports="resume"},9960(t){t.exports="seek"},19180(t){t.exports="stopall"},98328(t){t.exports="stop"},50401(t){t.exports="unlocked"},52498(t){t.exports="volume"},14463(t,e,i){t.exports={COMPLETE:i(19723),DECODED:i(57506),DECODED_ALL:i(98882),DESTROY:i(73146),DETUNE:i(11305),GLOBAL_DETUNE:i(40577),GLOBAL_MUTE:i(30333),GLOBAL_RATE:i(20394),GLOBAL_VOLUME:i(21802),LOOP:i(99190),LOOPED:i(1299),MUTE:i(97125),PAN:i(89259),PAUSE_ALL:i(79986),PAUSE:i(17586),PLAY:i(19618),RATE:i(42306),RESUME_ALL:i(10387),RESUME:i(48959),SEEK:i(9960),STOP_ALL:i(19180),STOP:i(98328),UNLOCKED:i(50401),VOLUME:i(52498)}},64895(t,e,i){var r=i(30341),s=i(83419),n=i(14463),a=i(45319),o=new s({Extends:r,initialize:function(t,e,i){if(void 0===i&&(i={}),this.tags=t.game.cache.audio.get(e),!this.tags)throw new Error('No cached audio asset with key "'+e);this.audio=null,this.startTime=0,this.previousTime=0,this.duration=this.tags[0].duration,this.totalDuration=this.tags[0].duration,r.call(this,t,e,i)},play:function(t,e){return!this.manager.isLocked(this,"play",[t,e])&&(!!r.prototype.play.call(this,t,e)&&(!!this.pickAndPlayAudioTag()&&(this.emit(n.PLAY,this),!0)))},pause:function(){return!this.manager.isLocked(this,"pause")&&(!(this.startTime>0)&&(!!r.prototype.pause.call(this)&&(this.currentConfig.seek=this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0),this.stopAndReleaseAudioTag(),this.emit(n.PAUSE,this),!0)))},resume:function(){return!this.manager.isLocked(this,"resume")&&(!(this.startTime>0)&&(!!r.prototype.resume.call(this)&&(!!this.pickAndPlayAudioTag()&&(this.emit(n.RESUME,this),!0))))},stop:function(){return!this.manager.isLocked(this,"stop")&&(!!r.prototype.stop.call(this)&&(this.stopAndReleaseAudioTag(),this.emit(n.STOP,this),!0))},pickAndPlayAudioTag:function(){if(!this.pickAudioTag())return this.reset(),!1;var t=this.currentConfig.seek,e=this.currentConfig.delay,i=(this.currentMarker?this.currentMarker.start:0)+t;return this.previousTime=i,this.audio.currentTime=i,this.applyConfig(),0===e?(this.startTime=0,this.audio.paused&&this.playCatchPromise()):(this.startTime=window.performance.now()+1e3*e,this.audio.paused||this.audio.pause()),this.resetConfig(),!0},pickAudioTag:function(){if(this.audio)return!0;for(var t=0;t0)this.startTime=i-this.manager.loopEndOffset?(this.audio.currentTime=e+Math.max(0,r-i),r=this.audio.currentTime):r=i)return this.reset(),this.stopAndReleaseAudioTag(),void this.emit(n.COMPLETE,this);this.previousTime=r}},destroy:function(){r.prototype.destroy.call(this),this.tags=null,this.audio&&this.stopAndReleaseAudioTag()},updateMute:function(){this.audio&&(this.audio.muted=this.currentConfig.mute||this.manager.mute)},updateVolume:function(){this.audio&&(this.audio.volume=a(this.currentConfig.volume*this.manager.volume,0,1))},calculateRate:function(){r.prototype.calculateRate.call(this),this.audio&&(this.audio.playbackRate=this.totalRate)},mute:{get:function(){return this.currentConfig.mute},set:function(t){this.currentConfig.mute=t,this.manager.isLocked(this,"mute",t)||(this.updateMute(),this.emit(n.MUTE,this,t))}},setMute:function(t){return this.mute=t,this},volume:{get:function(){return this.currentConfig.volume},set:function(t){this.currentConfig.volume=t,this.manager.isLocked(this,"volume",t)||(this.updateVolume(),this.emit(n.VOLUME,this,t))}},setVolume:function(t){return this.volume=t,this},rate:{get:function(){return this.currentConfig.rate},set:function(t){this.currentConfig.rate=t,this.manager.isLocked(this,n.RATE,t)||(this.calculateRate(),this.emit(n.RATE,this,t))}},setRate:function(t){return this.rate=t,this},detune:{get:function(){return this.currentConfig.detune},set:function(t){this.currentConfig.detune=t,this.manager.isLocked(this,n.DETUNE,t)||(this.calculateRate(),this.emit(n.DETUNE,this,t))}},setDetune:function(t){return this.detune=t,this},seek:{get:function(){return this.isPlaying?this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0):this.isPaused?this.currentConfig.seek:0},set:function(t){this.manager.isLocked(this,"seek",t)||this.startTime>0||(this.isPlaying||this.isPaused)&&(t=Math.min(Math.max(0,t),this.duration),this.isPlaying?(this.previousTime=t,this.audio.currentTime=t):this.isPaused&&(this.currentConfig.seek=t),this.emit(n.SEEK,this,t))}},setSeek:function(t){return this.seek=t,this},loop:{get:function(){return this.currentConfig.loop},set:function(t){this.currentConfig.loop=t,this.manager.isLocked(this,"loop",t)||(this.audio&&(this.audio.loop=t),this.emit(n.LOOP,this,t))}},setLoop:function(t){return this.loop=t,this},pan:{get:function(){return this.currentConfig.pan},set:function(t){this.currentConfig.pan=t,this.emit(n.PAN,this,t)}},setPan:function(t){return this.pan=t,this}});t.exports=o},33684(t,e,i){var r=i(85034),s=i(83419),n=i(14463),a=i(64895),o=new s({Extends:r,initialize:function(t){this.override=!0,this.audioPlayDelay=.1,this.loopEndOffset=.05,this.onBlurPausedSounds=[],this.locked="ontouchstart"in window,this.lockedActionsQueue=this.locked?[]:null,this._mute=!1,this._volume=1,r.call(this,t)},add:function(t,e){var i=new a(this,t,e);return this.sounds.push(i),i},unlock:function(){this.locked=!1;var t=this;if(this.game.cache.audio.entries.each(function(e,i){for(var r=0;r-1},setAll:function(t,e,i,s){return r.SetAll(this.list,t,e,i,s),this},each:function(t,e){for(var i=[null],r=2;r0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}}});t.exports=o},90330(t,e,i){t.exports=i(60269).default},25774(t,e,i){var r=i(83419),s=i(50792),n=i(82348),a=new r({Extends:s,initialize:function(){s.call(this),this._pending=[],this._active=[],this._destroy=[],this._toProcess=0,this.checkQueue=!1},isActive:function(t){return this._active.indexOf(t)>-1},isPending:function(t){return this._toProcess>0&&this._pending.indexOf(t)>-1},isDestroying:function(t){return this._destroy.indexOf(t)>-1},add:function(t){return this.checkQueue&&this.isActive(t)&&!this.isDestroying(t)||this.isPending(t)||(this._pending.push(t),this._toProcess++),t},remove:function(t){if(this.isPending(t)){var e=this._pending,i=e.indexOf(t);-1!==i&&e.splice(i,1)}else this.isActive(t)&&(this._destroy.push(t),this._toProcess++);return t},removeAll:function(){for(var t=this._active,e=this._destroy,i=t.length;i--;)e.push(t[i]),this._toProcess++;return this},update:function(){if(0===this._toProcess)return this._active;var t,e,i=this._destroy,r=this._active;for(t=0;t=t.minX&&e.maxY>=t.minY}function v(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(t,e,i,s,n){for(var a,o=[e,i];o.length;)(i=o.pop())-(e=o.pop())<=s||(a=e+Math.ceil((i-e)/s/2)*s,r(t,a,e,i,n),o.push(e,a,a,i))}s.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],r=this.toBBox;if(!m(t,e))return i;for(var s,n,a,o,h=[];e;){for(s=0,n=e.children.length;s=0&&n[e].children.length>this._maxEntries;)this._split(n,e),e--;this._adjustParentBBoxes(s,n,e)},_split:function(t,e){var i=t[e],r=i.children.length,s=this._minEntries;this._chooseSplitAxis(i,s,r);var n=this._chooseSplitIndex(i,s,r),o=v(i.children.splice(n,i.children.length-n));o.height=i.height,o.leaf=i.leaf,a(i,this.toBBox),a(o,this.toBBox),e?t[e-1].children.push(o):this._splitRoot(i,o)},_splitRoot:function(t,e){this.data=v([t,e]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var r,s,n,a,h,l,u,c;for(l=u=1/0,r=e;r<=i-e;r++)a=p(s=o(t,0,r,this.toBBox),n=o(t,r,i,this.toBBox)),h=d(s)+d(n),a=e;s--)n=t.children[s],h(u,t.leaf?a(n):n),d+=c(u);return d},_adjustParentBBoxes:function(t,e,i){for(var r=i;r>=0;r--)h(e[r],t)},_condense:function(t){for(var e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():a(t[i],this.toBBox)},compareMinX:function(t,e){return t.left-e.left},compareMinY:function(t,e){return t.top-e.top},toBBox:function(t){return{minX:t.left,minY:t.top,maxX:t.right,maxY:t.bottom}}},t.exports=s},86555(t,e,i){var r=i(45319),s=i(83419),n=i(56583),a=i(26099),o=new s({initialize:function(t,e,i,r){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===r&&(r=null),this._width=t,this._height=e,this._parent=r,this.aspectMode=i,this.aspectRatio=0===e?1:t/e,this.minWidth=0,this.minHeight=0,this.maxWidth=Number.MAX_VALUE,this.maxHeight=Number.MAX_VALUE,this.snapTo=new a},setAspectMode:function(t){return void 0===t&&(t=0),this.aspectMode=t,this.setSize(this._width,this._height)},setSnap:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.snapTo.set(t,e),this.setSize(this._width,this._height)},setParent:function(t){return this._parent=t,this.setSize(this._width,this._height)},setMin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.minWidth=r(t,0,this.maxWidth),this.minHeight=r(e,0,this.maxHeight),this.setSize(this._width,this._height)},setMax:function(t,e){return void 0===t&&(t=Number.MAX_VALUE),void 0===e&&(e=t),this.maxWidth=r(t,this.minWidth,Number.MAX_VALUE),this.maxHeight=r(e,this.minHeight,Number.MAX_VALUE),this.setSize(this._width,this._height)},setSize:function(t,e){switch(void 0===t&&(t=0),void 0===e&&(e=t),this.aspectMode){case o.NONE:this._width=this.getNewWidth(n(t,this.snapTo.x)),this._height=this.getNewHeight(n(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height;break;case o.WIDTH_CONTROLS_HEIGHT:this._width=this.getNewWidth(n(t,this.snapTo.x)),this._height=this.getNewHeight(this._width*(1/this.aspectRatio),!1);break;case o.HEIGHT_CONTROLS_WIDTH:this._height=this.getNewHeight(n(e,this.snapTo.y)),this._width=this.getNewWidth(this._height*this.aspectRatio,!1);break;case o.FIT:this.constrain(t,e,!0);break;case o.ENVELOP:this.constrain(t,e,!1)}return this},setAspectRatio:function(t){return this.aspectRatio=t,this.setSize(this._width,this._height)},resize:function(t,e){return this._width=this.getNewWidth(n(t,this.snapTo.x)),this._height=this.getNewHeight(n(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height,this},getNewWidth:function(t,e){return void 0===e&&(e=!0),t=r(t,this.minWidth,this.maxWidth),e&&this._parent&&t>this._parent.width&&(t=Math.max(this.minWidth,this._parent.width)),t},getNewHeight:function(t,e){return void 0===e&&(e=!0),t=r(t,this.minHeight,this.maxHeight),e&&this._parent&&t>this._parent.height&&(t=Math.max(this.minHeight,this._parent.height)),t},constrain:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=!0),t=this.getNewWidth(t),e=this.getNewHeight(e);var r=this.snapTo,s=0===e?1:t/e;return i&&this.aspectRatio>s||!i&&this.aspectRatio0&&(t=(e=n(e,r.y))*this.aspectRatio)):(i&&this.aspectRatios)&&(t=(e=n(e,r.y))*this.aspectRatio,r.x>0&&(e=(t=n(t,r.x))*(1/this.aspectRatio))),this._width=t,this._height=e,this},fitTo:function(t,e){return this.constrain(t,e,!0)},envelop:function(t,e){return this.constrain(t,e,!1)},setWidth:function(t){return this.setSize(t,this._height)},setHeight:function(t){return this.setSize(this._width,t)},toString:function(){return"[{ Size (width="+this._width+" height="+this._height+" aspectRatio="+this.aspectRatio+" aspectMode="+this.aspectMode+") }]"},setCSS:function(t){t&&t.style&&(t.style.width=this._width+"px",t.style.height=this._height+"px")},copy:function(t){return t.setAspectMode(this.aspectMode),t.aspectRatio=this.aspectRatio,t.setSize(this.width,this.height)},destroy:function(){this._parent=null,this.snapTo=null},width:{get:function(){return this._width},set:function(t){this.setSize(t,this._height)}},height:{get:function(){return this._height},set:function(t){this.setSize(this._width,t)}}});o.NONE=0,o.WIDTH_CONTROLS_HEIGHT=1,o.HEIGHT_CONTROLS_WIDTH=2,o.FIT=3,o.ENVELOP=4,t.exports=o},15238(t){t.exports="add"},56187(t){t.exports="remove"},82348(t,e,i){t.exports={PROCESS_QUEUE_ADD:i(15238),PROCESS_QUEUE_REMOVE:i(56187)}},41392(t,e,i){t.exports={Events:i(82348),List:i(73162),Map:i(90330),ProcessQueue:i(25774),RTree:i(59542),Size:i(86555)}},57382(t,e,i){var r=i(83419),s=i(45319),n=i(40987),a=i(8054),o=i(50030),h=i(79237),l=new r({Extends:h,initialize:function(t,e,i,r,s){h.call(this,t,e,i,r,s),this.add("__BASE",0,0,0,r,s),this._source=this.frames.__BASE.source,this.canvas=this._source.image,this.context=this.canvas.getContext("2d",{willReadFrequently:!0}),this.width=r,this.height=s,this.imageData=this.context.getImageData(0,0,r,s),this.data=null,this.imageData&&(this.data=this.imageData.data),this.pixels=null,this.buffer,this.data&&(this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data)},update:function(){return this.imageData=this.context.getImageData(0,0,this.width,this.height),this.data=this.imageData.data,this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data,this.manager.game.config.renderType===a.WEBGL&&this.refresh(),this},draw:function(t,e,i,r){return void 0===r&&(r=!0),this.context.drawImage(i,t,e),r&&this.update(),this},drawFrame:function(t,e,i,r,s){void 0===i&&(i=0),void 0===r&&(r=0),void 0===s&&(s=!0);var n=this.manager.getFrame(t,e);if(n){var a=n.canvasData,o=n.cutWidth,h=n.cutHeight,l=n.source.resolution;this.context.drawImage(n.source.image,a.x,a.y,o,h,i,r,o/l,h/l),s&&this.update()}return this},setPixel:function(t,e,i,r,s,n){if(void 0===n&&(n=255),t=Math.abs(Math.floor(t)),e=Math.abs(Math.floor(e)),this.getIndex(t,e)>-1){var a=this.context.getImageData(t,e,1,1);a.data[0]=i,a.data[1]=r,a.data[2]=s,a.data[3]=n,this.context.putImageData(a,t,e)}return this},putData:function(t,e,i,r,s,n,a){return void 0===r&&(r=0),void 0===s&&(s=0),void 0===n&&(n=t.width),void 0===a&&(a=t.height),this.context.putImageData(t,e,i,r,s,n,a),this},getData:function(t,e,i,r){return t=s(Math.floor(t),0,this.width-1),e=s(Math.floor(e),0,this.height-1),i=s(i,1,this.width-t),r=s(r,1,this.height-e),this.context.getImageData(t,e,i,r)},getPixel:function(t,e,i){i||(i=new n);var r=this.getIndex(t,e);if(r>-1){var s=this.data,a=s[r+0],o=s[r+1],h=s[r+2],l=s[r+3];i.setTo(a,o,h,l)}return i},getPixels:function(t,e,i,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===r&&(r=i),t=Math.abs(Math.round(t)),e=Math.abs(Math.round(e));for(var a=s(t,0,this.width),o=s(t+i,0,this.width),h=s(e,0,this.height),l=s(e+r,0,this.height),u=new n,d=[],c=h;ca.width&&(t=a.width-r.cutX),r.cutY+e>a.height&&(e=a.height-r.cutY),r.setSize(t,e,r.cutX,r.cutY)}return this},render:function(){if(0!==this.commandBuffer.length)return this.camera.preRender(),this.renderer.type===o.WEBGL&&this._renderWebGL(),this.renderer.type===o.CANVAS&&this._renderCanvas(),this},_renderWebGL:function(){this.renderer.renderNodes.getNode("DynamicTextureHandler").run(this)},_renderCanvas:function(){var t,e,i,s,n,a,o,h,l,u,d,c,p,g,m,v=this.camera,y=this.context,x=this.renderer,T=this.manager;x.setContext(y);for(var w=this.commandBuffer,b=w.length,S=!1,C=!1,E=0;E>24&255)/255;var _=A>>16&255,M=A>>8&255,R=255&A;y.save(),y.globalCompositeOperation="source-over",y.fillStyle="rgba("+_+","+M+","+R+","+t+")",y.fillRect(g,m,p,n),y.restore();break;case f.STAMP:a=w[++E],s=w[++E],g=w[++E],m=w[++E],t=w[++E],c=w[++E],l=w[++E],u=w[++E],d=w[++E],o=w[++E],h=w[++E],e=w[++E],C&&(e=r.ERASE);var P=T.resetStamp(t,c);P.setPosition(g,m).setRotation(l).setScale(u,d).setTexture(a,s).setOrigin(o,h).setBlendMode(e),P.renderCanvas(x,P,v,null);break;case f.REPEAT:a=w[++E],s=w[++E],g=w[++E],m=w[++E],t=w[++E],c=w[++E],l=w[++E],u=w[++E],d=w[++E],o=w[++E],h=w[++E],e=w[++E],p=w[++E],n=w[++E];var O=w[++E],L=w[++E],D=w[++E],F=w[++E],I=w[++E];C&&(e=r.ERASE);var N=T.resetTileSprite(t,c);N.setPosition(g,m).setRotation(l).setScale(u,d).setTexture(a,s).setSize(p,n).setOrigin(o,h).setBlendMode(e).setTilePosition(O,L).setTileRotation(D).setTileScale(F,I),N.renderCanvas(x,N,v,null);break;case f.DRAW:var B=w[++E];if(g=w[++E],m=w[++E],void 0!==g){var k=B.x;B.x=g}if(void 0!==m){var U=B.y;B.y=m}C&&(i=B.blendMode,B.blendMode=r.ERASE),B.renderCanvas(x,B,v,null),void 0!==g&&(B.x=k),void 0!==m&&(B.y=U),C&&(B.blendMode=i);break;case f.SET_ERASE:C=!!w[++E];break;case f.PRESERVE:S=w[++E];break;case f.CALLBACK:(0,w[++E])();break;case f.CAPTURE:B=w[++E];var z=w[++E],Y=this.startCapture(B,z);B.renderCanvas(x,B,z.camera||v,Y.transform),this.finishCapture(B,Y)}}S||(w.length=0),x.setContext()},fill:function(t,e,i,r,s,n){void 0===e&&(e=1),void 0===i&&(i=0),void 0===r&&(r=0),void 0===s&&(s=this.width),void 0===n&&(n=this.height);var a=t>>16&255,o=t>>8&255,h=255&t,l=c.getTintFromFloats(a/255,o/255,h/255,e);return this.commandBuffer.push(f.FILL,l,i,r,s,n),this},clear:function(t,e,i,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===r&&(r=this.height),this.commandBuffer.push(f.CLEAR,t,e,i,r),this},stamp:function(t,e,i,r,s){void 0===i&&(i=0),void 0===r&&(r=0);var n=u(s,"alpha",1),a=u(s,"tint",16777215),o=u(s,"angle",0),h=u(s,"rotation",0),l=u(s,"scale",1),d=u(s,"scaleX",l),c=u(s,"scaleY",l),p=u(s,"originX",.5),g=u(s,"originY",.5),m=u(s,"blendMode",0);return 0!==o&&(h=o*Math.PI/180),this.commandBuffer.push(f.STAMP,t,e,i,r,n,a,h,d,c,p,g,m),this},erase:function(t,e,i,r,s){var n=this.commandBuffer,a=n.length;return n[a-2]!==f.SET_ERASE||n[a-1]?n.push(f.SET_ERASE,!0):n.length-=2,this.draw(t,e,i,r,s),n.push(f.SET_ERASE,!1),this},draw:function(t,e,i,r,s){Array.isArray(t)||(t=[t]);for(var n=t.length,a=0;aT||x.y>w)){var b=Math.max(x.x,e),S=Math.max(x.y,i),C=Math.min(x.r,T)-b,E=Math.min(x.b,w)-S;m=C,v=E,p=a?h+(u-(b-x.x)-C):h+(b-x.x),g=o?l+(d-(S-x.y)-E):l+(S-x.y),e=b,i=S,r=C,n=E}else p=0,g=0,m=0,v=0}else a&&(p=h+(u-e-r)),o&&(g=l+(d-i-n));var A=this.source.width,_=this.source.height;return t.u0=Math.max(0,p/A),t.v0=1-Math.max(0,g/_),t.u1=Math.min(1,(p+m)/A),t.v1=1-Math.min(1,(g+v)/_),t.x=e,t.y=i,t.cx=p,t.cy=g,t.cw=m,t.ch=v,t.width=r,t.height=n,t.flipX=a,t.flipY=o,t},updateCropUVs:function(t,e,i){return this.setCropUVs(t,t.x,t.y,t.width,t.height,e,i)},setUVs:function(t,e,i,r,s,n){var a=this.data.drawImage;return a.width=t,a.height=e,this.u0=i,this.v0=r,this.u1=s,this.v1=n,this},updateUVs:function(){var t=this.cutX,e=this.cutY,i=this.cutWidth,r=this.cutHeight,s=this.data.drawImage;s.width=i,s.height=r;var n=this.source.width,a=this.source.height;return this.u0=t/n,this.v0=1-e/a,this.u1=(t+i)/n,this.v1=1-(e+r)/a,this},updateUVsInverted:function(){var t=this.source.width,e=this.source.height;return this.u0=(this.cutX+this.cutHeight)/t,this.v0=1-this.cutY/e,this.u1=this.cutX/t,this.v1=1-(this.cutY+this.cutWidth)/e,this},clone:function(){var t=new a(this.texture,this.name,this.sourceIndex);return t.cutX=this.cutX,t.cutY=this.cutY,t.cutWidth=this.cutWidth,t.cutHeight=this.cutHeight,t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t.halfWidth=this.halfWidth,t.halfHeight=this.halfHeight,t.centerX=this.centerX,t.centerY=this.centerY,t.rotated=this.rotated,t.data=n(!0,t.data,this.data),t.updateUVs(),t},destroy:function(){this.texture=null,this.source=null,this.customData=null,this.data=null},glTexture:{get:function(){return this.source.glTexture}},realWidth:{get:function(){return this.data.sourceSize.w}},realHeight:{get:function(){return this.data.sourceSize.h}},radius:{get:function(){return this.data.radius}},trimmed:{get:function(){return this.data.trim}},scale9:{get:function(){return this.data.scale9}},is3Slice:{get:function(){return this.data.is3Slice}},canvasData:{get:function(){return this.data.drawImage}}});t.exports=a},79237(t,e,i){var r=i(83419),s=i(4327),n=i(11876),a='Texture "%s" has no frame "%s"',o=new r({initialize:function(t,e,i,r,s){Array.isArray(i)||(i=[i]),this.manager=t,this.key=e,this.source=[],this.dataSource=[],this.frames={},this.customData={},this.firstFrame="__BASE",this.frameTotal=0,this.smoothPixelArt=null;for(var a=0;an&&(n=h.cutX+h.cutWidth),h.cutY+h.cutHeight>a&&(a=h.cutY+h.cutHeight)}return{x:r,y:s,width:n-r,height:a-s}},getFrameNames:function(t){void 0===t&&(t=!1);var e=Object.keys(this.frames);if(!t){var i=e.indexOf("__BASE");-1!==i&&e.splice(i,1)}return e},getSourceImage:function(t){null!=t&&1!==this.frameTotal||(t="__BASE");var e=this.frames[t];return e?e.source.image:(console.warn(a,this.key,t),this.frames.__BASE.source.image)},getDataSourceImage:function(t){null!=t&&1!==this.frameTotal||(t="__BASE");var e,i=this.frames[t];return i?e=i.sourceIndex:(console.warn(a,this.key,t),e=this.frames.__BASE.sourceIndex),this.dataSource[e].image},setSource:function(t,e,i,r,s){void 0===e&&(e=0),void 0===i&&(i=!1),Array.isArray(t)||(t=[t]);for(var a=0;a0&&o.height>0&&l.drawImage(a.source.image,o.x,o.y,o.width,o.height,0,0,o.width,o.height),n=h.toDataURL(i,s),r.remove(h)}return n},addImage:function(t,e,i){var r=null;return this.checkKey(t)&&(r=this.create(t,e),v.Image(r,0),i&&r.setDataSource(i),this.emit(u.ADD,t,r),this.emit(u.ADD_KEY+t,r)),r},addGLTexture:function(t,e){var i=null;if(this.checkKey(t)){var r=e.width,s=e.height;(i=this.create(t,e,r,s)).add("__BASE",0,0,0,r,s),this.emit(u.ADD,t,i),this.emit(u.ADD_KEY+t,i)}return i},addCompressedTexture:function(t,e,i){var r=null;if(this.checkKey(t)){if((r=this.create(t,e)).add("__BASE",0,0,0,e.width,e.height),i){var s=function(t,e,i){Array.isArray(i.textures)||Array.isArray(i.frames)?v.JSONArray(t,e,i):v.JSONHash(t,e,i)};if(Array.isArray(i))for(var n=0;n=h.x&&t=h.y&&e=o.x&&t=o.y&&e>1),g=Math.max(1,g>>1),f+=m}return{mipmaps:c,width:h,height:l,internalFormat:o,compressed:!0,generateMipmap:!1}}console.warn("KTXParser - Only compressed formats supported")}},41942(t){t.exports=function(t,e){if(e&&e.frames&&e.pages){var i=t.source[0];t.add("__BASE",0,0,0,i.width,i.height);var r=e.frames;for(var s in r)if(r.hasOwnProperty(s)){var n=r[s],a=0|n.page;if(a>=t.source.length)console.warn('PCT atlas frame "'+s+'" references missing page '+a);else{var o=t.add(n.key||s,a,n.x,n.y,n.w,n.h);o?(n.trimmed&&o.setTrim(n.sourceW,n.sourceH,n.trimX,n.trimY,n.w,n.h),n.rotated&&(o.rotated=!0,o.updateUVsInverted())):console.warn("Invalid PCT atlas, frame already exists: "+s)}}return t.customData.pct={pages:e.pages,folders:e.folders},t}console.warn("Invalid PCT atlas data given")}},39620(t){var e={1:".png",2:".webp",3:".jpg",4:".jpeg",5:".gif"},i=function(t,e){for(var i=String(t);i.length0&&function(t){if(0===t.length)return!1;for(var e=0;e57)return!1}return!0}(s.substring(0,a))&&(n=i[parseInt(s.substring(0,a),10)],s=s.substring(a+1));var o=/~([1-5])$/.exec(s);if(o){var h=e[parseInt(o[1],10)];s=s.substring(0,s.length-2)+h}else r&&(s+=r);return n?n+"/"+s:s},s=function(t,s){var n="",a=/~([1-5])$/.exec(t);a&&(n=e[parseInt(a[1],10)],t=t.substring(0,t.length-2));for(var o=[],h=t.split(","),l=0;l=0)for(var c=u.substring(0,d),f=u.substring(d+1),p=f.indexOf("-"),g=f.substring(0,p),m=f.substring(p+1),v=parseInt(g,10),y=parseInt(m,10),x=g.length>1&&"0"===g.charAt(0)?g.length:0,T=v;T<=y;T++){var w=x>0?i(T,x):String(T);o.push(r(c+w,s,n))}else o.push(r(u,s,n))}return o};t.exports=function(t){if("string"!=typeof t||0===t.length)return console.warn("Invalid PCT file: empty or not a string"),null;var e=t.split("\n"),i=e[0];if(13===i.charCodeAt(i.length-1)&&(i=i.substring(0,i.length-1)),!i||0!==i.indexOf("PCT:"))return console.warn("Not a PCT file: missing PCT: header"),null;var n=i.substring(4),a=n.split("."),o=parseInt(a[0],10);if(isNaN(o)||o>1)return console.warn("Unsupported PCT version: "+n),null;for(var h=[],l=[],u={},d=0,c=null,f=1;f1};if(x.trimmed){var T=v[1].split(",");x.sourceW=parseInt(T[0],10),x.sourceH=parseInt(T[1],10),x.trimX=parseInt(T[2],10),x.trimY=parseInt(T[3],10)}c=x}else if("A:"===g){var w=p.indexOf("=",2);if(-1===w)continue;var b=r(p.substring(2,w),l,""),S=s(p.substring(w+1),l),C=u[b];if(C)for(var E=0;E>1),g=Math.max(1,g>>1),f+=v}return{mipmaps:c,width:h,height:l,internalFormat:s,compressed:!0,generateMipmap:!1}}},75549(t,e,i){var r=i(95540);t.exports=function(t,e,i,s,n,a,o){var h=r(o,"frameWidth",null),l=r(o,"frameHeight",h);if(null===h)throw new Error("TextureManager.SpriteSheet: Invalid frameWidth given.");var u=t.source[e];t.add("__BASE",e,0,0,u.width,u.height);var d=r(o,"startFrame",0),c=r(o,"endFrame",-1),f=r(o,"margin",0),p=r(o,"spacing",0),g=Math.floor((n-f+p)/(h+p))*Math.floor((a-f+p)/(l+p));0===g&&console.warn("SpriteSheet frame dimensions will result in zero frames for texture:",t.key),(d>g||d<-g)&&(d=0),d<0&&(d=g+d),(-1===c||c>g||cn&&(y=b-n),S>a&&(x=S-a),w>=d&&w<=c&&(t.add(T,e,i+m,s+v,h-y,l-x),T++),(m+=h+p)+h>n&&(m=f,v+=l+p)}return t}},47534(t,e,i){var r=i(95540);t.exports=function(t,e,i){var s=r(i,"frameWidth",null),n=r(i,"frameHeight",s);if(!s)throw new Error("TextureManager.SpriteSheetFromAtlas: Invalid frameWidth given.");var a=t.source[0];t.add("__BASE",0,0,0,a.width,a.height);var o,h=r(i,"startFrame",0),l=r(i,"endFrame",-1),u=r(i,"margin",0),d=r(i,"spacing",0),c=e.cutX,f=e.cutY,p=e.cutWidth,g=e.cutHeight,m=e.realWidth,v=e.realHeight,y=Math.floor((m-u+d)/(s+d)),x=Math.floor((v-u+d)/(n+d)),T=y*x,w=e.x,b=s-w,S=s-(m-p-w),C=e.y,E=n-C,A=n-(v-g-C);(h>T||h<-T)&&(h=0),h<0&&(h=T+h),-1!==l&&(T=h+(l+1));for(var _=u,M=u,R=0,P=0;P=this.firstgid&&tthis.right||e>this.bottom)},copy:function(t){return this.index=t.index,this.alpha=t.alpha,this.properties=a(t.properties),this.visible=t.visible,this.setFlip(t.flipX,t.flipY),this.tint=t.tint,this.rotation=t.rotation,this.collideUp=t.collideUp,this.collideDown=t.collideDown,this.collideLeft=t.collideLeft,this.collideRight=t.collideRight,this.collisionCallback=t.collisionCallback,this.collisionCallbackContext=t.collisionCallbackContext,this},getCollisionGroup:function(){return this.tileset?this.tileset.getTileCollisionGroup(this.index):null},getTileData:function(){return this.tileset?this.tileset.getTileData(this.index):null},getLeft:function(t){var e=this.tilemapLayer;return e?e.tileToWorldXY(this.x,this.y,void 0,t).x:this.x*this.baseWidth},getRight:function(t){var e=this.tilemapLayer;return e?this.getLeft(t)+this.width*e.scaleX:this.getLeft(t)+this.width},getTop:function(t){var e=this.tilemapLayer;return e?e.tileToWorldXY(this.x,this.y,void 0,t).y:this.y*this.baseWidth-(this.height-this.baseHeight)},getBottom:function(t){var e=this.tilemapLayer;return e?this.getTop(t)+this.height*e.scaleY:this.getTop(t)+this.height},getBounds:function(t,e){return void 0===e&&(e=new o),e.x=this.getLeft(t),e.y=this.getTop(t),e.width=this.getRight(t)-e.x,e.height=this.getBottom(t)-e.y,e},getCenterX:function(t){return(this.getLeft(t)+this.getRight(t))/2},getCenterY:function(t){return(this.getTop(t)+this.getBottom(t))/2},intersects:function(t,e,i,r){return!(i<=this.pixelX||r<=this.pixelY||t>=this.right||e>=this.bottom)},isInteresting:function(t,e){return t&&e?this.canCollide||this.hasInterestingFace:t?this.collides:!!e&&this.hasInterestingFace},resetCollision:function(t){(void 0===t&&(t=!0),this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,t)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},resetFaces:function(){return this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this},setCollision:function(t,e,i,r,s){(void 0===e&&(e=t),void 0===i&&(i=t),void 0===r&&(r=t),void 0===s&&(s=!0),this.collideLeft=t,this.collideRight=e,this.collideUp=i,this.collideDown=r,this.faceLeft=t,this.faceRight=e,this.faceTop=i,this.faceBottom=r,s)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},setCollisionCallback:function(t,e){return null===t?(this.collisionCallback=void 0,this.collisionCallbackContext=void 0):(this.collisionCallback=t,this.collisionCallbackContext=e),this},setSize:function(t,e,i,r){return void 0!==t&&(this.width=t),void 0!==e&&(this.height=e),void 0!==i&&(this.baseWidth=i),void 0!==r&&(this.baseHeight=r),this.updatePixelXY(),this},updatePixelXY:function(){var t=this.layer.orientation;if(t===n.ORTHOGONAL)this.pixelX=this.x*this.baseWidth,this.pixelY=this.y*this.baseHeight;else if(t===n.ISOMETRIC)this.pixelX=(this.x-this.y)*this.baseWidth*.5,this.pixelY=(this.x+this.y)*this.baseHeight*.5;else if(t===n.STAGGERED)this.pixelX=this.x*this.baseWidth+this.y%2*(this.baseWidth/2),this.pixelY=this.y*(this.baseHeight/2);else if(t===n.HEXAGONAL){var e,i,r=this.layer.staggerAxis,s=this.layer.staggerIndex,a=this.layer.hexSideLength;"y"===r?(i=(this.baseHeight-a)/2+a,this.pixelX="odd"===s?this.x*this.baseWidth+this.y%2*(this.baseWidth/2):this.x*this.baseWidth-this.y%2*(this.baseWidth/2),this.pixelY=this.y*i):"x"===r&&(e=(this.baseWidth-a)/2+a,this.pixelX=this.x*e,this.pixelY="odd"===s?this.y*this.baseHeight+this.x%2*(this.baseHeight/2):this.y*this.baseHeight-this.x%2*(this.baseHeight/2))}return this.right=this.pixelX+this.baseWidth,this.bottom=this.pixelY+this.baseHeight,this},destroy:function(){this.collisionCallback=void 0,this.collisionCallbackContext=void 0,this.properties=void 0},canCollide:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown||void 0!==this.collisionCallback}},collides:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown}},hasInterestingFace:{get:function(){return this.faceTop||this.faceBottom||this.faceLeft||this.faceRight}},tileset:{get:function(){var t=this.layer.tilemapLayer;if(t){var e=t.gidMap[this.index];if(e)return e}return null}},tilemapLayer:{get:function(){return this.layer.tilemapLayer}},tilemap:{get:function(){var t=this.tilemapLayer;return t?t.tilemap:null}}});t.exports=l},49075(t,e,i){var r=i(84101),s=i(83419),n=i(39506),a=i(80341),o=i(95540),h=i(14977),l=i(27462),u=i(91907),d=i(36305),c=i(19133),f=i(68287),p=i(23029),g=i(81086),m=i(44731),v=i(53180),y=i(20442),x=i(33629),T=new s({initialize:function(t,e){this.scene=t,this.tileWidth=e.tileWidth,this.tileHeight=e.tileHeight,this.width=e.width,this.height=e.height,this.orientation=e.orientation,this.renderOrder=e.renderOrder,this.format=e.format,this.version=e.version,this.properties=e.properties,this.widthInPixels=e.widthInPixels,this.heightInPixels=e.heightInPixels,this.imageCollections=e.imageCollections,this.images=e.images,this.layers=e.layers,this.tiles=e.tiles,this.tilesets=e.tilesets,this.objects=e.objects,this.currentLayerIndex=0,this.hexSideLength=e.hexSideLength;var i=this.orientation;this._convert={WorldToTileXY:g.GetWorldToTileXYFunction(i),WorldToTileX:g.GetWorldToTileXFunction(i),WorldToTileY:g.GetWorldToTileYFunction(i),TileToWorldXY:g.GetTileToWorldXYFunction(i),TileToWorldX:g.GetTileToWorldXFunction(i),TileToWorldY:g.GetTileToWorldYFunction(i),GetTileCorners:g.GetTileCornersFunction(i)}},setRenderOrder:function(t){var e=["right-down","left-down","right-up","left-up"];return"number"==typeof t&&(t=e[t]),e.indexOf(t)>-1&&(this.renderOrder=t),this},addTilesetImage:function(t,e,i,s,n,o,h,l){if(void 0===t)return null;null==e&&(e=t);var u=this.scene.sys.textures;if(!u.exists(e))return console.warn('Texture key "%s" not found',e),null;var d=u.get(e),c=this.getTilesetIndex(t);if(null===c&&this.format===a.TILED_JSON)return console.warn('Tilemap has no tileset "%s". Its tilesets are %o',t,this.tilesets),null;var f=this.tilesets[c];return f?((i||s)&&f.setTileSize(i,s),(n||o)&&f.setSpacing(n,o),f.setImage(d),f):(void 0===i&&(i=this.tileWidth),void 0===s&&(s=this.tileHeight),void 0===n&&(n=0),void 0===o&&(o=0),void 0===h&&(h=0),void 0===l&&(l={x:0,y:0}),(f=new x(t,h,i,s,n,o,void 0,void 0,l)).setImage(d),this.tilesets.push(f),this.tiles=r(this),f)},copy:function(t,e,i,r,s,n,a,o){return null!==(o=this.getLayer(o))?(g.Copy(t,e,i,r,s,n,a,o),this):null},createBlankLayer:function(t,e,i,r,s,n,a,o){if(void 0===i&&(i=0),void 0===r&&(r=0),void 0===s&&(s=this.width),void 0===n&&(n=this.height),void 0===a&&(a=this.tileWidth),void 0===o&&(o=this.tileHeight),null!==this.getLayerIndex(t))return console.warn("Invalid Tilemap Layer ID: "+t),null;for(var l,u=new h({name:t,tileWidth:a,tileHeight:o,width:s,height:n,orientation:this.orientation,hexSideLength:this.hexSideLength}),d=0;d1&&console.warn("TilemapGPULayer can only use one tileset. Using the first item given."),e=e[0]),a=new v(this.scene,this,n,e,i,r)):(a=new y(this.scene,this,n,e,i,r)).setRenderOrder(this.renderOrder),this.scene.sys.displayList.add(a),a)},createFromObjects:function(t,e,i){void 0===i&&(i=!0);var r=[],s=this.getObjectLayer(t);if(!s)return console.warn("createFromObjects: Invalid objectLayerName given: "+t),r;var a=new l(i?this.tilesets:void 0);Array.isArray(e)||(e=[e]);var h=s.objects;e.sortByY&&h.sort(function(t,e){return t.y>e.y?1:-1});for(var c=0;c-1&&this.putTileAt(e,n.x,n.y,i,n.tilemapLayer)}return r},removeTileAt:function(t,e,i,r,s){return void 0===i&&(i=!0),void 0===r&&(r=!0),null===(s=this.getLayer(s))?null:g.RemoveTileAt(t,e,i,r,s)},removeTileAtWorldXY:function(t,e,i,r,s,n){return void 0===i&&(i=!0),void 0===r&&(r=!0),null===(n=this.getLayer(n))?null:g.RemoveTileAtWorldXY(t,e,i,r,s,n)},renderDebug:function(t,e,i){return null===(i=this.getLayer(i))?null:(this.orientation===u.ORTHOGONAL&&g.RenderDebug(t,e,i),this)},renderDebugFull:function(t,e){for(var i=this.layers,r=0;r=0&&t<4&&(this._renderOrder=t),this},cull:function(t){return this.cullCallback(this.layer,t,this.culledTiles,this._renderOrder)},setSkipCull:function(t){return void 0===t&&(t=!0),this.skipCull=t,this},setCullPadding:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=1),this.cullPaddingX=t,this.cullPaddingY=e,this},setTint:function(t,e,i,r,s,n){void 0===t&&(t=16777215);return this.forEachTile(function(e){e.tint=t},this,e,i,r,s,n)},setTintMode:function(t,e,i,r,s,n){void 0===t&&(t=h.MULTIPLY);return this.forEachTile(function(e){e.tintMode=t},this,e,i,r,s,n)},destroy:function(t){this.culledTiles.length=0,this.cullCallback=null,o.prototype.destroy.call(this,t)}});t.exports=l},44731(t,e,i){var r=i(83419),s=i(78389),n=i(31401),a=i(95643),o=i(81086),h=i(26099),l=new r({Extends:a,Mixins:[n.Alpha,n.BlendMode,n.ComputedSize,n.Depth,n.ElapseTimer,n.Flip,n.GetBounds,n.Lighting,n.Mask,n.Origin,n.RenderNodes,n.Transform,n.Visible,n.ScrollFactor,s],initialize:function(t,e,i,r,s,n){a.call(this,e,t),this.isTilemap=!0,this.tilemap=i,this.layerIndex=r,this.layer=i.layers[r],this.layer.tilemapLayer=this,this.gidMap=[],this.tempVec=new h,this.collisionCategory=1,this.collisionMask=1,this.setAlpha(this.layer.alpha),this.setPosition(s,n),this.setOrigin(0,0),this.setSize(i.tileWidth*this.layer.width,i.tileHeight*this.layer.height)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(t,e){this.updateTimer(t,e)},calculateFacesAt:function(t,e){return o.CalculateFacesAt(t,e,this.layer),this},calculateFacesWithin:function(t,e,i,r){return o.CalculateFacesWithin(t,e,i,r,this.layer),this},createFromTiles:function(t,e,i,r,s){return o.CreateFromTiles(t,e,i,r,s,this.layer)},copy:function(t,e,i,r,s,n,a){return o.Copy(t,e,i,r,s,n,a,this.layer),this},fill:function(t,e,i,r,s,n){return o.Fill(t,e,i,r,s,n,this.layer),this},filterTiles:function(t,e,i,r,s,n,a){return o.FilterTiles(t,e,i,r,s,n,a,this.layer)},findByIndex:function(t,e,i){return o.FindByIndex(t,e,i,this.layer)},findTile:function(t,e,i,r,s,n,a){return o.FindTile(t,e,i,r,s,n,a,this.layer)},forEachTile:function(t,e,i,r,s,n,a){return o.ForEachTile(t,e,i,r,s,n,a,this.layer),this},getTileAt:function(t,e,i){return o.GetTileAt(t,e,i,this.layer)},getTileAtWorldXY:function(t,e,i,r){return o.GetTileAtWorldXY(t,e,i,r,this.layer)},getIsoTileAtWorldXY:function(t,e,i,r,s){void 0===i&&(i=!0);var n=this.tempVec;return o.IsometricWorldToTileXY(t,e,!0,n,s,this.layer,i),this.getTileAt(n.x,n.y,r)},getTilesWithin:function(t,e,i,r,s){return o.GetTilesWithin(t,e,i,r,s,this.layer)},getTilesWithinShape:function(t,e,i){return o.GetTilesWithinShape(t,e,i,this.layer)},getTilesWithinWorldXY:function(t,e,i,r,s,n){return o.GetTilesWithinWorldXY(t,e,i,r,s,n,this.layer)},hasTileAt:function(t,e){return o.HasTileAt(t,e,this.layer)},hasTileAtWorldXY:function(t,e,i){return o.HasTileAtWorldXY(t,e,i,this.layer)},putTileAt:function(t,e,i,r){return o.PutTileAt(t,e,i,r,this.layer)},putTileAtWorldXY:function(t,e,i,r,s){return o.PutTileAtWorldXY(t,e,i,r,s,this.layer)},putTilesAt:function(t,e,i,r){return o.PutTilesAt(t,e,i,r,this.layer),this},randomize:function(t,e,i,r,s){return o.Randomize(t,e,i,r,s,this.layer),this},removeTileAt:function(t,e,i,r){return o.RemoveTileAt(t,e,i,r,this.layer)},removeTileAtWorldXY:function(t,e,i,r,s){return o.RemoveTileAtWorldXY(t,e,i,r,s,this.layer)},renderDebug:function(t,e){return o.RenderDebug(t,e,this.layer),this},replaceByIndex:function(t,e,i,r,s,n){return o.ReplaceByIndex(t,e,i,r,s,n,this.layer),this},setCollision:function(t,e,i,r){return o.SetCollision(t,e,i,this.layer,r),this},setCollisionBetween:function(t,e,i,r){return o.SetCollisionBetween(t,e,i,r,this.layer),this},setCollisionByProperty:function(t,e,i){return o.SetCollisionByProperty(t,e,i,this.layer),this},setCollisionByExclusion:function(t,e,i){return o.SetCollisionByExclusion(t,e,i,this.layer),this},setCollisionFromCollisionGroup:function(t,e){return o.SetCollisionFromCollisionGroup(t,e,this.layer),this},setTileIndexCallback:function(t,e,i){return o.SetTileIndexCallback(t,e,i,this.layer),this},setTileLocationCallback:function(t,e,i,r,s,n){return o.SetTileLocationCallback(t,e,i,r,s,n,this.layer),this},shuffle:function(t,e,i,r){return o.Shuffle(t,e,i,r,this.layer),this},swapByIndex:function(t,e,i,r,s,n){return o.SwapByIndex(t,e,i,r,s,n,this.layer),this},tileToWorldX:function(t,e){return this.tilemap.tileToWorldX(t,e,this)},tileToWorldY:function(t,e){return this.tilemap.tileToWorldY(t,e,this)},tileToWorldXY:function(t,e,i,r){return this.tilemap.tileToWorldXY(t,e,i,r,this)},getTileCorners:function(t,e,i){return this.tilemap.getTileCorners(t,e,i,this)},weightedRandomize:function(t,e,i,r,s){return o.WeightedRandomize(e,i,r,s,t,this.layer),this},worldToTileX:function(t,e,i){return this.tilemap.worldToTileX(t,e,i,this)},worldToTileY:function(t,e,i){return this.tilemap.worldToTileY(t,e,i,this)},worldToTileXY:function(t,e,i,r,s){return this.tilemap.worldToTileXY(t,e,i,r,s,this)},destroy:function(t){void 0===t&&(t=!0),this.tilemap&&(this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),t&&this.tilemap.removeLayer(this),this.tilemap=void 0,this.layer=void 0,this.gidMap=[],this.tileset=[],a.prototype.destroy.call(this))}});t.exports=l},16153(t,e,i){var r=i(61340),s=new r,n=new r,a=new r;t.exports=function(t,e,i,r){var o=e.cull(i),h=o.length,l=i.alpha*e.alpha;if(!(0===h||l<=0)){n.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var u=t.currentContext,d=e.gidMap;u.save(),s.copyWithScrollFactorFrom(i.matrixCombined,i.scrollX,i.scrollY,e.scrollFactorX,e.scrollFactorY),r&&s.multiply(r),s.multiply(n,a),a.setToContext(u),(!t.antialias||e.scaleX>1||e.scaleY>1)&&(u.imageSmoothingEnabled=!1);for(var c=0;c=this.firstgid&&t>>1]).startTime)<=e&&h+s.duration>e)return s.tileid+this.firstgid;hi.width||e.height>i.height?this.updateTileData(e.width,e.height):this.updateTileData(i.width,i.height,i.x,i.y),this},setTileSize:function(t,e){return void 0!==t&&(this.tileWidth=t),void 0!==e&&(this.tileHeight=e),this.image&&this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},setSpacing:function(t,e){return void 0!==t&&(this.tileMargin=t),void 0!==e&&(this.tileSpacing=e),this.image&&this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},updateTileData:function(t,e,i,r){void 0===i&&(i=0),void 0===r&&(r=0);var s=(e-2*this.tileMargin+this.tileSpacing)/(this.tileHeight+this.tileSpacing),n=(t-2*this.tileMargin+this.tileSpacing)/(this.tileWidth+this.tileSpacing);s%1==0&&n%1==0||console.warn("Image tile area not tile size multiple in: "+this.name),s=Math.floor(s),n=Math.floor(n),this.rows=s,this.columns=n,this.total=s*n,this.texCoordinates.length=0;for(var a=this.tileMargin+i,o=this.tileMargin+r,h=0;h8388608)throw new Error("Tileset._animationDataTexture: too many animations - total number of animations plus animation frames is max 8388608, got "+f);var p=2*f,g=Math.min(p,4096),m=Math.ceil(p/4096),v=new Uint32Array(g*m),y=0,x=r.length;for(o=0;os.worldView.x+n.scaleX*i.tileWidth*(-a-.5)&&h.xs.worldView.y+n.scaleY*i.tileHeight*(-o-1)&&h.y=0;n--)for(s=r.width-1;s>=0;s--)if((a=r.data[n][s])&&a.index===t){if(o===e)return a;o+=1}}else for(n=0;na.width&&(i=Math.max(a.width-t,0)),e+s>a.height&&(s=Math.max(a.height-e,0));for(var u=[],d=e;d-1}return!1}},24152(t,e,i){var r=i(45091),s=new(i(26099));t.exports=function(t,e,i,n){n.tilemapLayer.worldToTileXY(t,e,!0,s,i);var a=s.x,o=s.y;return r(a,o,n)}},90454(t,e,i){var r=i(63448),s=i(56583);t.exports=function(t,e){var i,n,a,o,h=t.tilemapLayer.tilemap,l=t.tilemapLayer,u=Math.floor(h.tileWidth*l.scaleX),d=Math.floor(h.tileHeight*l.scaleY),c=t.hexSideLength;if("y"===t.staggerAxis){var f=(d-c)/2+c;i=s(e.worldView.x-l.x,u,0,!0)-l.cullPaddingX,n=r(e.worldView.right-l.x,u,0,!0)+l.cullPaddingX,a=s(e.worldView.y-l.y,f,0,!0)-l.cullPaddingY,o=r(e.worldView.bottom-l.y,f,0,!0)+l.cullPaddingY}else{var p=(u-c)/2+c;i=s(e.worldView.x-l.x,p,0,!0)-l.cullPaddingX,n=r(e.worldView.right-l.x,p,0,!0)+l.cullPaddingX,a=s(e.worldView.y-l.y,d,0,!0)-l.cullPaddingY,o=r(e.worldView.bottom-l.y,d,0,!0)+l.cullPaddingY}return{left:i,right:n,top:a,bottom:o}}},9474(t,e,i){var r=i(90454),s=i(32483);t.exports=function(t,e,i,n){void 0===i&&(i=[]),void 0===n&&(n=0),i.length=0;var a=t.tilemapLayer,o=r(t,e);return a.skipCull&&1===a.scrollFactorX&&1===a.scrollFactorY&&(o.left=0,o.right=t.width,o.top=0,o.bottom=t.height),s(t,o,n,i),i}},27229(t,e,i){var r=i(19951),s=i(26099),n=new s;t.exports=function(t,e,i,a){var o=a.baseTileWidth,h=a.baseTileHeight,l=a.tilemapLayer;l&&(o*=l.scaleX,h*=l.scaleY);var u,d,c=r(t,e,n,i,a),f=[],p=.5773502691896257;"y"===a.staggerAxis?(u=p*o,d=h/2):(u=o/2,d=p*h);for(var g=0;g<6;g++){var m=2*Math.PI*(.5-g)/6;f.push(new s(c.x+u*Math.cos(m),c.y+d*Math.sin(m)))}return f}},19951(t,e,i){var r=i(26099);t.exports=function(t,e,i,s,n){i||(i=new r);var a=n.baseTileWidth,o=n.baseTileHeight,h=n.tilemapLayer,l=0,u=0;h&&(s||(s=h.scene.cameras.main),l=h.x+s.scrollX*(1-h.scrollFactorX),u=h.y+s.scrollY*(1-h.scrollFactorY),a*=h.scaleX,o*=h.scaleY);var d,c,f=a/2,p=o/2,g=n.staggerAxis,m=n.staggerIndex;return"y"===g?(d=l+a*t+a,c=u+1.5*e*p+p,e%2==0&&("odd"===m?d-=f:d+=f)):"x"===g&&"odd"===m&&(d=l+1.5*t*f+f,c=u+o*t+o,t%2==0&&("odd"===m?c-=p:c+=p)),i.set(d,c)}},86625(t,e,i){var r=i(26099);t.exports=function(t,e,i,s,n,a){s||(s=new r);var o=a.baseTileWidth,h=a.baseTileHeight,l=a.tilemapLayer;l&&(n||(n=l.scene.cameras.main),t-=l.x+n.scrollX*(1-l.scrollFactorX),e-=l.y+n.scrollY*(1-l.scrollFactorY),o*=l.scaleX,h*=l.scaleY);var u,d,c,f,p,g=.5773502691896257,m=-.3333333333333333,v=.6666666666666666,y=o/2,x=h/2;"y"===a.staggerAxis?(c=g*(u=(t-y)/(g*o))+m*(d=(e-x)/x),f=0*u+v*d):(c=m*(u=(t-y)/y)+g*(d=(e-x)/(g*h)),f=v*u+0*d),p=-c-f;var T,w=Math.round(c),b=Math.round(f),S=Math.round(p),C=Math.abs(w-c),E=Math.abs(b-f),A=Math.abs(S-p);C>E&&C>A?w=-b-S:E>A&&(b=-w-S);var _=b;return T="odd"===a.staggerIndex?_%2==0?b/2+w:b/2+w-.5:_%2==0?b/2+w:b/2+w+.5,s.set(T,_)}},62991(t){t.exports=function(t,e,i){return t>=0&&t=0&&e=0;n--)(o=l[a][n])&&-1!==o.index&&o.visible&&0!==o.alpha&&(c||r(n,a,t,e))&&i.push(o);else if(2===s)for(a=p;a>=0;a--)for(n=0;n=0;a--)for(n=f;n>=0;n--)(o=l[a][n])&&-1!==o.index&&o.visible&&0!==o.alpha&&(c||r(n,a,t,e))&&i.push(o);return h.tilesDrawn=i.length,h.tilesTotal=u*d,i}},14127(t,e,i){var r=i(26099);t.exports=function(t,e,i,s,n){i||(i=new r);var a=n.baseTileWidth,o=n.baseTileHeight,h=n.tilemapLayer,l=0,u=0;h&&(s||(s=h.scene.cameras.main),l=h.x+s.scrollX*(1-h.scrollFactorX),a*=h.scaleX,u=h.y+s.scrollY*(1-h.scrollFactorY),o*=h.scaleY);var d=l+a/2*(t-e),c=u+(t+e)*(o/2);return i.set(d,c)}},96897(t,e,i){var r=i(26099);t.exports=function(t,e,i,s,n,a,o){s||(s=new r);var h=a.baseTileWidth,l=a.baseTileHeight,u=a.tilemapLayer;u&&(n||(n=u.scene.cameras.main),e-=u.y+n.scrollY*(1-u.scrollFactorY),l*=u.scaleY,t-=u.x+n.scrollX*(1-u.scrollFactorX),h*=u.scaleX);var d=h/2,c=l/2;o||(e-=l);var f=.5*((t-=d)/d+e/c),p=.5*(-t/d+e/c);return i&&(f=Math.floor(f),p=Math.floor(p)),s.set(f,p)}},71558(t,e,i){var r=i(23029),s=i(62991),n=i(72023),a=i(20576);t.exports=function(t,e,i,o,h){if(void 0===o&&(o=!0),!s(e,i,h))return null;var l,u=h.data[i][e],d=u&&u.collides;t instanceof r?(null===h.data[i][e]&&(h.data[i][e]=new r(h,t.index,e,i,h.tileWidth,h.tileHeight)),h.data[i][e].copy(t)):(l=t,null===h.data[i][e]?h.data[i][e]=new r(h,l,e,i,h.tileWidth,h.tileHeight):h.data[i][e].index=l);var c=h.data[i][e],f=-1!==h.collideIndexes.indexOf(c.index);if(-1===(l=t instanceof r?t.index:t))c.width=h.tileWidth,c.height=h.tileHeight;else{var p=h.tilemapLayer.tilemap,g=p.tiles[l][2],m=p.tilesets[g];c.width=m.tileWidth,c.height=m.tileHeight}return a(c,f),o&&d!==c.collides&&n(e,i,h),c}},26303(t,e,i){var r=i(71558),s=new(i(26099));t.exports=function(t,e,i,n,a,o){return o.tilemapLayer.worldToTileXY(e,i,!0,s,a,o),r(t,s.x,s.y,n,o)}},14051(t,e,i){var r=i(42573),s=i(71558);t.exports=function(t,e,i,n,a){if(void 0===n&&(n=!0),!Array.isArray(t))return null;Array.isArray(t[0])||(t=[t]);for(var o=t.length,h=t[0].length,l=0;l=d;s--)(a=o[n][s])&&-1!==a.index&&a.visible&&0!==a.alpha&&r.push(a);else if(2===i)for(n=p;n>=f;n--)for(s=d;o[n]&&s=f;n--)for(s=c;o[n]&&s>=d;s--)(a=o[n][s])&&-1!==a.index&&a.visible&&0!==a.alpha&&r.push(a);return u.tilesDrawn=r.length,u.tilesTotal=h*l,r}},57068(t,e,i){var r=i(20576),s=i(42573),n=i(9589);t.exports=function(t,e,i,a,o){void 0===e&&(e=!0),void 0===i&&(i=!0),void 0===o&&(o=!0),Array.isArray(t)||(t=[t]);for(var h=0;he)){for(var l=t;l<=e;l++)n(l,i,o);if(h)for(var u=0;u=t&&c.index<=e&&r(c,i)}a&&s(0,0,o.width,o.height,o)}}},75661(t,e,i){var r=i(20576),s=i(42573),n=i(9589);t.exports=function(t,e,i,a){void 0===e&&(e=!0),void 0===i&&(i=!0),Array.isArray(t)||(t=[t]);for(var o=0;o0&&r(o,t)}}e&&s(0,0,i.width,i.height,i)}},9589(t){t.exports=function(t,e,i){var r=i.collideIndexes.indexOf(t);e&&-1===r?i.collideIndexes.push(t):e||-1===r||i.collideIndexes.splice(r,1)}},20576(t){t.exports=function(t,e){e?t.setCollision(!0,!0,!0,!0,!1):t.resetCollision(!1)}},79583(t){t.exports=function(t,e,i,r){if("number"==typeof t)r.callbacks[t]=null!==e?{callback:e,callbackContext:i}:void 0;else for(var s=0,n=t.length;s-1?new s(o,f,d,u,a.tilesize,a.tilesize):e?null:new s(o,-1,d,u,a.tilesize,a.tilesize),h.push(c)}l.push(h),h=[]}o.data=l,i.push(o)}return i}},96483(t,e,i){var r=i(33629);t.exports=function(t){for(var e=[],i=[],s=0;so&&(o=e.layer[l].width),e.layer[l].height>h&&(h=e.layer[l].height);var u=new s({width:o,height:h,name:t,tileWidth:e.layer[0].tilesize,tileHeight:e.layer[0].tilesize,format:r.WELTMEISTER});return u.layers=n(e,i),u.tilesets=a(e),u}},52833(t,e,i){t.exports={ParseTileLayers:i(6656),ParseTilesets:i(96483),ParseWeltmeister:i(87021)}},57442(t,e,i){t.exports={FromOrientationString:i(6641),Parse:i(46177),Parse2DArray:i(2342),ParseCSV:i(82593),Impact:i(52833),Tiled:i(96761)}},51233(t,e,i){var r=i(79291);t.exports=function(t){for(var e,i,s,n,a,o=0;o>>0;return r}},84101(t,e,i){var r=i(33629);t.exports=function(t){var e,i,s=[];for(e=0;e0;)if(n.i>=n.layers.length){if(i.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}n=i.pop()}else{var a=n.layers[n.i];if(n.i++,"imagelayer"===a.type){var o=r(a,"offsetx",0)+r(a,"startx",0),h=r(a,"offsety",0)+r(a,"starty",0);e.push({name:n.name+a.name,image:a.image,x:n.x+o+a.x,y:n.y+h+a.y,alpha:n.opacity*a.opacity,visible:n.visible&&a.visible,properties:r(a,"properties",{})})}else if("group"===a.type){var l=s(t,a,n);i.push(n),n=l}}return e}},46594(t,e,i){var r=i(51233),s=i(84101),n=i(91907),a=i(62644),o=i(80341),h=i(6641),l=i(87010),u=i(12635),d=i(22611),c=i(28200),f=i(24619);t.exports=function(t,e,i){var p=a(e),g=new l({width:p.width,height:p.height,name:t,tileWidth:p.tilewidth,tileHeight:p.tileheight,orientation:h(p.orientation),format:o.TILED_JSON,version:p.version,properties:p.properties,renderOrder:p.renderorder,infinite:p.infinite});if(g.orientation===n.HEXAGONAL)if(g.hexSideLength=p.hexsidelength,g.staggerAxis=p.staggeraxis,g.staggerIndex=p.staggerindex,"y"===g.staggerAxis){var m=(g.tileHeight-g.hexSideLength)/2;g.widthInPixels=g.tileWidth*(g.width+.5),g.heightInPixels=g.height*(g.hexSideLength+m)+m}else{var v=(g.tileWidth-g.hexSideLength)/2;g.widthInPixels=g.width*(g.hexSideLength+v)+v,g.heightInPixels=g.tileHeight*(g.height+.5)}g.layers=c(p,i),g.images=u(p);var y=f(p);return g.tilesets=y.tilesets,g.imageCollections=y.imageCollections,g.objects=d(p),g.tiles=s(g),r(g),g}},52205(t,e,i){var r=i(18254),s=i(29920),n=function(t){return{x:t.x,y:t.y}},a=["id","name","type","rotation","properties","visible","x","y","width","height"];t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=0);var o=r(t,a);if(o.x+=e,o.y+=i,t.gid){var h=s(t.gid);o.gid=h.gid,o.flippedHorizontal=h.flippedHorizontal,o.flippedVertical=h.flippedVertical,o.flippedAntiDiagonal=h.flippedAntiDiagonal}else t.polyline?o.polyline=t.polyline.map(n):t.polygon?o.polygon=t.polygon.map(n):t.ellipse?o.ellipse=t.ellipse:t.text?o.text=t.text:t.point?o.point=!0:o.rectangle=!0;return o}},22611(t,e,i){var r=i(95540),s=i(52205),n=i(48700),a=i(79677);t.exports=function(t){for(var e=[],i=[],o=a(t);o.i0;)if(o.i>=o.layers.length){if(i.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}o=i.pop()}else{var h=o.layers[o.i];if(o.i++,h.opacity*=o.opacity,h.visible=o.visible&&h.visible,"objectgroup"===h.type){h.name=o.name+h.name;for(var l=o.x+r(h,"startx",0)+r(h,"offsetx",0),u=o.y+r(h,"starty",0)+r(h,"offsety",0),d=[],c=0;c0;)if(f.i>=f.layers.length){if(c.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}f=c.pop()}else{var p=f.layers[f.i];if(f.i++,"tilelayer"===p.type)if(p.compression)console.warn("TilemapParser.parseTiledJSON - Layer compression is unsupported, skipping layer '"+p.name+"'");else{if(p.encoding&&"base64"===p.encoding){if(p.chunks)for(var g=0;g0?((y=new u(m,v.gid,F,I,t.tilewidth,t.tileheight)).rotation=v.rotation,y.flipX=v.flipped,b[I][F]=y):(x=e?null:new u(m,-1,F,I,t.tilewidth,t.tileheight),b[I][F]=x),++S===M.width&&(O++,S=0)}}else{(m=new h({name:f.name+p.name,id:p.id,x:f.x+o(p,"offsetx",0)+p.x,y:f.y+o(p,"offsety",0)+p.y,width:p.width,height:p.height,tileWidth:t.tilewidth,tileHeight:t.tileheight,alpha:f.opacity*p.opacity,visible:f.visible&&p.visible,properties:o(p,"properties",[]),orientation:a(t.orientation)})).orientation===s.HEXAGONAL&&(m.hexSideLength=t.hexsidelength,m.staggerAxis=t.staggeraxis,m.staggerIndex=t.staggerindex,"y"===m.staggerAxis?(T=(m.tileHeight-m.hexSideLength)/2,m.widthInPixels=m.tileWidth*(m.width+.5),m.heightInPixels=m.height*(m.hexSideLength+T)+T):(w=(m.tileWidth-m.hexSideLength)/2,m.widthInPixels=m.width*(m.hexSideLength+w)+w,m.heightInPixels=m.tileHeight*(m.height+.5)));for(var N=[],B=0,k=p.data.length;B0?((y=new u(m,v.gid,S,b.length,t.tilewidth,t.tileheight)).rotation=v.rotation,y.flipX=v.flipped,N.push(y)):(x=e?null:new u(m,-1,S,b.length,t.tilewidth,t.tileheight),N.push(x)),++S===p.width&&(b.push(N),S=0,N=[])}m.data=b,d.push(m)}else if("group"===p.type){var U=n(t,p,f);c.push(f),f=U}}return d}},24619(t,e,i){var r=i(33629),s=i(16536),n=i(52205),a=i(57880);t.exports=function(t){for(var e,i=[],o=[],h=null,l=0;l1){var c=void 0,f=void 0;if(Array.isArray(u.tiles)){c=c||{},f=f||{};for(var p=0;p0){var n,a,o,h={},l={};if(Array.isArray(r.edgecolors))for(n=0;n0)throw new Error("TimerEvent infinite loop created via zero delay")}else e=new a(t);return this._pendingInsertion.push(e),e},delayedCall:function(t,e,i,r){return this.addEvent({delay:t,callback:e,args:i,callbackScope:r})},clearPendingEvents:function(){return this._pendingInsertion=[],this},removeEvent:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e-1&&this._active.splice(s,1),r.destroy()}for(i=0;i=r.delay)){var s=r.elapsed-r.delay;if(r.elapsed=r.delay,!r.hasDispatched&&r.callback&&(r.hasDispatched=!0,r.callback.apply(r.callbackScope,r.args)),r.repeatCount>0){if(r.repeatCount--,s>=r.delay)for(;s>=r.delay&&r.repeatCount>0;)r.callback&&r.callback.apply(r.callbackScope,r.args),s-=r.delay,r.repeatCount--;r.elapsed=s,r.hasDispatched=!1}else r.hasDispatched&&this._pendingRemoval.push(r)}}}},shutdown:function(){var t;for(t=0;t0||this.totalComplete>0)&&(0!==this.loop&&(-1===this.loop||this.loop>this.iteration)?(this.iteration++,this.reset(!0)):this.complete=!0),this.complete&&this.emit(h.COMPLETE,this)}},play:function(t){return void 0===t&&(t=!0),this.paused=!1,this.complete=!1,this.totalComplete=0,t&&this.reset(),this},pause:function(){this.paused=!0;for(var t=this.events,e=0;e0&&(i=e[e.length-1].time);for(var r=0;r0)throw new Error("TimerEvent infinite loop created via zero delay");return this},getProgress:function(){return this.elapsed/this.delay},getOverallProgress:function(){if(this.repeat>0){var t=this.delay+this.delay*this.repeat;return(this.elapsed+this.delay*(this.repeat-this.repeatCount))/t}return this.getProgress()},getRepeatCount:function(){return this.repeatCount},getElapsed:function(){return this.elapsed},getElapsedSeconds:function(){return.001*this.elapsed},getRemaining:function(){return this.delay-this.elapsed},getRemainingSeconds:function(){return.001*this.getRemaining()},getOverallRemaining:function(){return this.delay*(1+this.repeatCount)-this.elapsed},getOverallRemainingSeconds:function(){return.001*this.getOverallRemaining()},remove:function(t){void 0===t&&(t=!1),this.elapsed=this.delay,this.hasDispatched=!t,this.repeatCount=0},destroy:function(){this.callback=void 0,this.callbackScope=void 0,this.args=[]}});t.exports=n},35945(t){t.exports="complete"},89809(t,e,i){t.exports={COMPLETE:i(35945)}},90291(t,e,i){t.exports={Clock:i(33385),Events:i(89809),Timeline:i(96120),TimerEvent:i(94880)}},40382(t,e,i){var r=i(72905),s=i(83419),n=i(43491),a=i(88032),o=i(37277),h=i(44594),l=i(93109),u=i(8462),d=i(8357),c=i(43960),f=i(26012),p=new s({initialize:function(t){this.scene=t,this.events=t.sys.events,this.timeScale=1,this.paused=!1,this.processing=!1,this.tweens=[],this.time=0,this.startTime=0,this.nextTime=0,this.prevTime=0,this.maxLag=500,this.lagSkip=33,this.gap=1e3/240,this.events.once(h.BOOT,this.boot,this),this.events.on(h.START,this.start,this)},boot:function(){this.events.once(h.DESTROY,this.destroy,this)},start:function(){this.timeScale=1,this.paused=!1,this.startTime=Date.now(),this.prevTime=this.startTime,this.nextTime=this.gap,this.events.on(h.UPDATE,this.update,this),this.events.once(h.SHUTDOWN,this.shutdown,this)},create:function(t){Array.isArray(t)||(t=[t]);for(var e=[],i=0;i-1},existing:function(t){return this.has(t)||this.tweens.push(t.reset()),this},addCounter:function(t){var e=a(this,t);return this.tweens.push(e.reset()),e},stagger:function(t,e){return l(t,e)},setLagSmooth:function(t,e){return void 0===t&&(t=1/1e-8),void 0===e&&(e=0),this.maxLag=t,this.lagSkip=Math.min(e,this.maxLag),this},setFps:function(t){return void 0===t&&(t=240),this.gap=1e3/t,this.nextTime=1e3*this.time+this.gap,this},getDelta:function(t){var e=Date.now()-this.prevTime;e>this.maxLag&&(this.startTime+=e-this.lagSkip),this.prevTime+=e;var i=this.prevTime-this.startTime,r=i-this.nextTime,s=i-1e3*this.time;return r>0||t?(i/=1e3,this.time=i,this.nextTime+=r+(r>=this.gap?4:this.gap-r)):s=0,s},tick:function(){return this.step(!0),this},update:function(){this.paused||this.step(!1)},step:function(t){void 0===t&&(t=!1);var e=this.getDelta(t);if(!(e<=0)){var i,r;this.processing=!0;var s=[],n=this.tweens;for(i=0;i0){for(i=0;i-1&&(r.isPendingRemove()||r.isDestroyed())&&(n.splice(o,1),r.destroy())}s.length=0}this.processing=!1}},remove:function(t){return this.processing?t.setPendingRemoveState():(r(this.tweens,t),t.setRemovedState()),this},reset:function(t){return this.existing(t),t.seek(),t.setActiveState(),this},makeActive:function(t){return this.existing(t),t.setActiveState(),this},each:function(t,e){var i,r=[null];for(i=1;iE&&(E=M),C[A][_]=M}}}var R=o?r(o):null;return i=h?function(t,e,i,r){var s,n=0,o=r%y,h=Math.floor(r/y);if(o>=0&&o=0&&ht&&(this.loopCounter=t),this},remove:function(){return this.parent&&this.parent.remove(this),this},stop:function(){return!this.parent||this.isRemoved()||this.isPendingRemove()||this.isDestroyed()||(this.dispatchEvent(n.TWEEN_STOP,"onStop"),this.setPendingRemoveState()),this},updateLoopCountdown:function(t){this.countdown-=t,this.countdown<=0&&(this.setActiveState(),this.dispatchEvent(n.TWEEN_LOOP,"onLoop"))},updateStartCountdown:function(t){return this.countdown-=t,this.countdown<=0&&(this.hasStarted=!0,this.setActiveState(),this.dispatchEvent(n.TWEEN_START,"onStart"),t=0),t},updateCompleteDelay:function(t){this.countdown-=t,this.countdown<=0&&this.onCompleteHandler()},setCallback:function(t,e,i){return void 0===i&&(i=[]),this.callbacks.hasOwnProperty(t)&&(this.callbacks[t]={func:e,params:i}),this},setPendingState:function(){this.state=a.PENDING},setActiveState:function(){this.state=a.ACTIVE,this.hasStarted=!1},setLoopDelayState:function(){this.state=a.LOOP_DELAY},setCompleteDelayState:function(){this.state=a.COMPLETE_DELAY},setStartDelayState:function(){this.state=a.START_DELAY,this.countdown=this.startDelay,this.hasStarted=!1},setPendingRemoveState:function(){this.state=a.PENDING_REMOVE},setRemovedState:function(){this.state=a.REMOVED},setFinishedState:function(){this.state=a.FINISHED},setDestroyedState:function(){this.state=a.DESTROYED},isPending:function(){return this.state===a.PENDING},isActive:function(){return this.state===a.ACTIVE},isLoopDelayed:function(){return this.state===a.LOOP_DELAY},isCompleteDelayed:function(){return this.state===a.COMPLETE_DELAY},isStartDelayed:function(){return this.state===a.START_DELAY},isPendingRemove:function(){return this.state===a.PENDING_REMOVE},isRemoved:function(){return this.state===a.REMOVED},isFinished:function(){return this.state===a.FINISHED},isDestroyed:function(){return this.state===a.DESTROYED},destroy:function(){this.data&&this.data.forEach(function(t){t.destroy()}),this.removeAllListeners(),this.callbacks=null,this.data=null,this.parent=null,this.setDestroyedState()}});o.TYPES=["onActive","onComplete","onLoop","onPause","onRepeat","onResume","onStart","onStop","onUpdate","onYoyo"],t.exports=o},95042(t,e,i){var r=i(83419),s=i(842),n=i(86353),a=new r({initialize:function(t,e,i,r,s,n,a,o,h,l){this.tween=t,this.targetIndex=e,this.duration=r<=0?.01:r,this.totalDuration=0,this.delay=0,this.getDelay=i,this.yoyo=s,this.hold=n,this.repeat=a,this.repeatDelay=o,this.repeatCounter=0,this.flipX=h,this.flipY=l,this.progress=0,this.elapsed=0,this.state=0,this.isCountdown=!1},getTarget:function(){return this.tween.targets[this.targetIndex]},setTargetValue:function(t){void 0===t&&(t=this.current),this.tween.targets[this.targetIndex][this.key]=t},setCreatedState:function(){this.state=n.CREATED,this.isCountdown=!1},setDelayState:function(){this.state=n.DELAY,this.isCountdown=!0},setPendingRenderState:function(){this.state=n.PENDING_RENDER,this.isCountdown=!1},setPlayingForwardState:function(){this.state=n.PLAYING_FORWARD,this.isCountdown=!1},setPlayingBackwardState:function(){this.state=n.PLAYING_BACKWARD,this.isCountdown=!1},setHoldState:function(){this.state=n.HOLD_DELAY,this.isCountdown=!0},setRepeatState:function(){this.state=n.REPEAT_DELAY,this.isCountdown=!0},setCompleteState:function(){this.state=n.COMPLETE,this.isCountdown=!1},isCreated:function(){return this.state===n.CREATED},isDelayed:function(){return this.state===n.DELAY},isPendingRender:function(){return this.state===n.PENDING_RENDER},isPlayingForward:function(){return this.state===n.PLAYING_FORWARD},isPlayingBackward:function(){return this.state===n.PLAYING_BACKWARD},isHolding:function(){return this.state===n.HOLD_DELAY},isRepeating:function(){return this.state===n.REPEAT_DELAY},isComplete:function(){return this.state===n.COMPLETE},setStateFromEnd:function(t){this.yoyo?this.onRepeat(t,!0,!0):this.repeatCounter>0?this.onRepeat(t,!0,!1):this.setCompleteState()},setStateFromStart:function(t){this.repeatCounter>0?this.onRepeat(t,!1):this.setCompleteState()},reset:function(){var t=this.tween,e=t.totalTargets,i=this.targetIndex,r=t.targets[i],s=this.key;this.progress=0,this.elapsed=0,this.delay=this.getDelay(r,s,0,i,e,t),this.repeatCounter=-1===this.repeat?n.MAX:this.repeat,this.setPendingRenderState();var a=this.duration+this.hold;this.yoyo&&(a+=this.duration);var o=a+this.repeatDelay;this.totalDuration=this.delay+a,-1===this.repeat?(this.totalDuration+=o*n.MAX,t.isInfinite=!0):this.repeat>0&&(this.totalDuration+=o*this.repeat),this.totalDuration>t.duration&&(t.duration=this.totalDuration),this.delay0&&(this.elapsed=this.delay,this.setDelayState())},onRepeat:function(t,e,i){var r=this.tween,n=r.totalTargets,a=this.targetIndex,o=r.targets[a],h=this.key,l="texture"!==h;if(this.elapsed=t,this.progress=t/this.duration,this.flipX&&o.toggleFlipX(),this.flipY&&o.toggleFlipY(),l&&(e||i)&&(this.start=this.getStartValue(o,h,this.start,a,n,r)),i)return this.setPlayingBackwardState(),void this.dispatchEvent(s.TWEEN_YOYO,"onYoyo");this.repeatCounter--,l&&(this.end=this.getEndValue(o,h,this.start,a,n,r)),this.repeatDelay>0?(this.elapsed=this.repeatDelay-t,l&&(this.current=this.start,o[h]=this.current),this.setRepeatState()):(this.setPlayingForwardState(),this.dispatchEvent(s.TWEEN_REPEAT,"onRepeat"))},destroy:function(){this.tween=null,this.getDelay=null,this.setCompleteState()}});t.exports=a},69902(t){t.exports={targets:null,delay:0,duration:1e3,ease:"Power0",easeParams:null,hold:0,repeat:0,repeatDelay:0,yoyo:!1,flipX:!1,flipY:!1,persist:!1,interpolation:null}},81076(t){t.exports=["callbackScope","completeDelay","delay","duration","ease","easeParams","flipX","flipY","hold","interpolation","loop","loopDelay","onActive","onActiveParams","onComplete","onCompleteParams","onLoop","onLoopParams","onPause","onPauseParams","onRepeat","onRepeatParams","onResume","onResumeParams","onStart","onStartParams","onStop","onStopParams","onUpdate","onUpdateParams","onYoyo","onYoyoParams","paused","persist","props","repeat","repeatDelay","targets","yoyo"]},8462(t,e,i){var r=i(70402),s=i(83419),n=i(842),a=i(44603),o=i(39429),h=i(36383),l=i(86353),u=i(48177),d=i(42220),c=new s({Extends:r,initialize:function(t,e){r.call(this,t),this.targets=e,this.totalTargets=e.length,this.isSeeking=!1,this.isInfinite=!1,this.elapsed=0,this.totalElapsed=0,this.duration=0,this.progress=0,this.totalDuration=0,this.totalProgress=0,this.isNumberTween=!1},add:function(t,e,i,r,s,n,a,o,h,l,d,c,f,p,g,m){var v=new u(this,t,e,i,r,s,n,a,o,h,l,d,c,f,p,g,m);return this.totalData=this.data.push(v),v},addFrame:function(t,e,i,r,s,n,a,o,h,l){var u=new d(this,t,e,i,r,s,n,a,o,h,l);return this.totalData=this.data.push(u),u},getValue:function(t){void 0===t&&(t=0);var e=null;return this.data&&(e=this.data[t].current),e},hasTarget:function(t){return this.targets&&-1!==this.targets.indexOf(t)},updateTo:function(t,e,i){if(void 0===i&&(i=!1),"texture"!==t)for(var r=0;r0)this.elapsed=0,this.progress=0,this.loopCounter--,this.initTweenData(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.setLoopDelayState()):(this.setActiveState(),this.dispatchEvent(n.TWEEN_LOOP,"onLoop"));else{if(!(this.completeDelay>0))return this.onCompleteHandler(),!0;this.countdown=this.completeDelay,this.setCompleteDelayState()}return!1},onCompleteHandler:function(){this.progress=1,this.totalProgress=1,r.prototype.onCompleteHandler.call(this)},play:function(){return this.isDestroyed()?(console.warn("Cannot play destroyed Tween",this),this):((this.isPendingRemove()||this.isFinished())&&this.seek(),this.paused=!1,this.setActiveState(),this)},seek:function(t,e,i){if(void 0===t&&(t=0),void 0===e&&(e=16.6),void 0===i&&(i=!1),this.isDestroyed())return console.warn("Cannot seek destroyed Tween",this),this;i||(this.isSeeking=!0),this.reset(!0),this.initTweenData(!0),this.setActiveState(),this.dispatchEvent(n.TWEEN_ACTIVE,"onActive");var r=this.paused;if(this.paused=!1,t>0){for(var s=Math.floor(t/e),a=t-s*e,o=0;o0&&this.update(a)}return this.paused=r,this.isSeeking=!1,this},initTweenData:function(t){void 0===t&&(t=!1),this.duration=0,this.startDelay=h.MAX_SAFE_INTEGER;for(var e=this.data,i=0;i0?r+s+(r+a)*n:r+s},reset:function(t){return void 0===t&&(t=!1),this.elapsed=0,this.totalElapsed=0,this.progress=0,this.totalProgress=0,this.loopCounter=this.loop,-1===this.loop&&(this.isInfinite=!0,this.loopCounter=l.MAX),t||(this.initTweenData(),this.setActiveState(),this.dispatchEvent(n.TWEEN_ACTIVE,"onActive")),this},update:function(t){if(this.isPendingRemove()||this.isDestroyed())return!this.persist||(this.setFinishedState(),!1);if(this.paused||this.isFinished())return!1;if(t*=this.timeScale*this.parent.timeScale,this.isLoopDelayed())return this.updateLoopCountdown(t),!1;if(this.isCompleteDelayed())return this.updateCompleteDelay(t),!1;this.hasStarted||(this.startDelay-=t,this.startDelay<=0&&(this.hasStarted=!0,this.dispatchEvent(n.TWEEN_START,"onStart"),t=0));var e=!1;if(this.isActive())for(var i=this.data,r=0;r0&&!this.isStartDelayed()?this.setStartDelayState():this.setActiveState(),this},add:function(t){var e=this.parent.create(t);Array.isArray(e)||(e=[e]);for(var i=this.data,r=0;r0)this.loopCounter--,this.resetTweens(),this.loopDelay>0?(this.countdown=this.loopDelay,this.setLoopDelayState()):(this.setActiveState(),this.dispatchEvent(a.TWEEN_LOOP,"onLoop"));else{if(!(this.completeDelay>0))return this.onCompleteHandler(),!0;this.countdown=this.completeDelay,this.setCompleteDelayState()}return!1},play:function(){return this.isDestroyed()?(console.warn("Cannot play destroyed TweenChain",this),this):((this.isPendingRemove()||this.isPending())&&this.resetTweens(),this.paused=!1,this.startDelay>0&&!this.isStartDelayed()?this.setStartDelayState():this.setActiveState(),this)},resetTweens:function(){for(var t=this.data,e=this.totalData,i=0;i=d?(c=u-d,u=d,f=!0):u<0&&(u=0);var p=s(u/d,0,1);this.elapsed=u,this.progress=p,this.previous=this.current,h||(p=1-p);var g=this.ease(p);this.interpolation?this.current=this.interpolation(this.interpolationData,g):this.current=this.start+(this.end-this.start)*g,n[o]=this.current,f&&(h?(e.isNumberTween&&(this.current=this.end,n[o]=this.current),this.hold>0?(this.elapsed=this.hold,this.setHoldState()):this.setStateFromEnd(c)):(e.isNumberTween&&(this.current=this.start,n[o]=this.current),this.setStateFromStart(c))),this.dispatchEvent(a.TWEEN_UPDATE,"onUpdate")}return!this.isComplete()},dispatchEvent:function(t,e){var i=this.tween;if(!i.isSeeking){var r=i.targets[this.targetIndex],s=this.key,n=this.current,a=this.previous;i.emit(t,i,s,r,n,a);var o=i.callbacks[e];o&&o.func.apply(i.callbackScope,[i,r,s,n,a].concat(o.params))}},destroy:function(){r.prototype.destroy.call(this),this.getActiveValue=null,this.getEndValue=null,this.getStartValue=null,this.ease=null}});t.exports=o},42220(t,e,i){var r=i(95042),s=i(45319),n=i(83419),a=i(842),o=new n({Extends:r,initialize:function(t,e,i,s,n,a,o,h,l,u,d){r.call(this,t,e,n,a,!1,o,h,l,u,d),this.key="texture",this.startTexture=null,this.endTexture=i,this.startFrame=null,this.endFrame=s,this.yoyo=0!==h},reset:function(t){r.prototype.reset.call(this);var e=this.tween.targets[this.targetIndex];this.startTexture||(this.startTexture=e.texture.key,this.startFrame=e.frame.name),t&&e.setTexture(this.startTexture,this.startFrame)},update:function(t){var e=this.tween,i=this.targetIndex,r=e.targets[i];if(!r)return this.setCompleteState(),!1;if(this.isCountdown&&(this.elapsed-=t,this.elapsed<=0&&(this.elapsed=0,t=0,this.isDelayed()?this.setPendingRenderState():this.isRepeating()?(this.setPlayingForwardState(),this.dispatchEvent(a.TWEEN_REPEAT,"onRepeat")):this.isHolding()&&this.setStateFromEnd(0))),this.isPendingRender())return this.startTexture&&r.setTexture(this.startTexture,this.startFrame),this.setPlayingForwardState(),!0;var n=this.isPlayingForward(),o=this.isPlayingBackward();if(n||o){var h=this.elapsed,l=this.duration,u=0,d=!1;(h+=t)>=l?(u=h-l,h=l,d=!0):h<0&&(h=0);var c=s(h/l,0,1);this.elapsed=h,this.progress=c,d&&(n?(r.setTexture(this.endTexture,this.endFrame),this.hold>0?(this.elapsed=this.hold,this.setHoldState()):this.setStateFromEnd(u)):(r.setTexture(this.startTexture,this.startFrame),this.setStateFromStart(u))),this.dispatchEvent(a.TWEEN_UPDATE,"onUpdate")}return!this.isComplete()},dispatchEvent:function(t,e){var i=this.tween;if(!i.isSeeking){var r=i.targets[this.targetIndex],s=this.key;i.emit(t,i,s,r);var n=i.callbacks[e];n&&n.func.apply(i.callbackScope,[i,r,s].concat(n.params))}},destroy:function(){r.prototype.destroy.call(this),this.startTexture=null,this.endTexture=null,this.startFrame=null,this.endFrame=null}});t.exports=o},86353(t){t.exports={CREATED:0,DELAY:2,PENDING_RENDER:4,PLAYING_FORWARD:5,PLAYING_BACKWARD:6,HOLD_DELAY:7,REPEAT_DELAY:8,COMPLETE:9,PENDING:20,ACTIVE:21,LOOP_DELAY:22,COMPLETE_DELAY:23,START_DELAY:24,PENDING_REMOVE:25,REMOVED:26,FINISHED:27,DESTROYED:28,MAX:999999999999}},83419(t){function e(t,e,i){var r=i?t[e]:Object.getOwnPropertyDescriptor(t,e);return!i&&r.value&&"object"==typeof r.value&&(r=r.value),!(!r||!function(t){return!!t.get&&"function"==typeof t.get||!!t.set&&"function"==typeof t.set}(r))&&(void 0===r.enumerable&&(r.enumerable=!0),void 0===r.configurable&&(r.configurable=!0),r)}function i(t,e){var i=Object.getOwnPropertyDescriptor(t,e);return!!i&&(i.value&&"object"==typeof i.value&&(i=i.value),!1===i.configurable)}function r(t,r,s,a){for(var o in r)if(r.hasOwnProperty(o)){var h=e(r,o,s);if(!1!==h){if(i((a||t).prototype,o)){if(n.ignoreFinals)continue;throw new Error("cannot override final property '"+o+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,o,h)}else t.prototype[o]=r[o]}}function s(t,e){if(e){Array.isArray(e)||(e=[e]);for(var i=0;i0){var n=i-t.length;if(n<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.push(e),r&&r.call(s,e),e):null;for(var a=e.length-1;a>=0;)-1!==t.indexOf(e[a])&&e.splice(a,1),a--;if(0===(a=e.length))return null;i>0&&a>n&&(e.splice(n),a=n);for(var o=0;o0){var a=r-t.length;if(a<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.splice(i,0,e),s&&s.call(n,e),e):null;for(var o=e.length-1;o>=0;)-1!==t.indexOf(e[o])&&e.pop(),o--;if(0===(o=e.length))return null;r>0&&o>a&&(e.splice(a),o=a);for(var h=o-1;h>=0;h--){var l=e[h];t.splice(i,0,l),s&&s.call(n,l)}return e}},66905(t){t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&ie.length&&(n=e.length),i?(r=e[n-1][i],(s=e[n][i])-t<=t-r?e[n]:e[n-1]):(r=e[n-1],(s=e[n])-t<=t-r?s:r)}},43491(t){var e=function(t,i){void 0===i&&(i=[]);for(var r=0;r=0;a--)if(o=t[a],!e||e&&void 0===i&&o.hasOwnProperty(e)||e&&void 0!==i&&o[e]===i)return o;return null}},26546(t){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var r=e+Math.floor(Math.random()*(i-e));return void 0===t[r]?null:t[r]}},85835(t){t.exports=function(t,e,i){if(e===i)return t;var r=t.indexOf(e),s=t.indexOf(i);if(r<0||s<0)throw new Error("Supplied items must be elements of the same array");return r>s||(t.splice(r,1),s=t.indexOf(i),t.splice(s+1,0,e)),t}},83371(t){t.exports=function(t,e,i){if(e===i)return t;var r=t.indexOf(e),s=t.indexOf(i);if(r<0||s<0)throw new Error("Supplied items must be elements of the same array");return r0){var r=t[i-1],s=t.indexOf(r);t[i]=r,t[s]=e}return t}},69693(t){t.exports=function(t,e,i){var r=t.indexOf(e);if(-1===r||i<0||i>=t.length)throw new Error("Supplied index out of bounds");return r!==i&&(t.splice(r,1),t.splice(i,0,e)),e}},40853(t){t.exports=function(t,e){var i=t.indexOf(e);if(-1!==i&&i=e;s--)a?n.push(i+s.toString()+r):n.push(s);else for(s=t;s<=e;s++)a?n.push(i+s.toString()+r):n.push(s);return n}},593(t,e,i){var r=i(2284);t.exports=function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=null),void 0===i&&(i=1),null===e&&(e=t,t=0);for(var s=[],n=Math.max(r((e-t)/(i||1)),0),a=0;ae?1:0}var r=function(t,s,n,a,o){for(void 0===n&&(n=0),void 0===a&&(a=t.length-1),void 0===o&&(o=i);a>n;){if(a-n>600){var h=a-n+1,l=s-n+1,u=Math.log(h),d=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*d*(h-d)/h)*(l-h/2<0?-1:1),f=Math.max(n,Math.floor(s-l*d/h+c)),p=Math.min(a,Math.floor(s+(h-l)*d/h+c));r(t,s,f,p,o)}var g=t[s],m=n,v=a;for(e(t,n,s),o(t[a],g)>0&&e(t,n,a);m0;)v--}0===o(t[n],g)?e(t,n,v):e(t,++v,a),v<=s&&(n=v+1),s<=v&&(a=v-1)}};t.exports=r},88492(t,e,i){var r=i(35154),s=i(33680),n=function(t,e,i){for(var r=[],s=0;s=0;){var h=e[a];-1!==(n=t.indexOf(h))&&(r(t,n),o.push(h),i&&i.call(s,h)),a--}return o}},60248(t,e,i){var r=i(19133);t.exports=function(t,e,i,s){if(void 0===s&&(s=t),e<0||e>t.length-1)throw new Error("Index out of bounds");var n=r(t,e);return i&&i.call(s,n),n}},81409(t,e,i){var r=i(82011);t.exports=function(t,e,i,s,n){if(void 0===e&&(e=0),void 0===i&&(i=t.length),void 0===n&&(n=t),r(t,e,i)){var a=i-e,o=t.splice(e,a);if(s)for(var h=0;h=s||e>=i||i>s){if(r)throw new Error("Range Error: Values outside acceptable range");return!1}return!0}},89545(t){t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i>0&&(t.splice(i,1),t.unshift(e)),e}},17810(t,e,i){var r=i(82011);t.exports=function(t,e,i,s,n){if(void 0===s&&(s=0),void 0===n&&(n=t.length),r(t,s,n))for(var a=s;a0;e--){var i=Math.floor(Math.random()*(e+1)),r=t[e];t[e]=t[i],t[i]=r}return t}},90126(t){t.exports=function(t){var e=/\D/g;return t.sort(function(t,i){return parseInt(t.replace(e,""),10)-parseInt(i.replace(e,""),10)}),t}},19133(t){t.exports=function(t,e){if(!(e>=t.length)){for(var i=t.length-1,r=t[e],s=e;sl&&(n=l),a>l&&(a=l),o=s,h=n;;)if(o-1;n--)r[s][n]=t[n][s]}return r}},54915(t,e,i){t.exports={CheckMatrix:i(86922),MatrixToString:i(63362),ReverseColumns:i(92598),ReverseRows:i(21224),Rotate180:i(98717),RotateLeft:i(44657),RotateMatrix:i(37829),RotateRight:i(92632),Translate:i(69512),TransposeMatrix:i(2429)}},71334(t){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";t.exports=function(t,i){for(var r=new Uint8Array(t),s=r.length,n=i?"data:"+i+";base64,":"",a=0;a>2],n+=e[(3&r[a])<<4|r[a+1]>>4],n+=e[(15&r[a+1])<<2|r[a+2]>>6],n+=e[63&r[a+2]];return s%3==2?n=n.substring(0,n.length-1)+"=":s%3==1&&(n=n.substring(0,n.length-2)+"=="),n}},53134(t){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=new Uint8Array(256),r=0;r<64;r++)i[e.charCodeAt(r)]=r;t.exports=function(t){var e,r,s,n,a=(t=t.substr(t.indexOf(",")+1)).length,o=.75*a,h=0;"="===t[a-1]&&(o--,"="===t[a-2]&&o--);for(var l=new ArrayBuffer(o),u=new Uint8Array(l),d=0;d>4,u[h++]=(15&r)<<4|s>>2,u[h++]=(3&s)<<6|63&n;return l}},65839(t,e,i){t.exports={ArrayBufferToBase64:i(71334),Base64ToArrayBuffer:i(53134)}},91799(t,e,i){t.exports={Array:i(37105),Base64:i(65839),Objects:i(1183),String:i(31749),NOOP:i(29747),NULL:i(20242)}},41786(t){t.exports=function(t){var e={};for(var i in t)Array.isArray(t[i])?e[i]=t[i].slice(0):e[i]=t[i];return e}},62644(t){var e=function(t){var i,r,s;if("object"!=typeof t||null===t)return t;for(s in i=Array.isArray(t)?[]:{},t)r=t[s],i[s]=e(r);return i};t.exports=e},79291(t,e,i){var r=i(41212),s=function(){var t,e,i,n,a,o,h=arguments[0]||{},l=1,u=arguments.length,d=!1;for("boolean"==typeof h&&(d=h,h=arguments[1]||{},l=2),u===l&&(h=this,--l);l=(t=t.toString()).length)switch(r){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var n=Math.ceil((s=e-t.length)/2);t=new Array(s-n+1).join(i)+t+new Array(n+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t}},33628(t){t.exports=function(t,e){return 0===e?t.slice(1):t.slice(0,e)+t.slice(e+1)}},27671(t){t.exports=function(t){return t.split("").reverse().join("")}},45650(t){t.exports=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})}},35355(t){t.exports=function(t){return t&&t[0].toUpperCase()+t.slice(1)}},31749(t,e,i){t.exports={Format:i(27902),Pad:i(41836),RemoveAt:i(33628),Reverse:i(27671),UppercaseFirst:i(35355),UUID:i(45650)}}},e={};function i(r){var s=e[r];if(void 0!==s)return s.exports;var n=e[r]={exports:{}};return t[r](n,n.exports,i),n.exports}return i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var r in e)i.o(e,r)&&!i.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i(85454)})()); \ No newline at end of file