diff --git a/env.config.js b/env.config.js index 1c15b7d..f9030dd 100644 --- a/env.config.js +++ b/env.config.js @@ -34,4 +34,26 @@ const CONFIG = { xinzhiKey, } } + +// const CONFIG = { +// // 开发环境配置 +// development: { +// officialWebUrl: 'https://iot.iot-xcwl.cn/', +// baseUrl: 'https://iot.iot-xcwl.cn/prod-api/', +// mqttServer: protocalProd + 'iot.iot-xcwl.cn/mqtt', +// decoderUrl: 'https://iot.iot-xcwl.cn/', +// qqmapKey, +// xinzhiKey, +// }, +// // 生产环境配置 +// production: { +// officialWebUrl: 'https://iot.iot-xcwl.cn/', +// baseUrl: 'https://iot.iot-xcwl.cn/prod-api/', +// mqttServer: protocalProd + 'iot.iot-xcwl.cn/mqtt', +// decoderUrl: 'https://iot.iot-xcwl.cn/', +// qqmapKey, +// xinzhiKey, +// } +// } + export default CONFIG[process.env.NODE_ENV]; \ No newline at end of file diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json index ce0eb08..153d4e3 100644 --- a/node_modules/.package-lock.json +++ b/node_modules/.package-lock.json @@ -5,24 +5,30 @@ "requires": true, "packages": { "node_modules/@babel/helper-string-parser": { - "version": "7.25.9", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", + "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.25.9", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.27.1.tgz", + "integrity": "sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==", "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/parser": { - "version": "7.27.0", + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.28.0.tgz", + "integrity": "sha512-jVZGvOxOuNSsuQuLRTh13nU0AogFlw32w/MT+LV6D3sP5WdbW61E77RnkbaO2dUvmPAYrBDJXGn5gGS6tH4j8g==", "license": "MIT", "dependencies": { - "@babel/types": "^7.27.0" + "@babel/types": "^7.28.0" }, "bin": { "parser": "bin/babel-parser.js" @@ -32,11 +38,13 @@ } }, "node_modules/@babel/types": { - "version": "7.27.0", + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.28.0.tgz", + "integrity": "sha512-jYnje+JyZG5YThjHiF28oT4SIZLnYOcSBb6+SDaFIyzDVSkXQmQQYclJ2R+YxcdmK0AX6x1E5OQNtuh3jHDrUg==", "license": "MIT", "dependencies": { - "@babel/helper-string-parser": "^7.25.9", - "@babel/helper-validator-identifier": "^7.25.9" + "@babel/helper-string-parser": "^7.27.1", + "@babel/helper-validator-identifier": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -44,6 +52,8 @@ }, "node_modules/@intlify/core-base": { "version": "9.14.4", + "resolved": "https://registry.npmjs.org/@intlify/core-base/-/core-base-9.14.4.tgz", + "integrity": "sha512-vtZCt7NqWhKEtHa3SD/322DlgP5uR9MqWxnE0y8Q0tjDs9H5Lxhss+b5wv8rmuXRoHKLESNgw9d+EN9ybBbj9g==", "license": "MIT", "dependencies": { "@intlify/message-compiler": "9.14.4", @@ -58,6 +68,8 @@ }, "node_modules/@intlify/message-compiler": { "version": "9.14.4", + "resolved": "https://registry.npmjs.org/@intlify/message-compiler/-/message-compiler-9.14.4.tgz", + "integrity": "sha512-vcyCLiVRN628U38c3PbahrhbbXrckrM9zpy0KZVlDk2Z0OnGwv8uQNNXP3twwGtfLsCf4gu3ci6FMIZnPaqZsw==", "license": "MIT", "dependencies": { "@intlify/shared": "9.14.4", @@ -72,6 +84,8 @@ }, "node_modules/@intlify/shared": { "version": "9.14.4", + "resolved": "https://registry.npmjs.org/@intlify/shared/-/shared-9.14.4.tgz", + "integrity": "sha512-P9zv6i1WvMc9qDBWvIgKkymjY2ptIiQ065PjDv7z7fDqH3J/HBRBN5IoiR46r/ujRcU7hCuSIZWvCAFCyuOYZA==", "license": "MIT", "engines": { "node": ">= 16" @@ -81,100 +95,122 @@ } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.5.0", + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.4.tgz", + "integrity": "sha512-VT2+G1VQs/9oz078bLrYbecdZKs912zQlkelYpuf+SXF+QvZDYJlbx/LSx+meSAwdDFnF8FVXW92AVjjkVmgFw==", "license": "MIT", "peer": true }, "node_modules/@vue/compiler-core": { - "version": "3.5.13", + "version": "3.5.17", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.5.17.tgz", + "integrity": "sha512-Xe+AittLbAyV0pabcN7cP7/BenRBNcteM4aSDCtRvGw0d9OL+HG1u/XHLY/kt1q4fyMeZYXyIYrsHuPSiDPosA==", "license": "MIT", "dependencies": { - "@babel/parser": "^7.25.3", - "@vue/shared": "3.5.13", + "@babel/parser": "^7.27.5", + "@vue/shared": "3.5.17", "entities": "^4.5.0", "estree-walker": "^2.0.2", - "source-map-js": "^1.2.0" + "source-map-js": "^1.2.1" } }, "node_modules/@vue/compiler-dom": { - "version": "3.5.13", + "version": "3.5.17", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.5.17.tgz", + "integrity": "sha512-+2UgfLKoaNLhgfhV5Ihnk6wB4ljyW1/7wUIog2puUqajiC29Lp5R/IKDdkebh9jTbTogTbsgB+OY9cEWzG95JQ==", "license": "MIT", "dependencies": { - "@vue/compiler-core": "3.5.13", - "@vue/shared": "3.5.13" + "@vue/compiler-core": "3.5.17", + "@vue/shared": "3.5.17" } }, "node_modules/@vue/compiler-sfc": { - "version": "3.5.13", + "version": "3.5.17", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.5.17.tgz", + "integrity": "sha512-rQQxbRJMgTqwRugtjw0cnyQv9cP4/4BxWfTdRBkqsTfLOHWykLzbOc3C4GGzAmdMDxhzU/1Ija5bTjMVrddqww==", "license": "MIT", "peer": true, "dependencies": { - "@babel/parser": "^7.25.3", - "@vue/compiler-core": "3.5.13", - "@vue/compiler-dom": "3.5.13", - "@vue/compiler-ssr": "3.5.13", - "@vue/shared": "3.5.13", + "@babel/parser": "^7.27.5", + "@vue/compiler-core": "3.5.17", + "@vue/compiler-dom": "3.5.17", + "@vue/compiler-ssr": "3.5.17", + "@vue/shared": "3.5.17", "estree-walker": "^2.0.2", - "magic-string": "^0.30.11", - "postcss": "^8.4.48", - "source-map-js": "^1.2.0" + "magic-string": "^0.30.17", + "postcss": "^8.5.6", + "source-map-js": "^1.2.1" } }, "node_modules/@vue/compiler-ssr": { - "version": "3.5.13", + "version": "3.5.17", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.5.17.tgz", + "integrity": "sha512-hkDbA0Q20ZzGgpj5uZjb9rBzQtIHLS78mMilwrlpWk2Ep37DYntUz0PonQ6kr113vfOEdM+zTBuJDaceNIW0tQ==", "license": "MIT", "peer": true, "dependencies": { - "@vue/compiler-dom": "3.5.13", - "@vue/shared": "3.5.13" + "@vue/compiler-dom": "3.5.17", + "@vue/shared": "3.5.17" } }, "node_modules/@vue/devtools-api": { "version": "6.6.4", + "resolved": "https://registry.npmjs.org/@vue/devtools-api/-/devtools-api-6.6.4.tgz", + "integrity": "sha512-sGhTPMuXqZ1rVOk32RylztWkfXTRhuS7vgAKv0zjqk8gbsHkJ7xfFf+jbySxt7tWObEJwyKaHMikV/WGDiQm8g==", "license": "MIT" }, "node_modules/@vue/reactivity": { - "version": "3.5.13", + "version": "3.5.17", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.5.17.tgz", + "integrity": "sha512-l/rmw2STIscWi7SNJp708FK4Kofs97zc/5aEPQh4bOsReD/8ICuBcEmS7KGwDj5ODQLYWVN2lNibKJL1z5b+Lw==", "license": "MIT", "peer": true, "dependencies": { - "@vue/shared": "3.5.13" + "@vue/shared": "3.5.17" } }, "node_modules/@vue/runtime-core": { - "version": "3.5.13", + "version": "3.5.17", + "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.5.17.tgz", + "integrity": "sha512-QQLXa20dHg1R0ri4bjKeGFKEkJA7MMBxrKo2G+gJikmumRS7PTD4BOU9FKrDQWMKowz7frJJGqBffYMgQYS96Q==", "license": "MIT", "peer": true, "dependencies": { - "@vue/reactivity": "3.5.13", - "@vue/shared": "3.5.13" + "@vue/reactivity": "3.5.17", + "@vue/shared": "3.5.17" } }, "node_modules/@vue/runtime-dom": { - "version": "3.5.13", + "version": "3.5.17", + "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.5.17.tgz", + "integrity": "sha512-8El0M60TcwZ1QMz4/os2MdlQECgGoVHPuLnQBU3m9h3gdNRW9xRmI8iLS4t/22OQlOE6aJvNNlBiCzPHur4H9g==", "license": "MIT", "peer": true, "dependencies": { - "@vue/reactivity": "3.5.13", - "@vue/runtime-core": "3.5.13", - "@vue/shared": "3.5.13", + "@vue/reactivity": "3.5.17", + "@vue/runtime-core": "3.5.17", + "@vue/shared": "3.5.17", "csstype": "^3.1.3" } }, "node_modules/@vue/server-renderer": { - "version": "3.5.13", + "version": "3.5.17", + "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.5.17.tgz", + "integrity": "sha512-BOHhm8HalujY6lmC3DbqF6uXN/K00uWiEeF22LfEsm9Q93XeJ/plHTepGwf6tqFcF7GA5oGSSAAUock3VvzaCA==", "license": "MIT", "peer": true, "dependencies": { - "@vue/compiler-ssr": "3.5.13", - "@vue/shared": "3.5.13" + "@vue/compiler-ssr": "3.5.17", + "@vue/shared": "3.5.17" }, "peerDependencies": { - "vue": "3.5.13" + "vue": "3.5.17" } }, "node_modules/@vue/shared": { - "version": "3.5.13", + "version": "3.5.17", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.5.17.tgz", + "integrity": "sha512-CabR+UN630VnsJO/jHWYBC1YVXyMq94KKp6iF5MQgZJs5I8cmjw6oVMO1oDbtBkENSHSSn/UadWlW/OAgdmKrg==", "license": "MIT" }, "node_modules/ansi-styles": { @@ -202,87 +238,46 @@ }, "node_modules/async-limiter": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", + "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==", "license": "MIT" }, "node_modules/balanced-match": { "version": "1.0.2", - "license": "MIT" - }, - "node_modules/base64-js": { - "version": "1.5.1", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "license": "MIT" }, "node_modules/bl": { - "version": "4.1.0", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.3.tgz", + "integrity": "sha512-pvcNpa0UU69UT341rO6AYy4FVAIkUHuZXRIWbq+zHnsVcRzDDjIAhGuuYoi0d//cwIwtt4pkpKycWEfjdV+vww==", "license": "MIT", "dependencies": { - "buffer": "^5.5.0", - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" - } - }, - "node_modules/bl/node_modules/readable-stream": { - "version": "3.6.2", - "license": "MIT", - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" + "readable-stream": "^2.3.5", + "safe-buffer": "^5.1.1" } }, "node_modules/brace-expansion": { - "version": "1.1.11", + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, - "node_modules/buffer": { - "version": "5.7.1", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT", - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, "node_modules/buffer-from": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "license": "MIT" }, "node_modules/callback-stream": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/callback-stream/-/callback-stream-1.1.0.tgz", + "integrity": "sha512-sAZ9kODla+mGACBZ1IpTCAisKoGnv6PykW7fPk1LrM+mMepE18Yz0515yoVcrZy7dQsTUp3uZLQ/9Sx1RnLoHw==", "license": "MIT", "dependencies": { "inherits": "^2.0.1", @@ -357,6 +352,8 @@ }, "node_modules/commist": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/commist/-/commist-1.1.0.tgz", + "integrity": "sha512-rraC8NXWOEjhADbZe9QBNzLAN5Q3fsTPQtBV+fEVj6xKIgDgNiEVE6ZNfHpZOqfQ21YUzfVNUXLOEZquYvQPPg==", "license": "MIT", "dependencies": { "leven": "^2.1.0", @@ -365,10 +362,14 @@ }, "node_modules/concat-map": { "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "license": "MIT" }, "node_modules/concat-stream": { "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", "engines": [ "node >= 0.8" ], @@ -382,15 +383,21 @@ }, "node_modules/core-util-is": { "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", "license": "MIT" }, "node_modules/csstype": { "version": "3.1.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", + "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==", "license": "MIT", "peer": true }, "node_modules/d": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.2.tgz", + "integrity": "sha512-MOqHvMWF9/9MX6nza0KgvFH4HpMU0EF5uUDXqX/BtxtU8NfB0QzRtJ8Oe/6SuS4kbhyzVJwjd97EA4PKrzJ8bw==", "license": "ISC", "dependencies": { "es5-ext": "^0.10.64", @@ -401,7 +408,10 @@ } }, "node_modules/debug": { - "version": "4.4.0", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", + "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==", + "dev": true, "license": "MIT", "dependencies": { "ms": "^2.1.3" @@ -430,6 +440,8 @@ }, "node_modules/duplexify": { "version": "3.7.1", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", + "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", "license": "MIT", "dependencies": { "end-of-stream": "^1.0.0", @@ -439,7 +451,9 @@ } }, "node_modules/end-of-stream": { - "version": "1.4.4", + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz", + "integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==", "license": "MIT", "dependencies": { "once": "^1.4.0" @@ -447,6 +461,8 @@ }, "node_modules/entities": { "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", "license": "BSD-2-Clause", "engines": { "node": ">=0.12" @@ -457,6 +473,8 @@ }, "node_modules/es5-ext": { "version": "0.10.64", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.64.tgz", + "integrity": "sha512-p2snDhiLaXe6dahss1LddxqEm+SkuDvV8dnIQG0MWjyHpcMNfXKPE+/Cc0y+PhxJX3A4xGNeFCj5oc0BUh6deg==", "hasInstallScript": true, "license": "ISC", "dependencies": { @@ -471,6 +489,8 @@ }, "node_modules/es6-iterator": { "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", + "integrity": "sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==", "license": "MIT", "dependencies": { "d": "1", @@ -480,6 +500,8 @@ }, "node_modules/es6-map": { "version": "0.1.5", + "resolved": "https://registry.npmjs.org/es6-map/-/es6-map-0.1.5.tgz", + "integrity": "sha512-mz3UqCh0uPCIqsw1SSAkB/p0rOzF/M0V++vyN7JqlPtSW/VsYgQBvVvqMLmfBuyMzTpLnNqi6JmcSizs4jy19A==", "license": "MIT", "dependencies": { "d": "1", @@ -492,6 +514,8 @@ }, "node_modules/es6-set": { "version": "0.1.6", + "resolved": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.6.tgz", + "integrity": "sha512-TE3LgGLDIBX332jq3ypv6bcOpkLO0AslAQo7p2VqX/1N46YNsvIWgvjojjSEnWEGWMhr1qUbYeTSir5J6mFHOw==", "license": "ISC", "dependencies": { "d": "^1.0.1", @@ -507,6 +531,8 @@ }, "node_modules/es6-symbol": { "version": "3.1.4", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.4.tgz", + "integrity": "sha512-U9bFFjX8tFiATgtkJ1zg25+KviIXpgRvRHS8sau3GfhVzThRQrOeksPeT0BWW2MNZs1OEWJ1DPXOQMn0KKRkvg==", "license": "ISC", "dependencies": { "d": "^1.0.2", @@ -528,6 +554,8 @@ }, "node_modules/esniff": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/esniff/-/esniff-2.0.1.tgz", + "integrity": "sha512-kTUIGKQ/mDPFoJ0oVfcmyJn4iBDRptjNVIzwIFR7tqWXdVI9xfA2RMwY/gbSpJG3lkdWNEjLap/NqVHZiJsdfg==", "license": "ISC", "dependencies": { "d": "^1.0.1", @@ -541,10 +569,14 @@ }, "node_modules/estree-walker": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", "license": "MIT" }, "node_modules/event-emitter": { "version": "0.3.5", + "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", + "integrity": "sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==", "license": "MIT", "dependencies": { "d": "1", @@ -553,6 +585,8 @@ }, "node_modules/ext": { "version": "1.7.0", + "resolved": "https://registry.npmjs.org/ext/-/ext-1.7.0.tgz", + "integrity": "sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==", "license": "ISC", "dependencies": { "type": "^2.7.2" @@ -560,14 +594,21 @@ }, "node_modules/extend": { "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", "license": "MIT" }, "node_modules/fs.realpath": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "license": "ISC" }, "node_modules/glob": { "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", @@ -586,6 +627,8 @@ }, "node_modules/glob-parent": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha512-E8Ak/2+dZY6fnzlR7+ueWvhsH1SjHr4jjss4YS/h4py44jY9MhK/VFdaZJAWDz6BbL21KeteKxFSFpq8OS5gVA==", "license": "ISC", "dependencies": { "is-glob": "^3.1.0", @@ -594,6 +637,8 @@ }, "node_modules/glob-stream": { "version": "6.1.0", + "resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-6.1.0.tgz", + "integrity": "sha512-uMbLGAP3S2aDOHUDfdoYcdIePUCfysbAd0IAoWVZbeGU/oNQ8asHVSshLDJUPWxfzj8zsCG7/XeHPHTtow0nsw==", "license": "MIT", "dependencies": { "extend": "^3.0.0", @@ -623,6 +668,8 @@ }, "node_modules/help-me": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/help-me/-/help-me-1.1.0.tgz", + "integrity": "sha512-P/IZ8yOMne3SCTHbVY429NZ67B/2bVQlcYGZh2iPPbdLrEQ/qY5aGChn0YTDmt7Sb4IKRI51fypItav+lNl76w==", "license": "MIT", "dependencies": { "callback-stream": "^1.0.2", @@ -631,26 +678,11 @@ "xtend": "^4.0.0" } }, - "node_modules/ieee754": { - "version": "1.2.1", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "BSD-3-Clause" - }, "node_modules/inflight": { "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", "license": "ISC", "dependencies": { "once": "^1.3.0", @@ -659,10 +691,14 @@ }, "node_modules/inherits": { "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "license": "ISC" }, "node_modules/is-absolute": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", + "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", "license": "MIT", "dependencies": { "is-relative": "^1.0.0", @@ -674,6 +710,8 @@ }, "node_modules/is-extglob": { "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "license": "MIT", "engines": { "node": ">=0.10.0" @@ -681,6 +719,8 @@ }, "node_modules/is-glob": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha512-UFpDDrPgM6qpnFNI+rh/p3bUaq9hKLZN8bMUWzxmcnZVS3omf4IPK+BrewlnWjO1WmUsMYuSjKh4UJuV4+Lqmw==", "license": "MIT", "dependencies": { "is-extglob": "^2.1.0" @@ -691,6 +731,8 @@ }, "node_modules/is-negated-glob": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-negated-glob/-/is-negated-glob-1.0.0.tgz", + "integrity": "sha512-czXVVn/QEmgvej1f50BZ648vUI+em0xqMq2Sn+QncCLN4zj1UAxlT+kw/6ggQTOaZPd1HqKQGEqbpQVtJucWug==", "license": "MIT", "engines": { "node": ">=0.10.0" @@ -698,6 +740,8 @@ }, "node_modules/is-relative": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", + "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", "license": "MIT", "dependencies": { "is-unc-path": "^1.0.0" @@ -708,6 +752,8 @@ }, "node_modules/is-unc-path": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", + "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", "license": "MIT", "dependencies": { "unc-path-regex": "^0.1.2" @@ -718,6 +764,8 @@ }, "node_modules/is-windows": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", "license": "MIT", "engines": { "node": ">=0.10.0" @@ -725,14 +773,20 @@ }, "node_modules/isarray": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", "license": "MIT" }, "node_modules/jsencrypt": { "version": "3.3.2", + "resolved": "https://registry.npmjs.org/jsencrypt/-/jsencrypt-3.3.2.tgz", + "integrity": "sha512-arQR1R1ESGdAxY7ZheWr12wCaF2yF47v5qpB76TtV64H1pyGudk9Hvw8Y9tb/FiTIaaTRUyaSnm5T/Y53Ghm/A==", "license": "MIT" }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", "license": "MIT" }, "node_modules/launch-ide": { @@ -748,6 +802,8 @@ }, "node_modules/leven": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-2.1.0.tgz", + "integrity": "sha512-nvVPLpIHUxCUoRLrFqTgSxXJ614d8AgQoWl7zPe/2VadE8+1dpU3LBhowRuBAcuwruWtOdD8oYC9jDNJjXDPyA==", "license": "MIT", "engines": { "node": ">=0.10.0" @@ -755,6 +811,8 @@ }, "node_modules/magic-string": { "version": "0.30.17", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.17.tgz", + "integrity": "sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==", "license": "MIT", "peer": true, "dependencies": { @@ -763,6 +821,8 @@ }, "node_modules/minimatch": { "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" @@ -773,6 +833,8 @@ }, "node_modules/minimist": { "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" @@ -780,16 +842,19 @@ }, "node_modules/moment": { "version": "2.30.1", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.30.1.tgz", + "integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==", "license": "MIT", "engines": { "node": "*" } }, "node_modules/mqtt": { - "version": "3.0.0", + "version": "2.18.9", + "resolved": "https://registry.npmjs.org/mqtt/-/mqtt-2.18.9.tgz", + "integrity": "sha512-ufywki8VAQ8YAERiunbj77TnXgaeVYVlyebnj4o9vhPUQFRjo+d3oUf0rft8kWi7YPYf4O8rkwPkeFc7ndWESg==", "license": "MIT", "dependencies": { - "base64-js": "^1.3.0", "commist": "^1.0.0", "concat-stream": "^1.6.2", "end-of-stream": "^1.4.1", @@ -797,12 +862,12 @@ "help-me": "^1.0.1", "inherits": "^2.0.3", "minimist": "^1.2.0", - "mqtt-packet": "^6.0.0", + "mqtt-packet": "^5.6.0", "pump": "^3.0.0", "readable-stream": "^2.3.6", "reinterval": "^1.1.0", - "split2": "^3.1.0", - "websocket-stream": "^5.1.2", + "split2": "^2.1.1", + "websocket-stream": "~5.2.0", "xtend": "^4.0.1" }, "bin": { @@ -815,20 +880,28 @@ } }, "node_modules/mqtt-packet": { - "version": "6.10.0", + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/mqtt-packet/-/mqtt-packet-5.6.1.tgz", + "integrity": "sha512-eaF9rO2uFrIYEHomJxziuKTDkbWW5psLBaIGCazQSKqYsTaB3n4SpvJ1PexKaDBiPnMLPIFWBIiTYT3IfEJfww==", "license": "MIT", "dependencies": { - "bl": "^4.0.2", - "debug": "^4.1.1", - "process-nextick-args": "^2.0.1" + "bl": "^1.2.1", + "inherits": "^2.0.3", + "process-nextick-args": "^2.0.0", + "safe-buffer": "^5.1.0" } }, "node_modules/ms": { "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, "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==", "funding": [ { "type": "github", @@ -846,10 +919,14 @@ }, "node_modules/next-tick": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", + "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==", "license": "ISC" }, "node_modules/once": { "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "license": "ISC", "dependencies": { "wrappy": "1" @@ -857,6 +934,8 @@ }, "node_modules/ordered-read-streams": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ordered-read-streams/-/ordered-read-streams-1.0.1.tgz", + "integrity": "sha512-Z87aSjx3r5c0ZB7bcJqIgIRX5bxR7A4aSzvIbaxd0oTkWBCOoKfuGHiKj60CHVUgg1Phm5yMZzBdt8XqRs73Mw==", "license": "MIT", "dependencies": { "readable-stream": "^2.0.1" @@ -864,10 +943,14 @@ }, "node_modules/path-dirname": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", + "integrity": "sha512-ALzNPpyNq9AqXMBjeymIjFDAkAFH06mHJH/cSBHAgU0s4vfpBn6b2nf8tiRLvagKD8RbTpq2FKTBg7cl9l3c7Q==", "license": "MIT" }, "node_modules/path-is-absolute": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "license": "MIT", "engines": { "node": ">=0.10.0" @@ -875,6 +958,8 @@ }, "node_modules/picocolors": { "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", "license": "ISC", "peer": true }, @@ -893,7 +978,9 @@ } }, "node_modules/postcss": { - "version": "8.5.3", + "version": "8.5.6", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz", + "integrity": "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==", "funding": [ { "type": "opencollective", @@ -911,7 +998,7 @@ "license": "MIT", "peer": true, "dependencies": { - "nanoid": "^3.3.8", + "nanoid": "^3.3.11", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" }, @@ -921,10 +1008,14 @@ }, "node_modules/process-nextick-args": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", "license": "MIT" }, "node_modules/pump": { - "version": "3.0.2", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.3.tgz", + "integrity": "sha512-todwxLMY7/heScKmntwQG8CXVkWUOdYxIvY2s0VWAAMh/nd8SoYiRaKjlr7+iCs984f2P8zvrfWcDDYVb73NfA==", "license": "MIT", "dependencies": { "end-of-stream": "^1.1.0", @@ -933,6 +1024,8 @@ }, "node_modules/pumpify": { "version": "1.5.1", + "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", + "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", "license": "MIT", "dependencies": { "duplexify": "^3.6.0", @@ -942,6 +1035,8 @@ }, "node_modules/pumpify/node_modules/pump": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", + "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", "license": "MIT", "dependencies": { "end-of-stream": "^1.1.0", @@ -950,6 +1045,8 @@ }, "node_modules/readable-stream": { "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", "license": "MIT", "dependencies": { "core-util-is": "~1.0.0", @@ -961,55 +1058,83 @@ "util-deprecate": "~1.0.1" } }, + "node_modules/readable-stream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "license": "MIT" + }, "node_modules/reinterval": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/reinterval/-/reinterval-1.1.0.tgz", + "integrity": "sha512-QIRet3SYrGp0HUHO88jVskiG6seqUGC5iAG7AwI/BV4ypGcuqk9Du6YQBUOUqm9c8pw1eyLoIaONifRua1lsEQ==", "license": "MIT" }, "node_modules/remove-trailing-separator": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha512-/hS+Y0u3aOfIETiaiirUFwDBDzmXPvO+jAfKTitUngIPzdKc6Z0LoFjM/CK5PL4C+eKwHohlHAb6H0VFfmmUsw==", "license": "ISC" }, "node_modules/safe-buffer": { - "version": "5.1.2", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], "license": "MIT" }, "node_modules/source-map-js": { "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } }, "node_modules/split2": { - "version": "3.2.2", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-2.2.0.tgz", + "integrity": "sha512-RAb22TG39LhI31MbreBgIuKiIKhVsawfTgEGqKHTK87aG+ul/PB8Sqoi3I7kVdRWiCfrKxK3uo4/YUkpNvhPbw==", "license": "ISC", "dependencies": { - "readable-stream": "^3.0.0" - } - }, - "node_modules/split2/node_modules/readable-stream": { - "version": "3.6.2", - "license": "MIT", - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" + "through2": "^2.0.2" } }, "node_modules/stream-shift": { "version": "1.0.3", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.3.tgz", + "integrity": "sha512-76ORR0DO1o1hlKwTbi/DM3EXWGf3ZJYO8cXX5RJwnul2DEg2oyoZyjLNoQM8WsvZiFKCRfC1O0J7iCvie3RZmQ==", "license": "MIT" }, "node_modules/string_decoder": { "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "license": "MIT", "dependencies": { "safe-buffer": "~5.1.0" } }, + "node_modules/string_decoder/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "license": "MIT" + }, "node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -1025,6 +1150,8 @@ }, "node_modules/through2": { "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", "license": "MIT", "dependencies": { "readable-stream": "~2.3.6", @@ -1033,6 +1160,8 @@ }, "node_modules/through2-filter": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/through2-filter/-/through2-filter-3.0.0.tgz", + "integrity": "sha512-jaRjI2WxN3W1V8/FMZ9HKIBXixtiqs3SQSX4/YGIiP3gL6djW48VoZq9tDqeCWs3MT8YY5wb/zli8VW8snY1CA==", "license": "MIT", "dependencies": { "through2": "~2.0.0", @@ -1041,6 +1170,8 @@ }, "node_modules/to-absolute-glob": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz", + "integrity": "sha512-rtwLUQEwT8ZeKQbyFJyomBRYXyE16U5VKuy0ftxLMK/PZb2fkOsg5r9kHdauuVDbsNdIBoC/HCthpidamQFXYA==", "license": "MIT", "dependencies": { "is-absolute": "^1.0.0", @@ -1052,18 +1183,20 @@ }, "node_modules/type": { "version": "2.7.3", + "resolved": "https://registry.npmjs.org/type/-/type-2.7.3.tgz", + "integrity": "sha512-8j+1QmAbPvLZow5Qpi6NCaN8FB60p/6x8/vfNqOk/hC+HuvFZhL4+WfekuhQLiqFZXOgQdrs3B+XxEmCc6b3FQ==", "license": "ISC" }, "node_modules/typedarray": { "version": "0.0.6", - "license": "MIT" - }, - "node_modules/ultron": { - "version": "1.1.1", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==", "license": "MIT" }, "node_modules/unc-path-regex": { "version": "0.1.2", + "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", + "integrity": "sha512-eXL4nmJT7oCpkZsHZUOJo8hcX3GbsiDOa0Qu9F646fi8dT3XuSVopVqAcEiVzSKKH7UoDti23wNX3qGFxcW5Qg==", "license": "MIT", "engines": { "node": ">=0.10.0" @@ -1071,6 +1204,8 @@ }, "node_modules/unique-stream": { "version": "2.3.1", + "resolved": "https://registry.npmjs.org/unique-stream/-/unique-stream-2.3.1.tgz", + "integrity": "sha512-2nY4TnBE70yoxHkDli7DMazpWiP7xMdCYqU2nBRO0UB+ZpEkGsSija7MvmvnZFUeC+mrgiUfcHSr3LmRFIg4+A==", "license": "MIT", "dependencies": { "json-stable-stringify-without-jsonify": "^1.0.1", @@ -1079,6 +1214,8 @@ }, "node_modules/util-deprecate": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", "license": "MIT" }, "node_modules/vite-code-inspector-plugin": { @@ -1092,15 +1229,17 @@ } }, "node_modules/vue": { - "version": "3.5.13", + "version": "3.5.17", + "resolved": "https://registry.npmjs.org/vue/-/vue-3.5.17.tgz", + "integrity": "sha512-LbHV3xPN9BeljML+Xctq4lbz2lVHCR6DtbpTf5XIO6gugpXUN49j2QQPcMj086r9+AkJ0FfUT8xjulKKBkkr9g==", "license": "MIT", "peer": true, "dependencies": { - "@vue/compiler-dom": "3.5.13", - "@vue/compiler-sfc": "3.5.13", - "@vue/runtime-dom": "3.5.13", - "@vue/server-renderer": "3.5.13", - "@vue/shared": "3.5.13" + "@vue/compiler-dom": "3.5.17", + "@vue/compiler-sfc": "3.5.17", + "@vue/runtime-dom": "3.5.17", + "@vue/server-renderer": "3.5.17", + "@vue/shared": "3.5.17" }, "peerDependencies": { "typescript": "*" @@ -1113,6 +1252,8 @@ }, "node_modules/vue-i18n": { "version": "9.14.4", + "resolved": "https://registry.npmjs.org/vue-i18n/-/vue-i18n-9.14.4.tgz", + "integrity": "sha512-B934C8yUyWLT0EMud3DySrwSUJI7ZNiWYsEEz2gknTthqKiG4dzWE/WSa8AzCuSQzwBEv4HtG1jZDhgzPfWSKQ==", "license": "MIT", "dependencies": { "@intlify/core-base": "9.14.4", @@ -1140,32 +1281,52 @@ } }, "node_modules/websocket-stream": { - "version": "5.5.2", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/websocket-stream/-/websocket-stream-5.2.0.tgz", + "integrity": "sha512-2ZfiWuEK/bTi8AhXdYh/lFEUwXtGVcbO4vWUy5XJhf7F6nCMAC8hbXXTarxrmv2BFSwdk3P3bhvgiA9wzT+GFQ==", "license": "BSD-2-Clause", "dependencies": { - "duplexify": "^3.5.1", + "duplexify": "^3.6.1", "inherits": "^2.0.1", - "readable-stream": "^2.3.3", + "readable-stream": "^3.0.0", "safe-buffer": "^5.1.2", - "ws": "^3.2.0", + "ws": "^6.1.2", "xtend": "^4.0.0" } }, + "node_modules/websocket-stream/node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/wrappy": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "license": "ISC" }, "node_modules/ws": { - "version": "3.3.3", + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.3.tgz", + "integrity": "sha512-jmTjYU0j60B+vHey6TfR3Z7RD61z/hmxBS3VMSGIrroOWXQEneK1zNuotOUrGyBHQj0yrpsLHPWtigEFd13ndA==", "license": "MIT", "dependencies": { - "async-limiter": "~1.0.0", - "safe-buffer": "~5.1.0", - "ultron": "~1.1.0" + "async-limiter": "~1.0.0" } }, "node_modules/xtend": { "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", "license": "MIT", "engines": { "node": ">=0.4" diff --git a/node_modules/@babel/helper-string-parser/package.json b/node_modules/@babel/helper-string-parser/package.json index 0d0a31a..c4c86e4 100644 --- a/node_modules/@babel/helper-string-parser/package.json +++ b/node_modules/@babel/helper-string-parser/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-string-parser", - "version": "7.25.9", + "version": "7.27.1", "description": "A utility package to parse strings", "repository": { "type": "git", diff --git a/node_modules/@babel/helper-validator-identifier/package.json b/node_modules/@babel/helper-validator-identifier/package.json index 0147740..316dff6 100644 --- a/node_modules/@babel/helper-validator-identifier/package.json +++ b/node_modules/@babel/helper-validator-identifier/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-validator-identifier", - "version": "7.25.9", + "version": "7.27.1", "description": "Validate identifier/keywords name", "repository": { "type": "git", diff --git a/node_modules/@babel/parser/bin/babel-parser.js b/node_modules/@babel/parser/bin/babel-parser.js index 3aca314..4808c5e 100644 --- a/node_modules/@babel/parser/bin/babel-parser.js +++ b/node_modules/@babel/parser/bin/babel-parser.js @@ -1,5 +1,5 @@ #!/usr/bin/env node -/* eslint no-var: 0 */ +/* eslint-disable no-var, unicorn/prefer-node-protocol */ var parser = require(".."); var fs = require("fs"); diff --git a/node_modules/@babel/parser/index.cjs b/node_modules/@babel/parser/index.cjs deleted file mode 100644 index 89863a9..0000000 --- a/node_modules/@babel/parser/index.cjs +++ /dev/null @@ -1,5 +0,0 @@ -try { - module.exports = require("./lib/index.cjs"); -} catch { - module.exports = require("./lib/index.js"); -} diff --git a/node_modules/@babel/parser/lib/index.js b/node_modules/@babel/parser/lib/index.js index 99fe739..41c94cd 100644 --- a/node_modules/@babel/parser/lib/index.js +++ b/node_modules/@babel/parser/lib/index.js @@ -116,9 +116,6 @@ var StandardErrors = { }) => `\`${exportName}\` has already been exported. Exported identifiers must be unique.`, DuplicateProto: "Redefinition of __proto__ property.", DuplicateRegExpFlags: "Duplicate regular expression flag.", - DynamicImportPhaseRequiresImportExpressions: ({ - phase - }) => `'import.${phase}(...)' can only be parsed when using the 'createImportExpressions' option.`, ElementAfterRest: "Rest element must be last element.", EscapedCharNotAnIdentifier: "Invalid Unicode escape.", ExportBindingIsString: ({ @@ -151,6 +148,7 @@ var StandardErrors = { IncompatibleRegExpUVFlags: "The 'u' and 'v' regular expression flags cannot be enabled at the same time.", InvalidBigIntLiteral: "Invalid BigIntLiteral.", InvalidCodePoint: "Code point out of bounds.", + InvalidCoverDiscardElement: "'void' must be followed by an expression when not used in a binding position.", InvalidCoverInitializedName: "Invalid shorthand property initializer.", InvalidDecimal: "Invalid decimal.", InvalidDigit: ({ @@ -267,7 +265,8 @@ var StandardErrors = { unexpected }) => `Unexpected token${unexpected ? ` '${unexpected}'.` : ""}${expected ? `, expected "${expected}"` : ""}`, UnexpectedTokenUnaryExponentiation: "Illegal expression. Wrap left hand side or entire exponentiation in parentheses.", - UnexpectedUsingDeclaration: "Using declaration cannot appear in the top level when source type is `script`.", + UnexpectedUsingDeclaration: "Using declaration cannot appear in the top level when source type is `script` or in the bare case statement.", + UnexpectedVoidPattern: "Unexpected void binding.", UnsupportedBind: "Binding should be performed on object property.", UnsupportedDecoratorExport: "A decorated export must export a class declaration.", UnsupportedDefaultExport: "Only expressions, functions or classes are allowed as the `default` export.", @@ -288,6 +287,8 @@ var StandardErrors = { VarRedeclaration: ({ identifierName }) => `Identifier '${identifierName}' has already been declared.`, + VoidPatternCatchClauseParam: "A void binding can not be the catch clause parameter. Use `try { ... } catch { ... }` if you want to discard the caught error.", + VoidPatternInitializer: "A void binding may not have an initializer.", YieldBindingIdentifier: "Can not use 'yield' as identifier inside a generator.", YieldInParameter: "Yield expression is not allowed in formal parameters.", YieldNotInGeneratorFunction: "'yield' is only allowed within generator functions.", @@ -306,6 +307,12 @@ var StrictModeErrors = { StrictOctalLiteral: "Legacy octal literals are not allowed in strict mode.", StrictWith: "'with' in strict mode." }; +var ParseExpressionErrors = { + ParseExpressionEmptyInput: "Unexpected parseExpression() input: The input is empty or contains only comments.", + ParseExpressionExpectsEOF: ({ + unexpected + }) => `Unexpected parseExpression() input: The input should contain exactly one expression, but the first expression is followed by the unexpected character \`${String.fromCodePoint(unexpected)}\`.` +}; const UnparenthesizedPipeBodyDescriptions = new Set(["ArrowFunctionExpression", "AssignmentExpression", "ConditionalExpression", "YieldExpression"]); var PipelineOperatorErrors = Object.assign({ PipeBodyIsTighter: "Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.", @@ -420,7 +427,7 @@ function ParseErrorEnum(argument, syntaxPlugin) { } return ParseErrorConstructors; } -const Errors = Object.assign({}, ParseErrorEnum(ModuleErrors), ParseErrorEnum(StandardErrors), ParseErrorEnum(StrictModeErrors), ParseErrorEnum`pipelineOperator`(PipelineOperatorErrors)); +const Errors = Object.assign({}, ParseErrorEnum(ModuleErrors), ParseErrorEnum(StandardErrors), ParseErrorEnum(StrictModeErrors), ParseErrorEnum(ParseExpressionErrors), ParseErrorEnum`pipelineOperator`(PipelineOperatorErrors)); function createDefaultOptions() { return { sourceType: "script", @@ -468,6 +475,17 @@ function getOptions(opts) { throw new Error("With a `startLine > 1` you must also specify `startIndex` and `startColumn`."); } } + if (options.sourceType === "commonjs") { + if (opts.allowAwaitOutsideFunction != null) { + throw new Error("The `allowAwaitOutsideFunction` option cannot be used with `sourceType: 'commonjs'`."); + } + if (opts.allowReturnOutsideFunction != null) { + throw new Error("`sourceType: 'commonjs'` implies `allowReturnOutsideFunction: true`, please remove the `allowReturnOutsideFunction` option or use `sourceType: 'script'`."); + } + if (opts.allowNewTargetOutsideFunction != null) { + throw new Error("`sourceType: 'commonjs'` implies `allowNewTargetOutsideFunction: true`, please remove the `allowNewTargetOutsideFunction` option or use `sourceType: 'script'`."); + } + } return options; } const { @@ -541,19 +559,43 @@ var estree = superClass => class ESTreeParserMixin extends superClass { parseBooleanLiteral(value) { return this.estreeParseLiteral(value); } + estreeParseChainExpression(node, endLoc) { + const chain = this.startNodeAtNode(node); + chain.expression = node; + return this.finishNodeAt(chain, "ChainExpression", endLoc); + } directiveToStmt(directive) { const expression = directive.value; delete directive.value; - expression.type = "Literal"; + this.castNodeTo(expression, "Literal"); expression.raw = expression.extra.raw; expression.value = expression.extra.expressionValue; - const stmt = directive; - stmt.type = "ExpressionStatement"; + const stmt = this.castNodeTo(directive, "ExpressionStatement"); stmt.expression = expression; stmt.directive = expression.extra.rawValue; delete expression.extra; return stmt; } + fillOptionalPropertiesForTSESLint(node) {} + cloneEstreeStringLiteral(node) { + const { + start, + end, + loc, + range, + raw, + value + } = node; + const cloned = Object.create(node.constructor.prototype); + cloned.type = "Literal"; + cloned.start = start; + cloned.end = end; + cloned.loc = loc; + cloned.range = range; + cloned.raw = raw; + cloned.value = value; + return cloned; + } initFunction(node, isAsync) { super.initFunction(node, isAsync); node.expression = false; @@ -592,8 +634,7 @@ var estree = superClass => class ESTreeParserMixin extends superClass { node = node; delete node.id; node.name = name; - node.type = "PrivateIdentifier"; - return node; + return this.castNodeTo(node, "PrivateIdentifier"); } isPrivateName(node) { { @@ -625,9 +666,7 @@ var estree = superClass => class ESTreeParserMixin extends superClass { let funcNode = this.startNode(); funcNode.kind = node.kind; funcNode = super.parseMethod(funcNode, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope); - funcNode.type = "FunctionExpression"; delete funcNode.kind; - node.value = funcNode; const { typeParameters } = node; @@ -636,10 +675,20 @@ var estree = superClass => class ESTreeParserMixin extends superClass { funcNode.typeParameters = typeParameters; this.resetStartLocationFromNode(funcNode, typeParameters); } + const valueNode = this.castNodeTo(funcNode, "FunctionExpression"); + node.value = valueNode; if (type === "ClassPrivateMethod") { node.computed = false; } - return this.finishNode(node, "MethodDefinition"); + if (type === "ObjectMethod") { + if (node.kind === "method") { + node.kind = "init"; + } + node.shorthand = false; + return this.finishNode(node, "Property"); + } else { + return this.finishNode(node, "MethodDefinition"); + } } nameIsConstructor(key) { if (key.type === "Literal") return key.value === "constructor"; @@ -653,7 +702,7 @@ var estree = superClass => class ESTreeParserMixin extends superClass { } } { - propertyNode.type = "PropertyDefinition"; + this.castNodeTo(propertyNode, "PropertyDefinition"); } return propertyNode; } @@ -665,7 +714,7 @@ var estree = superClass => class ESTreeParserMixin extends superClass { } } { - propertyNode.type = "PropertyDefinition"; + this.castNodeTo(propertyNode, "PropertyDefinition"); } propertyNode.computed = false; return propertyNode; @@ -677,28 +726,26 @@ var estree = superClass => class ESTreeParserMixin extends superClass { return accessorPropertyNode; } } - accessorPropertyNode.type = "AccessorProperty"; - return accessorPropertyNode; - } - parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) { - const node = super.parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor); - if (node) { - node.type = "Property"; - if (node.kind === "method") { - node.kind = "init"; - } - node.shorthand = false; + if (accessorPropertyNode.abstract && this.hasPlugin("typescript")) { + delete accessorPropertyNode.abstract; + this.castNodeTo(accessorPropertyNode, "TSAbstractAccessorProperty"); + } else { + this.castNodeTo(accessorPropertyNode, "AccessorProperty"); } - return node; + return accessorPropertyNode; } parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors) { const node = super.parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors); if (node) { node.kind = "init"; - node.type = "Property"; + this.castNodeTo(node, "Property"); } return node; } + finishObjectProperty(node) { + node.kind = "init"; + return this.finishNode(node, "Property"); + } isValidLVal(type, isUnparenthesizedInAssign, binding) { return type === "Property" ? "value" : super.isValidLVal(type, isUnparenthesizedInAssign, binding); } @@ -735,12 +782,16 @@ var estree = superClass => class ESTreeParserMixin extends superClass { const node = super.finishCallExpression(unfinished, optional); if (node.callee.type === "Import") { var _ref, _ref2; - node.type = "ImportExpression"; + this.castNodeTo(node, "ImportExpression"); node.source = node.arguments[0]; node.options = (_ref = node.arguments[1]) != null ? _ref : null; node.attributes = (_ref2 = node.arguments[1]) != null ? _ref2 : null; delete node.arguments; delete node.callee; + } else if (node.type === "OptionalCallExpression") { + this.castNodeTo(node, "CallExpression"); + } else { + node.optional = false; } return node; } @@ -759,7 +810,7 @@ var estree = superClass => class ESTreeParserMixin extends superClass { break; case "ExportNamedDeclaration": if (node.specifiers.length === 1 && node.specifiers[0].type === "ExportNamespaceSpecifier") { - node.type = "ExportAllDeclaration"; + this.castNodeTo(node, "ExportAllDeclaration"); node.exported = node.specifiers[0].exported; delete node.specifiers; } @@ -777,18 +828,18 @@ var estree = superClass => class ESTreeParserMixin extends superClass { } return node; } - parseSubscript(base, startLoc, noCalls, state) { - const node = super.parseSubscript(base, startLoc, noCalls, state); + stopParseSubscript(base, state) { + const node = super.stopParseSubscript(base, state); if (state.optionalChainMember) { - if (node.type === "OptionalMemberExpression" || node.type === "OptionalCallExpression") { - node.type = node.type.substring(8); - } - if (state.stop) { - const chain = this.startNodeAtNode(node); - chain.expression = node; - return this.finishNode(chain, "ChainExpression"); - } - } else if (node.type === "MemberExpression" || node.type === "CallExpression") { + return this.estreeParseChainExpression(node, base.loc.end); + } + return node; + } + parseMember(base, startLoc, state, computed, optional) { + const node = super.parseMember(base, startLoc, state, computed, optional); + if (node.type === "OptionalMemberExpression") { + this.castNodeTo(node, "MemberExpression"); + } else { node.optional = false; } return node; @@ -811,9 +862,30 @@ var estree = superClass => class ESTreeParserMixin extends superClass { isObjectMethod(node) { return node.type === "Property" && (node.method || node.kind === "get" || node.kind === "set"); } + castNodeTo(node, type) { + const result = super.castNodeTo(node, type); + this.fillOptionalPropertiesForTSESLint(result); + return result; + } + cloneIdentifier(node) { + const cloned = super.cloneIdentifier(node); + this.fillOptionalPropertiesForTSESLint(cloned); + return cloned; + } + cloneStringLiteral(node) { + if (node.type === "Literal") { + return this.cloneEstreeStringLiteral(node); + } + return super.cloneStringLiteral(node); + } finishNodeAt(node, type, endLoc) { return toESTreeLocation(super.finishNodeAt(node, type, endLoc)); } + finishNode(node, type) { + const result = super.finishNode(node, type); + this.fillOptionalPropertiesForTSESLint(result); + return result; + } resetStartLocation(node, startLoc) { super.resetStartLocation(node, startLoc); toESTreeLocation(node); @@ -1281,7 +1353,7 @@ const tt = { startsExpr }), placeholder: createToken("%%", { - startsExpr: true + startsExpr }), string: createToken("string", { startsExpr @@ -1304,10 +1376,10 @@ const tt = { eof: createToken("eof"), jsxName: createToken("jsxName"), jsxText: createToken("jsxText", { - beforeExpr: true + beforeExpr }), jsxTagStart: createToken("jsxTagStart", { - startsExpr: true + startsExpr }), jsxTagEnd: createToken("jsxTagEnd") }; @@ -1487,6 +1559,9 @@ class ScopeHandler { get allowDirectSuper() { return (this.currentThisScopeFlags() & 32) > 0; } + get allowNewTarget() { + return (this.currentThisScopeFlags() & 512) > 0; + } get inClass() { return (this.currentThisScopeFlags() & 64) > 0; } @@ -1502,7 +1577,7 @@ class ScopeHandler { if (flags & 128) { return true; } - if (flags & (387 | 64)) { + if (flags & (1667 | 64)) { return false; } } @@ -1510,6 +1585,9 @@ class ScopeHandler { get inNonArrowFunction() { return (this.currentThisScopeFlags() & 2) > 0; } + get inBareCaseStatement() { + return (this.currentScope().flags & 256) > 0; + } get treatFunctionsAsVar() { return this.treatFunctionsAsVarInScope(this.currentScope()); } @@ -1549,7 +1627,7 @@ class ScopeHandler { this.checkRedeclarationInScope(scope, name, bindingType, loc); scope.names.set(name, (scope.names.get(name) || 0) | 1); this.maybeExportDefined(scope, name); - if (scope.flags & 387) break; + if (scope.flags & 1667) break; } } if (this.parser.inModule && scope.flags & 1) { @@ -1596,7 +1674,7 @@ class ScopeHandler { const { flags } = this.scopeStack[i]; - if (flags & 387) { + if (flags & 1667) { return flags; } } @@ -1606,7 +1684,7 @@ class ScopeHandler { const { flags } = this.scopeStack[i]; - if (flags & (387 | 64) && !(flags & 4)) { + if (flags & (1667 | 64) && !(flags & 4)) { return flags; } } @@ -1646,6 +1724,3275 @@ class FlowScopeHandler extends ScopeHandler { } } } +const reservedTypes = new Set(["_", "any", "bool", "boolean", "empty", "extends", "false", "interface", "mixed", "null", "number", "static", "string", "true", "typeof", "void"]); +const FlowErrors = ParseErrorEnum`flow`({ + AmbiguousConditionalArrow: "Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.", + AmbiguousDeclareModuleKind: "Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.", + AssignReservedType: ({ + reservedType + }) => `Cannot overwrite reserved type ${reservedType}.`, + DeclareClassElement: "The `declare` modifier can only appear on class fields.", + DeclareClassFieldInitializer: "Initializers are not allowed in fields with the `declare` modifier.", + DuplicateDeclareModuleExports: "Duplicate `declare module.exports` statement.", + EnumBooleanMemberNotInitialized: ({ + memberName, + enumName + }) => `Boolean enum members need to be initialized. Use either \`${memberName} = true,\` or \`${memberName} = false,\` in enum \`${enumName}\`.`, + EnumDuplicateMemberName: ({ + memberName, + enumName + }) => `Enum member names need to be unique, but the name \`${memberName}\` has already been used before in enum \`${enumName}\`.`, + EnumInconsistentMemberValues: ({ + enumName + }) => `Enum \`${enumName}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`, + EnumInvalidExplicitType: ({ + invalidEnumType, + enumName + }) => `Enum type \`${invalidEnumType}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${enumName}\`.`, + EnumInvalidExplicitTypeUnknownSupplied: ({ + enumName + }) => `Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${enumName}\`.`, + EnumInvalidMemberInitializerPrimaryType: ({ + enumName, + memberName, + explicitType + }) => `Enum \`${enumName}\` has type \`${explicitType}\`, so the initializer of \`${memberName}\` needs to be a ${explicitType} literal.`, + EnumInvalidMemberInitializerSymbolType: ({ + enumName, + memberName + }) => `Symbol enum members cannot be initialized. Use \`${memberName},\` in enum \`${enumName}\`.`, + EnumInvalidMemberInitializerUnknownType: ({ + enumName, + memberName + }) => `The enum member initializer for \`${memberName}\` needs to be a literal (either a boolean, number, or string) in enum \`${enumName}\`.`, + EnumInvalidMemberName: ({ + enumName, + memberName, + suggestion + }) => `Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${memberName}\`, consider using \`${suggestion}\`, in enum \`${enumName}\`.`, + EnumNumberMemberNotInitialized: ({ + enumName, + memberName + }) => `Number enum members need to be initialized, e.g. \`${memberName} = 1\` in enum \`${enumName}\`.`, + EnumStringMemberInconsistentlyInitialized: ({ + enumName + }) => `String enum members need to consistently either all use initializers, or use no initializers, in enum \`${enumName}\`.`, + GetterMayNotHaveThisParam: "A getter cannot have a `this` parameter.", + ImportReflectionHasImportType: "An `import module` declaration can not use `type` or `typeof` keyword.", + ImportTypeShorthandOnlyInPureImport: "The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.", + InexactInsideExact: "Explicit inexact syntax cannot appear inside an explicit exact object type.", + InexactInsideNonObject: "Explicit inexact syntax cannot appear in class or interface definitions.", + InexactVariance: "Explicit inexact syntax cannot have variance.", + InvalidNonTypeImportInDeclareModule: "Imports within a `declare module` body must always be `import type` or `import typeof`.", + MissingTypeParamDefault: "Type parameter declaration needs a default, since a preceding type parameter declaration has a default.", + NestedDeclareModule: "`declare module` cannot be used inside another `declare module`.", + NestedFlowComment: "Cannot have a flow comment inside another flow comment.", + PatternIsOptional: Object.assign({ + message: "A binding pattern parameter cannot be optional in an implementation signature." + }, { + reasonCode: "OptionalBindingPattern" + }), + SetterMayNotHaveThisParam: "A setter cannot have a `this` parameter.", + SpreadVariance: "Spread properties cannot have variance.", + ThisParamAnnotationRequired: "A type annotation is required for the `this` parameter.", + ThisParamBannedInConstructor: "Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.", + ThisParamMayNotBeOptional: "The `this` parameter cannot be optional.", + ThisParamMustBeFirst: "The `this` parameter must be the first function parameter.", + ThisParamNoDefault: "The `this` parameter may not have a default value.", + TypeBeforeInitializer: "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.", + TypeCastInPattern: "The type cast expression is expected to be wrapped with parenthesis.", + UnexpectedExplicitInexactInObject: "Explicit inexact syntax must appear at the end of an inexact object.", + UnexpectedReservedType: ({ + reservedType + }) => `Unexpected reserved type ${reservedType}.`, + UnexpectedReservedUnderscore: "`_` is only allowed as a type argument to call or new.", + UnexpectedSpaceBetweenModuloChecks: "Spaces between `%` and `checks` are not allowed here.", + UnexpectedSpreadType: "Spread operator cannot appear in class or interface definitions.", + UnexpectedSubtractionOperand: 'Unexpected token, expected "number" or "bigint".', + UnexpectedTokenAfterTypeParameter: "Expected an arrow function after this type parameter declaration.", + UnexpectedTypeParameterBeforeAsyncArrowFunction: "Type parameters must come after the async keyword, e.g. instead of ` async () => {}`, use `async () => {}`.", + UnsupportedDeclareExportKind: ({ + unsupportedExportKind, + suggestion + }) => `\`declare export ${unsupportedExportKind}\` is not supported. Use \`${suggestion}\` instead.`, + UnsupportedStatementInDeclareModule: "Only declares and type imports are allowed inside declare module.", + UnterminatedFlowComment: "Unterminated flow-comment." +}); +function isEsModuleType(bodyElement) { + return bodyElement.type === "DeclareExportAllDeclaration" || bodyElement.type === "DeclareExportDeclaration" && (!bodyElement.declaration || bodyElement.declaration.type !== "TypeAlias" && bodyElement.declaration.type !== "InterfaceDeclaration"); +} +function hasTypeImportKind(node) { + return node.importKind === "type" || node.importKind === "typeof"; +} +const exportSuggestions = { + const: "declare export var", + let: "declare export var", + type: "export type", + interface: "export interface" +}; +function partition(list, test) { + const list1 = []; + const list2 = []; + for (let i = 0; i < list.length; i++) { + (test(list[i], i, list) ? list1 : list2).push(list[i]); + } + return [list1, list2]; +} +const FLOW_PRAGMA_REGEX = /\*?\s*@((?:no)?flow)\b/; +var flow = superClass => class FlowParserMixin extends superClass { + constructor(...args) { + super(...args); + this.flowPragma = undefined; + } + getScopeHandler() { + return FlowScopeHandler; + } + shouldParseTypes() { + return this.getPluginOption("flow", "all") || this.flowPragma === "flow"; + } + finishToken(type, val) { + if (type !== 134 && type !== 13 && type !== 28) { + if (this.flowPragma === undefined) { + this.flowPragma = null; + } + } + super.finishToken(type, val); + } + addComment(comment) { + if (this.flowPragma === undefined) { + const matches = FLOW_PRAGMA_REGEX.exec(comment.value); + if (!matches) ;else if (matches[1] === "flow") { + this.flowPragma = "flow"; + } else if (matches[1] === "noflow") { + this.flowPragma = "noflow"; + } else { + throw new Error("Unexpected flow pragma"); + } + } + super.addComment(comment); + } + flowParseTypeInitialiser(tok) { + const oldInType = this.state.inType; + this.state.inType = true; + this.expect(tok || 14); + const type = this.flowParseType(); + this.state.inType = oldInType; + return type; + } + flowParsePredicate() { + const node = this.startNode(); + const moduloLoc = this.state.startLoc; + this.next(); + this.expectContextual(110); + if (this.state.lastTokStartLoc.index > moduloLoc.index + 1) { + this.raise(FlowErrors.UnexpectedSpaceBetweenModuloChecks, moduloLoc); + } + if (this.eat(10)) { + node.value = super.parseExpression(); + this.expect(11); + return this.finishNode(node, "DeclaredPredicate"); + } else { + return this.finishNode(node, "InferredPredicate"); + } + } + flowParseTypeAndPredicateInitialiser() { + const oldInType = this.state.inType; + this.state.inType = true; + this.expect(14); + let type = null; + let predicate = null; + if (this.match(54)) { + this.state.inType = oldInType; + predicate = this.flowParsePredicate(); + } else { + type = this.flowParseType(); + this.state.inType = oldInType; + if (this.match(54)) { + predicate = this.flowParsePredicate(); + } + } + return [type, predicate]; + } + flowParseDeclareClass(node) { + this.next(); + this.flowParseInterfaceish(node, true); + return this.finishNode(node, "DeclareClass"); + } + flowParseDeclareFunction(node) { + this.next(); + const id = node.id = this.parseIdentifier(); + const typeNode = this.startNode(); + const typeContainer = this.startNode(); + if (this.match(47)) { + typeNode.typeParameters = this.flowParseTypeParameterDeclaration(); + } else { + typeNode.typeParameters = null; + } + this.expect(10); + const tmp = this.flowParseFunctionTypeParams(); + typeNode.params = tmp.params; + typeNode.rest = tmp.rest; + typeNode.this = tmp._this; + this.expect(11); + [typeNode.returnType, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); + typeContainer.typeAnnotation = this.finishNode(typeNode, "FunctionTypeAnnotation"); + id.typeAnnotation = this.finishNode(typeContainer, "TypeAnnotation"); + this.resetEndLocation(id); + this.semicolon(); + this.scope.declareName(node.id.name, 2048, node.id.loc.start); + return this.finishNode(node, "DeclareFunction"); + } + flowParseDeclare(node, insideModule) { + if (this.match(80)) { + return this.flowParseDeclareClass(node); + } else if (this.match(68)) { + return this.flowParseDeclareFunction(node); + } else if (this.match(74)) { + return this.flowParseDeclareVariable(node); + } else if (this.eatContextual(127)) { + if (this.match(16)) { + return this.flowParseDeclareModuleExports(node); + } else { + if (insideModule) { + this.raise(FlowErrors.NestedDeclareModule, this.state.lastTokStartLoc); + } + return this.flowParseDeclareModule(node); + } + } else if (this.isContextual(130)) { + return this.flowParseDeclareTypeAlias(node); + } else if (this.isContextual(131)) { + return this.flowParseDeclareOpaqueType(node); + } else if (this.isContextual(129)) { + return this.flowParseDeclareInterface(node); + } else if (this.match(82)) { + return this.flowParseDeclareExportDeclaration(node, insideModule); + } else { + this.unexpected(); + } + } + flowParseDeclareVariable(node) { + this.next(); + node.id = this.flowParseTypeAnnotatableIdentifier(true); + this.scope.declareName(node.id.name, 5, node.id.loc.start); + this.semicolon(); + return this.finishNode(node, "DeclareVariable"); + } + flowParseDeclareModule(node) { + this.scope.enter(0); + if (this.match(134)) { + node.id = super.parseExprAtom(); + } else { + node.id = this.parseIdentifier(); + } + const bodyNode = node.body = this.startNode(); + const body = bodyNode.body = []; + this.expect(5); + while (!this.match(8)) { + let bodyNode = this.startNode(); + if (this.match(83)) { + this.next(); + if (!this.isContextual(130) && !this.match(87)) { + this.raise(FlowErrors.InvalidNonTypeImportInDeclareModule, this.state.lastTokStartLoc); + } + super.parseImport(bodyNode); + } else { + this.expectContextual(125, FlowErrors.UnsupportedStatementInDeclareModule); + bodyNode = this.flowParseDeclare(bodyNode, true); + } + body.push(bodyNode); + } + this.scope.exit(); + this.expect(8); + this.finishNode(bodyNode, "BlockStatement"); + let kind = null; + let hasModuleExport = false; + body.forEach(bodyElement => { + if (isEsModuleType(bodyElement)) { + if (kind === "CommonJS") { + this.raise(FlowErrors.AmbiguousDeclareModuleKind, bodyElement); + } + kind = "ES"; + } else if (bodyElement.type === "DeclareModuleExports") { + if (hasModuleExport) { + this.raise(FlowErrors.DuplicateDeclareModuleExports, bodyElement); + } + if (kind === "ES") { + this.raise(FlowErrors.AmbiguousDeclareModuleKind, bodyElement); + } + kind = "CommonJS"; + hasModuleExport = true; + } + }); + node.kind = kind || "CommonJS"; + return this.finishNode(node, "DeclareModule"); + } + flowParseDeclareExportDeclaration(node, insideModule) { + this.expect(82); + if (this.eat(65)) { + if (this.match(68) || this.match(80)) { + node.declaration = this.flowParseDeclare(this.startNode()); + } else { + node.declaration = this.flowParseType(); + this.semicolon(); + } + node.default = true; + return this.finishNode(node, "DeclareExportDeclaration"); + } else { + if (this.match(75) || this.isLet() || (this.isContextual(130) || this.isContextual(129)) && !insideModule) { + const label = this.state.value; + throw this.raise(FlowErrors.UnsupportedDeclareExportKind, this.state.startLoc, { + unsupportedExportKind: label, + suggestion: exportSuggestions[label] + }); + } + if (this.match(74) || this.match(68) || this.match(80) || this.isContextual(131)) { + node.declaration = this.flowParseDeclare(this.startNode()); + node.default = false; + return this.finishNode(node, "DeclareExportDeclaration"); + } else if (this.match(55) || this.match(5) || this.isContextual(129) || this.isContextual(130) || this.isContextual(131)) { + node = this.parseExport(node, null); + if (node.type === "ExportNamedDeclaration") { + node.default = false; + delete node.exportKind; + return this.castNodeTo(node, "DeclareExportDeclaration"); + } else { + return this.castNodeTo(node, "DeclareExportAllDeclaration"); + } + } + } + this.unexpected(); + } + flowParseDeclareModuleExports(node) { + this.next(); + this.expectContextual(111); + node.typeAnnotation = this.flowParseTypeAnnotation(); + this.semicolon(); + return this.finishNode(node, "DeclareModuleExports"); + } + flowParseDeclareTypeAlias(node) { + this.next(); + const finished = this.flowParseTypeAlias(node); + this.castNodeTo(finished, "DeclareTypeAlias"); + return finished; + } + flowParseDeclareOpaqueType(node) { + this.next(); + const finished = this.flowParseOpaqueType(node, true); + this.castNodeTo(finished, "DeclareOpaqueType"); + return finished; + } + flowParseDeclareInterface(node) { + this.next(); + this.flowParseInterfaceish(node, false); + return this.finishNode(node, "DeclareInterface"); + } + flowParseInterfaceish(node, isClass) { + node.id = this.flowParseRestrictedIdentifier(!isClass, true); + this.scope.declareName(node.id.name, isClass ? 17 : 8201, node.id.loc.start); + if (this.match(47)) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } else { + node.typeParameters = null; + } + node.extends = []; + if (this.eat(81)) { + do { + node.extends.push(this.flowParseInterfaceExtends()); + } while (!isClass && this.eat(12)); + } + if (isClass) { + node.implements = []; + node.mixins = []; + if (this.eatContextual(117)) { + do { + node.mixins.push(this.flowParseInterfaceExtends()); + } while (this.eat(12)); + } + if (this.eatContextual(113)) { + do { + node.implements.push(this.flowParseInterfaceExtends()); + } while (this.eat(12)); + } + } + node.body = this.flowParseObjectType({ + allowStatic: isClass, + allowExact: false, + allowSpread: false, + allowProto: isClass, + allowInexact: false + }); + } + flowParseInterfaceExtends() { + const node = this.startNode(); + node.id = this.flowParseQualifiedTypeIdentifier(); + if (this.match(47)) { + node.typeParameters = this.flowParseTypeParameterInstantiation(); + } else { + node.typeParameters = null; + } + return this.finishNode(node, "InterfaceExtends"); + } + flowParseInterface(node) { + this.flowParseInterfaceish(node, false); + return this.finishNode(node, "InterfaceDeclaration"); + } + checkNotUnderscore(word) { + if (word === "_") { + this.raise(FlowErrors.UnexpectedReservedUnderscore, this.state.startLoc); + } + } + checkReservedType(word, startLoc, declaration) { + if (!reservedTypes.has(word)) return; + this.raise(declaration ? FlowErrors.AssignReservedType : FlowErrors.UnexpectedReservedType, startLoc, { + reservedType: word + }); + } + flowParseRestrictedIdentifier(liberal, declaration) { + this.checkReservedType(this.state.value, this.state.startLoc, declaration); + return this.parseIdentifier(liberal); + } + flowParseTypeAlias(node) { + node.id = this.flowParseRestrictedIdentifier(false, true); + this.scope.declareName(node.id.name, 8201, node.id.loc.start); + if (this.match(47)) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } else { + node.typeParameters = null; + } + node.right = this.flowParseTypeInitialiser(29); + this.semicolon(); + return this.finishNode(node, "TypeAlias"); + } + flowParseOpaqueType(node, declare) { + this.expectContextual(130); + node.id = this.flowParseRestrictedIdentifier(true, true); + this.scope.declareName(node.id.name, 8201, node.id.loc.start); + if (this.match(47)) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } else { + node.typeParameters = null; + } + node.supertype = null; + if (this.match(14)) { + node.supertype = this.flowParseTypeInitialiser(14); + } + node.impltype = null; + if (!declare) { + node.impltype = this.flowParseTypeInitialiser(29); + } + this.semicolon(); + return this.finishNode(node, "OpaqueType"); + } + flowParseTypeParameter(requireDefault = false) { + const nodeStartLoc = this.state.startLoc; + const node = this.startNode(); + const variance = this.flowParseVariance(); + const ident = this.flowParseTypeAnnotatableIdentifier(); + node.name = ident.name; + node.variance = variance; + node.bound = ident.typeAnnotation; + if (this.match(29)) { + this.eat(29); + node.default = this.flowParseType(); + } else { + if (requireDefault) { + this.raise(FlowErrors.MissingTypeParamDefault, nodeStartLoc); + } + } + return this.finishNode(node, "TypeParameter"); + } + flowParseTypeParameterDeclaration() { + const oldInType = this.state.inType; + const node = this.startNode(); + node.params = []; + this.state.inType = true; + if (this.match(47) || this.match(143)) { + this.next(); + } else { + this.unexpected(); + } + let defaultRequired = false; + do { + const typeParameter = this.flowParseTypeParameter(defaultRequired); + node.params.push(typeParameter); + if (typeParameter.default) { + defaultRequired = true; + } + if (!this.match(48)) { + this.expect(12); + } + } while (!this.match(48)); + this.expect(48); + this.state.inType = oldInType; + return this.finishNode(node, "TypeParameterDeclaration"); + } + flowInTopLevelContext(cb) { + if (this.curContext() !== types.brace) { + const oldContext = this.state.context; + this.state.context = [oldContext[0]]; + try { + return cb(); + } finally { + this.state.context = oldContext; + } + } else { + return cb(); + } + } + flowParseTypeParameterInstantiationInExpression() { + if (this.reScan_lt() !== 47) return; + return this.flowParseTypeParameterInstantiation(); + } + flowParseTypeParameterInstantiation() { + const node = this.startNode(); + const oldInType = this.state.inType; + this.state.inType = true; + node.params = []; + this.flowInTopLevelContext(() => { + this.expect(47); + const oldNoAnonFunctionType = this.state.noAnonFunctionType; + this.state.noAnonFunctionType = false; + while (!this.match(48)) { + node.params.push(this.flowParseType()); + if (!this.match(48)) { + this.expect(12); + } + } + this.state.noAnonFunctionType = oldNoAnonFunctionType; + }); + this.state.inType = oldInType; + if (!this.state.inType && this.curContext() === types.brace) { + this.reScan_lt_gt(); + } + this.expect(48); + return this.finishNode(node, "TypeParameterInstantiation"); + } + flowParseTypeParameterInstantiationCallOrNew() { + if (this.reScan_lt() !== 47) return; + const node = this.startNode(); + const oldInType = this.state.inType; + node.params = []; + this.state.inType = true; + this.expect(47); + while (!this.match(48)) { + node.params.push(this.flowParseTypeOrImplicitInstantiation()); + if (!this.match(48)) { + this.expect(12); + } + } + this.expect(48); + this.state.inType = oldInType; + return this.finishNode(node, "TypeParameterInstantiation"); + } + flowParseInterfaceType() { + const node = this.startNode(); + this.expectContextual(129); + node.extends = []; + if (this.eat(81)) { + do { + node.extends.push(this.flowParseInterfaceExtends()); + } while (this.eat(12)); + } + node.body = this.flowParseObjectType({ + allowStatic: false, + allowExact: false, + allowSpread: false, + allowProto: false, + allowInexact: false + }); + return this.finishNode(node, "InterfaceTypeAnnotation"); + } + flowParseObjectPropertyKey() { + return this.match(135) || this.match(134) ? super.parseExprAtom() : this.parseIdentifier(true); + } + flowParseObjectTypeIndexer(node, isStatic, variance) { + node.static = isStatic; + if (this.lookahead().type === 14) { + node.id = this.flowParseObjectPropertyKey(); + node.key = this.flowParseTypeInitialiser(); + } else { + node.id = null; + node.key = this.flowParseType(); + } + this.expect(3); + node.value = this.flowParseTypeInitialiser(); + node.variance = variance; + return this.finishNode(node, "ObjectTypeIndexer"); + } + flowParseObjectTypeInternalSlot(node, isStatic) { + node.static = isStatic; + node.id = this.flowParseObjectPropertyKey(); + this.expect(3); + this.expect(3); + if (this.match(47) || this.match(10)) { + node.method = true; + node.optional = false; + node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.loc.start)); + } else { + node.method = false; + if (this.eat(17)) { + node.optional = true; + } + node.value = this.flowParseTypeInitialiser(); + } + return this.finishNode(node, "ObjectTypeInternalSlot"); + } + flowParseObjectTypeMethodish(node) { + node.params = []; + node.rest = null; + node.typeParameters = null; + node.this = null; + if (this.match(47)) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } + this.expect(10); + if (this.match(78)) { + node.this = this.flowParseFunctionTypeParam(true); + node.this.name = null; + if (!this.match(11)) { + this.expect(12); + } + } + while (!this.match(11) && !this.match(21)) { + node.params.push(this.flowParseFunctionTypeParam(false)); + if (!this.match(11)) { + this.expect(12); + } + } + if (this.eat(21)) { + node.rest = this.flowParseFunctionTypeParam(false); + } + this.expect(11); + node.returnType = this.flowParseTypeInitialiser(); + return this.finishNode(node, "FunctionTypeAnnotation"); + } + flowParseObjectTypeCallProperty(node, isStatic) { + const valueNode = this.startNode(); + node.static = isStatic; + node.value = this.flowParseObjectTypeMethodish(valueNode); + return this.finishNode(node, "ObjectTypeCallProperty"); + } + flowParseObjectType({ + allowStatic, + allowExact, + allowSpread, + allowProto, + allowInexact + }) { + const oldInType = this.state.inType; + this.state.inType = true; + const nodeStart = this.startNode(); + nodeStart.callProperties = []; + nodeStart.properties = []; + nodeStart.indexers = []; + nodeStart.internalSlots = []; + let endDelim; + let exact; + let inexact = false; + if (allowExact && this.match(6)) { + this.expect(6); + endDelim = 9; + exact = true; + } else { + this.expect(5); + endDelim = 8; + exact = false; + } + nodeStart.exact = exact; + while (!this.match(endDelim)) { + let isStatic = false; + let protoStartLoc = null; + let inexactStartLoc = null; + const node = this.startNode(); + if (allowProto && this.isContextual(118)) { + const lookahead = this.lookahead(); + if (lookahead.type !== 14 && lookahead.type !== 17) { + this.next(); + protoStartLoc = this.state.startLoc; + allowStatic = false; + } + } + if (allowStatic && this.isContextual(106)) { + const lookahead = this.lookahead(); + if (lookahead.type !== 14 && lookahead.type !== 17) { + this.next(); + isStatic = true; + } + } + const variance = this.flowParseVariance(); + if (this.eat(0)) { + if (protoStartLoc != null) { + this.unexpected(protoStartLoc); + } + if (this.eat(0)) { + if (variance) { + this.unexpected(variance.loc.start); + } + nodeStart.internalSlots.push(this.flowParseObjectTypeInternalSlot(node, isStatic)); + } else { + nodeStart.indexers.push(this.flowParseObjectTypeIndexer(node, isStatic, variance)); + } + } else if (this.match(10) || this.match(47)) { + if (protoStartLoc != null) { + this.unexpected(protoStartLoc); + } + if (variance) { + this.unexpected(variance.loc.start); + } + nodeStart.callProperties.push(this.flowParseObjectTypeCallProperty(node, isStatic)); + } else { + let kind = "init"; + if (this.isContextual(99) || this.isContextual(104)) { + const lookahead = this.lookahead(); + if (tokenIsLiteralPropertyName(lookahead.type)) { + kind = this.state.value; + this.next(); + } + } + const propOrInexact = this.flowParseObjectTypeProperty(node, isStatic, protoStartLoc, variance, kind, allowSpread, allowInexact != null ? allowInexact : !exact); + if (propOrInexact === null) { + inexact = true; + inexactStartLoc = this.state.lastTokStartLoc; + } else { + nodeStart.properties.push(propOrInexact); + } + } + this.flowObjectTypeSemicolon(); + if (inexactStartLoc && !this.match(8) && !this.match(9)) { + this.raise(FlowErrors.UnexpectedExplicitInexactInObject, inexactStartLoc); + } + } + this.expect(endDelim); + if (allowSpread) { + nodeStart.inexact = inexact; + } + const out = this.finishNode(nodeStart, "ObjectTypeAnnotation"); + this.state.inType = oldInType; + return out; + } + flowParseObjectTypeProperty(node, isStatic, protoStartLoc, variance, kind, allowSpread, allowInexact) { + if (this.eat(21)) { + const isInexactToken = this.match(12) || this.match(13) || this.match(8) || this.match(9); + if (isInexactToken) { + if (!allowSpread) { + this.raise(FlowErrors.InexactInsideNonObject, this.state.lastTokStartLoc); + } else if (!allowInexact) { + this.raise(FlowErrors.InexactInsideExact, this.state.lastTokStartLoc); + } + if (variance) { + this.raise(FlowErrors.InexactVariance, variance); + } + return null; + } + if (!allowSpread) { + this.raise(FlowErrors.UnexpectedSpreadType, this.state.lastTokStartLoc); + } + if (protoStartLoc != null) { + this.unexpected(protoStartLoc); + } + if (variance) { + this.raise(FlowErrors.SpreadVariance, variance); + } + node.argument = this.flowParseType(); + return this.finishNode(node, "ObjectTypeSpreadProperty"); + } else { + node.key = this.flowParseObjectPropertyKey(); + node.static = isStatic; + node.proto = protoStartLoc != null; + node.kind = kind; + let optional = false; + if (this.match(47) || this.match(10)) { + node.method = true; + if (protoStartLoc != null) { + this.unexpected(protoStartLoc); + } + if (variance) { + this.unexpected(variance.loc.start); + } + node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.loc.start)); + if (kind === "get" || kind === "set") { + this.flowCheckGetterSetterParams(node); + } + if (!allowSpread && node.key.name === "constructor" && node.value.this) { + this.raise(FlowErrors.ThisParamBannedInConstructor, node.value.this); + } + } else { + if (kind !== "init") this.unexpected(); + node.method = false; + if (this.eat(17)) { + optional = true; + } + node.value = this.flowParseTypeInitialiser(); + node.variance = variance; + } + node.optional = optional; + return this.finishNode(node, "ObjectTypeProperty"); + } + } + flowCheckGetterSetterParams(property) { + const paramCount = property.kind === "get" ? 0 : 1; + const length = property.value.params.length + (property.value.rest ? 1 : 0); + if (property.value.this) { + this.raise(property.kind === "get" ? FlowErrors.GetterMayNotHaveThisParam : FlowErrors.SetterMayNotHaveThisParam, property.value.this); + } + if (length !== paramCount) { + this.raise(property.kind === "get" ? Errors.BadGetterArity : Errors.BadSetterArity, property); + } + if (property.kind === "set" && property.value.rest) { + this.raise(Errors.BadSetterRestParameter, property); + } + } + flowObjectTypeSemicolon() { + if (!this.eat(13) && !this.eat(12) && !this.match(8) && !this.match(9)) { + this.unexpected(); + } + } + flowParseQualifiedTypeIdentifier(startLoc, id) { + startLoc != null ? startLoc : startLoc = this.state.startLoc; + let node = id || this.flowParseRestrictedIdentifier(true); + while (this.eat(16)) { + const node2 = this.startNodeAt(startLoc); + node2.qualification = node; + node2.id = this.flowParseRestrictedIdentifier(true); + node = this.finishNode(node2, "QualifiedTypeIdentifier"); + } + return node; + } + flowParseGenericType(startLoc, id) { + const node = this.startNodeAt(startLoc); + node.typeParameters = null; + node.id = this.flowParseQualifiedTypeIdentifier(startLoc, id); + if (this.match(47)) { + node.typeParameters = this.flowParseTypeParameterInstantiation(); + } + return this.finishNode(node, "GenericTypeAnnotation"); + } + flowParseTypeofType() { + const node = this.startNode(); + this.expect(87); + node.argument = this.flowParsePrimaryType(); + return this.finishNode(node, "TypeofTypeAnnotation"); + } + flowParseTupleType() { + const node = this.startNode(); + node.types = []; + this.expect(0); + while (this.state.pos < this.length && !this.match(3)) { + node.types.push(this.flowParseType()); + if (this.match(3)) break; + this.expect(12); + } + this.expect(3); + return this.finishNode(node, "TupleTypeAnnotation"); + } + flowParseFunctionTypeParam(first) { + let name = null; + let optional = false; + let typeAnnotation = null; + const node = this.startNode(); + const lh = this.lookahead(); + const isThis = this.state.type === 78; + if (lh.type === 14 || lh.type === 17) { + if (isThis && !first) { + this.raise(FlowErrors.ThisParamMustBeFirst, node); + } + name = this.parseIdentifier(isThis); + if (this.eat(17)) { + optional = true; + if (isThis) { + this.raise(FlowErrors.ThisParamMayNotBeOptional, node); + } + } + typeAnnotation = this.flowParseTypeInitialiser(); + } else { + typeAnnotation = this.flowParseType(); + } + node.name = name; + node.optional = optional; + node.typeAnnotation = typeAnnotation; + return this.finishNode(node, "FunctionTypeParam"); + } + reinterpretTypeAsFunctionTypeParam(type) { + const node = this.startNodeAt(type.loc.start); + node.name = null; + node.optional = false; + node.typeAnnotation = type; + return this.finishNode(node, "FunctionTypeParam"); + } + flowParseFunctionTypeParams(params = []) { + let rest = null; + let _this = null; + if (this.match(78)) { + _this = this.flowParseFunctionTypeParam(true); + _this.name = null; + if (!this.match(11)) { + this.expect(12); + } + } + while (!this.match(11) && !this.match(21)) { + params.push(this.flowParseFunctionTypeParam(false)); + if (!this.match(11)) { + this.expect(12); + } + } + if (this.eat(21)) { + rest = this.flowParseFunctionTypeParam(false); + } + return { + params, + rest, + _this + }; + } + flowIdentToTypeAnnotation(startLoc, node, id) { + switch (id.name) { + case "any": + return this.finishNode(node, "AnyTypeAnnotation"); + case "bool": + case "boolean": + return this.finishNode(node, "BooleanTypeAnnotation"); + case "mixed": + return this.finishNode(node, "MixedTypeAnnotation"); + case "empty": + return this.finishNode(node, "EmptyTypeAnnotation"); + case "number": + return this.finishNode(node, "NumberTypeAnnotation"); + case "string": + return this.finishNode(node, "StringTypeAnnotation"); + case "symbol": + return this.finishNode(node, "SymbolTypeAnnotation"); + default: + this.checkNotUnderscore(id.name); + return this.flowParseGenericType(startLoc, id); + } + } + flowParsePrimaryType() { + const startLoc = this.state.startLoc; + const node = this.startNode(); + let tmp; + let type; + let isGroupedType = false; + const oldNoAnonFunctionType = this.state.noAnonFunctionType; + switch (this.state.type) { + case 5: + return this.flowParseObjectType({ + allowStatic: false, + allowExact: false, + allowSpread: true, + allowProto: false, + allowInexact: true + }); + case 6: + return this.flowParseObjectType({ + allowStatic: false, + allowExact: true, + allowSpread: true, + allowProto: false, + allowInexact: false + }); + case 0: + this.state.noAnonFunctionType = false; + type = this.flowParseTupleType(); + this.state.noAnonFunctionType = oldNoAnonFunctionType; + return type; + case 47: + { + const node = this.startNode(); + node.typeParameters = this.flowParseTypeParameterDeclaration(); + this.expect(10); + tmp = this.flowParseFunctionTypeParams(); + node.params = tmp.params; + node.rest = tmp.rest; + node.this = tmp._this; + this.expect(11); + this.expect(19); + node.returnType = this.flowParseType(); + return this.finishNode(node, "FunctionTypeAnnotation"); + } + case 10: + { + const node = this.startNode(); + this.next(); + if (!this.match(11) && !this.match(21)) { + if (tokenIsIdentifier(this.state.type) || this.match(78)) { + const token = this.lookahead().type; + isGroupedType = token !== 17 && token !== 14; + } else { + isGroupedType = true; + } + } + if (isGroupedType) { + this.state.noAnonFunctionType = false; + type = this.flowParseType(); + this.state.noAnonFunctionType = oldNoAnonFunctionType; + if (this.state.noAnonFunctionType || !(this.match(12) || this.match(11) && this.lookahead().type === 19)) { + this.expect(11); + return type; + } else { + this.eat(12); + } + } + if (type) { + tmp = this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(type)]); + } else { + tmp = this.flowParseFunctionTypeParams(); + } + node.params = tmp.params; + node.rest = tmp.rest; + node.this = tmp._this; + this.expect(11); + this.expect(19); + node.returnType = this.flowParseType(); + node.typeParameters = null; + return this.finishNode(node, "FunctionTypeAnnotation"); + } + case 134: + return this.parseLiteral(this.state.value, "StringLiteralTypeAnnotation"); + case 85: + case 86: + node.value = this.match(85); + this.next(); + return this.finishNode(node, "BooleanLiteralTypeAnnotation"); + case 53: + if (this.state.value === "-") { + this.next(); + if (this.match(135)) { + return this.parseLiteralAtNode(-this.state.value, "NumberLiteralTypeAnnotation", node); + } + if (this.match(136)) { + return this.parseLiteralAtNode(-this.state.value, "BigIntLiteralTypeAnnotation", node); + } + throw this.raise(FlowErrors.UnexpectedSubtractionOperand, this.state.startLoc); + } + this.unexpected(); + return; + case 135: + return this.parseLiteral(this.state.value, "NumberLiteralTypeAnnotation"); + case 136: + return this.parseLiteral(this.state.value, "BigIntLiteralTypeAnnotation"); + case 88: + this.next(); + return this.finishNode(node, "VoidTypeAnnotation"); + case 84: + this.next(); + return this.finishNode(node, "NullLiteralTypeAnnotation"); + case 78: + this.next(); + return this.finishNode(node, "ThisTypeAnnotation"); + case 55: + this.next(); + return this.finishNode(node, "ExistsTypeAnnotation"); + case 87: + return this.flowParseTypeofType(); + default: + if (tokenIsKeyword(this.state.type)) { + const label = tokenLabelName(this.state.type); + this.next(); + return super.createIdentifier(node, label); + } else if (tokenIsIdentifier(this.state.type)) { + if (this.isContextual(129)) { + return this.flowParseInterfaceType(); + } + return this.flowIdentToTypeAnnotation(startLoc, node, this.parseIdentifier()); + } + } + this.unexpected(); + } + flowParsePostfixType() { + const startLoc = this.state.startLoc; + let type = this.flowParsePrimaryType(); + let seenOptionalIndexedAccess = false; + while ((this.match(0) || this.match(18)) && !this.canInsertSemicolon()) { + const node = this.startNodeAt(startLoc); + const optional = this.eat(18); + seenOptionalIndexedAccess = seenOptionalIndexedAccess || optional; + this.expect(0); + if (!optional && this.match(3)) { + node.elementType = type; + this.next(); + type = this.finishNode(node, "ArrayTypeAnnotation"); + } else { + node.objectType = type; + node.indexType = this.flowParseType(); + this.expect(3); + if (seenOptionalIndexedAccess) { + node.optional = optional; + type = this.finishNode(node, "OptionalIndexedAccessType"); + } else { + type = this.finishNode(node, "IndexedAccessType"); + } + } + } + return type; + } + flowParsePrefixType() { + const node = this.startNode(); + if (this.eat(17)) { + node.typeAnnotation = this.flowParsePrefixType(); + return this.finishNode(node, "NullableTypeAnnotation"); + } else { + return this.flowParsePostfixType(); + } + } + flowParseAnonFunctionWithoutParens() { + const param = this.flowParsePrefixType(); + if (!this.state.noAnonFunctionType && this.eat(19)) { + const node = this.startNodeAt(param.loc.start); + node.params = [this.reinterpretTypeAsFunctionTypeParam(param)]; + node.rest = null; + node.this = null; + node.returnType = this.flowParseType(); + node.typeParameters = null; + return this.finishNode(node, "FunctionTypeAnnotation"); + } + return param; + } + flowParseIntersectionType() { + const node = this.startNode(); + this.eat(45); + const type = this.flowParseAnonFunctionWithoutParens(); + node.types = [type]; + while (this.eat(45)) { + node.types.push(this.flowParseAnonFunctionWithoutParens()); + } + return node.types.length === 1 ? type : this.finishNode(node, "IntersectionTypeAnnotation"); + } + flowParseUnionType() { + const node = this.startNode(); + this.eat(43); + const type = this.flowParseIntersectionType(); + node.types = [type]; + while (this.eat(43)) { + node.types.push(this.flowParseIntersectionType()); + } + return node.types.length === 1 ? type : this.finishNode(node, "UnionTypeAnnotation"); + } + flowParseType() { + const oldInType = this.state.inType; + this.state.inType = true; + const type = this.flowParseUnionType(); + this.state.inType = oldInType; + return type; + } + flowParseTypeOrImplicitInstantiation() { + if (this.state.type === 132 && this.state.value === "_") { + const startLoc = this.state.startLoc; + const node = this.parseIdentifier(); + return this.flowParseGenericType(startLoc, node); + } else { + return this.flowParseType(); + } + } + flowParseTypeAnnotation() { + const node = this.startNode(); + node.typeAnnotation = this.flowParseTypeInitialiser(); + return this.finishNode(node, "TypeAnnotation"); + } + flowParseTypeAnnotatableIdentifier(allowPrimitiveOverride) { + const ident = allowPrimitiveOverride ? this.parseIdentifier() : this.flowParseRestrictedIdentifier(); + if (this.match(14)) { + ident.typeAnnotation = this.flowParseTypeAnnotation(); + this.resetEndLocation(ident); + } + return ident; + } + typeCastToParameter(node) { + node.expression.typeAnnotation = node.typeAnnotation; + this.resetEndLocation(node.expression, node.typeAnnotation.loc.end); + return node.expression; + } + flowParseVariance() { + let variance = null; + if (this.match(53)) { + variance = this.startNode(); + if (this.state.value === "+") { + variance.kind = "plus"; + } else { + variance.kind = "minus"; + } + this.next(); + return this.finishNode(variance, "Variance"); + } + return variance; + } + parseFunctionBody(node, allowExpressionBody, isMethod = false) { + if (allowExpressionBody) { + this.forwardNoArrowParamsConversionAt(node, () => super.parseFunctionBody(node, true, isMethod)); + return; + } + super.parseFunctionBody(node, false, isMethod); + } + parseFunctionBodyAndFinish(node, type, isMethod = false) { + if (this.match(14)) { + const typeNode = this.startNode(); + [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); + node.returnType = typeNode.typeAnnotation ? this.finishNode(typeNode, "TypeAnnotation") : null; + } + return super.parseFunctionBodyAndFinish(node, type, isMethod); + } + parseStatementLike(flags) { + if (this.state.strict && this.isContextual(129)) { + const lookahead = this.lookahead(); + if (tokenIsKeywordOrIdentifier(lookahead.type)) { + const node = this.startNode(); + this.next(); + return this.flowParseInterface(node); + } + } else if (this.isContextual(126)) { + const node = this.startNode(); + this.next(); + return this.flowParseEnumDeclaration(node); + } + const stmt = super.parseStatementLike(flags); + if (this.flowPragma === undefined && !this.isValidDirective(stmt)) { + this.flowPragma = null; + } + return stmt; + } + parseExpressionStatement(node, expr, decorators) { + if (expr.type === "Identifier") { + if (expr.name === "declare") { + if (this.match(80) || tokenIsIdentifier(this.state.type) || this.match(68) || this.match(74) || this.match(82)) { + return this.flowParseDeclare(node); + } + } else if (tokenIsIdentifier(this.state.type)) { + if (expr.name === "interface") { + return this.flowParseInterface(node); + } else if (expr.name === "type") { + return this.flowParseTypeAlias(node); + } else if (expr.name === "opaque") { + return this.flowParseOpaqueType(node, false); + } + } + } + return super.parseExpressionStatement(node, expr, decorators); + } + shouldParseExportDeclaration() { + const { + type + } = this.state; + if (type === 126 || tokenIsFlowInterfaceOrTypeOrOpaque(type)) { + return !this.state.containsEsc; + } + return super.shouldParseExportDeclaration(); + } + isExportDefaultSpecifier() { + const { + type + } = this.state; + if (type === 126 || tokenIsFlowInterfaceOrTypeOrOpaque(type)) { + return this.state.containsEsc; + } + return super.isExportDefaultSpecifier(); + } + parseExportDefaultExpression() { + if (this.isContextual(126)) { + const node = this.startNode(); + this.next(); + return this.flowParseEnumDeclaration(node); + } + return super.parseExportDefaultExpression(); + } + parseConditional(expr, startLoc, refExpressionErrors) { + if (!this.match(17)) return expr; + if (this.state.maybeInArrowParameters) { + const nextCh = this.lookaheadCharCode(); + if (nextCh === 44 || nextCh === 61 || nextCh === 58 || nextCh === 41) { + this.setOptionalParametersError(refExpressionErrors); + return expr; + } + } + this.expect(17); + const state = this.state.clone(); + const originalNoArrowAt = this.state.noArrowAt; + const node = this.startNodeAt(startLoc); + let { + consequent, + failed + } = this.tryParseConditionalConsequent(); + let [valid, invalid] = this.getArrowLikeExpressions(consequent); + if (failed || invalid.length > 0) { + const noArrowAt = [...originalNoArrowAt]; + if (invalid.length > 0) { + this.state = state; + this.state.noArrowAt = noArrowAt; + for (let i = 0; i < invalid.length; i++) { + noArrowAt.push(invalid[i].start); + } + ({ + consequent, + failed + } = this.tryParseConditionalConsequent()); + [valid, invalid] = this.getArrowLikeExpressions(consequent); + } + if (failed && valid.length > 1) { + this.raise(FlowErrors.AmbiguousConditionalArrow, state.startLoc); + } + if (failed && valid.length === 1) { + this.state = state; + noArrowAt.push(valid[0].start); + this.state.noArrowAt = noArrowAt; + ({ + consequent, + failed + } = this.tryParseConditionalConsequent()); + } + } + this.getArrowLikeExpressions(consequent, true); + this.state.noArrowAt = originalNoArrowAt; + this.expect(14); + node.test = expr; + node.consequent = consequent; + node.alternate = this.forwardNoArrowParamsConversionAt(node, () => this.parseMaybeAssign(undefined, undefined)); + return this.finishNode(node, "ConditionalExpression"); + } + tryParseConditionalConsequent() { + this.state.noArrowParamsConversionAt.push(this.state.start); + const consequent = this.parseMaybeAssignAllowIn(); + const failed = !this.match(14); + this.state.noArrowParamsConversionAt.pop(); + return { + consequent, + failed + }; + } + getArrowLikeExpressions(node, disallowInvalid) { + const stack = [node]; + const arrows = []; + while (stack.length !== 0) { + const node = stack.pop(); + if (node.type === "ArrowFunctionExpression" && node.body.type !== "BlockStatement") { + if (node.typeParameters || !node.returnType) { + this.finishArrowValidation(node); + } else { + arrows.push(node); + } + stack.push(node.body); + } else if (node.type === "ConditionalExpression") { + stack.push(node.consequent); + stack.push(node.alternate); + } + } + if (disallowInvalid) { + arrows.forEach(node => this.finishArrowValidation(node)); + return [arrows, []]; + } + return partition(arrows, node => node.params.every(param => this.isAssignable(param, true))); + } + finishArrowValidation(node) { + var _node$extra; + this.toAssignableList(node.params, (_node$extra = node.extra) == null ? void 0 : _node$extra.trailingCommaLoc, false); + this.scope.enter(514 | 4); + super.checkParams(node, false, true); + this.scope.exit(); + } + forwardNoArrowParamsConversionAt(node, parse) { + let result; + if (this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(node.start))) { + this.state.noArrowParamsConversionAt.push(this.state.start); + result = parse(); + this.state.noArrowParamsConversionAt.pop(); + } else { + result = parse(); + } + return result; + } + parseParenItem(node, startLoc) { + const newNode = super.parseParenItem(node, startLoc); + if (this.eat(17)) { + newNode.optional = true; + this.resetEndLocation(node); + } + if (this.match(14)) { + const typeCastNode = this.startNodeAt(startLoc); + typeCastNode.expression = newNode; + typeCastNode.typeAnnotation = this.flowParseTypeAnnotation(); + return this.finishNode(typeCastNode, "TypeCastExpression"); + } + return newNode; + } + assertModuleNodeAllowed(node) { + if (node.type === "ImportDeclaration" && (node.importKind === "type" || node.importKind === "typeof") || node.type === "ExportNamedDeclaration" && node.exportKind === "type" || node.type === "ExportAllDeclaration" && node.exportKind === "type") { + return; + } + super.assertModuleNodeAllowed(node); + } + parseExportDeclaration(node) { + if (this.isContextual(130)) { + node.exportKind = "type"; + const declarationNode = this.startNode(); + this.next(); + if (this.match(5)) { + node.specifiers = this.parseExportSpecifiers(true); + super.parseExportFrom(node); + return null; + } else { + return this.flowParseTypeAlias(declarationNode); + } + } else if (this.isContextual(131)) { + node.exportKind = "type"; + const declarationNode = this.startNode(); + this.next(); + return this.flowParseOpaqueType(declarationNode, false); + } else if (this.isContextual(129)) { + node.exportKind = "type"; + const declarationNode = this.startNode(); + this.next(); + return this.flowParseInterface(declarationNode); + } else if (this.isContextual(126)) { + node.exportKind = "value"; + const declarationNode = this.startNode(); + this.next(); + return this.flowParseEnumDeclaration(declarationNode); + } else { + return super.parseExportDeclaration(node); + } + } + eatExportStar(node) { + if (super.eatExportStar(node)) return true; + if (this.isContextual(130) && this.lookahead().type === 55) { + node.exportKind = "type"; + this.next(); + this.next(); + return true; + } + return false; + } + maybeParseExportNamespaceSpecifier(node) { + const { + startLoc + } = this.state; + const hasNamespace = super.maybeParseExportNamespaceSpecifier(node); + if (hasNamespace && node.exportKind === "type") { + this.unexpected(startLoc); + } + return hasNamespace; + } + parseClassId(node, isStatement, optionalId) { + super.parseClassId(node, isStatement, optionalId); + if (this.match(47)) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } + } + parseClassMember(classBody, member, state) { + const { + startLoc + } = this.state; + if (this.isContextual(125)) { + if (super.parseClassMemberFromModifier(classBody, member)) { + return; + } + member.declare = true; + } + super.parseClassMember(classBody, member, state); + if (member.declare) { + if (member.type !== "ClassProperty" && member.type !== "ClassPrivateProperty" && member.type !== "PropertyDefinition") { + this.raise(FlowErrors.DeclareClassElement, startLoc); + } else if (member.value) { + this.raise(FlowErrors.DeclareClassFieldInitializer, member.value); + } + } + } + isIterator(word) { + return word === "iterator" || word === "asyncIterator"; + } + readIterator() { + const word = super.readWord1(); + const fullWord = "@@" + word; + if (!this.isIterator(word) || !this.state.inType) { + this.raise(Errors.InvalidIdentifier, this.state.curPosition(), { + identifierName: fullWord + }); + } + this.finishToken(132, fullWord); + } + getTokenFromCode(code) { + const next = this.input.charCodeAt(this.state.pos + 1); + if (code === 123 && next === 124) { + this.finishOp(6, 2); + } else if (this.state.inType && (code === 62 || code === 60)) { + this.finishOp(code === 62 ? 48 : 47, 1); + } else if (this.state.inType && code === 63) { + if (next === 46) { + this.finishOp(18, 2); + } else { + this.finishOp(17, 1); + } + } else if (isIteratorStart(code, next, this.input.charCodeAt(this.state.pos + 2))) { + this.state.pos += 2; + this.readIterator(); + } else { + super.getTokenFromCode(code); + } + } + isAssignable(node, isBinding) { + if (node.type === "TypeCastExpression") { + return this.isAssignable(node.expression, isBinding); + } else { + return super.isAssignable(node, isBinding); + } + } + toAssignable(node, isLHS = false) { + if (!isLHS && node.type === "AssignmentExpression" && node.left.type === "TypeCastExpression") { + node.left = this.typeCastToParameter(node.left); + } + super.toAssignable(node, isLHS); + } + toAssignableList(exprList, trailingCommaLoc, isLHS) { + for (let i = 0; i < exprList.length; i++) { + const expr = exprList[i]; + if ((expr == null ? void 0 : expr.type) === "TypeCastExpression") { + exprList[i] = this.typeCastToParameter(expr); + } + } + super.toAssignableList(exprList, trailingCommaLoc, isLHS); + } + toReferencedList(exprList, isParenthesizedExpr) { + for (let i = 0; i < exprList.length; i++) { + var _expr$extra; + const expr = exprList[i]; + if (expr && expr.type === "TypeCastExpression" && !((_expr$extra = expr.extra) != null && _expr$extra.parenthesized) && (exprList.length > 1 || !isParenthesizedExpr)) { + this.raise(FlowErrors.TypeCastInPattern, expr.typeAnnotation); + } + } + return exprList; + } + parseArrayLike(close, canBePattern, isTuple, refExpressionErrors) { + const node = super.parseArrayLike(close, canBePattern, isTuple, refExpressionErrors); + if (canBePattern && !this.state.maybeInArrowParameters) { + this.toReferencedList(node.elements); + } + return node; + } + isValidLVal(type, isParenthesized, binding) { + return type === "TypeCastExpression" || super.isValidLVal(type, isParenthesized, binding); + } + parseClassProperty(node) { + if (this.match(14)) { + node.typeAnnotation = this.flowParseTypeAnnotation(); + } + return super.parseClassProperty(node); + } + parseClassPrivateProperty(node) { + if (this.match(14)) { + node.typeAnnotation = this.flowParseTypeAnnotation(); + } + return super.parseClassPrivateProperty(node); + } + isClassMethod() { + return this.match(47) || super.isClassMethod(); + } + isClassProperty() { + return this.match(14) || super.isClassProperty(); + } + isNonstaticConstructor(method) { + return !this.match(14) && super.isNonstaticConstructor(method); + } + pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { + if (method.variance) { + this.unexpected(method.variance.loc.start); + } + delete method.variance; + if (this.match(47)) { + method.typeParameters = this.flowParseTypeParameterDeclaration(); + } + super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper); + if (method.params && isConstructor) { + const params = method.params; + if (params.length > 0 && this.isThisParam(params[0])) { + this.raise(FlowErrors.ThisParamBannedInConstructor, method); + } + } else if (method.type === "MethodDefinition" && isConstructor && method.value.params) { + const params = method.value.params; + if (params.length > 0 && this.isThisParam(params[0])) { + this.raise(FlowErrors.ThisParamBannedInConstructor, method); + } + } + } + pushClassPrivateMethod(classBody, method, isGenerator, isAsync) { + if (method.variance) { + this.unexpected(method.variance.loc.start); + } + delete method.variance; + if (this.match(47)) { + method.typeParameters = this.flowParseTypeParameterDeclaration(); + } + super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync); + } + parseClassSuper(node) { + super.parseClassSuper(node); + if (node.superClass && (this.match(47) || this.match(51))) { + { + node.superTypeParameters = this.flowParseTypeParameterInstantiationInExpression(); + } + } + if (this.isContextual(113)) { + this.next(); + const implemented = node.implements = []; + do { + const node = this.startNode(); + node.id = this.flowParseRestrictedIdentifier(true); + if (this.match(47)) { + node.typeParameters = this.flowParseTypeParameterInstantiation(); + } else { + node.typeParameters = null; + } + implemented.push(this.finishNode(node, "ClassImplements")); + } while (this.eat(12)); + } + } + checkGetterSetterParams(method) { + super.checkGetterSetterParams(method); + const params = this.getObjectOrClassMethodParams(method); + if (params.length > 0) { + const param = params[0]; + if (this.isThisParam(param) && method.kind === "get") { + this.raise(FlowErrors.GetterMayNotHaveThisParam, param); + } else if (this.isThisParam(param)) { + this.raise(FlowErrors.SetterMayNotHaveThisParam, param); + } + } + } + parsePropertyNamePrefixOperator(node) { + node.variance = this.flowParseVariance(); + } + parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) { + if (prop.variance) { + this.unexpected(prop.variance.loc.start); + } + delete prop.variance; + let typeParameters; + if (this.match(47) && !isAccessor) { + typeParameters = this.flowParseTypeParameterDeclaration(); + if (!this.match(10)) this.unexpected(); + } + const result = super.parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors); + if (typeParameters) { + (result.value || result).typeParameters = typeParameters; + } + return result; + } + parseFunctionParamType(param) { + if (this.eat(17)) { + if (param.type !== "Identifier") { + this.raise(FlowErrors.PatternIsOptional, param); + } + if (this.isThisParam(param)) { + this.raise(FlowErrors.ThisParamMayNotBeOptional, param); + } + param.optional = true; + } + if (this.match(14)) { + param.typeAnnotation = this.flowParseTypeAnnotation(); + } else if (this.isThisParam(param)) { + this.raise(FlowErrors.ThisParamAnnotationRequired, param); + } + if (this.match(29) && this.isThisParam(param)) { + this.raise(FlowErrors.ThisParamNoDefault, param); + } + this.resetEndLocation(param); + return param; + } + parseMaybeDefault(startLoc, left) { + const node = super.parseMaybeDefault(startLoc, left); + if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) { + this.raise(FlowErrors.TypeBeforeInitializer, node.typeAnnotation); + } + return node; + } + checkImportReflection(node) { + super.checkImportReflection(node); + if (node.module && node.importKind !== "value") { + this.raise(FlowErrors.ImportReflectionHasImportType, node.specifiers[0].loc.start); + } + } + parseImportSpecifierLocal(node, specifier, type) { + specifier.local = hasTypeImportKind(node) ? this.flowParseRestrictedIdentifier(true, true) : this.parseIdentifier(); + node.specifiers.push(this.finishImportSpecifier(specifier, type)); + } + isPotentialImportPhase(isExport) { + if (super.isPotentialImportPhase(isExport)) return true; + if (this.isContextual(130)) { + if (!isExport) return true; + const ch = this.lookaheadCharCode(); + return ch === 123 || ch === 42; + } + return !isExport && this.isContextual(87); + } + applyImportPhase(node, isExport, phase, loc) { + super.applyImportPhase(node, isExport, phase, loc); + if (isExport) { + if (!phase && this.match(65)) { + return; + } + node.exportKind = phase === "type" ? phase : "value"; + } else { + if (phase === "type" && this.match(55)) this.unexpected(); + node.importKind = phase === "type" || phase === "typeof" ? phase : "value"; + } + } + parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, bindingType) { + const firstIdent = specifier.imported; + let specifierTypeKind = null; + if (firstIdent.type === "Identifier") { + if (firstIdent.name === "type") { + specifierTypeKind = "type"; + } else if (firstIdent.name === "typeof") { + specifierTypeKind = "typeof"; + } + } + let isBinding = false; + if (this.isContextual(93) && !this.isLookaheadContextual("as")) { + const as_ident = this.parseIdentifier(true); + if (specifierTypeKind !== null && !tokenIsKeywordOrIdentifier(this.state.type)) { + specifier.imported = as_ident; + specifier.importKind = specifierTypeKind; + specifier.local = this.cloneIdentifier(as_ident); + } else { + specifier.imported = firstIdent; + specifier.importKind = null; + specifier.local = this.parseIdentifier(); + } + } else { + if (specifierTypeKind !== null && tokenIsKeywordOrIdentifier(this.state.type)) { + specifier.imported = this.parseIdentifier(true); + specifier.importKind = specifierTypeKind; + } else { + if (importedIsString) { + throw this.raise(Errors.ImportBindingIsString, specifier, { + importName: firstIdent.value + }); + } + specifier.imported = firstIdent; + specifier.importKind = null; + } + if (this.eatContextual(93)) { + specifier.local = this.parseIdentifier(); + } else { + isBinding = true; + specifier.local = this.cloneIdentifier(specifier.imported); + } + } + const specifierIsTypeImport = hasTypeImportKind(specifier); + if (isInTypeOnlyImport && specifierIsTypeImport) { + this.raise(FlowErrors.ImportTypeShorthandOnlyInPureImport, specifier); + } + if (isInTypeOnlyImport || specifierIsTypeImport) { + this.checkReservedType(specifier.local.name, specifier.local.loc.start, true); + } + if (isBinding && !isInTypeOnlyImport && !specifierIsTypeImport) { + this.checkReservedWord(specifier.local.name, specifier.loc.start, true, true); + } + return this.finishImportSpecifier(specifier, "ImportSpecifier"); + } + parseBindingAtom() { + switch (this.state.type) { + case 78: + return this.parseIdentifier(true); + default: + return super.parseBindingAtom(); + } + } + parseFunctionParams(node, isConstructor) { + const kind = node.kind; + if (kind !== "get" && kind !== "set" && this.match(47)) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } + super.parseFunctionParams(node, isConstructor); + } + parseVarId(decl, kind) { + super.parseVarId(decl, kind); + if (this.match(14)) { + decl.id.typeAnnotation = this.flowParseTypeAnnotation(); + this.resetEndLocation(decl.id); + } + } + parseAsyncArrowFromCallExpression(node, call) { + if (this.match(14)) { + const oldNoAnonFunctionType = this.state.noAnonFunctionType; + this.state.noAnonFunctionType = true; + node.returnType = this.flowParseTypeAnnotation(); + this.state.noAnonFunctionType = oldNoAnonFunctionType; + } + return super.parseAsyncArrowFromCallExpression(node, call); + } + shouldParseAsyncArrow() { + return this.match(14) || super.shouldParseAsyncArrow(); + } + parseMaybeAssign(refExpressionErrors, afterLeftParse) { + var _jsx; + let state = null; + let jsx; + if (this.hasPlugin("jsx") && (this.match(143) || this.match(47))) { + state = this.state.clone(); + jsx = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state); + if (!jsx.error) return jsx.node; + const { + context + } = this.state; + const currentContext = context[context.length - 1]; + if (currentContext === types.j_oTag || currentContext === types.j_expr) { + context.pop(); + } + } + if ((_jsx = jsx) != null && _jsx.error || this.match(47)) { + var _jsx2, _jsx3; + state = state || this.state.clone(); + let typeParameters; + const arrow = this.tryParse(abort => { + var _arrowExpression$extr; + typeParameters = this.flowParseTypeParameterDeclaration(); + const arrowExpression = this.forwardNoArrowParamsConversionAt(typeParameters, () => { + const result = super.parseMaybeAssign(refExpressionErrors, afterLeftParse); + this.resetStartLocationFromNode(result, typeParameters); + return result; + }); + if ((_arrowExpression$extr = arrowExpression.extra) != null && _arrowExpression$extr.parenthesized) abort(); + const expr = this.maybeUnwrapTypeCastExpression(arrowExpression); + if (expr.type !== "ArrowFunctionExpression") abort(); + expr.typeParameters = typeParameters; + this.resetStartLocationFromNode(expr, typeParameters); + return arrowExpression; + }, state); + let arrowExpression = null; + if (arrow.node && this.maybeUnwrapTypeCastExpression(arrow.node).type === "ArrowFunctionExpression") { + if (!arrow.error && !arrow.aborted) { + if (arrow.node.async) { + this.raise(FlowErrors.UnexpectedTypeParameterBeforeAsyncArrowFunction, typeParameters); + } + return arrow.node; + } + arrowExpression = arrow.node; + } + if ((_jsx2 = jsx) != null && _jsx2.node) { + this.state = jsx.failState; + return jsx.node; + } + if (arrowExpression) { + this.state = arrow.failState; + return arrowExpression; + } + if ((_jsx3 = jsx) != null && _jsx3.thrown) throw jsx.error; + if (arrow.thrown) throw arrow.error; + throw this.raise(FlowErrors.UnexpectedTokenAfterTypeParameter, typeParameters); + } + return super.parseMaybeAssign(refExpressionErrors, afterLeftParse); + } + parseArrow(node) { + if (this.match(14)) { + const result = this.tryParse(() => { + const oldNoAnonFunctionType = this.state.noAnonFunctionType; + this.state.noAnonFunctionType = true; + const typeNode = this.startNode(); + [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); + this.state.noAnonFunctionType = oldNoAnonFunctionType; + if (this.canInsertSemicolon()) this.unexpected(); + if (!this.match(19)) this.unexpected(); + return typeNode; + }); + if (result.thrown) return null; + if (result.error) this.state = result.failState; + node.returnType = result.node.typeAnnotation ? this.finishNode(result.node, "TypeAnnotation") : null; + } + return super.parseArrow(node); + } + shouldParseArrow(params) { + return this.match(14) || super.shouldParseArrow(params); + } + setArrowFunctionParameters(node, params) { + if (this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(node.start))) { + node.params = params; + } else { + super.setArrowFunctionParameters(node, params); + } + } + checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged = true) { + if (isArrowFunction && this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(node.start))) { + return; + } + for (let i = 0; i < node.params.length; i++) { + if (this.isThisParam(node.params[i]) && i > 0) { + this.raise(FlowErrors.ThisParamMustBeFirst, node.params[i]); + } + } + super.checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged); + } + parseParenAndDistinguishExpression(canBeArrow) { + return super.parseParenAndDistinguishExpression(canBeArrow && !this.state.noArrowAt.includes(this.sourceToOffsetPos(this.state.start))); + } + parseSubscripts(base, startLoc, noCalls) { + if (base.type === "Identifier" && base.name === "async" && this.state.noArrowAt.includes(startLoc.index)) { + this.next(); + const node = this.startNodeAt(startLoc); + node.callee = base; + node.arguments = super.parseCallExpressionArguments(); + base = this.finishNode(node, "CallExpression"); + } else if (base.type === "Identifier" && base.name === "async" && this.match(47)) { + const state = this.state.clone(); + const arrow = this.tryParse(abort => this.parseAsyncArrowWithTypeParameters(startLoc) || abort(), state); + if (!arrow.error && !arrow.aborted) return arrow.node; + const result = this.tryParse(() => super.parseSubscripts(base, startLoc, noCalls), state); + if (result.node && !result.error) return result.node; + if (arrow.node) { + this.state = arrow.failState; + return arrow.node; + } + if (result.node) { + this.state = result.failState; + return result.node; + } + throw arrow.error || result.error; + } + return super.parseSubscripts(base, startLoc, noCalls); + } + parseSubscript(base, startLoc, noCalls, subscriptState) { + if (this.match(18) && this.isLookaheadToken_lt()) { + subscriptState.optionalChainMember = true; + if (noCalls) { + subscriptState.stop = true; + return base; + } + this.next(); + const node = this.startNodeAt(startLoc); + node.callee = base; + node.typeArguments = this.flowParseTypeParameterInstantiationInExpression(); + this.expect(10); + node.arguments = this.parseCallExpressionArguments(); + node.optional = true; + return this.finishCallExpression(node, true); + } else if (!noCalls && this.shouldParseTypes() && (this.match(47) || this.match(51))) { + const node = this.startNodeAt(startLoc); + node.callee = base; + const result = this.tryParse(() => { + node.typeArguments = this.flowParseTypeParameterInstantiationCallOrNew(); + this.expect(10); + node.arguments = super.parseCallExpressionArguments(); + if (subscriptState.optionalChainMember) { + node.optional = false; + } + return this.finishCallExpression(node, subscriptState.optionalChainMember); + }); + if (result.node) { + if (result.error) this.state = result.failState; + return result.node; + } + } + return super.parseSubscript(base, startLoc, noCalls, subscriptState); + } + parseNewCallee(node) { + super.parseNewCallee(node); + let targs = null; + if (this.shouldParseTypes() && this.match(47)) { + targs = this.tryParse(() => this.flowParseTypeParameterInstantiationCallOrNew()).node; + } + node.typeArguments = targs; + } + parseAsyncArrowWithTypeParameters(startLoc) { + const node = this.startNodeAt(startLoc); + this.parseFunctionParams(node, false); + if (!this.parseArrow(node)) return; + return super.parseArrowExpression(node, undefined, true); + } + readToken_mult_modulo(code) { + const next = this.input.charCodeAt(this.state.pos + 1); + if (code === 42 && next === 47 && this.state.hasFlowComment) { + this.state.hasFlowComment = false; + this.state.pos += 2; + this.nextToken(); + return; + } + super.readToken_mult_modulo(code); + } + readToken_pipe_amp(code) { + const next = this.input.charCodeAt(this.state.pos + 1); + if (code === 124 && next === 125) { + this.finishOp(9, 2); + return; + } + super.readToken_pipe_amp(code); + } + parseTopLevel(file, program) { + const fileNode = super.parseTopLevel(file, program); + if (this.state.hasFlowComment) { + this.raise(FlowErrors.UnterminatedFlowComment, this.state.curPosition()); + } + return fileNode; + } + skipBlockComment() { + if (this.hasPlugin("flowComments") && this.skipFlowComment()) { + if (this.state.hasFlowComment) { + throw this.raise(FlowErrors.NestedFlowComment, this.state.startLoc); + } + this.hasFlowCommentCompletion(); + const commentSkip = this.skipFlowComment(); + if (commentSkip) { + this.state.pos += commentSkip; + this.state.hasFlowComment = true; + } + return; + } + return super.skipBlockComment(this.state.hasFlowComment ? "*-/" : "*/"); + } + skipFlowComment() { + const { + pos + } = this.state; + let shiftToFirstNonWhiteSpace = 2; + while ([32, 9].includes(this.input.charCodeAt(pos + shiftToFirstNonWhiteSpace))) { + shiftToFirstNonWhiteSpace++; + } + const ch2 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos); + const ch3 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos + 1); + if (ch2 === 58 && ch3 === 58) { + return shiftToFirstNonWhiteSpace + 2; + } + if (this.input.slice(shiftToFirstNonWhiteSpace + pos, shiftToFirstNonWhiteSpace + pos + 12) === "flow-include") { + return shiftToFirstNonWhiteSpace + 12; + } + if (ch2 === 58 && ch3 !== 58) { + return shiftToFirstNonWhiteSpace; + } + return false; + } + hasFlowCommentCompletion() { + const end = this.input.indexOf("*/", this.state.pos); + if (end === -1) { + throw this.raise(Errors.UnterminatedComment, this.state.curPosition()); + } + } + flowEnumErrorBooleanMemberNotInitialized(loc, { + enumName, + memberName + }) { + this.raise(FlowErrors.EnumBooleanMemberNotInitialized, loc, { + memberName, + enumName + }); + } + flowEnumErrorInvalidMemberInitializer(loc, enumContext) { + return this.raise(!enumContext.explicitType ? FlowErrors.EnumInvalidMemberInitializerUnknownType : enumContext.explicitType === "symbol" ? FlowErrors.EnumInvalidMemberInitializerSymbolType : FlowErrors.EnumInvalidMemberInitializerPrimaryType, loc, enumContext); + } + flowEnumErrorNumberMemberNotInitialized(loc, details) { + this.raise(FlowErrors.EnumNumberMemberNotInitialized, loc, details); + } + flowEnumErrorStringMemberInconsistentlyInitialized(node, details) { + this.raise(FlowErrors.EnumStringMemberInconsistentlyInitialized, node, details); + } + flowEnumMemberInit() { + const startLoc = this.state.startLoc; + const endOfInit = () => this.match(12) || this.match(8); + switch (this.state.type) { + case 135: + { + const literal = this.parseNumericLiteral(this.state.value); + if (endOfInit()) { + return { + type: "number", + loc: literal.loc.start, + value: literal + }; + } + return { + type: "invalid", + loc: startLoc + }; + } + case 134: + { + const literal = this.parseStringLiteral(this.state.value); + if (endOfInit()) { + return { + type: "string", + loc: literal.loc.start, + value: literal + }; + } + return { + type: "invalid", + loc: startLoc + }; + } + case 85: + case 86: + { + const literal = this.parseBooleanLiteral(this.match(85)); + if (endOfInit()) { + return { + type: "boolean", + loc: literal.loc.start, + value: literal + }; + } + return { + type: "invalid", + loc: startLoc + }; + } + default: + return { + type: "invalid", + loc: startLoc + }; + } + } + flowEnumMemberRaw() { + const loc = this.state.startLoc; + const id = this.parseIdentifier(true); + const init = this.eat(29) ? this.flowEnumMemberInit() : { + type: "none", + loc + }; + return { + id, + init + }; + } + flowEnumCheckExplicitTypeMismatch(loc, context, expectedType) { + const { + explicitType + } = context; + if (explicitType === null) { + return; + } + if (explicitType !== expectedType) { + this.flowEnumErrorInvalidMemberInitializer(loc, context); + } + } + flowEnumMembers({ + enumName, + explicitType + }) { + const seenNames = new Set(); + const members = { + booleanMembers: [], + numberMembers: [], + stringMembers: [], + defaultedMembers: [] + }; + let hasUnknownMembers = false; + while (!this.match(8)) { + if (this.eat(21)) { + hasUnknownMembers = true; + break; + } + const memberNode = this.startNode(); + const { + id, + init + } = this.flowEnumMemberRaw(); + const memberName = id.name; + if (memberName === "") { + continue; + } + if (/^[a-z]/.test(memberName)) { + this.raise(FlowErrors.EnumInvalidMemberName, id, { + memberName, + suggestion: memberName[0].toUpperCase() + memberName.slice(1), + enumName + }); + } + if (seenNames.has(memberName)) { + this.raise(FlowErrors.EnumDuplicateMemberName, id, { + memberName, + enumName + }); + } + seenNames.add(memberName); + const context = { + enumName, + explicitType, + memberName + }; + memberNode.id = id; + switch (init.type) { + case "boolean": + { + this.flowEnumCheckExplicitTypeMismatch(init.loc, context, "boolean"); + memberNode.init = init.value; + members.booleanMembers.push(this.finishNode(memberNode, "EnumBooleanMember")); + break; + } + case "number": + { + this.flowEnumCheckExplicitTypeMismatch(init.loc, context, "number"); + memberNode.init = init.value; + members.numberMembers.push(this.finishNode(memberNode, "EnumNumberMember")); + break; + } + case "string": + { + this.flowEnumCheckExplicitTypeMismatch(init.loc, context, "string"); + memberNode.init = init.value; + members.stringMembers.push(this.finishNode(memberNode, "EnumStringMember")); + break; + } + case "invalid": + { + throw this.flowEnumErrorInvalidMemberInitializer(init.loc, context); + } + case "none": + { + switch (explicitType) { + case "boolean": + this.flowEnumErrorBooleanMemberNotInitialized(init.loc, context); + break; + case "number": + this.flowEnumErrorNumberMemberNotInitialized(init.loc, context); + break; + default: + members.defaultedMembers.push(this.finishNode(memberNode, "EnumDefaultedMember")); + } + } + } + if (!this.match(8)) { + this.expect(12); + } + } + return { + members, + hasUnknownMembers + }; + } + flowEnumStringMembers(initializedMembers, defaultedMembers, { + enumName + }) { + if (initializedMembers.length === 0) { + return defaultedMembers; + } else if (defaultedMembers.length === 0) { + return initializedMembers; + } else if (defaultedMembers.length > initializedMembers.length) { + for (const member of initializedMembers) { + this.flowEnumErrorStringMemberInconsistentlyInitialized(member, { + enumName + }); + } + return defaultedMembers; + } else { + for (const member of defaultedMembers) { + this.flowEnumErrorStringMemberInconsistentlyInitialized(member, { + enumName + }); + } + return initializedMembers; + } + } + flowEnumParseExplicitType({ + enumName + }) { + if (!this.eatContextual(102)) return null; + if (!tokenIsIdentifier(this.state.type)) { + throw this.raise(FlowErrors.EnumInvalidExplicitTypeUnknownSupplied, this.state.startLoc, { + enumName + }); + } + const { + value + } = this.state; + this.next(); + if (value !== "boolean" && value !== "number" && value !== "string" && value !== "symbol") { + this.raise(FlowErrors.EnumInvalidExplicitType, this.state.startLoc, { + enumName, + invalidEnumType: value + }); + } + return value; + } + flowEnumBody(node, id) { + const enumName = id.name; + const nameLoc = id.loc.start; + const explicitType = this.flowEnumParseExplicitType({ + enumName + }); + this.expect(5); + const { + members, + hasUnknownMembers + } = this.flowEnumMembers({ + enumName, + explicitType + }); + node.hasUnknownMembers = hasUnknownMembers; + switch (explicitType) { + case "boolean": + node.explicitType = true; + node.members = members.booleanMembers; + this.expect(8); + return this.finishNode(node, "EnumBooleanBody"); + case "number": + node.explicitType = true; + node.members = members.numberMembers; + this.expect(8); + return this.finishNode(node, "EnumNumberBody"); + case "string": + node.explicitType = true; + node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, { + enumName + }); + this.expect(8); + return this.finishNode(node, "EnumStringBody"); + case "symbol": + node.members = members.defaultedMembers; + this.expect(8); + return this.finishNode(node, "EnumSymbolBody"); + default: + { + const empty = () => { + node.members = []; + this.expect(8); + return this.finishNode(node, "EnumStringBody"); + }; + node.explicitType = false; + const boolsLen = members.booleanMembers.length; + const numsLen = members.numberMembers.length; + const strsLen = members.stringMembers.length; + const defaultedLen = members.defaultedMembers.length; + if (!boolsLen && !numsLen && !strsLen && !defaultedLen) { + return empty(); + } else if (!boolsLen && !numsLen) { + node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, { + enumName + }); + this.expect(8); + return this.finishNode(node, "EnumStringBody"); + } else if (!numsLen && !strsLen && boolsLen >= defaultedLen) { + for (const member of members.defaultedMembers) { + this.flowEnumErrorBooleanMemberNotInitialized(member.loc.start, { + enumName, + memberName: member.id.name + }); + } + node.members = members.booleanMembers; + this.expect(8); + return this.finishNode(node, "EnumBooleanBody"); + } else if (!boolsLen && !strsLen && numsLen >= defaultedLen) { + for (const member of members.defaultedMembers) { + this.flowEnumErrorNumberMemberNotInitialized(member.loc.start, { + enumName, + memberName: member.id.name + }); + } + node.members = members.numberMembers; + this.expect(8); + return this.finishNode(node, "EnumNumberBody"); + } else { + this.raise(FlowErrors.EnumInconsistentMemberValues, nameLoc, { + enumName + }); + return empty(); + } + } + } + } + flowParseEnumDeclaration(node) { + const id = this.parseIdentifier(); + node.id = id; + node.body = this.flowEnumBody(this.startNode(), id); + return this.finishNode(node, "EnumDeclaration"); + } + jsxParseOpeningElementAfterName(node) { + if (this.shouldParseTypes()) { + if (this.match(47) || this.match(51)) { + node.typeArguments = this.flowParseTypeParameterInstantiationInExpression(); + } + } + return super.jsxParseOpeningElementAfterName(node); + } + isLookaheadToken_lt() { + const next = this.nextTokenStart(); + if (this.input.charCodeAt(next) === 60) { + const afterNext = this.input.charCodeAt(next + 1); + return afterNext !== 60 && afterNext !== 61; + } + return false; + } + reScan_lt_gt() { + const { + type + } = this.state; + if (type === 47) { + this.state.pos -= 1; + this.readToken_lt(); + } else if (type === 48) { + this.state.pos -= 1; + this.readToken_gt(); + } + } + reScan_lt() { + const { + type + } = this.state; + if (type === 51) { + this.state.pos -= 2; + this.finishOp(47, 1); + return 47; + } + return type; + } + maybeUnwrapTypeCastExpression(node) { + return node.type === "TypeCastExpression" ? node.expression : node; + } +}; +const entities = { + __proto__: null, + quot: "\u0022", + amp: "&", + apos: "\u0027", + lt: "<", + gt: ">", + nbsp: "\u00A0", + iexcl: "\u00A1", + cent: "\u00A2", + pound: "\u00A3", + curren: "\u00A4", + yen: "\u00A5", + brvbar: "\u00A6", + sect: "\u00A7", + uml: "\u00A8", + copy: "\u00A9", + ordf: "\u00AA", + laquo: "\u00AB", + not: "\u00AC", + shy: "\u00AD", + reg: "\u00AE", + macr: "\u00AF", + deg: "\u00B0", + plusmn: "\u00B1", + sup2: "\u00B2", + sup3: "\u00B3", + acute: "\u00B4", + micro: "\u00B5", + para: "\u00B6", + middot: "\u00B7", + cedil: "\u00B8", + sup1: "\u00B9", + ordm: "\u00BA", + raquo: "\u00BB", + frac14: "\u00BC", + frac12: "\u00BD", + frac34: "\u00BE", + iquest: "\u00BF", + Agrave: "\u00C0", + Aacute: "\u00C1", + Acirc: "\u00C2", + Atilde: "\u00C3", + Auml: "\u00C4", + Aring: "\u00C5", + AElig: "\u00C6", + Ccedil: "\u00C7", + Egrave: "\u00C8", + Eacute: "\u00C9", + Ecirc: "\u00CA", + Euml: "\u00CB", + Igrave: "\u00CC", + Iacute: "\u00CD", + Icirc: "\u00CE", + Iuml: "\u00CF", + ETH: "\u00D0", + Ntilde: "\u00D1", + Ograve: "\u00D2", + Oacute: "\u00D3", + Ocirc: "\u00D4", + Otilde: "\u00D5", + Ouml: "\u00D6", + times: "\u00D7", + Oslash: "\u00D8", + Ugrave: "\u00D9", + Uacute: "\u00DA", + Ucirc: "\u00DB", + Uuml: "\u00DC", + Yacute: "\u00DD", + THORN: "\u00DE", + szlig: "\u00DF", + agrave: "\u00E0", + aacute: "\u00E1", + acirc: "\u00E2", + atilde: "\u00E3", + auml: "\u00E4", + aring: "\u00E5", + aelig: "\u00E6", + ccedil: "\u00E7", + egrave: "\u00E8", + eacute: "\u00E9", + ecirc: "\u00EA", + euml: "\u00EB", + igrave: "\u00EC", + iacute: "\u00ED", + icirc: "\u00EE", + iuml: "\u00EF", + eth: "\u00F0", + ntilde: "\u00F1", + ograve: "\u00F2", + oacute: "\u00F3", + ocirc: "\u00F4", + otilde: "\u00F5", + ouml: "\u00F6", + divide: "\u00F7", + oslash: "\u00F8", + ugrave: "\u00F9", + uacute: "\u00FA", + ucirc: "\u00FB", + uuml: "\u00FC", + yacute: "\u00FD", + thorn: "\u00FE", + yuml: "\u00FF", + OElig: "\u0152", + oelig: "\u0153", + Scaron: "\u0160", + scaron: "\u0161", + Yuml: "\u0178", + fnof: "\u0192", + circ: "\u02C6", + tilde: "\u02DC", + Alpha: "\u0391", + Beta: "\u0392", + Gamma: "\u0393", + Delta: "\u0394", + Epsilon: "\u0395", + Zeta: "\u0396", + Eta: "\u0397", + Theta: "\u0398", + Iota: "\u0399", + Kappa: "\u039A", + Lambda: "\u039B", + Mu: "\u039C", + Nu: "\u039D", + Xi: "\u039E", + Omicron: "\u039F", + Pi: "\u03A0", + Rho: "\u03A1", + Sigma: "\u03A3", + Tau: "\u03A4", + Upsilon: "\u03A5", + Phi: "\u03A6", + Chi: "\u03A7", + Psi: "\u03A8", + Omega: "\u03A9", + alpha: "\u03B1", + beta: "\u03B2", + gamma: "\u03B3", + delta: "\u03B4", + epsilon: "\u03B5", + zeta: "\u03B6", + eta: "\u03B7", + theta: "\u03B8", + iota: "\u03B9", + kappa: "\u03BA", + lambda: "\u03BB", + mu: "\u03BC", + nu: "\u03BD", + xi: "\u03BE", + omicron: "\u03BF", + pi: "\u03C0", + rho: "\u03C1", + sigmaf: "\u03C2", + sigma: "\u03C3", + tau: "\u03C4", + upsilon: "\u03C5", + phi: "\u03C6", + chi: "\u03C7", + psi: "\u03C8", + omega: "\u03C9", + thetasym: "\u03D1", + upsih: "\u03D2", + piv: "\u03D6", + ensp: "\u2002", + emsp: "\u2003", + thinsp: "\u2009", + zwnj: "\u200C", + zwj: "\u200D", + lrm: "\u200E", + rlm: "\u200F", + ndash: "\u2013", + mdash: "\u2014", + lsquo: "\u2018", + rsquo: "\u2019", + sbquo: "\u201A", + ldquo: "\u201C", + rdquo: "\u201D", + bdquo: "\u201E", + dagger: "\u2020", + Dagger: "\u2021", + bull: "\u2022", + hellip: "\u2026", + permil: "\u2030", + prime: "\u2032", + Prime: "\u2033", + lsaquo: "\u2039", + rsaquo: "\u203A", + oline: "\u203E", + frasl: "\u2044", + euro: "\u20AC", + image: "\u2111", + weierp: "\u2118", + real: "\u211C", + trade: "\u2122", + alefsym: "\u2135", + larr: "\u2190", + uarr: "\u2191", + rarr: "\u2192", + darr: "\u2193", + harr: "\u2194", + crarr: "\u21B5", + lArr: "\u21D0", + uArr: "\u21D1", + rArr: "\u21D2", + dArr: "\u21D3", + hArr: "\u21D4", + forall: "\u2200", + part: "\u2202", + exist: "\u2203", + empty: "\u2205", + nabla: "\u2207", + isin: "\u2208", + notin: "\u2209", + ni: "\u220B", + prod: "\u220F", + sum: "\u2211", + minus: "\u2212", + lowast: "\u2217", + radic: "\u221A", + prop: "\u221D", + infin: "\u221E", + ang: "\u2220", + and: "\u2227", + or: "\u2228", + cap: "\u2229", + cup: "\u222A", + int: "\u222B", + there4: "\u2234", + sim: "\u223C", + cong: "\u2245", + asymp: "\u2248", + ne: "\u2260", + equiv: "\u2261", + le: "\u2264", + ge: "\u2265", + sub: "\u2282", + sup: "\u2283", + nsub: "\u2284", + sube: "\u2286", + supe: "\u2287", + oplus: "\u2295", + otimes: "\u2297", + perp: "\u22A5", + sdot: "\u22C5", + lceil: "\u2308", + rceil: "\u2309", + lfloor: "\u230A", + rfloor: "\u230B", + lang: "\u2329", + rang: "\u232A", + loz: "\u25CA", + spades: "\u2660", + clubs: "\u2663", + hearts: "\u2665", + diams: "\u2666" +}; +const lineBreak = /\r\n|[\r\n\u2028\u2029]/; +const lineBreakG = new RegExp(lineBreak.source, "g"); +function isNewLine(code) { + switch (code) { + case 10: + case 13: + case 8232: + case 8233: + return true; + default: + return false; + } +} +function hasNewLine(input, start, end) { + for (let i = start; i < end; i++) { + if (isNewLine(input.charCodeAt(i))) { + return true; + } + } + return false; +} +const skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g; +const skipWhiteSpaceInLine = /(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g; +function isWhitespace(code) { + switch (code) { + case 0x0009: + case 0x000b: + case 0x000c: + case 32: + case 160: + case 5760: + case 0x2000: + case 0x2001: + case 0x2002: + case 0x2003: + case 0x2004: + case 0x2005: + case 0x2006: + case 0x2007: + case 0x2008: + case 0x2009: + case 0x200a: + case 0x202f: + case 0x205f: + case 0x3000: + case 0xfeff: + return true; + default: + return false; + } +} +const JsxErrors = ParseErrorEnum`jsx`({ + AttributeIsEmpty: "JSX attributes must only be assigned a non-empty expression.", + MissingClosingTagElement: ({ + openingTagName + }) => `Expected corresponding JSX closing tag for <${openingTagName}>.`, + MissingClosingTagFragment: "Expected corresponding JSX closing tag for <>.", + UnexpectedSequenceExpression: "Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?", + UnexpectedToken: ({ + unexpected, + HTMLEntity + }) => `Unexpected token \`${unexpected}\`. Did you mean \`${HTMLEntity}\` or \`{'${unexpected}'}\`?`, + UnsupportedJsxValue: "JSX value should be either an expression or a quoted JSX text.", + UnterminatedJsxContent: "Unterminated JSX contents.", + UnwrappedAdjacentJSXElements: "Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...?" +}); +function isFragment(object) { + return object ? object.type === "JSXOpeningFragment" || object.type === "JSXClosingFragment" : false; +} +function getQualifiedJSXName(object) { + if (object.type === "JSXIdentifier") { + return object.name; + } + if (object.type === "JSXNamespacedName") { + return object.namespace.name + ":" + object.name.name; + } + if (object.type === "JSXMemberExpression") { + return getQualifiedJSXName(object.object) + "." + getQualifiedJSXName(object.property); + } + throw new Error("Node had unexpected type: " + object.type); +} +var jsx = superClass => class JSXParserMixin extends superClass { + jsxReadToken() { + let out = ""; + let chunkStart = this.state.pos; + for (;;) { + if (this.state.pos >= this.length) { + throw this.raise(JsxErrors.UnterminatedJsxContent, this.state.startLoc); + } + const ch = this.input.charCodeAt(this.state.pos); + switch (ch) { + case 60: + case 123: + if (this.state.pos === this.state.start) { + if (ch === 60 && this.state.canStartJSXElement) { + ++this.state.pos; + this.finishToken(143); + } else { + super.getTokenFromCode(ch); + } + return; + } + out += this.input.slice(chunkStart, this.state.pos); + this.finishToken(142, out); + return; + case 38: + out += this.input.slice(chunkStart, this.state.pos); + out += this.jsxReadEntity(); + chunkStart = this.state.pos; + break; + case 62: + case 125: + default: + if (isNewLine(ch)) { + out += this.input.slice(chunkStart, this.state.pos); + out += this.jsxReadNewLine(true); + chunkStart = this.state.pos; + } else { + ++this.state.pos; + } + } + } + } + jsxReadNewLine(normalizeCRLF) { + const ch = this.input.charCodeAt(this.state.pos); + let out; + ++this.state.pos; + if (ch === 13 && this.input.charCodeAt(this.state.pos) === 10) { + ++this.state.pos; + out = normalizeCRLF ? "\n" : "\r\n"; + } else { + out = String.fromCharCode(ch); + } + ++this.state.curLine; + this.state.lineStart = this.state.pos; + return out; + } + jsxReadString(quote) { + let out = ""; + let chunkStart = ++this.state.pos; + for (;;) { + if (this.state.pos >= this.length) { + throw this.raise(Errors.UnterminatedString, this.state.startLoc); + } + const ch = this.input.charCodeAt(this.state.pos); + if (ch === quote) break; + if (ch === 38) { + out += this.input.slice(chunkStart, this.state.pos); + out += this.jsxReadEntity(); + chunkStart = this.state.pos; + } else if (isNewLine(ch)) { + out += this.input.slice(chunkStart, this.state.pos); + out += this.jsxReadNewLine(false); + chunkStart = this.state.pos; + } else { + ++this.state.pos; + } + } + out += this.input.slice(chunkStart, this.state.pos++); + this.finishToken(134, out); + } + jsxReadEntity() { + const startPos = ++this.state.pos; + if (this.codePointAtPos(this.state.pos) === 35) { + ++this.state.pos; + let radix = 10; + if (this.codePointAtPos(this.state.pos) === 120) { + radix = 16; + ++this.state.pos; + } + const codePoint = this.readInt(radix, undefined, false, "bail"); + if (codePoint !== null && this.codePointAtPos(this.state.pos) === 59) { + ++this.state.pos; + return String.fromCodePoint(codePoint); + } + } else { + let count = 0; + let semi = false; + while (count++ < 10 && this.state.pos < this.length && !(semi = this.codePointAtPos(this.state.pos) === 59)) { + ++this.state.pos; + } + if (semi) { + const desc = this.input.slice(startPos, this.state.pos); + const entity = entities[desc]; + ++this.state.pos; + if (entity) { + return entity; + } + } + } + this.state.pos = startPos; + return "&"; + } + jsxReadWord() { + let ch; + const start = this.state.pos; + do { + ch = this.input.charCodeAt(++this.state.pos); + } while (isIdentifierChar(ch) || ch === 45); + this.finishToken(141, this.input.slice(start, this.state.pos)); + } + jsxParseIdentifier() { + const node = this.startNode(); + if (this.match(141)) { + node.name = this.state.value; + } else if (tokenIsKeyword(this.state.type)) { + node.name = tokenLabelName(this.state.type); + } else { + this.unexpected(); + } + this.next(); + return this.finishNode(node, "JSXIdentifier"); + } + jsxParseNamespacedName() { + const startLoc = this.state.startLoc; + const name = this.jsxParseIdentifier(); + if (!this.eat(14)) return name; + const node = this.startNodeAt(startLoc); + node.namespace = name; + node.name = this.jsxParseIdentifier(); + return this.finishNode(node, "JSXNamespacedName"); + } + jsxParseElementName() { + const startLoc = this.state.startLoc; + let node = this.jsxParseNamespacedName(); + if (node.type === "JSXNamespacedName") { + return node; + } + while (this.eat(16)) { + const newNode = this.startNodeAt(startLoc); + newNode.object = node; + newNode.property = this.jsxParseIdentifier(); + node = this.finishNode(newNode, "JSXMemberExpression"); + } + return node; + } + jsxParseAttributeValue() { + let node; + switch (this.state.type) { + case 5: + node = this.startNode(); + this.setContext(types.brace); + this.next(); + node = this.jsxParseExpressionContainer(node, types.j_oTag); + if (node.expression.type === "JSXEmptyExpression") { + this.raise(JsxErrors.AttributeIsEmpty, node); + } + return node; + case 143: + case 134: + return this.parseExprAtom(); + default: + throw this.raise(JsxErrors.UnsupportedJsxValue, this.state.startLoc); + } + } + jsxParseEmptyExpression() { + const node = this.startNodeAt(this.state.lastTokEndLoc); + return this.finishNodeAt(node, "JSXEmptyExpression", this.state.startLoc); + } + jsxParseSpreadChild(node) { + this.next(); + node.expression = this.parseExpression(); + this.setContext(types.j_expr); + this.state.canStartJSXElement = true; + this.expect(8); + return this.finishNode(node, "JSXSpreadChild"); + } + jsxParseExpressionContainer(node, previousContext) { + if (this.match(8)) { + node.expression = this.jsxParseEmptyExpression(); + } else { + const expression = this.parseExpression(); + node.expression = expression; + } + this.setContext(previousContext); + this.state.canStartJSXElement = true; + this.expect(8); + return this.finishNode(node, "JSXExpressionContainer"); + } + jsxParseAttribute() { + const node = this.startNode(); + if (this.match(5)) { + this.setContext(types.brace); + this.next(); + this.expect(21); + node.argument = this.parseMaybeAssignAllowIn(); + this.setContext(types.j_oTag); + this.state.canStartJSXElement = true; + this.expect(8); + return this.finishNode(node, "JSXSpreadAttribute"); + } + node.name = this.jsxParseNamespacedName(); + node.value = this.eat(29) ? this.jsxParseAttributeValue() : null; + return this.finishNode(node, "JSXAttribute"); + } + jsxParseOpeningElementAt(startLoc) { + const node = this.startNodeAt(startLoc); + if (this.eat(144)) { + return this.finishNode(node, "JSXOpeningFragment"); + } + node.name = this.jsxParseElementName(); + return this.jsxParseOpeningElementAfterName(node); + } + jsxParseOpeningElementAfterName(node) { + const attributes = []; + while (!this.match(56) && !this.match(144)) { + attributes.push(this.jsxParseAttribute()); + } + node.attributes = attributes; + node.selfClosing = this.eat(56); + this.expect(144); + return this.finishNode(node, "JSXOpeningElement"); + } + jsxParseClosingElementAt(startLoc) { + const node = this.startNodeAt(startLoc); + if (this.eat(144)) { + return this.finishNode(node, "JSXClosingFragment"); + } + node.name = this.jsxParseElementName(); + this.expect(144); + return this.finishNode(node, "JSXClosingElement"); + } + jsxParseElementAt(startLoc) { + const node = this.startNodeAt(startLoc); + const children = []; + const openingElement = this.jsxParseOpeningElementAt(startLoc); + let closingElement = null; + if (!openingElement.selfClosing) { + contents: for (;;) { + switch (this.state.type) { + case 143: + startLoc = this.state.startLoc; + this.next(); + if (this.eat(56)) { + closingElement = this.jsxParseClosingElementAt(startLoc); + break contents; + } + children.push(this.jsxParseElementAt(startLoc)); + break; + case 142: + children.push(this.parseLiteral(this.state.value, "JSXText")); + break; + case 5: + { + const node = this.startNode(); + this.setContext(types.brace); + this.next(); + if (this.match(21)) { + children.push(this.jsxParseSpreadChild(node)); + } else { + children.push(this.jsxParseExpressionContainer(node, types.j_expr)); + } + break; + } + default: + this.unexpected(); + } + } + if (isFragment(openingElement) && !isFragment(closingElement) && closingElement !== null) { + this.raise(JsxErrors.MissingClosingTagFragment, closingElement); + } else if (!isFragment(openingElement) && isFragment(closingElement)) { + this.raise(JsxErrors.MissingClosingTagElement, closingElement, { + openingTagName: getQualifiedJSXName(openingElement.name) + }); + } else if (!isFragment(openingElement) && !isFragment(closingElement)) { + if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name)) { + this.raise(JsxErrors.MissingClosingTagElement, closingElement, { + openingTagName: getQualifiedJSXName(openingElement.name) + }); + } + } + } + if (isFragment(openingElement)) { + node.openingFragment = openingElement; + node.closingFragment = closingElement; + } else { + node.openingElement = openingElement; + node.closingElement = closingElement; + } + node.children = children; + if (this.match(47)) { + throw this.raise(JsxErrors.UnwrappedAdjacentJSXElements, this.state.startLoc); + } + return isFragment(openingElement) ? this.finishNode(node, "JSXFragment") : this.finishNode(node, "JSXElement"); + } + jsxParseElement() { + const startLoc = this.state.startLoc; + this.next(); + return this.jsxParseElementAt(startLoc); + } + setContext(newContext) { + const { + context + } = this.state; + context[context.length - 1] = newContext; + } + parseExprAtom(refExpressionErrors) { + if (this.match(143)) { + return this.jsxParseElement(); + } else if (this.match(47) && this.input.charCodeAt(this.state.pos) !== 33) { + this.replaceToken(143); + return this.jsxParseElement(); + } else { + return super.parseExprAtom(refExpressionErrors); + } + } + skipSpace() { + const curContext = this.curContext(); + if (!curContext.preserveSpace) super.skipSpace(); + } + getTokenFromCode(code) { + const context = this.curContext(); + if (context === types.j_expr) { + this.jsxReadToken(); + return; + } + if (context === types.j_oTag || context === types.j_cTag) { + if (isIdentifierStart(code)) { + this.jsxReadWord(); + return; + } + if (code === 62) { + ++this.state.pos; + this.finishToken(144); + return; + } + if ((code === 34 || code === 39) && context === types.j_oTag) { + this.jsxReadString(code); + return; + } + } + if (code === 60 && this.state.canStartJSXElement && this.input.charCodeAt(this.state.pos + 1) !== 33) { + ++this.state.pos; + this.finishToken(143); + return; + } + super.getTokenFromCode(code); + } + updateContext(prevType) { + const { + context, + type + } = this.state; + if (type === 56 && prevType === 143) { + context.splice(-2, 2, types.j_cTag); + this.state.canStartJSXElement = false; + } else if (type === 143) { + context.push(types.j_oTag); + } else if (type === 144) { + const out = context[context.length - 1]; + if (out === types.j_oTag && prevType === 56 || out === types.j_cTag) { + context.pop(); + this.state.canStartJSXElement = context[context.length - 1] === types.j_expr; + } else { + this.setContext(types.j_expr); + this.state.canStartJSXElement = true; + } + } else { + this.state.canStartJSXElement = tokenComesBeforeExpression(type); + } + } +}; +class TypeScriptScope extends Scope { + constructor(...args) { + super(...args); + this.tsNames = new Map(); + } +} +class TypeScriptScopeHandler extends ScopeHandler { + constructor(...args) { + super(...args); + this.importsStack = []; + } + createScope(flags) { + this.importsStack.push(new Set()); + return new TypeScriptScope(flags); + } + enter(flags) { + if (flags === 1024) { + this.importsStack.push(new Set()); + } + super.enter(flags); + } + exit() { + const flags = super.exit(); + if (flags === 1024) { + this.importsStack.pop(); + } + return flags; + } + hasImport(name, allowShadow) { + const len = this.importsStack.length; + if (this.importsStack[len - 1].has(name)) { + return true; + } + if (!allowShadow && len > 1) { + for (let i = 0; i < len - 1; i++) { + if (this.importsStack[i].has(name)) return true; + } + } + return false; + } + declareName(name, bindingType, loc) { + if (bindingType & 4096) { + if (this.hasImport(name, true)) { + this.parser.raise(Errors.VarRedeclaration, loc, { + identifierName: name + }); + } + this.importsStack[this.importsStack.length - 1].add(name); + return; + } + const scope = this.currentScope(); + let type = scope.tsNames.get(name) || 0; + if (bindingType & 1024) { + this.maybeExportDefined(scope, name); + scope.tsNames.set(name, type | 16); + return; + } + super.declareName(name, bindingType, loc); + if (bindingType & 2) { + if (!(bindingType & 1)) { + this.checkRedeclarationInScope(scope, name, bindingType, loc); + this.maybeExportDefined(scope, name); + } + type = type | 1; + } + if (bindingType & 256) { + type = type | 2; + } + if (bindingType & 512) { + type = type | 4; + } + if (bindingType & 128) { + type = type | 8; + } + if (type) scope.tsNames.set(name, type); + } + isRedeclaredInScope(scope, name, bindingType) { + const type = scope.tsNames.get(name); + if ((type & 2) > 0) { + if (bindingType & 256) { + const isConst = !!(bindingType & 512); + const wasConst = (type & 4) > 0; + return isConst !== wasConst; + } + return true; + } + if (bindingType & 128 && (type & 8) > 0) { + if (scope.names.get(name) & 2) { + return !!(bindingType & 1); + } else { + return false; + } + } + if (bindingType & 2 && (type & 1) > 0) { + return true; + } + return super.isRedeclaredInScope(scope, name, bindingType); + } + checkLocalExport(id) { + const { + name + } = id; + if (this.hasImport(name)) return; + const len = this.scopeStack.length; + for (let i = len - 1; i >= 0; i--) { + const scope = this.scopeStack[i]; + const type = scope.tsNames.get(name); + if ((type & 1) > 0 || (type & 16) > 0) { + return; + } + } + super.checkLocalExport(id); + } +} +class ProductionParameterHandler { + constructor() { + this.stacks = []; + } + enter(flags) { + this.stacks.push(flags); + } + exit() { + this.stacks.pop(); + } + currentFlags() { + return this.stacks[this.stacks.length - 1]; + } + get hasAwait() { + return (this.currentFlags() & 2) > 0; + } + get hasYield() { + return (this.currentFlags() & 1) > 0; + } + get hasReturn() { + return (this.currentFlags() & 4) > 0; + } + get hasIn() { + return (this.currentFlags() & 8) > 0; + } +} +function functionFlags(isAsync, isGenerator) { + return (isAsync ? 2 : 0) | (isGenerator ? 1 : 0); +} class BaseParser { constructor() { this.sawUnambiguousESM = false; @@ -1755,6 +5102,7 @@ class CommentsParser extends BaseParser { } } finalizeComment(commentWS) { + var _node$options; const { comments } = commentWS; @@ -1781,6 +5129,9 @@ class CommentsParser extends BaseParser { case "OptionalCallExpression": adjustInnerComments(node, node.arguments, commentWS); break; + case "ImportExpression": + adjustInnerComments(node, [node.source, (_node$options = node.options) != null ? _node$options : null], commentWS); + break; case "FunctionDeclaration": case "FunctionExpression": case "ArrowFunctionExpression": @@ -1838,20 +5189,6 @@ class CommentsParser extends BaseParser { commentWS.leadingNode = null; } } - resetPreviousIdentifierLeadingComments(node) { - const { - commentStack - } = this.state; - const { - length - } = commentStack; - if (length === 0) return; - if (commentStack[length - 1].trailingNode === node) { - commentStack[length - 1].trailingNode = null; - } else if (length >= 2 && commentStack[length - 2].trailingNode === node) { - commentStack[length - 2].trailingNode = null; - } - } takeSurroundingComments(node, start, end) { const { commentStack @@ -1873,57 +5210,6 @@ class CommentsParser extends BaseParser { } } } -const lineBreak = /\r\n|[\r\n\u2028\u2029]/; -const lineBreakG = new RegExp(lineBreak.source, "g"); -function isNewLine(code) { - switch (code) { - case 10: - case 13: - case 8232: - case 8233: - return true; - default: - return false; - } -} -function hasNewLine(input, start, end) { - for (let i = start; i < end; i++) { - if (isNewLine(input.charCodeAt(i))) { - return true; - } - } - return false; -} -const skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g; -const skipWhiteSpaceInLine = /(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g; -function isWhitespace(code) { - switch (code) { - case 0x0009: - case 0x000b: - case 0x000c: - case 32: - case 160: - case 5760: - case 0x2000: - case 0x2001: - case 0x2002: - case 0x2003: - case 0x2004: - case 0x2005: - case 0x2006: - case 0x2007: - case 0x2008: - case 0x2009: - case 0x200a: - case 0x202f: - case 0x205f: - case 0x3000: - case 0xfeff: - return true; - default: - return false; - } -} class State { constructor() { this.flags = 1024; @@ -2478,7 +5764,10 @@ class Tokenizer extends CommentsParser { return skipWhiteSpace.test(this.input) ? skipWhiteSpace.lastIndex : pos; } lookaheadCharCode() { - return this.input.charCodeAt(this.nextTokenStart()); + return this.lookaheadCharCodeSince(this.state.pos); + } + lookaheadCharCodeSince(pos) { + return this.input.charCodeAt(this.nextTokenStartSince(pos)); } nextTokenInLineStart() { return this.nextTokenInLineStartSince(this.state.pos); @@ -3569,35 +6858,6 @@ function newAsyncArrowScope() { function newExpressionScope() { return new ExpressionScope(); } -class ProductionParameterHandler { - constructor() { - this.stacks = []; - } - enter(flags) { - this.stacks.push(flags); - } - exit() { - this.stacks.pop(); - } - currentFlags() { - return this.stacks[this.stacks.length - 1]; - } - get hasAwait() { - return (this.currentFlags() & 2) > 0; - } - get hasYield() { - return (this.currentFlags() & 1) > 0; - } - get hasReturn() { - return (this.currentFlags() & 4) > 0; - } - get hasIn() { - return (this.currentFlags() & 8) > 0; - } -} -function functionFlags(isAsync, isGenerator) { - return (isAsync ? 2 : 0) | (isGenerator ? 1 : 0); -} class UtilParser extends Tokenizer { addExtra(node, key, value, enumerable = true) { if (!node) return; @@ -3621,9 +6881,8 @@ class UtilParser extends Tokenizer { return this.state.type === token && !this.state.containsEsc; } isUnparsedContextual(nameStart, name) { - const nameEnd = nameStart + name.length; - if (this.input.slice(nameStart, nameEnd) === name) { - const nextCh = this.input.charCodeAt(nameEnd); + if (this.input.startsWith(name, nameStart)) { + const nextCh = this.input.charCodeAt(nameStart + name.length); return !(isIdentifierChar(nextCh) || (nextCh & 0xfc00) === 0xd800); } return false; @@ -3726,9 +6985,10 @@ class UtilParser extends Tokenizer { shorthandAssignLoc, doubleProtoLoc, privateKeyLoc, - optionalParametersLoc + optionalParametersLoc, + voidPatternLoc } = refExpressionErrors; - const hasErrors = !!shorthandAssignLoc || !!doubleProtoLoc || !!optionalParametersLoc || !!privateKeyLoc; + const hasErrors = !!shorthandAssignLoc || !!doubleProtoLoc || !!optionalParametersLoc || !!privateKeyLoc || !!voidPatternLoc; if (!andThrow) { return hasErrors; } @@ -3744,6 +7004,9 @@ class UtilParser extends Tokenizer { if (optionalParametersLoc != null) { this.unexpected(optionalParametersLoc); } + if (voidPatternLoc != null) { + this.raise(Errors.InvalidCoverDiscardElement, voidPatternLoc); + } } isLiteralPropertyName() { return tokenIsLiteralPropertyName(this.state.type); @@ -3791,14 +7054,22 @@ class UtilParser extends Tokenizer { } enterInitialScopes() { let paramFlags = 0; - if (this.inModule) { + if (this.inModule || this.optionFlags & 1) { paramFlags |= 2; } if (this.optionFlags & 32) { paramFlags |= 1; } - this.scope.enter(1); + const isCommonJS = !this.inModule && this.options.sourceType === "commonjs"; + if (isCommonJS || this.optionFlags & 2) { + paramFlags |= 4; + } this.prodParam.enter(paramFlags); + let scopeFlags = isCommonJS ? 514 : 1; + if (this.optionFlags & 4) { + scopeFlags |= 512; + } + this.scope.enter(scopeFlags); } checkDestructuringPrivate(refExpressionErrors) { const { @@ -3815,6 +7086,7 @@ class ExpressionErrors { this.doubleProtoLoc = null; this.privateKeyLoc = null; this.optionalParametersLoc = null; + this.voidPatternLoc = null; } } class Node { @@ -3841,58 +7113,6 @@ const NodePrototype = Node.prototype; return newNode; }; } -function clonePlaceholder(node) { - return cloneIdentifier(node); -} -function cloneIdentifier(node) { - const { - type, - start, - end, - loc, - range, - extra, - name - } = node; - const cloned = Object.create(NodePrototype); - cloned.type = type; - cloned.start = start; - cloned.end = end; - cloned.loc = loc; - cloned.range = range; - cloned.extra = extra; - cloned.name = name; - if (type === "Placeholder") { - cloned.expectedNode = node.expectedNode; - } - return cloned; -} -function cloneStringLiteral(node) { - const { - type, - start, - end, - loc, - range, - extra - } = node; - if (type === "Placeholder") { - return clonePlaceholder(node); - } - const cloned = Object.create(NodePrototype); - cloned.type = type; - cloned.start = start; - cloned.end = end; - cloned.loc = loc; - cloned.range = range; - if (node.raw !== undefined) { - cloned.raw = node.raw; - } else { - cloned.extra = extra; - } - cloned.value = node.value; - return cloned; -} class NodeUtils extends UtilParser { startNode() { const loc = this.state.startLoc; @@ -3930,3194 +7150,47 @@ class NodeUtils extends UtilParser { resetStartLocationFromNode(node, locationNode) { this.resetStartLocation(node, locationNode.loc.start); } -} -const reservedTypes = new Set(["_", "any", "bool", "boolean", "empty", "extends", "false", "interface", "mixed", "null", "number", "static", "string", "true", "typeof", "void"]); -const FlowErrors = ParseErrorEnum`flow`({ - AmbiguousConditionalArrow: "Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.", - AmbiguousDeclareModuleKind: "Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.", - AssignReservedType: ({ - reservedType - }) => `Cannot overwrite reserved type ${reservedType}.`, - DeclareClassElement: "The `declare` modifier can only appear on class fields.", - DeclareClassFieldInitializer: "Initializers are not allowed in fields with the `declare` modifier.", - DuplicateDeclareModuleExports: "Duplicate `declare module.exports` statement.", - EnumBooleanMemberNotInitialized: ({ - memberName, - enumName - }) => `Boolean enum members need to be initialized. Use either \`${memberName} = true,\` or \`${memberName} = false,\` in enum \`${enumName}\`.`, - EnumDuplicateMemberName: ({ - memberName, - enumName - }) => `Enum member names need to be unique, but the name \`${memberName}\` has already been used before in enum \`${enumName}\`.`, - EnumInconsistentMemberValues: ({ - enumName - }) => `Enum \`${enumName}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`, - EnumInvalidExplicitType: ({ - invalidEnumType, - enumName - }) => `Enum type \`${invalidEnumType}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${enumName}\`.`, - EnumInvalidExplicitTypeUnknownSupplied: ({ - enumName - }) => `Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${enumName}\`.`, - EnumInvalidMemberInitializerPrimaryType: ({ - enumName, - memberName, - explicitType - }) => `Enum \`${enumName}\` has type \`${explicitType}\`, so the initializer of \`${memberName}\` needs to be a ${explicitType} literal.`, - EnumInvalidMemberInitializerSymbolType: ({ - enumName, - memberName - }) => `Symbol enum members cannot be initialized. Use \`${memberName},\` in enum \`${enumName}\`.`, - EnumInvalidMemberInitializerUnknownType: ({ - enumName, - memberName - }) => `The enum member initializer for \`${memberName}\` needs to be a literal (either a boolean, number, or string) in enum \`${enumName}\`.`, - EnumInvalidMemberName: ({ - enumName, - memberName, - suggestion - }) => `Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${memberName}\`, consider using \`${suggestion}\`, in enum \`${enumName}\`.`, - EnumNumberMemberNotInitialized: ({ - enumName, - memberName - }) => `Number enum members need to be initialized, e.g. \`${memberName} = 1\` in enum \`${enumName}\`.`, - EnumStringMemberInconsistentlyInitialized: ({ - enumName - }) => `String enum members need to consistently either all use initializers, or use no initializers, in enum \`${enumName}\`.`, - GetterMayNotHaveThisParam: "A getter cannot have a `this` parameter.", - ImportReflectionHasImportType: "An `import module` declaration can not use `type` or `typeof` keyword.", - ImportTypeShorthandOnlyInPureImport: "The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.", - InexactInsideExact: "Explicit inexact syntax cannot appear inside an explicit exact object type.", - InexactInsideNonObject: "Explicit inexact syntax cannot appear in class or interface definitions.", - InexactVariance: "Explicit inexact syntax cannot have variance.", - InvalidNonTypeImportInDeclareModule: "Imports within a `declare module` body must always be `import type` or `import typeof`.", - MissingTypeParamDefault: "Type parameter declaration needs a default, since a preceding type parameter declaration has a default.", - NestedDeclareModule: "`declare module` cannot be used inside another `declare module`.", - NestedFlowComment: "Cannot have a flow comment inside another flow comment.", - PatternIsOptional: Object.assign({ - message: "A binding pattern parameter cannot be optional in an implementation signature." - }, { - reasonCode: "OptionalBindingPattern" - }), - SetterMayNotHaveThisParam: "A setter cannot have a `this` parameter.", - SpreadVariance: "Spread properties cannot have variance.", - ThisParamAnnotationRequired: "A type annotation is required for the `this` parameter.", - ThisParamBannedInConstructor: "Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.", - ThisParamMayNotBeOptional: "The `this` parameter cannot be optional.", - ThisParamMustBeFirst: "The `this` parameter must be the first function parameter.", - ThisParamNoDefault: "The `this` parameter may not have a default value.", - TypeBeforeInitializer: "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.", - TypeCastInPattern: "The type cast expression is expected to be wrapped with parenthesis.", - UnexpectedExplicitInexactInObject: "Explicit inexact syntax must appear at the end of an inexact object.", - UnexpectedReservedType: ({ - reservedType - }) => `Unexpected reserved type ${reservedType}.`, - UnexpectedReservedUnderscore: "`_` is only allowed as a type argument to call or new.", - UnexpectedSpaceBetweenModuloChecks: "Spaces between `%` and `checks` are not allowed here.", - UnexpectedSpreadType: "Spread operator cannot appear in class or interface definitions.", - UnexpectedSubtractionOperand: 'Unexpected token, expected "number" or "bigint".', - UnexpectedTokenAfterTypeParameter: "Expected an arrow function after this type parameter declaration.", - UnexpectedTypeParameterBeforeAsyncArrowFunction: "Type parameters must come after the async keyword, e.g. instead of ` async () => {}`, use `async () => {}`.", - UnsupportedDeclareExportKind: ({ - unsupportedExportKind, - suggestion - }) => `\`declare export ${unsupportedExportKind}\` is not supported. Use \`${suggestion}\` instead.`, - UnsupportedStatementInDeclareModule: "Only declares and type imports are allowed inside declare module.", - UnterminatedFlowComment: "Unterminated flow-comment." -}); -function isEsModuleType(bodyElement) { - return bodyElement.type === "DeclareExportAllDeclaration" || bodyElement.type === "DeclareExportDeclaration" && (!bodyElement.declaration || bodyElement.declaration.type !== "TypeAlias" && bodyElement.declaration.type !== "InterfaceDeclaration"); -} -function hasTypeImportKind(node) { - return node.importKind === "type" || node.importKind === "typeof"; -} -const exportSuggestions = { - const: "declare export var", - let: "declare export var", - type: "export type", - interface: "export interface" -}; -function partition(list, test) { - const list1 = []; - const list2 = []; - for (let i = 0; i < list.length; i++) { - (test(list[i], i, list) ? list1 : list2).push(list[i]); - } - return [list1, list2]; -} -const FLOW_PRAGMA_REGEX = /\*?\s*@((?:no)?flow)\b/; -var flow = superClass => class FlowParserMixin extends superClass { - constructor(...args) { - super(...args); - this.flowPragma = undefined; - } - getScopeHandler() { - return FlowScopeHandler; - } - shouldParseTypes() { - return this.getPluginOption("flow", "all") || this.flowPragma === "flow"; - } - finishToken(type, val) { - if (type !== 134 && type !== 13 && type !== 28) { - if (this.flowPragma === undefined) { - this.flowPragma = null; - } - } - super.finishToken(type, val); - } - addComment(comment) { - if (this.flowPragma === undefined) { - const matches = FLOW_PRAGMA_REGEX.exec(comment.value); - if (!matches) ;else if (matches[1] === "flow") { - this.flowPragma = "flow"; - } else if (matches[1] === "noflow") { - this.flowPragma = "noflow"; - } else { - throw new Error("Unexpected flow pragma"); - } - } - super.addComment(comment); - } - flowParseTypeInitialiser(tok) { - const oldInType = this.state.inType; - this.state.inType = true; - this.expect(tok || 14); - const type = this.flowParseType(); - this.state.inType = oldInType; - return type; - } - flowParsePredicate() { - const node = this.startNode(); - const moduloLoc = this.state.startLoc; - this.next(); - this.expectContextual(110); - if (this.state.lastTokStartLoc.index > moduloLoc.index + 1) { - this.raise(FlowErrors.UnexpectedSpaceBetweenModuloChecks, moduloLoc); - } - if (this.eat(10)) { - node.value = super.parseExpression(); - this.expect(11); - return this.finishNode(node, "DeclaredPredicate"); - } else { - return this.finishNode(node, "InferredPredicate"); - } - } - flowParseTypeAndPredicateInitialiser() { - const oldInType = this.state.inType; - this.state.inType = true; - this.expect(14); - let type = null; - let predicate = null; - if (this.match(54)) { - this.state.inType = oldInType; - predicate = this.flowParsePredicate(); - } else { - type = this.flowParseType(); - this.state.inType = oldInType; - if (this.match(54)) { - predicate = this.flowParsePredicate(); - } - } - return [type, predicate]; - } - flowParseDeclareClass(node) { - this.next(); - this.flowParseInterfaceish(node, true); - return this.finishNode(node, "DeclareClass"); - } - flowParseDeclareFunction(node) { - this.next(); - const id = node.id = this.parseIdentifier(); - const typeNode = this.startNode(); - const typeContainer = this.startNode(); - if (this.match(47)) { - typeNode.typeParameters = this.flowParseTypeParameterDeclaration(); - } else { - typeNode.typeParameters = null; - } - this.expect(10); - const tmp = this.flowParseFunctionTypeParams(); - typeNode.params = tmp.params; - typeNode.rest = tmp.rest; - typeNode.this = tmp._this; - this.expect(11); - [typeNode.returnType, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); - typeContainer.typeAnnotation = this.finishNode(typeNode, "FunctionTypeAnnotation"); - id.typeAnnotation = this.finishNode(typeContainer, "TypeAnnotation"); - this.resetEndLocation(id); - this.semicolon(); - this.scope.declareName(node.id.name, 2048, node.id.loc.start); - return this.finishNode(node, "DeclareFunction"); - } - flowParseDeclare(node, insideModule) { - if (this.match(80)) { - return this.flowParseDeclareClass(node); - } else if (this.match(68)) { - return this.flowParseDeclareFunction(node); - } else if (this.match(74)) { - return this.flowParseDeclareVariable(node); - } else if (this.eatContextual(127)) { - if (this.match(16)) { - return this.flowParseDeclareModuleExports(node); - } else { - if (insideModule) { - this.raise(FlowErrors.NestedDeclareModule, this.state.lastTokStartLoc); - } - return this.flowParseDeclareModule(node); - } - } else if (this.isContextual(130)) { - return this.flowParseDeclareTypeAlias(node); - } else if (this.isContextual(131)) { - return this.flowParseDeclareOpaqueType(node); - } else if (this.isContextual(129)) { - return this.flowParseDeclareInterface(node); - } else if (this.match(82)) { - return this.flowParseDeclareExportDeclaration(node, insideModule); - } else { - this.unexpected(); - } - } - flowParseDeclareVariable(node) { - this.next(); - node.id = this.flowParseTypeAnnotatableIdentifier(true); - this.scope.declareName(node.id.name, 5, node.id.loc.start); - this.semicolon(); - return this.finishNode(node, "DeclareVariable"); - } - flowParseDeclareModule(node) { - this.scope.enter(0); - if (this.match(134)) { - node.id = super.parseExprAtom(); - } else { - node.id = this.parseIdentifier(); - } - const bodyNode = node.body = this.startNode(); - const body = bodyNode.body = []; - this.expect(5); - while (!this.match(8)) { - let bodyNode = this.startNode(); - if (this.match(83)) { - this.next(); - if (!this.isContextual(130) && !this.match(87)) { - this.raise(FlowErrors.InvalidNonTypeImportInDeclareModule, this.state.lastTokStartLoc); - } - super.parseImport(bodyNode); - } else { - this.expectContextual(125, FlowErrors.UnsupportedStatementInDeclareModule); - bodyNode = this.flowParseDeclare(bodyNode, true); - } - body.push(bodyNode); - } - this.scope.exit(); - this.expect(8); - this.finishNode(bodyNode, "BlockStatement"); - let kind = null; - let hasModuleExport = false; - body.forEach(bodyElement => { - if (isEsModuleType(bodyElement)) { - if (kind === "CommonJS") { - this.raise(FlowErrors.AmbiguousDeclareModuleKind, bodyElement); - } - kind = "ES"; - } else if (bodyElement.type === "DeclareModuleExports") { - if (hasModuleExport) { - this.raise(FlowErrors.DuplicateDeclareModuleExports, bodyElement); - } - if (kind === "ES") { - this.raise(FlowErrors.AmbiguousDeclareModuleKind, bodyElement); - } - kind = "CommonJS"; - hasModuleExport = true; - } - }); - node.kind = kind || "CommonJS"; - return this.finishNode(node, "DeclareModule"); - } - flowParseDeclareExportDeclaration(node, insideModule) { - this.expect(82); - if (this.eat(65)) { - if (this.match(68) || this.match(80)) { - node.declaration = this.flowParseDeclare(this.startNode()); - } else { - node.declaration = this.flowParseType(); - this.semicolon(); - } - node.default = true; - return this.finishNode(node, "DeclareExportDeclaration"); - } else { - if (this.match(75) || this.isLet() || (this.isContextual(130) || this.isContextual(129)) && !insideModule) { - const label = this.state.value; - throw this.raise(FlowErrors.UnsupportedDeclareExportKind, this.state.startLoc, { - unsupportedExportKind: label, - suggestion: exportSuggestions[label] - }); - } - if (this.match(74) || this.match(68) || this.match(80) || this.isContextual(131)) { - node.declaration = this.flowParseDeclare(this.startNode()); - node.default = false; - return this.finishNode(node, "DeclareExportDeclaration"); - } else if (this.match(55) || this.match(5) || this.isContextual(129) || this.isContextual(130) || this.isContextual(131)) { - node = this.parseExport(node, null); - if (node.type === "ExportNamedDeclaration") { - node.type = "ExportDeclaration"; - node.default = false; - delete node.exportKind; - } - node.type = "Declare" + node.type; - return node; - } - } - this.unexpected(); - } - flowParseDeclareModuleExports(node) { - this.next(); - this.expectContextual(111); - node.typeAnnotation = this.flowParseTypeAnnotation(); - this.semicolon(); - return this.finishNode(node, "DeclareModuleExports"); - } - flowParseDeclareTypeAlias(node) { - this.next(); - const finished = this.flowParseTypeAlias(node); - finished.type = "DeclareTypeAlias"; - return finished; - } - flowParseDeclareOpaqueType(node) { - this.next(); - const finished = this.flowParseOpaqueType(node, true); - finished.type = "DeclareOpaqueType"; - return finished; - } - flowParseDeclareInterface(node) { - this.next(); - this.flowParseInterfaceish(node, false); - return this.finishNode(node, "DeclareInterface"); - } - flowParseInterfaceish(node, isClass) { - node.id = this.flowParseRestrictedIdentifier(!isClass, true); - this.scope.declareName(node.id.name, isClass ? 17 : 8201, node.id.loc.start); - if (this.match(47)) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } else { - node.typeParameters = null; - } - node.extends = []; - if (this.eat(81)) { - do { - node.extends.push(this.flowParseInterfaceExtends()); - } while (!isClass && this.eat(12)); - } - if (isClass) { - node.implements = []; - node.mixins = []; - if (this.eatContextual(117)) { - do { - node.mixins.push(this.flowParseInterfaceExtends()); - } while (this.eat(12)); - } - if (this.eatContextual(113)) { - do { - node.implements.push(this.flowParseInterfaceExtends()); - } while (this.eat(12)); - } - } - node.body = this.flowParseObjectType({ - allowStatic: isClass, - allowExact: false, - allowSpread: false, - allowProto: isClass, - allowInexact: false - }); - } - flowParseInterfaceExtends() { - const node = this.startNode(); - node.id = this.flowParseQualifiedTypeIdentifier(); - if (this.match(47)) { - node.typeParameters = this.flowParseTypeParameterInstantiation(); - } else { - node.typeParameters = null; - } - return this.finishNode(node, "InterfaceExtends"); - } - flowParseInterface(node) { - this.flowParseInterfaceish(node, false); - return this.finishNode(node, "InterfaceDeclaration"); - } - checkNotUnderscore(word) { - if (word === "_") { - this.raise(FlowErrors.UnexpectedReservedUnderscore, this.state.startLoc); - } - } - checkReservedType(word, startLoc, declaration) { - if (!reservedTypes.has(word)) return; - this.raise(declaration ? FlowErrors.AssignReservedType : FlowErrors.UnexpectedReservedType, startLoc, { - reservedType: word - }); - } - flowParseRestrictedIdentifier(liberal, declaration) { - this.checkReservedType(this.state.value, this.state.startLoc, declaration); - return this.parseIdentifier(liberal); - } - flowParseTypeAlias(node) { - node.id = this.flowParseRestrictedIdentifier(false, true); - this.scope.declareName(node.id.name, 8201, node.id.loc.start); - if (this.match(47)) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } else { - node.typeParameters = null; - } - node.right = this.flowParseTypeInitialiser(29); - this.semicolon(); - return this.finishNode(node, "TypeAlias"); - } - flowParseOpaqueType(node, declare) { - this.expectContextual(130); - node.id = this.flowParseRestrictedIdentifier(true, true); - this.scope.declareName(node.id.name, 8201, node.id.loc.start); - if (this.match(47)) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } else { - node.typeParameters = null; - } - node.supertype = null; - if (this.match(14)) { - node.supertype = this.flowParseTypeInitialiser(14); - } - node.impltype = null; - if (!declare) { - node.impltype = this.flowParseTypeInitialiser(29); - } - this.semicolon(); - return this.finishNode(node, "OpaqueType"); - } - flowParseTypeParameter(requireDefault = false) { - const nodeStartLoc = this.state.startLoc; - const node = this.startNode(); - const variance = this.flowParseVariance(); - const ident = this.flowParseTypeAnnotatableIdentifier(); - node.name = ident.name; - node.variance = variance; - node.bound = ident.typeAnnotation; - if (this.match(29)) { - this.eat(29); - node.default = this.flowParseType(); - } else { - if (requireDefault) { - this.raise(FlowErrors.MissingTypeParamDefault, nodeStartLoc); - } - } - return this.finishNode(node, "TypeParameter"); - } - flowParseTypeParameterDeclaration() { - const oldInType = this.state.inType; - const node = this.startNode(); - node.params = []; - this.state.inType = true; - if (this.match(47) || this.match(143)) { - this.next(); - } else { - this.unexpected(); - } - let defaultRequired = false; - do { - const typeParameter = this.flowParseTypeParameter(defaultRequired); - node.params.push(typeParameter); - if (typeParameter.default) { - defaultRequired = true; - } - if (!this.match(48)) { - this.expect(12); - } - } while (!this.match(48)); - this.expect(48); - this.state.inType = oldInType; - return this.finishNode(node, "TypeParameterDeclaration"); - } - flowInTopLevelContext(cb) { - if (this.curContext() !== types.brace) { - const oldContext = this.state.context; - this.state.context = [oldContext[0]]; - try { - return cb(); - } finally { - this.state.context = oldContext; - } - } else { - return cb(); - } - } - flowParseTypeParameterInstantiationInExpression() { - if (this.reScan_lt() !== 47) return; - return this.flowParseTypeParameterInstantiation(); - } - flowParseTypeParameterInstantiation() { - const node = this.startNode(); - const oldInType = this.state.inType; - this.state.inType = true; - node.params = []; - this.flowInTopLevelContext(() => { - this.expect(47); - const oldNoAnonFunctionType = this.state.noAnonFunctionType; - this.state.noAnonFunctionType = false; - while (!this.match(48)) { - node.params.push(this.flowParseType()); - if (!this.match(48)) { - this.expect(12); - } - } - this.state.noAnonFunctionType = oldNoAnonFunctionType; - }); - this.state.inType = oldInType; - if (!this.state.inType && this.curContext() === types.brace) { - this.reScan_lt_gt(); - } - this.expect(48); - return this.finishNode(node, "TypeParameterInstantiation"); - } - flowParseTypeParameterInstantiationCallOrNew() { - if (this.reScan_lt() !== 47) return; - const node = this.startNode(); - const oldInType = this.state.inType; - node.params = []; - this.state.inType = true; - this.expect(47); - while (!this.match(48)) { - node.params.push(this.flowParseTypeOrImplicitInstantiation()); - if (!this.match(48)) { - this.expect(12); - } - } - this.expect(48); - this.state.inType = oldInType; - return this.finishNode(node, "TypeParameterInstantiation"); - } - flowParseInterfaceType() { - const node = this.startNode(); - this.expectContextual(129); - node.extends = []; - if (this.eat(81)) { - do { - node.extends.push(this.flowParseInterfaceExtends()); - } while (this.eat(12)); - } - node.body = this.flowParseObjectType({ - allowStatic: false, - allowExact: false, - allowSpread: false, - allowProto: false, - allowInexact: false - }); - return this.finishNode(node, "InterfaceTypeAnnotation"); - } - flowParseObjectPropertyKey() { - return this.match(135) || this.match(134) ? super.parseExprAtom() : this.parseIdentifier(true); - } - flowParseObjectTypeIndexer(node, isStatic, variance) { - node.static = isStatic; - if (this.lookahead().type === 14) { - node.id = this.flowParseObjectPropertyKey(); - node.key = this.flowParseTypeInitialiser(); - } else { - node.id = null; - node.key = this.flowParseType(); - } - this.expect(3); - node.value = this.flowParseTypeInitialiser(); - node.variance = variance; - return this.finishNode(node, "ObjectTypeIndexer"); - } - flowParseObjectTypeInternalSlot(node, isStatic) { - node.static = isStatic; - node.id = this.flowParseObjectPropertyKey(); - this.expect(3); - this.expect(3); - if (this.match(47) || this.match(10)) { - node.method = true; - node.optional = false; - node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.loc.start)); - } else { - node.method = false; - if (this.eat(17)) { - node.optional = true; - } - node.value = this.flowParseTypeInitialiser(); - } - return this.finishNode(node, "ObjectTypeInternalSlot"); - } - flowParseObjectTypeMethodish(node) { - node.params = []; - node.rest = null; - node.typeParameters = null; - node.this = null; - if (this.match(47)) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } - this.expect(10); - if (this.match(78)) { - node.this = this.flowParseFunctionTypeParam(true); - node.this.name = null; - if (!this.match(11)) { - this.expect(12); - } - } - while (!this.match(11) && !this.match(21)) { - node.params.push(this.flowParseFunctionTypeParam(false)); - if (!this.match(11)) { - this.expect(12); - } - } - if (this.eat(21)) { - node.rest = this.flowParseFunctionTypeParam(false); - } - this.expect(11); - node.returnType = this.flowParseTypeInitialiser(); - return this.finishNode(node, "FunctionTypeAnnotation"); - } - flowParseObjectTypeCallProperty(node, isStatic) { - const valueNode = this.startNode(); - node.static = isStatic; - node.value = this.flowParseObjectTypeMethodish(valueNode); - return this.finishNode(node, "ObjectTypeCallProperty"); - } - flowParseObjectType({ - allowStatic, - allowExact, - allowSpread, - allowProto, - allowInexact - }) { - const oldInType = this.state.inType; - this.state.inType = true; - const nodeStart = this.startNode(); - nodeStart.callProperties = []; - nodeStart.properties = []; - nodeStart.indexers = []; - nodeStart.internalSlots = []; - let endDelim; - let exact; - let inexact = false; - if (allowExact && this.match(6)) { - this.expect(6); - endDelim = 9; - exact = true; - } else { - this.expect(5); - endDelim = 8; - exact = false; - } - nodeStart.exact = exact; - while (!this.match(endDelim)) { - let isStatic = false; - let protoStartLoc = null; - let inexactStartLoc = null; - const node = this.startNode(); - if (allowProto && this.isContextual(118)) { - const lookahead = this.lookahead(); - if (lookahead.type !== 14 && lookahead.type !== 17) { - this.next(); - protoStartLoc = this.state.startLoc; - allowStatic = false; - } - } - if (allowStatic && this.isContextual(106)) { - const lookahead = this.lookahead(); - if (lookahead.type !== 14 && lookahead.type !== 17) { - this.next(); - isStatic = true; - } - } - const variance = this.flowParseVariance(); - if (this.eat(0)) { - if (protoStartLoc != null) { - this.unexpected(protoStartLoc); - } - if (this.eat(0)) { - if (variance) { - this.unexpected(variance.loc.start); - } - nodeStart.internalSlots.push(this.flowParseObjectTypeInternalSlot(node, isStatic)); - } else { - nodeStart.indexers.push(this.flowParseObjectTypeIndexer(node, isStatic, variance)); - } - } else if (this.match(10) || this.match(47)) { - if (protoStartLoc != null) { - this.unexpected(protoStartLoc); - } - if (variance) { - this.unexpected(variance.loc.start); - } - nodeStart.callProperties.push(this.flowParseObjectTypeCallProperty(node, isStatic)); - } else { - let kind = "init"; - if (this.isContextual(99) || this.isContextual(104)) { - const lookahead = this.lookahead(); - if (tokenIsLiteralPropertyName(lookahead.type)) { - kind = this.state.value; - this.next(); - } - } - const propOrInexact = this.flowParseObjectTypeProperty(node, isStatic, protoStartLoc, variance, kind, allowSpread, allowInexact != null ? allowInexact : !exact); - if (propOrInexact === null) { - inexact = true; - inexactStartLoc = this.state.lastTokStartLoc; - } else { - nodeStart.properties.push(propOrInexact); - } - } - this.flowObjectTypeSemicolon(); - if (inexactStartLoc && !this.match(8) && !this.match(9)) { - this.raise(FlowErrors.UnexpectedExplicitInexactInObject, inexactStartLoc); - } - } - this.expect(endDelim); - if (allowSpread) { - nodeStart.inexact = inexact; - } - const out = this.finishNode(nodeStart, "ObjectTypeAnnotation"); - this.state.inType = oldInType; - return out; - } - flowParseObjectTypeProperty(node, isStatic, protoStartLoc, variance, kind, allowSpread, allowInexact) { - if (this.eat(21)) { - const isInexactToken = this.match(12) || this.match(13) || this.match(8) || this.match(9); - if (isInexactToken) { - if (!allowSpread) { - this.raise(FlowErrors.InexactInsideNonObject, this.state.lastTokStartLoc); - } else if (!allowInexact) { - this.raise(FlowErrors.InexactInsideExact, this.state.lastTokStartLoc); - } - if (variance) { - this.raise(FlowErrors.InexactVariance, variance); - } - return null; - } - if (!allowSpread) { - this.raise(FlowErrors.UnexpectedSpreadType, this.state.lastTokStartLoc); - } - if (protoStartLoc != null) { - this.unexpected(protoStartLoc); - } - if (variance) { - this.raise(FlowErrors.SpreadVariance, variance); - } - node.argument = this.flowParseType(); - return this.finishNode(node, "ObjectTypeSpreadProperty"); - } else { - node.key = this.flowParseObjectPropertyKey(); - node.static = isStatic; - node.proto = protoStartLoc != null; - node.kind = kind; - let optional = false; - if (this.match(47) || this.match(10)) { - node.method = true; - if (protoStartLoc != null) { - this.unexpected(protoStartLoc); - } - if (variance) { - this.unexpected(variance.loc.start); - } - node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.loc.start)); - if (kind === "get" || kind === "set") { - this.flowCheckGetterSetterParams(node); - } - if (!allowSpread && node.key.name === "constructor" && node.value.this) { - this.raise(FlowErrors.ThisParamBannedInConstructor, node.value.this); - } - } else { - if (kind !== "init") this.unexpected(); - node.method = false; - if (this.eat(17)) { - optional = true; - } - node.value = this.flowParseTypeInitialiser(); - node.variance = variance; - } - node.optional = optional; - return this.finishNode(node, "ObjectTypeProperty"); - } - } - flowCheckGetterSetterParams(property) { - const paramCount = property.kind === "get" ? 0 : 1; - const length = property.value.params.length + (property.value.rest ? 1 : 0); - if (property.value.this) { - this.raise(property.kind === "get" ? FlowErrors.GetterMayNotHaveThisParam : FlowErrors.SetterMayNotHaveThisParam, property.value.this); - } - if (length !== paramCount) { - this.raise(property.kind === "get" ? Errors.BadGetterArity : Errors.BadSetterArity, property); - } - if (property.kind === "set" && property.value.rest) { - this.raise(Errors.BadSetterRestParameter, property); - } - } - flowObjectTypeSemicolon() { - if (!this.eat(13) && !this.eat(12) && !this.match(8) && !this.match(9)) { - this.unexpected(); - } - } - flowParseQualifiedTypeIdentifier(startLoc, id) { - startLoc != null ? startLoc : startLoc = this.state.startLoc; - let node = id || this.flowParseRestrictedIdentifier(true); - while (this.eat(16)) { - const node2 = this.startNodeAt(startLoc); - node2.qualification = node; - node2.id = this.flowParseRestrictedIdentifier(true); - node = this.finishNode(node2, "QualifiedTypeIdentifier"); - } + castNodeTo(node, type) { + node.type = type; return node; } - flowParseGenericType(startLoc, id) { - const node = this.startNodeAt(startLoc); - node.typeParameters = null; - node.id = this.flowParseQualifiedTypeIdentifier(startLoc, id); - if (this.match(47)) { - node.typeParameters = this.flowParseTypeParameterInstantiation(); - } - return this.finishNode(node, "GenericTypeAnnotation"); - } - flowParseTypeofType() { - const node = this.startNode(); - this.expect(87); - node.argument = this.flowParsePrimaryType(); - return this.finishNode(node, "TypeofTypeAnnotation"); - } - flowParseTupleType() { - const node = this.startNode(); - node.types = []; - this.expect(0); - while (this.state.pos < this.length && !this.match(3)) { - node.types.push(this.flowParseType()); - if (this.match(3)) break; - this.expect(12); - } - this.expect(3); - return this.finishNode(node, "TupleTypeAnnotation"); - } - flowParseFunctionTypeParam(first) { - let name = null; - let optional = false; - let typeAnnotation = null; - const node = this.startNode(); - const lh = this.lookahead(); - const isThis = this.state.type === 78; - if (lh.type === 14 || lh.type === 17) { - if (isThis && !first) { - this.raise(FlowErrors.ThisParamMustBeFirst, node); - } - name = this.parseIdentifier(isThis); - if (this.eat(17)) { - optional = true; - if (isThis) { - this.raise(FlowErrors.ThisParamMayNotBeOptional, node); - } - } - typeAnnotation = this.flowParseTypeInitialiser(); - } else { - typeAnnotation = this.flowParseType(); - } - node.name = name; - node.optional = optional; - node.typeAnnotation = typeAnnotation; - return this.finishNode(node, "FunctionTypeParam"); - } - reinterpretTypeAsFunctionTypeParam(type) { - const node = this.startNodeAt(type.loc.start); - node.name = null; - node.optional = false; - node.typeAnnotation = type; - return this.finishNode(node, "FunctionTypeParam"); - } - flowParseFunctionTypeParams(params = []) { - let rest = null; - let _this = null; - if (this.match(78)) { - _this = this.flowParseFunctionTypeParam(true); - _this.name = null; - if (!this.match(11)) { - this.expect(12); - } - } - while (!this.match(11) && !this.match(21)) { - params.push(this.flowParseFunctionTypeParam(false)); - if (!this.match(11)) { - this.expect(12); - } - } - if (this.eat(21)) { - rest = this.flowParseFunctionTypeParam(false); - } - return { - params, - rest, - _this - }; - } - flowIdentToTypeAnnotation(startLoc, node, id) { - switch (id.name) { - case "any": - return this.finishNode(node, "AnyTypeAnnotation"); - case "bool": - case "boolean": - return this.finishNode(node, "BooleanTypeAnnotation"); - case "mixed": - return this.finishNode(node, "MixedTypeAnnotation"); - case "empty": - return this.finishNode(node, "EmptyTypeAnnotation"); - case "number": - return this.finishNode(node, "NumberTypeAnnotation"); - case "string": - return this.finishNode(node, "StringTypeAnnotation"); - case "symbol": - return this.finishNode(node, "SymbolTypeAnnotation"); - default: - this.checkNotUnderscore(id.name); - return this.flowParseGenericType(startLoc, id); - } - } - flowParsePrimaryType() { - const startLoc = this.state.startLoc; - const node = this.startNode(); - let tmp; - let type; - let isGroupedType = false; - const oldNoAnonFunctionType = this.state.noAnonFunctionType; - switch (this.state.type) { - case 5: - return this.flowParseObjectType({ - allowStatic: false, - allowExact: false, - allowSpread: true, - allowProto: false, - allowInexact: true - }); - case 6: - return this.flowParseObjectType({ - allowStatic: false, - allowExact: true, - allowSpread: true, - allowProto: false, - allowInexact: false - }); - case 0: - this.state.noAnonFunctionType = false; - type = this.flowParseTupleType(); - this.state.noAnonFunctionType = oldNoAnonFunctionType; - return type; - case 47: - { - const node = this.startNode(); - node.typeParameters = this.flowParseTypeParameterDeclaration(); - this.expect(10); - tmp = this.flowParseFunctionTypeParams(); - node.params = tmp.params; - node.rest = tmp.rest; - node.this = tmp._this; - this.expect(11); - this.expect(19); - node.returnType = this.flowParseType(); - return this.finishNode(node, "FunctionTypeAnnotation"); - } - case 10: - { - const node = this.startNode(); - this.next(); - if (!this.match(11) && !this.match(21)) { - if (tokenIsIdentifier(this.state.type) || this.match(78)) { - const token = this.lookahead().type; - isGroupedType = token !== 17 && token !== 14; - } else { - isGroupedType = true; - } - } - if (isGroupedType) { - this.state.noAnonFunctionType = false; - type = this.flowParseType(); - this.state.noAnonFunctionType = oldNoAnonFunctionType; - if (this.state.noAnonFunctionType || !(this.match(12) || this.match(11) && this.lookahead().type === 19)) { - this.expect(11); - return type; - } else { - this.eat(12); - } - } - if (type) { - tmp = this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(type)]); - } else { - tmp = this.flowParseFunctionTypeParams(); - } - node.params = tmp.params; - node.rest = tmp.rest; - node.this = tmp._this; - this.expect(11); - this.expect(19); - node.returnType = this.flowParseType(); - node.typeParameters = null; - return this.finishNode(node, "FunctionTypeAnnotation"); - } - case 134: - return this.parseLiteral(this.state.value, "StringLiteralTypeAnnotation"); - case 85: - case 86: - node.value = this.match(85); - this.next(); - return this.finishNode(node, "BooleanLiteralTypeAnnotation"); - case 53: - if (this.state.value === "-") { - this.next(); - if (this.match(135)) { - return this.parseLiteralAtNode(-this.state.value, "NumberLiteralTypeAnnotation", node); - } - if (this.match(136)) { - return this.parseLiteralAtNode(-this.state.value, "BigIntLiteralTypeAnnotation", node); - } - throw this.raise(FlowErrors.UnexpectedSubtractionOperand, this.state.startLoc); - } - this.unexpected(); - return; - case 135: - return this.parseLiteral(this.state.value, "NumberLiteralTypeAnnotation"); - case 136: - return this.parseLiteral(this.state.value, "BigIntLiteralTypeAnnotation"); - case 88: - this.next(); - return this.finishNode(node, "VoidTypeAnnotation"); - case 84: - this.next(); - return this.finishNode(node, "NullLiteralTypeAnnotation"); - case 78: - this.next(); - return this.finishNode(node, "ThisTypeAnnotation"); - case 55: - this.next(); - return this.finishNode(node, "ExistsTypeAnnotation"); - case 87: - return this.flowParseTypeofType(); - default: - if (tokenIsKeyword(this.state.type)) { - const label = tokenLabelName(this.state.type); - this.next(); - return super.createIdentifier(node, label); - } else if (tokenIsIdentifier(this.state.type)) { - if (this.isContextual(129)) { - return this.flowParseInterfaceType(); - } - return this.flowIdentToTypeAnnotation(startLoc, node, this.parseIdentifier()); - } - } - this.unexpected(); - } - flowParsePostfixType() { - const startLoc = this.state.startLoc; - let type = this.flowParsePrimaryType(); - let seenOptionalIndexedAccess = false; - while ((this.match(0) || this.match(18)) && !this.canInsertSemicolon()) { - const node = this.startNodeAt(startLoc); - const optional = this.eat(18); - seenOptionalIndexedAccess = seenOptionalIndexedAccess || optional; - this.expect(0); - if (!optional && this.match(3)) { - node.elementType = type; - this.next(); - type = this.finishNode(node, "ArrayTypeAnnotation"); - } else { - node.objectType = type; - node.indexType = this.flowParseType(); - this.expect(3); - if (seenOptionalIndexedAccess) { - node.optional = optional; - type = this.finishNode(node, "OptionalIndexedAccessType"); - } else { - type = this.finishNode(node, "IndexedAccessType"); - } - } - } - return type; - } - flowParsePrefixType() { - const node = this.startNode(); - if (this.eat(17)) { - node.typeAnnotation = this.flowParsePrefixType(); - return this.finishNode(node, "NullableTypeAnnotation"); - } else { - return this.flowParsePostfixType(); - } - } - flowParseAnonFunctionWithoutParens() { - const param = this.flowParsePrefixType(); - if (!this.state.noAnonFunctionType && this.eat(19)) { - const node = this.startNodeAt(param.loc.start); - node.params = [this.reinterpretTypeAsFunctionTypeParam(param)]; - node.rest = null; - node.this = null; - node.returnType = this.flowParseType(); - node.typeParameters = null; - return this.finishNode(node, "FunctionTypeAnnotation"); - } - return param; - } - flowParseIntersectionType() { - const node = this.startNode(); - this.eat(45); - const type = this.flowParseAnonFunctionWithoutParens(); - node.types = [type]; - while (this.eat(45)) { - node.types.push(this.flowParseAnonFunctionWithoutParens()); - } - return node.types.length === 1 ? type : this.finishNode(node, "IntersectionTypeAnnotation"); - } - flowParseUnionType() { - const node = this.startNode(); - this.eat(43); - const type = this.flowParseIntersectionType(); - node.types = [type]; - while (this.eat(43)) { - node.types.push(this.flowParseIntersectionType()); - } - return node.types.length === 1 ? type : this.finishNode(node, "UnionTypeAnnotation"); - } - flowParseType() { - const oldInType = this.state.inType; - this.state.inType = true; - const type = this.flowParseUnionType(); - this.state.inType = oldInType; - return type; - } - flowParseTypeOrImplicitInstantiation() { - if (this.state.type === 132 && this.state.value === "_") { - const startLoc = this.state.startLoc; - const node = this.parseIdentifier(); - return this.flowParseGenericType(startLoc, node); - } else { - return this.flowParseType(); - } - } - flowParseTypeAnnotation() { - const node = this.startNode(); - node.typeAnnotation = this.flowParseTypeInitialiser(); - return this.finishNode(node, "TypeAnnotation"); - } - flowParseTypeAnnotatableIdentifier(allowPrimitiveOverride) { - const ident = allowPrimitiveOverride ? this.parseIdentifier() : this.flowParseRestrictedIdentifier(); - if (this.match(14)) { - ident.typeAnnotation = this.flowParseTypeAnnotation(); - this.resetEndLocation(ident); - } - return ident; - } - typeCastToParameter(node) { - node.expression.typeAnnotation = node.typeAnnotation; - this.resetEndLocation(node.expression, node.typeAnnotation.loc.end); - return node.expression; - } - flowParseVariance() { - let variance = null; - if (this.match(53)) { - variance = this.startNode(); - if (this.state.value === "+") { - variance.kind = "plus"; - } else { - variance.kind = "minus"; - } - this.next(); - return this.finishNode(variance, "Variance"); - } - return variance; - } - parseFunctionBody(node, allowExpressionBody, isMethod = false) { - if (allowExpressionBody) { - this.forwardNoArrowParamsConversionAt(node, () => super.parseFunctionBody(node, true, isMethod)); - return; - } - super.parseFunctionBody(node, false, isMethod); - } - parseFunctionBodyAndFinish(node, type, isMethod = false) { - if (this.match(14)) { - const typeNode = this.startNode(); - [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); - node.returnType = typeNode.typeAnnotation ? this.finishNode(typeNode, "TypeAnnotation") : null; - } - return super.parseFunctionBodyAndFinish(node, type, isMethod); - } - parseStatementLike(flags) { - if (this.state.strict && this.isContextual(129)) { - const lookahead = this.lookahead(); - if (tokenIsKeywordOrIdentifier(lookahead.type)) { - const node = this.startNode(); - this.next(); - return this.flowParseInterface(node); - } - } else if (this.isContextual(126)) { - const node = this.startNode(); - this.next(); - return this.flowParseEnumDeclaration(node); - } - const stmt = super.parseStatementLike(flags); - if (this.flowPragma === undefined && !this.isValidDirective(stmt)) { - this.flowPragma = null; - } - return stmt; - } - parseExpressionStatement(node, expr, decorators) { - if (expr.type === "Identifier") { - if (expr.name === "declare") { - if (this.match(80) || tokenIsIdentifier(this.state.type) || this.match(68) || this.match(74) || this.match(82)) { - return this.flowParseDeclare(node); - } - } else if (tokenIsIdentifier(this.state.type)) { - if (expr.name === "interface") { - return this.flowParseInterface(node); - } else if (expr.name === "type") { - return this.flowParseTypeAlias(node); - } else if (expr.name === "opaque") { - return this.flowParseOpaqueType(node, false); - } - } - } - return super.parseExpressionStatement(node, expr, decorators); - } - shouldParseExportDeclaration() { - const { - type - } = this.state; - if (type === 126 || tokenIsFlowInterfaceOrTypeOrOpaque(type)) { - return !this.state.containsEsc; - } - return super.shouldParseExportDeclaration(); - } - isExportDefaultSpecifier() { - const { - type - } = this.state; - if (type === 126 || tokenIsFlowInterfaceOrTypeOrOpaque(type)) { - return this.state.containsEsc; - } - return super.isExportDefaultSpecifier(); - } - parseExportDefaultExpression() { - if (this.isContextual(126)) { - const node = this.startNode(); - this.next(); - return this.flowParseEnumDeclaration(node); - } - return super.parseExportDefaultExpression(); - } - parseConditional(expr, startLoc, refExpressionErrors) { - if (!this.match(17)) return expr; - if (this.state.maybeInArrowParameters) { - const nextCh = this.lookaheadCharCode(); - if (nextCh === 44 || nextCh === 61 || nextCh === 58 || nextCh === 41) { - this.setOptionalParametersError(refExpressionErrors); - return expr; - } - } - this.expect(17); - const state = this.state.clone(); - const originalNoArrowAt = this.state.noArrowAt; - const node = this.startNodeAt(startLoc); - let { - consequent, - failed - } = this.tryParseConditionalConsequent(); - let [valid, invalid] = this.getArrowLikeExpressions(consequent); - if (failed || invalid.length > 0) { - const noArrowAt = [...originalNoArrowAt]; - if (invalid.length > 0) { - this.state = state; - this.state.noArrowAt = noArrowAt; - for (let i = 0; i < invalid.length; i++) { - noArrowAt.push(invalid[i].start); - } - ({ - consequent, - failed - } = this.tryParseConditionalConsequent()); - [valid, invalid] = this.getArrowLikeExpressions(consequent); - } - if (failed && valid.length > 1) { - this.raise(FlowErrors.AmbiguousConditionalArrow, state.startLoc); - } - if (failed && valid.length === 1) { - this.state = state; - noArrowAt.push(valid[0].start); - this.state.noArrowAt = noArrowAt; - ({ - consequent, - failed - } = this.tryParseConditionalConsequent()); - } - } - this.getArrowLikeExpressions(consequent, true); - this.state.noArrowAt = originalNoArrowAt; - this.expect(14); - node.test = expr; - node.consequent = consequent; - node.alternate = this.forwardNoArrowParamsConversionAt(node, () => this.parseMaybeAssign(undefined, undefined)); - return this.finishNode(node, "ConditionalExpression"); - } - tryParseConditionalConsequent() { - this.state.noArrowParamsConversionAt.push(this.state.start); - const consequent = this.parseMaybeAssignAllowIn(); - const failed = !this.match(14); - this.state.noArrowParamsConversionAt.pop(); - return { - consequent, - failed - }; - } - getArrowLikeExpressions(node, disallowInvalid) { - const stack = [node]; - const arrows = []; - while (stack.length !== 0) { - const node = stack.pop(); - if (node.type === "ArrowFunctionExpression" && node.body.type !== "BlockStatement") { - if (node.typeParameters || !node.returnType) { - this.finishArrowValidation(node); - } else { - arrows.push(node); - } - stack.push(node.body); - } else if (node.type === "ConditionalExpression") { - stack.push(node.consequent); - stack.push(node.alternate); - } - } - if (disallowInvalid) { - arrows.forEach(node => this.finishArrowValidation(node)); - return [arrows, []]; - } - return partition(arrows, node => node.params.every(param => this.isAssignable(param, true))); - } - finishArrowValidation(node) { - var _node$extra; - this.toAssignableList(node.params, (_node$extra = node.extra) == null ? void 0 : _node$extra.trailingCommaLoc, false); - this.scope.enter(2 | 4); - super.checkParams(node, false, true); - this.scope.exit(); - } - forwardNoArrowParamsConversionAt(node, parse) { - let result; - if (this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(node.start))) { - this.state.noArrowParamsConversionAt.push(this.state.start); - result = parse(); - this.state.noArrowParamsConversionAt.pop(); - } else { - result = parse(); - } - return result; - } - parseParenItem(node, startLoc) { - const newNode = super.parseParenItem(node, startLoc); - if (this.eat(17)) { - newNode.optional = true; - this.resetEndLocation(node); - } - if (this.match(14)) { - const typeCastNode = this.startNodeAt(startLoc); - typeCastNode.expression = newNode; - typeCastNode.typeAnnotation = this.flowParseTypeAnnotation(); - return this.finishNode(typeCastNode, "TypeCastExpression"); - } - return newNode; - } - assertModuleNodeAllowed(node) { - if (node.type === "ImportDeclaration" && (node.importKind === "type" || node.importKind === "typeof") || node.type === "ExportNamedDeclaration" && node.exportKind === "type" || node.type === "ExportAllDeclaration" && node.exportKind === "type") { - return; - } - super.assertModuleNodeAllowed(node); - } - parseExportDeclaration(node) { - if (this.isContextual(130)) { - node.exportKind = "type"; - const declarationNode = this.startNode(); - this.next(); - if (this.match(5)) { - node.specifiers = this.parseExportSpecifiers(true); - super.parseExportFrom(node); - return null; - } else { - return this.flowParseTypeAlias(declarationNode); - } - } else if (this.isContextual(131)) { - node.exportKind = "type"; - const declarationNode = this.startNode(); - this.next(); - return this.flowParseOpaqueType(declarationNode, false); - } else if (this.isContextual(129)) { - node.exportKind = "type"; - const declarationNode = this.startNode(); - this.next(); - return this.flowParseInterface(declarationNode); - } else if (this.isContextual(126)) { - node.exportKind = "value"; - const declarationNode = this.startNode(); - this.next(); - return this.flowParseEnumDeclaration(declarationNode); - } else { - return super.parseExportDeclaration(node); - } - } - eatExportStar(node) { - if (super.eatExportStar(node)) return true; - if (this.isContextual(130) && this.lookahead().type === 55) { - node.exportKind = "type"; - this.next(); - this.next(); - return true; - } - return false; - } - maybeParseExportNamespaceSpecifier(node) { - const { - startLoc - } = this.state; - const hasNamespace = super.maybeParseExportNamespaceSpecifier(node); - if (hasNamespace && node.exportKind === "type") { - this.unexpected(startLoc); - } - return hasNamespace; - } - parseClassId(node, isStatement, optionalId) { - super.parseClassId(node, isStatement, optionalId); - if (this.match(47)) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } - } - parseClassMember(classBody, member, state) { - const { - startLoc - } = this.state; - if (this.isContextual(125)) { - if (super.parseClassMemberFromModifier(classBody, member)) { - return; - } - member.declare = true; - } - super.parseClassMember(classBody, member, state); - if (member.declare) { - if (member.type !== "ClassProperty" && member.type !== "ClassPrivateProperty" && member.type !== "PropertyDefinition") { - this.raise(FlowErrors.DeclareClassElement, startLoc); - } else if (member.value) { - this.raise(FlowErrors.DeclareClassFieldInitializer, member.value); - } - } - } - isIterator(word) { - return word === "iterator" || word === "asyncIterator"; - } - readIterator() { - const word = super.readWord1(); - const fullWord = "@@" + word; - if (!this.isIterator(word) || !this.state.inType) { - this.raise(Errors.InvalidIdentifier, this.state.curPosition(), { - identifierName: fullWord - }); - } - this.finishToken(132, fullWord); - } - getTokenFromCode(code) { - const next = this.input.charCodeAt(this.state.pos + 1); - if (code === 123 && next === 124) { - this.finishOp(6, 2); - } else if (this.state.inType && (code === 62 || code === 60)) { - this.finishOp(code === 62 ? 48 : 47, 1); - } else if (this.state.inType && code === 63) { - if (next === 46) { - this.finishOp(18, 2); - } else { - this.finishOp(17, 1); - } - } else if (isIteratorStart(code, next, this.input.charCodeAt(this.state.pos + 2))) { - this.state.pos += 2; - this.readIterator(); - } else { - super.getTokenFromCode(code); - } - } - isAssignable(node, isBinding) { - if (node.type === "TypeCastExpression") { - return this.isAssignable(node.expression, isBinding); - } else { - return super.isAssignable(node, isBinding); - } - } - toAssignable(node, isLHS = false) { - if (!isLHS && node.type === "AssignmentExpression" && node.left.type === "TypeCastExpression") { - node.left = this.typeCastToParameter(node.left); - } - super.toAssignable(node, isLHS); - } - toAssignableList(exprList, trailingCommaLoc, isLHS) { - for (let i = 0; i < exprList.length; i++) { - const expr = exprList[i]; - if ((expr == null ? void 0 : expr.type) === "TypeCastExpression") { - exprList[i] = this.typeCastToParameter(expr); - } - } - super.toAssignableList(exprList, trailingCommaLoc, isLHS); - } - toReferencedList(exprList, isParenthesizedExpr) { - for (let i = 0; i < exprList.length; i++) { - var _expr$extra; - const expr = exprList[i]; - if (expr && expr.type === "TypeCastExpression" && !((_expr$extra = expr.extra) != null && _expr$extra.parenthesized) && (exprList.length > 1 || !isParenthesizedExpr)) { - this.raise(FlowErrors.TypeCastInPattern, expr.typeAnnotation); - } - } - return exprList; - } - parseArrayLike(close, canBePattern, isTuple, refExpressionErrors) { - const node = super.parseArrayLike(close, canBePattern, isTuple, refExpressionErrors); - if (canBePattern && !this.state.maybeInArrowParameters) { - this.toReferencedList(node.elements); - } - return node; - } - isValidLVal(type, isParenthesized, binding) { - return type === "TypeCastExpression" || super.isValidLVal(type, isParenthesized, binding); - } - parseClassProperty(node) { - if (this.match(14)) { - node.typeAnnotation = this.flowParseTypeAnnotation(); - } - return super.parseClassProperty(node); - } - parseClassPrivateProperty(node) { - if (this.match(14)) { - node.typeAnnotation = this.flowParseTypeAnnotation(); - } - return super.parseClassPrivateProperty(node); - } - isClassMethod() { - return this.match(47) || super.isClassMethod(); - } - isClassProperty() { - return this.match(14) || super.isClassProperty(); - } - isNonstaticConstructor(method) { - return !this.match(14) && super.isNonstaticConstructor(method); - } - pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { - if (method.variance) { - this.unexpected(method.variance.loc.start); - } - delete method.variance; - if (this.match(47)) { - method.typeParameters = this.flowParseTypeParameterDeclaration(); - } - super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper); - if (method.params && isConstructor) { - const params = method.params; - if (params.length > 0 && this.isThisParam(params[0])) { - this.raise(FlowErrors.ThisParamBannedInConstructor, method); - } - } else if (method.type === "MethodDefinition" && isConstructor && method.value.params) { - const params = method.value.params; - if (params.length > 0 && this.isThisParam(params[0])) { - this.raise(FlowErrors.ThisParamBannedInConstructor, method); - } - } - } - pushClassPrivateMethod(classBody, method, isGenerator, isAsync) { - if (method.variance) { - this.unexpected(method.variance.loc.start); - } - delete method.variance; - if (this.match(47)) { - method.typeParameters = this.flowParseTypeParameterDeclaration(); - } - super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync); - } - parseClassSuper(node) { - super.parseClassSuper(node); - if (node.superClass && (this.match(47) || this.match(51))) { - { - node.superTypeParameters = this.flowParseTypeParameterInstantiationInExpression(); - } - } - if (this.isContextual(113)) { - this.next(); - const implemented = node.implements = []; - do { - const node = this.startNode(); - node.id = this.flowParseRestrictedIdentifier(true); - if (this.match(47)) { - node.typeParameters = this.flowParseTypeParameterInstantiation(); - } else { - node.typeParameters = null; - } - implemented.push(this.finishNode(node, "ClassImplements")); - } while (this.eat(12)); - } - } - checkGetterSetterParams(method) { - super.checkGetterSetterParams(method); - const params = this.getObjectOrClassMethodParams(method); - if (params.length > 0) { - const param = params[0]; - if (this.isThisParam(param) && method.kind === "get") { - this.raise(FlowErrors.GetterMayNotHaveThisParam, param); - } else if (this.isThisParam(param)) { - this.raise(FlowErrors.SetterMayNotHaveThisParam, param); - } - } - } - parsePropertyNamePrefixOperator(node) { - node.variance = this.flowParseVariance(); - } - parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) { - if (prop.variance) { - this.unexpected(prop.variance.loc.start); - } - delete prop.variance; - let typeParameters; - if (this.match(47) && !isAccessor) { - typeParameters = this.flowParseTypeParameterDeclaration(); - if (!this.match(10)) this.unexpected(); - } - const result = super.parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors); - if (typeParameters) { - (result.value || result).typeParameters = typeParameters; - } - return result; - } - parseFunctionParamType(param) { - if (this.eat(17)) { - if (param.type !== "Identifier") { - this.raise(FlowErrors.PatternIsOptional, param); - } - if (this.isThisParam(param)) { - this.raise(FlowErrors.ThisParamMayNotBeOptional, param); - } - param.optional = true; - } - if (this.match(14)) { - param.typeAnnotation = this.flowParseTypeAnnotation(); - } else if (this.isThisParam(param)) { - this.raise(FlowErrors.ThisParamAnnotationRequired, param); - } - if (this.match(29) && this.isThisParam(param)) { - this.raise(FlowErrors.ThisParamNoDefault, param); - } - this.resetEndLocation(param); - return param; - } - parseMaybeDefault(startLoc, left) { - const node = super.parseMaybeDefault(startLoc, left); - if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) { - this.raise(FlowErrors.TypeBeforeInitializer, node.typeAnnotation); - } - return node; - } - checkImportReflection(node) { - super.checkImportReflection(node); - if (node.module && node.importKind !== "value") { - this.raise(FlowErrors.ImportReflectionHasImportType, node.specifiers[0].loc.start); - } - } - parseImportSpecifierLocal(node, specifier, type) { - specifier.local = hasTypeImportKind(node) ? this.flowParseRestrictedIdentifier(true, true) : this.parseIdentifier(); - node.specifiers.push(this.finishImportSpecifier(specifier, type)); - } - isPotentialImportPhase(isExport) { - if (super.isPotentialImportPhase(isExport)) return true; - if (this.isContextual(130)) { - if (!isExport) return true; - const ch = this.lookaheadCharCode(); - return ch === 123 || ch === 42; - } - return !isExport && this.isContextual(87); - } - applyImportPhase(node, isExport, phase, loc) { - super.applyImportPhase(node, isExport, phase, loc); - if (isExport) { - if (!phase && this.match(65)) { - return; - } - node.exportKind = phase === "type" ? phase : "value"; - } else { - if (phase === "type" && this.match(55)) this.unexpected(); - node.importKind = phase === "type" || phase === "typeof" ? phase : "value"; - } - } - parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, bindingType) { - const firstIdent = specifier.imported; - let specifierTypeKind = null; - if (firstIdent.type === "Identifier") { - if (firstIdent.name === "type") { - specifierTypeKind = "type"; - } else if (firstIdent.name === "typeof") { - specifierTypeKind = "typeof"; - } - } - let isBinding = false; - if (this.isContextual(93) && !this.isLookaheadContextual("as")) { - const as_ident = this.parseIdentifier(true); - if (specifierTypeKind !== null && !tokenIsKeywordOrIdentifier(this.state.type)) { - specifier.imported = as_ident; - specifier.importKind = specifierTypeKind; - specifier.local = cloneIdentifier(as_ident); - } else { - specifier.imported = firstIdent; - specifier.importKind = null; - specifier.local = this.parseIdentifier(); - } - } else { - if (specifierTypeKind !== null && tokenIsKeywordOrIdentifier(this.state.type)) { - specifier.imported = this.parseIdentifier(true); - specifier.importKind = specifierTypeKind; - } else { - if (importedIsString) { - throw this.raise(Errors.ImportBindingIsString, specifier, { - importName: firstIdent.value - }); - } - specifier.imported = firstIdent; - specifier.importKind = null; - } - if (this.eatContextual(93)) { - specifier.local = this.parseIdentifier(); - } else { - isBinding = true; - specifier.local = cloneIdentifier(specifier.imported); - } - } - const specifierIsTypeImport = hasTypeImportKind(specifier); - if (isInTypeOnlyImport && specifierIsTypeImport) { - this.raise(FlowErrors.ImportTypeShorthandOnlyInPureImport, specifier); - } - if (isInTypeOnlyImport || specifierIsTypeImport) { - this.checkReservedType(specifier.local.name, specifier.local.loc.start, true); - } - if (isBinding && !isInTypeOnlyImport && !specifierIsTypeImport) { - this.checkReservedWord(specifier.local.name, specifier.loc.start, true, true); - } - return this.finishImportSpecifier(specifier, "ImportSpecifier"); - } - parseBindingAtom() { - switch (this.state.type) { - case 78: - return this.parseIdentifier(true); - default: - return super.parseBindingAtom(); - } - } - parseFunctionParams(node, isConstructor) { - const kind = node.kind; - if (kind !== "get" && kind !== "set" && this.match(47)) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } - super.parseFunctionParams(node, isConstructor); - } - parseVarId(decl, kind) { - super.parseVarId(decl, kind); - if (this.match(14)) { - decl.id.typeAnnotation = this.flowParseTypeAnnotation(); - this.resetEndLocation(decl.id); - } - } - parseAsyncArrowFromCallExpression(node, call) { - if (this.match(14)) { - const oldNoAnonFunctionType = this.state.noAnonFunctionType; - this.state.noAnonFunctionType = true; - node.returnType = this.flowParseTypeAnnotation(); - this.state.noAnonFunctionType = oldNoAnonFunctionType; - } - return super.parseAsyncArrowFromCallExpression(node, call); - } - shouldParseAsyncArrow() { - return this.match(14) || super.shouldParseAsyncArrow(); - } - parseMaybeAssign(refExpressionErrors, afterLeftParse) { - var _jsx; - let state = null; - let jsx; - if (this.hasPlugin("jsx") && (this.match(143) || this.match(47))) { - state = this.state.clone(); - jsx = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state); - if (!jsx.error) return jsx.node; - const { - context - } = this.state; - const currentContext = context[context.length - 1]; - if (currentContext === types.j_oTag || currentContext === types.j_expr) { - context.pop(); - } - } - if ((_jsx = jsx) != null && _jsx.error || this.match(47)) { - var _jsx2, _jsx3; - state = state || this.state.clone(); - let typeParameters; - const arrow = this.tryParse(abort => { - var _arrowExpression$extr; - typeParameters = this.flowParseTypeParameterDeclaration(); - const arrowExpression = this.forwardNoArrowParamsConversionAt(typeParameters, () => { - const result = super.parseMaybeAssign(refExpressionErrors, afterLeftParse); - this.resetStartLocationFromNode(result, typeParameters); - return result; - }); - if ((_arrowExpression$extr = arrowExpression.extra) != null && _arrowExpression$extr.parenthesized) abort(); - const expr = this.maybeUnwrapTypeCastExpression(arrowExpression); - if (expr.type !== "ArrowFunctionExpression") abort(); - expr.typeParameters = typeParameters; - this.resetStartLocationFromNode(expr, typeParameters); - return arrowExpression; - }, state); - let arrowExpression = null; - if (arrow.node && this.maybeUnwrapTypeCastExpression(arrow.node).type === "ArrowFunctionExpression") { - if (!arrow.error && !arrow.aborted) { - if (arrow.node.async) { - this.raise(FlowErrors.UnexpectedTypeParameterBeforeAsyncArrowFunction, typeParameters); - } - return arrow.node; - } - arrowExpression = arrow.node; - } - if ((_jsx2 = jsx) != null && _jsx2.node) { - this.state = jsx.failState; - return jsx.node; - } - if (arrowExpression) { - this.state = arrow.failState; - return arrowExpression; - } - if ((_jsx3 = jsx) != null && _jsx3.thrown) throw jsx.error; - if (arrow.thrown) throw arrow.error; - throw this.raise(FlowErrors.UnexpectedTokenAfterTypeParameter, typeParameters); - } - return super.parseMaybeAssign(refExpressionErrors, afterLeftParse); - } - parseArrow(node) { - if (this.match(14)) { - const result = this.tryParse(() => { - const oldNoAnonFunctionType = this.state.noAnonFunctionType; - this.state.noAnonFunctionType = true; - const typeNode = this.startNode(); - [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); - this.state.noAnonFunctionType = oldNoAnonFunctionType; - if (this.canInsertSemicolon()) this.unexpected(); - if (!this.match(19)) this.unexpected(); - return typeNode; - }); - if (result.thrown) return null; - if (result.error) this.state = result.failState; - node.returnType = result.node.typeAnnotation ? this.finishNode(result.node, "TypeAnnotation") : null; - } - return super.parseArrow(node); - } - shouldParseArrow(params) { - return this.match(14) || super.shouldParseArrow(params); - } - setArrowFunctionParameters(node, params) { - if (this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(node.start))) { - node.params = params; - } else { - super.setArrowFunctionParameters(node, params); - } - } - checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged = true) { - if (isArrowFunction && this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(node.start))) { - return; - } - for (let i = 0; i < node.params.length; i++) { - if (this.isThisParam(node.params[i]) && i > 0) { - this.raise(FlowErrors.ThisParamMustBeFirst, node.params[i]); - } - } - super.checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged); - } - parseParenAndDistinguishExpression(canBeArrow) { - return super.parseParenAndDistinguishExpression(canBeArrow && !this.state.noArrowAt.includes(this.sourceToOffsetPos(this.state.start))); - } - parseSubscripts(base, startLoc, noCalls) { - if (base.type === "Identifier" && base.name === "async" && this.state.noArrowAt.includes(startLoc.index)) { - this.next(); - const node = this.startNodeAt(startLoc); - node.callee = base; - node.arguments = super.parseCallExpressionArguments(11); - base = this.finishNode(node, "CallExpression"); - } else if (base.type === "Identifier" && base.name === "async" && this.match(47)) { - const state = this.state.clone(); - const arrow = this.tryParse(abort => this.parseAsyncArrowWithTypeParameters(startLoc) || abort(), state); - if (!arrow.error && !arrow.aborted) return arrow.node; - const result = this.tryParse(() => super.parseSubscripts(base, startLoc, noCalls), state); - if (result.node && !result.error) return result.node; - if (arrow.node) { - this.state = arrow.failState; - return arrow.node; - } - if (result.node) { - this.state = result.failState; - return result.node; - } - throw arrow.error || result.error; - } - return super.parseSubscripts(base, startLoc, noCalls); - } - parseSubscript(base, startLoc, noCalls, subscriptState) { - if (this.match(18) && this.isLookaheadToken_lt()) { - subscriptState.optionalChainMember = true; - if (noCalls) { - subscriptState.stop = true; - return base; - } - this.next(); - const node = this.startNodeAt(startLoc); - node.callee = base; - node.typeArguments = this.flowParseTypeParameterInstantiationInExpression(); - this.expect(10); - node.arguments = this.parseCallExpressionArguments(11); - node.optional = true; - return this.finishCallExpression(node, true); - } else if (!noCalls && this.shouldParseTypes() && (this.match(47) || this.match(51))) { - const node = this.startNodeAt(startLoc); - node.callee = base; - const result = this.tryParse(() => { - node.typeArguments = this.flowParseTypeParameterInstantiationCallOrNew(); - this.expect(10); - node.arguments = super.parseCallExpressionArguments(11); - if (subscriptState.optionalChainMember) { - node.optional = false; - } - return this.finishCallExpression(node, subscriptState.optionalChainMember); - }); - if (result.node) { - if (result.error) this.state = result.failState; - return result.node; - } - } - return super.parseSubscript(base, startLoc, noCalls, subscriptState); - } - parseNewCallee(node) { - super.parseNewCallee(node); - let targs = null; - if (this.shouldParseTypes() && this.match(47)) { - targs = this.tryParse(() => this.flowParseTypeParameterInstantiationCallOrNew()).node; - } - node.typeArguments = targs; - } - parseAsyncArrowWithTypeParameters(startLoc) { - const node = this.startNodeAt(startLoc); - this.parseFunctionParams(node, false); - if (!this.parseArrow(node)) return; - return super.parseArrowExpression(node, undefined, true); - } - readToken_mult_modulo(code) { - const next = this.input.charCodeAt(this.state.pos + 1); - if (code === 42 && next === 47 && this.state.hasFlowComment) { - this.state.hasFlowComment = false; - this.state.pos += 2; - this.nextToken(); - return; - } - super.readToken_mult_modulo(code); - } - readToken_pipe_amp(code) { - const next = this.input.charCodeAt(this.state.pos + 1); - if (code === 124 && next === 125) { - this.finishOp(9, 2); - return; - } - super.readToken_pipe_amp(code); - } - parseTopLevel(file, program) { - const fileNode = super.parseTopLevel(file, program); - if (this.state.hasFlowComment) { - this.raise(FlowErrors.UnterminatedFlowComment, this.state.curPosition()); - } - return fileNode; - } - skipBlockComment() { - if (this.hasPlugin("flowComments") && this.skipFlowComment()) { - if (this.state.hasFlowComment) { - throw this.raise(FlowErrors.NestedFlowComment, this.state.startLoc); - } - this.hasFlowCommentCompletion(); - const commentSkip = this.skipFlowComment(); - if (commentSkip) { - this.state.pos += commentSkip; - this.state.hasFlowComment = true; - } - return; - } - return super.skipBlockComment(this.state.hasFlowComment ? "*-/" : "*/"); - } - skipFlowComment() { - const { - pos - } = this.state; - let shiftToFirstNonWhiteSpace = 2; - while ([32, 9].includes(this.input.charCodeAt(pos + shiftToFirstNonWhiteSpace))) { - shiftToFirstNonWhiteSpace++; - } - const ch2 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos); - const ch3 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos + 1); - if (ch2 === 58 && ch3 === 58) { - return shiftToFirstNonWhiteSpace + 2; - } - if (this.input.slice(shiftToFirstNonWhiteSpace + pos, shiftToFirstNonWhiteSpace + pos + 12) === "flow-include") { - return shiftToFirstNonWhiteSpace + 12; - } - if (ch2 === 58 && ch3 !== 58) { - return shiftToFirstNonWhiteSpace; - } - return false; - } - hasFlowCommentCompletion() { - const end = this.input.indexOf("*/", this.state.pos); - if (end === -1) { - throw this.raise(Errors.UnterminatedComment, this.state.curPosition()); - } - } - flowEnumErrorBooleanMemberNotInitialized(loc, { - enumName, - memberName - }) { - this.raise(FlowErrors.EnumBooleanMemberNotInitialized, loc, { - memberName, - enumName - }); - } - flowEnumErrorInvalidMemberInitializer(loc, enumContext) { - return this.raise(!enumContext.explicitType ? FlowErrors.EnumInvalidMemberInitializerUnknownType : enumContext.explicitType === "symbol" ? FlowErrors.EnumInvalidMemberInitializerSymbolType : FlowErrors.EnumInvalidMemberInitializerPrimaryType, loc, enumContext); - } - flowEnumErrorNumberMemberNotInitialized(loc, details) { - this.raise(FlowErrors.EnumNumberMemberNotInitialized, loc, details); - } - flowEnumErrorStringMemberInconsistentlyInitialized(node, details) { - this.raise(FlowErrors.EnumStringMemberInconsistentlyInitialized, node, details); - } - flowEnumMemberInit() { - const startLoc = this.state.startLoc; - const endOfInit = () => this.match(12) || this.match(8); - switch (this.state.type) { - case 135: - { - const literal = this.parseNumericLiteral(this.state.value); - if (endOfInit()) { - return { - type: "number", - loc: literal.loc.start, - value: literal - }; - } - return { - type: "invalid", - loc: startLoc - }; - } - case 134: - { - const literal = this.parseStringLiteral(this.state.value); - if (endOfInit()) { - return { - type: "string", - loc: literal.loc.start, - value: literal - }; - } - return { - type: "invalid", - loc: startLoc - }; - } - case 85: - case 86: - { - const literal = this.parseBooleanLiteral(this.match(85)); - if (endOfInit()) { - return { - type: "boolean", - loc: literal.loc.start, - value: literal - }; - } - return { - type: "invalid", - loc: startLoc - }; - } - default: - return { - type: "invalid", - loc: startLoc - }; - } - } - flowEnumMemberRaw() { - const loc = this.state.startLoc; - const id = this.parseIdentifier(true); - const init = this.eat(29) ? this.flowEnumMemberInit() : { - type: "none", - loc - }; - return { - id, - init - }; - } - flowEnumCheckExplicitTypeMismatch(loc, context, expectedType) { - const { - explicitType - } = context; - if (explicitType === null) { - return; - } - if (explicitType !== expectedType) { - this.flowEnumErrorInvalidMemberInitializer(loc, context); - } - } - flowEnumMembers({ - enumName, - explicitType - }) { - const seenNames = new Set(); - const members = { - booleanMembers: [], - numberMembers: [], - stringMembers: [], - defaultedMembers: [] - }; - let hasUnknownMembers = false; - while (!this.match(8)) { - if (this.eat(21)) { - hasUnknownMembers = true; - break; - } - const memberNode = this.startNode(); - const { - id, - init - } = this.flowEnumMemberRaw(); - const memberName = id.name; - if (memberName === "") { - continue; - } - if (/^[a-z]/.test(memberName)) { - this.raise(FlowErrors.EnumInvalidMemberName, id, { - memberName, - suggestion: memberName[0].toUpperCase() + memberName.slice(1), - enumName - }); - } - if (seenNames.has(memberName)) { - this.raise(FlowErrors.EnumDuplicateMemberName, id, { - memberName, - enumName - }); - } - seenNames.add(memberName); - const context = { - enumName, - explicitType, - memberName - }; - memberNode.id = id; - switch (init.type) { - case "boolean": - { - this.flowEnumCheckExplicitTypeMismatch(init.loc, context, "boolean"); - memberNode.init = init.value; - members.booleanMembers.push(this.finishNode(memberNode, "EnumBooleanMember")); - break; - } - case "number": - { - this.flowEnumCheckExplicitTypeMismatch(init.loc, context, "number"); - memberNode.init = init.value; - members.numberMembers.push(this.finishNode(memberNode, "EnumNumberMember")); - break; - } - case "string": - { - this.flowEnumCheckExplicitTypeMismatch(init.loc, context, "string"); - memberNode.init = init.value; - members.stringMembers.push(this.finishNode(memberNode, "EnumStringMember")); - break; - } - case "invalid": - { - throw this.flowEnumErrorInvalidMemberInitializer(init.loc, context); - } - case "none": - { - switch (explicitType) { - case "boolean": - this.flowEnumErrorBooleanMemberNotInitialized(init.loc, context); - break; - case "number": - this.flowEnumErrorNumberMemberNotInitialized(init.loc, context); - break; - default: - members.defaultedMembers.push(this.finishNode(memberNode, "EnumDefaultedMember")); - } - } - } - if (!this.match(8)) { - this.expect(12); - } - } - return { - members, - hasUnknownMembers - }; - } - flowEnumStringMembers(initializedMembers, defaultedMembers, { - enumName - }) { - if (initializedMembers.length === 0) { - return defaultedMembers; - } else if (defaultedMembers.length === 0) { - return initializedMembers; - } else if (defaultedMembers.length > initializedMembers.length) { - for (const member of initializedMembers) { - this.flowEnumErrorStringMemberInconsistentlyInitialized(member, { - enumName - }); - } - return defaultedMembers; - } else { - for (const member of defaultedMembers) { - this.flowEnumErrorStringMemberInconsistentlyInitialized(member, { - enumName - }); - } - return initializedMembers; - } - } - flowEnumParseExplicitType({ - enumName - }) { - if (!this.eatContextual(102)) return null; - if (!tokenIsIdentifier(this.state.type)) { - throw this.raise(FlowErrors.EnumInvalidExplicitTypeUnknownSupplied, this.state.startLoc, { - enumName - }); - } - const { - value - } = this.state; - this.next(); - if (value !== "boolean" && value !== "number" && value !== "string" && value !== "symbol") { - this.raise(FlowErrors.EnumInvalidExplicitType, this.state.startLoc, { - enumName, - invalidEnumType: value - }); - } - return value; - } - flowEnumBody(node, id) { - const enumName = id.name; - const nameLoc = id.loc.start; - const explicitType = this.flowEnumParseExplicitType({ - enumName - }); - this.expect(5); - const { - members, - hasUnknownMembers - } = this.flowEnumMembers({ - enumName, - explicitType - }); - node.hasUnknownMembers = hasUnknownMembers; - switch (explicitType) { - case "boolean": - node.explicitType = true; - node.members = members.booleanMembers; - this.expect(8); - return this.finishNode(node, "EnumBooleanBody"); - case "number": - node.explicitType = true; - node.members = members.numberMembers; - this.expect(8); - return this.finishNode(node, "EnumNumberBody"); - case "string": - node.explicitType = true; - node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, { - enumName - }); - this.expect(8); - return this.finishNode(node, "EnumStringBody"); - case "symbol": - node.members = members.defaultedMembers; - this.expect(8); - return this.finishNode(node, "EnumSymbolBody"); - default: - { - const empty = () => { - node.members = []; - this.expect(8); - return this.finishNode(node, "EnumStringBody"); - }; - node.explicitType = false; - const boolsLen = members.booleanMembers.length; - const numsLen = members.numberMembers.length; - const strsLen = members.stringMembers.length; - const defaultedLen = members.defaultedMembers.length; - if (!boolsLen && !numsLen && !strsLen && !defaultedLen) { - return empty(); - } else if (!boolsLen && !numsLen) { - node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, { - enumName - }); - this.expect(8); - return this.finishNode(node, "EnumStringBody"); - } else if (!numsLen && !strsLen && boolsLen >= defaultedLen) { - for (const member of members.defaultedMembers) { - this.flowEnumErrorBooleanMemberNotInitialized(member.loc.start, { - enumName, - memberName: member.id.name - }); - } - node.members = members.booleanMembers; - this.expect(8); - return this.finishNode(node, "EnumBooleanBody"); - } else if (!boolsLen && !strsLen && numsLen >= defaultedLen) { - for (const member of members.defaultedMembers) { - this.flowEnumErrorNumberMemberNotInitialized(member.loc.start, { - enumName, - memberName: member.id.name - }); - } - node.members = members.numberMembers; - this.expect(8); - return this.finishNode(node, "EnumNumberBody"); - } else { - this.raise(FlowErrors.EnumInconsistentMemberValues, nameLoc, { - enumName - }); - return empty(); - } - } - } - } - flowParseEnumDeclaration(node) { - const id = this.parseIdentifier(); - node.id = id; - node.body = this.flowEnumBody(this.startNode(), id); - return this.finishNode(node, "EnumDeclaration"); - } - jsxParseOpeningElementAfterName(node) { - if (this.shouldParseTypes()) { - if (this.match(47) || this.match(51)) { - node.typeArguments = this.flowParseTypeParameterInstantiationInExpression(); - } - } - return super.jsxParseOpeningElementAfterName(node); - } - isLookaheadToken_lt() { - const next = this.nextTokenStart(); - if (this.input.charCodeAt(next) === 60) { - const afterNext = this.input.charCodeAt(next + 1); - return afterNext !== 60 && afterNext !== 61; - } - return false; - } - reScan_lt_gt() { - const { - type - } = this.state; - if (type === 47) { - this.state.pos -= 1; - this.readToken_lt(); - } else if (type === 48) { - this.state.pos -= 1; - this.readToken_gt(); - } - } - reScan_lt() { - const { - type - } = this.state; - if (type === 51) { - this.state.pos -= 2; - this.finishOp(47, 1); - return 47; - } - return type; - } - maybeUnwrapTypeCastExpression(node) { - return node.type === "TypeCastExpression" ? node.expression : node; - } -}; -const entities = { - __proto__: null, - quot: "\u0022", - amp: "&", - apos: "\u0027", - lt: "<", - gt: ">", - nbsp: "\u00A0", - iexcl: "\u00A1", - cent: "\u00A2", - pound: "\u00A3", - curren: "\u00A4", - yen: "\u00A5", - brvbar: "\u00A6", - sect: "\u00A7", - uml: "\u00A8", - copy: "\u00A9", - ordf: "\u00AA", - laquo: "\u00AB", - not: "\u00AC", - shy: "\u00AD", - reg: "\u00AE", - macr: "\u00AF", - deg: "\u00B0", - plusmn: "\u00B1", - sup2: "\u00B2", - sup3: "\u00B3", - acute: "\u00B4", - micro: "\u00B5", - para: "\u00B6", - middot: "\u00B7", - cedil: "\u00B8", - sup1: "\u00B9", - ordm: "\u00BA", - raquo: "\u00BB", - frac14: "\u00BC", - frac12: "\u00BD", - frac34: "\u00BE", - iquest: "\u00BF", - Agrave: "\u00C0", - Aacute: "\u00C1", - Acirc: "\u00C2", - Atilde: "\u00C3", - Auml: "\u00C4", - Aring: "\u00C5", - AElig: "\u00C6", - Ccedil: "\u00C7", - Egrave: "\u00C8", - Eacute: "\u00C9", - Ecirc: "\u00CA", - Euml: "\u00CB", - Igrave: "\u00CC", - Iacute: "\u00CD", - Icirc: "\u00CE", - Iuml: "\u00CF", - ETH: "\u00D0", - Ntilde: "\u00D1", - Ograve: "\u00D2", - Oacute: "\u00D3", - Ocirc: "\u00D4", - Otilde: "\u00D5", - Ouml: "\u00D6", - times: "\u00D7", - Oslash: "\u00D8", - Ugrave: "\u00D9", - Uacute: "\u00DA", - Ucirc: "\u00DB", - Uuml: "\u00DC", - Yacute: "\u00DD", - THORN: "\u00DE", - szlig: "\u00DF", - agrave: "\u00E0", - aacute: "\u00E1", - acirc: "\u00E2", - atilde: "\u00E3", - auml: "\u00E4", - aring: "\u00E5", - aelig: "\u00E6", - ccedil: "\u00E7", - egrave: "\u00E8", - eacute: "\u00E9", - ecirc: "\u00EA", - euml: "\u00EB", - igrave: "\u00EC", - iacute: "\u00ED", - icirc: "\u00EE", - iuml: "\u00EF", - eth: "\u00F0", - ntilde: "\u00F1", - ograve: "\u00F2", - oacute: "\u00F3", - ocirc: "\u00F4", - otilde: "\u00F5", - ouml: "\u00F6", - divide: "\u00F7", - oslash: "\u00F8", - ugrave: "\u00F9", - uacute: "\u00FA", - ucirc: "\u00FB", - uuml: "\u00FC", - yacute: "\u00FD", - thorn: "\u00FE", - yuml: "\u00FF", - OElig: "\u0152", - oelig: "\u0153", - Scaron: "\u0160", - scaron: "\u0161", - Yuml: "\u0178", - fnof: "\u0192", - circ: "\u02C6", - tilde: "\u02DC", - Alpha: "\u0391", - Beta: "\u0392", - Gamma: "\u0393", - Delta: "\u0394", - Epsilon: "\u0395", - Zeta: "\u0396", - Eta: "\u0397", - Theta: "\u0398", - Iota: "\u0399", - Kappa: "\u039A", - Lambda: "\u039B", - Mu: "\u039C", - Nu: "\u039D", - Xi: "\u039E", - Omicron: "\u039F", - Pi: "\u03A0", - Rho: "\u03A1", - Sigma: "\u03A3", - Tau: "\u03A4", - Upsilon: "\u03A5", - Phi: "\u03A6", - Chi: "\u03A7", - Psi: "\u03A8", - Omega: "\u03A9", - alpha: "\u03B1", - beta: "\u03B2", - gamma: "\u03B3", - delta: "\u03B4", - epsilon: "\u03B5", - zeta: "\u03B6", - eta: "\u03B7", - theta: "\u03B8", - iota: "\u03B9", - kappa: "\u03BA", - lambda: "\u03BB", - mu: "\u03BC", - nu: "\u03BD", - xi: "\u03BE", - omicron: "\u03BF", - pi: "\u03C0", - rho: "\u03C1", - sigmaf: "\u03C2", - sigma: "\u03C3", - tau: "\u03C4", - upsilon: "\u03C5", - phi: "\u03C6", - chi: "\u03C7", - psi: "\u03C8", - omega: "\u03C9", - thetasym: "\u03D1", - upsih: "\u03D2", - piv: "\u03D6", - ensp: "\u2002", - emsp: "\u2003", - thinsp: "\u2009", - zwnj: "\u200C", - zwj: "\u200D", - lrm: "\u200E", - rlm: "\u200F", - ndash: "\u2013", - mdash: "\u2014", - lsquo: "\u2018", - rsquo: "\u2019", - sbquo: "\u201A", - ldquo: "\u201C", - rdquo: "\u201D", - bdquo: "\u201E", - dagger: "\u2020", - Dagger: "\u2021", - bull: "\u2022", - hellip: "\u2026", - permil: "\u2030", - prime: "\u2032", - Prime: "\u2033", - lsaquo: "\u2039", - rsaquo: "\u203A", - oline: "\u203E", - frasl: "\u2044", - euro: "\u20AC", - image: "\u2111", - weierp: "\u2118", - real: "\u211C", - trade: "\u2122", - alefsym: "\u2135", - larr: "\u2190", - uarr: "\u2191", - rarr: "\u2192", - darr: "\u2193", - harr: "\u2194", - crarr: "\u21B5", - lArr: "\u21D0", - uArr: "\u21D1", - rArr: "\u21D2", - dArr: "\u21D3", - hArr: "\u21D4", - forall: "\u2200", - part: "\u2202", - exist: "\u2203", - empty: "\u2205", - nabla: "\u2207", - isin: "\u2208", - notin: "\u2209", - ni: "\u220B", - prod: "\u220F", - sum: "\u2211", - minus: "\u2212", - lowast: "\u2217", - radic: "\u221A", - prop: "\u221D", - infin: "\u221E", - ang: "\u2220", - and: "\u2227", - or: "\u2228", - cap: "\u2229", - cup: "\u222A", - int: "\u222B", - there4: "\u2234", - sim: "\u223C", - cong: "\u2245", - asymp: "\u2248", - ne: "\u2260", - equiv: "\u2261", - le: "\u2264", - ge: "\u2265", - sub: "\u2282", - sup: "\u2283", - nsub: "\u2284", - sube: "\u2286", - supe: "\u2287", - oplus: "\u2295", - otimes: "\u2297", - perp: "\u22A5", - sdot: "\u22C5", - lceil: "\u2308", - rceil: "\u2309", - lfloor: "\u230A", - rfloor: "\u230B", - lang: "\u2329", - rang: "\u232A", - loz: "\u25CA", - spades: "\u2660", - clubs: "\u2663", - hearts: "\u2665", - diams: "\u2666" -}; -const JsxErrors = ParseErrorEnum`jsx`({ - AttributeIsEmpty: "JSX attributes must only be assigned a non-empty expression.", - MissingClosingTagElement: ({ - openingTagName - }) => `Expected corresponding JSX closing tag for <${openingTagName}>.`, - MissingClosingTagFragment: "Expected corresponding JSX closing tag for <>.", - UnexpectedSequenceExpression: "Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?", - UnexpectedToken: ({ - unexpected, - HTMLEntity - }) => `Unexpected token \`${unexpected}\`. Did you mean \`${HTMLEntity}\` or \`{'${unexpected}'}\`?`, - UnsupportedJsxValue: "JSX value should be either an expression or a quoted JSX text.", - UnterminatedJsxContent: "Unterminated JSX contents.", - UnwrappedAdjacentJSXElements: "Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...?" -}); -function isFragment(object) { - return object ? object.type === "JSXOpeningFragment" || object.type === "JSXClosingFragment" : false; -} -function getQualifiedJSXName(object) { - if (object.type === "JSXIdentifier") { - return object.name; - } - if (object.type === "JSXNamespacedName") { - return object.namespace.name + ":" + object.name.name; - } - if (object.type === "JSXMemberExpression") { - return getQualifiedJSXName(object.object) + "." + getQualifiedJSXName(object.property); - } - throw new Error("Node had unexpected type: " + object.type); -} -var jsx = superClass => class JSXParserMixin extends superClass { - jsxReadToken() { - let out = ""; - let chunkStart = this.state.pos; - for (;;) { - if (this.state.pos >= this.length) { - throw this.raise(JsxErrors.UnterminatedJsxContent, this.state.startLoc); - } - const ch = this.input.charCodeAt(this.state.pos); - switch (ch) { - case 60: - case 123: - if (this.state.pos === this.state.start) { - if (ch === 60 && this.state.canStartJSXElement) { - ++this.state.pos; - this.finishToken(143); - } else { - super.getTokenFromCode(ch); - } - return; - } - out += this.input.slice(chunkStart, this.state.pos); - this.finishToken(142, out); - return; - case 38: - out += this.input.slice(chunkStart, this.state.pos); - out += this.jsxReadEntity(); - chunkStart = this.state.pos; - break; - case 62: - case 125: - default: - if (isNewLine(ch)) { - out += this.input.slice(chunkStart, this.state.pos); - out += this.jsxReadNewLine(true); - chunkStart = this.state.pos; - } else { - ++this.state.pos; - } - } - } - } - jsxReadNewLine(normalizeCRLF) { - const ch = this.input.charCodeAt(this.state.pos); - let out; - ++this.state.pos; - if (ch === 13 && this.input.charCodeAt(this.state.pos) === 10) { - ++this.state.pos; - out = normalizeCRLF ? "\n" : "\r\n"; - } else { - out = String.fromCharCode(ch); - } - ++this.state.curLine; - this.state.lineStart = this.state.pos; - return out; - } - jsxReadString(quote) { - let out = ""; - let chunkStart = ++this.state.pos; - for (;;) { - if (this.state.pos >= this.length) { - throw this.raise(Errors.UnterminatedString, this.state.startLoc); - } - const ch = this.input.charCodeAt(this.state.pos); - if (ch === quote) break; - if (ch === 38) { - out += this.input.slice(chunkStart, this.state.pos); - out += this.jsxReadEntity(); - chunkStart = this.state.pos; - } else if (isNewLine(ch)) { - out += this.input.slice(chunkStart, this.state.pos); - out += this.jsxReadNewLine(false); - chunkStart = this.state.pos; - } else { - ++this.state.pos; - } - } - out += this.input.slice(chunkStart, this.state.pos++); - this.finishToken(134, out); - } - jsxReadEntity() { - const startPos = ++this.state.pos; - if (this.codePointAtPos(this.state.pos) === 35) { - ++this.state.pos; - let radix = 10; - if (this.codePointAtPos(this.state.pos) === 120) { - radix = 16; - ++this.state.pos; - } - const codePoint = this.readInt(radix, undefined, false, "bail"); - if (codePoint !== null && this.codePointAtPos(this.state.pos) === 59) { - ++this.state.pos; - return String.fromCodePoint(codePoint); - } - } else { - let count = 0; - let semi = false; - while (count++ < 10 && this.state.pos < this.length && !(semi = this.codePointAtPos(this.state.pos) === 59)) { - ++this.state.pos; - } - if (semi) { - const desc = this.input.slice(startPos, this.state.pos); - const entity = entities[desc]; - ++this.state.pos; - if (entity) { - return entity; - } - } - } - this.state.pos = startPos; - return "&"; - } - jsxReadWord() { - let ch; - const start = this.state.pos; - do { - ch = this.input.charCodeAt(++this.state.pos); - } while (isIdentifierChar(ch) || ch === 45); - this.finishToken(141, this.input.slice(start, this.state.pos)); - } - jsxParseIdentifier() { - const node = this.startNode(); - if (this.match(141)) { - node.name = this.state.value; - } else if (tokenIsKeyword(this.state.type)) { - node.name = tokenLabelName(this.state.type); - } else { - this.unexpected(); - } - this.next(); - return this.finishNode(node, "JSXIdentifier"); - } - jsxParseNamespacedName() { - const startLoc = this.state.startLoc; - const name = this.jsxParseIdentifier(); - if (!this.eat(14)) return name; - const node = this.startNodeAt(startLoc); - node.namespace = name; - node.name = this.jsxParseIdentifier(); - return this.finishNode(node, "JSXNamespacedName"); - } - jsxParseElementName() { - const startLoc = this.state.startLoc; - let node = this.jsxParseNamespacedName(); - if (node.type === "JSXNamespacedName") { - return node; - } - while (this.eat(16)) { - const newNode = this.startNodeAt(startLoc); - newNode.object = node; - newNode.property = this.jsxParseIdentifier(); - node = this.finishNode(newNode, "JSXMemberExpression"); - } - return node; - } - jsxParseAttributeValue() { - let node; - switch (this.state.type) { - case 5: - node = this.startNode(); - this.setContext(types.brace); - this.next(); - node = this.jsxParseExpressionContainer(node, types.j_oTag); - if (node.expression.type === "JSXEmptyExpression") { - this.raise(JsxErrors.AttributeIsEmpty, node); - } - return node; - case 143: - case 134: - return this.parseExprAtom(); - default: - throw this.raise(JsxErrors.UnsupportedJsxValue, this.state.startLoc); - } - } - jsxParseEmptyExpression() { - const node = this.startNodeAt(this.state.lastTokEndLoc); - return this.finishNodeAt(node, "JSXEmptyExpression", this.state.startLoc); - } - jsxParseSpreadChild(node) { - this.next(); - node.expression = this.parseExpression(); - this.setContext(types.j_expr); - this.state.canStartJSXElement = true; - this.expect(8); - return this.finishNode(node, "JSXSpreadChild"); - } - jsxParseExpressionContainer(node, previousContext) { - if (this.match(8)) { - node.expression = this.jsxParseEmptyExpression(); - } else { - const expression = this.parseExpression(); - node.expression = expression; - } - this.setContext(previousContext); - this.state.canStartJSXElement = true; - this.expect(8); - return this.finishNode(node, "JSXExpressionContainer"); - } - jsxParseAttribute() { - const node = this.startNode(); - if (this.match(5)) { - this.setContext(types.brace); - this.next(); - this.expect(21); - node.argument = this.parseMaybeAssignAllowIn(); - this.setContext(types.j_oTag); - this.state.canStartJSXElement = true; - this.expect(8); - return this.finishNode(node, "JSXSpreadAttribute"); - } - node.name = this.jsxParseNamespacedName(); - node.value = this.eat(29) ? this.jsxParseAttributeValue() : null; - return this.finishNode(node, "JSXAttribute"); - } - jsxParseOpeningElementAt(startLoc) { - const node = this.startNodeAt(startLoc); - if (this.eat(144)) { - return this.finishNode(node, "JSXOpeningFragment"); - } - node.name = this.jsxParseElementName(); - return this.jsxParseOpeningElementAfterName(node); - } - jsxParseOpeningElementAfterName(node) { - const attributes = []; - while (!this.match(56) && !this.match(144)) { - attributes.push(this.jsxParseAttribute()); - } - node.attributes = attributes; - node.selfClosing = this.eat(56); - this.expect(144); - return this.finishNode(node, "JSXOpeningElement"); - } - jsxParseClosingElementAt(startLoc) { - const node = this.startNodeAt(startLoc); - if (this.eat(144)) { - return this.finishNode(node, "JSXClosingFragment"); - } - node.name = this.jsxParseElementName(); - this.expect(144); - return this.finishNode(node, "JSXClosingElement"); - } - jsxParseElementAt(startLoc) { - const node = this.startNodeAt(startLoc); - const children = []; - const openingElement = this.jsxParseOpeningElementAt(startLoc); - let closingElement = null; - if (!openingElement.selfClosing) { - contents: for (;;) { - switch (this.state.type) { - case 143: - startLoc = this.state.startLoc; - this.next(); - if (this.eat(56)) { - closingElement = this.jsxParseClosingElementAt(startLoc); - break contents; - } - children.push(this.jsxParseElementAt(startLoc)); - break; - case 142: - children.push(this.parseLiteral(this.state.value, "JSXText")); - break; - case 5: - { - const node = this.startNode(); - this.setContext(types.brace); - this.next(); - if (this.match(21)) { - children.push(this.jsxParseSpreadChild(node)); - } else { - children.push(this.jsxParseExpressionContainer(node, types.j_expr)); - } - break; - } - default: - this.unexpected(); - } - } - if (isFragment(openingElement) && !isFragment(closingElement) && closingElement !== null) { - this.raise(JsxErrors.MissingClosingTagFragment, closingElement); - } else if (!isFragment(openingElement) && isFragment(closingElement)) { - this.raise(JsxErrors.MissingClosingTagElement, closingElement, { - openingTagName: getQualifiedJSXName(openingElement.name) - }); - } else if (!isFragment(openingElement) && !isFragment(closingElement)) { - if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name)) { - this.raise(JsxErrors.MissingClosingTagElement, closingElement, { - openingTagName: getQualifiedJSXName(openingElement.name) - }); - } - } - } - if (isFragment(openingElement)) { - node.openingFragment = openingElement; - node.closingFragment = closingElement; - } else { - node.openingElement = openingElement; - node.closingElement = closingElement; - } - node.children = children; - if (this.match(47)) { - throw this.raise(JsxErrors.UnwrappedAdjacentJSXElements, this.state.startLoc); - } - return isFragment(openingElement) ? this.finishNode(node, "JSXFragment") : this.finishNode(node, "JSXElement"); - } - jsxParseElement() { - const startLoc = this.state.startLoc; - this.next(); - return this.jsxParseElementAt(startLoc); - } - setContext(newContext) { - const { - context - } = this.state; - context[context.length - 1] = newContext; - } - parseExprAtom(refExpressionErrors) { - if (this.match(143)) { - return this.jsxParseElement(); - } else if (this.match(47) && this.input.charCodeAt(this.state.pos) !== 33) { - this.replaceToken(143); - return this.jsxParseElement(); - } else { - return super.parseExprAtom(refExpressionErrors); - } - } - skipSpace() { - const curContext = this.curContext(); - if (!curContext.preserveSpace) super.skipSpace(); - } - getTokenFromCode(code) { - const context = this.curContext(); - if (context === types.j_expr) { - this.jsxReadToken(); - return; - } - if (context === types.j_oTag || context === types.j_cTag) { - if (isIdentifierStart(code)) { - this.jsxReadWord(); - return; - } - if (code === 62) { - ++this.state.pos; - this.finishToken(144); - return; - } - if ((code === 34 || code === 39) && context === types.j_oTag) { - this.jsxReadString(code); - return; - } - } - if (code === 60 && this.state.canStartJSXElement && this.input.charCodeAt(this.state.pos + 1) !== 33) { - ++this.state.pos; - this.finishToken(143); - return; - } - super.getTokenFromCode(code); - } - updateContext(prevType) { - const { - context, - type - } = this.state; - if (type === 56 && prevType === 143) { - context.splice(-2, 2, types.j_cTag); - this.state.canStartJSXElement = false; - } else if (type === 143) { - context.push(types.j_oTag); - } else if (type === 144) { - const out = context[context.length - 1]; - if (out === types.j_oTag && prevType === 56 || out === types.j_cTag) { - context.pop(); - this.state.canStartJSXElement = context[context.length - 1] === types.j_expr; - } else { - this.setContext(types.j_expr); - this.state.canStartJSXElement = true; - } - } else { - this.state.canStartJSXElement = tokenComesBeforeExpression(type); - } - } -}; -class TypeScriptScope extends Scope { - constructor(...args) { - super(...args); - this.tsNames = new Map(); - } -} -class TypeScriptScopeHandler extends ScopeHandler { - constructor(...args) { - super(...args); - this.importsStack = []; - } - createScope(flags) { - this.importsStack.push(new Set()); - return new TypeScriptScope(flags); - } - enter(flags) { - if (flags === 256) { - this.importsStack.push(new Set()); - } - super.enter(flags); - } - exit() { - const flags = super.exit(); - if (flags === 256) { - this.importsStack.pop(); - } - return flags; - } - hasImport(name, allowShadow) { - const len = this.importsStack.length; - if (this.importsStack[len - 1].has(name)) { - return true; - } - if (!allowShadow && len > 1) { - for (let i = 0; i < len - 1; i++) { - if (this.importsStack[i].has(name)) return true; - } - } - return false; - } - declareName(name, bindingType, loc) { - if (bindingType & 4096) { - if (this.hasImport(name, true)) { - this.parser.raise(Errors.VarRedeclaration, loc, { - identifierName: name - }); - } - this.importsStack[this.importsStack.length - 1].add(name); - return; - } - const scope = this.currentScope(); - let type = scope.tsNames.get(name) || 0; - if (bindingType & 1024) { - this.maybeExportDefined(scope, name); - scope.tsNames.set(name, type | 16); - return; - } - super.declareName(name, bindingType, loc); - if (bindingType & 2) { - if (!(bindingType & 1)) { - this.checkRedeclarationInScope(scope, name, bindingType, loc); - this.maybeExportDefined(scope, name); - } - type = type | 1; - } - if (bindingType & 256) { - type = type | 2; - } - if (bindingType & 512) { - type = type | 4; - } - if (bindingType & 128) { - type = type | 8; - } - if (type) scope.tsNames.set(name, type); - } - isRedeclaredInScope(scope, name, bindingType) { - const type = scope.tsNames.get(name); - if ((type & 2) > 0) { - if (bindingType & 256) { - const isConst = !!(bindingType & 512); - const wasConst = (type & 4) > 0; - return isConst !== wasConst; - } - return true; - } - if (bindingType & 128 && (type & 8) > 0) { - if (scope.names.get(name) & 2) { - return !!(bindingType & 1); - } else { - return false; - } - } - if (bindingType & 2 && (type & 1) > 0) { - return true; - } - return super.isRedeclaredInScope(scope, name, bindingType); - } - checkLocalExport(id) { + cloneIdentifier(node) { const { + type, + start, + end, + loc, + range, name - } = id; - if (this.hasImport(name)) return; - const len = this.scopeStack.length; - for (let i = len - 1; i >= 0; i--) { - const scope = this.scopeStack[i]; - const type = scope.tsNames.get(name); - if ((type & 1) > 0 || (type & 16) > 0) { - return; - } - } - super.checkLocalExport(id); + } = node; + const cloned = Object.create(NodePrototype); + cloned.type = type; + cloned.start = start; + cloned.end = end; + cloned.loc = loc; + cloned.range = range; + cloned.name = name; + if (node.extra) cloned.extra = node.extra; + return cloned; + } + cloneStringLiteral(node) { + const { + type, + start, + end, + loc, + range, + extra + } = node; + const cloned = Object.create(NodePrototype); + cloned.type = type; + cloned.start = start; + cloned.end = end; + cloned.loc = loc; + cloned.range = range; + cloned.extra = extra; + cloned.value = node.value; + return cloned; } } const unwrapParenthesizedExpression = node => { @@ -7145,9 +7218,10 @@ class LValParser extends NodeUtils { case "ArrayPattern": case "AssignmentPattern": case "RestElement": + case "VoidPattern": break; case "ObjectExpression": - node.type = "ObjectPattern"; + this.castNodeTo(node, "ObjectPattern"); for (let i = 0, length = node.properties.length, last = length - 1; i < length; i++) { var _node$extra2; const prop = node.properties[i]; @@ -7175,15 +7249,18 @@ class LValParser extends NodeUtils { throw new Error("Internal @babel/parser error (this is a bug, please report it)." + " SpreadElement should be converted by .toAssignable's caller."); } case "ArrayExpression": - node.type = "ArrayPattern"; + this.castNodeTo(node, "ArrayPattern"); this.toAssignableList(node.elements, (_node$extra3 = node.extra) == null ? void 0 : _node$extra3.trailingCommaLoc, isLHS); break; case "AssignmentExpression": if (node.operator !== "=") { this.raise(Errors.MissingEqInAssignment, node.left.loc.end); } - node.type = "AssignmentPattern"; + this.castNodeTo(node, "AssignmentPattern"); delete node.operator; + if (node.left.type === "VoidPattern") { + this.raise(Errors.VoidPatternInitializer, node.left); + } this.toAssignable(node.left, isLHS); break; case "ParenthesizedExpression": @@ -7195,7 +7272,7 @@ class LValParser extends NodeUtils { if (prop.type === "ObjectMethod") { this.raise(prop.kind === "get" || prop.kind === "set" ? Errors.PatternHasAccessor : Errors.PatternHasMethod, prop.key); } else if (prop.type === "SpreadElement") { - prop.type = "RestElement"; + this.castNodeTo(prop, "RestElement"); const arg = prop.argument; this.checkToRestConversion(arg, false); this.toAssignable(arg, isLHS); @@ -7224,7 +7301,7 @@ class LValParser extends NodeUtils { toAssignableListItem(exprList, index, isLHS) { const node = exprList[index]; if (node.type === "SpreadElement") { - node.type = "RestElement"; + this.castNodeTo(node, "RestElement"); const arg = node.argument; this.checkToRestConversion(arg, true); this.toAssignable(arg, isLHS); @@ -7239,6 +7316,7 @@ class LValParser extends NodeUtils { case "ArrayPattern": case "AssignmentPattern": case "RestElement": + case "VoidPattern": return true; case "ObjectExpression": { @@ -7284,7 +7362,11 @@ class LValParser extends NodeUtils { parseRestBinding() { const node = this.startNode(); this.next(); - node.argument = this.parseBindingAtom(); + const argument = this.parseBindingAtom(); + if (argument.type === "VoidPattern") { + this.raise(Errors.UnexpectedVoidPattern, argument); + } + node.argument = argument; return this.finishNode(node, "RestElement"); } parseBindingAtom() { @@ -7298,6 +7380,8 @@ class LValParser extends NodeUtils { } case 5: return this.parseObjectLike(8, true); + case 88: + return this.parseVoidPattern(null); } return this.parseIdentifier(); } @@ -7342,7 +7426,12 @@ class LValParser extends NodeUtils { } parseBindingRestProperty(prop) { this.next(); - prop.argument = this.parseIdentifier(); + if (this.hasPlugin("discardBinding") && this.match(88)) { + prop.argument = this.parseVoidPattern(null); + this.raise(Errors.UnexpectedVoidPattern, prop.argument); + } else { + prop.argument = this.parseIdentifier(); + } this.checkCommaAfterRest(125); return this.finishNode(prop, "RestElement"); } @@ -7370,10 +7459,11 @@ class LValParser extends NodeUtils { if (this.hasPlugin("flow") || flags & 2) { this.parseFunctionParamType(left); } - const elt = this.parseMaybeDefault(left.loc.start, left); if (decorators.length) { left.decorators = decorators; + this.resetStartLocationFromNode(left, decorators[0]); } + const elt = this.parseMaybeDefault(left.loc.start, left); return elt; } parseFunctionParamType(param) { @@ -7384,6 +7474,9 @@ class LValParser extends NodeUtils { left = left != null ? left : this.parseBindingAtom(); if (!this.eat(29)) return left; const node = this.startNodeAt(startLoc); + if (left.type === "VoidPattern") { + this.raise(Errors.VoidPatternInitializer, left); + } node.left = left; node.right = this.parseMaybeAssignAllowIn(); return this.finishNode(node, "AssignmentPattern"); @@ -7402,6 +7495,8 @@ class LValParser extends NodeUtils { return "elements"; case "ObjectPattern": return "properties"; + case "VoidPattern": + return true; } return false; } @@ -7440,6 +7535,8 @@ class LValParser extends NodeUtils { } } return; + } else if (type === "VoidPattern" && ancestor.type === "CatchClause") { + this.raise(Errors.VoidPatternCatchClauseParam, expression); } const validity = this.isValidLVal(type, !(hasParenthesizedAncestor || (_expression$extra = expression.extra) != null && _expression$extra.parenthesized) && ancestor.type === "AssignmentExpression", binding); if (validity === true) return; @@ -7548,7 +7645,7 @@ const TSErrors = ParseErrorEnum`typescript`({ DeclareFunctionHasImplementation: "An implementation cannot be declared in ambient contexts.", DuplicateAccessibilityModifier: ({ modifier - }) => `Accessibility modifier already seen.`, + }) => `Accessibility modifier already seen: '${modifier}'.`, DuplicateModifier: ({ modifier }) => `Duplicate modifier: '${modifier}'.`, @@ -7574,6 +7671,7 @@ const TSErrors = ParseErrorEnum`typescript`({ InvalidHeritageClauseType: ({ token }) => `'${token}' list can only include identifiers or qualified-names with optional type arguments.`, + InvalidModifierOnAwaitUsingDeclaration: modifier => `'${modifier}' modifier cannot appear on an await using declaration.`, InvalidModifierOnTypeMember: ({ modifier }) => `'${modifier}' modifier cannot appear on a type member.`, @@ -7583,6 +7681,7 @@ const TSErrors = ParseErrorEnum`typescript`({ InvalidModifierOnTypeParameterPositions: ({ modifier }) => `'${modifier}' modifier can only appear on a type parameter of a class, interface or type alias.`, + InvalidModifierOnUsingDeclaration: modifier => `'${modifier}' modifier cannot appear on a using declaration.`, InvalidModifiersOrder: ({ orderedModifiers }) => `'${orderedModifiers[0]}' modifier must precede '${orderedModifiers[1]}' modifier.`, @@ -7590,7 +7689,7 @@ const TSErrors = ParseErrorEnum`typescript`({ InvalidTupleMemberLabel: "Tuple members must be labeled with a simple identifier.", MissingInterfaceName: "'interface' declarations must be followed by an identifier.", NonAbstractClassHasAbstractMethod: "Abstract methods can only appear within an abstract class.", - NonClassMethodPropertyHasAbstractModifer: "'abstract' modifier can only appear on a class, method, or property declaration.", + NonClassMethodPropertyHasAbstractModifier: "'abstract' modifier can only appear on a class, method, or property declaration.", OptionalTypeBeforeRequired: "A required element cannot follow an optional element.", OverrideNotInSubClass: "This member cannot have an 'override' modifier because its containing class does not extend another class.", PatternIsOptional: "A binding pattern parameter cannot be optional in an implementation signature.", @@ -7621,7 +7720,8 @@ const TSErrors = ParseErrorEnum`typescript`({ UnsupportedParameterPropertyKind: "A parameter property may not be declared using a binding pattern.", UnsupportedSignatureParameterKind: ({ type - }) => `Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${type}.` + }) => `Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${type}.`, + UsingDeclarationInAmbientContext: kind => `'${kind}' declarations are not allowed in ambient contexts.` }); function keywordTypeFromName(value) { switch (value) { @@ -7697,12 +7797,15 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { } return this.tsNextTokenOnSameLineAndCanFollowModifier(); } - tsParseModifier(allowedModifiers, stopOnStartOfClassStaticBlock) { + tsParseModifier(allowedModifiers, stopOnStartOfClassStaticBlock, hasSeenStaticModifier) { if (!tokenIsIdentifier(this.state.type) && this.state.type !== 58 && this.state.type !== 75) { return undefined; } const modifier = this.state.value; if (allowedModifiers.includes(modifier)) { + if (hasSeenStaticModifier && this.match(106)) { + return undefined; + } if (stopOnStartOfClassStaticBlock && this.tsIsStartOfStaticBlocks()) { return undefined; } @@ -7736,7 +7839,7 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { const { startLoc } = this.state; - const modifier = this.tsParseModifier(allowedModifiers.concat(disallowedModifiers != null ? disallowedModifiers : []), stopOnStartOfClassStaticBlock); + const modifier = this.tsParseModifier(allowedModifiers.concat(disallowedModifiers != null ? disallowedModifiers : []), stopOnStartOfClassStaticBlock, modified.static); if (!modifier) break; if (tsIsAccessModifier(modifier)) { if (modified.accessibility) { @@ -7862,9 +7965,8 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { node.argument = this.parseStringLiteral(this.state.value); } } - if (this.eat(12) && !this.match(11)) { - node.options = super.parseMaybeAssignAllowIn(); - this.eat(12); + if (this.eat(12)) { + node.options = this.tsParseImportTypeOptions(); } else { node.options = null; } @@ -7879,6 +7981,41 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { } return this.finishNode(node, "TSImportType"); } + tsParseImportTypeOptions() { + const node = this.startNode(); + this.expect(5); + const withProperty = this.startNode(); + if (this.isContextual(76)) { + withProperty.method = false; + withProperty.key = this.parseIdentifier(true); + withProperty.computed = false; + withProperty.shorthand = false; + } else { + this.unexpected(null, 76); + } + this.expect(14); + withProperty.value = this.tsParseImportTypeWithPropertyValue(); + node.properties = [this.finishObjectProperty(withProperty)]; + this.expect(8); + return this.finishNode(node, "ObjectExpression"); + } + tsParseImportTypeWithPropertyValue() { + const node = this.startNode(); + const properties = []; + this.expect(5); + while (!this.match(8)) { + const type = this.state.type; + if (tokenIsIdentifier(type) || type === 134) { + properties.push(super.parsePropertyDefinition(null)); + } else { + this.unexpected(); + } + this.eat(12); + } + node.properties = properties; + this.next(); + return this.finishNode(node, "ObjectExpression"); + } tsParseEntityName(flags) { let entity; if (flags & 1 && this.match(78)) { @@ -8034,12 +8171,11 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { } tsParsePropertyOrMethodSignature(node, readonly) { if (this.eat(17)) node.optional = true; - const nodeAny = node; if (this.match(10) || this.match(47)) { if (readonly) { this.raise(TSErrors.ReadonlyForMethodSignature, node); } - const method = nodeAny; + const method = node; if (method.kind && this.match(47)) { this.raise(TSErrors.AccessorCannotHaveTypeParameters, this.state.curPosition()); } @@ -8077,7 +8213,7 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { } return this.finishNode(method, "TSMethodSignature"); } else { - const property = nodeAny; + const property = node; if (readonly) property.readonly = true; const type = this.tsTryParseTypeAnnotation(); if (type) property.typeAnnotation = type; @@ -8112,6 +8248,9 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { if (!node.computed && node.key.type === "Identifier" && (node.key.name === "get" || node.key.name === "set") && this.tsTokenCanFollowModifier()) { node.kind = node.key.name; super.parsePropertyName(node); + if (!this.match(10) && !this.match(47)) { + this.unexpected(null, 10); + } } return this.tsParsePropertyOrMethodSignature(node, !!node.readonly); } @@ -8597,7 +8736,7 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { return this.finishNode(node, "TSConditionalType"); } isAbstractConstructorSignature() { - return this.isContextual(124) && this.lookahead().type === 77; + return this.isContextual(124) && this.isLookaheadContextual("new"); } tsParseNonConditionalType() { if (this.tsIsStartOfFunctionType()) { @@ -8668,7 +8807,7 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { node.typeAnnotation = this.tsInType(() => { node.typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutModifiers); this.expect(29); - if (this.isContextual(114) && this.lookahead().type !== 16) { + if (this.isContextual(114) && this.lookaheadCharCode() !== 46) { const node = this.startNode(); this.next(); return this.finishNode(node, "TSIntrinsicKeyword"); @@ -8781,7 +8920,7 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { this.tsParseModuleOrNamespaceDeclaration(inner, true); node.body = inner; } else { - this.scope.enter(256); + this.scope.enter(1024); this.prodParam.enter(0); node.body = this.tsParseModuleBlock(); this.prodParam.exit(); @@ -8803,7 +8942,7 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { this.unexpected(); } if (this.match(5)) { - this.scope.enter(256); + this.scope.enter(1024); this.prodParam.enter(0); node.body = this.tsParseModuleBlock(); this.prodParam.exit(); @@ -8866,51 +9005,65 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { } this.state = state; } - tsTryParseDeclare(nany) { + tsTryParseDeclare(node) { if (this.isLineTerminator()) { return; } - let startType = this.state.type; - let kind; - if (this.isContextual(100)) { - startType = 74; - kind = "let"; - } + const startType = this.state.type; return this.tsInAmbientContext(() => { switch (startType) { case 68: - nany.declare = true; - return super.parseFunctionStatement(nany, false, false); + node.declare = true; + return super.parseFunctionStatement(node, false, false); case 80: - nany.declare = true; - return this.parseClass(nany, true, false); + node.declare = true; + return this.parseClass(node, true, false); case 126: - return this.tsParseEnumDeclaration(nany, { + return this.tsParseEnumDeclaration(node, { declare: true }); case 112: - return this.tsParseAmbientExternalModuleDeclaration(nany); + return this.tsParseAmbientExternalModuleDeclaration(node); + case 100: + if (this.state.containsEsc) { + return; + } case 75: case 74: if (!this.match(75) || !this.isLookaheadContextual("enum")) { - nany.declare = true; - return this.parseVarStatement(nany, kind || this.state.value, true); + node.declare = true; + return this.parseVarStatement(node, this.state.value, true); } this.expect(75); - return this.tsParseEnumDeclaration(nany, { + return this.tsParseEnumDeclaration(node, { const: true, declare: true }); + case 107: + if (this.isUsing()) { + this.raise(TSErrors.InvalidModifierOnUsingDeclaration, this.state.startLoc, "declare"); + node.declare = true; + return this.parseVarStatement(node, "using", true); + } + break; + case 96: + if (this.isAwaitUsing()) { + this.raise(TSErrors.InvalidModifierOnAwaitUsingDeclaration, this.state.startLoc, "declare"); + node.declare = true; + this.next(); + return this.parseVarStatement(node, "await using", true); + } + break; case 129: { - const result = this.tsParseInterfaceDeclaration(nany, { + const result = this.tsParseInterfaceDeclaration(node, { declare: true }); if (result) return result; } default: if (tokenIsIdentifier(startType)) { - return this.tsParseDeclaration(nany, this.state.value, true, null); + return this.tsParseDeclaration(node, this.state.value, true, null); } } }); @@ -8930,7 +9083,7 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { } case "global": if (this.match(5)) { - this.scope.enter(256); + this.scope.enter(1024); this.prodParam.enter(0); const mod = node; mod.kind = "global"; @@ -9028,7 +9181,7 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { return super.isExportDefaultSpecifier(); } parseBindingElement(flags, decorators) { - const startLoc = this.state.startLoc; + const startLoc = decorators.length ? decorators[0].loc.start : this.state.startLoc; const modified = {}; this.tsParseModifiers({ allowedModifiers: ["public", "private", "protected", "override", "readonly"] @@ -9161,7 +9314,7 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { if (!noCalls && this.eat(10)) { const node = this.startNodeAt(startLoc); node.callee = base; - node.arguments = this.parseCallExpressionArguments(11); + node.arguments = this.parseCallExpressionArguments(); this.tsCheckForInvalidTypeCasts(node.arguments); { node.typeParameters = typeArguments; @@ -9186,8 +9339,13 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { this.unexpected(missingParenErrorLoc, 10); } if (result) { - if (result.type === "TSInstantiationExpression" && (this.match(16) || this.match(18) && this.lookaheadCharCode() !== 40)) { - this.raise(TSErrors.InvalidPropertyAccessAfterInstantiationExpression, this.state.startLoc); + if (result.type === "TSInstantiationExpression") { + if (this.match(16) || this.match(18) && this.lookaheadCharCode() !== 40) { + this.raise(TSErrors.InvalidPropertyAccessAfterInstantiationExpression, this.state.startLoc); + } + if (!this.match(16) && !this.match(18)) { + result.expression = super.stopParseSubscript(base, state); + } } return result; } @@ -9313,7 +9471,7 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { } } isAbstractClass() { - return this.isContextual(124) && this.lookahead().type === 80; + return this.isContextual(124) && this.isLookaheadContextual("class"); } parseExportDefaultExpression() { if (this.isAbstractClass()) { @@ -9334,12 +9492,16 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { } = this.state; const declaration = super.parseVarStatement(node, kind, allowMissingInitializer || isAmbientContext); if (!isAmbientContext) return declaration; + if (!node.declare && (kind === "using" || kind === "await using")) { + this.raiseOverwrite(TSErrors.UsingDeclarationInAmbientContext, node, kind); + return declaration; + } for (const { id, init } of declaration.declarations) { if (!init) continue; - if (kind !== "const" || !!id.typeAnnotation) { + if (kind === "var" || kind === "let" || !!id.typeAnnotation) { this.raise(TSErrors.InitializerNotAllowedInAmbientContext, init); } else if (!isValidAmbientConstInitializer(init, this.hasPlugin("estree"))) { this.raise(TSErrors.ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference, init); @@ -9575,7 +9737,7 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { } declareClassPrivateMethodInScope(node, kind) { if (node.type === "TSDeclareMethod") return; - if (node.type === "MethodDefinition" && !hasOwnProperty.call(node.value, "body")) { + if (node.type === "MethodDefinition" && node.value.body == null) { return; } super.declareClassPrivateMethodInScope(node, kind); @@ -9945,7 +10107,7 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { } else if (this.isContextual(129)) { if (!this.hasFollowingLineBreak()) { node.abstract = true; - this.raise(TSErrors.NonClassMethodPropertyHasAbstractModifer, node); + this.raise(TSErrors.NonClassMethodPropertyHasAbstractModifier, node); return this.tsParseInterfaceDeclaration(node); } } else { @@ -9954,7 +10116,7 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { } parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope) { const method = super.parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope); - if (method.abstract) { + if (method.abstract || method.type === "TSAbstractMethodDefinition") { const hasEstreePlugin = this.hasPlugin("estree"); const methodFn = hasEstreePlugin ? method.value : method; if (methodFn.body) { @@ -10053,12 +10215,115 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { node[rightOfAsKey] = isImport ? this.parseIdentifier() : this.parseModuleExportName(); } if (!node[rightOfAsKey]) { - node[rightOfAsKey] = cloneIdentifier(node[leftOfAsKey]); + node[rightOfAsKey] = this.cloneIdentifier(node[leftOfAsKey]); } if (isImport) { this.checkIdentifier(node[rightOfAsKey], hasTypeSpecifier ? 4098 : 4096); } } + fillOptionalPropertiesForTSESLint(node) { + var _node$directive, _node$decorators, _node$optional, _node$typeAnnotation, _node$accessibility, _node$decorators2, _node$override, _node$readonly, _node$static, _node$declare, _node$returnType, _node$typeParameters, _node$optional2, _node$optional3, _node$accessibility2, _node$readonly2, _node$static2, _node$declare2, _node$definite, _node$readonly3, _node$typeAnnotation2, _node$accessibility3, _node$decorators3, _node$override2, _node$optional4, _node$id, _node$abstract, _node$declare3, _node$decorators4, _node$implements, _node$superTypeArgume, _node$typeParameters2, _node$declare4, _node$definite2, _node$const, _node$declare5, _node$computed, _node$qualifier, _node$options, _node$declare6, _node$extends, _node$declare7, _node$global, _node$const2, _node$in, _node$out; + switch (node.type) { + case "ExpressionStatement": + (_node$directive = node.directive) != null ? _node$directive : node.directive = undefined; + return; + case "RestElement": + node.value = undefined; + case "Identifier": + case "ArrayPattern": + case "AssignmentPattern": + case "ObjectPattern": + (_node$decorators = node.decorators) != null ? _node$decorators : node.decorators = []; + (_node$optional = node.optional) != null ? _node$optional : node.optional = false; + (_node$typeAnnotation = node.typeAnnotation) != null ? _node$typeAnnotation : node.typeAnnotation = undefined; + return; + case "TSParameterProperty": + (_node$accessibility = node.accessibility) != null ? _node$accessibility : node.accessibility = undefined; + (_node$decorators2 = node.decorators) != null ? _node$decorators2 : node.decorators = []; + (_node$override = node.override) != null ? _node$override : node.override = false; + (_node$readonly = node.readonly) != null ? _node$readonly : node.readonly = false; + (_node$static = node.static) != null ? _node$static : node.static = false; + return; + case "TSEmptyBodyFunctionExpression": + node.body = null; + case "TSDeclareFunction": + case "FunctionDeclaration": + case "FunctionExpression": + case "ClassMethod": + case "ClassPrivateMethod": + (_node$declare = node.declare) != null ? _node$declare : node.declare = false; + (_node$returnType = node.returnType) != null ? _node$returnType : node.returnType = undefined; + (_node$typeParameters = node.typeParameters) != null ? _node$typeParameters : node.typeParameters = undefined; + return; + case "Property": + (_node$optional2 = node.optional) != null ? _node$optional2 : node.optional = false; + return; + case "TSMethodSignature": + case "TSPropertySignature": + (_node$optional3 = node.optional) != null ? _node$optional3 : node.optional = false; + case "TSIndexSignature": + (_node$accessibility2 = node.accessibility) != null ? _node$accessibility2 : node.accessibility = undefined; + (_node$readonly2 = node.readonly) != null ? _node$readonly2 : node.readonly = false; + (_node$static2 = node.static) != null ? _node$static2 : node.static = false; + return; + case "TSAbstractPropertyDefinition": + case "PropertyDefinition": + case "TSAbstractAccessorProperty": + case "AccessorProperty": + (_node$declare2 = node.declare) != null ? _node$declare2 : node.declare = false; + (_node$definite = node.definite) != null ? _node$definite : node.definite = false; + (_node$readonly3 = node.readonly) != null ? _node$readonly3 : node.readonly = false; + (_node$typeAnnotation2 = node.typeAnnotation) != null ? _node$typeAnnotation2 : node.typeAnnotation = undefined; + case "TSAbstractMethodDefinition": + case "MethodDefinition": + (_node$accessibility3 = node.accessibility) != null ? _node$accessibility3 : node.accessibility = undefined; + (_node$decorators3 = node.decorators) != null ? _node$decorators3 : node.decorators = []; + (_node$override2 = node.override) != null ? _node$override2 : node.override = false; + (_node$optional4 = node.optional) != null ? _node$optional4 : node.optional = false; + return; + case "ClassExpression": + (_node$id = node.id) != null ? _node$id : node.id = null; + case "ClassDeclaration": + (_node$abstract = node.abstract) != null ? _node$abstract : node.abstract = false; + (_node$declare3 = node.declare) != null ? _node$declare3 : node.declare = false; + (_node$decorators4 = node.decorators) != null ? _node$decorators4 : node.decorators = []; + (_node$implements = node.implements) != null ? _node$implements : node.implements = []; + (_node$superTypeArgume = node.superTypeArguments) != null ? _node$superTypeArgume : node.superTypeArguments = undefined; + (_node$typeParameters2 = node.typeParameters) != null ? _node$typeParameters2 : node.typeParameters = undefined; + return; + case "TSTypeAliasDeclaration": + case "VariableDeclaration": + (_node$declare4 = node.declare) != null ? _node$declare4 : node.declare = false; + return; + case "VariableDeclarator": + (_node$definite2 = node.definite) != null ? _node$definite2 : node.definite = false; + return; + case "TSEnumDeclaration": + (_node$const = node.const) != null ? _node$const : node.const = false; + (_node$declare5 = node.declare) != null ? _node$declare5 : node.declare = false; + return; + case "TSEnumMember": + (_node$computed = node.computed) != null ? _node$computed : node.computed = false; + return; + case "TSImportType": + (_node$qualifier = node.qualifier) != null ? _node$qualifier : node.qualifier = null; + (_node$options = node.options) != null ? _node$options : node.options = null; + return; + case "TSInterfaceDeclaration": + (_node$declare6 = node.declare) != null ? _node$declare6 : node.declare = false; + (_node$extends = node.extends) != null ? _node$extends : node.extends = []; + return; + case "TSModuleDeclaration": + (_node$declare7 = node.declare) != null ? _node$declare7 : node.declare = false; + (_node$global = node.global) != null ? _node$global : node.global = node.kind === "global"; + return; + case "TSTypeParameter": + (_node$const2 = node.const) != null ? _node$const2 : node.const = false; + (_node$in = node.in) != null ? _node$in : node.in = false; + (_node$out = node.out) != null ? _node$out : node.out = false; + return; + } + } }; function isPossiblyLiteralEnum(expression) { if (expression.type !== "MemberExpression") return false; @@ -10171,6 +10436,19 @@ var placeholders = superClass => class PlaceholdersParserMixin extends superClas super.checkReservedWord(word, startLoc, checkKeywords, isBinding); } } + cloneIdentifier(node) { + const cloned = super.cloneIdentifier(node); + if (cloned.type === "Placeholder") { + cloned.expectedNode = node.expectedNode; + } + return cloned; + } + cloneStringLiteral(node) { + if (node.type === "Placeholder") { + return this.cloneIdentifier(node); + } + return super.cloneStringLiteral(node); + } parseBindingAtom() { return this.parsePlaceholder("Pattern") || super.parseBindingAtom(); } @@ -10188,8 +10466,8 @@ var placeholders = superClass => class PlaceholdersParserMixin extends superClas if (super.chStartsBindingIdentifier(ch, pos)) { return true; } - const nextToken = this.lookahead(); - if (nextToken.type === 133) { + const next = this.nextTokenStart(); + if (this.input.charCodeAt(next) === 37 && this.input.charCodeAt(next + 1) === 37) { return true; } return false; @@ -10326,7 +10604,7 @@ var v8intrinsic = superClass => class V8IntrinsicMixin extends superClass { if (tokenIsIdentifier(this.state.type)) { const name = this.parseIdentifierName(); const identifier = this.createIdentifier(node, name); - identifier.type = "V8IntrinsicIdentifier"; + this.castNodeTo(identifier, "V8IntrinsicIdentifier"); if (this.match(10)) { return identifier; } @@ -10361,13 +10639,12 @@ function validatePlugins(pluginsMap) { throw new Error("Cannot combine placeholders and v8intrinsic plugins."); } if (pluginsMap.has("pipelineOperator")) { - var _pluginsMap$get; + var _pluginsMap$get2; const proposal = pluginsMap.get("pipelineOperator").proposal; if (!PIPELINE_PROPOSALS.includes(proposal)) { const proposalList = PIPELINE_PROPOSALS.map(p => `"${p}"`).join(", "); throw new Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${proposalList}.`); } - const tupleSyntaxIsHash = ((_pluginsMap$get = pluginsMap.get("recordAndTuple")) == null ? void 0 : _pluginsMap$get.syntaxType) === "hash"; if (proposal === "hack") { if (pluginsMap.has("placeholders")) { throw new Error("Cannot combine placeholders plugin and Hack-style pipes."); @@ -10380,10 +10657,13 @@ function validatePlugins(pluginsMap) { const tokenList = TOPIC_TOKENS.map(t => `"${t}"`).join(", "); throw new Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${tokenList}.`); } - if (topicToken === "#" && tupleSyntaxIsHash) { - throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "hack", topicToken: "#" }]\` and \`${JSON.stringify(["recordAndTuple", pluginsMap.get("recordAndTuple")])}\`.`); + { + var _pluginsMap$get; + if (topicToken === "#" && ((_pluginsMap$get = pluginsMap.get("recordAndTuple")) == null ? void 0 : _pluginsMap$get.syntaxType) === "hash") { + throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "hack", topicToken: "#" }]\` and \`${JSON.stringify(["recordAndTuple", pluginsMap.get("recordAndTuple")])}\`.`); + } } - } else if (proposal === "smart" && tupleSyntaxIsHash) { + } else if (proposal === "smart" && ((_pluginsMap$get2 = pluginsMap.get("recordAndTuple")) == null ? void 0 : _pluginsMap$get2.syntaxType) === "hash") { throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "smart" }]\` and \`${JSON.stringify(["recordAndTuple", pluginsMap.get("recordAndTuple")])}\`.`); } } @@ -10409,9 +10689,9 @@ function validatePlugins(pluginsMap) { } } if (pluginsMap.has("recordAndTuple")) { - const syntaxType = pluginsMap.get("recordAndTuple").syntaxType; - if (syntaxType != null) { - { + { + const syntaxType = pluginsMap.get("recordAndTuple").syntaxType; + if (syntaxType != null) { const RECORD_AND_TUPLE_SYNTAX_TYPES = ["hash", "bar"]; if (!RECORD_AND_TUPLE_SYNTAX_TYPES.includes(syntaxType)) { throw new Error("The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: " + RECORD_AND_TUPLE_SYNTAX_TYPES.map(p => `'${p}'`).join(", ")); @@ -10427,6 +10707,9 @@ function validatePlugins(pluginsMap) { if (pluginsMap.has("optionalChainingAssign") && pluginsMap.get("optionalChainingAssign").version !== "2023-07") { throw new Error("The 'optionalChainingAssign' plugin requires a 'version' option," + " representing the last proposal update. Currently, the" + " only supported value is '2023-07'."); } + if (pluginsMap.has("discardBinding") && pluginsMap.get("discardBinding").syntaxType !== "void") { + throw new Error("The 'discardBinding' plugin requires a 'syntaxType' option. Currently the only supported value is 'void'."); + } } const mixinPlugins = { estree, @@ -10468,9 +10751,14 @@ class ExpressionParser extends LValParser { getExpression() { this.enterInitialScopes(); this.nextToken(); + if (this.match(140)) { + throw this.raise(Errors.ParseExpressionEmptyInput, this.state.startLoc); + } const expr = this.parseExpression(); if (!this.match(140)) { - this.unexpected(); + throw this.raise(Errors.ParseExpressionExpectsEOF, this.state.startLoc, { + unexpected: this.input.codePointAt(this.state.start) + }); } this.finalizeRemainingComments(); expr.comments = this.comments; @@ -10557,6 +10845,9 @@ class ExpressionParser extends LValParser { this.checkDestructuringPrivate(refExpressionErrors); refExpressionErrors.privateKeyLoc = null; } + if (refExpressionErrors.voidPatternLoc != null && refExpressionErrors.voidPatternLoc.index >= startIndex) { + refExpressionErrors.voidPatternLoc = null; + } } else { node.left = left; } @@ -10814,8 +11105,7 @@ class ExpressionParser extends LValParser { if (noCalls) { this.raise(Errors.OptionalChainingNoNew, this.state.startLoc); if (this.lookaheadCharCode() === 40) { - state.stop = true; - return base; + return this.stopParseSubscript(base, state); } } state.optionalChainMember = optional = true; @@ -10828,11 +11118,14 @@ class ExpressionParser extends LValParser { if (computed || optional || this.eat(16)) { return this.parseMember(base, startLoc, state, computed, optional); } else { - state.stop = true; - return base; + return this.stopParseSubscript(base, state); } } } + stopParseSubscript(base, state) { + state.stop = true; + return base; + } parseMember(base, startLoc, state, computed, optional) { const node = this.startNodeAt(startLoc); node.object = base; @@ -10883,9 +11176,9 @@ class ExpressionParser extends LValParser { node.optional = optional; } if (optional) { - node.arguments = this.parseCallExpressionArguments(11); + node.arguments = this.parseCallExpressionArguments(); } else { - node.arguments = this.parseCallExpressionArguments(11, base.type !== "Super", node, refExpressionErrors); + node.arguments = this.parseCallExpressionArguments(base.type !== "Super", node, refExpressionErrors); } let finishedNode = this.finishCallExpression(node, optionalChainMember); if (maybeAsyncArrow && this.shouldParseAsyncArrow() && !optional) { @@ -10933,17 +11226,17 @@ class ExpressionParser extends LValParser { } return this.finishNode(node, optional ? "OptionalCallExpression" : "CallExpression"); } - parseCallExpressionArguments(close, allowPlaceholder, nodeForExtra, refExpressionErrors) { + parseCallExpressionArguments(allowPlaceholder, nodeForExtra, refExpressionErrors) { const elts = []; let first = true; const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; this.state.inFSharpPipelineDirectBody = false; - while (!this.eat(close)) { + while (!this.eat(11)) { if (first) { first = false; } else { this.expect(12); - if (this.match(close)) { + if (this.match(11)) { if (nodeForExtra) { this.addTrailingCommaExtraToNode(nodeForExtra); } @@ -10951,7 +11244,7 @@ class ExpressionParser extends LValParser { break; } } - elts.push(this.parseExprListItem(false, refExpressionErrors, allowPlaceholder)); + elts.push(this.parseExprListItem(11, false, refExpressionErrors, allowPlaceholder)); } this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; return elts; @@ -10989,7 +11282,7 @@ class ExpressionParser extends LValParser { node = this.startNode(); this.next(); if (this.match(16)) { - return this.parseImportMetaProperty(node); + return this.parseImportMetaPropertyOrPhaseCall(node); } if (this.match(10)) { if (this.optionFlags & 512) { @@ -11032,20 +11325,10 @@ class ExpressionParser extends LValParser { const canBeArrow = this.state.potentialArrowAt === this.state.start; return this.parseParenAndDistinguishExpression(canBeArrow); } - case 2: - case 1: - { - return this.parseArrayLike(this.state.type === 2 ? 4 : 3, false, true); - } case 0: { return this.parseArrayLike(3, true, false, refExpressionErrors); } - case 6: - case 7: - { - return this.parseObjectLike(this.state.type === 6 ? 9 : 8, false, true); - } case 5: { return this.parseObjectLike(8, false, false, refExpressionErrors); @@ -11115,8 +11398,14 @@ class ExpressionParser extends LValParser { break; } default: - if (type === 137) { - return this.parseDecimalLiteral(this.state.value); + { + if (type === 137) { + return this.parseDecimalLiteral(this.state.value); + } else if (type === 2 || type === 1) { + return this.parseArrayLike(this.state.type === 2 ? 4 : 3, false, true); + } else if (type === 6 || type === 7) { + return this.parseObjectLike(this.state.type === 6 ? 9 : 8, false, true); + } } if (tokenIsIdentifier(type)) { if (this.isContextual(127) && this.lookaheadInLineCharCode() === 123) { @@ -11286,27 +11575,24 @@ class ExpressionParser extends LValParser { } return this.finishNode(node, "MetaProperty"); } - parseImportMetaProperty(node) { - const id = this.createIdentifier(this.startNodeAtNode(node), "import"); + parseImportMetaPropertyOrPhaseCall(node) { this.next(); - if (this.isContextual(101)) { - if (!this.inModule) { - this.raise(Errors.ImportMetaOutsideModule, id); - } - this.sawUnambiguousESM = true; - } else if (this.isContextual(105) || this.isContextual(97)) { + if (this.isContextual(105) || this.isContextual(97)) { const isSource = this.isContextual(105); this.expectPlugin(isSource ? "sourcePhaseImports" : "deferredImportEvaluation"); - if (!(this.optionFlags & 512)) { - throw this.raise(Errors.DynamicImportPhaseRequiresImportExpressions, this.state.startLoc, { - phase: this.state.value - }); - } this.next(); node.phase = isSource ? "source" : "defer"; return this.parseImportCall(node); + } else { + const id = this.createIdentifierAt(this.startNodeAtNode(node), "import", this.state.lastTokStartLoc); + if (this.isContextual(101)) { + if (!this.inModule) { + this.raise(Errors.ImportMetaOutsideModule, id); + } + this.sawUnambiguousESM = true; + } + return this.parseMetaProperty(node, id, "meta"); } - return this.parseMetaProperty(node, id, "meta"); } parseLiteralAtNode(value, type, node) { this.addExtra(node, "rawValue", value); @@ -11326,7 +11612,9 @@ class ExpressionParser extends LValParser { return this.parseLiteral(value, "NumericLiteral"); } parseBigIntLiteral(value) { - return this.parseLiteral(value, "BigIntLiteral"); + { + return this.parseLiteral(value, "BigIntLiteral"); + } } parseDecimalLiteral(value) { return this.parseLiteral(value, "DecimalLiteral"); @@ -11383,7 +11671,7 @@ class ExpressionParser extends LValParser { break; } } else { - exprList.push(this.parseMaybeAssignAllowIn(refExpressionErrors, this.parseParenItem)); + exprList.push(this.parseMaybeAssignAllowInOrVoidPattern(11, refExpressionErrors, this.parseParenItem)); } } const innerEndLoc = this.state.lastTokEndLoc; @@ -11445,7 +11733,7 @@ class ExpressionParser extends LValParser { const meta = this.createIdentifier(this.startNodeAtNode(node), "new"); this.next(); const metaProp = this.parseMetaProperty(node, meta, "target"); - if (!this.scope.inNonArrowFunction && !this.scope.inClass && !(this.optionFlags & 4)) { + if (!this.scope.allowNewTarget) { this.raise(Errors.UnexpectedNewTarget, metaProp); } return metaProp; @@ -11660,13 +11948,13 @@ class ExpressionParser extends LValParser { parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors) { prop.shorthand = false; if (this.eat(14)) { - prop.value = isPattern ? this.parseMaybeDefault(this.state.startLoc) : this.parseMaybeAssignAllowIn(refExpressionErrors); - return this.finishNode(prop, "ObjectProperty"); + prop.value = isPattern ? this.parseMaybeDefault(this.state.startLoc) : this.parseMaybeAssignAllowInOrVoidPattern(8, refExpressionErrors); + return this.finishObjectProperty(prop); } if (!prop.computed && prop.key.type === "Identifier") { this.checkReservedWord(prop.key.name, prop.key.loc.start, true, false); if (isPattern) { - prop.value = this.parseMaybeDefault(startLoc, cloneIdentifier(prop.key)); + prop.value = this.parseMaybeDefault(startLoc, this.cloneIdentifier(prop.key)); } else if (this.match(29)) { const shorthandAssignLoc = this.state.startLoc; if (refExpressionErrors != null) { @@ -11676,14 +11964,17 @@ class ExpressionParser extends LValParser { } else { this.raise(Errors.InvalidCoverInitializedName, shorthandAssignLoc); } - prop.value = this.parseMaybeDefault(startLoc, cloneIdentifier(prop.key)); + prop.value = this.parseMaybeDefault(startLoc, this.cloneIdentifier(prop.key)); } else { - prop.value = cloneIdentifier(prop.key); + prop.value = this.cloneIdentifier(prop.key); } prop.shorthand = true; - return this.finishNode(prop, "ObjectProperty"); + return this.finishObjectProperty(prop); } } + finishObjectProperty(node) { + return this.finishNode(node, "ObjectProperty"); + } parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) { const node = this.parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) || this.parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors); if (!node) this.unexpected(); @@ -11748,7 +12039,7 @@ class ExpressionParser extends LValParser { parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) { this.initFunction(node, isAsync); node.generator = isGenerator; - this.scope.enter(2 | 16 | (inClassScope ? 64 : 0) | (allowDirectSuper ? 32 : 0)); + this.scope.enter(514 | 16 | (inClassScope ? 576 : 0) | (allowDirectSuper ? 32 : 0)); this.prodParam.enter(functionFlags(isAsync, node.generator)); this.parseFunctionParams(node, isConstructor); const finishedNode = this.parseFunctionBodyAndFinish(node, type, true); @@ -11769,7 +12060,7 @@ class ExpressionParser extends LValParser { return this.finishNode(node, isTuple ? "TupleExpression" : "ArrayExpression"); } parseArrowExpression(node, params, isAsync, trailingCommaLoc) { - this.scope.enter(2 | 4); + this.scope.enter(514 | 4); let flags = functionFlags(isAsync, false); if (!this.match(5) && this.prodParam.hasIn) { flags |= 8; @@ -11857,11 +12148,11 @@ class ExpressionParser extends LValParser { break; } } - elts.push(this.parseExprListItem(allowEmpty, refExpressionErrors)); + elts.push(this.parseExprListItem(close, allowEmpty, refExpressionErrors)); } return elts; } - parseExprListItem(allowEmpty, refExpressionErrors, allowPlaceholder) { + parseExprListItem(close, allowEmpty, refExpressionErrors, allowPlaceholder) { let elt; if (this.match(12)) { if (!allowEmpty) { @@ -11882,7 +12173,7 @@ class ExpressionParser extends LValParser { this.next(); elt = this.finishNode(node, "ArgumentPlaceholder"); } else { - elt = this.parseMaybeAssignAllowIn(refExpressionErrors, this.parseParenItem); + elt = this.parseMaybeAssignAllowInOrVoidPattern(close, refExpressionErrors, this.parseParenItem); } return elt; } @@ -11896,6 +12187,11 @@ class ExpressionParser extends LValParser { node.loc.identifierName = name; return this.finishNode(node, "Identifier"); } + createIdentifierAt(node, name, endLoc) { + node.name = name; + node.loc.identifierName = name; + return this.finishNodeAt(node, "Identifier", endLoc); + } parseIdentifierName(liberal) { let name; const { @@ -11960,7 +12256,7 @@ class ExpressionParser extends LValParser { } } recordAwaitIfAllowed() { - const isAwaitAllowed = this.prodParam.hasAwait || this.optionFlags & 1 && !this.scope.inFunction; + const isAwaitAllowed = this.prodParam.hasAwait; if (isAwaitAllowed && !this.scope.inFunction) { this.state.hasTopLevelAwait = true; } @@ -12023,12 +12319,17 @@ class ExpressionParser extends LValParser { if (this.eat(12)) { if (!this.match(11)) { node.options = this.parseMaybeAssignAllowIn(); - if (this.eat(12) && !this.match(11)) { - do { - this.parseMaybeAssignAllowIn(); - } while (this.eat(12) && !this.match(11)); - this.raise(Errors.ImportCallArity, node); + if (this.eat(12)) { + this.addTrailingCommaExtraToNode(node.options); + if (!this.match(11)) { + do { + this.parseMaybeAssignAllowIn(); + } while (this.eat(12) && !this.match(11)); + this.raise(Errors.ImportCallArity, node); + } } + } else { + this.addTrailingCommaExtraToNode(node.source); } } this.expect(11); @@ -12174,6 +12475,24 @@ class ExpressionParser extends LValParser { } return this.finishNode(node, "ModuleExpression"); } + parseVoidPattern(refExpressionErrors) { + this.expectPlugin("discardBinding"); + const node = this.startNode(); + if (refExpressionErrors != null) { + refExpressionErrors.voidPatternLoc = this.state.startLoc; + } + this.next(); + return this.finishNode(node, "VoidPattern"); + } + parseMaybeAssignAllowInOrVoidPattern(close, refExpressionErrors, afterLeftParse) { + if (refExpressionErrors != null && this.match(88)) { + const nextCode = this.lookaheadCharCode(); + if (nextCode === 44 || nextCode === (close === 3 ? 93 : close === 8 ? 125 : 41) || nextCode === 61) { + return this.parseMaybeDefault(this.state.startLoc, this.parseVoidPattern(refExpressionErrors)); + } + } + return this.parseMaybeAssignAllowIn(refExpressionErrors, afterLeftParse); + } parsePropertyNamePrefixOperator(prop) {} } const loopLabel = { @@ -12293,14 +12612,14 @@ function babel7CompatTokens(tokens, input, startIndex) { } class StatementParser extends ExpressionParser { parseTopLevel(file, program) { - file.program = this.parseProgram(program); + file.program = this.parseProgram(program, 140, this.options.sourceType === "module" ? "module" : "script"); file.comments = this.comments; if (this.optionFlags & 256) { file.tokens = babel7CompatTokens(this.tokens, this.input, this.startIndex); } return this.finishNode(file, "File"); } - parseProgram(program, end = 140, sourceType = this.options.sourceType) { + parseProgram(program, end, sourceType) { program.sourceType = sourceType; program.interpreter = this.parseInterpreterDirective(); this.parseBlockBody(program, true, true, end); @@ -12323,18 +12642,16 @@ class StatementParser extends ExpressionParser { return finishedProgram; } stmtToDirective(stmt) { - const directive = stmt; - directive.type = "Directive"; - directive.value = directive.expression; - delete directive.expression; - const directiveLiteral = directive.value; + const directive = this.castNodeTo(stmt, "Directive"); + const directiveLiteral = this.castNodeTo(stmt.expression, "DirectiveLiteral"); const expressionValue = directiveLiteral.value; const raw = this.input.slice(this.offsetToSourcePos(directiveLiteral.start), this.offsetToSourcePos(directiveLiteral.end)); const val = directiveLiteral.value = raw.slice(1, -1); this.addExtra(directiveLiteral, "raw", raw); this.addExtra(directiveLiteral, "rawValue", val); this.addExtra(directiveLiteral, "expressionValue", expressionValue); - directiveLiteral.type = "DirectiveLiteral"; + directive.value = directiveLiteral; + delete stmt.expression; return directive; } parseInterpreterDirective() { @@ -12352,6 +12669,45 @@ class StatementParser extends ExpressionParser { } return this.hasFollowingBindingAtom(); } + isUsing() { + if (!this.isContextual(107)) { + return false; + } + const next = this.nextTokenInLineStart(); + const nextCh = this.codePointAtPos(next); + return this.chStartsBindingIdentifier(nextCh, next); + } + isForUsing() { + if (!this.isContextual(107)) { + return false; + } + const next = this.nextTokenInLineStart(); + const nextCh = this.codePointAtPos(next); + if (this.isUnparsedContextual(next, "of")) { + const nextCharAfterOf = this.lookaheadCharCodeSince(next + 2); + if (nextCharAfterOf !== 61 && nextCharAfterOf !== 58 && nextCharAfterOf !== 59) { + return false; + } + } + if (this.chStartsBindingIdentifier(nextCh, next) || this.isUnparsedContextual(next, "void")) { + return true; + } + return false; + } + isAwaitUsing() { + if (!this.isContextual(96)) { + return false; + } + let next = this.nextTokenInLineStart(); + if (this.isUnparsedContextual(next, "using")) { + next = this.nextTokenInLineStartSince(next + 5); + const nextCh = this.codePointAtPos(next); + if (this.chStartsBindingIdentifier(nextCh, next)) { + return true; + } + } + return false; + } chStartsBindingIdentifier(ch, pos) { if (isIdentifierStart(ch)) { keywordRelationalOperator.lastIndex = pos; @@ -12381,29 +12737,8 @@ class StatementParser extends ExpressionParser { const nextCh = this.codePointAtPos(next); return nextCh === 123 || this.chStartsBindingIdentifier(nextCh, next); } - startsUsingForOf() { - const { - type, - containsEsc - } = this.lookahead(); - if (type === 102 && !containsEsc) { - return false; - } else if (tokenIsIdentifier(type) && !this.hasFollowingLineBreak()) { - this.expectPlugin("explicitResourceManagement"); - return true; - } - } - startsAwaitUsing() { - let next = this.nextTokenInLineStart(); - if (this.isUnparsedContextual(next, "using")) { - next = this.nextTokenInLineStartSince(next + 5); - const nextCh = this.codePointAtPos(next); - if (this.chStartsBindingIdentifier(nextCh, next)) { - this.expectPlugin("explicitResourceManagement"); - return true; - } - } - return false; + allowsUsing() { + return (this.scope.inModule || !this.scope.inTopLevel) && !this.scope.inBareCaseStatement; } parseModuleItem() { return this.parseStatementLike(1 | 2 | 4 | 8); @@ -12468,11 +12803,13 @@ class StatementParser extends ExpressionParser { case 73: return this.parseTryStatement(node); case 96: - if (!this.state.containsEsc && this.startsAwaitUsing()) { - if (!this.recordAwaitIfAllowed()) { - this.raise(Errors.AwaitUsingNotInAsyncContext, node); + if (this.isAwaitUsing()) { + if (!this.allowsUsing()) { + this.raise(Errors.UnexpectedUsingDeclaration, node); } else if (!allowDeclaration) { this.raise(Errors.UnexpectedLexicalDeclaration, node); + } else if (!this.recordAwaitIfAllowed()) { + this.raise(Errors.AwaitUsingNotInAsyncContext, node); } this.next(); return this.parseVarStatement(node, "await using"); @@ -12482,8 +12819,7 @@ class StatementParser extends ExpressionParser { if (this.state.containsEsc || !this.hasInLineFollowingBindingIdentifierOrBrace()) { break; } - this.expectPlugin("explicitResourceManagement"); - if (!this.scope.inModule && this.scope.inTopLevel) { + if (!this.allowsUsing()) { this.raise(Errors.UnexpectedUsingDeclaration, this.state.startLoc); } else if (!allowDeclaration) { this.raise(Errors.UnexpectedLexicalDeclaration, this.state.startLoc); @@ -12651,7 +12987,7 @@ class StatementParser extends ExpressionParser { if (this.eat(10)) { const node = this.startNodeAt(startLoc); node.callee = expr; - node.arguments = this.parseCallExpressionArguments(11); + node.arguments = this.parseCallExpressionArguments(); this.toReferencedList(node.arguments); return this.finishNode(node, "CallExpression"); } @@ -12725,8 +13061,8 @@ class StatementParser extends ExpressionParser { } const startsWithLet = this.isContextual(100); { - const startsWithAwaitUsing = this.isContextual(96) && this.startsAwaitUsing(); - const starsWithUsingDeclaration = startsWithAwaitUsing || this.isContextual(107) && this.startsUsingForOf(); + const startsWithAwaitUsing = this.isAwaitUsing(); + const starsWithUsingDeclaration = startsWithAwaitUsing || this.isForUsing(); const isLetOrUsing = startsWithLet && this.hasFollowingBindingAtom() || starsWithUsingDeclaration; if (this.match(74) || this.match(75) || isLetOrUsing) { const initNode = this.startNode(); @@ -12796,7 +13132,7 @@ class StatementParser extends ExpressionParser { return this.finishNode(node, "IfStatement"); } parseReturnStatement(node) { - if (!this.prodParam.hasReturn && !(this.optionFlags & 2)) { + if (!this.prodParam.hasReturn) { this.raise(Errors.IllegalReturn, this.state.startLoc); } this.next(); @@ -12814,7 +13150,7 @@ class StatementParser extends ExpressionParser { const cases = node.cases = []; this.expect(5); this.state.labels.push(switchLabel); - this.scope.enter(0); + this.scope.enter(256); let cur; for (let sawDefault; !this.match(8);) { if (this.match(61) || this.match(65)) { @@ -13068,6 +13404,10 @@ class StatementParser extends ExpressionParser { if (id.type === "ArrayPattern" || id.type === "ObjectPattern") { this.raise(Errors.UsingDeclarationHasBindingPattern, id.loc.start); } + } else { + if (id.type === "VoidPattern") { + this.raise(Errors.UnexpectedVoidPattern, id.loc.start); + } } this.checkLVal(id, { type: "VariableDeclarator" @@ -13095,7 +13435,7 @@ class StatementParser extends ExpressionParser { } const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; this.state.maybeInArrowParameters = false; - this.scope.enter(2); + this.scope.enter(514); this.prodParam.enter(functionFlags(isAsync, node.generator)); if (!isDeclaration) { node.id = this.parseFunctionId(); @@ -13236,6 +13576,7 @@ class StatementParser extends ExpressionParser { method.kind = "method"; const isPrivateName = this.match(139); this.parseClassElementName(method); + this.parsePostMemberNameModifiers(method); if (isPrivateName) { this.pushClassPrivateMethod(classBody, privateMethod, true, false); return; @@ -13347,7 +13688,7 @@ class StatementParser extends ExpressionParser { } parseClassStaticBlock(classBody, member) { var _member$decorators; - this.scope.enter(64 | 128 | 16); + this.scope.enter(576 | 128 | 16); const oldLabels = this.state.labels; this.state.labels = []; this.prodParam.enter(0); @@ -13411,7 +13752,7 @@ class StatementParser extends ExpressionParser { return this.finishNode(node, "ClassAccessorProperty"); } parseInitializer(node) { - this.scope.enter(64 | 16); + this.scope.enter(576 | 16); this.expressionScope.enter(newExpressionScope()); this.prodParam.enter(0); node.value = this.eat(29) ? this.parseMaybeAssignAllowIn() : null; @@ -13578,7 +13919,7 @@ class StatementParser extends ExpressionParser { } return this.parseClass(this.maybeTakeDecorators(this.parseDecorators(false), this.startNode()), true, true); } - if (this.match(75) || this.match(74) || this.isLet()) { + if (this.match(75) || this.match(74) || this.isLet() || this.isUsing() || this.isAwaitUsing()) { throw this.raise(Errors.UnsupportedDefaultExport, this.state.startLoc); } const res = this.parseMaybeAssignAllowIn(); @@ -13601,10 +13942,9 @@ class StatementParser extends ExpressionParser { return false; } if ((type === 130 || type === 129) && !this.state.containsEsc) { - const { - type: nextType - } = this.lookahead(); - if (tokenIsIdentifier(nextType) && nextType !== 98 || nextType === 5) { + const next = this.nextTokenStart(); + const nextChar = this.input.charCodeAt(next); + if (nextChar === 123 || this.chStartsBindingIdentifier(nextChar, next) && !this.input.startsWith("from", next)) { this.expectOnePlugin(["flow", "typescript"]); return false; } @@ -13647,11 +13987,11 @@ class StatementParser extends ExpressionParser { return true; } } - if (this.isContextual(107)) { + if (this.isUsing()) { this.raise(Errors.UsingDeclarationExport, this.state.startLoc); return true; } - if (this.isContextual(96) && this.startsAwaitUsing()) { + if (this.isAwaitUsing()) { this.raise(Errors.UsingDeclarationExport, this.state.startLoc); return true; } @@ -13763,9 +14103,9 @@ class StatementParser extends ExpressionParser { if (this.eatContextual(93)) { node.exported = this.parseModuleExportName(); } else if (isString) { - node.exported = cloneStringLiteral(node.local); + node.exported = this.cloneStringLiteral(node.local); } else if (!node.exported) { - node.exported = cloneIdentifier(node.local); + node.exported = this.cloneIdentifier(node.local); } return this.finishNode(node, "ExportSpecifier"); } @@ -13868,18 +14208,18 @@ class StatementParser extends ExpressionParser { this.applyImportPhase(node, isExport, null); return null; } - const phaseIdentifier = this.parseIdentifier(true); + const phaseIdentifier = this.startNode(); + const phaseIdentifierName = this.parseIdentifierName(true); const { type } = this.state; const isImportPhase = tokenIsKeywordOrIdentifier(type) ? type !== 98 || this.lookaheadCharCode() === 102 : type !== 12; if (isImportPhase) { - this.resetPreviousIdentifierLeadingComments(phaseIdentifier); - this.applyImportPhase(node, isExport, phaseIdentifier.name, phaseIdentifier.loc.start); + this.applyImportPhase(node, isExport, phaseIdentifierName, phaseIdentifier.loc.start); return null; } else { this.applyImportPhase(node, isExport, null); - return phaseIdentifier; + return this.createIdentifier(phaseIdentifier, phaseIdentifierName); } } isPrecedingIdImportPhase(phase) { @@ -14077,7 +14417,7 @@ class StatementParser extends ExpressionParser { } this.checkReservedWord(imported.name, specifier.loc.start, true, true); if (!specifier.local) { - specifier.local = cloneIdentifier(imported); + specifier.local = this.cloneIdentifier(imported); } } return this.finishImportSpecifier(specifier, "ImportSpecifier", bindingType); diff --git a/node_modules/@babel/parser/lib/index.js.map b/node_modules/@babel/parser/lib/index.js.map index 52ff54b..dd2f4b3 100644 --- a/node_modules/@babel/parser/lib/index.js.map +++ b/node_modules/@babel/parser/lib/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sources":["../src/util/location.ts","../src/parse-error/module-errors.ts","../src/parse-error/to-node-description.ts","../src/parse-error/standard-errors.ts","../src/parse-error/strict-mode-errors.ts","../src/parse-error/pipeline-operator-errors.ts","../src/parse-error.ts","../src/options.ts","../src/plugins/estree.ts","../src/tokenizer/context.ts","../src/tokenizer/types.ts","../../babel-helper-validator-identifier/src/identifier.ts","../../babel-helper-validator-identifier/src/keyword.ts","../src/util/identifier.ts","../src/util/scope.ts","../src/plugins/flow/scope.ts","../src/parser/base.ts","../src/parser/comments.ts","../src/util/whitespace.ts","../src/tokenizer/state.ts","../../babel-helper-string-parser/src/index.ts","../src/tokenizer/index.ts","../src/util/class-scope.ts","../src/util/expression-scope.ts","../src/util/production-parameter.ts","../src/parser/util.ts","../src/parser/node.ts","../src/plugins/flow/index.ts","../src/plugins/jsx/xhtml.ts","../src/plugins/jsx/index.ts","../src/plugins/typescript/scope.ts","../src/parser/lval.ts","../src/plugins/typescript/index.ts","../src/plugins/placeholders.ts","../src/plugins/v8intrinsic.ts","../src/plugin-utils.ts","../src/parser/expression.ts","../src/parser/statement.ts","../src/parser/index.ts","../src/index.ts"],"sourcesContent":["export type Pos = {\n start: number;\n};\n\n// These are used when `options.locations` is on, for the\n// `startLoc` and `endLoc` properties.\n\nexport class Position {\n line: number;\n column: number;\n index: number;\n\n constructor(line: number, col: number, index: number) {\n this.line = line;\n this.column = col;\n this.index = index;\n }\n}\n\nexport class SourceLocation {\n start: Position;\n end: Position;\n filename: string;\n identifierName: string | undefined | null;\n\n constructor(start: Position, end?: Position) {\n this.start = start;\n // (may start as null, but initialized later)\n this.end = end;\n }\n}\n\n/**\n * creates a new position with a non-zero column offset from the given position.\n * This function should be only be used when we create AST node out of the token\n * boundaries, such as TemplateElement ends before tt.templateNonTail. This\n * function does not skip whitespaces.\n */\nexport function createPositionWithColumnOffset(\n position: Position,\n columnOffset: number,\n) {\n const { line, column, index } = position;\n return new Position(line, column + columnOffset, index + columnOffset);\n}\n","import type { ParseErrorTemplates } from \"../parse-error.ts\";\n\nconst code = \"BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED\";\n\nexport default {\n ImportMetaOutsideModule: {\n message: `import.meta may appear only with 'sourceType: \"module\"'`,\n code,\n },\n ImportOutsideModule: {\n message: `'import' and 'export' may appear only with 'sourceType: \"module\"'`,\n code,\n },\n} satisfies ParseErrorTemplates;\n","const NodeDescriptions = {\n ArrayPattern: \"array destructuring pattern\",\n AssignmentExpression: \"assignment expression\",\n AssignmentPattern: \"assignment expression\",\n ArrowFunctionExpression: \"arrow function expression\",\n ConditionalExpression: \"conditional expression\",\n CatchClause: \"catch clause\",\n ForOfStatement: \"for-of statement\",\n ForInStatement: \"for-in statement\",\n ForStatement: \"for-loop\",\n FormalParameters: \"function parameter list\",\n Identifier: \"identifier\",\n ImportSpecifier: \"import specifier\",\n ImportDefaultSpecifier: \"import default specifier\",\n ImportNamespaceSpecifier: \"import namespace specifier\",\n ObjectPattern: \"object destructuring pattern\",\n ParenthesizedExpression: \"parenthesized expression\",\n RestElement: \"rest element\",\n UpdateExpression: {\n true: \"prefix operation\",\n false: \"postfix operation\",\n },\n VariableDeclarator: \"variable declaration\",\n YieldExpression: \"yield expression\",\n};\n\ntype NodeTypesWithDescriptions = keyof Omit<\n typeof NodeDescriptions,\n \"UpdateExpression\"\n>;\n\ntype NodeWithDescription =\n | {\n type: \"UpdateExpression\";\n prefix: boolean;\n }\n | {\n type: NodeTypesWithDescriptions;\n };\n\nconst toNodeDescription = (node: NodeWithDescription) =>\n node.type === \"UpdateExpression\"\n ? NodeDescriptions.UpdateExpression[`${node.prefix}`]\n : NodeDescriptions[node.type];\n\nexport default toNodeDescription;\n","import type { ParseErrorTemplates } from \"../parse-error.ts\";\nimport toNodeDescription from \"./to-node-description.ts\";\n\nexport type LValAncestor =\n | { type: \"UpdateExpression\"; prefix: boolean }\n | {\n type:\n | \"ArrayPattern\"\n | \"AssignmentExpression\"\n | \"CatchClause\"\n | \"ForOfStatement\"\n | \"FormalParameters\"\n | \"ForInStatement\"\n | \"ForStatement\"\n | \"ImportSpecifier\"\n | \"ImportNamespaceSpecifier\"\n | \"ImportDefaultSpecifier\"\n | \"ParenthesizedExpression\"\n | \"ObjectPattern\"\n | \"RestElement\"\n | \"VariableDeclarator\";\n };\n\nexport default {\n AccessorIsGenerator: ({ kind }: { kind: \"get\" | \"set\" }) =>\n `A ${kind}ter cannot be a generator.`,\n ArgumentsInClass:\n \"'arguments' is only allowed in functions and class methods.\",\n AsyncFunctionInSingleStatementContext:\n \"Async functions can only be declared at the top level or inside a block.\",\n AwaitBindingIdentifier:\n \"Can not use 'await' as identifier inside an async function.\",\n AwaitBindingIdentifierInStaticBlock:\n \"Can not use 'await' as identifier inside a static block.\",\n AwaitExpressionFormalParameter:\n \"'await' is not allowed in async function parameters.\",\n AwaitUsingNotInAsyncContext:\n \"'await using' is only allowed within async functions and at the top levels of modules.\",\n AwaitNotInAsyncContext:\n \"'await' is only allowed within async functions and at the top levels of modules.\",\n BadGetterArity: \"A 'get' accessor must not have any formal parameters.\",\n BadSetterArity: \"A 'set' accessor must have exactly one formal parameter.\",\n BadSetterRestParameter:\n \"A 'set' accessor function argument must not be a rest parameter.\",\n ConstructorClassField: \"Classes may not have a field named 'constructor'.\",\n ConstructorClassPrivateField:\n \"Classes may not have a private field named '#constructor'.\",\n ConstructorIsAccessor: \"Class constructor may not be an accessor.\",\n ConstructorIsAsync: \"Constructor can't be an async function.\",\n ConstructorIsGenerator: \"Constructor can't be a generator.\",\n DeclarationMissingInitializer: ({\n kind,\n }: {\n kind: \"await using\" | \"const\" | \"destructuring\" | \"using\";\n }) => `Missing initializer in ${kind} declaration.`,\n DecoratorArgumentsOutsideParentheses:\n \"Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.\",\n DecoratorBeforeExport:\n \"Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.\",\n DecoratorsBeforeAfterExport:\n \"Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.\",\n DecoratorConstructor:\n \"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?\",\n DecoratorExportClass:\n \"Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.\",\n DecoratorSemicolon: \"Decorators must not be followed by a semicolon.\",\n DecoratorStaticBlock: \"Decorators can't be used with a static block.\",\n DeferImportRequiresNamespace:\n 'Only `import defer * as x from \"./module\"` is valid.',\n DeletePrivateField: \"Deleting a private field is not allowed.\",\n DestructureNamedImport:\n \"ES2015 named imports do not destructure. Use another statement for destructuring after the import.\",\n DuplicateConstructor: \"Duplicate constructor in the same class.\",\n DuplicateDefaultExport: \"Only one default export allowed per module.\",\n DuplicateExport: ({ exportName }: { exportName: string }) =>\n `\\`${exportName}\\` has already been exported. Exported identifiers must be unique.`,\n DuplicateProto: \"Redefinition of __proto__ property.\",\n DuplicateRegExpFlags: \"Duplicate regular expression flag.\",\n DynamicImportPhaseRequiresImportExpressions: ({ phase }: { phase: string }) =>\n `'import.${phase}(...)' can only be parsed when using the 'createImportExpressions' option.`,\n ElementAfterRest: \"Rest element must be last element.\",\n EscapedCharNotAnIdentifier: \"Invalid Unicode escape.\",\n ExportBindingIsString: ({\n localName,\n exportName,\n }: {\n localName: string;\n exportName: string;\n }) =>\n `A string literal cannot be used as an exported binding without \\`from\\`.\\n- Did you mean \\`export { '${localName}' as '${exportName}' } from 'some-module'\\`?`,\n ExportDefaultFromAsIdentifier:\n \"'from' is not allowed as an identifier after 'export default'.\",\n\n ForInOfLoopInitializer: ({\n type,\n }: {\n type: \"ForInStatement\" | \"ForOfStatement\";\n }) =>\n `'${\n type === \"ForInStatement\" ? \"for-in\" : \"for-of\"\n }' loop variable declaration may not have an initializer.`,\n ForInUsing: \"For-in loop may not start with 'using' declaration.\",\n\n ForOfAsync: \"The left-hand side of a for-of loop may not be 'async'.\",\n ForOfLet: \"The left-hand side of a for-of loop may not start with 'let'.\",\n GeneratorInSingleStatementContext:\n \"Generators can only be declared at the top level or inside a block.\",\n\n IllegalBreakContinue: ({\n type,\n }: {\n type: \"BreakStatement\" | \"ContinueStatement\";\n }) => `Unsyntactic ${type === \"BreakStatement\" ? \"break\" : \"continue\"}.`,\n\n IllegalLanguageModeDirective:\n \"Illegal 'use strict' directive in function with non-simple parameter list.\",\n IllegalReturn: \"'return' outside of function.\",\n ImportAttributesUseAssert:\n \"The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedImportAssert` parser plugin to suppress this error.\",\n ImportBindingIsString: ({ importName }: { importName: string }) =>\n `A string literal cannot be used as an imported binding.\\n- Did you mean \\`import { \"${importName}\" as foo }\\`?`,\n ImportCallArity: `\\`import()\\` requires exactly one or two arguments.`,\n ImportCallNotNewExpression: \"Cannot use new with import(...).\",\n ImportCallSpreadArgument: \"`...` is not allowed in `import()`.\",\n ImportJSONBindingNotDefault:\n \"A JSON module can only be imported with `default`.\",\n ImportReflectionHasAssertion: \"`import module x` cannot have assertions.\",\n ImportReflectionNotBinding:\n 'Only `import module x from \"./module\"` is valid.',\n IncompatibleRegExpUVFlags:\n \"The 'u' and 'v' regular expression flags cannot be enabled at the same time.\",\n InvalidBigIntLiteral: \"Invalid BigIntLiteral.\",\n InvalidCodePoint: \"Code point out of bounds.\",\n InvalidCoverInitializedName: \"Invalid shorthand property initializer.\",\n InvalidDecimal: \"Invalid decimal.\",\n InvalidDigit: ({ radix }: { radix: number }) =>\n `Expected number in radix ${radix}.`,\n InvalidEscapeSequence: \"Bad character escape sequence.\",\n InvalidEscapeSequenceTemplate: \"Invalid escape sequence in template.\",\n InvalidEscapedReservedWord: ({ reservedWord }: { reservedWord: string }) =>\n `Escape sequence in keyword ${reservedWord}.`,\n InvalidIdentifier: ({ identifierName }: { identifierName: string }) =>\n `Invalid identifier ${identifierName}.`,\n InvalidLhs: ({ ancestor }: { ancestor: LValAncestor }) =>\n `Invalid left-hand side in ${toNodeDescription(ancestor)}.`,\n InvalidLhsBinding: ({ ancestor }: { ancestor: LValAncestor }) =>\n `Binding invalid left-hand side in ${toNodeDescription(ancestor)}.`,\n InvalidLhsOptionalChaining: ({ ancestor }: { ancestor: LValAncestor }) =>\n `Invalid optional chaining in the left-hand side of ${toNodeDescription(\n ancestor,\n )}.`,\n InvalidNumber: \"Invalid number.\",\n InvalidOrMissingExponent:\n \"Floating-point numbers require a valid exponent after the 'e'.\",\n InvalidOrUnexpectedToken: ({ unexpected }: { unexpected: string }) =>\n `Unexpected character '${unexpected}'.`,\n InvalidParenthesizedAssignment: \"Invalid parenthesized assignment pattern.\",\n InvalidPrivateFieldResolution: ({\n identifierName,\n }: {\n identifierName: string;\n }) => `Private name #${identifierName} is not defined.`,\n InvalidPropertyBindingPattern: \"Binding member expression.\",\n InvalidRecordProperty:\n \"Only properties and spread elements are allowed in record definitions.\",\n InvalidRestAssignmentPattern: \"Invalid rest operator's argument.\",\n LabelRedeclaration: ({ labelName }: { labelName: string }) =>\n `Label '${labelName}' is already declared.`,\n LetInLexicalBinding: \"'let' is disallowed as a lexically bound name.\",\n LineTerminatorBeforeArrow: \"No line break is allowed before '=>'.\",\n MalformedRegExpFlags: \"Invalid regular expression flag.\",\n MissingClassName: \"A class name is required.\",\n MissingEqInAssignment:\n \"Only '=' operator can be used for specifying default value.\",\n MissingSemicolon: \"Missing semicolon.\",\n MissingPlugin: ({ missingPlugin }: { missingPlugin: [string] }) =>\n `This experimental syntax requires enabling the parser plugin: ${missingPlugin\n .map(name => JSON.stringify(name))\n .join(\", \")}.`,\n // FIXME: Would be nice to make this \"missingPlugins\" instead.\n // Also, seems like we can drop the \"(s)\" from the message and just make it \"s\".\n MissingOneOfPlugins: ({ missingPlugin }: { missingPlugin: string[] }) =>\n `This experimental syntax requires enabling one of the following parser plugin(s): ${missingPlugin\n .map(name => JSON.stringify(name))\n .join(\", \")}.`,\n MissingUnicodeEscape: \"Expecting Unicode escape sequence \\\\uXXXX.\",\n MixingCoalesceWithLogical:\n \"Nullish coalescing operator(??) requires parens when mixing with logical operators.\",\n ModuleAttributeDifferentFromType:\n \"The only accepted module attribute is `type`.\",\n ModuleAttributeInvalidValue:\n \"Only string literals are allowed as module attribute values.\",\n ModuleAttributesWithDuplicateKeys: ({ key }: { key: string }) =>\n `Duplicate key \"${key}\" is not allowed in module attributes.`,\n ModuleExportNameHasLoneSurrogate: ({\n surrogateCharCode,\n }: {\n surrogateCharCode: number;\n }) =>\n `An export name cannot include a lone surrogate, found '\\\\u${surrogateCharCode.toString(\n 16,\n )}'.`,\n ModuleExportUndefined: ({ localName }: { localName: string }) =>\n `Export '${localName}' is not defined.`,\n MultipleDefaultsInSwitch: \"Multiple default clauses.\",\n NewlineAfterThrow: \"Illegal newline after throw.\",\n NoCatchOrFinally: \"Missing catch or finally clause.\",\n NumberIdentifier: \"Identifier directly after number.\",\n NumericSeparatorInEscapeSequence:\n \"Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.\",\n ObsoleteAwaitStar:\n \"'await*' has been removed from the async functions proposal. Use Promise.all() instead.\",\n OptionalChainingNoNew:\n \"Constructors in/after an Optional Chain are not allowed.\",\n OptionalChainingNoTemplate:\n \"Tagged Template Literals are not allowed in optionalChain.\",\n OverrideOnConstructor:\n \"'override' modifier cannot appear on a constructor declaration.\",\n ParamDupe: \"Argument name clash.\",\n PatternHasAccessor: \"Object pattern can't contain getter or setter.\",\n PatternHasMethod: \"Object pattern can't contain methods.\",\n PrivateInExpectedIn: ({ identifierName }: { identifierName: string }) =>\n `Private names are only allowed in property accesses (\\`obj.#${identifierName}\\`) or in \\`in\\` expressions (\\`#${identifierName} in obj\\`).`,\n PrivateNameRedeclaration: ({ identifierName }: { identifierName: string }) =>\n `Duplicate private name #${identifierName}.`,\n RecordExpressionBarIncorrectEndSyntaxType:\n \"Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.\",\n RecordExpressionBarIncorrectStartSyntaxType:\n \"Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.\",\n RecordExpressionHashIncorrectStartSyntaxType:\n \"Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.\",\n RecordNoProto: \"'__proto__' is not allowed in Record expressions.\",\n RestTrailingComma: \"Unexpected trailing comma after rest element.\",\n SloppyFunction:\n \"In non-strict mode code, functions can only be declared at top level or inside a block.\",\n SloppyFunctionAnnexB:\n \"In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.\",\n SourcePhaseImportRequiresDefault:\n 'Only `import source x from \"./module\"` is valid.',\n StaticPrototype: \"Classes may not have static property named prototype.\",\n SuperNotAllowed:\n \"`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?\",\n SuperPrivateField: \"Private fields can't be accessed on super.\",\n TrailingDecorator: \"Decorators must be attached to a class element.\",\n TupleExpressionBarIncorrectEndSyntaxType:\n \"Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.\",\n TupleExpressionBarIncorrectStartSyntaxType:\n \"Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.\",\n TupleExpressionHashIncorrectStartSyntaxType:\n \"Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.\",\n UnexpectedArgumentPlaceholder: \"Unexpected argument placeholder.\",\n UnexpectedAwaitAfterPipelineBody:\n 'Unexpected \"await\" after pipeline body; await must have parentheses in minimal proposal.',\n UnexpectedDigitAfterHash: \"Unexpected digit after hash token.\",\n UnexpectedImportExport:\n \"'import' and 'export' may only appear at the top level.\",\n UnexpectedKeyword: ({ keyword }: { keyword: string }) =>\n `Unexpected keyword '${keyword}'.`,\n UnexpectedLeadingDecorator:\n \"Leading decorators must be attached to a class declaration.\",\n UnexpectedLexicalDeclaration:\n \"Lexical declaration cannot appear in a single-statement context.\",\n UnexpectedNewTarget:\n \"`new.target` can only be used in functions or class properties.\",\n UnexpectedNumericSeparator:\n \"A numeric separator is only allowed between two digits.\",\n UnexpectedPrivateField: \"Unexpected private name.\",\n UnexpectedReservedWord: ({ reservedWord }: { reservedWord: string }) =>\n `Unexpected reserved word '${reservedWord}'.`,\n UnexpectedSuper: \"'super' is only allowed in object methods and classes.\",\n UnexpectedToken: ({\n expected,\n unexpected,\n }: {\n expected?: string | null;\n unexpected?: string | null;\n }) =>\n `Unexpected token${unexpected ? ` '${unexpected}'.` : \"\"}${\n expected ? `, expected \"${expected}\"` : \"\"\n }`,\n UnexpectedTokenUnaryExponentiation:\n \"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.\",\n UnexpectedUsingDeclaration:\n \"Using declaration cannot appear in the top level when source type is `script`.\",\n UnsupportedBind: \"Binding should be performed on object property.\",\n UnsupportedDecoratorExport:\n \"A decorated export must export a class declaration.\",\n UnsupportedDefaultExport:\n \"Only expressions, functions or classes are allowed as the `default` export.\",\n UnsupportedImport:\n \"`import` can only be used in `import()` or `import.meta`.\",\n UnsupportedMetaProperty: ({\n target,\n onlyValidPropertyName,\n }: {\n target: string;\n onlyValidPropertyName: string;\n }) =>\n `The only valid meta property for ${target} is ${target}.${onlyValidPropertyName}.`,\n UnsupportedParameterDecorator:\n \"Decorators cannot be used to decorate parameters.\",\n UnsupportedPropertyDecorator:\n \"Decorators cannot be used to decorate object literal properties.\",\n UnsupportedSuper:\n \"'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).\",\n UnterminatedComment: \"Unterminated comment.\",\n UnterminatedRegExp: \"Unterminated regular expression.\",\n UnterminatedString: \"Unterminated string constant.\",\n UnterminatedTemplate: \"Unterminated template.\",\n UsingDeclarationExport: \"Using declaration cannot be exported.\",\n UsingDeclarationHasBindingPattern:\n \"Using declaration cannot have destructuring patterns.\",\n VarRedeclaration: ({ identifierName }: { identifierName: string }) =>\n `Identifier '${identifierName}' has already been declared.`,\n YieldBindingIdentifier:\n \"Can not use 'yield' as identifier inside a generator.\",\n YieldInParameter: \"Yield expression is not allowed in formal parameters.\",\n YieldNotInGeneratorFunction:\n \"'yield' is only allowed within generator functions.\",\n ZeroDigitNumericSeparator:\n \"Numeric separator can not be used after leading 0.\",\n} satisfies ParseErrorTemplates;\n","import type { ParseErrorTemplates } from \"../parse-error\";\n\nexport default {\n StrictDelete: \"Deleting local variable in strict mode.\",\n\n // `referenceName` is the StringValue[1] of an IdentifierReference[2], which\n // is represented as just an `Identifier`[3] in the Babel AST.\n // 1. https://tc39.es/ecma262/#sec-static-semantics-stringvalue\n // 2. https://tc39.es/ecma262/#prod-IdentifierReference\n // 3. https://github.com/babel/babel/blob/main/packages/babel-parser/ast/spec.md#identifier\n StrictEvalArguments: ({ referenceName }: { referenceName: string }) =>\n `Assigning to '${referenceName}' in strict mode.`,\n\n // `bindingName` is the StringValue[1] of a BindingIdentifier[2], which is\n // represented as just an `Identifier`[3] in the Babel AST.\n // 1. https://tc39.es/ecma262/#sec-static-semantics-stringvalue\n // 2. https://tc39.es/ecma262/#prod-BindingIdentifier\n // 3. https://github.com/babel/babel/blob/main/packages/babel-parser/ast/spec.md#identifier\n StrictEvalArgumentsBinding: ({ bindingName }: { bindingName: string }) =>\n `Binding '${bindingName}' in strict mode.`,\n\n StrictFunction:\n \"In strict mode code, functions can only be declared at top level or inside a block.\",\n\n StrictNumericEscape: \"The only valid numeric escape in strict mode is '\\\\0'.\",\n\n StrictOctalLiteral: \"Legacy octal literals are not allowed in strict mode.\",\n\n StrictWith: \"'with' in strict mode.\",\n} satisfies ParseErrorTemplates;\n","import type { ParseErrorTemplates } from \"../parse-error.ts\";\nimport toNodeDescription from \"./to-node-description.ts\";\n\nexport const UnparenthesizedPipeBodyDescriptions = new Set([\n \"ArrowFunctionExpression\",\n \"AssignmentExpression\",\n \"ConditionalExpression\",\n \"YieldExpression\",\n] as const);\n\ntype GetSetMemberType> =\n T extends Set ? M : unknown;\n\nexport type UnparenthesizedPipeBodyTypes = GetSetMemberType<\n typeof UnparenthesizedPipeBodyDescriptions\n>;\n\nexport default {\n // This error is only used by the smart-mix proposal\n PipeBodyIsTighter:\n \"Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.\",\n PipeTopicRequiresHackPipes: process.env.BABEL_8_BREAKING\n ? 'Topic references are only supported when using the `\"proposal\": \"hack\"` version of the pipeline proposal.'\n : 'Topic reference is used, but the pipelineOperator plugin was not passed a \"proposal\": \"hack\" or \"smart\" option.',\n PipeTopicUnbound:\n \"Topic reference is unbound; it must be inside a pipe body.\",\n PipeTopicUnconfiguredToken: ({ token }: { token: string }) =>\n `Invalid topic token ${token}. In order to use ${token} as a topic reference, the pipelineOperator plugin must be configured with { \"proposal\": \"hack\", \"topicToken\": \"${token}\" }.`,\n PipeTopicUnused:\n \"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.\",\n PipeUnparenthesizedBody: ({ type }: { type: UnparenthesizedPipeBodyTypes }) =>\n `Hack-style pipe body cannot be an unparenthesized ${toNodeDescription({\n type,\n })}; please wrap it in parentheses.`,\n\n ...(process.env.BABEL_8_BREAKING\n ? {}\n : {\n // Messages whose codes start with “Pipeline” or “PrimaryTopic”\n // are retained for backwards compatibility\n // with the deprecated smart-mix pipe operator proposal plugin.\n // They are subject to removal in a future major version.\n PipelineBodyNoArrow:\n 'Unexpected arrow \"=>\" after pipeline body; arrow function in pipeline body must be parenthesized.',\n PipelineBodySequenceExpression:\n \"Pipeline body may not be a comma-separated sequence expression.\",\n PipelineHeadSequenceExpression:\n \"Pipeline head should not be a comma-separated sequence expression.\",\n PipelineTopicUnused:\n \"Pipeline is in topic style but does not use topic reference.\",\n PrimaryTopicNotAllowed:\n \"Topic reference was used in a lexical context without topic binding.\",\n PrimaryTopicRequiresSmartPipeline:\n 'Topic reference is used, but the pipelineOperator plugin was not passed a \"proposal\": \"hack\" or \"smart\" option.',\n }),\n} satisfies ParseErrorTemplates;\n","import { Position } from \"./util/location.ts\";\n\ntype SyntaxPlugin =\n | \"flow\"\n | \"typescript\"\n | \"jsx\"\n | \"pipelineOperator\"\n | \"placeholders\";\n\ntype ParseErrorCode =\n | \"BABEL_PARSER_SYNTAX_ERROR\"\n | \"BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED\";\n\n// Babel uses \"normal\" SyntaxErrors for it's errors, but adds some extra\n// functionality. This functionality is defined in the\n// `ParseErrorSpecification` interface below. We may choose to change to someday\n// give our errors their own full-blown class, but until then this allow us to\n// keep all the desirable properties of SyntaxErrors (like their name in stack\n// traces, etc.), and also allows us to punt on any publicly facing\n// class-hierarchy decisions until Babel 8.\ninterface ParseErrorSpecification {\n // Look, these *could* be readonly, but then Flow complains when we initially\n // set them. We could do a whole dance and make a special interface that's not\n // readonly for when we create the error, then cast it to the readonly\n // interface for public use, but the previous implementation didn't have them\n // as readonly, so let's just not worry about it for now.\n code: ParseErrorCode;\n reasonCode: string;\n syntaxPlugin?: SyntaxPlugin;\n missingPlugin?: string | string[];\n loc: Position;\n details: ErrorDetails;\n\n // We should consider removing this as it now just contains the same\n // information as `loc.index`.\n pos: number;\n}\n\nexport type ParseError = SyntaxError &\n ParseErrorSpecification;\n\n// By `ParseErrorConstructor`, we mean something like the new-less style\n// `ErrorConstructor`[1], since `ParseError`'s are not themselves actually\n// separate classes from `SyntaxError`'s.\n//\n// 1. https://github.com/microsoft/TypeScript/blob/v4.5.5/lib/lib.es5.d.ts#L1027\nexport type ParseErrorConstructor = (\n loc: Position,\n details: ErrorDetails,\n) => ParseError;\n\ntype ToMessage = (self: ErrorDetails) => string;\n\ntype ParseErrorCredentials = {\n code: string;\n reasonCode: string;\n syntaxPlugin?: SyntaxPlugin;\n toMessage: ToMessage;\n};\n\nfunction defineHidden(obj: object, key: string, value: unknown) {\n Object.defineProperty(obj, key, {\n enumerable: false,\n configurable: true,\n value,\n });\n}\n\nfunction toParseErrorConstructor({\n toMessage,\n code,\n reasonCode,\n syntaxPlugin,\n}: ParseErrorCredentials): ParseErrorConstructor {\n const hasMissingPlugin =\n reasonCode === \"MissingPlugin\" || reasonCode === \"MissingOneOfPlugins\";\n\n if (!process.env.BABEL_8_BREAKING) {\n const oldReasonCodes: Record = {\n AccessorCannotDeclareThisParameter: \"AccesorCannotDeclareThisParameter\",\n AccessorCannotHaveTypeParameters: \"AccesorCannotHaveTypeParameters\",\n ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:\n \"ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference\",\n SetAccessorCannotHaveOptionalParameter:\n \"SetAccesorCannotHaveOptionalParameter\",\n SetAccessorCannotHaveRestParameter: \"SetAccesorCannotHaveRestParameter\",\n SetAccessorCannotHaveReturnType: \"SetAccesorCannotHaveReturnType\",\n };\n if (oldReasonCodes[reasonCode]) {\n reasonCode = oldReasonCodes[reasonCode];\n }\n }\n\n return function constructor(loc: Position, details: ErrorDetails) {\n const error: ParseError = new SyntaxError() as any;\n\n error.code = code as ParseErrorCode;\n error.reasonCode = reasonCode;\n error.loc = loc;\n error.pos = loc.index;\n\n error.syntaxPlugin = syntaxPlugin;\n if (hasMissingPlugin) {\n error.missingPlugin = (details as any).missingPlugin;\n }\n\n type Overrides = {\n loc?: Position;\n details?: ErrorDetails;\n };\n defineHidden(error, \"clone\", function clone(overrides: Overrides = {}) {\n const { line, column, index } = overrides.loc ?? loc;\n return constructor(new Position(line, column, index), {\n ...details,\n ...overrides.details,\n });\n });\n\n defineHidden(error, \"details\", details);\n\n Object.defineProperty(error, \"message\", {\n configurable: true,\n get(this: ParseError): string {\n const message = `${toMessage(details)} (${loc.line}:${loc.column})`;\n this.message = message;\n return message;\n },\n set(value: string) {\n Object.defineProperty(this, \"message\", { value, writable: true });\n },\n });\n\n return error;\n };\n}\n\ntype ParseErrorTemplate =\n | string\n | ToMessage\n | { message: string | ToMessage; code?: ParseErrorCode };\n\nexport type ParseErrorTemplates = { [reasonCode: string]: ParseErrorTemplate };\n\n// This is the templated form of `ParseErrorEnum`.\n//\n// Note: We could factor out the return type calculation into something like\n// `ParseErrorConstructor`, and then we could\n// reuse it in the non-templated form of `ParseErrorEnum`, but TypeScript\n// doesn't seem to drill down that far when showing you the computed type of\n// an object in an editor, so we'll leave it inlined for now.\nexport function ParseErrorEnum(a: TemplateStringsArray): <\n T extends ParseErrorTemplates,\n>(\n parseErrorTemplates: T,\n) => {\n [K in keyof T]: ParseErrorConstructor<\n T[K] extends { message: string | ToMessage }\n ? T[K][\"message\"] extends ToMessage\n ? Parameters[0]\n : object\n : T[K] extends ToMessage\n ? Parameters[0]\n : object\n >;\n};\n\nexport function ParseErrorEnum(\n parseErrorTemplates: T,\n syntaxPlugin?: SyntaxPlugin,\n): {\n [K in keyof T]: ParseErrorConstructor<\n T[K] extends { message: string | ToMessage }\n ? T[K][\"message\"] extends ToMessage\n ? Parameters[0]\n : object\n : T[K] extends ToMessage\n ? Parameters[0]\n : object\n >;\n};\n\n// You call `ParseErrorEnum` with a mapping from `ReasonCode`'s to either:\n//\n// 1. a static error message,\n// 2. `toMessage` functions that define additional necessary `details` needed by\n// the `ParseError`, or\n// 3. Objects that contain a `message` of one of the above and overridden `code`\n// and/or `reasonCode`:\n//\n// ParseErrorEnum `optionalSyntaxPlugin` ({\n// ErrorWithStaticMessage: \"message\",\n// ErrorWithDynamicMessage: ({ type } : { type: string }) => `${type}`),\n// ErrorWithOverriddenCodeAndOrReasonCode: {\n// message: ({ type }: { type: string }) => `${type}`),\n// code: \"AN_ERROR_CODE\",\n// ...(BABEL_8_BREAKING ? { } : { reasonCode: \"CustomErrorReasonCode\" })\n// }\n// });\n//\nexport function ParseErrorEnum(\n argument: TemplateStringsArray | ParseErrorTemplates,\n syntaxPlugin?: SyntaxPlugin,\n) {\n // If the first parameter is an array, that means we were called with a tagged\n // template literal. Extract the syntaxPlugin from this, and call again in\n // the \"normalized\" form.\n if (Array.isArray(argument)) {\n return (parseErrorTemplates: ParseErrorTemplates) =>\n ParseErrorEnum(parseErrorTemplates, argument[0]);\n }\n\n const ParseErrorConstructors = {} as Record<\n string,\n ParseErrorConstructor\n >;\n\n for (const reasonCode of Object.keys(argument)) {\n const template = (argument as ParseErrorTemplates)[reasonCode];\n const { message, ...rest } =\n typeof template === \"string\"\n ? { message: () => template }\n : typeof template === \"function\"\n ? { message: template }\n : template;\n const toMessage = typeof message === \"string\" ? () => message : message;\n\n ParseErrorConstructors[reasonCode] = toParseErrorConstructor({\n code: \"BABEL_PARSER_SYNTAX_ERROR\",\n reasonCode,\n toMessage,\n ...(syntaxPlugin ? { syntaxPlugin } : {}),\n ...rest,\n });\n }\n\n return ParseErrorConstructors;\n}\n\nimport ModuleErrors from \"./parse-error/module-errors.ts\";\nimport StandardErrors from \"./parse-error/standard-errors.ts\";\nimport StrictModeErrors from \"./parse-error/strict-mode-errors.ts\";\nimport PipelineOperatorErrors from \"./parse-error/pipeline-operator-errors.ts\";\n\nexport const Errors = {\n ...ParseErrorEnum(ModuleErrors),\n ...ParseErrorEnum(StandardErrors),\n ...ParseErrorEnum(StrictModeErrors),\n ...ParseErrorEnum`pipelineOperator`(PipelineOperatorErrors),\n};\n\nexport type { LValAncestor } from \"./parse-error/standard-errors.ts\";\n","import type { Plugin } from \"./plugin-utils.ts\";\n\n// A second optional argument can be given to further configure\n// the parser process. These options are recognized:\n\nexport type SourceType = \"script\" | \"module\" | \"unambiguous\";\n\nexport interface Options {\n /**\n * By default, import and export declarations can only appear at a program's top level.\n * Setting this option to true allows them anywhere where a statement is allowed.\n */\n allowImportExportEverywhere?: boolean;\n\n /**\n * By default, await use is not allowed outside of an async function.\n * Set this to true to accept such code.\n */\n allowAwaitOutsideFunction?: boolean;\n\n /**\n * By default, a return statement at the top level raises an error.\n * Set this to true to accept such code.\n */\n allowReturnOutsideFunction?: boolean;\n\n /**\n * By default, new.target use is not allowed outside of a function or class.\n * Set this to true to accept such code.\n */\n allowNewTargetOutsideFunction?: boolean;\n\n allowSuperOutsideMethod?: boolean;\n\n /**\n * By default, exported identifiers must refer to a declared variable.\n * Set this to true to allow export statements to reference undeclared variables.\n */\n allowUndeclaredExports?: boolean;\n\n /**\n * By default, yield use is not allowed outside of a generator function.\n * Set this to true to accept such code.\n */\n\n allowYieldOutsideFunction?: boolean;\n\n /**\n * By default, Babel parser JavaScript code according to Annex B syntax.\n * Set this to `false` to disable such behavior.\n */\n annexB?: boolean;\n\n /**\n * By default, Babel attaches comments to adjacent AST nodes.\n * When this option is set to false, comments are not attached.\n * It can provide up to 30% performance improvement when the input code has many comments.\n * @babel/eslint-parser will set it for you.\n * It is not recommended to use attachComment: false with Babel transform,\n * as doing so removes all the comments in output code, and renders annotations such as\n * /* istanbul ignore next *\\/ nonfunctional.\n */\n attachComment?: boolean;\n\n /**\n * By default, Babel always throws an error when it finds some invalid code.\n * When this option is set to true, it will store the parsing error and\n * try to continue parsing the invalid input file.\n */\n errorRecovery?: boolean;\n\n /**\n * Indicate the mode the code should be parsed in.\n * Can be one of \"script\", \"module\", or \"unambiguous\". Defaults to \"script\".\n * \"unambiguous\" will make @babel/parser attempt to guess, based on the presence\n * of ES6 import or export statements.\n * Files with ES6 imports and exports are considered \"module\" and are otherwise \"script\".\n */\n sourceType?: \"script\" | \"module\" | \"unambiguous\";\n\n /**\n * Correlate output AST nodes with their source filename.\n * Useful when generating code and source maps from the ASTs of multiple input files.\n */\n sourceFilename?: string;\n\n /**\n * By default, all source indexes start from 0.\n * You can provide a start index to alternatively start with.\n * Useful for integration with other source tools.\n */\n startIndex?: number;\n\n /**\n * By default, the first line of code parsed is treated as line 1.\n * You can provide a line number to alternatively start with.\n * Useful for integration with other source tools.\n */\n startLine?: number;\n\n /**\n * By default, the parsed code is treated as if it starts from line 1, column 0.\n * You can provide a column number to alternatively start with.\n * Useful for integration with other source tools.\n */\n startColumn?: number;\n\n /**\n * Array containing the plugins that you want to enable.\n */\n plugins?: Plugin[];\n\n /**\n * Should the parser work in strict mode.\n * Defaults to true if sourceType === 'module'. Otherwise, false.\n */\n strictMode?: boolean;\n\n /**\n * Adds a ranges property to each node: [node.start, node.end]\n */\n ranges?: boolean;\n\n /**\n * Adds all parsed tokens to a tokens property on the File node.\n */\n tokens?: boolean;\n\n /**\n * By default, the parser adds information about parentheses by setting\n * `extra.parenthesized` to `true` as needed.\n * When this option is `true` the parser creates `ParenthesizedExpression`\n * AST nodes instead of using the `extra` property.\n */\n createParenthesizedExpressions?: boolean;\n\n /**\n * The default is false in Babel 7 and true in Babel 8\n * Set this to true to parse it as an `ImportExpression` node.\n * Otherwise `import(foo)` is parsed as `CallExpression(Import, [Identifier(foo)])`.\n */\n createImportExpressions?: boolean;\n}\n\nexport const enum OptionFlags {\n AllowAwaitOutsideFunction = 1 << 0,\n AllowReturnOutsideFunction = 1 << 1,\n AllowNewTargetOutsideFunction = 1 << 2,\n AllowImportExportEverywhere = 1 << 3,\n AllowSuperOutsideMethod = 1 << 4,\n AllowYieldOutsideFunction = 1 << 5,\n AllowUndeclaredExports = 1 << 6,\n Ranges = 1 << 7,\n Tokens = 1 << 8,\n CreateImportExpressions = 1 << 9,\n CreateParenthesizedExpressions = 1 << 10,\n ErrorRecovery = 1 << 11,\n AttachComment = 1 << 12,\n AnnexB = 1 << 13,\n}\n\ntype OptionsWithDefaults = Required;\n\nfunction createDefaultOptions(): OptionsWithDefaults {\n return {\n // Source type (\"script\" or \"module\") for different semantics\n sourceType: \"script\",\n // Source filename.\n sourceFilename: undefined,\n // Index (0-based) from which to start counting source. Useful for\n // integration with other tools.\n startIndex: 0,\n // Column (0-based) from which to start counting source. Useful for\n // integration with other tools.\n startColumn: 0,\n // Line (1-based) from which to start counting source. Useful for\n // integration with other tools.\n startLine: 1,\n // When enabled, await at the top level is not considered an\n // error.\n allowAwaitOutsideFunction: false,\n // When enabled, a return at the top level is not considered an\n // error.\n allowReturnOutsideFunction: false,\n // When enabled, new.target outside a function or class is not\n // considered an error.\n allowNewTargetOutsideFunction: false,\n // When enabled, import/export statements are not constrained to\n // appearing at the top of the program.\n allowImportExportEverywhere: false,\n // TODO\n allowSuperOutsideMethod: false,\n // When enabled, export statements can reference undeclared variables.\n allowUndeclaredExports: false,\n allowYieldOutsideFunction: false,\n // An array of plugins to enable\n plugins: [],\n // TODO\n strictMode: null,\n // Nodes have their start and end characters offsets recorded in\n // `start` and `end` properties (directly on the node, rather than\n // the `loc` object, which holds line/column data. To also add a\n // [semi-standardized][range] `range` property holding a `[start,\n // end]` array with the same numbers, set the `ranges` option to\n // `true`.\n //\n // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678\n ranges: false,\n // Adds all parsed tokens to a `tokens` property on the `File` node\n tokens: false,\n // Whether to create ImportExpression AST nodes (if false\n // `import(foo)` will be parsed as CallExpression(Import, [Identifier(foo)])\n createImportExpressions: process.env.BABEL_8_BREAKING ? true : false,\n // Whether to create ParenthesizedExpression AST nodes (if false\n // the parser sets extra.parenthesized on the expression nodes instead).\n createParenthesizedExpressions: false,\n // When enabled, errors are attached to the AST instead of being directly thrown.\n // Some errors will still throw, because @babel/parser can't always recover.\n errorRecovery: false,\n // When enabled, comments will be attached to adjacent AST nodes as one of\n // `leadingComments`, `trailingComments` and `innerComments`. The comment attachment\n // is vital to preserve comments after transform. If you don't print AST back,\n // consider set this option to `false` for performance\n attachComment: true,\n // When enabled, the parser will support Annex B syntax.\n // https://tc39.es/ecma262/#sec-additional-ecmascript-features-for-web-browsers\n annexB: true,\n };\n}\n\n// Interpret and default an options object\n\nexport function getOptions(opts?: Options | null): OptionsWithDefaults {\n // https://github.com/babel/babel/pull/16918\n // `options` is accessed frequently, please make sure it is a fast object.\n // `%ToFastProperties` can make it a fast object, but the performance is the same as the slow object.\n const options: any = createDefaultOptions();\n\n if (opts == null) {\n return options;\n }\n if (opts.annexB != null && opts.annexB !== false) {\n throw new Error(\"The `annexB` option can only be set to `false`.\");\n }\n\n for (const key of Object.keys(options) as (keyof Options)[]) {\n if (opts[key] != null) options[key] = opts[key];\n }\n\n if (options.startLine === 1) {\n if (opts.startIndex == null && options.startColumn > 0) {\n options.startIndex = options.startColumn;\n } else if (opts.startColumn == null && options.startIndex > 0) {\n options.startColumn = options.startIndex;\n }\n } else if (opts.startColumn == null || opts.startIndex == null) {\n if (opts.startIndex != null || process.env.BABEL_8_BREAKING) {\n throw new Error(\n \"With a `startLine > 1` you must also specify `startIndex` and `startColumn`.\",\n );\n }\n }\n\n return options;\n}\n","import type { TokenType } from \"../tokenizer/types.ts\";\nimport type Parser from \"../parser/index.ts\";\nimport type { ExpressionErrors } from \"../parser/util.ts\";\nimport type * as N from \"../types.ts\";\nimport type { Node as NodeType, NodeBase, File } from \"../types.ts\";\nimport type { Position } from \"../util/location.ts\";\nimport { Errors } from \"../parse-error.ts\";\nimport type { Undone } from \"../parser/node.ts\";\nimport type { BindingFlag } from \"../util/scopeflags.ts\";\nimport { OptionFlags } from \"../options.ts\";\n\nconst { defineProperty } = Object;\nconst toUnenumerable = (object: any, key: string) => {\n if (object) {\n defineProperty(object, key, { enumerable: false, value: object[key] });\n }\n};\n\nfunction toESTreeLocation(node: any) {\n toUnenumerable(node.loc.start, \"index\");\n toUnenumerable(node.loc.end, \"index\");\n\n return node;\n}\n\nexport default (superClass: typeof Parser) =>\n class ESTreeParserMixin extends superClass implements Parser {\n parse(): File {\n const file = toESTreeLocation(super.parse());\n\n if (this.optionFlags & OptionFlags.Tokens) {\n file.tokens = file.tokens.map(toESTreeLocation);\n }\n\n return file;\n }\n\n // @ts-expect-error ESTree plugin changes node types\n parseRegExpLiteral({ pattern, flags }): N.EstreeRegExpLiteral {\n let regex: RegExp | null = null;\n try {\n regex = new RegExp(pattern, flags);\n } catch (_) {\n // In environments that don't support these flags value will\n // be null as the regex can't be represented natively.\n }\n const node = this.estreeParseLiteral(regex);\n node.regex = { pattern, flags };\n\n return node;\n }\n\n // @ts-expect-error ESTree plugin changes node types\n parseBigIntLiteral(value: any): N.Node {\n // https://github.com/estree/estree/blob/master/es2020.md#bigintliteral\n let bigInt: bigint | null;\n try {\n bigInt = BigInt(value);\n } catch {\n bigInt = null;\n }\n const node = this.estreeParseLiteral(bigInt);\n node.bigint = String(node.value || value);\n\n return node;\n }\n\n // @ts-expect-error ESTree plugin changes node types\n parseDecimalLiteral(value: any): N.Node {\n // https://github.com/estree/estree/blob/master/experimental/decimal.md\n // todo: use BigDecimal when node supports it.\n const decimal: null = null;\n const node = this.estreeParseLiteral(decimal);\n node.decimal = String(node.value || value);\n\n return node;\n }\n\n estreeParseLiteral(value: any) {\n // @ts-expect-error ESTree plugin changes node types\n return this.parseLiteral(value, \"Literal\");\n }\n\n // @ts-expect-error ESTree plugin changes node types\n parseStringLiteral(value: any): N.Node {\n return this.estreeParseLiteral(value);\n }\n\n parseNumericLiteral(value: any): any {\n return this.estreeParseLiteral(value);\n }\n\n // @ts-expect-error ESTree plugin changes node types\n parseNullLiteral(): N.Node {\n return this.estreeParseLiteral(null);\n }\n\n parseBooleanLiteral(value: boolean): N.BooleanLiteral {\n // @ts-expect-error ESTree plugin changes node types\n return this.estreeParseLiteral(value);\n }\n\n // Cast a Directive to an ExpressionStatement. Mutates the input Directive.\n directiveToStmt(directive: N.Directive): N.ExpressionStatement {\n const expression = directive.value as any as N.EstreeLiteral;\n delete directive.value;\n\n expression.type = \"Literal\";\n // @ts-expect-error N.EstreeLiteral.raw is not defined.\n expression.raw = expression.extra.raw;\n expression.value = expression.extra.expressionValue;\n\n const stmt = directive as any as N.ExpressionStatement;\n stmt.type = \"ExpressionStatement\";\n stmt.expression = expression;\n // @ts-expect-error N.ExpressionStatement.directive is not defined\n stmt.directive = expression.extra.rawValue;\n\n delete expression.extra;\n\n return stmt;\n }\n\n // ==================================\n // Overrides\n // ==================================\n\n initFunction(node: N.BodilessFunctionOrMethodBase, isAsync: boolean): void {\n super.initFunction(node, isAsync);\n node.expression = false;\n }\n\n checkDeclaration(node: N.Pattern | N.ObjectProperty): void {\n if (node != null && this.isObjectProperty(node)) {\n // @ts-expect-error plugin typings\n this.checkDeclaration((node as unknown as N.EstreeProperty).value);\n } else {\n super.checkDeclaration(node);\n }\n }\n\n getObjectOrClassMethodParams(method: N.ObjectMethod | N.ClassMethod) {\n return (method as unknown as N.EstreeMethodDefinition).value.params;\n }\n\n isValidDirective(stmt: N.Statement): boolean {\n return (\n stmt.type === \"ExpressionStatement\" &&\n stmt.expression.type === \"Literal\" &&\n typeof stmt.expression.value === \"string\" &&\n !stmt.expression.extra?.parenthesized\n );\n }\n\n parseBlockBody(\n node: N.BlockStatementLike,\n allowDirectives: boolean | undefined | null,\n topLevel: boolean,\n end: TokenType,\n afterBlockParse?: (hasStrictModeDirective: boolean) => void,\n ): void {\n super.parseBlockBody(\n node,\n allowDirectives,\n topLevel,\n end,\n afterBlockParse,\n );\n\n const directiveStatements = node.directives.map(d =>\n this.directiveToStmt(d),\n );\n // @ts-expect-error estree plugin typings\n node.body = directiveStatements.concat(node.body);\n delete node.directives;\n }\n\n parsePrivateName(): any {\n const node = super.parsePrivateName();\n if (!process.env.BABEL_8_BREAKING) {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return node;\n }\n }\n return this.convertPrivateNameToPrivateIdentifier(node);\n }\n\n convertPrivateNameToPrivateIdentifier(\n node: N.PrivateName,\n ): N.EstreePrivateIdentifier {\n const name = super.getPrivateNameSV(node);\n node = node as any;\n delete node.id;\n // @ts-expect-error mutate AST types\n node.name = name;\n // @ts-expect-error mutate AST types\n node.type = \"PrivateIdentifier\";\n return node as unknown as N.EstreePrivateIdentifier;\n }\n\n // @ts-expect-error ESTree plugin changes node types\n isPrivateName(node: N.Node): node is N.EstreePrivateIdentifier {\n if (!process.env.BABEL_8_BREAKING) {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return super.isPrivateName(node);\n }\n }\n return node.type === \"PrivateIdentifier\";\n }\n\n // @ts-expect-error ESTree plugin changes node types\n getPrivateNameSV(node: N.EstreePrivateIdentifier): string {\n if (!process.env.BABEL_8_BREAKING) {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return super.getPrivateNameSV(node as unknown as N.PrivateName);\n }\n }\n return node.name;\n }\n\n // @ts-expect-error plugin may override interfaces\n parseLiteral(value: any, type: T[\"type\"]): T {\n const node = super.parseLiteral(value, type);\n // @ts-expect-error mutating AST types\n node.raw = node.extra.raw;\n delete node.extra;\n\n return node;\n }\n\n parseFunctionBody(\n node: N.Function,\n allowExpression?: boolean | null,\n isMethod: boolean = false,\n ): void {\n super.parseFunctionBody(node, allowExpression, isMethod);\n node.expression = node.body.type !== \"BlockStatement\";\n }\n\n // @ts-expect-error plugin may override interfaces\n parseMethod<\n T extends N.ClassPrivateMethod | N.ObjectMethod | N.ClassMethod,\n >(\n node: Undone,\n isGenerator: boolean,\n isAsync: boolean,\n isConstructor: boolean,\n allowDirectSuper: boolean,\n type: T[\"type\"],\n inClassScope: boolean = false,\n ): N.EstreeMethodDefinition | N.EstreeTSAbstractMethodDefinition {\n let funcNode = this.startNode();\n funcNode.kind = node.kind; // provide kind, so super method correctly sets state\n funcNode = super.parseMethod(\n // @ts-expect-error todo(flow->ts)\n funcNode,\n isGenerator,\n isAsync,\n isConstructor,\n allowDirectSuper,\n type,\n inClassScope,\n );\n // @ts-expect-error mutate AST types\n funcNode.type = \"FunctionExpression\";\n delete funcNode.kind;\n // @ts-expect-error mutate AST types\n node.value = funcNode;\n const { typeParameters } = node;\n if (typeParameters) {\n delete node.typeParameters;\n funcNode.typeParameters = typeParameters;\n this.resetStartLocationFromNode(funcNode, typeParameters);\n }\n if (type === \"ClassPrivateMethod\") {\n node.computed = false;\n }\n if (process.env.BABEL_8_BREAKING && this.hasPlugin(\"typescript\")) {\n if (!funcNode.body) {\n (funcNode as unknown as N.EstreeTSEmptyBodyFunctionExpression).type =\n \"TSEmptyBodyFunctionExpression\";\n }\n // @ts-expect-error todo(flow->ts) property not defined for all types in union\n if (node.abstract) {\n return this.finishNode(\n // @ts-expect-error cast methods to estree types\n node as Undone,\n \"TSAbstractMethodDefinition\",\n );\n }\n }\n return this.finishNode(\n // @ts-expect-error cast methods to estree types\n node as Undone,\n \"MethodDefinition\",\n );\n }\n\n nameIsConstructor(key: N.Expression | N.PrivateName): boolean {\n if (key.type === \"Literal\") return key.value === \"constructor\";\n return super.nameIsConstructor(key);\n }\n\n parseClassProperty(...args: [N.ClassProperty]): any {\n const propertyNode = super.parseClassProperty(...args);\n if (!process.env.BABEL_8_BREAKING) {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return propertyNode as unknown as N.EstreePropertyDefinition;\n }\n }\n if (\n process.env.BABEL_8_BREAKING &&\n propertyNode.abstract &&\n this.hasPlugin(\"typescript\")\n ) {\n (propertyNode as unknown as N.EstreeTSAbstractPropertyDefinition).type =\n \"TSAbstractPropertyDefinition\";\n } else {\n (propertyNode as unknown as N.EstreePropertyDefinition).type =\n \"PropertyDefinition\";\n }\n return propertyNode;\n }\n\n parseClassPrivateProperty(...args: [N.ClassPrivateProperty]): any {\n const propertyNode = super.parseClassPrivateProperty(...args);\n if (!process.env.BABEL_8_BREAKING) {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return propertyNode as unknown as N.EstreePropertyDefinition;\n }\n }\n if (\n process.env.BABEL_8_BREAKING &&\n propertyNode.abstract &&\n this.hasPlugin(\"typescript\")\n ) {\n (propertyNode as unknown as N.EstreeTSAbstractPropertyDefinition).type =\n \"TSAbstractPropertyDefinition\";\n } else {\n (propertyNode as unknown as N.EstreePropertyDefinition).type =\n \"PropertyDefinition\";\n }\n propertyNode.computed = false;\n return propertyNode;\n }\n\n parseClassAccessorProperty(\n this: Parser,\n node: N.ClassAccessorProperty,\n ): any {\n const accessorPropertyNode = super.parseClassAccessorProperty(node);\n if (!process.env.BABEL_8_BREAKING) {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return accessorPropertyNode;\n }\n }\n (accessorPropertyNode as unknown as N.EstreeAccessorProperty).type =\n \"AccessorProperty\";\n return accessorPropertyNode;\n }\n\n parseObjectMethod(\n prop: N.ObjectMethod,\n isGenerator: boolean,\n isAsync: boolean,\n isPattern: boolean,\n isAccessor: boolean,\n ): N.ObjectMethod | undefined | null {\n const node: N.EstreeProperty = super.parseObjectMethod(\n prop,\n isGenerator,\n isAsync,\n isPattern,\n isAccessor,\n ) as any;\n\n if (node) {\n node.type = \"Property\";\n if ((node as any as N.ClassMethod).kind === \"method\") {\n node.kind = \"init\";\n }\n node.shorthand = false;\n }\n\n return node as any;\n }\n\n parseObjectProperty(\n prop: N.ObjectProperty,\n startLoc: Position | undefined | null,\n isPattern: boolean,\n refExpressionErrors?: ExpressionErrors | null,\n ): N.ObjectProperty | undefined | null {\n const node: N.EstreeProperty = super.parseObjectProperty(\n prop,\n startLoc,\n isPattern,\n refExpressionErrors,\n ) as any;\n\n if (node) {\n node.kind = \"init\";\n node.type = \"Property\";\n }\n\n return node as any;\n }\n\n isValidLVal(\n type: string,\n isUnparenthesizedInAssign: boolean,\n binding: BindingFlag,\n ) {\n return type === \"Property\"\n ? \"value\"\n : super.isValidLVal(type, isUnparenthesizedInAssign, binding);\n }\n\n isAssignable(node: N.Node, isBinding?: boolean): boolean {\n if (node != null && this.isObjectProperty(node)) {\n return this.isAssignable(node.value, isBinding);\n }\n return super.isAssignable(node, isBinding);\n }\n\n toAssignable(node: N.Node, isLHS: boolean = false): void {\n if (node != null && this.isObjectProperty(node)) {\n const { key, value } = node;\n if (this.isPrivateName(key)) {\n this.classScope.usePrivateName(\n this.getPrivateNameSV(key),\n key.loc.start,\n );\n }\n this.toAssignable(value, isLHS);\n } else {\n super.toAssignable(node, isLHS);\n }\n }\n\n toAssignableObjectExpressionProp(\n prop: N.Node,\n isLast: boolean,\n isLHS: boolean,\n ) {\n if (\n prop.type === \"Property\" &&\n (prop.kind === \"get\" || prop.kind === \"set\")\n ) {\n this.raise(Errors.PatternHasAccessor, prop.key);\n } else if (prop.type === \"Property\" && prop.method) {\n this.raise(Errors.PatternHasMethod, prop.key);\n } else {\n super.toAssignableObjectExpressionProp(prop, isLast, isLHS);\n }\n }\n\n finishCallExpression(\n unfinished: Undone,\n optional: boolean,\n ): T {\n const node = super.finishCallExpression(unfinished, optional);\n\n if (node.callee.type === \"Import\") {\n (node as N.Node as N.EstreeImportExpression).type = \"ImportExpression\";\n (node as N.Node as N.EstreeImportExpression).source = node\n .arguments[0] as N.Expression;\n (node as N.Node as N.EstreeImportExpression).options =\n (node.arguments[1] as N.Expression) ?? null;\n // compatibility with previous ESTree AST\n // TODO(Babel 8): Remove this\n (node as N.Node as N.EstreeImportExpression).attributes =\n (node.arguments[1] as N.Expression) ?? null;\n // arguments isn't optional in the type definition\n delete node.arguments;\n // callee isn't optional in the type definition\n delete node.callee;\n }\n\n return node;\n }\n\n toReferencedArguments(\n node:\n | N.CallExpression\n | N.OptionalCallExpression\n | N.EstreeImportExpression,\n /* isParenthesizedExpr?: boolean, */\n ) {\n // ImportExpressions do not have an arguments array.\n if (node.type === \"ImportExpression\") {\n return;\n }\n\n super.toReferencedArguments(node);\n }\n\n parseExport(\n unfinished: Undone,\n decorators: N.Decorator[] | null,\n ) {\n const exportStartLoc = this.state.lastTokStartLoc;\n const node = super.parseExport(unfinished, decorators);\n\n switch (node.type) {\n case \"ExportAllDeclaration\":\n // @ts-expect-error mutating AST types\n node.exported = null;\n break;\n\n case \"ExportNamedDeclaration\":\n if (\n node.specifiers.length === 1 &&\n node.specifiers[0].type === \"ExportNamespaceSpecifier\"\n ) {\n // @ts-expect-error mutating AST types\n node.type = \"ExportAllDeclaration\";\n // @ts-expect-error mutating AST types\n node.exported = node.specifiers[0].exported;\n delete node.specifiers;\n }\n\n // fallthrough\n case \"ExportDefaultDeclaration\":\n {\n const { declaration } = node;\n if (\n declaration?.type === \"ClassDeclaration\" &&\n declaration.decorators?.length > 0 &&\n // decorator comes before export\n declaration.start === node.start\n ) {\n this.resetStartLocation(\n node,\n // For compatibility with ESLint's keyword-spacing rule, which assumes that an\n // export declaration must start with export.\n // https://github.com/babel/babel/issues/15085\n // Here we reset export declaration's start to be the start of the export token\n exportStartLoc,\n );\n }\n }\n\n break;\n }\n\n return node;\n }\n\n parseSubscript(\n base: N.Expression,\n startLoc: Position,\n noCalls: boolean | undefined | null,\n state: N.ParseSubscriptState,\n ): N.Expression {\n const node = super.parseSubscript(base, startLoc, noCalls, state);\n\n if (state.optionalChainMember) {\n // https://github.com/estree/estree/blob/master/es2020.md#chainexpression\n if (\n node.type === \"OptionalMemberExpression\" ||\n node.type === \"OptionalCallExpression\"\n ) {\n // strip Optional prefix\n (node as unknown as N.CallExpression | N.MemberExpression).type =\n node.type.substring(8) as \"CallExpression\" | \"MemberExpression\";\n }\n if (state.stop) {\n const chain = this.startNodeAtNode(node);\n chain.expression = node;\n return this.finishNode(chain, \"ChainExpression\");\n }\n } else if (\n node.type === \"MemberExpression\" ||\n node.type === \"CallExpression\"\n ) {\n // @ts-expect-error not in the type definitions\n node.optional = false;\n }\n\n return node;\n }\n\n isOptionalMemberExpression(node: N.Node) {\n if (node.type === \"ChainExpression\") {\n return node.expression.type === \"MemberExpression\";\n }\n return super.isOptionalMemberExpression(node);\n }\n\n hasPropertyAsPrivateName(node: N.Node): boolean {\n if (node.type === \"ChainExpression\") {\n node = node.expression;\n }\n return super.hasPropertyAsPrivateName(node);\n }\n\n // @ts-expect-error ESTree plugin changes node types\n isObjectProperty(node: N.Node): node is N.EstreeProperty {\n return node.type === \"Property\" && node.kind === \"init\" && !node.method;\n }\n\n // @ts-expect-error ESTree plugin changes node types\n isObjectMethod(node: N.Node): node is N.EstreeProperty {\n return (\n node.type === \"Property\" &&\n (node.method || node.kind === \"get\" || node.kind === \"set\")\n );\n }\n\n finishNodeAt(\n node: Undone,\n type: T[\"type\"],\n endLoc: Position,\n ): T {\n return toESTreeLocation(super.finishNodeAt(node, type, endLoc));\n }\n\n resetStartLocation(node: N.Node, startLoc: Position) {\n super.resetStartLocation(node, startLoc);\n toESTreeLocation(node);\n }\n\n resetEndLocation(\n node: NodeBase,\n endLoc: Position = this.state.lastTokEndLoc,\n ): void {\n super.resetEndLocation(node, endLoc);\n toESTreeLocation(node);\n }\n };\n","// The token context is used in JSX plugin to track\n// jsx tag / jsx text / normal JavaScript expression\n\nexport class TokContext {\n constructor(token: string, preserveSpace?: boolean) {\n this.token = token;\n this.preserveSpace = !!preserveSpace;\n }\n\n token: string;\n preserveSpace: boolean;\n}\n\nconst types: {\n [key: string]: TokContext;\n} = {\n brace: new TokContext(\"{\"), // normal JavaScript expression\n j_oTag: new TokContext(\"...\", true), // JSX expressions\n};\n\nif (!process.env.BABEL_8_BREAKING) {\n types.template = new TokContext(\"`\", true);\n}\n\nexport { types };\n","import { types as tc, type TokContext } from \"./context.ts\";\n// ## Token types\n\n// The assignment of fine-grained, information-carrying type objects\n// allows the tokenizer to store the information it has about a\n// token in a way that is very cheap for the parser to look up.\n\n// All token type variables start with an underscore, to make them\n// easy to recognize.\n\n// The `beforeExpr` property is used to disambiguate between 1) binary\n// expression (<) and JSX Tag start (); 2) object literal and JSX\n// texts. It is set on the `updateContext` function in the JSX plugin.\n\n// The `startsExpr` property is used to determine whether an expression\n// may be the “argument” subexpression of a `yield` expression or\n// `yield` statement. It is set on all token types that may be at the\n// start of a subexpression.\n\n// `isLoop` marks a keyword as starting a loop, which is important\n// to know when parsing a label, in order to allow or disallow\n// continue jumps to that label.\n\nconst beforeExpr = true;\nconst startsExpr = true;\nconst isLoop = true;\nconst isAssign = true;\nconst prefix = true;\nconst postfix = true;\n\ntype TokenOptions = {\n keyword?: string;\n beforeExpr?: boolean;\n startsExpr?: boolean;\n rightAssociative?: boolean;\n isLoop?: boolean;\n isAssign?: boolean;\n prefix?: boolean;\n postfix?: boolean;\n binop?: number | null;\n};\n\n// Internally the tokenizer stores token as a number\nexport type TokenType = number;\n\n// The `ExportedTokenType` is exported via `tokTypes` and accessible\n// when `tokens: true` is enabled. Unlike internal token type, it provides\n// metadata of the tokens.\nexport class ExportedTokenType {\n label: string;\n keyword: string | undefined | null;\n beforeExpr: boolean;\n startsExpr: boolean;\n rightAssociative: boolean;\n isLoop: boolean;\n isAssign: boolean;\n prefix: boolean;\n postfix: boolean;\n binop: number | undefined | null;\n // todo(Babel 8): remove updateContext from exposed token layout\n declare updateContext:\n | ((context: Array) => void)\n | undefined\n | null;\n\n constructor(label: string, conf: TokenOptions = {}) {\n this.label = label;\n this.keyword = conf.keyword;\n this.beforeExpr = !!conf.beforeExpr;\n this.startsExpr = !!conf.startsExpr;\n this.rightAssociative = !!conf.rightAssociative;\n this.isLoop = !!conf.isLoop;\n this.isAssign = !!conf.isAssign;\n this.prefix = !!conf.prefix;\n this.postfix = !!conf.postfix;\n this.binop = conf.binop != null ? conf.binop : null;\n if (!process.env.BABEL_8_BREAKING) {\n this.updateContext = null;\n }\n }\n}\n\n// A map from keyword/keyword-like string value to the token type\nexport const keywords = new Map();\n\nfunction createKeyword(name: string, options: TokenOptions = {}): TokenType {\n options.keyword = name;\n const token = createToken(name, options);\n keywords.set(name, token);\n return token;\n}\n\nfunction createBinop(name: string, binop: number) {\n return createToken(name, { beforeExpr, binop });\n}\n\nlet tokenTypeCounter = -1;\nexport const tokenTypes: ExportedTokenType[] = [];\nconst tokenLabels: string[] = [];\nconst tokenBinops: number[] = [];\nconst tokenBeforeExprs: boolean[] = [];\nconst tokenStartsExprs: boolean[] = [];\nconst tokenPrefixes: boolean[] = [];\n\nfunction createToken(name: string, options: TokenOptions = {}): TokenType {\n ++tokenTypeCounter;\n tokenLabels.push(name);\n tokenBinops.push(options.binop ?? -1);\n tokenBeforeExprs.push(options.beforeExpr ?? false);\n tokenStartsExprs.push(options.startsExpr ?? false);\n tokenPrefixes.push(options.prefix ?? false);\n tokenTypes.push(new ExportedTokenType(name, options));\n\n return tokenTypeCounter;\n}\n\nfunction createKeywordLike(\n name: string,\n options: TokenOptions = {},\n): TokenType {\n ++tokenTypeCounter;\n keywords.set(name, tokenTypeCounter);\n tokenLabels.push(name);\n tokenBinops.push(options.binop ?? -1);\n tokenBeforeExprs.push(options.beforeExpr ?? false);\n tokenStartsExprs.push(options.startsExpr ?? false);\n tokenPrefixes.push(options.prefix ?? false);\n // In the exported token type, we set the label as \"name\" for backward compatibility with Babel 7\n tokenTypes.push(new ExportedTokenType(\"name\", options));\n\n return tokenTypeCounter;\n}\n\n// For performance the token type helpers depend on the following declarations order.\n// When adding new token types, please also check if the token helpers need update.\n\nexport type InternalTokenTypes = typeof tt;\n\nexport const tt = {\n // Punctuation token types.\n bracketL: createToken(\"[\", { beforeExpr, startsExpr }),\n bracketHashL: createToken(\"#[\", { beforeExpr, startsExpr }),\n bracketBarL: createToken(\"[|\", { beforeExpr, startsExpr }),\n bracketR: createToken(\"]\"),\n bracketBarR: createToken(\"|]\"),\n braceL: createToken(\"{\", { beforeExpr, startsExpr }),\n braceBarL: createToken(\"{|\", { beforeExpr, startsExpr }),\n braceHashL: createToken(\"#{\", { beforeExpr, startsExpr }),\n braceR: createToken(\"}\"),\n braceBarR: createToken(\"|}\"),\n parenL: createToken(\"(\", { beforeExpr, startsExpr }),\n parenR: createToken(\")\"),\n comma: createToken(\",\", { beforeExpr }),\n semi: createToken(\";\", { beforeExpr }),\n colon: createToken(\":\", { beforeExpr }),\n doubleColon: createToken(\"::\", { beforeExpr }),\n dot: createToken(\".\"),\n question: createToken(\"?\", { beforeExpr }),\n questionDot: createToken(\"?.\"),\n arrow: createToken(\"=>\", { beforeExpr }),\n template: createToken(\"template\"),\n ellipsis: createToken(\"...\", { beforeExpr }),\n backQuote: createToken(\"`\", { startsExpr }),\n dollarBraceL: createToken(\"${\", { beforeExpr, startsExpr }),\n // start: isTemplate\n templateTail: createToken(\"...`\", { startsExpr }),\n templateNonTail: createToken(\"...${\", { beforeExpr, startsExpr }),\n // end: isTemplate\n at: createToken(\"@\"),\n hash: createToken(\"#\", { startsExpr }),\n\n // Special hashbang token.\n interpreterDirective: createToken(\"#!...\"),\n\n // Operators. These carry several kinds of properties to help the\n // parser use them properly (the presence of these properties is\n // what categorizes them as operators).\n //\n // `binop`, when present, specifies that this operator is a binary\n // operator, and will refer to its precedence.\n //\n // `prefix` and `postfix` mark the operator as a prefix or postfix\n // unary operator.\n //\n // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as\n // binary operators with a very low precedence, that should result\n // in AssignmentExpression nodes.\n\n // start: isAssign\n eq: createToken(\"=\", { beforeExpr, isAssign }),\n assign: createToken(\"_=\", { beforeExpr, isAssign }),\n slashAssign: createToken(\"_=\", { beforeExpr, isAssign }),\n // These are only needed to support % and ^ as a Hack-pipe topic token.\n // When the proposal settles on a token, the others can be merged with\n // tt.assign.\n xorAssign: createToken(\"_=\", { beforeExpr, isAssign }),\n moduloAssign: createToken(\"_=\", { beforeExpr, isAssign }),\n // end: isAssign\n\n incDec: createToken(\"++/--\", { prefix, postfix, startsExpr }),\n bang: createToken(\"!\", { beforeExpr, prefix, startsExpr }),\n tilde: createToken(\"~\", { beforeExpr, prefix, startsExpr }),\n\n // More possible topic tokens.\n // When the proposal settles on a token, at least one of these may be removed.\n doubleCaret: createToken(\"^^\", { startsExpr }),\n doubleAt: createToken(\"@@\", { startsExpr }),\n\n // start: isBinop\n pipeline: createBinop(\"|>\", 0),\n nullishCoalescing: createBinop(\"??\", 1),\n logicalOR: createBinop(\"||\", 1),\n logicalAND: createBinop(\"&&\", 2),\n bitwiseOR: createBinop(\"|\", 3),\n bitwiseXOR: createBinop(\"^\", 4),\n bitwiseAND: createBinop(\"&\", 5),\n equality: createBinop(\"==/!=/===/!==\", 6),\n lt: createBinop(\"/<=/>=\", 7),\n gt: createBinop(\"/<=/>=\", 7),\n relational: createBinop(\"/<=/>=\", 7),\n bitShift: createBinop(\"<>/>>>\", 8),\n bitShiftL: createBinop(\"<>/>>>\", 8),\n bitShiftR: createBinop(\"<>/>>>\", 8),\n plusMin: createToken(\"+/-\", { beforeExpr, binop: 9, prefix, startsExpr }),\n // startsExpr: required by v8intrinsic plugin\n modulo: createToken(\"%\", { binop: 10, startsExpr }),\n // unset `beforeExpr` as it can be `function *`\n star: createToken(\"*\", { binop: 10 }),\n slash: createBinop(\"/\", 10),\n exponent: createToken(\"**\", {\n beforeExpr,\n binop: 11,\n rightAssociative: true,\n }),\n\n // Keywords\n // Don't forget to update packages/babel-helper-validator-identifier/src/keyword.js\n // when new keywords are added\n // start: isLiteralPropertyName\n // start: isKeyword\n _in: createKeyword(\"in\", { beforeExpr, binop: 7 }),\n _instanceof: createKeyword(\"instanceof\", { beforeExpr, binop: 7 }),\n // end: isBinop\n _break: createKeyword(\"break\"),\n _case: createKeyword(\"case\", { beforeExpr }),\n _catch: createKeyword(\"catch\"),\n _continue: createKeyword(\"continue\"),\n _debugger: createKeyword(\"debugger\"),\n _default: createKeyword(\"default\", { beforeExpr }),\n _else: createKeyword(\"else\", { beforeExpr }),\n _finally: createKeyword(\"finally\"),\n _function: createKeyword(\"function\", { startsExpr }),\n _if: createKeyword(\"if\"),\n _return: createKeyword(\"return\", { beforeExpr }),\n _switch: createKeyword(\"switch\"),\n _throw: createKeyword(\"throw\", { beforeExpr, prefix, startsExpr }),\n _try: createKeyword(\"try\"),\n _var: createKeyword(\"var\"),\n _const: createKeyword(\"const\"),\n _with: createKeyword(\"with\"),\n _new: createKeyword(\"new\", { beforeExpr, startsExpr }),\n _this: createKeyword(\"this\", { startsExpr }),\n _super: createKeyword(\"super\", { startsExpr }),\n _class: createKeyword(\"class\", { startsExpr }),\n _extends: createKeyword(\"extends\", { beforeExpr }),\n _export: createKeyword(\"export\"),\n _import: createKeyword(\"import\", { startsExpr }),\n _null: createKeyword(\"null\", { startsExpr }),\n _true: createKeyword(\"true\", { startsExpr }),\n _false: createKeyword(\"false\", { startsExpr }),\n _typeof: createKeyword(\"typeof\", { beforeExpr, prefix, startsExpr }),\n _void: createKeyword(\"void\", { beforeExpr, prefix, startsExpr }),\n _delete: createKeyword(\"delete\", { beforeExpr, prefix, startsExpr }),\n // start: isLoop\n _do: createKeyword(\"do\", { isLoop, beforeExpr }),\n _for: createKeyword(\"for\", { isLoop }),\n _while: createKeyword(\"while\", { isLoop }),\n // end: isLoop\n // end: isKeyword\n\n // Primary literals\n // start: isIdentifier\n _as: createKeywordLike(\"as\", { startsExpr }),\n _assert: createKeywordLike(\"assert\", { startsExpr }),\n _async: createKeywordLike(\"async\", { startsExpr }),\n _await: createKeywordLike(\"await\", { startsExpr }),\n _defer: createKeywordLike(\"defer\", { startsExpr }),\n _from: createKeywordLike(\"from\", { startsExpr }),\n _get: createKeywordLike(\"get\", { startsExpr }),\n _let: createKeywordLike(\"let\", { startsExpr }),\n _meta: createKeywordLike(\"meta\", { startsExpr }),\n _of: createKeywordLike(\"of\", { startsExpr }),\n _sent: createKeywordLike(\"sent\", { startsExpr }),\n _set: createKeywordLike(\"set\", { startsExpr }),\n _source: createKeywordLike(\"source\", { startsExpr }),\n _static: createKeywordLike(\"static\", { startsExpr }),\n _using: createKeywordLike(\"using\", { startsExpr }),\n _yield: createKeywordLike(\"yield\", { startsExpr }),\n\n // Flow and TypeScript Keywordlike\n _asserts: createKeywordLike(\"asserts\", { startsExpr }),\n _checks: createKeywordLike(\"checks\", { startsExpr }),\n _exports: createKeywordLike(\"exports\", { startsExpr }),\n _global: createKeywordLike(\"global\", { startsExpr }),\n _implements: createKeywordLike(\"implements\", { startsExpr }),\n _intrinsic: createKeywordLike(\"intrinsic\", { startsExpr }),\n _infer: createKeywordLike(\"infer\", { startsExpr }),\n _is: createKeywordLike(\"is\", { startsExpr }),\n _mixins: createKeywordLike(\"mixins\", { startsExpr }),\n _proto: createKeywordLike(\"proto\", { startsExpr }),\n _require: createKeywordLike(\"require\", { startsExpr }),\n _satisfies: createKeywordLike(\"satisfies\", { startsExpr }),\n // start: isTSTypeOperator\n _keyof: createKeywordLike(\"keyof\", { startsExpr }),\n _readonly: createKeywordLike(\"readonly\", { startsExpr }),\n _unique: createKeywordLike(\"unique\", { startsExpr }),\n // end: isTSTypeOperator\n // start: isTSDeclarationStart\n _abstract: createKeywordLike(\"abstract\", { startsExpr }),\n _declare: createKeywordLike(\"declare\", { startsExpr }),\n _enum: createKeywordLike(\"enum\", { startsExpr }),\n _module: createKeywordLike(\"module\", { startsExpr }),\n _namespace: createKeywordLike(\"namespace\", { startsExpr }),\n // start: isFlowInterfaceOrTypeOrOpaque\n _interface: createKeywordLike(\"interface\", { startsExpr }),\n _type: createKeywordLike(\"type\", { startsExpr }),\n // end: isTSDeclarationStart\n _opaque: createKeywordLike(\"opaque\", { startsExpr }),\n // end: isFlowInterfaceOrTypeOrOpaque\n name: createToken(\"name\", { startsExpr }),\n\n // placeholder plugin\n placeholder: createToken(\"%%\", { startsExpr: true }),\n // end: isIdentifier\n\n string: createToken(\"string\", { startsExpr }),\n num: createToken(\"num\", { startsExpr }),\n bigint: createToken(\"bigint\", { startsExpr }),\n // TODO: Remove this in Babel 8\n decimal: createToken(\"decimal\", { startsExpr }),\n // end: isLiteralPropertyName\n regexp: createToken(\"regexp\", { startsExpr }),\n privateName: createToken(\"#name\", { startsExpr }),\n eof: createToken(\"eof\"),\n\n // jsx plugin\n jsxName: createToken(\"jsxName\"),\n jsxText: createToken(\"jsxText\", { beforeExpr: true }),\n jsxTagStart: createToken(\"jsxTagStart\", { startsExpr: true }),\n jsxTagEnd: createToken(\"jsxTagEnd\"),\n} as const;\n\nexport function tokenIsIdentifier(token: TokenType): boolean {\n return token >= tt._as && token <= tt.placeholder;\n}\n\nexport function tokenKeywordOrIdentifierIsKeyword(token: TokenType): boolean {\n // we can remove the token >= tt._in check when we\n // know a token is either keyword or identifier\n return token <= tt._while;\n}\n\nexport function tokenIsKeywordOrIdentifier(token: TokenType): boolean {\n return token >= tt._in && token <= tt.placeholder;\n}\n\nexport function tokenIsLiteralPropertyName(token: TokenType): boolean {\n return token >= tt._in && token <= tt.decimal;\n}\n\nexport function tokenComesBeforeExpression(token: TokenType): boolean {\n return tokenBeforeExprs[token];\n}\n\nexport function tokenCanStartExpression(token: TokenType): boolean {\n return tokenStartsExprs[token];\n}\n\nexport function tokenIsAssignment(token: TokenType): boolean {\n return token >= tt.eq && token <= tt.moduloAssign;\n}\n\nexport function tokenIsFlowInterfaceOrTypeOrOpaque(token: TokenType): boolean {\n return token >= tt._interface && token <= tt._opaque;\n}\n\nexport function tokenIsLoop(token: TokenType): boolean {\n return token >= tt._do && token <= tt._while;\n}\n\nexport function tokenIsKeyword(token: TokenType): boolean {\n return token >= tt._in && token <= tt._while;\n}\n\nexport function tokenIsOperator(token: TokenType): boolean {\n return token >= tt.pipeline && token <= tt._instanceof;\n}\n\nexport function tokenIsPostfix(token: TokenType): boolean {\n return token === tt.incDec;\n}\n\nexport function tokenIsPrefix(token: TokenType): boolean {\n return tokenPrefixes[token];\n}\n\nexport function tokenIsTSTypeOperator(token: TokenType): boolean {\n return token >= tt._keyof && token <= tt._unique;\n}\n\nexport function tokenIsTSDeclarationStart(token: TokenType): boolean {\n return token >= tt._abstract && token <= tt._type;\n}\n\nexport function tokenLabelName(token: TokenType): string {\n return tokenLabels[token];\n}\n\nexport function tokenOperatorPrecedence(token: TokenType): number {\n return tokenBinops[token];\n}\n\nexport function tokenIsBinaryOperator(token: TokenType): boolean {\n return tokenBinops[token] !== -1;\n}\n\nexport function tokenIsRightAssociative(token: TokenType): boolean {\n return token === tt.exponent;\n}\n\nexport function tokenIsTemplate(token: TokenType): boolean {\n return token >= tt.templateTail && token <= tt.templateNonTail;\n}\n\nexport function getExportedToken(token: TokenType): ExportedTokenType {\n return tokenTypes[token];\n}\n\nexport function isTokenType(obj: any): boolean {\n return typeof obj === \"number\";\n}\n\nif (!process.env.BABEL_8_BREAKING) {\n tokenTypes[tt.braceR].updateContext = context => {\n context.pop();\n };\n\n tokenTypes[tt.braceL].updateContext =\n tokenTypes[tt.braceHashL].updateContext =\n tokenTypes[tt.dollarBraceL].updateContext =\n context => {\n context.push(tc.brace);\n };\n\n tokenTypes[tt.backQuote].updateContext = context => {\n if (context[context.length - 1] === tc.template) {\n context.pop();\n } else {\n context.push(tc.template);\n }\n };\n\n tokenTypes[tt.jsxTagStart].updateContext = context => {\n context.push(tc.j_expr, tc.j_oTag);\n };\n}\n","// We inline this package\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport * as charCodes from \"charcodes\";\n\n// ## Character categories\n\n// Big ugly regular expressions that match characters in the\n// whitespace, identifier, and identifier-start categories. These\n// are only applied when a character is found to actually have a\n// code point between 0x80 and 0xffff.\n// Generated by `scripts/generate-identifier-regex.cjs`.\n\n/* prettier-ignore */\nlet nonASCIIidentifierStartChars = \"\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u037f\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u052f\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05d0-\\u05ea\\u05ef-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086a\\u0870-\\u0887\\u0889-\\u088e\\u08a0-\\u08c9\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u09fc\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0af9\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c39\\u0c3d\\u0c58-\\u0c5a\\u0c5d\\u0c60\\u0c61\\u0c80\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cdd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d04-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d54-\\u0d56\\u0d5f-\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e86-\\u0e8a\\u0e8c-\\u0ea3\\u0ea5\\u0ea7-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f5\\u13f8-\\u13fd\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f8\\u1700-\\u1711\\u171f-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1878\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191e\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19b0-\\u19c9\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4c\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1c80-\\u1c8a\\u1c90-\\u1cba\\u1cbd-\\u1cbf\\u1ce9-\\u1cec\\u1cee-\\u1cf3\\u1cf5\\u1cf6\\u1cfa\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2118-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309b-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312f\\u3131-\\u318e\\u31a0-\\u31bf\\u31f0-\\u31ff\\u3400-\\u4dbf\\u4e00-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua69d\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua7cd\\ua7d0\\ua7d1\\ua7d3\\ua7d5-\\ua7dc\\ua7f2-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua8fd\\ua8fe\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\ua9e0-\\ua9e4\\ua9e6-\\ua9ef\\ua9fa-\\ua9fe\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa7e-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uab30-\\uab5a\\uab5c-\\uab69\\uab70-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc\";\n/* prettier-ignore */\nlet nonASCIIidentifierChars = \"\\xb7\\u0300-\\u036f\\u0387\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u064b-\\u0669\\u0670\\u06d6-\\u06dc\\u06df-\\u06e4\\u06e7\\u06e8\\u06ea-\\u06ed\\u06f0-\\u06f9\\u0711\\u0730-\\u074a\\u07a6-\\u07b0\\u07c0-\\u07c9\\u07eb-\\u07f3\\u07fd\\u0816-\\u0819\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0859-\\u085b\\u0897-\\u089f\\u08ca-\\u08e1\\u08e3-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09cb-\\u09cd\\u09d7\\u09e2\\u09e3\\u09e6-\\u09ef\\u09fe\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2\\u0ae3\\u0ae6-\\u0aef\\u0afa-\\u0aff\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b55-\\u0b57\\u0b62\\u0b63\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c00-\\u0c04\\u0c3c\\u0c3e-\\u0c44\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62\\u0c63\\u0c66-\\u0c6f\\u0c81-\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2\\u0ce3\\u0ce6-\\u0cef\\u0cf3\\u0d00-\\u0d03\\u0d3b\\u0d3c\\u0d3e-\\u0d44\\u0d46-\\u0d48\\u0d4a-\\u0d4d\\u0d57\\u0d62\\u0d63\\u0d66-\\u0d6f\\u0d81-\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0de6-\\u0def\\u0df2\\u0df3\\u0e31\\u0e34-\\u0e3a\\u0e47-\\u0e4e\\u0e50-\\u0e59\\u0eb1\\u0eb4-\\u0ebc\\u0ec8-\\u0ece\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f3e\\u0f3f\\u0f71-\\u0f84\\u0f86\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u102b-\\u103e\\u1040-\\u1049\\u1056-\\u1059\\u105e-\\u1060\\u1062-\\u1064\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u1369-\\u1371\\u1712-\\u1715\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17b4-\\u17d3\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u180f-\\u1819\\u18a9\\u1920-\\u192b\\u1930-\\u193b\\u1946-\\u194f\\u19d0-\\u19da\\u1a17-\\u1a1b\\u1a55-\\u1a5e\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1ab0-\\u1abd\\u1abf-\\u1ace\\u1b00-\\u1b04\\u1b34-\\u1b44\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1b80-\\u1b82\\u1ba1-\\u1bad\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c24-\\u1c37\\u1c40-\\u1c49\\u1c50-\\u1c59\\u1cd0-\\u1cd2\\u1cd4-\\u1ce8\\u1ced\\u1cf4\\u1cf7-\\u1cf9\\u1dc0-\\u1dff\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2cef-\\u2cf1\\u2d7f\\u2de0-\\u2dff\\u302a-\\u302f\\u3099\\u309a\\u30fb\\ua620-\\ua629\\ua66f\\ua674-\\ua67d\\ua69e\\ua69f\\ua6f0\\ua6f1\\ua802\\ua806\\ua80b\\ua823-\\ua827\\ua82c\\ua880\\ua881\\ua8b4-\\ua8c5\\ua8d0-\\ua8d9\\ua8e0-\\ua8f1\\ua8ff-\\ua909\\ua926-\\ua92d\\ua947-\\ua953\\ua980-\\ua983\\ua9b3-\\ua9c0\\ua9d0-\\ua9d9\\ua9e5\\ua9f0-\\ua9f9\\uaa29-\\uaa36\\uaa43\\uaa4c\\uaa4d\\uaa50-\\uaa59\\uaa7b-\\uaa7d\\uaab0\\uaab2-\\uaab4\\uaab7\\uaab8\\uaabe\\uaabf\\uaac1\\uaaeb-\\uaaef\\uaaf5\\uaaf6\\uabe3-\\uabea\\uabec\\uabed\\uabf0-\\uabf9\\ufb1e\\ufe00-\\ufe0f\\ufe20-\\ufe2f\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f\\uff65\";\n\nconst nonASCIIidentifierStart = new RegExp(\n \"[\" + nonASCIIidentifierStartChars + \"]\",\n);\nconst nonASCIIidentifier = new RegExp(\n \"[\" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + \"]\",\n);\n\nnonASCIIidentifierStartChars = nonASCIIidentifierChars = null;\n\n// These are a run-length and offset-encoded representation of the\n// >0xffff code points that are a valid part of identifiers. The\n// offset starts at 0x10000, and each pair of numbers represents an\n// offset to the next range, and then a size of the range. They were\n// generated by `scripts/generate-identifier-regex.cjs`.\n/* prettier-ignore */\nconst astralIdentifierStartCodes = [0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,2,60,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,496,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191];\n/* prettier-ignore */\nconst astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,343,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239];\n\n// This has a complexity linear to the value of the code. The\n// assumption is that looking up astral identifier characters is\n// rare.\nfunction isInAstralSet(code: number, set: readonly number[]): boolean {\n let pos = 0x10000;\n for (let i = 0, length = set.length; i < length; i += 2) {\n pos += set[i];\n if (pos > code) return false;\n\n pos += set[i + 1];\n if (pos >= code) return true;\n }\n return false;\n}\n\n// Test whether a given character code starts an identifier.\n\nexport function isIdentifierStart(code: number): boolean {\n if (code < charCodes.uppercaseA) return code === charCodes.dollarSign;\n if (code <= charCodes.uppercaseZ) return true;\n if (code < charCodes.lowercaseA) return code === charCodes.underscore;\n if (code <= charCodes.lowercaseZ) return true;\n if (code <= 0xffff) {\n return (\n code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code))\n );\n }\n return isInAstralSet(code, astralIdentifierStartCodes);\n}\n\n// Test whether a given character is part of an identifier.\n\nexport function isIdentifierChar(code: number): boolean {\n if (code < charCodes.digit0) return code === charCodes.dollarSign;\n if (code < charCodes.colon) return true;\n if (code < charCodes.uppercaseA) return false;\n if (code <= charCodes.uppercaseZ) return true;\n if (code < charCodes.lowercaseA) return code === charCodes.underscore;\n if (code <= charCodes.lowercaseZ) return true;\n if (code <= 0xffff) {\n return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));\n }\n return (\n isInAstralSet(code, astralIdentifierStartCodes) ||\n isInAstralSet(code, astralIdentifierCodes)\n );\n}\n\n// Test whether a given string is a valid identifier name\n\nexport function isIdentifierName(name: string): boolean {\n let isFirst = true;\n for (let i = 0; i < name.length; i++) {\n // The implementation is based on\n // https://source.chromium.org/chromium/chromium/src/+/master:v8/src/builtins/builtins-string-gen.cc;l=1455;drc=221e331b49dfefadbc6fa40b0c68e6f97606d0b3;bpv=0;bpt=1\n // We reimplement `codePointAt` because `codePointAt` is a V8 builtin which is not inlined by TurboFan (as of M91)\n // since `name` is mostly ASCII, an inlined `charCodeAt` wins here\n let cp = name.charCodeAt(i);\n if ((cp & 0xfc00) === 0xd800 && i + 1 < name.length) {\n const trail = name.charCodeAt(++i);\n if ((trail & 0xfc00) === 0xdc00) {\n cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff);\n }\n }\n if (isFirst) {\n isFirst = false;\n if (!isIdentifierStart(cp)) {\n return false;\n }\n } else if (!isIdentifierChar(cp)) {\n return false;\n }\n }\n return !isFirst;\n}\n","const reservedWords = {\n keyword: [\n \"break\",\n \"case\",\n \"catch\",\n \"continue\",\n \"debugger\",\n \"default\",\n \"do\",\n \"else\",\n \"finally\",\n \"for\",\n \"function\",\n \"if\",\n \"return\",\n \"switch\",\n \"throw\",\n \"try\",\n \"var\",\n \"const\",\n \"while\",\n \"with\",\n \"new\",\n \"this\",\n \"super\",\n \"class\",\n \"extends\",\n \"export\",\n \"import\",\n \"null\",\n \"true\",\n \"false\",\n \"in\",\n \"instanceof\",\n \"typeof\",\n \"void\",\n \"delete\",\n ],\n strict: [\n \"implements\",\n \"interface\",\n \"let\",\n \"package\",\n \"private\",\n \"protected\",\n \"public\",\n \"static\",\n \"yield\",\n ],\n strictBind: [\"eval\", \"arguments\"],\n};\nconst keywords = new Set(reservedWords.keyword);\nconst reservedWordsStrictSet = new Set(reservedWords.strict);\nconst reservedWordsStrictBindSet = new Set(reservedWords.strictBind);\n\n/**\n * Checks if word is a reserved word in non-strict mode\n */\nexport function isReservedWord(word: string, inModule: boolean): boolean {\n return (inModule && word === \"await\") || word === \"enum\";\n}\n\n/**\n * Checks if word is a reserved word in non-binding strict mode\n *\n * Includes non-strict reserved words\n */\nexport function isStrictReservedWord(word: string, inModule: boolean): boolean {\n return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);\n}\n\n/**\n * Checks if word is a reserved word in binding strict mode, but it is allowed as\n * a normal identifier.\n */\nexport function isStrictBindOnlyReservedWord(word: string): boolean {\n return reservedWordsStrictBindSet.has(word);\n}\n\n/**\n * Checks if word is a reserved word in binding strict mode\n *\n * Includes non-strict reserved words and non-binding strict reserved words\n */\nexport function isStrictBindReservedWord(\n word: string,\n inModule: boolean,\n): boolean {\n return (\n isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word)\n );\n}\n\nexport function isKeyword(word: string): boolean {\n return keywords.has(word);\n}\n","import * as charCodes from \"charcodes\";\nimport { isIdentifierStart } from \"@babel/helper-validator-identifier\";\n\nexport {\n isIdentifierStart,\n isIdentifierChar,\n isReservedWord,\n isStrictBindOnlyReservedWord,\n isStrictBindReservedWord,\n isStrictReservedWord,\n isKeyword,\n} from \"@babel/helper-validator-identifier\";\n\nexport const keywordRelationalOperator = /^in(stanceof)?$/;\n\n// Test whether a current state character code and next character code is @\n\nexport function isIteratorStart(\n current: number,\n next: number,\n next2: number,\n): boolean {\n return (\n current === charCodes.atSign &&\n next === charCodes.atSign &&\n isIdentifierStart(next2)\n );\n}\n\n// This is the comprehensive set of JavaScript reserved words\n// If a word is in this set, it could be a reserved word,\n// depending on sourceType/strictMode/binding info. In other words\n// if a word is not in this set, it is not a reserved word under\n// any circumstance.\nconst reservedWordLikeSet = new Set([\n \"break\",\n \"case\",\n \"catch\",\n \"continue\",\n \"debugger\",\n \"default\",\n \"do\",\n \"else\",\n \"finally\",\n \"for\",\n \"function\",\n \"if\",\n \"return\",\n \"switch\",\n \"throw\",\n \"try\",\n \"var\",\n \"const\",\n \"while\",\n \"with\",\n \"new\",\n \"this\",\n \"super\",\n \"class\",\n \"extends\",\n \"export\",\n \"import\",\n \"null\",\n \"true\",\n \"false\",\n \"in\",\n \"instanceof\",\n \"typeof\",\n \"void\",\n \"delete\",\n // strict\n \"implements\",\n \"interface\",\n \"let\",\n \"package\",\n \"private\",\n \"protected\",\n \"public\",\n \"static\",\n \"yield\",\n // strictBind\n \"eval\",\n \"arguments\",\n // reservedWorkLike\n \"enum\",\n \"await\",\n]);\n\nexport function canBeReservedWord(word: string): boolean {\n return reservedWordLikeSet.has(word);\n}\n","import { ScopeFlag, BindingFlag } from \"./scopeflags.ts\";\nimport type { Position } from \"./location.ts\";\nimport type * as N from \"../types.ts\";\nimport { Errors } from \"../parse-error.ts\";\nimport type Tokenizer from \"../tokenizer/index.ts\";\n\nexport const enum NameType {\n // var-declared names in the current lexical scope\n Var = 1 << 0,\n // lexically-declared names in the current lexical scope\n Lexical = 1 << 1,\n // lexically-declared FunctionDeclaration names in the current lexical scope\n Function = 1 << 2,\n}\n\n// Start an AST node, attaching a start offset.\nexport class Scope {\n flags: ScopeFlag = 0;\n names: Map = new Map();\n firstLexicalName = \"\";\n\n constructor(flags: ScopeFlag) {\n this.flags = flags;\n }\n}\n\n// The functions in this module keep track of declared variables in the\n// current scope in order to detect duplicate variable names.\nexport default class ScopeHandler {\n parser: Tokenizer;\n scopeStack: Array = [];\n inModule: boolean;\n undefinedExports: Map = new Map();\n\n constructor(parser: Tokenizer, inModule: boolean) {\n this.parser = parser;\n this.inModule = inModule;\n }\n\n get inTopLevel() {\n return (this.currentScope().flags & ScopeFlag.PROGRAM) > 0;\n }\n get inFunction() {\n return (this.currentVarScopeFlags() & ScopeFlag.FUNCTION) > 0;\n }\n get allowSuper() {\n return (this.currentThisScopeFlags() & ScopeFlag.SUPER) > 0;\n }\n get allowDirectSuper() {\n return (this.currentThisScopeFlags() & ScopeFlag.DIRECT_SUPER) > 0;\n }\n get inClass() {\n return (this.currentThisScopeFlags() & ScopeFlag.CLASS) > 0;\n }\n get inClassAndNotInNonArrowFunction() {\n const flags = this.currentThisScopeFlags();\n return (flags & ScopeFlag.CLASS) > 0 && (flags & ScopeFlag.FUNCTION) === 0;\n }\n get inStaticBlock() {\n for (let i = this.scopeStack.length - 1; ; i--) {\n const { flags } = this.scopeStack[i];\n if (flags & ScopeFlag.STATIC_BLOCK) {\n return true;\n }\n if (flags & (ScopeFlag.VAR | ScopeFlag.CLASS)) {\n // function body, module body, class property initializers\n return false;\n }\n }\n }\n get inNonArrowFunction() {\n return (this.currentThisScopeFlags() & ScopeFlag.FUNCTION) > 0;\n }\n get treatFunctionsAsVar() {\n return this.treatFunctionsAsVarInScope(this.currentScope());\n }\n\n createScope(flags: ScopeFlag): Scope {\n return new Scope(flags);\n }\n\n enter(flags: ScopeFlag) {\n /*:: +createScope: (flags:ScopeFlag) => IScope; */\n // @ts-expect-error This method will be overwritten by subclasses\n this.scopeStack.push(this.createScope(flags));\n }\n\n exit(): ScopeFlag {\n const scope = this.scopeStack.pop();\n return scope.flags;\n }\n\n // The spec says:\n // > At the top level of a function, or script, function declarations are\n // > treated like var declarations rather than like lexical declarations.\n treatFunctionsAsVarInScope(scope: IScope): boolean {\n return !!(\n scope.flags & (ScopeFlag.FUNCTION | ScopeFlag.STATIC_BLOCK) ||\n (!this.parser.inModule && scope.flags & ScopeFlag.PROGRAM)\n );\n }\n\n declareName(name: string, bindingType: BindingFlag, loc: Position) {\n let scope = this.currentScope();\n if (\n bindingType & BindingFlag.SCOPE_LEXICAL ||\n bindingType & BindingFlag.SCOPE_FUNCTION\n ) {\n this.checkRedeclarationInScope(scope, name, bindingType, loc);\n\n let type = scope.names.get(name) || 0;\n\n if (bindingType & BindingFlag.SCOPE_FUNCTION) {\n type = type | NameType.Function;\n } else {\n if (!scope.firstLexicalName) {\n scope.firstLexicalName = name;\n }\n type = type | NameType.Lexical;\n }\n\n scope.names.set(name, type);\n\n if (bindingType & BindingFlag.SCOPE_LEXICAL) {\n this.maybeExportDefined(scope, name);\n }\n } else if (bindingType & BindingFlag.SCOPE_VAR) {\n for (let i = this.scopeStack.length - 1; i >= 0; --i) {\n scope = this.scopeStack[i];\n this.checkRedeclarationInScope(scope, name, bindingType, loc);\n scope.names.set(name, (scope.names.get(name) || 0) | NameType.Var);\n this.maybeExportDefined(scope, name);\n\n if (scope.flags & ScopeFlag.VAR) break;\n }\n }\n if (this.parser.inModule && scope.flags & ScopeFlag.PROGRAM) {\n this.undefinedExports.delete(name);\n }\n }\n\n maybeExportDefined(scope: IScope, name: string) {\n if (this.parser.inModule && scope.flags & ScopeFlag.PROGRAM) {\n this.undefinedExports.delete(name);\n }\n }\n\n checkRedeclarationInScope(\n scope: IScope,\n name: string,\n bindingType: BindingFlag,\n loc: Position,\n ) {\n if (this.isRedeclaredInScope(scope, name, bindingType)) {\n this.parser.raise(Errors.VarRedeclaration, loc, {\n identifierName: name,\n });\n }\n }\n\n isRedeclaredInScope(\n scope: IScope,\n name: string,\n bindingType: BindingFlag,\n ): boolean {\n if (!(bindingType & BindingFlag.KIND_VALUE)) return false;\n\n if (bindingType & BindingFlag.SCOPE_LEXICAL) {\n return scope.names.has(name);\n }\n\n const type = scope.names.get(name);\n\n if (bindingType & BindingFlag.SCOPE_FUNCTION) {\n return (\n (type & NameType.Lexical) > 0 ||\n (!this.treatFunctionsAsVarInScope(scope) && (type & NameType.Var) > 0)\n );\n }\n\n return (\n ((type & NameType.Lexical) > 0 &&\n // Annex B.3.4\n // https://tc39.es/ecma262/#sec-variablestatements-in-catch-blocks\n !(\n scope.flags & ScopeFlag.SIMPLE_CATCH &&\n scope.firstLexicalName === name\n )) ||\n (!this.treatFunctionsAsVarInScope(scope) &&\n (type & NameType.Function) > 0)\n );\n }\n\n checkLocalExport(id: N.Identifier) {\n const { name } = id;\n const topLevelScope = this.scopeStack[0];\n if (!topLevelScope.names.has(name)) {\n this.undefinedExports.set(name, id.loc.start);\n }\n }\n\n currentScope(): IScope {\n return this.scopeStack[this.scopeStack.length - 1];\n }\n\n currentVarScopeFlags(): ScopeFlag {\n for (let i = this.scopeStack.length - 1; ; i--) {\n const { flags } = this.scopeStack[i];\n if (flags & ScopeFlag.VAR) {\n return flags;\n }\n }\n }\n\n // Could be useful for `arguments`, `this`, `new.target`, `super()`, `super.property`, and `super[property]`.\n currentThisScopeFlags(): ScopeFlag {\n for (let i = this.scopeStack.length - 1; ; i--) {\n const { flags } = this.scopeStack[i];\n if (\n flags & (ScopeFlag.VAR | ScopeFlag.CLASS) &&\n !(flags & ScopeFlag.ARROW)\n ) {\n return flags;\n }\n }\n }\n}\n","import type { Position } from \"../../util/location.ts\";\nimport ScopeHandler, { NameType, Scope } from \"../../util/scope.ts\";\nimport { BindingFlag, type ScopeFlag } from \"../../util/scopeflags.ts\";\nimport type * as N from \"../../types.ts\";\n\n// Reference implementation: https://github.com/facebook/flow/blob/23aeb2a2ef6eb4241ce178fde5d8f17c5f747fb5/src/typing/env.ml#L536-L584\nclass FlowScope extends Scope {\n // declare function foo(): type;\n declareFunctions: Set = new Set();\n}\n\nexport default class FlowScopeHandler extends ScopeHandler {\n createScope(flags: ScopeFlag): FlowScope {\n return new FlowScope(flags);\n }\n\n declareName(name: string, bindingType: BindingFlag, loc: Position) {\n const scope = this.currentScope();\n if (bindingType & BindingFlag.FLAG_FLOW_DECLARE_FN) {\n this.checkRedeclarationInScope(scope, name, bindingType, loc);\n this.maybeExportDefined(scope, name);\n scope.declareFunctions.add(name);\n return;\n }\n\n super.declareName(name, bindingType, loc);\n }\n\n isRedeclaredInScope(\n scope: FlowScope,\n name: string,\n bindingType: BindingFlag,\n ): boolean {\n if (super.isRedeclaredInScope(scope, name, bindingType)) return true;\n\n if (\n bindingType & BindingFlag.FLAG_FLOW_DECLARE_FN &&\n !scope.declareFunctions.has(name)\n ) {\n const type = scope.names.get(name);\n return (type & NameType.Function) > 0 || (type & NameType.Lexical) > 0;\n }\n\n return false;\n }\n\n checkLocalExport(id: N.Identifier) {\n if (!this.scopeStack[0].declareFunctions.has(id.name)) {\n super.checkLocalExport(id);\n }\n }\n}\n","import type { OptionFlags, Options } from \"../options.ts\";\nimport type State from \"../tokenizer/state.ts\";\nimport type { PluginsMap } from \"./index.ts\";\nimport type ScopeHandler from \"../util/scope.ts\";\nimport type ExpressionScopeHandler from \"../util/expression-scope.ts\";\nimport type ClassScopeHandler from \"../util/class-scope.ts\";\nimport type ProductionParameterHandler from \"../util/production-parameter.ts\";\nimport type {\n ParserPluginWithOptions,\n PluginConfig,\n PluginOptions,\n} from \"../typings.ts\";\nimport type * as N from \"../types.ts\";\n\nexport default class BaseParser {\n // Properties set by constructor in index.js\n declare options: Options;\n declare optionFlags: OptionFlags;\n declare inModule: boolean;\n declare scope: ScopeHandler;\n declare classScope: ClassScopeHandler;\n declare prodParam: ProductionParameterHandler;\n declare expressionScope: ExpressionScopeHandler;\n declare plugins: PluginsMap;\n declare filename: string | undefined | null;\n declare startIndex: number;\n // Names of exports store. `default` is stored as a name for both\n // `export default foo;` and `export { foo as default };`.\n declare exportedIdentifiers: Set;\n sawUnambiguousESM: boolean = false;\n ambiguousScriptDifferentAst: boolean = false;\n\n // Initialized by Tokenizer\n declare state: State;\n // input and length are not in state as they are constant and we do\n // not want to ever copy them, which happens if state gets cloned\n declare input: string;\n declare length: number;\n // Comment store for Program.comments\n declare comments: Array;\n\n sourceToOffsetPos(sourcePos: number) {\n return sourcePos + this.startIndex;\n }\n\n offsetToSourcePos(offsetPos: number) {\n return offsetPos - this.startIndex;\n }\n\n // This method accepts either a string (plugin name) or an array pair\n // (plugin name and options object). If an options object is given,\n // then each value is non-recursively checked for identity with that\n // plugin’s actual option value.\n hasPlugin(pluginConfig: PluginConfig): boolean {\n if (typeof pluginConfig === \"string\") {\n return this.plugins.has(pluginConfig);\n } else {\n const [pluginName, pluginOptions] = pluginConfig;\n if (!this.hasPlugin(pluginName)) {\n return false;\n }\n const actualOptions = this.plugins.get(pluginName);\n for (const key of Object.keys(\n pluginOptions,\n ) as (keyof typeof pluginOptions)[]) {\n if (actualOptions?.[key] !== pluginOptions[key]) {\n return false;\n }\n }\n return true;\n }\n }\n\n getPluginOption<\n PluginName extends ParserPluginWithOptions[0],\n OptionName extends keyof PluginOptions,\n >(plugin: PluginName, name: OptionName) {\n return (this.plugins.get(plugin) as null | PluginOptions)?.[\n name\n ];\n }\n}\n","/*:: declare var invariant; */\n\nimport BaseParser from \"./base.ts\";\nimport type { Comment, Node, Identifier } from \"../types.ts\";\nimport * as charCodes from \"charcodes\";\nimport type { Undone } from \"./node.ts\";\n\n/**\n * A whitespace token containing comments\n */\nexport type CommentWhitespace = {\n /**\n * the start of the whitespace token.\n */\n start: number;\n /**\n * the end of the whitespace token.\n */\n end: number;\n /**\n * the containing comments\n */\n comments: Array;\n /**\n * the immediately preceding AST node of the whitespace token\n */\n leadingNode: Node | null;\n /**\n * the immediately following AST node of the whitespace token\n */\n trailingNode: Node | null;\n /**\n * the innermost AST node containing the whitespace with minimal size (|end - start|)\n */\n containingNode: Node | null;\n};\n\n/**\n * Merge comments with node's trailingComments or assign comments to be\n * trailingComments. New comments will be placed before old comments\n * because the commentStack is enumerated reversely.\n */\nfunction setTrailingComments(node: Undone, comments: Array) {\n if (node.trailingComments === undefined) {\n node.trailingComments = comments;\n } else {\n node.trailingComments.unshift(...comments);\n }\n}\n\n/**\n * Merge comments with node's leadingComments or assign comments to be\n * leadingComments. New comments will be placed before old comments\n * because the commentStack is enumerated reversely.\n */\nfunction setLeadingComments(node: Undone, comments: Array) {\n if (node.leadingComments === undefined) {\n node.leadingComments = comments;\n } else {\n node.leadingComments.unshift(...comments);\n }\n}\n\n/**\n * Merge comments with node's innerComments or assign comments to be\n * innerComments. New comments will be placed before old comments\n * because the commentStack is enumerated reversely.\n */\nexport function setInnerComments(\n node: Undone,\n comments?: Array,\n) {\n if (node.innerComments === undefined) {\n node.innerComments = comments;\n } else {\n node.innerComments.unshift(...comments);\n }\n}\n\n/**\n * Given node and elements array, if elements has non-null element,\n * merge comments to its trailingComments, otherwise merge comments\n * to node's innerComments\n */\nfunction adjustInnerComments(\n node: Undone,\n elements: Array,\n commentWS: CommentWhitespace,\n) {\n let lastElement = null;\n let i = elements.length;\n while (lastElement === null && i > 0) {\n lastElement = elements[--i];\n }\n if (lastElement === null || lastElement.start > commentWS.start) {\n setInnerComments(node, commentWS.comments);\n } else {\n setTrailingComments(lastElement, commentWS.comments);\n }\n}\n\nexport default class CommentsParser extends BaseParser {\n addComment(comment: Comment): void {\n if (this.filename) comment.loc.filename = this.filename;\n const { commentsLen } = this.state;\n if (this.comments.length !== commentsLen) {\n this.comments.length = commentsLen;\n }\n this.comments.push(comment);\n this.state.commentsLen++;\n }\n\n /**\n * Given a newly created AST node _n_, attach _n_ to a comment whitespace _w_ if applicable\n * {@see {@link CommentWhitespace}}\n */\n processComment(node: Node): void {\n const { commentStack } = this.state;\n const commentStackLength = commentStack.length;\n if (commentStackLength === 0) return;\n let i = commentStackLength - 1;\n const lastCommentWS = commentStack[i];\n\n if (lastCommentWS.start === node.end) {\n lastCommentWS.leadingNode = node;\n i--;\n }\n\n const { start: nodeStart } = node;\n // invariant: for all 0 <= j <= i, let c = commentStack[j], c must satisfy c.end < node.end\n for (; i >= 0; i--) {\n const commentWS = commentStack[i];\n const commentEnd = commentWS.end;\n if (commentEnd > nodeStart) {\n // by definition of commentWhiteSpace, this implies commentWS.start > nodeStart\n // so node can be a containingNode candidate. At this time we can finalize the comment\n // whitespace, because\n // 1) its leadingNode or trailingNode, if exists, will not change\n // 2) its containingNode have been assigned and will not change because it is the\n // innermost minimal-sized AST node\n commentWS.containingNode = node;\n this.finalizeComment(commentWS);\n commentStack.splice(i, 1);\n } else {\n if (commentEnd === nodeStart) {\n commentWS.trailingNode = node;\n }\n // stop the loop when commentEnd <= nodeStart\n break;\n }\n }\n }\n\n /**\n * Assign the comments of comment whitespaces to related AST nodes.\n * Also adjust innerComments following trailing comma.\n */\n finalizeComment(commentWS: CommentWhitespace) {\n const { comments } = commentWS;\n if (commentWS.leadingNode !== null || commentWS.trailingNode !== null) {\n if (commentWS.leadingNode !== null) {\n setTrailingComments(commentWS.leadingNode, comments);\n }\n if (commentWS.trailingNode !== null) {\n setLeadingComments(commentWS.trailingNode, comments);\n }\n } else {\n /*:: invariant(commentWS.containingNode !== null) */\n const { containingNode: node, start: commentStart } = commentWS;\n if (\n this.input.charCodeAt(this.offsetToSourcePos(commentStart) - 1) ===\n charCodes.comma\n ) {\n // If a commentWhitespace follows a comma and the containingNode allows\n // list structures with trailing comma, merge it to the trailingComment\n // of the last non-null list element\n switch (node.type) {\n case \"ObjectExpression\":\n case \"ObjectPattern\":\n case \"RecordExpression\":\n adjustInnerComments(node, node.properties, commentWS);\n break;\n case \"CallExpression\":\n case \"OptionalCallExpression\":\n adjustInnerComments(node, node.arguments, commentWS);\n break;\n case \"FunctionDeclaration\":\n case \"FunctionExpression\":\n case \"ArrowFunctionExpression\":\n case \"ObjectMethod\":\n case \"ClassMethod\":\n case \"ClassPrivateMethod\":\n adjustInnerComments(node, node.params, commentWS);\n break;\n case \"ArrayExpression\":\n case \"ArrayPattern\":\n case \"TupleExpression\":\n adjustInnerComments(node, node.elements, commentWS);\n break;\n case \"ExportNamedDeclaration\":\n case \"ImportDeclaration\":\n adjustInnerComments(node, node.specifiers, commentWS);\n break;\n case \"TSEnumDeclaration\":\n if (!process.env.BABEL_8_BREAKING) {\n adjustInnerComments(node, node.members, commentWS);\n } else {\n setInnerComments(node, comments);\n }\n break;\n case \"TSEnumBody\":\n adjustInnerComments(node, node.members, commentWS);\n break;\n default: {\n setInnerComments(node, comments);\n }\n }\n } else {\n setInnerComments(node, comments);\n }\n }\n }\n\n /**\n * Drains remaining commentStack and applies finalizeComment\n * to each comment whitespace. Used only in parseExpression\n * where the top level AST node is _not_ Program\n * {@see {@link CommentsParser#finalizeComment}}\n */\n finalizeRemainingComments() {\n const { commentStack } = this.state;\n for (let i = commentStack.length - 1; i >= 0; i--) {\n this.finalizeComment(commentStack[i]);\n }\n this.state.commentStack = [];\n }\n\n /* eslint-disable no-irregular-whitespace */\n /**\n * Reset previous node trailing comments. Used in object / class\n * property parsing. We parse `async`, `static`, `set` and `get`\n * as an identifier but may reinterpret it into an async/static/accessor\n * method later. In this case the identifier is not part of the AST and we\n * should sync the knowledge to commentStacks\n *\n * For example, when parsing\n * ```\n * async /* 1 *​/ function f() {}\n * ```\n * the comment whitespace `/* 1 *​/` has leading node Identifier(async). When\n * we see the function token, we create a Function node and mark `/* 1 *​/` as\n * inner comments. So `/* 1 *​/` should be detached from the Identifier node.\n *\n * @param node the last finished AST node _before_ current token\n */\n /* eslint-enable no-irregular-whitespace */\n resetPreviousNodeTrailingComments(node: Node) {\n const { commentStack } = this.state;\n const { length } = commentStack;\n if (length === 0) return;\n const commentWS = commentStack[length - 1];\n if (commentWS.leadingNode === node) {\n commentWS.leadingNode = null;\n }\n }\n\n /* eslint-disable no-irregular-whitespace */\n /**\n * Reset previous node leading comments, assuming that `node` is a\n * single-token node. Used in import phase modifiers parsing. We parse\n * `module` in `import module foo from ...` as an identifier but may\n * reinterpret it into a phase modifier later. In this case the identifier is\n * not part of the AST and we should sync the knowledge to commentStacks\n *\n * For example, when parsing\n * ```\n * import /* 1 *​/ module a from \"a\";\n * ```\n * the comment whitespace `/* 1 *​/` has trailing node Identifier(module). When\n * we see that `module` is not a default import binding, we mark `/* 1 *​/` as\n * inner comments of the ImportDeclaration. So `/* 1 *​/` should be detached from\n * the Identifier node.\n *\n * @param node the last finished AST node _before_ current token\n */\n /* eslint-enable no-irregular-whitespace */\n resetPreviousIdentifierLeadingComments(node: Identifier) {\n const { commentStack } = this.state;\n const { length } = commentStack;\n if (length === 0) return;\n\n if (commentStack[length - 1].trailingNode === node) {\n commentStack[length - 1].trailingNode = null;\n } else if (length >= 2 && commentStack[length - 2].trailingNode === node) {\n commentStack[length - 2].trailingNode = null;\n }\n }\n\n /**\n * Attach a node to the comment whitespaces right before/after\n * the given range.\n *\n * This is used to properly attach comments around parenthesized\n * expressions as leading/trailing comments of the inner expression.\n */\n takeSurroundingComments(node: Node, start: number, end: number) {\n const { commentStack } = this.state;\n const commentStackLength = commentStack.length;\n if (commentStackLength === 0) return;\n let i = commentStackLength - 1;\n\n for (; i >= 0; i--) {\n const commentWS = commentStack[i];\n const commentEnd = commentWS.end;\n const commentStart = commentWS.start;\n\n if (commentStart === end) {\n commentWS.leadingNode = node;\n } else if (commentEnd === start) {\n commentWS.trailingNode = node;\n } else if (commentEnd < start) {\n break;\n }\n }\n }\n}\n","import * as charCodes from \"charcodes\";\n\n// Matches a whole line break (where CRLF is considered a single\n// line break). Used to count lines.\nexport const lineBreak = /\\r\\n|[\\r\\n\\u2028\\u2029]/;\nexport const lineBreakG = new RegExp(lineBreak.source, \"g\");\n\n// https://tc39.github.io/ecma262/#sec-line-terminators\nexport function isNewLine(code: number): boolean {\n switch (code) {\n case charCodes.lineFeed:\n case charCodes.carriageReturn:\n case charCodes.lineSeparator:\n case charCodes.paragraphSeparator:\n return true;\n\n default:\n return false;\n }\n}\n\nexport function hasNewLine(input: string, start: number, end: number): boolean {\n for (let i = start; i < end; i++) {\n if (isNewLine(input.charCodeAt(i))) {\n return true;\n }\n }\n return false;\n}\n\nexport const skipWhiteSpace = /(?:\\s|\\/\\/.*|\\/\\*[^]*?\\*\\/)*/g;\n\nexport const skipWhiteSpaceInLine =\n /(?:[^\\S\\n\\r\\u2028\\u2029]|\\/\\/.*|\\/\\*.*?\\*\\/)*/g;\n\n// https://tc39.github.io/ecma262/#sec-white-space\nexport function isWhitespace(code: number): boolean {\n switch (code) {\n case 0x0009: // CHARACTER TABULATION\n case 0x000b: // LINE TABULATION\n case 0x000c: // FORM FEED\n case charCodes.space:\n case charCodes.nonBreakingSpace:\n case charCodes.oghamSpaceMark:\n case 0x2000: // EN QUAD\n case 0x2001: // EM QUAD\n case 0x2002: // EN SPACE\n case 0x2003: // EM SPACE\n case 0x2004: // THREE-PER-EM SPACE\n case 0x2005: // FOUR-PER-EM SPACE\n case 0x2006: // SIX-PER-EM SPACE\n case 0x2007: // FIGURE SPACE\n case 0x2008: // PUNCTUATION SPACE\n case 0x2009: // THIN SPACE\n case 0x200a: // HAIR SPACE\n case 0x202f: // NARROW NO-BREAK SPACE\n case 0x205f: // MEDIUM MATHEMATICAL SPACE\n case 0x3000: // IDEOGRAPHIC SPACE\n case 0xfeff: // ZERO WIDTH NO-BREAK SPACE\n return true;\n\n default:\n return false;\n }\n}\n","import type { Options } from \"../options.ts\";\nimport type { CommentWhitespace } from \"../parser/comments\";\nimport { Position } from \"../util/location.ts\";\n\nimport { types as ct, type TokContext } from \"./context.ts\";\nimport { tt, type TokenType } from \"./types.ts\";\nimport type { Errors } from \"../parse-error.ts\";\nimport type { ParseError } from \"../parse-error.ts\";\n\nexport type DeferredStrictError =\n | typeof Errors.StrictNumericEscape\n | typeof Errors.StrictOctalLiteral;\n\ntype TopicContextState = {\n // When a topic binding has been currently established,\n // then this is 1. Otherwise, it is 0. This is forwards compatible\n // with a future plugin for multiple lexical topics.\n maxNumOfResolvableTopics: number;\n // When a topic binding has been currently established, and if that binding\n // has been used as a topic reference `#`, then this is 0. Otherwise, it is\n // `null`. This is forwards compatible with a future plugin for multiple\n // lexical topics.\n maxTopicIndex: null | 0;\n};\n\nexport const enum LoopLabelKind {\n Loop = 1,\n Switch = 2,\n}\n\ndeclare const bit: import(\"../../../../scripts/babel-plugin-bit-decorator/types.d.ts\").BitDecorator;\n\nexport default class State {\n @bit.storage flags: number;\n\n @bit accessor strict = false;\n\n startIndex: number;\n curLine: number;\n lineStart: number;\n\n // And, if locations are used, the {line, column} object\n // corresponding to those offsets\n startLoc: Position;\n endLoc: Position;\n\n init({\n strictMode,\n sourceType,\n startIndex,\n startLine,\n startColumn,\n }: Options): void {\n this.strict =\n strictMode === false\n ? false\n : strictMode === true\n ? true\n : sourceType === \"module\";\n\n this.startIndex = startIndex;\n this.curLine = startLine;\n this.lineStart = -startColumn;\n this.startLoc = this.endLoc = new Position(\n startLine,\n startColumn,\n startIndex,\n );\n }\n\n errors: ParseError[] = [];\n\n // Used to signify the start of a potential arrow function\n potentialArrowAt: number = -1;\n\n // Used to signify the start of an expression which looks like a\n // typed arrow function, but it isn't\n // e.g. a ? (b) : c => d\n // ^\n noArrowAt: number[] = [];\n\n // Used to signify the start of an expression whose params, if it looks like\n // an arrow function, shouldn't be converted to assignable nodes.\n // This is used to defer the validation of typed arrow functions inside\n // conditional expressions.\n // e.g. a ? (b) : c => d\n // ^\n noArrowParamsConversionAt: number[] = [];\n\n // Flags to track\n @bit accessor maybeInArrowParameters = false;\n @bit accessor inType = false;\n @bit accessor noAnonFunctionType = false;\n @bit accessor hasFlowComment = false;\n @bit accessor isAmbientContext = false;\n @bit accessor inAbstractClass = false;\n @bit accessor inDisallowConditionalTypesContext = false;\n\n // For the Hack-style pipelines plugin\n topicContext: TopicContextState = {\n maxNumOfResolvableTopics: 0,\n maxTopicIndex: null,\n };\n\n // For the F#-style pipelines plugin\n @bit accessor soloAwait = false;\n @bit accessor inFSharpPipelineDirectBody = false;\n\n // Labels in scope.\n labels: Array<{\n kind: LoopLabelKind;\n name?: string | null;\n statementStart?: number;\n }> = [];\n\n commentsLen = 0;\n // Comment attachment store\n commentStack: Array = [];\n\n // The current position of the tokenizer in the input.\n pos: number = 0;\n\n // Properties of the current token:\n // Its type\n type: TokenType = tt.eof;\n\n // For tokens that include more information than their type, the value\n value: any = null;\n\n // Its start and end offset\n start: number = 0;\n end: number = 0;\n\n // Position information for the previous token\n // this is initialized when generating the second token.\n lastTokEndLoc: Position = null;\n // this is initialized when generating the second token.\n lastTokStartLoc: Position = null;\n\n // The context stack is used to track whether the apostrophe \"`\" starts\n // or ends a string template\n context: Array = [ct.brace];\n\n // Used to track whether a JSX element is allowed to form\n @bit accessor canStartJSXElement = true;\n\n // Used to signal to callers of `readWord1` whether the word\n // contained any escape sequences. This is needed because words with\n // escape sequences must not be interpreted as keywords.\n @bit accessor containsEsc = false;\n\n // Used to track invalid escape sequences in template literals,\n // that must be reported if the template is not tagged.\n firstInvalidTemplateEscapePos: null | Position = null;\n\n @bit accessor hasTopLevelAwait = false;\n\n // This property is used to track the following errors\n // - StrictNumericEscape\n // - StrictOctalLiteral\n //\n // in a literal that occurs prior to/immediately after a \"use strict\" directive.\n\n // todo(JLHwung): set strictErrors to null and avoid recording string errors\n // after a non-directive is parsed\n strictErrors: Map = new Map();\n\n // Tokens length in token store\n tokensLength: number = 0;\n\n /**\n * When we add a new property, we must manually update the `clone` method\n * @see State#clone\n */\n\n curPosition(): Position {\n return new Position(\n this.curLine,\n this.pos - this.lineStart,\n this.pos + this.startIndex,\n );\n }\n\n clone(): State {\n const state = new State();\n state.flags = this.flags;\n state.startIndex = this.startIndex;\n state.curLine = this.curLine;\n state.lineStart = this.lineStart;\n state.startLoc = this.startLoc;\n state.endLoc = this.endLoc;\n state.errors = this.errors.slice();\n state.potentialArrowAt = this.potentialArrowAt;\n state.noArrowAt = this.noArrowAt.slice();\n state.noArrowParamsConversionAt = this.noArrowParamsConversionAt.slice();\n state.topicContext = this.topicContext;\n state.labels = this.labels.slice();\n state.commentsLen = this.commentsLen;\n state.commentStack = this.commentStack.slice();\n state.pos = this.pos;\n state.type = this.type;\n state.value = this.value;\n state.start = this.start;\n state.end = this.end;\n state.lastTokEndLoc = this.lastTokEndLoc;\n state.lastTokStartLoc = this.lastTokStartLoc;\n state.context = this.context.slice();\n state.firstInvalidTemplateEscapePos = this.firstInvalidTemplateEscapePos;\n state.strictErrors = this.strictErrors;\n state.tokensLength = this.tokensLength;\n\n return state;\n }\n}\n\nexport type LookaheadState = {\n pos: number;\n value: any;\n type: TokenType;\n start: number;\n end: number;\n context: TokContext[];\n startLoc: Position;\n lastTokEndLoc: Position;\n curLine: number;\n lineStart: number;\n curPosition: State[\"curPosition\"];\n /* Used only in readToken_mult_modulo */\n inType: boolean;\n // These boolean properties are not initialized in createLookaheadState()\n // instead they will only be set by the tokenizer\n containsEsc?: boolean;\n};\n","// We inline this package\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport * as charCodes from \"charcodes\";\n\n// The following character codes are forbidden from being\n// an immediate sibling of NumericLiteralSeparator _\nconst forbiddenNumericSeparatorSiblings = {\n decBinOct: new Set([\n charCodes.dot,\n charCodes.uppercaseB,\n charCodes.uppercaseE,\n charCodes.uppercaseO,\n charCodes.underscore, // multiple separators are not allowed\n charCodes.lowercaseB,\n charCodes.lowercaseE,\n charCodes.lowercaseO,\n ]),\n hex: new Set([\n charCodes.dot,\n charCodes.uppercaseX,\n charCodes.underscore, // multiple separators are not allowed\n charCodes.lowercaseX,\n ]),\n};\n\nconst isAllowedNumericSeparatorSibling = {\n // 0 - 1\n bin: (ch: number) => ch === charCodes.digit0 || ch === charCodes.digit1,\n\n // 0 - 7\n oct: (ch: number) => ch >= charCodes.digit0 && ch <= charCodes.digit7,\n\n // 0 - 9\n dec: (ch: number) => ch >= charCodes.digit0 && ch <= charCodes.digit9,\n\n // 0 - 9, A - F, a - f,\n hex: (ch: number) =>\n (ch >= charCodes.digit0 && ch <= charCodes.digit9) ||\n (ch >= charCodes.uppercaseA && ch <= charCodes.uppercaseF) ||\n (ch >= charCodes.lowercaseA && ch <= charCodes.lowercaseF),\n};\n\nexport type StringContentsErrorHandlers = EscapedCharErrorHandlers & {\n unterminated(\n initialPos: number,\n initialLineStart: number,\n initialCurLine: number,\n ): void;\n};\n\nexport function readStringContents(\n type: \"single\" | \"double\" | \"template\",\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n errors: StringContentsErrorHandlers,\n) {\n const initialPos = pos;\n const initialLineStart = lineStart;\n const initialCurLine = curLine;\n\n let out = \"\";\n let firstInvalidLoc = null;\n let chunkStart = pos;\n const { length } = input;\n for (;;) {\n if (pos >= length) {\n errors.unterminated(initialPos, initialLineStart, initialCurLine);\n out += input.slice(chunkStart, pos);\n break;\n }\n const ch = input.charCodeAt(pos);\n if (isStringEnd(type, ch, input, pos)) {\n out += input.slice(chunkStart, pos);\n break;\n }\n if (ch === charCodes.backslash) {\n out += input.slice(chunkStart, pos);\n const res = readEscapedChar(\n input,\n pos,\n lineStart,\n curLine,\n type === \"template\",\n errors,\n );\n if (res.ch === null && !firstInvalidLoc) {\n firstInvalidLoc = { pos, lineStart, curLine };\n } else {\n out += res.ch;\n }\n ({ pos, lineStart, curLine } = res);\n chunkStart = pos;\n } else if (\n ch === charCodes.lineSeparator ||\n ch === charCodes.paragraphSeparator\n ) {\n ++pos;\n ++curLine;\n lineStart = pos;\n } else if (ch === charCodes.lineFeed || ch === charCodes.carriageReturn) {\n if (type === \"template\") {\n out += input.slice(chunkStart, pos) + \"\\n\";\n ++pos;\n if (\n ch === charCodes.carriageReturn &&\n input.charCodeAt(pos) === charCodes.lineFeed\n ) {\n ++pos;\n }\n ++curLine;\n chunkStart = lineStart = pos;\n } else {\n errors.unterminated(initialPos, initialLineStart, initialCurLine);\n }\n } else {\n ++pos;\n }\n }\n return process.env.BABEL_8_BREAKING\n ? { pos, str: out, firstInvalidLoc, lineStart, curLine }\n : {\n pos,\n str: out,\n firstInvalidLoc,\n lineStart,\n curLine,\n containsInvalid: !!firstInvalidLoc,\n };\n}\n\nfunction isStringEnd(\n type: \"single\" | \"double\" | \"template\",\n ch: number,\n input: string,\n pos: number,\n) {\n if (type === \"template\") {\n return (\n ch === charCodes.graveAccent ||\n (ch === charCodes.dollarSign &&\n input.charCodeAt(pos + 1) === charCodes.leftCurlyBrace)\n );\n }\n return (\n ch === (type === \"double\" ? charCodes.quotationMark : charCodes.apostrophe)\n );\n}\n\ntype EscapedCharErrorHandlers = HexCharErrorHandlers &\n CodePointErrorHandlers & {\n strictNumericEscape(pos: number, lineStart: number, curLine: number): void;\n };\n\nfunction readEscapedChar(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n inTemplate: boolean,\n errors: EscapedCharErrorHandlers,\n) {\n const throwOnInvalid = !inTemplate;\n pos++; // skip '\\'\n\n const res = (ch: string | null) => ({ pos, ch, lineStart, curLine });\n\n const ch = input.charCodeAt(pos++);\n switch (ch) {\n case charCodes.lowercaseN:\n return res(\"\\n\");\n case charCodes.lowercaseR:\n return res(\"\\r\");\n case charCodes.lowercaseX: {\n let code;\n ({ code, pos } = readHexChar(\n input,\n pos,\n lineStart,\n curLine,\n 2,\n false,\n throwOnInvalid,\n errors,\n ));\n return res(code === null ? null : String.fromCharCode(code));\n }\n case charCodes.lowercaseU: {\n let code;\n ({ code, pos } = readCodePoint(\n input,\n pos,\n lineStart,\n curLine,\n throwOnInvalid,\n errors,\n ));\n return res(code === null ? null : String.fromCodePoint(code));\n }\n case charCodes.lowercaseT:\n return res(\"\\t\");\n case charCodes.lowercaseB:\n return res(\"\\b\");\n case charCodes.lowercaseV:\n return res(\"\\u000b\");\n case charCodes.lowercaseF:\n return res(\"\\f\");\n case charCodes.carriageReturn:\n if (input.charCodeAt(pos) === charCodes.lineFeed) {\n ++pos;\n }\n // fall through\n case charCodes.lineFeed:\n lineStart = pos;\n ++curLine;\n // fall through\n case charCodes.lineSeparator:\n case charCodes.paragraphSeparator:\n return res(\"\");\n case charCodes.digit8:\n case charCodes.digit9:\n if (inTemplate) {\n return res(null);\n } else {\n errors.strictNumericEscape(pos - 1, lineStart, curLine);\n }\n // fall through\n default:\n if (ch >= charCodes.digit0 && ch <= charCodes.digit7) {\n const startPos = pos - 1;\n const match = /^[0-7]+/.exec(input.slice(startPos, pos + 2));\n\n let octalStr = match[0];\n\n let octal = parseInt(octalStr, 8);\n if (octal > 255) {\n octalStr = octalStr.slice(0, -1);\n octal = parseInt(octalStr, 8);\n }\n pos += octalStr.length - 1;\n const next = input.charCodeAt(pos);\n if (\n octalStr !== \"0\" ||\n next === charCodes.digit8 ||\n next === charCodes.digit9\n ) {\n if (inTemplate) {\n return res(null);\n } else {\n errors.strictNumericEscape(startPos, lineStart, curLine);\n }\n }\n\n return res(String.fromCharCode(octal));\n }\n\n return res(String.fromCharCode(ch));\n }\n}\n\ntype HexCharErrorHandlers = IntErrorHandlers & {\n invalidEscapeSequence(pos: number, lineStart: number, curLine: number): void;\n};\n\n// Used to read character escape sequences ('\\x', '\\u').\nfunction readHexChar(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n len: number,\n forceLen: boolean,\n throwOnInvalid: boolean,\n errors: HexCharErrorHandlers,\n) {\n const initialPos = pos;\n let n;\n ({ n, pos } = readInt(\n input,\n pos,\n lineStart,\n curLine,\n 16,\n len,\n forceLen,\n false,\n errors,\n /* bailOnError */ !throwOnInvalid,\n ));\n if (n === null) {\n if (throwOnInvalid) {\n errors.invalidEscapeSequence(initialPos, lineStart, curLine);\n } else {\n pos = initialPos - 1;\n }\n }\n return { code: n, pos };\n}\n\nexport type IntErrorHandlers = {\n numericSeparatorInEscapeSequence(\n pos: number,\n lineStart: number,\n curLine: number,\n ): void;\n unexpectedNumericSeparator(\n pos: number,\n lineStart: number,\n curLine: number,\n ): void;\n // It can return \"true\" to indicate that the error was handled\n // and the int parsing should continue.\n invalidDigit(\n pos: number,\n lineStart: number,\n curLine: number,\n radix: number,\n ): boolean;\n};\n\nexport function readInt(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n radix: number,\n len: number | undefined,\n forceLen: boolean,\n allowNumSeparator: boolean | \"bail\",\n errors: IntErrorHandlers,\n bailOnError: boolean,\n) {\n const start = pos;\n const forbiddenSiblings =\n radix === 16\n ? forbiddenNumericSeparatorSiblings.hex\n : forbiddenNumericSeparatorSiblings.decBinOct;\n const isAllowedSibling =\n radix === 16\n ? isAllowedNumericSeparatorSibling.hex\n : radix === 10\n ? isAllowedNumericSeparatorSibling.dec\n : radix === 8\n ? isAllowedNumericSeparatorSibling.oct\n : isAllowedNumericSeparatorSibling.bin;\n\n let invalid = false;\n let total = 0;\n\n for (let i = 0, e = len == null ? Infinity : len; i < e; ++i) {\n const code = input.charCodeAt(pos);\n let val;\n\n if (code === charCodes.underscore && allowNumSeparator !== \"bail\") {\n const prev = input.charCodeAt(pos - 1);\n const next = input.charCodeAt(pos + 1);\n\n if (!allowNumSeparator) {\n if (bailOnError) return { n: null, pos };\n errors.numericSeparatorInEscapeSequence(pos, lineStart, curLine);\n } else if (\n Number.isNaN(next) ||\n !isAllowedSibling(next) ||\n forbiddenSiblings.has(prev) ||\n forbiddenSiblings.has(next)\n ) {\n if (bailOnError) return { n: null, pos };\n errors.unexpectedNumericSeparator(pos, lineStart, curLine);\n }\n\n // Ignore this _ character\n ++pos;\n continue;\n }\n\n if (code >= charCodes.lowercaseA) {\n val = code - charCodes.lowercaseA + charCodes.lineFeed;\n } else if (code >= charCodes.uppercaseA) {\n val = code - charCodes.uppercaseA + charCodes.lineFeed;\n } else if (charCodes.isDigit(code)) {\n val = code - charCodes.digit0; // 0-9\n } else {\n val = Infinity;\n }\n if (val >= radix) {\n // If we found a digit which is too big, errors.invalidDigit can return true to avoid\n // breaking the loop (this is used for error recovery).\n if (val <= 9 && bailOnError) {\n return { n: null, pos };\n } else if (\n val <= 9 &&\n errors.invalidDigit(pos, lineStart, curLine, radix)\n ) {\n val = 0;\n } else if (forceLen) {\n val = 0;\n invalid = true;\n } else {\n break;\n }\n }\n ++pos;\n total = total * radix + val;\n }\n if (pos === start || (len != null && pos - start !== len) || invalid) {\n return { n: null, pos };\n }\n\n return { n: total, pos };\n}\n\nexport type CodePointErrorHandlers = HexCharErrorHandlers & {\n invalidCodePoint(pos: number, lineStart: number, curLine: number): void;\n};\n\nexport function readCodePoint(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n throwOnInvalid: boolean,\n errors: CodePointErrorHandlers,\n) {\n const ch = input.charCodeAt(pos);\n let code;\n\n if (ch === charCodes.leftCurlyBrace) {\n ++pos;\n ({ code, pos } = readHexChar(\n input,\n pos,\n lineStart,\n curLine,\n input.indexOf(\"}\", pos) - pos,\n true,\n throwOnInvalid,\n errors,\n ));\n ++pos;\n if (code !== null && code > 0x10ffff) {\n if (throwOnInvalid) {\n errors.invalidCodePoint(pos, lineStart, curLine);\n } else {\n return { code: null, pos };\n }\n }\n } else {\n ({ code, pos } = readHexChar(\n input,\n pos,\n lineStart,\n curLine,\n 4,\n false,\n throwOnInvalid,\n errors,\n ));\n }\n return { code, pos };\n}\n","/*:: declare var invariant; */\n\nimport { OptionFlags, type Options } from \"../options.ts\";\nimport {\n Position,\n SourceLocation,\n createPositionWithColumnOffset,\n} from \"../util/location.ts\";\nimport CommentsParser, { type CommentWhitespace } from \"../parser/comments.ts\";\nimport type * as N from \"../types.ts\";\nimport * as charCodes from \"charcodes\";\nimport { isIdentifierStart, isIdentifierChar } from \"../util/identifier.ts\";\nimport {\n tokenIsKeyword,\n tokenLabelName,\n tt,\n keywords as keywordTypes,\n type TokenType,\n} from \"./types.ts\";\nimport type { TokContext } from \"./context.ts\";\nimport {\n Errors,\n type ParseError,\n type ParseErrorConstructor,\n} from \"../parse-error.ts\";\nimport {\n lineBreakG,\n isNewLine,\n isWhitespace,\n skipWhiteSpace,\n skipWhiteSpaceInLine,\n} from \"../util/whitespace.ts\";\nimport State from \"./state.ts\";\nimport type { LookaheadState, DeferredStrictError } from \"./state.ts\";\nimport type { Undone } from \"../parser/node.ts\";\nimport type { Node } from \"../types.ts\";\n\nimport {\n readInt,\n readCodePoint,\n readStringContents,\n type IntErrorHandlers,\n type CodePointErrorHandlers,\n type StringContentsErrorHandlers,\n} from \"@babel/helper-string-parser\";\n\nimport type { Plugin } from \"../typings.ts\";\n\nfunction buildPosition(pos: number, lineStart: number, curLine: number) {\n return new Position(curLine, pos - lineStart, pos);\n}\n\nconst VALID_REGEX_FLAGS = new Set([\n charCodes.lowercaseG,\n charCodes.lowercaseM,\n charCodes.lowercaseS,\n charCodes.lowercaseI,\n charCodes.lowercaseY,\n charCodes.lowercaseU,\n charCodes.lowercaseD,\n charCodes.lowercaseV,\n]);\n\n// Object type used to represent tokens. Note that normally, tokens\n// simply exist as properties on the parser object. This is only\n// used for the onToken callback and the external tokenizer.\n\nexport class Token {\n constructor(state: State) {\n const startIndex = state.startIndex || 0;\n this.type = state.type;\n this.value = state.value;\n this.start = startIndex + state.start;\n this.end = startIndex + state.end;\n this.loc = new SourceLocation(state.startLoc, state.endLoc);\n }\n\n declare type: TokenType;\n declare value: any;\n declare start: number;\n declare end: number;\n declare loc: SourceLocation;\n}\n\n// ## Tokenizer\n\nexport default abstract class Tokenizer extends CommentsParser {\n isLookahead: boolean;\n\n // Token store.\n tokens: Array = [];\n\n constructor(options: Options, input: string) {\n super();\n this.state = new State();\n this.state.init(options);\n this.input = input;\n this.length = input.length;\n this.comments = [];\n this.isLookahead = false;\n }\n\n pushToken(token: Token | N.Comment) {\n // Pop out invalid tokens trapped by try-catch parsing.\n // Those parsing branches are mainly created by typescript and flow plugins.\n this.tokens.length = this.state.tokensLength;\n this.tokens.push(token);\n ++this.state.tokensLength;\n }\n\n // Move to the next token\n\n next(): void {\n this.checkKeywordEscapes();\n if (this.optionFlags & OptionFlags.Tokens) {\n this.pushToken(new Token(this.state));\n }\n\n this.state.lastTokEndLoc = this.state.endLoc;\n this.state.lastTokStartLoc = this.state.startLoc;\n this.nextToken();\n }\n\n eat(type: TokenType): boolean {\n if (this.match(type)) {\n this.next();\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * Whether current token matches given type\n */\n match(type: TokenType): boolean {\n return this.state.type === type;\n }\n\n /**\n * Create a LookaheadState from current parser state\n */\n createLookaheadState(state: State): LookaheadState {\n return {\n pos: state.pos,\n value: null,\n type: state.type,\n start: state.start,\n end: state.end,\n context: [this.curContext()],\n inType: state.inType,\n startLoc: state.startLoc,\n lastTokEndLoc: state.lastTokEndLoc,\n curLine: state.curLine,\n lineStart: state.lineStart,\n curPosition: state.curPosition,\n };\n }\n\n /**\n * lookahead peeks the next token, skipping changes to token context and\n * comment stack. For performance it returns a limited LookaheadState\n * instead of full parser state.\n *\n * The { column, line } Loc info is not included in lookahead since such usage\n * is rare. Although it may return other location properties e.g. `curLine` and\n * `lineStart`, these properties are not listed in the LookaheadState interface\n * and thus the returned value is _NOT_ reliable.\n *\n * The tokenizer should make best efforts to avoid using any parser state\n * other than those defined in LookaheadState\n */\n lookahead(): LookaheadState {\n const old = this.state;\n // @ts-expect-error For performance we use a simplified tokenizer state structure\n this.state = this.createLookaheadState(old);\n\n this.isLookahead = true;\n this.nextToken();\n this.isLookahead = false;\n\n const curr = this.state;\n this.state = old;\n return curr;\n }\n\n nextTokenStart(): number {\n return this.nextTokenStartSince(this.state.pos);\n }\n\n nextTokenStartSince(pos: number): number {\n skipWhiteSpace.lastIndex = pos;\n return skipWhiteSpace.test(this.input) ? skipWhiteSpace.lastIndex : pos;\n }\n\n lookaheadCharCode(): number {\n return this.input.charCodeAt(this.nextTokenStart());\n }\n\n /**\n * Similar to nextToken, but it will stop at line break when it is seen before the next token\n *\n * @returns {number} position of the next token start or line break, whichever is seen first.\n * @memberof Tokenizer\n */\n nextTokenInLineStart(): number {\n return this.nextTokenInLineStartSince(this.state.pos);\n }\n\n nextTokenInLineStartSince(pos: number): number {\n skipWhiteSpaceInLine.lastIndex = pos;\n return skipWhiteSpaceInLine.test(this.input)\n ? skipWhiteSpaceInLine.lastIndex\n : pos;\n }\n\n /**\n * Similar to lookaheadCharCode, but it will return the char code of line break if it is\n * seen before the next token\n *\n * @returns {number} char code of the next token start or line break, whichever is seen first.\n * @memberof Tokenizer\n */\n lookaheadInLineCharCode(): number {\n return this.input.charCodeAt(this.nextTokenInLineStart());\n }\n\n codePointAtPos(pos: number): number {\n // The implementation is based on\n // https://source.chromium.org/chromium/chromium/src/+/master:v8/src/builtins/builtins-string-gen.cc;l=1455;drc=221e331b49dfefadbc6fa40b0c68e6f97606d0b3;bpv=0;bpt=1\n // We reimplement `codePointAt` because `codePointAt` is a V8 builtin which is not inlined by TurboFan (as of M91)\n // since `input` is mostly ASCII, an inlined `charCodeAt` wins here\n let cp = this.input.charCodeAt(pos);\n if ((cp & 0xfc00) === 0xd800 && ++pos < this.input.length) {\n const trail = this.input.charCodeAt(pos);\n if ((trail & 0xfc00) === 0xdc00) {\n cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff);\n }\n }\n return cp;\n }\n\n // Toggle strict mode. Re-reads the next number or string to please\n // pedantic tests (`\"use strict\"; 010;` should fail).\n\n setStrict(strict: boolean): void {\n this.state.strict = strict;\n if (strict) {\n // Throw an error for any string decimal escape found before/immediately\n // after a \"use strict\" directive. Strict mode will be set at parse\n // time for any literals that occur after the next node of the strict\n // directive.\n this.state.strictErrors.forEach(([toParseError, at]) =>\n this.raise(toParseError, at),\n );\n this.state.strictErrors.clear();\n }\n }\n\n curContext(): TokContext {\n return this.state.context[this.state.context.length - 1];\n }\n\n // Read a single token, updating the parser object's token-related properties.\n nextToken(): void {\n this.skipSpace();\n this.state.start = this.state.pos;\n if (!this.isLookahead) this.state.startLoc = this.state.curPosition();\n if (this.state.pos >= this.length) {\n this.finishToken(tt.eof);\n return;\n }\n\n this.getTokenFromCode(this.codePointAtPos(this.state.pos));\n }\n\n // Skips a block comment, whose end is marked by commentEnd.\n // *-/ is used by the Flow plugin, when parsing block comments nested\n // inside Flow comments.\n skipBlockComment(commentEnd: \"*/\" | \"*-/\"): N.CommentBlock | undefined {\n let startLoc;\n if (!this.isLookahead) startLoc = this.state.curPosition();\n const start = this.state.pos;\n const end = this.input.indexOf(commentEnd, start + 2);\n if (end === -1) {\n // We have to call this again here because startLoc may not be set...\n // This seems to be for performance reasons:\n // https://github.com/babel/babel/commit/acf2a10899f696a8aaf34df78bf9725b5ea7f2da\n throw this.raise(Errors.UnterminatedComment, this.state.curPosition());\n }\n\n this.state.pos = end + commentEnd.length;\n lineBreakG.lastIndex = start + 2;\n while (lineBreakG.test(this.input) && lineBreakG.lastIndex <= end) {\n ++this.state.curLine;\n this.state.lineStart = lineBreakG.lastIndex;\n }\n\n // If we are doing a lookahead right now we need to advance the position (above code)\n // but we do not want to push the comment to the state.\n if (this.isLookahead) return;\n /*:: invariant(startLoc) */\n\n const comment: N.CommentBlock = {\n type: \"CommentBlock\",\n value: this.input.slice(start + 2, end),\n start: this.sourceToOffsetPos(start),\n end: this.sourceToOffsetPos(end + commentEnd.length),\n loc: new SourceLocation(startLoc, this.state.curPosition()),\n };\n if (this.optionFlags & OptionFlags.Tokens) this.pushToken(comment);\n return comment;\n }\n\n skipLineComment(startSkip: number): N.CommentLine | undefined {\n const start = this.state.pos;\n let startLoc;\n if (!this.isLookahead) startLoc = this.state.curPosition();\n let ch = this.input.charCodeAt((this.state.pos += startSkip));\n if (this.state.pos < this.length) {\n while (!isNewLine(ch) && ++this.state.pos < this.length) {\n ch = this.input.charCodeAt(this.state.pos);\n }\n }\n\n // If we are doing a lookahead right now we need to advance the position (above code)\n // but we do not want to push the comment to the state.\n if (this.isLookahead) return;\n\n const end = this.state.pos;\n const value = this.input.slice(start + startSkip, end);\n\n const comment: N.CommentLine = {\n type: \"CommentLine\",\n value,\n start: this.sourceToOffsetPos(start),\n end: this.sourceToOffsetPos(end),\n loc: new SourceLocation(startLoc, this.state.curPosition()),\n };\n if (this.optionFlags & OptionFlags.Tokens) this.pushToken(comment);\n return comment;\n }\n\n // Called at the start of the parse and after every token. Skips\n // whitespace and comments, and.\n\n skipSpace(): void {\n const spaceStart = this.state.pos;\n const comments: N.Comment[] =\n this.optionFlags & OptionFlags.AttachComment ? [] : null;\n loop: while (this.state.pos < this.length) {\n const ch = this.input.charCodeAt(this.state.pos);\n switch (ch) {\n case charCodes.space:\n case charCodes.nonBreakingSpace:\n case charCodes.tab:\n ++this.state.pos;\n break;\n case charCodes.carriageReturn:\n if (\n this.input.charCodeAt(this.state.pos + 1) === charCodes.lineFeed\n ) {\n ++this.state.pos;\n }\n // fall through\n case charCodes.lineFeed:\n case charCodes.lineSeparator:\n case charCodes.paragraphSeparator:\n ++this.state.pos;\n ++this.state.curLine;\n this.state.lineStart = this.state.pos;\n break;\n\n case charCodes.slash:\n switch (this.input.charCodeAt(this.state.pos + 1)) {\n case charCodes.asterisk: {\n const comment = this.skipBlockComment(\"*/\");\n if (comment !== undefined) {\n this.addComment(comment);\n comments?.push(comment);\n }\n break;\n }\n\n case charCodes.slash: {\n const comment = this.skipLineComment(2);\n if (comment !== undefined) {\n this.addComment(comment);\n comments?.push(comment);\n }\n break;\n }\n\n default:\n break loop;\n }\n break;\n\n default:\n if (isWhitespace(ch)) {\n ++this.state.pos;\n } else if (\n ch === charCodes.dash &&\n !this.inModule &&\n this.optionFlags & OptionFlags.AnnexB\n ) {\n const pos = this.state.pos;\n if (\n this.input.charCodeAt(pos + 1) === charCodes.dash &&\n this.input.charCodeAt(pos + 2) === charCodes.greaterThan &&\n (spaceStart === 0 || this.state.lineStart > spaceStart)\n ) {\n // A `-->` line comment\n const comment = this.skipLineComment(3);\n if (comment !== undefined) {\n this.addComment(comment);\n comments?.push(comment);\n }\n } else {\n break loop;\n }\n } else if (\n ch === charCodes.lessThan &&\n !this.inModule &&\n this.optionFlags & OptionFlags.AnnexB\n ) {\n const pos = this.state.pos;\n if (\n this.input.charCodeAt(pos + 1) === charCodes.exclamationMark &&\n this.input.charCodeAt(pos + 2) === charCodes.dash &&\n this.input.charCodeAt(pos + 3) === charCodes.dash\n ) {\n // `` line comment\n const comment = this.skipLineComment(3);\n if (comment !== undefined) {\n this.addComment(comment);\n comments?.push(comment);\n }\n } else {\n break loop;\n }\n } else if (\n ch === charCodes.lessThan &&\n !this.inModule &&\n this.optionFlags & OptionFlags.AnnexB\n ) {\n const pos = this.state.pos;\n if (\n this.input.charCodeAt(pos + 1) === charCodes.exclamationMark &&\n this.input.charCodeAt(pos + 2) === charCodes.dash &&\n this.input.charCodeAt(pos + 3) === charCodes.dash\n ) {\n // ``; - case 5: - return escapeHtml(toDisplayString(evaluateConstant(node.content))); - case 8: - return escapeHtml(evaluateConstant(node)); - case 12: - return stringifyNode(node.content, context); - default: - return ""; - } -} -function stringifyElement(node, context) { - let res = `<${node.tag}`; - let innerHTML = ""; - for (let i = 0; i < node.props.length; i++) { - const p = node.props[i]; - if (p.type === 6) { - res += ` ${p.name}`; - if (p.value) { - res += `="${escapeHtml(p.value.content)}"`; - } - } else if (p.type === 7) { - if (p.name === "bind") { - const exp = p.exp; - if (exp.content[0] === "_") { - res += ` ${p.arg.content}="__VUE_EXP_START__${exp.content}__VUE_EXP_END__"`; - continue; - } - if (isBooleanAttr(p.arg.content) && exp.content === "false") { - continue; - } - let evaluated = evaluateConstant(exp); - if (evaluated != null) { - const arg = p.arg && p.arg.content; - if (arg === "class") { - evaluated = normalizeClass(evaluated); - } else if (arg === "style") { - evaluated = stringifyStyle(normalizeStyle(evaluated)); - } - res += ` ${p.arg.content}="${escapeHtml( - evaluated - )}"`; - } - } else if (p.name === "html") { - innerHTML = evaluateConstant(p.exp); - } else if (p.name === "text") { - innerHTML = escapeHtml( - toDisplayString(evaluateConstant(p.exp)) - ); - } - } - } - if (context.scopeId) { - res += ` ${context.scopeId}`; - } - res += `>`; - if (innerHTML) { - res += innerHTML; - } else { - for (let i = 0; i < node.children.length; i++) { - res += stringifyNode(node.children[i], context); - } - } - if (!isVoidTag(node.tag)) { - res += ``; - } - return res; -} -function evaluateConstant(exp) { - if (exp.type === 4) { - return new Function(`return (${exp.content})`)(); - } else { - let res = ``; - exp.children.forEach((c) => { - if (isString$1(c) || isSymbol$1(c)) { - return; - } - if (c.type === 2) { - res += c.content; - } else if (c.type === 5) { - res += toDisplayString(evaluateConstant(c.content)); - } else { - res += evaluateConstant(c); - } - }); - return res; - } -} - -const ignoreSideEffectTags = (node, context) => { - if (node.type === 1 && node.tagType === 0 && (node.tag === "script" || node.tag === "style")) { - context.onError( - createDOMCompilerError( - 63, - node.loc - ) - ); - context.removeNode(); - } -}; - -function isValidHTMLNesting(parent, child) { - if (parent in onlyValidChildren) { - return onlyValidChildren[parent].has(child); - } - if (child in onlyValidParents) { - return onlyValidParents[child].has(parent); - } - if (parent in knownInvalidChildren) { - if (knownInvalidChildren[parent].has(child)) return false; - } - if (child in knownInvalidParents) { - if (knownInvalidParents[child].has(parent)) return false; - } - return true; -} -const headings = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "h6"]); -const emptySet = /* @__PURE__ */ new Set([]); -const onlyValidChildren = { - head: /* @__PURE__ */ new Set([ - "base", - "basefront", - "bgsound", - "link", - "meta", - "title", - "noscript", - "noframes", - "style", - "script", - "template" - ]), - optgroup: /* @__PURE__ */ new Set(["option"]), - select: /* @__PURE__ */ new Set(["optgroup", "option", "hr"]), - // table - table: /* @__PURE__ */ new Set(["caption", "colgroup", "tbody", "tfoot", "thead"]), - tr: /* @__PURE__ */ new Set(["td", "th"]), - colgroup: /* @__PURE__ */ new Set(["col"]), - tbody: /* @__PURE__ */ new Set(["tr"]), - thead: /* @__PURE__ */ new Set(["tr"]), - tfoot: /* @__PURE__ */ new Set(["tr"]), - // these elements can not have any children elements - script: emptySet, - iframe: emptySet, - option: emptySet, - textarea: emptySet, - style: emptySet, - title: emptySet -}; -const onlyValidParents = { - // sections - html: emptySet, - body: /* @__PURE__ */ new Set(["html"]), - head: /* @__PURE__ */ new Set(["html"]), - // table - td: /* @__PURE__ */ new Set(["tr"]), - colgroup: /* @__PURE__ */ new Set(["table"]), - caption: /* @__PURE__ */ new Set(["table"]), - tbody: /* @__PURE__ */ new Set(["table"]), - tfoot: /* @__PURE__ */ new Set(["table"]), - col: /* @__PURE__ */ new Set(["colgroup"]), - th: /* @__PURE__ */ new Set(["tr"]), - thead: /* @__PURE__ */ new Set(["table"]), - tr: /* @__PURE__ */ new Set(["tbody", "thead", "tfoot"]), - // data list - dd: /* @__PURE__ */ new Set(["dl", "div"]), - dt: /* @__PURE__ */ new Set(["dl", "div"]), - // other - figcaption: /* @__PURE__ */ new Set(["figure"]), - // li: new Set(["ul", "ol"]), - summary: /* @__PURE__ */ new Set(["details"]), - area: /* @__PURE__ */ new Set(["map"]) -}; -const knownInvalidChildren = { - p: /* @__PURE__ */ new Set([ - "address", - "article", - "aside", - "blockquote", - "center", - "details", - "dialog", - "dir", - "div", - "dl", - "fieldset", - "figure", - "footer", - "form", - "h1", - "h2", - "h3", - "h4", - "h5", - "h6", - "header", - "hgroup", - "hr", - "li", - "main", - "nav", - "menu", - "ol", - "p", - "pre", - "section", - "table", - "ul" - ]), - svg: /* @__PURE__ */ new Set([ - "b", - "blockquote", - "br", - "code", - "dd", - "div", - "dl", - "dt", - "em", - "embed", - "h1", - "h2", - "h3", - "h4", - "h5", - "h6", - "hr", - "i", - "img", - "li", - "menu", - "meta", - "ol", - "p", - "pre", - "ruby", - "s", - "small", - "span", - "strong", - "sub", - "sup", - "table", - "u", - "ul", - "var" - ]) -}; -const knownInvalidParents = { - a: /* @__PURE__ */ new Set(["a"]), - button: /* @__PURE__ */ new Set(["button"]), - dd: /* @__PURE__ */ new Set(["dd", "dt"]), - dt: /* @__PURE__ */ new Set(["dd", "dt"]), - form: /* @__PURE__ */ new Set(["form"]), - li: /* @__PURE__ */ new Set(["li"]), - h1: headings, - h2: headings, - h3: headings, - h4: headings, - h5: headings, - h6: headings -}; - -const validateHtmlNesting = (node, context) => { - if (node.type === 1 && node.tagType === 0 && context.parent && context.parent.type === 1 && context.parent.tagType === 0 && !isValidHTMLNesting(context.parent.tag, node.tag)) { - const error = new SyntaxError( - `<${node.tag}> cannot be child of <${context.parent.tag}>, according to HTML specifications. This can cause hydration errors or potentially disrupt future functionality.` - ); - error.loc = node.loc; - context.onWarn(error); - } -}; - -const DOMNodeTransforms = [ - transformStyle, - ...[transformTransition, validateHtmlNesting] -]; -const DOMDirectiveTransforms = { - cloak: noopDirectiveTransform, - html: transformVHtml, - text: transformVText, - model: transformModel, - // override compiler-core - on: transformOn, - // override compiler-core - show: transformShow -}; -function compile$1(src, options = {}) { - return baseCompile( - src, - extend({}, parserOptions, options, { - nodeTransforms: [ - // ignore ` - -[Get supported base64-js with the Tidelift Subscription](https://tidelift.com/subscription/pkg/npm-base64-js?utm_source=npm-base64-js&utm_medium=referral&utm_campaign=readme) - -## methods - -`base64js` has three exposed functions, `byteLength`, `toByteArray` and `fromByteArray`, which both take a single argument. - -* `byteLength` - Takes a base64 string and returns length of byte array -* `toByteArray` - Takes a base64 string and returns a byte array -* `fromByteArray` - Takes a byte array and returns a base64 string - -## license - -MIT diff --git a/node_modules/base64-js/base64js.min.js b/node_modules/base64-js/base64js.min.js deleted file mode 100644 index 908ac83..0000000 --- a/node_modules/base64-js/base64js.min.js +++ /dev/null @@ -1 +0,0 @@ -(function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"==typeof window?"undefined"==typeof global?"undefined"==typeof self?this:self:global:window,b.base64js=a()}})(function(){return function(){function b(d,e,g){function a(j,i){if(!e[j]){if(!d[j]){var f="function"==typeof require&&require;if(!i&&f)return f(j,!0);if(h)return h(j,!0);var c=new Error("Cannot find module '"+j+"'");throw c.code="MODULE_NOT_FOUND",c}var k=e[j]={exports:{}};d[j][0].call(k.exports,function(b){var c=d[j][1][b];return a(c||b)},k,k.exports,b,d,e,g)}return e[j].exports}for(var h="function"==typeof require&&require,c=0;c>16,j[k++]=255&b>>8,j[k++]=255&b;return 2===h&&(b=l[a.charCodeAt(c)]<<2|l[a.charCodeAt(c+1)]>>4,j[k++]=255&b),1===h&&(b=l[a.charCodeAt(c)]<<10|l[a.charCodeAt(c+1)]<<4|l[a.charCodeAt(c+2)]>>2,j[k++]=255&b>>8,j[k++]=255&b),j}function g(a){return k[63&a>>18]+k[63&a>>12]+k[63&a>>6]+k[63&a]}function h(a,b,c){for(var d,e=[],f=b;fj?j:g+f));return 1===d?(b=a[c-1],e.push(k[b>>2]+k[63&b<<4]+"==")):2===d&&(b=(a[c-2]<<8)+a[c-1],e.push(k[b>>10]+k[63&b>>4]+k[63&b<<2]+"=")),e.join("")}c.byteLength=function(a){var b=d(a),c=b[0],e=b[1];return 3*(c+e)/4-e},c.toByteArray=f,c.fromByteArray=j;for(var k=[],l=[],m="undefined"==typeof Uint8Array?Array:Uint8Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,p=n.length;o 0) { - throw new Error('Invalid string. Length must be a multiple of 4') - } - - // Trim off extra bytes after placeholder bytes are found - // See: https://github.com/beatgammit/base64-js/issues/42 - var validLen = b64.indexOf('=') - if (validLen === -1) validLen = len - - var placeHoldersLen = validLen === len - ? 0 - : 4 - (validLen % 4) - - return [validLen, placeHoldersLen] -} - -// base64 is 4/3 + up to two characters of the original data -function byteLength (b64) { - var lens = getLens(b64) - var validLen = lens[0] - var placeHoldersLen = lens[1] - return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen -} - -function _byteLength (b64, validLen, placeHoldersLen) { - return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen -} - -function toByteArray (b64) { - var tmp - var lens = getLens(b64) - var validLen = lens[0] - var placeHoldersLen = lens[1] - - var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)) - - var curByte = 0 - - // if there are placeholders, only get up to the last complete 4 chars - var len = placeHoldersLen > 0 - ? validLen - 4 - : validLen - - var i - for (i = 0; i < len; i += 4) { - tmp = - (revLookup[b64.charCodeAt(i)] << 18) | - (revLookup[b64.charCodeAt(i + 1)] << 12) | - (revLookup[b64.charCodeAt(i + 2)] << 6) | - revLookup[b64.charCodeAt(i + 3)] - arr[curByte++] = (tmp >> 16) & 0xFF - arr[curByte++] = (tmp >> 8) & 0xFF - arr[curByte++] = tmp & 0xFF - } - - if (placeHoldersLen === 2) { - tmp = - (revLookup[b64.charCodeAt(i)] << 2) | - (revLookup[b64.charCodeAt(i + 1)] >> 4) - arr[curByte++] = tmp & 0xFF - } - - if (placeHoldersLen === 1) { - tmp = - (revLookup[b64.charCodeAt(i)] << 10) | - (revLookup[b64.charCodeAt(i + 1)] << 4) | - (revLookup[b64.charCodeAt(i + 2)] >> 2) - arr[curByte++] = (tmp >> 8) & 0xFF - arr[curByte++] = tmp & 0xFF - } - - return arr -} - -function tripletToBase64 (num) { - return lookup[num >> 18 & 0x3F] + - lookup[num >> 12 & 0x3F] + - lookup[num >> 6 & 0x3F] + - lookup[num & 0x3F] -} - -function encodeChunk (uint8, start, end) { - var tmp - var output = [] - for (var i = start; i < end; i += 3) { - tmp = - ((uint8[i] << 16) & 0xFF0000) + - ((uint8[i + 1] << 8) & 0xFF00) + - (uint8[i + 2] & 0xFF) - output.push(tripletToBase64(tmp)) - } - return output.join('') -} - -function fromByteArray (uint8) { - var tmp - var len = uint8.length - var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes - var parts = [] - var maxChunkLength = 16383 // must be multiple of 3 - - // go through the array every three bytes, we'll deal with trailing stuff later - for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { - parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength))) - } - - // pad the end with zeros, but make sure to not forget the extra bytes - if (extraBytes === 1) { - tmp = uint8[len - 1] - parts.push( - lookup[tmp >> 2] + - lookup[(tmp << 4) & 0x3F] + - '==' - ) - } else if (extraBytes === 2) { - tmp = (uint8[len - 2] << 8) + uint8[len - 1] - parts.push( - lookup[tmp >> 10] + - lookup[(tmp >> 4) & 0x3F] + - lookup[(tmp << 2) & 0x3F] + - '=' - ) - } - - return parts.join('') -} diff --git a/node_modules/base64-js/package.json b/node_modules/base64-js/package.json deleted file mode 100644 index c3972e3..0000000 --- a/node_modules/base64-js/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "base64-js", - "description": "Base64 encoding/decoding in pure JS", - "version": "1.5.1", - "author": "T. Jameson Little ", - "typings": "index.d.ts", - "bugs": { - "url": "https://github.com/beatgammit/base64-js/issues" - }, - "devDependencies": { - "babel-minify": "^0.5.1", - "benchmark": "^2.1.4", - "browserify": "^16.3.0", - "standard": "*", - "tape": "4.x" - }, - "homepage": "https://github.com/beatgammit/base64-js", - "keywords": [ - "base64" - ], - "license": "MIT", - "main": "index.js", - "repository": { - "type": "git", - "url": "git://github.com/beatgammit/base64-js.git" - }, - "scripts": { - "build": "browserify -s base64js -r ./ | minify > base64js.min.js", - "lint": "standard", - "test": "npm run lint && npm run unit", - "unit": "tape test/*.js" - }, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] -} diff --git a/node_modules/bl/.travis.yml b/node_modules/bl/.travis.yml index 016eaf5..a349506 100644 --- a/node_modules/bl/.travis.yml +++ b/node_modules/bl/.travis.yml @@ -1,7 +1,4 @@ sudo: false -arch: - - amd64 - - ppc64le language: node_js node_js: - '6' @@ -9,7 +6,6 @@ node_js: - '10' - '12' - '14' - - '15' - lts/* notifications: email: diff --git a/node_modules/bl/BufferList.js b/node_modules/bl/BufferList.js deleted file mode 100644 index 471ee77..0000000 --- a/node_modules/bl/BufferList.js +++ /dev/null @@ -1,396 +0,0 @@ -'use strict' - -const { Buffer } = require('buffer') -const symbol = Symbol.for('BufferList') - -function BufferList (buf) { - if (!(this instanceof BufferList)) { - return new BufferList(buf) - } - - BufferList._init.call(this, buf) -} - -BufferList._init = function _init (buf) { - Object.defineProperty(this, symbol, { value: true }) - - this._bufs = [] - this.length = 0 - - if (buf) { - this.append(buf) - } -} - -BufferList.prototype._new = function _new (buf) { - return new BufferList(buf) -} - -BufferList.prototype._offset = function _offset (offset) { - if (offset === 0) { - return [0, 0] - } - - let tot = 0 - - for (let i = 0; i < this._bufs.length; i++) { - const _t = tot + this._bufs[i].length - if (offset < _t || i === this._bufs.length - 1) { - return [i, offset - tot] - } - tot = _t - } -} - -BufferList.prototype._reverseOffset = function (blOffset) { - const bufferId = blOffset[0] - let offset = blOffset[1] - - for (let i = 0; i < bufferId; i++) { - offset += this._bufs[i].length - } - - return offset -} - -BufferList.prototype.get = function get (index) { - if (index > this.length || index < 0) { - return undefined - } - - const offset = this._offset(index) - - return this._bufs[offset[0]][offset[1]] -} - -BufferList.prototype.slice = function slice (start, end) { - if (typeof start === 'number' && start < 0) { - start += this.length - } - - if (typeof end === 'number' && end < 0) { - end += this.length - } - - return this.copy(null, 0, start, end) -} - -BufferList.prototype.copy = function copy (dst, dstStart, srcStart, srcEnd) { - if (typeof srcStart !== 'number' || srcStart < 0) { - srcStart = 0 - } - - if (typeof srcEnd !== 'number' || srcEnd > this.length) { - srcEnd = this.length - } - - if (srcStart >= this.length) { - return dst || Buffer.alloc(0) - } - - if (srcEnd <= 0) { - return dst || Buffer.alloc(0) - } - - const copy = !!dst - const off = this._offset(srcStart) - const len = srcEnd - srcStart - let bytes = len - let bufoff = (copy && dstStart) || 0 - let start = off[1] - - // copy/slice everything - if (srcStart === 0 && srcEnd === this.length) { - if (!copy) { - // slice, but full concat if multiple buffers - return this._bufs.length === 1 - ? this._bufs[0] - : Buffer.concat(this._bufs, this.length) - } - - // copy, need to copy individual buffers - for (let i = 0; i < this._bufs.length; i++) { - this._bufs[i].copy(dst, bufoff) - bufoff += this._bufs[i].length - } - - return dst - } - - // easy, cheap case where it's a subset of one of the buffers - if (bytes <= this._bufs[off[0]].length - start) { - return copy - ? this._bufs[off[0]].copy(dst, dstStart, start, start + bytes) - : this._bufs[off[0]].slice(start, start + bytes) - } - - if (!copy) { - // a slice, we need something to copy in to - dst = Buffer.allocUnsafe(len) - } - - for (let i = off[0]; i < this._bufs.length; i++) { - const l = this._bufs[i].length - start - - if (bytes > l) { - this._bufs[i].copy(dst, bufoff, start) - bufoff += l - } else { - this._bufs[i].copy(dst, bufoff, start, start + bytes) - bufoff += l - break - } - - bytes -= l - - if (start) { - start = 0 - } - } - - // safeguard so that we don't return uninitialized memory - if (dst.length > bufoff) return dst.slice(0, bufoff) - - return dst -} - -BufferList.prototype.shallowSlice = function shallowSlice (start, end) { - start = start || 0 - end = typeof end !== 'number' ? this.length : end - - if (start < 0) { - start += this.length - } - - if (end < 0) { - end += this.length - } - - if (start === end) { - return this._new() - } - - const startOffset = this._offset(start) - const endOffset = this._offset(end) - const buffers = this._bufs.slice(startOffset[0], endOffset[0] + 1) - - if (endOffset[1] === 0) { - buffers.pop() - } else { - buffers[buffers.length - 1] = buffers[buffers.length - 1].slice(0, endOffset[1]) - } - - if (startOffset[1] !== 0) { - buffers[0] = buffers[0].slice(startOffset[1]) - } - - return this._new(buffers) -} - -BufferList.prototype.toString = function toString (encoding, start, end) { - return this.slice(start, end).toString(encoding) -} - -BufferList.prototype.consume = function consume (bytes) { - // first, normalize the argument, in accordance with how Buffer does it - bytes = Math.trunc(bytes) - // do nothing if not a positive number - if (Number.isNaN(bytes) || bytes <= 0) return this - - while (this._bufs.length) { - if (bytes >= this._bufs[0].length) { - bytes -= this._bufs[0].length - this.length -= this._bufs[0].length - this._bufs.shift() - } else { - this._bufs[0] = this._bufs[0].slice(bytes) - this.length -= bytes - break - } - } - - return this -} - -BufferList.prototype.duplicate = function duplicate () { - const copy = this._new() - - for (let i = 0; i < this._bufs.length; i++) { - copy.append(this._bufs[i]) - } - - return copy -} - -BufferList.prototype.append = function append (buf) { - if (buf == null) { - return this - } - - if (buf.buffer) { - // append a view of the underlying ArrayBuffer - this._appendBuffer(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength)) - } else if (Array.isArray(buf)) { - for (let i = 0; i < buf.length; i++) { - this.append(buf[i]) - } - } else if (this._isBufferList(buf)) { - // unwrap argument into individual BufferLists - for (let i = 0; i < buf._bufs.length; i++) { - this.append(buf._bufs[i]) - } - } else { - // coerce number arguments to strings, since Buffer(number) does - // uninitialized memory allocation - if (typeof buf === 'number') { - buf = buf.toString() - } - - this._appendBuffer(Buffer.from(buf)) - } - - return this -} - -BufferList.prototype._appendBuffer = function appendBuffer (buf) { - this._bufs.push(buf) - this.length += buf.length -} - -BufferList.prototype.indexOf = function (search, offset, encoding) { - if (encoding === undefined && typeof offset === 'string') { - encoding = offset - offset = undefined - } - - if (typeof search === 'function' || Array.isArray(search)) { - throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.') - } else if (typeof search === 'number') { - search = Buffer.from([search]) - } else if (typeof search === 'string') { - search = Buffer.from(search, encoding) - } else if (this._isBufferList(search)) { - search = search.slice() - } else if (Array.isArray(search.buffer)) { - search = Buffer.from(search.buffer, search.byteOffset, search.byteLength) - } else if (!Buffer.isBuffer(search)) { - search = Buffer.from(search) - } - - offset = Number(offset || 0) - - if (isNaN(offset)) { - offset = 0 - } - - if (offset < 0) { - offset = this.length + offset - } - - if (offset < 0) { - offset = 0 - } - - if (search.length === 0) { - return offset > this.length ? this.length : offset - } - - const blOffset = this._offset(offset) - let blIndex = blOffset[0] // index of which internal buffer we're working on - let buffOffset = blOffset[1] // offset of the internal buffer we're working on - - // scan over each buffer - for (; blIndex < this._bufs.length; blIndex++) { - const buff = this._bufs[blIndex] - - while (buffOffset < buff.length) { - const availableWindow = buff.length - buffOffset - - if (availableWindow >= search.length) { - const nativeSearchResult = buff.indexOf(search, buffOffset) - - if (nativeSearchResult !== -1) { - return this._reverseOffset([blIndex, nativeSearchResult]) - } - - buffOffset = buff.length - search.length + 1 // end of native search window - } else { - const revOffset = this._reverseOffset([blIndex, buffOffset]) - - if (this._match(revOffset, search)) { - return revOffset - } - - buffOffset++ - } - } - - buffOffset = 0 - } - - return -1 -} - -BufferList.prototype._match = function (offset, search) { - if (this.length - offset < search.length) { - return false - } - - for (let searchOffset = 0; searchOffset < search.length; searchOffset++) { - if (this.get(offset + searchOffset) !== search[searchOffset]) { - return false - } - } - return true -} - -;(function () { - const methods = { - readDoubleBE: 8, - readDoubleLE: 8, - readFloatBE: 4, - readFloatLE: 4, - readInt32BE: 4, - readInt32LE: 4, - readUInt32BE: 4, - readUInt32LE: 4, - readInt16BE: 2, - readInt16LE: 2, - readUInt16BE: 2, - readUInt16LE: 2, - readInt8: 1, - readUInt8: 1, - readIntBE: null, - readIntLE: null, - readUIntBE: null, - readUIntLE: null - } - - for (const m in methods) { - (function (m) { - if (methods[m] === null) { - BufferList.prototype[m] = function (offset, byteLength) { - return this.slice(offset, offset + byteLength)[m](0, byteLength) - } - } else { - BufferList.prototype[m] = function (offset = 0) { - return this.slice(offset, offset + methods[m])[m](0) - } - } - }(m)) - } -}()) - -// Used internally by the class and also as an indicator of this object being -// a `BufferList`. It's not possible to use `instanceof BufferList` in a browser -// environment because there could be multiple different copies of the -// BufferList class and some `BufferList`s might be `BufferList`s. -BufferList.prototype._isBufferList = function _isBufferList (b) { - return b instanceof BufferList || BufferList.isBufferList(b) -} - -BufferList.isBufferList = function isBufferList (b) { - return b != null && b[symbol] -} - -module.exports = BufferList diff --git a/node_modules/bl/LICENSE.md b/node_modules/bl/LICENSE.md index ecbe516..ff35a34 100644 --- a/node_modules/bl/LICENSE.md +++ b/node_modules/bl/LICENSE.md @@ -1,7 +1,7 @@ The MIT License (MIT) ===================== -Copyright (c) 2013-2019 bl contributors +Copyright (c) 2013-2016 bl contributors ---------------------------------- *bl contributors listed at * diff --git a/node_modules/bl/README.md b/node_modules/bl/README.md index 9680b1d..9eebd88 100644 --- a/node_modules/bl/README.md +++ b/node_modules/bl/README.md @@ -1,24 +1,25 @@ # bl *(BufferList)* -[![Build Status](https://api.travis-ci.com/rvagg/bl.svg?branch=master)](https://travis-ci.com/rvagg/bl/) +[![Build Status](https://travis-ci.org/rvagg/bl.svg?branch=master)](https://travis-ci.org/rvagg/bl) **A Node.js Buffer list collector, reader and streamer thingy.** -[![NPM](https://nodei.co/npm/bl.svg)](https://nodei.co/npm/bl/) +[![NPM](https://nodei.co/npm/bl.png?downloads=true&downloadRank=true)](https://nodei.co/npm/bl/) +[![NPM](https://nodei.co/npm-dl/bl.png?months=6&height=3)](https://nodei.co/npm/bl/) **bl** is a storage object for collections of Node Buffers, exposing them with the main Buffer readable API. Also works as a duplex stream so you can collect buffers from a stream that emits them and emit buffers to a stream that consumes them! The original buffers are kept intact and copies are only done as necessary. Any reads that require the use of a single original buffer will return a slice of that buffer only (which references the same memory as the original buffer). Reads that span buffers perform concatenation as required and return the results transparently. ```js -const { BufferList } = require('bl') +const BufferList = require('bl') -const bl = new BufferList() -bl.append(Buffer.from('abcd')) -bl.append(Buffer.from('efg')) +var bl = new BufferList() +bl.append(new Buffer('abcd')) +bl.append(new Buffer('efg')) bl.append('hi') // bl will also accept & convert Strings -bl.append(Buffer.from('j')) -bl.append(Buffer.from([ 0x3, 0x4 ])) +bl.append(new Buffer('j')) +bl.append(new Buffer([ 0x3, 0x4 ])) console.log(bl.length) // 12 @@ -28,9 +29,6 @@ console.log(bl.slice(3, 6).toString('ascii')) // 'def' console.log(bl.slice(3, 8).toString('ascii')) // 'defgh' console.log(bl.slice(5, 10).toString('ascii')) // 'fghij' -console.log(bl.indexOf('def')) // 3 -console.log(bl.indexOf('asdf')) // -1 - // or just use toString! console.log(bl.toString()) // 'abcdefghij\u0003\u0004' console.log(bl.toString('ascii', 3, 8)) // 'defgh' @@ -44,11 +42,11 @@ console.log(bl.readUInt16LE(10)) // 0x0403 Give it a callback in the constructor and use it just like **[concat-stream](https://github.com/maxogden/node-concat-stream)**: ```js -const { BufferListStream } = require('bl') -const fs = require('fs') +const bl = require('bl') + , fs = require('fs') fs.createReadStream('README.md') - .pipe(BufferListStream((err, data) => { // note 'new' isn't strictly required + .pipe(bl(function (err, data) { // note 'new' isn't strictly required // `data` is a complete Buffer object containing the full data console.log(data.toString()) })) @@ -57,14 +55,12 @@ fs.createReadStream('README.md') Note that when you use the *callback* method like this, the resulting `data` parameter is a concatenation of all `Buffer` objects in the list. If you want to avoid the overhead of this concatenation (in cases of extreme performance consciousness), then avoid the *callback* method and just listen to `'end'` instead, like a standard Stream. Or to fetch a URL using [hyperquest](https://github.com/substack/hyperquest) (should work with [request](http://github.com/mikeal/request) and even plain Node http too!): - ```js const hyperquest = require('hyperquest') -const { BufferListStream } = require('bl') + , bl = require('bl') + , url = 'https://raw.github.com/rvagg/bl/master/README.md' -const url = 'https://raw.github.com/rvagg/bl/master/README.md' - -hyperquest(url).pipe(BufferListStream((err, data) => { +hyperquest(url).pipe(bl(function (err, data) { console.log(data.toString()) })) ``` @@ -72,26 +68,24 @@ hyperquest(url).pipe(BufferListStream((err, data) => { Or, use it as a readable stream to recompose a list of Buffers to an output source: ```js -const { BufferListStream } = require('bl') -const fs = require('fs') +const BufferList = require('bl') + , fs = require('fs') -var bl = new BufferListStream() -bl.append(Buffer.from('abcd')) -bl.append(Buffer.from('efg')) -bl.append(Buffer.from('hi')) -bl.append(Buffer.from('j')) +var bl = new BufferList() +bl.append(new Buffer('abcd')) +bl.append(new Buffer('efg')) +bl.append(new Buffer('hi')) +bl.append(new Buffer('j')) bl.pipe(fs.createWriteStream('gibberish.txt')) ``` ## API - * new BufferList([ buf ]) - * BufferList.isBufferList(obj) + * new BufferList([ callback ]) * bl.length * bl.append(buffer) * bl.get(index) - * bl.indexOf(value[, byteOffset][, encoding]) * bl.slice([ start[, end ] ]) * bl.shallowSlice([ start[, end ] ]) * bl.copy(dest, [ destStart, [ srcStart [, srcEnd ] ] ]) @@ -99,32 +93,27 @@ bl.pipe(fs.createWriteStream('gibberish.txt')) * bl.consume(bytes) * bl.toString([encoding, [ start, [ end ]]]) * bl.readDoubleBE(), bl.readDoubleLE(), bl.readFloatBE(), bl.readFloatLE(), bl.readInt32BE(), bl.readInt32LE(), bl.readUInt32BE(), bl.readUInt32LE(), bl.readInt16BE(), bl.readInt16LE(), bl.readUInt16BE(), bl.readUInt16LE(), bl.readInt8(), bl.readUInt8() - * new BufferListStream([ callback ]) + * Streams -------------------------------------------------------- -### new BufferList([ Buffer | Buffer array | BufferList | BufferList array | String ]) -No arguments are _required_ for the constructor, but you can initialise the list by passing in a single `Buffer` object or an array of `Buffer` objects. +### new BufferList([ callback | Buffer | Buffer array | BufferList | BufferList array | String ]) +The constructor takes an optional callback, if supplied, the callback will be called with an error argument followed by a reference to the **bl** instance, when `bl.end()` is called (i.e. from a piped stream). This is a convenient method of collecting the entire contents of a stream, particularly when the stream is *chunky*, such as a network stream. + +Normally, no arguments are required for the constructor, but you can initialise the list by passing in a single `Buffer` object or an array of `Buffer` object. `new` is not strictly required, if you don't instantiate a new object, it will be done automatically for you so you can create a new instance simply with: ```js -const { BufferList } = require('bl') -const bl = BufferList() +var bl = require('bl') +var myinstance = bl() // equivalent to: -const { BufferList } = require('bl') -const bl = new BufferList() +var BufferList = require('bl') +var myinstance = new BufferList() ``` --------------------------------------------------------- - -### BufferList.isBufferList(obj) -Determines if the passed object is a `BufferList`. It will return `true` if the passed object is an instance of `BufferList` **or** `BufferListStream` and `false` otherwise. - -N.B. this won't return `true` for `BufferList` or `BufferListStream` instances created by versions of this library before this static method was added. - -------------------------------------------------------- ### bl.length @@ -140,12 +129,6 @@ Get the length of the list in bytes. This is the sum of the lengths of all of th ### bl.get(index) `get()` will return the byte at the specified index. --------------------------------------------------------- - -### bl.indexOf(value[, byteOffset][, encoding]) -`get()` will return the byte at the specified index. -`indexOf()` method returns the first index at which a given element can be found in the BufferList, or -1 if it is not present. - -------------------------------------------------------- ### bl.slice([ start, [ end ] ]) @@ -171,7 +154,7 @@ No copies will be performed. All buffers in the result share memory with the ori `duplicate()` performs a **shallow-copy** of the list. The internal Buffers remains the same, so if you change the underlying Buffers, the change will be reflected in both the original and the duplicate. This method is needed if you want to call `consume()` or `pipe()` and still keep the original list.Example: ```js -var bl = new BufferListStream() +var bl = new BufferList() bl.append('hello') bl.append(' world') @@ -201,33 +184,9 @@ All of the standard byte-reading methods of the `Buffer` interface are implement See the [Buffer](http://nodejs.org/docs/latest/api/buffer.html) documentation for how these work. -------------------------------------------------------- - -### new BufferListStream([ callback | Buffer | Buffer array | BufferList | BufferList array | String ]) -**BufferListStream** is a Node **[Duplex Stream](http://nodejs.org/docs/latest/api/stream.html#stream_class_stream_duplex)**, so it can be read from and written to like a standard Node stream. You can also `pipe()` to and from a **BufferListStream** instance. - -The constructor takes an optional callback, if supplied, the callback will be called with an error argument followed by a reference to the **bl** instance, when `bl.end()` is called (i.e. from a piped stream). This is a convenient method of collecting the entire contents of a stream, particularly when the stream is *chunky*, such as a network stream. - -Normally, no arguments are required for the constructor, but you can initialise the list by passing in a single `Buffer` object or an array of `Buffer` object. - -`new` is not strictly required, if you don't instantiate a new object, it will be done automatically for you so you can create a new instance simply with: - -```js -const { BufferListStream } = require('bl') -const bl = BufferListStream() - -// equivalent to: - -const { BufferListStream } = require('bl') -const bl = new BufferListStream() -``` - -N.B. For backwards compatibility reasons, `BufferListStream` is the **default** export when you `require('bl')`: - -```js -const { BufferListStream } = require('bl') -// equivalent to: -const BufferListStream = require('bl') -``` + +### Streams +**bl** is a Node **[Duplex Stream](http://nodejs.org/docs/latest/api/stream.html#stream_class_stream_duplex)**, so it can be read from and written to like a standard Node stream. You can also `pipe()` to and from a **bl** instance. -------------------------------------------------------- @@ -239,9 +198,11 @@ const BufferListStream = require('bl') * [Matteo Collina](https://github.com/mcollina) * [Jarett Cruger](https://github.com/jcrugzz) +======= + ## License & copyright -Copyright (c) 2013-2019 bl contributors (listed above). +Copyright (c) 2013-2016 bl contributors (listed above). bl is licensed under the MIT license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE.md file for more details. diff --git a/node_modules/bl/bl.js b/node_modules/bl/bl.js index 40228f8..0c8de18 100644 --- a/node_modules/bl/bl.js +++ b/node_modules/bl/bl.js @@ -1,18 +1,19 @@ -'use strict' +var DuplexStream = require('readable-stream/duplex') + , util = require('util') + , Buffer = require('safe-buffer').Buffer -const DuplexStream = require('readable-stream').Duplex -const inherits = require('inherits') -const BufferList = require('./BufferList') -function BufferListStream (callback) { - if (!(this instanceof BufferListStream)) { - return new BufferListStream(callback) - } +function BufferList (callback) { + if (!(this instanceof BufferList)) + return new BufferList(callback) - if (typeof callback === 'function') { + this._bufs = [] + this.length = 0 + + if (typeof callback == 'function') { this._callback = callback - const piper = function piper (err) { + var piper = function piper (err) { if (this._callback) { this._callback(err) this._callback = null @@ -25,40 +26,79 @@ function BufferListStream (callback) { this.on('unpipe', function onUnpipe (src) { src.removeListener('error', piper) }) - - callback = null + } else { + this.append(callback) } - BufferList._init.call(this, callback) DuplexStream.call(this) } -inherits(BufferListStream, DuplexStream) -Object.assign(BufferListStream.prototype, BufferList.prototype) -BufferListStream.prototype._new = function _new (callback) { - return new BufferListStream(callback) +util.inherits(BufferList, DuplexStream) + + +BufferList.prototype._offset = function _offset (offset) { + var tot = 0, i = 0, _t + if (offset === 0) return [ 0, 0 ] + for (; i < this._bufs.length; i++) { + _t = tot + this._bufs[i].length + if (offset < _t || i == this._bufs.length - 1) + return [ i, offset - tot ] + tot = _t + } } -BufferListStream.prototype._write = function _write (buf, encoding, callback) { + +BufferList.prototype.append = function append (buf) { + var i = 0 + + if (Buffer.isBuffer(buf)) { + this._appendBuffer(buf); + } else if (Array.isArray(buf)) { + for (; i < buf.length; i++) + this.append(buf[i]) + } else if (buf instanceof BufferList) { + // unwrap argument into individual BufferLists + for (; i < buf._bufs.length; i++) + this.append(buf._bufs[i]) + } else if (buf != null) { + // coerce number arguments to strings, since Buffer(number) does + // uninitialized memory allocation + if (typeof buf == 'number') + buf = buf.toString() + + this._appendBuffer(Buffer.from(buf)); + } + + return this +} + + +BufferList.prototype._appendBuffer = function appendBuffer (buf) { + this._bufs.push(buf) + this.length += buf.length +} + + +BufferList.prototype._write = function _write (buf, encoding, callback) { this._appendBuffer(buf) - if (typeof callback === 'function') { + if (typeof callback == 'function') callback() - } } -BufferListStream.prototype._read = function _read (size) { - if (!this.length) { + +BufferList.prototype._read = function _read (size) { + if (!this.length) return this.push(null) - } size = Math.min(size, this.length) this.push(this.slice(0, size)) this.consume(size) } -BufferListStream.prototype.end = function end (chunk) { + +BufferList.prototype.end = function end (chunk) { DuplexStream.prototype.end.call(this, chunk) if (this._callback) { @@ -67,18 +107,184 @@ BufferListStream.prototype.end = function end (chunk) { } } -BufferListStream.prototype._destroy = function _destroy (err, cb) { + +BufferList.prototype.get = function get (index) { + return this.slice(index, index + 1)[0] +} + + +BufferList.prototype.slice = function slice (start, end) { + if (typeof start == 'number' && start < 0) + start += this.length + if (typeof end == 'number' && end < 0) + end += this.length + return this.copy(null, 0, start, end) +} + + +BufferList.prototype.copy = function copy (dst, dstStart, srcStart, srcEnd) { + if (typeof srcStart != 'number' || srcStart < 0) + srcStart = 0 + if (typeof srcEnd != 'number' || srcEnd > this.length) + srcEnd = this.length + if (srcStart >= this.length) + return dst || Buffer.alloc(0) + if (srcEnd <= 0) + return dst || Buffer.alloc(0) + + var copy = !!dst + , off = this._offset(srcStart) + , len = srcEnd - srcStart + , bytes = len + , bufoff = (copy && dstStart) || 0 + , start = off[1] + , l + , i + + // copy/slice everything + if (srcStart === 0 && srcEnd == this.length) { + if (!copy) { // slice, but full concat if multiple buffers + return this._bufs.length === 1 + ? this._bufs[0] + : Buffer.concat(this._bufs, this.length) + } + + // copy, need to copy individual buffers + for (i = 0; i < this._bufs.length; i++) { + this._bufs[i].copy(dst, bufoff) + bufoff += this._bufs[i].length + } + + return dst + } + + // easy, cheap case where it's a subset of one of the buffers + if (bytes <= this._bufs[off[0]].length - start) { + return copy + ? this._bufs[off[0]].copy(dst, dstStart, start, start + bytes) + : this._bufs[off[0]].slice(start, start + bytes) + } + + if (!copy) // a slice, we need something to copy in to + dst = Buffer.allocUnsafe(len) + + for (i = off[0]; i < this._bufs.length; i++) { + l = this._bufs[i].length - start + + if (bytes > l) { + this._bufs[i].copy(dst, bufoff, start) + bufoff += l + } else { + this._bufs[i].copy(dst, bufoff, start, start + bytes) + bufoff += l + break + } + + bytes -= l + + if (start) + start = 0 + } + + // safeguard so that we don't return uninitialized memory + if (dst.length > bufoff) return dst.slice(0, bufoff) + + return dst +} + +BufferList.prototype.shallowSlice = function shallowSlice (start, end) { + start = start || 0 + end = end || this.length + + if (start < 0) + start += this.length + if (end < 0) + end += this.length + + var startOffset = this._offset(start) + , endOffset = this._offset(end) + , buffers = this._bufs.slice(startOffset[0], endOffset[0] + 1) + + if (endOffset[1] == 0) + buffers.pop() + else + buffers[buffers.length-1] = buffers[buffers.length-1].slice(0, endOffset[1]) + + if (startOffset[1] != 0) + buffers[0] = buffers[0].slice(startOffset[1]) + + return new BufferList(buffers) +} + +BufferList.prototype.toString = function toString (encoding, start, end) { + return this.slice(start, end).toString(encoding) +} + +BufferList.prototype.consume = function consume (bytes) { + // first, normalize the argument, in accordance with how Buffer does it + bytes = Math.trunc(bytes) + // do nothing if not a positive number + if (Number.isNaN(bytes) || bytes <= 0) return this + + while (this._bufs.length) { + if (bytes >= this._bufs[0].length) { + bytes -= this._bufs[0].length + this.length -= this._bufs[0].length + this._bufs.shift() + } else { + this._bufs[0] = this._bufs[0].slice(bytes) + this.length -= bytes + break + } + } + return this +} + + +BufferList.prototype.duplicate = function duplicate () { + var i = 0 + , copy = new BufferList() + + for (; i < this._bufs.length; i++) + copy.append(this._bufs[i]) + + return copy +} + + +BufferList.prototype.destroy = function destroy () { this._bufs.length = 0 this.length = 0 - cb(err) + this.push(null) } -BufferListStream.prototype._isBufferList = function _isBufferList (b) { - return b instanceof BufferListStream || b instanceof BufferList || BufferListStream.isBufferList(b) -} -BufferListStream.isBufferList = BufferList.isBufferList +;(function () { + var methods = { + 'readDoubleBE' : 8 + , 'readDoubleLE' : 8 + , 'readFloatBE' : 4 + , 'readFloatLE' : 4 + , 'readInt32BE' : 4 + , 'readInt32LE' : 4 + , 'readUInt32BE' : 4 + , 'readUInt32LE' : 4 + , 'readInt16BE' : 2 + , 'readInt16LE' : 2 + , 'readUInt16BE' : 2 + , 'readUInt16LE' : 2 + , 'readInt8' : 1 + , 'readUInt8' : 1 + } -module.exports = BufferListStream -module.exports.BufferListStream = BufferListStream -module.exports.BufferList = BufferList + for (var m in methods) { + (function (m) { + BufferList.prototype[m] = function (offset) { + return this.slice(offset, offset + methods[m])[m](0) + } + }(m)) + } +}()) + + +module.exports = BufferList diff --git a/node_modules/bl/node_modules/readable-stream/CONTRIBUTING.md b/node_modules/bl/node_modules/readable-stream/CONTRIBUTING.md deleted file mode 100644 index f478d58..0000000 --- a/node_modules/bl/node_modules/readable-stream/CONTRIBUTING.md +++ /dev/null @@ -1,38 +0,0 @@ -# Developer's Certificate of Origin 1.1 - -By making a contribution to this project, I certify that: - -* (a) The contribution was created in whole or in part by me and I - have the right to submit it under the open source license - indicated in the file; or - -* (b) The contribution is based upon previous work that, to the best - of my knowledge, is covered under an appropriate open source - license and I have the right under that license to submit that - work with modifications, whether created in whole or in part - by me, under the same open source license (unless I am - permitted to submit under a different license), as indicated - in the file; or - -* (c) The contribution was provided directly to me by some other - person who certified (a), (b) or (c) and I have not modified - it. - -* (d) I understand and agree that this project and the contribution - are public and that a record of the contribution (including all - personal information I submit with it, including my sign-off) is - maintained indefinitely and may be redistributed consistent with - this project or the open source license(s) involved. - -## Moderation Policy - -The [Node.js Moderation Policy] applies to this WG. - -## Code of Conduct - -The [Node.js Code of Conduct][] applies to this WG. - -[Node.js Code of Conduct]: -https://github.com/nodejs/node/blob/master/CODE_OF_CONDUCT.md -[Node.js Moderation Policy]: -https://github.com/nodejs/TSC/blob/master/Moderation-Policy.md diff --git a/node_modules/bl/node_modules/readable-stream/GOVERNANCE.md b/node_modules/bl/node_modules/readable-stream/GOVERNANCE.md deleted file mode 100644 index 16ffb93..0000000 --- a/node_modules/bl/node_modules/readable-stream/GOVERNANCE.md +++ /dev/null @@ -1,136 +0,0 @@ -### Streams Working Group - -The Node.js Streams is jointly governed by a Working Group -(WG) -that is responsible for high-level guidance of the project. - -The WG has final authority over this project including: - -* Technical direction -* Project governance and process (including this policy) -* Contribution policy -* GitHub repository hosting -* Conduct guidelines -* Maintaining the list of additional Collaborators - -For the current list of WG members, see the project -[README.md](./README.md#current-project-team-members). - -### Collaborators - -The readable-stream GitHub repository is -maintained by the WG and additional Collaborators who are added by the -WG on an ongoing basis. - -Individuals making significant and valuable contributions are made -Collaborators and given commit-access to the project. These -individuals are identified by the WG and their addition as -Collaborators is discussed during the WG meeting. - -_Note:_ If you make a significant contribution and are not considered -for commit-access log an issue or contact a WG member directly and it -will be brought up in the next WG meeting. - -Modifications of the contents of the readable-stream repository are -made on -a collaborative basis. Anybody with a GitHub account may propose a -modification via pull request and it will be considered by the project -Collaborators. All pull requests must be reviewed and accepted by a -Collaborator with sufficient expertise who is able to take full -responsibility for the change. In the case of pull requests proposed -by an existing Collaborator, an additional Collaborator is required -for sign-off. Consensus should be sought if additional Collaborators -participate and there is disagreement around a particular -modification. See _Consensus Seeking Process_ below for further detail -on the consensus model used for governance. - -Collaborators may opt to elevate significant or controversial -modifications, or modifications that have not found consensus to the -WG for discussion by assigning the ***WG-agenda*** tag to a pull -request or issue. The WG should serve as the final arbiter where -required. - -For the current list of Collaborators, see the project -[README.md](./README.md#members). - -### WG Membership - -WG seats are not time-limited. There is no fixed size of the WG. -However, the expected target is between 6 and 12, to ensure adequate -coverage of important areas of expertise, balanced with the ability to -make decisions efficiently. - -There is no specific set of requirements or qualifications for WG -membership beyond these rules. - -The WG may add additional members to the WG by unanimous consensus. - -A WG member may be removed from the WG by voluntary resignation, or by -unanimous consensus of all other WG members. - -Changes to WG membership should be posted in the agenda, and may be -suggested as any other agenda item (see "WG Meetings" below). - -If an addition or removal is proposed during a meeting, and the full -WG is not in attendance to participate, then the addition or removal -is added to the agenda for the subsequent meeting. This is to ensure -that all members are given the opportunity to participate in all -membership decisions. If a WG member is unable to attend a meeting -where a planned membership decision is being made, then their consent -is assumed. - -No more than 1/3 of the WG members may be affiliated with the same -employer. If removal or resignation of a WG member, or a change of -employment by a WG member, creates a situation where more than 1/3 of -the WG membership shares an employer, then the situation must be -immediately remedied by the resignation or removal of one or more WG -members affiliated with the over-represented employer(s). - -### WG Meetings - -The WG meets occasionally on a Google Hangout On Air. A designated moderator -approved by the WG runs the meeting. Each meeting should be -published to YouTube. - -Items are added to the WG agenda that are considered contentious or -are modifications of governance, contribution policy, WG membership, -or release process. - -The intention of the agenda is not to approve or review all patches; -that should happen continuously on GitHub and be handled by the larger -group of Collaborators. - -Any community member or contributor can ask that something be added to -the next meeting's agenda by logging a GitHub Issue. Any Collaborator, -WG member or the moderator can add the item to the agenda by adding -the ***WG-agenda*** tag to the issue. - -Prior to each WG meeting the moderator will share the Agenda with -members of the WG. WG members can add any items they like to the -agenda at the beginning of each meeting. The moderator and the WG -cannot veto or remove items. - -The WG may invite persons or representatives from certain projects to -participate in a non-voting capacity. - -The moderator is responsible for summarizing the discussion of each -agenda item and sends it as a pull request after the meeting. - -### Consensus Seeking Process - -The WG follows a -[Consensus -Seeking](http://en.wikipedia.org/wiki/Consensus-seeking_decision-making) -decision-making model. - -When an agenda item has appeared to reach a consensus the moderator -will ask "Does anyone object?" as a final call for dissent from the -consensus. - -If an agenda item cannot reach a consensus a WG member can call for -either a closing vote or a vote to table the issue to the next -meeting. The call for a vote must be seconded by a majority of the WG -or else the discussion will continue. Simple majority wins. - -Note that changes to WG membership require a majority consensus. See -"WG Membership" above. diff --git a/node_modules/bl/node_modules/readable-stream/LICENSE b/node_modules/bl/node_modules/readable-stream/LICENSE deleted file mode 100644 index 2873b3b..0000000 --- a/node_modules/bl/node_modules/readable-stream/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Node.js is licensed for use as follows: - -""" -Copyright Node.js contributors. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" - -This license applies to parts of Node.js originating from the -https://github.com/joyent/node repository: - -""" -Copyright Joyent, Inc. and other Node contributors. All rights reserved. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" diff --git a/node_modules/bl/node_modules/readable-stream/README.md b/node_modules/bl/node_modules/readable-stream/README.md deleted file mode 100644 index 19117c1..0000000 --- a/node_modules/bl/node_modules/readable-stream/README.md +++ /dev/null @@ -1,106 +0,0 @@ -# readable-stream - -***Node.js core streams for userland*** [![Build Status](https://travis-ci.com/nodejs/readable-stream.svg?branch=master)](https://travis-ci.com/nodejs/readable-stream) - - -[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/) -[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/) - - -[![Sauce Test Status](https://saucelabs.com/browser-matrix/readabe-stream.svg)](https://saucelabs.com/u/readabe-stream) - -```bash -npm install --save readable-stream -``` - -This package is a mirror of the streams implementations in Node.js. - -Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v10.18.1/docs/api/stream.html). - -If you want to guarantee a stable streams base, regardless of what version of -Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html). - -As of version 2.0.0 **readable-stream** uses semantic versioning. - -## Version 3.x.x - -v3.x.x of `readable-stream` is a cut from Node 10. This version supports Node 6, 8, and 10, as well as evergreen browsers, IE 11 and latest Safari. The breaking changes introduced by v3 are composed by the combined breaking changes in [Node v9](https://nodejs.org/en/blog/release/v9.0.0/) and [Node v10](https://nodejs.org/en/blog/release/v10.0.0/), as follows: - -1. Error codes: https://github.com/nodejs/node/pull/13310, - https://github.com/nodejs/node/pull/13291, - https://github.com/nodejs/node/pull/16589, - https://github.com/nodejs/node/pull/15042, - https://github.com/nodejs/node/pull/15665, - https://github.com/nodejs/readable-stream/pull/344 -2. 'readable' have precedence over flowing - https://github.com/nodejs/node/pull/18994 -3. make virtual methods errors consistent - https://github.com/nodejs/node/pull/18813 -4. updated streams error handling - https://github.com/nodejs/node/pull/18438 -5. writable.end should return this. - https://github.com/nodejs/node/pull/18780 -6. readable continues to read when push('') - https://github.com/nodejs/node/pull/18211 -7. add custom inspect to BufferList - https://github.com/nodejs/node/pull/17907 -8. always defer 'readable' with nextTick - https://github.com/nodejs/node/pull/17979 - -## Version 2.x.x -v2.x.x of `readable-stream` is a cut of the stream module from Node 8 (there have been no semver-major changes from Node 4 to 8). This version supports all Node.js versions from 0.8, as well as evergreen browsers and IE 10 & 11. - -### Big Thanks - -Cross-browser Testing Platform and Open Source <3 Provided by [Sauce Labs][sauce] - -# Usage - -You can swap your `require('stream')` with `require('readable-stream')` -without any changes, if you are just using one of the main classes and -functions. - -```js -const { - Readable, - Writable, - Transform, - Duplex, - pipeline, - finished -} = require('readable-stream') -```` - -Note that `require('stream')` will return `Stream`, while -`require('readable-stream')` will return `Readable`. We discourage using -whatever is exported directly, but rather use one of the properties as -shown in the example above. - -# Streams Working Group - -`readable-stream` is maintained by the Streams Working Group, which -oversees the development and maintenance of the Streams API within -Node.js. The responsibilities of the Streams Working Group include: - -* Addressing stream issues on the Node.js issue tracker. -* Authoring and editing stream documentation within the Node.js project. -* Reviewing changes to stream subclasses within the Node.js project. -* Redirecting changes to streams from the Node.js project to this - project. -* Assisting in the implementation of stream providers within Node.js. -* Recommending versions of `readable-stream` to be included in Node.js. -* Messaging about the future of streams to give the community advance - notice of changes. - - -## Team Members - -* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) <calvin.metcalf@gmail.com> - - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242 -* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) <mathiasbuus@gmail.com> -* **Matteo Collina** ([@mcollina](https://github.com/mcollina)) <matteo.collina@gmail.com> - - Release GPG key: 3ABC01543F22DD2239285CDD818674489FBC127E -* **Irina Shestak** ([@lrlna](https://github.com/lrlna)) <shestak.irina@gmail.com> -* **Yoshua Wyuts** ([@yoshuawuyts](https://github.com/yoshuawuyts)) <yoshuawuyts@gmail.com> - -[sauce]: https://saucelabs.com diff --git a/node_modules/bl/node_modules/readable-stream/errors-browser.js b/node_modules/bl/node_modules/readable-stream/errors-browser.js deleted file mode 100644 index fb8e73e..0000000 --- a/node_modules/bl/node_modules/readable-stream/errors-browser.js +++ /dev/null @@ -1,127 +0,0 @@ -'use strict'; - -function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } - -var codes = {}; - -function createErrorType(code, message, Base) { - if (!Base) { - Base = Error; - } - - function getMessage(arg1, arg2, arg3) { - if (typeof message === 'string') { - return message; - } else { - return message(arg1, arg2, arg3); - } - } - - var NodeError = - /*#__PURE__*/ - function (_Base) { - _inheritsLoose(NodeError, _Base); - - function NodeError(arg1, arg2, arg3) { - return _Base.call(this, getMessage(arg1, arg2, arg3)) || this; - } - - return NodeError; - }(Base); - - NodeError.prototype.name = Base.name; - NodeError.prototype.code = code; - codes[code] = NodeError; -} // https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js - - -function oneOf(expected, thing) { - if (Array.isArray(expected)) { - var len = expected.length; - expected = expected.map(function (i) { - return String(i); - }); - - if (len > 2) { - return "one of ".concat(thing, " ").concat(expected.slice(0, len - 1).join(', '), ", or ") + expected[len - 1]; - } else if (len === 2) { - return "one of ".concat(thing, " ").concat(expected[0], " or ").concat(expected[1]); - } else { - return "of ".concat(thing, " ").concat(expected[0]); - } - } else { - return "of ".concat(thing, " ").concat(String(expected)); - } -} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith - - -function startsWith(str, search, pos) { - return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search; -} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith - - -function endsWith(str, search, this_len) { - if (this_len === undefined || this_len > str.length) { - this_len = str.length; - } - - return str.substring(this_len - search.length, this_len) === search; -} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes - - -function includes(str, search, start) { - if (typeof start !== 'number') { - start = 0; - } - - if (start + search.length > str.length) { - return false; - } else { - return str.indexOf(search, start) !== -1; - } -} - -createErrorType('ERR_INVALID_OPT_VALUE', function (name, value) { - return 'The value "' + value + '" is invalid for option "' + name + '"'; -}, TypeError); -createErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) { - // determiner: 'must be' or 'must not be' - var determiner; - - if (typeof expected === 'string' && startsWith(expected, 'not ')) { - determiner = 'must not be'; - expected = expected.replace(/^not /, ''); - } else { - determiner = 'must be'; - } - - var msg; - - if (endsWith(name, ' argument')) { - // For cases like 'first argument' - msg = "The ".concat(name, " ").concat(determiner, " ").concat(oneOf(expected, 'type')); - } else { - var type = includes(name, '.') ? 'property' : 'argument'; - msg = "The \"".concat(name, "\" ").concat(type, " ").concat(determiner, " ").concat(oneOf(expected, 'type')); - } - - msg += ". Received type ".concat(typeof actual); - return msg; -}, TypeError); -createErrorType('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF'); -createErrorType('ERR_METHOD_NOT_IMPLEMENTED', function (name) { - return 'The ' + name + ' method is not implemented'; -}); -createErrorType('ERR_STREAM_PREMATURE_CLOSE', 'Premature close'); -createErrorType('ERR_STREAM_DESTROYED', function (name) { - return 'Cannot call ' + name + ' after a stream was destroyed'; -}); -createErrorType('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times'); -createErrorType('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable'); -createErrorType('ERR_STREAM_WRITE_AFTER_END', 'write after end'); -createErrorType('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError); -createErrorType('ERR_UNKNOWN_ENCODING', function (arg) { - return 'Unknown encoding: ' + arg; -}, TypeError); -createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event'); -module.exports.codes = codes; diff --git a/node_modules/bl/node_modules/readable-stream/errors.js b/node_modules/bl/node_modules/readable-stream/errors.js deleted file mode 100644 index 8471526..0000000 --- a/node_modules/bl/node_modules/readable-stream/errors.js +++ /dev/null @@ -1,116 +0,0 @@ -'use strict'; - -const codes = {}; - -function createErrorType(code, message, Base) { - if (!Base) { - Base = Error - } - - function getMessage (arg1, arg2, arg3) { - if (typeof message === 'string') { - return message - } else { - return message(arg1, arg2, arg3) - } - } - - class NodeError extends Base { - constructor (arg1, arg2, arg3) { - super(getMessage(arg1, arg2, arg3)); - } - } - - NodeError.prototype.name = Base.name; - NodeError.prototype.code = code; - - codes[code] = NodeError; -} - -// https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js -function oneOf(expected, thing) { - if (Array.isArray(expected)) { - const len = expected.length; - expected = expected.map((i) => String(i)); - if (len > 2) { - return `one of ${thing} ${expected.slice(0, len - 1).join(', ')}, or ` + - expected[len - 1]; - } else if (len === 2) { - return `one of ${thing} ${expected[0]} or ${expected[1]}`; - } else { - return `of ${thing} ${expected[0]}`; - } - } else { - return `of ${thing} ${String(expected)}`; - } -} - -// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith -function startsWith(str, search, pos) { - return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search; -} - -// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith -function endsWith(str, search, this_len) { - if (this_len === undefined || this_len > str.length) { - this_len = str.length; - } - return str.substring(this_len - search.length, this_len) === search; -} - -// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes -function includes(str, search, start) { - if (typeof start !== 'number') { - start = 0; - } - - if (start + search.length > str.length) { - return false; - } else { - return str.indexOf(search, start) !== -1; - } -} - -createErrorType('ERR_INVALID_OPT_VALUE', function (name, value) { - return 'The value "' + value + '" is invalid for option "' + name + '"' -}, TypeError); -createErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) { - // determiner: 'must be' or 'must not be' - let determiner; - if (typeof expected === 'string' && startsWith(expected, 'not ')) { - determiner = 'must not be'; - expected = expected.replace(/^not /, ''); - } else { - determiner = 'must be'; - } - - let msg; - if (endsWith(name, ' argument')) { - // For cases like 'first argument' - msg = `The ${name} ${determiner} ${oneOf(expected, 'type')}`; - } else { - const type = includes(name, '.') ? 'property' : 'argument'; - msg = `The "${name}" ${type} ${determiner} ${oneOf(expected, 'type')}`; - } - - msg += `. Received type ${typeof actual}`; - return msg; -}, TypeError); -createErrorType('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF'); -createErrorType('ERR_METHOD_NOT_IMPLEMENTED', function (name) { - return 'The ' + name + ' method is not implemented' -}); -createErrorType('ERR_STREAM_PREMATURE_CLOSE', 'Premature close'); -createErrorType('ERR_STREAM_DESTROYED', function (name) { - return 'Cannot call ' + name + ' after a stream was destroyed'; -}); -createErrorType('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times'); -createErrorType('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable'); -createErrorType('ERR_STREAM_WRITE_AFTER_END', 'write after end'); -createErrorType('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError); -createErrorType('ERR_UNKNOWN_ENCODING', function (arg) { - return 'Unknown encoding: ' + arg -}, TypeError); -createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event'); - -module.exports.codes = codes; diff --git a/node_modules/bl/node_modules/readable-stream/experimentalWarning.js b/node_modules/bl/node_modules/readable-stream/experimentalWarning.js deleted file mode 100644 index 78e8414..0000000 --- a/node_modules/bl/node_modules/readable-stream/experimentalWarning.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict' - -var experimentalWarnings = new Set(); - -function emitExperimentalWarning(feature) { - if (experimentalWarnings.has(feature)) return; - var msg = feature + ' is an experimental feature. This feature could ' + - 'change at any time'; - experimentalWarnings.add(feature); - process.emitWarning(msg, 'ExperimentalWarning'); -} - -function noop() {} - -module.exports.emitExperimentalWarning = process.emitWarning - ? emitExperimentalWarning - : noop; diff --git a/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js b/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js deleted file mode 100644 index 19abfa6..0000000 --- a/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// a duplex stream is just a stream that is both readable and writable. -// Since JS doesn't have multiple prototypal inheritance, this class -// prototypally inherits from Readable, and then parasitically from -// Writable. - -'use strict'; - -/**/ -var objectKeys = Object.keys || function (obj) { - var keys = []; - for (var key in obj) keys.push(key); - return keys; -}; -/**/ - -module.exports = Duplex; -var Readable = require('./_stream_readable'); -var Writable = require('./_stream_writable'); -require('inherits')(Duplex, Readable); -{ - // Allow the keys array to be GC'ed. - var keys = objectKeys(Writable.prototype); - for (var v = 0; v < keys.length; v++) { - var method = keys[v]; - if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; - } -} -function Duplex(options) { - if (!(this instanceof Duplex)) return new Duplex(options); - Readable.call(this, options); - Writable.call(this, options); - this.allowHalfOpen = true; - if (options) { - if (options.readable === false) this.readable = false; - if (options.writable === false) this.writable = false; - if (options.allowHalfOpen === false) { - this.allowHalfOpen = false; - this.once('end', onend); - } - } -} -Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState.highWaterMark; - } -}); -Object.defineProperty(Duplex.prototype, 'writableBuffer', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState && this._writableState.getBuffer(); - } -}); -Object.defineProperty(Duplex.prototype, 'writableLength', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState.length; - } -}); - -// the no-half-open enforcer -function onend() { - // If the writable side ended, then we're ok. - if (this._writableState.ended) return; - - // no more data can be written. - // But allow more writes to happen in this tick. - process.nextTick(onEndNT, this); -} -function onEndNT(self) { - self.end(); -} -Object.defineProperty(Duplex.prototype, 'destroyed', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - if (this._readableState === undefined || this._writableState === undefined) { - return false; - } - return this._readableState.destroyed && this._writableState.destroyed; - }, - set: function set(value) { - // we ignore the value if the stream - // has not been initialized yet - if (this._readableState === undefined || this._writableState === undefined) { - return; - } - - // backward compatibility, the user is explicitly - // managing destroyed - this._readableState.destroyed = value; - this._writableState.destroyed = value; - } -}); \ No newline at end of file diff --git a/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js b/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js deleted file mode 100644 index 24a6bdd..0000000 --- a/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// a passthrough stream. -// basically just the most minimal sort of Transform stream. -// Every written chunk gets output as-is. - -'use strict'; - -module.exports = PassThrough; -var Transform = require('./_stream_transform'); -require('inherits')(PassThrough, Transform); -function PassThrough(options) { - if (!(this instanceof PassThrough)) return new PassThrough(options); - Transform.call(this, options); -} -PassThrough.prototype._transform = function (chunk, encoding, cb) { - cb(null, chunk); -}; \ No newline at end of file diff --git a/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js b/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js deleted file mode 100644 index df1f608..0000000 --- a/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js +++ /dev/null @@ -1,1027 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -'use strict'; - -module.exports = Readable; - -/**/ -var Duplex; -/**/ - -Readable.ReadableState = ReadableState; - -/**/ -var EE = require('events').EventEmitter; -var EElistenerCount = function EElistenerCount(emitter, type) { - return emitter.listeners(type).length; -}; -/**/ - -/**/ -var Stream = require('./internal/streams/stream'); -/**/ - -var Buffer = require('buffer').Buffer; -var OurUint8Array = (typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {}; -function _uint8ArrayToBuffer(chunk) { - return Buffer.from(chunk); -} -function _isUint8Array(obj) { - return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; -} - -/**/ -var debugUtil = require('util'); -var debug; -if (debugUtil && debugUtil.debuglog) { - debug = debugUtil.debuglog('stream'); -} else { - debug = function debug() {}; -} -/**/ - -var BufferList = require('./internal/streams/buffer_list'); -var destroyImpl = require('./internal/streams/destroy'); -var _require = require('./internal/streams/state'), - getHighWaterMark = _require.getHighWaterMark; -var _require$codes = require('../errors').codes, - ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, - ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF, - ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, - ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; - -// Lazy loaded to improve the startup performance. -var StringDecoder; -var createReadableStreamAsyncIterator; -var from; -require('inherits')(Readable, Stream); -var errorOrDestroy = destroyImpl.errorOrDestroy; -var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; -function prependListener(emitter, event, fn) { - // Sadly this is not cacheable as some libraries bundle their own - // event emitter implementation with them. - if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); - - // This is a hack to make sure that our error handler is attached before any - // userland ones. NEVER DO THIS. This is here only because this code needs - // to continue to work with older versions of Node.js that do not include - // the prependListener() method. The goal is to eventually remove this hack. - if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; -} -function ReadableState(options, stream, isDuplex) { - Duplex = Duplex || require('./_stream_duplex'); - options = options || {}; - - // Duplex streams are both readable and writable, but share - // the same options object. - // However, some cases require setting options to different - // values for the readable and the writable sides of the duplex stream. - // These options can be provided separately as readableXXX and writableXXX. - if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; - - // object stream flag. Used to make read(n) ignore n and to - // make all the buffer merging and length checks go away - this.objectMode = !!options.objectMode; - if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; - - // the point at which it stops calling _read() to fill the buffer - // Note: 0 is a valid value, means "don't call _read preemptively ever" - this.highWaterMark = getHighWaterMark(this, options, 'readableHighWaterMark', isDuplex); - - // A linked list is used to store data chunks instead of an array because the - // linked list can remove elements from the beginning faster than - // array.shift() - this.buffer = new BufferList(); - this.length = 0; - this.pipes = null; - this.pipesCount = 0; - this.flowing = null; - this.ended = false; - this.endEmitted = false; - this.reading = false; - - // a flag to be able to tell if the event 'readable'/'data' is emitted - // immediately, or on a later tick. We set this to true at first, because - // any actions that shouldn't happen until "later" should generally also - // not happen before the first read call. - this.sync = true; - - // whenever we return null, then we set a flag to say - // that we're awaiting a 'readable' event emission. - this.needReadable = false; - this.emittedReadable = false; - this.readableListening = false; - this.resumeScheduled = false; - this.paused = true; - - // Should close be emitted on destroy. Defaults to true. - this.emitClose = options.emitClose !== false; - - // Should .destroy() be called after 'end' (and potentially 'finish') - this.autoDestroy = !!options.autoDestroy; - - // has it been destroyed - this.destroyed = false; - - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; - - // the number of writers that are awaiting a drain event in .pipe()s - this.awaitDrain = 0; - - // if true, a maybeReadMore has been scheduled - this.readingMore = false; - this.decoder = null; - this.encoding = null; - if (options.encoding) { - if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; - this.decoder = new StringDecoder(options.encoding); - this.encoding = options.encoding; - } -} -function Readable(options) { - Duplex = Duplex || require('./_stream_duplex'); - if (!(this instanceof Readable)) return new Readable(options); - - // Checking for a Stream.Duplex instance is faster here instead of inside - // the ReadableState constructor, at least with V8 6.5 - var isDuplex = this instanceof Duplex; - this._readableState = new ReadableState(options, this, isDuplex); - - // legacy - this.readable = true; - if (options) { - if (typeof options.read === 'function') this._read = options.read; - if (typeof options.destroy === 'function') this._destroy = options.destroy; - } - Stream.call(this); -} -Object.defineProperty(Readable.prototype, 'destroyed', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - if (this._readableState === undefined) { - return false; - } - return this._readableState.destroyed; - }, - set: function set(value) { - // we ignore the value if the stream - // has not been initialized yet - if (!this._readableState) { - return; - } - - // backward compatibility, the user is explicitly - // managing destroyed - this._readableState.destroyed = value; - } -}); -Readable.prototype.destroy = destroyImpl.destroy; -Readable.prototype._undestroy = destroyImpl.undestroy; -Readable.prototype._destroy = function (err, cb) { - cb(err); -}; - -// Manually shove something into the read() buffer. -// This returns true if the highWaterMark has not been hit yet, -// similar to how Writable.write() returns true if you should -// write() some more. -Readable.prototype.push = function (chunk, encoding) { - var state = this._readableState; - var skipChunkCheck; - if (!state.objectMode) { - if (typeof chunk === 'string') { - encoding = encoding || state.defaultEncoding; - if (encoding !== state.encoding) { - chunk = Buffer.from(chunk, encoding); - encoding = ''; - } - skipChunkCheck = true; - } - } else { - skipChunkCheck = true; - } - return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); -}; - -// Unshift should *always* be something directly out of read() -Readable.prototype.unshift = function (chunk) { - return readableAddChunk(this, chunk, null, true, false); -}; -function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { - debug('readableAddChunk', chunk); - var state = stream._readableState; - if (chunk === null) { - state.reading = false; - onEofChunk(stream, state); - } else { - var er; - if (!skipChunkCheck) er = chunkInvalid(state, chunk); - if (er) { - errorOrDestroy(stream, er); - } else if (state.objectMode || chunk && chunk.length > 0) { - if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) { - chunk = _uint8ArrayToBuffer(chunk); - } - if (addToFront) { - if (state.endEmitted) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());else addChunk(stream, state, chunk, true); - } else if (state.ended) { - errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF()); - } else if (state.destroyed) { - return false; - } else { - state.reading = false; - if (state.decoder && !encoding) { - chunk = state.decoder.write(chunk); - if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state); - } else { - addChunk(stream, state, chunk, false); - } - } - } else if (!addToFront) { - state.reading = false; - maybeReadMore(stream, state); - } - } - - // We can push more data if we are below the highWaterMark. - // Also, if we have no data yet, we can stand some more bytes. - // This is to work around cases where hwm=0, such as the repl. - return !state.ended && (state.length < state.highWaterMark || state.length === 0); -} -function addChunk(stream, state, chunk, addToFront) { - if (state.flowing && state.length === 0 && !state.sync) { - state.awaitDrain = 0; - stream.emit('data', chunk); - } else { - // update the buffer info. - state.length += state.objectMode ? 1 : chunk.length; - if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); - if (state.needReadable) emitReadable(stream); - } - maybeReadMore(stream, state); -} -function chunkInvalid(state, chunk) { - var er; - if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { - er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk); - } - return er; -} -Readable.prototype.isPaused = function () { - return this._readableState.flowing === false; -}; - -// backwards compatibility. -Readable.prototype.setEncoding = function (enc) { - if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; - var decoder = new StringDecoder(enc); - this._readableState.decoder = decoder; - // If setEncoding(null), decoder.encoding equals utf8 - this._readableState.encoding = this._readableState.decoder.encoding; - - // Iterate over current buffer to convert already stored Buffers: - var p = this._readableState.buffer.head; - var content = ''; - while (p !== null) { - content += decoder.write(p.data); - p = p.next; - } - this._readableState.buffer.clear(); - if (content !== '') this._readableState.buffer.push(content); - this._readableState.length = content.length; - return this; -}; - -// Don't raise the hwm > 1GB -var MAX_HWM = 0x40000000; -function computeNewHighWaterMark(n) { - if (n >= MAX_HWM) { - // TODO(ronag): Throw ERR_VALUE_OUT_OF_RANGE. - n = MAX_HWM; - } else { - // Get the next highest power of 2 to prevent increasing hwm excessively in - // tiny amounts - n--; - n |= n >>> 1; - n |= n >>> 2; - n |= n >>> 4; - n |= n >>> 8; - n |= n >>> 16; - n++; - } - return n; -} - -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function howMuchToRead(n, state) { - if (n <= 0 || state.length === 0 && state.ended) return 0; - if (state.objectMode) return 1; - if (n !== n) { - // Only flow one buffer at a time - if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; - } - // If we're asking for more than the current hwm, then raise the hwm. - if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); - if (n <= state.length) return n; - // Don't have enough - if (!state.ended) { - state.needReadable = true; - return 0; - } - return state.length; -} - -// you can override either this method, or the async _read(n) below. -Readable.prototype.read = function (n) { - debug('read', n); - n = parseInt(n, 10); - var state = this._readableState; - var nOrig = n; - if (n !== 0) state.emittedReadable = false; - - // if we're doing read(0) to trigger a readable event, but we - // already have a bunch of data in the buffer, then just trigger - // the 'readable' event and move on. - if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) { - debug('read: emitReadable', state.length, state.ended); - if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); - return null; - } - n = howMuchToRead(n, state); - - // if we've ended, and we're now clear, then finish it up. - if (n === 0 && state.ended) { - if (state.length === 0) endReadable(this); - return null; - } - - // All the actual chunk generation logic needs to be - // *below* the call to _read. The reason is that in certain - // synthetic stream cases, such as passthrough streams, _read - // may be a completely synchronous operation which may change - // the state of the read buffer, providing enough data when - // before there was *not* enough. - // - // So, the steps are: - // 1. Figure out what the state of things will be after we do - // a read from the buffer. - // - // 2. If that resulting state will trigger a _read, then call _read. - // Note that this may be asynchronous, or synchronous. Yes, it is - // deeply ugly to write APIs this way, but that still doesn't mean - // that the Readable class should behave improperly, as streams are - // designed to be sync/async agnostic. - // Take note if the _read call is sync or async (ie, if the read call - // has returned yet), so that we know whether or not it's safe to emit - // 'readable' etc. - // - // 3. Actually pull the requested chunks out of the buffer and return. - - // if we need a readable event, then we need to do some reading. - var doRead = state.needReadable; - debug('need readable', doRead); - - // if we currently have less than the highWaterMark, then also read some - if (state.length === 0 || state.length - n < state.highWaterMark) { - doRead = true; - debug('length less than watermark', doRead); - } - - // however, if we've ended, then there's no point, and if we're already - // reading, then it's unnecessary. - if (state.ended || state.reading) { - doRead = false; - debug('reading or ended', doRead); - } else if (doRead) { - debug('do read'); - state.reading = true; - state.sync = true; - // if the length is currently zero, then we *need* a readable event. - if (state.length === 0) state.needReadable = true; - // call internal read method - this._read(state.highWaterMark); - state.sync = false; - // If _read pushed data synchronously, then `reading` will be false, - // and we need to re-evaluate how much data we can return to the user. - if (!state.reading) n = howMuchToRead(nOrig, state); - } - var ret; - if (n > 0) ret = fromList(n, state);else ret = null; - if (ret === null) { - state.needReadable = state.length <= state.highWaterMark; - n = 0; - } else { - state.length -= n; - state.awaitDrain = 0; - } - if (state.length === 0) { - // If we have nothing in the buffer, then we want to know - // as soon as we *do* get something into the buffer. - if (!state.ended) state.needReadable = true; - - // If we tried to read() past the EOF, then emit end on the next tick. - if (nOrig !== n && state.ended) endReadable(this); - } - if (ret !== null) this.emit('data', ret); - return ret; -}; -function onEofChunk(stream, state) { - debug('onEofChunk'); - if (state.ended) return; - if (state.decoder) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) { - state.buffer.push(chunk); - state.length += state.objectMode ? 1 : chunk.length; - } - } - state.ended = true; - if (state.sync) { - // if we are sync, wait until next tick to emit the data. - // Otherwise we risk emitting data in the flow() - // the readable code triggers during a read() call - emitReadable(stream); - } else { - // emit 'readable' now to make sure it gets picked up. - state.needReadable = false; - if (!state.emittedReadable) { - state.emittedReadable = true; - emitReadable_(stream); - } - } -} - -// Don't emit readable right away in sync mode, because this can trigger -// another read() call => stack overflow. This way, it might trigger -// a nextTick recursion warning, but that's not so bad. -function emitReadable(stream) { - var state = stream._readableState; - debug('emitReadable', state.needReadable, state.emittedReadable); - state.needReadable = false; - if (!state.emittedReadable) { - debug('emitReadable', state.flowing); - state.emittedReadable = true; - process.nextTick(emitReadable_, stream); - } -} -function emitReadable_(stream) { - var state = stream._readableState; - debug('emitReadable_', state.destroyed, state.length, state.ended); - if (!state.destroyed && (state.length || state.ended)) { - stream.emit('readable'); - state.emittedReadable = false; - } - - // The stream needs another readable event if - // 1. It is not flowing, as the flow mechanism will take - // care of it. - // 2. It is not ended. - // 3. It is below the highWaterMark, so we can schedule - // another readable later. - state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark; - flow(stream); -} - -// at this point, the user has presumably seen the 'readable' event, -// and called read() to consume some data. that may have triggered -// in turn another _read(n) call, in which case reading = true if -// it's in progress. -// However, if we're not ended, or reading, and the length < hwm, -// then go ahead and try to read some more preemptively. -function maybeReadMore(stream, state) { - if (!state.readingMore) { - state.readingMore = true; - process.nextTick(maybeReadMore_, stream, state); - } -} -function maybeReadMore_(stream, state) { - // Attempt to read more data if we should. - // - // The conditions for reading more data are (one of): - // - Not enough data buffered (state.length < state.highWaterMark). The loop - // is responsible for filling the buffer with enough data if such data - // is available. If highWaterMark is 0 and we are not in the flowing mode - // we should _not_ attempt to buffer any extra data. We'll get more data - // when the stream consumer calls read() instead. - // - No data in the buffer, and the stream is in flowing mode. In this mode - // the loop below is responsible for ensuring read() is called. Failing to - // call read here would abort the flow and there's no other mechanism for - // continuing the flow if the stream consumer has just subscribed to the - // 'data' event. - // - // In addition to the above conditions to keep reading data, the following - // conditions prevent the data from being read: - // - The stream has ended (state.ended). - // - There is already a pending 'read' operation (state.reading). This is a - // case where the the stream has called the implementation defined _read() - // method, but they are processing the call asynchronously and have _not_ - // called push() with new data. In this case we skip performing more - // read()s. The execution ends in this method again after the _read() ends - // up calling push() with more data. - while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) { - var len = state.length; - debug('maybeReadMore read 0'); - stream.read(0); - if (len === state.length) - // didn't get any data, stop spinning. - break; - } - state.readingMore = false; -} - -// abstract method. to be overridden in specific implementation classes. -// call cb(er, data) where data is <= n in length. -// for virtual (non-string, non-buffer) streams, "length" is somewhat -// arbitrary, and perhaps not very meaningful. -Readable.prototype._read = function (n) { - errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED('_read()')); -}; -Readable.prototype.pipe = function (dest, pipeOpts) { - var src = this; - var state = this._readableState; - switch (state.pipesCount) { - case 0: - state.pipes = dest; - break; - case 1: - state.pipes = [state.pipes, dest]; - break; - default: - state.pipes.push(dest); - break; - } - state.pipesCount += 1; - debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); - var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; - var endFn = doEnd ? onend : unpipe; - if (state.endEmitted) process.nextTick(endFn);else src.once('end', endFn); - dest.on('unpipe', onunpipe); - function onunpipe(readable, unpipeInfo) { - debug('onunpipe'); - if (readable === src) { - if (unpipeInfo && unpipeInfo.hasUnpiped === false) { - unpipeInfo.hasUnpiped = true; - cleanup(); - } - } - } - function onend() { - debug('onend'); - dest.end(); - } - - // when the dest drains, it reduces the awaitDrain counter - // on the source. This would be more elegant with a .once() - // handler in flow(), but adding and removing repeatedly is - // too slow. - var ondrain = pipeOnDrain(src); - dest.on('drain', ondrain); - var cleanedUp = false; - function cleanup() { - debug('cleanup'); - // cleanup event handlers once the pipe is broken - dest.removeListener('close', onclose); - dest.removeListener('finish', onfinish); - dest.removeListener('drain', ondrain); - dest.removeListener('error', onerror); - dest.removeListener('unpipe', onunpipe); - src.removeListener('end', onend); - src.removeListener('end', unpipe); - src.removeListener('data', ondata); - cleanedUp = true; - - // if the reader is waiting for a drain event from this - // specific writer, then it would cause it to never start - // flowing again. - // So, if this is awaiting a drain, then we just call it now. - // If we don't know, then assume that we are waiting for one. - if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); - } - src.on('data', ondata); - function ondata(chunk) { - debug('ondata'); - var ret = dest.write(chunk); - debug('dest.write', ret); - if (ret === false) { - // If the user unpiped during `dest.write()`, it is possible - // to get stuck in a permanently paused state if that write - // also returned false. - // => Check whether `dest` is still a piping destination. - if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { - debug('false write response, pause', state.awaitDrain); - state.awaitDrain++; - } - src.pause(); - } - } - - // if the dest has an error, then stop piping into it. - // however, don't suppress the throwing behavior for this. - function onerror(er) { - debug('onerror', er); - unpipe(); - dest.removeListener('error', onerror); - if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er); - } - - // Make sure our error handler is attached before userland ones. - prependListener(dest, 'error', onerror); - - // Both close and finish should trigger unpipe, but only once. - function onclose() { - dest.removeListener('finish', onfinish); - unpipe(); - } - dest.once('close', onclose); - function onfinish() { - debug('onfinish'); - dest.removeListener('close', onclose); - unpipe(); - } - dest.once('finish', onfinish); - function unpipe() { - debug('unpipe'); - src.unpipe(dest); - } - - // tell the dest that it's being piped to - dest.emit('pipe', src); - - // start the flow if it hasn't been started already. - if (!state.flowing) { - debug('pipe resume'); - src.resume(); - } - return dest; -}; -function pipeOnDrain(src) { - return function pipeOnDrainFunctionResult() { - var state = src._readableState; - debug('pipeOnDrain', state.awaitDrain); - if (state.awaitDrain) state.awaitDrain--; - if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { - state.flowing = true; - flow(src); - } - }; -} -Readable.prototype.unpipe = function (dest) { - var state = this._readableState; - var unpipeInfo = { - hasUnpiped: false - }; - - // if we're not piping anywhere, then do nothing. - if (state.pipesCount === 0) return this; - - // just one destination. most common case. - if (state.pipesCount === 1) { - // passed in one, but it's not the right one. - if (dest && dest !== state.pipes) return this; - if (!dest) dest = state.pipes; - - // got a match. - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - if (dest) dest.emit('unpipe', this, unpipeInfo); - return this; - } - - // slow case. multiple pipe destinations. - - if (!dest) { - // remove all. - var dests = state.pipes; - var len = state.pipesCount; - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - for (var i = 0; i < len; i++) dests[i].emit('unpipe', this, { - hasUnpiped: false - }); - return this; - } - - // try to find the right one. - var index = indexOf(state.pipes, dest); - if (index === -1) return this; - state.pipes.splice(index, 1); - state.pipesCount -= 1; - if (state.pipesCount === 1) state.pipes = state.pipes[0]; - dest.emit('unpipe', this, unpipeInfo); - return this; -}; - -// set up data events if they are asked for -// Ensure readable listeners eventually get something -Readable.prototype.on = function (ev, fn) { - var res = Stream.prototype.on.call(this, ev, fn); - var state = this._readableState; - if (ev === 'data') { - // update readableListening so that resume() may be a no-op - // a few lines down. This is needed to support once('readable'). - state.readableListening = this.listenerCount('readable') > 0; - - // Try start flowing on next tick if stream isn't explicitly paused - if (state.flowing !== false) this.resume(); - } else if (ev === 'readable') { - if (!state.endEmitted && !state.readableListening) { - state.readableListening = state.needReadable = true; - state.flowing = false; - state.emittedReadable = false; - debug('on readable', state.length, state.reading); - if (state.length) { - emitReadable(this); - } else if (!state.reading) { - process.nextTick(nReadingNextTick, this); - } - } - } - return res; -}; -Readable.prototype.addListener = Readable.prototype.on; -Readable.prototype.removeListener = function (ev, fn) { - var res = Stream.prototype.removeListener.call(this, ev, fn); - if (ev === 'readable') { - // We need to check if there is someone still listening to - // readable and reset the state. However this needs to happen - // after readable has been emitted but before I/O (nextTick) to - // support once('readable', fn) cycles. This means that calling - // resume within the same tick will have no - // effect. - process.nextTick(updateReadableListening, this); - } - return res; -}; -Readable.prototype.removeAllListeners = function (ev) { - var res = Stream.prototype.removeAllListeners.apply(this, arguments); - if (ev === 'readable' || ev === undefined) { - // We need to check if there is someone still listening to - // readable and reset the state. However this needs to happen - // after readable has been emitted but before I/O (nextTick) to - // support once('readable', fn) cycles. This means that calling - // resume within the same tick will have no - // effect. - process.nextTick(updateReadableListening, this); - } - return res; -}; -function updateReadableListening(self) { - var state = self._readableState; - state.readableListening = self.listenerCount('readable') > 0; - if (state.resumeScheduled && !state.paused) { - // flowing needs to be set to true now, otherwise - // the upcoming resume will not flow. - state.flowing = true; - - // crude way to check if we should resume - } else if (self.listenerCount('data') > 0) { - self.resume(); - } -} -function nReadingNextTick(self) { - debug('readable nexttick read 0'); - self.read(0); -} - -// pause() and resume() are remnants of the legacy readable stream API -// If the user uses them, then switch into old mode. -Readable.prototype.resume = function () { - var state = this._readableState; - if (!state.flowing) { - debug('resume'); - // we flow only if there is no one listening - // for readable, but we still have to call - // resume() - state.flowing = !state.readableListening; - resume(this, state); - } - state.paused = false; - return this; -}; -function resume(stream, state) { - if (!state.resumeScheduled) { - state.resumeScheduled = true; - process.nextTick(resume_, stream, state); - } -} -function resume_(stream, state) { - debug('resume', state.reading); - if (!state.reading) { - stream.read(0); - } - state.resumeScheduled = false; - stream.emit('resume'); - flow(stream); - if (state.flowing && !state.reading) stream.read(0); -} -Readable.prototype.pause = function () { - debug('call pause flowing=%j', this._readableState.flowing); - if (this._readableState.flowing !== false) { - debug('pause'); - this._readableState.flowing = false; - this.emit('pause'); - } - this._readableState.paused = true; - return this; -}; -function flow(stream) { - var state = stream._readableState; - debug('flow', state.flowing); - while (state.flowing && stream.read() !== null); -} - -// wrap an old-style stream as the async data source. -// This is *not* part of the readable stream interface. -// It is an ugly unfortunate mess of history. -Readable.prototype.wrap = function (stream) { - var _this = this; - var state = this._readableState; - var paused = false; - stream.on('end', function () { - debug('wrapped end'); - if (state.decoder && !state.ended) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) _this.push(chunk); - } - _this.push(null); - }); - stream.on('data', function (chunk) { - debug('wrapped data'); - if (state.decoder) chunk = state.decoder.write(chunk); - - // don't skip over falsy values in objectMode - if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; - var ret = _this.push(chunk); - if (!ret) { - paused = true; - stream.pause(); - } - }); - - // proxy all the other methods. - // important when wrapping filters and duplexes. - for (var i in stream) { - if (this[i] === undefined && typeof stream[i] === 'function') { - this[i] = function methodWrap(method) { - return function methodWrapReturnFunction() { - return stream[method].apply(stream, arguments); - }; - }(i); - } - } - - // proxy certain important events. - for (var n = 0; n < kProxyEvents.length; n++) { - stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); - } - - // when we try to consume some more bytes, simply unpause the - // underlying stream. - this._read = function (n) { - debug('wrapped _read', n); - if (paused) { - paused = false; - stream.resume(); - } - }; - return this; -}; -if (typeof Symbol === 'function') { - Readable.prototype[Symbol.asyncIterator] = function () { - if (createReadableStreamAsyncIterator === undefined) { - createReadableStreamAsyncIterator = require('./internal/streams/async_iterator'); - } - return createReadableStreamAsyncIterator(this); - }; -} -Object.defineProperty(Readable.prototype, 'readableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._readableState.highWaterMark; - } -}); -Object.defineProperty(Readable.prototype, 'readableBuffer', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._readableState && this._readableState.buffer; - } -}); -Object.defineProperty(Readable.prototype, 'readableFlowing', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._readableState.flowing; - }, - set: function set(state) { - if (this._readableState) { - this._readableState.flowing = state; - } - } -}); - -// exposed for testing purposes only. -Readable._fromList = fromList; -Object.defineProperty(Readable.prototype, 'readableLength', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._readableState.length; - } -}); - -// Pluck off n bytes from an array of buffers. -// Length is the combined lengths of all the buffers in the list. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function fromList(n, state) { - // nothing buffered - if (state.length === 0) return null; - var ret; - if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { - // read it all, truncate the list - if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.first();else ret = state.buffer.concat(state.length); - state.buffer.clear(); - } else { - // read part of list - ret = state.buffer.consume(n, state.decoder); - } - return ret; -} -function endReadable(stream) { - var state = stream._readableState; - debug('endReadable', state.endEmitted); - if (!state.endEmitted) { - state.ended = true; - process.nextTick(endReadableNT, state, stream); - } -} -function endReadableNT(state, stream) { - debug('endReadableNT', state.endEmitted, state.length); - - // Check that we didn't get one last unshift. - if (!state.endEmitted && state.length === 0) { - state.endEmitted = true; - stream.readable = false; - stream.emit('end'); - if (state.autoDestroy) { - // In case of duplex streams we need a way to detect - // if the writable side is ready for autoDestroy as well - var wState = stream._writableState; - if (!wState || wState.autoDestroy && wState.finished) { - stream.destroy(); - } - } - } -} -if (typeof Symbol === 'function') { - Readable.from = function (iterable, opts) { - if (from === undefined) { - from = require('./internal/streams/from'); - } - return from(Readable, iterable, opts); - }; -} -function indexOf(xs, x) { - for (var i = 0, l = xs.length; i < l; i++) { - if (xs[i] === x) return i; - } - return -1; -} \ No newline at end of file diff --git a/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js b/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js deleted file mode 100644 index 1ccb715..0000000 --- a/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js +++ /dev/null @@ -1,190 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// a transform stream is a readable/writable stream where you do -// something with the data. Sometimes it's called a "filter", -// but that's not a great name for it, since that implies a thing where -// some bits pass through, and others are simply ignored. (That would -// be a valid example of a transform, of course.) -// -// While the output is causally related to the input, it's not a -// necessarily symmetric or synchronous transformation. For example, -// a zlib stream might take multiple plain-text writes(), and then -// emit a single compressed chunk some time in the future. -// -// Here's how this works: -// -// The Transform stream has all the aspects of the readable and writable -// stream classes. When you write(chunk), that calls _write(chunk,cb) -// internally, and returns false if there's a lot of pending writes -// buffered up. When you call read(), that calls _read(n) until -// there's enough pending readable data buffered up. -// -// In a transform stream, the written data is placed in a buffer. When -// _read(n) is called, it transforms the queued up data, calling the -// buffered _write cb's as it consumes chunks. If consuming a single -// written chunk would result in multiple output chunks, then the first -// outputted bit calls the readcb, and subsequent chunks just go into -// the read buffer, and will cause it to emit 'readable' if necessary. -// -// This way, back-pressure is actually determined by the reading side, -// since _read has to be called to start processing a new chunk. However, -// a pathological inflate type of transform can cause excessive buffering -// here. For example, imagine a stream where every byte of input is -// interpreted as an integer from 0-255, and then results in that many -// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in -// 1kb of data being output. In this case, you could write a very small -// amount of input, and end up with a very large amount of output. In -// such a pathological inflating mechanism, there'd be no way to tell -// the system to stop doing the transform. A single 4MB write could -// cause the system to run out of memory. -// -// However, even in such a pathological case, only a single written chunk -// would be consumed, and then the rest would wait (un-transformed) until -// the results of the previous transformed chunk were consumed. - -'use strict'; - -module.exports = Transform; -var _require$codes = require('../errors').codes, - ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, - ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, - ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING, - ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0; -var Duplex = require('./_stream_duplex'); -require('inherits')(Transform, Duplex); -function afterTransform(er, data) { - var ts = this._transformState; - ts.transforming = false; - var cb = ts.writecb; - if (cb === null) { - return this.emit('error', new ERR_MULTIPLE_CALLBACK()); - } - ts.writechunk = null; - ts.writecb = null; - if (data != null) - // single equals check for both `null` and `undefined` - this.push(data); - cb(er); - var rs = this._readableState; - rs.reading = false; - if (rs.needReadable || rs.length < rs.highWaterMark) { - this._read(rs.highWaterMark); - } -} -function Transform(options) { - if (!(this instanceof Transform)) return new Transform(options); - Duplex.call(this, options); - this._transformState = { - afterTransform: afterTransform.bind(this), - needTransform: false, - transforming: false, - writecb: null, - writechunk: null, - writeencoding: null - }; - - // start out asking for a readable event once data is transformed. - this._readableState.needReadable = true; - - // we have implemented the _read method, and done the other things - // that Readable wants before the first _read call, so unset the - // sync guard flag. - this._readableState.sync = false; - if (options) { - if (typeof options.transform === 'function') this._transform = options.transform; - if (typeof options.flush === 'function') this._flush = options.flush; - } - - // When the writable side finishes, then flush out anything remaining. - this.on('prefinish', prefinish); -} -function prefinish() { - var _this = this; - if (typeof this._flush === 'function' && !this._readableState.destroyed) { - this._flush(function (er, data) { - done(_this, er, data); - }); - } else { - done(this, null, null); - } -} -Transform.prototype.push = function (chunk, encoding) { - this._transformState.needTransform = false; - return Duplex.prototype.push.call(this, chunk, encoding); -}; - -// This is the part where you do stuff! -// override this function in implementation classes. -// 'chunk' is an input chunk. -// -// Call `push(newChunk)` to pass along transformed output -// to the readable side. You may call 'push' zero or more times. -// -// Call `cb(err)` when you are done with this chunk. If you pass -// an error, then that'll put the hurt on the whole operation. If you -// never call cb(), then you'll never get another chunk. -Transform.prototype._transform = function (chunk, encoding, cb) { - cb(new ERR_METHOD_NOT_IMPLEMENTED('_transform()')); -}; -Transform.prototype._write = function (chunk, encoding, cb) { - var ts = this._transformState; - ts.writecb = cb; - ts.writechunk = chunk; - ts.writeencoding = encoding; - if (!ts.transforming) { - var rs = this._readableState; - if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); - } -}; - -// Doesn't matter what the args are here. -// _transform does all the work. -// That we got here means that the readable side wants more data. -Transform.prototype._read = function (n) { - var ts = this._transformState; - if (ts.writechunk !== null && !ts.transforming) { - ts.transforming = true; - this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); - } else { - // mark that we need a transform, so that any data that comes in - // will get processed, now that we've asked for it. - ts.needTransform = true; - } -}; -Transform.prototype._destroy = function (err, cb) { - Duplex.prototype._destroy.call(this, err, function (err2) { - cb(err2); - }); -}; -function done(stream, er, data) { - if (er) return stream.emit('error', er); - if (data != null) - // single equals check for both `null` and `undefined` - stream.push(data); - - // TODO(BridgeAR): Write a test for these two error cases - // if there's nothing in the write buffer, then that means - // that nothing more will ever be provided - if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0(); - if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING(); - return stream.push(null); -} \ No newline at end of file diff --git a/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js b/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js deleted file mode 100644 index 292415e..0000000 --- a/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js +++ /dev/null @@ -1,641 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// A bit simpler than readable streams. -// Implement an async ._write(chunk, encoding, cb), and it'll handle all -// the drain event emission and buffering. - -'use strict'; - -module.exports = Writable; - -/* */ -function WriteReq(chunk, encoding, cb) { - this.chunk = chunk; - this.encoding = encoding; - this.callback = cb; - this.next = null; -} - -// It seems a linked list but it is not -// there will be only 2 of these for each stream -function CorkedRequest(state) { - var _this = this; - this.next = null; - this.entry = null; - this.finish = function () { - onCorkedFinish(_this, state); - }; -} -/* */ - -/**/ -var Duplex; -/**/ - -Writable.WritableState = WritableState; - -/**/ -var internalUtil = { - deprecate: require('util-deprecate') -}; -/**/ - -/**/ -var Stream = require('./internal/streams/stream'); -/**/ - -var Buffer = require('buffer').Buffer; -var OurUint8Array = (typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {}; -function _uint8ArrayToBuffer(chunk) { - return Buffer.from(chunk); -} -function _isUint8Array(obj) { - return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; -} -var destroyImpl = require('./internal/streams/destroy'); -var _require = require('./internal/streams/state'), - getHighWaterMark = _require.getHighWaterMark; -var _require$codes = require('../errors').codes, - ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, - ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, - ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, - ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE, - ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED, - ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES, - ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END, - ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING; -var errorOrDestroy = destroyImpl.errorOrDestroy; -require('inherits')(Writable, Stream); -function nop() {} -function WritableState(options, stream, isDuplex) { - Duplex = Duplex || require('./_stream_duplex'); - options = options || {}; - - // Duplex streams are both readable and writable, but share - // the same options object. - // However, some cases require setting options to different - // values for the readable and the writable sides of the duplex stream, - // e.g. options.readableObjectMode vs. options.writableObjectMode, etc. - if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; - - // object stream flag to indicate whether or not this stream - // contains buffers or objects. - this.objectMode = !!options.objectMode; - if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; - - // the point at which write() starts returning false - // Note: 0 is a valid value, means that we always return false if - // the entire buffer is not flushed immediately on write() - this.highWaterMark = getHighWaterMark(this, options, 'writableHighWaterMark', isDuplex); - - // if _final has been called - this.finalCalled = false; - - // drain event flag. - this.needDrain = false; - // at the start of calling end() - this.ending = false; - // when end() has been called, and returned - this.ended = false; - // when 'finish' is emitted - this.finished = false; - - // has it been destroyed - this.destroyed = false; - - // should we decode strings into buffers before passing to _write? - // this is here so that some node-core streams can optimize string - // handling at a lower level. - var noDecode = options.decodeStrings === false; - this.decodeStrings = !noDecode; - - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; - - // not an actual buffer we keep track of, but a measurement - // of how much we're waiting to get pushed to some underlying - // socket or file. - this.length = 0; - - // a flag to see when we're in the middle of a write. - this.writing = false; - - // when true all writes will be buffered until .uncork() call - this.corked = 0; - - // a flag to be able to tell if the onwrite cb is called immediately, - // or on a later tick. We set this to true at first, because any - // actions that shouldn't happen until "later" should generally also - // not happen before the first write call. - this.sync = true; - - // a flag to know if we're processing previously buffered items, which - // may call the _write() callback in the same tick, so that we don't - // end up in an overlapped onwrite situation. - this.bufferProcessing = false; - - // the callback that's passed to _write(chunk,cb) - this.onwrite = function (er) { - onwrite(stream, er); - }; - - // the callback that the user supplies to write(chunk,encoding,cb) - this.writecb = null; - - // the amount that is being written when _write is called. - this.writelen = 0; - this.bufferedRequest = null; - this.lastBufferedRequest = null; - - // number of pending user-supplied write callbacks - // this must be 0 before 'finish' can be emitted - this.pendingcb = 0; - - // emit prefinish if the only thing we're waiting for is _write cbs - // This is relevant for synchronous Transform streams - this.prefinished = false; - - // True if the error was already emitted and should not be thrown again - this.errorEmitted = false; - - // Should close be emitted on destroy. Defaults to true. - this.emitClose = options.emitClose !== false; - - // Should .destroy() be called after 'finish' (and potentially 'end') - this.autoDestroy = !!options.autoDestroy; - - // count buffered requests - this.bufferedRequestCount = 0; - - // allocate the first CorkedRequest, there is always - // one allocated and free to use, and we maintain at most two - this.corkedRequestsFree = new CorkedRequest(this); -} -WritableState.prototype.getBuffer = function getBuffer() { - var current = this.bufferedRequest; - var out = []; - while (current) { - out.push(current); - current = current.next; - } - return out; -}; -(function () { - try { - Object.defineProperty(WritableState.prototype, 'buffer', { - get: internalUtil.deprecate(function writableStateBufferGetter() { - return this.getBuffer(); - }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') - }); - } catch (_) {} -})(); - -// Test _writableState for inheritance to account for Duplex streams, -// whose prototype chain only points to Readable. -var realHasInstance; -if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { - realHasInstance = Function.prototype[Symbol.hasInstance]; - Object.defineProperty(Writable, Symbol.hasInstance, { - value: function value(object) { - if (realHasInstance.call(this, object)) return true; - if (this !== Writable) return false; - return object && object._writableState instanceof WritableState; - } - }); -} else { - realHasInstance = function realHasInstance(object) { - return object instanceof this; - }; -} -function Writable(options) { - Duplex = Duplex || require('./_stream_duplex'); - - // Writable ctor is applied to Duplexes, too. - // `realHasInstance` is necessary because using plain `instanceof` - // would return false, as no `_writableState` property is attached. - - // Trying to use the custom `instanceof` for Writable here will also break the - // Node.js LazyTransform implementation, which has a non-trivial getter for - // `_writableState` that would lead to infinite recursion. - - // Checking for a Stream.Duplex instance is faster here instead of inside - // the WritableState constructor, at least with V8 6.5 - var isDuplex = this instanceof Duplex; - if (!isDuplex && !realHasInstance.call(Writable, this)) return new Writable(options); - this._writableState = new WritableState(options, this, isDuplex); - - // legacy. - this.writable = true; - if (options) { - if (typeof options.write === 'function') this._write = options.write; - if (typeof options.writev === 'function') this._writev = options.writev; - if (typeof options.destroy === 'function') this._destroy = options.destroy; - if (typeof options.final === 'function') this._final = options.final; - } - Stream.call(this); -} - -// Otherwise people can pipe Writable streams, which is just wrong. -Writable.prototype.pipe = function () { - errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE()); -}; -function writeAfterEnd(stream, cb) { - var er = new ERR_STREAM_WRITE_AFTER_END(); - // TODO: defer error events consistently everywhere, not just the cb - errorOrDestroy(stream, er); - process.nextTick(cb, er); -} - -// Checks that a user-supplied chunk is valid, especially for the particular -// mode the stream is in. Currently this means that `null` is never accepted -// and undefined/non-string values are only allowed in object mode. -function validChunk(stream, state, chunk, cb) { - var er; - if (chunk === null) { - er = new ERR_STREAM_NULL_VALUES(); - } else if (typeof chunk !== 'string' && !state.objectMode) { - er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer'], chunk); - } - if (er) { - errorOrDestroy(stream, er); - process.nextTick(cb, er); - return false; - } - return true; -} -Writable.prototype.write = function (chunk, encoding, cb) { - var state = this._writableState; - var ret = false; - var isBuf = !state.objectMode && _isUint8Array(chunk); - if (isBuf && !Buffer.isBuffer(chunk)) { - chunk = _uint8ArrayToBuffer(chunk); - } - if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; - if (typeof cb !== 'function') cb = nop; - if (state.ending) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { - state.pendingcb++; - ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); - } - return ret; -}; -Writable.prototype.cork = function () { - this._writableState.corked++; -}; -Writable.prototype.uncork = function () { - var state = this._writableState; - if (state.corked) { - state.corked--; - if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); - } -}; -Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { - // node::ParseEncoding() requires lower case. - if (typeof encoding === 'string') encoding = encoding.toLowerCase(); - if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new ERR_UNKNOWN_ENCODING(encoding); - this._writableState.defaultEncoding = encoding; - return this; -}; -Object.defineProperty(Writable.prototype, 'writableBuffer', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState && this._writableState.getBuffer(); - } -}); -function decodeChunk(state, chunk, encoding) { - if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { - chunk = Buffer.from(chunk, encoding); - } - return chunk; -} -Object.defineProperty(Writable.prototype, 'writableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState.highWaterMark; - } -}); - -// if we're already writing something, then just put this -// in the queue, and wait our turn. Otherwise, call _write -// If we return false, then we need a drain event, so set that flag. -function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { - if (!isBuf) { - var newChunk = decodeChunk(state, chunk, encoding); - if (chunk !== newChunk) { - isBuf = true; - encoding = 'buffer'; - chunk = newChunk; - } - } - var len = state.objectMode ? 1 : chunk.length; - state.length += len; - var ret = state.length < state.highWaterMark; - // we must ensure that previous needDrain will not be reset to false. - if (!ret) state.needDrain = true; - if (state.writing || state.corked) { - var last = state.lastBufferedRequest; - state.lastBufferedRequest = { - chunk: chunk, - encoding: encoding, - isBuf: isBuf, - callback: cb, - next: null - }; - if (last) { - last.next = state.lastBufferedRequest; - } else { - state.bufferedRequest = state.lastBufferedRequest; - } - state.bufferedRequestCount += 1; - } else { - doWrite(stream, state, false, len, chunk, encoding, cb); - } - return ret; -} -function doWrite(stream, state, writev, len, chunk, encoding, cb) { - state.writelen = len; - state.writecb = cb; - state.writing = true; - state.sync = true; - if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED('write'));else if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); - state.sync = false; -} -function onwriteError(stream, state, sync, er, cb) { - --state.pendingcb; - if (sync) { - // defer the callback if we are being called synchronously - // to avoid piling up things on the stack - process.nextTick(cb, er); - // this can emit finish, and it will always happen - // after error - process.nextTick(finishMaybe, stream, state); - stream._writableState.errorEmitted = true; - errorOrDestroy(stream, er); - } else { - // the caller expect this to happen before if - // it is async - cb(er); - stream._writableState.errorEmitted = true; - errorOrDestroy(stream, er); - // this can emit finish, but finish must - // always follow error - finishMaybe(stream, state); - } -} -function onwriteStateUpdate(state) { - state.writing = false; - state.writecb = null; - state.length -= state.writelen; - state.writelen = 0; -} -function onwrite(stream, er) { - var state = stream._writableState; - var sync = state.sync; - var cb = state.writecb; - if (typeof cb !== 'function') throw new ERR_MULTIPLE_CALLBACK(); - onwriteStateUpdate(state); - if (er) onwriteError(stream, state, sync, er, cb);else { - // Check if we're actually ready to finish, but don't emit yet - var finished = needFinish(state) || stream.destroyed; - if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { - clearBuffer(stream, state); - } - if (sync) { - process.nextTick(afterWrite, stream, state, finished, cb); - } else { - afterWrite(stream, state, finished, cb); - } - } -} -function afterWrite(stream, state, finished, cb) { - if (!finished) onwriteDrain(stream, state); - state.pendingcb--; - cb(); - finishMaybe(stream, state); -} - -// Must force callback to be called on nextTick, so that we don't -// emit 'drain' before the write() consumer gets the 'false' return -// value, and has a chance to attach a 'drain' listener. -function onwriteDrain(stream, state) { - if (state.length === 0 && state.needDrain) { - state.needDrain = false; - stream.emit('drain'); - } -} - -// if there's something in the buffer waiting, then process it -function clearBuffer(stream, state) { - state.bufferProcessing = true; - var entry = state.bufferedRequest; - if (stream._writev && entry && entry.next) { - // Fast case, write everything using _writev() - var l = state.bufferedRequestCount; - var buffer = new Array(l); - var holder = state.corkedRequestsFree; - holder.entry = entry; - var count = 0; - var allBuffers = true; - while (entry) { - buffer[count] = entry; - if (!entry.isBuf) allBuffers = false; - entry = entry.next; - count += 1; - } - buffer.allBuffers = allBuffers; - doWrite(stream, state, true, state.length, buffer, '', holder.finish); - - // doWrite is almost always async, defer these to save a bit of time - // as the hot path ends with doWrite - state.pendingcb++; - state.lastBufferedRequest = null; - if (holder.next) { - state.corkedRequestsFree = holder.next; - holder.next = null; - } else { - state.corkedRequestsFree = new CorkedRequest(state); - } - state.bufferedRequestCount = 0; - } else { - // Slow case, write chunks one-by-one - while (entry) { - var chunk = entry.chunk; - var encoding = entry.encoding; - var cb = entry.callback; - var len = state.objectMode ? 1 : chunk.length; - doWrite(stream, state, false, len, chunk, encoding, cb); - entry = entry.next; - state.bufferedRequestCount--; - // if we didn't call the onwrite immediately, then - // it means that we need to wait until it does. - // also, that means that the chunk and cb are currently - // being processed, so move the buffer counter past them. - if (state.writing) { - break; - } - } - if (entry === null) state.lastBufferedRequest = null; - } - state.bufferedRequest = entry; - state.bufferProcessing = false; -} -Writable.prototype._write = function (chunk, encoding, cb) { - cb(new ERR_METHOD_NOT_IMPLEMENTED('_write()')); -}; -Writable.prototype._writev = null; -Writable.prototype.end = function (chunk, encoding, cb) { - var state = this._writableState; - if (typeof chunk === 'function') { - cb = chunk; - chunk = null; - encoding = null; - } else if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); - - // .end() fully uncorks - if (state.corked) { - state.corked = 1; - this.uncork(); - } - - // ignore unnecessary end() calls. - if (!state.ending) endWritable(this, state, cb); - return this; -}; -Object.defineProperty(Writable.prototype, 'writableLength', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState.length; - } -}); -function needFinish(state) { - return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; -} -function callFinal(stream, state) { - stream._final(function (err) { - state.pendingcb--; - if (err) { - errorOrDestroy(stream, err); - } - state.prefinished = true; - stream.emit('prefinish'); - finishMaybe(stream, state); - }); -} -function prefinish(stream, state) { - if (!state.prefinished && !state.finalCalled) { - if (typeof stream._final === 'function' && !state.destroyed) { - state.pendingcb++; - state.finalCalled = true; - process.nextTick(callFinal, stream, state); - } else { - state.prefinished = true; - stream.emit('prefinish'); - } - } -} -function finishMaybe(stream, state) { - var need = needFinish(state); - if (need) { - prefinish(stream, state); - if (state.pendingcb === 0) { - state.finished = true; - stream.emit('finish'); - if (state.autoDestroy) { - // In case of duplex streams we need a way to detect - // if the readable side is ready for autoDestroy as well - var rState = stream._readableState; - if (!rState || rState.autoDestroy && rState.endEmitted) { - stream.destroy(); - } - } - } - } - return need; -} -function endWritable(stream, state, cb) { - state.ending = true; - finishMaybe(stream, state); - if (cb) { - if (state.finished) process.nextTick(cb);else stream.once('finish', cb); - } - state.ended = true; - stream.writable = false; -} -function onCorkedFinish(corkReq, state, err) { - var entry = corkReq.entry; - corkReq.entry = null; - while (entry) { - var cb = entry.callback; - state.pendingcb--; - cb(err); - entry = entry.next; - } - - // reuse the free corkReq. - state.corkedRequestsFree.next = corkReq; -} -Object.defineProperty(Writable.prototype, 'destroyed', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - if (this._writableState === undefined) { - return false; - } - return this._writableState.destroyed; - }, - set: function set(value) { - // we ignore the value if the stream - // has not been initialized yet - if (!this._writableState) { - return; - } - - // backward compatibility, the user is explicitly - // managing destroyed - this._writableState.destroyed = value; - } -}); -Writable.prototype.destroy = destroyImpl.destroy; -Writable.prototype._undestroy = destroyImpl.undestroy; -Writable.prototype._destroy = function (err, cb) { - cb(err); -}; \ No newline at end of file diff --git a/node_modules/bl/node_modules/readable-stream/lib/internal/streams/async_iterator.js b/node_modules/bl/node_modules/readable-stream/lib/internal/streams/async_iterator.js deleted file mode 100644 index 742c5a4..0000000 --- a/node_modules/bl/node_modules/readable-stream/lib/internal/streams/async_iterator.js +++ /dev/null @@ -1,180 +0,0 @@ -'use strict'; - -var _Object$setPrototypeO; -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } -var finished = require('./end-of-stream'); -var kLastResolve = Symbol('lastResolve'); -var kLastReject = Symbol('lastReject'); -var kError = Symbol('error'); -var kEnded = Symbol('ended'); -var kLastPromise = Symbol('lastPromise'); -var kHandlePromise = Symbol('handlePromise'); -var kStream = Symbol('stream'); -function createIterResult(value, done) { - return { - value: value, - done: done - }; -} -function readAndResolve(iter) { - var resolve = iter[kLastResolve]; - if (resolve !== null) { - var data = iter[kStream].read(); - // we defer if data is null - // we can be expecting either 'end' or - // 'error' - if (data !== null) { - iter[kLastPromise] = null; - iter[kLastResolve] = null; - iter[kLastReject] = null; - resolve(createIterResult(data, false)); - } - } -} -function onReadable(iter) { - // we wait for the next tick, because it might - // emit an error with process.nextTick - process.nextTick(readAndResolve, iter); -} -function wrapForNext(lastPromise, iter) { - return function (resolve, reject) { - lastPromise.then(function () { - if (iter[kEnded]) { - resolve(createIterResult(undefined, true)); - return; - } - iter[kHandlePromise](resolve, reject); - }, reject); - }; -} -var AsyncIteratorPrototype = Object.getPrototypeOf(function () {}); -var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = { - get stream() { - return this[kStream]; - }, - next: function next() { - var _this = this; - // if we have detected an error in the meanwhile - // reject straight away - var error = this[kError]; - if (error !== null) { - return Promise.reject(error); - } - if (this[kEnded]) { - return Promise.resolve(createIterResult(undefined, true)); - } - if (this[kStream].destroyed) { - // We need to defer via nextTick because if .destroy(err) is - // called, the error will be emitted via nextTick, and - // we cannot guarantee that there is no error lingering around - // waiting to be emitted. - return new Promise(function (resolve, reject) { - process.nextTick(function () { - if (_this[kError]) { - reject(_this[kError]); - } else { - resolve(createIterResult(undefined, true)); - } - }); - }); - } - - // if we have multiple next() calls - // we will wait for the previous Promise to finish - // this logic is optimized to support for await loops, - // where next() is only called once at a time - var lastPromise = this[kLastPromise]; - var promise; - if (lastPromise) { - promise = new Promise(wrapForNext(lastPromise, this)); - } else { - // fast path needed to support multiple this.push() - // without triggering the next() queue - var data = this[kStream].read(); - if (data !== null) { - return Promise.resolve(createIterResult(data, false)); - } - promise = new Promise(this[kHandlePromise]); - } - this[kLastPromise] = promise; - return promise; - } -}, _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, function () { - return this; -}), _defineProperty(_Object$setPrototypeO, "return", function _return() { - var _this2 = this; - // destroy(err, cb) is a private API - // we can guarantee we have that here, because we control the - // Readable class this is attached to - return new Promise(function (resolve, reject) { - _this2[kStream].destroy(null, function (err) { - if (err) { - reject(err); - return; - } - resolve(createIterResult(undefined, true)); - }); - }); -}), _Object$setPrototypeO), AsyncIteratorPrototype); -var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator(stream) { - var _Object$create; - var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, { - value: stream, - writable: true - }), _defineProperty(_Object$create, kLastResolve, { - value: null, - writable: true - }), _defineProperty(_Object$create, kLastReject, { - value: null, - writable: true - }), _defineProperty(_Object$create, kError, { - value: null, - writable: true - }), _defineProperty(_Object$create, kEnded, { - value: stream._readableState.endEmitted, - writable: true - }), _defineProperty(_Object$create, kHandlePromise, { - value: function value(resolve, reject) { - var data = iterator[kStream].read(); - if (data) { - iterator[kLastPromise] = null; - iterator[kLastResolve] = null; - iterator[kLastReject] = null; - resolve(createIterResult(data, false)); - } else { - iterator[kLastResolve] = resolve; - iterator[kLastReject] = reject; - } - }, - writable: true - }), _Object$create)); - iterator[kLastPromise] = null; - finished(stream, function (err) { - if (err && err.code !== 'ERR_STREAM_PREMATURE_CLOSE') { - var reject = iterator[kLastReject]; - // reject if we are waiting for data in the Promise - // returned by next() and store the error - if (reject !== null) { - iterator[kLastPromise] = null; - iterator[kLastResolve] = null; - iterator[kLastReject] = null; - reject(err); - } - iterator[kError] = err; - return; - } - var resolve = iterator[kLastResolve]; - if (resolve !== null) { - iterator[kLastPromise] = null; - iterator[kLastResolve] = null; - iterator[kLastReject] = null; - resolve(createIterResult(undefined, true)); - } - iterator[kEnded] = true; - }); - stream.on('readable', onReadable.bind(null, iterator)); - return iterator; -}; -module.exports = createReadableStreamAsyncIterator; \ No newline at end of file diff --git a/node_modules/bl/node_modules/readable-stream/lib/internal/streams/buffer_list.js b/node_modules/bl/node_modules/readable-stream/lib/internal/streams/buffer_list.js deleted file mode 100644 index 69bda49..0000000 --- a/node_modules/bl/node_modules/readable-stream/lib/internal/streams/buffer_list.js +++ /dev/null @@ -1,183 +0,0 @@ -'use strict'; - -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } -var _require = require('buffer'), - Buffer = _require.Buffer; -var _require2 = require('util'), - inspect = _require2.inspect; -var custom = inspect && inspect.custom || 'inspect'; -function copyBuffer(src, target, offset) { - Buffer.prototype.copy.call(src, target, offset); -} -module.exports = /*#__PURE__*/function () { - function BufferList() { - _classCallCheck(this, BufferList); - this.head = null; - this.tail = null; - this.length = 0; - } - _createClass(BufferList, [{ - key: "push", - value: function push(v) { - var entry = { - data: v, - next: null - }; - if (this.length > 0) this.tail.next = entry;else this.head = entry; - this.tail = entry; - ++this.length; - } - }, { - key: "unshift", - value: function unshift(v) { - var entry = { - data: v, - next: this.head - }; - if (this.length === 0) this.tail = entry; - this.head = entry; - ++this.length; - } - }, { - key: "shift", - value: function shift() { - if (this.length === 0) return; - var ret = this.head.data; - if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; - --this.length; - return ret; - } - }, { - key: "clear", - value: function clear() { - this.head = this.tail = null; - this.length = 0; - } - }, { - key: "join", - value: function join(s) { - if (this.length === 0) return ''; - var p = this.head; - var ret = '' + p.data; - while (p = p.next) ret += s + p.data; - return ret; - } - }, { - key: "concat", - value: function concat(n) { - if (this.length === 0) return Buffer.alloc(0); - var ret = Buffer.allocUnsafe(n >>> 0); - var p = this.head; - var i = 0; - while (p) { - copyBuffer(p.data, ret, i); - i += p.data.length; - p = p.next; - } - return ret; - } - - // Consumes a specified amount of bytes or characters from the buffered data. - }, { - key: "consume", - value: function consume(n, hasStrings) { - var ret; - if (n < this.head.data.length) { - // `slice` is the same for buffers and strings. - ret = this.head.data.slice(0, n); - this.head.data = this.head.data.slice(n); - } else if (n === this.head.data.length) { - // First chunk is a perfect match. - ret = this.shift(); - } else { - // Result spans more than one buffer. - ret = hasStrings ? this._getString(n) : this._getBuffer(n); - } - return ret; - } - }, { - key: "first", - value: function first() { - return this.head.data; - } - - // Consumes a specified amount of characters from the buffered data. - }, { - key: "_getString", - value: function _getString(n) { - var p = this.head; - var c = 1; - var ret = p.data; - n -= ret.length; - while (p = p.next) { - var str = p.data; - var nb = n > str.length ? str.length : n; - if (nb === str.length) ret += str;else ret += str.slice(0, n); - n -= nb; - if (n === 0) { - if (nb === str.length) { - ++c; - if (p.next) this.head = p.next;else this.head = this.tail = null; - } else { - this.head = p; - p.data = str.slice(nb); - } - break; - } - ++c; - } - this.length -= c; - return ret; - } - - // Consumes a specified amount of bytes from the buffered data. - }, { - key: "_getBuffer", - value: function _getBuffer(n) { - var ret = Buffer.allocUnsafe(n); - var p = this.head; - var c = 1; - p.data.copy(ret); - n -= p.data.length; - while (p = p.next) { - var buf = p.data; - var nb = n > buf.length ? buf.length : n; - buf.copy(ret, ret.length - n, 0, nb); - n -= nb; - if (n === 0) { - if (nb === buf.length) { - ++c; - if (p.next) this.head = p.next;else this.head = this.tail = null; - } else { - this.head = p; - p.data = buf.slice(nb); - } - break; - } - ++c; - } - this.length -= c; - return ret; - } - - // Make sure the linked list only shows the minimal necessary information. - }, { - key: custom, - value: function value(_, options) { - return inspect(this, _objectSpread(_objectSpread({}, options), {}, { - // Only inspect one level. - depth: 0, - // It should not recurse. - customInspect: false - })); - } - }]); - return BufferList; -}(); \ No newline at end of file diff --git a/node_modules/bl/node_modules/readable-stream/lib/internal/streams/destroy.js b/node_modules/bl/node_modules/readable-stream/lib/internal/streams/destroy.js deleted file mode 100644 index 31a17c4..0000000 --- a/node_modules/bl/node_modules/readable-stream/lib/internal/streams/destroy.js +++ /dev/null @@ -1,96 +0,0 @@ -'use strict'; - -// undocumented cb() API, needed for core, not for public API -function destroy(err, cb) { - var _this = this; - var readableDestroyed = this._readableState && this._readableState.destroyed; - var writableDestroyed = this._writableState && this._writableState.destroyed; - if (readableDestroyed || writableDestroyed) { - if (cb) { - cb(err); - } else if (err) { - if (!this._writableState) { - process.nextTick(emitErrorNT, this, err); - } else if (!this._writableState.errorEmitted) { - this._writableState.errorEmitted = true; - process.nextTick(emitErrorNT, this, err); - } - } - return this; - } - - // we set destroyed to true before firing error callbacks in order - // to make it re-entrance safe in case destroy() is called within callbacks - - if (this._readableState) { - this._readableState.destroyed = true; - } - - // if this is a duplex stream mark the writable part as destroyed as well - if (this._writableState) { - this._writableState.destroyed = true; - } - this._destroy(err || null, function (err) { - if (!cb && err) { - if (!_this._writableState) { - process.nextTick(emitErrorAndCloseNT, _this, err); - } else if (!_this._writableState.errorEmitted) { - _this._writableState.errorEmitted = true; - process.nextTick(emitErrorAndCloseNT, _this, err); - } else { - process.nextTick(emitCloseNT, _this); - } - } else if (cb) { - process.nextTick(emitCloseNT, _this); - cb(err); - } else { - process.nextTick(emitCloseNT, _this); - } - }); - return this; -} -function emitErrorAndCloseNT(self, err) { - emitErrorNT(self, err); - emitCloseNT(self); -} -function emitCloseNT(self) { - if (self._writableState && !self._writableState.emitClose) return; - if (self._readableState && !self._readableState.emitClose) return; - self.emit('close'); -} -function undestroy() { - if (this._readableState) { - this._readableState.destroyed = false; - this._readableState.reading = false; - this._readableState.ended = false; - this._readableState.endEmitted = false; - } - if (this._writableState) { - this._writableState.destroyed = false; - this._writableState.ended = false; - this._writableState.ending = false; - this._writableState.finalCalled = false; - this._writableState.prefinished = false; - this._writableState.finished = false; - this._writableState.errorEmitted = false; - } -} -function emitErrorNT(self, err) { - self.emit('error', err); -} -function errorOrDestroy(stream, err) { - // We have tests that rely on errors being emitted - // in the same tick, so changing this is semver major. - // For now when you opt-in to autoDestroy we allow - // the error to be emitted nextTick. In a future - // semver major update we should change the default to this. - - var rState = stream._readableState; - var wState = stream._writableState; - if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream.destroy(err);else stream.emit('error', err); -} -module.exports = { - destroy: destroy, - undestroy: undestroy, - errorOrDestroy: errorOrDestroy -}; \ No newline at end of file diff --git a/node_modules/bl/node_modules/readable-stream/lib/internal/streams/end-of-stream.js b/node_modules/bl/node_modules/readable-stream/lib/internal/streams/end-of-stream.js deleted file mode 100644 index 59c671b..0000000 --- a/node_modules/bl/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +++ /dev/null @@ -1,86 +0,0 @@ -// Ported from https://github.com/mafintosh/end-of-stream with -// permission from the author, Mathias Buus (@mafintosh). - -'use strict'; - -var ERR_STREAM_PREMATURE_CLOSE = require('../../../errors').codes.ERR_STREAM_PREMATURE_CLOSE; -function once(callback) { - var called = false; - return function () { - if (called) return; - called = true; - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - callback.apply(this, args); - }; -} -function noop() {} -function isRequest(stream) { - return stream.setHeader && typeof stream.abort === 'function'; -} -function eos(stream, opts, callback) { - if (typeof opts === 'function') return eos(stream, null, opts); - if (!opts) opts = {}; - callback = once(callback || noop); - var readable = opts.readable || opts.readable !== false && stream.readable; - var writable = opts.writable || opts.writable !== false && stream.writable; - var onlegacyfinish = function onlegacyfinish() { - if (!stream.writable) onfinish(); - }; - var writableEnded = stream._writableState && stream._writableState.finished; - var onfinish = function onfinish() { - writable = false; - writableEnded = true; - if (!readable) callback.call(stream); - }; - var readableEnded = stream._readableState && stream._readableState.endEmitted; - var onend = function onend() { - readable = false; - readableEnded = true; - if (!writable) callback.call(stream); - }; - var onerror = function onerror(err) { - callback.call(stream, err); - }; - var onclose = function onclose() { - var err; - if (readable && !readableEnded) { - if (!stream._readableState || !stream._readableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); - return callback.call(stream, err); - } - if (writable && !writableEnded) { - if (!stream._writableState || !stream._writableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); - return callback.call(stream, err); - } - }; - var onrequest = function onrequest() { - stream.req.on('finish', onfinish); - }; - if (isRequest(stream)) { - stream.on('complete', onfinish); - stream.on('abort', onclose); - if (stream.req) onrequest();else stream.on('request', onrequest); - } else if (writable && !stream._writableState) { - // legacy streams - stream.on('end', onlegacyfinish); - stream.on('close', onlegacyfinish); - } - stream.on('end', onend); - stream.on('finish', onfinish); - if (opts.error !== false) stream.on('error', onerror); - stream.on('close', onclose); - return function () { - stream.removeListener('complete', onfinish); - stream.removeListener('abort', onclose); - stream.removeListener('request', onrequest); - if (stream.req) stream.req.removeListener('finish', onfinish); - stream.removeListener('end', onlegacyfinish); - stream.removeListener('close', onlegacyfinish); - stream.removeListener('finish', onfinish); - stream.removeListener('end', onend); - stream.removeListener('error', onerror); - stream.removeListener('close', onclose); - }; -} -module.exports = eos; \ No newline at end of file diff --git a/node_modules/bl/node_modules/readable-stream/lib/internal/streams/from-browser.js b/node_modules/bl/node_modules/readable-stream/lib/internal/streams/from-browser.js deleted file mode 100644 index a4ce56f..0000000 --- a/node_modules/bl/node_modules/readable-stream/lib/internal/streams/from-browser.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function () { - throw new Error('Readable.from is not available in the browser') -}; diff --git a/node_modules/bl/node_modules/readable-stream/lib/internal/streams/from.js b/node_modules/bl/node_modules/readable-stream/lib/internal/streams/from.js deleted file mode 100644 index 0a34ee9..0000000 --- a/node_modules/bl/node_modules/readable-stream/lib/internal/streams/from.js +++ /dev/null @@ -1,52 +0,0 @@ -'use strict'; - -function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } -function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } -var ERR_INVALID_ARG_TYPE = require('../../../errors').codes.ERR_INVALID_ARG_TYPE; -function from(Readable, iterable, opts) { - var iterator; - if (iterable && typeof iterable.next === 'function') { - iterator = iterable; - } else if (iterable && iterable[Symbol.asyncIterator]) iterator = iterable[Symbol.asyncIterator]();else if (iterable && iterable[Symbol.iterator]) iterator = iterable[Symbol.iterator]();else throw new ERR_INVALID_ARG_TYPE('iterable', ['Iterable'], iterable); - var readable = new Readable(_objectSpread({ - objectMode: true - }, opts)); - // Reading boolean to protect against _read - // being called before last iteration completion. - var reading = false; - readable._read = function () { - if (!reading) { - reading = true; - next(); - } - }; - function next() { - return _next2.apply(this, arguments); - } - function _next2() { - _next2 = _asyncToGenerator(function* () { - try { - var _yield$iterator$next = yield iterator.next(), - value = _yield$iterator$next.value, - done = _yield$iterator$next.done; - if (done) { - readable.push(null); - } else if (readable.push(yield value)) { - next(); - } else { - reading = false; - } - } catch (err) { - readable.destroy(err); - } - }); - return _next2.apply(this, arguments); - } - return readable; -} -module.exports = from; diff --git a/node_modules/bl/node_modules/readable-stream/lib/internal/streams/pipeline.js b/node_modules/bl/node_modules/readable-stream/lib/internal/streams/pipeline.js deleted file mode 100644 index e6f3924..0000000 --- a/node_modules/bl/node_modules/readable-stream/lib/internal/streams/pipeline.js +++ /dev/null @@ -1,86 +0,0 @@ -// Ported from https://github.com/mafintosh/pump with -// permission from the author, Mathias Buus (@mafintosh). - -'use strict'; - -var eos; -function once(callback) { - var called = false; - return function () { - if (called) return; - called = true; - callback.apply(void 0, arguments); - }; -} -var _require$codes = require('../../../errors').codes, - ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS, - ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED; -function noop(err) { - // Rethrow the error if it exists to avoid swallowing it - if (err) throw err; -} -function isRequest(stream) { - return stream.setHeader && typeof stream.abort === 'function'; -} -function destroyer(stream, reading, writing, callback) { - callback = once(callback); - var closed = false; - stream.on('close', function () { - closed = true; - }); - if (eos === undefined) eos = require('./end-of-stream'); - eos(stream, { - readable: reading, - writable: writing - }, function (err) { - if (err) return callback(err); - closed = true; - callback(); - }); - var destroyed = false; - return function (err) { - if (closed) return; - if (destroyed) return; - destroyed = true; - - // request.destroy just do .end - .abort is what we want - if (isRequest(stream)) return stream.abort(); - if (typeof stream.destroy === 'function') return stream.destroy(); - callback(err || new ERR_STREAM_DESTROYED('pipe')); - }; -} -function call(fn) { - fn(); -} -function pipe(from, to) { - return from.pipe(to); -} -function popCallback(streams) { - if (!streams.length) return noop; - if (typeof streams[streams.length - 1] !== 'function') return noop; - return streams.pop(); -} -function pipeline() { - for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) { - streams[_key] = arguments[_key]; - } - var callback = popCallback(streams); - if (Array.isArray(streams[0])) streams = streams[0]; - if (streams.length < 2) { - throw new ERR_MISSING_ARGS('streams'); - } - var error; - var destroys = streams.map(function (stream, i) { - var reading = i < streams.length - 1; - var writing = i > 0; - return destroyer(stream, reading, writing, function (err) { - if (!error) error = err; - if (err) destroys.forEach(call); - if (reading) return; - destroys.forEach(call); - callback(error); - }); - }); - return streams.reduce(pipe); -} -module.exports = pipeline; \ No newline at end of file diff --git a/node_modules/bl/node_modules/readable-stream/lib/internal/streams/state.js b/node_modules/bl/node_modules/readable-stream/lib/internal/streams/state.js deleted file mode 100644 index 3fbf892..0000000 --- a/node_modules/bl/node_modules/readable-stream/lib/internal/streams/state.js +++ /dev/null @@ -1,22 +0,0 @@ -'use strict'; - -var ERR_INVALID_OPT_VALUE = require('../../../errors').codes.ERR_INVALID_OPT_VALUE; -function highWaterMarkFrom(options, isDuplex, duplexKey) { - return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null; -} -function getHighWaterMark(state, options, duplexKey, isDuplex) { - var hwm = highWaterMarkFrom(options, isDuplex, duplexKey); - if (hwm != null) { - if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) { - var name = isDuplex ? duplexKey : 'highWaterMark'; - throw new ERR_INVALID_OPT_VALUE(name, hwm); - } - return Math.floor(hwm); - } - - // Default value - return state.objectMode ? 16 : 16 * 1024; -} -module.exports = { - getHighWaterMark: getHighWaterMark -}; \ No newline at end of file diff --git a/node_modules/bl/node_modules/readable-stream/lib/internal/streams/stream-browser.js b/node_modules/bl/node_modules/readable-stream/lib/internal/streams/stream-browser.js deleted file mode 100644 index 9332a3f..0000000 --- a/node_modules/bl/node_modules/readable-stream/lib/internal/streams/stream-browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('events').EventEmitter; diff --git a/node_modules/bl/node_modules/readable-stream/lib/internal/streams/stream.js b/node_modules/bl/node_modules/readable-stream/lib/internal/streams/stream.js deleted file mode 100644 index ce2ad5b..0000000 --- a/node_modules/bl/node_modules/readable-stream/lib/internal/streams/stream.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('stream'); diff --git a/node_modules/bl/node_modules/readable-stream/package.json b/node_modules/bl/node_modules/readable-stream/package.json deleted file mode 100644 index ade59e7..0000000 --- a/node_modules/bl/node_modules/readable-stream/package.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "name": "readable-stream", - "version": "3.6.2", - "description": "Streams3, a user-land copy of the stream library from Node.js", - "main": "readable.js", - "engines": { - "node": ">= 6" - }, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "devDependencies": { - "@babel/cli": "^7.2.0", - "@babel/core": "^7.2.0", - "@babel/polyfill": "^7.0.0", - "@babel/preset-env": "^7.2.0", - "airtap": "0.0.9", - "assert": "^1.4.0", - "bl": "^2.0.0", - "deep-strict-equal": "^0.2.0", - "events.once": "^2.0.2", - "glob": "^7.1.2", - "gunzip-maybe": "^1.4.1", - "hyperquest": "^2.1.3", - "lolex": "^2.6.0", - "nyc": "^11.0.0", - "pump": "^3.0.0", - "rimraf": "^2.6.2", - "tap": "^12.0.0", - "tape": "^4.9.0", - "tar-fs": "^1.16.2", - "util-promisify": "^2.1.0" - }, - "scripts": { - "test": "tap -J --no-esm test/parallel/*.js test/ours/*.js", - "ci": "TAP=1 tap --no-esm test/parallel/*.js test/ours/*.js | tee test.tap", - "test-browsers": "airtap --sauce-connect --loopback airtap.local -- test/browser.js", - "test-browser-local": "airtap --open --local -- test/browser.js", - "cover": "nyc npm test", - "report": "nyc report --reporter=lcov", - "update-browser-errors": "babel -o errors-browser.js errors.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/nodejs/readable-stream" - }, - "keywords": [ - "readable", - "stream", - "pipe" - ], - "browser": { - "util": false, - "worker_threads": false, - "./errors": "./errors-browser.js", - "./readable.js": "./readable-browser.js", - "./lib/internal/streams/from.js": "./lib/internal/streams/from-browser.js", - "./lib/internal/streams/stream.js": "./lib/internal/streams/stream-browser.js" - }, - "nyc": { - "include": [ - "lib/**.js" - ] - }, - "license": "MIT" -} diff --git a/node_modules/bl/node_modules/readable-stream/readable-browser.js b/node_modules/bl/node_modules/readable-stream/readable-browser.js deleted file mode 100644 index adbf60d..0000000 --- a/node_modules/bl/node_modules/readable-stream/readable-browser.js +++ /dev/null @@ -1,9 +0,0 @@ -exports = module.exports = require('./lib/_stream_readable.js'); -exports.Stream = exports; -exports.Readable = exports; -exports.Writable = require('./lib/_stream_writable.js'); -exports.Duplex = require('./lib/_stream_duplex.js'); -exports.Transform = require('./lib/_stream_transform.js'); -exports.PassThrough = require('./lib/_stream_passthrough.js'); -exports.finished = require('./lib/internal/streams/end-of-stream.js'); -exports.pipeline = require('./lib/internal/streams/pipeline.js'); diff --git a/node_modules/bl/node_modules/readable-stream/readable.js b/node_modules/bl/node_modules/readable-stream/readable.js deleted file mode 100644 index 9e0ca12..0000000 --- a/node_modules/bl/node_modules/readable-stream/readable.js +++ /dev/null @@ -1,16 +0,0 @@ -var Stream = require('stream'); -if (process.env.READABLE_STREAM === 'disable' && Stream) { - module.exports = Stream.Readable; - Object.assign(module.exports, Stream); - module.exports.Stream = Stream; -} else { - exports = module.exports = require('./lib/_stream_readable.js'); - exports.Stream = Stream || exports; - exports.Readable = exports; - exports.Writable = require('./lib/_stream_writable.js'); - exports.Duplex = require('./lib/_stream_duplex.js'); - exports.Transform = require('./lib/_stream_transform.js'); - exports.PassThrough = require('./lib/_stream_passthrough.js'); - exports.finished = require('./lib/internal/streams/end-of-stream.js'); - exports.pipeline = require('./lib/internal/streams/pipeline.js'); -} diff --git a/node_modules/bl/package.json b/node_modules/bl/package.json index 3b2be3f..1ffd252 100644 --- a/node_modules/bl/package.json +++ b/node_modules/bl/package.json @@ -1,12 +1,10 @@ { "name": "bl", - "version": "4.1.0", + "version": "1.2.3", "description": "Buffer List: collect buffers and access with a standard readable Buffer interface, streamable too!", - "license": "MIT", "main": "bl.js", "scripts": { - "lint": "standard *.js test/*.js", - "test": "npm run lint && node test/test.js | faucet" + "test": "node test/test.js | faucet" }, "repository": { "type": "git", @@ -24,14 +22,14 @@ "stream", "awesomesauce" ], + "license": "MIT", "dependencies": { - "buffer": "^5.5.0", - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" + "readable-stream": "^2.3.5", + "safe-buffer": "^5.1.1" }, "devDependencies": { - "faucet": "~0.0.1", - "standard": "^14.3.0", - "tape": "^4.11.0" + "faucet": "0.0.1", + "hash_file": "~0.1.1", + "tape": "~4.9.0" } } diff --git a/node_modules/bl/test/convert.js b/node_modules/bl/test/convert.js deleted file mode 100644 index 9f3e235..0000000 --- a/node_modules/bl/test/convert.js +++ /dev/null @@ -1,21 +0,0 @@ -'use strict' - -const tape = require('tape') -const { BufferList, BufferListStream } = require('../') -const { Buffer } = require('buffer') - -tape('convert from BufferList to BufferListStream', (t) => { - const data = Buffer.from(`TEST-${Date.now()}`) - const bl = new BufferList(data) - const bls = new BufferListStream(bl) - t.ok(bl.slice().equals(bls.slice())) - t.end() -}) - -tape('convert from BufferListStream to BufferList', (t) => { - const data = Buffer.from(`TEST-${Date.now()}`) - const bls = new BufferListStream(data) - const bl = new BufferList(bls) - t.ok(bl.slice().equals(bls.slice())) - t.end() -}) diff --git a/node_modules/bl/test/indexOf.js b/node_modules/bl/test/indexOf.js deleted file mode 100644 index 62dcb01..0000000 --- a/node_modules/bl/test/indexOf.js +++ /dev/null @@ -1,492 +0,0 @@ -'use strict' - -const tape = require('tape') -const BufferList = require('../') -const { Buffer } = require('buffer') - -tape('indexOf single byte needle', (t) => { - const bl = new BufferList(['abcdefg', 'abcdefg', '12345']) - - t.equal(bl.indexOf('e'), 4) - t.equal(bl.indexOf('e', 5), 11) - t.equal(bl.indexOf('e', 12), -1) - t.equal(bl.indexOf('5'), 18) - - t.end() -}) - -tape('indexOf multiple byte needle', (t) => { - const bl = new BufferList(['abcdefg', 'abcdefg']) - - t.equal(bl.indexOf('ef'), 4) - t.equal(bl.indexOf('ef', 5), 11) - - t.end() -}) - -tape('indexOf multiple byte needles across buffer boundaries', (t) => { - const bl = new BufferList(['abcdefg', 'abcdefg']) - - t.equal(bl.indexOf('fgabc'), 5) - - t.end() -}) - -tape('indexOf takes a Uint8Array search', (t) => { - const bl = new BufferList(['abcdefg', 'abcdefg']) - const search = new Uint8Array([102, 103, 97, 98, 99]) // fgabc - - t.equal(bl.indexOf(search), 5) - - t.end() -}) - -tape('indexOf takes a buffer list search', (t) => { - const bl = new BufferList(['abcdefg', 'abcdefg']) - const search = new BufferList('fgabc') - - t.equal(bl.indexOf(search), 5) - - t.end() -}) - -tape('indexOf a zero byte needle', (t) => { - const b = new BufferList('abcdef') - const bufEmpty = Buffer.from('') - - t.equal(b.indexOf(''), 0) - t.equal(b.indexOf('', 1), 1) - t.equal(b.indexOf('', b.length + 1), b.length) - t.equal(b.indexOf('', Infinity), b.length) - t.equal(b.indexOf(bufEmpty), 0) - t.equal(b.indexOf(bufEmpty, 1), 1) - t.equal(b.indexOf(bufEmpty, b.length + 1), b.length) - t.equal(b.indexOf(bufEmpty, Infinity), b.length) - - t.end() -}) - -tape('indexOf buffers smaller and larger than the needle', (t) => { - const bl = new BufferList(['abcdefg', 'a', 'bcdefg', 'a', 'bcfgab']) - - t.equal(bl.indexOf('fgabc'), 5) - t.equal(bl.indexOf('fgabc', 6), 12) - t.equal(bl.indexOf('fgabc', 13), -1) - - t.end() -}) - -// only present in node 6+ -;(process.version.substr(1).split('.')[0] >= 6) && tape('indexOf latin1 and binary encoding', (t) => { - const b = new BufferList('abcdef') - - // test latin1 encoding - t.equal( - new BufferList(Buffer.from(b.toString('latin1'), 'latin1')) - .indexOf('d', 0, 'latin1'), - 3 - ) - t.equal( - new BufferList(Buffer.from(b.toString('latin1'), 'latin1')) - .indexOf(Buffer.from('d', 'latin1'), 0, 'latin1'), - 3 - ) - t.equal( - new BufferList(Buffer.from('aa\u00e8aa', 'latin1')) - .indexOf('\u00e8', 'latin1'), - 2 - ) - t.equal( - new BufferList(Buffer.from('\u00e8', 'latin1')) - .indexOf('\u00e8', 'latin1'), - 0 - ) - t.equal( - new BufferList(Buffer.from('\u00e8', 'latin1')) - .indexOf(Buffer.from('\u00e8', 'latin1'), 'latin1'), - 0 - ) - - // test binary encoding - t.equal( - new BufferList(Buffer.from(b.toString('binary'), 'binary')) - .indexOf('d', 0, 'binary'), - 3 - ) - t.equal( - new BufferList(Buffer.from(b.toString('binary'), 'binary')) - .indexOf(Buffer.from('d', 'binary'), 0, 'binary'), - 3 - ) - t.equal( - new BufferList(Buffer.from('aa\u00e8aa', 'binary')) - .indexOf('\u00e8', 'binary'), - 2 - ) - t.equal( - new BufferList(Buffer.from('\u00e8', 'binary')) - .indexOf('\u00e8', 'binary'), - 0 - ) - t.equal( - new BufferList(Buffer.from('\u00e8', 'binary')) - .indexOf(Buffer.from('\u00e8', 'binary'), 'binary'), - 0 - ) - - t.end() -}) - -tape('indexOf the entire nodejs10 buffer test suite', (t) => { - const b = new BufferList('abcdef') - const bufA = Buffer.from('a') - const bufBc = Buffer.from('bc') - const bufF = Buffer.from('f') - const bufZ = Buffer.from('z') - - const stringComparison = 'abcdef' - - t.equal(b.indexOf('a'), 0) - t.equal(b.indexOf('a', 1), -1) - t.equal(b.indexOf('a', -1), -1) - t.equal(b.indexOf('a', -4), -1) - t.equal(b.indexOf('a', -b.length), 0) - t.equal(b.indexOf('a', NaN), 0) - t.equal(b.indexOf('a', -Infinity), 0) - t.equal(b.indexOf('a', Infinity), -1) - t.equal(b.indexOf('bc'), 1) - t.equal(b.indexOf('bc', 2), -1) - t.equal(b.indexOf('bc', -1), -1) - t.equal(b.indexOf('bc', -3), -1) - t.equal(b.indexOf('bc', -5), 1) - t.equal(b.indexOf('bc', NaN), 1) - t.equal(b.indexOf('bc', -Infinity), 1) - t.equal(b.indexOf('bc', Infinity), -1) - t.equal(b.indexOf('f'), b.length - 1) - t.equal(b.indexOf('z'), -1) - - // empty search tests - t.equal(b.indexOf(bufA), 0) - t.equal(b.indexOf(bufA, 1), -1) - t.equal(b.indexOf(bufA, -1), -1) - t.equal(b.indexOf(bufA, -4), -1) - t.equal(b.indexOf(bufA, -b.length), 0) - t.equal(b.indexOf(bufA, NaN), 0) - t.equal(b.indexOf(bufA, -Infinity), 0) - t.equal(b.indexOf(bufA, Infinity), -1) - t.equal(b.indexOf(bufBc), 1) - t.equal(b.indexOf(bufBc, 2), -1) - t.equal(b.indexOf(bufBc, -1), -1) - t.equal(b.indexOf(bufBc, -3), -1) - t.equal(b.indexOf(bufBc, -5), 1) - t.equal(b.indexOf(bufBc, NaN), 1) - t.equal(b.indexOf(bufBc, -Infinity), 1) - t.equal(b.indexOf(bufBc, Infinity), -1) - t.equal(b.indexOf(bufF), b.length - 1) - t.equal(b.indexOf(bufZ), -1) - t.equal(b.indexOf(0x61), 0) - t.equal(b.indexOf(0x61, 1), -1) - t.equal(b.indexOf(0x61, -1), -1) - t.equal(b.indexOf(0x61, -4), -1) - t.equal(b.indexOf(0x61, -b.length), 0) - t.equal(b.indexOf(0x61, NaN), 0) - t.equal(b.indexOf(0x61, -Infinity), 0) - t.equal(b.indexOf(0x61, Infinity), -1) - t.equal(b.indexOf(0x0), -1) - - // test offsets - t.equal(b.indexOf('d', 2), 3) - t.equal(b.indexOf('f', 5), 5) - t.equal(b.indexOf('f', -1), 5) - t.equal(b.indexOf('f', 6), -1) - - t.equal(b.indexOf(Buffer.from('d'), 2), 3) - t.equal(b.indexOf(Buffer.from('f'), 5), 5) - t.equal(b.indexOf(Buffer.from('f'), -1), 5) - t.equal(b.indexOf(Buffer.from('f'), 6), -1) - - t.equal(Buffer.from('ff').indexOf(Buffer.from('f'), 1, 'ucs2'), -1) - - // test invalid and uppercase encoding - t.equal(b.indexOf('b', 'utf8'), 1) - t.equal(b.indexOf('b', 'UTF8'), 1) - t.equal(b.indexOf('62', 'HEX'), 1) - t.throws(() => b.indexOf('bad', 'enc'), TypeError) - - // test hex encoding - t.equal( - Buffer.from(b.toString('hex'), 'hex') - .indexOf('64', 0, 'hex'), - 3 - ) - t.equal( - Buffer.from(b.toString('hex'), 'hex') - .indexOf(Buffer.from('64', 'hex'), 0, 'hex'), - 3 - ) - - // test base64 encoding - t.equal( - Buffer.from(b.toString('base64'), 'base64') - .indexOf('ZA==', 0, 'base64'), - 3 - ) - t.equal( - Buffer.from(b.toString('base64'), 'base64') - .indexOf(Buffer.from('ZA==', 'base64'), 0, 'base64'), - 3 - ) - - // test ascii encoding - t.equal( - Buffer.from(b.toString('ascii'), 'ascii') - .indexOf('d', 0, 'ascii'), - 3 - ) - t.equal( - Buffer.from(b.toString('ascii'), 'ascii') - .indexOf(Buffer.from('d', 'ascii'), 0, 'ascii'), - 3 - ) - - // test optional offset with passed encoding - t.equal(Buffer.from('aaaa0').indexOf('30', 'hex'), 4) - t.equal(Buffer.from('aaaa00a').indexOf('3030', 'hex'), 4) - - { - // test usc2 encoding - const twoByteString = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'ucs2') - - t.equal(8, twoByteString.indexOf('\u0395', 4, 'ucs2')) - t.equal(6, twoByteString.indexOf('\u03a3', -4, 'ucs2')) - t.equal(4, twoByteString.indexOf('\u03a3', -6, 'ucs2')) - t.equal(4, twoByteString.indexOf( - Buffer.from('\u03a3', 'ucs2'), -6, 'ucs2')) - t.equal(-1, twoByteString.indexOf('\u03a3', -2, 'ucs2')) - } - - const mixedByteStringUcs2 = - Buffer.from('\u039a\u0391abc\u03a3\u03a3\u0395', 'ucs2') - - t.equal(6, mixedByteStringUcs2.indexOf('bc', 0, 'ucs2')) - t.equal(10, mixedByteStringUcs2.indexOf('\u03a3', 0, 'ucs2')) - t.equal(-1, mixedByteStringUcs2.indexOf('\u0396', 0, 'ucs2')) - - t.equal( - 6, mixedByteStringUcs2.indexOf(Buffer.from('bc', 'ucs2'), 0, 'ucs2')) - t.equal( - 10, mixedByteStringUcs2.indexOf(Buffer.from('\u03a3', 'ucs2'), 0, 'ucs2')) - t.equal( - -1, mixedByteStringUcs2.indexOf(Buffer.from('\u0396', 'ucs2'), 0, 'ucs2')) - - { - const twoByteString = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'ucs2') - - // Test single char pattern - t.equal(0, twoByteString.indexOf('\u039a', 0, 'ucs2')) - let index = twoByteString.indexOf('\u0391', 0, 'ucs2') - t.equal(2, index, `Alpha - at index ${index}`) - index = twoByteString.indexOf('\u03a3', 0, 'ucs2') - t.equal(4, index, `First Sigma - at index ${index}`) - index = twoByteString.indexOf('\u03a3', 6, 'ucs2') - t.equal(6, index, `Second Sigma - at index ${index}`) - index = twoByteString.indexOf('\u0395', 0, 'ucs2') - t.equal(8, index, `Epsilon - at index ${index}`) - index = twoByteString.indexOf('\u0392', 0, 'ucs2') - t.equal(-1, index, `Not beta - at index ${index}`) - - // Test multi-char pattern - index = twoByteString.indexOf('\u039a\u0391', 0, 'ucs2') - t.equal(0, index, `Lambda Alpha - at index ${index}`) - index = twoByteString.indexOf('\u0391\u03a3', 0, 'ucs2') - t.equal(2, index, `Alpha Sigma - at index ${index}`) - index = twoByteString.indexOf('\u03a3\u03a3', 0, 'ucs2') - t.equal(4, index, `Sigma Sigma - at index ${index}`) - index = twoByteString.indexOf('\u03a3\u0395', 0, 'ucs2') - t.equal(6, index, `Sigma Epsilon - at index ${index}`) - } - - const mixedByteStringUtf8 = Buffer.from('\u039a\u0391abc\u03a3\u03a3\u0395') - - t.equal(5, mixedByteStringUtf8.indexOf('bc')) - t.equal(5, mixedByteStringUtf8.indexOf('bc', 5)) - t.equal(5, mixedByteStringUtf8.indexOf('bc', -8)) - t.equal(7, mixedByteStringUtf8.indexOf('\u03a3')) - t.equal(-1, mixedByteStringUtf8.indexOf('\u0396')) - - // Test complex string indexOf algorithms. Only trigger for long strings. - // Long string that isn't a simple repeat of a shorter string. - let longString = 'A' - for (let i = 66; i < 76; i++) { // from 'B' to 'K' - longString = longString + String.fromCharCode(i) + longString - } - - const longBufferString = Buffer.from(longString) - - // pattern of 15 chars, repeated every 16 chars in long - let pattern = 'ABACABADABACABA' - for (let i = 0; i < longBufferString.length - pattern.length; i += 7) { - const index = longBufferString.indexOf(pattern, i) - t.equal((i + 15) & ~0xf, index, - `Long ABACABA...-string at index ${i}`) - } - - let index = longBufferString.indexOf('AJABACA') - t.equal(510, index, `Long AJABACA, First J - at index ${index}`) - index = longBufferString.indexOf('AJABACA', 511) - t.equal(1534, index, `Long AJABACA, Second J - at index ${index}`) - - pattern = 'JABACABADABACABA' - index = longBufferString.indexOf(pattern) - t.equal(511, index, `Long JABACABA..., First J - at index ${index}`) - index = longBufferString.indexOf(pattern, 512) - t.equal( - 1535, index, `Long JABACABA..., Second J - at index ${index}`) - - // Search for a non-ASCII string in a pure ASCII string. - const asciiString = Buffer.from( - 'somethingnotatallsinisterwhichalsoworks') - t.equal(-1, asciiString.indexOf('\x2061')) - t.equal(3, asciiString.indexOf('eth', 0)) - - // Search in string containing many non-ASCII chars. - const allCodePoints = [] - for (let i = 0; i < 65536; i++) { - allCodePoints[i] = i - } - - const allCharsString = String.fromCharCode.apply(String, allCodePoints) - const allCharsBufferUtf8 = Buffer.from(allCharsString) - const allCharsBufferUcs2 = Buffer.from(allCharsString, 'ucs2') - - // Search for string long enough to trigger complex search with ASCII pattern - // and UC16 subject. - t.equal(-1, allCharsBufferUtf8.indexOf('notfound')) - t.equal(-1, allCharsBufferUcs2.indexOf('notfound')) - - // Needle is longer than haystack, but only because it's encoded as UTF-16 - t.equal(Buffer.from('aaaa').indexOf('a'.repeat(4), 'ucs2'), -1) - - t.equal(Buffer.from('aaaa').indexOf('a'.repeat(4), 'utf8'), 0) - t.equal(Buffer.from('aaaa').indexOf('你好', 'ucs2'), -1) - - // Haystack has odd length, but the needle is UCS2. - t.equal(Buffer.from('aaaaa').indexOf('b', 'ucs2'), -1) - - { - // Find substrings in Utf8. - const lengths = [1, 3, 15] // Single char, simple and complex. - const indices = [0x5, 0x60, 0x400, 0x680, 0x7ee, 0xFF02, 0x16610, 0x2f77b] - for (let lengthIndex = 0; lengthIndex < lengths.length; lengthIndex++) { - for (let i = 0; i < indices.length; i++) { - const index = indices[i] - let length = lengths[lengthIndex] - - if (index + length > 0x7F) { - length = 2 * length - } - - if (index + length > 0x7FF) { - length = 3 * length - } - - if (index + length > 0xFFFF) { - length = 4 * length - } - - const patternBufferUtf8 = allCharsBufferUtf8.slice(index, index + length) - t.equal(index, allCharsBufferUtf8.indexOf(patternBufferUtf8)) - - const patternStringUtf8 = patternBufferUtf8.toString() - t.equal(index, allCharsBufferUtf8.indexOf(patternStringUtf8)) - } - } - } - - { - // Find substrings in Usc2. - const lengths = [2, 4, 16] // Single char, simple and complex. - const indices = [0x5, 0x65, 0x105, 0x205, 0x285, 0x2005, 0x2085, 0xfff0] - - for (let lengthIndex = 0; lengthIndex < lengths.length; lengthIndex++) { - for (let i = 0; i < indices.length; i++) { - const index = indices[i] * 2 - const length = lengths[lengthIndex] - - const patternBufferUcs2 = - allCharsBufferUcs2.slice(index, index + length) - t.equal( - index, allCharsBufferUcs2.indexOf(patternBufferUcs2, 0, 'ucs2')) - - const patternStringUcs2 = patternBufferUcs2.toString('ucs2') - t.equal( - index, allCharsBufferUcs2.indexOf(patternStringUcs2, 0, 'ucs2')) - } - } - } - - [ - () => {}, - {}, - [] - ].forEach((val) => { - t.throws(() => b.indexOf(val), TypeError, `"${JSON.stringify(val)}" should throw`) - }) - - // Test weird offset arguments. - // The following offsets coerce to NaN or 0, searching the whole Buffer - t.equal(b.indexOf('b', undefined), 1) - t.equal(b.indexOf('b', {}), 1) - t.equal(b.indexOf('b', 0), 1) - t.equal(b.indexOf('b', null), 1) - t.equal(b.indexOf('b', []), 1) - - // The following offset coerces to 2, in other words +[2] === 2 - t.equal(b.indexOf('b', [2]), -1) - - // Behavior should match String.indexOf() - t.equal( - b.indexOf('b', undefined), - stringComparison.indexOf('b', undefined)) - t.equal( - b.indexOf('b', {}), - stringComparison.indexOf('b', {})) - t.equal( - b.indexOf('b', 0), - stringComparison.indexOf('b', 0)) - t.equal( - b.indexOf('b', null), - stringComparison.indexOf('b', null)) - t.equal( - b.indexOf('b', []), - stringComparison.indexOf('b', [])) - t.equal( - b.indexOf('b', [2]), - stringComparison.indexOf('b', [2])) - - // test truncation of Number arguments to uint8 - { - const buf = Buffer.from('this is a test') - - t.equal(buf.indexOf(0x6973), 3) - t.equal(buf.indexOf(0x697320), 4) - t.equal(buf.indexOf(0x69732069), 2) - t.equal(buf.indexOf(0x697374657374), 0) - t.equal(buf.indexOf(0x69737374), 0) - t.equal(buf.indexOf(0x69737465), 11) - t.equal(buf.indexOf(0x69737465), 11) - t.equal(buf.indexOf(-140), 0) - t.equal(buf.indexOf(-152), 1) - t.equal(buf.indexOf(0xff), -1) - t.equal(buf.indexOf(0xffff), -1) - } - - // Test that Uint8Array arguments are okay. - { - const needle = new Uint8Array([0x66, 0x6f, 0x6f]) - const haystack = new BufferList(Buffer.from('a foo b foo')) - t.equal(haystack.indexOf(needle), 2) - } - - t.end() -}) diff --git a/node_modules/bl/test/isBufferList.js b/node_modules/bl/test/isBufferList.js deleted file mode 100644 index 9d895d5..0000000 --- a/node_modules/bl/test/isBufferList.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict' - -const tape = require('tape') -const { BufferList, BufferListStream } = require('../') -const { Buffer } = require('buffer') - -tape('isBufferList positives', (t) => { - t.ok(BufferList.isBufferList(new BufferList())) - t.ok(BufferList.isBufferList(new BufferListStream())) - - t.end() -}) - -tape('isBufferList negatives', (t) => { - const types = [ - null, - undefined, - NaN, - true, - false, - {}, - [], - Buffer.alloc(0), - [Buffer.alloc(0)] - ] - - for (const obj of types) { - t.notOk(BufferList.isBufferList(obj)) - } - - t.end() -}) diff --git a/node_modules/bl/test/test.js b/node_modules/bl/test/test.js index e523d0c..dac1861 100644 --- a/node_modules/bl/test/test.js +++ b/node_modules/bl/test/test.js @@ -1,39 +1,30 @@ -'use strict' +var tape = require('tape') + , crypto = require('crypto') + , fs = require('fs') + , hash = require('hash_file') + , BufferList = require('../') + , Buffer = require('safe-buffer').Buffer -const tape = require('tape') -const crypto = require('crypto') -const fs = require('fs') -const path = require('path') -const BufferList = require('../') -const { Buffer } = require('buffer') - -const encodings = - ('hex utf8 utf-8 ascii binary base64' + - (process.browser ? '' : ' ucs2 ucs-2 utf16le utf-16le')).split(' ') - -require('./indexOf') -require('./isBufferList') -require('./convert') + , encodings = + ('hex utf8 utf-8 ascii binary base64' + + (process.browser ? '' : ' ucs2 ucs-2 utf16le utf-16le')).split(' ') tape('single bytes from single buffer', function (t) { - const bl = new BufferList() - + var bl = new BufferList() bl.append(Buffer.from('abcd')) t.equal(bl.length, 4) - t.equal(bl.get(-1), undefined) + t.equal(bl.get(0), 97) t.equal(bl.get(1), 98) t.equal(bl.get(2), 99) t.equal(bl.get(3), 100) - t.equal(bl.get(4), undefined) t.end() }) tape('single bytes from multiple buffers', function (t) { - const bl = new BufferList() - + var bl = new BufferList() bl.append(Buffer.from('abcd')) bl.append(Buffer.from('efg')) bl.append(Buffer.from('hi')) @@ -51,13 +42,11 @@ tape('single bytes from multiple buffers', function (t) { t.equal(bl.get(7), 104) t.equal(bl.get(8), 105) t.equal(bl.get(9), 106) - t.end() }) tape('multi bytes from single buffer', function (t) { - const bl = new BufferList() - + var bl = new BufferList() bl.append(Buffer.from('abcd')) t.equal(bl.length, 4) @@ -71,8 +60,7 @@ tape('multi bytes from single buffer', function (t) { }) tape('multi bytes from single buffer (negative indexes)', function (t) { - const bl = new BufferList() - + var bl = new BufferList() bl.append(Buffer.from('buffer')) t.equal(bl.length, 6) @@ -85,7 +73,7 @@ tape('multi bytes from single buffer (negative indexes)', function (t) { }) tape('multiple bytes from multiple buffers', function (t) { - const bl = new BufferList() + var bl = new BufferList() bl.append(Buffer.from('abcd')) bl.append(Buffer.from('efg')) @@ -105,10 +93,10 @@ tape('multiple bytes from multiple buffers', function (t) { }) tape('multiple bytes from multiple buffer lists', function (t) { - const bl = new BufferList() + var bl = new BufferList() - bl.append(new BufferList([Buffer.from('abcd'), Buffer.from('efg')])) - bl.append(new BufferList([Buffer.from('hi'), Buffer.from('j')])) + bl.append(new BufferList([ Buffer.from('abcd'), Buffer.from('efg') ])) + bl.append(new BufferList([ Buffer.from('hi'), Buffer.from('j') ])) t.equal(bl.length, 10) @@ -124,16 +112,16 @@ tape('multiple bytes from multiple buffer lists', function (t) { // same data as previous test, just using nested constructors tape('multiple bytes from crazy nested buffer lists', function (t) { - const bl = new BufferList() + var bl = new BufferList() bl.append(new BufferList([ - new BufferList([ - new BufferList(Buffer.from('abc')), - Buffer.from('d'), - new BufferList(Buffer.from('efg')) - ]), - new BufferList([Buffer.from('hi')]), - new BufferList(Buffer.from('j')) + new BufferList([ + new BufferList(Buffer.from('abc')) + , Buffer.from('d') + , new BufferList(Buffer.from('efg')) + ]) + , new BufferList([ Buffer.from('hi') ]) + , new BufferList(Buffer.from('j')) ])) t.equal(bl.length, 10) @@ -149,69 +137,49 @@ tape('multiple bytes from crazy nested buffer lists', function (t) { }) tape('append accepts arrays of Buffers', function (t) { - const bl = new BufferList() - + var bl = new BufferList() bl.append(Buffer.from('abc')) - bl.append([Buffer.from('def')]) - bl.append([Buffer.from('ghi'), Buffer.from('jkl')]) - bl.append([Buffer.from('mnop'), Buffer.from('qrstu'), Buffer.from('vwxyz')]) + bl.append([ Buffer.from('def') ]) + bl.append([ Buffer.from('ghi'), Buffer.from('jkl') ]) + bl.append([ Buffer.from('mnop'), Buffer.from('qrstu'), Buffer.from('vwxyz') ]) t.equal(bl.length, 26) t.equal(bl.slice().toString('ascii'), 'abcdefghijklmnopqrstuvwxyz') - - t.end() -}) - -tape('append accepts arrays of Uint8Arrays', function (t) { - const bl = new BufferList() - - bl.append(new Uint8Array([97, 98, 99])) - bl.append([Uint8Array.from([100, 101, 102])]) - bl.append([new Uint8Array([103, 104, 105]), new Uint8Array([106, 107, 108])]) - bl.append([new Uint8Array([109, 110, 111, 112]), new Uint8Array([113, 114, 115, 116, 117]), new Uint8Array([118, 119, 120, 121, 122])]) - t.equal(bl.length, 26) - t.equal(bl.slice().toString('ascii'), 'abcdefghijklmnopqrstuvwxyz') - t.end() }) tape('append accepts arrays of BufferLists', function (t) { - const bl = new BufferList() - + var bl = new BufferList() bl.append(Buffer.from('abc')) - bl.append([new BufferList('def')]) - bl.append(new BufferList([Buffer.from('ghi'), new BufferList('jkl')])) - bl.append([Buffer.from('mnop'), new BufferList([Buffer.from('qrstu'), Buffer.from('vwxyz')])]) + bl.append([ new BufferList('def') ]) + bl.append(new BufferList([ Buffer.from('ghi'), new BufferList('jkl') ])) + bl.append([ Buffer.from('mnop'), new BufferList([ Buffer.from('qrstu'), Buffer.from('vwxyz') ]) ]) t.equal(bl.length, 26) t.equal(bl.slice().toString('ascii'), 'abcdefghijklmnopqrstuvwxyz') - t.end() }) tape('append chainable', function (t) { - const bl = new BufferList() - + var bl = new BufferList() t.ok(bl.append(Buffer.from('abcd')) === bl) - t.ok(bl.append([Buffer.from('abcd')]) === bl) + t.ok(bl.append([ Buffer.from('abcd') ]) === bl) t.ok(bl.append(new BufferList(Buffer.from('abcd'))) === bl) - t.ok(bl.append([new BufferList(Buffer.from('abcd'))]) === bl) - + t.ok(bl.append([ new BufferList(Buffer.from('abcd')) ]) === bl) t.end() }) tape('append chainable (test results)', function (t) { - const bl = new BufferList('abc') - .append([new BufferList('def')]) - .append(new BufferList([Buffer.from('ghi'), new BufferList('jkl')])) - .append([Buffer.from('mnop'), new BufferList([Buffer.from('qrstu'), Buffer.from('vwxyz')])]) + var bl = new BufferList('abc') + .append([ new BufferList('def') ]) + .append(new BufferList([ Buffer.from('ghi'), new BufferList('jkl') ])) + .append([ Buffer.from('mnop'), new BufferList([ Buffer.from('qrstu'), Buffer.from('vwxyz') ]) ]) t.equal(bl.length, 26) t.equal(bl.slice().toString('ascii'), 'abcdefghijklmnopqrstuvwxyz') - t.end() }) tape('consuming from multiple buffers', function (t) { - const bl = new BufferList() + var bl = new BufferList() bl.append(Buffer.from('abcd')) bl.append(Buffer.from('efg')) @@ -246,7 +214,7 @@ tape('consuming from multiple buffers', function (t) { }) tape('complete consumption', function (t) { - const bl = new BufferList() + var bl = new BufferList() bl.append(Buffer.from('a')) bl.append(Buffer.from('b')) @@ -260,12 +228,11 @@ tape('complete consumption', function (t) { }) tape('test readUInt8 / readInt8', function (t) { - const buf1 = Buffer.alloc(1) - const buf2 = Buffer.alloc(3) - const buf3 = Buffer.alloc(3) - const bl = new BufferList() + var buf1 = Buffer.alloc(1) + , buf2 = Buffer.alloc(3) + , buf3 = Buffer.alloc(3) + , bl = new BufferList() - buf1[0] = 0x1 buf2[1] = 0x3 buf2[2] = 0x4 buf3[0] = 0x23 @@ -275,7 +242,6 @@ tape('test readUInt8 / readInt8', function (t) { bl.append(buf2) bl.append(buf3) - t.equal(bl.readUInt8(), 0x1) t.equal(bl.readUInt8(2), 0x3) t.equal(bl.readInt8(2), 0x3) t.equal(bl.readUInt8(3), 0x4) @@ -284,17 +250,15 @@ tape('test readUInt8 / readInt8', function (t) { t.equal(bl.readInt8(4), 0x23) t.equal(bl.readUInt8(5), 0x42) t.equal(bl.readInt8(5), 0x42) - t.end() }) tape('test readUInt16LE / readUInt16BE / readInt16LE / readInt16BE', function (t) { - const buf1 = Buffer.alloc(1) - const buf2 = Buffer.alloc(3) - const buf3 = Buffer.alloc(3) - const bl = new BufferList() + var buf1 = Buffer.alloc(1) + , buf2 = Buffer.alloc(3) + , buf3 = Buffer.alloc(3) + , bl = new BufferList() - buf1[0] = 0x1 buf2[1] = 0x3 buf2[2] = 0x4 buf3[0] = 0x23 @@ -304,8 +268,6 @@ tape('test readUInt16LE / readUInt16BE / readInt16LE / readInt16BE', function (t bl.append(buf2) bl.append(buf3) - t.equal(bl.readUInt16BE(), 0x0100) - t.equal(bl.readUInt16LE(), 0x0001) t.equal(bl.readUInt16BE(2), 0x0304) t.equal(bl.readUInt16LE(2), 0x0403) t.equal(bl.readInt16BE(2), 0x0304) @@ -318,17 +280,15 @@ tape('test readUInt16LE / readUInt16BE / readInt16LE / readInt16BE', function (t t.equal(bl.readUInt16LE(4), 0x4223) t.equal(bl.readInt16BE(4), 0x2342) t.equal(bl.readInt16LE(4), 0x4223) - t.end() }) tape('test readUInt32LE / readUInt32BE / readInt32LE / readInt32BE', function (t) { - const buf1 = Buffer.alloc(1) - const buf2 = Buffer.alloc(3) - const buf3 = Buffer.alloc(3) - const bl = new BufferList() + var buf1 = Buffer.alloc(1) + , buf2 = Buffer.alloc(3) + , buf3 = Buffer.alloc(3) + , bl = new BufferList() - buf1[0] = 0x1 buf2[1] = 0x3 buf2[2] = 0x4 buf3[0] = 0x23 @@ -338,68 +298,19 @@ tape('test readUInt32LE / readUInt32BE / readInt32LE / readInt32BE', function (t bl.append(buf2) bl.append(buf3) - t.equal(bl.readUInt32BE(), 0x01000304) - t.equal(bl.readUInt32LE(), 0x04030001) t.equal(bl.readUInt32BE(2), 0x03042342) t.equal(bl.readUInt32LE(2), 0x42230403) t.equal(bl.readInt32BE(2), 0x03042342) t.equal(bl.readInt32LE(2), 0x42230403) - - t.end() -}) - -tape('test readUIntLE / readUIntBE / readIntLE / readIntBE', function (t) { - const buf1 = Buffer.alloc(1) - const buf2 = Buffer.alloc(3) - const buf3 = Buffer.alloc(3) - const bl = new BufferList() - - buf2[0] = 0x2 - buf2[1] = 0x3 - buf2[2] = 0x4 - buf3[0] = 0x23 - buf3[1] = 0x42 - buf3[2] = 0x61 - - bl.append(buf1) - bl.append(buf2) - bl.append(buf3) - - t.equal(bl.readUIntBE(1, 1), 0x02) - t.equal(bl.readUIntBE(1, 2), 0x0203) - t.equal(bl.readUIntBE(1, 3), 0x020304) - t.equal(bl.readUIntBE(1, 4), 0x02030423) - t.equal(bl.readUIntBE(1, 5), 0x0203042342) - t.equal(bl.readUIntBE(1, 6), 0x020304234261) - t.equal(bl.readUIntLE(1, 1), 0x02) - t.equal(bl.readUIntLE(1, 2), 0x0302) - t.equal(bl.readUIntLE(1, 3), 0x040302) - t.equal(bl.readUIntLE(1, 4), 0x23040302) - t.equal(bl.readUIntLE(1, 5), 0x4223040302) - t.equal(bl.readUIntLE(1, 6), 0x614223040302) - t.equal(bl.readIntBE(1, 1), 0x02) - t.equal(bl.readIntBE(1, 2), 0x0203) - t.equal(bl.readIntBE(1, 3), 0x020304) - t.equal(bl.readIntBE(1, 4), 0x02030423) - t.equal(bl.readIntBE(1, 5), 0x0203042342) - t.equal(bl.readIntBE(1, 6), 0x020304234261) - t.equal(bl.readIntLE(1, 1), 0x02) - t.equal(bl.readIntLE(1, 2), 0x0302) - t.equal(bl.readIntLE(1, 3), 0x040302) - t.equal(bl.readIntLE(1, 4), 0x23040302) - t.equal(bl.readIntLE(1, 5), 0x4223040302) - t.equal(bl.readIntLE(1, 6), 0x614223040302) - t.end() }) tape('test readFloatLE / readFloatBE', function (t) { - const buf1 = Buffer.alloc(1) - const buf2 = Buffer.alloc(3) - const buf3 = Buffer.alloc(3) - const bl = new BufferList() + var buf1 = Buffer.alloc(1) + , buf2 = Buffer.alloc(3) + , buf3 = Buffer.alloc(3) + , bl = new BufferList() - buf1[0] = 0x01 buf2[1] = 0x00 buf2[2] = 0x00 buf3[0] = 0x80 @@ -409,22 +320,16 @@ tape('test readFloatLE / readFloatBE', function (t) { bl.append(buf2) bl.append(buf3) - const canonical = Buffer.concat([buf1, buf2, buf3]) - t.equal(bl.readFloatLE(), canonical.readFloatLE()) - t.equal(bl.readFloatBE(), canonical.readFloatBE()) - t.equal(bl.readFloatLE(2), canonical.readFloatLE(2)) - t.equal(bl.readFloatBE(2), canonical.readFloatBE(2)) - + t.equal(bl.readFloatLE(2), 0x01) t.end() }) tape('test readDoubleLE / readDoubleBE', function (t) { - const buf1 = Buffer.alloc(1) - const buf2 = Buffer.alloc(3) - const buf3 = Buffer.alloc(10) - const bl = new BufferList() + var buf1 = Buffer.alloc(1) + , buf2 = Buffer.alloc(3) + , buf3 = Buffer.alloc(10) + , bl = new BufferList() - buf1[0] = 0x01 buf2[1] = 0x55 buf2[2] = 0x55 buf3[0] = 0x55 @@ -438,17 +343,12 @@ tape('test readDoubleLE / readDoubleBE', function (t) { bl.append(buf2) bl.append(buf3) - const canonical = Buffer.concat([buf1, buf2, buf3]) - t.equal(bl.readDoubleBE(), canonical.readDoubleBE()) - t.equal(bl.readDoubleLE(), canonical.readDoubleLE()) - t.equal(bl.readDoubleBE(2), canonical.readDoubleBE(2)) - t.equal(bl.readDoubleLE(2), canonical.readDoubleLE(2)) - + t.equal(bl.readDoubleLE(2), 0.3333333333333333) t.end() }) tape('test toString', function (t) { - const bl = new BufferList() + var bl = new BufferList() bl.append(Buffer.from('abcd')) bl.append(Buffer.from('efg')) @@ -465,8 +365,8 @@ tape('test toString', function (t) { }) tape('test toString encoding', function (t) { - const bl = new BufferList() - const b = Buffer.from('abcdefghij\xff\x00') + var bl = new BufferList() + , b = Buffer.from('abcdefghij\xff\x00') bl.append(Buffer.from('abcd')) bl.append(Buffer.from('efg')) @@ -475,8 +375,8 @@ tape('test toString encoding', function (t) { bl.append(Buffer.from('\xff\x00')) encodings.forEach(function (enc) { - t.equal(bl.toString(enc), b.toString(enc), enc) - }) + t.equal(bl.toString(enc), b.toString(enc), enc) + }) t.end() }) @@ -498,47 +398,45 @@ tape('uninitialized memory', function (t) { }) !process.browser && tape('test stream', function (t) { - const random = crypto.randomBytes(65534) + var random = crypto.randomBytes(65534) + , rndhash = hash(random, 'md5') + , md5sum = crypto.createHash('md5') + , bl = new BufferList(function (err, buf) { + t.ok(Buffer.isBuffer(buf)) + t.ok(err === null) + t.equal(rndhash, hash(bl.slice(), 'md5')) + t.equal(rndhash, hash(buf, 'md5')) - const bl = new BufferList((err, buf) => { - t.ok(Buffer.isBuffer(buf)) - t.ok(err === null) - t.ok(random.equals(bl.slice())) - t.ok(random.equals(buf.slice())) + bl.pipe(fs.createWriteStream('/tmp/bl_test_rnd_out.dat')) + .on('close', function () { + var s = fs.createReadStream('/tmp/bl_test_rnd_out.dat') + s.on('data', md5sum.update.bind(md5sum)) + s.on('end', function() { + t.equal(rndhash, md5sum.digest('hex'), 'woohoo! correct hash!') + t.end() + }) + }) - bl.pipe(fs.createWriteStream('/tmp/bl_test_rnd_out.dat')) - .on('close', function () { - const rndhash = crypto.createHash('md5').update(random).digest('hex') - const md5sum = crypto.createHash('md5') - const s = fs.createReadStream('/tmp/bl_test_rnd_out.dat') - - s.on('data', md5sum.update.bind(md5sum)) - s.on('end', function () { - t.equal(rndhash, md5sum.digest('hex'), 'woohoo! correct hash!') - t.end() - }) }) - }) fs.writeFileSync('/tmp/bl_test_rnd.dat', random) fs.createReadStream('/tmp/bl_test_rnd.dat').pipe(bl) }) tape('instantiation with Buffer', function (t) { - const buf = crypto.randomBytes(1024) - const buf2 = crypto.randomBytes(1024) - let b = BufferList(buf) + var buf = crypto.randomBytes(1024) + , buf2 = crypto.randomBytes(1024) + , b = BufferList(buf) t.equal(buf.toString('hex'), b.slice().toString('hex'), 'same buffer') - b = BufferList([buf, buf2]) - t.equal(b.slice().toString('hex'), Buffer.concat([buf, buf2]).toString('hex'), 'same buffer') - + b = BufferList([ buf, buf2 ]) + t.equal(b.slice().toString('hex'), Buffer.concat([ buf, buf2 ]).toString('hex'), 'same buffer') t.end() }) tape('test String appendage', function (t) { - const bl = new BufferList() - const b = Buffer.from('abcdefghij\xff\x00') + var bl = new BufferList() + , b = Buffer.from('abcdefghij\xff\x00') bl.append('abcd') bl.append('efg') @@ -547,15 +445,15 @@ tape('test String appendage', function (t) { bl.append('\xff\x00') encodings.forEach(function (enc) { - t.equal(bl.toString(enc), b.toString(enc)) - }) + t.equal(bl.toString(enc), b.toString(enc)) + }) t.end() }) tape('test Number appendage', function (t) { - const bl = new BufferList() - const b = Buffer.from('1234567890') + var bl = new BufferList() + , b = Buffer.from('1234567890') bl.append(1234) bl.append(567) @@ -563,8 +461,8 @@ tape('test Number appendage', function (t) { bl.append(0) encodings.forEach(function (enc) { - t.equal(bl.toString(enc), b.toString(enc)) - }) + t.equal(bl.toString(enc), b.toString(enc)) + }) t.end() }) @@ -581,12 +479,10 @@ tape('write nothing, should get empty buffer', function (t) { tape('unicode string', function (t) { t.plan(2) - - const inp1 = '\u2600' - const inp2 = '\u2603' - const exp = inp1 + ' and ' + inp2 - const bl = BufferList() - + var inp1 = '\u2600' + , inp2 = '\u2603' + , exp = inp1 + ' and ' + inp2 + , bl = BufferList() bl.write(inp1) bl.write(' and ') bl.write(inp2) @@ -595,8 +491,8 @@ tape('unicode string', function (t) { }) tape('should emit finish', function (t) { - const source = BufferList() - const dest = BufferList() + var source = BufferList() + , dest = BufferList() source.write('hello') source.pipe(dest) @@ -608,100 +504,90 @@ tape('should emit finish', function (t) { }) tape('basic copy', function (t) { - const buf = crypto.randomBytes(1024) - const buf2 = Buffer.alloc(1024) - const b = BufferList(buf) + var buf = crypto.randomBytes(1024) + , buf2 = Buffer.alloc(1024) + , b = BufferList(buf) b.copy(buf2) t.equal(b.slice().toString('hex'), buf2.toString('hex'), 'same buffer') - t.end() }) tape('copy after many appends', function (t) { - const buf = crypto.randomBytes(512) - const buf2 = Buffer.alloc(1024) - const b = BufferList(buf) + var buf = crypto.randomBytes(512) + , buf2 = Buffer.alloc(1024) + , b = BufferList(buf) b.append(buf) b.copy(buf2) t.equal(b.slice().toString('hex'), buf2.toString('hex'), 'same buffer') - t.end() }) tape('copy at a precise position', function (t) { - const buf = crypto.randomBytes(1004) - const buf2 = Buffer.alloc(1024) - const b = BufferList(buf) + var buf = crypto.randomBytes(1004) + , buf2 = Buffer.alloc(1024) + , b = BufferList(buf) b.copy(buf2, 20) t.equal(b.slice().toString('hex'), buf2.slice(20).toString('hex'), 'same buffer') - t.end() }) tape('copy starting from a precise location', function (t) { - const buf = crypto.randomBytes(10) - const buf2 = Buffer.alloc(5) - const b = BufferList(buf) + var buf = crypto.randomBytes(10) + , buf2 = Buffer.alloc(5) + , b = BufferList(buf) b.copy(buf2, 0, 5) t.equal(b.slice(5).toString('hex'), buf2.toString('hex'), 'same buffer') - t.end() }) tape('copy in an interval', function (t) { - const rnd = crypto.randomBytes(10) - const b = BufferList(rnd) // put the random bytes there - const actual = Buffer.alloc(3) - const expected = Buffer.alloc(3) + var rnd = crypto.randomBytes(10) + , b = BufferList(rnd) // put the random bytes there + , actual = Buffer.alloc(3) + , expected = Buffer.alloc(3) rnd.copy(expected, 0, 5, 8) b.copy(actual, 0, 5, 8) t.equal(actual.toString('hex'), expected.toString('hex'), 'same buffer') - t.end() }) tape('copy an interval between two buffers', function (t) { - const buf = crypto.randomBytes(10) - const buf2 = Buffer.alloc(10) - const b = BufferList(buf) + var buf = crypto.randomBytes(10) + , buf2 = Buffer.alloc(10) + , b = BufferList(buf) b.append(buf) b.copy(buf2, 0, 5, 15) t.equal(b.slice(5, 15).toString('hex'), buf2.toString('hex'), 'same buffer') - t.end() }) tape('shallow slice across buffer boundaries', function (t) { - const bl = new BufferList(['First', 'Second', 'Third']) + var bl = new BufferList(['First', 'Second', 'Third']) t.equal(bl.shallowSlice(3, 13).toString(), 'stSecondTh') - t.end() }) tape('shallow slice within single buffer', function (t) { t.plan(2) - - const bl = new BufferList(['First', 'Second', 'Third']) + var bl = new BufferList(['First', 'Second', 'Third']) t.equal(bl.shallowSlice(5, 10).toString(), 'Secon') t.equal(bl.shallowSlice(7, 10).toString(), 'con') - t.end() }) tape('shallow slice single buffer', function (t) { t.plan(3) - - const bl = new BufferList(['First', 'Second', 'Third']) + var bl = new BufferList(['First', 'Second', 'Third']) t.equal(bl.shallowSlice(0, 5).toString(), 'First') t.equal(bl.shallowSlice(5, 11).toString(), 'Second') @@ -710,8 +596,7 @@ tape('shallow slice single buffer', function (t) { tape('shallow slice with negative or omitted indices', function (t) { t.plan(4) - - const bl = new BufferList(['First', 'Second', 'Third']) + var bl = new BufferList(['First', 'Second', 'Third']) t.equal(bl.shallowSlice().toString(), 'FirstSecondThird') t.equal(bl.shallowSlice(5).toString(), 'SecondThird') @@ -721,9 +606,8 @@ tape('shallow slice with negative or omitted indices', function (t) { tape('shallow slice does not make a copy', function (t) { t.plan(1) - - const buffers = [Buffer.from('First'), Buffer.from('Second'), Buffer.from('Third')] - const bl = (new BufferList(buffers)).shallowSlice(5, -3) + var buffers = [Buffer.from('First'), Buffer.from('Second'), Buffer.from('Third')] + var bl = (new BufferList(buffers)).shallowSlice(5, -3) buffers[1].fill('h') buffers[2].fill('h') @@ -731,29 +615,11 @@ tape('shallow slice does not make a copy', function (t) { t.equal(bl.toString(), 'hhhhhhhh') }) -tape('shallow slice with 0 length', function (t) { - t.plan(1) - - const buffers = [Buffer.from('First'), Buffer.from('Second'), Buffer.from('Third')] - const bl = (new BufferList(buffers)).shallowSlice(0, 0) - - t.equal(bl.length, 0) -}) - -tape('shallow slice with 0 length from middle', function (t) { - t.plan(1) - - const buffers = [Buffer.from('First'), Buffer.from('Second'), Buffer.from('Third')] - const bl = (new BufferList(buffers)).shallowSlice(10, 10) - - t.equal(bl.length, 0) -}) - tape('duplicate', function (t) { t.plan(2) - const bl = new BufferList('abcdefghij\xff\x00') - const dup = bl.duplicate() + var bl = new BufferList('abcdefghij\xff\x00') + , dup = bl.duplicate() t.equal(bl.prototype, dup.prototype) t.equal(bl.toString('hex'), dup.toString('hex')) @@ -762,48 +628,32 @@ tape('duplicate', function (t) { tape('destroy no pipe', function (t) { t.plan(2) - const bl = new BufferList('alsdkfja;lsdkfja;lsdk') - + var bl = new BufferList('alsdkfja;lsdkfja;lsdk') bl.destroy() t.equal(bl._bufs.length, 0) t.equal(bl.length, 0) }) -tape('destroy with error', function (t) { - t.plan(3) - - const bl = new BufferList('alsdkfja;lsdkfja;lsdk') - const err = new Error('kaboom') - - bl.destroy(err) - bl.on('error', function (_err) { - t.equal(_err, err) - }) - - t.equal(bl._bufs.length, 0) - t.equal(bl.length, 0) -}) - !process.browser && tape('destroy with pipe before read end', function (t) { t.plan(2) - const bl = new BufferList() - fs.createReadStream(path.join(__dirname, '/test.js')) + var bl = new BufferList() + fs.createReadStream(__dirname + '/test.js') .pipe(bl) bl.destroy() t.equal(bl._bufs.length, 0) t.equal(bl.length, 0) + }) !process.browser && tape('destroy with pipe before read end with race', function (t) { t.plan(2) - const bl = new BufferList() - - fs.createReadStream(path.join(__dirname, '/test.js')) + var bl = new BufferList() + fs.createReadStream(__dirname + '/test.js') .pipe(bl) setTimeout(function () { @@ -818,9 +668,8 @@ tape('destroy with error', function (t) { !process.browser && tape('destroy with pipe after read end', function (t) { t.plan(2) - const bl = new BufferList() - - fs.createReadStream(path.join(__dirname, '/test.js')) + var bl = new BufferList() + fs.createReadStream(__dirname + '/test.js') .on('end', onEnd) .pipe(bl) @@ -835,10 +684,10 @@ tape('destroy with error', function (t) { !process.browser && tape('destroy with pipe while writing to a destination', function (t) { t.plan(4) - const bl = new BufferList() - const ds = new BufferList() + var bl = new BufferList() + , ds = new BufferList() - fs.createReadStream(path.join(__dirname, '/test.js')) + fs.createReadStream(__dirname + '/test.js') .on('end', onEnd) .pipe(bl) @@ -855,13 +704,13 @@ tape('destroy with error', function (t) { t.equals(bl._bufs.length, 0) t.equals(bl.length, 0) + }, 100) } }) !process.browser && tape('handle error', function (t) { t.plan(2) - fs.createReadStream('/does/not/exist').pipe(BufferList(function (err, data) { t.ok(err instanceof Error, 'has error') t.notOk(data, 'no data') diff --git a/node_modules/brace-expansion/index.js b/node_modules/brace-expansion/index.js index 0478be8..bd19fe6 100644 --- a/node_modules/brace-expansion/index.js +++ b/node_modules/brace-expansion/index.js @@ -109,7 +109,7 @@ function expand(str, isTop) { var isOptions = m.body.indexOf(',') >= 0; if (!isSequence && !isOptions) { // {a},b} - if (m.post.match(/,.*\}/)) { + if (m.post.match(/,(?!,).*\}/)) { str = m.pre + '{' + m.body + escClose + m.post; return expand(str); } diff --git a/node_modules/brace-expansion/package.json b/node_modules/brace-expansion/package.json index a18faa8..3447888 100644 --- a/node_modules/brace-expansion/package.json +++ b/node_modules/brace-expansion/package.json @@ -1,7 +1,7 @@ { "name": "brace-expansion", "description": "Brace expansion as known from sh/bash", - "version": "1.1.11", + "version": "1.1.12", "repository": { "type": "git", "url": "git://github.com/juliangruber/brace-expansion.git" @@ -43,5 +43,8 @@ "iphone/6.0..latest", "android-browser/4.2..latest" ] + }, + "publishConfig": { + "tag": "1.x" } } diff --git a/node_modules/buffer/AUTHORS.md b/node_modules/buffer/AUTHORS.md deleted file mode 100644 index 22eb171..0000000 --- a/node_modules/buffer/AUTHORS.md +++ /dev/null @@ -1,70 +0,0 @@ -# Authors - -#### Ordered by first contribution. - -- Romain Beauxis (toots@rastageeks.org) -- Tobias Koppers (tobias.koppers@googlemail.com) -- Janus (ysangkok@gmail.com) -- Rainer Dreyer (rdrey1@gmail.com) -- Tõnis Tiigi (tonistiigi@gmail.com) -- James Halliday (mail@substack.net) -- Michael Williamson (mike@zwobble.org) -- elliottcable (github@elliottcable.name) -- rafael (rvalle@livelens.net) -- Andrew Kelley (superjoe30@gmail.com) -- Andreas Madsen (amwebdk@gmail.com) -- Mike Brevoort (mike.brevoort@pearson.com) -- Brian White (mscdex@mscdex.net) -- Feross Aboukhadijeh (feross@feross.org) -- Ruben Verborgh (ruben@verborgh.org) -- eliang (eliang.cs@gmail.com) -- Jesse Tane (jesse.tane@gmail.com) -- Alfonso Boza (alfonso@cloud.com) -- Mathias Buus (mathiasbuus@gmail.com) -- Devon Govett (devongovett@gmail.com) -- Daniel Cousens (github@dcousens.com) -- Joseph Dykstra (josephdykstra@gmail.com) -- Parsha Pourkhomami (parshap+git@gmail.com) -- Damjan Košir (damjan.kosir@gmail.com) -- daverayment (dave.rayment@gmail.com) -- kawanet (u-suke@kawa.net) -- Linus Unnebäck (linus@folkdatorn.se) -- Nolan Lawson (nolan.lawson@gmail.com) -- Calvin Metcalf (calvin.metcalf@gmail.com) -- Koki Takahashi (hakatasiloving@gmail.com) -- Guy Bedford (guybedford@gmail.com) -- Jan Schär (jscissr@gmail.com) -- RaulTsc (tomescu.raul@gmail.com) -- Matthieu Monsch (monsch@alum.mit.edu) -- Dan Ehrenberg (littledan@chromium.org) -- Kirill Fomichev (fanatid@ya.ru) -- Yusuke Kawasaki (u-suke@kawa.net) -- DC (dcposch@dcpos.ch) -- John-David Dalton (john.david.dalton@gmail.com) -- adventure-yunfei (adventure030@gmail.com) -- Emil Bay (github@tixz.dk) -- Sam Sudar (sudar.sam@gmail.com) -- Volker Mische (volker.mische@gmail.com) -- David Walton (support@geekstocks.com) -- Сковорода Никита Андреевич (chalkerx@gmail.com) -- greenkeeper[bot] (greenkeeper[bot]@users.noreply.github.com) -- ukstv (sergey.ukustov@machinomy.com) -- Renée Kooi (renee@kooi.me) -- ranbochen (ranbochen@qq.com) -- Vladimir Borovik (bobahbdb@gmail.com) -- greenkeeper[bot] (23040076+greenkeeper[bot]@users.noreply.github.com) -- kumavis (aaron@kumavis.me) -- Sergey Ukustov (sergey.ukustov@machinomy.com) -- Fei Liu (liu.feiwood@gmail.com) -- Blaine Bublitz (blaine.bublitz@gmail.com) -- clement (clement@seald.io) -- Koushik Dutta (koushd@gmail.com) -- Jordan Harband (ljharb@gmail.com) -- Niklas Mischkulnig (mischnic@users.noreply.github.com) -- Nikolai Vavilov (vvnicholas@gmail.com) -- Fedor Nezhivoi (gyzerok@users.noreply.github.com) -- Peter Newman (peternewman@users.noreply.github.com) -- mathmakgakpak (44949126+mathmakgakpak@users.noreply.github.com) -- jkkang (jkkang@smartauth.kr) - -#### Generated by bin/update-authors.sh. diff --git a/node_modules/buffer/LICENSE b/node_modules/buffer/LICENSE deleted file mode 100644 index d6bf75d..0000000 --- a/node_modules/buffer/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Feross Aboukhadijeh, and other contributors. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/buffer/README.md b/node_modules/buffer/README.md deleted file mode 100644 index 9a23d7c..0000000 --- a/node_modules/buffer/README.md +++ /dev/null @@ -1,410 +0,0 @@ -# buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url] - -[travis-image]: https://img.shields.io/travis/feross/buffer/master.svg -[travis-url]: https://travis-ci.org/feross/buffer -[npm-image]: https://img.shields.io/npm/v/buffer.svg -[npm-url]: https://npmjs.org/package/buffer -[downloads-image]: https://img.shields.io/npm/dm/buffer.svg -[downloads-url]: https://npmjs.org/package/buffer -[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg -[standard-url]: https://standardjs.com - -#### The buffer module from [node.js](https://nodejs.org/), for the browser. - -[![saucelabs][saucelabs-image]][saucelabs-url] - -[saucelabs-image]: https://saucelabs.com/browser-matrix/buffer.svg -[saucelabs-url]: https://saucelabs.com/u/buffer - -With [browserify](http://browserify.org), simply `require('buffer')` or use the `Buffer` global and you will get this module. - -The goal is to provide an API that is 100% identical to -[node's Buffer API](https://nodejs.org/api/buffer.html). Read the -[official docs](https://nodejs.org/api/buffer.html) for the full list of properties, -instance methods, and class methods that are supported. - -## features - -- Manipulate binary data like a boss, in all browsers! -- Super fast. Backed by Typed Arrays (`Uint8Array`/`ArrayBuffer`, not `Object`) -- Extremely small bundle size (**6.75KB minified + gzipped**, 51.9KB with comments) -- Excellent browser support (Chrome, Firefox, Edge, Safari 9+, IE 11, iOS 9+, Android, etc.) -- Preserves Node API exactly, with one minor difference (see below) -- Square-bracket `buf[4]` notation works! -- Does not modify any browser prototypes or put anything on `window` -- Comprehensive test suite (including all buffer tests from node.js core) - -## install - -To use this module directly (without browserify), install it: - -```bash -npm install buffer -``` - -This module was previously called **native-buffer-browserify**, but please use **buffer** -from now on. - -If you do not use a bundler, you can use the [standalone script](https://bundle.run/buffer). - -## usage - -The module's API is identical to node's `Buffer` API. Read the -[official docs](https://nodejs.org/api/buffer.html) for the full list of properties, -instance methods, and class methods that are supported. - -As mentioned above, `require('buffer')` or use the `Buffer` global with -[browserify](http://browserify.org) and this module will automatically be included -in your bundle. Almost any npm module will work in the browser, even if it assumes that -the node `Buffer` API will be available. - -To depend on this module explicitly (without browserify), require it like this: - -```js -var Buffer = require('buffer/').Buffer // note: the trailing slash is important! -``` - -To require this module explicitly, use `require('buffer/')` which tells the node.js module -lookup algorithm (also used by browserify) to use the **npm module** named `buffer` -instead of the **node.js core** module named `buffer`! - - -## how does it work? - -The Buffer constructor returns instances of `Uint8Array` that have their prototype -changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of `Uint8Array`, -so the returned instances will have all the node `Buffer` methods and the -`Uint8Array` methods. Square bracket notation works as expected -- it returns a -single octet. - -The `Uint8Array` prototype remains unmodified. - - -## tracking the latest node api - -This module tracks the Buffer API in the latest (unstable) version of node.js. The Buffer -API is considered **stable** in the -[node stability index](https://nodejs.org/docs/latest/api/documentation.html#documentation_stability_index), -so it is unlikely that there will ever be breaking changes. -Nonetheless, when/if the Buffer API changes in node, this module's API will change -accordingly. - -## related packages - -- [`buffer-reverse`](https://www.npmjs.com/package/buffer-reverse) - Reverse a buffer -- [`buffer-xor`](https://www.npmjs.com/package/buffer-xor) - Bitwise xor a buffer -- [`is-buffer`](https://www.npmjs.com/package/is-buffer) - Determine if an object is a Buffer without including the whole `Buffer` package - -## conversion packages - -### convert typed array to buffer - -Use [`typedarray-to-buffer`](https://www.npmjs.com/package/typedarray-to-buffer) to convert any kind of typed array to a `Buffer`. Does not perform a copy, so it's super fast. - -### convert buffer to typed array - -`Buffer` is a subclass of `Uint8Array` (which is a typed array). So there is no need to explicitly convert to typed array. Just use the buffer as a `Uint8Array`. - -### convert blob to buffer - -Use [`blob-to-buffer`](https://www.npmjs.com/package/blob-to-buffer) to convert a `Blob` to a `Buffer`. - -### convert buffer to blob - -To convert a `Buffer` to a `Blob`, use the `Blob` constructor: - -```js -var blob = new Blob([ buffer ]) -``` - -Optionally, specify a mimetype: - -```js -var blob = new Blob([ buffer ], { type: 'text/html' }) -``` - -### convert arraybuffer to buffer - -To convert an `ArrayBuffer` to a `Buffer`, use the `Buffer.from` function. Does not perform a copy, so it's super fast. - -```js -var buffer = Buffer.from(arrayBuffer) -``` - -### convert buffer to arraybuffer - -To convert a `Buffer` to an `ArrayBuffer`, use the `.buffer` property (which is present on all `Uint8Array` objects): - -```js -var arrayBuffer = buffer.buffer.slice( - buffer.byteOffset, buffer.byteOffset + buffer.byteLength -) -``` - -Alternatively, use the [`to-arraybuffer`](https://www.npmjs.com/package/to-arraybuffer) module. - -## performance - -See perf tests in `/perf`. - -`BrowserBuffer` is the browser `buffer` module (this repo). `Uint8Array` is included as a -sanity check (since `BrowserBuffer` uses `Uint8Array` under the hood, `Uint8Array` will -always be at least a bit faster). Finally, `NodeBuffer` is the node.js buffer module, -which is included to compare against. - -NOTE: Performance has improved since these benchmarks were taken. PR welcome to update the README. - -### Chrome 38 - -| Method | Operations | Accuracy | Sampled | Fastest | -|:-------|:-----------|:---------|:--------|:-------:| -| BrowserBuffer#bracket-notation | 11,457,464 ops/sec | ±0.86% | 66 | ✓ | -| Uint8Array#bracket-notation | 10,824,332 ops/sec | ±0.74% | 65 | | -| | | | | -| BrowserBuffer#concat | 450,532 ops/sec | ±0.76% | 68 | | -| Uint8Array#concat | 1,368,911 ops/sec | ±1.50% | 62 | ✓ | -| | | | | -| BrowserBuffer#copy(16000) | 903,001 ops/sec | ±0.96% | 67 | | -| Uint8Array#copy(16000) | 1,422,441 ops/sec | ±1.04% | 66 | ✓ | -| | | | | -| BrowserBuffer#copy(16) | 11,431,358 ops/sec | ±0.46% | 69 | | -| Uint8Array#copy(16) | 13,944,163 ops/sec | ±1.12% | 68 | ✓ | -| | | | | -| BrowserBuffer#new(16000) | 106,329 ops/sec | ±6.70% | 44 | | -| Uint8Array#new(16000) | 131,001 ops/sec | ±2.85% | 31 | ✓ | -| | | | | -| BrowserBuffer#new(16) | 1,554,491 ops/sec | ±1.60% | 65 | | -| Uint8Array#new(16) | 6,623,930 ops/sec | ±1.66% | 65 | ✓ | -| | | | | -| BrowserBuffer#readDoubleBE | 112,830 ops/sec | ±0.51% | 69 | ✓ | -| DataView#getFloat64 | 93,500 ops/sec | ±0.57% | 68 | | -| | | | | -| BrowserBuffer#readFloatBE | 146,678 ops/sec | ±0.95% | 68 | ✓ | -| DataView#getFloat32 | 99,311 ops/sec | ±0.41% | 67 | | -| | | | | -| BrowserBuffer#readUInt32LE | 843,214 ops/sec | ±0.70% | 69 | ✓ | -| DataView#getUint32 | 103,024 ops/sec | ±0.64% | 67 | | -| | | | | -| BrowserBuffer#slice | 1,013,941 ops/sec | ±0.75% | 67 | | -| Uint8Array#subarray | 1,903,928 ops/sec | ±0.53% | 67 | ✓ | -| | | | | -| BrowserBuffer#writeFloatBE | 61,387 ops/sec | ±0.90% | 67 | | -| DataView#setFloat32 | 141,249 ops/sec | ±0.40% | 66 | ✓ | - - -### Firefox 33 - -| Method | Operations | Accuracy | Sampled | Fastest | -|:-------|:-----------|:---------|:--------|:-------:| -| BrowserBuffer#bracket-notation | 20,800,421 ops/sec | ±1.84% | 60 | | -| Uint8Array#bracket-notation | 20,826,235 ops/sec | ±2.02% | 61 | ✓ | -| | | | | -| BrowserBuffer#concat | 153,076 ops/sec | ±2.32% | 61 | | -| Uint8Array#concat | 1,255,674 ops/sec | ±8.65% | 52 | ✓ | -| | | | | -| BrowserBuffer#copy(16000) | 1,105,312 ops/sec | ±1.16% | 63 | | -| Uint8Array#copy(16000) | 1,615,911 ops/sec | ±0.55% | 66 | ✓ | -| | | | | -| BrowserBuffer#copy(16) | 16,357,599 ops/sec | ±0.73% | 68 | | -| Uint8Array#copy(16) | 31,436,281 ops/sec | ±1.05% | 68 | ✓ | -| | | | | -| BrowserBuffer#new(16000) | 52,995 ops/sec | ±6.01% | 35 | | -| Uint8Array#new(16000) | 87,686 ops/sec | ±5.68% | 45 | ✓ | -| | | | | -| BrowserBuffer#new(16) | 252,031 ops/sec | ±1.61% | 66 | | -| Uint8Array#new(16) | 8,477,026 ops/sec | ±0.49% | 68 | ✓ | -| | | | | -| BrowserBuffer#readDoubleBE | 99,871 ops/sec | ±0.41% | 69 | | -| DataView#getFloat64 | 285,663 ops/sec | ±0.70% | 68 | ✓ | -| | | | | -| BrowserBuffer#readFloatBE | 115,540 ops/sec | ±0.42% | 69 | | -| DataView#getFloat32 | 288,722 ops/sec | ±0.82% | 68 | ✓ | -| | | | | -| BrowserBuffer#readUInt32LE | 633,926 ops/sec | ±1.08% | 67 | ✓ | -| DataView#getUint32 | 294,808 ops/sec | ±0.79% | 64 | | -| | | | | -| BrowserBuffer#slice | 349,425 ops/sec | ±0.46% | 69 | | -| Uint8Array#subarray | 5,965,819 ops/sec | ±0.60% | 65 | ✓ | -| | | | | -| BrowserBuffer#writeFloatBE | 59,980 ops/sec | ±0.41% | 67 | | -| DataView#setFloat32 | 317,634 ops/sec | ±0.63% | 68 | ✓ | - -### Safari 8 - -| Method | Operations | Accuracy | Sampled | Fastest | -|:-------|:-----------|:---------|:--------|:-------:| -| BrowserBuffer#bracket-notation | 10,279,729 ops/sec | ±2.25% | 56 | ✓ | -| Uint8Array#bracket-notation | 10,030,767 ops/sec | ±2.23% | 59 | | -| | | | | -| BrowserBuffer#concat | 144,138 ops/sec | ±1.38% | 65 | | -| Uint8Array#concat | 4,950,764 ops/sec | ±1.70% | 63 | ✓ | -| | | | | -| BrowserBuffer#copy(16000) | 1,058,548 ops/sec | ±1.51% | 64 | | -| Uint8Array#copy(16000) | 1,409,666 ops/sec | ±1.17% | 65 | ✓ | -| | | | | -| BrowserBuffer#copy(16) | 6,282,529 ops/sec | ±1.88% | 58 | | -| Uint8Array#copy(16) | 11,907,128 ops/sec | ±2.87% | 58 | ✓ | -| | | | | -| BrowserBuffer#new(16000) | 101,663 ops/sec | ±3.89% | 57 | | -| Uint8Array#new(16000) | 22,050,818 ops/sec | ±6.51% | 46 | ✓ | -| | | | | -| BrowserBuffer#new(16) | 176,072 ops/sec | ±2.13% | 64 | | -| Uint8Array#new(16) | 24,385,731 ops/sec | ±5.01% | 51 | ✓ | -| | | | | -| BrowserBuffer#readDoubleBE | 41,341 ops/sec | ±1.06% | 67 | | -| DataView#getFloat64 | 322,280 ops/sec | ±0.84% | 68 | ✓ | -| | | | | -| BrowserBuffer#readFloatBE | 46,141 ops/sec | ±1.06% | 65 | | -| DataView#getFloat32 | 337,025 ops/sec | ±0.43% | 69 | ✓ | -| | | | | -| BrowserBuffer#readUInt32LE | 151,551 ops/sec | ±1.02% | 66 | | -| DataView#getUint32 | 308,278 ops/sec | ±0.94% | 67 | ✓ | -| | | | | -| BrowserBuffer#slice | 197,365 ops/sec | ±0.95% | 66 | | -| Uint8Array#subarray | 9,558,024 ops/sec | ±3.08% | 58 | ✓ | -| | | | | -| BrowserBuffer#writeFloatBE | 17,518 ops/sec | ±1.03% | 63 | | -| DataView#setFloat32 | 319,751 ops/sec | ±0.48% | 68 | ✓ | - - -### Node 0.11.14 - -| Method | Operations | Accuracy | Sampled | Fastest | -|:-------|:-----------|:---------|:--------|:-------:| -| BrowserBuffer#bracket-notation | 10,489,828 ops/sec | ±3.25% | 90 | | -| Uint8Array#bracket-notation | 10,534,884 ops/sec | ±0.81% | 92 | ✓ | -| NodeBuffer#bracket-notation | 10,389,910 ops/sec | ±0.97% | 87 | | -| | | | | -| BrowserBuffer#concat | 487,830 ops/sec | ±2.58% | 88 | | -| Uint8Array#concat | 1,814,327 ops/sec | ±1.28% | 88 | ✓ | -| NodeBuffer#concat | 1,636,523 ops/sec | ±1.88% | 73 | | -| | | | | -| BrowserBuffer#copy(16000) | 1,073,665 ops/sec | ±0.77% | 90 | | -| Uint8Array#copy(16000) | 1,348,517 ops/sec | ±0.84% | 89 | ✓ | -| NodeBuffer#copy(16000) | 1,289,533 ops/sec | ±0.82% | 93 | | -| | | | | -| BrowserBuffer#copy(16) | 12,782,706 ops/sec | ±0.74% | 85 | | -| Uint8Array#copy(16) | 14,180,427 ops/sec | ±0.93% | 92 | ✓ | -| NodeBuffer#copy(16) | 11,083,134 ops/sec | ±1.06% | 89 | | -| | | | | -| BrowserBuffer#new(16000) | 141,678 ops/sec | ±3.30% | 67 | | -| Uint8Array#new(16000) | 161,491 ops/sec | ±2.96% | 60 | | -| NodeBuffer#new(16000) | 292,699 ops/sec | ±3.20% | 55 | ✓ | -| | | | | -| BrowserBuffer#new(16) | 1,655,466 ops/sec | ±2.41% | 82 | | -| Uint8Array#new(16) | 14,399,926 ops/sec | ±0.91% | 94 | ✓ | -| NodeBuffer#new(16) | 3,894,696 ops/sec | ±0.88% | 92 | | -| | | | | -| BrowserBuffer#readDoubleBE | 109,582 ops/sec | ±0.75% | 93 | ✓ | -| DataView#getFloat64 | 91,235 ops/sec | ±0.81% | 90 | | -| NodeBuffer#readDoubleBE | 88,593 ops/sec | ±0.96% | 81 | | -| | | | | -| BrowserBuffer#readFloatBE | 139,854 ops/sec | ±1.03% | 85 | ✓ | -| DataView#getFloat32 | 98,744 ops/sec | ±0.80% | 89 | | -| NodeBuffer#readFloatBE | 92,769 ops/sec | ±0.94% | 93 | | -| | | | | -| BrowserBuffer#readUInt32LE | 710,861 ops/sec | ±0.82% | 92 | | -| DataView#getUint32 | 117,893 ops/sec | ±0.84% | 91 | | -| NodeBuffer#readUInt32LE | 851,412 ops/sec | ±0.72% | 93 | ✓ | -| | | | | -| BrowserBuffer#slice | 1,673,877 ops/sec | ±0.73% | 94 | | -| Uint8Array#subarray | 6,919,243 ops/sec | ±0.67% | 90 | ✓ | -| NodeBuffer#slice | 4,617,604 ops/sec | ±0.79% | 93 | | -| | | | | -| BrowserBuffer#writeFloatBE | 66,011 ops/sec | ±0.75% | 93 | | -| DataView#setFloat32 | 127,760 ops/sec | ±0.72% | 93 | ✓ | -| NodeBuffer#writeFloatBE | 103,352 ops/sec | ±0.83% | 93 | | - -### iojs 1.8.1 - -| Method | Operations | Accuracy | Sampled | Fastest | -|:-------|:-----------|:---------|:--------|:-------:| -| BrowserBuffer#bracket-notation | 10,990,488 ops/sec | ±1.11% | 91 | | -| Uint8Array#bracket-notation | 11,268,757 ops/sec | ±0.65% | 97 | | -| NodeBuffer#bracket-notation | 11,353,260 ops/sec | ±0.83% | 94 | ✓ | -| | | | | -| BrowserBuffer#concat | 378,954 ops/sec | ±0.74% | 94 | | -| Uint8Array#concat | 1,358,288 ops/sec | ±0.97% | 87 | | -| NodeBuffer#concat | 1,934,050 ops/sec | ±1.11% | 78 | ✓ | -| | | | | -| BrowserBuffer#copy(16000) | 894,538 ops/sec | ±0.56% | 84 | | -| Uint8Array#copy(16000) | 1,442,656 ops/sec | ±0.71% | 96 | | -| NodeBuffer#copy(16000) | 1,457,898 ops/sec | ±0.53% | 92 | ✓ | -| | | | | -| BrowserBuffer#copy(16) | 12,870,457 ops/sec | ±0.67% | 95 | | -| Uint8Array#copy(16) | 16,643,989 ops/sec | ±0.61% | 93 | ✓ | -| NodeBuffer#copy(16) | 14,885,848 ops/sec | ±0.74% | 94 | | -| | | | | -| BrowserBuffer#new(16000) | 109,264 ops/sec | ±4.21% | 63 | | -| Uint8Array#new(16000) | 138,916 ops/sec | ±1.87% | 61 | | -| NodeBuffer#new(16000) | 281,449 ops/sec | ±3.58% | 51 | ✓ | -| | | | | -| BrowserBuffer#new(16) | 1,362,935 ops/sec | ±0.56% | 99 | | -| Uint8Array#new(16) | 6,193,090 ops/sec | ±0.64% | 95 | ✓ | -| NodeBuffer#new(16) | 4,745,425 ops/sec | ±1.56% | 90 | | -| | | | | -| BrowserBuffer#readDoubleBE | 118,127 ops/sec | ±0.59% | 93 | ✓ | -| DataView#getFloat64 | 107,332 ops/sec | ±0.65% | 91 | | -| NodeBuffer#readDoubleBE | 116,274 ops/sec | ±0.94% | 95 | | -| | | | | -| BrowserBuffer#readFloatBE | 150,326 ops/sec | ±0.58% | 95 | ✓ | -| DataView#getFloat32 | 110,541 ops/sec | ±0.57% | 98 | | -| NodeBuffer#readFloatBE | 121,599 ops/sec | ±0.60% | 87 | | -| | | | | -| BrowserBuffer#readUInt32LE | 814,147 ops/sec | ±0.62% | 93 | | -| DataView#getUint32 | 137,592 ops/sec | ±0.64% | 90 | | -| NodeBuffer#readUInt32LE | 931,650 ops/sec | ±0.71% | 96 | ✓ | -| | | | | -| BrowserBuffer#slice | 878,590 ops/sec | ±0.68% | 93 | | -| Uint8Array#subarray | 2,843,308 ops/sec | ±1.02% | 90 | | -| NodeBuffer#slice | 4,998,316 ops/sec | ±0.68% | 90 | ✓ | -| | | | | -| BrowserBuffer#writeFloatBE | 65,927 ops/sec | ±0.74% | 93 | | -| DataView#setFloat32 | 139,823 ops/sec | ±0.97% | 89 | ✓ | -| NodeBuffer#writeFloatBE | 135,763 ops/sec | ±0.65% | 96 | | -| | | | | - -## Testing the project - -First, install the project: - - npm install - -Then, to run tests in Node.js, run: - - npm run test-node - -To test locally in a browser, you can run: - - npm run test-browser-es5-local # For ES5 browsers that don't support ES6 - npm run test-browser-es6-local # For ES6 compliant browsers - -This will print out a URL that you can then open in a browser to run the tests, using [airtap](https://www.npmjs.com/package/airtap). - -To run automated browser tests using Saucelabs, ensure that your `SAUCE_USERNAME` and `SAUCE_ACCESS_KEY` environment variables are set, then run: - - npm test - -This is what's run in Travis, to check against various browsers. The list of browsers is kept in the `bin/airtap-es5.yml` and `bin/airtap-es6.yml` files. - -## JavaScript Standard Style - -This module uses [JavaScript Standard Style](https://github.com/feross/standard). - -[![JavaScript Style Guide](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) - -To test that the code conforms to the style, `npm install` and run: - - ./node_modules/.bin/standard - -## credit - -This was originally forked from [buffer-browserify](https://github.com/toots/buffer-browserify). - -## Security Policies and Procedures - -The `buffer` team and community take all security bugs in `buffer` seriously. Please see our [security policies and procedures](https://github.com/feross/security) document to learn how to report issues. - -## license - -MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org), and other contributors. Originally forked from an MIT-licensed module by Romain Beauxis. diff --git a/node_modules/buffer/index.d.ts b/node_modules/buffer/index.d.ts deleted file mode 100644 index 5d1a804..0000000 --- a/node_modules/buffer/index.d.ts +++ /dev/null @@ -1,186 +0,0 @@ -export class Buffer extends Uint8Array { - length: number - write(string: string, offset?: number, length?: number, encoding?: string): number; - toString(encoding?: string, start?: number, end?: number): string; - toJSON(): { type: 'Buffer', data: any[] }; - equals(otherBuffer: Buffer): boolean; - compare(otherBuffer: Buffer, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number; - copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; - slice(start?: number, end?: number): Buffer; - writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; - writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; - writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; - writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; - readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number; - readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number; - readIntLE(offset: number, byteLength: number, noAssert?: boolean): number; - readIntBE(offset: number, byteLength: number, noAssert?: boolean): number; - readUInt8(offset: number, noAssert?: boolean): number; - readUInt16LE(offset: number, noAssert?: boolean): number; - readUInt16BE(offset: number, noAssert?: boolean): number; - readUInt32LE(offset: number, noAssert?: boolean): number; - readUInt32BE(offset: number, noAssert?: boolean): number; - readInt8(offset: number, noAssert?: boolean): number; - readInt16LE(offset: number, noAssert?: boolean): number; - readInt16BE(offset: number, noAssert?: boolean): number; - readInt32LE(offset: number, noAssert?: boolean): number; - readInt32BE(offset: number, noAssert?: boolean): number; - readFloatLE(offset: number, noAssert?: boolean): number; - readFloatBE(offset: number, noAssert?: boolean): number; - readDoubleLE(offset: number, noAssert?: boolean): number; - readDoubleBE(offset: number, noAssert?: boolean): number; - reverse(): this; - swap16(): Buffer; - swap32(): Buffer; - swap64(): Buffer; - writeUInt8(value: number, offset: number, noAssert?: boolean): number; - writeUInt16LE(value: number, offset: number, noAssert?: boolean): number; - writeUInt16BE(value: number, offset: number, noAssert?: boolean): number; - writeUInt32LE(value: number, offset: number, noAssert?: boolean): number; - writeUInt32BE(value: number, offset: number, noAssert?: boolean): number; - writeInt8(value: number, offset: number, noAssert?: boolean): number; - writeInt16LE(value: number, offset: number, noAssert?: boolean): number; - writeInt16BE(value: number, offset: number, noAssert?: boolean): number; - writeInt32LE(value: number, offset: number, noAssert?: boolean): number; - writeInt32BE(value: number, offset: number, noAssert?: boolean): number; - writeFloatLE(value: number, offset: number, noAssert?: boolean): number; - writeFloatBE(value: number, offset: number, noAssert?: boolean): number; - writeDoubleLE(value: number, offset: number, noAssert?: boolean): number; - writeDoubleBE(value: number, offset: number, noAssert?: boolean): number; - fill(value: any, offset?: number, end?: number): this; - indexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; - lastIndexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; - includes(value: string | number | Buffer, byteOffset?: number, encoding?: string): boolean; - - /** - * Allocates a new buffer containing the given {str}. - * - * @param str String to store in buffer. - * @param encoding encoding to use, optional. Default is 'utf8' - */ - constructor (str: string, encoding?: string); - /** - * Allocates a new buffer of {size} octets. - * - * @param size count of octets to allocate. - */ - constructor (size: number); - /** - * Allocates a new buffer containing the given {array} of octets. - * - * @param array The octets to store. - */ - constructor (array: Uint8Array); - /** - * Produces a Buffer backed by the same allocated memory as - * the given {ArrayBuffer}. - * - * - * @param arrayBuffer The ArrayBuffer with which to share memory. - */ - constructor (arrayBuffer: ArrayBuffer); - /** - * Allocates a new buffer containing the given {array} of octets. - * - * @param array The octets to store. - */ - constructor (array: any[]); - /** - * Copies the passed {buffer} data onto a new {Buffer} instance. - * - * @param buffer The buffer to copy. - */ - constructor (buffer: Buffer); - prototype: Buffer; - /** - * Allocates a new Buffer using an {array} of octets. - * - * @param array - */ - static from(array: any[]): Buffer; - /** - * When passed a reference to the .buffer property of a TypedArray instance, - * the newly created Buffer will share the same allocated memory as the TypedArray. - * The optional {byteOffset} and {length} arguments specify a memory range - * within the {arrayBuffer} that will be shared by the Buffer. - * - * @param arrayBuffer The .buffer property of a TypedArray or a new ArrayBuffer() - * @param byteOffset - * @param length - */ - static from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer; - /** - * Copies the passed {buffer} data onto a new Buffer instance. - * - * @param buffer - */ - static from(buffer: Buffer | Uint8Array): Buffer; - /** - * Creates a new Buffer containing the given JavaScript string {str}. - * If provided, the {encoding} parameter identifies the character encoding. - * If not provided, {encoding} defaults to 'utf8'. - * - * @param str - */ - static from(str: string, encoding?: string): Buffer; - /** - * Returns true if {obj} is a Buffer - * - * @param obj object to test. - */ - static isBuffer(obj: any): obj is Buffer; - /** - * Returns true if {encoding} is a valid encoding argument. - * Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex' - * - * @param encoding string to test. - */ - static isEncoding(encoding: string): boolean; - /** - * Gives the actual byte length of a string. encoding defaults to 'utf8'. - * This is not the same as String.prototype.length since that returns the number of characters in a string. - * - * @param string string to test. - * @param encoding encoding used to evaluate (defaults to 'utf8') - */ - static byteLength(string: string, encoding?: string): number; - /** - * Returns a buffer which is the result of concatenating all the buffers in the list together. - * - * If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer. - * If the list has exactly one item, then the first item of the list is returned. - * If the list has more than one item, then a new Buffer is created. - * - * @param list An array of Buffer objects to concatenate - * @param totalLength Total length of the buffers when concatenated. - * If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly. - */ - static concat(list: Buffer[], totalLength?: number): Buffer; - /** - * The same as buf1.compare(buf2). - */ - static compare(buf1: Buffer, buf2: Buffer): number; - /** - * Allocates a new buffer of {size} octets. - * - * @param size count of octets to allocate. - * @param fill if specified, buffer will be initialized by calling buf.fill(fill). - * If parameter is omitted, buffer will be filled with zeros. - * @param encoding encoding used for call to buf.fill while initializing - */ - static alloc(size: number, fill?: string | Buffer | number, encoding?: string): Buffer; - /** - * Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents - * of the newly created Buffer are unknown and may contain sensitive data. - * - * @param size count of octets to allocate - */ - static allocUnsafe(size: number): Buffer; - /** - * Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents - * of the newly created Buffer are unknown and may contain sensitive data. - * - * @param size count of octets to allocate - */ - static allocUnsafeSlow(size: number): Buffer; -} diff --git a/node_modules/buffer/index.js b/node_modules/buffer/index.js deleted file mode 100644 index 609cf31..0000000 --- a/node_modules/buffer/index.js +++ /dev/null @@ -1,1817 +0,0 @@ -/*! - * The buffer module from node.js, for the browser. - * - * @author Feross Aboukhadijeh - * @license MIT - */ -/* eslint-disable no-proto */ - -'use strict' - -var base64 = require('base64-js') -var ieee754 = require('ieee754') -var customInspectSymbol = - (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation - ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation - : null - -exports.Buffer = Buffer -exports.SlowBuffer = SlowBuffer -exports.INSPECT_MAX_BYTES = 50 - -var K_MAX_LENGTH = 0x7fffffff -exports.kMaxLength = K_MAX_LENGTH - -/** - * If `Buffer.TYPED_ARRAY_SUPPORT`: - * === true Use Uint8Array implementation (fastest) - * === false Print warning and recommend using `buffer` v4.x which has an Object - * implementation (most compatible, even IE6) - * - * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, - * Opera 11.6+, iOS 4.2+. - * - * We report that the browser does not support typed arrays if the are not subclassable - * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array` - * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support - * for __proto__ and has a buggy typed array implementation. - */ -Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport() - -if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' && - typeof console.error === 'function') { - console.error( - 'This browser lacks typed array (Uint8Array) support which is required by ' + - '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.' - ) -} - -function typedArraySupport () { - // Can typed array instances can be augmented? - try { - var arr = new Uint8Array(1) - var proto = { foo: function () { return 42 } } - Object.setPrototypeOf(proto, Uint8Array.prototype) - Object.setPrototypeOf(arr, proto) - return arr.foo() === 42 - } catch (e) { - return false - } -} - -Object.defineProperty(Buffer.prototype, 'parent', { - enumerable: true, - get: function () { - if (!Buffer.isBuffer(this)) return undefined - return this.buffer - } -}) - -Object.defineProperty(Buffer.prototype, 'offset', { - enumerable: true, - get: function () { - if (!Buffer.isBuffer(this)) return undefined - return this.byteOffset - } -}) - -function createBuffer (length) { - if (length > K_MAX_LENGTH) { - throw new RangeError('The value "' + length + '" is invalid for option "size"') - } - // Return an augmented `Uint8Array` instance - var buf = new Uint8Array(length) - Object.setPrototypeOf(buf, Buffer.prototype) - return buf -} - -/** - * The Buffer constructor returns instances of `Uint8Array` that have their - * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of - * `Uint8Array`, so the returned instances will have all the node `Buffer` methods - * and the `Uint8Array` methods. Square bracket notation works as expected -- it - * returns a single octet. - * - * The `Uint8Array` prototype remains unmodified. - */ - -function Buffer (arg, encodingOrOffset, length) { - // Common case. - if (typeof arg === 'number') { - if (typeof encodingOrOffset === 'string') { - throw new TypeError( - 'The "string" argument must be of type string. Received type number' - ) - } - return allocUnsafe(arg) - } - return from(arg, encodingOrOffset, length) -} - -Buffer.poolSize = 8192 // not used by this implementation - -function from (value, encodingOrOffset, length) { - if (typeof value === 'string') { - return fromString(value, encodingOrOffset) - } - - if (ArrayBuffer.isView(value)) { - return fromArrayView(value) - } - - if (value == null) { - throw new TypeError( - 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + - 'or Array-like Object. Received type ' + (typeof value) - ) - } - - if (isInstance(value, ArrayBuffer) || - (value && isInstance(value.buffer, ArrayBuffer))) { - return fromArrayBuffer(value, encodingOrOffset, length) - } - - if (typeof SharedArrayBuffer !== 'undefined' && - (isInstance(value, SharedArrayBuffer) || - (value && isInstance(value.buffer, SharedArrayBuffer)))) { - return fromArrayBuffer(value, encodingOrOffset, length) - } - - if (typeof value === 'number') { - throw new TypeError( - 'The "value" argument must not be of type number. Received type number' - ) - } - - var valueOf = value.valueOf && value.valueOf() - if (valueOf != null && valueOf !== value) { - return Buffer.from(valueOf, encodingOrOffset, length) - } - - var b = fromObject(value) - if (b) return b - - if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null && - typeof value[Symbol.toPrimitive] === 'function') { - return Buffer.from( - value[Symbol.toPrimitive]('string'), encodingOrOffset, length - ) - } - - throw new TypeError( - 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + - 'or Array-like Object. Received type ' + (typeof value) - ) -} - -/** - * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError - * if value is a number. - * Buffer.from(str[, encoding]) - * Buffer.from(array) - * Buffer.from(buffer) - * Buffer.from(arrayBuffer[, byteOffset[, length]]) - **/ -Buffer.from = function (value, encodingOrOffset, length) { - return from(value, encodingOrOffset, length) -} - -// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug: -// https://github.com/feross/buffer/pull/148 -Object.setPrototypeOf(Buffer.prototype, Uint8Array.prototype) -Object.setPrototypeOf(Buffer, Uint8Array) - -function assertSize (size) { - if (typeof size !== 'number') { - throw new TypeError('"size" argument must be of type number') - } else if (size < 0) { - throw new RangeError('The value "' + size + '" is invalid for option "size"') - } -} - -function alloc (size, fill, encoding) { - assertSize(size) - if (size <= 0) { - return createBuffer(size) - } - if (fill !== undefined) { - // Only pay attention to encoding if it's a string. This - // prevents accidentally sending in a number that would - // be interpreted as a start offset. - return typeof encoding === 'string' - ? createBuffer(size).fill(fill, encoding) - : createBuffer(size).fill(fill) - } - return createBuffer(size) -} - -/** - * Creates a new filled Buffer instance. - * alloc(size[, fill[, encoding]]) - **/ -Buffer.alloc = function (size, fill, encoding) { - return alloc(size, fill, encoding) -} - -function allocUnsafe (size) { - assertSize(size) - return createBuffer(size < 0 ? 0 : checked(size) | 0) -} - -/** - * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. - * */ -Buffer.allocUnsafe = function (size) { - return allocUnsafe(size) -} -/** - * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. - */ -Buffer.allocUnsafeSlow = function (size) { - return allocUnsafe(size) -} - -function fromString (string, encoding) { - if (typeof encoding !== 'string' || encoding === '') { - encoding = 'utf8' - } - - if (!Buffer.isEncoding(encoding)) { - throw new TypeError('Unknown encoding: ' + encoding) - } - - var length = byteLength(string, encoding) | 0 - var buf = createBuffer(length) - - var actual = buf.write(string, encoding) - - if (actual !== length) { - // Writing a hex string, for example, that contains invalid characters will - // cause everything after the first invalid character to be ignored. (e.g. - // 'abxxcd' will be treated as 'ab') - buf = buf.slice(0, actual) - } - - return buf -} - -function fromArrayLike (array) { - var length = array.length < 0 ? 0 : checked(array.length) | 0 - var buf = createBuffer(length) - for (var i = 0; i < length; i += 1) { - buf[i] = array[i] & 255 - } - return buf -} - -function fromArrayView (arrayView) { - if (isInstance(arrayView, Uint8Array)) { - var copy = new Uint8Array(arrayView) - return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength) - } - return fromArrayLike(arrayView) -} - -function fromArrayBuffer (array, byteOffset, length) { - if (byteOffset < 0 || array.byteLength < byteOffset) { - throw new RangeError('"offset" is outside of buffer bounds') - } - - if (array.byteLength < byteOffset + (length || 0)) { - throw new RangeError('"length" is outside of buffer bounds') - } - - var buf - if (byteOffset === undefined && length === undefined) { - buf = new Uint8Array(array) - } else if (length === undefined) { - buf = new Uint8Array(array, byteOffset) - } else { - buf = new Uint8Array(array, byteOffset, length) - } - - // Return an augmented `Uint8Array` instance - Object.setPrototypeOf(buf, Buffer.prototype) - - return buf -} - -function fromObject (obj) { - if (Buffer.isBuffer(obj)) { - var len = checked(obj.length) | 0 - var buf = createBuffer(len) - - if (buf.length === 0) { - return buf - } - - obj.copy(buf, 0, 0, len) - return buf - } - - if (obj.length !== undefined) { - if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) { - return createBuffer(0) - } - return fromArrayLike(obj) - } - - if (obj.type === 'Buffer' && Array.isArray(obj.data)) { - return fromArrayLike(obj.data) - } -} - -function checked (length) { - // Note: cannot use `length < K_MAX_LENGTH` here because that fails when - // length is NaN (which is otherwise coerced to zero.) - if (length >= K_MAX_LENGTH) { - throw new RangeError('Attempt to allocate Buffer larger than maximum ' + - 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes') - } - return length | 0 -} - -function SlowBuffer (length) { - if (+length != length) { // eslint-disable-line eqeqeq - length = 0 - } - return Buffer.alloc(+length) -} - -Buffer.isBuffer = function isBuffer (b) { - return b != null && b._isBuffer === true && - b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false -} - -Buffer.compare = function compare (a, b) { - if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength) - if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength) - if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { - throw new TypeError( - 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array' - ) - } - - if (a === b) return 0 - - var x = a.length - var y = b.length - - for (var i = 0, len = Math.min(x, y); i < len; ++i) { - if (a[i] !== b[i]) { - x = a[i] - y = b[i] - break - } - } - - if (x < y) return -1 - if (y < x) return 1 - return 0 -} - -Buffer.isEncoding = function isEncoding (encoding) { - switch (String(encoding).toLowerCase()) { - case 'hex': - case 'utf8': - case 'utf-8': - case 'ascii': - case 'latin1': - case 'binary': - case 'base64': - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return true - default: - return false - } -} - -Buffer.concat = function concat (list, length) { - if (!Array.isArray(list)) { - throw new TypeError('"list" argument must be an Array of Buffers') - } - - if (list.length === 0) { - return Buffer.alloc(0) - } - - var i - if (length === undefined) { - length = 0 - for (i = 0; i < list.length; ++i) { - length += list[i].length - } - } - - var buffer = Buffer.allocUnsafe(length) - var pos = 0 - for (i = 0; i < list.length; ++i) { - var buf = list[i] - if (isInstance(buf, Uint8Array)) { - if (pos + buf.length > buffer.length) { - Buffer.from(buf).copy(buffer, pos) - } else { - Uint8Array.prototype.set.call( - buffer, - buf, - pos - ) - } - } else if (!Buffer.isBuffer(buf)) { - throw new TypeError('"list" argument must be an Array of Buffers') - } else { - buf.copy(buffer, pos) - } - pos += buf.length - } - return buffer -} - -function byteLength (string, encoding) { - if (Buffer.isBuffer(string)) { - return string.length - } - if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) { - return string.byteLength - } - if (typeof string !== 'string') { - throw new TypeError( - 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' + - 'Received type ' + typeof string - ) - } - - var len = string.length - var mustMatch = (arguments.length > 2 && arguments[2] === true) - if (!mustMatch && len === 0) return 0 - - // Use a for loop to avoid recursion - var loweredCase = false - for (;;) { - switch (encoding) { - case 'ascii': - case 'latin1': - case 'binary': - return len - case 'utf8': - case 'utf-8': - return utf8ToBytes(string).length - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return len * 2 - case 'hex': - return len >>> 1 - case 'base64': - return base64ToBytes(string).length - default: - if (loweredCase) { - return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8 - } - encoding = ('' + encoding).toLowerCase() - loweredCase = true - } - } -} -Buffer.byteLength = byteLength - -function slowToString (encoding, start, end) { - var loweredCase = false - - // No need to verify that "this.length <= MAX_UINT32" since it's a read-only - // property of a typed array. - - // This behaves neither like String nor Uint8Array in that we set start/end - // to their upper/lower bounds if the value passed is out of range. - // undefined is handled specially as per ECMA-262 6th Edition, - // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. - if (start === undefined || start < 0) { - start = 0 - } - // Return early if start > this.length. Done here to prevent potential uint32 - // coercion fail below. - if (start > this.length) { - return '' - } - - if (end === undefined || end > this.length) { - end = this.length - } - - if (end <= 0) { - return '' - } - - // Force coercion to uint32. This will also coerce falsey/NaN values to 0. - end >>>= 0 - start >>>= 0 - - if (end <= start) { - return '' - } - - if (!encoding) encoding = 'utf8' - - while (true) { - switch (encoding) { - case 'hex': - return hexSlice(this, start, end) - - case 'utf8': - case 'utf-8': - return utf8Slice(this, start, end) - - case 'ascii': - return asciiSlice(this, start, end) - - case 'latin1': - case 'binary': - return latin1Slice(this, start, end) - - case 'base64': - return base64Slice(this, start, end) - - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return utf16leSlice(this, start, end) - - default: - if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) - encoding = (encoding + '').toLowerCase() - loweredCase = true - } - } -} - -// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package) -// to detect a Buffer instance. It's not possible to use `instanceof Buffer` -// reliably in a browserify context because there could be multiple different -// copies of the 'buffer' package in use. This method works even for Buffer -// instances that were created from another copy of the `buffer` package. -// See: https://github.com/feross/buffer/issues/154 -Buffer.prototype._isBuffer = true - -function swap (b, n, m) { - var i = b[n] - b[n] = b[m] - b[m] = i -} - -Buffer.prototype.swap16 = function swap16 () { - var len = this.length - if (len % 2 !== 0) { - throw new RangeError('Buffer size must be a multiple of 16-bits') - } - for (var i = 0; i < len; i += 2) { - swap(this, i, i + 1) - } - return this -} - -Buffer.prototype.swap32 = function swap32 () { - var len = this.length - if (len % 4 !== 0) { - throw new RangeError('Buffer size must be a multiple of 32-bits') - } - for (var i = 0; i < len; i += 4) { - swap(this, i, i + 3) - swap(this, i + 1, i + 2) - } - return this -} - -Buffer.prototype.swap64 = function swap64 () { - var len = this.length - if (len % 8 !== 0) { - throw new RangeError('Buffer size must be a multiple of 64-bits') - } - for (var i = 0; i < len; i += 8) { - swap(this, i, i + 7) - swap(this, i + 1, i + 6) - swap(this, i + 2, i + 5) - swap(this, i + 3, i + 4) - } - return this -} - -Buffer.prototype.toString = function toString () { - var length = this.length - if (length === 0) return '' - if (arguments.length === 0) return utf8Slice(this, 0, length) - return slowToString.apply(this, arguments) -} - -Buffer.prototype.toLocaleString = Buffer.prototype.toString - -Buffer.prototype.equals = function equals (b) { - if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') - if (this === b) return true - return Buffer.compare(this, b) === 0 -} - -Buffer.prototype.inspect = function inspect () { - var str = '' - var max = exports.INSPECT_MAX_BYTES - str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim() - if (this.length > max) str += ' ... ' - return '' -} -if (customInspectSymbol) { - Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect -} - -Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) { - if (isInstance(target, Uint8Array)) { - target = Buffer.from(target, target.offset, target.byteLength) - } - if (!Buffer.isBuffer(target)) { - throw new TypeError( - 'The "target" argument must be one of type Buffer or Uint8Array. ' + - 'Received type ' + (typeof target) - ) - } - - if (start === undefined) { - start = 0 - } - if (end === undefined) { - end = target ? target.length : 0 - } - if (thisStart === undefined) { - thisStart = 0 - } - if (thisEnd === undefined) { - thisEnd = this.length - } - - if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { - throw new RangeError('out of range index') - } - - if (thisStart >= thisEnd && start >= end) { - return 0 - } - if (thisStart >= thisEnd) { - return -1 - } - if (start >= end) { - return 1 - } - - start >>>= 0 - end >>>= 0 - thisStart >>>= 0 - thisEnd >>>= 0 - - if (this === target) return 0 - - var x = thisEnd - thisStart - var y = end - start - var len = Math.min(x, y) - - var thisCopy = this.slice(thisStart, thisEnd) - var targetCopy = target.slice(start, end) - - for (var i = 0; i < len; ++i) { - if (thisCopy[i] !== targetCopy[i]) { - x = thisCopy[i] - y = targetCopy[i] - break - } - } - - if (x < y) return -1 - if (y < x) return 1 - return 0 -} - -// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, -// OR the last index of `val` in `buffer` at offset <= `byteOffset`. -// -// Arguments: -// - buffer - a Buffer to search -// - val - a string, Buffer, or number -// - byteOffset - an index into `buffer`; will be clamped to an int32 -// - encoding - an optional encoding, relevant is val is a string -// - dir - true for indexOf, false for lastIndexOf -function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) { - // Empty buffer means no match - if (buffer.length === 0) return -1 - - // Normalize byteOffset - if (typeof byteOffset === 'string') { - encoding = byteOffset - byteOffset = 0 - } else if (byteOffset > 0x7fffffff) { - byteOffset = 0x7fffffff - } else if (byteOffset < -0x80000000) { - byteOffset = -0x80000000 - } - byteOffset = +byteOffset // Coerce to Number. - if (numberIsNaN(byteOffset)) { - // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer - byteOffset = dir ? 0 : (buffer.length - 1) - } - - // Normalize byteOffset: negative offsets start from the end of the buffer - if (byteOffset < 0) byteOffset = buffer.length + byteOffset - if (byteOffset >= buffer.length) { - if (dir) return -1 - else byteOffset = buffer.length - 1 - } else if (byteOffset < 0) { - if (dir) byteOffset = 0 - else return -1 - } - - // Normalize val - if (typeof val === 'string') { - val = Buffer.from(val, encoding) - } - - // Finally, search either indexOf (if dir is true) or lastIndexOf - if (Buffer.isBuffer(val)) { - // Special case: looking for empty string/buffer always fails - if (val.length === 0) { - return -1 - } - return arrayIndexOf(buffer, val, byteOffset, encoding, dir) - } else if (typeof val === 'number') { - val = val & 0xFF // Search for a byte value [0-255] - if (typeof Uint8Array.prototype.indexOf === 'function') { - if (dir) { - return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset) - } else { - return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset) - } - } - return arrayIndexOf(buffer, [val], byteOffset, encoding, dir) - } - - throw new TypeError('val must be string, number or Buffer') -} - -function arrayIndexOf (arr, val, byteOffset, encoding, dir) { - var indexSize = 1 - var arrLength = arr.length - var valLength = val.length - - if (encoding !== undefined) { - encoding = String(encoding).toLowerCase() - if (encoding === 'ucs2' || encoding === 'ucs-2' || - encoding === 'utf16le' || encoding === 'utf-16le') { - if (arr.length < 2 || val.length < 2) { - return -1 - } - indexSize = 2 - arrLength /= 2 - valLength /= 2 - byteOffset /= 2 - } - } - - function read (buf, i) { - if (indexSize === 1) { - return buf[i] - } else { - return buf.readUInt16BE(i * indexSize) - } - } - - var i - if (dir) { - var foundIndex = -1 - for (i = byteOffset; i < arrLength; i++) { - if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { - if (foundIndex === -1) foundIndex = i - if (i - foundIndex + 1 === valLength) return foundIndex * indexSize - } else { - if (foundIndex !== -1) i -= i - foundIndex - foundIndex = -1 - } - } - } else { - if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength - for (i = byteOffset; i >= 0; i--) { - var found = true - for (var j = 0; j < valLength; j++) { - if (read(arr, i + j) !== read(val, j)) { - found = false - break - } - } - if (found) return i - } - } - - return -1 -} - -Buffer.prototype.includes = function includes (val, byteOffset, encoding) { - return this.indexOf(val, byteOffset, encoding) !== -1 -} - -Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) { - return bidirectionalIndexOf(this, val, byteOffset, encoding, true) -} - -Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) { - return bidirectionalIndexOf(this, val, byteOffset, encoding, false) -} - -function hexWrite (buf, string, offset, length) { - offset = Number(offset) || 0 - var remaining = buf.length - offset - if (!length) { - length = remaining - } else { - length = Number(length) - if (length > remaining) { - length = remaining - } - } - - var strLen = string.length - - if (length > strLen / 2) { - length = strLen / 2 - } - for (var i = 0; i < length; ++i) { - var parsed = parseInt(string.substr(i * 2, 2), 16) - if (numberIsNaN(parsed)) return i - buf[offset + i] = parsed - } - return i -} - -function utf8Write (buf, string, offset, length) { - return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length) -} - -function asciiWrite (buf, string, offset, length) { - return blitBuffer(asciiToBytes(string), buf, offset, length) -} - -function base64Write (buf, string, offset, length) { - return blitBuffer(base64ToBytes(string), buf, offset, length) -} - -function ucs2Write (buf, string, offset, length) { - return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length) -} - -Buffer.prototype.write = function write (string, offset, length, encoding) { - // Buffer#write(string) - if (offset === undefined) { - encoding = 'utf8' - length = this.length - offset = 0 - // Buffer#write(string, encoding) - } else if (length === undefined && typeof offset === 'string') { - encoding = offset - length = this.length - offset = 0 - // Buffer#write(string, offset[, length][, encoding]) - } else if (isFinite(offset)) { - offset = offset >>> 0 - if (isFinite(length)) { - length = length >>> 0 - if (encoding === undefined) encoding = 'utf8' - } else { - encoding = length - length = undefined - } - } else { - throw new Error( - 'Buffer.write(string, encoding, offset[, length]) is no longer supported' - ) - } - - var remaining = this.length - offset - if (length === undefined || length > remaining) length = remaining - - if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) { - throw new RangeError('Attempt to write outside buffer bounds') - } - - if (!encoding) encoding = 'utf8' - - var loweredCase = false - for (;;) { - switch (encoding) { - case 'hex': - return hexWrite(this, string, offset, length) - - case 'utf8': - case 'utf-8': - return utf8Write(this, string, offset, length) - - case 'ascii': - case 'latin1': - case 'binary': - return asciiWrite(this, string, offset, length) - - case 'base64': - // Warning: maxLength not taken into account in base64Write - return base64Write(this, string, offset, length) - - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return ucs2Write(this, string, offset, length) - - default: - if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) - encoding = ('' + encoding).toLowerCase() - loweredCase = true - } - } -} - -Buffer.prototype.toJSON = function toJSON () { - return { - type: 'Buffer', - data: Array.prototype.slice.call(this._arr || this, 0) - } -} - -function base64Slice (buf, start, end) { - if (start === 0 && end === buf.length) { - return base64.fromByteArray(buf) - } else { - return base64.fromByteArray(buf.slice(start, end)) - } -} - -function utf8Slice (buf, start, end) { - end = Math.min(buf.length, end) - var res = [] - - var i = start - while (i < end) { - var firstByte = buf[i] - var codePoint = null - var bytesPerSequence = (firstByte > 0xEF) - ? 4 - : (firstByte > 0xDF) - ? 3 - : (firstByte > 0xBF) - ? 2 - : 1 - - if (i + bytesPerSequence <= end) { - var secondByte, thirdByte, fourthByte, tempCodePoint - - switch (bytesPerSequence) { - case 1: - if (firstByte < 0x80) { - codePoint = firstByte - } - break - case 2: - secondByte = buf[i + 1] - if ((secondByte & 0xC0) === 0x80) { - tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F) - if (tempCodePoint > 0x7F) { - codePoint = tempCodePoint - } - } - break - case 3: - secondByte = buf[i + 1] - thirdByte = buf[i + 2] - if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { - tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F) - if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { - codePoint = tempCodePoint - } - } - break - case 4: - secondByte = buf[i + 1] - thirdByte = buf[i + 2] - fourthByte = buf[i + 3] - if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { - tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F) - if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { - codePoint = tempCodePoint - } - } - } - } - - if (codePoint === null) { - // we did not generate a valid codePoint so insert a - // replacement char (U+FFFD) and advance only 1 byte - codePoint = 0xFFFD - bytesPerSequence = 1 - } else if (codePoint > 0xFFFF) { - // encode to utf16 (surrogate pair dance) - codePoint -= 0x10000 - res.push(codePoint >>> 10 & 0x3FF | 0xD800) - codePoint = 0xDC00 | codePoint & 0x3FF - } - - res.push(codePoint) - i += bytesPerSequence - } - - return decodeCodePointsArray(res) -} - -// Based on http://stackoverflow.com/a/22747272/680742, the browser with -// the lowest limit is Chrome, with 0x10000 args. -// We go 1 magnitude less, for safety -var MAX_ARGUMENTS_LENGTH = 0x1000 - -function decodeCodePointsArray (codePoints) { - var len = codePoints.length - if (len <= MAX_ARGUMENTS_LENGTH) { - return String.fromCharCode.apply(String, codePoints) // avoid extra slice() - } - - // Decode in chunks to avoid "call stack size exceeded". - var res = '' - var i = 0 - while (i < len) { - res += String.fromCharCode.apply( - String, - codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH) - ) - } - return res -} - -function asciiSlice (buf, start, end) { - var ret = '' - end = Math.min(buf.length, end) - - for (var i = start; i < end; ++i) { - ret += String.fromCharCode(buf[i] & 0x7F) - } - return ret -} - -function latin1Slice (buf, start, end) { - var ret = '' - end = Math.min(buf.length, end) - - for (var i = start; i < end; ++i) { - ret += String.fromCharCode(buf[i]) - } - return ret -} - -function hexSlice (buf, start, end) { - var len = buf.length - - if (!start || start < 0) start = 0 - if (!end || end < 0 || end > len) end = len - - var out = '' - for (var i = start; i < end; ++i) { - out += hexSliceLookupTable[buf[i]] - } - return out -} - -function utf16leSlice (buf, start, end) { - var bytes = buf.slice(start, end) - var res = '' - // If bytes.length is odd, the last 8 bits must be ignored (same as node.js) - for (var i = 0; i < bytes.length - 1; i += 2) { - res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256)) - } - return res -} - -Buffer.prototype.slice = function slice (start, end) { - var len = this.length - start = ~~start - end = end === undefined ? len : ~~end - - if (start < 0) { - start += len - if (start < 0) start = 0 - } else if (start > len) { - start = len - } - - if (end < 0) { - end += len - if (end < 0) end = 0 - } else if (end > len) { - end = len - } - - if (end < start) end = start - - var newBuf = this.subarray(start, end) - // Return an augmented `Uint8Array` instance - Object.setPrototypeOf(newBuf, Buffer.prototype) - - return newBuf -} - -/* - * Need to make sure that buffer isn't trying to write out of bounds. - */ -function checkOffset (offset, ext, length) { - if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') - if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') -} - -Buffer.prototype.readUintLE = -Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) { - offset = offset >>> 0 - byteLength = byteLength >>> 0 - if (!noAssert) checkOffset(offset, byteLength, this.length) - - var val = this[offset] - var mul = 1 - var i = 0 - while (++i < byteLength && (mul *= 0x100)) { - val += this[offset + i] * mul - } - - return val -} - -Buffer.prototype.readUintBE = -Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) { - offset = offset >>> 0 - byteLength = byteLength >>> 0 - if (!noAssert) { - checkOffset(offset, byteLength, this.length) - } - - var val = this[offset + --byteLength] - var mul = 1 - while (byteLength > 0 && (mul *= 0x100)) { - val += this[offset + --byteLength] * mul - } - - return val -} - -Buffer.prototype.readUint8 = -Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 1, this.length) - return this[offset] -} - -Buffer.prototype.readUint16LE = -Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 2, this.length) - return this[offset] | (this[offset + 1] << 8) -} - -Buffer.prototype.readUint16BE = -Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 2, this.length) - return (this[offset] << 8) | this[offset + 1] -} - -Buffer.prototype.readUint32LE = -Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 4, this.length) - - return ((this[offset]) | - (this[offset + 1] << 8) | - (this[offset + 2] << 16)) + - (this[offset + 3] * 0x1000000) -} - -Buffer.prototype.readUint32BE = -Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 4, this.length) - - return (this[offset] * 0x1000000) + - ((this[offset + 1] << 16) | - (this[offset + 2] << 8) | - this[offset + 3]) -} - -Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) { - offset = offset >>> 0 - byteLength = byteLength >>> 0 - if (!noAssert) checkOffset(offset, byteLength, this.length) - - var val = this[offset] - var mul = 1 - var i = 0 - while (++i < byteLength && (mul *= 0x100)) { - val += this[offset + i] * mul - } - mul *= 0x80 - - if (val >= mul) val -= Math.pow(2, 8 * byteLength) - - return val -} - -Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) { - offset = offset >>> 0 - byteLength = byteLength >>> 0 - if (!noAssert) checkOffset(offset, byteLength, this.length) - - var i = byteLength - var mul = 1 - var val = this[offset + --i] - while (i > 0 && (mul *= 0x100)) { - val += this[offset + --i] * mul - } - mul *= 0x80 - - if (val >= mul) val -= Math.pow(2, 8 * byteLength) - - return val -} - -Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 1, this.length) - if (!(this[offset] & 0x80)) return (this[offset]) - return ((0xff - this[offset] + 1) * -1) -} - -Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 2, this.length) - var val = this[offset] | (this[offset + 1] << 8) - return (val & 0x8000) ? val | 0xFFFF0000 : val -} - -Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 2, this.length) - var val = this[offset + 1] | (this[offset] << 8) - return (val & 0x8000) ? val | 0xFFFF0000 : val -} - -Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 4, this.length) - - return (this[offset]) | - (this[offset + 1] << 8) | - (this[offset + 2] << 16) | - (this[offset + 3] << 24) -} - -Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 4, this.length) - - return (this[offset] << 24) | - (this[offset + 1] << 16) | - (this[offset + 2] << 8) | - (this[offset + 3]) -} - -Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 4, this.length) - return ieee754.read(this, offset, true, 23, 4) -} - -Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 4, this.length) - return ieee754.read(this, offset, false, 23, 4) -} - -Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 8, this.length) - return ieee754.read(this, offset, true, 52, 8) -} - -Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 8, this.length) - return ieee754.read(this, offset, false, 52, 8) -} - -function checkInt (buf, value, offset, ext, max, min) { - if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance') - if (value > max || value < min) throw new RangeError('"value" argument is out of bounds') - if (offset + ext > buf.length) throw new RangeError('Index out of range') -} - -Buffer.prototype.writeUintLE = -Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) { - value = +value - offset = offset >>> 0 - byteLength = byteLength >>> 0 - if (!noAssert) { - var maxBytes = Math.pow(2, 8 * byteLength) - 1 - checkInt(this, value, offset, byteLength, maxBytes, 0) - } - - var mul = 1 - var i = 0 - this[offset] = value & 0xFF - while (++i < byteLength && (mul *= 0x100)) { - this[offset + i] = (value / mul) & 0xFF - } - - return offset + byteLength -} - -Buffer.prototype.writeUintBE = -Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) { - value = +value - offset = offset >>> 0 - byteLength = byteLength >>> 0 - if (!noAssert) { - var maxBytes = Math.pow(2, 8 * byteLength) - 1 - checkInt(this, value, offset, byteLength, maxBytes, 0) - } - - var i = byteLength - 1 - var mul = 1 - this[offset + i] = value & 0xFF - while (--i >= 0 && (mul *= 0x100)) { - this[offset + i] = (value / mul) & 0xFF - } - - return offset + byteLength -} - -Buffer.prototype.writeUint8 = -Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0) - this[offset] = (value & 0xff) - return offset + 1 -} - -Buffer.prototype.writeUint16LE = -Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) - this[offset] = (value & 0xff) - this[offset + 1] = (value >>> 8) - return offset + 2 -} - -Buffer.prototype.writeUint16BE = -Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) - this[offset] = (value >>> 8) - this[offset + 1] = (value & 0xff) - return offset + 2 -} - -Buffer.prototype.writeUint32LE = -Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) - this[offset + 3] = (value >>> 24) - this[offset + 2] = (value >>> 16) - this[offset + 1] = (value >>> 8) - this[offset] = (value & 0xff) - return offset + 4 -} - -Buffer.prototype.writeUint32BE = -Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) - this[offset] = (value >>> 24) - this[offset + 1] = (value >>> 16) - this[offset + 2] = (value >>> 8) - this[offset + 3] = (value & 0xff) - return offset + 4 -} - -Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) { - var limit = Math.pow(2, (8 * byteLength) - 1) - - checkInt(this, value, offset, byteLength, limit - 1, -limit) - } - - var i = 0 - var mul = 1 - var sub = 0 - this[offset] = value & 0xFF - while (++i < byteLength && (mul *= 0x100)) { - if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { - sub = 1 - } - this[offset + i] = ((value / mul) >> 0) - sub & 0xFF - } - - return offset + byteLength -} - -Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) { - var limit = Math.pow(2, (8 * byteLength) - 1) - - checkInt(this, value, offset, byteLength, limit - 1, -limit) - } - - var i = byteLength - 1 - var mul = 1 - var sub = 0 - this[offset + i] = value & 0xFF - while (--i >= 0 && (mul *= 0x100)) { - if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { - sub = 1 - } - this[offset + i] = ((value / mul) >> 0) - sub & 0xFF - } - - return offset + byteLength -} - -Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80) - if (value < 0) value = 0xff + value + 1 - this[offset] = (value & 0xff) - return offset + 1 -} - -Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) - this[offset] = (value & 0xff) - this[offset + 1] = (value >>> 8) - return offset + 2 -} - -Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) - this[offset] = (value >>> 8) - this[offset + 1] = (value & 0xff) - return offset + 2 -} - -Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) - this[offset] = (value & 0xff) - this[offset + 1] = (value >>> 8) - this[offset + 2] = (value >>> 16) - this[offset + 3] = (value >>> 24) - return offset + 4 -} - -Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) - if (value < 0) value = 0xffffffff + value + 1 - this[offset] = (value >>> 24) - this[offset + 1] = (value >>> 16) - this[offset + 2] = (value >>> 8) - this[offset + 3] = (value & 0xff) - return offset + 4 -} - -function checkIEEE754 (buf, value, offset, ext, max, min) { - if (offset + ext > buf.length) throw new RangeError('Index out of range') - if (offset < 0) throw new RangeError('Index out of range') -} - -function writeFloat (buf, value, offset, littleEndian, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) { - checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38) - } - ieee754.write(buf, value, offset, littleEndian, 23, 4) - return offset + 4 -} - -Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) { - return writeFloat(this, value, offset, true, noAssert) -} - -Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) { - return writeFloat(this, value, offset, false, noAssert) -} - -function writeDouble (buf, value, offset, littleEndian, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) { - checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308) - } - ieee754.write(buf, value, offset, littleEndian, 52, 8) - return offset + 8 -} - -Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) { - return writeDouble(this, value, offset, true, noAssert) -} - -Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) { - return writeDouble(this, value, offset, false, noAssert) -} - -// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) -Buffer.prototype.copy = function copy (target, targetStart, start, end) { - if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer') - if (!start) start = 0 - if (!end && end !== 0) end = this.length - if (targetStart >= target.length) targetStart = target.length - if (!targetStart) targetStart = 0 - if (end > 0 && end < start) end = start - - // Copy 0 bytes; we're done - if (end === start) return 0 - if (target.length === 0 || this.length === 0) return 0 - - // Fatal error conditions - if (targetStart < 0) { - throw new RangeError('targetStart out of bounds') - } - if (start < 0 || start >= this.length) throw new RangeError('Index out of range') - if (end < 0) throw new RangeError('sourceEnd out of bounds') - - // Are we oob? - if (end > this.length) end = this.length - if (target.length - targetStart < end - start) { - end = target.length - targetStart + start - } - - var len = end - start - - if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') { - // Use built-in when available, missing from IE11 - this.copyWithin(targetStart, start, end) - } else { - Uint8Array.prototype.set.call( - target, - this.subarray(start, end), - targetStart - ) - } - - return len -} - -// Usage: -// buffer.fill(number[, offset[, end]]) -// buffer.fill(buffer[, offset[, end]]) -// buffer.fill(string[, offset[, end]][, encoding]) -Buffer.prototype.fill = function fill (val, start, end, encoding) { - // Handle string cases: - if (typeof val === 'string') { - if (typeof start === 'string') { - encoding = start - start = 0 - end = this.length - } else if (typeof end === 'string') { - encoding = end - end = this.length - } - if (encoding !== undefined && typeof encoding !== 'string') { - throw new TypeError('encoding must be a string') - } - if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { - throw new TypeError('Unknown encoding: ' + encoding) - } - if (val.length === 1) { - var code = val.charCodeAt(0) - if ((encoding === 'utf8' && code < 128) || - encoding === 'latin1') { - // Fast path: If `val` fits into a single byte, use that numeric value. - val = code - } - } - } else if (typeof val === 'number') { - val = val & 255 - } else if (typeof val === 'boolean') { - val = Number(val) - } - - // Invalid ranges are not set to a default, so can range check early. - if (start < 0 || this.length < start || this.length < end) { - throw new RangeError('Out of range index') - } - - if (end <= start) { - return this - } - - start = start >>> 0 - end = end === undefined ? this.length : end >>> 0 - - if (!val) val = 0 - - var i - if (typeof val === 'number') { - for (i = start; i < end; ++i) { - this[i] = val - } - } else { - var bytes = Buffer.isBuffer(val) - ? val - : Buffer.from(val, encoding) - var len = bytes.length - if (len === 0) { - throw new TypeError('The value "' + val + - '" is invalid for argument "value"') - } - for (i = 0; i < end - start; ++i) { - this[i + start] = bytes[i % len] - } - } - - return this -} - -// HELPER FUNCTIONS -// ================ - -var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g - -function base64clean (str) { - // Node takes equal signs as end of the Base64 encoding - str = str.split('=')[0] - // Node strips out invalid characters like \n and \t from the string, base64-js does not - str = str.trim().replace(INVALID_BASE64_RE, '') - // Node converts strings with length < 2 to '' - if (str.length < 2) return '' - // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not - while (str.length % 4 !== 0) { - str = str + '=' - } - return str -} - -function utf8ToBytes (string, units) { - units = units || Infinity - var codePoint - var length = string.length - var leadSurrogate = null - var bytes = [] - - for (var i = 0; i < length; ++i) { - codePoint = string.charCodeAt(i) - - // is surrogate component - if (codePoint > 0xD7FF && codePoint < 0xE000) { - // last char was a lead - if (!leadSurrogate) { - // no lead yet - if (codePoint > 0xDBFF) { - // unexpected trail - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) - continue - } else if (i + 1 === length) { - // unpaired lead - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) - continue - } - - // valid lead - leadSurrogate = codePoint - - continue - } - - // 2 leads in a row - if (codePoint < 0xDC00) { - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) - leadSurrogate = codePoint - continue - } - - // valid surrogate pair - codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000 - } else if (leadSurrogate) { - // valid bmp char, but last char was a lead - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) - } - - leadSurrogate = null - - // encode utf8 - if (codePoint < 0x80) { - if ((units -= 1) < 0) break - bytes.push(codePoint) - } else if (codePoint < 0x800) { - if ((units -= 2) < 0) break - bytes.push( - codePoint >> 0x6 | 0xC0, - codePoint & 0x3F | 0x80 - ) - } else if (codePoint < 0x10000) { - if ((units -= 3) < 0) break - bytes.push( - codePoint >> 0xC | 0xE0, - codePoint >> 0x6 & 0x3F | 0x80, - codePoint & 0x3F | 0x80 - ) - } else if (codePoint < 0x110000) { - if ((units -= 4) < 0) break - bytes.push( - codePoint >> 0x12 | 0xF0, - codePoint >> 0xC & 0x3F | 0x80, - codePoint >> 0x6 & 0x3F | 0x80, - codePoint & 0x3F | 0x80 - ) - } else { - throw new Error('Invalid code point') - } - } - - return bytes -} - -function asciiToBytes (str) { - var byteArray = [] - for (var i = 0; i < str.length; ++i) { - // Node's code seems to be doing this and not & 0x7F.. - byteArray.push(str.charCodeAt(i) & 0xFF) - } - return byteArray -} - -function utf16leToBytes (str, units) { - var c, hi, lo - var byteArray = [] - for (var i = 0; i < str.length; ++i) { - if ((units -= 2) < 0) break - - c = str.charCodeAt(i) - hi = c >> 8 - lo = c % 256 - byteArray.push(lo) - byteArray.push(hi) - } - - return byteArray -} - -function base64ToBytes (str) { - return base64.toByteArray(base64clean(str)) -} - -function blitBuffer (src, dst, offset, length) { - for (var i = 0; i < length; ++i) { - if ((i + offset >= dst.length) || (i >= src.length)) break - dst[i + offset] = src[i] - } - return i -} - -// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass -// the `instanceof` check but they should be treated as of that type. -// See: https://github.com/feross/buffer/issues/166 -function isInstance (obj, type) { - return obj instanceof type || - (obj != null && obj.constructor != null && obj.constructor.name != null && - obj.constructor.name === type.name) -} -function numberIsNaN (obj) { - // For IE11 support - return obj !== obj // eslint-disable-line no-self-compare -} - -// Create lookup table for `toString('hex')` -// See: https://github.com/feross/buffer/issues/219 -var hexSliceLookupTable = (function () { - var alphabet = '0123456789abcdef' - var table = new Array(256) - for (var i = 0; i < 16; ++i) { - var i16 = i * 16 - for (var j = 0; j < 16; ++j) { - table[i16 + j] = alphabet[i] + alphabet[j] - } - } - return table -})() diff --git a/node_modules/buffer/package.json b/node_modules/buffer/package.json deleted file mode 100644 index 3b1b498..0000000 --- a/node_modules/buffer/package.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "name": "buffer", - "description": "Node.js Buffer API, for the browser", - "version": "5.7.1", - "author": { - "name": "Feross Aboukhadijeh", - "email": "feross@feross.org", - "url": "https://feross.org" - }, - "bugs": { - "url": "https://github.com/feross/buffer/issues" - }, - "contributors": [ - "Romain Beauxis ", - "James Halliday " - ], - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - }, - "devDependencies": { - "airtap": "^3.0.0", - "benchmark": "^2.1.4", - "browserify": "^17.0.0", - "concat-stream": "^2.0.0", - "hyperquest": "^2.1.3", - "is-buffer": "^2.0.4", - "is-nan": "^1.3.0", - "split": "^1.0.1", - "standard": "*", - "tape": "^5.0.1", - "through2": "^4.0.2", - "uglify-js": "^3.11.3" - }, - "homepage": "https://github.com/feross/buffer", - "jspm": { - "map": { - "./index.js": { - "node": "@node/buffer" - } - } - }, - "keywords": [ - "arraybuffer", - "browser", - "browserify", - "buffer", - "compatible", - "dataview", - "uint8array" - ], - "license": "MIT", - "main": "index.js", - "types": "index.d.ts", - "repository": { - "type": "git", - "url": "git://github.com/feross/buffer.git" - }, - "scripts": { - "perf": "browserify --debug perf/bracket-notation.js > perf/bundle.js && open perf/index.html", - "perf-node": "node perf/bracket-notation.js && node perf/concat.js && node perf/copy-big.js && node perf/copy.js && node perf/new-big.js && node perf/new.js && node perf/readDoubleBE.js && node perf/readFloatBE.js && node perf/readUInt32LE.js && node perf/slice.js && node perf/writeFloatBE.js", - "size": "browserify -r ./ | uglifyjs -c -m | gzip | wc -c", - "test": "standard && node ./bin/test.js", - "test-browser-es5": "airtap -- test/*.js", - "test-browser-es5-local": "airtap --local -- test/*.js", - "test-browser-es6": "airtap -- test/*.js test/node/*.js", - "test-browser-es6-local": "airtap --local -- test/*.js test/node/*.js", - "test-node": "tape test/*.js test/node/*.js", - "update-authors": "./bin/update-authors.sh" - }, - "standard": { - "ignore": [ - "test/node/**/*.js", - "test/common.js", - "test/_polyfill.js", - "perf/**/*.js" - ], - "globals": [ - "SharedArrayBuffer" - ] - }, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] -} diff --git a/node_modules/debug/package.json b/node_modules/debug/package.json index 60dfcf5..afc2f8b 100644 --- a/node_modules/debug/package.json +++ b/node_modules/debug/package.json @@ -1,6 +1,6 @@ { "name": "debug", - "version": "4.4.0", + "version": "4.4.1", "repository": { "type": "git", "url": "git://github.com/debug-js/debug.git" @@ -26,7 +26,7 @@ "scripts": { "lint": "xo", "test": "npm run test:node && npm run test:browser && npm run lint", - "test:node": "istanbul cover _mocha -- test.js test.node.js", + "test:node": "mocha test.js test.node.js", "test:browser": "karma start --single-run", "test:coverage": "cat ./coverage/lcov.info | coveralls" }, @@ -37,7 +37,6 @@ "brfs": "^2.0.1", "browserify": "^16.2.3", "coveralls": "^3.0.2", - "istanbul": "^0.4.5", "karma": "^3.1.4", "karma-browserify": "^6.0.0", "karma-chrome-launcher": "^2.2.0", diff --git a/node_modules/debug/src/browser.js b/node_modules/debug/src/browser.js index df8e179..5993451 100644 --- a/node_modules/debug/src/browser.js +++ b/node_modules/debug/src/browser.js @@ -219,7 +219,7 @@ function save(namespaces) { function load() { let r; try { - r = exports.storage.getItem('debug'); + r = exports.storage.getItem('debug') || exports.storage.getItem('DEBUG') ; } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? diff --git a/node_modules/debug/src/common.js b/node_modules/debug/src/common.js index 528c7ec..141cb57 100644 --- a/node_modules/debug/src/common.js +++ b/node_modules/debug/src/common.js @@ -168,7 +168,7 @@ function setup(env) { const split = (typeof namespaces === 'string' ? namespaces : '') .trim() - .replace(' ', ',') + .replace(/\s+/g, ',') .split(',') .filter(Boolean); diff --git a/node_modules/end-of-stream/index.js b/node_modules/end-of-stream/index.js index c77f0d5..7ce47e9 100644 --- a/node_modules/end-of-stream/index.js +++ b/node_modules/end-of-stream/index.js @@ -2,6 +2,8 @@ var once = require('once'); var noop = function() {}; +var qnt = global.Bare ? queueMicrotask : process.nextTick.bind(process); + var isRequest = function(stream) { return stream.setHeader && typeof stream.abort === 'function'; }; @@ -45,7 +47,7 @@ var eos = function(stream, opts, callback) { }; var onclose = function() { - process.nextTick(onclosenexttick); + qnt(onclosenexttick); }; var onclosenexttick = function() { diff --git a/node_modules/end-of-stream/package.json b/node_modules/end-of-stream/package.json index b75bbf0..0b530cd 100644 --- a/node_modules/end-of-stream/package.json +++ b/node_modules/end-of-stream/package.json @@ -1,6 +1,6 @@ { "name": "end-of-stream", - "version": "1.4.4", + "version": "1.4.5", "description": "Call a callback when a readable/writable/duplex stream has completed or failed.", "repository": { "type": "git", diff --git a/node_modules/ieee754/LICENSE b/node_modules/ieee754/LICENSE deleted file mode 100644 index 5aac82c..0000000 --- a/node_modules/ieee754/LICENSE +++ /dev/null @@ -1,11 +0,0 @@ -Copyright 2008 Fair Oaks Labs, Inc. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/ieee754/README.md b/node_modules/ieee754/README.md deleted file mode 100644 index cb7527b..0000000 --- a/node_modules/ieee754/README.md +++ /dev/null @@ -1,51 +0,0 @@ -# ieee754 [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url] - -[travis-image]: https://img.shields.io/travis/feross/ieee754/master.svg -[travis-url]: https://travis-ci.org/feross/ieee754 -[npm-image]: https://img.shields.io/npm/v/ieee754.svg -[npm-url]: https://npmjs.org/package/ieee754 -[downloads-image]: https://img.shields.io/npm/dm/ieee754.svg -[downloads-url]: https://npmjs.org/package/ieee754 -[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg -[standard-url]: https://standardjs.com - -[![saucelabs][saucelabs-image]][saucelabs-url] - -[saucelabs-image]: https://saucelabs.com/browser-matrix/ieee754.svg -[saucelabs-url]: https://saucelabs.com/u/ieee754 - -### Read/write IEEE754 floating point numbers from/to a Buffer or array-like object. - -## install - -``` -npm install ieee754 -``` - -## methods - -`var ieee754 = require('ieee754')` - -The `ieee754` object has the following functions: - -``` -ieee754.read = function (buffer, offset, isLE, mLen, nBytes) -ieee754.write = function (buffer, value, offset, isLE, mLen, nBytes) -``` - -The arguments mean the following: - -- buffer = the buffer -- offset = offset into the buffer -- value = value to set (only for `write`) -- isLe = is little endian? -- mLen = mantissa length -- nBytes = number of bytes - -## what is ieee754? - -The IEEE Standard for Floating-Point Arithmetic (IEEE 754) is a technical standard for floating-point computation. [Read more](http://en.wikipedia.org/wiki/IEEE_floating_point). - -## license - -BSD 3 Clause. Copyright (c) 2008, Fair Oaks Labs, Inc. diff --git a/node_modules/ieee754/index.d.ts b/node_modules/ieee754/index.d.ts deleted file mode 100644 index f1e4354..0000000 --- a/node_modules/ieee754/index.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -declare namespace ieee754 { - export function read( - buffer: Uint8Array, offset: number, isLE: boolean, mLen: number, - nBytes: number): number; - export function write( - buffer: Uint8Array, value: number, offset: number, isLE: boolean, - mLen: number, nBytes: number): void; - } - - export = ieee754; \ No newline at end of file diff --git a/node_modules/ieee754/index.js b/node_modules/ieee754/index.js deleted file mode 100644 index 81d26c3..0000000 --- a/node_modules/ieee754/index.js +++ /dev/null @@ -1,85 +0,0 @@ -/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ -exports.read = function (buffer, offset, isLE, mLen, nBytes) { - var e, m - var eLen = (nBytes * 8) - mLen - 1 - var eMax = (1 << eLen) - 1 - var eBias = eMax >> 1 - var nBits = -7 - var i = isLE ? (nBytes - 1) : 0 - var d = isLE ? -1 : 1 - var s = buffer[offset + i] - - i += d - - e = s & ((1 << (-nBits)) - 1) - s >>= (-nBits) - nBits += eLen - for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {} - - m = e & ((1 << (-nBits)) - 1) - e >>= (-nBits) - nBits += mLen - for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {} - - if (e === 0) { - e = 1 - eBias - } else if (e === eMax) { - return m ? NaN : ((s ? -1 : 1) * Infinity) - } else { - m = m + Math.pow(2, mLen) - e = e - eBias - } - return (s ? -1 : 1) * m * Math.pow(2, e - mLen) -} - -exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { - var e, m, c - var eLen = (nBytes * 8) - mLen - 1 - var eMax = (1 << eLen) - 1 - var eBias = eMax >> 1 - var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0) - var i = isLE ? 0 : (nBytes - 1) - var d = isLE ? 1 : -1 - var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0 - - value = Math.abs(value) - - if (isNaN(value) || value === Infinity) { - m = isNaN(value) ? 1 : 0 - e = eMax - } else { - e = Math.floor(Math.log(value) / Math.LN2) - if (value * (c = Math.pow(2, -e)) < 1) { - e-- - c *= 2 - } - if (e + eBias >= 1) { - value += rt / c - } else { - value += rt * Math.pow(2, 1 - eBias) - } - if (value * c >= 2) { - e++ - c /= 2 - } - - if (e + eBias >= eMax) { - m = 0 - e = eMax - } else if (e + eBias >= 1) { - m = ((value * c) - 1) * Math.pow(2, mLen) - e = e + eBias - } else { - m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen) - e = 0 - } - } - - for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} - - e = (e << mLen) | m - eLen += mLen - for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} - - buffer[offset + i - d] |= s * 128 -} diff --git a/node_modules/ieee754/package.json b/node_modules/ieee754/package.json deleted file mode 100644 index 7b23851..0000000 --- a/node_modules/ieee754/package.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "ieee754", - "description": "Read/write IEEE754 floating point numbers from/to a Buffer or array-like object", - "version": "1.2.1", - "author": { - "name": "Feross Aboukhadijeh", - "email": "feross@feross.org", - "url": "https://feross.org" - }, - "contributors": [ - "Romain Beauxis " - ], - "devDependencies": { - "airtap": "^3.0.0", - "standard": "*", - "tape": "^5.0.1" - }, - "keywords": [ - "IEEE 754", - "buffer", - "convert", - "floating point", - "ieee754" - ], - "license": "BSD-3-Clause", - "main": "index.js", - "types": "index.d.ts", - "repository": { - "type": "git", - "url": "git://github.com/feross/ieee754.git" - }, - "scripts": { - "test": "standard && npm run test-node && npm run test-browser", - "test-browser": "airtap -- test/*.js", - "test-browser-local": "airtap --local -- test/*.js", - "test-node": "tape test/*.js" - }, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] -} diff --git a/node_modules/mqtt-packet/.github/workflows/ci.yml b/node_modules/mqtt-packet/.github/workflows/ci.yml deleted file mode 100644 index 04ad172..0000000 --- a/node_modules/mqtt-packet/.github/workflows/ci.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: ci - -on: [push, pull_request] - -jobs: - test: - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [6.x, 8.x, 10.x, 12.x, 14.x] - - steps: - - uses: actions/checkout@v1 - - - name: Use Node.js - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - - name: Install - run: | - npm install - - - name: Run tests - run: | - npm run ci diff --git a/node_modules/mqtt-packet/README.md b/node_modules/mqtt-packet/README.md index 72a0356..193f685 100644 --- a/node_modules/mqtt-packet/README.md +++ b/node_modules/mqtt-packet/README.md @@ -1,7 +1,7 @@ -mqtt-packet +mqtt-packet   [![Build Status](https://travis-ci.org/mqttjs/mqtt-packet.png)](https://travis-ci.org/mqttjs/mqtt-packet) =========== -Encode and Decode MQTT 3.1.1, 5.0 packets the node way. +Encode and Decode MQTT 3.1.1 packets the node way. [![JavaScript Style Guide](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) @@ -12,7 +12,7 @@ Encode and Decode MQTT 3.1.1, 5.0 packets the node way. * Contributing * License & copyright -This library is tested with node v6, v8, v10, v12 and v14. The last version to support +This library is tested with node v4, v6 and v7. The last version to support older versions of node was mqtt-packet@4.1.2. Installation @@ -28,8 +28,8 @@ Examples ### Generating ```js -const mqtt = require('mqtt-packet'); -const object = { +var mqtt = require('mqtt-packet') +var object = { cmd: 'publish', retain: false, qos: 0, @@ -37,8 +37,7 @@ const object = { length: 10, topic: 'test', payload: 'test' // Can also be a Buffer -}; -const opts = { protocolVersion: 4 }; // default is 4. Usually, opts is a connect packet +} console.log(mqtt.generate(object)) // Prints: @@ -47,7 +46,7 @@ console.log(mqtt.generate(object)) // // Which is the same as: // -// Buffer.from([ +// new Buffer([ // 48, 10, // Header (publish) // 0, 4, // Topic length // 116, 101, 115, 116, // Topic (test) @@ -58,12 +57,11 @@ console.log(mqtt.generate(object)) ### Parsing ```js -const mqtt = require('mqtt-packet'); -const opts = { protocolVersion: 4 }; // default is 4. Usually, opts is a connect packet -const parser = mqtt.parser(opts); +var mqtt = require('mqtt-packet') +var parser = mqtt.parser() // Synchronously emits all the parsed packets -parser.on('packet', packet => { +parser.on('packet', function(packet) { console.log(packet) // Prints: // @@ -78,12 +76,12 @@ parser.on('packet', packet => { // } }) -parser.parse(Buffer.from([ +parser.parse(new Buffer([ 48, 10, // Header (publish) 0, 4, // Topic length 116, 101, 115, 116, // Topic (test) 116, 101, 115, 116 // Payload (test) -])) +]) // Returns the number of bytes left in the parser ``` @@ -96,7 +94,7 @@ API -### mqtt.generate(object, [opts]) +### mqtt.generate(object) Generates a `Buffer` containing an MQTT packet. The object must be one of the ones specified by the [packets](#packets) @@ -104,7 +102,7 @@ section. Throws an `Error` if a packet cannot be generated. -### mqtt.writeToStream(object, stream, [opts]) +### mqtt.writeToStream(object, stream) Writes the mqtt packet defined by `object` to the given stream. The object must be one of the ones specified by the [packets](#packets) @@ -117,7 +115,7 @@ Should be set before any `writeToStream` calls. -### mqtt.parser([opts]) +### mqtt.parser() Returns a new `Parser` object. `Parser` inherits from `EventEmitter` and will emit: @@ -148,40 +146,16 @@ and that you can input to `generate`. ```js { cmd: 'connect', - protocolId: 'MQTT', // Or 'MQIsdp' in MQTT 3.1 and 5.0 - protocolVersion: 4, // Or 3 in MQTT 3.1, or 5 in MQTT 5.0 + protocolId: 'MQTT', // Or 'MQIsdp' in MQTT 3.1 + protocolVersion: 4, // Or 3 in MQTT 3.1 clean: true, // Can also be false clientId: 'my-device', keepalive: 0, // Seconds which can be any positive number, with 0 as the default setting username: 'matteo', - password: Buffer.from('collina'), // Passwords are buffers + password: new Buffer('collina'), // Passwords are buffers will: { topic: 'mydevice/status', - payload: Buffer.from('dead'), // Payloads are buffers - properties: { // MQTT 5.0 - willDelayInterval: 1234, - payloadFormatIndicator: false, - messageExpiryInterval: 4321, - contentType: 'test', - responseTopic: 'topic', - correlationData: Buffer.from([1, 2, 3, 4]), - userProperties: { - 'test': 'test' - } - } - }, - properties: { // MQTT 5.0 properties - sessionExpiryInterval: 1234, - receiveMaximum: 432, - maximumPacketSize: 100, - topicAliasMaximum: 456, - requestResponseInformation: true, - requestProblemInformation: true, - userProperties: { - 'test': 'test' - }, - authenticationMethod: 'test', - authenticationData: Buffer.from([1, 2, 3, 4]) + payload: new Buffer('dead') // Payloads are buffers } } ``` @@ -197,30 +171,8 @@ automatically be converted into a `Buffer`. ```js { cmd: 'connack', - returnCode: 0, // Or whatever else you see fit MQTT < 5.0 - sessionPresent: false, // Can also be true. - reasonCode: 0, // reason code MQTT 5.0 - properties: { // MQTT 5.0 properties - sessionExpiryInterval: 1234, - receiveMaximum: 432, - maximumQoS: 2, - retainAvailable: true, - maximumPacketSize: 100, - assignedClientIdentifier: 'test', - topicAliasMaximum: 456, - reasonString: 'test', - userProperties: { - 'test': 'test' - }, - wildcardSubscriptionAvailable: true, - subscriptionIdentifiersAvailable: true, - sharedSubscriptionAvailable: false, - serverKeepAlive: 1234, - responseInformation: 'test', - serverReference: 'test', - authenticationMethod: 'test', - authenticationData: Buffer.from([1, 2, 3, 4]) - } + returnCode: 0, // Or whatever else you see fit + sessionPresent: false // Can also be true. } ``` @@ -233,18 +185,9 @@ missing. { cmd: 'subscribe', messageId: 42, - properties: { // MQTT 5.0 properties - subscriptionIdentifier: 145, - userProperties: { - test: 'test' - } - } subscriptions: [{ topic: 'test', - qos: 0, - nl: false, // no Local MQTT 5.0 flag - rap: true, // Retain as Published MQTT 5.0 flag - rh: 1 // Retain Handling MQTT 5.0 + qos: 0 }] } ``` @@ -257,12 +200,6 @@ All properties are mandatory. { cmd: 'suback', messageId: 42, - properties: { // MQTT 5.0 properties - reasonString: 'test', - userProperties: { - 'test': 'test' - } - } granted: [0, 1, 2, 128] } ``` @@ -276,11 +213,6 @@ All properties are mandatory. { cmd: 'unsubscribe', messageId: 42, - properties: { // MQTT 5.0 properties - userProperties: { - 'test': 'test' - } - } unsubscriptions: [ 'test', 'a/topic' @@ -295,13 +227,7 @@ All properties are mandatory. ```js { cmd: 'unsuback', - messageId: 42, - properties: { // MQTT 5.0 properties - reasonString: 'test', - userProperties: { - 'test': 'test' - } - } + messageId: 42 } ``` @@ -316,20 +242,8 @@ All properties are mandatory. qos: 2, dup: false, topic: 'test', - payload: Buffer.from('test'), - retain: false, - properties: { // optional properties MQTT 5.0 - payloadFormatIndicator: true, - messageExpiryInterval: 4321, - topicAlias: 100, - responseTopic: 'topic', - correlationData: Buffer.from([1, 2, 3, 4]), - userProperties: { - 'test': 'test' - }, - subscriptionIdentifier: 120, // can be an Array in message from broker, if message included in few another subscriptions - contentType: 'test' - } + payload: new Buffer('test'), + retain: false } ``` @@ -342,14 +256,7 @@ Both `topic` and `payload` can be `Buffer` objects instead of strings. ```js { cmd: 'puback', - messageId: 42, - reasonCode: 16, // only for MQTT 5.0 - properties: { // MQTT 5.0 properties - reasonString: 'test', - userProperties: { - 'test': 'test' - } - } + messageId: 42 } ``` @@ -360,15 +267,8 @@ missing. ```js { - cmd: 'pubrec', - messageId: 42, - reasonCode: 16, // only for MQTT 5.0 - properties: { // properties MQTT 5.0 - reasonString: 'test', - userProperties: { - 'test': 'test' - } - } + cmd: 'pubcomp', + messageId: 42 } ``` @@ -380,14 +280,7 @@ missing. ```js { cmd: 'pubrel', - messageId: 42, - reasonCode: 16, // only for MQTT 5.0 - properties: { // properties MQTT 5.0 - reasonString: 'test', - userProperties: { - 'test': 'test' - } - } + messageId: 42 } ``` @@ -399,14 +292,7 @@ missing. ```js { cmd: 'pubcomp', - messageId: 42, - reasonCode: 16, // only for MQTT 5.0 - properties: { // properties MQTT 5.0 - reasonString: 'test', - userProperties: { - 'test': 'test' - } - } + messageId: 42 } ``` @@ -433,33 +319,7 @@ missing. ```js { - cmd: 'disconnect', - reasonCode: 0, // MQTT 5.0 code - properties: { // properties MQTT 5.0 - sessionExpiryInterval: 145, - reasonString: 'test', - userProperties: { - 'test': 'test' - }, - serverReference: 'test' - } -} -``` - -### Auth - -```js -{ - cmd: 'auth', - reasonCode: 0, // MQTT 5.0 code - properties: { // properties MQTT 5.0 - authenticationMethod: 'test', - authenticationData: Buffer.from([0, 1, 2, 3]), - reasonString: 'test', - userProperties: { - 'test': 'test' - } - } + cmd: 'disconnect' } ``` @@ -482,7 +342,6 @@ mqtt-packet is only possible due to the excellent work of the following contribu Matteo CollinaGitHub/mcollinaTwitter/@matteocollina Adam RuddGitHub/adamvrTwitter/@adam_vr Peter SorowkaGitHub/psorowkaTwitter/@psorowka -Siarhei BuntsevichGitHub/scarry1992 License diff --git a/node_modules/mqtt-packet/benchmarks/generate.js b/node_modules/mqtt-packet/benchmarks/generate.js index 0d7ce7e..539a10a 100644 --- a/node_modules/mqtt-packet/benchmarks/generate.js +++ b/node_modules/mqtt-packet/benchmarks/generate.js @@ -1,7 +1,9 @@ -const mqtt = require('../') -const max = 100000 -let i -const buf = Buffer.from('test') +'use strict' + +var mqtt = require('../') +var max = 100000 +var i +var buf = Buffer.from('test') // initialize it mqtt.generate({ @@ -10,7 +12,8 @@ mqtt.generate({ payload: buf }) -const start = Date.now() +var start = Date.now() +var time for (i = 0; i < max; i++) { mqtt.generate({ @@ -20,7 +23,7 @@ for (i = 0; i < max; i++) { }) } -const time = Date.now() - start +time = Date.now() - start console.log('Total time', time) console.log('Total packets', max) console.log('Packet/s', max / time * 1000) diff --git a/node_modules/mqtt-packet/benchmarks/generateNet.js b/node_modules/mqtt-packet/benchmarks/generateNet.js index 852ac94..02e2780 100644 --- a/node_modules/mqtt-packet/benchmarks/generateNet.js +++ b/node_modules/mqtt-packet/benchmarks/generateNet.js @@ -1,13 +1,13 @@ -const mqtt = require('../') -const max = 1000000 -let i = 0 -const start = Date.now() -let time -const buf = Buffer.allocUnsafe(10) -const net = require('net') -const server = net.createServer(handle) -let dest +var mqtt = require('../') +var max = 1000000 +var i = 0 +var start = Date.now() +var time +var buf = Buffer.allocUnsafe(10) +var net = require('net') +var server = net.createServer(handle) +var dest buf.fill('test') @@ -15,12 +15,12 @@ function handle (sock) { sock.resume() } -server.listen(0, () => { +server.listen(0, function () { dest = net.connect(server.address()) dest.on('connect', tickWait) dest.on('drain', tickWait) - dest.on('finish', () => { + dest.on('finish', function () { time = Date.now() - start console.log('Total time', time) console.log('Total packets', max) @@ -31,7 +31,7 @@ server.listen(0, () => { function tickWait () { // console.log('tickWait', i) - let res = true + var res = true // var toSend = new Buffer(5 + buf.length) for (; i < max && res; i++) { diff --git a/node_modules/mqtt-packet/benchmarks/parse.js b/node_modules/mqtt-packet/benchmarks/parse.js index e6df8ee..cacdf4e 100644 --- a/node_modules/mqtt-packet/benchmarks/parse.js +++ b/node_modules/mqtt-packet/benchmarks/parse.js @@ -1,9 +1,10 @@ -const mqtt = require('../') -const parser = mqtt.parser() -const max = 10000000 -let i -const start = Date.now() / 1000 +var mqtt = require('../') +var parser = mqtt.parser() +var max = 10000000 +var i +var start = Date.now() / 1000 +var time for (i = 0; i < max; i++) { parser.parse(Buffer.from([ @@ -14,7 +15,7 @@ for (i = 0; i < max; i++) { ])) } -const time = Date.now() / 1000 - start +time = Date.now() / 1000 - start console.log('Total packets', max) console.log('Total time', Math.round(time * 100) / 100) console.log('Packet/s', max / time) diff --git a/node_modules/mqtt-packet/benchmarks/writeToStream.js b/node_modules/mqtt-packet/benchmarks/writeToStream.js index 919b53d..87ca0c5 100644 --- a/node_modules/mqtt-packet/benchmarks/writeToStream.js +++ b/node_modules/mqtt-packet/benchmarks/writeToStream.js @@ -1,13 +1,13 @@ -const mqtt = require('../') -const max = 1000000 -let i = 0 -const start = Date.now() -let time -const buf = Buffer.allocUnsafe(10) -const net = require('net') -const server = net.createServer(handle) -let dest +var mqtt = require('../') +var max = 1000000 +var i = 0 +var start = Date.now() +var time +var buf = Buffer.allocUnsafe(10) +var net = require('net') +var server = net.createServer(handle) +var dest function handle (sock) { sock.resume() @@ -15,12 +15,12 @@ function handle (sock) { buf.fill('test') -server.listen(0, () => { +server.listen(0, function () { dest = net.connect(server.address()) dest.on('connect', tickWait) dest.on('drain', tickWait) - dest.on('finish', () => { + dest.on('finish', function () { time = Date.now() - start console.log('Total time', time) console.log('Total packets', max) @@ -30,7 +30,7 @@ server.listen(0, () => { }) function tickWait () { - let res = true + var res = true // var toSend = new Buffer(5) for (; i < max && res; i++) { diff --git a/node_modules/mqtt-packet/constants.js b/node_modules/mqtt-packet/constants.js index 1e55e4e..6bfddcf 100644 --- a/node_modules/mqtt-packet/constants.js +++ b/node_modules/mqtt-packet/constants.js @@ -1,5 +1,9 @@ +'use strict' + +var Buffer = require('safe-buffer').Buffer + /* Protocol - protocol constants */ -const protocol = module.exports +var protocol = module.exports /* Command code => mnemonic */ protocol.types = { @@ -18,13 +22,13 @@ protocol.types = { 12: 'pingreq', 13: 'pingresp', 14: 'disconnect', - 15: 'auth' + 15: 'reserved' } /* Mnemonic => Command code */ protocol.codes = {} -for (const k in protocol.types) { - const v = protocol.types[k] +for (var k in protocol.types) { + var v = protocol.types[k] protocol.codes[v] = k } @@ -37,14 +41,13 @@ protocol.QOS_SHIFT = 1 protocol.RETAIN_MASK = 0x01 /* Length */ -protocol.VARBYTEINT_MASK = 0x7F -protocol.VARBYTEINT_FIN_MASK = 0x80 -protocol.VARBYTEINT_MAX = 268435455 +protocol.LENGTH_MASK = 0x7F +protocol.LENGTH_FIN_MASK = 0x80 /* Connack */ protocol.SESSIONPRESENT_MASK = 0x01 protocol.SESSIONPRESENT_HEADER = Buffer.from([protocol.SESSIONPRESENT_MASK]) -protocol.CONNACK_HEADER = Buffer.from([protocol.codes.connack << protocol.CMD_SHIFT]) +protocol.CONNACK_HEADER = Buffer.from([protocol.codes['connack'] << protocol.CMD_SHIFT]) /* Connect */ protocol.USERNAME_MASK = 0x80 @@ -54,78 +57,13 @@ protocol.WILL_QOS_MASK = 0x18 protocol.WILL_QOS_SHIFT = 3 protocol.WILL_FLAG_MASK = 0x04 protocol.CLEAN_SESSION_MASK = 0x02 -protocol.CONNECT_HEADER = Buffer.from([protocol.codes.connect << protocol.CMD_SHIFT]) - -/* Properties */ -protocol.properties = { - sessionExpiryInterval: 17, - willDelayInterval: 24, - receiveMaximum: 33, - maximumPacketSize: 39, - topicAliasMaximum: 34, - requestResponseInformation: 25, - requestProblemInformation: 23, - userProperties: 38, - authenticationMethod: 21, - authenticationData: 22, - payloadFormatIndicator: 1, - messageExpiryInterval: 2, - contentType: 3, - responseTopic: 8, - correlationData: 9, - maximumQoS: 36, - retainAvailable: 37, - assignedClientIdentifier: 18, - reasonString: 31, - wildcardSubscriptionAvailable: 40, - subscriptionIdentifiersAvailable: 41, - sharedSubscriptionAvailable: 42, - serverKeepAlive: 19, - responseInformation: 26, - serverReference: 28, - topicAlias: 35, - subscriptionIdentifier: 11 -} -protocol.propertiesCodes = {} -for (const prop in protocol.properties) { - const id = protocol.properties[prop] - protocol.propertiesCodes[id] = prop -} -protocol.propertiesTypes = { - sessionExpiryInterval: 'int32', - willDelayInterval: 'int32', - receiveMaximum: 'int16', - maximumPacketSize: 'int32', - topicAliasMaximum: 'int16', - requestResponseInformation: 'byte', - requestProblemInformation: 'byte', - userProperties: 'pair', - authenticationMethod: 'string', - authenticationData: 'binary', - payloadFormatIndicator: 'byte', - messageExpiryInterval: 'int32', - contentType: 'string', - responseTopic: 'string', - correlationData: 'binary', - maximumQoS: 'int8', - retainAvailable: 'byte', - assignedClientIdentifier: 'string', - reasonString: 'string', - wildcardSubscriptionAvailable: 'byte', - subscriptionIdentifiersAvailable: 'byte', - sharedSubscriptionAvailable: 'byte', - serverKeepAlive: 'int16', - responseInformation: 'string', - serverReference: 'string', - topicAlias: 'int16', - subscriptionIdentifier: 'var' -} +protocol.CONNECT_HEADER = Buffer.from([protocol.codes['connect'] << protocol.CMD_SHIFT]) function genHeader (type) { - return [0, 1, 2].map(qos => { - return [0, 1].map(dup => { - return [0, 1].map(retain => { - const buf = Buffer.alloc(1) + return [0, 1, 2].map(function (qos) { + return [0, 1].map(function (dup) { + return [0, 1].map(function (retain) { + var buf = new Buffer(1) buf.writeUInt8( protocol.codes[type] << protocol.CMD_SHIFT | (dup ? protocol.DUP_MASK : 0) | @@ -141,17 +79,6 @@ protocol.PUBLISH_HEADER = genHeader('publish') /* Subscribe */ protocol.SUBSCRIBE_HEADER = genHeader('subscribe') -protocol.SUBSCRIBE_OPTIONS_QOS_MASK = 0x03 -protocol.SUBSCRIBE_OPTIONS_NL_MASK = 0x01 -protocol.SUBSCRIBE_OPTIONS_NL_SHIFT = 2 -protocol.SUBSCRIBE_OPTIONS_RAP_MASK = 0x01 -protocol.SUBSCRIBE_OPTIONS_RAP_SHIFT = 3 -protocol.SUBSCRIBE_OPTIONS_RH_MASK = 0x03 -protocol.SUBSCRIBE_OPTIONS_RH_SHIFT = 4 -protocol.SUBSCRIBE_OPTIONS_RH = [0x00, 0x10, 0x20] -protocol.SUBSCRIBE_OPTIONS_NL = 0x04 -protocol.SUBSCRIBE_OPTIONS_RAP = 0x08 -protocol.SUBSCRIBE_OPTIONS_QOS = [0x00, 0x01, 0x02] /* Unsubscribe */ protocol.UNSUBSCRIBE_HEADER = genHeader('unsubscribe') @@ -165,23 +92,20 @@ protocol.ACKS = { pubrec: genHeader('pubrec') } -protocol.SUBACK_HEADER = Buffer.from([protocol.codes.suback << protocol.CMD_SHIFT]) +protocol.SUBACK_HEADER = Buffer.from([protocol.codes['suback'] << protocol.CMD_SHIFT]) /* Protocol versions */ protocol.VERSION3 = Buffer.from([3]) protocol.VERSION4 = Buffer.from([4]) -protocol.VERSION5 = Buffer.from([5]) -protocol.VERSION131 = Buffer.from([131]) -protocol.VERSION132 = Buffer.from([132]) /* QoS */ -protocol.QOS = [0, 1, 2].map(qos => { +protocol.QOS = [0, 1, 2].map(function (qos) { return Buffer.from([qos]) }) /* Empty packets */ protocol.EMPTY = { - pingreq: Buffer.from([protocol.codes.pingreq << 4, 0]), - pingresp: Buffer.from([protocol.codes.pingresp << 4, 0]), - disconnect: Buffer.from([protocol.codes.disconnect << 4, 0]) + pingreq: Buffer.from([protocol.codes['pingreq'] << 4, 0]), + pingresp: Buffer.from([protocol.codes['pingresp'] << 4, 0]), + disconnect: Buffer.from([protocol.codes['disconnect'] << 4, 0]) } diff --git a/node_modules/mqtt-packet/generate.js b/node_modules/mqtt-packet/generate.js index a426bdb..335acbd 100644 --- a/node_modules/mqtt-packet/generate.js +++ b/node_modules/mqtt-packet/generate.js @@ -1,52 +1,56 @@ -const writeToStream = require('./writeToStream') -const EventEmitter = require('events') +'use strict' -function generate (packet, opts) { - const stream = new Accumulator() - writeToStream(packet, stream, opts) +var Buffer = require('safe-buffer').Buffer +var writeToStream = require('./writeToStream') +var EE = require('events').EventEmitter +var inherits = require('inherits') + +function generate (packet) { + var stream = new Accumulator() + writeToStream(packet, stream) return stream.concat() } -class Accumulator extends EventEmitter { - constructor () { - super() - this._array = new Array(20) - this._i = 0 +function Accumulator () { + this._array = new Array(20) + this._i = 0 +} + +inherits(Accumulator, EE) + +Accumulator.prototype.write = function (chunk) { + this._array[this._i++] = chunk + return true +} + +Accumulator.prototype.concat = function () { + var length = 0 + var lengths = new Array(this._array.length) + var list = this._array + var pos = 0 + var i + var result + + for (i = 0; i < list.length && list[i] !== undefined; i++) { + if (typeof list[i] !== 'string') lengths[i] = list[i].length + else lengths[i] = Buffer.byteLength(list[i]) + + length += lengths[i] } - write (chunk) { - this._array[this._i++] = chunk - return true - } + result = Buffer.allocUnsafe(length) - concat () { - let length = 0 - const lengths = new Array(this._array.length) - const list = this._array - let pos = 0 - let i - - for (i = 0; i < list.length && list[i] !== undefined; i++) { - if (typeof list[i] !== 'string') lengths[i] = list[i].length - else lengths[i] = Buffer.byteLength(list[i]) - - length += lengths[i] + for (i = 0; i < list.length && list[i] !== undefined; i++) { + if (typeof list[i] !== 'string') { + list[i].copy(result, pos) + pos += lengths[i] + } else { + result.write(list[i], pos) + pos += lengths[i] } - - const result = Buffer.allocUnsafe(length) - - for (i = 0; i < list.length && list[i] !== undefined; i++) { - if (typeof list[i] !== 'string') { - list[i].copy(result, pos) - pos += lengths[i] - } else { - result.write(list[i], pos) - pos += lengths[i] - } - } - - return result } + + return result } module.exports = generate diff --git a/node_modules/mqtt-packet/mqtt.js b/node_modules/mqtt-packet/mqtt.js index f23c8d7..2e436de 100644 --- a/node_modules/mqtt-packet/mqtt.js +++ b/node_modules/mqtt-packet/mqtt.js @@ -1,3 +1,5 @@ -exports.parser = require('./parser').parser +'use strict' + +exports.parser = require('./parser') exports.generate = require('./generate') exports.writeToStream = require('./writeToStream') diff --git a/node_modules/mqtt-packet/numbers.js b/node_modules/mqtt-packet/numbers.js index c89ea11..f697e55 100644 --- a/node_modules/mqtt-packet/numbers.js +++ b/node_modules/mqtt-packet/numbers.js @@ -1,15 +1,11 @@ -const max = 65536 -const cache = {} +'use strict' -// in node 6 Buffer.subarray returns a Uint8Array instead of a Buffer -// later versions return a Buffer -// alternative is Buffer.slice but that creates a new buffer -// creating new buffers takes time -// SubOk is only false on node < 8 -const SubOk = Buffer.isBuffer(Buffer.from([1, 2]).subarray(0, 1)) +var Buffer = require('safe-buffer').Buffer +var max = 65536 +var cache = {} function generateBuffer (i) { - const buffer = Buffer.allocUnsafe(2) + var buffer = Buffer.allocUnsafe(2) buffer.writeUInt8(i >> 8, 0) buffer.writeUInt8(i & 0x00FF, 0 + 1) @@ -17,42 +13,13 @@ function generateBuffer (i) { } function generateCache () { - for (let i = 0; i < max; i++) { + for (var i = 0; i < max; i++) { cache[i] = generateBuffer(i) } } -function genBufVariableByteInt (num) { - const maxLength = 4 // max 4 bytes - let digit = 0 - let pos = 0 - const buffer = Buffer.allocUnsafe(maxLength) - - do { - digit = num % 128 | 0 - num = num / 128 | 0 - if (num > 0) digit = digit | 0x80 - - buffer.writeUInt8(digit, pos++) - } while (num > 0 && pos < maxLength) - - if (num > 0) { - pos = 0 - } - - return SubOk ? buffer.subarray(0, pos) : buffer.slice(0, pos) -} - -function generate4ByteBuffer (num) { - const buffer = Buffer.allocUnsafe(4) - buffer.writeUInt32BE(num, 0) - return buffer -} - module.exports = { - cache, - generateCache, - generateNumber: generateBuffer, - genBufVariableByteInt, - generate4ByteBuffer + cache: cache, + generateCache: generateCache, + generateNumber: generateBuffer } diff --git a/node_modules/mqtt-packet/package.json b/node_modules/mqtt-packet/package.json index 9b3e7d0..6a2192a 100644 --- a/node_modules/mqtt-packet/package.json +++ b/node_modules/mqtt-packet/package.json @@ -1,6 +1,6 @@ { "name": "mqtt-packet", - "version": "6.10.0", + "version": "5.6.1", "description": "Parse and generate MQTT packets like a breeze", "main": "mqtt.js", "types": "types/index.d.ts", @@ -8,8 +8,7 @@ "Matteo Collina (https://github.com/mcollina)", "Adam Rudd ", "Peter Sorowka (https://github.com/psorowka)", - "Wouter Klijn (https://github.com/wuhkuh)", - "Siarhei Buntsevich (https://github.com/scarry1992)" + "Wouter Klijn (https://github.com/wuhkuh)" ], "scripts": { "test": "tape test.js | tap-spec && standard", @@ -34,15 +33,17 @@ }, "homepage": "https://github.com/mqttjs/mqtt-packet", "devDependencies": { + "dev-null": "^0.1.1", "pre-commit": "^1.2.2", - "readable-stream": "^3.6.0", - "standard": "^14.3.4", - "tap-spec": "^5.0.0", - "tape": "^5.0.1" + "readable-stream": "^2.3.0", + "standard": "^10.0.2", + "tap-spec": "^4.1.1", + "tape": "^4.6.3" }, "dependencies": { - "bl": "^4.0.2", - "debug": "^4.1.1", - "process-nextick-args": "^2.0.1" + "bl": "^1.2.1", + "inherits": "^2.0.3", + "process-nextick-args": "^2.0.0", + "safe-buffer": "^5.1.0" } } diff --git a/node_modules/mqtt-packet/packet.js b/node_modules/mqtt-packet/packet.js index 4ef1e78..ebbecfa 100644 --- a/node_modules/mqtt-packet/packet.js +++ b/node_modules/mqtt-packet/packet.js @@ -1,13 +1,12 @@ -class Packet { - constructor () { - this.cmd = null - this.retain = false - this.qos = 0 - this.dup = false - this.length = -1 - this.topic = null - this.payload = null - } + +function Packet () { + this.cmd = null + this.retain = false + this.qos = 0 + this.dup = false + this.length = -1 + this.topic = null + this.payload = null } module.exports = Packet diff --git a/node_modules/mqtt-packet/parser.js b/node_modules/mqtt-packet/parser.js index da599eb..cd15383 100644 --- a/node_modules/mqtt-packet/parser.js +++ b/node_modules/mqtt-packet/parser.js @@ -1,716 +1,376 @@ -const bl = require('bl') -const EventEmitter = require('events') -const Packet = require('./packet') -const constants = require('./constants') -const debug = require('debug')('mqtt-packet:parser') +'use strict' -class Parser extends EventEmitter { - constructor () { - super() - this.parser = this.constructor.parser +var bl = require('bl') +var inherits = require('inherits') +var EE = require('events').EventEmitter +var Packet = require('./packet') +var constants = require('./constants') + +function Parser () { + if (!(this instanceof Parser)) return new Parser() + + this._states = [ + '_parseHeader', + '_parseLength', + '_parsePayload', + '_newPacket' + ] + + this._resetState() +} + +inherits(Parser, EE) + +Parser.prototype._resetState = function () { + this.packet = new Packet() + this.error = null + this._list = bl() + this._stateCounter = 0 +} + +Parser.prototype.parse = function (buf) { + if (this.error) this._resetState() + + this._list.append(buf) + + while ((this.packet.length !== -1 || this._list.length > 0) && + this[this._states[this._stateCounter]]() && + !this.error) { + this._stateCounter++ + + if (this._stateCounter >= this._states.length) this._stateCounter = 0 } - static parser (opt) { - if (!(this instanceof Parser)) return (new Parser()).parser(opt) + return this._list.length +} - this.settings = opt || {} +Parser.prototype._parseHeader = function () { + // There is at least one byte in the buffer + var zero = this._list.readUInt8(0) + this.packet.cmd = constants.types[zero >> constants.CMD_SHIFT] + this.packet.retain = (zero & constants.RETAIN_MASK) !== 0 + this.packet.qos = (zero >> constants.QOS_SHIFT) & constants.QOS_MASK + this.packet.dup = (zero & constants.DUP_MASK) !== 0 - this._states = [ - '_parseHeader', - '_parseLength', - '_parsePayload', - '_newPacket' - ] + this._list.consume(1) - this._resetState() - return this - } + return true +} - _resetState () { - debug('_resetState: resetting packet, error, _list, and _stateCounter') - this.packet = new Packet() - this.error = null - this._list = bl() - this._stateCounter = 0 - } +Parser.prototype._parseLength = function () { + // There is at least one byte in the list + var bytes = 0 + var mul = 1 + var length = 0 + var result = true + var current - parse (buf) { - if (this.error) this._resetState() + while (bytes < 5) { + current = this._list.readUInt8(bytes++) + length += mul * (current & constants.LENGTH_MASK) + mul *= 0x80 - this._list.append(buf) - debug('parse: current state: %s', this._states[this._stateCounter]) - while ((this.packet.length !== -1 || this._list.length > 0) && - this[this._states[this._stateCounter]]() && - !this.error) { - this._stateCounter++ - debug('parse: state complete. _stateCounter is now: %d', this._stateCounter) - debug('parse: packet.length: %d, buffer list length: %d', this.packet.length, this._list.length) - if (this._stateCounter >= this._states.length) this._stateCounter = 0 - } - debug('parse: exited while loop. packet: %d, buffer list length: %d', this.packet.length, this._list.length) - return this._list.length - } - - _parseHeader () { - // There is at least one byte in the buffer - const zero = this._list.readUInt8(0) - this.packet.cmd = constants.types[zero >> constants.CMD_SHIFT] - this.packet.retain = (zero & constants.RETAIN_MASK) !== 0 - this.packet.qos = (zero >> constants.QOS_SHIFT) & constants.QOS_MASK - this.packet.dup = (zero & constants.DUP_MASK) !== 0 - debug('_parseHeader: packet: %o', this.packet) - - this._list.consume(1) - - return true - } - - _parseLength () { - // There is at least one byte in the list - const result = this._parseVarByteNum(true) - - if (result) { - this.packet.length = result.value - this._list.consume(result.bytes) - } - debug('_parseLength %d', result.value) - return !!result - } - - _parsePayload () { - debug('_parsePayload: payload %O', this._list) - let result = false - - // Do we have a payload? Do we have enough data to complete the payload? - // PINGs have no payload - if (this.packet.length === 0 || this._list.length >= this.packet.length) { - this._pos = 0 - - switch (this.packet.cmd) { - case 'connect': - this._parseConnect() - break - case 'connack': - this._parseConnack() - break - case 'publish': - this._parsePublish() - break - case 'puback': - case 'pubrec': - case 'pubrel': - case 'pubcomp': - this._parseConfirmation() - break - case 'subscribe': - this._parseSubscribe() - break - case 'suback': - this._parseSuback() - break - case 'unsubscribe': - this._parseUnsubscribe() - break - case 'unsuback': - this._parseUnsuback() - break - case 'pingreq': - case 'pingresp': - // These are empty, nothing to do - break - case 'disconnect': - this._parseDisconnect() - break - case 'auth': - this._parseAuth() - break - default: - this._emitError(new Error('Not supported')) - } - - result = true - } - debug('_parsePayload complete result: %s', result) - return result - } - - _parseConnect () { - debug('_parseConnect') - let topic // Will topic - let payload // Will payload - let password // Password - let username // Username - const flags = {} - const packet = this.packet - - // Parse protocolId - const protocolId = this._parseString() - - if (protocolId === null) return this._emitError(new Error('Cannot parse protocolId')) - if (protocolId !== 'MQTT' && protocolId !== 'MQIsdp') { - return this._emitError(new Error('Invalid protocolId')) - } - - packet.protocolId = protocolId - - // Parse constants version number - if (this._pos >= this._list.length) return this._emitError(new Error('Packet too short')) - - packet.protocolVersion = this._list.readUInt8(this._pos) - - if (packet.protocolVersion >= 128) { - packet.bridgeMode = true - packet.protocolVersion = packet.protocolVersion - 128 - } - - if (packet.protocolVersion !== 3 && packet.protocolVersion !== 4 && packet.protocolVersion !== 5) { - return this._emitError(new Error('Invalid protocol version')) - } - - this._pos++ - - if (this._pos >= this._list.length) { - return this._emitError(new Error('Packet too short')) - } - - // Parse connect flags - flags.username = (this._list.readUInt8(this._pos) & constants.USERNAME_MASK) - flags.password = (this._list.readUInt8(this._pos) & constants.PASSWORD_MASK) - flags.will = (this._list.readUInt8(this._pos) & constants.WILL_FLAG_MASK) - - if (flags.will) { - packet.will = {} - packet.will.retain = (this._list.readUInt8(this._pos) & constants.WILL_RETAIN_MASK) !== 0 - packet.will.qos = (this._list.readUInt8(this._pos) & - constants.WILL_QOS_MASK) >> constants.WILL_QOS_SHIFT - } - - packet.clean = (this._list.readUInt8(this._pos) & constants.CLEAN_SESSION_MASK) !== 0 - this._pos++ - - // Parse keepalive - packet.keepalive = this._parseNum() - if (packet.keepalive === -1) return this._emitError(new Error('Packet too short')) - - // parse properties - if (packet.protocolVersion === 5) { - const properties = this._parseProperties() - if (Object.getOwnPropertyNames(properties).length) { - packet.properties = properties - } - } - // Parse clientId - const clientId = this._parseString() - if (clientId === null) return this._emitError(new Error('Packet too short')) - packet.clientId = clientId - debug('_parseConnect: packet.clientId: %s', packet.clientId) - - if (flags.will) { - if (packet.protocolVersion === 5) { - const willProperties = this._parseProperties() - if (Object.getOwnPropertyNames(willProperties).length) { - packet.will.properties = willProperties - } - } - // Parse will topic - topic = this._parseString() - if (topic === null) return this._emitError(new Error('Cannot parse will topic')) - packet.will.topic = topic - debug('_parseConnect: packet.will.topic: %s', packet.will.topic) - - // Parse will payload - payload = this._parseBuffer() - if (payload === null) return this._emitError(new Error('Cannot parse will payload')) - packet.will.payload = payload - debug('_parseConnect: packet.will.paylaod: %s', packet.will.payload) - } - - // Parse username - if (flags.username) { - username = this._parseString() - if (username === null) return this._emitError(new Error('Cannot parse username')) - packet.username = username - debug('_parseConnect: packet.username: %s', packet.username) - } - - // Parse password - if (flags.password) { - password = this._parseBuffer() - if (password === null) return this._emitError(new Error('Cannot parse password')) - packet.password = password - } - // need for right parse auth packet and self set up - this.settings = packet - debug('_parseConnect: complete') - return packet - } - - _parseConnack () { - debug('_parseConnack') - const packet = this.packet - - if (this._list.length < 1) return null - packet.sessionPresent = !!(this._list.readUInt8(this._pos++) & constants.SESSIONPRESENT_MASK) - - if (this.settings.protocolVersion === 5) { - if (this._list.length >= 2) { - packet.reasonCode = this._list.readUInt8(this._pos++) - } else { - packet.reasonCode = 0 - } - } else { - if (this._list.length < 2) return null - packet.returnCode = this._list.readUInt8(this._pos++) - } - - if (packet.returnCode === -1 || packet.reasonCode === -1) return this._emitError(new Error('Cannot parse return code')) - // mqtt 5 properties - if (this.settings.protocolVersion === 5) { - const properties = this._parseProperties() - if (Object.getOwnPropertyNames(properties).length) { - packet.properties = properties - } - } - debug('_parseConnack: complete') - } - - _parsePublish () { - debug('_parsePublish') - const packet = this.packet - packet.topic = this._parseString() - - if (packet.topic === null) return this._emitError(new Error('Cannot parse topic')) - - // Parse messageId - if (packet.qos > 0) if (!this._parseMessageId()) { return } - - // Properties mqtt 5 - if (this.settings.protocolVersion === 5) { - const properties = this._parseProperties() - if (Object.getOwnPropertyNames(properties).length) { - packet.properties = properties - } - } - - packet.payload = this._list.slice(this._pos, packet.length) - debug('_parsePublish: payload from buffer list: %o', packet.payload) - } - - _parseSubscribe () { - debug('_parseSubscribe') - const packet = this.packet - let topic - let options - let qos - let rh - let rap - let nl - let subscription - - if (packet.qos !== 1) { - return this._emitError(new Error('Wrong subscribe header')) - } - - packet.subscriptions = [] - - if (!this._parseMessageId()) { return } - - // Properties mqtt 5 - if (this.settings.protocolVersion === 5) { - const properties = this._parseProperties() - if (Object.getOwnPropertyNames(properties).length) { - packet.properties = properties - } - } - - while (this._pos < packet.length) { - // Parse topic - topic = this._parseString() - if (topic === null) return this._emitError(new Error('Cannot parse topic')) - if (this._pos >= packet.length) return this._emitError(new Error('Malformed Subscribe Payload')) - - options = this._parseByte() - qos = options & constants.SUBSCRIBE_OPTIONS_QOS_MASK - nl = ((options >> constants.SUBSCRIBE_OPTIONS_NL_SHIFT) & constants.SUBSCRIBE_OPTIONS_NL_MASK) !== 0 - rap = ((options >> constants.SUBSCRIBE_OPTIONS_RAP_SHIFT) & constants.SUBSCRIBE_OPTIONS_RAP_MASK) !== 0 - rh = (options >> constants.SUBSCRIBE_OPTIONS_RH_SHIFT) & constants.SUBSCRIBE_OPTIONS_RH_MASK - - subscription = { topic, qos } - - // mqtt 5 options - if (this.settings.protocolVersion === 5) { - subscription.nl = nl - subscription.rap = rap - subscription.rh = rh - } else if (this.settings.bridgeMode) { - subscription.rh = 0 - subscription.rap = true - subscription.nl = true - } - - // Push pair to subscriptions - debug('_parseSubscribe: push subscription `%s` to subscription', subscription) - packet.subscriptions.push(subscription) + if ((current & constants.LENGTH_FIN_MASK) === 0) break + if (this._list.length <= bytes) { + result = false + break } } - _parseSuback () { - debug('_parseSuback') - const packet = this.packet - this.packet.granted = [] - - if (!this._parseMessageId()) { return } - - // Properties mqtt 5 - if (this.settings.protocolVersion === 5) { - const properties = this._parseProperties() - if (Object.getOwnPropertyNames(properties).length) { - packet.properties = properties - } - } - - // Parse granted QoSes - while (this._pos < this.packet.length) { - this.packet.granted.push(this._list.readUInt8(this._pos++)) - } + if (result) { + this.packet.length = length + this._list.consume(bytes) } - _parseUnsubscribe () { - debug('_parseUnsubscribe') - const packet = this.packet + return result +} - packet.unsubscriptions = [] - - // Parse messageId - if (!this._parseMessageId()) { return } - - // Properties mqtt 5 - if (this.settings.protocolVersion === 5) { - const properties = this._parseProperties() - if (Object.getOwnPropertyNames(properties).length) { - packet.properties = properties - } - } - - while (this._pos < packet.length) { - // Parse topic - const topic = this._parseString() - if (topic === null) return this._emitError(new Error('Cannot parse topic')) - - // Push topic to unsubscriptions - debug('_parseUnsubscribe: push topic `%s` to unsubscriptions', topic) - packet.unsubscriptions.push(topic) - } - } - - _parseUnsuback () { - debug('_parseUnsuback') - const packet = this.packet - if (!this._parseMessageId()) return this._emitError(new Error('Cannot parse messageId')) - // Properties mqtt 5 - if (this.settings.protocolVersion === 5) { - const properties = this._parseProperties() - if (Object.getOwnPropertyNames(properties).length) { - packet.properties = properties - } - // Parse granted QoSes - packet.granted = [] - while (this._pos < this.packet.length) { - this.packet.granted.push(this._list.readUInt8(this._pos++)) - } - } - } - - // parse packets like puback, pubrec, pubrel, pubcomp - _parseConfirmation () { - debug('_parseConfirmation: packet.cmd: `%s`', this.packet.cmd) - const packet = this.packet - - this._parseMessageId() - - if (this.settings.protocolVersion === 5) { - if (packet.length > 2) { - // response code - packet.reasonCode = this._parseByte() - debug('_parseConfirmation: packet.reasonCode `%d`', packet.reasonCode) - } else { - packet.reasonCode = 0 - } - - if (packet.length > 3) { - // properies mqtt 5 - const properties = this._parseProperties() - if (Object.getOwnPropertyNames(properties).length) { - packet.properties = properties - } - } - } - - return true - } - - // parse disconnect packet - _parseDisconnect () { - const packet = this.packet - debug('_parseDisconnect') - - if (this.settings.protocolVersion === 5) { - // response code - if (this._list.length > 0) { - packet.reasonCode = this._parseByte() - } else { - packet.reasonCode = 0 - } - // properies mqtt 5 - const properties = this._parseProperties() - if (Object.getOwnPropertyNames(properties).length) { - packet.properties = properties - } - } - - debug('_parseDisconnect result: true') - return true - } - - // parse auth packet - _parseAuth () { - debug('_parseAuth') - const packet = this.packet - - if (this.settings.protocolVersion !== 5) { - return this._emitError(new Error('Not supported auth packet for this version MQTT')) - } - - // response code - packet.reasonCode = this._parseByte() - // properies mqtt 5 - const properties = this._parseProperties() - if (Object.getOwnPropertyNames(properties).length) { - packet.properties = properties - } - - debug('_parseAuth: result: true') - return true - } - - _parseMessageId () { - const packet = this.packet - - packet.messageId = this._parseNum() - - if (packet.messageId === null) { - this._emitError(new Error('Cannot parse messageId')) - return false - } - - debug('_parseMessageId: packet.messageId %d', packet.messageId) - return true - } - - _parseString (maybeBuffer) { - const length = this._parseNum() - const end = length + this._pos - - if (length === -1 || end > this._list.length || end > this.packet.length) return null - - const result = this._list.toString('utf8', this._pos, end) - this._pos += length - debug('_parseString: result: %s', result) - return result - } - - _parseStringPair () { - debug('_parseStringPair') - return { - name: this._parseString(), - value: this._parseString() - } - } - - _parseBuffer () { - const length = this._parseNum() - const end = length + this._pos - - if (length === -1 || end > this._list.length || end > this.packet.length) return null - - const result = this._list.slice(this._pos, end) - - this._pos += length - debug('_parseBuffer: result: %o', result) - return result - } - - _parseNum () { - if (this._list.length - this._pos < 2) return -1 - - const result = this._list.readUInt16BE(this._pos) - this._pos += 2 - debug('_parseNum: result: %s', result) - return result - } - - _parse4ByteNum () { - if (this._list.length - this._pos < 4) return -1 - - const result = this._list.readUInt32BE(this._pos) - this._pos += 4 - debug('_parse4ByteNum: result: %s', result) - return result - } - - _parseVarByteNum (fullInfoFlag) { - debug('_parseVarByteNum') - const maxBytes = 4 - let bytes = 0 - let mul = 1 - let value = 0 - let result = false - let current - const padding = this._pos ? this._pos : 0 - - while (bytes < maxBytes && (padding + bytes) < this._list.length) { - current = this._list.readUInt8(padding + bytes++) - value += mul * (current & constants.VARBYTEINT_MASK) - mul *= 0x80 - - if ((current & constants.VARBYTEINT_FIN_MASK) === 0) { - result = true - break - } - if (this._list.length <= bytes) { - break - } - } - - if (!result && bytes === maxBytes && this._list.length >= bytes) { - this._emitError(new Error('Invalid variable byte integer')) - } - - if (padding) { - this._pos += bytes - } - - result = result - ? fullInfoFlag ? { - bytes, - value - } : value - : false - - debug('_parseVarByteNum: result: %o', result) - return result - } - - _parseByte () { - let result - if (this._pos < this._list.length) { - result = this._list.readUInt8(this._pos) - this._pos++ - } - debug('_parseByte: result: %o', result) - return result - } - - _parseByType (type) { - debug('_parseByType: type: %s', type) - switch (type) { - case 'byte': { - return this._parseByte() !== 0 - } - case 'int8': { - return this._parseByte() - } - case 'int16': { - return this._parseNum() - } - case 'int32': { - return this._parse4ByteNum() - } - case 'var': { - return this._parseVarByteNum() - } - case 'string': { - return this._parseString() - } - case 'pair': { - return this._parseStringPair() - } - case 'binary': { - return this._parseBuffer() - } - } - } - - _parseProperties () { - debug('_parseProperties') - const length = this._parseVarByteNum() - const start = this._pos - const end = start + length - const result = {} - while (this._pos < end) { - const type = this._parseByte() - if (!type) { - this._emitError(new Error('Cannot parse property code type')) - return false - } - const name = constants.propertiesCodes[type] - if (!name) { - this._emitError(new Error('Unknown property')) - return false - } - // user properties process - if (name === 'userProperties') { - if (!result[name]) { - result[name] = Object.create(null) - } - const currentUserProperty = this._parseByType(constants.propertiesTypes[name]) - if (result[name][currentUserProperty.name]) { - if (Array.isArray(result[name][currentUserProperty.name])) { - result[name][currentUserProperty.name].push(currentUserProperty.value) - } else { - const currentValue = result[name][currentUserProperty.name] - result[name][currentUserProperty.name] = [currentValue] - result[name][currentUserProperty.name].push(currentUserProperty.value) - } - } else { - result[name][currentUserProperty.name] = currentUserProperty.value - } - continue - } - if (result[name]) { - if (Array.isArray(result[name])) { - result[name].push(this._parseByType(constants.propertiesTypes[name])) - } else { - result[name] = [result[name]] - result[name].push(this._parseByType(constants.propertiesTypes[name])) - } - } else { - result[name] = this._parseByType(constants.propertiesTypes[name]) - } - } - return result - } - - _newPacket () { - debug('_newPacket') - if (this.packet) { - this._list.consume(this.packet.length) - debug('_newPacket: parser emit packet: packet.cmd: %s, packet.payload: %s, packet.length: %d', this.packet.cmd, this.packet.payload, this.packet.length) - this.emit('packet', this.packet) - } - debug('_newPacket: new packet') - this.packet = new Packet() +Parser.prototype._parsePayload = function () { + var result = false + // Do we have a payload? Do we have enough data to complete the payload? + // PINGs have no payload + if (this.packet.length === 0 || this._list.length >= this.packet.length) { this._pos = 0 - return true + switch (this.packet.cmd) { + case 'connect': + this._parseConnect() + break + case 'connack': + this._parseConnack() + break + case 'publish': + this._parsePublish() + break + case 'puback': + case 'pubrec': + case 'pubrel': + case 'pubcomp': + this._parseMessageId() + break + case 'subscribe': + this._parseSubscribe() + break + case 'suback': + this._parseSuback() + break + case 'unsubscribe': + this._parseUnsubscribe() + break + case 'unsuback': + this._parseUnsuback() + break + case 'pingreq': + case 'pingresp': + case 'disconnect': + // These are empty, nothing to do + break + default: + this._emitError(new Error('Not supported')) + } + + result = true } - _emitError (err) { - debug('_emitError') - this.error = err - this.emit('error', err) + return result +} + +Parser.prototype._parseConnect = function () { + var protocolId // Protocol ID + var clientId // Client ID + var topic // Will topic + var payload // Will payload + var password // Password + var username // Username + var flags = {} + var packet = this.packet + + // Parse protocolId + protocolId = this._parseString() + + if (protocolId === null) return this._emitError(new Error('Cannot parse protocolId')) + if (protocolId !== 'MQTT' && protocolId !== 'MQIsdp') { + return this._emitError(new Error('Invalid protocolId')) + } + + packet.protocolId = protocolId + + // Parse constants version number + if (this._pos >= this._list.length) return this._emitError(new Error('Packet too short')) + + packet.protocolVersion = this._list.readUInt8(this._pos) + + if (packet.protocolVersion !== 3 && packet.protocolVersion !== 4) { + return this._emitError(new Error('Invalid protocol version')) + } + + this._pos++ + + if (this._pos >= this._list.length) { + return this._emitError(new Error('Packet too short')) + } + + // Parse connect flags + flags.username = (this._list.readUInt8(this._pos) & constants.USERNAME_MASK) + flags.password = (this._list.readUInt8(this._pos) & constants.PASSWORD_MASK) + flags.will = (this._list.readUInt8(this._pos) & constants.WILL_FLAG_MASK) + + if (flags.will) { + packet.will = {} + packet.will.retain = (this._list.readUInt8(this._pos) & constants.WILL_RETAIN_MASK) !== 0 + packet.will.qos = (this._list.readUInt8(this._pos) & + constants.WILL_QOS_MASK) >> constants.WILL_QOS_SHIFT + } + + packet.clean = (this._list.readUInt8(this._pos) & constants.CLEAN_SESSION_MASK) !== 0 + this._pos++ + + // Parse keepalive + packet.keepalive = this._parseNum() + if (packet.keepalive === -1) return this._emitError(new Error('Packet too short')) + + // Parse clientId + clientId = this._parseString() + if (clientId === null) return this._emitError(new Error('Packet too short')) + packet.clientId = clientId + + if (flags.will) { + // Parse will topic + topic = this._parseString() + if (topic === null) return this._emitError(new Error('Cannot parse will topic')) + packet.will.topic = topic + + // Parse will payload + payload = this._parseBuffer() + if (payload === null) return this._emitError(new Error('Cannot parse will payload')) + packet.will.payload = payload + } + + // Parse username + if (flags.username) { + username = this._parseString() + if (username === null) return this._emitError(new Error('Cannot parse username')) + packet.username = username + } + + // Parse password + if (flags.password) { + password = this._parseBuffer() + if (password === null) return this._emitError(new Error('Cannot parse password')) + packet.password = password + } + + return packet +} + +Parser.prototype._parseConnack = function () { + var packet = this.packet + + if (this._list.length < 2) return null + + packet.sessionPresent = !!(this._list.readUInt8(this._pos++) & constants.SESSIONPRESENT_MASK) + packet.returnCode = this._list.readUInt8(this._pos) + + if (packet.returnCode === -1) return this._emitError(new Error('Cannot parse return code')) +} + +Parser.prototype._parsePublish = function () { + var packet = this.packet + packet.topic = this._parseString() + + if (packet.topic === null) return this._emitError(new Error('Cannot parse topic')) + + // Parse messageId + if (packet.qos > 0) if (!this._parseMessageId()) { return } + + packet.payload = this._list.slice(this._pos, packet.length) +} + +Parser.prototype._parseSubscribe = function () { + var packet = this.packet + var topic + var qos + + if (packet.qos !== 1) { + return this._emitError(new Error('Wrong subscribe header')) + } + + packet.subscriptions = [] + + if (!this._parseMessageId()) { return } + + while (this._pos < packet.length) { + // Parse topic + topic = this._parseString() + if (topic === null) return this._emitError(new Error('Cannot parse topic')) + + if (this._pos >= packet.length) return this._emitError(new Error('Malformed Subscribe Payload')) + qos = this._list.readUInt8(this._pos++) + + // Push pair to subscriptions + packet.subscriptions.push({ topic: topic, qos: qos }) } } +Parser.prototype._parseSuback = function () { + this.packet.granted = [] + + if (!this._parseMessageId()) { return } + + // Parse granted QoSes + while (this._pos < this.packet.length) { + this.packet.granted.push(this._list.readUInt8(this._pos++)) + } +} + +Parser.prototype._parseUnsubscribe = function () { + var packet = this.packet + + packet.unsubscriptions = [] + + // Parse messageId + if (!this._parseMessageId()) { return } + + while (this._pos < packet.length) { + var topic + + // Parse topic + topic = this._parseString() + if (topic === null) return this._emitError(new Error('Cannot parse topic')) + + // Push topic to unsubscriptions + packet.unsubscriptions.push(topic) + } +} + +Parser.prototype._parseUnsuback = function () { + if (!this._parseMessageId()) return this._emitError(new Error('Cannot parse messageId')) +} + +Parser.prototype._parseMessageId = function () { + var packet = this.packet + + packet.messageId = this._parseNum() + + if (packet.messageId === null) { + this._emitError(new Error('Cannot parse messageId')) + return false + } + + return true +} + +Parser.prototype._parseString = function (maybeBuffer) { + var length = this._parseNum() + var result + var end = length + this._pos + + if (length === -1 || end > this._list.length || end > this.packet.length) return null + + result = this._list.toString('utf8', this._pos, end) + this._pos += length + + return result +} + +Parser.prototype._parseBuffer = function () { + var length = this._parseNum() + var result + var end = length + this._pos + + if (length === -1 || end > this._list.length || end > this.packet.length) return null + + result = this._list.slice(this._pos, end) + + this._pos += length + + return result +} + +Parser.prototype._parseNum = function () { + if (this._list.length - this._pos < 2) return -1 + + var result = this._list.readUInt16BE(this._pos) + this._pos += 2 + + return result +} + +Parser.prototype._newPacket = function () { + if (this.packet) { + this._list.consume(this.packet.length) + this.emit('packet', this.packet) + } + + this.packet = new Packet() + + return true +} + +Parser.prototype._emitError = function (err) { + this.error = err + this.emit('error', err) +} + module.exports = Parser diff --git a/node_modules/mqtt-packet/test.js b/node_modules/mqtt-packet/test.js index f12de52..d4e5494 100644 --- a/node_modules/mqtt-packet/test.js +++ b/node_modules/mqtt-packet/test.js @@ -1,8 +1,9 @@ -const util = require('util') +'use strict' -const test = require('tape') -const mqtt = require('./') -const WS = require('readable-stream').Writable +var test = require('tape') +var mqtt = require('./') +var Buffer = require('safe-buffer').Buffer +var WS = require('readable-stream').Writable function normalExpectedObject (object) { if (object.username != null) object.username = object.username.toString() @@ -11,191 +12,127 @@ function normalExpectedObject (object) { } function testParseGenerate (name, object, buffer, opts) { - test(`${name} parse`, t => { + test(name + ' parse', function (t) { t.plan(2) - const parser = mqtt.parser(opts) - const expected = object - const fixture = buffer + var parser = mqtt.parser(opts) + var expected = object + var fixture = buffer - parser.on('packet', packet => { + parser.on('packet', function (packet) { if (packet.cmd !== 'publish') { delete packet.topic delete packet.payload } - t.deepLooseEqual(packet, normalExpectedObject(expected), 'expected packet') + t.deepEqual(packet, normalExpectedObject(expected), 'expected packet') }) - parser.on('error', err => { + parser.on('error', function (err) { t.fail(err) }) t.equal(parser.parse(fixture), 0, 'remaining bytes') }) - test(`${name} generate`, t => { - // For really large buffers, the expanded hex string can be so long as to - // generate an error in nodejs 14.x, so only do the test with extra output - // for relatively small buffers. - const bigLength = 10000 - const generatedBuffer = mqtt.generate(object, opts) - if (generatedBuffer.length < bigLength && buffer.length < bigLength) { - t.equal(generatedBuffer.toString('hex'), buffer.toString('hex')) - } else { - const bufferOkay = generatedBuffer.equals(buffer) - if (bufferOkay) { - t.pass() - } else { - // Output abbreviated representations of the buffers. - t.comment('Expected:\n' + util.inspect(buffer)) - t.comment('Got:\n' + util.inspect(generatedBuffer)) - t.fail('Large buffers not equal') - } - } + test(name + ' generate', function (t) { + t.equal(mqtt.generate(object).toString('hex'), buffer.toString('hex')) t.end() }) - test(`${name} mirror`, t => { + test(name + ' mirror', function (t) { t.plan(2) - const parser = mqtt.parser(opts) - const expected = object - const fixture = mqtt.generate(object, opts) + var parser = mqtt.parser(opts) + var expected = object + var fixture = mqtt.generate(object) - parser.on('packet', packet => { + parser.on('packet', function (packet) { if (packet.cmd !== 'publish') { delete packet.topic delete packet.payload } - t.deepLooseEqual(packet, normalExpectedObject(expected), 'expected packet') + t.deepEqual(packet, normalExpectedObject(expected), 'expected packet') }) - parser.on('error', err => { + parser.on('error', function (err) { t.fail(err) }) t.equal(parser.parse(fixture), 0, 'remaining bytes') }) - - test(`${name} writeToStream`, t => { - const stream = WS() - stream.write = () => true - stream.on('error', (err) => t.fail(err)) - - const result = mqtt.writeToStream(object, stream, opts) - t.equal(result, true, 'should return true') - t.end() - }) } -// the API allows to pass strings as buffers to writeToStream and generate -// parsing them back will result in a string so only generate and compare to buffer -function testGenerateOnly (name, object, buffer, opts) { - test(name, t => { - t.equal(mqtt.generate(object, opts).toString('hex'), buffer.toString('hex')) - t.end() - }) -} - -function testParseOnly (name, object, buffer, opts) { - test(name, t => { - const parser = mqtt.parser(opts) - // const expected = object - // const fixture = buffer - - t.plan(2 + Object.keys(object).length) - - parser.on('packet', packet => { - t.equal(Object.keys(object).length, Object.keys(packet).length, 'key count') - Object.keys(object).forEach(key => { - t.deepEqual(packet[key], object[key], `expected packet property ${key}`) - }) - }) - - t.equal(parser.parse(buffer), 0, 'remaining bytes') - t.end() - }) -} - -function testParseError (expected, fixture, opts) { - test(expected, t => { +function testParseError (expected, fixture) { + test(expected, function (t) { t.plan(1) - const parser = mqtt.parser(opts) + var parser = mqtt.parser() - parser.on('error', err => { + parser.on('error', function (err) { t.equal(err.message, expected, 'expected error message') }) - parser.on('packet', () => { + parser.on('packet', function () { t.fail('parse errors should not be followed by packet events') }) parser.parse(fixture) - t.end() }) } -function testGenerateError (expected, fixture, opts, name) { - test(name || expected, t => { +function testGenerateError (expected, fixture) { + test(expected, function (t) { t.plan(1) try { - mqtt.generate(fixture, opts) + mqtt.generate(fixture) } catch (err) { t.equal(expected, err.message) } + }) +} + +function testParseGenerateDefaults (name, object, buffer, opts) { + test(name + ' parse', function (t) { + var parser = mqtt.parser(opts) + var expected = object + var fixture = buffer + + t.plan(1 + Object.keys(expected).length) + + parser.on('packet', function (packet) { + Object.keys(expected).forEach(function (key) { + t.deepEqual(packet[key], expected[key], 'expected packet property ' + key) + }) + }) + + t.equal(parser.parse(fixture), 0, 'remaining bytes') + }) + + test(name + ' generate', function (t) { + t.equal(mqtt.generate(object).toString('hex'), buffer.toString('hex')) t.end() }) } -function testGenerateErrorMultipleCmds (cmds, expected, fixture, opts) { - cmds.forEach(cmd => { - const obj = Object.assign({}, fixture) - obj.cmd = cmd - testGenerateError(expected, obj, opts, `${expected} on ${cmd}`) - } - ) -} - -function testParseGenerateDefaults (name, object, buffer, generated, opts) { - testParseOnly(`${name} parse`, generated, buffer, opts) - testGenerateOnly(`${name} generate`, object, buffer, opts) -} - -function testParseAndGenerate (name, object, buffer, opts) { - testParseOnly(`${name} parse`, object, buffer, opts) - testGenerateOnly(`${name} generate`, object, buffer, opts) -} - function testWriteToStreamError (expected, fixture) { - test(`writeToStream ${expected} error`, t => { + test('writeToStream ' + expected + ' error', function (t) { t.plan(2) - const stream = WS() + var stream = WS() stream.write = () => t.fail('should not have called write') stream.on('error', () => t.pass('error emitted')) - const result = mqtt.writeToStream(fixture, stream) + var result = mqtt.writeToStream(fixture, stream) t.false(result, 'result should be false') - t.end() }) } -test('cacheNumbers get/set/unset', t => { - t.true(mqtt.writeToStream.cacheNumbers, 'initial state of cacheNumbers is enabled') - mqtt.writeToStream.cacheNumbers = false - t.false(mqtt.writeToStream.cacheNumbers, 'cacheNumbers can be disabled') - mqtt.writeToStream.cacheNumbers = true - t.true(mqtt.writeToStream.cacheNumbers, 'cacheNumbers can be enabled') - t.end() -}) - -test('disabled numbers cache', t => { - const stream = WS() - const message = { +test('disabled numbers cache', function (t) { + var stream = WS() + var message = { cmd: 'publish', retain: false, qos: 0, @@ -204,13 +141,13 @@ test('disabled numbers cache', t => { topic: Buffer.from('test'), payload: Buffer.from('test') } - const expected = Buffer.from([ + var expected = Buffer.from([ 48, 10, // Header 0, 4, // Topic length 116, 101, 115, 116, // Topic (test) 116, 101, 115, 116 // Payload (test) ]) - let written = Buffer.alloc(0) + var written = Buffer.alloc(0) stream.write = (chunk) => { written = Buffer.concat([written, chunk]) @@ -227,30 +164,6 @@ test('disabled numbers cache', t => { t.end() }) -testGenerateError('Unknown command', {}) - -testParseError('Not supported', Buffer.from([0, 1, 0]), {}) - -// Length header field -testParseError('Invalid variable byte integer', Buffer.from( - [16, 255, 255, 255, 255] -), {}) -testParseError('Invalid variable byte integer', Buffer.from( - [16, 255, 255, 255, 128] -), {}) -testParseError('Invalid variable byte integer', Buffer.from( - [16, 255, 255, 255, 255, 1] -), {}) -testParseError('Invalid variable byte integer', Buffer.from( - [16, 255, 255, 255, 255, 127] -), {}) -testParseError('Invalid variable byte integer', Buffer.from( - [16, 255, 255, 255, 255, 128] -), {}) -testParseError('Invalid variable byte integer', Buffer.from( - [16, 255, 255, 255, 255, 255, 1] -), {}) - testParseGenerate('minimal connect', { cmd: 'connect', retain: false, @@ -273,277 +186,6 @@ testParseGenerate('minimal connect', { 116, 101, 115, 116 // Client ID ])) -testGenerateOnly('minimal connect with clientId as Buffer', { - cmd: 'connect', - retain: false, - qos: 0, - dup: false, - length: 18, - protocolId: 'MQIsdp', - protocolVersion: 3, - clean: false, - keepalive: 30, - clientId: Buffer.from('test') -}, Buffer.from([ - 16, 18, // Header - 0, 6, // Protocol ID length - 77, 81, 73, 115, 100, 112, // Protocol ID - 3, // Protocol version - 0, // Connect flags - 0, 30, // Keepalive - 0, 4, // Client ID length - 116, 101, 115, 116 // Client ID -])) - -testParseGenerate('connect MQTT bridge 131', { - cmd: 'connect', - retain: false, - qos: 0, - dup: false, - length: 18, - protocolId: 'MQIsdp', - protocolVersion: 3, - bridgeMode: true, - clean: false, - keepalive: 30, - clientId: 'test' -}, Buffer.from([ - 16, 18, // Header - 0, 6, // Protocol ID length - 77, 81, 73, 115, 100, 112, // Protocol ID - 131, // Protocol version - 0, // Connect flags - 0, 30, // Keepalive - 0, 4, // Client ID length - 116, 101, 115, 116 // Client ID -])) - -testParseGenerate('connect MQTT bridge 132', { - cmd: 'connect', - retain: false, - qos: 0, - dup: false, - length: 18, - protocolId: 'MQIsdp', - protocolVersion: 4, - bridgeMode: true, - clean: false, - keepalive: 30, - clientId: 'test' -}, Buffer.from([ - 16, 18, // Header - 0, 6, // Protocol ID length - 77, 81, 73, 115, 100, 112, // Protocol ID - 132, // Protocol version - 0, // Connect flags - 0, 30, // Keepalive - 0, 4, // Client ID length - 116, 101, 115, 116 // Client ID -])) - -testParseGenerate('connect MQTT 5', { - cmd: 'connect', - retain: false, - qos: 0, - dup: false, - length: 125, - protocolId: 'MQTT', - protocolVersion: 5, - will: { - retain: true, - qos: 2, - properties: { - willDelayInterval: 1234, - payloadFormatIndicator: false, - messageExpiryInterval: 4321, - contentType: 'test', - responseTopic: 'topic', - correlationData: Buffer.from([1, 2, 3, 4]), - userProperties: { - test: 'test' - } - }, - topic: 'topic', - payload: Buffer.from([4, 3, 2, 1]) - }, - clean: true, - keepalive: 30, - properties: { - sessionExpiryInterval: 1234, - receiveMaximum: 432, - maximumPacketSize: 100, - topicAliasMaximum: 456, - requestResponseInformation: true, - requestProblemInformation: true, - userProperties: { - test: 'test' - }, - authenticationMethod: 'test', - authenticationData: Buffer.from([1, 2, 3, 4]) - }, - clientId: 'test' -}, Buffer.from([ - 16, 125, // Header - 0, 4, // Protocol ID length - 77, 81, 84, 84, // Protocol ID - 5, // Protocol version - 54, // Connect flags - 0, 30, // Keepalive - 47, // properties length - 17, 0, 0, 4, 210, // sessionExpiryInterval - 33, 1, 176, // receiveMaximum - 39, 0, 0, 0, 100, // maximumPacketSize - 34, 1, 200, // topicAliasMaximum - 25, 1, // requestResponseInformation - 23, 1, // requestProblemInformation, - 38, 0, 4, 116, 101, 115, 116, 0, 4, 116, 101, 115, 116, // userProperties, - 21, 0, 4, 116, 101, 115, 116, // authenticationMethod - 22, 0, 4, 1, 2, 3, 4, // authenticationData - 0, 4, // Client ID length - 116, 101, 115, 116, // Client ID - 47, // will properties - 24, 0, 0, 4, 210, // will delay interval - 1, 0, // payload format indicator - 2, 0, 0, 16, 225, // message expiry interval - 3, 0, 4, 116, 101, 115, 116, // content type - 8, 0, 5, 116, 111, 112, 105, 99, // response topic - 9, 0, 4, 1, 2, 3, 4, // corelation data - 38, 0, 4, 116, 101, 115, 116, 0, 4, 116, 101, 115, 116, // user properties - 0, 5, // Will topic length - 116, 111, 112, 105, 99, // Will topic - 0, 4, // Will payload length - 4, 3, 2, 1// Will payload -])) - -testParseGenerate('connect MQTT 5 with will properties but with empty will payload', { - cmd: 'connect', - retain: false, - qos: 0, - dup: false, - length: 121, - protocolId: 'MQTT', - protocolVersion: 5, - will: { - retain: true, - qos: 2, - properties: { - willDelayInterval: 1234, - payloadFormatIndicator: false, - messageExpiryInterval: 4321, - contentType: 'test', - responseTopic: 'topic', - correlationData: Buffer.from([1, 2, 3, 4]), - userProperties: { - test: 'test' - } - }, - topic: 'topic', - payload: Buffer.from([]) - }, - clean: true, - keepalive: 30, - properties: { - sessionExpiryInterval: 1234, - receiveMaximum: 432, - maximumPacketSize: 100, - topicAliasMaximum: 456, - requestResponseInformation: true, - requestProblemInformation: true, - userProperties: { - test: 'test' - }, - authenticationMethod: 'test', - authenticationData: Buffer.from([1, 2, 3, 4]) - }, - clientId: 'test' -}, Buffer.from([ - 16, 121, // Header - 0, 4, // Protocol ID length - 77, 81, 84, 84, // Protocol ID - 5, // Protocol version - 54, // Connect flags - 0, 30, // Keepalive - 47, // properties length - 17, 0, 0, 4, 210, // sessionExpiryInterval - 33, 1, 176, // receiveMaximum - 39, 0, 0, 0, 100, // maximumPacketSize - 34, 1, 200, // topicAliasMaximum - 25, 1, // requestResponseInformation - 23, 1, // requestProblemInformation, - 38, 0, 4, 116, 101, 115, 116, 0, 4, 116, 101, 115, 116, // userProperties, - 21, 0, 4, 116, 101, 115, 116, // authenticationMethod - 22, 0, 4, 1, 2, 3, 4, // authenticationData - 0, 4, // Client ID length - 116, 101, 115, 116, // Client ID - 47, // will properties - 24, 0, 0, 4, 210, // will delay interval - 1, 0, // payload format indicator - 2, 0, 0, 16, 225, // message expiry interval - 3, 0, 4, 116, 101, 115, 116, // content type - 8, 0, 5, 116, 111, 112, 105, 99, // response topic - 9, 0, 4, 1, 2, 3, 4, // corelation data - 38, 0, 4, 116, 101, 115, 116, 0, 4, 116, 101, 115, 116, // user properties - 0, 5, // Will topic length - 116, 111, 112, 105, 99, // Will topic - 0, 0 // Will payload length -])) - -testParseGenerate('connect MQTT 5 w/o will properties', { - cmd: 'connect', - retain: false, - qos: 0, - dup: false, - length: 78, - protocolId: 'MQTT', - protocolVersion: 5, - will: { - retain: true, - qos: 2, - topic: 'topic', - payload: Buffer.from([4, 3, 2, 1]) - }, - clean: true, - keepalive: 30, - properties: { - sessionExpiryInterval: 1234, - receiveMaximum: 432, - maximumPacketSize: 100, - topicAliasMaximum: 456, - requestResponseInformation: true, - requestProblemInformation: true, - userProperties: { - test: 'test' - }, - authenticationMethod: 'test', - authenticationData: Buffer.from([1, 2, 3, 4]) - }, - clientId: 'test' -}, Buffer.from([ - 16, 78, // Header - 0, 4, // Protocol ID length - 77, 81, 84, 84, // Protocol ID - 5, // Protocol version - 54, // Connect flags - 0, 30, // Keepalive - 47, // properties length - 17, 0, 0, 4, 210, // sessionExpiryInterval - 33, 1, 176, // receiveMaximum - 39, 0, 0, 0, 100, // maximumPacketSize - 34, 1, 200, // topicAliasMaximum - 25, 1, // requestResponseInformation - 23, 1, // requestProblemInformation, - 38, 0, 4, 116, 101, 115, 116, 0, 4, 116, 101, 115, 116, // userProperties, - 21, 0, 4, 116, 101, 115, 116, // authenticationMethod - 22, 0, 4, 1, 2, 3, 4, // authenticationData - 0, 4, // Client ID length - 116, 101, 115, 116, // Client ID - 0, // will properties - 0, 5, // Will topic length - 116, 111, 112, 105, 99, // Will topic - 0, 4, // Will payload length - 4, 3, 2, 1// Will payload -])) - testParseGenerate('no clientId with 3.1.1', { cmd: 'connect', retain: false, @@ -565,76 +207,6 @@ testParseGenerate('no clientId with 3.1.1', { 0, 0 // Client ID length ])) -testParseGenerateDefaults('no clientId with 5.0', { - cmd: 'connect', - protocolId: 'MQTT', - protocolVersion: 5, - clean: true, - keepalive: 60, - properties: - { - receiveMaximum: 20 - }, - clientId: '' -}, Buffer.from( - [16, 16, 0, 4, 77, 81, 84, 84, 5, 2, 0, 60, 3, 33, 0, 20, 0, 0] -), { - cmd: 'connect', - retain: false, - qos: 0, - dup: false, - length: 16, - topic: null, - payload: null, - protocolId: 'MQTT', - protocolVersion: 5, - clean: true, - keepalive: 60, - properties: { - receiveMaximum: 20 - }, - clientId: '' -}, { protocolVersion: 5 }) - -testParseGenerateDefaults('utf-8 clientId with 5.0', { - cmd: 'connect', - retain: false, - qos: 0, - dup: false, - length: 23, - protocolId: 'MQTT', - protocolVersion: 4, - clean: true, - keepalive: 30, - clientId: 'Ŧėśt🜄' -}, Buffer.from([ - 16, 23, // Header - 0, 4, // Protocol ID length - 77, 81, 84, 84, // Protocol ID - 4, // Protocol version - 2, // Connect flags - 0, 30, // Keepalive - 0, 11, // Client ID length - 197, 166, // Ŧ (UTF-8: 0xc5a6) - 196, 151, // ė (UTF-8: 0xc497) - 197, 155, // ś (utf-8: 0xc59b) - 116, // t (utf-8: 0x74) - 240, 159, 156, 132 // 🜄 (utf-8: 0xf09f9c84) -]), { - cmd: 'connect', - retain: false, - qos: 0, - dup: false, - length: 23, - topic: null, - payload: null, - protocolId: 'MQTT', - protocolVersion: 4, - clean: true, - keepalive: 30, - clientId: 'Ŧėśt🜄' -}, { protocol: 5 }) - testParseGenerateDefaults('default connect', { cmd: 'connect', clientId: 'test' @@ -642,209 +214,7 @@ testParseGenerateDefaults('default connect', { 16, 16, 0, 4, 77, 81, 84, 84, 4, 2, 0, 0, 0, 4, 116, 101, 115, 116 -]), { - cmd: 'connect', - retain: false, - qos: 0, - dup: false, - length: 16, - topic: null, - payload: null, - protocolId: 'MQTT', - protocolVersion: 4, - clean: true, - keepalive: 0, - clientId: 'test' -}) - -testParseAndGenerate('Version 4 CONACK', { - cmd: 'connack', - retain: false, - qos: 0, - dup: false, - length: 2, - topic: null, - payload: null, - sessionPresent: false, - returnCode: 1 -}, Buffer.from([ - 32, 2, // Fixed Header (CONNACK, Remaining Length) - 0, 1 // Variable Header (Session not present, Connection Refused - unacceptable protocol version) -]), {}) // Default protocolVersion (4) - -testParseAndGenerate('Version 5 CONACK', { - cmd: 'connack', - retain: false, - qos: 0, - dup: false, - length: 3, - topic: null, - payload: null, - sessionPresent: false, - reasonCode: 140 -}, Buffer.from([ - 32, 3, // Fixed Header (CONNACK, Remaining Length) - 0, 140, // Variable Header (Session not present, Bad authentication method) - 0 // Property Length Zero -]), { protocolVersion: 5 }) - -testParseOnly('Version 4 CONACK in Version 5 mode', { - cmd: 'connack', - retain: false, - qos: 0, - dup: false, - length: 2, - topic: null, - payload: null, - sessionPresent: false, - reasonCode: 1 // a version 4 return code stored in the version 5 reasonCode because this client is in version 5 -}, Buffer.from([ - 32, 2, // Fixed Header (CONNACK, Remaining Length) - 0, 1 // Variable Header (Session not present, Connection Refused - unacceptable protocol version) -]), { protocolVersion: 5 }) // message is in version 4 format, but this client is in version 5 mode - -testParseOnly('Version 5 PUBACK test 1', { - cmd: 'puback', - messageId: 42, - retain: false, - qos: 0, - dup: false, - length: 2, - topic: null, - payload: null, - reasonCode: 0 -}, Buffer.from([ - 64, 2, // Fixed Header (PUBACK, Remaining Length) - 0, 42 // Variable Header (2 Bytes: Packet Identifier 42, Implied Reason code: Success, Implied no properties) -]), { protocolVersion: 5 } -) - -testParseAndGenerate('Version 5 PUBACK test 2', { - cmd: 'puback', - messageId: 42, - retain: false, - qos: 0, - dup: false, - length: 3, - topic: null, - payload: null, - reasonCode: 0 -}, Buffer.from([ - 64, 3, // Fixed Header (PUBACK, Remaining Length) - 0, 42, 0 // Variable Header (2 Bytes: Packet Identifier 42, Reason code: 0 Success, Implied no properties) -]), { protocolVersion: 5 } -) - -testParseOnly('Version 5 PUBACK test 3', { - cmd: 'puback', - messageId: 42, - retain: false, - qos: 0, - dup: false, - length: 4, - topic: null, - payload: null, - reasonCode: 0 -}, Buffer.from([ - 64, 4, // Fixed Header (PUBACK, Remaining Length) - 0, 42, 0, // Variable Header (2 Bytes: Packet Identifier 42, Reason code: 0 Success) - 0 // no properties -]), { protocolVersion: 5 } -) - -testParseOnly('Version 5 CONNACK test 1', { - cmd: 'connack', - retain: false, - qos: 0, - dup: false, - length: 1, - topic: null, - payload: null, - sessionPresent: true, - reasonCode: 0 -}, Buffer.from([ - 32, 1, // Fixed Header (CONNACK, Remaining Length) - 1 // Variable Header (Session Present: 1 => true, Implied Reason code: Success, Implied no properties) -]), { protocolVersion: 5 } -) - -testParseOnly('Version 5 CONNACK test 2', { - cmd: 'connack', - retain: false, - qos: 0, - dup: false, - length: 2, - topic: null, - payload: null, - sessionPresent: true, - reasonCode: 0 -}, Buffer.from([ - 32, 2, // Fixed Header (CONNACK, Remaining Length) - 1, 0 // Variable Header (Session Present: 1 => true, Connect Reason code: Success, Implied no properties) -]), { protocolVersion: 5 } -) - -testParseAndGenerate('Version 5 CONNACK test 3', { - cmd: 'connack', - retain: false, - qos: 0, - dup: false, - length: 3, - topic: null, - payload: null, - sessionPresent: true, - reasonCode: 0 -}, Buffer.from([ - 32, 3, // Fixed Header (CONNACK, Remaining Length) - 1, 0, // Variable Header (Session Present: 1 => true, Connect Reason code: Success) - 0 // no properties -]), { protocolVersion: 5 } -) - -testParseOnly('Version 5 DISCONNECT test 1', { - cmd: 'disconnect', - retain: false, - qos: 0, - dup: false, - length: 0, - topic: null, - payload: null, - reasonCode: 0 -}, Buffer.from([ - 224, 0 // Fixed Header (DISCONNECT, Remaining Length), Implied Reason code: Normal Disconnection -]), { protocolVersion: 5 } -) - -testParseOnly('Version 5 DISCONNECT test 2', { - cmd: 'disconnect', - retain: false, - qos: 0, - dup: false, - length: 1, - topic: null, - payload: null, - reasonCode: 0 -}, Buffer.from([ - 224, 1, // Fixed Header (DISCONNECT, Remaining Length) - 0 // reason Code (Normal disconnection) -]), { protocolVersion: 5 } -) - -testParseAndGenerate('Version 5 DISCONNECT test 3', { - cmd: 'disconnect', - retain: false, - qos: 0, - dup: false, - length: 2, - topic: null, - payload: null, - reasonCode: 0 -}, Buffer.from([ - 224, 2, // Fixed Header (DISCONNECT, Remaining Length) - 0, // reason Code (Normal disconnection) - 0 // no properties -]), { protocolVersion: 5 } -) +])) testParseGenerate('empty will payload', { cmd: 'connect', @@ -858,13 +228,13 @@ testParseGenerate('empty will payload', { retain: true, qos: 2, topic: 'topic', - payload: Buffer.alloc(0) + payload: new Buffer(0) }, clean: true, keepalive: 30, clientId: 'test', username: 'username', - password: Buffer.from('password') + password: new Buffer('password') }, Buffer.from([ 16, 47, // Header 0, 6, // Protocol ID length @@ -895,7 +265,7 @@ testParseGenerate('empty buffer username payload', { clean: true, keepalive: 30, clientId: 'test', - username: Buffer.from('') + username: new Buffer('') }, Buffer.from([ 16, 20, // Header 0, 6, // Protocol ID length @@ -946,7 +316,7 @@ testParseGenerate('empty buffer password payload', { keepalive: 30, clientId: 'test', username: 'username', - password: Buffer.from('') + password: new Buffer('') }, Buffer.from([ 16, 30, // Header 0, 6, // Protocol ID length @@ -1002,7 +372,7 @@ testParseGenerate('empty string username and password payload', { keepalive: 30, clientId: 'test', username: '', - password: Buffer.from('') + password: new Buffer('') }, Buffer.from([ 16, 22, // Header 0, 6, // Protocol ID length @@ -1030,13 +400,13 @@ testParseGenerate('maximal connect', { retain: true, qos: 2, topic: 'topic', - payload: Buffer.from('payload') + payload: new Buffer('payload') }, clean: true, keepalive: 30, clientId: 'test', username: 'username', - password: Buffer.from('password') + password: new Buffer('password') }, Buffer.from([ 16, 54, // Header 0, 6, // Protocol ID length @@ -1068,13 +438,13 @@ testParseGenerate('max connect with special chars', { retain: true, qos: 2, topic: 'tòpic', - payload: Buffer.from('pay£oad') + payload: new Buffer('pay£oad') }, clean: true, keepalive: 30, clientId: 'te$t', username: 'u$ern4me', - password: Buffer.from('p4$$w0£d') + password: new Buffer('p4$$w0£d') }, Buffer.from([ 16, 57, // Header 0, 6, // Protocol ID length @@ -1094,43 +464,49 @@ testParseGenerate('max connect with special chars', { 112, 52, 36, 36, 119, 48, 194, 163, 100 // Password ])) -testGenerateOnly('connect all strings generate', { - cmd: 'connect', - retain: false, - qos: 0, - dup: false, - length: 54, - protocolId: 'MQIsdp', - protocolVersion: 3, - will: { - retain: true, - qos: 2, - topic: 'topic', - payload: 'payload' - }, - clean: true, - keepalive: 30, - clientId: 'test', - username: 'username', - password: 'password' -}, Buffer.from([ - 16, 54, // Header - 0, 6, // Protocol ID length - 77, 81, 73, 115, 100, 112, // Protocol ID - 3, // Protocol version - 246, // Connect flags - 0, 30, // Keepalive - 0, 4, // Client ID length - 116, 101, 115, 116, // Client ID - 0, 5, // Will topic length - 116, 111, 112, 105, 99, // Will topic - 0, 7, // Will payload length - 112, 97, 121, 108, 111, 97, 100, // Will payload - 0, 8, // Username length - 117, 115, 101, 114, 110, 97, 109, 101, // Username - 0, 8, // Password length - 112, 97, 115, 115, 119, 111, 114, 100 // Password -])) +test('connect all strings generate', function (t) { + var message = { + cmd: 'connect', + retain: false, + qos: 0, + dup: false, + length: 54, + protocolId: 'MQIsdp', + protocolVersion: 3, + will: { + retain: true, + qos: 2, + topic: 'topic', + payload: 'payload' + }, + clean: true, + keepalive: 30, + clientId: 'test', + username: 'username', + password: 'password' + } + var expected = Buffer.from([ + 16, 54, // Header + 0, 6, // Protocol ID length + 77, 81, 73, 115, 100, 112, // Protocol ID + 3, // Protocol version + 246, // Connect flags + 0, 30, // Keepalive + 0, 4, // Client ID length + 116, 101, 115, 116, // Client ID + 0, 5, // Will topic length + 116, 111, 112, 105, 99, // Will topic + 0, 7, // Will payload length + 112, 97, 121, 108, 111, 97, 100, // Will payload + 0, 8, // Username length + 117, 115, 101, 114, 110, 97, 109, 101, // Username + 0, 8, // Password length + 112, 97, 115, 115, 119, 111, 114, 100 // Password + ]) + + t.equal(mqtt.generate(message).toString('hex'), expected.toString('hex')) + t.end() +}) testParseError('Cannot parse protocolId', Buffer.from([ 16, 4, @@ -1138,92 +514,6 @@ testParseError('Cannot parse protocolId', Buffer.from([ 77, 81 ])) -// missing protocol version on connect -testParseError('Packet too short', Buffer.from([ - 16, 8, // Header - 0, 6, // Protocol ID length - 77, 81, 73, 115, 100, 112 // Protocol ID -])) - -// missing keepalive on connect -testParseError('Packet too short', Buffer.from([ - 16, 10, // Header - 0, 6, // Protocol ID length - 77, 81, 73, 115, 100, 112, // Protocol ID - 3, // Protocol version - 246 // Connect flags -])) - -// missing clientid on connect -testParseError('Packet too short', Buffer.from([ - 16, 10, // Header - 0, 6, // Protocol ID length - 77, 81, 73, 115, 100, 112, // Protocol ID - 3, // Protocol version - 246, // Connect flags - 0, 30 // Keepalive -])) - -// missing will topic on connect -testParseError('Cannot parse will topic', Buffer.from([ - 16, 16, // Header - 0, 6, // Protocol ID length - 77, 81, 73, 115, 100, 112, // Protocol ID - 3, // Protocol version - 246, // Connect flags - 0, 30, // Keepalive - 0, 2, // Will topic length - 0, 0 // Will topic -])) - -// missing will payload on connect -testParseError('Cannot parse will payload', Buffer.from([ - 16, 23, // Header - 0, 6, // Protocol ID length - 77, 81, 73, 115, 100, 112, // Protocol ID - 3, // Protocol version - 246, // Connect flags - 0, 30, // Keepalive - 0, 5, // Will topic length - 116, 111, 112, 105, 99, // Will topic - 0, 2, // Will payload length - 0, 0 // Will payload -])) - -// missing username on connect -testParseError('Cannot parse username', Buffer.from([ - 16, 32, // Header - 0, 6, // Protocol ID length - 77, 81, 73, 115, 100, 112, // Protocol ID - 3, // Protocol version - 246, // Connect flags - 0, 30, // Keepalive - 0, 5, // Will topic length - 116, 111, 112, 105, 99, // Will topic - 0, 7, // Will payload length - 112, 97, 121, 108, 111, 97, 100, // Will payload - 0, 2, // Username length - 0, 0 // Username -])) - -// missing password on connect -testParseError('Cannot parse password', Buffer.from([ - 16, 42, // Header - 0, 6, // Protocol ID length - 77, 81, 73, 115, 100, 112, // Protocol ID - 3, // Protocol version - 246, // Connect flags - 0, 30, // Keepalive - 0, 5, // Will topic length - 116, 111, 112, 105, 99, // Will topic - 0, 7, // Will payload length - 112, 97, 121, 108, 111, 97, 100, // Will payload - 0, 8, // Username length - 117, 115, 101, 114, 110, 97, 109, 101, // Username - 0, 2, // Password length - 0, 0 // Password -])) - testParseGenerate('connack with return code 0', { cmd: 'connack', retain: false, @@ -1236,109 +526,6 @@ testParseGenerate('connack with return code 0', { 32, 2, 0, 0 ])) -testParseGenerate('connack MQTT 5 with properties', { - cmd: 'connack', - retain: false, - qos: 0, - dup: false, - length: 87, - sessionPresent: false, - reasonCode: 0, - properties: { - sessionExpiryInterval: 1234, - receiveMaximum: 432, - maximumQoS: 2, - retainAvailable: true, - maximumPacketSize: 100, - assignedClientIdentifier: 'test', - topicAliasMaximum: 456, - reasonString: 'test', - userProperties: { - test: 'test' - }, - wildcardSubscriptionAvailable: true, - subscriptionIdentifiersAvailable: true, - sharedSubscriptionAvailable: false, - serverKeepAlive: 1234, - responseInformation: 'test', - serverReference: 'test', - authenticationMethod: 'test', - authenticationData: Buffer.from([1, 2, 3, 4]) - } -}, Buffer.from([ - 32, 87, 0, 0, - 84, // properties length - 17, 0, 0, 4, 210, // sessionExpiryInterval - 33, 1, 176, // receiveMaximum - 36, 2, // Maximum qos - 37, 1, // retainAvailable - 39, 0, 0, 0, 100, // maximumPacketSize - 18, 0, 4, 116, 101, 115, 116, // assignedClientIdentifier - 34, 1, 200, // topicAliasMaximum - 31, 0, 4, 116, 101, 115, 116, // reasonString - 38, 0, 4, 116, 101, 115, 116, 0, 4, 116, 101, 115, 116, // userProperties - 40, 1, // wildcardSubscriptionAvailable - 41, 1, // subscriptionIdentifiersAvailable - 42, 0, // sharedSubscriptionAvailable - 19, 4, 210, // serverKeepAlive - 26, 0, 4, 116, 101, 115, 116, // responseInformation - 28, 0, 4, 116, 101, 115, 116, // serverReference - 21, 0, 4, 116, 101, 115, 116, // authenticationMethod - 22, 0, 4, 1, 2, 3, 4 // authenticationData -]), { protocolVersion: 5 }) - -testParseGenerate('connack MQTT 5 with properties and doubled user properties', { - cmd: 'connack', - retain: false, - qos: 0, - dup: false, - length: 100, - sessionPresent: false, - reasonCode: 0, - properties: { - sessionExpiryInterval: 1234, - receiveMaximum: 432, - maximumQoS: 2, - retainAvailable: true, - maximumPacketSize: 100, - assignedClientIdentifier: 'test', - topicAliasMaximum: 456, - reasonString: 'test', - userProperties: { - test: ['test', 'test'] - }, - wildcardSubscriptionAvailable: true, - subscriptionIdentifiersAvailable: true, - sharedSubscriptionAvailable: false, - serverKeepAlive: 1234, - responseInformation: 'test', - serverReference: 'test', - authenticationMethod: 'test', - authenticationData: Buffer.from([1, 2, 3, 4]) - } -}, Buffer.from([ - 32, 100, 0, 0, - 97, // properties length - 17, 0, 0, 4, 210, // sessionExpiryInterval - 33, 1, 176, // receiveMaximum - 36, 2, // Maximum qos - 37, 1, // retainAvailable - 39, 0, 0, 0, 100, // maximumPacketSize - 18, 0, 4, 116, 101, 115, 116, // assignedClientIdentifier - 34, 1, 200, // topicAliasMaximum - 31, 0, 4, 116, 101, 115, 116, // reasonString - 38, 0, 4, 116, 101, 115, 116, 0, 4, 116, 101, 115, 116, - 38, 0, 4, 116, 101, 115, 116, 0, 4, 116, 101, 115, 116, // userProperties - 40, 1, // wildcardSubscriptionAvailable - 41, 1, // subscriptionIdentifiersAvailable - 42, 0, // sharedSubscriptionAvailable - 19, 4, 210, // serverKeepAlive - 26, 0, 4, 116, 101, 115, 116, // responseInformation - 28, 0, 4, 116, 101, 115, 116, // serverReference - 21, 0, 4, 116, 101, 115, 116, // authenticationMethod - 22, 0, 4, 1, 2, 3, 4 // authenticationData -]), { protocolVersion: 5 }) - testParseGenerate('connack with return code 0 session present bit set', { cmd: 'connack', retain: false, @@ -1363,16 +550,6 @@ testParseGenerate('connack with return code 5', { 32, 2, 0, 5 ])) -testGenerateError('Invalid return code', { - cmd: 'connack', - retain: false, - qos: 0, - dup: false, - length: 2, - sessionPresent: false, - returnCode: '5' // returncode must be a number -}) - testParseGenerate('minimal publish', { cmd: 'publish', retain: false, @@ -1380,7 +557,7 @@ testParseGenerate('minimal publish', { dup: false, length: 10, topic: 'test', - payload: Buffer.from('test') + payload: new Buffer('test') }, Buffer.from([ 48, 10, // Header 0, 4, // Topic length @@ -1388,139 +565,8 @@ testParseGenerate('minimal publish', { 116, 101, 115, 116 // Payload (test) ])) -testParseGenerate('publish MQTT 5 properties', { - cmd: 'publish', - retain: true, - qos: 2, - dup: true, - length: 86, - topic: 'test', - payload: Buffer.from('test'), - messageId: 10, - properties: { - payloadFormatIndicator: true, - messageExpiryInterval: 4321, - topicAlias: 100, - responseTopic: 'topic', - correlationData: Buffer.from([1, 2, 3, 4]), - userProperties: { - test: ['test', 'test', 'test'] - }, - subscriptionIdentifier: 120, - contentType: 'test' - } -}, Buffer.from([ - 61, 86, // Header - 0, 4, // Topic length - 116, 101, 115, 116, // Topic (test) - 0, 10, // Message ID - 73, // properties length - 1, 1, // payloadFormatIndicator - 2, 0, 0, 16, 225, // message expiry interval - 35, 0, 100, // topicAlias - 8, 0, 5, 116, 111, 112, 105, 99, // response topic - 9, 0, 4, 1, 2, 3, 4, // correlationData - 38, 0, 4, 116, 101, 115, 116, 0, 4, 116, 101, 115, 116, // userProperties - 38, 0, 4, 116, 101, 115, 116, 0, 4, 116, 101, 115, 116, // userProperties - 38, 0, 4, 116, 101, 115, 116, 0, 4, 116, 101, 115, 116, // userProperties - 11, 120, // subscriptionIdentifier - 3, 0, 4, 116, 101, 115, 116, // content type - 116, 101, 115, 116 // Payload (test) -]), { protocolVersion: 5 }) - -testParseGenerate('publish MQTT 5 with multiple same properties', { - cmd: 'publish', - retain: true, - qos: 2, - dup: true, - length: 64, - topic: 'test', - payload: Buffer.from('test'), - messageId: 10, - properties: { - payloadFormatIndicator: true, - messageExpiryInterval: 4321, - topicAlias: 100, - responseTopic: 'topic', - correlationData: Buffer.from([1, 2, 3, 4]), - userProperties: { - test: 'test' - }, - subscriptionIdentifier: [120, 121, 122], - contentType: 'test' - } -}, Buffer.from([ - 61, 64, // Header - 0, 4, // Topic length - 116, 101, 115, 116, // Topic (test) - 0, 10, // Message ID - 51, // properties length - 1, 1, // payloadFormatIndicator - 2, 0, 0, 16, 225, // message expiry interval - 35, 0, 100, // topicAlias - 8, 0, 5, 116, 111, 112, 105, 99, // response topic - 9, 0, 4, 1, 2, 3, 4, // correlationData - 38, 0, 4, 116, 101, 115, 116, 0, 4, 116, 101, 115, 116, // userProperties - 11, 120, // subscriptionIdentifier - 11, 121, // subscriptionIdentifier - 11, 122, // subscriptionIdentifier - 3, 0, 4, 116, 101, 115, 116, // content type - 116, 101, 115, 116 // Payload (test) -]), { protocolVersion: 5 }) - -testParseGenerate('publish MQTT 5 properties with 0-4 byte varbyte', { - cmd: 'publish', - retain: true, - qos: 2, - dup: true, - length: 27, - topic: 'test', - payload: Buffer.from('test'), - messageId: 10, - properties: { - payloadFormatIndicator: false, - subscriptionIdentifier: [128, 16384, 2097152] // this tests the varbyte handling - } -}, Buffer.from([ - 61, 27, // Header - 0, 4, // Topic length - 116, 101, 115, 116, // Topic (test) - 0, 10, // Message ID - 14, // properties length - 1, 0, // payloadFormatIndicator - 11, 128, 1, // subscriptionIdentifier - 11, 128, 128, 1, // subscriptionIdentifier - 11, 128, 128, 128, 1, // subscriptionIdentifier - 116, 101, 115, 116 // Payload (test) -]), { protocolVersion: 5 }) - -testParseGenerate('publish MQTT 5 properties with max value varbyte', { - cmd: 'publish', - retain: true, - qos: 2, - dup: true, - length: 22, - topic: 'test', - payload: Buffer.from('test'), - messageId: 10, - properties: { - payloadFormatIndicator: false, - subscriptionIdentifier: [1, 268435455] - } -}, Buffer.from([ - 61, 22, // Header - 0, 4, // Topic length - 116, 101, 115, 116, // Topic (test) - 0, 10, // Message ID - 9, // properties length - 1, 0, // payloadFormatIndicator - 11, 1, // subscriptionIdentifier - 11, 255, 255, 255, 127, // subscriptionIdentifier (max value) - 116, 101, 115, 116 // Payload (test) -]), { protocolVersion: 5 }) - -; (() => { - const buffer = Buffer.alloc(2048) +;(function () { + var buffer = new Buffer(2048) testParseGenerate('2KB publish packet', { cmd: 'publish', retain: false, @@ -1536,19 +582,18 @@ testParseGenerate('publish MQTT 5 properties with max value varbyte', { ]), buffer])) })() -; (() => { - const maxLength = 268435455 - const buffer = Buffer.alloc(maxLength - 6) - testParseGenerate('Max payload publish packet', { +;(function () { + var buffer = new Buffer(2 * 1024 * 1024) + testParseGenerate('2MB publish packet', { cmd: 'publish', retain: false, qos: 0, dup: false, - length: maxLength, + length: 6 + 2 * 1024 * 1024, topic: 'test', payload: buffer }, Buffer.concat([Buffer.from([ - 48, 255, 255, 255, 127, // Header + 48, 134, 128, 128, 1, // Header 0, 4, // Topic length 116, 101, 115, 116 // Topic (test) ]), buffer])) @@ -1562,7 +607,7 @@ testParseGenerate('maximal publish', { dup: true, topic: 'test', messageId: 10, - payload: Buffer.from('test') + payload: new Buffer('test') }, Buffer.from([ 61, 12, // Header 0, 4, // Topic length @@ -1571,8 +616,8 @@ testParseGenerate('maximal publish', { 116, 101, 115, 116 // Payload ])) -test('publish all strings generate', t => { - const message = { +test('publish all strings generate', function (t) { + var message = { cmd: 'publish', retain: true, qos: 2, @@ -1580,9 +625,9 @@ test('publish all strings generate', t => { dup: true, topic: 'test', messageId: 10, - payload: Buffer.from('test') + payload: new Buffer('test') } - const expected = Buffer.from([ + var expected = Buffer.from([ 61, 12, // Header 0, 4, // Topic length 116, 101, 115, 116, // Topic @@ -1601,7 +646,7 @@ testParseGenerate('empty publish', { dup: false, length: 6, topic: 'test', - payload: Buffer.alloc(0) + payload: new Buffer(0) }, Buffer.from([ 48, 6, // Header 0, 4, // Topic length @@ -1609,22 +654,22 @@ testParseGenerate('empty publish', { // Empty payload ])) -test('splitted publish parse', t => { +test('splitted publish parse', function (t) { t.plan(3) - const parser = mqtt.parser() - const expected = { + var parser = mqtt.parser() + var expected = { cmd: 'publish', retain: false, qos: 0, dup: false, length: 10, topic: 'test', - payload: Buffer.from('test') + payload: new Buffer('test') } - parser.on('packet', packet => { - t.deepLooseEqual(packet, expected, 'expected packet') + parser.on('packet', function (packet) { + t.deepEqual(packet, expected, 'expected packet') }) t.equal(parser.parse(Buffer.from([ @@ -1638,100 +683,6 @@ test('splitted publish parse', t => { ])), 0, 'remaining bytes') }) -test('split publish longer', t => { - t.plan(3) - - const length = 255 - const topic = 'test' - // Minus two bytes for the topic length specifier - const payloadLength = length - topic.length - 2 - - const parser = mqtt.parser() - const expected = { - cmd: 'publish', - retain: false, - qos: 0, - dup: false, - length: length, - topic: topic, - payload: Buffer.from('a'.repeat(payloadLength)) - } - - parser.on('packet', packet => { - t.deepLooseEqual(packet, expected, 'expected packet') - }) - - t.equal(parser.parse(Buffer.from([ - 48, 255, 1, // Header - 0, topic.length, // Topic length - 116, 101, 115, 116 // Topic (test) - ])), 6, 'remaining bytes') - - t.equal(parser.parse(Buffer.from(Array(payloadLength).fill(97))), - 0, 'remaining bytes') -}) - -test('split length parse', t => { - t.plan(4) - - const length = 255 - const topic = 'test' - const payloadLength = length - topic.length - 2 - - const parser = mqtt.parser() - const expected = { - cmd: 'publish', - retain: false, - qos: 0, - dup: false, - length: length, - topic: topic, - payload: Buffer.from('a'.repeat(payloadLength)) - } - - parser.on('packet', packet => { - t.deepLooseEqual(packet, expected, 'expected packet') - }) - - t.equal(parser.parse(Buffer.from([ - 48, 255 // Header (partial length) - ])), 1, 'remaining bytes') - - t.equal(parser.parse(Buffer.from([ - 1, // Rest of header length - 0, topic.length, // Topic length - 116, 101, 115, 116 // Topic (test) - ])), 6, 'remaining bytes') - - t.equal(parser.parse(Buffer.from(Array(payloadLength).fill(97))), - 0, 'remaining bytes') -}) - -testGenerateError('Invalid variable byte integer: 268435456', { - cmd: 'publish', - retain: false, - qos: 0, - dup: false, - length: (268435455 + 1), - topic: 'test', - payload: Buffer.alloc(268435455 + 1 - 6) -}, {}, 'Length var byte integer over max allowed value throws error') - -testGenerateError('Invalid subscriptionIdentifier: 268435456', { - cmd: 'publish', - retain: true, - qos: 2, - dup: true, - length: 27, - topic: 'test', - payload: Buffer.from('test'), - messageId: 10, - properties: { - payloadFormatIndicator: false, - subscriptionIdentifier: 268435456 - } -}, { protocolVersion: 5 }, 'MQTT 5.0 var byte integer >24 bits throws error') - testParseGenerate('puback', { cmd: 'puback', retain: false, @@ -1744,43 +695,6 @@ testParseGenerate('puback', { 0, 2 // Message ID ])) -testParseGenerate('puback with reason and no MQTT 5 properties', { - cmd: 'puback', - retain: false, - qos: 0, - dup: false, - length: 3, - messageId: 2, - reasonCode: 16 -}, Buffer.from([ - 64, 3, // Header - 0, 2, // Message ID - 16 // reason code -]), { protocolVersion: 5 }) - -testParseGenerate('puback MQTT 5 properties', { - cmd: 'puback', - retain: false, - qos: 0, - dup: false, - length: 24, - messageId: 2, - reasonCode: 16, - properties: { - reasonString: 'test', - userProperties: { - test: 'test' - } - } -}, Buffer.from([ - 64, 24, // Header - 0, 2, // Message ID - 16, // reason code - 20, // properties length - 31, 0, 4, 116, 101, 115, 116, // reasonString - 38, 0, 4, 116, 101, 115, 116, 0, 4, 116, 101, 115, 116 // userProperties -]), { protocolVersion: 5 }) - testParseGenerate('pubrec', { cmd: 'pubrec', retain: false, @@ -1793,29 +707,6 @@ testParseGenerate('pubrec', { 0, 2 // Message ID ])) -testParseGenerate('pubrec MQTT 5 properties', { - cmd: 'pubrec', - retain: false, - qos: 0, - dup: false, - length: 24, - messageId: 2, - reasonCode: 16, - properties: { - reasonString: 'test', - userProperties: { - test: 'test' - } - } -}, Buffer.from([ - 80, 24, // Header - 0, 2, // Message ID - 16, // reason code - 20, // properties length - 31, 0, 4, 116, 101, 115, 116, // reasonString - 38, 0, 4, 116, 101, 115, 116, 0, 4, 116, 101, 115, 116 // userProperties -]), { protocolVersion: 5 }) - testParseGenerate('pubrel', { cmd: 'pubrel', retain: false, @@ -1828,29 +719,6 @@ testParseGenerate('pubrel', { 0, 2 // Message ID ])) -testParseGenerate('pubrel MQTT5 properties', { - cmd: 'pubrel', - retain: false, - qos: 1, - dup: false, - length: 24, - messageId: 2, - reasonCode: 16, - properties: { - reasonString: 'test', - userProperties: { - test: 'test' - } - } -}, Buffer.from([ - 98, 24, // Header - 0, 2, // Message ID - 16, // reason code - 20, // properties length - 31, 0, 4, 116, 101, 115, 116, // reasonString - 38, 0, 4, 116, 101, 115, 116, 0, 4, 116, 101, 115, 116 // userProperties -]), { protocolVersion: 5 }) - testParseGenerate('pubcomp', { cmd: 'pubcomp', retain: false, @@ -1863,29 +731,6 @@ testParseGenerate('pubcomp', { 0, 2 // Message ID ])) -testParseGenerate('pubcomp MQTT 5 properties', { - cmd: 'pubcomp', - retain: false, - qos: 0, - dup: false, - length: 24, - messageId: 2, - reasonCode: 16, - properties: { - reasonString: 'test', - userProperties: { - test: 'test' - } - } -}, Buffer.from([ - 112, 24, // Header - 0, 2, // Message ID - 16, // reason code - 20, // properties length - 31, 0, 4, 116, 101, 115, 116, // reasonString - 38, 0, 4, 116, 101, 115, 116, 0, 4, 116, 101, 115, 116 // userProperties -]), { protocolVersion: 5 }) - testParseError('Wrong subscribe header', Buffer.from([ 128, 9, // Header (subscribeqos=0length=9) 0, 6, // Message ID (6) @@ -1915,39 +760,6 @@ testParseGenerate('subscribe to one topic', { 0 // Qos (0) ])) -testParseGenerate('subscribe to one topic by MQTT 5', { - cmd: 'subscribe', - retain: false, - qos: 1, - dup: false, - length: 26, - subscriptions: [ - { - topic: 'test', - qos: 0, - nl: false, - rap: true, - rh: 1 - } - ], - messageId: 6, - properties: { - subscriptionIdentifier: 145, - userProperties: { - test: 'test' - } - } -}, Buffer.from([ - 130, 26, // Header (subscribeqos=1length=9) - 0, 6, // Message ID (6) - 16, // properties length - 11, 145, 1, // subscriptionIdentifier - 38, 0, 4, 116, 101, 115, 116, 0, 4, 116, 101, 115, 116, // userProperties - 0, 4, // Topic length, - 116, 101, 115, 116, // Topic (test) - 24 // settings(qos: 0, noLocal: false, Retain as Published: true, retain handling: 1) -]), { protocolVersion: 5 }) - testParseGenerate('subscribe to three topics', { cmd: 'subscribe', retain: false, @@ -1981,58 +793,6 @@ testParseGenerate('subscribe to three topics', { 2 // Qos (2) ])) -testParseGenerate('subscribe to 3 topics by MQTT 5', { - cmd: 'subscribe', - retain: false, - qos: 1, - dup: false, - length: 40, - subscriptions: [ - { - topic: 'test', - qos: 0, - nl: false, - rap: true, - rh: 1 - }, - { - topic: 'uest', - qos: 1, - nl: false, - rap: false, - rh: 0 - }, { - topic: 'tfst', - qos: 2, - nl: true, - rap: false, - rh: 0 - } - ], - messageId: 6, - properties: { - subscriptionIdentifier: 145, - userProperties: { - test: 'test' - } - } -}, Buffer.from([ - 130, 40, // Header (subscribeqos=1length=9) - 0, 6, // Message ID (6) - 16, // properties length - 11, 145, 1, // subscriptionIdentifier - 38, 0, 4, 116, 101, 115, 116, 0, 4, 116, 101, 115, 116, // userProperties - 0, 4, // Topic length, - 116, 101, 115, 116, // Topic (test) - 24, // settings(qos: 0, noLocal: false, Retain as Published: true, retain handling: 1) - 0, 4, // Topic length - 117, 101, 115, 116, // Topic (uest) - 1, // Qos (1) - 0, 4, // Topic length - 116, 102, 115, 116, // Topic (tfst) - 6 // Qos (2), No Local: true -]), { protocolVersion: 5 }) - testParseGenerate('suback', { cmd: 'suback', retain: false, @@ -2047,29 +807,6 @@ testParseGenerate('suback', { 0, 1, 2, 128 // Granted qos (0, 1, 2) and a rejected being 0x80 ])) -testParseGenerate('suback MQTT 5', { - cmd: 'suback', - retain: false, - qos: 0, - dup: false, - length: 27, - granted: [0, 1, 2, 128], - messageId: 6, - properties: { - reasonString: 'test', - userProperties: { - test: 'test' - } - } -}, Buffer.from([ - 144, 27, // Header - 0, 6, // Message ID - 20, // properties length - 31, 0, 4, 116, 101, 115, 116, // reasonString - 38, 0, 4, 116, 101, 115, 116, 0, 4, 116, 101, 115, 116, // userProperties - 0, 1, 2, 128 // Granted qos (0, 1, 2) and a rejected being 0x80 -]), { protocolVersion: 5 }) - testParseGenerate('unsubscribe', { cmd: 'unsubscribe', retain: false, @@ -2090,53 +827,6 @@ testParseGenerate('unsubscribe', { 116, 101, 115, 116 // Topic (test) ])) -testGenerateError('Invalid unsubscriptions', { - cmd: 'unsubscribe', - retain: false, - qos: 1, - dup: true, - length: 5, - unsubscriptions: 5, - messageId: 7 -}, {}, 'unsubscribe with unsubscriptions not an array') - -testGenerateError('Invalid unsubscriptions', { - cmd: 'unsubscribe', - retain: false, - qos: 1, - dup: true, - length: 5, - unsubscriptions: [1, 2], - messageId: 7 -}, {}, 'unsubscribe with unsubscriptions as an object') - -testParseGenerate('unsubscribe MQTT 5', { - cmd: 'unsubscribe', - retain: false, - qos: 1, - dup: false, - length: 28, - unsubscriptions: [ - 'tfst', - 'test' - ], - messageId: 7, - properties: { - userProperties: { - test: 'test' - } - } -}, Buffer.from([ - 162, 28, - 0, 7, // Message ID (7) - 13, // properties length - 38, 0, 4, 116, 101, 115, 116, 0, 4, 116, 101, 115, 116, // userProperties - 0, 4, // Topic length - 116, 102, 115, 116, // Topic (tfst) - 0, 4, // Topic length, - 116, 101, 115, 116 // Topic (test) -]), { protocolVersion: 5 }) - testParseGenerate('unsuback', { cmd: 'unsuback', retain: false, @@ -2149,29 +839,6 @@ testParseGenerate('unsuback', { 0, 8 // Message ID ])) -testParseGenerate('unsuback MQTT 5', { - cmd: 'unsuback', - retain: false, - qos: 0, - dup: false, - length: 25, - messageId: 8, - properties: { - reasonString: 'test', - userProperties: { - test: 'test' - } - }, - granted: [0, 128] -}, Buffer.from([ - 176, 25, // Header - 0, 8, // Message ID - 20, // properties length - 31, 0, 4, 116, 101, 115, 116, // reasonString - 38, 0, 4, 116, 101, 115, 116, 0, 4, 116, 101, 115, 116, // userProperties - 0, 128 // success and error -]), { protocolVersion: 5 }) - testParseGenerate('pingreq', { cmd: 'pingreq', retain: false, @@ -2202,68 +869,7 @@ testParseGenerate('disconnect', { 224, 0 // Header ])) -testParseGenerate('disconnect MQTT 5', { - cmd: 'disconnect', - retain: false, - qos: 0, - dup: false, - length: 34, - reasonCode: 0, - properties: { - sessionExpiryInterval: 145, - reasonString: 'test', - userProperties: { - test: 'test' - }, - serverReference: 'test' - } -}, Buffer.from([ - 224, 34, // Header - 0, // reason code - 32, // properties length - 17, 0, 0, 0, 145, // sessionExpiryInterval - 31, 0, 4, 116, 101, 115, 116, // reasonString - 38, 0, 4, 116, 101, 115, 116, 0, 4, 116, 101, 115, 116, // userProperties - 28, 0, 4, 116, 101, 115, 116// serverReference -]), { protocolVersion: 5 }) - -testParseGenerate('disconnect MQTT 5 with no properties', { - cmd: 'disconnect', - retain: false, - qos: 0, - dup: false, - length: 2, - reasonCode: 0 -}, Buffer.from([ - 224, 2, // Fixed Header (DISCONNECT, Remaining Length) - 0, // Reason Code (Normal Disconnection) - 0 // Property Length (0 => No Properties) -]), { protocolVersion: 5 }) - -testParseGenerate('auth MQTT 5', { - cmd: 'auth', - retain: false, - qos: 0, - dup: false, - length: 36, - reasonCode: 0, - properties: { - authenticationMethod: 'test', - authenticationData: Buffer.from([0, 1, 2, 3]), - reasonString: 'test', - userProperties: { - test: 'test' - } - } -}, Buffer.from([ - 240, 36, // Header - 0, // reason code - 34, // properties length - 21, 0, 4, 116, 101, 115, 116, // auth method - 22, 0, 4, 0, 1, 2, 3, // auth data - 31, 0, 4, 116, 101, 115, 116, // reasonString - 38, 0, 4, 116, 101, 115, 116, 0, 4, 116, 101, 115, 116 // userProperties -]), { protocolVersion: 5 }) +testGenerateError('Unknown command', {}) testGenerateError('Invalid protocolId', { cmd: 'connect', @@ -2286,27 +892,6 @@ testGenerateError('Invalid protocolId', { password: 'password' }) -testGenerateError('Invalid protocol version', { - cmd: 'connect', - retain: false, - qos: 0, - dup: false, - length: 54, - protocolId: 'MQIsdp', - protocolVersion: 1, - will: { - retain: true, - qos: 2, - topic: 'topic', - payload: 'payload' - }, - clean: true, - keepalive: 30, - clientId: 'test', - username: 'username', - password: 'password' -}) - testGenerateError('clientId must be supplied before 3.1.1', { cmd: 'connect', retain: false, @@ -2492,81 +1077,12 @@ testGenerateError('Username is required to use password', { password: 'password' }) -testGenerateError('Invalid messageExpiryInterval: -4321', { - cmd: 'publish', - retain: true, - qos: 2, - dup: true, - length: 60, - topic: 'test', - payload: Buffer.from('test'), - messageId: 10, - properties: { - payloadFormatIndicator: true, - messageExpiryInterval: -4321, - topicAlias: 100, - responseTopic: 'topic', - correlationData: Buffer.from([1, 2, 3, 4]), - userProperties: { - test: 'test' - }, - subscriptionIdentifier: 120, - contentType: 'test' - } -}, { protocolVersion: 5 }) - -testGenerateError('Invalid topicAlias: -100', { - cmd: 'publish', - retain: true, - qos: 2, - dup: true, - length: 60, - topic: 'test', - payload: Buffer.from('test'), - messageId: 10, - properties: { - payloadFormatIndicator: true, - messageExpiryInterval: 4321, - topicAlias: -100, - responseTopic: 'topic', - correlationData: Buffer.from([1, 2, 3, 4]), - userProperties: { - test: 'test' - }, - subscriptionIdentifier: 120, - contentType: 'test' - } -}, { protocolVersion: 5 }) - -testGenerateError('Invalid subscriptionIdentifier: -120', { - cmd: 'publish', - retain: true, - qos: 2, - dup: true, - length: 60, - topic: 'test', - payload: Buffer.from('test'), - messageId: 10, - properties: { - payloadFormatIndicator: true, - messageExpiryInterval: 4321, - topicAlias: 100, - responseTopic: 'topic', - correlationData: Buffer.from([1, 2, 3, 4]), - userProperties: { - test: 'test' - }, - subscriptionIdentifier: -120, - contentType: 'test' - } -}, { protocolVersion: 5 }) - -test('support cork', t => { +test('support cork', function (t) { t.plan(9) - const dest = WS() + var dest = WS() - dest._write = (chunk, enc, cb) => { + dest._write = function (chunk, enc, cb) { t.pass('_write called') cb() } @@ -2620,7 +1136,7 @@ testParseError('Invalid protocolId', Buffer.from([ ])) // CONNECT Packets that contain an unsupported protocol version -// Flag (i.e. not `3` or `4` or '5') should cause an error +// Flag (i.e. not `3` or `4`) should cause an error testParseError('Invalid protocol version', Buffer.from([ 16, 18, 0, 6, @@ -2652,147 +1168,33 @@ testParseError('Cannot parse protocolId', Buffer.from([ 77, 81, 73, 115, 100, 112 ])) -testParseError('Unknown property', Buffer.from([ - 61, 60, // Header - 0, 4, // Topic length - 116, 101, 115, 116, // Topic (test) - 0, 10, // Message ID - 47, // properties length - 126, 1, // unknown property - 2, 0, 0, 16, 225, // message expiry interval - 35, 0, 100, // topicAlias - 8, 0, 5, 116, 111, 112, 105, 99, // response topic - 9, 0, 4, 1, 2, 3, 4, // correlationData - 38, 0, 4, 116, 101, 115, 116, 0, 4, 116, 101, 115, 116, // userProperties - 11, 120, // subscriptionIdentifier - 3, 0, 4, 116, 101, 115, 116, // content type - 116, 101, 115, 116 // Payload (test) -]), { protocolVersion: 5 }) - -testParseError('Not supported auth packet for this version MQTT', Buffer.from([ - 240, 36, // Header - 0, // reason code - 34, // properties length - 21, 0, 4, 116, 101, 115, 116, // auth method - 22, 0, 4, 0, 1, 2, 3, // auth data - 31, 0, 4, 116, 101, 115, 116, // reasonString - 38, 0, 4, 116, 101, 115, 116, 0, 4, 116, 101, 115, 116 // userProperties -])) - // When a Subscribe packet contains a topic_filter and the given // length is topic_filter.length + 1 then the last byte (requested QoS) is interpreted as topic_filter // reading the requested_qos at the end causes 'Index out of range' read testParseError('Malformed Subscribe Payload', Buffer.from([ 130, 14, // subscribe header and remaining length - 0, 123, // packet ID - 0, 10, // topic filter length - 104, 105, 106, 107, 108, 47, 109, 110, 111, // topic filter with length of 9 bytes - 0 // requested QoS + 0, 123, // packet ID + 0, 10, // topic filter length + 104, 105, 106, 107, 108, 47, 109, 110, 111, // topic filter with length of 9 bytes + 0 // requested QoS ])) -test('Cannot parse property code type', t => { - const packets = Buffer.from([ - 16, 16, 0, 4, 77, 81, 84, 84, 5, 2, 0, 60, 3, 33, 0, 20, 0, 0, 98, 2, 211, 1, 224, 2, 0, 32 - ]) - - t.plan(3) - - const parser = mqtt.parser() - - parser.on('error', err => { - t.equal(err.message, 'Cannot parse property code type', 'expected error message') - t.end() - }) - - parser.on('packet', (packet) => { - t.pass('Packet parsed') - }) - - parser.parse(packets) -}) - -testWriteToStreamError('Invalid command', { - cmd: 'invalid' -}) - -testWriteToStreamError('Invalid protocolId', { - cmd: 'connect', - protocolId: {} -}) - -test('userProperties null prototype', t => { - t.plan(3) - - const packet = mqtt.generate({ - cmd: 'connect', - retain: false, - qos: 0, - dup: false, - length: 125, - protocolId: 'MQTT', - protocolVersion: 5, - will: { - retain: true, - qos: 2, - properties: { - willDelayInterval: 1234, - payloadFormatIndicator: false, - messageExpiryInterval: 4321, - contentType: 'test', - responseTopic: 'topic', - correlationData: Buffer.from([1, 2, 3, 4]), - userProperties: { - test: 'test' - } - }, - topic: 'topic', - payload: Buffer.from([4, 3, 2, 1]) - }, - clean: true, - keepalive: 30, - properties: { - sessionExpiryInterval: 1234, - receiveMaximum: 432, - maximumPacketSize: 100, - topicAliasMaximum: 456, - requestResponseInformation: true, - requestProblemInformation: true, - userProperties: { - test: 'test' - }, - authenticationMethod: 'test', - authenticationData: Buffer.from([1, 2, 3, 4]) - }, - clientId: 'test' - }) - - const parser = mqtt.parser() - - parser.on('packet', packet => { - t.equal(packet.cmd, 'connect') - t.equal(Object.getPrototypeOf(packet.properties.userProperties), null) - t.equal(Object.getPrototypeOf(packet.will.properties.userProperties), null) - }) - - parser.parse(packet) -}) - -test('stops parsing after first error', t => { +test('stops parsing after first error', function (t) { t.plan(4) - const parser = mqtt.parser() + var parser = mqtt.parser() - let packetCount = 0 - let errorCount = 0 - let expectedPackets = 1 - let expectedErrors = 1 + var packetCount = 0 + var errorCount = 0 + var expectedPackets = 1 + var expectedErrors = 1 - parser.on('packet', packet => { - t.ok(++packetCount <= expectedPackets, `expected <= ${expectedPackets} packets`) + parser.on('packet', function (packet) { + t.ok(++packetCount <= expectedPackets, 'expected <= ' + expectedPackets + ' packets') }) - parser.on('error', erroneous => { - t.ok(++errorCount <= expectedErrors, `expected <= ${expectedErrors} errors`) + parser.on('error', function (erroneous) { + t.ok(++errorCount <= expectedErrors, 'expected <= ' + expectedErrors + ' errors') }) parser.parse(Buffer.from([ @@ -2850,17 +1252,17 @@ test('stops parsing after first error', t => { ])) }) -testGenerateErrorMultipleCmds([ - 'publish', - 'puback', - 'pubrec', - 'pubrel', - 'subscribe', - 'suback', - 'unsubscribe', - 'unsuback' -], 'Invalid messageId', { - qos: 1, // required for publish - topic: 'test', // required for publish - messageId: 'a' -}, {}) +testWriteToStreamError('Invalid protocolId', { + cmd: 'connect', + protocolId: {} +}) + +testWriteToStreamError('Invalid topic', { + cmd: 'publish', + topic: {} +}) + +testWriteToStreamError('Invalid messageId', { + cmd: 'subscribe', + mid: {} +}) diff --git a/node_modules/mqtt-packet/testRandom.js b/node_modules/mqtt-packet/testRandom.js index 9beff90..c1ae8a2 100644 --- a/node_modules/mqtt-packet/testRandom.js +++ b/node_modules/mqtt-packet/testRandom.js @@ -1,11 +1,15 @@ -const mqtt = require('./') -const crypto = require('crypto') -const max = 1E5 -const start = Date.now() / 1000 +'use strict' + +var mqtt = require('./') +var crypto = require('crypto') +var max = 1E5 +var i +var start = Date.now() / 1000 +var time var errors = 0 var packets = 0 var randomPacket -const firstBytes = [ +var firstBytes = [ 16 * 1, // CONNECT 16 * 2, // CONNACK 16 * 3, // PUBLISH, QoS: 0, No Retain, No Dup @@ -31,11 +35,11 @@ const firstBytes = [ 16 * 12, // PINGREQ 16 * 13, // PINGRESP 16 * 14, // DISCONNECT - 16 * 15 // RESERVED + 16 * 15 // RESERVED ] function doParse () { - const parser = mqtt.parser() + var parser = mqtt.parser() parser.on('error', onError) parser.on('packet', onPacket) @@ -49,7 +53,7 @@ function doParse () { try { console.log('Starting benchmark') - for (let i = 0; i < max; i++) { + for (i = 0; i < max; i++) { doParse() } } catch (e) { @@ -67,8 +71,8 @@ function onPacket () { packets++ } -const delta = Math.abs(max - packets - errors) -const time = Date.now() / 1000 - start +var delta = Math.abs(max - packets - errors) +time = Date.now() / 1000 - start console.log('Benchmark complete') console.log('==========================') console.log('Sent packets:', max) @@ -82,5 +86,5 @@ else console.log('Missing packets:', delta, '\r\n') console.log('Total packets:', packets + errors) console.log('Total errors:', errors + delta) -console.log('Error rate:', `${((errors + delta) / max * 100).toFixed(2)}%`) +console.log('Error rate:', ((errors + delta) / max * 100).toFixed(2) + '%') console.log('==========================') diff --git a/node_modules/mqtt-packet/types/index.d.ts b/node_modules/mqtt-packet/types/index.d.ts index 0bc7465..3b0cba7 100644 --- a/node_modules/mqtt-packet/types/index.d.ts +++ b/node_modules/mqtt-packet/types/index.d.ts @@ -3,8 +3,7 @@ import WritableStream = NodeJS.WritableStream export declare type QoS = 0 | 1 | 2 -export declare type PacketCmd = 'auth' | - 'connack' | +export declare type PacketCmd = 'connack' | 'connect' | 'disconnect' | 'pingreq' | @@ -19,29 +18,16 @@ export declare type PacketCmd = 'auth' | 'unsuback' | 'unsubscribe' -export declare type UserProperties = {[index: string]: string | string[]} - export interface IPacket { cmd: PacketCmd messageId?: number length?: number } -export interface IAuthPacket extends IPacket { - cmd: 'auth' - reasonCode: number, - properties?: { - authenticationMethod?: string, - authenticationData?: Buffer, - reasonString?: string, - userProperties?: UserProperties, - } -} - export interface IConnectPacket extends IPacket { cmd: 'connect' clientId: string - protocolVersion?: 4 | 5 | 3 + protocolVersion?: 4 | 3 protocolId?: 'MQTT' | 'MQIsdp' clean?: boolean keepalive?: number @@ -52,26 +38,6 @@ export interface IConnectPacket extends IPacket { payload: Buffer qos?: QoS retain?: boolean - properties?: { - willDelayInterval?: number, - payloadFormatIndicator?: number, - messageExpiryInterval?: number, - contentType?: string, - responseTopic?: string, - correlationData?: Buffer, - userProperties?: UserProperties - } - } - properties?: { - sessionExpiryInterval?: number, - receiveMaximum?: number, - maximumPacketSize?: number, - topicAliasMaximum?: number, - requestResponseInformation?: boolean, - requestProblemInformation?: boolean, - userProperties?: UserProperties, - authenticationMethod?: string, - authenticationData?: Buffer } } @@ -82,123 +48,52 @@ export interface IPublishPacket extends IPacket { retain: boolean topic: string payload: string | Buffer - properties?: { - payloadFormatIndicator?: boolean, - messageExpiryInterval?: number, - topicAlias?: number, - responseTopic?: string, - correlationData?: Buffer, - userProperties?: UserProperties, - subscriptionIdentifier?: number, - contentType?: string - } } export interface IConnackPacket extends IPacket { cmd: 'connack' - returnCode?: number, - reasonCode?: number, + returnCode: number sessionPresent: boolean - properties?: { - sessionExpiryInterval?: number, - receiveMaximum?: number, - maximumQoS?: number, - retainAvailable?: boolean, - maximumPacketSize?: number, - assignedClientIdentifier?: string, - topicAliasMaximum?: number, - reasonString?: string, - userProperties?: UserProperties, - wildcardSubscriptionAvailable?: boolean, - subscriptionIdentifiersAvailable?: boolean, - sharedSubscriptionAvailable?: boolean, - serverKeepAlive?: number, - responseInformation?: string, - serverReference?: string, - authenticationMethod?: string, - authenticationData?: Buffer - } } export interface ISubscription { topic: string - qos: QoS, - nl?: boolean, - rap?: boolean, - rh?: number + qos: QoS } export interface ISubscribePacket extends IPacket { cmd: 'subscribe' - subscriptions: ISubscription[], - properties?: { - reasonString?: string, - userProperties?: UserProperties - } + subscriptions: ISubscription[] } export interface ISubackPacket extends IPacket { - cmd: 'suback', - reasonCode?: number, - properties?: { - reasonString?: string, - userProperties?: UserProperties - }, - granted: number[] | Object[] + cmd: 'suback' + granted: number[] } export interface IUnsubscribePacket extends IPacket { - cmd: 'unsubscribe', - properties?: { - reasonString?: string, - userProperties?: UserProperties - }, + cmd: 'unsubscribe' unsubscriptions: string[] } export interface IUnsubackPacket extends IPacket { - cmd: 'unsuback', - reasonCode?: number, - properties?: { - reasonString?: string, - userProperties?: UserProperties - } + cmd: 'unsuback' } export interface IPubackPacket extends IPacket { - cmd: 'puback', - reasonCode?: number, - properties?: { - reasonString?: string, - userProperties?: UserProperties - } + cmd: 'puback' } export interface IPubcompPacket extends IPacket { - cmd: 'pubcomp', - reasonCode?: number, - properties?: { - reasonString?: string, - userProperties?: UserProperties - } + cmd: 'pubcomp' } export interface IPubrelPacket extends IPacket { - cmd: 'pubrel', - reasonCode?: number, - properties?: { - reasonString?: string, - userProperties?: UserProperties - } + cmd: 'pubrel' } export interface IPubrecPacket extends IPacket { - cmd: 'pubrec', - reasonCode?: number, - properties?: { - reasonString?: string, - userProperties?: UserProperties - } + cmd: 'pubrec' } export interface IPingreqPacket extends IPacket { @@ -210,14 +105,7 @@ export interface IPingrespPacket extends IPacket { } export interface IDisconnectPacket extends IPacket { - cmd: 'disconnect', - reasonCode?: number, - properties?: { - sessionExpiryInterval?: number, - reasonString?: string, - userProperties?: UserProperties, - serverReference?: string - } + cmd: 'disconnect' } export declare type Packet = IConnectPacket | @@ -233,22 +121,21 @@ export declare type Packet = IConnectPacket | IPingreqPacket | IPingrespPacket | IDisconnectPacket | - IPubrecPacket | - IAuthPacket + IPubrecPacket export interface Parser extends EventEmitter { on(event: 'packet', callback: (packet: Packet) => void): this on(event: 'error', callback: (error: any) => void): this - parse(buffer: Buffer, opts?: Object): number + parse(buffer: Buffer): number } -export declare function parser(opts?: Object): Parser +export declare function parser(): Parser -export declare function generate(packet: Packet, opts?: Object): Buffer +export declare function generate(packet: Packet): Buffer -export declare function writeToStream(object: Packet, stream: WritableStream, opts?: Object): void +export declare function writeToStream(object: Packet, stream: WritableStream): void export declare namespace writeToStream { let cacheNumbers: boolean diff --git a/node_modules/mqtt-packet/writeToStream.js b/node_modules/mqtt-packet/writeToStream.js index e7b6d18..ada150e 100644 --- a/node_modules/mqtt-packet/writeToStream.js +++ b/node_modules/mqtt-packet/writeToStream.js @@ -1,20 +1,19 @@ -const protocol = require('./constants') -const empty = Buffer.allocUnsafe(0) -const zeroBuf = Buffer.from([0]) -const numbers = require('./numbers') -const nextTick = require('process-nextick-args').nextTick -const debug = require('debug')('mqtt-packet:writeToStream') +'use strict' -const numCache = numbers.cache -const generateNumber = numbers.generateNumber -const generateCache = numbers.generateCache -const genBufVariableByteInt = numbers.genBufVariableByteInt -const generate4ByteBuffer = numbers.generate4ByteBuffer -let writeNumber = writeNumberCached -let toGenerate = true +var protocol = require('./constants') +var Buffer = require('safe-buffer').Buffer +var empty = Buffer.allocUnsafe(0) +var zeroBuf = Buffer.from([0]) +var numbers = require('./numbers') +var nextTick = require('process-nextick-args').nextTick -function generate (packet, stream, opts) { - debug('generate called') +var numCache = numbers.cache +var generateNumber = numbers.generateNumber +var generateCache = numbers.generateCache +var writeNumber = writeNumberCached +var toGenerate = true + +function generate (packet, stream) { if (stream.cork) { stream.cork() nextTick(uncork, stream) @@ -24,34 +23,30 @@ function generate (packet, stream, opts) { toGenerate = false generateCache() } - debug('generate: packet.cmd: %s', packet.cmd) + switch (packet.cmd) { case 'connect': - return connect(packet, stream, opts) + return connect(packet, stream) case 'connack': - return connack(packet, stream, opts) + return connack(packet, stream) case 'publish': - return publish(packet, stream, opts) + return publish(packet, stream) case 'puback': case 'pubrec': case 'pubrel': case 'pubcomp': - return confirmation(packet, stream, opts) - case 'subscribe': - return subscribe(packet, stream, opts) - case 'suback': - return suback(packet, stream, opts) - case 'unsubscribe': - return unsubscribe(packet, stream, opts) case 'unsuback': - return unsuback(packet, stream, opts) + return confirmation(packet, stream) + case 'subscribe': + return subscribe(packet, stream) + case 'suback': + return suback(packet, stream) + case 'unsubscribe': + return unsubscribe(packet, stream) case 'pingreq': case 'pingresp': - return emptyPacket(packet, stream, opts) case 'disconnect': - return disconnect(packet, stream, opts) - case 'auth': - return auth(packet, stream, opts) + return emptyPacket(packet, stream) default: stream.emit('error', new Error('Unknown command')) return false @@ -62,10 +57,10 @@ function generate (packet, stream, opts) { * Set to "false" to allocate buffers on-the-flight instead of pre-generated cache */ Object.defineProperty(generate, 'cacheNumbers', { - get () { + get: function () { return writeNumber === writeNumberCached }, - set (value) { + set: function (value) { if (value) { if (!numCache || Object.keys(numCache).length === 0) toGenerate = true writeNumber = writeNumberCached @@ -80,22 +75,20 @@ function uncork (stream) { stream.uncork() } -function connect (packet, stream, opts) { - const settings = packet || {} - const protocolId = settings.protocolId || 'MQTT' - let protocolVersion = settings.protocolVersion || 4 - const will = settings.will - let clean = settings.clean - const keepalive = settings.keepalive || 0 - const clientId = settings.clientId || '' - const username = settings.username - const password = settings.password - /* mqtt5 new oprions */ - const properties = settings.properties +function connect (opts, stream) { + var settings = opts || {} + var protocolId = settings.protocolId || 'MQTT' + var protocolVersion = settings.protocolVersion || 4 + var will = settings.will + var clean = settings.clean + var keepalive = settings.keepalive || 0 + var clientId = settings.clientId || '' + var username = settings.username + var password = settings.password if (clean === undefined) clean = true - let length = 0 + var length = 0 // Must be a string and non-falsy if (!protocolId || @@ -104,16 +97,16 @@ function connect (packet, stream, opts) { return false } else length += protocolId.length + 2 - // Must be 3 or 4 or 5 - if (protocolVersion !== 3 && protocolVersion !== 4 && protocolVersion !== 5) { + // Must be 3 or 4 + if (protocolVersion !== 3 && protocolVersion !== 4) { stream.emit('error', new Error('Invalid protocol version')) return false } else length += 1 - // ClientId might be omitted in 3.1.1 and 5, but only if cleanSession is set to 1 + // ClientId might be omitted in 3.1.1, but only if cleanSession is set to 1 if ((typeof clientId === 'string' || Buffer.isBuffer(clientId)) && - (clientId || protocolVersion >= 4) && (clientId || clean)) { - length += Buffer.byteLength(clientId) + 2 + (clientId || protocolVersion === 4) && (clientId || clean)) { + length += clientId.length + 2 } else { if (protocolVersion < 4) { stream.emit('error', new Error('clientId must be supplied before 3.1.1')) @@ -137,13 +130,6 @@ function connect (packet, stream, opts) { // Connect flags length += 1 - // Properties - if (protocolVersion === 5) { - var propertiesData = getProperties(stream, properties) - if (!propertiesData) { return false } - length += propertiesData.length - } - // If will exists... if (will) { // It must be an object @@ -160,30 +146,24 @@ function connect (packet, stream, opts) { } // Payload - length += 2 // payload length - if (will.payload) { + if (will.payload && will.payload) { if (will.payload.length >= 0) { if (typeof will.payload === 'string') { - length += Buffer.byteLength(will.payload) + length += Buffer.byteLength(will.payload) + 2 } else { - length += will.payload.length + length += will.payload.length + 2 } } else { stream.emit('error', new Error('Invalid will payload')) return false } - } - // will properties - var willProperties = {} - if (protocolVersion === 5) { - willProperties = getProperties(stream, will.properties) - if (!willProperties) { return false } - length += willProperties.length + } else { + length += 2 } } // Username - let providedUsername = false + var providedUsername = false if (username != null) { if (isStringOrBuffer(username)) { providedUsername = true @@ -213,29 +193,16 @@ function connect (packet, stream, opts) { stream.write(protocol.CONNECT_HEADER) // Generate length - writeVarByteInt(stream, length) + writeLength(stream, length) // Generate protocol ID writeStringOrBuffer(stream, protocolId) - - if (settings.bridgeMode) { - protocolVersion += 128 - } - stream.write( - protocolVersion === 131 - ? protocol.VERSION131 - : protocolVersion === 132 - ? protocol.VERSION132 - : protocolVersion === 4 - ? protocol.VERSION4 - : protocolVersion === 5 - ? protocol.VERSION5 - : protocol.VERSION3 + protocolVersion === 4 ? protocol.VERSION4 : protocol.VERSION3 ) // Connect flags - let flags = 0 + var flags = 0 flags |= (username != null) ? protocol.USERNAME_MASK : 0 flags |= (password != null) ? protocol.PASSWORD_MASK : 0 flags |= (will && will.retain) ? protocol.WILL_RETAIN_MASK : 0 @@ -248,19 +215,11 @@ function connect (packet, stream, opts) { // Keepalive writeNumber(stream, keepalive) - // Properties - if (protocolVersion === 5) { - propertiesData.write() - } - // Client ID writeStringOrBuffer(stream, clientId) // Will if (will) { - if (protocolVersion === 5) { - willProperties.write() - } writeString(stream, will.topic) writeStringOrBuffer(stream, will.payload) } @@ -277,50 +236,32 @@ function connect (packet, stream, opts) { return true } -function connack (packet, stream, opts) { - const version = opts ? opts.protocolVersion : 4 - const settings = packet || {} - const rc = version === 5 ? settings.reasonCode : settings.returnCode - const properties = settings.properties - let length = 2 // length of rc and sessionHeader +function connack (opts, stream) { + var settings = opts || {} + var rc = settings.returnCode // Check return code if (typeof rc !== 'number') { stream.emit('error', new Error('Invalid return code')) return false } - // mqtt5 properties - let propertiesData = null - if (version === 5) { - propertiesData = getProperties(stream, properties) - if (!propertiesData) { return false } - length += propertiesData.length - } stream.write(protocol.CONNACK_HEADER) - // length - writeVarByteInt(stream, length) - stream.write(settings.sessionPresent ? protocol.SESSIONPRESENT_HEADER : zeroBuf) + writeLength(stream, 2) + stream.write(opts.sessionPresent ? protocol.SESSIONPRESENT_HEADER : zeroBuf) - stream.write(Buffer.from([rc])) - if (propertiesData != null) { - propertiesData.write() - } - return true + return stream.write(Buffer.from([rc])) } -function publish (packet, stream, opts) { - debug('publish: packet: %o', packet) - const version = opts ? opts.protocolVersion : 4 - const settings = packet || {} - const qos = settings.qos || 0 - const retain = settings.retain ? protocol.RETAIN_MASK : 0 - const topic = settings.topic - const payload = settings.payload || empty - const id = settings.messageId - const properties = settings.properties +function publish (opts, stream) { + var settings = opts || {} + var qos = settings.qos || 0 + var retain = settings.retain ? protocol.RETAIN_MASK : 0 + var topic = settings.topic + var payload = settings.payload || empty + var id = settings.messageId - let length = 0 + var length = 0 // Topic must be a non-empty string or Buffer if (typeof topic === 'string') length += Buffer.byteLength(topic) + 2 @@ -340,19 +281,11 @@ function publish (packet, stream, opts) { return false } else if (qos) length += 2 - // mqtt5 properties - let propertiesData = null - if (version === 5) { - propertiesData = getProperties(stream, properties) - if (!propertiesData) { return false } - length += propertiesData.length - } - // Header - stream.write(protocol.PUBLISH_HEADER[qos][settings.dup ? 1 : 0][retain ? 1 : 0]) + stream.write(protocol.PUBLISH_HEADER[qos][opts.dup ? 1 : 0][retain ? 1 : 0]) // Remaining length - writeVarByteInt(stream, length) + writeLength(stream, length) // Topic writeNumber(stream, byteLength(topic)) @@ -361,27 +294,17 @@ function publish (packet, stream, opts) { // Message ID if (qos > 0) writeNumber(stream, id) - // Properties - if (propertiesData != null) { - propertiesData.write() - } - // Payload - debug('publish: payload: %o', payload) return stream.write(payload) } /* Puback, pubrec, pubrel and pubcomp */ -function confirmation (packet, stream, opts) { - const version = opts ? opts.protocolVersion : 4 - const settings = packet || {} - const type = settings.cmd || 'puback' - const id = settings.messageId - const dup = (settings.dup && type === 'pubrel') ? protocol.DUP_MASK : 0 - let qos = 0 - const reasonCode = settings.reasonCode - const properties = settings.properties - let length = version === 5 ? 3 : 2 +function confirmation (opts, stream) { + var settings = opts || {} + var type = settings.cmd || 'puback' + var id = settings.messageId + var dup = (settings.dup && type === 'pubrel') ? protocol.DUP_MASK : 0 + var qos = 0 if (type === 'pubrel') qos = 1 @@ -391,48 +314,23 @@ function confirmation (packet, stream, opts) { return false } - // properies mqtt 5 - let propertiesData = null - if (version === 5) { - // Confirm should not add empty property length with no properties (rfc 3.4.2.2.1) - if (typeof properties === 'object') { - propertiesData = getPropertiesByMaximumPacketSize(stream, properties, opts, length) - if (!propertiesData) { return false } - length += propertiesData.length - } - } - // Header stream.write(protocol.ACKS[type][qos][dup][0]) // Length - writeVarByteInt(stream, length) + writeLength(stream, 2) // Message ID - writeNumber(stream, id) - - // reason code in header - if (version === 5) { - stream.write(Buffer.from([reasonCode])) - } - - // properies mqtt 5 - if (propertiesData !== null) { - propertiesData.write() - } - return true + return writeNumber(stream, id) } -function subscribe (packet, stream, opts) { - debug('subscribe: packet: ') - const version = opts ? opts.protocolVersion : 4 - const settings = packet || {} - const dup = settings.dup ? protocol.DUP_MASK : 0 - const id = settings.messageId - const subs = settings.subscriptions - const properties = settings.properties +function subscribe (opts, stream) { + var settings = opts || {} + var dup = settings.dup ? protocol.DUP_MASK : 0 + var id = settings.messageId + var subs = settings.subscriptions - let length = 0 + var length = 0 // Check message ID if (typeof id !== 'number') { @@ -440,19 +338,11 @@ function subscribe (packet, stream, opts) { return false } else length += 2 - // properies mqtt 5 - let propertiesData = null - if (version === 5) { - propertiesData = getProperties(stream, properties) - if (!propertiesData) { return false } - length += propertiesData.length - } - // Check subscriptions if (typeof subs === 'object' && subs.length) { - for (let i = 0; i < subs.length; i += 1) { - const itopic = subs[i].topic - const iqos = subs[i].qos + for (var i = 0; i < subs.length; i += 1) { + var itopic = subs[i].topic + var iqos = subs[i].qos if (typeof itopic !== 'string') { stream.emit('error', new Error('Invalid subscriptions - invalid topic')) @@ -463,24 +353,6 @@ function subscribe (packet, stream, opts) { return false } - if (version === 5) { - const nl = subs[i].nl || false - if (typeof nl !== 'boolean') { - stream.emit('error', new Error('Invalid subscriptions - invalid No Local')) - return false - } - const rap = subs[i].rap || false - if (typeof rap !== 'boolean') { - stream.emit('error', new Error('Invalid subscriptions - invalid Retain as Published')) - return false - } - const rh = subs[i].rh || 0 - if (typeof rh !== 'number' || rh > 2) { - stream.emit('error', new Error('Invalid subscriptions - invalid Retain Handling')) - return false - } - } - length += Buffer.byteLength(itopic) + 2 + 1 } } else { @@ -489,55 +361,38 @@ function subscribe (packet, stream, opts) { } // Generate header - debug('subscribe: writing to stream: %o', protocol.SUBSCRIBE_HEADER) stream.write(protocol.SUBSCRIBE_HEADER[1][dup ? 1 : 0][0]) // Generate length - writeVarByteInt(stream, length) + writeLength(stream, length) // Generate message ID writeNumber(stream, id) - // properies mqtt 5 - if (propertiesData !== null) { - propertiesData.write() - } - - let result = true + var result = true // Generate subs - for (const sub of subs) { - const jtopic = sub.topic - const jqos = sub.qos - const jnl = +sub.nl - const jrap = +sub.rap - const jrh = sub.rh - let joptions + for (var j = 0; j < subs.length; j++) { + var sub = subs[j] + var jtopic = sub.topic + var jqos = sub.qos // Write topic string writeString(stream, jtopic) - // options process - joptions = protocol.SUBSCRIBE_OPTIONS_QOS[jqos] - if (version === 5) { - joptions |= jnl ? protocol.SUBSCRIBE_OPTIONS_NL : 0 - joptions |= jrap ? protocol.SUBSCRIBE_OPTIONS_RAP : 0 - joptions |= jrh ? protocol.SUBSCRIBE_OPTIONS_RH[jrh] : 0 - } - // Write options - result = stream.write(Buffer.from([joptions])) + // Write qos + result = stream.write(protocol.QOS[jqos]) } return result } -function suback (packet, stream, opts) { - const version = opts ? opts.protocolVersion : 4 - const settings = packet || {} - const id = settings.messageId - const granted = settings.granted - const properties = settings.properties - let length = 0 +function suback (opts, stream) { + var settings = opts || {} + var id = settings.messageId + var granted = settings.granted + + var length = 0 // Check message ID if (typeof id !== 'number') { @@ -547,7 +402,7 @@ function suback (packet, stream, opts) { // Check granted qos vector if (typeof granted === 'object' && granted.length) { - for (let i = 0; i < granted.length; i += 1) { + for (var i = 0; i < granted.length; i += 1) { if (typeof granted[i] !== 'number') { stream.emit('error', new Error('Invalid qos vector')) return false @@ -559,40 +414,25 @@ function suback (packet, stream, opts) { return false } - // properies mqtt 5 - let propertiesData = null - if (version === 5) { - propertiesData = getPropertiesByMaximumPacketSize(stream, properties, opts, length) - if (!propertiesData) { return false } - length += propertiesData.length - } - // header stream.write(protocol.SUBACK_HEADER) // Length - writeVarByteInt(stream, length) + writeLength(stream, length) // Message ID writeNumber(stream, id) - // properies mqtt 5 - if (propertiesData !== null) { - propertiesData.write() - } - return stream.write(Buffer.from(granted)) } -function unsubscribe (packet, stream, opts) { - const version = opts ? opts.protocolVersion : 4 - const settings = packet || {} - const id = settings.messageId - const dup = settings.dup ? protocol.DUP_MASK : 0 - const unsubs = settings.unsubscriptions - const properties = settings.properties +function unsubscribe (opts, stream) { + var settings = opts || {} + var id = settings.messageId + var dup = settings.dup ? protocol.DUP_MASK : 0 + var unsubs = settings.unsubscriptions - let length = 0 + var length = 0 // Check message ID if (typeof id !== 'number') { @@ -603,7 +443,7 @@ function unsubscribe (packet, stream, opts) { } // Check unsubs if (typeof unsubs === 'object' && unsubs.length) { - for (let i = 0; i < unsubs.length; i += 1) { + for (var i = 0; i < unsubs.length; i += 1) { if (typeof unsubs[i] !== 'string') { stream.emit('error', new Error('Invalid unsubscriptions')) return false @@ -614,170 +454,61 @@ function unsubscribe (packet, stream, opts) { stream.emit('error', new Error('Invalid unsubscriptions')) return false } - // properies mqtt 5 - let propertiesData = null - if (version === 5) { - propertiesData = getProperties(stream, properties) - if (!propertiesData) { return false } - length += propertiesData.length - } // Header stream.write(protocol.UNSUBSCRIBE_HEADER[1][dup ? 1 : 0][0]) // Length - writeVarByteInt(stream, length) + writeLength(stream, length) // Message ID writeNumber(stream, id) - // properies mqtt 5 - if (propertiesData !== null) { - propertiesData.write() - } - // Unsubs - let result = true - for (let j = 0; j < unsubs.length; j++) { + var result = true + for (var j = 0; j < unsubs.length; j++) { result = writeString(stream, unsubs[j]) } return result } -function unsuback (packet, stream, opts) { - const version = opts ? opts.protocolVersion : 4 - const settings = packet || {} - const id = settings.messageId - const dup = settings.dup ? protocol.DUP_MASK : 0 - const granted = settings.granted - const properties = settings.properties - const type = settings.cmd - const qos = 0 - - let length = 2 - - // Check message ID - if (typeof id !== 'number') { - stream.emit('error', new Error('Invalid messageId')) - return false - } - - // Check granted - if (version === 5) { - if (typeof granted === 'object' && granted.length) { - for (let i = 0; i < granted.length; i += 1) { - if (typeof granted[i] !== 'number') { - stream.emit('error', new Error('Invalid qos vector')) - return false - } - length += 1 - } - } else { - stream.emit('error', new Error('Invalid qos vector')) - return false - } - } - - // properies mqtt 5 - let propertiesData = null - if (version === 5) { - propertiesData = getPropertiesByMaximumPacketSize(stream, properties, opts, length) - if (!propertiesData) { return false } - length += propertiesData.length - } - - // Header - stream.write(protocol.ACKS[type][qos][dup][0]) - - // Length - writeVarByteInt(stream, length) - - // Message ID - writeNumber(stream, id) - - // properies mqtt 5 - if (propertiesData !== null) { - propertiesData.write() - } - - // payload - if (version === 5) { - stream.write(Buffer.from(granted)) - } - return true -} - -function emptyPacket (packet, stream, opts) { - return stream.write(protocol.EMPTY[packet.cmd]) -} - -function disconnect (packet, stream, opts) { - const version = opts ? opts.protocolVersion : 4 - const settings = packet || {} - const reasonCode = settings.reasonCode - const properties = settings.properties - let length = version === 5 ? 1 : 0 - - // properies mqtt 5 - let propertiesData = null - if (version === 5) { - propertiesData = getPropertiesByMaximumPacketSize(stream, properties, opts, length) - if (!propertiesData) { return false } - length += propertiesData.length - } - - // Header - stream.write(Buffer.from([protocol.codes.disconnect << 4])) - - // Length - writeVarByteInt(stream, length) - - // reason code in header - if (version === 5) { - stream.write(Buffer.from([reasonCode])) - } - - // properies mqtt 5 - if (propertiesData !== null) { - propertiesData.write() - } - - return true -} - -function auth (packet, stream, opts) { - const version = opts ? opts.protocolVersion : 4 - const settings = packet || {} - const reasonCode = settings.reasonCode - const properties = settings.properties - let length = version === 5 ? 1 : 0 - - if (version !== 5) stream.emit('error', new Error('Invalid mqtt version for auth packet')) - - // properies mqtt 5 - const propertiesData = getPropertiesByMaximumPacketSize(stream, properties, opts, length) - if (!propertiesData) { return false } - length += propertiesData.length - - // Header - stream.write(Buffer.from([protocol.codes.auth << 4])) - - // Length - writeVarByteInt(stream, length) - - // reason code in header - stream.write(Buffer.from([reasonCode])) - - // properies mqtt 5 - if (propertiesData !== null) { - propertiesData.write() - } - return true +function emptyPacket (opts, stream) { + return stream.write(protocol.EMPTY[opts.cmd]) } /** - * writeVarByteInt - write an MQTT style variable byte integer to the buffer + * calcLengthLength - calculate the length of the remaining + * length field + * + * @api private + */ +function calcLengthLength (length) { + if (length >= 0 && length < 128) return 1 + else if (length >= 128 && length < 16384) return 2 + else if (length >= 16384 && length < 2097152) return 3 + else if (length >= 2097152 && length < 268435456) return 4 + else return 0 +} + +function genBufLength (length) { + var digit = 0 + var pos = 0 + var buffer = Buffer.allocUnsafe(calcLengthLength(length)) + + do { + digit = length % 128 | 0 + length = length / 128 | 0 + if (length > 0) digit = digit | 0x80 + + buffer.writeUInt8(digit, pos++) + } while (length > 0) + + return buffer +} + +/** + * writeLength - write an MQTT style length field to the buffer * * @param buffer - destination * @param pos - offset @@ -787,21 +518,16 @@ function auth (packet, stream, opts) { * @api private */ -const varByteIntCache = {} -function writeVarByteInt (stream, num) { - if (num > protocol.VARBYTEINT_MAX) { - stream.emit('error', new Error(`Invalid variable byte integer: ${num}`)) - return false - } - - let buffer = varByteIntCache[num] +var lengthCache = {} +function writeLength (stream, length) { + var buffer = lengthCache[length] if (!buffer) { - buffer = genBufVariableByteInt(num) - if (num < 16384) varByteIntCache[num] = buffer + buffer = genBufLength(length) + if (length < 16384) lengthCache[length] = buffer } - debug('writeVarByteInt: writing to stream: %o', buffer) - return stream.write(buffer) + + stream.write(buffer) } /** @@ -816,26 +542,10 @@ function writeVarByteInt (stream, num) { */ function writeString (stream, string) { - const strlen = Buffer.byteLength(string) + var strlen = Buffer.byteLength(string) writeNumber(stream, strlen) - debug('writeString: %s', string) - return stream.write(string, 'utf8') -} - -/** - * writeStringPair - write a utf8 string pairs to the buffer - * - * @param buffer - destination - * @param name - string name to write - * @param value - string value to write - * @return number of bytes written - * - * @api private - */ -function writeStringPair (stream, name, value) { - writeString(stream, name) - writeString(stream, value) + stream.write(string, 'utf8') } /** @@ -849,20 +559,12 @@ function writeStringPair (stream, name, value) { * @api private */ function writeNumberCached (stream, number) { - debug('writeNumberCached: number: %d', number) - debug('writeNumberCached: %o', numCache[number]) return stream.write(numCache[number]) } function writeNumberGenerated (stream, number) { - const generatedNumber = generateNumber(number) - debug('writeNumberGenerated: %o', generatedNumber) - return stream.write(generatedNumber) -} -function write4ByteNumber (stream, number) { - const generated4ByteBuffer = generate4ByteBuffer(number) - debug('write4ByteNumber: %o', generated4ByteBuffer) - return stream.write(generated4ByteBuffer) + return stream.write(generateNumber(number)) } + /** * writeStringOrBuffer - write a String or Buffer with the its length prefix * @@ -880,230 +582,6 @@ function writeStringOrBuffer (stream, toWrite) { } else writeNumber(stream, 0) } -function getProperties (stream, properties) { - /* connect properties */ - if (typeof properties !== 'object' || properties.length != null) { - return { - length: 1, - write () { - writeProperties(stream, {}, 0) - } - } - } - let propertiesLength = 0 - function getLengthProperty (name, value) { - const type = protocol.propertiesTypes[name] - let length = 0 - switch (type) { - case 'byte': { - if (typeof value !== 'boolean') { - stream.emit('error', new Error(`Invalid ${name}: ${value}`)) - return false - } - length += 1 + 1 - break - } - case 'int8': { - if (typeof value !== 'number' || value < 0 || value > 0xff) { - stream.emit('error', new Error(`Invalid ${name}: ${value}`)) - return false - } - length += 1 + 1 - break - } - case 'binary': { - if (value && value === null) { - stream.emit('error', new Error(`Invalid ${name}: ${value}`)) - return false - } - length += 1 + Buffer.byteLength(value) + 2 - break - } - case 'int16': { - if (typeof value !== 'number' || value < 0 || value > 0xffff) { - stream.emit('error', new Error(`Invalid ${name}: ${value}`)) - return false - } - length += 1 + 2 - break - } - case 'int32': { - if (typeof value !== 'number' || value < 0 || value > 0xffffffff) { - stream.emit('error', new Error(`Invalid ${name}: ${value}`)) - return false - } - length += 1 + 4 - break - } - case 'var': { - // var byte integer is max 24 bits packed in 32 bits - if (typeof value !== 'number' || value < 0 || value > 0x0fffffff) { - stream.emit('error', new Error(`Invalid ${name}: ${value}`)) - return false - } - length += 1 + Buffer.byteLength(genBufVariableByteInt(value)) - break - } - case 'string': { - if (typeof value !== 'string') { - stream.emit('error', new Error(`Invalid ${name}: ${value}`)) - return false - } - length += 1 + 2 + Buffer.byteLength(value.toString()) - break - } - case 'pair': { - if (typeof value !== 'object') { - stream.emit('error', new Error(`Invalid ${name}: ${value}`)) - return false - } - length += Object.getOwnPropertyNames(value).reduce((result, name) => { - const currentValue = value[name] - if (Array.isArray(currentValue)) { - result += currentValue.reduce((currentLength, value) => { - currentLength += 1 + 2 + Buffer.byteLength(name.toString()) + 2 + Buffer.byteLength(value.toString()) - return currentLength - }, 0) - } else { - result += 1 + 2 + Buffer.byteLength(name.toString()) + 2 + Buffer.byteLength(value[name].toString()) - } - return result - }, 0) - break - } - default: { - stream.emit('error', new Error(`Invalid property ${name}: ${value}`)) - return false - } - } - return length - } - if (properties) { - for (const propName in properties) { - let propLength = 0 - let propValueLength = 0 - const propValue = properties[propName] - if (Array.isArray(propValue)) { - for (let valueIndex = 0; valueIndex < propValue.length; valueIndex++) { - propValueLength = getLengthProperty(propName, propValue[valueIndex]) - if (!propValueLength) { return false } - propLength += propValueLength - } - } else { - propValueLength = getLengthProperty(propName, propValue) - if (!propValueLength) { return false } - propLength = propValueLength - } - if (!propLength) return false - propertiesLength += propLength - } - } - const propertiesLengthLength = Buffer.byteLength(genBufVariableByteInt(propertiesLength)) - - return { - length: propertiesLengthLength + propertiesLength, - write () { - writeProperties(stream, properties, propertiesLength) - } - } -} - -function getPropertiesByMaximumPacketSize (stream, properties, opts, length) { - const mayEmptyProps = ['reasonString', 'userProperties'] - const maximumPacketSize = opts && opts.properties && opts.properties.maximumPacketSize ? opts.properties.maximumPacketSize : 0 - - let propertiesData = getProperties(stream, properties) - if (maximumPacketSize) { - while (length + propertiesData.length > maximumPacketSize) { - const currentMayEmptyProp = mayEmptyProps.shift() - if (currentMayEmptyProp && properties[currentMayEmptyProp]) { - delete properties[currentMayEmptyProp] - propertiesData = getProperties(stream, properties) - } else { - return false - } - } - } - return propertiesData -} - -function writeProperty (stream, propName, value) { - const type = protocol.propertiesTypes[propName] - switch (type) { - case 'byte': { - stream.write(Buffer.from([protocol.properties[propName]])) - stream.write(Buffer.from([+value])) - break - } - case 'int8': { - stream.write(Buffer.from([protocol.properties[propName]])) - stream.write(Buffer.from([value])) - break - } - case 'binary': { - stream.write(Buffer.from([protocol.properties[propName]])) - writeStringOrBuffer(stream, value) - break - } - case 'int16': { - stream.write(Buffer.from([protocol.properties[propName]])) - writeNumber(stream, value) - break - } - case 'int32': { - stream.write(Buffer.from([protocol.properties[propName]])) - write4ByteNumber(stream, value) - break - } - case 'var': { - stream.write(Buffer.from([protocol.properties[propName]])) - writeVarByteInt(stream, value) - break - } - case 'string': { - stream.write(Buffer.from([protocol.properties[propName]])) - writeString(stream, value) - break - } - case 'pair': { - Object.getOwnPropertyNames(value).forEach(name => { - const currentValue = value[name] - if (Array.isArray(currentValue)) { - currentValue.forEach(value => { - stream.write(Buffer.from([protocol.properties[propName]])) - writeStringPair(stream, name.toString(), value.toString()) - }) - } else { - stream.write(Buffer.from([protocol.properties[propName]])) - writeStringPair(stream, name.toString(), currentValue.toString()) - } - }) - break - } - default: { - stream.emit('error', new Error(`Invalid property ${propName} value: ${value}`)) - return false - } - } -} - -function writeProperties (stream, properties, propertiesLength) { - /* write properties to stream */ - writeVarByteInt(stream, propertiesLength) - for (const propName in properties) { - if (Object.prototype.hasOwnProperty.call(properties, propName) && properties[propName] !== null) { - const value = properties[propName] - if (Array.isArray(value)) { - for (let valueIndex = 0; valueIndex < value.length; valueIndex++) { - writeProperty(stream, propName, value[valueIndex]) - } - } else { - writeProperty(stream, propName, value) - } - } - } -} - function byteLength (bufOrString) { if (!bufOrString) return 0 else if (bufOrString instanceof Buffer) return bufOrString.length diff --git a/node_modules/mqtt/README.md b/node_modules/mqtt/README.md index 389ad6e..a17fd85 100644 --- a/node_modules/mqtt/README.md +++ b/node_modules/mqtt/README.md @@ -56,8 +56,6 @@ which are `Buffer`. Another __breaking change__ is that MQTT.js now defaults to MQTT v3.1.1, so to support old brokers, please read the [client options doc](#client). -MQTT v5 support is experimental as it has not been implemented by brokers yet. - ## Installation @@ -214,36 +212,12 @@ the `connect` event. Typically a `net.Socket`. * `incomingStore`: a [Store](#store) for the incoming packets * `outgoingStore`: a [Store](#store) for the outgoing packets * `queueQoSZero`: if connection is broken, queue outgoing QoS zero messages (default `true`) - * `customHandleAcks`: MQTT 5 feature of custom handling puback and pubrec packets. Its callback: - ```js - customHandleAcks: function(topic, message, packet, done) {*some logic wit colling done(error, reasonCode)*} - ``` - * `properties`: properties MQTT 5.0. - `object` that supports the following properties: - * `sessionExpiryInterval`: representing the Session Expiry Interval in seconds `number`, - * `receiveMaximum`: representing the Receive Maximum value `number`, - * `maximumPacketSize`: representing the Maximum Packet Size the Client is willing to accept `number`, - * `topicAliasMaximum`: representing the Topic Alias Maximum value indicates the highest value that the Client will accept as a Topic Alias sent by the Server `number`, - * `requestResponseInformation`: The Client uses this value to request the Server to return Response Information in the CONNACK `boolean`, - * `requestProblemInformation`: The Client uses this value to indicate whether the Reason String or User Properties are sent in the case of failures `boolean`, - * `userProperties`: The User Property is allowed to appear multiple times to represent multiple name, value pairs `object`, - * `authenticationMethod`: the name of the authentication method used for extended authentication `string`, - * `authenticationData`: Binary Data containing authentication data `binary` - * `authPacket`: settings for auth packet `object` * `will`: a message that will sent by the broker automatically when the client disconnect badly. The format is: * `topic`: the topic to publish * `payload`: the message to publish * `qos`: the QoS * `retain`: the retain flag - * `properties`: properties of will by MQTT 5.0: - * `willDelayInterval`: representing the Will Delay Interval in seconds `number`, - * `payloadFormatIndicator`: Will Message is UTF-8 Encoded Character Data or not `boolean`, - * `messageExpiryInterval`: value is the lifetime of the Will Message in seconds and is sent as the Publication Expiry Interval when the Server publishes the Will Message `number`, - * `contentType`: describing the content of the Will Message `string`, - * `responseTopic`: String which is used as the Topic Name for a response message `string`, - * `correlationData`: The Correlation Data is used by the sender of the Request Message to identify which request the Response Message is for when it is received `binary`, - * `userProperties`: The User Property is allowed to appear multiple times to represent multiple name, value pairs `object` * `transformWsUrl` : optional `(url, options, client) => url` function For ws/wss protocols only. Can be used to implement signing urls which upon reconnect can have become expired. @@ -291,12 +265,6 @@ Emitted when a reconnect starts. Emitted after a disconnection. -#### Event `'disconnect'` - -`function (packet) {}` - -Emitted after receiving disconnect packet from broker. MQTT 5.0 feature. - #### Event `'offline'` `function () {}` @@ -359,16 +327,6 @@ Publish a message to a topic * `qos` QoS level, `Number`, default `0` * `retain` retain flag, `Boolean`, default `false` * `dup` mark as duplicate flag, `Boolean`, default `false` - * `properties`: MQTT 5.0 properties `object` - * `payloadFormatIndicator`: Payload is UTF-8 Encoded Character Data or not `boolean`, - * `messageExpiryInterval`: the lifetime of the Application Message in seconds `number`, - * `topicAlias`: value that is used to identify the Topic instead of using the Topic Name `number`, - * `responseTopic`: String which is used as the Topic Name for a response message `string`, - * `correlationData`: used by the sender of the Request Message to identify which request the Response Message is for when it is received `binary`, - * `userProperties`: The User Property is allowed to appear multiple times to represent multiple name, value pairs `object`, - * `subscriptionIdentifier`: representing the identifier of the subscription `number`, - * `contentType`: String describing the content of the Application Message `string` - * `cbStorePut` - `function ()`, fired when message is put into `outgoingStore` if QoS is `1` or `2`. * `callback` - `function (err)`, fired when the QoS handling completes, or at the next tick if QoS 0. An error occurs if client is disconnecting. @@ -380,16 +338,10 @@ Subscribe to a topic or topics * `topic` is a `String` topic to subscribe to or an `Array` of topics to subscribe to. It can also be an object, it has as object - keys the topic name and as value the QoS, like `{'test1': {qos: 0}, 'test2': {qos: 1}}`. + keys the topic name and as value the QoS, like `{'test1': 0, 'test2': 1}`. MQTT `topic` wildcard characters are supported (`+` - for single level and `#` - for multi level) * `options` is the options to subscribe with, including: * `qos` qos subscription level, default 0 - * `nl` No Local MQTT 5.0 flag (If the value is true, Application Messages MUST NOT be forwarded to a connection with a ClientID equal to the ClientID of the publishing connection) - * `rap` Retain as Published MQTT 5.0 flag (If true, Application Messages forwarded using this subscription keep the RETAIN flag they were published with. If false, Application Messages forwarded using this subscription have the RETAIN flag set to 0.) - * `rh` Retain Handling MQTT 5.0 (This option specifies whether retained messages are sent when the subscription is established.) - * `properties`: `object` - * `subscriptionIdentifier`: representing the identifier of the subscription `number`, - * `userProperties`: The User Property is allowed to appear multiple times to represent multiple name, value pairs `object` * `callback` - `function (err, granted)` callback fired on suback where: * `err` a subscription error or an error that occurs when client is disconnecting @@ -399,32 +351,22 @@ Subscribe to a topic or topics ------------------------------------------------------- -### mqtt.Client#unsubscribe(topic/topic array, [options], [callback]) +### mqtt.Client#unsubscribe(topic/topic array, [callback]) Unsubscribe from a topic or topics * `topic` is a `String` topic or an array of topics to unsubscribe from -* `options`: options of unsubscribe. - * `properties`: `object` - * `userProperties`: The User Property is allowed to appear multiple times to represent multiple name, value pairs `object` * `callback` - `function (err)`, fired on unsuback. An error occurs if client is disconnecting. ------------------------------------------------------- -### mqtt.Client#end([force], [options], [cb]) +### mqtt.Client#end([force], [cb]) Close the client, accepts the following options: * `force`: passing it to true will close the client right away, without waiting for the in-flight messages to be acked. This parameter is optional. -* `options`: options of disconnect. - * `reasonCode`: Disconnect Reason Code `number` - * `properties`: `object` - * `sessionExpiryInterval`: representing the Session Expiry Interval in seconds `number`, - * `reasonString`: representing the reason for the disconnect `string`, - * `userProperties`: The User Property is allowed to appear multiple times to represent multiple name, value pairs `object`, - * `serverReference`: String which can be used by the Client to identify another Server to use `string` * `cb`: will be called when the client is closed. This parameter is optional. @@ -531,40 +473,22 @@ at https://unpkg.com/mqtt/dist/mqtt.min.js. See http://unpkg.com for the full documentation on version ranges. -## WeChat Mini Program -Support [WeChat Mini Program](https://mp.weixin.qq.com/). See [Doc](https://mp.weixin.qq.com/debug/wxadoc/dev/api/network-socket.html). +## Weixin App +Surport [Weixin App](https://mp.weixin.qq.com/). See [Doc](https://mp.weixin.qq.com/debug/wxadoc/dev/api/network-socket.html). ## Example(js) ```js var mqtt = require('mqtt') -var client = mqtt.connect('wxs://test.mosquitto.org') +var client = mqtt.connect('wxs://test.mosquitto.org') ``` ## Example(ts) ```ts import { connect } from 'mqtt'; -const client = connect('wxs://test.mosquitto.org'); -``` - -## Ali Mini Program -Surport [Ali Mini Program](https://open.alipay.com/channel/miniIndex.htm). See [Doc](https://docs.alipay.com/mini/developer/getting-started). - - -## Example(js) - -```js -var mqtt = require('mqtt') -var client = mqtt.connect('alis://test.mosquitto.org') -``` - -## Example(ts) - -```ts -import { connect } from 'mqtt'; -const client = connect('alis://test.mosquitto.org'); +const client = connect('wxs://test.mosquitto.org'); ``` @@ -680,7 +604,6 @@ MQTT.js is only possible due to the excellent work of the following contributors Adam RuddGitHub/adamvrTwitter/@adam_vr Matteo CollinaGitHub/mcollinaTwitter/@matteocollina Maxime AgorGitHub/4rzaelTwitter/@4rzael -Siarhei BuntsevichGitHub/scarry1992 diff --git a/node_modules/mqtt/dist/mqtt.js b/node_modules/mqtt/dist/mqtt.js index 79ceffb..2fc2fa8 100644 --- a/node_modules/mqtt/dist/mqtt.js +++ b/node_modules/mqtt/dist/mqtt.js @@ -1,5 +1,5 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.mqtt = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i 0) { + if (this.options.resubscribe) { + this._resubscribeTopics.resubscribe = true + this.subscribe(this._resubscribeTopics) + } else { + this._resubscribeTopics = {} + } + } + + firstConnection = false + }) + // Clear ping timer this.on('close', function () { if (that.pingTimer !== null) { @@ -269,24 +283,18 @@ MqttClient.prototype._setupStream = function () { }) function nextTickWork () { - if (packets.length) { - process.nextTick(work) - } else { - var done = completeParse - completeParse = null - done() - } + process.nextTick(work) } function work () { var packet = packets.shift() + var done = completeParse if (packet) { that._handlePacket(packet, nextTickWork) } else { - var done = completeParse completeParse = null - if (done) done() + done() } } @@ -302,10 +310,7 @@ MqttClient.prototype._setupStream = function () { this.stream.on('error', nop) // Echo stream close - this.stream.on('close', function () { - flushVolatile(that.outgoing) - that.emit('close') - }) + eos(this.stream, this.emit.bind(this, 'close')) // Send a connect packet connectPacket = Object.create(this.options) @@ -316,18 +321,6 @@ MqttClient.prototype._setupStream = function () { // Echo connection errors parser.on('error', this.emit.bind(this, 'error')) - // auth - if (this.options.properties) { - if (!this.options.properties.authenticationMethod && this.options.properties.authenticationData) { - this.emit('error', new Error('Packet has no Authentication Method')) - return this - } - if (this.options.properties.authenticationMethod && this.options.authPacket && typeof this.options.authPacket === 'object') { - var authPacket = xtend({cmd: 'auth', reasonCode: 0}, this.options.authPacket) - sendPacket(this, authPacket) - } - } - // many drain listeners are needed for qos 1 callbacks if the connection is intermittent this.stream.setMaxListeners(1000) @@ -338,14 +331,6 @@ MqttClient.prototype._setupStream = function () { } MqttClient.prototype._handlePacket = function (packet, done) { - var options = this.options - - if (options.protocolVersion === 5 && options.properties && options.properties.maximumPacketSize && options.properties.maximumPacketSize < packet.length) { - this.emit('error', new Error('exceeding packets size ' + packet.cmd)) - this.end({reasonCode: 149, properties: { reasonString: 'Maximum packet size was exceeded' }}) - return this - } - this.emit('packetreceive', packet) switch (packet.cmd) { @@ -371,10 +356,6 @@ MqttClient.prototype._handlePacket = function (packet, done) { this._handlePingresp(packet) done() break - case 'disconnect': - this._handleDisconnect(packet) - done() - break default: // do nothing // maybe we should do an error handling @@ -403,7 +384,6 @@ MqttClient.prototype._checkDisconnecting = function (callback) { * {Number} qos - qos level to publish on * {Boolean} retain - whether or not to retain the message * {Boolean} dup - whether or not mark a message as duplicate - * {Function} cbStorePut - function(){} called when message is put into `outgoingStore` * @param {Function} [callback] - function(err){} * called when publish succeeds or fails * @returns {MqttClient} this - for chaining @@ -416,7 +396,6 @@ MqttClient.prototype._checkDisconnecting = function (callback) { */ MqttClient.prototype.publish = function (topic, message, opts, callback) { var packet - var options = this.options // .publish(topic, payload, cb); if (typeof opts === 'function') { @@ -442,42 +421,16 @@ MqttClient.prototype.publish = function (topic, message, opts, callback) { dup: opts.dup } - if (options.protocolVersion === 5) { - packet.properties = opts.properties - if ((!options.properties && packet.properties && packet.properties.topicAlias) || ((opts.properties && options.properties) && - ((opts.properties.topicAlias && options.properties.topicAliasMaximum && opts.properties.topicAlias > options.properties.topicAliasMaximum) || - (!options.properties.topicAliasMaximum && opts.properties.topicAlias)))) { - /* - if we are don`t setup topic alias or - topic alias maximum less than topic alias or - server don`t give topic alias maximum, - we are removing topic alias from packet - */ - delete packet.properties.topicAlias - } - } - switch (opts.qos) { case 1: case 2: + // Add to callbacks - this.outgoing[packet.messageId] = { - volatile: false, - cb: callback || nop - } - if (this._storeProcessing) { - this._packetIdsDuringStoreProcessing[packet.messageId] = false - this._storePacket(packet, undefined, opts.cbStorePut) - } else { - this._sendPacket(packet, undefined, opts.cbStorePut) - } + this.outgoing[packet.messageId] = callback || nop + this._sendPacket(packet) break default: - if (this._storeProcessing) { - this._storePacket(packet, callback, opts.cbStorePut) - } else { - this._sendPacket(packet, callback, opts.cbStorePut) - } + this._sendPacket(packet, callback) break } @@ -497,15 +450,12 @@ MqttClient.prototype.publish = function (topic, message, opts, callback) { * @api public * @example client.subscribe('topic'); * @example client.subscribe('topic', {qos: 1}); - * @example client.subscribe({'topic': {qos: 0}, 'topic2': {qos: 1}}, console.log); + * @example client.subscribe({'topic': 0, 'topic2': 1}, console.log); * @example client.subscribe('topic', console.log); */ MqttClient.prototype.subscribe = function () { var packet - var args = new Array(arguments.length) - for (var i = 0; i < arguments.length; i++) { - args[i] = arguments[i] - } + var args = Array.prototype.slice.call(arguments) var subs = [] var obj = args.shift() var resubscribe = obj.resubscribe @@ -513,7 +463,6 @@ MqttClient.prototype.subscribe = function () { var opts = args.pop() var invalidTopic var that = this - var version = this.options.protocolVersion delete obj.resubscribe @@ -536,52 +485,31 @@ MqttClient.prototype.subscribe = function () { return this } - var defaultOpts = { - qos: 0 - } - if (version === 5) { - defaultOpts.nl = false - defaultOpts.rap = false - defaultOpts.rh = 0 - } + var defaultOpts = { qos: 0 } opts = xtend(defaultOpts, opts) if (Array.isArray(obj)) { obj.forEach(function (topic) { - if (!that._resubscribeTopics.hasOwnProperty(topic) || - that._resubscribeTopics[topic].qos < opts.qos || + if (that._resubscribeTopics[topic] < opts.qos || + !that._resubscribeTopics.hasOwnProperty(topic) || resubscribe) { - var currentOpts = { + subs.push({ topic: topic, qos: opts.qos - } - if (version === 5) { - currentOpts.nl = opts.nl - currentOpts.rap = opts.rap - currentOpts.rh = opts.rh - currentOpts.properties = opts.properties - } - subs.push(currentOpts) + }) } }) } else { Object .keys(obj) .forEach(function (k) { - if (!that._resubscribeTopics.hasOwnProperty(k) || - that._resubscribeTopics[k].qos < obj[k].qos || + if (that._resubscribeTopics[k] < obj[k] || + !that._resubscribeTopics.hasOwnProperty(k) || resubscribe) { - var currentOpts = { + subs.push({ topic: k, - qos: obj[k].qos - } - if (version === 5) { - currentOpts.nl = obj[k].nl - currentOpts.rap = obj[k].rap - currentOpts.rh = obj[k].rh - currentOpts.properties = opts.properties - } - subs.push(currentOpts) + qos: obj[k] + }) } }) } @@ -595,10 +523,6 @@ MqttClient.prototype.subscribe = function () { messageId: this._nextId() } - if (opts.properties) { - packet.properties = opts.properties - } - if (!subs.length) { callback(null, []) return @@ -609,32 +533,22 @@ MqttClient.prototype.subscribe = function () { var topics = [] subs.forEach(function (sub) { if (that.options.reconnectPeriod > 0) { - var topic = { qos: sub.qos } - if (version === 5) { - topic.nl = sub.nl || false - topic.rap = sub.rap || false - topic.rh = sub.rh || 0 - topic.properties = sub.properties - } - that._resubscribeTopics[sub.topic] = topic + that._resubscribeTopics[sub.topic] = sub.qos topics.push(sub.topic) } }) that.messageIdToTopic[packet.messageId] = topics } - this.outgoing[packet.messageId] = { - volatile: true, - cb: function (err, packet) { - if (!err) { - var granted = packet.granted - for (var i = 0; i < granted.length; i += 1) { - subs[i].qos = granted[i] - } + this.outgoing[packet.messageId] = function (err, packet) { + if (!err) { + var granted = packet.granted + for (var i = 0; i < granted.length; i += 1) { + subs[i].qos = granted[i] } - - callback(err, subs) } + + callback(err, subs) } this._sendPacket(packet) @@ -646,37 +560,21 @@ MqttClient.prototype.subscribe = function () { * unsubscribe - unsubscribe from topic(s) * * @param {String, Array} topic - topics to unsubscribe from - * @param {Object} [opts] - optional subscription options, includes: - * {Object} properties - properties of unsubscribe packet * @param {Function} [callback] - callback fired on unsuback * @returns {MqttClient} this - for chaining * @api public * @example client.unsubscribe('topic'); * @example client.unsubscribe('topic', console.log); */ -MqttClient.prototype.unsubscribe = function () { +MqttClient.prototype.unsubscribe = function (topic, callback) { var packet = { cmd: 'unsubscribe', qos: 1, messageId: this._nextId() } var that = this - var args = new Array(arguments.length) - for (var i = 0; i < arguments.length; i++) { - args[i] = arguments[i] - } - var topic = args.shift() - var callback = args.pop() || nop - var opts = args.pop() - if (typeof topic === 'string') { - topic = [topic] - } - - if (typeof callback !== 'function') { - opts = callback - callback = nop - } + callback = callback || nop if (this._checkDisconnecting(callback)) { return this @@ -694,14 +592,7 @@ MqttClient.prototype.unsubscribe = function () { }) } - if (typeof opts === 'object' && opts.properties) { - packet.properties = opts.properties - } - - this.outgoing[packet.messageId] = { - volatile: true, - cb: callback - } + this.outgoing[packet.messageId] = callback this._sendPacket(packet) @@ -717,33 +608,14 @@ MqttClient.prototype.unsubscribe = function () { * * @api public */ -MqttClient.prototype.end = function () { +MqttClient.prototype.end = function (force, cb) { var that = this - var force = arguments[0] - var opts = arguments[1] - var cb = arguments[2] - - if (force == null || typeof force !== 'boolean') { - cb = opts || nop - opts = force + if (typeof force === 'function') { + cb = force force = false - if (typeof opts !== 'object') { - cb = opts - opts = null - if (typeof cb !== 'function') { - cb = nop - } - } } - if (typeof opts !== 'object') { - cb = opts - opts = null - } - - cb = cb || nop - function closeStores () { that.disconnected = true that.incomingStore.close(function () { @@ -763,7 +635,7 @@ MqttClient.prototype.end = function () { // defer closesStores of an I/O cycle, // just to make sure things are // ok for websockets - that._cleanUp(force, setImmediate.bind(null, closeStores), opts) + that._cleanUp(force, setImmediate.bind(null, closeStores)) } if (this.disconnecting) { @@ -795,7 +667,7 @@ MqttClient.prototype.end = function () { * @example client.removeOutgoingMessage(client.getLastMessageId()); */ MqttClient.prototype.removeOutgoingMessage = function (mid) { - var cb = this.outgoing[mid] ? this.outgoing[mid].cb : null + var cb = this.outgoing[mid] delete this.outgoing[mid] this.outgoingStore.del({messageId: mid}, function () { cb(new Error('Message removed')) @@ -881,7 +753,6 @@ MqttClient.prototype._clearReconnect = function () { * @api private */ MqttClient.prototype._cleanUp = function (forced, done) { - var opts = arguments[2] if (done) { this.stream.on('close', done) } @@ -892,9 +763,8 @@ MqttClient.prototype._cleanUp = function (forced, done) { } this.stream.destroy() } else { - var packet = xtend({ cmd: 'disconnect' }, opts) this._sendPacket( - packet, + { cmd: 'disconnect' }, setImmediate.bind( null, this.stream.end.bind(this.stream) @@ -923,14 +793,23 @@ MqttClient.prototype._cleanUp = function (forced, done) { * @param {String} type - packet type (see `protocol`) * @param {Object} packet - packet options * @param {Function} cb - callback when the packet is sent - * @param {Function} cbStorePut - called when message is put into outgoingStore * @api private */ -MqttClient.prototype._sendPacket = function (packet, cb, cbStorePut) { - cbStorePut = cbStorePut || nop - +MqttClient.prototype._sendPacket = function (packet, cb) { if (!this.connected) { - this._storePacket(packet, cb, cbStorePut) + if (((packet.qos || 0) === 0 && this.queueQoSZero) || packet.cmd !== 'publish') { + this.queue.push({ packet: packet, cb: cb }) + } else if (packet.qos > 0) { + cb = this.outgoing[packet.messageId] + this.outgoingStore.put(packet, function (err) { + if (err) { + return cb && cb(err) + } + }) + } else if (cb) { + cb(new Error('No connection to broker')) + } + return } @@ -941,7 +820,7 @@ MqttClient.prototype._sendPacket = function (packet, cb, cbStorePut) { case 'publish': break case 'pubrel': - storeAndSend(this, packet, cb, cbStorePut) + storeAndSend(this, packet, cb) return default: sendPacket(this, packet, cb) @@ -951,7 +830,7 @@ MqttClient.prototype._sendPacket = function (packet, cb, cbStorePut) { switch (packet.qos) { case 2: case 1: - storeAndSend(this, packet, cb, cbStorePut) + storeAndSend(this, packet, cb) break /** * no need of case here since it will be caught by default @@ -966,32 +845,6 @@ MqttClient.prototype._sendPacket = function (packet, cb, cbStorePut) { } } -/** - * _storePacket - queue a packet - * @param {String} type - packet type (see `protocol`) - * @param {Object} packet - packet options - * @param {Function} cb - callback when the packet is sent - * @param {Function} cbStorePut - called when message is put into outgoingStore - * @api private - */ -MqttClient.prototype._storePacket = function (packet, cb, cbStorePut) { - cbStorePut = cbStorePut || nop - - if (((packet.qos || 0) === 0 && this.queueQoSZero) || packet.cmd !== 'publish') { - this.queue.push({ packet: packet, cb: cb }) - } else if (packet.qos > 0) { - cb = this.outgoing[packet.messageId] ? this.outgoing[packet.messageId].cb : null - this.outgoingStore.put(packet, function (err) { - if (err) { - return cb && cb(err) - } - cbStorePut() - }) - } else if (cb) { - cb(new Error('No connection to broker')) - } -} - /** * _setupPingTimer - setup the ping timer * @@ -1050,30 +903,21 @@ MqttClient.prototype._handlePingresp = function () { */ MqttClient.prototype._handleConnack = function (packet) { - var options = this.options - var version = options.protocolVersion - var rc = version === 5 ? packet.reasonCode : packet.returnCode + var rc = packet.returnCode + var errors = [ + '', + 'Unacceptable protocol version', + 'Identifier rejected', + 'Server unavailable', + 'Bad username or password', + 'Not authorized' + ] clearTimeout(this.connackTimer) - if (packet.properties) { - if (packet.properties.topicAliasMaximum) { - if (!options.properties) { options.properties = {} } - options.properties.topicAliasMaximum = packet.properties.topicAliasMaximum - } - if (packet.properties.serverKeepAlive && options.keepalive) { - options.keepalive = packet.properties.serverKeepAlive - this._shiftPingInterval() - } - if (packet.properties.maximumPacketSize) { - if (!options.properties) { options.properties = {} } - options.properties.maximumPacketSize = packet.properties.maximumPacketSize - } - } - if (rc === 0) { this.reconnecting = false - this._onConnect(packet) + this.emit('connect', packet) } else if (rc > 0) { var err = new Error('Connection refused: ' + errors[rc]) err.code = rc @@ -1118,47 +962,28 @@ MqttClient.prototype._handlePublish = function (packet, done) { var qos = packet.qos var mid = packet.messageId var that = this - var options = this.options - var validReasonCodes = [0, 16, 128, 131, 135, 144, 145, 151, 153] switch (qos) { - case 2: { - options.customHandleAcks(topic, message, packet, function (error, code) { - if (!(error instanceof Error)) { - code = error - error = null - } - if (error) { return that.emit('error', error) } - if (validReasonCodes.indexOf(code) === -1) { return that.emit('error', new Error('Wrong reason code for pubrec')) } - if (code) { - that._sendPacket({cmd: 'pubrec', messageId: mid, reasonCode: code}, done) - } else { - that.incomingStore.put(packet, function () { - that._sendPacket({cmd: 'pubrec', messageId: mid}, done) - }) + case 2: + this.incomingStore.put(packet, function (err) { + if (err) { + return done(err) } + that._sendPacket({cmd: 'pubrec', messageId: mid}, done) }) break - } - case 1: { + case 1: // emit the message event - options.customHandleAcks(topic, message, packet, function (error, code) { - if (!(error instanceof Error)) { - code = error - error = null + this.emit('message', topic, message, packet) + this.handleMessage(packet, function (err) { + if (err) { + return done(err) } - if (error) { return that.emit('error', error) } - if (validReasonCodes.indexOf(code) === -1) { return that.emit('error', new Error('Wrong reason code for puback')) } - if (!code) { that.emit('message', topic, message, packet) } - that.handleMessage(packet, function (err) { - if (err) { - return done && done(err) - } - that._sendPacket({cmd: 'puback', messageId: mid, reasonCode: code}, done) - }) + // send 'puback' if the above 'handleMessage' method executed + // successfully. + that._sendPacket({cmd: 'puback', messageId: mid}, done) }) break - } case 0: // emit the message event this.emit('message', topic, message, packet) @@ -1195,9 +1020,8 @@ MqttClient.prototype._handleAck = function (packet) { var mid = packet.messageId var type = packet.cmd var response = null - var cb = this.outgoing[mid] ? this.outgoing[mid].cb : null + var cb = this.outgoing[mid] var that = this - var err if (!cb) { // Server sent an ack in error, ignore it. @@ -1209,13 +1033,7 @@ MqttClient.prototype._handleAck = function (packet) { case 'pubcomp': // same thing as puback for QoS 2 case 'puback': - var pubackRC = packet.reasonCode // Callback - we're done - if (pubackRC && pubackRC > 0 && pubackRC !== 16) { - err = new Error('Publish error: ' + errors[pubackRC]) - err.code = pubackRC - cb(err, packet) - } delete this.outgoing[mid] this.outgoingStore.del(packet, cb) break @@ -1225,27 +1043,18 @@ MqttClient.prototype._handleAck = function (packet) { qos: 2, messageId: mid } - var pubrecRC = packet.reasonCode - if (pubrecRC && pubrecRC > 0 && pubrecRC !== 16) { - err = new Error('Publish error: ' + errors[pubrecRC]) - err.code = pubrecRC - cb(err, packet) - } else { - this._sendPacket(response) - } + this._sendPacket(response) break case 'suback': delete this.outgoing[mid] - for (var grantedI = 0; grantedI < packet.granted.length; grantedI++) { - if ((packet.granted[grantedI] & 0x80) !== 0) { - // suback with Failure status - var topics = this.messageIdToTopic[mid] - if (topics) { - topics.forEach(function (topic) { - delete that._resubscribeTopics[topic] - }) - } + if (packet.granted.length === 1 && (packet.granted[0] & 0x80) !== 0) { + // suback with Failure status + var topics = this.messageIdToTopic[mid] + if (topics) { + topics.forEach(function (topic) { + delete that._resubscribeTopics[topic] + }) } } cb(null, packet) @@ -1278,14 +1087,18 @@ MqttClient.prototype._handlePubrel = function (packet, callback) { var comp = {cmd: 'pubcomp', messageId: mid} that.incomingStore.get(packet, function (err, pub) { - if (!err) { + if (!err && pub.cmd !== 'pubrel') { that.emit('message', pub.topic, pub.payload, pub) - that.handleMessage(pub, function (err) { + that.incomingStore.put(packet, function (err) { if (err) { return callback(err) } - that.incomingStore.del(pub, nop) - that._sendPacket(comp, callback) + that.handleMessage(pub, function (err) { + if (err) { + return callback(err) + } + that._sendPacket(comp, callback) + }) }) } else { that._sendPacket(comp, callback) @@ -1293,16 +1106,6 @@ MqttClient.prototype._handlePubrel = function (packet, callback) { }) } -/** - * _handleDisconnect - * - * @param {Object} packet - * @api private - */ -MqttClient.prototype._handleDisconnect = function (packet) { - this.emit('disconnect', packet) -} - /** * _nextId * @return unsigned int @@ -1325,278 +1128,10 @@ MqttClient.prototype.getLastMessageId = function () { return (this.nextId === 1) ? 65535 : (this.nextId - 1) } -/** - * _resubscribe - * @api private - */ -MqttClient.prototype._resubscribe = function (connack) { - var _resubscribeTopicsKeys = Object.keys(this._resubscribeTopics) - if (!this._firstConnection && - (this.options.clean || (this.options.protocolVersion === 5 && !connack.sessionPresent)) && - _resubscribeTopicsKeys.length > 0) { - if (this.options.resubscribe) { - if (this.options.protocolVersion === 5) { - for (var topicI = 0; topicI < _resubscribeTopicsKeys.length; topicI++) { - var resubscribeTopic = {} - resubscribeTopic[_resubscribeTopicsKeys[topicI]] = this._resubscribeTopics[_resubscribeTopicsKeys[topicI]] - resubscribeTopic.resubscribe = true - this.subscribe(resubscribeTopic, {properties: resubscribeTopic[_resubscribeTopicsKeys[topicI]].properties}) - } - } else { - this._resubscribeTopics.resubscribe = true - this.subscribe(this._resubscribeTopics) - } - } else { - this._resubscribeTopics = {} - } - } - - this._firstConnection = false -} - -/** - * _onConnect - * - * @api private - */ -MqttClient.prototype._onConnect = function (packet) { - if (this.disconnected) { - this.emit('connect', packet) - return - } - - var that = this - - this._setupPingTimer() - this._resubscribe(packet) - - this.connected = true - - function startStreamProcess () { - var outStore = that.outgoingStore.createStream() - - function clearStoreProcessing () { - that._storeProcessing = false - that._packetIdsDuringStoreProcessing = {} - } - - that.once('close', remove) - outStore.on('error', function (err) { - clearStoreProcessing() - that.removeListener('close', remove) - that.emit('error', err) - }) - - function remove () { - outStore.destroy() - outStore = null - clearStoreProcessing() - } - - function storeDeliver () { - // edge case, we wrapped this twice - if (!outStore) { - return - } - that._storeProcessing = true - - var packet = outStore.read(1) - - var cb - - if (!packet) { - // read when data is available in the future - outStore.once('readable', storeDeliver) - return - } - - // Skip already processed store packets - if (that._packetIdsDuringStoreProcessing[packet.messageId]) { - storeDeliver() - return - } - - // Avoid unnecessary stream read operations when disconnected - if (!that.disconnecting && !that.reconnectTimer) { - cb = that.outgoing[packet.messageId] ? that.outgoing[packet.messageId].cb : null - that.outgoing[packet.messageId] = { - volatile: false, - cb: function (err, status) { - // Ensure that the original callback passed in to publish gets invoked - if (cb) { - cb(err, status) - } - - storeDeliver() - } - } - that._packetIdsDuringStoreProcessing[packet.messageId] = true - that._sendPacket(packet) - } else if (outStore.destroy) { - outStore.destroy() - } - } - - outStore.on('end', function () { - var allProcessed = true - for (var id in that._packetIdsDuringStoreProcessing) { - if (!that._packetIdsDuringStoreProcessing[id]) { - allProcessed = false - break - } - } - if (allProcessed) { - clearStoreProcessing() - that.removeListener('close', remove) - that.emit('connect', packet) - } else { - startStreamProcess() - } - }) - storeDeliver() - } - // start flowing - startStreamProcess() -} - module.exports = MqttClient -}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./store":7,"./validations":8,"_process":92,"events":13,"inherits":80,"mqtt-packet":84,"readable-stream":108,"reinterval":109,"xtend":121}],2:[function(require,module,exports){ -(function (Buffer){ -'use strict' - -var Transform = require('readable-stream').Transform -var duplexify = require('duplexify') -var base64 = require('base64-js') - -/* global FileReader */ -var my -var proxy -var stream -var isInitialized = false - -function buildProxy () { - var proxy = new Transform() - proxy._write = function (chunk, encoding, next) { - my.sendSocketMessage({ - data: chunk.buffer, - success: function () { - next() - }, - fail: function () { - next(new Error()) - } - }) - } - proxy._flush = function socketEnd (done) { - my.closeSocket({ - success: function () { - done() - } - }) - } - - return proxy -} - -function setDefaultOpts (opts) { - if (!opts.hostname) { - opts.hostname = 'localhost' - } - if (!opts.path) { - opts.path = '/' - } - - if (!opts.wsOptions) { - opts.wsOptions = {} - } -} - -function buildUrl (opts, client) { - var protocol = opts.protocol === 'alis' ? 'wss' : 'ws' - var url = protocol + '://' + opts.hostname + opts.path - if (opts.port && opts.port !== 80 && opts.port !== 443) { - url = protocol + '://' + opts.hostname + ':' + opts.port + opts.path - } - if (typeof (opts.transformWsUrl) === 'function') { - url = opts.transformWsUrl(url, opts, client) - } - return url -} - -function bindEventHandler () { - if (isInitialized) return - - isInitialized = true - - my.onSocketOpen(function () { - stream.setReadable(proxy) - stream.setWritable(proxy) - stream.emit('connect') - }) - - my.onSocketMessage(function (res) { - if (typeof res.data === 'string') { - var array = base64.toByteArray(res.data) - var buffer = Buffer.from(array) - proxy.push(buffer) - } else { - var reader = new FileReader() - reader.addEventListener('load', function () { - var data = reader.result - - if (data instanceof ArrayBuffer) data = Buffer.from(data) - else data = Buffer.from(data, 'utf8') - proxy.push(data) - }) - reader.readAsArrayBuffer(res.data) - } - }) - - my.onSocketClose(function () { - stream.end() - stream.destroy() - }) - - my.onSocketError(function (res) { - stream.destroy(res) - }) -} - -function buildStream (client, opts) { - opts.hostname = opts.hostname || opts.host - - if (!opts.hostname) { - throw new Error('Could not determine host. Specify host manually.') - } - - var websocketSubProtocol = - (opts.protocolId === 'MQIsdp') && (opts.protocolVersion === 3) - ? 'mqttv3.1' - : 'mqtt' - - setDefaultOpts(opts) - - var url = buildUrl(opts, client) - my = opts.my - my.connectSocket({ - url: url, - protocols: websocketSubProtocol - }) - - proxy = buildProxy() - stream = duplexify.obj() - - bindEventHandler() - - return stream -} - -module.exports = buildStream - -}).call(this,require("buffer").Buffer) -},{"base64-js":10,"buffer":12,"duplexify":17,"readable-stream":108}],3:[function(require,module,exports){ +}).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"./store":6,"./validations":7,"_process":96,"end-of-stream":16,"events":79,"inherits":84,"mqtt-packet":89,"readable-stream":112,"reinterval":113,"xtend":165}],2:[function(require,module,exports){ 'use strict' var net = require('net') @@ -1617,7 +1152,7 @@ function buildBuilder (client, opts) { module.exports = buildBuilder -},{"net":11}],4:[function(require,module,exports){ +},{"net":11}],3:[function(require,module,exports){ 'use strict' var tls = require('tls') @@ -1660,8 +1195,8 @@ function buildBuilder (mqttClient, opts) { module.exports = buildBuilder -},{"tls":11}],5:[function(require,module,exports){ -(function (process){ +},{"tls":11}],4:[function(require,module,exports){ +(function (process){(function (){ 'use strict' var websocket = require('websocket-stream') @@ -1755,41 +1290,81 @@ if (IS_BROWSER) { module.exports = buildBuilder } -}).call(this,require('_process')) -},{"_process":92,"url":113,"websocket-stream":118}],6:[function(require,module,exports){ -(function (process,Buffer){ +}).call(this)}).call(this,require('_process')) +},{"_process":96,"url":128,"websocket-stream":162}],5:[function(require,module,exports){ 'use strict' -var Transform = require('readable-stream').Transform -var duplexify = require('duplexify') - /* global wx */ -var socketTask -var proxy -var stream +var socketOpen = false +var socketMsgQueue = [] -function buildProxy () { - var proxy = new Transform() - proxy._write = function (chunk, encoding, next) { - socketTask.send({ - data: chunk.buffer, - success: function () { - next() - }, - fail: function (errMsg) { - next(new Error(errMsg)) - } +function sendSocketMessage (msg) { + if (socketOpen) { + wx.sendSocketMessage({ + data: msg.buffer || msg }) + } else { + socketMsgQueue.push(msg) } - proxy._flush = function socketEnd (done) { - socketTask.close({ - success: function () { - done() - } - }) +} + +function WebSocket (url, protocols) { + var ws = { + OPEN: 1, + CLOSING: 2, + CLOSED: 3, + readyState: socketOpen ? 1 : 0, + send: sendSocketMessage, + close: wx.closeSocket, + onopen: null, + onmessage: null, + onclose: null, + onerror: null } - return proxy + wx.connectSocket({ + url: url, + protocols: protocols + }) + wx.onSocketOpen(function (res) { + ws.readyState = ws.OPEN + socketOpen = true + for (var i = 0; i < socketMsgQueue.length; i++) { + sendSocketMessage(socketMsgQueue[i]) + } + socketMsgQueue = [] + + ws.onopen && ws.onopen.apply(ws, arguments) + }) + wx.onSocketMessage(function (res) { + ws.onmessage && ws.onmessage.apply(ws, arguments) + }) + wx.onSocketClose(function () { + ws.onclose && ws.onclose.apply(ws, arguments) + ws.readyState = ws.CLOSED + socketOpen = false + }) + wx.onSocketError(function () { + ws.onerror && ws.onerror.apply(ws, arguments) + ws.readyState = ws.CLOSED + socketOpen = false + }) + + return ws +} + +var websocket = require('websocket-stream') + +function buildUrl (opts, client) { + var protocol = opts.protocol === 'wxs' ? 'wss' : 'ws' + var url = protocol + '://' + opts.hostname + opts.path + if (opts.port && opts.port !== 80 && opts.port !== 443) { + url = protocol + '://' + opts.hostname + ':' + opts.port + opts.path + } + if (typeof (opts.transformWsUrl) === 'function') { + url = opts.transformWsUrl(url, opts, client) + } + return url } function setDefaultOpts (opts) { @@ -1805,97 +1380,31 @@ function setDefaultOpts (opts) { } } -function buildUrl (opts, client) { - var protocol = opts.protocol === 'wxs' ? 'wss' : 'ws' - var url = protocol + '://' + opts.hostname + opts.path - if (opts.port && opts.port !== 80 && opts.port !== 443) { - url = protocol + '://' + opts.hostname + ':' + opts.port + opts.path - } - if (typeof (opts.transformWsUrl) === 'function') { - url = opts.transformWsUrl(url, opts, client) - } - return url -} - -function bindEventHandler () { - socketTask.onOpen(function () { - stream.setReadable(proxy) - stream.setWritable(proxy) - stream.emit('connect') - }) - - socketTask.onMessage(function (res) { - var data = res.data - - if (data instanceof ArrayBuffer) data = Buffer.from(data) - else data = Buffer.from(data, 'utf8') - proxy.push(data) - }) - - socketTask.onClose(function () { - stream.end() - stream.destroy() - }) - - socketTask.onError(function (res) { - stream.destroy(new Error(res.errMsg)) - }) -} - -function buildStream (client, opts) { - opts.hostname = opts.hostname || opts.host - - if (!opts.hostname) { - throw new Error('Could not determine host. Specify host manually.') - } - +function createWebSocket (client, opts) { var websocketSubProtocol = (opts.protocolId === 'MQIsdp') && (opts.protocolVersion === 3) ? 'mqttv3.1' : 'mqtt' setDefaultOpts(opts) - var url = buildUrl(opts, client) - socketTask = wx.connectSocket({ - url: url, - protocols: websocketSubProtocol - }) - - proxy = buildProxy() - stream = duplexify.obj() - stream._destroy = function (err, cb) { - socketTask.close({ - success: function () { - cb && cb(err) - } - }) - } - - var destroyRef = stream.destroy - stream.destroy = function () { - stream.destroy = destroyRef - - var self = this - process.nextTick(function () { - socketTask.close({ - fail: function () { - self._destroy(new Error()) - } - }) - }) - }.bind(stream) - - bindEventHandler() - - return stream + return websocket(WebSocket(url, [websocketSubProtocol])) } -module.exports = buildStream +function buildBuilder (client, opts) { + opts.hostname = opts.hostname || opts.host -}).call(this,require('_process'),require("buffer").Buffer) -},{"_process":92,"buffer":12,"duplexify":17,"readable-stream":108}],7:[function(require,module,exports){ -(function (process){ + if (!opts.hostname) { + throw new Error('Could not determine host. Specify host manually.') + } + + return createWebSocket(client, opts) +} + +module.exports = buildBuilder + +},{"websocket-stream":162}],6:[function(require,module,exports){ +(function (process){(function (){ 'use strict' /** @@ -2037,8 +1546,8 @@ Store.prototype.close = function (cb) { module.exports = Store -}).call(this,require('_process')) -},{"_process":92,"es6-map":67,"readable-stream":108,"xtend":121}],8:[function(require,module,exports){ +}).call(this)}).call(this,require('_process')) +},{"_process":96,"es6-map":64,"readable-stream":112,"xtend":165}],7:[function(require,module,exports){ 'use strict' /** @@ -2092,8 +1601,8 @@ module.exports = { validateTopics: validateTopics } -},{}],9:[function(require,module,exports){ -(function (process){ +},{}],8:[function(require,module,exports){ +(function (process){(function (){ 'use strict' var MqttClient = require('../client') @@ -2111,9 +1620,6 @@ if (process.title !== 'browser') { } else { protocols.wx = require('./wx') protocols.wxs = require('./wx') - - protocols.ali = require('./ali') - protocols.alis = require('./ali') } protocols.ws = require('./ws') @@ -2175,7 +1681,7 @@ function connect (brokerUrl, opts) { if (opts.cert && opts.key) { if (opts.protocol) { - if (['mqtts', 'wss', 'wxs', 'alis'].indexOf(opts.protocol) === -1) { + if (['mqtts', 'wss', 'wxs'].indexOf(opts.protocol) === -1) { switch (opts.protocol) { case 'mqtt': opts.protocol = 'mqtts' @@ -2186,9 +1692,6 @@ function connect (brokerUrl, opts) { case 'wx': opts.protocol = 'wxs' break - case 'ali': - opts.protocol = 'alis' - break default: throw new Error('Unknown protocol for secure connection: "' + opts.protocol + '"!') } @@ -2207,9 +1710,7 @@ function connect (brokerUrl, opts) { 'ws', 'wss', 'wx', - 'wxs', - 'ali', - 'alis' + 'wxs' ].filter(function (key, index) { if (isSecure && index % 2 === 0) { // Skip insecure protocols when requesting a secure one. @@ -2252,8 +1753,8 @@ module.exports.connect = connect module.exports.MqttClient = MqttClient module.exports.Store = Store -}).call(this,require('_process')) -},{"../client":1,"../store":7,"./ali":2,"./tcp":3,"./tls":4,"./ws":5,"./wx":6,"_process":92,"url":113,"xtend":121}],10:[function(require,module,exports){ +}).call(this)}).call(this,require('_process')) +},{"../client":1,"../store":6,"./tcp":2,"./tls":3,"./ws":4,"./wx":5,"_process":96,"url":128,"xtend":165}],9:[function(require,module,exports){ 'use strict' exports.byteLength = byteLength @@ -2321,7 +1822,8 @@ function toByteArray (b64) { ? validLen - 4 : validLen - for (var i = 0; i < len; i += 4) { + var i + for (i = 0; i < len; i += 4) { tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | @@ -2380,9 +1882,7 @@ function fromByteArray (uint8) { // go through the array every three bytes, we'll deal with trailing stuff later for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { - parts.push(encodeChunk( - uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength) - )) + parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength))) } // pad the end with zeros, but make sure to not forget the extra bytes @@ -2406,9 +1906,302 @@ function fromByteArray (uint8) { return parts.join('') } -},{}],11:[function(require,module,exports){ +},{}],10:[function(require,module,exports){ +var DuplexStream = require('readable-stream/duplex') + , util = require('util') + , Buffer = require('safe-buffer').Buffer + + +function BufferList (callback) { + if (!(this instanceof BufferList)) + return new BufferList(callback) + + this._bufs = [] + this.length = 0 + + if (typeof callback == 'function') { + this._callback = callback + + var piper = function piper (err) { + if (this._callback) { + this._callback(err) + this._callback = null + } + }.bind(this) + + this.on('pipe', function onPipe (src) { + src.on('error', piper) + }) + this.on('unpipe', function onUnpipe (src) { + src.removeListener('error', piper) + }) + } else { + this.append(callback) + } + + DuplexStream.call(this) +} + + +util.inherits(BufferList, DuplexStream) + + +BufferList.prototype._offset = function _offset (offset) { + var tot = 0, i = 0, _t + if (offset === 0) return [ 0, 0 ] + for (; i < this._bufs.length; i++) { + _t = tot + this._bufs[i].length + if (offset < _t || i == this._bufs.length - 1) + return [ i, offset - tot ] + tot = _t + } +} + + +BufferList.prototype.append = function append (buf) { + var i = 0 + + if (Buffer.isBuffer(buf)) { + this._appendBuffer(buf); + } else if (Array.isArray(buf)) { + for (; i < buf.length; i++) + this.append(buf[i]) + } else if (buf instanceof BufferList) { + // unwrap argument into individual BufferLists + for (; i < buf._bufs.length; i++) + this.append(buf._bufs[i]) + } else if (buf != null) { + // coerce number arguments to strings, since Buffer(number) does + // uninitialized memory allocation + if (typeof buf == 'number') + buf = buf.toString() + + this._appendBuffer(Buffer.from(buf)); + } + + return this +} + + +BufferList.prototype._appendBuffer = function appendBuffer (buf) { + this._bufs.push(buf) + this.length += buf.length +} + + +BufferList.prototype._write = function _write (buf, encoding, callback) { + this._appendBuffer(buf) + + if (typeof callback == 'function') + callback() +} + + +BufferList.prototype._read = function _read (size) { + if (!this.length) + return this.push(null) + + size = Math.min(size, this.length) + this.push(this.slice(0, size)) + this.consume(size) +} + + +BufferList.prototype.end = function end (chunk) { + DuplexStream.prototype.end.call(this, chunk) + + if (this._callback) { + this._callback(null, this.slice()) + this._callback = null + } +} + + +BufferList.prototype.get = function get (index) { + return this.slice(index, index + 1)[0] +} + + +BufferList.prototype.slice = function slice (start, end) { + if (typeof start == 'number' && start < 0) + start += this.length + if (typeof end == 'number' && end < 0) + end += this.length + return this.copy(null, 0, start, end) +} + + +BufferList.prototype.copy = function copy (dst, dstStart, srcStart, srcEnd) { + if (typeof srcStart != 'number' || srcStart < 0) + srcStart = 0 + if (typeof srcEnd != 'number' || srcEnd > this.length) + srcEnd = this.length + if (srcStart >= this.length) + return dst || Buffer.alloc(0) + if (srcEnd <= 0) + return dst || Buffer.alloc(0) + + var copy = !!dst + , off = this._offset(srcStart) + , len = srcEnd - srcStart + , bytes = len + , bufoff = (copy && dstStart) || 0 + , start = off[1] + , l + , i + + // copy/slice everything + if (srcStart === 0 && srcEnd == this.length) { + if (!copy) { // slice, but full concat if multiple buffers + return this._bufs.length === 1 + ? this._bufs[0] + : Buffer.concat(this._bufs, this.length) + } + + // copy, need to copy individual buffers + for (i = 0; i < this._bufs.length; i++) { + this._bufs[i].copy(dst, bufoff) + bufoff += this._bufs[i].length + } + + return dst + } + + // easy, cheap case where it's a subset of one of the buffers + if (bytes <= this._bufs[off[0]].length - start) { + return copy + ? this._bufs[off[0]].copy(dst, dstStart, start, start + bytes) + : this._bufs[off[0]].slice(start, start + bytes) + } + + if (!copy) // a slice, we need something to copy in to + dst = Buffer.allocUnsafe(len) + + for (i = off[0]; i < this._bufs.length; i++) { + l = this._bufs[i].length - start + + if (bytes > l) { + this._bufs[i].copy(dst, bufoff, start) + bufoff += l + } else { + this._bufs[i].copy(dst, bufoff, start, start + bytes) + bufoff += l + break + } + + bytes -= l + + if (start) + start = 0 + } + + // safeguard so that we don't return uninitialized memory + if (dst.length > bufoff) return dst.slice(0, bufoff) + + return dst +} + +BufferList.prototype.shallowSlice = function shallowSlice (start, end) { + start = start || 0 + end = end || this.length + + if (start < 0) + start += this.length + if (end < 0) + end += this.length + + var startOffset = this._offset(start) + , endOffset = this._offset(end) + , buffers = this._bufs.slice(startOffset[0], endOffset[0] + 1) + + if (endOffset[1] == 0) + buffers.pop() + else + buffers[buffers.length-1] = buffers[buffers.length-1].slice(0, endOffset[1]) + + if (startOffset[1] != 0) + buffers[0] = buffers[0].slice(startOffset[1]) + + return new BufferList(buffers) +} + +BufferList.prototype.toString = function toString (encoding, start, end) { + return this.slice(start, end).toString(encoding) +} + +BufferList.prototype.consume = function consume (bytes) { + // first, normalize the argument, in accordance with how Buffer does it + bytes = Math.trunc(bytes) + // do nothing if not a positive number + if (Number.isNaN(bytes) || bytes <= 0) return this + + while (this._bufs.length) { + if (bytes >= this._bufs[0].length) { + bytes -= this._bufs[0].length + this.length -= this._bufs[0].length + this._bufs.shift() + } else { + this._bufs[0] = this._bufs[0].slice(bytes) + this.length -= bytes + break + } + } + return this +} + + +BufferList.prototype.duplicate = function duplicate () { + var i = 0 + , copy = new BufferList() + + for (; i < this._bufs.length; i++) + copy.append(this._bufs[i]) + + return copy +} + + +BufferList.prototype.destroy = function destroy () { + this._bufs.length = 0 + this.length = 0 + this.push(null) +} + + +;(function () { + var methods = { + 'readDoubleBE' : 8 + , 'readDoubleLE' : 8 + , 'readFloatBE' : 4 + , 'readFloatLE' : 4 + , 'readInt32BE' : 4 + , 'readInt32LE' : 4 + , 'readUInt32BE' : 4 + , 'readUInt32LE' : 4 + , 'readInt16BE' : 2 + , 'readInt16LE' : 2 + , 'readUInt16BE' : 2 + , 'readUInt16LE' : 2 + , 'readInt8' : 1 + , 'readUInt8' : 1 + } + + for (var m in methods) { + (function (m) { + BufferList.prototype[m] = function (offset) { + return this.slice(offset, offset + methods[m])[m](0) + } + }(m)) + } +}()) + + +module.exports = BufferList + +},{"readable-stream/duplex":101,"safe-buffer":114,"util":133}],11:[function(require,module,exports){ },{}],12:[function(require,module,exports){ +(function (Buffer){(function (){ /*! * The buffer module from node.js, for the browser. * @@ -4187,7 +3980,1824 @@ function numberIsNaN (obj) { return obj !== obj // eslint-disable-line no-self-compare } -},{"base64-js":10,"ieee754":79}],13:[function(require,module,exports){ +}).call(this)}).call(this,require("buffer").Buffer) +},{"base64-js":9,"buffer":12,"ieee754":83}],13:[function(require,module,exports){ +(function (Buffer){(function (){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// NOTE: These type checking functions intentionally don't use `instanceof` +// because it is fragile and can be easily faked with `Object.create()`. + +function isArray(arg) { + if (Array.isArray) { + return Array.isArray(arg); + } + return objectToString(arg) === '[object Array]'; +} +exports.isArray = isArray; + +function isBoolean(arg) { + return typeof arg === 'boolean'; +} +exports.isBoolean = isBoolean; + +function isNull(arg) { + return arg === null; +} +exports.isNull = isNull; + +function isNullOrUndefined(arg) { + return arg == null; +} +exports.isNullOrUndefined = isNullOrUndefined; + +function isNumber(arg) { + return typeof arg === 'number'; +} +exports.isNumber = isNumber; + +function isString(arg) { + return typeof arg === 'string'; +} +exports.isString = isString; + +function isSymbol(arg) { + return typeof arg === 'symbol'; +} +exports.isSymbol = isSymbol; + +function isUndefined(arg) { + return arg === void 0; +} +exports.isUndefined = isUndefined; + +function isRegExp(re) { + return objectToString(re) === '[object RegExp]'; +} +exports.isRegExp = isRegExp; + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} +exports.isObject = isObject; + +function isDate(d) { + return objectToString(d) === '[object Date]'; +} +exports.isDate = isDate; + +function isError(e) { + return (objectToString(e) === '[object Error]' || e instanceof Error); +} +exports.isError = isError; + +function isFunction(arg) { + return typeof arg === 'function'; +} +exports.isFunction = isFunction; + +function isPrimitive(arg) { + return arg === null || + typeof arg === 'boolean' || + typeof arg === 'number' || + typeof arg === 'string' || + typeof arg === 'symbol' || // ES6 symbol + typeof arg === 'undefined'; +} +exports.isPrimitive = isPrimitive; + +exports.isBuffer = Buffer.isBuffer; + +function objectToString(o) { + return Object.prototype.toString.call(o); +} + +}).call(this)}).call(this,{"isBuffer":require("../../is-buffer/index.js")}) +},{"../../is-buffer/index.js":85}],14:[function(require,module,exports){ +"use strict"; + +var isValue = require("type/value/is") + , ensureValue = require("type/value/ensure") + , ensurePlainFunction = require("type/plain-function/ensure") + , copy = require("es5-ext/object/copy") + , normalizeOptions = require("es5-ext/object/normalize-options") + , map = require("es5-ext/object/map"); + +var bind = Function.prototype.bind + , defineProperty = Object.defineProperty + , hasOwnProperty = Object.prototype.hasOwnProperty + , define; + +define = function (name, desc, options) { + var value = ensureValue(desc) && ensurePlainFunction(desc.value), dgs; + dgs = copy(desc); + delete dgs.writable; + delete dgs.value; + dgs.get = function () { + if (!options.overwriteDefinition && hasOwnProperty.call(this, name)) return value; + desc.value = bind.call(value, options.resolveContext ? options.resolveContext(this) : this); + defineProperty(this, name, desc); + return this[name]; + }; + return dgs; +}; + +module.exports = function (props/*, options*/) { + var options = normalizeOptions(arguments[1]); + if (isValue(options.resolveContext)) ensurePlainFunction(options.resolveContext); + return map(props, function (desc, name) { return define(name, desc, options); }); +}; + +},{"es5-ext/object/copy":37,"es5-ext/object/map":45,"es5-ext/object/normalize-options":46,"type/plain-function/ensure":122,"type/value/ensure":126,"type/value/is":127}],15:[function(require,module,exports){ +"use strict"; + +var isValue = require("type/value/is") + , isPlainFunction = require("type/plain-function/is") + , assign = require("es5-ext/object/assign") + , normalizeOpts = require("es5-ext/object/normalize-options") + , contains = require("es5-ext/string/#/contains"); + +var d = (module.exports = function (dscr, value/*, options*/) { + var c, e, w, options, desc; + if (arguments.length < 2 || typeof dscr !== "string") { + options = value; + value = dscr; + dscr = null; + } else { + options = arguments[2]; + } + if (isValue(dscr)) { + c = contains.call(dscr, "c"); + e = contains.call(dscr, "e"); + w = contains.call(dscr, "w"); + } else { + c = w = true; + e = false; + } + + desc = { value: value, configurable: c, enumerable: e, writable: w }; + return !options ? desc : assign(normalizeOpts(options), desc); +}); + +d.gs = function (dscr, get, set/*, options*/) { + var c, e, options, desc; + if (typeof dscr !== "string") { + options = set; + set = get; + get = dscr; + dscr = null; + } else { + options = arguments[3]; + } + if (!isValue(get)) { + get = undefined; + } else if (!isPlainFunction(get)) { + options = get; + get = set = undefined; + } else if (!isValue(set)) { + set = undefined; + } else if (!isPlainFunction(set)) { + options = set; + set = undefined; + } + if (isValue(dscr)) { + c = contains.call(dscr, "c"); + e = contains.call(dscr, "e"); + } else { + c = true; + e = false; + } + + desc = { get: get, set: set, configurable: c, enumerable: e }; + return !options ? desc : assign(normalizeOpts(options), desc); +}; + +},{"es5-ext/object/assign":34,"es5-ext/object/normalize-options":46,"es5-ext/string/#/contains":53,"type/plain-function/is":123,"type/value/is":127}],16:[function(require,module,exports){ +(function (process){(function (){ +var once = require('once'); + +var noop = function() {}; + +var isRequest = function(stream) { + return stream.setHeader && typeof stream.abort === 'function'; +}; + +var isChildProcess = function(stream) { + return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3 +}; + +var eos = function(stream, opts, callback) { + if (typeof opts === 'function') return eos(stream, null, opts); + if (!opts) opts = {}; + + callback = once(callback || noop); + + var ws = stream._writableState; + var rs = stream._readableState; + var readable = opts.readable || (opts.readable !== false && stream.readable); + var writable = opts.writable || (opts.writable !== false && stream.writable); + var cancelled = false; + + var onlegacyfinish = function() { + if (!stream.writable) onfinish(); + }; + + var onfinish = function() { + writable = false; + if (!readable) callback.call(stream); + }; + + var onend = function() { + readable = false; + if (!writable) callback.call(stream); + }; + + var onexit = function(exitCode) { + callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null); + }; + + var onerror = function(err) { + callback.call(stream, err); + }; + + var onclose = function() { + process.nextTick(onclosenexttick); + }; + + var onclosenexttick = function() { + if (cancelled) return; + if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close')); + if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close')); + }; + + var onrequest = function() { + stream.req.on('finish', onfinish); + }; + + if (isRequest(stream)) { + stream.on('complete', onfinish); + stream.on('abort', onclose); + if (stream.req) onrequest(); + else stream.on('request', onrequest); + } else if (writable && !ws) { // legacy streams + stream.on('end', onlegacyfinish); + stream.on('close', onlegacyfinish); + } + + if (isChildProcess(stream)) stream.on('exit', onexit); + + stream.on('end', onend); + stream.on('finish', onfinish); + if (opts.error !== false) stream.on('error', onerror); + stream.on('close', onclose); + + return function() { + cancelled = true; + stream.removeListener('complete', onfinish); + stream.removeListener('abort', onclose); + stream.removeListener('request', onrequest); + if (stream.req) stream.req.removeListener('finish', onfinish); + stream.removeListener('end', onlegacyfinish); + stream.removeListener('close', onlegacyfinish); + stream.removeListener('finish', onfinish); + stream.removeListener('exit', onexit); + stream.removeListener('end', onend); + stream.removeListener('error', onerror); + stream.removeListener('close', onclose); + }; +}; + +module.exports = eos; + +}).call(this)}).call(this,require('_process')) +},{"_process":96,"once":94}],17:[function(require,module,exports){ +// Inspired by Google Closure: +// http://closure-library.googlecode.com/svn/docs/ +// closure_goog_array_array.js.html#goog.array.clear + +"use strict"; + +var value = require("../../object/valid-value"); + +module.exports = function () { + value(this).length = 0; + return this; +}; + +},{"../../object/valid-value":52}],18:[function(require,module,exports){ +"use strict"; + +var numberIsNaN = require("../../number/is-nan") + , toPosInt = require("../../number/to-pos-integer") + , value = require("../../object/valid-value") + , indexOf = Array.prototype.indexOf + , objHasOwnProperty = Object.prototype.hasOwnProperty + , abs = Math.abs + , floor = Math.floor; + +module.exports = function (searchElement/*, fromIndex*/) { + var i, length, fromIndex, val; + if (!numberIsNaN(searchElement)) return indexOf.apply(this, arguments); + + length = toPosInt(value(this).length); + fromIndex = arguments[1]; + if (isNaN(fromIndex)) fromIndex = 0; + else if (fromIndex >= 0) fromIndex = floor(fromIndex); + else fromIndex = toPosInt(this.length) - floor(abs(fromIndex)); + + for (i = fromIndex; i < length; ++i) { + if (objHasOwnProperty.call(this, i)) { + val = this[i]; + if (numberIsNaN(val)) return i; // Jslint: ignore + } + } + return -1; +}; + +},{"../../number/is-nan":28,"../../number/to-pos-integer":32,"../../object/valid-value":52}],19:[function(require,module,exports){ +"use strict"; + +module.exports = require("./is-implemented")() ? Array.from : require("./shim"); + +},{"./is-implemented":20,"./shim":21}],20:[function(require,module,exports){ +"use strict"; + +module.exports = function () { + var from = Array.from, arr, result; + if (typeof from !== "function") return false; + arr = ["raz", "dwa"]; + result = from(arr); + return Boolean(result && result !== arr && result[1] === "dwa"); +}; + +},{}],21:[function(require,module,exports){ +"use strict"; + +var iteratorSymbol = require("es6-symbol").iterator + , isArguments = require("../../function/is-arguments") + , isFunction = require("../../function/is-function") + , toPosInt = require("../../number/to-pos-integer") + , callable = require("../../object/valid-callable") + , validValue = require("../../object/valid-value") + , isValue = require("../../object/is-value") + , isString = require("../../string/is-string") + , isArray = Array.isArray + , call = Function.prototype.call + , desc = { configurable: true, enumerable: true, writable: true, value: null } + , defineProperty = Object.defineProperty; + +// eslint-disable-next-line complexity, max-lines-per-function +module.exports = function (arrayLike/*, mapFn, thisArg*/) { + var mapFn = arguments[1] + , thisArg = arguments[2] + , Context + , i + , j + , arr + , length + , code + , iterator + , result + , getIterator + , value; + + arrayLike = Object(validValue(arrayLike)); + + if (isValue(mapFn)) callable(mapFn); + if (!this || this === Array || !isFunction(this)) { + // Result: Plain array + if (!mapFn) { + if (isArguments(arrayLike)) { + // Source: Arguments + length = arrayLike.length; + if (length !== 1) return Array.apply(null, arrayLike); + arr = new Array(1); + arr[0] = arrayLike[0]; + return arr; + } + if (isArray(arrayLike)) { + // Source: Array + arr = new Array((length = arrayLike.length)); + for (i = 0; i < length; ++i) arr[i] = arrayLike[i]; + return arr; + } + } + arr = []; + } else { + // Result: Non plain array + Context = this; + } + + if (!isArray(arrayLike)) { + if ((getIterator = arrayLike[iteratorSymbol]) !== undefined) { + // Source: Iterator + iterator = callable(getIterator).call(arrayLike); + if (Context) arr = new Context(); + result = iterator.next(); + i = 0; + while (!result.done) { + value = mapFn ? call.call(mapFn, thisArg, result.value, i) : result.value; + if (Context) { + desc.value = value; + defineProperty(arr, i, desc); + } else { + arr[i] = value; + } + result = iterator.next(); + ++i; + } + length = i; + } else if (isString(arrayLike)) { + // Source: String + length = arrayLike.length; + if (Context) arr = new Context(); + for (i = 0, j = 0; i < length; ++i) { + value = arrayLike[i]; + if (i + 1 < length) { + code = value.charCodeAt(0); + // eslint-disable-next-line max-depth + if (code >= 0xd800 && code <= 0xdbff) value += arrayLike[++i]; + } + value = mapFn ? call.call(mapFn, thisArg, value, j) : value; + if (Context) { + desc.value = value; + defineProperty(arr, j, desc); + } else { + arr[j] = value; + } + ++j; + } + length = j; + } + } + if (length === undefined) { + // Source: array or array-like + length = toPosInt(arrayLike.length); + if (Context) arr = new Context(length); + for (i = 0; i < length; ++i) { + value = mapFn ? call.call(mapFn, thisArg, arrayLike[i], i) : arrayLike[i]; + if (Context) { + desc.value = value; + defineProperty(arr, i, desc); + } else { + arr[i] = value; + } + } + } + if (Context) { + desc.value = null; + arr.length = length; + } + return arr; +}; + +},{"../../function/is-arguments":22,"../../function/is-function":23,"../../number/to-pos-integer":32,"../../object/is-value":41,"../../object/valid-callable":51,"../../object/valid-value":52,"../../string/is-string":56,"es6-symbol":70}],22:[function(require,module,exports){ +"use strict"; + +var objToString = Object.prototype.toString + , id = objToString.call((function () { return arguments; })()); + +module.exports = function (value) { return objToString.call(value) === id; }; + +},{}],23:[function(require,module,exports){ +"use strict"; + +var objToString = Object.prototype.toString + , isFunctionStringTag = RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/); + +module.exports = function (value) { + return typeof value === "function" && isFunctionStringTag(objToString.call(value)); +}; + +},{}],24:[function(require,module,exports){ +"use strict"; + +// eslint-disable-next-line no-empty-function +module.exports = function () {}; + +},{}],25:[function(require,module,exports){ +"use strict"; + +module.exports = require("./is-implemented")() ? Math.sign : require("./shim"); + +},{"./is-implemented":26,"./shim":27}],26:[function(require,module,exports){ +"use strict"; + +module.exports = function () { + var sign = Math.sign; + if (typeof sign !== "function") return false; + return sign(10) === 1 && sign(-20) === -1; +}; + +},{}],27:[function(require,module,exports){ +"use strict"; + +module.exports = function (value) { + value = Number(value); + if (isNaN(value) || value === 0) return value; + return value > 0 ? 1 : -1; +}; + +},{}],28:[function(require,module,exports){ +"use strict"; + +module.exports = require("./is-implemented")() ? Number.isNaN : require("./shim"); + +},{"./is-implemented":29,"./shim":30}],29:[function(require,module,exports){ +"use strict"; + +module.exports = function () { + var numberIsNaN = Number.isNaN; + if (typeof numberIsNaN !== "function") return false; + return !numberIsNaN({}) && numberIsNaN(NaN) && !numberIsNaN(34); +}; + +},{}],30:[function(require,module,exports){ +"use strict"; + +module.exports = function (value) { + // eslint-disable-next-line no-self-compare + return value !== value; +}; + +},{}],31:[function(require,module,exports){ +"use strict"; + +var sign = require("../math/sign") + , abs = Math.abs + , floor = Math.floor; + +module.exports = function (value) { + if (isNaN(value)) return 0; + value = Number(value); + if (value === 0 || !isFinite(value)) return value; + return sign(value) * floor(abs(value)); +}; + +},{"../math/sign":25}],32:[function(require,module,exports){ +"use strict"; + +var toInteger = require("./to-integer") + , max = Math.max; + +module.exports = function (value) { return max(0, toInteger(value)); }; + +},{"./to-integer":31}],33:[function(require,module,exports){ +// Internal method, used by iteration functions. +// Calls a function for each key-value pair found in object +// Optionally takes compareFn to iterate object in specific order + +"use strict"; + +var callable = require("./valid-callable") + , value = require("./valid-value") + , bind = Function.prototype.bind + , call = Function.prototype.call + , keys = Object.keys + , objPropertyIsEnumerable = Object.prototype.propertyIsEnumerable; + +module.exports = function (method, defVal) { + return function (obj, cb/*, thisArg, compareFn*/) { + var list, thisArg = arguments[2], compareFn = arguments[3]; + obj = Object(value(obj)); + callable(cb); + + list = keys(obj); + if (compareFn) { + list.sort(typeof compareFn === "function" ? bind.call(compareFn, obj) : undefined); + } + if (typeof method !== "function") method = list[method]; + return call.call(method, list, function (key, index) { + if (!objPropertyIsEnumerable.call(obj, key)) return defVal; + return call.call(cb, thisArg, obj[key], key, obj, index); + }); + }; +}; + +},{"./valid-callable":51,"./valid-value":52}],34:[function(require,module,exports){ +"use strict"; + +module.exports = require("./is-implemented")() ? Object.assign : require("./shim"); + +},{"./is-implemented":35,"./shim":36}],35:[function(require,module,exports){ +"use strict"; + +module.exports = function () { + var assign = Object.assign, obj; + if (typeof assign !== "function") return false; + obj = { foo: "raz" }; + assign(obj, { bar: "dwa" }, { trzy: "trzy" }); + return obj.foo + obj.bar + obj.trzy === "razdwatrzy"; +}; + +},{}],36:[function(require,module,exports){ +"use strict"; + +var keys = require("../keys") + , value = require("../valid-value") + , max = Math.max; + +module.exports = function (dest, src/*, …srcn*/) { + var error, i, length = max(arguments.length, 2), assign; + dest = Object(value(dest)); + assign = function (key) { + try { + dest[key] = src[key]; + } catch (e) { + if (!error) error = e; + } + }; + for (i = 1; i < length; ++i) { + src = arguments[i]; + keys(src).forEach(assign); + } + if (error !== undefined) throw error; + return dest; +}; + +},{"../keys":42,"../valid-value":52}],37:[function(require,module,exports){ +"use strict"; + +var aFrom = require("../array/from") + , assign = require("./assign") + , value = require("./valid-value"); + +module.exports = function (obj/*, propertyNames, options*/) { + var copy = Object(value(obj)), propertyNames = arguments[1], options = Object(arguments[2]); + if (copy !== obj && !propertyNames) return copy; + var result = {}; + if (propertyNames) { + aFrom(propertyNames, function (propertyName) { + if (options.ensure || propertyName in obj) result[propertyName] = obj[propertyName]; + }); + } else { + assign(result, obj); + } + return result; +}; + +},{"../array/from":19,"./assign":34,"./valid-value":52}],38:[function(require,module,exports){ +// Workaround for http://code.google.com/p/v8/issues/detail?id=2804 + +"use strict"; + +var create = Object.create, shim; + +if (!require("./set-prototype-of/is-implemented")()) { + shim = require("./set-prototype-of/shim"); +} + +module.exports = (function () { + var nullObject, polyProps, desc; + if (!shim) return create; + if (shim.level !== 1) return create; + + nullObject = {}; + polyProps = {}; + desc = { configurable: false, enumerable: false, writable: true, value: undefined }; + Object.getOwnPropertyNames(Object.prototype).forEach(function (name) { + if (name === "__proto__") { + polyProps[name] = { + configurable: true, + enumerable: false, + writable: true, + value: undefined + }; + return; + } + polyProps[name] = desc; + }); + Object.defineProperties(nullObject, polyProps); + + Object.defineProperty(shim, "nullPolyfill", { + configurable: false, + enumerable: false, + writable: false, + value: nullObject + }); + + return function (prototype, props) { + return create(prototype === null ? nullObject : prototype, props); + }; +})(); + +},{"./set-prototype-of/is-implemented":49,"./set-prototype-of/shim":50}],39:[function(require,module,exports){ +"use strict"; + +module.exports = require("./_iterate")("forEach"); + +},{"./_iterate":33}],40:[function(require,module,exports){ +"use strict"; + +var isValue = require("./is-value"); + +var map = { function: true, object: true }; + +module.exports = function (value) { return (isValue(value) && map[typeof value]) || false; }; + +},{"./is-value":41}],41:[function(require,module,exports){ +"use strict"; + +var _undefined = require("../function/noop")(); // Support ES3 engines + +module.exports = function (val) { return val !== _undefined && val !== null; }; + +},{"../function/noop":24}],42:[function(require,module,exports){ +"use strict"; + +module.exports = require("./is-implemented")() ? Object.keys : require("./shim"); + +},{"./is-implemented":43,"./shim":44}],43:[function(require,module,exports){ +"use strict"; + +module.exports = function () { + try { + Object.keys("primitive"); + return true; + } catch (e) { + return false; + } +}; + +},{}],44:[function(require,module,exports){ +"use strict"; + +var isValue = require("../is-value"); + +var keys = Object.keys; + +module.exports = function (object) { return keys(isValue(object) ? Object(object) : object); }; + +},{"../is-value":41}],45:[function(require,module,exports){ +"use strict"; + +var callable = require("./valid-callable") + , forEach = require("./for-each") + , call = Function.prototype.call; + +module.exports = function (obj, cb/*, thisArg*/) { + var result = {}, thisArg = arguments[2]; + callable(cb); + forEach(obj, function (value, key, targetObj, index) { + result[key] = call.call(cb, thisArg, value, key, targetObj, index); + }); + return result; +}; + +},{"./for-each":39,"./valid-callable":51}],46:[function(require,module,exports){ +"use strict"; + +var isValue = require("./is-value"); + +var forEach = Array.prototype.forEach, create = Object.create; + +var process = function (src, obj) { + var key; + for (key in src) obj[key] = src[key]; +}; + +// eslint-disable-next-line no-unused-vars +module.exports = function (opts1/*, …options*/) { + var result = create(null); + forEach.call(arguments, function (options) { + if (!isValue(options)) return; + process(Object(options), result); + }); + return result; +}; + +},{"./is-value":41}],47:[function(require,module,exports){ +"use strict"; + +var forEach = Array.prototype.forEach, create = Object.create; + +// eslint-disable-next-line no-unused-vars +module.exports = function (arg/*, …args*/) { + var set = create(null); + forEach.call(arguments, function (name) { set[name] = true; }); + return set; +}; + +},{}],48:[function(require,module,exports){ +"use strict"; + +module.exports = require("./is-implemented")() ? Object.setPrototypeOf : require("./shim"); + +},{"./is-implemented":49,"./shim":50}],49:[function(require,module,exports){ +"use strict"; + +var create = Object.create, getPrototypeOf = Object.getPrototypeOf, plainObject = {}; + +module.exports = function (/* CustomCreate*/) { + var setPrototypeOf = Object.setPrototypeOf, customCreate = arguments[0] || create; + if (typeof setPrototypeOf !== "function") return false; + return getPrototypeOf(setPrototypeOf(customCreate(null), plainObject)) === plainObject; +}; + +},{}],50:[function(require,module,exports){ +/* eslint no-proto: "off" */ + +// Big thanks to @WebReflection for sorting this out +// https://gist.github.com/WebReflection/5593554 + +"use strict"; + +var isObject = require("../is-object") + , value = require("../valid-value") + , objIsPrototypeOf = Object.prototype.isPrototypeOf + , defineProperty = Object.defineProperty + , nullDesc = { configurable: true, enumerable: false, writable: true, value: undefined } + , validate; + +validate = function (obj, prototype) { + value(obj); + if (prototype === null || isObject(prototype)) return obj; + throw new TypeError("Prototype must be null or an object"); +}; + +module.exports = (function (status) { + var fn, set; + if (!status) return null; + if (status.level === 2) { + if (status.set) { + set = status.set; + fn = function (obj, prototype) { + set.call(validate(obj, prototype), prototype); + return obj; + }; + } else { + fn = function (obj, prototype) { + validate(obj, prototype).__proto__ = prototype; + return obj; + }; + } + } else { + fn = function self(obj, prototype) { + var isNullBase; + validate(obj, prototype); + isNullBase = objIsPrototypeOf.call(self.nullPolyfill, obj); + if (isNullBase) delete self.nullPolyfill.__proto__; + if (prototype === null) prototype = self.nullPolyfill; + obj.__proto__ = prototype; + if (isNullBase) defineProperty(self.nullPolyfill, "__proto__", nullDesc); + return obj; + }; + } + return Object.defineProperty(fn, "level", { + configurable: false, + enumerable: false, + writable: false, + value: status.level + }); +})( + (function () { + var tmpObj1 = Object.create(null) + , tmpObj2 = {} + , set + , desc = Object.getOwnPropertyDescriptor(Object.prototype, "__proto__"); + + if (desc) { + try { + set = desc.set; // Opera crashes at this point + set.call(tmpObj1, tmpObj2); + } catch (ignore) {} + if (Object.getPrototypeOf(tmpObj1) === tmpObj2) return { set: set, level: 2 }; + } + + tmpObj1.__proto__ = tmpObj2; + if (Object.getPrototypeOf(tmpObj1) === tmpObj2) return { level: 2 }; + + tmpObj1 = {}; + tmpObj1.__proto__ = tmpObj2; + if (Object.getPrototypeOf(tmpObj1) === tmpObj2) return { level: 1 }; + + return false; + })() +); + +require("../create"); + +},{"../create":38,"../is-object":40,"../valid-value":52}],51:[function(require,module,exports){ +"use strict"; + +module.exports = function (fn) { + if (typeof fn !== "function") throw new TypeError(fn + " is not a function"); + return fn; +}; + +},{}],52:[function(require,module,exports){ +"use strict"; + +var isValue = require("./is-value"); + +module.exports = function (value) { + if (!isValue(value)) throw new TypeError("Cannot use null or undefined"); + return value; +}; + +},{"./is-value":41}],53:[function(require,module,exports){ +"use strict"; + +module.exports = require("./is-implemented")() ? String.prototype.contains : require("./shim"); + +},{"./is-implemented":54,"./shim":55}],54:[function(require,module,exports){ +"use strict"; + +var str = "razdwatrzy"; + +module.exports = function () { + if (typeof str.contains !== "function") return false; + return str.contains("dwa") === true && str.contains("foo") === false; +}; + +},{}],55:[function(require,module,exports){ +"use strict"; + +var indexOf = String.prototype.indexOf; + +module.exports = function (searchString/*, position*/) { + return indexOf.call(this, searchString, arguments[1]) > -1; +}; + +},{}],56:[function(require,module,exports){ +"use strict"; + +var objToString = Object.prototype.toString, id = objToString.call(""); + +module.exports = function (value) { + return ( + typeof value === "string" || + (value && + typeof value === "object" && + (value instanceof String || objToString.call(value) === id)) || + false + ); +}; + +},{}],57:[function(require,module,exports){ +"use strict"; + +var setPrototypeOf = require("es5-ext/object/set-prototype-of") + , contains = require("es5-ext/string/#/contains") + , d = require("d") + , Symbol = require("es6-symbol") + , Iterator = require("./"); + +var defineProperty = Object.defineProperty, ArrayIterator; + +ArrayIterator = module.exports = function (arr, kind) { + if (!(this instanceof ArrayIterator)) throw new TypeError("Constructor requires 'new'"); + Iterator.call(this, arr); + if (!kind) kind = "value"; + else if (contains.call(kind, "key+value")) kind = "key+value"; + else if (contains.call(kind, "key")) kind = "key"; + else kind = "value"; + defineProperty(this, "__kind__", d("", kind)); +}; +if (setPrototypeOf) setPrototypeOf(ArrayIterator, Iterator); + +// Internal %ArrayIteratorPrototype% doesn't expose its constructor +delete ArrayIterator.prototype.constructor; + +ArrayIterator.prototype = Object.create(Iterator.prototype, { + _resolve: d(function (i) { + if (this.__kind__ === "value") return this.__list__[i]; + if (this.__kind__ === "key+value") return [i, this.__list__[i]]; + return i; + }) +}); +defineProperty(ArrayIterator.prototype, Symbol.toStringTag, d("c", "Array Iterator")); + +},{"./":60,"d":15,"es5-ext/object/set-prototype-of":48,"es5-ext/string/#/contains":53,"es6-symbol":70}],58:[function(require,module,exports){ +"use strict"; + +var isArguments = require("es5-ext/function/is-arguments") + , callable = require("es5-ext/object/valid-callable") + , isString = require("es5-ext/string/is-string") + , get = require("./get"); + +var isArray = Array.isArray, call = Function.prototype.call, some = Array.prototype.some; + +module.exports = function (iterable, cb /*, thisArg*/) { + var mode, thisArg = arguments[2], result, doBreak, broken, i, length, char, code; + if (isArray(iterable) || isArguments(iterable)) mode = "array"; + else if (isString(iterable)) mode = "string"; + else iterable = get(iterable); + + callable(cb); + doBreak = function () { + broken = true; + }; + if (mode === "array") { + some.call(iterable, function (value) { + call.call(cb, thisArg, value, doBreak); + return broken; + }); + return; + } + if (mode === "string") { + length = iterable.length; + for (i = 0; i < length; ++i) { + char = iterable[i]; + if (i + 1 < length) { + code = char.charCodeAt(0); + if (code >= 0xd800 && code <= 0xdbff) char += iterable[++i]; + } + call.call(cb, thisArg, char, doBreak); + if (broken) break; + } + return; + } + result = iterable.next(); + + while (!result.done) { + call.call(cb, thisArg, result.value, doBreak); + if (broken) return; + result = iterable.next(); + } +}; + +},{"./get":59,"es5-ext/function/is-arguments":22,"es5-ext/object/valid-callable":51,"es5-ext/string/is-string":56}],59:[function(require,module,exports){ +"use strict"; + +var isArguments = require("es5-ext/function/is-arguments") + , isString = require("es5-ext/string/is-string") + , ArrayIterator = require("./array") + , StringIterator = require("./string") + , iterable = require("./valid-iterable") + , iteratorSymbol = require("es6-symbol").iterator; + +module.exports = function (obj) { + if (typeof iterable(obj)[iteratorSymbol] === "function") return obj[iteratorSymbol](); + if (isArguments(obj)) return new ArrayIterator(obj); + if (isString(obj)) return new StringIterator(obj); + return new ArrayIterator(obj); +}; + +},{"./array":57,"./string":62,"./valid-iterable":63,"es5-ext/function/is-arguments":22,"es5-ext/string/is-string":56,"es6-symbol":70}],60:[function(require,module,exports){ +"use strict"; + +var clear = require("es5-ext/array/#/clear") + , assign = require("es5-ext/object/assign") + , callable = require("es5-ext/object/valid-callable") + , value = require("es5-ext/object/valid-value") + , d = require("d") + , autoBind = require("d/auto-bind") + , Symbol = require("es6-symbol"); + +var defineProperty = Object.defineProperty, defineProperties = Object.defineProperties, Iterator; + +module.exports = Iterator = function (list, context) { + if (!(this instanceof Iterator)) throw new TypeError("Constructor requires 'new'"); + defineProperties(this, { + __list__: d("w", value(list)), + __context__: d("w", context), + __nextIndex__: d("w", 0) + }); + if (!context) return; + callable(context.on); + context.on("_add", this._onAdd); + context.on("_delete", this._onDelete); + context.on("_clear", this._onClear); +}; + +// Internal %IteratorPrototype% doesn't expose its constructor +delete Iterator.prototype.constructor; + +defineProperties( + Iterator.prototype, + assign( + { + _next: d(function () { + var i; + if (!this.__list__) return undefined; + if (this.__redo__) { + i = this.__redo__.shift(); + if (i !== undefined) return i; + } + if (this.__nextIndex__ < this.__list__.length) return this.__nextIndex__++; + this._unBind(); + return undefined; + }), + next: d(function () { + return this._createResult(this._next()); + }), + _createResult: d(function (i) { + if (i === undefined) return { done: true, value: undefined }; + return { done: false, value: this._resolve(i) }; + }), + _resolve: d(function (i) { + return this.__list__[i]; + }), + _unBind: d(function () { + this.__list__ = null; + delete this.__redo__; + if (!this.__context__) return; + this.__context__.off("_add", this._onAdd); + this.__context__.off("_delete", this._onDelete); + this.__context__.off("_clear", this._onClear); + this.__context__ = null; + }), + toString: d(function () { + return "[object " + (this[Symbol.toStringTag] || "Object") + "]"; + }) + }, + autoBind({ + _onAdd: d(function (index) { + if (index >= this.__nextIndex__) return; + ++this.__nextIndex__; + if (!this.__redo__) { + defineProperty(this, "__redo__", d("c", [index])); + return; + } + this.__redo__.forEach(function (redo, i) { + if (redo >= index) this.__redo__[i] = ++redo; + }, this); + this.__redo__.push(index); + }), + _onDelete: d(function (index) { + var i; + if (index >= this.__nextIndex__) return; + --this.__nextIndex__; + if (!this.__redo__) return; + i = this.__redo__.indexOf(index); + if (i !== -1) this.__redo__.splice(i, 1); + this.__redo__.forEach(function (redo, j) { + if (redo > index) this.__redo__[j] = --redo; + }, this); + }), + _onClear: d(function () { + if (this.__redo__) clear.call(this.__redo__); + this.__nextIndex__ = 0; + }) + }) + ) +); + +defineProperty( + Iterator.prototype, + Symbol.iterator, + d(function () { + return this; + }) +); + +},{"d":15,"d/auto-bind":14,"es5-ext/array/#/clear":17,"es5-ext/object/assign":34,"es5-ext/object/valid-callable":51,"es5-ext/object/valid-value":52,"es6-symbol":70}],61:[function(require,module,exports){ +"use strict"; + +var isArguments = require("es5-ext/function/is-arguments") + , isValue = require("es5-ext/object/is-value") + , isString = require("es5-ext/string/is-string"); + +var iteratorSymbol = require("es6-symbol").iterator + , isArray = Array.isArray; + +module.exports = function (value) { + if (!isValue(value)) return false; + if (isArray(value)) return true; + if (isString(value)) return true; + if (isArguments(value)) return true; + return typeof value[iteratorSymbol] === "function"; +}; + +},{"es5-ext/function/is-arguments":22,"es5-ext/object/is-value":41,"es5-ext/string/is-string":56,"es6-symbol":70}],62:[function(require,module,exports){ +// Thanks @mathiasbynens +// http://mathiasbynens.be/notes/javascript-unicode#iterating-over-symbols + +"use strict"; + +var setPrototypeOf = require("es5-ext/object/set-prototype-of") + , d = require("d") + , Symbol = require("es6-symbol") + , Iterator = require("./"); + +var defineProperty = Object.defineProperty, StringIterator; + +StringIterator = module.exports = function (str) { + if (!(this instanceof StringIterator)) throw new TypeError("Constructor requires 'new'"); + str = String(str); + Iterator.call(this, str); + defineProperty(this, "__length__", d("", str.length)); +}; +if (setPrototypeOf) setPrototypeOf(StringIterator, Iterator); + +// Internal %ArrayIteratorPrototype% doesn't expose its constructor +delete StringIterator.prototype.constructor; + +StringIterator.prototype = Object.create(Iterator.prototype, { + _next: d(function () { + if (!this.__list__) return undefined; + if (this.__nextIndex__ < this.__length__) return this.__nextIndex__++; + this._unBind(); + return undefined; + }), + _resolve: d(function (i) { + var char = this.__list__[i], code; + if (this.__nextIndex__ === this.__length__) return char; + code = char.charCodeAt(0); + if (code >= 0xd800 && code <= 0xdbff) return char + this.__list__[this.__nextIndex__++]; + return char; + }) +}); +defineProperty(StringIterator.prototype, Symbol.toStringTag, d("c", "String Iterator")); + +},{"./":60,"d":15,"es5-ext/object/set-prototype-of":48,"es6-symbol":70}],63:[function(require,module,exports){ +"use strict"; + +var isIterable = require("./is-iterable"); + +module.exports = function (value) { + if (!isIterable(value)) throw new TypeError(value + " is not iterable"); + return value; +}; + +},{"./is-iterable":61}],64:[function(require,module,exports){ +'use strict'; + +module.exports = require('./is-implemented')() ? Map : require('./polyfill'); + +},{"./is-implemented":65,"./polyfill":69}],65:[function(require,module,exports){ +'use strict'; + +module.exports = function () { + var map, iterator, result; + if (typeof Map !== 'function') return false; + try { + // WebKit doesn't support arguments and crashes + map = new Map([['raz', 'one'], ['dwa', 'two'], ['trzy', 'three']]); + } catch (e) { + return false; + } + if (String(map) !== '[object Map]') return false; + if (map.size !== 3) return false; + if (typeof map.clear !== 'function') return false; + if (typeof map.delete !== 'function') return false; + if (typeof map.entries !== 'function') return false; + if (typeof map.forEach !== 'function') return false; + if (typeof map.get !== 'function') return false; + if (typeof map.has !== 'function') return false; + if (typeof map.keys !== 'function') return false; + if (typeof map.set !== 'function') return false; + if (typeof map.values !== 'function') return false; + + iterator = map.entries(); + result = iterator.next(); + if (result.done !== false) return false; + if (!result.value) return false; + if (result.value[0] !== 'raz') return false; + if (result.value[1] !== 'one') return false; + + return true; +}; + +},{}],66:[function(require,module,exports){ +// Exports true if environment provides native `Map` implementation, +// whatever that is. + +'use strict'; + +module.exports = (function () { + if (typeof Map === 'undefined') return false; + return (Object.prototype.toString.call(new Map()) === '[object Map]'); +}()); + +},{}],67:[function(require,module,exports){ +'use strict'; + +module.exports = require('es5-ext/object/primitive-set')('key', + 'value', 'key+value'); + +},{"es5-ext/object/primitive-set":47}],68:[function(require,module,exports){ +'use strict'; + +var setPrototypeOf = require('es5-ext/object/set-prototype-of') + , d = require('d') + , Iterator = require('es6-iterator') + , toStringTagSymbol = require('es6-symbol').toStringTag + , kinds = require('./iterator-kinds') + + , defineProperties = Object.defineProperties + , unBind = Iterator.prototype._unBind + , MapIterator; + +MapIterator = module.exports = function (map, kind) { + if (!(this instanceof MapIterator)) return new MapIterator(map, kind); + Iterator.call(this, map.__mapKeysData__, map); + if (!kind || !kinds[kind]) kind = 'key+value'; + defineProperties(this, { + __kind__: d('', kind), + __values__: d('w', map.__mapValuesData__) + }); +}; +if (setPrototypeOf) setPrototypeOf(MapIterator, Iterator); + +MapIterator.prototype = Object.create(Iterator.prototype, { + constructor: d(MapIterator), + _resolve: d(function (i) { + if (this.__kind__ === 'value') return this.__values__[i]; + if (this.__kind__ === 'key') return this.__list__[i]; + return [this.__list__[i], this.__values__[i]]; + }), + _unBind: d(function () { + this.__values__ = null; + unBind.call(this); + }), + toString: d(function () { return '[object Map Iterator]'; }) +}); +Object.defineProperty(MapIterator.prototype, toStringTagSymbol, + d('c', 'Map Iterator')); + +},{"./iterator-kinds":67,"d":15,"es5-ext/object/set-prototype-of":48,"es6-iterator":60,"es6-symbol":70}],69:[function(require,module,exports){ +'use strict'; + +var clear = require('es5-ext/array/#/clear') + , eIndexOf = require('es5-ext/array/#/e-index-of') + , setPrototypeOf = require('es5-ext/object/set-prototype-of') + , callable = require('es5-ext/object/valid-callable') + , validValue = require('es5-ext/object/valid-value') + , d = require('d') + , ee = require('event-emitter') + , Symbol = require('es6-symbol') + , iterator = require('es6-iterator/valid-iterable') + , forOf = require('es6-iterator/for-of') + , Iterator = require('./lib/iterator') + , isNative = require('./is-native-implemented') + + , call = Function.prototype.call + , defineProperties = Object.defineProperties, getPrototypeOf = Object.getPrototypeOf + , MapPoly; + +module.exports = MapPoly = function (/*iterable*/) { + var iterable = arguments[0], keys, values, self; + if (!(this instanceof MapPoly)) throw new TypeError('Constructor requires \'new\''); + if (isNative && setPrototypeOf && (Map !== MapPoly)) { + self = setPrototypeOf(new Map(), getPrototypeOf(this)); + } else { + self = this; + } + if (iterable != null) iterator(iterable); + defineProperties(self, { + __mapKeysData__: d('c', keys = []), + __mapValuesData__: d('c', values = []) + }); + if (!iterable) return self; + forOf(iterable, function (value) { + var key = validValue(value)[0]; + value = value[1]; + if (eIndexOf.call(keys, key) !== -1) return; + keys.push(key); + values.push(value); + }, self); + return self; +}; + +if (isNative) { + if (setPrototypeOf) setPrototypeOf(MapPoly, Map); + MapPoly.prototype = Object.create(Map.prototype, { + constructor: d(MapPoly) + }); +} + +ee(defineProperties(MapPoly.prototype, { + clear: d(function () { + if (!this.__mapKeysData__.length) return; + clear.call(this.__mapKeysData__); + clear.call(this.__mapValuesData__); + this.emit('_clear'); + }), + delete: d(function (key) { + var index = eIndexOf.call(this.__mapKeysData__, key); + if (index === -1) return false; + this.__mapKeysData__.splice(index, 1); + this.__mapValuesData__.splice(index, 1); + this.emit('_delete', index, key); + return true; + }), + entries: d(function () { return new Iterator(this, 'key+value'); }), + forEach: d(function (cb/*, thisArg*/) { + var thisArg = arguments[1], iterator, result; + callable(cb); + iterator = this.entries(); + result = iterator._next(); + while (result !== undefined) { + call.call(cb, thisArg, this.__mapValuesData__[result], + this.__mapKeysData__[result], this); + result = iterator._next(); + } + }), + get: d(function (key) { + var index = eIndexOf.call(this.__mapKeysData__, key); + if (index === -1) return; + return this.__mapValuesData__[index]; + }), + has: d(function (key) { + return (eIndexOf.call(this.__mapKeysData__, key) !== -1); + }), + keys: d(function () { return new Iterator(this, 'key'); }), + set: d(function (key, value) { + var index = eIndexOf.call(this.__mapKeysData__, key), emit; + if (index === -1) { + index = this.__mapKeysData__.push(key) - 1; + emit = true; + } + this.__mapValuesData__[index] = value; + if (emit) this.emit('_add', index, key); + return this; + }), + size: d.gs(function () { return this.__mapKeysData__.length; }), + values: d(function () { return new Iterator(this, 'value'); }), + toString: d(function () { return '[object Map]'; }) +})); +Object.defineProperty(MapPoly.prototype, Symbol.iterator, d(function () { + return this.entries(); +})); +Object.defineProperty(MapPoly.prototype, Symbol.toStringTag, d('c', 'Map')); + +},{"./is-native-implemented":66,"./lib/iterator":68,"d":15,"es5-ext/array/#/clear":17,"es5-ext/array/#/e-index-of":18,"es5-ext/object/set-prototype-of":48,"es5-ext/object/valid-callable":51,"es5-ext/object/valid-value":52,"es6-iterator/for-of":58,"es6-iterator/valid-iterable":63,"es6-symbol":70,"event-emitter":78}],70:[function(require,module,exports){ +"use strict"; + +module.exports = require("./is-implemented")() + ? require("ext/global-this").Symbol + : require("./polyfill"); + +},{"./is-implemented":71,"./polyfill":76,"ext/global-this":81}],71:[function(require,module,exports){ +"use strict"; + +var global = require("ext/global-this") + , validTypes = { object: true, symbol: true }; + +module.exports = function () { + var Symbol = global.Symbol; + var symbol; + if (typeof Symbol !== "function") return false; + symbol = Symbol("test symbol"); + try { String(symbol); } + catch (e) { return false; } + + // Return 'true' also for polyfills + if (!validTypes[typeof Symbol.iterator]) return false; + if (!validTypes[typeof Symbol.toPrimitive]) return false; + if (!validTypes[typeof Symbol.toStringTag]) return false; + + return true; +}; + +},{"ext/global-this":81}],72:[function(require,module,exports){ +"use strict"; + +module.exports = function (value) { + if (!value) return false; + if (typeof value === "symbol") return true; + if (!value.constructor) return false; + if (value.constructor.name !== "Symbol") return false; + return value[value.constructor.toStringTag] === "Symbol"; +}; + +},{}],73:[function(require,module,exports){ +"use strict"; + +var d = require("d"); + +var create = Object.create, defineProperty = Object.defineProperty, objPrototype = Object.prototype; + +var created = create(null); +module.exports = function (desc) { + var postfix = 0, name, ie11BugWorkaround; + while (created[desc + (postfix || "")]) ++postfix; + desc += postfix || ""; + created[desc] = true; + name = "@@" + desc; + defineProperty( + objPrototype, + name, + d.gs(null, function (value) { + // For IE11 issue see: + // https://connect.microsoft.com/IE/feedbackdetail/view/1928508/ + // ie11-broken-getters-on-dom-objects + // https://github.com/medikoo/es6-symbol/issues/12 + if (ie11BugWorkaround) return; + ie11BugWorkaround = true; + defineProperty(this, name, d(value)); + ie11BugWorkaround = false; + }) + ); + return name; +}; + +},{"d":15}],74:[function(require,module,exports){ +"use strict"; + +var d = require("d") + , NativeSymbol = require("ext/global-this").Symbol; + +module.exports = function (SymbolPolyfill) { + return Object.defineProperties(SymbolPolyfill, { + // To ensure proper interoperability with other native functions (e.g. Array.from) + // fallback to eventual native implementation of given symbol + hasInstance: d( + "", (NativeSymbol && NativeSymbol.hasInstance) || SymbolPolyfill("hasInstance") + ), + isConcatSpreadable: d( + "", + (NativeSymbol && NativeSymbol.isConcatSpreadable) || + SymbolPolyfill("isConcatSpreadable") + ), + iterator: d("", (NativeSymbol && NativeSymbol.iterator) || SymbolPolyfill("iterator")), + match: d("", (NativeSymbol && NativeSymbol.match) || SymbolPolyfill("match")), + replace: d("", (NativeSymbol && NativeSymbol.replace) || SymbolPolyfill("replace")), + search: d("", (NativeSymbol && NativeSymbol.search) || SymbolPolyfill("search")), + species: d("", (NativeSymbol && NativeSymbol.species) || SymbolPolyfill("species")), + split: d("", (NativeSymbol && NativeSymbol.split) || SymbolPolyfill("split")), + toPrimitive: d( + "", (NativeSymbol && NativeSymbol.toPrimitive) || SymbolPolyfill("toPrimitive") + ), + toStringTag: d( + "", (NativeSymbol && NativeSymbol.toStringTag) || SymbolPolyfill("toStringTag") + ), + unscopables: d( + "", (NativeSymbol && NativeSymbol.unscopables) || SymbolPolyfill("unscopables") + ) + }); +}; + +},{"d":15,"ext/global-this":81}],75:[function(require,module,exports){ +"use strict"; + +var d = require("d") + , validateSymbol = require("../../../validate-symbol"); + +var registry = Object.create(null); + +module.exports = function (SymbolPolyfill) { + return Object.defineProperties(SymbolPolyfill, { + for: d(function (key) { + if (registry[key]) return registry[key]; + return (registry[key] = SymbolPolyfill(String(key))); + }), + keyFor: d(function (symbol) { + var key; + validateSymbol(symbol); + for (key in registry) { + if (registry[key] === symbol) return key; + } + return undefined; + }) + }); +}; + +},{"../../../validate-symbol":77,"d":15}],76:[function(require,module,exports){ +// ES2015 Symbol polyfill for environments that do not (or partially) support it + +"use strict"; + +var d = require("d") + , validateSymbol = require("./validate-symbol") + , NativeSymbol = require("ext/global-this").Symbol + , generateName = require("./lib/private/generate-name") + , setupStandardSymbols = require("./lib/private/setup/standard-symbols") + , setupSymbolRegistry = require("./lib/private/setup/symbol-registry"); + +var create = Object.create + , defineProperties = Object.defineProperties + , defineProperty = Object.defineProperty; + +var SymbolPolyfill, HiddenSymbol, isNativeSafe; + +if (typeof NativeSymbol === "function") { + try { + String(NativeSymbol()); + isNativeSafe = true; + } catch (ignore) {} +} else { + NativeSymbol = null; +} + +// Internal constructor (not one exposed) for creating Symbol instances. +// This one is used to ensure that `someSymbol instanceof Symbol` always return false +HiddenSymbol = function Symbol(description) { + if (this instanceof HiddenSymbol) throw new TypeError("Symbol is not a constructor"); + return SymbolPolyfill(description); +}; + +// Exposed `Symbol` constructor +// (returns instances of HiddenSymbol) +module.exports = SymbolPolyfill = function Symbol(description) { + var symbol; + if (this instanceof Symbol) throw new TypeError("Symbol is not a constructor"); + if (isNativeSafe) return NativeSymbol(description); + symbol = create(HiddenSymbol.prototype); + description = description === undefined ? "" : String(description); + return defineProperties(symbol, { + __description__: d("", description), + __name__: d("", generateName(description)) + }); +}; + +setupStandardSymbols(SymbolPolyfill); +setupSymbolRegistry(SymbolPolyfill); + +// Internal tweaks for real symbol producer +defineProperties(HiddenSymbol.prototype, { + constructor: d(SymbolPolyfill), + toString: d("", function () { return this.__name__; }) +}); + +// Proper implementation of methods exposed on Symbol.prototype +// They won't be accessible on produced symbol instances as they derive from HiddenSymbol.prototype +defineProperties(SymbolPolyfill.prototype, { + toString: d(function () { return "Symbol (" + validateSymbol(this).__description__ + ")"; }), + valueOf: d(function () { return validateSymbol(this); }) +}); +defineProperty( + SymbolPolyfill.prototype, + SymbolPolyfill.toPrimitive, + d("", function () { + var symbol = validateSymbol(this); + if (typeof symbol === "symbol") return symbol; + return symbol.toString(); + }) +); +defineProperty(SymbolPolyfill.prototype, SymbolPolyfill.toStringTag, d("c", "Symbol")); + +// Proper implementaton of toPrimitive and toStringTag for returned symbol instances +defineProperty( + HiddenSymbol.prototype, SymbolPolyfill.toStringTag, + d("c", SymbolPolyfill.prototype[SymbolPolyfill.toStringTag]) +); + +// Note: It's important to define `toPrimitive` as last one, as some implementations +// implement `toPrimitive` natively without implementing `toStringTag` (or other specified symbols) +// And that may invoke error in definition flow: +// See: https://github.com/medikoo/es6-symbol/issues/13#issuecomment-164146149 +defineProperty( + HiddenSymbol.prototype, SymbolPolyfill.toPrimitive, + d("c", SymbolPolyfill.prototype[SymbolPolyfill.toPrimitive]) +); + +},{"./lib/private/generate-name":73,"./lib/private/setup/standard-symbols":74,"./lib/private/setup/symbol-registry":75,"./validate-symbol":77,"d":15,"ext/global-this":81}],77:[function(require,module,exports){ +"use strict"; + +var isSymbol = require("./is-symbol"); + +module.exports = function (value) { + if (!isSymbol(value)) throw new TypeError(value + " is not a symbol"); + return value; +}; + +},{"./is-symbol":72}],78:[function(require,module,exports){ +'use strict'; + +var d = require('d') + , callable = require('es5-ext/object/valid-callable') + + , apply = Function.prototype.apply, call = Function.prototype.call + , create = Object.create, defineProperty = Object.defineProperty + , defineProperties = Object.defineProperties + , hasOwnProperty = Object.prototype.hasOwnProperty + , descriptor = { configurable: true, enumerable: false, writable: true } + + , on, once, off, emit, methods, descriptors, base; + +on = function (type, listener) { + var data; + + callable(listener); + + if (!hasOwnProperty.call(this, '__ee__')) { + data = descriptor.value = create(null); + defineProperty(this, '__ee__', descriptor); + descriptor.value = null; + } else { + data = this.__ee__; + } + if (!data[type]) data[type] = listener; + else if (typeof data[type] === 'object') data[type].push(listener); + else data[type] = [data[type], listener]; + + return this; +}; + +once = function (type, listener) { + var once, self; + + callable(listener); + self = this; + on.call(this, type, once = function () { + off.call(self, type, once); + apply.call(listener, this, arguments); + }); + + once.__eeOnceListener__ = listener; + return this; +}; + +off = function (type, listener) { + var data, listeners, candidate, i; + + callable(listener); + + if (!hasOwnProperty.call(this, '__ee__')) return this; + data = this.__ee__; + if (!data[type]) return this; + listeners = data[type]; + + if (typeof listeners === 'object') { + for (i = 0; (candidate = listeners[i]); ++i) { + if ((candidate === listener) || + (candidate.__eeOnceListener__ === listener)) { + if (listeners.length === 2) data[type] = listeners[i ? 0 : 1]; + else listeners.splice(i, 1); + } + } + } else { + if ((listeners === listener) || + (listeners.__eeOnceListener__ === listener)) { + delete data[type]; + } + } + + return this; +}; + +emit = function (type) { + var i, l, listener, listeners, args; + + if (!hasOwnProperty.call(this, '__ee__')) return; + listeners = this.__ee__[type]; + if (!listeners) return; + + if (typeof listeners === 'object') { + l = arguments.length; + args = new Array(l - 1); + for (i = 1; i < l; ++i) args[i - 1] = arguments[i]; + + listeners = listeners.slice(); + for (i = 0; (listener = listeners[i]); ++i) { + apply.call(listener, this, args); + } + } else { + switch (arguments.length) { + case 1: + call.call(listeners, this); + break; + case 2: + call.call(listeners, this, arguments[1]); + break; + case 3: + call.call(listeners, this, arguments[1], arguments[2]); + break; + default: + l = arguments.length; + args = new Array(l - 1); + for (i = 1; i < l; ++i) { + args[i - 1] = arguments[i]; + } + apply.call(listeners, this, args); + } + } +}; + +methods = { + on: on, + once: once, + off: off, + emit: emit +}; + +descriptors = { + on: d(on), + once: d(once), + off: d(off), + emit: d(emit) +}; + +base = defineProperties({}, descriptors); + +module.exports = exports = function (o) { + return (o == null) ? create(base) : defineProperties(Object(o), descriptors); +}; +exports.methods = methods; + +},{"d":15,"es5-ext/object/valid-callable":51}],79:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -4712,2031 +6322,55 @@ function functionBindPolyfill(context) { }; } -},{}],14:[function(require,module,exports){ -(function (Buffer){ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// NOTE: These type checking functions intentionally don't use `instanceof` -// because it is fragile and can be easily faked with `Object.create()`. - -function isArray(arg) { - if (Array.isArray) { - return Array.isArray(arg); - } - return objectToString(arg) === '[object Array]'; -} -exports.isArray = isArray; - -function isBoolean(arg) { - return typeof arg === 'boolean'; -} -exports.isBoolean = isBoolean; - -function isNull(arg) { - return arg === null; -} -exports.isNull = isNull; - -function isNullOrUndefined(arg) { - return arg == null; -} -exports.isNullOrUndefined = isNullOrUndefined; - -function isNumber(arg) { - return typeof arg === 'number'; -} -exports.isNumber = isNumber; - -function isString(arg) { - return typeof arg === 'string'; -} -exports.isString = isString; - -function isSymbol(arg) { - return typeof arg === 'symbol'; -} -exports.isSymbol = isSymbol; - -function isUndefined(arg) { - return arg === void 0; -} -exports.isUndefined = isUndefined; - -function isRegExp(re) { - return objectToString(re) === '[object RegExp]'; -} -exports.isRegExp = isRegExp; - -function isObject(arg) { - return typeof arg === 'object' && arg !== null; -} -exports.isObject = isObject; - -function isDate(d) { - return objectToString(d) === '[object Date]'; -} -exports.isDate = isDate; - -function isError(e) { - return (objectToString(e) === '[object Error]' || e instanceof Error); -} -exports.isError = isError; - -function isFunction(arg) { - return typeof arg === 'function'; -} -exports.isFunction = isFunction; - -function isPrimitive(arg) { - return arg === null || - typeof arg === 'boolean' || - typeof arg === 'number' || - typeof arg === 'string' || - typeof arg === 'symbol' || // ES6 symbol - typeof arg === 'undefined'; -} -exports.isPrimitive = isPrimitive; - -exports.isBuffer = Buffer.isBuffer; - -function objectToString(o) { - return Object.prototype.toString.call(o); -} - -}).call(this,{"isBuffer":require("../../is-buffer/index.js")}) -},{"../../is-buffer/index.js":81}],15:[function(require,module,exports){ -'use strict'; - -var copy = require('es5-ext/object/copy') - , normalizeOptions = require('es5-ext/object/normalize-options') - , ensureCallable = require('es5-ext/object/valid-callable') - , map = require('es5-ext/object/map') - , callable = require('es5-ext/object/valid-callable') - , validValue = require('es5-ext/object/valid-value') - - , bind = Function.prototype.bind, defineProperty = Object.defineProperty - , hasOwnProperty = Object.prototype.hasOwnProperty - , define; - -define = function (name, desc, options) { - var value = validValue(desc) && callable(desc.value), dgs; - dgs = copy(desc); - delete dgs.writable; - delete dgs.value; - dgs.get = function () { - if (!options.overwriteDefinition && hasOwnProperty.call(this, name)) return value; - desc.value = bind.call(value, options.resolveContext ? options.resolveContext(this) : this); - defineProperty(this, name, desc); - return this[name]; - }; - return dgs; +},{}],80:[function(require,module,exports){ +var naiveFallback = function () { + if (typeof self === "object" && self) return self; + if (typeof window === "object" && window) return window; + throw new Error("Unable to resolve global `this`"); }; -module.exports = function (props/*, options*/) { - var options = normalizeOptions(arguments[1]); - if (options.resolveContext != null) ensureCallable(options.resolveContext); - return map(props, function (desc, name) { return define(name, desc, options); }); -}; - -},{"es5-ext/object/copy":39,"es5-ext/object/map":48,"es5-ext/object/normalize-options":49,"es5-ext/object/valid-callable":54,"es5-ext/object/valid-value":55}],16:[function(require,module,exports){ -'use strict'; - -var assign = require('es5-ext/object/assign') - , normalizeOpts = require('es5-ext/object/normalize-options') - , isCallable = require('es5-ext/object/is-callable') - , contains = require('es5-ext/string/#/contains') - - , d; - -d = module.exports = function (dscr, value/*, options*/) { - var c, e, w, options, desc; - if ((arguments.length < 2) || (typeof dscr !== 'string')) { - options = value; - value = dscr; - dscr = null; - } else { - options = arguments[2]; - } - if (dscr == null) { - c = w = true; - e = false; - } else { - c = contains.call(dscr, 'c'); - e = contains.call(dscr, 'e'); - w = contains.call(dscr, 'w'); - } - - desc = { value: value, configurable: c, enumerable: e, writable: w }; - return !options ? desc : assign(normalizeOpts(options), desc); -}; - -d.gs = function (dscr, get, set/*, options*/) { - var c, e, options, desc; - if (typeof dscr !== 'string') { - options = set; - set = get; - get = dscr; - dscr = null; - } else { - options = arguments[3]; - } - if (get == null) { - get = undefined; - } else if (!isCallable(get)) { - options = get; - get = set = undefined; - } else if (set == null) { - set = undefined; - } else if (!isCallable(set)) { - options = set; - set = undefined; - } - if (dscr == null) { - c = true; - e = false; - } else { - c = contains.call(dscr, 'c'); - e = contains.call(dscr, 'e'); - } - - desc = { get: get, set: set, configurable: c, enumerable: e }; - return !options ? desc : assign(normalizeOpts(options), desc); -}; - -},{"es5-ext/object/assign":36,"es5-ext/object/is-callable":42,"es5-ext/object/normalize-options":49,"es5-ext/string/#/contains":56}],17:[function(require,module,exports){ -(function (process,Buffer){ -var stream = require('readable-stream') -var eos = require('end-of-stream') -var inherits = require('inherits') -var shift = require('stream-shift') - -var SIGNAL_FLUSH = (Buffer.from && Buffer.from !== Uint8Array.from) - ? Buffer.from([0]) - : new Buffer([0]) - -var onuncork = function(self, fn) { - if (self._corked) self.once('uncork', fn) - else fn() -} - -var autoDestroy = function (self, err) { - if (self._autoDestroy) self.destroy(err) -} - -var destroyer = function(self, end) { - return function(err) { - if (err) autoDestroy(self, err.message === 'premature close' ? null : err) - else if (end && !self._ended) self.end() - } -} - -var end = function(ws, fn) { - if (!ws) return fn() - if (ws._writableState && ws._writableState.finished) return fn() - if (ws._writableState) return ws.end(fn) - ws.end() - fn() -} - -var toStreams2 = function(rs) { - return new (stream.Readable)({objectMode:true, highWaterMark:16}).wrap(rs) -} - -var Duplexify = function(writable, readable, opts) { - if (!(this instanceof Duplexify)) return new Duplexify(writable, readable, opts) - stream.Duplex.call(this, opts) - - this._writable = null - this._readable = null - this._readable2 = null - - this._autoDestroy = !opts || opts.autoDestroy !== false - this._forwardDestroy = !opts || opts.destroy !== false - this._forwardEnd = !opts || opts.end !== false - this._corked = 1 // start corked - this._ondrain = null - this._drained = false - this._forwarding = false - this._unwrite = null - this._unread = null - this._ended = false - - this.destroyed = false - - if (writable) this.setWritable(writable) - if (readable) this.setReadable(readable) -} - -inherits(Duplexify, stream.Duplex) - -Duplexify.obj = function(writable, readable, opts) { - if (!opts) opts = {} - opts.objectMode = true - opts.highWaterMark = 16 - return new Duplexify(writable, readable, opts) -} - -Duplexify.prototype.cork = function() { - if (++this._corked === 1) this.emit('cork') -} - -Duplexify.prototype.uncork = function() { - if (this._corked && --this._corked === 0) this.emit('uncork') -} - -Duplexify.prototype.setWritable = function(writable) { - if (this._unwrite) this._unwrite() - - if (this.destroyed) { - if (writable && writable.destroy) writable.destroy() - return - } - - if (writable === null || writable === false) { - this.end() - return - } - - var self = this - var unend = eos(writable, {writable:true, readable:false}, destroyer(this, this._forwardEnd)) - - var ondrain = function() { - var ondrain = self._ondrain - self._ondrain = null - if (ondrain) ondrain() - } - - var clear = function() { - self._writable.removeListener('drain', ondrain) - unend() - } - - if (this._unwrite) process.nextTick(ondrain) // force a drain on stream reset to avoid livelocks - - this._writable = writable - this._writable.on('drain', ondrain) - this._unwrite = clear - - this.uncork() // always uncork setWritable -} - -Duplexify.prototype.setReadable = function(readable) { - if (this._unread) this._unread() - - if (this.destroyed) { - if (readable && readable.destroy) readable.destroy() - return - } - - if (readable === null || readable === false) { - this.push(null) - this.resume() - return - } - - var self = this - var unend = eos(readable, {writable:false, readable:true}, destroyer(this)) - - var onreadable = function() { - self._forward() - } - - var onend = function() { - self.push(null) - } - - var clear = function() { - self._readable2.removeListener('readable', onreadable) - self._readable2.removeListener('end', onend) - unend() - } - - this._drained = true - this._readable = readable - this._readable2 = readable._readableState ? readable : toStreams2(readable) - this._readable2.on('readable', onreadable) - this._readable2.on('end', onend) - this._unread = clear - - this._forward() -} - -Duplexify.prototype._read = function() { - this._drained = true - this._forward() -} - -Duplexify.prototype._forward = function() { - if (this._forwarding || !this._readable2 || !this._drained) return - this._forwarding = true - - var data - - while (this._drained && (data = shift(this._readable2)) !== null) { - if (this.destroyed) continue - this._drained = this.push(data) - } - - this._forwarding = false -} - -Duplexify.prototype.destroy = function(err) { - if (this.destroyed) return - this.destroyed = true - - var self = this - process.nextTick(function() { - self._destroy(err) - }) -} - -Duplexify.prototype._destroy = function(err) { - if (err) { - var ondrain = this._ondrain - this._ondrain = null - if (ondrain) ondrain(err) - else this.emit('error', err) - } - - if (this._forwardDestroy) { - if (this._readable && this._readable.destroy) this._readable.destroy() - if (this._writable && this._writable.destroy) this._writable.destroy() - } - - this.emit('close') -} - -Duplexify.prototype._write = function(data, enc, cb) { - if (this.destroyed) return cb() - if (this._corked) return onuncork(this, this._write.bind(this, data, enc, cb)) - if (data === SIGNAL_FLUSH) return this._finish(cb) - if (!this._writable) return cb() - - if (this._writable.write(data) === false) this._ondrain = cb - else cb() -} - -Duplexify.prototype._finish = function(cb) { - var self = this - this.emit('preend') - onuncork(this, function() { - end(self._forwardEnd && self._writable, function() { - // haxx to not emit prefinish twice - if (self._writableState.prefinished === false) self._writableState.prefinished = true - self.emit('prefinish') - onuncork(self, cb) - }) - }) -} - -Duplexify.prototype.end = function(data, enc, cb) { - if (typeof data === 'function') return this.end(null, null, data) - if (typeof enc === 'function') return this.end(data, null, enc) - this._ended = true - if (data) this.write(data) - if (!this._writableState.ending) this.write(SIGNAL_FLUSH) - return stream.Writable.prototype.end.call(this, cb) -} - -module.exports = Duplexify - -}).call(this,require('_process'),require("buffer").Buffer) -},{"_process":92,"buffer":12,"end-of-stream":18,"inherits":80,"readable-stream":108,"stream-shift":111}],18:[function(require,module,exports){ -var once = require('once'); - -var noop = function() {}; - -var isRequest = function(stream) { - return stream.setHeader && typeof stream.abort === 'function'; -}; - -var isChildProcess = function(stream) { - return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3 -}; - -var eos = function(stream, opts, callback) { - if (typeof opts === 'function') return eos(stream, null, opts); - if (!opts) opts = {}; - - callback = once(callback || noop); - - var ws = stream._writableState; - var rs = stream._readableState; - var readable = opts.readable || (opts.readable !== false && stream.readable); - var writable = opts.writable || (opts.writable !== false && stream.writable); - - var onlegacyfinish = function() { - if (!stream.writable) onfinish(); - }; - - var onfinish = function() { - writable = false; - if (!readable) callback.call(stream); - }; - - var onend = function() { - readable = false; - if (!writable) callback.call(stream); - }; - - var onexit = function(exitCode) { - callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null); - }; - - var onerror = function(err) { - callback.call(stream, err); - }; - - var onclose = function() { - if (readable && !(rs && rs.ended)) return callback.call(stream, new Error('premature close')); - if (writable && !(ws && ws.ended)) return callback.call(stream, new Error('premature close')); - }; - - var onrequest = function() { - stream.req.on('finish', onfinish); - }; - - if (isRequest(stream)) { - stream.on('complete', onfinish); - stream.on('abort', onclose); - if (stream.req) onrequest(); - else stream.on('request', onrequest); - } else if (writable && !ws) { // legacy streams - stream.on('end', onlegacyfinish); - stream.on('close', onlegacyfinish); - } - - if (isChildProcess(stream)) stream.on('exit', onexit); - - stream.on('end', onend); - stream.on('finish', onfinish); - if (opts.error !== false) stream.on('error', onerror); - stream.on('close', onclose); - - return function() { - stream.removeListener('complete', onfinish); - stream.removeListener('abort', onclose); - stream.removeListener('request', onrequest); - if (stream.req) stream.req.removeListener('finish', onfinish); - stream.removeListener('end', onlegacyfinish); - stream.removeListener('close', onlegacyfinish); - stream.removeListener('finish', onfinish); - stream.removeListener('exit', onexit); - stream.removeListener('end', onend); - stream.removeListener('error', onerror); - stream.removeListener('close', onclose); - }; -}; - -module.exports = eos; - -},{"once":90}],19:[function(require,module,exports){ -// Inspired by Google Closure: -// http://closure-library.googlecode.com/svn/docs/ -// closure_goog_array_array.js.html#goog.array.clear - -"use strict"; - -var value = require("../../object/valid-value"); - -module.exports = function () { - value(this).length = 0; - return this; -}; - -},{"../../object/valid-value":55}],20:[function(require,module,exports){ -"use strict"; - -var numberIsNaN = require("../../number/is-nan") - , toPosInt = require("../../number/to-pos-integer") - , value = require("../../object/valid-value") - , indexOf = Array.prototype.indexOf - , objHasOwnProperty = Object.prototype.hasOwnProperty - , abs = Math.abs - , floor = Math.floor; - -module.exports = function (searchElement /*, fromIndex*/) { - var i, length, fromIndex, val; - if (!numberIsNaN(searchElement)) return indexOf.apply(this, arguments); - - length = toPosInt(value(this).length); - fromIndex = arguments[1]; - if (isNaN(fromIndex)) fromIndex = 0; - else if (fromIndex >= 0) fromIndex = floor(fromIndex); - else fromIndex = toPosInt(this.length) - floor(abs(fromIndex)); - - for (i = fromIndex; i < length; ++i) { - if (objHasOwnProperty.call(this, i)) { - val = this[i]; - if (numberIsNaN(val)) return i; // Jslint: ignore - } - } - return -1; -}; - -},{"../../number/is-nan":30,"../../number/to-pos-integer":34,"../../object/valid-value":55}],21:[function(require,module,exports){ -"use strict"; - -module.exports = require("./is-implemented")() - ? Array.from - : require("./shim"); - -},{"./is-implemented":22,"./shim":23}],22:[function(require,module,exports){ -"use strict"; - -module.exports = function () { - var from = Array.from, arr, result; - if (typeof from !== "function") return false; - arr = ["raz", "dwa"]; - result = from(arr); - return Boolean(result && (result !== arr) && (result[1] === "dwa")); -}; - -},{}],23:[function(require,module,exports){ -"use strict"; - -var iteratorSymbol = require("es6-symbol").iterator - , isArguments = require("../../function/is-arguments") - , isFunction = require("../../function/is-function") - , toPosInt = require("../../number/to-pos-integer") - , callable = require("../../object/valid-callable") - , validValue = require("../../object/valid-value") - , isValue = require("../../object/is-value") - , isString = require("../../string/is-string") - , isArray = Array.isArray - , call = Function.prototype.call - , desc = { configurable: true, enumerable: true, writable: true, value: null } - , defineProperty = Object.defineProperty; - -// eslint-disable-next-line complexity -module.exports = function (arrayLike /*, mapFn, thisArg*/) { - var mapFn = arguments[1] - , thisArg = arguments[2] - , Context - , i - , j - , arr - , length - , code - , iterator - , result - , getIterator - , value; - - arrayLike = Object(validValue(arrayLike)); - - if (isValue(mapFn)) callable(mapFn); - if (!this || this === Array || !isFunction(this)) { - // Result: Plain array - if (!mapFn) { - if (isArguments(arrayLike)) { - // Source: Arguments - length = arrayLike.length; - if (length !== 1) return Array.apply(null, arrayLike); - arr = new Array(1); - arr[0] = arrayLike[0]; - return arr; - } - if (isArray(arrayLike)) { - // Source: Array - arr = new Array(length = arrayLike.length); - for (i = 0; i < length; ++i) arr[i] = arrayLike[i]; - return arr; - } - } - arr = []; - } else { - // Result: Non plain array - Context = this; - } - - if (!isArray(arrayLike)) { - if ((getIterator = arrayLike[iteratorSymbol]) !== undefined) { - // Source: Iterator - iterator = callable(getIterator).call(arrayLike); - if (Context) arr = new Context(); - result = iterator.next(); - i = 0; - while (!result.done) { - value = mapFn ? call.call(mapFn, thisArg, result.value, i) : result.value; - if (Context) { - desc.value = value; - defineProperty(arr, i, desc); - } else { - arr[i] = value; - } - result = iterator.next(); - ++i; - } - length = i; - } else if (isString(arrayLike)) { - // Source: String - length = arrayLike.length; - if (Context) arr = new Context(); - for (i = 0, j = 0; i < length; ++i) { - value = arrayLike[i]; - if (i + 1 < length) { - code = value.charCodeAt(0); - // eslint-disable-next-line max-depth - if (code >= 0xd800 && code <= 0xdbff) value += arrayLike[++i]; - } - value = mapFn ? call.call(mapFn, thisArg, value, j) : value; - if (Context) { - desc.value = value; - defineProperty(arr, j, desc); - } else { - arr[j] = value; - } - ++j; - } - length = j; - } - } - if (length === undefined) { - // Source: array or array-like - length = toPosInt(arrayLike.length); - if (Context) arr = new Context(length); - for (i = 0; i < length; ++i) { - value = mapFn ? call.call(mapFn, thisArg, arrayLike[i], i) : arrayLike[i]; - if (Context) { - desc.value = value; - defineProperty(arr, i, desc); - } else { - arr[i] = value; - } - } - } - if (Context) { - desc.value = null; - arr.length = length; - } - return arr; -}; - -},{"../../function/is-arguments":24,"../../function/is-function":25,"../../number/to-pos-integer":34,"../../object/is-value":44,"../../object/valid-callable":54,"../../object/valid-value":55,"../../string/is-string":59,"es6-symbol":73}],24:[function(require,module,exports){ -"use strict"; - -var objToString = Object.prototype.toString - , id = objToString.call( - (function () { - return arguments; - })() -); - -module.exports = function (value) { - return objToString.call(value) === id; -}; - -},{}],25:[function(require,module,exports){ -"use strict"; - -var objToString = Object.prototype.toString, id = objToString.call(require("./noop")); - -module.exports = function (value) { - return typeof value === "function" && objToString.call(value) === id; -}; - -},{"./noop":26}],26:[function(require,module,exports){ -"use strict"; - -// eslint-disable-next-line no-empty-function -module.exports = function () {}; - -},{}],27:[function(require,module,exports){ -"use strict"; - -module.exports = require("./is-implemented")() - ? Math.sign - : require("./shim"); - -},{"./is-implemented":28,"./shim":29}],28:[function(require,module,exports){ -"use strict"; - -module.exports = function () { - var sign = Math.sign; - if (typeof sign !== "function") return false; - return (sign(10) === 1) && (sign(-20) === -1); -}; - -},{}],29:[function(require,module,exports){ -"use strict"; - -module.exports = function (value) { - value = Number(value); - if (isNaN(value) || (value === 0)) return value; - return value > 0 ? 1 : -1; -}; - -},{}],30:[function(require,module,exports){ -"use strict"; - -module.exports = require("./is-implemented")() - ? Number.isNaN - : require("./shim"); - -},{"./is-implemented":31,"./shim":32}],31:[function(require,module,exports){ -"use strict"; - -module.exports = function () { - var numberIsNaN = Number.isNaN; - if (typeof numberIsNaN !== "function") return false; - return !numberIsNaN({}) && numberIsNaN(NaN) && !numberIsNaN(34); -}; - -},{}],32:[function(require,module,exports){ -"use strict"; - -module.exports = function (value) { - // eslint-disable-next-line no-self-compare - return value !== value; -}; - -},{}],33:[function(require,module,exports){ -"use strict"; - -var sign = require("../math/sign") - - , abs = Math.abs, floor = Math.floor; - -module.exports = function (value) { - if (isNaN(value)) return 0; - value = Number(value); - if ((value === 0) || !isFinite(value)) return value; - return sign(value) * floor(abs(value)); -}; - -},{"../math/sign":27}],34:[function(require,module,exports){ -"use strict"; - -var toInteger = require("./to-integer") - - , max = Math.max; - -module.exports = function (value) { - return max(0, toInteger(value)); -}; - -},{"./to-integer":33}],35:[function(require,module,exports){ -// Internal method, used by iteration functions. -// Calls a function for each key-value pair found in object -// Optionally takes compareFn to iterate object in specific order - -"use strict"; - -var callable = require("./valid-callable") - , value = require("./valid-value") - , bind = Function.prototype.bind - , call = Function.prototype.call - , keys = Object.keys - , objPropertyIsEnumerable = Object.prototype.propertyIsEnumerable; - -module.exports = function (method, defVal) { - return function (obj, cb /*, thisArg, compareFn*/) { - var list, thisArg = arguments[2], compareFn = arguments[3]; - obj = Object(value(obj)); - callable(cb); - - list = keys(obj); - if (compareFn) { - list.sort(typeof compareFn === "function" ? bind.call(compareFn, obj) : undefined); - } - if (typeof method !== "function") method = list[method]; - return call.call(method, list, function (key, index) { - if (!objPropertyIsEnumerable.call(obj, key)) return defVal; - return call.call(cb, thisArg, obj[key], key, obj, index); - }); - }; -}; - -},{"./valid-callable":54,"./valid-value":55}],36:[function(require,module,exports){ -"use strict"; - -module.exports = require("./is-implemented")() - ? Object.assign - : require("./shim"); - -},{"./is-implemented":37,"./shim":38}],37:[function(require,module,exports){ -"use strict"; - -module.exports = function () { - var assign = Object.assign, obj; - if (typeof assign !== "function") return false; - obj = { foo: "raz" }; - assign(obj, { bar: "dwa" }, { trzy: "trzy" }); - return (obj.foo + obj.bar + obj.trzy) === "razdwatrzy"; -}; - -},{}],38:[function(require,module,exports){ -"use strict"; - -var keys = require("../keys") - , value = require("../valid-value") - , max = Math.max; - -module.exports = function (dest, src /*, …srcn*/) { - var error, i, length = max(arguments.length, 2), assign; - dest = Object(value(dest)); - assign = function (key) { - try { - dest[key] = src[key]; - } catch (e) { - if (!error) error = e; - } - }; - for (i = 1; i < length; ++i) { - src = arguments[i]; - keys(src).forEach(assign); - } - if (error !== undefined) throw error; - return dest; -}; - -},{"../keys":45,"../valid-value":55}],39:[function(require,module,exports){ -"use strict"; - -var aFrom = require("../array/from") - , assign = require("./assign") - , value = require("./valid-value"); - -module.exports = function (obj/*, propertyNames, options*/) { - var copy = Object(value(obj)), propertyNames = arguments[1], options = Object(arguments[2]); - if (copy !== obj && !propertyNames) return copy; - var result = {}; - if (propertyNames) { - aFrom(propertyNames, function (propertyName) { - if (options.ensure || propertyName in obj) result[propertyName] = obj[propertyName]; - }); - } else { - assign(result, obj); - } - return result; -}; - -},{"../array/from":21,"./assign":36,"./valid-value":55}],40:[function(require,module,exports){ -// Workaround for http://code.google.com/p/v8/issues/detail?id=2804 - -"use strict"; - -var create = Object.create, shim; - -if (!require("./set-prototype-of/is-implemented")()) { - shim = require("./set-prototype-of/shim"); -} - module.exports = (function () { - var nullObject, polyProps, desc; - if (!shim) return create; - if (shim.level !== 1) return create; + if (this) return this; - nullObject = {}; - polyProps = {}; - desc = { - configurable: false, - enumerable: false, - writable: true, - value: undefined - }; - Object.getOwnPropertyNames(Object.prototype).forEach(function (name) { - if (name === "__proto__") { - polyProps[name] = { - configurable: true, - enumerable: false, - writable: true, - value: undefined - }; - return; - } - polyProps[name] = desc; - }); - Object.defineProperties(nullObject, polyProps); + // Unexpected strict mode (may happen if e.g. bundled into ESM module) - Object.defineProperty(shim, "nullPolyfill", { - configurable: false, - enumerable: false, - writable: false, - value: nullObject - }); - - return function (prototype, props) { - return create(prototype === null ? nullObject : prototype, props); - }; -}()); - -},{"./set-prototype-of/is-implemented":52,"./set-prototype-of/shim":53}],41:[function(require,module,exports){ -"use strict"; - -module.exports = require("./_iterate")("forEach"); - -},{"./_iterate":35}],42:[function(require,module,exports){ -// Deprecated - -"use strict"; - -module.exports = function (obj) { - return typeof obj === "function"; -}; - -},{}],43:[function(require,module,exports){ -"use strict"; - -var isValue = require("./is-value"); - -var map = { function: true, object: true }; - -module.exports = function (value) { - return (isValue(value) && map[typeof value]) || false; -}; - -},{"./is-value":44}],44:[function(require,module,exports){ -"use strict"; - -var _undefined = require("../function/noop")(); // Support ES3 engines - -module.exports = function (val) { - return (val !== _undefined) && (val !== null); -}; - -},{"../function/noop":26}],45:[function(require,module,exports){ -"use strict"; - -module.exports = require("./is-implemented")() ? Object.keys : require("./shim"); - -},{"./is-implemented":46,"./shim":47}],46:[function(require,module,exports){ -"use strict"; - -module.exports = function () { + // Thanks @mathiasbynens -> https://mathiasbynens.be/notes/globalthis + // In all ES5+ engines global object inherits from Object.prototype + // (if you approached one that doesn't please report) try { - Object.keys("primitive"); - return true; - } catch (e) { - return false; - } -}; - -},{}],47:[function(require,module,exports){ -"use strict"; - -var isValue = require("../is-value"); - -var keys = Object.keys; - -module.exports = function (object) { return keys(isValue(object) ? Object(object) : object); }; - -},{"../is-value":44}],48:[function(require,module,exports){ -"use strict"; - -var callable = require("./valid-callable") - , forEach = require("./for-each") - , call = Function.prototype.call; - -module.exports = function (obj, cb /*, thisArg*/) { - var result = {}, thisArg = arguments[2]; - callable(cb); - forEach(obj, function (value, key, targetObj, index) { - result[key] = call.call(cb, thisArg, value, key, targetObj, index); - }); - return result; -}; - -},{"./for-each":41,"./valid-callable":54}],49:[function(require,module,exports){ -"use strict"; - -var isValue = require("./is-value"); - -var forEach = Array.prototype.forEach, create = Object.create; - -var process = function (src, obj) { - var key; - for (key in src) obj[key] = src[key]; -}; - -// eslint-disable-next-line no-unused-vars -module.exports = function (opts1 /*, …options*/) { - var result = create(null); - forEach.call(arguments, function (options) { - if (!isValue(options)) return; - process(Object(options), result); - }); - return result; -}; - -},{"./is-value":44}],50:[function(require,module,exports){ -"use strict"; - -var forEach = Array.prototype.forEach, create = Object.create; - -// eslint-disable-next-line no-unused-vars -module.exports = function (arg /*, …args*/) { - var set = create(null); - forEach.call(arguments, function (name) { - set[name] = true; - }); - return set; -}; - -},{}],51:[function(require,module,exports){ -"use strict"; - -module.exports = require("./is-implemented")() - ? Object.setPrototypeOf - : require("./shim"); - -},{"./is-implemented":52,"./shim":53}],52:[function(require,module,exports){ -"use strict"; - -var create = Object.create, getPrototypeOf = Object.getPrototypeOf, plainObject = {}; - -module.exports = function (/* CustomCreate*/) { - var setPrototypeOf = Object.setPrototypeOf, customCreate = arguments[0] || create; - if (typeof setPrototypeOf !== "function") return false; - return getPrototypeOf(setPrototypeOf(customCreate(null), plainObject)) === plainObject; -}; - -},{}],53:[function(require,module,exports){ -/* eslint no-proto: "off" */ - -// Big thanks to @WebReflection for sorting this out -// https://gist.github.com/WebReflection/5593554 - -"use strict"; - -var isObject = require("../is-object") - , value = require("../valid-value") - , objIsPrototypeOf = Object.prototype.isPrototypeOf - , defineProperty = Object.defineProperty - , nullDesc = { - configurable: true, - enumerable: false, - writable: true, - value: undefined -} - , validate; - -validate = function (obj, prototype) { - value(obj); - if (prototype === null || isObject(prototype)) return obj; - throw new TypeError("Prototype must be null or an object"); -}; - -module.exports = (function (status) { - var fn, set; - if (!status) return null; - if (status.level === 2) { - if (status.set) { - set = status.set; - fn = function (obj, prototype) { - set.call(validate(obj, prototype), prototype); - return obj; - }; - } else { - fn = function (obj, prototype) { - validate(obj, prototype).__proto__ = prototype; - return obj; - }; - } - } else { - fn = function self(obj, prototype) { - var isNullBase; - validate(obj, prototype); - isNullBase = objIsPrototypeOf.call(self.nullPolyfill, obj); - if (isNullBase) delete self.nullPolyfill.__proto__; - if (prototype === null) prototype = self.nullPolyfill; - obj.__proto__ = prototype; - if (isNullBase) defineProperty(self.nullPolyfill, "__proto__", nullDesc); - return obj; - }; - } - return Object.defineProperty(fn, "level", { - configurable: false, - enumerable: false, - writable: false, - value: status.level - }); -}( - (function () { - var tmpObj1 = Object.create(null) - , tmpObj2 = {} - , set - , desc = Object.getOwnPropertyDescriptor(Object.prototype, "__proto__"); - - if (desc) { - try { - set = desc.set; // Opera crashes at this point - set.call(tmpObj1, tmpObj2); - } catch (ignore) {} - if (Object.getPrototypeOf(tmpObj1) === tmpObj2) return { set: set, level: 2 }; - } - - tmpObj1.__proto__ = tmpObj2; - if (Object.getPrototypeOf(tmpObj1) === tmpObj2) return { level: 2 }; - - tmpObj1 = {}; - tmpObj1.__proto__ = tmpObj2; - if (Object.getPrototypeOf(tmpObj1) === tmpObj2) return { level: 1 }; - - return false; - })() -)); - -require("../create"); - -},{"../create":40,"../is-object":43,"../valid-value":55}],54:[function(require,module,exports){ -"use strict"; - -module.exports = function (fn) { - if (typeof fn !== "function") throw new TypeError(fn + " is not a function"); - return fn; -}; - -},{}],55:[function(require,module,exports){ -"use strict"; - -var isValue = require("./is-value"); - -module.exports = function (value) { - if (!isValue(value)) throw new TypeError("Cannot use null or undefined"); - return value; -}; - -},{"./is-value":44}],56:[function(require,module,exports){ -"use strict"; - -module.exports = require("./is-implemented")() - ? String.prototype.contains - : require("./shim"); - -},{"./is-implemented":57,"./shim":58}],57:[function(require,module,exports){ -"use strict"; - -var str = "razdwatrzy"; - -module.exports = function () { - if (typeof str.contains !== "function") return false; - return (str.contains("dwa") === true) && (str.contains("foo") === false); -}; - -},{}],58:[function(require,module,exports){ -"use strict"; - -var indexOf = String.prototype.indexOf; - -module.exports = function (searchString/*, position*/) { - return indexOf.call(this, searchString, arguments[1]) > -1; -}; - -},{}],59:[function(require,module,exports){ -"use strict"; - -var objToString = Object.prototype.toString, id = objToString.call(""); - -module.exports = function (value) { - return ( - typeof value === "string" || - (value && - typeof value === "object" && - (value instanceof String || objToString.call(value) === id)) || - false - ); -}; - -},{}],60:[function(require,module,exports){ -"use strict"; - -var setPrototypeOf = require("es5-ext/object/set-prototype-of") - , contains = require("es5-ext/string/#/contains") - , d = require("d") - , Symbol = require("es6-symbol") - , Iterator = require("./"); - -var defineProperty = Object.defineProperty, ArrayIterator; - -ArrayIterator = module.exports = function (arr, kind) { - if (!(this instanceof ArrayIterator)) throw new TypeError("Constructor requires 'new'"); - Iterator.call(this, arr); - if (!kind) kind = "value"; - else if (contains.call(kind, "key+value")) kind = "key+value"; - else if (contains.call(kind, "key")) kind = "key"; - else kind = "value"; - defineProperty(this, "__kind__", d("", kind)); -}; -if (setPrototypeOf) setPrototypeOf(ArrayIterator, Iterator); - -// Internal %ArrayIteratorPrototype% doesn't expose its constructor -delete ArrayIterator.prototype.constructor; - -ArrayIterator.prototype = Object.create(Iterator.prototype, { - _resolve: d(function (i) { - if (this.__kind__ === "value") return this.__list__[i]; - if (this.__kind__ === "key+value") return [i, this.__list__[i]]; - return i; - }) -}); -defineProperty(ArrayIterator.prototype, Symbol.toStringTag, d("c", "Array Iterator")); - -},{"./":63,"d":16,"es5-ext/object/set-prototype-of":51,"es5-ext/string/#/contains":56,"es6-symbol":73}],61:[function(require,module,exports){ -"use strict"; - -var isArguments = require("es5-ext/function/is-arguments") - , callable = require("es5-ext/object/valid-callable") - , isString = require("es5-ext/string/is-string") - , get = require("./get"); - -var isArray = Array.isArray, call = Function.prototype.call, some = Array.prototype.some; - -module.exports = function (iterable, cb /*, thisArg*/) { - var mode, thisArg = arguments[2], result, doBreak, broken, i, length, char, code; - if (isArray(iterable) || isArguments(iterable)) mode = "array"; - else if (isString(iterable)) mode = "string"; - else iterable = get(iterable); - - callable(cb); - doBreak = function () { - broken = true; - }; - if (mode === "array") { - some.call(iterable, function (value) { - call.call(cb, thisArg, value, doBreak); - return broken; + Object.defineProperty(Object.prototype, "__global__", { + get: function () { return this; }, + configurable: true }); - return; + } catch (error) { + // Unfortunate case of Object.prototype being sealed (via preventExtensions, seal or freeze) + return naiveFallback(); } - if (mode === "string") { - length = iterable.length; - for (i = 0; i < length; ++i) { - char = iterable[i]; - if (i + 1 < length) { - code = char.charCodeAt(0); - if (code >= 0xd800 && code <= 0xdbff) char += iterable[++i]; - } - call.call(cb, thisArg, char, doBreak); - if (broken) break; - } - return; + try { + // Safari case (window.__global__ is resolved with global context, but __global__ does not) + if (!__global__) return naiveFallback(); + return __global__; + } finally { + delete Object.prototype.__global__; } - result = iterable.next(); +})(); - while (!result.done) { - call.call(cb, thisArg, result.value, doBreak); - if (broken) return; - result = iterable.next(); - } -}; - -},{"./get":62,"es5-ext/function/is-arguments":24,"es5-ext/object/valid-callable":54,"es5-ext/string/is-string":59}],62:[function(require,module,exports){ +},{}],81:[function(require,module,exports){ "use strict"; -var isArguments = require("es5-ext/function/is-arguments") - , isString = require("es5-ext/string/is-string") - , ArrayIterator = require("./array") - , StringIterator = require("./string") - , iterable = require("./valid-iterable") - , iteratorSymbol = require("es6-symbol").iterator; +module.exports = require("./is-implemented")() ? globalThis : require("./implementation"); -module.exports = function (obj) { - if (typeof iterable(obj)[iteratorSymbol] === "function") return obj[iteratorSymbol](); - if (isArguments(obj)) return new ArrayIterator(obj); - if (isString(obj)) return new StringIterator(obj); - return new ArrayIterator(obj); -}; - -},{"./array":60,"./string":65,"./valid-iterable":66,"es5-ext/function/is-arguments":24,"es5-ext/string/is-string":59,"es6-symbol":73}],63:[function(require,module,exports){ +},{"./implementation":80,"./is-implemented":82}],82:[function(require,module,exports){ "use strict"; -var clear = require("es5-ext/array/#/clear") - , assign = require("es5-ext/object/assign") - , callable = require("es5-ext/object/valid-callable") - , value = require("es5-ext/object/valid-value") - , d = require("d") - , autoBind = require("d/auto-bind") - , Symbol = require("es6-symbol"); - -var defineProperty = Object.defineProperty, defineProperties = Object.defineProperties, Iterator; - -module.exports = Iterator = function (list, context) { - if (!(this instanceof Iterator)) throw new TypeError("Constructor requires 'new'"); - defineProperties(this, { - __list__: d("w", value(list)), - __context__: d("w", context), - __nextIndex__: d("w", 0) - }); - if (!context) return; - callable(context.on); - context.on("_add", this._onAdd); - context.on("_delete", this._onDelete); - context.on("_clear", this._onClear); -}; - -// Internal %IteratorPrototype% doesn't expose its constructor -delete Iterator.prototype.constructor; - -defineProperties( - Iterator.prototype, - assign( - { - _next: d(function () { - var i; - if (!this.__list__) return undefined; - if (this.__redo__) { - i = this.__redo__.shift(); - if (i !== undefined) return i; - } - if (this.__nextIndex__ < this.__list__.length) return this.__nextIndex__++; - this._unBind(); - return undefined; - }), - next: d(function () { - return this._createResult(this._next()); - }), - _createResult: d(function (i) { - if (i === undefined) return { done: true, value: undefined }; - return { done: false, value: this._resolve(i) }; - }), - _resolve: d(function (i) { - return this.__list__[i]; - }), - _unBind: d(function () { - this.__list__ = null; - delete this.__redo__; - if (!this.__context__) return; - this.__context__.off("_add", this._onAdd); - this.__context__.off("_delete", this._onDelete); - this.__context__.off("_clear", this._onClear); - this.__context__ = null; - }), - toString: d(function () { - return "[object " + (this[Symbol.toStringTag] || "Object") + "]"; - }) - }, - autoBind({ - _onAdd: d(function (index) { - if (index >= this.__nextIndex__) return; - ++this.__nextIndex__; - if (!this.__redo__) { - defineProperty(this, "__redo__", d("c", [index])); - return; - } - this.__redo__.forEach(function (redo, i) { - if (redo >= index) this.__redo__[i] = ++redo; - }, this); - this.__redo__.push(index); - }), - _onDelete: d(function (index) { - var i; - if (index >= this.__nextIndex__) return; - --this.__nextIndex__; - if (!this.__redo__) return; - i = this.__redo__.indexOf(index); - if (i !== -1) this.__redo__.splice(i, 1); - this.__redo__.forEach(function (redo, j) { - if (redo > index) this.__redo__[j] = --redo; - }, this); - }), - _onClear: d(function () { - if (this.__redo__) clear.call(this.__redo__); - this.__nextIndex__ = 0; - }) - }) - ) -); - -defineProperty( - Iterator.prototype, - Symbol.iterator, - d(function () { - return this; - }) -); - -},{"d":16,"d/auto-bind":15,"es5-ext/array/#/clear":19,"es5-ext/object/assign":36,"es5-ext/object/valid-callable":54,"es5-ext/object/valid-value":55,"es6-symbol":73}],64:[function(require,module,exports){ -"use strict"; - -var isArguments = require("es5-ext/function/is-arguments") - , isValue = require("es5-ext/object/is-value") - , isString = require("es5-ext/string/is-string"); - -var iteratorSymbol = require("es6-symbol").iterator - , isArray = Array.isArray; - -module.exports = function (value) { - if (!isValue(value)) return false; - if (isArray(value)) return true; - if (isString(value)) return true; - if (isArguments(value)) return true; - return typeof value[iteratorSymbol] === "function"; -}; - -},{"es5-ext/function/is-arguments":24,"es5-ext/object/is-value":44,"es5-ext/string/is-string":59,"es6-symbol":73}],65:[function(require,module,exports){ -// Thanks @mathiasbynens -// http://mathiasbynens.be/notes/javascript-unicode#iterating-over-symbols - -"use strict"; - -var setPrototypeOf = require("es5-ext/object/set-prototype-of") - , d = require("d") - , Symbol = require("es6-symbol") - , Iterator = require("./"); - -var defineProperty = Object.defineProperty, StringIterator; - -StringIterator = module.exports = function (str) { - if (!(this instanceof StringIterator)) throw new TypeError("Constructor requires 'new'"); - str = String(str); - Iterator.call(this, str); - defineProperty(this, "__length__", d("", str.length)); -}; -if (setPrototypeOf) setPrototypeOf(StringIterator, Iterator); - -// Internal %ArrayIteratorPrototype% doesn't expose its constructor -delete StringIterator.prototype.constructor; - -StringIterator.prototype = Object.create(Iterator.prototype, { - _next: d(function () { - if (!this.__list__) return undefined; - if (this.__nextIndex__ < this.__length__) return this.__nextIndex__++; - this._unBind(); - return undefined; - }), - _resolve: d(function (i) { - var char = this.__list__[i], code; - if (this.__nextIndex__ === this.__length__) return char; - code = char.charCodeAt(0); - if (code >= 0xd800 && code <= 0xdbff) return char + this.__list__[this.__nextIndex__++]; - return char; - }) -}); -defineProperty(StringIterator.prototype, Symbol.toStringTag, d("c", "String Iterator")); - -},{"./":63,"d":16,"es5-ext/object/set-prototype-of":51,"es6-symbol":73}],66:[function(require,module,exports){ -"use strict"; - -var isIterable = require("./is-iterable"); - -module.exports = function (value) { - if (!isIterable(value)) throw new TypeError(value + " is not iterable"); - return value; -}; - -},{"./is-iterable":64}],67:[function(require,module,exports){ -'use strict'; - -module.exports = require('./is-implemented')() ? Map : require('./polyfill'); - -},{"./is-implemented":68,"./polyfill":72}],68:[function(require,module,exports){ -'use strict'; - module.exports = function () { - var map, iterator, result; - if (typeof Map !== 'function') return false; - try { - // WebKit doesn't support arguments and crashes - map = new Map([['raz', 'one'], ['dwa', 'two'], ['trzy', 'three']]); - } catch (e) { - return false; - } - if (String(map) !== '[object Map]') return false; - if (map.size !== 3) return false; - if (typeof map.clear !== 'function') return false; - if (typeof map.delete !== 'function') return false; - if (typeof map.entries !== 'function') return false; - if (typeof map.forEach !== 'function') return false; - if (typeof map.get !== 'function') return false; - if (typeof map.has !== 'function') return false; - if (typeof map.keys !== 'function') return false; - if (typeof map.set !== 'function') return false; - if (typeof map.values !== 'function') return false; - - iterator = map.entries(); - result = iterator.next(); - if (result.done !== false) return false; - if (!result.value) return false; - if (result.value[0] !== 'raz') return false; - if (result.value[1] !== 'one') return false; - - return true; + if (typeof globalThis !== "object") return false; + if (!globalThis) return false; + return globalThis.Array === Array; }; -},{}],69:[function(require,module,exports){ -// Exports true if environment provides native `Map` implementation, -// whatever that is. - -'use strict'; - -module.exports = (function () { - if (typeof Map === 'undefined') return false; - return (Object.prototype.toString.call(new Map()) === '[object Map]'); -}()); - -},{}],70:[function(require,module,exports){ -'use strict'; - -module.exports = require('es5-ext/object/primitive-set')('key', - 'value', 'key+value'); - -},{"es5-ext/object/primitive-set":50}],71:[function(require,module,exports){ -'use strict'; - -var setPrototypeOf = require('es5-ext/object/set-prototype-of') - , d = require('d') - , Iterator = require('es6-iterator') - , toStringTagSymbol = require('es6-symbol').toStringTag - , kinds = require('./iterator-kinds') - - , defineProperties = Object.defineProperties - , unBind = Iterator.prototype._unBind - , MapIterator; - -MapIterator = module.exports = function (map, kind) { - if (!(this instanceof MapIterator)) return new MapIterator(map, kind); - Iterator.call(this, map.__mapKeysData__, map); - if (!kind || !kinds[kind]) kind = 'key+value'; - defineProperties(this, { - __kind__: d('', kind), - __values__: d('w', map.__mapValuesData__) - }); -}; -if (setPrototypeOf) setPrototypeOf(MapIterator, Iterator); - -MapIterator.prototype = Object.create(Iterator.prototype, { - constructor: d(MapIterator), - _resolve: d(function (i) { - if (this.__kind__ === 'value') return this.__values__[i]; - if (this.__kind__ === 'key') return this.__list__[i]; - return [this.__list__[i], this.__values__[i]]; - }), - _unBind: d(function () { - this.__values__ = null; - unBind.call(this); - }), - toString: d(function () { return '[object Map Iterator]'; }) -}); -Object.defineProperty(MapIterator.prototype, toStringTagSymbol, - d('c', 'Map Iterator')); - -},{"./iterator-kinds":70,"d":16,"es5-ext/object/set-prototype-of":51,"es6-iterator":63,"es6-symbol":73}],72:[function(require,module,exports){ -'use strict'; - -var clear = require('es5-ext/array/#/clear') - , eIndexOf = require('es5-ext/array/#/e-index-of') - , setPrototypeOf = require('es5-ext/object/set-prototype-of') - , callable = require('es5-ext/object/valid-callable') - , validValue = require('es5-ext/object/valid-value') - , d = require('d') - , ee = require('event-emitter') - , Symbol = require('es6-symbol') - , iterator = require('es6-iterator/valid-iterable') - , forOf = require('es6-iterator/for-of') - , Iterator = require('./lib/iterator') - , isNative = require('./is-native-implemented') - - , call = Function.prototype.call - , defineProperties = Object.defineProperties, getPrototypeOf = Object.getPrototypeOf - , MapPoly; - -module.exports = MapPoly = function (/*iterable*/) { - var iterable = arguments[0], keys, values, self; - if (!(this instanceof MapPoly)) throw new TypeError('Constructor requires \'new\''); - if (isNative && setPrototypeOf && (Map !== MapPoly)) { - self = setPrototypeOf(new Map(), getPrototypeOf(this)); - } else { - self = this; - } - if (iterable != null) iterator(iterable); - defineProperties(self, { - __mapKeysData__: d('c', keys = []), - __mapValuesData__: d('c', values = []) - }); - if (!iterable) return self; - forOf(iterable, function (value) { - var key = validValue(value)[0]; - value = value[1]; - if (eIndexOf.call(keys, key) !== -1) return; - keys.push(key); - values.push(value); - }, self); - return self; -}; - -if (isNative) { - if (setPrototypeOf) setPrototypeOf(MapPoly, Map); - MapPoly.prototype = Object.create(Map.prototype, { - constructor: d(MapPoly) - }); -} - -ee(defineProperties(MapPoly.prototype, { - clear: d(function () { - if (!this.__mapKeysData__.length) return; - clear.call(this.__mapKeysData__); - clear.call(this.__mapValuesData__); - this.emit('_clear'); - }), - delete: d(function (key) { - var index = eIndexOf.call(this.__mapKeysData__, key); - if (index === -1) return false; - this.__mapKeysData__.splice(index, 1); - this.__mapValuesData__.splice(index, 1); - this.emit('_delete', index, key); - return true; - }), - entries: d(function () { return new Iterator(this, 'key+value'); }), - forEach: d(function (cb/*, thisArg*/) { - var thisArg = arguments[1], iterator, result; - callable(cb); - iterator = this.entries(); - result = iterator._next(); - while (result !== undefined) { - call.call(cb, thisArg, this.__mapValuesData__[result], - this.__mapKeysData__[result], this); - result = iterator._next(); - } - }), - get: d(function (key) { - var index = eIndexOf.call(this.__mapKeysData__, key); - if (index === -1) return; - return this.__mapValuesData__[index]; - }), - has: d(function (key) { - return (eIndexOf.call(this.__mapKeysData__, key) !== -1); - }), - keys: d(function () { return new Iterator(this, 'key'); }), - set: d(function (key, value) { - var index = eIndexOf.call(this.__mapKeysData__, key), emit; - if (index === -1) { - index = this.__mapKeysData__.push(key) - 1; - emit = true; - } - this.__mapValuesData__[index] = value; - if (emit) this.emit('_add', index, key); - return this; - }), - size: d.gs(function () { return this.__mapKeysData__.length; }), - values: d(function () { return new Iterator(this, 'value'); }), - toString: d(function () { return '[object Map]'; }) -})); -Object.defineProperty(MapPoly.prototype, Symbol.iterator, d(function () { - return this.entries(); -})); -Object.defineProperty(MapPoly.prototype, Symbol.toStringTag, d('c', 'Map')); - -},{"./is-native-implemented":69,"./lib/iterator":71,"d":16,"es5-ext/array/#/clear":19,"es5-ext/array/#/e-index-of":20,"es5-ext/object/set-prototype-of":51,"es5-ext/object/valid-callable":54,"es5-ext/object/valid-value":55,"es6-iterator/for-of":61,"es6-iterator/valid-iterable":66,"es6-symbol":73,"event-emitter":78}],73:[function(require,module,exports){ -'use strict'; - -module.exports = require('./is-implemented')() ? Symbol : require('./polyfill'); - -},{"./is-implemented":74,"./polyfill":76}],74:[function(require,module,exports){ -'use strict'; - -var validTypes = { object: true, symbol: true }; - -module.exports = function () { - var symbol; - if (typeof Symbol !== 'function') return false; - symbol = Symbol('test symbol'); - try { String(symbol); } catch (e) { return false; } - - // Return 'true' also for polyfills - if (!validTypes[typeof Symbol.iterator]) return false; - if (!validTypes[typeof Symbol.toPrimitive]) return false; - if (!validTypes[typeof Symbol.toStringTag]) return false; - - return true; -}; - -},{}],75:[function(require,module,exports){ -'use strict'; - -module.exports = function (x) { - if (!x) return false; - if (typeof x === 'symbol') return true; - if (!x.constructor) return false; - if (x.constructor.name !== 'Symbol') return false; - return (x[x.constructor.toStringTag] === 'Symbol'); -}; - -},{}],76:[function(require,module,exports){ -// ES2015 Symbol polyfill for environments that do not (or partially) support it - -'use strict'; - -var d = require('d') - , validateSymbol = require('./validate-symbol') - - , create = Object.create, defineProperties = Object.defineProperties - , defineProperty = Object.defineProperty, objPrototype = Object.prototype - , NativeSymbol, SymbolPolyfill, HiddenSymbol, globalSymbols = create(null) - , isNativeSafe; - -if (typeof Symbol === 'function') { - NativeSymbol = Symbol; - try { - String(NativeSymbol()); - isNativeSafe = true; - } catch (ignore) {} -} - -var generateName = (function () { - var created = create(null); - return function (desc) { - var postfix = 0, name, ie11BugWorkaround; - while (created[desc + (postfix || '')]) ++postfix; - desc += (postfix || ''); - created[desc] = true; - name = '@@' + desc; - defineProperty(objPrototype, name, d.gs(null, function (value) { - // For IE11 issue see: - // https://connect.microsoft.com/IE/feedbackdetail/view/1928508/ - // ie11-broken-getters-on-dom-objects - // https://github.com/medikoo/es6-symbol/issues/12 - if (ie11BugWorkaround) return; - ie11BugWorkaround = true; - defineProperty(this, name, d(value)); - ie11BugWorkaround = false; - })); - return name; - }; -}()); - -// Internal constructor (not one exposed) for creating Symbol instances. -// This one is used to ensure that `someSymbol instanceof Symbol` always return false -HiddenSymbol = function Symbol(description) { - if (this instanceof HiddenSymbol) throw new TypeError('Symbol is not a constructor'); - return SymbolPolyfill(description); -}; - -// Exposed `Symbol` constructor -// (returns instances of HiddenSymbol) -module.exports = SymbolPolyfill = function Symbol(description) { - var symbol; - if (this instanceof Symbol) throw new TypeError('Symbol is not a constructor'); - if (isNativeSafe) return NativeSymbol(description); - symbol = create(HiddenSymbol.prototype); - description = (description === undefined ? '' : String(description)); - return defineProperties(symbol, { - __description__: d('', description), - __name__: d('', generateName(description)) - }); -}; -defineProperties(SymbolPolyfill, { - for: d(function (key) { - if (globalSymbols[key]) return globalSymbols[key]; - return (globalSymbols[key] = SymbolPolyfill(String(key))); - }), - keyFor: d(function (s) { - var key; - validateSymbol(s); - for (key in globalSymbols) if (globalSymbols[key] === s) return key; - }), - - // To ensure proper interoperability with other native functions (e.g. Array.from) - // fallback to eventual native implementation of given symbol - hasInstance: d('', (NativeSymbol && NativeSymbol.hasInstance) || SymbolPolyfill('hasInstance')), - isConcatSpreadable: d('', (NativeSymbol && NativeSymbol.isConcatSpreadable) || - SymbolPolyfill('isConcatSpreadable')), - iterator: d('', (NativeSymbol && NativeSymbol.iterator) || SymbolPolyfill('iterator')), - match: d('', (NativeSymbol && NativeSymbol.match) || SymbolPolyfill('match')), - replace: d('', (NativeSymbol && NativeSymbol.replace) || SymbolPolyfill('replace')), - search: d('', (NativeSymbol && NativeSymbol.search) || SymbolPolyfill('search')), - species: d('', (NativeSymbol && NativeSymbol.species) || SymbolPolyfill('species')), - split: d('', (NativeSymbol && NativeSymbol.split) || SymbolPolyfill('split')), - toPrimitive: d('', (NativeSymbol && NativeSymbol.toPrimitive) || SymbolPolyfill('toPrimitive')), - toStringTag: d('', (NativeSymbol && NativeSymbol.toStringTag) || SymbolPolyfill('toStringTag')), - unscopables: d('', (NativeSymbol && NativeSymbol.unscopables) || SymbolPolyfill('unscopables')) -}); - -// Internal tweaks for real symbol producer -defineProperties(HiddenSymbol.prototype, { - constructor: d(SymbolPolyfill), - toString: d('', function () { return this.__name__; }) -}); - -// Proper implementation of methods exposed on Symbol.prototype -// They won't be accessible on produced symbol instances as they derive from HiddenSymbol.prototype -defineProperties(SymbolPolyfill.prototype, { - toString: d(function () { return 'Symbol (' + validateSymbol(this).__description__ + ')'; }), - valueOf: d(function () { return validateSymbol(this); }) -}); -defineProperty(SymbolPolyfill.prototype, SymbolPolyfill.toPrimitive, d('', function () { - var symbol = validateSymbol(this); - if (typeof symbol === 'symbol') return symbol; - return symbol.toString(); -})); -defineProperty(SymbolPolyfill.prototype, SymbolPolyfill.toStringTag, d('c', 'Symbol')); - -// Proper implementaton of toPrimitive and toStringTag for returned symbol instances -defineProperty(HiddenSymbol.prototype, SymbolPolyfill.toStringTag, - d('c', SymbolPolyfill.prototype[SymbolPolyfill.toStringTag])); - -// Note: It's important to define `toPrimitive` as last one, as some implementations -// implement `toPrimitive` natively without implementing `toStringTag` (or other specified symbols) -// And that may invoke error in definition flow: -// See: https://github.com/medikoo/es6-symbol/issues/13#issuecomment-164146149 -defineProperty(HiddenSymbol.prototype, SymbolPolyfill.toPrimitive, - d('c', SymbolPolyfill.prototype[SymbolPolyfill.toPrimitive])); - -},{"./validate-symbol":77,"d":16}],77:[function(require,module,exports){ -'use strict'; - -var isSymbol = require('./is-symbol'); - -module.exports = function (value) { - if (!isSymbol(value)) throw new TypeError(value + " is not a symbol"); - return value; -}; - -},{"./is-symbol":75}],78:[function(require,module,exports){ -'use strict'; - -var d = require('d') - , callable = require('es5-ext/object/valid-callable') - - , apply = Function.prototype.apply, call = Function.prototype.call - , create = Object.create, defineProperty = Object.defineProperty - , defineProperties = Object.defineProperties - , hasOwnProperty = Object.prototype.hasOwnProperty - , descriptor = { configurable: true, enumerable: false, writable: true } - - , on, once, off, emit, methods, descriptors, base; - -on = function (type, listener) { - var data; - - callable(listener); - - if (!hasOwnProperty.call(this, '__ee__')) { - data = descriptor.value = create(null); - defineProperty(this, '__ee__', descriptor); - descriptor.value = null; - } else { - data = this.__ee__; - } - if (!data[type]) data[type] = listener; - else if (typeof data[type] === 'object') data[type].push(listener); - else data[type] = [data[type], listener]; - - return this; -}; - -once = function (type, listener) { - var once, self; - - callable(listener); - self = this; - on.call(this, type, once = function () { - off.call(self, type, once); - apply.call(listener, this, arguments); - }); - - once.__eeOnceListener__ = listener; - return this; -}; - -off = function (type, listener) { - var data, listeners, candidate, i; - - callable(listener); - - if (!hasOwnProperty.call(this, '__ee__')) return this; - data = this.__ee__; - if (!data[type]) return this; - listeners = data[type]; - - if (typeof listeners === 'object') { - for (i = 0; (candidate = listeners[i]); ++i) { - if ((candidate === listener) || - (candidate.__eeOnceListener__ === listener)) { - if (listeners.length === 2) data[type] = listeners[i ? 0 : 1]; - else listeners.splice(i, 1); - } - } - } else { - if ((listeners === listener) || - (listeners.__eeOnceListener__ === listener)) { - delete data[type]; - } - } - - return this; -}; - -emit = function (type) { - var i, l, listener, listeners, args; - - if (!hasOwnProperty.call(this, '__ee__')) return; - listeners = this.__ee__[type]; - if (!listeners) return; - - if (typeof listeners === 'object') { - l = arguments.length; - args = new Array(l - 1); - for (i = 1; i < l; ++i) args[i - 1] = arguments[i]; - - listeners = listeners.slice(); - for (i = 0; (listener = listeners[i]); ++i) { - apply.call(listener, this, args); - } - } else { - switch (arguments.length) { - case 1: - call.call(listeners, this); - break; - case 2: - call.call(listeners, this, arguments[1]); - break; - case 3: - call.call(listeners, this, arguments[1], arguments[2]); - break; - default: - l = arguments.length; - args = new Array(l - 1); - for (i = 1; i < l; ++i) { - args[i - 1] = arguments[i]; - } - apply.call(listeners, this, args); - } - } -}; - -methods = { - on: on, - once: once, - off: off, - emit: emit -}; - -descriptors = { - on: d(on), - once: d(once), - off: d(off), - emit: d(emit) -}; - -base = defineProperties({}, descriptors); - -module.exports = exports = function (o) { - return (o == null) ? create(base) : defineProperties(Object(o), descriptors); -}; -exports.methods = methods; - -},{"d":16,"es5-ext/object/valid-callable":54}],79:[function(require,module,exports){ +},{}],83:[function(require,module,exports){ +/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ exports.read = function (buffer, offset, isLE, mLen, nBytes) { var e, m var eLen = (nBytes * 8) - mLen - 1 @@ -6822,32 +6456,36 @@ exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { buffer[offset + i - d] |= s * 128 } -},{}],80:[function(require,module,exports){ +},{}],84:[function(require,module,exports){ if (typeof Object.create === 'function') { // implementation from standard node.js 'util' module module.exports = function inherits(ctor, superCtor) { - ctor.super_ = superCtor - ctor.prototype = Object.create(superCtor.prototype, { - constructor: { - value: ctor, - enumerable: false, - writable: true, - configurable: true - } - }); + if (superCtor) { + ctor.super_ = superCtor + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }) + } }; } else { // old school shim for old browsers module.exports = function inherits(ctor, superCtor) { - ctor.super_ = superCtor - var TempCtor = function () {} - TempCtor.prototype = superCtor.prototype - ctor.prototype = new TempCtor() - ctor.prototype.constructor = ctor + if (superCtor) { + ctor.super_ = superCtor + var TempCtor = function () {} + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } } } -},{}],81:[function(require,module,exports){ +},{}],85:[function(require,module,exports){ /*! * Determine if an object is a Buffer * @@ -6870,7 +6508,14 @@ function isSlowBuffer (obj) { return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0)) } -},{}],82:[function(require,module,exports){ +},{}],86:[function(require,module,exports){ +var toString = {}.toString; + +module.exports = Array.isArray || function (arr) { + return toString.call(arr) == '[object Array]'; +}; + +},{}],87:[function(require,module,exports){ 'use strict' var Buffer = require('safe-buffer').Buffer @@ -6895,7 +6540,7 @@ protocol.types = { 12: 'pingreq', 13: 'pingresp', 14: 'disconnect', - 15: 'auth' + 15: 'reserved' } /* Mnemonic => Command code */ @@ -6932,71 +6577,6 @@ protocol.WILL_FLAG_MASK = 0x04 protocol.CLEAN_SESSION_MASK = 0x02 protocol.CONNECT_HEADER = Buffer.from([protocol.codes['connect'] << protocol.CMD_SHIFT]) -/* Properties */ -protocol.properties = { - sessionExpiryInterval: 17, - willDelayInterval: 24, - receiveMaximum: 33, - maximumPacketSize: 39, - topicAliasMaximum: 34, - requestResponseInformation: 25, - requestProblemInformation: 23, - userProperties: 38, - authenticationMethod: 21, - authenticationData: 22, - payloadFormatIndicator: 1, - messageExpiryInterval: 2, - contentType: 3, - responseTopic: 8, - correlationData: 9, - maximumQoS: 36, - retainAvailable: 37, - assignedClientIdentifier: 18, - reasonString: 31, - wildcardSubscriptionAvailable: 40, - subscriptionIdentifiersAvailable: 41, - sharedSubscriptionAvailable: 42, - serverKeepAlive: 19, - responseInformation: 26, - serverReference: 28, - topicAlias: 35, - subscriptionIdentifier: 11 -} -protocol.propertiesCodes = {} -for (var prop in protocol.properties) { - var id = protocol.properties[prop] - protocol.propertiesCodes[id] = prop -} -protocol.propertiesTypes = { - sessionExpiryInterval: 'int32', - willDelayInterval: 'int32', - receiveMaximum: 'int16', - maximumPacketSize: 'int32', - topicAliasMaximum: 'int16', - requestResponseInformation: 'byte', - requestProblemInformation: 'byte', - userProperties: 'pair', - authenticationMethod: 'string', - authenticationData: 'binary', - payloadFormatIndicator: 'byte', - messageExpiryInterval: 'int32', - contentType: 'string', - responseTopic: 'string', - correlationData: 'binary', - maximumQoS: 'int8', - retainAvailable: 'byte', - assignedClientIdentifier: 'string', - reasonString: 'string', - wildcardSubscriptionAvailable: 'byte', - subscriptionIdentifiersAvailable: 'byte', - sharedSubscriptionAvailable: 'byte', - serverKeepAlive: 'int32', - responseInformation: 'string', - serverReference: 'string', - topicAlias: 'int16', - subscriptionIdentifier: 'var' -} - function genHeader (type) { return [0, 1, 2].map(function (qos) { return [0, 1].map(function (dup) { @@ -7017,17 +6597,6 @@ protocol.PUBLISH_HEADER = genHeader('publish') /* Subscribe */ protocol.SUBSCRIBE_HEADER = genHeader('subscribe') -protocol.SUBSCRIBE_OPTIONS_QOS_MASK = 0x03 -protocol.SUBSCRIBE_OPTIONS_NL_MASK = 0x01 -protocol.SUBSCRIBE_OPTIONS_NL_SHIFT = 2 -protocol.SUBSCRIBE_OPTIONS_RAP_MASK = 0x01 -protocol.SUBSCRIBE_OPTIONS_RAP_SHIFT = 3 -protocol.SUBSCRIBE_OPTIONS_RH_MASK = 0x03 -protocol.SUBSCRIBE_OPTIONS_RH_SHIFT = 4 -protocol.SUBSCRIBE_OPTIONS_RH = [0x00, 0x10, 0x20] -protocol.SUBSCRIBE_OPTIONS_NL = 0x04 -protocol.SUBSCRIBE_OPTIONS_RAP = 0x08 -protocol.SUBSCRIBE_OPTIONS_QOS = [0x00, 0x01, 0x02] /* Unsubscribe */ protocol.UNSUBSCRIBE_HEADER = genHeader('unsubscribe') @@ -7046,7 +6615,6 @@ protocol.SUBACK_HEADER = Buffer.from([protocol.codes['suback'] << protocol.CMD_S /* Protocol versions */ protocol.VERSION3 = Buffer.from([3]) protocol.VERSION4 = Buffer.from([4]) -protocol.VERSION5 = Buffer.from([5]) /* QoS */ protocol.QOS = [0, 1, 2].map(function (qos) { @@ -7060,7 +6628,7 @@ protocol.EMPTY = { disconnect: Buffer.from([protocol.codes['disconnect'] << 4, 0]) } -},{"safe-buffer":110}],83:[function(require,module,exports){ +},{"safe-buffer":114}],88:[function(require,module,exports){ 'use strict' var Buffer = require('safe-buffer').Buffer @@ -7068,9 +6636,9 @@ var writeToStream = require('./writeToStream') var EE = require('events').EventEmitter var inherits = require('inherits') -function generate (packet, opts) { +function generate (packet) { var stream = new Accumulator() - writeToStream(packet, stream, opts) + writeToStream(packet, stream) return stream.concat() } @@ -7118,297 +6686,14 @@ Accumulator.prototype.concat = function () { module.exports = generate -},{"./writeToStream":89,"events":13,"inherits":80,"safe-buffer":110}],84:[function(require,module,exports){ +},{"./writeToStream":93,"events":79,"inherits":84,"safe-buffer":114}],89:[function(require,module,exports){ 'use strict' exports.parser = require('./parser') exports.generate = require('./generate') exports.writeToStream = require('./writeToStream') -},{"./generate":83,"./parser":88,"./writeToStream":89}],85:[function(require,module,exports){ -var DuplexStream = require('readable-stream/duplex') - , util = require('util') - , Buffer = require('safe-buffer').Buffer - - -function BufferList (callback) { - if (!(this instanceof BufferList)) - return new BufferList(callback) - - this._bufs = [] - this.length = 0 - - if (typeof callback == 'function') { - this._callback = callback - - var piper = function piper (err) { - if (this._callback) { - this._callback(err) - this._callback = null - } - }.bind(this) - - this.on('pipe', function onPipe (src) { - src.on('error', piper) - }) - this.on('unpipe', function onUnpipe (src) { - src.removeListener('error', piper) - }) - } else { - this.append(callback) - } - - DuplexStream.call(this) -} - - -util.inherits(BufferList, DuplexStream) - - -BufferList.prototype._offset = function _offset (offset) { - var tot = 0, i = 0, _t - if (offset === 0) return [ 0, 0 ] - for (; i < this._bufs.length; i++) { - _t = tot + this._bufs[i].length - if (offset < _t || i == this._bufs.length - 1) - return [ i, offset - tot ] - tot = _t - } -} - - -BufferList.prototype.append = function append (buf) { - var i = 0 - - if (Buffer.isBuffer(buf)) { - this._appendBuffer(buf); - } else if (Array.isArray(buf)) { - for (; i < buf.length; i++) - this.append(buf[i]) - } else if (buf instanceof BufferList) { - // unwrap argument into individual BufferLists - for (; i < buf._bufs.length; i++) - this.append(buf._bufs[i]) - } else if (buf != null) { - // coerce number arguments to strings, since Buffer(number) does - // uninitialized memory allocation - if (typeof buf == 'number') - buf = buf.toString() - - this._appendBuffer(Buffer.from(buf)); - } - - return this -} - - -BufferList.prototype._appendBuffer = function appendBuffer (buf) { - this._bufs.push(buf) - this.length += buf.length -} - - -BufferList.prototype._write = function _write (buf, encoding, callback) { - this._appendBuffer(buf) - - if (typeof callback == 'function') - callback() -} - - -BufferList.prototype._read = function _read (size) { - if (!this.length) - return this.push(null) - - size = Math.min(size, this.length) - this.push(this.slice(0, size)) - this.consume(size) -} - - -BufferList.prototype.end = function end (chunk) { - DuplexStream.prototype.end.call(this, chunk) - - if (this._callback) { - this._callback(null, this.slice()) - this._callback = null - } -} - - -BufferList.prototype.get = function get (index) { - return this.slice(index, index + 1)[0] -} - - -BufferList.prototype.slice = function slice (start, end) { - if (typeof start == 'number' && start < 0) - start += this.length - if (typeof end == 'number' && end < 0) - end += this.length - return this.copy(null, 0, start, end) -} - - -BufferList.prototype.copy = function copy (dst, dstStart, srcStart, srcEnd) { - if (typeof srcStart != 'number' || srcStart < 0) - srcStart = 0 - if (typeof srcEnd != 'number' || srcEnd > this.length) - srcEnd = this.length - if (srcStart >= this.length) - return dst || Buffer.alloc(0) - if (srcEnd <= 0) - return dst || Buffer.alloc(0) - - var copy = !!dst - , off = this._offset(srcStart) - , len = srcEnd - srcStart - , bytes = len - , bufoff = (copy && dstStart) || 0 - , start = off[1] - , l - , i - - // copy/slice everything - if (srcStart === 0 && srcEnd == this.length) { - if (!copy) { // slice, but full concat if multiple buffers - return this._bufs.length === 1 - ? this._bufs[0] - : Buffer.concat(this._bufs, this.length) - } - - // copy, need to copy individual buffers - for (i = 0; i < this._bufs.length; i++) { - this._bufs[i].copy(dst, bufoff) - bufoff += this._bufs[i].length - } - - return dst - } - - // easy, cheap case where it's a subset of one of the buffers - if (bytes <= this._bufs[off[0]].length - start) { - return copy - ? this._bufs[off[0]].copy(dst, dstStart, start, start + bytes) - : this._bufs[off[0]].slice(start, start + bytes) - } - - if (!copy) // a slice, we need something to copy in to - dst = Buffer.allocUnsafe(len) - - for (i = off[0]; i < this._bufs.length; i++) { - l = this._bufs[i].length - start - - if (bytes > l) { - this._bufs[i].copy(dst, bufoff, start) - } else { - this._bufs[i].copy(dst, bufoff, start, start + bytes) - break - } - - bufoff += l - bytes -= l - - if (start) - start = 0 - } - - return dst -} - -BufferList.prototype.shallowSlice = function shallowSlice (start, end) { - start = start || 0 - end = end || this.length - - if (start < 0) - start += this.length - if (end < 0) - end += this.length - - var startOffset = this._offset(start) - , endOffset = this._offset(end) - , buffers = this._bufs.slice(startOffset[0], endOffset[0] + 1) - - if (endOffset[1] == 0) - buffers.pop() - else - buffers[buffers.length-1] = buffers[buffers.length-1].slice(0, endOffset[1]) - - if (startOffset[1] != 0) - buffers[0] = buffers[0].slice(startOffset[1]) - - return new BufferList(buffers) -} - -BufferList.prototype.toString = function toString (encoding, start, end) { - return this.slice(start, end).toString(encoding) -} - -BufferList.prototype.consume = function consume (bytes) { - while (this._bufs.length) { - if (bytes >= this._bufs[0].length) { - bytes -= this._bufs[0].length - this.length -= this._bufs[0].length - this._bufs.shift() - } else { - this._bufs[0] = this._bufs[0].slice(bytes) - this.length -= bytes - break - } - } - return this -} - - -BufferList.prototype.duplicate = function duplicate () { - var i = 0 - , copy = new BufferList() - - for (; i < this._bufs.length; i++) - copy.append(this._bufs[i]) - - return copy -} - - -BufferList.prototype.destroy = function destroy () { - this._bufs.length = 0 - this.length = 0 - this.push(null) -} - - -;(function () { - var methods = { - 'readDoubleBE' : 8 - , 'readDoubleLE' : 8 - , 'readFloatBE' : 4 - , 'readFloatLE' : 4 - , 'readInt32BE' : 4 - , 'readInt32LE' : 4 - , 'readUInt32BE' : 4 - , 'readUInt32LE' : 4 - , 'readInt16BE' : 2 - , 'readInt16LE' : 2 - , 'readUInt16BE' : 2 - , 'readUInt16LE' : 2 - , 'readInt8' : 1 - , 'readUInt8' : 1 - } - - for (var m in methods) { - (function (m) { - BufferList.prototype[m] = function (offset) { - return this.slice(offset, offset + methods[m])[m](0) - } - }(m)) - } -}()) - - -module.exports = BufferList - -},{"readable-stream/duplex":97,"safe-buffer":110,"util":117}],86:[function(require,module,exports){ +},{"./generate":88,"./parser":92,"./writeToStream":93}],90:[function(require,module,exports){ 'use strict' var Buffer = require('safe-buffer').Buffer @@ -7429,55 +6714,13 @@ function generateCache () { } } -/** - * calcVariableByteIntLength - calculate the variable byte integer - * length field - * - * @api private - */ -function calcVariableByteIntLength (length) { - if (length >= 0 && length < 128) return 1 - else if (length >= 128 && length < 16384) return 2 - else if (length >= 16384 && length < 2097152) return 3 - else if (length >= 2097152 && length < 268435456) return 4 - else return 0 -} - -function genBufVariableByteInt (num) { - var digit = 0 - var pos = 0 - var length = calcVariableByteIntLength(num) - var buffer = Buffer.allocUnsafe(length) - - do { - digit = num % 128 | 0 - num = num / 128 | 0 - if (num > 0) digit = digit | 0x80 - - buffer.writeUInt8(digit, pos++) - } while (num > 0) - - return { - data: buffer, - length: length - } -} - -function generate4ByteBuffer (num) { - var buffer = Buffer.allocUnsafe(4) - buffer.writeUInt32BE(num, 0) - return buffer -} - module.exports = { cache: cache, generateCache: generateCache, - generateNumber: generateBuffer, - genBufVariableByteInt: genBufVariableByteInt, - generate4ByteBuffer: generate4ByteBuffer + generateNumber: generateBuffer } -},{"safe-buffer":110}],87:[function(require,module,exports){ +},{"safe-buffer":114}],91:[function(require,module,exports){ function Packet () { this.cmd = null @@ -7491,7 +6734,7 @@ function Packet () { module.exports = Packet -},{}],88:[function(require,module,exports){ +},{}],92:[function(require,module,exports){ 'use strict' var bl = require('bl') @@ -7500,10 +6743,8 @@ var EE = require('events').EventEmitter var Packet = require('./packet') var constants = require('./constants') -function Parser (opt) { - if (!(this instanceof Parser)) return new Parser(opt) - - this.settings = opt || {} +function Parser () { + if (!(this instanceof Parser)) return new Parser() this._states = [ '_parseHeader', @@ -7530,8 +6771,8 @@ Parser.prototype.parse = function (buf) { this._list.append(buf) while ((this.packet.length !== -1 || this._list.length > 0) && - this[this._states[this._stateCounter]]() && - !this.error) { + this[this._states[this._stateCounter]]() && + !this.error) { this._stateCounter++ if (this._stateCounter >= this._states.length) this._stateCounter = 0 @@ -7555,14 +6796,30 @@ Parser.prototype._parseHeader = function () { Parser.prototype._parseLength = function () { // There is at least one byte in the list - var result = this._parseVarByteNum(true) + var bytes = 0 + var mul = 1 + var length = 0 + var result = true + var current - if (result) { - this.packet.length = result.value - this._list.consume(result.bytes) + while (bytes < 5) { + current = this._list.readUInt8(bytes++) + length += mul * (current & constants.LENGTH_MASK) + mul *= 0x80 + + if ((current & constants.LENGTH_FIN_MASK) === 0) break + if (this._list.length <= bytes) { + result = false + break + } } - return !!result + if (result) { + this.packet.length = length + this._list.consume(bytes) + } + + return result } Parser.prototype._parsePayload = function () { @@ -7587,7 +6844,7 @@ Parser.prototype._parsePayload = function () { case 'pubrec': case 'pubrel': case 'pubcomp': - this._parseConfirmation() + this._parseMessageId() break case 'subscribe': this._parseSubscribe() @@ -7603,13 +6860,8 @@ Parser.prototype._parsePayload = function () { break case 'pingreq': case 'pingresp': - // These are empty, nothing to do - break case 'disconnect': - this._parseDisconnect() - break - case 'auth': - this._parseAuth() + // These are empty, nothing to do break default: this._emitError(new Error('Not supported')) @@ -7646,7 +6898,7 @@ Parser.prototype._parseConnect = function () { packet.protocolVersion = this._list.readUInt8(this._pos) - if (packet.protocolVersion !== 3 && packet.protocolVersion !== 4 && packet.protocolVersion !== 5) { + if (packet.protocolVersion !== 3 && packet.protocolVersion !== 4) { return this._emitError(new Error('Invalid protocol version')) } @@ -7675,25 +6927,12 @@ Parser.prototype._parseConnect = function () { packet.keepalive = this._parseNum() if (packet.keepalive === -1) return this._emitError(new Error('Packet too short')) - // parse properties - if (packet.protocolVersion === 5) { - var properties = this._parseProperties() - if (Object.getOwnPropertyNames(properties).length) { - packet.properties = properties - } - } // Parse clientId clientId = this._parseString() if (clientId === null) return this._emitError(new Error('Packet too short')) packet.clientId = clientId if (flags.will) { - if (packet.protocolVersion === 5) { - var willProperties = this._parseProperties() - if (Object.getOwnPropertyNames(willProperties).length) { - packet.will.properties = willProperties - } - } // Parse will topic topic = this._parseString() if (topic === null) return this._emitError(new Error('Cannot parse will topic')) @@ -7718,8 +6957,6 @@ Parser.prototype._parseConnect = function () { if (password === null) return this._emitError(new Error('Cannot parse password')) packet.password = password } - // need for right parse auth packet and self set up - this.settings = packet return packet } @@ -7730,20 +6967,9 @@ Parser.prototype._parseConnack = function () { if (this._list.length < 2) return null packet.sessionPresent = !!(this._list.readUInt8(this._pos++) & constants.SESSIONPRESENT_MASK) - if (this.settings.protocolVersion === 5) { - packet.reasonCode = this._list.readUInt8(this._pos++) - } else { - packet.returnCode = this._list.readUInt8(this._pos++) - } + packet.returnCode = this._list.readUInt8(this._pos) - if (packet.returnCode === -1 || packet.reasonCode === -1) return this._emitError(new Error('Cannot parse return code')) - // mqtt 5 properties - if (this.settings.protocolVersion === 5) { - var properties = this._parseProperties() - if (Object.getOwnPropertyNames(properties).length) { - packet.properties = properties - } - } + if (packet.returnCode === -1) return this._emitError(new Error('Cannot parse return code')) } Parser.prototype._parsePublish = function () { @@ -7755,26 +6981,13 @@ Parser.prototype._parsePublish = function () { // Parse messageId if (packet.qos > 0) if (!this._parseMessageId()) { return } - // Properties mqtt 5 - if (this.settings.protocolVersion === 5) { - var properties = this._parseProperties() - if (Object.getOwnPropertyNames(properties).length) { - packet.properties = properties - } - } - packet.payload = this._list.slice(this._pos, packet.length) } Parser.prototype._parseSubscribe = function () { var packet = this.packet var topic - var options var qos - var rh - var rap - var nl - var subscription if (packet.qos !== 1) { return this._emitError(new Error('Wrong subscribe header')) @@ -7784,53 +6997,24 @@ Parser.prototype._parseSubscribe = function () { if (!this._parseMessageId()) { return } - // Properties mqtt 5 - if (this.settings.protocolVersion === 5) { - var properties = this._parseProperties() - if (Object.getOwnPropertyNames(properties).length) { - packet.properties = properties - } - } - while (this._pos < packet.length) { // Parse topic topic = this._parseString() if (topic === null) return this._emitError(new Error('Cannot parse topic')) - options = this._parseByte() - qos = options & constants.SUBSCRIBE_OPTIONS_QOS_MASK - nl = ((options >> constants.SUBSCRIBE_OPTIONS_NL_SHIFT) & constants.SUBSCRIBE_OPTIONS_NL_MASK) !== 0 - rap = ((options >> constants.SUBSCRIBE_OPTIONS_RAP_SHIFT) & constants.SUBSCRIBE_OPTIONS_RAP_MASK) !== 0 - rh = (options >> constants.SUBSCRIBE_OPTIONS_RH_SHIFT) & constants.SUBSCRIBE_OPTIONS_RH_MASK - - subscription = { topic: topic, qos: qos } - - // mqtt 5 options - if (this.settings.protocolVersion === 5) { - subscription.nl = nl - subscription.rap = rap - subscription.rh = rh - } + if (this._pos >= packet.length) return this._emitError(new Error('Malformed Subscribe Payload')) + qos = this._list.readUInt8(this._pos++) // Push pair to subscriptions - packet.subscriptions.push(subscription) + packet.subscriptions.push({ topic: topic, qos: qos }) } } Parser.prototype._parseSuback = function () { - var packet = this.packet this.packet.granted = [] if (!this._parseMessageId()) { return } - // Properties mqtt 5 - if (this.settings.protocolVersion === 5) { - var properties = this._parseProperties() - if (Object.getOwnPropertyNames(properties).length) { - packet.properties = properties - } - } - // Parse granted QoSes while (this._pos < this.packet.length) { this.packet.granted.push(this._list.readUInt8(this._pos++)) @@ -7845,14 +7029,6 @@ Parser.prototype._parseUnsubscribe = function () { // Parse messageId if (!this._parseMessageId()) { return } - // Properties mqtt 5 - if (this.settings.protocolVersion === 5) { - var properties = this._parseProperties() - if (Object.getOwnPropertyNames(properties).length) { - packet.properties = properties - } - } - while (this._pos < packet.length) { var topic @@ -7866,77 +7042,7 @@ Parser.prototype._parseUnsubscribe = function () { } Parser.prototype._parseUnsuback = function () { - var packet = this.packet if (!this._parseMessageId()) return this._emitError(new Error('Cannot parse messageId')) - // Properties mqtt 5 - if (this.settings.protocolVersion === 5) { - var properties = this._parseProperties() - if (Object.getOwnPropertyNames(properties).length) { - packet.properties = properties - } - // Parse granted QoSes - packet.granted = [] - while (this._pos < this.packet.length) { - this.packet.granted.push(this._list.readUInt8(this._pos++)) - } - } -} - -// parse packets like puback, pubrec, pubrel, pubcomp -Parser.prototype._parseConfirmation = function () { - var packet = this.packet - - this._parseMessageId() - - if (this.settings.protocolVersion === 5) { - if (packet.length > 2) { - // response code - packet.reasonCode = this._parseByte() - // properies mqtt 5 - var properties = this._parseProperties() - if (Object.getOwnPropertyNames(properties).length) { - packet.properties = properties - } - } - } - - return true -} - -// parse disconnect packet -Parser.prototype._parseDisconnect = function () { - var packet = this.packet - - if (this.settings.protocolVersion === 5) { - // response code - packet.reasonCode = this._parseByte() - // properies mqtt 5 - var properties = this._parseProperties() - if (Object.getOwnPropertyNames(properties).length) { - packet.properties = properties - } - } - - return true -} - -// parse auth packet -Parser.prototype._parseAuth = function () { - var packet = this.packet - - if (this.settings.protocolVersion !== 5) { - return this._emitError(new Error('Not supported auth packet for this version MQTT')) - } - - // response code - packet.reasonCode = this._parseByte() - // properies mqtt 5 - var properties = this._parseProperties() - if (Object.getOwnPropertyNames(properties).length) { - packet.properties = properties - } - - return true } Parser.prototype._parseMessageId = function () { @@ -7965,13 +7071,6 @@ Parser.prototype._parseString = function (maybeBuffer) { return result } -Parser.prototype._parseStringPair = function () { - return { - name: this._parseString(), - value: this._parseString() - } -} - Parser.prototype._parseBuffer = function () { var length = this._parseNum() var result @@ -7995,110 +7094,6 @@ Parser.prototype._parseNum = function () { return result } -Parser.prototype._parse4ByteNum = function () { - if (this._list.length - this._pos < 4) return -1 - - var result = this._list.readUInt32BE(this._pos) - this._pos += 4 - - return result -} - -Parser.prototype._parseVarByteNum = function (fullInfoFlag) { - var bytes = 0 - var mul = 1 - var length = 0 - var result = true - var current - var padding = this._pos ? this._pos : 0 - - while (bytes < 5) { - current = this._list.readUInt8(padding + bytes++) - length += mul * (current & constants.LENGTH_MASK) - mul *= 0x80 - - if ((current & constants.LENGTH_FIN_MASK) === 0) break - if (this._list.length <= bytes) { - result = false - break - } - } - - if (padding) { - this._pos += bytes - } - - result = result - ? fullInfoFlag ? { - bytes: bytes, - value: length - } : length - : false - - return result -} - -Parser.prototype._parseByte = function () { - var result = this._list.readUInt8(this._pos) - this._pos++ - return result -} - -Parser.prototype._parseByType = function (type) { - switch (type) { - case 'byte': { - return this._parseByte() !== 0 - } - case 'int8': { - return this._parseByte() - } - case 'int16': { - return this._parseNum() - } - case 'int32': { - return this._parse4ByteNum() - } - case 'var': { - return this._parseVarByteNum() - } - case 'string': { - return this._parseString() - } - case 'pair': { - return this._parseStringPair() - } - case 'binary': { - return this._parseBuffer() - } - } -} - -Parser.prototype._parseProperties = function () { - var length = this._parseVarByteNum() - var start = this._pos - var end = start + length - var result = {} - while (this._pos < end) { - var type = this._parseByte() - var name = constants.propertiesCodes[type] - if (!name) { - this._emitError(new Error('Unknown property')) - return false - } - // user properties process - if (name === 'userProperties') { - if (!result[name]) { - result[name] = {} - } - var currentUserProperty = this._parseByType(constants.propertiesTypes[name]) - result[name][currentUserProperty.name] = currentUserProperty.value - continue - } - result[name] = this._parseByType(constants.propertiesTypes[name]) - } - return result -} - Parser.prototype._newPacket = function () { if (this.packet) { this._list.consume(this.packet.length) @@ -8107,8 +7102,6 @@ Parser.prototype._newPacket = function () { this.packet = new Packet() - this._pos = 0 - return true } @@ -8119,7 +7112,7 @@ Parser.prototype._emitError = function (err) { module.exports = Parser -},{"./constants":82,"./packet":87,"bl":85,"events":13,"inherits":80}],89:[function(require,module,exports){ +},{"./constants":87,"./packet":91,"bl":10,"events":79,"inherits":84}],93:[function(require,module,exports){ 'use strict' var protocol = require('./constants') @@ -8132,12 +7125,10 @@ var nextTick = require('process-nextick-args').nextTick var numCache = numbers.cache var generateNumber = numbers.generateNumber var generateCache = numbers.generateCache -var genBufVariableByteInt = numbers.genBufVariableByteInt -var generate4ByteBuffer = numbers.generate4ByteBuffer var writeNumber = writeNumberCached var toGenerate = true -function generate (packet, stream, opts) { +function generate (packet, stream) { if (stream.cork) { stream.cork() nextTick(uncork, stream) @@ -8150,31 +7141,27 @@ function generate (packet, stream, opts) { switch (packet.cmd) { case 'connect': - return connect(packet, stream, opts) + return connect(packet, stream) case 'connack': - return connack(packet, stream, opts) + return connack(packet, stream) case 'publish': - return publish(packet, stream, opts) + return publish(packet, stream) case 'puback': case 'pubrec': case 'pubrel': case 'pubcomp': - return confirmation(packet, stream, opts) - case 'subscribe': - return subscribe(packet, stream, opts) - case 'suback': - return suback(packet, stream, opts) - case 'unsubscribe': - return unsubscribe(packet, stream, opts) case 'unsuback': - return unsuback(packet, stream, opts) + return confirmation(packet, stream) + case 'subscribe': + return subscribe(packet, stream) + case 'suback': + return suback(packet, stream) + case 'unsubscribe': + return unsubscribe(packet, stream) case 'pingreq': case 'pingresp': - return emptyPacket(packet, stream, opts) case 'disconnect': - return disconnect(packet, stream, opts) - case 'auth': - return auth(packet, stream, opts) + return emptyPacket(packet, stream) default: stream.emit('error', new Error('Unknown command')) return false @@ -8203,8 +7190,8 @@ function uncork (stream) { stream.uncork() } -function connect (packet, stream, opts) { - var settings = packet || {} +function connect (opts, stream) { + var settings = opts || {} var protocolId = settings.protocolId || 'MQTT' var protocolVersion = settings.protocolVersion || 4 var will = settings.will @@ -8213,8 +7200,6 @@ function connect (packet, stream, opts) { var clientId = settings.clientId || '' var username = settings.username var password = settings.password - /* mqtt5 new oprions */ - var properties = settings.properties if (clean === undefined) clean = true @@ -8227,8 +7212,8 @@ function connect (packet, stream, opts) { return false } else length += protocolId.length + 2 - // Must be 3 or 4 or 5 - if (protocolVersion !== 3 && protocolVersion !== 4 && protocolVersion !== 5) { + // Must be 3 or 4 + if (protocolVersion !== 3 && protocolVersion !== 4) { stream.emit('error', new Error('Invalid protocol version')) return false } else length += 1 @@ -8260,12 +7245,6 @@ function connect (packet, stream, opts) { // Connect flags length += 1 - // Properties - if (protocolVersion === 5) { - var propertiesData = getProperties(stream, properties) - length += propertiesData.length - } - // If will exists... if (will) { // It must be an object @@ -8282,7 +7261,7 @@ function connect (packet, stream, opts) { } // Payload - if (will.payload) { + if (will.payload && will.payload) { if (will.payload.length >= 0) { if (typeof will.payload === 'string') { length += Buffer.byteLength(will.payload) + 2 @@ -8293,13 +7272,8 @@ function connect (packet, stream, opts) { stream.emit('error', new Error('Invalid will payload')) return false } - - // will properties - var willProperties = {} - if (protocolVersion === 5) { - willProperties = getProperties(stream, will.properties) - length += willProperties.length - } + } else { + length += 2 } } @@ -8334,16 +7308,12 @@ function connect (packet, stream, opts) { stream.write(protocol.CONNECT_HEADER) // Generate length - writeVarByteInt(stream, length) + writeLength(stream, length) // Generate protocol ID writeStringOrBuffer(stream, protocolId) stream.write( - protocolVersion === 4 - ? protocol.VERSION4 - : protocolVersion === 5 - ? protocol.VERSION5 - : protocol.VERSION3 + protocolVersion === 4 ? protocol.VERSION4 : protocol.VERSION3 ) // Connect flags @@ -8360,19 +7330,11 @@ function connect (packet, stream, opts) { // Keepalive writeNumber(stream, keepalive) - // Properties - if (protocolVersion === 5) { - propertiesData.write() - } - // Client ID writeStringOrBuffer(stream, clientId) // Will if (will) { - if (protocolVersion === 5) { - willProperties.write() - } writeString(stream, will.topic) writeStringOrBuffer(stream, will.payload) } @@ -8389,46 +7351,30 @@ function connect (packet, stream, opts) { return true } -function connack (packet, stream, opts) { - var version = opts ? opts.protocolVersion : 4 - var settings = packet || {} - var rc = version === 5 ? settings.reasonCode : settings.returnCode - var properties = settings.properties - var length = 2 // length of rc and sessionHeader +function connack (opts, stream) { + var settings = opts || {} + var rc = settings.returnCode // Check return code if (typeof rc !== 'number') { stream.emit('error', new Error('Invalid return code')) return false } - // mqtt5 properties - var propertiesData = null - if (version === 5) { - propertiesData = getProperties(stream, properties) - length += propertiesData.length - } stream.write(protocol.CONNACK_HEADER) - // length - writeVarByteInt(stream, length) - stream.write(settings.sessionPresent ? protocol.SESSIONPRESENT_HEADER : zeroBuf) + writeLength(stream, 2) + stream.write(opts.sessionPresent ? protocol.SESSIONPRESENT_HEADER : zeroBuf) - stream.write(Buffer.from([rc])) - if (propertiesData != null) { - propertiesData.write() - } - return true + return stream.write(Buffer.from([rc])) } -function publish (packet, stream, opts) { - var version = opts ? opts.protocolVersion : 4 - var settings = packet || {} +function publish (opts, stream) { + var settings = opts || {} var qos = settings.qos || 0 var retain = settings.retain ? protocol.RETAIN_MASK : 0 var topic = settings.topic var payload = settings.payload || empty var id = settings.messageId - var properties = settings.properties var length = 0 @@ -8450,18 +7396,11 @@ function publish (packet, stream, opts) { return false } else if (qos) length += 2 - // mqtt5 properties - var propertiesData = null - if (version === 5) { - propertiesData = getProperties(stream, properties) - length += propertiesData.length - } - // Header - stream.write(protocol.PUBLISH_HEADER[qos][settings.dup ? 1 : 0][retain ? 1 : 0]) + stream.write(protocol.PUBLISH_HEADER[qos][opts.dup ? 1 : 0][retain ? 1 : 0]) // Remaining length - writeVarByteInt(stream, length) + writeLength(stream, length) // Topic writeNumber(stream, byteLength(topic)) @@ -8470,26 +7409,17 @@ function publish (packet, stream, opts) { // Message ID if (qos > 0) writeNumber(stream, id) - // Properties - if (propertiesData != null) { - propertiesData.write() - } - // Payload return stream.write(payload) } /* Puback, pubrec, pubrel and pubcomp */ -function confirmation (packet, stream, opts) { - var version = opts ? opts.protocolVersion : 4 - var settings = packet || {} +function confirmation (opts, stream) { + var settings = opts || {} var type = settings.cmd || 'puback' var id = settings.messageId var dup = (settings.dup && type === 'pubrel') ? protocol.DUP_MASK : 0 var qos = 0 - var reasonCode = settings.reasonCode - var properties = settings.properties - var length = version === 5 ? 3 : 2 if (type === 'pubrel') qos = 1 @@ -8499,42 +7429,21 @@ function confirmation (packet, stream, opts) { return false } - // properies mqtt 5 - var propertiesData = null - if (version === 5) { - propertiesData = getPropertiesByMaximumPacketSize(stream, properties, opts, length) - if (!propertiesData) { return false } - length += propertiesData.length - } - // Header stream.write(protocol.ACKS[type][qos][dup][0]) // Length - writeVarByteInt(stream, length) + writeLength(stream, 2) // Message ID - writeNumber(stream, id) - - // reason code in header - if (version === 5) { - stream.write(Buffer.from([reasonCode])) - } - - // properies mqtt 5 - if (propertiesData !== null) { - propertiesData.write() - } - return true + return writeNumber(stream, id) } -function subscribe (packet, stream, opts) { - var version = opts ? opts.protocolVersion : 4 - var settings = packet || {} +function subscribe (opts, stream) { + var settings = opts || {} var dup = settings.dup ? protocol.DUP_MASK : 0 var id = settings.messageId var subs = settings.subscriptions - var properties = settings.properties var length = 0 @@ -8544,13 +7453,6 @@ function subscribe (packet, stream, opts) { return false } else length += 2 - // properies mqtt 5 - var propertiesData = null - if (version === 5) { - propertiesData = getProperties(stream, properties) - length += propertiesData.length - } - // Check subscriptions if (typeof subs === 'object' && subs.length) { for (var i = 0; i < subs.length; i += 1) { @@ -8566,24 +7468,6 @@ function subscribe (packet, stream, opts) { return false } - if (version === 5) { - var nl = subs[i].nl || false - if (typeof nl !== 'boolean') { - stream.emit('error', new Error('Invalid subscriptions - invalid No Local')) - return false - } - var rap = subs[i].rap || false - if (typeof rap !== 'boolean') { - stream.emit('error', new Error('Invalid subscriptions - invalid Retain as Published')) - return false - } - var rh = subs[i].rh || 0 - if (typeof rh !== 'number' || rh > 2) { - stream.emit('error', new Error('Invalid subscriptions - invalid Retain Handling')) - return false - } - } - length += Buffer.byteLength(itopic) + 2 + 1 } } else { @@ -8595,16 +7479,11 @@ function subscribe (packet, stream, opts) { stream.write(protocol.SUBSCRIBE_HEADER[1][dup ? 1 : 0][0]) // Generate length - writeVarByteInt(stream, length) + writeLength(stream, length) // Generate message ID writeNumber(stream, id) - // properies mqtt 5 - if (propertiesData !== null) { - propertiesData.write() - } - var result = true // Generate subs @@ -8612,34 +7491,22 @@ function subscribe (packet, stream, opts) { var sub = subs[j] var jtopic = sub.topic var jqos = sub.qos - var jnl = +sub.nl - var jrap = +sub.rap - var jrh = sub.rh - var joptions // Write topic string writeString(stream, jtopic) - // options process - joptions = protocol.SUBSCRIBE_OPTIONS_QOS[jqos] - if (version === 5) { - joptions |= jnl ? protocol.SUBSCRIBE_OPTIONS_NL : 0 - joptions |= jrap ? protocol.SUBSCRIBE_OPTIONS_RAP : 0 - joptions |= jrh ? protocol.SUBSCRIBE_OPTIONS_RH[jrh] : 0 - } - // Write options - result = stream.write(Buffer.from([joptions])) + // Write qos + result = stream.write(protocol.QOS[jqos]) } return result } -function suback (packet, stream, opts) { - var version = opts ? opts.protocolVersion : 4 - var settings = packet || {} +function suback (opts, stream) { + var settings = opts || {} var id = settings.messageId var granted = settings.granted - var properties = settings.properties + var length = 0 // Check message ID @@ -8662,38 +7529,23 @@ function suback (packet, stream, opts) { return false } - // properies mqtt 5 - var propertiesData = null - if (version === 5) { - propertiesData = getPropertiesByMaximumPacketSize(stream, properties, opts, length) - if (!propertiesData) { return false } - length += propertiesData.length - } - // header stream.write(protocol.SUBACK_HEADER) // Length - writeVarByteInt(stream, length) + writeLength(stream, length) // Message ID writeNumber(stream, id) - // properies mqtt 5 - if (propertiesData !== null) { - propertiesData.write() - } - return stream.write(Buffer.from(granted)) } -function unsubscribe (packet, stream, opts) { - var version = opts ? opts.protocolVersion : 4 - var settings = packet || {} +function unsubscribe (opts, stream) { + var settings = opts || {} var id = settings.messageId var dup = settings.dup ? protocol.DUP_MASK : 0 var unsubs = settings.unsubscriptions - var properties = settings.properties var length = 0 @@ -8717,27 +7569,16 @@ function unsubscribe (packet, stream, opts) { stream.emit('error', new Error('Invalid unsubscriptions')) return false } - // properies mqtt 5 - var propertiesData = null - if (version === 5) { - propertiesData = getProperties(stream, properties) - length += propertiesData.length - } // Header stream.write(protocol.UNSUBSCRIBE_HEADER[1][dup ? 1 : 0][0]) // Length - writeVarByteInt(stream, length) + writeLength(stream, length) // Message ID writeNumber(stream, id) - // properies mqtt 5 - if (propertiesData !== null) { - propertiesData.write() - } - // Unsubs var result = true for (var j = 0; j < unsubs.length; j++) { @@ -8747,139 +7588,42 @@ function unsubscribe (packet, stream, opts) { return result } -function unsuback (packet, stream, opts) { - var version = opts ? opts.protocolVersion : 4 - var settings = packet || {} - var id = settings.messageId - var dup = settings.dup ? protocol.DUP_MASK : 0 - var granted = settings.granted - var properties = settings.properties - var type = settings.cmd - var qos = 0 - - var length = 2 - - // Check message ID - if (typeof id !== 'number') { - stream.emit('error', new Error('Invalid messageId')) - return false - } - - // Check granted - if (version === 5) { - if (typeof granted === 'object' && granted.length) { - for (var i = 0; i < granted.length; i += 1) { - if (typeof granted[i] !== 'number') { - stream.emit('error', new Error('Invalid qos vector')) - return false - } - length += 1 - } - } else { - stream.emit('error', new Error('Invalid qos vector')) - return false - } - } - - // properies mqtt 5 - var propertiesData = null - if (version === 5) { - propertiesData = getPropertiesByMaximumPacketSize(stream, properties, opts, length) - if (!propertiesData) { return false } - length += propertiesData.length - } - - // Header - stream.write(protocol.ACKS[type][qos][dup][0]) - - // Length - writeVarByteInt(stream, length) - - // Message ID - writeNumber(stream, id) - - // properies mqtt 5 - if (propertiesData !== null) { - propertiesData.write() - } - - // payload - if (version === 5) { - stream.write(Buffer.from(granted)) - } - return true -} - -function emptyPacket (packet, stream, opts) { - return stream.write(protocol.EMPTY[packet.cmd]) -} - -function disconnect (packet, stream, opts) { - var version = opts ? opts.protocolVersion : 4 - var settings = packet || {} - var reasonCode = settings.reasonCode - var properties = settings.properties - var length = version === 5 ? 1 : 0 - - // properies mqtt 5 - var propertiesData = null - if (version === 5) { - propertiesData = getPropertiesByMaximumPacketSize(stream, properties, opts, length) - if (!propertiesData) { return false } - length += propertiesData.length - } - - // Header - stream.write(Buffer.from([protocol.codes['disconnect'] << 4])) - - // Length - writeVarByteInt(stream, length) - - // reason code in header - if (version === 5) { - stream.write(Buffer.from([reasonCode])) - } - - // properies mqtt 5 - if (propertiesData !== null) { - propertiesData.write() - } - - return true -} - -function auth (packet, stream, opts) { - var version = opts ? opts.protocolVersion : 4 - var settings = packet || {} - var reasonCode = settings.reasonCode - var properties = settings.properties - var length = version === 5 ? 1 : 0 - - if (version !== 5) stream.emit('error', new Error('Invalid mqtt version for auth packet')) - - // properies mqtt 5 - var propertiesData = getPropertiesByMaximumPacketSize(stream, properties, opts, length) - if (!propertiesData) { return false } - length += propertiesData.length - - // Header - stream.write(Buffer.from([protocol.codes['auth'] << 4])) - - // Length - writeVarByteInt(stream, length) - - // reason code in header - stream.write(Buffer.from([reasonCode])) - - // properies mqtt 5 - if (propertiesData !== null) { - propertiesData.write() - } - return true +function emptyPacket (opts, stream) { + return stream.write(protocol.EMPTY[opts.cmd]) } /** - * writeVarByteInt - write an MQTT style variable byte integer to the buffer + * calcLengthLength - calculate the length of the remaining + * length field + * + * @api private + */ +function calcLengthLength (length) { + if (length >= 0 && length < 128) return 1 + else if (length >= 128 && length < 16384) return 2 + else if (length >= 16384 && length < 2097152) return 3 + else if (length >= 2097152 && length < 268435456) return 4 + else return 0 +} + +function genBufLength (length) { + var digit = 0 + var pos = 0 + var buffer = Buffer.allocUnsafe(calcLengthLength(length)) + + do { + digit = length % 128 | 0 + length = length / 128 | 0 + if (length > 0) digit = digit | 0x80 + + buffer.writeUInt8(digit, pos++) + } while (length > 0) + + return buffer +} + +/** + * writeLength - write an MQTT style length field to the buffer * * @param buffer - destination * @param pos - offset @@ -8889,13 +7633,13 @@ function auth (packet, stream, opts) { * @api private */ -var varByteIntCache = {} -function writeVarByteInt (stream, num) { - var buffer = varByteIntCache[num] +var lengthCache = {} +function writeLength (stream, length) { + var buffer = lengthCache[length] if (!buffer) { - buffer = genBufVariableByteInt(num).data - if (num < 16384) varByteIntCache[num] = buffer + buffer = genBufLength(length) + if (length < 16384) lengthCache[length] = buffer } stream.write(buffer) @@ -8919,21 +7663,6 @@ function writeString (stream, string) { stream.write(string, 'utf8') } -/** - * writeStringPair - write a utf8 string pairs to the buffer - * - * @param buffer - destination - * @param name - string name to write - * @param value - string value to write - * @return number of bytes written - * - * @api private - */ -function writeStringPair (stream, name, value) { - writeString(stream, name) - writeString(stream, value) -} - /** * writeNumber - write a two byte number to the buffer * @@ -8950,9 +7679,7 @@ function writeNumberCached (stream, number) { function writeNumberGenerated (stream, number) { return stream.write(generateNumber(number)) } -function write4ByteNumber (stream, number) { - return stream.write(generate4ByteBuffer(number)) -} + /** * writeStringOrBuffer - write a String or Buffer with the its length prefix * @@ -8970,191 +7697,6 @@ function writeStringOrBuffer (stream, toWrite) { } else writeNumber(stream, 0) } -function getProperties (stream, properties) { - /* connect properties */ - if (typeof properties !== 'object' || properties.length != null) { - return { - length: 1, - write: function () { - writeProperties(stream, {}, 0) - } - } - } - var propertiesLength = 0 - function getLengthProperty (name) { - var type = protocol.propertiesTypes[name] - var value = properties[name] - var length = 0 - switch (type) { - case 'byte': { - if (typeof value !== 'boolean') { - stream.emit('error', new Error('Invalid ' + name)) - return false - } - length += 1 + 1 - break - } - case 'int8': { - if (typeof value !== 'number') { - stream.emit('error', new Error('Invalid ' + name)) - return false - } - length += 1 + 1 - break - } - case 'binary': { - if (value && value === null) { - stream.emit('error', new Error('Invalid ' + name)) - return false - } - length += 1 + Buffer.byteLength(value) + 2 - break - } - case 'int16': { - if (typeof value !== 'number') { - stream.emit('error', new Error('Invalid ' + name)) - return false - } - length += 1 + 2 - break - } - case 'int32': { - if (typeof value !== 'number') { - stream.emit('error', new Error('Invalid ' + name)) - return false - } - length += 1 + 4 - break - } - case 'var': { - if (typeof value !== 'number') { - stream.emit('error', new Error('Invalid ' + name)) - return false - } - length += 1 + genBufVariableByteInt(value).length - break - } - case 'string': { - if (typeof value !== 'string') { - stream.emit('error', new Error('Invalid ' + name)) - return false - } - length += 1 + 2 + Buffer.byteLength(value.toString()) - break - } - case 'pair': { - if (typeof value !== 'object') { - stream.emit('error', new Error('Invalid ' + name)) - return false - } - length += Object.getOwnPropertyNames(value).reduce(function (result, name) { - result += 1 + 2 + Buffer.byteLength(name.toString()) + 2 + Buffer.byteLength(value[name].toString()) - return result - }, 0) - break - } - default: { - stream.emit('error', new Error('Invalid property ' + name)) - return false - } - } - return length - } - if (properties) { - for (var propName in properties) { - var propLength = getLengthProperty(propName) - if (!propLength) return false - propertiesLength += propLength - } - } - var propertiesLengthLength = genBufVariableByteInt(propertiesLength).length - - return { - length: propertiesLengthLength + propertiesLength, - write: function () { - writeProperties(stream, properties, propertiesLength) - } - } -} - -function getPropertiesByMaximumPacketSize (stream, properties, opts, length) { - var mayEmptyProps = ['reasonString', 'userProperties'] - var maximumPacketSize = opts && opts.properties && opts.properties.maximumPacketSize ? opts.properties.maximumPacketSize : 0 - - var propertiesData = getProperties(stream, properties) - if (maximumPacketSize) { - while (length + propertiesData.length > maximumPacketSize) { - var currentMayEmptyProp = mayEmptyProps.shift() - if (currentMayEmptyProp && properties[currentMayEmptyProp]) { - delete properties[currentMayEmptyProp] - propertiesData = getProperties(stream, properties) - } else { - return false - } - } - } - return propertiesData -} - -function writeProperties (stream, properties, propertiesLength) { - /* write properties to stream */ - writeVarByteInt(stream, propertiesLength) - for (var propName in properties) { - if (properties.hasOwnProperty(propName) && properties[propName] !== null) { - var value = properties[propName] - var type = protocol.propertiesTypes[propName] - switch (type) { - case 'byte': { - stream.write(Buffer.from([protocol.properties[propName]])) - stream.write(Buffer.from([+value])) - break - } - case 'int8': { - stream.write(Buffer.from([protocol.properties[propName]])) - stream.write(Buffer.from([value])) - break - } - case 'binary': { - stream.write(Buffer.from([protocol.properties[propName]])) - writeStringOrBuffer(stream, value) - break - } - case 'int16': { - stream.write(Buffer.from([protocol.properties[propName]])) - writeNumber(stream, value) - break - } - case 'int32': { - stream.write(Buffer.from([protocol.properties[propName]])) - write4ByteNumber(stream, value) - break - } - case 'var': { - stream.write(Buffer.from([protocol.properties[propName]])) - writeVarByteInt(stream, value) - break - } - case 'string': { - stream.write(Buffer.from([protocol.properties[propName]])) - writeString(stream, value) - break - } - case 'pair': { - Object.getOwnPropertyNames(value).forEach(function (name) { - stream.write(Buffer.from([protocol.properties[propName]])) - writeStringPair(stream, name.toString(), value[name].toString()) - }) - break - } - default: { - stream.emit('error', new Error('Invalid property ' + propName)) - return false - } - } - } - } -} - function byteLength (bufOrString) { if (!bufOrString) return 0 else if (bufOrString instanceof Buffer) return bufOrString.length @@ -9167,7 +7709,7 @@ function isStringOrBuffer (field) { module.exports = generate -},{"./constants":82,"./numbers":86,"process-nextick-args":91,"safe-buffer":110}],90:[function(require,module,exports){ +},{"./constants":87,"./numbers":90,"process-nextick-args":95,"safe-buffer":114}],94:[function(require,module,exports){ var wrappy = require('wrappy') module.exports = wrappy(once) module.exports.strict = wrappy(onceStrict) @@ -9211,11 +7753,12 @@ function onceStrict (fn) { return f } -},{"wrappy":120}],91:[function(require,module,exports){ -(function (process){ +},{"wrappy":164}],95:[function(require,module,exports){ +(function (process){(function (){ 'use strict'; -if (!process.version || +if (typeof process === 'undefined' || + !process.version || process.version.indexOf('v0.') === 0 || process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) { module.exports = { nextTick: nextTick }; @@ -9258,8 +7801,8 @@ function nextTick(fn, arg1, arg2, arg3) { } -}).call(this,require('_process')) -},{"_process":92}],92:[function(require,module,exports){ +}).call(this)}).call(this,require('_process')) +},{"_process":96}],96:[function(require,module,exports){ // shim for using process in browser var process = module.exports = {}; @@ -9445,8 +7988,8 @@ process.chdir = function (dir) { }; process.umask = function() { return 0; }; -},{}],93:[function(require,module,exports){ -(function (global){ +},{}],97:[function(require,module,exports){ +(function (global){(function (){ /*! https://mths.be/punycode v1.4.1 by @mathias */ ;(function(root) { @@ -9981,8 +8524,8 @@ process.umask = function() { return 0; }; }(this)); -}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],94:[function(require,module,exports){ +}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{}],98:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -10068,7 +8611,7 @@ var isArray = Array.isArray || function (xs) { return Object.prototype.toString.call(xs) === '[object Array]'; }; -},{}],95:[function(require,module,exports){ +},{}],99:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -10155,16 +8698,16 @@ var objectKeys = Object.keys || function (obj) { return res; }; -},{}],96:[function(require,module,exports){ +},{}],100:[function(require,module,exports){ 'use strict'; exports.decode = exports.parse = require('./decode'); exports.encode = exports.stringify = require('./encode'); -},{"./decode":94,"./encode":95}],97:[function(require,module,exports){ +},{"./decode":98,"./encode":99}],101:[function(require,module,exports){ module.exports = require('./lib/_stream_duplex.js'); -},{"./lib/_stream_duplex.js":98}],98:[function(require,module,exports){ +},{"./lib/_stream_duplex.js":102}],102:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -10210,7 +8753,7 @@ var objectKeys = Object.keys || function (obj) { module.exports = Duplex; /**/ -var util = require('core-util-is'); +var util = Object.create(require('core-util-is')); util.inherits = require('inherits'); /**/ @@ -10296,7 +8839,7 @@ Duplex.prototype._destroy = function (err, cb) { pna.nextTick(cb, err); }; -},{"./_stream_readable":100,"./_stream_writable":102,"core-util-is":14,"inherits":80,"process-nextick-args":91}],99:[function(require,module,exports){ +},{"./_stream_readable":104,"./_stream_writable":106,"core-util-is":13,"inherits":84,"process-nextick-args":95}],103:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -10329,7 +8872,7 @@ module.exports = PassThrough; var Transform = require('./_stream_transform'); /**/ -var util = require('core-util-is'); +var util = Object.create(require('core-util-is')); util.inherits = require('inherits'); /**/ @@ -10344,8 +8887,8 @@ function PassThrough(options) { PassThrough.prototype._transform = function (chunk, encoding, cb) { cb(null, chunk); }; -},{"./_stream_transform":101,"core-util-is":14,"inherits":80}],100:[function(require,module,exports){ -(function (process,global){ +},{"./_stream_transform":105,"core-util-is":13,"inherits":84}],104:[function(require,module,exports){ +(function (process,global){(function (){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -10412,7 +8955,7 @@ function _isUint8Array(obj) { /**/ /**/ -var util = require('core-util-is'); +var util = Object.create(require('core-util-is')); util.inherits = require('inherits'); /**/ @@ -11365,8 +9908,8 @@ function indexOf(xs, x) { } return -1; } -}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./_stream_duplex":98,"./internal/streams/BufferList":103,"./internal/streams/destroy":104,"./internal/streams/stream":105,"_process":92,"core-util-is":14,"events":13,"inherits":80,"isarray":106,"process-nextick-args":91,"safe-buffer":110,"string_decoder/":107,"util":11}],101:[function(require,module,exports){ +}).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"./_stream_duplex":102,"./internal/streams/BufferList":107,"./internal/streams/destroy":108,"./internal/streams/stream":109,"_process":96,"core-util-is":13,"events":79,"inherits":84,"isarray":86,"process-nextick-args":95,"safe-buffer":110,"string_decoder/":111,"util":11}],105:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -11437,7 +9980,7 @@ module.exports = Transform; var Duplex = require('./_stream_duplex'); /**/ -var util = require('core-util-is'); +var util = Object.create(require('core-util-is')); util.inherits = require('inherits'); /**/ @@ -11581,8 +10124,8 @@ function done(stream, er, data) { return stream.push(null); } -},{"./_stream_duplex":98,"core-util-is":14,"inherits":80}],102:[function(require,module,exports){ -(function (process,global,setImmediate){ +},{"./_stream_duplex":102,"core-util-is":13,"inherits":84}],106:[function(require,module,exports){ +(function (process,global,setImmediate){(function (){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -11649,7 +10192,7 @@ var Duplex; Writable.WritableState = WritableState; /**/ -var util = require('core-util-is'); +var util = Object.create(require('core-util-is')); util.inherits = require('inherits'); /**/ @@ -12270,8 +10813,8 @@ Writable.prototype._destroy = function (err, cb) { this.end(); cb(err); }; -}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("timers").setImmediate) -},{"./_stream_duplex":98,"./internal/streams/destroy":104,"./internal/streams/stream":105,"_process":92,"core-util-is":14,"inherits":80,"process-nextick-args":91,"safe-buffer":110,"timers":112,"util-deprecate":115}],103:[function(require,module,exports){ +}).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("timers").setImmediate) +},{"./_stream_duplex":102,"./internal/streams/destroy":108,"./internal/streams/stream":109,"_process":96,"core-util-is":13,"inherits":84,"process-nextick-args":95,"safe-buffer":110,"timers":116,"util-deprecate":130}],107:[function(require,module,exports){ 'use strict'; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -12351,7 +10894,7 @@ if (util && util.inspect && util.inspect.custom) { return this.constructor.name + ' ' + obj; }; } -},{"safe-buffer":110,"util":11}],104:[function(require,module,exports){ +},{"safe-buffer":110,"util":11}],108:[function(require,module,exports){ 'use strict'; /**/ @@ -12426,17 +10969,74 @@ module.exports = { destroy: destroy, undestroy: undestroy }; -},{"process-nextick-args":91}],105:[function(require,module,exports){ +},{"process-nextick-args":95}],109:[function(require,module,exports){ module.exports = require('events').EventEmitter; -},{"events":13}],106:[function(require,module,exports){ -var toString = {}.toString; +},{"events":79}],110:[function(require,module,exports){ +/* eslint-disable node/no-deprecated-api */ +var buffer = require('buffer') +var Buffer = buffer.Buffer -module.exports = Array.isArray || function (arr) { - return toString.call(arr) == '[object Array]'; -}; +// alternative to using Object.keys for old browsers +function copyProps (src, dst) { + for (var key in src) { + dst[key] = src[key] + } +} +if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { + module.exports = buffer +} else { + // Copy properties from require('buffer') + copyProps(buffer, exports) + exports.Buffer = SafeBuffer +} -},{}],107:[function(require,module,exports){ +function SafeBuffer (arg, encodingOrOffset, length) { + return Buffer(arg, encodingOrOffset, length) +} + +// Copy static methods from Buffer +copyProps(Buffer, SafeBuffer) + +SafeBuffer.from = function (arg, encodingOrOffset, length) { + if (typeof arg === 'number') { + throw new TypeError('Argument must not be a number') + } + return Buffer(arg, encodingOrOffset, length) +} + +SafeBuffer.alloc = function (size, fill, encoding) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + var buf = Buffer(size) + if (fill !== undefined) { + if (typeof encoding === 'string') { + buf.fill(fill, encoding) + } else { + buf.fill(fill) + } + } else { + buf.fill(0) + } + return buf +} + +SafeBuffer.allocUnsafe = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return Buffer(size) +} + +SafeBuffer.allocUnsafeSlow = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return buffer.SlowBuffer(size) +} + +},{"buffer":12}],111:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -12733,7 +11333,7 @@ function simpleWrite(buf) { function simpleEnd(buf) { return buf && buf.length ? this.write(buf) : ''; } -},{"safe-buffer":110}],108:[function(require,module,exports){ +},{"safe-buffer":110}],112:[function(require,module,exports){ exports = module.exports = require('./lib/_stream_readable.js'); exports.Stream = exports; exports.Readable = exports; @@ -12742,7 +11342,7 @@ exports.Duplex = require('./lib/_stream_duplex.js'); exports.Transform = require('./lib/_stream_transform.js'); exports.PassThrough = require('./lib/_stream_passthrough.js'); -},{"./lib/_stream_duplex.js":98,"./lib/_stream_passthrough.js":99,"./lib/_stream_readable.js":100,"./lib/_stream_transform.js":101,"./lib/_stream_writable.js":102}],109:[function(require,module,exports){ +},{"./lib/_stream_duplex.js":102,"./lib/_stream_passthrough.js":103,"./lib/_stream_readable.js":104,"./lib/_stream_transform.js":105,"./lib/_stream_writable.js":106}],113:[function(require,module,exports){ 'use strict' function ReInterval (callback, interval, args) { @@ -12801,7 +11401,8 @@ function reInterval () { module.exports = reInterval; -},{}],110:[function(require,module,exports){ +},{}],114:[function(require,module,exports){ +/*! safe-buffer. MIT License. Feross Aboukhadijeh */ /* eslint-disable node/no-deprecated-api */ var buffer = require('buffer') var Buffer = buffer.Buffer @@ -12824,6 +11425,8 @@ function SafeBuffer (arg, encodingOrOffset, length) { return Buffer(arg, encodingOrOffset, length) } +SafeBuffer.prototype = Object.create(Buffer.prototype) + // Copy static methods from Buffer copyProps(Buffer, SafeBuffer) @@ -12865,13 +11468,13 @@ SafeBuffer.allocUnsafeSlow = function (size) { return buffer.SlowBuffer(size) } -},{"buffer":12}],111:[function(require,module,exports){ +},{"buffer":12}],115:[function(require,module,exports){ module.exports = shift function shift (stream) { var rs = stream._readableState if (!rs) return null - return rs.objectMode ? stream.read() : stream.read(getStateLength(rs)) + return (rs.objectMode || typeof stream._duplexState === 'number') ? stream.read() : stream.read(getStateLength(rs)) } function getStateLength (state) { @@ -12887,8 +11490,8 @@ function getStateLength (state) { return state.length } -},{}],112:[function(require,module,exports){ -(function (setImmediate,clearImmediate){ +},{}],116:[function(require,module,exports){ +(function (setImmediate,clearImmediate){(function (){ var nextTick = require('process/browser.js').nextTick; var apply = Function.prototype.apply; var slice = Array.prototype.slice; @@ -12965,8 +11568,191 @@ exports.setImmediate = typeof setImmediate === "function" ? setImmediate : funct exports.clearImmediate = typeof clearImmediate === "function" ? clearImmediate : function(id) { delete immediateIds[id]; }; -}).call(this,require("timers").setImmediate,require("timers").clearImmediate) -},{"process/browser.js":92,"timers":112}],113:[function(require,module,exports){ +}).call(this)}).call(this,require("timers").setImmediate,require("timers").clearImmediate) +},{"process/browser.js":96,"timers":116}],117:[function(require,module,exports){ +"use strict"; + +var isPrototype = require("../prototype/is"); + +module.exports = function (value) { + if (typeof value !== "function") return false; + + if (!hasOwnProperty.call(value, "length")) return false; + + try { + if (typeof value.length !== "number") return false; + if (typeof value.call !== "function") return false; + if (typeof value.apply !== "function") return false; + } catch (error) { + return false; + } + + return !isPrototype(value); +}; + +},{"../prototype/is":124}],118:[function(require,module,exports){ +"use strict"; + +var isValue = require("../value/is") + , isObject = require("../object/is") + , stringCoerce = require("../string/coerce") + , toShortString = require("./to-short-string"); + +var resolveMessage = function (message, value) { + return message.replace("%v", toShortString(value)); +}; + +module.exports = function (value, defaultMessage, inputOptions) { + if (!isObject(inputOptions)) throw new TypeError(resolveMessage(defaultMessage, value)); + if (!isValue(value)) { + if ("default" in inputOptions) return inputOptions["default"]; + if (inputOptions.isOptional) return null; + } + var errorMessage = stringCoerce(inputOptions.errorMessage); + if (!isValue(errorMessage)) errorMessage = defaultMessage; + throw new TypeError(resolveMessage(errorMessage, value)); +}; + +},{"../object/is":121,"../string/coerce":125,"../value/is":127,"./to-short-string":120}],119:[function(require,module,exports){ +"use strict"; + +module.exports = function (value) { + try { + return value.toString(); + } catch (error) { + try { return String(value); } + catch (error2) { return null; } + } +}; + +},{}],120:[function(require,module,exports){ +"use strict"; + +var safeToString = require("./safe-to-string"); + +var reNewLine = /[\n\r\u2028\u2029]/g; + +module.exports = function (value) { + var string = safeToString(value); + if (string === null) return ""; + // Trim if too long + if (string.length > 100) string = string.slice(0, 99) + "…"; + // Replace eventual new lines + string = string.replace(reNewLine, function (char) { + switch (char) { + case "\n": + return "\\n"; + case "\r": + return "\\r"; + case "\u2028": + return "\\u2028"; + case "\u2029": + return "\\u2029"; + /* istanbul ignore next */ + default: + throw new Error("Unexpected character"); + } + }); + return string; +}; + +},{"./safe-to-string":119}],121:[function(require,module,exports){ +"use strict"; + +var isValue = require("../value/is"); + +// prettier-ignore +var possibleTypes = { "object": true, "function": true, "undefined": true /* document.all */ }; + +module.exports = function (value) { + if (!isValue(value)) return false; + return hasOwnProperty.call(possibleTypes, typeof value); +}; + +},{"../value/is":127}],122:[function(require,module,exports){ +"use strict"; + +var resolveException = require("../lib/resolve-exception") + , is = require("./is"); + +module.exports = function (value/*, options*/) { + if (is(value)) return value; + return resolveException(value, "%v is not a plain function", arguments[1]); +}; + +},{"../lib/resolve-exception":118,"./is":123}],123:[function(require,module,exports){ +"use strict"; + +var isFunction = require("../function/is"); + +var classRe = /^\s*class[\s{/}]/, functionToString = Function.prototype.toString; + +module.exports = function (value) { + if (!isFunction(value)) return false; + if (classRe.test(functionToString.call(value))) return false; + return true; +}; + +},{"../function/is":117}],124:[function(require,module,exports){ +"use strict"; + +var isObject = require("../object/is"); + +module.exports = function (value) { + if (!isObject(value)) return false; + try { + if (!value.constructor) return false; + return value.constructor.prototype === value; + } catch (error) { + return false; + } +}; + +},{"../object/is":121}],125:[function(require,module,exports){ +"use strict"; + +var isValue = require("../value/is") + , isObject = require("../object/is"); + +var objectToString = Object.prototype.toString; + +module.exports = function (value) { + if (!isValue(value)) return null; + if (isObject(value)) { + // Reject Object.prototype.toString coercion + var valueToString = value.toString; + if (typeof valueToString !== "function") return null; + if (valueToString === objectToString) return null; + // Note: It can be object coming from other realm, still as there's no ES3 and CSP compliant + // way to resolve its realm's Object.prototype.toString it's left as not addressed edge case + } + try { + return "" + value; // Ensure implicit coercion + } catch (error) { + return null; + } +}; + +},{"../object/is":121,"../value/is":127}],126:[function(require,module,exports){ +"use strict"; + +var resolveException = require("../lib/resolve-exception") + , is = require("./is"); + +module.exports = function (value/*, options*/) { + if (is(value)) return value; + return resolveException(value, "Cannot use %v", arguments[1]); +}; + +},{"../lib/resolve-exception":118,"./is":127}],127:[function(require,module,exports){ +"use strict"; + +// ES3 safe +var _undefined = void 0; + +module.exports = function (value) { return value !== _undefined && value !== null; }; + +},{}],128:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -13700,7 +12486,7 @@ Url.prototype.parseHost = function() { if (host) this.hostname = host; }; -},{"./util":114,"punycode":93,"querystring":96}],114:[function(require,module,exports){ +},{"./util":129,"punycode":97,"querystring":100}],129:[function(require,module,exports){ 'use strict'; module.exports = { @@ -13718,8 +12504,8 @@ module.exports = { } }; -},{}],115:[function(require,module,exports){ -(function (global){ +},{}],130:[function(require,module,exports){ +(function (global){(function (){ /** * Module exports. @@ -13788,16 +12574,41 @@ function config (name) { return String(val).toLowerCase() === 'true'; } -}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],116:[function(require,module,exports){ +}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{}],131:[function(require,module,exports){ +if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); + }; +} else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + var TempCtor = function () {} + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } +} + +},{}],132:[function(require,module,exports){ module.exports = function isBuffer(arg) { return arg && typeof arg === 'object' && typeof arg.copy === 'function' && typeof arg.fill === 'function' && typeof arg.readUInt8 === 'function'; } -},{}],117:[function(require,module,exports){ -(function (process,global){ +},{}],133:[function(require,module,exports){ +(function (process,global){(function (){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -14385,9 +13196,3389 @@ function hasOwnProperty(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } -}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./support/isBuffer":116,"_process":92,"inherits":80}],118:[function(require,module,exports){ -(function (process,global){ +}).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"./support/isBuffer":132,"_process":96,"inherits":131}],134:[function(require,module,exports){ +(function (process,Buffer){(function (){ +var stream = require('readable-stream') +var eos = require('end-of-stream') +var inherits = require('inherits') +var shift = require('stream-shift') + +var SIGNAL_FLUSH = (Buffer.from && Buffer.from !== Uint8Array.from) + ? Buffer.from([0]) + : new Buffer([0]) + +var onuncork = function(self, fn) { + if (self._corked) self.once('uncork', fn) + else fn() +} + +var autoDestroy = function (self, err) { + if (self._autoDestroy) self.destroy(err) +} + +var destroyer = function(self, end) { + return function(err) { + if (err) autoDestroy(self, err.message === 'premature close' ? null : err) + else if (end && !self._ended) self.end() + } +} + +var end = function(ws, fn) { + if (!ws) return fn() + if (ws._writableState && ws._writableState.finished) return fn() + if (ws._writableState) return ws.end(fn) + ws.end() + fn() +} + +var toStreams2 = function(rs) { + return new (stream.Readable)({objectMode:true, highWaterMark:16}).wrap(rs) +} + +var Duplexify = function(writable, readable, opts) { + if (!(this instanceof Duplexify)) return new Duplexify(writable, readable, opts) + stream.Duplex.call(this, opts) + + this._writable = null + this._readable = null + this._readable2 = null + + this._autoDestroy = !opts || opts.autoDestroy !== false + this._forwardDestroy = !opts || opts.destroy !== false + this._forwardEnd = !opts || opts.end !== false + this._corked = 1 // start corked + this._ondrain = null + this._drained = false + this._forwarding = false + this._unwrite = null + this._unread = null + this._ended = false + + this.destroyed = false + + if (writable) this.setWritable(writable) + if (readable) this.setReadable(readable) +} + +inherits(Duplexify, stream.Duplex) + +Duplexify.obj = function(writable, readable, opts) { + if (!opts) opts = {} + opts.objectMode = true + opts.highWaterMark = 16 + return new Duplexify(writable, readable, opts) +} + +Duplexify.prototype.cork = function() { + if (++this._corked === 1) this.emit('cork') +} + +Duplexify.prototype.uncork = function() { + if (this._corked && --this._corked === 0) this.emit('uncork') +} + +Duplexify.prototype.setWritable = function(writable) { + if (this._unwrite) this._unwrite() + + if (this.destroyed) { + if (writable && writable.destroy) writable.destroy() + return + } + + if (writable === null || writable === false) { + this.end() + return + } + + var self = this + var unend = eos(writable, {writable:true, readable:false}, destroyer(this, this._forwardEnd)) + + var ondrain = function() { + var ondrain = self._ondrain + self._ondrain = null + if (ondrain) ondrain() + } + + var clear = function() { + self._writable.removeListener('drain', ondrain) + unend() + } + + if (this._unwrite) process.nextTick(ondrain) // force a drain on stream reset to avoid livelocks + + this._writable = writable + this._writable.on('drain', ondrain) + this._unwrite = clear + + this.uncork() // always uncork setWritable +} + +Duplexify.prototype.setReadable = function(readable) { + if (this._unread) this._unread() + + if (this.destroyed) { + if (readable && readable.destroy) readable.destroy() + return + } + + if (readable === null || readable === false) { + this.push(null) + this.resume() + return + } + + var self = this + var unend = eos(readable, {writable:false, readable:true}, destroyer(this)) + + var onreadable = function() { + self._forward() + } + + var onend = function() { + self.push(null) + } + + var clear = function() { + self._readable2.removeListener('readable', onreadable) + self._readable2.removeListener('end', onend) + unend() + } + + this._drained = true + this._readable = readable + this._readable2 = readable._readableState ? readable : toStreams2(readable) + this._readable2.on('readable', onreadable) + this._readable2.on('end', onend) + this._unread = clear + + this._forward() +} + +Duplexify.prototype._read = function() { + this._drained = true + this._forward() +} + +Duplexify.prototype._forward = function() { + if (this._forwarding || !this._readable2 || !this._drained) return + this._forwarding = true + + var data + + while (this._drained && (data = shift(this._readable2)) !== null) { + if (this.destroyed) continue + this._drained = this.push(data) + } + + this._forwarding = false +} + +Duplexify.prototype.destroy = function(err) { + if (this.destroyed) return + this.destroyed = true + + var self = this + process.nextTick(function() { + self._destroy(err) + }) +} + +Duplexify.prototype._destroy = function(err) { + if (err) { + var ondrain = this._ondrain + this._ondrain = null + if (ondrain) ondrain(err) + else this.emit('error', err) + } + + if (this._forwardDestroy) { + if (this._readable && this._readable.destroy) this._readable.destroy() + if (this._writable && this._writable.destroy) this._writable.destroy() + } + + this.emit('close') +} + +Duplexify.prototype._write = function(data, enc, cb) { + if (this.destroyed) return cb() + if (this._corked) return onuncork(this, this._write.bind(this, data, enc, cb)) + if (data === SIGNAL_FLUSH) return this._finish(cb) + if (!this._writable) return cb() + + if (this._writable.write(data) === false) this._ondrain = cb + else cb() +} + +Duplexify.prototype._finish = function(cb) { + var self = this + this.emit('preend') + onuncork(this, function() { + end(self._forwardEnd && self._writable, function() { + // haxx to not emit prefinish twice + if (self._writableState.prefinished === false) self._writableState.prefinished = true + self.emit('prefinish') + onuncork(self, cb) + }) + }) +} + +Duplexify.prototype.end = function(data, enc, cb) { + if (typeof data === 'function') return this.end(null, null, data) + if (typeof enc === 'function') return this.end(data, null, enc) + this._ended = true + if (data) this.write(data) + if (!this._writableState.ending) this.write(SIGNAL_FLUSH) + return stream.Writable.prototype.end.call(this, cb) +} + +module.exports = Duplexify + +}).call(this)}).call(this,require('_process'),require("buffer").Buffer) +},{"_process":96,"buffer":12,"end-of-stream":16,"inherits":84,"readable-stream":143,"stream-shift":115}],135:[function(require,module,exports){ +arguments[4][102][0].apply(exports,arguments) +},{"./_stream_readable":137,"./_stream_writable":139,"core-util-is":13,"dup":102,"inherits":84,"process-nextick-args":95}],136:[function(require,module,exports){ +arguments[4][103][0].apply(exports,arguments) +},{"./_stream_transform":138,"core-util-is":13,"dup":103,"inherits":84}],137:[function(require,module,exports){ +arguments[4][104][0].apply(exports,arguments) +},{"./_stream_duplex":135,"./internal/streams/BufferList":140,"./internal/streams/destroy":141,"./internal/streams/stream":142,"_process":96,"core-util-is":13,"dup":104,"events":79,"inherits":84,"isarray":86,"process-nextick-args":95,"safe-buffer":144,"string_decoder/":160,"util":11}],138:[function(require,module,exports){ +arguments[4][105][0].apply(exports,arguments) +},{"./_stream_duplex":135,"core-util-is":13,"dup":105,"inherits":84}],139:[function(require,module,exports){ +arguments[4][106][0].apply(exports,arguments) +},{"./_stream_duplex":135,"./internal/streams/destroy":141,"./internal/streams/stream":142,"_process":96,"core-util-is":13,"dup":106,"inherits":84,"process-nextick-args":95,"safe-buffer":144,"timers":116,"util-deprecate":130}],140:[function(require,module,exports){ +arguments[4][107][0].apply(exports,arguments) +},{"dup":107,"safe-buffer":144,"util":11}],141:[function(require,module,exports){ +arguments[4][108][0].apply(exports,arguments) +},{"dup":108,"process-nextick-args":95}],142:[function(require,module,exports){ +arguments[4][109][0].apply(exports,arguments) +},{"dup":109,"events":79}],143:[function(require,module,exports){ +arguments[4][112][0].apply(exports,arguments) +},{"./lib/_stream_duplex.js":135,"./lib/_stream_passthrough.js":136,"./lib/_stream_readable.js":137,"./lib/_stream_transform.js":138,"./lib/_stream_writable.js":139,"dup":112}],144:[function(require,module,exports){ +arguments[4][110][0].apply(exports,arguments) +},{"buffer":12,"dup":110}],145:[function(require,module,exports){ +'use strict'; + +function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } + +var codes = {}; + +function createErrorType(code, message, Base) { + if (!Base) { + Base = Error; + } + + function getMessage(arg1, arg2, arg3) { + if (typeof message === 'string') { + return message; + } else { + return message(arg1, arg2, arg3); + } + } + + var NodeError = + /*#__PURE__*/ + function (_Base) { + _inheritsLoose(NodeError, _Base); + + function NodeError(arg1, arg2, arg3) { + return _Base.call(this, getMessage(arg1, arg2, arg3)) || this; + } + + return NodeError; + }(Base); + + NodeError.prototype.name = Base.name; + NodeError.prototype.code = code; + codes[code] = NodeError; +} // https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js + + +function oneOf(expected, thing) { + if (Array.isArray(expected)) { + var len = expected.length; + expected = expected.map(function (i) { + return String(i); + }); + + if (len > 2) { + return "one of ".concat(thing, " ").concat(expected.slice(0, len - 1).join(', '), ", or ") + expected[len - 1]; + } else if (len === 2) { + return "one of ".concat(thing, " ").concat(expected[0], " or ").concat(expected[1]); + } else { + return "of ".concat(thing, " ").concat(expected[0]); + } + } else { + return "of ".concat(thing, " ").concat(String(expected)); + } +} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith + + +function startsWith(str, search, pos) { + return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search; +} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith + + +function endsWith(str, search, this_len) { + if (this_len === undefined || this_len > str.length) { + this_len = str.length; + } + + return str.substring(this_len - search.length, this_len) === search; +} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes + + +function includes(str, search, start) { + if (typeof start !== 'number') { + start = 0; + } + + if (start + search.length > str.length) { + return false; + } else { + return str.indexOf(search, start) !== -1; + } +} + +createErrorType('ERR_INVALID_OPT_VALUE', function (name, value) { + return 'The value "' + value + '" is invalid for option "' + name + '"'; +}, TypeError); +createErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) { + // determiner: 'must be' or 'must not be' + var determiner; + + if (typeof expected === 'string' && startsWith(expected, 'not ')) { + determiner = 'must not be'; + expected = expected.replace(/^not /, ''); + } else { + determiner = 'must be'; + } + + var msg; + + if (endsWith(name, ' argument')) { + // For cases like 'first argument' + msg = "The ".concat(name, " ").concat(determiner, " ").concat(oneOf(expected, 'type')); + } else { + var type = includes(name, '.') ? 'property' : 'argument'; + msg = "The \"".concat(name, "\" ").concat(type, " ").concat(determiner, " ").concat(oneOf(expected, 'type')); + } + + msg += ". Received type ".concat(typeof actual); + return msg; +}, TypeError); +createErrorType('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF'); +createErrorType('ERR_METHOD_NOT_IMPLEMENTED', function (name) { + return 'The ' + name + ' method is not implemented'; +}); +createErrorType('ERR_STREAM_PREMATURE_CLOSE', 'Premature close'); +createErrorType('ERR_STREAM_DESTROYED', function (name) { + return 'Cannot call ' + name + ' after a stream was destroyed'; +}); +createErrorType('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times'); +createErrorType('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable'); +createErrorType('ERR_STREAM_WRITE_AFTER_END', 'write after end'); +createErrorType('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError); +createErrorType('ERR_UNKNOWN_ENCODING', function (arg) { + return 'Unknown encoding: ' + arg; +}, TypeError); +createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event'); +module.exports.codes = codes; + +},{}],146:[function(require,module,exports){ +(function (process){(function (){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. +// a duplex stream is just a stream that is both readable and writable. +// Since JS doesn't have multiple prototypal inheritance, this class +// prototypally inherits from Readable, and then parasitically from +// Writable. +'use strict'; +/**/ + +var objectKeys = Object.keys || function (obj) { + var keys = []; + + for (var key in obj) { + keys.push(key); + } + + return keys; +}; +/**/ + + +module.exports = Duplex; + +var Readable = require('./_stream_readable'); + +var Writable = require('./_stream_writable'); + +require('inherits')(Duplex, Readable); + +{ + // Allow the keys array to be GC'ed. + var keys = objectKeys(Writable.prototype); + + for (var v = 0; v < keys.length; v++) { + var method = keys[v]; + if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; + } +} + +function Duplex(options) { + if (!(this instanceof Duplex)) return new Duplex(options); + Readable.call(this, options); + Writable.call(this, options); + this.allowHalfOpen = true; + + if (options) { + if (options.readable === false) this.readable = false; + if (options.writable === false) this.writable = false; + + if (options.allowHalfOpen === false) { + this.allowHalfOpen = false; + this.once('end', onend); + } + } +} + +Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._writableState.highWaterMark; + } +}); +Object.defineProperty(Duplex.prototype, 'writableBuffer', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._writableState && this._writableState.getBuffer(); + } +}); +Object.defineProperty(Duplex.prototype, 'writableLength', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._writableState.length; + } +}); // the no-half-open enforcer + +function onend() { + // If the writable side ended, then we're ok. + if (this._writableState.ended) return; // no more data can be written. + // But allow more writes to happen in this tick. + + process.nextTick(onEndNT, this); +} + +function onEndNT(self) { + self.end(); +} + +Object.defineProperty(Duplex.prototype, 'destroyed', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + if (this._readableState === undefined || this._writableState === undefined) { + return false; + } + + return this._readableState.destroyed && this._writableState.destroyed; + }, + set: function set(value) { + // we ignore the value if the stream + // has not been initialized yet + if (this._readableState === undefined || this._writableState === undefined) { + return; + } // backward compatibility, the user is explicitly + // managing destroyed + + + this._readableState.destroyed = value; + this._writableState.destroyed = value; + } +}); +}).call(this)}).call(this,require('_process')) +},{"./_stream_readable":148,"./_stream_writable":150,"_process":96,"inherits":84}],147:[function(require,module,exports){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. +// a passthrough stream. +// basically just the most minimal sort of Transform stream. +// Every written chunk gets output as-is. +'use strict'; + +module.exports = PassThrough; + +var Transform = require('./_stream_transform'); + +require('inherits')(PassThrough, Transform); + +function PassThrough(options) { + if (!(this instanceof PassThrough)) return new PassThrough(options); + Transform.call(this, options); +} + +PassThrough.prototype._transform = function (chunk, encoding, cb) { + cb(null, chunk); +}; +},{"./_stream_transform":149,"inherits":84}],148:[function(require,module,exports){ +(function (process,global){(function (){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. +'use strict'; + +module.exports = Readable; +/**/ + +var Duplex; +/**/ + +Readable.ReadableState = ReadableState; +/**/ + +var EE = require('events').EventEmitter; + +var EElistenerCount = function EElistenerCount(emitter, type) { + return emitter.listeners(type).length; +}; +/**/ + +/**/ + + +var Stream = require('./internal/streams/stream'); +/**/ + + +var Buffer = require('buffer').Buffer; + +var OurUint8Array = global.Uint8Array || function () {}; + +function _uint8ArrayToBuffer(chunk) { + return Buffer.from(chunk); +} + +function _isUint8Array(obj) { + return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; +} +/**/ + + +var debugUtil = require('util'); + +var debug; + +if (debugUtil && debugUtil.debuglog) { + debug = debugUtil.debuglog('stream'); +} else { + debug = function debug() {}; +} +/**/ + + +var BufferList = require('./internal/streams/buffer_list'); + +var destroyImpl = require('./internal/streams/destroy'); + +var _require = require('./internal/streams/state'), + getHighWaterMark = _require.getHighWaterMark; + +var _require$codes = require('../errors').codes, + ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, + ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF, + ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, + ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; // Lazy loaded to improve the startup performance. + + +var StringDecoder; +var createReadableStreamAsyncIterator; +var from; + +require('inherits')(Readable, Stream); + +var errorOrDestroy = destroyImpl.errorOrDestroy; +var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; + +function prependListener(emitter, event, fn) { + // Sadly this is not cacheable as some libraries bundle their own + // event emitter implementation with them. + if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); // This is a hack to make sure that our error handler is attached before any + // userland ones. NEVER DO THIS. This is here only because this code needs + // to continue to work with older versions of Node.js that do not include + // the prependListener() method. The goal is to eventually remove this hack. + + if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; +} + +function ReadableState(options, stream, isDuplex) { + Duplex = Duplex || require('./_stream_duplex'); + options = options || {}; // Duplex streams are both readable and writable, but share + // the same options object. + // However, some cases require setting options to different + // values for the readable and the writable sides of the duplex stream. + // These options can be provided separately as readableXXX and writableXXX. + + if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; // object stream flag. Used to make read(n) ignore n and to + // make all the buffer merging and length checks go away + + this.objectMode = !!options.objectMode; + if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; // the point at which it stops calling _read() to fill the buffer + // Note: 0 is a valid value, means "don't call _read preemptively ever" + + this.highWaterMark = getHighWaterMark(this, options, 'readableHighWaterMark', isDuplex); // A linked list is used to store data chunks instead of an array because the + // linked list can remove elements from the beginning faster than + // array.shift() + + this.buffer = new BufferList(); + this.length = 0; + this.pipes = null; + this.pipesCount = 0; + this.flowing = null; + this.ended = false; + this.endEmitted = false; + this.reading = false; // a flag to be able to tell if the event 'readable'/'data' is emitted + // immediately, or on a later tick. We set this to true at first, because + // any actions that shouldn't happen until "later" should generally also + // not happen before the first read call. + + this.sync = true; // whenever we return null, then we set a flag to say + // that we're awaiting a 'readable' event emission. + + this.needReadable = false; + this.emittedReadable = false; + this.readableListening = false; + this.resumeScheduled = false; + this.paused = true; // Should close be emitted on destroy. Defaults to true. + + this.emitClose = options.emitClose !== false; // Should .destroy() be called after 'end' (and potentially 'finish') + + this.autoDestroy = !!options.autoDestroy; // has it been destroyed + + this.destroyed = false; // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + + this.defaultEncoding = options.defaultEncoding || 'utf8'; // the number of writers that are awaiting a drain event in .pipe()s + + this.awaitDrain = 0; // if true, a maybeReadMore has been scheduled + + this.readingMore = false; + this.decoder = null; + this.encoding = null; + + if (options.encoding) { + if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; + this.decoder = new StringDecoder(options.encoding); + this.encoding = options.encoding; + } +} + +function Readable(options) { + Duplex = Duplex || require('./_stream_duplex'); + if (!(this instanceof Readable)) return new Readable(options); // Checking for a Stream.Duplex instance is faster here instead of inside + // the ReadableState constructor, at least with V8 6.5 + + var isDuplex = this instanceof Duplex; + this._readableState = new ReadableState(options, this, isDuplex); // legacy + + this.readable = true; + + if (options) { + if (typeof options.read === 'function') this._read = options.read; + if (typeof options.destroy === 'function') this._destroy = options.destroy; + } + + Stream.call(this); +} + +Object.defineProperty(Readable.prototype, 'destroyed', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + if (this._readableState === undefined) { + return false; + } + + return this._readableState.destroyed; + }, + set: function set(value) { + // we ignore the value if the stream + // has not been initialized yet + if (!this._readableState) { + return; + } // backward compatibility, the user is explicitly + // managing destroyed + + + this._readableState.destroyed = value; + } +}); +Readable.prototype.destroy = destroyImpl.destroy; +Readable.prototype._undestroy = destroyImpl.undestroy; + +Readable.prototype._destroy = function (err, cb) { + cb(err); +}; // Manually shove something into the read() buffer. +// This returns true if the highWaterMark has not been hit yet, +// similar to how Writable.write() returns true if you should +// write() some more. + + +Readable.prototype.push = function (chunk, encoding) { + var state = this._readableState; + var skipChunkCheck; + + if (!state.objectMode) { + if (typeof chunk === 'string') { + encoding = encoding || state.defaultEncoding; + + if (encoding !== state.encoding) { + chunk = Buffer.from(chunk, encoding); + encoding = ''; + } + + skipChunkCheck = true; + } + } else { + skipChunkCheck = true; + } + + return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); +}; // Unshift should *always* be something directly out of read() + + +Readable.prototype.unshift = function (chunk) { + return readableAddChunk(this, chunk, null, true, false); +}; + +function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { + debug('readableAddChunk', chunk); + var state = stream._readableState; + + if (chunk === null) { + state.reading = false; + onEofChunk(stream, state); + } else { + var er; + if (!skipChunkCheck) er = chunkInvalid(state, chunk); + + if (er) { + errorOrDestroy(stream, er); + } else if (state.objectMode || chunk && chunk.length > 0) { + if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) { + chunk = _uint8ArrayToBuffer(chunk); + } + + if (addToFront) { + if (state.endEmitted) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());else addChunk(stream, state, chunk, true); + } else if (state.ended) { + errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF()); + } else if (state.destroyed) { + return false; + } else { + state.reading = false; + + if (state.decoder && !encoding) { + chunk = state.decoder.write(chunk); + if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state); + } else { + addChunk(stream, state, chunk, false); + } + } + } else if (!addToFront) { + state.reading = false; + maybeReadMore(stream, state); + } + } // We can push more data if we are below the highWaterMark. + // Also, if we have no data yet, we can stand some more bytes. + // This is to work around cases where hwm=0, such as the repl. + + + return !state.ended && (state.length < state.highWaterMark || state.length === 0); +} + +function addChunk(stream, state, chunk, addToFront) { + if (state.flowing && state.length === 0 && !state.sync) { + state.awaitDrain = 0; + stream.emit('data', chunk); + } else { + // update the buffer info. + state.length += state.objectMode ? 1 : chunk.length; + if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); + if (state.needReadable) emitReadable(stream); + } + + maybeReadMore(stream, state); +} + +function chunkInvalid(state, chunk) { + var er; + + if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { + er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk); + } + + return er; +} + +Readable.prototype.isPaused = function () { + return this._readableState.flowing === false; +}; // backwards compatibility. + + +Readable.prototype.setEncoding = function (enc) { + if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; + var decoder = new StringDecoder(enc); + this._readableState.decoder = decoder; // If setEncoding(null), decoder.encoding equals utf8 + + this._readableState.encoding = this._readableState.decoder.encoding; // Iterate over current buffer to convert already stored Buffers: + + var p = this._readableState.buffer.head; + var content = ''; + + while (p !== null) { + content += decoder.write(p.data); + p = p.next; + } + + this._readableState.buffer.clear(); + + if (content !== '') this._readableState.buffer.push(content); + this._readableState.length = content.length; + return this; +}; // Don't raise the hwm > 1GB + + +var MAX_HWM = 0x40000000; + +function computeNewHighWaterMark(n) { + if (n >= MAX_HWM) { + // TODO(ronag): Throw ERR_VALUE_OUT_OF_RANGE. + n = MAX_HWM; + } else { + // Get the next highest power of 2 to prevent increasing hwm excessively in + // tiny amounts + n--; + n |= n >>> 1; + n |= n >>> 2; + n |= n >>> 4; + n |= n >>> 8; + n |= n >>> 16; + n++; + } + + return n; +} // This function is designed to be inlinable, so please take care when making +// changes to the function body. + + +function howMuchToRead(n, state) { + if (n <= 0 || state.length === 0 && state.ended) return 0; + if (state.objectMode) return 1; + + if (n !== n) { + // Only flow one buffer at a time + if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; + } // If we're asking for more than the current hwm, then raise the hwm. + + + if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); + if (n <= state.length) return n; // Don't have enough + + if (!state.ended) { + state.needReadable = true; + return 0; + } + + return state.length; +} // you can override either this method, or the async _read(n) below. + + +Readable.prototype.read = function (n) { + debug('read', n); + n = parseInt(n, 10); + var state = this._readableState; + var nOrig = n; + if (n !== 0) state.emittedReadable = false; // if we're doing read(0) to trigger a readable event, but we + // already have a bunch of data in the buffer, then just trigger + // the 'readable' event and move on. + + if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) { + debug('read: emitReadable', state.length, state.ended); + if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); + return null; + } + + n = howMuchToRead(n, state); // if we've ended, and we're now clear, then finish it up. + + if (n === 0 && state.ended) { + if (state.length === 0) endReadable(this); + return null; + } // All the actual chunk generation logic needs to be + // *below* the call to _read. The reason is that in certain + // synthetic stream cases, such as passthrough streams, _read + // may be a completely synchronous operation which may change + // the state of the read buffer, providing enough data when + // before there was *not* enough. + // + // So, the steps are: + // 1. Figure out what the state of things will be after we do + // a read from the buffer. + // + // 2. If that resulting state will trigger a _read, then call _read. + // Note that this may be asynchronous, or synchronous. Yes, it is + // deeply ugly to write APIs this way, but that still doesn't mean + // that the Readable class should behave improperly, as streams are + // designed to be sync/async agnostic. + // Take note if the _read call is sync or async (ie, if the read call + // has returned yet), so that we know whether or not it's safe to emit + // 'readable' etc. + // + // 3. Actually pull the requested chunks out of the buffer and return. + // if we need a readable event, then we need to do some reading. + + + var doRead = state.needReadable; + debug('need readable', doRead); // if we currently have less than the highWaterMark, then also read some + + if (state.length === 0 || state.length - n < state.highWaterMark) { + doRead = true; + debug('length less than watermark', doRead); + } // however, if we've ended, then there's no point, and if we're already + // reading, then it's unnecessary. + + + if (state.ended || state.reading) { + doRead = false; + debug('reading or ended', doRead); + } else if (doRead) { + debug('do read'); + state.reading = true; + state.sync = true; // if the length is currently zero, then we *need* a readable event. + + if (state.length === 0) state.needReadable = true; // call internal read method + + this._read(state.highWaterMark); + + state.sync = false; // If _read pushed data synchronously, then `reading` will be false, + // and we need to re-evaluate how much data we can return to the user. + + if (!state.reading) n = howMuchToRead(nOrig, state); + } + + var ret; + if (n > 0) ret = fromList(n, state);else ret = null; + + if (ret === null) { + state.needReadable = state.length <= state.highWaterMark; + n = 0; + } else { + state.length -= n; + state.awaitDrain = 0; + } + + if (state.length === 0) { + // If we have nothing in the buffer, then we want to know + // as soon as we *do* get something into the buffer. + if (!state.ended) state.needReadable = true; // If we tried to read() past the EOF, then emit end on the next tick. + + if (nOrig !== n && state.ended) endReadable(this); + } + + if (ret !== null) this.emit('data', ret); + return ret; +}; + +function onEofChunk(stream, state) { + debug('onEofChunk'); + if (state.ended) return; + + if (state.decoder) { + var chunk = state.decoder.end(); + + if (chunk && chunk.length) { + state.buffer.push(chunk); + state.length += state.objectMode ? 1 : chunk.length; + } + } + + state.ended = true; + + if (state.sync) { + // if we are sync, wait until next tick to emit the data. + // Otherwise we risk emitting data in the flow() + // the readable code triggers during a read() call + emitReadable(stream); + } else { + // emit 'readable' now to make sure it gets picked up. + state.needReadable = false; + + if (!state.emittedReadable) { + state.emittedReadable = true; + emitReadable_(stream); + } + } +} // Don't emit readable right away in sync mode, because this can trigger +// another read() call => stack overflow. This way, it might trigger +// a nextTick recursion warning, but that's not so bad. + + +function emitReadable(stream) { + var state = stream._readableState; + debug('emitReadable', state.needReadable, state.emittedReadable); + state.needReadable = false; + + if (!state.emittedReadable) { + debug('emitReadable', state.flowing); + state.emittedReadable = true; + process.nextTick(emitReadable_, stream); + } +} + +function emitReadable_(stream) { + var state = stream._readableState; + debug('emitReadable_', state.destroyed, state.length, state.ended); + + if (!state.destroyed && (state.length || state.ended)) { + stream.emit('readable'); + state.emittedReadable = false; + } // The stream needs another readable event if + // 1. It is not flowing, as the flow mechanism will take + // care of it. + // 2. It is not ended. + // 3. It is below the highWaterMark, so we can schedule + // another readable later. + + + state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark; + flow(stream); +} // at this point, the user has presumably seen the 'readable' event, +// and called read() to consume some data. that may have triggered +// in turn another _read(n) call, in which case reading = true if +// it's in progress. +// However, if we're not ended, or reading, and the length < hwm, +// then go ahead and try to read some more preemptively. + + +function maybeReadMore(stream, state) { + if (!state.readingMore) { + state.readingMore = true; + process.nextTick(maybeReadMore_, stream, state); + } +} + +function maybeReadMore_(stream, state) { + // Attempt to read more data if we should. + // + // The conditions for reading more data are (one of): + // - Not enough data buffered (state.length < state.highWaterMark). The loop + // is responsible for filling the buffer with enough data if such data + // is available. If highWaterMark is 0 and we are not in the flowing mode + // we should _not_ attempt to buffer any extra data. We'll get more data + // when the stream consumer calls read() instead. + // - No data in the buffer, and the stream is in flowing mode. In this mode + // the loop below is responsible for ensuring read() is called. Failing to + // call read here would abort the flow and there's no other mechanism for + // continuing the flow if the stream consumer has just subscribed to the + // 'data' event. + // + // In addition to the above conditions to keep reading data, the following + // conditions prevent the data from being read: + // - The stream has ended (state.ended). + // - There is already a pending 'read' operation (state.reading). This is a + // case where the the stream has called the implementation defined _read() + // method, but they are processing the call asynchronously and have _not_ + // called push() with new data. In this case we skip performing more + // read()s. The execution ends in this method again after the _read() ends + // up calling push() with more data. + while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) { + var len = state.length; + debug('maybeReadMore read 0'); + stream.read(0); + if (len === state.length) // didn't get any data, stop spinning. + break; + } + + state.readingMore = false; +} // abstract method. to be overridden in specific implementation classes. +// call cb(er, data) where data is <= n in length. +// for virtual (non-string, non-buffer) streams, "length" is somewhat +// arbitrary, and perhaps not very meaningful. + + +Readable.prototype._read = function (n) { + errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED('_read()')); +}; + +Readable.prototype.pipe = function (dest, pipeOpts) { + var src = this; + var state = this._readableState; + + switch (state.pipesCount) { + case 0: + state.pipes = dest; + break; + + case 1: + state.pipes = [state.pipes, dest]; + break; + + default: + state.pipes.push(dest); + break; + } + + state.pipesCount += 1; + debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); + var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; + var endFn = doEnd ? onend : unpipe; + if (state.endEmitted) process.nextTick(endFn);else src.once('end', endFn); + dest.on('unpipe', onunpipe); + + function onunpipe(readable, unpipeInfo) { + debug('onunpipe'); + + if (readable === src) { + if (unpipeInfo && unpipeInfo.hasUnpiped === false) { + unpipeInfo.hasUnpiped = true; + cleanup(); + } + } + } + + function onend() { + debug('onend'); + dest.end(); + } // when the dest drains, it reduces the awaitDrain counter + // on the source. This would be more elegant with a .once() + // handler in flow(), but adding and removing repeatedly is + // too slow. + + + var ondrain = pipeOnDrain(src); + dest.on('drain', ondrain); + var cleanedUp = false; + + function cleanup() { + debug('cleanup'); // cleanup event handlers once the pipe is broken + + dest.removeListener('close', onclose); + dest.removeListener('finish', onfinish); + dest.removeListener('drain', ondrain); + dest.removeListener('error', onerror); + dest.removeListener('unpipe', onunpipe); + src.removeListener('end', onend); + src.removeListener('end', unpipe); + src.removeListener('data', ondata); + cleanedUp = true; // if the reader is waiting for a drain event from this + // specific writer, then it would cause it to never start + // flowing again. + // So, if this is awaiting a drain, then we just call it now. + // If we don't know, then assume that we are waiting for one. + + if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); + } + + src.on('data', ondata); + + function ondata(chunk) { + debug('ondata'); + var ret = dest.write(chunk); + debug('dest.write', ret); + + if (ret === false) { + // If the user unpiped during `dest.write()`, it is possible + // to get stuck in a permanently paused state if that write + // also returned false. + // => Check whether `dest` is still a piping destination. + if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { + debug('false write response, pause', state.awaitDrain); + state.awaitDrain++; + } + + src.pause(); + } + } // if the dest has an error, then stop piping into it. + // however, don't suppress the throwing behavior for this. + + + function onerror(er) { + debug('onerror', er); + unpipe(); + dest.removeListener('error', onerror); + if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er); + } // Make sure our error handler is attached before userland ones. + + + prependListener(dest, 'error', onerror); // Both close and finish should trigger unpipe, but only once. + + function onclose() { + dest.removeListener('finish', onfinish); + unpipe(); + } + + dest.once('close', onclose); + + function onfinish() { + debug('onfinish'); + dest.removeListener('close', onclose); + unpipe(); + } + + dest.once('finish', onfinish); + + function unpipe() { + debug('unpipe'); + src.unpipe(dest); + } // tell the dest that it's being piped to + + + dest.emit('pipe', src); // start the flow if it hasn't been started already. + + if (!state.flowing) { + debug('pipe resume'); + src.resume(); + } + + return dest; +}; + +function pipeOnDrain(src) { + return function pipeOnDrainFunctionResult() { + var state = src._readableState; + debug('pipeOnDrain', state.awaitDrain); + if (state.awaitDrain) state.awaitDrain--; + + if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { + state.flowing = true; + flow(src); + } + }; +} + +Readable.prototype.unpipe = function (dest) { + var state = this._readableState; + var unpipeInfo = { + hasUnpiped: false + }; // if we're not piping anywhere, then do nothing. + + if (state.pipesCount === 0) return this; // just one destination. most common case. + + if (state.pipesCount === 1) { + // passed in one, but it's not the right one. + if (dest && dest !== state.pipes) return this; + if (!dest) dest = state.pipes; // got a match. + + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + if (dest) dest.emit('unpipe', this, unpipeInfo); + return this; + } // slow case. multiple pipe destinations. + + + if (!dest) { + // remove all. + var dests = state.pipes; + var len = state.pipesCount; + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + + for (var i = 0; i < len; i++) { + dests[i].emit('unpipe', this, { + hasUnpiped: false + }); + } + + return this; + } // try to find the right one. + + + var index = indexOf(state.pipes, dest); + if (index === -1) return this; + state.pipes.splice(index, 1); + state.pipesCount -= 1; + if (state.pipesCount === 1) state.pipes = state.pipes[0]; + dest.emit('unpipe', this, unpipeInfo); + return this; +}; // set up data events if they are asked for +// Ensure readable listeners eventually get something + + +Readable.prototype.on = function (ev, fn) { + var res = Stream.prototype.on.call(this, ev, fn); + var state = this._readableState; + + if (ev === 'data') { + // update readableListening so that resume() may be a no-op + // a few lines down. This is needed to support once('readable'). + state.readableListening = this.listenerCount('readable') > 0; // Try start flowing on next tick if stream isn't explicitly paused + + if (state.flowing !== false) this.resume(); + } else if (ev === 'readable') { + if (!state.endEmitted && !state.readableListening) { + state.readableListening = state.needReadable = true; + state.flowing = false; + state.emittedReadable = false; + debug('on readable', state.length, state.reading); + + if (state.length) { + emitReadable(this); + } else if (!state.reading) { + process.nextTick(nReadingNextTick, this); + } + } + } + + return res; +}; + +Readable.prototype.addListener = Readable.prototype.on; + +Readable.prototype.removeListener = function (ev, fn) { + var res = Stream.prototype.removeListener.call(this, ev, fn); + + if (ev === 'readable') { + // We need to check if there is someone still listening to + // readable and reset the state. However this needs to happen + // after readable has been emitted but before I/O (nextTick) to + // support once('readable', fn) cycles. This means that calling + // resume within the same tick will have no + // effect. + process.nextTick(updateReadableListening, this); + } + + return res; +}; + +Readable.prototype.removeAllListeners = function (ev) { + var res = Stream.prototype.removeAllListeners.apply(this, arguments); + + if (ev === 'readable' || ev === undefined) { + // We need to check if there is someone still listening to + // readable and reset the state. However this needs to happen + // after readable has been emitted but before I/O (nextTick) to + // support once('readable', fn) cycles. This means that calling + // resume within the same tick will have no + // effect. + process.nextTick(updateReadableListening, this); + } + + return res; +}; + +function updateReadableListening(self) { + var state = self._readableState; + state.readableListening = self.listenerCount('readable') > 0; + + if (state.resumeScheduled && !state.paused) { + // flowing needs to be set to true now, otherwise + // the upcoming resume will not flow. + state.flowing = true; // crude way to check if we should resume + } else if (self.listenerCount('data') > 0) { + self.resume(); + } +} + +function nReadingNextTick(self) { + debug('readable nexttick read 0'); + self.read(0); +} // pause() and resume() are remnants of the legacy readable stream API +// If the user uses them, then switch into old mode. + + +Readable.prototype.resume = function () { + var state = this._readableState; + + if (!state.flowing) { + debug('resume'); // we flow only if there is no one listening + // for readable, but we still have to call + // resume() + + state.flowing = !state.readableListening; + resume(this, state); + } + + state.paused = false; + return this; +}; + +function resume(stream, state) { + if (!state.resumeScheduled) { + state.resumeScheduled = true; + process.nextTick(resume_, stream, state); + } +} + +function resume_(stream, state) { + debug('resume', state.reading); + + if (!state.reading) { + stream.read(0); + } + + state.resumeScheduled = false; + stream.emit('resume'); + flow(stream); + if (state.flowing && !state.reading) stream.read(0); +} + +Readable.prototype.pause = function () { + debug('call pause flowing=%j', this._readableState.flowing); + + if (this._readableState.flowing !== false) { + debug('pause'); + this._readableState.flowing = false; + this.emit('pause'); + } + + this._readableState.paused = true; + return this; +}; + +function flow(stream) { + var state = stream._readableState; + debug('flow', state.flowing); + + while (state.flowing && stream.read() !== null) { + ; + } +} // wrap an old-style stream as the async data source. +// This is *not* part of the readable stream interface. +// It is an ugly unfortunate mess of history. + + +Readable.prototype.wrap = function (stream) { + var _this = this; + + var state = this._readableState; + var paused = false; + stream.on('end', function () { + debug('wrapped end'); + + if (state.decoder && !state.ended) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) _this.push(chunk); + } + + _this.push(null); + }); + stream.on('data', function (chunk) { + debug('wrapped data'); + if (state.decoder) chunk = state.decoder.write(chunk); // don't skip over falsy values in objectMode + + if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; + + var ret = _this.push(chunk); + + if (!ret) { + paused = true; + stream.pause(); + } + }); // proxy all the other methods. + // important when wrapping filters and duplexes. + + for (var i in stream) { + if (this[i] === undefined && typeof stream[i] === 'function') { + this[i] = function methodWrap(method) { + return function methodWrapReturnFunction() { + return stream[method].apply(stream, arguments); + }; + }(i); + } + } // proxy certain important events. + + + for (var n = 0; n < kProxyEvents.length; n++) { + stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); + } // when we try to consume some more bytes, simply unpause the + // underlying stream. + + + this._read = function (n) { + debug('wrapped _read', n); + + if (paused) { + paused = false; + stream.resume(); + } + }; + + return this; +}; + +if (typeof Symbol === 'function') { + Readable.prototype[Symbol.asyncIterator] = function () { + if (createReadableStreamAsyncIterator === undefined) { + createReadableStreamAsyncIterator = require('./internal/streams/async_iterator'); + } + + return createReadableStreamAsyncIterator(this); + }; +} + +Object.defineProperty(Readable.prototype, 'readableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._readableState.highWaterMark; + } +}); +Object.defineProperty(Readable.prototype, 'readableBuffer', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._readableState && this._readableState.buffer; + } +}); +Object.defineProperty(Readable.prototype, 'readableFlowing', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._readableState.flowing; + }, + set: function set(state) { + if (this._readableState) { + this._readableState.flowing = state; + } + } +}); // exposed for testing purposes only. + +Readable._fromList = fromList; +Object.defineProperty(Readable.prototype, 'readableLength', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._readableState.length; + } +}); // Pluck off n bytes from an array of buffers. +// Length is the combined lengths of all the buffers in the list. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. + +function fromList(n, state) { + // nothing buffered + if (state.length === 0) return null; + var ret; + if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { + // read it all, truncate the list + if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.first();else ret = state.buffer.concat(state.length); + state.buffer.clear(); + } else { + // read part of list + ret = state.buffer.consume(n, state.decoder); + } + return ret; +} + +function endReadable(stream) { + var state = stream._readableState; + debug('endReadable', state.endEmitted); + + if (!state.endEmitted) { + state.ended = true; + process.nextTick(endReadableNT, state, stream); + } +} + +function endReadableNT(state, stream) { + debug('endReadableNT', state.endEmitted, state.length); // Check that we didn't get one last unshift. + + if (!state.endEmitted && state.length === 0) { + state.endEmitted = true; + stream.readable = false; + stream.emit('end'); + + if (state.autoDestroy) { + // In case of duplex streams we need a way to detect + // if the writable side is ready for autoDestroy as well + var wState = stream._writableState; + + if (!wState || wState.autoDestroy && wState.finished) { + stream.destroy(); + } + } + } +} + +if (typeof Symbol === 'function') { + Readable.from = function (iterable, opts) { + if (from === undefined) { + from = require('./internal/streams/from'); + } + + return from(Readable, iterable, opts); + }; +} + +function indexOf(xs, x) { + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) return i; + } + + return -1; +} +}).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"../errors":145,"./_stream_duplex":146,"./internal/streams/async_iterator":151,"./internal/streams/buffer_list":152,"./internal/streams/destroy":153,"./internal/streams/from":155,"./internal/streams/state":157,"./internal/streams/stream":158,"_process":96,"buffer":12,"events":79,"inherits":84,"string_decoder/":160,"util":11}],149:[function(require,module,exports){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. +// a transform stream is a readable/writable stream where you do +// something with the data. Sometimes it's called a "filter", +// but that's not a great name for it, since that implies a thing where +// some bits pass through, and others are simply ignored. (That would +// be a valid example of a transform, of course.) +// +// While the output is causally related to the input, it's not a +// necessarily symmetric or synchronous transformation. For example, +// a zlib stream might take multiple plain-text writes(), and then +// emit a single compressed chunk some time in the future. +// +// Here's how this works: +// +// The Transform stream has all the aspects of the readable and writable +// stream classes. When you write(chunk), that calls _write(chunk,cb) +// internally, and returns false if there's a lot of pending writes +// buffered up. When you call read(), that calls _read(n) until +// there's enough pending readable data buffered up. +// +// In a transform stream, the written data is placed in a buffer. When +// _read(n) is called, it transforms the queued up data, calling the +// buffered _write cb's as it consumes chunks. If consuming a single +// written chunk would result in multiple output chunks, then the first +// outputted bit calls the readcb, and subsequent chunks just go into +// the read buffer, and will cause it to emit 'readable' if necessary. +// +// This way, back-pressure is actually determined by the reading side, +// since _read has to be called to start processing a new chunk. However, +// a pathological inflate type of transform can cause excessive buffering +// here. For example, imagine a stream where every byte of input is +// interpreted as an integer from 0-255, and then results in that many +// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in +// 1kb of data being output. In this case, you could write a very small +// amount of input, and end up with a very large amount of output. In +// such a pathological inflating mechanism, there'd be no way to tell +// the system to stop doing the transform. A single 4MB write could +// cause the system to run out of memory. +// +// However, even in such a pathological case, only a single written chunk +// would be consumed, and then the rest would wait (un-transformed) until +// the results of the previous transformed chunk were consumed. +'use strict'; + +module.exports = Transform; + +var _require$codes = require('../errors').codes, + ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, + ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, + ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING, + ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0; + +var Duplex = require('./_stream_duplex'); + +require('inherits')(Transform, Duplex); + +function afterTransform(er, data) { + var ts = this._transformState; + ts.transforming = false; + var cb = ts.writecb; + + if (cb === null) { + return this.emit('error', new ERR_MULTIPLE_CALLBACK()); + } + + ts.writechunk = null; + ts.writecb = null; + if (data != null) // single equals check for both `null` and `undefined` + this.push(data); + cb(er); + var rs = this._readableState; + rs.reading = false; + + if (rs.needReadable || rs.length < rs.highWaterMark) { + this._read(rs.highWaterMark); + } +} + +function Transform(options) { + if (!(this instanceof Transform)) return new Transform(options); + Duplex.call(this, options); + this._transformState = { + afterTransform: afterTransform.bind(this), + needTransform: false, + transforming: false, + writecb: null, + writechunk: null, + writeencoding: null + }; // start out asking for a readable event once data is transformed. + + this._readableState.needReadable = true; // we have implemented the _read method, and done the other things + // that Readable wants before the first _read call, so unset the + // sync guard flag. + + this._readableState.sync = false; + + if (options) { + if (typeof options.transform === 'function') this._transform = options.transform; + if (typeof options.flush === 'function') this._flush = options.flush; + } // When the writable side finishes, then flush out anything remaining. + + + this.on('prefinish', prefinish); +} + +function prefinish() { + var _this = this; + + if (typeof this._flush === 'function' && !this._readableState.destroyed) { + this._flush(function (er, data) { + done(_this, er, data); + }); + } else { + done(this, null, null); + } +} + +Transform.prototype.push = function (chunk, encoding) { + this._transformState.needTransform = false; + return Duplex.prototype.push.call(this, chunk, encoding); +}; // This is the part where you do stuff! +// override this function in implementation classes. +// 'chunk' is an input chunk. +// +// Call `push(newChunk)` to pass along transformed output +// to the readable side. You may call 'push' zero or more times. +// +// Call `cb(err)` when you are done with this chunk. If you pass +// an error, then that'll put the hurt on the whole operation. If you +// never call cb(), then you'll never get another chunk. + + +Transform.prototype._transform = function (chunk, encoding, cb) { + cb(new ERR_METHOD_NOT_IMPLEMENTED('_transform()')); +}; + +Transform.prototype._write = function (chunk, encoding, cb) { + var ts = this._transformState; + ts.writecb = cb; + ts.writechunk = chunk; + ts.writeencoding = encoding; + + if (!ts.transforming) { + var rs = this._readableState; + if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); + } +}; // Doesn't matter what the args are here. +// _transform does all the work. +// That we got here means that the readable side wants more data. + + +Transform.prototype._read = function (n) { + var ts = this._transformState; + + if (ts.writechunk !== null && !ts.transforming) { + ts.transforming = true; + + this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); + } else { + // mark that we need a transform, so that any data that comes in + // will get processed, now that we've asked for it. + ts.needTransform = true; + } +}; + +Transform.prototype._destroy = function (err, cb) { + Duplex.prototype._destroy.call(this, err, function (err2) { + cb(err2); + }); +}; + +function done(stream, er, data) { + if (er) return stream.emit('error', er); + if (data != null) // single equals check for both `null` and `undefined` + stream.push(data); // TODO(BridgeAR): Write a test for these two error cases + // if there's nothing in the write buffer, then that means + // that nothing more will ever be provided + + if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0(); + if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING(); + return stream.push(null); +} +},{"../errors":145,"./_stream_duplex":146,"inherits":84}],150:[function(require,module,exports){ +(function (process,global){(function (){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. +// A bit simpler than readable streams. +// Implement an async ._write(chunk, encoding, cb), and it'll handle all +// the drain event emission and buffering. +'use strict'; + +module.exports = Writable; +/* */ + +function WriteReq(chunk, encoding, cb) { + this.chunk = chunk; + this.encoding = encoding; + this.callback = cb; + this.next = null; +} // It seems a linked list but it is not +// there will be only 2 of these for each stream + + +function CorkedRequest(state) { + var _this = this; + + this.next = null; + this.entry = null; + + this.finish = function () { + onCorkedFinish(_this, state); + }; +} +/* */ + +/**/ + + +var Duplex; +/**/ + +Writable.WritableState = WritableState; +/**/ + +var internalUtil = { + deprecate: require('util-deprecate') +}; +/**/ + +/**/ + +var Stream = require('./internal/streams/stream'); +/**/ + + +var Buffer = require('buffer').Buffer; + +var OurUint8Array = global.Uint8Array || function () {}; + +function _uint8ArrayToBuffer(chunk) { + return Buffer.from(chunk); +} + +function _isUint8Array(obj) { + return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; +} + +var destroyImpl = require('./internal/streams/destroy'); + +var _require = require('./internal/streams/state'), + getHighWaterMark = _require.getHighWaterMark; + +var _require$codes = require('../errors').codes, + ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, + ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, + ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, + ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE, + ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED, + ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES, + ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END, + ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING; + +var errorOrDestroy = destroyImpl.errorOrDestroy; + +require('inherits')(Writable, Stream); + +function nop() {} + +function WritableState(options, stream, isDuplex) { + Duplex = Duplex || require('./_stream_duplex'); + options = options || {}; // Duplex streams are both readable and writable, but share + // the same options object. + // However, some cases require setting options to different + // values for the readable and the writable sides of the duplex stream, + // e.g. options.readableObjectMode vs. options.writableObjectMode, etc. + + if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; // object stream flag to indicate whether or not this stream + // contains buffers or objects. + + this.objectMode = !!options.objectMode; + if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; // the point at which write() starts returning false + // Note: 0 is a valid value, means that we always return false if + // the entire buffer is not flushed immediately on write() + + this.highWaterMark = getHighWaterMark(this, options, 'writableHighWaterMark', isDuplex); // if _final has been called + + this.finalCalled = false; // drain event flag. + + this.needDrain = false; // at the start of calling end() + + this.ending = false; // when end() has been called, and returned + + this.ended = false; // when 'finish' is emitted + + this.finished = false; // has it been destroyed + + this.destroyed = false; // should we decode strings into buffers before passing to _write? + // this is here so that some node-core streams can optimize string + // handling at a lower level. + + var noDecode = options.decodeStrings === false; + this.decodeStrings = !noDecode; // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + + this.defaultEncoding = options.defaultEncoding || 'utf8'; // not an actual buffer we keep track of, but a measurement + // of how much we're waiting to get pushed to some underlying + // socket or file. + + this.length = 0; // a flag to see when we're in the middle of a write. + + this.writing = false; // when true all writes will be buffered until .uncork() call + + this.corked = 0; // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, because any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + + this.sync = true; // a flag to know if we're processing previously buffered items, which + // may call the _write() callback in the same tick, so that we don't + // end up in an overlapped onwrite situation. + + this.bufferProcessing = false; // the callback that's passed to _write(chunk,cb) + + this.onwrite = function (er) { + onwrite(stream, er); + }; // the callback that the user supplies to write(chunk,encoding,cb) + + + this.writecb = null; // the amount that is being written when _write is called. + + this.writelen = 0; + this.bufferedRequest = null; + this.lastBufferedRequest = null; // number of pending user-supplied write callbacks + // this must be 0 before 'finish' can be emitted + + this.pendingcb = 0; // emit prefinish if the only thing we're waiting for is _write cbs + // This is relevant for synchronous Transform streams + + this.prefinished = false; // True if the error was already emitted and should not be thrown again + + this.errorEmitted = false; // Should close be emitted on destroy. Defaults to true. + + this.emitClose = options.emitClose !== false; // Should .destroy() be called after 'finish' (and potentially 'end') + + this.autoDestroy = !!options.autoDestroy; // count buffered requests + + this.bufferedRequestCount = 0; // allocate the first CorkedRequest, there is always + // one allocated and free to use, and we maintain at most two + + this.corkedRequestsFree = new CorkedRequest(this); +} + +WritableState.prototype.getBuffer = function getBuffer() { + var current = this.bufferedRequest; + var out = []; + + while (current) { + out.push(current); + current = current.next; + } + + return out; +}; + +(function () { + try { + Object.defineProperty(WritableState.prototype, 'buffer', { + get: internalUtil.deprecate(function writableStateBufferGetter() { + return this.getBuffer(); + }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') + }); + } catch (_) {} +})(); // Test _writableState for inheritance to account for Duplex streams, +// whose prototype chain only points to Readable. + + +var realHasInstance; + +if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { + realHasInstance = Function.prototype[Symbol.hasInstance]; + Object.defineProperty(Writable, Symbol.hasInstance, { + value: function value(object) { + if (realHasInstance.call(this, object)) return true; + if (this !== Writable) return false; + return object && object._writableState instanceof WritableState; + } + }); +} else { + realHasInstance = function realHasInstance(object) { + return object instanceof this; + }; +} + +function Writable(options) { + Duplex = Duplex || require('./_stream_duplex'); // Writable ctor is applied to Duplexes, too. + // `realHasInstance` is necessary because using plain `instanceof` + // would return false, as no `_writableState` property is attached. + // Trying to use the custom `instanceof` for Writable here will also break the + // Node.js LazyTransform implementation, which has a non-trivial getter for + // `_writableState` that would lead to infinite recursion. + // Checking for a Stream.Duplex instance is faster here instead of inside + // the WritableState constructor, at least with V8 6.5 + + var isDuplex = this instanceof Duplex; + if (!isDuplex && !realHasInstance.call(Writable, this)) return new Writable(options); + this._writableState = new WritableState(options, this, isDuplex); // legacy. + + this.writable = true; + + if (options) { + if (typeof options.write === 'function') this._write = options.write; + if (typeof options.writev === 'function') this._writev = options.writev; + if (typeof options.destroy === 'function') this._destroy = options.destroy; + if (typeof options.final === 'function') this._final = options.final; + } + + Stream.call(this); +} // Otherwise people can pipe Writable streams, which is just wrong. + + +Writable.prototype.pipe = function () { + errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE()); +}; + +function writeAfterEnd(stream, cb) { + var er = new ERR_STREAM_WRITE_AFTER_END(); // TODO: defer error events consistently everywhere, not just the cb + + errorOrDestroy(stream, er); + process.nextTick(cb, er); +} // Checks that a user-supplied chunk is valid, especially for the particular +// mode the stream is in. Currently this means that `null` is never accepted +// and undefined/non-string values are only allowed in object mode. + + +function validChunk(stream, state, chunk, cb) { + var er; + + if (chunk === null) { + er = new ERR_STREAM_NULL_VALUES(); + } else if (typeof chunk !== 'string' && !state.objectMode) { + er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer'], chunk); + } + + if (er) { + errorOrDestroy(stream, er); + process.nextTick(cb, er); + return false; + } + + return true; +} + +Writable.prototype.write = function (chunk, encoding, cb) { + var state = this._writableState; + var ret = false; + + var isBuf = !state.objectMode && _isUint8Array(chunk); + + if (isBuf && !Buffer.isBuffer(chunk)) { + chunk = _uint8ArrayToBuffer(chunk); + } + + if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; + if (typeof cb !== 'function') cb = nop; + if (state.ending) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { + state.pendingcb++; + ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); + } + return ret; +}; + +Writable.prototype.cork = function () { + this._writableState.corked++; +}; + +Writable.prototype.uncork = function () { + var state = this._writableState; + + if (state.corked) { + state.corked--; + if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); + } +}; + +Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { + // node::ParseEncoding() requires lower case. + if (typeof encoding === 'string') encoding = encoding.toLowerCase(); + if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new ERR_UNKNOWN_ENCODING(encoding); + this._writableState.defaultEncoding = encoding; + return this; +}; + +Object.defineProperty(Writable.prototype, 'writableBuffer', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._writableState && this._writableState.getBuffer(); + } +}); + +function decodeChunk(state, chunk, encoding) { + if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { + chunk = Buffer.from(chunk, encoding); + } + + return chunk; +} + +Object.defineProperty(Writable.prototype, 'writableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._writableState.highWaterMark; + } +}); // if we're already writing something, then just put this +// in the queue, and wait our turn. Otherwise, call _write +// If we return false, then we need a drain event, so set that flag. + +function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { + if (!isBuf) { + var newChunk = decodeChunk(state, chunk, encoding); + + if (chunk !== newChunk) { + isBuf = true; + encoding = 'buffer'; + chunk = newChunk; + } + } + + var len = state.objectMode ? 1 : chunk.length; + state.length += len; + var ret = state.length < state.highWaterMark; // we must ensure that previous needDrain will not be reset to false. + + if (!ret) state.needDrain = true; + + if (state.writing || state.corked) { + var last = state.lastBufferedRequest; + state.lastBufferedRequest = { + chunk: chunk, + encoding: encoding, + isBuf: isBuf, + callback: cb, + next: null + }; + + if (last) { + last.next = state.lastBufferedRequest; + } else { + state.bufferedRequest = state.lastBufferedRequest; + } + + state.bufferedRequestCount += 1; + } else { + doWrite(stream, state, false, len, chunk, encoding, cb); + } + + return ret; +} + +function doWrite(stream, state, writev, len, chunk, encoding, cb) { + state.writelen = len; + state.writecb = cb; + state.writing = true; + state.sync = true; + if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED('write'));else if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); + state.sync = false; +} + +function onwriteError(stream, state, sync, er, cb) { + --state.pendingcb; + + if (sync) { + // defer the callback if we are being called synchronously + // to avoid piling up things on the stack + process.nextTick(cb, er); // this can emit finish, and it will always happen + // after error + + process.nextTick(finishMaybe, stream, state); + stream._writableState.errorEmitted = true; + errorOrDestroy(stream, er); + } else { + // the caller expect this to happen before if + // it is async + cb(er); + stream._writableState.errorEmitted = true; + errorOrDestroy(stream, er); // this can emit finish, but finish must + // always follow error + + finishMaybe(stream, state); + } +} + +function onwriteStateUpdate(state) { + state.writing = false; + state.writecb = null; + state.length -= state.writelen; + state.writelen = 0; +} + +function onwrite(stream, er) { + var state = stream._writableState; + var sync = state.sync; + var cb = state.writecb; + if (typeof cb !== 'function') throw new ERR_MULTIPLE_CALLBACK(); + onwriteStateUpdate(state); + if (er) onwriteError(stream, state, sync, er, cb);else { + // Check if we're actually ready to finish, but don't emit yet + var finished = needFinish(state) || stream.destroyed; + + if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { + clearBuffer(stream, state); + } + + if (sync) { + process.nextTick(afterWrite, stream, state, finished, cb); + } else { + afterWrite(stream, state, finished, cb); + } + } +} + +function afterWrite(stream, state, finished, cb) { + if (!finished) onwriteDrain(stream, state); + state.pendingcb--; + cb(); + finishMaybe(stream, state); +} // Must force callback to be called on nextTick, so that we don't +// emit 'drain' before the write() consumer gets the 'false' return +// value, and has a chance to attach a 'drain' listener. + + +function onwriteDrain(stream, state) { + if (state.length === 0 && state.needDrain) { + state.needDrain = false; + stream.emit('drain'); + } +} // if there's something in the buffer waiting, then process it + + +function clearBuffer(stream, state) { + state.bufferProcessing = true; + var entry = state.bufferedRequest; + + if (stream._writev && entry && entry.next) { + // Fast case, write everything using _writev() + var l = state.bufferedRequestCount; + var buffer = new Array(l); + var holder = state.corkedRequestsFree; + holder.entry = entry; + var count = 0; + var allBuffers = true; + + while (entry) { + buffer[count] = entry; + if (!entry.isBuf) allBuffers = false; + entry = entry.next; + count += 1; + } + + buffer.allBuffers = allBuffers; + doWrite(stream, state, true, state.length, buffer, '', holder.finish); // doWrite is almost always async, defer these to save a bit of time + // as the hot path ends with doWrite + + state.pendingcb++; + state.lastBufferedRequest = null; + + if (holder.next) { + state.corkedRequestsFree = holder.next; + holder.next = null; + } else { + state.corkedRequestsFree = new CorkedRequest(state); + } + + state.bufferedRequestCount = 0; + } else { + // Slow case, write chunks one-by-one + while (entry) { + var chunk = entry.chunk; + var encoding = entry.encoding; + var cb = entry.callback; + var len = state.objectMode ? 1 : chunk.length; + doWrite(stream, state, false, len, chunk, encoding, cb); + entry = entry.next; + state.bufferedRequestCount--; // if we didn't call the onwrite immediately, then + // it means that we need to wait until it does. + // also, that means that the chunk and cb are currently + // being processed, so move the buffer counter past them. + + if (state.writing) { + break; + } + } + + if (entry === null) state.lastBufferedRequest = null; + } + + state.bufferedRequest = entry; + state.bufferProcessing = false; +} + +Writable.prototype._write = function (chunk, encoding, cb) { + cb(new ERR_METHOD_NOT_IMPLEMENTED('_write()')); +}; + +Writable.prototype._writev = null; + +Writable.prototype.end = function (chunk, encoding, cb) { + var state = this._writableState; + + if (typeof chunk === 'function') { + cb = chunk; + chunk = null; + encoding = null; + } else if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); // .end() fully uncorks + + if (state.corked) { + state.corked = 1; + this.uncork(); + } // ignore unnecessary end() calls. + + + if (!state.ending) endWritable(this, state, cb); + return this; +}; + +Object.defineProperty(Writable.prototype, 'writableLength', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._writableState.length; + } +}); + +function needFinish(state) { + return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; +} + +function callFinal(stream, state) { + stream._final(function (err) { + state.pendingcb--; + + if (err) { + errorOrDestroy(stream, err); + } + + state.prefinished = true; + stream.emit('prefinish'); + finishMaybe(stream, state); + }); +} + +function prefinish(stream, state) { + if (!state.prefinished && !state.finalCalled) { + if (typeof stream._final === 'function' && !state.destroyed) { + state.pendingcb++; + state.finalCalled = true; + process.nextTick(callFinal, stream, state); + } else { + state.prefinished = true; + stream.emit('prefinish'); + } + } +} + +function finishMaybe(stream, state) { + var need = needFinish(state); + + if (need) { + prefinish(stream, state); + + if (state.pendingcb === 0) { + state.finished = true; + stream.emit('finish'); + + if (state.autoDestroy) { + // In case of duplex streams we need a way to detect + // if the readable side is ready for autoDestroy as well + var rState = stream._readableState; + + if (!rState || rState.autoDestroy && rState.endEmitted) { + stream.destroy(); + } + } + } + } + + return need; +} + +function endWritable(stream, state, cb) { + state.ending = true; + finishMaybe(stream, state); + + if (cb) { + if (state.finished) process.nextTick(cb);else stream.once('finish', cb); + } + + state.ended = true; + stream.writable = false; +} + +function onCorkedFinish(corkReq, state, err) { + var entry = corkReq.entry; + corkReq.entry = null; + + while (entry) { + var cb = entry.callback; + state.pendingcb--; + cb(err); + entry = entry.next; + } // reuse the free corkReq. + + + state.corkedRequestsFree.next = corkReq; +} + +Object.defineProperty(Writable.prototype, 'destroyed', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + if (this._writableState === undefined) { + return false; + } + + return this._writableState.destroyed; + }, + set: function set(value) { + // we ignore the value if the stream + // has not been initialized yet + if (!this._writableState) { + return; + } // backward compatibility, the user is explicitly + // managing destroyed + + + this._writableState.destroyed = value; + } +}); +Writable.prototype.destroy = destroyImpl.destroy; +Writable.prototype._undestroy = destroyImpl.undestroy; + +Writable.prototype._destroy = function (err, cb) { + cb(err); +}; +}).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"../errors":145,"./_stream_duplex":146,"./internal/streams/destroy":153,"./internal/streams/state":157,"./internal/streams/stream":158,"_process":96,"buffer":12,"inherits":84,"util-deprecate":130}],151:[function(require,module,exports){ +(function (process){(function (){ +'use strict'; + +var _Object$setPrototypeO; + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +var finished = require('./end-of-stream'); + +var kLastResolve = Symbol('lastResolve'); +var kLastReject = Symbol('lastReject'); +var kError = Symbol('error'); +var kEnded = Symbol('ended'); +var kLastPromise = Symbol('lastPromise'); +var kHandlePromise = Symbol('handlePromise'); +var kStream = Symbol('stream'); + +function createIterResult(value, done) { + return { + value: value, + done: done + }; +} + +function readAndResolve(iter) { + var resolve = iter[kLastResolve]; + + if (resolve !== null) { + var data = iter[kStream].read(); // we defer if data is null + // we can be expecting either 'end' or + // 'error' + + if (data !== null) { + iter[kLastPromise] = null; + iter[kLastResolve] = null; + iter[kLastReject] = null; + resolve(createIterResult(data, false)); + } + } +} + +function onReadable(iter) { + // we wait for the next tick, because it might + // emit an error with process.nextTick + process.nextTick(readAndResolve, iter); +} + +function wrapForNext(lastPromise, iter) { + return function (resolve, reject) { + lastPromise.then(function () { + if (iter[kEnded]) { + resolve(createIterResult(undefined, true)); + return; + } + + iter[kHandlePromise](resolve, reject); + }, reject); + }; +} + +var AsyncIteratorPrototype = Object.getPrototypeOf(function () {}); +var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = { + get stream() { + return this[kStream]; + }, + + next: function next() { + var _this = this; + + // if we have detected an error in the meanwhile + // reject straight away + var error = this[kError]; + + if (error !== null) { + return Promise.reject(error); + } + + if (this[kEnded]) { + return Promise.resolve(createIterResult(undefined, true)); + } + + if (this[kStream].destroyed) { + // We need to defer via nextTick because if .destroy(err) is + // called, the error will be emitted via nextTick, and + // we cannot guarantee that there is no error lingering around + // waiting to be emitted. + return new Promise(function (resolve, reject) { + process.nextTick(function () { + if (_this[kError]) { + reject(_this[kError]); + } else { + resolve(createIterResult(undefined, true)); + } + }); + }); + } // if we have multiple next() calls + // we will wait for the previous Promise to finish + // this logic is optimized to support for await loops, + // where next() is only called once at a time + + + var lastPromise = this[kLastPromise]; + var promise; + + if (lastPromise) { + promise = new Promise(wrapForNext(lastPromise, this)); + } else { + // fast path needed to support multiple this.push() + // without triggering the next() queue + var data = this[kStream].read(); + + if (data !== null) { + return Promise.resolve(createIterResult(data, false)); + } + + promise = new Promise(this[kHandlePromise]); + } + + this[kLastPromise] = promise; + return promise; + } +}, _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, function () { + return this; +}), _defineProperty(_Object$setPrototypeO, "return", function _return() { + var _this2 = this; + + // destroy(err, cb) is a private API + // we can guarantee we have that here, because we control the + // Readable class this is attached to + return new Promise(function (resolve, reject) { + _this2[kStream].destroy(null, function (err) { + if (err) { + reject(err); + return; + } + + resolve(createIterResult(undefined, true)); + }); + }); +}), _Object$setPrototypeO), AsyncIteratorPrototype); + +var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator(stream) { + var _Object$create; + + var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, { + value: stream, + writable: true + }), _defineProperty(_Object$create, kLastResolve, { + value: null, + writable: true + }), _defineProperty(_Object$create, kLastReject, { + value: null, + writable: true + }), _defineProperty(_Object$create, kError, { + value: null, + writable: true + }), _defineProperty(_Object$create, kEnded, { + value: stream._readableState.endEmitted, + writable: true + }), _defineProperty(_Object$create, kHandlePromise, { + value: function value(resolve, reject) { + var data = iterator[kStream].read(); + + if (data) { + iterator[kLastPromise] = null; + iterator[kLastResolve] = null; + iterator[kLastReject] = null; + resolve(createIterResult(data, false)); + } else { + iterator[kLastResolve] = resolve; + iterator[kLastReject] = reject; + } + }, + writable: true + }), _Object$create)); + iterator[kLastPromise] = null; + finished(stream, function (err) { + if (err && err.code !== 'ERR_STREAM_PREMATURE_CLOSE') { + var reject = iterator[kLastReject]; // reject if we are waiting for data in the Promise + // returned by next() and store the error + + if (reject !== null) { + iterator[kLastPromise] = null; + iterator[kLastResolve] = null; + iterator[kLastReject] = null; + reject(err); + } + + iterator[kError] = err; + return; + } + + var resolve = iterator[kLastResolve]; + + if (resolve !== null) { + iterator[kLastPromise] = null; + iterator[kLastResolve] = null; + iterator[kLastReject] = null; + resolve(createIterResult(undefined, true)); + } + + iterator[kEnded] = true; + }); + stream.on('readable', onReadable.bind(null, iterator)); + return iterator; +}; + +module.exports = createReadableStreamAsyncIterator; +}).call(this)}).call(this,require('_process')) +},{"./end-of-stream":154,"_process":96}],152:[function(require,module,exports){ +'use strict'; + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +var _require = require('buffer'), + Buffer = _require.Buffer; + +var _require2 = require('util'), + inspect = _require2.inspect; + +var custom = inspect && inspect.custom || 'inspect'; + +function copyBuffer(src, target, offset) { + Buffer.prototype.copy.call(src, target, offset); +} + +module.exports = +/*#__PURE__*/ +function () { + function BufferList() { + _classCallCheck(this, BufferList); + + this.head = null; + this.tail = null; + this.length = 0; + } + + _createClass(BufferList, [{ + key: "push", + value: function push(v) { + var entry = { + data: v, + next: null + }; + if (this.length > 0) this.tail.next = entry;else this.head = entry; + this.tail = entry; + ++this.length; + } + }, { + key: "unshift", + value: function unshift(v) { + var entry = { + data: v, + next: this.head + }; + if (this.length === 0) this.tail = entry; + this.head = entry; + ++this.length; + } + }, { + key: "shift", + value: function shift() { + if (this.length === 0) return; + var ret = this.head.data; + if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; + --this.length; + return ret; + } + }, { + key: "clear", + value: function clear() { + this.head = this.tail = null; + this.length = 0; + } + }, { + key: "join", + value: function join(s) { + if (this.length === 0) return ''; + var p = this.head; + var ret = '' + p.data; + + while (p = p.next) { + ret += s + p.data; + } + + return ret; + } + }, { + key: "concat", + value: function concat(n) { + if (this.length === 0) return Buffer.alloc(0); + var ret = Buffer.allocUnsafe(n >>> 0); + var p = this.head; + var i = 0; + + while (p) { + copyBuffer(p.data, ret, i); + i += p.data.length; + p = p.next; + } + + return ret; + } // Consumes a specified amount of bytes or characters from the buffered data. + + }, { + key: "consume", + value: function consume(n, hasStrings) { + var ret; + + if (n < this.head.data.length) { + // `slice` is the same for buffers and strings. + ret = this.head.data.slice(0, n); + this.head.data = this.head.data.slice(n); + } else if (n === this.head.data.length) { + // First chunk is a perfect match. + ret = this.shift(); + } else { + // Result spans more than one buffer. + ret = hasStrings ? this._getString(n) : this._getBuffer(n); + } + + return ret; + } + }, { + key: "first", + value: function first() { + return this.head.data; + } // Consumes a specified amount of characters from the buffered data. + + }, { + key: "_getString", + value: function _getString(n) { + var p = this.head; + var c = 1; + var ret = p.data; + n -= ret.length; + + while (p = p.next) { + var str = p.data; + var nb = n > str.length ? str.length : n; + if (nb === str.length) ret += str;else ret += str.slice(0, n); + n -= nb; + + if (n === 0) { + if (nb === str.length) { + ++c; + if (p.next) this.head = p.next;else this.head = this.tail = null; + } else { + this.head = p; + p.data = str.slice(nb); + } + + break; + } + + ++c; + } + + this.length -= c; + return ret; + } // Consumes a specified amount of bytes from the buffered data. + + }, { + key: "_getBuffer", + value: function _getBuffer(n) { + var ret = Buffer.allocUnsafe(n); + var p = this.head; + var c = 1; + p.data.copy(ret); + n -= p.data.length; + + while (p = p.next) { + var buf = p.data; + var nb = n > buf.length ? buf.length : n; + buf.copy(ret, ret.length - n, 0, nb); + n -= nb; + + if (n === 0) { + if (nb === buf.length) { + ++c; + if (p.next) this.head = p.next;else this.head = this.tail = null; + } else { + this.head = p; + p.data = buf.slice(nb); + } + + break; + } + + ++c; + } + + this.length -= c; + return ret; + } // Make sure the linked list only shows the minimal necessary information. + + }, { + key: custom, + value: function value(_, options) { + return inspect(this, _objectSpread({}, options, { + // Only inspect one level. + depth: 0, + // It should not recurse. + customInspect: false + })); + } + }]); + + return BufferList; +}(); +},{"buffer":12,"util":11}],153:[function(require,module,exports){ +(function (process){(function (){ +'use strict'; // undocumented cb() API, needed for core, not for public API + +function destroy(err, cb) { + var _this = this; + + var readableDestroyed = this._readableState && this._readableState.destroyed; + var writableDestroyed = this._writableState && this._writableState.destroyed; + + if (readableDestroyed || writableDestroyed) { + if (cb) { + cb(err); + } else if (err) { + if (!this._writableState) { + process.nextTick(emitErrorNT, this, err); + } else if (!this._writableState.errorEmitted) { + this._writableState.errorEmitted = true; + process.nextTick(emitErrorNT, this, err); + } + } + + return this; + } // we set destroyed to true before firing error callbacks in order + // to make it re-entrance safe in case destroy() is called within callbacks + + + if (this._readableState) { + this._readableState.destroyed = true; + } // if this is a duplex stream mark the writable part as destroyed as well + + + if (this._writableState) { + this._writableState.destroyed = true; + } + + this._destroy(err || null, function (err) { + if (!cb && err) { + if (!_this._writableState) { + process.nextTick(emitErrorAndCloseNT, _this, err); + } else if (!_this._writableState.errorEmitted) { + _this._writableState.errorEmitted = true; + process.nextTick(emitErrorAndCloseNT, _this, err); + } else { + process.nextTick(emitCloseNT, _this); + } + } else if (cb) { + process.nextTick(emitCloseNT, _this); + cb(err); + } else { + process.nextTick(emitCloseNT, _this); + } + }); + + return this; +} + +function emitErrorAndCloseNT(self, err) { + emitErrorNT(self, err); + emitCloseNT(self); +} + +function emitCloseNT(self) { + if (self._writableState && !self._writableState.emitClose) return; + if (self._readableState && !self._readableState.emitClose) return; + self.emit('close'); +} + +function undestroy() { + if (this._readableState) { + this._readableState.destroyed = false; + this._readableState.reading = false; + this._readableState.ended = false; + this._readableState.endEmitted = false; + } + + if (this._writableState) { + this._writableState.destroyed = false; + this._writableState.ended = false; + this._writableState.ending = false; + this._writableState.finalCalled = false; + this._writableState.prefinished = false; + this._writableState.finished = false; + this._writableState.errorEmitted = false; + } +} + +function emitErrorNT(self, err) { + self.emit('error', err); +} + +function errorOrDestroy(stream, err) { + // We have tests that rely on errors being emitted + // in the same tick, so changing this is semver major. + // For now when you opt-in to autoDestroy we allow + // the error to be emitted nextTick. In a future + // semver major update we should change the default to this. + var rState = stream._readableState; + var wState = stream._writableState; + if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream.destroy(err);else stream.emit('error', err); +} + +module.exports = { + destroy: destroy, + undestroy: undestroy, + errorOrDestroy: errorOrDestroy +}; +}).call(this)}).call(this,require('_process')) +},{"_process":96}],154:[function(require,module,exports){ +// Ported from https://github.com/mafintosh/end-of-stream with +// permission from the author, Mathias Buus (@mafintosh). +'use strict'; + +var ERR_STREAM_PREMATURE_CLOSE = require('../../../errors').codes.ERR_STREAM_PREMATURE_CLOSE; + +function once(callback) { + var called = false; + return function () { + if (called) return; + called = true; + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + callback.apply(this, args); + }; +} + +function noop() {} + +function isRequest(stream) { + return stream.setHeader && typeof stream.abort === 'function'; +} + +function eos(stream, opts, callback) { + if (typeof opts === 'function') return eos(stream, null, opts); + if (!opts) opts = {}; + callback = once(callback || noop); + var readable = opts.readable || opts.readable !== false && stream.readable; + var writable = opts.writable || opts.writable !== false && stream.writable; + + var onlegacyfinish = function onlegacyfinish() { + if (!stream.writable) onfinish(); + }; + + var writableEnded = stream._writableState && stream._writableState.finished; + + var onfinish = function onfinish() { + writable = false; + writableEnded = true; + if (!readable) callback.call(stream); + }; + + var readableEnded = stream._readableState && stream._readableState.endEmitted; + + var onend = function onend() { + readable = false; + readableEnded = true; + if (!writable) callback.call(stream); + }; + + var onerror = function onerror(err) { + callback.call(stream, err); + }; + + var onclose = function onclose() { + var err; + + if (readable && !readableEnded) { + if (!stream._readableState || !stream._readableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); + return callback.call(stream, err); + } + + if (writable && !writableEnded) { + if (!stream._writableState || !stream._writableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); + return callback.call(stream, err); + } + }; + + var onrequest = function onrequest() { + stream.req.on('finish', onfinish); + }; + + if (isRequest(stream)) { + stream.on('complete', onfinish); + stream.on('abort', onclose); + if (stream.req) onrequest();else stream.on('request', onrequest); + } else if (writable && !stream._writableState) { + // legacy streams + stream.on('end', onlegacyfinish); + stream.on('close', onlegacyfinish); + } + + stream.on('end', onend); + stream.on('finish', onfinish); + if (opts.error !== false) stream.on('error', onerror); + stream.on('close', onclose); + return function () { + stream.removeListener('complete', onfinish); + stream.removeListener('abort', onclose); + stream.removeListener('request', onrequest); + if (stream.req) stream.req.removeListener('finish', onfinish); + stream.removeListener('end', onlegacyfinish); + stream.removeListener('close', onlegacyfinish); + stream.removeListener('finish', onfinish); + stream.removeListener('end', onend); + stream.removeListener('error', onerror); + stream.removeListener('close', onclose); + }; +} + +module.exports = eos; +},{"../../../errors":145}],155:[function(require,module,exports){ +module.exports = function () { + throw new Error('Readable.from is not available in the browser') +}; + +},{}],156:[function(require,module,exports){ +// Ported from https://github.com/mafintosh/pump with +// permission from the author, Mathias Buus (@mafintosh). +'use strict'; + +var eos; + +function once(callback) { + var called = false; + return function () { + if (called) return; + called = true; + callback.apply(void 0, arguments); + }; +} + +var _require$codes = require('../../../errors').codes, + ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS, + ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED; + +function noop(err) { + // Rethrow the error if it exists to avoid swallowing it + if (err) throw err; +} + +function isRequest(stream) { + return stream.setHeader && typeof stream.abort === 'function'; +} + +function destroyer(stream, reading, writing, callback) { + callback = once(callback); + var closed = false; + stream.on('close', function () { + closed = true; + }); + if (eos === undefined) eos = require('./end-of-stream'); + eos(stream, { + readable: reading, + writable: writing + }, function (err) { + if (err) return callback(err); + closed = true; + callback(); + }); + var destroyed = false; + return function (err) { + if (closed) return; + if (destroyed) return; + destroyed = true; // request.destroy just do .end - .abort is what we want + + if (isRequest(stream)) return stream.abort(); + if (typeof stream.destroy === 'function') return stream.destroy(); + callback(err || new ERR_STREAM_DESTROYED('pipe')); + }; +} + +function call(fn) { + fn(); +} + +function pipe(from, to) { + return from.pipe(to); +} + +function popCallback(streams) { + if (!streams.length) return noop; + if (typeof streams[streams.length - 1] !== 'function') return noop; + return streams.pop(); +} + +function pipeline() { + for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) { + streams[_key] = arguments[_key]; + } + + var callback = popCallback(streams); + if (Array.isArray(streams[0])) streams = streams[0]; + + if (streams.length < 2) { + throw new ERR_MISSING_ARGS('streams'); + } + + var error; + var destroys = streams.map(function (stream, i) { + var reading = i < streams.length - 1; + var writing = i > 0; + return destroyer(stream, reading, writing, function (err) { + if (!error) error = err; + if (err) destroys.forEach(call); + if (reading) return; + destroys.forEach(call); + callback(error); + }); + }); + return streams.reduce(pipe); +} + +module.exports = pipeline; +},{"../../../errors":145,"./end-of-stream":154}],157:[function(require,module,exports){ +'use strict'; + +var ERR_INVALID_OPT_VALUE = require('../../../errors').codes.ERR_INVALID_OPT_VALUE; + +function highWaterMarkFrom(options, isDuplex, duplexKey) { + return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null; +} + +function getHighWaterMark(state, options, duplexKey, isDuplex) { + var hwm = highWaterMarkFrom(options, isDuplex, duplexKey); + + if (hwm != null) { + if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) { + var name = isDuplex ? duplexKey : 'highWaterMark'; + throw new ERR_INVALID_OPT_VALUE(name, hwm); + } + + return Math.floor(hwm); + } // Default value + + + return state.objectMode ? 16 : 16 * 1024; +} + +module.exports = { + getHighWaterMark: getHighWaterMark +}; +},{"../../../errors":145}],158:[function(require,module,exports){ +arguments[4][109][0].apply(exports,arguments) +},{"dup":109,"events":79}],159:[function(require,module,exports){ +exports = module.exports = require('./lib/_stream_readable.js'); +exports.Stream = exports; +exports.Readable = exports; +exports.Writable = require('./lib/_stream_writable.js'); +exports.Duplex = require('./lib/_stream_duplex.js'); +exports.Transform = require('./lib/_stream_transform.js'); +exports.PassThrough = require('./lib/_stream_passthrough.js'); +exports.finished = require('./lib/internal/streams/end-of-stream.js'); +exports.pipeline = require('./lib/internal/streams/pipeline.js'); + +},{"./lib/_stream_duplex.js":146,"./lib/_stream_passthrough.js":147,"./lib/_stream_readable.js":148,"./lib/_stream_transform.js":149,"./lib/_stream_writable.js":150,"./lib/internal/streams/end-of-stream.js":154,"./lib/internal/streams/pipeline.js":156}],160:[function(require,module,exports){ +arguments[4][111][0].apply(exports,arguments) +},{"dup":111,"safe-buffer":161}],161:[function(require,module,exports){ +arguments[4][110][0].apply(exports,arguments) +},{"buffer":12,"dup":110}],162:[function(require,module,exports){ +(function (process,global){(function (){ 'use strict' var Transform = require('readable-stream').Transform @@ -14462,6 +16653,10 @@ function WebSocketStream(target, protocols, options) { // was already open when passed in if (socket.readyState === socket.OPEN) { stream = proxy + } else if (isBrowser) { + stream = proxy + stream.cork() + socket.onopen = onopenBrowser } else { stream = duplexify.obj() socket.onopen = onopen @@ -14521,6 +16716,11 @@ function WebSocketStream(target, protocols, options) { stream.emit('connect') } + function onopenBrowser () { + stream.uncork() + stream.emit('connect') + } + function onclose() { stream.end() stream.destroy() @@ -14558,8 +16758,8 @@ function WebSocketStream(target, protocols, options) { return stream } -}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"_process":92,"duplexify":17,"readable-stream":108,"safe-buffer":110,"ws":119}],119:[function(require,module,exports){ +}).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"_process":96,"duplexify":134,"readable-stream":159,"safe-buffer":114,"ws":163}],163:[function(require,module,exports){ var ws = null @@ -14573,7 +16773,7 @@ if (typeof WebSocket !== 'undefined') { module.exports = ws -},{}],120:[function(require,module,exports){ +},{}],164:[function(require,module,exports){ // Returns a wrapper function that returns a wrapped callback // The wrapper function should do some stuff, and return a // presumably different callback function. @@ -14608,7 +16808,7 @@ function wrappy (fn, cb) { } } -},{}],121:[function(require,module,exports){ +},{}],165:[function(require,module,exports){ module.exports = extend var hasOwnProperty = Object.prototype.hasOwnProperty; @@ -14629,5 +16829,5 @@ function extend() { return target } -},{}]},{},[9])(9) +},{}]},{},[8])(8) }); diff --git a/node_modules/mqtt/dist/mqtt.min.js b/node_modules/mqtt/dist/mqtt.min.js index 7fdd259..523e060 100644 --- a/node_modules/mqtt/dist/mqtt.min.js +++ b/node_modules/mqtt/dist/mqtt.min.js @@ -1 +1 @@ -(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.mqtt=f()}})(function(){var define,module,exports;return function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;ioptions.properties.topicAliasMaximum||!options.properties.topicAliasMaximum&&opts.properties.topicAlias)){delete packet.properties.topicAlias}}switch(opts.qos){case 1:case 2:this.outgoing[packet.messageId]={volatile:false,cb:callback||nop};if(this._storeProcessing){this._packetIdsDuringStoreProcessing[packet.messageId]=false;this._storePacket(packet,undefined,opts.cbStorePut)}else{this._sendPacket(packet,undefined,opts.cbStorePut)}break;default:if(this._storeProcessing){this._storePacket(packet,callback,opts.cbStorePut)}else{this._sendPacket(packet,callback,opts.cbStorePut)}break}return this};MqttClient.prototype.subscribe=function(){var packet;var args=new Array(arguments.length);for(var i=0;i0){var topic={qos:sub.qos};if(version===5){topic.nl=sub.nl||false;topic.rap=sub.rap||false;topic.rh=sub.rh||0;topic.properties=sub.properties}that._resubscribeTopics[sub.topic]=topic;topics.push(sub.topic)}});that.messageIdToTopic[packet.messageId]=topics}this.outgoing[packet.messageId]={volatile:true,cb:function(err,packet){if(!err){var granted=packet.granted;for(var i=0;i0){this.once("outgoingEmpty",setTimeout.bind(null,finish,10))}else{finish()}return this};MqttClient.prototype.removeOutgoingMessage=function(mid){var cb=this.outgoing[mid]?this.outgoing[mid].cb:null;delete this.outgoing[mid];this.outgoingStore.del({messageId:mid},function(){cb(new Error("Message removed"))});return this};MqttClient.prototype.reconnect=function(opts){var that=this;var f=function(){if(opts){that.options.incomingStore=opts.incomingStore;that.options.outgoingStore=opts.outgoingStore}else{that.options.incomingStore=null;that.options.outgoingStore=null}that.incomingStore=that.options.incomingStore||new Store;that.outgoingStore=that.options.outgoingStore||new Store;that.disconnecting=false;that.disconnected=false;that._deferredReconnect=null;that._reconnect()};if(this.disconnecting&&!this.disconnected){this._deferredReconnect=f}else{f()}return this};MqttClient.prototype._reconnect=function(){this.emit("reconnect");this._setupStream()};MqttClient.prototype._setupReconnect=function(){var that=this;if(!that.disconnecting&&!that.reconnectTimer&&that.options.reconnectPeriod>0){if(!this.reconnecting){this.emit("offline");this.reconnecting=true}that.reconnectTimer=setInterval(function(){that._reconnect()},that.options.reconnectPeriod)}};MqttClient.prototype._clearReconnect=function(){if(this.reconnectTimer){clearInterval(this.reconnectTimer);this.reconnectTimer=null}};MqttClient.prototype._cleanUp=function(forced,done){var opts=arguments[2];if(done){this.stream.on("close",done)}if(forced){if(this.options.reconnectPeriod===0&&this.options.clean){flush(this.outgoing)}this.stream.destroy()}else{var packet=xtend({cmd:"disconnect"},opts);this._sendPacket(packet,setImmediate.bind(null,this.stream.end.bind(this.stream)))}if(!this.disconnecting){this._clearReconnect();this._setupReconnect()}if(this.pingTimer!==null){this.pingTimer.clear();this.pingTimer=null}if(done&&!this.connected){this.stream.removeListener("close",done);done()}};MqttClient.prototype._sendPacket=function(packet,cb,cbStorePut){cbStorePut=cbStorePut||nop;if(!this.connected){this._storePacket(packet,cb,cbStorePut);return}this._shiftPingInterval();switch(packet.cmd){case"publish":break;case"pubrel":storeAndSend(this,packet,cb,cbStorePut);return;default:sendPacket(this,packet,cb);return}switch(packet.qos){case 2:case 1:storeAndSend(this,packet,cb,cbStorePut);break;case 0:default:sendPacket(this,packet,cb);break}};MqttClient.prototype._storePacket=function(packet,cb,cbStorePut){cbStorePut=cbStorePut||nop;if((packet.qos||0)===0&&this.queueQoSZero||packet.cmd!=="publish"){this.queue.push({packet:packet,cb:cb})}else if(packet.qos>0){cb=this.outgoing[packet.messageId]?this.outgoing[packet.messageId].cb:null;this.outgoingStore.put(packet,function(err){if(err){return cb&&cb(err)}cbStorePut()})}else if(cb){cb(new Error("No connection to broker"))}};MqttClient.prototype._setupPingTimer=function(){var that=this;if(!this.pingTimer&&this.options.keepalive){this.pingResp=true;this.pingTimer=reInterval(function(){that._checkPing()},this.options.keepalive*1e3)}};MqttClient.prototype._shiftPingInterval=function(){if(this.pingTimer&&this.options.keepalive&&this.options.reschedulePings){this.pingTimer.reschedule(this.options.keepalive*1e3)}};MqttClient.prototype._checkPing=function(){if(this.pingResp){this.pingResp=false;this._sendPacket({cmd:"pingreq"})}else{this._cleanUp(true)}};MqttClient.prototype._handlePingresp=function(){this.pingResp=true};MqttClient.prototype._handleConnack=function(packet){var options=this.options;var version=options.protocolVersion;var rc=version===5?packet.reasonCode:packet.returnCode;clearTimeout(this.connackTimer);if(packet.properties){if(packet.properties.topicAliasMaximum){if(!options.properties){options.properties={}}options.properties.topicAliasMaximum=packet.properties.topicAliasMaximum}if(packet.properties.serverKeepAlive&&options.keepalive){options.keepalive=packet.properties.serverKeepAlive;this._shiftPingInterval()}if(packet.properties.maximumPacketSize){if(!options.properties){options.properties={}}options.properties.maximumPacketSize=packet.properties.maximumPacketSize}}if(rc===0){this.reconnecting=false;this._onConnect(packet)}else if(rc>0){var err=new Error("Connection refused: "+errors[rc]);err.code=rc;this.emit("error",err)}};MqttClient.prototype._handlePublish=function(packet,done){done=typeof done!=="undefined"?done:nop;var topic=packet.topic.toString();var message=packet.payload;var qos=packet.qos;var mid=packet.messageId;var that=this;var options=this.options;var validReasonCodes=[0,16,128,131,135,144,145,151,153];switch(qos){case 2:{options.customHandleAcks(topic,message,packet,function(error,code){if(!(error instanceof Error)){code=error;error=null}if(error){return that.emit("error",error)}if(validReasonCodes.indexOf(code)===-1){return that.emit("error",new Error("Wrong reason code for pubrec"))}if(code){that._sendPacket({cmd:"pubrec",messageId:mid,reasonCode:code},done)}else{that.incomingStore.put(packet,function(){that._sendPacket({cmd:"pubrec",messageId:mid},done)})}});break}case 1:{options.customHandleAcks(topic,message,packet,function(error,code){if(!(error instanceof Error)){code=error;error=null}if(error){return that.emit("error",error)}if(validReasonCodes.indexOf(code)===-1){return that.emit("error",new Error("Wrong reason code for puback"))}if(!code){that.emit("message",topic,message,packet)}that.handleMessage(packet,function(err){if(err){return done&&done(err)}that._sendPacket({cmd:"puback",messageId:mid,reasonCode:code},done)})});break}case 0:this.emit("message",topic,message,packet);this.handleMessage(packet,done);break;default:break}};MqttClient.prototype.handleMessage=function(packet,callback){callback()};MqttClient.prototype._handleAck=function(packet){var mid=packet.messageId;var type=packet.cmd;var response=null;var cb=this.outgoing[mid]?this.outgoing[mid].cb:null;var that=this;var err;if(!cb){return}switch(type){case"pubcomp":case"puback":var pubackRC=packet.reasonCode;if(pubackRC&&pubackRC>0&&pubackRC!==16){err=new Error("Publish error: "+errors[pubackRC]);err.code=pubackRC;cb(err,packet)}delete this.outgoing[mid];this.outgoingStore.del(packet,cb);break;case"pubrec":response={cmd:"pubrel",qos:2,messageId:mid};var pubrecRC=packet.reasonCode;if(pubrecRC&&pubrecRC>0&&pubrecRC!==16){err=new Error("Publish error: "+errors[pubrecRC]);err.code=pubrecRC;cb(err,packet)}else{this._sendPacket(response)}break;case"suback":delete this.outgoing[mid];for(var grantedI=0;grantedI0){if(this.options.resubscribe){if(this.options.protocolVersion===5){for(var topicI=0;topicI<_resubscribeTopicsKeys.length;topicI++){var resubscribeTopic={};resubscribeTopic[_resubscribeTopicsKeys[topicI]]=this._resubscribeTopics[_resubscribeTopicsKeys[topicI]];resubscribeTopic.resubscribe=true;this.subscribe(resubscribeTopic,{properties:resubscribeTopic[_resubscribeTopicsKeys[topicI]].properties})}}else{this._resubscribeTopics.resubscribe=true;this.subscribe(this._resubscribeTopics)}}else{this._resubscribeTopics={}}}this._firstConnection=false};MqttClient.prototype._onConnect=function(packet){if(this.disconnected){this.emit("connect",packet);return}var that=this;this._setupPingTimer();this._resubscribe(packet);this.connected=true;function startStreamProcess(){var outStore=that.outgoingStore.createStream();function clearStoreProcessing(){that._storeProcessing=false;that._packetIdsDuringStoreProcessing={}}that.once("close",remove);outStore.on("error",function(err){clearStoreProcessing();that.removeListener("close",remove);that.emit("error",err)});function remove(){outStore.destroy();outStore=null;clearStoreProcessing()}function storeDeliver(){if(!outStore){return}that._storeProcessing=true;var packet=outStore.read(1);var cb;if(!packet){outStore.once("readable",storeDeliver);return}if(that._packetIdsDuringStoreProcessing[packet.messageId]){storeDeliver();return}if(!that.disconnecting&&!that.reconnectTimer){cb=that.outgoing[packet.messageId]?that.outgoing[packet.messageId].cb:null;that.outgoing[packet.messageId]={volatile:false,cb:function(err,status){if(cb){cb(err,status)}storeDeliver()}};that._packetIdsDuringStoreProcessing[packet.messageId]=true;that._sendPacket(packet)}else if(outStore.destroy){outStore.destroy()}}outStore.on("end",function(){var allProcessed=true;for(var id in that._packetIdsDuringStoreProcessing){if(!that._packetIdsDuringStoreProcessing[id]){allProcessed=false;break}}if(allProcessed){clearStoreProcessing();that.removeListener("close",remove);that.emit("connect",packet)}else{startStreamProcess()}});storeDeliver()}startStreamProcess()};module.exports=MqttClient}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./store":7,"./validations":8,_process:92,events:13,inherits:80,"mqtt-packet":84,"readable-stream":108,reinterval:109,xtend:121}],2:[function(require,module,exports){(function(Buffer){"use strict";var Transform=require("readable-stream").Transform;var duplexify=require("duplexify");var base64=require("base64-js");var my;var proxy;var stream;var isInitialized=false;function buildProxy(){var proxy=new Transform;proxy._write=function(chunk,encoding,next){my.sendSocketMessage({data:chunk.buffer,success:function(){next()},fail:function(){next(new Error)}})};proxy._flush=function socketEnd(done){my.closeSocket({success:function(){done()}})};return proxy}function setDefaultOpts(opts){if(!opts.hostname){opts.hostname="localhost"}if(!opts.path){opts.path="/"}if(!opts.wsOptions){opts.wsOptions={}}}function buildUrl(opts,client){var protocol=opts.protocol==="alis"?"wss":"ws";var url=protocol+"://"+opts.hostname+opts.path;if(opts.port&&opts.port!==80&&opts.port!==443){url=protocol+"://"+opts.hostname+":"+opts.port+opts.path}if(typeof opts.transformWsUrl==="function"){url=opts.transformWsUrl(url,opts,client)}return url}function bindEventHandler(){if(isInitialized)return;isInitialized=true;my.onSocketOpen(function(){stream.setReadable(proxy);stream.setWritable(proxy);stream.emit("connect")});my.onSocketMessage(function(res){if(typeof res.data==="string"){var array=base64.toByteArray(res.data);var buffer=Buffer.from(array);proxy.push(buffer)}else{var reader=new FileReader;reader.addEventListener("load",function(){var data=reader.result;if(data instanceof ArrayBuffer)data=Buffer.from(data);else data=Buffer.from(data,"utf8");proxy.push(data)});reader.readAsArrayBuffer(res.data)}});my.onSocketClose(function(){stream.end();stream.destroy()});my.onSocketError(function(res){stream.destroy(res)})}function buildStream(client,opts){opts.hostname=opts.hostname||opts.host;if(!opts.hostname){throw new Error("Could not determine host. Specify host manually.")}var websocketSubProtocol=opts.protocolId==="MQIsdp"&&opts.protocolVersion===3?"mqttv3.1":"mqtt";setDefaultOpts(opts);var url=buildUrl(opts,client);my=opts.my;my.connectSocket({url:url,protocols:websocketSubProtocol});proxy=buildProxy();stream=duplexify.obj();bindEventHandler();return stream}module.exports=buildStream}).call(this,require("buffer").Buffer)},{"base64-js":10,buffer:12,duplexify:17,"readable-stream":108}],3:[function(require,module,exports){"use strict";var net=require("net");function buildBuilder(client,opts){var port,host;opts.port=opts.port||1883;opts.hostname=opts.hostname||opts.host||"localhost";port=opts.port;host=opts.hostname;return net.createConnection(port,host)}module.exports=buildBuilder},{net:11}],4:[function(require,module,exports){"use strict";var tls=require("tls");function buildBuilder(mqttClient,opts){var connection;opts.port=opts.port||8883;opts.host=opts.hostname||opts.host||"localhost";opts.rejectUnauthorized=opts.rejectUnauthorized!==false;delete opts.path;connection=tls.connect(opts);connection.on("secureConnect",function(){if(opts.rejectUnauthorized&&!connection.authorized){connection.emit("error",new Error("TLS not authorized"))}else{connection.removeListener("error",handleTLSerrors)}});function handleTLSerrors(err){if(opts.rejectUnauthorized){mqttClient.emit("error",err)}connection.end()}connection.on("error",handleTLSerrors);return connection}module.exports=buildBuilder},{tls:11}],5:[function(require,module,exports){(function(process){"use strict";var websocket=require("websocket-stream");var urlModule=require("url");var WSS_OPTIONS=["rejectUnauthorized","ca","cert","key","pfx","passphrase"];var IS_BROWSER=process.title==="browser";function buildUrl(opts,client){var url=opts.protocol+"://"+opts.hostname+":"+opts.port+opts.path;if(typeof opts.transformWsUrl==="function"){url=opts.transformWsUrl(url,opts,client)}return url}function setDefaultOpts(opts){if(!opts.hostname){opts.hostname="localhost"}if(!opts.port){if(opts.protocol==="wss"){opts.port=443}else{opts.port=80}}if(!opts.path){opts.path="/"}if(!opts.wsOptions){opts.wsOptions={}}if(!IS_BROWSER&&opts.protocol==="wss"){WSS_OPTIONS.forEach(function(prop){if(opts.hasOwnProperty(prop)&&!opts.wsOptions.hasOwnProperty(prop)){opts.wsOptions[prop]=opts[prop]}})}}function createWebSocket(client,opts){var websocketSubProtocol=opts.protocolId==="MQIsdp"&&opts.protocolVersion===3?"mqttv3.1":"mqtt";setDefaultOpts(opts);var url=buildUrl(opts,client);return websocket(url,[websocketSubProtocol],opts.wsOptions)}function buildBuilder(client,opts){return createWebSocket(client,opts)}function buildBuilderBrowser(client,opts){if(!opts.hostname){opts.hostname=opts.host}if(!opts.hostname){if(typeof document==="undefined"){throw new Error("Could not determine host. Specify host manually.")}var parsed=urlModule.parse(document.URL);opts.hostname=parsed.hostname;if(!opts.port){opts.port=parsed.port}}return createWebSocket(client,opts)}if(IS_BROWSER){module.exports=buildBuilderBrowser}else{module.exports=buildBuilder}}).call(this,require("_process"))},{_process:92,url:113,"websocket-stream":118}],6:[function(require,module,exports){(function(process,Buffer){"use strict";var Transform=require("readable-stream").Transform;var duplexify=require("duplexify");var socketTask;var proxy;var stream;function buildProxy(){var proxy=new Transform;proxy._write=function(chunk,encoding,next){socketTask.send({data:chunk.buffer,success:function(){next()},fail:function(errMsg){next(new Error(errMsg))}})};proxy._flush=function socketEnd(done){socketTask.close({success:function(){done()}})};return proxy}function setDefaultOpts(opts){if(!opts.hostname){opts.hostname="localhost"}if(!opts.path){opts.path="/"}if(!opts.wsOptions){opts.wsOptions={}}}function buildUrl(opts,client){var protocol=opts.protocol==="wxs"?"wss":"ws";var url=protocol+"://"+opts.hostname+opts.path;if(opts.port&&opts.port!==80&&opts.port!==443){url=protocol+"://"+opts.hostname+":"+opts.port+opts.path}if(typeof opts.transformWsUrl==="function"){url=opts.transformWsUrl(url,opts,client)}return url}function bindEventHandler(){socketTask.onOpen(function(){stream.setReadable(proxy);stream.setWritable(proxy);stream.emit("connect")});socketTask.onMessage(function(res){var data=res.data;if(data instanceof ArrayBuffer)data=Buffer.from(data);else data=Buffer.from(data,"utf8");proxy.push(data)});socketTask.onClose(function(){stream.end();stream.destroy()});socketTask.onError(function(res){stream.destroy(new Error(res.errMsg))})}function buildStream(client,opts){opts.hostname=opts.hostname||opts.host;if(!opts.hostname){throw new Error("Could not determine host. Specify host manually.")}var websocketSubProtocol=opts.protocolId==="MQIsdp"&&opts.protocolVersion===3?"mqttv3.1":"mqtt";setDefaultOpts(opts);var url=buildUrl(opts,client);socketTask=wx.connectSocket({url:url,protocols:websocketSubProtocol});proxy=buildProxy();stream=duplexify.obj();stream._destroy=function(err,cb){socketTask.close({success:function(){cb&&cb(err)}})};var destroyRef=stream.destroy;stream.destroy=function(){stream.destroy=destroyRef;var self=this;process.nextTick(function(){socketTask.close({fail:function(){self._destroy(new Error)}})})}.bind(stream);bindEventHandler();return stream}module.exports=buildStream}).call(this,require("_process"),require("buffer").Buffer)},{_process:92,buffer:12,duplexify:17,"readable-stream":108}],7:[function(require,module,exports){(function(process){"use strict";var xtend=require("xtend");var Readable=require("readable-stream").Readable;var streamsOpts={objectMode:true};var defaultStoreOptions={clean:true};var Map=require("es6-map");function Store(options){if(!(this instanceof Store)){return new Store(options)}this.options=options||{};this.options=xtend(defaultStoreOptions,options);this._inflights=new Map}Store.prototype.put=function(packet,cb){this._inflights.set(packet.messageId,packet);if(cb){cb()}return this};Store.prototype.createStream=function(){var stream=new Readable(streamsOpts);var destroyed=false;var values=[];var i=0;this._inflights.forEach(function(value,key){values.push(value)});stream._read=function(){if(!destroyed&&i0){throw new Error("Invalid string. Length must be a multiple of 4")}var validLen=b64.indexOf("=");if(validLen===-1)validLen=len;var placeHoldersLen=validLen===len?0:4-validLen%4;return[validLen,placeHoldersLen]}function byteLength(b64){var lens=getLens(b64);var validLen=lens[0];var placeHoldersLen=lens[1];return(validLen+placeHoldersLen)*3/4-placeHoldersLen}function _byteLength(b64,validLen,placeHoldersLen){return(validLen+placeHoldersLen)*3/4-placeHoldersLen}function toByteArray(b64){var tmp;var lens=getLens(b64);var validLen=lens[0];var placeHoldersLen=lens[1];var arr=new Arr(_byteLength(b64,validLen,placeHoldersLen));var curByte=0;var len=placeHoldersLen>0?validLen-4:validLen;for(var i=0;i>16&255;arr[curByte++]=tmp>>8&255;arr[curByte++]=tmp&255}if(placeHoldersLen===2){tmp=revLookup[b64.charCodeAt(i)]<<2|revLookup[b64.charCodeAt(i+1)]>>4;arr[curByte++]=tmp&255}if(placeHoldersLen===1){tmp=revLookup[b64.charCodeAt(i)]<<10|revLookup[b64.charCodeAt(i+1)]<<4|revLookup[b64.charCodeAt(i+2)]>>2;arr[curByte++]=tmp>>8&255;arr[curByte++]=tmp&255}return arr}function tripletToBase64(num){return lookup[num>>18&63]+lookup[num>>12&63]+lookup[num>>6&63]+lookup[num&63]}function encodeChunk(uint8,start,end){var tmp;var output=[];for(var i=start;ilen2?len2:i+maxChunkLength))}if(extraBytes===1){tmp=uint8[len-1];parts.push(lookup[tmp>>2]+lookup[tmp<<4&63]+"==")}else if(extraBytes===2){tmp=(uint8[len-2]<<8)+uint8[len-1];parts.push(lookup[tmp>>10]+lookup[tmp>>4&63]+lookup[tmp<<2&63]+"=")}return parts.join("")}},{}],11:[function(require,module,exports){},{}],12:[function(require,module,exports){"use strict";var base64=require("base64-js");var ieee754=require("ieee754");exports.Buffer=Buffer;exports.SlowBuffer=SlowBuffer;exports.INSPECT_MAX_BYTES=50;var K_MAX_LENGTH=2147483647;exports.kMaxLength=K_MAX_LENGTH;Buffer.TYPED_ARRAY_SUPPORT=typedArraySupport();if(!Buffer.TYPED_ARRAY_SUPPORT&&typeof console!=="undefined"&&typeof console.error==="function"){console.error("This browser lacks typed array (Uint8Array) support which is required by "+"`buffer` v5.x. Use `buffer` v4.x if you require old browser support.")}function typedArraySupport(){try{var arr=new Uint8Array(1);arr.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}};return arr.foo()===42}catch(e){return false}}Object.defineProperty(Buffer.prototype,"parent",{enumerable:true,get:function(){if(!Buffer.isBuffer(this))return undefined;return this.buffer}});Object.defineProperty(Buffer.prototype,"offset",{enumerable:true,get:function(){if(!Buffer.isBuffer(this))return undefined;return this.byteOffset}});function createBuffer(length){if(length>K_MAX_LENGTH){throw new RangeError('The value "'+length+'" is invalid for option "size"')}var buf=new Uint8Array(length);buf.__proto__=Buffer.prototype;return buf}function Buffer(arg,encodingOrOffset,length){if(typeof arg==="number"){if(typeof encodingOrOffset==="string"){throw new TypeError('The "string" argument must be of type string. Received type number')}return allocUnsafe(arg)}return from(arg,encodingOrOffset,length)}if(typeof Symbol!=="undefined"&&Symbol.species!=null&&Buffer[Symbol.species]===Buffer){Object.defineProperty(Buffer,Symbol.species,{value:null,configurable:true,enumerable:false,writable:false})}Buffer.poolSize=8192;function from(value,encodingOrOffset,length){if(typeof value==="string"){return fromString(value,encodingOrOffset)}if(ArrayBuffer.isView(value)){return fromArrayLike(value)}if(value==null){throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, "+"or Array-like Object. Received type "+typeof value)}if(isInstance(value,ArrayBuffer)||value&&isInstance(value.buffer,ArrayBuffer)){return fromArrayBuffer(value,encodingOrOffset,length)}if(typeof value==="number"){throw new TypeError('The "value" argument must not be of type number. Received type number')}var valueOf=value.valueOf&&value.valueOf();if(valueOf!=null&&valueOf!==value){return Buffer.from(valueOf,encodingOrOffset,length)}var b=fromObject(value);if(b)return b;if(typeof Symbol!=="undefined"&&Symbol.toPrimitive!=null&&typeof value[Symbol.toPrimitive]==="function"){return Buffer.from(value[Symbol.toPrimitive]("string"),encodingOrOffset,length)}throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, "+"or Array-like Object. Received type "+typeof value)}Buffer.from=function(value,encodingOrOffset,length){return from(value,encodingOrOffset,length)};Buffer.prototype.__proto__=Uint8Array.prototype;Buffer.__proto__=Uint8Array;function assertSize(size){if(typeof size!=="number"){throw new TypeError('"size" argument must be of type number')}else if(size<0){throw new RangeError('The value "'+size+'" is invalid for option "size"')}}function alloc(size,fill,encoding){assertSize(size);if(size<=0){return createBuffer(size)}if(fill!==undefined){return typeof encoding==="string"?createBuffer(size).fill(fill,encoding):createBuffer(size).fill(fill)}return createBuffer(size)}Buffer.alloc=function(size,fill,encoding){return alloc(size,fill,encoding)};function allocUnsafe(size){assertSize(size);return createBuffer(size<0?0:checked(size)|0)}Buffer.allocUnsafe=function(size){return allocUnsafe(size)};Buffer.allocUnsafeSlow=function(size){return allocUnsafe(size)};function fromString(string,encoding){if(typeof encoding!=="string"||encoding===""){encoding="utf8"}if(!Buffer.isEncoding(encoding)){throw new TypeError("Unknown encoding: "+encoding)}var length=byteLength(string,encoding)|0;var buf=createBuffer(length);var actual=buf.write(string,encoding);if(actual!==length){buf=buf.slice(0,actual)}return buf}function fromArrayLike(array){var length=array.length<0?0:checked(array.length)|0;var buf=createBuffer(length);for(var i=0;i=K_MAX_LENGTH){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+K_MAX_LENGTH.toString(16)+" bytes")}return length|0}function SlowBuffer(length){if(+length!=length){length=0}return Buffer.alloc(+length)}Buffer.isBuffer=function isBuffer(b){return b!=null&&b._isBuffer===true&&b!==Buffer.prototype};Buffer.compare=function compare(a,b){if(isInstance(a,Uint8Array))a=Buffer.from(a,a.offset,a.byteLength);if(isInstance(b,Uint8Array))b=Buffer.from(b,b.offset,b.byteLength);if(!Buffer.isBuffer(a)||!Buffer.isBuffer(b)){throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array')}if(a===b)return 0;var x=a.length;var y=b.length;for(var i=0,len=Math.min(x,y);i2&&arguments[2]===true;if(!mustMatch&&len===0)return 0;var loweredCase=false;for(;;){switch(encoding){case"ascii":case"latin1":case"binary":return len;case"utf8":case"utf-8":return utf8ToBytes(string).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return len*2;case"hex":return len>>>1;case"base64":return base64ToBytes(string).length;default:if(loweredCase){return mustMatch?-1:utf8ToBytes(string).length}encoding=(""+encoding).toLowerCase();loweredCase=true}}}Buffer.byteLength=byteLength;function slowToString(encoding,start,end){var loweredCase=false;if(start===undefined||start<0){start=0}if(start>this.length){return""}if(end===undefined||end>this.length){end=this.length}if(end<=0){return""}end>>>=0;start>>>=0;if(end<=start){return""}if(!encoding)encoding="utf8";while(true){switch(encoding){case"hex":return hexSlice(this,start,end);case"utf8":case"utf-8":return utf8Slice(this,start,end);case"ascii":return asciiSlice(this,start,end);case"latin1":case"binary":return latin1Slice(this,start,end);case"base64":return base64Slice(this,start,end);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,start,end);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(encoding+"").toLowerCase();loweredCase=true}}}Buffer.prototype._isBuffer=true;function swap(b,n,m){var i=b[n];b[n]=b[m];b[m]=i}Buffer.prototype.swap16=function swap16(){var len=this.length;if(len%2!==0){throw new RangeError("Buffer size must be a multiple of 16-bits")}for(var i=0;imax)str+=" ... ";return""};Buffer.prototype.compare=function compare(target,start,end,thisStart,thisEnd){if(isInstance(target,Uint8Array)){target=Buffer.from(target,target.offset,target.byteLength)}if(!Buffer.isBuffer(target)){throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. '+"Received type "+typeof target)}if(start===undefined){start=0}if(end===undefined){end=target?target.length:0}if(thisStart===undefined){thisStart=0}if(thisEnd===undefined){thisEnd=this.length}if(start<0||end>target.length||thisStart<0||thisEnd>this.length){throw new RangeError("out of range index")}if(thisStart>=thisEnd&&start>=end){return 0}if(thisStart>=thisEnd){return-1}if(start>=end){return 1}start>>>=0;end>>>=0;thisStart>>>=0;thisEnd>>>=0;if(this===target)return 0;var x=thisEnd-thisStart;var y=end-start;var len=Math.min(x,y);var thisCopy=this.slice(thisStart,thisEnd);var targetCopy=target.slice(start,end);for(var i=0;i2147483647){byteOffset=2147483647}else if(byteOffset<-2147483648){byteOffset=-2147483648}byteOffset=+byteOffset;if(numberIsNaN(byteOffset)){byteOffset=dir?0:buffer.length-1}if(byteOffset<0)byteOffset=buffer.length+byteOffset;if(byteOffset>=buffer.length){if(dir)return-1;else byteOffset=buffer.length-1}else if(byteOffset<0){if(dir)byteOffset=0;else return-1}if(typeof val==="string"){val=Buffer.from(val,encoding)}if(Buffer.isBuffer(val)){if(val.length===0){return-1}return arrayIndexOf(buffer,val,byteOffset,encoding,dir)}else if(typeof val==="number"){val=val&255;if(typeof Uint8Array.prototype.indexOf==="function"){if(dir){return Uint8Array.prototype.indexOf.call(buffer,val,byteOffset)}else{return Uint8Array.prototype.lastIndexOf.call(buffer,val,byteOffset)}}return arrayIndexOf(buffer,[val],byteOffset,encoding,dir)}throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(arr,val,byteOffset,encoding,dir){var indexSize=1;var arrLength=arr.length;var valLength=val.length;if(encoding!==undefined){encoding=String(encoding).toLowerCase();if(encoding==="ucs2"||encoding==="ucs-2"||encoding==="utf16le"||encoding==="utf-16le"){if(arr.length<2||val.length<2){return-1}indexSize=2;arrLength/=2;valLength/=2;byteOffset/=2}}function read(buf,i){if(indexSize===1){return buf[i]}else{return buf.readUInt16BE(i*indexSize)}}var i;if(dir){var foundIndex=-1;for(i=byteOffset;iarrLength)byteOffset=arrLength-valLength;for(i=byteOffset;i>=0;i--){var found=true;for(var j=0;jremaining){length=remaining}}var strLen=string.length;if(length>strLen/2){length=strLen/2}for(var i=0;i>>0;if(isFinite(length)){length=length>>>0;if(encoding===undefined)encoding="utf8"}else{encoding=length;length=undefined}}else{throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported")}var remaining=this.length-offset;if(length===undefined||length>remaining)length=remaining;if(string.length>0&&(length<0||offset<0)||offset>this.length){throw new RangeError("Attempt to write outside buffer bounds")}if(!encoding)encoding="utf8";var loweredCase=false;for(;;){switch(encoding){case"hex":return hexWrite(this,string,offset,length);case"utf8":case"utf-8":return utf8Write(this,string,offset,length);case"ascii":return asciiWrite(this,string,offset,length);case"latin1":case"binary":return latin1Write(this,string,offset,length);case"base64":return base64Write(this,string,offset,length);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,string,offset,length);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(""+encoding).toLowerCase();loweredCase=true}}};Buffer.prototype.toJSON=function toJSON(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function base64Slice(buf,start,end){if(start===0&&end===buf.length){return base64.fromByteArray(buf)}else{return base64.fromByteArray(buf.slice(start,end))}}function utf8Slice(buf,start,end){end=Math.min(buf.length,end);var res=[];var i=start;while(i239?4:firstByte>223?3:firstByte>191?2:1;if(i+bytesPerSequence<=end){var secondByte,thirdByte,fourthByte,tempCodePoint;switch(bytesPerSequence){case 1:if(firstByte<128){codePoint=firstByte}break;case 2:secondByte=buf[i+1];if((secondByte&192)===128){tempCodePoint=(firstByte&31)<<6|secondByte&63;if(tempCodePoint>127){codePoint=tempCodePoint}}break;case 3:secondByte=buf[i+1];thirdByte=buf[i+2];if((secondByte&192)===128&&(thirdByte&192)===128){tempCodePoint=(firstByte&15)<<12|(secondByte&63)<<6|thirdByte&63;if(tempCodePoint>2047&&(tempCodePoint<55296||tempCodePoint>57343)){codePoint=tempCodePoint}}break;case 4:secondByte=buf[i+1];thirdByte=buf[i+2];fourthByte=buf[i+3];if((secondByte&192)===128&&(thirdByte&192)===128&&(fourthByte&192)===128){tempCodePoint=(firstByte&15)<<18|(secondByte&63)<<12|(thirdByte&63)<<6|fourthByte&63;if(tempCodePoint>65535&&tempCodePoint<1114112){codePoint=tempCodePoint}}}}if(codePoint===null){codePoint=65533;bytesPerSequence=1}else if(codePoint>65535){codePoint-=65536;res.push(codePoint>>>10&1023|55296);codePoint=56320|codePoint&1023}res.push(codePoint);i+=bytesPerSequence}return decodeCodePointsArray(res)}var MAX_ARGUMENTS_LENGTH=4096;function decodeCodePointsArray(codePoints){var len=codePoints.length;if(len<=MAX_ARGUMENTS_LENGTH){return String.fromCharCode.apply(String,codePoints)}var res="";var i=0;while(ilen)end=len;var out="";for(var i=start;ilen){start=len}if(end<0){end+=len;if(end<0)end=0}else if(end>len){end=len}if(endlength)throw new RangeError("Trying to access beyond buffer length")}Buffer.prototype.readUIntLE=function readUIntLE(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);var val=this[offset];var mul=1;var i=0;while(++i>>0;byteLength=byteLength>>>0;if(!noAssert){checkOffset(offset,byteLength,this.length)}var val=this[offset+--byteLength];var mul=1;while(byteLength>0&&(mul*=256)){val+=this[offset+--byteLength]*mul}return val};Buffer.prototype.readUInt8=function readUInt8(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,1,this.length);return this[offset]};Buffer.prototype.readUInt16LE=function readUInt16LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);return this[offset]|this[offset+1]<<8};Buffer.prototype.readUInt16BE=function readUInt16BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);return this[offset]<<8|this[offset+1]};Buffer.prototype.readUInt32LE=function readUInt32LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return(this[offset]|this[offset+1]<<8|this[offset+2]<<16)+this[offset+3]*16777216};Buffer.prototype.readUInt32BE=function readUInt32BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return this[offset]*16777216+(this[offset+1]<<16|this[offset+2]<<8|this[offset+3])};Buffer.prototype.readIntLE=function readIntLE(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);var val=this[offset];var mul=1;var i=0;while(++i=mul)val-=Math.pow(2,8*byteLength);return val};Buffer.prototype.readIntBE=function readIntBE(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);var i=byteLength;var mul=1;var val=this[offset+--i];while(i>0&&(mul*=256)){val+=this[offset+--i]*mul}mul*=128;if(val>=mul)val-=Math.pow(2,8*byteLength);return val};Buffer.prototype.readInt8=function readInt8(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,1,this.length);if(!(this[offset]&128))return this[offset];return(255-this[offset]+1)*-1};Buffer.prototype.readInt16LE=function readInt16LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);var val=this[offset]|this[offset+1]<<8;return val&32768?val|4294901760:val};Buffer.prototype.readInt16BE=function readInt16BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);var val=this[offset+1]|this[offset]<<8;return val&32768?val|4294901760:val};Buffer.prototype.readInt32LE=function readInt32LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return this[offset]|this[offset+1]<<8|this[offset+2]<<16|this[offset+3]<<24};Buffer.prototype.readInt32BE=function readInt32BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return this[offset]<<24|this[offset+1]<<16|this[offset+2]<<8|this[offset+3]};Buffer.prototype.readFloatLE=function readFloatLE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,true,23,4)};Buffer.prototype.readFloatBE=function readFloatBE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,false,23,4)};Buffer.prototype.readDoubleLE=function readDoubleLE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,true,52,8)};Buffer.prototype.readDoubleBE=function readDoubleBE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,false,52,8)};function checkInt(buf,value,offset,ext,max,min){if(!Buffer.isBuffer(buf))throw new TypeError('"buffer" argument must be a Buffer instance');if(value>max||valuebuf.length)throw new RangeError("Index out of range")}Buffer.prototype.writeUIntLE=function writeUIntLE(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert){var maxBytes=Math.pow(2,8*byteLength)-1;checkInt(this,value,offset,byteLength,maxBytes,0)}var mul=1;var i=0;this[offset]=value&255;while(++i>>0;byteLength=byteLength>>>0;if(!noAssert){var maxBytes=Math.pow(2,8*byteLength)-1;checkInt(this,value,offset,byteLength,maxBytes,0)}var i=byteLength-1;var mul=1;this[offset+i]=value&255;while(--i>=0&&(mul*=256)){this[offset+i]=value/mul&255}return offset+byteLength};Buffer.prototype.writeUInt8=function writeUInt8(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,1,255,0);this[offset]=value&255;return offset+1};Buffer.prototype.writeUInt16LE=function writeUInt16LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,65535,0);this[offset]=value&255;this[offset+1]=value>>>8;return offset+2};Buffer.prototype.writeUInt16BE=function writeUInt16BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,65535,0);this[offset]=value>>>8;this[offset+1]=value&255;return offset+2};Buffer.prototype.writeUInt32LE=function writeUInt32LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,4294967295,0);this[offset+3]=value>>>24;this[offset+2]=value>>>16;this[offset+1]=value>>>8;this[offset]=value&255;return offset+4};Buffer.prototype.writeUInt32BE=function writeUInt32BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,4294967295,0);this[offset]=value>>>24;this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value&255;return offset+4};Buffer.prototype.writeIntLE=function writeIntLE(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;if(!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=0;var mul=1;var sub=0;this[offset]=value&255;while(++i>0)-sub&255}return offset+byteLength};Buffer.prototype.writeIntBE=function writeIntBE(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;if(!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=byteLength-1;var mul=1;var sub=0;this[offset+i]=value&255;while(--i>=0&&(mul*=256)){if(value<0&&sub===0&&this[offset+i+1]!==0){sub=1}this[offset+i]=(value/mul>>0)-sub&255}return offset+byteLength};Buffer.prototype.writeInt8=function writeInt8(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,1,127,-128);if(value<0)value=255+value+1;this[offset]=value&255;return offset+1};Buffer.prototype.writeInt16LE=function writeInt16LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,32767,-32768);this[offset]=value&255;this[offset+1]=value>>>8;return offset+2};Buffer.prototype.writeInt16BE=function writeInt16BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,32767,-32768);this[offset]=value>>>8;this[offset+1]=value&255;return offset+2};Buffer.prototype.writeInt32LE=function writeInt32LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,2147483647,-2147483648);this[offset]=value&255;this[offset+1]=value>>>8;this[offset+2]=value>>>16;this[offset+3]=value>>>24;return offset+4};Buffer.prototype.writeInt32BE=function writeInt32BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,2147483647,-2147483648);if(value<0)value=4294967295+value+1;this[offset]=value>>>24;this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value&255;return offset+4};function checkIEEE754(buf,value,offset,ext,max,min){if(offset+ext>buf.length)throw new RangeError("Index out of range");if(offset<0)throw new RangeError("Index out of range")}function writeFloat(buf,value,offset,littleEndian,noAssert){value=+value;offset=offset>>>0;if(!noAssert){checkIEEE754(buf,value,offset,4,34028234663852886e22,-34028234663852886e22)}ieee754.write(buf,value,offset,littleEndian,23,4);return offset+4}Buffer.prototype.writeFloatLE=function writeFloatLE(value,offset,noAssert){return writeFloat(this,value,offset,true,noAssert)};Buffer.prototype.writeFloatBE=function writeFloatBE(value,offset,noAssert){return writeFloat(this,value,offset,false,noAssert)};function writeDouble(buf,value,offset,littleEndian,noAssert){value=+value;offset=offset>>>0;if(!noAssert){checkIEEE754(buf,value,offset,8,17976931348623157e292,-17976931348623157e292)}ieee754.write(buf,value,offset,littleEndian,52,8);return offset+8}Buffer.prototype.writeDoubleLE=function writeDoubleLE(value,offset,noAssert){return writeDouble(this,value,offset,true,noAssert)};Buffer.prototype.writeDoubleBE=function writeDoubleBE(value,offset,noAssert){return writeDouble(this,value,offset,false,noAssert)};Buffer.prototype.copy=function copy(target,targetStart,start,end){if(!Buffer.isBuffer(target))throw new TypeError("argument should be a Buffer");if(!start)start=0;if(!end&&end!==0)end=this.length;if(targetStart>=target.length)targetStart=target.length;if(!targetStart)targetStart=0;if(end>0&&end=this.length)throw new RangeError("Index out of range");if(end<0)throw new RangeError("sourceEnd out of bounds");if(end>this.length)end=this.length;if(target.length-targetStart=0;--i){target[i+targetStart]=this[i+start]}}else{Uint8Array.prototype.set.call(target,this.subarray(start,end),targetStart)}return len};Buffer.prototype.fill=function fill(val,start,end,encoding){if(typeof val==="string"){if(typeof start==="string"){encoding=start;start=0;end=this.length}else if(typeof end==="string"){encoding=end;end=this.length}if(encoding!==undefined&&typeof encoding!=="string"){throw new TypeError("encoding must be a string")}if(typeof encoding==="string"&&!Buffer.isEncoding(encoding)){throw new TypeError("Unknown encoding: "+encoding)}if(val.length===1){var code=val.charCodeAt(0);if(encoding==="utf8"&&code<128||encoding==="latin1"){val=code}}}else if(typeof val==="number"){val=val&255}if(start<0||this.length>>0;end=end===undefined?this.length:end>>>0;if(!val)val=0;var i;if(typeof val==="number"){for(i=start;i55295&&codePoint<57344){if(!leadSurrogate){if(codePoint>56319){if((units-=3)>-1)bytes.push(239,191,189);continue}else if(i+1===length){if((units-=3)>-1)bytes.push(239,191,189);continue}leadSurrogate=codePoint;continue}if(codePoint<56320){if((units-=3)>-1)bytes.push(239,191,189);leadSurrogate=codePoint;continue}codePoint=(leadSurrogate-55296<<10|codePoint-56320)+65536}else if(leadSurrogate){if((units-=3)>-1)bytes.push(239,191,189)}leadSurrogate=null;if(codePoint<128){if((units-=1)<0)break;bytes.push(codePoint)}else if(codePoint<2048){if((units-=2)<0)break;bytes.push(codePoint>>6|192,codePoint&63|128)}else if(codePoint<65536){if((units-=3)<0)break;bytes.push(codePoint>>12|224,codePoint>>6&63|128,codePoint&63|128)}else if(codePoint<1114112){if((units-=4)<0)break;bytes.push(codePoint>>18|240,codePoint>>12&63|128,codePoint>>6&63|128,codePoint&63|128)}else{throw new Error("Invalid code point")}}return bytes}function asciiToBytes(str){var byteArray=[];for(var i=0;i>8;lo=c%256;byteArray.push(lo);byteArray.push(hi)}return byteArray}function base64ToBytes(str){return base64.toByteArray(base64clean(str))}function blitBuffer(src,dst,offset,length){for(var i=0;i=dst.length||i>=src.length)break;dst[i+offset]=src[i]}return i}function isInstance(obj,type){return obj instanceof type||obj!=null&&obj.constructor!=null&&obj.constructor.name!=null&&obj.constructor.name===type.name}function numberIsNaN(obj){return obj!==obj}},{"base64-js":10,ieee754:79}],13:[function(require,module,exports){var objectCreate=Object.create||objectCreatePolyfill;var objectKeys=Object.keys||objectKeysPolyfill;var bind=Function.prototype.bind||functionBindPolyfill;function EventEmitter(){if(!this._events||!Object.prototype.hasOwnProperty.call(this,"_events")){this._events=objectCreate(null);this._eventsCount=0}this._maxListeners=this._maxListeners||undefined}module.exports=EventEmitter;EventEmitter.EventEmitter=EventEmitter;EventEmitter.prototype._events=undefined;EventEmitter.prototype._maxListeners=undefined;var defaultMaxListeners=10;var hasDefineProperty;try{var o={};if(Object.defineProperty)Object.defineProperty(o,"x",{value:0});hasDefineProperty=o.x===0}catch(err){hasDefineProperty=false}if(hasDefineProperty){Object.defineProperty(EventEmitter,"defaultMaxListeners",{enumerable:true,get:function(){return defaultMaxListeners},set:function(arg){if(typeof arg!=="number"||arg<0||arg!==arg)throw new TypeError('"defaultMaxListeners" must be a positive number');defaultMaxListeners=arg}})}else{EventEmitter.defaultMaxListeners=defaultMaxListeners}EventEmitter.prototype.setMaxListeners=function setMaxListeners(n){if(typeof n!=="number"||n<0||isNaN(n))throw new TypeError('"n" argument must be a positive number');this._maxListeners=n;return this};function $getMaxListeners(that){if(that._maxListeners===undefined)return EventEmitter.defaultMaxListeners;return that._maxListeners}EventEmitter.prototype.getMaxListeners=function getMaxListeners(){return $getMaxListeners(this)};function emitNone(handler,isFn,self){if(isFn)handler.call(self);else{var len=handler.length;var listeners=arrayClone(handler,len);for(var i=0;i1)er=arguments[1];if(er instanceof Error){throw er}else{var err=new Error('Unhandled "error" event. ('+er+")");err.context=er;throw err}return false}handler=events[type];if(!handler)return false;var isFn=typeof handler==="function";len=arguments.length;switch(len){case 1:emitNone(handler,isFn,this);break;case 2:emitOne(handler,isFn,this,arguments[1]);break;case 3:emitTwo(handler,isFn,this,arguments[1],arguments[2]);break;case 4:emitThree(handler,isFn,this,arguments[1],arguments[2],arguments[3]);break;default:args=new Array(len-1);for(i=1;i0&&existing.length>m){existing.warned=true;var w=new Error("Possible EventEmitter memory leak detected. "+existing.length+' "'+String(type)+'" listeners '+"added. Use emitter.setMaxListeners() to "+"increase limit.");w.name="MaxListenersExceededWarning";w.emitter=target;w.type=type;w.count=existing.length;if(typeof console==="object"&&console.warn){console.warn("%s: %s",w.name,w.message)}}}}return target}EventEmitter.prototype.addListener=function addListener(type,listener){return _addListener(this,type,listener,false)};EventEmitter.prototype.on=EventEmitter.prototype.addListener;EventEmitter.prototype.prependListener=function prependListener(type,listener){return _addListener(this,type,listener,true)};function onceWrapper(){if(!this.fired){this.target.removeListener(this.type,this.wrapFn);this.fired=true;switch(arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:var args=new Array(arguments.length);for(var i=0;i=0;i--){if(list[i]===listener||list[i].listener===listener){originalListener=list[i].listener;position=i;break}}if(position<0)return this;if(position===0)list.shift();else spliceOne(list,position);if(list.length===1)events[type]=list[0];if(events.removeListener)this.emit("removeListener",type,originalListener||listener)}return this};EventEmitter.prototype.removeAllListeners=function removeAllListeners(type){var listeners,events,i;events=this._events;if(!events)return this;if(!events.removeListener){if(arguments.length===0){this._events=objectCreate(null);this._eventsCount=0}else if(events[type]){if(--this._eventsCount===0)this._events=objectCreate(null);else delete events[type]}return this}if(arguments.length===0){var keys=objectKeys(events);var key;for(i=0;i=0;i--){this.removeListener(type,listeners[i])}}return this};function _listeners(target,type,unwrap){var events=target._events;if(!events)return[];var evlistener=events[type];if(!evlistener)return[];if(typeof evlistener==="function")return unwrap?[evlistener.listener||evlistener]:[evlistener];return unwrap?unwrapListeners(evlistener):arrayClone(evlistener,evlistener.length)}EventEmitter.prototype.listeners=function listeners(type){return _listeners(this,type,true)};EventEmitter.prototype.rawListeners=function rawListeners(type){return _listeners(this,type,false)};EventEmitter.listenerCount=function(emitter,type){if(typeof emitter.listenerCount==="function"){return emitter.listenerCount(type)}else{return listenerCount.call(emitter,type)}};EventEmitter.prototype.listenerCount=listenerCount;function listenerCount(type){var events=this._events;if(events){var evlistener=events[type];if(typeof evlistener==="function"){return 1}else if(evlistener){return evlistener.length}}return 0}EventEmitter.prototype.eventNames=function eventNames(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};function spliceOne(list,index){for(var i=index,k=i+1,n=list.length;k=0)fromIndex=floor(fromIndex);else fromIndex=toPosInt(this.length)-floor(abs(fromIndex));for(i=fromIndex;i=55296&&code<=56319)value+=arrayLike[++i]}value=mapFn?call.call(mapFn,thisArg,value,j):value;if(Context){desc.value=value;defineProperty(arr,j,desc)}else{arr[j]=value}++j}length=j}}if(length===undefined){length=toPosInt(arrayLike.length);if(Context)arr=new Context(length);for(i=0;i0?1:-1}},{}],30:[function(require,module,exports){"use strict";module.exports=require("./is-implemented")()?Number.isNaN:require("./shim")},{"./is-implemented":31,"./shim":32}],31:[function(require,module,exports){"use strict";module.exports=function(){var numberIsNaN=Number.isNaN;if(typeof numberIsNaN!=="function")return false;return!numberIsNaN({})&&numberIsNaN(NaN)&&!numberIsNaN(34)}},{}],32:[function(require,module,exports){"use strict";module.exports=function(value){return value!==value}},{}],33:[function(require,module,exports){"use strict";var sign=require("../math/sign"),abs=Math.abs,floor=Math.floor;module.exports=function(value){if(isNaN(value))return 0;value=Number(value);if(value===0||!isFinite(value))return value;return sign(value)*floor(abs(value))}},{"../math/sign":27}],34:[function(require,module,exports){"use strict";var toInteger=require("./to-integer"),max=Math.max;module.exports=function(value){return max(0,toInteger(value))}},{"./to-integer":33}],35:[function(require,module,exports){"use strict";var callable=require("./valid-callable"),value=require("./valid-value"),bind=Function.prototype.bind,call=Function.prototype.call,keys=Object.keys,objPropertyIsEnumerable=Object.prototype.propertyIsEnumerable;module.exports=function(method,defVal){return function(obj,cb){var list,thisArg=arguments[2],compareFn=arguments[3];obj=Object(value(obj));callable(cb);list=keys(obj);if(compareFn){list.sort(typeof compareFn==="function"?bind.call(compareFn,obj):undefined)}if(typeof method!=="function")method=list[method];return call.call(method,list,function(key,index){if(!objPropertyIsEnumerable.call(obj,key))return defVal;return call.call(cb,thisArg,obj[key],key,obj,index)})}}},{"./valid-callable":54,"./valid-value":55}],36:[function(require,module,exports){"use strict";module.exports=require("./is-implemented")()?Object.assign:require("./shim")},{"./is-implemented":37,"./shim":38}],37:[function(require,module,exports){"use strict";module.exports=function(){var assign=Object.assign,obj;if(typeof assign!=="function")return false;obj={foo:"raz"};assign(obj,{bar:"dwa"},{trzy:"trzy"});return obj.foo+obj.bar+obj.trzy==="razdwatrzy"}},{}],38:[function(require,module,exports){"use strict";var keys=require("../keys"),value=require("../valid-value"),max=Math.max;module.exports=function(dest,src){var error,i,length=max(arguments.length,2),assign;dest=Object(value(dest));assign=function(key){try{dest[key]=src[key]}catch(e){if(!error)error=e}};for(i=1;i-1}},{}],59:[function(require,module,exports){"use strict";var objToString=Object.prototype.toString,id=objToString.call("");module.exports=function(value){return typeof value==="string"||value&&typeof value==="object"&&(value instanceof String||objToString.call(value)===id)||false}},{}],60:[function(require,module,exports){"use strict";var setPrototypeOf=require("es5-ext/object/set-prototype-of"),contains=require("es5-ext/string/#/contains"),d=require("d"),Symbol=require("es6-symbol"),Iterator=require("./");var defineProperty=Object.defineProperty,ArrayIterator;ArrayIterator=module.exports=function(arr,kind){if(!(this instanceof ArrayIterator))throw new TypeError("Constructor requires 'new'");Iterator.call(this,arr);if(!kind)kind="value";else if(contains.call(kind,"key+value"))kind="key+value";else if(contains.call(kind,"key"))kind="key";else kind="value";defineProperty(this,"__kind__",d("",kind))};if(setPrototypeOf)setPrototypeOf(ArrayIterator,Iterator);delete ArrayIterator.prototype.constructor;ArrayIterator.prototype=Object.create(Iterator.prototype,{_resolve:d(function(i){if(this.__kind__==="value")return this.__list__[i];if(this.__kind__==="key+value")return[i,this.__list__[i]];return i})});defineProperty(ArrayIterator.prototype,Symbol.toStringTag,d("c","Array Iterator"))},{"./":63,d:16,"es5-ext/object/set-prototype-of":51,"es5-ext/string/#/contains":56,"es6-symbol":73}],61:[function(require,module,exports){"use strict";var isArguments=require("es5-ext/function/is-arguments"),callable=require("es5-ext/object/valid-callable"),isString=require("es5-ext/string/is-string"),get=require("./get");var isArray=Array.isArray,call=Function.prototype.call,some=Array.prototype.some;module.exports=function(iterable,cb){var mode,thisArg=arguments[2],result,doBreak,broken,i,length,char,code;if(isArray(iterable)||isArguments(iterable))mode="array";else if(isString(iterable))mode="string";else iterable=get(iterable);callable(cb);doBreak=function(){broken=true};if(mode==="array"){some.call(iterable,function(value){call.call(cb,thisArg,value,doBreak);return broken});return}if(mode==="string"){length=iterable.length;for(i=0;i=55296&&code<=56319)char+=iterable[++i]}call.call(cb,thisArg,char,doBreak);if(broken)break}return}result=iterable.next();while(!result.done){call.call(cb,thisArg,result.value,doBreak);if(broken)return;result=iterable.next()}}},{"./get":62,"es5-ext/function/is-arguments":24,"es5-ext/object/valid-callable":54,"es5-ext/string/is-string":59}],62:[function(require,module,exports){"use strict";var isArguments=require("es5-ext/function/is-arguments"),isString=require("es5-ext/string/is-string"),ArrayIterator=require("./array"),StringIterator=require("./string"),iterable=require("./valid-iterable"),iteratorSymbol=require("es6-symbol").iterator;module.exports=function(obj){if(typeof iterable(obj)[iteratorSymbol]==="function")return obj[iteratorSymbol]();if(isArguments(obj))return new ArrayIterator(obj);if(isString(obj))return new StringIterator(obj);return new ArrayIterator(obj)}},{"./array":60,"./string":65,"./valid-iterable":66,"es5-ext/function/is-arguments":24,"es5-ext/string/is-string":59,"es6-symbol":73}],63:[function(require,module,exports){"use strict";var clear=require("es5-ext/array/#/clear"),assign=require("es5-ext/object/assign"),callable=require("es5-ext/object/valid-callable"),value=require("es5-ext/object/valid-value"),d=require("d"),autoBind=require("d/auto-bind"),Symbol=require("es6-symbol");var defineProperty=Object.defineProperty,defineProperties=Object.defineProperties,Iterator;module.exports=Iterator=function(list,context){if(!(this instanceof Iterator))throw new TypeError("Constructor requires 'new'");defineProperties(this,{__list__:d("w",value(list)),__context__:d("w",context),__nextIndex__:d("w",0)});if(!context)return;callable(context.on);context.on("_add",this._onAdd);context.on("_delete",this._onDelete);context.on("_clear",this._onClear)};delete Iterator.prototype.constructor;defineProperties(Iterator.prototype,assign({_next:d(function(){var i;if(!this.__list__)return undefined;if(this.__redo__){i=this.__redo__.shift();if(i!==undefined)return i}if(this.__nextIndex__=this.__nextIndex__)return;++this.__nextIndex__;if(!this.__redo__){defineProperty(this,"__redo__",d("c",[index]));return}this.__redo__.forEach(function(redo,i){if(redo>=index)this.__redo__[i]=++redo},this);this.__redo__.push(index)}),_onDelete:d(function(index){var i;if(index>=this.__nextIndex__)return;--this.__nextIndex__;if(!this.__redo__)return;i=this.__redo__.indexOf(index);if(i!==-1)this.__redo__.splice(i,1);this.__redo__.forEach(function(redo,j){if(redo>index)this.__redo__[j]=--redo},this)}),_onClear:d(function(){if(this.__redo__)clear.call(this.__redo__);this.__nextIndex__=0})})));defineProperty(Iterator.prototype,Symbol.iterator,d(function(){return this}))},{d:16,"d/auto-bind":15,"es5-ext/array/#/clear":19,"es5-ext/object/assign":36,"es5-ext/object/valid-callable":54,"es5-ext/object/valid-value":55,"es6-symbol":73}],64:[function(require,module,exports){"use strict";var isArguments=require("es5-ext/function/is-arguments"),isValue=require("es5-ext/object/is-value"),isString=require("es5-ext/string/is-string");var iteratorSymbol=require("es6-symbol").iterator,isArray=Array.isArray;module.exports=function(value){if(!isValue(value))return false;if(isArray(value))return true;if(isString(value))return true;if(isArguments(value))return true;return typeof value[iteratorSymbol]==="function"}},{"es5-ext/function/is-arguments":24,"es5-ext/object/is-value":44,"es5-ext/string/is-string":59,"es6-symbol":73}],65:[function(require,module,exports){"use strict";var setPrototypeOf=require("es5-ext/object/set-prototype-of"),d=require("d"),Symbol=require("es6-symbol"),Iterator=require("./");var defineProperty=Object.defineProperty,StringIterator;StringIterator=module.exports=function(str){if(!(this instanceof StringIterator))throw new TypeError("Constructor requires 'new'");str=String(str);Iterator.call(this,str);defineProperty(this,"__length__",d("",str.length))};if(setPrototypeOf)setPrototypeOf(StringIterator,Iterator);delete StringIterator.prototype.constructor;StringIterator.prototype=Object.create(Iterator.prototype,{_next:d(function(){if(!this.__list__)return undefined;if(this.__nextIndex__=55296&&code<=56319)return char+this.__list__[this.__nextIndex__++];return char})});defineProperty(StringIterator.prototype,Symbol.toStringTag,d("c","String Iterator"))},{"./":63,d:16,"es5-ext/object/set-prototype-of":51,"es6-symbol":73}],66:[function(require,module,exports){"use strict";var isIterable=require("./is-iterable");module.exports=function(value){if(!isIterable(value))throw new TypeError(value+" is not iterable");return value}},{"./is-iterable":64}],67:[function(require,module,exports){"use strict";module.exports=require("./is-implemented")()?Map:require("./polyfill")},{"./is-implemented":68,"./polyfill":72}],68:[function(require,module,exports){"use strict";module.exports=function(){var map,iterator,result;if(typeof Map!=="function")return false;try{map=new Map([["raz","one"],["dwa","two"],["trzy","three"]])}catch(e){return false}if(String(map)!=="[object Map]")return false;if(map.size!==3)return false;if(typeof map.clear!=="function")return false;if(typeof map.delete!=="function")return false;if(typeof map.entries!=="function")return false;if(typeof map.forEach!=="function")return false;if(typeof map.get!=="function")return false;if(typeof map.has!=="function")return false;if(typeof map.keys!=="function")return false;if(typeof map.set!=="function")return false;if(typeof map.values!=="function")return false;iterator=map.entries();result=iterator.next();if(result.done!==false)return false;if(!result.value)return false;if(result.value[0]!=="raz")return false;if(result.value[1]!=="one")return false;return true}},{}],69:[function(require,module,exports){"use strict";module.exports=function(){if(typeof Map==="undefined")return false;return Object.prototype.toString.call(new Map)==="[object Map]"}()},{}],70:[function(require,module,exports){"use strict";module.exports=require("es5-ext/object/primitive-set")("key","value","key+value")},{"es5-ext/object/primitive-set":50}],71:[function(require,module,exports){"use strict";var setPrototypeOf=require("es5-ext/object/set-prototype-of"),d=require("d"),Iterator=require("es6-iterator"),toStringTagSymbol=require("es6-symbol").toStringTag,kinds=require("./iterator-kinds"),defineProperties=Object.defineProperties,unBind=Iterator.prototype._unBind,MapIterator;MapIterator=module.exports=function(map,kind){if(!(this instanceof MapIterator))return new MapIterator(map,kind);Iterator.call(this,map.__mapKeysData__,map);if(!kind||!kinds[kind])kind="key+value";defineProperties(this,{__kind__:d("",kind),__values__:d("w",map.__mapValuesData__)})};if(setPrototypeOf)setPrototypeOf(MapIterator,Iterator);MapIterator.prototype=Object.create(Iterator.prototype,{constructor:d(MapIterator),_resolve:d(function(i){if(this.__kind__==="value")return this.__values__[i];if(this.__kind__==="key")return this.__list__[i];return[this.__list__[i],this.__values__[i]]}),_unBind:d(function(){this.__values__=null;unBind.call(this)}),toString:d(function(){return"[object Map Iterator]"})});Object.defineProperty(MapIterator.prototype,toStringTagSymbol,d("c","Map Iterator"))},{"./iterator-kinds":70,d:16,"es5-ext/object/set-prototype-of":51,"es6-iterator":63,"es6-symbol":73}],72:[function(require,module,exports){"use strict";var clear=require("es5-ext/array/#/clear"),eIndexOf=require("es5-ext/array/#/e-index-of"),setPrototypeOf=require("es5-ext/object/set-prototype-of"),callable=require("es5-ext/object/valid-callable"),validValue=require("es5-ext/object/valid-value"),d=require("d"),ee=require("event-emitter"),Symbol=require("es6-symbol"),iterator=require("es6-iterator/valid-iterable"),forOf=require("es6-iterator/for-of"),Iterator=require("./lib/iterator"),isNative=require("./is-native-implemented"),call=Function.prototype.call,defineProperties=Object.defineProperties,getPrototypeOf=Object.getPrototypeOf,MapPoly;module.exports=MapPoly=function(){var iterable=arguments[0],keys,values,self;if(!(this instanceof MapPoly))throw new TypeError("Constructor requires 'new'");if(isNative&&setPrototypeOf&&Map!==MapPoly){self=setPrototypeOf(new Map,getPrototypeOf(this))}else{self=this}if(iterable!=null)iterator(iterable);defineProperties(self,{__mapKeysData__:d("c",keys=[]),__mapValuesData__:d("c",values=[])});if(!iterable)return self;forOf(iterable,function(value){var key=validValue(value)[0];value=value[1];if(eIndexOf.call(keys,key)!==-1)return;keys.push(key);values.push(value)},self);return self};if(isNative){if(setPrototypeOf)setPrototypeOf(MapPoly,Map);MapPoly.prototype=Object.create(Map.prototype,{constructor:d(MapPoly)})}ee(defineProperties(MapPoly.prototype,{clear:d(function(){if(!this.__mapKeysData__.length)return;clear.call(this.__mapKeysData__);clear.call(this.__mapValuesData__);this.emit("_clear")}),delete:d(function(key){var index=eIndexOf.call(this.__mapKeysData__,key);if(index===-1)return false;this.__mapKeysData__.splice(index,1);this.__mapValuesData__.splice(index,1);this.emit("_delete",index,key);return true}),entries:d(function(){return new Iterator(this,"key+value")}),forEach:d(function(cb){var thisArg=arguments[1],iterator,result;callable(cb);iterator=this.entries();result=iterator._next();while(result!==undefined){call.call(cb,thisArg,this.__mapValuesData__[result],this.__mapKeysData__[result],this);result=iterator._next()}}),get:d(function(key){var index=eIndexOf.call(this.__mapKeysData__,key);if(index===-1)return;return this.__mapValuesData__[index]}),has:d(function(key){return eIndexOf.call(this.__mapKeysData__,key)!==-1}),keys:d(function(){return new Iterator(this,"key")}),set:d(function(key,value){var index=eIndexOf.call(this.__mapKeysData__,key),emit;if(index===-1){index=this.__mapKeysData__.push(key)-1;emit=true}this.__mapValuesData__[index]=value;if(emit)this.emit("_add",index,key);return this}),size:d.gs(function(){return this.__mapKeysData__.length}),values:d(function(){return new Iterator(this,"value")}),toString:d(function(){return"[object Map]"})}));Object.defineProperty(MapPoly.prototype,Symbol.iterator,d(function(){return this.entries()}));Object.defineProperty(MapPoly.prototype,Symbol.toStringTag,d("c","Map"))},{"./is-native-implemented":69,"./lib/iterator":71,d:16,"es5-ext/array/#/clear":19,"es5-ext/array/#/e-index-of":20,"es5-ext/object/set-prototype-of":51,"es5-ext/object/valid-callable":54,"es5-ext/object/valid-value":55,"es6-iterator/for-of":61,"es6-iterator/valid-iterable":66,"es6-symbol":73,"event-emitter":78}],73:[function(require,module,exports){"use strict";module.exports=require("./is-implemented")()?Symbol:require("./polyfill")},{"./is-implemented":74,"./polyfill":76}],74:[function(require,module,exports){"use strict";var validTypes={object:true,symbol:true};module.exports=function(){var symbol;if(typeof Symbol!=="function")return false;symbol=Symbol("test symbol");try{String(symbol)}catch(e){return false}if(!validTypes[typeof Symbol.iterator])return false;if(!validTypes[typeof Symbol.toPrimitive])return false;if(!validTypes[typeof Symbol.toStringTag])return false;return true}},{}],75:[function(require,module,exports){"use strict";module.exports=function(x){if(!x)return false;if(typeof x==="symbol")return true;if(!x.constructor)return false;if(x.constructor.name!=="Symbol")return false;return x[x.constructor.toStringTag]==="Symbol"}},{}],76:[function(require,module,exports){"use strict";var d=require("d"),validateSymbol=require("./validate-symbol"),create=Object.create,defineProperties=Object.defineProperties,defineProperty=Object.defineProperty,objPrototype=Object.prototype,NativeSymbol,SymbolPolyfill,HiddenSymbol,globalSymbols=create(null),isNativeSafe;if(typeof Symbol==="function"){NativeSymbol=Symbol;try{String(NativeSymbol());isNativeSafe=true}catch(ignore){}}var generateName=function(){var created=create(null);return function(desc){var postfix=0,name,ie11BugWorkaround;while(created[desc+(postfix||"")])++postfix;desc+=postfix||"";created[desc]=true;name="@@"+desc;defineProperty(objPrototype,name,d.gs(null,function(value){if(ie11BugWorkaround)return;ie11BugWorkaround=true;defineProperty(this,name,d(value));ie11BugWorkaround=false}));return name}}();HiddenSymbol=function Symbol(description){if(this instanceof HiddenSymbol)throw new TypeError("Symbol is not a constructor");return SymbolPolyfill(description)};module.exports=SymbolPolyfill=function Symbol(description){var symbol;if(this instanceof Symbol)throw new TypeError("Symbol is not a constructor");if(isNativeSafe)return NativeSymbol(description);symbol=create(HiddenSymbol.prototype);description=description===undefined?"":String(description);return defineProperties(symbol,{__description__:d("",description),__name__:d("",generateName(description))})};defineProperties(SymbolPolyfill,{for:d(function(key){if(globalSymbols[key])return globalSymbols[key];return globalSymbols[key]=SymbolPolyfill(String(key))}),keyFor:d(function(s){var key;validateSymbol(s);for(key in globalSymbols)if(globalSymbols[key]===s)return key}),hasInstance:d("",NativeSymbol&&NativeSymbol.hasInstance||SymbolPolyfill("hasInstance")),isConcatSpreadable:d("",NativeSymbol&&NativeSymbol.isConcatSpreadable||SymbolPolyfill("isConcatSpreadable")),iterator:d("",NativeSymbol&&NativeSymbol.iterator||SymbolPolyfill("iterator")),match:d("",NativeSymbol&&NativeSymbol.match||SymbolPolyfill("match")),replace:d("",NativeSymbol&&NativeSymbol.replace||SymbolPolyfill("replace")),search:d("",NativeSymbol&&NativeSymbol.search||SymbolPolyfill("search")),species:d("",NativeSymbol&&NativeSymbol.species||SymbolPolyfill("species")),split:d("",NativeSymbol&&NativeSymbol.split||SymbolPolyfill("split")),toPrimitive:d("",NativeSymbol&&NativeSymbol.toPrimitive||SymbolPolyfill("toPrimitive")),toStringTag:d("",NativeSymbol&&NativeSymbol.toStringTag||SymbolPolyfill("toStringTag")),unscopables:d("",NativeSymbol&&NativeSymbol.unscopables||SymbolPolyfill("unscopables"))});defineProperties(HiddenSymbol.prototype,{constructor:d(SymbolPolyfill),toString:d("",function(){return this.__name__})});defineProperties(SymbolPolyfill.prototype,{toString:d(function(){return"Symbol ("+validateSymbol(this).__description__+")"}),valueOf:d(function(){return validateSymbol(this)})});defineProperty(SymbolPolyfill.prototype,SymbolPolyfill.toPrimitive,d("",function(){var symbol=validateSymbol(this);if(typeof symbol==="symbol")return symbol;return symbol.toString()}));defineProperty(SymbolPolyfill.prototype,SymbolPolyfill.toStringTag,d("c","Symbol"));defineProperty(HiddenSymbol.prototype,SymbolPolyfill.toStringTag,d("c",SymbolPolyfill.prototype[SymbolPolyfill.toStringTag]));defineProperty(HiddenSymbol.prototype,SymbolPolyfill.toPrimitive,d("c",SymbolPolyfill.prototype[SymbolPolyfill.toPrimitive]))},{"./validate-symbol":77,d:16}],77:[function(require,module,exports){"use strict";var isSymbol=require("./is-symbol");module.exports=function(value){if(!isSymbol(value))throw new TypeError(value+" is not a symbol");return value}},{"./is-symbol":75}],78:[function(require,module,exports){"use strict";var d=require("d"),callable=require("es5-ext/object/valid-callable"),apply=Function.prototype.apply,call=Function.prototype.call,create=Object.create,defineProperty=Object.defineProperty,defineProperties=Object.defineProperties,hasOwnProperty=Object.prototype.hasOwnProperty,descriptor={configurable:true,enumerable:false,writable:true},on,once,off,emit,methods,descriptors,base;on=function(type,listener){var data;callable(listener);if(!hasOwnProperty.call(this,"__ee__")){data=descriptor.value=create(null);defineProperty(this,"__ee__",descriptor);descriptor.value=null}else{data=this.__ee__}if(!data[type])data[type]=listener;else if(typeof data[type]==="object")data[type].push(listener);else data[type]=[data[type],listener];return this};once=function(type,listener){var once,self;callable(listener);self=this;on.call(this,type,once=function(){off.call(self,type,once);apply.call(listener,this,arguments)});once.__eeOnceListener__=listener;return this};off=function(type,listener){var data,listeners,candidate,i;callable(listener);if(!hasOwnProperty.call(this,"__ee__"))return this;data=this.__ee__;if(!data[type])return this;listeners=data[type];if(typeof listeners==="object"){for(i=0;candidate=listeners[i];++i){if(candidate===listener||candidate.__eeOnceListener__===listener){if(listeners.length===2)data[type]=listeners[i?0:1];else listeners.splice(i,1)}}}else{if(listeners===listener||listeners.__eeOnceListener__===listener){delete data[type]}}return this};emit=function(type){var i,l,listener,listeners,args;if(!hasOwnProperty.call(this,"__ee__"))return;listeners=this.__ee__[type];if(!listeners)return;if(typeof listeners==="object"){l=arguments.length;args=new Array(l-1);for(i=1;i>1;var nBits=-7;var i=isLE?nBytes-1:0;var d=isLE?-1:1;var s=buffer[offset+i];i+=d;e=s&(1<<-nBits)-1;s>>=-nBits;nBits+=eLen;for(;nBits>0;e=e*256+buffer[offset+i],i+=d,nBits-=8){}m=e&(1<<-nBits)-1;e>>=-nBits;nBits+=mLen;for(;nBits>0;m=m*256+buffer[offset+i],i+=d,nBits-=8){}if(e===0){e=1-eBias}else if(e===eMax){return m?NaN:(s?-1:1)*Infinity}else{m=m+Math.pow(2,mLen);e=e-eBias}return(s?-1:1)*m*Math.pow(2,e-mLen)};exports.write=function(buffer,value,offset,isLE,mLen,nBytes){var e,m,c;var eLen=nBytes*8-mLen-1;var eMax=(1<>1;var rt=mLen===23?Math.pow(2,-24)-Math.pow(2,-77):0;var i=isLE?0:nBytes-1;var d=isLE?1:-1;var s=value<0||value===0&&1/value<0?1:0;value=Math.abs(value);if(isNaN(value)||value===Infinity){m=isNaN(value)?1:0;e=eMax}else{e=Math.floor(Math.log(value)/Math.LN2);if(value*(c=Math.pow(2,-e))<1){e--;c*=2}if(e+eBias>=1){value+=rt/c}else{value+=rt*Math.pow(2,1-eBias)}if(value*c>=2){e++;c/=2}if(e+eBias>=eMax){m=0;e=eMax}else if(e+eBias>=1){m=(value*c-1)*Math.pow(2,mLen);e=e+eBias}else{m=value*Math.pow(2,eBias-1)*Math.pow(2,mLen);e=0}}for(;mLen>=8;buffer[offset+i]=m&255,i+=d,m/=256,mLen-=8){}e=e<0;buffer[offset+i]=e&255,i+=d,e/=256,eLen-=8){}buffer[offset+i-d]|=s*128}},{}],80:[function(require,module,exports){if(typeof Object.create==="function"){module.exports=function inherits(ctor,superCtor){ctor.super_=superCtor;ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:false,writable:true,configurable:true}})}}else{module.exports=function inherits(ctor,superCtor){ctor.super_=superCtor;var TempCtor=function(){};TempCtor.prototype=superCtor.prototype;ctor.prototype=new TempCtor;ctor.prototype.constructor=ctor}}},{}],81:[function(require,module,exports){module.exports=function(obj){return obj!=null&&(isBuffer(obj)||isSlowBuffer(obj)||!!obj._isBuffer)};function isBuffer(obj){return!!obj.constructor&&typeof obj.constructor.isBuffer==="function"&&obj.constructor.isBuffer(obj)}function isSlowBuffer(obj){return typeof obj.readFloatLE==="function"&&typeof obj.slice==="function"&&isBuffer(obj.slice(0,0))}},{}],82:[function(require,module,exports){"use strict";var Buffer=require("safe-buffer").Buffer;var protocol=module.exports;protocol.types={0:"reserved",1:"connect",2:"connack",3:"publish",4:"puback",5:"pubrec",6:"pubrel",7:"pubcomp",8:"subscribe",9:"suback",10:"unsubscribe",11:"unsuback",12:"pingreq",13:"pingresp",14:"disconnect",15:"auth"};protocol.codes={};for(var k in protocol.types){var v=protocol.types[k];protocol.codes[v]=k}protocol.CMD_SHIFT=4;protocol.CMD_MASK=240;protocol.DUP_MASK=8;protocol.QOS_MASK=3;protocol.QOS_SHIFT=1;protocol.RETAIN_MASK=1;protocol.LENGTH_MASK=127;protocol.LENGTH_FIN_MASK=128;protocol.SESSIONPRESENT_MASK=1;protocol.SESSIONPRESENT_HEADER=Buffer.from([protocol.SESSIONPRESENT_MASK]);protocol.CONNACK_HEADER=Buffer.from([protocol.codes["connack"]<this.length)srcEnd=this.length;if(srcStart>=this.length)return dst||Buffer.alloc(0);if(srcEnd<=0)return dst||Buffer.alloc(0);var copy=!!dst,off=this._offset(srcStart),len=srcEnd-srcStart,bytes=len,bufoff=copy&&dstStart||0,start=off[1],l,i;if(srcStart===0&&srcEnd==this.length){if(!copy){return this._bufs.length===1?this._bufs[0]:Buffer.concat(this._bufs,this.length)}for(i=0;il){this._bufs[i].copy(dst,bufoff,start)}else{this._bufs[i].copy(dst,bufoff,start,start+bytes);break}bufoff+=l;bytes-=l;if(start)start=0}return dst};BufferList.prototype.shallowSlice=function shallowSlice(start,end){start=start||0;end=end||this.length;if(start<0)start+=this.length;if(end<0)end+=this.length;var startOffset=this._offset(start),endOffset=this._offset(end),buffers=this._bufs.slice(startOffset[0],endOffset[0]+1);if(endOffset[1]==0)buffers.pop();else buffers[buffers.length-1]=buffers[buffers.length-1].slice(0,endOffset[1]);if(startOffset[1]!=0)buffers[0]=buffers[0].slice(startOffset[1]);return new BufferList(buffers)};BufferList.prototype.toString=function toString(encoding,start,end){return this.slice(start,end).toString(encoding)};BufferList.prototype.consume=function consume(bytes){while(this._bufs.length){if(bytes>=this._bufs[0].length){bytes-=this._bufs[0].length;this.length-=this._bufs[0].length;this._bufs.shift()}else{this._bufs[0]=this._bufs[0].slice(bytes);this.length-=bytes;break}}return this};BufferList.prototype.duplicate=function duplicate(){var i=0,copy=new BufferList;for(;i>8,0);buffer.writeUInt8(i&255,0+1);return buffer}function generateCache(){for(var i=0;i=0&&length<128)return 1;else if(length>=128&&length<16384)return 2;else if(length>=16384&&length<2097152)return 3;else if(length>=2097152&&length<268435456)return 4;else return 0}function genBufVariableByteInt(num){var digit=0;var pos=0;var length=calcVariableByteIntLength(num);var buffer=Buffer.allocUnsafe(length);do{digit=num%128|0;num=num/128|0;if(num>0)digit=digit|128;buffer.writeUInt8(digit,pos++)}while(num>0);return{data:buffer,length:length}}function generate4ByteBuffer(num){var buffer=Buffer.allocUnsafe(4);buffer.writeUInt32BE(num,0);return buffer}module.exports={cache:cache,generateCache:generateCache,generateNumber:generateBuffer,genBufVariableByteInt:genBufVariableByteInt,generate4ByteBuffer:generate4ByteBuffer}},{"safe-buffer":110}],87:[function(require,module,exports){function Packet(){this.cmd=null;this.retain=false;this.qos=0;this.dup=false;this.length=-1;this.topic=null;this.payload=null}module.exports=Packet},{}],88:[function(require,module,exports){"use strict";var bl=require("bl");var inherits=require("inherits");var EE=require("events").EventEmitter;var Packet=require("./packet");var constants=require("./constants");function Parser(opt){if(!(this instanceof Parser))return new Parser(opt);this.settings=opt||{};this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"];this._resetState()}inherits(Parser,EE);Parser.prototype._resetState=function(){this.packet=new Packet;this.error=null;this._list=bl();this._stateCounter=0};Parser.prototype.parse=function(buf){if(this.error)this._resetState();this._list.append(buf);while((this.packet.length!==-1||this._list.length>0)&&this[this._states[this._stateCounter]]()&&!this.error){this._stateCounter++;if(this._stateCounter>=this._states.length)this._stateCounter=0}return this._list.length};Parser.prototype._parseHeader=function(){var zero=this._list.readUInt8(0);this.packet.cmd=constants.types[zero>>constants.CMD_SHIFT];this.packet.retain=(zero&constants.RETAIN_MASK)!==0;this.packet.qos=zero>>constants.QOS_SHIFT&constants.QOS_MASK;this.packet.dup=(zero&constants.DUP_MASK)!==0;this._list.consume(1);return true};Parser.prototype._parseLength=function(){var result=this._parseVarByteNum(true);if(result){this.packet.length=result.value;this._list.consume(result.bytes)}return!!result};Parser.prototype._parsePayload=function(){var result=false;if(this.packet.length===0||this._list.length>=this.packet.length){this._pos=0;switch(this.packet.cmd){case"connect":this._parseConnect();break;case"connack":this._parseConnack();break;case"publish":this._parsePublish();break;case"puback":case"pubrec":case"pubrel":case"pubcomp":this._parseConfirmation();break;case"subscribe":this._parseSubscribe();break;case"suback":this._parseSuback();break;case"unsubscribe":this._parseUnsubscribe();break;case"unsuback":this._parseUnsuback();break;case"pingreq":case"pingresp":break;case"disconnect":this._parseDisconnect();break;case"auth":this._parseAuth();break;default:this._emitError(new Error("Not supported"))}result=true}return result};Parser.prototype._parseConnect=function(){var protocolId;var clientId;var topic;var payload;var password;var username;var flags={};var packet=this.packet;protocolId=this._parseString();if(protocolId===null)return this._emitError(new Error("Cannot parse protocolId"));if(protocolId!=="MQTT"&&protocolId!=="MQIsdp"){return this._emitError(new Error("Invalid protocolId"))}packet.protocolId=protocolId;if(this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));packet.protocolVersion=this._list.readUInt8(this._pos);if(packet.protocolVersion!==3&&packet.protocolVersion!==4&&packet.protocolVersion!==5){return this._emitError(new Error("Invalid protocol version"))}this._pos++;if(this._pos>=this._list.length){return this._emitError(new Error("Packet too short"))}flags.username=this._list.readUInt8(this._pos)&constants.USERNAME_MASK;flags.password=this._list.readUInt8(this._pos)&constants.PASSWORD_MASK;flags.will=this._list.readUInt8(this._pos)&constants.WILL_FLAG_MASK;if(flags.will){packet.will={};packet.will.retain=(this._list.readUInt8(this._pos)&constants.WILL_RETAIN_MASK)!==0;packet.will.qos=(this._list.readUInt8(this._pos)&constants.WILL_QOS_MASK)>>constants.WILL_QOS_SHIFT}packet.clean=(this._list.readUInt8(this._pos)&constants.CLEAN_SESSION_MASK)!==0;this._pos++;packet.keepalive=this._parseNum();if(packet.keepalive===-1)return this._emitError(new Error("Packet too short"));if(packet.protocolVersion===5){var properties=this._parseProperties();if(Object.getOwnPropertyNames(properties).length){packet.properties=properties}}clientId=this._parseString();if(clientId===null)return this._emitError(new Error("Packet too short"));packet.clientId=clientId;if(flags.will){if(packet.protocolVersion===5){var willProperties=this._parseProperties();if(Object.getOwnPropertyNames(willProperties).length){packet.will.properties=willProperties}}topic=this._parseString();if(topic===null)return this._emitError(new Error("Cannot parse will topic"));packet.will.topic=topic;payload=this._parseBuffer();if(payload===null)return this._emitError(new Error("Cannot parse will payload"));packet.will.payload=payload}if(flags.username){username=this._parseString();if(username===null)return this._emitError(new Error("Cannot parse username"));packet.username=username}if(flags.password){password=this._parseBuffer();if(password===null)return this._emitError(new Error("Cannot parse password"));packet.password=password}this.settings=packet;return packet};Parser.prototype._parseConnack=function(){var packet=this.packet;if(this._list.length<2)return null;packet.sessionPresent=!!(this._list.readUInt8(this._pos++)&constants.SESSIONPRESENT_MASK);if(this.settings.protocolVersion===5){packet.reasonCode=this._list.readUInt8(this._pos++)}else{packet.returnCode=this._list.readUInt8(this._pos++)}if(packet.returnCode===-1||packet.reasonCode===-1)return this._emitError(new Error("Cannot parse return code"));if(this.settings.protocolVersion===5){var properties=this._parseProperties();if(Object.getOwnPropertyNames(properties).length){packet.properties=properties}}};Parser.prototype._parsePublish=function(){var packet=this.packet;packet.topic=this._parseString();if(packet.topic===null)return this._emitError(new Error("Cannot parse topic"));if(packet.qos>0)if(!this._parseMessageId()){return}if(this.settings.protocolVersion===5){var properties=this._parseProperties();if(Object.getOwnPropertyNames(properties).length){packet.properties=properties}}packet.payload=this._list.slice(this._pos,packet.length)};Parser.prototype._parseSubscribe=function(){var packet=this.packet;var topic;var options;var qos;var rh;var rap;var nl;var subscription;if(packet.qos!==1){return this._emitError(new Error("Wrong subscribe header"))}packet.subscriptions=[];if(!this._parseMessageId()){return}if(this.settings.protocolVersion===5){var properties=this._parseProperties();if(Object.getOwnPropertyNames(properties).length){packet.properties=properties}}while(this._pos>constants.SUBSCRIBE_OPTIONS_NL_SHIFT&constants.SUBSCRIBE_OPTIONS_NL_MASK)!==0;rap=(options>>constants.SUBSCRIBE_OPTIONS_RAP_SHIFT&constants.SUBSCRIBE_OPTIONS_RAP_MASK)!==0;rh=options>>constants.SUBSCRIBE_OPTIONS_RH_SHIFT&constants.SUBSCRIBE_OPTIONS_RH_MASK;subscription={topic:topic,qos:qos};if(this.settings.protocolVersion===5){subscription.nl=nl;subscription.rap=rap;subscription.rh=rh}packet.subscriptions.push(subscription)}};Parser.prototype._parseSuback=function(){var packet=this.packet;this.packet.granted=[];if(!this._parseMessageId()){return}if(this.settings.protocolVersion===5){var properties=this._parseProperties();if(Object.getOwnPropertyNames(properties).length){packet.properties=properties}}while(this._pos2){packet.reasonCode=this._parseByte();var properties=this._parseProperties();if(Object.getOwnPropertyNames(properties).length){packet.properties=properties}}}return true};Parser.prototype._parseDisconnect=function(){var packet=this.packet;if(this.settings.protocolVersion===5){packet.reasonCode=this._parseByte();var properties=this._parseProperties();if(Object.getOwnPropertyNames(properties).length){packet.properties=properties}}return true};Parser.prototype._parseAuth=function(){var packet=this.packet;if(this.settings.protocolVersion!==5){return this._emitError(new Error("Not supported auth packet for this version MQTT"))}packet.reasonCode=this._parseByte();var properties=this._parseProperties();if(Object.getOwnPropertyNames(properties).length){packet.properties=properties}return true};Parser.prototype._parseMessageId=function(){var packet=this.packet;packet.messageId=this._parseNum();if(packet.messageId===null){this._emitError(new Error("Cannot parse messageId"));return false}return true};Parser.prototype._parseString=function(maybeBuffer){var length=this._parseNum();var result;var end=length+this._pos;if(length===-1||end>this._list.length||end>this.packet.length)return null;result=this._list.toString("utf8",this._pos,end);this._pos+=length;return result};Parser.prototype._parseStringPair=function(){return{name:this._parseString(),value:this._parseString()}};Parser.prototype._parseBuffer=function(){var length=this._parseNum();var result;var end=length+this._pos;if(length===-1||end>this._list.length||end>this.packet.length)return null;result=this._list.slice(this._pos,end);this._pos+=length;return result};Parser.prototype._parseNum=function(){if(this._list.length-this._pos<2)return-1;var result=this._list.readUInt16BE(this._pos);this._pos+=2;return result};Parser.prototype._parse4ByteNum=function(){if(this._list.length-this._pos<4)return-1;var result=this._list.readUInt32BE(this._pos);this._pos+=4;return result};Parser.prototype._parseVarByteNum=function(fullInfoFlag){var bytes=0;var mul=1;var length=0;var result=true;var current;var padding=this._pos?this._pos:0;while(bytes<5){current=this._list.readUInt8(padding+bytes++);length+=mul*(current&constants.LENGTH_MASK);mul*=128;if((current&constants.LENGTH_FIN_MASK)===0)break;if(this._list.length<=bytes){result=false;break}}if(padding){this._pos+=bytes}result=result?fullInfoFlag?{bytes:bytes,value:length}:length:false;return result};Parser.prototype._parseByte=function(){var result=this._list.readUInt8(this._pos);this._pos++;return result};Parser.prototype._parseByType=function(type){switch(type){case"byte":{return this._parseByte()!==0}case"int8":{return this._parseByte()}case"int16":{return this._parseNum()}case"int32":{return this._parse4ByteNum()}case"var":{return this._parseVarByteNum()}case"string":{return this._parseString()}case"pair":{return this._parseStringPair()}case"binary":{return this._parseBuffer()}}};Parser.prototype._parseProperties=function(){var length=this._parseVarByteNum();var start=this._pos;var end=start+length;var result={};while(this._pos65535||keepalive%1!==0){stream.emit("error",new Error("Invalid keepalive"));return false}else length+=2;length+=1;if(protocolVersion===5){var propertiesData=getProperties(stream,properties);length+=propertiesData.length}if(will){if(typeof will!=="object"){stream.emit("error",new Error("Invalid will"));return false}if(!will.topic||typeof will.topic!=="string"){stream.emit("error",new Error("Invalid will topic"));return false}else{length+=Buffer.byteLength(will.topic)+2}if(will.payload){if(will.payload.length>=0){if(typeof will.payload==="string"){length+=Buffer.byteLength(will.payload)+2}else{length+=will.payload.length+2}}else{stream.emit("error",new Error("Invalid will payload"));return false}var willProperties={};if(protocolVersion===5){willProperties=getProperties(stream,will.properties);length+=willProperties.length}}}var providedUsername=false;if(username!=null){if(isStringOrBuffer(username)){providedUsername=true;length+=Buffer.byteLength(username)+2}else{stream.emit("error",new Error("Invalid username"));return false}}if(password!=null){if(!providedUsername){stream.emit("error",new Error("Username is required to use password"));return false}if(isStringOrBuffer(password)){length+=byteLength(password)+2}else{stream.emit("error",new Error("Invalid password"));return false}}stream.write(protocol.CONNECT_HEADER);writeVarByteInt(stream,length);writeStringOrBuffer(stream,protocolId);stream.write(protocolVersion===4?protocol.VERSION4:protocolVersion===5?protocol.VERSION5:protocol.VERSION3);var flags=0;flags|=username!=null?protocol.USERNAME_MASK:0;flags|=password!=null?protocol.PASSWORD_MASK:0;flags|=will&&will.retain?protocol.WILL_RETAIN_MASK:0;flags|=will&&will.qos?will.qos<0)writeNumber(stream,id);if(propertiesData!=null){propertiesData.write()}return stream.write(payload)}function confirmation(packet,stream,opts){var version=opts?opts.protocolVersion:4;var settings=packet||{};var type=settings.cmd||"puback";var id=settings.messageId;var dup=settings.dup&&type==="pubrel"?protocol.DUP_MASK:0;var qos=0;var reasonCode=settings.reasonCode;var properties=settings.properties;var length=version===5?3:2;if(type==="pubrel")qos=1;if(typeof id!=="number"){stream.emit("error",new Error("Invalid messageId"));return false}var propertiesData=null;if(version===5){propertiesData=getPropertiesByMaximumPacketSize(stream,properties,opts,length);if(!propertiesData){return false}length+=propertiesData.length}stream.write(protocol.ACKS[type][qos][dup][0]);writeVarByteInt(stream,length);writeNumber(stream,id);if(version===5){stream.write(Buffer.from([reasonCode]))}if(propertiesData!==null){propertiesData.write()}return true}function subscribe(packet,stream,opts){var version=opts?opts.protocolVersion:4;var settings=packet||{};var dup=settings.dup?protocol.DUP_MASK:0;var id=settings.messageId;var subs=settings.subscriptions;var properties=settings.properties;var length=0;if(typeof id!=="number"){stream.emit("error",new Error("Invalid messageId"));return false}else length+=2;var propertiesData=null;if(version===5){propertiesData=getProperties(stream,properties);length+=propertiesData.length}if(typeof subs==="object"&&subs.length){for(var i=0;i2){stream.emit("error",new Error("Invalid subscriptions - invalid Retain Handling"));return false}}length+=Buffer.byteLength(itopic)+2+1}}else{stream.emit("error",new Error("Invalid subscriptions"));return false}stream.write(protocol.SUBSCRIBE_HEADER[1][dup?1:0][0]);writeVarByteInt(stream,length);writeNumber(stream,id);if(propertiesData!==null){propertiesData.write()}var result=true;for(var j=0;jmaximumPacketSize){var currentMayEmptyProp=mayEmptyProps.shift();if(currentMayEmptyProp&&properties[currentMayEmptyProp]){delete properties[currentMayEmptyProp];propertiesData=getProperties(stream,properties)}else{return false}}}return propertiesData}function writeProperties(stream,properties,propertiesLength){writeVarByteInt(stream,propertiesLength);for(var propName in properties){if(properties.hasOwnProperty(propName)&&properties[propName]!==null){var value=properties[propName];var type=protocol.propertiesTypes[propName];switch(type){case"byte":{stream.write(Buffer.from([protocol.properties[propName]]));stream.write(Buffer.from([+value]));break}case"int8":{stream.write(Buffer.from([protocol.properties[propName]]));stream.write(Buffer.from([value]));break}case"binary":{stream.write(Buffer.from([protocol.properties[propName]]));writeStringOrBuffer(stream,value);break}case"int16":{stream.write(Buffer.from([protocol.properties[propName]]));writeNumber(stream,value);break}case"int32":{stream.write(Buffer.from([protocol.properties[propName]]));write4ByteNumber(stream,value);break}case"var":{stream.write(Buffer.from([protocol.properties[propName]]));writeVarByteInt(stream,value);break}case"string":{stream.write(Buffer.from([protocol.properties[propName]]));writeString(stream,value);break}case"pair":{Object.getOwnPropertyNames(value).forEach(function(name){stream.write(Buffer.from([protocol.properties[propName]]));writeStringPair(stream,name.toString(),value[name].toString())});break}default:{stream.emit("error",new Error("Invalid property "+propName));return false}}}}}function byteLength(bufOrString){if(!bufOrString)return 0;else if(bufOrString instanceof Buffer)return bufOrString.length;else return Buffer.byteLength(bufOrString)}function isStringOrBuffer(field){return typeof field==="string"||field instanceof Buffer}module.exports=generate},{"./constants":82,"./numbers":86,"process-nextick-args":91,"safe-buffer":110}],90:[function(require,module,exports){var wrappy=require("wrappy");module.exports=wrappy(once);module.exports.strict=wrappy(onceStrict);once.proto=once(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return once(this)},configurable:true});Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return onceStrict(this)},configurable:true})});function once(fn){var f=function(){if(f.called)return f.value;f.called=true;return f.value=fn.apply(this,arguments)};f.called=false;return f}function onceStrict(fn){var f=function(){if(f.called)throw new Error(f.onceError);f.called=true;return f.value=fn.apply(this,arguments)};var name=fn.name||"Function wrapped with `once`";f.onceError=name+" shouldn't be called more than once";f.called=false;return f}},{wrappy:120}],91:[function(require,module,exports){(function(process){"use strict";if(!process.version||process.version.indexOf("v0.")===0||process.version.indexOf("v1.")===0&&process.version.indexOf("v1.8.")!==0){module.exports={nextTick:nextTick}}else{module.exports=process}function nextTick(fn,arg1,arg2,arg3){if(typeof fn!=="function"){throw new TypeError('"callback" argument must be a function')}var len=arguments.length;var args,i;switch(len){case 0:case 1:return process.nextTick(fn);case 2:return process.nextTick(function afterTickOne(){fn.call(null,arg1)});case 3:return process.nextTick(function afterTickTwo(){fn.call(null,arg1,arg2)});case 4:return process.nextTick(function afterTickThree(){fn.call(null,arg1,arg2,arg3)});default:args=new Array(len-1);i=0;while(i1){for(var i=1;i= 0x80 (not a basic code point)","invalid-input":"Invalid input"},baseMinusTMin=base-tMin,floor=Math.floor,stringFromCharCode=String.fromCharCode,key;function error(type){throw new RangeError(errors[type])}function map(array,fn){var length=array.length;var result=[];while(length--){result[length]=fn(array[length])}return result}function mapDomain(string,fn){var parts=string.split("@");var result="";if(parts.length>1){result=parts[0]+"@";string=parts[1]}string=string.replace(regexSeparators,".");var labels=string.split(".");var encoded=map(labels,fn).join(".");return result+encoded}function ucs2decode(string){var output=[],counter=0,length=string.length,value,extra;while(counter=55296&&value<=56319&&counter65535){value-=65536;output+=stringFromCharCode(value>>>10&1023|55296);value=56320|value&1023}output+=stringFromCharCode(value);return output}).join("")}function basicToDigit(codePoint){if(codePoint-48<10){return codePoint-22}if(codePoint-65<26){return codePoint-65}if(codePoint-97<26){return codePoint-97}return base}function digitToBasic(digit,flag){return digit+22+75*(digit<26)-((flag!=0)<<5)}function adapt(delta,numPoints,firstTime){var k=0;delta=firstTime?floor(delta/damp):delta>>1;delta+=floor(delta/numPoints);for(;delta>baseMinusTMin*tMax>>1;k+=base){delta=floor(delta/baseMinusTMin)}return floor(k+(baseMinusTMin+1)*delta/(delta+skew))}function decode(input){var output=[],inputLength=input.length,out,i=0,n=initialN,bias=initialBias,basic,j,index,oldi,w,k,digit,t,baseMinusT;basic=input.lastIndexOf(delimiter);if(basic<0){basic=0}for(j=0;j=128){error("not-basic")}output.push(input.charCodeAt(j))}for(index=basic>0?basic+1:0;index=inputLength){error("invalid-input")}digit=basicToDigit(input.charCodeAt(index++));if(digit>=base||digit>floor((maxInt-i)/w)){error("overflow")}i+=digit*w;t=k<=bias?tMin:k>=bias+tMax?tMax:k-bias;if(digitfloor(maxInt/baseMinusT)){error("overflow")}w*=baseMinusT}out=output.length+1;bias=adapt(i-oldi,out,oldi==0);if(floor(i/out)>maxInt-n){error("overflow")}n+=floor(i/out);i%=out;output.splice(i++,0,n)}return ucs2encode(output)}function encode(input){var n,delta,handledCPCount,basicLength,bias,j,m,q,k,t,currentValue,output=[],inputLength,handledCPCountPlusOne,baseMinusT,qMinusT;input=ucs2decode(input);inputLength=input.length;n=initialN;delta=0;bias=initialBias;for(j=0;j=n&¤tValuefloor((maxInt-delta)/handledCPCountPlusOne)){error("overflow")}delta+=(m-n)*handledCPCountPlusOne;n=m;for(j=0;jmaxInt){error("overflow")}if(currentValue==n){for(q=delta,k=base;;k+=base){t=k<=bias?tMin:k>=bias+tMax?tMax:k-bias;if(q0&&len>maxKeys){len=maxKeys}for(var i=0;i=0){kstr=x.substr(0,idx);vstr=x.substr(idx+1)}else{kstr=x;vstr=""}k=decodeURIComponent(kstr);v=decodeURIComponent(vstr);if(!hasOwnProperty(obj,k)){obj[k]=v}else if(isArray(obj[k])){obj[k].push(v)}else{obj[k]=[obj[k],v]}}return obj};var isArray=Array.isArray||function(xs){return Object.prototype.toString.call(xs)==="[object Array]"}},{}],95:[function(require,module,exports){"use strict";var stringifyPrimitive=function(v){switch(typeof v){case"string":return v;case"boolean":return v?"true":"false";case"number":return isFinite(v)?v:"";default:return""}};module.exports=function(obj,sep,eq,name){sep=sep||"&";eq=eq||"=";if(obj===null){obj=undefined}if(typeof obj==="object"){return map(objectKeys(obj),function(k){var ks=encodeURIComponent(stringifyPrimitive(k))+eq;if(isArray(obj[k])){return map(obj[k],function(v){return ks+encodeURIComponent(stringifyPrimitive(v))}).join(sep)}else{return ks+encodeURIComponent(stringifyPrimitive(obj[k]))}}).join(sep)}if(!name)return"";return encodeURIComponent(stringifyPrimitive(name))+eq+encodeURIComponent(stringifyPrimitive(obj))};var isArray=Array.isArray||function(xs){return Object.prototype.toString.call(xs)==="[object Array]"};function map(xs,f){if(xs.map)return xs.map(f);var res=[];for(var i=0;i0){if(typeof chunk!=="string"&&!state.objectMode&&Object.getPrototypeOf(chunk)!==Buffer.prototype){chunk=_uint8ArrayToBuffer(chunk)}if(addToFront){if(state.endEmitted)stream.emit("error",new Error("stream.unshift() after end event"));else addChunk(stream,state,chunk,true)}else if(state.ended){stream.emit("error",new Error("stream.push() after EOF"))}else{state.reading=false;if(state.decoder&&!encoding){chunk=state.decoder.write(chunk);if(state.objectMode||chunk.length!==0)addChunk(stream,state,chunk,false);else maybeReadMore(stream,state)}else{addChunk(stream,state,chunk,false)}}}else if(!addToFront){state.reading=false}}return needMoreData(state)}function addChunk(stream,state,chunk,addToFront){if(state.flowing&&state.length===0&&!state.sync){stream.emit("data",chunk);stream.read(0)}else{state.length+=state.objectMode?1:chunk.length;if(addToFront)state.buffer.unshift(chunk);else state.buffer.push(chunk);if(state.needReadable)emitReadable(stream)}maybeReadMore(stream,state)}function chunkInvalid(state,chunk){var er;if(!_isUint8Array(chunk)&&typeof chunk!=="string"&&chunk!==undefined&&!state.objectMode){er=new TypeError("Invalid non-string/buffer chunk")}return er}function needMoreData(state){return!state.ended&&(state.needReadable||state.length=MAX_HWM){n=MAX_HWM}else{n--;n|=n>>>1;n|=n>>>2;n|=n>>>4;n|=n>>>8;n|=n>>>16;n++}return n}function howMuchToRead(n,state){if(n<=0||state.length===0&&state.ended)return 0;if(state.objectMode)return 1;if(n!==n){if(state.flowing&&state.length)return state.buffer.head.data.length;else return state.length}if(n>state.highWaterMark)state.highWaterMark=computeNewHighWaterMark(n);if(n<=state.length)return n;if(!state.ended){state.needReadable=true;return 0}return state.length}Readable.prototype.read=function(n){debug("read",n);n=parseInt(n,10);var state=this._readableState;var nOrig=n;if(n!==0)state.emittedReadable=false;if(n===0&&state.needReadable&&(state.length>=state.highWaterMark||state.ended)){debug("read: emitReadable",state.length,state.ended);if(state.length===0&&state.ended)endReadable(this);else emitReadable(this);return null}n=howMuchToRead(n,state);if(n===0&&state.ended){if(state.length===0)endReadable(this);return null}var doRead=state.needReadable;debug("need readable",doRead);if(state.length===0||state.length-n0)ret=fromList(n,state);else ret=null;if(ret===null){state.needReadable=true;n=0}else{state.length-=n}if(state.length===0){if(!state.ended)state.needReadable=true;if(nOrig!==n&&state.ended)endReadable(this)}if(ret!==null)this.emit("data",ret);return ret};function onEofChunk(stream,state){if(state.ended)return;if(state.decoder){var chunk=state.decoder.end();if(chunk&&chunk.length){state.buffer.push(chunk);state.length+=state.objectMode?1:chunk.length}}state.ended=true;emitReadable(stream)}function emitReadable(stream){var state=stream._readableState;state.needReadable=false;if(!state.emittedReadable){debug("emitReadable",state.flowing);state.emittedReadable=true;if(state.sync)pna.nextTick(emitReadable_,stream);else emitReadable_(stream)}}function emitReadable_(stream){debug("emit readable");stream.emit("readable");flow(stream)}function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;pna.nextTick(maybeReadMore_,stream,state)}}function maybeReadMore_(stream,state){var len=state.length;while(!state.reading&&!state.flowing&&!state.ended&&state.length1&&indexOf(state.pipes,dest)!==-1)&&!cleanedUp){debug("false write response, pause",src._readableState.awaitDrain);src._readableState.awaitDrain++;increasedAwaitDrain=true}src.pause()}}function onerror(er){debug("onerror",er);unpipe();dest.removeListener("error",onerror);if(EElistenerCount(dest,"error")===0)dest.emit("error",er)}prependListener(dest,"error",onerror);function onclose(){dest.removeListener("finish",onfinish);unpipe()}dest.once("close",onclose);function onfinish(){debug("onfinish");dest.removeListener("close",onclose);unpipe()}dest.once("finish",onfinish);function unpipe(){debug("unpipe");src.unpipe(dest)}dest.emit("pipe",src);if(!state.flowing){debug("pipe resume");src.resume()}return dest};function pipeOnDrain(src){return function(){var state=src._readableState;debug("pipeOnDrain",state.awaitDrain);if(state.awaitDrain)state.awaitDrain--;if(state.awaitDrain===0&&EElistenerCount(src,"data")){state.flowing=true;flow(src)}}}Readable.prototype.unpipe=function(dest){var state=this._readableState;var unpipeInfo={hasUnpiped:false};if(state.pipesCount===0)return this;if(state.pipesCount===1){if(dest&&dest!==state.pipes)return this;if(!dest)dest=state.pipes;state.pipes=null;state.pipesCount=0;state.flowing=false;if(dest)dest.emit("unpipe",this,unpipeInfo);return this}if(!dest){var dests=state.pipes;var len=state.pipesCount;state.pipes=null;state.pipesCount=0;state.flowing=false;for(var i=0;i=state.length){if(state.decoder)ret=state.buffer.join("");else if(state.buffer.length===1)ret=state.buffer.head.data;else ret=state.buffer.concat(state.length);state.buffer.clear()}else{ret=fromListPartial(n,state.buffer,state.decoder)}return ret}function fromListPartial(n,list,hasStrings){var ret;if(nstr.length?str.length:n;if(nb===str.length)ret+=str;else ret+=str.slice(0,n);n-=nb;if(n===0){if(nb===str.length){++c;if(p.next)list.head=p.next;else list.head=list.tail=null}else{list.head=p;p.data=str.slice(nb)}break}++c}list.length-=c;return ret}function copyFromBuffer(n,list){var ret=Buffer.allocUnsafe(n);var p=list.head;var c=1;p.data.copy(ret);n-=p.data.length;while(p=p.next){var buf=p.data;var nb=n>buf.length?buf.length:n;buf.copy(ret,ret.length-n,0,nb);n-=nb;if(n===0){if(nb===buf.length){++c;if(p.next)list.head=p.next;else list.head=list.tail=null}else{list.head=p;p.data=buf.slice(nb)}break}++c}list.length-=c;return ret}function endReadable(stream){var state=stream._readableState;if(state.length>0)throw new Error('"endReadable()" called on non-empty stream');if(!state.endEmitted){state.ended=true;pna.nextTick(endReadableNT,state,stream)}}function endReadableNT(state,stream){if(!state.endEmitted&&state.length===0){state.endEmitted=true;stream.readable=false;stream.emit("end")}}function indexOf(xs,x){for(var i=0,l=xs.length;i-1?setImmediate:pna.nextTick;var Duplex;Writable.WritableState=WritableState;var util=require("core-util-is");util.inherits=require("inherits");var internalUtil={deprecate:require("util-deprecate")};var Stream=require("./internal/streams/stream");var Buffer=require("safe-buffer").Buffer;var OurUint8Array=global.Uint8Array||function(){};function _uint8ArrayToBuffer(chunk){return Buffer.from(chunk)}function _isUint8Array(obj){return Buffer.isBuffer(obj)||obj instanceof OurUint8Array}var destroyImpl=require("./internal/streams/destroy");util.inherits(Writable,Stream);function nop(){}function WritableState(options,stream){Duplex=Duplex||require("./_stream_duplex");options=options||{};var isDuplex=stream instanceof Duplex;this.objectMode=!!options.objectMode;if(isDuplex)this.objectMode=this.objectMode||!!options.writableObjectMode;var hwm=options.highWaterMark;var writableHwm=options.writableHighWaterMark;var defaultHwm=this.objectMode?16:16*1024;if(hwm||hwm===0)this.highWaterMark=hwm;else if(isDuplex&&(writableHwm||writableHwm===0))this.highWaterMark=writableHwm;else this.highWaterMark=defaultHwm;this.highWaterMark=Math.floor(this.highWaterMark);this.finalCalled=false;this.needDrain=false;this.ending=false;this.ended=false;this.finished=false;this.destroyed=false;var noDecode=options.decodeStrings===false;this.decodeStrings=!noDecode;this.defaultEncoding=options.defaultEncoding||"utf8";this.length=0;this.writing=false;this.corked=0;this.sync=true;this.bufferProcessing=false;this.onwrite=function(er){onwrite(stream,er)};this.writecb=null;this.writelen=0;this.bufferedRequest=null;this.lastBufferedRequest=null;this.pendingcb=0;this.prefinished=false;this.errorEmitted=false;this.bufferedRequestCount=0;this.corkedRequestsFree=new CorkedRequest(this)}WritableState.prototype.getBuffer=function getBuffer(){var current=this.bufferedRequest;var out=[];while(current){out.push(current);current=current.next}return out};(function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:internalUtil.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer "+"instead.","DEP0003")})}catch(_){}})();var realHasInstance;if(typeof Symbol==="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==="function"){realHasInstance=Function.prototype[Symbol.hasInstance];Object.defineProperty(Writable,Symbol.hasInstance,{value:function(object){if(realHasInstance.call(this,object))return true;if(this!==Writable)return false;return object&&object._writableState instanceof WritableState}})}else{realHasInstance=function(object){return object instanceof this}}function Writable(options){Duplex=Duplex||require("./_stream_duplex");if(!realHasInstance.call(Writable,this)&&!(this instanceof Duplex)){return new Writable(options)}this._writableState=new WritableState(options,this);this.writable=true;if(options){if(typeof options.write==="function")this._write=options.write;if(typeof options.writev==="function")this._writev=options.writev;if(typeof options.destroy==="function")this._destroy=options.destroy;if(typeof options.final==="function")this._final=options.final}Stream.call(this)}Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function writeAfterEnd(stream,cb){var er=new Error("write after end");stream.emit("error",er);pna.nextTick(cb,er)}function validChunk(stream,state,chunk,cb){var valid=true;var er=false;if(chunk===null){er=new TypeError("May not write null values to stream")}else if(typeof chunk!=="string"&&chunk!==undefined&&!state.objectMode){er=new TypeError("Invalid non-string/buffer chunk")}if(er){stream.emit("error",er);pna.nextTick(cb,er);valid=false}return valid}Writable.prototype.write=function(chunk,encoding,cb){var state=this._writableState;var ret=false;var isBuf=!state.objectMode&&_isUint8Array(chunk);if(isBuf&&!Buffer.isBuffer(chunk)){chunk=_uint8ArrayToBuffer(chunk)}if(typeof encoding==="function"){cb=encoding;encoding=null}if(isBuf)encoding="buffer";else if(!encoding)encoding=state.defaultEncoding;if(typeof cb!=="function")cb=nop;if(state.ended)writeAfterEnd(this,cb);else if(isBuf||validChunk(this,state,chunk,cb)){state.pendingcb++;ret=writeOrBuffer(this,state,isBuf,chunk,encoding,cb)}return ret};Writable.prototype.cork=function(){var state=this._writableState;state.corked++};Writable.prototype.uncork=function(){var state=this._writableState;if(state.corked){state.corked--;if(!state.writing&&!state.corked&&!state.finished&&!state.bufferProcessing&&state.bufferedRequest)clearBuffer(this,state)}};Writable.prototype.setDefaultEncoding=function setDefaultEncoding(encoding){if(typeof encoding==="string")encoding=encoding.toLowerCase();if(!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((encoding+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+encoding);this._writableState.defaultEncoding=encoding;return this};function decodeChunk(state,chunk,encoding){if(!state.objectMode&&state.decodeStrings!==false&&typeof chunk==="string"){chunk=Buffer.from(chunk,encoding)}return chunk}Object.defineProperty(Writable.prototype,"writableHighWaterMark",{enumerable:false,get:function(){return this._writableState.highWaterMark}});function writeOrBuffer(stream,state,isBuf,chunk,encoding,cb){if(!isBuf){var newChunk=decodeChunk(state,chunk,encoding);if(chunk!==newChunk){isBuf=true;encoding="buffer";chunk=newChunk}}var len=state.objectMode?1:chunk.length;state.length+=len;var ret=state.length0)this.tail.next=entry;else this.head=entry;this.tail=entry;++this.length};BufferList.prototype.unshift=function unshift(v){var entry={data:v,next:this.head};if(this.length===0)this.tail=entry;this.head=entry;++this.length};BufferList.prototype.shift=function shift(){if(this.length===0)return;var ret=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return ret};BufferList.prototype.clear=function clear(){this.head=this.tail=null;this.length=0};BufferList.prototype.join=function join(s){if(this.length===0)return"";var p=this.head;var ret=""+p.data;while(p=p.next){ret+=s+p.data}return ret};BufferList.prototype.concat=function concat(n){if(this.length===0)return Buffer.alloc(0);if(this.length===1)return this.head.data;var ret=Buffer.allocUnsafe(n>>>0);var p=this.head;var i=0;while(p){copyBuffer(p.data,ret,i);i+=p.data.length;p=p.next}return ret};return BufferList}();if(util&&util.inspect&&util.inspect.custom){module.exports.prototype[util.inspect.custom]=function(){var obj=util.inspect({length:this.length});return this.constructor.name+" "+obj}}},{"safe-buffer":110,util:11}],104:[function(require,module,exports){"use strict";var pna=require("process-nextick-args");function destroy(err,cb){var _this=this;var readableDestroyed=this._readableState&&this._readableState.destroyed;var writableDestroyed=this._writableState&&this._writableState.destroyed;if(readableDestroyed||writableDestroyed){if(cb){cb(err)}else if(err&&(!this._writableState||!this._writableState.errorEmitted)){pna.nextTick(emitErrorNT,this,err)}return this}if(this._readableState){this._readableState.destroyed=true}if(this._writableState){this._writableState.destroyed=true}this._destroy(err||null,function(err){if(!cb&&err){pna.nextTick(emitErrorNT,_this,err);if(_this._writableState){_this._writableState.errorEmitted=true}}else if(cb){cb(err)}});return this}function undestroy(){if(this._readableState){this._readableState.destroyed=false;this._readableState.reading=false;this._readableState.ended=false;this._readableState.endEmitted=false}if(this._writableState){this._writableState.destroyed=false;this._writableState.ended=false;this._writableState.ending=false;this._writableState.finished=false;this._writableState.errorEmitted=false}}function emitErrorNT(self,err){self.emit("error",err)}module.exports={destroy:destroy,undestroy:undestroy}},{"process-nextick-args":91}],105:[function(require,module,exports){module.exports=require("events").EventEmitter},{events:13}],106:[function(require,module,exports){var toString={}.toString;module.exports=Array.isArray||function(arr){return toString.call(arr)=="[object Array]"}},{}],107:[function(require,module,exports){"use strict";var Buffer=require("safe-buffer").Buffer;var isEncoding=Buffer.isEncoding||function(encoding){encoding=""+encoding;switch(encoding&&encoding.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return true;default:return false}};function _normalizeEncoding(enc){if(!enc)return"utf8";var retried;while(true){switch(enc){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return enc;default:if(retried)return;enc=(""+enc).toLowerCase();retried=true}}}function normalizeEncoding(enc){var nenc=_normalizeEncoding(enc);if(typeof nenc!=="string"&&(Buffer.isEncoding===isEncoding||!isEncoding(enc)))throw new Error("Unknown encoding: "+enc);return nenc||enc}exports.StringDecoder=StringDecoder;function StringDecoder(encoding){this.encoding=normalizeEncoding(encoding);var nb;switch(this.encoding){case"utf16le":this.text=utf16Text;this.end=utf16End;nb=4;break;case"utf8":this.fillLast=utf8FillLast;nb=4;break;case"base64":this.text=base64Text;this.end=base64End;nb=3;break;default:this.write=simpleWrite;this.end=simpleEnd;return}this.lastNeed=0;this.lastTotal=0;this.lastChar=Buffer.allocUnsafe(nb)}StringDecoder.prototype.write=function(buf){if(buf.length===0)return"";var r;var i;if(this.lastNeed){r=this.fillLast(buf);if(r===undefined)return"";i=this.lastNeed;this.lastNeed=0}else{i=0}if(i>5===6)return 2;else if(byte>>4===14)return 3;else if(byte>>3===30)return 4;return byte>>6===2?-1:-2}function utf8CheckIncomplete(self,buf,i){var j=buf.length-1;if(j=0){if(nb>0)self.lastNeed=nb-1;return nb}if(--j=0){if(nb>0)self.lastNeed=nb-2;return nb}if(--j=0){if(nb>0){if(nb===2)nb=0;else self.lastNeed=nb-3}return nb}return 0}function utf8CheckExtraBytes(self,buf,p){if((buf[0]&192)!==128){self.lastNeed=0;return"�"}if(self.lastNeed>1&&buf.length>1){if((buf[1]&192)!==128){self.lastNeed=1;return"�"}if(self.lastNeed>2&&buf.length>2){if((buf[2]&192)!==128){self.lastNeed=2;return"�"}}}}function utf8FillLast(buf){var p=this.lastTotal-this.lastNeed;var r=utf8CheckExtraBytes(this,buf,p);if(r!==undefined)return r;if(this.lastNeed<=buf.length){buf.copy(this.lastChar,p,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal)}buf.copy(this.lastChar,p,0,buf.length);this.lastNeed-=buf.length}function utf8Text(buf,i){var total=utf8CheckIncomplete(this,buf,i);if(!this.lastNeed)return buf.toString("utf8",i);this.lastTotal=total;var end=buf.length-(total-this.lastNeed);buf.copy(this.lastChar,0,end);return buf.toString("utf8",i,end)}function utf8End(buf){var r=buf&&buf.length?this.write(buf):"";if(this.lastNeed)return r+"�";return r}function utf16Text(buf,i){if((buf.length-i)%2===0){var r=buf.toString("utf16le",i);if(r){var c=r.charCodeAt(r.length-1);if(c>=55296&&c<=56319){this.lastNeed=2;this.lastTotal=4;this.lastChar[0]=buf[buf.length-2];this.lastChar[1]=buf[buf.length-1];return r.slice(0,-1)}}return r}this.lastNeed=1;this.lastTotal=2;this.lastChar[0]=buf[buf.length-1];return buf.toString("utf16le",i,buf.length-1)}function utf16End(buf){var r=buf&&buf.length?this.write(buf):"";if(this.lastNeed){var end=this.lastTotal-this.lastNeed;return r+this.lastChar.toString("utf16le",0,end)}return r}function base64Text(buf,i){var n=(buf.length-i)%3;if(n===0)return buf.toString("base64",i);this.lastNeed=3-n;this.lastTotal=3;if(n===1){this.lastChar[0]=buf[buf.length-1]}else{this.lastChar[0]=buf[buf.length-2];this.lastChar[1]=buf[buf.length-1]}return buf.toString("base64",i,buf.length-n)}function base64End(buf){var r=buf&&buf.length?this.write(buf):"";if(this.lastNeed)return r+this.lastChar.toString("base64",0,3-this.lastNeed);return r}function simpleWrite(buf){return buf.toString(this.encoding)}function simpleEnd(buf){return buf&&buf.length?this.write(buf):""}},{"safe-buffer":110}],108:[function(require,module,exports){exports=module.exports=require("./lib/_stream_readable.js");exports.Stream=exports;exports.Readable=exports;exports.Writable=require("./lib/_stream_writable.js");exports.Duplex=require("./lib/_stream_duplex.js");exports.Transform=require("./lib/_stream_transform.js");exports.PassThrough=require("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":98,"./lib/_stream_passthrough.js":99,"./lib/_stream_readable.js":100,"./lib/_stream_transform.js":101,"./lib/_stream_writable.js":102}],109:[function(require,module,exports){"use strict";function ReInterval(callback,interval,args){var self=this;this._callback=callback;this._args=args;this._interval=setInterval(callback,interval,this._args);this.reschedule=function(interval){if(!interval)interval=self._interval;if(self._interval)clearInterval(self._interval);self._interval=setInterval(self._callback,interval,self._args)};this.clear=function(){if(self._interval){clearInterval(self._interval);self._interval=undefined}};this.destroy=function(){if(self._interval){clearInterval(self._interval)}self._callback=undefined;self._interval=undefined;self._args=undefined}}function reInterval(){if(typeof arguments[0]!=="function")throw new Error("callback needed");if(typeof arguments[1]!=="number")throw new Error("interval needed");var args;if(arguments.length>0){args=new Array(arguments.length-2);for(var i=0;i=0){item._idleTimeoutId=setTimeout(function onTimeout(){if(item._onTimeout)item._onTimeout()},msecs)}};exports.setImmediate=typeof setImmediate==="function"?setImmediate:function(fn){var id=nextImmediateId++;var args=arguments.length<2?false:slice.call(arguments,1);immediateIds[id]=true;nextTick(function onNextTick(){if(immediateIds[id]){if(args){fn.apply(null,args)}else{fn.call(null)}exports.clearImmediate(id)}});return id};exports.clearImmediate=typeof clearImmediate==="function"?clearImmediate:function(id){delete immediateIds[id]}}).call(this,require("timers").setImmediate,require("timers").clearImmediate)},{"process/browser.js":92,timers:112}],113:[function(require,module,exports){"use strict";var punycode=require("punycode");var util=require("./util");exports.parse=urlParse;exports.resolve=urlResolve;exports.resolveObject=urlResolveObject;exports.format=urlFormat;exports.Url=Url;function Url(){this.protocol=null;this.slashes=null;this.auth=null;this.host=null;this.port=null;this.hostname=null;this.hash=null;this.search=null;this.query=null;this.pathname=null;this.path=null;this.href=null}var protocolPattern=/^([a-z0-9.+-]+:)/i,portPattern=/:[0-9]*$/,simplePathPattern=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,delims=["<",">",'"',"`"," ","\r","\n","\t"],unwise=["{","}","|","\\","^","`"].concat(delims),autoEscape=["'"].concat(unwise),nonHostChars=["%","/","?",";","#"].concat(autoEscape),hostEndingChars=["/","?","#"],hostnameMaxLen=255,hostnamePartPattern=/^[+a-z0-9A-Z_-]{0,63}$/,hostnamePartStart=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,unsafeProtocol={javascript:true,"javascript:":true},hostlessProtocol={javascript:true,"javascript:":true},slashedProtocol={http:true,https:true,ftp:true,gopher:true,file:true,"http:":true,"https:":true,"ftp:":true,"gopher:":true,"file:":true},querystring=require("querystring");function urlParse(url,parseQueryString,slashesDenoteHost){if(url&&util.isObject(url)&&url instanceof Url)return url;var u=new Url;u.parse(url,parseQueryString,slashesDenoteHost);return u}Url.prototype.parse=function(url,parseQueryString,slashesDenoteHost){if(!util.isString(url)){throw new TypeError("Parameter 'url' must be a string, not "+typeof url)}var queryIndex=url.indexOf("?"),splitter=queryIndex!==-1&&queryIndex127){newpart+="x"}else{newpart+=part[j]}}if(!newpart.match(hostnamePartPattern)){var validParts=hostparts.slice(0,i);var notHost=hostparts.slice(i+1);var bit=part.match(hostnamePartStart);if(bit){validParts.push(bit[1]);notHost.unshift(bit[2])}if(notHost.length){rest="/"+notHost.join(".")+rest}this.hostname=validParts.join(".");break}}}}if(this.hostname.length>hostnameMaxLen){this.hostname=""}else{this.hostname=this.hostname.toLowerCase()}if(!ipv6Hostname){this.hostname=punycode.toASCII(this.hostname)}var p=this.port?":"+this.port:"";var h=this.hostname||"";this.host=h+p;this.href+=this.host;if(ipv6Hostname){this.hostname=this.hostname.substr(1,this.hostname.length-2);if(rest[0]!=="/"){rest="/"+rest}}}if(!unsafeProtocol[lowerProto]){for(var i=0,l=autoEscape.length;i0?result.host.split("@"):false;if(authInHost){result.auth=authInHost.shift();result.host=result.hostname=authInHost.shift()}}result.search=relative.search;result.query=relative.query;if(!util.isNull(result.pathname)||!util.isNull(result.search)){result.path=(result.pathname?result.pathname:"")+(result.search?result.search:"")}result.href=result.format();return result}if(!srcPath.length){result.pathname=null;if(result.search){result.path="/"+result.search}else{result.path=null}result.href=result.format();return result}var last=srcPath.slice(-1)[0];var hasTrailingSlash=(result.host||relative.host||srcPath.length>1)&&(last==="."||last==="..")||last==="";var up=0;for(var i=srcPath.length;i>=0;i--){last=srcPath[i];if(last==="."){srcPath.splice(i,1)}else if(last===".."){srcPath.splice(i,1);up++}else if(up){srcPath.splice(i,1);up--}}if(!mustEndAbs&&!removeAllDots){for(;up--;up){srcPath.unshift("..")}}if(mustEndAbs&&srcPath[0]!==""&&(!srcPath[0]||srcPath[0].charAt(0)!=="/")){srcPath.unshift("")}if(hasTrailingSlash&&srcPath.join("/").substr(-1)!=="/"){srcPath.push("")}var isAbsolute=srcPath[0]===""||srcPath[0]&&srcPath[0].charAt(0)==="/";if(psychotic){result.hostname=result.host=isAbsolute?"":srcPath.length?srcPath.shift():"";var authInHost=result.host&&result.host.indexOf("@")>0?result.host.split("@"):false;if(authInHost){result.auth=authInHost.shift();result.host=result.hostname=authInHost.shift()}}mustEndAbs=mustEndAbs||result.host&&srcPath.length;if(mustEndAbs&&!isAbsolute){srcPath.unshift("")}if(!srcPath.length){result.pathname=null;result.path=null}else{result.pathname=srcPath.join("/")}if(!util.isNull(result.pathname)||!util.isNull(result.search)){result.path=(result.pathname?result.pathname:"")+(result.search?result.search:"")}result.auth=relative.auth||result.auth;result.slashes=result.slashes||relative.slashes;result.href=result.format();return result};Url.prototype.parseHost=function(){var host=this.host;var port=portPattern.exec(host);if(port){port=port[0];if(port!==":"){this.port=port.substr(1)}host=host.substr(0,host.length-port.length)}if(host)this.hostname=host}},{"./util":114,punycode:93,querystring:96}],114:[function(require,module,exports){"use strict";module.exports={isString:function(arg){return typeof arg==="string"},isObject:function(arg){return typeof arg==="object"&&arg!==null},isNull:function(arg){return arg===null},isNullOrUndefined:function(arg){return arg==null}}},{}],115:[function(require,module,exports){(function(global){module.exports=deprecate;function deprecate(fn,msg){if(config("noDeprecation")){return fn}var warned=false;function deprecated(){if(!warned){if(config("throwDeprecation")){throw new Error(msg)}else if(config("traceDeprecation")){console.trace(msg)}else{console.warn(msg)}warned=true}return fn.apply(this,arguments)}return deprecated}function config(name){try{if(!global.localStorage)return false}catch(_){return false}var val=global.localStorage[name];if(null==val)return false;return String(val).toLowerCase()==="true"}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],116:[function(require,module,exports){module.exports=function isBuffer(arg){return arg&&typeof arg==="object"&&typeof arg.copy==="function"&&typeof arg.fill==="function"&&typeof arg.readUInt8==="function"}},{}],117:[function(require,module,exports){(function(process,global){var formatRegExp=/%[sdj%]/g;exports.format=function(f){if(!isString(f)){var objects=[];for(var i=0;i=len)return x;switch(x){case"%s":return String(args[i++]);case"%d":return Number(args[i++]);case"%j":try{return JSON.stringify(args[i++])}catch(_){return"[Circular]"}default:return x}});for(var x=args[i];i=3)ctx.depth=arguments[2];if(arguments.length>=4)ctx.colors=arguments[3];if(isBoolean(opts)){ctx.showHidden=opts}else if(opts){exports._extend(ctx,opts)}if(isUndefined(ctx.showHidden))ctx.showHidden=false;if(isUndefined(ctx.depth))ctx.depth=2;if(isUndefined(ctx.colors))ctx.colors=false;if(isUndefined(ctx.customInspect))ctx.customInspect=true;if(ctx.colors)ctx.stylize=stylizeWithColor;return formatValue(ctx,obj,ctx.depth)}exports.inspect=inspect;inspect.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};inspect.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function stylizeWithColor(str,styleType){var style=inspect.styles[styleType];if(style){return"["+inspect.colors[style][0]+"m"+str+"["+inspect.colors[style][1]+"m"}else{return str}}function stylizeNoColor(str,styleType){return str}function arrayToHash(array){var hash={};array.forEach(function(val,idx){hash[val]=true});return hash}function formatValue(ctx,value,recurseTimes){if(ctx.customInspect&&value&&isFunction(value.inspect)&&value.inspect!==exports.inspect&&!(value.constructor&&value.constructor.prototype===value)){var ret=value.inspect(recurseTimes,ctx);if(!isString(ret)){ret=formatValue(ctx,ret,recurseTimes)}return ret}var primitive=formatPrimitive(ctx,value);if(primitive){return primitive}var keys=Object.keys(value);var visibleKeys=arrayToHash(keys);if(ctx.showHidden){keys=Object.getOwnPropertyNames(value)}if(isError(value)&&(keys.indexOf("message")>=0||keys.indexOf("description")>=0)){return formatError(value)}if(keys.length===0){if(isFunction(value)){var name=value.name?": "+value.name:"";return ctx.stylize("[Function"+name+"]","special")}if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),"regexp")}if(isDate(value)){return ctx.stylize(Date.prototype.toString.call(value),"date")}if(isError(value)){return formatError(value)}}var base="",array=false,braces=["{","}"];if(isArray(value)){array=true;braces=["[","]"]}if(isFunction(value)){var n=value.name?": "+value.name:"";base=" [Function"+n+"]"}if(isRegExp(value)){base=" "+RegExp.prototype.toString.call(value)}if(isDate(value)){base=" "+Date.prototype.toUTCString.call(value)}if(isError(value)){base=" "+formatError(value)}if(keys.length===0&&(!array||value.length==0)){return braces[0]+base+braces[1]}if(recurseTimes<0){if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),"regexp")}else{return ctx.stylize("[Object]","special")}}ctx.seen.push(value);var output;if(array){output=formatArray(ctx,value,recurseTimes,visibleKeys,keys)}else{output=keys.map(function(key){return formatProperty(ctx,value,recurseTimes,visibleKeys,key,array)})}ctx.seen.pop();return reduceToSingleString(output,base,braces)}function formatPrimitive(ctx,value){if(isUndefined(value))return ctx.stylize("undefined","undefined");if(isString(value)){var simple="'"+JSON.stringify(value).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return ctx.stylize(simple,"string")}if(isNumber(value))return ctx.stylize(""+value,"number");if(isBoolean(value))return ctx.stylize(""+value,"boolean");if(isNull(value))return ctx.stylize("null","null")}function formatError(value){return"["+Error.prototype.toString.call(value)+"]"}function formatArray(ctx,value,recurseTimes,visibleKeys,keys){var output=[];for(var i=0,l=value.length;i-1){if(array){str=str.split("\n").map(function(line){return" "+line}).join("\n").substr(2)}else{str="\n"+str.split("\n").map(function(line){return" "+line}).join("\n")}}}else{str=ctx.stylize("[Circular]","special")}}if(isUndefined(name)){if(array&&key.match(/^\d+$/)){return str}name=JSON.stringify(""+key);if(name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)){name=name.substr(1,name.length-2);name=ctx.stylize(name,"name")}else{name=name.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'");name=ctx.stylize(name,"string")}}return name+": "+str}function reduceToSingleString(output,base,braces){var numLinesEst=0;var length=output.reduce(function(prev,cur){numLinesEst++;if(cur.indexOf("\n")>=0)numLinesEst++;return prev+cur.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(length>60){return braces[0]+(base===""?"":base+"\n ")+" "+output.join(",\n ")+" "+braces[1]}return braces[0]+base+" "+output.join(", ")+" "+braces[1]}function isArray(ar){return Array.isArray(ar)}exports.isArray=isArray;function isBoolean(arg){return typeof arg==="boolean"}exports.isBoolean=isBoolean;function isNull(arg){return arg===null}exports.isNull=isNull;function isNullOrUndefined(arg){return arg==null}exports.isNullOrUndefined=isNullOrUndefined;function isNumber(arg){return typeof arg==="number"}exports.isNumber=isNumber;function isString(arg){return typeof arg==="string"}exports.isString=isString;function isSymbol(arg){return typeof arg==="symbol"}exports.isSymbol=isSymbol;function isUndefined(arg){return arg===void 0}exports.isUndefined=isUndefined;function isRegExp(re){return isObject(re)&&objectToString(re)==="[object RegExp]"}exports.isRegExp=isRegExp;function isObject(arg){return typeof arg==="object"&&arg!==null}exports.isObject=isObject;function isDate(d){return isObject(d)&&objectToString(d)==="[object Date]"}exports.isDate=isDate;function isError(e){return isObject(e)&&(objectToString(e)==="[object Error]"||e instanceof Error)}exports.isError=isError;function isFunction(arg){return typeof arg==="function"}exports.isFunction=isFunction;function isPrimitive(arg){return arg===null||typeof arg==="boolean"||typeof arg==="number"||typeof arg==="string"||typeof arg==="symbol"||typeof arg==="undefined"}exports.isPrimitive=isPrimitive;exports.isBuffer=require("./support/isBuffer");function objectToString(o){return Object.prototype.toString.call(o)}function pad(n){return n<10?"0"+n.toString(10):n.toString(10)}var months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function timestamp(){var d=new Date;var time=[pad(d.getHours()),pad(d.getMinutes()),pad(d.getSeconds())].join(":");return[d.getDate(),months[d.getMonth()],time].join(" ")}exports.log=function(){console.log("%s - %s",timestamp(),exports.format.apply(exports,arguments))};exports.inherits=require("inherits");exports._extend=function(origin,add){if(!add||!isObject(add))return origin;var keys=Object.keys(add);var i=keys.length;while(i--){origin[keys[i]]=add[keys[i]]}return origin};function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./support/isBuffer":116,_process:92,inherits:80}],118:[function(require,module,exports){(function(process,global){"use strict";var Transform=require("readable-stream").Transform;var duplexify=require("duplexify");var WS=require("ws");var Buffer=require("safe-buffer").Buffer;module.exports=WebSocketStream;function buildProxy(options,socketWrite,socketEnd){var proxy=new Transform({objectMode:options.objectMode});proxy._write=socketWrite;proxy._flush=socketEnd;return proxy}function WebSocketStream(target,protocols,options){var stream,socket;var isBrowser=process.title==="browser";var isNative=!!global.WebSocket;var socketWrite=isBrowser?socketWriteBrowser:socketWriteNode;if(protocols&&!Array.isArray(protocols)&&"object"===typeof protocols){options=protocols;protocols=null;if(typeof options.protocol==="string"||Array.isArray(options.protocol)){protocols=options.protocol}}if(!options)options={};if(options.objectMode===undefined){options.objectMode=!(options.binary===true||options.binary===undefined)}var proxy=buildProxy(options,socketWrite,socketEnd);if(!options.objectMode){proxy._writev=writev}var bufferSize=options.browserBufferSize||1024*512;var bufferTimeout=options.browserBufferTimeout||1e3;if(typeof target==="object"){socket=target}else{if(isNative&&isBrowser){socket=new WS(target,protocols)}else{socket=new WS(target,protocols,options)}socket.binaryType="arraybuffer"}if(socket.readyState===socket.OPEN){stream=proxy}else{stream=duplexify.obj();socket.onopen=onopen}stream.socket=socket;socket.onclose=onclose;socket.onerror=onerror;socket.onmessage=onmessage;proxy.on("close",destroy);var coerceToBuffer=!options.objectMode;function socketWriteNode(chunk,enc,next){if(socket.readyState!==socket.OPEN){next();return}if(coerceToBuffer&&typeof chunk==="string"){chunk=Buffer.from(chunk,"utf8")}socket.send(chunk,next)}function socketWriteBrowser(chunk,enc,next){if(socket.bufferedAmount>bufferSize){setTimeout(socketWriteBrowser,bufferTimeout,chunk,enc,next);return}if(coerceToBuffer&&typeof chunk==="string"){chunk=Buffer.from(chunk,"utf8")}try{socket.send(chunk)}catch(err){return next(err)}next()}function socketEnd(done){socket.close();done()}function onopen(){stream.setReadable(proxy);stream.setWritable(proxy);stream.emit("connect")}function onclose(){stream.end();stream.destroy()}function onerror(err){stream.destroy(err)}function onmessage(event){var data=event.data;if(data instanceof ArrayBuffer)data=Buffer.from(data);else data=Buffer.from(data,"utf8");proxy.push(data)}function destroy(){socket.close()}function writev(chunks,cb){var buffers=new Array(chunks.length);for(var i=0;i0){if(this.options.resubscribe){this._resubscribeTopics.resubscribe=true;this.subscribe(this._resubscribeTopics)}else{this._resubscribeTopics={}}}firstConnection=false});this.on("close",function(){if(that.pingTimer!==null){that.pingTimer.clear();that.pingTimer=null}});this.on("close",this._setupReconnect);events.EventEmitter.call(this);this._setupStream()}inherits(MqttClient,events.EventEmitter);MqttClient.prototype._setupStream=function(){var connectPacket;var that=this;var writable=new Writable;var parser=mqttPacket.parser(this.options);var completeParse=null;var packets=[];this._clearReconnect();this.stream=this.streamBuilder(this);parser.on("packet",function(packet){packets.push(packet)});function nextTickWork(){process.nextTick(work)}function work(){var packet=packets.shift();var done=completeParse;if(packet){that._handlePacket(packet,nextTickWork)}else{completeParse=null;done()}}writable._write=function(buf,enc,done){completeParse=done;parser.parse(buf);work()};this.stream.pipe(writable);this.stream.on("error",nop);eos(this.stream,this.emit.bind(this,"close"));connectPacket=Object.create(this.options);connectPacket.cmd="connect";sendPacket(this,connectPacket);parser.on("error",this.emit.bind(this,"error"));this.stream.setMaxListeners(1e3);clearTimeout(this.connackTimer);this.connackTimer=setTimeout(function(){that._cleanUp(true)},this.options.connectTimeout)};MqttClient.prototype._handlePacket=function(packet,done){this.emit("packetreceive",packet);switch(packet.cmd){case"publish":this._handlePublish(packet,done);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":this._handleAck(packet);done();break;case"pubrel":this._handlePubrel(packet,done);break;case"connack":this._handleConnack(packet);done();break;case"pingresp":this._handlePingresp(packet);done();break;default:break}};MqttClient.prototype._checkDisconnecting=function(callback){if(this.disconnecting){if(callback){callback(new Error("client disconnecting"))}else{this.emit("error",new Error("client disconnecting"))}}return this.disconnecting};MqttClient.prototype.publish=function(topic,message,opts,callback){var packet;if(typeof opts==="function"){callback=opts;opts=null}var defaultOpts={qos:0,retain:false,dup:false};opts=xtend(defaultOpts,opts);if(this._checkDisconnecting(callback)){return this}packet={cmd:"publish",topic:topic,payload:message,qos:opts.qos,retain:opts.retain,messageId:this._nextId(),dup:opts.dup};switch(opts.qos){case 1:case 2:this.outgoing[packet.messageId]=callback||nop;this._sendPacket(packet);break;default:this._sendPacket(packet,callback);break}return this};MqttClient.prototype.subscribe=function(){var packet;var args=Array.prototype.slice.call(arguments);var subs=[];var obj=args.shift();var resubscribe=obj.resubscribe;var callback=args.pop()||nop;var opts=args.pop();var invalidTopic;var that=this;delete obj.resubscribe;if(typeof obj==="string"){obj=[obj]}if(typeof callback!=="function"){opts=callback;callback=nop}invalidTopic=validations.validateTopics(obj);if(invalidTopic!==null){setImmediate(callback,new Error("Invalid topic "+invalidTopic));return this}if(this._checkDisconnecting(callback)){return this}var defaultOpts={qos:0};opts=xtend(defaultOpts,opts);if(Array.isArray(obj)){obj.forEach(function(topic){if(that._resubscribeTopics[topic]0){that._resubscribeTopics[sub.topic]=sub.qos;topics.push(sub.topic)}});that.messageIdToTopic[packet.messageId]=topics}this.outgoing[packet.messageId]=function(err,packet){if(!err){var granted=packet.granted;for(var i=0;i0){this.once("outgoingEmpty",setTimeout.bind(null,finish,10))}else{finish()}return this};MqttClient.prototype.removeOutgoingMessage=function(mid){var cb=this.outgoing[mid];delete this.outgoing[mid];this.outgoingStore.del({messageId:mid},function(){cb(new Error("Message removed"))});return this};MqttClient.prototype.reconnect=function(opts){var that=this;var f=function(){if(opts){that.options.incomingStore=opts.incomingStore;that.options.outgoingStore=opts.outgoingStore}else{that.options.incomingStore=null;that.options.outgoingStore=null}that.incomingStore=that.options.incomingStore||new Store;that.outgoingStore=that.options.outgoingStore||new Store;that.disconnecting=false;that.disconnected=false;that._deferredReconnect=null;that._reconnect()};if(this.disconnecting&&!this.disconnected){this._deferredReconnect=f}else{f()}return this};MqttClient.prototype._reconnect=function(){this.emit("reconnect");this._setupStream()};MqttClient.prototype._setupReconnect=function(){var that=this;if(!that.disconnecting&&!that.reconnectTimer&&that.options.reconnectPeriod>0){if(!this.reconnecting){this.emit("offline");this.reconnecting=true}that.reconnectTimer=setInterval(function(){that._reconnect()},that.options.reconnectPeriod)}};MqttClient.prototype._clearReconnect=function(){if(this.reconnectTimer){clearInterval(this.reconnectTimer);this.reconnectTimer=null}};MqttClient.prototype._cleanUp=function(forced,done){if(done){this.stream.on("close",done)}if(forced){if(this.options.reconnectPeriod===0&&this.options.clean){flush(this.outgoing)}this.stream.destroy()}else{this._sendPacket({cmd:"disconnect"},setImmediate.bind(null,this.stream.end.bind(this.stream)))}if(!this.disconnecting){this._clearReconnect();this._setupReconnect()}if(this.pingTimer!==null){this.pingTimer.clear();this.pingTimer=null}if(done&&!this.connected){this.stream.removeListener("close",done);done()}};MqttClient.prototype._sendPacket=function(packet,cb){if(!this.connected){if((packet.qos||0)===0&&this.queueQoSZero||packet.cmd!=="publish"){this.queue.push({packet:packet,cb:cb})}else if(packet.qos>0){cb=this.outgoing[packet.messageId];this.outgoingStore.put(packet,function(err){if(err){return cb&&cb(err)}})}else if(cb){cb(new Error("No connection to broker"))}return}this._shiftPingInterval();switch(packet.cmd){case"publish":break;case"pubrel":storeAndSend(this,packet,cb);return;default:sendPacket(this,packet,cb);return}switch(packet.qos){case 2:case 1:storeAndSend(this,packet,cb);break;case 0:default:sendPacket(this,packet,cb);break}};MqttClient.prototype._setupPingTimer=function(){var that=this;if(!this.pingTimer&&this.options.keepalive){this.pingResp=true;this.pingTimer=reInterval(function(){that._checkPing()},this.options.keepalive*1e3)}};MqttClient.prototype._shiftPingInterval=function(){if(this.pingTimer&&this.options.keepalive&&this.options.reschedulePings){this.pingTimer.reschedule(this.options.keepalive*1e3)}};MqttClient.prototype._checkPing=function(){if(this.pingResp){this.pingResp=false;this._sendPacket({cmd:"pingreq"})}else{this._cleanUp(true)}};MqttClient.prototype._handlePingresp=function(){this.pingResp=true};MqttClient.prototype._handleConnack=function(packet){var rc=packet.returnCode;var errors=["","Unacceptable protocol version","Identifier rejected","Server unavailable","Bad username or password","Not authorized"];clearTimeout(this.connackTimer);if(rc===0){this.reconnecting=false;this.emit("connect",packet)}else if(rc>0){var err=new Error("Connection refused: "+errors[rc]);err.code=rc;this.emit("error",err)}};MqttClient.prototype._handlePublish=function(packet,done){done=typeof done!=="undefined"?done:nop;var topic=packet.topic.toString();var message=packet.payload;var qos=packet.qos;var mid=packet.messageId;var that=this;switch(qos){case 2:this.incomingStore.put(packet,function(err){if(err){return done(err)}that._sendPacket({cmd:"pubrec",messageId:mid},done)});break;case 1:this.emit("message",topic,message,packet);this.handleMessage(packet,function(err){if(err){return done(err)}that._sendPacket({cmd:"puback",messageId:mid},done)});break;case 0:this.emit("message",topic,message,packet);this.handleMessage(packet,done);break;default:break}};MqttClient.prototype.handleMessage=function(packet,callback){callback()};MqttClient.prototype._handleAck=function(packet){var mid=packet.messageId;var type=packet.cmd;var response=null;var cb=this.outgoing[mid];var that=this;if(!cb){return}switch(type){case"pubcomp":case"puback":delete this.outgoing[mid];this.outgoingStore.del(packet,cb);break;case"pubrec":response={cmd:"pubrel",qos:2,messageId:mid};this._sendPacket(response);break;case"suback":delete this.outgoing[mid];if(packet.granted.length===1&&(packet.granted[0]&128)!==0){var topics=this.messageIdToTopic[mid];if(topics){topics.forEach(function(topic){delete that._resubscribeTopics[topic]})}}cb(null,packet);break;case"unsuback":delete this.outgoing[mid];cb(null);break;default:that.emit("error",new Error("unrecognized packet type"))}if(this.disconnecting&&Object.keys(this.outgoing).length===0){this.emit("outgoingEmpty")}};MqttClient.prototype._handlePubrel=function(packet,callback){callback=typeof callback!=="undefined"?callback:nop;var mid=packet.messageId;var that=this;var comp={cmd:"pubcomp",messageId:mid};that.incomingStore.get(packet,function(err,pub){if(!err&&pub.cmd!=="pubrel"){that.emit("message",pub.topic,pub.payload,pub);that.incomingStore.put(packet,function(err){if(err){return callback(err)}that.handleMessage(pub,function(err){if(err){return callback(err)}that._sendPacket(comp,callback)})})}else{that._sendPacket(comp,callback)}})};MqttClient.prototype._nextId=function(){var id=this.nextId++;if(this.nextId===65536){this.nextId=1}return id};MqttClient.prototype.getLastMessageId=function(){return this.nextId===1?65535:this.nextId-1};module.exports=MqttClient}).call(this)}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./store":6,"./validations":7,_process:96,"end-of-stream":16,events:79,inherits:84,"mqtt-packet":89,"readable-stream":112,reinterval:113,xtend:165}],2:[function(require,module,exports){"use strict";var net=require("net");function buildBuilder(client,opts){var port,host;opts.port=opts.port||1883;opts.hostname=opts.hostname||opts.host||"localhost";port=opts.port;host=opts.hostname;return net.createConnection(port,host)}module.exports=buildBuilder},{net:11}],3:[function(require,module,exports){"use strict";var tls=require("tls");function buildBuilder(mqttClient,opts){var connection;opts.port=opts.port||8883;opts.host=opts.hostname||opts.host||"localhost";opts.rejectUnauthorized=opts.rejectUnauthorized!==false;delete opts.path;connection=tls.connect(opts);connection.on("secureConnect",function(){if(opts.rejectUnauthorized&&!connection.authorized){connection.emit("error",new Error("TLS not authorized"))}else{connection.removeListener("error",handleTLSerrors)}});function handleTLSerrors(err){if(opts.rejectUnauthorized){mqttClient.emit("error",err)}connection.end()}connection.on("error",handleTLSerrors);return connection}module.exports=buildBuilder},{tls:11}],4:[function(require,module,exports){(function(process){(function(){"use strict";var websocket=require("websocket-stream");var urlModule=require("url");var WSS_OPTIONS=["rejectUnauthorized","ca","cert","key","pfx","passphrase"];var IS_BROWSER=process.title==="browser";function buildUrl(opts,client){var url=opts.protocol+"://"+opts.hostname+":"+opts.port+opts.path;if(typeof opts.transformWsUrl==="function"){url=opts.transformWsUrl(url,opts,client)}return url}function setDefaultOpts(opts){if(!opts.hostname){opts.hostname="localhost"}if(!opts.port){if(opts.protocol==="wss"){opts.port=443}else{opts.port=80}}if(!opts.path){opts.path="/"}if(!opts.wsOptions){opts.wsOptions={}}if(!IS_BROWSER&&opts.protocol==="wss"){WSS_OPTIONS.forEach(function(prop){if(opts.hasOwnProperty(prop)&&!opts.wsOptions.hasOwnProperty(prop)){opts.wsOptions[prop]=opts[prop]}})}}function createWebSocket(client,opts){var websocketSubProtocol=opts.protocolId==="MQIsdp"&&opts.protocolVersion===3?"mqttv3.1":"mqtt";setDefaultOpts(opts);var url=buildUrl(opts,client);return websocket(url,[websocketSubProtocol],opts.wsOptions)}function buildBuilder(client,opts){return createWebSocket(client,opts)}function buildBuilderBrowser(client,opts){if(!opts.hostname){opts.hostname=opts.host}if(!opts.hostname){if(typeof document==="undefined"){throw new Error("Could not determine host. Specify host manually.")}var parsed=urlModule.parse(document.URL);opts.hostname=parsed.hostname;if(!opts.port){opts.port=parsed.port}}return createWebSocket(client,opts)}if(IS_BROWSER){module.exports=buildBuilderBrowser}else{module.exports=buildBuilder}}).call(this)}).call(this,require("_process"))},{_process:96,url:128,"websocket-stream":162}],5:[function(require,module,exports){"use strict";var socketOpen=false;var socketMsgQueue=[];function sendSocketMessage(msg){if(socketOpen){wx.sendSocketMessage({data:msg.buffer||msg})}else{socketMsgQueue.push(msg)}}function WebSocket(url,protocols){var ws={OPEN:1,CLOSING:2,CLOSED:3,readyState:socketOpen?1:0,send:sendSocketMessage,close:wx.closeSocket,onopen:null,onmessage:null,onclose:null,onerror:null};wx.connectSocket({url:url,protocols:protocols});wx.onSocketOpen(function(res){ws.readyState=ws.OPEN;socketOpen=true;for(var i=0;i0){throw new Error("Invalid string. Length must be a multiple of 4")}var validLen=b64.indexOf("=");if(validLen===-1)validLen=len;var placeHoldersLen=validLen===len?0:4-validLen%4;return[validLen,placeHoldersLen]}function byteLength(b64){var lens=getLens(b64);var validLen=lens[0];var placeHoldersLen=lens[1];return(validLen+placeHoldersLen)*3/4-placeHoldersLen}function _byteLength(b64,validLen,placeHoldersLen){return(validLen+placeHoldersLen)*3/4-placeHoldersLen}function toByteArray(b64){var tmp;var lens=getLens(b64);var validLen=lens[0];var placeHoldersLen=lens[1];var arr=new Arr(_byteLength(b64,validLen,placeHoldersLen));var curByte=0;var len=placeHoldersLen>0?validLen-4:validLen;var i;for(i=0;i>16&255;arr[curByte++]=tmp>>8&255;arr[curByte++]=tmp&255}if(placeHoldersLen===2){tmp=revLookup[b64.charCodeAt(i)]<<2|revLookup[b64.charCodeAt(i+1)]>>4;arr[curByte++]=tmp&255}if(placeHoldersLen===1){tmp=revLookup[b64.charCodeAt(i)]<<10|revLookup[b64.charCodeAt(i+1)]<<4|revLookup[b64.charCodeAt(i+2)]>>2;arr[curByte++]=tmp>>8&255;arr[curByte++]=tmp&255}return arr}function tripletToBase64(num){return lookup[num>>18&63]+lookup[num>>12&63]+lookup[num>>6&63]+lookup[num&63]}function encodeChunk(uint8,start,end){var tmp;var output=[];for(var i=start;ilen2?len2:i+maxChunkLength))}if(extraBytes===1){tmp=uint8[len-1];parts.push(lookup[tmp>>2]+lookup[tmp<<4&63]+"==")}else if(extraBytes===2){tmp=(uint8[len-2]<<8)+uint8[len-1];parts.push(lookup[tmp>>10]+lookup[tmp>>4&63]+lookup[tmp<<2&63]+"=")}return parts.join("")}},{}],10:[function(require,module,exports){var DuplexStream=require("readable-stream/duplex"),util=require("util"),Buffer=require("safe-buffer").Buffer;function BufferList(callback){if(!(this instanceof BufferList))return new BufferList(callback);this._bufs=[];this.length=0;if(typeof callback=="function"){this._callback=callback;var piper=function piper(err){if(this._callback){this._callback(err);this._callback=null}}.bind(this);this.on("pipe",function onPipe(src){src.on("error",piper)});this.on("unpipe",function onUnpipe(src){src.removeListener("error",piper)})}else{this.append(callback)}DuplexStream.call(this)}util.inherits(BufferList,DuplexStream);BufferList.prototype._offset=function _offset(offset){var tot=0,i=0,_t;if(offset===0)return[0,0];for(;ithis.length)srcEnd=this.length;if(srcStart>=this.length)return dst||Buffer.alloc(0);if(srcEnd<=0)return dst||Buffer.alloc(0);var copy=!!dst,off=this._offset(srcStart),len=srcEnd-srcStart,bytes=len,bufoff=copy&&dstStart||0,start=off[1],l,i;if(srcStart===0&&srcEnd==this.length){if(!copy){return this._bufs.length===1?this._bufs[0]:Buffer.concat(this._bufs,this.length)}for(i=0;il){this._bufs[i].copy(dst,bufoff,start);bufoff+=l}else{this._bufs[i].copy(dst,bufoff,start,start+bytes);bufoff+=l;break}bytes-=l;if(start)start=0}if(dst.length>bufoff)return dst.slice(0,bufoff);return dst};BufferList.prototype.shallowSlice=function shallowSlice(start,end){start=start||0;end=end||this.length;if(start<0)start+=this.length;if(end<0)end+=this.length;var startOffset=this._offset(start),endOffset=this._offset(end),buffers=this._bufs.slice(startOffset[0],endOffset[0]+1);if(endOffset[1]==0)buffers.pop();else buffers[buffers.length-1]=buffers[buffers.length-1].slice(0,endOffset[1]);if(startOffset[1]!=0)buffers[0]=buffers[0].slice(startOffset[1]);return new BufferList(buffers)};BufferList.prototype.toString=function toString(encoding,start,end){return this.slice(start,end).toString(encoding)};BufferList.prototype.consume=function consume(bytes){bytes=Math.trunc(bytes);if(Number.isNaN(bytes)||bytes<=0)return this;while(this._bufs.length){if(bytes>=this._bufs[0].length){bytes-=this._bufs[0].length;this.length-=this._bufs[0].length;this._bufs.shift()}else{this._bufs[0]=this._bufs[0].slice(bytes);this.length-=bytes;break}}return this};BufferList.prototype.duplicate=function duplicate(){var i=0,copy=new BufferList;for(;iK_MAX_LENGTH){throw new RangeError('The value "'+length+'" is invalid for option "size"')}var buf=new Uint8Array(length);buf.__proto__=Buffer.prototype;return buf}function Buffer(arg,encodingOrOffset,length){if(typeof arg==="number"){if(typeof encodingOrOffset==="string"){throw new TypeError('The "string" argument must be of type string. Received type number')}return allocUnsafe(arg)}return from(arg,encodingOrOffset,length)}if(typeof Symbol!=="undefined"&&Symbol.species!=null&&Buffer[Symbol.species]===Buffer){Object.defineProperty(Buffer,Symbol.species,{value:null,configurable:true,enumerable:false,writable:false})}Buffer.poolSize=8192;function from(value,encodingOrOffset,length){if(typeof value==="string"){return fromString(value,encodingOrOffset)}if(ArrayBuffer.isView(value)){return fromArrayLike(value)}if(value==null){throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, "+"or Array-like Object. Received type "+typeof value)}if(isInstance(value,ArrayBuffer)||value&&isInstance(value.buffer,ArrayBuffer)){return fromArrayBuffer(value,encodingOrOffset,length)}if(typeof value==="number"){throw new TypeError('The "value" argument must not be of type number. Received type number')}var valueOf=value.valueOf&&value.valueOf();if(valueOf!=null&&valueOf!==value){return Buffer.from(valueOf,encodingOrOffset,length)}var b=fromObject(value);if(b)return b;if(typeof Symbol!=="undefined"&&Symbol.toPrimitive!=null&&typeof value[Symbol.toPrimitive]==="function"){return Buffer.from(value[Symbol.toPrimitive]("string"),encodingOrOffset,length)}throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, "+"or Array-like Object. Received type "+typeof value)}Buffer.from=function(value,encodingOrOffset,length){return from(value,encodingOrOffset,length)};Buffer.prototype.__proto__=Uint8Array.prototype;Buffer.__proto__=Uint8Array;function assertSize(size){if(typeof size!=="number"){throw new TypeError('"size" argument must be of type number')}else if(size<0){throw new RangeError('The value "'+size+'" is invalid for option "size"')}}function alloc(size,fill,encoding){assertSize(size);if(size<=0){return createBuffer(size)}if(fill!==undefined){return typeof encoding==="string"?createBuffer(size).fill(fill,encoding):createBuffer(size).fill(fill)}return createBuffer(size)}Buffer.alloc=function(size,fill,encoding){return alloc(size,fill,encoding)};function allocUnsafe(size){assertSize(size);return createBuffer(size<0?0:checked(size)|0)}Buffer.allocUnsafe=function(size){return allocUnsafe(size)};Buffer.allocUnsafeSlow=function(size){return allocUnsafe(size)};function fromString(string,encoding){if(typeof encoding!=="string"||encoding===""){encoding="utf8"}if(!Buffer.isEncoding(encoding)){throw new TypeError("Unknown encoding: "+encoding)}var length=byteLength(string,encoding)|0;var buf=createBuffer(length);var actual=buf.write(string,encoding);if(actual!==length){buf=buf.slice(0,actual)}return buf}function fromArrayLike(array){var length=array.length<0?0:checked(array.length)|0;var buf=createBuffer(length);for(var i=0;i=K_MAX_LENGTH){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+K_MAX_LENGTH.toString(16)+" bytes")}return length|0}function SlowBuffer(length){if(+length!=length){length=0}return Buffer.alloc(+length)}Buffer.isBuffer=function isBuffer(b){return b!=null&&b._isBuffer===true&&b!==Buffer.prototype};Buffer.compare=function compare(a,b){if(isInstance(a,Uint8Array))a=Buffer.from(a,a.offset,a.byteLength);if(isInstance(b,Uint8Array))b=Buffer.from(b,b.offset,b.byteLength);if(!Buffer.isBuffer(a)||!Buffer.isBuffer(b)){throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array')}if(a===b)return 0;var x=a.length;var y=b.length;for(var i=0,len=Math.min(x,y);i2&&arguments[2]===true;if(!mustMatch&&len===0)return 0;var loweredCase=false;for(;;){switch(encoding){case"ascii":case"latin1":case"binary":return len;case"utf8":case"utf-8":return utf8ToBytes(string).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return len*2;case"hex":return len>>>1;case"base64":return base64ToBytes(string).length;default:if(loweredCase){return mustMatch?-1:utf8ToBytes(string).length}encoding=(""+encoding).toLowerCase();loweredCase=true}}}Buffer.byteLength=byteLength;function slowToString(encoding,start,end){var loweredCase=false;if(start===undefined||start<0){start=0}if(start>this.length){return""}if(end===undefined||end>this.length){end=this.length}if(end<=0){return""}end>>>=0;start>>>=0;if(end<=start){return""}if(!encoding)encoding="utf8";while(true){switch(encoding){case"hex":return hexSlice(this,start,end);case"utf8":case"utf-8":return utf8Slice(this,start,end);case"ascii":return asciiSlice(this,start,end);case"latin1":case"binary":return latin1Slice(this,start,end);case"base64":return base64Slice(this,start,end);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,start,end);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(encoding+"").toLowerCase();loweredCase=true}}}Buffer.prototype._isBuffer=true;function swap(b,n,m){var i=b[n];b[n]=b[m];b[m]=i}Buffer.prototype.swap16=function swap16(){var len=this.length;if(len%2!==0){throw new RangeError("Buffer size must be a multiple of 16-bits")}for(var i=0;imax)str+=" ... ";return""};Buffer.prototype.compare=function compare(target,start,end,thisStart,thisEnd){if(isInstance(target,Uint8Array)){target=Buffer.from(target,target.offset,target.byteLength)}if(!Buffer.isBuffer(target)){throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. '+"Received type "+typeof target)}if(start===undefined){start=0}if(end===undefined){end=target?target.length:0}if(thisStart===undefined){thisStart=0}if(thisEnd===undefined){thisEnd=this.length}if(start<0||end>target.length||thisStart<0||thisEnd>this.length){throw new RangeError("out of range index")}if(thisStart>=thisEnd&&start>=end){return 0}if(thisStart>=thisEnd){return-1}if(start>=end){return 1}start>>>=0;end>>>=0;thisStart>>>=0;thisEnd>>>=0;if(this===target)return 0;var x=thisEnd-thisStart;var y=end-start;var len=Math.min(x,y);var thisCopy=this.slice(thisStart,thisEnd);var targetCopy=target.slice(start,end);for(var i=0;i2147483647){byteOffset=2147483647}else if(byteOffset<-2147483648){byteOffset=-2147483648}byteOffset=+byteOffset;if(numberIsNaN(byteOffset)){byteOffset=dir?0:buffer.length-1}if(byteOffset<0)byteOffset=buffer.length+byteOffset;if(byteOffset>=buffer.length){if(dir)return-1;else byteOffset=buffer.length-1}else if(byteOffset<0){if(dir)byteOffset=0;else return-1}if(typeof val==="string"){val=Buffer.from(val,encoding)}if(Buffer.isBuffer(val)){if(val.length===0){return-1}return arrayIndexOf(buffer,val,byteOffset,encoding,dir)}else if(typeof val==="number"){val=val&255;if(typeof Uint8Array.prototype.indexOf==="function"){if(dir){return Uint8Array.prototype.indexOf.call(buffer,val,byteOffset)}else{return Uint8Array.prototype.lastIndexOf.call(buffer,val,byteOffset)}}return arrayIndexOf(buffer,[val],byteOffset,encoding,dir)}throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(arr,val,byteOffset,encoding,dir){var indexSize=1;var arrLength=arr.length;var valLength=val.length;if(encoding!==undefined){encoding=String(encoding).toLowerCase();if(encoding==="ucs2"||encoding==="ucs-2"||encoding==="utf16le"||encoding==="utf-16le"){if(arr.length<2||val.length<2){return-1}indexSize=2;arrLength/=2;valLength/=2;byteOffset/=2}}function read(buf,i){if(indexSize===1){return buf[i]}else{return buf.readUInt16BE(i*indexSize)}}var i;if(dir){var foundIndex=-1;for(i=byteOffset;iarrLength)byteOffset=arrLength-valLength;for(i=byteOffset;i>=0;i--){var found=true;for(var j=0;jremaining){length=remaining}}var strLen=string.length;if(length>strLen/2){length=strLen/2}for(var i=0;i>>0;if(isFinite(length)){length=length>>>0;if(encoding===undefined)encoding="utf8"}else{encoding=length;length=undefined}}else{throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported")}var remaining=this.length-offset;if(length===undefined||length>remaining)length=remaining;if(string.length>0&&(length<0||offset<0)||offset>this.length){throw new RangeError("Attempt to write outside buffer bounds")}if(!encoding)encoding="utf8";var loweredCase=false;for(;;){switch(encoding){case"hex":return hexWrite(this,string,offset,length);case"utf8":case"utf-8":return utf8Write(this,string,offset,length);case"ascii":return asciiWrite(this,string,offset,length);case"latin1":case"binary":return latin1Write(this,string,offset,length);case"base64":return base64Write(this,string,offset,length);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,string,offset,length);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(""+encoding).toLowerCase();loweredCase=true}}};Buffer.prototype.toJSON=function toJSON(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function base64Slice(buf,start,end){if(start===0&&end===buf.length){return base64.fromByteArray(buf)}else{return base64.fromByteArray(buf.slice(start,end))}}function utf8Slice(buf,start,end){end=Math.min(buf.length,end);var res=[];var i=start;while(i239?4:firstByte>223?3:firstByte>191?2:1;if(i+bytesPerSequence<=end){var secondByte,thirdByte,fourthByte,tempCodePoint;switch(bytesPerSequence){case 1:if(firstByte<128){codePoint=firstByte}break;case 2:secondByte=buf[i+1];if((secondByte&192)===128){tempCodePoint=(firstByte&31)<<6|secondByte&63;if(tempCodePoint>127){codePoint=tempCodePoint}}break;case 3:secondByte=buf[i+1];thirdByte=buf[i+2];if((secondByte&192)===128&&(thirdByte&192)===128){tempCodePoint=(firstByte&15)<<12|(secondByte&63)<<6|thirdByte&63;if(tempCodePoint>2047&&(tempCodePoint<55296||tempCodePoint>57343)){codePoint=tempCodePoint}}break;case 4:secondByte=buf[i+1];thirdByte=buf[i+2];fourthByte=buf[i+3];if((secondByte&192)===128&&(thirdByte&192)===128&&(fourthByte&192)===128){tempCodePoint=(firstByte&15)<<18|(secondByte&63)<<12|(thirdByte&63)<<6|fourthByte&63;if(tempCodePoint>65535&&tempCodePoint<1114112){codePoint=tempCodePoint}}}}if(codePoint===null){codePoint=65533;bytesPerSequence=1}else if(codePoint>65535){codePoint-=65536;res.push(codePoint>>>10&1023|55296);codePoint=56320|codePoint&1023}res.push(codePoint);i+=bytesPerSequence}return decodeCodePointsArray(res)}var MAX_ARGUMENTS_LENGTH=4096;function decodeCodePointsArray(codePoints){var len=codePoints.length;if(len<=MAX_ARGUMENTS_LENGTH){return String.fromCharCode.apply(String,codePoints)}var res="";var i=0;while(ilen)end=len;var out="";for(var i=start;ilen){start=len}if(end<0){end+=len;if(end<0)end=0}else if(end>len){end=len}if(endlength)throw new RangeError("Trying to access beyond buffer length")}Buffer.prototype.readUIntLE=function readUIntLE(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);var val=this[offset];var mul=1;var i=0;while(++i>>0;byteLength=byteLength>>>0;if(!noAssert){checkOffset(offset,byteLength,this.length)}var val=this[offset+--byteLength];var mul=1;while(byteLength>0&&(mul*=256)){val+=this[offset+--byteLength]*mul}return val};Buffer.prototype.readUInt8=function readUInt8(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,1,this.length);return this[offset]};Buffer.prototype.readUInt16LE=function readUInt16LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);return this[offset]|this[offset+1]<<8};Buffer.prototype.readUInt16BE=function readUInt16BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);return this[offset]<<8|this[offset+1]};Buffer.prototype.readUInt32LE=function readUInt32LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return(this[offset]|this[offset+1]<<8|this[offset+2]<<16)+this[offset+3]*16777216};Buffer.prototype.readUInt32BE=function readUInt32BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return this[offset]*16777216+(this[offset+1]<<16|this[offset+2]<<8|this[offset+3])};Buffer.prototype.readIntLE=function readIntLE(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);var val=this[offset];var mul=1;var i=0;while(++i=mul)val-=Math.pow(2,8*byteLength);return val};Buffer.prototype.readIntBE=function readIntBE(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);var i=byteLength;var mul=1;var val=this[offset+--i];while(i>0&&(mul*=256)){val+=this[offset+--i]*mul}mul*=128;if(val>=mul)val-=Math.pow(2,8*byteLength);return val};Buffer.prototype.readInt8=function readInt8(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,1,this.length);if(!(this[offset]&128))return this[offset];return(255-this[offset]+1)*-1};Buffer.prototype.readInt16LE=function readInt16LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);var val=this[offset]|this[offset+1]<<8;return val&32768?val|4294901760:val};Buffer.prototype.readInt16BE=function readInt16BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);var val=this[offset+1]|this[offset]<<8;return val&32768?val|4294901760:val};Buffer.prototype.readInt32LE=function readInt32LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return this[offset]|this[offset+1]<<8|this[offset+2]<<16|this[offset+3]<<24};Buffer.prototype.readInt32BE=function readInt32BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return this[offset]<<24|this[offset+1]<<16|this[offset+2]<<8|this[offset+3]};Buffer.prototype.readFloatLE=function readFloatLE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,true,23,4)};Buffer.prototype.readFloatBE=function readFloatBE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,false,23,4)};Buffer.prototype.readDoubleLE=function readDoubleLE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,true,52,8)};Buffer.prototype.readDoubleBE=function readDoubleBE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,false,52,8)};function checkInt(buf,value,offset,ext,max,min){if(!Buffer.isBuffer(buf))throw new TypeError('"buffer" argument must be a Buffer instance');if(value>max||valuebuf.length)throw new RangeError("Index out of range")}Buffer.prototype.writeUIntLE=function writeUIntLE(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert){var maxBytes=Math.pow(2,8*byteLength)-1;checkInt(this,value,offset,byteLength,maxBytes,0)}var mul=1;var i=0;this[offset]=value&255;while(++i>>0;byteLength=byteLength>>>0;if(!noAssert){var maxBytes=Math.pow(2,8*byteLength)-1;checkInt(this,value,offset,byteLength,maxBytes,0)}var i=byteLength-1;var mul=1;this[offset+i]=value&255;while(--i>=0&&(mul*=256)){this[offset+i]=value/mul&255}return offset+byteLength};Buffer.prototype.writeUInt8=function writeUInt8(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,1,255,0);this[offset]=value&255;return offset+1};Buffer.prototype.writeUInt16LE=function writeUInt16LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,65535,0);this[offset]=value&255;this[offset+1]=value>>>8;return offset+2};Buffer.prototype.writeUInt16BE=function writeUInt16BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,65535,0);this[offset]=value>>>8;this[offset+1]=value&255;return offset+2};Buffer.prototype.writeUInt32LE=function writeUInt32LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,4294967295,0);this[offset+3]=value>>>24;this[offset+2]=value>>>16;this[offset+1]=value>>>8;this[offset]=value&255;return offset+4};Buffer.prototype.writeUInt32BE=function writeUInt32BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,4294967295,0);this[offset]=value>>>24;this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value&255;return offset+4};Buffer.prototype.writeIntLE=function writeIntLE(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;if(!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=0;var mul=1;var sub=0;this[offset]=value&255;while(++i>0)-sub&255}return offset+byteLength};Buffer.prototype.writeIntBE=function writeIntBE(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;if(!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=byteLength-1;var mul=1;var sub=0;this[offset+i]=value&255;while(--i>=0&&(mul*=256)){if(value<0&&sub===0&&this[offset+i+1]!==0){sub=1}this[offset+i]=(value/mul>>0)-sub&255}return offset+byteLength};Buffer.prototype.writeInt8=function writeInt8(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,1,127,-128);if(value<0)value=255+value+1;this[offset]=value&255;return offset+1};Buffer.prototype.writeInt16LE=function writeInt16LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,32767,-32768);this[offset]=value&255;this[offset+1]=value>>>8;return offset+2};Buffer.prototype.writeInt16BE=function writeInt16BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,32767,-32768);this[offset]=value>>>8;this[offset+1]=value&255;return offset+2};Buffer.prototype.writeInt32LE=function writeInt32LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,2147483647,-2147483648);this[offset]=value&255;this[offset+1]=value>>>8;this[offset+2]=value>>>16;this[offset+3]=value>>>24;return offset+4};Buffer.prototype.writeInt32BE=function writeInt32BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,2147483647,-2147483648);if(value<0)value=4294967295+value+1;this[offset]=value>>>24;this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value&255;return offset+4};function checkIEEE754(buf,value,offset,ext,max,min){if(offset+ext>buf.length)throw new RangeError("Index out of range");if(offset<0)throw new RangeError("Index out of range")}function writeFloat(buf,value,offset,littleEndian,noAssert){value=+value;offset=offset>>>0;if(!noAssert){checkIEEE754(buf,value,offset,4,34028234663852886e22,-34028234663852886e22)}ieee754.write(buf,value,offset,littleEndian,23,4);return offset+4}Buffer.prototype.writeFloatLE=function writeFloatLE(value,offset,noAssert){return writeFloat(this,value,offset,true,noAssert)};Buffer.prototype.writeFloatBE=function writeFloatBE(value,offset,noAssert){return writeFloat(this,value,offset,false,noAssert)};function writeDouble(buf,value,offset,littleEndian,noAssert){value=+value;offset=offset>>>0;if(!noAssert){checkIEEE754(buf,value,offset,8,17976931348623157e292,-17976931348623157e292)}ieee754.write(buf,value,offset,littleEndian,52,8);return offset+8}Buffer.prototype.writeDoubleLE=function writeDoubleLE(value,offset,noAssert){return writeDouble(this,value,offset,true,noAssert)};Buffer.prototype.writeDoubleBE=function writeDoubleBE(value,offset,noAssert){return writeDouble(this,value,offset,false,noAssert)};Buffer.prototype.copy=function copy(target,targetStart,start,end){if(!Buffer.isBuffer(target))throw new TypeError("argument should be a Buffer");if(!start)start=0;if(!end&&end!==0)end=this.length;if(targetStart>=target.length)targetStart=target.length;if(!targetStart)targetStart=0;if(end>0&&end=this.length)throw new RangeError("Index out of range");if(end<0)throw new RangeError("sourceEnd out of bounds");if(end>this.length)end=this.length;if(target.length-targetStart=0;--i){target[i+targetStart]=this[i+start]}}else{Uint8Array.prototype.set.call(target,this.subarray(start,end),targetStart)}return len};Buffer.prototype.fill=function fill(val,start,end,encoding){if(typeof val==="string"){if(typeof start==="string"){encoding=start;start=0;end=this.length}else if(typeof end==="string"){encoding=end;end=this.length}if(encoding!==undefined&&typeof encoding!=="string"){throw new TypeError("encoding must be a string")}if(typeof encoding==="string"&&!Buffer.isEncoding(encoding)){throw new TypeError("Unknown encoding: "+encoding)}if(val.length===1){var code=val.charCodeAt(0);if(encoding==="utf8"&&code<128||encoding==="latin1"){val=code}}}else if(typeof val==="number"){val=val&255}if(start<0||this.length>>0;end=end===undefined?this.length:end>>>0;if(!val)val=0;var i;if(typeof val==="number"){for(i=start;i55295&&codePoint<57344){if(!leadSurrogate){if(codePoint>56319){if((units-=3)>-1)bytes.push(239,191,189);continue}else if(i+1===length){if((units-=3)>-1)bytes.push(239,191,189);continue}leadSurrogate=codePoint;continue}if(codePoint<56320){if((units-=3)>-1)bytes.push(239,191,189);leadSurrogate=codePoint;continue}codePoint=(leadSurrogate-55296<<10|codePoint-56320)+65536}else if(leadSurrogate){if((units-=3)>-1)bytes.push(239,191,189)}leadSurrogate=null;if(codePoint<128){if((units-=1)<0)break;bytes.push(codePoint)}else if(codePoint<2048){if((units-=2)<0)break;bytes.push(codePoint>>6|192,codePoint&63|128)}else if(codePoint<65536){if((units-=3)<0)break;bytes.push(codePoint>>12|224,codePoint>>6&63|128,codePoint&63|128)}else if(codePoint<1114112){if((units-=4)<0)break;bytes.push(codePoint>>18|240,codePoint>>12&63|128,codePoint>>6&63|128,codePoint&63|128)}else{throw new Error("Invalid code point")}}return bytes}function asciiToBytes(str){var byteArray=[];for(var i=0;i>8;lo=c%256;byteArray.push(lo);byteArray.push(hi)}return byteArray}function base64ToBytes(str){return base64.toByteArray(base64clean(str))}function blitBuffer(src,dst,offset,length){for(var i=0;i=dst.length||i>=src.length)break;dst[i+offset]=src[i]}return i}function isInstance(obj,type){return obj instanceof type||obj!=null&&obj.constructor!=null&&obj.constructor.name!=null&&obj.constructor.name===type.name}function numberIsNaN(obj){return obj!==obj}}).call(this)}).call(this,require("buffer").Buffer)},{"base64-js":9,buffer:12,ieee754:83}],13:[function(require,module,exports){(function(Buffer){(function(){function isArray(arg){if(Array.isArray){return Array.isArray(arg)}return objectToString(arg)==="[object Array]"}exports.isArray=isArray;function isBoolean(arg){return typeof arg==="boolean"}exports.isBoolean=isBoolean;function isNull(arg){return arg===null}exports.isNull=isNull;function isNullOrUndefined(arg){return arg==null}exports.isNullOrUndefined=isNullOrUndefined;function isNumber(arg){return typeof arg==="number"}exports.isNumber=isNumber;function isString(arg){return typeof arg==="string"}exports.isString=isString;function isSymbol(arg){return typeof arg==="symbol"}exports.isSymbol=isSymbol;function isUndefined(arg){return arg===void 0}exports.isUndefined=isUndefined;function isRegExp(re){return objectToString(re)==="[object RegExp]"}exports.isRegExp=isRegExp;function isObject(arg){return typeof arg==="object"&&arg!==null}exports.isObject=isObject;function isDate(d){return objectToString(d)==="[object Date]"}exports.isDate=isDate;function isError(e){return objectToString(e)==="[object Error]"||e instanceof Error}exports.isError=isError;function isFunction(arg){return typeof arg==="function"}exports.isFunction=isFunction;function isPrimitive(arg){return arg===null||typeof arg==="boolean"||typeof arg==="number"||typeof arg==="string"||typeof arg==="symbol"||typeof arg==="undefined"}exports.isPrimitive=isPrimitive;exports.isBuffer=Buffer.isBuffer;function objectToString(o){return Object.prototype.toString.call(o)}}).call(this)}).call(this,{isBuffer:require("../../is-buffer/index.js")})},{"../../is-buffer/index.js":85}],14:[function(require,module,exports){"use strict";var isValue=require("type/value/is"),ensureValue=require("type/value/ensure"),ensurePlainFunction=require("type/plain-function/ensure"),copy=require("es5-ext/object/copy"),normalizeOptions=require("es5-ext/object/normalize-options"),map=require("es5-ext/object/map");var bind=Function.prototype.bind,defineProperty=Object.defineProperty,hasOwnProperty=Object.prototype.hasOwnProperty,define;define=function(name,desc,options){var value=ensureValue(desc)&&ensurePlainFunction(desc.value),dgs;dgs=copy(desc);delete dgs.writable;delete dgs.value;dgs.get=function(){if(!options.overwriteDefinition&&hasOwnProperty.call(this,name))return value;desc.value=bind.call(value,options.resolveContext?options.resolveContext(this):this);defineProperty(this,name,desc);return this[name]};return dgs};module.exports=function(props){var options=normalizeOptions(arguments[1]);if(isValue(options.resolveContext))ensurePlainFunction(options.resolveContext);return map(props,function(desc,name){return define(name,desc,options)})}},{"es5-ext/object/copy":37,"es5-ext/object/map":45,"es5-ext/object/normalize-options":46,"type/plain-function/ensure":122,"type/value/ensure":126,"type/value/is":127}],15:[function(require,module,exports){"use strict";var isValue=require("type/value/is"),isPlainFunction=require("type/plain-function/is"),assign=require("es5-ext/object/assign"),normalizeOpts=require("es5-ext/object/normalize-options"),contains=require("es5-ext/string/#/contains");var d=module.exports=function(dscr,value){var c,e,w,options,desc;if(arguments.length<2||typeof dscr!=="string"){options=value;value=dscr;dscr=null}else{options=arguments[2]}if(isValue(dscr)){c=contains.call(dscr,"c");e=contains.call(dscr,"e");w=contains.call(dscr,"w")}else{c=w=true;e=false}desc={value:value,configurable:c,enumerable:e,writable:w};return!options?desc:assign(normalizeOpts(options),desc)};d.gs=function(dscr,get,set){var c,e,options,desc;if(typeof dscr!=="string"){options=set;set=get;get=dscr;dscr=null}else{options=arguments[3]}if(!isValue(get)){get=undefined}else if(!isPlainFunction(get)){options=get;get=set=undefined}else if(!isValue(set)){set=undefined}else if(!isPlainFunction(set)){options=set;set=undefined}if(isValue(dscr)){c=contains.call(dscr,"c");e=contains.call(dscr,"e")}else{c=true;e=false}desc={get:get,set:set,configurable:c,enumerable:e};return!options?desc:assign(normalizeOpts(options),desc)}},{"es5-ext/object/assign":34,"es5-ext/object/normalize-options":46,"es5-ext/string/#/contains":53,"type/plain-function/is":123,"type/value/is":127}],16:[function(require,module,exports){(function(process){(function(){var once=require("once");var noop=function(){};var isRequest=function(stream){return stream.setHeader&&typeof stream.abort==="function"};var isChildProcess=function(stream){return stream.stdio&&Array.isArray(stream.stdio)&&stream.stdio.length===3};var eos=function(stream,opts,callback){if(typeof opts==="function")return eos(stream,null,opts);if(!opts)opts={};callback=once(callback||noop);var ws=stream._writableState;var rs=stream._readableState;var readable=opts.readable||opts.readable!==false&&stream.readable;var writable=opts.writable||opts.writable!==false&&stream.writable;var cancelled=false;var onlegacyfinish=function(){if(!stream.writable)onfinish()};var onfinish=function(){writable=false;if(!readable)callback.call(stream)};var onend=function(){readable=false;if(!writable)callback.call(stream)};var onexit=function(exitCode){callback.call(stream,exitCode?new Error("exited with error code: "+exitCode):null)};var onerror=function(err){callback.call(stream,err)};var onclose=function(){process.nextTick(onclosenexttick)};var onclosenexttick=function(){if(cancelled)return;if(readable&&!(rs&&(rs.ended&&!rs.destroyed)))return callback.call(stream,new Error("premature close"));if(writable&&!(ws&&(ws.ended&&!ws.destroyed)))return callback.call(stream,new Error("premature close"))};var onrequest=function(){stream.req.on("finish",onfinish)};if(isRequest(stream)){stream.on("complete",onfinish);stream.on("abort",onclose);if(stream.req)onrequest();else stream.on("request",onrequest)}else if(writable&&!ws){stream.on("end",onlegacyfinish);stream.on("close",onlegacyfinish)}if(isChildProcess(stream))stream.on("exit",onexit);stream.on("end",onend);stream.on("finish",onfinish);if(opts.error!==false)stream.on("error",onerror);stream.on("close",onclose);return function(){cancelled=true;stream.removeListener("complete",onfinish);stream.removeListener("abort",onclose);stream.removeListener("request",onrequest);if(stream.req)stream.req.removeListener("finish",onfinish);stream.removeListener("end",onlegacyfinish);stream.removeListener("close",onlegacyfinish);stream.removeListener("finish",onfinish);stream.removeListener("exit",onexit);stream.removeListener("end",onend);stream.removeListener("error",onerror);stream.removeListener("close",onclose)}};module.exports=eos}).call(this)}).call(this,require("_process"))},{_process:96,once:94}],17:[function(require,module,exports){"use strict";var value=require("../../object/valid-value");module.exports=function(){value(this).length=0;return this}},{"../../object/valid-value":52}],18:[function(require,module,exports){"use strict";var numberIsNaN=require("../../number/is-nan"),toPosInt=require("../../number/to-pos-integer"),value=require("../../object/valid-value"),indexOf=Array.prototype.indexOf,objHasOwnProperty=Object.prototype.hasOwnProperty,abs=Math.abs,floor=Math.floor;module.exports=function(searchElement){var i,length,fromIndex,val;if(!numberIsNaN(searchElement))return indexOf.apply(this,arguments);length=toPosInt(value(this).length);fromIndex=arguments[1];if(isNaN(fromIndex))fromIndex=0;else if(fromIndex>=0)fromIndex=floor(fromIndex);else fromIndex=toPosInt(this.length)-floor(abs(fromIndex));for(i=fromIndex;i=55296&&code<=56319)value+=arrayLike[++i]}value=mapFn?call.call(mapFn,thisArg,value,j):value;if(Context){desc.value=value;defineProperty(arr,j,desc)}else{arr[j]=value}++j}length=j}}if(length===undefined){length=toPosInt(arrayLike.length);if(Context)arr=new Context(length);for(i=0;i0?1:-1}},{}],28:[function(require,module,exports){"use strict";module.exports=require("./is-implemented")()?Number.isNaN:require("./shim")},{"./is-implemented":29,"./shim":30}],29:[function(require,module,exports){"use strict";module.exports=function(){var numberIsNaN=Number.isNaN;if(typeof numberIsNaN!=="function")return false;return!numberIsNaN({})&&numberIsNaN(NaN)&&!numberIsNaN(34)}},{}],30:[function(require,module,exports){"use strict";module.exports=function(value){return value!==value}},{}],31:[function(require,module,exports){"use strict";var sign=require("../math/sign"),abs=Math.abs,floor=Math.floor;module.exports=function(value){if(isNaN(value))return 0;value=Number(value);if(value===0||!isFinite(value))return value;return sign(value)*floor(abs(value))}},{"../math/sign":25}],32:[function(require,module,exports){"use strict";var toInteger=require("./to-integer"),max=Math.max;module.exports=function(value){return max(0,toInteger(value))}},{"./to-integer":31}],33:[function(require,module,exports){"use strict";var callable=require("./valid-callable"),value=require("./valid-value"),bind=Function.prototype.bind,call=Function.prototype.call,keys=Object.keys,objPropertyIsEnumerable=Object.prototype.propertyIsEnumerable;module.exports=function(method,defVal){return function(obj,cb){var list,thisArg=arguments[2],compareFn=arguments[3];obj=Object(value(obj));callable(cb);list=keys(obj);if(compareFn){list.sort(typeof compareFn==="function"?bind.call(compareFn,obj):undefined)}if(typeof method!=="function")method=list[method];return call.call(method,list,function(key,index){if(!objPropertyIsEnumerable.call(obj,key))return defVal;return call.call(cb,thisArg,obj[key],key,obj,index)})}}},{"./valid-callable":51,"./valid-value":52}],34:[function(require,module,exports){"use strict";module.exports=require("./is-implemented")()?Object.assign:require("./shim")},{"./is-implemented":35,"./shim":36}],35:[function(require,module,exports){"use strict";module.exports=function(){var assign=Object.assign,obj;if(typeof assign!=="function")return false;obj={foo:"raz"};assign(obj,{bar:"dwa"},{trzy:"trzy"});return obj.foo+obj.bar+obj.trzy==="razdwatrzy"}},{}],36:[function(require,module,exports){"use strict";var keys=require("../keys"),value=require("../valid-value"),max=Math.max;module.exports=function(dest,src){var error,i,length=max(arguments.length,2),assign;dest=Object(value(dest));assign=function(key){try{dest[key]=src[key]}catch(e){if(!error)error=e}};for(i=1;i-1}},{}],56:[function(require,module,exports){"use strict";var objToString=Object.prototype.toString,id=objToString.call("");module.exports=function(value){return typeof value==="string"||value&&typeof value==="object"&&(value instanceof String||objToString.call(value)===id)||false}},{}],57:[function(require,module,exports){"use strict";var setPrototypeOf=require("es5-ext/object/set-prototype-of"),contains=require("es5-ext/string/#/contains"),d=require("d"),Symbol=require("es6-symbol"),Iterator=require("./");var defineProperty=Object.defineProperty,ArrayIterator;ArrayIterator=module.exports=function(arr,kind){if(!(this instanceof ArrayIterator))throw new TypeError("Constructor requires 'new'");Iterator.call(this,arr);if(!kind)kind="value";else if(contains.call(kind,"key+value"))kind="key+value";else if(contains.call(kind,"key"))kind="key";else kind="value";defineProperty(this,"__kind__",d("",kind))};if(setPrototypeOf)setPrototypeOf(ArrayIterator,Iterator);delete ArrayIterator.prototype.constructor;ArrayIterator.prototype=Object.create(Iterator.prototype,{_resolve:d(function(i){if(this.__kind__==="value")return this.__list__[i];if(this.__kind__==="key+value")return[i,this.__list__[i]];return i})});defineProperty(ArrayIterator.prototype,Symbol.toStringTag,d("c","Array Iterator"))},{"./":60,d:15,"es5-ext/object/set-prototype-of":48,"es5-ext/string/#/contains":53,"es6-symbol":70}],58:[function(require,module,exports){"use strict";var isArguments=require("es5-ext/function/is-arguments"),callable=require("es5-ext/object/valid-callable"),isString=require("es5-ext/string/is-string"),get=require("./get");var isArray=Array.isArray,call=Function.prototype.call,some=Array.prototype.some;module.exports=function(iterable,cb){var mode,thisArg=arguments[2],result,doBreak,broken,i,length,char,code;if(isArray(iterable)||isArguments(iterable))mode="array";else if(isString(iterable))mode="string";else iterable=get(iterable);callable(cb);doBreak=function(){broken=true};if(mode==="array"){some.call(iterable,function(value){call.call(cb,thisArg,value,doBreak);return broken});return}if(mode==="string"){length=iterable.length;for(i=0;i=55296&&code<=56319)char+=iterable[++i]}call.call(cb,thisArg,char,doBreak);if(broken)break}return}result=iterable.next();while(!result.done){call.call(cb,thisArg,result.value,doBreak);if(broken)return;result=iterable.next()}}},{"./get":59,"es5-ext/function/is-arguments":22,"es5-ext/object/valid-callable":51,"es5-ext/string/is-string":56}],59:[function(require,module,exports){"use strict";var isArguments=require("es5-ext/function/is-arguments"),isString=require("es5-ext/string/is-string"),ArrayIterator=require("./array"),StringIterator=require("./string"),iterable=require("./valid-iterable"),iteratorSymbol=require("es6-symbol").iterator;module.exports=function(obj){if(typeof iterable(obj)[iteratorSymbol]==="function")return obj[iteratorSymbol]();if(isArguments(obj))return new ArrayIterator(obj);if(isString(obj))return new StringIterator(obj);return new ArrayIterator(obj)}},{"./array":57,"./string":62,"./valid-iterable":63,"es5-ext/function/is-arguments":22,"es5-ext/string/is-string":56,"es6-symbol":70}],60:[function(require,module,exports){"use strict";var clear=require("es5-ext/array/#/clear"),assign=require("es5-ext/object/assign"),callable=require("es5-ext/object/valid-callable"),value=require("es5-ext/object/valid-value"),d=require("d"),autoBind=require("d/auto-bind"),Symbol=require("es6-symbol");var defineProperty=Object.defineProperty,defineProperties=Object.defineProperties,Iterator;module.exports=Iterator=function(list,context){if(!(this instanceof Iterator))throw new TypeError("Constructor requires 'new'");defineProperties(this,{__list__:d("w",value(list)),__context__:d("w",context),__nextIndex__:d("w",0)});if(!context)return;callable(context.on);context.on("_add",this._onAdd);context.on("_delete",this._onDelete);context.on("_clear",this._onClear)};delete Iterator.prototype.constructor;defineProperties(Iterator.prototype,assign({_next:d(function(){var i;if(!this.__list__)return undefined;if(this.__redo__){i=this.__redo__.shift();if(i!==undefined)return i}if(this.__nextIndex__=this.__nextIndex__)return;++this.__nextIndex__;if(!this.__redo__){defineProperty(this,"__redo__",d("c",[index]));return}this.__redo__.forEach(function(redo,i){if(redo>=index)this.__redo__[i]=++redo},this);this.__redo__.push(index)}),_onDelete:d(function(index){var i;if(index>=this.__nextIndex__)return;--this.__nextIndex__;if(!this.__redo__)return;i=this.__redo__.indexOf(index);if(i!==-1)this.__redo__.splice(i,1);this.__redo__.forEach(function(redo,j){if(redo>index)this.__redo__[j]=--redo},this)}),_onClear:d(function(){if(this.__redo__)clear.call(this.__redo__);this.__nextIndex__=0})})));defineProperty(Iterator.prototype,Symbol.iterator,d(function(){return this}))},{d:15,"d/auto-bind":14,"es5-ext/array/#/clear":17,"es5-ext/object/assign":34,"es5-ext/object/valid-callable":51,"es5-ext/object/valid-value":52,"es6-symbol":70}],61:[function(require,module,exports){"use strict";var isArguments=require("es5-ext/function/is-arguments"),isValue=require("es5-ext/object/is-value"),isString=require("es5-ext/string/is-string");var iteratorSymbol=require("es6-symbol").iterator,isArray=Array.isArray;module.exports=function(value){if(!isValue(value))return false;if(isArray(value))return true;if(isString(value))return true;if(isArguments(value))return true;return typeof value[iteratorSymbol]==="function"}},{"es5-ext/function/is-arguments":22,"es5-ext/object/is-value":41,"es5-ext/string/is-string":56,"es6-symbol":70}],62:[function(require,module,exports){"use strict";var setPrototypeOf=require("es5-ext/object/set-prototype-of"),d=require("d"),Symbol=require("es6-symbol"),Iterator=require("./");var defineProperty=Object.defineProperty,StringIterator;StringIterator=module.exports=function(str){if(!(this instanceof StringIterator))throw new TypeError("Constructor requires 'new'");str=String(str);Iterator.call(this,str);defineProperty(this,"__length__",d("",str.length))};if(setPrototypeOf)setPrototypeOf(StringIterator,Iterator);delete StringIterator.prototype.constructor;StringIterator.prototype=Object.create(Iterator.prototype,{_next:d(function(){if(!this.__list__)return undefined;if(this.__nextIndex__=55296&&code<=56319)return char+this.__list__[this.__nextIndex__++];return char})});defineProperty(StringIterator.prototype,Symbol.toStringTag,d("c","String Iterator"))},{"./":60,d:15,"es5-ext/object/set-prototype-of":48,"es6-symbol":70}],63:[function(require,module,exports){"use strict";var isIterable=require("./is-iterable");module.exports=function(value){if(!isIterable(value))throw new TypeError(value+" is not iterable");return value}},{"./is-iterable":61}],64:[function(require,module,exports){"use strict";module.exports=require("./is-implemented")()?Map:require("./polyfill")},{"./is-implemented":65,"./polyfill":69}],65:[function(require,module,exports){"use strict";module.exports=function(){var map,iterator,result;if(typeof Map!=="function")return false;try{map=new Map([["raz","one"],["dwa","two"],["trzy","three"]])}catch(e){return false}if(String(map)!=="[object Map]")return false;if(map.size!==3)return false;if(typeof map.clear!=="function")return false;if(typeof map.delete!=="function")return false;if(typeof map.entries!=="function")return false;if(typeof map.forEach!=="function")return false;if(typeof map.get!=="function")return false;if(typeof map.has!=="function")return false;if(typeof map.keys!=="function")return false;if(typeof map.set!=="function")return false;if(typeof map.values!=="function")return false;iterator=map.entries();result=iterator.next();if(result.done!==false)return false;if(!result.value)return false;if(result.value[0]!=="raz")return false;if(result.value[1]!=="one")return false;return true}},{}],66:[function(require,module,exports){"use strict";module.exports=function(){if(typeof Map==="undefined")return false;return Object.prototype.toString.call(new Map)==="[object Map]"}()},{}],67:[function(require,module,exports){"use strict";module.exports=require("es5-ext/object/primitive-set")("key","value","key+value")},{"es5-ext/object/primitive-set":47}],68:[function(require,module,exports){"use strict";var setPrototypeOf=require("es5-ext/object/set-prototype-of"),d=require("d"),Iterator=require("es6-iterator"),toStringTagSymbol=require("es6-symbol").toStringTag,kinds=require("./iterator-kinds"),defineProperties=Object.defineProperties,unBind=Iterator.prototype._unBind,MapIterator;MapIterator=module.exports=function(map,kind){if(!(this instanceof MapIterator))return new MapIterator(map,kind);Iterator.call(this,map.__mapKeysData__,map);if(!kind||!kinds[kind])kind="key+value";defineProperties(this,{__kind__:d("",kind),__values__:d("w",map.__mapValuesData__)})};if(setPrototypeOf)setPrototypeOf(MapIterator,Iterator);MapIterator.prototype=Object.create(Iterator.prototype,{constructor:d(MapIterator),_resolve:d(function(i){if(this.__kind__==="value")return this.__values__[i];if(this.__kind__==="key")return this.__list__[i];return[this.__list__[i],this.__values__[i]]}),_unBind:d(function(){this.__values__=null;unBind.call(this)}),toString:d(function(){return"[object Map Iterator]"})});Object.defineProperty(MapIterator.prototype,toStringTagSymbol,d("c","Map Iterator"))},{"./iterator-kinds":67,d:15,"es5-ext/object/set-prototype-of":48,"es6-iterator":60,"es6-symbol":70}],69:[function(require,module,exports){"use strict";var clear=require("es5-ext/array/#/clear"),eIndexOf=require("es5-ext/array/#/e-index-of"),setPrototypeOf=require("es5-ext/object/set-prototype-of"),callable=require("es5-ext/object/valid-callable"),validValue=require("es5-ext/object/valid-value"),d=require("d"),ee=require("event-emitter"),Symbol=require("es6-symbol"),iterator=require("es6-iterator/valid-iterable"),forOf=require("es6-iterator/for-of"),Iterator=require("./lib/iterator"),isNative=require("./is-native-implemented"),call=Function.prototype.call,defineProperties=Object.defineProperties,getPrototypeOf=Object.getPrototypeOf,MapPoly;module.exports=MapPoly=function(){var iterable=arguments[0],keys,values,self;if(!(this instanceof MapPoly))throw new TypeError("Constructor requires 'new'");if(isNative&&setPrototypeOf&&Map!==MapPoly){self=setPrototypeOf(new Map,getPrototypeOf(this))}else{self=this}if(iterable!=null)iterator(iterable);defineProperties(self,{__mapKeysData__:d("c",keys=[]),__mapValuesData__:d("c",values=[])});if(!iterable)return self;forOf(iterable,function(value){var key=validValue(value)[0];value=value[1];if(eIndexOf.call(keys,key)!==-1)return;keys.push(key);values.push(value)},self);return self};if(isNative){if(setPrototypeOf)setPrototypeOf(MapPoly,Map);MapPoly.prototype=Object.create(Map.prototype,{constructor:d(MapPoly)})}ee(defineProperties(MapPoly.prototype,{clear:d(function(){if(!this.__mapKeysData__.length)return;clear.call(this.__mapKeysData__);clear.call(this.__mapValuesData__);this.emit("_clear")}),delete:d(function(key){var index=eIndexOf.call(this.__mapKeysData__,key);if(index===-1)return false;this.__mapKeysData__.splice(index,1);this.__mapValuesData__.splice(index,1);this.emit("_delete",index,key);return true}),entries:d(function(){return new Iterator(this,"key+value")}),forEach:d(function(cb){var thisArg=arguments[1],iterator,result;callable(cb);iterator=this.entries();result=iterator._next();while(result!==undefined){call.call(cb,thisArg,this.__mapValuesData__[result],this.__mapKeysData__[result],this);result=iterator._next()}}),get:d(function(key){var index=eIndexOf.call(this.__mapKeysData__,key);if(index===-1)return;return this.__mapValuesData__[index]}),has:d(function(key){return eIndexOf.call(this.__mapKeysData__,key)!==-1}),keys:d(function(){return new Iterator(this,"key")}),set:d(function(key,value){var index=eIndexOf.call(this.__mapKeysData__,key),emit;if(index===-1){index=this.__mapKeysData__.push(key)-1;emit=true}this.__mapValuesData__[index]=value;if(emit)this.emit("_add",index,key);return this}),size:d.gs(function(){return this.__mapKeysData__.length}),values:d(function(){return new Iterator(this,"value")}),toString:d(function(){return"[object Map]"})}));Object.defineProperty(MapPoly.prototype,Symbol.iterator,d(function(){return this.entries()}));Object.defineProperty(MapPoly.prototype,Symbol.toStringTag,d("c","Map"))},{"./is-native-implemented":66,"./lib/iterator":68,d:15,"es5-ext/array/#/clear":17,"es5-ext/array/#/e-index-of":18,"es5-ext/object/set-prototype-of":48,"es5-ext/object/valid-callable":51,"es5-ext/object/valid-value":52,"es6-iterator/for-of":58,"es6-iterator/valid-iterable":63,"es6-symbol":70,"event-emitter":78}],70:[function(require,module,exports){"use strict";module.exports=require("./is-implemented")()?require("ext/global-this").Symbol:require("./polyfill")},{"./is-implemented":71,"./polyfill":76,"ext/global-this":81}],71:[function(require,module,exports){"use strict";var global=require("ext/global-this"),validTypes={object:true,symbol:true};module.exports=function(){var Symbol=global.Symbol;var symbol;if(typeof Symbol!=="function")return false;symbol=Symbol("test symbol");try{String(symbol)}catch(e){return false}if(!validTypes[typeof Symbol.iterator])return false;if(!validTypes[typeof Symbol.toPrimitive])return false;if(!validTypes[typeof Symbol.toStringTag])return false;return true}},{"ext/global-this":81}],72:[function(require,module,exports){"use strict";module.exports=function(value){if(!value)return false;if(typeof value==="symbol")return true;if(!value.constructor)return false;if(value.constructor.name!=="Symbol")return false;return value[value.constructor.toStringTag]==="Symbol"}},{}],73:[function(require,module,exports){"use strict";var d=require("d");var create=Object.create,defineProperty=Object.defineProperty,objPrototype=Object.prototype;var created=create(null);module.exports=function(desc){var postfix=0,name,ie11BugWorkaround;while(created[desc+(postfix||"")])++postfix;desc+=postfix||"";created[desc]=true;name="@@"+desc;defineProperty(objPrototype,name,d.gs(null,function(value){if(ie11BugWorkaround)return;ie11BugWorkaround=true;defineProperty(this,name,d(value));ie11BugWorkaround=false}));return name}},{d:15}],74:[function(require,module,exports){"use strict";var d=require("d"),NativeSymbol=require("ext/global-this").Symbol;module.exports=function(SymbolPolyfill){return Object.defineProperties(SymbolPolyfill,{hasInstance:d("",NativeSymbol&&NativeSymbol.hasInstance||SymbolPolyfill("hasInstance")),isConcatSpreadable:d("",NativeSymbol&&NativeSymbol.isConcatSpreadable||SymbolPolyfill("isConcatSpreadable")),iterator:d("",NativeSymbol&&NativeSymbol.iterator||SymbolPolyfill("iterator")),match:d("",NativeSymbol&&NativeSymbol.match||SymbolPolyfill("match")),replace:d("",NativeSymbol&&NativeSymbol.replace||SymbolPolyfill("replace")),search:d("",NativeSymbol&&NativeSymbol.search||SymbolPolyfill("search")),species:d("",NativeSymbol&&NativeSymbol.species||SymbolPolyfill("species")),split:d("",NativeSymbol&&NativeSymbol.split||SymbolPolyfill("split")),toPrimitive:d("",NativeSymbol&&NativeSymbol.toPrimitive||SymbolPolyfill("toPrimitive")),toStringTag:d("",NativeSymbol&&NativeSymbol.toStringTag||SymbolPolyfill("toStringTag")),unscopables:d("",NativeSymbol&&NativeSymbol.unscopables||SymbolPolyfill("unscopables"))})}},{d:15,"ext/global-this":81}],75:[function(require,module,exports){"use strict";var d=require("d"),validateSymbol=require("../../../validate-symbol");var registry=Object.create(null);module.exports=function(SymbolPolyfill){return Object.defineProperties(SymbolPolyfill,{for:d(function(key){if(registry[key])return registry[key];return registry[key]=SymbolPolyfill(String(key))}),keyFor:d(function(symbol){var key;validateSymbol(symbol);for(key in registry){if(registry[key]===symbol)return key}return undefined})})}},{"../../../validate-symbol":77,d:15}],76:[function(require,module,exports){"use strict";var d=require("d"),validateSymbol=require("./validate-symbol"),NativeSymbol=require("ext/global-this").Symbol,generateName=require("./lib/private/generate-name"),setupStandardSymbols=require("./lib/private/setup/standard-symbols"),setupSymbolRegistry=require("./lib/private/setup/symbol-registry");var create=Object.create,defineProperties=Object.defineProperties,defineProperty=Object.defineProperty;var SymbolPolyfill,HiddenSymbol,isNativeSafe;if(typeof NativeSymbol==="function"){try{String(NativeSymbol());isNativeSafe=true}catch(ignore){}}else{NativeSymbol=null}HiddenSymbol=function Symbol(description){if(this instanceof HiddenSymbol)throw new TypeError("Symbol is not a constructor");return SymbolPolyfill(description)};module.exports=SymbolPolyfill=function Symbol(description){var symbol;if(this instanceof Symbol)throw new TypeError("Symbol is not a constructor");if(isNativeSafe)return NativeSymbol(description);symbol=create(HiddenSymbol.prototype);description=description===undefined?"":String(description);return defineProperties(symbol,{__description__:d("",description),__name__:d("",generateName(description))})};setupStandardSymbols(SymbolPolyfill);setupSymbolRegistry(SymbolPolyfill);defineProperties(HiddenSymbol.prototype,{constructor:d(SymbolPolyfill),toString:d("",function(){return this.__name__})});defineProperties(SymbolPolyfill.prototype,{toString:d(function(){return"Symbol ("+validateSymbol(this).__description__+")"}),valueOf:d(function(){return validateSymbol(this)})});defineProperty(SymbolPolyfill.prototype,SymbolPolyfill.toPrimitive,d("",function(){var symbol=validateSymbol(this);if(typeof symbol==="symbol")return symbol;return symbol.toString()}));defineProperty(SymbolPolyfill.prototype,SymbolPolyfill.toStringTag,d("c","Symbol"));defineProperty(HiddenSymbol.prototype,SymbolPolyfill.toStringTag,d("c",SymbolPolyfill.prototype[SymbolPolyfill.toStringTag]));defineProperty(HiddenSymbol.prototype,SymbolPolyfill.toPrimitive,d("c",SymbolPolyfill.prototype[SymbolPolyfill.toPrimitive]))},{"./lib/private/generate-name":73,"./lib/private/setup/standard-symbols":74,"./lib/private/setup/symbol-registry":75,"./validate-symbol":77,d:15,"ext/global-this":81}],77:[function(require,module,exports){"use strict";var isSymbol=require("./is-symbol");module.exports=function(value){if(!isSymbol(value))throw new TypeError(value+" is not a symbol");return value}},{"./is-symbol":72}],78:[function(require,module,exports){"use strict";var d=require("d"),callable=require("es5-ext/object/valid-callable"),apply=Function.prototype.apply,call=Function.prototype.call,create=Object.create,defineProperty=Object.defineProperty,defineProperties=Object.defineProperties,hasOwnProperty=Object.prototype.hasOwnProperty,descriptor={configurable:true,enumerable:false,writable:true},on,once,off,emit,methods,descriptors,base;on=function(type,listener){var data;callable(listener);if(!hasOwnProperty.call(this,"__ee__")){data=descriptor.value=create(null);defineProperty(this,"__ee__",descriptor);descriptor.value=null}else{data=this.__ee__}if(!data[type])data[type]=listener;else if(typeof data[type]==="object")data[type].push(listener);else data[type]=[data[type],listener];return this};once=function(type,listener){var once,self;callable(listener);self=this;on.call(this,type,once=function(){off.call(self,type,once);apply.call(listener,this,arguments)});once.__eeOnceListener__=listener;return this};off=function(type,listener){var data,listeners,candidate,i;callable(listener);if(!hasOwnProperty.call(this,"__ee__"))return this;data=this.__ee__;if(!data[type])return this;listeners=data[type];if(typeof listeners==="object"){for(i=0;candidate=listeners[i];++i){if(candidate===listener||candidate.__eeOnceListener__===listener){if(listeners.length===2)data[type]=listeners[i?0:1];else listeners.splice(i,1)}}}else{if(listeners===listener||listeners.__eeOnceListener__===listener){delete data[type]}}return this};emit=function(type){var i,l,listener,listeners,args;if(!hasOwnProperty.call(this,"__ee__"))return;listeners=this.__ee__[type];if(!listeners)return;if(typeof listeners==="object"){l=arguments.length;args=new Array(l-1);for(i=1;i1)er=arguments[1];if(er instanceof Error){throw er}else{var err=new Error('Unhandled "error" event. ('+er+")");err.context=er;throw err}return false}handler=events[type];if(!handler)return false;var isFn=typeof handler==="function";len=arguments.length;switch(len){case 1:emitNone(handler,isFn,this);break;case 2:emitOne(handler,isFn,this,arguments[1]);break;case 3:emitTwo(handler,isFn,this,arguments[1],arguments[2]);break;case 4:emitThree(handler,isFn,this,arguments[1],arguments[2],arguments[3]);break;default:args=new Array(len-1);for(i=1;i0&&existing.length>m){existing.warned=true;var w=new Error("Possible EventEmitter memory leak detected. "+existing.length+' "'+String(type)+'" listeners '+"added. Use emitter.setMaxListeners() to "+"increase limit.");w.name="MaxListenersExceededWarning";w.emitter=target;w.type=type;w.count=existing.length;if(typeof console==="object"&&console.warn){console.warn("%s: %s",w.name,w.message)}}}}return target}EventEmitter.prototype.addListener=function addListener(type,listener){return _addListener(this,type,listener,false)};EventEmitter.prototype.on=EventEmitter.prototype.addListener;EventEmitter.prototype.prependListener=function prependListener(type,listener){return _addListener(this,type,listener,true)};function onceWrapper(){if(!this.fired){this.target.removeListener(this.type,this.wrapFn);this.fired=true;switch(arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:var args=new Array(arguments.length);for(var i=0;i=0;i--){if(list[i]===listener||list[i].listener===listener){originalListener=list[i].listener;position=i;break}}if(position<0)return this;if(position===0)list.shift();else spliceOne(list,position);if(list.length===1)events[type]=list[0];if(events.removeListener)this.emit("removeListener",type,originalListener||listener)}return this};EventEmitter.prototype.removeAllListeners=function removeAllListeners(type){var listeners,events,i;events=this._events;if(!events)return this;if(!events.removeListener){if(arguments.length===0){this._events=objectCreate(null);this._eventsCount=0}else if(events[type]){if(--this._eventsCount===0)this._events=objectCreate(null);else delete events[type]}return this}if(arguments.length===0){var keys=objectKeys(events);var key;for(i=0;i=0;i--){this.removeListener(type,listeners[i])}}return this};function _listeners(target,type,unwrap){var events=target._events;if(!events)return[];var evlistener=events[type];if(!evlistener)return[];if(typeof evlistener==="function")return unwrap?[evlistener.listener||evlistener]:[evlistener];return unwrap?unwrapListeners(evlistener):arrayClone(evlistener,evlistener.length)}EventEmitter.prototype.listeners=function listeners(type){return _listeners(this,type,true)};EventEmitter.prototype.rawListeners=function rawListeners(type){return _listeners(this,type,false)};EventEmitter.listenerCount=function(emitter,type){if(typeof emitter.listenerCount==="function"){return emitter.listenerCount(type)}else{return listenerCount.call(emitter,type)}};EventEmitter.prototype.listenerCount=listenerCount;function listenerCount(type){var events=this._events;if(events){var evlistener=events[type];if(typeof evlistener==="function"){return 1}else if(evlistener){return evlistener.length}}return 0}EventEmitter.prototype.eventNames=function eventNames(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};function spliceOne(list,index){for(var i=index,k=i+1,n=list.length;k>1;var nBits=-7;var i=isLE?nBytes-1:0;var d=isLE?-1:1;var s=buffer[offset+i];i+=d;e=s&(1<<-nBits)-1;s>>=-nBits;nBits+=eLen;for(;nBits>0;e=e*256+buffer[offset+i],i+=d,nBits-=8){}m=e&(1<<-nBits)-1;e>>=-nBits;nBits+=mLen;for(;nBits>0;m=m*256+buffer[offset+i],i+=d,nBits-=8){}if(e===0){e=1-eBias}else if(e===eMax){return m?NaN:(s?-1:1)*Infinity}else{m=m+Math.pow(2,mLen);e=e-eBias}return(s?-1:1)*m*Math.pow(2,e-mLen)};exports.write=function(buffer,value,offset,isLE,mLen,nBytes){var e,m,c;var eLen=nBytes*8-mLen-1;var eMax=(1<>1;var rt=mLen===23?Math.pow(2,-24)-Math.pow(2,-77):0;var i=isLE?0:nBytes-1;var d=isLE?1:-1;var s=value<0||value===0&&1/value<0?1:0;value=Math.abs(value);if(isNaN(value)||value===Infinity){m=isNaN(value)?1:0;e=eMax}else{e=Math.floor(Math.log(value)/Math.LN2);if(value*(c=Math.pow(2,-e))<1){e--;c*=2}if(e+eBias>=1){value+=rt/c}else{value+=rt*Math.pow(2,1-eBias)}if(value*c>=2){e++;c/=2}if(e+eBias>=eMax){m=0;e=eMax}else if(e+eBias>=1){m=(value*c-1)*Math.pow(2,mLen);e=e+eBias}else{m=value*Math.pow(2,eBias-1)*Math.pow(2,mLen);e=0}}for(;mLen>=8;buffer[offset+i]=m&255,i+=d,m/=256,mLen-=8){}e=e<0;buffer[offset+i]=e&255,i+=d,e/=256,eLen-=8){}buffer[offset+i-d]|=s*128}},{}],84:[function(require,module,exports){if(typeof Object.create==="function"){module.exports=function inherits(ctor,superCtor){if(superCtor){ctor.super_=superCtor;ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:false,writable:true,configurable:true}})}}}else{module.exports=function inherits(ctor,superCtor){if(superCtor){ctor.super_=superCtor;var TempCtor=function(){};TempCtor.prototype=superCtor.prototype;ctor.prototype=new TempCtor;ctor.prototype.constructor=ctor}}}},{}],85:[function(require,module,exports){module.exports=function(obj){return obj!=null&&(isBuffer(obj)||isSlowBuffer(obj)||!!obj._isBuffer)};function isBuffer(obj){return!!obj.constructor&&typeof obj.constructor.isBuffer==="function"&&obj.constructor.isBuffer(obj)}function isSlowBuffer(obj){return typeof obj.readFloatLE==="function"&&typeof obj.slice==="function"&&isBuffer(obj.slice(0,0))}},{}],86:[function(require,module,exports){var toString={}.toString;module.exports=Array.isArray||function(arr){return toString.call(arr)=="[object Array]"}},{}],87:[function(require,module,exports){"use strict";var Buffer=require("safe-buffer").Buffer;var protocol=module.exports;protocol.types={0:"reserved",1:"connect",2:"connack",3:"publish",4:"puback",5:"pubrec",6:"pubrel",7:"pubcomp",8:"subscribe",9:"suback",10:"unsubscribe",11:"unsuback",12:"pingreq",13:"pingresp",14:"disconnect",15:"reserved"};protocol.codes={};for(var k in protocol.types){var v=protocol.types[k];protocol.codes[v]=k}protocol.CMD_SHIFT=4;protocol.CMD_MASK=240;protocol.DUP_MASK=8;protocol.QOS_MASK=3;protocol.QOS_SHIFT=1;protocol.RETAIN_MASK=1;protocol.LENGTH_MASK=127;protocol.LENGTH_FIN_MASK=128;protocol.SESSIONPRESENT_MASK=1;protocol.SESSIONPRESENT_HEADER=Buffer.from([protocol.SESSIONPRESENT_MASK]);protocol.CONNACK_HEADER=Buffer.from([protocol.codes["connack"]<>8,0);buffer.writeUInt8(i&255,0+1);return buffer}function generateCache(){for(var i=0;i0)&&this[this._states[this._stateCounter]]()&&!this.error){this._stateCounter++;if(this._stateCounter>=this._states.length)this._stateCounter=0}return this._list.length};Parser.prototype._parseHeader=function(){var zero=this._list.readUInt8(0);this.packet.cmd=constants.types[zero>>constants.CMD_SHIFT];this.packet.retain=(zero&constants.RETAIN_MASK)!==0;this.packet.qos=zero>>constants.QOS_SHIFT&constants.QOS_MASK;this.packet.dup=(zero&constants.DUP_MASK)!==0;this._list.consume(1);return true};Parser.prototype._parseLength=function(){var bytes=0;var mul=1;var length=0;var result=true;var current;while(bytes<5){current=this._list.readUInt8(bytes++);length+=mul*(current&constants.LENGTH_MASK);mul*=128;if((current&constants.LENGTH_FIN_MASK)===0)break;if(this._list.length<=bytes){result=false;break}}if(result){this.packet.length=length;this._list.consume(bytes)}return result};Parser.prototype._parsePayload=function(){var result=false;if(this.packet.length===0||this._list.length>=this.packet.length){this._pos=0;switch(this.packet.cmd){case"connect":this._parseConnect();break;case"connack":this._parseConnack();break;case"publish":this._parsePublish();break;case"puback":case"pubrec":case"pubrel":case"pubcomp":this._parseMessageId();break;case"subscribe":this._parseSubscribe();break;case"suback":this._parseSuback();break;case"unsubscribe":this._parseUnsubscribe();break;case"unsuback":this._parseUnsuback();break;case"pingreq":case"pingresp":case"disconnect":break;default:this._emitError(new Error("Not supported"))}result=true}return result};Parser.prototype._parseConnect=function(){var protocolId;var clientId;var topic;var payload;var password;var username;var flags={};var packet=this.packet;protocolId=this._parseString();if(protocolId===null)return this._emitError(new Error("Cannot parse protocolId"));if(protocolId!=="MQTT"&&protocolId!=="MQIsdp"){return this._emitError(new Error("Invalid protocolId"))}packet.protocolId=protocolId;if(this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));packet.protocolVersion=this._list.readUInt8(this._pos);if(packet.protocolVersion!==3&&packet.protocolVersion!==4){return this._emitError(new Error("Invalid protocol version"))}this._pos++;if(this._pos>=this._list.length){return this._emitError(new Error("Packet too short"))}flags.username=this._list.readUInt8(this._pos)&constants.USERNAME_MASK;flags.password=this._list.readUInt8(this._pos)&constants.PASSWORD_MASK;flags.will=this._list.readUInt8(this._pos)&constants.WILL_FLAG_MASK;if(flags.will){packet.will={};packet.will.retain=(this._list.readUInt8(this._pos)&constants.WILL_RETAIN_MASK)!==0;packet.will.qos=(this._list.readUInt8(this._pos)&constants.WILL_QOS_MASK)>>constants.WILL_QOS_SHIFT}packet.clean=(this._list.readUInt8(this._pos)&constants.CLEAN_SESSION_MASK)!==0;this._pos++;packet.keepalive=this._parseNum();if(packet.keepalive===-1)return this._emitError(new Error("Packet too short"));clientId=this._parseString();if(clientId===null)return this._emitError(new Error("Packet too short"));packet.clientId=clientId;if(flags.will){topic=this._parseString();if(topic===null)return this._emitError(new Error("Cannot parse will topic"));packet.will.topic=topic;payload=this._parseBuffer();if(payload===null)return this._emitError(new Error("Cannot parse will payload"));packet.will.payload=payload}if(flags.username){username=this._parseString();if(username===null)return this._emitError(new Error("Cannot parse username"));packet.username=username}if(flags.password){password=this._parseBuffer();if(password===null)return this._emitError(new Error("Cannot parse password"));packet.password=password}return packet};Parser.prototype._parseConnack=function(){var packet=this.packet;if(this._list.length<2)return null;packet.sessionPresent=!!(this._list.readUInt8(this._pos++)&constants.SESSIONPRESENT_MASK);packet.returnCode=this._list.readUInt8(this._pos);if(packet.returnCode===-1)return this._emitError(new Error("Cannot parse return code"))};Parser.prototype._parsePublish=function(){var packet=this.packet;packet.topic=this._parseString();if(packet.topic===null)return this._emitError(new Error("Cannot parse topic"));if(packet.qos>0)if(!this._parseMessageId()){return}packet.payload=this._list.slice(this._pos,packet.length)};Parser.prototype._parseSubscribe=function(){var packet=this.packet;var topic;var qos;if(packet.qos!==1){return this._emitError(new Error("Wrong subscribe header"))}packet.subscriptions=[];if(!this._parseMessageId()){return}while(this._pos=packet.length)return this._emitError(new Error("Malformed Subscribe Payload"));qos=this._list.readUInt8(this._pos++);packet.subscriptions.push({topic:topic,qos:qos})}};Parser.prototype._parseSuback=function(){this.packet.granted=[];if(!this._parseMessageId()){return}while(this._posthis._list.length||end>this.packet.length)return null;result=this._list.toString("utf8",this._pos,end);this._pos+=length;return result};Parser.prototype._parseBuffer=function(){var length=this._parseNum();var result;var end=length+this._pos;if(length===-1||end>this._list.length||end>this.packet.length)return null;result=this._list.slice(this._pos,end);this._pos+=length;return result};Parser.prototype._parseNum=function(){if(this._list.length-this._pos<2)return-1;var result=this._list.readUInt16BE(this._pos);this._pos+=2;return result};Parser.prototype._newPacket=function(){if(this.packet){this._list.consume(this.packet.length);this.emit("packet",this.packet)}this.packet=new Packet;return true};Parser.prototype._emitError=function(err){this.error=err;this.emit("error",err)};module.exports=Parser},{"./constants":87,"./packet":91,bl:10,events:79,inherits:84}],93:[function(require,module,exports){"use strict";var protocol=require("./constants");var Buffer=require("safe-buffer").Buffer;var empty=Buffer.allocUnsafe(0);var zeroBuf=Buffer.from([0]);var numbers=require("./numbers");var nextTick=require("process-nextick-args").nextTick;var numCache=numbers.cache;var generateNumber=numbers.generateNumber;var generateCache=numbers.generateCache;var writeNumber=writeNumberCached;var toGenerate=true;function generate(packet,stream){if(stream.cork){stream.cork();nextTick(uncork,stream)}if(toGenerate){toGenerate=false;generateCache()}switch(packet.cmd){case"connect":return connect(packet,stream);case"connack":return connack(packet,stream);case"publish":return publish(packet,stream);case"puback":case"pubrec":case"pubrel":case"pubcomp":case"unsuback":return confirmation(packet,stream);case"subscribe":return subscribe(packet,stream);case"suback":return suback(packet,stream);case"unsubscribe":return unsubscribe(packet,stream);case"pingreq":case"pingresp":case"disconnect":return emptyPacket(packet,stream);default:stream.emit("error",new Error("Unknown command"));return false}}Object.defineProperty(generate,"cacheNumbers",{get:function(){return writeNumber===writeNumberCached},set:function(value){if(value){if(!numCache||Object.keys(numCache).length===0)toGenerate=true;writeNumber=writeNumberCached}else{toGenerate=false;writeNumber=writeNumberGenerated}}});function uncork(stream){stream.uncork()}function connect(opts,stream){var settings=opts||{};var protocolId=settings.protocolId||"MQTT";var protocolVersion=settings.protocolVersion||4;var will=settings.will;var clean=settings.clean;var keepalive=settings.keepalive||0;var clientId=settings.clientId||"";var username=settings.username;var password=settings.password;if(clean===undefined)clean=true;var length=0;if(!protocolId||typeof protocolId!=="string"&&!Buffer.isBuffer(protocolId)){stream.emit("error",new Error("Invalid protocolId"));return false}else length+=protocolId.length+2;if(protocolVersion!==3&&protocolVersion!==4){stream.emit("error",new Error("Invalid protocol version"));return false}else length+=1;if((typeof clientId==="string"||Buffer.isBuffer(clientId))&&(clientId||protocolVersion===4)&&(clientId||clean)){length+=clientId.length+2}else{if(protocolVersion<4){stream.emit("error",new Error("clientId must be supplied before 3.1.1"));return false}if(clean*1===0){stream.emit("error",new Error("clientId must be given if cleanSession set to 0"));return false}}if(typeof keepalive!=="number"||keepalive<0||keepalive>65535||keepalive%1!==0){stream.emit("error",new Error("Invalid keepalive"));return false}else length+=2;length+=1;if(will){if(typeof will!=="object"){stream.emit("error",new Error("Invalid will"));return false}if(!will.topic||typeof will.topic!=="string"){stream.emit("error",new Error("Invalid will topic"));return false}else{length+=Buffer.byteLength(will.topic)+2}if(will.payload&&will.payload){if(will.payload.length>=0){if(typeof will.payload==="string"){length+=Buffer.byteLength(will.payload)+2}else{length+=will.payload.length+2}}else{stream.emit("error",new Error("Invalid will payload"));return false}}else{length+=2}}var providedUsername=false;if(username!=null){if(isStringOrBuffer(username)){providedUsername=true;length+=Buffer.byteLength(username)+2}else{stream.emit("error",new Error("Invalid username"));return false}}if(password!=null){if(!providedUsername){stream.emit("error",new Error("Username is required to use password"));return false}if(isStringOrBuffer(password)){length+=byteLength(password)+2}else{stream.emit("error",new Error("Invalid password"));return false}}stream.write(protocol.CONNECT_HEADER);writeLength(stream,length);writeStringOrBuffer(stream,protocolId);stream.write(protocolVersion===4?protocol.VERSION4:protocol.VERSION3);var flags=0;flags|=username!=null?protocol.USERNAME_MASK:0;flags|=password!=null?protocol.PASSWORD_MASK:0;flags|=will&&will.retain?protocol.WILL_RETAIN_MASK:0;flags|=will&&will.qos?will.qos<0)writeNumber(stream,id);return stream.write(payload)}function confirmation(opts,stream){var settings=opts||{};var type=settings.cmd||"puback";var id=settings.messageId;var dup=settings.dup&&type==="pubrel"?protocol.DUP_MASK:0;var qos=0;if(type==="pubrel")qos=1;if(typeof id!=="number"){stream.emit("error",new Error("Invalid messageId"));return false}stream.write(protocol.ACKS[type][qos][dup][0]);writeLength(stream,2);return writeNumber(stream,id)}function subscribe(opts,stream){var settings=opts||{};var dup=settings.dup?protocol.DUP_MASK:0;var id=settings.messageId;var subs=settings.subscriptions;var length=0;if(typeof id!=="number"){stream.emit("error",new Error("Invalid messageId"));return false}else length+=2;if(typeof subs==="object"&&subs.length){for(var i=0;i=0&&length<128)return 1;else if(length>=128&&length<16384)return 2;else if(length>=16384&&length<2097152)return 3;else if(length>=2097152&&length<268435456)return 4;else return 0}function genBufLength(length){var digit=0;var pos=0;var buffer=Buffer.allocUnsafe(calcLengthLength(length));do{digit=length%128|0;length=length/128|0;if(length>0)digit=digit|128;buffer.writeUInt8(digit,pos++)}while(length>0);return buffer}var lengthCache={};function writeLength(stream,length){var buffer=lengthCache[length];if(!buffer){buffer=genBufLength(length);if(length<16384)lengthCache[length]=buffer}stream.write(buffer)}function writeString(stream,string){var strlen=Buffer.byteLength(string);writeNumber(stream,strlen);stream.write(string,"utf8")}function writeNumberCached(stream,number){return stream.write(numCache[number])}function writeNumberGenerated(stream,number){return stream.write(generateNumber(number))}function writeStringOrBuffer(stream,toWrite){if(typeof toWrite==="string"){writeString(stream,toWrite)}else if(toWrite){writeNumber(stream,toWrite.length);stream.write(toWrite)}else writeNumber(stream,0)}function byteLength(bufOrString){if(!bufOrString)return 0;else if(bufOrString instanceof Buffer)return bufOrString.length;else return Buffer.byteLength(bufOrString)}function isStringOrBuffer(field){return typeof field==="string"||field instanceof Buffer}module.exports=generate},{"./constants":87,"./numbers":90,"process-nextick-args":95,"safe-buffer":114}],94:[function(require,module,exports){var wrappy=require("wrappy");module.exports=wrappy(once);module.exports.strict=wrappy(onceStrict);once.proto=once(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return once(this)},configurable:true});Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return onceStrict(this)},configurable:true})});function once(fn){var f=function(){if(f.called)return f.value;f.called=true;return f.value=fn.apply(this,arguments)};f.called=false;return f}function onceStrict(fn){var f=function(){if(f.called)throw new Error(f.onceError);f.called=true;return f.value=fn.apply(this,arguments)};var name=fn.name||"Function wrapped with `once`";f.onceError=name+" shouldn't be called more than once";f.called=false;return f}},{wrappy:164}],95:[function(require,module,exports){(function(process){(function(){"use strict";if(typeof process==="undefined"||!process.version||process.version.indexOf("v0.")===0||process.version.indexOf("v1.")===0&&process.version.indexOf("v1.8.")!==0){module.exports={nextTick:nextTick}}else{module.exports=process}function nextTick(fn,arg1,arg2,arg3){if(typeof fn!=="function"){throw new TypeError('"callback" argument must be a function')}var len=arguments.length;var args,i;switch(len){case 0:case 1:return process.nextTick(fn);case 2:return process.nextTick(function afterTickOne(){fn.call(null,arg1)});case 3:return process.nextTick(function afterTickTwo(){fn.call(null,arg1,arg2)});case 4:return process.nextTick(function afterTickThree(){fn.call(null,arg1,arg2,arg3)});default:args=new Array(len-1);i=0;while(i1){for(var i=1;i= 0x80 (not a basic code point)","invalid-input":"Invalid input"},baseMinusTMin=base-tMin,floor=Math.floor,stringFromCharCode=String.fromCharCode,key;function error(type){throw new RangeError(errors[type])}function map(array,fn){var length=array.length;var result=[];while(length--){result[length]=fn(array[length])}return result}function mapDomain(string,fn){var parts=string.split("@");var result="";if(parts.length>1){result=parts[0]+"@";string=parts[1]}string=string.replace(regexSeparators,".");var labels=string.split(".");var encoded=map(labels,fn).join(".");return result+encoded}function ucs2decode(string){var output=[],counter=0,length=string.length,value,extra;while(counter=55296&&value<=56319&&counter65535){value-=65536;output+=stringFromCharCode(value>>>10&1023|55296);value=56320|value&1023}output+=stringFromCharCode(value);return output}).join("")}function basicToDigit(codePoint){if(codePoint-48<10){return codePoint-22}if(codePoint-65<26){return codePoint-65}if(codePoint-97<26){return codePoint-97}return base}function digitToBasic(digit,flag){return digit+22+75*(digit<26)-((flag!=0)<<5)}function adapt(delta,numPoints,firstTime){var k=0;delta=firstTime?floor(delta/damp):delta>>1;delta+=floor(delta/numPoints);for(;delta>baseMinusTMin*tMax>>1;k+=base){delta=floor(delta/baseMinusTMin)}return floor(k+(baseMinusTMin+1)*delta/(delta+skew))}function decode(input){var output=[],inputLength=input.length,out,i=0,n=initialN,bias=initialBias,basic,j,index,oldi,w,k,digit,t,baseMinusT;basic=input.lastIndexOf(delimiter);if(basic<0){basic=0}for(j=0;j=128){error("not-basic")}output.push(input.charCodeAt(j))}for(index=basic>0?basic+1:0;index=inputLength){error("invalid-input")}digit=basicToDigit(input.charCodeAt(index++));if(digit>=base||digit>floor((maxInt-i)/w)){error("overflow")}i+=digit*w;t=k<=bias?tMin:k>=bias+tMax?tMax:k-bias;if(digitfloor(maxInt/baseMinusT)){error("overflow")}w*=baseMinusT}out=output.length+1;bias=adapt(i-oldi,out,oldi==0);if(floor(i/out)>maxInt-n){error("overflow")}n+=floor(i/out);i%=out;output.splice(i++,0,n)}return ucs2encode(output)}function encode(input){var n,delta,handledCPCount,basicLength,bias,j,m,q,k,t,currentValue,output=[],inputLength,handledCPCountPlusOne,baseMinusT,qMinusT;input=ucs2decode(input);inputLength=input.length;n=initialN;delta=0;bias=initialBias;for(j=0;j=n&¤tValuefloor((maxInt-delta)/handledCPCountPlusOne)){error("overflow")}delta+=(m-n)*handledCPCountPlusOne;n=m;for(j=0;jmaxInt){error("overflow")}if(currentValue==n){for(q=delta,k=base;;k+=base){t=k<=bias?tMin:k>=bias+tMax?tMax:k-bias;if(q0&&len>maxKeys){len=maxKeys}for(var i=0;i=0){kstr=x.substr(0,idx);vstr=x.substr(idx+1)}else{kstr=x;vstr=""}k=decodeURIComponent(kstr);v=decodeURIComponent(vstr);if(!hasOwnProperty(obj,k)){obj[k]=v}else if(isArray(obj[k])){obj[k].push(v)}else{obj[k]=[obj[k],v]}}return obj};var isArray=Array.isArray||function(xs){return Object.prototype.toString.call(xs)==="[object Array]"}},{}],99:[function(require,module,exports){"use strict";var stringifyPrimitive=function(v){switch(typeof v){case"string":return v;case"boolean":return v?"true":"false";case"number":return isFinite(v)?v:"";default:return""}};module.exports=function(obj,sep,eq,name){sep=sep||"&";eq=eq||"=";if(obj===null){obj=undefined}if(typeof obj==="object"){return map(objectKeys(obj),function(k){var ks=encodeURIComponent(stringifyPrimitive(k))+eq;if(isArray(obj[k])){return map(obj[k],function(v){return ks+encodeURIComponent(stringifyPrimitive(v))}).join(sep)}else{return ks+encodeURIComponent(stringifyPrimitive(obj[k]))}}).join(sep)}if(!name)return"";return encodeURIComponent(stringifyPrimitive(name))+eq+encodeURIComponent(stringifyPrimitive(obj))};var isArray=Array.isArray||function(xs){return Object.prototype.toString.call(xs)==="[object Array]"};function map(xs,f){if(xs.map)return xs.map(f);var res=[];for(var i=0;i0){if(typeof chunk!=="string"&&!state.objectMode&&Object.getPrototypeOf(chunk)!==Buffer.prototype){chunk=_uint8ArrayToBuffer(chunk)}if(addToFront){if(state.endEmitted)stream.emit("error",new Error("stream.unshift() after end event"));else addChunk(stream,state,chunk,true)}else if(state.ended){stream.emit("error",new Error("stream.push() after EOF"))}else{state.reading=false;if(state.decoder&&!encoding){chunk=state.decoder.write(chunk);if(state.objectMode||chunk.length!==0)addChunk(stream,state,chunk,false);else maybeReadMore(stream,state)}else{addChunk(stream,state,chunk,false)}}}else if(!addToFront){state.reading=false}}return needMoreData(state)}function addChunk(stream,state,chunk,addToFront){if(state.flowing&&state.length===0&&!state.sync){stream.emit("data",chunk);stream.read(0)}else{state.length+=state.objectMode?1:chunk.length;if(addToFront)state.buffer.unshift(chunk);else state.buffer.push(chunk);if(state.needReadable)emitReadable(stream)}maybeReadMore(stream,state)}function chunkInvalid(state,chunk){var er;if(!_isUint8Array(chunk)&&typeof chunk!=="string"&&chunk!==undefined&&!state.objectMode){er=new TypeError("Invalid non-string/buffer chunk")}return er}function needMoreData(state){return!state.ended&&(state.needReadable||state.length=MAX_HWM){n=MAX_HWM}else{n--;n|=n>>>1;n|=n>>>2;n|=n>>>4;n|=n>>>8;n|=n>>>16;n++}return n}function howMuchToRead(n,state){if(n<=0||state.length===0&&state.ended)return 0;if(state.objectMode)return 1;if(n!==n){if(state.flowing&&state.length)return state.buffer.head.data.length;else return state.length}if(n>state.highWaterMark)state.highWaterMark=computeNewHighWaterMark(n);if(n<=state.length)return n;if(!state.ended){state.needReadable=true;return 0}return state.length}Readable.prototype.read=function(n){debug("read",n);n=parseInt(n,10);var state=this._readableState;var nOrig=n;if(n!==0)state.emittedReadable=false;if(n===0&&state.needReadable&&(state.length>=state.highWaterMark||state.ended)){debug("read: emitReadable",state.length,state.ended);if(state.length===0&&state.ended)endReadable(this);else emitReadable(this);return null}n=howMuchToRead(n,state);if(n===0&&state.ended){if(state.length===0)endReadable(this);return null}var doRead=state.needReadable;debug("need readable",doRead);if(state.length===0||state.length-n0)ret=fromList(n,state);else ret=null;if(ret===null){state.needReadable=true;n=0}else{state.length-=n}if(state.length===0){if(!state.ended)state.needReadable=true;if(nOrig!==n&&state.ended)endReadable(this)}if(ret!==null)this.emit("data",ret);return ret};function onEofChunk(stream,state){if(state.ended)return;if(state.decoder){var chunk=state.decoder.end();if(chunk&&chunk.length){state.buffer.push(chunk);state.length+=state.objectMode?1:chunk.length}}state.ended=true;emitReadable(stream)}function emitReadable(stream){var state=stream._readableState;state.needReadable=false;if(!state.emittedReadable){debug("emitReadable",state.flowing);state.emittedReadable=true;if(state.sync)pna.nextTick(emitReadable_,stream);else emitReadable_(stream)}}function emitReadable_(stream){debug("emit readable");stream.emit("readable");flow(stream)}function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;pna.nextTick(maybeReadMore_,stream,state)}}function maybeReadMore_(stream,state){var len=state.length;while(!state.reading&&!state.flowing&&!state.ended&&state.length1&&indexOf(state.pipes,dest)!==-1)&&!cleanedUp){debug("false write response, pause",src._readableState.awaitDrain);src._readableState.awaitDrain++;increasedAwaitDrain=true}src.pause()}}function onerror(er){debug("onerror",er);unpipe();dest.removeListener("error",onerror);if(EElistenerCount(dest,"error")===0)dest.emit("error",er)}prependListener(dest,"error",onerror);function onclose(){dest.removeListener("finish",onfinish);unpipe()}dest.once("close",onclose);function onfinish(){debug("onfinish");dest.removeListener("close",onclose);unpipe()}dest.once("finish",onfinish);function unpipe(){debug("unpipe");src.unpipe(dest)}dest.emit("pipe",src);if(!state.flowing){debug("pipe resume");src.resume()}return dest};function pipeOnDrain(src){return function(){var state=src._readableState;debug("pipeOnDrain",state.awaitDrain);if(state.awaitDrain)state.awaitDrain--;if(state.awaitDrain===0&&EElistenerCount(src,"data")){state.flowing=true;flow(src)}}}Readable.prototype.unpipe=function(dest){var state=this._readableState;var unpipeInfo={hasUnpiped:false};if(state.pipesCount===0)return this;if(state.pipesCount===1){if(dest&&dest!==state.pipes)return this;if(!dest)dest=state.pipes;state.pipes=null;state.pipesCount=0;state.flowing=false;if(dest)dest.emit("unpipe",this,unpipeInfo);return this}if(!dest){var dests=state.pipes;var len=state.pipesCount;state.pipes=null;state.pipesCount=0;state.flowing=false;for(var i=0;i=state.length){if(state.decoder)ret=state.buffer.join("");else if(state.buffer.length===1)ret=state.buffer.head.data;else ret=state.buffer.concat(state.length);state.buffer.clear()}else{ret=fromListPartial(n,state.buffer,state.decoder)}return ret}function fromListPartial(n,list,hasStrings){var ret;if(nstr.length?str.length:n;if(nb===str.length)ret+=str;else ret+=str.slice(0,n);n-=nb;if(n===0){if(nb===str.length){++c;if(p.next)list.head=p.next;else list.head=list.tail=null}else{list.head=p;p.data=str.slice(nb)}break}++c}list.length-=c;return ret}function copyFromBuffer(n,list){var ret=Buffer.allocUnsafe(n);var p=list.head;var c=1;p.data.copy(ret);n-=p.data.length;while(p=p.next){var buf=p.data;var nb=n>buf.length?buf.length:n;buf.copy(ret,ret.length-n,0,nb);n-=nb;if(n===0){if(nb===buf.length){++c;if(p.next)list.head=p.next;else list.head=list.tail=null}else{list.head=p;p.data=buf.slice(nb)}break}++c}list.length-=c;return ret}function endReadable(stream){var state=stream._readableState;if(state.length>0)throw new Error('"endReadable()" called on non-empty stream');if(!state.endEmitted){state.ended=true;pna.nextTick(endReadableNT,state,stream)}}function endReadableNT(state,stream){if(!state.endEmitted&&state.length===0){state.endEmitted=true;stream.readable=false;stream.emit("end")}}function indexOf(xs,x){for(var i=0,l=xs.length;i-1?setImmediate:pna.nextTick;var Duplex;Writable.WritableState=WritableState;var util=Object.create(require("core-util-is"));util.inherits=require("inherits");var internalUtil={deprecate:require("util-deprecate")};var Stream=require("./internal/streams/stream");var Buffer=require("safe-buffer").Buffer;var OurUint8Array=global.Uint8Array||function(){};function _uint8ArrayToBuffer(chunk){return Buffer.from(chunk)}function _isUint8Array(obj){return Buffer.isBuffer(obj)||obj instanceof OurUint8Array}var destroyImpl=require("./internal/streams/destroy");util.inherits(Writable,Stream);function nop(){}function WritableState(options,stream){Duplex=Duplex||require("./_stream_duplex");options=options||{};var isDuplex=stream instanceof Duplex;this.objectMode=!!options.objectMode;if(isDuplex)this.objectMode=this.objectMode||!!options.writableObjectMode;var hwm=options.highWaterMark;var writableHwm=options.writableHighWaterMark;var defaultHwm=this.objectMode?16:16*1024;if(hwm||hwm===0)this.highWaterMark=hwm;else if(isDuplex&&(writableHwm||writableHwm===0))this.highWaterMark=writableHwm;else this.highWaterMark=defaultHwm;this.highWaterMark=Math.floor(this.highWaterMark);this.finalCalled=false;this.needDrain=false;this.ending=false;this.ended=false;this.finished=false;this.destroyed=false;var noDecode=options.decodeStrings===false;this.decodeStrings=!noDecode;this.defaultEncoding=options.defaultEncoding||"utf8";this.length=0;this.writing=false;this.corked=0;this.sync=true;this.bufferProcessing=false;this.onwrite=function(er){onwrite(stream,er)};this.writecb=null;this.writelen=0;this.bufferedRequest=null;this.lastBufferedRequest=null;this.pendingcb=0;this.prefinished=false;this.errorEmitted=false;this.bufferedRequestCount=0;this.corkedRequestsFree=new CorkedRequest(this)}WritableState.prototype.getBuffer=function getBuffer(){var current=this.bufferedRequest;var out=[];while(current){out.push(current);current=current.next}return out};(function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:internalUtil.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer "+"instead.","DEP0003")})}catch(_){}})();var realHasInstance;if(typeof Symbol==="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==="function"){realHasInstance=Function.prototype[Symbol.hasInstance];Object.defineProperty(Writable,Symbol.hasInstance,{value:function(object){if(realHasInstance.call(this,object))return true;if(this!==Writable)return false;return object&&object._writableState instanceof WritableState}})}else{realHasInstance=function(object){return object instanceof this}}function Writable(options){Duplex=Duplex||require("./_stream_duplex");if(!realHasInstance.call(Writable,this)&&!(this instanceof Duplex)){return new Writable(options)}this._writableState=new WritableState(options,this);this.writable=true;if(options){if(typeof options.write==="function")this._write=options.write;if(typeof options.writev==="function")this._writev=options.writev;if(typeof options.destroy==="function")this._destroy=options.destroy;if(typeof options.final==="function")this._final=options.final}Stream.call(this)}Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function writeAfterEnd(stream,cb){var er=new Error("write after end");stream.emit("error",er);pna.nextTick(cb,er)}function validChunk(stream,state,chunk,cb){var valid=true;var er=false;if(chunk===null){er=new TypeError("May not write null values to stream")}else if(typeof chunk!=="string"&&chunk!==undefined&&!state.objectMode){er=new TypeError("Invalid non-string/buffer chunk")}if(er){stream.emit("error",er);pna.nextTick(cb,er);valid=false}return valid}Writable.prototype.write=function(chunk,encoding,cb){var state=this._writableState;var ret=false;var isBuf=!state.objectMode&&_isUint8Array(chunk);if(isBuf&&!Buffer.isBuffer(chunk)){chunk=_uint8ArrayToBuffer(chunk)}if(typeof encoding==="function"){cb=encoding;encoding=null}if(isBuf)encoding="buffer";else if(!encoding)encoding=state.defaultEncoding;if(typeof cb!=="function")cb=nop;if(state.ended)writeAfterEnd(this,cb);else if(isBuf||validChunk(this,state,chunk,cb)){state.pendingcb++;ret=writeOrBuffer(this,state,isBuf,chunk,encoding,cb)}return ret};Writable.prototype.cork=function(){var state=this._writableState;state.corked++};Writable.prototype.uncork=function(){var state=this._writableState;if(state.corked){state.corked--;if(!state.writing&&!state.corked&&!state.finished&&!state.bufferProcessing&&state.bufferedRequest)clearBuffer(this,state)}};Writable.prototype.setDefaultEncoding=function setDefaultEncoding(encoding){if(typeof encoding==="string")encoding=encoding.toLowerCase();if(!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((encoding+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+encoding);this._writableState.defaultEncoding=encoding;return this};function decodeChunk(state,chunk,encoding){if(!state.objectMode&&state.decodeStrings!==false&&typeof chunk==="string"){chunk=Buffer.from(chunk,encoding)}return chunk}Object.defineProperty(Writable.prototype,"writableHighWaterMark",{enumerable:false,get:function(){return this._writableState.highWaterMark}});function writeOrBuffer(stream,state,isBuf,chunk,encoding,cb){if(!isBuf){var newChunk=decodeChunk(state,chunk,encoding);if(chunk!==newChunk){isBuf=true;encoding="buffer";chunk=newChunk}}var len=state.objectMode?1:chunk.length;state.length+=len;var ret=state.length0)this.tail.next=entry;else this.head=entry;this.tail=entry;++this.length};BufferList.prototype.unshift=function unshift(v){var entry={data:v,next:this.head};if(this.length===0)this.tail=entry;this.head=entry;++this.length};BufferList.prototype.shift=function shift(){if(this.length===0)return;var ret=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return ret};BufferList.prototype.clear=function clear(){this.head=this.tail=null;this.length=0};BufferList.prototype.join=function join(s){if(this.length===0)return"";var p=this.head;var ret=""+p.data;while(p=p.next){ret+=s+p.data}return ret};BufferList.prototype.concat=function concat(n){if(this.length===0)return Buffer.alloc(0);if(this.length===1)return this.head.data;var ret=Buffer.allocUnsafe(n>>>0);var p=this.head;var i=0;while(p){copyBuffer(p.data,ret,i);i+=p.data.length;p=p.next}return ret};return BufferList}();if(util&&util.inspect&&util.inspect.custom){module.exports.prototype[util.inspect.custom]=function(){var obj=util.inspect({length:this.length});return this.constructor.name+" "+obj}}},{"safe-buffer":110,util:11}],108:[function(require,module,exports){"use strict";var pna=require("process-nextick-args");function destroy(err,cb){var _this=this;var readableDestroyed=this._readableState&&this._readableState.destroyed;var writableDestroyed=this._writableState&&this._writableState.destroyed;if(readableDestroyed||writableDestroyed){if(cb){cb(err)}else if(err&&(!this._writableState||!this._writableState.errorEmitted)){pna.nextTick(emitErrorNT,this,err)}return this}if(this._readableState){this._readableState.destroyed=true}if(this._writableState){this._writableState.destroyed=true}this._destroy(err||null,function(err){if(!cb&&err){pna.nextTick(emitErrorNT,_this,err);if(_this._writableState){_this._writableState.errorEmitted=true}}else if(cb){cb(err)}});return this}function undestroy(){if(this._readableState){this._readableState.destroyed=false;this._readableState.reading=false;this._readableState.ended=false;this._readableState.endEmitted=false}if(this._writableState){this._writableState.destroyed=false;this._writableState.ended=false;this._writableState.ending=false;this._writableState.finished=false;this._writableState.errorEmitted=false}}function emitErrorNT(self,err){self.emit("error",err)}module.exports={destroy:destroy,undestroy:undestroy}},{"process-nextick-args":95}],109:[function(require,module,exports){module.exports=require("events").EventEmitter},{events:79}],110:[function(require,module,exports){var buffer=require("buffer");var Buffer=buffer.Buffer;function copyProps(src,dst){for(var key in src){dst[key]=src[key]}}if(Buffer.from&&Buffer.alloc&&Buffer.allocUnsafe&&Buffer.allocUnsafeSlow){module.exports=buffer}else{copyProps(buffer,exports);exports.Buffer=SafeBuffer}function SafeBuffer(arg,encodingOrOffset,length){return Buffer(arg,encodingOrOffset,length)}copyProps(Buffer,SafeBuffer);SafeBuffer.from=function(arg,encodingOrOffset,length){if(typeof arg==="number"){throw new TypeError("Argument must not be a number")}return Buffer(arg,encodingOrOffset,length)};SafeBuffer.alloc=function(size,fill,encoding){if(typeof size!=="number"){throw new TypeError("Argument must be a number")}var buf=Buffer(size);if(fill!==undefined){if(typeof encoding==="string"){buf.fill(fill,encoding)}else{buf.fill(fill)}}else{buf.fill(0)}return buf};SafeBuffer.allocUnsafe=function(size){if(typeof size!=="number"){throw new TypeError("Argument must be a number")}return Buffer(size)};SafeBuffer.allocUnsafeSlow=function(size){if(typeof size!=="number"){throw new TypeError("Argument must be a number")}return buffer.SlowBuffer(size)}},{buffer:12}],111:[function(require,module,exports){"use strict";var Buffer=require("safe-buffer").Buffer;var isEncoding=Buffer.isEncoding||function(encoding){encoding=""+encoding;switch(encoding&&encoding.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return true;default:return false}};function _normalizeEncoding(enc){if(!enc)return"utf8";var retried;while(true){switch(enc){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return enc;default:if(retried)return;enc=(""+enc).toLowerCase();retried=true}}}function normalizeEncoding(enc){var nenc=_normalizeEncoding(enc);if(typeof nenc!=="string"&&(Buffer.isEncoding===isEncoding||!isEncoding(enc)))throw new Error("Unknown encoding: "+enc);return nenc||enc}exports.StringDecoder=StringDecoder;function StringDecoder(encoding){this.encoding=normalizeEncoding(encoding);var nb;switch(this.encoding){case"utf16le":this.text=utf16Text;this.end=utf16End;nb=4;break;case"utf8":this.fillLast=utf8FillLast;nb=4;break;case"base64":this.text=base64Text;this.end=base64End;nb=3;break;default:this.write=simpleWrite;this.end=simpleEnd;return}this.lastNeed=0;this.lastTotal=0;this.lastChar=Buffer.allocUnsafe(nb)}StringDecoder.prototype.write=function(buf){if(buf.length===0)return"";var r;var i;if(this.lastNeed){r=this.fillLast(buf);if(r===undefined)return"";i=this.lastNeed;this.lastNeed=0}else{i=0}if(i>5===6)return 2;else if(byte>>4===14)return 3;else if(byte>>3===30)return 4;return byte>>6===2?-1:-2}function utf8CheckIncomplete(self,buf,i){var j=buf.length-1;if(j=0){if(nb>0)self.lastNeed=nb-1;return nb}if(--j=0){if(nb>0)self.lastNeed=nb-2;return nb}if(--j=0){if(nb>0){if(nb===2)nb=0;else self.lastNeed=nb-3}return nb}return 0}function utf8CheckExtraBytes(self,buf,p){if((buf[0]&192)!==128){self.lastNeed=0;return"�"}if(self.lastNeed>1&&buf.length>1){if((buf[1]&192)!==128){self.lastNeed=1;return"�"}if(self.lastNeed>2&&buf.length>2){if((buf[2]&192)!==128){self.lastNeed=2;return"�"}}}}function utf8FillLast(buf){var p=this.lastTotal-this.lastNeed;var r=utf8CheckExtraBytes(this,buf,p);if(r!==undefined)return r;if(this.lastNeed<=buf.length){buf.copy(this.lastChar,p,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal)}buf.copy(this.lastChar,p,0,buf.length);this.lastNeed-=buf.length}function utf8Text(buf,i){var total=utf8CheckIncomplete(this,buf,i);if(!this.lastNeed)return buf.toString("utf8",i);this.lastTotal=total;var end=buf.length-(total-this.lastNeed);buf.copy(this.lastChar,0,end);return buf.toString("utf8",i,end)}function utf8End(buf){var r=buf&&buf.length?this.write(buf):"";if(this.lastNeed)return r+"�";return r}function utf16Text(buf,i){if((buf.length-i)%2===0){var r=buf.toString("utf16le",i);if(r){var c=r.charCodeAt(r.length-1);if(c>=55296&&c<=56319){this.lastNeed=2;this.lastTotal=4;this.lastChar[0]=buf[buf.length-2];this.lastChar[1]=buf[buf.length-1];return r.slice(0,-1)}}return r}this.lastNeed=1;this.lastTotal=2;this.lastChar[0]=buf[buf.length-1];return buf.toString("utf16le",i,buf.length-1)}function utf16End(buf){var r=buf&&buf.length?this.write(buf):"";if(this.lastNeed){var end=this.lastTotal-this.lastNeed;return r+this.lastChar.toString("utf16le",0,end)}return r}function base64Text(buf,i){var n=(buf.length-i)%3;if(n===0)return buf.toString("base64",i);this.lastNeed=3-n;this.lastTotal=3;if(n===1){this.lastChar[0]=buf[buf.length-1]}else{this.lastChar[0]=buf[buf.length-2];this.lastChar[1]=buf[buf.length-1]}return buf.toString("base64",i,buf.length-n)}function base64End(buf){var r=buf&&buf.length?this.write(buf):"";if(this.lastNeed)return r+this.lastChar.toString("base64",0,3-this.lastNeed);return r}function simpleWrite(buf){return buf.toString(this.encoding)}function simpleEnd(buf){return buf&&buf.length?this.write(buf):""}},{"safe-buffer":110}],112:[function(require,module,exports){exports=module.exports=require("./lib/_stream_readable.js");exports.Stream=exports;exports.Readable=exports;exports.Writable=require("./lib/_stream_writable.js");exports.Duplex=require("./lib/_stream_duplex.js");exports.Transform=require("./lib/_stream_transform.js");exports.PassThrough=require("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":102,"./lib/_stream_passthrough.js":103,"./lib/_stream_readable.js":104,"./lib/_stream_transform.js":105,"./lib/_stream_writable.js":106}],113:[function(require,module,exports){"use strict";function ReInterval(callback,interval,args){var self=this;this._callback=callback;this._args=args;this._interval=setInterval(callback,interval,this._args);this.reschedule=function(interval){if(!interval)interval=self._interval;if(self._interval)clearInterval(self._interval);self._interval=setInterval(self._callback,interval,self._args)};this.clear=function(){if(self._interval){clearInterval(self._interval);self._interval=undefined}};this.destroy=function(){if(self._interval){clearInterval(self._interval)}self._callback=undefined;self._interval=undefined;self._args=undefined}}function reInterval(){if(typeof arguments[0]!=="function")throw new Error("callback needed");if(typeof arguments[1]!=="number")throw new Error("interval needed");var args;if(arguments.length>0){args=new Array(arguments.length-2);for(var i=0;i=0){item._idleTimeoutId=setTimeout(function onTimeout(){if(item._onTimeout)item._onTimeout()},msecs)}};exports.setImmediate=typeof setImmediate==="function"?setImmediate:function(fn){var id=nextImmediateId++;var args=arguments.length<2?false:slice.call(arguments,1);immediateIds[id]=true;nextTick(function onNextTick(){if(immediateIds[id]){if(args){fn.apply(null,args)}else{fn.call(null)}exports.clearImmediate(id)}});return id};exports.clearImmediate=typeof clearImmediate==="function"?clearImmediate:function(id){delete immediateIds[id]}}).call(this)}).call(this,require("timers").setImmediate,require("timers").clearImmediate)},{"process/browser.js":96,timers:116}],117:[function(require,module,exports){"use strict";var isPrototype=require("../prototype/is");module.exports=function(value){if(typeof value!=="function")return false;if(!hasOwnProperty.call(value,"length"))return false;try{if(typeof value.length!=="number")return false;if(typeof value.call!=="function")return false;if(typeof value.apply!=="function")return false}catch(error){return false}return!isPrototype(value)}},{"../prototype/is":124}],118:[function(require,module,exports){"use strict";var isValue=require("../value/is"),isObject=require("../object/is"),stringCoerce=require("../string/coerce"),toShortString=require("./to-short-string");var resolveMessage=function(message,value){return message.replace("%v",toShortString(value))};module.exports=function(value,defaultMessage,inputOptions){if(!isObject(inputOptions))throw new TypeError(resolveMessage(defaultMessage,value));if(!isValue(value)){if("default"in inputOptions)return inputOptions["default"];if(inputOptions.isOptional)return null}var errorMessage=stringCoerce(inputOptions.errorMessage);if(!isValue(errorMessage))errorMessage=defaultMessage;throw new TypeError(resolveMessage(errorMessage,value))}},{"../object/is":121,"../string/coerce":125,"../value/is":127,"./to-short-string":120}],119:[function(require,module,exports){"use strict";module.exports=function(value){try{return value.toString()}catch(error){try{return String(value)}catch(error2){return null}}}},{}],120:[function(require,module,exports){"use strict";var safeToString=require("./safe-to-string");var reNewLine=/[\n\r\u2028\u2029]/g;module.exports=function(value){var string=safeToString(value);if(string===null)return"";if(string.length>100)string=string.slice(0,99)+"…";string=string.replace(reNewLine,function(char){switch(char){case"\n":return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}});return string}},{"./safe-to-string":119}],121:[function(require,module,exports){"use strict";var isValue=require("../value/is");var possibleTypes={object:true,function:true,undefined:true};module.exports=function(value){if(!isValue(value))return false;return hasOwnProperty.call(possibleTypes,typeof value)}},{"../value/is":127}],122:[function(require,module,exports){"use strict";var resolveException=require("../lib/resolve-exception"),is=require("./is");module.exports=function(value){if(is(value))return value;return resolveException(value,"%v is not a plain function",arguments[1])}},{"../lib/resolve-exception":118,"./is":123}],123:[function(require,module,exports){"use strict";var isFunction=require("../function/is");var classRe=/^\s*class[\s{/}]/,functionToString=Function.prototype.toString;module.exports=function(value){if(!isFunction(value))return false;if(classRe.test(functionToString.call(value)))return false;return true}},{"../function/is":117}],124:[function(require,module,exports){"use strict";var isObject=require("../object/is");module.exports=function(value){if(!isObject(value))return false;try{if(!value.constructor)return false;return value.constructor.prototype===value}catch(error){return false}}},{"../object/is":121}],125:[function(require,module,exports){"use strict";var isValue=require("../value/is"),isObject=require("../object/is");var objectToString=Object.prototype.toString;module.exports=function(value){if(!isValue(value))return null;if(isObject(value)){var valueToString=value.toString;if(typeof valueToString!=="function")return null;if(valueToString===objectToString)return null}try{return""+value}catch(error){return null}}},{"../object/is":121,"../value/is":127}],126:[function(require,module,exports){"use strict";var resolveException=require("../lib/resolve-exception"),is=require("./is");module.exports=function(value){if(is(value))return value;return resolveException(value,"Cannot use %v",arguments[1])}},{"../lib/resolve-exception":118,"./is":127}],127:[function(require,module,exports){"use strict";var _undefined=void 0;module.exports=function(value){return value!==_undefined&&value!==null}},{}],128:[function(require,module,exports){"use strict";var punycode=require("punycode");var util=require("./util");exports.parse=urlParse;exports.resolve=urlResolve;exports.resolveObject=urlResolveObject;exports.format=urlFormat;exports.Url=Url;function Url(){this.protocol=null;this.slashes=null;this.auth=null;this.host=null;this.port=null;this.hostname=null;this.hash=null;this.search=null;this.query=null;this.pathname=null;this.path=null;this.href=null}var protocolPattern=/^([a-z0-9.+-]+:)/i,portPattern=/:[0-9]*$/,simplePathPattern=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,delims=["<",">",'"',"`"," ","\r","\n","\t"],unwise=["{","}","|","\\","^","`"].concat(delims),autoEscape=["'"].concat(unwise),nonHostChars=["%","/","?",";","#"].concat(autoEscape),hostEndingChars=["/","?","#"],hostnameMaxLen=255,hostnamePartPattern=/^[+a-z0-9A-Z_-]{0,63}$/,hostnamePartStart=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,unsafeProtocol={javascript:true,"javascript:":true},hostlessProtocol={javascript:true,"javascript:":true},slashedProtocol={http:true,https:true,ftp:true,gopher:true,file:true,"http:":true,"https:":true,"ftp:":true,"gopher:":true,"file:":true},querystring=require("querystring");function urlParse(url,parseQueryString,slashesDenoteHost){if(url&&util.isObject(url)&&url instanceof Url)return url;var u=new Url;u.parse(url,parseQueryString,slashesDenoteHost);return u}Url.prototype.parse=function(url,parseQueryString,slashesDenoteHost){if(!util.isString(url)){throw new TypeError("Parameter 'url' must be a string, not "+typeof url)}var queryIndex=url.indexOf("?"),splitter=queryIndex!==-1&&queryIndex127){newpart+="x"}else{newpart+=part[j]}}if(!newpart.match(hostnamePartPattern)){var validParts=hostparts.slice(0,i);var notHost=hostparts.slice(i+1);var bit=part.match(hostnamePartStart);if(bit){validParts.push(bit[1]);notHost.unshift(bit[2])}if(notHost.length){rest="/"+notHost.join(".")+rest}this.hostname=validParts.join(".");break}}}}if(this.hostname.length>hostnameMaxLen){this.hostname=""}else{this.hostname=this.hostname.toLowerCase()}if(!ipv6Hostname){this.hostname=punycode.toASCII(this.hostname)}var p=this.port?":"+this.port:"";var h=this.hostname||"";this.host=h+p;this.href+=this.host;if(ipv6Hostname){this.hostname=this.hostname.substr(1,this.hostname.length-2);if(rest[0]!=="/"){rest="/"+rest}}}if(!unsafeProtocol[lowerProto]){for(var i=0,l=autoEscape.length;i0?result.host.split("@"):false;if(authInHost){result.auth=authInHost.shift();result.host=result.hostname=authInHost.shift()}}result.search=relative.search;result.query=relative.query;if(!util.isNull(result.pathname)||!util.isNull(result.search)){result.path=(result.pathname?result.pathname:"")+(result.search?result.search:"")}result.href=result.format();return result}if(!srcPath.length){result.pathname=null;if(result.search){result.path="/"+result.search}else{result.path=null}result.href=result.format();return result}var last=srcPath.slice(-1)[0];var hasTrailingSlash=(result.host||relative.host||srcPath.length>1)&&(last==="."||last==="..")||last==="";var up=0;for(var i=srcPath.length;i>=0;i--){last=srcPath[i];if(last==="."){srcPath.splice(i,1)}else if(last===".."){srcPath.splice(i,1);up++}else if(up){srcPath.splice(i,1);up--}}if(!mustEndAbs&&!removeAllDots){for(;up--;up){srcPath.unshift("..")}}if(mustEndAbs&&srcPath[0]!==""&&(!srcPath[0]||srcPath[0].charAt(0)!=="/")){srcPath.unshift("")}if(hasTrailingSlash&&srcPath.join("/").substr(-1)!=="/"){srcPath.push("")}var isAbsolute=srcPath[0]===""||srcPath[0]&&srcPath[0].charAt(0)==="/";if(psychotic){result.hostname=result.host=isAbsolute?"":srcPath.length?srcPath.shift():"";var authInHost=result.host&&result.host.indexOf("@")>0?result.host.split("@"):false;if(authInHost){result.auth=authInHost.shift();result.host=result.hostname=authInHost.shift()}}mustEndAbs=mustEndAbs||result.host&&srcPath.length;if(mustEndAbs&&!isAbsolute){srcPath.unshift("")}if(!srcPath.length){result.pathname=null;result.path=null}else{result.pathname=srcPath.join("/")}if(!util.isNull(result.pathname)||!util.isNull(result.search)){result.path=(result.pathname?result.pathname:"")+(result.search?result.search:"")}result.auth=relative.auth||result.auth;result.slashes=result.slashes||relative.slashes;result.href=result.format();return result};Url.prototype.parseHost=function(){var host=this.host;var port=portPattern.exec(host);if(port){port=port[0];if(port!==":"){this.port=port.substr(1)}host=host.substr(0,host.length-port.length)}if(host)this.hostname=host}},{"./util":129,punycode:97,querystring:100}],129:[function(require,module,exports){"use strict";module.exports={isString:function(arg){return typeof arg==="string"},isObject:function(arg){return typeof arg==="object"&&arg!==null},isNull:function(arg){return arg===null},isNullOrUndefined:function(arg){return arg==null}}},{}],130:[function(require,module,exports){(function(global){(function(){module.exports=deprecate;function deprecate(fn,msg){if(config("noDeprecation")){return fn}var warned=false;function deprecated(){if(!warned){if(config("throwDeprecation")){throw new Error(msg)}else if(config("traceDeprecation")){console.trace(msg)}else{console.warn(msg)}warned=true}return fn.apply(this,arguments)}return deprecated}function config(name){try{if(!global.localStorage)return false}catch(_){return false}var val=global.localStorage[name];if(null==val)return false;return String(val).toLowerCase()==="true"}}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],131:[function(require,module,exports){if(typeof Object.create==="function"){module.exports=function inherits(ctor,superCtor){ctor.super_=superCtor;ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:false,writable:true,configurable:true}})}}else{module.exports=function inherits(ctor,superCtor){ctor.super_=superCtor;var TempCtor=function(){};TempCtor.prototype=superCtor.prototype;ctor.prototype=new TempCtor;ctor.prototype.constructor=ctor}}},{}],132:[function(require,module,exports){module.exports=function isBuffer(arg){return arg&&typeof arg==="object"&&typeof arg.copy==="function"&&typeof arg.fill==="function"&&typeof arg.readUInt8==="function"}},{}],133:[function(require,module,exports){(function(process,global){(function(){var formatRegExp=/%[sdj%]/g;exports.format=function(f){if(!isString(f)){var objects=[];for(var i=0;i=len)return x;switch(x){case"%s":return String(args[i++]);case"%d":return Number(args[i++]);case"%j":try{return JSON.stringify(args[i++])}catch(_){return"[Circular]"}default:return x}});for(var x=args[i];i=3)ctx.depth=arguments[2];if(arguments.length>=4)ctx.colors=arguments[3];if(isBoolean(opts)){ctx.showHidden=opts}else if(opts){exports._extend(ctx,opts)}if(isUndefined(ctx.showHidden))ctx.showHidden=false;if(isUndefined(ctx.depth))ctx.depth=2;if(isUndefined(ctx.colors))ctx.colors=false;if(isUndefined(ctx.customInspect))ctx.customInspect=true;if(ctx.colors)ctx.stylize=stylizeWithColor;return formatValue(ctx,obj,ctx.depth)}exports.inspect=inspect;inspect.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};inspect.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function stylizeWithColor(str,styleType){var style=inspect.styles[styleType];if(style){return"["+inspect.colors[style][0]+"m"+str+"["+inspect.colors[style][1]+"m"}else{return str}}function stylizeNoColor(str,styleType){return str}function arrayToHash(array){var hash={};array.forEach(function(val,idx){hash[val]=true});return hash}function formatValue(ctx,value,recurseTimes){if(ctx.customInspect&&value&&isFunction(value.inspect)&&value.inspect!==exports.inspect&&!(value.constructor&&value.constructor.prototype===value)){var ret=value.inspect(recurseTimes,ctx);if(!isString(ret)){ret=formatValue(ctx,ret,recurseTimes)}return ret}var primitive=formatPrimitive(ctx,value);if(primitive){return primitive}var keys=Object.keys(value);var visibleKeys=arrayToHash(keys);if(ctx.showHidden){keys=Object.getOwnPropertyNames(value)}if(isError(value)&&(keys.indexOf("message")>=0||keys.indexOf("description")>=0)){return formatError(value)}if(keys.length===0){if(isFunction(value)){var name=value.name?": "+value.name:"";return ctx.stylize("[Function"+name+"]","special")}if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),"regexp")}if(isDate(value)){return ctx.stylize(Date.prototype.toString.call(value),"date")}if(isError(value)){return formatError(value)}}var base="",array=false,braces=["{","}"];if(isArray(value)){array=true;braces=["[","]"]}if(isFunction(value)){var n=value.name?": "+value.name:"";base=" [Function"+n+"]"}if(isRegExp(value)){base=" "+RegExp.prototype.toString.call(value)}if(isDate(value)){base=" "+Date.prototype.toUTCString.call(value)}if(isError(value)){base=" "+formatError(value)}if(keys.length===0&&(!array||value.length==0)){return braces[0]+base+braces[1]}if(recurseTimes<0){if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),"regexp")}else{return ctx.stylize("[Object]","special")}}ctx.seen.push(value);var output;if(array){output=formatArray(ctx,value,recurseTimes,visibleKeys,keys)}else{output=keys.map(function(key){return formatProperty(ctx,value,recurseTimes,visibleKeys,key,array)})}ctx.seen.pop();return reduceToSingleString(output,base,braces)}function formatPrimitive(ctx,value){if(isUndefined(value))return ctx.stylize("undefined","undefined");if(isString(value)){var simple="'"+JSON.stringify(value).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return ctx.stylize(simple,"string")}if(isNumber(value))return ctx.stylize(""+value,"number");if(isBoolean(value))return ctx.stylize(""+value,"boolean");if(isNull(value))return ctx.stylize("null","null")}function formatError(value){return"["+Error.prototype.toString.call(value)+"]"}function formatArray(ctx,value,recurseTimes,visibleKeys,keys){var output=[];for(var i=0,l=value.length;i-1){if(array){str=str.split("\n").map(function(line){return" "+line}).join("\n").substr(2)}else{str="\n"+str.split("\n").map(function(line){return" "+line}).join("\n")}}}else{str=ctx.stylize("[Circular]","special")}}if(isUndefined(name)){if(array&&key.match(/^\d+$/)){return str}name=JSON.stringify(""+key);if(name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)){name=name.substr(1,name.length-2);name=ctx.stylize(name,"name")}else{name=name.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'");name=ctx.stylize(name,"string")}}return name+": "+str}function reduceToSingleString(output,base,braces){var numLinesEst=0;var length=output.reduce(function(prev,cur){numLinesEst++;if(cur.indexOf("\n")>=0)numLinesEst++;return prev+cur.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(length>60){return braces[0]+(base===""?"":base+"\n ")+" "+output.join(",\n ")+" "+braces[1]}return braces[0]+base+" "+output.join(", ")+" "+braces[1]}function isArray(ar){return Array.isArray(ar)}exports.isArray=isArray;function isBoolean(arg){return typeof arg==="boolean"}exports.isBoolean=isBoolean;function isNull(arg){return arg===null}exports.isNull=isNull;function isNullOrUndefined(arg){return arg==null}exports.isNullOrUndefined=isNullOrUndefined;function isNumber(arg){return typeof arg==="number"}exports.isNumber=isNumber;function isString(arg){return typeof arg==="string"}exports.isString=isString;function isSymbol(arg){return typeof arg==="symbol"}exports.isSymbol=isSymbol;function isUndefined(arg){return arg===void 0}exports.isUndefined=isUndefined;function isRegExp(re){return isObject(re)&&objectToString(re)==="[object RegExp]"}exports.isRegExp=isRegExp;function isObject(arg){return typeof arg==="object"&&arg!==null}exports.isObject=isObject;function isDate(d){return isObject(d)&&objectToString(d)==="[object Date]"}exports.isDate=isDate;function isError(e){return isObject(e)&&(objectToString(e)==="[object Error]"||e instanceof Error)}exports.isError=isError;function isFunction(arg){return typeof arg==="function"}exports.isFunction=isFunction;function isPrimitive(arg){return arg===null||typeof arg==="boolean"||typeof arg==="number"||typeof arg==="string"||typeof arg==="symbol"||typeof arg==="undefined"}exports.isPrimitive=isPrimitive;exports.isBuffer=require("./support/isBuffer");function objectToString(o){return Object.prototype.toString.call(o)}function pad(n){return n<10?"0"+n.toString(10):n.toString(10)}var months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function timestamp(){var d=new Date;var time=[pad(d.getHours()),pad(d.getMinutes()),pad(d.getSeconds())].join(":");return[d.getDate(),months[d.getMonth()],time].join(" ")}exports.log=function(){console.log("%s - %s",timestamp(),exports.format.apply(exports,arguments))};exports.inherits=require("inherits");exports._extend=function(origin,add){if(!add||!isObject(add))return origin;var keys=Object.keys(add);var i=keys.length;while(i--){origin[keys[i]]=add[keys[i]]}return origin};function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}}).call(this)}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./support/isBuffer":132,_process:96,inherits:131}],134:[function(require,module,exports){(function(process,Buffer){(function(){var stream=require("readable-stream");var eos=require("end-of-stream");var inherits=require("inherits");var shift=require("stream-shift");var SIGNAL_FLUSH=Buffer.from&&Buffer.from!==Uint8Array.from?Buffer.from([0]):new Buffer([0]);var onuncork=function(self,fn){if(self._corked)self.once("uncork",fn);else fn()};var autoDestroy=function(self,err){if(self._autoDestroy)self.destroy(err)};var destroyer=function(self,end){return function(err){if(err)autoDestroy(self,err.message==="premature close"?null:err);else if(end&&!self._ended)self.end()}};var end=function(ws,fn){if(!ws)return fn();if(ws._writableState&&ws._writableState.finished)return fn();if(ws._writableState)return ws.end(fn);ws.end();fn()};var toStreams2=function(rs){return new stream.Readable({objectMode:true,highWaterMark:16}).wrap(rs)};var Duplexify=function(writable,readable,opts){if(!(this instanceof Duplexify))return new Duplexify(writable,readable,opts);stream.Duplex.call(this,opts);this._writable=null;this._readable=null;this._readable2=null;this._autoDestroy=!opts||opts.autoDestroy!==false;this._forwardDestroy=!opts||opts.destroy!==false;this._forwardEnd=!opts||opts.end!==false;this._corked=1;this._ondrain=null;this._drained=false;this._forwarding=false;this._unwrite=null;this._unread=null;this._ended=false;this.destroyed=false;if(writable)this.setWritable(writable);if(readable)this.setReadable(readable)};inherits(Duplexify,stream.Duplex);Duplexify.obj=function(writable,readable,opts){if(!opts)opts={};opts.objectMode=true;opts.highWaterMark=16;return new Duplexify(writable,readable,opts)};Duplexify.prototype.cork=function(){if(++this._corked===1)this.emit("cork")};Duplexify.prototype.uncork=function(){if(this._corked&&--this._corked===0)this.emit("uncork")};Duplexify.prototype.setWritable=function(writable){if(this._unwrite)this._unwrite();if(this.destroyed){if(writable&&writable.destroy)writable.destroy();return}if(writable===null||writable===false){this.end();return}var self=this;var unend=eos(writable,{writable:true,readable:false},destroyer(this,this._forwardEnd));var ondrain=function(){var ondrain=self._ondrain;self._ondrain=null;if(ondrain)ondrain()};var clear=function(){self._writable.removeListener("drain",ondrain);unend()};if(this._unwrite)process.nextTick(ondrain);this._writable=writable;this._writable.on("drain",ondrain);this._unwrite=clear;this.uncork()};Duplexify.prototype.setReadable=function(readable){if(this._unread)this._unread();if(this.destroyed){if(readable&&readable.destroy)readable.destroy();return}if(readable===null||readable===false){this.push(null);this.resume();return}var self=this;var unend=eos(readable,{writable:false,readable:true},destroyer(this));var onreadable=function(){self._forward()};var onend=function(){self.push(null)};var clear=function(){self._readable2.removeListener("readable",onreadable);self._readable2.removeListener("end",onend);unend()};this._drained=true;this._readable=readable;this._readable2=readable._readableState?readable:toStreams2(readable);this._readable2.on("readable",onreadable);this._readable2.on("end",onend);this._unread=clear;this._forward()};Duplexify.prototype._read=function(){this._drained=true;this._forward()};Duplexify.prototype._forward=function(){if(this._forwarding||!this._readable2||!this._drained)return;this._forwarding=true;var data;while(this._drained&&(data=shift(this._readable2))!==null){if(this.destroyed)continue;this._drained=this.push(data)}this._forwarding=false};Duplexify.prototype.destroy=function(err){if(this.destroyed)return;this.destroyed=true;var self=this;process.nextTick(function(){self._destroy(err)})};Duplexify.prototype._destroy=function(err){if(err){var ondrain=this._ondrain;this._ondrain=null;if(ondrain)ondrain(err);else this.emit("error",err)}if(this._forwardDestroy){if(this._readable&&this._readable.destroy)this._readable.destroy();if(this._writable&&this._writable.destroy)this._writable.destroy()}this.emit("close")};Duplexify.prototype._write=function(data,enc,cb){if(this.destroyed)return cb();if(this._corked)return onuncork(this,this._write.bind(this,data,enc,cb));if(data===SIGNAL_FLUSH)return this._finish(cb);if(!this._writable)return cb();if(this._writable.write(data)===false)this._ondrain=cb;else cb()};Duplexify.prototype._finish=function(cb){var self=this;this.emit("preend");onuncork(this,function(){end(self._forwardEnd&&self._writable,function(){if(self._writableState.prefinished===false)self._writableState.prefinished=true;self.emit("prefinish");onuncork(self,cb)})})};Duplexify.prototype.end=function(data,enc,cb){if(typeof data==="function")return this.end(null,null,data);if(typeof enc==="function")return this.end(data,null,enc);this._ended=true;if(data)this.write(data);if(!this._writableState.ending)this.write(SIGNAL_FLUSH);return stream.Writable.prototype.end.call(this,cb)};module.exports=Duplexify}).call(this)}).call(this,require("_process"),require("buffer").Buffer)},{_process:96,buffer:12,"end-of-stream":16,inherits:84,"readable-stream":143,"stream-shift":115}],135:[function(require,module,exports){arguments[4][102][0].apply(exports,arguments)},{"./_stream_readable":137,"./_stream_writable":139,"core-util-is":13,dup:102,inherits:84,"process-nextick-args":95}],136:[function(require,module,exports){arguments[4][103][0].apply(exports,arguments)},{"./_stream_transform":138,"core-util-is":13,dup:103,inherits:84}],137:[function(require,module,exports){arguments[4][104][0].apply(exports,arguments)},{"./_stream_duplex":135,"./internal/streams/BufferList":140,"./internal/streams/destroy":141,"./internal/streams/stream":142,_process:96,"core-util-is":13,dup:104,events:79,inherits:84,isarray:86,"process-nextick-args":95,"safe-buffer":144,"string_decoder/":160,util:11}],138:[function(require,module,exports){arguments[4][105][0].apply(exports,arguments)},{"./_stream_duplex":135,"core-util-is":13,dup:105,inherits:84}],139:[function(require,module,exports){arguments[4][106][0].apply(exports,arguments)},{"./_stream_duplex":135,"./internal/streams/destroy":141,"./internal/streams/stream":142,_process:96,"core-util-is":13,dup:106,inherits:84,"process-nextick-args":95,"safe-buffer":144,timers:116,"util-deprecate":130}],140:[function(require,module,exports){arguments[4][107][0].apply(exports,arguments)},{dup:107,"safe-buffer":144,util:11}],141:[function(require,module,exports){arguments[4][108][0].apply(exports,arguments)},{dup:108,"process-nextick-args":95}],142:[function(require,module,exports){arguments[4][109][0].apply(exports,arguments)},{dup:109,events:79}],143:[function(require,module,exports){arguments[4][112][0].apply(exports,arguments)},{"./lib/_stream_duplex.js":135,"./lib/_stream_passthrough.js":136,"./lib/_stream_readable.js":137,"./lib/_stream_transform.js":138,"./lib/_stream_writable.js":139,dup:112}],144:[function(require,module,exports){arguments[4][110][0].apply(exports,arguments)},{buffer:12,dup:110}],145:[function(require,module,exports){"use strict";function _inheritsLoose(subClass,superClass){subClass.prototype=Object.create(superClass.prototype);subClass.prototype.constructor=subClass;subClass.__proto__=superClass}var codes={};function createErrorType(code,message,Base){if(!Base){Base=Error}function getMessage(arg1,arg2,arg3){if(typeof message==="string"){return message}else{return message(arg1,arg2,arg3)}}var NodeError=function(_Base){_inheritsLoose(NodeError,_Base);function NodeError(arg1,arg2,arg3){return _Base.call(this,getMessage(arg1,arg2,arg3))||this}return NodeError}(Base);NodeError.prototype.name=Base.name;NodeError.prototype.code=code;codes[code]=NodeError}function oneOf(expected,thing){if(Array.isArray(expected)){var len=expected.length;expected=expected.map(function(i){return String(i)});if(len>2){return"one of ".concat(thing," ").concat(expected.slice(0,len-1).join(", "),", or ")+expected[len-1]}else if(len===2){return"one of ".concat(thing," ").concat(expected[0]," or ").concat(expected[1])}else{return"of ".concat(thing," ").concat(expected[0])}}else{return"of ".concat(thing," ").concat(String(expected))}}function startsWith(str,search,pos){return str.substr(!pos||pos<0?0:+pos,search.length)===search}function endsWith(str,search,this_len){if(this_len===undefined||this_len>str.length){this_len=str.length}return str.substring(this_len-search.length,this_len)===search}function includes(str,search,start){if(typeof start!=="number"){start=0}if(start+search.length>str.length){return false}else{return str.indexOf(search,start)!==-1}}createErrorType("ERR_INVALID_OPT_VALUE",function(name,value){return'The value "'+value+'" is invalid for option "'+name+'"'},TypeError);createErrorType("ERR_INVALID_ARG_TYPE",function(name,expected,actual){var determiner;if(typeof expected==="string"&&startsWith(expected,"not ")){determiner="must not be";expected=expected.replace(/^not /,"")}else{determiner="must be"}var msg;if(endsWith(name," argument")){msg="The ".concat(name," ").concat(determiner," ").concat(oneOf(expected,"type"))}else{var type=includes(name,".")?"property":"argument";msg='The "'.concat(name,'" ').concat(type," ").concat(determiner," ").concat(oneOf(expected,"type"))}msg+=". Received type ".concat(typeof actual);return msg},TypeError);createErrorType("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");createErrorType("ERR_METHOD_NOT_IMPLEMENTED",function(name){return"The "+name+" method is not implemented"});createErrorType("ERR_STREAM_PREMATURE_CLOSE","Premature close");createErrorType("ERR_STREAM_DESTROYED",function(name){return"Cannot call "+name+" after a stream was destroyed"});createErrorType("ERR_MULTIPLE_CALLBACK","Callback called multiple times");createErrorType("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");createErrorType("ERR_STREAM_WRITE_AFTER_END","write after end");createErrorType("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);createErrorType("ERR_UNKNOWN_ENCODING",function(arg){return"Unknown encoding: "+arg},TypeError);createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");module.exports.codes=codes},{}],146:[function(require,module,exports){(function(process){(function(){"use strict";var objectKeys=Object.keys||function(obj){var keys=[];for(var key in obj){keys.push(key)}return keys};module.exports=Duplex;var Readable=require("./_stream_readable");var Writable=require("./_stream_writable");require("inherits")(Duplex,Readable);{var keys=objectKeys(Writable.prototype);for(var v=0;v0){if(typeof chunk!=="string"&&!state.objectMode&&Object.getPrototypeOf(chunk)!==Buffer.prototype){chunk=_uint8ArrayToBuffer(chunk)}if(addToFront){if(state.endEmitted)errorOrDestroy(stream,new ERR_STREAM_UNSHIFT_AFTER_END_EVENT);else addChunk(stream,state,chunk,true)}else if(state.ended){errorOrDestroy(stream,new ERR_STREAM_PUSH_AFTER_EOF)}else if(state.destroyed){return false}else{state.reading=false;if(state.decoder&&!encoding){chunk=state.decoder.write(chunk);if(state.objectMode||chunk.length!==0)addChunk(stream,state,chunk,false);else maybeReadMore(stream,state)}else{addChunk(stream,state,chunk,false)}}}else if(!addToFront){state.reading=false;maybeReadMore(stream,state)}}return!state.ended&&(state.length=MAX_HWM){n=MAX_HWM}else{n--;n|=n>>>1;n|=n>>>2;n|=n>>>4;n|=n>>>8;n|=n>>>16;n++}return n}function howMuchToRead(n,state){if(n<=0||state.length===0&&state.ended)return 0;if(state.objectMode)return 1;if(n!==n){if(state.flowing&&state.length)return state.buffer.head.data.length;else return state.length}if(n>state.highWaterMark)state.highWaterMark=computeNewHighWaterMark(n);if(n<=state.length)return n;if(!state.ended){state.needReadable=true;return 0}return state.length}Readable.prototype.read=function(n){debug("read",n);n=parseInt(n,10);var state=this._readableState;var nOrig=n;if(n!==0)state.emittedReadable=false;if(n===0&&state.needReadable&&((state.highWaterMark!==0?state.length>=state.highWaterMark:state.length>0)||state.ended)){debug("read: emitReadable",state.length,state.ended);if(state.length===0&&state.ended)endReadable(this);else emitReadable(this);return null}n=howMuchToRead(n,state);if(n===0&&state.ended){if(state.length===0)endReadable(this);return null}var doRead=state.needReadable;debug("need readable",doRead);if(state.length===0||state.length-n0)ret=fromList(n,state);else ret=null;if(ret===null){state.needReadable=state.length<=state.highWaterMark;n=0}else{state.length-=n;state.awaitDrain=0}if(state.length===0){if(!state.ended)state.needReadable=true;if(nOrig!==n&&state.ended)endReadable(this)}if(ret!==null)this.emit("data",ret);return ret};function onEofChunk(stream,state){debug("onEofChunk");if(state.ended)return;if(state.decoder){var chunk=state.decoder.end();if(chunk&&chunk.length){state.buffer.push(chunk);state.length+=state.objectMode?1:chunk.length}}state.ended=true;if(state.sync){emitReadable(stream)}else{state.needReadable=false;if(!state.emittedReadable){state.emittedReadable=true;emitReadable_(stream)}}}function emitReadable(stream){var state=stream._readableState;debug("emitReadable",state.needReadable,state.emittedReadable);state.needReadable=false;if(!state.emittedReadable){debug("emitReadable",state.flowing);state.emittedReadable=true;process.nextTick(emitReadable_,stream)}}function emitReadable_(stream){var state=stream._readableState;debug("emitReadable_",state.destroyed,state.length,state.ended);if(!state.destroyed&&(state.length||state.ended)){stream.emit("readable");state.emittedReadable=false}state.needReadable=!state.flowing&&!state.ended&&state.length<=state.highWaterMark;flow(stream)}function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;process.nextTick(maybeReadMore_,stream,state)}}function maybeReadMore_(stream,state){while(!state.reading&&!state.ended&&(state.length1&&indexOf(state.pipes,dest)!==-1)&&!cleanedUp){debug("false write response, pause",state.awaitDrain);state.awaitDrain++}src.pause()}}function onerror(er){debug("onerror",er);unpipe();dest.removeListener("error",onerror);if(EElistenerCount(dest,"error")===0)errorOrDestroy(dest,er)}prependListener(dest,"error",onerror);function onclose(){dest.removeListener("finish",onfinish);unpipe()}dest.once("close",onclose);function onfinish(){debug("onfinish");dest.removeListener("close",onclose);unpipe()}dest.once("finish",onfinish);function unpipe(){debug("unpipe");src.unpipe(dest)}dest.emit("pipe",src);if(!state.flowing){debug("pipe resume");src.resume()}return dest};function pipeOnDrain(src){return function pipeOnDrainFunctionResult(){var state=src._readableState;debug("pipeOnDrain",state.awaitDrain);if(state.awaitDrain)state.awaitDrain--;if(state.awaitDrain===0&&EElistenerCount(src,"data")){state.flowing=true;flow(src)}}}Readable.prototype.unpipe=function(dest){var state=this._readableState;var unpipeInfo={hasUnpiped:false};if(state.pipesCount===0)return this;if(state.pipesCount===1){if(dest&&dest!==state.pipes)return this;if(!dest)dest=state.pipes;state.pipes=null;state.pipesCount=0;state.flowing=false;if(dest)dest.emit("unpipe",this,unpipeInfo);return this}if(!dest){var dests=state.pipes;var len=state.pipesCount;state.pipes=null;state.pipesCount=0;state.flowing=false;for(var i=0;i0;if(state.flowing!==false)this.resume()}else if(ev==="readable"){if(!state.endEmitted&&!state.readableListening){state.readableListening=state.needReadable=true;state.flowing=false;state.emittedReadable=false;debug("on readable",state.length,state.reading);if(state.length){emitReadable(this)}else if(!state.reading){process.nextTick(nReadingNextTick,this)}}}return res};Readable.prototype.addListener=Readable.prototype.on;Readable.prototype.removeListener=function(ev,fn){var res=Stream.prototype.removeListener.call(this,ev,fn);if(ev==="readable"){process.nextTick(updateReadableListening,this)}return res};Readable.prototype.removeAllListeners=function(ev){var res=Stream.prototype.removeAllListeners.apply(this,arguments);if(ev==="readable"||ev===undefined){process.nextTick(updateReadableListening,this)}return res};function updateReadableListening(self){var state=self._readableState;state.readableListening=self.listenerCount("readable")>0;if(state.resumeScheduled&&!state.paused){state.flowing=true}else if(self.listenerCount("data")>0){self.resume()}}function nReadingNextTick(self){debug("readable nexttick read 0");self.read(0)}Readable.prototype.resume=function(){var state=this._readableState;if(!state.flowing){debug("resume");state.flowing=!state.readableListening;resume(this,state)}state.paused=false;return this};function resume(stream,state){if(!state.resumeScheduled){state.resumeScheduled=true;process.nextTick(resume_,stream,state)}}function resume_(stream,state){debug("resume",state.reading);if(!state.reading){stream.read(0)}state.resumeScheduled=false;stream.emit("resume");flow(stream);if(state.flowing&&!state.reading)stream.read(0)}Readable.prototype.pause=function(){debug("call pause flowing=%j",this._readableState.flowing);if(this._readableState.flowing!==false){debug("pause");this._readableState.flowing=false;this.emit("pause")}this._readableState.paused=true;return this};function flow(stream){var state=stream._readableState;debug("flow",state.flowing);while(state.flowing&&stream.read()!==null){}}Readable.prototype.wrap=function(stream){var _this=this;var state=this._readableState;var paused=false;stream.on("end",function(){debug("wrapped end");if(state.decoder&&!state.ended){var chunk=state.decoder.end();if(chunk&&chunk.length)_this.push(chunk)}_this.push(null)});stream.on("data",function(chunk){debug("wrapped data");if(state.decoder)chunk=state.decoder.write(chunk);if(state.objectMode&&(chunk===null||chunk===undefined))return;else if(!state.objectMode&&(!chunk||!chunk.length))return;var ret=_this.push(chunk);if(!ret){paused=true;stream.pause()}});for(var i in stream){if(this[i]===undefined&&typeof stream[i]==="function"){this[i]=function methodWrap(method){return function methodWrapReturnFunction(){return stream[method].apply(stream,arguments)}}(i)}}for(var n=0;n=state.length){if(state.decoder)ret=state.buffer.join("");else if(state.buffer.length===1)ret=state.buffer.first();else ret=state.buffer.concat(state.length);state.buffer.clear()}else{ret=state.buffer.consume(n,state.decoder)}return ret}function endReadable(stream){var state=stream._readableState;debug("endReadable",state.endEmitted);if(!state.endEmitted){state.ended=true;process.nextTick(endReadableNT,state,stream)}}function endReadableNT(state,stream){debug("endReadableNT",state.endEmitted,state.length);if(!state.endEmitted&&state.length===0){state.endEmitted=true;stream.readable=false;stream.emit("end");if(state.autoDestroy){var wState=stream._writableState;if(!wState||wState.autoDestroy&&wState.finished){stream.destroy()}}}}if(typeof Symbol==="function"){Readable.from=function(iterable,opts){if(from===undefined){from=require("./internal/streams/from")}return from(Readable,iterable,opts)}}function indexOf(xs,x){for(var i=0,l=xs.length;i-1))throw new ERR_UNKNOWN_ENCODING(encoding);this._writableState.defaultEncoding=encoding;return this};Object.defineProperty(Writable.prototype,"writableBuffer",{enumerable:false,get:function get(){return this._writableState&&this._writableState.getBuffer()}});function decodeChunk(state,chunk,encoding){if(!state.objectMode&&state.decodeStrings!==false&&typeof chunk==="string"){chunk=Buffer.from(chunk,encoding)}return chunk}Object.defineProperty(Writable.prototype,"writableHighWaterMark",{enumerable:false,get:function get(){return this._writableState.highWaterMark}});function writeOrBuffer(stream,state,isBuf,chunk,encoding,cb){if(!isBuf){var newChunk=decodeChunk(state,chunk,encoding);if(chunk!==newChunk){isBuf=true;encoding="buffer";chunk=newChunk}}var len=state.objectMode?1:chunk.length;state.length+=len;var ret=state.length0)this.tail.next=entry;else this.head=entry;this.tail=entry;++this.length}},{key:"unshift",value:function unshift(v){var entry={data:v,next:this.head};if(this.length===0)this.tail=entry;this.head=entry;++this.length}},{key:"shift",value:function shift(){if(this.length===0)return;var ret=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return ret}},{key:"clear",value:function clear(){this.head=this.tail=null;this.length=0}},{key:"join",value:function join(s){if(this.length===0)return"";var p=this.head;var ret=""+p.data;while(p=p.next){ret+=s+p.data}return ret}},{key:"concat",value:function concat(n){if(this.length===0)return Buffer.alloc(0);var ret=Buffer.allocUnsafe(n>>>0);var p=this.head;var i=0;while(p){copyBuffer(p.data,ret,i);i+=p.data.length;p=p.next}return ret}},{key:"consume",value:function consume(n,hasStrings){var ret;if(nstr.length?str.length:n;if(nb===str.length)ret+=str;else ret+=str.slice(0,n);n-=nb;if(n===0){if(nb===str.length){++c;if(p.next)this.head=p.next;else this.head=this.tail=null}else{this.head=p;p.data=str.slice(nb)}break}++c}this.length-=c;return ret}},{key:"_getBuffer",value:function _getBuffer(n){var ret=Buffer.allocUnsafe(n);var p=this.head;var c=1;p.data.copy(ret);n-=p.data.length;while(p=p.next){var buf=p.data;var nb=n>buf.length?buf.length:n;buf.copy(ret,ret.length-n,0,nb);n-=nb;if(n===0){if(nb===buf.length){++c;if(p.next)this.head=p.next;else this.head=this.tail=null}else{this.head=p;p.data=buf.slice(nb)}break}++c}this.length-=c;return ret}},{key:custom,value:function value(_,options){return inspect(this,_objectSpread({},options,{depth:0,customInspect:false}))}}]);return BufferList}()},{buffer:12,util:11}],153:[function(require,module,exports){(function(process){(function(){"use strict";function destroy(err,cb){var _this=this;var readableDestroyed=this._readableState&&this._readableState.destroyed;var writableDestroyed=this._writableState&&this._writableState.destroyed;if(readableDestroyed||writableDestroyed){if(cb){cb(err)}else if(err){if(!this._writableState){process.nextTick(emitErrorNT,this,err)}else if(!this._writableState.errorEmitted){this._writableState.errorEmitted=true;process.nextTick(emitErrorNT,this,err)}}return this}if(this._readableState){this._readableState.destroyed=true}if(this._writableState){this._writableState.destroyed=true}this._destroy(err||null,function(err){if(!cb&&err){if(!_this._writableState){process.nextTick(emitErrorAndCloseNT,_this,err)}else if(!_this._writableState.errorEmitted){_this._writableState.errorEmitted=true;process.nextTick(emitErrorAndCloseNT,_this,err)}else{process.nextTick(emitCloseNT,_this)}}else if(cb){process.nextTick(emitCloseNT,_this);cb(err)}else{process.nextTick(emitCloseNT,_this)}});return this}function emitErrorAndCloseNT(self,err){emitErrorNT(self,err);emitCloseNT(self)}function emitCloseNT(self){if(self._writableState&&!self._writableState.emitClose)return;if(self._readableState&&!self._readableState.emitClose)return;self.emit("close")}function undestroy(){if(this._readableState){this._readableState.destroyed=false;this._readableState.reading=false;this._readableState.ended=false;this._readableState.endEmitted=false}if(this._writableState){this._writableState.destroyed=false;this._writableState.ended=false;this._writableState.ending=false;this._writableState.finalCalled=false;this._writableState.prefinished=false;this._writableState.finished=false;this._writableState.errorEmitted=false}}function emitErrorNT(self,err){self.emit("error",err)}function errorOrDestroy(stream,err){var rState=stream._readableState;var wState=stream._writableState;if(rState&&rState.autoDestroy||wState&&wState.autoDestroy)stream.destroy(err);else stream.emit("error",err)}module.exports={destroy:destroy,undestroy:undestroy,errorOrDestroy:errorOrDestroy}}).call(this)}).call(this,require("_process"))},{_process:96}],154:[function(require,module,exports){"use strict";var ERR_STREAM_PREMATURE_CLOSE=require("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;function once(callback){var called=false;return function(){if(called)return;called=true;for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key]}callback.apply(this,args)}}function noop(){}function isRequest(stream){return stream.setHeader&&typeof stream.abort==="function"}function eos(stream,opts,callback){if(typeof opts==="function")return eos(stream,null,opts);if(!opts)opts={};callback=once(callback||noop);var readable=opts.readable||opts.readable!==false&&stream.readable;var writable=opts.writable||opts.writable!==false&&stream.writable;var onlegacyfinish=function onlegacyfinish(){if(!stream.writable)onfinish()};var writableEnded=stream._writableState&&stream._writableState.finished;var onfinish=function onfinish(){writable=false;writableEnded=true;if(!readable)callback.call(stream)};var readableEnded=stream._readableState&&stream._readableState.endEmitted;var onend=function onend(){readable=false;readableEnded=true;if(!writable)callback.call(stream)};var onerror=function onerror(err){callback.call(stream,err)};var onclose=function onclose(){var err;if(readable&&!readableEnded){if(!stream._readableState||!stream._readableState.ended)err=new ERR_STREAM_PREMATURE_CLOSE;return callback.call(stream,err)}if(writable&&!writableEnded){if(!stream._writableState||!stream._writableState.ended)err=new ERR_STREAM_PREMATURE_CLOSE;return callback.call(stream,err)}};var onrequest=function onrequest(){stream.req.on("finish",onfinish)};if(isRequest(stream)){stream.on("complete",onfinish);stream.on("abort",onclose);if(stream.req)onrequest();else stream.on("request",onrequest)}else if(writable&&!stream._writableState){stream.on("end",onlegacyfinish);stream.on("close",onlegacyfinish)}stream.on("end",onend);stream.on("finish",onfinish);if(opts.error!==false)stream.on("error",onerror);stream.on("close",onclose);return function(){stream.removeListener("complete",onfinish);stream.removeListener("abort",onclose);stream.removeListener("request",onrequest);if(stream.req)stream.req.removeListener("finish",onfinish);stream.removeListener("end",onlegacyfinish);stream.removeListener("close",onlegacyfinish);stream.removeListener("finish",onfinish);stream.removeListener("end",onend);stream.removeListener("error",onerror);stream.removeListener("close",onclose)}}module.exports=eos},{"../../../errors":145}],155:[function(require,module,exports){module.exports=function(){throw new Error("Readable.from is not available in the browser")}},{}],156:[function(require,module,exports){"use strict";var eos;function once(callback){var called=false;return function(){if(called)return;called=true;callback.apply(void 0,arguments)}}var _require$codes=require("../../../errors").codes,ERR_MISSING_ARGS=_require$codes.ERR_MISSING_ARGS,ERR_STREAM_DESTROYED=_require$codes.ERR_STREAM_DESTROYED;function noop(err){if(err)throw err}function isRequest(stream){return stream.setHeader&&typeof stream.abort==="function"}function destroyer(stream,reading,writing,callback){callback=once(callback);var closed=false;stream.on("close",function(){closed=true});if(eos===undefined)eos=require("./end-of-stream");eos(stream,{readable:reading,writable:writing},function(err){if(err)return callback(err);closed=true;callback()});var destroyed=false;return function(err){if(closed)return;if(destroyed)return;destroyed=true;if(isRequest(stream))return stream.abort();if(typeof stream.destroy==="function")return stream.destroy();callback(err||new ERR_STREAM_DESTROYED("pipe"))}}function call(fn){fn()}function pipe(from,to){return from.pipe(to)}function popCallback(streams){if(!streams.length)return noop;if(typeof streams[streams.length-1]!=="function")return noop;return streams.pop()}function pipeline(){for(var _len=arguments.length,streams=new Array(_len),_key=0;_key<_len;_key++){streams[_key]=arguments[_key]}var callback=popCallback(streams);if(Array.isArray(streams[0]))streams=streams[0];if(streams.length<2){throw new ERR_MISSING_ARGS("streams")}var error;var destroys=streams.map(function(stream,i){var reading=i0;return destroyer(stream,reading,writing,function(err){if(!error)error=err;if(err)destroys.forEach(call);if(reading)return;destroys.forEach(call);callback(error)})});return streams.reduce(pipe)}module.exports=pipeline},{"../../../errors":145,"./end-of-stream":154}],157:[function(require,module,exports){"use strict";var ERR_INVALID_OPT_VALUE=require("../../../errors").codes.ERR_INVALID_OPT_VALUE;function highWaterMarkFrom(options,isDuplex,duplexKey){return options.highWaterMark!=null?options.highWaterMark:isDuplex?options[duplexKey]:null}function getHighWaterMark(state,options,duplexKey,isDuplex){var hwm=highWaterMarkFrom(options,isDuplex,duplexKey);if(hwm!=null){if(!(isFinite(hwm)&&Math.floor(hwm)===hwm)||hwm<0){var name=isDuplex?duplexKey:"highWaterMark";throw new ERR_INVALID_OPT_VALUE(name,hwm)}return Math.floor(hwm)}return state.objectMode?16:16*1024}module.exports={getHighWaterMark:getHighWaterMark}},{"../../../errors":145}],158:[function(require,module,exports){arguments[4][109][0].apply(exports,arguments)},{dup:109,events:79}],159:[function(require,module,exports){exports=module.exports=require("./lib/_stream_readable.js");exports.Stream=exports;exports.Readable=exports;exports.Writable=require("./lib/_stream_writable.js");exports.Duplex=require("./lib/_stream_duplex.js");exports.Transform=require("./lib/_stream_transform.js");exports.PassThrough=require("./lib/_stream_passthrough.js");exports.finished=require("./lib/internal/streams/end-of-stream.js");exports.pipeline=require("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":146,"./lib/_stream_passthrough.js":147,"./lib/_stream_readable.js":148,"./lib/_stream_transform.js":149,"./lib/_stream_writable.js":150,"./lib/internal/streams/end-of-stream.js":154,"./lib/internal/streams/pipeline.js":156}],160:[function(require,module,exports){arguments[4][111][0].apply(exports,arguments)},{dup:111,"safe-buffer":161}],161:[function(require,module,exports){arguments[4][110][0].apply(exports,arguments)},{buffer:12,dup:110}],162:[function(require,module,exports){(function(process,global){(function(){"use strict";var Transform=require("readable-stream").Transform;var duplexify=require("duplexify");var WS=require("ws");var Buffer=require("safe-buffer").Buffer;module.exports=WebSocketStream;function buildProxy(options,socketWrite,socketEnd){var proxy=new Transform({objectMode:options.objectMode});proxy._write=socketWrite;proxy._flush=socketEnd;return proxy}function WebSocketStream(target,protocols,options){var stream,socket;var isBrowser=process.title==="browser";var isNative=!!global.WebSocket;var socketWrite=isBrowser?socketWriteBrowser:socketWriteNode;if(protocols&&!Array.isArray(protocols)&&"object"===typeof protocols){options=protocols;protocols=null;if(typeof options.protocol==="string"||Array.isArray(options.protocol)){protocols=options.protocol}}if(!options)options={};if(options.objectMode===undefined){options.objectMode=!(options.binary===true||options.binary===undefined)}var proxy=buildProxy(options,socketWrite,socketEnd);if(!options.objectMode){proxy._writev=writev}var bufferSize=options.browserBufferSize||1024*512;var bufferTimeout=options.browserBufferTimeout||1e3;if(typeof target==="object"){socket=target}else{if(isNative&&isBrowser){socket=new WS(target,protocols)}else{socket=new WS(target,protocols,options)}socket.binaryType="arraybuffer"}if(socket.readyState===socket.OPEN){stream=proxy}else if(isBrowser){stream=proxy;stream.cork();socket.onopen=onopenBrowser}else{stream=duplexify.obj();socket.onopen=onopen}stream.socket=socket;socket.onclose=onclose;socket.onerror=onerror;socket.onmessage=onmessage;proxy.on("close",destroy);var coerceToBuffer=!options.objectMode;function socketWriteNode(chunk,enc,next){if(socket.readyState!==socket.OPEN){next();return}if(coerceToBuffer&&typeof chunk==="string"){chunk=Buffer.from(chunk,"utf8")}socket.send(chunk,next)}function socketWriteBrowser(chunk,enc,next){if(socket.bufferedAmount>bufferSize){setTimeout(socketWriteBrowser,bufferTimeout,chunk,enc,next);return}if(coerceToBuffer&&typeof chunk==="string"){chunk=Buffer.from(chunk,"utf8")}try{socket.send(chunk)}catch(err){return next(err)}next()}function socketEnd(done){socket.close();done()}function onopen(){stream.setReadable(proxy);stream.setWritable(proxy);stream.emit("connect")}function onopenBrowser(){stream.uncork();stream.emit("connect")}function onclose(){stream.end();stream.destroy()}function onerror(err){stream.destroy(err)}function onmessage(event){var data=event.data;if(data instanceof ArrayBuffer)data=Buffer.from(data);else data=Buffer.from(data,"utf8");proxy.push(data)}function destroy(){socket.close()}function writev(chunks,cb){var buffers=new Array(chunks.length);for(var i=0;i 0) { + if (this.options.resubscribe) { + this._resubscribeTopics.resubscribe = true + this.subscribe(this._resubscribeTopics) + } else { + this._resubscribeTopics = {} + } + } + + firstConnection = false + }) + // Clear ping timer this.on('close', function () { if (that.pingTimer !== null) { @@ -267,24 +281,18 @@ MqttClient.prototype._setupStream = function () { }) function nextTickWork () { - if (packets.length) { - process.nextTick(work) - } else { - var done = completeParse - completeParse = null - done() - } + process.nextTick(work) } function work () { var packet = packets.shift() + var done = completeParse if (packet) { that._handlePacket(packet, nextTickWork) } else { - var done = completeParse completeParse = null - if (done) done() + done() } } @@ -300,10 +308,7 @@ MqttClient.prototype._setupStream = function () { this.stream.on('error', nop) // Echo stream close - this.stream.on('close', function () { - flushVolatile(that.outgoing) - that.emit('close') - }) + eos(this.stream, this.emit.bind(this, 'close')) // Send a connect packet connectPacket = Object.create(this.options) @@ -314,18 +319,6 @@ MqttClient.prototype._setupStream = function () { // Echo connection errors parser.on('error', this.emit.bind(this, 'error')) - // auth - if (this.options.properties) { - if (!this.options.properties.authenticationMethod && this.options.properties.authenticationData) { - this.emit('error', new Error('Packet has no Authentication Method')) - return this - } - if (this.options.properties.authenticationMethod && this.options.authPacket && typeof this.options.authPacket === 'object') { - var authPacket = xtend({cmd: 'auth', reasonCode: 0}, this.options.authPacket) - sendPacket(this, authPacket) - } - } - // many drain listeners are needed for qos 1 callbacks if the connection is intermittent this.stream.setMaxListeners(1000) @@ -336,14 +329,6 @@ MqttClient.prototype._setupStream = function () { } MqttClient.prototype._handlePacket = function (packet, done) { - var options = this.options - - if (options.protocolVersion === 5 && options.properties && options.properties.maximumPacketSize && options.properties.maximumPacketSize < packet.length) { - this.emit('error', new Error('exceeding packets size ' + packet.cmd)) - this.end({reasonCode: 149, properties: { reasonString: 'Maximum packet size was exceeded' }}) - return this - } - this.emit('packetreceive', packet) switch (packet.cmd) { @@ -369,10 +354,6 @@ MqttClient.prototype._handlePacket = function (packet, done) { this._handlePingresp(packet) done() break - case 'disconnect': - this._handleDisconnect(packet) - done() - break default: // do nothing // maybe we should do an error handling @@ -401,7 +382,6 @@ MqttClient.prototype._checkDisconnecting = function (callback) { * {Number} qos - qos level to publish on * {Boolean} retain - whether or not to retain the message * {Boolean} dup - whether or not mark a message as duplicate - * {Function} cbStorePut - function(){} called when message is put into `outgoingStore` * @param {Function} [callback] - function(err){} * called when publish succeeds or fails * @returns {MqttClient} this - for chaining @@ -414,7 +394,6 @@ MqttClient.prototype._checkDisconnecting = function (callback) { */ MqttClient.prototype.publish = function (topic, message, opts, callback) { var packet - var options = this.options // .publish(topic, payload, cb); if (typeof opts === 'function') { @@ -440,42 +419,16 @@ MqttClient.prototype.publish = function (topic, message, opts, callback) { dup: opts.dup } - if (options.protocolVersion === 5) { - packet.properties = opts.properties - if ((!options.properties && packet.properties && packet.properties.topicAlias) || ((opts.properties && options.properties) && - ((opts.properties.topicAlias && options.properties.topicAliasMaximum && opts.properties.topicAlias > options.properties.topicAliasMaximum) || - (!options.properties.topicAliasMaximum && opts.properties.topicAlias)))) { - /* - if we are don`t setup topic alias or - topic alias maximum less than topic alias or - server don`t give topic alias maximum, - we are removing topic alias from packet - */ - delete packet.properties.topicAlias - } - } - switch (opts.qos) { case 1: case 2: + // Add to callbacks - this.outgoing[packet.messageId] = { - volatile: false, - cb: callback || nop - } - if (this._storeProcessing) { - this._packetIdsDuringStoreProcessing[packet.messageId] = false - this._storePacket(packet, undefined, opts.cbStorePut) - } else { - this._sendPacket(packet, undefined, opts.cbStorePut) - } + this.outgoing[packet.messageId] = callback || nop + this._sendPacket(packet) break default: - if (this._storeProcessing) { - this._storePacket(packet, callback, opts.cbStorePut) - } else { - this._sendPacket(packet, callback, opts.cbStorePut) - } + this._sendPacket(packet, callback) break } @@ -495,15 +448,12 @@ MqttClient.prototype.publish = function (topic, message, opts, callback) { * @api public * @example client.subscribe('topic'); * @example client.subscribe('topic', {qos: 1}); - * @example client.subscribe({'topic': {qos: 0}, 'topic2': {qos: 1}}, console.log); + * @example client.subscribe({'topic': 0, 'topic2': 1}, console.log); * @example client.subscribe('topic', console.log); */ MqttClient.prototype.subscribe = function () { var packet - var args = new Array(arguments.length) - for (var i = 0; i < arguments.length; i++) { - args[i] = arguments[i] - } + var args = Array.prototype.slice.call(arguments) var subs = [] var obj = args.shift() var resubscribe = obj.resubscribe @@ -511,7 +461,6 @@ MqttClient.prototype.subscribe = function () { var opts = args.pop() var invalidTopic var that = this - var version = this.options.protocolVersion delete obj.resubscribe @@ -534,52 +483,31 @@ MqttClient.prototype.subscribe = function () { return this } - var defaultOpts = { - qos: 0 - } - if (version === 5) { - defaultOpts.nl = false - defaultOpts.rap = false - defaultOpts.rh = 0 - } + var defaultOpts = { qos: 0 } opts = xtend(defaultOpts, opts) if (Array.isArray(obj)) { obj.forEach(function (topic) { - if (!that._resubscribeTopics.hasOwnProperty(topic) || - that._resubscribeTopics[topic].qos < opts.qos || + if (that._resubscribeTopics[topic] < opts.qos || + !that._resubscribeTopics.hasOwnProperty(topic) || resubscribe) { - var currentOpts = { + subs.push({ topic: topic, qos: opts.qos - } - if (version === 5) { - currentOpts.nl = opts.nl - currentOpts.rap = opts.rap - currentOpts.rh = opts.rh - currentOpts.properties = opts.properties - } - subs.push(currentOpts) + }) } }) } else { Object .keys(obj) .forEach(function (k) { - if (!that._resubscribeTopics.hasOwnProperty(k) || - that._resubscribeTopics[k].qos < obj[k].qos || + if (that._resubscribeTopics[k] < obj[k] || + !that._resubscribeTopics.hasOwnProperty(k) || resubscribe) { - var currentOpts = { + subs.push({ topic: k, - qos: obj[k].qos - } - if (version === 5) { - currentOpts.nl = obj[k].nl - currentOpts.rap = obj[k].rap - currentOpts.rh = obj[k].rh - currentOpts.properties = opts.properties - } - subs.push(currentOpts) + qos: obj[k] + }) } }) } @@ -593,10 +521,6 @@ MqttClient.prototype.subscribe = function () { messageId: this._nextId() } - if (opts.properties) { - packet.properties = opts.properties - } - if (!subs.length) { callback(null, []) return @@ -607,32 +531,22 @@ MqttClient.prototype.subscribe = function () { var topics = [] subs.forEach(function (sub) { if (that.options.reconnectPeriod > 0) { - var topic = { qos: sub.qos } - if (version === 5) { - topic.nl = sub.nl || false - topic.rap = sub.rap || false - topic.rh = sub.rh || 0 - topic.properties = sub.properties - } - that._resubscribeTopics[sub.topic] = topic + that._resubscribeTopics[sub.topic] = sub.qos topics.push(sub.topic) } }) that.messageIdToTopic[packet.messageId] = topics } - this.outgoing[packet.messageId] = { - volatile: true, - cb: function (err, packet) { - if (!err) { - var granted = packet.granted - for (var i = 0; i < granted.length; i += 1) { - subs[i].qos = granted[i] - } + this.outgoing[packet.messageId] = function (err, packet) { + if (!err) { + var granted = packet.granted + for (var i = 0; i < granted.length; i += 1) { + subs[i].qos = granted[i] } - - callback(err, subs) } + + callback(err, subs) } this._sendPacket(packet) @@ -644,37 +558,21 @@ MqttClient.prototype.subscribe = function () { * unsubscribe - unsubscribe from topic(s) * * @param {String, Array} topic - topics to unsubscribe from - * @param {Object} [opts] - optional subscription options, includes: - * {Object} properties - properties of unsubscribe packet * @param {Function} [callback] - callback fired on unsuback * @returns {MqttClient} this - for chaining * @api public * @example client.unsubscribe('topic'); * @example client.unsubscribe('topic', console.log); */ -MqttClient.prototype.unsubscribe = function () { +MqttClient.prototype.unsubscribe = function (topic, callback) { var packet = { cmd: 'unsubscribe', qos: 1, messageId: this._nextId() } var that = this - var args = new Array(arguments.length) - for (var i = 0; i < arguments.length; i++) { - args[i] = arguments[i] - } - var topic = args.shift() - var callback = args.pop() || nop - var opts = args.pop() - if (typeof topic === 'string') { - topic = [topic] - } - - if (typeof callback !== 'function') { - opts = callback - callback = nop - } + callback = callback || nop if (this._checkDisconnecting(callback)) { return this @@ -692,14 +590,7 @@ MqttClient.prototype.unsubscribe = function () { }) } - if (typeof opts === 'object' && opts.properties) { - packet.properties = opts.properties - } - - this.outgoing[packet.messageId] = { - volatile: true, - cb: callback - } + this.outgoing[packet.messageId] = callback this._sendPacket(packet) @@ -715,33 +606,14 @@ MqttClient.prototype.unsubscribe = function () { * * @api public */ -MqttClient.prototype.end = function () { +MqttClient.prototype.end = function (force, cb) { var that = this - var force = arguments[0] - var opts = arguments[1] - var cb = arguments[2] - - if (force == null || typeof force !== 'boolean') { - cb = opts || nop - opts = force + if (typeof force === 'function') { + cb = force force = false - if (typeof opts !== 'object') { - cb = opts - opts = null - if (typeof cb !== 'function') { - cb = nop - } - } } - if (typeof opts !== 'object') { - cb = opts - opts = null - } - - cb = cb || nop - function closeStores () { that.disconnected = true that.incomingStore.close(function () { @@ -761,7 +633,7 @@ MqttClient.prototype.end = function () { // defer closesStores of an I/O cycle, // just to make sure things are // ok for websockets - that._cleanUp(force, setImmediate.bind(null, closeStores), opts) + that._cleanUp(force, setImmediate.bind(null, closeStores)) } if (this.disconnecting) { @@ -793,7 +665,7 @@ MqttClient.prototype.end = function () { * @example client.removeOutgoingMessage(client.getLastMessageId()); */ MqttClient.prototype.removeOutgoingMessage = function (mid) { - var cb = this.outgoing[mid] ? this.outgoing[mid].cb : null + var cb = this.outgoing[mid] delete this.outgoing[mid] this.outgoingStore.del({messageId: mid}, function () { cb(new Error('Message removed')) @@ -879,7 +751,6 @@ MqttClient.prototype._clearReconnect = function () { * @api private */ MqttClient.prototype._cleanUp = function (forced, done) { - var opts = arguments[2] if (done) { this.stream.on('close', done) } @@ -890,9 +761,8 @@ MqttClient.prototype._cleanUp = function (forced, done) { } this.stream.destroy() } else { - var packet = xtend({ cmd: 'disconnect' }, opts) this._sendPacket( - packet, + { cmd: 'disconnect' }, setImmediate.bind( null, this.stream.end.bind(this.stream) @@ -921,14 +791,23 @@ MqttClient.prototype._cleanUp = function (forced, done) { * @param {String} type - packet type (see `protocol`) * @param {Object} packet - packet options * @param {Function} cb - callback when the packet is sent - * @param {Function} cbStorePut - called when message is put into outgoingStore * @api private */ -MqttClient.prototype._sendPacket = function (packet, cb, cbStorePut) { - cbStorePut = cbStorePut || nop - +MqttClient.prototype._sendPacket = function (packet, cb) { if (!this.connected) { - this._storePacket(packet, cb, cbStorePut) + if (((packet.qos || 0) === 0 && this.queueQoSZero) || packet.cmd !== 'publish') { + this.queue.push({ packet: packet, cb: cb }) + } else if (packet.qos > 0) { + cb = this.outgoing[packet.messageId] + this.outgoingStore.put(packet, function (err) { + if (err) { + return cb && cb(err) + } + }) + } else if (cb) { + cb(new Error('No connection to broker')) + } + return } @@ -939,7 +818,7 @@ MqttClient.prototype._sendPacket = function (packet, cb, cbStorePut) { case 'publish': break case 'pubrel': - storeAndSend(this, packet, cb, cbStorePut) + storeAndSend(this, packet, cb) return default: sendPacket(this, packet, cb) @@ -949,7 +828,7 @@ MqttClient.prototype._sendPacket = function (packet, cb, cbStorePut) { switch (packet.qos) { case 2: case 1: - storeAndSend(this, packet, cb, cbStorePut) + storeAndSend(this, packet, cb) break /** * no need of case here since it will be caught by default @@ -964,32 +843,6 @@ MqttClient.prototype._sendPacket = function (packet, cb, cbStorePut) { } } -/** - * _storePacket - queue a packet - * @param {String} type - packet type (see `protocol`) - * @param {Object} packet - packet options - * @param {Function} cb - callback when the packet is sent - * @param {Function} cbStorePut - called when message is put into outgoingStore - * @api private - */ -MqttClient.prototype._storePacket = function (packet, cb, cbStorePut) { - cbStorePut = cbStorePut || nop - - if (((packet.qos || 0) === 0 && this.queueQoSZero) || packet.cmd !== 'publish') { - this.queue.push({ packet: packet, cb: cb }) - } else if (packet.qos > 0) { - cb = this.outgoing[packet.messageId] ? this.outgoing[packet.messageId].cb : null - this.outgoingStore.put(packet, function (err) { - if (err) { - return cb && cb(err) - } - cbStorePut() - }) - } else if (cb) { - cb(new Error('No connection to broker')) - } -} - /** * _setupPingTimer - setup the ping timer * @@ -1048,30 +901,21 @@ MqttClient.prototype._handlePingresp = function () { */ MqttClient.prototype._handleConnack = function (packet) { - var options = this.options - var version = options.protocolVersion - var rc = version === 5 ? packet.reasonCode : packet.returnCode + var rc = packet.returnCode + var errors = [ + '', + 'Unacceptable protocol version', + 'Identifier rejected', + 'Server unavailable', + 'Bad username or password', + 'Not authorized' + ] clearTimeout(this.connackTimer) - if (packet.properties) { - if (packet.properties.topicAliasMaximum) { - if (!options.properties) { options.properties = {} } - options.properties.topicAliasMaximum = packet.properties.topicAliasMaximum - } - if (packet.properties.serverKeepAlive && options.keepalive) { - options.keepalive = packet.properties.serverKeepAlive - this._shiftPingInterval() - } - if (packet.properties.maximumPacketSize) { - if (!options.properties) { options.properties = {} } - options.properties.maximumPacketSize = packet.properties.maximumPacketSize - } - } - if (rc === 0) { this.reconnecting = false - this._onConnect(packet) + this.emit('connect', packet) } else if (rc > 0) { var err = new Error('Connection refused: ' + errors[rc]) err.code = rc @@ -1116,47 +960,28 @@ MqttClient.prototype._handlePublish = function (packet, done) { var qos = packet.qos var mid = packet.messageId var that = this - var options = this.options - var validReasonCodes = [0, 16, 128, 131, 135, 144, 145, 151, 153] switch (qos) { - case 2: { - options.customHandleAcks(topic, message, packet, function (error, code) { - if (!(error instanceof Error)) { - code = error - error = null - } - if (error) { return that.emit('error', error) } - if (validReasonCodes.indexOf(code) === -1) { return that.emit('error', new Error('Wrong reason code for pubrec')) } - if (code) { - that._sendPacket({cmd: 'pubrec', messageId: mid, reasonCode: code}, done) - } else { - that.incomingStore.put(packet, function () { - that._sendPacket({cmd: 'pubrec', messageId: mid}, done) - }) + case 2: + this.incomingStore.put(packet, function (err) { + if (err) { + return done(err) } + that._sendPacket({cmd: 'pubrec', messageId: mid}, done) }) break - } - case 1: { + case 1: // emit the message event - options.customHandleAcks(topic, message, packet, function (error, code) { - if (!(error instanceof Error)) { - code = error - error = null + this.emit('message', topic, message, packet) + this.handleMessage(packet, function (err) { + if (err) { + return done(err) } - if (error) { return that.emit('error', error) } - if (validReasonCodes.indexOf(code) === -1) { return that.emit('error', new Error('Wrong reason code for puback')) } - if (!code) { that.emit('message', topic, message, packet) } - that.handleMessage(packet, function (err) { - if (err) { - return done && done(err) - } - that._sendPacket({cmd: 'puback', messageId: mid, reasonCode: code}, done) - }) + // send 'puback' if the above 'handleMessage' method executed + // successfully. + that._sendPacket({cmd: 'puback', messageId: mid}, done) }) break - } case 0: // emit the message event this.emit('message', topic, message, packet) @@ -1193,9 +1018,8 @@ MqttClient.prototype._handleAck = function (packet) { var mid = packet.messageId var type = packet.cmd var response = null - var cb = this.outgoing[mid] ? this.outgoing[mid].cb : null + var cb = this.outgoing[mid] var that = this - var err if (!cb) { // Server sent an ack in error, ignore it. @@ -1207,13 +1031,7 @@ MqttClient.prototype._handleAck = function (packet) { case 'pubcomp': // same thing as puback for QoS 2 case 'puback': - var pubackRC = packet.reasonCode // Callback - we're done - if (pubackRC && pubackRC > 0 && pubackRC !== 16) { - err = new Error('Publish error: ' + errors[pubackRC]) - err.code = pubackRC - cb(err, packet) - } delete this.outgoing[mid] this.outgoingStore.del(packet, cb) break @@ -1223,27 +1041,18 @@ MqttClient.prototype._handleAck = function (packet) { qos: 2, messageId: mid } - var pubrecRC = packet.reasonCode - if (pubrecRC && pubrecRC > 0 && pubrecRC !== 16) { - err = new Error('Publish error: ' + errors[pubrecRC]) - err.code = pubrecRC - cb(err, packet) - } else { - this._sendPacket(response) - } + this._sendPacket(response) break case 'suback': delete this.outgoing[mid] - for (var grantedI = 0; grantedI < packet.granted.length; grantedI++) { - if ((packet.granted[grantedI] & 0x80) !== 0) { - // suback with Failure status - var topics = this.messageIdToTopic[mid] - if (topics) { - topics.forEach(function (topic) { - delete that._resubscribeTopics[topic] - }) - } + if (packet.granted.length === 1 && (packet.granted[0] & 0x80) !== 0) { + // suback with Failure status + var topics = this.messageIdToTopic[mid] + if (topics) { + topics.forEach(function (topic) { + delete that._resubscribeTopics[topic] + }) } } cb(null, packet) @@ -1276,14 +1085,18 @@ MqttClient.prototype._handlePubrel = function (packet, callback) { var comp = {cmd: 'pubcomp', messageId: mid} that.incomingStore.get(packet, function (err, pub) { - if (!err) { + if (!err && pub.cmd !== 'pubrel') { that.emit('message', pub.topic, pub.payload, pub) - that.handleMessage(pub, function (err) { + that.incomingStore.put(packet, function (err) { if (err) { return callback(err) } - that.incomingStore.del(pub, nop) - that._sendPacket(comp, callback) + that.handleMessage(pub, function (err) { + if (err) { + return callback(err) + } + that._sendPacket(comp, callback) + }) }) } else { that._sendPacket(comp, callback) @@ -1291,16 +1104,6 @@ MqttClient.prototype._handlePubrel = function (packet, callback) { }) } -/** - * _handleDisconnect - * - * @param {Object} packet - * @api private - */ -MqttClient.prototype._handleDisconnect = function (packet) { - this.emit('disconnect', packet) -} - /** * _nextId * @return unsigned int @@ -1323,138 +1126,4 @@ MqttClient.prototype.getLastMessageId = function () { return (this.nextId === 1) ? 65535 : (this.nextId - 1) } -/** - * _resubscribe - * @api private - */ -MqttClient.prototype._resubscribe = function (connack) { - var _resubscribeTopicsKeys = Object.keys(this._resubscribeTopics) - if (!this._firstConnection && - (this.options.clean || (this.options.protocolVersion === 5 && !connack.sessionPresent)) && - _resubscribeTopicsKeys.length > 0) { - if (this.options.resubscribe) { - if (this.options.protocolVersion === 5) { - for (var topicI = 0; topicI < _resubscribeTopicsKeys.length; topicI++) { - var resubscribeTopic = {} - resubscribeTopic[_resubscribeTopicsKeys[topicI]] = this._resubscribeTopics[_resubscribeTopicsKeys[topicI]] - resubscribeTopic.resubscribe = true - this.subscribe(resubscribeTopic, {properties: resubscribeTopic[_resubscribeTopicsKeys[topicI]].properties}) - } - } else { - this._resubscribeTopics.resubscribe = true - this.subscribe(this._resubscribeTopics) - } - } else { - this._resubscribeTopics = {} - } - } - - this._firstConnection = false -} - -/** - * _onConnect - * - * @api private - */ -MqttClient.prototype._onConnect = function (packet) { - if (this.disconnected) { - this.emit('connect', packet) - return - } - - var that = this - - this._setupPingTimer() - this._resubscribe(packet) - - this.connected = true - - function startStreamProcess () { - var outStore = that.outgoingStore.createStream() - - function clearStoreProcessing () { - that._storeProcessing = false - that._packetIdsDuringStoreProcessing = {} - } - - that.once('close', remove) - outStore.on('error', function (err) { - clearStoreProcessing() - that.removeListener('close', remove) - that.emit('error', err) - }) - - function remove () { - outStore.destroy() - outStore = null - clearStoreProcessing() - } - - function storeDeliver () { - // edge case, we wrapped this twice - if (!outStore) { - return - } - that._storeProcessing = true - - var packet = outStore.read(1) - - var cb - - if (!packet) { - // read when data is available in the future - outStore.once('readable', storeDeliver) - return - } - - // Skip already processed store packets - if (that._packetIdsDuringStoreProcessing[packet.messageId]) { - storeDeliver() - return - } - - // Avoid unnecessary stream read operations when disconnected - if (!that.disconnecting && !that.reconnectTimer) { - cb = that.outgoing[packet.messageId] ? that.outgoing[packet.messageId].cb : null - that.outgoing[packet.messageId] = { - volatile: false, - cb: function (err, status) { - // Ensure that the original callback passed in to publish gets invoked - if (cb) { - cb(err, status) - } - - storeDeliver() - } - } - that._packetIdsDuringStoreProcessing[packet.messageId] = true - that._sendPacket(packet) - } else if (outStore.destroy) { - outStore.destroy() - } - } - - outStore.on('end', function () { - var allProcessed = true - for (var id in that._packetIdsDuringStoreProcessing) { - if (!that._packetIdsDuringStoreProcessing[id]) { - allProcessed = false - break - } - } - if (allProcessed) { - clearStoreProcessing() - that.removeListener('close', remove) - that.emit('connect', packet) - } else { - startStreamProcess() - } - }) - storeDeliver() - } - // start flowing - startStreamProcess() -} - module.exports = MqttClient diff --git a/node_modules/mqtt/lib/connect/ali.js b/node_modules/mqtt/lib/connect/ali.js deleted file mode 100644 index 1f3c725..0000000 --- a/node_modules/mqtt/lib/connect/ali.js +++ /dev/null @@ -1,130 +0,0 @@ -'use strict' - -var Transform = require('readable-stream').Transform -var duplexify = require('duplexify') -var base64 = require('base64-js') - -/* global FileReader */ -var my -var proxy -var stream -var isInitialized = false - -function buildProxy () { - var proxy = new Transform() - proxy._write = function (chunk, encoding, next) { - my.sendSocketMessage({ - data: chunk.buffer, - success: function () { - next() - }, - fail: function () { - next(new Error()) - } - }) - } - proxy._flush = function socketEnd (done) { - my.closeSocket({ - success: function () { - done() - } - }) - } - - return proxy -} - -function setDefaultOpts (opts) { - if (!opts.hostname) { - opts.hostname = 'localhost' - } - if (!opts.path) { - opts.path = '/' - } - - if (!opts.wsOptions) { - opts.wsOptions = {} - } -} - -function buildUrl (opts, client) { - var protocol = opts.protocol === 'alis' ? 'wss' : 'ws' - var url = protocol + '://' + opts.hostname + opts.path - if (opts.port && opts.port !== 80 && opts.port !== 443) { - url = protocol + '://' + opts.hostname + ':' + opts.port + opts.path - } - if (typeof (opts.transformWsUrl) === 'function') { - url = opts.transformWsUrl(url, opts, client) - } - return url -} - -function bindEventHandler () { - if (isInitialized) return - - isInitialized = true - - my.onSocketOpen(function () { - stream.setReadable(proxy) - stream.setWritable(proxy) - stream.emit('connect') - }) - - my.onSocketMessage(function (res) { - if (typeof res.data === 'string') { - var array = base64.toByteArray(res.data) - var buffer = Buffer.from(array) - proxy.push(buffer) - } else { - var reader = new FileReader() - reader.addEventListener('load', function () { - var data = reader.result - - if (data instanceof ArrayBuffer) data = Buffer.from(data) - else data = Buffer.from(data, 'utf8') - proxy.push(data) - }) - reader.readAsArrayBuffer(res.data) - } - }) - - my.onSocketClose(function () { - stream.end() - stream.destroy() - }) - - my.onSocketError(function (res) { - stream.destroy(res) - }) -} - -function buildStream (client, opts) { - opts.hostname = opts.hostname || opts.host - - if (!opts.hostname) { - throw new Error('Could not determine host. Specify host manually.') - } - - var websocketSubProtocol = - (opts.protocolId === 'MQIsdp') && (opts.protocolVersion === 3) - ? 'mqttv3.1' - : 'mqtt' - - setDefaultOpts(opts) - - var url = buildUrl(opts, client) - my = opts.my - my.connectSocket({ - url: url, - protocols: websocketSubProtocol - }) - - proxy = buildProxy() - stream = duplexify.obj() - - bindEventHandler() - - return stream -} - -module.exports = buildStream diff --git a/node_modules/mqtt/lib/connect/index.js b/node_modules/mqtt/lib/connect/index.js index a989618..5ec9c3b 100644 --- a/node_modules/mqtt/lib/connect/index.js +++ b/node_modules/mqtt/lib/connect/index.js @@ -15,9 +15,6 @@ if (process.title !== 'browser') { } else { protocols.wx = require('./wx') protocols.wxs = require('./wx') - - protocols.ali = require('./ali') - protocols.alis = require('./ali') } protocols.ws = require('./ws') @@ -79,7 +76,7 @@ function connect (brokerUrl, opts) { if (opts.cert && opts.key) { if (opts.protocol) { - if (['mqtts', 'wss', 'wxs', 'alis'].indexOf(opts.protocol) === -1) { + if (['mqtts', 'wss', 'wxs'].indexOf(opts.protocol) === -1) { switch (opts.protocol) { case 'mqtt': opts.protocol = 'mqtts' @@ -90,9 +87,6 @@ function connect (brokerUrl, opts) { case 'wx': opts.protocol = 'wxs' break - case 'ali': - opts.protocol = 'alis' - break default: throw new Error('Unknown protocol for secure connection: "' + opts.protocol + '"!') } @@ -111,9 +105,7 @@ function connect (brokerUrl, opts) { 'ws', 'wss', 'wx', - 'wxs', - 'ali', - 'alis' + 'wxs' ].filter(function (key, index) { if (isSecure && index % 2 === 0) { // Skip insecure protocols when requesting a secure one. diff --git a/node_modules/mqtt/lib/connect/wx.js b/node_modules/mqtt/lib/connect/wx.js index c5048b5..5178117 100644 --- a/node_modules/mqtt/lib/connect/wx.js +++ b/node_modules/mqtt/lib/connect/wx.js @@ -1,35 +1,76 @@ 'use strict' -var Transform = require('readable-stream').Transform -var duplexify = require('duplexify') - /* global wx */ -var socketTask -var proxy -var stream +var socketOpen = false +var socketMsgQueue = [] -function buildProxy () { - var proxy = new Transform() - proxy._write = function (chunk, encoding, next) { - socketTask.send({ - data: chunk.buffer, - success: function () { - next() - }, - fail: function (errMsg) { - next(new Error(errMsg)) - } +function sendSocketMessage (msg) { + if (socketOpen) { + wx.sendSocketMessage({ + data: msg.buffer || msg }) + } else { + socketMsgQueue.push(msg) } - proxy._flush = function socketEnd (done) { - socketTask.close({ - success: function () { - done() - } - }) +} + +function WebSocket (url, protocols) { + var ws = { + OPEN: 1, + CLOSING: 2, + CLOSED: 3, + readyState: socketOpen ? 1 : 0, + send: sendSocketMessage, + close: wx.closeSocket, + onopen: null, + onmessage: null, + onclose: null, + onerror: null } - return proxy + wx.connectSocket({ + url: url, + protocols: protocols + }) + wx.onSocketOpen(function (res) { + ws.readyState = ws.OPEN + socketOpen = true + for (var i = 0; i < socketMsgQueue.length; i++) { + sendSocketMessage(socketMsgQueue[i]) + } + socketMsgQueue = [] + + ws.onopen && ws.onopen.apply(ws, arguments) + }) + wx.onSocketMessage(function (res) { + ws.onmessage && ws.onmessage.apply(ws, arguments) + }) + wx.onSocketClose(function () { + ws.onclose && ws.onclose.apply(ws, arguments) + ws.readyState = ws.CLOSED + socketOpen = false + }) + wx.onSocketError(function () { + ws.onerror && ws.onerror.apply(ws, arguments) + ws.readyState = ws.CLOSED + socketOpen = false + }) + + return ws +} + +var websocket = require('websocket-stream') + +function buildUrl (opts, client) { + var protocol = opts.protocol === 'wxs' ? 'wss' : 'ws' + var url = protocol + '://' + opts.hostname + opts.path + if (opts.port && opts.port !== 80 && opts.port !== 443) { + url = protocol + '://' + opts.hostname + ':' + opts.port + opts.path + } + if (typeof (opts.transformWsUrl) === 'function') { + url = opts.transformWsUrl(url, opts, client) + } + return url } function setDefaultOpts (opts) { @@ -45,90 +86,25 @@ function setDefaultOpts (opts) { } } -function buildUrl (opts, client) { - var protocol = opts.protocol === 'wxs' ? 'wss' : 'ws' - var url = protocol + '://' + opts.hostname + opts.path - if (opts.port && opts.port !== 80 && opts.port !== 443) { - url = protocol + '://' + opts.hostname + ':' + opts.port + opts.path - } - if (typeof (opts.transformWsUrl) === 'function') { - url = opts.transformWsUrl(url, opts, client) - } - return url -} - -function bindEventHandler () { - socketTask.onOpen(function () { - stream.setReadable(proxy) - stream.setWritable(proxy) - stream.emit('connect') - }) - - socketTask.onMessage(function (res) { - var data = res.data - - if (data instanceof ArrayBuffer) data = Buffer.from(data) - else data = Buffer.from(data, 'utf8') - proxy.push(data) - }) - - socketTask.onClose(function () { - stream.end() - stream.destroy() - }) - - socketTask.onError(function (res) { - stream.destroy(new Error(res.errMsg)) - }) -} - -function buildStream (client, opts) { - opts.hostname = opts.hostname || opts.host - - if (!opts.hostname) { - throw new Error('Could not determine host. Specify host manually.') - } - +function createWebSocket (client, opts) { var websocketSubProtocol = (opts.protocolId === 'MQIsdp') && (opts.protocolVersion === 3) ? 'mqttv3.1' : 'mqtt' setDefaultOpts(opts) - var url = buildUrl(opts, client) - socketTask = wx.connectSocket({ - url: url, - protocols: websocketSubProtocol - }) - - proxy = buildProxy() - stream = duplexify.obj() - stream._destroy = function (err, cb) { - socketTask.close({ - success: function () { - cb && cb(err) - } - }) - } - - var destroyRef = stream.destroy - stream.destroy = function () { - stream.destroy = destroyRef - - var self = this - process.nextTick(function () { - socketTask.close({ - fail: function () { - self._destroy(new Error()) - } - }) - }) - }.bind(stream) - - bindEventHandler() - - return stream + return websocket(WebSocket(url, [websocketSubProtocol])) } -module.exports = buildStream +function buildBuilder (client, opts) { + opts.hostname = opts.hostname || opts.host + + if (!opts.hostname) { + throw new Error('Could not determine host. Specify host manually.') + } + + return createWebSocket(client, opts) +} + +module.exports = buildBuilder diff --git a/node_modules/mqtt/package.json b/node_modules/mqtt/package.json index c4bfbc6..cc6ad37 100644 --- a/node_modules/mqtt/package.json +++ b/node_modules/mqtt/package.json @@ -1,11 +1,10 @@ { "name": "mqtt", "description": "A library for the MQTT protocol", - "version": "3.0.0", + "version": "2.18.9", "contributors": [ "Adam Rudd ", - "Matteo Collina (https://github.com/mcollina)", - "Siarhei Buntsevich (https://github.com/scarry1992)" + "Matteo Collina (https://github.com/mcollina)" ], "keywords": [ "mqtt", @@ -30,13 +29,10 @@ "prepare": "npm run browser-build", "browser-build": "rimraf dist/ && mkdirp dist/ && browserify mqtt.js -s mqtt > dist/mqtt.js && uglifyjs < dist/mqtt.js > dist/mqtt.min.js", "browser-test": "zuul --server test/browser/server.js --local --open test/browser/test.js", + "weapp-test": "zuul --server test/browser/server.js --local --open test/browser/wx.js", "sauce-test": "zuul --server test/browser/server.js --tunnel ngrok -- test/browser/test.js", - "ci": "npm run tslint && npm run typescript-compile-test && npm run test && codecov" + "ci": "npm run tslint && npm run typescript-test && npm run test && codecov" }, - "pre-commit": [ - "test", - "tslint" - ], "bin": { "mqtt_pub": "./bin/pub.js", "mqtt_sub": "./bin/sub.js", @@ -63,7 +59,6 @@ "net": false }, "dependencies": { - "base64-js": "^1.3.0", "commist": "^1.0.0", "concat-stream": "^1.6.2", "end-of-stream": "^1.4.1", @@ -71,34 +66,34 @@ "help-me": "^1.0.1", "inherits": "^2.0.3", "minimist": "^1.2.0", - "mqtt-packet": "^6.0.0", + "mqtt-packet": "^5.6.0", "pump": "^3.0.0", "readable-stream": "^2.3.6", "reinterval": "^1.1.0", - "split2": "^3.1.0", - "websocket-stream": "^5.1.2", + "split2": "^2.1.1", + "websocket-stream": "~5.2.0", "xtend": "^4.0.1" }, "devDependencies": { - "@types/node": "^10.0.0", + "@types/node": "^8.10.21", "browserify": "^16.2.2", "codecov": "^3.0.4", "global": "^4.3.2", "istanbul": "^0.4.5", "mkdirp": "^0.5.1", "mocha": "^4.1.0", - "mqtt-connection": "^4.0.0", + "mqtt-connection": "^3.0.0", "pre-commit": "^1.2.2", "rimraf": "^2.6.2", "safe-buffer": "^5.1.2", "should": "^13.2.1", "sinon": "~1.17.7", - "snazzy": "^8.0.0", + "snazzy": "^7.1.1", "standard": "^11.0.1", - "through2": "^3.0.0", + "through2": "^2.0.3", "tslint": "^5.11.0", - "tslint-config-standard": "^8.0.1", - "typescript": "^3.2.2", + "tslint-config-standard": "^7.1.0", + "typescript": "^2.9.2", "uglify-js": "^3.4.5", "ws": "^3.3.3", "zuul": "^3.12.0", diff --git a/node_modules/mqtt/test/abstract_client.js b/node_modules/mqtt/test/abstract_client.js index 017a2e3..87c0b98 100644 --- a/node_modules/mqtt/test/abstract_client.js +++ b/node_modules/mqtt/test/abstract_client.js @@ -12,7 +12,6 @@ var Store = require('./../lib/store') var port = 9876 module.exports = function (server, config) { - var version = config.protocolVersion || 4 function connect (opts) { opts = xtend(config, opts) return mqtt.connect(opts) @@ -303,13 +302,11 @@ module.exports = function (server, config) { }) it('should provide connack packet with connect event', function (done) { - var connack = version === 5 ? {reasonCode: 0} : {returnCode: 0} server.once('client', function (serverClient) { - connack.sessionPresent = true - serverClient.connack(connack) + serverClient.connack({returnCode: 0, sessionPresent: true}) + server.once('client', function (serverClient) { - connack.sessionPresent = false - serverClient.connack(connack) + serverClient.connack({returnCode: 0, sessionPresent: false}) }) }) @@ -342,8 +339,7 @@ module.exports = function (server, config) { done(new Error('Should not emit connect')) }) client.once('error', function (error) { - var value = version === 5 ? 128 : 2 - should(error.code).be.equal(value) // code for clientID identifer rejected + should(error.code).be.equal(2) // code for clientID identifer rejected client.end() done() }) @@ -536,64 +532,6 @@ module.exports = function (server, config) { }) }) - it('should not interrupt messages', function (done) { - var client = null - var incomingStore = new mqtt.Store({ clean: false }) - var outgoingStore = new mqtt.Store({ clean: false }) - var publishCount = 0 - var server2 = new Server(function (c) { - c.on('connect', function () { - c.connack({returnCode: 0}) - }) - c.on('publish', function (packet) { - if (packet.qos !== 0) { - c.puback({messageId: packet.messageId}) - } - switch (publishCount++) { - case 0: - packet.payload.toString().should.equal('payload1') - break - case 1: - packet.payload.toString().should.equal('payload2') - break - case 2: - packet.payload.toString().should.equal('payload3') - break - case 3: - packet.payload.toString().should.equal('payload4') - server2.close() - done() - break - } - }) - }) - - server2.listen(port + 50, function () { - client = mqtt.connect({ - port: port + 50, - host: 'localhost', - clean: false, - clientId: 'cid1', - reconnectPeriod: 0, - incomingStore: incomingStore, - outgoingStore: outgoingStore, - queueQoSZero: true - }) - client.on('packetreceive', function (packet) { - if (packet.cmd === 'connack') { - setImmediate( - function () { - client.publish('test', 'payload3', {qos: 1}) - client.publish('test', 'payload4', {qos: 0}) - } - ) - } - }) - client.publish('test', 'payload1', {qos: 2}) - client.publish('test', 'payload2', {qos: 2}) - }) - }) - it('should call cb if an outgoing QoS 0 message is not sent', function (done) { var client = connect({queueQoSZero: false}) var called = false @@ -1066,7 +1004,7 @@ module.exports = function (server, config) { return new AsyncStore() } } - AsyncStore.prototype.del = function (packet, cb) { + AsyncStore.prototype.put = function (packet, cb) { process.nextTick(function () { cb(new Error('Error')) }) @@ -1089,15 +1027,15 @@ module.exports = function (server, config) { }) it('should handle success with async incoming store in QoS 2 `handlePubrel` method', function (done) { - var delComplete = false + var putComplete = false function AsyncStore () { if (!(this instanceof AsyncStore)) { return new AsyncStore() } } - AsyncStore.prototype.del = function (packet, cb) { + AsyncStore.prototype.put = function (packet, cb) { process.nextTick(function () { - delComplete = true + putComplete = true cb(null) }) } @@ -1113,7 +1051,7 @@ module.exports = function (server, config) { messageId: 1, qos: 2 }, function () { - delComplete.should.equal(true) + putComplete.should.equal(true) done() client.end() }) @@ -1215,115 +1153,6 @@ module.exports = function (server, config) { }) }) }) - - it('should keep message order', function (done) { - var publishCount = 0 - var reconnect = false - var client = {} - var incomingStore = new mqtt.Store({ clean: false }) - var outgoingStore = new mqtt.Store({ clean: false }) - var server2 = new Server(function (c) { - // errors are not interesting for this test - // but they might happen on some platforms - c.on('error', function () {}) - - c.on('connect', function (packet) { - c.connack({returnCode: 0}) - }) - c.on('publish', function (packet) { - c.puback({messageId: packet.messageId}) - if (reconnect) { - switch (publishCount++) { - case 0: - packet.payload.toString().should.equal('payload1') - break - case 1: - packet.payload.toString().should.equal('payload2') - break - case 2: - packet.payload.toString().should.equal('payload3') - server2.close() - done() - break - } - } - }) - }) - - server2.listen(port + 50, function () { - client = mqtt.connect({ - port: port + 50, - host: 'localhost', - clean: false, - clientId: 'cid1', - reconnectPeriod: 0, - incomingStore: incomingStore, - outgoingStore: outgoingStore - }) - - client.on('connect', function () { - if (!reconnect) { - client.publish('topic', 'payload1', {qos: 1}) - client.publish('topic', 'payload2', {qos: 1}) - client.end(true) - } else { - client.publish('topic', 'payload3', {qos: 1}) - } - }) - client.on('close', function () { - if (!reconnect) { - client.reconnect({ - clean: false, - incomingStore: incomingStore, - outgoingStore: outgoingStore - }) - reconnect = true - } - }) - }) - }) - - function testCallbackStorePutByQoS (qos, clean, expected, done) { - var client = connect({ - clean: clean, - clientId: 'testId' - }) - - var callbacks = [] - - function cbStorePut () { - callbacks.push('storeput') - } - - client.on('connect', function () { - client.publish('test', 'test', {qos: qos, cbStorePut: cbStorePut}, function (err) { - if (err) done(err) - callbacks.push('publish') - should.deepEqual(callbacks, expected) - done() - }) - client.end() - }) - } - - it('should not call cbStorePut when publishing message with QoS `0` and clean `true`', function (done) { - testCallbackStorePutByQoS(0, true, ['publish'], done) - }) - it('should not call cbStorePut when publishing message with QoS `0` and clean `false`', function (done) { - testCallbackStorePutByQoS(0, false, ['publish'], done) - }) - it('should call cbStorePut before publish completes when publishing message with QoS `1` and clean `true`', function (done) { - testCallbackStorePutByQoS(1, true, ['storeput', 'publish'], done) - }) - it('should call cbStorePut before publish completes when publishing message with QoS `1` and clean `false`', function (done) { - testCallbackStorePutByQoS(1, false, ['storeput', 'publish'], done) - }) - it('should call cbStorePut before publish completes when publishing message with QoS `2` and clean `true`', function (done) { - testCallbackStorePutByQoS(2, true, ['storeput', 'publish'], done) - }) - it('should call cbStorePut before publish completes when publishing message with QoS `2` and clean `false`', function (done) { - testCallbackStorePutByQoS(2, false, ['storeput', 'publish'], done) - }) }) describe('unsubscribing', function () { @@ -1599,16 +1428,10 @@ module.exports = function (server, config) { server.once('client', function (serverClient) { serverClient.once('subscribe', function (packet) { - var result = { + packet.subscriptions.should.containEql({ topic: topic, qos: 0 - } - if (version === 5) { - result.nl = false - result.rap = false - result.rh = 0 - } - packet.subscriptions.should.containEql(result) + }) done() }) }) @@ -1656,13 +1479,7 @@ module.exports = function (server, config) { serverClient.once('subscribe', function (packet) { // i.e. [{topic: 'a', qos: 0}, {topic: 'b', qos: 0}] var expected = subs.map(function (i) { - var result = {topic: i, qos: 0} - if (version === 5) { - result.nl = false - result.rap = false - result.rh = 0 - } - return result + return {topic: i, qos: 0} }) packet.subscriptions.should.eql(expected) @@ -1674,8 +1491,8 @@ module.exports = function (server, config) { it('should accept an hash of subscriptions', function (done) { var client = connect() var topics = { - test1: {qos: 0}, - test2: {qos: 1} + test1: 0, + test2: 1 } client.once('connect', function () { @@ -1689,16 +1506,10 @@ module.exports = function (server, config) { for (k in topics) { if (topics.hasOwnProperty(k)) { - var result = { + expected.push({ topic: k, - qos: topics[k].qos - } - if (version === 5) { - result.nl = false - result.rap = false - result.rh = 0 - } - expected.push(result) + qos: topics[k] + }) } } @@ -1724,12 +1535,6 @@ module.exports = function (server, config) { qos: 1 }] - if (version === 5) { - expected[0].nl = false - expected[0].rap = false - expected[0].rh = 0 - } - packet.subscriptions.should.eql(expected) done() }) @@ -1747,16 +1552,10 @@ module.exports = function (server, config) { server.once('client', function (serverClient) { serverClient.once('subscribe', function (packet) { - var result = { + packet.subscriptions.should.containEql({ topic: topic, qos: defaultOpts.qos - } - if (version === 5) { - result.nl = false - result.rap = false - result.rh = 0 - } - packet.subscriptions.should.containEql(result) + }) done() }) }) @@ -1772,14 +1571,7 @@ module.exports = function (server, config) { done(err) } else { should.exist(granted, 'granted not given') - var result = {topic: 'test', qos: 2} - if (version === 5) { - result.nl = false - result.rap = false - result.rh = 0 - result.properties = undefined - } - granted.should.containEql(result) + granted.should.containEql({topic: 'test', qos: 2}) done() } }) @@ -1825,16 +1617,10 @@ module.exports = function (server, config) { server.once('client', function (serverClient) { serverClient.once('subscribe', function (packet) { - var result = { + packet.subscriptions.should.containEql({ topic: topic, qos: 0 - } - if (version === 5) { - result.nl = false - result.rap = false - result.rh = 0 - } - packet.subscriptions.should.containEql(result) + }) done() }) }) @@ -2061,78 +1847,11 @@ module.exports = function (server, config) { var testTopic = 'test' var testMessage = 'message' var mid = 253 - var publishReceived = false - var pubrecReceived = false - var pubrelReceived = false client.once('connect', function () { client.subscribe(testTopic, {qos: 2}) }) - client.on('packetreceive', (packet) => { - switch (packet.cmd) { - case 'connack': - case 'suback': - // expected, but not specifically part of QOS 2 semantics - break - case 'publish': - pubrecReceived.should.be.false() - pubrelReceived.should.be.false() - publishReceived = true - break - case 'pubrel': - publishReceived.should.be.true() - pubrecReceived.should.be.true() - pubrelReceived = true - break - default: - should.fail() - } - }) - - server.once('client', function (serverClient) { - serverClient.once('subscribe', function () { - serverClient.publish({ - topic: testTopic, - payload: testMessage, - qos: 2, - messageId: mid - }) - }) - - serverClient.on('pubrec', function () { - publishReceived.should.be.true() - pubrelReceived.should.be.false() - pubrecReceived = true - }) - - serverClient.once('pubcomp', function () { - client.removeAllListeners() - serverClient.removeAllListeners() - publishReceived.should.be.true() - pubrecReceived.should.be.true() - pubrelReceived.should.be.true() - done() - }) - }) - }) - - it('should should empty the incoming store after a qos 2 handshake is completed', function (done) { - var client = connect() - var testTopic = 'test' - var testMessage = 'message' - var mid = 253 - - client.once('connect', function () { - client.subscribe(testTopic, {qos: 2}) - }) - - client.on('packetreceive', (packet) => { - if (packet.cmd === 'pubrel') { - should(client.incomingStore._inflights.size).be.equal(1) - } - }) - server.once('client', function (serverClient) { serverClient.once('subscribe', function () { serverClient.publish({ @@ -2144,94 +1863,10 @@ module.exports = function (server, config) { }) serverClient.once('pubcomp', function () { - should(client.incomingStore._inflights.size).be.equal(0) - client.removeAllListeners() done() }) }) }) - - function testMultiplePubrel (shouldSendPubcompFail, done) { - var client = connect() - var testTopic = 'test' - var testMessage = 'message' - var mid = 253 - var pubcompCount = 0 - var pubrelCount = 0 - var handleMessageCount = 0 - var emitMessageCount = 0 - var origSendPacket = client._sendPacket - var shouldSendFail - - client.handleMessage = function (packet, callback) { - handleMessageCount++ - callback() - } - - client.on('message', function () { - emitMessageCount++ - }) - - client._sendPacket = function (packet, sendDone) { - shouldSendFail = packet.cmd === 'pubcomp' && shouldSendPubcompFail - if (sendDone) { - sendDone(shouldSendFail ? new Error('testing pubcomp failure') : undefined) - } - - // send the mocked response - switch (packet.cmd) { - case 'subscribe': - const suback = {cmd: 'suback', messageId: packet.messageId, granted: [2]} - client._handlePacket(suback, function (err) { - should(err).not.be.ok() - }) - break - case 'pubrec': - case 'pubcomp': - // for both pubrec and pubcomp, reply with pubrel, simulating the server not receiving the pubcomp - if (packet.cmd === 'pubcomp') { - pubcompCount++ - if (pubcompCount === 2) { - // end the test once the client has gone through two rounds of replying to pubrel messages - pubrelCount.should.be.exactly(2) - handleMessageCount.should.be.exactly(1) - emitMessageCount.should.be.exactly(1) - client._sendPacket = origSendPacket - done() - break - } - } - - // simulate the pubrel message, either in response to pubrec or to mock pubcomp failing to be received - const pubrel = {cmd: 'pubrel', messageId: mid} - pubrelCount++ - client._handlePacket(pubrel, function (err) { - if (shouldSendFail) { - should(err).be.ok() - } else { - should(err).not.be.ok() - } - }) - break - } - } - - client.once('connect', function () { - client.subscribe(testTopic, {qos: 2}) - const publish = {cmd: 'publish', topic: testTopic, payload: testMessage, qos: 2, messageId: mid} - client._handlePacket(publish, function (err) { - should(err).not.be.ok() - }) - }) - } - - it('handle qos 2 messages exactly once when multiple pubrel received', function (done) { - testMultiplePubrel(false, done) - }) - - it('handle qos 2 messages exactly once when multiple pubrel received and sending pubcomp fails on client', function (done) { - testMultiplePubrel(true, done) - }) }) describe('auto reconnect', function () { @@ -2682,57 +2317,6 @@ module.exports = function (server, config) { }) }) - it('should clear outgoing if close from server', function (done) { - var reconnect = false - var client = {} - var server2 = new Server(function (c) { - c.on('connect', function (packet) { - c.connack({returnCode: 0}) - }) - c.on('subscribe', function (packet) { - if (reconnect) { - c.suback({ - messageId: packet.messageId, - granted: packet.subscriptions.map(function (e) { - return e.qos - }) - }) - } else { - c.destroy() - } - }) - }) - - server2.listen(port + 50, function () { - client = mqtt.connect({ - port: port + 50, - host: 'localhost', - clean: true, - clientId: 'cid1', - reconnectPeriod: 0 - }) - - client.on('connect', function () { - client.subscribe('test', {qos: 2}, function (e) { - if (!e) { - client.end() - } - }) - }) - - client.on('close', function () { - if (reconnect) { - server2.close() - done() - } else { - Object.keys(client.outgoing).length.should.equal(0) - reconnect = true - client.reconnect() - } - }) - }) - }) - it('should resend in-flight QoS 1 publish messages from the client if clean is false', function (done) { var reconnect = false var client = {} @@ -3007,7 +2591,6 @@ module.exports = function (server, config) { context('with alternate server client', function () { var cachedClientListeners - var connack = version === 5 ? { reasonCode: 0 } : { returnCode: 0 } beforeEach(function () { cachedClientListeners = server.listeners('client') @@ -3029,7 +2612,7 @@ module.exports = function (server, config) { server.on('client', function (serverClient) { serverClient.on('connect', function () { connectCount++ - serverClient.connack(connack) + serverClient.connack({returnCode: 0}) }) serverClient.on('subscribe', function () { @@ -3058,7 +2641,7 @@ module.exports = function (server, config) { server.on('client', function (serverClient) { serverClient.on('connect', function () { - serverClient.connack(connack) + serverClient.connack({returnCode: 0}) }) serverClient.on('subscribe', function () { diff --git a/node_modules/mqtt/test/client.js b/node_modules/mqtt/test/client.js index 008d037..ff4e8e6 100644 --- a/node_modules/mqtt/test/client.js +++ b/node_modules/mqtt/test/client.js @@ -12,7 +12,6 @@ var Buffer = require('safe-buffer').Buffer var Duplex = require('readable-stream').Duplex var Connection = require('mqtt-connection') var Server = require('./server') -var FastServer = require('./server').FastMqttServer var port = 9876 var server @@ -27,35 +26,13 @@ function connOnlyServer () { /** * Test server */ -function buildServer (fastFlag) { - var handler = function (client) { - client.on('auth', function (packet) { - var rc = 'reasonCode' - var connack = {} - connack[rc] = 0 - client.connack(connack) - }) +function buildServer () { + return new Server(function (client) { client.on('connect', function (packet) { - var rc = 'returnCode' - var connack = {} - if (client.options && client.options.protocolVersion === 5) { - rc = 'reasonCode' - if (packet.clientId === 'invalid') { - connack[rc] = 128 - } else { - connack[rc] = 0 - } + if (packet.clientId === 'invalid') { + client.connack({returnCode: 2}) } else { - if (packet.clientId === 'invalid') { - connack[rc] = 2 - } else { - connack[rc] = 0 - } - } - if (packet.properties && packet.properties.authenticationMethod) { - return false - } else { - client.connack(connack) + client.connack({returnCode: 0}) } }) @@ -96,19 +73,13 @@ function buildServer (fastFlag) { }) client.on('unsubscribe', function (packet) { - packet.granted = packet.unsubscriptions.map(function () { return 0 }) client.unsuback(packet) }) client.on('pingreq', function () { client.pingresp() }) - } - if (fastFlag) { - return new FastServer(handler) - } else { - return new Server(handler) - } + }) } server = buildServer().listen(port) @@ -292,15 +263,14 @@ describe('MqttClient', function () { it('should reconnect to multiple host-ports-protocol combinations if servers is passed', function (done) { this.timeout(15000) - var server = buildServer(true).listen(port + 41) - var server2 = buildServer(true).listen(port + 42) + var server2 = buildServer().listen(port + 42) server2.on('listening', function () { var client = mqtt.connect({ protocol: 'wss', servers: [ { port: port + 42, host: 'localhost', protocol: 'ws' }, - { port: port + 41, host: 'localhost' } + { port: port, host: 'localhost' } ], keepalive: 50 }) @@ -311,7 +281,7 @@ describe('MqttClient', function () { }) server.once('client', function () { - should.equal(client.stream.socket.url, 'wss://localhost:9917/', 'Protocol for second client should use the default protocol: wss, on port: port + 42.') + should.equal(client.stream.socket.url, 'wss://localhost:9876/', 'Protocol for second client should use the default protocol: wss, on port: port + 42.') client.end() done() }) @@ -571,559 +541,4 @@ describe('MqttClient', function () { }) }) }) - - it('check emit error on checkDisconnection w/o callback', function (done) { - this.timeout(15000) - var server118 = new Server(function (client) { - client.on('connect', function (packet) { - client.connack({ - reasonCode: 0 - }) - }) - client.on('publish', function (packet) { - setImmediate(function () { - packet.reasonCode = 0 - client.puback(packet) - }) - }) - }).listen(port + 118) - var opts = { - host: 'localhost', - port: port + 118, - protocolVersion: 5 - } - var client = mqtt.connect(opts) - client.on('error', function (error) { - should(error.message).be.equal('client disconnecting') - server118.close() - done() - }) - client.on('connect', function () { - client.end(function () { - client._checkDisconnecting() - }) - server118.close() - }) - }) - - describe('MQTT 5.0', function () { - var server = buildServer().listen(port + 115) - var config = { protocol: 'mqtt', port: port + 115, protocolVersion: 5, properties: { maximumPacketSize: 200 } } - abstractClientTests(server, config) - it('should has Auth method with Auth data', function (done) { - this.timeout(5000) - var opts = {host: 'localhost', port: port + 115, protocolVersion: 5, properties: { authenticationData: Buffer.from([1, 2, 3, 4]) }} - try { - mqtt.connect(opts) - } catch (error) { - should(error.message).be.equal('Packet has no Authentication Method') - } - done() - }) - it('auth packet', function (done) { - this.timeout(15000) - server.once('client', function (client) { - client.on('auth', function (packet) { - done() - }) - }) - var opts = {host: 'localhost', port: port + 115, protocolVersion: 5, properties: { authenticationMethod: 'json' }, authPacket: {}} - mqtt.connect(opts) - }) - it('Maximum Packet Size', function (done) { - this.timeout(15000) - var opts = {host: 'localhost', port: port + 115, protocolVersion: 5, properties: { maximumPacketSize: 1 }} - var client = mqtt.connect(opts) - client.on('error', function (error) { - should(error.message).be.equal('exceeding packets size connack') - done() - }) - }) - describe('Topic Alias', function () { - it('topicAlias > topicAliasMaximum', function (done) { - this.timeout(15000) - var maximum = 15 - var current = 22 - server.once('client', function (client) { - client.on('publish', function (packet) { - if (packet.properties && packet.properties.topicAlias) { - done(new Error('Packet should not have topicAlias')) - return false - } - done() - }) - }) - var opts = {host: 'localhost', port: port + 115, protocolVersion: 5, properties: { topicAliasMaximum: maximum }} - var client = mqtt.connect(opts) - client.publish('t/h', 'Message', { properties: { topicAlias: current } }) - }) - it('topicAlias w/o topicAliasMaximum in settings', function (done) { - this.timeout(15000) - server.once('client', function (client) { - client.on('publish', function (packet) { - if (packet.properties && packet.properties.topicAlias) { - done(new Error('Packet should not have topicAlias')) - return false - } - done() - }) - }) - var opts = {host: 'localhost', port: port + 115, protocolVersion: 5} - var client = mqtt.connect(opts) - client.publish('t/h', 'Message', { properties: { topicAlias: 22 } }) - }) - }) - it('Change values of some properties by server response', function (done) { - this.timeout(15000) - var server116 = new Server(function (client) { - client.on('connect', function (packet) { - client.connack({ - reasonCode: 0, - properties: { - topicAliasMaximum: 15, - serverKeepAlive: 16, - maximumPacketSize: 95 - } - }) - }) - }).listen(port + 116) - var opts = { - host: 'localhost', - port: port + 116, - protocolVersion: 5, - properties: { - topicAliasMaximum: 10, - serverKeepAlive: 11, - maximumPacketSize: 100 - } - } - var client = mqtt.connect(opts) - client.on('connect', function () { - should(client.options.keepalive).be.equal(16) - should(client.options.properties.topicAliasMaximum).be.equal(15) - should(client.options.properties.maximumPacketSize).be.equal(95) - server116.close() - done() - }) - }) - - it('should resubscribe when reconnecting with protocolVersion 5 and Session Present flag is false', function (done) { - this.timeout(15000) - var tryReconnect = true - var reconnectEvent = false - var server316 = new Server(function (client) { - client.on('connect', function (packet) { - client.connack({ - reasonCode: 0, - sessionPresent: false - }) - client.on('subscribe', function () { - if (!tryReconnect) { - client.end() - server316.close() - done() - } - }) - }) - }).listen(port + 316) - var opts = { - host: 'localhost', - port: port + 316, - protocolVersion: 5 - } - var client = mqtt.connect(opts) - - client.on('reconnect', function () { - reconnectEvent = true - }) - - client.on('connect', function (connack) { - should(connack.sessionPresent).be.equal(false) - if (tryReconnect) { - client.subscribe('hello', function () { - client.stream.end() - }) - - tryReconnect = false - } else { - reconnectEvent.should.equal(true) - } - }) - }) - - it('should resubscribe when reconnecting with protocolVersion 5 and properties', function (done) { - this.timeout(15000) - var tryReconnect = true - var reconnectEvent = false - var server326 = new Server(function (client) { - client.on('connect', function (packet) { - client.on('subscribe', function (packet) { - if (!reconnectEvent) { - client.suback({ - messageId: packet.messageId, - granted: packet.subscriptions.map(function (e) { - return e.qos - }) - }) - } else { - if (!tryReconnect) { - should(packet.properties.userProperties.test).be.equal('test') - client.end() - server326.close() - done() - } - } - }) - client.connack({ - reasonCode: 0, - sessionPresent: false - }) - }) - }).listen(port + 326) - var opts = { - host: 'localhost', - port: port + 326, - protocolVersion: 5 - } - var client = mqtt.connect(opts) - - client.on('reconnect', function () { - reconnectEvent = true - }) - - client.on('connect', function (connack) { - should(connack.sessionPresent).be.equal(false) - if (tryReconnect) { - client.subscribe('hello', { properties: { userProperties: { test: 'test' } } }, function () { - client.stream.end() - }) - - tryReconnect = false - } else { - reconnectEvent.should.equal(true) - } - }) - }) - - var serverErr = new Server(function (client) { - client.on('connect', function (packet) { - client.connack({ - reasonCode: 0 - }) - }) - client.on('publish', function (packet) { - setImmediate(function () { - switch (packet.qos) { - case 0: - break - case 1: - packet.reasonCode = 142 - delete packet.cmd - client.puback(packet) - break - case 2: - packet.reasonCode = 142 - delete packet.cmd - client.pubrec(packet) - break - } - }) - }) - - client.on('pubrel', function (packet) { - packet.reasonCode = 142 - delete packet.cmd - client.pubcomp(packet) - }) - }) - it('Subscribe properties', function (done) { - this.timeout(15000) - var opts = { - host: 'localhost', - port: port + 119, - protocolVersion: 5 - } - var subOptions = { properties: { subscriptionIdentifier: 1234 } } - var server119 = new Server(function (client) { - client.on('connect', function (packet) { - client.connack({ - reasonCode: 0 - }) - }) - client.on('subscribe', function (packet) { - should(packet.properties.subscriptionIdentifier).be.equal(subOptions.properties.subscriptionIdentifier) - server119.close() - done() - }) - }).listen(port + 119) - - var client = mqtt.connect(opts) - client.on('connect', function () { - client.subscribe('a/b', subOptions) - }) - }) - - it('puback handling errors check', function (done) { - this.timeout(15000) - serverErr.listen(port + 117) - var opts = { - host: 'localhost', - port: port + 117, - protocolVersion: 5 - } - var client = mqtt.connect(opts) - client.once('connect', () => { - client.publish('a/b', 'message', {qos: 1}, function (err, packet) { - should(err.message).be.equal('Publish error: Session taken over') - should(err.code).be.equal(142) - }) - serverErr.close() - done() - }) - }) - it('pubrec handling errors check', function (done) { - this.timeout(15000) - serverErr.listen(port + 118) - var opts = { - host: 'localhost', - port: port + 118, - protocolVersion: 5 - } - var client = mqtt.connect(opts) - client.once('connect', () => { - client.publish('a/b', 'message', {qos: 2}, function (err, packet) { - should(err.message).be.equal('Publish error: Session taken over') - should(err.code).be.equal(142) - }) - serverErr.close() - done() - }) - }) - it('puback handling custom reason code', function (done) { - this.timeout(15000) - serverErr.listen(port + 117) - var opts = { - host: 'localhost', - port: port + 117, - protocolVersion: 5, - customHandleAcks: function (topic, message, packet, cb) { - var code = 0 - if (topic === 'a/b') { - code = 128 - } - cb(code) - } - } - - serverErr.once('client', function (c) { - c.once('subscribe', function () { - c.publish({ topic: 'a/b', payload: 'payload', qos: 1, messageId: 1 }) - }) - - c.on('puback', function (packet) { - should(packet.reasonCode).be.equal(128) - client.end() - c.destroy() - serverErr.close() - done() - }) - }) - - var client = mqtt.connect(opts) - client.once('connect', function () { - client.subscribe('a/b', {qos: 1}) - }) - }) - it('server side disconnect', function (done) { - this.timeout(15000) - var server327 = new Server(function (client) { - client.on('connect', function (packet) { - client.connack({ - reasonCode: 0 - }) - client.disconnect({reasonCode: 128}) - server327.close() - }) - }) - server327.listen(port + 327) - var opts = { - host: 'localhost', - port: port + 327, - protocolVersion: 5 - } - - var client = mqtt.connect(opts) - client.once('disconnect', function (disconnectPacket) { - should(disconnectPacket.reasonCode).be.equal(128) - done() - }) - }) - it('pubrec handling custom reason code', function (done) { - this.timeout(15000) - serverErr.listen(port + 117) - var opts = { - host: 'localhost', - port: port + 117, - protocolVersion: 5, - customHandleAcks: function (topic, message, packet, cb) { - var code = 0 - if (topic === 'a/b') { - code = 128 - } - cb(code) - } - } - - serverErr.once('client', function (c) { - c.once('subscribe', function () { - c.publish({ topic: 'a/b', payload: 'payload', qos: 2, messageId: 1 }) - }) - - c.on('pubrec', function (packet) { - should(packet.reasonCode).be.equal(128) - client.end() - c.destroy() - serverErr.close() - done() - }) - }) - - var client = mqtt.connect(opts) - client.once('connect', function () { - client.subscribe('a/b', {qos: 1}) - }) - }) - it('puback handling custom reason code with error', function (done) { - this.timeout(15000) - serverErr.listen(port + 117) - var opts = { - host: 'localhost', - port: port + 117, - protocolVersion: 5, - customHandleAcks: function (topic, message, packet, cb) { - var code = 0 - if (topic === 'a/b') { - cb(new Error('a/b is not valid')) - } - cb(code) - } - } - - serverErr.once('client', function (c) { - c.once('subscribe', function () { - c.publish({ topic: 'a/b', payload: 'payload', qos: 1, messageId: 1 }) - }) - }) - - var client = mqtt.connect(opts) - client.on('error', function (error) { - should(error.message).be.equal('a/b is not valid') - client.end() - serverErr.close() - done() - }) - client.once('connect', function () { - client.subscribe('a/b', {qos: 1}) - }) - }) - it('pubrec handling custom reason code with error', function (done) { - this.timeout(15000) - serverErr.listen(port + 117) - var opts = { - host: 'localhost', - port: port + 117, - protocolVersion: 5, - customHandleAcks: function (topic, message, packet, cb) { - var code = 0 - if (topic === 'a/b') { - cb(new Error('a/b is not valid')) - } - cb(code) - } - } - - serverErr.once('client', function (c) { - c.once('subscribe', function () { - c.publish({ topic: 'a/b', payload: 'payload', qos: 2, messageId: 1 }) - }) - }) - - var client = mqtt.connect(opts) - client.on('error', function (error) { - should(error.message).be.equal('a/b is not valid') - client.end() - serverErr.close() - done() - }) - client.once('connect', function () { - client.subscribe('a/b', {qos: 1}) - }) - }) - it('puback handling custom invalid reason code', function (done) { - this.timeout(15000) - serverErr.listen(port + 117) - var opts = { - host: 'localhost', - port: port + 117, - protocolVersion: 5, - customHandleAcks: function (topic, message, packet, cb) { - var code = 0 - if (topic === 'a/b') { - code = 124124 - } - cb(code) - } - } - - serverErr.once('client', function (c) { - c.once('subscribe', function () { - c.publish({ topic: 'a/b', payload: 'payload', qos: 1, messageId: 1 }) - }) - }) - - var client = mqtt.connect(opts) - client.on('error', function (error) { - should(error.message).be.equal('Wrong reason code for puback') - client.end() - serverErr.close() - done() - }) - client.once('connect', function () { - client.subscribe('a/b', {qos: 1}) - }) - }) - it('pubrec handling custom invalid reason code', function (done) { - this.timeout(15000) - serverErr.listen(port + 117) - var opts = { - host: 'localhost', - port: port + 117, - protocolVersion: 5, - customHandleAcks: function (topic, message, packet, cb) { - var code = 0 - if (topic === 'a/b') { - code = 34535 - } - cb(code) - } - } - - serverErr.once('client', function (c) { - c.once('subscribe', function () { - c.publish({ topic: 'a/b', payload: 'payload', qos: 2, messageId: 1 }) - }) - }) - - var client = mqtt.connect(opts) - client.on('error', function (error) { - should(error.message).be.equal('Wrong reason code for pubrec') - client.end() - serverErr.close() - done() - }) - client.once('connect', function () { - client.subscribe('a/b', {qos: 1}) - }) - }) - }) }) diff --git a/node_modules/mqtt/test/server.js b/node_modules/mqtt/test/server.js index 3baf7f1..00c7ec7 100644 --- a/node_modules/mqtt/test/server.js +++ b/node_modules/mqtt/test/server.js @@ -5,14 +5,11 @@ var tls = require('tls') var inherits = require('inherits') var Connection = require('mqtt-connection') var MqttServer -var FastMqttServer var MqttSecureServer function setupConnection (duplex) { - var that = this - var connection = new Connection(duplex, function () { - that.emit('client', connection) - }) + var connection = new Connection(duplex) + this.emit('client', connection) } /* @@ -37,31 +34,6 @@ MqttServer = module.exports = function Server (listener) { } inherits(MqttServer, net.Server) -/* - * FastMqttServer(w/o waiting for initialization) - * - * @param {Function} listener - fired on client connection - */ -FastMqttServer = module.exports.FastMqttServer = function Server (listener) { - if (!(this instanceof Server)) { - return new Server(listener) - } - - net.Server.call(this) - - this.on('connection', function (duplex) { - var connection = new Connection(duplex) - this.emit('client', connection) - }) - - if (listener) { - this.on('client', listener) - } - - return this -} -inherits(FastMqttServer, net.Server) - /** * MqttSecureServer * diff --git a/node_modules/mqtt/test/typescript/broker-connect-subscribe-and-publish.js b/node_modules/mqtt/test/typescript/broker-connect-subscribe-and-publish.js deleted file mode 100644 index 0c85121..0000000 --- a/node_modules/mqtt/test/typescript/broker-connect-subscribe-and-publish.js +++ /dev/null @@ -1,24 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -// relative path uses package.json {"types":"types/index.d.ts", ...} -var __1 = require("../.."); -var BROKER = 'test.mosquitto.org'; -var PAYLOAD = 'hello from TS'; -var TOPIC = 'typescript-test-' + Math.random().toString(16).substr(2); -var opts = {}; -console.log("connect(" + JSON.stringify(BROKER) + ")"); -var client = __1.connect("mqtt://" + BROKER, opts); -client.subscribe((_a = {}, _a[TOPIC] = 2, _a), function (err, granted) { - granted.forEach(function (_a) { - var topic = _a.topic, qos = _a.qos; - console.log("subscribed to " + topic + " with qos=" + qos); - }); - client.publish(TOPIC, PAYLOAD, { qos: 2 }); -}).on('message', function (topic, payload) { - console.log("message from " + topic + ": " + payload); - client.end(); -}).on('connect', function (packet) { - console.log('connected!', JSON.stringify(packet)); -}); -var _a; -//# sourceMappingURL=broker-connect-subscribe-and-publish.js.map \ No newline at end of file diff --git a/node_modules/mqtt/test/typescript/broker-connect-subscribe-and-publish.js.map b/node_modules/mqtt/test/typescript/broker-connect-subscribe-and-publish.js.map deleted file mode 100644 index 74fead4..0000000 --- a/node_modules/mqtt/test/typescript/broker-connect-subscribe-and-publish.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"broker-connect-subscribe-and-publish.js","sourceRoot":"","sources":["broker-connect-subscribe-and-publish.ts"],"names":[],"mappings":";;AAAA,oEAAoE;AACpE,2BAAqE;AACrE,IAAM,MAAM,GAAG,oBAAoB,CAAA;AAEnC,IAAM,OAAO,GAAG,eAAe,CAAA;AAC/B,IAAM,KAAK,GAAG,kBAAkB,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;AACvE,IAAM,IAAI,GAAmB,EAAE,CAAA;AAE/B,OAAO,CAAC,GAAG,CAAC,aAAW,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,MAAG,CAAC,CAAA;AACjD,IAAM,MAAM,GAAU,WAAO,CAAC,YAAU,MAAQ,EAAE,IAAI,CAAC,CAAA;AAEvD,MAAM,CAAC,SAAS,WAAE,GAAC,KAAK,IAAG,CAAC,OAAG,UAAC,GAAG,EAAE,OAAO;IACxC,OAAO,CAAC,OAAO,CAAC,UAAC,EAAY;YAAX,gBAAK,EAAE,YAAG;QACxB,OAAO,CAAC,GAAG,CAAC,mBAAiB,KAAK,kBAAa,GAAK,CAAC,CAAA;IACzD,CAAC,CAAC,CAAA;IACF,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,EAAC,GAAG,EAAE,CAAC,EAAC,CAAC,CAAA;AAC5C,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,EAAE,UAAC,KAAa,EAAE,OAAe;IAC5C,OAAO,CAAC,GAAG,CAAC,kBAAgB,KAAK,UAAK,OAAS,CAAC,CAAA;IAChD,MAAM,CAAC,GAAG,EAAE,CAAA;AAChB,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,EAAE,UAAC,MAAsB;IACpC,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAA;AACrD,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/mqtt/test/typescript/broker-connect-subscribe-and-publish.ts b/node_modules/mqtt/test/typescript/broker-connect-subscribe-and-publish.ts index e22610e..0c53157 100644 --- a/node_modules/mqtt/test/typescript/broker-connect-subscribe-and-publish.ts +++ b/node_modules/mqtt/test/typescript/broker-connect-subscribe-and-publish.ts @@ -9,7 +9,7 @@ const opts: IClientOptions = {} console.log(`connect(${JSON.stringify(BROKER)})`) const client:Client = connect(`mqtt://${BROKER}`, opts) -client.subscribe({[TOPIC]: {qos: 2}}, (err, granted) => { +client.subscribe({[TOPIC]: 2}, (err, granted) => { granted.forEach(({topic, qos}) => { console.log(`subscribed to ${topic} with qos=${qos}`) }) diff --git a/node_modules/mqtt/types/lib/client-options.d.ts b/node_modules/mqtt/types/lib/client-options.d.ts index 8c34abc..1db9c5f 100644 --- a/node_modules/mqtt/types/lib/client-options.d.ts +++ b/node_modules/mqtt/types/lib/client-options.d.ts @@ -2,8 +2,6 @@ import { MqttClient } from './client' import { Store } from './store' import { QoS } from 'mqtt-packet' -export declare type StorePutCallback = () => void - export interface IClientOptions extends ISecureClientOptions { port?: number // port is made into a number subsequently host?: string // host does NOT include port @@ -88,32 +86,9 @@ export interface IClientOptions extends ISecureClientOptions { /** * the retain flag */ - retain: boolean, - /* - * properies object of will - * */ - properties?: { - willDelayInterval?: number, - payloadFormatIndicator?: number, - messageExpiryInterval?: number, - contentType?: string, - responseTopic?: string, - correlationData?: Buffer, - userProperties?: Object - } - } - transformWsUrl?: (url: string, options: IClientOptions, client: MqttClient) => string, - properties?: { - sessionExpiryInterval?: number, - receiveMaximum?: number, - maximumPacketSize?: number, - topicAliasMaximum?: number, - requestResponseInformation?: boolean, - requestProblemInformation?: boolean, - userProperties?: Object, - authenticationMethod?: string, - authenticationData?: Buffer + retain: boolean } + transformWsUrl?: (url: string, options: IClientOptions, client: MqttClient) => string } export interface ISecureClientOptions { /** @@ -143,28 +118,12 @@ export interface IClientPublishOptions { * whether or not mark a message as duplicate */ dup?: boolean - /** - * callback called when message is put into `outgoingStore` - */ - cbStorePut?: StorePutCallback } export interface IClientSubscribeOptions { /** * the QoS */ - qos: QoS, - /* - * no local flag - * */ - nl?: boolean, - /* - * Retain As Published flag - * */ - rap?: boolean, - /* - * Retain Handling option - * */ - rh?: number + qos: QoS } export interface IClientReconnectOptions { /** diff --git a/node_modules/mqtt/types/lib/client.d.ts b/node_modules/mqtt/types/lib/client.d.ts index bef009f..3eee609 100644 --- a/node_modules/mqtt/types/lib/client.d.ts +++ b/node_modules/mqtt/types/lib/client.d.ts @@ -19,18 +19,6 @@ export interface ISubscriptionGrant { * is the granted qos level on it, may return 128 on error */ qos: QoS | number - /* - * no local flag - * */ - nl?: boolean, - /* - * Retain As Published flag - * */ - rap?: boolean, - /* - * Retain Handling option - * */ - rh?: number } export interface ISubscriptionRequest { /** @@ -41,29 +29,12 @@ export interface ISubscriptionRequest { * is the granted qos level on it */ qos: QoS - /* - * no local flag - * */ - nl?: boolean, - /* - * Retain As Published flag - * */ - rap?: boolean, - /* - * Retain Handling option - * */ - rh?: number } export interface ISubscriptionMap { /** - * object which has topic names as object keys and as value the options, like {'test1': {qos: 0}, 'test2': {qos: 2}}. + * object which has topic names as object keys and as value the QoS, like {'test1': 0, 'test2': 1}. */ - [topic: string]: { - qos: QoS, - nl?: boolean, - rap?: boolean, - rh?: number - } + [topic: string]: QoS } export declare type ClientSubscribeCallback = (err: Error, granted: ISubscriptionGrant[]) => void @@ -118,12 +89,9 @@ export declare class MqttClient extends events.EventEmitter { * @param {Object} [opts] - publish options, includes: * @param {Number} [opts.qos] - qos level to publish on * @param {Boolean} [opts.retain] - whether or not to retain the message - * @param {Function}[opts.cbStorePut] - function(){} - * called when message is put into `outgoingStore` * * @param {Function} [callback] - function(err){} * called when publish succeeds or fails - * * @returns {Client} this - for chaining * @api public * @@ -165,27 +133,24 @@ export declare class MqttClient extends events.EventEmitter { * unsubscribe - unsubscribe from topic(s) * * @param {String, Array} topic - topics to unsubscribe from - * @param {Object} opts - opts of unsubscribe * @param {Function} [callback] - callback fired on unsuback * @returns {MqttClient} this - for chaining * @api public * @example client.unsubscribe('topic') * @example client.unsubscribe('topic', console.log) - * @example client.unsubscribe('topic', opts, console.log) */ - public unsubscribe (topic: string | string[], opts?: Object, callback?: PacketCallback): this + public unsubscribe (topic: string | string[], callback?: PacketCallback): this /** * end - close connection * * @returns {MqttClient} this - for chaining * @param {Boolean} force - do not wait for all in-flight messages to be acked - * @param {Object} opts - opts disconnect * @param {Function} cb - called when the client has been closed * * @api public */ - public end (force?: boolean, opts?: Object, cb?: CloseCallback): this + public end (force?: boolean, cb?: CloseCallback): this /** * removeOutgoingMessage - remove a message in outgoing store diff --git a/node_modules/postcss/README.md b/node_modules/postcss/README.md index 939a802..05fed07 100644 --- a/node_modules/postcss/README.md +++ b/node_modules/postcss/README.md @@ -9,11 +9,12 @@ These plugins can lint your CSS, support variables and mixins, transpile future CSS syntax, inline images, and more. PostCSS is used by industry leaders including Wikipedia, Twitter, Alibaba, -and JetBrains. The [Autoprefixer] and [Stylelint] PostCSS plugins is one of the most popular CSS tools. +and JetBrains. The [Autoprefixer] and [Stylelint] PostCSS plugins are some of the most popular CSS tools. --- -  Made at Evil Martians, product consulting for developer tools. +  Built by + Evil Martians, go-to agency for developer tools. --- diff --git a/node_modules/postcss/lib/container.d.ts b/node_modules/postcss/lib/container.d.ts index 9569f34..c2b310b 100644 --- a/node_modules/postcss/lib/container.d.ts +++ b/node_modules/postcss/lib/container.d.ts @@ -2,14 +2,17 @@ import AtRule from './at-rule.js' import Comment from './comment.js' import Declaration from './declaration.js' import Node, { ChildNode, ChildProps, NodeProps } from './node.js' +import { Root } from './postcss.js' import Rule from './rule.js' declare namespace Container { - export class ContainerWithChildren< - Child extends Node = ChildNode - > extends Container_ { + export type ContainerWithChildren = { nodes: Child[] - } + } & ( + | AtRule + | Root + | Rule + ) export interface ValueOptions { /** diff --git a/node_modules/postcss/lib/input.d.ts b/node_modules/postcss/lib/input.d.ts index 260040f..3207da3 100644 --- a/node_modules/postcss/lib/input.d.ts +++ b/node_modules/postcss/lib/input.d.ts @@ -18,6 +18,11 @@ declare namespace Input { */ endLine?: number + /** + * Offset of exclusive end position in source file. + */ + endOffset?: number + /** * Absolute path to the source file. */ @@ -28,6 +33,11 @@ declare namespace Input { */ line: number + /** + * Offset of inclusive start position in source file. + */ + offset: number + /** * Source code. */ @@ -131,6 +141,9 @@ declare class Input_ { */ constructor(css: string, opts?: ProcessOptions) + /** + * Returns `CssSyntaxError` with information about the error and its position. + */ error( message: string, start: @@ -151,9 +164,6 @@ declare class Input_ { }, opts?: { plugin?: CssSyntaxError['plugin'] } ): CssSyntaxError - /** - * Returns `CssSyntaxError` with information about the error and its position. - */ error( message: string, line: number, @@ -165,12 +175,23 @@ declare class Input_ { offset: number, opts?: { plugin?: CssSyntaxError['plugin'] } ): CssSyntaxError + + /** + * Converts source line and column to offset. + * + * @param line Source line. + * @param column Source column. + * @return Source offset. + */ + fromLineAndColumn(line: number, column: number): number + /** * Converts source offset to line and column. * * @param offset Source offset. */ fromOffset(offset: number): { col: number; line: number } | null + /** * Reads the input source map and returns a symbol position * in the input source (e.g., in a Sass file that was compiled diff --git a/node_modules/postcss/lib/input.js b/node_modules/postcss/lib/input.js index 9773e0f..bb0ccf5 100644 --- a/node_modules/postcss/lib/input.js +++ b/node_modules/postcss/lib/input.js @@ -9,11 +9,26 @@ let CssSyntaxError = require('./css-syntax-error') let PreviousMap = require('./previous-map') let terminalHighlight = require('./terminal-highlight') -let fromOffsetCache = Symbol('fromOffsetCache') +let lineToIndexCache = Symbol('lineToIndexCache') let sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator) let pathAvailable = Boolean(resolve && isAbsolute) +function getLineToIndex(input) { + if (input[lineToIndexCache]) return input[lineToIndexCache] + let lines = input.css.split('\n') + let lineToIndex = new Array(lines.length) + let prevIndex = 0 + + for (let i = 0, l = lines.length; i < l; i++) { + lineToIndex[i] = prevIndex + prevIndex += lines[i].length + 1 + } + + input[lineToIndexCache] = lineToIndex + return lineToIndex +} + class Input { get from() { return this.file || this.id @@ -68,31 +83,38 @@ class Input { } error(message, line, column, opts = {}) { - let endColumn, endLine, result + let endColumn, endLine, endOffset, offset, result if (line && typeof line === 'object') { let start = line let end = column if (typeof start.offset === 'number') { - let pos = this.fromOffset(start.offset) + offset = start.offset + let pos = this.fromOffset(offset) line = pos.line column = pos.col } else { line = start.line column = start.column + offset = this.fromLineAndColumn(line, column) } if (typeof end.offset === 'number') { - let pos = this.fromOffset(end.offset) + endOffset = end.offset + let pos = this.fromOffset(endOffset) endLine = pos.line endColumn = pos.col } else { endLine = end.line endColumn = end.column + endOffset = this.fromLineAndColumn(end.line, end.column) } } else if (!column) { - let pos = this.fromOffset(line) + offset = line + let pos = this.fromOffset(offset) line = pos.line column = pos.col + } else { + offset = this.fromLineAndColumn(line, column) } let origin = this.origin(line, column, endLine, endColumn) @@ -120,7 +142,7 @@ class Input { ) } - result.input = { column, endColumn, endLine, line, source: this.css } + result.input = { column, endColumn, endLine, endOffset, line, offset, source: this.css } if (this.file) { if (pathToFileURL) { result.input.url = pathToFileURL(this.file).toString() @@ -131,23 +153,15 @@ class Input { return result } + fromLineAndColumn(line, column) { + let lineToIndex = getLineToIndex(this) + let index = lineToIndex[line - 1] + return index + column - 1 + } + fromOffset(offset) { - let lastLine, lineToIndex - if (!this[fromOffsetCache]) { - let lines = this.css.split('\n') - lineToIndex = new Array(lines.length) - let prevIndex = 0 - - for (let i = 0, l = lines.length; i < l; i++) { - lineToIndex[i] = prevIndex - prevIndex += lines[i].length + 1 - } - - this[fromOffsetCache] = lineToIndex - } else { - lineToIndex = this[fromOffsetCache] - } - lastLine = lineToIndex[lineToIndex.length - 1] + let lineToIndex = getLineToIndex(this) + let lastLine = lineToIndex[lineToIndex.length - 1] let min = 0 if (offset >= lastLine) { diff --git a/node_modules/postcss/lib/node.d.ts b/node_modules/postcss/lib/node.d.ts index aa7229f..a09fe4d 100644 --- a/node_modules/postcss/lib/node.d.ts +++ b/node_modules/postcss/lib/node.d.ts @@ -1,5 +1,4 @@ import AtRule = require('./at-rule.js') - import { AtRuleProps } from './at-rule.js' import Comment, { CommentProps } from './comment.js' import Container, { NewChild } from './container.js' @@ -66,6 +65,22 @@ declare namespace Node { /** * The inclusive ending position for the source * code of a node. + * + * However, `end.offset` of a non `Root` node is the exclusive position. + * See https://github.com/postcss/postcss/pull/1879 for details. + * + * ```js + * const root = postcss.parse('a { color: black }') + * const a = root.first + * const color = a.first + * + * // The offset of `Root` node is the inclusive position + * css.source.end // { line: 1, column: 19, offset: 18 } + * + * // The offset of non `Root` node is the exclusive position + * a.source.end // { line: 1, column: 18, offset: 18 } + * color.source.end // { line: 1, column: 16, offset: 16 } + * ``` */ end?: Position @@ -424,7 +439,7 @@ declare abstract class Node_ { * @return Range. */ rangeBy( - opts?: Pick + opts?: Pick ): Node.Range /** diff --git a/node_modules/postcss/lib/node.js b/node_modules/postcss/lib/node.js index 2b865ba..b403b71 100644 --- a/node_modules/postcss/lib/node.js +++ b/node_modules/postcss/lib/node.js @@ -34,11 +34,8 @@ function cloneNode(obj, parent) { function sourceOffset(inputCSS, position) { // Not all custom syntaxes support `offset` in `source.start` and `source.end` - if ( - position && - typeof position.offset !== 'undefined' - ) { - return position.offset; + if (position && typeof position.offset !== 'undefined') { + return position.offset } let column = 1 @@ -208,14 +205,15 @@ class Node { return this.parent.nodes[index + 1] } - positionBy(opts) { + positionBy(opts = {}) { let pos = this.source.start if (opts.index) { pos = this.positionInside(opts.index) } else if (opts.word) { - let inputString = ('document' in this.source.input) - ? this.source.input.document - : this.source.input.css + let inputString = + 'document' in this.source.input + ? this.source.input.document + : this.source.input.css let stringRepresentation = inputString.slice( sourceOffset(inputString, this.source.start), sourceOffset(inputString, this.source.end) @@ -229,9 +227,10 @@ class Node { positionInside(index) { let column = this.source.start.column let line = this.source.start.line - let inputString = ('document' in this.source.input) - ? this.source.input.document - : this.source.input.css + let inputString = + 'document' in this.source.input + ? this.source.input.document + : this.source.input.css let offset = sourceOffset(inputString, this.source.start) let end = offset + index @@ -244,7 +243,7 @@ class Node { } } - return { column, line } + return { column, line, offset: end } } prev() { @@ -253,25 +252,36 @@ class Node { return this.parent.nodes[index - 1] } - rangeBy(opts) { + rangeBy(opts = {}) { + let inputString = + 'document' in this.source.input + ? this.source.input.document + : this.source.input.css let start = { column: this.source.start.column, - line: this.source.start.line + line: this.source.start.line, + offset: sourceOffset(inputString, this.source.start) } let end = this.source.end ? { column: this.source.end.column + 1, - line: this.source.end.line + line: this.source.end.line, + offset: + typeof this.source.end.offset === 'number' + ? // `source.end.offset` is exclusive, so we don't need to add 1 + this.source.end.offset + : // Since line/column in this.source.end is inclusive, + // the `sourceOffset(... , this.source.end)` returns an inclusive offset. + // So, we add 1 to convert it to exclusive. + sourceOffset(inputString, this.source.end) + 1 } : { column: start.column + 1, - line: start.line + line: start.line, + offset: start.offset + 1 } if (opts.word) { - let inputString = ('document' in this.source.input) - ? this.source.input.document - : this.source.input.css let stringRepresentation = inputString.slice( sourceOffset(inputString, this.source.start), sourceOffset(inputString, this.source.end) @@ -279,15 +289,14 @@ class Node { let index = stringRepresentation.indexOf(opts.word) if (index !== -1) { start = this.positionInside(index) - end = this.positionInside( - index + opts.word.length, - ) + end = this.positionInside(index + opts.word.length) } } else { if (opts.start) { start = { column: opts.start.column, - line: opts.start.line + line: opts.start.line, + offset: sourceOffset(inputString, opts.start) } } else if (opts.index) { start = this.positionInside(opts.index) @@ -296,7 +305,8 @@ class Node { if (opts.end) { end = { column: opts.end.column, - line: opts.end.line + line: opts.end.line, + offset: sourceOffset(inputString, opts.end) } } else if (typeof opts.endIndex === 'number') { end = this.positionInside(opts.endIndex) @@ -309,7 +319,11 @@ class Node { end.line < start.line || (end.line === start.line && end.column <= start.column) ) { - end = { column: start.column + 1, line: start.line } + end = { + column: start.column + 1, + line: start.line, + offset: start.offset + 1 + } } return { end, start } @@ -384,6 +398,7 @@ class Node { } else if (typeof value === 'object' && value.toJSON) { fixed[name] = value.toJSON(null, inputs) } else if (name === 'source') { + if (value == null) continue let inputId = inputs.get(value.input) if (inputId == null) { inputId = inputsNextIndex @@ -423,7 +438,7 @@ class Node { return result } - warn(result, text, opts) { + warn(result, text, opts = {}) { let data = { node: this } for (let i in opts) data[i] = opts[i] return result.warn(text, data) diff --git a/node_modules/postcss/lib/processor.js b/node_modules/postcss/lib/processor.js index c38be53..8493687 100644 --- a/node_modules/postcss/lib/processor.js +++ b/node_modules/postcss/lib/processor.js @@ -7,7 +7,7 @@ let Root = require('./root') class Processor { constructor(plugins = []) { - this.version = '8.5.3' + this.version = '8.5.6' this.plugins = this.normalize(plugins) } diff --git a/node_modules/postcss/lib/result.js b/node_modules/postcss/lib/result.js index 4ab2a8f..c6af4e8 100644 --- a/node_modules/postcss/lib/result.js +++ b/node_modules/postcss/lib/result.js @@ -12,7 +12,7 @@ class Result { this.messages = [] this.root = root this.opts = opts - this.css = undefined + this.css = '' this.map = undefined } diff --git a/node_modules/postcss/lib/stringifier.d.ts b/node_modules/postcss/lib/stringifier.d.ts index f707a6a..b5a6f86 100644 --- a/node_modules/postcss/lib/stringifier.d.ts +++ b/node_modules/postcss/lib/stringifier.d.ts @@ -25,7 +25,7 @@ declare class Stringifier_ { comment(node: Comment): void decl(node: Declaration, semicolon?: boolean): void document(node: Document): void - raw(node: AnyNode, own: null | string, detect?: string): string + raw(node: AnyNode, own: null | string, detect?: string): boolean | string rawBeforeClose(root: Root): string | undefined rawBeforeComment(root: Root, node: Comment): string | undefined rawBeforeDecl(root: Root, node: Declaration): string | undefined @@ -35,7 +35,7 @@ declare class Stringifier_ { rawEmptyBody(root: Root): string | undefined rawIndent(root: Root): string | undefined rawSemicolon(root: Root): boolean | undefined - rawValue(node: AnyNode, prop: string): string + rawValue(node: AnyNode, prop: string): number | string root(node: Root): void rule(node: Rule): void stringify(node: AnyNode, semicolon?: boolean): void diff --git a/node_modules/postcss/package.json b/node_modules/postcss/package.json index daf3530..c69124b 100644 --- a/node_modules/postcss/package.json +++ b/node_modules/postcss/package.json @@ -1,14 +1,14 @@ { "name": "postcss", - "version": "8.5.3", + "version": "8.5.6", "description": "Tool for transforming styles with JS plugins", "engines": { "node": "^10 || ^12 || >=14" }, "exports": { ".": { - "require": "./lib/postcss.js", - "import": "./lib/postcss.mjs" + "import": "./lib/postcss.mjs", + "require": "./lib/postcss.js" }, "./lib/at-rule": "./lib/at-rule.js", "./lib/comment": "./lib/comment.js", @@ -74,7 +74,7 @@ "url": "https://github.com/postcss/postcss/issues" }, "dependencies": { - "nanoid": "^3.3.8", + "nanoid": "^3.3.11", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" }, diff --git a/node_modules/pump/index.js b/node_modules/pump/index.js index ce95e3e..712c076 100644 --- a/node_modules/pump/index.js +++ b/node_modules/pump/index.js @@ -7,7 +7,7 @@ try { } catch (e) {} var noop = function () {} -var ancient = /^v?\.0/.test(process.version) +var ancient = typeof process === 'undefined' ? false : /^v?\.0/.test(process.version) var isFn = function (fn) { return typeof fn === 'function' diff --git a/node_modules/pump/package.json b/node_modules/pump/package.json index ba588fb..976555c 100644 --- a/node_modules/pump/package.json +++ b/node_modules/pump/package.json @@ -1,6 +1,6 @@ { "name": "pump", - "version": "3.0.2", + "version": "3.0.3", "repository": "git://github.com/mafintosh/pump.git", "license": "MIT", "description": "pipe streams together and close all of them if one of them closes", diff --git a/node_modules/safe-buffer/index.js b/node_modules/safe-buffer/index.js index 22438da..f8d3ec9 100644 --- a/node_modules/safe-buffer/index.js +++ b/node_modules/safe-buffer/index.js @@ -1,3 +1,4 @@ +/*! safe-buffer. MIT License. Feross Aboukhadijeh */ /* eslint-disable node/no-deprecated-api */ var buffer = require('buffer') var Buffer = buffer.Buffer @@ -20,6 +21,8 @@ function SafeBuffer (arg, encodingOrOffset, length) { return Buffer(arg, encodingOrOffset, length) } +SafeBuffer.prototype = Object.create(Buffer.prototype) + // Copy static methods from Buffer copyProps(Buffer, SafeBuffer) diff --git a/node_modules/safe-buffer/package.json b/node_modules/safe-buffer/package.json index 623fbc3..f2869e2 100644 --- a/node_modules/safe-buffer/package.json +++ b/node_modules/safe-buffer/package.json @@ -1,18 +1,18 @@ { "name": "safe-buffer", "description": "Safer Node.js Buffer API", - "version": "5.1.2", + "version": "5.2.1", "author": { "name": "Feross Aboukhadijeh", "email": "feross@feross.org", - "url": "http://feross.org" + "url": "https://feross.org" }, "bugs": { "url": "https://github.com/feross/safe-buffer/issues" }, "devDependencies": { "standard": "*", - "tape": "^4.0.0" + "tape": "^5.0.0" }, "homepage": "https://github.com/feross/safe-buffer", "keywords": [ @@ -33,5 +33,19 @@ }, "scripts": { "test": "standard && tape test/*.js" - } + }, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] } diff --git a/node_modules/split2/LICENSE b/node_modules/split2/LICENSE index a91afe5..2a05e83 100644 --- a/node_modules/split2/LICENSE +++ b/node_modules/split2/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2014-2018, Matteo Collina +Copyright (c) 2014-2017, Matteo Collina Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above diff --git a/node_modules/split2/README.md b/node_modules/split2/README.md index 00db262..626ff30 100644 --- a/node_modules/split2/README.md +++ b/node_modules/split2/README.md @@ -1,11 +1,11 @@ # Split2(matcher, mapper, options) -![ci](https://github.com/mcollina/split2/workflows/ci/badge.svg) +[![build status](https://secure.travis-ci.org/mcollina/split2.svg)](http://travis-ci.org/mcollina/split2) Break up a stream and reassemble it so that each line is a chunk. `split2` is inspired by [@dominictarr](https://github.com/dominictarr) [`split`](https://github.com/dominictarr/split) module, and it is totally API compatible with it. -However, it is based on Node.js core [`Transform`](https://nodejs.org/api/stream.html#stream_new_stream_transform_options) via [`readable-stream`](https://github.com/nodejs/readable-stream) +However, it is based on [`through2`](https://github.com/rvagg/through2) by [@rvagg](https://github.com/rvagg) and it is fully based on Stream3. `matcher` may be a `String`, or a `RegExp`. Example, read every line in a file ... @@ -23,13 +23,11 @@ However, it is based on Node.js core [`Transform`](https://nodejs.org/api/stream `split` takes an optional options object on it's third argument, which is directly passed as a -[Transform](https://nodejs.org/api/stream.html#stream_new_stream_transform_options) +[Transform](http://nodejs.org/api/stream.html#stream_class_stream_transform_1) option. -Additionally, the `.maxLength` and `.skipOverflow` options are implemented, which set limits on the internal -buffer size and the stream's behavior when the limit is exceeded. There is no limit unless `maxLength` is set. When -the internal buffer size exceeds `maxLength`, the stream emits an error by default. You may also set `skipOverflow` to -true to suppress the error and instead skip past any lines that cause the internal buffer to exceed `maxLength`. +Additionally, the `.maxLength` option is implemented, which will make the split stream throw an error +if the buffer size exceeds `.maxLength`. Calling `.destroy` will make the stream emit `close`. Use this to perform cleanup logic @@ -60,29 +58,14 @@ fs.createReadStream(file) .on('data', function (obj) { //each chunk now is a js object }) - .on("error", function(error) => { - //handling parsing errors - }) ``` However, in [@dominictarr](https://github.com/dominictarr) [`split`](https://github.com/dominictarr/split) the mapper -is wrapped in a try-catch, while here it is not: if your parsing logic can throw, wrap it yourself. Otherwise, you can also use the stream error handling when mapper function throw. - -# Benchmark - -```bash -$ node bench.js -benchSplit*10000: 1484.983ms -benchBinarySplit*10000: 1484.080ms -benchSplit*10000: 1407.334ms -benchBinarySplit*10000: 1500.281ms -``` - -Benchmark taken on Node 8.11.3, on a Macbook i5 2018. +is wrapped in a try-catch, while here it is not: if your parsing logic can throw, wrap it yourself. # License -Copyright (c) 2014-2018, Matteo Collina +Copyright (c) 2014-2017, Matteo Collina Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above diff --git a/node_modules/split2/bench.js b/node_modules/split2/bench.js index 7a3f9d5..f9ab5e8 100644 --- a/node_modules/split2/bench.js +++ b/node_modules/split2/bench.js @@ -2,7 +2,6 @@ var split = require('./') var bench = require('fastbench') -var binarySplit = require('binary-split') var fs = require('fs') function benchSplit (cb) { @@ -12,16 +11,8 @@ function benchSplit (cb) { .resume() } -function benchBinarySplit (cb) { - fs.createReadStream('package.json') - .pipe(binarySplit()) - .on('end', cb) - .resume() -} - var run = bench([ - benchSplit, - benchBinarySplit + benchSplit ], 10000) run(run) diff --git a/node_modules/split2/index.js b/node_modules/split2/index.js index fc2007b..70a8320 100644 --- a/node_modules/split2/index.js +++ b/node_modules/split2/index.js @@ -1,5 +1,5 @@ /* -Copyright (c) 2014-2018, Matteo Collina +Copyright (c) 2014-2016, Matteo Collina Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above @@ -16,53 +16,32 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 'use strict' -const { Transform } = require('readable-stream') -const { StringDecoder } = require('string_decoder') -const kLast = Symbol('last') -const kDecoder = Symbol('decoder') +var through = require('through2') +var StringDecoder = require('string_decoder').StringDecoder function transform (chunk, enc, cb) { - var list - if (this.overflow) { // Line buffer is full. Skip to start of next line. - var buf = this[kDecoder].write(chunk) - list = buf.split(this.matcher) - - if (list.length === 1) return cb() // Line ending not found. Discard entire chunk. - - // Line ending found. Discard trailing fragment of previous line and reset overflow state. - list.shift() - this.overflow = false - } else { - this[kLast] += this[kDecoder].write(chunk) - list = this[kLast].split(this.matcher) + this._last += this._decoder.write(chunk) + if (this._last.length > this.maxLength) { + return cb(new Error('maximum buffer reached')) } - this[kLast] = list.pop() + var list = this._last.split(this.matcher) + + this._last = list.pop() for (var i = 0; i < list.length; i++) { - try { - push(this, this.mapper(list[i])) - } catch (error) { - return cb(error) - } + push(this, this.mapper(list[i])) } - this.overflow = this[kLast].length > this.maxLength - if (this.overflow && !this.skipOverflow) return cb(new Error('maximum buffer reached')) - cb() } function flush (cb) { // forward any gibberish left in there - this[kLast] += this[kDecoder].end() + this._last += this._decoder.end() - if (this[kLast]) { - try { - push(this, this.mapper(this[kLast])) - } catch (error) { - return cb(error) - } + if (this._last) { + push(this, this.mapper(this._last)) } cb() @@ -111,20 +90,21 @@ function split (matcher, mapper, options) { } } - options = Object.assign({}, options) - options.transform = transform - options.flush = flush - options.readableObjectMode = true + var stream = through(options, transform, flush) - const stream = new Transform(options) + // this stream is in objectMode only in the readable part + stream._readableState.objectMode = true - stream[kLast] = '' - stream[kDecoder] = new StringDecoder('utf8') + // objectMode default hwm is 16 and not 16384 + if (stream._readableState.highWaterMark && !options.highWaterMark) { + stream._readableState.highWaterMark = 16 + } + + stream._last = '' + stream._decoder = new StringDecoder('utf8') stream.matcher = matcher stream.mapper = mapper stream.maxLength = options.maxLength - stream.skipOverflow = options.skipOverflow - stream.overflow = false return stream } diff --git a/node_modules/split2/node_modules/readable-stream/CONTRIBUTING.md b/node_modules/split2/node_modules/readable-stream/CONTRIBUTING.md deleted file mode 100644 index f478d58..0000000 --- a/node_modules/split2/node_modules/readable-stream/CONTRIBUTING.md +++ /dev/null @@ -1,38 +0,0 @@ -# Developer's Certificate of Origin 1.1 - -By making a contribution to this project, I certify that: - -* (a) The contribution was created in whole or in part by me and I - have the right to submit it under the open source license - indicated in the file; or - -* (b) The contribution is based upon previous work that, to the best - of my knowledge, is covered under an appropriate open source - license and I have the right under that license to submit that - work with modifications, whether created in whole or in part - by me, under the same open source license (unless I am - permitted to submit under a different license), as indicated - in the file; or - -* (c) The contribution was provided directly to me by some other - person who certified (a), (b) or (c) and I have not modified - it. - -* (d) I understand and agree that this project and the contribution - are public and that a record of the contribution (including all - personal information I submit with it, including my sign-off) is - maintained indefinitely and may be redistributed consistent with - this project or the open source license(s) involved. - -## Moderation Policy - -The [Node.js Moderation Policy] applies to this WG. - -## Code of Conduct - -The [Node.js Code of Conduct][] applies to this WG. - -[Node.js Code of Conduct]: -https://github.com/nodejs/node/blob/master/CODE_OF_CONDUCT.md -[Node.js Moderation Policy]: -https://github.com/nodejs/TSC/blob/master/Moderation-Policy.md diff --git a/node_modules/split2/node_modules/readable-stream/GOVERNANCE.md b/node_modules/split2/node_modules/readable-stream/GOVERNANCE.md deleted file mode 100644 index 16ffb93..0000000 --- a/node_modules/split2/node_modules/readable-stream/GOVERNANCE.md +++ /dev/null @@ -1,136 +0,0 @@ -### Streams Working Group - -The Node.js Streams is jointly governed by a Working Group -(WG) -that is responsible for high-level guidance of the project. - -The WG has final authority over this project including: - -* Technical direction -* Project governance and process (including this policy) -* Contribution policy -* GitHub repository hosting -* Conduct guidelines -* Maintaining the list of additional Collaborators - -For the current list of WG members, see the project -[README.md](./README.md#current-project-team-members). - -### Collaborators - -The readable-stream GitHub repository is -maintained by the WG and additional Collaborators who are added by the -WG on an ongoing basis. - -Individuals making significant and valuable contributions are made -Collaborators and given commit-access to the project. These -individuals are identified by the WG and their addition as -Collaborators is discussed during the WG meeting. - -_Note:_ If you make a significant contribution and are not considered -for commit-access log an issue or contact a WG member directly and it -will be brought up in the next WG meeting. - -Modifications of the contents of the readable-stream repository are -made on -a collaborative basis. Anybody with a GitHub account may propose a -modification via pull request and it will be considered by the project -Collaborators. All pull requests must be reviewed and accepted by a -Collaborator with sufficient expertise who is able to take full -responsibility for the change. In the case of pull requests proposed -by an existing Collaborator, an additional Collaborator is required -for sign-off. Consensus should be sought if additional Collaborators -participate and there is disagreement around a particular -modification. See _Consensus Seeking Process_ below for further detail -on the consensus model used for governance. - -Collaborators may opt to elevate significant or controversial -modifications, or modifications that have not found consensus to the -WG for discussion by assigning the ***WG-agenda*** tag to a pull -request or issue. The WG should serve as the final arbiter where -required. - -For the current list of Collaborators, see the project -[README.md](./README.md#members). - -### WG Membership - -WG seats are not time-limited. There is no fixed size of the WG. -However, the expected target is between 6 and 12, to ensure adequate -coverage of important areas of expertise, balanced with the ability to -make decisions efficiently. - -There is no specific set of requirements or qualifications for WG -membership beyond these rules. - -The WG may add additional members to the WG by unanimous consensus. - -A WG member may be removed from the WG by voluntary resignation, or by -unanimous consensus of all other WG members. - -Changes to WG membership should be posted in the agenda, and may be -suggested as any other agenda item (see "WG Meetings" below). - -If an addition or removal is proposed during a meeting, and the full -WG is not in attendance to participate, then the addition or removal -is added to the agenda for the subsequent meeting. This is to ensure -that all members are given the opportunity to participate in all -membership decisions. If a WG member is unable to attend a meeting -where a planned membership decision is being made, then their consent -is assumed. - -No more than 1/3 of the WG members may be affiliated with the same -employer. If removal or resignation of a WG member, or a change of -employment by a WG member, creates a situation where more than 1/3 of -the WG membership shares an employer, then the situation must be -immediately remedied by the resignation or removal of one or more WG -members affiliated with the over-represented employer(s). - -### WG Meetings - -The WG meets occasionally on a Google Hangout On Air. A designated moderator -approved by the WG runs the meeting. Each meeting should be -published to YouTube. - -Items are added to the WG agenda that are considered contentious or -are modifications of governance, contribution policy, WG membership, -or release process. - -The intention of the agenda is not to approve or review all patches; -that should happen continuously on GitHub and be handled by the larger -group of Collaborators. - -Any community member or contributor can ask that something be added to -the next meeting's agenda by logging a GitHub Issue. Any Collaborator, -WG member or the moderator can add the item to the agenda by adding -the ***WG-agenda*** tag to the issue. - -Prior to each WG meeting the moderator will share the Agenda with -members of the WG. WG members can add any items they like to the -agenda at the beginning of each meeting. The moderator and the WG -cannot veto or remove items. - -The WG may invite persons or representatives from certain projects to -participate in a non-voting capacity. - -The moderator is responsible for summarizing the discussion of each -agenda item and sends it as a pull request after the meeting. - -### Consensus Seeking Process - -The WG follows a -[Consensus -Seeking](http://en.wikipedia.org/wiki/Consensus-seeking_decision-making) -decision-making model. - -When an agenda item has appeared to reach a consensus the moderator -will ask "Does anyone object?" as a final call for dissent from the -consensus. - -If an agenda item cannot reach a consensus a WG member can call for -either a closing vote or a vote to table the issue to the next -meeting. The call for a vote must be seconded by a majority of the WG -or else the discussion will continue. Simple majority wins. - -Note that changes to WG membership require a majority consensus. See -"WG Membership" above. diff --git a/node_modules/split2/node_modules/readable-stream/LICENSE b/node_modules/split2/node_modules/readable-stream/LICENSE deleted file mode 100644 index 2873b3b..0000000 --- a/node_modules/split2/node_modules/readable-stream/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Node.js is licensed for use as follows: - -""" -Copyright Node.js contributors. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" - -This license applies to parts of Node.js originating from the -https://github.com/joyent/node repository: - -""" -Copyright Joyent, Inc. and other Node contributors. All rights reserved. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" diff --git a/node_modules/split2/node_modules/readable-stream/README.md b/node_modules/split2/node_modules/readable-stream/README.md deleted file mode 100644 index 19117c1..0000000 --- a/node_modules/split2/node_modules/readable-stream/README.md +++ /dev/null @@ -1,106 +0,0 @@ -# readable-stream - -***Node.js core streams for userland*** [![Build Status](https://travis-ci.com/nodejs/readable-stream.svg?branch=master)](https://travis-ci.com/nodejs/readable-stream) - - -[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/) -[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/) - - -[![Sauce Test Status](https://saucelabs.com/browser-matrix/readabe-stream.svg)](https://saucelabs.com/u/readabe-stream) - -```bash -npm install --save readable-stream -``` - -This package is a mirror of the streams implementations in Node.js. - -Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v10.18.1/docs/api/stream.html). - -If you want to guarantee a stable streams base, regardless of what version of -Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html). - -As of version 2.0.0 **readable-stream** uses semantic versioning. - -## Version 3.x.x - -v3.x.x of `readable-stream` is a cut from Node 10. This version supports Node 6, 8, and 10, as well as evergreen browsers, IE 11 and latest Safari. The breaking changes introduced by v3 are composed by the combined breaking changes in [Node v9](https://nodejs.org/en/blog/release/v9.0.0/) and [Node v10](https://nodejs.org/en/blog/release/v10.0.0/), as follows: - -1. Error codes: https://github.com/nodejs/node/pull/13310, - https://github.com/nodejs/node/pull/13291, - https://github.com/nodejs/node/pull/16589, - https://github.com/nodejs/node/pull/15042, - https://github.com/nodejs/node/pull/15665, - https://github.com/nodejs/readable-stream/pull/344 -2. 'readable' have precedence over flowing - https://github.com/nodejs/node/pull/18994 -3. make virtual methods errors consistent - https://github.com/nodejs/node/pull/18813 -4. updated streams error handling - https://github.com/nodejs/node/pull/18438 -5. writable.end should return this. - https://github.com/nodejs/node/pull/18780 -6. readable continues to read when push('') - https://github.com/nodejs/node/pull/18211 -7. add custom inspect to BufferList - https://github.com/nodejs/node/pull/17907 -8. always defer 'readable' with nextTick - https://github.com/nodejs/node/pull/17979 - -## Version 2.x.x -v2.x.x of `readable-stream` is a cut of the stream module from Node 8 (there have been no semver-major changes from Node 4 to 8). This version supports all Node.js versions from 0.8, as well as evergreen browsers and IE 10 & 11. - -### Big Thanks - -Cross-browser Testing Platform and Open Source <3 Provided by [Sauce Labs][sauce] - -# Usage - -You can swap your `require('stream')` with `require('readable-stream')` -without any changes, if you are just using one of the main classes and -functions. - -```js -const { - Readable, - Writable, - Transform, - Duplex, - pipeline, - finished -} = require('readable-stream') -```` - -Note that `require('stream')` will return `Stream`, while -`require('readable-stream')` will return `Readable`. We discourage using -whatever is exported directly, but rather use one of the properties as -shown in the example above. - -# Streams Working Group - -`readable-stream` is maintained by the Streams Working Group, which -oversees the development and maintenance of the Streams API within -Node.js. The responsibilities of the Streams Working Group include: - -* Addressing stream issues on the Node.js issue tracker. -* Authoring and editing stream documentation within the Node.js project. -* Reviewing changes to stream subclasses within the Node.js project. -* Redirecting changes to streams from the Node.js project to this - project. -* Assisting in the implementation of stream providers within Node.js. -* Recommending versions of `readable-stream` to be included in Node.js. -* Messaging about the future of streams to give the community advance - notice of changes. - - -## Team Members - -* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) <calvin.metcalf@gmail.com> - - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242 -* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) <mathiasbuus@gmail.com> -* **Matteo Collina** ([@mcollina](https://github.com/mcollina)) <matteo.collina@gmail.com> - - Release GPG key: 3ABC01543F22DD2239285CDD818674489FBC127E -* **Irina Shestak** ([@lrlna](https://github.com/lrlna)) <shestak.irina@gmail.com> -* **Yoshua Wyuts** ([@yoshuawuyts](https://github.com/yoshuawuyts)) <yoshuawuyts@gmail.com> - -[sauce]: https://saucelabs.com diff --git a/node_modules/split2/node_modules/readable-stream/errors-browser.js b/node_modules/split2/node_modules/readable-stream/errors-browser.js deleted file mode 100644 index fb8e73e..0000000 --- a/node_modules/split2/node_modules/readable-stream/errors-browser.js +++ /dev/null @@ -1,127 +0,0 @@ -'use strict'; - -function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } - -var codes = {}; - -function createErrorType(code, message, Base) { - if (!Base) { - Base = Error; - } - - function getMessage(arg1, arg2, arg3) { - if (typeof message === 'string') { - return message; - } else { - return message(arg1, arg2, arg3); - } - } - - var NodeError = - /*#__PURE__*/ - function (_Base) { - _inheritsLoose(NodeError, _Base); - - function NodeError(arg1, arg2, arg3) { - return _Base.call(this, getMessage(arg1, arg2, arg3)) || this; - } - - return NodeError; - }(Base); - - NodeError.prototype.name = Base.name; - NodeError.prototype.code = code; - codes[code] = NodeError; -} // https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js - - -function oneOf(expected, thing) { - if (Array.isArray(expected)) { - var len = expected.length; - expected = expected.map(function (i) { - return String(i); - }); - - if (len > 2) { - return "one of ".concat(thing, " ").concat(expected.slice(0, len - 1).join(', '), ", or ") + expected[len - 1]; - } else if (len === 2) { - return "one of ".concat(thing, " ").concat(expected[0], " or ").concat(expected[1]); - } else { - return "of ".concat(thing, " ").concat(expected[0]); - } - } else { - return "of ".concat(thing, " ").concat(String(expected)); - } -} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith - - -function startsWith(str, search, pos) { - return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search; -} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith - - -function endsWith(str, search, this_len) { - if (this_len === undefined || this_len > str.length) { - this_len = str.length; - } - - return str.substring(this_len - search.length, this_len) === search; -} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes - - -function includes(str, search, start) { - if (typeof start !== 'number') { - start = 0; - } - - if (start + search.length > str.length) { - return false; - } else { - return str.indexOf(search, start) !== -1; - } -} - -createErrorType('ERR_INVALID_OPT_VALUE', function (name, value) { - return 'The value "' + value + '" is invalid for option "' + name + '"'; -}, TypeError); -createErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) { - // determiner: 'must be' or 'must not be' - var determiner; - - if (typeof expected === 'string' && startsWith(expected, 'not ')) { - determiner = 'must not be'; - expected = expected.replace(/^not /, ''); - } else { - determiner = 'must be'; - } - - var msg; - - if (endsWith(name, ' argument')) { - // For cases like 'first argument' - msg = "The ".concat(name, " ").concat(determiner, " ").concat(oneOf(expected, 'type')); - } else { - var type = includes(name, '.') ? 'property' : 'argument'; - msg = "The \"".concat(name, "\" ").concat(type, " ").concat(determiner, " ").concat(oneOf(expected, 'type')); - } - - msg += ". Received type ".concat(typeof actual); - return msg; -}, TypeError); -createErrorType('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF'); -createErrorType('ERR_METHOD_NOT_IMPLEMENTED', function (name) { - return 'The ' + name + ' method is not implemented'; -}); -createErrorType('ERR_STREAM_PREMATURE_CLOSE', 'Premature close'); -createErrorType('ERR_STREAM_DESTROYED', function (name) { - return 'Cannot call ' + name + ' after a stream was destroyed'; -}); -createErrorType('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times'); -createErrorType('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable'); -createErrorType('ERR_STREAM_WRITE_AFTER_END', 'write after end'); -createErrorType('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError); -createErrorType('ERR_UNKNOWN_ENCODING', function (arg) { - return 'Unknown encoding: ' + arg; -}, TypeError); -createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event'); -module.exports.codes = codes; diff --git a/node_modules/split2/node_modules/readable-stream/errors.js b/node_modules/split2/node_modules/readable-stream/errors.js deleted file mode 100644 index 8471526..0000000 --- a/node_modules/split2/node_modules/readable-stream/errors.js +++ /dev/null @@ -1,116 +0,0 @@ -'use strict'; - -const codes = {}; - -function createErrorType(code, message, Base) { - if (!Base) { - Base = Error - } - - function getMessage (arg1, arg2, arg3) { - if (typeof message === 'string') { - return message - } else { - return message(arg1, arg2, arg3) - } - } - - class NodeError extends Base { - constructor (arg1, arg2, arg3) { - super(getMessage(arg1, arg2, arg3)); - } - } - - NodeError.prototype.name = Base.name; - NodeError.prototype.code = code; - - codes[code] = NodeError; -} - -// https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js -function oneOf(expected, thing) { - if (Array.isArray(expected)) { - const len = expected.length; - expected = expected.map((i) => String(i)); - if (len > 2) { - return `one of ${thing} ${expected.slice(0, len - 1).join(', ')}, or ` + - expected[len - 1]; - } else if (len === 2) { - return `one of ${thing} ${expected[0]} or ${expected[1]}`; - } else { - return `of ${thing} ${expected[0]}`; - } - } else { - return `of ${thing} ${String(expected)}`; - } -} - -// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith -function startsWith(str, search, pos) { - return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search; -} - -// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith -function endsWith(str, search, this_len) { - if (this_len === undefined || this_len > str.length) { - this_len = str.length; - } - return str.substring(this_len - search.length, this_len) === search; -} - -// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes -function includes(str, search, start) { - if (typeof start !== 'number') { - start = 0; - } - - if (start + search.length > str.length) { - return false; - } else { - return str.indexOf(search, start) !== -1; - } -} - -createErrorType('ERR_INVALID_OPT_VALUE', function (name, value) { - return 'The value "' + value + '" is invalid for option "' + name + '"' -}, TypeError); -createErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) { - // determiner: 'must be' or 'must not be' - let determiner; - if (typeof expected === 'string' && startsWith(expected, 'not ')) { - determiner = 'must not be'; - expected = expected.replace(/^not /, ''); - } else { - determiner = 'must be'; - } - - let msg; - if (endsWith(name, ' argument')) { - // For cases like 'first argument' - msg = `The ${name} ${determiner} ${oneOf(expected, 'type')}`; - } else { - const type = includes(name, '.') ? 'property' : 'argument'; - msg = `The "${name}" ${type} ${determiner} ${oneOf(expected, 'type')}`; - } - - msg += `. Received type ${typeof actual}`; - return msg; -}, TypeError); -createErrorType('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF'); -createErrorType('ERR_METHOD_NOT_IMPLEMENTED', function (name) { - return 'The ' + name + ' method is not implemented' -}); -createErrorType('ERR_STREAM_PREMATURE_CLOSE', 'Premature close'); -createErrorType('ERR_STREAM_DESTROYED', function (name) { - return 'Cannot call ' + name + ' after a stream was destroyed'; -}); -createErrorType('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times'); -createErrorType('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable'); -createErrorType('ERR_STREAM_WRITE_AFTER_END', 'write after end'); -createErrorType('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError); -createErrorType('ERR_UNKNOWN_ENCODING', function (arg) { - return 'Unknown encoding: ' + arg -}, TypeError); -createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event'); - -module.exports.codes = codes; diff --git a/node_modules/split2/node_modules/readable-stream/experimentalWarning.js b/node_modules/split2/node_modules/readable-stream/experimentalWarning.js deleted file mode 100644 index 78e8414..0000000 --- a/node_modules/split2/node_modules/readable-stream/experimentalWarning.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict' - -var experimentalWarnings = new Set(); - -function emitExperimentalWarning(feature) { - if (experimentalWarnings.has(feature)) return; - var msg = feature + ' is an experimental feature. This feature could ' + - 'change at any time'; - experimentalWarnings.add(feature); - process.emitWarning(msg, 'ExperimentalWarning'); -} - -function noop() {} - -module.exports.emitExperimentalWarning = process.emitWarning - ? emitExperimentalWarning - : noop; diff --git a/node_modules/split2/node_modules/readable-stream/lib/_stream_duplex.js b/node_modules/split2/node_modules/readable-stream/lib/_stream_duplex.js deleted file mode 100644 index 19abfa6..0000000 --- a/node_modules/split2/node_modules/readable-stream/lib/_stream_duplex.js +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// a duplex stream is just a stream that is both readable and writable. -// Since JS doesn't have multiple prototypal inheritance, this class -// prototypally inherits from Readable, and then parasitically from -// Writable. - -'use strict'; - -/**/ -var objectKeys = Object.keys || function (obj) { - var keys = []; - for (var key in obj) keys.push(key); - return keys; -}; -/**/ - -module.exports = Duplex; -var Readable = require('./_stream_readable'); -var Writable = require('./_stream_writable'); -require('inherits')(Duplex, Readable); -{ - // Allow the keys array to be GC'ed. - var keys = objectKeys(Writable.prototype); - for (var v = 0; v < keys.length; v++) { - var method = keys[v]; - if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; - } -} -function Duplex(options) { - if (!(this instanceof Duplex)) return new Duplex(options); - Readable.call(this, options); - Writable.call(this, options); - this.allowHalfOpen = true; - if (options) { - if (options.readable === false) this.readable = false; - if (options.writable === false) this.writable = false; - if (options.allowHalfOpen === false) { - this.allowHalfOpen = false; - this.once('end', onend); - } - } -} -Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState.highWaterMark; - } -}); -Object.defineProperty(Duplex.prototype, 'writableBuffer', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState && this._writableState.getBuffer(); - } -}); -Object.defineProperty(Duplex.prototype, 'writableLength', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState.length; - } -}); - -// the no-half-open enforcer -function onend() { - // If the writable side ended, then we're ok. - if (this._writableState.ended) return; - - // no more data can be written. - // But allow more writes to happen in this tick. - process.nextTick(onEndNT, this); -} -function onEndNT(self) { - self.end(); -} -Object.defineProperty(Duplex.prototype, 'destroyed', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - if (this._readableState === undefined || this._writableState === undefined) { - return false; - } - return this._readableState.destroyed && this._writableState.destroyed; - }, - set: function set(value) { - // we ignore the value if the stream - // has not been initialized yet - if (this._readableState === undefined || this._writableState === undefined) { - return; - } - - // backward compatibility, the user is explicitly - // managing destroyed - this._readableState.destroyed = value; - this._writableState.destroyed = value; - } -}); \ No newline at end of file diff --git a/node_modules/split2/node_modules/readable-stream/lib/_stream_passthrough.js b/node_modules/split2/node_modules/readable-stream/lib/_stream_passthrough.js deleted file mode 100644 index 24a6bdd..0000000 --- a/node_modules/split2/node_modules/readable-stream/lib/_stream_passthrough.js +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// a passthrough stream. -// basically just the most minimal sort of Transform stream. -// Every written chunk gets output as-is. - -'use strict'; - -module.exports = PassThrough; -var Transform = require('./_stream_transform'); -require('inherits')(PassThrough, Transform); -function PassThrough(options) { - if (!(this instanceof PassThrough)) return new PassThrough(options); - Transform.call(this, options); -} -PassThrough.prototype._transform = function (chunk, encoding, cb) { - cb(null, chunk); -}; \ No newline at end of file diff --git a/node_modules/split2/node_modules/readable-stream/lib/_stream_readable.js b/node_modules/split2/node_modules/readable-stream/lib/_stream_readable.js deleted file mode 100644 index df1f608..0000000 --- a/node_modules/split2/node_modules/readable-stream/lib/_stream_readable.js +++ /dev/null @@ -1,1027 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -'use strict'; - -module.exports = Readable; - -/**/ -var Duplex; -/**/ - -Readable.ReadableState = ReadableState; - -/**/ -var EE = require('events').EventEmitter; -var EElistenerCount = function EElistenerCount(emitter, type) { - return emitter.listeners(type).length; -}; -/**/ - -/**/ -var Stream = require('./internal/streams/stream'); -/**/ - -var Buffer = require('buffer').Buffer; -var OurUint8Array = (typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {}; -function _uint8ArrayToBuffer(chunk) { - return Buffer.from(chunk); -} -function _isUint8Array(obj) { - return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; -} - -/**/ -var debugUtil = require('util'); -var debug; -if (debugUtil && debugUtil.debuglog) { - debug = debugUtil.debuglog('stream'); -} else { - debug = function debug() {}; -} -/**/ - -var BufferList = require('./internal/streams/buffer_list'); -var destroyImpl = require('./internal/streams/destroy'); -var _require = require('./internal/streams/state'), - getHighWaterMark = _require.getHighWaterMark; -var _require$codes = require('../errors').codes, - ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, - ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF, - ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, - ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; - -// Lazy loaded to improve the startup performance. -var StringDecoder; -var createReadableStreamAsyncIterator; -var from; -require('inherits')(Readable, Stream); -var errorOrDestroy = destroyImpl.errorOrDestroy; -var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; -function prependListener(emitter, event, fn) { - // Sadly this is not cacheable as some libraries bundle their own - // event emitter implementation with them. - if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); - - // This is a hack to make sure that our error handler is attached before any - // userland ones. NEVER DO THIS. This is here only because this code needs - // to continue to work with older versions of Node.js that do not include - // the prependListener() method. The goal is to eventually remove this hack. - if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; -} -function ReadableState(options, stream, isDuplex) { - Duplex = Duplex || require('./_stream_duplex'); - options = options || {}; - - // Duplex streams are both readable and writable, but share - // the same options object. - // However, some cases require setting options to different - // values for the readable and the writable sides of the duplex stream. - // These options can be provided separately as readableXXX and writableXXX. - if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; - - // object stream flag. Used to make read(n) ignore n and to - // make all the buffer merging and length checks go away - this.objectMode = !!options.objectMode; - if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; - - // the point at which it stops calling _read() to fill the buffer - // Note: 0 is a valid value, means "don't call _read preemptively ever" - this.highWaterMark = getHighWaterMark(this, options, 'readableHighWaterMark', isDuplex); - - // A linked list is used to store data chunks instead of an array because the - // linked list can remove elements from the beginning faster than - // array.shift() - this.buffer = new BufferList(); - this.length = 0; - this.pipes = null; - this.pipesCount = 0; - this.flowing = null; - this.ended = false; - this.endEmitted = false; - this.reading = false; - - // a flag to be able to tell if the event 'readable'/'data' is emitted - // immediately, or on a later tick. We set this to true at first, because - // any actions that shouldn't happen until "later" should generally also - // not happen before the first read call. - this.sync = true; - - // whenever we return null, then we set a flag to say - // that we're awaiting a 'readable' event emission. - this.needReadable = false; - this.emittedReadable = false; - this.readableListening = false; - this.resumeScheduled = false; - this.paused = true; - - // Should close be emitted on destroy. Defaults to true. - this.emitClose = options.emitClose !== false; - - // Should .destroy() be called after 'end' (and potentially 'finish') - this.autoDestroy = !!options.autoDestroy; - - // has it been destroyed - this.destroyed = false; - - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; - - // the number of writers that are awaiting a drain event in .pipe()s - this.awaitDrain = 0; - - // if true, a maybeReadMore has been scheduled - this.readingMore = false; - this.decoder = null; - this.encoding = null; - if (options.encoding) { - if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; - this.decoder = new StringDecoder(options.encoding); - this.encoding = options.encoding; - } -} -function Readable(options) { - Duplex = Duplex || require('./_stream_duplex'); - if (!(this instanceof Readable)) return new Readable(options); - - // Checking for a Stream.Duplex instance is faster here instead of inside - // the ReadableState constructor, at least with V8 6.5 - var isDuplex = this instanceof Duplex; - this._readableState = new ReadableState(options, this, isDuplex); - - // legacy - this.readable = true; - if (options) { - if (typeof options.read === 'function') this._read = options.read; - if (typeof options.destroy === 'function') this._destroy = options.destroy; - } - Stream.call(this); -} -Object.defineProperty(Readable.prototype, 'destroyed', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - if (this._readableState === undefined) { - return false; - } - return this._readableState.destroyed; - }, - set: function set(value) { - // we ignore the value if the stream - // has not been initialized yet - if (!this._readableState) { - return; - } - - // backward compatibility, the user is explicitly - // managing destroyed - this._readableState.destroyed = value; - } -}); -Readable.prototype.destroy = destroyImpl.destroy; -Readable.prototype._undestroy = destroyImpl.undestroy; -Readable.prototype._destroy = function (err, cb) { - cb(err); -}; - -// Manually shove something into the read() buffer. -// This returns true if the highWaterMark has not been hit yet, -// similar to how Writable.write() returns true if you should -// write() some more. -Readable.prototype.push = function (chunk, encoding) { - var state = this._readableState; - var skipChunkCheck; - if (!state.objectMode) { - if (typeof chunk === 'string') { - encoding = encoding || state.defaultEncoding; - if (encoding !== state.encoding) { - chunk = Buffer.from(chunk, encoding); - encoding = ''; - } - skipChunkCheck = true; - } - } else { - skipChunkCheck = true; - } - return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); -}; - -// Unshift should *always* be something directly out of read() -Readable.prototype.unshift = function (chunk) { - return readableAddChunk(this, chunk, null, true, false); -}; -function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { - debug('readableAddChunk', chunk); - var state = stream._readableState; - if (chunk === null) { - state.reading = false; - onEofChunk(stream, state); - } else { - var er; - if (!skipChunkCheck) er = chunkInvalid(state, chunk); - if (er) { - errorOrDestroy(stream, er); - } else if (state.objectMode || chunk && chunk.length > 0) { - if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) { - chunk = _uint8ArrayToBuffer(chunk); - } - if (addToFront) { - if (state.endEmitted) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());else addChunk(stream, state, chunk, true); - } else if (state.ended) { - errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF()); - } else if (state.destroyed) { - return false; - } else { - state.reading = false; - if (state.decoder && !encoding) { - chunk = state.decoder.write(chunk); - if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state); - } else { - addChunk(stream, state, chunk, false); - } - } - } else if (!addToFront) { - state.reading = false; - maybeReadMore(stream, state); - } - } - - // We can push more data if we are below the highWaterMark. - // Also, if we have no data yet, we can stand some more bytes. - // This is to work around cases where hwm=0, such as the repl. - return !state.ended && (state.length < state.highWaterMark || state.length === 0); -} -function addChunk(stream, state, chunk, addToFront) { - if (state.flowing && state.length === 0 && !state.sync) { - state.awaitDrain = 0; - stream.emit('data', chunk); - } else { - // update the buffer info. - state.length += state.objectMode ? 1 : chunk.length; - if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); - if (state.needReadable) emitReadable(stream); - } - maybeReadMore(stream, state); -} -function chunkInvalid(state, chunk) { - var er; - if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { - er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk); - } - return er; -} -Readable.prototype.isPaused = function () { - return this._readableState.flowing === false; -}; - -// backwards compatibility. -Readable.prototype.setEncoding = function (enc) { - if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; - var decoder = new StringDecoder(enc); - this._readableState.decoder = decoder; - // If setEncoding(null), decoder.encoding equals utf8 - this._readableState.encoding = this._readableState.decoder.encoding; - - // Iterate over current buffer to convert already stored Buffers: - var p = this._readableState.buffer.head; - var content = ''; - while (p !== null) { - content += decoder.write(p.data); - p = p.next; - } - this._readableState.buffer.clear(); - if (content !== '') this._readableState.buffer.push(content); - this._readableState.length = content.length; - return this; -}; - -// Don't raise the hwm > 1GB -var MAX_HWM = 0x40000000; -function computeNewHighWaterMark(n) { - if (n >= MAX_HWM) { - // TODO(ronag): Throw ERR_VALUE_OUT_OF_RANGE. - n = MAX_HWM; - } else { - // Get the next highest power of 2 to prevent increasing hwm excessively in - // tiny amounts - n--; - n |= n >>> 1; - n |= n >>> 2; - n |= n >>> 4; - n |= n >>> 8; - n |= n >>> 16; - n++; - } - return n; -} - -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function howMuchToRead(n, state) { - if (n <= 0 || state.length === 0 && state.ended) return 0; - if (state.objectMode) return 1; - if (n !== n) { - // Only flow one buffer at a time - if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; - } - // If we're asking for more than the current hwm, then raise the hwm. - if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); - if (n <= state.length) return n; - // Don't have enough - if (!state.ended) { - state.needReadable = true; - return 0; - } - return state.length; -} - -// you can override either this method, or the async _read(n) below. -Readable.prototype.read = function (n) { - debug('read', n); - n = parseInt(n, 10); - var state = this._readableState; - var nOrig = n; - if (n !== 0) state.emittedReadable = false; - - // if we're doing read(0) to trigger a readable event, but we - // already have a bunch of data in the buffer, then just trigger - // the 'readable' event and move on. - if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) { - debug('read: emitReadable', state.length, state.ended); - if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); - return null; - } - n = howMuchToRead(n, state); - - // if we've ended, and we're now clear, then finish it up. - if (n === 0 && state.ended) { - if (state.length === 0) endReadable(this); - return null; - } - - // All the actual chunk generation logic needs to be - // *below* the call to _read. The reason is that in certain - // synthetic stream cases, such as passthrough streams, _read - // may be a completely synchronous operation which may change - // the state of the read buffer, providing enough data when - // before there was *not* enough. - // - // So, the steps are: - // 1. Figure out what the state of things will be after we do - // a read from the buffer. - // - // 2. If that resulting state will trigger a _read, then call _read. - // Note that this may be asynchronous, or synchronous. Yes, it is - // deeply ugly to write APIs this way, but that still doesn't mean - // that the Readable class should behave improperly, as streams are - // designed to be sync/async agnostic. - // Take note if the _read call is sync or async (ie, if the read call - // has returned yet), so that we know whether or not it's safe to emit - // 'readable' etc. - // - // 3. Actually pull the requested chunks out of the buffer and return. - - // if we need a readable event, then we need to do some reading. - var doRead = state.needReadable; - debug('need readable', doRead); - - // if we currently have less than the highWaterMark, then also read some - if (state.length === 0 || state.length - n < state.highWaterMark) { - doRead = true; - debug('length less than watermark', doRead); - } - - // however, if we've ended, then there's no point, and if we're already - // reading, then it's unnecessary. - if (state.ended || state.reading) { - doRead = false; - debug('reading or ended', doRead); - } else if (doRead) { - debug('do read'); - state.reading = true; - state.sync = true; - // if the length is currently zero, then we *need* a readable event. - if (state.length === 0) state.needReadable = true; - // call internal read method - this._read(state.highWaterMark); - state.sync = false; - // If _read pushed data synchronously, then `reading` will be false, - // and we need to re-evaluate how much data we can return to the user. - if (!state.reading) n = howMuchToRead(nOrig, state); - } - var ret; - if (n > 0) ret = fromList(n, state);else ret = null; - if (ret === null) { - state.needReadable = state.length <= state.highWaterMark; - n = 0; - } else { - state.length -= n; - state.awaitDrain = 0; - } - if (state.length === 0) { - // If we have nothing in the buffer, then we want to know - // as soon as we *do* get something into the buffer. - if (!state.ended) state.needReadable = true; - - // If we tried to read() past the EOF, then emit end on the next tick. - if (nOrig !== n && state.ended) endReadable(this); - } - if (ret !== null) this.emit('data', ret); - return ret; -}; -function onEofChunk(stream, state) { - debug('onEofChunk'); - if (state.ended) return; - if (state.decoder) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) { - state.buffer.push(chunk); - state.length += state.objectMode ? 1 : chunk.length; - } - } - state.ended = true; - if (state.sync) { - // if we are sync, wait until next tick to emit the data. - // Otherwise we risk emitting data in the flow() - // the readable code triggers during a read() call - emitReadable(stream); - } else { - // emit 'readable' now to make sure it gets picked up. - state.needReadable = false; - if (!state.emittedReadable) { - state.emittedReadable = true; - emitReadable_(stream); - } - } -} - -// Don't emit readable right away in sync mode, because this can trigger -// another read() call => stack overflow. This way, it might trigger -// a nextTick recursion warning, but that's not so bad. -function emitReadable(stream) { - var state = stream._readableState; - debug('emitReadable', state.needReadable, state.emittedReadable); - state.needReadable = false; - if (!state.emittedReadable) { - debug('emitReadable', state.flowing); - state.emittedReadable = true; - process.nextTick(emitReadable_, stream); - } -} -function emitReadable_(stream) { - var state = stream._readableState; - debug('emitReadable_', state.destroyed, state.length, state.ended); - if (!state.destroyed && (state.length || state.ended)) { - stream.emit('readable'); - state.emittedReadable = false; - } - - // The stream needs another readable event if - // 1. It is not flowing, as the flow mechanism will take - // care of it. - // 2. It is not ended. - // 3. It is below the highWaterMark, so we can schedule - // another readable later. - state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark; - flow(stream); -} - -// at this point, the user has presumably seen the 'readable' event, -// and called read() to consume some data. that may have triggered -// in turn another _read(n) call, in which case reading = true if -// it's in progress. -// However, if we're not ended, or reading, and the length < hwm, -// then go ahead and try to read some more preemptively. -function maybeReadMore(stream, state) { - if (!state.readingMore) { - state.readingMore = true; - process.nextTick(maybeReadMore_, stream, state); - } -} -function maybeReadMore_(stream, state) { - // Attempt to read more data if we should. - // - // The conditions for reading more data are (one of): - // - Not enough data buffered (state.length < state.highWaterMark). The loop - // is responsible for filling the buffer with enough data if such data - // is available. If highWaterMark is 0 and we are not in the flowing mode - // we should _not_ attempt to buffer any extra data. We'll get more data - // when the stream consumer calls read() instead. - // - No data in the buffer, and the stream is in flowing mode. In this mode - // the loop below is responsible for ensuring read() is called. Failing to - // call read here would abort the flow and there's no other mechanism for - // continuing the flow if the stream consumer has just subscribed to the - // 'data' event. - // - // In addition to the above conditions to keep reading data, the following - // conditions prevent the data from being read: - // - The stream has ended (state.ended). - // - There is already a pending 'read' operation (state.reading). This is a - // case where the the stream has called the implementation defined _read() - // method, but they are processing the call asynchronously and have _not_ - // called push() with new data. In this case we skip performing more - // read()s. The execution ends in this method again after the _read() ends - // up calling push() with more data. - while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) { - var len = state.length; - debug('maybeReadMore read 0'); - stream.read(0); - if (len === state.length) - // didn't get any data, stop spinning. - break; - } - state.readingMore = false; -} - -// abstract method. to be overridden in specific implementation classes. -// call cb(er, data) where data is <= n in length. -// for virtual (non-string, non-buffer) streams, "length" is somewhat -// arbitrary, and perhaps not very meaningful. -Readable.prototype._read = function (n) { - errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED('_read()')); -}; -Readable.prototype.pipe = function (dest, pipeOpts) { - var src = this; - var state = this._readableState; - switch (state.pipesCount) { - case 0: - state.pipes = dest; - break; - case 1: - state.pipes = [state.pipes, dest]; - break; - default: - state.pipes.push(dest); - break; - } - state.pipesCount += 1; - debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); - var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; - var endFn = doEnd ? onend : unpipe; - if (state.endEmitted) process.nextTick(endFn);else src.once('end', endFn); - dest.on('unpipe', onunpipe); - function onunpipe(readable, unpipeInfo) { - debug('onunpipe'); - if (readable === src) { - if (unpipeInfo && unpipeInfo.hasUnpiped === false) { - unpipeInfo.hasUnpiped = true; - cleanup(); - } - } - } - function onend() { - debug('onend'); - dest.end(); - } - - // when the dest drains, it reduces the awaitDrain counter - // on the source. This would be more elegant with a .once() - // handler in flow(), but adding and removing repeatedly is - // too slow. - var ondrain = pipeOnDrain(src); - dest.on('drain', ondrain); - var cleanedUp = false; - function cleanup() { - debug('cleanup'); - // cleanup event handlers once the pipe is broken - dest.removeListener('close', onclose); - dest.removeListener('finish', onfinish); - dest.removeListener('drain', ondrain); - dest.removeListener('error', onerror); - dest.removeListener('unpipe', onunpipe); - src.removeListener('end', onend); - src.removeListener('end', unpipe); - src.removeListener('data', ondata); - cleanedUp = true; - - // if the reader is waiting for a drain event from this - // specific writer, then it would cause it to never start - // flowing again. - // So, if this is awaiting a drain, then we just call it now. - // If we don't know, then assume that we are waiting for one. - if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); - } - src.on('data', ondata); - function ondata(chunk) { - debug('ondata'); - var ret = dest.write(chunk); - debug('dest.write', ret); - if (ret === false) { - // If the user unpiped during `dest.write()`, it is possible - // to get stuck in a permanently paused state if that write - // also returned false. - // => Check whether `dest` is still a piping destination. - if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { - debug('false write response, pause', state.awaitDrain); - state.awaitDrain++; - } - src.pause(); - } - } - - // if the dest has an error, then stop piping into it. - // however, don't suppress the throwing behavior for this. - function onerror(er) { - debug('onerror', er); - unpipe(); - dest.removeListener('error', onerror); - if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er); - } - - // Make sure our error handler is attached before userland ones. - prependListener(dest, 'error', onerror); - - // Both close and finish should trigger unpipe, but only once. - function onclose() { - dest.removeListener('finish', onfinish); - unpipe(); - } - dest.once('close', onclose); - function onfinish() { - debug('onfinish'); - dest.removeListener('close', onclose); - unpipe(); - } - dest.once('finish', onfinish); - function unpipe() { - debug('unpipe'); - src.unpipe(dest); - } - - // tell the dest that it's being piped to - dest.emit('pipe', src); - - // start the flow if it hasn't been started already. - if (!state.flowing) { - debug('pipe resume'); - src.resume(); - } - return dest; -}; -function pipeOnDrain(src) { - return function pipeOnDrainFunctionResult() { - var state = src._readableState; - debug('pipeOnDrain', state.awaitDrain); - if (state.awaitDrain) state.awaitDrain--; - if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { - state.flowing = true; - flow(src); - } - }; -} -Readable.prototype.unpipe = function (dest) { - var state = this._readableState; - var unpipeInfo = { - hasUnpiped: false - }; - - // if we're not piping anywhere, then do nothing. - if (state.pipesCount === 0) return this; - - // just one destination. most common case. - if (state.pipesCount === 1) { - // passed in one, but it's not the right one. - if (dest && dest !== state.pipes) return this; - if (!dest) dest = state.pipes; - - // got a match. - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - if (dest) dest.emit('unpipe', this, unpipeInfo); - return this; - } - - // slow case. multiple pipe destinations. - - if (!dest) { - // remove all. - var dests = state.pipes; - var len = state.pipesCount; - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - for (var i = 0; i < len; i++) dests[i].emit('unpipe', this, { - hasUnpiped: false - }); - return this; - } - - // try to find the right one. - var index = indexOf(state.pipes, dest); - if (index === -1) return this; - state.pipes.splice(index, 1); - state.pipesCount -= 1; - if (state.pipesCount === 1) state.pipes = state.pipes[0]; - dest.emit('unpipe', this, unpipeInfo); - return this; -}; - -// set up data events if they are asked for -// Ensure readable listeners eventually get something -Readable.prototype.on = function (ev, fn) { - var res = Stream.prototype.on.call(this, ev, fn); - var state = this._readableState; - if (ev === 'data') { - // update readableListening so that resume() may be a no-op - // a few lines down. This is needed to support once('readable'). - state.readableListening = this.listenerCount('readable') > 0; - - // Try start flowing on next tick if stream isn't explicitly paused - if (state.flowing !== false) this.resume(); - } else if (ev === 'readable') { - if (!state.endEmitted && !state.readableListening) { - state.readableListening = state.needReadable = true; - state.flowing = false; - state.emittedReadable = false; - debug('on readable', state.length, state.reading); - if (state.length) { - emitReadable(this); - } else if (!state.reading) { - process.nextTick(nReadingNextTick, this); - } - } - } - return res; -}; -Readable.prototype.addListener = Readable.prototype.on; -Readable.prototype.removeListener = function (ev, fn) { - var res = Stream.prototype.removeListener.call(this, ev, fn); - if (ev === 'readable') { - // We need to check if there is someone still listening to - // readable and reset the state. However this needs to happen - // after readable has been emitted but before I/O (nextTick) to - // support once('readable', fn) cycles. This means that calling - // resume within the same tick will have no - // effect. - process.nextTick(updateReadableListening, this); - } - return res; -}; -Readable.prototype.removeAllListeners = function (ev) { - var res = Stream.prototype.removeAllListeners.apply(this, arguments); - if (ev === 'readable' || ev === undefined) { - // We need to check if there is someone still listening to - // readable and reset the state. However this needs to happen - // after readable has been emitted but before I/O (nextTick) to - // support once('readable', fn) cycles. This means that calling - // resume within the same tick will have no - // effect. - process.nextTick(updateReadableListening, this); - } - return res; -}; -function updateReadableListening(self) { - var state = self._readableState; - state.readableListening = self.listenerCount('readable') > 0; - if (state.resumeScheduled && !state.paused) { - // flowing needs to be set to true now, otherwise - // the upcoming resume will not flow. - state.flowing = true; - - // crude way to check if we should resume - } else if (self.listenerCount('data') > 0) { - self.resume(); - } -} -function nReadingNextTick(self) { - debug('readable nexttick read 0'); - self.read(0); -} - -// pause() and resume() are remnants of the legacy readable stream API -// If the user uses them, then switch into old mode. -Readable.prototype.resume = function () { - var state = this._readableState; - if (!state.flowing) { - debug('resume'); - // we flow only if there is no one listening - // for readable, but we still have to call - // resume() - state.flowing = !state.readableListening; - resume(this, state); - } - state.paused = false; - return this; -}; -function resume(stream, state) { - if (!state.resumeScheduled) { - state.resumeScheduled = true; - process.nextTick(resume_, stream, state); - } -} -function resume_(stream, state) { - debug('resume', state.reading); - if (!state.reading) { - stream.read(0); - } - state.resumeScheduled = false; - stream.emit('resume'); - flow(stream); - if (state.flowing && !state.reading) stream.read(0); -} -Readable.prototype.pause = function () { - debug('call pause flowing=%j', this._readableState.flowing); - if (this._readableState.flowing !== false) { - debug('pause'); - this._readableState.flowing = false; - this.emit('pause'); - } - this._readableState.paused = true; - return this; -}; -function flow(stream) { - var state = stream._readableState; - debug('flow', state.flowing); - while (state.flowing && stream.read() !== null); -} - -// wrap an old-style stream as the async data source. -// This is *not* part of the readable stream interface. -// It is an ugly unfortunate mess of history. -Readable.prototype.wrap = function (stream) { - var _this = this; - var state = this._readableState; - var paused = false; - stream.on('end', function () { - debug('wrapped end'); - if (state.decoder && !state.ended) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) _this.push(chunk); - } - _this.push(null); - }); - stream.on('data', function (chunk) { - debug('wrapped data'); - if (state.decoder) chunk = state.decoder.write(chunk); - - // don't skip over falsy values in objectMode - if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; - var ret = _this.push(chunk); - if (!ret) { - paused = true; - stream.pause(); - } - }); - - // proxy all the other methods. - // important when wrapping filters and duplexes. - for (var i in stream) { - if (this[i] === undefined && typeof stream[i] === 'function') { - this[i] = function methodWrap(method) { - return function methodWrapReturnFunction() { - return stream[method].apply(stream, arguments); - }; - }(i); - } - } - - // proxy certain important events. - for (var n = 0; n < kProxyEvents.length; n++) { - stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); - } - - // when we try to consume some more bytes, simply unpause the - // underlying stream. - this._read = function (n) { - debug('wrapped _read', n); - if (paused) { - paused = false; - stream.resume(); - } - }; - return this; -}; -if (typeof Symbol === 'function') { - Readable.prototype[Symbol.asyncIterator] = function () { - if (createReadableStreamAsyncIterator === undefined) { - createReadableStreamAsyncIterator = require('./internal/streams/async_iterator'); - } - return createReadableStreamAsyncIterator(this); - }; -} -Object.defineProperty(Readable.prototype, 'readableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._readableState.highWaterMark; - } -}); -Object.defineProperty(Readable.prototype, 'readableBuffer', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._readableState && this._readableState.buffer; - } -}); -Object.defineProperty(Readable.prototype, 'readableFlowing', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._readableState.flowing; - }, - set: function set(state) { - if (this._readableState) { - this._readableState.flowing = state; - } - } -}); - -// exposed for testing purposes only. -Readable._fromList = fromList; -Object.defineProperty(Readable.prototype, 'readableLength', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._readableState.length; - } -}); - -// Pluck off n bytes from an array of buffers. -// Length is the combined lengths of all the buffers in the list. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function fromList(n, state) { - // nothing buffered - if (state.length === 0) return null; - var ret; - if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { - // read it all, truncate the list - if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.first();else ret = state.buffer.concat(state.length); - state.buffer.clear(); - } else { - // read part of list - ret = state.buffer.consume(n, state.decoder); - } - return ret; -} -function endReadable(stream) { - var state = stream._readableState; - debug('endReadable', state.endEmitted); - if (!state.endEmitted) { - state.ended = true; - process.nextTick(endReadableNT, state, stream); - } -} -function endReadableNT(state, stream) { - debug('endReadableNT', state.endEmitted, state.length); - - // Check that we didn't get one last unshift. - if (!state.endEmitted && state.length === 0) { - state.endEmitted = true; - stream.readable = false; - stream.emit('end'); - if (state.autoDestroy) { - // In case of duplex streams we need a way to detect - // if the writable side is ready for autoDestroy as well - var wState = stream._writableState; - if (!wState || wState.autoDestroy && wState.finished) { - stream.destroy(); - } - } - } -} -if (typeof Symbol === 'function') { - Readable.from = function (iterable, opts) { - if (from === undefined) { - from = require('./internal/streams/from'); - } - return from(Readable, iterable, opts); - }; -} -function indexOf(xs, x) { - for (var i = 0, l = xs.length; i < l; i++) { - if (xs[i] === x) return i; - } - return -1; -} \ No newline at end of file diff --git a/node_modules/split2/node_modules/readable-stream/lib/_stream_transform.js b/node_modules/split2/node_modules/readable-stream/lib/_stream_transform.js deleted file mode 100644 index 1ccb715..0000000 --- a/node_modules/split2/node_modules/readable-stream/lib/_stream_transform.js +++ /dev/null @@ -1,190 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// a transform stream is a readable/writable stream where you do -// something with the data. Sometimes it's called a "filter", -// but that's not a great name for it, since that implies a thing where -// some bits pass through, and others are simply ignored. (That would -// be a valid example of a transform, of course.) -// -// While the output is causally related to the input, it's not a -// necessarily symmetric or synchronous transformation. For example, -// a zlib stream might take multiple plain-text writes(), and then -// emit a single compressed chunk some time in the future. -// -// Here's how this works: -// -// The Transform stream has all the aspects of the readable and writable -// stream classes. When you write(chunk), that calls _write(chunk,cb) -// internally, and returns false if there's a lot of pending writes -// buffered up. When you call read(), that calls _read(n) until -// there's enough pending readable data buffered up. -// -// In a transform stream, the written data is placed in a buffer. When -// _read(n) is called, it transforms the queued up data, calling the -// buffered _write cb's as it consumes chunks. If consuming a single -// written chunk would result in multiple output chunks, then the first -// outputted bit calls the readcb, and subsequent chunks just go into -// the read buffer, and will cause it to emit 'readable' if necessary. -// -// This way, back-pressure is actually determined by the reading side, -// since _read has to be called to start processing a new chunk. However, -// a pathological inflate type of transform can cause excessive buffering -// here. For example, imagine a stream where every byte of input is -// interpreted as an integer from 0-255, and then results in that many -// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in -// 1kb of data being output. In this case, you could write a very small -// amount of input, and end up with a very large amount of output. In -// such a pathological inflating mechanism, there'd be no way to tell -// the system to stop doing the transform. A single 4MB write could -// cause the system to run out of memory. -// -// However, even in such a pathological case, only a single written chunk -// would be consumed, and then the rest would wait (un-transformed) until -// the results of the previous transformed chunk were consumed. - -'use strict'; - -module.exports = Transform; -var _require$codes = require('../errors').codes, - ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, - ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, - ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING, - ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0; -var Duplex = require('./_stream_duplex'); -require('inherits')(Transform, Duplex); -function afterTransform(er, data) { - var ts = this._transformState; - ts.transforming = false; - var cb = ts.writecb; - if (cb === null) { - return this.emit('error', new ERR_MULTIPLE_CALLBACK()); - } - ts.writechunk = null; - ts.writecb = null; - if (data != null) - // single equals check for both `null` and `undefined` - this.push(data); - cb(er); - var rs = this._readableState; - rs.reading = false; - if (rs.needReadable || rs.length < rs.highWaterMark) { - this._read(rs.highWaterMark); - } -} -function Transform(options) { - if (!(this instanceof Transform)) return new Transform(options); - Duplex.call(this, options); - this._transformState = { - afterTransform: afterTransform.bind(this), - needTransform: false, - transforming: false, - writecb: null, - writechunk: null, - writeencoding: null - }; - - // start out asking for a readable event once data is transformed. - this._readableState.needReadable = true; - - // we have implemented the _read method, and done the other things - // that Readable wants before the first _read call, so unset the - // sync guard flag. - this._readableState.sync = false; - if (options) { - if (typeof options.transform === 'function') this._transform = options.transform; - if (typeof options.flush === 'function') this._flush = options.flush; - } - - // When the writable side finishes, then flush out anything remaining. - this.on('prefinish', prefinish); -} -function prefinish() { - var _this = this; - if (typeof this._flush === 'function' && !this._readableState.destroyed) { - this._flush(function (er, data) { - done(_this, er, data); - }); - } else { - done(this, null, null); - } -} -Transform.prototype.push = function (chunk, encoding) { - this._transformState.needTransform = false; - return Duplex.prototype.push.call(this, chunk, encoding); -}; - -// This is the part where you do stuff! -// override this function in implementation classes. -// 'chunk' is an input chunk. -// -// Call `push(newChunk)` to pass along transformed output -// to the readable side. You may call 'push' zero or more times. -// -// Call `cb(err)` when you are done with this chunk. If you pass -// an error, then that'll put the hurt on the whole operation. If you -// never call cb(), then you'll never get another chunk. -Transform.prototype._transform = function (chunk, encoding, cb) { - cb(new ERR_METHOD_NOT_IMPLEMENTED('_transform()')); -}; -Transform.prototype._write = function (chunk, encoding, cb) { - var ts = this._transformState; - ts.writecb = cb; - ts.writechunk = chunk; - ts.writeencoding = encoding; - if (!ts.transforming) { - var rs = this._readableState; - if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); - } -}; - -// Doesn't matter what the args are here. -// _transform does all the work. -// That we got here means that the readable side wants more data. -Transform.prototype._read = function (n) { - var ts = this._transformState; - if (ts.writechunk !== null && !ts.transforming) { - ts.transforming = true; - this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); - } else { - // mark that we need a transform, so that any data that comes in - // will get processed, now that we've asked for it. - ts.needTransform = true; - } -}; -Transform.prototype._destroy = function (err, cb) { - Duplex.prototype._destroy.call(this, err, function (err2) { - cb(err2); - }); -}; -function done(stream, er, data) { - if (er) return stream.emit('error', er); - if (data != null) - // single equals check for both `null` and `undefined` - stream.push(data); - - // TODO(BridgeAR): Write a test for these two error cases - // if there's nothing in the write buffer, then that means - // that nothing more will ever be provided - if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0(); - if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING(); - return stream.push(null); -} \ No newline at end of file diff --git a/node_modules/split2/node_modules/readable-stream/lib/_stream_writable.js b/node_modules/split2/node_modules/readable-stream/lib/_stream_writable.js deleted file mode 100644 index 292415e..0000000 --- a/node_modules/split2/node_modules/readable-stream/lib/_stream_writable.js +++ /dev/null @@ -1,641 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// A bit simpler than readable streams. -// Implement an async ._write(chunk, encoding, cb), and it'll handle all -// the drain event emission and buffering. - -'use strict'; - -module.exports = Writable; - -/* */ -function WriteReq(chunk, encoding, cb) { - this.chunk = chunk; - this.encoding = encoding; - this.callback = cb; - this.next = null; -} - -// It seems a linked list but it is not -// there will be only 2 of these for each stream -function CorkedRequest(state) { - var _this = this; - this.next = null; - this.entry = null; - this.finish = function () { - onCorkedFinish(_this, state); - }; -} -/* */ - -/**/ -var Duplex; -/**/ - -Writable.WritableState = WritableState; - -/**/ -var internalUtil = { - deprecate: require('util-deprecate') -}; -/**/ - -/**/ -var Stream = require('./internal/streams/stream'); -/**/ - -var Buffer = require('buffer').Buffer; -var OurUint8Array = (typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {}; -function _uint8ArrayToBuffer(chunk) { - return Buffer.from(chunk); -} -function _isUint8Array(obj) { - return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; -} -var destroyImpl = require('./internal/streams/destroy'); -var _require = require('./internal/streams/state'), - getHighWaterMark = _require.getHighWaterMark; -var _require$codes = require('../errors').codes, - ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, - ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, - ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, - ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE, - ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED, - ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES, - ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END, - ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING; -var errorOrDestroy = destroyImpl.errorOrDestroy; -require('inherits')(Writable, Stream); -function nop() {} -function WritableState(options, stream, isDuplex) { - Duplex = Duplex || require('./_stream_duplex'); - options = options || {}; - - // Duplex streams are both readable and writable, but share - // the same options object. - // However, some cases require setting options to different - // values for the readable and the writable sides of the duplex stream, - // e.g. options.readableObjectMode vs. options.writableObjectMode, etc. - if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; - - // object stream flag to indicate whether or not this stream - // contains buffers or objects. - this.objectMode = !!options.objectMode; - if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; - - // the point at which write() starts returning false - // Note: 0 is a valid value, means that we always return false if - // the entire buffer is not flushed immediately on write() - this.highWaterMark = getHighWaterMark(this, options, 'writableHighWaterMark', isDuplex); - - // if _final has been called - this.finalCalled = false; - - // drain event flag. - this.needDrain = false; - // at the start of calling end() - this.ending = false; - // when end() has been called, and returned - this.ended = false; - // when 'finish' is emitted - this.finished = false; - - // has it been destroyed - this.destroyed = false; - - // should we decode strings into buffers before passing to _write? - // this is here so that some node-core streams can optimize string - // handling at a lower level. - var noDecode = options.decodeStrings === false; - this.decodeStrings = !noDecode; - - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; - - // not an actual buffer we keep track of, but a measurement - // of how much we're waiting to get pushed to some underlying - // socket or file. - this.length = 0; - - // a flag to see when we're in the middle of a write. - this.writing = false; - - // when true all writes will be buffered until .uncork() call - this.corked = 0; - - // a flag to be able to tell if the onwrite cb is called immediately, - // or on a later tick. We set this to true at first, because any - // actions that shouldn't happen until "later" should generally also - // not happen before the first write call. - this.sync = true; - - // a flag to know if we're processing previously buffered items, which - // may call the _write() callback in the same tick, so that we don't - // end up in an overlapped onwrite situation. - this.bufferProcessing = false; - - // the callback that's passed to _write(chunk,cb) - this.onwrite = function (er) { - onwrite(stream, er); - }; - - // the callback that the user supplies to write(chunk,encoding,cb) - this.writecb = null; - - // the amount that is being written when _write is called. - this.writelen = 0; - this.bufferedRequest = null; - this.lastBufferedRequest = null; - - // number of pending user-supplied write callbacks - // this must be 0 before 'finish' can be emitted - this.pendingcb = 0; - - // emit prefinish if the only thing we're waiting for is _write cbs - // This is relevant for synchronous Transform streams - this.prefinished = false; - - // True if the error was already emitted and should not be thrown again - this.errorEmitted = false; - - // Should close be emitted on destroy. Defaults to true. - this.emitClose = options.emitClose !== false; - - // Should .destroy() be called after 'finish' (and potentially 'end') - this.autoDestroy = !!options.autoDestroy; - - // count buffered requests - this.bufferedRequestCount = 0; - - // allocate the first CorkedRequest, there is always - // one allocated and free to use, and we maintain at most two - this.corkedRequestsFree = new CorkedRequest(this); -} -WritableState.prototype.getBuffer = function getBuffer() { - var current = this.bufferedRequest; - var out = []; - while (current) { - out.push(current); - current = current.next; - } - return out; -}; -(function () { - try { - Object.defineProperty(WritableState.prototype, 'buffer', { - get: internalUtil.deprecate(function writableStateBufferGetter() { - return this.getBuffer(); - }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') - }); - } catch (_) {} -})(); - -// Test _writableState for inheritance to account for Duplex streams, -// whose prototype chain only points to Readable. -var realHasInstance; -if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { - realHasInstance = Function.prototype[Symbol.hasInstance]; - Object.defineProperty(Writable, Symbol.hasInstance, { - value: function value(object) { - if (realHasInstance.call(this, object)) return true; - if (this !== Writable) return false; - return object && object._writableState instanceof WritableState; - } - }); -} else { - realHasInstance = function realHasInstance(object) { - return object instanceof this; - }; -} -function Writable(options) { - Duplex = Duplex || require('./_stream_duplex'); - - // Writable ctor is applied to Duplexes, too. - // `realHasInstance` is necessary because using plain `instanceof` - // would return false, as no `_writableState` property is attached. - - // Trying to use the custom `instanceof` for Writable here will also break the - // Node.js LazyTransform implementation, which has a non-trivial getter for - // `_writableState` that would lead to infinite recursion. - - // Checking for a Stream.Duplex instance is faster here instead of inside - // the WritableState constructor, at least with V8 6.5 - var isDuplex = this instanceof Duplex; - if (!isDuplex && !realHasInstance.call(Writable, this)) return new Writable(options); - this._writableState = new WritableState(options, this, isDuplex); - - // legacy. - this.writable = true; - if (options) { - if (typeof options.write === 'function') this._write = options.write; - if (typeof options.writev === 'function') this._writev = options.writev; - if (typeof options.destroy === 'function') this._destroy = options.destroy; - if (typeof options.final === 'function') this._final = options.final; - } - Stream.call(this); -} - -// Otherwise people can pipe Writable streams, which is just wrong. -Writable.prototype.pipe = function () { - errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE()); -}; -function writeAfterEnd(stream, cb) { - var er = new ERR_STREAM_WRITE_AFTER_END(); - // TODO: defer error events consistently everywhere, not just the cb - errorOrDestroy(stream, er); - process.nextTick(cb, er); -} - -// Checks that a user-supplied chunk is valid, especially for the particular -// mode the stream is in. Currently this means that `null` is never accepted -// and undefined/non-string values are only allowed in object mode. -function validChunk(stream, state, chunk, cb) { - var er; - if (chunk === null) { - er = new ERR_STREAM_NULL_VALUES(); - } else if (typeof chunk !== 'string' && !state.objectMode) { - er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer'], chunk); - } - if (er) { - errorOrDestroy(stream, er); - process.nextTick(cb, er); - return false; - } - return true; -} -Writable.prototype.write = function (chunk, encoding, cb) { - var state = this._writableState; - var ret = false; - var isBuf = !state.objectMode && _isUint8Array(chunk); - if (isBuf && !Buffer.isBuffer(chunk)) { - chunk = _uint8ArrayToBuffer(chunk); - } - if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; - if (typeof cb !== 'function') cb = nop; - if (state.ending) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { - state.pendingcb++; - ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); - } - return ret; -}; -Writable.prototype.cork = function () { - this._writableState.corked++; -}; -Writable.prototype.uncork = function () { - var state = this._writableState; - if (state.corked) { - state.corked--; - if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); - } -}; -Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { - // node::ParseEncoding() requires lower case. - if (typeof encoding === 'string') encoding = encoding.toLowerCase(); - if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new ERR_UNKNOWN_ENCODING(encoding); - this._writableState.defaultEncoding = encoding; - return this; -}; -Object.defineProperty(Writable.prototype, 'writableBuffer', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState && this._writableState.getBuffer(); - } -}); -function decodeChunk(state, chunk, encoding) { - if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { - chunk = Buffer.from(chunk, encoding); - } - return chunk; -} -Object.defineProperty(Writable.prototype, 'writableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState.highWaterMark; - } -}); - -// if we're already writing something, then just put this -// in the queue, and wait our turn. Otherwise, call _write -// If we return false, then we need a drain event, so set that flag. -function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { - if (!isBuf) { - var newChunk = decodeChunk(state, chunk, encoding); - if (chunk !== newChunk) { - isBuf = true; - encoding = 'buffer'; - chunk = newChunk; - } - } - var len = state.objectMode ? 1 : chunk.length; - state.length += len; - var ret = state.length < state.highWaterMark; - // we must ensure that previous needDrain will not be reset to false. - if (!ret) state.needDrain = true; - if (state.writing || state.corked) { - var last = state.lastBufferedRequest; - state.lastBufferedRequest = { - chunk: chunk, - encoding: encoding, - isBuf: isBuf, - callback: cb, - next: null - }; - if (last) { - last.next = state.lastBufferedRequest; - } else { - state.bufferedRequest = state.lastBufferedRequest; - } - state.bufferedRequestCount += 1; - } else { - doWrite(stream, state, false, len, chunk, encoding, cb); - } - return ret; -} -function doWrite(stream, state, writev, len, chunk, encoding, cb) { - state.writelen = len; - state.writecb = cb; - state.writing = true; - state.sync = true; - if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED('write'));else if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); - state.sync = false; -} -function onwriteError(stream, state, sync, er, cb) { - --state.pendingcb; - if (sync) { - // defer the callback if we are being called synchronously - // to avoid piling up things on the stack - process.nextTick(cb, er); - // this can emit finish, and it will always happen - // after error - process.nextTick(finishMaybe, stream, state); - stream._writableState.errorEmitted = true; - errorOrDestroy(stream, er); - } else { - // the caller expect this to happen before if - // it is async - cb(er); - stream._writableState.errorEmitted = true; - errorOrDestroy(stream, er); - // this can emit finish, but finish must - // always follow error - finishMaybe(stream, state); - } -} -function onwriteStateUpdate(state) { - state.writing = false; - state.writecb = null; - state.length -= state.writelen; - state.writelen = 0; -} -function onwrite(stream, er) { - var state = stream._writableState; - var sync = state.sync; - var cb = state.writecb; - if (typeof cb !== 'function') throw new ERR_MULTIPLE_CALLBACK(); - onwriteStateUpdate(state); - if (er) onwriteError(stream, state, sync, er, cb);else { - // Check if we're actually ready to finish, but don't emit yet - var finished = needFinish(state) || stream.destroyed; - if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { - clearBuffer(stream, state); - } - if (sync) { - process.nextTick(afterWrite, stream, state, finished, cb); - } else { - afterWrite(stream, state, finished, cb); - } - } -} -function afterWrite(stream, state, finished, cb) { - if (!finished) onwriteDrain(stream, state); - state.pendingcb--; - cb(); - finishMaybe(stream, state); -} - -// Must force callback to be called on nextTick, so that we don't -// emit 'drain' before the write() consumer gets the 'false' return -// value, and has a chance to attach a 'drain' listener. -function onwriteDrain(stream, state) { - if (state.length === 0 && state.needDrain) { - state.needDrain = false; - stream.emit('drain'); - } -} - -// if there's something in the buffer waiting, then process it -function clearBuffer(stream, state) { - state.bufferProcessing = true; - var entry = state.bufferedRequest; - if (stream._writev && entry && entry.next) { - // Fast case, write everything using _writev() - var l = state.bufferedRequestCount; - var buffer = new Array(l); - var holder = state.corkedRequestsFree; - holder.entry = entry; - var count = 0; - var allBuffers = true; - while (entry) { - buffer[count] = entry; - if (!entry.isBuf) allBuffers = false; - entry = entry.next; - count += 1; - } - buffer.allBuffers = allBuffers; - doWrite(stream, state, true, state.length, buffer, '', holder.finish); - - // doWrite is almost always async, defer these to save a bit of time - // as the hot path ends with doWrite - state.pendingcb++; - state.lastBufferedRequest = null; - if (holder.next) { - state.corkedRequestsFree = holder.next; - holder.next = null; - } else { - state.corkedRequestsFree = new CorkedRequest(state); - } - state.bufferedRequestCount = 0; - } else { - // Slow case, write chunks one-by-one - while (entry) { - var chunk = entry.chunk; - var encoding = entry.encoding; - var cb = entry.callback; - var len = state.objectMode ? 1 : chunk.length; - doWrite(stream, state, false, len, chunk, encoding, cb); - entry = entry.next; - state.bufferedRequestCount--; - // if we didn't call the onwrite immediately, then - // it means that we need to wait until it does. - // also, that means that the chunk and cb are currently - // being processed, so move the buffer counter past them. - if (state.writing) { - break; - } - } - if (entry === null) state.lastBufferedRequest = null; - } - state.bufferedRequest = entry; - state.bufferProcessing = false; -} -Writable.prototype._write = function (chunk, encoding, cb) { - cb(new ERR_METHOD_NOT_IMPLEMENTED('_write()')); -}; -Writable.prototype._writev = null; -Writable.prototype.end = function (chunk, encoding, cb) { - var state = this._writableState; - if (typeof chunk === 'function') { - cb = chunk; - chunk = null; - encoding = null; - } else if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); - - // .end() fully uncorks - if (state.corked) { - state.corked = 1; - this.uncork(); - } - - // ignore unnecessary end() calls. - if (!state.ending) endWritable(this, state, cb); - return this; -}; -Object.defineProperty(Writable.prototype, 'writableLength', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState.length; - } -}); -function needFinish(state) { - return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; -} -function callFinal(stream, state) { - stream._final(function (err) { - state.pendingcb--; - if (err) { - errorOrDestroy(stream, err); - } - state.prefinished = true; - stream.emit('prefinish'); - finishMaybe(stream, state); - }); -} -function prefinish(stream, state) { - if (!state.prefinished && !state.finalCalled) { - if (typeof stream._final === 'function' && !state.destroyed) { - state.pendingcb++; - state.finalCalled = true; - process.nextTick(callFinal, stream, state); - } else { - state.prefinished = true; - stream.emit('prefinish'); - } - } -} -function finishMaybe(stream, state) { - var need = needFinish(state); - if (need) { - prefinish(stream, state); - if (state.pendingcb === 0) { - state.finished = true; - stream.emit('finish'); - if (state.autoDestroy) { - // In case of duplex streams we need a way to detect - // if the readable side is ready for autoDestroy as well - var rState = stream._readableState; - if (!rState || rState.autoDestroy && rState.endEmitted) { - stream.destroy(); - } - } - } - } - return need; -} -function endWritable(stream, state, cb) { - state.ending = true; - finishMaybe(stream, state); - if (cb) { - if (state.finished) process.nextTick(cb);else stream.once('finish', cb); - } - state.ended = true; - stream.writable = false; -} -function onCorkedFinish(corkReq, state, err) { - var entry = corkReq.entry; - corkReq.entry = null; - while (entry) { - var cb = entry.callback; - state.pendingcb--; - cb(err); - entry = entry.next; - } - - // reuse the free corkReq. - state.corkedRequestsFree.next = corkReq; -} -Object.defineProperty(Writable.prototype, 'destroyed', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - if (this._writableState === undefined) { - return false; - } - return this._writableState.destroyed; - }, - set: function set(value) { - // we ignore the value if the stream - // has not been initialized yet - if (!this._writableState) { - return; - } - - // backward compatibility, the user is explicitly - // managing destroyed - this._writableState.destroyed = value; - } -}); -Writable.prototype.destroy = destroyImpl.destroy; -Writable.prototype._undestroy = destroyImpl.undestroy; -Writable.prototype._destroy = function (err, cb) { - cb(err); -}; \ No newline at end of file diff --git a/node_modules/split2/node_modules/readable-stream/lib/internal/streams/async_iterator.js b/node_modules/split2/node_modules/readable-stream/lib/internal/streams/async_iterator.js deleted file mode 100644 index 742c5a4..0000000 --- a/node_modules/split2/node_modules/readable-stream/lib/internal/streams/async_iterator.js +++ /dev/null @@ -1,180 +0,0 @@ -'use strict'; - -var _Object$setPrototypeO; -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } -var finished = require('./end-of-stream'); -var kLastResolve = Symbol('lastResolve'); -var kLastReject = Symbol('lastReject'); -var kError = Symbol('error'); -var kEnded = Symbol('ended'); -var kLastPromise = Symbol('lastPromise'); -var kHandlePromise = Symbol('handlePromise'); -var kStream = Symbol('stream'); -function createIterResult(value, done) { - return { - value: value, - done: done - }; -} -function readAndResolve(iter) { - var resolve = iter[kLastResolve]; - if (resolve !== null) { - var data = iter[kStream].read(); - // we defer if data is null - // we can be expecting either 'end' or - // 'error' - if (data !== null) { - iter[kLastPromise] = null; - iter[kLastResolve] = null; - iter[kLastReject] = null; - resolve(createIterResult(data, false)); - } - } -} -function onReadable(iter) { - // we wait for the next tick, because it might - // emit an error with process.nextTick - process.nextTick(readAndResolve, iter); -} -function wrapForNext(lastPromise, iter) { - return function (resolve, reject) { - lastPromise.then(function () { - if (iter[kEnded]) { - resolve(createIterResult(undefined, true)); - return; - } - iter[kHandlePromise](resolve, reject); - }, reject); - }; -} -var AsyncIteratorPrototype = Object.getPrototypeOf(function () {}); -var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = { - get stream() { - return this[kStream]; - }, - next: function next() { - var _this = this; - // if we have detected an error in the meanwhile - // reject straight away - var error = this[kError]; - if (error !== null) { - return Promise.reject(error); - } - if (this[kEnded]) { - return Promise.resolve(createIterResult(undefined, true)); - } - if (this[kStream].destroyed) { - // We need to defer via nextTick because if .destroy(err) is - // called, the error will be emitted via nextTick, and - // we cannot guarantee that there is no error lingering around - // waiting to be emitted. - return new Promise(function (resolve, reject) { - process.nextTick(function () { - if (_this[kError]) { - reject(_this[kError]); - } else { - resolve(createIterResult(undefined, true)); - } - }); - }); - } - - // if we have multiple next() calls - // we will wait for the previous Promise to finish - // this logic is optimized to support for await loops, - // where next() is only called once at a time - var lastPromise = this[kLastPromise]; - var promise; - if (lastPromise) { - promise = new Promise(wrapForNext(lastPromise, this)); - } else { - // fast path needed to support multiple this.push() - // without triggering the next() queue - var data = this[kStream].read(); - if (data !== null) { - return Promise.resolve(createIterResult(data, false)); - } - promise = new Promise(this[kHandlePromise]); - } - this[kLastPromise] = promise; - return promise; - } -}, _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, function () { - return this; -}), _defineProperty(_Object$setPrototypeO, "return", function _return() { - var _this2 = this; - // destroy(err, cb) is a private API - // we can guarantee we have that here, because we control the - // Readable class this is attached to - return new Promise(function (resolve, reject) { - _this2[kStream].destroy(null, function (err) { - if (err) { - reject(err); - return; - } - resolve(createIterResult(undefined, true)); - }); - }); -}), _Object$setPrototypeO), AsyncIteratorPrototype); -var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator(stream) { - var _Object$create; - var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, { - value: stream, - writable: true - }), _defineProperty(_Object$create, kLastResolve, { - value: null, - writable: true - }), _defineProperty(_Object$create, kLastReject, { - value: null, - writable: true - }), _defineProperty(_Object$create, kError, { - value: null, - writable: true - }), _defineProperty(_Object$create, kEnded, { - value: stream._readableState.endEmitted, - writable: true - }), _defineProperty(_Object$create, kHandlePromise, { - value: function value(resolve, reject) { - var data = iterator[kStream].read(); - if (data) { - iterator[kLastPromise] = null; - iterator[kLastResolve] = null; - iterator[kLastReject] = null; - resolve(createIterResult(data, false)); - } else { - iterator[kLastResolve] = resolve; - iterator[kLastReject] = reject; - } - }, - writable: true - }), _Object$create)); - iterator[kLastPromise] = null; - finished(stream, function (err) { - if (err && err.code !== 'ERR_STREAM_PREMATURE_CLOSE') { - var reject = iterator[kLastReject]; - // reject if we are waiting for data in the Promise - // returned by next() and store the error - if (reject !== null) { - iterator[kLastPromise] = null; - iterator[kLastResolve] = null; - iterator[kLastReject] = null; - reject(err); - } - iterator[kError] = err; - return; - } - var resolve = iterator[kLastResolve]; - if (resolve !== null) { - iterator[kLastPromise] = null; - iterator[kLastResolve] = null; - iterator[kLastReject] = null; - resolve(createIterResult(undefined, true)); - } - iterator[kEnded] = true; - }); - stream.on('readable', onReadable.bind(null, iterator)); - return iterator; -}; -module.exports = createReadableStreamAsyncIterator; \ No newline at end of file diff --git a/node_modules/split2/node_modules/readable-stream/lib/internal/streams/buffer_list.js b/node_modules/split2/node_modules/readable-stream/lib/internal/streams/buffer_list.js deleted file mode 100644 index 69bda49..0000000 --- a/node_modules/split2/node_modules/readable-stream/lib/internal/streams/buffer_list.js +++ /dev/null @@ -1,183 +0,0 @@ -'use strict'; - -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } -var _require = require('buffer'), - Buffer = _require.Buffer; -var _require2 = require('util'), - inspect = _require2.inspect; -var custom = inspect && inspect.custom || 'inspect'; -function copyBuffer(src, target, offset) { - Buffer.prototype.copy.call(src, target, offset); -} -module.exports = /*#__PURE__*/function () { - function BufferList() { - _classCallCheck(this, BufferList); - this.head = null; - this.tail = null; - this.length = 0; - } - _createClass(BufferList, [{ - key: "push", - value: function push(v) { - var entry = { - data: v, - next: null - }; - if (this.length > 0) this.tail.next = entry;else this.head = entry; - this.tail = entry; - ++this.length; - } - }, { - key: "unshift", - value: function unshift(v) { - var entry = { - data: v, - next: this.head - }; - if (this.length === 0) this.tail = entry; - this.head = entry; - ++this.length; - } - }, { - key: "shift", - value: function shift() { - if (this.length === 0) return; - var ret = this.head.data; - if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; - --this.length; - return ret; - } - }, { - key: "clear", - value: function clear() { - this.head = this.tail = null; - this.length = 0; - } - }, { - key: "join", - value: function join(s) { - if (this.length === 0) return ''; - var p = this.head; - var ret = '' + p.data; - while (p = p.next) ret += s + p.data; - return ret; - } - }, { - key: "concat", - value: function concat(n) { - if (this.length === 0) return Buffer.alloc(0); - var ret = Buffer.allocUnsafe(n >>> 0); - var p = this.head; - var i = 0; - while (p) { - copyBuffer(p.data, ret, i); - i += p.data.length; - p = p.next; - } - return ret; - } - - // Consumes a specified amount of bytes or characters from the buffered data. - }, { - key: "consume", - value: function consume(n, hasStrings) { - var ret; - if (n < this.head.data.length) { - // `slice` is the same for buffers and strings. - ret = this.head.data.slice(0, n); - this.head.data = this.head.data.slice(n); - } else if (n === this.head.data.length) { - // First chunk is a perfect match. - ret = this.shift(); - } else { - // Result spans more than one buffer. - ret = hasStrings ? this._getString(n) : this._getBuffer(n); - } - return ret; - } - }, { - key: "first", - value: function first() { - return this.head.data; - } - - // Consumes a specified amount of characters from the buffered data. - }, { - key: "_getString", - value: function _getString(n) { - var p = this.head; - var c = 1; - var ret = p.data; - n -= ret.length; - while (p = p.next) { - var str = p.data; - var nb = n > str.length ? str.length : n; - if (nb === str.length) ret += str;else ret += str.slice(0, n); - n -= nb; - if (n === 0) { - if (nb === str.length) { - ++c; - if (p.next) this.head = p.next;else this.head = this.tail = null; - } else { - this.head = p; - p.data = str.slice(nb); - } - break; - } - ++c; - } - this.length -= c; - return ret; - } - - // Consumes a specified amount of bytes from the buffered data. - }, { - key: "_getBuffer", - value: function _getBuffer(n) { - var ret = Buffer.allocUnsafe(n); - var p = this.head; - var c = 1; - p.data.copy(ret); - n -= p.data.length; - while (p = p.next) { - var buf = p.data; - var nb = n > buf.length ? buf.length : n; - buf.copy(ret, ret.length - n, 0, nb); - n -= nb; - if (n === 0) { - if (nb === buf.length) { - ++c; - if (p.next) this.head = p.next;else this.head = this.tail = null; - } else { - this.head = p; - p.data = buf.slice(nb); - } - break; - } - ++c; - } - this.length -= c; - return ret; - } - - // Make sure the linked list only shows the minimal necessary information. - }, { - key: custom, - value: function value(_, options) { - return inspect(this, _objectSpread(_objectSpread({}, options), {}, { - // Only inspect one level. - depth: 0, - // It should not recurse. - customInspect: false - })); - } - }]); - return BufferList; -}(); \ No newline at end of file diff --git a/node_modules/split2/node_modules/readable-stream/lib/internal/streams/destroy.js b/node_modules/split2/node_modules/readable-stream/lib/internal/streams/destroy.js deleted file mode 100644 index 31a17c4..0000000 --- a/node_modules/split2/node_modules/readable-stream/lib/internal/streams/destroy.js +++ /dev/null @@ -1,96 +0,0 @@ -'use strict'; - -// undocumented cb() API, needed for core, not for public API -function destroy(err, cb) { - var _this = this; - var readableDestroyed = this._readableState && this._readableState.destroyed; - var writableDestroyed = this._writableState && this._writableState.destroyed; - if (readableDestroyed || writableDestroyed) { - if (cb) { - cb(err); - } else if (err) { - if (!this._writableState) { - process.nextTick(emitErrorNT, this, err); - } else if (!this._writableState.errorEmitted) { - this._writableState.errorEmitted = true; - process.nextTick(emitErrorNT, this, err); - } - } - return this; - } - - // we set destroyed to true before firing error callbacks in order - // to make it re-entrance safe in case destroy() is called within callbacks - - if (this._readableState) { - this._readableState.destroyed = true; - } - - // if this is a duplex stream mark the writable part as destroyed as well - if (this._writableState) { - this._writableState.destroyed = true; - } - this._destroy(err || null, function (err) { - if (!cb && err) { - if (!_this._writableState) { - process.nextTick(emitErrorAndCloseNT, _this, err); - } else if (!_this._writableState.errorEmitted) { - _this._writableState.errorEmitted = true; - process.nextTick(emitErrorAndCloseNT, _this, err); - } else { - process.nextTick(emitCloseNT, _this); - } - } else if (cb) { - process.nextTick(emitCloseNT, _this); - cb(err); - } else { - process.nextTick(emitCloseNT, _this); - } - }); - return this; -} -function emitErrorAndCloseNT(self, err) { - emitErrorNT(self, err); - emitCloseNT(self); -} -function emitCloseNT(self) { - if (self._writableState && !self._writableState.emitClose) return; - if (self._readableState && !self._readableState.emitClose) return; - self.emit('close'); -} -function undestroy() { - if (this._readableState) { - this._readableState.destroyed = false; - this._readableState.reading = false; - this._readableState.ended = false; - this._readableState.endEmitted = false; - } - if (this._writableState) { - this._writableState.destroyed = false; - this._writableState.ended = false; - this._writableState.ending = false; - this._writableState.finalCalled = false; - this._writableState.prefinished = false; - this._writableState.finished = false; - this._writableState.errorEmitted = false; - } -} -function emitErrorNT(self, err) { - self.emit('error', err); -} -function errorOrDestroy(stream, err) { - // We have tests that rely on errors being emitted - // in the same tick, so changing this is semver major. - // For now when you opt-in to autoDestroy we allow - // the error to be emitted nextTick. In a future - // semver major update we should change the default to this. - - var rState = stream._readableState; - var wState = stream._writableState; - if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream.destroy(err);else stream.emit('error', err); -} -module.exports = { - destroy: destroy, - undestroy: undestroy, - errorOrDestroy: errorOrDestroy -}; \ No newline at end of file diff --git a/node_modules/split2/node_modules/readable-stream/lib/internal/streams/end-of-stream.js b/node_modules/split2/node_modules/readable-stream/lib/internal/streams/end-of-stream.js deleted file mode 100644 index 59c671b..0000000 --- a/node_modules/split2/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +++ /dev/null @@ -1,86 +0,0 @@ -// Ported from https://github.com/mafintosh/end-of-stream with -// permission from the author, Mathias Buus (@mafintosh). - -'use strict'; - -var ERR_STREAM_PREMATURE_CLOSE = require('../../../errors').codes.ERR_STREAM_PREMATURE_CLOSE; -function once(callback) { - var called = false; - return function () { - if (called) return; - called = true; - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - callback.apply(this, args); - }; -} -function noop() {} -function isRequest(stream) { - return stream.setHeader && typeof stream.abort === 'function'; -} -function eos(stream, opts, callback) { - if (typeof opts === 'function') return eos(stream, null, opts); - if (!opts) opts = {}; - callback = once(callback || noop); - var readable = opts.readable || opts.readable !== false && stream.readable; - var writable = opts.writable || opts.writable !== false && stream.writable; - var onlegacyfinish = function onlegacyfinish() { - if (!stream.writable) onfinish(); - }; - var writableEnded = stream._writableState && stream._writableState.finished; - var onfinish = function onfinish() { - writable = false; - writableEnded = true; - if (!readable) callback.call(stream); - }; - var readableEnded = stream._readableState && stream._readableState.endEmitted; - var onend = function onend() { - readable = false; - readableEnded = true; - if (!writable) callback.call(stream); - }; - var onerror = function onerror(err) { - callback.call(stream, err); - }; - var onclose = function onclose() { - var err; - if (readable && !readableEnded) { - if (!stream._readableState || !stream._readableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); - return callback.call(stream, err); - } - if (writable && !writableEnded) { - if (!stream._writableState || !stream._writableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); - return callback.call(stream, err); - } - }; - var onrequest = function onrequest() { - stream.req.on('finish', onfinish); - }; - if (isRequest(stream)) { - stream.on('complete', onfinish); - stream.on('abort', onclose); - if (stream.req) onrequest();else stream.on('request', onrequest); - } else if (writable && !stream._writableState) { - // legacy streams - stream.on('end', onlegacyfinish); - stream.on('close', onlegacyfinish); - } - stream.on('end', onend); - stream.on('finish', onfinish); - if (opts.error !== false) stream.on('error', onerror); - stream.on('close', onclose); - return function () { - stream.removeListener('complete', onfinish); - stream.removeListener('abort', onclose); - stream.removeListener('request', onrequest); - if (stream.req) stream.req.removeListener('finish', onfinish); - stream.removeListener('end', onlegacyfinish); - stream.removeListener('close', onlegacyfinish); - stream.removeListener('finish', onfinish); - stream.removeListener('end', onend); - stream.removeListener('error', onerror); - stream.removeListener('close', onclose); - }; -} -module.exports = eos; \ No newline at end of file diff --git a/node_modules/split2/node_modules/readable-stream/lib/internal/streams/from-browser.js b/node_modules/split2/node_modules/readable-stream/lib/internal/streams/from-browser.js deleted file mode 100644 index a4ce56f..0000000 --- a/node_modules/split2/node_modules/readable-stream/lib/internal/streams/from-browser.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function () { - throw new Error('Readable.from is not available in the browser') -}; diff --git a/node_modules/split2/node_modules/readable-stream/lib/internal/streams/from.js b/node_modules/split2/node_modules/readable-stream/lib/internal/streams/from.js deleted file mode 100644 index 0a34ee9..0000000 --- a/node_modules/split2/node_modules/readable-stream/lib/internal/streams/from.js +++ /dev/null @@ -1,52 +0,0 @@ -'use strict'; - -function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } -function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } -var ERR_INVALID_ARG_TYPE = require('../../../errors').codes.ERR_INVALID_ARG_TYPE; -function from(Readable, iterable, opts) { - var iterator; - if (iterable && typeof iterable.next === 'function') { - iterator = iterable; - } else if (iterable && iterable[Symbol.asyncIterator]) iterator = iterable[Symbol.asyncIterator]();else if (iterable && iterable[Symbol.iterator]) iterator = iterable[Symbol.iterator]();else throw new ERR_INVALID_ARG_TYPE('iterable', ['Iterable'], iterable); - var readable = new Readable(_objectSpread({ - objectMode: true - }, opts)); - // Reading boolean to protect against _read - // being called before last iteration completion. - var reading = false; - readable._read = function () { - if (!reading) { - reading = true; - next(); - } - }; - function next() { - return _next2.apply(this, arguments); - } - function _next2() { - _next2 = _asyncToGenerator(function* () { - try { - var _yield$iterator$next = yield iterator.next(), - value = _yield$iterator$next.value, - done = _yield$iterator$next.done; - if (done) { - readable.push(null); - } else if (readable.push(yield value)) { - next(); - } else { - reading = false; - } - } catch (err) { - readable.destroy(err); - } - }); - return _next2.apply(this, arguments); - } - return readable; -} -module.exports = from; diff --git a/node_modules/split2/node_modules/readable-stream/lib/internal/streams/pipeline.js b/node_modules/split2/node_modules/readable-stream/lib/internal/streams/pipeline.js deleted file mode 100644 index e6f3924..0000000 --- a/node_modules/split2/node_modules/readable-stream/lib/internal/streams/pipeline.js +++ /dev/null @@ -1,86 +0,0 @@ -// Ported from https://github.com/mafintosh/pump with -// permission from the author, Mathias Buus (@mafintosh). - -'use strict'; - -var eos; -function once(callback) { - var called = false; - return function () { - if (called) return; - called = true; - callback.apply(void 0, arguments); - }; -} -var _require$codes = require('../../../errors').codes, - ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS, - ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED; -function noop(err) { - // Rethrow the error if it exists to avoid swallowing it - if (err) throw err; -} -function isRequest(stream) { - return stream.setHeader && typeof stream.abort === 'function'; -} -function destroyer(stream, reading, writing, callback) { - callback = once(callback); - var closed = false; - stream.on('close', function () { - closed = true; - }); - if (eos === undefined) eos = require('./end-of-stream'); - eos(stream, { - readable: reading, - writable: writing - }, function (err) { - if (err) return callback(err); - closed = true; - callback(); - }); - var destroyed = false; - return function (err) { - if (closed) return; - if (destroyed) return; - destroyed = true; - - // request.destroy just do .end - .abort is what we want - if (isRequest(stream)) return stream.abort(); - if (typeof stream.destroy === 'function') return stream.destroy(); - callback(err || new ERR_STREAM_DESTROYED('pipe')); - }; -} -function call(fn) { - fn(); -} -function pipe(from, to) { - return from.pipe(to); -} -function popCallback(streams) { - if (!streams.length) return noop; - if (typeof streams[streams.length - 1] !== 'function') return noop; - return streams.pop(); -} -function pipeline() { - for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) { - streams[_key] = arguments[_key]; - } - var callback = popCallback(streams); - if (Array.isArray(streams[0])) streams = streams[0]; - if (streams.length < 2) { - throw new ERR_MISSING_ARGS('streams'); - } - var error; - var destroys = streams.map(function (stream, i) { - var reading = i < streams.length - 1; - var writing = i > 0; - return destroyer(stream, reading, writing, function (err) { - if (!error) error = err; - if (err) destroys.forEach(call); - if (reading) return; - destroys.forEach(call); - callback(error); - }); - }); - return streams.reduce(pipe); -} -module.exports = pipeline; \ No newline at end of file diff --git a/node_modules/split2/node_modules/readable-stream/lib/internal/streams/state.js b/node_modules/split2/node_modules/readable-stream/lib/internal/streams/state.js deleted file mode 100644 index 3fbf892..0000000 --- a/node_modules/split2/node_modules/readable-stream/lib/internal/streams/state.js +++ /dev/null @@ -1,22 +0,0 @@ -'use strict'; - -var ERR_INVALID_OPT_VALUE = require('../../../errors').codes.ERR_INVALID_OPT_VALUE; -function highWaterMarkFrom(options, isDuplex, duplexKey) { - return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null; -} -function getHighWaterMark(state, options, duplexKey, isDuplex) { - var hwm = highWaterMarkFrom(options, isDuplex, duplexKey); - if (hwm != null) { - if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) { - var name = isDuplex ? duplexKey : 'highWaterMark'; - throw new ERR_INVALID_OPT_VALUE(name, hwm); - } - return Math.floor(hwm); - } - - // Default value - return state.objectMode ? 16 : 16 * 1024; -} -module.exports = { - getHighWaterMark: getHighWaterMark -}; \ No newline at end of file diff --git a/node_modules/split2/node_modules/readable-stream/lib/internal/streams/stream-browser.js b/node_modules/split2/node_modules/readable-stream/lib/internal/streams/stream-browser.js deleted file mode 100644 index 9332a3f..0000000 --- a/node_modules/split2/node_modules/readable-stream/lib/internal/streams/stream-browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('events').EventEmitter; diff --git a/node_modules/split2/node_modules/readable-stream/lib/internal/streams/stream.js b/node_modules/split2/node_modules/readable-stream/lib/internal/streams/stream.js deleted file mode 100644 index ce2ad5b..0000000 --- a/node_modules/split2/node_modules/readable-stream/lib/internal/streams/stream.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('stream'); diff --git a/node_modules/split2/node_modules/readable-stream/package.json b/node_modules/split2/node_modules/readable-stream/package.json deleted file mode 100644 index ade59e7..0000000 --- a/node_modules/split2/node_modules/readable-stream/package.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "name": "readable-stream", - "version": "3.6.2", - "description": "Streams3, a user-land copy of the stream library from Node.js", - "main": "readable.js", - "engines": { - "node": ">= 6" - }, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "devDependencies": { - "@babel/cli": "^7.2.0", - "@babel/core": "^7.2.0", - "@babel/polyfill": "^7.0.0", - "@babel/preset-env": "^7.2.0", - "airtap": "0.0.9", - "assert": "^1.4.0", - "bl": "^2.0.0", - "deep-strict-equal": "^0.2.0", - "events.once": "^2.0.2", - "glob": "^7.1.2", - "gunzip-maybe": "^1.4.1", - "hyperquest": "^2.1.3", - "lolex": "^2.6.0", - "nyc": "^11.0.0", - "pump": "^3.0.0", - "rimraf": "^2.6.2", - "tap": "^12.0.0", - "tape": "^4.9.0", - "tar-fs": "^1.16.2", - "util-promisify": "^2.1.0" - }, - "scripts": { - "test": "tap -J --no-esm test/parallel/*.js test/ours/*.js", - "ci": "TAP=1 tap --no-esm test/parallel/*.js test/ours/*.js | tee test.tap", - "test-browsers": "airtap --sauce-connect --loopback airtap.local -- test/browser.js", - "test-browser-local": "airtap --open --local -- test/browser.js", - "cover": "nyc npm test", - "report": "nyc report --reporter=lcov", - "update-browser-errors": "babel -o errors-browser.js errors.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/nodejs/readable-stream" - }, - "keywords": [ - "readable", - "stream", - "pipe" - ], - "browser": { - "util": false, - "worker_threads": false, - "./errors": "./errors-browser.js", - "./readable.js": "./readable-browser.js", - "./lib/internal/streams/from.js": "./lib/internal/streams/from-browser.js", - "./lib/internal/streams/stream.js": "./lib/internal/streams/stream-browser.js" - }, - "nyc": { - "include": [ - "lib/**.js" - ] - }, - "license": "MIT" -} diff --git a/node_modules/split2/node_modules/readable-stream/readable-browser.js b/node_modules/split2/node_modules/readable-stream/readable-browser.js deleted file mode 100644 index adbf60d..0000000 --- a/node_modules/split2/node_modules/readable-stream/readable-browser.js +++ /dev/null @@ -1,9 +0,0 @@ -exports = module.exports = require('./lib/_stream_readable.js'); -exports.Stream = exports; -exports.Readable = exports; -exports.Writable = require('./lib/_stream_writable.js'); -exports.Duplex = require('./lib/_stream_duplex.js'); -exports.Transform = require('./lib/_stream_transform.js'); -exports.PassThrough = require('./lib/_stream_passthrough.js'); -exports.finished = require('./lib/internal/streams/end-of-stream.js'); -exports.pipeline = require('./lib/internal/streams/pipeline.js'); diff --git a/node_modules/split2/node_modules/readable-stream/readable.js b/node_modules/split2/node_modules/readable-stream/readable.js deleted file mode 100644 index 9e0ca12..0000000 --- a/node_modules/split2/node_modules/readable-stream/readable.js +++ /dev/null @@ -1,16 +0,0 @@ -var Stream = require('stream'); -if (process.env.READABLE_STREAM === 'disable' && Stream) { - module.exports = Stream.Readable; - Object.assign(module.exports, Stream); - module.exports.Stream = Stream; -} else { - exports = module.exports = require('./lib/_stream_readable.js'); - exports.Stream = Stream || exports; - exports.Readable = exports; - exports.Writable = require('./lib/_stream_writable.js'); - exports.Duplex = require('./lib/_stream_duplex.js'); - exports.Transform = require('./lib/_stream_transform.js'); - exports.PassThrough = require('./lib/_stream_passthrough.js'); - exports.finished = require('./lib/internal/streams/end-of-stream.js'); - exports.pipeline = require('./lib/internal/streams/pipeline.js'); -} diff --git a/node_modules/split2/package.json b/node_modules/split2/package.json index 4a9fbd2..a9b6f6e 100644 --- a/node_modules/split2/package.json +++ b/node_modules/split2/package.json @@ -1,15 +1,10 @@ { "name": "split2", - "version": "3.2.2", + "version": "2.2.0", "description": "split a Text Stream into a Line Stream, using Stream 3", "main": "index.js", "scripts": { - "lint": "standard --verbose", - "unit": "nyc --lines 100 --branches 100 --functions 100 --check-coverage --reporter=text tape test.js", - "coverage": "nyc --reporter=html --reporter=cobertura --reporter=text tape test/test.js", - "test:report": "npm run lint && npm run unit:report", - "test": "npm run lint && npm run unit", - "legacy": "tape test.js" + "test": "standard && tap -b test.js" }, "pre-commit": [ "test" @@ -25,16 +20,14 @@ "author": "Matteo Collina ", "license": "ISC", "devDependencies": { - "binary-split": "^1.0.3", "callback-stream": "^1.1.0", "fastbench": "^1.0.0", - "nyc": "^15.0.1", "pre-commit": "^1.1.2", "safe-buffer": "^5.1.1", - "standard": "^14.0.0", - "tape": "^5.0.0" + "standard": "^10.0.0", + "tap": "^10.0.0" }, "dependencies": { - "readable-stream": "^3.0.0" + "through2": "^2.0.2" } } diff --git a/node_modules/split2/test.js b/node_modules/split2/test.js index e035787..9715dfd 100644 --- a/node_modules/split2/test.js +++ b/node_modules/split2/test.js @@ -1,6 +1,6 @@ 'use strict' -var test = require('tape') +var test = require('tap').test var split = require('./') var callback = require('callback-stream') var Buffer = require('safe-buffer').Buffer @@ -35,22 +35,6 @@ test('split two lines on two writes', function (t) { input.end() }) -test('split four lines on three writes', function (t) { - t.plan(2) - - var input = split() - - input.pipe(strcb(function (err, list) { - t.error(err) - t.deepEqual(list, ['hello', 'world', 'bye', 'world']) - })) - - input.write('hello\nwor') - input.write('ld\nbye\nwo') - input.write('rld') - input.end() -}) - test('accumulate multiple writes', function (t) { t.plan(2) @@ -152,7 +136,7 @@ test('splits a buffer', function (t) { test('do not end on undefined', function (t) { t.plan(2) - var input = split(function (line) { }) + var input = split(function (line) {}) input.pipe(strcb(function (err, list) { t.error(err) @@ -165,7 +149,7 @@ test('do not end on undefined', function (t) { test('has destroy method', function (t) { t.plan(1) - var input = split(function (line) { }) + var input = split(function (line) {}) input.on('close', function () { t.ok(true, 'close emitted') @@ -318,75 +302,3 @@ test('readable highWaterMark', function (t) { t.equal(input._readableState.highWaterMark, 16) t.end() }) - -test('maxLength < chunk size', function (t) { - t.plan(2) - - var input = split({ maxLength: 2 }) - - input.pipe(strcb(function (err, list) { - t.error(err) - t.deepEqual(list, ['a', 'b']) - })) - - input.end('a\nb') -}) - -test('maximum buffer limit w/skip', function (t) { - t.plan(2) - - var input = split({ maxLength: 2, skipOverflow: true }) - - input.pipe(strcb(function (err, list) { - t.error(err) - t.deepEqual(list, ['a', 'b', 'c']) - })) - - input.write('a\n123') - input.write('456') - input.write('789\nb\nc') - input.end() -}) - -test("don't modify the options object", function (t) { - t.plan(2) - - var options = {} - var input = split(options) - - input.pipe(strcb(function (err, list) { - t.error(err) - t.same(options, {}) - })) - - input.end() -}) - -test('mapper throws flush', function (t) { - t.plan(1) - var error = new Error() - var input = split(function () { - throw error - }) - - input.on('error', (err, list) => { - t.same(err, error) - }) - input.end('hello') -}) - -test('mapper throws on transform', function (t) { - t.plan(2) - - var error = new Error() - var input = split(function (l) { - throw error - }) - - input.on('error', (err) => { - t.same(err, error) - }) - input.write('a') - input.write('\n') - input.end('b') -}) diff --git a/node_modules/ultron/LICENSE b/node_modules/ultron/LICENSE deleted file mode 100644 index 6dc9316..0000000 --- a/node_modules/ultron/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Unshift.io, Arnout Kazemier, the Contributors. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/node_modules/ultron/README.md b/node_modules/ultron/README.md deleted file mode 100644 index c9d8b07..0000000 --- a/node_modules/ultron/README.md +++ /dev/null @@ -1,113 +0,0 @@ -# Ultron - -[![Made by unshift](https://img.shields.io/badge/made%20by-unshift-00ffcc.svg?style=flat-square)](http://unshift.io)[![Version npm](http://img.shields.io/npm/v/ultron.svg?style=flat-square)](http://browsenpm.org/package/ultron)[![Build Status](http://img.shields.io/travis/unshiftio/ultron/master.svg?style=flat-square)](https://travis-ci.org/unshiftio/ultron)[![Dependencies](https://img.shields.io/david/unshiftio/ultron.svg?style=flat-square)](https://david-dm.org/unshiftio/ultron)[![Coverage Status](http://img.shields.io/coveralls/unshiftio/ultron/master.svg?style=flat-square)](https://coveralls.io/r/unshiftio/ultron?branch=master)[![IRC channel](http://img.shields.io/badge/IRC-irc.freenode.net%23unshift-00a8ff.svg?style=flat-square)](http://webchat.freenode.net/?channels=unshift) - -Ultron is a high-intelligence robot. It gathers intelligence so it can start -improving upon his rudimentary design. It will learn your event emitting -patterns and find ways to exterminate them. Allowing you to remove only the -event emitters that **you** assigned and not the ones that your users or -developers assigned. This can prevent race conditions, memory leaks and even file -descriptor leaks from ever happening as you won't remove clean up processes. - -## Installation - -The module is designed to be used in browsers using browserify and in Node.js. -You can install the module through the public npm registry by running the -following command in CLI: - -``` -npm install --save ultron -``` - -## Usage - -In all examples we assume that you've required the library as following: - -```js -'use strict'; - -var Ultron = require('ultron'); -``` - -Now that we've required the library we can construct our first `Ultron` instance. -The constructor requires one argument which should be the `EventEmitter` -instance that we need to operate upon. This can be the `EventEmitter` module -that ships with Node.js or `EventEmitter3` or anything else as long as it -follow the same API and internal structure as these 2. So with that in mind we -can create the instance: - -```js -// -// For the sake of this example we're going to construct an empty EventEmitter -// -var EventEmitter = require('events').EventEmitter; // or require('eventmitter3'); -var events = new EventEmitter(); - -var ultron = new Ultron(events); -``` - -You can now use the following API's from the Ultron instance: - -### Ultron.on - -Register a new event listener for the given event. It follows the exact same API -as `EventEmitter.on` but it will return itself instead of returning the -EventEmitter instance. If you are using EventEmitter3 it also supports the -context param: - -```js -ultron.on('event-name', handler, { custom: 'function context' }); -``` - -Just like you would expect, it can also be chained together. - -```js -ultron -.on('event-name', handler) -.on('another event', handler); -``` - -### Ultron.once - -Exactly the same as the [Ultron.on](#ultronon) but it only allows the execution -once. - -Just like you would expect, it can also be chained together. - -```js -ultron -.once('event-name', handler, { custom: 'this value' }) -.once('another event', handler); -``` - -### Ultron.remove - -This is where all the magic happens and the safe removal starts. This function -accepts different argument styles: - -- No arguments, assume that all events need to be removed so it will work as - `removeAllListeners()` API. -- 1 argument, when it's a string it will be split on ` ` and `,` to create a - list of events that need to be cleared. -- Multiple arguments, we assume that they are all names of events that need to - be cleared. - -```js -ultron.remove('foo, bar baz'); // Removes foo, bar and baz. -ultron.remove('foo', 'bar', 'baz'); // Removes foo, bar and baz. -ultron.remove(); // Removes everything. -``` - -If you just want to remove a single event listener using a function reference -you can still use the EventEmitter's `removeListener(event, fn)` API: - -```js -function foo() {} - -ultron.on('foo', foo); -events.removeListener('foo', foo); -``` - -## License - -MIT diff --git a/node_modules/ultron/index.js b/node_modules/ultron/index.js deleted file mode 100644 index f78071e..0000000 --- a/node_modules/ultron/index.js +++ /dev/null @@ -1,136 +0,0 @@ -'use strict'; - -var has = Object.prototype.hasOwnProperty; - -/** - * An auto incrementing id which we can use to create "unique" Ultron instances - * so we can track the event emitters that are added through the Ultron - * interface. - * - * @type {Number} - * @private - */ -var id = 0; - -/** - * Ultron is high-intelligence robot. It gathers intelligence so it can start improving - * upon his rudimentary design. It will learn from your EventEmitting patterns - * and exterminate them. - * - * @constructor - * @param {EventEmitter} ee EventEmitter instance we need to wrap. - * @api public - */ -function Ultron(ee) { - if (!(this instanceof Ultron)) return new Ultron(ee); - - this.id = id++; - this.ee = ee; -} - -/** - * Register a new EventListener for the given event. - * - * @param {String} event Name of the event. - * @param {Functon} fn Callback function. - * @param {Mixed} context The context of the function. - * @returns {Ultron} - * @api public - */ -Ultron.prototype.on = function on(event, fn, context) { - fn.__ultron = this.id; - this.ee.on(event, fn, context); - - return this; -}; -/** - * Add an EventListener that's only called once. - * - * @param {String} event Name of the event. - * @param {Function} fn Callback function. - * @param {Mixed} context The context of the function. - * @returns {Ultron} - * @api public - */ -Ultron.prototype.once = function once(event, fn, context) { - fn.__ultron = this.id; - this.ee.once(event, fn, context); - - return this; -}; - -/** - * Remove the listeners we assigned for the given event. - * - * @returns {Ultron} - * @api public - */ -Ultron.prototype.remove = function remove() { - var args = arguments - , ee = this.ee - , event; - - // - // When no event names are provided we assume that we need to clear all the - // events that were assigned through us. - // - if (args.length === 1 && 'string' === typeof args[0]) { - args = args[0].split(/[, ]+/); - } else if (!args.length) { - if (ee.eventNames) { - args = ee.eventNames(); - } else if (ee._events) { - args = []; - - for (event in ee._events) { - if (has.call(ee._events, event)) args.push(event); - } - - if (Object.getOwnPropertySymbols) { - args = args.concat(Object.getOwnPropertySymbols(ee._events)); - } - } - } - - for (var i = 0; i < args.length; i++) { - var listeners = ee.listeners(args[i]); - - for (var j = 0; j < listeners.length; j++) { - event = listeners[j]; - - // - // Once listeners have a `listener` property that stores the real listener - // in the EventEmitter that ships with Node.js. - // - if (event.listener) { - if (event.listener.__ultron !== this.id) continue; - } else if (event.__ultron !== this.id) { - continue; - } - - ee.removeListener(args[i], event); - } - } - - return this; -}; - -/** - * Destroy the Ultron instance, remove all listeners and release all references. - * - * @returns {Boolean} - * @api public - */ -Ultron.prototype.destroy = function destroy() { - if (!this.ee) return false; - - this.remove(); - this.ee = null; - - return true; -}; - -// -// Expose the module. -// -module.exports = Ultron; diff --git a/node_modules/ultron/package.json b/node_modules/ultron/package.json deleted file mode 100644 index b3fd2f6..0000000 --- a/node_modules/ultron/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "ultron", - "version": "1.1.1", - "description": "Ultron is high-intelligence robot. It gathers intel so it can start improving upon his rudimentary design", - "main": "index.js", - "scripts": { - "100%": "istanbul check-coverage --statements 100 --functions 100 --lines 100 --branches 100", - "test": "mocha test.js", - "watch": "mocha --watch test.js", - "coverage": "istanbul cover _mocha -- test.js", - "test-travis": "istanbul cover _mocha --report lcovonly -- test.js" - }, - "repository": { - "type": "git", - "url": "https://github.com/unshiftio/ultron" - }, - "keywords": [ - "Ultron", - "robot", - "gather", - "intelligence", - "event", - "events", - "eventemitter", - "emitter", - "cleanup" - ], - "author": "Arnout Kazemier", - "license": "MIT", - "devDependencies": { - "assume": "~1.5.0", - "eventemitter3": "2.0.x", - "istanbul": "0.4.x", - "mocha": "~4.0.0", - "pre-commit": "~1.2.0" - }, - "bugs": { - "url": "https://github.com/unshiftio/ultron/issues" - }, - "homepage": "https://github.com/unshiftio/ultron" -} diff --git a/node_modules/vue/dist/vue.cjs.js b/node_modules/vue/dist/vue.cjs.js index ef543fa..ea4907c 100644 --- a/node_modules/vue/dist/vue.cjs.js +++ b/node_modules/vue/dist/vue.cjs.js @@ -1,5 +1,5 @@ /** -* vue v3.5.13 +* vue v3.5.17 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/ diff --git a/node_modules/vue/dist/vue.cjs.prod.js b/node_modules/vue/dist/vue.cjs.prod.js index 82c078c..18aac9b 100644 --- a/node_modules/vue/dist/vue.cjs.prod.js +++ b/node_modules/vue/dist/vue.cjs.prod.js @@ -1,5 +1,5 @@ /** -* vue v3.5.13 +* vue v3.5.17 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/ diff --git a/node_modules/vue/dist/vue.esm-browser.js b/node_modules/vue/dist/vue.esm-browser.js index f93761d..3a62026 100644 --- a/node_modules/vue/dist/vue.esm-browser.js +++ b/node_modules/vue/dist/vue.esm-browser.js @@ -1,5 +1,5 @@ /** -* vue v3.5.13 +* vue v3.5.17 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/ @@ -126,7 +126,7 @@ const PatchFlagNames = { [512]: `NEED_PATCH`, [1024]: `DYNAMIC_SLOTS`, [2048]: `DEV_ROOT_FRAGMENT`, - [-1]: `HOISTED`, + [-1]: `CACHED`, [-2]: `BAIL` }; @@ -396,6 +396,10 @@ class EffectScope { * @internal */ this._active = true; + /** + * @internal track `on` calls, allow `on` call multiple times + */ + this._on = 0; /** * @internal */ @@ -466,14 +470,20 @@ class EffectScope { * @internal */ on() { - activeEffectScope = this; + if (++this._on === 1) { + this.prevScope = activeEffectScope; + activeEffectScope = this; + } } /** * This should only be called on non-detached scopes * @internal */ off() { - activeEffectScope = this.parent; + if (this._on > 0 && --this._on === 0) { + activeEffectScope = this.prevScope; + this.prevScope = void 0; + } } stop(fromParent) { if (this._active) { @@ -555,7 +565,7 @@ class ReactiveEffect { } resume() { if (this.flags & 64) { - this.flags &= ~64; + this.flags &= -65; if (pausedQueueEffects.has(this)) { pausedQueueEffects.delete(this); this.trigger(); @@ -595,7 +605,7 @@ class ReactiveEffect { cleanupDeps(this); activeSub = prevEffect; shouldTrack = prevShouldTrack; - this.flags &= ~2; + this.flags &= -3; } } stop() { @@ -606,7 +616,7 @@ class ReactiveEffect { this.deps = this.depsTail = void 0; cleanupEffect(this); this.onStop && this.onStop(); - this.flags &= ~1; + this.flags &= -2; } } trigger() { @@ -656,7 +666,7 @@ function endBatch() { while (e) { const next = e.next; e.next = void 0; - e.flags &= ~8; + e.flags &= -9; e = next; } } @@ -667,7 +677,7 @@ function endBatch() { while (e) { const next = e.next; e.next = void 0; - e.flags &= ~8; + e.flags &= -9; if (e.flags & 1) { try { ; @@ -723,17 +733,16 @@ function refreshComputed(computed) { if (computed.flags & 4 && !(computed.flags & 16)) { return; } - computed.flags &= ~16; + computed.flags &= -17; if (computed.globalVersion === globalVersion) { return; } computed.globalVersion = globalVersion; - const dep = computed.dep; - computed.flags |= 2; - if (dep.version > 0 && !computed.isSSR && computed.deps && !isDirty(computed)) { - computed.flags &= ~2; + if (!computed.isSSR && computed.flags & 128 && (!computed.deps && !computed._dirty || !isDirty(computed))) { return; } + computed.flags |= 2; + const dep = computed.dep; const prevSub = activeSub; const prevShouldTrack = shouldTrack; activeSub = computed; @@ -742,6 +751,7 @@ function refreshComputed(computed) { prepareDeps(computed); const value = computed.fn(computed._value); if (dep.version === 0 || hasChanged(value, computed._value)) { + computed.flags |= 128; computed._value = value; dep.version++; } @@ -752,7 +762,7 @@ function refreshComputed(computed) { activeSub = prevSub; shouldTrack = prevShouldTrack; cleanupDeps(computed); - computed.flags &= ~2; + computed.flags &= -3; } } function removeSub(link, soft = false) { @@ -771,7 +781,7 @@ function removeSub(link, soft = false) { if (dep.subs === link) { dep.subs = prevSub; if (!prevSub && dep.computed) { - dep.computed.flags &= ~4; + dep.computed.flags &= -5; for (let l = dep.computed.deps; l; l = l.nextDep) { removeSub(l, true); } @@ -847,6 +857,7 @@ class Link { } } class Dep { + // TODO isolatedDeclarations "__v_skip" constructor(computed) { this.computed = computed; this.version = 0; @@ -867,6 +878,10 @@ class Dep { * Subscriber counter */ this.sc = 0; + /** + * @internal + */ + this.__v_skip = true; { this.subsHead = void 0; } @@ -1704,14 +1719,14 @@ function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandl if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) { return target; } - const existingProxy = proxyMap.get(target); - if (existingProxy) { - return existingProxy; - } const targetType = getTargetType(target); if (targetType === 0 /* INVALID */) { return target; } + const existingProxy = proxyMap.get(target); + if (existingProxy) { + return existingProxy; + } const proxy = new Proxy( target, targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers @@ -2134,11 +2149,11 @@ function watch$1(source, cb, options = EMPTY_OBJ) { oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue, boundCleanup ]; + oldValue = newValue; call ? call(cb, 3, args) : ( // @ts-expect-error cb(...args) ); - oldValue = newValue; } finally { activeWatcher = currentWatcher; } @@ -2555,11 +2570,11 @@ function flushPreFlushCbs(instance, seen, i = flushIndex + 1) { queue.splice(i, 1); i--; if (cb.flags & 4) { - cb.flags &= ~1; + cb.flags &= -2; } cb(); if (!(cb.flags & 4)) { - cb.flags &= ~1; + cb.flags &= -2; } } } @@ -2584,10 +2599,10 @@ function flushPostFlushCbs(seen) { continue; } if (cb.flags & 4) { - cb.flags &= ~1; + cb.flags &= -2; } if (!(cb.flags & 8)) cb(); - cb.flags &= ~1; + cb.flags &= -2; } activePostFlushCbs = null; postFlushIndex = 0; @@ -2623,7 +2638,7 @@ function flushJobs(seen) { for (; flushIndex < queue.length; flushIndex++) { const job = queue[flushIndex]; if (job) { - job.flags &= ~1; + job.flags &= -2; } } flushIndex = -1; @@ -3063,15 +3078,16 @@ const TeleportImpl = { updateCssVars(n2, true); } if (isTeleportDeferred(n2.props)) { + n2.el.__isMounted = false; queuePostRenderEffect(() => { mountToTarget(); - n2.el.__isMounted = true; + delete n2.el.__isMounted; }, parentSuspense); } else { mountToTarget(); } } else { - if (isTeleportDeferred(n2.props) && !n1.el.__isMounted) { + if (isTeleportDeferred(n2.props) && n1.el.__isMounted === false) { queuePostRenderEffect(() => { TeleportImpl.process( n1, @@ -3085,7 +3101,6 @@ const TeleportImpl = { optimized, internals ); - delete n1.el.__isMounted; }, parentSuspense); return; } @@ -3112,7 +3127,7 @@ const TeleportImpl = { namespace, slotScopeIds ); - traverseStaticChildren(n1, n2, true); + traverseStaticChildren(n1, n2, false); } else if (!optimized) { patchChildren( n1, @@ -4073,6 +4088,8 @@ function createHydrationFunctions(rendererInternals) { ) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear; const content = el.content.firstChild; if (needCallTransitionHooks) { + const cls = content.getAttribute("class"); + if (cls) content.$cls = cls; transition.beforeEnter(content); } replaceNode(content, el, parentComponent); @@ -4325,7 +4342,12 @@ function propHasMismatch(el, key, clientValue, vnode, instance) { let actual; let expected; if (key === "class") { - actual = el.getAttribute("class"); + if (el.$cls) { + actual = el.$cls; + delete el.$cls; + } else { + actual = el.getAttribute("class"); + } expected = normalizeClass(clientValue); if (!isSetEqual(toClassSet(actual || ""), toClassSet(expected))) { mismatchType = 2 /* CLASS */; @@ -4463,7 +4485,7 @@ function isMismatchAllowed(el, allowedType) { if (allowedType === 0 /* TEXT */ && list.includes("children")) { return true; } - return allowedAttr.split(",").includes(MismatchTypeString[allowedType]); + return list.includes(MismatchTypeString[allowedType]); } } @@ -4620,14 +4642,25 @@ function defineAsyncComponent(source) { name: "AsyncComponentWrapper", __asyncLoader: load, __asyncHydrate(el, instance, hydrate) { + let patched = false; const doHydrate = hydrateStrategy ? () => { + const performHydrate = () => { + if (patched) { + warn$1( + `Skipping lazy hydration for component '${getComponentName(resolvedComp)}': it was updated before lazy hydration performed.` + ); + return; + } + hydrate(); + }; const teardown = hydrateStrategy( - hydrate, + performHydrate, (cb) => forEachElement(el, cb) ); if (teardown) { (instance.bum || (instance.bum = [])).push(teardown); } + (instance.u || (instance.u = [])).push(() => patched = true); } : hydrate; if (resolvedComp) { doHydrate(); @@ -4797,6 +4830,9 @@ const KeepAliveImpl = { { devtoolsComponentAdded(instance2); } + { + instance2.__keepAliveStorageContainer = storageContainer; + } }; function unmount(vnode) { resetShapeFlag(vnode); @@ -4884,7 +4920,7 @@ const KeepAliveImpl = { ); const { include, exclude, max } = props; if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) { - vnode.shapeFlag &= ~256; + vnode.shapeFlag &= -257; current = vnode; return rawVNode; } @@ -4971,8 +5007,8 @@ function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) { }, target); } function resetShapeFlag(vnode) { - vnode.shapeFlag &= ~256; - vnode.shapeFlag &= ~512; + vnode.shapeFlag &= -257; + vnode.shapeFlag &= -513; } function getInnerChild(vnode) { return vnode.shapeFlag & 128 ? vnode.ssContent : vnode; @@ -5087,14 +5123,16 @@ function renderList(source, renderItem, cache, index) { if (sourceIsArray || isString(source)) { const sourceIsReactiveArray = sourceIsArray && isReactive(source); let needsWrap = false; + let isReadonlySource = false; if (sourceIsReactiveArray) { needsWrap = !isShallow(source); + isReadonlySource = isReadonly(source); source = shallowReadArray(source); } ret = new Array(source.length); for (let i = 0, l = source.length; i < l; i++) { ret[i] = renderItem( - needsWrap ? toReactive(source[i]) : source[i], + needsWrap ? isReadonlySource ? toReadonly(toReactive(source[i])) : toReactive(source[i]) : source[i], i, void 0, cached && cached[i] @@ -6116,11 +6154,9 @@ function createAppAPI(render, hydrate) { } { context.reload = () => { - render( - cloneVNode(vnode), - rootContainer, - namespace - ); + const cloned = cloneVNode(vnode); + cloned.el = null; + render(cloned, rootContainer, namespace); }; } if (isHydrate && hydrate) { @@ -6170,9 +6206,15 @@ If you want to remount the same app, move your app creation logic into a factory }, provide(key, value) { if (key in context.provides) { - warn$1( - `App already provides property with key "${String(key)}". It will be overwritten with the new value.` - ); + if (hasOwn(context.provides, key)) { + warn$1( + `App already provides property with key "${String(key)}". It will be overwritten with the new value.` + ); + } else { + warn$1( + `App already provides property with key "${String(key)}" inherited from its parent element. It will be overwritten with the new value.` + ); + } } context.provides[key] = value; return app; @@ -6209,7 +6251,7 @@ function provide(key, value) { function inject(key, defaultValue, treatDefaultAsFactory = false) { const instance = currentInstance || currentRenderingInstance; if (instance || currentApp) { - const provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0; + let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0; if (provides && key in provides) { return provides[key]; } else if (arguments.length > 1) { @@ -6643,7 +6685,7 @@ const normalizeSlot = (key, rawSlot, ctx) => { return rawSlot; } const normalized = withCtx((...args) => { - if (currentInstance && (!ctx || ctx.root === currentInstance.root)) { + if (currentInstance && !(ctx === null && currentRenderingInstance) && !(ctx && ctx.root !== currentInstance.root)) { warn$1( `Slot "${key}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.` ); @@ -6682,7 +6724,7 @@ const normalizeVNodeSlots = (instance, children) => { }; const assignSlots = (slots, children, optimized) => { for (const key in children) { - if (optimized || key !== "_") { + if (optimized || !isInternalKey(key)) { slots[key] = children[key]; } } @@ -6690,6 +6732,8 @@ const assignSlots = (slots, children, optimized) => { const initSlots = (instance, children, optimized) => { const slots = instance.slots = createInternalObject(); if (instance.vnode.shapeFlag & 32) { + const cacheIndexes = children.__; + if (cacheIndexes) def(slots, "__", cacheIndexes, true); const type = children._; if (type) { assignSlots(slots, children, optimized); @@ -6901,6 +6945,8 @@ function baseCreateRenderer(options, createHydrationFns) { } if (ref != null && parentComponent) { setRef(ref, n1 && n1.ref, parentSuspense, n2 || n1, !n2); + } else if (ref == null && n1 && n1.ref != null) { + setRef(n1.ref, null, parentSuspense, n1, true); } }; const processText = (n1, n2, container, anchor) => { @@ -7206,7 +7252,7 @@ function baseCreateRenderer(options, createHydrationFns) { (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement // which also requires the correct parent container !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything. - oldVNode.shapeFlag & (6 | 64)) ? hostParentNode(oldVNode.el) : ( + oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(oldVNode.el) : ( // In other cases, the parent container is not actually used so we // just pass the block element here to avoid a DOM parentNode call. fallbackContainer @@ -7368,8 +7414,8 @@ function baseCreateRenderer(options, createHydrationFns) { endMeasure(instance, `init`); } } + if (isHmrUpdating) initialVNode.el = null; if (instance.asyncDep) { - if (isHmrUpdating) initialVNode.el = null; parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized); if (!initialVNode.el) { const placeholder = instance.subTree = createVNode(Comment); @@ -7460,7 +7506,8 @@ function baseCreateRenderer(options, createHydrationFns) { hydrateSubTree(); } } else { - if (root.ce) { + if (root.ce && // @ts-expect-error _def is private + root.ce._def.shadowRoot !== false) { root.ce._injectChildStyle(type); } { @@ -7931,7 +7978,13 @@ function baseCreateRenderer(options, createHydrationFns) { queuePostRenderEffect(() => transition.enter(el), parentSuspense); } else { const { leave, delayLeave, afterLeave } = transition; - const remove2 = () => hostInsert(el, container, anchor); + const remove2 = () => { + if (vnode.ctx.isUnmounted) { + hostRemove(el); + } else { + hostInsert(el, container, anchor); + } + }; const performLeave = () => { leave(el, () => { remove2(); @@ -7964,7 +8017,9 @@ function baseCreateRenderer(options, createHydrationFns) { optimized = false; } if (ref != null) { + pauseTracking(); setRef(ref, null, parentSuspense, vnode, true); + resetTracking(); } if (cacheIndex != null) { parentComponent.renderCache[cacheIndex] = void 0; @@ -8076,12 +8131,27 @@ function baseCreateRenderer(options, createHydrationFns) { if (instance.type.__hmrId) { unregisterHMR(instance); } - const { bum, scope, job, subTree, um, m, a } = instance; + const { + bum, + scope, + job, + subTree, + um, + m, + a, + parent, + slots: { __: slotCacheKeys } + } = instance; invalidateMount(m); invalidateMount(a); if (bum) { invokeArrayFns(bum); } + if (parent && isArray(slotCacheKeys)) { + slotCacheKeys.forEach((v) => { + parent.renderCache[v] = void 0; + }); + } scope.stop(); if (job) { job.flags |= 8; @@ -8177,8 +8247,8 @@ function toggleRecurse({ effect, job }, allowed) { effect.flags |= 32; job.flags |= 4; } else { - effect.flags &= ~32; - job.flags &= ~4; + effect.flags &= -33; + job.flags &= -5; } } function needTransition(parentSuspense, transition) { @@ -8205,6 +8275,9 @@ function traverseStaticChildren(n1, n2, shallow = false) { if (c2.type === Comment && !c2.el) { c2.el = c1.el; } + { + c2.el && (c2.el.__vnode = c2); + } } } } @@ -9550,8 +9623,8 @@ function isSameVNodeType(n1, n2) { if (n2.shapeFlag & 6 && n1.component) { const dirtyInstances = hmrDirtyComponents.get(n2.type); if (dirtyInstances && dirtyInstances.has(n1.component)) { - n1.shapeFlag &= ~256; - n2.shapeFlag &= ~512; + n1.shapeFlag &= -257; + n2.shapeFlag &= -513; return false; } } @@ -10012,7 +10085,7 @@ function setupComponent(instance, isSSR = false, optimized = false) { const { props, children } = instance.vnode; const isStateful = isStatefulComponent(instance); initProps(instance, props, isStateful, isSSR); - initSlots(instance, children, optimized); + initSlots(instance, children, optimized || isSSR); const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0; isSSR && setInSSRSetupState(false); return setupResult; @@ -10343,13 +10416,15 @@ function initCustomFormatter() { if (obj.__isVue) { return ["div", vueStyle, `VueInstance`]; } else if (isRef(obj)) { + pauseTracking(); + const value = obj.value; + resetTracking(); return [ "div", {}, ["span", vueStyle, genRefFlag(obj)], "<", - // avoid debugger accessing value affecting behavior - formatValue("_value" in obj ? obj._value : obj), + formatValue(value), `>` ]; } else if (isReactive(obj)) { @@ -10530,7 +10605,7 @@ function isMemoSame(cached, memo) { return true; } -const version = "3.5.13"; +const version = "3.5.17"; const warn = warn$1 ; const ErrorTypeStrings = ErrorTypeStrings$1 ; const devtools = devtools$1 ; @@ -11348,7 +11423,7 @@ function shouldSetAsProp(el, key, value, isSVG) { } return false; } - if (key === "spellcheck" || key === "draggable" || key === "translate") { + if (key === "spellcheck" || key === "draggable" || key === "translate" || key === "autocorrect") { return false; } if (key === "form") { @@ -11431,13 +11506,10 @@ class VueElement extends BaseClass { this._root = this; } } - if (!this._def.__asyncLoader) { - this._resolveProps(this._def); - } } connectedCallback() { if (!this.isConnected) return; - if (!this.shadowRoot) { + if (!this.shadowRoot && !this._resolved) { this._parseSlots(); } this._connected = true; @@ -11450,8 +11522,7 @@ class VueElement extends BaseClass { } if (!this._instance) { if (this._resolved) { - this._setParent(); - this._update(); + this._mount(this._def); } else { if (parent && parent._pendingResolve) { this._pendingResolve = parent._pendingResolve.then(() => { @@ -11467,7 +11538,15 @@ class VueElement extends BaseClass { _setParent(parent = this._parent) { if (parent) { this._instance.parent = parent._instance; - this._instance.provides = parent._instance.provides; + this._inheritParentContext(parent); + } + } + _inheritParentContext(parent = this._parent) { + if (parent && this._app) { + Object.setPrototypeOf( + this._app._context.provides, + parent._instance.provides + ); } } disconnectedCallback() { @@ -11517,9 +11596,7 @@ class VueElement extends BaseClass { } } this._numberProps = numberProps; - if (isAsync) { - this._resolveProps(def); - } + this._resolveProps(def); if (this.shadowRoot) { this._applyStyles(styles); } else if (styles) { @@ -11531,9 +11608,10 @@ class VueElement extends BaseClass { }; const asyncDef = this._def.__asyncLoader; if (asyncDef) { - this._pendingResolve = asyncDef().then( - (def) => resolve(this._def = def, true) - ); + this._pendingResolve = asyncDef().then((def) => { + def.configureApp = this._def.configureApp; + resolve(this._def = def, true); + }); } else { resolve(this._def); } @@ -11543,6 +11621,7 @@ class VueElement extends BaseClass { def.name = "VueElement"; } this._app = this._createApp(def); + this._inheritParentContext(); if (def.configureApp) { def.configureApp(this._app); } @@ -11627,7 +11706,9 @@ class VueElement extends BaseClass { } } _update() { - render(this._createVNode(), this._root); + const vnode = this._createVNode(); + if (this._app) vnode.appContext = this._app._context; + render(vnode, this._root); } _createVNode() { const baseProps = {}; @@ -11837,6 +11918,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({ instance.vnode.el, moveClass )) { + prevChildren = []; return; } prevChildren.forEach(callPendingCbs); @@ -11860,6 +11942,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({ }; el.addEventListener("transitionend", cb); }); + prevChildren = []; }); return () => { const rawProps = toRaw(props); @@ -13474,7 +13557,7 @@ class Tokenizer { this.buffer = input; while (this.index < this.buffer.length) { const c = this.buffer.charCodeAt(this.index); - if (c === 10) { + if (c === 10 && this.state !== 33) { this.newlines.push(this.index); } switch (this.state) { @@ -14479,7 +14562,7 @@ function isUpperCase(c) { return c > 64 && c < 91; } const windowsNewlineRE = /\r\n/g; -function condenseWhitespace(nodes, tag) { +function condenseWhitespace(nodes) { const shouldCondense = currentOptions.whitespace !== "preserve"; let removedWhitespace = false; for (let i = 0; i < nodes.length; i++) { @@ -14643,12 +14726,12 @@ function cacheStatic(root, context) { context, // Root node is unfortunately non-hoistable due to potential parent // fallthrough attributes. - isSingleElementRoot(root, root.children[0]) + !!getSingleElementRoot(root) ); } -function isSingleElementRoot(root, child) { - const { children } = root; - return children.length === 1 && child.type === 1 && !isSlotOutlet(child); +function getSingleElementRoot(root) { + const children = root.children.filter((x) => x.type !== 3); + return children.length === 1 && children[0].type === 1 && !isSlotOutlet(children[0]) ? children[0] : null; } function walk(node, parent, context, doNotHoistNode = false, inFor = false) { const { children } = node; @@ -14709,6 +14792,7 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) { } } let cachedAsArray = false; + const slotCacheKeys = []; if (toCache.length === children.length && node.type === 1) { if (node.tagType === 0 && node.codegenNode && node.codegenNode.type === 13 && isArray(node.codegenNode.children)) { node.codegenNode.children = getCacheExpression( @@ -14718,6 +14802,7 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) { } else if (node.tagType === 1 && node.codegenNode && node.codegenNode.type === 13 && node.codegenNode.children && !isArray(node.codegenNode.children) && node.codegenNode.children.type === 15) { const slot = getSlotNode(node.codegenNode, "default"); if (slot) { + slotCacheKeys.push(context.cached.length); slot.returns = getCacheExpression( createArrayExpression(slot.returns) ); @@ -14727,6 +14812,7 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) { const slotName = findDir(node, "slot", true); const slot = slotName && slotName.arg && getSlotNode(parent.codegenNode, slotName.arg); if (slot) { + slotCacheKeys.push(context.cached.length); slot.returns = getCacheExpression( createArrayExpression(slot.returns) ); @@ -14736,9 +14822,18 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) { } if (!cachedAsArray) { for (const child of toCache) { + slotCacheKeys.push(context.cached.length); child.codegenNode = context.cache(child.codegenNode); } } + if (slotCacheKeys.length && node.type === 1 && node.tagType === 1 && node.codegenNode && node.codegenNode.type === 13 && node.codegenNode.children && !isArray(node.codegenNode.children) && node.codegenNode.children.type === 15) { + node.codegenNode.children.properties.push( + createObjectProperty( + `__`, + createSimpleExpression(JSON.stringify(slotCacheKeys), false) + ) + ); + } function getCacheExpression(value) { const exp = context.cache(value); if (inFor && context.hmr) { @@ -15096,15 +15191,15 @@ function createRootCodegen(root, context) { const { helper } = context; const { children } = root; if (children.length === 1) { - const child = children[0]; - if (isSingleElementRoot(root, child) && child.codegenNode) { - const codegenNode = child.codegenNode; + const singleElementRootChild = getSingleElementRoot(root); + if (singleElementRootChild && singleElementRootChild.codegenNode) { + const codegenNode = singleElementRootChild.codegenNode; if (codegenNode.type === 13) { convertToBlock(codegenNode, context); } root.codegenNode = codegenNode; } else { - root.codegenNode = child; + root.codegenNode = children[0]; } } else if (children.length > 1) { let patchFlag = 64; @@ -16451,7 +16546,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) { let prev; while (j--) { prev = children[j]; - if (prev.type !== 3) { + if (prev.type !== 3 && isNonWhitespaceContent(prev)) { break; } } @@ -17383,8 +17478,7 @@ const transformModel$1 = (dir, node, context) => { context.onError(createCompilerError(44, exp.loc)); return createTransformProps(); } - const maybeRef = false; - if (!expString.trim() || !isMemberExpression(exp) && !maybeRef) { + if (!expString.trim() || !isMemberExpression(exp) && true) { context.onError( createCompilerError(42, exp.loc) ); @@ -17953,6 +18047,9 @@ const ignoreSideEffectTags = (node, context) => { }; function isValidHTMLNesting(parent, child) { + if (parent === "template") { + return true; + } if (parent in onlyValidChildren) { return onlyValidChildren[parent].has(child); } diff --git a/node_modules/vue/dist/vue.esm-browser.prod.js b/node_modules/vue/dist/vue.esm-browser.prod.js index 19179c3..7dd450b 100644 --- a/node_modules/vue/dist/vue.esm-browser.prod.js +++ b/node_modules/vue/dist/vue.esm-browser.prod.js @@ -1,9 +1,12 @@ /** -* vue v3.5.13 +* vue v3.5.17 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/let e,t,n,r,i,l,s,o,a,c,u,d,p;function f(e){let t=Object.create(null);for(let n of e.split(","))t[n]=1;return e=>e in t}let h={},m=[],g=()=>{},y=()=>!1,b=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&(e.charCodeAt(2)>122||97>e.charCodeAt(2)),_=e=>e.startsWith("onUpdate:"),S=Object.assign,x=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},C=Object.prototype.hasOwnProperty,T=(e,t)=>C.call(e,t),k=Array.isArray,w=e=>"[object Map]"===L(e),N=e=>"[object Set]"===L(e),E=e=>"[object Date]"===L(e),A=e=>"[object RegExp]"===L(e),R=e=>"function"==typeof e,I=e=>"string"==typeof e,O=e=>"symbol"==typeof e,P=e=>null!==e&&"object"==typeof e,M=e=>(P(e)||R(e))&&R(e.then)&&R(e.catch),D=Object.prototype.toString,L=e=>D.call(e),$=e=>L(e).slice(8,-1),F=e=>"[object Object]"===L(e),V=e=>I(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,B=f(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),U=f("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),j=e=>{let t=Object.create(null);return n=>t[n]||(t[n]=e(n))},H=/-(\w)/g,q=j(e=>e.replace(H,(e,t)=>t?t.toUpperCase():"")),W=/\B([A-Z])/g,K=j(e=>e.replace(W,"-$1").toLowerCase()),z=j(e=>e.charAt(0).toUpperCase()+e.slice(1)),J=j(e=>e?`on${z(e)}`:""),G=(e,t)=>!Object.is(e,t),Q=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},Z=e=>{let t=parseFloat(e);return isNaN(t)?e:t},Y=e=>{let t=I(e)?Number(e):NaN;return isNaN(t)?e:t},ee=()=>e||(e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{}),et=f("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol");function en(e){if(k(e)){let t={};for(let n=0;n{if(e){let n=e.split(ei);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function eo(e){let t="";if(I(e))t=e;else if(k(e))for(let n=0;neh(e,t))}let eg=e=>!!(e&&!0===e.__v_isRef),ey=e=>I(e)?e:null==e?"":k(e)||P(e)&&(e.toString===D||!R(e.toString))?eg(e)?ey(e.value):JSON.stringify(e,ev,2):String(e),ev=(e,t)=>eg(t)?ev(e,t.value):w(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[eb(t,r)+" =>"]=n,e),{})}:N(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>eb(e))}:O(t)?eb(t):!P(t)||k(t)||F(t)?t:String(t),eb=(e,t="")=>{var n;return O(e)?`Symbol(${null!=(n=e.description)?n:t})`:e};class e_{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=t,!e&&t&&(this.index=(t.scopes||(t.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){let e,t;if(this._isPaused=!0,this.scopes)for(e=0,t=this.scopes.length;e0)){if(i){let e=i;for(i=void 0;e;){let t=e.next;e.next=void 0,e.flags&=-9,e=t}}for(;r;){let t=r;for(r=void 0;t;){let n=t.next;if(t.next=void 0,t.flags&=-9,1&t.flags)try{t.trigger()}catch(t){e||(e=t)}t=n}}if(e)throw e}}function eA(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function eR(e){let t;let n=e.depsTail,r=n;for(;r;){let e=r.prevDep;-1===r.version?(r===n&&(n=e),eP(r),function(e){let{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=e}e.deps=t,e.depsTail=n}function eI(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(eO(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function eO(e){if(4&e.flags&&!(16&e.flags)||(e.flags&=-17,e.globalVersion===eU))return;e.globalVersion=eU;let t=e.dep;if(e.flags|=2,t.version>0&&!e.isSSR&&e.deps&&!eI(e)){e.flags&=-3;return}let r=n,i=eL;n=e,eL=!0;try{eA(e);let n=e.fn(e._value);(0===t.version||G(n,e._value))&&(e._value=n,t.version++)}catch(e){throw t.version++,e}finally{n=r,eL=i,eR(e),e.flags&=-3}}function eP(e,t=!1){let{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)eP(e,!0)}t||--n.sc||!n.map||n.map.delete(n.key)}function eM(e,t){e.effect instanceof ek&&(e=e.effect.fn);let n=new ek(e);t&&S(n,t);try{n.run()}catch(e){throw n.stop(),e}let r=n.run.bind(n);return r.effect=n,r}function eD(e){e.effect.stop()}let eL=!0,e$=[];function eF(){e$.push(eL),eL=!1}function eV(){let e=e$.pop();eL=void 0===e||e}function eB(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let e=n;n=void 0;try{t()}finally{n=e}}}let eU=0;class ej{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class eH{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(e){if(!n||!eL||n===this.computed)return;let t=this.activeLink;if(void 0===t||t.sub!==n)t=this.activeLink=new ej(n,this),n.deps?(t.prevDep=n.depsTail,n.depsTail.nextDep=t,n.depsTail=t):n.deps=n.depsTail=t,function e(t){if(t.dep.sc++,4&t.sub.flags){let n=t.dep.computed;if(n&&!t.dep.subs){n.flags|=20;for(let t=n.deps;t;t=t.nextDep)e(t)}let r=t.dep.subs;r!==t&&(t.prevSub=r,r&&(r.nextSub=t)),t.dep.subs=t}}(t);else if(-1===t.version&&(t.version=this.version,t.nextDep)){let e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=n.depsTail,t.nextDep=void 0,n.depsTail.nextDep=t,n.depsTail=t,n.deps===t&&(n.deps=e)}return t}trigger(e){this.version++,eU++,this.notify(e)}notify(e){ew++;try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{eE()}}}let eq=new WeakMap,eW=Symbol(""),eK=Symbol(""),ez=Symbol("");function eJ(e,t,r){if(eL&&n){let t=eq.get(e);t||eq.set(e,t=new Map);let n=t.get(r);n||(t.set(r,n=new eH),n.map=t,n.key=r),n.track()}}function eG(e,t,n,r,i,l){let s=eq.get(e);if(!s){eU++;return}let o=e=>{e&&e.trigger()};if(ew++,"clear"===t)s.forEach(o);else{let i=k(e),l=i&&V(n);if(i&&"length"===n){let e=Number(r);s.forEach((t,n)=>{("length"===n||n===ez||!O(n)&&n>=e)&&o(t)})}else switch((void 0!==n||s.has(void 0))&&o(s.get(n)),l&&o(s.get(ez)),t){case"add":i?l&&o(s.get("length")):(o(s.get(eW)),w(e)&&o(s.get(eK)));break;case"delete":!i&&(o(s.get(eW)),w(e)&&o(s.get(eK)));break;case"set":w(e)&&o(s.get(eW))}}eE()}function eQ(e){let t=tw(e);return t===e?t:(eJ(t,"iterate",ez),tT(e)?t:t.map(tE))}function eX(e){return eJ(e=tw(e),"iterate",ez),e}let eZ={__proto__:null,[Symbol.iterator](){return eY(this,Symbol.iterator,tE)},concat(...e){return eQ(this).concat(...e.map(e=>k(e)?eQ(e):e))},entries(){return eY(this,"entries",e=>(e[1]=tE(e[1]),e))},every(e,t){return e1(this,"every",e,t,void 0,arguments)},filter(e,t){return e1(this,"filter",e,t,e=>e.map(tE),arguments)},find(e,t){return e1(this,"find",e,t,tE,arguments)},findIndex(e,t){return e1(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return e1(this,"findLast",e,t,tE,arguments)},findLastIndex(e,t){return e1(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return e1(this,"forEach",e,t,void 0,arguments)},includes(...e){return e3(this,"includes",e)},indexOf(...e){return e3(this,"indexOf",e)},join(e){return eQ(this).join(e)},lastIndexOf(...e){return e3(this,"lastIndexOf",e)},map(e,t){return e1(this,"map",e,t,void 0,arguments)},pop(){return e6(this,"pop")},push(...e){return e6(this,"push",e)},reduce(e,...t){return e2(this,"reduce",e,t)},reduceRight(e,...t){return e2(this,"reduceRight",e,t)},shift(){return e6(this,"shift")},some(e,t){return e1(this,"some",e,t,void 0,arguments)},splice(...e){return e6(this,"splice",e)},toReversed(){return eQ(this).toReversed()},toSorted(e){return eQ(this).toSorted(e)},toSpliced(...e){return eQ(this).toSpliced(...e)},unshift(...e){return e6(this,"unshift",e)},values(){return eY(this,"values",tE)}};function eY(e,t,n){let r=eX(e),i=r[t]();return r===e||tT(e)||(i._next=i.next,i.next=()=>{let e=i._next();return e.value&&(e.value=n(e.value)),e}),i}let e0=Array.prototype;function e1(e,t,n,r,i,l){let s=eX(e),o=s!==e&&!tT(e),a=s[t];if(a!==e0[t]){let t=a.apply(e,l);return o?tE(t):t}let c=n;s!==e&&(o?c=function(t,r){return n.call(this,tE(t),r,e)}:n.length>2&&(c=function(t,r){return n.call(this,t,r,e)}));let u=a.call(s,c,r);return o&&i?i(u):u}function e2(e,t,n,r){let i=eX(e),l=n;return i!==e&&(tT(e)?n.length>3&&(l=function(t,r,i){return n.call(this,t,r,i,e)}):l=function(t,r,i){return n.call(this,t,tE(r),i,e)}),i[t](l,...r)}function e3(e,t,n){let r=tw(e);eJ(r,"iterate",ez);let i=r[t](...n);return(-1===i||!1===i)&&tk(n[0])?(n[0]=tw(n[0]),r[t](...n)):i}function e6(e,t,n=[]){eF(),ew++;let r=tw(e)[t].apply(e,n);return eE(),eV(),r}let e4=f("__proto__,__v_isRef,__isVue"),e8=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>"arguments"!==e&&"caller"!==e).map(e=>Symbol[e]).filter(O));function e5(e){O(e)||(e=String(e));let t=tw(this);return eJ(t,"has",e),t.hasOwnProperty(e)}class e9{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if("__v_skip"===t)return e.__v_skip;let r=this._isReadonly,i=this._isShallow;if("__v_isReactive"===t)return!r;if("__v_isReadonly"===t)return r;if("__v_isShallow"===t)return i;if("__v_raw"===t)return n===(r?i?tg:tm:i?th:tf).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;let l=k(e);if(!r){let e;if(l&&(e=eZ[t]))return e;if("hasOwnProperty"===t)return e5}let s=Reflect.get(e,t,tR(e)?e:n);return(O(t)?e8.has(t):e4(t))?s:(r||eJ(e,"get",t),i)?s:tR(s)?l&&V(t)?s:s.value:P(s)?r?tb(s):ty(s):s}}class e7 extends e9{constructor(e=!1){super(!1,e)}set(e,t,n,r){let i=e[t];if(!this._isShallow){let t=tC(i);if(tT(n)||tC(n)||(i=tw(i),n=tw(n)),!k(e)&&tR(i)&&!tR(n))return!t&&(i.value=n,!0)}let l=k(e)&&V(t)?Number(t)e,ts=e=>Reflect.getPrototypeOf(e);function to(e){return function(...t){return"delete"!==e&&("clear"===e?void 0:this)}}function ta(e,t){let n=function(e,t){let n={get(n){let r=this.__v_raw,i=tw(r),l=tw(n);e||(G(n,l)&&eJ(i,"get",n),eJ(i,"get",l));let{has:s}=ts(i),o=t?tl:e?tA:tE;return s.call(i,n)?o(r.get(n)):s.call(i,l)?o(r.get(l)):void(r!==i&&r.get(n))},get size(){let t=this.__v_raw;return e||eJ(tw(t),"iterate",eW),Reflect.get(t,"size",t)},has(t){let n=this.__v_raw,r=tw(n),i=tw(t);return e||(G(t,i)&&eJ(r,"has",t),eJ(r,"has",i)),t===i?n.has(t):n.has(t)||n.has(i)},forEach(n,r){let i=this,l=i.__v_raw,s=tw(l),o=t?tl:e?tA:tE;return e||eJ(s,"iterate",eW),l.forEach((e,t)=>n.call(r,o(e),o(t),i))}};return S(n,e?{add:to("add"),set:to("set"),delete:to("delete"),clear:to("clear")}:{add(e){t||tT(e)||tC(e)||(e=tw(e));let n=tw(this);return ts(n).has.call(n,e)||(n.add(e),eG(n,"add",e,e)),this},set(e,n){t||tT(n)||tC(n)||(n=tw(n));let r=tw(this),{has:i,get:l}=ts(r),s=i.call(r,e);s||(e=tw(e),s=i.call(r,e));let o=l.call(r,e);return r.set(e,n),s?G(n,o)&&eG(r,"set",e,n):eG(r,"add",e,n),this},delete(e){let t=tw(this),{has:n,get:r}=ts(t),i=n.call(t,e);i||(e=tw(e),i=n.call(t,e)),r&&r.call(t,e);let l=t.delete(e);return i&&eG(t,"delete",e,void 0),l},clear(){let e=tw(this),t=0!==e.size,n=e.clear();return t&&eG(e,"clear",void 0,void 0),n}}),["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=function(...n){let i=this.__v_raw,l=tw(i),s=w(l),o="entries"===r||r===Symbol.iterator&&s,a=i[r](...n),c=t?tl:e?tA:tE;return e||eJ(l,"iterate","keys"===r&&s?eK:eW),{next(){let{value:e,done:t}=a.next();return t?{value:e,done:t}:{value:o?[c(e[0]),c(e[1])]:c(e),done:t}},[Symbol.iterator](){return this}}}}),n}(e,t);return(t,r,i)=>"__v_isReactive"===r?!e:"__v_isReadonly"===r?e:"__v_raw"===r?t:Reflect.get(T(n,r)&&r in t?n:t,r,i)}let tc={get:ta(!1,!1)},tu={get:ta(!1,!0)},td={get:ta(!0,!1)},tp={get:ta(!0,!0)},tf=new WeakMap,th=new WeakMap,tm=new WeakMap,tg=new WeakMap;function ty(e){return tC(e)?e:tS(e,!1,tt,tc,tf)}function tv(e){return tS(e,!1,tr,tu,th)}function tb(e){return tS(e,!0,tn,td,tm)}function t_(e){return tS(e,!0,ti,tp,tg)}function tS(e,t,n,r,i){if(!P(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;let l=i.get(e);if(l)return l;let s=e.__v_skip||!Object.isExtensible(e)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}($(e));if(0===s)return e;let o=new Proxy(e,2===s?r:n);return i.set(e,o),o}function tx(e){return tC(e)?tx(e.__v_raw):!!(e&&e.__v_isReactive)}function tC(e){return!!(e&&e.__v_isReadonly)}function tT(e){return!!(e&&e.__v_isShallow)}function tk(e){return!!e&&!!e.__v_raw}function tw(e){let t=e&&e.__v_raw;return t?tw(t):e}function tN(e){return!T(e,"__v_skip")&&Object.isExtensible(e)&&X(e,"__v_skip",!0),e}let tE=e=>P(e)?ty(e):e,tA=e=>P(e)?tb(e):e;function tR(e){return!!e&&!0===e.__v_isRef}function tI(e){return tP(e,!1)}function tO(e){return tP(e,!0)}function tP(e,t){return tR(e)?e:new tM(e,t)}class tM{constructor(e,t){this.dep=new eH,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:tw(e),this._value=t?e:tE(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||tT(e)||tC(e);G(e=n?e:tw(e),t)&&(this._rawValue=e,this._value=n?e:tE(e),this.dep.trigger())}}function tD(e){e.dep&&e.dep.trigger()}function tL(e){return tR(e)?e.value:e}function t$(e){return R(e)?e():tL(e)}let tF={get:(e,t,n)=>"__v_raw"===t?e:tL(Reflect.get(e,t,n)),set:(e,t,n,r)=>{let i=e[t];return tR(i)&&!tR(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function tV(e){return tx(e)?e:new Proxy(e,tF)}class tB{constructor(e){this.__v_isRef=!0,this._value=void 0;let t=this.dep=new eH,{get:n,set:r}=e(t.track.bind(t),t.trigger.bind(t));this._get=n,this._set=r}get value(){return this._value=this._get()}set value(e){this._set(e)}}function tU(e){return new tB(e)}function tj(e){let t=k(e)?Array(e.length):{};for(let n in e)t[n]=tK(e,n);return t}class tH{constructor(e,t,n){this._object=e,this._key=t,this._defaultValue=n,this.__v_isRef=!0,this._value=void 0}get value(){let e=this._object[this._key];return this._value=void 0===e?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return function(e,t){let n=eq.get(e);return n&&n.get(t)}(tw(this._object),this._key)}}class tq{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function tW(e,t,n){return tR(e)?e:R(e)?new tq(e):P(e)&&arguments.length>1?tK(e,t,n):tI(e)}function tK(e,t,n){let r=e[t];return tR(r)?r:new tH(e,t,n)}class tz{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new eH(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=eU-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(8&this.flags)&&n!==this)return eN(this,!0),!0}get value(){let e=this.dep.track();return eO(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}let tJ={GET:"get",HAS:"has",ITERATE:"iterate"},tG={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},tQ={},tX=new WeakMap;function tZ(){return d}function tY(e,t=!1,n=d){if(n){let t=tX.get(n);t||tX.set(n,t=[]),t.push(e)}}function t0(e,t=1/0,n){if(t<=0||!P(e)||e.__v_skip||(n=n||new Set).has(e))return e;if(n.add(e),t--,tR(e))t0(e.value,t,n);else if(k(e))for(let r=0;r{t0(e,t,n)});else if(F(e)){for(let r in e)t0(e[r],t,n);for(let r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&t0(e[r],t,n)}return e}function t1(e,t){}let t2={SETUP_FUNCTION:0,0:"SETUP_FUNCTION",RENDER_FUNCTION:1,1:"RENDER_FUNCTION",NATIVE_EVENT_HANDLER:5,5:"NATIVE_EVENT_HANDLER",COMPONENT_EVENT_HANDLER:6,6:"COMPONENT_EVENT_HANDLER",VNODE_HOOK:7,7:"VNODE_HOOK",DIRECTIVE_HOOK:8,8:"DIRECTIVE_HOOK",TRANSITION_HOOK:9,9:"TRANSITION_HOOK",APP_ERROR_HANDLER:10,10:"APP_ERROR_HANDLER",APP_WARN_HANDLER:11,11:"APP_WARN_HANDLER",FUNCTION_REF:12,12:"FUNCTION_REF",ASYNC_COMPONENT_LOADER:13,13:"ASYNC_COMPONENT_LOADER",SCHEDULER:14,14:"SCHEDULER",COMPONENT_UPDATE:15,15:"COMPONENT_UPDATE",APP_UNMOUNT_CLEANUP:16,16:"APP_UNMOUNT_CLEANUP"};function t3(e,t,n,r){try{return r?e(...r):e()}catch(e){t4(e,t,n)}}function t6(e,t,n,r){if(R(e)){let i=t3(e,t,n,r);return i&&M(i)&&i.catch(e=>{t4(e,t,n)}),i}if(k(e)){let i=[];for(let l=0;l=nc(n)?t8.push(e):t8.splice(function(e){let t=t5+1,n=t8.length;for(;t>>1,i=t8[r],l=nc(i);lnc(e)-nc(t));if(t9.length=0,t7){t7.push(...e);return}for(ne=0,t7=e;nenull==e.id?2&e.flags?-1:1/0:e.id,nu=null,nd=null;function np(e){let t=nu;return nu=e,nd=e&&e.type.__scopeId||null,t}function nf(e){nd=e}function nh(){nd=null}let nm=e=>ng;function ng(e,t=nu,n){if(!t||e._n)return e;let r=(...n)=>{let i;r._d&&ls(-1);let l=np(t);try{i=e(...n)}finally{np(l),r._d&&ls(1)}return i};return r._n=!0,r._c=!0,r._d=!0,r}function ny(e,t){if(null===nu)return e;let n=lH(nu),r=e.dirs||(e.dirs=[]);for(let e=0;ee.__isTeleport,nS=e=>e&&(e.disabled||""===e.disabled),nx=e=>e&&(e.defer||""===e.defer),nC=e=>"undefined"!=typeof SVGElement&&e instanceof SVGElement,nT=e=>"function"==typeof MathMLElement&&e instanceof MathMLElement,nk=(e,t)=>{let n=e&&e.to;return I(n)?t?t(n):null:n},nw={name:"Teleport",__isTeleport:!0,process(e,t,n,r,i,l,s,o,a,c){let{mc:u,pc:d,pbc:p,o:{insert:f,querySelector:h,createText:m,createComment:g}}=c,y=nS(t.props),{shapeFlag:b,children:_,dynamicChildren:S}=t;if(null==e){let e=t.el=m(""),c=t.anchor=m("");f(e,n,r),f(c,n,r);let d=(e,t)=>{16&b&&(i&&i.isCE&&(i.ce._teleportTarget=e),u(_,e,t,i,l,s,o,a))},p=()=>{let e=t.target=nk(t.props,h),n=nR(e,t,m,f);e&&("svg"!==s&&nC(e)?s="svg":"mathml"!==s&&nT(e)&&(s="mathml"),y||(d(e,n),nA(t,!1)))};y&&(d(n,c),nA(t,!0)),nx(t.props)?iw(()=>{p(),t.el.__isMounted=!0},l):p()}else{if(nx(t.props)&&!e.el.__isMounted){iw(()=>{nw.process(e,t,n,r,i,l,s,o,a,c),delete e.el.__isMounted},l);return}t.el=e.el,t.targetStart=e.targetStart;let u=t.anchor=e.anchor,f=t.target=e.target,m=t.targetAnchor=e.targetAnchor,g=nS(e.props),b=g?n:f;if("svg"===s||nC(f)?s="svg":("mathml"===s||nT(f))&&(s="mathml"),S?(p(e.dynamicChildren,S,b,i,l,s,o),iP(e,t,!0)):a||d(e,t,b,g?u:m,i,l,s,o,!1),y)g?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):nN(t,n,u,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){let e=t.target=nk(t.props,h);e&&nN(t,e,null,c,0)}else g&&nN(t,f,m,c,1);nA(t,y)}},remove(e,t,n,{um:r,o:{remove:i}},l){let{shapeFlag:s,children:o,anchor:a,targetStart:c,targetAnchor:u,target:d,props:p}=e;if(d&&(i(c),i(u)),l&&i(a),16&s){let e=l||!nS(p);for(let i=0;i{e.isMounted=!0}),rb(()=>{e.isUnmounting=!0}),e}let nM=[Function,Array],nD={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:nM,onEnter:nM,onAfterEnter:nM,onEnterCancelled:nM,onBeforeLeave:nM,onLeave:nM,onAfterLeave:nM,onLeaveCancelled:nM,onBeforeAppear:nM,onAppear:nM,onAfterAppear:nM,onAppearCancelled:nM},nL=e=>{let t=e.subTree;return t.component?nL(t.component):t};function n$(e){let t=e[0];if(e.length>1){for(let n of e)if(n.type!==i7){t=n;break}}return t}let nF={name:"BaseTransition",props:nD,setup(e,{slots:t}){let n=lI(),r=nP();return()=>{let i=t.default&&nq(t.default(),!0);if(!i||!i.length)return;let l=n$(i),s=tw(e),{mode:o}=s;if(r.isLeaving)return nU(l);let a=nj(l);if(!a)return nU(l);let c=nB(a,s,r,n,e=>c=e);a.type!==i7&&nH(a,c);let u=n.subTree&&nj(n.subTree);if(u&&u.type!==i7&&!ld(a,u)&&nL(n).type!==i7){let e=nB(u,s,r,n);if(nH(u,e),"out-in"===o&&a.type!==i7)return r.isLeaving=!0,e.afterLeave=()=>{r.isLeaving=!1,8&n.job.flags||n.update(),delete e.afterLeave,u=void 0},nU(l);"in-out"===o&&a.type!==i7?e.delayLeave=(e,t,n)=>{nV(r,u)[String(u.key)]=u,e[nI]=()=>{t(),e[nI]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{n(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return l}}};function nV(e,t){let{leavingVNodes:n}=e,r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function nB(e,t,n,r,i){let{appear:l,mode:s,persisted:o=!1,onBeforeEnter:a,onEnter:c,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:p,onLeave:f,onAfterLeave:h,onLeaveCancelled:m,onBeforeAppear:g,onAppear:y,onAfterAppear:b,onAppearCancelled:_}=t,S=String(e.key),x=nV(n,e),C=(e,t)=>{e&&t6(e,r,9,t)},T=(e,t)=>{let n=t[1];C(e,t),k(e)?e.every(e=>e.length<=1)&&n():e.length<=1&&n()},w={mode:s,persisted:o,beforeEnter(t){let r=a;if(!n.isMounted){if(!l)return;r=g||a}t[nI]&&t[nI](!0);let i=x[S];i&&ld(e,i)&&i.el[nI]&&i.el[nI](),C(r,[t])},enter(e){let t=c,r=u,i=d;if(!n.isMounted){if(!l)return;t=y||c,r=b||u,i=_||d}let s=!1,o=e[nO]=t=>{s||(s=!0,t?C(i,[e]):C(r,[e]),w.delayedLeave&&w.delayedLeave(),e[nO]=void 0)};t?T(t,[e,o]):o()},leave(t,r){let i=String(e.key);if(t[nO]&&t[nO](!0),n.isUnmounting)return r();C(p,[t]);let l=!1,s=t[nI]=n=>{l||(l=!0,r(),n?C(m,[t]):C(h,[t]),t[nI]=void 0,x[i]!==e||delete x[i])};x[i]=e,f?T(f,[t,s]):s()},clone(e){let l=nB(e,t,n,r,i);return i&&i(l),l}};return w}function nU(e){if(rl(e))return(e=lv(e)).children=null,e}function nj(e){if(!rl(e))return n_(e.type)&&e.children?n$(e.children):e;let{shapeFlag:t,children:n}=e;if(n){if(16&t)return n[0];if(32&t&&R(n.default))return n.default()}}function nH(e,t){6&e.shapeFlag&&e.component?(e.transition=t,nH(e.component.subTree,t)):128&e.shapeFlag?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function nq(e,t=!1,n){let r=[],i=0;for(let l=0;l1)for(let e=0;en.value,set:e=>n.value=e}),n}function nG(e,t,n,r,i=!1){if(k(e)){e.forEach((e,l)=>nG(e,t&&(k(t)?t[l]:t),n,r,i));return}if(rn(r)&&!i){512&r.shapeFlag&&r.type.__asyncResolved&&r.component.subTree.component&&nG(e,t,n,r.component.subTree);return}let l=4&r.shapeFlag?lH(r.component):r.el,s=i?null:l,{i:o,r:a}=e,c=t&&t.r,u=o.refs===h?o.refs={}:o.refs,d=o.setupState,p=tw(d),f=d===h?()=>!1:e=>T(p,e);if(null!=c&&c!==a&&(I(c)?(u[c]=null,f(c)&&(d[c]=null)):tR(c)&&(c.value=null)),R(a))t3(a,o,12,[s,u]);else{let t=I(a),r=tR(a);if(t||r){let o=()=>{if(e.f){let n=t?f(a)?d[a]:u[a]:a.value;i?k(n)&&x(n,l):k(n)?n.includes(l)||n.push(l):t?(u[a]=[l],f(a)&&(d[a]=u[a])):(a.value=[l],e.k&&(u[e.k]=a.value))}else t?(u[a]=s,f(a)&&(d[a]=s)):r&&(a.value=s,e.k&&(u[e.k]=s))};s?(o.id=-1,iw(o,n)):o()}}}let nQ=!1,nX=()=>{nQ||(console.error("Hydration completed but contains mismatches."),nQ=!0)},nZ=e=>e.namespaceURI.includes("svg")&&"foreignObject"!==e.tagName,nY=e=>e.namespaceURI.includes("MathML"),n0=e=>{if(1===e.nodeType){if(nZ(e))return"svg";if(nY(e))return"mathml"}},n1=e=>8===e.nodeType;function n2(e){let{mt:t,p:n,o:{patchProp:r,createText:i,nextSibling:l,parentNode:s,remove:o,insert:a,createComment:c}}=e,u=(n,r,o,c,b,_=!1)=>{_=_||!!r.dynamicChildren;let S=n1(n)&&"["===n.data,x=()=>h(n,r,o,c,b,S),{type:C,ref:T,shapeFlag:k,patchFlag:w}=r,N=n.nodeType;r.el=n,-2===w&&(_=!1,r.dynamicChildren=null);let E=null;switch(C){case i9:3!==N?""===r.children?(a(r.el=i(""),s(n),n),E=n):E=x():(n.data!==r.children&&(nX(),n.data=r.children),E=l(n));break;case i7:y(n)?(E=l(n),g(r.el=n.content.firstChild,n,o)):E=8!==N||S?x():l(n);break;case le:if(S&&(N=(n=l(n)).nodeType),1===N||3===N){E=n;let e=!r.children.length;for(let t=0;t{s=s||!!t.dynamicChildren;let{type:a,props:c,patchFlag:u,shapeFlag:d,dirs:f,transition:h}=t,m="input"===a||"option"===a;if(m||-1!==u){let a;f&&nv(t,null,n,"created");let _=!1;if(y(e)){_=iO(null,h)&&n&&n.vnode.props&&n.vnode.props.appear;let r=e.content.firstChild;_&&h.beforeEnter(r),g(r,e,n),t.el=e=r}if(16&d&&!(c&&(c.innerHTML||c.textContent))){let r=p(e.firstChild,t,e,n,i,l,s);for(;r;){n4(e,1)||nX();let t=r;r=r.nextSibling,o(t)}}else if(8&d){let n=t.children;"\n"===n[0]&&("PRE"===e.tagName||"TEXTAREA"===e.tagName)&&(n=n.slice(1)),e.textContent!==n&&(n4(e,0)||nX(),e.textContent=t.children)}if(c){if(m||!s||48&u){let t=e.tagName.includes("-");for(let i in c)(m&&(i.endsWith("value")||"indeterminate"===i)||b(i)&&!B(i)||"."===i[0]||t)&&r(e,i,null,c[i],void 0,n)}else if(c.onClick)r(e,"onClick",null,c.onClick,void 0,n);else if(4&u&&tx(c.style))for(let e in c.style)c.style[e]}(a=c&&c.onVnodeBeforeMount)&&lw(a,n,t),f&&nv(t,null,n,"beforeMount"),((a=c&&c.onVnodeMounted)||f||_)&&i4(()=>{a&&lw(a,n,t),_&&h.enter(e),f&&nv(t,null,n,"mounted")},i)}return e.nextSibling},p=(e,t,r,s,o,c,d)=>{d=d||!!t.dynamicChildren;let p=t.children,f=p.length;for(let t=0;t{let{slotScopeIds:u}=t;u&&(i=i?i.concat(u):u);let d=s(e),f=p(l(e),t,d,n,r,i,o);return f&&n1(f)&&"]"===f.data?l(t.anchor=f):(nX(),a(t.anchor=c("]"),d,f),f)},h=(e,t,r,i,a,c)=>{if(n4(e.parentElement,1)||nX(),t.el=null,c){let t=m(e);for(;;){let n=l(e);if(n&&n!==t)o(n);else break}}let u=l(e),d=s(e);return o(e),n(null,t,d,u,r,i,n0(d),a),r&&(r.vnode.el=t.el,iZ(r,t.el)),u},m=(e,t="[",n="]")=>{let r=0;for(;e;)if((e=l(e))&&n1(e)&&(e.data===t&&r++,e.data===n)){if(0===r)return l(e);r--}return e},g=(e,t,n)=>{let r=t.parentNode;r&&r.replaceChild(e,t);let i=n;for(;i;)i.vnode.el===t&&(i.vnode.el=i.subTree.el=e),i=i.parent},y=e=>1===e.nodeType&&"TEMPLATE"===e.tagName;return[(e,t)=>{if(!t.hasChildNodes()){n(null,e,t),na(),t._vnode=e;return}u(t.firstChild,e,null,null,null),na(),t._vnode=e},u]}let n3="data-allow-mismatch",n6={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function n4(e,t){if(0===t||1===t)for(;e&&!e.hasAttribute(n3);)e=e.parentElement;let n=e&&e.getAttribute(n3);if(null==n)return!1;if(""===n)return!0;{let e=n.split(",");return!!(0===t&&e.includes("children"))||n.split(",").includes(n6[t])}}let n8=ee().requestIdleCallback||(e=>setTimeout(e,1)),n5=ee().cancelIdleCallback||(e=>clearTimeout(e)),n9=(e=1e4)=>t=>{let n=n8(t,{timeout:e});return()=>n5(n)},n7=e=>(t,n)=>{let r=new IntersectionObserver(e=>{for(let n of e)if(n.isIntersecting){r.disconnect(),t();break}},e);return n(e=>{if(e instanceof Element){if(function(e){let{top:t,left:n,bottom:r,right:i}=e.getBoundingClientRect(),{innerHeight:l,innerWidth:s}=window;return(t>0&&t0&&r0&&n0&&ir.disconnect()},re=e=>t=>{if(e){let n=matchMedia(e);if(!n.matches)return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t);t()}},rt=(e=[])=>(t,n)=>{I(e)&&(e=[e]);let r=!1,i=e=>{r||(r=!0,l(),t(),e.target.dispatchEvent(new e.constructor(e.type,e)))},l=()=>{n(t=>{for(let n of e)t.removeEventListener(n,i)})};return n(t=>{for(let n of e)t.addEventListener(n,i,{once:!0})}),l},rn=e=>!!e.type.__asyncLoader;function rr(e){let t;R(e)&&(e={loader:e});let{loader:n,loadingComponent:r,errorComponent:i,delay:l=200,hydrate:s,timeout:o,suspensible:a=!0,onError:c}=e,u=null,d=0,p=()=>(d++,u=null,f()),f=()=>{let e;return u||(e=u=n().catch(e=>{if(e=e instanceof Error?e:Error(String(e)),c)return new Promise((t,n)=>{c(e,()=>t(p()),()=>n(e),d+1)});throw e}).then(n=>e!==u&&u?u:(n&&(n.__esModule||"Module"===n[Symbol.toStringTag])&&(n=n.default),t=n,n)))};return nW({name:"AsyncComponentWrapper",__asyncLoader:f,__asyncHydrate(e,n,r){let i=s?()=>{let t=s(r,t=>(function(e,t){if(n1(e)&&"["===e.data){let n=1,r=e.nextSibling;for(;r;){if(1===r.nodeType){if(!1===t(r))break}else if(n1(r)){if("]"===r.data){if(0==--n)break}else"["===r.data&&n++}r=r.nextSibling}}else t(e)})(e,t));t&&(n.bum||(n.bum=[])).push(t)}:r;t?i():f().then(()=>!n.isUnmounted&&i())},get __asyncResolved(){return t},setup(){let e=lR;if(nz(e),t)return()=>ri(t,e);let n=t=>{u=null,t4(t,e,13,!i)};if(a&&e.suspense||lD)return f().then(t=>()=>ri(t,e)).catch(e=>(n(e),()=>i?lg(i,{error:e}):null));let s=tI(!1),c=tI(),d=tI(!!l);return l&&setTimeout(()=>{d.value=!1},l),null!=o&&setTimeout(()=>{if(!s.value&&!c.value){let e=Error(`Async component timed out after ${o}ms.`);n(e),c.value=e}},o),f().then(()=>{s.value=!0,e.parent&&rl(e.parent.vnode)&&e.parent.update()}).catch(e=>{n(e),c.value=e}),()=>s.value&&t?ri(t,e):c.value&&i?lg(i,{error:c.value}):r&&!d.value?lg(r):void 0}})}function ri(e,t){let{ref:n,props:r,children:i,ce:l}=t.vnode,s=lg(e,r,i);return s.ref=n,s.ce=l,delete t.vnode.ce,s}let rl=e=>e.type.__isKeepAlive,rs={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){let n=lI(),r=n.ctx;if(!r.renderer)return()=>{let e=t.default&&t.default();return e&&1===e.length?e[0]:e};let i=new Map,l=new Set,s=null,o=n.suspense,{renderer:{p:a,m:c,um:u,o:{createElement:d}}}=r,p=d("div");function f(e){rd(e),u(e,n,o,!0)}function h(e){i.forEach((t,n)=>{let r=lq(t.type);r&&!e(r)&&m(n)})}function m(e){let t=i.get(e);!t||s&&ld(t,s)?s&&rd(s):f(t),i.delete(e),l.delete(e)}r.activate=(e,t,n,r,i)=>{let l=e.component;c(e,t,n,0,o),a(l.vnode,e,t,n,l,o,r,e.slotScopeIds,i),iw(()=>{l.isDeactivated=!1,l.a&&Q(l.a);let t=e.props&&e.props.onVnodeMounted;t&&lw(t,l.parent,e)},o)},r.deactivate=e=>{let t=e.component;iM(t.m),iM(t.a),c(e,p,null,1,o),iw(()=>{t.da&&Q(t.da);let n=e.props&&e.props.onVnodeUnmounted;n&&lw(n,t.parent,e),t.isDeactivated=!0},o)},iB(()=>[e.include,e.exclude],([e,t])=>{e&&h(t=>ro(e,t)),t&&h(e=>!ro(t,e))},{flush:"post",deep:!0});let g=null,y=()=>{null!=g&&(iY(n.subTree.type)?iw(()=>{i.set(g,rp(n.subTree))},n.subTree.suspense):i.set(g,rp(n.subTree)))};return rg(y),rv(y),rb(()=>{i.forEach(e=>{let{subTree:t,suspense:r}=n,i=rp(t);if(e.type===i.type&&e.key===i.key){rd(i);let e=i.component.da;e&&iw(e,r);return}f(e)})}),()=>{if(g=null,!t.default)return s=null;let n=t.default(),r=n[0];if(n.length>1)return s=null,n;if(!lu(r)||!(4&r.shapeFlag)&&!(128&r.shapeFlag))return s=null,r;let o=rp(r);if(o.type===i7)return s=null,o;let a=o.type,c=lq(rn(o)?o.type.__asyncResolved||{}:a),{include:u,exclude:d,max:p}=e;if(u&&(!c||!ro(u,c))||d&&c&&ro(d,c))return o.shapeFlag&=-257,s=o,r;let f=null==o.key?a:o.key,h=i.get(f);return o.el&&(o=lv(o),128&r.shapeFlag&&(r.ssContent=o)),g=f,h?(o.el=h.el,o.component=h.component,o.transition&&nH(o,o.transition),o.shapeFlag|=512,l.delete(f),l.add(f)):(l.add(f),p&&l.size>parseInt(p,10)&&m(l.values().next().value)),o.shapeFlag|=256,s=o,iY(r.type)?r:o}}};function ro(e,t){return k(e)?e.some(e=>ro(e,t)):I(e)?e.split(",").includes(t):!!A(e)&&(e.lastIndex=0,e.test(t))}function ra(e,t){ru(e,"a",t)}function rc(e,t){ru(e,"da",t)}function ru(e,t,n=lR){let r=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()});if(rf(t,r,n),n){let e=n.parent;for(;e&&e.parent;)rl(e.parent.vnode)&&function(e,t,n,r){let i=rf(t,e,r,!0);r_(()=>{x(r[t],i)},n)}(r,t,n,e),e=e.parent}}function rd(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function rp(e){return 128&e.shapeFlag?e.ssContent:e}function rf(e,t,n=lR,r=!1){if(n){let i=n[e]||(n[e]=[]),l=t.__weh||(t.__weh=(...r)=>{eF();let i=lO(n),l=t6(t,n,e,r);return i(),eV(),l});return r?i.unshift(l):i.push(l),l}}let rh=e=>(t,n=lR)=>{lD&&"sp"!==e||rf(e,(...e)=>t(...e),n)},rm=rh("bm"),rg=rh("m"),ry=rh("bu"),rv=rh("u"),rb=rh("bum"),r_=rh("um"),rS=rh("sp"),rx=rh("rtg"),rC=rh("rtc");function rT(e,t=lR){rf("ec",e,t)}let rk="components";function rw(e,t){return rR(rk,e,!0,t)||e}let rN=Symbol.for("v-ndc");function rE(e){return I(e)?rR(rk,e,!1)||e:e||rN}function rA(e){return rR("directives",e)}function rR(e,t,n=!0,r=!1){let i=nu||lR;if(i){let n=i.type;if(e===rk){let e=lq(n,!1);if(e&&(e===t||e===q(t)||e===z(q(t))))return n}let l=rI(i[e]||n[e],t)||rI(i.appContext[e],t);return!l&&r?n:l}}function rI(e,t){return e&&(e[t]||e[q(t)]||e[z(q(t))])}function rO(e,t,n,r){let i;let l=n&&n[r],s=k(e);if(s||I(e)){let n=s&&tx(e),r=!1;n&&(r=!tT(e),e=eX(e)),i=Array(e.length);for(let n=0,s=e.length;nt(e,n,void 0,l&&l[n]));else{let n=Object.keys(e);i=Array(n.length);for(let r=0,s=n.length;r{let t=r.fn(...e);return t&&(t.key=r.key),t}:r.fn)}return e}function rM(e,t,n={},r,i){if(nu.ce||nu.parent&&rn(nu.parent)&&nu.parent.ce)return"default"!==t&&(n.name=t),lr(),lc(i5,null,[lg("slot",n,r&&r())],64);let l=e[t];l&&l._c&&(l._d=!1),lr();let s=l&&rD(l(n)),o=n.key||s&&s.key,a=lc(i5,{key:(o&&!O(o)?o:`_${t}`)+(!s&&r?"_fb":"")},s||(r?r():[]),s&&1===e._?64:-2);return!i&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),l&&l._c&&(l._d=!0),a}function rD(e){return e.some(e=>!lu(e)||!!(e.type!==i7&&(e.type!==i5||rD(e.children))))?e:null}function rL(e,t){let n={};for(let r in e)n[t&&/[A-Z]/.test(r)?`on:${r}`:J(r)]=e[r];return n}let r$=e=>e?lM(e)?lH(e):r$(e.parent):null,rF=S(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>r$(e.parent),$root:e=>r$(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>r4(e),$forceUpdate:e=>e.f||(e.f=()=>{ni(e.update)}),$nextTick:e=>e.n||(e.n=nr.bind(e.proxy)),$watch:e=>ij.bind(e)}),rV=(e,t)=>e!==h&&!e.__isScriptSetup&&T(e,t),rB={get({_:e},t){let n,r,i;if("__v_skip"===t)return!0;let{ctx:l,setupState:s,data:o,props:a,accessCache:c,type:u,appContext:d}=e;if("$"!==t[0]){let r=c[t];if(void 0!==r)switch(r){case 1:return s[t];case 2:return o[t];case 4:return l[t];case 3:return a[t]}else{if(rV(s,t))return c[t]=1,s[t];if(o!==h&&T(o,t))return c[t]=2,o[t];if((n=e.propsOptions[0])&&T(n,t))return c[t]=3,a[t];if(l!==h&&T(l,t))return c[t]=4,l[t];r3&&(c[t]=0)}}let p=rF[t];return p?("$attrs"===t&&eJ(e.attrs,"get",""),p(e)):(r=u.__cssModules)&&(r=r[t])?r:l!==h&&T(l,t)?(c[t]=4,l[t]):T(i=d.config.globalProperties,t)?i[t]:void 0},set({_:e},t,n){let{data:r,setupState:i,ctx:l}=e;return rV(i,t)?(i[t]=n,!0):r!==h&&T(r,t)?(r[t]=n,!0):!T(e.props,t)&&!("$"===t[0]&&t.slice(1)in e)&&(l[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:i,propsOptions:l}},s){let o;return!!n[s]||e!==h&&T(e,s)||rV(t,s)||(o=l[0])&&T(o,s)||T(r,s)||T(rF,s)||T(i.config.globalProperties,s)},defineProperty(e,t,n){return null!=n.get?e._.accessCache[t]=0:T(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},rU=S({},rB,{get(e,t){if(t!==Symbol.unscopables)return rB.get(e,t,e)},has:(e,t)=>"_"!==t[0]&&!et(t)});function rj(){return null}function rH(){return null}function rq(e){}function rW(e){}function rK(){return null}function rz(){}function rJ(e,t){return null}function rG(){return rX().slots}function rQ(){return rX().attrs}function rX(){let e=lI();return e.setupContext||(e.setupContext=lj(e))}function rZ(e){return k(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}function rY(e,t){let n=rZ(e);for(let e in t){if(e.startsWith("__skip"))continue;let r=n[e];r?k(r)||R(r)?r=n[e]={type:r,default:t[e]}:r.default=t[e]:null===r&&(r=n[e]={default:t[e]}),r&&t[`__skip_${e}`]&&(r.skipFactory=!0)}return n}function r0(e,t){return e&&t?k(e)&&k(t)?e.concat(t):S({},rZ(e),rZ(t)):e||t}function r1(e,t){let n={};for(let r in e)t.includes(r)||Object.defineProperty(n,r,{enumerable:!0,get:()=>e[r]});return n}function r2(e){let t=lI(),n=e();return lP(),M(n)&&(n=n.catch(e=>{throw lO(t),e})),[n,()=>lO(t)]}let r3=!0;function r6(e,t,n){t6(k(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function r4(e){let t;let n=e.type,{mixins:r,extends:i}=n,{mixins:l,optionsCache:s,config:{optionMergeStrategies:o}}=e.appContext,a=s.get(n);return a?t=a:l.length||r||i?(t={},l.length&&l.forEach(e=>r8(t,e,o,!0)),r8(t,n,o)):t=n,P(n)&&s.set(n,t),t}function r8(e,t,n,r=!1){let{mixins:i,extends:l}=t;for(let s in l&&r8(e,l,n,!0),i&&i.forEach(t=>r8(e,t,n,!0)),t)if(r&&"expose"===s);else{let r=r5[s]||n&&n[s];e[s]=r?r(e[s],t[s]):t[s]}return e}let r5={data:r9,props:ir,emits:ir,methods:it,computed:it,beforeCreate:ie,created:ie,beforeMount:ie,mounted:ie,beforeUpdate:ie,updated:ie,beforeDestroy:ie,beforeUnmount:ie,destroyed:ie,unmounted:ie,activated:ie,deactivated:ie,errorCaptured:ie,serverPrefetch:ie,components:it,directives:it,watch:function(e,t){if(!e)return t;if(!t)return e;let n=S(Object.create(null),e);for(let r in t)n[r]=ie(e[r],t[r]);return n},provide:r9,inject:function(e,t){return it(r7(e),r7(t))}};function r9(e,t){return t?e?function(){return S(R(e)?e.call(this,this):e,R(t)?t.call(this,this):t)}:t:e}function r7(e){if(k(e)){let t={};for(let n=0;n1)return n&&R(t)?t.call(r&&r.proxy):t}}function ic(){return!!(lR||nu||is)}let iu={},id=()=>Object.create(iu),ip=e=>Object.getPrototypeOf(e)===iu;function ih(e,t,n,r){let i;let[l,s]=e.propsOptions,o=!1;if(t)for(let a in t){let c;if(B(a))continue;let u=t[a];l&&T(l,c=q(a))?s&&s.includes(c)?(i||(i={}))[c]=u:n[c]=u:iz(e.emitsOptions,a)||a in r&&u===r[a]||(r[a]=u,o=!0)}if(s){let t=tw(n),r=i||h;for(let i=0;i"_"===e[0]||"$stable"===e,ib=e=>k(e)?e.map(lx):[lx(e)],i_=(e,t,n)=>{if(t._n)return t;let r=ng((...e)=>ib(t(...e)),n);return r._c=!1,r},iS=(e,t,n)=>{let r=e._ctx;for(let n in e){if(iv(n))continue;let i=e[n];if(R(i))t[n]=i_(n,i,r);else if(null!=i){let e=ib(i);t[n]=()=>e}}},ix=(e,t)=>{let n=ib(t);e.slots.default=()=>n},iC=(e,t,n)=>{for(let r in t)(n||"_"!==r)&&(e[r]=t[r])},iT=(e,t,n)=>{let r=e.slots=id();if(32&e.vnode.shapeFlag){let e=t._;e?(iC(r,t,n),n&&X(r,"_",e,!0)):iS(t,r)}else t&&ix(e,t)},ik=(e,t,n)=>{let{vnode:r,slots:i}=e,l=!0,s=h;if(32&r.shapeFlag){let e=t._;e?n&&1===e?l=!1:iC(i,t,n):(l=!t.$stable,iS(t,i)),s=t}else t&&(ix(e,t),s={default:1});if(l)for(let e in i)iv(e)||null!=s[e]||delete i[e]},iw=i4;function iN(e){return iA(e)}function iE(e){return iA(e,n2)}function iA(e,t){var n;let r,i;ee().__VUE__=!0;let{insert:l,remove:s,patchProp:o,createElement:a,createText:c,createComment:u,setText:d,setElementText:p,parentNode:f,nextSibling:y,setScopeId:b=g,insertStaticContent:_}=e,x=(e,t,n,r=null,i=null,l=null,s,o=null,a=!!t.dynamicChildren)=>{if(e===t)return;e&&!ld(e,t)&&(r=ei(e),Z(e,i,l,!0),e=null),-2===t.patchFlag&&(a=!1,t.dynamicChildren=null);let{type:c,ref:u,shapeFlag:d}=t;switch(c){case i9:C(e,t,n,r);break;case i7:k(e,t,n,r);break;case le:null==e&&w(t,n,r,s);break;case i5:F(e,t,n,r,i,l,s,o,a);break;default:1&d?A(e,t,n,r,i,l,s,o,a):6&d?V(e,t,n,r,i,l,s,o,a):64&d?c.process(e,t,n,r,i,l,s,o,a,eo):128&d&&c.process(e,t,n,r,i,l,s,o,a,eo)}null!=u&&i&&nG(u,e&&e.ref,l,t||e,!t)},C=(e,t,n,r)=>{if(null==e)l(t.el=c(t.children),n,r);else{let n=t.el=e.el;t.children!==e.children&&d(n,t.children)}},k=(e,t,n,r)=>{null==e?l(t.el=u(t.children||""),n,r):t.el=e.el},w=(e,t,n,r)=>{[e.el,e.anchor]=_(e.children,t,n,r,e.el,e.anchor)},N=({el:e,anchor:t},n,r)=>{let i;for(;e&&e!==t;)i=y(e),l(e,n,r),e=i;l(t,n,r)},E=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=y(e),s(e),e=n;s(t)},A=(e,t,n,r,i,l,s,o,a)=>{"svg"===t.type?s="svg":"math"===t.type&&(s="mathml"),null==e?I(t,n,r,i,l,s,o,a):D(e,t,i,l,s,o,a)},I=(e,t,n,r,i,s,c,u)=>{let d,f;let{props:h,shapeFlag:m,transition:g,dirs:y}=e;if(d=e.el=a(e.type,s,h&&h.is,h),8&m?p(d,e.children):16&m&&M(e.children,d,null,r,i,iR(e,s),c,u),y&&nv(e,null,r,"created"),O(d,e,e.scopeId,c,r),h){for(let e in h)"value"===e||B(e)||o(d,e,null,h[e],s,r);"value"in h&&o(d,"value",null,h.value,s),(f=h.onVnodeBeforeMount)&&lw(f,r,e)}y&&nv(e,null,r,"beforeMount");let b=iO(i,g);b&&g.beforeEnter(d),l(d,t,n),((f=h&&h.onVnodeMounted)||b||y)&&iw(()=>{f&&lw(f,r,e),b&&g.enter(d),y&&nv(e,null,r,"mounted")},i)},O=(e,t,n,r,i)=>{if(n&&b(e,n),r)for(let t=0;t{for(let c=a;c{let a;let c=t.el=e.el,{patchFlag:u,dynamicChildren:d,dirs:f}=t;u|=16&e.patchFlag;let m=e.props||h,g=t.props||h;if(n&&iI(n,!1),(a=g.onVnodeBeforeUpdate)&&lw(a,n,t,e),f&&nv(t,e,n,"beforeUpdate"),n&&iI(n,!0),(m.innerHTML&&null==g.innerHTML||m.textContent&&null==g.textContent)&&p(c,""),d?L(e.dynamicChildren,d,c,n,r,iR(t,i),l):s||z(e,t,c,null,n,r,iR(t,i),l,!1),u>0){if(16&u)$(c,m,g,n,i);else if(2&u&&m.class!==g.class&&o(c,"class",null,g.class,i),4&u&&o(c,"style",m.style,g.style,i),8&u){let e=t.dynamicProps;for(let t=0;t{a&&lw(a,n,t,e),f&&nv(t,e,n,"updated")},r)},L=(e,t,n,r,i,l,s)=>{for(let o=0;o{if(t!==n){if(t!==h)for(let l in t)B(l)||l in n||o(e,l,t[l],null,i,r);for(let l in n){if(B(l))continue;let s=n[l],a=t[l];s!==a&&"value"!==l&&o(e,l,a,s,i,r)}"value"in n&&o(e,"value",t.value,n.value,i)}},F=(e,t,n,r,i,s,o,a,u)=>{let d=t.el=e?e.el:c(""),p=t.anchor=e?e.anchor:c(""),{patchFlag:f,dynamicChildren:h,slotScopeIds:m}=t;m&&(a=a?a.concat(m):m),null==e?(l(d,n,r),l(p,n,r),M(t.children||[],n,p,i,s,o,a,u)):f>0&&64&f&&h&&e.dynamicChildren?(L(e.dynamicChildren,h,n,i,s,o,a),(null!=t.key||i&&t===i.subTree)&&iP(e,t,!0)):z(e,t,n,p,i,s,o,a,u)},V=(e,t,n,r,i,l,s,o,a)=>{t.slotScopeIds=o,null==e?512&t.shapeFlag?i.ctx.activate(t,n,r,s,a):U(t,n,r,i,l,s,a):j(e,t,a)},U=(e,t,n,r,i,l,s)=>{let o=e.component=lA(e,r,i);rl(e)&&(o.ctx.renderer=eo),lL(o,!1,s),o.asyncDep?(i&&i.registerDep(o,H,s),e.el||k(null,o.subTree=lg(i7),t,n)):H(o,e,t,n,i,l,s)},j=(e,t,n)=>{let r=t.component=e.component;if(function(e,t,n){let{props:r,children:i,component:l}=e,{props:s,children:o,patchFlag:a}=t,c=l.emitsOptions;if(t.dirs||t.transition)return!0;if(!n||!(a>=0))return(!!i||!!o)&&(!o||!o.$stable)||r!==s&&(r?!s||iX(r,s,c):!!s);if(1024&a)return!0;if(16&a)return r?iX(r,s,c):!!s;if(8&a){let e=t.dynamicProps;for(let t=0;t{let a=()=>{if(e.isMounted){let t,{next:n,bu:r,u:i,parent:c,vnode:u}=e;{let t=function e(t){let n=t.subTree.component;if(n)return n.asyncDep&&!n.asyncResolved?n:e(n)}(e);if(t){n&&(n.el=u.el,W(e,n,o)),t.asyncDep.then(()=>{e.isUnmounted||a()});return}}let d=n;iI(e,!1),n?(n.el=u.el,W(e,n,o)):n=u,r&&Q(r),(t=n.props&&n.props.onVnodeBeforeUpdate)&&lw(t,c,n,u),iI(e,!0);let p=iJ(e),h=e.subTree;e.subTree=p,x(h,p,f(h.el),ei(h),e,l,s),n.el=p.el,null===d&&iZ(e,p.el),i&&iw(i,l),(t=n.props&&n.props.onVnodeUpdated)&&iw(()=>lw(t,c,n,u),l)}else{let o;let{el:a,props:c}=t,{bm:u,m:d,parent:p,root:f,type:h}=e,m=rn(t);if(iI(e,!1),u&&Q(u),!m&&(o=c&&c.onVnodeBeforeMount)&&lw(o,p,t),iI(e,!0),a&&i){let t=()=>{e.subTree=iJ(e),i(a,e.subTree,e,l,null)};m&&h.__asyncHydrate?h.__asyncHydrate(a,e,t):t()}else{f.ce&&f.ce._injectChildStyle(h);let i=e.subTree=iJ(e);x(null,i,n,r,e,l,s),t.el=i.el}if(d&&iw(d,l),!m&&(o=c&&c.onVnodeMounted)){let e=t;iw(()=>lw(o,p,e),l)}(256&t.shapeFlag||p&&rn(p.vnode)&&256&p.vnode.shapeFlag)&&e.a&&iw(e.a,l),e.isMounted=!0,t=n=r=null}};e.scope.on();let c=e.effect=new ek(a);e.scope.off();let u=e.update=c.run.bind(c),d=e.job=c.runIfDirty.bind(c);d.i=e,d.id=e.uid,c.scheduler=()=>ni(d),iI(e,!0),u()},W=(e,t,n)=>{t.component=e;let r=e.vnode.props;e.vnode=t,e.next=null,function(e,t,n,r){let{props:i,attrs:l,vnode:{patchFlag:s}}=e,o=tw(i),[a]=e.propsOptions,c=!1;if((r||s>0)&&!(16&s)){if(8&s){let n=e.vnode.dynamicProps;for(let r=0;r{let c=e&&e.children,u=e?e.shapeFlag:0,d=t.children,{patchFlag:f,shapeFlag:h}=t;if(f>0){if(128&f){G(c,d,n,r,i,l,s,o,a);return}if(256&f){J(c,d,n,r,i,l,s,o,a);return}}8&h?(16&u&&er(c,i,l),d!==c&&p(n,d)):16&u?16&h?G(c,d,n,r,i,l,s,o,a):er(c,i,l,!0):(8&u&&p(n,""),16&h&&M(d,n,r,i,l,s,o,a))},J=(e,t,n,r,i,l,s,o,a)=>{let c;e=e||m,t=t||m;let u=e.length,d=t.length,p=Math.min(u,d);for(c=0;cd?er(e,i,l,!0,!1,p):M(t,n,r,i,l,s,o,a,p)},G=(e,t,n,r,i,l,s,o,a)=>{let c=0,u=t.length,d=e.length-1,p=u-1;for(;c<=d&&c<=p;){let r=e[c],u=t[c]=a?lC(t[c]):lx(t[c]);if(ld(r,u))x(r,u,n,null,i,l,s,o,a);else break;c++}for(;c<=d&&c<=p;){let r=e[d],c=t[p]=a?lC(t[p]):lx(t[p]);if(ld(r,c))x(r,c,n,null,i,l,s,o,a);else break;d--,p--}if(c>d){if(c<=p){let e=p+1,d=ep)for(;c<=d;)Z(e[c],i,l,!0),c++;else{let f;let h=c,g=c,y=new Map;for(c=g;c<=p;c++){let e=t[c]=a?lC(t[c]):lx(t[c]);null!=e.key&&y.set(e.key,c)}let b=0,_=p-g+1,S=!1,C=0,T=Array(_);for(c=0;c<_;c++)T[c]=0;for(c=h;c<=d;c++){let r;let u=e[c];if(b>=_){Z(u,i,l,!0);continue}if(null!=u.key)r=y.get(u.key);else for(f=g;f<=p;f++)if(0===T[f-g]&&ld(u,t[f])){r=f;break}void 0===r?Z(u,i,l,!0):(T[r-g]=c+1,r>=C?C=r:S=!0,x(u,t[r],n,null,i,l,s,o,a),b++)}let k=S?function(e){let t,n,r,i,l;let s=e.slice(),o=[0],a=e.length;for(t=0;t>1]]0&&(s[t]=o[r-1]),o[r]=t)}}for(r=o.length,i=o[r-1];r-- >0;)o[r]=i,i=s[i];return o}(T):m;for(f=k.length-1,c=_-1;c>=0;c--){let e=g+c,d=t[e],p=e+1{let{el:s,type:o,transition:a,children:c,shapeFlag:u}=e;if(6&u){X(e.component.subTree,t,n,r);return}if(128&u){e.suspense.move(t,n,r);return}if(64&u){o.move(e,t,n,eo);return}if(o===i5){l(s,t,n);for(let e=0;ea.enter(s),i);else{let{leave:e,delayLeave:r,afterLeave:i}=a,o=()=>l(s,t,n),c=()=>{e(s,()=>{o(),i&&i()})};r?r(s,o,c):c()}}else l(s,t,n)},Z=(e,t,n,r=!1,i=!1)=>{let l;let{type:s,props:o,ref:a,children:c,dynamicChildren:u,shapeFlag:d,patchFlag:p,dirs:f,cacheIndex:h}=e;if(-2===p&&(i=!1),null!=a&&nG(a,null,n,e,!0),null!=h&&(t.renderCache[h]=void 0),256&d){t.ctx.deactivate(e);return}let m=1&d&&f,g=!rn(e);if(g&&(l=o&&o.onVnodeBeforeUnmount)&&lw(l,t,e),6&d)en(e.component,n,r);else{if(128&d){e.suspense.unmount(n,r);return}m&&nv(e,null,t,"beforeUnmount"),64&d?e.type.remove(e,t,n,eo,r):u&&!u.hasOnce&&(s!==i5||p>0&&64&p)?er(u,t,n,!1,!0):(s===i5&&384&p||!i&&16&d)&&er(c,t,n),r&&Y(e)}(g&&(l=o&&o.onVnodeUnmounted)||m)&&iw(()=>{l&&lw(l,t,e),m&&nv(e,null,t,"unmounted")},n)},Y=e=>{let{type:t,el:n,anchor:r,transition:i}=e;if(t===i5){et(n,r);return}if(t===le){E(e);return}let l=()=>{s(n),i&&!i.persisted&&i.afterLeave&&i.afterLeave()};if(1&e.shapeFlag&&i&&!i.persisted){let{leave:t,delayLeave:r}=i,s=()=>t(n,l);r?r(e.el,l,s):s()}else l()},et=(e,t)=>{let n;for(;e!==t;)n=y(e),s(e),e=n;s(t)},en=(e,t,n)=>{let{bum:r,scope:i,job:l,subTree:s,um:o,m:a,a:c}=e;iM(a),iM(c),r&&Q(r),i.stop(),l&&(l.flags|=8,Z(s,e,t,n)),o&&iw(o,t),iw(()=>{e.isUnmounted=!0},t),t&&t.pendingBranch&&!t.isUnmounted&&e.asyncDep&&!e.asyncResolved&&e.suspenseId===t.pendingId&&(t.deps--,0===t.deps&&t.resolve())},er=(e,t,n,r=!1,i=!1,l=0)=>{for(let s=l;s{if(6&e.shapeFlag)return ei(e.component.subTree);if(128&e.shapeFlag)return e.suspense.next();let t=y(e.anchor||e.el),n=t&&t[nb];return n?y(n):t},el=!1,es=(e,t,n)=>{null==e?t._vnode&&Z(t._vnode,null,null,!0):x(t._vnode||null,e,t,null,null,null,n),t._vnode=e,el||(el=!0,no(),na(),el=!1)},eo={p:x,um:Z,m:X,r:Y,mt:U,mc:M,pc:z,pbc:L,n:ei,o:e};return t&&([r,i]=t(eo)),{render:es,hydrate:r,createApp:(n=r,function(e,t=null){R(e)||(e=S({},e)),null==t||P(t)||(t=null);let r=ii(),i=new WeakSet,l=[],s=!1,o=r.app={_uid:il++,_component:e,_props:t,_container:null,_context:r,_instance:null,version:lQ,get config(){return r.config},set config(v){},use:(e,...t)=>(i.has(e)||(e&&R(e.install)?(i.add(e),e.install(o,...t)):R(e)&&(i.add(e),e(o,...t))),o),mixin:e=>(r.mixins.includes(e)||r.mixins.push(e),o),component:(e,t)=>t?(r.components[e]=t,o):r.components[e],directive:(e,t)=>t?(r.directives[e]=t,o):r.directives[e],mount(i,l,a){if(!s){let c=o._ceVNode||lg(e,t);return c.appContext=r,!0===a?a="svg":!1===a&&(a=void 0),l&&n?n(c,i):es(c,i,a),s=!0,o._container=i,i.__vue_app__=o,lH(c.component)}},onUnmount(e){l.push(e)},unmount(){s&&(t6(l,o._instance,16),es(null,o._container),delete o._container.__vue_app__)},provide:(e,t)=>(r.provides[e]=t,o),runWithContext(e){let t=is;is=o;try{return e()}finally{is=t}}};return o})}}function iR({type:e,props:t},n){return"svg"===n&&"foreignObject"===e||"mathml"===n&&"annotation-xml"===e&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function iI({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function iO(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function iP(e,t,n=!1){let r=e.children,i=t.children;if(k(r)&&k(i))for(let e=0;eia(iD);function i$(e,t){return iU(e,null,t)}function iF(e,t){return iU(e,null,{flush:"post"})}function iV(e,t){return iU(e,null,{flush:"sync"})}function iB(e,t,n){return iU(e,t,n)}function iU(e,t,n=h){let r;let{immediate:i,deep:l,flush:s,once:o}=n,a=S({},n),c=t&&i||!t&&"post"!==s;if(lD){if("sync"===s){let e=iL();r=e.__watcherHandles||(e.__watcherHandles=[])}else if(!c){let e=()=>{};return e.stop=g,e.resume=g,e.pause=g,e}}let u=lR;a.call=(e,t,n)=>t6(e,u,t,n);let p=!1;"post"===s?a.scheduler=e=>{iw(e,u&&u.suspense)}:"sync"!==s&&(p=!0,a.scheduler=(e,t)=>{t?e():ni(e)}),a.augmentJob=e=>{t&&(e.flags|=4),p&&(e.flags|=2,u&&(e.id=u.uid,e.i=u))};let f=function(e,t,n=h){let r,i,l,s;let{immediate:o,deep:a,once:c,scheduler:u,augmentJob:p,call:f}=n,m=e=>a?e:tT(e)||!1===a||0===a?t0(e,1):t0(e),y=!1,b=!1;if(tR(e)?(i=()=>e.value,y=tT(e)):tx(e)?(i=()=>m(e),y=!0):k(e)?(b=!0,y=e.some(e=>tx(e)||tT(e)),i=()=>e.map(e=>tR(e)?e.value:tx(e)?m(e):R(e)?f?f(e,2):e():void 0)):i=R(e)?t?f?()=>f(e,2):e:()=>{if(l){eF();try{l()}finally{eV()}}let t=d;d=r;try{return f?f(e,3,[s]):e(s)}finally{d=t}}:g,t&&a){let e=i,t=!0===a?1/0:a;i=()=>t0(e(),t)}let _=ex(),S=()=>{r.stop(),_&&_.active&&x(_.effects,r)};if(c&&t){let e=t;t=(...t)=>{e(...t),S()}}let C=b?Array(e.length).fill(tQ):tQ,T=e=>{if(1&r.flags&&(r.dirty||e)){if(t){let e=r.run();if(a||y||(b?e.some((e,t)=>G(e,C[t])):G(e,C))){l&&l();let n=d;d=r;try{let n=[e,C===tQ?void 0:b&&C[0]===tQ?[]:C,s];f?f(t,3,n):t(...n),C=e}finally{d=n}}}else r.run()}};return p&&p(T),(r=new ek(i)).scheduler=u?()=>u(T,!1):T,s=e=>tY(e,!1,r),l=r.onStop=()=>{let e=tX.get(r);if(e){if(f)f(e,4);else for(let t of e)t();tX.delete(r)}},t?o?T(!0):C=r.run():u?u(T.bind(null,!0),!0):r.run(),S.pause=r.pause.bind(r),S.resume=r.resume.bind(r),S.stop=S,S}(e,t,a);return lD&&(r?r.push(f):c&&f()),f}function ij(e,t,n){let r;let i=this.proxy,l=I(e)?e.includes(".")?iH(i,e):()=>i[e]:e.bind(i,i);R(t)?r=t:(r=t.handler,n=t);let s=lO(this),o=iU(l,r.bind(i),n);return s(),o}function iH(e,t){let n=t.split(".");return()=>{let t=e;for(let e=0;e{let a,c;let u=h;return iV(()=>{let t=e[i];G(a,t)&&(a=t,o())}),{get:()=>(s(),n.get?n.get(a):a),set(e){let s=n.set?n.set(e):e;if(!G(s,a)&&!(u!==h&&G(e,u)))return;let d=r.vnode.props;d&&(t in d||i in d||l in d)&&(`onUpdate:${t}`in d||`onUpdate:${i}`in d||`onUpdate:${l}`in d)||(a=e,o()),r.emit(`update:${t}`,s),G(e,s)&&G(e,u)&&!G(s,c)&&o(),u=e,c=s}}});return o[Symbol.iterator]=()=>{let e=0;return{next:()=>e<2?{value:e++?s||h:o,done:!1}:{done:!0}}},o}let iW=(e,t)=>"modelValue"===t||"model-value"===t?e.modelModifiers:e[`${t}Modifiers`]||e[`${q(t)}Modifiers`]||e[`${K(t)}Modifiers`];function iK(e,t,...n){let r;if(e.isUnmounted)return;let i=e.vnode.props||h,l=n,s=t.startsWith("update:"),o=s&&iW(i,t.slice(7));o&&(o.trim&&(l=n.map(e=>I(e)?e.trim():e)),o.number&&(l=n.map(Z)));let a=i[r=J(t)]||i[r=J(q(t))];!a&&s&&(a=i[r=J(K(t))]),a&&t6(a,e,6,l);let c=i[r+"Once"];if(c){if(e.emitted){if(e.emitted[r])return}else e.emitted={};e.emitted[r]=!0,t6(c,e,6,l)}}function iz(e,t){return!!(e&&b(t))&&(T(e,(t=t.slice(2).replace(/Once$/,""))[0].toLowerCase()+t.slice(1))||T(e,K(t))||T(e,t))}function iJ(e){let t,n;let{type:r,vnode:i,proxy:l,withProxy:s,propsOptions:[o],slots:a,attrs:c,emit:u,render:d,renderCache:p,props:f,data:h,setupState:m,ctx:g,inheritAttrs:y}=e,b=np(e);try{if(4&i.shapeFlag){let e=s||l;t=lx(d.call(e,e,p,f,m,h,g)),n=c}else t=lx(r.length>1?r(f,{attrs:c,slots:a,emit:u}):r(f,null)),n=r.props?c:iG(c)}catch(n){lt.length=0,t4(n,e,1),t=lg(i7)}let S=t;if(n&&!1!==y){let e=Object.keys(n),{shapeFlag:t}=S;e.length&&7&t&&(o&&e.some(_)&&(n=iQ(n,o)),S=lv(S,n,!1,!0))}return i.dirs&&((S=lv(S,null,!1,!0)).dirs=S.dirs?S.dirs.concat(i.dirs):i.dirs),i.transition&&nH(S,i.transition),t=S,np(b),t}let iG=e=>{let t;for(let n in e)("class"===n||"style"===n||b(n))&&((t||(t={}))[n]=e[n]);return t},iQ=(e,t)=>{let n={};for(let r in e)_(r)&&r.slice(9)in t||(n[r]=e[r]);return n};function iX(e,t,n){let r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let i=0;ie.__isSuspense,i0=0,i1={name:"Suspense",__isSuspense:!0,process(e,t,n,r,i,l,s,o,a,c){if(null==e)!function(e,t,n,r,i,l,s,o,a){let{p:c,o:{createElement:u}}=a,d=u("div"),p=e.suspense=i3(e,i,r,t,d,n,l,s,o,a);c(null,p.pendingBranch=e.ssContent,d,null,r,p,l,s),p.deps>0?(i2(e,"onPending"),i2(e,"onFallback"),c(null,e.ssFallback,t,n,r,null,l,s),i8(p,e.ssFallback)):p.resolve(!1,!0)}(t,n,r,i,l,s,o,a,c);else{if(l&&l.deps>0&&!e.suspense.isInFallback){t.suspense=e.suspense,t.suspense.vnode=t,t.el=e.el;return}!function(e,t,n,r,i,l,s,o,{p:a,um:c,o:{createElement:u}}){let d=t.suspense=e.suspense;d.vnode=t,t.el=e.el;let p=t.ssContent,f=t.ssFallback,{activeBranch:h,pendingBranch:m,isInFallback:g,isHydrating:y}=d;if(m)d.pendingBranch=p,ld(p,m)?(a(m,p,d.hiddenContainer,null,i,d,l,s,o),d.deps<=0?d.resolve():g&&!y&&(a(h,f,n,r,i,null,l,s,o),i8(d,f))):(d.pendingId=i0++,y?(d.isHydrating=!1,d.activeBranch=m):c(m,i,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u("div"),g?(a(null,p,d.hiddenContainer,null,i,d,l,s,o),d.deps<=0?d.resolve():(a(h,f,n,r,i,null,l,s,o),i8(d,f))):h&&ld(p,h)?(a(h,p,n,r,i,d,l,s,o),d.resolve(!0)):(a(null,p,d.hiddenContainer,null,i,d,l,s,o),d.deps<=0&&d.resolve()));else if(h&&ld(p,h))a(h,p,n,r,i,d,l,s,o),i8(d,p);else if(i2(t,"onPending"),d.pendingBranch=p,512&p.shapeFlag?d.pendingId=p.component.suspenseId:d.pendingId=i0++,a(null,p,d.hiddenContainer,null,i,d,l,s,o),d.deps<=0)d.resolve();else{let{timeout:e,pendingId:t}=d;e>0?setTimeout(()=>{d.pendingId===t&&d.fallback(f)},e):0===e&&d.fallback(f)}}(e,t,n,r,i,s,o,a,c)}},hydrate:function(e,t,n,r,i,l,s,o,a){let c=t.suspense=i3(t,r,n,e.parentNode,document.createElement("div"),null,i,l,s,o,!0),u=a(e,c.pendingBranch=t.ssContent,n,c,l,s);return 0===c.deps&&c.resolve(!1,!0),u},normalize:function(e){let{shapeFlag:t,children:n}=e,r=32&t;e.ssContent=i6(r?n.default:n),e.ssFallback=r?i6(n.fallback):lg(i7)}};function i2(e,t){let n=e.props&&e.props[t];R(n)&&n()}function i3(e,t,n,r,i,l,s,o,a,c,u=!1){let d;let{p:p,m:f,um:h,n:m,o:{parentNode:g,remove:y}}=c,b=function(e){let t=e.props&&e.props.suspensible;return null!=t&&!1!==t}(e);b&&t&&t.pendingBranch&&(d=t.pendingId,t.deps++);let _=e.props?Y(e.props.timeout):void 0,S=l,x={vnode:e,parent:t,parentComponent:n,namespace:s,container:r,hiddenContainer:i,deps:0,pendingId:i0++,timeout:"number"==typeof _?_:-1,activeBranch:null,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve(e=!1,n=!1){let{vnode:r,activeBranch:i,pendingBranch:s,pendingId:o,effects:a,parentComponent:c,container:u}=x,p=!1;x.isHydrating?x.isHydrating=!1:e||((p=i&&s.transition&&"out-in"===s.transition.mode)&&(i.transition.afterLeave=()=>{o===x.pendingId&&(f(s,u,l===S?m(i):l,0),ns(a))}),i&&(g(i.el)===u&&(l=m(i)),h(i,c,x,!0)),p||f(s,u,l,0)),i8(x,s),x.pendingBranch=null,x.isInFallback=!1;let y=x.parent,_=!1;for(;y;){if(y.pendingBranch){y.effects.push(...a),_=!0;break}y=y.parent}_||p||ns(a),x.effects=[],b&&t&&t.pendingBranch&&d===t.pendingId&&(t.deps--,0!==t.deps||n||t.resolve()),i2(r,"onResolve")},fallback(e){if(!x.pendingBranch)return;let{vnode:t,activeBranch:n,parentComponent:r,container:i,namespace:l}=x;i2(t,"onFallback");let s=m(n),c=()=>{x.isInFallback&&(p(null,e,i,s,r,null,l,o,a),i8(x,e))},u=e.transition&&"out-in"===e.transition.mode;u&&(n.transition.afterLeave=c),x.isInFallback=!0,h(n,r,null,!0),u||c()},move(e,t,n){x.activeBranch&&f(x.activeBranch,e,t,n),x.container=e},next:()=>x.activeBranch&&m(x.activeBranch),registerDep(e,t,n){let r=!!x.pendingBranch;r&&x.deps++;let i=e.vnode.el;e.asyncDep.catch(t=>{t4(t,e,0)}).then(l=>{if(e.isUnmounted||x.isUnmounted||x.pendingId!==e.suspenseId)return;e.asyncResolved=!0;let{vnode:o}=e;l$(e,l,!1),i&&(o.el=i);let a=!i&&e.subTree.el;t(e,o,g(i||e.subTree.el),i?null:m(e.subTree),x,s,n),a&&y(a),iZ(e,o.el),r&&0==--x.deps&&x.resolve()})},unmount(e,t){x.isUnmounted=!0,x.activeBranch&&h(x.activeBranch,n,e,t),x.pendingBranch&&h(x.pendingBranch,n,e,t)}};return x}function i6(e){let t;if(R(e)){let n=ll&&e._c;n&&(e._d=!1,lr()),e=e(),n&&(e._d=!0,t=ln,li())}return k(e)&&(e=function(e,t=!0){let n;for(let t=0;tt!==e)),e}function i4(e,t){t&&t.pendingBranch?k(e)?t.effects.push(...e):t.effects.push(e):ns(e)}function i8(e,t){e.activeBranch=t;let{vnode:n,parentComponent:r}=e,i=t.el;for(;!i&&t.component;)i=(t=t.component.subTree).el;n.el=i,r&&r.subTree===n&&(r.vnode.el=i,iZ(r,i))}let i5=Symbol.for("v-fgt"),i9=Symbol.for("v-txt"),i7=Symbol.for("v-cmt"),le=Symbol.for("v-stc"),lt=[],ln=null;function lr(e=!1){lt.push(ln=e?null:[])}function li(){lt.pop(),ln=lt[lt.length-1]||null}let ll=1;function ls(e,t=!1){ll+=e,e<0&&ln&&t&&(ln.hasOnce=!0)}function lo(e){return e.dynamicChildren=ll>0?ln||m:null,li(),ll>0&&ln&&ln.push(e),e}function la(e,t,n,r,i,l){return lo(lm(e,t,n,r,i,l,!0))}function lc(e,t,n,r,i){return lo(lg(e,t,n,r,i,!0))}function lu(e){return!!e&&!0===e.__v_isVNode}function ld(e,t){return e.type===t.type&&e.key===t.key}function lp(e){}let lf=({key:e})=>null!=e?e:null,lh=({ref:e,ref_key:t,ref_for:n})=>("number"==typeof e&&(e=""+e),null!=e?I(e)||tR(e)||R(e)?{i:nu,r:e,k:t,f:!!n}:e:null);function lm(e,t=null,n=null,r=0,i=null,l=e===i5?0:1,s=!1,o=!1){let a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&lf(t),ref:t&&lh(t),scopeId:nd,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:l,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:nu};return o?(lT(a,n),128&l&&e.normalize(a)):n&&(a.shapeFlag|=I(n)?8:16),ll>0&&!s&&ln&&(a.patchFlag>0||6&l)&&32!==a.patchFlag&&ln.push(a),a}let lg=function(e,t=null,n=null,r=0,i=null,l=!1){var s;if(e&&e!==rN||(e=i7),lu(e)){let r=lv(e,t,!0);return n&&lT(r,n),ll>0&&!l&&ln&&(6&r.shapeFlag?ln[ln.indexOf(e)]=r:ln.push(r)),r.patchFlag=-2,r}if(R(s=e)&&"__vccOpts"in s&&(e=e.__vccOpts),t){let{class:e,style:n}=t=ly(t);e&&!I(e)&&(t.class=eo(e)),P(n)&&(tk(n)&&!k(n)&&(n=S({},n)),t.style=en(n))}let o=I(e)?1:iY(e)?128:n_(e)?64:P(e)?4:R(e)?2:0;return lm(e,t,n,r,i,o,l,!0)};function ly(e){return e?tk(e)||ip(e)?S({},e):e:null}function lv(e,t,n=!1,r=!1){let{props:i,ref:l,patchFlag:s,children:o,transition:a}=e,c=t?lk(i||{},t):i,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&lf(c),ref:t&&t.ref?n&&l?k(l)?l.concat(lh(t)):[l,lh(t)]:lh(t):l,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:o,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==i5?-1===s?16:16|s:s,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&lv(e.ssContent),ssFallback:e.ssFallback&&lv(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&r&&nH(u,a.clone(u)),u}function lb(e=" ",t=0){return lg(i9,null,e,t)}function l_(e,t){let n=lg(le,null,e);return n.staticCount=t,n}function lS(e="",t=!1){return t?(lr(),lc(i7,null,e)):lg(i7,null,e)}function lx(e){return null==e||"boolean"==typeof e?lg(i7):k(e)?lg(i5,null,e.slice()):lu(e)?lC(e):lg(i9,null,String(e))}function lC(e){return null===e.el&&-1!==e.patchFlag||e.memo?e:lv(e)}function lT(e,t){let n=0,{shapeFlag:r}=e;if(null==t)t=null;else if(k(t))n=16;else if("object"==typeof t){if(65&r){let n=t.default;n&&(n._c&&(n._d=!1),lT(e,n()),n._c&&(n._d=!0));return}{n=32;let r=t._;r||ip(t)?3===r&&nu&&(1===nu.slots._?t._=1:(t._=2,e.patchFlag|=1024)):t._ctx=nu}}else R(t)?(t={default:t,_ctx:nu},n=32):(t=String(t),64&r?(n=16,t=[lb(t)]):n=8);e.children=t,e.shapeFlag|=n}function lk(...e){let t={};for(let n=0;n{c=!0;let[r,i]=e(t,n,!0);S(o,r),i&&a.push(...i)};!r&&n.mixins.length&&n.mixins.forEach(i),t.extends&&i(t.extends),t.mixins&&t.mixins.forEach(i)}if(!s&&!c)return P(t)&&i.set(t,m),m;if(k(s))for(let e=0;e{let r=e(t,n,!0);r&&(a=!0,S(o,r))};!r&&n.mixins.length&&n.mixins.forEach(i),t.extends&&i(t.extends),t.mixins&&t.mixins.forEach(i)}return s||a?(k(s)?s.forEach(e=>o[e]=null):S(o,s),P(t)&&i.set(t,o),o):(P(t)&&i.set(t,null),null)}(r,i),emit:null,emitted:null,propsDefaults:h,inheritAttrs:r.inheritAttrs,ctx:h,data:h,props:h,attrs:h,slots:h,refs:h,setupState:h,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return l.ctx={_:l},l.root=t?t.root:l,l.emit=iK.bind(null,l),e.ce&&e.ce(l),l}let lR=null,lI=()=>lR||nu;{let e=ee(),t=(t,n)=>{let r;return(r=e[t])||(r=e[t]=[]),r.push(n),e=>{r.length>1?r.forEach(t=>t(e)):r[0](e)}};l=t("__VUE_INSTANCE_SETTERS__",e=>lR=e),s=t("__VUE_SSR_SETTERS__",e=>lD=e)}let lO=e=>{let t=lR;return l(e),e.scope.on(),()=>{e.scope.off(),l(t)}},lP=()=>{lR&&lR.scope.off(),l(null)};function lM(e){return 4&e.vnode.shapeFlag}let lD=!1;function lL(e,t=!1,n=!1){t&&s(t);let{props:r,children:i}=e.vnode,l=lM(e);!function(e,t,n,r=!1){let i={},l=id();for(let n in e.propsDefaults=Object.create(null),ih(e,t,i,l),e.propsOptions[0])n in i||(i[n]=void 0);n?e.props=r?i:tv(i):e.type.props?e.props=i:e.props=l,e.attrs=l}(e,r,l,t),iT(e,i,n);let o=l?function(e,t){let n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,rB);let{setup:r}=n;if(r){eF();let n=e.setupContext=r.length>1?lj(e):null,i=lO(e),l=t3(r,e,0,[e.props,n]),s=M(l);if(eV(),i(),(s||e.sp)&&!rn(e)&&nz(e),s){if(l.then(lP,lP),t)return l.then(n=>{l$(e,n,t)}).catch(t=>{t4(t,e,0)});e.asyncDep=l}else l$(e,l,t)}else lB(e,t)}(e,t):void 0;return t&&s(!1),o}function l$(e,t,n){R(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:P(t)&&(e.setupState=tV(t)),lB(e,n)}function lF(e){o=e,a=e=>{e.render._rc&&(e.withProxy=new Proxy(e.ctx,rU))}}let lV=()=>!o;function lB(e,t,n){let r=e.type;if(!e.render){if(!t&&o&&!r.render){let t=r.template||r4(e).template;if(t){let{isCustomElement:n,compilerOptions:i}=e.appContext.config,{delimiters:l,compilerOptions:s}=r,a=S(S({isCustomElement:n,delimiters:l},i),s);r.render=o(t,a)}}e.render=r.render||g,a&&a(e)}{let t=lO(e);eF();try{!function(e){let t=r4(e),n=e.proxy,r=e.ctx;r3=!1,t.beforeCreate&&r6(t.beforeCreate,e,"bc");let{data:i,computed:l,methods:s,watch:o,provide:a,inject:c,created:u,beforeMount:d,mounted:p,beforeUpdate:f,updated:h,activated:m,deactivated:y,beforeDestroy:b,beforeUnmount:_,destroyed:S,unmounted:x,render:C,renderTracked:T,renderTriggered:w,errorCaptured:N,serverPrefetch:E,expose:A,inheritAttrs:O,components:M,directives:D,filters:L}=t;if(c&&function(e,t,n=g){for(let n in k(e)&&(e=r7(e)),e){let r;let i=e[n];tR(r=P(i)?"default"in i?ia(i.from||n,i.default,!0):ia(i.from||n):ia(i))?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>r.value,set:e=>r.value=e}):t[n]=r}}(c,r,null),s)for(let e in s){let t=s[e];R(t)&&(r[e]=t.bind(n))}if(i){let t=i.call(n,n);P(t)&&(e.data=ty(t))}if(r3=!0,l)for(let e in l){let t=l[e],i=R(t)?t.bind(n,n):R(t.get)?t.get.bind(n,n):g,s=lW({get:i,set:!R(t)&&R(t.set)?t.set.bind(n):g});Object.defineProperty(r,e,{enumerable:!0,configurable:!0,get:()=>s.value,set:e=>s.value=e})}if(o)for(let e in o)!function e(t,n,r,i){let l=i.includes(".")?iH(r,i):()=>r[i];if(I(t)){let e=n[t];R(e)&&iB(l,e)}else if(R(t))iB(l,t.bind(r));else if(P(t)){if(k(t))t.forEach(t=>e(t,n,r,i));else{let e=R(t.handler)?t.handler.bind(r):n[t.handler];R(e)&&iB(l,e,t)}}}(o[e],r,n,e);if(a){let e=R(a)?a.call(n):a;Reflect.ownKeys(e).forEach(t=>{io(t,e[t])})}function $(e,t){k(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(u&&r6(u,e,"c"),$(rm,d),$(rg,p),$(ry,f),$(rv,h),$(ra,m),$(rc,y),$(rT,N),$(rC,T),$(rx,w),$(rb,_),$(r_,x),$(rS,E),k(A)){if(A.length){let t=e.exposed||(e.exposed={});A.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t})})}else e.exposed||(e.exposed={})}C&&e.render===g&&(e.render=C),null!=O&&(e.inheritAttrs=O),M&&(e.components=M),D&&(e.directives=D),E&&nz(e)}(e)}finally{eV(),t()}}}let lU={get:(e,t)=>(eJ(e,"get",""),e[t])};function lj(e){return{attrs:new Proxy(e.attrs,lU),slots:e.slots,emit:e.emit,expose:t=>{e.exposed=t||{}}}}function lH(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(tV(tN(e.exposed)),{get:(t,n)=>n in t?t[n]:n in rF?rF[n](e):void 0,has:(e,t)=>t in e||t in rF})):e.proxy}function lq(e,t=!0){return R(e)?e.displayName||e.name:e.name||t&&e.__name}let lW=(e,t)=>(function(e,t,n=!1){let r,i;return R(e)?r=e:(r=e.get,i=e.set),new tz(r,i,n)})(e,0,lD);function lK(e,t,n){let r=arguments.length;return 2!==r?(r>3?n=Array.prototype.slice.call(arguments,2):3===r&&lu(n)&&(n=[n]),lg(e,t,n)):!P(t)||k(t)?lg(e,null,t):lu(t)?lg(e,null,[t]):lg(e,t)}function lz(){}function lJ(e,t,n,r){let i=n[r];if(i&&lG(i,e))return i;let l=t();return l.memo=e.slice(),l.cacheIndex=r,n[r]=l}function lG(e,t){let n=e.memo;if(n.length!=t.length)return!1;for(let e=0;e0&&ln&&ln.push(e),!0}let lQ="3.5.13",lX=g,lZ=null,lY=void 0,l0=g,l1={createComponentInstance:lA,setupComponent:lL,renderComponentRoot:iJ,setCurrentRenderingInstance:np,isVNode:lu,normalizeVNode:lx,getComponentPublicInstance:lH,ensureValidVNode:rD,pushWarningContext:function(e){},popWarningContext:function(){}},l2=null,l3=null,l6=null,l4="undefined"!=typeof window&&window.trustedTypes;if(l4)try{p=l4.createPolicy("vue",{createHTML:e=>e})}catch(e){}let l8=p?e=>p.createHTML(e):e=>e,l5="undefined"!=typeof document?document:null,l9=l5&&l5.createElement("template"),l7="transition",se="animation",st=Symbol("_vtc"),sn={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},sr=S({},nD,sn),si=((ox=(e,{slots:t})=>lK(nF,so(e),t)).displayName="Transition",ox.props=sr,ox),sl=(e,t=[])=>{k(e)?e.forEach(e=>e(...t)):e&&e(...t)},ss=e=>!!e&&(k(e)?e.some(e=>e.length>1):e.length>1);function so(e){let t={};for(let n in e)n in sn||(t[n]=e[n]);if(!1===e.css)return t;let{name:n="v",type:r,duration:i,enterFromClass:l=`${n}-enter-from`,enterActiveClass:s=`${n}-enter-active`,enterToClass:o=`${n}-enter-to`,appearFromClass:a=l,appearActiveClass:c=s,appearToClass:u=o,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:p=`${n}-leave-active`,leaveToClass:f=`${n}-leave-to`}=e,h=function(e){if(null==e)return null;if(P(e))return[Y(e.enter),Y(e.leave)];{let t=Y(e);return[t,t]}}(i),m=h&&h[0],g=h&&h[1],{onBeforeEnter:y,onEnter:b,onEnterCancelled:_,onLeave:x,onLeaveCancelled:C,onBeforeAppear:T=y,onAppear:k=b,onAppearCancelled:w=_}=t,N=(e,t,n,r)=>{e._enterCancelled=r,sc(e,t?u:o),sc(e,t?c:s),n&&n()},E=(e,t)=>{e._isLeaving=!1,sc(e,d),sc(e,f),sc(e,p),t&&t()},A=e=>(t,n)=>{let i=e?k:b,s=()=>N(t,e,n);sl(i,[t,s]),su(()=>{sc(t,e?a:l),sa(t,e?u:o),ss(i)||sp(t,r,m,s)})};return S(t,{onBeforeEnter(e){sl(y,[e]),sa(e,l),sa(e,s)},onBeforeAppear(e){sl(T,[e]),sa(e,a),sa(e,c)},onEnter:A(!1),onAppear:A(!0),onLeave(e,t){e._isLeaving=!0;let n=()=>E(e,t);sa(e,d),e._enterCancelled?(sa(e,p),sg()):(sg(),sa(e,p)),su(()=>{e._isLeaving&&(sc(e,d),sa(e,f),ss(x)||sp(e,r,g,n))}),sl(x,[e,n])},onEnterCancelled(e){N(e,!1,void 0,!0),sl(_,[e])},onAppearCancelled(e){N(e,!0,void 0,!0),sl(w,[e])},onLeaveCancelled(e){E(e),sl(C,[e])}})}function sa(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.add(t)),(e[st]||(e[st]=new Set)).add(t)}function sc(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.remove(t));let n=e[st];n&&(n.delete(t),n.size||(e[st]=void 0))}function su(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let sd=0;function sp(e,t,n,r){let i=e._endId=++sd,l=()=>{i===e._endId&&r()};if(null!=n)return setTimeout(l,n);let{type:s,timeout:o,propCount:a}=sf(e,t);if(!s)return r();let c=s+"end",u=0,d=()=>{e.removeEventListener(c,p),l()},p=t=>{t.target===e&&++u>=a&&d()};setTimeout(()=>{u(n[e]||"").split(", "),i=r(`${l7}Delay`),l=r(`${l7}Duration`),s=sh(i,l),o=r(`${se}Delay`),a=r(`${se}Duration`),c=sh(o,a),u=null,d=0,p=0;t===l7?s>0&&(u=l7,d=s,p=l.length):t===se?c>0&&(u=se,d=c,p=a.length):p=(u=(d=Math.max(s,c))>0?s>c?l7:se:null)?u===l7?l.length:a.length:0;let f=u===l7&&/\b(transform|all)(,|$)/.test(r(`${l7}Property`).toString());return{type:u,timeout:d,propCount:p,hasTransform:f}}function sh(e,t){for(;e.lengthsm(t)+sm(e[n])))}function sm(e){return"auto"===e?0:1e3*Number(e.slice(0,-1).replace(",","."))}function sg(){return document.body.offsetHeight}let sy=Symbol("_vod"),sv=Symbol("_vsh"),sb={beforeMount(e,{value:t},{transition:n}){e[sy]="none"===e.style.display?"":e.style.display,n&&t?n.beforeEnter(e):s_(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:r}){!t!=!n&&(r?t?(r.beforeEnter(e),s_(e,!0),r.enter(e)):r.leave(e,()=>{s_(e,!1)}):s_(e,t))},beforeUnmount(e,{value:t}){s_(e,t)}};function s_(e,t){e.style.display=t?e[sy]:"none",e[sv]=!t}let sS=Symbol("");function sx(e){let t=lI();if(!t)return;let n=t.ut=(n=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(e=>sC(e,n))},r=()=>{let r=e(t.proxy);t.ce?sC(t.ce,r):function e(t,n){if(128&t.shapeFlag){let r=t.suspense;t=r.activeBranch,r.pendingBranch&&!r.isHydrating&&r.effects.push(()=>{e(r.activeBranch,n)})}for(;t.component;)t=t.component.subTree;if(1&t.shapeFlag&&t.el)sC(t.el,n);else if(t.type===i5)t.children.forEach(t=>e(t,n));else if(t.type===le){let{el:e,anchor:r}=t;for(;e&&(sC(e,n),e!==r);)e=e.nextSibling}}(t.subTree,r),n(r)};ry(()=>{ns(r)}),rg(()=>{iB(r,g,{flush:"post"});let e=new MutationObserver(r);e.observe(t.subTree.el.parentNode,{childList:!0}),r_(()=>e.disconnect())})}function sC(e,t){if(1===e.nodeType){let n=e.style,r="";for(let e in t)n.setProperty(`--${e}`,t[e]),r+=`--${e}: ${t[e]};`;n[sS]=r}}let sT=/(^|;)\s*display\s*:/,sk=/\s*!important$/;function sw(e,t,n){if(k(n))n.forEach(n=>sw(e,t,n));else if(null==n&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{let r=function(e,t){let n=sE[t];if(n)return n;let r=q(t);if("filter"!==r&&r in e)return sE[t]=r;r=z(r);for(let n=0;nsD||(sL.then(()=>sD=0),sD=Date.now()),sF=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)>96&&123>e.charCodeAt(2),sV={};function sB(e,t,n){let r=nW(e,t);F(r)&&S(r,t);class i extends sH{constructor(e){super(r,e,n)}}return i.def=r,i}let sU=(e,t)=>sB(e,t,oy),sj="undefined"!=typeof HTMLElement?HTMLElement:class{};class sH extends sj{constructor(e,t={},n=og){super(),this._def=e,this._props=t,this._createApp=n,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._ob=null,this.shadowRoot&&n!==og?this._root=this.shadowRoot:!1!==e.shadowRoot?(this.attachShadow({mode:"open"}),this._root=this.shadowRoot):this._root=this,this._def.__asyncLoader||this._resolveProps(this._def)}connectedCallback(){if(!this.isConnected)return;this.shadowRoot||this._parseSlots(),this._connected=!0;let e=this;for(;e=e&&(e.parentNode||e.host);)if(e instanceof sH){this._parent=e;break}this._instance||(this._resolved?(this._setParent(),this._update()):e&&e._pendingResolve?this._pendingResolve=e._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(e=this._parent){e&&(this._instance.parent=e._instance,this._instance.provides=e._instance.provides)}disconnectedCallback(){this._connected=!1,nr(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null)})}_resolveDef(){if(this._pendingResolve)return;for(let e=0;e{for(let t of e)this._setAttr(t.attributeName)}),this._ob.observe(this,{attributes:!0});let e=(e,t=!1)=>{let n;this._resolved=!0,this._pendingResolve=void 0;let{props:r,styles:i}=e;if(r&&!k(r))for(let e in r){let t=r[e];(t===Number||t&&t.type===Number)&&(e in this._props&&(this._props[e]=Y(this._props[e])),(n||(n=Object.create(null)))[q(e)]=!0)}this._numberProps=n,t&&this._resolveProps(e),this.shadowRoot&&this._applyStyles(i),this._mount(e)},t=this._def.__asyncLoader;t?this._pendingResolve=t().then(t=>e(this._def=t,!0)):e(this._def)}_mount(e){this._app=this._createApp(e),e.configureApp&&e.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);let t=this._instance&&this._instance.exposed;if(t)for(let e in t)T(this,e)||Object.defineProperty(this,e,{get:()=>tL(t[e])})}_resolveProps(e){let{props:t}=e,n=k(t)?t:Object.keys(t||{});for(let e of Object.keys(this))"_"!==e[0]&&n.includes(e)&&this._setProp(e,this[e]);for(let e of n.map(q))Object.defineProperty(this,e,{get(){return this._getProp(e)},set(t){this._setProp(e,t,!0,!0)}})}_setAttr(e){if(e.startsWith("data-v-"))return;let t=this.hasAttribute(e),n=t?this.getAttribute(e):sV,r=q(e);t&&this._numberProps&&this._numberProps[r]&&(n=Y(n)),this._setProp(r,n,!1,!0)}_getProp(e){return this._props[e]}_setProp(e,t,n=!0,r=!1){if(t!==this._props[e]&&(t===sV?delete this._props[e]:(this._props[e]=t,"key"===e&&this._app&&(this._app._ceVNode.key=t)),r&&this._instance&&this._update(),n)){let n=this._ob;n&&n.disconnect(),!0===t?this.setAttribute(K(e),""):"string"==typeof t||"number"==typeof t?this.setAttribute(K(e),t+""):t||this.removeAttribute(K(e)),n&&n.observe(this,{attributes:!0})}}_update(){oh(this._createVNode(),this._root)}_createVNode(){let e={};this.shadowRoot||(e.onVnodeMounted=e.onVnodeUpdated=this._renderSlots.bind(this));let t=lg(this._def,S(e,this._props));return this._instance||(t.ce=e=>{this._instance=e,e.ce=this,e.isCE=!0;let t=(e,t)=>{this.dispatchEvent(new CustomEvent(e,F(t[0])?S({detail:t},t[0]):{detail:t}))};e.emit=(e,...n)=>{t(e,n),K(e)!==e&&t(K(e),n)},this._setParent()}),t}_applyStyles(e,t){if(!e)return;if(t){if(t===this._def||this._styleChildren.has(t))return;this._styleChildren.add(t)}let n=this._nonce;for(let t=e.length-1;t>=0;t--){let r=document.createElement("style");n&&r.setAttribute("nonce",n),r.textContent=e[t],this.shadowRoot.prepend(r)}}_parseSlots(){let e;let t=this._slots={};for(;e=this.firstChild;){let n=1===e.nodeType&&e.getAttribute("slot")||"default";(t[n]||(t[n]=[])).push(e),this.removeChild(e)}}_renderSlots(){let e=(this._teleportTarget||this).querySelectorAll("slot"),t=this._instance.type.__scopeId;for(let n=0;n{if(!n.length)return;let t=e.moveClass||`${e.name||"v"}-move`;if(!function(e,t,n){let r=e.cloneNode(),i=e[st];i&&i.forEach(e=>{e.split(/\s+/).forEach(e=>e&&r.classList.remove(e))}),n.split(/\s+/).forEach(e=>e&&r.classList.add(e)),r.style.display="none";let l=1===t.nodeType?t:t.parentNode;l.appendChild(r);let{hasTransform:s}=sf(r);return l.removeChild(r),s}(n[0].el,i.vnode.el,t))return;n.forEach(sZ),n.forEach(sY);let r=n.filter(s0);sg(),r.forEach(e=>{let n=e.el,r=n.style;sa(n,t),r.transform=r.webkitTransform=r.transitionDuration="";let i=n[sG]=e=>{(!e||e.target===n)&&(!e||/transform$/.test(e.propertyName))&&(n.removeEventListener("transitionend",i),n[sG]=null,sc(n,t))};n.addEventListener("transitionend",i)})}),()=>{let s=tw(e),o=so(s),a=s.tag||i5;if(n=[],r)for(let e=0;e{let t=e.props["onUpdate:modelValue"]||!1;return k(t)?e=>Q(t,e):t};function s2(e){e.target.composing=!0}function s3(e){let t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}let s6=Symbol("_assign"),s4={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e[s6]=s1(i);let l=r||i.props&&"number"===i.props.type;sO(e,t?"change":"input",t=>{if(t.target.composing)return;let r=e.value;n&&(r=r.trim()),l&&(r=Z(r)),e[s6](r)}),n&&sO(e,"change",()=>{e.value=e.value.trim()}),t||(sO(e,"compositionstart",s2),sO(e,"compositionend",s3),sO(e,"change",s3))},mounted(e,{value:t}){e.value=null==t?"":t},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:l}},s){if(e[s6]=s1(s),e.composing)return;let o=(l||"number"===e.type)&&!/^0\d/.test(e.value)?Z(e.value):e.value,a=null==t?"":t;o===a||document.activeElement===e&&"range"!==e.type&&(r&&t===n||i&&e.value.trim()===a)||(e.value=a)}},s8={deep:!0,created(e,t,n){e[s6]=s1(n),sO(e,"change",()=>{let t=e._modelValue,n=ot(e),r=e.checked,i=e[s6];if(k(t)){let e=em(t,n),l=-1!==e;if(r&&!l)i(t.concat(n));else if(!r&&l){let n=[...t];n.splice(e,1),i(n)}}else if(N(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(on(e,r))})},mounted:s5,beforeUpdate(e,t,n){e[s6]=s1(n),s5(e,t,n)}};function s5(e,{value:t,oldValue:n},r){let i;if(e._modelValue=t,k(t))i=em(t,r.props.value)>-1;else if(N(t))i=t.has(r.props.value);else{if(t===n)return;i=eh(t,on(e,!0))}e.checked!==i&&(e.checked=i)}let s9={created(e,{value:t},n){e.checked=eh(t,n.props.value),e[s6]=s1(n),sO(e,"change",()=>{e[s6](ot(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[s6]=s1(r),t!==n&&(e.checked=eh(t,r.props.value))}},s7={deep:!0,created(e,{value:t,modifiers:{number:n}},r){let i=N(t);sO(e,"change",()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?Z(ot(e)):ot(e));e[s6](e.multiple?i?new Set(t):t:t[0]),e._assigning=!0,nr(()=>{e._assigning=!1})}),e[s6]=s1(r)},mounted(e,{value:t}){oe(e,t)},beforeUpdate(e,t,n){e[s6]=s1(n)},updated(e,{value:t}){e._assigning||oe(e,t)}};function oe(e,t){let n=e.multiple,r=k(t);if(!n||r||N(t)){for(let i=0,l=e.options.length;iString(e)===String(s)):l.selected=em(t,s)>-1}else l.selected=t.has(s)}else if(eh(ot(l),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}n||-1===e.selectedIndex||(e.selectedIndex=-1)}}function ot(e){return"_value"in e?e._value:e.value}function on(e,t){let n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}let or={created(e,t,n){ol(e,t,n,null,"created")},mounted(e,t,n){ol(e,t,n,null,"mounted")},beforeUpdate(e,t,n,r){ol(e,t,n,r,"beforeUpdate")},updated(e,t,n,r){ol(e,t,n,r,"updated")}};function oi(e,t){switch(e){case"SELECT":return s7;case"TEXTAREA":return s4;default:switch(t){case"checkbox":return s8;case"radio":return s9;default:return s4}}}function ol(e,t,n,r,i){let l=oi(e.tagName,n.props&&n.props.type)[i];l&&l(e,t,n,r)}let os=["ctrl","shift","alt","meta"],oo={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&0!==e.button,middle:e=>"button"in e&&1!==e.button,right:e=>"button"in e&&2!==e.button,exact:(e,t)=>os.some(n=>e[`${n}Key`]&&!t.includes(n))},oa=(e,t)=>{let n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=(n,...r)=>{for(let e=0;e{let n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=n=>{if(!("key"in n))return;let r=K(n.key);if(t.some(e=>e===r||oc[e]===r))return e(n)})},od=S({patchProp:(e,t,n,r,i,l)=>{let s="svg"===i;"class"===t?function(e,t,n){let r=e[st];r&&(t=(t?[t,...r]:[...r]).join(" ")),null==t?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}(e,r,s):"style"===t?function(e,t,n){let r=e.style,i=I(n),l=!1;if(n&&!i){if(t){if(I(t))for(let e of t.split(";")){let t=e.slice(0,e.indexOf(":")).trim();null==n[t]&&sw(r,t,"")}else for(let e in t)null==n[e]&&sw(r,e,"")}for(let e in n)"display"===e&&(l=!0),sw(r,e,n[e])}else if(i){if(t!==n){let e=r[sS];e&&(n+=";"+e),r.cssText=n,l=sT.test(n)}}else t&&e.removeAttribute("style");sy in e&&(e[sy]=l?r.display:"",e[sv]&&(r.display="none"))}(e,n,r):b(t)?_(t)||function(e,t,n,r,i=null){let l=e[sP]||(e[sP]={}),s=l[t];if(r&&s)s.value=r;else{let[n,o]=function(e){let t;if(sM.test(e)){let n;for(t={};n=e.match(sM);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[":"===e[2]?e.slice(3):K(e.slice(2)),t]}(t);r?sO(e,n,l[t]=function(e,t){let n=e=>{if(e._vts){if(e._vts<=n.attached)return}else e._vts=Date.now();t6(function(e,t){if(!k(t))return t;{let n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(e=>t=>!t._stopped&&e&&e(t))}}(e,n.value),t,5,[e])};return n.value=e,n.attached=s$(),n}(r,i),o):s&&(!function(e,t,n,r){e.removeEventListener(t,n,r)}(e,n,s,o),l[t]=void 0)}}(e,t,0,r,l):("."===t[0]?(t=t.slice(1),0):"^"===t[0]?(t=t.slice(1),1):!function(e,t,n,r){if(r)return!!("innerHTML"===t||"textContent"===t||t in e&&sF(t)&&R(n));if("spellcheck"===t||"draggable"===t||"translate"===t||"form"===t||"list"===t&&"INPUT"===e.tagName||"type"===t&&"TEXTAREA"===e.tagName)return!1;if("width"===t||"height"===t){let t=e.tagName;if("IMG"===t||"VIDEO"===t||"CANVAS"===t||"SOURCE"===t)return!1}return!(sF(t)&&I(n))&&t in e}(e,t,r,s))?e._isVueCE&&(/[A-Z]/.test(t)||!I(r))?sI(e,q(t),r,l,t):("true-value"===t?e._trueValue=r:"false-value"===t&&(e._falseValue=r),sR(e,t,r,s)):(sI(e,t,r),e.tagName.includes("-")||"value"!==t&&"checked"!==t&&"selected"!==t||sR(e,t,r,s,l,"value"!==t))}},{insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i="svg"===t?l5.createElementNS("http://www.w3.org/2000/svg",e):"mathml"===t?l5.createElementNS("http://www.w3.org/1998/Math/MathML",e):n?l5.createElement(e,{is:n}):l5.createElement(e);return"select"===e&&r&&null!=r.multiple&&i.setAttribute("multiple",r.multiple),i},createText:e=>l5.createTextNode(e),createComment:e=>l5.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>l5.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,i,l){let s=n?n.previousSibling:t.lastChild;if(i&&(i===l||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),i!==l&&(i=i.nextSibling););else{l9.innerHTML=l8("svg"===r?`${e}`:"mathml"===r?`${e}`:e);let i=l9.content;if("svg"===r||"mathml"===r){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[s?s.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}}),op=!1;function of(){return c=op?c:iE(od),op=!0,c}let oh=(...e)=>{(c||(c=iN(od))).render(...e)},om=(...e)=>{of().hydrate(...e)},og=(...e)=>{let t=(c||(c=iN(od))).createApp(...e),{mount:n}=t;return t.mount=e=>{let r=ob(e);if(!r)return;let i=t._component;R(i)||i.render||i.template||(i.template=r.innerHTML),1===r.nodeType&&(r.textContent="");let l=n(r,!1,ov(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),l},t},oy=(...e)=>{let t=of().createApp(...e),{mount:n}=t;return t.mount=e=>{let t=ob(e);if(t)return n(t,!0,ov(t))},t};function ov(e){return e instanceof SVGElement?"svg":"function"==typeof MathMLElement&&e instanceof MathMLElement?"mathml":void 0}function ob(e){return I(e)?document.querySelector(e):e}let o_=!1,oS=()=>{o_||(o_=!0,s4.getSSRProps=({value:e})=>({value:e}),s9.getSSRProps=({value:e},t)=>{if(t.props&&eh(t.props.value,e))return{checked:!0}},s8.getSSRProps=({value:e},t)=>{if(k(e)){if(t.props&&em(e,t.props.value)>-1)return{checked:!0}}else if(N(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},or.getSSRProps=(e,t)=>{if("string"!=typeof t.type)return;let n=oi(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)},sb.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}})};var ox,oC,oT=Object.freeze({__proto__:null,BaseTransition:nF,BaseTransitionPropsValidators:nD,Comment:i7,DeprecationTypes:l6,EffectScope:e_,ErrorCodes:t2,ErrorTypeStrings:lZ,Fragment:i5,KeepAlive:rs,ReactiveEffect:ek,Static:le,Suspense:i1,Teleport:nE,Text:i9,TrackOpTypes:tJ,Transition:si,TransitionGroup:sX,TriggerOpTypes:tG,VueElement:sH,assertNumber:t1,callWithAsyncErrorHandling:t6,callWithErrorHandling:t3,camelize:q,capitalize:z,cloneVNode:lv,compatUtils:l3,computed:lW,createApp:og,createBlock:lc,createCommentVNode:lS,createElementBlock:la,createElementVNode:lm,createHydrationRenderer:iE,createPropsRestProxy:r1,createRenderer:iN,createSSRApp:oy,createSlots:rP,createStaticVNode:l_,createTextVNode:lb,createVNode:lg,customRef:tU,defineAsyncComponent:rr,defineComponent:nW,defineCustomElement:sB,defineEmits:rH,defineExpose:rq,defineModel:rz,defineOptions:rW,defineProps:rj,defineSSRCustomElement:sU,defineSlots:rK,devtools:lY,effect:eM,effectScope:eS,getCurrentInstance:lI,getCurrentScope:ex,getCurrentWatcher:tZ,getTransitionRawChildren:nq,guardReactiveProps:ly,h:lK,handleError:t4,hasInjectionContext:ic,hydrate:om,hydrateOnIdle:n9,hydrateOnInteraction:rt,hydrateOnMediaQuery:re,hydrateOnVisible:n7,initCustomFormatter:lz,initDirectivesForSSR:oS,inject:ia,isMemoSame:lG,isProxy:tk,isReactive:tx,isReadonly:tC,isRef:tR,isRuntimeOnly:lV,isShallow:tT,isVNode:lu,markRaw:tN,mergeDefaults:rY,mergeModels:r0,mergeProps:lk,nextTick:nr,normalizeClass:eo,normalizeProps:ea,normalizeStyle:en,onActivated:ra,onBeforeMount:rm,onBeforeUnmount:rb,onBeforeUpdate:ry,onDeactivated:rc,onErrorCaptured:rT,onMounted:rg,onRenderTracked:rC,onRenderTriggered:rx,onScopeDispose:eC,onServerPrefetch:rS,onUnmounted:r_,onUpdated:rv,onWatcherCleanup:tY,openBlock:lr,popScopeId:nh,provide:io,proxyRefs:tV,pushScopeId:nf,queuePostFlushCb:ns,reactive:ty,readonly:tb,ref:tI,registerRuntimeCompiler:lF,render:oh,renderList:rO,renderSlot:rM,resolveComponent:rw,resolveDirective:rA,resolveDynamicComponent:rE,resolveFilter:l2,resolveTransitionHooks:nB,setBlockTracking:ls,setDevtoolsHook:l0,setTransitionHooks:nH,shallowReactive:tv,shallowReadonly:t_,shallowRef:tO,ssrContextKey:iD,ssrUtils:l1,stop:eD,toDisplayString:ey,toHandlerKey:J,toHandlers:rL,toRaw:tw,toRef:tW,toRefs:tj,toValue:t$,transformVNodeArgs:lp,triggerRef:tD,unref:tL,useAttrs:rQ,useCssModule:sK,useCssVars:sx,useHost:sq,useId:nK,useModel:iq,useSSRContext:iL,useShadowRoot:sW,useSlots:rG,useTemplateRef:nJ,useTransitionState:nP,vModelCheckbox:s8,vModelDynamic:or,vModelRadio:s9,vModelSelect:s7,vModelText:s4,vShow:sb,version:lQ,warn:lX,watch:iB,watchEffect:i$,watchPostEffect:iF,watchSyncEffect:iV,withAsyncContext:r2,withCtx:ng,withDefaults:rJ,withDirectives:ny,withKeys:ou,withMemo:lJ,withModifiers:oa,withScopeId:nm});let ok=Symbol(""),ow=Symbol(""),oN=Symbol(""),oE=Symbol(""),oA=Symbol(""),oR=Symbol(""),oI=Symbol(""),oO=Symbol(""),oP=Symbol(""),oM=Symbol(""),oD=Symbol(""),oL=Symbol(""),o$=Symbol(""),oF=Symbol(""),oV=Symbol(""),oB=Symbol(""),oU=Symbol(""),oj=Symbol(""),oH=Symbol(""),oq=Symbol(""),oW=Symbol(""),oK=Symbol(""),oz=Symbol(""),oJ=Symbol(""),oG=Symbol(""),oQ=Symbol(""),oX=Symbol(""),oZ=Symbol(""),oY=Symbol(""),o0=Symbol(""),o1=Symbol(""),o2=Symbol(""),o3=Symbol(""),o6=Symbol(""),o4=Symbol(""),o8=Symbol(""),o5=Symbol(""),o9=Symbol(""),o7=Symbol(""),ae={[ok]:"Fragment",[ow]:"Teleport",[oN]:"Suspense",[oE]:"KeepAlive",[oA]:"BaseTransition",[oR]:"openBlock",[oI]:"createBlock",[oO]:"createElementBlock",[oP]:"createVNode",[oM]:"createElementVNode",[oD]:"createCommentVNode",[oL]:"createTextVNode",[o$]:"createStaticVNode",[oF]:"resolveComponent",[oV]:"resolveDynamicComponent",[oB]:"resolveDirective",[oU]:"resolveFilter",[oj]:"withDirectives",[oH]:"renderList",[oq]:"renderSlot",[oW]:"createSlots",[oK]:"toDisplayString",[oz]:"mergeProps",[oJ]:"normalizeClass",[oG]:"normalizeStyle",[oQ]:"normalizeProps",[oX]:"guardReactiveProps",[oZ]:"toHandlers",[oY]:"camelize",[o0]:"capitalize",[o1]:"toHandlerKey",[o2]:"setBlockTracking",[o3]:"pushScopeId",[o6]:"popScopeId",[o4]:"withCtx",[o8]:"unref",[o5]:"isRef",[o9]:"withMemo",[o7]:"isMemoSame"},at={start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0},source:""};function an(e,t,n,r,i,l,s,o=!1,a=!1,c=!1,u=at){return e&&(o?(e.helper(oR),e.helper(e.inSSR||c?oI:oO)):e.helper(e.inSSR||c?oP:oM),s&&e.helper(oj)),{type:13,tag:t,props:n,children:r,patchFlag:i,dynamicProps:l,directives:s,isBlock:o,disableTracking:a,isComponent:c,loc:u}}function ar(e,t=at){return{type:17,loc:t,elements:e}}function ai(e,t=at){return{type:15,loc:t,properties:e}}function al(e,t){return{type:16,loc:at,key:I(e)?as(e,!0):e,value:t}}function as(e,t=!1,n=at,r=0){return{type:4,loc:n,content:e,isStatic:t,constType:t?3:r}}function ao(e,t=at){return{type:8,loc:t,children:e}}function aa(e,t=[],n=at){return{type:14,loc:n,callee:e,arguments:t}}function ac(e,t,n=!1,r=!1,i=at){return{type:18,params:e,returns:t,newline:n,isSlot:r,loc:i}}function au(e,t,n,r=!0){return{type:19,test:e,consequent:t,alternate:n,newline:r,loc:at}}function ad(e,{helper:t,removeHelper:n,inSSR:r}){if(!e.isBlock){var i,l;e.isBlock=!0,n((i=e.isComponent,r||i?oP:oM)),t(oR),t((l=e.isComponent,r||l?oI:oO))}}let ap=new Uint8Array([123,123]),af=new Uint8Array([125,125]);function ah(e){return e>=97&&e<=122||e>=65&&e<=90}function am(e){return 32===e||10===e||9===e||12===e||13===e}function ag(e){return 47===e||62===e||am(e)}function ay(e){let t=new Uint8Array(e.length);for(let n=0;n4===e.type&&e.isStatic;function aC(e){switch(e){case"Teleport":case"teleport":return ow;case"Suspense":case"suspense":return oN;case"KeepAlive":case"keep-alive":return oE;case"BaseTransition":case"base-transition":return oA}}let aT=/^\d|[^\$\w\xA0-\uFFFF]/,ak=e=>!aT.test(e),aw=/[A-Za-z_$\xA0-\uFFFF]/,aN=/[\.\?\w$\xA0-\uFFFF]/,aE=/\s+[.[]\s*|\s*[.[]\s+/g,aA=e=>4===e.type?e.content:e.loc.source,aR=e=>{let t=aA(e).trim().replace(aE,e=>e.trim()),n=0,r=[],i=0,l=0,s=null;for(let e=0;e|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/,aO=e=>aI.test(aA(e));function aP(e,t,n=!1){for(let r=0;r4===e.key.type&&e.key.content===r)}return n}function aH(e,t){return`_${t}_${e.replace(/[^\w]/g,(t,n)=>"-"===t?"_":e.charCodeAt(n).toString())}`}let aq=/([\s\S]*?)\s+(?:in|of)\s+(\S[\s\S]*)/,aW={parseMode:"base",ns:0,delimiters:["{{","}}"],getNamespace:()=>0,isVoidTag:y,isPreTag:y,isIgnoreNewlineTag:y,isCustomElement:y,onError:ab,onWarn:a_,comments:!1,prefixIdentifiers:!1},aK=aW,az=null,aJ="",aG=null,aQ=null,aX="",aZ=-1,aY=-1,a0=0,a1=!1,a2=null,a3=[],a6=new class{constructor(e,t){this.stack=e,this.cbs=t,this.state=1,this.buffer="",this.sectionStart=0,this.index=0,this.entityStart=0,this.baseState=1,this.inRCDATA=!1,this.inXML=!1,this.inVPre=!1,this.newlines=[],this.mode=0,this.delimiterOpen=ap,this.delimiterClose=af,this.delimiterIndex=-1,this.currentSequence=void 0,this.sequenceIndex=0}get inSFCRoot(){return 2===this.mode&&0===this.stack.length}reset(){this.state=1,this.mode=0,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=1,this.inRCDATA=!1,this.currentSequence=void 0,this.newlines.length=0,this.delimiterOpen=ap,this.delimiterClose=af}getPos(e){let t=1,n=e+1;for(let r=this.newlines.length-1;r>=0;r--){let i=this.newlines[r];if(e>i){t=r+2,n=e-i;break}}return{column:n,line:t,offset:e}}peek(){return this.buffer.charCodeAt(this.index+1)}stateText(e){60===e?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=5,this.sectionStart=this.index):this.inVPre||e!==this.delimiterOpen[0]||(this.state=2,this.delimiterIndex=0,this.stateInterpolationOpen(e))}stateInterpolationOpen(e){if(e===this.delimiterOpen[this.delimiterIndex]){if(this.delimiterIndex===this.delimiterOpen.length-1){let e=this.index+1-this.delimiterOpen.length;e>this.sectionStart&&this.cbs.ontext(this.sectionStart,e),this.state=3,this.sectionStart=e}else this.delimiterIndex++}else this.inRCDATA?(this.state=32,this.stateInRCDATA(e)):(this.state=1,this.stateText(e))}stateInterpolation(e){e===this.delimiterClose[0]&&(this.state=4,this.delimiterIndex=0,this.stateInterpolationClose(e))}stateInterpolationClose(e){e===this.delimiterClose[this.delimiterIndex]?this.delimiterIndex===this.delimiterClose.length-1?(this.cbs.oninterpolation(this.sectionStart,this.index+1),this.inRCDATA?this.state=32:this.state=1,this.sectionStart=this.index+1):this.delimiterIndex++:(this.state=3,this.stateInterpolation(e))}stateSpecialStartSequence(e){let t=this.sequenceIndex===this.currentSequence.length;if(t?ag(e):(32|e)===this.currentSequence[this.sequenceIndex]){if(!t){this.sequenceIndex++;return}}else this.inRCDATA=!1;this.sequenceIndex=0,this.state=6,this.stateInTagName(e)}stateInRCDATA(e){if(this.sequenceIndex===this.currentSequence.length){if(62===e||am(e)){let t=this.index-this.currentSequence.length;if(this.sectionStart=e||(28===this.state?this.currentSequence===av.CdataEnd?this.cbs.oncdata(this.sectionStart,e):this.cbs.oncomment(this.sectionStart,e):6===this.state||11===this.state||18===this.state||17===this.state||12===this.state||13===this.state||14===this.state||15===this.state||16===this.state||20===this.state||19===this.state||21===this.state||9===this.state||this.cbs.ontext(this.sectionStart,e))}emitCodePoint(e,t){}}(a3,{onerr:cu,ontext(e,t){a7(a5(e,t),e,t)},ontextentity(e,t,n){a7(e,t,n)},oninterpolation(e,t){if(a1)return a7(a5(e,t),e,t);let n=e+a6.delimiterOpen.length,r=t-a6.delimiterClose.length;for(;am(aJ.charCodeAt(n));)n++;for(;am(aJ.charCodeAt(r-1));)r--;let i=a5(n,r);i.includes("&")&&(i=aK.decodeEntities(i,!1)),cs({type:5,content:cc(i,!1,co(n,r)),loc:co(e,t)})},onopentagname(e,t){let n=a5(e,t);aG={type:1,tag:n,ns:aK.getNamespace(n,a3[0],aK.ns),tagType:0,props:[],children:[],loc:co(e-1,t),codegenNode:void 0}},onopentagend(e){a9(e)},onclosetag(e,t){let n=a5(e,t);if(!aK.isVoidTag(n)){let r=!1;for(let e=0;e0&&a3[0].loc.start.offset;for(let n=0;n<=e;n++)ce(a3.shift(),t,n(7===e.type?e.rawName:e.name)===t)},onattribend(e,t){aG&&aQ&&(ca(aQ.loc,t),0!==e&&(aX.includes("&")&&(aX=aK.decodeEntities(aX,!0)),6===aQ.type?("class"===aQ.name&&(aX=cl(aX).trim()),aQ.value={type:2,content:aX,loc:1===e?co(aZ,aY):co(aZ-1,aY+1)},a6.inSFCRoot&&"template"===aG.tag&&"lang"===aQ.name&&aX&&"html"!==aX&&a6.enterRCDATA(ay("{let i=t.start.offset+n,l=i+e.length;return cc(e,!1,co(i,l),0,r?1:0)},o={source:s(l.trim(),n.indexOf(l,i.length)),value:void 0,key:void 0,index:void 0,finalized:!1},a=i.trim().replace(a8,"").trim(),c=i.indexOf(a),u=a.match(a4);if(u){let e;a=a.replace(a4,"").trim();let t=u[1].trim();if(t&&(e=n.indexOf(t,c+a.length),o.key=s(t,e,!0)),u[2]){let r=u[2].trim();r&&(o.index=s(r,n.indexOf(r,o.key?e+t.length:c+a.length),!0))}}return a&&(o.value=s(a,c,!0)),o}(aQ.exp)))),(7!==aQ.type||"pre"!==aQ.name)&&aG.props.push(aQ)),aX="",aZ=aY=-1},oncomment(e,t){aK.comments&&cs({type:3,content:a5(e,t),loc:co(e-4,t+3)})},onend(){let e=aJ.length;for(let t=0;t64&&n<91||aC(e)||aK.isBuiltInComponent&&aK.isBuiltInComponent(e)||aK.isNativeTag&&!aK.isNativeTag(e))return!0;for(let e=0;e=0;)n--;return n}let cn=new Set(["if","else","else-if","for","slot"]),cr=/\r\n/g;function ci(e,t){let n="preserve"!==aK.whitespace,r=!1;for(let t=0;t1)for(let i=0;i{n--};for(;nt===e:t=>e.test(t);return(e,r)=>{if(1===e.type){let{props:i}=e;if(3===e.tagType&&i.some(a$))return;let l=[];for(let s=0;s`${ae[e]}: _${ae[e]}`;function c_(e,t,{helper:n,push:r,newline:i,isTS:l}){let s=n("component"===t?oF:oB);for(let n=0;n3;t.push("["),n&&t.indent(),cx(e,t,n),n&&t.deindent(),t.push("]")}function cx(e,t,n=!1,r=!0){let{push:i,newline:l}=t;for(let s=0;se||"null")}([s,o,a,n,u]),t),r(")"),p&&r(")"),d&&(r(", "),cC(d,t),r(")"))}(e,t);break;case 14:!function(e,t){let{push:n,helper:r,pure:i}=t,l=I(e.callee)?e.callee:r(e.callee);i&&n(cv),n(l+"(",-2,e),cx(e.arguments,t),n(")")}(e,t);break;case 15:!function(e,t){let{push:n,indent:r,deindent:i,newline:l}=t,{properties:s}=e;if(!s.length){n("{}",-2,e);return}let o=s.length>1;n(o?"{":"{ "),o&&r();for(let e=0;e "),(a||o)&&(n("{"),r()),s?(a&&n("return "),k(s)?cS(s,t):cC(s,t)):o&&cC(o,t),(a||o)&&(i(),n("}")),c&&n(")")}(e,t);break;case 19:!function(e,t){let{test:n,consequent:r,alternate:i,newline:l}=e,{push:s,indent:o,deindent:a,newline:c}=t;if(4===n.type){let e=!ak(n.content);e&&s("("),cT(n,t),e&&s(")")}else s("("),cC(n,t),s(")");l&&o(),t.indentLevel++,l||s(" "),s("? "),cC(r,t),t.indentLevel--,l&&c(),l||s(" "),s(": ");let u=19===i.type;!u&&t.indentLevel++,cC(i,t),!u&&t.indentLevel--,l&&a(!0)}(e,t);break;case 20:!function(e,t){let{push:n,helper:r,indent:i,deindent:l,newline:s}=t,{needPauseTracking:o,needArraySpread:a}=e;a&&n("[...("),n(`_cache[${e.index}] || (`),o&&(i(),n(`${r(o2)}(-1`),e.inVOnce&&n(", true"),n("),"),s(),n("(")),n(`_cache[${e.index}] = `),cC(e.value,t),o&&(n(`).cacheIndex = ${e.index},`),s(),n(`${r(o2)}(1),`),s(),n(`_cache[${e.index}]`),l()),n(")"),a&&n(")]")}(e,t);break;case 21:cx(e.body,t,!0,!1)}}function cT(e,t){let{content:n,isStatic:r}=e;t.push(r?JSON.stringify(n):n,-3,e)}function ck(e,t){for(let n=0;n(function(e,t,n,r){if("else"!==t.name&&(!t.exp||!t.exp.content.trim())){let r=t.exp?t.exp.loc:e.loc;n.onError(aS(28,t.loc)),t.exp=as("true",!1,r)}if("if"===t.name){var i;let l=cN(e,t),s={type:9,loc:co((i=e.loc).start.offset,i.end.offset),branches:[l]};if(n.replaceNode(s),r)return r(s,l,!0)}else{let i=n.parent.children,l=i.indexOf(e);for(;l-- >=-1;){let s=i[l];if(s&&3===s.type||s&&2===s.type&&!s.content.trim().length){n.removeNode(s);continue}if(s&&9===s.type){"else-if"===t.name&&void 0===s.branches[s.branches.length-1].condition&&n.onError(aS(30,e.loc)),n.removeNode();let i=cN(e,t);s.branches.push(i);let l=r&&r(s,i,!1);cg(i,n),l&&l(),n.currentNode=null}else n.onError(aS(30,e.loc));break}}})(e,t,n,(e,t,r)=>{let i=n.parent.children,l=i.indexOf(e),s=0;for(;l-- >=0;){let e=i[l];e&&9===e.type&&(s+=e.branches.length)}return()=>{r?e.codegenNode=cE(t,s,n):function(e){for(;;)if(19===e.type){if(19!==e.alternate.type)return e;e=e.alternate}else 20===e.type&&(e=e.value)}(e.codegenNode).alternate=cE(t,s+e.branches.length-1,n)}}));function cN(e,t){let n=3===e.tagType;return{type:10,loc:e.loc,condition:"else"===t.name?void 0:t.exp,children:n&&!aP(e,"for")?e.children:[e],userKey:aM(e,"key"),isTemplateIf:n}}function cE(e,t,n){return e.condition?au(e.condition,cA(e,t,n),aa(n.helper(oD),['""',"true"])):cA(e,t,n)}function cA(e,t,n){let{helper:r}=n,i=al("key",as(`${t}`,!1,at,2)),{children:l}=e,s=l[0];if(1!==l.length||1!==s.type){if(1!==l.length||11!==s.type)return an(n,r(ok),ai([i]),l,64,void 0,void 0,!0,!1,!1,e.loc);{let e=s.codegenNode;return aU(e,i,n),e}}{let e=s.codegenNode,t=14===e.type&&e.callee===o9?e.arguments[1].returns:e;return 13===t.type&&ad(t,n),aU(t,i,n),e}}let cR=(e,t,n)=>{let{modifiers:r,loc:i}=e,l=e.arg,{exp:s}=e;if(s&&4===s.type&&!s.content.trim()&&(s=void 0),!s){if(4!==l.type||!l.isStatic)return n.onError(aS(52,l.loc)),{props:[al(l,as("",!0,i))]};cI(e),s=e.exp}return 4!==l.type?(l.children.unshift("("),l.children.push(') || ""')):l.isStatic||(l.content=`${l.content} || ""`),r.some(e=>"camel"===e.content)&&(4===l.type?l.isStatic?l.content=q(l.content):l.content=`${n.helperString(oY)}(${l.content})`:(l.children.unshift(`${n.helperString(oY)}(`),l.children.push(")"))),!n.inSSR&&(r.some(e=>"prop"===e.content)&&cO(l,"."),r.some(e=>"attr"===e.content)&&cO(l,"^")),{props:[al(l,s)]}},cI=(e,t)=>{let n=e.arg,r=q(n.content);e.exp=as(r,!1,n.loc)},cO=(e,t)=>{4===e.type?e.isStatic?e.content=t+e.content:e.content=`\`${t}\${${e.content}}\``:(e.children.unshift(`'${t}' + (`),e.children.push(")"))},cP=cy("for",(e,t,n)=>{let{helper:r,removeHelper:i}=n;return function(e,t,n,r){if(!t.exp){n.onError(aS(31,t.loc));return}let i=t.forParseResult;if(!i){n.onError(aS(32,t.loc));return}cM(i);let{addIdentifiers:l,removeIdentifiers:s,scopes:o}=n,{source:a,value:c,key:u,index:d}=i,p={type:11,loc:t.loc,source:a,valueAlias:c,keyAlias:u,objectIndexAlias:d,parseResult:i,children:aF(e)?e.children:[e]};n.replaceNode(p),o.vFor++;let f=r&&r(p);return()=>{o.vFor--,f&&f()}}(e,t,n,t=>{let l=aa(r(oH),[t.source]),s=aF(e),o=aP(e,"memo"),a=aM(e,"key",!1,!0);a&&7===a.type&&!a.exp&&cI(a);let c=a&&(6===a.type?a.value?as(a.value.content,!0):void 0:a.exp),u=a&&c?al("key",c):null,d=4===t.source.type&&t.source.constType>0,p=d?64:a?128:256;return t.codegenNode=an(n,r(ok),void 0,l,p,void 0,void 0,!0,!d,!1,e.loc),()=>{let a;let{children:p}=t,f=1!==p.length||1!==p[0].type,h=aV(e)?e:s&&1===e.children.length&&aV(e.children[0])?e.children[0]:null;if(h)a=h.codegenNode,s&&u&&aU(a,u,n);else if(f)a=an(n,r(ok),u?ai([u]):void 0,e.children,64,void 0,void 0,!0,void 0,!1);else{var m,g,y,b,_,S,x,C;a=p[0].codegenNode,s&&u&&aU(a,u,n),!d!==a.isBlock&&(a.isBlock?(i(oR),i((m=n.inSSR,g=a.isComponent,m||g?oI:oO))):i((y=n.inSSR,b=a.isComponent,y||b?oP:oM))),(a.isBlock=!d,a.isBlock)?(r(oR),r((_=n.inSSR,S=a.isComponent,_||S?oI:oO))):r((x=n.inSSR,C=a.isComponent,x||C?oP:oM))}if(o){let e=ac(cD(t.parseResult,[as("_cached")]));e.body={type:21,body:[ao(["const _memo = (",o.exp,")"]),ao(["if (_cached",...c?[" && _cached.key === ",c]:[],` && ${n.helperString(o7)}(_cached, _memo)) return _cached`]),ao(["const _item = ",a]),as("_item.memo = _memo"),as("return _item")],loc:at},l.arguments.push(e,as("_cache"),as(String(n.cached.length))),n.cached.push(null)}else l.arguments.push(ac(cD(t.parseResult),a,!0))}})});function cM(e,t){e.finalized||(e.finalized=!0)}function cD({value:e,key:t,index:n},r=[]){return function(e){let t=e.length;for(;t--&&!e[t];);return e.slice(0,t+1).map((e,t)=>e||as("_".repeat(t+1),!1))}([e,t,n,...r])}let cL=as("undefined",!1),c$=(e,t)=>{if(1===e.type&&(1===e.tagType||3===e.tagType)){let n=aP(e,"slot");if(n)return n.exp,t.scopes.vSlot++,()=>{t.scopes.vSlot--}}},cF=(e,t,n,r)=>ac(e,n,!1,!0,n.length?n[0].loc:r);function cV(e,t,n){let r=[al("name",e),al("fn",t)];return null!=n&&r.push(al("key",as(String(n),!0))),ai(r)}let cB=new WeakMap,cU=(e,t)=>function(){let n,r,i,l,s;if(!(1===(e=t.currentNode).type&&(0===e.tagType||1===e.tagType)))return;let{tag:o,props:a}=e,c=1===e.tagType,u=c?function(e,t,n=!1){let{tag:r}=e,i=cq(r),l=aM(e,"is",!1,!0);if(l){if(i){let e;if(6===l.type?e=l.value&&as(l.value.content,!0):(e=l.exp)||(e=as("is",!1,l.arg.loc)),e)return aa(t.helper(oV),[e])}else 6===l.type&&l.value.content.startsWith("vue:")&&(r=l.value.content.slice(4))}let s=aC(r)||t.isBuiltInComponent(r);return s?(n||t.helper(s),s):(t.helper(oF),t.components.add(r),aH(r,"component"))}(e,t):`"${o}"`,d=P(u)&&u.callee===oV,p=0,f=d||u===ow||u===oN||!c&&("svg"===o||"foreignObject"===o||"math"===o);if(a.length>0){let r=cj(e,t,void 0,c,d);n=r.props,p=r.patchFlag,l=r.dynamicPropNames;let i=r.directives;s=i&&i.length?ar(i.map(e=>(function(e,t){let n=[],r=cB.get(e);r?n.push(t.helperString(r)):(t.helper(oB),t.directives.add(e.name),n.push(aH(e.name,"directive")));let{loc:i}=e;if(e.exp&&n.push(e.exp),e.arg&&(e.exp||n.push("void 0"),n.push(e.arg)),Object.keys(e.modifiers).length){e.arg||(e.exp||n.push("void 0"),n.push("void 0"));let t=as("true",!1,i);n.push(ai(e.modifiers.map(e=>al(e,t)),i))}return ar(n,e.loc)})(e,t))):void 0,r.shouldUseBlock&&(f=!0)}if(e.children.length>0){if(u===oE&&(f=!0,p|=1024),c&&u!==ow&&u!==oE){let{slots:n,hasDynamicSlots:i}=function(e,t,n=cF){t.helper(o4);let{children:r,loc:i}=e,l=[],s=[],o=t.scopes.vSlot>0||t.scopes.vFor>0,a=aP(e,"slot",!0);if(a){let{arg:e,exp:t}=a;e&&!ax(e)&&(o=!0),l.push(al(e||as("default",!0),n(t,void 0,r,i)))}let c=!1,u=!1,d=[],p=new Set,f=0;for(let e=0;eal("default",n(e,void 0,t,i));c?d.length&&d.some(e=>(function e(t){return 2!==t.type&&12!==t.type||(2===t.type?!!t.content.trim():e(t.content))})(e))&&(u?t.onError(aS(39,d[0].loc)):l.push(e(void 0,d))):l.push(e(void 0,r))}let h=o?2:!function e(t){for(let n=0;n0,h=!1,m=0,g=!1,y=!1,_=!1,S=!1,x=!1,C=!1,T=[],k=e=>{u.length&&(d.push(ai(cH(u),a)),u=[]),e&&d.push(e)},w=()=>{t.scopes.vFor>0&&u.push(al(as("ref_for",!0),as("true")))},N=({key:e,value:n})=>{if(ax(e)){let l=e.content,s=b(l);s&&(!r||i)&&"onclick"!==l.toLowerCase()&&"onUpdate:modelValue"!==l&&!B(l)&&(S=!0),s&&B(l)&&(C=!0),s&&14===n.type&&(n=n.arguments[0]),20===n.type||(4===n.type||8===n.type)&&cp(n,t)>0||("ref"===l?g=!0:"class"===l?y=!0:"style"===l?_=!0:"key"===l||T.includes(l)||T.push(l),r&&("class"===l||"style"===l)&&!T.includes(l)&&T.push(l))}else x=!0};for(let i=0;i"prop"===e.content)&&(m|=32);let S=t.directiveTransforms[n];if(S){let{props:n,needRuntime:r}=S(s,e,t);l||n.forEach(N),_&&i&&!ax(i)?k(ai(n,a)):u.push(...n),r&&(p.push(s),O(r)&&cB.set(s,r))}else!U(n)&&(p.push(s),f&&(h=!0))}}if(d.length?(k(),s=d.length>1?aa(t.helper(oz),d,a):d[0]):u.length&&(s=ai(cH(u),a)),x?m|=16:(y&&!r&&(m|=2),_&&!r&&(m|=4),T.length&&(m|=8),S&&(m|=32)),!h&&(0===m||32===m)&&(g||C||p.length>0)&&(m|=512),!t.inSSR&&s)switch(s.type){case 15:let E=-1,A=-1,R=!1;for(let e=0;e{if(aV(e)){let{children:n,loc:r}=e,{slotName:i,slotProps:l}=function(e,t){let n,r='"default"',i=[];for(let t=0;t0){let{props:r,directives:l}=cj(e,t,i,!1,!1);n=r,l.length&&t.onError(aS(36,l[0].loc))}return{slotName:r,slotProps:n}}(e,t),s=[t.prefixIdentifiers?"_ctx.$slots":"$slots",i,"{}","undefined","true"],o=2;l&&(s[2]=l,o=3),n.length&&(s[3]=ac([],n,!1,!1,r),o=4),t.scopeId&&!t.slotted&&(o=5),s.splice(o),e.codegenNode=aa(t.helper(oq),s,r)}},cK=(e,t,n,r)=>{let i;let{loc:l,modifiers:s,arg:o}=e;if(e.exp||s.length,4===o.type){if(o.isStatic){let e=o.content;e.startsWith("vue:")&&(e=`vnode-${e.slice(4)}`),i=as(0!==t.tagType||e.startsWith("vnode")||!/[A-Z]/.test(e)?J(q(e)):`on:${e}`,!0,o.loc)}else i=ao([`${n.helperString(o1)}(`,o,")"])}else(i=o).children.unshift(`${n.helperString(o1)}(`),i.children.push(")");let a=e.exp;a&&!a.content.trim()&&(a=void 0);let c=n.cacheHandlers&&!a&&!n.inVOnce;if(a){let e=aR(a),t=!(e||aO(a)),n=a.content.includes(";");(t||c&&e)&&(a=ao([`${t?"$event":"(...args)"} => ${n?"{":"("}`,a,n?"}":")"]))}let u={props:[al(i,a||as("() => {}",!1,l))]};return r&&(u=r(u)),c&&(u.props[0].value=n.cache(u.props[0].value)),u.props.forEach(e=>e.key.isHandlerKey=!0),u},cz=(e,t)=>{if(0===e.type||1===e.type||11===e.type||10===e.type)return()=>{let n;let r=e.children,i=!1;for(let e=0;e7===e.type&&!t.directiveTransforms[e.name]))))for(let e=0;e{if(1===e.type&&aP(e,"once",!0)&&!cJ.has(e)&&!t.inVOnce&&!t.inSSR)return cJ.add(e),t.inVOnce=!0,t.helper(o2),()=>{t.inVOnce=!1;let e=t.currentNode;e.codegenNode&&(e.codegenNode=t.cache(e.codegenNode,!0,!0))}},cQ=(e,t,n)=>{let r;let{exp:i,arg:l}=e;if(!i)return n.onError(aS(41,e.loc)),cX();let s=i.loc.source.trim(),o=4===i.type?i.content:s,a=n.bindingMetadata[s];if("props"===a||"props-aliased"===a)return i.loc,cX();if(!o.trim()||!aR(i))return n.onError(aS(42,i.loc)),cX();let c=l||as("modelValue",!0),u=l?ax(l)?`onUpdate:${q(l.content)}`:ao(['"onUpdate:" + ',l]):"onUpdate:modelValue",d=n.isTS?"($event: any)":"$event";r=ao([`${d} => ((`,i,") = $event)"]);let p=[al(c,e.exp),al(u,r)];if(e.modifiers.length&&1===t.tagType){let t=e.modifiers.map(e=>e.content).map(e=>(ak(e)?e:JSON.stringify(e))+": true").join(", "),n=l?ax(l)?`${l.content}Modifiers`:ao([l,' + "Modifiers"']):"modelModifiers";p.push(al(n,as(`{ ${t} }`,!1,e.loc,2)))}return cX(p)};function cX(e=[]){return{props:e}}let cZ=new WeakSet,cY=(e,t)=>{if(1===e.type){let n=aP(e,"memo");if(!(!n||cZ.has(e)))return cZ.add(e),()=>{let r=e.codegenNode||t.currentNode.codegenNode;r&&13===r.type&&(1!==e.tagType&&ad(r,t),e.codegenNode=aa(t.helper(o9),[n.exp,ac(void 0,r),"_cache",String(t.cached.length)]),t.cached.push(null))}}},c0=Symbol(""),c1=Symbol(""),c2=Symbol(""),c3=Symbol(""),c6=Symbol(""),c4=Symbol(""),c8=Symbol(""),c5=Symbol(""),c9=Symbol(""),c7=Symbol("");!function(e){Object.getOwnPropertySymbols(e).forEach(t=>{ae[t]=e[t]})}({[c0]:"vModelRadio",[c1]:"vModelCheckbox",[c2]:"vModelText",[c3]:"vModelSelect",[c6]:"vModelDynamic",[c4]:"withModifiers",[c8]:"withKeys",[c5]:"vShow",[c9]:"Transition",[c7]:"TransitionGroup"});let ue={parseMode:"html",isVoidTag:ep,isNativeTag:e=>ec(e)||eu(e)||ed(e),isPreTag:e=>"pre"===e,isIgnoreNewlineTag:e=>"pre"===e||"textarea"===e,decodeEntities:function(e,t=!1){return(u||(u=document.createElement("div")),t)?(u.innerHTML=`
`,u.children[0].getAttribute("foo")):(u.innerHTML=e,u.textContent)},isBuiltInComponent:e=>"Transition"===e||"transition"===e?c9:"TransitionGroup"===e||"transition-group"===e?c7:void 0,getNamespace(e,t,n){let r=t?t.ns:n;if(t&&2===r){if("annotation-xml"===t.tag){if("svg"===e)return 1;t.props.some(e=>6===e.type&&"encoding"===e.name&&null!=e.value&&("text/html"===e.value.content||"application/xhtml+xml"===e.value.content))&&(r=0)}else/^m(?:[ions]|text)$/.test(t.tag)&&"mglyph"!==e&&"malignmark"!==e&&(r=0)}else t&&1===r&&("foreignObject"===t.tag||"desc"===t.tag||"title"===t.tag)&&(r=0);if(0===r){if("svg"===e)return 1;if("math"===e)return 2}return r}},ut=(e,t)=>as(JSON.stringify(es(e)),!1,t,3),un=f("passive,once,capture"),ur=f("stop,prevent,self,ctrl,shift,alt,meta,exact,middle"),ui=f("left,right"),ul=f("onkeyup,onkeydown,onkeypress"),us=(e,t,n,r)=>{let i=[],l=[],s=[];for(let n=0;nax(e)&&"onclick"===e.content.toLowerCase()?as(t,!0):4!==e.type?ao(["(",e,`) === "onClick" ? "${t}" : (`,e,")"]):e,ua=(e,t)=>{1===e.type&&0===e.tagType&&("script"===e.tag||"style"===e.tag)&&t.removeNode()},uc=[e=>{1===e.type&&e.props.forEach((t,n)=>{6===t.type&&"style"===t.name&&t.value&&(e.props[n]={type:7,name:"bind",arg:as("style",!0,t.loc),exp:ut(t.value.content,t.loc),modifiers:[],loc:t.loc})})}],uu={cloak:()=>({props:[]}),html:(e,t,n)=>{let{exp:r,loc:i}=e;return r||n.onError(aS(53,i)),t.children.length&&(n.onError(aS(54,i)),t.children.length=0),{props:[al(as("innerHTML",!0,i),r||as("",!0))]}},text:(e,t,n)=>{let{exp:r,loc:i}=e;return r||n.onError(aS(55,i)),t.children.length&&(n.onError(aS(56,i)),t.children.length=0),{props:[al(as("textContent",!0),r?cp(r,n)>0?r:aa(n.helperString(oK),[r],i):as("",!0))]}},model:(e,t,n)=>{let r=cQ(e,t,n);if(!r.props.length||1===t.tagType)return r;e.arg&&n.onError(aS(58,e.arg.loc));let{tag:i}=t,l=n.isCustomElement(i);if("input"===i||"textarea"===i||"select"===i||l){let s=c2,o=!1;if("input"===i||l){let r=aM(t,"type");if(r){if(7===r.type)s=c6;else if(r.value)switch(r.value.content){case"radio":s=c0;break;case"checkbox":s=c1;break;case"file":o=!0,n.onError(aS(59,e.loc))}}else t.props.some(e=>7===e.type&&"bind"===e.name&&(!e.arg||4!==e.arg.type||!e.arg.isStatic))&&(s=c6)}else"select"===i&&(s=c3);o||(r.needRuntime=n.helper(s))}else n.onError(aS(57,e.loc));return r.props=r.props.filter(e=>!(4===e.key.type&&"modelValue"===e.key.content)),r},on:(e,t,n)=>cK(e,t,n,t=>{let{modifiers:r}=e;if(!r.length)return t;let{key:i,value:l}=t.props[0],{keyModifiers:s,nonKeyModifiers:o,eventOptionModifiers:a}=us(i,r,n,e.loc);if(o.includes("right")&&(i=uo(i,"onContextmenu")),o.includes("middle")&&(i=uo(i,"onMouseup")),o.length&&(l=aa(n.helper(c4),[l,JSON.stringify(o)])),s.length&&(!ax(i)||ul(i.content.toLowerCase()))&&(l=aa(n.helper(c8),[l,JSON.stringify(s)])),a.length){let e=a.map(z).join("");i=ax(i)?as(`${i.content}${e}`,!0):ao(["(",i,`) + "${e}"`])}return{props:[al(i,l)]}}),show:(e,t,n)=>{let{exp:r,loc:i}=e;return!r&&n.onError(aS(61,i)),{props:[],needRuntime:n.helper(c5)}}},ud=Object.create(null);function up(e,t){if(!I(e)){if(!e.nodeType)return g;e=e.innerHTML}let n=e+JSON.stringify(t,(e,t)=>"function"==typeof t?t.toString():t),r=ud[n];if(r)return r;if("#"===e[0]){let t=document.querySelector(e);e=t?t.innerHTML:""}let i=S({hoistStatic:!0,onError:void 0,onWarn:g},t);i.isCustomElement||"undefined"==typeof customElements||(i.isCustomElement=e=>!!customElements.get(e));let{code:l}=function(e,t={}){return function(e,t={}){let n=t.onError||ab,r="module"===t.mode;!0===t.prefixIdentifiers?n(aS(47)):r&&n(aS(48)),t.cacheHandlers&&n(aS(49)),t.scopeId&&!r&&n(aS(50));let i=S({},t,{prefixIdentifiers:!1}),l=I(e)?function(e,t){if(a6.reset(),aG=null,aQ=null,aX="",aZ=-1,aY=-1,a3.length=0,aJ=e,aK=S({},aW),t){let e;for(e in t)null!=t[e]&&(aK[e]=t[e])}a6.mode="html"===aK.parseMode?1:"sfc"===aK.parseMode?2:0,a6.inXML=1===aK.ns||2===aK.ns;let n=t&&t.delimiters;n&&(a6.delimiterOpen=ay(n[0]),a6.delimiterClose=ay(n[1]));let r=az=function(e,t=""){return{type:0,source:t,children:e,helpers:new Set,components:[],directives:[],hoists:[],imports:[],cached:[],temps:0,codegenNode:void 0,loc:at}}([],e);return a6.parse(aJ),r.loc=co(0,e.length),r.children=ci(r.children),az=null,r}(e,i):e,[s,o]=[[cG,cw,cY,cP,cW,cU,c$,cz],{on:cK,bind:cR,model:cQ}];return!function(e,t){let n=function(e,{filename:t="",prefixIdentifiers:n=!1,hoistStatic:r=!1,hmr:i=!1,cacheHandlers:l=!1,nodeTransforms:s=[],directiveTransforms:o={},transformHoist:a=null,isBuiltInComponent:c=g,isCustomElement:u=g,expressionPlugins:d=[],scopeId:p=null,slotted:f=!0,ssr:m=!1,inSSR:y=!1,ssrCssVars:b="",bindingMetadata:_=h,inline:S=!1,isTS:x=!1,onError:C=ab,onWarn:T=a_,compatConfig:k}){let w=t.replace(/\?.*$/,"").match(/([^/\\]+)\.\w+$/),N={filename:t,selfName:w&&z(q(w[1])),prefixIdentifiers:n,hoistStatic:r,hmr:i,cacheHandlers:l,nodeTransforms:s,directiveTransforms:o,transformHoist:a,isBuiltInComponent:c,isCustomElement:u,expressionPlugins:d,scopeId:p,slotted:f,ssr:m,inSSR:y,ssrCssVars:b,bindingMetadata:_,inline:S,isTS:x,onError:C,onWarn:T,compatConfig:k,root:e,helpers:new Map,components:new Set,directives:new Set,hoists:[],imports:[],cached:[],constantCache:new WeakMap,temps:0,identifiers:Object.create(null),scopes:{vFor:0,vSlot:0,vPre:0,vOnce:0},parent:null,grandParent:null,currentNode:e,childIndex:0,inVOnce:!1,helper(e){let t=N.helpers.get(e)||0;return N.helpers.set(e,t+1),e},removeHelper(e){let t=N.helpers.get(e);if(t){let n=t-1;n?N.helpers.set(e,n):N.helpers.delete(e)}},helperString:e=>`_${ae[N.helper(e)]}`,replaceNode(e){N.parent.children[N.childIndex]=N.currentNode=e},removeNode(e){let t=N.parent.children,n=e?t.indexOf(e):N.currentNode?N.childIndex:-1;e&&e!==N.currentNode?N.childIndex>n&&(N.childIndex--,N.onNodeRemoved()):(N.currentNode=null,N.onNodeRemoved()),N.parent.children.splice(n,1)},onNodeRemoved:g,addIdentifiers(e){},removeIdentifiers(e){},hoist(e){I(e)&&(e=as(e)),N.hoists.push(e);let t=as(`_hoisted_${N.hoists.length}`,!1,e.loc,2);return t.hoisted=e,t},cache(e,t=!1,n=!1){let r=function(e,t,n=!1,r=!1){return{type:20,index:e,value:t,needPauseTracking:n,inVOnce:r,needArraySpread:!1,loc:at}}(N.cached.length,e,t,n);return N.cached.push(r),r}};return N}(e,t);cg(e,n),t.hoistStatic&&function e(t,n,r,i=!1,l=!1){let{children:s}=t,o=[];for(let n=0;n0){if(e>=2){a.codegenNode.patchFlag=-1,o.push(a);continue}}else{let e=a.codegenNode;if(13===e.type){let t=e.patchFlag;if((void 0===t||512===t||1===t)&&ch(a,r)>=2){let t=cm(a);t&&(e.props=r.hoist(t))}e.dynamicProps&&(e.dynamicProps=r.hoist(e.dynamicProps))}}}else if(12===a.type&&(i?0:cp(a,r))>=2){o.push(a);continue}if(1===a.type){let n=1===a.tagType;n&&r.scopes.vSlot++,e(a,t,r,!1,l),n&&r.scopes.vSlot--}else if(11===a.type)e(a,t,r,1===a.children.length,!0);else if(9===a.type)for(let n=0;ne.key===t||e.key.content===t);return n&&n.value}}o.length&&r.transformHoist&&r.transformHoist(s,r,t)}(e,void 0,n,cd(e,e.children[0])),t.ssr||function(e,t){let{helper:n}=t,{children:r}=e;if(1===r.length){let n=r[0];if(cd(e,n)&&n.codegenNode){let r=n.codegenNode;13===r.type&&ad(r,t),e.codegenNode=r}else e.codegenNode=n}else r.length>1&&(e.codegenNode=an(t,n(ok),void 0,e.children,64,void 0,void 0,!0,void 0,!1))}(e,n),e.helpers=new Set([...n.helpers.keys()]),e.components=[...n.components],e.directives=[...n.directives],e.imports=n.imports,e.hoists=n.hoists,e.temps=n.temps,e.cached=n.cached,e.transformed=!0}(l,S({},i,{nodeTransforms:[...s,...t.nodeTransforms||[]],directiveTransforms:S({},o,t.directiveTransforms||{})})),function(e,t={}){let n=function(e,{mode:t="function",prefixIdentifiers:n="module"===t,sourceMap:r=!1,filename:i="template.vue.html",scopeId:l=null,optimizeImports:s=!1,runtimeGlobalName:o="Vue",runtimeModuleName:a="vue",ssrRuntimeModuleName:c="vue/server-renderer",ssr:u=!1,isTS:d=!1,inSSR:p=!1}){let f={mode:t,prefixIdentifiers:n,sourceMap:r,filename:i,scopeId:l,optimizeImports:s,runtimeGlobalName:o,runtimeModuleName:a,ssrRuntimeModuleName:c,ssr:u,isTS:d,inSSR:p,source:e.source,code:"",column:1,line:1,offset:0,indentLevel:0,pure:!1,map:void 0,helper:e=>`_${ae[e]}`,push(e,t=-2,n){f.code+=e},indent(){h(++f.indentLevel)},deindent(e=!1){e?--f.indentLevel:h(--f.indentLevel)},newline(){h(f.indentLevel)}};function h(e){f.push("\n"+" ".repeat(e),0)}return f}(e,t);t.onContextCreated&&t.onContextCreated(n);let{mode:r,push:i,prefixIdentifiers:l,indent:s,deindent:o,newline:a,scopeId:c,ssr:u}=n,d=Array.from(e.helpers),p=d.length>0,f=!l&&"module"!==r;(function(e,t){let{ssr:n,prefixIdentifiers:r,push:i,newline:l,runtimeModuleName:s,runtimeGlobalName:o,ssrRuntimeModuleName:a}=t,c=Array.from(e.helpers);if(c.length>0&&(i(`const _Vue = ${o} -`,-1),e.hoists.length)){let e=[oP,oM,oD,oL,o$].filter(e=>c.includes(e)).map(cb).join(", ");i(`const { ${e} } = _Vue -`,-1)}(function(e,t){if(!e.length)return;t.pure=!0;let{push:n,newline:r}=t;r();for(let i=0;i0)&&a()),e.directives.length&&(c_(e.directives,"directive",n),e.temps>0&&a()),e.temps>0){i("let ");for(let t=0;t0?", ":""}_temp${t}`)}return(e.components.length||e.directives.length||e.temps)&&(i(` -`,0),a()),u||i("return "),e.codegenNode?cC(e.codegenNode,n):i("null"),f&&(o(),i("}")),o(),i("}"),{ast:e,code:n.code,preamble:"",map:n.map?n.map.toJSON():void 0}}(l,i)}(e,S({},ue,t,{nodeTransforms:[ua,...uc,...t.nodeTransforms||[]],directiveTransforms:S({},uu,t.directiveTransforms||{}),transformHoist:null}))}(e,i),s=Function("Vue",l)(oT);return s._rc=!0,ud[n]=s}lF(up);export{nF as BaseTransition,nD as BaseTransitionPropsValidators,i7 as Comment,l6 as DeprecationTypes,e_ as EffectScope,t2 as ErrorCodes,lZ as ErrorTypeStrings,i5 as Fragment,rs as KeepAlive,ek as ReactiveEffect,le as Static,i1 as Suspense,nE as Teleport,i9 as Text,tJ as TrackOpTypes,si as Transition,sX as TransitionGroup,tG as TriggerOpTypes,sH as VueElement,t1 as assertNumber,t6 as callWithAsyncErrorHandling,t3 as callWithErrorHandling,q as camelize,z as capitalize,lv as cloneVNode,l3 as compatUtils,up as compile,lW as computed,og as createApp,lc as createBlock,lS as createCommentVNode,la as createElementBlock,lm as createElementVNode,iE as createHydrationRenderer,r1 as createPropsRestProxy,iN as createRenderer,oy as createSSRApp,rP as createSlots,l_ as createStaticVNode,lb as createTextVNode,lg as createVNode,tU as customRef,rr as defineAsyncComponent,nW as defineComponent,sB as defineCustomElement,rH as defineEmits,rq as defineExpose,rz as defineModel,rW as defineOptions,rj as defineProps,sU as defineSSRCustomElement,rK as defineSlots,lY as devtools,eM as effect,eS as effectScope,lI as getCurrentInstance,ex as getCurrentScope,tZ as getCurrentWatcher,nq as getTransitionRawChildren,ly as guardReactiveProps,lK as h,t4 as handleError,ic as hasInjectionContext,om as hydrate,n9 as hydrateOnIdle,rt as hydrateOnInteraction,re as hydrateOnMediaQuery,n7 as hydrateOnVisible,lz as initCustomFormatter,oS as initDirectivesForSSR,ia as inject,lG as isMemoSame,tk as isProxy,tx as isReactive,tC as isReadonly,tR as isRef,lV as isRuntimeOnly,tT as isShallow,lu as isVNode,tN as markRaw,rY as mergeDefaults,r0 as mergeModels,lk as mergeProps,nr as nextTick,eo as normalizeClass,ea as normalizeProps,en as normalizeStyle,ra as onActivated,rm as onBeforeMount,rb as onBeforeUnmount,ry as onBeforeUpdate,rc as onDeactivated,rT as onErrorCaptured,rg as onMounted,rC as onRenderTracked,rx as onRenderTriggered,eC as onScopeDispose,rS as onServerPrefetch,r_ as onUnmounted,rv as onUpdated,tY as onWatcherCleanup,lr as openBlock,nh as popScopeId,io as provide,tV as proxyRefs,nf as pushScopeId,ns as queuePostFlushCb,ty as reactive,tb as readonly,tI as ref,lF as registerRuntimeCompiler,oh as render,rO as renderList,rM as renderSlot,rw as resolveComponent,rA as resolveDirective,rE as resolveDynamicComponent,l2 as resolveFilter,nB as resolveTransitionHooks,ls as setBlockTracking,l0 as setDevtoolsHook,nH as setTransitionHooks,tv as shallowReactive,t_ as shallowReadonly,tO as shallowRef,iD as ssrContextKey,l1 as ssrUtils,eD as stop,ey as toDisplayString,J as toHandlerKey,rL as toHandlers,tw as toRaw,tW as toRef,tj as toRefs,t$ as toValue,lp as transformVNodeArgs,tD as triggerRef,tL as unref,rQ as useAttrs,sK as useCssModule,sx as useCssVars,sq as useHost,nK as useId,iq as useModel,iL as useSSRContext,sW as useShadowRoot,rG as useSlots,nJ as useTemplateRef,nP as useTransitionState,s8 as vModelCheckbox,or as vModelDynamic,s9 as vModelRadio,s7 as vModelSelect,s4 as vModelText,sb as vShow,lQ as version,lX as warn,iB as watch,i$ as watchEffect,iF as watchPostEffect,iV as watchSyncEffect,r2 as withAsyncContext,ng as withCtx,rJ as withDefaults,ny as withDirectives,ou as withKeys,lJ as withMemo,oa as withModifiers,nm as withScopeId}; +**/let e,t,n,r,i,l,s,o,a,c,u,d,p;function h(e){let t=Object.create(null);for(let n of e.split(","))t[n]=1;return e=>e in t}let f={},m=[],g=()=>{},y=()=>!1,b=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&(e.charCodeAt(2)>122||97>e.charCodeAt(2)),_=e=>e.startsWith("onUpdate:"),S=Object.assign,x=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},C=Object.prototype.hasOwnProperty,T=(e,t)=>C.call(e,t),k=Array.isArray,w=e=>"[object Map]"===D(e),N=e=>"[object Set]"===D(e),E=e=>"[object Date]"===D(e),A=e=>"function"==typeof e,R=e=>"string"==typeof e,I=e=>"symbol"==typeof e,O=e=>null!==e&&"object"==typeof e,P=e=>(O(e)||A(e))&&A(e.then)&&A(e.catch),M=Object.prototype.toString,D=e=>M.call(e),$=e=>"[object Object]"===D(e),L=e=>R(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,F=h(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),V=h("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),B=e=>{let t=Object.create(null);return n=>t[n]||(t[n]=e(n))},U=/-(\w)/g,j=B(e=>e.replace(U,(e,t)=>t?t.toUpperCase():"")),H=/\B([A-Z])/g,q=B(e=>e.replace(H,"-$1").toLowerCase()),W=B(e=>e.charAt(0).toUpperCase()+e.slice(1)),K=B(e=>e?`on${W(e)}`:""),z=(e,t)=>!Object.is(e,t),J=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},Q=e=>{let t=parseFloat(e);return isNaN(t)?e:t},X=e=>{let t=R(e)?Number(e):NaN;return isNaN(t)?e:t},Z=()=>e||(e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{}),Y=h("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol");function ee(e){if(k(e)){let t={};for(let n=0;n{if(e){let n=e.split(en);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function el(e){let t="";if(R(e))t=e;else if(k(e))for(let n=0;nep(e,t))}let ef=e=>!!(e&&!0===e.__v_isRef),em=e=>R(e)?e:null==e?"":k(e)||O(e)&&(e.toString===M||!A(e.toString))?ef(e)?em(e.value):JSON.stringify(e,eg,2):String(e),eg=(e,t)=>{if(ef(t))return eg(e,t.value);if(w(t))return{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[ev(t,r)+" =>"]=n,e),{})};if(N(t))return{[`Set(${t.size})`]:[...t.values()].map(e=>ev(e))};if(I(t))return ev(t);if(O(t)&&!k(t)&&!$(t))return String(t);return t},ev=(e,t="")=>{var n;return I(e)?`Symbol(${null!=(n=e.description)?n:t})`:e};class ey{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=t,!e&&t&&(this.index=(t.scopes||(t.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){let e,t;if(this._isPaused=!0,this.scopes)for(e=0,t=this.scopes.length;e0&&0==--this._on&&(t=this.prevScope,this.prevScope=void 0)}stop(e){if(this._active){let t,n;for(t=0,this._active=!1,n=this.effects.length;t0)){if(i){let e=i;for(i=void 0;e;){let t=e.next;e.next=void 0,e.flags&=-9,e=t}}for(;r;){let t=r;for(r=void 0;t;){let n=t.next;if(t.next=void 0,t.flags&=-9,1&t.flags)try{t.trigger()}catch(t){e||(e=t)}t=n}}if(e)throw e}}function eN(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function eE(e){let t,n=e.depsTail,r=n;for(;r;){let e=r.prevDep;-1===r.version?(r===n&&(n=e),eI(r),function(e){let{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=e}e.deps=t,e.depsTail=n}function eA(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(eR(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function eR(e){if(4&e.flags&&!(16&e.flags)||(e.flags&=-17,e.globalVersion===eV)||(e.globalVersion=eV,!e.isSSR&&128&e.flags&&(!e.deps&&!e._dirty||!eA(e))))return;e.flags|=2;let t=e.dep,r=n,i=eM;n=e,eM=!0;try{eN(e);let n=e.fn(e._value);(0===t.version||z(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(e){throw t.version++,e}finally{n=r,eM=i,eE(e),e.flags&=-3}}function eI(e,t=!1){let{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)eI(e,!0)}t||--n.sc||!n.map||n.map.delete(n.key)}function eO(e,t){e.effect instanceof eC&&(e=e.effect.fn);let n=new eC(e);t&&S(n,t);try{n.run()}catch(e){throw n.stop(),e}let r=n.run.bind(n);return r.effect=n,r}function eP(e){e.effect.stop()}let eM=!0,eD=[];function e$(){eD.push(eM),eM=!1}function eL(){let e=eD.pop();eM=void 0===e||e}function eF(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let e=n;n=void 0;try{t()}finally{n=e}}}let eV=0;class eB{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class eU{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!n||!eM||n===this.computed)return;let t=this.activeLink;if(void 0===t||t.sub!==n)t=this.activeLink=new eB(n,this),n.deps?(t.prevDep=n.depsTail,n.depsTail.nextDep=t,n.depsTail=t):n.deps=n.depsTail=t,function e(t){if(t.dep.sc++,4&t.sub.flags){let n=t.dep.computed;if(n&&!t.dep.subs){n.flags|=20;for(let t=n.deps;t;t=t.nextDep)e(t)}let r=t.dep.subs;r!==t&&(t.prevSub=r,r&&(r.nextSub=t)),t.dep.subs=t}}(t);else if(-1===t.version&&(t.version=this.version,t.nextDep)){let e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=n.depsTail,t.nextDep=void 0,n.depsTail.nextDep=t,n.depsTail=t,n.deps===t&&(n.deps=e)}return t}trigger(e){this.version++,eV++,this.notify(e)}notify(e){eT++;try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{ew()}}}let ej=new WeakMap,eH=Symbol(""),eq=Symbol(""),eW=Symbol("");function eK(e,t,r){if(eM&&n){let t=ej.get(e);t||ej.set(e,t=new Map);let n=t.get(r);n||(t.set(r,n=new eU),n.map=t,n.key=r),n.track()}}function ez(e,t,n,r,i,l){let s=ej.get(e);if(!s)return void eV++;let o=e=>{e&&e.trigger()};if(eT++,"clear"===t)s.forEach(o);else{let i=k(e),l=i&&L(n);if(i&&"length"===n){let e=Number(r);s.forEach((t,n)=>{("length"===n||n===eW||!I(n)&&n>=e)&&o(t)})}else switch((void 0!==n||s.has(void 0))&&o(s.get(n)),l&&o(s.get(eW)),t){case"add":i?l&&o(s.get("length")):(o(s.get(eH)),w(e)&&o(s.get(eq)));break;case"delete":!i&&(o(s.get(eH)),w(e)&&o(s.get(eq)));break;case"set":w(e)&&o(s.get(eH))}}ew()}function eJ(e){let t=tT(e);return t===e?t:(eK(t,"iterate",eW),tx(e)?t:t.map(tw))}function eG(e){return eK(e=tT(e),"iterate",eW),e}let eQ={__proto__:null,[Symbol.iterator](){return eX(this,Symbol.iterator,tw)},concat(...e){return eJ(this).concat(...e.map(e=>k(e)?eJ(e):e))},entries(){return eX(this,"entries",e=>(e[1]=tw(e[1]),e))},every(e,t){return eY(this,"every",e,t,void 0,arguments)},filter(e,t){return eY(this,"filter",e,t,e=>e.map(tw),arguments)},find(e,t){return eY(this,"find",e,t,tw,arguments)},findIndex(e,t){return eY(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return eY(this,"findLast",e,t,tw,arguments)},findLastIndex(e,t){return eY(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return eY(this,"forEach",e,t,void 0,arguments)},includes(...e){return e1(this,"includes",e)},indexOf(...e){return e1(this,"indexOf",e)},join(e){return eJ(this).join(e)},lastIndexOf(...e){return e1(this,"lastIndexOf",e)},map(e,t){return eY(this,"map",e,t,void 0,arguments)},pop(){return e2(this,"pop")},push(...e){return e2(this,"push",e)},reduce(e,...t){return e0(this,"reduce",e,t)},reduceRight(e,...t){return e0(this,"reduceRight",e,t)},shift(){return e2(this,"shift")},some(e,t){return eY(this,"some",e,t,void 0,arguments)},splice(...e){return e2(this,"splice",e)},toReversed(){return eJ(this).toReversed()},toSorted(e){return eJ(this).toSorted(e)},toSpliced(...e){return eJ(this).toSpliced(...e)},unshift(...e){return e2(this,"unshift",e)},values(){return eX(this,"values",tw)}};function eX(e,t,n){let r=eG(e),i=r[t]();return r===e||tx(e)||(i._next=i.next,i.next=()=>{let e=i._next();return e.value&&(e.value=n(e.value)),e}),i}let eZ=Array.prototype;function eY(e,t,n,r,i,l){let s=eG(e),o=s!==e&&!tx(e),a=s[t];if(a!==eZ[t]){let t=a.apply(e,l);return o?tw(t):t}let c=n;s!==e&&(o?c=function(t,r){return n.call(this,tw(t),r,e)}:n.length>2&&(c=function(t,r){return n.call(this,t,r,e)}));let u=a.call(s,c,r);return o&&i?i(u):u}function e0(e,t,n,r){let i=eG(e),l=n;return i!==e&&(tx(e)?n.length>3&&(l=function(t,r,i){return n.call(this,t,r,i,e)}):l=function(t,r,i){return n.call(this,t,tw(r),i,e)}),i[t](l,...r)}function e1(e,t,n){let r=tT(e);eK(r,"iterate",eW);let i=r[t](...n);return(-1===i||!1===i)&&tC(n[0])?(n[0]=tT(n[0]),r[t](...n)):i}function e2(e,t,n=[]){e$(),eT++;let r=tT(e)[t].apply(e,n);return ew(),eL(),r}let e3=h("__proto__,__v_isRef,__isVue"),e6=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>"arguments"!==e&&"caller"!==e).map(e=>Symbol[e]).filter(I));function e4(e){I(e)||(e=String(e));let t=tT(this);return eK(t,"has",e),t.hasOwnProperty(e)}class e8{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if("__v_skip"===t)return e.__v_skip;let r=this._isReadonly,i=this._isShallow;if("__v_isReactive"===t)return!r;if("__v_isReadonly"===t)return r;if("__v_isShallow"===t)return i;if("__v_raw"===t)return n===(r?i?tf:th:i?tp:td).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;let l=k(e);if(!r){let e;if(l&&(e=eQ[t]))return e;if("hasOwnProperty"===t)return e4}let s=Reflect.get(e,t,tE(e)?e:n);return(I(t)?e6.has(t):e3(t))||(r||eK(e,"get",t),i)?s:tE(s)?l&&L(t)?s:s.value:O(s)?r?tv(s):tm(s):s}}class e5 extends e8{constructor(e=!1){super(!1,e)}set(e,t,n,r){let i=e[t];if(!this._isShallow){let t=tS(i);if(tx(n)||tS(n)||(i=tT(i),n=tT(n)),!k(e)&&tE(i)&&!tE(n))if(t)return!1;else return i.value=n,!0}let l=k(e)&&L(t)?Number(t)e,ti=e=>Reflect.getPrototypeOf(e);function tl(e){return function(...t){return"delete"!==e&&("clear"===e?void 0:this)}}function ts(e,t){let n=function(e,t){let n={get(n){let r=this.__v_raw,i=tT(r),l=tT(n);e||(z(n,l)&&eK(i,"get",n),eK(i,"get",l));let{has:s}=ti(i),o=t?tr:e?tN:tw;return s.call(i,n)?o(r.get(n)):s.call(i,l)?o(r.get(l)):void(r!==i&&r.get(n))},get size(){let t=this.__v_raw;return e||eK(tT(t),"iterate",eH),Reflect.get(t,"size",t)},has(t){let n=this.__v_raw,r=tT(n),i=tT(t);return e||(z(t,i)&&eK(r,"has",t),eK(r,"has",i)),t===i?n.has(t):n.has(t)||n.has(i)},forEach(n,r){let i=this,l=i.__v_raw,s=tT(l),o=t?tr:e?tN:tw;return e||eK(s,"iterate",eH),l.forEach((e,t)=>n.call(r,o(e),o(t),i))}};return S(n,e?{add:tl("add"),set:tl("set"),delete:tl("delete"),clear:tl("clear")}:{add(e){t||tx(e)||tS(e)||(e=tT(e));let n=tT(this);return ti(n).has.call(n,e)||(n.add(e),ez(n,"add",e,e)),this},set(e,n){t||tx(n)||tS(n)||(n=tT(n));let r=tT(this),{has:i,get:l}=ti(r),s=i.call(r,e);s||(e=tT(e),s=i.call(r,e));let o=l.call(r,e);return r.set(e,n),s?z(n,o)&&ez(r,"set",e,n):ez(r,"add",e,n),this},delete(e){let t=tT(this),{has:n,get:r}=ti(t),i=n.call(t,e);i||(e=tT(e),i=n.call(t,e)),r&&r.call(t,e);let l=t.delete(e);return i&&ez(t,"delete",e,void 0),l},clear(){let e=tT(this),t=0!==e.size,n=e.clear();return t&&ez(e,"clear",void 0,void 0),n}}),["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=function(...n){let i=this.__v_raw,l=tT(i),s=w(l),o="entries"===r||r===Symbol.iterator&&s,a=i[r](...n),c=t?tr:e?tN:tw;return e||eK(l,"iterate","keys"===r&&s?eq:eH),{next(){let{value:e,done:t}=a.next();return t?{value:e,done:t}:{value:o?[c(e[0]),c(e[1])]:c(e),done:t}},[Symbol.iterator](){return this}}}}),n}(e,t);return(t,r,i)=>"__v_isReactive"===r?!e:"__v_isReadonly"===r?e:"__v_raw"===r?t:Reflect.get(T(n,r)&&r in t?n:t,r,i)}let to={get:ts(!1,!1)},ta={get:ts(!1,!0)},tc={get:ts(!0,!1)},tu={get:ts(!0,!0)},td=new WeakMap,tp=new WeakMap,th=new WeakMap,tf=new WeakMap;function tm(e){return tS(e)?e:tb(e,!1,e7,to,td)}function tg(e){return tb(e,!1,tt,ta,tp)}function tv(e){return tb(e,!0,te,tc,th)}function ty(e){return tb(e,!0,tn,tu,tf)}function tb(e,t,n,r,i){var l;if(!O(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;let s=(l=e).__v_skip||!Object.isExtensible(l)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}(D(l).slice(8,-1));if(0===s)return e;let o=i.get(e);if(o)return o;let a=new Proxy(e,2===s?r:n);return i.set(e,a),a}function t_(e){return tS(e)?t_(e.__v_raw):!!(e&&e.__v_isReactive)}function tS(e){return!!(e&&e.__v_isReadonly)}function tx(e){return!!(e&&e.__v_isShallow)}function tC(e){return!!e&&!!e.__v_raw}function tT(e){let t=e&&e.__v_raw;return t?tT(t):e}function tk(e){return!T(e,"__v_skip")&&Object.isExtensible(e)&&G(e,"__v_skip",!0),e}let tw=e=>O(e)?tm(e):e,tN=e=>O(e)?tv(e):e;function tE(e){return!!e&&!0===e.__v_isRef}function tA(e){return tI(e,!1)}function tR(e){return tI(e,!0)}function tI(e,t){return tE(e)?e:new tO(e,t)}class tO{constructor(e,t){this.dep=new eU,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:tT(e),this._value=t?e:tw(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||tx(e)||tS(e);z(e=n?e:tT(e),t)&&(this._rawValue=e,this._value=n?e:tw(e),this.dep.trigger())}}function tP(e){e.dep&&e.dep.trigger()}function tM(e){return tE(e)?e.value:e}function tD(e){return A(e)?e():tM(e)}let t$={get:(e,t,n)=>"__v_raw"===t?e:tM(Reflect.get(e,t,n)),set:(e,t,n,r)=>{let i=e[t];return tE(i)&&!tE(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function tL(e){return t_(e)?e:new Proxy(e,t$)}class tF{constructor(e){this.__v_isRef=!0,this._value=void 0;let t=this.dep=new eU,{get:n,set:r}=e(t.track.bind(t),t.trigger.bind(t));this._get=n,this._set=r}get value(){return this._value=this._get()}set value(e){this._set(e)}}function tV(e){return new tF(e)}function tB(e){let t=k(e)?Array(e.length):{};for(let n in e)t[n]=tq(e,n);return t}class tU{constructor(e,t,n){this._object=e,this._key=t,this._defaultValue=n,this.__v_isRef=!0,this._value=void 0}get value(){let e=this._object[this._key];return this._value=void 0===e?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return function(e,t){let n=ej.get(e);return n&&n.get(t)}(tT(this._object),this._key)}}class tj{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function tH(e,t,n){return tE(e)?e:A(e)?new tj(e):O(e)&&arguments.length>1?tq(e,t,n):tA(e)}function tq(e,t,n){let r=e[t];return tE(r)?r:new tU(e,t,n)}class tW{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new eU(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=eV-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(8&this.flags)&&n!==this)return ek(this,!0),!0}get value(){let e=this.dep.track();return eR(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}let tK={GET:"get",HAS:"has",ITERATE:"iterate"},tz={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},tJ={},tG=new WeakMap;function tQ(){return d}function tX(e,t=!1,n=d){if(n){let t=tG.get(n);t||tG.set(n,t=[]),t.push(e)}}function tZ(e,t=1/0,n){if(t<=0||!O(e)||e.__v_skip||(n=n||new Set).has(e))return e;if(n.add(e),t--,tE(e))tZ(e.value,t,n);else if(k(e))for(let r=0;r{tZ(e,t,n)});else if($(e)){for(let r in e)tZ(e[r],t,n);for(let r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&tZ(e[r],t,n)}return e}function tY(e,t){}let t0={SETUP_FUNCTION:0,0:"SETUP_FUNCTION",RENDER_FUNCTION:1,1:"RENDER_FUNCTION",NATIVE_EVENT_HANDLER:5,5:"NATIVE_EVENT_HANDLER",COMPONENT_EVENT_HANDLER:6,6:"COMPONENT_EVENT_HANDLER",VNODE_HOOK:7,7:"VNODE_HOOK",DIRECTIVE_HOOK:8,8:"DIRECTIVE_HOOK",TRANSITION_HOOK:9,9:"TRANSITION_HOOK",APP_ERROR_HANDLER:10,10:"APP_ERROR_HANDLER",APP_WARN_HANDLER:11,11:"APP_WARN_HANDLER",FUNCTION_REF:12,12:"FUNCTION_REF",ASYNC_COMPONENT_LOADER:13,13:"ASYNC_COMPONENT_LOADER",SCHEDULER:14,14:"SCHEDULER",COMPONENT_UPDATE:15,15:"COMPONENT_UPDATE",APP_UNMOUNT_CLEANUP:16,16:"APP_UNMOUNT_CLEANUP"};function t1(e,t,n,r){try{return r?e(...r):e()}catch(e){t3(e,t,n)}}function t2(e,t,n,r){if(A(e)){let i=t1(e,t,n,r);return i&&P(i)&&i.catch(e=>{t3(e,t,n)}),i}if(k(e)){let i=[];for(let l=0;l=no(n)?t6.push(e):t6.splice(function(e){let t=t4+1,n=t6.length;for(;t>>1,i=t6[r],l=no(i);lno(e)-no(t));if(t8.length=0,t5)return void t5.push(...e);for(t9=0,t5=e;t9null==e.id?2&e.flags?-1:1/0:e.id,na=null,nc=null;function nu(e){let t=na;return na=e,nc=e&&e.type.__scopeId||null,t}function nd(e){nc=e}function np(){nc=null}let nh=e=>nf;function nf(e,t=na,n){if(!t||e._n)return e;let r=(...n)=>{let i;r._d&&i7(-1);let l=nu(t);try{i=e(...n)}finally{nu(l),r._d&&i7(1)}return i};return r._n=!0,r._c=!0,r._d=!0,r}function nm(e,t){if(null===na)return e;let n=l$(na),r=e.dirs||(e.dirs=[]);for(let e=0;ee&&(e.disabled||""===e.disabled),nb=e=>e&&(e.defer||""===e.defer),n_=e=>"undefined"!=typeof SVGElement&&e instanceof SVGElement,nS=e=>"function"==typeof MathMLElement&&e instanceof MathMLElement,nx=(e,t)=>{let n=e&&e.to;return R(n)?t?t(n):null:n},nC={name:"Teleport",__isTeleport:!0,process(e,t,n,r,i,l,s,o,a,c){let{mc:u,pc:d,pbc:p,o:{insert:h,querySelector:f,createText:m,createComment:g}}=c,y=ny(t.props),{shapeFlag:b,children:_,dynamicChildren:S}=t;if(null==e){let e=t.el=m(""),c=t.anchor=m("");h(e,n,r),h(c,n,r);let d=(e,t)=>{16&b&&(i&&i.isCE&&(i.ce._teleportTarget=e),u(_,e,t,i,l,s,o,a))},p=()=>{let e=t.target=nx(t.props,f),n=nN(e,t,m,h);e&&("svg"!==s&&n_(e)?s="svg":"mathml"!==s&&nS(e)&&(s="mathml"),y||(d(e,n),nw(t,!1)))};y&&(d(n,c),nw(t,!0)),nb(t.props)?(t.el.__isMounted=!1,ib(()=>{p(),delete t.el.__isMounted},l)):p()}else{if(nb(t.props)&&!1===e.el.__isMounted)return void ib(()=>{nC.process(e,t,n,r,i,l,s,o,a,c)},l);t.el=e.el,t.targetStart=e.targetStart;let u=t.anchor=e.anchor,h=t.target=e.target,m=t.targetAnchor=e.targetAnchor,g=ny(e.props),b=g?n:h,_=g?u:m;if("svg"===s||n_(h)?s="svg":("mathml"===s||nS(h))&&(s="mathml"),S?(p(e.dynamicChildren,S,b,i,l,s,o),iw(e,t,!0)):a||d(e,t,b,_,i,l,s,o,!1),y)g?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):nT(t,n,u,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){let e=t.target=nx(t.props,f);e&&nT(t,e,null,c,0)}else g&&nT(t,h,m,c,1);nw(t,y)}},remove(e,t,n,{um:r,o:{remove:i}},l){let{shapeFlag:s,children:o,anchor:a,targetStart:c,targetAnchor:u,target:d,props:p}=e;if(d&&(i(c),i(u)),l&&i(a),16&s){let e=l||!ny(p);for(let i=0;i{e.isMounted=!0}),rf(()=>{e.isUnmounting=!0}),e}let nI=[Function,Array],nO={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:nI,onEnter:nI,onAfterEnter:nI,onEnterCancelled:nI,onBeforeLeave:nI,onLeave:nI,onAfterLeave:nI,onLeaveCancelled:nI,onBeforeAppear:nI,onAppear:nI,onAfterAppear:nI,onAppearCancelled:nI},nP=e=>{let t=e.subTree;return t.component?nP(t.component):t};function nM(e){let t=e[0];if(e.length>1){for(let n of e)if(n.type!==i2){t=n;break}}return t}let nD={name:"BaseTransition",props:nO,setup(e,{slots:t}){let n=lT(),r=nR();return()=>{let i=t.default&&nU(t.default(),!0);if(!i||!i.length)return;let l=nM(i),s=tT(e),{mode:o}=s;if(r.isLeaving)return nF(l);let a=nV(l);if(!a)return nF(l);let c=nL(a,s,r,n,e=>c=e);a.type!==i2&&nB(a,c);let u=n.subTree&&nV(n.subTree);if(u&&u.type!==i2&&!li(a,u)&&nP(n).type!==i2){let e=nL(u,s,r,n);if(nB(u,e),"out-in"===o&&a.type!==i2)return r.isLeaving=!0,e.afterLeave=()=>{r.isLeaving=!1,8&n.job.flags||n.update(),delete e.afterLeave,u=void 0},nF(l);"in-out"===o&&a.type!==i2?e.delayLeave=(e,t,n)=>{n$(r,u)[String(u.key)]=u,e[nE]=()=>{t(),e[nE]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{n(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return l}}};function n$(e,t){let{leavingVNodes:n}=e,r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function nL(e,t,n,r,i){let{appear:l,mode:s,persisted:o=!1,onBeforeEnter:a,onEnter:c,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:p,onLeave:h,onAfterLeave:f,onLeaveCancelled:m,onBeforeAppear:g,onAppear:y,onAfterAppear:b,onAppearCancelled:_}=t,S=String(e.key),x=n$(n,e),C=(e,t)=>{e&&t2(e,r,9,t)},T=(e,t)=>{let n=t[1];C(e,t),k(e)?e.every(e=>e.length<=1)&&n():e.length<=1&&n()},w={mode:s,persisted:o,beforeEnter(t){let r=a;if(!n.isMounted)if(!l)return;else r=g||a;t[nE]&&t[nE](!0);let i=x[S];i&&li(e,i)&&i.el[nE]&&i.el[nE](),C(r,[t])},enter(e){let t=c,r=u,i=d;if(!n.isMounted)if(!l)return;else t=y||c,r=b||u,i=_||d;let s=!1,o=e[nA]=t=>{s||(s=!0,t?C(i,[e]):C(r,[e]),w.delayedLeave&&w.delayedLeave(),e[nA]=void 0)};t?T(t,[e,o]):o()},leave(t,r){let i=String(e.key);if(t[nA]&&t[nA](!0),n.isUnmounting)return r();C(p,[t]);let l=!1,s=t[nE]=n=>{l||(l=!0,r(),n?C(m,[t]):C(f,[t]),t[nE]=void 0,x[i]===e&&delete x[i])};x[i]=e,h?T(h,[t,s]):s()},clone(e){let l=nL(e,t,n,r,i);return i&&i(l),l}};return w}function nF(e){if(re(e))return(e=ld(e)).children=null,e}function nV(e){if(!re(e))return e.type.__isTeleport&&e.children?nM(e.children):e;if(e.component)return e.component.subTree;let{shapeFlag:t,children:n}=e;if(n){if(16&t)return n[0];if(32&t&&A(n.default))return n.default()}}function nB(e,t){6&e.shapeFlag&&e.component?(e.transition=t,nB(e.component.subTree,t)):128&e.shapeFlag?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function nU(e,t=!1,n){let r=[],i=0;for(let l=0;l1)for(let e=0;en.value,set:e=>n.value=e}),n}function nK(e,t,n,r,i=!1){if(k(e))return void e.forEach((e,l)=>nK(e,t&&(k(t)?t[l]:t),n,r,i));if(n5(r)&&!i){512&r.shapeFlag&&r.type.__asyncResolved&&r.component.subTree.component&&nK(e,t,n,r.component.subTree);return}let l=4&r.shapeFlag?l$(r.component):r.el,s=i?null:l,{i:o,r:a}=e,c=t&&t.r,u=o.refs===f?o.refs={}:o.refs,d=o.setupState,p=tT(d),h=d===f?()=>!1:e=>T(p,e);if(null!=c&&c!==a&&(R(c)?(u[c]=null,h(c)&&(d[c]=null)):tE(c)&&(c.value=null)),A(a))t1(a,o,12,[s,u]);else{let t=R(a),r=tE(a);if(t||r){let o=()=>{if(e.f){let n=t?h(a)?d[a]:u[a]:a.value;i?k(n)&&x(n,l):k(n)?n.includes(l)||n.push(l):t?(u[a]=[l],h(a)&&(d[a]=u[a])):(a.value=[l],e.k&&(u[e.k]=a.value))}else t?(u[a]=s,h(a)&&(d[a]=s)):r&&(a.value=s,e.k&&(u[e.k]=s))};s?(o.id=-1,ib(o,n)):o()}}}let nz=!1,nJ=()=>{nz||(console.error("Hydration completed but contains mismatches."),nz=!0)},nG=e=>{if(1===e.nodeType){if(e.namespaceURI.includes("svg")&&"foreignObject"!==e.tagName)return"svg";if(e.namespaceURI.includes("MathML"))return"mathml"}},nQ=e=>8===e.nodeType;function nX(e){let{mt:t,p:n,o:{patchProp:r,createText:i,nextSibling:l,parentNode:s,remove:o,insert:a,createComment:c}}=e,u=(n,r,o,c,b,_=!1)=>{_=_||!!r.dynamicChildren;let S=nQ(n)&&"["===n.data,x=()=>f(n,r,o,c,b,S),{type:C,ref:T,shapeFlag:k,patchFlag:w}=r,N=n.nodeType;r.el=n,-2===w&&(_=!1,r.dynamicChildren=null);let E=null;switch(C){case i1:3!==N?""===r.children?(a(r.el=i(""),s(n),n),E=n):E=x():(n.data!==r.children&&(nJ(),n.data=r.children),E=l(n));break;case i2:y(n)?(E=l(n),g(r.el=n.content.firstChild,n,o)):E=8!==N||S?x():l(n);break;case i3:if(S&&(N=(n=l(n)).nodeType),1===N||3===N){E=n;let e=!r.children.length;for(let t=0;t{s=s||!!t.dynamicChildren;let{type:a,props:c,patchFlag:u,shapeFlag:d,dirs:h,transition:f}=t,m="input"===a||"option"===a;if(m||-1!==u){let a;h&&ng(t,null,n,"created");let _=!1;if(y(e)){_=ik(null,f)&&n&&n.vnode.props&&n.vnode.props.appear;let r=e.content.firstChild;if(_){let e=r.getAttribute("class");e&&(r.$cls=e),f.beforeEnter(r)}g(r,e,n),t.el=e=r}if(16&d&&!(c&&(c.innerHTML||c.textContent))){let r=p(e.firstChild,t,e,n,i,l,s);for(;r;){n0(e,1)||nJ();let t=r;r=r.nextSibling,o(t)}}else if(8&d){let n=t.children;` +`===n[0]&&("PRE"===e.tagName||"TEXTAREA"===e.tagName)&&(n=n.slice(1)),e.textContent!==n&&(n0(e,0)||nJ(),e.textContent=t.children)}if(c){if(m||!s||48&u){let t=e.tagName.includes("-");for(let i in c)(m&&(i.endsWith("value")||"indeterminate"===i)||b(i)&&!F(i)||"."===i[0]||t)&&r(e,i,null,c[i],void 0,n)}else if(c.onClick)r(e,"onClick",null,c.onClick,void 0,n);else if(4&u&&t_(c.style))for(let e in c.style)c.style[e]}(a=c&&c.onVnodeBeforeMount)&&lb(a,n,t),h&&ng(t,null,n,"beforeMount"),((a=c&&c.onVnodeMounted)||h||_)&&iZ(()=>{a&&lb(a,n,t),_&&f.enter(e),h&&ng(t,null,n,"mounted")},i)}return e.nextSibling},p=(e,t,r,s,o,c,d)=>{d=d||!!t.dynamicChildren;let p=t.children,h=p.length;for(let t=0;t{let{slotScopeIds:u}=t;u&&(i=i?i.concat(u):u);let d=s(e),h=p(l(e),t,d,n,r,i,o);return h&&nQ(h)&&"]"===h.data?l(t.anchor=h):(nJ(),a(t.anchor=c("]"),d,h),h)},f=(e,t,r,i,a,c)=>{if(n0(e.parentElement,1)||nJ(),t.el=null,c){let t=m(e);for(;;){let n=l(e);if(n&&n!==t)o(n);else break}}let u=l(e),d=s(e);return o(e),n(null,t,d,u,r,i,nG(d),a),r&&(r.vnode.el=t.el,iW(r,t.el)),u},m=(e,t="[",n="]")=>{let r=0;for(;e;)if((e=l(e))&&nQ(e)&&(e.data===t&&r++,e.data===n))if(0===r)return l(e);else r--;return e},g=(e,t,n)=>{let r=t.parentNode;r&&r.replaceChild(e,t);let i=n;for(;i;)i.vnode.el===t&&(i.vnode.el=i.subTree.el=e),i=i.parent},y=e=>1===e.nodeType&&"TEMPLATE"===e.tagName;return[(e,t)=>{if(!t.hasChildNodes()){n(null,e,t),ns(),t._vnode=e;return}u(t.firstChild,e,null,null,null),ns(),t._vnode=e},u]}let nZ="data-allow-mismatch",nY={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function n0(e,t){if(0===t||1===t)for(;e&&!e.hasAttribute(nZ);)e=e.parentElement;let n=e&&e.getAttribute(nZ);if(null==n)return!1;{if(""===n)return!0;let e=n.split(",");return!!(0===t&&e.includes("children"))||e.includes(nY[t])}}let n1=Z().requestIdleCallback||(e=>setTimeout(e,1)),n2=Z().cancelIdleCallback||(e=>clearTimeout(e)),n3=(e=1e4)=>t=>{let n=n1(t,{timeout:e});return()=>n2(n)},n6=e=>(t,n)=>{let r=new IntersectionObserver(e=>{for(let n of e)if(n.isIntersecting){r.disconnect(),t();break}},e);return n(e=>{if(e instanceof Element){if(function(e){let{top:t,left:n,bottom:r,right:i}=e.getBoundingClientRect(),{innerHeight:l,innerWidth:s}=window;return(t>0&&t0&&r0&&n0&&ir.disconnect()},n4=e=>t=>{if(e){let n=matchMedia(e);if(!n.matches)return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t);t()}},n8=(e=[])=>(t,n)=>{R(e)&&(e=[e]);let r=!1,i=e=>{r||(r=!0,l(),t(),e.target.dispatchEvent(new e.constructor(e.type,e)))},l=()=>{n(t=>{for(let n of e)t.removeEventListener(n,i)})};return n(t=>{for(let n of e)t.addEventListener(n,i,{once:!0})}),l},n5=e=>!!e.type.__asyncLoader;function n9(e){let t;A(e)&&(e={loader:e});let{loader:n,loadingComponent:r,errorComponent:i,delay:l=200,hydrate:s,timeout:o,suspensible:a=!0,onError:c}=e,u=null,d=0,p=()=>{let e;return u||(e=u=n().catch(e=>{if(e=e instanceof Error?e:Error(String(e)),c)return new Promise((t,n)=>{c(e,()=>t((d++,u=null,p())),()=>n(e),d+1)});throw e}).then(n=>e!==u&&u?u:(n&&(n.__esModule||"Module"===n[Symbol.toStringTag])&&(n=n.default),t=n,n)))};return nj({name:"AsyncComponentWrapper",__asyncLoader:p,__asyncHydrate(e,n,r){let i=s?()=>{let t=s(()=>{r()},t=>(function(e,t){if(nQ(e)&&"["===e.data){let n=1,r=e.nextSibling;for(;r;){if(1===r.nodeType){if(!1===t(r))break}else if(nQ(r))if("]"===r.data){if(0==--n)break}else"["===r.data&&n++;r=r.nextSibling}}else t(e)})(e,t));t&&(n.bum||(n.bum=[])).push(t),(n.u||(n.u=[])).push(()=>!0)}:r;t?i():p().then(()=>!n.isUnmounted&&i())},get __asyncResolved(){return t},setup(){let e=lC;if(nq(e),t)return()=>n7(t,e);let n=t=>{u=null,t3(t,e,13,!i)};if(a&&e.suspense||lE)return p().then(t=>()=>n7(t,e)).catch(e=>(n(e),()=>i?lc(i,{error:e}):null));let s=tA(!1),c=tA(),d=tA(!!l);return l&&setTimeout(()=>{d.value=!1},l),null!=o&&setTimeout(()=>{if(!s.value&&!c.value){let e=Error(`Async component timed out after ${o}ms.`);n(e),c.value=e}},o),p().then(()=>{s.value=!0,e.parent&&re(e.parent.vnode)&&e.parent.update()}).catch(e=>{n(e),c.value=e}),()=>s.value&&t?n7(t,e):c.value&&i?lc(i,{error:c.value}):r&&!d.value?lc(r):void 0}})}function n7(e,t){let{ref:n,props:r,children:i,ce:l}=t.vnode,s=lc(e,r,i);return s.ref=n,s.ce=l,delete t.vnode.ce,s}let re=e=>e.type.__isKeepAlive,rt={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){let n=lT(),r=n.ctx;if(!r.renderer)return()=>{let e=t.default&&t.default();return e&&1===e.length?e[0]:e};let i=new Map,l=new Set,s=null,o=n.suspense,{renderer:{p:a,m:c,um:u,o:{createElement:d}}}=r,p=d("div");function h(e){rs(e),u(e,n,o,!0)}function f(e){i.forEach((t,n)=>{let r=lL(t.type);r&&!e(r)&&m(n)})}function m(e){let t=i.get(e);!t||s&&li(t,s)?s&&rs(s):h(t),i.delete(e),l.delete(e)}r.activate=(e,t,n,r,i)=>{let l=e.component;c(e,t,n,0,o),a(l.vnode,e,t,n,l,o,r,e.slotScopeIds,i),ib(()=>{l.isDeactivated=!1,l.a&&J(l.a);let t=e.props&&e.props.onVnodeMounted;t&&lb(t,l.parent,e)},o)},r.deactivate=e=>{let t=e.component;iN(t.m),iN(t.a),c(e,p,null,1,o),ib(()=>{t.da&&J(t.da);let n=e.props&&e.props.onVnodeUnmounted;n&&lb(n,t.parent,e),t.isDeactivated=!0},o)},iP(()=>[e.include,e.exclude],([e,t])=>{e&&f(t=>rn(e,t)),t&&f(e=>!rn(t,e))},{flush:"post",deep:!0});let g=null,y=()=>{null!=g&&(iK(n.subTree.type)?ib(()=>{i.set(g,ro(n.subTree))},n.subTree.suspense):i.set(g,ro(n.subTree)))};return rd(y),rh(y),rf(()=>{i.forEach(e=>{let{subTree:t,suspense:r}=n,i=ro(t);if(e.type===i.type&&e.key===i.key){rs(i);let e=i.component.da;e&&ib(e,r);return}h(e)})}),()=>{if(g=null,!t.default)return s=null;let n=t.default(),r=n[0];if(n.length>1)return s=null,n;if(!lr(r)||!(4&r.shapeFlag)&&!(128&r.shapeFlag))return s=null,r;let o=ro(r);if(o.type===i2)return s=null,o;let a=o.type,c=lL(n5(o)?o.type.__asyncResolved||{}:a),{include:u,exclude:d,max:p}=e;if(u&&(!c||!rn(u,c))||d&&c&&rn(d,c))return o.shapeFlag&=-257,s=o,r;let h=null==o.key?a:o.key,f=i.get(h);return o.el&&(o=ld(o),128&r.shapeFlag&&(r.ssContent=o)),g=h,f?(o.el=f.el,o.component=f.component,o.transition&&nB(o,o.transition),o.shapeFlag|=512,l.delete(h),l.add(h)):(l.add(h),p&&l.size>parseInt(p,10)&&m(l.values().next().value)),o.shapeFlag|=256,s=o,iK(r.type)?r:o}}};function rn(e,t){return k(e)?e.some(e=>rn(e,t)):R(e)?e.split(",").includes(t):"[object RegExp]"===D(e)&&(e.lastIndex=0,e.test(t))}function rr(e,t){rl(e,"a",t)}function ri(e,t){rl(e,"da",t)}function rl(e,t,n=lC){let r=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()});if(ra(t,r,n),n){let e=n.parent;for(;e&&e.parent;)re(e.parent.vnode)&&function(e,t,n,r){let i=ra(t,e,r,!0);rm(()=>{x(r[t],i)},n)}(r,t,n,e),e=e.parent}}function rs(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function ro(e){return 128&e.shapeFlag?e.ssContent:e}function ra(e,t,n=lC,r=!1){if(n){let i=n[e]||(n[e]=[]),l=t.__weh||(t.__weh=(...r)=>{e$();let i=lk(n),l=t2(t,n,e,r);return i(),eL(),l});return r?i.unshift(l):i.push(l),l}}let rc=e=>(t,n=lC)=>{lE&&"sp"!==e||ra(e,(...e)=>t(...e),n)},ru=rc("bm"),rd=rc("m"),rp=rc("bu"),rh=rc("u"),rf=rc("bum"),rm=rc("um"),rg=rc("sp"),rv=rc("rtg"),ry=rc("rtc");function rb(e,t=lC){ra("ec",e,t)}let r_="components";function rS(e,t){return rk(r_,e,!0,t)||e}let rx=Symbol.for("v-ndc");function rC(e){return R(e)?rk(r_,e,!1)||e:e||rx}function rT(e){return rk("directives",e)}function rk(e,t,n=!0,r=!1){let i=na||lC;if(i){let n=i.type;if(e===r_){let e=lL(n,!1);if(e&&(e===t||e===j(t)||e===W(j(t))))return n}let l=rw(i[e]||n[e],t)||rw(i.appContext[e],t);return!l&&r?n:l}}function rw(e,t){return e&&(e[t]||e[j(t)]||e[W(j(t))])}function rN(e,t,n,r){let i,l=n&&n[r],s=k(e);if(s||R(e)){let n=s&&t_(e),r=!1,o=!1;n&&(r=!tx(e),o=tS(e),e=eG(e)),i=Array(e.length);for(let n=0,s=e.length;nt(e,n,void 0,l&&l[n]));else{let n=Object.keys(e);i=Array(n.length);for(let r=0,s=n.length;r{let t=r.fn(...e);return t&&(t.key=r.key),t}:r.fn)}return e}function rA(e,t,n={},r,i){if(na.ce||na.parent&&n5(na.parent)&&na.parent.ce)return"default"!==t&&(n.name=t),i8(),ln(i0,null,[lc("slot",n,r&&r())],64);let l=e[t];l&&l._c&&(l._d=!1),i8();let s=l&&rR(l(n)),o=n.key||s&&s.key,a=ln(i0,{key:(o&&!I(o)?o:`_${t}`)+(!s&&r?"_fb":"")},s||(r?r():[]),s&&1===e._?64:-2);return!i&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),l&&l._c&&(l._d=!0),a}function rR(e){return e.some(e=>!lr(e)||e.type!==i2&&(e.type!==i0||!!rR(e.children)))?e:null}function rI(e,t){let n={};for(let r in e)n[t&&/[A-Z]/.test(r)?`on:${r}`:K(r)]=e[r];return n}let rO=e=>e?lN(e)?l$(e):rO(e.parent):null,rP=S(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>rO(e.parent),$root:e=>rO(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>r0(e),$forceUpdate:e=>e.f||(e.f=()=>{nn(e.update)}),$nextTick:e=>e.n||(e.n=nt.bind(e.proxy)),$watch:e=>iD.bind(e)}),rM=(e,t)=>e!==f&&!e.__isScriptSetup&&T(e,t),rD={get({_:e},t){let n,r,i;if("__v_skip"===t)return!0;let{ctx:l,setupState:s,data:o,props:a,accessCache:c,type:u,appContext:d}=e;if("$"!==t[0]){let r=c[t];if(void 0!==r)switch(r){case 1:return s[t];case 2:return o[t];case 4:return l[t];case 3:return a[t]}else{if(rM(s,t))return c[t]=1,s[t];if(o!==f&&T(o,t))return c[t]=2,o[t];if((n=e.propsOptions[0])&&T(n,t))return c[t]=3,a[t];if(l!==f&&T(l,t))return c[t]=4,l[t];rZ&&(c[t]=0)}}let p=rP[t];return p?("$attrs"===t&&eK(e.attrs,"get",""),p(e)):(r=u.__cssModules)&&(r=r[t])?r:l!==f&&T(l,t)?(c[t]=4,l[t]):T(i=d.config.globalProperties,t)?i[t]:void 0},set({_:e},t,n){let{data:r,setupState:i,ctx:l}=e;return rM(i,t)?(i[t]=n,!0):r!==f&&T(r,t)?(r[t]=n,!0):!T(e.props,t)&&!("$"===t[0]&&t.slice(1)in e)&&(l[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:i,propsOptions:l}},s){let o;return!!n[s]||e!==f&&T(e,s)||rM(t,s)||(o=l[0])&&T(o,s)||T(r,s)||T(rP,s)||T(i.config.globalProperties,s)},defineProperty(e,t,n){return null!=n.get?e._.accessCache[t]=0:T(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},r$=S({},rD,{get(e,t){if(t!==Symbol.unscopables)return rD.get(e,t,e)},has:(e,t)=>"_"!==t[0]&&!Y(t)});function rL(){return null}function rF(){return null}function rV(e){}function rB(e){}function rU(){return null}function rj(){}function rH(e,t){return null}function rq(){return rK().slots}function rW(){return rK().attrs}function rK(){let e=lT();return e.setupContext||(e.setupContext=lD(e))}function rz(e){return k(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}function rJ(e,t){let n=rz(e);for(let e in t){if(e.startsWith("__skip"))continue;let r=n[e];r?k(r)||A(r)?r=n[e]={type:r,default:t[e]}:r.default=t[e]:null===r&&(r=n[e]={default:t[e]}),r&&t[`__skip_${e}`]&&(r.skipFactory=!0)}return n}function rG(e,t){return e&&t?k(e)&&k(t)?e.concat(t):S({},rz(e),rz(t)):e||t}function rQ(e,t){let n={};for(let r in e)t.includes(r)||Object.defineProperty(n,r,{enumerable:!0,get:()=>e[r]});return n}function rX(e){let t=lT(),n=e();return lw(),P(n)&&(n=n.catch(e=>{throw lk(t),e})),[n,()=>lk(t)]}let rZ=!0;function rY(e,t,n){t2(k(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function r0(e){let t,n=e.type,{mixins:r,extends:i}=n,{mixins:l,optionsCache:s,config:{optionMergeStrategies:o}}=e.appContext,a=s.get(n);return a?t=a:l.length||r||i?(t={},l.length&&l.forEach(e=>r1(t,e,o,!0)),r1(t,n,o)):t=n,O(n)&&s.set(n,t),t}function r1(e,t,n,r=!1){let{mixins:i,extends:l}=t;for(let s in l&&r1(e,l,n,!0),i&&i.forEach(t=>r1(e,t,n,!0)),t)if(r&&"expose"===s);else{let r=r2[s]||n&&n[s];e[s]=r?r(e[s],t[s]):t[s]}return e}let r2={data:r3,props:r5,emits:r5,methods:r8,computed:r8,beforeCreate:r4,created:r4,beforeMount:r4,mounted:r4,beforeUpdate:r4,updated:r4,beforeDestroy:r4,beforeUnmount:r4,destroyed:r4,unmounted:r4,activated:r4,deactivated:r4,errorCaptured:r4,serverPrefetch:r4,components:r8,directives:r8,watch:function(e,t){if(!e)return t;if(!t)return e;let n=S(Object.create(null),e);for(let r in t)n[r]=r4(e[r],t[r]);return n},provide:r3,inject:function(e,t){return r8(r6(e),r6(t))}};function r3(e,t){return t?e?function(){return S(A(e)?e.call(this,this):e,A(t)?t.call(this,this):t)}:t:e}function r6(e){if(k(e)){let t={};for(let n=0;n1)return n&&A(t)?t.call(r&&r.proxy):t}}function ii(){return!!(lC||na||ie)}let il={},is=()=>Object.create(il),io=e=>Object.getPrototypeOf(e)===il;function ia(e,t,n,r){let i,[l,s]=e.propsOptions,o=!1;if(t)for(let a in t){let c;if(F(a))continue;let u=t[a];l&&T(l,c=j(a))?s&&s.includes(c)?(i||(i={}))[c]=u:n[c]=u:iB(e.emitsOptions,a)||a in r&&u===r[a]||(r[a]=u,o=!0)}if(s){let t=tT(n),r=i||f;for(let i=0;i"_"===e[0]||"$stable"===e,ih=e=>k(e)?e.map(lm):[lm(e)],im=(e,t,n)=>{if(t._n)return t;let r=nf((...e)=>ih(t(...e)),n);return r._c=!1,r},ig=(e,t,n)=>{let r=e._ctx;for(let n in e){if(ip(n))continue;let i=e[n];if(A(i))t[n]=im(n,i,r);else if(null!=i){let e=ih(i);t[n]=()=>e}}},iv=(e,t)=>{let n=ih(t);e.slots.default=()=>n},iy=(e,t,n)=>{for(let r in t)(n||!ip(r))&&(e[r]=t[r])},ib=iZ;function i_(e){return ix(e)}function iS(e){return ix(e,nX)}function ix(e,t){var n;let r,i;Z().__VUE__=!0;let{insert:l,remove:s,patchProp:o,createElement:a,createText:c,createComment:u,setText:d,setElementText:p,parentNode:h,nextSibling:y,setScopeId:b=g,insertStaticContent:_}=e,x=(e,t,n,r=null,i=null,l=null,s,o=null,a=!!t.dynamicChildren)=>{if(e===t)return;e&&!li(e,t)&&(r=er(e),X(e,i,l,!0),e=null),-2===t.patchFlag&&(a=!1,t.dynamicChildren=null);let{type:c,ref:u,shapeFlag:d}=t;switch(c){case i1:C(e,t,n,r);break;case i2:w(e,t,n,r);break;case i3:null==e&&N(t,n,r,s);break;case i0:L(e,t,n,r,i,l,s,o,a);break;default:1&d?E(e,t,n,r,i,l,s,o,a):6&d?V(e,t,n,r,i,l,s,o,a):64&d?c.process(e,t,n,r,i,l,s,o,a,es):128&d&&c.process(e,t,n,r,i,l,s,o,a,es)}null!=u&&i?nK(u,e&&e.ref,l,t||e,!t):null==u&&e&&null!=e.ref&&nK(e.ref,null,l,e,!0)},C=(e,t,n,r)=>{if(null==e)l(t.el=c(t.children),n,r);else{let n=t.el=e.el;t.children!==e.children&&d(n,t.children)}},w=(e,t,n,r)=>{null==e?l(t.el=u(t.children||""),n,r):t.el=e.el},N=(e,t,n,r)=>{[e.el,e.anchor]=_(e.children,t,n,r,e.el,e.anchor)},E=(e,t,n,r,i,l,s,o,a)=>{"svg"===t.type?s="svg":"math"===t.type&&(s="mathml"),null==e?R(t,n,r,i,l,s,o,a):M(e,t,i,l,s,o,a)},R=(e,t,n,r,i,s,c,u)=>{let d,h,{props:f,shapeFlag:m,transition:g,dirs:y}=e;if(d=e.el=a(e.type,s,f&&f.is,f),8&m?p(d,e.children):16&m&&P(e.children,d,null,r,i,iC(e,s),c,u),y&&ng(e,null,r,"created"),I(d,e,e.scopeId,c,r),f){for(let e in f)"value"===e||F(e)||o(d,e,null,f[e],s,r);"value"in f&&o(d,"value",null,f.value,s),(h=f.onVnodeBeforeMount)&&lb(h,r,e)}y&&ng(e,null,r,"beforeMount");let b=ik(i,g);b&&g.beforeEnter(d),l(d,t,n),((h=f&&f.onVnodeMounted)||b||y)&&ib(()=>{h&&lb(h,r,e),b&&g.enter(d),y&&ng(e,null,r,"mounted")},i)},I=(e,t,n,r,i)=>{if(n&&b(e,n),r)for(let t=0;t{for(let c=a;c{let a,c=t.el=e.el,{patchFlag:u,dynamicChildren:d,dirs:h}=t;u|=16&e.patchFlag;let m=e.props||f,g=t.props||f;if(n&&iT(n,!1),(a=g.onVnodeBeforeUpdate)&&lb(a,n,t,e),h&&ng(t,e,n,"beforeUpdate"),n&&iT(n,!0),(m.innerHTML&&null==g.innerHTML||m.textContent&&null==g.textContent)&&p(c,""),d?D(e.dynamicChildren,d,c,n,r,iC(t,i),l):s||K(e,t,c,null,n,r,iC(t,i),l,!1),u>0){if(16&u)$(c,m,g,n,i);else if(2&u&&m.class!==g.class&&o(c,"class",null,g.class,i),4&u&&o(c,"style",m.style,g.style,i),8&u){let e=t.dynamicProps;for(let t=0;t{a&&lb(a,n,t,e),h&&ng(t,e,n,"updated")},r)},D=(e,t,n,r,i,l,s)=>{for(let o=0;o{if(t!==n){if(t!==f)for(let l in t)F(l)||l in n||o(e,l,t[l],null,i,r);for(let l in n){if(F(l))continue;let s=n[l],a=t[l];s!==a&&"value"!==l&&o(e,l,a,s,i,r)}"value"in n&&o(e,"value",t.value,n.value,i)}},L=(e,t,n,r,i,s,o,a,u)=>{let d=t.el=e?e.el:c(""),p=t.anchor=e?e.anchor:c(""),{patchFlag:h,dynamicChildren:f,slotScopeIds:m}=t;m&&(a=a?a.concat(m):m),null==e?(l(d,n,r),l(p,n,r),P(t.children||[],n,p,i,s,o,a,u)):h>0&&64&h&&f&&e.dynamicChildren?(D(e.dynamicChildren,f,n,i,s,o,a),(null!=t.key||i&&t===i.subTree)&&iw(e,t,!0)):K(e,t,n,p,i,s,o,a,u)},V=(e,t,n,r,i,l,s,o,a)=>{t.slotScopeIds=o,null==e?512&t.shapeFlag?i.ctx.activate(t,n,r,s,a):B(t,n,r,i,l,s,a):U(e,t,a)},B=(e,t,n,r,i,l,s)=>{let o=e.component=lx(e,r,i);re(e)&&(o.ctx.renderer=es),lA(o,!1,s),o.asyncDep?(i&&i.registerDep(o,H,s),e.el||w(null,o.subTree=lc(i2),t,n)):H(o,e,t,n,i,l,s)},U=(e,t,n)=>{let r=t.component=e.component;if(function(e,t,n){let{props:r,children:i,component:l}=e,{props:s,children:o,patchFlag:a}=t,c=l.emitsOptions;if(t.dirs||t.transition)return!0;if(!n||!(a>=0))return(!!i||!!o)&&(!o||!o.$stable)||r!==s&&(r?!s||iq(r,s,c):!!s);if(1024&a)return!0;if(16&a)return r?iq(r,s,c):!!s;if(8&a){let e=t.dynamicProps;for(let t=0;t{let a=()=>{if(e.isMounted){let t,{next:n,bu:r,u:i,parent:c,vnode:u}=e;{let t=function e(t){let n=t.subTree.component;if(n)if(n.asyncDep&&!n.asyncResolved)return n;else return e(n)}(e);if(t){n&&(n.el=u.el,W(e,n,o)),t.asyncDep.then(()=>{e.isUnmounted||a()});return}}let d=n;iT(e,!1),n?(n.el=u.el,W(e,n,o)):n=u,r&&J(r),(t=n.props&&n.props.onVnodeBeforeUpdate)&&lb(t,c,n,u),iT(e,!0);let p=iU(e),f=e.subTree;e.subTree=p,x(f,p,h(f.el),er(f),e,l,s),n.el=p.el,null===d&&iW(e,p.el),i&&ib(i,l),(t=n.props&&n.props.onVnodeUpdated)&&ib(()=>lb(t,c,n,u),l)}else{let o,{el:a,props:c}=t,{bm:u,m:d,parent:p,root:h,type:f}=e,m=n5(t);if(iT(e,!1),u&&J(u),!m&&(o=c&&c.onVnodeBeforeMount)&&lb(o,p,t),iT(e,!0),a&&i){let t=()=>{e.subTree=iU(e),i(a,e.subTree,e,l,null)};m&&f.__asyncHydrate?f.__asyncHydrate(a,e,t):t()}else{h.ce&&!1!==h.ce._def.shadowRoot&&h.ce._injectChildStyle(f);let i=e.subTree=iU(e);x(null,i,n,r,e,l,s),t.el=i.el}if(d&&ib(d,l),!m&&(o=c&&c.onVnodeMounted)){let e=t;ib(()=>lb(o,p,e),l)}(256&t.shapeFlag||p&&n5(p.vnode)&&256&p.vnode.shapeFlag)&&e.a&&ib(e.a,l),e.isMounted=!0,t=n=r=null}};e.scope.on();let c=e.effect=new eC(a);e.scope.off();let u=e.update=c.run.bind(c),d=e.job=c.runIfDirty.bind(c);d.i=e,d.id=e.uid,c.scheduler=()=>nn(d),iT(e,!0),u()},W=(e,t,n)=>{t.component=e;let r=e.vnode.props;e.vnode=t,e.next=null,function(e,t,n,r){let{props:i,attrs:l,vnode:{patchFlag:s}}=e,o=tT(i),[a]=e.propsOptions,c=!1;if((r||s>0)&&!(16&s)){if(8&s){let n=e.vnode.dynamicProps;for(let r=0;r{let{vnode:r,slots:i}=e,l=!0,s=f;if(32&r.shapeFlag){let e=t._;e?n&&1===e?l=!1:iy(i,t,n):(l=!t.$stable,ig(t,i)),s=t}else t&&(iv(e,t),s={default:1});if(l)for(let e in i)ip(e)||null!=s[e]||delete i[e]})(e,t.children,n),e$(),nl(e),eL()},K=(e,t,n,r,i,l,s,o,a=!1)=>{let c=e&&e.children,u=e?e.shapeFlag:0,d=t.children,{patchFlag:h,shapeFlag:f}=t;if(h>0){if(128&h)return void G(c,d,n,r,i,l,s,o,a);else if(256&h)return void z(c,d,n,r,i,l,s,o,a)}8&f?(16&u&&en(c,i,l),d!==c&&p(n,d)):16&u?16&f?G(c,d,n,r,i,l,s,o,a):en(c,i,l,!0):(8&u&&p(n,""),16&f&&P(d,n,r,i,l,s,o,a))},z=(e,t,n,r,i,l,s,o,a)=>{let c;e=e||m,t=t||m;let u=e.length,d=t.length,p=Math.min(u,d);for(c=0;cd?en(e,i,l,!0,!1,p):P(t,n,r,i,l,s,o,a,p)},G=(e,t,n,r,i,l,s,o,a)=>{let c=0,u=t.length,d=e.length-1,p=u-1;for(;c<=d&&c<=p;){let r=e[c],u=t[c]=a?lg(t[c]):lm(t[c]);if(li(r,u))x(r,u,n,null,i,l,s,o,a);else break;c++}for(;c<=d&&c<=p;){let r=e[d],c=t[p]=a?lg(t[p]):lm(t[p]);if(li(r,c))x(r,c,n,null,i,l,s,o,a);else break;d--,p--}if(c>d){if(c<=p){let e=p+1,d=ep)for(;c<=d;)X(e[c],i,l,!0),c++;else{let h,f=c,g=c,y=new Map;for(c=g;c<=p;c++){let e=t[c]=a?lg(t[c]):lm(t[c]);null!=e.key&&y.set(e.key,c)}let b=0,_=p-g+1,S=!1,C=0,T=Array(_);for(c=0;c<_;c++)T[c]=0;for(c=f;c<=d;c++){let r,u=e[c];if(b>=_){X(u,i,l,!0);continue}if(null!=u.key)r=y.get(u.key);else for(h=g;h<=p;h++)if(0===T[h-g]&&li(u,t[h])){r=h;break}void 0===r?X(u,i,l,!0):(T[r-g]=c+1,r>=C?C=r:S=!0,x(u,t[r],n,null,i,l,s,o,a),b++)}let k=S?function(e){let t,n,r,i,l,s=e.slice(),o=[0],a=e.length;for(t=0;t>1]]0&&(s[t]=o[r-1]),o[r]=t)}}for(r=o.length,i=o[r-1];r-- >0;)o[r]=i,i=s[i];return o}(T):m;for(h=k.length-1,c=_-1;c>=0;c--){let e=g+c,d=t[e],p=e+1{let{el:o,type:a,transition:c,children:u,shapeFlag:d}=e;if(6&d)return void Q(e.component.subTree,t,n,r);if(128&d)return void e.suspense.move(t,n,r);if(64&d)return void a.move(e,t,n,es);if(a===i0){l(o,t,n);for(let e=0;e{let i;for(;e&&e!==t;)i=y(e),l(e,n,r),e=i;l(t,n,r)})(e,t,n);if(2!==r&&1&d&&c)if(0===r)c.beforeEnter(o),l(o,t,n),ib(()=>c.enter(o),i);else{let{leave:r,delayLeave:i,afterLeave:a}=c,u=()=>{e.ctx.isUnmounted?s(o):l(o,t,n)},d=()=>{r(o,()=>{u(),a&&a()})};i?i(o,u,d):d()}else l(o,t,n)},X=(e,t,n,r=!1,i=!1)=>{let l,{type:s,props:o,ref:a,children:c,dynamicChildren:u,shapeFlag:d,patchFlag:p,dirs:h,cacheIndex:f}=e;if(-2===p&&(i=!1),null!=a&&(e$(),nK(a,null,n,e,!0),eL()),null!=f&&(t.renderCache[f]=void 0),256&d)return void t.ctx.deactivate(e);let m=1&d&&h,g=!n5(e);if(g&&(l=o&&o.onVnodeBeforeUnmount)&&lb(l,t,e),6&d)et(e.component,n,r);else{if(128&d)return void e.suspense.unmount(n,r);m&&ng(e,null,t,"beforeUnmount"),64&d?e.type.remove(e,t,n,es,r):u&&!u.hasOnce&&(s!==i0||p>0&&64&p)?en(u,t,n,!1,!0):(s===i0&&384&p||!i&&16&d)&&en(c,t,n),r&&Y(e)}(g&&(l=o&&o.onVnodeUnmounted)||m)&&ib(()=>{l&&lb(l,t,e),m&&ng(e,null,t,"unmounted")},n)},Y=e=>{let{type:t,el:n,anchor:r,transition:i}=e;if(t===i0)return void ee(n,r);if(t===i3)return void(({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=y(e),s(e),e=n;s(t)})(e);let l=()=>{s(n),i&&!i.persisted&&i.afterLeave&&i.afterLeave()};if(1&e.shapeFlag&&i&&!i.persisted){let{leave:t,delayLeave:r}=i,s=()=>t(n,l);r?r(e.el,l,s):s()}else l()},ee=(e,t)=>{let n;for(;e!==t;)n=y(e),s(e),e=n;s(t)},et=(e,t,n)=>{let{bum:r,scope:i,job:l,subTree:s,um:o,m:a,a:c,parent:u,slots:{__:d}}=e;iN(a),iN(c),r&&J(r),u&&k(d)&&d.forEach(e=>{u.renderCache[e]=void 0}),i.stop(),l&&(l.flags|=8,X(s,e,t,n)),o&&ib(o,t),ib(()=>{e.isUnmounted=!0},t),t&&t.pendingBranch&&!t.isUnmounted&&e.asyncDep&&!e.asyncResolved&&e.suspenseId===t.pendingId&&(t.deps--,0===t.deps&&t.resolve())},en=(e,t,n,r=!1,i=!1,l=0)=>{for(let s=l;s{if(6&e.shapeFlag)return er(e.component.subTree);if(128&e.shapeFlag)return e.suspense.next();let t=y(e.anchor||e.el),n=t&&t[nv];return n?y(n):t},ei=!1,el=(e,t,n)=>{null==e?t._vnode&&X(t._vnode,null,null,!0):x(t._vnode||null,e,t,null,null,null,n),t._vnode=e,ei||(ei=!0,nl(),ns(),ei=!1)},es={p:x,um:X,m:Q,r:Y,mt:B,mc:P,pc:K,pbc:D,n:er,o:e};return t&&([r,i]=t(es)),{render:el,hydrate:r,createApp:(n=r,function(e,t=null){A(e)||(e=S({},e)),null==t||O(t)||(t=null);let r=r9(),i=new WeakSet,l=[],s=!1,o=r.app={_uid:r7++,_component:e,_props:t,_container:null,_context:r,_instance:null,version:lH,get config(){return r.config},set config(v){},use:(e,...t)=>(i.has(e)||(e&&A(e.install)?(i.add(e),e.install(o,...t)):A(e)&&(i.add(e),e(o,...t))),o),mixin:e=>(r.mixins.includes(e)||r.mixins.push(e),o),component:(e,t)=>t?(r.components[e]=t,o):r.components[e],directive:(e,t)=>t?(r.directives[e]=t,o):r.directives[e],mount(i,l,a){if(!s){let c=o._ceVNode||lc(e,t);return c.appContext=r,!0===a?a="svg":!1===a&&(a=void 0),l&&n?n(c,i):el(c,i,a),s=!0,o._container=i,i.__vue_app__=o,l$(c.component)}},onUnmount(e){l.push(e)},unmount(){s&&(t2(l,o._instance,16),el(null,o._container),delete o._container.__vue_app__)},provide:(e,t)=>(r.provides[e]=t,o),runWithContext(e){let t=ie;ie=o;try{return e()}finally{ie=t}}};return o})}}function iC({type:e,props:t},n){return"svg"===n&&"foreignObject"===e||"mathml"===n&&"annotation-xml"===e&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function iT({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function ik(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function iw(e,t,n=!1){let r=e.children,i=t.children;if(k(r)&&k(i))for(let e=0;eir(iE);function iR(e,t){return iM(e,null,t)}function iI(e,t){return iM(e,null,{flush:"post"})}function iO(e,t){return iM(e,null,{flush:"sync"})}function iP(e,t,n){return iM(e,t,n)}function iM(e,t,n=f){let r,{immediate:i,deep:l,flush:s,once:o}=n,a=S({},n),c=t&&i||!t&&"post"!==s;if(lE){if("sync"===s){let e=iA();r=e.__watcherHandles||(e.__watcherHandles=[])}else if(!c){let e=()=>{};return e.stop=g,e.resume=g,e.pause=g,e}}let u=lC;a.call=(e,t,n)=>t2(e,u,t,n);let p=!1;"post"===s?a.scheduler=e=>{ib(e,u&&u.suspense)}:"sync"!==s&&(p=!0,a.scheduler=(e,t)=>{t?e():nn(e)}),a.augmentJob=e=>{t&&(e.flags|=4),p&&(e.flags|=2,u&&(e.id=u.uid,e.i=u))};let h=function(e,t,n=f){let r,i,l,s,{immediate:o,deep:a,once:c,scheduler:u,augmentJob:p,call:h}=n,m=e=>a?e:tx(e)||!1===a||0===a?tZ(e,1):tZ(e),y=!1,b=!1;if(tE(e)?(i=()=>e.value,y=tx(e)):t_(e)?(i=()=>m(e),y=!0):k(e)?(b=!0,y=e.some(e=>t_(e)||tx(e)),i=()=>e.map(e=>tE(e)?e.value:t_(e)?m(e):A(e)?h?h(e,2):e():void 0)):i=A(e)?t?h?()=>h(e,2):e:()=>{if(l){e$();try{l()}finally{eL()}}let t=d;d=r;try{return h?h(e,3,[s]):e(s)}finally{d=t}}:g,t&&a){let e=i,t=!0===a?1/0:a;i=()=>tZ(e(),t)}let _=e_(),S=()=>{r.stop(),_&&_.active&&x(_.effects,r)};if(c&&t){let e=t;t=(...t)=>{e(...t),S()}}let C=b?Array(e.length).fill(tJ):tJ,T=e=>{if(1&r.flags&&(r.dirty||e))if(t){let e=r.run();if(a||y||(b?e.some((e,t)=>z(e,C[t])):z(e,C))){l&&l();let n=d;d=r;try{let n=[e,C===tJ?void 0:b&&C[0]===tJ?[]:C,s];C=e,h?h(t,3,n):t(...n)}finally{d=n}}}else r.run()};return p&&p(T),(r=new eC(i)).scheduler=u?()=>u(T,!1):T,s=e=>tX(e,!1,r),l=r.onStop=()=>{let e=tG.get(r);if(e){if(h)h(e,4);else for(let t of e)t();tG.delete(r)}},t?o?T(!0):C=r.run():u?u(T.bind(null,!0),!0):r.run(),S.pause=r.pause.bind(r),S.resume=r.resume.bind(r),S.stop=S,S}(e,t,a);return lE&&(r?r.push(h):c&&h()),h}function iD(e,t,n){let r,i=this.proxy,l=R(e)?e.includes(".")?i$(i,e):()=>i[e]:e.bind(i,i);A(t)?r=t:(r=t.handler,n=t);let s=lk(this),o=iM(l,r.bind(i),n);return s(),o}function i$(e,t){let n=t.split(".");return()=>{let t=e;for(let e=0;e{let a,c,u=f;return iO(()=>{let t=e[i];z(a,t)&&(a=t,o())}),{get:()=>(s(),n.get?n.get(a):a),set(e){let s=n.set?n.set(e):e;if(!z(s,a)&&!(u!==f&&z(e,u)))return;let d=r.vnode.props;d&&(t in d||i in d||l in d)&&(`onUpdate:${t}`in d||`onUpdate:${i}`in d||`onUpdate:${l}`in d)||(a=e,o()),r.emit(`update:${t}`,s),z(e,s)&&z(e,u)&&!z(s,c)&&o(),u=e,c=s}}});return o[Symbol.iterator]=()=>{let e=0;return{next:()=>e<2?{value:e++?s||f:o,done:!1}:{done:!0}}},o}let iF=(e,t)=>"modelValue"===t||"model-value"===t?e.modelModifiers:e[`${t}Modifiers`]||e[`${j(t)}Modifiers`]||e[`${q(t)}Modifiers`];function iV(e,t,...n){let r;if(e.isUnmounted)return;let i=e.vnode.props||f,l=n,s=t.startsWith("update:"),o=s&&iF(i,t.slice(7));o&&(o.trim&&(l=n.map(e=>R(e)?e.trim():e)),o.number&&(l=n.map(Q)));let a=i[r=K(t)]||i[r=K(j(t))];!a&&s&&(a=i[r=K(q(t))]),a&&t2(a,e,6,l);let c=i[r+"Once"];if(c){if(e.emitted){if(e.emitted[r])return}else e.emitted={};e.emitted[r]=!0,t2(c,e,6,l)}}function iB(e,t){return!!e&&!!b(t)&&(T(e,(t=t.slice(2).replace(/Once$/,""))[0].toLowerCase()+t.slice(1))||T(e,q(t))||T(e,t))}function iU(e){let t,n,{type:r,vnode:i,proxy:l,withProxy:s,propsOptions:[o],slots:a,attrs:c,emit:u,render:d,renderCache:p,props:h,data:f,setupState:m,ctx:g,inheritAttrs:y}=e,b=nu(e);try{if(4&i.shapeFlag){let e=s||l;t=lm(d.call(e,e,p,h,m,f,g)),n=c}else t=lm(r.length>1?r(h,{attrs:c,slots:a,emit:u}):r(h,null)),n=r.props?c:ij(c)}catch(n){i6.length=0,t3(n,e,1),t=lc(i2)}let S=t;if(n&&!1!==y){let e=Object.keys(n),{shapeFlag:t}=S;e.length&&7&t&&(o&&e.some(_)&&(n=iH(n,o)),S=ld(S,n,!1,!0))}return i.dirs&&((S=ld(S,null,!1,!0)).dirs=S.dirs?S.dirs.concat(i.dirs):i.dirs),i.transition&&nB(S,i.transition),t=S,nu(b),t}let ij=e=>{let t;for(let n in e)("class"===n||"style"===n||b(n))&&((t||(t={}))[n]=e[n]);return t},iH=(e,t)=>{let n={};for(let r in e)_(r)&&r.slice(9)in t||(n[r]=e[r]);return n};function iq(e,t,n){let r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let i=0;ie.__isSuspense,iz=0,iJ={name:"Suspense",__isSuspense:!0,process(e,t,n,r,i,l,s,o,a,c){if(null==e){var u=t,d=n,p=r,h=i,f=l,m=s,g=o,y=a,b=c;let{p:e,o:{createElement:_}}=b,S=_("div"),x=u.suspense=iQ(u,f,h,d,S,p,m,g,y,b);e(null,x.pendingBranch=u.ssContent,S,null,h,x,m,g),x.deps>0?(iG(u,"onPending"),iG(u,"onFallback"),e(null,u.ssFallback,d,p,h,null,m,g),iY(x,u.ssFallback)):x.resolve(!1,!0)}else{if(l&&l.deps>0&&!e.suspense.isInFallback){t.suspense=e.suspense,t.suspense.vnode=t,t.el=e.el;return}!function(e,t,n,r,i,l,s,o,{p:a,um:c,o:{createElement:u}}){let d=t.suspense=e.suspense;d.vnode=t,t.el=e.el;let p=t.ssContent,h=t.ssFallback,{activeBranch:f,pendingBranch:m,isInFallback:g,isHydrating:y}=d;if(m)d.pendingBranch=p,li(p,m)?(a(m,p,d.hiddenContainer,null,i,d,l,s,o),d.deps<=0?d.resolve():g&&!y&&(a(f,h,n,r,i,null,l,s,o),iY(d,h))):(d.pendingId=iz++,y?(d.isHydrating=!1,d.activeBranch=m):c(m,i,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u("div"),g?(a(null,p,d.hiddenContainer,null,i,d,l,s,o),d.deps<=0?d.resolve():(a(f,h,n,r,i,null,l,s,o),iY(d,h))):f&&li(p,f)?(a(f,p,n,r,i,d,l,s,o),d.resolve(!0)):(a(null,p,d.hiddenContainer,null,i,d,l,s,o),d.deps<=0&&d.resolve()));else if(f&&li(p,f))a(f,p,n,r,i,d,l,s,o),iY(d,p);else if(iG(t,"onPending"),d.pendingBranch=p,512&p.shapeFlag?d.pendingId=p.component.suspenseId:d.pendingId=iz++,a(null,p,d.hiddenContainer,null,i,d,l,s,o),d.deps<=0)d.resolve();else{let{timeout:e,pendingId:t}=d;e>0?setTimeout(()=>{d.pendingId===t&&d.fallback(h)},e):0===e&&d.fallback(h)}}(e,t,n,r,i,s,o,a,c)}},hydrate:function(e,t,n,r,i,l,s,o,a){let c=t.suspense=iQ(t,r,n,e.parentNode,document.createElement("div"),null,i,l,s,o,!0),u=a(e,c.pendingBranch=t.ssContent,n,c,l,s);return 0===c.deps&&c.resolve(!1,!0),u},normalize:function(e){let{shapeFlag:t,children:n}=e,r=32&t;e.ssContent=iX(r?n.default:n),e.ssFallback=r?iX(n.fallback):lc(i2)}};function iG(e,t){let n=e.props&&e.props[t];A(n)&&n()}function iQ(e,t,n,r,i,l,s,o,a,c,u=!1){let d,{p:p,m:h,um:f,n:m,o:{parentNode:g,remove:y}}=c,b=function(e){let t=e.props&&e.props.suspensible;return null!=t&&!1!==t}(e);b&&t&&t.pendingBranch&&(d=t.pendingId,t.deps++);let _=e.props?X(e.props.timeout):void 0,S=l,x={vnode:e,parent:t,parentComponent:n,namespace:s,container:r,hiddenContainer:i,deps:0,pendingId:iz++,timeout:"number"==typeof _?_:-1,activeBranch:null,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve(e=!1,n=!1){let{vnode:r,activeBranch:i,pendingBranch:s,pendingId:o,effects:a,parentComponent:c,container:u}=x,p=!1;x.isHydrating?x.isHydrating=!1:!e&&((p=i&&s.transition&&"out-in"===s.transition.mode)&&(i.transition.afterLeave=()=>{o===x.pendingId&&(h(s,u,l===S?m(i):l,0),ni(a))}),i&&(g(i.el)===u&&(l=m(i)),f(i,c,x,!0)),p||h(s,u,l,0)),iY(x,s),x.pendingBranch=null,x.isInFallback=!1;let y=x.parent,_=!1;for(;y;){if(y.pendingBranch){y.effects.push(...a),_=!0;break}y=y.parent}_||p||ni(a),x.effects=[],b&&t&&t.pendingBranch&&d===t.pendingId&&(t.deps--,0!==t.deps||n||t.resolve()),iG(r,"onResolve")},fallback(e){if(!x.pendingBranch)return;let{vnode:t,activeBranch:n,parentComponent:r,container:i,namespace:l}=x;iG(t,"onFallback");let s=m(n),c=()=>{x.isInFallback&&(p(null,e,i,s,r,null,l,o,a),iY(x,e))},u=e.transition&&"out-in"===e.transition.mode;u&&(n.transition.afterLeave=c),x.isInFallback=!0,f(n,r,null,!0),u||c()},move(e,t,n){x.activeBranch&&h(x.activeBranch,e,t,n),x.container=e},next:()=>x.activeBranch&&m(x.activeBranch),registerDep(e,t,n){let r=!!x.pendingBranch;r&&x.deps++;let i=e.vnode.el;e.asyncDep.catch(t=>{t3(t,e,0)}).then(l=>{if(e.isUnmounted||x.isUnmounted||x.pendingId!==e.suspenseId)return;e.asyncResolved=!0;let{vnode:o}=e;lR(e,l,!1),i&&(o.el=i);let a=!i&&e.subTree.el;t(e,o,g(i||e.subTree.el),i?null:m(e.subTree),x,s,n),a&&y(a),iW(e,o.el),r&&0==--x.deps&&x.resolve()})},unmount(e,t){x.isUnmounted=!0,x.activeBranch&&f(x.activeBranch,n,e,t),x.pendingBranch&&f(x.pendingBranch,n,e,t)}};return x}function iX(e){let t;if(A(e)){let n=i9&&e._c;n&&(e._d=!1,i8()),e=e(),n&&(e._d=!0,t=i4,i5())}return k(e)&&(e=function(e,t=!0){let n;for(let t=0;tt!==e)),e}function iZ(e,t){t&&t.pendingBranch?k(e)?t.effects.push(...e):t.effects.push(e):ni(e)}function iY(e,t){e.activeBranch=t;let{vnode:n,parentComponent:r}=e,i=t.el;for(;!i&&t.component;)i=(t=t.component.subTree).el;n.el=i,r&&r.subTree===n&&(r.vnode.el=i,iW(r,i))}let i0=Symbol.for("v-fgt"),i1=Symbol.for("v-txt"),i2=Symbol.for("v-cmt"),i3=Symbol.for("v-stc"),i6=[],i4=null;function i8(e=!1){i6.push(i4=e?null:[])}function i5(){i6.pop(),i4=i6[i6.length-1]||null}let i9=1;function i7(e,t=!1){i9+=e,e<0&&i4&&t&&(i4.hasOnce=!0)}function le(e){return e.dynamicChildren=i9>0?i4||m:null,i5(),i9>0&&i4&&i4.push(e),e}function lt(e,t,n,r,i,l){return le(la(e,t,n,r,i,l,!0))}function ln(e,t,n,r,i){return le(lc(e,t,n,r,i,!0))}function lr(e){return!!e&&!0===e.__v_isVNode}function li(e,t){return e.type===t.type&&e.key===t.key}function ll(e){}let ls=({key:e})=>null!=e?e:null,lo=({ref:e,ref_key:t,ref_for:n})=>("number"==typeof e&&(e=""+e),null!=e?R(e)||tE(e)||A(e)?{i:na,r:e,k:t,f:!!n}:e:null);function la(e,t=null,n=null,r=0,i=null,l=+(e!==i0),s=!1,o=!1){let a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&ls(t),ref:t&&lo(t),scopeId:nc,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:l,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:na};return o?(lv(a,n),128&l&&e.normalize(a)):n&&(a.shapeFlag|=R(n)?8:16),i9>0&&!s&&i4&&(a.patchFlag>0||6&l)&&32!==a.patchFlag&&i4.push(a),a}let lc=function(e,t=null,n=null,r=0,i=null,l=!1){var s;if(e&&e!==rx||(e=i2),lr(e)){let r=ld(e,t,!0);return n&&lv(r,n),i9>0&&!l&&i4&&(6&r.shapeFlag?i4[i4.indexOf(e)]=r:i4.push(r)),r.patchFlag=-2,r}if(A(s=e)&&"__vccOpts"in s&&(e=e.__vccOpts),t){let{class:e,style:n}=t=lu(t);e&&!R(e)&&(t.class=el(e)),O(n)&&(tC(n)&&!k(n)&&(n=S({},n)),t.style=ee(n))}let o=R(e)?1:iK(e)?128:e.__isTeleport?64:O(e)?4:2*!!A(e);return la(e,t,n,r,i,o,l,!0)};function lu(e){return e?tC(e)||io(e)?S({},e):e:null}function ld(e,t,n=!1,r=!1){let{props:i,ref:l,patchFlag:s,children:o,transition:a}=e,c=t?ly(i||{},t):i,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&ls(c),ref:t&&t.ref?n&&l?k(l)?l.concat(lo(t)):[l,lo(t)]:lo(t):l,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:o,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==i0?-1===s?16:16|s:s,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&ld(e.ssContent),ssFallback:e.ssFallback&&ld(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&r&&nB(u,a.clone(u)),u}function lp(e=" ",t=0){return lc(i1,null,e,t)}function lh(e,t){let n=lc(i3,null,e);return n.staticCount=t,n}function lf(e="",t=!1){return t?(i8(),ln(i2,null,e)):lc(i2,null,e)}function lm(e){return null==e||"boolean"==typeof e?lc(i2):k(e)?lc(i0,null,e.slice()):lr(e)?lg(e):lc(i1,null,String(e))}function lg(e){return null===e.el&&-1!==e.patchFlag||e.memo?e:ld(e)}function lv(e,t){let n=0,{shapeFlag:r}=e;if(null==t)t=null;else if(k(t))n=16;else if("object"==typeof t)if(65&r){let n=t.default;n&&(n._c&&(n._d=!1),lv(e,n()),n._c&&(n._d=!0));return}else{n=32;let r=t._;r||io(t)?3===r&&na&&(1===na.slots._?t._=1:(t._=2,e.patchFlag|=1024)):t._ctx=na}else A(t)?(t={default:t,_ctx:na},n=32):(t=String(t),64&r?(n=16,t=[lp(t)]):n=8);e.children=t,e.shapeFlag|=n}function ly(...e){let t={};for(let n=0;n{c=!0;let[r,i]=e(t,n,!0);S(o,r),i&&a.push(...i)};!r&&n.mixins.length&&n.mixins.forEach(i),t.extends&&i(t.extends),t.mixins&&t.mixins.forEach(i)}if(!s&&!c)return O(t)&&i.set(t,m),m;if(k(s))for(let e=0;e{let r=e(t,n,!0);r&&(a=!0,S(o,r))};!r&&n.mixins.length&&n.mixins.forEach(i),t.extends&&i(t.extends),t.mixins&&t.mixins.forEach(i)}return s||a?(k(s)?s.forEach(e=>o[e]=null):S(o,s),O(t)&&i.set(t,o),o):(O(t)&&i.set(t,null),null)}(r,i),emit:null,emitted:null,propsDefaults:f,inheritAttrs:r.inheritAttrs,ctx:f,data:f,props:f,attrs:f,slots:f,refs:f,setupState:f,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return l.ctx={_:l},l.root=t?t.root:l,l.emit=iV.bind(null,l),e.ce&&e.ce(l),l}let lC=null,lT=()=>lC||na;{let e=Z(),t=(t,n)=>{let r;return(r=e[t])||(r=e[t]=[]),r.push(n),e=>{r.length>1?r.forEach(t=>t(e)):r[0](e)}};l=t("__VUE_INSTANCE_SETTERS__",e=>lC=e),s=t("__VUE_SSR_SETTERS__",e=>lE=e)}let lk=e=>{let t=lC;return l(e),e.scope.on(),()=>{e.scope.off(),l(t)}},lw=()=>{lC&&lC.scope.off(),l(null)};function lN(e){return 4&e.vnode.shapeFlag}let lE=!1;function lA(e,t=!1,n=!1){t&&s(t);let{props:r,children:i}=e.vnode,l=lN(e);!function(e,t,n,r=!1){let i={},l=is();for(let n in e.propsDefaults=Object.create(null),ia(e,t,i,l),e.propsOptions[0])n in i||(i[n]=void 0);n?e.props=r?i:tg(i):e.type.props?e.props=i:e.props=l,e.attrs=l}(e,r,l,t),((e,t,n)=>{let r=e.slots=is();if(32&e.vnode.shapeFlag){let e=t.__;e&&G(r,"__",e,!0);let i=t._;i?(iy(r,t,n),n&&G(r,"_",i,!0)):ig(t,r)}else t&&iv(e,t)})(e,i,n||t);let o=l?function(e,t){let n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,rD);let{setup:r}=n;if(r){e$();let n=e.setupContext=r.length>1?lD(e):null,i=lk(e),l=t1(r,e,0,[e.props,n]),s=P(l);if(eL(),i(),(s||e.sp)&&!n5(e)&&nq(e),s){if(l.then(lw,lw),t)return l.then(n=>{lR(e,n,t)}).catch(t=>{t3(t,e,0)});e.asyncDep=l}else lR(e,l,t)}else lP(e,t)}(e,t):void 0;return t&&s(!1),o}function lR(e,t,n){A(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:O(t)&&(e.setupState=tL(t)),lP(e,n)}function lI(e){o=e,a=e=>{e.render._rc&&(e.withProxy=new Proxy(e.ctx,r$))}}let lO=()=>!o;function lP(e,t,n){let r=e.type;if(!e.render){if(!t&&o&&!r.render){let t=r.template||r0(e).template;if(t){let{isCustomElement:n,compilerOptions:i}=e.appContext.config,{delimiters:l,compilerOptions:s}=r,a=S(S({isCustomElement:n,delimiters:l},i),s);r.render=o(t,a)}}e.render=r.render||g,a&&a(e)}{let t=lk(e);e$();try{!function(e){let t=r0(e),n=e.proxy,r=e.ctx;rZ=!1,t.beforeCreate&&rY(t.beforeCreate,e,"bc");let{data:i,computed:l,methods:s,watch:o,provide:a,inject:c,created:u,beforeMount:d,mounted:p,beforeUpdate:h,updated:f,activated:m,deactivated:y,beforeDestroy:b,beforeUnmount:_,destroyed:S,unmounted:x,render:C,renderTracked:T,renderTriggered:w,errorCaptured:N,serverPrefetch:E,expose:I,inheritAttrs:P,components:M,directives:D,filters:$}=t;if(c&&function(e,t,n=g){for(let n in k(e)&&(e=r6(e)),e){let r,i=e[n];tE(r=O(i)?"default"in i?ir(i.from||n,i.default,!0):ir(i.from||n):ir(i))?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>r.value,set:e=>r.value=e}):t[n]=r}}(c,r,null),s)for(let e in s){let t=s[e];A(t)&&(r[e]=t.bind(n))}if(i){let t=i.call(n,n);O(t)&&(e.data=tm(t))}if(rZ=!0,l)for(let e in l){let t=l[e],i=A(t)?t.bind(n,n):A(t.get)?t.get.bind(n,n):g,s=lF({get:i,set:!A(t)&&A(t.set)?t.set.bind(n):g});Object.defineProperty(r,e,{enumerable:!0,configurable:!0,get:()=>s.value,set:e=>s.value=e})}if(o)for(let e in o)!function e(t,n,r,i){let l=i.includes(".")?i$(r,i):()=>r[i];if(R(t)){let e=n[t];A(e)&&iP(l,e)}else if(A(t))iP(l,t.bind(r));else if(O(t))if(k(t))t.forEach(t=>e(t,n,r,i));else{let e=A(t.handler)?t.handler.bind(r):n[t.handler];A(e)&&iP(l,e,t)}}(o[e],r,n,e);if(a){let e=A(a)?a.call(n):a;Reflect.ownKeys(e).forEach(t=>{it(t,e[t])})}function L(e,t){k(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(u&&rY(u,e,"c"),L(ru,d),L(rd,p),L(rp,h),L(rh,f),L(rr,m),L(ri,y),L(rb,N),L(ry,T),L(rv,w),L(rf,_),L(rm,x),L(rg,E),k(I))if(I.length){let t=e.exposed||(e.exposed={});I.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t})})}else e.exposed||(e.exposed={});C&&e.render===g&&(e.render=C),null!=P&&(e.inheritAttrs=P),M&&(e.components=M),D&&(e.directives=D),E&&nq(e)}(e)}finally{eL(),t()}}}let lM={get:(e,t)=>(eK(e,"get",""),e[t])};function lD(e){return{attrs:new Proxy(e.attrs,lM),slots:e.slots,emit:e.emit,expose:t=>{e.exposed=t||{}}}}function l$(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(tL(tk(e.exposed)),{get:(t,n)=>n in t?t[n]:n in rP?rP[n](e):void 0,has:(e,t)=>t in e||t in rP})):e.proxy}function lL(e,t=!0){return A(e)?e.displayName||e.name:e.name||t&&e.__name}let lF=(e,t)=>(function(e,t,n=!1){let r,i;return A(e)?r=e:(r=e.get,i=e.set),new tW(r,i,n)})(e,0,lE);function lV(e,t,n){let r=arguments.length;return 2!==r?(r>3?n=Array.prototype.slice.call(arguments,2):3===r&&lr(n)&&(n=[n]),lc(e,t,n)):!O(t)||k(t)?lc(e,null,t):lr(t)?lc(e,null,[t]):lc(e,t)}function lB(){}function lU(e,t,n,r){let i=n[r];if(i&&lj(i,e))return i;let l=t();return l.memo=e.slice(),l.cacheIndex=r,n[r]=l}function lj(e,t){let n=e.memo;if(n.length!=t.length)return!1;for(let e=0;e0&&i4&&i4.push(e),!0}let lH="3.5.17",lq=g,lW=null,lK=void 0,lz=g,lJ={createComponentInstance:lx,setupComponent:lA,renderComponentRoot:iU,setCurrentRenderingInstance:nu,isVNode:lr,normalizeVNode:lm,getComponentPublicInstance:l$,ensureValidVNode:rR,pushWarningContext:function(e){},popWarningContext:function(){}},lG=null,lQ=null,lX=null,lZ="undefined"!=typeof window&&window.trustedTypes;if(lZ)try{p=lZ.createPolicy("vue",{createHTML:e=>e})}catch(e){}let lY=p?e=>p.createHTML(e):e=>e,l0="undefined"!=typeof document?document:null,l1=l0&&l0.createElement("template"),l2="transition",l3="animation",l6=Symbol("_vtc"),l4={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},l8=S({},nO,l4),l5=((of=(e,{slots:t})=>lV(nD,se(e),t)).displayName="Transition",of.props=l8,of),l9=(e,t=[])=>{k(e)?e.forEach(e=>e(...t)):e&&e(...t)},l7=e=>!!e&&(k(e)?e.some(e=>e.length>1):e.length>1);function se(e){let t={};for(let n in e)n in l4||(t[n]=e[n]);if(!1===e.css)return t;let{name:n="v",type:r,duration:i,enterFromClass:l=`${n}-enter-from`,enterActiveClass:s=`${n}-enter-active`,enterToClass:o=`${n}-enter-to`,appearFromClass:a=l,appearActiveClass:c=s,appearToClass:u=o,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:p=`${n}-leave-active`,leaveToClass:h=`${n}-leave-to`}=e,f=function(e){if(null==e)return null;{if(O(e))return[function(e){return X(e)}(e.enter),function(e){return X(e)}(e.leave)];let t=function(e){return X(e)}(e);return[t,t]}}(i),m=f&&f[0],g=f&&f[1],{onBeforeEnter:y,onEnter:b,onEnterCancelled:_,onLeave:x,onLeaveCancelled:C,onBeforeAppear:T=y,onAppear:k=b,onAppearCancelled:w=_}=t,N=(e,t,n,r)=>{e._enterCancelled=r,sn(e,t?u:o),sn(e,t?c:s),n&&n()},E=(e,t)=>{e._isLeaving=!1,sn(e,d),sn(e,h),sn(e,p),t&&t()},A=e=>(t,n)=>{let i=e?k:b,s=()=>N(t,e,n);l9(i,[t,s]),sr(()=>{sn(t,e?a:l),st(t,e?u:o),l7(i)||sl(t,r,m,s)})};return S(t,{onBeforeEnter(e){l9(y,[e]),st(e,l),st(e,s)},onBeforeAppear(e){l9(T,[e]),st(e,a),st(e,c)},onEnter:A(!1),onAppear:A(!0),onLeave(e,t){e._isLeaving=!0;let n=()=>E(e,t);st(e,d),e._enterCancelled?(st(e,p),sc()):(sc(),st(e,p)),sr(()=>{e._isLeaving&&(sn(e,d),st(e,h),l7(x)||sl(e,r,g,n))}),l9(x,[e,n])},onEnterCancelled(e){N(e,!1,void 0,!0),l9(_,[e])},onAppearCancelled(e){N(e,!0,void 0,!0),l9(w,[e])},onLeaveCancelled(e){E(e),l9(C,[e])}})}function st(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.add(t)),(e[l6]||(e[l6]=new Set)).add(t)}function sn(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.remove(t));let n=e[l6];n&&(n.delete(t),n.size||(e[l6]=void 0))}function sr(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let si=0;function sl(e,t,n,r){let i=e._endId=++si,l=()=>{i===e._endId&&r()};if(null!=n)return setTimeout(l,n);let{type:s,timeout:o,propCount:a}=ss(e,t);if(!s)return r();let c=s+"end",u=0,d=()=>{e.removeEventListener(c,p),l()},p=t=>{t.target===e&&++u>=a&&d()};setTimeout(()=>{u(n[e]||"").split(", "),i=r(`${l2}Delay`),l=r(`${l2}Duration`),s=so(i,l),o=r(`${l3}Delay`),a=r(`${l3}Duration`),c=so(o,a),u=null,d=0,p=0;t===l2?s>0&&(u=l2,d=s,p=l.length):t===l3?c>0&&(u=l3,d=c,p=a.length):p=(u=(d=Math.max(s,c))>0?s>c?l2:l3:null)?u===l2?l.length:a.length:0;let h=u===l2&&/\b(transform|all)(,|$)/.test(r(`${l2}Property`).toString());return{type:u,timeout:d,propCount:p,hasTransform:h}}function so(e,t){for(;e.lengthsa(t)+sa(e[n])))}function sa(e){return"auto"===e?0:1e3*Number(e.slice(0,-1).replace(",","."))}function sc(){return document.body.offsetHeight}let su=Symbol("_vod"),sd=Symbol("_vsh"),sp={beforeMount(e,{value:t},{transition:n}){e[su]="none"===e.style.display?"":e.style.display,n&&t?n.beforeEnter(e):sh(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:r}){!t!=!n&&(r?t?(r.beforeEnter(e),sh(e,!0),r.enter(e)):r.leave(e,()=>{sh(e,!1)}):sh(e,t))},beforeUnmount(e,{value:t}){sh(e,t)}};function sh(e,t){e.style.display=t?e[su]:"none",e[sd]=!t}let sf=Symbol("");function sm(e){let t=lT();if(!t)return;let n=t.ut=(n=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(e=>sg(e,n))},r=()=>{let r=e(t.proxy);t.ce?sg(t.ce,r):function e(t,n){if(128&t.shapeFlag){let r=t.suspense;t=r.activeBranch,r.pendingBranch&&!r.isHydrating&&r.effects.push(()=>{e(r.activeBranch,n)})}for(;t.component;)t=t.component.subTree;if(1&t.shapeFlag&&t.el)sg(t.el,n);else if(t.type===i0)t.children.forEach(t=>e(t,n));else if(t.type===i3){let{el:e,anchor:r}=t;for(;e&&(sg(e,n),e!==r);)e=e.nextSibling}}(t.subTree,r),n(r)};rp(()=>{ni(r)}),rd(()=>{iP(r,g,{flush:"post"});let e=new MutationObserver(r);e.observe(t.subTree.el.parentNode,{childList:!0}),rm(()=>e.disconnect())})}function sg(e,t){if(1===e.nodeType){let n=e.style,r="";for(let e in t)n.setProperty(`--${e}`,t[e]),r+=`--${e}: ${t[e]};`;n[sf]=r}}let sv=/(^|;)\s*display\s*:/,sy=/\s*!important$/;function sb(e,t,n){if(k(n))n.forEach(n=>sb(e,t,n));else if(null==n&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{let r=function(e,t){let n=sS[t];if(n)return n;let r=j(t);if("filter"!==r&&r in e)return sS[t]=r;r=W(r);for(let n=0;n111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)>96&&123>e.charCodeAt(2),sI={};function sO(e,t,n){let r=nj(e,t);$(r)&&S(r,t);class i extends sD{constructor(e){super(r,e,n)}}return i.def=r,i}let sP=(e,t)=>sO(e,t,oc),sM="undefined"!=typeof HTMLElement?HTMLElement:class{};class sD extends sM{constructor(e,t={},n=oa){super(),this._def=e,this._props=t,this._createApp=n,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._ob=null,this.shadowRoot&&n!==oa?this._root=this.shadowRoot:!1!==e.shadowRoot?(this.attachShadow({mode:"open"}),this._root=this.shadowRoot):this._root=this}connectedCallback(){if(!this.isConnected)return;this.shadowRoot||this._resolved||this._parseSlots(),this._connected=!0;let e=this;for(;e=e&&(e.parentNode||e.host);)if(e instanceof sD){this._parent=e;break}this._instance||(this._resolved?this._mount(this._def):e&&e._pendingResolve?this._pendingResolve=e._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(e=this._parent){e&&(this._instance.parent=e._instance,this._inheritParentContext(e))}_inheritParentContext(e=this._parent){e&&this._app&&Object.setPrototypeOf(this._app._context.provides,e._instance.provides)}disconnectedCallback(){this._connected=!1,nt(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null)})}_resolveDef(){if(this._pendingResolve)return;for(let e=0;e{for(let t of e)this._setAttr(t.attributeName)}),this._ob.observe(this,{attributes:!0});let e=(e,t=!1)=>{let n;this._resolved=!0,this._pendingResolve=void 0;let{props:r,styles:i}=e;if(r&&!k(r))for(let e in r){let t=r[e];(t===Number||t&&t.type===Number)&&(e in this._props&&(this._props[e]=X(this._props[e])),(n||(n=Object.create(null)))[j(e)]=!0)}this._numberProps=n,this._resolveProps(e),this.shadowRoot&&this._applyStyles(i),this._mount(e)},t=this._def.__asyncLoader;t?this._pendingResolve=t().then(t=>{t.configureApp=this._def.configureApp,e(this._def=t,!0)}):e(this._def)}_mount(e){this._app=this._createApp(e),this._inheritParentContext(),e.configureApp&&e.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);let t=this._instance&&this._instance.exposed;if(t)for(let e in t)T(this,e)||Object.defineProperty(this,e,{get:()=>tM(t[e])})}_resolveProps(e){let{props:t}=e,n=k(t)?t:Object.keys(t||{});for(let e of Object.keys(this))"_"!==e[0]&&n.includes(e)&&this._setProp(e,this[e]);for(let e of n.map(j))Object.defineProperty(this,e,{get(){return this._getProp(e)},set(t){this._setProp(e,t,!0,!0)}})}_setAttr(e){if(e.startsWith("data-v-"))return;let t=this.hasAttribute(e),n=t?this.getAttribute(e):sI,r=j(e);t&&this._numberProps&&this._numberProps[r]&&(n=X(n)),this._setProp(r,n,!1,!0)}_getProp(e){return this._props[e]}_setProp(e,t,n=!0,r=!1){if(t!==this._props[e]&&(t===sI?delete this._props[e]:(this._props[e]=t,"key"===e&&this._app&&(this._app._ceVNode.key=t)),r&&this._instance&&this._update(),n)){let n=this._ob;n&&n.disconnect(),!0===t?this.setAttribute(q(e),""):"string"==typeof t||"number"==typeof t?this.setAttribute(q(e),t+""):t||this.removeAttribute(q(e)),n&&n.observe(this,{attributes:!0})}}_update(){let e=this._createVNode();this._app&&(e.appContext=this._app._context),os(e,this._root)}_createVNode(){let e={};this.shadowRoot||(e.onVnodeMounted=e.onVnodeUpdated=this._renderSlots.bind(this));let t=lc(this._def,S(e,this._props));return this._instance||(t.ce=e=>{this._instance=e,e.ce=this,e.isCE=!0;let t=(e,t)=>{this.dispatchEvent(new CustomEvent(e,$(t[0])?S({detail:t},t[0]):{detail:t}))};e.emit=(e,...n)=>{t(e,n),q(e)!==e&&t(q(e),n)},this._setParent()}),t}_applyStyles(e,t){if(!e)return;if(t){if(t===this._def||this._styleChildren.has(t))return;this._styleChildren.add(t)}let n=this._nonce;for(let t=e.length-1;t>=0;t--){let r=document.createElement("style");n&&r.setAttribute("nonce",n),r.textContent=e[t],this.shadowRoot.prepend(r)}}_parseSlots(){let e,t=this._slots={};for(;e=this.firstChild;){let n=1===e.nodeType&&e.getAttribute("slot")||"default";(t[n]||(t[n]=[])).push(e),this.removeChild(e)}}_renderSlots(){let e=(this._teleportTarget||this).querySelectorAll("slot"),t=this._instance.type.__scopeId;for(let n=0;n{if(!n.length)return;let t=e.moveClass||`${e.name||"v"}-move`;if(!function(e,t,n){let r=e.cloneNode(),i=e[l6];i&&i.forEach(e=>{e.split(/\s+/).forEach(e=>e&&r.classList.remove(e))}),n.split(/\s+/).forEach(e=>e&&r.classList.add(e)),r.style.display="none";let l=1===t.nodeType?t:t.parentNode;l.appendChild(r);let{hasTransform:s}=ss(r);return l.removeChild(r),s}(n[0].el,i.vnode.el,t)){n=[];return}n.forEach(sq),n.forEach(sW);let r=n.filter(sK);sc(),r.forEach(e=>{let n=e.el,r=n.style;st(n,t),r.transform=r.webkitTransform=r.transitionDuration="";let i=n[sU]=e=>{(!e||e.target===n)&&(!e||/transform$/.test(e.propertyName))&&(n.removeEventListener("transitionend",i),n[sU]=null,sn(n,t))};n.addEventListener("transitionend",i)}),n=[]}),()=>{let s=tT(e),o=se(s),a=s.tag||i0;if(n=[],r)for(let e=0;e{let t=e.props["onUpdate:modelValue"]||!1;return k(t)?e=>J(t,e):t};function sJ(e){e.target.composing=!0}function sG(e){let t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}let sQ=Symbol("_assign"),sX={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e[sQ]=sz(i);let l=r||i.props&&"number"===i.props.type;sk(e,t?"change":"input",t=>{if(t.target.composing)return;let r=e.value;n&&(r=r.trim()),l&&(r=Q(r)),e[sQ](r)}),n&&sk(e,"change",()=>{e.value=e.value.trim()}),t||(sk(e,"compositionstart",sJ),sk(e,"compositionend",sG),sk(e,"change",sG))},mounted(e,{value:t}){e.value=null==t?"":t},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:l}},s){if(e[sQ]=sz(s),e.composing)return;let o=(l||"number"===e.type)&&!/^0\d/.test(e.value)?Q(e.value):e.value,a=null==t?"":t;if(o!==a){if(document.activeElement===e&&"range"!==e.type&&(r&&t===n||i&&e.value.trim()===a))return;e.value=a}}},sZ={deep:!0,created(e,t,n){e[sQ]=sz(n),sk(e,"change",()=>{let t=e._modelValue,n=s3(e),r=e.checked,i=e[sQ];if(k(t)){let e=eh(t,n),l=-1!==e;if(r&&!l)i(t.concat(n));else if(!r&&l){let n=[...t];n.splice(e,1),i(n)}}else if(N(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(s6(e,r))})},mounted:sY,beforeUpdate(e,t,n){e[sQ]=sz(n),sY(e,t,n)}};function sY(e,{value:t,oldValue:n},r){let i;if(e._modelValue=t,k(t))i=eh(t,r.props.value)>-1;else if(N(t))i=t.has(r.props.value);else{if(t===n)return;i=ep(t,s6(e,!0))}e.checked!==i&&(e.checked=i)}let s0={created(e,{value:t},n){e.checked=ep(t,n.props.value),e[sQ]=sz(n),sk(e,"change",()=>{e[sQ](s3(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[sQ]=sz(r),t!==n&&(e.checked=ep(t,r.props.value))}},s1={deep:!0,created(e,{value:t,modifiers:{number:n}},r){let i=N(t);sk(e,"change",()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?Q(s3(e)):s3(e));e[sQ](e.multiple?i?new Set(t):t:t[0]),e._assigning=!0,nt(()=>{e._assigning=!1})}),e[sQ]=sz(r)},mounted(e,{value:t}){s2(e,t)},beforeUpdate(e,t,n){e[sQ]=sz(n)},updated(e,{value:t}){e._assigning||s2(e,t)}};function s2(e,t){let n=e.multiple,r=k(t);if(!n||r||N(t)){for(let i=0,l=e.options.length;iString(e)===String(s)):l.selected=eh(t,s)>-1}else l.selected=t.has(s);else if(ep(s3(l),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}n||-1===e.selectedIndex||(e.selectedIndex=-1)}}function s3(e){return"_value"in e?e._value:e.value}function s6(e,t){let n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}let s4={created(e,t,n){s5(e,t,n,null,"created")},mounted(e,t,n){s5(e,t,n,null,"mounted")},beforeUpdate(e,t,n,r){s5(e,t,n,r,"beforeUpdate")},updated(e,t,n,r){s5(e,t,n,r,"updated")}};function s8(e,t){switch(e){case"SELECT":return s1;case"TEXTAREA":return sX;default:switch(t){case"checkbox":return sZ;case"radio":return s0;default:return sX}}}function s5(e,t,n,r,i){let l=s8(e.tagName,n.props&&n.props.type)[i];l&&l(e,t,n,r)}let s9=["ctrl","shift","alt","meta"],s7={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&0!==e.button,middle:e=>"button"in e&&1!==e.button,right:e=>"button"in e&&2!==e.button,exact:(e,t)=>s9.some(n=>e[`${n}Key`]&&!t.includes(n))},oe=(e,t)=>{let n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=(n,...r)=>{for(let e=0;e{let n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=n=>{if(!("key"in n))return;let r=q(n.key);if(t.some(e=>e===r||ot[e]===r))return e(n)})},or=S({patchProp:(e,t,n,r,i,l)=>{let s="svg"===i;if("class"===t){var o=r;let t=e[l6];t&&(o=(o?[o,...t]:[...t]).join(" ")),null==o?e.removeAttribute("class"):s?e.setAttribute("class",o):e.className=o}else"style"===t?function(e,t,n){let r=e.style,i=R(n),l=!1;if(n&&!i){if(t)if(R(t))for(let e of t.split(";")){let t=e.slice(0,e.indexOf(":")).trim();null==n[t]&&sb(r,t,"")}else for(let e in t)null==n[e]&&sb(r,e,"");for(let e in n)"display"===e&&(l=!0),sb(r,e,n[e])}else if(i){if(t!==n){let e=r[sf];e&&(n+=";"+e),r.cssText=n,l=sv.test(n)}}else t&&e.removeAttribute("style");su in e&&(e[su]=l?r.display:"",e[sd]&&(r.display="none"))}(e,n,r):b(t)?_(t)||function(e,t,n,r,i=null){let l=e[sw]||(e[sw]={}),s=l[t];if(r&&s)s.value=r;else{let[n,o]=function(e){let t;if(sN.test(e)){let n;for(t={};n=e.match(sN);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[":"===e[2]?e.slice(3):q(e.slice(2)),t]}(t);if(r)sk(e,n,l[t]=function(e,t){let n=e=>{if(e._vts){if(e._vts<=n.attached)return}else e._vts=Date.now();t2(function(e,t){if(!k(t))return t;{let n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(e=>t=>!t._stopped&&e&&e(t))}}(e,n.value),t,5,[e])};return n.value=e,n.attached=sE||(sA.then(()=>sE=0),sE=Date.now()),n}(r,i),o);else s&&(e.removeEventListener(n,s,o),l[t]=void 0)}}(e,t,0,r,l):("."===t[0]?(t=t.slice(1),0):"^"===t[0]?(t=t.slice(1),1):!function(e,t,n,r){if(r)return!!("innerHTML"===t||"textContent"===t||t in e&&sR(t)&&A(n));if("spellcheck"===t||"draggable"===t||"translate"===t||"autocorrect"===t||"form"===t||"list"===t&&"INPUT"===e.tagName||"type"===t&&"TEXTAREA"===e.tagName)return!1;if("width"===t||"height"===t){let t=e.tagName;if("IMG"===t||"VIDEO"===t||"CANVAS"===t||"SOURCE"===t)return!1}return!(sR(t)&&R(n))&&t in e}(e,t,r,s))?e._isVueCE&&(/[A-Z]/.test(t)||!R(r))?sT(e,j(t),r,l,t):("true-value"===t?e._trueValue=r:"false-value"===t&&(e._falseValue=r),sC(e,t,r,s)):(sT(e,t,r),e.tagName.includes("-")||"value"!==t&&"checked"!==t&&"selected"!==t||sC(e,t,r,s,l,"value"!==t))}},{insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i="svg"===t?l0.createElementNS("http://www.w3.org/2000/svg",e):"mathml"===t?l0.createElementNS("http://www.w3.org/1998/Math/MathML",e):n?l0.createElement(e,{is:n}):l0.createElement(e);return"select"===e&&r&&null!=r.multiple&&i.setAttribute("multiple",r.multiple),i},createText:e=>l0.createTextNode(e),createComment:e=>l0.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>l0.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,i,l){let s=n?n.previousSibling:t.lastChild;if(i&&(i===l||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),i!==l&&(i=i.nextSibling););else{l1.innerHTML=lY("svg"===r?`${e}`:"mathml"===r?`${e}`:e);let i=l1.content;if("svg"===r||"mathml"===r){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[s?s.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}}),oi=!1;function ol(){return c=oi?c:iS(or),oi=!0,c}let os=(...e)=>{(c||(c=i_(or))).render(...e)},oo=(...e)=>{ol().hydrate(...e)},oa=(...e)=>{let t=(c||(c=i_(or))).createApp(...e),{mount:n}=t;return t.mount=e=>{let r=od(e);if(!r)return;let i=t._component;A(i)||i.render||i.template||(i.template=r.innerHTML),1===r.nodeType&&(r.textContent="");let l=n(r,!1,ou(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),l},t},oc=(...e)=>{let t=ol().createApp(...e),{mount:n}=t;return t.mount=e=>{let t=od(e);if(t)return n(t,!0,ou(t))},t};function ou(e){return e instanceof SVGElement?"svg":"function"==typeof MathMLElement&&e instanceof MathMLElement?"mathml":void 0}function od(e){return R(e)?document.querySelector(e):e}let op=!1,oh=()=>{op||(op=!0,sX.getSSRProps=({value:e})=>({value:e}),s0.getSSRProps=({value:e},t)=>{if(t.props&&ep(t.props.value,e))return{checked:!0}},sZ.getSSRProps=({value:e},t)=>{if(k(e)){if(t.props&&eh(e,t.props.value)>-1)return{checked:!0}}else if(N(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},s4.getSSRProps=(e,t)=>{if("string"!=typeof t.type)return;let n=s8(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)},sp.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}})};var of,om,og,ov=Object.freeze({__proto__:null,BaseTransition:nD,BaseTransitionPropsValidators:nO,Comment:i2,DeprecationTypes:lX,EffectScope:ey,ErrorCodes:t0,ErrorTypeStrings:lW,Fragment:i0,KeepAlive:rt,ReactiveEffect:eC,Static:i3,Suspense:iJ,Teleport:nk,Text:i1,TrackOpTypes:tK,Transition:l5,TransitionGroup:sH,TriggerOpTypes:tz,VueElement:sD,assertNumber:tY,callWithAsyncErrorHandling:t2,callWithErrorHandling:t1,camelize:j,capitalize:W,cloneVNode:ld,compatUtils:lQ,computed:lF,createApp:oa,createBlock:ln,createCommentVNode:lf,createElementBlock:lt,createElementVNode:la,createHydrationRenderer:iS,createPropsRestProxy:rQ,createRenderer:i_,createSSRApp:oc,createSlots:rE,createStaticVNode:lh,createTextVNode:lp,createVNode:lc,customRef:tV,defineAsyncComponent:n9,defineComponent:nj,defineCustomElement:sO,defineEmits:rF,defineExpose:rV,defineModel:rj,defineOptions:rB,defineProps:rL,defineSSRCustomElement:sP,defineSlots:rU,devtools:lK,effect:eO,effectScope:eb,getCurrentInstance:lT,getCurrentScope:e_,getCurrentWatcher:tQ,getTransitionRawChildren:nU,guardReactiveProps:lu,h:lV,handleError:t3,hasInjectionContext:ii,hydrate:oo,hydrateOnIdle:n3,hydrateOnInteraction:n8,hydrateOnMediaQuery:n4,hydrateOnVisible:n6,initCustomFormatter:lB,initDirectivesForSSR:oh,inject:ir,isMemoSame:lj,isProxy:tC,isReactive:t_,isReadonly:tS,isRef:tE,isRuntimeOnly:lO,isShallow:tx,isVNode:lr,markRaw:tk,mergeDefaults:rJ,mergeModels:rG,mergeProps:ly,nextTick:nt,normalizeClass:el,normalizeProps:es,normalizeStyle:ee,onActivated:rr,onBeforeMount:ru,onBeforeUnmount:rf,onBeforeUpdate:rp,onDeactivated:ri,onErrorCaptured:rb,onMounted:rd,onRenderTracked:ry,onRenderTriggered:rv,onScopeDispose:eS,onServerPrefetch:rg,onUnmounted:rm,onUpdated:rh,onWatcherCleanup:tX,openBlock:i8,popScopeId:np,provide:it,proxyRefs:tL,pushScopeId:nd,queuePostFlushCb:ni,reactive:tm,readonly:tv,ref:tA,registerRuntimeCompiler:lI,render:os,renderList:rN,renderSlot:rA,resolveComponent:rS,resolveDirective:rT,resolveDynamicComponent:rC,resolveFilter:lG,resolveTransitionHooks:nL,setBlockTracking:i7,setDevtoolsHook:lz,setTransitionHooks:nB,shallowReactive:tg,shallowReadonly:ty,shallowRef:tR,ssrContextKey:iE,ssrUtils:lJ,stop:eP,toDisplayString:em,toHandlerKey:K,toHandlers:rI,toRaw:tT,toRef:tH,toRefs:tB,toValue:tD,transformVNodeArgs:ll,triggerRef:tP,unref:tM,useAttrs:rW,useCssModule:sF,useCssVars:sm,useHost:s$,useId:nH,useModel:iL,useSSRContext:iA,useShadowRoot:sL,useSlots:rq,useTemplateRef:nW,useTransitionState:nR,vModelCheckbox:sZ,vModelDynamic:s4,vModelRadio:s0,vModelSelect:s1,vModelText:sX,vShow:sp,version:lH,warn:lq,watch:iP,watchEffect:iR,watchPostEffect:iI,watchSyncEffect:iO,withAsyncContext:rX,withCtx:nf,withDefaults:rH,withDirectives:nm,withKeys:on,withMemo:lU,withModifiers:oe,withScopeId:nh});let oy=Symbol(""),ob=Symbol(""),o_=Symbol(""),oS=Symbol(""),ox=Symbol(""),oC=Symbol(""),oT=Symbol(""),ok=Symbol(""),ow=Symbol(""),oN=Symbol(""),oE=Symbol(""),oA=Symbol(""),oR=Symbol(""),oI=Symbol(""),oO=Symbol(""),oP=Symbol(""),oM=Symbol(""),oD=Symbol(""),o$=Symbol(""),oL=Symbol(""),oF=Symbol(""),oV=Symbol(""),oB=Symbol(""),oU=Symbol(""),oj=Symbol(""),oH=Symbol(""),oq=Symbol(""),oW=Symbol(""),oK=Symbol(""),oz=Symbol(""),oJ=Symbol(""),oG=Symbol(""),oQ=Symbol(""),oX=Symbol(""),oZ=Symbol(""),oY=Symbol(""),o0=Symbol(""),o1=Symbol(""),o2=Symbol(""),o3={[oy]:"Fragment",[ob]:"Teleport",[o_]:"Suspense",[oS]:"KeepAlive",[ox]:"BaseTransition",[oC]:"openBlock",[oT]:"createBlock",[ok]:"createElementBlock",[ow]:"createVNode",[oN]:"createElementVNode",[oE]:"createCommentVNode",[oA]:"createTextVNode",[oR]:"createStaticVNode",[oI]:"resolveComponent",[oO]:"resolveDynamicComponent",[oP]:"resolveDirective",[oM]:"resolveFilter",[oD]:"withDirectives",[o$]:"renderList",[oL]:"renderSlot",[oF]:"createSlots",[oV]:"toDisplayString",[oB]:"mergeProps",[oU]:"normalizeClass",[oj]:"normalizeStyle",[oH]:"normalizeProps",[oq]:"guardReactiveProps",[oW]:"toHandlers",[oK]:"camelize",[oz]:"capitalize",[oJ]:"toHandlerKey",[oG]:"setBlockTracking",[oQ]:"pushScopeId",[oX]:"popScopeId",[oZ]:"withCtx",[oY]:"unref",[o0]:"isRef",[o1]:"withMemo",[o2]:"isMemoSame"},o6={start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0},source:""};function o4(e,t,n,r,i,l,s,o=!1,a=!1,c=!1,u=o6){var d,p,h,f;return e&&(o?(e.helper(oC),e.helper((d=e.inSSR,p=c,d||p?oT:ok))):e.helper((h=e.inSSR,f=c,h||f?ow:oN)),s&&e.helper(oD)),{type:13,tag:t,props:n,children:r,patchFlag:i,dynamicProps:l,directives:s,isBlock:o,disableTracking:a,isComponent:c,loc:u}}function o8(e,t=o6){return{type:17,loc:t,elements:e}}function o5(e,t=o6){return{type:15,loc:t,properties:e}}function o9(e,t){return{type:16,loc:o6,key:R(e)?o7(e,!0):e,value:t}}function o7(e,t=!1,n=o6,r=0){return{type:4,loc:n,content:e,isStatic:t,constType:t?3:r}}function ae(e,t=o6){return{type:8,loc:t,children:e}}function at(e,t=[],n=o6){return{type:14,loc:n,callee:e,arguments:t}}function an(e,t,n=!1,r=!1,i=o6){return{type:18,params:e,returns:t,newline:n,isSlot:r,loc:i}}function ar(e,t,n,r=!0){return{type:19,test:e,consequent:t,alternate:n,newline:r,loc:o6}}function ai(e,{helper:t,removeHelper:n,inSSR:r}){if(!e.isBlock){var i,l;e.isBlock=!0,n((i=e.isComponent,r||i?ow:oN)),t(oC),t((l=e.isComponent,r||l?oT:ok))}}let al=new Uint8Array([123,123]),as=new Uint8Array([125,125]);function ao(e){return e>=97&&e<=122||e>=65&&e<=90}function aa(e){return 32===e||10===e||9===e||12===e||13===e}function ac(e){return 47===e||62===e||aa(e)}function au(e){let t=new Uint8Array(e.length);for(let n=0;n4===e.type&&e.isStatic;function ag(e){switch(e){case"Teleport":case"teleport":return ob;case"Suspense":case"suspense":return o_;case"KeepAlive":case"keep-alive":return oS;case"BaseTransition":case"base-transition":return ox}}let av=/^\d|[^\$\w\xA0-\uFFFF]/,ay=e=>!av.test(e),ab=/[A-Za-z_$\xA0-\uFFFF]/,a_=/[\.\?\w$\xA0-\uFFFF]/,aS=/\s+[.[]\s*|\s*[.[]\s+/g,ax=e=>4===e.type?e.content:e.loc.source,aC=e=>{let t=ax(e).trim().replace(aS,e=>e.trim()),n=0,r=[],i=0,l=0,s=null;for(let e=0;e|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/;function ak(e,t,n=!1){for(let r=0;r4===e.key.type&&e.key.content===r)}return n}function aD(e,t){return`_${t}_${e.replace(/[^\w]/g,(t,n)=>"-"===t?"_":e.charCodeAt(n).toString())}`}let a$=/([\s\S]*?)\s+(?:in|of)\s+(\S[\s\S]*)/,aL={parseMode:"base",ns:0,delimiters:["{{","}}"],getNamespace:()=>0,isVoidTag:y,isPreTag:y,isIgnoreNewlineTag:y,isCustomElement:y,onError:ap,onWarn:ah,comments:!1,prefixIdentifiers:!1},aF=aL,aV=null,aB="",aU=null,aj=null,aH="",aq=-1,aW=-1,aK=0,az=!1,aJ=null,aG=[],aQ=new class{constructor(e,t){this.stack=e,this.cbs=t,this.state=1,this.buffer="",this.sectionStart=0,this.index=0,this.entityStart=0,this.baseState=1,this.inRCDATA=!1,this.inXML=!1,this.inVPre=!1,this.newlines=[],this.mode=0,this.delimiterOpen=al,this.delimiterClose=as,this.delimiterIndex=-1,this.currentSequence=void 0,this.sequenceIndex=0}get inSFCRoot(){return 2===this.mode&&0===this.stack.length}reset(){this.state=1,this.mode=0,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=1,this.inRCDATA=!1,this.currentSequence=void 0,this.newlines.length=0,this.delimiterOpen=al,this.delimiterClose=as}getPos(e){let t=1,n=e+1;for(let r=this.newlines.length-1;r>=0;r--){let i=this.newlines[r];if(e>i){t=r+2,n=e-i;break}}return{column:n,line:t,offset:e}}peek(){return this.buffer.charCodeAt(this.index+1)}stateText(e){60===e?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=5,this.sectionStart=this.index):this.inVPre||e!==this.delimiterOpen[0]||(this.state=2,this.delimiterIndex=0,this.stateInterpolationOpen(e))}stateInterpolationOpen(e){if(e===this.delimiterOpen[this.delimiterIndex])if(this.delimiterIndex===this.delimiterOpen.length-1){let e=this.index+1-this.delimiterOpen.length;e>this.sectionStart&&this.cbs.ontext(this.sectionStart,e),this.state=3,this.sectionStart=e}else this.delimiterIndex++;else this.inRCDATA?(this.state=32,this.stateInRCDATA(e)):(this.state=1,this.stateText(e))}stateInterpolation(e){e===this.delimiterClose[0]&&(this.state=4,this.delimiterIndex=0,this.stateInterpolationClose(e))}stateInterpolationClose(e){e===this.delimiterClose[this.delimiterIndex]?this.delimiterIndex===this.delimiterClose.length-1?(this.cbs.oninterpolation(this.sectionStart,this.index+1),this.inRCDATA?this.state=32:this.state=1,this.sectionStart=this.index+1):this.delimiterIndex++:(this.state=3,this.stateInterpolation(e))}stateSpecialStartSequence(e){let t=this.sequenceIndex===this.currentSequence.length;if(t?ac(e):(32|e)===this.currentSequence[this.sequenceIndex]){if(!t)return void this.sequenceIndex++}else this.inRCDATA=!1;this.sequenceIndex=0,this.state=6,this.stateInTagName(e)}stateInRCDATA(e){if(this.sequenceIndex===this.currentSequence.length){if(62===e||aa(e)){let t=this.index-this.currentSequence.length;if(this.sectionStart=e||(28===this.state?this.currentSequence===ad.CdataEnd?this.cbs.oncdata(this.sectionStart,e):this.cbs.oncomment(this.sectionStart,e):6===this.state||11===this.state||18===this.state||17===this.state||12===this.state||13===this.state||14===this.state||15===this.state||16===this.state||20===this.state||19===this.state||21===this.state||9===this.state||this.cbs.ontext(this.sectionStart,e))}emitCodePoint(e,t){}}(aG,{onerr:cn,ontext(e,t){a1(aY(e,t),e,t)},ontextentity(e,t,n){a1(e,t,n)},oninterpolation(e,t){if(az)return a1(aY(e,t),e,t);let n=e+aQ.delimiterOpen.length,r=t-aQ.delimiterClose.length;for(;aa(aB.charCodeAt(n));)n++;for(;aa(aB.charCodeAt(r-1));)r--;let i=aY(n,r);i.includes("&")&&(i=aF.decodeEntities(i,!1)),a9({type:5,content:ct(i,!1,a7(n,r)),loc:a7(e,t)})},onopentagname(e,t){let n=aY(e,t);aU={type:1,tag:n,ns:aF.getNamespace(n,aG[0],aF.ns),tagType:0,props:[],children:[],loc:a7(e-1,t),codegenNode:void 0}},onopentagend(e){a0(e)},onclosetag(e,t){let n=aY(e,t);if(!aF.isVoidTag(n)){let r=!1;for(let e=0;e0&&aG[0].loc.start.offset;for(let n=0;n<=e;n++)a2(aG.shift(),t,n(7===e.type?e.rawName:e.name)===t)},onattribend(e,t){aU&&aj&&(ce(aj.loc,t),0!==e&&(aH.includes("&")&&(aH=aF.decodeEntities(aH,!0)),6===aj.type?("class"===aj.name&&(aH=a5(aH).trim()),aj.value={type:2,content:aH,loc:1===e?a7(aq,aW):a7(aq-1,aW+1)},aQ.inSFCRoot&&"template"===aU.tag&&"lang"===aj.name&&aH&&"html"!==aH&&aQ.enterRCDATA(au("{let i=t.start.offset+n,l=i+e.length;return ct(e,!1,a7(i,l),0,+!!r)},o={source:s(l.trim(),n.indexOf(l,i.length)),value:void 0,key:void 0,index:void 0,finalized:!1},a=i.trim().replace(aZ,"").trim(),c=i.indexOf(a),u=a.match(aX);if(u){let e;a=a.replace(aX,"").trim();let t=u[1].trim();if(t&&(e=n.indexOf(t,c+a.length),o.key=s(t,e,!0)),u[2]){let r=u[2].trim();r&&(o.index=s(r,n.indexOf(r,o.key?e+t.length:c+a.length),!0))}}return a&&(o.value=s(a,c,!0)),o}(aj.exp)))),(7!==aj.type||"pre"!==aj.name)&&aU.props.push(aj)),aH="",aq=aW=-1},oncomment(e,t){aF.comments&&a9({type:3,content:aY(e,t),loc:a7(e-4,t+3)})},onend(){let e=aB.length;for(let t=0;t64&&n<91||ag(e)||aF.isBuiltInComponent&&aF.isBuiltInComponent(e)||aF.isNativeTag&&!aF.isNativeTag(e))return!0;for(let e=0;e=0;)n--;return n}let a6=new Set(["if","else","else-if","for","slot"]),a4=/\r\n/g;function a8(e){let t="preserve"!==aF.whitespace,n=!1;for(let r=0;r3!==e.type);return 1!==t.length||1!==t[0].type||aI(t[0])?null:t[0]}function ci(e,t){let{constantCache:n}=t;switch(e.type){case 1:if(0!==e.tagType)return 0;let r=n.get(e);if(void 0!==r)return r;let i=e.codegenNode;if(13!==i.type||i.isBlock&&"svg"!==e.tag&&"foreignObject"!==e.tag&&"math"!==e.tag)return 0;if(void 0!==i.patchFlag)return n.set(e,0),0;{let r=3,c=cs(e,t);if(0===c)return n.set(e,0),0;c1)for(let i=0;i{l--};for(;lt===e:t=>e.test(t);return(e,r)=>{if(1===e.type){let{props:i}=e;if(3===e.tagType&&i.some(aA))return;let l=[];for(let s=0;s`${o3[e]}: _${o3[e]}`;function cp(e,t,{helper:n,push:r,newline:i,isTS:l}){let s=n("component"===t?oI:oP);for(let n=0;n3;t.push("["),n&&t.indent(),cf(e,t,n),n&&t.deindent(),t.push("]")}function cf(e,t,n=!1,r=!0){let{push:i,newline:l}=t;for(let s=0;se||"null")}([a,c,u,i,p]),t),l(")"),f&&l(")"),h&&(l(", "),cm(h,t),l(")"))}(e,t);break;case 14:var m=e,g=t;let{push:y,helper:b,pure:_}=g,S=R(m.callee)?m.callee:b(m.callee);_&&y(cu),y(S+"(",-2,m),cf(m.arguments,g),y(")");break;case 15:!function(e,t){let{push:n,indent:r,deindent:i,newline:l}=t,{properties:s}=e;if(!s.length)return n("{}",-2,e);let o=s.length>1;n(o?"{":"{ "),o&&r();for(let e=0;e "),(P||O)&&(T("{"),w()),A?(P&&T("return "),k(A)?ch(A,C):cm(A,C)):O&&cm(O,C),(P||O)&&(N(),T("}")),M&&T(")");break;case 19:var D=e,$=t;let{test:L,consequent:F,alternate:V,newline:B}=D,{push:U,indent:j,deindent:H,newline:q}=$;if(4===L.type){let e=!ay(L.content);e&&U("("),cg(L,$),e&&U(")")}else U("("),cm(L,$),U(")");B&&j(),$.indentLevel++,B||U(" "),U("? "),cm(F,$),$.indentLevel--,B&&q(),B||U(" "),U(": ");let W=19===V.type;!W&&$.indentLevel++,cm(V,$),!W&&$.indentLevel--,B&&H(!0);break;case 20:var K=e,z=t;let{push:J,helper:G,indent:Q,deindent:X,newline:Z}=z,{needPauseTracking:Y,needArraySpread:ee}=K;ee&&J("[...("),J(`_cache[${K.index}] || (`),Y&&(Q(),J(`${G(oG)}(-1`),K.inVOnce&&J(", true"),J("),"),Z(),J("(")),J(`_cache[${K.index}] = `),cm(K.value,z),Y&&(J(`).cacheIndex = ${K.index},`),Z(),J(`${G(oG)}(1),`),Z(),J(`_cache[${K.index}]`),X()),J(")"),ee&&J(")]");break;case 21:cf(e.body,t,!0,!1)}}function cg(e,t){let{content:n,isStatic:r}=e;t.push(r?JSON.stringify(n):n,-3,e)}function cv(e,t){for(let n=0;n(function(e,t,n,r){if("else"!==t.name&&(!t.exp||!t.exp.content.trim())){let r=t.exp?t.exp.loc:e.loc;n.onError(af(28,t.loc)),t.exp=o7("true",!1,r)}if("if"===t.name){var i;let l=cb(e,t),s={type:9,loc:a7((i=e.loc).start.offset,i.end.offset),branches:[l]};if(n.replaceNode(s),r)return r(s,l,!0)}else{let i=n.parent.children,l=i.indexOf(e);for(;l-- >=-1;){let s=i[l];if(s&&3===s.type||s&&2===s.type&&!s.content.trim().length){n.removeNode(s);continue}if(s&&9===s.type){"else-if"===t.name&&void 0===s.branches[s.branches.length-1].condition&&n.onError(af(30,e.loc)),n.removeNode();let i=cb(e,t);s.branches.push(i);let l=r&&r(s,i,!1);ca(i,n),l&&l(),n.currentNode=null}else n.onError(af(30,e.loc));break}}})(e,t,n,(e,t,r)=>{let i=n.parent.children,l=i.indexOf(e),s=0;for(;l-- >=0;){let e=i[l];e&&9===e.type&&(s+=e.branches.length)}return()=>{r?e.codegenNode=c_(t,s,n):function(e){for(;;)if(19===e.type)if(19!==e.alternate.type)return e;else e=e.alternate;else 20===e.type&&(e=e.value)}(e.codegenNode).alternate=c_(t,s+e.branches.length-1,n)}}));function cb(e,t){let n=3===e.tagType;return{type:10,loc:e.loc,condition:"else"===t.name?void 0:t.exp,children:n&&!ak(e,"for")?e.children:[e],userKey:aw(e,"key"),isTemplateIf:n}}function c_(e,t,n){return e.condition?ar(e.condition,cS(e,t,n),at(n.helper(oE),['""',"true"])):cS(e,t,n)}function cS(e,t,n){let{helper:r}=n,i=o9("key",o7(`${t}`,!1,o6,2)),{children:l}=e,s=l[0];if(1!==l.length||1!==s.type)if(1!==l.length||11!==s.type)return o4(n,r(oy),o5([i]),l,64,void 0,void 0,!0,!1,!1,e.loc);else{let e=s.codegenNode;return aP(e,i,n),e}{let e=s.codegenNode,t=14===e.type&&e.callee===o1?e.arguments[1].returns:e;return 13===t.type&&ai(t,n),aP(t,i,n),e}}let cx=(e,t,n)=>{let{modifiers:r,loc:i}=e,l=e.arg,{exp:s}=e;if(s&&4===s.type&&!s.content.trim()&&(s=void 0),!s){if(4!==l.type||!l.isStatic)return n.onError(af(52,l.loc)),{props:[o9(l,o7("",!0,i))]};cC(e),s=e.exp}return 4!==l.type?(l.children.unshift("("),l.children.push(') || ""')):l.isStatic||(l.content=`${l.content} || ""`),r.some(e=>"camel"===e.content)&&(4===l.type?l.isStatic?l.content=j(l.content):l.content=`${n.helperString(oK)}(${l.content})`:(l.children.unshift(`${n.helperString(oK)}(`),l.children.push(")"))),!n.inSSR&&(r.some(e=>"prop"===e.content)&&cT(l,"."),r.some(e=>"attr"===e.content)&&cT(l,"^")),{props:[o9(l,s)]}},cC=(e,t)=>{let n=e.arg;e.exp=o7(j(n.content),!1,n.loc)},cT=(e,t)=>{4===e.type?e.isStatic?e.content=t+e.content:e.content=`\`${t}\${${e.content}}\``:(e.children.unshift(`'${t}' + (`),e.children.push(")"))},ck=cc("for",(e,t,n)=>{let{helper:r,removeHelper:i}=n;return function(e,t,n,r){if(!t.exp)return void n.onError(af(31,t.loc));let i=t.forParseResult;if(!i)return void n.onError(af(32,t.loc));cw(i);let{addIdentifiers:l,removeIdentifiers:s,scopes:o}=n,{source:a,value:c,key:u,index:d}=i,p={type:11,loc:t.loc,source:a,valueAlias:c,keyAlias:u,objectIndexAlias:d,parseResult:i,children:aR(e)?e.children:[e]};n.replaceNode(p),o.vFor++;let h=r&&r(p);return()=>{o.vFor--,h&&h()}}(e,t,n,t=>{let l=at(r(o$),[t.source]),s=aR(e),o=ak(e,"memo"),a=aw(e,"key",!1,!0);a&&7===a.type&&!a.exp&&cC(a);let c=a&&(6===a.type?a.value?o7(a.value.content,!0):void 0:a.exp),u=a&&c?o9("key",c):null,d=4===t.source.type&&t.source.constType>0,p=d?64:a?128:256;return t.codegenNode=o4(n,r(oy),void 0,l,p,void 0,void 0,!0,!d,!1,e.loc),()=>{let a,{children:p}=t,h=1!==p.length||1!==p[0].type,f=aI(e)?e:s&&1===e.children.length&&aI(e.children[0])?e.children[0]:null;if(f)a=f.codegenNode,s&&u&&aP(a,u,n);else if(h)a=o4(n,r(oy),u?o5([u]):void 0,e.children,64,void 0,void 0,!0,void 0,!1);else{var m,g,y,b,_,S,x,C;a=p[0].codegenNode,s&&u&&aP(a,u,n),!d!==a.isBlock&&(a.isBlock?(i(oC),i((m=n.inSSR,g=a.isComponent,m||g?oT:ok))):i((y=n.inSSR,b=a.isComponent,y||b?ow:oN))),(a.isBlock=!d,a.isBlock)?(r(oC),r((_=n.inSSR,S=a.isComponent,_||S?oT:ok))):r((x=n.inSSR,C=a.isComponent,x||C?ow:oN))}if(o){let e=an(cN(t.parseResult,[o7("_cached")]));e.body={type:21,body:[ae(["const _memo = (",o.exp,")"]),ae(["if (_cached",...c?[" && _cached.key === ",c]:[],` && ${n.helperString(o2)}(_cached, _memo)) return _cached`]),ae(["const _item = ",a]),o7("_item.memo = _memo"),o7("return _item")],loc:o6},l.arguments.push(e,o7("_cache"),o7(String(n.cached.length))),n.cached.push(null)}else l.arguments.push(an(cN(t.parseResult),a,!0))}})});function cw(e,t){e.finalized||(e.finalized=!0)}function cN({value:e,key:t,index:n},r=[]){var i=[e,t,n,...r];let l=i.length;for(;l--&&!i[l];);return i.slice(0,l+1).map((e,t)=>e||o7("_".repeat(t+1),!1))}let cE=o7("undefined",!1),cA=(e,t)=>{if(1===e.type&&(1===e.tagType||3===e.tagType)){let n=ak(e,"slot");if(n)return n.exp,t.scopes.vSlot++,()=>{t.scopes.vSlot--}}};function cR(e,t,n){let r=[o9("name",e),o9("fn",t)];return null!=n&&r.push(o9("key",o7(String(n),!0))),o5(r)}function cI(e){return 2!==e.type&&12!==e.type||(2===e.type?!!e.content.trim():cI(e.content))}let cO=new WeakMap,cP=(e,t)=>function(){let n,r,i,l,s;if(1!==(e=t.currentNode).type||0!==e.tagType&&1!==e.tagType)return;let{tag:o,props:a}=e,c=1===e.tagType,u=c?function(e,t,n=!1){let{tag:r}=e,i=c$(r),l=aw(e,"is",!1,!0);if(l)if(i){let e;if(6===l.type?e=l.value&&o7(l.value.content,!0):(e=l.exp)||(e=o7("is",!1,l.arg.loc)),e)return at(t.helper(oO),[e])}else 6===l.type&&l.value.content.startsWith("vue:")&&(r=l.value.content.slice(4));let s=ag(r)||t.isBuiltInComponent(r);return s?(n||t.helper(s),s):(t.helper(oI),t.components.add(r),aD(r,"component"))}(e,t):`"${o}"`,d=O(u)&&u.callee===oO,p=0,h=d||u===ob||u===o_||!c&&("svg"===o||"foreignObject"===o||"math"===o);if(a.length>0){let r=cM(e,t,void 0,c,d);n=r.props,p=r.patchFlag,l=r.dynamicPropNames;let i=r.directives;s=i&&i.length?o8(i.map(e=>(function(e,t){let n=[],r=cO.get(e);r?n.push(t.helperString(r)):(t.helper(oP),t.directives.add(e.name),n.push(aD(e.name,"directive")));let{loc:i}=e;if(e.exp&&n.push(e.exp),e.arg&&(e.exp||n.push("void 0"),n.push(e.arg)),Object.keys(e.modifiers).length){e.arg||(e.exp||n.push("void 0"),n.push("void 0"));let t=o7("true",!1,i);n.push(o5(e.modifiers.map(e=>o9(e,t)),i))}return o8(n,e.loc)})(e,t))):void 0,r.shouldUseBlock&&(h=!0)}if(e.children.length>0)if(u===oS&&(h=!0,p|=1024),c&&u!==ob&&u!==oS){let{slots:n,hasDynamicSlots:i}=function(e,t,n=(e,t,n,r)=>an(e,n,!1,!0,n.length?n[0].loc:r)){t.helper(oZ);let{children:r,loc:i}=e,l=[],s=[],o=t.scopes.vSlot>0||t.scopes.vFor>0,a=ak(e,"slot",!0);if(a){let{arg:e,exp:t}=a;e&&!am(e)&&(o=!0),l.push(o9(e||o7("default",!0),n(t,void 0,r,i)))}let c=!1,u=!1,d=[],p=new Set,h=0;for(let e=0;eo9("default",n(e,void 0,t,i));c?d.length&&d.some(e=>cI(e))&&(u?t.onError(af(39,d[0].loc)):l.push(e(void 0,d))):l.push(e(void 0,r))}let f=o?2:!function e(t){for(let n=0;n0,f=!1,m=0,g=!1,y=!1,_=!1,S=!1,x=!1,C=!1,T=[],k=e=>{u.length&&(d.push(o5(cD(u),a)),u=[]),e&&d.push(e)},w=()=>{t.scopes.vFor>0&&u.push(o9(o7("ref_for",!0),o7("true")))},N=({key:e,value:n})=>{if(am(e)){let l=e.content,s=b(l);s&&(!r||i)&&"onclick"!==l.toLowerCase()&&"onUpdate:modelValue"!==l&&!F(l)&&(S=!0),s&&F(l)&&(C=!0),s&&14===n.type&&(n=n.arguments[0]),20===n.type||(4===n.type||8===n.type)&&ci(n,t)>0||("ref"===l?g=!0:"class"===l?y=!0:"style"===l?_=!0:"key"===l||T.includes(l)||T.push(l),r&&("class"===l||"style"===l)&&!T.includes(l)&&T.push(l))}else x=!0};for(let i=0;i"prop"===e.content)&&(m|=32);let S=t.directiveTransforms[n];if(S){let{props:n,needRuntime:r}=S(s,e,t);l||n.forEach(N),_&&i&&!am(i)?k(o5(n,a)):u.push(...n),r&&(p.push(s),I(r)&&cO.set(s,r))}else!V(n)&&(p.push(s),h&&(f=!0))}}if(d.length?(k(),s=d.length>1?at(t.helper(oB),d,a):d[0]):u.length&&(s=o5(cD(u),a)),x?m|=16:(y&&!r&&(m|=2),_&&!r&&(m|=4),T.length&&(m|=8),S&&(m|=32)),!f&&(0===m||32===m)&&(g||C||p.length>0)&&(m|=512),!t.inSSR&&s)switch(s.type){case 15:let E=-1,A=-1,R=!1;for(let e=0;e{if(aI(e)){let{children:n,loc:r}=e,{slotName:i,slotProps:l}=function(e,t){let n,r='"default"',i=[];for(let t=0;t0){let{props:r,directives:l}=cM(e,t,i,!1,!1);n=r,l.length&&t.onError(af(36,l[0].loc))}return{slotName:r,slotProps:n}}(e,t),s=[t.prefixIdentifiers?"_ctx.$slots":"$slots",i,"{}","undefined","true"],o=2;l&&(s[2]=l,o=3),n.length&&(s[3]=an([],n,!1,!1,r),o=4),t.scopeId&&!t.slotted&&(o=5),s.splice(o),e.codegenNode=at(t.helper(oL),s,r)}},cF=(e,t,n,r)=>{let i,{loc:l,modifiers:s,arg:o}=e;if(!e.exp&&!s.length,4===o.type)if(o.isStatic){let e=o.content;e.startsWith("vue:")&&(e=`vnode-${e.slice(4)}`),i=o7(0!==t.tagType||e.startsWith("vnode")||!/[A-Z]/.test(e)?K(j(e)):`on:${e}`,!0,o.loc)}else i=ae([`${n.helperString(oJ)}(`,o,")"]);else(i=o).children.unshift(`${n.helperString(oJ)}(`),i.children.push(")");let a=e.exp;a&&!a.content.trim()&&(a=void 0);let c=n.cacheHandlers&&!a&&!n.inVOnce;if(a){let e,t=aC(a),n=!(t||(e=a,aT.test(ax(e)))),r=a.content.includes(";");(n||c&&t)&&(a=ae([`${n?"$event":"(...args)"} => ${r?"{":"("}`,a,r?"}":")"]))}let u={props:[o9(i,a||o7("() => {}",!1,l))]};return r&&(u=r(u)),c&&(u.props[0].value=n.cache(u.props[0].value)),u.props.forEach(e=>e.key.isHandlerKey=!0),u},cV=(e,t)=>{if(0===e.type||1===e.type||11===e.type||10===e.type)return()=>{let n,r=e.children,i=!1;for(let e=0;e7===e.type&&!t.directiveTransforms[e.name]))))for(let e=0;e{if(1===e.type&&ak(e,"once",!0)&&!cB.has(e)&&!t.inVOnce&&!t.inSSR)return cB.add(e),t.inVOnce=!0,t.helper(oG),()=>{t.inVOnce=!1;let e=t.currentNode;e.codegenNode&&(e.codegenNode=t.cache(e.codegenNode,!0,!0))}},cj=(e,t,n)=>{let r,{exp:i,arg:l}=e;if(!i)return n.onError(af(41,e.loc)),cH();let s=i.loc.source.trim(),o=4===i.type?i.content:s,a=n.bindingMetadata[s];if("props"===a||"props-aliased"===a)return i.loc,cH();if(!o.trim()||!aC(i))return n.onError(af(42,i.loc)),cH();let c=l||o7("modelValue",!0),u=l?am(l)?`onUpdate:${j(l.content)}`:ae(['"onUpdate:" + ',l]):"onUpdate:modelValue",d=n.isTS?"($event: any)":"$event";r=ae([`${d} => ((`,i,") = $event)"]);let p=[o9(c,e.exp),o9(u,r)];if(e.modifiers.length&&1===t.tagType){let t=e.modifiers.map(e=>e.content).map(e=>(ay(e)?e:JSON.stringify(e))+": true").join(", "),n=l?am(l)?`${l.content}Modifiers`:ae([l,' + "Modifiers"']):"modelModifiers";p.push(o9(n,o7(`{ ${t} }`,!1,e.loc,2)))}return cH(p)};function cH(e=[]){return{props:e}}let cq=new WeakSet,cW=(e,t)=>{if(1===e.type){let n=ak(e,"memo");if(!(!n||cq.has(e)))return cq.add(e),()=>{let r=e.codegenNode||t.currentNode.codegenNode;r&&13===r.type&&(1!==e.tagType&&ai(r,t),e.codegenNode=at(t.helper(o1),[n.exp,an(void 0,r),"_cache",String(t.cached.length)]),t.cached.push(null))}}},cK=Symbol(""),cz=Symbol(""),cJ=Symbol(""),cG=Symbol(""),cQ=Symbol(""),cX=Symbol(""),cZ=Symbol(""),cY=Symbol(""),c0=Symbol(""),c1=Symbol("");Object.getOwnPropertySymbols(og={[cK]:"vModelRadio",[cz]:"vModelCheckbox",[cJ]:"vModelText",[cG]:"vModelSelect",[cQ]:"vModelDynamic",[cX]:"withModifiers",[cZ]:"withKeys",[cY]:"vShow",[c0]:"Transition",[c1]:"TransitionGroup"}).forEach(e=>{o3[e]=og[e]});let c2={parseMode:"html",isVoidTag:eu,isNativeTag:e=>eo(e)||ea(e)||ec(e),isPreTag:e=>"pre"===e,isIgnoreNewlineTag:e=>"pre"===e||"textarea"===e,decodeEntities:function(e,t=!1){return(u||(u=document.createElement("div")),t)?(u.innerHTML=`
`,u.children[0].getAttribute("foo")):(u.innerHTML=e,u.textContent)},isBuiltInComponent:e=>"Transition"===e||"transition"===e?c0:"TransitionGroup"===e||"transition-group"===e?c1:void 0,getNamespace(e,t,n){let r=t?t.ns:n;if(t&&2===r)if("annotation-xml"===t.tag){if("svg"===e)return 1;t.props.some(e=>6===e.type&&"encoding"===e.name&&null!=e.value&&("text/html"===e.value.content||"application/xhtml+xml"===e.value.content))&&(r=0)}else/^m(?:[ions]|text)$/.test(t.tag)&&"mglyph"!==e&&"malignmark"!==e&&(r=0);else t&&1===r&&("foreignObject"===t.tag||"desc"===t.tag||"title"===t.tag)&&(r=0);if(0===r){if("svg"===e)return 1;if("math"===e)return 2}return r}},c3=h("passive,once,capture"),c6=h("stop,prevent,self,ctrl,shift,alt,meta,exact,middle"),c4=h("left,right"),c8=h("onkeyup,onkeydown,onkeypress"),c5=(e,t)=>am(e)&&"onclick"===e.content.toLowerCase()?o7(t,!0):4!==e.type?ae(["(",e,`) === "onClick" ? "${t}" : (`,e,")"]):e,c9=(e,t)=>{1===e.type&&0===e.tagType&&("script"===e.tag||"style"===e.tag)&&t.removeNode()},c7=[e=>{1===e.type&&e.props.forEach((t,n)=>{let r,i;6===t.type&&"style"===t.name&&t.value&&(e.props[n]={type:7,name:"bind",arg:o7("style",!0,t.loc),exp:(r=t.value.content,i=t.loc,o7(JSON.stringify(ei(r)),!1,i,3)),modifiers:[],loc:t.loc})})}],ue={cloak:()=>({props:[]}),html:(e,t,n)=>{let{exp:r,loc:i}=e;return r||n.onError(af(53,i)),t.children.length&&(n.onError(af(54,i)),t.children.length=0),{props:[o9(o7("innerHTML",!0,i),r||o7("",!0))]}},text:(e,t,n)=>{let{exp:r,loc:i}=e;return r||n.onError(af(55,i)),t.children.length&&(n.onError(af(56,i)),t.children.length=0),{props:[o9(o7("textContent",!0),r?ci(r,n)>0?r:at(n.helperString(oV),[r],i):o7("",!0))]}},model:(e,t,n)=>{let r=cj(e,t,n);if(!r.props.length||1===t.tagType)return r;e.arg&&n.onError(af(58,e.arg.loc));let{tag:i}=t,l=n.isCustomElement(i);if("input"===i||"textarea"===i||"select"===i||l){let s=cJ,o=!1;if("input"===i||l){let r=aw(t,"type");if(r){if(7===r.type)s=cQ;else if(r.value)switch(r.value.content){case"radio":s=cK;break;case"checkbox":s=cz;break;case"file":o=!0,n.onError(af(59,e.loc))}}else t.props.some(e=>7===e.type&&"bind"===e.name&&(!e.arg||4!==e.arg.type||!e.arg.isStatic))&&(s=cQ)}else"select"===i&&(s=cG);o||(r.needRuntime=n.helper(s))}else n.onError(af(57,e.loc));return r.props=r.props.filter(e=>4!==e.key.type||"modelValue"!==e.key.content),r},on:(e,t,n)=>cF(e,t,n,t=>{let{modifiers:r}=e;if(!r.length)return t;let{key:i,value:l}=t.props[0],{keyModifiers:s,nonKeyModifiers:o,eventOptionModifiers:a}=((e,t,n,r)=>{let i=[],l=[],s=[];for(let n=0;n{let{exp:r,loc:i}=e;return r||n.onError(af(61,i)),{props:[],needRuntime:n.helper(cY)}}},ut=Object.create(null);function un(e,t){if(!R(e))if(!e.nodeType)return g;else e=e.innerHTML;let n=e+JSON.stringify(t,(e,t)=>"function"==typeof t?t.toString():t),r=ut[n];if(r)return r;if("#"===e[0]){let t=document.querySelector(e);e=t?t.innerHTML:""}let i=S({hoistStatic:!0,onError:void 0,onWarn:g},t);i.isCustomElement||"undefined"==typeof customElements||(i.isCustomElement=e=>!!customElements.get(e));let{code:l}=function(e,t={}){return function(e,t={}){let n=t.onError||ap,r="module"===t.mode;!0===t.prefixIdentifiers?n(af(47)):r&&n(af(48)),t.cacheHandlers&&n(af(49)),t.scopeId&&!r&&n(af(50));let i=S({},t,{prefixIdentifiers:!1}),l=R(e)?function(e,t){if(aQ.reset(),aU=null,aj=null,aH="",aq=-1,aW=-1,aG.length=0,aB=e,aF=S({},aL),t){let e;for(e in t)null!=t[e]&&(aF[e]=t[e])}aQ.mode="html"===aF.parseMode?1:2*("sfc"===aF.parseMode),aQ.inXML=1===aF.ns||2===aF.ns;let n=t&&t.delimiters;n&&(aQ.delimiterOpen=au(n[0]),aQ.delimiterClose=au(n[1]));let r=aV=function(e,t=""){return{type:0,source:t,children:e,helpers:new Set,components:[],directives:[],hoists:[],imports:[],cached:[],temps:0,codegenNode:void 0,loc:o6}}([],e);return aQ.parse(aB),r.loc=a7(0,e.length),r.children=a8(r.children),aV=null,r}(e,i):e,[s,o]=[[cU,cy,cW,ck,cL,cP,cA,cV],{on:cF,bind:cx,model:cj}];var a=S({},i,{nodeTransforms:[...s,...t.nodeTransforms||[]],directiveTransforms:S({},o,t.directiveTransforms||{})});let c=function(e,{filename:t="",prefixIdentifiers:n=!1,hoistStatic:r=!1,hmr:i=!1,cacheHandlers:l=!1,nodeTransforms:s=[],directiveTransforms:o={},transformHoist:a=null,isBuiltInComponent:c=g,isCustomElement:u=g,expressionPlugins:d=[],scopeId:p=null,slotted:h=!0,ssr:m=!1,inSSR:y=!1,ssrCssVars:b="",bindingMetadata:_=f,inline:S=!1,isTS:x=!1,onError:C=ap,onWarn:T=ah,compatConfig:k}){let w=t.replace(/\?.*$/,"").match(/([^/\\]+)\.\w+$/),N={filename:t,selfName:w&&W(j(w[1])),prefixIdentifiers:n,hoistStatic:r,hmr:i,cacheHandlers:l,nodeTransforms:s,directiveTransforms:o,transformHoist:a,isBuiltInComponent:c,isCustomElement:u,expressionPlugins:d,scopeId:p,slotted:h,ssr:m,inSSR:y,ssrCssVars:b,bindingMetadata:_,inline:S,isTS:x,onError:C,onWarn:T,compatConfig:k,root:e,helpers:new Map,components:new Set,directives:new Set,hoists:[],imports:[],cached:[],constantCache:new WeakMap,temps:0,identifiers:Object.create(null),scopes:{vFor:0,vSlot:0,vPre:0,vOnce:0},parent:null,grandParent:null,currentNode:e,childIndex:0,inVOnce:!1,helper(e){let t=N.helpers.get(e)||0;return N.helpers.set(e,t+1),e},removeHelper(e){let t=N.helpers.get(e);if(t){let n=t-1;n?N.helpers.set(e,n):N.helpers.delete(e)}},helperString:e=>`_${o3[N.helper(e)]}`,replaceNode(e){N.parent.children[N.childIndex]=N.currentNode=e},removeNode(e){let t=N.parent.children,n=e?t.indexOf(e):N.currentNode?N.childIndex:-1;e&&e!==N.currentNode?N.childIndex>n&&(N.childIndex--,N.onNodeRemoved()):(N.currentNode=null,N.onNodeRemoved()),N.parent.children.splice(n,1)},onNodeRemoved:g,addIdentifiers(e){},removeIdentifiers(e){},hoist(e){R(e)&&(e=o7(e)),N.hoists.push(e);let t=o7(`_hoisted_${N.hoists.length}`,!1,e.loc,2);return t.hoisted=e,t},cache(e,t=!1,n=!1){let r=function(e,t,n=!1,r=!1){return{type:20,index:e,value:t,needPauseTracking:n,inVOnce:r,needArraySpread:!1,loc:o6}}(N.cached.length,e,t,n);return N.cached.push(r),r}};return N}(l,a);return ca(l,c),a.hoistStatic&&function e(t,n,r,i=!1,l=!1){let{children:s}=t,o=[];for(let n=0;n0){if(e>=2){a.codegenNode.patchFlag=-1,o.push(a);continue}}else{let e=a.codegenNode;if(13===e.type){let t=e.patchFlag;if((void 0===t||512===t||1===t)&&cs(a,r)>=2){let t=co(a);t&&(e.props=r.hoist(t))}e.dynamicProps&&(e.dynamicProps=r.hoist(e.dynamicProps))}}}else if(12===a.type&&(i?0:ci(a,r))>=2){o.push(a);continue}if(1===a.type){let n=1===a.tagType;n&&r.scopes.vSlot++,e(a,t,r,!1,l),n&&r.scopes.vSlot--}else if(11===a.type)e(a,t,r,1===a.children.length,!0);else if(9===a.type)for(let n=0;ne.key===t||e.key.content===t);return n&&n.value}}c.length&&1===t.type&&1===t.tagType&&t.codegenNode&&13===t.codegenNode.type&&t.codegenNode.children&&!k(t.codegenNode.children)&&15===t.codegenNode.children.type&&t.codegenNode.children.properties.push(o9("__",o7(JSON.stringify(c),!1))),o.length&&r.transformHoist&&r.transformHoist(s,r,t)}(l,void 0,c,!!cr(l)),a.ssr||function(e,t){let{helper:n}=t,{children:r}=e;if(1===r.length){let n=cr(e);if(n&&n.codegenNode){let r=n.codegenNode;13===r.type&&ai(r,t),e.codegenNode=r}else e.codegenNode=r[0]}else r.length>1&&(e.codegenNode=o4(t,n(oy),void 0,e.children,64,void 0,void 0,!0,void 0,!1))}(l,c),l.helpers=new Set([...c.helpers.keys()]),l.components=[...c.components],l.directives=[...c.directives],l.imports=c.imports,l.hoists=c.hoists,l.temps=c.temps,l.cached=c.cached,l.transformed=!0,function(e,t={}){let n=function(e,{mode:t="function",prefixIdentifiers:n="module"===t,sourceMap:r=!1,filename:i="template.vue.html",scopeId:l=null,optimizeImports:s=!1,runtimeGlobalName:o="Vue",runtimeModuleName:a="vue",ssrRuntimeModuleName:c="vue/server-renderer",ssr:u=!1,isTS:d=!1,inSSR:p=!1}){let h={mode:t,prefixIdentifiers:n,sourceMap:r,filename:i,scopeId:l,optimizeImports:s,runtimeGlobalName:o,runtimeModuleName:a,ssrRuntimeModuleName:c,ssr:u,isTS:d,inSSR:p,source:e.source,code:"",column:1,line:1,offset:0,indentLevel:0,pure:!1,map:void 0,helper:e=>`_${o3[e]}`,push(e,t=-2,n){h.code+=e},indent(){f(++h.indentLevel)},deindent(e=!1){e?--h.indentLevel:f(--h.indentLevel)},newline(){f(h.indentLevel)}};function f(e){h.push(` +`+" ".repeat(e),0)}return h}(e,t);t.onContextCreated&&t.onContextCreated(n);let{mode:r,push:i,prefixIdentifiers:l,indent:s,deindent:o,newline:a,scopeId:c,ssr:u}=n,d=Array.from(e.helpers),p=d.length>0,h=!l&&"module"!==r;var f=e,m=n;let{ssr:g,prefixIdentifiers:y,push:b,newline:_,runtimeModuleName:S,runtimeGlobalName:x,ssrRuntimeModuleName:C}=m,T=Array.from(f.helpers);if(T.length>0&&(b(`const _Vue = ${x} +`,-1),f.hoists.length)){let e=[ow,oN,oE,oA,oR].filter(e=>T.includes(e)).map(cd).join(", ");b(`const { ${e} } = _Vue +`,-1)}(function(e,t){if(!e.length)return;t.pure=!0;let{push:n,newline:r}=t;r();for(let i=0;i0)&&a()),e.directives.length&&(cp(e.directives,"directive",n),e.temps>0&&a()),e.temps>0){i("let ");for(let t=0;t0?", ":""}_temp${t}`)}return(e.components.length||e.directives.length||e.temps)&&(i(` +`,0),a()),u||i("return "),e.codegenNode?cm(e.codegenNode,n):i("null"),h&&(o(),i("}")),o(),i("}"),{ast:e,code:n.code,preamble:"",map:n.map?n.map.toJSON():void 0}}(l,i)}(e,S({},c2,t,{nodeTransforms:[c9,...c7,...t.nodeTransforms||[]],directiveTransforms:S({},ue,t.directiveTransforms||{}),transformHoist:null}))}(e,i),s=Function("Vue",l)(ov);return s._rc=!0,ut[n]=s}lI(un);export{nD as BaseTransition,nO as BaseTransitionPropsValidators,i2 as Comment,lX as DeprecationTypes,ey as EffectScope,t0 as ErrorCodes,lW as ErrorTypeStrings,i0 as Fragment,rt as KeepAlive,eC as ReactiveEffect,i3 as Static,iJ as Suspense,nk as Teleport,i1 as Text,tK as TrackOpTypes,l5 as Transition,sH as TransitionGroup,tz as TriggerOpTypes,sD as VueElement,tY as assertNumber,t2 as callWithAsyncErrorHandling,t1 as callWithErrorHandling,j as camelize,W as capitalize,ld as cloneVNode,lQ as compatUtils,un as compile,lF as computed,oa as createApp,ln as createBlock,lf as createCommentVNode,lt as createElementBlock,la as createElementVNode,iS as createHydrationRenderer,rQ as createPropsRestProxy,i_ as createRenderer,oc as createSSRApp,rE as createSlots,lh as createStaticVNode,lp as createTextVNode,lc as createVNode,tV as customRef,n9 as defineAsyncComponent,nj as defineComponent,sO as defineCustomElement,rF as defineEmits,rV as defineExpose,rj as defineModel,rB as defineOptions,rL as defineProps,sP as defineSSRCustomElement,rU as defineSlots,lK as devtools,eO as effect,eb as effectScope,lT as getCurrentInstance,e_ as getCurrentScope,tQ as getCurrentWatcher,nU as getTransitionRawChildren,lu as guardReactiveProps,lV as h,t3 as handleError,ii as hasInjectionContext,oo as hydrate,n3 as hydrateOnIdle,n8 as hydrateOnInteraction,n4 as hydrateOnMediaQuery,n6 as hydrateOnVisible,lB as initCustomFormatter,oh as initDirectivesForSSR,ir as inject,lj as isMemoSame,tC as isProxy,t_ as isReactive,tS as isReadonly,tE as isRef,lO as isRuntimeOnly,tx as isShallow,lr as isVNode,tk as markRaw,rJ as mergeDefaults,rG as mergeModels,ly as mergeProps,nt as nextTick,el as normalizeClass,es as normalizeProps,ee as normalizeStyle,rr as onActivated,ru as onBeforeMount,rf as onBeforeUnmount,rp as onBeforeUpdate,ri as onDeactivated,rb as onErrorCaptured,rd as onMounted,ry as onRenderTracked,rv as onRenderTriggered,eS as onScopeDispose,rg as onServerPrefetch,rm as onUnmounted,rh as onUpdated,tX as onWatcherCleanup,i8 as openBlock,np as popScopeId,it as provide,tL as proxyRefs,nd as pushScopeId,ni as queuePostFlushCb,tm as reactive,tv as readonly,tA as ref,lI as registerRuntimeCompiler,os as render,rN as renderList,rA as renderSlot,rS as resolveComponent,rT as resolveDirective,rC as resolveDynamicComponent,lG as resolveFilter,nL as resolveTransitionHooks,i7 as setBlockTracking,lz as setDevtoolsHook,nB as setTransitionHooks,tg as shallowReactive,ty as shallowReadonly,tR as shallowRef,iE as ssrContextKey,lJ as ssrUtils,eP as stop,em as toDisplayString,K as toHandlerKey,rI as toHandlers,tT as toRaw,tH as toRef,tB as toRefs,tD as toValue,ll as transformVNodeArgs,tP as triggerRef,tM as unref,rW as useAttrs,sF as useCssModule,sm as useCssVars,s$ as useHost,nH as useId,iL as useModel,iA as useSSRContext,sL as useShadowRoot,rq as useSlots,nW as useTemplateRef,nR as useTransitionState,sZ as vModelCheckbox,s4 as vModelDynamic,s0 as vModelRadio,s1 as vModelSelect,sX as vModelText,sp as vShow,lH as version,lq as warn,iP as watch,iR as watchEffect,iI as watchPostEffect,iO as watchSyncEffect,rX as withAsyncContext,nf as withCtx,rH as withDefaults,nm as withDirectives,on as withKeys,lU as withMemo,oe as withModifiers,nh as withScopeId}; diff --git a/node_modules/vue/dist/vue.esm-bundler.js b/node_modules/vue/dist/vue.esm-bundler.js index a31373d..3879243 100644 --- a/node_modules/vue/dist/vue.esm-bundler.js +++ b/node_modules/vue/dist/vue.esm-bundler.js @@ -1,5 +1,5 @@ /** -* vue v3.5.13 +* vue v3.5.17 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/ diff --git a/node_modules/vue/dist/vue.global.js b/node_modules/vue/dist/vue.global.js index ba3fbfb..a44287e 100644 --- a/node_modules/vue/dist/vue.global.js +++ b/node_modules/vue/dist/vue.global.js @@ -1,5 +1,5 @@ /** -* vue v3.5.13 +* vue v3.5.17 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/ @@ -129,7 +129,7 @@ var Vue = (function (exports) { [512]: `NEED_PATCH`, [1024]: `DYNAMIC_SLOTS`, [2048]: `DEV_ROOT_FRAGMENT`, - [-1]: `HOISTED`, + [-1]: `CACHED`, [-2]: `BAIL` }; @@ -399,6 +399,10 @@ var Vue = (function (exports) { * @internal */ this._active = true; + /** + * @internal track `on` calls, allow `on` call multiple times + */ + this._on = 0; /** * @internal */ @@ -469,14 +473,20 @@ var Vue = (function (exports) { * @internal */ on() { - activeEffectScope = this; + if (++this._on === 1) { + this.prevScope = activeEffectScope; + activeEffectScope = this; + } } /** * This should only be called on non-detached scopes * @internal */ off() { - activeEffectScope = this.parent; + if (this._on > 0 && --this._on === 0) { + activeEffectScope = this.prevScope; + this.prevScope = void 0; + } } stop(fromParent) { if (this._active) { @@ -558,7 +568,7 @@ var Vue = (function (exports) { } resume() { if (this.flags & 64) { - this.flags &= ~64; + this.flags &= -65; if (pausedQueueEffects.has(this)) { pausedQueueEffects.delete(this); this.trigger(); @@ -598,7 +608,7 @@ var Vue = (function (exports) { cleanupDeps(this); activeSub = prevEffect; shouldTrack = prevShouldTrack; - this.flags &= ~2; + this.flags &= -3; } } stop() { @@ -609,7 +619,7 @@ var Vue = (function (exports) { this.deps = this.depsTail = void 0; cleanupEffect(this); this.onStop && this.onStop(); - this.flags &= ~1; + this.flags &= -2; } } trigger() { @@ -659,7 +669,7 @@ var Vue = (function (exports) { while (e) { const next = e.next; e.next = void 0; - e.flags &= ~8; + e.flags &= -9; e = next; } } @@ -670,7 +680,7 @@ var Vue = (function (exports) { while (e) { const next = e.next; e.next = void 0; - e.flags &= ~8; + e.flags &= -9; if (e.flags & 1) { try { ; @@ -726,17 +736,16 @@ var Vue = (function (exports) { if (computed.flags & 4 && !(computed.flags & 16)) { return; } - computed.flags &= ~16; + computed.flags &= -17; if (computed.globalVersion === globalVersion) { return; } computed.globalVersion = globalVersion; - const dep = computed.dep; - computed.flags |= 2; - if (dep.version > 0 && !computed.isSSR && computed.deps && !isDirty(computed)) { - computed.flags &= ~2; + if (!computed.isSSR && computed.flags & 128 && (!computed.deps && !computed._dirty || !isDirty(computed))) { return; } + computed.flags |= 2; + const dep = computed.dep; const prevSub = activeSub; const prevShouldTrack = shouldTrack; activeSub = computed; @@ -745,6 +754,7 @@ var Vue = (function (exports) { prepareDeps(computed); const value = computed.fn(computed._value); if (dep.version === 0 || hasChanged(value, computed._value)) { + computed.flags |= 128; computed._value = value; dep.version++; } @@ -755,7 +765,7 @@ var Vue = (function (exports) { activeSub = prevSub; shouldTrack = prevShouldTrack; cleanupDeps(computed); - computed.flags &= ~2; + computed.flags &= -3; } } function removeSub(link, soft = false) { @@ -774,7 +784,7 @@ var Vue = (function (exports) { if (dep.subs === link) { dep.subs = prevSub; if (!prevSub && dep.computed) { - dep.computed.flags &= ~4; + dep.computed.flags &= -5; for (let l = dep.computed.deps; l; l = l.nextDep) { removeSub(l, true); } @@ -850,6 +860,7 @@ var Vue = (function (exports) { } } class Dep { + // TODO isolatedDeclarations "__v_skip" constructor(computed) { this.computed = computed; this.version = 0; @@ -870,6 +881,10 @@ var Vue = (function (exports) { * Subscriber counter */ this.sc = 0; + /** + * @internal + */ + this.__v_skip = true; { this.subsHead = void 0; } @@ -1707,14 +1722,14 @@ var Vue = (function (exports) { if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) { return target; } - const existingProxy = proxyMap.get(target); - if (existingProxy) { - return existingProxy; - } const targetType = getTargetType(target); if (targetType === 0 /* INVALID */) { return target; } + const existingProxy = proxyMap.get(target); + if (existingProxy) { + return existingProxy; + } const proxy = new Proxy( target, targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers @@ -2137,11 +2152,11 @@ var Vue = (function (exports) { oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue, boundCleanup ]; + oldValue = newValue; call ? call(cb, 3, args) : ( // @ts-expect-error cb(...args) ); - oldValue = newValue; } finally { activeWatcher = currentWatcher; } @@ -2558,11 +2573,11 @@ var Vue = (function (exports) { queue.splice(i, 1); i--; if (cb.flags & 4) { - cb.flags &= ~1; + cb.flags &= -2; } cb(); if (!(cb.flags & 4)) { - cb.flags &= ~1; + cb.flags &= -2; } } } @@ -2587,10 +2602,10 @@ var Vue = (function (exports) { continue; } if (cb.flags & 4) { - cb.flags &= ~1; + cb.flags &= -2; } if (!(cb.flags & 8)) cb(); - cb.flags &= ~1; + cb.flags &= -2; } activePostFlushCbs = null; postFlushIndex = 0; @@ -2626,7 +2641,7 @@ var Vue = (function (exports) { for (; flushIndex < queue.length; flushIndex++) { const job = queue[flushIndex]; if (job) { - job.flags &= ~1; + job.flags &= -2; } } flushIndex = -1; @@ -3066,15 +3081,16 @@ var Vue = (function (exports) { updateCssVars(n2, true); } if (isTeleportDeferred(n2.props)) { + n2.el.__isMounted = false; queuePostRenderEffect(() => { mountToTarget(); - n2.el.__isMounted = true; + delete n2.el.__isMounted; }, parentSuspense); } else { mountToTarget(); } } else { - if (isTeleportDeferred(n2.props) && !n1.el.__isMounted) { + if (isTeleportDeferred(n2.props) && n1.el.__isMounted === false) { queuePostRenderEffect(() => { TeleportImpl.process( n1, @@ -3088,7 +3104,6 @@ var Vue = (function (exports) { optimized, internals ); - delete n1.el.__isMounted; }, parentSuspense); return; } @@ -3115,7 +3130,7 @@ var Vue = (function (exports) { namespace, slotScopeIds ); - traverseStaticChildren(n1, n2, true); + traverseStaticChildren(n1, n2, false); } else if (!optimized) { patchChildren( n1, @@ -4076,6 +4091,8 @@ var Vue = (function (exports) { ) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear; const content = el.content.firstChild; if (needCallTransitionHooks) { + const cls = content.getAttribute("class"); + if (cls) content.$cls = cls; transition.beforeEnter(content); } replaceNode(content, el, parentComponent); @@ -4328,7 +4345,12 @@ Server rendered element contains fewer child nodes than client vdom.` let actual; let expected; if (key === "class") { - actual = el.getAttribute("class"); + if (el.$cls) { + actual = el.$cls; + delete el.$cls; + } else { + actual = el.getAttribute("class"); + } expected = normalizeClass(clientValue); if (!isSetEqual(toClassSet(actual || ""), toClassSet(expected))) { mismatchType = 2 /* CLASS */; @@ -4466,7 +4488,7 @@ Server rendered element contains fewer child nodes than client vdom.` if (allowedType === 0 /* TEXT */ && list.includes("children")) { return true; } - return allowedAttr.split(",").includes(MismatchTypeString[allowedType]); + return list.includes(MismatchTypeString[allowedType]); } } @@ -4623,14 +4645,25 @@ Server rendered element contains fewer child nodes than client vdom.` name: "AsyncComponentWrapper", __asyncLoader: load, __asyncHydrate(el, instance, hydrate) { + let patched = false; const doHydrate = hydrateStrategy ? () => { + const performHydrate = () => { + if (patched) { + warn$1( + `Skipping lazy hydration for component '${getComponentName(resolvedComp)}': it was updated before lazy hydration performed.` + ); + return; + } + hydrate(); + }; const teardown = hydrateStrategy( - hydrate, + performHydrate, (cb) => forEachElement(el, cb) ); if (teardown) { (instance.bum || (instance.bum = [])).push(teardown); } + (instance.u || (instance.u = [])).push(() => patched = true); } : hydrate; if (resolvedComp) { doHydrate(); @@ -4794,6 +4827,9 @@ Server rendered element contains fewer child nodes than client vdom.` { devtoolsComponentAdded(instance2); } + { + instance2.__keepAliveStorageContainer = storageContainer; + } }; function unmount(vnode) { resetShapeFlag(vnode); @@ -4881,7 +4917,7 @@ Server rendered element contains fewer child nodes than client vdom.` ); const { include, exclude, max } = props; if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) { - vnode.shapeFlag &= ~256; + vnode.shapeFlag &= -257; current = vnode; return rawVNode; } @@ -4968,8 +5004,8 @@ Server rendered element contains fewer child nodes than client vdom.` }, target); } function resetShapeFlag(vnode) { - vnode.shapeFlag &= ~256; - vnode.shapeFlag &= ~512; + vnode.shapeFlag &= -257; + vnode.shapeFlag &= -513; } function getInnerChild(vnode) { return vnode.shapeFlag & 128 ? vnode.ssContent : vnode; @@ -5084,14 +5120,16 @@ If this is a native custom element, make sure to exclude it from component resol if (sourceIsArray || isString(source)) { const sourceIsReactiveArray = sourceIsArray && isReactive(source); let needsWrap = false; + let isReadonlySource = false; if (sourceIsReactiveArray) { needsWrap = !isShallow(source); + isReadonlySource = isReadonly(source); source = shallowReadArray(source); } ret = new Array(source.length); for (let i = 0, l = source.length; i < l; i++) { ret[i] = renderItem( - needsWrap ? toReactive(source[i]) : source[i], + needsWrap ? isReadonlySource ? toReadonly(toReactive(source[i])) : toReactive(source[i]) : source[i], i, void 0, cached && cached[i] @@ -6110,11 +6148,9 @@ If this is a native custom element, make sure to exclude it from component resol } { context.reload = () => { - render( - cloneVNode(vnode), - rootContainer, - namespace - ); + const cloned = cloneVNode(vnode); + cloned.el = null; + render(cloned, rootContainer, namespace); }; } if (isHydrate && hydrate) { @@ -6164,9 +6200,15 @@ If you want to remount the same app, move your app creation logic into a factory }, provide(key, value) { if (key in context.provides) { - warn$1( - `App already provides property with key "${String(key)}". It will be overwritten with the new value.` - ); + if (hasOwn(context.provides, key)) { + warn$1( + `App already provides property with key "${String(key)}". It will be overwritten with the new value.` + ); + } else { + warn$1( + `App already provides property with key "${String(key)}" inherited from its parent element. It will be overwritten with the new value.` + ); + } } context.provides[key] = value; return app; @@ -6203,7 +6245,7 @@ If you want to remount the same app, move your app creation logic into a factory function inject(key, defaultValue, treatDefaultAsFactory = false) { const instance = currentInstance || currentRenderingInstance; if (instance || currentApp) { - const provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0; + let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0; if (provides && key in provides) { return provides[key]; } else if (arguments.length > 1) { @@ -6637,7 +6679,7 @@ If you want to remount the same app, move your app creation logic into a factory return rawSlot; } const normalized = withCtx((...args) => { - if (currentInstance && (!ctx || ctx.root === currentInstance.root)) { + if (currentInstance && !(ctx === null && currentRenderingInstance) && !(ctx && ctx.root !== currentInstance.root)) { warn$1( `Slot "${key}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.` ); @@ -6676,7 +6718,7 @@ If you want to remount the same app, move your app creation logic into a factory }; const assignSlots = (slots, children, optimized) => { for (const key in children) { - if (optimized || key !== "_") { + if (optimized || !isInternalKey(key)) { slots[key] = children[key]; } } @@ -6684,6 +6726,8 @@ If you want to remount the same app, move your app creation logic into a factory const initSlots = (instance, children, optimized) => { const slots = instance.slots = createInternalObject(); if (instance.vnode.shapeFlag & 32) { + const cacheIndexes = children.__; + if (cacheIndexes) def(slots, "__", cacheIndexes, true); const type = children._; if (type) { assignSlots(slots, children, optimized); @@ -6895,6 +6939,8 @@ If you want to remount the same app, move your app creation logic into a factory } if (ref != null && parentComponent) { setRef(ref, n1 && n1.ref, parentSuspense, n2 || n1, !n2); + } else if (ref == null && n1 && n1.ref != null) { + setRef(n1.ref, null, parentSuspense, n1, true); } }; const processText = (n1, n2, container, anchor) => { @@ -7200,7 +7246,7 @@ If you want to remount the same app, move your app creation logic into a factory (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement // which also requires the correct parent container !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything. - oldVNode.shapeFlag & (6 | 64)) ? hostParentNode(oldVNode.el) : ( + oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(oldVNode.el) : ( // In other cases, the parent container is not actually used so we // just pass the block element here to avoid a DOM parentNode call. fallbackContainer @@ -7362,8 +7408,8 @@ If you want to remount the same app, move your app creation logic into a factory endMeasure(instance, `init`); } } + if (isHmrUpdating) initialVNode.el = null; if (instance.asyncDep) { - if (isHmrUpdating) initialVNode.el = null; parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized); if (!initialVNode.el) { const placeholder = instance.subTree = createVNode(Comment); @@ -7454,7 +7500,8 @@ If you want to remount the same app, move your app creation logic into a factory hydrateSubTree(); } } else { - if (root.ce) { + if (root.ce && // @ts-expect-error _def is private + root.ce._def.shadowRoot !== false) { root.ce._injectChildStyle(type); } { @@ -7925,7 +7972,13 @@ If you want to remount the same app, move your app creation logic into a factory queuePostRenderEffect(() => transition.enter(el), parentSuspense); } else { const { leave, delayLeave, afterLeave } = transition; - const remove2 = () => hostInsert(el, container, anchor); + const remove2 = () => { + if (vnode.ctx.isUnmounted) { + hostRemove(el); + } else { + hostInsert(el, container, anchor); + } + }; const performLeave = () => { leave(el, () => { remove2(); @@ -7958,7 +8011,9 @@ If you want to remount the same app, move your app creation logic into a factory optimized = false; } if (ref != null) { + pauseTracking(); setRef(ref, null, parentSuspense, vnode, true); + resetTracking(); } if (cacheIndex != null) { parentComponent.renderCache[cacheIndex] = void 0; @@ -8070,12 +8125,27 @@ If you want to remount the same app, move your app creation logic into a factory if (instance.type.__hmrId) { unregisterHMR(instance); } - const { bum, scope, job, subTree, um, m, a } = instance; + const { + bum, + scope, + job, + subTree, + um, + m, + a, + parent, + slots: { __: slotCacheKeys } + } = instance; invalidateMount(m); invalidateMount(a); if (bum) { invokeArrayFns(bum); } + if (parent && isArray(slotCacheKeys)) { + slotCacheKeys.forEach((v) => { + parent.renderCache[v] = void 0; + }); + } scope.stop(); if (job) { job.flags |= 8; @@ -8171,8 +8241,8 @@ If you want to remount the same app, move your app creation logic into a factory effect.flags |= 32; job.flags |= 4; } else { - effect.flags &= ~32; - job.flags &= ~4; + effect.flags &= -33; + job.flags &= -5; } } function needTransition(parentSuspense, transition) { @@ -8199,6 +8269,9 @@ If you want to remount the same app, move your app creation logic into a factory if (c2.type === Comment && !c2.el) { c2.el = c1.el; } + { + c2.el && (c2.el.__vnode = c2); + } } } } @@ -9516,8 +9589,8 @@ If you want to remount the same app, move your app creation logic into a factory if (n2.shapeFlag & 6 && n1.component) { const dirtyInstances = hmrDirtyComponents.get(n2.type); if (dirtyInstances && dirtyInstances.has(n1.component)) { - n1.shapeFlag &= ~256; - n2.shapeFlag &= ~512; + n1.shapeFlag &= -257; + n2.shapeFlag &= -513; return false; } } @@ -9966,7 +10039,7 @@ Component that was made reactive: `, const { props, children } = instance.vnode; const isStateful = isStatefulComponent(instance); initProps(instance, props, isStateful, isSSR); - initSlots(instance, children, optimized); + initSlots(instance, children, optimized || isSSR); const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0; isSSR && setInSSRSetupState(false); return setupResult; @@ -10295,13 +10368,15 @@ Component that was made reactive: `, if (obj.__isVue) { return ["div", vueStyle, `VueInstance`]; } else if (isRef(obj)) { + pauseTracking(); + const value = obj.value; + resetTracking(); return [ "div", {}, ["span", vueStyle, genRefFlag(obj)], "<", - // avoid debugger accessing value affecting behavior - formatValue("_value" in obj ? obj._value : obj), + formatValue(value), `>` ]; } else if (isReactive(obj)) { @@ -10482,7 +10557,7 @@ Component that was made reactive: `, return true; } - const version = "3.5.13"; + const version = "3.5.17"; const warn = warn$1 ; const ErrorTypeStrings = ErrorTypeStrings$1 ; const devtools = devtools$1 ; @@ -11281,7 +11356,7 @@ Expected function or array of functions, received type ${typeof value}.` } return false; } - if (key === "spellcheck" || key === "draggable" || key === "translate") { + if (key === "spellcheck" || key === "draggable" || key === "translate" || key === "autocorrect") { return false; } if (key === "form") { @@ -11364,13 +11439,10 @@ Expected function or array of functions, received type ${typeof value}.` this._root = this; } } - if (!this._def.__asyncLoader) { - this._resolveProps(this._def); - } } connectedCallback() { if (!this.isConnected) return; - if (!this.shadowRoot) { + if (!this.shadowRoot && !this._resolved) { this._parseSlots(); } this._connected = true; @@ -11383,8 +11455,7 @@ Expected function or array of functions, received type ${typeof value}.` } if (!this._instance) { if (this._resolved) { - this._setParent(); - this._update(); + this._mount(this._def); } else { if (parent && parent._pendingResolve) { this._pendingResolve = parent._pendingResolve.then(() => { @@ -11400,7 +11471,15 @@ Expected function or array of functions, received type ${typeof value}.` _setParent(parent = this._parent) { if (parent) { this._instance.parent = parent._instance; - this._instance.provides = parent._instance.provides; + this._inheritParentContext(parent); + } + } + _inheritParentContext(parent = this._parent) { + if (parent && this._app) { + Object.setPrototypeOf( + this._app._context.provides, + parent._instance.provides + ); } } disconnectedCallback() { @@ -11450,9 +11529,7 @@ Expected function or array of functions, received type ${typeof value}.` } } this._numberProps = numberProps; - if (isAsync) { - this._resolveProps(def); - } + this._resolveProps(def); if (this.shadowRoot) { this._applyStyles(styles); } else if (styles) { @@ -11464,9 +11541,10 @@ Expected function or array of functions, received type ${typeof value}.` }; const asyncDef = this._def.__asyncLoader; if (asyncDef) { - this._pendingResolve = asyncDef().then( - (def) => resolve(this._def = def, true) - ); + this._pendingResolve = asyncDef().then((def) => { + def.configureApp = this._def.configureApp; + resolve(this._def = def, true); + }); } else { resolve(this._def); } @@ -11476,6 +11554,7 @@ Expected function or array of functions, received type ${typeof value}.` def.name = "VueElement"; } this._app = this._createApp(def); + this._inheritParentContext(); if (def.configureApp) { def.configureApp(this._app); } @@ -11560,7 +11639,9 @@ Expected function or array of functions, received type ${typeof value}.` } } _update() { - render(this._createVNode(), this._root); + const vnode = this._createVNode(); + if (this._app) vnode.appContext = this._app._context; + render(vnode, this._root); } _createVNode() { const baseProps = {}; @@ -11758,6 +11839,7 @@ Expected function or array of functions, received type ${typeof value}.` instance.vnode.el, moveClass )) { + prevChildren = []; return; } prevChildren.forEach(callPendingCbs); @@ -11781,6 +11863,7 @@ Expected function or array of functions, received type ${typeof value}.` }; el.addEventListener("transitionend", cb); }); + prevChildren = []; }); return () => { const rawProps = toRaw(props); @@ -13182,7 +13265,7 @@ Make sure to use the production build (*.prod.js) when deploying for production. this.buffer = input; while (this.index < this.buffer.length) { const c = this.buffer.charCodeAt(this.index); - if (c === 10) { + if (c === 10 && this.state !== 33) { this.newlines.push(this.index); } switch (this.state) { @@ -14187,7 +14270,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins return c > 64 && c < 91; } const windowsNewlineRE = /\r\n/g; - function condenseWhitespace(nodes, tag) { + function condenseWhitespace(nodes) { const shouldCondense = currentOptions.whitespace !== "preserve"; let removedWhitespace = false; for (let i = 0; i < nodes.length; i++) { @@ -14351,12 +14434,12 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins context, // Root node is unfortunately non-hoistable due to potential parent // fallthrough attributes. - isSingleElementRoot(root, root.children[0]) + !!getSingleElementRoot(root) ); } - function isSingleElementRoot(root, child) { - const { children } = root; - return children.length === 1 && child.type === 1 && !isSlotOutlet(child); + function getSingleElementRoot(root) { + const children = root.children.filter((x) => x.type !== 3); + return children.length === 1 && children[0].type === 1 && !isSlotOutlet(children[0]) ? children[0] : null; } function walk(node, parent, context, doNotHoistNode = false, inFor = false) { const { children } = node; @@ -14417,6 +14500,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins } } let cachedAsArray = false; + const slotCacheKeys = []; if (toCache.length === children.length && node.type === 1) { if (node.tagType === 0 && node.codegenNode && node.codegenNode.type === 13 && isArray(node.codegenNode.children)) { node.codegenNode.children = getCacheExpression( @@ -14426,6 +14510,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins } else if (node.tagType === 1 && node.codegenNode && node.codegenNode.type === 13 && node.codegenNode.children && !isArray(node.codegenNode.children) && node.codegenNode.children.type === 15) { const slot = getSlotNode(node.codegenNode, "default"); if (slot) { + slotCacheKeys.push(context.cached.length); slot.returns = getCacheExpression( createArrayExpression(slot.returns) ); @@ -14435,6 +14520,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins const slotName = findDir(node, "slot", true); const slot = slotName && slotName.arg && getSlotNode(parent.codegenNode, slotName.arg); if (slot) { + slotCacheKeys.push(context.cached.length); slot.returns = getCacheExpression( createArrayExpression(slot.returns) ); @@ -14444,9 +14530,18 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins } if (!cachedAsArray) { for (const child of toCache) { + slotCacheKeys.push(context.cached.length); child.codegenNode = context.cache(child.codegenNode); } } + if (slotCacheKeys.length && node.type === 1 && node.tagType === 1 && node.codegenNode && node.codegenNode.type === 13 && node.codegenNode.children && !isArray(node.codegenNode.children) && node.codegenNode.children.type === 15) { + node.codegenNode.children.properties.push( + createObjectProperty( + `__`, + createSimpleExpression(JSON.stringify(slotCacheKeys), false) + ) + ); + } function getCacheExpression(value) { const exp = context.cache(value); if (inFor && context.hmr) { @@ -14804,15 +14899,15 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins const { helper } = context; const { children } = root; if (children.length === 1) { - const child = children[0]; - if (isSingleElementRoot(root, child) && child.codegenNode) { - const codegenNode = child.codegenNode; + const singleElementRootChild = getSingleElementRoot(root); + if (singleElementRootChild && singleElementRootChild.codegenNode) { + const codegenNode = singleElementRootChild.codegenNode; if (codegenNode.type === 13) { convertToBlock(codegenNode, context); } root.codegenNode = codegenNode; } else { - root.codegenNode = child; + root.codegenNode = children[0]; } } else if (children.length > 1) { let patchFlag = 64; @@ -16159,7 +16254,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins let prev; while (j--) { prev = children[j]; - if (prev.type !== 3) { + if (prev.type !== 3 && isNonWhitespaceContent(prev)) { break; } } @@ -17091,8 +17186,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins context.onError(createCompilerError(44, exp.loc)); return createTransformProps(); } - const maybeRef = false; - if (!expString.trim() || !isMemberExpression(exp) && !maybeRef) { + if (!expString.trim() || !isMemberExpression(exp) && true) { context.onError( createCompilerError(42, exp.loc) ); @@ -17661,6 +17755,9 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins }; function isValidHTMLNesting(parent, child) { + if (parent === "template") { + return true; + } if (parent in onlyValidChildren) { return onlyValidChildren[parent].has(child); } diff --git a/node_modules/vue/dist/vue.global.prod.js b/node_modules/vue/dist/vue.global.prod.js index b2cd5c3..f5cd839 100644 --- a/node_modules/vue/dist/vue.global.prod.js +++ b/node_modules/vue/dist/vue.global.prod.js @@ -1,9 +1,12 @@ /** -* vue v3.5.13 +* vue v3.5.17 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/var Vue=function(e){"use strict";var t,n;let r,i,l,s,o,a,c,u,d,p,f,h,m;function g(e){let t=Object.create(null);for(let n of e.split(","))t[n]=1;return e=>e in t}let y={},b=[],_=()=>{},S=()=>!1,x=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&(e.charCodeAt(2)>122||97>e.charCodeAt(2)),C=e=>e.startsWith("onUpdate:"),k=Object.assign,T=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},N=Object.prototype.hasOwnProperty,w=(e,t)=>N.call(e,t),A=Array.isArray,E=e=>"[object Map]"===V(e),I=e=>"[object Set]"===V(e),R=e=>"[object Date]"===V(e),O=e=>"[object RegExp]"===V(e),P=e=>"function"==typeof e,M=e=>"string"==typeof e,L=e=>"symbol"==typeof e,$=e=>null!==e&&"object"==typeof e,D=e=>($(e)||P(e))&&P(e.then)&&P(e.catch),F=Object.prototype.toString,V=e=>F.call(e),B=e=>V(e).slice(8,-1),U=e=>"[object Object]"===V(e),j=e=>M(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,H=g(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),q=g("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),W=e=>{let t=Object.create(null);return n=>t[n]||(t[n]=e(n))},K=/-(\w)/g,z=W(e=>e.replace(K,(e,t)=>t?t.toUpperCase():"")),J=/\B([A-Z])/g,G=W(e=>e.replace(J,"-$1").toLowerCase()),X=W(e=>e.charAt(0).toUpperCase()+e.slice(1)),Q=W(e=>e?`on${X(e)}`:""),Z=(e,t)=>!Object.is(e,t),Y=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},et=e=>{let t=parseFloat(e);return isNaN(t)?e:t},en=e=>{let t=M(e)?Number(e):NaN;return isNaN(t)?e:t},er=()=>r||(r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{}),ei=g("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol");function el(e){if(A(e)){let t={};for(let n=0;n{if(e){let n=e.split(eo);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function eu(e){let t="";if(M(e))t=e;else if(A(e))for(let n=0;neg(e,t))}let ev=e=>!!(e&&!0===e.__v_isRef),eb=e=>M(e)?e:null==e?"":A(e)||$(e)&&(e.toString===F||!P(e.toString))?ev(e)?eb(e.value):JSON.stringify(e,e_,2):String(e),e_=(e,t)=>ev(t)?e_(e,t.value):E(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[eS(t,r)+" =>"]=n,e),{})}:I(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>eS(e))}:L(t)?eS(t):!$(t)||A(t)||U(t)?t:String(t),eS=(e,t="")=>{var n;return L(e)?`Symbol(${null!=(n=e.description)?n:t})`:e};class ex{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=i,!e&&i&&(this.index=(i.scopes||(i.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){let e,t;if(this._isPaused=!0,this.scopes)for(e=0,t=this.scopes.length;e0)){if(o){let e=o;for(o=void 0;e;){let t=e.next;e.next=void 0,e.flags&=-9,e=t}}for(;s;){let t=s;for(s=void 0;t;){let n=t.next;if(t.next=void 0,t.flags&=-9,1&t.flags)try{t.trigger()}catch(t){e||(e=t)}t=n}}if(e)throw e}}function eA(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function eE(e){let t;let n=e.depsTail,r=n;for(;r;){let e=r.prevDep;-1===r.version?(r===n&&(n=e),eO(r),function(e){let{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=e}e.deps=t,e.depsTail=n}function eI(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(eR(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function eR(e){if(4&e.flags&&!(16&e.flags)||(e.flags&=-17,e.globalVersion===eF))return;e.globalVersion=eF;let t=e.dep;if(e.flags|=2,t.version>0&&!e.isSSR&&e.deps&&!eI(e)){e.flags&=-3;return}let n=l,r=eP;l=e,eP=!0;try{eA(e);let n=e.fn(e._value);(0===t.version||Z(n,e._value))&&(e._value=n,t.version++)}catch(e){throw t.version++,e}finally{l=n,eP=r,eE(e),e.flags&=-3}}function eO(e,t=!1){let{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)eO(e,!0)}t||--n.sc||!n.map||n.map.delete(n.key)}let eP=!0,eM=[];function eL(){eM.push(eP),eP=!1}function e$(){let e=eM.pop();eP=void 0===e||e}function eD(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let e=l;l=void 0;try{t()}finally{l=e}}}let eF=0;class eV{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class eB{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(e){if(!l||!eP||l===this.computed)return;let t=this.activeLink;if(void 0===t||t.sub!==l)t=this.activeLink=new eV(l,this),l.deps?(t.prevDep=l.depsTail,l.depsTail.nextDep=t,l.depsTail=t):l.deps=l.depsTail=t,function e(t){if(t.dep.sc++,4&t.sub.flags){let n=t.dep.computed;if(n&&!t.dep.subs){n.flags|=20;for(let t=n.deps;t;t=t.nextDep)e(t)}let r=t.dep.subs;r!==t&&(t.prevSub=r,r&&(r.nextSub=t)),t.dep.subs=t}}(t);else if(-1===t.version&&(t.version=this.version,t.nextDep)){let e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=l.depsTail,t.nextDep=void 0,l.depsTail.nextDep=t,l.depsTail=t,l.deps===t&&(l.deps=e)}return t}trigger(e){this.version++,eF++,this.notify(e)}notify(e){eT++;try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{ew()}}}let eU=new WeakMap,ej=Symbol(""),eH=Symbol(""),eq=Symbol("");function eW(e,t,n){if(eP&&l){let t=eU.get(e);t||eU.set(e,t=new Map);let r=t.get(n);r||(t.set(n,r=new eB),r.map=t,r.key=n),r.track()}}function eK(e,t,n,r,i,l){let s=eU.get(e);if(!s){eF++;return}let o=e=>{e&&e.trigger()};if(eT++,"clear"===t)s.forEach(o);else{let i=A(e),l=i&&j(n);if(i&&"length"===n){let e=Number(r);s.forEach((t,n)=>{("length"===n||n===eq||!L(n)&&n>=e)&&o(t)})}else switch((void 0!==n||s.has(void 0))&&o(s.get(n)),l&&o(s.get(eq)),t){case"add":i?l&&o(s.get("length")):(o(s.get(ej)),E(e)&&o(s.get(eH)));break;case"delete":!i&&(o(s.get(ej)),E(e)&&o(s.get(eH)));break;case"set":E(e)&&o(s.get(ej))}}ew()}function ez(e){let t=tx(e);return t===e?t:(eW(t,"iterate",eq),t_(e)?t:t.map(tk))}function eJ(e){return eW(e=tx(e),"iterate",eq),e}let eG={__proto__:null,[Symbol.iterator](){return eX(this,Symbol.iterator,tk)},concat(...e){return ez(this).concat(...e.map(e=>A(e)?ez(e):e))},entries(){return eX(this,"entries",e=>(e[1]=tk(e[1]),e))},every(e,t){return eZ(this,"every",e,t,void 0,arguments)},filter(e,t){return eZ(this,"filter",e,t,e=>e.map(tk),arguments)},find(e,t){return eZ(this,"find",e,t,tk,arguments)},findIndex(e,t){return eZ(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return eZ(this,"findLast",e,t,tk,arguments)},findLastIndex(e,t){return eZ(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return eZ(this,"forEach",e,t,void 0,arguments)},includes(...e){return e0(this,"includes",e)},indexOf(...e){return e0(this,"indexOf",e)},join(e){return ez(this).join(e)},lastIndexOf(...e){return e0(this,"lastIndexOf",e)},map(e,t){return eZ(this,"map",e,t,void 0,arguments)},pop(){return e1(this,"pop")},push(...e){return e1(this,"push",e)},reduce(e,...t){return eY(this,"reduce",e,t)},reduceRight(e,...t){return eY(this,"reduceRight",e,t)},shift(){return e1(this,"shift")},some(e,t){return eZ(this,"some",e,t,void 0,arguments)},splice(...e){return e1(this,"splice",e)},toReversed(){return ez(this).toReversed()},toSorted(e){return ez(this).toSorted(e)},toSpliced(...e){return ez(this).toSpliced(...e)},unshift(...e){return e1(this,"unshift",e)},values(){return eX(this,"values",tk)}};function eX(e,t,n){let r=eJ(e),i=r[t]();return r===e||t_(e)||(i._next=i.next,i.next=()=>{let e=i._next();return e.value&&(e.value=n(e.value)),e}),i}let eQ=Array.prototype;function eZ(e,t,n,r,i,l){let s=eJ(e),o=s!==e&&!t_(e),a=s[t];if(a!==eQ[t]){let t=a.apply(e,l);return o?tk(t):t}let c=n;s!==e&&(o?c=function(t,r){return n.call(this,tk(t),r,e)}:n.length>2&&(c=function(t,r){return n.call(this,t,r,e)}));let u=a.call(s,c,r);return o&&i?i(u):u}function eY(e,t,n,r){let i=eJ(e),l=n;return i!==e&&(t_(e)?n.length>3&&(l=function(t,r,i){return n.call(this,t,r,i,e)}):l=function(t,r,i){return n.call(this,t,tk(r),i,e)}),i[t](l,...r)}function e0(e,t,n){let r=tx(e);eW(r,"iterate",eq);let i=r[t](...n);return(-1===i||!1===i)&&tS(n[0])?(n[0]=tx(n[0]),r[t](...n)):i}function e1(e,t,n=[]){eL(),eT++;let r=tx(e)[t].apply(e,n);return ew(),e$(),r}let e2=g("__proto__,__v_isRef,__isVue"),e3=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>"arguments"!==e&&"caller"!==e).map(e=>Symbol[e]).filter(L));function e6(e){L(e)||(e=String(e));let t=tx(this);return eW(t,"has",e),t.hasOwnProperty(e)}class e4{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if("__v_skip"===t)return e.__v_skip;let r=this._isReadonly,i=this._isShallow;if("__v_isReactive"===t)return!r;if("__v_isReadonly"===t)return r;if("__v_isShallow"===t)return i;if("__v_raw"===t)return n===(r?i?tf:tp:i?td:tu).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;let l=A(e);if(!r){let e;if(l&&(e=eG[t]))return e;if("hasOwnProperty"===t)return e6}let s=Reflect.get(e,t,tN(e)?e:n);return(L(t)?e3.has(t):e2(t))?s:(r||eW(e,"get",t),i)?s:tN(s)?l&&j(t)?s:s.value:$(s)?r?tg(s):th(s):s}}class e8 extends e4{constructor(e=!1){super(!1,e)}set(e,t,n,r){let i=e[t];if(!this._isShallow){let t=tb(i);if(t_(n)||tb(n)||(i=tx(i),n=tx(n)),!A(e)&&tN(i)&&!tN(n))return!t&&(i.value=n,!0)}let l=A(e)&&j(t)?Number(t)e,tr=e=>Reflect.getPrototypeOf(e);function ti(e){return function(...t){return"delete"!==e&&("clear"===e?void 0:this)}}function tl(e,t){let n=function(e,t){let n={get(n){let r=this.__v_raw,i=tx(r),l=tx(n);e||(Z(n,l)&&eW(i,"get",n),eW(i,"get",l));let{has:s}=tr(i),o=t?tn:e?tT:tk;return s.call(i,n)?o(r.get(n)):s.call(i,l)?o(r.get(l)):void(r!==i&&r.get(n))},get size(){let t=this.__v_raw;return e||eW(tx(t),"iterate",ej),Reflect.get(t,"size",t)},has(t){let n=this.__v_raw,r=tx(n),i=tx(t);return e||(Z(t,i)&&eW(r,"has",t),eW(r,"has",i)),t===i?n.has(t):n.has(t)||n.has(i)},forEach(n,r){let i=this,l=i.__v_raw,s=tx(l),o=t?tn:e?tT:tk;return e||eW(s,"iterate",ej),l.forEach((e,t)=>n.call(r,o(e),o(t),i))}};return k(n,e?{add:ti("add"),set:ti("set"),delete:ti("delete"),clear:ti("clear")}:{add(e){t||t_(e)||tb(e)||(e=tx(e));let n=tx(this);return tr(n).has.call(n,e)||(n.add(e),eK(n,"add",e,e)),this},set(e,n){t||t_(n)||tb(n)||(n=tx(n));let r=tx(this),{has:i,get:l}=tr(r),s=i.call(r,e);s||(e=tx(e),s=i.call(r,e));let o=l.call(r,e);return r.set(e,n),s?Z(n,o)&&eK(r,"set",e,n):eK(r,"add",e,n),this},delete(e){let t=tx(this),{has:n,get:r}=tr(t),i=n.call(t,e);i||(e=tx(e),i=n.call(t,e)),r&&r.call(t,e);let l=t.delete(e);return i&&eK(t,"delete",e,void 0),l},clear(){let e=tx(this),t=0!==e.size,n=e.clear();return t&&eK(e,"clear",void 0,void 0),n}}),["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=function(...n){let i=this.__v_raw,l=tx(i),s=E(l),o="entries"===r||r===Symbol.iterator&&s,a=i[r](...n),c=t?tn:e?tT:tk;return e||eW(l,"iterate","keys"===r&&s?eH:ej),{next(){let{value:e,done:t}=a.next();return t?{value:e,done:t}:{value:o?[c(e[0]),c(e[1])]:c(e),done:t}},[Symbol.iterator](){return this}}}}),n}(e,t);return(t,r,i)=>"__v_isReactive"===r?!e:"__v_isReadonly"===r?e:"__v_raw"===r?t:Reflect.get(w(n,r)&&r in t?n:t,r,i)}let ts={get:tl(!1,!1)},to={get:tl(!1,!0)},ta={get:tl(!0,!1)},tc={get:tl(!0,!0)},tu=new WeakMap,td=new WeakMap,tp=new WeakMap,tf=new WeakMap;function th(e){return tb(e)?e:ty(e,!1,e9,ts,tu)}function tm(e){return ty(e,!1,te,to,td)}function tg(e){return ty(e,!0,e7,ta,tp)}function ty(e,t,n,r,i){if(!$(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;let l=i.get(e);if(l)return l;let s=e.__v_skip||!Object.isExtensible(e)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}(B(e));if(0===s)return e;let o=new Proxy(e,2===s?r:n);return i.set(e,o),o}function tv(e){return tb(e)?tv(e.__v_raw):!!(e&&e.__v_isReactive)}function tb(e){return!!(e&&e.__v_isReadonly)}function t_(e){return!!(e&&e.__v_isShallow)}function tS(e){return!!e&&!!e.__v_raw}function tx(e){let t=e&&e.__v_raw;return t?tx(t):e}function tC(e){return!w(e,"__v_skip")&&Object.isExtensible(e)&&ee(e,"__v_skip",!0),e}let tk=e=>$(e)?th(e):e,tT=e=>$(e)?tg(e):e;function tN(e){return!!e&&!0===e.__v_isRef}function tw(e){return tE(e,!1)}function tA(e){return tE(e,!0)}function tE(e,t){return tN(e)?e:new tI(e,t)}class tI{constructor(e,t){this.dep=new eB,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:tx(e),this._value=t?e:tk(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||t_(e)||tb(e);Z(e=n?e:tx(e),t)&&(this._rawValue=e,this._value=n?e:tk(e),this.dep.trigger())}}function tR(e){return tN(e)?e.value:e}let tO={get:(e,t,n)=>"__v_raw"===t?e:tR(Reflect.get(e,t,n)),set:(e,t,n,r)=>{let i=e[t];return tN(i)&&!tN(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function tP(e){return tv(e)?e:new Proxy(e,tO)}class tM{constructor(e){this.__v_isRef=!0,this._value=void 0;let t=this.dep=new eB,{get:n,set:r}=e(t.track.bind(t),t.trigger.bind(t));this._get=n,this._set=r}get value(){return this._value=this._get()}set value(e){this._set(e)}}function tL(e){return new tM(e)}class t${constructor(e,t,n){this._object=e,this._key=t,this._defaultValue=n,this.__v_isRef=!0,this._value=void 0}get value(){let e=this._object[this._key];return this._value=void 0===e?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return function(e,t){let n=eU.get(e);return n&&n.get(t)}(tx(this._object),this._key)}}class tD{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function tF(e,t,n){let r=e[t];return tN(r)?r:new t$(e,t,n)}class tV{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new eB(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=eF-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(8&this.flags)&&l!==this)return eN(this,!0),!0}get value(){let e=this.dep.track();return eR(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}let tB={},tU=new WeakMap;function tj(e,t=!1,n=h){if(n){let t=tU.get(n);t||tU.set(n,t=[]),t.push(e)}}function tH(e,t=1/0,n){if(t<=0||!$(e)||e.__v_skip||(n=n||new Set).has(e))return e;if(n.add(e),t--,tN(e))tH(e.value,t,n);else if(A(e))for(let r=0;r{tH(e,t,n)});else if(U(e)){for(let r in e)tH(e[r],t,n);for(let r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&tH(e[r],t,n)}return e}function tq(e,t,n,r){try{return r?e(...r):e()}catch(e){tK(e,t,n)}}function tW(e,t,n,r){if(P(e)){let i=tq(e,t,n,r);return i&&D(i)&&i.catch(e=>{tK(e,t,n)}),i}if(A(e)){let i=[];for(let l=0;l=t8(n)?tz.push(e):tz.splice(function(e){let t=tJ+1,n=tz.length;for(;t>>1,i=tz[r],l=t8(i);lt8(e)-t8(t));if(tG.length=0,tX){tX.push(...e);return}for(tQ=0,tX=e;tQnull==e.id?2&e.flags?-1:1/0:e.id,t5=null,t9=null;function t7(e){let t=t5;return t5=e,t9=e&&e.type.__scopeId||null,t}function ne(e,t=t5,n){if(!t||e._n)return e;let r=(...n)=>{let i;r._d&&im(-1);let l=t7(t);try{i=e(...n)}finally{t7(l),r._d&&im(1)}return i};return r._n=!0,r._c=!0,r._d=!0,r}function nt(e,t,n,r){let i=e.dirs,l=t&&t.dirs;for(let s=0;se.__isTeleport,ni=e=>e&&(e.disabled||""===e.disabled),nl=e=>e&&(e.defer||""===e.defer),ns=e=>"undefined"!=typeof SVGElement&&e instanceof SVGElement,no=e=>"function"==typeof MathMLElement&&e instanceof MathMLElement,na=(e,t)=>{let n=e&&e.to;return M(n)?t?t(n):null:n},nc={name:"Teleport",__isTeleport:!0,process(e,t,n,r,i,l,s,o,a,c){let{mc:u,pc:d,pbc:p,o:{insert:f,querySelector:h,createText:m,createComment:g}}=c,y=ni(t.props),{shapeFlag:b,children:_,dynamicChildren:S}=t;if(null==e){let e=t.el=m(""),c=t.anchor=m("");f(e,n,r),f(c,n,r);let d=(e,t)=>{16&b&&(i&&i.isCE&&(i.ce._teleportTarget=e),u(_,e,t,i,l,s,o,a))},p=()=>{let e=t.target=na(t.props,h),n=np(e,t,m,f);e&&("svg"!==s&&ns(e)?s="svg":"mathml"!==s&&no(e)&&(s="mathml"),y||(d(e,n),nd(t,!1)))};y&&(d(n,c),nd(t,!0)),nl(t.props)?rB(()=>{p(),t.el.__isMounted=!0},l):p()}else{if(nl(t.props)&&!e.el.__isMounted){rB(()=>{nc.process(e,t,n,r,i,l,s,o,a,c),delete e.el.__isMounted},l);return}t.el=e.el,t.targetStart=e.targetStart;let u=t.anchor=e.anchor,f=t.target=e.target,m=t.targetAnchor=e.targetAnchor,g=ni(e.props),b=g?n:f;if("svg"===s||ns(f)?s="svg":("mathml"===s||no(f))&&(s="mathml"),S?(p(e.dynamicChildren,S,b,i,l,s,o),rK(e,t,!0)):a||d(e,t,b,g?u:m,i,l,s,o,!1),y)g?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):nu(t,n,u,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){let e=t.target=na(t.props,h);e&&nu(t,e,null,c,0)}else g&&nu(t,f,m,c,1);nd(t,y)}},remove(e,t,n,{um:r,o:{remove:i}},l){let{shapeFlag:s,children:o,anchor:a,targetStart:c,targetAnchor:u,target:d,props:p}=e;if(d&&(i(c),i(u)),l&&i(a),16&s){let e=l||!ni(p);for(let i=0;i{e.isMounted=!0}),n3(()=>{e.isUnmounting=!0}),e}let ng=[Function,Array],ny={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:ng,onEnter:ng,onAfterEnter:ng,onEnterCancelled:ng,onBeforeLeave:ng,onLeave:ng,onAfterLeave:ng,onLeaveCancelled:ng,onBeforeAppear:ng,onAppear:ng,onAfterAppear:ng,onAppearCancelled:ng},nv=e=>{let t=e.subTree;return t.component?nv(t.component):t};function nb(e){let t=e[0];if(e.length>1){for(let n of e)if(n.type!==io){t=n;break}}return t}let n_={name:"BaseTransition",props:ny,setup(e,{slots:t}){let n=iL(),r=nm();return()=>{let i=t.default&&nN(t.default(),!0);if(!i||!i.length)return;let l=nb(i),s=tx(e),{mode:o}=s;if(r.isLeaving)return nC(l);let a=nk(l);if(!a)return nC(l);let c=nx(a,s,r,n,e=>c=e);a.type!==io&&nT(a,c);let u=n.subTree&&nk(n.subTree);if(u&&u.type!==io&&!ib(a,u)&&nv(n).type!==io){let e=nx(u,s,r,n);if(nT(u,e),"out-in"===o&&a.type!==io)return r.isLeaving=!0,e.afterLeave=()=>{r.isLeaving=!1,8&n.job.flags||n.update(),delete e.afterLeave,u=void 0},nC(l);"in-out"===o&&a.type!==io?e.delayLeave=(e,t,n)=>{nS(r,u)[String(u.key)]=u,e[nf]=()=>{t(),e[nf]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{n(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return l}}};function nS(e,t){let{leavingVNodes:n}=e,r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function nx(e,t,n,r,i){let{appear:l,mode:s,persisted:o=!1,onBeforeEnter:a,onEnter:c,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:p,onLeave:f,onAfterLeave:h,onLeaveCancelled:m,onBeforeAppear:g,onAppear:y,onAfterAppear:b,onAppearCancelled:_}=t,S=String(e.key),x=nS(n,e),C=(e,t)=>{e&&tW(e,r,9,t)},k=(e,t)=>{let n=t[1];C(e,t),A(e)?e.every(e=>e.length<=1)&&n():e.length<=1&&n()},T={mode:s,persisted:o,beforeEnter(t){let r=a;if(!n.isMounted){if(!l)return;r=g||a}t[nf]&&t[nf](!0);let i=x[S];i&&ib(e,i)&&i.el[nf]&&i.el[nf](),C(r,[t])},enter(e){let t=c,r=u,i=d;if(!n.isMounted){if(!l)return;t=y||c,r=b||u,i=_||d}let s=!1,o=e[nh]=t=>{s||(s=!0,t?C(i,[e]):C(r,[e]),T.delayedLeave&&T.delayedLeave(),e[nh]=void 0)};t?k(t,[e,o]):o()},leave(t,r){let i=String(e.key);if(t[nh]&&t[nh](!0),n.isUnmounting)return r();C(p,[t]);let l=!1,s=t[nf]=n=>{l||(l=!0,r(),n?C(m,[t]):C(h,[t]),t[nf]=void 0,x[i]!==e||delete x[i])};x[i]=e,f?k(f,[t,s]):s()},clone(e){let l=nx(e,t,n,r,i);return i&&i(l),l}};return T}function nC(e){if(nq(e))return(e=iT(e)).children=null,e}function nk(e){if(!nq(e))return nr(e.type)&&e.children?nb(e.children):e;let{shapeFlag:t,children:n}=e;if(n){if(16&t)return n[0];if(32&t&&P(n.default))return n.default()}}function nT(e,t){6&e.shapeFlag&&e.component?(e.transition=t,nT(e.component.subTree,t)):128&e.shapeFlag?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function nN(e,t=!1,n){let r=[],i=0;for(let l=0;l1)for(let e=0;enE(e,t&&(A(t)?t[l]:t),n,r,i));return}if(nj(r)&&!i){512&r.shapeFlag&&r.type.__asyncResolved&&r.component.subTree.component&&nE(e,t,n,r.component.subTree);return}let l=4&r.shapeFlag?iW(r.component):r.el,s=i?null:l,{i:o,r:a}=e,c=t&&t.r,u=o.refs===y?o.refs={}:o.refs,d=o.setupState,p=tx(d),f=d===y?()=>!1:e=>w(p,e);if(null!=c&&c!==a&&(M(c)?(u[c]=null,f(c)&&(d[c]=null)):tN(c)&&(c.value=null)),P(a))tq(a,o,12,[s,u]);else{let t=M(a),r=tN(a);if(t||r){let o=()=>{if(e.f){let n=t?f(a)?d[a]:u[a]:a.value;i?A(n)&&T(n,l):A(n)?n.includes(l)||n.push(l):t?(u[a]=[l],f(a)&&(d[a]=u[a])):(a.value=[l],e.k&&(u[e.k]=a.value))}else t?(u[a]=s,f(a)&&(d[a]=s)):r&&(a.value=s,e.k&&(u[e.k]=s))};s?(o.id=-1,rB(o,n)):o()}}}let nI=!1,nR=()=>{nI||(console.error("Hydration completed but contains mismatches."),nI=!0)},nO=e=>e.namespaceURI.includes("svg")&&"foreignObject"!==e.tagName,nP=e=>e.namespaceURI.includes("MathML"),nM=e=>{if(1===e.nodeType){if(nO(e))return"svg";if(nP(e))return"mathml"}},nL=e=>8===e.nodeType;function n$(e){let{mt:t,p:n,o:{patchProp:r,createText:i,nextSibling:l,parentNode:s,remove:o,insert:a,createComment:c}}=e,u=(n,r,o,c,b,_=!1)=>{_=_||!!r.dynamicChildren;let S=nL(n)&&"["===n.data,x=()=>h(n,r,o,c,b,S),{type:C,ref:k,shapeFlag:T,patchFlag:N}=r,w=n.nodeType;r.el=n,-2===N&&(_=!1,r.dynamicChildren=null);let A=null;switch(C){case is:3!==w?""===r.children?(a(r.el=i(""),s(n),n),A=n):A=x():(n.data!==r.children&&(nR(),n.data=r.children),A=l(n));break;case io:y(n)?(A=l(n),g(r.el=n.content.firstChild,n,o)):A=8!==w||S?x():l(n);break;case ia:if(S&&(w=(n=l(n)).nodeType),1===w||3===w){A=n;let e=!r.children.length;for(let t=0;t{s=s||!!t.dynamicChildren;let{type:a,props:c,patchFlag:u,shapeFlag:d,dirs:f,transition:h}=t,m="input"===a||"option"===a;if(m||-1!==u){let a;f&&nt(t,null,n,"created");let b=!1;if(y(e)){b=rW(null,h)&&n&&n.vnode.props&&n.vnode.props.appear;let r=e.content.firstChild;b&&h.beforeEnter(r),g(r,e,n),t.el=e=r}if(16&d&&!(c&&(c.innerHTML||c.textContent))){let r=p(e.firstChild,t,e,n,i,l,s);for(;r;){nV(e,1)||nR();let t=r;r=r.nextSibling,o(t)}}else if(8&d){let n=t.children;"\n"===n[0]&&("PRE"===e.tagName||"TEXTAREA"===e.tagName)&&(n=n.slice(1)),e.textContent!==n&&(nV(e,0)||nR(),e.textContent=t.children)}if(c){if(m||!s||48&u){let t=e.tagName.includes("-");for(let i in c)(m&&(i.endsWith("value")||"indeterminate"===i)||x(i)&&!H(i)||"."===i[0]||t)&&r(e,i,null,c[i],void 0,n)}else if(c.onClick)r(e,"onClick",null,c.onClick,void 0,n);else if(4&u&&tv(c.style))for(let e in c.style)c.style[e]}(a=c&&c.onVnodeBeforeMount)&&iR(a,n,t),f&&nt(t,null,n,"beforeMount"),((a=c&&c.onVnodeMounted)||f||b)&&ir(()=>{a&&iR(a,n,t),b&&h.enter(e),f&&nt(t,null,n,"mounted")},i)}return e.nextSibling},p=(e,t,r,s,o,c,d)=>{d=d||!!t.dynamicChildren;let p=t.children,f=p.length;for(let t=0;t{let{slotScopeIds:u}=t;u&&(i=i?i.concat(u):u);let d=s(e),f=p(l(e),t,d,n,r,i,o);return f&&nL(f)&&"]"===f.data?l(t.anchor=f):(nR(),a(t.anchor=c("]"),d,f),f)},h=(e,t,r,i,a,c)=>{if(nV(e.parentElement,1)||nR(),t.el=null,c){let t=m(e);for(;;){let n=l(e);if(n&&n!==t)o(n);else break}}let u=l(e),d=s(e);return o(e),n(null,t,d,u,r,i,nM(d),a),r&&(r.vnode.el=t.el,r8(r,t.el)),u},m=(e,t="[",n="]")=>{let r=0;for(;e;)if((e=l(e))&&nL(e)&&(e.data===t&&r++,e.data===n)){if(0===r)return l(e);r--}return e},g=(e,t,n)=>{let r=t.parentNode;r&&r.replaceChild(e,t);let i=n;for(;i;)i.vnode.el===t&&(i.vnode.el=i.subTree.el=e),i=i.parent},y=e=>1===e.nodeType&&"TEMPLATE"===e.tagName;return[(e,t)=>{if(!t.hasChildNodes()){n(null,e,t),t4(),t._vnode=e;return}u(t.firstChild,e,null,null,null),t4(),t._vnode=e},u]}let nD="data-allow-mismatch",nF={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function nV(e,t){if(0===t||1===t)for(;e&&!e.hasAttribute(nD);)e=e.parentElement;let n=e&&e.getAttribute(nD);if(null==n)return!1;if(""===n)return!0;{let e=n.split(",");return!!(0===t&&e.includes("children"))||n.split(",").includes(nF[t])}}let nB=er().requestIdleCallback||(e=>setTimeout(e,1)),nU=er().cancelIdleCallback||(e=>clearTimeout(e)),nj=e=>!!e.type.__asyncLoader;function nH(e,t){let{ref:n,props:r,children:i,ce:l}=t.vnode,s=iC(e,r,i);return s.ref=n,s.ce=l,delete t.vnode.ce,s}let nq=e=>e.type.__isKeepAlive;function nW(e,t){return A(e)?e.some(e=>nW(e,t)):M(e)?e.split(",").includes(t):!!O(e)&&(e.lastIndex=0,e.test(t))}function nK(e,t){nJ(e,"a",t)}function nz(e,t){nJ(e,"da",t)}function nJ(e,t,n=iM){let r=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()});if(nQ(t,r,n),n){let e=n.parent;for(;e&&e.parent;)nq(e.parent.vnode)&&function(e,t,n,r){let i=nQ(t,e,r,!0);n6(()=>{T(r[t],i)},n)}(r,t,n,e),e=e.parent}}function nG(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function nX(e){return 128&e.shapeFlag?e.ssContent:e}function nQ(e,t,n=iM,r=!1){if(n){let i=n[e]||(n[e]=[]),l=t.__weh||(t.__weh=(...r)=>{eL();let i=i$(n),l=tW(t,n,e,r);return i(),e$(),l});return r?i.unshift(l):i.push(l),l}}let nZ=e=>(t,n=iM)=>{iV&&"sp"!==e||nQ(e,(...e)=>t(...e),n)},nY=nZ("bm"),n0=nZ("m"),n1=nZ("bu"),n2=nZ("u"),n3=nZ("bum"),n6=nZ("um"),n4=nZ("sp"),n8=nZ("rtg"),n5=nZ("rtc");function n9(e,t=iM){nQ("ec",e,t)}let n7="components",re=Symbol.for("v-ndc");function rt(e,t,n=!0,r=!1){let i=t5||iM;if(i){let n=i.type;if(e===n7){let e=iK(n,!1);if(e&&(e===t||e===z(t)||e===X(z(t))))return n}let l=rn(i[e]||n[e],t)||rn(i.appContext[e],t);return!l&&r?n:l}}function rn(e,t){return e&&(e[t]||e[z(t)]||e[X(z(t))])}let rr=e=>e?iF(e)?iW(e):rr(e.parent):null,ri=k(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>rr(e.parent),$root:e=>rr(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>rp(e),$forceUpdate:e=>e.f||(e.f=()=>{t1(e.update)}),$nextTick:e=>e.n||(e.n=t0.bind(e.proxy)),$watch:e=>rQ.bind(e)}),rl=(e,t)=>e!==y&&!e.__isScriptSetup&&w(e,t),rs={get({_:e},t){let n,r,i;if("__v_skip"===t)return!0;let{ctx:l,setupState:s,data:o,props:a,accessCache:c,type:u,appContext:d}=e;if("$"!==t[0]){let r=c[t];if(void 0!==r)switch(r){case 1:return s[t];case 2:return o[t];case 4:return l[t];case 3:return a[t]}else{if(rl(s,t))return c[t]=1,s[t];if(o!==y&&w(o,t))return c[t]=2,o[t];if((n=e.propsOptions[0])&&w(n,t))return c[t]=3,a[t];if(l!==y&&w(l,t))return c[t]=4,l[t];ru&&(c[t]=0)}}let p=ri[t];return p?("$attrs"===t&&eW(e.attrs,"get",""),p(e)):(r=u.__cssModules)&&(r=r[t])?r:l!==y&&w(l,t)?(c[t]=4,l[t]):w(i=d.config.globalProperties,t)?i[t]:void 0},set({_:e},t,n){let{data:r,setupState:i,ctx:l}=e;return rl(i,t)?(i[t]=n,!0):r!==y&&w(r,t)?(r[t]=n,!0):!w(e.props,t)&&!("$"===t[0]&&t.slice(1)in e)&&(l[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:i,propsOptions:l}},s){let o;return!!n[s]||e!==y&&w(e,s)||rl(t,s)||(o=l[0])&&w(o,s)||w(r,s)||w(ri,s)||w(i.config.globalProperties,s)},defineProperty(e,t,n){return null!=n.get?e._.accessCache[t]=0:w(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},ro=k({},rs,{get(e,t){if(t!==Symbol.unscopables)return rs.get(e,t,e)},has:(e,t)=>"_"!==t[0]&&!ei(t)});function ra(){let e=iL();return e.setupContext||(e.setupContext=iq(e))}function rc(e){return A(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}let ru=!0;function rd(e,t,n){tW(A(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function rp(e){let t;let n=e.type,{mixins:r,extends:i}=n,{mixins:l,optionsCache:s,config:{optionMergeStrategies:o}}=e.appContext,a=s.get(n);return a?t=a:l.length||r||i?(t={},l.length&&l.forEach(e=>rf(t,e,o,!0)),rf(t,n,o)):t=n,$(n)&&s.set(n,t),t}function rf(e,t,n,r=!1){let{mixins:i,extends:l}=t;for(let s in l&&rf(e,l,n,!0),i&&i.forEach(t=>rf(e,t,n,!0)),t)if(r&&"expose"===s);else{let r=rh[s]||n&&n[s];e[s]=r?r(e[s],t[s]):t[s]}return e}let rh={data:rm,props:rb,emits:rb,methods:rv,computed:rv,beforeCreate:ry,created:ry,beforeMount:ry,mounted:ry,beforeUpdate:ry,updated:ry,beforeDestroy:ry,beforeUnmount:ry,destroyed:ry,unmounted:ry,activated:ry,deactivated:ry,errorCaptured:ry,serverPrefetch:ry,components:rv,directives:rv,watch:function(e,t){if(!e)return t;if(!t)return e;let n=k(Object.create(null),e);for(let r in t)n[r]=ry(e[r],t[r]);return n},provide:rm,inject:function(e,t){return rv(rg(e),rg(t))}};function rm(e,t){return t?e?function(){return k(P(e)?e.call(this,this):e,P(t)?t.call(this,this):t)}:t:e}function rg(e){if(A(e)){let t={};for(let n=0;n1)return n&&P(t)?t.call(r&&r.proxy):t}}let rT={},rN=()=>Object.create(rT),rw=e=>Object.getPrototypeOf(e)===rT;function rA(e,t,n,r){let i;let[l,s]=e.propsOptions,o=!1;if(t)for(let a in t){let c;if(H(a))continue;let u=t[a];l&&w(l,c=z(a))?s&&s.includes(c)?(i||(i={}))[c]=u:n[c]=u:r1(e.emitsOptions,a)||a in r&&u===r[a]||(r[a]=u,o=!0)}if(s){let t=tx(n),r=i||y;for(let i=0;i"_"===e[0]||"$stable"===e,rP=e=>A(e)?e.map(iw):[iw(e)],rM=(e,t,n)=>{if(t._n)return t;let r=ne((...e)=>rP(t(...e)),n);return r._c=!1,r},rL=(e,t,n)=>{let r=e._ctx;for(let n in e){if(rO(n))continue;let i=e[n];if(P(i))t[n]=rM(n,i,r);else if(null!=i){let e=rP(i);t[n]=()=>e}}},r$=(e,t)=>{let n=rP(t);e.slots.default=()=>n},rD=(e,t,n)=>{for(let r in t)(n||"_"!==r)&&(e[r]=t[r])},rF=(e,t,n)=>{let r=e.slots=rN();if(32&e.vnode.shapeFlag){let e=t._;e?(rD(r,t,n),n&&ee(r,"_",e,!0)):rL(t,r)}else t&&r$(e,t)},rV=(e,t,n)=>{let{vnode:r,slots:i}=e,l=!0,s=y;if(32&r.shapeFlag){let e=t._;e?n&&1===e?l=!1:rD(i,t,n):(l=!t.$stable,rL(t,i)),s=t}else t&&(r$(e,t),s={default:1});if(l)for(let e in i)rO(e)||null!=s[e]||delete i[e]},rB=ir;function rU(e){return rj(e,n$)}function rj(e,t){var n;let r,i;er().__VUE__=!0;let{insert:l,remove:s,patchProp:o,createElement:a,createText:u,createComment:d,setText:p,setElementText:f,parentNode:h,nextSibling:m,setScopeId:g=_,insertStaticContent:S}=e,x=(e,t,n,r=null,i=null,l=null,s,o=null,a=!!t.dynamicChildren)=>{if(e===t)return;e&&!ib(e,t)&&(r=eo(e),et(e,i,l,!0),e=null),-2===t.patchFlag&&(a=!1,t.dynamicChildren=null);let{type:c,ref:u,shapeFlag:d}=t;switch(c){case is:C(e,t,n,r);break;case io:T(e,t,n,r);break;case ia:null==e&&N(t,n,r,s);break;case il:U(e,t,n,r,i,l,s,o,a);break;default:1&d?R(e,t,n,r,i,l,s,o,a):6&d?j(e,t,n,r,i,l,s,o,a):64&d?c.process(e,t,n,r,i,l,s,o,a,eu):128&d&&c.process(e,t,n,r,i,l,s,o,a,eu)}null!=u&&i&&nE(u,e&&e.ref,l,t||e,!t)},C=(e,t,n,r)=>{if(null==e)l(t.el=u(t.children),n,r);else{let n=t.el=e.el;t.children!==e.children&&p(n,t.children)}},T=(e,t,n,r)=>{null==e?l(t.el=d(t.children||""),n,r):t.el=e.el},N=(e,t,n,r)=>{[e.el,e.anchor]=S(e.children,t,n,r,e.el,e.anchor)},E=({el:e,anchor:t},n,r)=>{let i;for(;e&&e!==t;)i=m(e),l(e,n,r),e=i;l(t,n,r)},I=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=m(e),s(e),e=n;s(t)},R=(e,t,n,r,i,l,s,o,a)=>{"svg"===t.type?s="svg":"math"===t.type&&(s="mathml"),null==e?O(t,n,r,i,l,s,o,a):F(e,t,i,l,s,o,a)},O=(e,t,n,r,i,s,c,u)=>{let d,p;let{props:h,shapeFlag:m,transition:g,dirs:y}=e;if(d=e.el=a(e.type,s,h&&h.is,h),8&m?f(d,e.children):16&m&&L(e.children,d,null,r,i,rH(e,s),c,u),y&&nt(e,null,r,"created"),M(d,e,e.scopeId,c,r),h){for(let e in h)"value"===e||H(e)||o(d,e,null,h[e],s,r);"value"in h&&o(d,"value",null,h.value,s),(p=h.onVnodeBeforeMount)&&iR(p,r,e)}y&&nt(e,null,r,"beforeMount");let b=rW(i,g);b&&g.beforeEnter(d),l(d,t,n),((p=h&&h.onVnodeMounted)||b||y)&&rB(()=>{p&&iR(p,r,e),b&&g.enter(d),y&&nt(e,null,r,"mounted")},i)},M=(e,t,n,r,i)=>{if(n&&g(e,n),r)for(let t=0;t{for(let c=a;c{let a;let c=t.el=e.el,{patchFlag:u,dynamicChildren:d,dirs:p}=t;u|=16&e.patchFlag;let h=e.props||y,m=t.props||y;if(n&&rq(n,!1),(a=m.onVnodeBeforeUpdate)&&iR(a,n,t,e),p&&nt(t,e,n,"beforeUpdate"),n&&rq(n,!0),(h.innerHTML&&null==m.innerHTML||h.textContent&&null==m.textContent)&&f(c,""),d?V(e.dynamicChildren,d,c,n,r,rH(t,i),l):s||X(e,t,c,null,n,r,rH(t,i),l,!1),u>0){if(16&u)B(c,h,m,n,i);else if(2&u&&h.class!==m.class&&o(c,"class",null,m.class,i),4&u&&o(c,"style",h.style,m.style,i),8&u){let e=t.dynamicProps;for(let t=0;t{a&&iR(a,n,t,e),p&&nt(t,e,n,"updated")},r)},V=(e,t,n,r,i,l,s)=>{for(let o=0;o{if(t!==n){if(t!==y)for(let l in t)H(l)||l in n||o(e,l,t[l],null,i,r);for(let l in n){if(H(l))continue;let s=n[l],a=t[l];s!==a&&"value"!==l&&o(e,l,a,s,i,r)}"value"in n&&o(e,"value",t.value,n.value,i)}},U=(e,t,n,r,i,s,o,a,c)=>{let d=t.el=e?e.el:u(""),p=t.anchor=e?e.anchor:u(""),{patchFlag:f,dynamicChildren:h,slotScopeIds:m}=t;m&&(a=a?a.concat(m):m),null==e?(l(d,n,r),l(p,n,r),L(t.children||[],n,p,i,s,o,a,c)):f>0&&64&f&&h&&e.dynamicChildren?(V(e.dynamicChildren,h,n,i,s,o,a),(null!=t.key||i&&t===i.subTree)&&rK(e,t,!0)):X(e,t,n,p,i,s,o,a,c)},j=(e,t,n,r,i,l,s,o,a)=>{t.slotScopeIds=o,null==e?512&t.shapeFlag?i.ctx.activate(t,n,r,s,a):q(t,n,r,i,l,s,a):W(e,t,a)},q=(e,t,n,r,i,l,s)=>{let o=e.component=function(e,t,n){let r=e.type,i=(t?t.appContext:e.appContext)||iO,l={uid:iP++,vnode:e,type:r,parent:t,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new ex(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(i.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:function e(t,n,r=!1){let i=r?rI:n.propsCache,l=i.get(t);if(l)return l;let s=t.props,o={},a=[],c=!1;if(!P(t)){let i=t=>{c=!0;let[r,i]=e(t,n,!0);k(o,r),i&&a.push(...i)};!r&&n.mixins.length&&n.mixins.forEach(i),t.extends&&i(t.extends),t.mixins&&t.mixins.forEach(i)}if(!s&&!c)return $(t)&&i.set(t,b),b;if(A(s))for(let e=0;e{let r=e(t,n,!0);r&&(a=!0,k(o,r))};!r&&n.mixins.length&&n.mixins.forEach(i),t.extends&&i(t.extends),t.mixins&&t.mixins.forEach(i)}return s||a?(A(s)?s.forEach(e=>o[e]=null):k(o,s),$(t)&&i.set(t,o),o):($(t)&&i.set(t,null),null)}(r,i),emit:null,emitted:null,propsDefaults:y,inheritAttrs:r.inheritAttrs,ctx:y,data:y,props:y,attrs:y,slots:y,refs:y,setupState:y,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return l.ctx={_:l},l.root=t?t.root:l,l.emit=r0.bind(null,l),e.ce&&e.ce(l),l}(e,r,i);nq(e)&&(o.ctx.renderer=eu),function(e,t=!1,n=!1){t&&c(t);let{props:r,children:i}=e.vnode,l=iF(e);(function(e,t,n,r=!1){let i={},l=rN();for(let n in e.propsDefaults=Object.create(null),rA(e,t,i,l),e.propsOptions[0])n in i||(i[n]=void 0);n?e.props=r?i:tm(i):e.type.props?e.props=i:e.props=l,e.attrs=l})(e,r,l,t),rF(e,i,n),l&&function(e,t){let n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,rs);let{setup:r}=n;if(r){eL();let n=e.setupContext=r.length>1?iq(e):null,i=i$(e),l=tq(r,e,0,[e.props,n]),s=D(l);if(e$(),i(),(s||e.sp)&&!nj(e)&&nA(e),s){if(l.then(iD,iD),t)return l.then(n=>{iB(e,n,t)}).catch(t=>{tK(t,e,0)});e.asyncDep=l}else iB(e,l,t)}else ij(e,t)}(e,t),t&&c(!1)}(o,!1,s),o.asyncDep?(i&&i.registerDep(o,K,s),e.el||T(null,o.subTree=iC(io),t,n)):K(o,e,t,n,i,l,s)},W=(e,t,n)=>{let r=t.component=e.component;if(function(e,t,n){let{props:r,children:i,component:l}=e,{props:s,children:o,patchFlag:a}=t,c=l.emitsOptions;if(t.dirs||t.transition)return!0;if(!n||!(a>=0))return(!!i||!!o)&&(!o||!o.$stable)||r!==s&&(r?!s||r4(r,s,c):!!s);if(1024&a)return!0;if(16&a)return r?r4(r,s,c):!!s;if(8&a){let e=t.dynamicProps;for(let t=0;t{let a=()=>{if(e.isMounted){let t,{next:n,bu:r,u:i,parent:c,vnode:u}=e;{let t=function e(t){let n=t.subTree.component;if(n)return n.asyncDep&&!n.asyncResolved?n:e(n)}(e);if(t){n&&(n.el=u.el,J(e,n,o)),t.asyncDep.then(()=>{e.isUnmounted||a()});return}}let d=n;rq(e,!1),n?(n.el=u.el,J(e,n,o)):n=u,r&&Y(r),(t=n.props&&n.props.onVnodeBeforeUpdate)&&iR(t,c,n,u),rq(e,!0);let p=r2(e),f=e.subTree;e.subTree=p,x(f,p,h(f.el),eo(f),e,l,s),n.el=p.el,null===d&&r8(e,p.el),i&&rB(i,l),(t=n.props&&n.props.onVnodeUpdated)&&rB(()=>iR(t,c,n,u),l)}else{let o;let{el:a,props:c}=t,{bm:u,m:d,parent:p,root:f,type:h}=e,m=nj(t);if(rq(e,!1),u&&Y(u),!m&&(o=c&&c.onVnodeBeforeMount)&&iR(o,p,t),rq(e,!0),a&&i){let t=()=>{e.subTree=r2(e),i(a,e.subTree,e,l,null)};m&&h.__asyncHydrate?h.__asyncHydrate(a,e,t):t()}else{f.ce&&f.ce._injectChildStyle(h);let i=e.subTree=r2(e);x(null,i,n,r,e,l,s),t.el=i.el}if(d&&rB(d,l),!m&&(o=c&&c.onVnodeMounted)){let e=t;rB(()=>iR(o,p,e),l)}(256&t.shapeFlag||p&&nj(p.vnode)&&256&p.vnode.shapeFlag)&&e.a&&rB(e.a,l),e.isMounted=!0,t=n=r=null}};e.scope.on();let c=e.effect=new ek(a);e.scope.off();let u=e.update=c.run.bind(c),d=e.job=c.runIfDirty.bind(c);d.i=e,d.id=e.uid,c.scheduler=()=>t1(d),rq(e,!0),u()},J=(e,t,n)=>{t.component=e;let r=e.vnode.props;e.vnode=t,e.next=null,function(e,t,n,r){let{props:i,attrs:l,vnode:{patchFlag:s}}=e,o=tx(i),[a]=e.propsOptions,c=!1;if((r||s>0)&&!(16&s)){if(8&s){let n=e.vnode.dynamicProps;for(let r=0;r{let c=e&&e.children,u=e?e.shapeFlag:0,d=t.children,{patchFlag:p,shapeFlag:h}=t;if(p>0){if(128&p){Z(c,d,n,r,i,l,s,o,a);return}if(256&p){Q(c,d,n,r,i,l,s,o,a);return}}8&h?(16&u&&es(c,i,l),d!==c&&f(n,d)):16&u?16&h?Z(c,d,n,r,i,l,s,o,a):es(c,i,l,!0):(8&u&&f(n,""),16&h&&L(d,n,r,i,l,s,o,a))},Q=(e,t,n,r,i,l,s,o,a)=>{let c;e=e||b,t=t||b;let u=e.length,d=t.length,p=Math.min(u,d);for(c=0;cd?es(e,i,l,!0,!1,p):L(t,n,r,i,l,s,o,a,p)},Z=(e,t,n,r,i,l,s,o,a)=>{let c=0,u=t.length,d=e.length-1,p=u-1;for(;c<=d&&c<=p;){let r=e[c],u=t[c]=a?iA(t[c]):iw(t[c]);if(ib(r,u))x(r,u,n,null,i,l,s,o,a);else break;c++}for(;c<=d&&c<=p;){let r=e[d],c=t[p]=a?iA(t[p]):iw(t[p]);if(ib(r,c))x(r,c,n,null,i,l,s,o,a);else break;d--,p--}if(c>d){if(c<=p){let e=p+1,d=ep)for(;c<=d;)et(e[c],i,l,!0),c++;else{let f;let h=c,m=c,g=new Map;for(c=m;c<=p;c++){let e=t[c]=a?iA(t[c]):iw(t[c]);null!=e.key&&g.set(e.key,c)}let y=0,_=p-m+1,S=!1,C=0,k=Array(_);for(c=0;c<_;c++)k[c]=0;for(c=h;c<=d;c++){let r;let u=e[c];if(y>=_){et(u,i,l,!0);continue}if(null!=u.key)r=g.get(u.key);else for(f=m;f<=p;f++)if(0===k[f-m]&&ib(u,t[f])){r=f;break}void 0===r?et(u,i,l,!0):(k[r-m]=c+1,r>=C?C=r:S=!0,x(u,t[r],n,null,i,l,s,o,a),y++)}let T=S?function(e){let t,n,r,i,l;let s=e.slice(),o=[0],a=e.length;for(t=0;t>1]]0&&(s[t]=o[r-1]),o[r]=t)}}for(r=o.length,i=o[r-1];r-- >0;)o[r]=i,i=s[i];return o}(k):b;for(f=T.length-1,c=_-1;c>=0;c--){let e=m+c,d=t[e],p=e+1{let{el:s,type:o,transition:a,children:c,shapeFlag:u}=e;if(6&u){ee(e.component.subTree,t,n,r);return}if(128&u){e.suspense.move(t,n,r);return}if(64&u){o.move(e,t,n,eu);return}if(o===il){l(s,t,n);for(let e=0;ea.enter(s),i);else{let{leave:e,delayLeave:r,afterLeave:i}=a,o=()=>l(s,t,n),c=()=>{e(s,()=>{o(),i&&i()})};r?r(s,o,c):c()}}else l(s,t,n)},et=(e,t,n,r=!1,i=!1)=>{let l;let{type:s,props:o,ref:a,children:c,dynamicChildren:u,shapeFlag:d,patchFlag:p,dirs:f,cacheIndex:h}=e;if(-2===p&&(i=!1),null!=a&&nE(a,null,n,e,!0),null!=h&&(t.renderCache[h]=void 0),256&d){t.ctx.deactivate(e);return}let m=1&d&&f,g=!nj(e);if(g&&(l=o&&o.onVnodeBeforeUnmount)&&iR(l,t,e),6&d)el(e.component,n,r);else{if(128&d){e.suspense.unmount(n,r);return}m&&nt(e,null,t,"beforeUnmount"),64&d?e.type.remove(e,t,n,eu,r):u&&!u.hasOnce&&(s!==il||p>0&&64&p)?es(u,t,n,!1,!0):(s===il&&384&p||!i&&16&d)&&es(c,t,n),r&&en(e)}(g&&(l=o&&o.onVnodeUnmounted)||m)&&rB(()=>{l&&iR(l,t,e),m&&nt(e,null,t,"unmounted")},n)},en=e=>{let{type:t,el:n,anchor:r,transition:i}=e;if(t===il){ei(n,r);return}if(t===ia){I(e);return}let l=()=>{s(n),i&&!i.persisted&&i.afterLeave&&i.afterLeave()};if(1&e.shapeFlag&&i&&!i.persisted){let{leave:t,delayLeave:r}=i,s=()=>t(n,l);r?r(e.el,l,s):s()}else l()},ei=(e,t)=>{let n;for(;e!==t;)n=m(e),s(e),e=n;s(t)},el=(e,t,n)=>{let{bum:r,scope:i,job:l,subTree:s,um:o,m:a,a:c}=e;rz(a),rz(c),r&&Y(r),i.stop(),l&&(l.flags|=8,et(s,e,t,n)),o&&rB(o,t),rB(()=>{e.isUnmounted=!0},t),t&&t.pendingBranch&&!t.isUnmounted&&e.asyncDep&&!e.asyncResolved&&e.suspenseId===t.pendingId&&(t.deps--,0===t.deps&&t.resolve())},es=(e,t,n,r=!1,i=!1,l=0)=>{for(let s=l;s{if(6&e.shapeFlag)return eo(e.component.subTree);if(128&e.shapeFlag)return e.suspense.next();let t=m(e.anchor||e.el),n=t&&t[nn];return n?m(n):t},ea=!1,ec=(e,t,n)=>{null==e?t._vnode&&et(t._vnode,null,null,!0):x(t._vnode||null,e,t,null,null,null,n),t._vnode=e,ea||(ea=!0,t6(),t4(),ea=!1)},eu={p:x,um:et,m:ee,r:en,mt:q,mc:L,pc:X,pbc:V,n:eo,o:e};return t&&([r,i]=t(eu)),{render:ec,hydrate:r,createApp:(n=r,function(e,t=null){P(e)||(e=k({},e)),null==t||$(t)||(t=null);let r=r_(),i=new WeakSet,l=[],s=!1,o=r.app={_uid:rS++,_component:e,_props:t,_container:null,_context:r,_instance:null,version:iX,get config(){return r.config},set config(v){},use:(e,...t)=>(i.has(e)||(e&&P(e.install)?(i.add(e),e.install(o,...t)):P(e)&&(i.add(e),e(o,...t))),o),mixin:e=>(r.mixins.includes(e)||r.mixins.push(e),o),component:(e,t)=>t?(r.components[e]=t,o):r.components[e],directive:(e,t)=>t?(r.directives[e]=t,o):r.directives[e],mount(i,l,a){if(!s){let c=o._ceVNode||iC(e,t);return c.appContext=r,!0===a?a="svg":!1===a&&(a=void 0),l&&n?n(c,i):ec(c,i,a),s=!0,o._container=i,i.__vue_app__=o,iW(c.component)}},onUnmount(e){l.push(e)},unmount(){s&&(tW(l,o._instance,16),ec(null,o._container),delete o._container.__vue_app__)},provide:(e,t)=>(r.provides[e]=t,o),runWithContext(e){let t=rx;rx=o;try{return e()}finally{rx=t}}};return o})}}function rH({type:e,props:t},n){return"svg"===n&&"foreignObject"===e||"mathml"===n&&"annotation-xml"===e&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function rq({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function rW(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function rK(e,t,n=!1){let r=e.children,i=t.children;if(A(r)&&A(i))for(let e=0;etW(e,c,t,n);let u=!1;return"post"===s?a.scheduler=e=>{rB(e,c&&c.suspense)}:"sync"!==s&&(u=!0,a.scheduler=(e,t)=>{t?e():t1(e)}),a.augmentJob=e=>{t&&(e.flags|=4),u&&(e.flags|=2,c&&(e.id=c.uid,e.i=c))},function(e,t,n=y){let r,l,s,o;let{immediate:a,deep:c,once:u,scheduler:d,augmentJob:p,call:f}=n,m=e=>c?e:t_(e)||!1===c||0===c?tH(e,1):tH(e),g=!1,b=!1;if(tN(e)?(l=()=>e.value,g=t_(e)):tv(e)?(l=()=>m(e),g=!0):A(e)?(b=!0,g=e.some(e=>tv(e)||t_(e)),l=()=>e.map(e=>tN(e)?e.value:tv(e)?m(e):P(e)?f?f(e,2):e():void 0)):l=P(e)?t?f?()=>f(e,2):e:()=>{if(s){eL();try{s()}finally{e$()}}let t=h;h=r;try{return f?f(e,3,[o]):e(o)}finally{h=t}}:_,t&&c){let e=l,t=!0===c?1/0:c;l=()=>tH(e(),t)}let S=i,x=()=>{r.stop(),S&&S.active&&T(S.effects,r)};if(u&&t){let e=t;t=(...t)=>{e(...t),x()}}let C=b?Array(e.length).fill(tB):tB,k=e=>{if(1&r.flags&&(r.dirty||e)){if(t){let e=r.run();if(c||g||(b?e.some((e,t)=>Z(e,C[t])):Z(e,C))){s&&s();let n=h;h=r;try{let n=[e,C===tB?void 0:b&&C[0]===tB?[]:C,o];f?f(t,3,n):t(...n),C=e}finally{h=n}}}else r.run()}};return p&&p(k),(r=new ek(l)).scheduler=d?()=>d(k,!1):k,o=e=>tj(e,!1,r),s=r.onStop=()=>{let e=tU.get(r);if(e){if(f)f(e,4);else for(let t of e)t();tU.delete(r)}},t?a?k(!0):C=r.run():d?d(k.bind(null,!0),!0):r.run(),x.pause=r.pause.bind(r),x.resume=r.resume.bind(r),x.stop=x,x}(e,t,a)}function rQ(e,t,n){let r;let i=this.proxy,l=M(e)?e.includes(".")?rZ(i,e):()=>i[e]:e.bind(i,i);P(t)?r=t:(r=t.handler,n=t);let s=i$(this),o=rX(l,r.bind(i),n);return s(),o}function rZ(e,t){let n=t.split(".");return()=>{let t=e;for(let e=0;e"modelValue"===t||"model-value"===t?e.modelModifiers:e[`${t}Modifiers`]||e[`${z(t)}Modifiers`]||e[`${G(t)}Modifiers`];function r0(e,t,...n){let r;if(e.isUnmounted)return;let i=e.vnode.props||y,l=n,s=t.startsWith("update:"),o=s&&rY(i,t.slice(7));o&&(o.trim&&(l=n.map(e=>M(e)?e.trim():e)),o.number&&(l=n.map(et)));let a=i[r=Q(t)]||i[r=Q(z(t))];!a&&s&&(a=i[r=Q(G(t))]),a&&tW(a,e,6,l);let c=i[r+"Once"];if(c){if(e.emitted){if(e.emitted[r])return}else e.emitted={};e.emitted[r]=!0,tW(c,e,6,l)}}function r1(e,t){return!!(e&&x(t))&&(w(e,(t=t.slice(2).replace(/Once$/,""))[0].toLowerCase()+t.slice(1))||w(e,G(t))||w(e,t))}function r2(e){let t,n;let{type:r,vnode:i,proxy:l,withProxy:s,propsOptions:[o],slots:a,attrs:c,emit:u,render:d,renderCache:p,props:f,data:h,setupState:m,ctx:g,inheritAttrs:y}=e,b=t7(e);try{if(4&i.shapeFlag){let e=s||l;t=iw(d.call(e,e,p,f,m,h,g)),n=c}else t=iw(r.length>1?r(f,{attrs:c,slots:a,emit:u}):r(f,null)),n=r.props?c:r3(c)}catch(n){ic.length=0,tK(n,e,1),t=iC(io)}let _=t;if(n&&!1!==y){let e=Object.keys(n),{shapeFlag:t}=_;e.length&&7&t&&(o&&e.some(C)&&(n=r6(n,o)),_=iT(_,n,!1,!0))}return i.dirs&&((_=iT(_,null,!1,!0)).dirs=_.dirs?_.dirs.concat(i.dirs):i.dirs),i.transition&&nT(_,i.transition),t=_,t7(b),t}let r3=e=>{let t;for(let n in e)("class"===n||"style"===n||x(n))&&((t||(t={}))[n]=e[n]);return t},r6=(e,t)=>{let n={};for(let r in e)C(r)&&r.slice(9)in t||(n[r]=e[r]);return n};function r4(e,t,n){let r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let i=0;ie.__isSuspense,r9=0;function r7(e,t){let n=e.props&&e.props[t];P(n)&&n()}function ie(e,t,n,r,i,l,s,o,a,c,u=!1){let d;let{p:p,m:f,um:h,n:m,o:{parentNode:g,remove:y}}=c,b=function(e){let t=e.props&&e.props.suspensible;return null!=t&&!1!==t}(e);b&&t&&t.pendingBranch&&(d=t.pendingId,t.deps++);let _=e.props?en(e.props.timeout):void 0,S=l,x={vnode:e,parent:t,parentComponent:n,namespace:s,container:r,hiddenContainer:i,deps:0,pendingId:r9++,timeout:"number"==typeof _?_:-1,activeBranch:null,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve(e=!1,n=!1){let{vnode:r,activeBranch:i,pendingBranch:s,pendingId:o,effects:a,parentComponent:c,container:u}=x,p=!1;x.isHydrating?x.isHydrating=!1:e||((p=i&&s.transition&&"out-in"===s.transition.mode)&&(i.transition.afterLeave=()=>{o===x.pendingId&&(f(s,u,l===S?m(i):l,0),t3(a))}),i&&(g(i.el)===u&&(l=m(i)),h(i,c,x,!0)),p||f(s,u,l,0)),ii(x,s),x.pendingBranch=null,x.isInFallback=!1;let y=x.parent,_=!1;for(;y;){if(y.pendingBranch){y.effects.push(...a),_=!0;break}y=y.parent}_||p||t3(a),x.effects=[],b&&t&&t.pendingBranch&&d===t.pendingId&&(t.deps--,0!==t.deps||n||t.resolve()),r7(r,"onResolve")},fallback(e){if(!x.pendingBranch)return;let{vnode:t,activeBranch:n,parentComponent:r,container:i,namespace:l}=x;r7(t,"onFallback");let s=m(n),c=()=>{x.isInFallback&&(p(null,e,i,s,r,null,l,o,a),ii(x,e))},u=e.transition&&"out-in"===e.transition.mode;u&&(n.transition.afterLeave=c),x.isInFallback=!0,h(n,r,null,!0),u||c()},move(e,t,n){x.activeBranch&&f(x.activeBranch,e,t,n),x.container=e},next:()=>x.activeBranch&&m(x.activeBranch),registerDep(e,t,n){let r=!!x.pendingBranch;r&&x.deps++;let i=e.vnode.el;e.asyncDep.catch(t=>{tK(t,e,0)}).then(l=>{if(e.isUnmounted||x.isUnmounted||x.pendingId!==e.suspenseId)return;e.asyncResolved=!0;let{vnode:o}=e;iB(e,l,!1),i&&(o.el=i);let a=!i&&e.subTree.el;t(e,o,g(i||e.subTree.el),i?null:m(e.subTree),x,s,n),a&&y(a),r8(e,o.el),r&&0==--x.deps&&x.resolve()})},unmount(e,t){x.isUnmounted=!0,x.activeBranch&&h(x.activeBranch,n,e,t),x.pendingBranch&&h(x.pendingBranch,n,e,t)}};return x}function it(e){let t;if(P(e)){let n=ih&&e._c;n&&(e._d=!1,id()),e=e(),n&&(e._d=!0,t=iu,ip())}return A(e)&&(e=function(e,t=!0){let n;for(let t=0;tt!==e)),e}function ir(e,t){t&&t.pendingBranch?A(e)?t.effects.push(...e):t.effects.push(e):t3(e)}function ii(e,t){e.activeBranch=t;let{vnode:n,parentComponent:r}=e,i=t.el;for(;!i&&t.component;)i=(t=t.component.subTree).el;n.el=i,r&&r.subTree===n&&(r.vnode.el=i,r8(r,i))}let il=Symbol.for("v-fgt"),is=Symbol.for("v-txt"),io=Symbol.for("v-cmt"),ia=Symbol.for("v-stc"),ic=[],iu=null;function id(e=!1){ic.push(iu=e?null:[])}function ip(){ic.pop(),iu=ic[ic.length-1]||null}let ih=1;function im(e,t=!1){ih+=e,e<0&&iu&&t&&(iu.hasOnce=!0)}function ig(e){return e.dynamicChildren=ih>0?iu||b:null,ip(),ih>0&&iu&&iu.push(e),e}function iy(e,t,n,r,i){return ig(iC(e,t,n,r,i,!0))}function iv(e){return!!e&&!0===e.__v_isVNode}function ib(e,t){return e.type===t.type&&e.key===t.key}let i_=({key:e})=>null!=e?e:null,iS=({ref:e,ref_key:t,ref_for:n})=>("number"==typeof e&&(e=""+e),null!=e?M(e)||tN(e)||P(e)?{i:t5,r:e,k:t,f:!!n}:e:null);function ix(e,t=null,n=null,r=0,i=null,l=e===il?0:1,s=!1,o=!1){let a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&i_(t),ref:t&&iS(t),scopeId:t9,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:l,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:t5};return o?(iE(a,n),128&l&&e.normalize(a)):n&&(a.shapeFlag|=M(n)?8:16),ih>0&&!s&&iu&&(a.patchFlag>0||6&l)&&32!==a.patchFlag&&iu.push(a),a}let iC=function(e,t=null,n=null,r=0,i=null,l=!1){var s;if(e&&e!==re||(e=io),iv(e)){let r=iT(e,t,!0);return n&&iE(r,n),ih>0&&!l&&iu&&(6&r.shapeFlag?iu[iu.indexOf(e)]=r:iu.push(r)),r.patchFlag=-2,r}if(P(s=e)&&"__vccOpts"in s&&(e=e.__vccOpts),t){let{class:e,style:n}=t=ik(t);e&&!M(e)&&(t.class=eu(e)),$(n)&&(tS(n)&&!A(n)&&(n=k({},n)),t.style=el(n))}let o=M(e)?1:r5(e)?128:nr(e)?64:$(e)?4:P(e)?2:0;return ix(e,t,n,r,i,o,l,!0)};function ik(e){return e?tS(e)||rw(e)?k({},e):e:null}function iT(e,t,n=!1,r=!1){let{props:i,ref:l,patchFlag:s,children:o,transition:a}=e,c=t?iI(i||{},t):i,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&i_(c),ref:t&&t.ref?n&&l?A(l)?l.concat(iS(t)):[l,iS(t)]:iS(t):l,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:o,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==il?-1===s?16:16|s:s,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&iT(e.ssContent),ssFallback:e.ssFallback&&iT(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&r&&nT(u,a.clone(u)),u}function iN(e=" ",t=0){return iC(is,null,e,t)}function iw(e){return null==e||"boolean"==typeof e?iC(io):A(e)?iC(il,null,e.slice()):iv(e)?iA(e):iC(is,null,String(e))}function iA(e){return null===e.el&&-1!==e.patchFlag||e.memo?e:iT(e)}function iE(e,t){let n=0,{shapeFlag:r}=e;if(null==t)t=null;else if(A(t))n=16;else if("object"==typeof t){if(65&r){let n=t.default;n&&(n._c&&(n._d=!1),iE(e,n()),n._c&&(n._d=!0));return}{n=32;let r=t._;r||rw(t)?3===r&&t5&&(1===t5.slots._?t._=1:(t._=2,e.patchFlag|=1024)):t._ctx=t5}}else P(t)?(t={default:t,_ctx:t5},n=32):(t=String(t),64&r?(n=16,t=[iN(t)]):n=8);e.children=t,e.shapeFlag|=n}function iI(...e){let t={};for(let n=0;niM||t5;a=e=>{iM=e},c=e=>{iV=e};let i$=e=>{let t=iM;return a(e),e.scope.on(),()=>{e.scope.off(),a(t)}},iD=()=>{iM&&iM.scope.off(),a(null)};function iF(e){return 4&e.vnode.shapeFlag}let iV=!1;function iB(e,t,n){P(t)?e.render=t:$(t)&&(e.setupState=tP(t)),ij(e,n)}function iU(e){u=e,d=e=>{e.render._rc&&(e.withProxy=new Proxy(e.ctx,ro))}}function ij(e,t,n){let r=e.type;if(!e.render){if(!t&&u&&!r.render){let t=r.template||rp(e).template;if(t){let{isCustomElement:n,compilerOptions:i}=e.appContext.config,{delimiters:l,compilerOptions:s}=r,o=k(k({isCustomElement:n,delimiters:l},i),s);r.render=u(t,o)}}e.render=r.render||_,d&&d(e)}{let t=i$(e);eL();try{!function(e){let t=rp(e),n=e.proxy,r=e.ctx;ru=!1,t.beforeCreate&&rd(t.beforeCreate,e,"bc");let{data:i,computed:l,methods:s,watch:o,provide:a,inject:c,created:u,beforeMount:d,mounted:p,beforeUpdate:f,updated:h,activated:m,deactivated:g,beforeDestroy:y,beforeUnmount:b,destroyed:S,unmounted:x,render:C,renderTracked:k,renderTriggered:T,errorCaptured:N,serverPrefetch:w,expose:E,inheritAttrs:I,components:R,directives:O,filters:L}=t;if(c&&function(e,t,n=_){for(let n in A(e)&&(e=rg(e)),e){let r;let i=e[n];tN(r=$(i)?"default"in i?rk(i.from||n,i.default,!0):rk(i.from||n):rk(i))?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>r.value,set:e=>r.value=e}):t[n]=r}}(c,r,null),s)for(let e in s){let t=s[e];P(t)&&(r[e]=t.bind(n))}if(i){let t=i.call(n,n);$(t)&&(e.data=th(t))}if(ru=!0,l)for(let e in l){let t=l[e],i=P(t)?t.bind(n,n):P(t.get)?t.get.bind(n,n):_,s=iz({get:i,set:!P(t)&&P(t.set)?t.set.bind(n):_});Object.defineProperty(r,e,{enumerable:!0,configurable:!0,get:()=>s.value,set:e=>s.value=e})}if(o)for(let e in o)!function e(t,n,r,i){let l=i.includes(".")?rZ(r,i):()=>r[i];if(M(t)){let e=n[t];P(e)&&rX(l,e,void 0)}else if(P(t)){var s;s=t.bind(r),rX(l,s,void 0)}else if($(t)){if(A(t))t.forEach(t=>e(t,n,r,i));else{let e=P(t.handler)?t.handler.bind(r):n[t.handler];P(e)&&rX(l,e,t)}}}(o[e],r,n,e);if(a){let e=P(a)?a.call(n):a;Reflect.ownKeys(e).forEach(t=>{rC(t,e[t])})}function D(e,t){A(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(u&&rd(u,e,"c"),D(nY,d),D(n0,p),D(n1,f),D(n2,h),D(nK,m),D(nz,g),D(n9,N),D(n5,k),D(n8,T),D(n3,b),D(n6,x),D(n4,w),A(E)){if(E.length){let t=e.exposed||(e.exposed={});E.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t})})}else e.exposed||(e.exposed={})}C&&e.render===_&&(e.render=C),null!=I&&(e.inheritAttrs=I),R&&(e.components=R),O&&(e.directives=O)}(e)}finally{e$(),t()}}}let iH={get:(e,t)=>(eW(e,"get",""),e[t])};function iq(e){return{attrs:new Proxy(e.attrs,iH),slots:e.slots,emit:e.emit,expose:t=>{e.exposed=t||{}}}}function iW(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(tP(tC(e.exposed)),{get:(t,n)=>n in t?t[n]:n in ri?ri[n](e):void 0,has:(e,t)=>t in e||t in ri})):e.proxy}function iK(e,t=!0){return P(e)?e.displayName||e.name:e.name||t&&e.__name}let iz=(e,t)=>(function(e,t,n=!1){let r,i;return P(e)?r=e:(r=e.get,i=e.set),new tV(r,i,n)})(e,0,iV);function iJ(e,t,n){let r=arguments.length;return 2!==r?(r>3?n=Array.prototype.slice.call(arguments,2):3===r&&iv(n)&&(n=[n]),iC(e,t,n)):!$(t)||A(t)?iC(e,null,t):iv(t)?iC(e,null,[t]):iC(e,t)}function iG(e,t){let n=e.memo;if(n.length!=t.length)return!1;for(let e=0;e0&&iu&&iu.push(e),!0}let iX="3.5.13",iQ="undefined"!=typeof window&&window.trustedTypes;if(iQ)try{m=iQ.createPolicy("vue",{createHTML:e=>e})}catch(e){}let iZ=m?e=>m.createHTML(e):e=>e,iY="undefined"!=typeof document?document:null,i0=iY&&iY.createElement("template"),i1="transition",i2="animation",i3=Symbol("_vtc"),i6={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},i4=k({},ny,i6),i8=((t=(e,{slots:t})=>iJ(n_,i7(e),t)).displayName="Transition",t.props=i4,t),i5=(e,t=[])=>{A(e)?e.forEach(e=>e(...t)):e&&e(...t)},i9=e=>!!e&&(A(e)?e.some(e=>e.length>1):e.length>1);function i7(e){let t={};for(let n in e)n in i6||(t[n]=e[n]);if(!1===e.css)return t;let{name:n="v",type:r,duration:i,enterFromClass:l=`${n}-enter-from`,enterActiveClass:s=`${n}-enter-active`,enterToClass:o=`${n}-enter-to`,appearFromClass:a=l,appearActiveClass:c=s,appearToClass:u=o,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:p=`${n}-leave-active`,leaveToClass:f=`${n}-leave-to`}=e,h=function(e){if(null==e)return null;if($(e))return[en(e.enter),en(e.leave)];{let t=en(e);return[t,t]}}(i),m=h&&h[0],g=h&&h[1],{onBeforeEnter:y,onEnter:b,onEnterCancelled:_,onLeave:S,onLeaveCancelled:x,onBeforeAppear:C=y,onAppear:T=b,onAppearCancelled:N=_}=t,w=(e,t,n,r)=>{e._enterCancelled=r,lt(e,t?u:o),lt(e,t?c:s),n&&n()},A=(e,t)=>{e._isLeaving=!1,lt(e,d),lt(e,f),lt(e,p),t&&t()},E=e=>(t,n)=>{let i=e?T:b,s=()=>w(t,e,n);i5(i,[t,s]),ln(()=>{lt(t,e?a:l),le(t,e?u:o),i9(i)||li(t,r,m,s)})};return k(t,{onBeforeEnter(e){i5(y,[e]),le(e,l),le(e,s)},onBeforeAppear(e){i5(C,[e]),le(e,a),le(e,c)},onEnter:E(!1),onAppear:E(!0),onLeave(e,t){e._isLeaving=!0;let n=()=>A(e,t);le(e,d),e._enterCancelled?(le(e,p),la()):(la(),le(e,p)),ln(()=>{e._isLeaving&&(lt(e,d),le(e,f),i9(S)||li(e,r,g,n))}),i5(S,[e,n])},onEnterCancelled(e){w(e,!1,void 0,!0),i5(_,[e])},onAppearCancelled(e){w(e,!0,void 0,!0),i5(N,[e])},onLeaveCancelled(e){A(e),i5(x,[e])}})}function le(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.add(t)),(e[i3]||(e[i3]=new Set)).add(t)}function lt(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.remove(t));let n=e[i3];n&&(n.delete(t),n.size||(e[i3]=void 0))}function ln(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let lr=0;function li(e,t,n,r){let i=e._endId=++lr,l=()=>{i===e._endId&&r()};if(null!=n)return setTimeout(l,n);let{type:s,timeout:o,propCount:a}=ll(e,t);if(!s)return r();let c=s+"end",u=0,d=()=>{e.removeEventListener(c,p),l()},p=t=>{t.target===e&&++u>=a&&d()};setTimeout(()=>{u(n[e]||"").split(", "),i=r(`${i1}Delay`),l=r(`${i1}Duration`),s=ls(i,l),o=r(`${i2}Delay`),a=r(`${i2}Duration`),c=ls(o,a),u=null,d=0,p=0;t===i1?s>0&&(u=i1,d=s,p=l.length):t===i2?c>0&&(u=i2,d=c,p=a.length):p=(u=(d=Math.max(s,c))>0?s>c?i1:i2:null)?u===i1?l.length:a.length:0;let f=u===i1&&/\b(transform|all)(,|$)/.test(r(`${i1}Property`).toString());return{type:u,timeout:d,propCount:p,hasTransform:f}}function ls(e,t){for(;e.lengthlo(t)+lo(e[n])))}function lo(e){return"auto"===e?0:1e3*Number(e.slice(0,-1).replace(",","."))}function la(){return document.body.offsetHeight}let lc=Symbol("_vod"),lu=Symbol("_vsh");function ld(e,t){e.style.display=t?e[lc]:"none",e[lu]=!t}let lp=Symbol("");function lf(e,t){if(1===e.nodeType){let n=e.style,r="";for(let e in t)n.setProperty(`--${e}`,t[e]),r+=`--${e}: ${t[e]};`;n[lp]=r}}let lh=/(^|;)\s*display\s*:/,lm=/\s*!important$/;function lg(e,t,n){if(A(n))n.forEach(n=>lg(e,t,n));else if(null==n&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{let r=function(e,t){let n=lv[t];if(n)return n;let r=z(t);if("filter"!==r&&r in e)return lv[t]=r;r=X(r);for(let n=0;nlT||(lN.then(()=>lT=0),lT=Date.now()),lA=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)>96&&123>e.charCodeAt(2),lE={};function lI(e,t,n){let r=nw(e,t);U(r)&&k(r,t);class i extends lO{constructor(e){super(r,e,n)}}return i.def=r,i}let lR="undefined"!=typeof HTMLElement?HTMLElement:class{};class lO extends lR{constructor(e,t={},n=l9){super(),this._def=e,this._props=t,this._createApp=n,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._ob=null,this.shadowRoot&&n!==l9?this._root=this.shadowRoot:!1!==e.shadowRoot?(this.attachShadow({mode:"open"}),this._root=this.shadowRoot):this._root=this,this._def.__asyncLoader||this._resolveProps(this._def)}connectedCallback(){if(!this.isConnected)return;this.shadowRoot||this._parseSlots(),this._connected=!0;let e=this;for(;e=e&&(e.parentNode||e.host);)if(e instanceof lO){this._parent=e;break}this._instance||(this._resolved?(this._setParent(),this._update()):e&&e._pendingResolve?this._pendingResolve=e._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(e=this._parent){e&&(this._instance.parent=e._instance,this._instance.provides=e._instance.provides)}disconnectedCallback(){this._connected=!1,t0(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null)})}_resolveDef(){if(this._pendingResolve)return;for(let e=0;e{for(let t of e)this._setAttr(t.attributeName)}),this._ob.observe(this,{attributes:!0});let e=(e,t=!1)=>{let n;this._resolved=!0,this._pendingResolve=void 0;let{props:r,styles:i}=e;if(r&&!A(r))for(let e in r){let t=r[e];(t===Number||t&&t.type===Number)&&(e in this._props&&(this._props[e]=en(this._props[e])),(n||(n=Object.create(null)))[z(e)]=!0)}this._numberProps=n,t&&this._resolveProps(e),this.shadowRoot&&this._applyStyles(i),this._mount(e)},t=this._def.__asyncLoader;t?this._pendingResolve=t().then(t=>e(this._def=t,!0)):e(this._def)}_mount(e){this._app=this._createApp(e),e.configureApp&&e.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);let t=this._instance&&this._instance.exposed;if(t)for(let e in t)w(this,e)||Object.defineProperty(this,e,{get:()=>tR(t[e])})}_resolveProps(e){let{props:t}=e,n=A(t)?t:Object.keys(t||{});for(let e of Object.keys(this))"_"!==e[0]&&n.includes(e)&&this._setProp(e,this[e]);for(let e of n.map(z))Object.defineProperty(this,e,{get(){return this._getProp(e)},set(t){this._setProp(e,t,!0,!0)}})}_setAttr(e){if(e.startsWith("data-v-"))return;let t=this.hasAttribute(e),n=t?this.getAttribute(e):lE,r=z(e);t&&this._numberProps&&this._numberProps[r]&&(n=en(n)),this._setProp(r,n,!1,!0)}_getProp(e){return this._props[e]}_setProp(e,t,n=!0,r=!1){if(t!==this._props[e]&&(t===lE?delete this._props[e]:(this._props[e]=t,"key"===e&&this._app&&(this._app._ceVNode.key=t)),r&&this._instance&&this._update(),n)){let n=this._ob;n&&n.disconnect(),!0===t?this.setAttribute(G(e),""):"string"==typeof t||"number"==typeof t?this.setAttribute(G(e),t+""):t||this.removeAttribute(G(e)),n&&n.observe(this,{attributes:!0})}}_update(){l5(this._createVNode(),this._root)}_createVNode(){let e={};this.shadowRoot||(e.onVnodeMounted=e.onVnodeUpdated=this._renderSlots.bind(this));let t=iC(this._def,k(e,this._props));return this._instance||(t.ce=e=>{this._instance=e,e.ce=this,e.isCE=!0;let t=(e,t)=>{this.dispatchEvent(new CustomEvent(e,U(t[0])?k({detail:t},t[0]):{detail:t}))};e.emit=(e,...n)=>{t(e,n),G(e)!==e&&t(G(e),n)},this._setParent()}),t}_applyStyles(e,t){if(!e)return;if(t){if(t===this._def||this._styleChildren.has(t))return;this._styleChildren.add(t)}let n=this._nonce;for(let t=e.length-1;t>=0;t--){let r=document.createElement("style");n&&r.setAttribute("nonce",n),r.textContent=e[t],this.shadowRoot.prepend(r)}}_parseSlots(){let e;let t=this._slots={};for(;e=this.firstChild;){let n=1===e.nodeType&&e.getAttribute("slot")||"default";(t[n]||(t[n]=[])).push(e),this.removeChild(e)}}_renderSlots(){let e=(this._teleportTarget||this).querySelectorAll("slot"),t=this._instance.type.__scopeId;for(let n=0;n{if(!n.length)return;let t=e.moveClass||`${e.name||"v"}-move`;if(!function(e,t,n){let r=e.cloneNode(),i=e[i3];i&&i.forEach(e=>{e.split(/\s+/).forEach(e=>e&&r.classList.remove(e))}),n.split(/\s+/).forEach(e=>e&&r.classList.add(e)),r.style.display="none";let l=1===t.nodeType?t:t.parentNode;l.appendChild(r);let{hasTransform:s}=ll(r);return l.removeChild(r),s}(n[0].el,i.vnode.el,t))return;n.forEach(lV),n.forEach(lB);let r=n.filter(lU);la(),r.forEach(e=>{let n=e.el,r=n.style;le(n,t),r.transform=r.webkitTransform=r.transitionDuration="";let i=n[l$]=e=>{(!e||e.target===n)&&(!e||/transform$/.test(e.propertyName))&&(n.removeEventListener("transitionend",i),n[l$]=null,lt(n,t))};n.addEventListener("transitionend",i)})}),()=>{let s=tx(e),o=i7(s),a=s.tag||il;if(n=[],r)for(let e=0;e{let t=e.props["onUpdate:modelValue"]||!1;return A(t)?e=>Y(t,e):t};function lH(e){e.target.composing=!0}function lq(e){let t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}let lW=Symbol("_assign"),lK={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e[lW]=lj(i);let l=r||i.props&&"number"===i.props.type;lx(e,t?"change":"input",t=>{if(t.target.composing)return;let r=e.value;n&&(r=r.trim()),l&&(r=et(r)),e[lW](r)}),n&&lx(e,"change",()=>{e.value=e.value.trim()}),t||(lx(e,"compositionstart",lH),lx(e,"compositionend",lq),lx(e,"change",lq))},mounted(e,{value:t}){e.value=null==t?"":t},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:l}},s){if(e[lW]=lj(s),e.composing)return;let o=(l||"number"===e.type)&&!/^0\d/.test(e.value)?et(e.value):e.value,a=null==t?"":t;o===a||document.activeElement===e&&"range"!==e.type&&(r&&t===n||i&&e.value.trim()===a)||(e.value=a)}},lz={deep:!0,created(e,t,n){e[lW]=lj(n),lx(e,"change",()=>{let t=e._modelValue,n=lZ(e),r=e.checked,i=e[lW];if(A(t)){let e=ey(t,n),l=-1!==e;if(r&&!l)i(t.concat(n));else if(!r&&l){let n=[...t];n.splice(e,1),i(n)}}else if(I(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(lY(e,r))})},mounted:lJ,beforeUpdate(e,t,n){e[lW]=lj(n),lJ(e,t,n)}};function lJ(e,{value:t,oldValue:n},r){let i;if(e._modelValue=t,A(t))i=ey(t,r.props.value)>-1;else if(I(t))i=t.has(r.props.value);else{if(t===n)return;i=eg(t,lY(e,!0))}e.checked!==i&&(e.checked=i)}let lG={created(e,{value:t},n){e.checked=eg(t,n.props.value),e[lW]=lj(n),lx(e,"change",()=>{e[lW](lZ(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[lW]=lj(r),t!==n&&(e.checked=eg(t,r.props.value))}},lX={deep:!0,created(e,{value:t,modifiers:{number:n}},r){let i=I(t);lx(e,"change",()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?et(lZ(e)):lZ(e));e[lW](e.multiple?i?new Set(t):t:t[0]),e._assigning=!0,t0(()=>{e._assigning=!1})}),e[lW]=lj(r)},mounted(e,{value:t}){lQ(e,t)},beforeUpdate(e,t,n){e[lW]=lj(n)},updated(e,{value:t}){e._assigning||lQ(e,t)}};function lQ(e,t){let n=e.multiple,r=A(t);if(!n||r||I(t)){for(let i=0,l=e.options.length;iString(e)===String(s)):l.selected=ey(t,s)>-1}else l.selected=t.has(s)}else if(eg(lZ(l),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}n||-1===e.selectedIndex||(e.selectedIndex=-1)}}function lZ(e){return"_value"in e?e._value:e.value}function lY(e,t){let n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}function l0(e,t,n,r,i){let l=function(e,t){switch(e){case"SELECT":return lX;case"TEXTAREA":return lK;default:switch(t){case"checkbox":return lz;case"radio":return lG;default:return lK}}}(e.tagName,n.props&&n.props.type)[i];l&&l(e,t,n,r)}let l1=["ctrl","shift","alt","meta"],l2={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&0!==e.button,middle:e=>"button"in e&&1!==e.button,right:e=>"button"in e&&2!==e.button,exact:(e,t)=>l1.some(n=>e[`${n}Key`]&&!t.includes(n))},l3={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},l6=k({patchProp:(e,t,n,r,i,l)=>{let s="svg"===i;"class"===t?function(e,t,n){let r=e[i3];r&&(t=(t?[t,...r]:[...r]).join(" ")),null==t?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}(e,r,s):"style"===t?function(e,t,n){let r=e.style,i=M(n),l=!1;if(n&&!i){if(t){if(M(t))for(let e of t.split(";")){let t=e.slice(0,e.indexOf(":")).trim();null==n[t]&&lg(r,t,"")}else for(let e in t)null==n[e]&&lg(r,e,"")}for(let e in n)"display"===e&&(l=!0),lg(r,e,n[e])}else if(i){if(t!==n){let e=r[lp];e&&(n+=";"+e),r.cssText=n,l=lh.test(n)}}else t&&e.removeAttribute("style");lc in e&&(e[lc]=l?r.display:"",e[lu]&&(r.display="none"))}(e,n,r):x(t)?C(t)||function(e,t,n,r,i=null){let l=e[lC]||(e[lC]={}),s=l[t];if(r&&s)s.value=r;else{let[n,o]=function(e){let t;if(lk.test(e)){let n;for(t={};n=e.match(lk);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[":"===e[2]?e.slice(3):G(e.slice(2)),t]}(t);r?lx(e,n,l[t]=function(e,t){let n=e=>{if(e._vts){if(e._vts<=n.attached)return}else e._vts=Date.now();tW(function(e,t){if(!A(t))return t;{let n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(e=>t=>!t._stopped&&e&&e(t))}}(e,n.value),t,5,[e])};return n.value=e,n.attached=lw(),n}(r,i),o):s&&(!function(e,t,n,r){e.removeEventListener(t,n,r)}(e,n,s,o),l[t]=void 0)}}(e,t,0,r,l):("."===t[0]?(t=t.slice(1),0):"^"===t[0]?(t=t.slice(1),1):!function(e,t,n,r){if(r)return!!("innerHTML"===t||"textContent"===t||t in e&&lA(t)&&P(n));if("spellcheck"===t||"draggable"===t||"translate"===t||"form"===t||"list"===t&&"INPUT"===e.tagName||"type"===t&&"TEXTAREA"===e.tagName)return!1;if("width"===t||"height"===t){let t=e.tagName;if("IMG"===t||"VIDEO"===t||"CANVAS"===t||"SOURCE"===t)return!1}return!(lA(t)&&M(n))&&t in e}(e,t,r,s))?e._isVueCE&&(/[A-Z]/.test(t)||!M(r))?lS(e,z(t),r,l,t):("true-value"===t?e._trueValue=r:"false-value"===t&&(e._falseValue=r),l_(e,t,r,s)):(lS(e,t,r),e.tagName.includes("-")||"value"!==t&&"checked"!==t&&"selected"!==t||l_(e,t,r,s,l,"value"!==t))}},{insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i="svg"===t?iY.createElementNS("http://www.w3.org/2000/svg",e):"mathml"===t?iY.createElementNS("http://www.w3.org/1998/Math/MathML",e):n?iY.createElement(e,{is:n}):iY.createElement(e);return"select"===e&&r&&null!=r.multiple&&i.setAttribute("multiple",r.multiple),i},createText:e=>iY.createTextNode(e),createComment:e=>iY.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>iY.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,i,l){let s=n?n.previousSibling:t.lastChild;if(i&&(i===l||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),i!==l&&(i=i.nextSibling););else{i0.innerHTML=iZ("svg"===r?`${e}`:"mathml"===r?`${e}`:e);let i=i0.content;if("svg"===r||"mathml"===r){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[s?s.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}}),l4=!1;function l8(){return p=l4?p:rU(l6),l4=!0,p}let l5=(...e)=>{(p||(p=rj(l6))).render(...e)},l9=(...e)=>{let t=(p||(p=rj(l6))).createApp(...e),{mount:n}=t;return t.mount=e=>{let r=st(e);if(!r)return;let i=t._component;P(i)||i.render||i.template||(i.template=r.innerHTML),1===r.nodeType&&(r.textContent="");let l=n(r,!1,se(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),l},t},l7=(...e)=>{let t=l8().createApp(...e),{mount:n}=t;return t.mount=e=>{let t=st(e);if(t)return n(t,!0,se(t))},t};function se(e){return e instanceof SVGElement?"svg":"function"==typeof MathMLElement&&e instanceof MathMLElement?"mathml":void 0}function st(e){return M(e)?document.querySelector(e):e}let sn=Symbol(""),sr=Symbol(""),si=Symbol(""),sl=Symbol(""),ss=Symbol(""),so=Symbol(""),sa=Symbol(""),sc=Symbol(""),su=Symbol(""),sd=Symbol(""),sp=Symbol(""),sf=Symbol(""),sh=Symbol(""),sm=Symbol(""),sg=Symbol(""),sy=Symbol(""),sv=Symbol(""),sb=Symbol(""),s_=Symbol(""),sS=Symbol(""),sx=Symbol(""),sC=Symbol(""),sk=Symbol(""),sT=Symbol(""),sN=Symbol(""),sw=Symbol(""),sA=Symbol(""),sE=Symbol(""),sI=Symbol(""),sR=Symbol(""),sO=Symbol(""),sP=Symbol(""),sM=Symbol(""),sL=Symbol(""),s$=Symbol(""),sD=Symbol(""),sF=Symbol(""),sV=Symbol(""),sB=Symbol(""),sU={[sn]:"Fragment",[sr]:"Teleport",[si]:"Suspense",[sl]:"KeepAlive",[ss]:"BaseTransition",[so]:"openBlock",[sa]:"createBlock",[sc]:"createElementBlock",[su]:"createVNode",[sd]:"createElementVNode",[sp]:"createCommentVNode",[sf]:"createTextVNode",[sh]:"createStaticVNode",[sm]:"resolveComponent",[sg]:"resolveDynamicComponent",[sy]:"resolveDirective",[sv]:"resolveFilter",[sb]:"withDirectives",[s_]:"renderList",[sS]:"renderSlot",[sx]:"createSlots",[sC]:"toDisplayString",[sk]:"mergeProps",[sT]:"normalizeClass",[sN]:"normalizeStyle",[sw]:"normalizeProps",[sA]:"guardReactiveProps",[sE]:"toHandlers",[sI]:"camelize",[sR]:"capitalize",[sO]:"toHandlerKey",[sP]:"setBlockTracking",[sM]:"pushScopeId",[sL]:"popScopeId",[s$]:"withCtx",[sD]:"unref",[sF]:"isRef",[sV]:"withMemo",[sB]:"isMemoSame"},sj={start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0},source:""};function sH(e,t,n,r,i,l,s,o=!1,a=!1,c=!1,u=sj){return e&&(o?(e.helper(so),e.helper(e.inSSR||c?sa:sc)):e.helper(e.inSSR||c?su:sd),s&&e.helper(sb)),{type:13,tag:t,props:n,children:r,patchFlag:i,dynamicProps:l,directives:s,isBlock:o,disableTracking:a,isComponent:c,loc:u}}function sq(e,t=sj){return{type:17,loc:t,elements:e}}function sW(e,t=sj){return{type:15,loc:t,properties:e}}function sK(e,t){return{type:16,loc:sj,key:M(e)?sz(e,!0):e,value:t}}function sz(e,t=!1,n=sj,r=0){return{type:4,loc:n,content:e,isStatic:t,constType:t?3:r}}function sJ(e,t=sj){return{type:8,loc:t,children:e}}function sG(e,t=[],n=sj){return{type:14,loc:n,callee:e,arguments:t}}function sX(e,t,n=!1,r=!1,i=sj){return{type:18,params:e,returns:t,newline:n,isSlot:r,loc:i}}function sQ(e,t,n,r=!0){return{type:19,test:e,consequent:t,alternate:n,newline:r,loc:sj}}function sZ(e,{helper:t,removeHelper:n,inSSR:r}){if(!e.isBlock){var i,l;e.isBlock=!0,n((i=e.isComponent,r||i?su:sd)),t(so),t((l=e.isComponent,r||l?sa:sc))}}let sY=new Uint8Array([123,123]),s0=new Uint8Array([125,125]);function s1(e){return e>=97&&e<=122||e>=65&&e<=90}function s2(e){return 32===e||10===e||9===e||12===e||13===e}function s3(e){return 47===e||62===e||s2(e)}function s6(e){let t=new Uint8Array(e.length);for(let n=0;n4===e.type&&e.isStatic;function oe(e){switch(e){case"Teleport":case"teleport":return sr;case"Suspense":case"suspense":return si;case"KeepAlive":case"keep-alive":return sl;case"BaseTransition":case"base-transition":return ss}}let ot=/^\d|[^\$\w\xA0-\uFFFF]/,on=e=>!ot.test(e),or=/[A-Za-z_$\xA0-\uFFFF]/,oi=/[\.\?\w$\xA0-\uFFFF]/,ol=/\s+[.[]\s*|\s*[.[]\s+/g,os=e=>4===e.type?e.content:e.loc.source,oo=e=>{let t=os(e).trim().replace(ol,e=>e.trim()),n=0,r=[],i=0,l=0,s=null;for(let e=0;e|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/,oc=e=>oa.test(os(e));function ou(e,t,n=!1){for(let r=0;r4===e.key.type&&e.key.content===r)}return n}function o_(e,t){return`_${t}_${e.replace(/[^\w]/g,(t,n)=>"-"===t?"_":e.charCodeAt(n).toString())}`}let oS=/([\s\S]*?)\s+(?:in|of)\s+(\S[\s\S]*)/,ox={parseMode:"base",ns:0,delimiters:["{{","}}"],getNamespace:()=>0,isVoidTag:S,isPreTag:S,isIgnoreNewlineTag:S,isCustomElement:S,onError:s8,onWarn:s5,comments:!1,prefixIdentifiers:!1},oC=ox,ok=null,oT="",oN=null,ow=null,oA="",oE=-1,oI=-1,oR=0,oO=!1,oP=null,oM=[],oL=new class{constructor(e,t){this.stack=e,this.cbs=t,this.state=1,this.buffer="",this.sectionStart=0,this.index=0,this.entityStart=0,this.baseState=1,this.inRCDATA=!1,this.inXML=!1,this.inVPre=!1,this.newlines=[],this.mode=0,this.delimiterOpen=sY,this.delimiterClose=s0,this.delimiterIndex=-1,this.currentSequence=void 0,this.sequenceIndex=0}get inSFCRoot(){return 2===this.mode&&0===this.stack.length}reset(){this.state=1,this.mode=0,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=1,this.inRCDATA=!1,this.currentSequence=void 0,this.newlines.length=0,this.delimiterOpen=sY,this.delimiterClose=s0}getPos(e){let t=1,n=e+1;for(let r=this.newlines.length-1;r>=0;r--){let i=this.newlines[r];if(e>i){t=r+2,n=e-i;break}}return{column:n,line:t,offset:e}}peek(){return this.buffer.charCodeAt(this.index+1)}stateText(e){60===e?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=5,this.sectionStart=this.index):this.inVPre||e!==this.delimiterOpen[0]||(this.state=2,this.delimiterIndex=0,this.stateInterpolationOpen(e))}stateInterpolationOpen(e){if(e===this.delimiterOpen[this.delimiterIndex]){if(this.delimiterIndex===this.delimiterOpen.length-1){let e=this.index+1-this.delimiterOpen.length;e>this.sectionStart&&this.cbs.ontext(this.sectionStart,e),this.state=3,this.sectionStart=e}else this.delimiterIndex++}else this.inRCDATA?(this.state=32,this.stateInRCDATA(e)):(this.state=1,this.stateText(e))}stateInterpolation(e){e===this.delimiterClose[0]&&(this.state=4,this.delimiterIndex=0,this.stateInterpolationClose(e))}stateInterpolationClose(e){e===this.delimiterClose[this.delimiterIndex]?this.delimiterIndex===this.delimiterClose.length-1?(this.cbs.oninterpolation(this.sectionStart,this.index+1),this.inRCDATA?this.state=32:this.state=1,this.sectionStart=this.index+1):this.delimiterIndex++:(this.state=3,this.stateInterpolation(e))}stateSpecialStartSequence(e){let t=this.sequenceIndex===this.currentSequence.length;if(t?s3(e):(32|e)===this.currentSequence[this.sequenceIndex]){if(!t){this.sequenceIndex++;return}}else this.inRCDATA=!1;this.sequenceIndex=0,this.state=6,this.stateInTagName(e)}stateInRCDATA(e){if(this.sequenceIndex===this.currentSequence.length){if(62===e||s2(e)){let t=this.index-this.currentSequence.length;if(this.sectionStart=e||(28===this.state?this.currentSequence===s4.CdataEnd?this.cbs.oncdata(this.sectionStart,e):this.cbs.oncomment(this.sectionStart,e):6===this.state||11===this.state||18===this.state||17===this.state||12===this.state||13===this.state||14===this.state||15===this.state||16===this.state||20===this.state||19===this.state||21===this.state||9===this.state||this.cbs.ontext(this.sectionStart,e))}emitCodePoint(e,t){}}(oM,{onerr:oQ,ontext(e,t){oB(oF(e,t),e,t)},ontextentity(e,t,n){oB(e,t,n)},oninterpolation(e,t){if(oO)return oB(oF(e,t),e,t);let n=e+oL.delimiterOpen.length,r=t-oL.delimiterClose.length;for(;s2(oT.charCodeAt(n));)n++;for(;s2(oT.charCodeAt(r-1));)r--;let i=oF(n,r);i.includes("&")&&(i=oC.decodeEntities(i,!1)),oz({type:5,content:oX(i,!1,oJ(n,r)),loc:oJ(e,t)})},onopentagname(e,t){let n=oF(e,t);oN={type:1,tag:n,ns:oC.getNamespace(n,oM[0],oC.ns),tagType:0,props:[],children:[],loc:oJ(e-1,t),codegenNode:void 0}},onopentagend(e){oV(e)},onclosetag(e,t){let n=oF(e,t);if(!oC.isVoidTag(n)){let r=!1;for(let e=0;e0&&oM[0].loc.start.offset;for(let n=0;n<=e;n++)oU(oM.shift(),t,n(7===e.type?e.rawName:e.name)===t)},onattribend(e,t){oN&&ow&&(oG(ow.loc,t),0!==e&&(oA.includes("&")&&(oA=oC.decodeEntities(oA,!0)),6===ow.type?("class"===ow.name&&(oA=oK(oA).trim()),ow.value={type:2,content:oA,loc:1===e?oJ(oE,oI):oJ(oE-1,oI+1)},oL.inSFCRoot&&"template"===oN.tag&&"lang"===ow.name&&oA&&"html"!==oA&&oL.enterRCDATA(s6("{let i=t.start.offset+n,l=i+e.length;return oX(e,!1,oJ(i,l),0,r?1:0)},o={source:s(l.trim(),n.indexOf(l,i.length)),value:void 0,key:void 0,index:void 0,finalized:!1},a=i.trim().replace(oD,"").trim(),c=i.indexOf(a),u=a.match(o$);if(u){let e;a=a.replace(o$,"").trim();let t=u[1].trim();if(t&&(e=n.indexOf(t,c+a.length),o.key=s(t,e,!0)),u[2]){let r=u[2].trim();r&&(o.index=s(r,n.indexOf(r,o.key?e+t.length:c+a.length),!0))}}return a&&(o.value=s(a,c,!0)),o}(ow.exp)))),(7!==ow.type||"pre"!==ow.name)&&oN.props.push(ow)),oA="",oE=oI=-1},oncomment(e,t){oC.comments&&oz({type:3,content:oF(e,t),loc:oJ(e-4,t+3)})},onend(){let e=oT.length;for(let t=0;t64&&n<91||oe(e)||oC.isBuiltInComponent&&oC.isBuiltInComponent(e)||oC.isNativeTag&&!oC.isNativeTag(e))return!0;for(let e=0;e=0;)n--;return n}let oH=new Set(["if","else","else-if","for","slot"]),oq=/\r\n/g;function oW(e,t){let n="preserve"!==oC.whitespace,r=!1;for(let t=0;t1)for(let i=0;i{n--};for(;nt===e:t=>e.test(t);return(e,r)=>{if(1===e.type){let{props:i}=e;if(3===e.tagType&&i.some(oh))return;let l=[];for(let s=0;s`${sU[e]}: _${sU[e]}`;function o5(e,t,{helper:n,push:r,newline:i,isTS:l}){let s=n("component"===t?sm:sy);for(let n=0;n3;t.push("["),n&&t.indent(),o7(e,t,n),n&&t.deindent(),t.push("]")}function o7(e,t,n=!1,r=!0){let{push:i,newline:l}=t;for(let s=0;se||"null")}([s,o,a,n,u]),t),r(")"),p&&r(")"),d&&(r(", "),ae(d,t),r(")"))}(e,t);break;case 14:!function(e,t){let{push:n,helper:r,pure:i}=t,l=M(e.callee)?e.callee:r(e.callee);i&&n(o4),n(l+"(",-2,e),o7(e.arguments,t),n(")")}(e,t);break;case 15:!function(e,t){let{push:n,indent:r,deindent:i,newline:l}=t,{properties:s}=e;if(!s.length){n("{}",-2,e);return}let o=s.length>1;n(o?"{":"{ "),o&&r();for(let e=0;e "),(a||o)&&(n("{"),r()),s?(a&&n("return "),A(s)?o9(s,t):ae(s,t)):o&&ae(o,t),(a||o)&&(i(),n("}")),c&&n(")")}(e,t);break;case 19:!function(e,t){let{test:n,consequent:r,alternate:i,newline:l}=e,{push:s,indent:o,deindent:a,newline:c}=t;if(4===n.type){let e=!on(n.content);e&&s("("),at(n,t),e&&s(")")}else s("("),ae(n,t),s(")");l&&o(),t.indentLevel++,l||s(" "),s("? "),ae(r,t),t.indentLevel--,l&&c(),l||s(" "),s(": ");let u=19===i.type;!u&&t.indentLevel++,ae(i,t),!u&&t.indentLevel--,l&&a(!0)}(e,t);break;case 20:!function(e,t){let{push:n,helper:r,indent:i,deindent:l,newline:s}=t,{needPauseTracking:o,needArraySpread:a}=e;a&&n("[...("),n(`_cache[${e.index}] || (`),o&&(i(),n(`${r(sP)}(-1`),e.inVOnce&&n(", true"),n("),"),s(),n("(")),n(`_cache[${e.index}] = `),ae(e.value,t),o&&(n(`).cacheIndex = ${e.index},`),s(),n(`${r(sP)}(1),`),s(),n(`_cache[${e.index}]`),l()),n(")"),a&&n(")]")}(e,t);break;case 21:o7(e.body,t,!0,!1)}}function at(e,t){let{content:n,isStatic:r}=e;t.push(r?JSON.stringify(n):n,-3,e)}function an(e,t){for(let n=0;n(function(e,t,n,r){if("else"!==t.name&&(!t.exp||!t.exp.content.trim())){let r=t.exp?t.exp.loc:e.loc;n.onError(s9(28,t.loc)),t.exp=sz("true",!1,r)}if("if"===t.name){var i;let l=ai(e,t),s={type:9,loc:oJ((i=e.loc).start.offset,i.end.offset),branches:[l]};if(n.replaceNode(s),r)return r(s,l,!0)}else{let i=n.parent.children,l=i.indexOf(e);for(;l-- >=-1;){let s=i[l];if(s&&3===s.type||s&&2===s.type&&!s.content.trim().length){n.removeNode(s);continue}if(s&&9===s.type){"else-if"===t.name&&void 0===s.branches[s.branches.length-1].condition&&n.onError(s9(30,e.loc)),n.removeNode();let i=ai(e,t);s.branches.push(i);let l=r&&r(s,i,!1);o3(i,n),l&&l(),n.currentNode=null}else n.onError(s9(30,e.loc));break}}})(e,t,n,(e,t,r)=>{let i=n.parent.children,l=i.indexOf(e),s=0;for(;l-- >=0;){let e=i[l];e&&9===e.type&&(s+=e.branches.length)}return()=>{r?e.codegenNode=al(t,s,n):function(e){for(;;)if(19===e.type){if(19!==e.alternate.type)return e;e=e.alternate}else 20===e.type&&(e=e.value)}(e.codegenNode).alternate=al(t,s+e.branches.length-1,n)}}));function ai(e,t){let n=3===e.tagType;return{type:10,loc:e.loc,condition:"else"===t.name?void 0:t.exp,children:n&&!ou(e,"for")?e.children:[e],userKey:od(e,"key"),isTemplateIf:n}}function al(e,t,n){return e.condition?sQ(e.condition,as(e,t,n),sG(n.helper(sp),['""',"true"])):as(e,t,n)}function as(e,t,n){let{helper:r}=n,i=sK("key",sz(`${t}`,!1,sj,2)),{children:l}=e,s=l[0];if(1!==l.length||1!==s.type){if(1!==l.length||11!==s.type)return sH(n,r(sn),sW([i]),l,64,void 0,void 0,!0,!1,!1,e.loc);{let e=s.codegenNode;return ov(e,i,n),e}}{let e=s.codegenNode,t=14===e.type&&e.callee===sV?e.arguments[1].returns:e;return 13===t.type&&sZ(t,n),ov(t,i,n),e}}let ao=(e,t,n)=>{let{modifiers:r,loc:i}=e,l=e.arg,{exp:s}=e;if(s&&4===s.type&&!s.content.trim()&&(s=void 0),!s){if(4!==l.type||!l.isStatic)return n.onError(s9(52,l.loc)),{props:[sK(l,sz("",!0,i))]};aa(e),s=e.exp}return 4!==l.type?(l.children.unshift("("),l.children.push(') || ""')):l.isStatic||(l.content=`${l.content} || ""`),r.some(e=>"camel"===e.content)&&(4===l.type?l.isStatic?l.content=z(l.content):l.content=`${n.helperString(sI)}(${l.content})`:(l.children.unshift(`${n.helperString(sI)}(`),l.children.push(")"))),!n.inSSR&&(r.some(e=>"prop"===e.content)&&ac(l,"."),r.some(e=>"attr"===e.content)&&ac(l,"^")),{props:[sK(l,s)]}},aa=(e,t)=>{let n=e.arg,r=z(n.content);e.exp=sz(r,!1,n.loc)},ac=(e,t)=>{4===e.type?e.isStatic?e.content=t+e.content:e.content=`\`${t}\${${e.content}}\``:(e.children.unshift(`'${t}' + (`),e.children.push(")"))},au=o6("for",(e,t,n)=>{let{helper:r,removeHelper:i}=n;return function(e,t,n,r){if(!t.exp){n.onError(s9(31,t.loc));return}let i=t.forParseResult;if(!i){n.onError(s9(32,t.loc));return}ad(i);let{addIdentifiers:l,removeIdentifiers:s,scopes:o}=n,{source:a,value:c,key:u,index:d}=i,p={type:11,loc:t.loc,source:a,valueAlias:c,keyAlias:u,objectIndexAlias:d,parseResult:i,children:om(e)?e.children:[e]};n.replaceNode(p),o.vFor++;let f=r&&r(p);return()=>{o.vFor--,f&&f()}}(e,t,n,t=>{let l=sG(r(s_),[t.source]),s=om(e),o=ou(e,"memo"),a=od(e,"key",!1,!0);a&&7===a.type&&!a.exp&&aa(a);let c=a&&(6===a.type?a.value?sz(a.value.content,!0):void 0:a.exp),u=a&&c?sK("key",c):null,d=4===t.source.type&&t.source.constType>0,p=d?64:a?128:256;return t.codegenNode=sH(n,r(sn),void 0,l,p,void 0,void 0,!0,!d,!1,e.loc),()=>{let a;let{children:p}=t,f=1!==p.length||1!==p[0].type,h=og(e)?e:s&&1===e.children.length&&og(e.children[0])?e.children[0]:null;if(h)a=h.codegenNode,s&&u&&ov(a,u,n);else if(f)a=sH(n,r(sn),u?sW([u]):void 0,e.children,64,void 0,void 0,!0,void 0,!1);else{var m,g,y,b,_,S,x,C;a=p[0].codegenNode,s&&u&&ov(a,u,n),!d!==a.isBlock&&(a.isBlock?(i(so),i((m=n.inSSR,g=a.isComponent,m||g?sa:sc))):i((y=n.inSSR,b=a.isComponent,y||b?su:sd))),(a.isBlock=!d,a.isBlock)?(r(so),r((_=n.inSSR,S=a.isComponent,_||S?sa:sc))):r((x=n.inSSR,C=a.isComponent,x||C?su:sd))}if(o){let e=sX(ap(t.parseResult,[sz("_cached")]));e.body={type:21,body:[sJ(["const _memo = (",o.exp,")"]),sJ(["if (_cached",...c?[" && _cached.key === ",c]:[],` && ${n.helperString(sB)}(_cached, _memo)) return _cached`]),sJ(["const _item = ",a]),sz("_item.memo = _memo"),sz("return _item")],loc:sj},l.arguments.push(e,sz("_cache"),sz(String(n.cached.length))),n.cached.push(null)}else l.arguments.push(sX(ap(t.parseResult),a,!0))}})});function ad(e,t){e.finalized||(e.finalized=!0)}function ap({value:e,key:t,index:n},r=[]){return function(e){let t=e.length;for(;t--&&!e[t];);return e.slice(0,t+1).map((e,t)=>e||sz("_".repeat(t+1),!1))}([e,t,n,...r])}let af=sz("undefined",!1),ah=(e,t)=>{if(1===e.type&&(1===e.tagType||3===e.tagType)){let n=ou(e,"slot");if(n)return n.exp,t.scopes.vSlot++,()=>{t.scopes.vSlot--}}},am=(e,t,n,r)=>sX(e,n,!1,!0,n.length?n[0].loc:r);function ag(e,t,n){let r=[sK("name",e),sK("fn",t)];return null!=n&&r.push(sK("key",sz(String(n),!0))),sW(r)}let ay=new WeakMap,av=(e,t)=>function(){let n,r,i,l,s;if(!(1===(e=t.currentNode).type&&(0===e.tagType||1===e.tagType)))return;let{tag:o,props:a}=e,c=1===e.tagType,u=c?function(e,t,n=!1){let{tag:r}=e,i=aS(r),l=od(e,"is",!1,!0);if(l){if(i){let e;if(6===l.type?e=l.value&&sz(l.value.content,!0):(e=l.exp)||(e=sz("is",!1,l.arg.loc)),e)return sG(t.helper(sg),[e])}else 6===l.type&&l.value.content.startsWith("vue:")&&(r=l.value.content.slice(4))}let s=oe(r)||t.isBuiltInComponent(r);return s?(n||t.helper(s),s):(t.helper(sm),t.components.add(r),o_(r,"component"))}(e,t):`"${o}"`,d=$(u)&&u.callee===sg,p=0,f=d||u===sr||u===si||!c&&("svg"===o||"foreignObject"===o||"math"===o);if(a.length>0){let r=ab(e,t,void 0,c,d);n=r.props,p=r.patchFlag,l=r.dynamicPropNames;let i=r.directives;s=i&&i.length?sq(i.map(e=>(function(e,t){let n=[],r=ay.get(e);r?n.push(t.helperString(r)):(t.helper(sy),t.directives.add(e.name),n.push(o_(e.name,"directive")));let{loc:i}=e;if(e.exp&&n.push(e.exp),e.arg&&(e.exp||n.push("void 0"),n.push(e.arg)),Object.keys(e.modifiers).length){e.arg||(e.exp||n.push("void 0"),n.push("void 0"));let t=sz("true",!1,i);n.push(sW(e.modifiers.map(e=>sK(e,t)),i))}return sq(n,e.loc)})(e,t))):void 0,r.shouldUseBlock&&(f=!0)}if(e.children.length>0){if(u===sl&&(f=!0,p|=1024),c&&u!==sr&&u!==sl){let{slots:n,hasDynamicSlots:i}=function(e,t,n=am){t.helper(s$);let{children:r,loc:i}=e,l=[],s=[],o=t.scopes.vSlot>0||t.scopes.vFor>0,a=ou(e,"slot",!0);if(a){let{arg:e,exp:t}=a;e&&!s7(e)&&(o=!0),l.push(sK(e||sz("default",!0),n(t,void 0,r,i)))}let c=!1,u=!1,d=[],p=new Set,f=0;for(let e=0;esK("default",n(e,void 0,t,i));c?d.length&&d.some(e=>(function e(t){return 2!==t.type&&12!==t.type||(2===t.type?!!t.content.trim():e(t.content))})(e))&&(u?t.onError(s9(39,d[0].loc)):l.push(e(void 0,d))):l.push(e(void 0,r))}let h=o?2:!function e(t){for(let n=0;n0,h=!1,m=0,g=!1,y=!1,b=!1,_=!1,S=!1,C=!1,k=[],T=e=>{u.length&&(d.push(sW(a_(u),a)),u=[]),e&&d.push(e)},N=()=>{t.scopes.vFor>0&&u.push(sK(sz("ref_for",!0),sz("true")))},w=({key:e,value:n})=>{if(s7(e)){let l=e.content,s=x(l);s&&(!r||i)&&"onclick"!==l.toLowerCase()&&"onUpdate:modelValue"!==l&&!H(l)&&(_=!0),s&&H(l)&&(C=!0),s&&14===n.type&&(n=n.arguments[0]),20===n.type||(4===n.type||8===n.type)&&oY(n,t)>0||("ref"===l?g=!0:"class"===l?y=!0:"style"===l?b=!0:"key"===l||k.includes(l)||k.push(l),r&&("class"===l||"style"===l)&&!k.includes(l)&&k.push(l))}else S=!0};for(let i=0;i"prop"===e.content)&&(m|=32);let x=t.directiveTransforms[n];if(x){let{props:n,needRuntime:r}=x(s,e,t);l||n.forEach(w),_&&i&&!s7(i)?T(sW(n,a)):u.push(...n),r&&(p.push(s),L(r)&&ay.set(s,r))}else!q(n)&&(p.push(s),f&&(h=!0))}}if(d.length?(T(),s=d.length>1?sG(t.helper(sk),d,a):d[0]):u.length&&(s=sW(a_(u),a)),S?m|=16:(y&&!r&&(m|=2),b&&!r&&(m|=4),k.length&&(m|=8),_&&(m|=32)),!h&&(0===m||32===m)&&(g||C||p.length>0)&&(m|=512),!t.inSSR&&s)switch(s.type){case 15:let A=-1,E=-1,I=!1;for(let e=0;e{if(og(e)){let{children:n,loc:r}=e,{slotName:i,slotProps:l}=function(e,t){let n,r='"default"',i=[];for(let t=0;t0){let{props:r,directives:l}=ab(e,t,i,!1,!1);n=r,l.length&&t.onError(s9(36,l[0].loc))}return{slotName:r,slotProps:n}}(e,t),s=[t.prefixIdentifiers?"_ctx.$slots":"$slots",i,"{}","undefined","true"],o=2;l&&(s[2]=l,o=3),n.length&&(s[3]=sX([],n,!1,!1,r),o=4),t.scopeId&&!t.slotted&&(o=5),s.splice(o),e.codegenNode=sG(t.helper(sS),s,r)}},aC=(e,t,n,r)=>{let i;let{loc:l,modifiers:s,arg:o}=e;if(e.exp||s.length,4===o.type){if(o.isStatic){let e=o.content;e.startsWith("vue:")&&(e=`vnode-${e.slice(4)}`),i=sz(0!==t.tagType||e.startsWith("vnode")||!/[A-Z]/.test(e)?Q(z(e)):`on:${e}`,!0,o.loc)}else i=sJ([`${n.helperString(sO)}(`,o,")"])}else(i=o).children.unshift(`${n.helperString(sO)}(`),i.children.push(")");let a=e.exp;a&&!a.content.trim()&&(a=void 0);let c=n.cacheHandlers&&!a&&!n.inVOnce;if(a){let e=oo(a),t=!(e||oc(a)),n=a.content.includes(";");(t||c&&e)&&(a=sJ([`${t?"$event":"(...args)"} => ${n?"{":"("}`,a,n?"}":")"]))}let u={props:[sK(i,a||sz("() => {}",!1,l))]};return r&&(u=r(u)),c&&(u.props[0].value=n.cache(u.props[0].value)),u.props.forEach(e=>e.key.isHandlerKey=!0),u},ak=(e,t)=>{if(0===e.type||1===e.type||11===e.type||10===e.type)return()=>{let n;let r=e.children,i=!1;for(let e=0;e7===e.type&&!t.directiveTransforms[e.name]))))for(let e=0;e{if(1===e.type&&ou(e,"once",!0)&&!aT.has(e)&&!t.inVOnce&&!t.inSSR)return aT.add(e),t.inVOnce=!0,t.helper(sP),()=>{t.inVOnce=!1;let e=t.currentNode;e.codegenNode&&(e.codegenNode=t.cache(e.codegenNode,!0,!0))}},aw=(e,t,n)=>{let r;let{exp:i,arg:l}=e;if(!i)return n.onError(s9(41,e.loc)),aA();let s=i.loc.source.trim(),o=4===i.type?i.content:s,a=n.bindingMetadata[s];if("props"===a||"props-aliased"===a)return i.loc,aA();if(!o.trim()||!oo(i))return n.onError(s9(42,i.loc)),aA();let c=l||sz("modelValue",!0),u=l?s7(l)?`onUpdate:${z(l.content)}`:sJ(['"onUpdate:" + ',l]):"onUpdate:modelValue",d=n.isTS?"($event: any)":"$event";r=sJ([`${d} => ((`,i,") = $event)"]);let p=[sK(c,e.exp),sK(u,r)];if(e.modifiers.length&&1===t.tagType){let t=e.modifiers.map(e=>e.content).map(e=>(on(e)?e:JSON.stringify(e))+": true").join(", "),n=l?s7(l)?`${l.content}Modifiers`:sJ([l,' + "Modifiers"']):"modelModifiers";p.push(sK(n,sz(`{ ${t} }`,!1,e.loc,2)))}return aA(p)};function aA(e=[]){return{props:e}}let aE=new WeakSet,aI=(e,t)=>{if(1===e.type){let n=ou(e,"memo");if(!(!n||aE.has(e)))return aE.add(e),()=>{let r=e.codegenNode||t.currentNode.codegenNode;r&&13===r.type&&(1!==e.tagType&&sZ(r,t),e.codegenNode=sG(t.helper(sV),[n.exp,sX(void 0,r),"_cache",String(t.cached.length)]),t.cached.push(null))}}},aR=Symbol(""),aO=Symbol(""),aP=Symbol(""),aM=Symbol(""),aL=Symbol(""),a$=Symbol(""),aD=Symbol(""),aF=Symbol(""),aV=Symbol(""),aB=Symbol("");!function(e){Object.getOwnPropertySymbols(e).forEach(t=>{sU[t]=e[t]})}({[aR]:"vModelRadio",[aO]:"vModelCheckbox",[aP]:"vModelText",[aM]:"vModelSelect",[aL]:"vModelDynamic",[a$]:"withModifiers",[aD]:"withKeys",[aF]:"vShow",[aV]:"Transition",[aB]:"TransitionGroup"});let aU={parseMode:"html",isVoidTag:eh,isNativeTag:e=>ed(e)||ep(e)||ef(e),isPreTag:e=>"pre"===e,isIgnoreNewlineTag:e=>"pre"===e||"textarea"===e,decodeEntities:function(e,t=!1){return(f||(f=document.createElement("div")),t)?(f.innerHTML=`
`,f.children[0].getAttribute("foo")):(f.innerHTML=e,f.textContent)},isBuiltInComponent:e=>"Transition"===e||"transition"===e?aV:"TransitionGroup"===e||"transition-group"===e?aB:void 0,getNamespace(e,t,n){let r=t?t.ns:n;if(t&&2===r){if("annotation-xml"===t.tag){if("svg"===e)return 1;t.props.some(e=>6===e.type&&"encoding"===e.name&&null!=e.value&&("text/html"===e.value.content||"application/xhtml+xml"===e.value.content))&&(r=0)}else/^m(?:[ions]|text)$/.test(t.tag)&&"mglyph"!==e&&"malignmark"!==e&&(r=0)}else t&&1===r&&("foreignObject"===t.tag||"desc"===t.tag||"title"===t.tag)&&(r=0);if(0===r){if("svg"===e)return 1;if("math"===e)return 2}return r}},aj=(e,t)=>sz(JSON.stringify(ec(e)),!1,t,3),aH=g("passive,once,capture"),aq=g("stop,prevent,self,ctrl,shift,alt,meta,exact,middle"),aW=g("left,right"),aK=g("onkeyup,onkeydown,onkeypress"),az=(e,t,n,r)=>{let i=[],l=[],s=[];for(let n=0;ns7(e)&&"onclick"===e.content.toLowerCase()?sz(t,!0):4!==e.type?sJ(["(",e,`) === "onClick" ? "${t}" : (`,e,")"]):e,aG=(e,t)=>{1===e.type&&0===e.tagType&&("script"===e.tag||"style"===e.tag)&&t.removeNode()},aX=[e=>{1===e.type&&e.props.forEach((t,n)=>{6===t.type&&"style"===t.name&&t.value&&(e.props[n]={type:7,name:"bind",arg:sz("style",!0,t.loc),exp:aj(t.value.content,t.loc),modifiers:[],loc:t.loc})})}],aQ={cloak:()=>({props:[]}),html:(e,t,n)=>{let{exp:r,loc:i}=e;return r||n.onError(s9(53,i)),t.children.length&&(n.onError(s9(54,i)),t.children.length=0),{props:[sK(sz("innerHTML",!0,i),r||sz("",!0))]}},text:(e,t,n)=>{let{exp:r,loc:i}=e;return r||n.onError(s9(55,i)),t.children.length&&(n.onError(s9(56,i)),t.children.length=0),{props:[sK(sz("textContent",!0),r?oY(r,n)>0?r:sG(n.helperString(sC),[r],i):sz("",!0))]}},model:(e,t,n)=>{let r=aw(e,t,n);if(!r.props.length||1===t.tagType)return r;e.arg&&n.onError(s9(58,e.arg.loc));let{tag:i}=t,l=n.isCustomElement(i);if("input"===i||"textarea"===i||"select"===i||l){let s=aP,o=!1;if("input"===i||l){let r=od(t,"type");if(r){if(7===r.type)s=aL;else if(r.value)switch(r.value.content){case"radio":s=aR;break;case"checkbox":s=aO;break;case"file":o=!0,n.onError(s9(59,e.loc))}}else t.props.some(e=>7===e.type&&"bind"===e.name&&(!e.arg||4!==e.arg.type||!e.arg.isStatic))&&(s=aL)}else"select"===i&&(s=aM);o||(r.needRuntime=n.helper(s))}else n.onError(s9(57,e.loc));return r.props=r.props.filter(e=>!(4===e.key.type&&"modelValue"===e.key.content)),r},on:(e,t,n)=>aC(e,t,n,t=>{let{modifiers:r}=e;if(!r.length)return t;let{key:i,value:l}=t.props[0],{keyModifiers:s,nonKeyModifiers:o,eventOptionModifiers:a}=az(i,r,n,e.loc);if(o.includes("right")&&(i=aJ(i,"onContextmenu")),o.includes("middle")&&(i=aJ(i,"onMouseup")),o.length&&(l=sG(n.helper(a$),[l,JSON.stringify(o)])),s.length&&(!s7(i)||aK(i.content.toLowerCase()))&&(l=sG(n.helper(aD),[l,JSON.stringify(s)])),a.length){let e=a.map(X).join("");i=s7(i)?sz(`${i.content}${e}`,!0):sJ(["(",i,`) + "${e}"`])}return{props:[sK(i,l)]}}),show:(e,t,n)=>{let{exp:r,loc:i}=e;return!r&&n.onError(s9(61,i)),{props:[],needRuntime:n.helper(aF)}}},aZ=Object.create(null);function aY(e,t){if(!M(e)){if(!e.nodeType)return _;e=e.innerHTML}let n=e+JSON.stringify(t,(e,t)=>"function"==typeof t?t.toString():t),r=aZ[n];if(r)return r;if("#"===e[0]){let t=document.querySelector(e);e=t?t.innerHTML:""}let i=k({hoistStatic:!0,onError:void 0,onWarn:_},t);i.isCustomElement||"undefined"==typeof customElements||(i.isCustomElement=e=>!!customElements.get(e));let{code:l}=function(e,t={}){return function(e,t={}){let n=t.onError||s8,r="module"===t.mode;!0===t.prefixIdentifiers?n(s9(47)):r&&n(s9(48)),t.cacheHandlers&&n(s9(49)),t.scopeId&&!r&&n(s9(50));let i=k({},t,{prefixIdentifiers:!1}),l=M(e)?function(e,t){if(oL.reset(),oN=null,ow=null,oA="",oE=-1,oI=-1,oM.length=0,oT=e,oC=k({},ox),t){let e;for(e in t)null!=t[e]&&(oC[e]=t[e])}oL.mode="html"===oC.parseMode?1:"sfc"===oC.parseMode?2:0,oL.inXML=1===oC.ns||2===oC.ns;let n=t&&t.delimiters;n&&(oL.delimiterOpen=s6(n[0]),oL.delimiterClose=s6(n[1]));let r=ok=function(e,t=""){return{type:0,source:t,children:e,helpers:new Set,components:[],directives:[],hoists:[],imports:[],cached:[],temps:0,codegenNode:void 0,loc:sj}}([],e);return oL.parse(oT),r.loc=oJ(0,e.length),r.children=oW(r.children),ok=null,r}(e,i):e,[s,o]=[[aN,ar,aI,au,ax,av,ah,ak],{on:aC,bind:ao,model:aw}];return!function(e,t){let n=function(e,{filename:t="",prefixIdentifiers:n=!1,hoistStatic:r=!1,hmr:i=!1,cacheHandlers:l=!1,nodeTransforms:s=[],directiveTransforms:o={},transformHoist:a=null,isBuiltInComponent:c=_,isCustomElement:u=_,expressionPlugins:d=[],scopeId:p=null,slotted:f=!0,ssr:h=!1,inSSR:m=!1,ssrCssVars:g="",bindingMetadata:b=y,inline:S=!1,isTS:x=!1,onError:C=s8,onWarn:k=s5,compatConfig:T}){let N=t.replace(/\?.*$/,"").match(/([^/\\]+)\.\w+$/),w={filename:t,selfName:N&&X(z(N[1])),prefixIdentifiers:n,hoistStatic:r,hmr:i,cacheHandlers:l,nodeTransforms:s,directiveTransforms:o,transformHoist:a,isBuiltInComponent:c,isCustomElement:u,expressionPlugins:d,scopeId:p,slotted:f,ssr:h,inSSR:m,ssrCssVars:g,bindingMetadata:b,inline:S,isTS:x,onError:C,onWarn:k,compatConfig:T,root:e,helpers:new Map,components:new Set,directives:new Set,hoists:[],imports:[],cached:[],constantCache:new WeakMap,temps:0,identifiers:Object.create(null),scopes:{vFor:0,vSlot:0,vPre:0,vOnce:0},parent:null,grandParent:null,currentNode:e,childIndex:0,inVOnce:!1,helper(e){let t=w.helpers.get(e)||0;return w.helpers.set(e,t+1),e},removeHelper(e){let t=w.helpers.get(e);if(t){let n=t-1;n?w.helpers.set(e,n):w.helpers.delete(e)}},helperString:e=>`_${sU[w.helper(e)]}`,replaceNode(e){w.parent.children[w.childIndex]=w.currentNode=e},removeNode(e){let t=w.parent.children,n=e?t.indexOf(e):w.currentNode?w.childIndex:-1;e&&e!==w.currentNode?w.childIndex>n&&(w.childIndex--,w.onNodeRemoved()):(w.currentNode=null,w.onNodeRemoved()),w.parent.children.splice(n,1)},onNodeRemoved:_,addIdentifiers(e){},removeIdentifiers(e){},hoist(e){M(e)&&(e=sz(e)),w.hoists.push(e);let t=sz(`_hoisted_${w.hoists.length}`,!1,e.loc,2);return t.hoisted=e,t},cache(e,t=!1,n=!1){let r=function(e,t,n=!1,r=!1){return{type:20,index:e,value:t,needPauseTracking:n,inVOnce:r,needArraySpread:!1,loc:sj}}(w.cached.length,e,t,n);return w.cached.push(r),r}};return w}(e,t);o3(e,n),t.hoistStatic&&function e(t,n,r,i=!1,l=!1){let{children:s}=t,o=[];for(let n=0;n0){if(e>=2){a.codegenNode.patchFlag=-1,o.push(a);continue}}else{let e=a.codegenNode;if(13===e.type){let t=e.patchFlag;if((void 0===t||512===t||1===t)&&o1(a,r)>=2){let t=o2(a);t&&(e.props=r.hoist(t))}e.dynamicProps&&(e.dynamicProps=r.hoist(e.dynamicProps))}}}else if(12===a.type&&(i?0:oY(a,r))>=2){o.push(a);continue}if(1===a.type){let n=1===a.tagType;n&&r.scopes.vSlot++,e(a,t,r,!1,l),n&&r.scopes.vSlot--}else if(11===a.type)e(a,t,r,1===a.children.length,!0);else if(9===a.type)for(let n=0;ne.key===t||e.key.content===t);return n&&n.value}}o.length&&r.transformHoist&&r.transformHoist(s,r,t)}(e,void 0,n,oZ(e,e.children[0])),t.ssr||function(e,t){let{helper:n}=t,{children:r}=e;if(1===r.length){let n=r[0];if(oZ(e,n)&&n.codegenNode){let r=n.codegenNode;13===r.type&&sZ(r,t),e.codegenNode=r}else e.codegenNode=n}else r.length>1&&(e.codegenNode=sH(t,n(sn),void 0,e.children,64,void 0,void 0,!0,void 0,!1))}(e,n),e.helpers=new Set([...n.helpers.keys()]),e.components=[...n.components],e.directives=[...n.directives],e.imports=n.imports,e.hoists=n.hoists,e.temps=n.temps,e.cached=n.cached,e.transformed=!0}(l,k({},i,{nodeTransforms:[...s,...t.nodeTransforms||[]],directiveTransforms:k({},o,t.directiveTransforms||{})})),function(e,t={}){let n=function(e,{mode:t="function",prefixIdentifiers:n="module"===t,sourceMap:r=!1,filename:i="template.vue.html",scopeId:l=null,optimizeImports:s=!1,runtimeGlobalName:o="Vue",runtimeModuleName:a="vue",ssrRuntimeModuleName:c="vue/server-renderer",ssr:u=!1,isTS:d=!1,inSSR:p=!1}){let f={mode:t,prefixIdentifiers:n,sourceMap:r,filename:i,scopeId:l,optimizeImports:s,runtimeGlobalName:o,runtimeModuleName:a,ssrRuntimeModuleName:c,ssr:u,isTS:d,inSSR:p,source:e.source,code:"",column:1,line:1,offset:0,indentLevel:0,pure:!1,map:void 0,helper:e=>`_${sU[e]}`,push(e,t=-2,n){f.code+=e},indent(){h(++f.indentLevel)},deindent(e=!1){e?--f.indentLevel:h(--f.indentLevel)},newline(){h(f.indentLevel)}};function h(e){f.push("\n"+" ".repeat(e),0)}return f}(e,t);t.onContextCreated&&t.onContextCreated(n);let{mode:r,push:i,prefixIdentifiers:l,indent:s,deindent:o,newline:a,scopeId:c,ssr:u}=n,d=Array.from(e.helpers),p=d.length>0,f=!l&&"module"!==r;(function(e,t){let{ssr:n,prefixIdentifiers:r,push:i,newline:l,runtimeModuleName:s,runtimeGlobalName:o,ssrRuntimeModuleName:a}=t,c=Array.from(e.helpers);if(c.length>0&&(i(`const _Vue = ${o} -`,-1),e.hoists.length)){let e=[su,sd,sp,sf,sh].filter(e=>c.includes(e)).map(o8).join(", ");i(`const { ${e} } = _Vue -`,-1)}(function(e,t){if(!e.length)return;t.pure=!0;let{push:n,newline:r}=t;r();for(let i=0;i0)&&a()),e.directives.length&&(o5(e.directives,"directive",n),e.temps>0&&a()),e.temps>0){i("let ");for(let t=0;t0?", ":""}_temp${t}`)}return(e.components.length||e.directives.length||e.temps)&&(i(` -`,0),a()),u||i("return "),e.codegenNode?ae(e.codegenNode,n):i("null"),f&&(o(),i("}")),o(),i("}"),{ast:e,code:n.code,preamble:"",map:n.map?n.map.toJSON():void 0}}(l,i)}(e,k({},aU,t,{nodeTransforms:[aG,...aX,...t.nodeTransforms||[]],directiveTransforms:k({},aQ,t.directiveTransforms||{}),transformHoist:null}))}(e,i),s=Function(l)();return s._rc=!0,aZ[n]=s}return iU(aY),e.BaseTransition=n_,e.BaseTransitionPropsValidators=ny,e.Comment=io,e.DeprecationTypes=null,e.EffectScope=ex,e.ErrorCodes={SETUP_FUNCTION:0,0:"SETUP_FUNCTION",RENDER_FUNCTION:1,1:"RENDER_FUNCTION",NATIVE_EVENT_HANDLER:5,5:"NATIVE_EVENT_HANDLER",COMPONENT_EVENT_HANDLER:6,6:"COMPONENT_EVENT_HANDLER",VNODE_HOOK:7,7:"VNODE_HOOK",DIRECTIVE_HOOK:8,8:"DIRECTIVE_HOOK",TRANSITION_HOOK:9,9:"TRANSITION_HOOK",APP_ERROR_HANDLER:10,10:"APP_ERROR_HANDLER",APP_WARN_HANDLER:11,11:"APP_WARN_HANDLER",FUNCTION_REF:12,12:"FUNCTION_REF",ASYNC_COMPONENT_LOADER:13,13:"ASYNC_COMPONENT_LOADER",SCHEDULER:14,14:"SCHEDULER",COMPONENT_UPDATE:15,15:"COMPONENT_UPDATE",APP_UNMOUNT_CLEANUP:16,16:"APP_UNMOUNT_CLEANUP"},e.ErrorTypeStrings=null,e.Fragment=il,e.KeepAlive={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){let n=iL(),r=n.ctx,i=new Map,l=new Set,s=null,o=n.suspense,{renderer:{p:a,m:c,um:u,o:{createElement:d}}}=r,p=d("div");function f(e){nG(e),u(e,n,o,!0)}function h(e){i.forEach((t,n)=>{let r=iK(t.type);r&&!e(r)&&m(n)})}function m(e){let t=i.get(e);!t||s&&ib(t,s)?s&&nG(s):f(t),i.delete(e),l.delete(e)}r.activate=(e,t,n,r,i)=>{let l=e.component;c(e,t,n,0,o),a(l.vnode,e,t,n,l,o,r,e.slotScopeIds,i),rB(()=>{l.isDeactivated=!1,l.a&&Y(l.a);let t=e.props&&e.props.onVnodeMounted;t&&iR(t,l.parent,e)},o)},r.deactivate=e=>{let t=e.component;rz(t.m),rz(t.a),c(e,p,null,1,o),rB(()=>{t.da&&Y(t.da);let n=e.props&&e.props.onVnodeUnmounted;n&&iR(n,t.parent,e),t.isDeactivated=!0},o)},rX(()=>[e.include,e.exclude],([e,t])=>{e&&h(t=>nW(e,t)),t&&h(e=>!nW(t,e))},{flush:"post",deep:!0});let g=null,y=()=>{null!=g&&(r5(n.subTree.type)?rB(()=>{i.set(g,nX(n.subTree))},n.subTree.suspense):i.set(g,nX(n.subTree)))};return n0(y),n2(y),n3(()=>{i.forEach(e=>{let{subTree:t,suspense:r}=n,i=nX(t);if(e.type===i.type&&e.key===i.key){nG(i);let e=i.component.da;e&&rB(e,r);return}f(e)})}),()=>{if(g=null,!t.default)return s=null;let n=t.default(),r=n[0];if(n.length>1)return s=null,n;if(!iv(r)||!(4&r.shapeFlag)&&!(128&r.shapeFlag))return s=null,r;let o=nX(r);if(o.type===io)return s=null,o;let a=o.type,c=iK(nj(o)?o.type.__asyncResolved||{}:a),{include:u,exclude:d,max:p}=e;if(u&&(!c||!nW(u,c))||d&&c&&nW(d,c))return o.shapeFlag&=-257,s=o,r;let f=null==o.key?a:o.key,h=i.get(f);return o.el&&(o=iT(o),128&r.shapeFlag&&(r.ssContent=o)),g=f,h?(o.el=h.el,o.component=h.component,o.transition&&nT(o,o.transition),o.shapeFlag|=512,l.delete(f),l.add(f)):(l.add(f),p&&l.size>parseInt(p,10)&&m(l.values().next().value)),o.shapeFlag|=256,s=o,r5(r.type)?r:o}}},e.ReactiveEffect=ek,e.Static=ia,e.Suspense={name:"Suspense",__isSuspense:!0,process(e,t,n,r,i,l,s,o,a,c){if(null==e)(function(e,t,n,r,i,l,s,o,a){let{p:c,o:{createElement:u}}=a,d=u("div"),p=e.suspense=ie(e,i,r,t,d,n,l,s,o,a);c(null,p.pendingBranch=e.ssContent,d,null,r,p,l,s),p.deps>0?(r7(e,"onPending"),r7(e,"onFallback"),c(null,e.ssFallback,t,n,r,null,l,s),ii(p,e.ssFallback)):p.resolve(!1,!0)})(t,n,r,i,l,s,o,a,c);else{if(l&&l.deps>0&&!e.suspense.isInFallback){t.suspense=e.suspense,t.suspense.vnode=t,t.el=e.el;return}(function(e,t,n,r,i,l,s,o,{p:a,um:c,o:{createElement:u}}){let d=t.suspense=e.suspense;d.vnode=t,t.el=e.el;let p=t.ssContent,f=t.ssFallback,{activeBranch:h,pendingBranch:m,isInFallback:g,isHydrating:y}=d;if(m)d.pendingBranch=p,ib(p,m)?(a(m,p,d.hiddenContainer,null,i,d,l,s,o),d.deps<=0?d.resolve():g&&!y&&(a(h,f,n,r,i,null,l,s,o),ii(d,f))):(d.pendingId=r9++,y?(d.isHydrating=!1,d.activeBranch=m):c(m,i,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u("div"),g?(a(null,p,d.hiddenContainer,null,i,d,l,s,o),d.deps<=0?d.resolve():(a(h,f,n,r,i,null,l,s,o),ii(d,f))):h&&ib(p,h)?(a(h,p,n,r,i,d,l,s,o),d.resolve(!0)):(a(null,p,d.hiddenContainer,null,i,d,l,s,o),d.deps<=0&&d.resolve()));else if(h&&ib(p,h))a(h,p,n,r,i,d,l,s,o),ii(d,p);else if(r7(t,"onPending"),d.pendingBranch=p,512&p.shapeFlag?d.pendingId=p.component.suspenseId:d.pendingId=r9++,a(null,p,d.hiddenContainer,null,i,d,l,s,o),d.deps<=0)d.resolve();else{let{timeout:e,pendingId:t}=d;e>0?setTimeout(()=>{d.pendingId===t&&d.fallback(f)},e):0===e&&d.fallback(f)}})(e,t,n,r,i,s,o,a,c)}},hydrate:function(e,t,n,r,i,l,s,o,a){let c=t.suspense=ie(t,r,n,e.parentNode,document.createElement("div"),null,i,l,s,o,!0),u=a(e,c.pendingBranch=t.ssContent,n,c,l,s);return 0===c.deps&&c.resolve(!1,!0),u},normalize:function(e){let{shapeFlag:t,children:n}=e,r=32&t;e.ssContent=it(r?n.default:n),e.ssFallback=r?it(n.fallback):iC(io)}},e.Teleport=nc,e.Text=is,e.TrackOpTypes={GET:"get",HAS:"has",ITERATE:"iterate"},e.Transition=i8,e.TransitionGroup=lF,e.TriggerOpTypes={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},e.VueElement=lO,e.assertNumber=function(e,t){},e.callWithAsyncErrorHandling=tW,e.callWithErrorHandling=tq,e.camelize=z,e.capitalize=X,e.cloneVNode=iT,e.compatUtils=null,e.compile=aY,e.computed=iz,e.createApp=l9,e.createBlock=iy,e.createCommentVNode=function(e="",t=!1){return t?(id(),iy(io,null,e)):iC(io,null,e)},e.createElementBlock=function(e,t,n,r,i,l){return ig(ix(e,t,n,r,i,l,!0))},e.createElementVNode=ix,e.createHydrationRenderer=rU,e.createPropsRestProxy=function(e,t){let n={};for(let r in e)t.includes(r)||Object.defineProperty(n,r,{enumerable:!0,get:()=>e[r]});return n},e.createRenderer=function(e){return rj(e)},e.createSSRApp=l7,e.createSlots=function(e,t){for(let n=0;n{let t=r.fn(...e);return t&&(t.key=r.key),t}:r.fn)}return e},e.createStaticVNode=function(e,t){let n=iC(ia,null,e);return n.staticCount=t,n},e.createTextVNode=iN,e.createVNode=iC,e.customRef=tL,e.defineAsyncComponent=function(e){let t;P(e)&&(e={loader:e});let{loader:n,loadingComponent:r,errorComponent:i,delay:l=200,hydrate:s,timeout:o,suspensible:a=!0,onError:c}=e,u=null,d=0,p=()=>(d++,u=null,f()),f=()=>{let e;return u||(e=u=n().catch(e=>{if(e=e instanceof Error?e:Error(String(e)),c)return new Promise((t,n)=>{c(e,()=>t(p()),()=>n(e),d+1)});throw e}).then(n=>e!==u&&u?u:(n&&(n.__esModule||"Module"===n[Symbol.toStringTag])&&(n=n.default),t=n,n)))};return nw({name:"AsyncComponentWrapper",__asyncLoader:f,__asyncHydrate(e,n,r){let i=s?()=>{let t=s(r,t=>(function(e,t){if(nL(e)&&"["===e.data){let n=1,r=e.nextSibling;for(;r;){if(1===r.nodeType){if(!1===t(r))break}else if(nL(r)){if("]"===r.data){if(0==--n)break}else"["===r.data&&n++}r=r.nextSibling}}else t(e)})(e,t));t&&(n.bum||(n.bum=[])).push(t)}:r;t?i():f().then(()=>!n.isUnmounted&&i())},get __asyncResolved(){return t},setup(){let e=iM;if(nA(e),t)return()=>nH(t,e);let n=t=>{u=null,tK(t,e,13,!i)};if(a&&e.suspense)return f().then(t=>()=>nH(t,e)).catch(e=>(n(e),()=>i?iC(i,{error:e}):null));let s=tw(!1),c=tw(),d=tw(!!l);return l&&setTimeout(()=>{d.value=!1},l),null!=o&&setTimeout(()=>{if(!s.value&&!c.value){let e=Error(`Async component timed out after ${o}ms.`);n(e),c.value=e}},o),f().then(()=>{s.value=!0,e.parent&&nq(e.parent.vnode)&&e.parent.update()}).catch(e=>{n(e),c.value=e}),()=>s.value&&t?nH(t,e):c.value&&i?iC(i,{error:c.value}):r&&!d.value?iC(r):void 0}})},e.defineComponent=nw,e.defineCustomElement=lI,e.defineEmits=function(){return null},e.defineExpose=function(e){},e.defineModel=function(){},e.defineOptions=function(e){},e.defineProps=function(){return null},e.defineSSRCustomElement=(e,t)=>lI(e,t,l7),e.defineSlots=function(){return null},e.devtools=void 0,e.effect=function(e,t){e.effect instanceof ek&&(e=e.effect.fn);let n=new ek(e);t&&k(n,t);try{n.run()}catch(e){throw n.stop(),e}let r=n.run.bind(n);return r.effect=n,r},e.effectScope=function(e){return new ex(e)},e.getCurrentInstance=iL,e.getCurrentScope=function(){return i},e.getCurrentWatcher=function(){return h},e.getTransitionRawChildren=nN,e.guardReactiveProps=ik,e.h=iJ,e.handleError=tK,e.hasInjectionContext=function(){return!!(iM||t5||rx)},e.hydrate=(...e)=>{l8().hydrate(...e)},e.hydrateOnIdle=(e=1e4)=>t=>{let n=nB(t,{timeout:e});return()=>nU(n)},e.hydrateOnInteraction=(e=[])=>(t,n)=>{M(e)&&(e=[e]);let r=!1,i=e=>{r||(r=!0,l(),t(),e.target.dispatchEvent(new e.constructor(e.type,e)))},l=()=>{n(t=>{for(let n of e)t.removeEventListener(n,i)})};return n(t=>{for(let n of e)t.addEventListener(n,i,{once:!0})}),l},e.hydrateOnMediaQuery=e=>t=>{if(e){let n=matchMedia(e);if(!n.matches)return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t);t()}},e.hydrateOnVisible=e=>(t,n)=>{let r=new IntersectionObserver(e=>{for(let n of e)if(n.isIntersecting){r.disconnect(),t();break}},e);return n(e=>{if(e instanceof Element){if(function(e){let{top:t,left:n,bottom:r,right:i}=e.getBoundingClientRect(),{innerHeight:l,innerWidth:s}=window;return(t>0&&t0&&r0&&n0&&ir.disconnect()},e.initCustomFormatter=function(){},e.initDirectivesForSSR=_,e.inject=rk,e.isMemoSame=iG,e.isProxy=tS,e.isReactive=tv,e.isReadonly=tb,e.isRef=tN,e.isRuntimeOnly=()=>!u,e.isShallow=t_,e.isVNode=iv,e.markRaw=tC,e.mergeDefaults=function(e,t){let n=rc(e);for(let e in t){if(e.startsWith("__skip"))continue;let r=n[e];r?A(r)||P(r)?r=n[e]={type:r,default:t[e]}:r.default=t[e]:null===r&&(r=n[e]={default:t[e]}),r&&t[`__skip_${e}`]&&(r.skipFactory=!0)}return n},e.mergeModels=function(e,t){return e&&t?A(e)&&A(t)?e.concat(t):k({},rc(e),rc(t)):e||t},e.mergeProps=iI,e.nextTick=t0,e.normalizeClass=eu,e.normalizeProps=function(e){if(!e)return null;let{class:t,style:n}=e;return t&&!M(t)&&(e.class=eu(t)),n&&(e.style=el(n)),e},e.normalizeStyle=el,e.onActivated=nK,e.onBeforeMount=nY,e.onBeforeUnmount=n3,e.onBeforeUpdate=n1,e.onDeactivated=nz,e.onErrorCaptured=n9,e.onMounted=n0,e.onRenderTracked=n5,e.onRenderTriggered=n8,e.onScopeDispose=function(e,t=!1){i&&i.cleanups.push(e)},e.onServerPrefetch=n4,e.onUnmounted=n6,e.onUpdated=n2,e.onWatcherCleanup=tj,e.openBlock=id,e.popScopeId=function(){t9=null},e.provide=rC,e.proxyRefs=tP,e.pushScopeId=function(e){t9=e},e.queuePostFlushCb=t3,e.reactive=th,e.readonly=tg,e.ref=tw,e.registerRuntimeCompiler=iU,e.render=l5,e.renderList=function(e,t,n,r){let i;let l=n&&n[r],s=A(e);if(s||M(e)){let n=s&&tv(e),r=!1;n&&(r=!t_(e),e=eJ(e)),i=Array(e.length);for(let n=0,s=e.length;nt(e,n,void 0,l&&l[n]));else{let n=Object.keys(e);i=Array(n.length);for(let r=0,s=n.length;r!iv(t)||!!(t.type!==io&&(t.type!==il||e(t.children))))?t:null}(l(n)),o=n.key||s&&s.key,a=iy(il,{key:(o&&!L(o)?o:`_${t}`)+(!s&&r?"_fb":"")},s||(r?r():[]),s&&1===e._?64:-2);return!i&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),l&&l._c&&(l._d=!0),a},e.resolveComponent=function(e,t){return rt(n7,e,!0,t)||e},e.resolveDirective=function(e){return rt("directives",e)},e.resolveDynamicComponent=function(e){return M(e)?rt(n7,e,!1)||e:e||re},e.resolveFilter=null,e.resolveTransitionHooks=nx,e.setBlockTracking=im,e.setDevtoolsHook=_,e.setTransitionHooks=nT,e.shallowReactive=tm,e.shallowReadonly=function(e){return ty(e,!0,tt,tc,tf)},e.shallowRef=tA,e.ssrContextKey=rJ,e.ssrUtils=null,e.stop=function(e){e.effect.stop()},e.toDisplayString=eb,e.toHandlerKey=Q,e.toHandlers=function(e,t){let n={};for(let r in e)n[t&&/[A-Z]/.test(r)?`on:${r}`:Q(r)]=e[r];return n},e.toRaw=tx,e.toRef=function(e,t,n){return tN(e)?e:P(e)?new tD(e):$(e)&&arguments.length>1?tF(e,t,n):tw(e)},e.toRefs=function(e){let t=A(e)?Array(e.length):{};for(let n in e)t[n]=tF(e,n);return t},e.toValue=function(e){return P(e)?e():tR(e)},e.transformVNodeArgs=function(e){},e.triggerRef=function(e){e.dep&&e.dep.trigger()},e.unref=tR,e.useAttrs=function(){return ra().attrs},e.useCssModule=function(e="$style"){return y},e.useCssVars=function(e){let t=iL();if(!t)return;let n=t.ut=(n=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(e=>lf(e,n))},r=()=>{let r=e(t.proxy);t.ce?lf(t.ce,r):function e(t,n){if(128&t.shapeFlag){let r=t.suspense;t=r.activeBranch,r.pendingBranch&&!r.isHydrating&&r.effects.push(()=>{e(r.activeBranch,n)})}for(;t.component;)t=t.component.subTree;if(1&t.shapeFlag&&t.el)lf(t.el,n);else if(t.type===il)t.children.forEach(t=>e(t,n));else if(t.type===ia){let{el:e,anchor:r}=t;for(;e&&(lf(e,n),e!==r);)e=e.nextSibling}}(t.subTree,r),n(r)};n1(()=>{t3(r)}),n0(()=>{rX(r,_,{flush:"post"});let e=new MutationObserver(r);e.observe(t.subTree.el.parentNode,{childList:!0}),n6(()=>e.disconnect())})},e.useHost=lP,e.useId=function(){let e=iL();return e?(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++:""},e.useModel=function(e,t,n=y){let r=iL(),i=z(t),l=G(t),s=rY(e,i),o=tL((s,o)=>{let a,c;let u=y;return rG(()=>{let t=e[i];Z(a,t)&&(a=t,o())}),{get:()=>(s(),n.get?n.get(a):a),set(e){let s=n.set?n.set(e):e;if(!Z(s,a)&&!(u!==y&&Z(e,u)))return;let d=r.vnode.props;d&&(t in d||i in d||l in d)&&(`onUpdate:${t}`in d||`onUpdate:${i}`in d||`onUpdate:${l}`in d)||(a=e,o()),r.emit(`update:${t}`,s),Z(e,s)&&Z(e,u)&&!Z(s,c)&&o(),u=e,c=s}}});return o[Symbol.iterator]=()=>{let e=0;return{next:()=>e<2?{value:e++?s||y:o,done:!1}:{done:!0}}},o},e.useSSRContext=()=>{},e.useShadowRoot=function(){let e=lP();return e&&e.shadowRoot},e.useSlots=function(){return ra().slots},e.useTemplateRef=function(e){let t=iL(),n=tA(null);return t&&Object.defineProperty(t.refs===y?t.refs={}:t.refs,e,{enumerable:!0,get:()=>n.value,set:e=>n.value=e}),n},e.useTransitionState=nm,e.vModelCheckbox=lz,e.vModelDynamic={created(e,t,n){l0(e,t,n,null,"created")},mounted(e,t,n){l0(e,t,n,null,"mounted")},beforeUpdate(e,t,n,r){l0(e,t,n,r,"beforeUpdate")},updated(e,t,n,r){l0(e,t,n,r,"updated")}},e.vModelRadio=lG,e.vModelSelect=lX,e.vModelText=lK,e.vShow={beforeMount(e,{value:t},{transition:n}){e[lc]="none"===e.style.display?"":e.style.display,n&&t?n.beforeEnter(e):ld(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:r}){!t!=!n&&(r?t?(r.beforeEnter(e),ld(e,!0),r.enter(e)):r.leave(e,()=>{ld(e,!1)}):ld(e,t))},beforeUnmount(e,{value:t}){ld(e,t)}},e.version=iX,e.warn=_,e.watch=function(e,t,n){return rX(e,t,n)},e.watchEffect=function(e,t){return rX(e,null,t)},e.watchPostEffect=function(e,t){return rX(e,null,{flush:"post"})},e.watchSyncEffect=rG,e.withAsyncContext=function(e){let t=iL(),n=e();return iD(),D(n)&&(n=n.catch(e=>{throw i$(t),e})),[n,()=>i$(t)]},e.withCtx=ne,e.withDefaults=function(e,t){return null},e.withDirectives=function(e,t){if(null===t5)return e;let n=iW(t5),r=e.dirs||(e.dirs=[]);for(let e=0;e{let n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=n=>{if(!("key"in n))return;let r=G(n.key);if(t.some(e=>e===r||l3[e]===r))return e(n)})},e.withMemo=function(e,t,n,r){let i=n[r];if(i&&iG(i,e))return i;let l=t();return l.memo=e.slice(),l.cacheIndex=r,n[r]=l},e.withModifiers=(e,t)=>{let n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=(n,...r)=>{for(let e=0;ene,e}({}); +**/var Vue=function(e){"use strict";var t,n,r;let i,l,s,o,a,c,u,d,p,h,f,m,g;function y(e){let t=Object.create(null);for(let n of e.split(","))t[n]=1;return e=>e in t}let b={},_=[],S=()=>{},x=()=>!1,C=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&(e.charCodeAt(2)>122||97>e.charCodeAt(2)),k=e=>e.startsWith("onUpdate:"),T=Object.assign,N=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},w=Object.prototype.hasOwnProperty,A=(e,t)=>w.call(e,t),E=Array.isArray,I=e=>"[object Map]"===V(e),R=e=>"[object Set]"===V(e),O=e=>"[object Date]"===V(e),P=e=>"function"==typeof e,M=e=>"string"==typeof e,L=e=>"symbol"==typeof e,$=e=>null!==e&&"object"==typeof e,D=e=>($(e)||P(e))&&P(e.then)&&P(e.catch),F=Object.prototype.toString,V=e=>F.call(e),B=e=>"[object Object]"===V(e),U=e=>M(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,j=y(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),H=y("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),q=e=>{let t=Object.create(null);return n=>t[n]||(t[n]=e(n))},W=/-(\w)/g,K=q(e=>e.replace(W,(e,t)=>t?t.toUpperCase():"")),z=/\B([A-Z])/g,J=q(e=>e.replace(z,"-$1").toLowerCase()),G=q(e=>e.charAt(0).toUpperCase()+e.slice(1)),X=q(e=>e?`on${G(e)}`:""),Q=(e,t)=>!Object.is(e,t),Z=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},ee=e=>{let t=parseFloat(e);return isNaN(t)?e:t},et=e=>{let t=M(e)?Number(e):NaN;return isNaN(t)?e:t},en=()=>i||(i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{}),er=y("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol");function ei(e){if(E(e)){let t={};for(let n=0;n{if(e){let n=e.split(es);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function ec(e){let t="";if(M(e))t=e;else if(E(e))for(let n=0;nem(e,t))}let ev=e=>!!(e&&!0===e.__v_isRef),ey=e=>M(e)?e:null==e?"":E(e)||$(e)&&(e.toString===F||!P(e.toString))?ev(e)?ey(e.value):JSON.stringify(e,eb,2):String(e),eb=(e,t)=>{if(ev(t))return eb(e,t.value);if(I(t))return{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[e_(t,r)+" =>"]=n,e),{})};if(R(t))return{[`Set(${t.size})`]:[...t.values()].map(e=>e_(e))};if(L(t))return e_(t);if($(t)&&!E(t)&&!B(t))return String(t);return t},e_=(e,t="")=>{var n;return L(e)?`Symbol(${null!=(n=e.description)?n:t})`:e};class eS{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=l,!e&&l&&(this.index=(l.scopes||(l.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){let e,t;if(this._isPaused=!0,this.scopes)for(e=0,t=this.scopes.length;e0&&0==--this._on&&(l=this.prevScope,this.prevScope=void 0)}stop(e){if(this._active){let t,n;for(t=0,this._active=!1,n=this.effects.length;t0)){if(a){let e=a;for(a=void 0;e;){let t=e.next;e.next=void 0,e.flags&=-9,e=t}}for(;o;){let t=o;for(o=void 0;t;){let n=t.next;if(t.next=void 0,t.flags&=-9,1&t.flags)try{t.trigger()}catch(t){e||(e=t)}t=n}}if(e)throw e}}function ew(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function eA(e){let t,n=e.depsTail,r=n;for(;r;){let e=r.prevDep;-1===r.version?(r===n&&(n=e),eR(r),function(e){let{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=e}e.deps=t,e.depsTail=n}function eE(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(eI(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function eI(e){if(4&e.flags&&!(16&e.flags)||(e.flags&=-17,e.globalVersion===eD)||(e.globalVersion=eD,!e.isSSR&&128&e.flags&&(!e.deps&&!e._dirty||!eE(e))))return;e.flags|=2;let t=e.dep,n=s,r=eO;s=e,eO=!0;try{ew(e);let n=e.fn(e._value);(0===t.version||Q(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(e){throw t.version++,e}finally{s=n,eO=r,eA(e),e.flags&=-3}}function eR(e,t=!1){let{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)eR(e,!0)}t||--n.sc||!n.map||n.map.delete(n.key)}let eO=!0,eP=[];function eM(){eP.push(eO),eO=!1}function eL(){let e=eP.pop();eO=void 0===e||e}function e$(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let e=s;s=void 0;try{t()}finally{s=e}}}let eD=0;class eF{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class eV{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!s||!eO||s===this.computed)return;let t=this.activeLink;if(void 0===t||t.sub!==s)t=this.activeLink=new eF(s,this),s.deps?(t.prevDep=s.depsTail,s.depsTail.nextDep=t,s.depsTail=t):s.deps=s.depsTail=t,function e(t){if(t.dep.sc++,4&t.sub.flags){let n=t.dep.computed;if(n&&!t.dep.subs){n.flags|=20;for(let t=n.deps;t;t=t.nextDep)e(t)}let r=t.dep.subs;r!==t&&(t.prevSub=r,r&&(r.nextSub=t)),t.dep.subs=t}}(t);else if(-1===t.version&&(t.version=this.version,t.nextDep)){let e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=s.depsTail,t.nextDep=void 0,s.depsTail.nextDep=t,s.depsTail=t,s.deps===t&&(s.deps=e)}return t}trigger(e){this.version++,eD++,this.notify(e)}notify(e){ek++;try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{eN()}}}let eB=new WeakMap,eU=Symbol(""),ej=Symbol(""),eH=Symbol("");function eq(e,t,n){if(eO&&s){let t=eB.get(e);t||eB.set(e,t=new Map);let r=t.get(n);r||(t.set(n,r=new eV),r.map=t,r.key=n),r.track()}}function eW(e,t,n,r,i,l){let s=eB.get(e);if(!s)return void eD++;let o=e=>{e&&e.trigger()};if(ek++,"clear"===t)s.forEach(o);else{let i=E(e),l=i&&U(n);if(i&&"length"===n){let e=Number(r);s.forEach((t,n)=>{("length"===n||n===eH||!L(n)&&n>=e)&&o(t)})}else switch((void 0!==n||s.has(void 0))&&o(s.get(n)),l&&o(s.get(eH)),t){case"add":i?l&&o(s.get("length")):(o(s.get(eU)),I(e)&&o(s.get(ej)));break;case"delete":!i&&(o(s.get(eU)),I(e)&&o(s.get(ej)));break;case"set":I(e)&&o(s.get(eU))}}eN()}function eK(e){let t=tS(e);return t===e?t:(eq(t,"iterate",eH),tb(e)?t:t.map(tC))}function ez(e){return eq(e=tS(e),"iterate",eH),e}let eJ={__proto__:null,[Symbol.iterator](){return eG(this,Symbol.iterator,tC)},concat(...e){return eK(this).concat(...e.map(e=>E(e)?eK(e):e))},entries(){return eG(this,"entries",e=>(e[1]=tC(e[1]),e))},every(e,t){return eQ(this,"every",e,t,void 0,arguments)},filter(e,t){return eQ(this,"filter",e,t,e=>e.map(tC),arguments)},find(e,t){return eQ(this,"find",e,t,tC,arguments)},findIndex(e,t){return eQ(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return eQ(this,"findLast",e,t,tC,arguments)},findLastIndex(e,t){return eQ(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return eQ(this,"forEach",e,t,void 0,arguments)},includes(...e){return eY(this,"includes",e)},indexOf(...e){return eY(this,"indexOf",e)},join(e){return eK(this).join(e)},lastIndexOf(...e){return eY(this,"lastIndexOf",e)},map(e,t){return eQ(this,"map",e,t,void 0,arguments)},pop(){return e0(this,"pop")},push(...e){return e0(this,"push",e)},reduce(e,...t){return eZ(this,"reduce",e,t)},reduceRight(e,...t){return eZ(this,"reduceRight",e,t)},shift(){return e0(this,"shift")},some(e,t){return eQ(this,"some",e,t,void 0,arguments)},splice(...e){return e0(this,"splice",e)},toReversed(){return eK(this).toReversed()},toSorted(e){return eK(this).toSorted(e)},toSpliced(...e){return eK(this).toSpliced(...e)},unshift(...e){return e0(this,"unshift",e)},values(){return eG(this,"values",tC)}};function eG(e,t,n){let r=ez(e),i=r[t]();return r===e||tb(e)||(i._next=i.next,i.next=()=>{let e=i._next();return e.value&&(e.value=n(e.value)),e}),i}let eX=Array.prototype;function eQ(e,t,n,r,i,l){let s=ez(e),o=s!==e&&!tb(e),a=s[t];if(a!==eX[t]){let t=a.apply(e,l);return o?tC(t):t}let c=n;s!==e&&(o?c=function(t,r){return n.call(this,tC(t),r,e)}:n.length>2&&(c=function(t,r){return n.call(this,t,r,e)}));let u=a.call(s,c,r);return o&&i?i(u):u}function eZ(e,t,n,r){let i=ez(e),l=n;return i!==e&&(tb(e)?n.length>3&&(l=function(t,r,i){return n.call(this,t,r,i,e)}):l=function(t,r,i){return n.call(this,t,tC(r),i,e)}),i[t](l,...r)}function eY(e,t,n){let r=tS(e);eq(r,"iterate",eH);let i=r[t](...n);return(-1===i||!1===i)&&t_(n[0])?(n[0]=tS(n[0]),r[t](...n)):i}function e0(e,t,n=[]){eM(),ek++;let r=tS(e)[t].apply(e,n);return eN(),eL(),r}let e1=y("__proto__,__v_isRef,__isVue"),e2=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>"arguments"!==e&&"caller"!==e).map(e=>Symbol[e]).filter(L));function e3(e){L(e)||(e=String(e));let t=tS(this);return eq(t,"has",e),t.hasOwnProperty(e)}class e6{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if("__v_skip"===t)return e.__v_skip;let r=this._isReadonly,i=this._isShallow;if("__v_isReactive"===t)return!r;if("__v_isReadonly"===t)return r;if("__v_isShallow"===t)return i;if("__v_raw"===t)return n===(r?i?tp:td:i?tu:tc).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;let l=E(e);if(!r){let e;if(l&&(e=eJ[t]))return e;if("hasOwnProperty"===t)return e3}let s=Reflect.get(e,t,tT(e)?e:n);return(L(t)?e2.has(t):e1(t))||(r||eq(e,"get",t),i)?s:tT(s)?l&&U(t)?s:s.value:$(s)?r?tm(s):th(s):s}}class e4 extends e6{constructor(e=!1){super(!1,e)}set(e,t,n,r){let i=e[t];if(!this._isShallow){let t=ty(i);if(tb(n)||ty(n)||(i=tS(i),n=tS(n)),!E(e)&&tT(i)&&!tT(n))if(t)return!1;else return i.value=n,!0}let l=E(e)&&U(t)?Number(t)e,tn=e=>Reflect.getPrototypeOf(e);function tr(e){return function(...t){return"delete"!==e&&("clear"===e?void 0:this)}}function ti(e,t){let n=function(e,t){let n={get(n){let r=this.__v_raw,i=tS(r),l=tS(n);e||(Q(n,l)&&eq(i,"get",n),eq(i,"get",l));let{has:s}=tn(i),o=t?tt:e?tk:tC;return s.call(i,n)?o(r.get(n)):s.call(i,l)?o(r.get(l)):void(r!==i&&r.get(n))},get size(){let t=this.__v_raw;return e||eq(tS(t),"iterate",eU),Reflect.get(t,"size",t)},has(t){let n=this.__v_raw,r=tS(n),i=tS(t);return e||(Q(t,i)&&eq(r,"has",t),eq(r,"has",i)),t===i?n.has(t):n.has(t)||n.has(i)},forEach(n,r){let i=this,l=i.__v_raw,s=tS(l),o=t?tt:e?tk:tC;return e||eq(s,"iterate",eU),l.forEach((e,t)=>n.call(r,o(e),o(t),i))}};return T(n,e?{add:tr("add"),set:tr("set"),delete:tr("delete"),clear:tr("clear")}:{add(e){t||tb(e)||ty(e)||(e=tS(e));let n=tS(this);return tn(n).has.call(n,e)||(n.add(e),eW(n,"add",e,e)),this},set(e,n){t||tb(n)||ty(n)||(n=tS(n));let r=tS(this),{has:i,get:l}=tn(r),s=i.call(r,e);s||(e=tS(e),s=i.call(r,e));let o=l.call(r,e);return r.set(e,n),s?Q(n,o)&&eW(r,"set",e,n):eW(r,"add",e,n),this},delete(e){let t=tS(this),{has:n,get:r}=tn(t),i=n.call(t,e);i||(e=tS(e),i=n.call(t,e)),r&&r.call(t,e);let l=t.delete(e);return i&&eW(t,"delete",e,void 0),l},clear(){let e=tS(this),t=0!==e.size,n=e.clear();return t&&eW(e,"clear",void 0,void 0),n}}),["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=function(...n){let i=this.__v_raw,l=tS(i),s=I(l),o="entries"===r||r===Symbol.iterator&&s,a=i[r](...n),c=t?tt:e?tk:tC;return e||eq(l,"iterate","keys"===r&&s?ej:eU),{next(){let{value:e,done:t}=a.next();return t?{value:e,done:t}:{value:o?[c(e[0]),c(e[1])]:c(e),done:t}},[Symbol.iterator](){return this}}}}),n}(e,t);return(t,r,i)=>"__v_isReactive"===r?!e:"__v_isReadonly"===r?e:"__v_raw"===r?t:Reflect.get(A(n,r)&&r in t?n:t,r,i)}let tl={get:ti(!1,!1)},ts={get:ti(!1,!0)},to={get:ti(!0,!1)},ta={get:ti(!0,!0)},tc=new WeakMap,tu=new WeakMap,td=new WeakMap,tp=new WeakMap;function th(e){return ty(e)?e:tg(e,!1,e5,tl,tc)}function tf(e){return tg(e,!1,e7,ts,tu)}function tm(e){return tg(e,!0,e9,to,td)}function tg(e,t,n,r,i){var l;if(!$(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;let s=(l=e).__v_skip||!Object.isExtensible(l)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}(V(l).slice(8,-1));if(0===s)return e;let o=i.get(e);if(o)return o;let a=new Proxy(e,2===s?r:n);return i.set(e,a),a}function tv(e){return ty(e)?tv(e.__v_raw):!!(e&&e.__v_isReactive)}function ty(e){return!!(e&&e.__v_isReadonly)}function tb(e){return!!(e&&e.__v_isShallow)}function t_(e){return!!e&&!!e.__v_raw}function tS(e){let t=e&&e.__v_raw;return t?tS(t):e}function tx(e){return!A(e,"__v_skip")&&Object.isExtensible(e)&&Y(e,"__v_skip",!0),e}let tC=e=>$(e)?th(e):e,tk=e=>$(e)?tm(e):e;function tT(e){return!!e&&!0===e.__v_isRef}function tN(e){return tA(e,!1)}function tw(e){return tA(e,!0)}function tA(e,t){return tT(e)?e:new tE(e,t)}class tE{constructor(e,t){this.dep=new eV,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:tS(e),this._value=t?e:tC(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||tb(e)||ty(e);Q(e=n?e:tS(e),t)&&(this._rawValue=e,this._value=n?e:tC(e),this.dep.trigger())}}function tI(e){return tT(e)?e.value:e}let tR={get:(e,t,n)=>"__v_raw"===t?e:tI(Reflect.get(e,t,n)),set:(e,t,n,r)=>{let i=e[t];return tT(i)&&!tT(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function tO(e){return tv(e)?e:new Proxy(e,tR)}class tP{constructor(e){this.__v_isRef=!0,this._value=void 0;let t=this.dep=new eV,{get:n,set:r}=e(t.track.bind(t),t.trigger.bind(t));this._get=n,this._set=r}get value(){return this._value=this._get()}set value(e){this._set(e)}}function tM(e){return new tP(e)}class tL{constructor(e,t,n){this._object=e,this._key=t,this._defaultValue=n,this.__v_isRef=!0,this._value=void 0}get value(){let e=this._object[this._key];return this._value=void 0===e?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return function(e,t){let n=eB.get(e);return n&&n.get(t)}(tS(this._object),this._key)}}class t${constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function tD(e,t,n){let r=e[t];return tT(r)?r:new tL(e,t,n)}class tF{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new eV(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=eD-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(8&this.flags)&&s!==this)return eT(this,!0),!0}get value(){let e=this.dep.track();return eI(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}let tV={},tB=new WeakMap;function tU(e,t=!1,n=m){if(n){let t=tB.get(n);t||tB.set(n,t=[]),t.push(e)}}function tj(e,t=1/0,n){if(t<=0||!$(e)||e.__v_skip||(n=n||new Set).has(e))return e;if(n.add(e),t--,tT(e))tj(e.value,t,n);else if(E(e))for(let r=0;r{tj(e,t,n)});else if(B(e)){for(let r in e)tj(e[r],t,n);for(let r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&tj(e[r],t,n)}return e}function tH(e,t,n,r){try{return r?e(...r):e()}catch(e){tW(e,t,n)}}function tq(e,t,n,r){if(P(e)){let i=tH(e,t,n,r);return i&&D(i)&&i.catch(e=>{tW(e,t,n)}),i}if(E(e)){let i=[];for(let l=0;l=t4(n)?tK.push(e):tK.splice(function(e){let t=tz+1,n=tK.length;for(;t>>1,i=tK[r],l=t4(i);lt4(e)-t4(t));if(tJ.length=0,tG)return void tG.push(...e);for(tX=0,tG=e;tXnull==e.id?2&e.flags?-1:1/0:e.id,t8=null,t5=null;function t9(e){let t=t8;return t8=e,t5=e&&e.type.__scopeId||null,t}function t7(e,t=t8,n){if(!t||e._n)return e;let r=(...n)=>{let i;r._d&&ia(-1);let l=t9(t);try{i=e(...n)}finally{t9(l),r._d&&ia(1)}return i};return r._n=!0,r._c=!0,r._d=!0,r}function ne(e,t,n,r){let i=e.dirs,l=t&&t.dirs;for(let s=0;se&&(e.disabled||""===e.disabled),nr=e=>e&&(e.defer||""===e.defer),ni=e=>"undefined"!=typeof SVGElement&&e instanceof SVGElement,nl=e=>"function"==typeof MathMLElement&&e instanceof MathMLElement,ns=(e,t)=>{let n=e&&e.to;return M(n)?t?t(n):null:n},no={name:"Teleport",__isTeleport:!0,process(e,t,n,r,i,l,s,o,a,c){let{mc:u,pc:d,pbc:p,o:{insert:h,querySelector:f,createText:m,createComment:g}}=c,y=nn(t.props),{shapeFlag:b,children:_,dynamicChildren:S}=t;if(null==e){let e=t.el=m(""),c=t.anchor=m("");h(e,n,r),h(c,n,r);let d=(e,t)=>{16&b&&(i&&i.isCE&&(i.ce._teleportTarget=e),u(_,e,t,i,l,s,o,a))},p=()=>{let e=t.target=ns(t.props,f),n=nu(e,t,m,h);e&&("svg"!==s&&ni(e)?s="svg":"mathml"!==s&&nl(e)&&(s="mathml"),y||(d(e,n),nc(t,!1)))};y&&(d(n,c),nc(t,!0)),nr(t.props)?(t.el.__isMounted=!1,rM(()=>{p(),delete t.el.__isMounted},l)):p()}else{if(nr(t.props)&&!1===e.el.__isMounted)return void rM(()=>{no.process(e,t,n,r,i,l,s,o,a,c)},l);t.el=e.el,t.targetStart=e.targetStart;let u=t.anchor=e.anchor,h=t.target=e.target,m=t.targetAnchor=e.targetAnchor,g=nn(e.props),b=g?n:h,_=g?u:m;if("svg"===s||ni(h)?s="svg":("mathml"===s||nl(h))&&(s="mathml"),S?(p(e.dynamicChildren,S,b,i,l,s,o),rB(e,t,!0)):a||d(e,t,b,_,i,l,s,o,!1),y)g?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):na(t,n,u,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){let e=t.target=ns(t.props,f);e&&na(t,e,null,c,0)}else g&&na(t,h,m,c,1);nc(t,y)}},remove(e,t,n,{um:r,o:{remove:i}},l){let{shapeFlag:s,children:o,anchor:a,targetStart:c,targetAnchor:u,target:d,props:p}=e;if(d&&(i(c),i(u)),l&&i(a),16&s){let e=l||!nn(p);for(let i=0;i{e.isMounted=!0}),nY(()=>{e.isUnmounting=!0}),e}let nf=[Function,Array],nm={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:nf,onEnter:nf,onAfterEnter:nf,onEnterCancelled:nf,onBeforeLeave:nf,onLeave:nf,onAfterLeave:nf,onLeaveCancelled:nf,onBeforeAppear:nf,onAppear:nf,onAfterAppear:nf,onAppearCancelled:nf},ng=e=>{let t=e.subTree;return t.component?ng(t.component):t};function nv(e){let t=e[0];if(e.length>1){for(let n of e)if(n.type!==ie){t=n;break}}return t}let ny={name:"BaseTransition",props:nm,setup(e,{slots:t}){let n=iE(),r=nh();return()=>{let i=t.default&&nk(t.default(),!0);if(!i||!i.length)return;let l=nv(i),s=tS(e),{mode:o}=s;if(r.isLeaving)return nS(l);let a=nx(l);if(!a)return nS(l);let c=n_(a,s,r,n,e=>c=e);a.type!==ie&&nC(a,c);let u=n.subTree&&nx(n.subTree);if(u&&u.type!==ie&&!ip(a,u)&&ng(n).type!==ie){let e=n_(u,s,r,n);if(nC(u,e),"out-in"===o&&a.type!==ie)return r.isLeaving=!0,e.afterLeave=()=>{r.isLeaving=!1,8&n.job.flags||n.update(),delete e.afterLeave,u=void 0},nS(l);"in-out"===o&&a.type!==ie?e.delayLeave=(e,t,n)=>{nb(r,u)[String(u.key)]=u,e[nd]=()=>{t(),e[nd]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{n(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return l}}};function nb(e,t){let{leavingVNodes:n}=e,r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function n_(e,t,n,r,i){let{appear:l,mode:s,persisted:o=!1,onBeforeEnter:a,onEnter:c,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:p,onLeave:h,onAfterLeave:f,onLeaveCancelled:m,onBeforeAppear:g,onAppear:y,onAfterAppear:b,onAppearCancelled:_}=t,S=String(e.key),x=nb(n,e),C=(e,t)=>{e&&tq(e,r,9,t)},k=(e,t)=>{let n=t[1];C(e,t),E(e)?e.every(e=>e.length<=1)&&n():e.length<=1&&n()},T={mode:s,persisted:o,beforeEnter(t){let r=a;if(!n.isMounted)if(!l)return;else r=g||a;t[nd]&&t[nd](!0);let i=x[S];i&&ip(e,i)&&i.el[nd]&&i.el[nd](),C(r,[t])},enter(e){let t=c,r=u,i=d;if(!n.isMounted)if(!l)return;else t=y||c,r=b||u,i=_||d;let s=!1,o=e[np]=t=>{s||(s=!0,t?C(i,[e]):C(r,[e]),T.delayedLeave&&T.delayedLeave(),e[np]=void 0)};t?k(t,[e,o]):o()},leave(t,r){let i=String(e.key);if(t[np]&&t[np](!0),n.isUnmounting)return r();C(p,[t]);let l=!1,s=t[nd]=n=>{l||(l=!0,r(),n?C(m,[t]):C(f,[t]),t[nd]=void 0,x[i]===e&&delete x[i])};x[i]=e,h?k(h,[t,s]):s()},clone(e){let l=n_(e,t,n,r,i);return i&&i(l),l}};return T}function nS(e){if(nB(e))return(e=ib(e)).children=null,e}function nx(e){if(!nB(e))return e.type.__isTeleport&&e.children?nv(e.children):e;if(e.component)return e.component.subTree;let{shapeFlag:t,children:n}=e;if(n){if(16&t)return n[0];if(32&t&&P(n.default))return n.default()}}function nC(e,t){6&e.shapeFlag&&e.component?(e.transition=t,nC(e.component.subTree,t)):128&e.shapeFlag?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function nk(e,t=!1,n){let r=[],i=0;for(let l=0;l1)for(let e=0;enw(e,t&&(E(t)?t[l]:t),n,r,i));if(nF(r)&&!i){512&r.shapeFlag&&r.type.__asyncResolved&&r.component.subTree.component&&nw(e,t,n,r.component.subTree);return}let l=4&r.shapeFlag?iV(r.component):r.el,s=i?null:l,{i:o,r:a}=e,c=t&&t.r,u=o.refs===b?o.refs={}:o.refs,d=o.setupState,p=tS(d),h=d===b?()=>!1:e=>A(p,e);if(null!=c&&c!==a&&(M(c)?(u[c]=null,h(c)&&(d[c]=null)):tT(c)&&(c.value=null)),P(a))tH(a,o,12,[s,u]);else{let t=M(a),r=tT(a);if(t||r){let o=()=>{if(e.f){let n=t?h(a)?d[a]:u[a]:a.value;i?E(n)&&N(n,l):E(n)?n.includes(l)||n.push(l):t?(u[a]=[l],h(a)&&(d[a]=u[a])):(a.value=[l],e.k&&(u[e.k]=a.value))}else t?(u[a]=s,h(a)&&(d[a]=s)):r&&(a.value=s,e.k&&(u[e.k]=s))};s?(o.id=-1,rM(o,n)):o()}}}let nA=!1,nE=()=>{nA||(console.error("Hydration completed but contains mismatches."),nA=!0)},nI=e=>{if(1===e.nodeType){if(e.namespaceURI.includes("svg")&&"foreignObject"!==e.tagName)return"svg";if(e.namespaceURI.includes("MathML"))return"mathml"}},nR=e=>8===e.nodeType;function nO(e){let{mt:t,p:n,o:{patchProp:r,createText:i,nextSibling:l,parentNode:s,remove:o,insert:a,createComment:c}}=e,u=(n,r,o,c,b,_=!1)=>{_=_||!!r.dynamicChildren;let S=nR(n)&&"["===n.data,x=()=>f(n,r,o,c,b,S),{type:C,ref:k,shapeFlag:T,patchFlag:N}=r,w=n.nodeType;r.el=n,-2===N&&(_=!1,r.dynamicChildren=null);let A=null;switch(C){case r7:3!==w?""===r.children?(a(r.el=i(""),s(n),n),A=n):A=x():(n.data!==r.children&&(nE(),n.data=r.children),A=l(n));break;case ie:y(n)?(A=l(n),g(r.el=n.content.firstChild,n,o)):A=8!==w||S?x():l(n);break;case it:if(S&&(w=(n=l(n)).nodeType),1===w||3===w){A=n;let e=!r.children.length;for(let t=0;t{s=s||!!t.dynamicChildren;let{type:a,props:c,patchFlag:u,shapeFlag:d,dirs:h,transition:f}=t,m="input"===a||"option"===a;if(m||-1!==u){let a;h&&ne(t,null,n,"created");let b=!1;if(y(e)){b=rV(null,f)&&n&&n.vnode.props&&n.vnode.props.appear;let r=e.content.firstChild;if(b){let e=r.getAttribute("class");e&&(r.$cls=e),f.beforeEnter(r)}g(r,e,n),t.el=e=r}if(16&d&&!(c&&(c.innerHTML||c.textContent))){let r=p(e.firstChild,t,e,n,i,l,s);for(;r;){nL(e,1)||nE();let t=r;r=r.nextSibling,o(t)}}else if(8&d){let n=t.children;` +`===n[0]&&("PRE"===e.tagName||"TEXTAREA"===e.tagName)&&(n=n.slice(1)),e.textContent!==n&&(nL(e,0)||nE(),e.textContent=t.children)}if(c){if(m||!s||48&u){let t=e.tagName.includes("-");for(let i in c)(m&&(i.endsWith("value")||"indeterminate"===i)||C(i)&&!j(i)||"."===i[0]||t)&&r(e,i,null,c[i],void 0,n)}else if(c.onClick)r(e,"onClick",null,c.onClick,void 0,n);else if(4&u&&tv(c.style))for(let e in c.style)c.style[e]}(a=c&&c.onVnodeBeforeMount)&&iT(a,n,t),h&&ne(t,null,n,"beforeMount"),((a=c&&c.onVnodeMounted)||h||b)&&r8(()=>{a&&iT(a,n,t),b&&f.enter(e),h&&ne(t,null,n,"mounted")},i)}return e.nextSibling},p=(e,t,r,s,o,c,d)=>{d=d||!!t.dynamicChildren;let p=t.children,h=p.length;for(let t=0;t{let{slotScopeIds:u}=t;u&&(i=i?i.concat(u):u);let d=s(e),h=p(l(e),t,d,n,r,i,o);return h&&nR(h)&&"]"===h.data?l(t.anchor=h):(nE(),a(t.anchor=c("]"),d,h),h)},f=(e,t,r,i,a,c)=>{if(nL(e.parentElement,1)||nE(),t.el=null,c){let t=m(e);for(;;){let n=l(e);if(n&&n!==t)o(n);else break}}let u=l(e),d=s(e);return o(e),n(null,t,d,u,r,i,nI(d),a),r&&(r.vnode.el=t.el,r0(r,t.el)),u},m=(e,t="[",n="]")=>{let r=0;for(;e;)if((e=l(e))&&nR(e)&&(e.data===t&&r++,e.data===n))if(0===r)return l(e);else r--;return e},g=(e,t,n)=>{let r=t.parentNode;r&&r.replaceChild(e,t);let i=n;for(;i;)i.vnode.el===t&&(i.vnode.el=i.subTree.el=e),i=i.parent},y=e=>1===e.nodeType&&"TEMPLATE"===e.tagName;return[(e,t)=>{if(!t.hasChildNodes()){n(null,e,t),t6(),t._vnode=e;return}u(t.firstChild,e,null,null,null),t6(),t._vnode=e},u]}let nP="data-allow-mismatch",nM={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function nL(e,t){if(0===t||1===t)for(;e&&!e.hasAttribute(nP);)e=e.parentElement;let n=e&&e.getAttribute(nP);if(null==n)return!1;{if(""===n)return!0;let e=n.split(",");return!!(0===t&&e.includes("children"))||e.includes(nM[t])}}let n$=en().requestIdleCallback||(e=>setTimeout(e,1)),nD=en().cancelIdleCallback||(e=>clearTimeout(e)),nF=e=>!!e.type.__asyncLoader;function nV(e,t){let{ref:n,props:r,children:i,ce:l}=t.vnode,s=iv(e,r,i);return s.ref=n,s.ce=l,delete t.vnode.ce,s}let nB=e=>e.type.__isKeepAlive;function nU(e,t){return E(e)?e.some(e=>nU(e,t)):M(e)?e.split(",").includes(t):"[object RegExp]"===V(e)&&(e.lastIndex=0,e.test(t))}function nj(e,t){nq(e,"a",t)}function nH(e,t){nq(e,"da",t)}function nq(e,t,n=iA){let r=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()});if(nz(t,r,n),n){let e=n.parent;for(;e&&e.parent;)nB(e.parent.vnode)&&function(e,t,n,r){let i=nz(t,e,r,!0);n0(()=>{N(r[t],i)},n)}(r,t,n,e),e=e.parent}}function nW(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function nK(e){return 128&e.shapeFlag?e.ssContent:e}function nz(e,t,n=iA,r=!1){if(n){let i=n[e]||(n[e]=[]),l=t.__weh||(t.__weh=(...r)=>{eM();let i=iI(n),l=tq(t,n,e,r);return i(),eL(),l});return r?i.unshift(l):i.push(l),l}}let nJ=e=>(t,n=iA)=>{iP&&"sp"!==e||nz(e,(...e)=>t(...e),n)},nG=nJ("bm"),nX=nJ("m"),nQ=nJ("bu"),nZ=nJ("u"),nY=nJ("bum"),n0=nJ("um"),n1=nJ("sp"),n2=nJ("rtg"),n3=nJ("rtc");function n6(e,t=iA){nz("ec",e,t)}let n4="components",n8=Symbol.for("v-ndc");function n5(e,t,n=!0,r=!1){let i=t8||iA;if(i){let n=i.type;if(e===n4){let e=iB(n,!1);if(e&&(e===t||e===K(t)||e===G(K(t))))return n}let l=n9(i[e]||n[e],t)||n9(i.appContext[e],t);return!l&&r?n:l}}function n9(e,t){return e&&(e[t]||e[K(t)]||e[G(K(t))])}let n7=e=>e?iO(e)?iV(e):n7(e.parent):null,re=T(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>n7(e.parent),$root:e=>n7(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>ra(e),$forceUpdate:e=>e.f||(e.f=()=>{t0(e.update)}),$nextTick:e=>e.n||(e.n=tY.bind(e.proxy)),$watch:e=>rW.bind(e)}),rt=(e,t)=>e!==b&&!e.__isScriptSetup&&A(e,t),rn={get({_:e},t){let n,r,i;if("__v_skip"===t)return!0;let{ctx:l,setupState:s,data:o,props:a,accessCache:c,type:u,appContext:d}=e;if("$"!==t[0]){let r=c[t];if(void 0!==r)switch(r){case 1:return s[t];case 2:return o[t];case 4:return l[t];case 3:return a[t]}else{if(rt(s,t))return c[t]=1,s[t];if(o!==b&&A(o,t))return c[t]=2,o[t];if((n=e.propsOptions[0])&&A(n,t))return c[t]=3,a[t];if(l!==b&&A(l,t))return c[t]=4,l[t];rs&&(c[t]=0)}}let p=re[t];return p?("$attrs"===t&&eq(e.attrs,"get",""),p(e)):(r=u.__cssModules)&&(r=r[t])?r:l!==b&&A(l,t)?(c[t]=4,l[t]):A(i=d.config.globalProperties,t)?i[t]:void 0},set({_:e},t,n){let{data:r,setupState:i,ctx:l}=e;return rt(i,t)?(i[t]=n,!0):r!==b&&A(r,t)?(r[t]=n,!0):!A(e.props,t)&&!("$"===t[0]&&t.slice(1)in e)&&(l[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:i,propsOptions:l}},s){let o;return!!n[s]||e!==b&&A(e,s)||rt(t,s)||(o=l[0])&&A(o,s)||A(r,s)||A(re,s)||A(i.config.globalProperties,s)},defineProperty(e,t,n){return null!=n.get?e._.accessCache[t]=0:A(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},rr=T({},rn,{get(e,t){if(t!==Symbol.unscopables)return rn.get(e,t,e)},has:(e,t)=>"_"!==t[0]&&!er(t)});function ri(){let e=iE();return e.setupContext||(e.setupContext=iF(e))}function rl(e){return E(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}let rs=!0;function ro(e,t,n){tq(E(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function ra(e){let t,n=e.type,{mixins:r,extends:i}=n,{mixins:l,optionsCache:s,config:{optionMergeStrategies:o}}=e.appContext,a=s.get(n);return a?t=a:l.length||r||i?(t={},l.length&&l.forEach(e=>rc(t,e,o,!0)),rc(t,n,o)):t=n,$(n)&&s.set(n,t),t}function rc(e,t,n,r=!1){let{mixins:i,extends:l}=t;for(let s in l&&rc(e,l,n,!0),i&&i.forEach(t=>rc(e,t,n,!0)),t)if(r&&"expose"===s);else{let r=ru[s]||n&&n[s];e[s]=r?r(e[s],t[s]):t[s]}return e}let ru={data:rd,props:rm,emits:rm,methods:rf,computed:rf,beforeCreate:rh,created:rh,beforeMount:rh,mounted:rh,beforeUpdate:rh,updated:rh,beforeDestroy:rh,beforeUnmount:rh,destroyed:rh,unmounted:rh,activated:rh,deactivated:rh,errorCaptured:rh,serverPrefetch:rh,components:rf,directives:rf,watch:function(e,t){if(!e)return t;if(!t)return e;let n=T(Object.create(null),e);for(let r in t)n[r]=rh(e[r],t[r]);return n},provide:rd,inject:function(e,t){return rf(rp(e),rp(t))}};function rd(e,t){return t?e?function(){return T(P(e)?e.call(this,this):e,P(t)?t.call(this,this):t)}:t:e}function rp(e){if(E(e)){let t={};for(let n=0;n1)return n&&P(t)?t.call(r&&r.proxy):t}}let rS={},rx=()=>Object.create(rS),rC=e=>Object.getPrototypeOf(e)===rS;function rk(e,t,n,r){let i,[l,s]=e.propsOptions,o=!1;if(t)for(let a in t){let c;if(j(a))continue;let u=t[a];l&&A(l,c=K(a))?s&&s.includes(c)?(i||(i={}))[c]=u:n[c]=u:rG(e.emitsOptions,a)||a in r&&u===r[a]||(r[a]=u,o=!0)}if(s){let t=tS(n),r=i||b;for(let i=0;i"_"===e[0]||"$stable"===e,rE=e=>E(e)?e.map(iS):[iS(e)],rI=(e,t,n)=>{if(t._n)return t;let r=t7((...e)=>rE(t(...e)),n);return r._c=!1,r},rR=(e,t,n)=>{let r=e._ctx;for(let n in e){if(rA(n))continue;let i=e[n];if(P(i))t[n]=rI(n,i,r);else if(null!=i){let e=rE(i);t[n]=()=>e}}},rO=(e,t)=>{let n=rE(t);e.slots.default=()=>n},rP=(e,t,n)=>{for(let r in t)(n||!rA(r))&&(e[r]=t[r])},rM=r8;function rL(e){return r$(e,nO)}function r$(e,t){var n;let r,i;en().__VUE__=!0;let{insert:l,remove:s,patchProp:o,createElement:a,createText:c,createComment:d,setText:p,setElementText:h,parentNode:f,nextSibling:m,setScopeId:g=S,insertStaticContent:y}=e,x=(e,t,n,r=null,i=null,l=null,s,o=null,a=!!t.dynamicChildren)=>{if(e===t)return;e&&!ip(e,t)&&(r=es(e),ee(e,i,l,!0),e=null),-2===t.patchFlag&&(a=!1,t.dynamicChildren=null);let{type:c,ref:u,shapeFlag:d}=t;switch(c){case r7:C(e,t,n,r);break;case ie:k(e,t,n,r);break;case it:null==e&&N(t,n,r,s);break;case r9:V(e,t,n,r,i,l,s,o,a);break;default:1&d?w(e,t,n,r,i,l,s,o,a):6&d?B(e,t,n,r,i,l,s,o,a):64&d?c.process(e,t,n,r,i,l,s,o,a,ec):128&d&&c.process(e,t,n,r,i,l,s,o,a,ec)}null!=u&&i?nw(u,e&&e.ref,l,t||e,!t):null==u&&e&&null!=e.ref&&nw(e.ref,null,l,e,!0)},C=(e,t,n,r)=>{if(null==e)l(t.el=c(t.children),n,r);else{let n=t.el=e.el;t.children!==e.children&&p(n,t.children)}},k=(e,t,n,r)=>{null==e?l(t.el=d(t.children||""),n,r):t.el=e.el},N=(e,t,n,r)=>{[e.el,e.anchor]=y(e.children,t,n,r,e.el,e.anchor)},w=(e,t,n,r,i,l,s,o,a)=>{"svg"===t.type?s="svg":"math"===t.type&&(s="mathml"),null==e?I(t,n,r,i,l,s,o,a):M(e,t,i,l,s,o,a)},I=(e,t,n,r,i,s,c,u)=>{let d,p,{props:f,shapeFlag:m,transition:g,dirs:y}=e;if(d=e.el=a(e.type,s,f&&f.is,f),8&m?h(d,e.children):16&m&&O(e.children,d,null,r,i,rD(e,s),c,u),y&&ne(e,null,r,"created"),R(d,e,e.scopeId,c,r),f){for(let e in f)"value"===e||j(e)||o(d,e,null,f[e],s,r);"value"in f&&o(d,"value",null,f.value,s),(p=f.onVnodeBeforeMount)&&iT(p,r,e)}y&&ne(e,null,r,"beforeMount");let b=rV(i,g);b&&g.beforeEnter(d),l(d,t,n),((p=f&&f.onVnodeMounted)||b||y)&&rM(()=>{p&&iT(p,r,e),b&&g.enter(d),y&&ne(e,null,r,"mounted")},i)},R=(e,t,n,r,i)=>{if(n&&g(e,n),r)for(let t=0;t{for(let c=a;c{let a,c=t.el=e.el,{patchFlag:u,dynamicChildren:d,dirs:p}=t;u|=16&e.patchFlag;let f=e.props||b,m=t.props||b;if(n&&rF(n,!1),(a=m.onVnodeBeforeUpdate)&&iT(a,n,t,e),p&&ne(t,e,n,"beforeUpdate"),n&&rF(n,!0),(f.innerHTML&&null==m.innerHTML||f.textContent&&null==m.textContent)&&h(c,""),d?L(e.dynamicChildren,d,c,n,r,rD(t,i),l):s||z(e,t,c,null,n,r,rD(t,i),l,!1),u>0){if(16&u)F(c,f,m,n,i);else if(2&u&&f.class!==m.class&&o(c,"class",null,m.class,i),4&u&&o(c,"style",f.style,m.style,i),8&u){let e=t.dynamicProps;for(let t=0;t{a&&iT(a,n,t,e),p&&ne(t,e,n,"updated")},r)},L=(e,t,n,r,i,l,s)=>{for(let o=0;o{if(t!==n){if(t!==b)for(let l in t)j(l)||l in n||o(e,l,t[l],null,i,r);for(let l in n){if(j(l))continue;let s=n[l],a=t[l];s!==a&&"value"!==l&&o(e,l,a,s,i,r)}"value"in n&&o(e,"value",t.value,n.value,i)}},V=(e,t,n,r,i,s,o,a,u)=>{let d=t.el=e?e.el:c(""),p=t.anchor=e?e.anchor:c(""),{patchFlag:h,dynamicChildren:f,slotScopeIds:m}=t;m&&(a=a?a.concat(m):m),null==e?(l(d,n,r),l(p,n,r),O(t.children||[],n,p,i,s,o,a,u)):h>0&&64&h&&f&&e.dynamicChildren?(L(e.dynamicChildren,f,n,i,s,o,a),(null!=t.key||i&&t===i.subTree)&&rB(e,t,!0)):z(e,t,n,p,i,s,o,a,u)},B=(e,t,n,r,i,l,s,o,a)=>{t.slotScopeIds=o,null==e?512&t.shapeFlag?i.ctx.activate(t,n,r,s,a):U(t,n,r,i,l,s,a):H(e,t,a)},U=(e,t,n,r,i,l,s)=>{let o=e.component=function(e,t,n){let r=e.type,i=(t?t.appContext:e.appContext)||iN,l={uid:iw++,vnode:e,type:r,parent:t,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new eS(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(i.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:function e(t,n,r=!1){let i=r?rN:n.propsCache,l=i.get(t);if(l)return l;let s=t.props,o={},a=[],c=!1;if(!P(t)){let i=t=>{c=!0;let[r,i]=e(t,n,!0);T(o,r),i&&a.push(...i)};!r&&n.mixins.length&&n.mixins.forEach(i),t.extends&&i(t.extends),t.mixins&&t.mixins.forEach(i)}if(!s&&!c)return $(t)&&i.set(t,_),_;if(E(s))for(let e=0;e{let r=e(t,n,!0);r&&(a=!0,T(o,r))};!r&&n.mixins.length&&n.mixins.forEach(i),t.extends&&i(t.extends),t.mixins&&t.mixins.forEach(i)}return s||a?(E(s)?s.forEach(e=>o[e]=null):T(o,s),$(t)&&i.set(t,o),o):($(t)&&i.set(t,null),null)}(r,i),emit:null,emitted:null,propsDefaults:b,inheritAttrs:r.inheritAttrs,ctx:b,data:b,props:b,attrs:b,slots:b,refs:b,setupState:b,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return l.ctx={_:l},l.root=t?t.root:l,l.emit=rJ.bind(null,l),e.ce&&e.ce(l),l}(e,r,i);nB(e)&&(o.ctx.renderer=ec),function(e,t=!1,n=!1){t&&u(t);let{props:r,children:i}=e.vnode,l=iO(e);!function(e,t,n,r=!1){let i={},l=rx();for(let n in e.propsDefaults=Object.create(null),rk(e,t,i,l),e.propsOptions[0])n in i||(i[n]=void 0);n?e.props=r?i:tf(i):e.type.props?e.props=i:e.props=l,e.attrs=l}(e,r,l,t),((e,t,n)=>{let r=e.slots=rx();if(32&e.vnode.shapeFlag){let e=t.__;e&&Y(r,"__",e,!0);let i=t._;i?(rP(r,t,n),n&&Y(r,"_",i,!0)):rR(t,r)}else t&&rO(e,t)})(e,i,n||t),l&&function(e,t){let n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,rn);let{setup:r}=n;if(r){eM();let n=e.setupContext=r.length>1?iF(e):null,i=iI(e),l=tH(r,e,0,[e.props,n]),s=D(l);if(eL(),i(),(s||e.sp)&&!nF(e)&&nN(e),s){if(l.then(iR,iR),t)return l.then(n=>{iM(e,n,t)}).catch(t=>{tW(t,e,0)});e.asyncDep=l}else iM(e,l,t)}else i$(e,t)}(e,t),t&&u(!1)}(o,!1,s),o.asyncDep?(i&&i.registerDep(o,q,s),e.el||k(null,o.subTree=iv(ie),t,n)):q(o,e,t,n,i,l,s)},H=(e,t,n)=>{let r=t.component=e.component;if(function(e,t,n){let{props:r,children:i,component:l}=e,{props:s,children:o,patchFlag:a}=t,c=l.emitsOptions;if(t.dirs||t.transition)return!0;if(!n||!(a>=0))return(!!i||!!o)&&(!o||!o.$stable)||r!==s&&(r?!s||rY(r,s,c):!!s);if(1024&a)return!0;if(16&a)return r?rY(r,s,c):!!s;if(8&a){let e=t.dynamicProps;for(let t=0;t{let a=()=>{if(e.isMounted){let t,{next:n,bu:r,u:i,parent:c,vnode:u}=e;{let t=function e(t){let n=t.subTree.component;if(n)if(n.asyncDep&&!n.asyncResolved)return n;else return e(n)}(e);if(t){n&&(n.el=u.el,W(e,n,o)),t.asyncDep.then(()=>{e.isUnmounted||a()});return}}let d=n;rF(e,!1),n?(n.el=u.el,W(e,n,o)):n=u,r&&Z(r),(t=n.props&&n.props.onVnodeBeforeUpdate)&&iT(t,c,n,u),rF(e,!0);let p=rX(e),h=e.subTree;e.subTree=p,x(h,p,f(h.el),es(h),e,l,s),n.el=p.el,null===d&&r0(e,p.el),i&&rM(i,l),(t=n.props&&n.props.onVnodeUpdated)&&rM(()=>iT(t,c,n,u),l)}else{let o,{el:a,props:c}=t,{bm:u,m:d,parent:p,root:h,type:f}=e,m=nF(t);if(rF(e,!1),u&&Z(u),!m&&(o=c&&c.onVnodeBeforeMount)&&iT(o,p,t),rF(e,!0),a&&i){let t=()=>{e.subTree=rX(e),i(a,e.subTree,e,l,null)};m&&f.__asyncHydrate?f.__asyncHydrate(a,e,t):t()}else{h.ce&&!1!==h.ce._def.shadowRoot&&h.ce._injectChildStyle(f);let i=e.subTree=rX(e);x(null,i,n,r,e,l,s),t.el=i.el}if(d&&rM(d,l),!m&&(o=c&&c.onVnodeMounted)){let e=t;rM(()=>iT(o,p,e),l)}(256&t.shapeFlag||p&&nF(p.vnode)&&256&p.vnode.shapeFlag)&&e.a&&rM(e.a,l),e.isMounted=!0,t=n=r=null}};e.scope.on();let c=e.effect=new eC(a);e.scope.off();let u=e.update=c.run.bind(c),d=e.job=c.runIfDirty.bind(c);d.i=e,d.id=e.uid,c.scheduler=()=>t0(d),rF(e,!0),u()},W=(e,t,n)=>{t.component=e;let r=e.vnode.props;e.vnode=t,e.next=null,function(e,t,n,r){let{props:i,attrs:l,vnode:{patchFlag:s}}=e,o=tS(i),[a]=e.propsOptions,c=!1;if((r||s>0)&&!(16&s)){if(8&s){let n=e.vnode.dynamicProps;for(let r=0;r{let{vnode:r,slots:i}=e,l=!0,s=b;if(32&r.shapeFlag){let e=t._;e?n&&1===e?l=!1:rP(i,t,n):(l=!t.$stable,rR(t,i)),s=t}else t&&(rO(e,t),s={default:1});if(l)for(let e in i)rA(e)||null!=s[e]||delete i[e]})(e,t.children,n),eM(),t3(e),eL()},z=(e,t,n,r,i,l,s,o,a=!1)=>{let c=e&&e.children,u=e?e.shapeFlag:0,d=t.children,{patchFlag:p,shapeFlag:f}=t;if(p>0){if(128&p)return void X(c,d,n,r,i,l,s,o,a);else if(256&p)return void G(c,d,n,r,i,l,s,o,a)}8&f?(16&u&&el(c,i,l),d!==c&&h(n,d)):16&u?16&f?X(c,d,n,r,i,l,s,o,a):el(c,i,l,!0):(8&u&&h(n,""),16&f&&O(d,n,r,i,l,s,o,a))},G=(e,t,n,r,i,l,s,o,a)=>{let c;e=e||_,t=t||_;let u=e.length,d=t.length,p=Math.min(u,d);for(c=0;cd?el(e,i,l,!0,!1,p):O(t,n,r,i,l,s,o,a,p)},X=(e,t,n,r,i,l,s,o,a)=>{let c=0,u=t.length,d=e.length-1,p=u-1;for(;c<=d&&c<=p;){let r=e[c],u=t[c]=a?ix(t[c]):iS(t[c]);if(ip(r,u))x(r,u,n,null,i,l,s,o,a);else break;c++}for(;c<=d&&c<=p;){let r=e[d],c=t[p]=a?ix(t[p]):iS(t[p]);if(ip(r,c))x(r,c,n,null,i,l,s,o,a);else break;d--,p--}if(c>d){if(c<=p){let e=p+1,d=ep)for(;c<=d;)ee(e[c],i,l,!0),c++;else{let h,f=c,m=c,g=new Map;for(c=m;c<=p;c++){let e=t[c]=a?ix(t[c]):iS(t[c]);null!=e.key&&g.set(e.key,c)}let y=0,b=p-m+1,S=!1,C=0,k=Array(b);for(c=0;c=b){ee(u,i,l,!0);continue}if(null!=u.key)r=g.get(u.key);else for(h=m;h<=p;h++)if(0===k[h-m]&&ip(u,t[h])){r=h;break}void 0===r?ee(u,i,l,!0):(k[r-m]=c+1,r>=C?C=r:S=!0,x(u,t[r],n,null,i,l,s,o,a),y++)}let T=S?function(e){let t,n,r,i,l,s=e.slice(),o=[0],a=e.length;for(t=0;t>1]]0&&(s[t]=o[r-1]),o[r]=t)}}for(r=o.length,i=o[r-1];r-- >0;)o[r]=i,i=s[i];return o}(k):_;for(h=T.length-1,c=b-1;c>=0;c--){let e=m+c,d=t[e],p=e+1{let{el:o,type:a,transition:c,children:u,shapeFlag:d}=e;if(6&d)return void Q(e.component.subTree,t,n,r);if(128&d)return void e.suspense.move(t,n,r);if(64&d)return void a.move(e,t,n,ec);if(a===r9){l(o,t,n);for(let e=0;e{let i;for(;e&&e!==t;)i=m(e),l(e,n,r),e=i;l(t,n,r)})(e,t,n);if(2!==r&&1&d&&c)if(0===r)c.beforeEnter(o),l(o,t,n),rM(()=>c.enter(o),i);else{let{leave:r,delayLeave:i,afterLeave:a}=c,u=()=>{e.ctx.isUnmounted?s(o):l(o,t,n)},d=()=>{r(o,()=>{u(),a&&a()})};i?i(o,u,d):d()}else l(o,t,n)},ee=(e,t,n,r=!1,i=!1)=>{let l,{type:s,props:o,ref:a,children:c,dynamicChildren:u,shapeFlag:d,patchFlag:p,dirs:h,cacheIndex:f}=e;if(-2===p&&(i=!1),null!=a&&(eM(),nw(a,null,n,e,!0),eL()),null!=f&&(t.renderCache[f]=void 0),256&d)return void t.ctx.deactivate(e);let m=1&d&&h,g=!nF(e);if(g&&(l=o&&o.onVnodeBeforeUnmount)&&iT(l,t,e),6&d)ei(e.component,n,r);else{if(128&d)return void e.suspense.unmount(n,r);m&&ne(e,null,t,"beforeUnmount"),64&d?e.type.remove(e,t,n,ec,r):u&&!u.hasOnce&&(s!==r9||p>0&&64&p)?el(u,t,n,!1,!0):(s===r9&&384&p||!i&&16&d)&&el(c,t,n),r&&et(e)}(g&&(l=o&&o.onVnodeUnmounted)||m)&&rM(()=>{l&&iT(l,t,e),m&&ne(e,null,t,"unmounted")},n)},et=e=>{let{type:t,el:n,anchor:r,transition:i}=e;if(t===r9)return void er(n,r);if(t===it)return void(({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=m(e),s(e),e=n;s(t)})(e);let l=()=>{s(n),i&&!i.persisted&&i.afterLeave&&i.afterLeave()};if(1&e.shapeFlag&&i&&!i.persisted){let{leave:t,delayLeave:r}=i,s=()=>t(n,l);r?r(e.el,l,s):s()}else l()},er=(e,t)=>{let n;for(;e!==t;)n=m(e),s(e),e=n;s(t)},ei=(e,t,n)=>{let{bum:r,scope:i,job:l,subTree:s,um:o,m:a,a:c,parent:u,slots:{__:d}}=e;rU(a),rU(c),r&&Z(r),u&&E(d)&&d.forEach(e=>{u.renderCache[e]=void 0}),i.stop(),l&&(l.flags|=8,ee(s,e,t,n)),o&&rM(o,t),rM(()=>{e.isUnmounted=!0},t),t&&t.pendingBranch&&!t.isUnmounted&&e.asyncDep&&!e.asyncResolved&&e.suspenseId===t.pendingId&&(t.deps--,0===t.deps&&t.resolve())},el=(e,t,n,r=!1,i=!1,l=0)=>{for(let s=l;s{if(6&e.shapeFlag)return es(e.component.subTree);if(128&e.shapeFlag)return e.suspense.next();let t=m(e.anchor||e.el),n=t&&t[nt];return n?m(n):t},eo=!1,ea=(e,t,n)=>{null==e?t._vnode&&ee(t._vnode,null,null,!0):x(t._vnode||null,e,t,null,null,null,n),t._vnode=e,eo||(eo=!0,t3(),t6(),eo=!1)},ec={p:x,um:ee,m:Q,r:et,mt:U,mc:O,pc:z,pbc:L,n:es,o:e};return t&&([r,i]=t(ec)),{render:ea,hydrate:r,createApp:(n=r,function(e,t=null){P(e)||(e=T({},e)),null==t||$(t)||(t=null);let r=rg(),i=new WeakSet,l=[],s=!1,o=r.app={_uid:rv++,_component:e,_props:t,_container:null,_context:r,_instance:null,version:iq,get config(){return r.config},set config(v){},use:(e,...t)=>(i.has(e)||(e&&P(e.install)?(i.add(e),e.install(o,...t)):P(e)&&(i.add(e),e(o,...t))),o),mixin:e=>(r.mixins.includes(e)||r.mixins.push(e),o),component:(e,t)=>t?(r.components[e]=t,o):r.components[e],directive:(e,t)=>t?(r.directives[e]=t,o):r.directives[e],mount(i,l,a){if(!s){let c=o._ceVNode||iv(e,t);return c.appContext=r,!0===a?a="svg":!1===a&&(a=void 0),l&&n?n(c,i):ea(c,i,a),s=!0,o._container=i,i.__vue_app__=o,iV(c.component)}},onUnmount(e){l.push(e)},unmount(){s&&(tq(l,o._instance,16),ea(null,o._container),delete o._container.__vue_app__)},provide:(e,t)=>(r.provides[e]=t,o),runWithContext(e){let t=ry;ry=o;try{return e()}finally{ry=t}}};return o})}}function rD({type:e,props:t},n){return"svg"===n&&"foreignObject"===e||"mathml"===n&&"annotation-xml"===e&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function rF({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function rV(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function rB(e,t,n=!1){let r=e.children,i=t.children;if(E(r)&&E(i))for(let e=0;etq(e,c,t,n);let u=!1;return"post"===s?a.scheduler=e=>{rM(e,c&&c.suspense)}:"sync"!==s&&(u=!0,a.scheduler=(e,t)=>{t?e():t0(e)}),a.augmentJob=e=>{t&&(e.flags|=4),u&&(e.flags|=2,c&&(e.id=c.uid,e.i=c))},function(e,t,n=b){let r,i,s,o,{immediate:a,deep:c,once:u,scheduler:d,augmentJob:p,call:h}=n,f=e=>c?e:tb(e)||!1===c||0===c?tj(e,1):tj(e),g=!1,y=!1;if(tT(e)?(i=()=>e.value,g=tb(e)):tv(e)?(i=()=>f(e),g=!0):E(e)?(y=!0,g=e.some(e=>tv(e)||tb(e)),i=()=>e.map(e=>tT(e)?e.value:tv(e)?f(e):P(e)?h?h(e,2):e():void 0)):i=P(e)?t?h?()=>h(e,2):e:()=>{if(s){eM();try{s()}finally{eL()}}let t=m;m=r;try{return h?h(e,3,[o]):e(o)}finally{m=t}}:S,t&&c){let e=i,t=!0===c?1/0:c;i=()=>tj(e(),t)}let _=l,x=()=>{r.stop(),_&&_.active&&N(_.effects,r)};if(u&&t){let e=t;t=(...t)=>{e(...t),x()}}let C=y?Array(e.length).fill(tV):tV,k=e=>{if(1&r.flags&&(r.dirty||e))if(t){let e=r.run();if(c||g||(y?e.some((e,t)=>Q(e,C[t])):Q(e,C))){s&&s();let n=m;m=r;try{let n=[e,C===tV?void 0:y&&C[0]===tV?[]:C,o];C=e,h?h(t,3,n):t(...n)}finally{m=n}}}else r.run()};return p&&p(k),(r=new eC(i)).scheduler=d?()=>d(k,!1):k,o=e=>tU(e,!1,r),s=r.onStop=()=>{let e=tB.get(r);if(e){if(h)h(e,4);else for(let t of e)t();tB.delete(r)}},t?a?k(!0):C=r.run():d?d(k.bind(null,!0),!0):r.run(),x.pause=r.pause.bind(r),x.resume=r.resume.bind(r),x.stop=x,x}(e,t,a)}function rW(e,t,n){let r,i=this.proxy,l=M(e)?e.includes(".")?rK(i,e):()=>i[e]:e.bind(i,i);P(t)?r=t:(r=t.handler,n=t);let s=iI(this),o=rq(l,r.bind(i),n);return s(),o}function rK(e,t){let n=t.split(".");return()=>{let t=e;for(let e=0;e"modelValue"===t||"model-value"===t?e.modelModifiers:e[`${t}Modifiers`]||e[`${K(t)}Modifiers`]||e[`${J(t)}Modifiers`];function rJ(e,t,...n){let r;if(e.isUnmounted)return;let i=e.vnode.props||b,l=n,s=t.startsWith("update:"),o=s&&rz(i,t.slice(7));o&&(o.trim&&(l=n.map(e=>M(e)?e.trim():e)),o.number&&(l=n.map(ee)));let a=i[r=X(t)]||i[r=X(K(t))];!a&&s&&(a=i[r=X(J(t))]),a&&tq(a,e,6,l);let c=i[r+"Once"];if(c){if(e.emitted){if(e.emitted[r])return}else e.emitted={};e.emitted[r]=!0,tq(c,e,6,l)}}function rG(e,t){return!!e&&!!C(t)&&(A(e,(t=t.slice(2).replace(/Once$/,""))[0].toLowerCase()+t.slice(1))||A(e,J(t))||A(e,t))}function rX(e){let t,n,{type:r,vnode:i,proxy:l,withProxy:s,propsOptions:[o],slots:a,attrs:c,emit:u,render:d,renderCache:p,props:h,data:f,setupState:m,ctx:g,inheritAttrs:y}=e,b=t9(e);try{if(4&i.shapeFlag){let e=s||l;t=iS(d.call(e,e,p,h,m,f,g)),n=c}else t=iS(r.length>1?r(h,{attrs:c,slots:a,emit:u}):r(h,null)),n=r.props?c:rQ(c)}catch(n){ir.length=0,tW(n,e,1),t=iv(ie)}let _=t;if(n&&!1!==y){let e=Object.keys(n),{shapeFlag:t}=_;e.length&&7&t&&(o&&e.some(k)&&(n=rZ(n,o)),_=ib(_,n,!1,!0))}return i.dirs&&((_=ib(_,null,!1,!0)).dirs=_.dirs?_.dirs.concat(i.dirs):i.dirs),i.transition&&nC(_,i.transition),t=_,t9(b),t}let rQ=e=>{let t;for(let n in e)("class"===n||"style"===n||C(n))&&((t||(t={}))[n]=e[n]);return t},rZ=(e,t)=>{let n={};for(let r in e)k(r)&&r.slice(9)in t||(n[r]=e[r]);return n};function rY(e,t,n){let r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let i=0;ie.__isSuspense,r2=0;function r3(e,t){let n=e.props&&e.props[t];P(n)&&n()}function r6(e,t,n,r,i,l,s,o,a,c,u=!1){let d,{p:p,m:h,um:f,n:m,o:{parentNode:g,remove:y}}=c,b=function(e){let t=e.props&&e.props.suspensible;return null!=t&&!1!==t}(e);b&&t&&t.pendingBranch&&(d=t.pendingId,t.deps++);let _=e.props?et(e.props.timeout):void 0,S=l,x={vnode:e,parent:t,parentComponent:n,namespace:s,container:r,hiddenContainer:i,deps:0,pendingId:r2++,timeout:"number"==typeof _?_:-1,activeBranch:null,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve(e=!1,n=!1){let{vnode:r,activeBranch:i,pendingBranch:s,pendingId:o,effects:a,parentComponent:c,container:u}=x,p=!1;x.isHydrating?x.isHydrating=!1:!e&&((p=i&&s.transition&&"out-in"===s.transition.mode)&&(i.transition.afterLeave=()=>{o===x.pendingId&&(h(s,u,l===S?m(i):l,0),t2(a))}),i&&(g(i.el)===u&&(l=m(i)),f(i,c,x,!0)),p||h(s,u,l,0)),r5(x,s),x.pendingBranch=null,x.isInFallback=!1;let y=x.parent,_=!1;for(;y;){if(y.pendingBranch){y.effects.push(...a),_=!0;break}y=y.parent}_||p||t2(a),x.effects=[],b&&t&&t.pendingBranch&&d===t.pendingId&&(t.deps--,0!==t.deps||n||t.resolve()),r3(r,"onResolve")},fallback(e){if(!x.pendingBranch)return;let{vnode:t,activeBranch:n,parentComponent:r,container:i,namespace:l}=x;r3(t,"onFallback");let s=m(n),c=()=>{x.isInFallback&&(p(null,e,i,s,r,null,l,o,a),r5(x,e))},u=e.transition&&"out-in"===e.transition.mode;u&&(n.transition.afterLeave=c),x.isInFallback=!0,f(n,r,null,!0),u||c()},move(e,t,n){x.activeBranch&&h(x.activeBranch,e,t,n),x.container=e},next:()=>x.activeBranch&&m(x.activeBranch),registerDep(e,t,n){let r=!!x.pendingBranch;r&&x.deps++;let i=e.vnode.el;e.asyncDep.catch(t=>{tW(t,e,0)}).then(l=>{if(e.isUnmounted||x.isUnmounted||x.pendingId!==e.suspenseId)return;e.asyncResolved=!0;let{vnode:o}=e;iM(e,l,!1),i&&(o.el=i);let a=!i&&e.subTree.el;t(e,o,g(i||e.subTree.el),i?null:m(e.subTree),x,s,n),a&&y(a),r0(e,o.el),r&&0==--x.deps&&x.resolve()})},unmount(e,t){x.isUnmounted=!0,x.activeBranch&&f(x.activeBranch,n,e,t),x.pendingBranch&&f(x.pendingBranch,n,e,t)}};return x}function r4(e){let t;if(P(e)){let n=io&&e._c;n&&(e._d=!1,il()),e=e(),n&&(e._d=!0,t=ii,is())}return E(e)&&(e=function(e,t=!0){let n;for(let t=0;tt!==e)),e}function r8(e,t){t&&t.pendingBranch?E(e)?t.effects.push(...e):t.effects.push(e):t2(e)}function r5(e,t){e.activeBranch=t;let{vnode:n,parentComponent:r}=e,i=t.el;for(;!i&&t.component;)i=(t=t.component.subTree).el;n.el=i,r&&r.subTree===n&&(r.vnode.el=i,r0(r,i))}let r9=Symbol.for("v-fgt"),r7=Symbol.for("v-txt"),ie=Symbol.for("v-cmt"),it=Symbol.for("v-stc"),ir=[],ii=null;function il(e=!1){ir.push(ii=e?null:[])}function is(){ir.pop(),ii=ir[ir.length-1]||null}let io=1;function ia(e,t=!1){io+=e,e<0&&ii&&t&&(ii.hasOnce=!0)}function ic(e){return e.dynamicChildren=io>0?ii||_:null,is(),io>0&&ii&&ii.push(e),e}function iu(e,t,n,r,i){return ic(iv(e,t,n,r,i,!0))}function id(e){return!!e&&!0===e.__v_isVNode}function ip(e,t){return e.type===t.type&&e.key===t.key}let ih=({key:e})=>null!=e?e:null,im=({ref:e,ref_key:t,ref_for:n})=>("number"==typeof e&&(e=""+e),null!=e?M(e)||tT(e)||P(e)?{i:t8,r:e,k:t,f:!!n}:e:null);function ig(e,t=null,n=null,r=0,i=null,l=+(e!==r9),s=!1,o=!1){let a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&ih(t),ref:t&&im(t),scopeId:t5,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:l,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:t8};return o?(iC(a,n),128&l&&e.normalize(a)):n&&(a.shapeFlag|=M(n)?8:16),io>0&&!s&&ii&&(a.patchFlag>0||6&l)&&32!==a.patchFlag&&ii.push(a),a}let iv=function(e,t=null,n=null,r=0,i=null,l=!1){var s;if(e&&e!==n8||(e=ie),id(e)){let r=ib(e,t,!0);return n&&iC(r,n),io>0&&!l&&ii&&(6&r.shapeFlag?ii[ii.indexOf(e)]=r:ii.push(r)),r.patchFlag=-2,r}if(P(s=e)&&"__vccOpts"in s&&(e=e.__vccOpts),t){let{class:e,style:n}=t=iy(t);e&&!M(e)&&(t.class=ec(e)),$(n)&&(t_(n)&&!E(n)&&(n=T({},n)),t.style=ei(n))}let o=M(e)?1:r1(e)?128:e.__isTeleport?64:$(e)?4:2*!!P(e);return ig(e,t,n,r,i,o,l,!0)};function iy(e){return e?t_(e)||rC(e)?T({},e):e:null}function ib(e,t,n=!1,r=!1){let{props:i,ref:l,patchFlag:s,children:o,transition:a}=e,c=t?ik(i||{},t):i,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&ih(c),ref:t&&t.ref?n&&l?E(l)?l.concat(im(t)):[l,im(t)]:im(t):l,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:o,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==r9?-1===s?16:16|s:s,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&ib(e.ssContent),ssFallback:e.ssFallback&&ib(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&r&&nC(u,a.clone(u)),u}function i_(e=" ",t=0){return iv(r7,null,e,t)}function iS(e){return null==e||"boolean"==typeof e?iv(ie):E(e)?iv(r9,null,e.slice()):id(e)?ix(e):iv(r7,null,String(e))}function ix(e){return null===e.el&&-1!==e.patchFlag||e.memo?e:ib(e)}function iC(e,t){let n=0,{shapeFlag:r}=e;if(null==t)t=null;else if(E(t))n=16;else if("object"==typeof t)if(65&r){let n=t.default;n&&(n._c&&(n._d=!1),iC(e,n()),n._c&&(n._d=!0));return}else{n=32;let r=t._;r||rC(t)?3===r&&t8&&(1===t8.slots._?t._=1:(t._=2,e.patchFlag|=1024)):t._ctx=t8}else P(t)?(t={default:t,_ctx:t8},n=32):(t=String(t),64&r?(n=16,t=[i_(t)]):n=8);e.children=t,e.shapeFlag|=n}function ik(...e){let t={};for(let n=0;niA||t8;c=e=>{iA=e},u=e=>{iP=e};let iI=e=>{let t=iA;return c(e),e.scope.on(),()=>{e.scope.off(),c(t)}},iR=()=>{iA&&iA.scope.off(),c(null)};function iO(e){return 4&e.vnode.shapeFlag}let iP=!1;function iM(e,t,n){P(t)?e.render=t:$(t)&&(e.setupState=tO(t)),i$(e,n)}function iL(e){d=e,p=e=>{e.render._rc&&(e.withProxy=new Proxy(e.ctx,rr))}}function i$(e,t,n){let r=e.type;if(!e.render){if(!t&&d&&!r.render){let t=r.template||ra(e).template;if(t){let{isCustomElement:n,compilerOptions:i}=e.appContext.config,{delimiters:l,compilerOptions:s}=r,o=T(T({isCustomElement:n,delimiters:l},i),s);r.render=d(t,o)}}e.render=r.render||S,p&&p(e)}{let t=iI(e);eM();try{!function(e){let t=ra(e),n=e.proxy,r=e.ctx;rs=!1,t.beforeCreate&&ro(t.beforeCreate,e,"bc");let{data:i,computed:l,methods:s,watch:o,provide:a,inject:c,created:u,beforeMount:d,mounted:p,beforeUpdate:h,updated:f,activated:m,deactivated:g,beforeDestroy:y,beforeUnmount:b,destroyed:_,unmounted:x,render:C,renderTracked:k,renderTriggered:T,errorCaptured:N,serverPrefetch:w,expose:A,inheritAttrs:I,components:R,directives:O,filters:L}=t;if(c&&function(e,t,n=S){for(let n in E(e)&&(e=rp(e)),e){let r,i=e[n];tT(r=$(i)?"default"in i?r_(i.from||n,i.default,!0):r_(i.from||n):r_(i))?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>r.value,set:e=>r.value=e}):t[n]=r}}(c,r,null),s)for(let e in s){let t=s[e];P(t)&&(r[e]=t.bind(n))}if(i){let t=i.call(n,n);$(t)&&(e.data=th(t))}if(rs=!0,l)for(let e in l){let t=l[e],i=P(t)?t.bind(n,n):P(t.get)?t.get.bind(n,n):S,s=iU({get:i,set:!P(t)&&P(t.set)?t.set.bind(n):S});Object.defineProperty(r,e,{enumerable:!0,configurable:!0,get:()=>s.value,set:e=>s.value=e})}if(o)for(let e in o)!function e(t,n,r,i){var l,s,o,a,c,u,d;let p=i.includes(".")?rK(r,i):()=>r[i];if(M(t)){let e=n[t];P(e)&&(l=p,s=e,rq(l,s,void 0))}else if(P(t)){o=p,a=t.bind(r),rq(o,a,void 0)}else if($(t))if(E(t))t.forEach(t=>e(t,n,r,i));else{let e=P(t.handler)?t.handler.bind(r):n[t.handler];P(e)&&(c=p,u=e,d=t,rq(c,u,d))}}(o[e],r,n,e);if(a){let e=P(a)?a.call(n):a;Reflect.ownKeys(e).forEach(t=>{rb(t,e[t])})}function D(e,t){E(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(u&&ro(u,e,"c"),D(nG,d),D(nX,p),D(nQ,h),D(nZ,f),D(nj,m),D(nH,g),D(n6,N),D(n3,k),D(n2,T),D(nY,b),D(n0,x),D(n1,w),E(A))if(A.length){let t=e.exposed||(e.exposed={});A.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t})})}else e.exposed||(e.exposed={});C&&e.render===S&&(e.render=C),null!=I&&(e.inheritAttrs=I),R&&(e.components=R),O&&(e.directives=O)}(e)}finally{eL(),t()}}}let iD={get:(e,t)=>(eq(e,"get",""),e[t])};function iF(e){return{attrs:new Proxy(e.attrs,iD),slots:e.slots,emit:e.emit,expose:t=>{e.exposed=t||{}}}}function iV(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(tO(tx(e.exposed)),{get:(t,n)=>n in t?t[n]:n in re?re[n](e):void 0,has:(e,t)=>t in e||t in re})):e.proxy}function iB(e,t=!0){return P(e)?e.displayName||e.name:e.name||t&&e.__name}let iU=(e,t)=>(function(e,t,n=!1){let r,i;return P(e)?r=e:(r=e.get,i=e.set),new tF(r,i,n)})(e,0,iP);function ij(e,t,n){let r=arguments.length;return 2!==r?(r>3?n=Array.prototype.slice.call(arguments,2):3===r&&id(n)&&(n=[n]),iv(e,t,n)):!$(t)||E(t)?iv(e,null,t):id(t)?iv(e,null,[t]):iv(e,t)}function iH(e,t){let n=e.memo;if(n.length!=t.length)return!1;for(let e=0;e0&&ii&&ii.push(e),!0}let iq="3.5.17",iW="undefined"!=typeof window&&window.trustedTypes;if(iW)try{g=iW.createPolicy("vue",{createHTML:e=>e})}catch(e){}let iK=g?e=>g.createHTML(e):e=>e,iz="undefined"!=typeof document?document:null,iJ=iz&&iz.createElement("template"),iG="transition",iX="animation",iQ=Symbol("_vtc"),iZ={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},iY=T({},nm,iZ),i0=((t=(e,{slots:t})=>ij(ny,i3(e),t)).displayName="Transition",t.props=iY,t),i1=(e,t=[])=>{E(e)?e.forEach(e=>e(...t)):e&&e(...t)},i2=e=>!!e&&(E(e)?e.some(e=>e.length>1):e.length>1);function i3(e){let t={};for(let n in e)n in iZ||(t[n]=e[n]);if(!1===e.css)return t;let{name:n="v",type:r,duration:i,enterFromClass:l=`${n}-enter-from`,enterActiveClass:s=`${n}-enter-active`,enterToClass:o=`${n}-enter-to`,appearFromClass:a=l,appearActiveClass:c=s,appearToClass:u=o,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:p=`${n}-leave-active`,leaveToClass:h=`${n}-leave-to`}=e,f=function(e){if(null==e)return null;{if($(e))return[function(e){return et(e)}(e.enter),function(e){return et(e)}(e.leave)];let t=function(e){return et(e)}(e);return[t,t]}}(i),m=f&&f[0],g=f&&f[1],{onBeforeEnter:y,onEnter:b,onEnterCancelled:_,onLeave:S,onLeaveCancelled:x,onBeforeAppear:C=y,onAppear:k=b,onAppearCancelled:N=_}=t,w=(e,t,n,r)=>{e._enterCancelled=r,i4(e,t?u:o),i4(e,t?c:s),n&&n()},A=(e,t)=>{e._isLeaving=!1,i4(e,d),i4(e,h),i4(e,p),t&&t()},E=e=>(t,n)=>{let i=e?k:b,s=()=>w(t,e,n);i1(i,[t,s]),i8(()=>{i4(t,e?a:l),i6(t,e?u:o),i2(i)||i9(t,r,m,s)})};return T(t,{onBeforeEnter(e){i1(y,[e]),i6(e,l),i6(e,s)},onBeforeAppear(e){i1(C,[e]),i6(e,a),i6(e,c)},onEnter:E(!1),onAppear:E(!0),onLeave(e,t){e._isLeaving=!0;let n=()=>A(e,t);i6(e,d),e._enterCancelled?(i6(e,p),ln()):(ln(),i6(e,p)),i8(()=>{e._isLeaving&&(i4(e,d),i6(e,h),i2(S)||i9(e,r,g,n))}),i1(S,[e,n])},onEnterCancelled(e){w(e,!1,void 0,!0),i1(_,[e])},onAppearCancelled(e){w(e,!0,void 0,!0),i1(N,[e])},onLeaveCancelled(e){A(e),i1(x,[e])}})}function i6(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.add(t)),(e[iQ]||(e[iQ]=new Set)).add(t)}function i4(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.remove(t));let n=e[iQ];n&&(n.delete(t),n.size||(e[iQ]=void 0))}function i8(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let i5=0;function i9(e,t,n,r){let i=e._endId=++i5,l=()=>{i===e._endId&&r()};if(null!=n)return setTimeout(l,n);let{type:s,timeout:o,propCount:a}=i7(e,t);if(!s)return r();let c=s+"end",u=0,d=()=>{e.removeEventListener(c,p),l()},p=t=>{t.target===e&&++u>=a&&d()};setTimeout(()=>{u(n[e]||"").split(", "),i=r(`${iG}Delay`),l=r(`${iG}Duration`),s=le(i,l),o=r(`${iX}Delay`),a=r(`${iX}Duration`),c=le(o,a),u=null,d=0,p=0;t===iG?s>0&&(u=iG,d=s,p=l.length):t===iX?c>0&&(u=iX,d=c,p=a.length):p=(u=(d=Math.max(s,c))>0?s>c?iG:iX:null)?u===iG?l.length:a.length:0;let h=u===iG&&/\b(transform|all)(,|$)/.test(r(`${iG}Property`).toString());return{type:u,timeout:d,propCount:p,hasTransform:h}}function le(e,t){for(;e.lengthlt(t)+lt(e[n])))}function lt(e){return"auto"===e?0:1e3*Number(e.slice(0,-1).replace(",","."))}function ln(){return document.body.offsetHeight}let lr=Symbol("_vod"),li=Symbol("_vsh");function ll(e,t){e.style.display=t?e[lr]:"none",e[li]=!t}let ls=Symbol("");function lo(e,t){if(1===e.nodeType){let n=e.style,r="";for(let e in t)n.setProperty(`--${e}`,t[e]),r+=`--${e}: ${t[e]};`;n[ls]=r}}let la=/(^|;)\s*display\s*:/,lc=/\s*!important$/;function lu(e,t,n){if(E(n))n.forEach(n=>lu(e,t,n));else if(null==n&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{let r=function(e,t){let n=lp[t];if(n)return n;let r=K(t);if("filter"!==r&&r in e)return lp[t]=r;r=G(r);for(let n=0;n111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)>96&&123>e.charCodeAt(2),lx={};function lC(e,t,n){let r=nT(e,t);B(r)&&T(r,t);class i extends lT{constructor(e){super(r,e,n)}}return i.def=r,i}let lk="undefined"!=typeof HTMLElement?HTMLElement:class{};class lT extends lk{constructor(e,t={},n=l1){super(),this._def=e,this._props=t,this._createApp=n,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._ob=null,this.shadowRoot&&n!==l1?this._root=this.shadowRoot:!1!==e.shadowRoot?(this.attachShadow({mode:"open"}),this._root=this.shadowRoot):this._root=this}connectedCallback(){if(!this.isConnected)return;this.shadowRoot||this._resolved||this._parseSlots(),this._connected=!0;let e=this;for(;e=e&&(e.parentNode||e.host);)if(e instanceof lT){this._parent=e;break}this._instance||(this._resolved?this._mount(this._def):e&&e._pendingResolve?this._pendingResolve=e._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(e=this._parent){e&&(this._instance.parent=e._instance,this._inheritParentContext(e))}_inheritParentContext(e=this._parent){e&&this._app&&Object.setPrototypeOf(this._app._context.provides,e._instance.provides)}disconnectedCallback(){this._connected=!1,tY(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null)})}_resolveDef(){if(this._pendingResolve)return;for(let e=0;e{for(let t of e)this._setAttr(t.attributeName)}),this._ob.observe(this,{attributes:!0});let e=(e,t=!1)=>{let n;this._resolved=!0,this._pendingResolve=void 0;let{props:r,styles:i}=e;if(r&&!E(r))for(let e in r){let t=r[e];(t===Number||t&&t.type===Number)&&(e in this._props&&(this._props[e]=et(this._props[e])),(n||(n=Object.create(null)))[K(e)]=!0)}this._numberProps=n,this._resolveProps(e),this.shadowRoot&&this._applyStyles(i),this._mount(e)},t=this._def.__asyncLoader;t?this._pendingResolve=t().then(t=>{t.configureApp=this._def.configureApp,e(this._def=t,!0)}):e(this._def)}_mount(e){this._app=this._createApp(e),this._inheritParentContext(),e.configureApp&&e.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);let t=this._instance&&this._instance.exposed;if(t)for(let e in t)A(this,e)||Object.defineProperty(this,e,{get:()=>tI(t[e])})}_resolveProps(e){let{props:t}=e,n=E(t)?t:Object.keys(t||{});for(let e of Object.keys(this))"_"!==e[0]&&n.includes(e)&&this._setProp(e,this[e]);for(let e of n.map(K))Object.defineProperty(this,e,{get(){return this._getProp(e)},set(t){this._setProp(e,t,!0,!0)}})}_setAttr(e){if(e.startsWith("data-v-"))return;let t=this.hasAttribute(e),n=t?this.getAttribute(e):lx,r=K(e);t&&this._numberProps&&this._numberProps[r]&&(n=et(n)),this._setProp(r,n,!1,!0)}_getProp(e){return this._props[e]}_setProp(e,t,n=!0,r=!1){if(t!==this._props[e]&&(t===lx?delete this._props[e]:(this._props[e]=t,"key"===e&&this._app&&(this._app._ceVNode.key=t)),r&&this._instance&&this._update(),n)){let n=this._ob;n&&n.disconnect(),!0===t?this.setAttribute(J(e),""):"string"==typeof t||"number"==typeof t?this.setAttribute(J(e),t+""):t||this.removeAttribute(J(e)),n&&n.observe(this,{attributes:!0})}}_update(){let e=this._createVNode();this._app&&(e.appContext=this._app._context),l0(e,this._root)}_createVNode(){let e={};this.shadowRoot||(e.onVnodeMounted=e.onVnodeUpdated=this._renderSlots.bind(this));let t=iv(this._def,T(e,this._props));return this._instance||(t.ce=e=>{this._instance=e,e.ce=this,e.isCE=!0;let t=(e,t)=>{this.dispatchEvent(new CustomEvent(e,B(t[0])?T({detail:t},t[0]):{detail:t}))};e.emit=(e,...n)=>{t(e,n),J(e)!==e&&t(J(e),n)},this._setParent()}),t}_applyStyles(e,t){if(!e)return;if(t){if(t===this._def||this._styleChildren.has(t))return;this._styleChildren.add(t)}let n=this._nonce;for(let t=e.length-1;t>=0;t--){let r=document.createElement("style");n&&r.setAttribute("nonce",n),r.textContent=e[t],this.shadowRoot.prepend(r)}}_parseSlots(){let e,t=this._slots={};for(;e=this.firstChild;){let n=1===e.nodeType&&e.getAttribute("slot")||"default";(t[n]||(t[n]=[])).push(e),this.removeChild(e)}}_renderSlots(){let e=(this._teleportTarget||this).querySelectorAll("slot"),t=this._instance.type.__scopeId;for(let n=0;n{if(!n.length)return;let t=e.moveClass||`${e.name||"v"}-move`;if(!function(e,t,n){let r=e.cloneNode(),i=e[iQ];i&&i.forEach(e=>{e.split(/\s+/).forEach(e=>e&&r.classList.remove(e))}),n.split(/\s+/).forEach(e=>e&&r.classList.add(e)),r.style.display="none";let l=1===t.nodeType?t:t.parentNode;l.appendChild(r);let{hasTransform:s}=i7(r);return l.removeChild(r),s}(n[0].el,i.vnode.el,t)){n=[];return}n.forEach(lO),n.forEach(lP);let r=n.filter(lM);ln(),r.forEach(e=>{let n=e.el,r=n.style;i6(n,t),r.transform=r.webkitTransform=r.transitionDuration="";let i=n[lE]=e=>{(!e||e.target===n)&&(!e||/transform$/.test(e.propertyName))&&(n.removeEventListener("transitionend",i),n[lE]=null,i4(n,t))};n.addEventListener("transitionend",i)}),n=[]}),()=>{let s=tS(e),o=i3(s),a=s.tag||r9;if(n=[],r)for(let e=0;e{let t=e.props["onUpdate:modelValue"]||!1;return E(t)?e=>Z(t,e):t};function l$(e){e.target.composing=!0}function lD(e){let t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}let lF=Symbol("_assign"),lV={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e[lF]=lL(i);let l=r||i.props&&"number"===i.props.type;lg(e,t?"change":"input",t=>{if(t.target.composing)return;let r=e.value;n&&(r=r.trim()),l&&(r=ee(r)),e[lF](r)}),n&&lg(e,"change",()=>{e.value=e.value.trim()}),t||(lg(e,"compositionstart",l$),lg(e,"compositionend",lD),lg(e,"change",lD))},mounted(e,{value:t}){e.value=null==t?"":t},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:l}},s){if(e[lF]=lL(s),e.composing)return;let o=(l||"number"===e.type)&&!/^0\d/.test(e.value)?ee(e.value):e.value,a=null==t?"":t;if(o!==a){if(document.activeElement===e&&"range"!==e.type&&(r&&t===n||i&&e.value.trim()===a))return;e.value=a}}},lB={deep:!0,created(e,t,n){e[lF]=lL(n),lg(e,"change",()=>{let t=e._modelValue,n=lW(e),r=e.checked,i=e[lF];if(E(t)){let e=eg(t,n),l=-1!==e;if(r&&!l)i(t.concat(n));else if(!r&&l){let n=[...t];n.splice(e,1),i(n)}}else if(R(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(lK(e,r))})},mounted:lU,beforeUpdate(e,t,n){e[lF]=lL(n),lU(e,t,n)}};function lU(e,{value:t,oldValue:n},r){let i;if(e._modelValue=t,E(t))i=eg(t,r.props.value)>-1;else if(R(t))i=t.has(r.props.value);else{if(t===n)return;i=em(t,lK(e,!0))}e.checked!==i&&(e.checked=i)}let lj={created(e,{value:t},n){e.checked=em(t,n.props.value),e[lF]=lL(n),lg(e,"change",()=>{e[lF](lW(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[lF]=lL(r),t!==n&&(e.checked=em(t,r.props.value))}},lH={deep:!0,created(e,{value:t,modifiers:{number:n}},r){let i=R(t);lg(e,"change",()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?ee(lW(e)):lW(e));e[lF](e.multiple?i?new Set(t):t:t[0]),e._assigning=!0,tY(()=>{e._assigning=!1})}),e[lF]=lL(r)},mounted(e,{value:t}){lq(e,t)},beforeUpdate(e,t,n){e[lF]=lL(n)},updated(e,{value:t}){e._assigning||lq(e,t)}};function lq(e,t){let n=e.multiple,r=E(t);if(!n||r||R(t)){for(let i=0,l=e.options.length;iString(e)===String(s)):l.selected=eg(t,s)>-1}else l.selected=t.has(s);else if(em(lW(l),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}n||-1===e.selectedIndex||(e.selectedIndex=-1)}}function lW(e){return"_value"in e?e._value:e.value}function lK(e,t){let n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}function lz(e,t,n,r,i){let l=function(e,t){switch(e){case"SELECT":return lH;case"TEXTAREA":return lV;default:switch(t){case"checkbox":return lB;case"radio":return lj;default:return lV}}}(e.tagName,n.props&&n.props.type)[i];l&&l(e,t,n,r)}let lJ=["ctrl","shift","alt","meta"],lG={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&0!==e.button,middle:e=>"button"in e&&1!==e.button,right:e=>"button"in e&&2!==e.button,exact:(e,t)=>lJ.some(n=>e[`${n}Key`]&&!t.includes(n))},lX={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},lQ=T({patchProp:(e,t,n,r,i,l)=>{let s="svg"===i;if("class"===t){var o=r;let t=e[iQ];t&&(o=(o?[o,...t]:[...t]).join(" ")),null==o?e.removeAttribute("class"):s?e.setAttribute("class",o):e.className=o}else"style"===t?function(e,t,n){let r=e.style,i=M(n),l=!1;if(n&&!i){if(t)if(M(t))for(let e of t.split(";")){let t=e.slice(0,e.indexOf(":")).trim();null==n[t]&&lu(r,t,"")}else for(let e in t)null==n[e]&&lu(r,e,"");for(let e in n)"display"===e&&(l=!0),lu(r,e,n[e])}else if(i){if(t!==n){let e=r[ls];e&&(n+=";"+e),r.cssText=n,l=la.test(n)}}else t&&e.removeAttribute("style");lr in e&&(e[lr]=l?r.display:"",e[li]&&(r.display="none"))}(e,n,r):C(t)?k(t)||function(e,t,n,r,i=null){let l=e[lv]||(e[lv]={}),s=l[t];if(r&&s)s.value=r;else{let[n,o]=function(e){let t;if(ly.test(e)){let n;for(t={};n=e.match(ly);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[":"===e[2]?e.slice(3):J(e.slice(2)),t]}(t);if(r)lg(e,n,l[t]=function(e,t){let n=e=>{if(e._vts){if(e._vts<=n.attached)return}else e._vts=Date.now();tq(function(e,t){if(!E(t))return t;{let n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(e=>t=>!t._stopped&&e&&e(t))}}(e,n.value),t,5,[e])};return n.value=e,n.attached=lb||(l_.then(()=>lb=0),lb=Date.now()),n}(r,i),o);else s&&(e.removeEventListener(n,s,o),l[t]=void 0)}}(e,t,0,r,l):("."===t[0]?(t=t.slice(1),0):"^"===t[0]?(t=t.slice(1),1):!function(e,t,n,r){if(r)return!!("innerHTML"===t||"textContent"===t||t in e&&lS(t)&&P(n));if("spellcheck"===t||"draggable"===t||"translate"===t||"autocorrect"===t||"form"===t||"list"===t&&"INPUT"===e.tagName||"type"===t&&"TEXTAREA"===e.tagName)return!1;if("width"===t||"height"===t){let t=e.tagName;if("IMG"===t||"VIDEO"===t||"CANVAS"===t||"SOURCE"===t)return!1}return!(lS(t)&&M(n))&&t in e}(e,t,r,s))?e._isVueCE&&(/[A-Z]/.test(t)||!M(r))?lm(e,K(t),r,l,t):("true-value"===t?e._trueValue=r:"false-value"===t&&(e._falseValue=r),lf(e,t,r,s)):(lm(e,t,r),e.tagName.includes("-")||"value"!==t&&"checked"!==t&&"selected"!==t||lf(e,t,r,s,l,"value"!==t))}},{insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i="svg"===t?iz.createElementNS("http://www.w3.org/2000/svg",e):"mathml"===t?iz.createElementNS("http://www.w3.org/1998/Math/MathML",e):n?iz.createElement(e,{is:n}):iz.createElement(e);return"select"===e&&r&&null!=r.multiple&&i.setAttribute("multiple",r.multiple),i},createText:e=>iz.createTextNode(e),createComment:e=>iz.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>iz.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,i,l){let s=n?n.previousSibling:t.lastChild;if(i&&(i===l||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),i!==l&&(i=i.nextSibling););else{iJ.innerHTML=iK("svg"===r?`${e}`:"mathml"===r?`${e}`:e);let i=iJ.content;if("svg"===r||"mathml"===r){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[s?s.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}}),lZ=!1;function lY(){return h=lZ?h:rL(lQ),lZ=!0,h}let l0=(...e)=>{(h||(h=r$(lQ))).render(...e)},l1=(...e)=>{let t=(h||(h=r$(lQ))).createApp(...e),{mount:n}=t;return t.mount=e=>{let r=l6(e);if(!r)return;let i=t._component;P(i)||i.render||i.template||(i.template=r.innerHTML),1===r.nodeType&&(r.textContent="");let l=n(r,!1,l3(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),l},t},l2=(...e)=>{let t=lY().createApp(...e),{mount:n}=t;return t.mount=e=>{let t=l6(e);if(t)return n(t,!0,l3(t))},t};function l3(e){return e instanceof SVGElement?"svg":"function"==typeof MathMLElement&&e instanceof MathMLElement?"mathml":void 0}function l6(e){return M(e)?document.querySelector(e):e}let l4=Symbol(""),l8=Symbol(""),l5=Symbol(""),l9=Symbol(""),l7=Symbol(""),se=Symbol(""),st=Symbol(""),sn=Symbol(""),sr=Symbol(""),si=Symbol(""),sl=Symbol(""),ss=Symbol(""),so=Symbol(""),sa=Symbol(""),sc=Symbol(""),su=Symbol(""),sd=Symbol(""),sp=Symbol(""),sh=Symbol(""),sf=Symbol(""),sm=Symbol(""),sg=Symbol(""),sv=Symbol(""),sy=Symbol(""),sb=Symbol(""),s_=Symbol(""),sS=Symbol(""),sx=Symbol(""),sC=Symbol(""),sk=Symbol(""),sT=Symbol(""),sN=Symbol(""),sw=Symbol(""),sA=Symbol(""),sE=Symbol(""),sI=Symbol(""),sR=Symbol(""),sO=Symbol(""),sP=Symbol(""),sM={[l4]:"Fragment",[l8]:"Teleport",[l5]:"Suspense",[l9]:"KeepAlive",[l7]:"BaseTransition",[se]:"openBlock",[st]:"createBlock",[sn]:"createElementBlock",[sr]:"createVNode",[si]:"createElementVNode",[sl]:"createCommentVNode",[ss]:"createTextVNode",[so]:"createStaticVNode",[sa]:"resolveComponent",[sc]:"resolveDynamicComponent",[su]:"resolveDirective",[sd]:"resolveFilter",[sp]:"withDirectives",[sh]:"renderList",[sf]:"renderSlot",[sm]:"createSlots",[sg]:"toDisplayString",[sv]:"mergeProps",[sy]:"normalizeClass",[sb]:"normalizeStyle",[s_]:"normalizeProps",[sS]:"guardReactiveProps",[sx]:"toHandlers",[sC]:"camelize",[sk]:"capitalize",[sT]:"toHandlerKey",[sN]:"setBlockTracking",[sw]:"pushScopeId",[sA]:"popScopeId",[sE]:"withCtx",[sI]:"unref",[sR]:"isRef",[sO]:"withMemo",[sP]:"isMemoSame"},sL={start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0},source:""};function s$(e,t,n,r,i,l,s,o=!1,a=!1,c=!1,u=sL){var d,p,h,f;return e&&(o?(e.helper(se),e.helper((d=e.inSSR,p=c,d||p?st:sn))):e.helper((h=e.inSSR,f=c,h||f?sr:si)),s&&e.helper(sp)),{type:13,tag:t,props:n,children:r,patchFlag:i,dynamicProps:l,directives:s,isBlock:o,disableTracking:a,isComponent:c,loc:u}}function sD(e,t=sL){return{type:17,loc:t,elements:e}}function sF(e,t=sL){return{type:15,loc:t,properties:e}}function sV(e,t){return{type:16,loc:sL,key:M(e)?sB(e,!0):e,value:t}}function sB(e,t=!1,n=sL,r=0){return{type:4,loc:n,content:e,isStatic:t,constType:t?3:r}}function sU(e,t=sL){return{type:8,loc:t,children:e}}function sj(e,t=[],n=sL){return{type:14,loc:n,callee:e,arguments:t}}function sH(e,t,n=!1,r=!1,i=sL){return{type:18,params:e,returns:t,newline:n,isSlot:r,loc:i}}function sq(e,t,n,r=!0){return{type:19,test:e,consequent:t,alternate:n,newline:r,loc:sL}}function sW(e,{helper:t,removeHelper:n,inSSR:r}){if(!e.isBlock){var i,l;e.isBlock=!0,n((i=e.isComponent,r||i?sr:si)),t(se),t((l=e.isComponent,r||l?st:sn))}}let sK=new Uint8Array([123,123]),sz=new Uint8Array([125,125]);function sJ(e){return e>=97&&e<=122||e>=65&&e<=90}function sG(e){return 32===e||10===e||9===e||12===e||13===e}function sX(e){return 47===e||62===e||sG(e)}function sQ(e){let t=new Uint8Array(e.length);for(let n=0;n4===e.type&&e.isStatic;function s3(e){switch(e){case"Teleport":case"teleport":return l8;case"Suspense":case"suspense":return l5;case"KeepAlive":case"keep-alive":return l9;case"BaseTransition":case"base-transition":return l7}}let s6=/^\d|[^\$\w\xA0-\uFFFF]/,s4=e=>!s6.test(e),s8=/[A-Za-z_$\xA0-\uFFFF]/,s5=/[\.\?\w$\xA0-\uFFFF]/,s9=/\s+[.[]\s*|\s*[.[]\s+/g,s7=e=>4===e.type?e.content:e.loc.source,oe=e=>{let t=s7(e).trim().replace(s9,e=>e.trim()),n=0,r=[],i=0,l=0,s=null;for(let e=0;e|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/;function on(e,t,n=!1){for(let r=0;r4===e.key.type&&e.key.content===r)}return n}function op(e,t){return`_${t}_${e.replace(/[^\w]/g,(t,n)=>"-"===t?"_":e.charCodeAt(n).toString())}`}let oh=/([\s\S]*?)\s+(?:in|of)\s+(\S[\s\S]*)/,of={parseMode:"base",ns:0,delimiters:["{{","}}"],getNamespace:()=>0,isVoidTag:x,isPreTag:x,isIgnoreNewlineTag:x,isCustomElement:x,onError:sY,onWarn:s0,comments:!1,prefixIdentifiers:!1},om=of,og=null,ov="",oy=null,ob=null,o_="",oS=-1,ox=-1,oC=0,ok=!1,oT=null,oN=[],ow=new class{constructor(e,t){this.stack=e,this.cbs=t,this.state=1,this.buffer="",this.sectionStart=0,this.index=0,this.entityStart=0,this.baseState=1,this.inRCDATA=!1,this.inXML=!1,this.inVPre=!1,this.newlines=[],this.mode=0,this.delimiterOpen=sK,this.delimiterClose=sz,this.delimiterIndex=-1,this.currentSequence=void 0,this.sequenceIndex=0}get inSFCRoot(){return 2===this.mode&&0===this.stack.length}reset(){this.state=1,this.mode=0,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=1,this.inRCDATA=!1,this.currentSequence=void 0,this.newlines.length=0,this.delimiterOpen=sK,this.delimiterClose=sz}getPos(e){let t=1,n=e+1;for(let r=this.newlines.length-1;r>=0;r--){let i=this.newlines[r];if(e>i){t=r+2,n=e-i;break}}return{column:n,line:t,offset:e}}peek(){return this.buffer.charCodeAt(this.index+1)}stateText(e){60===e?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=5,this.sectionStart=this.index):this.inVPre||e!==this.delimiterOpen[0]||(this.state=2,this.delimiterIndex=0,this.stateInterpolationOpen(e))}stateInterpolationOpen(e){if(e===this.delimiterOpen[this.delimiterIndex])if(this.delimiterIndex===this.delimiterOpen.length-1){let e=this.index+1-this.delimiterOpen.length;e>this.sectionStart&&this.cbs.ontext(this.sectionStart,e),this.state=3,this.sectionStart=e}else this.delimiterIndex++;else this.inRCDATA?(this.state=32,this.stateInRCDATA(e)):(this.state=1,this.stateText(e))}stateInterpolation(e){e===this.delimiterClose[0]&&(this.state=4,this.delimiterIndex=0,this.stateInterpolationClose(e))}stateInterpolationClose(e){e===this.delimiterClose[this.delimiterIndex]?this.delimiterIndex===this.delimiterClose.length-1?(this.cbs.oninterpolation(this.sectionStart,this.index+1),this.inRCDATA?this.state=32:this.state=1,this.sectionStart=this.index+1):this.delimiterIndex++:(this.state=3,this.stateInterpolation(e))}stateSpecialStartSequence(e){let t=this.sequenceIndex===this.currentSequence.length;if(t?sX(e):(32|e)===this.currentSequence[this.sequenceIndex]){if(!t)return void this.sequenceIndex++}else this.inRCDATA=!1;this.sequenceIndex=0,this.state=6,this.stateInTagName(e)}stateInRCDATA(e){if(this.sequenceIndex===this.currentSequence.length){if(62===e||sG(e)){let t=this.index-this.currentSequence.length;if(this.sectionStart=e||(28===this.state?this.currentSequence===sZ.CdataEnd?this.cbs.oncdata(this.sectionStart,e):this.cbs.oncomment(this.sectionStart,e):6===this.state||11===this.state||18===this.state||17===this.state||12===this.state||13===this.state||14===this.state||15===this.state||16===this.state||20===this.state||19===this.state||21===this.state||9===this.state||this.cbs.ontext(this.sectionStart,e))}emitCodePoint(e,t){}}(oN,{onerr:oH,ontext(e,t){oO(oI(e,t),e,t)},ontextentity(e,t,n){oO(e,t,n)},oninterpolation(e,t){if(ok)return oO(oI(e,t),e,t);let n=e+ow.delimiterOpen.length,r=t-ow.delimiterClose.length;for(;sG(ov.charCodeAt(n));)n++;for(;sG(ov.charCodeAt(r-1));)r--;let i=oI(n,r);i.includes("&")&&(i=om.decodeEntities(i,!1)),oV({type:5,content:oj(i,!1,oB(n,r)),loc:oB(e,t)})},onopentagname(e,t){let n=oI(e,t);oy={type:1,tag:n,ns:om.getNamespace(n,oN[0],om.ns),tagType:0,props:[],children:[],loc:oB(e-1,t),codegenNode:void 0}},onopentagend(e){oR(e)},onclosetag(e,t){let n=oI(e,t);if(!om.isVoidTag(n)){let r=!1;for(let e=0;e0&&oN[0].loc.start.offset;for(let n=0;n<=e;n++)oP(oN.shift(),t,n(7===e.type?e.rawName:e.name)===t)},onattribend(e,t){oy&&ob&&(oU(ob.loc,t),0!==e&&(o_.includes("&")&&(o_=om.decodeEntities(o_,!0)),6===ob.type?("class"===ob.name&&(o_=oF(o_).trim()),ob.value={type:2,content:o_,loc:1===e?oB(oS,ox):oB(oS-1,ox+1)},ow.inSFCRoot&&"template"===oy.tag&&"lang"===ob.name&&o_&&"html"!==o_&&ow.enterRCDATA(sQ("{let i=t.start.offset+n,l=i+e.length;return oj(e,!1,oB(i,l),0,+!!r)},o={source:s(l.trim(),n.indexOf(l,i.length)),value:void 0,key:void 0,index:void 0,finalized:!1},a=i.trim().replace(oE,"").trim(),c=i.indexOf(a),u=a.match(oA);if(u){let e;a=a.replace(oA,"").trim();let t=u[1].trim();if(t&&(e=n.indexOf(t,c+a.length),o.key=s(t,e,!0)),u[2]){let r=u[2].trim();r&&(o.index=s(r,n.indexOf(r,o.key?e+t.length:c+a.length),!0))}}return a&&(o.value=s(a,c,!0)),o}(ob.exp)))),(7!==ob.type||"pre"!==ob.name)&&oy.props.push(ob)),o_="",oS=ox=-1},oncomment(e,t){om.comments&&oV({type:3,content:oI(e,t),loc:oB(e-4,t+3)})},onend(){let e=ov.length;for(let t=0;t64&&n<91||s3(e)||om.isBuiltInComponent&&om.isBuiltInComponent(e)||om.isNativeTag&&!om.isNativeTag(e))return!0;for(let e=0;e=0;)n--;return n}let oL=new Set(["if","else","else-if","for","slot"]),o$=/\r\n/g;function oD(e){let t="preserve"!==om.whitespace,n=!1;for(let r=0;r3!==e.type);return 1!==t.length||1!==t[0].type||oa(t[0])?null:t[0]}function oW(e,t){let{constantCache:n}=t;switch(e.type){case 1:if(0!==e.tagType)return 0;let r=n.get(e);if(void 0!==r)return r;let i=e.codegenNode;if(13!==i.type||i.isBlock&&"svg"!==e.tag&&"foreignObject"!==e.tag&&"math"!==e.tag)return 0;if(void 0!==i.patchFlag)return n.set(e,0),0;{let r=3,c=oz(e,t);if(0===c)return n.set(e,0),0;c1)for(let i=0;i{l--};for(;lt===e:t=>e.test(t);return(e,r)=>{if(1===e.type){let{props:i}=e;if(3===e.tagType&&i.some(os))return;let l=[];for(let s=0;s`${sM[e]}: _${sM[e]}`;function oY(e,t,{helper:n,push:r,newline:i,isTS:l}){let s=n("component"===t?sa:su);for(let n=0;n3;t.push("["),n&&t.indent(),o1(e,t,n),n&&t.deindent(),t.push("]")}function o1(e,t,n=!1,r=!0){let{push:i,newline:l}=t;for(let s=0;se||"null")}([a,c,u,i,p]),t),l(")"),f&&l(")"),h&&(l(", "),o2(h,t),l(")"))}(e,t);break;case 14:var m=e,g=t;let{push:y,helper:b,pure:_}=g,S=M(m.callee)?m.callee:b(m.callee);_&&y(oQ),y(S+"(",-2,m),o1(m.arguments,g),y(")");break;case 15:!function(e,t){let{push:n,indent:r,deindent:i,newline:l}=t,{properties:s}=e;if(!s.length)return n("{}",-2,e);let o=s.length>1;n(o?"{":"{ "),o&&r();for(let e=0;e "),(R||I)&&(k("{"),T()),A?(R&&k("return "),E(A)?o0(A,C):o2(A,C)):I&&o2(I,C),(R||I)&&(N(),k("}")),O&&k(")");break;case 19:var P=e,$=t;let{test:D,consequent:F,alternate:V,newline:B}=P,{push:U,indent:j,deindent:H,newline:q}=$;if(4===D.type){let e=!s4(D.content);e&&U("("),o3(D,$),e&&U(")")}else U("("),o2(D,$),U(")");B&&j(),$.indentLevel++,B||U(" "),U("? "),o2(F,$),$.indentLevel--,B&&q(),B||U(" "),U(": ");let W=19===V.type;!W&&$.indentLevel++,o2(V,$),!W&&$.indentLevel--,B&&H(!0);break;case 20:var K=e,z=t;let{push:J,helper:G,indent:X,deindent:Q,newline:Z}=z,{needPauseTracking:Y,needArraySpread:ee}=K;ee&&J("[...("),J(`_cache[${K.index}] || (`),Y&&(X(),J(`${G(sN)}(-1`),K.inVOnce&&J(", true"),J("),"),Z(),J("(")),J(`_cache[${K.index}] = `),o2(K.value,z),Y&&(J(`).cacheIndex = ${K.index},`),Z(),J(`${G(sN)}(1),`),Z(),J(`_cache[${K.index}]`),Q()),J(")"),ee&&J(")]");break;case 21:o1(e.body,t,!0,!1)}}function o3(e,t){let{content:n,isStatic:r}=e;t.push(r?JSON.stringify(n):n,-3,e)}function o6(e,t){for(let n=0;n(function(e,t,n,r){if("else"!==t.name&&(!t.exp||!t.exp.content.trim())){let r=t.exp?t.exp.loc:e.loc;n.onError(s1(28,t.loc)),t.exp=sB("true",!1,r)}if("if"===t.name){var i;let l=o8(e,t),s={type:9,loc:oB((i=e.loc).start.offset,i.end.offset),branches:[l]};if(n.replaceNode(s),r)return r(s,l,!0)}else{let i=n.parent.children,l=i.indexOf(e);for(;l-- >=-1;){let s=i[l];if(s&&3===s.type||s&&2===s.type&&!s.content.trim().length){n.removeNode(s);continue}if(s&&9===s.type){"else-if"===t.name&&void 0===s.branches[s.branches.length-1].condition&&n.onError(s1(30,e.loc)),n.removeNode();let i=o8(e,t);s.branches.push(i);let l=r&&r(s,i,!1);oG(i,n),l&&l(),n.currentNode=null}else n.onError(s1(30,e.loc));break}}})(e,t,n,(e,t,r)=>{let i=n.parent.children,l=i.indexOf(e),s=0;for(;l-- >=0;){let e=i[l];e&&9===e.type&&(s+=e.branches.length)}return()=>{r?e.codegenNode=o5(t,s,n):function(e){for(;;)if(19===e.type)if(19!==e.alternate.type)return e;else e=e.alternate;else 20===e.type&&(e=e.value)}(e.codegenNode).alternate=o5(t,s+e.branches.length-1,n)}}));function o8(e,t){let n=3===e.tagType;return{type:10,loc:e.loc,condition:"else"===t.name?void 0:t.exp,children:n&&!on(e,"for")?e.children:[e],userKey:or(e,"key"),isTemplateIf:n}}function o5(e,t,n){return e.condition?sq(e.condition,o9(e,t,n),sj(n.helper(sl),['""',"true"])):o9(e,t,n)}function o9(e,t,n){let{helper:r}=n,i=sV("key",sB(`${t}`,!1,sL,2)),{children:l}=e,s=l[0];if(1!==l.length||1!==s.type)if(1!==l.length||11!==s.type)return s$(n,r(l4),sF([i]),l,64,void 0,void 0,!0,!1,!1,e.loc);else{let e=s.codegenNode;return ou(e,i,n),e}{let e=s.codegenNode,t=14===e.type&&e.callee===sO?e.arguments[1].returns:e;return 13===t.type&&sW(t,n),ou(t,i,n),e}}let o7=(e,t,n)=>{let{modifiers:r,loc:i}=e,l=e.arg,{exp:s}=e;if(s&&4===s.type&&!s.content.trim()&&(s=void 0),!s){if(4!==l.type||!l.isStatic)return n.onError(s1(52,l.loc)),{props:[sV(l,sB("",!0,i))]};ae(e),s=e.exp}return 4!==l.type?(l.children.unshift("("),l.children.push(') || ""')):l.isStatic||(l.content=`${l.content} || ""`),r.some(e=>"camel"===e.content)&&(4===l.type?l.isStatic?l.content=K(l.content):l.content=`${n.helperString(sC)}(${l.content})`:(l.children.unshift(`${n.helperString(sC)}(`),l.children.push(")"))),!n.inSSR&&(r.some(e=>"prop"===e.content)&&at(l,"."),r.some(e=>"attr"===e.content)&&at(l,"^")),{props:[sV(l,s)]}},ae=(e,t)=>{let n=e.arg;e.exp=sB(K(n.content),!1,n.loc)},at=(e,t)=>{4===e.type?e.isStatic?e.content=t+e.content:e.content=`\`${t}\${${e.content}}\``:(e.children.unshift(`'${t}' + (`),e.children.push(")"))},an=oX("for",(e,t,n)=>{let{helper:r,removeHelper:i}=n;return function(e,t,n,r){if(!t.exp)return void n.onError(s1(31,t.loc));let i=t.forParseResult;if(!i)return void n.onError(s1(32,t.loc));ar(i);let{addIdentifiers:l,removeIdentifiers:s,scopes:o}=n,{source:a,value:c,key:u,index:d}=i,p={type:11,loc:t.loc,source:a,valueAlias:c,keyAlias:u,objectIndexAlias:d,parseResult:i,children:oo(e)?e.children:[e]};n.replaceNode(p),o.vFor++;let h=r&&r(p);return()=>{o.vFor--,h&&h()}}(e,t,n,t=>{let l=sj(r(sh),[t.source]),s=oo(e),o=on(e,"memo"),a=or(e,"key",!1,!0);a&&7===a.type&&!a.exp&&ae(a);let c=a&&(6===a.type?a.value?sB(a.value.content,!0):void 0:a.exp),u=a&&c?sV("key",c):null,d=4===t.source.type&&t.source.constType>0,p=d?64:a?128:256;return t.codegenNode=s$(n,r(l4),void 0,l,p,void 0,void 0,!0,!d,!1,e.loc),()=>{let a,{children:p}=t,h=1!==p.length||1!==p[0].type,f=oa(e)?e:s&&1===e.children.length&&oa(e.children[0])?e.children[0]:null;if(f)a=f.codegenNode,s&&u&&ou(a,u,n);else if(h)a=s$(n,r(l4),u?sF([u]):void 0,e.children,64,void 0,void 0,!0,void 0,!1);else{var m,g,y,b,_,S,x,C;a=p[0].codegenNode,s&&u&&ou(a,u,n),!d!==a.isBlock&&(a.isBlock?(i(se),i((m=n.inSSR,g=a.isComponent,m||g?st:sn))):i((y=n.inSSR,b=a.isComponent,y||b?sr:si))),(a.isBlock=!d,a.isBlock)?(r(se),r((_=n.inSSR,S=a.isComponent,_||S?st:sn))):r((x=n.inSSR,C=a.isComponent,x||C?sr:si))}if(o){let e=sH(ai(t.parseResult,[sB("_cached")]));e.body={type:21,body:[sU(["const _memo = (",o.exp,")"]),sU(["if (_cached",...c?[" && _cached.key === ",c]:[],` && ${n.helperString(sP)}(_cached, _memo)) return _cached`]),sU(["const _item = ",a]),sB("_item.memo = _memo"),sB("return _item")],loc:sL},l.arguments.push(e,sB("_cache"),sB(String(n.cached.length))),n.cached.push(null)}else l.arguments.push(sH(ai(t.parseResult),a,!0))}})});function ar(e,t){e.finalized||(e.finalized=!0)}function ai({value:e,key:t,index:n},r=[]){var i=[e,t,n,...r];let l=i.length;for(;l--&&!i[l];);return i.slice(0,l+1).map((e,t)=>e||sB("_".repeat(t+1),!1))}let al=sB("undefined",!1),as=(e,t)=>{if(1===e.type&&(1===e.tagType||3===e.tagType)){let n=on(e,"slot");if(n)return n.exp,t.scopes.vSlot++,()=>{t.scopes.vSlot--}}};function ao(e,t,n){let r=[sV("name",e),sV("fn",t)];return null!=n&&r.push(sV("key",sB(String(n),!0))),sF(r)}function aa(e){return 2!==e.type&&12!==e.type||(2===e.type?!!e.content.trim():aa(e.content))}let ac=new WeakMap,au=(e,t)=>function(){let n,r,i,l,s;if(1!==(e=t.currentNode).type||0!==e.tagType&&1!==e.tagType)return;let{tag:o,props:a}=e,c=1===e.tagType,u=c?function(e,t,n=!1){let{tag:r}=e,i=ah(r),l=or(e,"is",!1,!0);if(l)if(i){let e;if(6===l.type?e=l.value&&sB(l.value.content,!0):(e=l.exp)||(e=sB("is",!1,l.arg.loc)),e)return sj(t.helper(sc),[e])}else 6===l.type&&l.value.content.startsWith("vue:")&&(r=l.value.content.slice(4));let s=s3(r)||t.isBuiltInComponent(r);return s?(n||t.helper(s),s):(t.helper(sa),t.components.add(r),op(r,"component"))}(e,t):`"${o}"`,d=$(u)&&u.callee===sc,p=0,h=d||u===l8||u===l5||!c&&("svg"===o||"foreignObject"===o||"math"===o);if(a.length>0){let r=ad(e,t,void 0,c,d);n=r.props,p=r.patchFlag,l=r.dynamicPropNames;let i=r.directives;s=i&&i.length?sD(i.map(e=>(function(e,t){let n=[],r=ac.get(e);r?n.push(t.helperString(r)):(t.helper(su),t.directives.add(e.name),n.push(op(e.name,"directive")));let{loc:i}=e;if(e.exp&&n.push(e.exp),e.arg&&(e.exp||n.push("void 0"),n.push(e.arg)),Object.keys(e.modifiers).length){e.arg||(e.exp||n.push("void 0"),n.push("void 0"));let t=sB("true",!1,i);n.push(sF(e.modifiers.map(e=>sV(e,t)),i))}return sD(n,e.loc)})(e,t))):void 0,r.shouldUseBlock&&(h=!0)}if(e.children.length>0)if(u===l9&&(h=!0,p|=1024),c&&u!==l8&&u!==l9){let{slots:n,hasDynamicSlots:i}=function(e,t,n=(e,t,n,r)=>sH(e,n,!1,!0,n.length?n[0].loc:r)){t.helper(sE);let{children:r,loc:i}=e,l=[],s=[],o=t.scopes.vSlot>0||t.scopes.vFor>0,a=on(e,"slot",!0);if(a){let{arg:e,exp:t}=a;e&&!s2(e)&&(o=!0),l.push(sV(e||sB("default",!0),n(t,void 0,r,i)))}let c=!1,u=!1,d=[],p=new Set,h=0;for(let e=0;esV("default",n(e,void 0,t,i));c?d.length&&d.some(e=>aa(e))&&(u?t.onError(s1(39,d[0].loc)):l.push(e(void 0,d))):l.push(e(void 0,r))}let f=o?2:!function e(t){for(let n=0;n0,f=!1,m=0,g=!1,y=!1,b=!1,_=!1,S=!1,x=!1,k=[],T=e=>{u.length&&(d.push(sF(ap(u),a)),u=[]),e&&d.push(e)},N=()=>{t.scopes.vFor>0&&u.push(sV(sB("ref_for",!0),sB("true")))},w=({key:e,value:n})=>{if(s2(e)){let l=e.content,s=C(l);s&&(!r||i)&&"onclick"!==l.toLowerCase()&&"onUpdate:modelValue"!==l&&!j(l)&&(_=!0),s&&j(l)&&(x=!0),s&&14===n.type&&(n=n.arguments[0]),20===n.type||(4===n.type||8===n.type)&&oW(n,t)>0||("ref"===l?g=!0:"class"===l?y=!0:"style"===l?b=!0:"key"===l||k.includes(l)||k.push(l),r&&("class"===l||"style"===l)&&!k.includes(l)&&k.push(l))}else S=!0};for(let i=0;i"prop"===e.content)&&(m|=32);let x=t.directiveTransforms[n];if(x){let{props:n,needRuntime:r}=x(s,e,t);l||n.forEach(w),_&&i&&!s2(i)?T(sF(n,a)):u.push(...n),r&&(p.push(s),L(r)&&ac.set(s,r))}else!H(n)&&(p.push(s),h&&(f=!0))}}if(d.length?(T(),s=d.length>1?sj(t.helper(sv),d,a):d[0]):u.length&&(s=sF(ap(u),a)),S?m|=16:(y&&!r&&(m|=2),b&&!r&&(m|=4),k.length&&(m|=8),_&&(m|=32)),!f&&(0===m||32===m)&&(g||x||p.length>0)&&(m|=512),!t.inSSR&&s)switch(s.type){case 15:let A=-1,E=-1,I=!1;for(let e=0;e{if(oa(e)){let{children:n,loc:r}=e,{slotName:i,slotProps:l}=function(e,t){let n,r='"default"',i=[];for(let t=0;t0){let{props:r,directives:l}=ad(e,t,i,!1,!1);n=r,l.length&&t.onError(s1(36,l[0].loc))}return{slotName:r,slotProps:n}}(e,t),s=[t.prefixIdentifiers?"_ctx.$slots":"$slots",i,"{}","undefined","true"],o=2;l&&(s[2]=l,o=3),n.length&&(s[3]=sH([],n,!1,!1,r),o=4),t.scopeId&&!t.slotted&&(o=5),s.splice(o),e.codegenNode=sj(t.helper(sf),s,r)}},am=(e,t,n,r)=>{let i,{loc:l,modifiers:s,arg:o}=e;if(!e.exp&&!s.length,4===o.type)if(o.isStatic){let e=o.content;e.startsWith("vue:")&&(e=`vnode-${e.slice(4)}`),i=sB(0!==t.tagType||e.startsWith("vnode")||!/[A-Z]/.test(e)?X(K(e)):`on:${e}`,!0,o.loc)}else i=sU([`${n.helperString(sT)}(`,o,")"]);else(i=o).children.unshift(`${n.helperString(sT)}(`),i.children.push(")");let a=e.exp;a&&!a.content.trim()&&(a=void 0);let c=n.cacheHandlers&&!a&&!n.inVOnce;if(a){let e,t=oe(a),n=!(t||(e=a,ot.test(s7(e)))),r=a.content.includes(";");(n||c&&t)&&(a=sU([`${n?"$event":"(...args)"} => ${r?"{":"("}`,a,r?"}":")"]))}let u={props:[sV(i,a||sB("() => {}",!1,l))]};return r&&(u=r(u)),c&&(u.props[0].value=n.cache(u.props[0].value)),u.props.forEach(e=>e.key.isHandlerKey=!0),u},ag=(e,t)=>{if(0===e.type||1===e.type||11===e.type||10===e.type)return()=>{let n,r=e.children,i=!1;for(let e=0;e7===e.type&&!t.directiveTransforms[e.name]))))for(let e=0;e{if(1===e.type&&on(e,"once",!0)&&!av.has(e)&&!t.inVOnce&&!t.inSSR)return av.add(e),t.inVOnce=!0,t.helper(sN),()=>{t.inVOnce=!1;let e=t.currentNode;e.codegenNode&&(e.codegenNode=t.cache(e.codegenNode,!0,!0))}},ab=(e,t,n)=>{let r,{exp:i,arg:l}=e;if(!i)return n.onError(s1(41,e.loc)),a_();let s=i.loc.source.trim(),o=4===i.type?i.content:s,a=n.bindingMetadata[s];if("props"===a||"props-aliased"===a)return i.loc,a_();if(!o.trim()||!oe(i))return n.onError(s1(42,i.loc)),a_();let c=l||sB("modelValue",!0),u=l?s2(l)?`onUpdate:${K(l.content)}`:sU(['"onUpdate:" + ',l]):"onUpdate:modelValue",d=n.isTS?"($event: any)":"$event";r=sU([`${d} => ((`,i,") = $event)"]);let p=[sV(c,e.exp),sV(u,r)];if(e.modifiers.length&&1===t.tagType){let t=e.modifiers.map(e=>e.content).map(e=>(s4(e)?e:JSON.stringify(e))+": true").join(", "),n=l?s2(l)?`${l.content}Modifiers`:sU([l,' + "Modifiers"']):"modelModifiers";p.push(sV(n,sB(`{ ${t} }`,!1,e.loc,2)))}return a_(p)};function a_(e=[]){return{props:e}}let aS=new WeakSet,ax=(e,t)=>{if(1===e.type){let n=on(e,"memo");if(!(!n||aS.has(e)))return aS.add(e),()=>{let r=e.codegenNode||t.currentNode.codegenNode;r&&13===r.type&&(1!==e.tagType&&sW(r,t),e.codegenNode=sj(t.helper(sO),[n.exp,sH(void 0,r),"_cache",String(t.cached.length)]),t.cached.push(null))}}},aC=Symbol(""),ak=Symbol(""),aT=Symbol(""),aN=Symbol(""),aw=Symbol(""),aA=Symbol(""),aE=Symbol(""),aI=Symbol(""),aR=Symbol(""),aO=Symbol("");Object.getOwnPropertySymbols(r={[aC]:"vModelRadio",[ak]:"vModelCheckbox",[aT]:"vModelText",[aN]:"vModelSelect",[aw]:"vModelDynamic",[aA]:"withModifiers",[aE]:"withKeys",[aI]:"vShow",[aR]:"Transition",[aO]:"TransitionGroup"}).forEach(e=>{sM[e]=r[e]});let aP={parseMode:"html",isVoidTag:eh,isNativeTag:e=>eu(e)||ed(e)||ep(e),isPreTag:e=>"pre"===e,isIgnoreNewlineTag:e=>"pre"===e||"textarea"===e,decodeEntities:function(e,t=!1){return(f||(f=document.createElement("div")),t)?(f.innerHTML=`
`,f.children[0].getAttribute("foo")):(f.innerHTML=e,f.textContent)},isBuiltInComponent:e=>"Transition"===e||"transition"===e?aR:"TransitionGroup"===e||"transition-group"===e?aO:void 0,getNamespace(e,t,n){let r=t?t.ns:n;if(t&&2===r)if("annotation-xml"===t.tag){if("svg"===e)return 1;t.props.some(e=>6===e.type&&"encoding"===e.name&&null!=e.value&&("text/html"===e.value.content||"application/xhtml+xml"===e.value.content))&&(r=0)}else/^m(?:[ions]|text)$/.test(t.tag)&&"mglyph"!==e&&"malignmark"!==e&&(r=0);else t&&1===r&&("foreignObject"===t.tag||"desc"===t.tag||"title"===t.tag)&&(r=0);if(0===r){if("svg"===e)return 1;if("math"===e)return 2}return r}},aM=y("passive,once,capture"),aL=y("stop,prevent,self,ctrl,shift,alt,meta,exact,middle"),a$=y("left,right"),aD=y("onkeyup,onkeydown,onkeypress"),aF=(e,t)=>s2(e)&&"onclick"===e.content.toLowerCase()?sB(t,!0):4!==e.type?sU(["(",e,`) === "onClick" ? "${t}" : (`,e,")"]):e,aV=(e,t)=>{1===e.type&&0===e.tagType&&("script"===e.tag||"style"===e.tag)&&t.removeNode()},aB=[e=>{1===e.type&&e.props.forEach((t,n)=>{let r,i;6===t.type&&"style"===t.name&&t.value&&(e.props[n]={type:7,name:"bind",arg:sB("style",!0,t.loc),exp:(r=t.value.content,i=t.loc,sB(JSON.stringify(ea(r)),!1,i,3)),modifiers:[],loc:t.loc})})}],aU={cloak:()=>({props:[]}),html:(e,t,n)=>{let{exp:r,loc:i}=e;return r||n.onError(s1(53,i)),t.children.length&&(n.onError(s1(54,i)),t.children.length=0),{props:[sV(sB("innerHTML",!0,i),r||sB("",!0))]}},text:(e,t,n)=>{let{exp:r,loc:i}=e;return r||n.onError(s1(55,i)),t.children.length&&(n.onError(s1(56,i)),t.children.length=0),{props:[sV(sB("textContent",!0),r?oW(r,n)>0?r:sj(n.helperString(sg),[r],i):sB("",!0))]}},model:(e,t,n)=>{let r=ab(e,t,n);if(!r.props.length||1===t.tagType)return r;e.arg&&n.onError(s1(58,e.arg.loc));let{tag:i}=t,l=n.isCustomElement(i);if("input"===i||"textarea"===i||"select"===i||l){let s=aT,o=!1;if("input"===i||l){let r=or(t,"type");if(r){if(7===r.type)s=aw;else if(r.value)switch(r.value.content){case"radio":s=aC;break;case"checkbox":s=ak;break;case"file":o=!0,n.onError(s1(59,e.loc))}}else t.props.some(e=>7===e.type&&"bind"===e.name&&(!e.arg||4!==e.arg.type||!e.arg.isStatic))&&(s=aw)}else"select"===i&&(s=aN);o||(r.needRuntime=n.helper(s))}else n.onError(s1(57,e.loc));return r.props=r.props.filter(e=>4!==e.key.type||"modelValue"!==e.key.content),r},on:(e,t,n)=>am(e,t,n,t=>{let{modifiers:r}=e;if(!r.length)return t;let{key:i,value:l}=t.props[0],{keyModifiers:s,nonKeyModifiers:o,eventOptionModifiers:a}=((e,t,n,r)=>{let i=[],l=[],s=[];for(let n=0;n{let{exp:r,loc:i}=e;return r||n.onError(s1(61,i)),{props:[],needRuntime:n.helper(aI)}}},aj=Object.create(null);function aH(e,t){if(!M(e))if(!e.nodeType)return S;else e=e.innerHTML;let n=e+JSON.stringify(t,(e,t)=>"function"==typeof t?t.toString():t),r=aj[n];if(r)return r;if("#"===e[0]){let t=document.querySelector(e);e=t?t.innerHTML:""}let i=T({hoistStatic:!0,onError:void 0,onWarn:S},t);i.isCustomElement||"undefined"==typeof customElements||(i.isCustomElement=e=>!!customElements.get(e));let{code:l}=function(e,t={}){return function(e,t={}){let n=t.onError||sY,r="module"===t.mode;!0===t.prefixIdentifiers?n(s1(47)):r&&n(s1(48)),t.cacheHandlers&&n(s1(49)),t.scopeId&&!r&&n(s1(50));let i=T({},t,{prefixIdentifiers:!1}),l=M(e)?function(e,t){if(ow.reset(),oy=null,ob=null,o_="",oS=-1,ox=-1,oN.length=0,ov=e,om=T({},of),t){let e;for(e in t)null!=t[e]&&(om[e]=t[e])}ow.mode="html"===om.parseMode?1:2*("sfc"===om.parseMode),ow.inXML=1===om.ns||2===om.ns;let n=t&&t.delimiters;n&&(ow.delimiterOpen=sQ(n[0]),ow.delimiterClose=sQ(n[1]));let r=og=function(e,t=""){return{type:0,source:t,children:e,helpers:new Set,components:[],directives:[],hoists:[],imports:[],cached:[],temps:0,codegenNode:void 0,loc:sL}}([],e);return ow.parse(ov),r.loc=oB(0,e.length),r.children=oD(r.children),og=null,r}(e,i):e,[s,o]=[[ay,o4,ax,an,af,au,as,ag],{on:am,bind:o7,model:ab}];var a=T({},i,{nodeTransforms:[...s,...t.nodeTransforms||[]],directiveTransforms:T({},o,t.directiveTransforms||{})});let c=function(e,{filename:t="",prefixIdentifiers:n=!1,hoistStatic:r=!1,hmr:i=!1,cacheHandlers:l=!1,nodeTransforms:s=[],directiveTransforms:o={},transformHoist:a=null,isBuiltInComponent:c=S,isCustomElement:u=S,expressionPlugins:d=[],scopeId:p=null,slotted:h=!0,ssr:f=!1,inSSR:m=!1,ssrCssVars:g="",bindingMetadata:y=b,inline:_=!1,isTS:x=!1,onError:C=sY,onWarn:k=s0,compatConfig:T}){let N=t.replace(/\?.*$/,"").match(/([^/\\]+)\.\w+$/),w={filename:t,selfName:N&&G(K(N[1])),prefixIdentifiers:n,hoistStatic:r,hmr:i,cacheHandlers:l,nodeTransforms:s,directiveTransforms:o,transformHoist:a,isBuiltInComponent:c,isCustomElement:u,expressionPlugins:d,scopeId:p,slotted:h,ssr:f,inSSR:m,ssrCssVars:g,bindingMetadata:y,inline:_,isTS:x,onError:C,onWarn:k,compatConfig:T,root:e,helpers:new Map,components:new Set,directives:new Set,hoists:[],imports:[],cached:[],constantCache:new WeakMap,temps:0,identifiers:Object.create(null),scopes:{vFor:0,vSlot:0,vPre:0,vOnce:0},parent:null,grandParent:null,currentNode:e,childIndex:0,inVOnce:!1,helper(e){let t=w.helpers.get(e)||0;return w.helpers.set(e,t+1),e},removeHelper(e){let t=w.helpers.get(e);if(t){let n=t-1;n?w.helpers.set(e,n):w.helpers.delete(e)}},helperString:e=>`_${sM[w.helper(e)]}`,replaceNode(e){w.parent.children[w.childIndex]=w.currentNode=e},removeNode(e){let t=w.parent.children,n=e?t.indexOf(e):w.currentNode?w.childIndex:-1;e&&e!==w.currentNode?w.childIndex>n&&(w.childIndex--,w.onNodeRemoved()):(w.currentNode=null,w.onNodeRemoved()),w.parent.children.splice(n,1)},onNodeRemoved:S,addIdentifiers(e){},removeIdentifiers(e){},hoist(e){M(e)&&(e=sB(e)),w.hoists.push(e);let t=sB(`_hoisted_${w.hoists.length}`,!1,e.loc,2);return t.hoisted=e,t},cache(e,t=!1,n=!1){let r=function(e,t,n=!1,r=!1){return{type:20,index:e,value:t,needPauseTracking:n,inVOnce:r,needArraySpread:!1,loc:sL}}(w.cached.length,e,t,n);return w.cached.push(r),r}};return w}(l,a);return oG(l,c),a.hoistStatic&&function e(t,n,r,i=!1,l=!1){let{children:s}=t,o=[];for(let n=0;n0){if(e>=2){a.codegenNode.patchFlag=-1,o.push(a);continue}}else{let e=a.codegenNode;if(13===e.type){let t=e.patchFlag;if((void 0===t||512===t||1===t)&&oz(a,r)>=2){let t=oJ(a);t&&(e.props=r.hoist(t))}e.dynamicProps&&(e.dynamicProps=r.hoist(e.dynamicProps))}}}else if(12===a.type&&(i?0:oW(a,r))>=2){o.push(a);continue}if(1===a.type){let n=1===a.tagType;n&&r.scopes.vSlot++,e(a,t,r,!1,l),n&&r.scopes.vSlot--}else if(11===a.type)e(a,t,r,1===a.children.length,!0);else if(9===a.type)for(let n=0;ne.key===t||e.key.content===t);return n&&n.value}}c.length&&1===t.type&&1===t.tagType&&t.codegenNode&&13===t.codegenNode.type&&t.codegenNode.children&&!E(t.codegenNode.children)&&15===t.codegenNode.children.type&&t.codegenNode.children.properties.push(sV("__",sB(JSON.stringify(c),!1))),o.length&&r.transformHoist&&r.transformHoist(s,r,t)}(l,void 0,c,!!oq(l)),a.ssr||function(e,t){let{helper:n}=t,{children:r}=e;if(1===r.length){let n=oq(e);if(n&&n.codegenNode){let r=n.codegenNode;13===r.type&&sW(r,t),e.codegenNode=r}else e.codegenNode=r[0]}else r.length>1&&(e.codegenNode=s$(t,n(l4),void 0,e.children,64,void 0,void 0,!0,void 0,!1))}(l,c),l.helpers=new Set([...c.helpers.keys()]),l.components=[...c.components],l.directives=[...c.directives],l.imports=c.imports,l.hoists=c.hoists,l.temps=c.temps,l.cached=c.cached,l.transformed=!0,function(e,t={}){let n=function(e,{mode:t="function",prefixIdentifiers:n="module"===t,sourceMap:r=!1,filename:i="template.vue.html",scopeId:l=null,optimizeImports:s=!1,runtimeGlobalName:o="Vue",runtimeModuleName:a="vue",ssrRuntimeModuleName:c="vue/server-renderer",ssr:u=!1,isTS:d=!1,inSSR:p=!1}){let h={mode:t,prefixIdentifiers:n,sourceMap:r,filename:i,scopeId:l,optimizeImports:s,runtimeGlobalName:o,runtimeModuleName:a,ssrRuntimeModuleName:c,ssr:u,isTS:d,inSSR:p,source:e.source,code:"",column:1,line:1,offset:0,indentLevel:0,pure:!1,map:void 0,helper:e=>`_${sM[e]}`,push(e,t=-2,n){h.code+=e},indent(){f(++h.indentLevel)},deindent(e=!1){e?--h.indentLevel:f(--h.indentLevel)},newline(){f(h.indentLevel)}};function f(e){h.push(` +`+" ".repeat(e),0)}return h}(e,t);t.onContextCreated&&t.onContextCreated(n);let{mode:r,push:i,prefixIdentifiers:l,indent:s,deindent:o,newline:a,scopeId:c,ssr:u}=n,d=Array.from(e.helpers),p=d.length>0,h=!l&&"module"!==r;var f=e,m=n;let{ssr:g,prefixIdentifiers:y,push:b,newline:_,runtimeModuleName:S,runtimeGlobalName:x,ssrRuntimeModuleName:C}=m,k=Array.from(f.helpers);if(k.length>0&&(b(`const _Vue = ${x} +`,-1),f.hoists.length)){let e=[sr,si,sl,ss,so].filter(e=>k.includes(e)).map(oZ).join(", ");b(`const { ${e} } = _Vue +`,-1)}(function(e,t){if(!e.length)return;t.pure=!0;let{push:n,newline:r}=t;r();for(let i=0;i0)&&a()),e.directives.length&&(oY(e.directives,"directive",n),e.temps>0&&a()),e.temps>0){i("let ");for(let t=0;t0?", ":""}_temp${t}`)}return(e.components.length||e.directives.length||e.temps)&&(i(` +`,0),a()),u||i("return "),e.codegenNode?o2(e.codegenNode,n):i("null"),h&&(o(),i("}")),o(),i("}"),{ast:e,code:n.code,preamble:"",map:n.map?n.map.toJSON():void 0}}(l,i)}(e,T({},aP,t,{nodeTransforms:[aV,...aB,...t.nodeTransforms||[]],directiveTransforms:T({},aU,t.directiveTransforms||{}),transformHoist:null}))}(e,i),s=Function(l)();return s._rc=!0,aj[n]=s}return iL(aH),e.BaseTransition=ny,e.BaseTransitionPropsValidators=nm,e.Comment=ie,e.DeprecationTypes=null,e.EffectScope=eS,e.ErrorCodes={SETUP_FUNCTION:0,0:"SETUP_FUNCTION",RENDER_FUNCTION:1,1:"RENDER_FUNCTION",NATIVE_EVENT_HANDLER:5,5:"NATIVE_EVENT_HANDLER",COMPONENT_EVENT_HANDLER:6,6:"COMPONENT_EVENT_HANDLER",VNODE_HOOK:7,7:"VNODE_HOOK",DIRECTIVE_HOOK:8,8:"DIRECTIVE_HOOK",TRANSITION_HOOK:9,9:"TRANSITION_HOOK",APP_ERROR_HANDLER:10,10:"APP_ERROR_HANDLER",APP_WARN_HANDLER:11,11:"APP_WARN_HANDLER",FUNCTION_REF:12,12:"FUNCTION_REF",ASYNC_COMPONENT_LOADER:13,13:"ASYNC_COMPONENT_LOADER",SCHEDULER:14,14:"SCHEDULER",COMPONENT_UPDATE:15,15:"COMPONENT_UPDATE",APP_UNMOUNT_CLEANUP:16,16:"APP_UNMOUNT_CLEANUP"},e.ErrorTypeStrings=null,e.Fragment=r9,e.KeepAlive={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){let n=iE(),r=n.ctx,i=new Map,l=new Set,s=null,o=n.suspense,{renderer:{p:a,m:c,um:u,o:{createElement:d}}}=r,p=d("div");function h(e){nW(e),u(e,n,o,!0)}function f(e){i.forEach((t,n)=>{let r=iB(t.type);r&&!e(r)&&m(n)})}function m(e){let t=i.get(e);!t||s&&ip(t,s)?s&&nW(s):h(t),i.delete(e),l.delete(e)}r.activate=(e,t,n,r,i)=>{let l=e.component;c(e,t,n,0,o),a(l.vnode,e,t,n,l,o,r,e.slotScopeIds,i),rM(()=>{l.isDeactivated=!1,l.a&&Z(l.a);let t=e.props&&e.props.onVnodeMounted;t&&iT(t,l.parent,e)},o)},r.deactivate=e=>{let t=e.component;rU(t.m),rU(t.a),c(e,p,null,1,o),rM(()=>{t.da&&Z(t.da);let n=e.props&&e.props.onVnodeUnmounted;n&&iT(n,t.parent,e),t.isDeactivated=!0},o)},rq(()=>[e.include,e.exclude],([e,t])=>{e&&f(t=>nU(e,t)),t&&f(e=>!nU(t,e))},{flush:"post",deep:!0});let g=null,y=()=>{null!=g&&(r1(n.subTree.type)?rM(()=>{i.set(g,nK(n.subTree))},n.subTree.suspense):i.set(g,nK(n.subTree)))};return nX(y),nZ(y),nY(()=>{i.forEach(e=>{let{subTree:t,suspense:r}=n,i=nK(t);if(e.type===i.type&&e.key===i.key){nW(i);let e=i.component.da;e&&rM(e,r);return}h(e)})}),()=>{if(g=null,!t.default)return s=null;let n=t.default(),r=n[0];if(n.length>1)return s=null,n;if(!id(r)||!(4&r.shapeFlag)&&!(128&r.shapeFlag))return s=null,r;let o=nK(r);if(o.type===ie)return s=null,o;let a=o.type,c=iB(nF(o)?o.type.__asyncResolved||{}:a),{include:u,exclude:d,max:p}=e;if(u&&(!c||!nU(u,c))||d&&c&&nU(d,c))return o.shapeFlag&=-257,s=o,r;let h=null==o.key?a:o.key,f=i.get(h);return o.el&&(o=ib(o),128&r.shapeFlag&&(r.ssContent=o)),g=h,f?(o.el=f.el,o.component=f.component,o.transition&&nC(o,o.transition),o.shapeFlag|=512,l.delete(h),l.add(h)):(l.add(h),p&&l.size>parseInt(p,10)&&m(l.values().next().value)),o.shapeFlag|=256,s=o,r1(r.type)?r:o}}},e.ReactiveEffect=eC,e.Static=it,e.Suspense={name:"Suspense",__isSuspense:!0,process(e,t,n,r,i,l,s,o,a,c){if(null==e){var u=t,d=n,p=r,h=i,f=l,m=s,g=o,y=a,b=c;let{p:e,o:{createElement:_}}=b,S=_("div"),x=u.suspense=r6(u,f,h,d,S,p,m,g,y,b);e(null,x.pendingBranch=u.ssContent,S,null,h,x,m,g),x.deps>0?(r3(u,"onPending"),r3(u,"onFallback"),e(null,u.ssFallback,d,p,h,null,m,g),r5(x,u.ssFallback)):x.resolve(!1,!0)}else{if(l&&l.deps>0&&!e.suspense.isInFallback){t.suspense=e.suspense,t.suspense.vnode=t,t.el=e.el;return}!function(e,t,n,r,i,l,s,o,{p:a,um:c,o:{createElement:u}}){let d=t.suspense=e.suspense;d.vnode=t,t.el=e.el;let p=t.ssContent,h=t.ssFallback,{activeBranch:f,pendingBranch:m,isInFallback:g,isHydrating:y}=d;if(m)d.pendingBranch=p,ip(p,m)?(a(m,p,d.hiddenContainer,null,i,d,l,s,o),d.deps<=0?d.resolve():g&&!y&&(a(f,h,n,r,i,null,l,s,o),r5(d,h))):(d.pendingId=r2++,y?(d.isHydrating=!1,d.activeBranch=m):c(m,i,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u("div"),g?(a(null,p,d.hiddenContainer,null,i,d,l,s,o),d.deps<=0?d.resolve():(a(f,h,n,r,i,null,l,s,o),r5(d,h))):f&&ip(p,f)?(a(f,p,n,r,i,d,l,s,o),d.resolve(!0)):(a(null,p,d.hiddenContainer,null,i,d,l,s,o),d.deps<=0&&d.resolve()));else if(f&&ip(p,f))a(f,p,n,r,i,d,l,s,o),r5(d,p);else if(r3(t,"onPending"),d.pendingBranch=p,512&p.shapeFlag?d.pendingId=p.component.suspenseId:d.pendingId=r2++,a(null,p,d.hiddenContainer,null,i,d,l,s,o),d.deps<=0)d.resolve();else{let{timeout:e,pendingId:t}=d;e>0?setTimeout(()=>{d.pendingId===t&&d.fallback(h)},e):0===e&&d.fallback(h)}}(e,t,n,r,i,s,o,a,c)}},hydrate:function(e,t,n,r,i,l,s,o,a){let c=t.suspense=r6(t,r,n,e.parentNode,document.createElement("div"),null,i,l,s,o,!0),u=a(e,c.pendingBranch=t.ssContent,n,c,l,s);return 0===c.deps&&c.resolve(!1,!0),u},normalize:function(e){let{shapeFlag:t,children:n}=e,r=32&t;e.ssContent=r4(r?n.default:n),e.ssFallback=r?r4(n.fallback):iv(ie)}},e.Teleport=no,e.Text=r7,e.TrackOpTypes={GET:"get",HAS:"has",ITERATE:"iterate"},e.Transition=i0,e.TransitionGroup=lR,e.TriggerOpTypes={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},e.VueElement=lT,e.assertNumber=function(e,t){},e.callWithAsyncErrorHandling=tq,e.callWithErrorHandling=tH,e.camelize=K,e.capitalize=G,e.cloneVNode=ib,e.compatUtils=null,e.compile=aH,e.computed=iU,e.createApp=l1,e.createBlock=iu,e.createCommentVNode=function(e="",t=!1){return t?(il(),iu(ie,null,e)):iv(ie,null,e)},e.createElementBlock=function(e,t,n,r,i,l){return ic(ig(e,t,n,r,i,l,!0))},e.createElementVNode=ig,e.createHydrationRenderer=rL,e.createPropsRestProxy=function(e,t){let n={};for(let r in e)t.includes(r)||Object.defineProperty(n,r,{enumerable:!0,get:()=>e[r]});return n},e.createRenderer=function(e){return r$(e)},e.createSSRApp=l2,e.createSlots=function(e,t){for(let n=0;n{let t=r.fn(...e);return t&&(t.key=r.key),t}:r.fn)}return e},e.createStaticVNode=function(e,t){let n=iv(it,null,e);return n.staticCount=t,n},e.createTextVNode=i_,e.createVNode=iv,e.customRef=tM,e.defineAsyncComponent=function(e){let t;P(e)&&(e={loader:e});let{loader:n,loadingComponent:r,errorComponent:i,delay:l=200,hydrate:s,timeout:o,suspensible:a=!0,onError:c}=e,u=null,d=0,p=()=>{let e;return u||(e=u=n().catch(e=>{if(e=e instanceof Error?e:Error(String(e)),c)return new Promise((t,n)=>{c(e,()=>t((d++,u=null,p())),()=>n(e),d+1)});throw e}).then(n=>e!==u&&u?u:(n&&(n.__esModule||"Module"===n[Symbol.toStringTag])&&(n=n.default),t=n,n)))};return nT({name:"AsyncComponentWrapper",__asyncLoader:p,__asyncHydrate(e,n,r){let i=s?()=>{let t=s(()=>{r()},t=>(function(e,t){if(nR(e)&&"["===e.data){let n=1,r=e.nextSibling;for(;r;){if(1===r.nodeType){if(!1===t(r))break}else if(nR(r))if("]"===r.data){if(0==--n)break}else"["===r.data&&n++;r=r.nextSibling}}else t(e)})(e,t));t&&(n.bum||(n.bum=[])).push(t),(n.u||(n.u=[])).push(()=>!0)}:r;t?i():p().then(()=>!n.isUnmounted&&i())},get __asyncResolved(){return t},setup(){let e=iA;if(nN(e),t)return()=>nV(t,e);let n=t=>{u=null,tW(t,e,13,!i)};if(a&&e.suspense)return p().then(t=>()=>nV(t,e)).catch(e=>(n(e),()=>i?iv(i,{error:e}):null));let s=tN(!1),c=tN(),d=tN(!!l);return l&&setTimeout(()=>{d.value=!1},l),null!=o&&setTimeout(()=>{if(!s.value&&!c.value){let e=Error(`Async component timed out after ${o}ms.`);n(e),c.value=e}},o),p().then(()=>{s.value=!0,e.parent&&nB(e.parent.vnode)&&e.parent.update()}).catch(e=>{n(e),c.value=e}),()=>s.value&&t?nV(t,e):c.value&&i?iv(i,{error:c.value}):r&&!d.value?iv(r):void 0}})},e.defineComponent=nT,e.defineCustomElement=lC,e.defineEmits=function(){return null},e.defineExpose=function(e){},e.defineModel=function(){},e.defineOptions=function(e){},e.defineProps=function(){return null},e.defineSSRCustomElement=(e,t)=>lC(e,t,l2),e.defineSlots=function(){return null},e.devtools=void 0,e.effect=function(e,t){e.effect instanceof eC&&(e=e.effect.fn);let n=new eC(e);t&&T(n,t);try{n.run()}catch(e){throw n.stop(),e}let r=n.run.bind(n);return r.effect=n,r},e.effectScope=function(e){return new eS(e)},e.getCurrentInstance=iE,e.getCurrentScope=function(){return l},e.getCurrentWatcher=function(){return m},e.getTransitionRawChildren=nk,e.guardReactiveProps=iy,e.h=ij,e.handleError=tW,e.hasInjectionContext=function(){return!!(iA||t8||ry)},e.hydrate=(...e)=>{lY().hydrate(...e)},e.hydrateOnIdle=(e=1e4)=>t=>{let n=n$(t,{timeout:e});return()=>nD(n)},e.hydrateOnInteraction=(e=[])=>(t,n)=>{M(e)&&(e=[e]);let r=!1,i=e=>{r||(r=!0,l(),t(),e.target.dispatchEvent(new e.constructor(e.type,e)))},l=()=>{n(t=>{for(let n of e)t.removeEventListener(n,i)})};return n(t=>{for(let n of e)t.addEventListener(n,i,{once:!0})}),l},e.hydrateOnMediaQuery=e=>t=>{if(e){let n=matchMedia(e);if(!n.matches)return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t);t()}},e.hydrateOnVisible=e=>(t,n)=>{let r=new IntersectionObserver(e=>{for(let n of e)if(n.isIntersecting){r.disconnect(),t();break}},e);return n(e=>{if(e instanceof Element){if(function(e){let{top:t,left:n,bottom:r,right:i}=e.getBoundingClientRect(),{innerHeight:l,innerWidth:s}=window;return(t>0&&t0&&r0&&n0&&ir.disconnect()},e.initCustomFormatter=function(){},e.initDirectivesForSSR=S,e.inject=r_,e.isMemoSame=iH,e.isProxy=t_,e.isReactive=tv,e.isReadonly=ty,e.isRef=tT,e.isRuntimeOnly=()=>!d,e.isShallow=tb,e.isVNode=id,e.markRaw=tx,e.mergeDefaults=function(e,t){let n=rl(e);for(let e in t){if(e.startsWith("__skip"))continue;let r=n[e];r?E(r)||P(r)?r=n[e]={type:r,default:t[e]}:r.default=t[e]:null===r&&(r=n[e]={default:t[e]}),r&&t[`__skip_${e}`]&&(r.skipFactory=!0)}return n},e.mergeModels=function(e,t){return e&&t?E(e)&&E(t)?e.concat(t):T({},rl(e),rl(t)):e||t},e.mergeProps=ik,e.nextTick=tY,e.normalizeClass=ec,e.normalizeProps=function(e){if(!e)return null;let{class:t,style:n}=e;return t&&!M(t)&&(e.class=ec(t)),n&&(e.style=ei(n)),e},e.normalizeStyle=ei,e.onActivated=nj,e.onBeforeMount=nG,e.onBeforeUnmount=nY,e.onBeforeUpdate=nQ,e.onDeactivated=nH,e.onErrorCaptured=n6,e.onMounted=nX,e.onRenderTracked=n3,e.onRenderTriggered=n2,e.onScopeDispose=function(e,t=!1){l&&l.cleanups.push(e)},e.onServerPrefetch=n1,e.onUnmounted=n0,e.onUpdated=nZ,e.onWatcherCleanup=tU,e.openBlock=il,e.popScopeId=function(){t5=null},e.provide=rb,e.proxyRefs=tO,e.pushScopeId=function(e){t5=e},e.queuePostFlushCb=t2,e.reactive=th,e.readonly=tm,e.ref=tN,e.registerRuntimeCompiler=iL,e.render=l0,e.renderList=function(e,t,n,r){let i,l=n&&n[r],s=E(e);if(s||M(e)){let n=s&&tv(e),r=!1,o=!1;n&&(r=!tb(e),o=ty(e),e=ez(e)),i=Array(e.length);for(let n=0,s=e.length;nt(e,n,void 0,l&&l[n]));else{let n=Object.keys(e);i=Array(n.length);for(let r=0,s=n.length;r!id(t)||t.type!==ie&&(t.type!==r9||!!e(t.children)))?t:null}(l(n)),o=n.key||s&&s.key,a=iu(r9,{key:(o&&!L(o)?o:`_${t}`)+(!s&&r?"_fb":"")},s||(r?r():[]),s&&1===e._?64:-2);return!i&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),l&&l._c&&(l._d=!0),a},e.resolveComponent=function(e,t){return n5(n4,e,!0,t)||e},e.resolveDirective=function(e){return n5("directives",e)},e.resolveDynamicComponent=function(e){return M(e)?n5(n4,e,!1)||e:e||n8},e.resolveFilter=null,e.resolveTransitionHooks=n_,e.setBlockTracking=ia,e.setDevtoolsHook=S,e.setTransitionHooks=nC,e.shallowReactive=tf,e.shallowReadonly=function(e){return tg(e,!0,te,ta,tp)},e.shallowRef=tw,e.ssrContextKey=rj,e.ssrUtils=null,e.stop=function(e){e.effect.stop()},e.toDisplayString=ey,e.toHandlerKey=X,e.toHandlers=function(e,t){let n={};for(let r in e)n[t&&/[A-Z]/.test(r)?`on:${r}`:X(r)]=e[r];return n},e.toRaw=tS,e.toRef=function(e,t,n){return tT(e)?e:P(e)?new t$(e):$(e)&&arguments.length>1?tD(e,t,n):tN(e)},e.toRefs=function(e){let t=E(e)?Array(e.length):{};for(let n in e)t[n]=tD(e,n);return t},e.toValue=function(e){return P(e)?e():tI(e)},e.transformVNodeArgs=function(e){},e.triggerRef=function(e){e.dep&&e.dep.trigger()},e.unref=tI,e.useAttrs=function(){return ri().attrs},e.useCssModule=function(e="$style"){return b},e.useCssVars=function(e){let t=iE();if(!t)return;let n=t.ut=(n=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(e=>lo(e,n))},r=()=>{let r=e(t.proxy);t.ce?lo(t.ce,r):function e(t,n){if(128&t.shapeFlag){let r=t.suspense;t=r.activeBranch,r.pendingBranch&&!r.isHydrating&&r.effects.push(()=>{e(r.activeBranch,n)})}for(;t.component;)t=t.component.subTree;if(1&t.shapeFlag&&t.el)lo(t.el,n);else if(t.type===r9)t.children.forEach(t=>e(t,n));else if(t.type===it){let{el:e,anchor:r}=t;for(;e&&(lo(e,n),e!==r);)e=e.nextSibling}}(t.subTree,r),n(r)};nQ(()=>{t2(r)}),nX(()=>{rq(r,S,{flush:"post"});let e=new MutationObserver(r);e.observe(t.subTree.el.parentNode,{childList:!0}),n0(()=>e.disconnect())})},e.useHost=lN,e.useId=function(){let e=iE();return e?(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++:""},e.useModel=function(e,t,n=b){let r=iE(),i=K(t),l=J(t),s=rz(e,i),o=tM((s,o)=>{let a,c,u=b;return rH(()=>{let t=e[i];Q(a,t)&&(a=t,o())}),{get:()=>(s(),n.get?n.get(a):a),set(e){let s=n.set?n.set(e):e;if(!Q(s,a)&&!(u!==b&&Q(e,u)))return;let d=r.vnode.props;d&&(t in d||i in d||l in d)&&(`onUpdate:${t}`in d||`onUpdate:${i}`in d||`onUpdate:${l}`in d)||(a=e,o()),r.emit(`update:${t}`,s),Q(e,s)&&Q(e,u)&&!Q(s,c)&&o(),u=e,c=s}}});return o[Symbol.iterator]=()=>{let e=0;return{next:()=>e<2?{value:e++?s||b:o,done:!1}:{done:!0}}},o},e.useSSRContext=()=>{},e.useShadowRoot=function(){let e=lN();return e&&e.shadowRoot},e.useSlots=function(){return ri().slots},e.useTemplateRef=function(e){let t=iE(),n=tw(null);return t&&Object.defineProperty(t.refs===b?t.refs={}:t.refs,e,{enumerable:!0,get:()=>n.value,set:e=>n.value=e}),n},e.useTransitionState=nh,e.vModelCheckbox=lB,e.vModelDynamic={created(e,t,n){lz(e,t,n,null,"created")},mounted(e,t,n){lz(e,t,n,null,"mounted")},beforeUpdate(e,t,n,r){lz(e,t,n,r,"beforeUpdate")},updated(e,t,n,r){lz(e,t,n,r,"updated")}},e.vModelRadio=lj,e.vModelSelect=lH,e.vModelText=lV,e.vShow={beforeMount(e,{value:t},{transition:n}){e[lr]="none"===e.style.display?"":e.style.display,n&&t?n.beforeEnter(e):ll(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:r}){!t!=!n&&(r?t?(r.beforeEnter(e),ll(e,!0),r.enter(e)):r.leave(e,()=>{ll(e,!1)}):ll(e,t))},beforeUnmount(e,{value:t}){ll(e,t)}},e.version=iq,e.warn=S,e.watch=function(e,t,n){return rq(e,t,n)},e.watchEffect=function(e,t){return rq(e,null,t)},e.watchPostEffect=function(e,t){return rq(e,null,{flush:"post"})},e.watchSyncEffect=rH,e.withAsyncContext=function(e){let t=iE(),n=e();return iR(),D(n)&&(n=n.catch(e=>{throw iI(t),e})),[n,()=>iI(t)]},e.withCtx=t7,e.withDefaults=function(e,t){return null},e.withDirectives=function(e,t){if(null===t8)return e;let n=iV(t8),r=e.dirs||(e.dirs=[]);for(let e=0;e{let n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=n=>{if(!("key"in n))return;let r=J(n.key);if(t.some(e=>e===r||lX[e]===r))return e(n)})},e.withMemo=function(e,t,n,r){let i=n[r];if(i&&iH(i,e))return i;let l=t();return l.memo=e.slice(),l.cacheIndex=r,n[r]=l},e.withModifiers=(e,t)=>{let n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=(n,...r)=>{for(let e=0;et7,e}({}); diff --git a/node_modules/vue/dist/vue.runtime.esm-browser.js b/node_modules/vue/dist/vue.runtime.esm-browser.js index 3f20d56..3aac5dc 100644 --- a/node_modules/vue/dist/vue.runtime.esm-browser.js +++ b/node_modules/vue/dist/vue.runtime.esm-browser.js @@ -1,5 +1,5 @@ /** -* vue v3.5.13 +* vue v3.5.17 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/ @@ -323,6 +323,10 @@ class EffectScope { * @internal */ this._active = true; + /** + * @internal track `on` calls, allow `on` call multiple times + */ + this._on = 0; /** * @internal */ @@ -393,14 +397,20 @@ class EffectScope { * @internal */ on() { - activeEffectScope = this; + if (++this._on === 1) { + this.prevScope = activeEffectScope; + activeEffectScope = this; + } } /** * This should only be called on non-detached scopes * @internal */ off() { - activeEffectScope = this.parent; + if (this._on > 0 && --this._on === 0) { + activeEffectScope = this.prevScope; + this.prevScope = void 0; + } } stop(fromParent) { if (this._active) { @@ -482,7 +492,7 @@ class ReactiveEffect { } resume() { if (this.flags & 64) { - this.flags &= ~64; + this.flags &= -65; if (pausedQueueEffects.has(this)) { pausedQueueEffects.delete(this); this.trigger(); @@ -522,7 +532,7 @@ class ReactiveEffect { cleanupDeps(this); activeSub = prevEffect; shouldTrack = prevShouldTrack; - this.flags &= ~2; + this.flags &= -3; } } stop() { @@ -533,7 +543,7 @@ class ReactiveEffect { this.deps = this.depsTail = void 0; cleanupEffect(this); this.onStop && this.onStop(); - this.flags &= ~1; + this.flags &= -2; } } trigger() { @@ -583,7 +593,7 @@ function endBatch() { while (e) { const next = e.next; e.next = void 0; - e.flags &= ~8; + e.flags &= -9; e = next; } } @@ -594,7 +604,7 @@ function endBatch() { while (e) { const next = e.next; e.next = void 0; - e.flags &= ~8; + e.flags &= -9; if (e.flags & 1) { try { ; @@ -650,17 +660,16 @@ function refreshComputed(computed) { if (computed.flags & 4 && !(computed.flags & 16)) { return; } - computed.flags &= ~16; + computed.flags &= -17; if (computed.globalVersion === globalVersion) { return; } computed.globalVersion = globalVersion; - const dep = computed.dep; - computed.flags |= 2; - if (dep.version > 0 && !computed.isSSR && computed.deps && !isDirty(computed)) { - computed.flags &= ~2; + if (!computed.isSSR && computed.flags & 128 && (!computed.deps && !computed._dirty || !isDirty(computed))) { return; } + computed.flags |= 2; + const dep = computed.dep; const prevSub = activeSub; const prevShouldTrack = shouldTrack; activeSub = computed; @@ -669,6 +678,7 @@ function refreshComputed(computed) { prepareDeps(computed); const value = computed.fn(computed._value); if (dep.version === 0 || hasChanged(value, computed._value)) { + computed.flags |= 128; computed._value = value; dep.version++; } @@ -679,7 +689,7 @@ function refreshComputed(computed) { activeSub = prevSub; shouldTrack = prevShouldTrack; cleanupDeps(computed); - computed.flags &= ~2; + computed.flags &= -3; } } function removeSub(link, soft = false) { @@ -698,7 +708,7 @@ function removeSub(link, soft = false) { if (dep.subs === link) { dep.subs = prevSub; if (!prevSub && dep.computed) { - dep.computed.flags &= ~4; + dep.computed.flags &= -5; for (let l = dep.computed.deps; l; l = l.nextDep) { removeSub(l, true); } @@ -774,6 +784,7 @@ class Link { } } class Dep { + // TODO isolatedDeclarations "__v_skip" constructor(computed) { this.computed = computed; this.version = 0; @@ -794,6 +805,10 @@ class Dep { * Subscriber counter */ this.sc = 0; + /** + * @internal + */ + this.__v_skip = true; { this.subsHead = void 0; } @@ -1631,14 +1646,14 @@ function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandl if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) { return target; } - const existingProxy = proxyMap.get(target); - if (existingProxy) { - return existingProxy; - } const targetType = getTargetType(target); if (targetType === 0 /* INVALID */) { return target; } + const existingProxy = proxyMap.get(target); + if (existingProxy) { + return existingProxy; + } const proxy = new Proxy( target, targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers @@ -2061,11 +2076,11 @@ function watch$1(source, cb, options = EMPTY_OBJ) { oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue, boundCleanup ]; + oldValue = newValue; call ? call(cb, 3, args) : ( // @ts-expect-error cb(...args) ); - oldValue = newValue; } finally { activeWatcher = currentWatcher; } @@ -2482,11 +2497,11 @@ function flushPreFlushCbs(instance, seen, i = flushIndex + 1) { queue.splice(i, 1); i--; if (cb.flags & 4) { - cb.flags &= ~1; + cb.flags &= -2; } cb(); if (!(cb.flags & 4)) { - cb.flags &= ~1; + cb.flags &= -2; } } } @@ -2511,10 +2526,10 @@ function flushPostFlushCbs(seen) { continue; } if (cb.flags & 4) { - cb.flags &= ~1; + cb.flags &= -2; } if (!(cb.flags & 8)) cb(); - cb.flags &= ~1; + cb.flags &= -2; } activePostFlushCbs = null; postFlushIndex = 0; @@ -2550,7 +2565,7 @@ function flushJobs(seen) { for (; flushIndex < queue.length; flushIndex++) { const job = queue[flushIndex]; if (job) { - job.flags &= ~1; + job.flags &= -2; } } flushIndex = -1; @@ -2990,15 +3005,16 @@ const TeleportImpl = { updateCssVars(n2, true); } if (isTeleportDeferred(n2.props)) { + n2.el.__isMounted = false; queuePostRenderEffect(() => { mountToTarget(); - n2.el.__isMounted = true; + delete n2.el.__isMounted; }, parentSuspense); } else { mountToTarget(); } } else { - if (isTeleportDeferred(n2.props) && !n1.el.__isMounted) { + if (isTeleportDeferred(n2.props) && n1.el.__isMounted === false) { queuePostRenderEffect(() => { TeleportImpl.process( n1, @@ -3012,7 +3028,6 @@ const TeleportImpl = { optimized, internals ); - delete n1.el.__isMounted; }, parentSuspense); return; } @@ -3039,7 +3054,7 @@ const TeleportImpl = { namespace, slotScopeIds ); - traverseStaticChildren(n1, n2, true); + traverseStaticChildren(n1, n2, false); } else if (!optimized) { patchChildren( n1, @@ -4000,6 +4015,8 @@ function createHydrationFunctions(rendererInternals) { ) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear; const content = el.content.firstChild; if (needCallTransitionHooks) { + const cls = content.getAttribute("class"); + if (cls) content.$cls = cls; transition.beforeEnter(content); } replaceNode(content, el, parentComponent); @@ -4252,7 +4269,12 @@ function propHasMismatch(el, key, clientValue, vnode, instance) { let actual; let expected; if (key === "class") { - actual = el.getAttribute("class"); + if (el.$cls) { + actual = el.$cls; + delete el.$cls; + } else { + actual = el.getAttribute("class"); + } expected = normalizeClass(clientValue); if (!isSetEqual(toClassSet(actual || ""), toClassSet(expected))) { mismatchType = 2 /* CLASS */; @@ -4390,7 +4412,7 @@ function isMismatchAllowed(el, allowedType) { if (allowedType === 0 /* TEXT */ && list.includes("children")) { return true; } - return allowedAttr.split(",").includes(MismatchTypeString[allowedType]); + return list.includes(MismatchTypeString[allowedType]); } } @@ -4547,14 +4569,25 @@ function defineAsyncComponent(source) { name: "AsyncComponentWrapper", __asyncLoader: load, __asyncHydrate(el, instance, hydrate) { + let patched = false; const doHydrate = hydrateStrategy ? () => { + const performHydrate = () => { + if (patched) { + warn$1( + `Skipping lazy hydration for component '${getComponentName(resolvedComp)}': it was updated before lazy hydration performed.` + ); + return; + } + hydrate(); + }; const teardown = hydrateStrategy( - hydrate, + performHydrate, (cb) => forEachElement(el, cb) ); if (teardown) { (instance.bum || (instance.bum = [])).push(teardown); } + (instance.u || (instance.u = [])).push(() => patched = true); } : hydrate; if (resolvedComp) { doHydrate(); @@ -4724,6 +4757,9 @@ const KeepAliveImpl = { { devtoolsComponentAdded(instance2); } + { + instance2.__keepAliveStorageContainer = storageContainer; + } }; function unmount(vnode) { resetShapeFlag(vnode); @@ -4811,7 +4847,7 @@ const KeepAliveImpl = { ); const { include, exclude, max } = props; if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) { - vnode.shapeFlag &= ~256; + vnode.shapeFlag &= -257; current = vnode; return rawVNode; } @@ -4898,8 +4934,8 @@ function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) { }, target); } function resetShapeFlag(vnode) { - vnode.shapeFlag &= ~256; - vnode.shapeFlag &= ~512; + vnode.shapeFlag &= -257; + vnode.shapeFlag &= -513; } function getInnerChild(vnode) { return vnode.shapeFlag & 128 ? vnode.ssContent : vnode; @@ -5014,14 +5050,16 @@ function renderList(source, renderItem, cache, index) { if (sourceIsArray || isString(source)) { const sourceIsReactiveArray = sourceIsArray && isReactive(source); let needsWrap = false; + let isReadonlySource = false; if (sourceIsReactiveArray) { needsWrap = !isShallow(source); + isReadonlySource = isReadonly(source); source = shallowReadArray(source); } ret = new Array(source.length); for (let i = 0, l = source.length; i < l; i++) { ret[i] = renderItem( - needsWrap ? toReactive(source[i]) : source[i], + needsWrap ? isReadonlySource ? toReadonly(toReactive(source[i])) : toReactive(source[i]) : source[i], i, void 0, cached && cached[i] @@ -6043,11 +6081,9 @@ function createAppAPI(render, hydrate) { } { context.reload = () => { - render( - cloneVNode(vnode), - rootContainer, - namespace - ); + const cloned = cloneVNode(vnode); + cloned.el = null; + render(cloned, rootContainer, namespace); }; } if (isHydrate && hydrate) { @@ -6097,9 +6133,15 @@ If you want to remount the same app, move your app creation logic into a factory }, provide(key, value) { if (key in context.provides) { - warn$1( - `App already provides property with key "${String(key)}". It will be overwritten with the new value.` - ); + if (hasOwn(context.provides, key)) { + warn$1( + `App already provides property with key "${String(key)}". It will be overwritten with the new value.` + ); + } else { + warn$1( + `App already provides property with key "${String(key)}" inherited from its parent element. It will be overwritten with the new value.` + ); + } } context.provides[key] = value; return app; @@ -6136,7 +6178,7 @@ function provide(key, value) { function inject(key, defaultValue, treatDefaultAsFactory = false) { const instance = currentInstance || currentRenderingInstance; if (instance || currentApp) { - const provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0; + let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0; if (provides && key in provides) { return provides[key]; } else if (arguments.length > 1) { @@ -6570,7 +6612,7 @@ const normalizeSlot = (key, rawSlot, ctx) => { return rawSlot; } const normalized = withCtx((...args) => { - if (currentInstance && (!ctx || ctx.root === currentInstance.root)) { + if (currentInstance && !(ctx === null && currentRenderingInstance) && !(ctx && ctx.root !== currentInstance.root)) { warn$1( `Slot "${key}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.` ); @@ -6609,7 +6651,7 @@ const normalizeVNodeSlots = (instance, children) => { }; const assignSlots = (slots, children, optimized) => { for (const key in children) { - if (optimized || key !== "_") { + if (optimized || !isInternalKey(key)) { slots[key] = children[key]; } } @@ -6617,6 +6659,8 @@ const assignSlots = (slots, children, optimized) => { const initSlots = (instance, children, optimized) => { const slots = instance.slots = createInternalObject(); if (instance.vnode.shapeFlag & 32) { + const cacheIndexes = children.__; + if (cacheIndexes) def(slots, "__", cacheIndexes, true); const type = children._; if (type) { assignSlots(slots, children, optimized); @@ -6828,6 +6872,8 @@ function baseCreateRenderer(options, createHydrationFns) { } if (ref != null && parentComponent) { setRef(ref, n1 && n1.ref, parentSuspense, n2 || n1, !n2); + } else if (ref == null && n1 && n1.ref != null) { + setRef(n1.ref, null, parentSuspense, n1, true); } }; const processText = (n1, n2, container, anchor) => { @@ -7133,7 +7179,7 @@ function baseCreateRenderer(options, createHydrationFns) { (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement // which also requires the correct parent container !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything. - oldVNode.shapeFlag & (6 | 64)) ? hostParentNode(oldVNode.el) : ( + oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(oldVNode.el) : ( // In other cases, the parent container is not actually used so we // just pass the block element here to avoid a DOM parentNode call. fallbackContainer @@ -7295,8 +7341,8 @@ function baseCreateRenderer(options, createHydrationFns) { endMeasure(instance, `init`); } } + if (isHmrUpdating) initialVNode.el = null; if (instance.asyncDep) { - if (isHmrUpdating) initialVNode.el = null; parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized); if (!initialVNode.el) { const placeholder = instance.subTree = createVNode(Comment); @@ -7387,7 +7433,8 @@ function baseCreateRenderer(options, createHydrationFns) { hydrateSubTree(); } } else { - if (root.ce) { + if (root.ce && // @ts-expect-error _def is private + root.ce._def.shadowRoot !== false) { root.ce._injectChildStyle(type); } { @@ -7858,7 +7905,13 @@ function baseCreateRenderer(options, createHydrationFns) { queuePostRenderEffect(() => transition.enter(el), parentSuspense); } else { const { leave, delayLeave, afterLeave } = transition; - const remove2 = () => hostInsert(el, container, anchor); + const remove2 = () => { + if (vnode.ctx.isUnmounted) { + hostRemove(el); + } else { + hostInsert(el, container, anchor); + } + }; const performLeave = () => { leave(el, () => { remove2(); @@ -7891,7 +7944,9 @@ function baseCreateRenderer(options, createHydrationFns) { optimized = false; } if (ref != null) { + pauseTracking(); setRef(ref, null, parentSuspense, vnode, true); + resetTracking(); } if (cacheIndex != null) { parentComponent.renderCache[cacheIndex] = void 0; @@ -8003,12 +8058,27 @@ function baseCreateRenderer(options, createHydrationFns) { if (instance.type.__hmrId) { unregisterHMR(instance); } - const { bum, scope, job, subTree, um, m, a } = instance; + const { + bum, + scope, + job, + subTree, + um, + m, + a, + parent, + slots: { __: slotCacheKeys } + } = instance; invalidateMount(m); invalidateMount(a); if (bum) { invokeArrayFns(bum); } + if (parent && isArray(slotCacheKeys)) { + slotCacheKeys.forEach((v) => { + parent.renderCache[v] = void 0; + }); + } scope.stop(); if (job) { job.flags |= 8; @@ -8104,8 +8174,8 @@ function toggleRecurse({ effect, job }, allowed) { effect.flags |= 32; job.flags |= 4; } else { - effect.flags &= ~32; - job.flags &= ~4; + effect.flags &= -33; + job.flags &= -5; } } function needTransition(parentSuspense, transition) { @@ -8132,6 +8202,9 @@ function traverseStaticChildren(n1, n2, shallow = false) { if (c2.type === Comment && !c2.el) { c2.el = c1.el; } + { + c2.el && (c2.el.__vnode = c2); + } } } } @@ -9477,8 +9550,8 @@ function isSameVNodeType(n1, n2) { if (n2.shapeFlag & 6 && n1.component) { const dirtyInstances = hmrDirtyComponents.get(n2.type); if (dirtyInstances && dirtyInstances.has(n1.component)) { - n1.shapeFlag &= ~256; - n2.shapeFlag &= ~512; + n1.shapeFlag &= -257; + n2.shapeFlag &= -513; return false; } } @@ -9939,7 +10012,7 @@ function setupComponent(instance, isSSR = false, optimized = false) { const { props, children } = instance.vnode; const isStateful = isStatefulComponent(instance); initProps(instance, props, isStateful, isSSR); - initSlots(instance, children, optimized); + initSlots(instance, children, optimized || isSSR); const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0; isSSR && setInSSRSetupState(false); return setupResult; @@ -10270,13 +10343,15 @@ function initCustomFormatter() { if (obj.__isVue) { return ["div", vueStyle, `VueInstance`]; } else if (isRef(obj)) { + pauseTracking(); + const value = obj.value; + resetTracking(); return [ "div", {}, ["span", vueStyle, genRefFlag(obj)], "<", - // avoid debugger accessing value affecting behavior - formatValue("_value" in obj ? obj._value : obj), + formatValue(value), `>` ]; } else if (isReactive(obj)) { @@ -10457,7 +10532,7 @@ function isMemoSame(cached, memo) { return true; } -const version = "3.5.13"; +const version = "3.5.17"; const warn = warn$1 ; const ErrorTypeStrings = ErrorTypeStrings$1 ; const devtools = devtools$1 ; @@ -11275,7 +11350,7 @@ function shouldSetAsProp(el, key, value, isSVG) { } return false; } - if (key === "spellcheck" || key === "draggable" || key === "translate") { + if (key === "spellcheck" || key === "draggable" || key === "translate" || key === "autocorrect") { return false; } if (key === "form") { @@ -11358,13 +11433,10 @@ class VueElement extends BaseClass { this._root = this; } } - if (!this._def.__asyncLoader) { - this._resolveProps(this._def); - } } connectedCallback() { if (!this.isConnected) return; - if (!this.shadowRoot) { + if (!this.shadowRoot && !this._resolved) { this._parseSlots(); } this._connected = true; @@ -11377,8 +11449,7 @@ class VueElement extends BaseClass { } if (!this._instance) { if (this._resolved) { - this._setParent(); - this._update(); + this._mount(this._def); } else { if (parent && parent._pendingResolve) { this._pendingResolve = parent._pendingResolve.then(() => { @@ -11394,7 +11465,15 @@ class VueElement extends BaseClass { _setParent(parent = this._parent) { if (parent) { this._instance.parent = parent._instance; - this._instance.provides = parent._instance.provides; + this._inheritParentContext(parent); + } + } + _inheritParentContext(parent = this._parent) { + if (parent && this._app) { + Object.setPrototypeOf( + this._app._context.provides, + parent._instance.provides + ); } } disconnectedCallback() { @@ -11444,9 +11523,7 @@ class VueElement extends BaseClass { } } this._numberProps = numberProps; - if (isAsync) { - this._resolveProps(def); - } + this._resolveProps(def); if (this.shadowRoot) { this._applyStyles(styles); } else if (styles) { @@ -11458,9 +11535,10 @@ class VueElement extends BaseClass { }; const asyncDef = this._def.__asyncLoader; if (asyncDef) { - this._pendingResolve = asyncDef().then( - (def) => resolve(this._def = def, true) - ); + this._pendingResolve = asyncDef().then((def) => { + def.configureApp = this._def.configureApp; + resolve(this._def = def, true); + }); } else { resolve(this._def); } @@ -11470,6 +11548,7 @@ class VueElement extends BaseClass { def.name = "VueElement"; } this._app = this._createApp(def); + this._inheritParentContext(); if (def.configureApp) { def.configureApp(this._app); } @@ -11554,7 +11633,9 @@ class VueElement extends BaseClass { } } _update() { - render(this._createVNode(), this._root); + const vnode = this._createVNode(); + if (this._app) vnode.appContext = this._app._context; + render(vnode, this._root); } _createVNode() { const baseProps = {}; @@ -11764,6 +11845,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({ instance.vnode.el, moveClass )) { + prevChildren = []; return; } prevChildren.forEach(callPendingCbs); @@ -11787,6 +11869,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({ }; el.addEventListener("transitionend", cb); }); + prevChildren = []; }); return () => { const rawProps = toRaw(props); diff --git a/node_modules/vue/dist/vue.runtime.esm-browser.prod.js b/node_modules/vue/dist/vue.runtime.esm-browser.prod.js index 9d0fddf..c99e186 100644 --- a/node_modules/vue/dist/vue.runtime.esm-browser.prod.js +++ b/node_modules/vue/dist/vue.runtime.esm-browser.prod.js @@ -1,5 +1,6 @@ /** -* vue v3.5.13 +* vue v3.5.17 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/var e,t;let n,l,r,i,s,o,a,u,c,f,p,d;function h(e){let t=Object.create(null);for(let n of e.split(","))t[n]=1;return e=>e in t}let g={},m=[],_=()=>{},y=()=>!1,b=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&(e.charCodeAt(2)>122||97>e.charCodeAt(2)),S=e=>e.startsWith("onUpdate:"),C=Object.assign,x=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},E=Object.prototype.hasOwnProperty,w=(e,t)=>E.call(e,t),k=Array.isArray,T=e=>"[object Map]"===F(e),A=e=>"[object Set]"===F(e),R=e=>"[object Date]"===F(e),N=e=>"[object RegExp]"===F(e),O=e=>"function"==typeof e,P=e=>"string"==typeof e,M=e=>"symbol"==typeof e,I=e=>null!==e&&"object"==typeof e,L=e=>(I(e)||O(e))&&O(e.then)&&O(e.catch),D=Object.prototype.toString,F=e=>D.call(e),V=e=>F(e).slice(8,-1),U=e=>"[object Object]"===F(e),j=e=>P(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,B=h(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),$=e=>{let t=Object.create(null);return n=>t[n]||(t[n]=e(n))},H=/-(\w)/g,W=$(e=>e.replace(H,(e,t)=>t?t.toUpperCase():"")),K=/\B([A-Z])/g,z=$(e=>e.replace(K,"-$1").toLowerCase()),q=$(e=>e.charAt(0).toUpperCase()+e.slice(1)),G=$(e=>e?`on${q(e)}`:""),J=(e,t)=>!Object.is(e,t),X=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:l,value:n})},Y=e=>{let t=parseFloat(e);return isNaN(t)?e:t},Q=e=>{let t=P(e)?Number(e):NaN;return isNaN(t)?e:t},ee=()=>n||(n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{}),et=h("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol");function en(e){if(k(e)){let t={};for(let n=0;n{if(e){let n=e.split(er);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}(l):en(l);if(r)for(let e in r)t[e]=r[e]}return t}if(P(e)||I(e))return e}let el=/;(?![^(]*\))/g,er=/:([^]+)/,ei=/\/\*[^]*?\*\//g;function es(e){let t="";if(P(e))t=e;else if(k(e))for(let n=0;neu(e,t))}let ef=e=>!!(e&&!0===e.__v_isRef),ep=e=>P(e)?e:null==e?"":k(e)||I(e)&&(e.toString===D||!O(e.toString))?ef(e)?ep(e.value):JSON.stringify(e,ed,2):String(e),ed=(e,t)=>ef(t)?ed(e,t.value):T(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],l)=>(e[eh(t,l)+" =>"]=n,e),{})}:A(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>eh(e))}:M(t)?eh(t):!I(t)||k(t)||U(t)?t:String(t),eh=(e,t="")=>{var n;return M(e)?`Symbol(${null!=(n=e.description)?n:t})`:e};class eg{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=l,!e&&l&&(this.index=(l.scopes||(l.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){let e,t;if(this._isPaused=!0,this.scopes)for(e=0,t=this.scopes.length;e0)){if(s){let e=s;for(s=void 0;e;){let t=e.next;e.next=void 0,e.flags&=-9,e=t}}for(;i;){let t=i;for(i=void 0;t;){let n=t.next;if(t.next=void 0,t.flags&=-9,1&t.flags)try{t.trigger()}catch(t){e||(e=t)}t=n}}if(e)throw e}}function eE(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function ew(e){let t;let n=e.depsTail,l=n;for(;l;){let e=l.prevDep;-1===l.version?(l===n&&(n=e),eA(l),function(e){let{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}(l)):t=l,l.dep.activeLink=l.prevActiveLink,l.prevActiveLink=void 0,l=e}e.deps=t,e.depsTail=n}function ek(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(eT(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function eT(e){if(4&e.flags&&!(16&e.flags)||(e.flags&=-17,e.globalVersion===eD))return;e.globalVersion=eD;let t=e.dep;if(e.flags|=2,t.version>0&&!e.isSSR&&e.deps&&!ek(e)){e.flags&=-3;return}let n=r,l=eO;r=e,eO=!0;try{eE(e);let n=e.fn(e._value);(0===t.version||J(n,e._value))&&(e._value=n,t.version++)}catch(e){throw t.version++,e}finally{r=n,eO=l,ew(e),e.flags&=-3}}function eA(e,t=!1){let{dep:n,prevSub:l,nextSub:r}=e;if(l&&(l.nextSub=r,e.prevSub=void 0),r&&(r.prevSub=l,e.nextSub=void 0),n.subs===e&&(n.subs=l,!l&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)eA(e,!0)}t||--n.sc||!n.map||n.map.delete(n.key)}function eR(e,t){e.effect instanceof eb&&(e=e.effect.fn);let n=new eb(e);t&&C(n,t);try{n.run()}catch(e){throw n.stop(),e}let l=n.run.bind(n);return l.effect=n,l}function eN(e){e.effect.stop()}let eO=!0,eP=[];function eM(){eP.push(eO),eO=!1}function eI(){let e=eP.pop();eO=void 0===e||e}function eL(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let e=r;r=void 0;try{t()}finally{r=e}}}let eD=0;class eF{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class eV{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(e){if(!r||!eO||r===this.computed)return;let t=this.activeLink;if(void 0===t||t.sub!==r)t=this.activeLink=new eF(r,this),r.deps?(t.prevDep=r.depsTail,r.depsTail.nextDep=t,r.depsTail=t):r.deps=r.depsTail=t,function e(t){if(t.dep.sc++,4&t.sub.flags){let n=t.dep.computed;if(n&&!t.dep.subs){n.flags|=20;for(let t=n.deps;t;t=t.nextDep)e(t)}let l=t.dep.subs;l!==t&&(t.prevSub=l,l&&(l.nextSub=t)),t.dep.subs=t}}(t);else if(-1===t.version&&(t.version=this.version,t.nextDep)){let e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=r.depsTail,t.nextDep=void 0,r.depsTail.nextDep=t,r.depsTail=t,r.deps===t&&(r.deps=e)}return t}trigger(e){this.version++,eD++,this.notify(e)}notify(e){eS++;try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{ex()}}}let eU=new WeakMap,ej=Symbol(""),eB=Symbol(""),e$=Symbol("");function eH(e,t,n){if(eO&&r){let t=eU.get(e);t||eU.set(e,t=new Map);let l=t.get(n);l||(t.set(n,l=new eV),l.map=t,l.key=n),l.track()}}function eW(e,t,n,l,r,i){let s=eU.get(e);if(!s){eD++;return}let o=e=>{e&&e.trigger()};if(eS++,"clear"===t)s.forEach(o);else{let r=k(e),i=r&&j(n);if(r&&"length"===n){let e=Number(l);s.forEach((t,n)=>{("length"===n||n===e$||!M(n)&&n>=e)&&o(t)})}else switch((void 0!==n||s.has(void 0))&&o(s.get(n)),i&&o(s.get(e$)),t){case"add":r?i&&o(s.get("length")):(o(s.get(ej)),T(e)&&o(s.get(eB)));break;case"delete":!r&&(o(s.get(ej)),T(e)&&o(s.get(eB)));break;case"set":T(e)&&o(s.get(ej))}}ex()}function eK(e){let t=tS(e);return t===e?t:(eH(t,"iterate",e$),ty(e)?t:t.map(tx))}function ez(e){return eH(e=tS(e),"iterate",e$),e}let eq={__proto__:null,[Symbol.iterator](){return eG(this,Symbol.iterator,tx)},concat(...e){return eK(this).concat(...e.map(e=>k(e)?eK(e):e))},entries(){return eG(this,"entries",e=>(e[1]=tx(e[1]),e))},every(e,t){return eX(this,"every",e,t,void 0,arguments)},filter(e,t){return eX(this,"filter",e,t,e=>e.map(tx),arguments)},find(e,t){return eX(this,"find",e,t,tx,arguments)},findIndex(e,t){return eX(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return eX(this,"findLast",e,t,tx,arguments)},findLastIndex(e,t){return eX(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return eX(this,"forEach",e,t,void 0,arguments)},includes(...e){return eY(this,"includes",e)},indexOf(...e){return eY(this,"indexOf",e)},join(e){return eK(this).join(e)},lastIndexOf(...e){return eY(this,"lastIndexOf",e)},map(e,t){return eX(this,"map",e,t,void 0,arguments)},pop(){return eQ(this,"pop")},push(...e){return eQ(this,"push",e)},reduce(e,...t){return eZ(this,"reduce",e,t)},reduceRight(e,...t){return eZ(this,"reduceRight",e,t)},shift(){return eQ(this,"shift")},some(e,t){return eX(this,"some",e,t,void 0,arguments)},splice(...e){return eQ(this,"splice",e)},toReversed(){return eK(this).toReversed()},toSorted(e){return eK(this).toSorted(e)},toSpliced(...e){return eK(this).toSpliced(...e)},unshift(...e){return eQ(this,"unshift",e)},values(){return eG(this,"values",tx)}};function eG(e,t,n){let l=ez(e),r=l[t]();return l===e||ty(e)||(r._next=r.next,r.next=()=>{let e=r._next();return e.value&&(e.value=n(e.value)),e}),r}let eJ=Array.prototype;function eX(e,t,n,l,r,i){let s=ez(e),o=s!==e&&!ty(e),a=s[t];if(a!==eJ[t]){let t=a.apply(e,i);return o?tx(t):t}let u=n;s!==e&&(o?u=function(t,l){return n.call(this,tx(t),l,e)}:n.length>2&&(u=function(t,l){return n.call(this,t,l,e)}));let c=a.call(s,u,l);return o&&r?r(c):c}function eZ(e,t,n,l){let r=ez(e),i=n;return r!==e&&(ty(e)?n.length>3&&(i=function(t,l,r){return n.call(this,t,l,r,e)}):i=function(t,l,r){return n.call(this,t,tx(l),r,e)}),r[t](i,...l)}function eY(e,t,n){let l=tS(e);eH(l,"iterate",e$);let r=l[t](...n);return(-1===r||!1===r)&&tb(n[0])?(n[0]=tS(n[0]),l[t](...n)):r}function eQ(e,t,n=[]){eM(),eS++;let l=tS(e)[t].apply(e,n);return ex(),eI(),l}let e0=h("__proto__,__v_isRef,__isVue"),e1=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>"arguments"!==e&&"caller"!==e).map(e=>Symbol[e]).filter(M));function e2(e){M(e)||(e=String(e));let t=tS(this);return eH(t,"has",e),t.hasOwnProperty(e)}class e6{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if("__v_skip"===t)return e.__v_skip;let l=this._isReadonly,r=this._isShallow;if("__v_isReactive"===t)return!l;if("__v_isReadonly"===t)return l;if("__v_isShallow"===t)return r;if("__v_raw"===t)return n===(l?r?tf:tc:r?tu:ta).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;let i=k(e);if(!l){let e;if(i&&(e=eq[t]))return e;if("hasOwnProperty"===t)return e2}let s=Reflect.get(e,t,tw(e)?e:n);return(M(t)?e1.has(t):e0(t))?s:(l||eH(e,"get",t),r)?s:tw(s)?i&&j(t)?s:s.value:I(s)?l?th(s):tp(s):s}}class e4 extends e6{constructor(e=!1){super(!1,e)}set(e,t,n,l){let r=e[t];if(!this._isShallow){let t=t_(r);if(ty(n)||t_(n)||(r=tS(r),n=tS(n)),!k(e)&&tw(r)&&!tw(n))return!t&&(r.value=n,!0)}let i=k(e)&&j(t)?Number(t)e,tt=e=>Reflect.getPrototypeOf(e);function tn(e){return function(...t){return"delete"!==e&&("clear"===e?void 0:this)}}function tl(e,t){let n=function(e,t){let n={get(n){let l=this.__v_raw,r=tS(l),i=tS(n);e||(J(n,i)&&eH(r,"get",n),eH(r,"get",i));let{has:s}=tt(r),o=t?te:e?tE:tx;return s.call(r,n)?o(l.get(n)):s.call(r,i)?o(l.get(i)):void(l!==r&&l.get(n))},get size(){let t=this.__v_raw;return e||eH(tS(t),"iterate",ej),Reflect.get(t,"size",t)},has(t){let n=this.__v_raw,l=tS(n),r=tS(t);return e||(J(t,r)&&eH(l,"has",t),eH(l,"has",r)),t===r?n.has(t):n.has(t)||n.has(r)},forEach(n,l){let r=this,i=r.__v_raw,s=tS(i),o=t?te:e?tE:tx;return e||eH(s,"iterate",ej),i.forEach((e,t)=>n.call(l,o(e),o(t),r))}};return C(n,e?{add:tn("add"),set:tn("set"),delete:tn("delete"),clear:tn("clear")}:{add(e){t||ty(e)||t_(e)||(e=tS(e));let n=tS(this);return tt(n).has.call(n,e)||(n.add(e),eW(n,"add",e,e)),this},set(e,n){t||ty(n)||t_(n)||(n=tS(n));let l=tS(this),{has:r,get:i}=tt(l),s=r.call(l,e);s||(e=tS(e),s=r.call(l,e));let o=i.call(l,e);return l.set(e,n),s?J(n,o)&&eW(l,"set",e,n):eW(l,"add",e,n),this},delete(e){let t=tS(this),{has:n,get:l}=tt(t),r=n.call(t,e);r||(e=tS(e),r=n.call(t,e)),l&&l.call(t,e);let i=t.delete(e);return r&&eW(t,"delete",e,void 0),i},clear(){let e=tS(this),t=0!==e.size,n=e.clear();return t&&eW(e,"clear",void 0,void 0),n}}),["keys","values","entries",Symbol.iterator].forEach(l=>{n[l]=function(...n){let r=this.__v_raw,i=tS(r),s=T(i),o="entries"===l||l===Symbol.iterator&&s,a=r[l](...n),u=t?te:e?tE:tx;return e||eH(i,"iterate","keys"===l&&s?eB:ej),{next(){let{value:e,done:t}=a.next();return t?{value:e,done:t}:{value:o?[u(e[0]),u(e[1])]:u(e),done:t}},[Symbol.iterator](){return this}}}}),n}(e,t);return(t,l,r)=>"__v_isReactive"===l?!e:"__v_isReadonly"===l?e:"__v_raw"===l?t:Reflect.get(w(n,l)&&l in t?n:t,l,r)}let tr={get:tl(!1,!1)},ti={get:tl(!1,!0)},ts={get:tl(!0,!1)},to={get:tl(!0,!0)},ta=new WeakMap,tu=new WeakMap,tc=new WeakMap,tf=new WeakMap;function tp(e){return t_(e)?e:tv(e,!1,e3,tr,ta)}function td(e){return tv(e,!1,e9,ti,tu)}function th(e){return tv(e,!0,e5,ts,tc)}function tg(e){return tv(e,!0,e7,to,tf)}function tv(e,t,n,l,r){if(!I(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;let i=r.get(e);if(i)return i;let s=e.__v_skip||!Object.isExtensible(e)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}(V(e));if(0===s)return e;let o=new Proxy(e,2===s?l:n);return r.set(e,o),o}function tm(e){return t_(e)?tm(e.__v_raw):!!(e&&e.__v_isReactive)}function t_(e){return!!(e&&e.__v_isReadonly)}function ty(e){return!!(e&&e.__v_isShallow)}function tb(e){return!!e&&!!e.__v_raw}function tS(e){let t=e&&e.__v_raw;return t?tS(t):e}function tC(e){return!w(e,"__v_skip")&&Object.isExtensible(e)&&Z(e,"__v_skip",!0),e}let tx=e=>I(e)?tp(e):e,tE=e=>I(e)?th(e):e;function tw(e){return!!e&&!0===e.__v_isRef}function tk(e){return tA(e,!1)}function tT(e){return tA(e,!0)}function tA(e,t){return tw(e)?e:new tR(e,t)}class tR{constructor(e,t){this.dep=new eV,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:tS(e),this._value=t?e:tx(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||ty(e)||t_(e);J(e=n?e:tS(e),t)&&(this._rawValue=e,this._value=n?e:tx(e),this.dep.trigger())}}function tN(e){e.dep&&e.dep.trigger()}function tO(e){return tw(e)?e.value:e}function tP(e){return O(e)?e():tO(e)}let tM={get:(e,t,n)=>"__v_raw"===t?e:tO(Reflect.get(e,t,n)),set:(e,t,n,l)=>{let r=e[t];return tw(r)&&!tw(n)?(r.value=n,!0):Reflect.set(e,t,n,l)}};function tI(e){return tm(e)?e:new Proxy(e,tM)}class tL{constructor(e){this.__v_isRef=!0,this._value=void 0;let t=this.dep=new eV,{get:n,set:l}=e(t.track.bind(t),t.trigger.bind(t));this._get=n,this._set=l}get value(){return this._value=this._get()}set value(e){this._set(e)}}function tD(e){return new tL(e)}function tF(e){let t=k(e)?Array(e.length):{};for(let n in e)t[n]=tB(e,n);return t}class tV{constructor(e,t,n){this._object=e,this._key=t,this._defaultValue=n,this.__v_isRef=!0,this._value=void 0}get value(){let e=this._object[this._key];return this._value=void 0===e?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return function(e,t){let n=eU.get(e);return n&&n.get(t)}(tS(this._object),this._key)}}class tU{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function tj(e,t,n){return tw(e)?e:O(e)?new tU(e):I(e)&&arguments.length>1?tB(e,t,n):tk(e)}function tB(e,t,n){let l=e[t];return tw(l)?l:new tV(e,t,n)}class t${constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new eV(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=eD-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(8&this.flags)&&r!==this)return eC(this,!0),!0}get value(){let e=this.dep.track();return eT(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}let tH={GET:"get",HAS:"has",ITERATE:"iterate"},tW={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},tK={},tz=new WeakMap;function tq(){return p}function tG(e,t=!1,n=p){if(n){let t=tz.get(n);t||tz.set(n,t=[]),t.push(e)}}function tJ(e,t=1/0,n){if(t<=0||!I(e)||e.__v_skip||(n=n||new Set).has(e))return e;if(n.add(e),t--,tw(e))tJ(e.value,t,n);else if(k(e))for(let l=0;l{tJ(e,t,n)});else if(U(e)){for(let l in e)tJ(e[l],t,n);for(let l of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,l)&&tJ(e[l],t,n)}return e}function tX(e,t){}let tZ={SETUP_FUNCTION:0,0:"SETUP_FUNCTION",RENDER_FUNCTION:1,1:"RENDER_FUNCTION",NATIVE_EVENT_HANDLER:5,5:"NATIVE_EVENT_HANDLER",COMPONENT_EVENT_HANDLER:6,6:"COMPONENT_EVENT_HANDLER",VNODE_HOOK:7,7:"VNODE_HOOK",DIRECTIVE_HOOK:8,8:"DIRECTIVE_HOOK",TRANSITION_HOOK:9,9:"TRANSITION_HOOK",APP_ERROR_HANDLER:10,10:"APP_ERROR_HANDLER",APP_WARN_HANDLER:11,11:"APP_WARN_HANDLER",FUNCTION_REF:12,12:"FUNCTION_REF",ASYNC_COMPONENT_LOADER:13,13:"ASYNC_COMPONENT_LOADER",SCHEDULER:14,14:"SCHEDULER",COMPONENT_UPDATE:15,15:"COMPONENT_UPDATE",APP_UNMOUNT_CLEANUP:16,16:"APP_UNMOUNT_CLEANUP"};function tY(e,t,n,l){try{return l?e(...l):e()}catch(e){t0(e,t,n)}}function tQ(e,t,n,l){if(O(e)){let r=tY(e,t,n,l);return r&&L(r)&&r.catch(e=>{t0(e,t,n)}),r}if(k(e)){let r=[];for(let i=0;i=nr(n)?t1.push(e):t1.splice(function(e){let t=t2+1,n=t1.length;for(;t>>1,r=t1[l],i=nr(r);inr(e)-nr(t));if(t6.length=0,t4){t4.push(...e);return}for(t8=0,t4=e;t8null==e.id?2&e.flags?-1:1/0:e.id,ni=null,ns=null;function no(e){let t=ni;return ni=e,ns=e&&e.type.__scopeId||null,t}function na(e){ns=e}function nu(){ns=null}let nc=e=>nf;function nf(e,t=ni,n){if(!t||e._n)return e;let l=(...n)=>{let r;l._d&&r7(-1);let i=no(t);try{r=e(...n)}finally{no(i),l._d&&r7(1)}return r};return l._n=!0,l._c=!0,l._d=!0,l}function np(e,t){if(null===ni)return e;let n=iV(ni),l=e.dirs||(e.dirs=[]);for(let e=0;ee.__isTeleport,nv=e=>e&&(e.disabled||""===e.disabled),nm=e=>e&&(e.defer||""===e.defer),n_=e=>"undefined"!=typeof SVGElement&&e instanceof SVGElement,ny=e=>"function"==typeof MathMLElement&&e instanceof MathMLElement,nb=(e,t)=>{let n=e&&e.to;return P(n)?t?t(n):null:n},nS={name:"Teleport",__isTeleport:!0,process(e,t,n,l,r,i,s,o,a,u){let{mc:c,pc:f,pbc:p,o:{insert:d,querySelector:h,createText:g,createComment:m}}=u,_=nv(t.props),{shapeFlag:y,children:b,dynamicChildren:S}=t;if(null==e){let e=t.el=g(""),u=t.anchor=g("");d(e,n,l),d(u,n,l);let f=(e,t)=>{16&y&&(r&&r.isCE&&(r.ce._teleportTarget=e),c(b,e,t,r,i,s,o,a))},p=()=>{let e=t.target=nb(t.props,h),n=nw(e,t,g,d);e&&("svg"!==s&&n_(e)?s="svg":"mathml"!==s&&ny(e)&&(s="mathml"),_||(f(e,n),nE(t,!1)))};_&&(f(n,u),nE(t,!0)),nm(t.props)?ry(()=>{p(),t.el.__isMounted=!0},i):p()}else{if(nm(t.props)&&!e.el.__isMounted){ry(()=>{nS.process(e,t,n,l,r,i,s,o,a,u),delete e.el.__isMounted},i);return}t.el=e.el,t.targetStart=e.targetStart;let c=t.anchor=e.anchor,d=t.target=e.target,g=t.targetAnchor=e.targetAnchor,m=nv(e.props),y=m?n:d;if("svg"===s||n_(d)?s="svg":("mathml"===s||ny(d))&&(s="mathml"),S?(p(e.dynamicChildren,S,y,r,i,s,o),rk(e,t,!0)):a||f(e,t,y,m?c:g,r,i,s,o,!1),_)m?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):nC(t,n,c,u,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){let e=t.target=nb(t.props,h);e&&nC(t,e,null,u,0)}else m&&nC(t,d,g,u,1);nE(t,_)}},remove(e,t,n,{um:l,o:{remove:r}},i){let{shapeFlag:s,children:o,anchor:a,targetStart:u,targetAnchor:c,target:f,props:p}=e;if(f&&(r(u),r(c)),i&&r(a),16&s){let e=i||!nv(p);for(let r=0;r{e.isMounted=!0}),lh(()=>{e.isUnmounting=!0}),e}let nR=[Function,Array],nN={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:nR,onEnter:nR,onAfterEnter:nR,onEnterCancelled:nR,onBeforeLeave:nR,onLeave:nR,onAfterLeave:nR,onLeaveCancelled:nR,onBeforeAppear:nR,onAppear:nR,onAfterAppear:nR,onAppearCancelled:nR},nO=e=>{let t=e.subTree;return t.component?nO(t.component):t};function nP(e){let t=e[0];if(e.length>1){for(let n of e)if(n.type!==r2){t=n;break}}return t}let nM={name:"BaseTransition",props:nN,setup(e,{slots:t}){let n=ik(),l=nA();return()=>{let r=t.default&&nU(t.default(),!0);if(!r||!r.length)return;let i=nP(r),s=tS(e),{mode:o}=s;if(l.isLeaving)return nD(i);let a=nF(i);if(!a)return nD(i);let u=nL(a,s,l,n,e=>u=e);a.type!==r2&&nV(a,u);let c=n.subTree&&nF(n.subTree);if(c&&c.type!==r2&&!ii(a,c)&&nO(n).type!==r2){let e=nL(c,s,l,n);if(nV(c,e),"out-in"===o&&a.type!==r2)return l.isLeaving=!0,e.afterLeave=()=>{l.isLeaving=!1,8&n.job.flags||n.update(),delete e.afterLeave,c=void 0},nD(i);"in-out"===o&&a.type!==r2?e.delayLeave=(e,t,n)=>{nI(l,c)[String(c.key)]=c,e[nk]=()=>{t(),e[nk]=void 0,delete u.delayedLeave,c=void 0},u.delayedLeave=()=>{n(),delete u.delayedLeave,c=void 0}}:c=void 0}else c&&(c=void 0);return i}}};function nI(e,t){let{leavingVNodes:n}=e,l=n.get(t.type);return l||(l=Object.create(null),n.set(t.type,l)),l}function nL(e,t,n,l,r){let{appear:i,mode:s,persisted:o=!1,onBeforeEnter:a,onEnter:u,onAfterEnter:c,onEnterCancelled:f,onBeforeLeave:p,onLeave:d,onAfterLeave:h,onLeaveCancelled:g,onBeforeAppear:m,onAppear:_,onAfterAppear:y,onAppearCancelled:b}=t,S=String(e.key),C=nI(n,e),x=(e,t)=>{e&&tQ(e,l,9,t)},E=(e,t)=>{let n=t[1];x(e,t),k(e)?e.every(e=>e.length<=1)&&n():e.length<=1&&n()},w={mode:s,persisted:o,beforeEnter(t){let l=a;if(!n.isMounted){if(!i)return;l=m||a}t[nk]&&t[nk](!0);let r=C[S];r&&ii(e,r)&&r.el[nk]&&r.el[nk](),x(l,[t])},enter(e){let t=u,l=c,r=f;if(!n.isMounted){if(!i)return;t=_||u,l=y||c,r=b||f}let s=!1,o=e[nT]=t=>{s||(s=!0,t?x(r,[e]):x(l,[e]),w.delayedLeave&&w.delayedLeave(),e[nT]=void 0)};t?E(t,[e,o]):o()},leave(t,l){let r=String(e.key);if(t[nT]&&t[nT](!0),n.isUnmounting)return l();x(p,[t]);let i=!1,s=t[nk]=n=>{i||(i=!0,l(),n?x(g,[t]):x(h,[t]),t[nk]=void 0,C[r]!==e||delete C[r])};C[r]=e,d?E(d,[t,s]):s()},clone(e){let i=nL(e,t,n,l,r);return r&&r(i),i}};return w}function nD(e){if(le(e))return(e=id(e)).children=null,e}function nF(e){if(!le(e))return ng(e.type)&&e.children?nP(e.children):e;let{shapeFlag:t,children:n}=e;if(n){if(16&t)return n[0];if(32&t&&O(n.default))return n.default()}}function nV(e,t){6&e.shapeFlag&&e.component?(e.transition=t,nV(e.component.subTree,t)):128&e.shapeFlag?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function nU(e,t=!1,n){let l=[],r=0;for(let i=0;i1)for(let e=0;en.value,set:e=>n.value=e}),n}function nW(e,t,n,l,r=!1){if(k(e)){e.forEach((e,i)=>nW(e,t&&(k(t)?t[i]:t),n,l,r));return}if(n5(l)&&!r){512&l.shapeFlag&&l.type.__asyncResolved&&l.component.subTree.component&&nW(e,t,n,l.component.subTree);return}let i=4&l.shapeFlag?iV(l.component):l.el,s=r?null:i,{i:o,r:a}=e,u=t&&t.r,c=o.refs===g?o.refs={}:o.refs,f=o.setupState,p=tS(f),d=f===g?()=>!1:e=>w(p,e);if(null!=u&&u!==a&&(P(u)?(c[u]=null,d(u)&&(f[u]=null)):tw(u)&&(u.value=null)),O(a))tY(a,o,12,[s,c]);else{let t=P(a),l=tw(a);if(t||l){let o=()=>{if(e.f){let n=t?d(a)?f[a]:c[a]:a.value;r?k(n)&&x(n,i):k(n)?n.includes(i)||n.push(i):t?(c[a]=[i],d(a)&&(f[a]=c[a])):(a.value=[i],e.k&&(c[e.k]=a.value))}else t?(c[a]=s,d(a)&&(f[a]=s)):l&&(a.value=s,e.k&&(c[e.k]=s))};s?(o.id=-1,ry(o,n)):o()}}}let nK=!1,nz=()=>{nK||(console.error("Hydration completed but contains mismatches."),nK=!0)},nq=e=>e.namespaceURI.includes("svg")&&"foreignObject"!==e.tagName,nG=e=>e.namespaceURI.includes("MathML"),nJ=e=>{if(1===e.nodeType){if(nq(e))return"svg";if(nG(e))return"mathml"}},nX=e=>8===e.nodeType;function nZ(e){let{mt:t,p:n,o:{patchProp:l,createText:r,nextSibling:i,parentNode:s,remove:o,insert:a,createComment:u}}=e,c=(n,l,o,u,y,b=!1)=>{b=b||!!l.dynamicChildren;let S=nX(n)&&"["===n.data,C=()=>h(n,l,o,u,y,S),{type:x,ref:E,shapeFlag:w,patchFlag:k}=l,T=n.nodeType;l.el=n,-2===k&&(b=!1,l.dynamicChildren=null);let A=null;switch(x){case r1:3!==T?""===l.children?(a(l.el=r(""),s(n),n),A=n):A=C():(n.data!==l.children&&(nz(),n.data=l.children),A=i(n));break;case r2:_(n)?(A=i(n),m(l.el=n.content.firstChild,n,o)):A=8!==T||S?C():i(n);break;case r6:if(S&&(T=(n=i(n)).nodeType),1===T||3===T){A=n;let e=!l.children.length;for(let t=0;t{s=s||!!t.dynamicChildren;let{type:a,props:u,patchFlag:c,shapeFlag:f,dirs:d,transition:h}=t,g="input"===a||"option"===a;if(g||-1!==c){let a;d&&nd(t,null,n,"created");let y=!1;if(_(e)){y=rw(null,h)&&n&&n.vnode.props&&n.vnode.props.appear;let l=e.content.firstChild;y&&h.beforeEnter(l),m(l,e,n),t.el=e=l}if(16&f&&!(u&&(u.innerHTML||u.textContent))){let l=p(e.firstChild,t,e,n,r,i,s);for(;l;){n0(e,1)||nz();let t=l;l=l.nextSibling,o(t)}}else if(8&f){let n=t.children;"\n"===n[0]&&("PRE"===e.tagName||"TEXTAREA"===e.tagName)&&(n=n.slice(1)),e.textContent!==n&&(n0(e,0)||nz(),e.textContent=t.children)}if(u){if(g||!s||48&c){let t=e.tagName.includes("-");for(let r in u)(g&&(r.endsWith("value")||"indeterminate"===r)||b(r)&&!B(r)||"."===r[0]||t)&&l(e,r,null,u[r],void 0,n)}else if(u.onClick)l(e,"onClick",null,u.onClick,void 0,n);else if(4&c&&tm(u.style))for(let e in u.style)u.style[e]}(a=u&&u.onVnodeBeforeMount)&&iS(a,n,t),d&&nd(t,null,n,"beforeMount"),((a=u&&u.onVnodeMounted)||d||y)&&rY(()=>{a&&iS(a,n,t),y&&h.enter(e),d&&nd(t,null,n,"mounted")},r)}return e.nextSibling},p=(e,t,l,s,o,u,f)=>{f=f||!!t.dynamicChildren;let p=t.children,d=p.length;for(let t=0;t{let{slotScopeIds:c}=t;c&&(r=r?r.concat(c):c);let f=s(e),d=p(i(e),t,f,n,l,r,o);return d&&nX(d)&&"]"===d.data?i(t.anchor=d):(nz(),a(t.anchor=u("]"),f,d),d)},h=(e,t,l,r,a,u)=>{if(n0(e.parentElement,1)||nz(),t.el=null,u){let t=g(e);for(;;){let n=i(e);if(n&&n!==t)o(n);else break}}let c=i(e),f=s(e);return o(e),n(null,t,f,c,l,r,nJ(f),a),l&&(l.vnode.el=t.el,rK(l,t.el)),c},g=(e,t="[",n="]")=>{let l=0;for(;e;)if((e=i(e))&&nX(e)&&(e.data===t&&l++,e.data===n)){if(0===l)return i(e);l--}return e},m=(e,t,n)=>{let l=t.parentNode;l&&l.replaceChild(e,t);let r=n;for(;r;)r.vnode.el===t&&(r.vnode.el=r.subTree.el=e),r=r.parent},_=e=>1===e.nodeType&&"TEMPLATE"===e.tagName;return[(e,t)=>{if(!t.hasChildNodes()){n(null,e,t),nl(),t._vnode=e;return}c(t.firstChild,e,null,null,null),nl(),t._vnode=e},c]}let nY="data-allow-mismatch",nQ={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function n0(e,t){if(0===t||1===t)for(;e&&!e.hasAttribute(nY);)e=e.parentElement;let n=e&&e.getAttribute(nY);if(null==n)return!1;if(""===n)return!0;{let e=n.split(",");return!!(0===t&&e.includes("children"))||n.split(",").includes(nQ[t])}}let n1=ee().requestIdleCallback||(e=>setTimeout(e,1)),n2=ee().cancelIdleCallback||(e=>clearTimeout(e)),n6=(e=1e4)=>t=>{let n=n1(t,{timeout:e});return()=>n2(n)},n4=e=>(t,n)=>{let l=new IntersectionObserver(e=>{for(let n of e)if(n.isIntersecting){l.disconnect(),t();break}},e);return n(e=>{if(e instanceof Element){if(function(e){let{top:t,left:n,bottom:l,right:r}=e.getBoundingClientRect(),{innerHeight:i,innerWidth:s}=window;return(t>0&&t0&&l0&&n0&&rl.disconnect()},n8=e=>t=>{if(e){let n=matchMedia(e);if(!n.matches)return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t);t()}},n3=(e=[])=>(t,n)=>{P(e)&&(e=[e]);let l=!1,r=e=>{l||(l=!0,i(),t(),e.target.dispatchEvent(new e.constructor(e.type,e)))},i=()=>{n(t=>{for(let n of e)t.removeEventListener(n,r)})};return n(t=>{for(let n of e)t.addEventListener(n,r,{once:!0})}),i},n5=e=>!!e.type.__asyncLoader;function n9(e){let t;O(e)&&(e={loader:e});let{loader:n,loadingComponent:l,errorComponent:r,delay:i=200,hydrate:s,timeout:o,suspensible:a=!0,onError:u}=e,c=null,f=0,p=()=>(f++,c=null,d()),d=()=>{let e;return c||(e=c=n().catch(e=>{if(e=e instanceof Error?e:Error(String(e)),u)return new Promise((t,n)=>{u(e,()=>t(p()),()=>n(e),f+1)});throw e}).then(n=>e!==c&&c?c:(n&&(n.__esModule||"Module"===n[Symbol.toStringTag])&&(n=n.default),t=n,n)))};return nj({name:"AsyncComponentWrapper",__asyncLoader:d,__asyncHydrate(e,n,l){let r=s?()=>{let t=s(l,t=>(function(e,t){if(nX(e)&&"["===e.data){let n=1,l=e.nextSibling;for(;l;){if(1===l.nodeType){if(!1===t(l))break}else if(nX(l)){if("]"===l.data){if(0==--n)break}else"["===l.data&&n++}l=l.nextSibling}}else t(e)})(e,t));t&&(n.bum||(n.bum=[])).push(t)}:l;t?r():d().then(()=>!n.isUnmounted&&r())},get __asyncResolved(){return t},setup(){let e=iw;if(n$(e),t)return()=>n7(t,e);let n=t=>{c=null,t0(t,e,13,!r)};if(a&&e.suspense||iN)return d().then(t=>()=>n7(t,e)).catch(e=>(n(e),()=>r?ic(r,{error:e}):null));let s=tk(!1),u=tk(),f=tk(!!i);return i&&setTimeout(()=>{f.value=!1},i),null!=o&&setTimeout(()=>{if(!s.value&&!u.value){let e=Error(`Async component timed out after ${o}ms.`);n(e),u.value=e}},o),d().then(()=>{s.value=!0,e.parent&&le(e.parent.vnode)&&e.parent.update()}).catch(e=>{n(e),u.value=e}),()=>s.value&&t?n7(t,e):u.value&&r?ic(r,{error:u.value}):l&&!f.value?ic(l):void 0}})}function n7(e,t){let{ref:n,props:l,children:r,ce:i}=t.vnode,s=ic(e,l,r);return s.ref=n,s.ce=i,delete t.vnode.ce,s}let le=e=>e.type.__isKeepAlive,lt={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){let n=ik(),l=n.ctx;if(!l.renderer)return()=>{let e=t.default&&t.default();return e&&1===e.length?e[0]:e};let r=new Map,i=new Set,s=null,o=n.suspense,{renderer:{p:a,m:u,um:c,o:{createElement:f}}}=l,p=f("div");function d(e){ls(e),c(e,n,o,!0)}function h(e){r.forEach((t,n)=>{let l=iU(t.type);l&&!e(l)&&g(n)})}function g(e){let t=r.get(e);!t||s&&ii(t,s)?s&&ls(s):d(t),r.delete(e),i.delete(e)}l.activate=(e,t,n,l,r)=>{let i=e.component;u(e,t,n,0,o),a(i.vnode,e,t,n,i,o,l,e.slotScopeIds,r),ry(()=>{i.isDeactivated=!1,i.a&&X(i.a);let t=e.props&&e.props.onVnodeMounted;t&&iS(t,i.parent,e)},o)},l.deactivate=e=>{let t=e.component;rT(t.m),rT(t.a),u(e,p,null,1,o),ry(()=>{t.da&&X(t.da);let n=e.props&&e.props.onVnodeUnmounted;n&&iS(n,t.parent,e),t.isDeactivated=!0},o)},rM(()=>[e.include,e.exclude],([e,t])=>{e&&h(t=>ln(e,t)),t&&h(e=>!ln(t,e))},{flush:"post",deep:!0});let m=null,_=()=>{null!=m&&(rz(n.subTree.type)?ry(()=>{r.set(m,lo(n.subTree))},n.subTree.suspense):r.set(m,lo(n.subTree)))};return lf(_),ld(_),lh(()=>{r.forEach(e=>{let{subTree:t,suspense:l}=n,r=lo(t);if(e.type===r.type&&e.key===r.key){ls(r);let e=r.component.da;e&&ry(e,l);return}d(e)})}),()=>{if(m=null,!t.default)return s=null;let n=t.default(),l=n[0];if(n.length>1)return s=null,n;if(!ir(l)||!(4&l.shapeFlag)&&!(128&l.shapeFlag))return s=null,l;let o=lo(l);if(o.type===r2)return s=null,o;let a=o.type,u=iU(n5(o)?o.type.__asyncResolved||{}:a),{include:c,exclude:f,max:p}=e;if(c&&(!u||!ln(c,u))||f&&u&&ln(f,u))return o.shapeFlag&=-257,s=o,l;let d=null==o.key?a:o.key,h=r.get(d);return o.el&&(o=id(o),128&l.shapeFlag&&(l.ssContent=o)),m=d,h?(o.el=h.el,o.component=h.component,o.transition&&nV(o,o.transition),o.shapeFlag|=512,i.delete(d),i.add(d)):(i.add(d),p&&i.size>parseInt(p,10)&&g(i.values().next().value)),o.shapeFlag|=256,s=o,rz(l.type)?l:o}}};function ln(e,t){return k(e)?e.some(e=>ln(e,t)):P(e)?e.split(",").includes(t):!!N(e)&&(e.lastIndex=0,e.test(t))}function ll(e,t){li(e,"a",t)}function lr(e,t){li(e,"da",t)}function li(e,t,n=iw){let l=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()});if(la(t,l,n),n){let e=n.parent;for(;e&&e.parent;)le(e.parent.vnode)&&function(e,t,n,l){let r=la(t,e,l,!0);lg(()=>{x(l[t],r)},n)}(l,t,n,e),e=e.parent}}function ls(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function lo(e){return 128&e.shapeFlag?e.ssContent:e}function la(e,t,n=iw,l=!1){if(n){let r=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...l)=>{eM();let r=iT(n),i=tQ(t,n,e,l);return r(),eI(),i});return l?r.unshift(i):r.push(i),i}}let lu=e=>(t,n=iw)=>{iN&&"sp"!==e||la(e,(...e)=>t(...e),n)},lc=lu("bm"),lf=lu("m"),lp=lu("bu"),ld=lu("u"),lh=lu("bum"),lg=lu("um"),lv=lu("sp"),lm=lu("rtg"),l_=lu("rtc");function ly(e,t=iw){la("ec",e,t)}let lb="components";function lS(e,t){return lw(lb,e,!0,t)||e}let lC=Symbol.for("v-ndc");function lx(e){return P(e)?lw(lb,e,!1)||e:e||lC}function lE(e){return lw("directives",e)}function lw(e,t,n=!0,l=!1){let r=ni||iw;if(r){let n=r.type;if(e===lb){let e=iU(n,!1);if(e&&(e===t||e===W(t)||e===q(W(t))))return n}let i=lk(r[e]||n[e],t)||lk(r.appContext[e],t);return!i&&l?n:i}}function lk(e,t){return e&&(e[t]||e[W(t)]||e[q(W(t))])}function lT(e,t,n,l){let r;let i=n&&n[l],s=k(e);if(s||P(e)){let n=s&&tm(e),l=!1;n&&(l=!ty(e),e=ez(e)),r=Array(e.length);for(let n=0,s=e.length;nt(e,n,void 0,i&&i[n]));else{let n=Object.keys(e);r=Array(n.length);for(let l=0,s=n.length;l{let t=l.fn(...e);return t&&(t.key=l.key),t}:l.fn)}return e}function lR(e,t,n={},l,r){if(ni.ce||ni.parent&&n5(ni.parent)&&ni.parent.ce)return"default"!==t&&(n.name=t),r3(),il(r0,null,[ic("slot",n,l&&l())],64);let i=e[t];i&&i._c&&(i._d=!1),r3();let s=i&&lN(i(n)),o=n.key||s&&s.key,a=il(r0,{key:(o&&!M(o)?o:`_${t}`)+(!s&&l?"_fb":"")},s||(l?l():[]),s&&1===e._?64:-2);return!r&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),i&&i._c&&(i._d=!0),a}function lN(e){return e.some(e=>!ir(e)||!!(e.type!==r2&&(e.type!==r0||lN(e.children))))?e:null}function lO(e,t){let n={};for(let l in e)n[t&&/[A-Z]/.test(l)?`on:${l}`:G(l)]=e[l];return n}let lP=e=>e?iR(e)?iV(e):lP(e.parent):null,lM=C(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>lP(e.parent),$root:e=>lP(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>l0(e),$forceUpdate:e=>e.f||(e.f=()=>{t7(e.update)}),$nextTick:e=>e.n||(e.n=t9.bind(e.proxy)),$watch:e=>rL.bind(e)}),lI=(e,t)=>e!==g&&!e.__isScriptSetup&&w(e,t),lL={get({_:e},t){let n,l,r;if("__v_skip"===t)return!0;let{ctx:i,setupState:s,data:o,props:a,accessCache:u,type:c,appContext:f}=e;if("$"!==t[0]){let l=u[t];if(void 0!==l)switch(l){case 1:return s[t];case 2:return o[t];case 4:return i[t];case 3:return a[t]}else{if(lI(s,t))return u[t]=1,s[t];if(o!==g&&w(o,t))return u[t]=2,o[t];if((n=e.propsOptions[0])&&w(n,t))return u[t]=3,a[t];if(i!==g&&w(i,t))return u[t]=4,i[t];lY&&(u[t]=0)}}let p=lM[t];return p?("$attrs"===t&&eH(e.attrs,"get",""),p(e)):(l=c.__cssModules)&&(l=l[t])?l:i!==g&&w(i,t)?(u[t]=4,i[t]):w(r=f.config.globalProperties,t)?r[t]:void 0},set({_:e},t,n){let{data:l,setupState:r,ctx:i}=e;return lI(r,t)?(r[t]=n,!0):l!==g&&w(l,t)?(l[t]=n,!0):!w(e.props,t)&&!("$"===t[0]&&t.slice(1)in e)&&(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:l,appContext:r,propsOptions:i}},s){let o;return!!n[s]||e!==g&&w(e,s)||lI(t,s)||(o=i[0])&&w(o,s)||w(l,s)||w(lM,s)||w(r.config.globalProperties,s)},defineProperty(e,t,n){return null!=n.get?e._.accessCache[t]=0:w(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},lD=C({},lL,{get(e,t){if(t!==Symbol.unscopables)return lL.get(e,t,e)},has:(e,t)=>"_"!==t[0]&&!et(t)});function lF(){return null}function lV(){return null}function lU(e){}function lj(e){}function lB(){return null}function l$(){}function lH(e,t){return null}function lW(){return lz().slots}function lK(){return lz().attrs}function lz(){let e=ik();return e.setupContext||(e.setupContext=iF(e))}function lq(e){return k(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}function lG(e,t){let n=lq(e);for(let e in t){if(e.startsWith("__skip"))continue;let l=n[e];l?k(l)||O(l)?l=n[e]={type:l,default:t[e]}:l.default=t[e]:null===l&&(l=n[e]={default:t[e]}),l&&t[`__skip_${e}`]&&(l.skipFactory=!0)}return n}function lJ(e,t){return e&&t?k(e)&&k(t)?e.concat(t):C({},lq(e),lq(t)):e||t}function lX(e,t){let n={};for(let l in e)t.includes(l)||Object.defineProperty(n,l,{enumerable:!0,get:()=>e[l]});return n}function lZ(e){let t=ik(),n=e();return iA(),L(n)&&(n=n.catch(e=>{throw iT(t),e})),[n,()=>iT(t)]}let lY=!0;function lQ(e,t,n){tQ(k(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function l0(e){let t;let n=e.type,{mixins:l,extends:r}=n,{mixins:i,optionsCache:s,config:{optionMergeStrategies:o}}=e.appContext,a=s.get(n);return a?t=a:i.length||l||r?(t={},i.length&&i.forEach(e=>l1(t,e,o,!0)),l1(t,n,o)):t=n,I(n)&&s.set(n,t),t}function l1(e,t,n,l=!1){let{mixins:r,extends:i}=t;for(let s in i&&l1(e,i,n,!0),r&&r.forEach(t=>l1(e,t,n,!0)),t)if(l&&"expose"===s);else{let l=l2[s]||n&&n[s];e[s]=l?l(e[s],t[s]):t[s]}return e}let l2={data:l6,props:l5,emits:l5,methods:l3,computed:l3,beforeCreate:l8,created:l8,beforeMount:l8,mounted:l8,beforeUpdate:l8,updated:l8,beforeDestroy:l8,beforeUnmount:l8,destroyed:l8,unmounted:l8,activated:l8,deactivated:l8,errorCaptured:l8,serverPrefetch:l8,components:l3,directives:l3,watch:function(e,t){if(!e)return t;if(!t)return e;let n=C(Object.create(null),e);for(let l in t)n[l]=l8(e[l],t[l]);return n},provide:l6,inject:function(e,t){return l3(l4(e),l4(t))}};function l6(e,t){return t?e?function(){return C(O(e)?e.call(this,this):e,O(t)?t.call(this,this):t)}:t:e}function l4(e){if(k(e)){let t={};for(let n=0;n1)return n&&O(t)?t.call(l&&l.proxy):t}}function rl(){return!!(iw||ni||re)}let rr={},ri=()=>Object.create(rr),rs=e=>Object.getPrototypeOf(e)===rr;function ro(e,t,n,l){let r;let[i,s]=e.propsOptions,o=!1;if(t)for(let a in t){let u;if(B(a))continue;let c=t[a];i&&w(i,u=W(a))?s&&s.includes(u)?(r||(r={}))[u]=c:n[u]=c:rj(e.emitsOptions,a)||a in l&&c===l[a]||(l[a]=c,o=!0)}if(s){let t=tS(n),l=r||g;for(let r=0;r"_"===e[0]||"$stable"===e,rp=e=>k(e)?e.map(im):[im(e)],rd=(e,t,n)=>{if(t._n)return t;let l=nf((...e)=>rp(t(...e)),n);return l._c=!1,l},rh=(e,t,n)=>{let l=e._ctx;for(let n in e){if(rf(n))continue;let r=e[n];if(O(r))t[n]=rd(n,r,l);else if(null!=r){let e=rp(r);t[n]=()=>e}}},rg=(e,t)=>{let n=rp(t);e.slots.default=()=>n},rv=(e,t,n)=>{for(let l in t)(n||"_"!==l)&&(e[l]=t[l])},rm=(e,t,n)=>{let l=e.slots=ri();if(32&e.vnode.shapeFlag){let e=t._;e?(rv(l,t,n),n&&Z(l,"_",e,!0)):rh(t,l)}else t&&rg(e,t)},r_=(e,t,n)=>{let{vnode:l,slots:r}=e,i=!0,s=g;if(32&l.shapeFlag){let e=t._;e?n&&1===e?i=!1:rv(r,t,n):(i=!t.$stable,rh(t,r)),s=t}else t&&(rg(e,t),s={default:1});if(i)for(let e in r)rf(e)||null!=s[e]||delete r[e]},ry=rY;function rb(e){return rC(e)}function rS(e){return rC(e,nZ)}function rC(e,t){var n;let l,r;ee().__VUE__=!0;let{insert:i,remove:s,patchProp:o,createElement:a,createText:u,createComment:c,setText:f,setElementText:p,parentNode:d,nextSibling:h,setScopeId:y=_,insertStaticContent:b}=e,S=(e,t,n,l=null,r=null,i=null,s,o=null,a=!!t.dynamicChildren)=>{if(e===t)return;e&&!ii(e,t)&&(l=er(e),Y(e,r,i,!0),e=null),-2===t.patchFlag&&(a=!1,t.dynamicChildren=null);let{type:u,ref:c,shapeFlag:f}=t;switch(u){case r1:x(e,t,n,l);break;case r2:E(e,t,n,l);break;case r6:null==e&&k(t,n,l,s);break;case r0:V(e,t,n,l,r,i,s,o,a);break;default:1&f?R(e,t,n,l,r,i,s,o,a):6&f?U(e,t,n,l,r,i,s,o,a):64&f?u.process(e,t,n,l,r,i,s,o,a,eo):128&f&&u.process(e,t,n,l,r,i,s,o,a,eo)}null!=c&&r&&nW(c,e&&e.ref,i,t||e,!t)},x=(e,t,n,l)=>{if(null==e)i(t.el=u(t.children),n,l);else{let n=t.el=e.el;t.children!==e.children&&f(n,t.children)}},E=(e,t,n,l)=>{null==e?i(t.el=c(t.children||""),n,l):t.el=e.el},k=(e,t,n,l)=>{[e.el,e.anchor]=b(e.children,t,n,l,e.el,e.anchor)},T=({el:e,anchor:t},n,l)=>{let r;for(;e&&e!==t;)r=h(e),i(e,n,l),e=r;i(t,n,l)},A=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=h(e),s(e),e=n;s(t)},R=(e,t,n,l,r,i,s,o,a)=>{"svg"===t.type?s="svg":"math"===t.type&&(s="mathml"),null==e?N(t,n,l,r,i,s,o,a):L(e,t,r,i,s,o,a)},N=(e,t,n,l,r,s,u,c)=>{let f,d;let{props:h,shapeFlag:g,transition:m,dirs:_}=e;if(f=e.el=a(e.type,s,h&&h.is,h),8&g?p(f,e.children):16&g&&M(e.children,f,null,l,r,rx(e,s),u,c),_&&nd(e,null,l,"created"),P(f,e,e.scopeId,u,l),h){for(let e in h)"value"===e||B(e)||o(f,e,null,h[e],s,l);"value"in h&&o(f,"value",null,h.value,s),(d=h.onVnodeBeforeMount)&&iS(d,l,e)}_&&nd(e,null,l,"beforeMount");let y=rw(r,m);y&&m.beforeEnter(f),i(f,t,n),((d=h&&h.onVnodeMounted)||y||_)&&ry(()=>{d&&iS(d,l,e),y&&m.enter(f),_&&nd(e,null,l,"mounted")},r)},P=(e,t,n,l,r)=>{if(n&&y(e,n),l)for(let t=0;t{for(let u=a;u{let a;let u=t.el=e.el,{patchFlag:c,dynamicChildren:f,dirs:d}=t;c|=16&e.patchFlag;let h=e.props||g,m=t.props||g;if(n&&rE(n,!1),(a=m.onVnodeBeforeUpdate)&&iS(a,n,t,e),d&&nd(t,e,n,"beforeUpdate"),n&&rE(n,!0),(h.innerHTML&&null==m.innerHTML||h.textContent&&null==m.textContent)&&p(u,""),f?D(e.dynamicChildren,f,u,n,l,rx(t,r),i):s||q(e,t,u,null,n,l,rx(t,r),i,!1),c>0){if(16&c)F(u,h,m,n,r);else if(2&c&&h.class!==m.class&&o(u,"class",null,m.class,r),4&c&&o(u,"style",h.style,m.style,r),8&c){let e=t.dynamicProps;for(let t=0;t{a&&iS(a,n,t,e),d&&nd(t,e,n,"updated")},l)},D=(e,t,n,l,r,i,s)=>{for(let o=0;o{if(t!==n){if(t!==g)for(let i in t)B(i)||i in n||o(e,i,t[i],null,r,l);for(let i in n){if(B(i))continue;let s=n[i],a=t[i];s!==a&&"value"!==i&&o(e,i,a,s,r,l)}"value"in n&&o(e,"value",t.value,n.value,r)}},V=(e,t,n,l,r,s,o,a,c)=>{let f=t.el=e?e.el:u(""),p=t.anchor=e?e.anchor:u(""),{patchFlag:d,dynamicChildren:h,slotScopeIds:g}=t;g&&(a=a?a.concat(g):g),null==e?(i(f,n,l),i(p,n,l),M(t.children||[],n,p,r,s,o,a,c)):d>0&&64&d&&h&&e.dynamicChildren?(D(e.dynamicChildren,h,n,r,s,o,a),(null!=t.key||r&&t===r.subTree)&&rk(e,t,!0)):q(e,t,n,p,r,s,o,a,c)},U=(e,t,n,l,r,i,s,o,a)=>{t.slotScopeIds=o,null==e?512&t.shapeFlag?r.ctx.activate(t,n,l,s,a):j(t,n,l,r,i,s,a):$(e,t,a)},j=(e,t,n,l,r,i,s)=>{let o=e.component=iE(e,l,r);le(e)&&(o.ctx.renderer=eo),iO(o,!1,s),o.asyncDep?(r&&r.registerDep(o,H,s),e.el||E(null,o.subTree=ic(r2),t,n)):H(o,e,t,n,r,i,s)},$=(e,t,n)=>{let l=t.component=e.component;if(function(e,t,n){let{props:l,children:r,component:i}=e,{props:s,children:o,patchFlag:a}=t,u=i.emitsOptions;if(t.dirs||t.transition)return!0;if(!n||!(a>=0))return(!!r||!!o)&&(!o||!o.$stable)||l!==s&&(l?!s||rW(l,s,u):!!s);if(1024&a)return!0;if(16&a)return l?rW(l,s,u):!!s;if(8&a){let e=t.dynamicProps;for(let t=0;t{let a=()=>{if(e.isMounted){let t,{next:n,bu:l,u:r,parent:u,vnode:c}=e;{let t=function e(t){let n=t.subTree.component;if(n)return n.asyncDep&&!n.asyncResolved?n:e(n)}(e);if(t){n&&(n.el=c.el,K(e,n,o)),t.asyncDep.then(()=>{e.isUnmounted||a()});return}}let f=n;rE(e,!1),n?(n.el=c.el,K(e,n,o)):n=c,l&&X(l),(t=n.props&&n.props.onVnodeBeforeUpdate)&&iS(t,u,n,c),rE(e,!0);let p=rB(e),h=e.subTree;e.subTree=p,S(h,p,d(h.el),er(h),e,i,s),n.el=p.el,null===f&&rK(e,p.el),r&&ry(r,i),(t=n.props&&n.props.onVnodeUpdated)&&ry(()=>iS(t,u,n,c),i)}else{let o;let{el:a,props:u}=t,{bm:c,m:f,parent:p,root:d,type:h}=e,g=n5(t);if(rE(e,!1),c&&X(c),!g&&(o=u&&u.onVnodeBeforeMount)&&iS(o,p,t),rE(e,!0),a&&r){let t=()=>{e.subTree=rB(e),r(a,e.subTree,e,i,null)};g&&h.__asyncHydrate?h.__asyncHydrate(a,e,t):t()}else{d.ce&&d.ce._injectChildStyle(h);let r=e.subTree=rB(e);S(null,r,n,l,e,i,s),t.el=r.el}if(f&&ry(f,i),!g&&(o=u&&u.onVnodeMounted)){let e=t;ry(()=>iS(o,p,e),i)}(256&t.shapeFlag||p&&n5(p.vnode)&&256&p.vnode.shapeFlag)&&e.a&&ry(e.a,i),e.isMounted=!0,t=n=l=null}};e.scope.on();let u=e.effect=new eb(a);e.scope.off();let c=e.update=u.run.bind(u),f=e.job=u.runIfDirty.bind(u);f.i=e,f.id=e.uid,u.scheduler=()=>t7(f),rE(e,!0),c()},K=(e,t,n)=>{t.component=e;let l=e.vnode.props;e.vnode=t,e.next=null,function(e,t,n,l){let{props:r,attrs:i,vnode:{patchFlag:s}}=e,o=tS(r),[a]=e.propsOptions,u=!1;if((l||s>0)&&!(16&s)){if(8&s){let n=e.vnode.dynamicProps;for(let l=0;l{let u=e&&e.children,c=e?e.shapeFlag:0,f=t.children,{patchFlag:d,shapeFlag:h}=t;if(d>0){if(128&d){J(u,f,n,l,r,i,s,o,a);return}if(256&d){G(u,f,n,l,r,i,s,o,a);return}}8&h?(16&c&&el(u,r,i),f!==u&&p(n,f)):16&c?16&h?J(u,f,n,l,r,i,s,o,a):el(u,r,i,!0):(8&c&&p(n,""),16&h&&M(f,n,l,r,i,s,o,a))},G=(e,t,n,l,r,i,s,o,a)=>{let u;e=e||m,t=t||m;let c=e.length,f=t.length,p=Math.min(c,f);for(u=0;uf?el(e,r,i,!0,!1,p):M(t,n,l,r,i,s,o,a,p)},J=(e,t,n,l,r,i,s,o,a)=>{let u=0,c=t.length,f=e.length-1,p=c-1;for(;u<=f&&u<=p;){let l=e[u],c=t[u]=a?i_(t[u]):im(t[u]);if(ii(l,c))S(l,c,n,null,r,i,s,o,a);else break;u++}for(;u<=f&&u<=p;){let l=e[f],u=t[p]=a?i_(t[p]):im(t[p]);if(ii(l,u))S(l,u,n,null,r,i,s,o,a);else break;f--,p--}if(u>f){if(u<=p){let e=p+1,f=ep)for(;u<=f;)Y(e[u],r,i,!0),u++;else{let d;let h=u,g=u,_=new Map;for(u=g;u<=p;u++){let e=t[u]=a?i_(t[u]):im(t[u]);null!=e.key&&_.set(e.key,u)}let y=0,b=p-g+1,C=!1,x=0,E=Array(b);for(u=0;u=b){Y(c,r,i,!0);continue}if(null!=c.key)l=_.get(c.key);else for(d=g;d<=p;d++)if(0===E[d-g]&&ii(c,t[d])){l=d;break}void 0===l?Y(c,r,i,!0):(E[l-g]=u+1,l>=x?x=l:C=!0,S(c,t[l],n,null,r,i,s,o,a),y++)}let w=C?function(e){let t,n,l,r,i;let s=e.slice(),o=[0],a=e.length;for(t=0;t>1]]0&&(s[t]=o[l-1]),o[l]=t)}}for(l=o.length,r=o[l-1];l-- >0;)o[l]=r,r=s[r];return o}(E):m;for(d=w.length-1,u=b-1;u>=0;u--){let e=g+u,f=t[e],p=e+1{let{el:s,type:o,transition:a,children:u,shapeFlag:c}=e;if(6&c){Z(e.component.subTree,t,n,l);return}if(128&c){e.suspense.move(t,n,l);return}if(64&c){o.move(e,t,n,eo);return}if(o===r0){i(s,t,n);for(let e=0;ea.enter(s),r);else{let{leave:e,delayLeave:l,afterLeave:r}=a,o=()=>i(s,t,n),u=()=>{e(s,()=>{o(),r&&r()})};l?l(s,o,u):u()}}else i(s,t,n)},Y=(e,t,n,l=!1,r=!1)=>{let i;let{type:s,props:o,ref:a,children:u,dynamicChildren:c,shapeFlag:f,patchFlag:p,dirs:d,cacheIndex:h}=e;if(-2===p&&(r=!1),null!=a&&nW(a,null,n,e,!0),null!=h&&(t.renderCache[h]=void 0),256&f){t.ctx.deactivate(e);return}let g=1&f&&d,m=!n5(e);if(m&&(i=o&&o.onVnodeBeforeUnmount)&&iS(i,t,e),6&f)en(e.component,n,l);else{if(128&f){e.suspense.unmount(n,l);return}g&&nd(e,null,t,"beforeUnmount"),64&f?e.type.remove(e,t,n,eo,l):c&&!c.hasOnce&&(s!==r0||p>0&&64&p)?el(c,t,n,!1,!0):(s===r0&&384&p||!r&&16&f)&&el(u,t,n),l&&Q(e)}(m&&(i=o&&o.onVnodeUnmounted)||g)&&ry(()=>{i&&iS(i,t,e),g&&nd(e,null,t,"unmounted")},n)},Q=e=>{let{type:t,el:n,anchor:l,transition:r}=e;if(t===r0){et(n,l);return}if(t===r6){A(e);return}let i=()=>{s(n),r&&!r.persisted&&r.afterLeave&&r.afterLeave()};if(1&e.shapeFlag&&r&&!r.persisted){let{leave:t,delayLeave:l}=r,s=()=>t(n,i);l?l(e.el,i,s):s()}else i()},et=(e,t)=>{let n;for(;e!==t;)n=h(e),s(e),e=n;s(t)},en=(e,t,n)=>{let{bum:l,scope:r,job:i,subTree:s,um:o,m:a,a:u}=e;rT(a),rT(u),l&&X(l),r.stop(),i&&(i.flags|=8,Y(s,e,t,n)),o&&ry(o,t),ry(()=>{e.isUnmounted=!0},t),t&&t.pendingBranch&&!t.isUnmounted&&e.asyncDep&&!e.asyncResolved&&e.suspenseId===t.pendingId&&(t.deps--,0===t.deps&&t.resolve())},el=(e,t,n,l=!1,r=!1,i=0)=>{for(let s=i;s{if(6&e.shapeFlag)return er(e.component.subTree);if(128&e.shapeFlag)return e.suspense.next();let t=h(e.anchor||e.el),n=t&&t[nh];return n?h(n):t},ei=!1,es=(e,t,n)=>{null==e?t._vnode&&Y(t._vnode,null,null,!0):S(t._vnode||null,e,t,null,null,null,n),t._vnode=e,ei||(ei=!0,nn(),nl(),ei=!1)},eo={p:S,um:Y,m:Z,r:Q,mt:j,mc:M,pc:q,pbc:D,n:er,o:e};return t&&([l,r]=t(eo)),{render:es,hydrate:l,createApp:(n=l,function(e,t=null){O(e)||(e=C({},e)),null==t||I(t)||(t=null);let l=l9(),r=new WeakSet,i=[],s=!1,o=l.app={_uid:l7++,_component:e,_props:t,_container:null,_context:l,_instance:null,version:iK,get config(){return l.config},set config(v){},use:(e,...t)=>(r.has(e)||(e&&O(e.install)?(r.add(e),e.install(o,...t)):O(e)&&(r.add(e),e(o,...t))),o),mixin:e=>(l.mixins.includes(e)||l.mixins.push(e),o),component:(e,t)=>t?(l.components[e]=t,o):l.components[e],directive:(e,t)=>t?(l.directives[e]=t,o):l.directives[e],mount(r,i,a){if(!s){let u=o._ceVNode||ic(e,t);return u.appContext=l,!0===a?a="svg":!1===a&&(a=void 0),i&&n?n(u,r):es(u,r,a),s=!0,o._container=r,r.__vue_app__=o,iV(u.component)}},onUnmount(e){i.push(e)},unmount(){s&&(tQ(i,o._instance,16),es(null,o._container),delete o._container.__vue_app__)},provide:(e,t)=>(l.provides[e]=t,o),runWithContext(e){let t=re;re=o;try{return e()}finally{re=t}}};return o})}}function rx({type:e,props:t},n){return"svg"===n&&"foreignObject"===e||"mathml"===n&&"annotation-xml"===e&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function rE({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function rw(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function rk(e,t,n=!1){let l=e.children,r=t.children;if(k(l)&&k(r))for(let e=0;ern(rA);function rN(e,t){return rI(e,null,t)}function rO(e,t){return rI(e,null,{flush:"post"})}function rP(e,t){return rI(e,null,{flush:"sync"})}function rM(e,t,n){return rI(e,t,n)}function rI(e,t,n=g){let l;let{immediate:r,deep:i,flush:s,once:o}=n,a=C({},n),u=t&&r||!t&&"post"!==s;if(iN){if("sync"===s){let e=rR();l=e.__watcherHandles||(e.__watcherHandles=[])}else if(!u){let e=()=>{};return e.stop=_,e.resume=_,e.pause=_,e}}let c=iw;a.call=(e,t,n)=>tQ(e,c,t,n);let f=!1;"post"===s?a.scheduler=e=>{ry(e,c&&c.suspense)}:"sync"!==s&&(f=!0,a.scheduler=(e,t)=>{t?e():t7(e)}),a.augmentJob=e=>{t&&(e.flags|=4),f&&(e.flags|=2,c&&(e.id=c.uid,e.i=c))};let d=function(e,t,n=g){let l,r,i,s;let{immediate:o,deep:a,once:u,scheduler:c,augmentJob:f,call:d}=n,h=e=>a?e:ty(e)||!1===a||0===a?tJ(e,1):tJ(e),m=!1,y=!1;if(tw(e)?(r=()=>e.value,m=ty(e)):tm(e)?(r=()=>h(e),m=!0):k(e)?(y=!0,m=e.some(e=>tm(e)||ty(e)),r=()=>e.map(e=>tw(e)?e.value:tm(e)?h(e):O(e)?d?d(e,2):e():void 0)):r=O(e)?t?d?()=>d(e,2):e:()=>{if(i){eM();try{i()}finally{eI()}}let t=p;p=l;try{return d?d(e,3,[s]):e(s)}finally{p=t}}:_,t&&a){let e=r,t=!0===a?1/0:a;r=()=>tJ(e(),t)}let b=em(),S=()=>{l.stop(),b&&b.active&&x(b.effects,l)};if(u&&t){let e=t;t=(...t)=>{e(...t),S()}}let C=y?Array(e.length).fill(tK):tK,E=e=>{if(1&l.flags&&(l.dirty||e)){if(t){let e=l.run();if(a||m||(y?e.some((e,t)=>J(e,C[t])):J(e,C))){i&&i();let n=p;p=l;try{let n=[e,C===tK?void 0:y&&C[0]===tK?[]:C,s];d?d(t,3,n):t(...n),C=e}finally{p=n}}}else l.run()}};return f&&f(E),(l=new eb(r)).scheduler=c?()=>c(E,!1):E,s=e=>tG(e,!1,l),i=l.onStop=()=>{let e=tz.get(l);if(e){if(d)d(e,4);else for(let t of e)t();tz.delete(l)}},t?o?E(!0):C=l.run():c?c(E.bind(null,!0),!0):l.run(),S.pause=l.pause.bind(l),S.resume=l.resume.bind(l),S.stop=S,S}(e,t,a);return iN&&(l?l.push(d):u&&d()),d}function rL(e,t,n){let l;let r=this.proxy,i=P(e)?e.includes(".")?rD(r,e):()=>r[e]:e.bind(r,r);O(t)?l=t:(l=t.handler,n=t);let s=iT(this),o=rI(i,l.bind(r),n);return s(),o}function rD(e,t){let n=t.split(".");return()=>{let t=e;for(let e=0;e{let a,u;let c=g;return rP(()=>{let t=e[r];J(a,t)&&(a=t,o())}),{get:()=>(s(),n.get?n.get(a):a),set(e){let s=n.set?n.set(e):e;if(!J(s,a)&&!(c!==g&&J(e,c)))return;let f=l.vnode.props;f&&(t in f||r in f||i in f)&&(`onUpdate:${t}`in f||`onUpdate:${r}`in f||`onUpdate:${i}`in f)||(a=e,o()),l.emit(`update:${t}`,s),J(e,s)&&J(e,c)&&!J(s,u)&&o(),c=e,u=s}}});return o[Symbol.iterator]=()=>{let e=0;return{next:()=>e<2?{value:e++?s||g:o,done:!1}:{done:!0}}},o}let rV=(e,t)=>"modelValue"===t||"model-value"===t?e.modelModifiers:e[`${t}Modifiers`]||e[`${W(t)}Modifiers`]||e[`${z(t)}Modifiers`];function rU(e,t,...n){let l;if(e.isUnmounted)return;let r=e.vnode.props||g,i=n,s=t.startsWith("update:"),o=s&&rV(r,t.slice(7));o&&(o.trim&&(i=n.map(e=>P(e)?e.trim():e)),o.number&&(i=n.map(Y)));let a=r[l=G(t)]||r[l=G(W(t))];!a&&s&&(a=r[l=G(z(t))]),a&&tQ(a,e,6,i);let u=r[l+"Once"];if(u){if(e.emitted){if(e.emitted[l])return}else e.emitted={};e.emitted[l]=!0,tQ(u,e,6,i)}}function rj(e,t){return!!(e&&b(t))&&(w(e,(t=t.slice(2).replace(/Once$/,""))[0].toLowerCase()+t.slice(1))||w(e,z(t))||w(e,t))}function rB(e){let t,n;let{type:l,vnode:r,proxy:i,withProxy:s,propsOptions:[o],slots:a,attrs:u,emit:c,render:f,renderCache:p,props:d,data:h,setupState:g,ctx:m,inheritAttrs:_}=e,y=no(e);try{if(4&r.shapeFlag){let e=s||i;t=im(f.call(e,e,p,d,g,h,m)),n=u}else t=im(l.length>1?l(d,{attrs:u,slots:a,emit:c}):l(d,null)),n=l.props?u:r$(u)}catch(n){r4.length=0,t0(n,e,1),t=ic(r2)}let b=t;if(n&&!1!==_){let e=Object.keys(n),{shapeFlag:t}=b;e.length&&7&t&&(o&&e.some(S)&&(n=rH(n,o)),b=id(b,n,!1,!0))}return r.dirs&&((b=id(b,null,!1,!0)).dirs=b.dirs?b.dirs.concat(r.dirs):r.dirs),r.transition&&nV(b,r.transition),t=b,no(y),t}let r$=e=>{let t;for(let n in e)("class"===n||"style"===n||b(n))&&((t||(t={}))[n]=e[n]);return t},rH=(e,t)=>{let n={};for(let l in e)S(l)&&l.slice(9)in t||(n[l]=e[l]);return n};function rW(e,t,n){let l=Object.keys(t);if(l.length!==Object.keys(e).length)return!0;for(let r=0;re.__isSuspense,rq=0,rG={name:"Suspense",__isSuspense:!0,process(e,t,n,l,r,i,s,o,a,u){if(null==e)!function(e,t,n,l,r,i,s,o,a){let{p:u,o:{createElement:c}}=a,f=c("div"),p=e.suspense=rX(e,r,l,t,f,n,i,s,o,a);u(null,p.pendingBranch=e.ssContent,f,null,l,p,i,s),p.deps>0?(rJ(e,"onPending"),rJ(e,"onFallback"),u(null,e.ssFallback,t,n,l,null,i,s),rQ(p,e.ssFallback)):p.resolve(!1,!0)}(t,n,l,r,i,s,o,a,u);else{if(i&&i.deps>0&&!e.suspense.isInFallback){t.suspense=e.suspense,t.suspense.vnode=t,t.el=e.el;return}!function(e,t,n,l,r,i,s,o,{p:a,um:u,o:{createElement:c}}){let f=t.suspense=e.suspense;f.vnode=t,t.el=e.el;let p=t.ssContent,d=t.ssFallback,{activeBranch:h,pendingBranch:g,isInFallback:m,isHydrating:_}=f;if(g)f.pendingBranch=p,ii(p,g)?(a(g,p,f.hiddenContainer,null,r,f,i,s,o),f.deps<=0?f.resolve():m&&!_&&(a(h,d,n,l,r,null,i,s,o),rQ(f,d))):(f.pendingId=rq++,_?(f.isHydrating=!1,f.activeBranch=g):u(g,r,f),f.deps=0,f.effects.length=0,f.hiddenContainer=c("div"),m?(a(null,p,f.hiddenContainer,null,r,f,i,s,o),f.deps<=0?f.resolve():(a(h,d,n,l,r,null,i,s,o),rQ(f,d))):h&&ii(p,h)?(a(h,p,n,l,r,f,i,s,o),f.resolve(!0)):(a(null,p,f.hiddenContainer,null,r,f,i,s,o),f.deps<=0&&f.resolve()));else if(h&&ii(p,h))a(h,p,n,l,r,f,i,s,o),rQ(f,p);else if(rJ(t,"onPending"),f.pendingBranch=p,512&p.shapeFlag?f.pendingId=p.component.suspenseId:f.pendingId=rq++,a(null,p,f.hiddenContainer,null,r,f,i,s,o),f.deps<=0)f.resolve();else{let{timeout:e,pendingId:t}=f;e>0?setTimeout(()=>{f.pendingId===t&&f.fallback(d)},e):0===e&&f.fallback(d)}}(e,t,n,l,r,s,o,a,u)}},hydrate:function(e,t,n,l,r,i,s,o,a){let u=t.suspense=rX(t,l,n,e.parentNode,document.createElement("div"),null,r,i,s,o,!0),c=a(e,u.pendingBranch=t.ssContent,n,u,i,s);return 0===u.deps&&u.resolve(!1,!0),c},normalize:function(e){let{shapeFlag:t,children:n}=e,l=32&t;e.ssContent=rZ(l?n.default:n),e.ssFallback=l?rZ(n.fallback):ic(r2)}};function rJ(e,t){let n=e.props&&e.props[t];O(n)&&n()}function rX(e,t,n,l,r,i,s,o,a,u,c=!1){let f;let{p:p,m:d,um:h,n:g,o:{parentNode:m,remove:_}}=u,y=function(e){let t=e.props&&e.props.suspensible;return null!=t&&!1!==t}(e);y&&t&&t.pendingBranch&&(f=t.pendingId,t.deps++);let b=e.props?Q(e.props.timeout):void 0,S=i,C={vnode:e,parent:t,parentComponent:n,namespace:s,container:l,hiddenContainer:r,deps:0,pendingId:rq++,timeout:"number"==typeof b?b:-1,activeBranch:null,pendingBranch:null,isInFallback:!c,isHydrating:c,isUnmounted:!1,effects:[],resolve(e=!1,n=!1){let{vnode:l,activeBranch:r,pendingBranch:s,pendingId:o,effects:a,parentComponent:u,container:c}=C,p=!1;C.isHydrating?C.isHydrating=!1:e||((p=r&&s.transition&&"out-in"===s.transition.mode)&&(r.transition.afterLeave=()=>{o===C.pendingId&&(d(s,c,i===S?g(r):i,0),nt(a))}),r&&(m(r.el)===c&&(i=g(r)),h(r,u,C,!0)),p||d(s,c,i,0)),rQ(C,s),C.pendingBranch=null,C.isInFallback=!1;let _=C.parent,b=!1;for(;_;){if(_.pendingBranch){_.effects.push(...a),b=!0;break}_=_.parent}b||p||nt(a),C.effects=[],y&&t&&t.pendingBranch&&f===t.pendingId&&(t.deps--,0!==t.deps||n||t.resolve()),rJ(l,"onResolve")},fallback(e){if(!C.pendingBranch)return;let{vnode:t,activeBranch:n,parentComponent:l,container:r,namespace:i}=C;rJ(t,"onFallback");let s=g(n),u=()=>{C.isInFallback&&(p(null,e,r,s,l,null,i,o,a),rQ(C,e))},c=e.transition&&"out-in"===e.transition.mode;c&&(n.transition.afterLeave=u),C.isInFallback=!0,h(n,l,null,!0),c||u()},move(e,t,n){C.activeBranch&&d(C.activeBranch,e,t,n),C.container=e},next:()=>C.activeBranch&&g(C.activeBranch),registerDep(e,t,n){let l=!!C.pendingBranch;l&&C.deps++;let r=e.vnode.el;e.asyncDep.catch(t=>{t0(t,e,0)}).then(i=>{if(e.isUnmounted||C.isUnmounted||C.pendingId!==e.suspenseId)return;e.asyncResolved=!0;let{vnode:o}=e;iP(e,i,!1),r&&(o.el=r);let a=!r&&e.subTree.el;t(e,o,m(r||e.subTree.el),r?null:g(e.subTree),C,s,n),a&&_(a),rK(e,o.el),l&&0==--C.deps&&C.resolve()})},unmount(e,t){C.isUnmounted=!0,C.activeBranch&&h(C.activeBranch,n,e,t),C.pendingBranch&&h(C.pendingBranch,n,e,t)}};return C}function rZ(e){let t;if(O(e)){let n=r9&&e._c;n&&(e._d=!1,r3()),e=e(),n&&(e._d=!0,t=r8,r5())}return k(e)&&(e=function(e,t=!0){let n;for(let t=0;tt!==e)),e}function rY(e,t){t&&t.pendingBranch?k(e)?t.effects.push(...e):t.effects.push(e):nt(e)}function rQ(e,t){e.activeBranch=t;let{vnode:n,parentComponent:l}=e,r=t.el;for(;!r&&t.component;)r=(t=t.component.subTree).el;n.el=r,l&&l.subTree===n&&(l.vnode.el=r,rK(l,r))}let r0=Symbol.for("v-fgt"),r1=Symbol.for("v-txt"),r2=Symbol.for("v-cmt"),r6=Symbol.for("v-stc"),r4=[],r8=null;function r3(e=!1){r4.push(r8=e?null:[])}function r5(){r4.pop(),r8=r4[r4.length-1]||null}let r9=1;function r7(e,t=!1){r9+=e,e<0&&r8&&t&&(r8.hasOnce=!0)}function ie(e){return e.dynamicChildren=r9>0?r8||m:null,r5(),r9>0&&r8&&r8.push(e),e}function it(e,t,n,l,r,i){return ie(iu(e,t,n,l,r,i,!0))}function il(e,t,n,l,r){return ie(ic(e,t,n,l,r,!0))}function ir(e){return!!e&&!0===e.__v_isVNode}function ii(e,t){return e.type===t.type&&e.key===t.key}function is(e){}let io=({key:e})=>null!=e?e:null,ia=({ref:e,ref_key:t,ref_for:n})=>("number"==typeof e&&(e=""+e),null!=e?P(e)||tw(e)||O(e)?{i:ni,r:e,k:t,f:!!n}:e:null);function iu(e,t=null,n=null,l=0,r=null,i=e===r0?0:1,s=!1,o=!1){let a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&io(t),ref:t&&ia(t),scopeId:ns,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:l,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:ni};return o?(iy(a,n),128&i&&e.normalize(a)):n&&(a.shapeFlag|=P(n)?8:16),r9>0&&!s&&r8&&(a.patchFlag>0||6&i)&&32!==a.patchFlag&&r8.push(a),a}let ic=function(e,t=null,n=null,l=0,r=null,i=!1){var s;if(e&&e!==lC||(e=r2),ir(e)){let l=id(e,t,!0);return n&&iy(l,n),r9>0&&!i&&r8&&(6&l.shapeFlag?r8[r8.indexOf(e)]=l:r8.push(l)),l.patchFlag=-2,l}if(O(s=e)&&"__vccOpts"in s&&(e=e.__vccOpts),t){let{class:e,style:n}=t=ip(t);e&&!P(e)&&(t.class=es(e)),I(n)&&(tb(n)&&!k(n)&&(n=C({},n)),t.style=en(n))}let o=P(e)?1:rz(e)?128:ng(e)?64:I(e)?4:O(e)?2:0;return iu(e,t,n,l,r,o,i,!0)};function ip(e){return e?tb(e)||rs(e)?C({},e):e:null}function id(e,t,n=!1,l=!1){let{props:r,ref:i,patchFlag:s,children:o,transition:a}=e,u=t?ib(r||{},t):r,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&io(u),ref:t&&t.ref?n&&i?k(i)?i.concat(ia(t)):[i,ia(t)]:ia(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:o,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==r0?-1===s?16:16|s:s,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&id(e.ssContent),ssFallback:e.ssFallback&&id(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&l&&nV(c,a.clone(c)),c}function ih(e=" ",t=0){return ic(r1,null,e,t)}function ig(e,t){let n=ic(r6,null,e);return n.staticCount=t,n}function iv(e="",t=!1){return t?(r3(),il(r2,null,e)):ic(r2,null,e)}function im(e){return null==e||"boolean"==typeof e?ic(r2):k(e)?ic(r0,null,e.slice()):ir(e)?i_(e):ic(r1,null,String(e))}function i_(e){return null===e.el&&-1!==e.patchFlag||e.memo?e:id(e)}function iy(e,t){let n=0,{shapeFlag:l}=e;if(null==t)t=null;else if(k(t))n=16;else if("object"==typeof t){if(65&l){let n=t.default;n&&(n._c&&(n._d=!1),iy(e,n()),n._c&&(n._d=!0));return}{n=32;let l=t._;l||rs(t)?3===l&&ni&&(1===ni.slots._?t._=1:(t._=2,e.patchFlag|=1024)):t._ctx=ni}}else O(t)?(t={default:t,_ctx:ni},n=32):(t=String(t),64&l?(n=16,t=[ih(t)]):n=8);e.children=t,e.shapeFlag|=n}function ib(...e){let t={};for(let n=0;n{u=!0;let[l,r]=e(t,n,!0);C(o,l),r&&a.push(...r)};!l&&n.mixins.length&&n.mixins.forEach(r),t.extends&&r(t.extends),t.mixins&&t.mixins.forEach(r)}if(!s&&!u)return I(t)&&r.set(t,m),m;if(k(s))for(let e=0;e{let l=e(t,n,!0);l&&(a=!0,C(o,l))};!l&&n.mixins.length&&n.mixins.forEach(r),t.extends&&r(t.extends),t.mixins&&t.mixins.forEach(r)}return s||a?(k(s)?s.forEach(e=>o[e]=null):C(o,s),I(t)&&r.set(t,o),o):(I(t)&&r.set(t,null),null)}(l,r),emit:null,emitted:null,propsDefaults:g,inheritAttrs:l.inheritAttrs,ctx:g,data:g,props:g,attrs:g,slots:g,refs:g,setupState:g,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return i.ctx={_:i},i.root=t?t.root:i,i.emit=rU.bind(null,i),e.ce&&e.ce(i),i}let iw=null,ik=()=>iw||ni;{let e=ee(),t=(t,n)=>{let l;return(l=e[t])||(l=e[t]=[]),l.push(n),e=>{l.length>1?l.forEach(t=>t(e)):l[0](e)}};o=t("__VUE_INSTANCE_SETTERS__",e=>iw=e),a=t("__VUE_SSR_SETTERS__",e=>iN=e)}let iT=e=>{let t=iw;return o(e),e.scope.on(),()=>{e.scope.off(),o(t)}},iA=()=>{iw&&iw.scope.off(),o(null)};function iR(e){return 4&e.vnode.shapeFlag}let iN=!1;function iO(e,t=!1,n=!1){t&&a(t);let{props:l,children:r}=e.vnode,i=iR(e);!function(e,t,n,l=!1){let r={},i=ri();for(let n in e.propsDefaults=Object.create(null),ro(e,t,r,i),e.propsOptions[0])n in r||(r[n]=void 0);n?e.props=l?r:td(r):e.type.props?e.props=r:e.props=i,e.attrs=i}(e,l,i,t),rm(e,r,n);let s=i?function(e,t){let n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,lL);let{setup:l}=n;if(l){eM();let n=e.setupContext=l.length>1?iF(e):null,r=iT(e),i=tY(l,e,0,[e.props,n]),s=L(i);if(eI(),r(),(s||e.sp)&&!n5(e)&&n$(e),s){if(i.then(iA,iA),t)return i.then(n=>{iP(e,n,t)}).catch(t=>{t0(t,e,0)});e.asyncDep=i}else iP(e,i,t)}else iL(e,t)}(e,t):void 0;return t&&a(!1),s}function iP(e,t,n){O(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:I(t)&&(e.setupState=tI(t)),iL(e,n)}function iM(e){u=e,c=e=>{e.render._rc&&(e.withProxy=new Proxy(e.ctx,lD))}}let iI=()=>!u;function iL(e,t,n){let l=e.type;if(!e.render){if(!t&&u&&!l.render){let t=l.template||l0(e).template;if(t){let{isCustomElement:n,compilerOptions:r}=e.appContext.config,{delimiters:i,compilerOptions:s}=l,o=C(C({isCustomElement:n,delimiters:i},r),s);l.render=u(t,o)}}e.render=l.render||_,c&&c(e)}{let t=iT(e);eM();try{!function(e){let t=l0(e),n=e.proxy,l=e.ctx;lY=!1,t.beforeCreate&&lQ(t.beforeCreate,e,"bc");let{data:r,computed:i,methods:s,watch:o,provide:a,inject:u,created:c,beforeMount:f,mounted:p,beforeUpdate:d,updated:h,activated:g,deactivated:m,beforeDestroy:y,beforeUnmount:b,destroyed:S,unmounted:C,render:x,renderTracked:E,renderTriggered:w,errorCaptured:T,serverPrefetch:A,expose:R,inheritAttrs:N,components:M,directives:L,filters:D}=t;if(u&&function(e,t,n=_){for(let n in k(e)&&(e=l4(e)),e){let l;let r=e[n];tw(l=I(r)?"default"in r?rn(r.from||n,r.default,!0):rn(r.from||n):rn(r))?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>l.value,set:e=>l.value=e}):t[n]=l}}(u,l,null),s)for(let e in s){let t=s[e];O(t)&&(l[e]=t.bind(n))}if(r){let t=r.call(n,n);I(t)&&(e.data=tp(t))}if(lY=!0,i)for(let e in i){let t=i[e],r=O(t)?t.bind(n,n):O(t.get)?t.get.bind(n,n):_,s=ij({get:r,set:!O(t)&&O(t.set)?t.set.bind(n):_});Object.defineProperty(l,e,{enumerable:!0,configurable:!0,get:()=>s.value,set:e=>s.value=e})}if(o)for(let e in o)!function e(t,n,l,r){let i=r.includes(".")?rD(l,r):()=>l[r];if(P(t)){let e=n[t];O(e)&&rM(i,e)}else if(O(t))rM(i,t.bind(l));else if(I(t)){if(k(t))t.forEach(t=>e(t,n,l,r));else{let e=O(t.handler)?t.handler.bind(l):n[t.handler];O(e)&&rM(i,e,t)}}}(o[e],l,n,e);if(a){let e=O(a)?a.call(n):a;Reflect.ownKeys(e).forEach(t=>{rt(t,e[t])})}function F(e,t){k(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(c&&lQ(c,e,"c"),F(lc,f),F(lf,p),F(lp,d),F(ld,h),F(ll,g),F(lr,m),F(ly,T),F(l_,E),F(lm,w),F(lh,b),F(lg,C),F(lv,A),k(R)){if(R.length){let t=e.exposed||(e.exposed={});R.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t})})}else e.exposed||(e.exposed={})}x&&e.render===_&&(e.render=x),null!=N&&(e.inheritAttrs=N),M&&(e.components=M),L&&(e.directives=L),A&&n$(e)}(e)}finally{eI(),t()}}}let iD={get:(e,t)=>(eH(e,"get",""),e[t])};function iF(e){return{attrs:new Proxy(e.attrs,iD),slots:e.slots,emit:e.emit,expose:t=>{e.exposed=t||{}}}}function iV(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(tI(tC(e.exposed)),{get:(t,n)=>n in t?t[n]:n in lM?lM[n](e):void 0,has:(e,t)=>t in e||t in lM})):e.proxy}function iU(e,t=!0){return O(e)?e.displayName||e.name:e.name||t&&e.__name}let ij=(e,t)=>(function(e,t,n=!1){let l,r;return O(e)?l=e:(l=e.get,r=e.set),new t$(l,r,n)})(e,0,iN);function iB(e,t,n){let l=arguments.length;return 2!==l?(l>3?n=Array.prototype.slice.call(arguments,2):3===l&&ir(n)&&(n=[n]),ic(e,t,n)):!I(t)||k(t)?ic(e,null,t):ir(t)?ic(e,null,[t]):ic(e,t)}function i$(){}function iH(e,t,n,l){let r=n[l];if(r&&iW(r,e))return r;let i=t();return i.memo=e.slice(),i.cacheIndex=l,n[l]=i}function iW(e,t){let n=e.memo;if(n.length!=t.length)return!1;for(let e=0;e0&&r8&&r8.push(e),!0}let iK="3.5.13",iz=_,iq=null,iG=void 0,iJ=_,iX={createComponentInstance:iE,setupComponent:iO,renderComponentRoot:rB,setCurrentRenderingInstance:no,isVNode:ir,normalizeVNode:im,getComponentPublicInstance:iV,ensureValidVNode:lN,pushWarningContext:function(e){},popWarningContext:function(){}},iZ=null,iY=null,iQ=null,i0="undefined"!=typeof window&&window.trustedTypes;if(i0)try{d=i0.createPolicy("vue",{createHTML:e=>e})}catch(e){}let i1=d?e=>d.createHTML(e):e=>e,i2="undefined"!=typeof document?document:null,i6=i2&&i2.createElement("template"),i4="transition",i8="animation",i3=Symbol("_vtc"),i5={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},i9=C({},nN,i5),i7=((e=(e,{slots:t})=>iB(nM,sn(e),t)).displayName="Transition",e.props=i9,e),se=(e,t=[])=>{k(e)?e.forEach(e=>e(...t)):e&&e(...t)},st=e=>!!e&&(k(e)?e.some(e=>e.length>1):e.length>1);function sn(e){let t={};for(let n in e)n in i5||(t[n]=e[n]);if(!1===e.css)return t;let{name:n="v",type:l,duration:r,enterFromClass:i=`${n}-enter-from`,enterActiveClass:s=`${n}-enter-active`,enterToClass:o=`${n}-enter-to`,appearFromClass:a=i,appearActiveClass:u=s,appearToClass:c=o,leaveFromClass:f=`${n}-leave-from`,leaveActiveClass:p=`${n}-leave-active`,leaveToClass:d=`${n}-leave-to`}=e,h=function(e){if(null==e)return null;if(I(e))return[Q(e.enter),Q(e.leave)];{let t=Q(e);return[t,t]}}(r),g=h&&h[0],m=h&&h[1],{onBeforeEnter:_,onEnter:y,onEnterCancelled:b,onLeave:S,onLeaveCancelled:x,onBeforeAppear:E=_,onAppear:w=y,onAppearCancelled:k=b}=t,T=(e,t,n,l)=>{e._enterCancelled=l,sr(e,t?c:o),sr(e,t?u:s),n&&n()},A=(e,t)=>{e._isLeaving=!1,sr(e,f),sr(e,d),sr(e,p),t&&t()},R=e=>(t,n)=>{let r=e?w:y,s=()=>T(t,e,n);se(r,[t,s]),si(()=>{sr(t,e?a:i),sl(t,e?c:o),st(r)||so(t,l,g,s)})};return C(t,{onBeforeEnter(e){se(_,[e]),sl(e,i),sl(e,s)},onBeforeAppear(e){se(E,[e]),sl(e,a),sl(e,u)},onEnter:R(!1),onAppear:R(!0),onLeave(e,t){e._isLeaving=!0;let n=()=>A(e,t);sl(e,f),e._enterCancelled?(sl(e,p),sf()):(sf(),sl(e,p)),si(()=>{e._isLeaving&&(sr(e,f),sl(e,d),st(S)||so(e,l,m,n))}),se(S,[e,n])},onEnterCancelled(e){T(e,!1,void 0,!0),se(b,[e])},onAppearCancelled(e){T(e,!0,void 0,!0),se(k,[e])},onLeaveCancelled(e){A(e),se(x,[e])}})}function sl(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.add(t)),(e[i3]||(e[i3]=new Set)).add(t)}function sr(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.remove(t));let n=e[i3];n&&(n.delete(t),n.size||(e[i3]=void 0))}function si(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let ss=0;function so(e,t,n,l){let r=e._endId=++ss,i=()=>{r===e._endId&&l()};if(null!=n)return setTimeout(i,n);let{type:s,timeout:o,propCount:a}=sa(e,t);if(!s)return l();let u=s+"end",c=0,f=()=>{e.removeEventListener(u,p),i()},p=t=>{t.target===e&&++c>=a&&f()};setTimeout(()=>{c(n[e]||"").split(", "),r=l(`${i4}Delay`),i=l(`${i4}Duration`),s=su(r,i),o=l(`${i8}Delay`),a=l(`${i8}Duration`),u=su(o,a),c=null,f=0,p=0;t===i4?s>0&&(c=i4,f=s,p=i.length):t===i8?u>0&&(c=i8,f=u,p=a.length):p=(c=(f=Math.max(s,u))>0?s>u?i4:i8:null)?c===i4?i.length:a.length:0;let d=c===i4&&/\b(transform|all)(,|$)/.test(l(`${i4}Property`).toString());return{type:c,timeout:f,propCount:p,hasTransform:d}}function su(e,t){for(;e.lengthsc(t)+sc(e[n])))}function sc(e){return"auto"===e?0:1e3*Number(e.slice(0,-1).replace(",","."))}function sf(){return document.body.offsetHeight}let sp=Symbol("_vod"),sd=Symbol("_vsh"),sh={beforeMount(e,{value:t},{transition:n}){e[sp]="none"===e.style.display?"":e.style.display,n&&t?n.beforeEnter(e):sg(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:l}){!t!=!n&&(l?t?(l.beforeEnter(e),sg(e,!0),l.enter(e)):l.leave(e,()=>{sg(e,!1)}):sg(e,t))},beforeUnmount(e,{value:t}){sg(e,t)}};function sg(e,t){e.style.display=t?e[sp]:"none",e[sd]=!t}let sv=Symbol("");function sm(e){let t=ik();if(!t)return;let n=t.ut=(n=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(e=>s_(e,n))},l=()=>{let l=e(t.proxy);t.ce?s_(t.ce,l):function e(t,n){if(128&t.shapeFlag){let l=t.suspense;t=l.activeBranch,l.pendingBranch&&!l.isHydrating&&l.effects.push(()=>{e(l.activeBranch,n)})}for(;t.component;)t=t.component.subTree;if(1&t.shapeFlag&&t.el)s_(t.el,n);else if(t.type===r0)t.children.forEach(t=>e(t,n));else if(t.type===r6){let{el:e,anchor:l}=t;for(;e&&(s_(e,n),e!==l);)e=e.nextSibling}}(t.subTree,l),n(l)};lp(()=>{nt(l)}),lf(()=>{rM(l,_,{flush:"post"});let e=new MutationObserver(l);e.observe(t.subTree.el.parentNode,{childList:!0}),lg(()=>e.disconnect())})}function s_(e,t){if(1===e.nodeType){let n=e.style,l="";for(let e in t)n.setProperty(`--${e}`,t[e]),l+=`--${e}: ${t[e]};`;n[sv]=l}}let sy=/(^|;)\s*display\s*:/,sb=/\s*!important$/;function sS(e,t,n){if(k(n))n.forEach(n=>sS(e,t,n));else if(null==n&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{let l=function(e,t){let n=sx[t];if(n)return n;let l=W(t);if("filter"!==l&&l in e)return sx[t]=l;l=q(l);for(let n=0;nsN||(sO.then(()=>sN=0),sN=Date.now()),sM=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)>96&&123>e.charCodeAt(2),sI={};function sL(e,t,n){let l=nj(e,t);U(l)&&C(l,t);class r extends sV{constructor(e){super(l,e,n)}}return r.def=l,r}let sD=(e,t)=>sL(e,t,op),sF="undefined"!=typeof HTMLElement?HTMLElement:class{};class sV extends sF{constructor(e,t={},n=of){super(),this._def=e,this._props=t,this._createApp=n,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._ob=null,this.shadowRoot&&n!==of?this._root=this.shadowRoot:!1!==e.shadowRoot?(this.attachShadow({mode:"open"}),this._root=this.shadowRoot):this._root=this,this._def.__asyncLoader||this._resolveProps(this._def)}connectedCallback(){if(!this.isConnected)return;this.shadowRoot||this._parseSlots(),this._connected=!0;let e=this;for(;e=e&&(e.parentNode||e.host);)if(e instanceof sV){this._parent=e;break}this._instance||(this._resolved?(this._setParent(),this._update()):e&&e._pendingResolve?this._pendingResolve=e._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(e=this._parent){e&&(this._instance.parent=e._instance,this._instance.provides=e._instance.provides)}disconnectedCallback(){this._connected=!1,t9(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null)})}_resolveDef(){if(this._pendingResolve)return;for(let e=0;e{for(let t of e)this._setAttr(t.attributeName)}),this._ob.observe(this,{attributes:!0});let e=(e,t=!1)=>{let n;this._resolved=!0,this._pendingResolve=void 0;let{props:l,styles:r}=e;if(l&&!k(l))for(let e in l){let t=l[e];(t===Number||t&&t.type===Number)&&(e in this._props&&(this._props[e]=Q(this._props[e])),(n||(n=Object.create(null)))[W(e)]=!0)}this._numberProps=n,t&&this._resolveProps(e),this.shadowRoot&&this._applyStyles(r),this._mount(e)},t=this._def.__asyncLoader;t?this._pendingResolve=t().then(t=>e(this._def=t,!0)):e(this._def)}_mount(e){this._app=this._createApp(e),e.configureApp&&e.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);let t=this._instance&&this._instance.exposed;if(t)for(let e in t)w(this,e)||Object.defineProperty(this,e,{get:()=>tO(t[e])})}_resolveProps(e){let{props:t}=e,n=k(t)?t:Object.keys(t||{});for(let e of Object.keys(this))"_"!==e[0]&&n.includes(e)&&this._setProp(e,this[e]);for(let e of n.map(W))Object.defineProperty(this,e,{get(){return this._getProp(e)},set(t){this._setProp(e,t,!0,!0)}})}_setAttr(e){if(e.startsWith("data-v-"))return;let t=this.hasAttribute(e),n=t?this.getAttribute(e):sI,l=W(e);t&&this._numberProps&&this._numberProps[l]&&(n=Q(n)),this._setProp(l,n,!1,!0)}_getProp(e){return this._props[e]}_setProp(e,t,n=!0,l=!1){if(t!==this._props[e]&&(t===sI?delete this._props[e]:(this._props[e]=t,"key"===e&&this._app&&(this._app._ceVNode.key=t)),l&&this._instance&&this._update(),n)){let n=this._ob;n&&n.disconnect(),!0===t?this.setAttribute(z(e),""):"string"==typeof t||"number"==typeof t?this.setAttribute(z(e),t+""):t||this.removeAttribute(z(e)),n&&n.observe(this,{attributes:!0})}}_update(){ou(this._createVNode(),this._root)}_createVNode(){let e={};this.shadowRoot||(e.onVnodeMounted=e.onVnodeUpdated=this._renderSlots.bind(this));let t=ic(this._def,C(e,this._props));return this._instance||(t.ce=e=>{this._instance=e,e.ce=this,e.isCE=!0;let t=(e,t)=>{this.dispatchEvent(new CustomEvent(e,U(t[0])?C({detail:t},t[0]):{detail:t}))};e.emit=(e,...n)=>{t(e,n),z(e)!==e&&t(z(e),n)},this._setParent()}),t}_applyStyles(e,t){if(!e)return;if(t){if(t===this._def||this._styleChildren.has(t))return;this._styleChildren.add(t)}let n=this._nonce;for(let t=e.length-1;t>=0;t--){let l=document.createElement("style");n&&l.setAttribute("nonce",n),l.textContent=e[t],this.shadowRoot.prepend(l)}}_parseSlots(){let e;let t=this._slots={};for(;e=this.firstChild;){let n=1===e.nodeType&&e.getAttribute("slot")||"default";(t[n]||(t[n]=[])).push(e),this.removeChild(e)}}_renderSlots(){let e=(this._teleportTarget||this).querySelectorAll("slot"),t=this._instance.type.__scopeId;for(let n=0;n{if(!n.length)return;let t=e.moveClass||`${e.name||"v"}-move`;if(!function(e,t,n){let l=e.cloneNode(),r=e[i3];r&&r.forEach(e=>{e.split(/\s+/).forEach(e=>e&&l.classList.remove(e))}),n.split(/\s+/).forEach(e=>e&&l.classList.add(e)),l.style.display="none";let i=1===t.nodeType?t:t.parentNode;i.appendChild(l);let{hasTransform:s}=sa(l);return i.removeChild(l),s}(n[0].el,r.vnode.el,t))return;n.forEach(sq),n.forEach(sG);let l=n.filter(sJ);sf(),l.forEach(e=>{let n=e.el,l=n.style;sl(n,t),l.transform=l.webkitTransform=l.transitionDuration="";let r=n[sW]=e=>{(!e||e.target===n)&&(!e||/transform$/.test(e.propertyName))&&(n.removeEventListener("transitionend",r),n[sW]=null,sr(n,t))};n.addEventListener("transitionend",r)})}),()=>{let s=tS(e),o=sn(s),a=s.tag||r0;if(n=[],l)for(let e=0;e{let t=e.props["onUpdate:modelValue"]||!1;return k(t)?e=>X(t,e):t};function sZ(e){e.target.composing=!0}function sY(e){let t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}let sQ=Symbol("_assign"),s0={created(e,{modifiers:{lazy:t,trim:n,number:l}},r){e[sQ]=sX(r);let i=l||r.props&&"number"===r.props.type;sT(e,t?"change":"input",t=>{if(t.target.composing)return;let l=e.value;n&&(l=l.trim()),i&&(l=Y(l)),e[sQ](l)}),n&&sT(e,"change",()=>{e.value=e.value.trim()}),t||(sT(e,"compositionstart",sZ),sT(e,"compositionend",sY),sT(e,"change",sY))},mounted(e,{value:t}){e.value=null==t?"":t},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:l,trim:r,number:i}},s){if(e[sQ]=sX(s),e.composing)return;let o=(i||"number"===e.type)&&!/^0\d/.test(e.value)?Y(e.value):e.value,a=null==t?"":t;o===a||document.activeElement===e&&"range"!==e.type&&(l&&t===n||r&&e.value.trim()===a)||(e.value=a)}},s1={deep:!0,created(e,t,n){e[sQ]=sX(n),sT(e,"change",()=>{let t=e._modelValue,n=s3(e),l=e.checked,r=e[sQ];if(k(t)){let e=ec(t,n),i=-1!==e;if(l&&!i)r(t.concat(n));else if(!l&&i){let n=[...t];n.splice(e,1),r(n)}}else if(A(t)){let e=new Set(t);l?e.add(n):e.delete(n),r(e)}else r(s5(e,l))})},mounted:s2,beforeUpdate(e,t,n){e[sQ]=sX(n),s2(e,t,n)}};function s2(e,{value:t,oldValue:n},l){let r;if(e._modelValue=t,k(t))r=ec(t,l.props.value)>-1;else if(A(t))r=t.has(l.props.value);else{if(t===n)return;r=eu(t,s5(e,!0))}e.checked!==r&&(e.checked=r)}let s6={created(e,{value:t},n){e.checked=eu(t,n.props.value),e[sQ]=sX(n),sT(e,"change",()=>{e[sQ](s3(e))})},beforeUpdate(e,{value:t,oldValue:n},l){e[sQ]=sX(l),t!==n&&(e.checked=eu(t,l.props.value))}},s4={deep:!0,created(e,{value:t,modifiers:{number:n}},l){let r=A(t);sT(e,"change",()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?Y(s3(e)):s3(e));e[sQ](e.multiple?r?new Set(t):t:t[0]),e._assigning=!0,t9(()=>{e._assigning=!1})}),e[sQ]=sX(l)},mounted(e,{value:t}){s8(e,t)},beforeUpdate(e,t,n){e[sQ]=sX(n)},updated(e,{value:t}){e._assigning||s8(e,t)}};function s8(e,t){let n=e.multiple,l=k(t);if(!n||l||A(t)){for(let r=0,i=e.options.length;rString(e)===String(s)):i.selected=ec(t,s)>-1}else i.selected=t.has(s)}else if(eu(s3(i),t)){e.selectedIndex!==r&&(e.selectedIndex=r);return}}n||-1===e.selectedIndex||(e.selectedIndex=-1)}}function s3(e){return"_value"in e?e._value:e.value}function s5(e,t){let n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}let s9={created(e,t,n){oe(e,t,n,null,"created")},mounted(e,t,n){oe(e,t,n,null,"mounted")},beforeUpdate(e,t,n,l){oe(e,t,n,l,"beforeUpdate")},updated(e,t,n,l){oe(e,t,n,l,"updated")}};function s7(e,t){switch(e){case"SELECT":return s4;case"TEXTAREA":return s0;default:switch(t){case"checkbox":return s1;case"radio":return s6;default:return s0}}}function oe(e,t,n,l,r){let i=s7(e.tagName,n.props&&n.props.type)[r];i&&i(e,t,n,l)}let ot=["ctrl","shift","alt","meta"],on={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&0!==e.button,middle:e=>"button"in e&&1!==e.button,right:e=>"button"in e&&2!==e.button,exact:(e,t)=>ot.some(n=>e[`${n}Key`]&&!t.includes(n))},ol=(e,t)=>{let n=e._withMods||(e._withMods={}),l=t.join(".");return n[l]||(n[l]=(n,...l)=>{for(let e=0;e{let n=e._withKeys||(e._withKeys={}),l=t.join(".");return n[l]||(n[l]=n=>{if(!("key"in n))return;let l=z(n.key);if(t.some(e=>e===l||or[e]===l))return e(n)})},os=C({patchProp:(e,t,n,l,r,i)=>{let s="svg"===r;"class"===t?function(e,t,n){let l=e[i3];l&&(t=(t?[t,...l]:[...l]).join(" ")),null==t?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}(e,l,s):"style"===t?function(e,t,n){let l=e.style,r=P(n),i=!1;if(n&&!r){if(t){if(P(t))for(let e of t.split(";")){let t=e.slice(0,e.indexOf(":")).trim();null==n[t]&&sS(l,t,"")}else for(let e in t)null==n[e]&&sS(l,e,"")}for(let e in n)"display"===e&&(i=!0),sS(l,e,n[e])}else if(r){if(t!==n){let e=l[sv];e&&(n+=";"+e),l.cssText=n,i=sy.test(n)}}else t&&e.removeAttribute("style");sp in e&&(e[sp]=i?l.display:"",e[sd]&&(l.display="none"))}(e,n,l):b(t)?S(t)||function(e,t,n,l,r=null){let i=e[sA]||(e[sA]={}),s=i[t];if(l&&s)s.value=l;else{let[n,o]=function(e){let t;if(sR.test(e)){let n;for(t={};n=e.match(sR);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[":"===e[2]?e.slice(3):z(e.slice(2)),t]}(t);l?sT(e,n,i[t]=function(e,t){let n=e=>{if(e._vts){if(e._vts<=n.attached)return}else e._vts=Date.now();tQ(function(e,t){if(!k(t))return t;{let n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(e=>t=>!t._stopped&&e&&e(t))}}(e,n.value),t,5,[e])};return n.value=e,n.attached=sP(),n}(l,r),o):s&&(!function(e,t,n,l){e.removeEventListener(t,n,l)}(e,n,s,o),i[t]=void 0)}}(e,t,0,l,i):("."===t[0]?(t=t.slice(1),0):"^"===t[0]?(t=t.slice(1),1):!function(e,t,n,l){if(l)return!!("innerHTML"===t||"textContent"===t||t in e&&sM(t)&&O(n));if("spellcheck"===t||"draggable"===t||"translate"===t||"form"===t||"list"===t&&"INPUT"===e.tagName||"type"===t&&"TEXTAREA"===e.tagName)return!1;if("width"===t||"height"===t){let t=e.tagName;if("IMG"===t||"VIDEO"===t||"CANVAS"===t||"SOURCE"===t)return!1}return!(sM(t)&&P(n))&&t in e}(e,t,l,s))?e._isVueCE&&(/[A-Z]/.test(t)||!P(l))?sk(e,W(t),l,i,t):("true-value"===t?e._trueValue=l:"false-value"===t&&(e._falseValue=l),sw(e,t,l,s)):(sk(e,t,l),e.tagName.includes("-")||"value"!==t&&"checked"!==t&&"selected"!==t||sw(e,t,l,s,i,"value"!==t))}},{insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,l)=>{let r="svg"===t?i2.createElementNS("http://www.w3.org/2000/svg",e):"mathml"===t?i2.createElementNS("http://www.w3.org/1998/Math/MathML",e):n?i2.createElement(e,{is:n}):i2.createElement(e);return"select"===e&&l&&null!=l.multiple&&r.setAttribute("multiple",l.multiple),r},createText:e=>i2.createTextNode(e),createComment:e=>i2.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>i2.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,l,r,i){let s=n?n.previousSibling:t.lastChild;if(r&&(r===i||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),r!==i&&(r=r.nextSibling););else{i6.innerHTML=i1("svg"===l?`${e}`:"mathml"===l?`${e}`:e);let r=i6.content;if("svg"===l||"mathml"===l){let e=r.firstChild;for(;e.firstChild;)r.appendChild(e.firstChild);r.removeChild(e)}t.insertBefore(r,n)}return[s?s.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}}),oo=!1;function oa(){return f=oo?f:rS(os),oo=!0,f}let ou=(...e)=>{(f||(f=rb(os))).render(...e)},oc=(...e)=>{oa().hydrate(...e)},of=(...e)=>{let t=(f||(f=rb(os))).createApp(...e),{mount:n}=t;return t.mount=e=>{let l=oh(e);if(!l)return;let r=t._component;O(r)||r.render||r.template||(r.template=l.innerHTML),1===l.nodeType&&(l.textContent="");let i=n(l,!1,od(l));return l instanceof Element&&(l.removeAttribute("v-cloak"),l.setAttribute("data-v-app","")),i},t},op=(...e)=>{let t=oa().createApp(...e),{mount:n}=t;return t.mount=e=>{let t=oh(e);if(t)return n(t,!0,od(t))},t};function od(e){return e instanceof SVGElement?"svg":"function"==typeof MathMLElement&&e instanceof MathMLElement?"mathml":void 0}function oh(e){return P(e)?document.querySelector(e):e}let og=!1,ov=()=>{og||(og=!0,s0.getSSRProps=({value:e})=>({value:e}),s6.getSSRProps=({value:e},t)=>{if(t.props&&eu(t.props.value,e))return{checked:!0}},s1.getSSRProps=({value:e},t)=>{if(k(e)){if(t.props&&ec(e,t.props.value)>-1)return{checked:!0}}else if(A(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},s9.getSSRProps=(e,t)=>{if("string"!=typeof t.type)return;let n=s7(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)},sh.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}})},om=()=>{};export{nM as BaseTransition,nN as BaseTransitionPropsValidators,r2 as Comment,iQ as DeprecationTypes,eg as EffectScope,tZ as ErrorCodes,iq as ErrorTypeStrings,r0 as Fragment,lt as KeepAlive,eb as ReactiveEffect,r6 as Static,rG as Suspense,nx as Teleport,r1 as Text,tH as TrackOpTypes,i7 as Transition,sz as TransitionGroup,tW as TriggerOpTypes,sV as VueElement,tX as assertNumber,tQ as callWithAsyncErrorHandling,tY as callWithErrorHandling,W as camelize,q as capitalize,id as cloneVNode,iY as compatUtils,om as compile,ij as computed,of as createApp,il as createBlock,iv as createCommentVNode,it as createElementBlock,iu as createElementVNode,rS as createHydrationRenderer,lX as createPropsRestProxy,rb as createRenderer,op as createSSRApp,lA as createSlots,ig as createStaticVNode,ih as createTextVNode,ic as createVNode,tD as customRef,n9 as defineAsyncComponent,nj as defineComponent,sL as defineCustomElement,lV as defineEmits,lU as defineExpose,l$ as defineModel,lj as defineOptions,lF as defineProps,sD as defineSSRCustomElement,lB as defineSlots,iG as devtools,eR as effect,ev as effectScope,ik as getCurrentInstance,em as getCurrentScope,tq as getCurrentWatcher,nU as getTransitionRawChildren,ip as guardReactiveProps,iB as h,t0 as handleError,rl as hasInjectionContext,oc as hydrate,n6 as hydrateOnIdle,n3 as hydrateOnInteraction,n8 as hydrateOnMediaQuery,n4 as hydrateOnVisible,i$ as initCustomFormatter,ov as initDirectivesForSSR,rn as inject,iW as isMemoSame,tb as isProxy,tm as isReactive,t_ as isReadonly,tw as isRef,iI as isRuntimeOnly,ty as isShallow,ir as isVNode,tC as markRaw,lG as mergeDefaults,lJ as mergeModels,ib as mergeProps,t9 as nextTick,es as normalizeClass,eo as normalizeProps,en as normalizeStyle,ll as onActivated,lc as onBeforeMount,lh as onBeforeUnmount,lp as onBeforeUpdate,lr as onDeactivated,ly as onErrorCaptured,lf as onMounted,l_ as onRenderTracked,lm as onRenderTriggered,e_ as onScopeDispose,lv as onServerPrefetch,lg as onUnmounted,ld as onUpdated,tG as onWatcherCleanup,r3 as openBlock,nu as popScopeId,rt as provide,tI as proxyRefs,na as pushScopeId,nt as queuePostFlushCb,tp as reactive,th as readonly,tk as ref,iM as registerRuntimeCompiler,ou as render,lT as renderList,lR as renderSlot,lS as resolveComponent,lE as resolveDirective,lx as resolveDynamicComponent,iZ as resolveFilter,nL as resolveTransitionHooks,r7 as setBlockTracking,iJ as setDevtoolsHook,nV as setTransitionHooks,td as shallowReactive,tg as shallowReadonly,tT as shallowRef,rA as ssrContextKey,iX as ssrUtils,eN as stop,ep as toDisplayString,G as toHandlerKey,lO as toHandlers,tS as toRaw,tj as toRef,tF as toRefs,tP as toValue,is as transformVNodeArgs,tN as triggerRef,tO as unref,lK as useAttrs,sB as useCssModule,sm as useCssVars,sU as useHost,nB as useId,rF as useModel,rR as useSSRContext,sj as useShadowRoot,lW as useSlots,nH as useTemplateRef,nA as useTransitionState,s1 as vModelCheckbox,s9 as vModelDynamic,s6 as vModelRadio,s4 as vModelSelect,s0 as vModelText,sh as vShow,iK as version,iz as warn,rM as watch,rN as watchEffect,rO as watchPostEffect,rP as watchSyncEffect,lZ as withAsyncContext,nf as withCtx,lH as withDefaults,np as withDirectives,oi as withKeys,iH as withMemo,ol as withModifiers,nc as withScopeId}; +**/var e,t;let n,l,r,i,s,o,a,u,c,f,p,d;function h(e){let t=Object.create(null);for(let n of e.split(","))t[n]=1;return e=>e in t}let g={},m=[],_=()=>{},y=()=>!1,b=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&(e.charCodeAt(2)>122||97>e.charCodeAt(2)),S=e=>e.startsWith("onUpdate:"),C=Object.assign,x=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},E=Object.prototype.hasOwnProperty,w=(e,t)=>E.call(e,t),k=Array.isArray,T=e=>"[object Map]"===D(e),A=e=>"[object Set]"===D(e),R=e=>"[object Date]"===D(e),O=e=>"function"==typeof e,N=e=>"string"==typeof e,P=e=>"symbol"==typeof e,M=e=>null!==e&&"object"==typeof e,I=e=>(M(e)||O(e))&&O(e.then)&&O(e.catch),L=Object.prototype.toString,D=e=>L.call(e),F=e=>"[object Object]"===D(e),V=e=>N(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,U=h(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),j=e=>{let t=Object.create(null);return n=>t[n]||(t[n]=e(n))},B=/-(\w)/g,$=j(e=>e.replace(B,(e,t)=>t?t.toUpperCase():"")),H=/\B([A-Z])/g,W=j(e=>e.replace(H,"-$1").toLowerCase()),K=j(e=>e.charAt(0).toUpperCase()+e.slice(1)),z=j(e=>e?`on${K(e)}`:""),q=(e,t)=>!Object.is(e,t),G=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:l,value:n})},X=e=>{let t=parseFloat(e);return isNaN(t)?e:t},Z=e=>{let t=N(e)?Number(e):NaN;return isNaN(t)?e:t},Y=()=>n||(n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{}),Q=h("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol");function ee(e){if(k(e)){let t={};for(let n=0;n{if(e){let n=e.split(en);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}(l):ee(l);if(r)for(let e in r)t[e]=r[e]}return t}if(N(e)||M(e))return e}let et=/;(?![^(]*\))/g,en=/:([^]+)/,el=/\/\*[^]*?\*\//g;function er(e){let t="";if(N(e))t=e;else if(k(e))for(let n=0;neo(e,t))}let eu=e=>!!(e&&!0===e.__v_isRef),ec=e=>N(e)?e:null==e?"":k(e)||M(e)&&(e.toString===L||!O(e.toString))?eu(e)?ec(e.value):JSON.stringify(e,ef,2):String(e),ef=(e,t)=>{if(eu(t))return ef(e,t.value);if(T(t))return{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],l)=>(e[ep(t,l)+" =>"]=n,e),{})};if(A(t))return{[`Set(${t.size})`]:[...t.values()].map(e=>ep(e))};if(P(t))return ep(t);if(M(t)&&!k(t)&&!F(t))return String(t);return t},ep=(e,t="")=>{var n;return P(e)?`Symbol(${null!=(n=e.description)?n:t})`:e};class ed{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=l,!e&&l&&(this.index=(l.scopes||(l.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){let e,t;if(this._isPaused=!0,this.scopes)for(e=0,t=this.scopes.length;e0&&0==--this._on&&(l=this.prevScope,this.prevScope=void 0)}stop(e){if(this._active){let t,n;for(t=0,this._active=!1,n=this.effects.length;t0)){if(s){let e=s;for(s=void 0;e;){let t=e.next;e.next=void 0,e.flags&=-9,e=t}}for(;i;){let t=i;for(i=void 0;t;){let n=t.next;if(t.next=void 0,t.flags&=-9,1&t.flags)try{t.trigger()}catch(t){e||(e=t)}t=n}}if(e)throw e}}function eC(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function ex(e){let t,n=e.depsTail,l=n;for(;l;){let e=l.prevDep;-1===l.version?(l===n&&(n=e),ek(l),function(e){let{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}(l)):t=l,l.dep.activeLink=l.prevActiveLink,l.prevActiveLink=void 0,l=e}e.deps=t,e.depsTail=n}function eE(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(ew(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function ew(e){if(4&e.flags&&!(16&e.flags)||(e.flags&=-17,e.globalVersion===eI)||(e.globalVersion=eI,!e.isSSR&&128&e.flags&&(!e.deps&&!e._dirty||!eE(e))))return;e.flags|=2;let t=e.dep,n=r,l=eR;r=e,eR=!0;try{eC(e);let n=e.fn(e._value);(0===t.version||q(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(e){throw t.version++,e}finally{r=n,eR=l,ex(e),e.flags&=-3}}function ek(e,t=!1){let{dep:n,prevSub:l,nextSub:r}=e;if(l&&(l.nextSub=r,e.prevSub=void 0),r&&(r.prevSub=l,e.nextSub=void 0),n.subs===e&&(n.subs=l,!l&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)ek(e,!0)}t||--n.sc||!n.map||n.map.delete(n.key)}function eT(e,t){e.effect instanceof e_&&(e=e.effect.fn);let n=new e_(e);t&&C(n,t);try{n.run()}catch(e){throw n.stop(),e}let l=n.run.bind(n);return l.effect=n,l}function eA(e){e.effect.stop()}let eR=!0,eO=[];function eN(){eO.push(eR),eR=!1}function eP(){let e=eO.pop();eR=void 0===e||e}function eM(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let e=r;r=void 0;try{t()}finally{r=e}}}let eI=0;class eL{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class eD{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!r||!eR||r===this.computed)return;let t=this.activeLink;if(void 0===t||t.sub!==r)t=this.activeLink=new eL(r,this),r.deps?(t.prevDep=r.depsTail,r.depsTail.nextDep=t,r.depsTail=t):r.deps=r.depsTail=t,function e(t){if(t.dep.sc++,4&t.sub.flags){let n=t.dep.computed;if(n&&!t.dep.subs){n.flags|=20;for(let t=n.deps;t;t=t.nextDep)e(t)}let l=t.dep.subs;l!==t&&(t.prevSub=l,l&&(l.nextSub=t)),t.dep.subs=t}}(t);else if(-1===t.version&&(t.version=this.version,t.nextDep)){let e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=r.depsTail,t.nextDep=void 0,r.depsTail.nextDep=t,r.depsTail=t,r.deps===t&&(r.deps=e)}return t}trigger(e){this.version++,eI++,this.notify(e)}notify(e){ey++;try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{eS()}}}let eF=new WeakMap,eV=Symbol(""),eU=Symbol(""),ej=Symbol("");function eB(e,t,n){if(eR&&r){let t=eF.get(e);t||eF.set(e,t=new Map);let l=t.get(n);l||(t.set(n,l=new eD),l.map=t,l.key=n),l.track()}}function e$(e,t,n,l,r,i){let s=eF.get(e);if(!s)return void eI++;let o=e=>{e&&e.trigger()};if(ey++,"clear"===t)s.forEach(o);else{let r=k(e),i=r&&V(n);if(r&&"length"===n){let e=Number(l);s.forEach((t,n)=>{("length"===n||n===ej||!P(n)&&n>=e)&&o(t)})}else switch((void 0!==n||s.has(void 0))&&o(s.get(n)),i&&o(s.get(ej)),t){case"add":r?i&&o(s.get("length")):(o(s.get(eV)),T(e)&&o(s.get(eU)));break;case"delete":!r&&(o(s.get(eV)),T(e)&&o(s.get(eU)));break;case"set":T(e)&&o(s.get(eV))}}eS()}function eH(e){let t=ty(e);return t===e?t:(eB(t,"iterate",ej),tm(e)?t:t.map(tS))}function eW(e){return eB(e=ty(e),"iterate",ej),e}let eK={__proto__:null,[Symbol.iterator](){return ez(this,Symbol.iterator,tS)},concat(...e){return eH(this).concat(...e.map(e=>k(e)?eH(e):e))},entries(){return ez(this,"entries",e=>(e[1]=tS(e[1]),e))},every(e,t){return eG(this,"every",e,t,void 0,arguments)},filter(e,t){return eG(this,"filter",e,t,e=>e.map(tS),arguments)},find(e,t){return eG(this,"find",e,t,tS,arguments)},findIndex(e,t){return eG(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return eG(this,"findLast",e,t,tS,arguments)},findLastIndex(e,t){return eG(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return eG(this,"forEach",e,t,void 0,arguments)},includes(...e){return eX(this,"includes",e)},indexOf(...e){return eX(this,"indexOf",e)},join(e){return eH(this).join(e)},lastIndexOf(...e){return eX(this,"lastIndexOf",e)},map(e,t){return eG(this,"map",e,t,void 0,arguments)},pop(){return eZ(this,"pop")},push(...e){return eZ(this,"push",e)},reduce(e,...t){return eJ(this,"reduce",e,t)},reduceRight(e,...t){return eJ(this,"reduceRight",e,t)},shift(){return eZ(this,"shift")},some(e,t){return eG(this,"some",e,t,void 0,arguments)},splice(...e){return eZ(this,"splice",e)},toReversed(){return eH(this).toReversed()},toSorted(e){return eH(this).toSorted(e)},toSpliced(...e){return eH(this).toSpliced(...e)},unshift(...e){return eZ(this,"unshift",e)},values(){return ez(this,"values",tS)}};function ez(e,t,n){let l=eW(e),r=l[t]();return l===e||tm(e)||(r._next=r.next,r.next=()=>{let e=r._next();return e.value&&(e.value=n(e.value)),e}),r}let eq=Array.prototype;function eG(e,t,n,l,r,i){let s=eW(e),o=s!==e&&!tm(e),a=s[t];if(a!==eq[t]){let t=a.apply(e,i);return o?tS(t):t}let u=n;s!==e&&(o?u=function(t,l){return n.call(this,tS(t),l,e)}:n.length>2&&(u=function(t,l){return n.call(this,t,l,e)}));let c=a.call(s,u,l);return o&&r?r(c):c}function eJ(e,t,n,l){let r=eW(e),i=n;return r!==e&&(tm(e)?n.length>3&&(i=function(t,l,r){return n.call(this,t,l,r,e)}):i=function(t,l,r){return n.call(this,t,tS(l),r,e)}),r[t](i,...l)}function eX(e,t,n){let l=ty(e);eB(l,"iterate",ej);let r=l[t](...n);return(-1===r||!1===r)&&t_(n[0])?(n[0]=ty(n[0]),l[t](...n)):r}function eZ(e,t,n=[]){eN(),ey++;let l=ty(e)[t].apply(e,n);return eS(),eP(),l}let eY=h("__proto__,__v_isRef,__isVue"),eQ=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>"arguments"!==e&&"caller"!==e).map(e=>Symbol[e]).filter(P));function e0(e){P(e)||(e=String(e));let t=ty(this);return eB(t,"has",e),t.hasOwnProperty(e)}class e1{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if("__v_skip"===t)return e.__v_skip;let l=this._isReadonly,r=this._isShallow;if("__v_isReactive"===t)return!l;if("__v_isReadonly"===t)return l;if("__v_isShallow"===t)return r;if("__v_raw"===t)return n===(l?r?tu:ta:r?to:ts).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;let i=k(e);if(!l){let e;if(i&&(e=eK[t]))return e;if("hasOwnProperty"===t)return e0}let s=Reflect.get(e,t,tx(e)?e:n);return(P(t)?eQ.has(t):eY(t))||(l||eB(e,"get",t),r)?s:tx(s)?i&&V(t)?s:s.value:M(s)?l?tp(s):tc(s):s}}class e2 extends e1{constructor(e=!1){super(!1,e)}set(e,t,n,l){let r=e[t];if(!this._isShallow){let t=tv(r);if(tm(n)||tv(n)||(r=ty(r),n=ty(n)),!k(e)&&tx(r)&&!tx(n))if(t)return!1;else return r.value=n,!0}let i=k(e)&&V(t)?Number(t)e,e7=e=>Reflect.getPrototypeOf(e);function te(e){return function(...t){return"delete"!==e&&("clear"===e?void 0:this)}}function tt(e,t){let n=function(e,t){let n={get(n){let l=this.__v_raw,r=ty(l),i=ty(n);e||(q(n,i)&&eB(r,"get",n),eB(r,"get",i));let{has:s}=e7(r),o=t?e9:e?tC:tS;return s.call(r,n)?o(l.get(n)):s.call(r,i)?o(l.get(i)):void(l!==r&&l.get(n))},get size(){let t=this.__v_raw;return e||eB(ty(t),"iterate",eV),Reflect.get(t,"size",t)},has(t){let n=this.__v_raw,l=ty(n),r=ty(t);return e||(q(t,r)&&eB(l,"has",t),eB(l,"has",r)),t===r?n.has(t):n.has(t)||n.has(r)},forEach(n,l){let r=this,i=r.__v_raw,s=ty(i),o=t?e9:e?tC:tS;return e||eB(s,"iterate",eV),i.forEach((e,t)=>n.call(l,o(e),o(t),r))}};return C(n,e?{add:te("add"),set:te("set"),delete:te("delete"),clear:te("clear")}:{add(e){t||tm(e)||tv(e)||(e=ty(e));let n=ty(this);return e7(n).has.call(n,e)||(n.add(e),e$(n,"add",e,e)),this},set(e,n){t||tm(n)||tv(n)||(n=ty(n));let l=ty(this),{has:r,get:i}=e7(l),s=r.call(l,e);s||(e=ty(e),s=r.call(l,e));let o=i.call(l,e);return l.set(e,n),s?q(n,o)&&e$(l,"set",e,n):e$(l,"add",e,n),this},delete(e){let t=ty(this),{has:n,get:l}=e7(t),r=n.call(t,e);r||(e=ty(e),r=n.call(t,e)),l&&l.call(t,e);let i=t.delete(e);return r&&e$(t,"delete",e,void 0),i},clear(){let e=ty(this),t=0!==e.size,n=e.clear();return t&&e$(e,"clear",void 0,void 0),n}}),["keys","values","entries",Symbol.iterator].forEach(l=>{n[l]=function(...n){let r=this.__v_raw,i=ty(r),s=T(i),o="entries"===l||l===Symbol.iterator&&s,a=r[l](...n),u=t?e9:e?tC:tS;return e||eB(i,"iterate","keys"===l&&s?eU:eV),{next(){let{value:e,done:t}=a.next();return t?{value:e,done:t}:{value:o?[u(e[0]),u(e[1])]:u(e),done:t}},[Symbol.iterator](){return this}}}}),n}(e,t);return(t,l,r)=>"__v_isReactive"===l?!e:"__v_isReadonly"===l?e:"__v_raw"===l?t:Reflect.get(w(n,l)&&l in t?n:t,l,r)}let tn={get:tt(!1,!1)},tl={get:tt(!1,!0)},tr={get:tt(!0,!1)},ti={get:tt(!0,!0)},ts=new WeakMap,to=new WeakMap,ta=new WeakMap,tu=new WeakMap;function tc(e){return tv(e)?e:th(e,!1,e8,tn,ts)}function tf(e){return th(e,!1,e3,tl,to)}function tp(e){return th(e,!0,e4,tr,ta)}function td(e){return th(e,!0,e5,ti,tu)}function th(e,t,n,l,r){var i;if(!M(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;let s=(i=e).__v_skip||!Object.isExtensible(i)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}(D(i).slice(8,-1));if(0===s)return e;let o=r.get(e);if(o)return o;let a=new Proxy(e,2===s?l:n);return r.set(e,a),a}function tg(e){return tv(e)?tg(e.__v_raw):!!(e&&e.__v_isReactive)}function tv(e){return!!(e&&e.__v_isReadonly)}function tm(e){return!!(e&&e.__v_isShallow)}function t_(e){return!!e&&!!e.__v_raw}function ty(e){let t=e&&e.__v_raw;return t?ty(t):e}function tb(e){return!w(e,"__v_skip")&&Object.isExtensible(e)&&J(e,"__v_skip",!0),e}let tS=e=>M(e)?tc(e):e,tC=e=>M(e)?tp(e):e;function tx(e){return!!e&&!0===e.__v_isRef}function tE(e){return tk(e,!1)}function tw(e){return tk(e,!0)}function tk(e,t){return tx(e)?e:new tT(e,t)}class tT{constructor(e,t){this.dep=new eD,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:ty(e),this._value=t?e:tS(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||tm(e)||tv(e);q(e=n?e:ty(e),t)&&(this._rawValue=e,this._value=n?e:tS(e),this.dep.trigger())}}function tA(e){e.dep&&e.dep.trigger()}function tR(e){return tx(e)?e.value:e}function tO(e){return O(e)?e():tR(e)}let tN={get:(e,t,n)=>"__v_raw"===t?e:tR(Reflect.get(e,t,n)),set:(e,t,n,l)=>{let r=e[t];return tx(r)&&!tx(n)?(r.value=n,!0):Reflect.set(e,t,n,l)}};function tP(e){return tg(e)?e:new Proxy(e,tN)}class tM{constructor(e){this.__v_isRef=!0,this._value=void 0;let t=this.dep=new eD,{get:n,set:l}=e(t.track.bind(t),t.trigger.bind(t));this._get=n,this._set=l}get value(){return this._value=this._get()}set value(e){this._set(e)}}function tI(e){return new tM(e)}function tL(e){let t=k(e)?Array(e.length):{};for(let n in e)t[n]=tU(e,n);return t}class tD{constructor(e,t,n){this._object=e,this._key=t,this._defaultValue=n,this.__v_isRef=!0,this._value=void 0}get value(){let e=this._object[this._key];return this._value=void 0===e?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return function(e,t){let n=eF.get(e);return n&&n.get(t)}(ty(this._object),this._key)}}class tF{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function tV(e,t,n){return tx(e)?e:O(e)?new tF(e):M(e)&&arguments.length>1?tU(e,t,n):tE(e)}function tU(e,t,n){let l=e[t];return tx(l)?l:new tD(e,t,n)}class tj{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new eD(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=eI-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(8&this.flags)&&r!==this)return eb(this,!0),!0}get value(){let e=this.dep.track();return ew(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}let tB={GET:"get",HAS:"has",ITERATE:"iterate"},t$={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},tH={},tW=new WeakMap;function tK(){return p}function tz(e,t=!1,n=p){if(n){let t=tW.get(n);t||tW.set(n,t=[]),t.push(e)}}function tq(e,t=1/0,n){if(t<=0||!M(e)||e.__v_skip||(n=n||new Set).has(e))return e;if(n.add(e),t--,tx(e))tq(e.value,t,n);else if(k(e))for(let l=0;l{tq(e,t,n)});else if(F(e)){for(let l in e)tq(e[l],t,n);for(let l of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,l)&&tq(e[l],t,n)}return e}function tG(e,t){}let tJ={SETUP_FUNCTION:0,0:"SETUP_FUNCTION",RENDER_FUNCTION:1,1:"RENDER_FUNCTION",NATIVE_EVENT_HANDLER:5,5:"NATIVE_EVENT_HANDLER",COMPONENT_EVENT_HANDLER:6,6:"COMPONENT_EVENT_HANDLER",VNODE_HOOK:7,7:"VNODE_HOOK",DIRECTIVE_HOOK:8,8:"DIRECTIVE_HOOK",TRANSITION_HOOK:9,9:"TRANSITION_HOOK",APP_ERROR_HANDLER:10,10:"APP_ERROR_HANDLER",APP_WARN_HANDLER:11,11:"APP_WARN_HANDLER",FUNCTION_REF:12,12:"FUNCTION_REF",ASYNC_COMPONENT_LOADER:13,13:"ASYNC_COMPONENT_LOADER",SCHEDULER:14,14:"SCHEDULER",COMPONENT_UPDATE:15,15:"COMPONENT_UPDATE",APP_UNMOUNT_CLEANUP:16,16:"APP_UNMOUNT_CLEANUP"};function tX(e,t,n,l){try{return l?e(...l):e()}catch(e){tY(e,t,n)}}function tZ(e,t,n,l){if(O(e)){let r=tX(e,t,n,l);return r&&I(r)&&r.catch(e=>{tY(e,t,n)}),r}if(k(e)){let r=[];for(let i=0;i=nn(n)?tQ.push(e):tQ.splice(function(e){let t=t0+1,n=tQ.length;for(;t>>1,r=tQ[l],i=nn(r);inn(e)-nn(t));if(t1.length=0,t2)return void t2.push(...e);for(t6=0,t2=e;t6null==e.id?2&e.flags?-1:1/0:e.id,nl=null,nr=null;function ni(e){let t=nl;return nl=e,nr=e&&e.type.__scopeId||null,t}function ns(e){nr=e}function no(){nr=null}let na=e=>nu;function nu(e,t=nl,n){if(!t||e._n)return e;let l=(...n)=>{let r;l._d&&r2(-1);let i=ni(t);try{r=e(...n)}finally{ni(i),l._d&&r2(1)}return r};return l._n=!0,l._c=!0,l._d=!0,l}function nc(e,t){if(null===nl)return e;let n=iN(nl),l=e.dirs||(e.dirs=[]);for(let e=0;ee&&(e.disabled||""===e.disabled),nh=e=>e&&(e.defer||""===e.defer),ng=e=>"undefined"!=typeof SVGElement&&e instanceof SVGElement,nv=e=>"function"==typeof MathMLElement&&e instanceof MathMLElement,nm=(e,t)=>{let n=e&&e.to;return N(n)?t?t(n):null:n},n_={name:"Teleport",__isTeleport:!0,process(e,t,n,l,r,i,s,o,a,u){let{mc:c,pc:f,pbc:p,o:{insert:d,querySelector:h,createText:g,createComment:m}}=u,_=nd(t.props),{shapeFlag:y,children:b,dynamicChildren:S}=t;if(null==e){let e=t.el=g(""),u=t.anchor=g("");d(e,n,l),d(u,n,l);let f=(e,t)=>{16&y&&(r&&r.isCE&&(r.ce._teleportTarget=e),c(b,e,t,r,i,s,o,a))},p=()=>{let e=t.target=nm(t.props,h),n=nC(e,t,g,d);e&&("svg"!==s&&ng(e)?s="svg":"mathml"!==s&&nv(e)&&(s="mathml"),_||(f(e,n),nS(t,!1)))};_&&(f(n,u),nS(t,!0)),nh(t.props)?(t.el.__isMounted=!1,rp(()=>{p(),delete t.el.__isMounted},i)):p()}else{if(nh(t.props)&&!1===e.el.__isMounted)return void rp(()=>{n_.process(e,t,n,l,r,i,s,o,a,u)},i);t.el=e.el,t.targetStart=e.targetStart;let c=t.anchor=e.anchor,d=t.target=e.target,g=t.targetAnchor=e.targetAnchor,m=nd(e.props),y=m?n:d,b=m?c:g;if("svg"===s||ng(d)?s="svg":("mathml"===s||nv(d))&&(s="mathml"),S?(p(e.dynamicChildren,S,y,r,i,s,o),ry(e,t,!0)):a||f(e,t,y,b,r,i,s,o,!1),_)m?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):ny(t,n,c,u,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){let e=t.target=nm(t.props,h);e&&ny(t,e,null,u,0)}else m&&ny(t,d,g,u,1);nS(t,_)}},remove(e,t,n,{um:l,o:{remove:r}},i){let{shapeFlag:s,children:o,anchor:a,targetStart:u,targetAnchor:c,target:f,props:p}=e;if(f&&(r(u),r(c)),i&&r(a),16&s){let e=i||!nd(p);for(let r=0;r{e.isMounted=!0}),lu(()=>{e.isUnmounting=!0}),e}let nk=[Function,Array],nT={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:nk,onEnter:nk,onAfterEnter:nk,onEnterCancelled:nk,onBeforeLeave:nk,onLeave:nk,onAfterLeave:nk,onLeaveCancelled:nk,onBeforeAppear:nk,onAppear:nk,onAfterAppear:nk,onAppearCancelled:nk},nA=e=>{let t=e.subTree;return t.component?nA(t.component):t};function nR(e){let t=e[0];if(e.length>1){for(let n of e)if(n.type!==rJ){t=n;break}}return t}let nO={name:"BaseTransition",props:nT,setup(e,{slots:t}){let n=iy(),l=nw();return()=>{let r=t.default&&nD(t.default(),!0);if(!r||!r.length)return;let i=nR(r),s=ty(e),{mode:o}=s;if(l.isLeaving)return nM(i);let a=nI(i);if(!a)return nM(i);let u=nP(a,s,l,n,e=>u=e);a.type!==rJ&&nL(a,u);let c=n.subTree&&nI(n.subTree);if(c&&c.type!==rJ&&!r5(a,c)&&nA(n).type!==rJ){let e=nP(c,s,l,n);if(nL(c,e),"out-in"===o&&a.type!==rJ)return l.isLeaving=!0,e.afterLeave=()=>{l.isLeaving=!1,8&n.job.flags||n.update(),delete e.afterLeave,c=void 0},nM(i);"in-out"===o&&a.type!==rJ?e.delayLeave=(e,t,n)=>{nN(l,c)[String(c.key)]=c,e[nx]=()=>{t(),e[nx]=void 0,delete u.delayedLeave,c=void 0},u.delayedLeave=()=>{n(),delete u.delayedLeave,c=void 0}}:c=void 0}else c&&(c=void 0);return i}}};function nN(e,t){let{leavingVNodes:n}=e,l=n.get(t.type);return l||(l=Object.create(null),n.set(t.type,l)),l}function nP(e,t,n,l,r){let{appear:i,mode:s,persisted:o=!1,onBeforeEnter:a,onEnter:u,onAfterEnter:c,onEnterCancelled:f,onBeforeLeave:p,onLeave:d,onAfterLeave:h,onLeaveCancelled:g,onBeforeAppear:m,onAppear:_,onAfterAppear:y,onAppearCancelled:b}=t,S=String(e.key),C=nN(n,e),x=(e,t)=>{e&&tZ(e,l,9,t)},E=(e,t)=>{let n=t[1];x(e,t),k(e)?e.every(e=>e.length<=1)&&n():e.length<=1&&n()},w={mode:s,persisted:o,beforeEnter(t){let l=a;if(!n.isMounted)if(!i)return;else l=m||a;t[nx]&&t[nx](!0);let r=C[S];r&&r5(e,r)&&r.el[nx]&&r.el[nx](),x(l,[t])},enter(e){let t=u,l=c,r=f;if(!n.isMounted)if(!i)return;else t=_||u,l=y||c,r=b||f;let s=!1,o=e[nE]=t=>{s||(s=!0,t?x(r,[e]):x(l,[e]),w.delayedLeave&&w.delayedLeave(),e[nE]=void 0)};t?E(t,[e,o]):o()},leave(t,l){let r=String(e.key);if(t[nE]&&t[nE](!0),n.isUnmounting)return l();x(p,[t]);let i=!1,s=t[nx]=n=>{i||(i=!0,l(),n?x(g,[t]):x(h,[t]),t[nx]=void 0,C[r]===e&&delete C[r])};C[r]=e,d?E(d,[t,s]):s()},clone(e){let i=nP(e,t,n,l,r);return r&&r(i),i}};return w}function nM(e){if(n4(e))return(e=ii(e)).children=null,e}function nI(e){if(!n4(e))return e.type.__isTeleport&&e.children?nR(e.children):e;if(e.component)return e.component.subTree;let{shapeFlag:t,children:n}=e;if(n){if(16&t)return n[0];if(32&t&&O(n.default))return n.default()}}function nL(e,t){6&e.shapeFlag&&e.component?(e.transition=t,nL(e.component.subTree,t)):128&e.shapeFlag?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function nD(e,t=!1,n){let l=[],r=0;for(let i=0;i1)for(let e=0;en.value,set:e=>n.value=e}),n}function nB(e,t,n,l,r=!1){if(k(e))return void e.forEach((e,i)=>nB(e,t&&(k(t)?t[i]:t),n,l,r));if(n2(l)&&!r){512&l.shapeFlag&&l.type.__asyncResolved&&l.component.subTree.component&&nB(e,t,n,l.component.subTree);return}let i=4&l.shapeFlag?iN(l.component):l.el,s=r?null:i,{i:o,r:a}=e,u=t&&t.r,c=o.refs===g?o.refs={}:o.refs,f=o.setupState,p=ty(f),d=f===g?()=>!1:e=>w(p,e);if(null!=u&&u!==a&&(N(u)?(c[u]=null,d(u)&&(f[u]=null)):tx(u)&&(u.value=null)),O(a))tX(a,o,12,[s,c]);else{let t=N(a),l=tx(a);if(t||l){let o=()=>{if(e.f){let n=t?d(a)?f[a]:c[a]:a.value;r?k(n)&&x(n,i):k(n)?n.includes(i)||n.push(i):t?(c[a]=[i],d(a)&&(f[a]=c[a])):(a.value=[i],e.k&&(c[e.k]=a.value))}else t?(c[a]=s,d(a)&&(f[a]=s)):l&&(a.value=s,e.k&&(c[e.k]=s))};s?(o.id=-1,rp(o,n)):o()}}}let n$=!1,nH=()=>{n$||(console.error("Hydration completed but contains mismatches."),n$=!0)},nW=e=>{if(1===e.nodeType){if(e.namespaceURI.includes("svg")&&"foreignObject"!==e.tagName)return"svg";if(e.namespaceURI.includes("MathML"))return"mathml"}},nK=e=>8===e.nodeType;function nz(e){let{mt:t,p:n,o:{patchProp:l,createText:r,nextSibling:i,parentNode:s,remove:o,insert:a,createComment:u}}=e,c=(n,l,o,u,y,b=!1)=>{b=b||!!l.dynamicChildren;let S=nK(n)&&"["===n.data,C=()=>h(n,l,o,u,y,S),{type:x,ref:E,shapeFlag:w,patchFlag:k}=l,T=n.nodeType;l.el=n,-2===k&&(b=!1,l.dynamicChildren=null);let A=null;switch(x){case rG:3!==T?""===l.children?(a(l.el=r(""),s(n),n),A=n):A=C():(n.data!==l.children&&(nH(),n.data=l.children),A=i(n));break;case rJ:_(n)?(A=i(n),m(l.el=n.content.firstChild,n,o)):A=8!==T||S?C():i(n);break;case rX:if(S&&(T=(n=i(n)).nodeType),1===T||3===T){A=n;let e=!l.children.length;for(let t=0;t{s=s||!!t.dynamicChildren;let{type:a,props:u,patchFlag:c,shapeFlag:f,dirs:d,transition:h}=t,g="input"===a||"option"===a;if(g||-1!==c){let a;d&&nf(t,null,n,"created");let y=!1;if(_(e)){y=r_(null,h)&&n&&n.vnode.props&&n.vnode.props.appear;let l=e.content.firstChild;if(y){let e=l.getAttribute("class");e&&(l.$cls=e),h.beforeEnter(l)}m(l,e,n),t.el=e=l}if(16&f&&!(u&&(u.innerHTML||u.textContent))){let l=p(e.firstChild,t,e,n,r,i,s);for(;l;){nJ(e,1)||nH();let t=l;l=l.nextSibling,o(t)}}else if(8&f){let n=t.children;` +`===n[0]&&("PRE"===e.tagName||"TEXTAREA"===e.tagName)&&(n=n.slice(1)),e.textContent!==n&&(nJ(e,0)||nH(),e.textContent=t.children)}if(u){if(g||!s||48&c){let t=e.tagName.includes("-");for(let r in u)(g&&(r.endsWith("value")||"indeterminate"===r)||b(r)&&!U(r)||"."===r[0]||t)&&l(e,r,null,u[r],void 0,n)}else if(u.onClick)l(e,"onClick",null,u.onClick,void 0,n);else if(4&c&&tg(u.style))for(let e in u.style)u.style[e]}(a=u&&u.onVnodeBeforeMount)&&ih(a,n,t),d&&nf(t,null,n,"beforeMount"),((a=u&&u.onVnodeMounted)||d||y)&&rK(()=>{a&&ih(a,n,t),y&&h.enter(e),d&&nf(t,null,n,"mounted")},r)}return e.nextSibling},p=(e,t,l,s,o,u,f)=>{f=f||!!t.dynamicChildren;let p=t.children,d=p.length;for(let t=0;t{let{slotScopeIds:c}=t;c&&(r=r?r.concat(c):c);let f=s(e),d=p(i(e),t,f,n,l,r,o);return d&&nK(d)&&"]"===d.data?i(t.anchor=d):(nH(),a(t.anchor=u("]"),f,d),d)},h=(e,t,l,r,a,u)=>{if(nJ(e.parentElement,1)||nH(),t.el=null,u){let t=g(e);for(;;){let n=i(e);if(n&&n!==t)o(n);else break}}let c=i(e),f=s(e);return o(e),n(null,t,f,c,l,r,nW(f),a),l&&(l.vnode.el=t.el,rV(l,t.el)),c},g=(e,t="[",n="]")=>{let l=0;for(;e;)if((e=i(e))&&nK(e)&&(e.data===t&&l++,e.data===n))if(0===l)return i(e);else l--;return e},m=(e,t,n)=>{let l=t.parentNode;l&&l.replaceChild(e,t);let r=n;for(;r;)r.vnode.el===t&&(r.vnode.el=r.subTree.el=e),r=r.parent},_=e=>1===e.nodeType&&"TEMPLATE"===e.tagName;return[(e,t)=>{if(!t.hasChildNodes()){n(null,e,t),nt(),t._vnode=e;return}c(t.firstChild,e,null,null,null),nt(),t._vnode=e},c]}let nq="data-allow-mismatch",nG={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function nJ(e,t){if(0===t||1===t)for(;e&&!e.hasAttribute(nq);)e=e.parentElement;let n=e&&e.getAttribute(nq);if(null==n)return!1;{if(""===n)return!0;let e=n.split(",");return!!(0===t&&e.includes("children"))||e.includes(nG[t])}}let nX=Y().requestIdleCallback||(e=>setTimeout(e,1)),nZ=Y().cancelIdleCallback||(e=>clearTimeout(e)),nY=(e=1e4)=>t=>{let n=nX(t,{timeout:e});return()=>nZ(n)},nQ=e=>(t,n)=>{let l=new IntersectionObserver(e=>{for(let n of e)if(n.isIntersecting){l.disconnect(),t();break}},e);return n(e=>{if(e instanceof Element){if(function(e){let{top:t,left:n,bottom:l,right:r}=e.getBoundingClientRect(),{innerHeight:i,innerWidth:s}=window;return(t>0&&t0&&l0&&n0&&rl.disconnect()},n0=e=>t=>{if(e){let n=matchMedia(e);if(!n.matches)return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t);t()}},n1=(e=[])=>(t,n)=>{N(e)&&(e=[e]);let l=!1,r=e=>{l||(l=!0,i(),t(),e.target.dispatchEvent(new e.constructor(e.type,e)))},i=()=>{n(t=>{for(let n of e)t.removeEventListener(n,r)})};return n(t=>{for(let n of e)t.addEventListener(n,r,{once:!0})}),i},n2=e=>!!e.type.__asyncLoader;function n6(e){let t;O(e)&&(e={loader:e});let{loader:n,loadingComponent:l,errorComponent:r,delay:i=200,hydrate:s,timeout:o,suspensible:a=!0,onError:u}=e,c=null,f=0,p=()=>{let e;return c||(e=c=n().catch(e=>{if(e=e instanceof Error?e:Error(String(e)),u)return new Promise((t,n)=>{u(e,()=>t((f++,c=null,p())),()=>n(e),f+1)});throw e}).then(n=>e!==c&&c?c:(n&&(n.__esModule||"Module"===n[Symbol.toStringTag])&&(n=n.default),t=n,n)))};return nF({name:"AsyncComponentWrapper",__asyncLoader:p,__asyncHydrate(e,n,l){let r=s?()=>{let t=s(()=>{l()},t=>(function(e,t){if(nK(e)&&"["===e.data){let n=1,l=e.nextSibling;for(;l;){if(1===l.nodeType){if(!1===t(l))break}else if(nK(l))if("]"===l.data){if(0==--n)break}else"["===l.data&&n++;l=l.nextSibling}}else t(e)})(e,t));t&&(n.bum||(n.bum=[])).push(t),(n.u||(n.u=[])).push(()=>!0)}:l;t?r():p().then(()=>!n.isUnmounted&&r())},get __asyncResolved(){return t},setup(){let e=i_;if(nU(e),t)return()=>n8(t,e);let n=t=>{c=null,tY(t,e,13,!r)};if(a&&e.suspense||ix)return p().then(t=>()=>n8(t,e)).catch(e=>(n(e),()=>r?il(r,{error:e}):null));let s=tE(!1),u=tE(),f=tE(!!i);return i&&setTimeout(()=>{f.value=!1},i),null!=o&&setTimeout(()=>{if(!s.value&&!u.value){let e=Error(`Async component timed out after ${o}ms.`);n(e),u.value=e}},o),p().then(()=>{s.value=!0,e.parent&&n4(e.parent.vnode)&&e.parent.update()}).catch(e=>{n(e),u.value=e}),()=>s.value&&t?n8(t,e):u.value&&r?il(r,{error:u.value}):l&&!f.value?il(l):void 0}})}function n8(e,t){let{ref:n,props:l,children:r,ce:i}=t.vnode,s=il(e,l,r);return s.ref=n,s.ce=i,delete t.vnode.ce,s}let n4=e=>e.type.__isKeepAlive,n3={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){let n=iy(),l=n.ctx;if(!l.renderer)return()=>{let e=t.default&&t.default();return e&&1===e.length?e[0]:e};let r=new Map,i=new Set,s=null,o=n.suspense,{renderer:{p:a,m:u,um:c,o:{createElement:f}}}=l,p=f("div");function d(e){lt(e),c(e,n,o,!0)}function h(e){r.forEach((t,n)=>{let l=iP(t.type);l&&!e(l)&&g(n)})}function g(e){let t=r.get(e);!t||s&&r5(t,s)?s&<(s):d(t),r.delete(e),i.delete(e)}l.activate=(e,t,n,l,r)=>{let i=e.component;u(e,t,n,0,o),a(i.vnode,e,t,n,i,o,l,e.slotScopeIds,r),rp(()=>{i.isDeactivated=!1,i.a&&G(i.a);let t=e.props&&e.props.onVnodeMounted;t&&ih(t,i.parent,e)},o)},l.deactivate=e=>{let t=e.component;rb(t.m),rb(t.a),u(e,p,null,1,o),rp(()=>{t.da&&G(t.da);let n=e.props&&e.props.onVnodeUnmounted;n&&ih(n,t.parent,e),t.isDeactivated=!0},o)},rk(()=>[e.include,e.exclude],([e,t])=>{e&&h(t=>n5(e,t)),t&&h(e=>!n5(t,e))},{flush:"post",deep:!0});let m=null,_=()=>{null!=m&&(rU(n.subTree.type)?rp(()=>{r.set(m,ln(n.subTree))},n.subTree.suspense):r.set(m,ln(n.subTree)))};return ls(_),la(_),lu(()=>{r.forEach(e=>{let{subTree:t,suspense:l}=n,r=ln(t);if(e.type===r.type&&e.key===r.key){lt(r);let e=r.component.da;e&&rp(e,l);return}d(e)})}),()=>{if(m=null,!t.default)return s=null;let n=t.default(),l=n[0];if(n.length>1)return s=null,n;if(!r3(l)||!(4&l.shapeFlag)&&!(128&l.shapeFlag))return s=null,l;let o=ln(l);if(o.type===rJ)return s=null,o;let a=o.type,u=iP(n2(o)?o.type.__asyncResolved||{}:a),{include:c,exclude:f,max:p}=e;if(c&&(!u||!n5(c,u))||f&&u&&n5(f,u))return o.shapeFlag&=-257,s=o,l;let d=null==o.key?a:o.key,h=r.get(d);return o.el&&(o=ii(o),128&l.shapeFlag&&(l.ssContent=o)),m=d,h?(o.el=h.el,o.component=h.component,o.transition&&nL(o,o.transition),o.shapeFlag|=512,i.delete(d),i.add(d)):(i.add(d),p&&i.size>parseInt(p,10)&&g(i.values().next().value)),o.shapeFlag|=256,s=o,rU(l.type)?l:o}}};function n5(e,t){return k(e)?e.some(e=>n5(e,t)):N(e)?e.split(",").includes(t):"[object RegExp]"===D(e)&&(e.lastIndex=0,e.test(t))}function n9(e,t){le(e,"a",t)}function n7(e,t){le(e,"da",t)}function le(e,t,n=i_){let l=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()});if(ll(t,l,n),n){let e=n.parent;for(;e&&e.parent;)n4(e.parent.vnode)&&function(e,t,n,l){let r=ll(t,e,l,!0);lc(()=>{x(l[t],r)},n)}(l,t,n,e),e=e.parent}}function lt(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function ln(e){return 128&e.shapeFlag?e.ssContent:e}function ll(e,t,n=i_,l=!1){if(n){let r=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...l)=>{eN();let r=ib(n),i=tZ(t,n,e,l);return r(),eP(),i});return l?r.unshift(i):r.push(i),i}}let lr=e=>(t,n=i_)=>{ix&&"sp"!==e||ll(e,(...e)=>t(...e),n)},li=lr("bm"),ls=lr("m"),lo=lr("bu"),la=lr("u"),lu=lr("bum"),lc=lr("um"),lf=lr("sp"),lp=lr("rtg"),ld=lr("rtc");function lh(e,t=i_){ll("ec",e,t)}let lg="components";function lv(e,t){return lb(lg,e,!0,t)||e}let lm=Symbol.for("v-ndc");function l_(e){return N(e)?lb(lg,e,!1)||e:e||lm}function ly(e){return lb("directives",e)}function lb(e,t,n=!0,l=!1){let r=nl||i_;if(r){let n=r.type;if(e===lg){let e=iP(n,!1);if(e&&(e===t||e===$(t)||e===K($(t))))return n}let i=lS(r[e]||n[e],t)||lS(r.appContext[e],t);return!i&&l?n:i}}function lS(e,t){return e&&(e[t]||e[$(t)]||e[K($(t))])}function lC(e,t,n,l){let r,i=n&&n[l],s=k(e);if(s||N(e)){let n=s&&tg(e),l=!1,o=!1;n&&(l=!tm(e),o=tv(e),e=eW(e)),r=Array(e.length);for(let n=0,s=e.length;nt(e,n,void 0,i&&i[n]));else{let n=Object.keys(e);r=Array(n.length);for(let l=0,s=n.length;l{let t=l.fn(...e);return t&&(t.key=l.key),t}:l.fn)}return e}function lE(e,t,n={},l,r){if(nl.ce||nl.parent&&n2(nl.parent)&&nl.parent.ce)return"default"!==t&&(n.name=t),rQ(),r4(rq,null,[il("slot",n,l&&l())],64);let i=e[t];i&&i._c&&(i._d=!1),rQ();let s=i&&lw(i(n)),o=n.key||s&&s.key,a=r4(rq,{key:(o&&!P(o)?o:`_${t}`)+(!s&&l?"_fb":"")},s||(l?l():[]),s&&1===e._?64:-2);return!r&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),i&&i._c&&(i._d=!0),a}function lw(e){return e.some(e=>!r3(e)||e.type!==rJ&&(e.type!==rq||!!lw(e.children)))?e:null}function lk(e,t){let n={};for(let l in e)n[t&&/[A-Z]/.test(l)?`on:${l}`:z(l)]=e[l];return n}let lT=e=>e?iC(e)?iN(e):lT(e.parent):null,lA=C(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>lT(e.parent),$root:e=>lT(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>lJ(e),$forceUpdate:e=>e.f||(e.f=()=>{t5(e.update)}),$nextTick:e=>e.n||(e.n=t3.bind(e.proxy)),$watch:e=>rA.bind(e)}),lR=(e,t)=>e!==g&&!e.__isScriptSetup&&w(e,t),lO={get({_:e},t){let n,l,r;if("__v_skip"===t)return!0;let{ctx:i,setupState:s,data:o,props:a,accessCache:u,type:c,appContext:f}=e;if("$"!==t[0]){let l=u[t];if(void 0!==l)switch(l){case 1:return s[t];case 2:return o[t];case 4:return i[t];case 3:return a[t]}else{if(lR(s,t))return u[t]=1,s[t];if(o!==g&&w(o,t))return u[t]=2,o[t];if((n=e.propsOptions[0])&&w(n,t))return u[t]=3,a[t];if(i!==g&&w(i,t))return u[t]=4,i[t];lq&&(u[t]=0)}}let p=lA[t];return p?("$attrs"===t&&eB(e.attrs,"get",""),p(e)):(l=c.__cssModules)&&(l=l[t])?l:i!==g&&w(i,t)?(u[t]=4,i[t]):w(r=f.config.globalProperties,t)?r[t]:void 0},set({_:e},t,n){let{data:l,setupState:r,ctx:i}=e;return lR(r,t)?(r[t]=n,!0):l!==g&&w(l,t)?(l[t]=n,!0):!w(e.props,t)&&!("$"===t[0]&&t.slice(1)in e)&&(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:l,appContext:r,propsOptions:i}},s){let o;return!!n[s]||e!==g&&w(e,s)||lR(t,s)||(o=i[0])&&w(o,s)||w(l,s)||w(lA,s)||w(r.config.globalProperties,s)},defineProperty(e,t,n){return null!=n.get?e._.accessCache[t]=0:w(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},lN=C({},lO,{get(e,t){if(t!==Symbol.unscopables)return lO.get(e,t,e)},has:(e,t)=>"_"!==t[0]&&!Q(t)});function lP(){return null}function lM(){return null}function lI(e){}function lL(e){}function lD(){return null}function lF(){}function lV(e,t){return null}function lU(){return lB().slots}function lj(){return lB().attrs}function lB(){let e=iy();return e.setupContext||(e.setupContext=iO(e))}function l$(e){return k(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}function lH(e,t){let n=l$(e);for(let e in t){if(e.startsWith("__skip"))continue;let l=n[e];l?k(l)||O(l)?l=n[e]={type:l,default:t[e]}:l.default=t[e]:null===l&&(l=n[e]={default:t[e]}),l&&t[`__skip_${e}`]&&(l.skipFactory=!0)}return n}function lW(e,t){return e&&t?k(e)&&k(t)?e.concat(t):C({},l$(e),l$(t)):e||t}function lK(e,t){let n={};for(let l in e)t.includes(l)||Object.defineProperty(n,l,{enumerable:!0,get:()=>e[l]});return n}function lz(e){let t=iy(),n=e();return iS(),I(n)&&(n=n.catch(e=>{throw ib(t),e})),[n,()=>ib(t)]}let lq=!0;function lG(e,t,n){tZ(k(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function lJ(e){let t,n=e.type,{mixins:l,extends:r}=n,{mixins:i,optionsCache:s,config:{optionMergeStrategies:o}}=e.appContext,a=s.get(n);return a?t=a:i.length||l||r?(t={},i.length&&i.forEach(e=>lX(t,e,o,!0)),lX(t,n,o)):t=n,M(n)&&s.set(n,t),t}function lX(e,t,n,l=!1){let{mixins:r,extends:i}=t;for(let s in i&&lX(e,i,n,!0),r&&r.forEach(t=>lX(e,t,n,!0)),t)if(l&&"expose"===s);else{let l=lZ[s]||n&&n[s];e[s]=l?l(e[s],t[s]):t[s]}return e}let lZ={data:lY,props:l2,emits:l2,methods:l1,computed:l1,beforeCreate:l0,created:l0,beforeMount:l0,mounted:l0,beforeUpdate:l0,updated:l0,beforeDestroy:l0,beforeUnmount:l0,destroyed:l0,unmounted:l0,activated:l0,deactivated:l0,errorCaptured:l0,serverPrefetch:l0,components:l1,directives:l1,watch:function(e,t){if(!e)return t;if(!t)return e;let n=C(Object.create(null),e);for(let l in t)n[l]=l0(e[l],t[l]);return n},provide:lY,inject:function(e,t){return l1(lQ(e),lQ(t))}};function lY(e,t){return t?e?function(){return C(O(e)?e.call(this,this):e,O(t)?t.call(this,this):t)}:t:e}function lQ(e){if(k(e)){let t={};for(let n=0;n1)return n&&O(t)?t.call(l&&l.proxy):t}}function l9(){return!!(i_||nl||l4)}let l7={},re=()=>Object.create(l7),rt=e=>Object.getPrototypeOf(e)===l7;function rn(e,t,n,l){let r,[i,s]=e.propsOptions,o=!1;if(t)for(let a in t){let u;if(U(a))continue;let c=t[a];i&&w(i,u=$(a))?s&&s.includes(u)?(r||(r={}))[u]=c:n[u]=c:rM(e.emitsOptions,a)||a in l&&c===l[a]||(l[a]=c,o=!0)}if(s){let t=ty(n),l=r||g;for(let r=0;r"_"===e[0]||"$stable"===e,ro=e=>k(e)?e.map(iu):[iu(e)],ra=(e,t,n)=>{if(t._n)return t;let l=nu((...e)=>ro(t(...e)),n);return l._c=!1,l},ru=(e,t,n)=>{let l=e._ctx;for(let n in e){if(rs(n))continue;let r=e[n];if(O(r))t[n]=ra(n,r,l);else if(null!=r){let e=ro(r);t[n]=()=>e}}},rc=(e,t)=>{let n=ro(t);e.slots.default=()=>n},rf=(e,t,n)=>{for(let l in t)(n||!rs(l))&&(e[l]=t[l])},rp=rK;function rd(e){return rg(e)}function rh(e){return rg(e,nz)}function rg(e,t){var n;let l,r;Y().__VUE__=!0;let{insert:i,remove:s,patchProp:o,createElement:a,createText:u,createComment:c,setText:f,setElementText:p,parentNode:d,nextSibling:h,setScopeId:y=_,insertStaticContent:b}=e,S=(e,t,n,l=null,r=null,i=null,s,o=null,a=!!t.dynamicChildren)=>{if(e===t)return;e&&!r5(e,t)&&(l=el(e),Z(e,r,i,!0),e=null),-2===t.patchFlag&&(a=!1,t.dynamicChildren=null);let{type:u,ref:c,shapeFlag:f}=t;switch(u){case rG:x(e,t,n,l);break;case rJ:E(e,t,n,l);break;case rX:null==e&&T(t,n,l,s);break;case rq:F(e,t,n,l,r,i,s,o,a);break;default:1&f?A(e,t,n,l,r,i,s,o,a):6&f?V(e,t,n,l,r,i,s,o,a):64&f?u.process(e,t,n,l,r,i,s,o,a,es):128&f&&u.process(e,t,n,l,r,i,s,o,a,es)}null!=c&&r?nB(c,e&&e.ref,i,t||e,!t):null==c&&e&&null!=e.ref&&nB(e.ref,null,i,e,!0)},x=(e,t,n,l)=>{if(null==e)i(t.el=u(t.children),n,l);else{let n=t.el=e.el;t.children!==e.children&&f(n,t.children)}},E=(e,t,n,l)=>{null==e?i(t.el=c(t.children||""),n,l):t.el=e.el},T=(e,t,n,l)=>{[e.el,e.anchor]=b(e.children,t,n,l,e.el,e.anchor)},A=(e,t,n,l,r,i,s,o,a)=>{"svg"===t.type?s="svg":"math"===t.type&&(s="mathml"),null==e?R(t,n,l,r,i,s,o,a):I(e,t,r,i,s,o,a)},R=(e,t,n,l,r,s,u,c)=>{let f,d,{props:h,shapeFlag:g,transition:m,dirs:_}=e;if(f=e.el=a(e.type,s,h&&h.is,h),8&g?p(f,e.children):16&g&&P(e.children,f,null,l,r,rv(e,s),u,c),_&&nf(e,null,l,"created"),N(f,e,e.scopeId,u,l),h){for(let e in h)"value"===e||U(e)||o(f,e,null,h[e],s,l);"value"in h&&o(f,"value",null,h.value,s),(d=h.onVnodeBeforeMount)&&ih(d,l,e)}_&&nf(e,null,l,"beforeMount");let y=r_(r,m);y&&m.beforeEnter(f),i(f,t,n),((d=h&&h.onVnodeMounted)||y||_)&&rp(()=>{d&&ih(d,l,e),y&&m.enter(f),_&&nf(e,null,l,"mounted")},r)},N=(e,t,n,l,r)=>{if(n&&y(e,n),l)for(let t=0;t{for(let u=a;u{let a,u=t.el=e.el,{patchFlag:c,dynamicChildren:f,dirs:d}=t;c|=16&e.patchFlag;let h=e.props||g,m=t.props||g;if(n&&rm(n,!1),(a=m.onVnodeBeforeUpdate)&&ih(a,n,t,e),d&&nf(t,e,n,"beforeUpdate"),n&&rm(n,!0),(h.innerHTML&&null==m.innerHTML||h.textContent&&null==m.textContent)&&p(u,""),f?L(e.dynamicChildren,f,u,n,l,rv(t,r),i):s||z(e,t,u,null,n,l,rv(t,r),i,!1),c>0){if(16&c)D(u,h,m,n,r);else if(2&c&&h.class!==m.class&&o(u,"class",null,m.class,r),4&c&&o(u,"style",h.style,m.style,r),8&c){let e=t.dynamicProps;for(let t=0;t{a&&ih(a,n,t,e),d&&nf(t,e,n,"updated")},l)},L=(e,t,n,l,r,i,s)=>{for(let o=0;o{if(t!==n){if(t!==g)for(let i in t)U(i)||i in n||o(e,i,t[i],null,r,l);for(let i in n){if(U(i))continue;let s=n[i],a=t[i];s!==a&&"value"!==i&&o(e,i,a,s,r,l)}"value"in n&&o(e,"value",t.value,n.value,r)}},F=(e,t,n,l,r,s,o,a,c)=>{let f=t.el=e?e.el:u(""),p=t.anchor=e?e.anchor:u(""),{patchFlag:d,dynamicChildren:h,slotScopeIds:g}=t;g&&(a=a?a.concat(g):g),null==e?(i(f,n,l),i(p,n,l),P(t.children||[],n,p,r,s,o,a,c)):d>0&&64&d&&h&&e.dynamicChildren?(L(e.dynamicChildren,h,n,r,s,o,a),(null!=t.key||r&&t===r.subTree)&&ry(e,t,!0)):z(e,t,n,p,r,s,o,a,c)},V=(e,t,n,l,r,i,s,o,a)=>{t.slotScopeIds=o,null==e?512&t.shapeFlag?r.ctx.activate(t,n,l,s,a):j(t,n,l,r,i,s,a):B(e,t,a)},j=(e,t,n,l,r,i,s)=>{let o=e.component=im(e,l,r);n4(e)&&(o.ctx.renderer=es),iE(o,!1,s),o.asyncDep?(r&&r.registerDep(o,H,s),e.el||E(null,o.subTree=il(rJ),t,n)):H(o,e,t,n,r,i,s)},B=(e,t,n)=>{let l=t.component=e.component;if(function(e,t,n){let{props:l,children:r,component:i}=e,{props:s,children:o,patchFlag:a}=t,u=i.emitsOptions;if(t.dirs||t.transition)return!0;if(!n||!(a>=0))return(!!r||!!o)&&(!o||!o.$stable)||l!==s&&(l?!s||rF(l,s,u):!!s);if(1024&a)return!0;if(16&a)return l?rF(l,s,u):!!s;if(8&a){let e=t.dynamicProps;for(let t=0;t{let a=()=>{if(e.isMounted){let t,{next:n,bu:l,u:r,parent:u,vnode:c}=e;{let t=function e(t){let n=t.subTree.component;if(n)if(n.asyncDep&&!n.asyncResolved)return n;else return e(n)}(e);if(t){n&&(n.el=c.el,K(e,n,o)),t.asyncDep.then(()=>{e.isUnmounted||a()});return}}let f=n;rm(e,!1),n?(n.el=c.el,K(e,n,o)):n=c,l&&G(l),(t=n.props&&n.props.onVnodeBeforeUpdate)&&ih(t,u,n,c),rm(e,!0);let p=rI(e),h=e.subTree;e.subTree=p,S(h,p,d(h.el),el(h),e,i,s),n.el=p.el,null===f&&rV(e,p.el),r&&rp(r,i),(t=n.props&&n.props.onVnodeUpdated)&&rp(()=>ih(t,u,n,c),i)}else{let o,{el:a,props:u}=t,{bm:c,m:f,parent:p,root:d,type:h}=e,g=n2(t);if(rm(e,!1),c&&G(c),!g&&(o=u&&u.onVnodeBeforeMount)&&ih(o,p,t),rm(e,!0),a&&r){let t=()=>{e.subTree=rI(e),r(a,e.subTree,e,i,null)};g&&h.__asyncHydrate?h.__asyncHydrate(a,e,t):t()}else{d.ce&&!1!==d.ce._def.shadowRoot&&d.ce._injectChildStyle(h);let r=e.subTree=rI(e);S(null,r,n,l,e,i,s),t.el=r.el}if(f&&rp(f,i),!g&&(o=u&&u.onVnodeMounted)){let e=t;rp(()=>ih(o,p,e),i)}(256&t.shapeFlag||p&&n2(p.vnode)&&256&p.vnode.shapeFlag)&&e.a&&rp(e.a,i),e.isMounted=!0,t=n=l=null}};e.scope.on();let u=e.effect=new e_(a);e.scope.off();let c=e.update=u.run.bind(u),f=e.job=u.runIfDirty.bind(u);f.i=e,f.id=e.uid,u.scheduler=()=>t5(f),rm(e,!0),c()},K=(e,t,n)=>{t.component=e;let l=e.vnode.props;e.vnode=t,e.next=null,function(e,t,n,l){let{props:r,attrs:i,vnode:{patchFlag:s}}=e,o=ty(r),[a]=e.propsOptions,u=!1;if((l||s>0)&&!(16&s)){if(8&s){let n=e.vnode.dynamicProps;for(let l=0;l{let{vnode:l,slots:r}=e,i=!0,s=g;if(32&l.shapeFlag){let e=t._;e?n&&1===e?i=!1:rf(r,t,n):(i=!t.$stable,ru(t,r)),s=t}else t&&(rc(e,t),s={default:1});if(i)for(let e in r)rs(e)||null!=s[e]||delete r[e]})(e,t.children,n),eN(),ne(e),eP()},z=(e,t,n,l,r,i,s,o,a=!1)=>{let u=e&&e.children,c=e?e.shapeFlag:0,f=t.children,{patchFlag:d,shapeFlag:h}=t;if(d>0){if(128&d)return void J(u,f,n,l,r,i,s,o,a);else if(256&d)return void q(u,f,n,l,r,i,s,o,a)}8&h?(16&c&&en(u,r,i),f!==u&&p(n,f)):16&c?16&h?J(u,f,n,l,r,i,s,o,a):en(u,r,i,!0):(8&c&&p(n,""),16&h&&P(f,n,l,r,i,s,o,a))},q=(e,t,n,l,r,i,s,o,a)=>{let u;e=e||m,t=t||m;let c=e.length,f=t.length,p=Math.min(c,f);for(u=0;uf?en(e,r,i,!0,!1,p):P(t,n,l,r,i,s,o,a,p)},J=(e,t,n,l,r,i,s,o,a)=>{let u=0,c=t.length,f=e.length-1,p=c-1;for(;u<=f&&u<=p;){let l=e[u],c=t[u]=a?ic(t[u]):iu(t[u]);if(r5(l,c))S(l,c,n,null,r,i,s,o,a);else break;u++}for(;u<=f&&u<=p;){let l=e[f],u=t[p]=a?ic(t[p]):iu(t[p]);if(r5(l,u))S(l,u,n,null,r,i,s,o,a);else break;f--,p--}if(u>f){if(u<=p){let e=p+1,f=ep)for(;u<=f;)Z(e[u],r,i,!0),u++;else{let d,h=u,g=u,_=new Map;for(u=g;u<=p;u++){let e=t[u]=a?ic(t[u]):iu(t[u]);null!=e.key&&_.set(e.key,u)}let y=0,b=p-g+1,C=!1,x=0,E=Array(b);for(u=0;u=b){Z(c,r,i,!0);continue}if(null!=c.key)l=_.get(c.key);else for(d=g;d<=p;d++)if(0===E[d-g]&&r5(c,t[d])){l=d;break}void 0===l?Z(c,r,i,!0):(E[l-g]=u+1,l>=x?x=l:C=!0,S(c,t[l],n,null,r,i,s,o,a),y++)}let w=C?function(e){let t,n,l,r,i,s=e.slice(),o=[0],a=e.length;for(t=0;t>1]]0&&(s[t]=o[l-1]),o[l]=t)}}for(l=o.length,r=o[l-1];l-- >0;)o[l]=r,r=s[r];return o}(E):m;for(d=w.length-1,u=b-1;u>=0;u--){let e=g+u,f=t[e],p=e+1{let{el:o,type:a,transition:u,children:c,shapeFlag:f}=e;if(6&f)return void X(e.component.subTree,t,n,l);if(128&f)return void e.suspense.move(t,n,l);if(64&f)return void a.move(e,t,n,es);if(a===rq){i(o,t,n);for(let e=0;e{let r;for(;e&&e!==t;)r=h(e),i(e,n,l),e=r;i(t,n,l)})(e,t,n);if(2!==l&&1&f&&u)if(0===l)u.beforeEnter(o),i(o,t,n),rp(()=>u.enter(o),r);else{let{leave:l,delayLeave:r,afterLeave:a}=u,c=()=>{e.ctx.isUnmounted?s(o):i(o,t,n)},f=()=>{l(o,()=>{c(),a&&a()})};r?r(o,c,f):f()}else i(o,t,n)},Z=(e,t,n,l=!1,r=!1)=>{let i,{type:s,props:o,ref:a,children:u,dynamicChildren:c,shapeFlag:f,patchFlag:p,dirs:d,cacheIndex:h}=e;if(-2===p&&(r=!1),null!=a&&(eN(),nB(a,null,n,e,!0),eP()),null!=h&&(t.renderCache[h]=void 0),256&f)return void t.ctx.deactivate(e);let g=1&f&&d,m=!n2(e);if(m&&(i=o&&o.onVnodeBeforeUnmount)&&ih(i,t,e),6&f)et(e.component,n,l);else{if(128&f)return void e.suspense.unmount(n,l);g&&nf(e,null,t,"beforeUnmount"),64&f?e.type.remove(e,t,n,es,l):c&&!c.hasOnce&&(s!==rq||p>0&&64&p)?en(c,t,n,!1,!0):(s===rq&&384&p||!r&&16&f)&&en(u,t,n),l&&Q(e)}(m&&(i=o&&o.onVnodeUnmounted)||g)&&rp(()=>{i&&ih(i,t,e),g&&nf(e,null,t,"unmounted")},n)},Q=e=>{let{type:t,el:n,anchor:l,transition:r}=e;if(t===rq)return void ee(n,l);if(t===rX)return void(({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=h(e),s(e),e=n;s(t)})(e);let i=()=>{s(n),r&&!r.persisted&&r.afterLeave&&r.afterLeave()};if(1&e.shapeFlag&&r&&!r.persisted){let{leave:t,delayLeave:l}=r,s=()=>t(n,i);l?l(e.el,i,s):s()}else i()},ee=(e,t)=>{let n;for(;e!==t;)n=h(e),s(e),e=n;s(t)},et=(e,t,n)=>{let{bum:l,scope:r,job:i,subTree:s,um:o,m:a,a:u,parent:c,slots:{__:f}}=e;rb(a),rb(u),l&&G(l),c&&k(f)&&f.forEach(e=>{c.renderCache[e]=void 0}),r.stop(),i&&(i.flags|=8,Z(s,e,t,n)),o&&rp(o,t),rp(()=>{e.isUnmounted=!0},t),t&&t.pendingBranch&&!t.isUnmounted&&e.asyncDep&&!e.asyncResolved&&e.suspenseId===t.pendingId&&(t.deps--,0===t.deps&&t.resolve())},en=(e,t,n,l=!1,r=!1,i=0)=>{for(let s=i;s{if(6&e.shapeFlag)return el(e.component.subTree);if(128&e.shapeFlag)return e.suspense.next();let t=h(e.anchor||e.el),n=t&&t[np];return n?h(n):t},er=!1,ei=(e,t,n)=>{null==e?t._vnode&&Z(t._vnode,null,null,!0):S(t._vnode||null,e,t,null,null,null,n),t._vnode=e,er||(er=!0,ne(),nt(),er=!1)},es={p:S,um:Z,m:X,r:Q,mt:j,mc:P,pc:z,pbc:L,n:el,o:e};return t&&([l,r]=t(es)),{render:ei,hydrate:l,createApp:(n=l,function(e,t=null){O(e)||(e=C({},e)),null==t||M(t)||(t=null);let l=l6(),r=new WeakSet,i=[],s=!1,o=l.app={_uid:l8++,_component:e,_props:t,_container:null,_context:l,_instance:null,version:iV,get config(){return l.config},set config(v){},use:(e,...t)=>(r.has(e)||(e&&O(e.install)?(r.add(e),e.install(o,...t)):O(e)&&(r.add(e),e(o,...t))),o),mixin:e=>(l.mixins.includes(e)||l.mixins.push(e),o),component:(e,t)=>t?(l.components[e]=t,o):l.components[e],directive:(e,t)=>t?(l.directives[e]=t,o):l.directives[e],mount(r,i,a){if(!s){let u=o._ceVNode||il(e,t);return u.appContext=l,!0===a?a="svg":!1===a&&(a=void 0),i&&n?n(u,r):ei(u,r,a),s=!0,o._container=r,r.__vue_app__=o,iN(u.component)}},onUnmount(e){i.push(e)},unmount(){s&&(tZ(i,o._instance,16),ei(null,o._container),delete o._container.__vue_app__)},provide:(e,t)=>(l.provides[e]=t,o),runWithContext(e){let t=l4;l4=o;try{return e()}finally{l4=t}}};return o})}}function rv({type:e,props:t},n){return"svg"===n&&"foreignObject"===e||"mathml"===n&&"annotation-xml"===e&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function rm({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function r_(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function ry(e,t,n=!1){let l=e.children,r=t.children;if(k(l)&&k(r))for(let e=0;el5(rS);function rx(e,t){return rT(e,null,t)}function rE(e,t){return rT(e,null,{flush:"post"})}function rw(e,t){return rT(e,null,{flush:"sync"})}function rk(e,t,n){return rT(e,t,n)}function rT(e,t,n=g){let l,{immediate:r,deep:i,flush:s,once:o}=n,a=C({},n),u=t&&r||!t&&"post"!==s;if(ix){if("sync"===s){let e=rC();l=e.__watcherHandles||(e.__watcherHandles=[])}else if(!u){let e=()=>{};return e.stop=_,e.resume=_,e.pause=_,e}}let c=i_;a.call=(e,t,n)=>tZ(e,c,t,n);let f=!1;"post"===s?a.scheduler=e=>{rp(e,c&&c.suspense)}:"sync"!==s&&(f=!0,a.scheduler=(e,t)=>{t?e():t5(e)}),a.augmentJob=e=>{t&&(e.flags|=4),f&&(e.flags|=2,c&&(e.id=c.uid,e.i=c))};let d=function(e,t,n=g){let l,r,i,s,{immediate:o,deep:a,once:u,scheduler:c,augmentJob:f,call:d}=n,h=e=>a?e:tm(e)||!1===a||0===a?tq(e,1):tq(e),m=!1,y=!1;if(tx(e)?(r=()=>e.value,m=tm(e)):tg(e)?(r=()=>h(e),m=!0):k(e)?(y=!0,m=e.some(e=>tg(e)||tm(e)),r=()=>e.map(e=>tx(e)?e.value:tg(e)?h(e):O(e)?d?d(e,2):e():void 0)):r=O(e)?t?d?()=>d(e,2):e:()=>{if(i){eN();try{i()}finally{eP()}}let t=p;p=l;try{return d?d(e,3,[s]):e(s)}finally{p=t}}:_,t&&a){let e=r,t=!0===a?1/0:a;r=()=>tq(e(),t)}let b=eg(),S=()=>{l.stop(),b&&b.active&&x(b.effects,l)};if(u&&t){let e=t;t=(...t)=>{e(...t),S()}}let C=y?Array(e.length).fill(tH):tH,E=e=>{if(1&l.flags&&(l.dirty||e))if(t){let e=l.run();if(a||m||(y?e.some((e,t)=>q(e,C[t])):q(e,C))){i&&i();let n=p;p=l;try{let n=[e,C===tH?void 0:y&&C[0]===tH?[]:C,s];C=e,d?d(t,3,n):t(...n)}finally{p=n}}}else l.run()};return f&&f(E),(l=new e_(r)).scheduler=c?()=>c(E,!1):E,s=e=>tz(e,!1,l),i=l.onStop=()=>{let e=tW.get(l);if(e){if(d)d(e,4);else for(let t of e)t();tW.delete(l)}},t?o?E(!0):C=l.run():c?c(E.bind(null,!0),!0):l.run(),S.pause=l.pause.bind(l),S.resume=l.resume.bind(l),S.stop=S,S}(e,t,a);return ix&&(l?l.push(d):u&&d()),d}function rA(e,t,n){let l,r=this.proxy,i=N(e)?e.includes(".")?rR(r,e):()=>r[e]:e.bind(r,r);O(t)?l=t:(l=t.handler,n=t);let s=ib(this),o=rT(i,l.bind(r),n);return s(),o}function rR(e,t){let n=t.split(".");return()=>{let t=e;for(let e=0;e{let a,u,c=g;return rw(()=>{let t=e[r];q(a,t)&&(a=t,o())}),{get:()=>(s(),n.get?n.get(a):a),set(e){let s=n.set?n.set(e):e;if(!q(s,a)&&!(c!==g&&q(e,c)))return;let f=l.vnode.props;f&&(t in f||r in f||i in f)&&(`onUpdate:${t}`in f||`onUpdate:${r}`in f||`onUpdate:${i}`in f)||(a=e,o()),l.emit(`update:${t}`,s),q(e,s)&&q(e,c)&&!q(s,u)&&o(),c=e,u=s}}});return o[Symbol.iterator]=()=>{let e=0;return{next:()=>e<2?{value:e++?s||g:o,done:!1}:{done:!0}}},o}let rN=(e,t)=>"modelValue"===t||"model-value"===t?e.modelModifiers:e[`${t}Modifiers`]||e[`${$(t)}Modifiers`]||e[`${W(t)}Modifiers`];function rP(e,t,...n){let l;if(e.isUnmounted)return;let r=e.vnode.props||g,i=n,s=t.startsWith("update:"),o=s&&rN(r,t.slice(7));o&&(o.trim&&(i=n.map(e=>N(e)?e.trim():e)),o.number&&(i=n.map(X)));let a=r[l=z(t)]||r[l=z($(t))];!a&&s&&(a=r[l=z(W(t))]),a&&tZ(a,e,6,i);let u=r[l+"Once"];if(u){if(e.emitted){if(e.emitted[l])return}else e.emitted={};e.emitted[l]=!0,tZ(u,e,6,i)}}function rM(e,t){return!!e&&!!b(t)&&(w(e,(t=t.slice(2).replace(/Once$/,""))[0].toLowerCase()+t.slice(1))||w(e,W(t))||w(e,t))}function rI(e){let t,n,{type:l,vnode:r,proxy:i,withProxy:s,propsOptions:[o],slots:a,attrs:u,emit:c,render:f,renderCache:p,props:d,data:h,setupState:g,ctx:m,inheritAttrs:_}=e,y=ni(e);try{if(4&r.shapeFlag){let e=s||i;t=iu(f.call(e,e,p,d,g,h,m)),n=u}else t=iu(l.length>1?l(d,{attrs:u,slots:a,emit:c}):l(d,null)),n=l.props?u:rL(u)}catch(n){rZ.length=0,tY(n,e,1),t=il(rJ)}let b=t;if(n&&!1!==_){let e=Object.keys(n),{shapeFlag:t}=b;e.length&&7&t&&(o&&e.some(S)&&(n=rD(n,o)),b=ii(b,n,!1,!0))}return r.dirs&&((b=ii(b,null,!1,!0)).dirs=b.dirs?b.dirs.concat(r.dirs):r.dirs),r.transition&&nL(b,r.transition),t=b,ni(y),t}let rL=e=>{let t;for(let n in e)("class"===n||"style"===n||b(n))&&((t||(t={}))[n]=e[n]);return t},rD=(e,t)=>{let n={};for(let l in e)S(l)&&l.slice(9)in t||(n[l]=e[l]);return n};function rF(e,t,n){let l=Object.keys(t);if(l.length!==Object.keys(e).length)return!0;for(let r=0;re.__isSuspense,rj=0,rB={name:"Suspense",__isSuspense:!0,process(e,t,n,l,r,i,s,o,a,u){if(null==e){var c=t,f=n,p=l,d=r,h=i,g=s,m=o,_=a,y=u;let{p:e,o:{createElement:b}}=y,S=b("div"),C=c.suspense=rH(c,h,d,f,S,p,g,m,_,y);e(null,C.pendingBranch=c.ssContent,S,null,d,C,g,m),C.deps>0?(r$(c,"onPending"),r$(c,"onFallback"),e(null,c.ssFallback,f,p,d,null,g,m),rz(C,c.ssFallback)):C.resolve(!1,!0)}else{if(i&&i.deps>0&&!e.suspense.isInFallback){t.suspense=e.suspense,t.suspense.vnode=t,t.el=e.el;return}!function(e,t,n,l,r,i,s,o,{p:a,um:u,o:{createElement:c}}){let f=t.suspense=e.suspense;f.vnode=t,t.el=e.el;let p=t.ssContent,d=t.ssFallback,{activeBranch:h,pendingBranch:g,isInFallback:m,isHydrating:_}=f;if(g)f.pendingBranch=p,r5(p,g)?(a(g,p,f.hiddenContainer,null,r,f,i,s,o),f.deps<=0?f.resolve():m&&!_&&(a(h,d,n,l,r,null,i,s,o),rz(f,d))):(f.pendingId=rj++,_?(f.isHydrating=!1,f.activeBranch=g):u(g,r,f),f.deps=0,f.effects.length=0,f.hiddenContainer=c("div"),m?(a(null,p,f.hiddenContainer,null,r,f,i,s,o),f.deps<=0?f.resolve():(a(h,d,n,l,r,null,i,s,o),rz(f,d))):h&&r5(p,h)?(a(h,p,n,l,r,f,i,s,o),f.resolve(!0)):(a(null,p,f.hiddenContainer,null,r,f,i,s,o),f.deps<=0&&f.resolve()));else if(h&&r5(p,h))a(h,p,n,l,r,f,i,s,o),rz(f,p);else if(r$(t,"onPending"),f.pendingBranch=p,512&p.shapeFlag?f.pendingId=p.component.suspenseId:f.pendingId=rj++,a(null,p,f.hiddenContainer,null,r,f,i,s,o),f.deps<=0)f.resolve();else{let{timeout:e,pendingId:t}=f;e>0?setTimeout(()=>{f.pendingId===t&&f.fallback(d)},e):0===e&&f.fallback(d)}}(e,t,n,l,r,s,o,a,u)}},hydrate:function(e,t,n,l,r,i,s,o,a){let u=t.suspense=rH(t,l,n,e.parentNode,document.createElement("div"),null,r,i,s,o,!0),c=a(e,u.pendingBranch=t.ssContent,n,u,i,s);return 0===u.deps&&u.resolve(!1,!0),c},normalize:function(e){let{shapeFlag:t,children:n}=e,l=32&t;e.ssContent=rW(l?n.default:n),e.ssFallback=l?rW(n.fallback):il(rJ)}};function r$(e,t){let n=e.props&&e.props[t];O(n)&&n()}function rH(e,t,n,l,r,i,s,o,a,u,c=!1){let f,{p:p,m:d,um:h,n:g,o:{parentNode:m,remove:_}}=u,y=function(e){let t=e.props&&e.props.suspensible;return null!=t&&!1!==t}(e);y&&t&&t.pendingBranch&&(f=t.pendingId,t.deps++);let b=e.props?Z(e.props.timeout):void 0,S=i,C={vnode:e,parent:t,parentComponent:n,namespace:s,container:l,hiddenContainer:r,deps:0,pendingId:rj++,timeout:"number"==typeof b?b:-1,activeBranch:null,pendingBranch:null,isInFallback:!c,isHydrating:c,isUnmounted:!1,effects:[],resolve(e=!1,n=!1){let{vnode:l,activeBranch:r,pendingBranch:s,pendingId:o,effects:a,parentComponent:u,container:c}=C,p=!1;C.isHydrating?C.isHydrating=!1:!e&&((p=r&&s.transition&&"out-in"===s.transition.mode)&&(r.transition.afterLeave=()=>{o===C.pendingId&&(d(s,c,i===S?g(r):i,0),t7(a))}),r&&(m(r.el)===c&&(i=g(r)),h(r,u,C,!0)),p||d(s,c,i,0)),rz(C,s),C.pendingBranch=null,C.isInFallback=!1;let _=C.parent,b=!1;for(;_;){if(_.pendingBranch){_.effects.push(...a),b=!0;break}_=_.parent}b||p||t7(a),C.effects=[],y&&t&&t.pendingBranch&&f===t.pendingId&&(t.deps--,0!==t.deps||n||t.resolve()),r$(l,"onResolve")},fallback(e){if(!C.pendingBranch)return;let{vnode:t,activeBranch:n,parentComponent:l,container:r,namespace:i}=C;r$(t,"onFallback");let s=g(n),u=()=>{C.isInFallback&&(p(null,e,r,s,l,null,i,o,a),rz(C,e))},c=e.transition&&"out-in"===e.transition.mode;c&&(n.transition.afterLeave=u),C.isInFallback=!0,h(n,l,null,!0),c||u()},move(e,t,n){C.activeBranch&&d(C.activeBranch,e,t,n),C.container=e},next:()=>C.activeBranch&&g(C.activeBranch),registerDep(e,t,n){let l=!!C.pendingBranch;l&&C.deps++;let r=e.vnode.el;e.asyncDep.catch(t=>{tY(t,e,0)}).then(i=>{if(e.isUnmounted||C.isUnmounted||C.pendingId!==e.suspenseId)return;e.asyncResolved=!0;let{vnode:o}=e;iw(e,i,!1),r&&(o.el=r);let a=!r&&e.subTree.el;t(e,o,m(r||e.subTree.el),r?null:g(e.subTree),C,s,n),a&&_(a),rV(e,o.el),l&&0==--C.deps&&C.resolve()})},unmount(e,t){C.isUnmounted=!0,C.activeBranch&&h(C.activeBranch,n,e,t),C.pendingBranch&&h(C.pendingBranch,n,e,t)}};return C}function rW(e){let t;if(O(e)){let n=r1&&e._c;n&&(e._d=!1,rQ()),e=e(),n&&(e._d=!0,t=rY,r0())}return k(e)&&(e=function(e,t=!0){let n;for(let t=0;tt!==e)),e}function rK(e,t){t&&t.pendingBranch?k(e)?t.effects.push(...e):t.effects.push(e):t7(e)}function rz(e,t){e.activeBranch=t;let{vnode:n,parentComponent:l}=e,r=t.el;for(;!r&&t.component;)r=(t=t.component.subTree).el;n.el=r,l&&l.subTree===n&&(l.vnode.el=r,rV(l,r))}let rq=Symbol.for("v-fgt"),rG=Symbol.for("v-txt"),rJ=Symbol.for("v-cmt"),rX=Symbol.for("v-stc"),rZ=[],rY=null;function rQ(e=!1){rZ.push(rY=e?null:[])}function r0(){rZ.pop(),rY=rZ[rZ.length-1]||null}let r1=1;function r2(e,t=!1){r1+=e,e<0&&rY&&t&&(rY.hasOnce=!0)}function r6(e){return e.dynamicChildren=r1>0?rY||m:null,r0(),r1>0&&rY&&rY.push(e),e}function r8(e,t,n,l,r,i){return r6(it(e,t,n,l,r,i,!0))}function r4(e,t,n,l,r){return r6(il(e,t,n,l,r,!0))}function r3(e){return!!e&&!0===e.__v_isVNode}function r5(e,t){return e.type===t.type&&e.key===t.key}function r9(e){}let r7=({key:e})=>null!=e?e:null,ie=({ref:e,ref_key:t,ref_for:n})=>("number"==typeof e&&(e=""+e),null!=e?N(e)||tx(e)||O(e)?{i:nl,r:e,k:t,f:!!n}:e:null);function it(e,t=null,n=null,l=0,r=null,i=+(e!==rq),s=!1,o=!1){let a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&r7(t),ref:t&&ie(t),scopeId:nr,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:l,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:nl};return o?(ip(a,n),128&i&&e.normalize(a)):n&&(a.shapeFlag|=N(n)?8:16),r1>0&&!s&&rY&&(a.patchFlag>0||6&i)&&32!==a.patchFlag&&rY.push(a),a}let il=function(e,t=null,n=null,l=0,r=null,i=!1){var s;if(e&&e!==lm||(e=rJ),r3(e)){let l=ii(e,t,!0);return n&&ip(l,n),r1>0&&!i&&rY&&(6&l.shapeFlag?rY[rY.indexOf(e)]=l:rY.push(l)),l.patchFlag=-2,l}if(O(s=e)&&"__vccOpts"in s&&(e=e.__vccOpts),t){let{class:e,style:n}=t=ir(t);e&&!N(e)&&(t.class=er(e)),M(n)&&(t_(n)&&!k(n)&&(n=C({},n)),t.style=ee(n))}let o=N(e)?1:rU(e)?128:e.__isTeleport?64:M(e)?4:2*!!O(e);return it(e,t,n,l,r,o,i,!0)};function ir(e){return e?t_(e)||rt(e)?C({},e):e:null}function ii(e,t,n=!1,l=!1){let{props:r,ref:i,patchFlag:s,children:o,transition:a}=e,u=t?id(r||{},t):r,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&r7(u),ref:t&&t.ref?n&&i?k(i)?i.concat(ie(t)):[i,ie(t)]:ie(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:o,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==rq?-1===s?16:16|s:s,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&ii(e.ssContent),ssFallback:e.ssFallback&&ii(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&l&&nL(c,a.clone(c)),c}function is(e=" ",t=0){return il(rG,null,e,t)}function io(e,t){let n=il(rX,null,e);return n.staticCount=t,n}function ia(e="",t=!1){return t?(rQ(),r4(rJ,null,e)):il(rJ,null,e)}function iu(e){return null==e||"boolean"==typeof e?il(rJ):k(e)?il(rq,null,e.slice()):r3(e)?ic(e):il(rG,null,String(e))}function ic(e){return null===e.el&&-1!==e.patchFlag||e.memo?e:ii(e)}function ip(e,t){let n=0,{shapeFlag:l}=e;if(null==t)t=null;else if(k(t))n=16;else if("object"==typeof t)if(65&l){let n=t.default;n&&(n._c&&(n._d=!1),ip(e,n()),n._c&&(n._d=!0));return}else{n=32;let l=t._;l||rt(t)?3===l&&nl&&(1===nl.slots._?t._=1:(t._=2,e.patchFlag|=1024)):t._ctx=nl}else O(t)?(t={default:t,_ctx:nl},n=32):(t=String(t),64&l?(n=16,t=[is(t)]):n=8);e.children=t,e.shapeFlag|=n}function id(...e){let t={};for(let n=0;n{u=!0;let[l,r]=e(t,n,!0);C(o,l),r&&a.push(...r)};!l&&n.mixins.length&&n.mixins.forEach(r),t.extends&&r(t.extends),t.mixins&&t.mixins.forEach(r)}if(!s&&!u)return M(t)&&r.set(t,m),m;if(k(s))for(let e=0;e{let l=e(t,n,!0);l&&(a=!0,C(o,l))};!l&&n.mixins.length&&n.mixins.forEach(r),t.extends&&r(t.extends),t.mixins&&t.mixins.forEach(r)}return s||a?(k(s)?s.forEach(e=>o[e]=null):C(o,s),M(t)&&r.set(t,o),o):(M(t)&&r.set(t,null),null)}(l,r),emit:null,emitted:null,propsDefaults:g,inheritAttrs:l.inheritAttrs,ctx:g,data:g,props:g,attrs:g,slots:g,refs:g,setupState:g,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return i.ctx={_:i},i.root=t?t.root:i,i.emit=rP.bind(null,i),e.ce&&e.ce(i),i}let i_=null,iy=()=>i_||nl;{let e=Y(),t=(t,n)=>{let l;return(l=e[t])||(l=e[t]=[]),l.push(n),e=>{l.length>1?l.forEach(t=>t(e)):l[0](e)}};o=t("__VUE_INSTANCE_SETTERS__",e=>i_=e),a=t("__VUE_SSR_SETTERS__",e=>ix=e)}let ib=e=>{let t=i_;return o(e),e.scope.on(),()=>{e.scope.off(),o(t)}},iS=()=>{i_&&i_.scope.off(),o(null)};function iC(e){return 4&e.vnode.shapeFlag}let ix=!1;function iE(e,t=!1,n=!1){t&&a(t);let{props:l,children:r}=e.vnode,i=iC(e);!function(e,t,n,l=!1){let r={},i=re();for(let n in e.propsDefaults=Object.create(null),rn(e,t,r,i),e.propsOptions[0])n in r||(r[n]=void 0);n?e.props=l?r:tf(r):e.type.props?e.props=r:e.props=i,e.attrs=i}(e,l,i,t),((e,t,n)=>{let l=e.slots=re();if(32&e.vnode.shapeFlag){let e=t.__;e&&J(l,"__",e,!0);let r=t._;r?(rf(l,t,n),n&&J(l,"_",r,!0)):ru(t,l)}else t&&rc(e,t)})(e,r,n||t);let s=i?function(e,t){let n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,lO);let{setup:l}=n;if(l){eN();let n=e.setupContext=l.length>1?iO(e):null,r=ib(e),i=tX(l,e,0,[e.props,n]),s=I(i);if(eP(),r(),(s||e.sp)&&!n2(e)&&nU(e),s){if(i.then(iS,iS),t)return i.then(n=>{iw(e,n,t)}).catch(t=>{tY(t,e,0)});e.asyncDep=i}else iw(e,i,t)}else iA(e,t)}(e,t):void 0;return t&&a(!1),s}function iw(e,t,n){O(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:M(t)&&(e.setupState=tP(t)),iA(e,n)}function ik(e){u=e,c=e=>{e.render._rc&&(e.withProxy=new Proxy(e.ctx,lN))}}let iT=()=>!u;function iA(e,t,n){let l=e.type;if(!e.render){if(!t&&u&&!l.render){let t=l.template||lJ(e).template;if(t){let{isCustomElement:n,compilerOptions:r}=e.appContext.config,{delimiters:i,compilerOptions:s}=l,o=C(C({isCustomElement:n,delimiters:i},r),s);l.render=u(t,o)}}e.render=l.render||_,c&&c(e)}{let t=ib(e);eN();try{!function(e){let t=lJ(e),n=e.proxy,l=e.ctx;lq=!1,t.beforeCreate&&lG(t.beforeCreate,e,"bc");let{data:r,computed:i,methods:s,watch:o,provide:a,inject:u,created:c,beforeMount:f,mounted:p,beforeUpdate:d,updated:h,activated:g,deactivated:m,beforeDestroy:y,beforeUnmount:b,destroyed:S,unmounted:C,render:x,renderTracked:E,renderTriggered:w,errorCaptured:T,serverPrefetch:A,expose:R,inheritAttrs:P,components:I,directives:L,filters:D}=t;if(u&&function(e,t,n=_){for(let n in k(e)&&(e=lQ(e)),e){let l,r=e[n];tx(l=M(r)?"default"in r?l5(r.from||n,r.default,!0):l5(r.from||n):l5(r))?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>l.value,set:e=>l.value=e}):t[n]=l}}(u,l,null),s)for(let e in s){let t=s[e];O(t)&&(l[e]=t.bind(n))}if(r){let t=r.call(n,n);M(t)&&(e.data=tc(t))}if(lq=!0,i)for(let e in i){let t=i[e],r=O(t)?t.bind(n,n):O(t.get)?t.get.bind(n,n):_,s=iM({get:r,set:!O(t)&&O(t.set)?t.set.bind(n):_});Object.defineProperty(l,e,{enumerable:!0,configurable:!0,get:()=>s.value,set:e=>s.value=e})}if(o)for(let e in o)!function e(t,n,l,r){let i=r.includes(".")?rR(l,r):()=>l[r];if(N(t)){let e=n[t];O(e)&&rk(i,e)}else if(O(t))rk(i,t.bind(l));else if(M(t))if(k(t))t.forEach(t=>e(t,n,l,r));else{let e=O(t.handler)?t.handler.bind(l):n[t.handler];O(e)&&rk(i,e,t)}}(o[e],l,n,e);if(a){let e=O(a)?a.call(n):a;Reflect.ownKeys(e).forEach(t=>{l3(t,e[t])})}function F(e,t){k(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(c&&lG(c,e,"c"),F(li,f),F(ls,p),F(lo,d),F(la,h),F(n9,g),F(n7,m),F(lh,T),F(ld,E),F(lp,w),F(lu,b),F(lc,C),F(lf,A),k(R))if(R.length){let t=e.exposed||(e.exposed={});R.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t})})}else e.exposed||(e.exposed={});x&&e.render===_&&(e.render=x),null!=P&&(e.inheritAttrs=P),I&&(e.components=I),L&&(e.directives=L),A&&nU(e)}(e)}finally{eP(),t()}}}let iR={get:(e,t)=>(eB(e,"get",""),e[t])};function iO(e){return{attrs:new Proxy(e.attrs,iR),slots:e.slots,emit:e.emit,expose:t=>{e.exposed=t||{}}}}function iN(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(tP(tb(e.exposed)),{get:(t,n)=>n in t?t[n]:n in lA?lA[n](e):void 0,has:(e,t)=>t in e||t in lA})):e.proxy}function iP(e,t=!0){return O(e)?e.displayName||e.name:e.name||t&&e.__name}let iM=(e,t)=>(function(e,t,n=!1){let l,r;return O(e)?l=e:(l=e.get,r=e.set),new tj(l,r,n)})(e,0,ix);function iI(e,t,n){let l=arguments.length;return 2!==l?(l>3?n=Array.prototype.slice.call(arguments,2):3===l&&r3(n)&&(n=[n]),il(e,t,n)):!M(t)||k(t)?il(e,null,t):r3(t)?il(e,null,[t]):il(e,t)}function iL(){}function iD(e,t,n,l){let r=n[l];if(r&&iF(r,e))return r;let i=t();return i.memo=e.slice(),i.cacheIndex=l,n[l]=i}function iF(e,t){let n=e.memo;if(n.length!=t.length)return!1;for(let e=0;e0&&rY&&rY.push(e),!0}let iV="3.5.17",iU=_,ij=null,iB=void 0,i$=_,iH={createComponentInstance:im,setupComponent:iE,renderComponentRoot:rI,setCurrentRenderingInstance:ni,isVNode:r3,normalizeVNode:iu,getComponentPublicInstance:iN,ensureValidVNode:lw,pushWarningContext:function(e){},popWarningContext:function(){}},iW=null,iK=null,iz=null,iq="undefined"!=typeof window&&window.trustedTypes;if(iq)try{d=iq.createPolicy("vue",{createHTML:e=>e})}catch(e){}let iG=d?e=>d.createHTML(e):e=>e,iJ="undefined"!=typeof document?document:null,iX=iJ&&iJ.createElement("template"),iZ="transition",iY="animation",iQ=Symbol("_vtc"),i0={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},i1=C({},nT,i0),i2=((e=(e,{slots:t})=>iI(nO,i4(e),t)).displayName="Transition",e.props=i1,e),i6=(e,t=[])=>{k(e)?e.forEach(e=>e(...t)):e&&e(...t)},i8=e=>!!e&&(k(e)?e.some(e=>e.length>1):e.length>1);function i4(e){let t={};for(let n in e)n in i0||(t[n]=e[n]);if(!1===e.css)return t;let{name:n="v",type:l,duration:r,enterFromClass:i=`${n}-enter-from`,enterActiveClass:s=`${n}-enter-active`,enterToClass:o=`${n}-enter-to`,appearFromClass:a=i,appearActiveClass:u=s,appearToClass:c=o,leaveFromClass:f=`${n}-leave-from`,leaveActiveClass:p=`${n}-leave-active`,leaveToClass:d=`${n}-leave-to`}=e,h=function(e){if(null==e)return null;{if(M(e))return[function(e){return Z(e)}(e.enter),function(e){return Z(e)}(e.leave)];let t=function(e){return Z(e)}(e);return[t,t]}}(r),g=h&&h[0],m=h&&h[1],{onBeforeEnter:_,onEnter:y,onEnterCancelled:b,onLeave:S,onLeaveCancelled:x,onBeforeAppear:E=_,onAppear:w=y,onAppearCancelled:k=b}=t,T=(e,t,n,l)=>{e._enterCancelled=l,i5(e,t?c:o),i5(e,t?u:s),n&&n()},A=(e,t)=>{e._isLeaving=!1,i5(e,f),i5(e,d),i5(e,p),t&&t()},R=e=>(t,n)=>{let r=e?w:y,s=()=>T(t,e,n);i6(r,[t,s]),i9(()=>{i5(t,e?a:i),i3(t,e?c:o),i8(r)||se(t,l,g,s)})};return C(t,{onBeforeEnter(e){i6(_,[e]),i3(e,i),i3(e,s)},onBeforeAppear(e){i6(E,[e]),i3(e,a),i3(e,u)},onEnter:R(!1),onAppear:R(!0),onLeave(e,t){e._isLeaving=!0;let n=()=>A(e,t);i3(e,f),e._enterCancelled?(i3(e,p),sr()):(sr(),i3(e,p)),i9(()=>{e._isLeaving&&(i5(e,f),i3(e,d),i8(S)||se(e,l,m,n))}),i6(S,[e,n])},onEnterCancelled(e){T(e,!1,void 0,!0),i6(b,[e])},onAppearCancelled(e){T(e,!0,void 0,!0),i6(k,[e])},onLeaveCancelled(e){A(e),i6(x,[e])}})}function i3(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.add(t)),(e[iQ]||(e[iQ]=new Set)).add(t)}function i5(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.remove(t));let n=e[iQ];n&&(n.delete(t),n.size||(e[iQ]=void 0))}function i9(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let i7=0;function se(e,t,n,l){let r=e._endId=++i7,i=()=>{r===e._endId&&l()};if(null!=n)return setTimeout(i,n);let{type:s,timeout:o,propCount:a}=st(e,t);if(!s)return l();let u=s+"end",c=0,f=()=>{e.removeEventListener(u,p),i()},p=t=>{t.target===e&&++c>=a&&f()};setTimeout(()=>{c(n[e]||"").split(", "),r=l(`${iZ}Delay`),i=l(`${iZ}Duration`),s=sn(r,i),o=l(`${iY}Delay`),a=l(`${iY}Duration`),u=sn(o,a),c=null,f=0,p=0;t===iZ?s>0&&(c=iZ,f=s,p=i.length):t===iY?u>0&&(c=iY,f=u,p=a.length):p=(c=(f=Math.max(s,u))>0?s>u?iZ:iY:null)?c===iZ?i.length:a.length:0;let d=c===iZ&&/\b(transform|all)(,|$)/.test(l(`${iZ}Property`).toString());return{type:c,timeout:f,propCount:p,hasTransform:d}}function sn(e,t){for(;e.lengthsl(t)+sl(e[n])))}function sl(e){return"auto"===e?0:1e3*Number(e.slice(0,-1).replace(",","."))}function sr(){return document.body.offsetHeight}let si=Symbol("_vod"),ss=Symbol("_vsh"),so={beforeMount(e,{value:t},{transition:n}){e[si]="none"===e.style.display?"":e.style.display,n&&t?n.beforeEnter(e):sa(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:l}){!t!=!n&&(l?t?(l.beforeEnter(e),sa(e,!0),l.enter(e)):l.leave(e,()=>{sa(e,!1)}):sa(e,t))},beforeUnmount(e,{value:t}){sa(e,t)}};function sa(e,t){e.style.display=t?e[si]:"none",e[ss]=!t}let su=Symbol("");function sc(e){let t=iy();if(!t)return;let n=t.ut=(n=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(e=>sf(e,n))},l=()=>{let l=e(t.proxy);t.ce?sf(t.ce,l):function e(t,n){if(128&t.shapeFlag){let l=t.suspense;t=l.activeBranch,l.pendingBranch&&!l.isHydrating&&l.effects.push(()=>{e(l.activeBranch,n)})}for(;t.component;)t=t.component.subTree;if(1&t.shapeFlag&&t.el)sf(t.el,n);else if(t.type===rq)t.children.forEach(t=>e(t,n));else if(t.type===rX){let{el:e,anchor:l}=t;for(;e&&(sf(e,n),e!==l);)e=e.nextSibling}}(t.subTree,l),n(l)};lo(()=>{t7(l)}),ls(()=>{rk(l,_,{flush:"post"});let e=new MutationObserver(l);e.observe(t.subTree.el.parentNode,{childList:!0}),lc(()=>e.disconnect())})}function sf(e,t){if(1===e.nodeType){let n=e.style,l="";for(let e in t)n.setProperty(`--${e}`,t[e]),l+=`--${e}: ${t[e]};`;n[su]=l}}let sp=/(^|;)\s*display\s*:/,sd=/\s*!important$/;function sh(e,t,n){if(k(n))n.forEach(n=>sh(e,t,n));else if(null==n&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{let l=function(e,t){let n=sv[t];if(n)return n;let l=$(t);if("filter"!==l&&l in e)return sv[t]=l;l=K(l);for(let n=0;n111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)>96&&123>e.charCodeAt(2),sk={};function sT(e,t,n){let l=nF(e,t);F(l)&&C(l,t);class r extends sO{constructor(e){super(l,e,n)}}return r.def=l,r}let sA=(e,t)=>sT(e,t,or),sR="undefined"!=typeof HTMLElement?HTMLElement:class{};class sO extends sR{constructor(e,t={},n=ol){super(),this._def=e,this._props=t,this._createApp=n,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._ob=null,this.shadowRoot&&n!==ol?this._root=this.shadowRoot:!1!==e.shadowRoot?(this.attachShadow({mode:"open"}),this._root=this.shadowRoot):this._root=this}connectedCallback(){if(!this.isConnected)return;this.shadowRoot||this._resolved||this._parseSlots(),this._connected=!0;let e=this;for(;e=e&&(e.parentNode||e.host);)if(e instanceof sO){this._parent=e;break}this._instance||(this._resolved?this._mount(this._def):e&&e._pendingResolve?this._pendingResolve=e._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(e=this._parent){e&&(this._instance.parent=e._instance,this._inheritParentContext(e))}_inheritParentContext(e=this._parent){e&&this._app&&Object.setPrototypeOf(this._app._context.provides,e._instance.provides)}disconnectedCallback(){this._connected=!1,t3(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null)})}_resolveDef(){if(this._pendingResolve)return;for(let e=0;e{for(let t of e)this._setAttr(t.attributeName)}),this._ob.observe(this,{attributes:!0});let e=(e,t=!1)=>{let n;this._resolved=!0,this._pendingResolve=void 0;let{props:l,styles:r}=e;if(l&&!k(l))for(let e in l){let t=l[e];(t===Number||t&&t.type===Number)&&(e in this._props&&(this._props[e]=Z(this._props[e])),(n||(n=Object.create(null)))[$(e)]=!0)}this._numberProps=n,this._resolveProps(e),this.shadowRoot&&this._applyStyles(r),this._mount(e)},t=this._def.__asyncLoader;t?this._pendingResolve=t().then(t=>{t.configureApp=this._def.configureApp,e(this._def=t,!0)}):e(this._def)}_mount(e){this._app=this._createApp(e),this._inheritParentContext(),e.configureApp&&e.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);let t=this._instance&&this._instance.exposed;if(t)for(let e in t)w(this,e)||Object.defineProperty(this,e,{get:()=>tR(t[e])})}_resolveProps(e){let{props:t}=e,n=k(t)?t:Object.keys(t||{});for(let e of Object.keys(this))"_"!==e[0]&&n.includes(e)&&this._setProp(e,this[e]);for(let e of n.map($))Object.defineProperty(this,e,{get(){return this._getProp(e)},set(t){this._setProp(e,t,!0,!0)}})}_setAttr(e){if(e.startsWith("data-v-"))return;let t=this.hasAttribute(e),n=t?this.getAttribute(e):sk,l=$(e);t&&this._numberProps&&this._numberProps[l]&&(n=Z(n)),this._setProp(l,n,!1,!0)}_getProp(e){return this._props[e]}_setProp(e,t,n=!0,l=!1){if(t!==this._props[e]&&(t===sk?delete this._props[e]:(this._props[e]=t,"key"===e&&this._app&&(this._app._ceVNode.key=t)),l&&this._instance&&this._update(),n)){let n=this._ob;n&&n.disconnect(),!0===t?this.setAttribute(W(e),""):"string"==typeof t||"number"==typeof t?this.setAttribute(W(e),t+""):t||this.removeAttribute(W(e)),n&&n.observe(this,{attributes:!0})}}_update(){let e=this._createVNode();this._app&&(e.appContext=this._app._context),ot(e,this._root)}_createVNode(){let e={};this.shadowRoot||(e.onVnodeMounted=e.onVnodeUpdated=this._renderSlots.bind(this));let t=il(this._def,C(e,this._props));return this._instance||(t.ce=e=>{this._instance=e,e.ce=this,e.isCE=!0;let t=(e,t)=>{this.dispatchEvent(new CustomEvent(e,F(t[0])?C({detail:t},t[0]):{detail:t}))};e.emit=(e,...n)=>{t(e,n),W(e)!==e&&t(W(e),n)},this._setParent()}),t}_applyStyles(e,t){if(!e)return;if(t){if(t===this._def||this._styleChildren.has(t))return;this._styleChildren.add(t)}let n=this._nonce;for(let t=e.length-1;t>=0;t--){let l=document.createElement("style");n&&l.setAttribute("nonce",n),l.textContent=e[t],this.shadowRoot.prepend(l)}}_parseSlots(){let e,t=this._slots={};for(;e=this.firstChild;){let n=1===e.nodeType&&e.getAttribute("slot")||"default";(t[n]||(t[n]=[])).push(e),this.removeChild(e)}}_renderSlots(){let e=(this._teleportTarget||this).querySelectorAll("slot"),t=this._instance.type.__scopeId;for(let n=0;n{if(!n.length)return;let t=e.moveClass||`${e.name||"v"}-move`;if(!function(e,t,n){let l=e.cloneNode(),r=e[iQ];r&&r.forEach(e=>{e.split(/\s+/).forEach(e=>e&&l.classList.remove(e))}),n.split(/\s+/).forEach(e=>e&&l.classList.add(e)),l.style.display="none";let i=1===t.nodeType?t:t.parentNode;i.appendChild(l);let{hasTransform:s}=st(l);return i.removeChild(l),s}(n[0].el,r.vnode.el,t)){n=[];return}n.forEach(sU),n.forEach(sj);let l=n.filter(sB);sr(),l.forEach(e=>{let n=e.el,l=n.style;i3(n,t),l.transform=l.webkitTransform=l.transitionDuration="";let r=n[sD]=e=>{(!e||e.target===n)&&(!e||/transform$/.test(e.propertyName))&&(n.removeEventListener("transitionend",r),n[sD]=null,i5(n,t))};n.addEventListener("transitionend",r)}),n=[]}),()=>{let s=ty(e),o=i4(s),a=s.tag||rq;if(n=[],l)for(let e=0;e{let t=e.props["onUpdate:modelValue"]||!1;return k(t)?e=>G(t,e):t};function sH(e){e.target.composing=!0}function sW(e){let t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}let sK=Symbol("_assign"),sz={created(e,{modifiers:{lazy:t,trim:n,number:l}},r){e[sK]=s$(r);let i=l||r.props&&"number"===r.props.type;sb(e,t?"change":"input",t=>{if(t.target.composing)return;let l=e.value;n&&(l=l.trim()),i&&(l=X(l)),e[sK](l)}),n&&sb(e,"change",()=>{e.value=e.value.trim()}),t||(sb(e,"compositionstart",sH),sb(e,"compositionend",sW),sb(e,"change",sW))},mounted(e,{value:t}){e.value=null==t?"":t},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:l,trim:r,number:i}},s){if(e[sK]=s$(s),e.composing)return;let o=(i||"number"===e.type)&&!/^0\d/.test(e.value)?X(e.value):e.value,a=null==t?"":t;if(o!==a){if(document.activeElement===e&&"range"!==e.type&&(l&&t===n||r&&e.value.trim()===a))return;e.value=a}}},sq={deep:!0,created(e,t,n){e[sK]=s$(n),sb(e,"change",()=>{let t=e._modelValue,n=sY(e),l=e.checked,r=e[sK];if(k(t)){let e=ea(t,n),i=-1!==e;if(l&&!i)r(t.concat(n));else if(!l&&i){let n=[...t];n.splice(e,1),r(n)}}else if(A(t)){let e=new Set(t);l?e.add(n):e.delete(n),r(e)}else r(sQ(e,l))})},mounted:sG,beforeUpdate(e,t,n){e[sK]=s$(n),sG(e,t,n)}};function sG(e,{value:t,oldValue:n},l){let r;if(e._modelValue=t,k(t))r=ea(t,l.props.value)>-1;else if(A(t))r=t.has(l.props.value);else{if(t===n)return;r=eo(t,sQ(e,!0))}e.checked!==r&&(e.checked=r)}let sJ={created(e,{value:t},n){e.checked=eo(t,n.props.value),e[sK]=s$(n),sb(e,"change",()=>{e[sK](sY(e))})},beforeUpdate(e,{value:t,oldValue:n},l){e[sK]=s$(l),t!==n&&(e.checked=eo(t,l.props.value))}},sX={deep:!0,created(e,{value:t,modifiers:{number:n}},l){let r=A(t);sb(e,"change",()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?X(sY(e)):sY(e));e[sK](e.multiple?r?new Set(t):t:t[0]),e._assigning=!0,t3(()=>{e._assigning=!1})}),e[sK]=s$(l)},mounted(e,{value:t}){sZ(e,t)},beforeUpdate(e,t,n){e[sK]=s$(n)},updated(e,{value:t}){e._assigning||sZ(e,t)}};function sZ(e,t){let n=e.multiple,l=k(t);if(!n||l||A(t)){for(let r=0,i=e.options.length;rString(e)===String(s)):i.selected=ea(t,s)>-1}else i.selected=t.has(s);else if(eo(sY(i),t)){e.selectedIndex!==r&&(e.selectedIndex=r);return}}n||-1===e.selectedIndex||(e.selectedIndex=-1)}}function sY(e){return"_value"in e?e._value:e.value}function sQ(e,t){let n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}let s0={created(e,t,n){s2(e,t,n,null,"created")},mounted(e,t,n){s2(e,t,n,null,"mounted")},beforeUpdate(e,t,n,l){s2(e,t,n,l,"beforeUpdate")},updated(e,t,n,l){s2(e,t,n,l,"updated")}};function s1(e,t){switch(e){case"SELECT":return sX;case"TEXTAREA":return sz;default:switch(t){case"checkbox":return sq;case"radio":return sJ;default:return sz}}}function s2(e,t,n,l,r){let i=s1(e.tagName,n.props&&n.props.type)[r];i&&i(e,t,n,l)}let s6=["ctrl","shift","alt","meta"],s8={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&0!==e.button,middle:e=>"button"in e&&1!==e.button,right:e=>"button"in e&&2!==e.button,exact:(e,t)=>s6.some(n=>e[`${n}Key`]&&!t.includes(n))},s4=(e,t)=>{let n=e._withMods||(e._withMods={}),l=t.join(".");return n[l]||(n[l]=(n,...l)=>{for(let e=0;e{let n=e._withKeys||(e._withKeys={}),l=t.join(".");return n[l]||(n[l]=n=>{if(!("key"in n))return;let l=W(n.key);if(t.some(e=>e===l||s3[e]===l))return e(n)})},s9=C({patchProp:(e,t,n,l,r,i)=>{let s="svg"===r;if("class"===t){var o=l;let t=e[iQ];t&&(o=(o?[o,...t]:[...t]).join(" ")),null==o?e.removeAttribute("class"):s?e.setAttribute("class",o):e.className=o}else"style"===t?function(e,t,n){let l=e.style,r=N(n),i=!1;if(n&&!r){if(t)if(N(t))for(let e of t.split(";")){let t=e.slice(0,e.indexOf(":")).trim();null==n[t]&&sh(l,t,"")}else for(let e in t)null==n[e]&&sh(l,e,"");for(let e in n)"display"===e&&(i=!0),sh(l,e,n[e])}else if(r){if(t!==n){let e=l[su];e&&(n+=";"+e),l.cssText=n,i=sp.test(n)}}else t&&e.removeAttribute("style");si in e&&(e[si]=i?l.display:"",e[ss]&&(l.display="none"))}(e,n,l):b(t)?S(t)||function(e,t,n,l,r=null){let i=e[sS]||(e[sS]={}),s=i[t];if(l&&s)s.value=l;else{let[n,o]=function(e){let t;if(sC.test(e)){let n;for(t={};n=e.match(sC);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[":"===e[2]?e.slice(3):W(e.slice(2)),t]}(t);if(l)sb(e,n,i[t]=function(e,t){let n=e=>{if(e._vts){if(e._vts<=n.attached)return}else e._vts=Date.now();tZ(function(e,t){if(!k(t))return t;{let n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(e=>t=>!t._stopped&&e&&e(t))}}(e,n.value),t,5,[e])};return n.value=e,n.attached=sx||(sE.then(()=>sx=0),sx=Date.now()),n}(l,r),o);else s&&(e.removeEventListener(n,s,o),i[t]=void 0)}}(e,t,0,l,i):("."===t[0]?(t=t.slice(1),0):"^"===t[0]?(t=t.slice(1),1):!function(e,t,n,l){if(l)return!!("innerHTML"===t||"textContent"===t||t in e&&sw(t)&&O(n));if("spellcheck"===t||"draggable"===t||"translate"===t||"autocorrect"===t||"form"===t||"list"===t&&"INPUT"===e.tagName||"type"===t&&"TEXTAREA"===e.tagName)return!1;if("width"===t||"height"===t){let t=e.tagName;if("IMG"===t||"VIDEO"===t||"CANVAS"===t||"SOURCE"===t)return!1}return!(sw(t)&&N(n))&&t in e}(e,t,l,s))?e._isVueCE&&(/[A-Z]/.test(t)||!N(l))?sy(e,$(t),l,i,t):("true-value"===t?e._trueValue=l:"false-value"===t&&(e._falseValue=l),s_(e,t,l,s)):(sy(e,t,l),e.tagName.includes("-")||"value"!==t&&"checked"!==t&&"selected"!==t||s_(e,t,l,s,i,"value"!==t))}},{insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,l)=>{let r="svg"===t?iJ.createElementNS("http://www.w3.org/2000/svg",e):"mathml"===t?iJ.createElementNS("http://www.w3.org/1998/Math/MathML",e):n?iJ.createElement(e,{is:n}):iJ.createElement(e);return"select"===e&&l&&null!=l.multiple&&r.setAttribute("multiple",l.multiple),r},createText:e=>iJ.createTextNode(e),createComment:e=>iJ.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>iJ.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,l,r,i){let s=n?n.previousSibling:t.lastChild;if(r&&(r===i||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),r!==i&&(r=r.nextSibling););else{iX.innerHTML=iG("svg"===l?`${e}`:"mathml"===l?`${e}`:e);let r=iX.content;if("svg"===l||"mathml"===l){let e=r.firstChild;for(;e.firstChild;)r.appendChild(e.firstChild);r.removeChild(e)}t.insertBefore(r,n)}return[s?s.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}}),s7=!1;function oe(){return f=s7?f:rh(s9),s7=!0,f}let ot=(...e)=>{(f||(f=rd(s9))).render(...e)},on=(...e)=>{oe().hydrate(...e)},ol=(...e)=>{let t=(f||(f=rd(s9))).createApp(...e),{mount:n}=t;return t.mount=e=>{let l=os(e);if(!l)return;let r=t._component;O(r)||r.render||r.template||(r.template=l.innerHTML),1===l.nodeType&&(l.textContent="");let i=n(l,!1,oi(l));return l instanceof Element&&(l.removeAttribute("v-cloak"),l.setAttribute("data-v-app","")),i},t},or=(...e)=>{let t=oe().createApp(...e),{mount:n}=t;return t.mount=e=>{let t=os(e);if(t)return n(t,!0,oi(t))},t};function oi(e){return e instanceof SVGElement?"svg":"function"==typeof MathMLElement&&e instanceof MathMLElement?"mathml":void 0}function os(e){return N(e)?document.querySelector(e):e}let oo=!1,oa=()=>{oo||(oo=!0,sz.getSSRProps=({value:e})=>({value:e}),sJ.getSSRProps=({value:e},t)=>{if(t.props&&eo(t.props.value,e))return{checked:!0}},sq.getSSRProps=({value:e},t)=>{if(k(e)){if(t.props&&ea(e,t.props.value)>-1)return{checked:!0}}else if(A(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},s0.getSSRProps=(e,t)=>{if("string"!=typeof t.type)return;let n=s1(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)},so.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}})},ou=()=>{};export{nO as BaseTransition,nT as BaseTransitionPropsValidators,rJ as Comment,iz as DeprecationTypes,ed as EffectScope,tJ as ErrorCodes,ij as ErrorTypeStrings,rq as Fragment,n3 as KeepAlive,e_ as ReactiveEffect,rX as Static,rB as Suspense,nb as Teleport,rG as Text,tB as TrackOpTypes,i2 as Transition,sV as TransitionGroup,t$ as TriggerOpTypes,sO as VueElement,tG as assertNumber,tZ as callWithAsyncErrorHandling,tX as callWithErrorHandling,$ as camelize,K as capitalize,ii as cloneVNode,iK as compatUtils,ou as compile,iM as computed,ol as createApp,r4 as createBlock,ia as createCommentVNode,r8 as createElementBlock,it as createElementVNode,rh as createHydrationRenderer,lK as createPropsRestProxy,rd as createRenderer,or as createSSRApp,lx as createSlots,io as createStaticVNode,is as createTextVNode,il as createVNode,tI as customRef,n6 as defineAsyncComponent,nF as defineComponent,sT as defineCustomElement,lM as defineEmits,lI as defineExpose,lF as defineModel,lL as defineOptions,lP as defineProps,sA as defineSSRCustomElement,lD as defineSlots,iB as devtools,eT as effect,eh as effectScope,iy as getCurrentInstance,eg as getCurrentScope,tK as getCurrentWatcher,nD as getTransitionRawChildren,ir as guardReactiveProps,iI as h,tY as handleError,l9 as hasInjectionContext,on as hydrate,nY as hydrateOnIdle,n1 as hydrateOnInteraction,n0 as hydrateOnMediaQuery,nQ as hydrateOnVisible,iL as initCustomFormatter,oa as initDirectivesForSSR,l5 as inject,iF as isMemoSame,t_ as isProxy,tg as isReactive,tv as isReadonly,tx as isRef,iT as isRuntimeOnly,tm as isShallow,r3 as isVNode,tb as markRaw,lH as mergeDefaults,lW as mergeModels,id as mergeProps,t3 as nextTick,er as normalizeClass,ei as normalizeProps,ee as normalizeStyle,n9 as onActivated,li as onBeforeMount,lu as onBeforeUnmount,lo as onBeforeUpdate,n7 as onDeactivated,lh as onErrorCaptured,ls as onMounted,ld as onRenderTracked,lp as onRenderTriggered,ev as onScopeDispose,lf as onServerPrefetch,lc as onUnmounted,la as onUpdated,tz as onWatcherCleanup,rQ as openBlock,no as popScopeId,l3 as provide,tP as proxyRefs,ns as pushScopeId,t7 as queuePostFlushCb,tc as reactive,tp as readonly,tE as ref,ik as registerRuntimeCompiler,ot as render,lC as renderList,lE as renderSlot,lv as resolveComponent,ly as resolveDirective,l_ as resolveDynamicComponent,iW as resolveFilter,nP as resolveTransitionHooks,r2 as setBlockTracking,i$ as setDevtoolsHook,nL as setTransitionHooks,tf as shallowReactive,td as shallowReadonly,tw as shallowRef,rS as ssrContextKey,iH as ssrUtils,eA as stop,ec as toDisplayString,z as toHandlerKey,lk as toHandlers,ty as toRaw,tV as toRef,tL as toRefs,tO as toValue,r9 as transformVNodeArgs,tA as triggerRef,tR as unref,lj as useAttrs,sM as useCssModule,sc as useCssVars,sN as useHost,nV as useId,rO as useModel,rC as useSSRContext,sP as useShadowRoot,lU as useSlots,nj as useTemplateRef,nw as useTransitionState,sq as vModelCheckbox,s0 as vModelDynamic,sJ as vModelRadio,sX as vModelSelect,sz as vModelText,so as vShow,iV as version,iU as warn,rk as watch,rx as watchEffect,rE as watchPostEffect,rw as watchSyncEffect,lz as withAsyncContext,nu as withCtx,lV as withDefaults,nc as withDirectives,s5 as withKeys,iD as withMemo,s4 as withModifiers,na as withScopeId}; diff --git a/node_modules/vue/dist/vue.runtime.esm-bundler.js b/node_modules/vue/dist/vue.runtime.esm-bundler.js index 5f119d9..97c59a6 100644 --- a/node_modules/vue/dist/vue.runtime.esm-bundler.js +++ b/node_modules/vue/dist/vue.runtime.esm-bundler.js @@ -1,5 +1,5 @@ /** -* vue v3.5.13 +* vue v3.5.17 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/ diff --git a/node_modules/vue/dist/vue.runtime.global.js b/node_modules/vue/dist/vue.runtime.global.js index cb4ce25..2ef28ef 100644 --- a/node_modules/vue/dist/vue.runtime.global.js +++ b/node_modules/vue/dist/vue.runtime.global.js @@ -1,5 +1,5 @@ /** -* vue v3.5.13 +* vue v3.5.17 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/ @@ -326,6 +326,10 @@ var Vue = (function (exports) { * @internal */ this._active = true; + /** + * @internal track `on` calls, allow `on` call multiple times + */ + this._on = 0; /** * @internal */ @@ -396,14 +400,20 @@ var Vue = (function (exports) { * @internal */ on() { - activeEffectScope = this; + if (++this._on === 1) { + this.prevScope = activeEffectScope; + activeEffectScope = this; + } } /** * This should only be called on non-detached scopes * @internal */ off() { - activeEffectScope = this.parent; + if (this._on > 0 && --this._on === 0) { + activeEffectScope = this.prevScope; + this.prevScope = void 0; + } } stop(fromParent) { if (this._active) { @@ -485,7 +495,7 @@ var Vue = (function (exports) { } resume() { if (this.flags & 64) { - this.flags &= ~64; + this.flags &= -65; if (pausedQueueEffects.has(this)) { pausedQueueEffects.delete(this); this.trigger(); @@ -525,7 +535,7 @@ var Vue = (function (exports) { cleanupDeps(this); activeSub = prevEffect; shouldTrack = prevShouldTrack; - this.flags &= ~2; + this.flags &= -3; } } stop() { @@ -536,7 +546,7 @@ var Vue = (function (exports) { this.deps = this.depsTail = void 0; cleanupEffect(this); this.onStop && this.onStop(); - this.flags &= ~1; + this.flags &= -2; } } trigger() { @@ -586,7 +596,7 @@ var Vue = (function (exports) { while (e) { const next = e.next; e.next = void 0; - e.flags &= ~8; + e.flags &= -9; e = next; } } @@ -597,7 +607,7 @@ var Vue = (function (exports) { while (e) { const next = e.next; e.next = void 0; - e.flags &= ~8; + e.flags &= -9; if (e.flags & 1) { try { ; @@ -653,17 +663,16 @@ var Vue = (function (exports) { if (computed.flags & 4 && !(computed.flags & 16)) { return; } - computed.flags &= ~16; + computed.flags &= -17; if (computed.globalVersion === globalVersion) { return; } computed.globalVersion = globalVersion; - const dep = computed.dep; - computed.flags |= 2; - if (dep.version > 0 && !computed.isSSR && computed.deps && !isDirty(computed)) { - computed.flags &= ~2; + if (!computed.isSSR && computed.flags & 128 && (!computed.deps && !computed._dirty || !isDirty(computed))) { return; } + computed.flags |= 2; + const dep = computed.dep; const prevSub = activeSub; const prevShouldTrack = shouldTrack; activeSub = computed; @@ -672,6 +681,7 @@ var Vue = (function (exports) { prepareDeps(computed); const value = computed.fn(computed._value); if (dep.version === 0 || hasChanged(value, computed._value)) { + computed.flags |= 128; computed._value = value; dep.version++; } @@ -682,7 +692,7 @@ var Vue = (function (exports) { activeSub = prevSub; shouldTrack = prevShouldTrack; cleanupDeps(computed); - computed.flags &= ~2; + computed.flags &= -3; } } function removeSub(link, soft = false) { @@ -701,7 +711,7 @@ var Vue = (function (exports) { if (dep.subs === link) { dep.subs = prevSub; if (!prevSub && dep.computed) { - dep.computed.flags &= ~4; + dep.computed.flags &= -5; for (let l = dep.computed.deps; l; l = l.nextDep) { removeSub(l, true); } @@ -777,6 +787,7 @@ var Vue = (function (exports) { } } class Dep { + // TODO isolatedDeclarations "__v_skip" constructor(computed) { this.computed = computed; this.version = 0; @@ -797,6 +808,10 @@ var Vue = (function (exports) { * Subscriber counter */ this.sc = 0; + /** + * @internal + */ + this.__v_skip = true; { this.subsHead = void 0; } @@ -1634,14 +1649,14 @@ var Vue = (function (exports) { if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) { return target; } - const existingProxy = proxyMap.get(target); - if (existingProxy) { - return existingProxy; - } const targetType = getTargetType(target); if (targetType === 0 /* INVALID */) { return target; } + const existingProxy = proxyMap.get(target); + if (existingProxy) { + return existingProxy; + } const proxy = new Proxy( target, targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers @@ -2064,11 +2079,11 @@ var Vue = (function (exports) { oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue, boundCleanup ]; + oldValue = newValue; call ? call(cb, 3, args) : ( // @ts-expect-error cb(...args) ); - oldValue = newValue; } finally { activeWatcher = currentWatcher; } @@ -2485,11 +2500,11 @@ var Vue = (function (exports) { queue.splice(i, 1); i--; if (cb.flags & 4) { - cb.flags &= ~1; + cb.flags &= -2; } cb(); if (!(cb.flags & 4)) { - cb.flags &= ~1; + cb.flags &= -2; } } } @@ -2514,10 +2529,10 @@ var Vue = (function (exports) { continue; } if (cb.flags & 4) { - cb.flags &= ~1; + cb.flags &= -2; } if (!(cb.flags & 8)) cb(); - cb.flags &= ~1; + cb.flags &= -2; } activePostFlushCbs = null; postFlushIndex = 0; @@ -2553,7 +2568,7 @@ var Vue = (function (exports) { for (; flushIndex < queue.length; flushIndex++) { const job = queue[flushIndex]; if (job) { - job.flags &= ~1; + job.flags &= -2; } } flushIndex = -1; @@ -2993,15 +3008,16 @@ var Vue = (function (exports) { updateCssVars(n2, true); } if (isTeleportDeferred(n2.props)) { + n2.el.__isMounted = false; queuePostRenderEffect(() => { mountToTarget(); - n2.el.__isMounted = true; + delete n2.el.__isMounted; }, parentSuspense); } else { mountToTarget(); } } else { - if (isTeleportDeferred(n2.props) && !n1.el.__isMounted) { + if (isTeleportDeferred(n2.props) && n1.el.__isMounted === false) { queuePostRenderEffect(() => { TeleportImpl.process( n1, @@ -3015,7 +3031,6 @@ var Vue = (function (exports) { optimized, internals ); - delete n1.el.__isMounted; }, parentSuspense); return; } @@ -3042,7 +3057,7 @@ var Vue = (function (exports) { namespace, slotScopeIds ); - traverseStaticChildren(n1, n2, true); + traverseStaticChildren(n1, n2, false); } else if (!optimized) { patchChildren( n1, @@ -4003,6 +4018,8 @@ var Vue = (function (exports) { ) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear; const content = el.content.firstChild; if (needCallTransitionHooks) { + const cls = content.getAttribute("class"); + if (cls) content.$cls = cls; transition.beforeEnter(content); } replaceNode(content, el, parentComponent); @@ -4255,7 +4272,12 @@ Server rendered element contains fewer child nodes than client vdom.` let actual; let expected; if (key === "class") { - actual = el.getAttribute("class"); + if (el.$cls) { + actual = el.$cls; + delete el.$cls; + } else { + actual = el.getAttribute("class"); + } expected = normalizeClass(clientValue); if (!isSetEqual(toClassSet(actual || ""), toClassSet(expected))) { mismatchType = 2 /* CLASS */; @@ -4393,7 +4415,7 @@ Server rendered element contains fewer child nodes than client vdom.` if (allowedType === 0 /* TEXT */ && list.includes("children")) { return true; } - return allowedAttr.split(",").includes(MismatchTypeString[allowedType]); + return list.includes(MismatchTypeString[allowedType]); } } @@ -4550,14 +4572,25 @@ Server rendered element contains fewer child nodes than client vdom.` name: "AsyncComponentWrapper", __asyncLoader: load, __asyncHydrate(el, instance, hydrate) { + let patched = false; const doHydrate = hydrateStrategy ? () => { + const performHydrate = () => { + if (patched) { + warn$1( + `Skipping lazy hydration for component '${getComponentName(resolvedComp)}': it was updated before lazy hydration performed.` + ); + return; + } + hydrate(); + }; const teardown = hydrateStrategy( - hydrate, + performHydrate, (cb) => forEachElement(el, cb) ); if (teardown) { (instance.bum || (instance.bum = [])).push(teardown); } + (instance.u || (instance.u = [])).push(() => patched = true); } : hydrate; if (resolvedComp) { doHydrate(); @@ -4721,6 +4754,9 @@ Server rendered element contains fewer child nodes than client vdom.` { devtoolsComponentAdded(instance2); } + { + instance2.__keepAliveStorageContainer = storageContainer; + } }; function unmount(vnode) { resetShapeFlag(vnode); @@ -4808,7 +4844,7 @@ Server rendered element contains fewer child nodes than client vdom.` ); const { include, exclude, max } = props; if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) { - vnode.shapeFlag &= ~256; + vnode.shapeFlag &= -257; current = vnode; return rawVNode; } @@ -4895,8 +4931,8 @@ Server rendered element contains fewer child nodes than client vdom.` }, target); } function resetShapeFlag(vnode) { - vnode.shapeFlag &= ~256; - vnode.shapeFlag &= ~512; + vnode.shapeFlag &= -257; + vnode.shapeFlag &= -513; } function getInnerChild(vnode) { return vnode.shapeFlag & 128 ? vnode.ssContent : vnode; @@ -5011,14 +5047,16 @@ If this is a native custom element, make sure to exclude it from component resol if (sourceIsArray || isString(source)) { const sourceIsReactiveArray = sourceIsArray && isReactive(source); let needsWrap = false; + let isReadonlySource = false; if (sourceIsReactiveArray) { needsWrap = !isShallow(source); + isReadonlySource = isReadonly(source); source = shallowReadArray(source); } ret = new Array(source.length); for (let i = 0, l = source.length; i < l; i++) { ret[i] = renderItem( - needsWrap ? toReactive(source[i]) : source[i], + needsWrap ? isReadonlySource ? toReadonly(toReactive(source[i])) : toReactive(source[i]) : source[i], i, void 0, cached && cached[i] @@ -6037,11 +6075,9 @@ If this is a native custom element, make sure to exclude it from component resol } { context.reload = () => { - render( - cloneVNode(vnode), - rootContainer, - namespace - ); + const cloned = cloneVNode(vnode); + cloned.el = null; + render(cloned, rootContainer, namespace); }; } if (isHydrate && hydrate) { @@ -6091,9 +6127,15 @@ If you want to remount the same app, move your app creation logic into a factory }, provide(key, value) { if (key in context.provides) { - warn$1( - `App already provides property with key "${String(key)}". It will be overwritten with the new value.` - ); + if (hasOwn(context.provides, key)) { + warn$1( + `App already provides property with key "${String(key)}". It will be overwritten with the new value.` + ); + } else { + warn$1( + `App already provides property with key "${String(key)}" inherited from its parent element. It will be overwritten with the new value.` + ); + } } context.provides[key] = value; return app; @@ -6130,7 +6172,7 @@ If you want to remount the same app, move your app creation logic into a factory function inject(key, defaultValue, treatDefaultAsFactory = false) { const instance = currentInstance || currentRenderingInstance; if (instance || currentApp) { - const provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0; + let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0; if (provides && key in provides) { return provides[key]; } else if (arguments.length > 1) { @@ -6564,7 +6606,7 @@ If you want to remount the same app, move your app creation logic into a factory return rawSlot; } const normalized = withCtx((...args) => { - if (currentInstance && (!ctx || ctx.root === currentInstance.root)) { + if (currentInstance && !(ctx === null && currentRenderingInstance) && !(ctx && ctx.root !== currentInstance.root)) { warn$1( `Slot "${key}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.` ); @@ -6603,7 +6645,7 @@ If you want to remount the same app, move your app creation logic into a factory }; const assignSlots = (slots, children, optimized) => { for (const key in children) { - if (optimized || key !== "_") { + if (optimized || !isInternalKey(key)) { slots[key] = children[key]; } } @@ -6611,6 +6653,8 @@ If you want to remount the same app, move your app creation logic into a factory const initSlots = (instance, children, optimized) => { const slots = instance.slots = createInternalObject(); if (instance.vnode.shapeFlag & 32) { + const cacheIndexes = children.__; + if (cacheIndexes) def(slots, "__", cacheIndexes, true); const type = children._; if (type) { assignSlots(slots, children, optimized); @@ -6822,6 +6866,8 @@ If you want to remount the same app, move your app creation logic into a factory } if (ref != null && parentComponent) { setRef(ref, n1 && n1.ref, parentSuspense, n2 || n1, !n2); + } else if (ref == null && n1 && n1.ref != null) { + setRef(n1.ref, null, parentSuspense, n1, true); } }; const processText = (n1, n2, container, anchor) => { @@ -7127,7 +7173,7 @@ If you want to remount the same app, move your app creation logic into a factory (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement // which also requires the correct parent container !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything. - oldVNode.shapeFlag & (6 | 64)) ? hostParentNode(oldVNode.el) : ( + oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(oldVNode.el) : ( // In other cases, the parent container is not actually used so we // just pass the block element here to avoid a DOM parentNode call. fallbackContainer @@ -7289,8 +7335,8 @@ If you want to remount the same app, move your app creation logic into a factory endMeasure(instance, `init`); } } + if (isHmrUpdating) initialVNode.el = null; if (instance.asyncDep) { - if (isHmrUpdating) initialVNode.el = null; parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized); if (!initialVNode.el) { const placeholder = instance.subTree = createVNode(Comment); @@ -7381,7 +7427,8 @@ If you want to remount the same app, move your app creation logic into a factory hydrateSubTree(); } } else { - if (root.ce) { + if (root.ce && // @ts-expect-error _def is private + root.ce._def.shadowRoot !== false) { root.ce._injectChildStyle(type); } { @@ -7852,7 +7899,13 @@ If you want to remount the same app, move your app creation logic into a factory queuePostRenderEffect(() => transition.enter(el), parentSuspense); } else { const { leave, delayLeave, afterLeave } = transition; - const remove2 = () => hostInsert(el, container, anchor); + const remove2 = () => { + if (vnode.ctx.isUnmounted) { + hostRemove(el); + } else { + hostInsert(el, container, anchor); + } + }; const performLeave = () => { leave(el, () => { remove2(); @@ -7885,7 +7938,9 @@ If you want to remount the same app, move your app creation logic into a factory optimized = false; } if (ref != null) { + pauseTracking(); setRef(ref, null, parentSuspense, vnode, true); + resetTracking(); } if (cacheIndex != null) { parentComponent.renderCache[cacheIndex] = void 0; @@ -7997,12 +8052,27 @@ If you want to remount the same app, move your app creation logic into a factory if (instance.type.__hmrId) { unregisterHMR(instance); } - const { bum, scope, job, subTree, um, m, a } = instance; + const { + bum, + scope, + job, + subTree, + um, + m, + a, + parent, + slots: { __: slotCacheKeys } + } = instance; invalidateMount(m); invalidateMount(a); if (bum) { invokeArrayFns(bum); } + if (parent && isArray(slotCacheKeys)) { + slotCacheKeys.forEach((v) => { + parent.renderCache[v] = void 0; + }); + } scope.stop(); if (job) { job.flags |= 8; @@ -8098,8 +8168,8 @@ If you want to remount the same app, move your app creation logic into a factory effect.flags |= 32; job.flags |= 4; } else { - effect.flags &= ~32; - job.flags &= ~4; + effect.flags &= -33; + job.flags &= -5; } } function needTransition(parentSuspense, transition) { @@ -8126,6 +8196,9 @@ If you want to remount the same app, move your app creation logic into a factory if (c2.type === Comment && !c2.el) { c2.el = c1.el; } + { + c2.el && (c2.el.__vnode = c2); + } } } } @@ -9443,8 +9516,8 @@ If you want to remount the same app, move your app creation logic into a factory if (n2.shapeFlag & 6 && n1.component) { const dirtyInstances = hmrDirtyComponents.get(n2.type); if (dirtyInstances && dirtyInstances.has(n1.component)) { - n1.shapeFlag &= ~256; - n2.shapeFlag &= ~512; + n1.shapeFlag &= -257; + n2.shapeFlag &= -513; return false; } } @@ -9893,7 +9966,7 @@ Component that was made reactive: `, const { props, children } = instance.vnode; const isStateful = isStatefulComponent(instance); initProps(instance, props, isStateful, isSSR); - initSlots(instance, children, optimized); + initSlots(instance, children, optimized || isSSR); const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0; isSSR && setInSSRSetupState(false); return setupResult; @@ -10222,13 +10295,15 @@ Component that was made reactive: `, if (obj.__isVue) { return ["div", vueStyle, `VueInstance`]; } else if (isRef(obj)) { + pauseTracking(); + const value = obj.value; + resetTracking(); return [ "div", {}, ["span", vueStyle, genRefFlag(obj)], "<", - // avoid debugger accessing value affecting behavior - formatValue("_value" in obj ? obj._value : obj), + formatValue(value), `>` ]; } else if (isReactive(obj)) { @@ -10409,7 +10484,7 @@ Component that was made reactive: `, return true; } - const version = "3.5.13"; + const version = "3.5.17"; const warn = warn$1 ; const ErrorTypeStrings = ErrorTypeStrings$1 ; const devtools = devtools$1 ; @@ -11208,7 +11283,7 @@ Expected function or array of functions, received type ${typeof value}.` } return false; } - if (key === "spellcheck" || key === "draggable" || key === "translate") { + if (key === "spellcheck" || key === "draggable" || key === "translate" || key === "autocorrect") { return false; } if (key === "form") { @@ -11291,13 +11366,10 @@ Expected function or array of functions, received type ${typeof value}.` this._root = this; } } - if (!this._def.__asyncLoader) { - this._resolveProps(this._def); - } } connectedCallback() { if (!this.isConnected) return; - if (!this.shadowRoot) { + if (!this.shadowRoot && !this._resolved) { this._parseSlots(); } this._connected = true; @@ -11310,8 +11382,7 @@ Expected function or array of functions, received type ${typeof value}.` } if (!this._instance) { if (this._resolved) { - this._setParent(); - this._update(); + this._mount(this._def); } else { if (parent && parent._pendingResolve) { this._pendingResolve = parent._pendingResolve.then(() => { @@ -11327,7 +11398,15 @@ Expected function or array of functions, received type ${typeof value}.` _setParent(parent = this._parent) { if (parent) { this._instance.parent = parent._instance; - this._instance.provides = parent._instance.provides; + this._inheritParentContext(parent); + } + } + _inheritParentContext(parent = this._parent) { + if (parent && this._app) { + Object.setPrototypeOf( + this._app._context.provides, + parent._instance.provides + ); } } disconnectedCallback() { @@ -11377,9 +11456,7 @@ Expected function or array of functions, received type ${typeof value}.` } } this._numberProps = numberProps; - if (isAsync) { - this._resolveProps(def); - } + this._resolveProps(def); if (this.shadowRoot) { this._applyStyles(styles); } else if (styles) { @@ -11391,9 +11468,10 @@ Expected function or array of functions, received type ${typeof value}.` }; const asyncDef = this._def.__asyncLoader; if (asyncDef) { - this._pendingResolve = asyncDef().then( - (def) => resolve(this._def = def, true) - ); + this._pendingResolve = asyncDef().then((def) => { + def.configureApp = this._def.configureApp; + resolve(this._def = def, true); + }); } else { resolve(this._def); } @@ -11403,6 +11481,7 @@ Expected function or array of functions, received type ${typeof value}.` def.name = "VueElement"; } this._app = this._createApp(def); + this._inheritParentContext(); if (def.configureApp) { def.configureApp(this._app); } @@ -11487,7 +11566,9 @@ Expected function or array of functions, received type ${typeof value}.` } } _update() { - render(this._createVNode(), this._root); + const vnode = this._createVNode(); + if (this._app) vnode.appContext = this._app._context; + render(vnode, this._root); } _createVNode() { const baseProps = {}; @@ -11685,6 +11766,7 @@ Expected function or array of functions, received type ${typeof value}.` instance.vnode.el, moveClass )) { + prevChildren = []; return; } prevChildren.forEach(callPendingCbs); @@ -11708,6 +11790,7 @@ Expected function or array of functions, received type ${typeof value}.` }; el.addEventListener("transitionend", cb); }); + prevChildren = []; }); return () => { const rawProps = toRaw(props); diff --git a/node_modules/vue/dist/vue.runtime.global.prod.js b/node_modules/vue/dist/vue.runtime.global.prod.js index ca71a3b..9b19f10 100644 --- a/node_modules/vue/dist/vue.runtime.global.prod.js +++ b/node_modules/vue/dist/vue.runtime.global.prod.js @@ -1,5 +1,6 @@ /** -* vue v3.5.13 +* vue v3.5.17 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/var Vue=function(e){"use strict";var t,n;let l,r,i,s,o,a,u,c,f,p,d,h;function g(e){let t=Object.create(null);for(let n of e.split(","))t[n]=1;return e=>e in t}let m={},_=[],y=()=>{},b=()=>!1,S=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&(e.charCodeAt(2)>122||97>e.charCodeAt(2)),C=e=>e.startsWith("onUpdate:"),x=Object.assign,w=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},E=Object.prototype.hasOwnProperty,k=(e,t)=>E.call(e,t),T=Array.isArray,A=e=>"[object Map]"===V(e),R=e=>"[object Set]"===V(e),O=e=>"[object Date]"===V(e),N=e=>"[object RegExp]"===V(e),P=e=>"function"==typeof e,M=e=>"string"==typeof e,I=e=>"symbol"==typeof e,L=e=>null!==e&&"object"==typeof e,D=e=>(L(e)||P(e))&&P(e.then)&&P(e.catch),F=Object.prototype.toString,V=e=>F.call(e),U=e=>V(e).slice(8,-1),j=e=>"[object Object]"===V(e),B=e=>M(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,$=g(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),H=e=>{let t=Object.create(null);return n=>t[n]||(t[n]=e(n))},W=/-(\w)/g,K=H(e=>e.replace(W,(e,t)=>t?t.toUpperCase():"")),z=/\B([A-Z])/g,q=H(e=>e.replace(z,"-$1").toLowerCase()),G=H(e=>e.charAt(0).toUpperCase()+e.slice(1)),J=H(e=>e?`on${G(e)}`:""),X=(e,t)=>!Object.is(e,t),Z=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:l,value:n})},Q=e=>{let t=parseFloat(e);return isNaN(t)?e:t},ee=e=>{let t=M(e)?Number(e):NaN;return isNaN(t)?e:t},et=()=>l||(l="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{}),en=g("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol");function el(e){if(T(e)){let t={};for(let n=0;n{if(e){let n=e.split(ei);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}(l):el(l);if(r)for(let e in r)t[e]=r[e]}return t}if(M(e)||L(e))return e}let er=/;(?![^(]*\))/g,ei=/:([^]+)/,es=/\/\*[^]*?\*\//g;function eo(e){let t="";if(M(e))t=e;else if(T(e))for(let n=0;neu(e,t))}let ef=e=>!!(e&&!0===e.__v_isRef),ep=e=>M(e)?e:null==e?"":T(e)||L(e)&&(e.toString===F||!P(e.toString))?ef(e)?ep(e.value):JSON.stringify(e,ed,2):String(e),ed=(e,t)=>ef(t)?ed(e,t.value):A(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],l)=>(e[eh(t,l)+" =>"]=n,e),{})}:R(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>eh(e))}:I(t)?eh(t):!L(t)||T(t)||j(t)?t:String(t),eh=(e,t="")=>{var n;return I(e)?`Symbol(${null!=(n=e.description)?n:t})`:e};class eg{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=r,!e&&r&&(this.index=(r.scopes||(r.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){let e,t;if(this._isPaused=!0,this.scopes)for(e=0,t=this.scopes.length;e0)){if(o){let e=o;for(o=void 0;e;){let t=e.next;e.next=void 0,e.flags&=-9,e=t}}for(;s;){let t=s;for(s=void 0;t;){let n=t.next;if(t.next=void 0,t.flags&=-9,1&t.flags)try{t.trigger()}catch(t){e||(e=t)}t=n}}if(e)throw e}}function eS(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function eC(e){let t;let n=e.depsTail,l=n;for(;l;){let e=l.prevDep;-1===l.version?(l===n&&(n=e),eE(l),function(e){let{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}(l)):t=l,l.dep.activeLink=l.prevActiveLink,l.prevActiveLink=void 0,l=e}e.deps=t,e.depsTail=n}function ex(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(ew(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function ew(e){if(4&e.flags&&!(16&e.flags)||(e.flags&=-17,e.globalVersion===eN))return;e.globalVersion=eN;let t=e.dep;if(e.flags|=2,t.version>0&&!e.isSSR&&e.deps&&!ex(e)){e.flags&=-3;return}let n=i,l=ek;i=e,ek=!0;try{eS(e);let n=e.fn(e._value);(0===t.version||X(n,e._value))&&(e._value=n,t.version++)}catch(e){throw t.version++,e}finally{i=n,ek=l,eC(e),e.flags&=-3}}function eE(e,t=!1){let{dep:n,prevSub:l,nextSub:r}=e;if(l&&(l.nextSub=r,e.prevSub=void 0),r&&(r.prevSub=l,e.nextSub=void 0),n.subs===e&&(n.subs=l,!l&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)eE(e,!0)}t||--n.sc||!n.map||n.map.delete(n.key)}let ek=!0,eT=[];function eA(){eT.push(ek),ek=!1}function eR(){let e=eT.pop();ek=void 0===e||e}function eO(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let e=i;i=void 0;try{t()}finally{i=e}}}let eN=0;class eP{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class eM{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(e){if(!i||!ek||i===this.computed)return;let t=this.activeLink;if(void 0===t||t.sub!==i)t=this.activeLink=new eP(i,this),i.deps?(t.prevDep=i.depsTail,i.depsTail.nextDep=t,i.depsTail=t):i.deps=i.depsTail=t,function e(t){if(t.dep.sc++,4&t.sub.flags){let n=t.dep.computed;if(n&&!t.dep.subs){n.flags|=20;for(let t=n.deps;t;t=t.nextDep)e(t)}let l=t.dep.subs;l!==t&&(t.prevSub=l,l&&(l.nextSub=t)),t.dep.subs=t}}(t);else if(-1===t.version&&(t.version=this.version,t.nextDep)){let e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=i.depsTail,t.nextDep=void 0,i.depsTail.nextDep=t,i.depsTail=t,i.deps===t&&(i.deps=e)}return t}trigger(e){this.version++,eN++,this.notify(e)}notify(e){e_++;try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{eb()}}}let eI=new WeakMap,eL=Symbol(""),eD=Symbol(""),eF=Symbol("");function eV(e,t,n){if(ek&&i){let t=eI.get(e);t||eI.set(e,t=new Map);let l=t.get(n);l||(t.set(n,l=new eM),l.map=t,l.key=n),l.track()}}function eU(e,t,n,l,r,i){let s=eI.get(e);if(!s){eN++;return}let o=e=>{e&&e.trigger()};if(e_++,"clear"===t)s.forEach(o);else{let r=T(e),i=r&&B(n);if(r&&"length"===n){let e=Number(l);s.forEach((t,n)=>{("length"===n||n===eF||!I(n)&&n>=e)&&o(t)})}else switch((void 0!==n||s.has(void 0))&&o(s.get(n)),i&&o(s.get(eF)),t){case"add":r?i&&o(s.get("length")):(o(s.get(eL)),A(e)&&o(s.get(eD)));break;case"delete":!r&&(o(s.get(eL)),A(e)&&o(s.get(eD)));break;case"set":A(e)&&o(s.get(eL))}}eb()}function ej(e){let t=tg(e);return t===e?t:(eV(t,"iterate",eF),td(e)?t:t.map(tm))}function eB(e){return eV(e=tg(e),"iterate",eF),e}let e$={__proto__:null,[Symbol.iterator](){return eH(this,Symbol.iterator,tm)},concat(...e){return ej(this).concat(...e.map(e=>T(e)?ej(e):e))},entries(){return eH(this,"entries",e=>(e[1]=tm(e[1]),e))},every(e,t){return eK(this,"every",e,t,void 0,arguments)},filter(e,t){return eK(this,"filter",e,t,e=>e.map(tm),arguments)},find(e,t){return eK(this,"find",e,t,tm,arguments)},findIndex(e,t){return eK(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return eK(this,"findLast",e,t,tm,arguments)},findLastIndex(e,t){return eK(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return eK(this,"forEach",e,t,void 0,arguments)},includes(...e){return eq(this,"includes",e)},indexOf(...e){return eq(this,"indexOf",e)},join(e){return ej(this).join(e)},lastIndexOf(...e){return eq(this,"lastIndexOf",e)},map(e,t){return eK(this,"map",e,t,void 0,arguments)},pop(){return eG(this,"pop")},push(...e){return eG(this,"push",e)},reduce(e,...t){return ez(this,"reduce",e,t)},reduceRight(e,...t){return ez(this,"reduceRight",e,t)},shift(){return eG(this,"shift")},some(e,t){return eK(this,"some",e,t,void 0,arguments)},splice(...e){return eG(this,"splice",e)},toReversed(){return ej(this).toReversed()},toSorted(e){return ej(this).toSorted(e)},toSpliced(...e){return ej(this).toSpliced(...e)},unshift(...e){return eG(this,"unshift",e)},values(){return eH(this,"values",tm)}};function eH(e,t,n){let l=eB(e),r=l[t]();return l===e||td(e)||(r._next=r.next,r.next=()=>{let e=r._next();return e.value&&(e.value=n(e.value)),e}),r}let eW=Array.prototype;function eK(e,t,n,l,r,i){let s=eB(e),o=s!==e&&!td(e),a=s[t];if(a!==eW[t]){let t=a.apply(e,i);return o?tm(t):t}let u=n;s!==e&&(o?u=function(t,l){return n.call(this,tm(t),l,e)}:n.length>2&&(u=function(t,l){return n.call(this,t,l,e)}));let c=a.call(s,u,l);return o&&r?r(c):c}function ez(e,t,n,l){let r=eB(e),i=n;return r!==e&&(td(e)?n.length>3&&(i=function(t,l,r){return n.call(this,t,l,r,e)}):i=function(t,l,r){return n.call(this,t,tm(l),r,e)}),r[t](i,...l)}function eq(e,t,n){let l=tg(e);eV(l,"iterate",eF);let r=l[t](...n);return(-1===r||!1===r)&&th(n[0])?(n[0]=tg(n[0]),l[t](...n)):r}function eG(e,t,n=[]){eA(),e_++;let l=tg(e)[t].apply(e,n);return eb(),eR(),l}let eJ=g("__proto__,__v_isRef,__isVue"),eX=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>"arguments"!==e&&"caller"!==e).map(e=>Symbol[e]).filter(I));function eZ(e){I(e)||(e=String(e));let t=tg(this);return eV(t,"has",e),t.hasOwnProperty(e)}class eY{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if("__v_skip"===t)return e.__v_skip;let l=this._isReadonly,r=this._isShallow;if("__v_isReactive"===t)return!l;if("__v_isReadonly"===t)return l;if("__v_isShallow"===t)return r;if("__v_raw"===t)return n===(l?r?ts:ti:r?tr:tl).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;let i=T(e);if(!l){let e;if(i&&(e=e$[t]))return e;if("hasOwnProperty"===t)return eZ}let s=Reflect.get(e,t,ty(e)?e:n);return(I(t)?eX.has(t):eJ(t))?s:(l||eV(e,"get",t),r)?s:ty(s)?i&&B(t)?s:s.value:L(s)?l?tu(s):to(s):s}}class eQ extends eY{constructor(e=!1){super(!1,e)}set(e,t,n,l){let r=e[t];if(!this._isShallow){let t=tp(r);if(td(n)||tp(n)||(r=tg(r),n=tg(n)),!T(e)&&ty(r)&&!ty(n))return!t&&(r.value=n,!0)}let i=T(e)&&B(t)?Number(t)e,e3=e=>Reflect.getPrototypeOf(e);function e5(e){return function(...t){return"delete"!==e&&("clear"===e?void 0:this)}}function e9(e,t){let n=function(e,t){let n={get(n){let l=this.__v_raw,r=tg(l),i=tg(n);e||(X(n,i)&&eV(r,"get",n),eV(r,"get",i));let{has:s}=e3(r),o=t?e8:e?t_:tm;return s.call(r,n)?o(l.get(n)):s.call(r,i)?o(l.get(i)):void(l!==r&&l.get(n))},get size(){let t=this.__v_raw;return e||eV(tg(t),"iterate",eL),Reflect.get(t,"size",t)},has(t){let n=this.__v_raw,l=tg(n),r=tg(t);return e||(X(t,r)&&eV(l,"has",t),eV(l,"has",r)),t===r?n.has(t):n.has(t)||n.has(r)},forEach(n,l){let r=this,i=r.__v_raw,s=tg(i),o=t?e8:e?t_:tm;return e||eV(s,"iterate",eL),i.forEach((e,t)=>n.call(l,o(e),o(t),r))}};return x(n,e?{add:e5("add"),set:e5("set"),delete:e5("delete"),clear:e5("clear")}:{add(e){t||td(e)||tp(e)||(e=tg(e));let n=tg(this);return e3(n).has.call(n,e)||(n.add(e),eU(n,"add",e,e)),this},set(e,n){t||td(n)||tp(n)||(n=tg(n));let l=tg(this),{has:r,get:i}=e3(l),s=r.call(l,e);s||(e=tg(e),s=r.call(l,e));let o=i.call(l,e);return l.set(e,n),s?X(n,o)&&eU(l,"set",e,n):eU(l,"add",e,n),this},delete(e){let t=tg(this),{has:n,get:l}=e3(t),r=n.call(t,e);r||(e=tg(e),r=n.call(t,e)),l&&l.call(t,e);let i=t.delete(e);return r&&eU(t,"delete",e,void 0),i},clear(){let e=tg(this),t=0!==e.size,n=e.clear();return t&&eU(e,"clear",void 0,void 0),n}}),["keys","values","entries",Symbol.iterator].forEach(l=>{n[l]=function(...n){let r=this.__v_raw,i=tg(r),s=A(i),o="entries"===l||l===Symbol.iterator&&s,a=r[l](...n),u=t?e8:e?t_:tm;return e||eV(i,"iterate","keys"===l&&s?eD:eL),{next(){let{value:e,done:t}=a.next();return t?{value:e,done:t}:{value:o?[u(e[0]),u(e[1])]:u(e),done:t}},[Symbol.iterator](){return this}}}}),n}(e,t);return(t,l,r)=>"__v_isReactive"===l?!e:"__v_isReadonly"===l?e:"__v_raw"===l?t:Reflect.get(k(n,l)&&l in t?n:t,l,r)}let e7={get:e9(!1,!1)},te={get:e9(!1,!0)},tt={get:e9(!0,!1)},tn={get:e9(!0,!0)},tl=new WeakMap,tr=new WeakMap,ti=new WeakMap,ts=new WeakMap;function to(e){return tp(e)?e:tc(e,!1,e1,e7,tl)}function ta(e){return tc(e,!1,e6,te,tr)}function tu(e){return tc(e,!0,e2,tt,ti)}function tc(e,t,n,l,r){if(!L(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;let i=r.get(e);if(i)return i;let s=e.__v_skip||!Object.isExtensible(e)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}(U(e));if(0===s)return e;let o=new Proxy(e,2===s?l:n);return r.set(e,o),o}function tf(e){return tp(e)?tf(e.__v_raw):!!(e&&e.__v_isReactive)}function tp(e){return!!(e&&e.__v_isReadonly)}function td(e){return!!(e&&e.__v_isShallow)}function th(e){return!!e&&!!e.__v_raw}function tg(e){let t=e&&e.__v_raw;return t?tg(t):e}function tv(e){return!k(e,"__v_skip")&&Object.isExtensible(e)&&Y(e,"__v_skip",!0),e}let tm=e=>L(e)?to(e):e,t_=e=>L(e)?tu(e):e;function ty(e){return!!e&&!0===e.__v_isRef}function tb(e){return tC(e,!1)}function tS(e){return tC(e,!0)}function tC(e,t){return ty(e)?e:new tx(e,t)}class tx{constructor(e,t){this.dep=new eM,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:tg(e),this._value=t?e:tm(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||td(e)||tp(e);X(e=n?e:tg(e),t)&&(this._rawValue=e,this._value=n?e:tm(e),this.dep.trigger())}}function tw(e){return ty(e)?e.value:e}let tE={get:(e,t,n)=>"__v_raw"===t?e:tw(Reflect.get(e,t,n)),set:(e,t,n,l)=>{let r=e[t];return ty(r)&&!ty(n)?(r.value=n,!0):Reflect.set(e,t,n,l)}};function tk(e){return tf(e)?e:new Proxy(e,tE)}class tT{constructor(e){this.__v_isRef=!0,this._value=void 0;let t=this.dep=new eM,{get:n,set:l}=e(t.track.bind(t),t.trigger.bind(t));this._get=n,this._set=l}get value(){return this._value=this._get()}set value(e){this._set(e)}}function tA(e){return new tT(e)}class tR{constructor(e,t,n){this._object=e,this._key=t,this._defaultValue=n,this.__v_isRef=!0,this._value=void 0}get value(){let e=this._object[this._key];return this._value=void 0===e?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return function(e,t){let n=eI.get(e);return n&&n.get(t)}(tg(this._object),this._key)}}class tO{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function tN(e,t,n){let l=e[t];return ty(l)?l:new tR(e,t,n)}class tP{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new eM(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=eN-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(8&this.flags)&&i!==this)return ey(this,!0),!0}get value(){let e=this.dep.track();return ew(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}let tM={},tI=new WeakMap;function tL(e,t=!1,n=d){if(n){let t=tI.get(n);t||tI.set(n,t=[]),t.push(e)}}function tD(e,t=1/0,n){if(t<=0||!L(e)||e.__v_skip||(n=n||new Set).has(e))return e;if(n.add(e),t--,ty(e))tD(e.value,t,n);else if(T(e))for(let l=0;l{tD(e,t,n)});else if(j(e)){for(let l in e)tD(e[l],t,n);for(let l of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,l)&&tD(e[l],t,n)}return e}function tF(e,t,n,l){try{return l?e(...l):e()}catch(e){tU(e,t,n)}}function tV(e,t,n,l){if(P(e)){let r=tF(e,t,n,l);return r&&D(r)&&r.catch(e=>{tU(e,t,n)}),r}if(T(e)){let r=[];for(let i=0;i=tQ(n)?tj.push(e):tj.splice(function(e){let t=tB+1,n=tj.length;for(;t>>1,r=tj[l],i=tQ(r);itQ(e)-tQ(t));if(t$.length=0,tH){tH.push(...e);return}for(tW=0,tH=e;tWnull==e.id?2&e.flags?-1:1/0:e.id,t0=null,t1=null;function t2(e){let t=t0;return t0=e,t1=e&&e.type.__scopeId||null,t}function t6(e,t=t0,n){if(!t||e._n)return e;let l=(...n)=>{let r;l._d&&rs(-1);let i=t2(t);try{r=e(...n)}finally{t2(i),l._d&&rs(1)}return r};return l._n=!0,l._c=!0,l._d=!0,l}function t4(e,t,n,l){let r=e.dirs,i=t&&t.dirs;for(let s=0;se.__isTeleport,t5=e=>e&&(e.disabled||""===e.disabled),t9=e=>e&&(e.defer||""===e.defer),t7=e=>"undefined"!=typeof SVGElement&&e instanceof SVGElement,ne=e=>"function"==typeof MathMLElement&&e instanceof MathMLElement,nt=(e,t)=>{let n=e&&e.to;return M(n)?t?t(n):null:n},nn={name:"Teleport",__isTeleport:!0,process(e,t,n,l,r,i,s,o,a,u){let{mc:c,pc:f,pbc:p,o:{insert:d,querySelector:h,createText:g,createComment:m}}=u,_=t5(t.props),{shapeFlag:y,children:b,dynamicChildren:S}=t;if(null==e){let e=t.el=g(""),u=t.anchor=g("");d(e,n,l),d(u,n,l);let f=(e,t)=>{16&y&&(r&&r.isCE&&(r.ce._teleportTarget=e),c(b,e,t,r,i,s,o,a))},p=()=>{let e=t.target=nt(t.props,h),n=ni(e,t,g,d);e&&("svg"!==s&&t7(e)?s="svg":"mathml"!==s&&ne(e)&&(s="mathml"),_||(f(e,n),nr(t,!1)))};_&&(f(n,u),nr(t,!0)),t9(t.props)?lM(()=>{p(),t.el.__isMounted=!0},i):p()}else{if(t9(t.props)&&!e.el.__isMounted){lM(()=>{nn.process(e,t,n,l,r,i,s,o,a,u),delete e.el.__isMounted},i);return}t.el=e.el,t.targetStart=e.targetStart;let c=t.anchor=e.anchor,d=t.target=e.target,g=t.targetAnchor=e.targetAnchor,m=t5(e.props),y=m?n:d;if("svg"===s||t7(d)?s="svg":("mathml"===s||ne(d))&&(s="mathml"),S?(p(e.dynamicChildren,S,y,r,i,s,o),lU(e,t,!0)):a||f(e,t,y,m?c:g,r,i,s,o,!1),_)m?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):nl(t,n,c,u,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){let e=t.target=nt(t.props,h);e&&nl(t,e,null,u,0)}else m&&nl(t,d,g,u,1);nr(t,_)}},remove(e,t,n,{um:l,o:{remove:r}},i){let{shapeFlag:s,children:o,anchor:a,targetStart:u,targetAnchor:c,target:f,props:p}=e;if(f&&(r(u),r(c)),i&&r(a),16&s){let e=i||!t5(p);for(let r=0;r{e.isMounted=!0}),nX(()=>{e.isUnmounting=!0}),e}let nu=[Function,Array],nc={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:nu,onEnter:nu,onAfterEnter:nu,onEnterCancelled:nu,onBeforeLeave:nu,onLeave:nu,onAfterLeave:nu,onLeaveCancelled:nu,onBeforeAppear:nu,onAppear:nu,onAfterAppear:nu,onAppearCancelled:nu},nf=e=>{let t=e.subTree;return t.component?nf(t.component):t};function np(e){let t=e[0];if(e.length>1){for(let n of e)if(n.type!==l7){t=n;break}}return t}let nd={name:"BaseTransition",props:nc,setup(e,{slots:t}){let n=rk(),l=na();return()=>{let r=t.default&&ny(t.default(),!0);if(!r||!r.length)return;let i=np(r),s=tg(e),{mode:o}=s;if(l.isLeaving)return nv(i);let a=nm(i);if(!a)return nv(i);let u=ng(a,s,l,n,e=>u=e);a.type!==l7&&n_(a,u);let c=n.subTree&&nm(n.subTree);if(c&&c.type!==l7&&!rc(a,c)&&nf(n).type!==l7){let e=ng(c,s,l,n);if(n_(c,e),"out-in"===o&&a.type!==l7)return l.isLeaving=!0,e.afterLeave=()=>{l.isLeaving=!1,8&n.job.flags||n.update(),delete e.afterLeave,c=void 0},nv(i);"in-out"===o&&a.type!==l7?e.delayLeave=(e,t,n)=>{nh(l,c)[String(c.key)]=c,e[ns]=()=>{t(),e[ns]=void 0,delete u.delayedLeave,c=void 0},u.delayedLeave=()=>{n(),delete u.delayedLeave,c=void 0}}:c=void 0}else c&&(c=void 0);return i}}};function nh(e,t){let{leavingVNodes:n}=e,l=n.get(t.type);return l||(l=Object.create(null),n.set(t.type,l)),l}function ng(e,t,n,l,r){let{appear:i,mode:s,persisted:o=!1,onBeforeEnter:a,onEnter:u,onAfterEnter:c,onEnterCancelled:f,onBeforeLeave:p,onLeave:d,onAfterLeave:h,onLeaveCancelled:g,onBeforeAppear:m,onAppear:_,onAfterAppear:y,onAppearCancelled:b}=t,S=String(e.key),C=nh(n,e),x=(e,t)=>{e&&tV(e,l,9,t)},w=(e,t)=>{let n=t[1];x(e,t),T(e)?e.every(e=>e.length<=1)&&n():e.length<=1&&n()},E={mode:s,persisted:o,beforeEnter(t){let l=a;if(!n.isMounted){if(!i)return;l=m||a}t[ns]&&t[ns](!0);let r=C[S];r&&rc(e,r)&&r.el[ns]&&r.el[ns](),x(l,[t])},enter(e){let t=u,l=c,r=f;if(!n.isMounted){if(!i)return;t=_||u,l=y||c,r=b||f}let s=!1,o=e[no]=t=>{s||(s=!0,t?x(r,[e]):x(l,[e]),E.delayedLeave&&E.delayedLeave(),e[no]=void 0)};t?w(t,[e,o]):o()},leave(t,l){let r=String(e.key);if(t[no]&&t[no](!0),n.isUnmounting)return l();x(p,[t]);let i=!1,s=t[ns]=n=>{i||(i=!0,l(),n?x(g,[t]):x(h,[t]),t[ns]=void 0,C[r]!==e||delete C[r])};C[r]=e,d?w(d,[t,s]):s()},clone(e){let i=ng(e,t,n,l,r);return r&&r(i),i}};return E}function nv(e){if(nF(e))return(e=rv(e)).children=null,e}function nm(e){if(!nF(e))return t3(e.type)&&e.children?np(e.children):e;let{shapeFlag:t,children:n}=e;if(n){if(16&t)return n[0];if(32&t&&P(n.default))return n.default()}}function n_(e,t){6&e.shapeFlag&&e.component?(e.transition=t,n_(e.component.subTree,t)):128&e.shapeFlag?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function ny(e,t=!1,n){let l=[],r=0;for(let i=0;i1)for(let e=0;enC(e,t&&(T(t)?t[i]:t),n,l,r));return}if(nL(l)&&!r){512&l.shapeFlag&&l.type.__asyncResolved&&l.component.subTree.component&&nC(e,t,n,l.component.subTree);return}let i=4&l.shapeFlag?rL(l.component):l.el,s=r?null:i,{i:o,r:a}=e,u=t&&t.r,c=o.refs===m?o.refs={}:o.refs,f=o.setupState,p=tg(f),d=f===m?()=>!1:e=>k(p,e);if(null!=u&&u!==a&&(M(u)?(c[u]=null,d(u)&&(f[u]=null)):ty(u)&&(u.value=null)),P(a))tF(a,o,12,[s,c]);else{let t=M(a),l=ty(a);if(t||l){let o=()=>{if(e.f){let n=t?d(a)?f[a]:c[a]:a.value;r?T(n)&&w(n,i):T(n)?n.includes(i)||n.push(i):t?(c[a]=[i],d(a)&&(f[a]=c[a])):(a.value=[i],e.k&&(c[e.k]=a.value))}else t?(c[a]=s,d(a)&&(f[a]=s)):l&&(a.value=s,e.k&&(c[e.k]=s))};s?(o.id=-1,lM(o,n)):o()}}}let nx=!1,nw=()=>{nx||(console.error("Hydration completed but contains mismatches."),nx=!0)},nE=e=>e.namespaceURI.includes("svg")&&"foreignObject"!==e.tagName,nk=e=>e.namespaceURI.includes("MathML"),nT=e=>{if(1===e.nodeType){if(nE(e))return"svg";if(nk(e))return"mathml"}},nA=e=>8===e.nodeType;function nR(e){let{mt:t,p:n,o:{patchProp:l,createText:r,nextSibling:i,parentNode:s,remove:o,insert:a,createComment:u}}=e,c=(n,l,o,u,y,b=!1)=>{b=b||!!l.dynamicChildren;let S=nA(n)&&"["===n.data,C=()=>h(n,l,o,u,y,S),{type:x,ref:w,shapeFlag:E,patchFlag:k}=l,T=n.nodeType;l.el=n,-2===k&&(b=!1,l.dynamicChildren=null);let A=null;switch(x){case l9:3!==T?""===l.children?(a(l.el=r(""),s(n),n),A=n):A=C():(n.data!==l.children&&(nw(),n.data=l.children),A=i(n));break;case l7:_(n)?(A=i(n),m(l.el=n.content.firstChild,n,o)):A=8!==T||S?C():i(n);break;case re:if(S&&(T=(n=i(n)).nodeType),1===T||3===T){A=n;let e=!l.children.length;for(let t=0;t{s=s||!!t.dynamicChildren;let{type:a,props:u,patchFlag:c,shapeFlag:f,dirs:d,transition:h}=t,g="input"===a||"option"===a;if(g||-1!==c){let a;d&&t4(t,null,n,"created");let y=!1;if(_(e)){y=lV(null,h)&&n&&n.vnode.props&&n.vnode.props.appear;let l=e.content.firstChild;y&&h.beforeEnter(l),m(l,e,n),t.el=e=l}if(16&f&&!(u&&(u.innerHTML||u.textContent))){let l=p(e.firstChild,t,e,n,r,i,s);for(;l;){nP(e,1)||nw();let t=l;l=l.nextSibling,o(t)}}else if(8&f){let n=t.children;"\n"===n[0]&&("PRE"===e.tagName||"TEXTAREA"===e.tagName)&&(n=n.slice(1)),e.textContent!==n&&(nP(e,0)||nw(),e.textContent=t.children)}if(u){if(g||!s||48&c){let t=e.tagName.includes("-");for(let r in u)(g&&(r.endsWith("value")||"indeterminate"===r)||S(r)&&!$(r)||"."===r[0]||t)&&l(e,r,null,u[r],void 0,n)}else if(u.onClick)l(e,"onClick",null,u.onClick,void 0,n);else if(4&c&&tf(u.style))for(let e in u.style)u.style[e]}(a=u&&u.onVnodeBeforeMount)&&rC(a,n,t),d&&t4(t,null,n,"beforeMount"),((a=u&&u.onVnodeMounted)||d||y)&&l8(()=>{a&&rC(a,n,t),y&&h.enter(e),d&&t4(t,null,n,"mounted")},r)}return e.nextSibling},p=(e,t,l,s,o,u,f)=>{f=f||!!t.dynamicChildren;let p=t.children,d=p.length;for(let t=0;t{let{slotScopeIds:c}=t;c&&(r=r?r.concat(c):c);let f=s(e),d=p(i(e),t,f,n,l,r,o);return d&&nA(d)&&"]"===d.data?i(t.anchor=d):(nw(),a(t.anchor=u("]"),f,d),d)},h=(e,t,l,r,a,u)=>{if(nP(e.parentElement,1)||nw(),t.el=null,u){let t=g(e);for(;;){let n=i(e);if(n&&n!==t)o(n);else break}}let c=i(e),f=s(e);return o(e),n(null,t,f,c,l,r,nT(f),a),l&&(l.vnode.el=t.el,lQ(l,t.el)),c},g=(e,t="[",n="]")=>{let l=0;for(;e;)if((e=i(e))&&nA(e)&&(e.data===t&&l++,e.data===n)){if(0===l)return i(e);l--}return e},m=(e,t,n)=>{let l=t.parentNode;l&&l.replaceChild(e,t);let r=n;for(;r;)r.vnode.el===t&&(r.vnode.el=r.subTree.el=e),r=r.parent},_=e=>1===e.nodeType&&"TEMPLATE"===e.tagName;return[(e,t)=>{if(!t.hasChildNodes()){n(null,e,t),tY(),t._vnode=e;return}c(t.firstChild,e,null,null,null),tY(),t._vnode=e},c]}let nO="data-allow-mismatch",nN={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function nP(e,t){if(0===t||1===t)for(;e&&!e.hasAttribute(nO);)e=e.parentElement;let n=e&&e.getAttribute(nO);if(null==n)return!1;if(""===n)return!0;{let e=n.split(",");return!!(0===t&&e.includes("children"))||n.split(",").includes(nN[t])}}let nM=et().requestIdleCallback||(e=>setTimeout(e,1)),nI=et().cancelIdleCallback||(e=>clearTimeout(e)),nL=e=>!!e.type.__asyncLoader;function nD(e,t){let{ref:n,props:l,children:r,ce:i}=t.vnode,s=rh(e,l,r);return s.ref=n,s.ce=i,delete t.vnode.ce,s}let nF=e=>e.type.__isKeepAlive;function nV(e,t){return T(e)?e.some(e=>nV(e,t)):M(e)?e.split(",").includes(t):!!N(e)&&(e.lastIndex=0,e.test(t))}function nU(e,t){nB(e,"a",t)}function nj(e,t){nB(e,"da",t)}function nB(e,t,n=rE){let l=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()});if(nW(t,l,n),n){let e=n.parent;for(;e&&e.parent;)nF(e.parent.vnode)&&function(e,t,n,l){let r=nW(t,e,l,!0);nZ(()=>{w(l[t],r)},n)}(l,t,n,e),e=e.parent}}function n$(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function nH(e){return 128&e.shapeFlag?e.ssContent:e}function nW(e,t,n=rE,l=!1){if(n){let r=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...l)=>{eA();let r=rT(n),i=tV(t,n,e,l);return r(),eR(),i});return l?r.unshift(i):r.push(i),i}}let nK=e=>(t,n=rE)=>{rO&&"sp"!==e||nW(e,(...e)=>t(...e),n)},nz=nK("bm"),nq=nK("m"),nG=nK("bu"),nJ=nK("u"),nX=nK("bum"),nZ=nK("um"),nY=nK("sp"),nQ=nK("rtg"),n0=nK("rtc");function n1(e,t=rE){nW("ec",e,t)}let n2="components",n6=Symbol.for("v-ndc");function n4(e,t,n=!0,l=!1){let r=t0||rE;if(r){let n=r.type;if(e===n2){let e=rD(n,!1);if(e&&(e===t||e===K(t)||e===G(K(t))))return n}let i=n8(r[e]||n[e],t)||n8(r.appContext[e],t);return!i&&l?n:i}}function n8(e,t){return e&&(e[t]||e[K(t)]||e[G(K(t))])}let n3=e=>e?rR(e)?rL(e):n3(e.parent):null,n5=x(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>n3(e.parent),$root:e=>n3(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>li(e),$forceUpdate:e=>e.f||(e.f=()=>{tG(e.update)}),$nextTick:e=>e.n||(e.n=tq.bind(e.proxy)),$watch:e=>lW.bind(e)}),n9=(e,t)=>e!==m&&!e.__isScriptSetup&&k(e,t),n7={get({_:e},t){let n,l,r;if("__v_skip"===t)return!0;let{ctx:i,setupState:s,data:o,props:a,accessCache:u,type:c,appContext:f}=e;if("$"!==t[0]){let l=u[t];if(void 0!==l)switch(l){case 1:return s[t];case 2:return o[t];case 4:return i[t];case 3:return a[t]}else{if(n9(s,t))return u[t]=1,s[t];if(o!==m&&k(o,t))return u[t]=2,o[t];if((n=e.propsOptions[0])&&k(n,t))return u[t]=3,a[t];if(i!==m&&k(i,t))return u[t]=4,i[t];ll&&(u[t]=0)}}let p=n5[t];return p?("$attrs"===t&&eV(e.attrs,"get",""),p(e)):(l=c.__cssModules)&&(l=l[t])?l:i!==m&&k(i,t)?(u[t]=4,i[t]):k(r=f.config.globalProperties,t)?r[t]:void 0},set({_:e},t,n){let{data:l,setupState:r,ctx:i}=e;return n9(r,t)?(r[t]=n,!0):l!==m&&k(l,t)?(l[t]=n,!0):!k(e.props,t)&&!("$"===t[0]&&t.slice(1)in e)&&(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:l,appContext:r,propsOptions:i}},s){let o;return!!n[s]||e!==m&&k(e,s)||n9(t,s)||(o=i[0])&&k(o,s)||k(l,s)||k(n5,s)||k(r.config.globalProperties,s)},defineProperty(e,t,n){return null!=n.get?e._.accessCache[t]=0:k(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},le=x({},n7,{get(e,t){if(t!==Symbol.unscopables)return n7.get(e,t,e)},has:(e,t)=>"_"!==t[0]&&!en(t)});function lt(){let e=rk();return e.setupContext||(e.setupContext=rI(e))}function ln(e){return T(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}let ll=!0;function lr(e,t,n){tV(T(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function li(e){let t;let n=e.type,{mixins:l,extends:r}=n,{mixins:i,optionsCache:s,config:{optionMergeStrategies:o}}=e.appContext,a=s.get(n);return a?t=a:i.length||l||r?(t={},i.length&&i.forEach(e=>ls(t,e,o,!0)),ls(t,n,o)):t=n,L(n)&&s.set(n,t),t}function ls(e,t,n,l=!1){let{mixins:r,extends:i}=t;for(let s in i&&ls(e,i,n,!0),r&&r.forEach(t=>ls(e,t,n,!0)),t)if(l&&"expose"===s);else{let l=lo[s]||n&&n[s];e[s]=l?l(e[s],t[s]):t[s]}return e}let lo={data:la,props:lp,emits:lp,methods:lf,computed:lf,beforeCreate:lc,created:lc,beforeMount:lc,mounted:lc,beforeUpdate:lc,updated:lc,beforeDestroy:lc,beforeUnmount:lc,destroyed:lc,unmounted:lc,activated:lc,deactivated:lc,errorCaptured:lc,serverPrefetch:lc,components:lf,directives:lf,watch:function(e,t){if(!e)return t;if(!t)return e;let n=x(Object.create(null),e);for(let l in t)n[l]=lc(e[l],t[l]);return n},provide:la,inject:function(e,t){return lf(lu(e),lu(t))}};function la(e,t){return t?e?function(){return x(P(e)?e.call(this,this):e,P(t)?t.call(this,this):t)}:t:e}function lu(e){if(T(e)){let t={};for(let n=0;n1)return n&&P(t)?t.call(l&&l.proxy):t}}let l_={},ly=()=>Object.create(l_),lb=e=>Object.getPrototypeOf(e)===l_;function lS(e,t,n,l){let r;let[i,s]=e.propsOptions,o=!1;if(t)for(let a in t){let u;if($(a))continue;let c=t[a];i&&k(i,u=K(a))?s&&s.includes(u)?(r||(r={}))[u]=c:n[u]=c:lG(e.emitsOptions,a)||a in l&&c===l[a]||(l[a]=c,o=!0)}if(s){let t=tg(n),l=r||m;for(let r=0;r"_"===e[0]||"$stable"===e,lk=e=>T(e)?e.map(r_):[r_(e)],lT=(e,t,n)=>{if(t._n)return t;let l=t6((...e)=>lk(t(...e)),n);return l._c=!1,l},lA=(e,t,n)=>{let l=e._ctx;for(let n in e){if(lE(n))continue;let r=e[n];if(P(r))t[n]=lT(n,r,l);else if(null!=r){let e=lk(r);t[n]=()=>e}}},lR=(e,t)=>{let n=lk(t);e.slots.default=()=>n},lO=(e,t,n)=>{for(let l in t)(n||"_"!==l)&&(e[l]=t[l])},lN=(e,t,n)=>{let l=e.slots=ly();if(32&e.vnode.shapeFlag){let e=t._;e?(lO(l,t,n),n&&Y(l,"_",e,!0)):lA(t,l)}else t&&lR(e,t)},lP=(e,t,n)=>{let{vnode:l,slots:r}=e,i=!0,s=m;if(32&l.shapeFlag){let e=t._;e?n&&1===e?i=!1:lO(r,t,n):(i=!t.$stable,lA(t,r)),s=t}else t&&(lR(e,t),s={default:1});if(i)for(let e in r)lE(e)||null!=s[e]||delete r[e]},lM=l8;function lI(e){return lL(e,nR)}function lL(e,t){var n;let l,r;et().__VUE__=!0;let{insert:i,remove:s,patchProp:o,createElement:a,createText:c,createComment:f,setText:p,setElementText:d,parentNode:h,nextSibling:g,setScopeId:b=y,insertStaticContent:S}=e,C=(e,t,n,l=null,r=null,i=null,s,o=null,a=!!t.dynamicChildren)=>{if(e===t)return;e&&!rc(e,t)&&(l=eo(e),en(e,r,i,!0),e=null),-2===t.patchFlag&&(a=!1,t.dynamicChildren=null);let{type:u,ref:c,shapeFlag:f}=t;switch(u){case l9:w(e,t,n,l);break;case l7:E(e,t,n,l);break;case re:null==e&&A(t,n,l,s);break;case l5:B(e,t,n,l,r,i,s,o,a);break;default:1&f?N(e,t,n,l,r,i,s,o,a):6&f?H(e,t,n,l,r,i,s,o,a):64&f?u.process(e,t,n,l,r,i,s,o,a,ec):128&f&&u.process(e,t,n,l,r,i,s,o,a,ec)}null!=c&&r&&nC(c,e&&e.ref,i,t||e,!t)},w=(e,t,n,l)=>{if(null==e)i(t.el=c(t.children),n,l);else{let n=t.el=e.el;t.children!==e.children&&p(n,t.children)}},E=(e,t,n,l)=>{null==e?i(t.el=f(t.children||""),n,l):t.el=e.el},A=(e,t,n,l)=>{[e.el,e.anchor]=S(e.children,t,n,l,e.el,e.anchor)},R=({el:e,anchor:t},n,l)=>{let r;for(;e&&e!==t;)r=g(e),i(e,n,l),e=r;i(t,n,l)},O=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=g(e),s(e),e=n;s(t)},N=(e,t,n,l,r,i,s,o,a)=>{"svg"===t.type?s="svg":"math"===t.type&&(s="mathml"),null==e?M(t,n,l,r,i,s,o,a):V(e,t,r,i,s,o,a)},M=(e,t,n,l,r,s,u,c)=>{let f,p;let{props:h,shapeFlag:g,transition:m,dirs:_}=e;if(f=e.el=a(e.type,s,h&&h.is,h),8&g?d(f,e.children):16&g&&F(e.children,f,null,l,r,lD(e,s),u,c),_&&t4(e,null,l,"created"),I(f,e,e.scopeId,u,l),h){for(let e in h)"value"===e||$(e)||o(f,e,null,h[e],s,l);"value"in h&&o(f,"value",null,h.value,s),(p=h.onVnodeBeforeMount)&&rC(p,l,e)}_&&t4(e,null,l,"beforeMount");let y=lV(r,m);y&&m.beforeEnter(f),i(f,t,n),((p=h&&h.onVnodeMounted)||y||_)&&lM(()=>{p&&rC(p,l,e),y&&m.enter(f),_&&t4(e,null,l,"mounted")},r)},I=(e,t,n,l,r)=>{if(n&&b(e,n),l)for(let t=0;t{for(let u=a;u{let a;let u=t.el=e.el,{patchFlag:c,dynamicChildren:f,dirs:p}=t;c|=16&e.patchFlag;let h=e.props||m,g=t.props||m;if(n&&lF(n,!1),(a=g.onVnodeBeforeUpdate)&&rC(a,n,t,e),p&&t4(t,e,n,"beforeUpdate"),n&&lF(n,!0),(h.innerHTML&&null==g.innerHTML||h.textContent&&null==g.textContent)&&d(u,""),f?U(e.dynamicChildren,f,u,n,l,lD(t,r),i):s||X(e,t,u,null,n,l,lD(t,r),i,!1),c>0){if(16&c)j(u,h,g,n,r);else if(2&c&&h.class!==g.class&&o(u,"class",null,g.class,r),4&c&&o(u,"style",h.style,g.style,r),8&c){let e=t.dynamicProps;for(let t=0;t{a&&rC(a,n,t,e),p&&t4(t,e,n,"updated")},l)},U=(e,t,n,l,r,i,s)=>{for(let o=0;o{if(t!==n){if(t!==m)for(let i in t)$(i)||i in n||o(e,i,t[i],null,r,l);for(let i in n){if($(i))continue;let s=n[i],a=t[i];s!==a&&"value"!==i&&o(e,i,a,s,r,l)}"value"in n&&o(e,"value",t.value,n.value,r)}},B=(e,t,n,l,r,s,o,a,u)=>{let f=t.el=e?e.el:c(""),p=t.anchor=e?e.anchor:c(""),{patchFlag:d,dynamicChildren:h,slotScopeIds:g}=t;g&&(a=a?a.concat(g):g),null==e?(i(f,n,l),i(p,n,l),F(t.children||[],n,p,r,s,o,a,u)):d>0&&64&d&&h&&e.dynamicChildren?(U(e.dynamicChildren,h,n,r,s,o,a),(null!=t.key||r&&t===r.subTree)&&lU(e,t,!0)):X(e,t,n,p,r,s,o,a,u)},H=(e,t,n,l,r,i,s,o,a)=>{t.slotScopeIds=o,null==e?512&t.shapeFlag?r.ctx.activate(t,n,l,s,a):W(t,n,l,r,i,s,a):z(e,t,a)},W=(e,t,n,l,r,i,s)=>{let o=e.component=function(e,t,n){let l=e.type,r=(t?t.appContext:e.appContext)||rx,i={uid:rw++,vnode:e,type:l,parent:t,appContext:r,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new eg(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(r.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:function e(t,n,l=!1){let r=l?lx:n.propsCache,i=r.get(t);if(i)return i;let s=t.props,o={},a=[],u=!1;if(!P(t)){let r=t=>{u=!0;let[l,r]=e(t,n,!0);x(o,l),r&&a.push(...r)};!l&&n.mixins.length&&n.mixins.forEach(r),t.extends&&r(t.extends),t.mixins&&t.mixins.forEach(r)}if(!s&&!u)return L(t)&&r.set(t,_),_;if(T(s))for(let e=0;e{let l=e(t,n,!0);l&&(a=!0,x(o,l))};!l&&n.mixins.length&&n.mixins.forEach(r),t.extends&&r(t.extends),t.mixins&&t.mixins.forEach(r)}return s||a?(T(s)?s.forEach(e=>o[e]=null):x(o,s),L(t)&&r.set(t,o),o):(L(t)&&r.set(t,null),null)}(l,r),emit:null,emitted:null,propsDefaults:m,inheritAttrs:l.inheritAttrs,ctx:m,data:m,props:m,attrs:m,slots:m,refs:m,setupState:m,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return i.ctx={_:i},i.root=t?t.root:i,i.emit=lq.bind(null,i),e.ce&&e.ce(i),i}(e,l,r);nF(e)&&(o.ctx.renderer=ec),function(e,t=!1,n=!1){t&&u(t);let{props:l,children:r}=e.vnode,i=rR(e);(function(e,t,n,l=!1){let r={},i=ly();for(let n in e.propsDefaults=Object.create(null),lS(e,t,r,i),e.propsOptions[0])n in r||(r[n]=void 0);n?e.props=l?r:ta(r):e.type.props?e.props=r:e.props=i,e.attrs=i})(e,l,i,t),lN(e,r,n),i&&function(e,t){let n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,n7);let{setup:l}=n;if(l){eA();let n=e.setupContext=l.length>1?rI(e):null,r=rT(e),i=tF(l,e,0,[e.props,n]),s=D(i);if(eR(),r(),(s||e.sp)&&!nL(e)&&nS(e),s){if(i.then(rA,rA),t)return i.then(n=>{rN(e,n,t)}).catch(t=>{tU(t,e,0)});e.asyncDep=i}else rN(e,i,t)}else rP(e,t)}(e,t),t&&u(!1)}(o,!1,s),o.asyncDep?(r&&r.registerDep(o,G,s),e.el||E(null,o.subTree=rh(l7),t,n)):G(o,e,t,n,r,i,s)},z=(e,t,n)=>{let l=t.component=e.component;if(function(e,t,n){let{props:l,children:r,component:i}=e,{props:s,children:o,patchFlag:a}=t,u=i.emitsOptions;if(t.dirs||t.transition)return!0;if(!n||!(a>=0))return(!!r||!!o)&&(!o||!o.$stable)||l!==s&&(l?!s||lY(l,s,u):!!s);if(1024&a)return!0;if(16&a)return l?lY(l,s,u):!!s;if(8&a){let e=t.dynamicProps;for(let t=0;t{let a=()=>{if(e.isMounted){let t,{next:n,bu:l,u:r,parent:u,vnode:c}=e;{let t=function e(t){let n=t.subTree.component;if(n)return n.asyncDep&&!n.asyncResolved?n:e(n)}(e);if(t){n&&(n.el=c.el,J(e,n,o)),t.asyncDep.then(()=>{e.isUnmounted||a()});return}}let f=n;lF(e,!1),n?(n.el=c.el,J(e,n,o)):n=c,l&&Z(l),(t=n.props&&n.props.onVnodeBeforeUpdate)&&rC(t,u,n,c),lF(e,!0);let p=lJ(e),d=e.subTree;e.subTree=p,C(d,p,h(d.el),eo(d),e,i,s),n.el=p.el,null===f&&lQ(e,p.el),r&&lM(r,i),(t=n.props&&n.props.onVnodeUpdated)&&lM(()=>rC(t,u,n,c),i)}else{let o;let{el:a,props:u}=t,{bm:c,m:f,parent:p,root:d,type:h}=e,g=nL(t);if(lF(e,!1),c&&Z(c),!g&&(o=u&&u.onVnodeBeforeMount)&&rC(o,p,t),lF(e,!0),a&&r){let t=()=>{e.subTree=lJ(e),r(a,e.subTree,e,i,null)};g&&h.__asyncHydrate?h.__asyncHydrate(a,e,t):t()}else{d.ce&&d.ce._injectChildStyle(h);let r=e.subTree=lJ(e);C(null,r,n,l,e,i,s),t.el=r.el}if(f&&lM(f,i),!g&&(o=u&&u.onVnodeMounted)){let e=t;lM(()=>rC(o,p,e),i)}(256&t.shapeFlag||p&&nL(p.vnode)&&256&p.vnode.shapeFlag)&&e.a&&lM(e.a,i),e.isMounted=!0,t=n=l=null}};e.scope.on();let u=e.effect=new em(a);e.scope.off();let c=e.update=u.run.bind(u),f=e.job=u.runIfDirty.bind(u);f.i=e,f.id=e.uid,u.scheduler=()=>tG(f),lF(e,!0),c()},J=(e,t,n)=>{t.component=e;let l=e.vnode.props;e.vnode=t,e.next=null,function(e,t,n,l){let{props:r,attrs:i,vnode:{patchFlag:s}}=e,o=tg(r),[a]=e.propsOptions,u=!1;if((l||s>0)&&!(16&s)){if(8&s){let n=e.vnode.dynamicProps;for(let l=0;l{let u=e&&e.children,c=e?e.shapeFlag:0,f=t.children,{patchFlag:p,shapeFlag:h}=t;if(p>0){if(128&p){Q(u,f,n,l,r,i,s,o,a);return}if(256&p){Y(u,f,n,l,r,i,s,o,a);return}}8&h?(16&c&&es(u,r,i),f!==u&&d(n,f)):16&c?16&h?Q(u,f,n,l,r,i,s,o,a):es(u,r,i,!0):(8&c&&d(n,""),16&h&&F(f,n,l,r,i,s,o,a))},Y=(e,t,n,l,r,i,s,o,a)=>{let u;e=e||_,t=t||_;let c=e.length,f=t.length,p=Math.min(c,f);for(u=0;uf?es(e,r,i,!0,!1,p):F(t,n,l,r,i,s,o,a,p)},Q=(e,t,n,l,r,i,s,o,a)=>{let u=0,c=t.length,f=e.length-1,p=c-1;for(;u<=f&&u<=p;){let l=e[u],c=t[u]=a?ry(t[u]):r_(t[u]);if(rc(l,c))C(l,c,n,null,r,i,s,o,a);else break;u++}for(;u<=f&&u<=p;){let l=e[f],u=t[p]=a?ry(t[p]):r_(t[p]);if(rc(l,u))C(l,u,n,null,r,i,s,o,a);else break;f--,p--}if(u>f){if(u<=p){let e=p+1,f=ep)for(;u<=f;)en(e[u],r,i,!0),u++;else{let d;let h=u,g=u,m=new Map;for(u=g;u<=p;u++){let e=t[u]=a?ry(t[u]):r_(t[u]);null!=e.key&&m.set(e.key,u)}let y=0,b=p-g+1,S=!1,x=0,w=Array(b);for(u=0;u=b){en(c,r,i,!0);continue}if(null!=c.key)l=m.get(c.key);else for(d=g;d<=p;d++)if(0===w[d-g]&&rc(c,t[d])){l=d;break}void 0===l?en(c,r,i,!0):(w[l-g]=u+1,l>=x?x=l:S=!0,C(c,t[l],n,null,r,i,s,o,a),y++)}let E=S?function(e){let t,n,l,r,i;let s=e.slice(),o=[0],a=e.length;for(t=0;t>1]]0&&(s[t]=o[l-1]),o[l]=t)}}for(l=o.length,r=o[l-1];l-- >0;)o[l]=r,r=s[r];return o}(w):_;for(d=E.length-1,u=b-1;u>=0;u--){let e=g+u,f=t[e],p=e+1{let{el:s,type:o,transition:a,children:u,shapeFlag:c}=e;if(6&c){ee(e.component.subTree,t,n,l);return}if(128&c){e.suspense.move(t,n,l);return}if(64&c){o.move(e,t,n,ec);return}if(o===l5){i(s,t,n);for(let e=0;ea.enter(s),r);else{let{leave:e,delayLeave:l,afterLeave:r}=a,o=()=>i(s,t,n),u=()=>{e(s,()=>{o(),r&&r()})};l?l(s,o,u):u()}}else i(s,t,n)},en=(e,t,n,l=!1,r=!1)=>{let i;let{type:s,props:o,ref:a,children:u,dynamicChildren:c,shapeFlag:f,patchFlag:p,dirs:d,cacheIndex:h}=e;if(-2===p&&(r=!1),null!=a&&nC(a,null,n,e,!0),null!=h&&(t.renderCache[h]=void 0),256&f){t.ctx.deactivate(e);return}let g=1&f&&d,m=!nL(e);if(m&&(i=o&&o.onVnodeBeforeUnmount)&&rC(i,t,e),6&f)ei(e.component,n,l);else{if(128&f){e.suspense.unmount(n,l);return}g&&t4(e,null,t,"beforeUnmount"),64&f?e.type.remove(e,t,n,ec,l):c&&!c.hasOnce&&(s!==l5||p>0&&64&p)?es(c,t,n,!1,!0):(s===l5&&384&p||!r&&16&f)&&es(u,t,n),l&&el(e)}(m&&(i=o&&o.onVnodeUnmounted)||g)&&lM(()=>{i&&rC(i,t,e),g&&t4(e,null,t,"unmounted")},n)},el=e=>{let{type:t,el:n,anchor:l,transition:r}=e;if(t===l5){er(n,l);return}if(t===re){O(e);return}let i=()=>{s(n),r&&!r.persisted&&r.afterLeave&&r.afterLeave()};if(1&e.shapeFlag&&r&&!r.persisted){let{leave:t,delayLeave:l}=r,s=()=>t(n,i);l?l(e.el,i,s):s()}else i()},er=(e,t)=>{let n;for(;e!==t;)n=g(e),s(e),e=n;s(t)},ei=(e,t,n)=>{let{bum:l,scope:r,job:i,subTree:s,um:o,m:a,a:u}=e;lj(a),lj(u),l&&Z(l),r.stop(),i&&(i.flags|=8,en(s,e,t,n)),o&&lM(o,t),lM(()=>{e.isUnmounted=!0},t),t&&t.pendingBranch&&!t.isUnmounted&&e.asyncDep&&!e.asyncResolved&&e.suspenseId===t.pendingId&&(t.deps--,0===t.deps&&t.resolve())},es=(e,t,n,l=!1,r=!1,i=0)=>{for(let s=i;s{if(6&e.shapeFlag)return eo(e.component.subTree);if(128&e.shapeFlag)return e.suspense.next();let t=g(e.anchor||e.el),n=t&&t[t8];return n?g(n):t},ea=!1,eu=(e,t,n)=>{null==e?t._vnode&&en(t._vnode,null,null,!0):C(t._vnode||null,e,t,null,null,null,n),t._vnode=e,ea||(ea=!0,tZ(),tY(),ea=!1)},ec={p:C,um:en,m:ee,r:el,mt:W,mc:F,pc:X,pbc:U,n:eo,o:e};return t&&([l,r]=t(ec)),{render:eu,hydrate:l,createApp:(n=l,function(e,t=null){P(e)||(e=x({},e)),null==t||L(t)||(t=null);let l=ld(),r=new WeakSet,i=[],s=!1,o=l.app={_uid:lh++,_component:e,_props:t,_container:null,_context:l,_instance:null,version:rj,get config(){return l.config},set config(v){},use:(e,...t)=>(r.has(e)||(e&&P(e.install)?(r.add(e),e.install(o,...t)):P(e)&&(r.add(e),e(o,...t))),o),mixin:e=>(l.mixins.includes(e)||l.mixins.push(e),o),component:(e,t)=>t?(l.components[e]=t,o):l.components[e],directive:(e,t)=>t?(l.directives[e]=t,o):l.directives[e],mount(r,i,a){if(!s){let u=o._ceVNode||rh(e,t);return u.appContext=l,!0===a?a="svg":!1===a&&(a=void 0),i&&n?n(u,r):eu(u,r,a),s=!0,o._container=r,r.__vue_app__=o,rL(u.component)}},onUnmount(e){i.push(e)},unmount(){s&&(tV(i,o._instance,16),eu(null,o._container),delete o._container.__vue_app__)},provide:(e,t)=>(l.provides[e]=t,o),runWithContext(e){let t=lg;lg=o;try{return e()}finally{lg=t}}};return o})}}function lD({type:e,props:t},n){return"svg"===n&&"foreignObject"===e||"mathml"===n&&"annotation-xml"===e&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function lF({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function lV(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function lU(e,t,n=!1){let l=e.children,r=t.children;if(T(l)&&T(r))for(let e=0;etV(e,u,t,n);let c=!1;return"post"===s?a.scheduler=e=>{lM(e,u&&u.suspense)}:"sync"!==s&&(c=!0,a.scheduler=(e,t)=>{t?e():tG(e)}),a.augmentJob=e=>{t&&(e.flags|=4),c&&(e.flags|=2,u&&(e.id=u.uid,e.i=u))},function(e,t,n=m){let l,i,s,o;let{immediate:a,deep:u,once:c,scheduler:f,augmentJob:p,call:h}=n,g=e=>u?e:td(e)||!1===u||0===u?tD(e,1):tD(e),_=!1,b=!1;if(ty(e)?(i=()=>e.value,_=td(e)):tf(e)?(i=()=>g(e),_=!0):T(e)?(b=!0,_=e.some(e=>tf(e)||td(e)),i=()=>e.map(e=>ty(e)?e.value:tf(e)?g(e):P(e)?h?h(e,2):e():void 0)):i=P(e)?t?h?()=>h(e,2):e:()=>{if(s){eA();try{s()}finally{eR()}}let t=d;d=l;try{return h?h(e,3,[o]):e(o)}finally{d=t}}:y,t&&u){let e=i,t=!0===u?1/0:u;i=()=>tD(e(),t)}let S=r,C=()=>{l.stop(),S&&S.active&&w(S.effects,l)};if(c&&t){let e=t;t=(...t)=>{e(...t),C()}}let x=b?Array(e.length).fill(tM):tM,E=e=>{if(1&l.flags&&(l.dirty||e)){if(t){let e=l.run();if(u||_||(b?e.some((e,t)=>X(e,x[t])):X(e,x))){s&&s();let n=d;d=l;try{let n=[e,x===tM?void 0:b&&x[0]===tM?[]:x,o];h?h(t,3,n):t(...n),x=e}finally{d=n}}}else l.run()}};return p&&p(E),(l=new em(i)).scheduler=f?()=>f(E,!1):E,o=e=>tL(e,!1,l),s=l.onStop=()=>{let e=tI.get(l);if(e){if(h)h(e,4);else for(let t of e)t();tI.delete(l)}},t?a?E(!0):x=l.run():f?f(E.bind(null,!0),!0):l.run(),C.pause=l.pause.bind(l),C.resume=l.resume.bind(l),C.stop=C,C}(e,t,a)}function lW(e,t,n){let l;let r=this.proxy,i=M(e)?e.includes(".")?lK(r,e):()=>r[e]:e.bind(r,r);P(t)?l=t:(l=t.handler,n=t);let s=rT(this),o=lH(i,l.bind(r),n);return s(),o}function lK(e,t){let n=t.split(".");return()=>{let t=e;for(let e=0;e"modelValue"===t||"model-value"===t?e.modelModifiers:e[`${t}Modifiers`]||e[`${K(t)}Modifiers`]||e[`${q(t)}Modifiers`];function lq(e,t,...n){let l;if(e.isUnmounted)return;let r=e.vnode.props||m,i=n,s=t.startsWith("update:"),o=s&&lz(r,t.slice(7));o&&(o.trim&&(i=n.map(e=>M(e)?e.trim():e)),o.number&&(i=n.map(Q)));let a=r[l=J(t)]||r[l=J(K(t))];!a&&s&&(a=r[l=J(q(t))]),a&&tV(a,e,6,i);let u=r[l+"Once"];if(u){if(e.emitted){if(e.emitted[l])return}else e.emitted={};e.emitted[l]=!0,tV(u,e,6,i)}}function lG(e,t){return!!(e&&S(t))&&(k(e,(t=t.slice(2).replace(/Once$/,""))[0].toLowerCase()+t.slice(1))||k(e,q(t))||k(e,t))}function lJ(e){let t,n;let{type:l,vnode:r,proxy:i,withProxy:s,propsOptions:[o],slots:a,attrs:u,emit:c,render:f,renderCache:p,props:d,data:h,setupState:g,ctx:m,inheritAttrs:_}=e,y=t2(e);try{if(4&r.shapeFlag){let e=s||i;t=r_(f.call(e,e,p,d,g,h,m)),n=u}else t=r_(l.length>1?l(d,{attrs:u,slots:a,emit:c}):l(d,null)),n=l.props?u:lX(u)}catch(n){rt.length=0,tU(n,e,1),t=rh(l7)}let b=t;if(n&&!1!==_){let e=Object.keys(n),{shapeFlag:t}=b;e.length&&7&t&&(o&&e.some(C)&&(n=lZ(n,o)),b=rv(b,n,!1,!0))}return r.dirs&&((b=rv(b,null,!1,!0)).dirs=b.dirs?b.dirs.concat(r.dirs):r.dirs),r.transition&&n_(b,r.transition),t=b,t2(y),t}let lX=e=>{let t;for(let n in e)("class"===n||"style"===n||S(n))&&((t||(t={}))[n]=e[n]);return t},lZ=(e,t)=>{let n={};for(let l in e)C(l)&&l.slice(9)in t||(n[l]=e[l]);return n};function lY(e,t,n){let l=Object.keys(t);if(l.length!==Object.keys(e).length)return!0;for(let r=0;re.__isSuspense,l1=0;function l2(e,t){let n=e.props&&e.props[t];P(n)&&n()}function l6(e,t,n,l,r,i,s,o,a,u,c=!1){let f;let{p:p,m:d,um:h,n:g,o:{parentNode:m,remove:_}}=u,y=function(e){let t=e.props&&e.props.suspensible;return null!=t&&!1!==t}(e);y&&t&&t.pendingBranch&&(f=t.pendingId,t.deps++);let b=e.props?ee(e.props.timeout):void 0,S=i,C={vnode:e,parent:t,parentComponent:n,namespace:s,container:l,hiddenContainer:r,deps:0,pendingId:l1++,timeout:"number"==typeof b?b:-1,activeBranch:null,pendingBranch:null,isInFallback:!c,isHydrating:c,isUnmounted:!1,effects:[],resolve(e=!1,n=!1){let{vnode:l,activeBranch:r,pendingBranch:s,pendingId:o,effects:a,parentComponent:u,container:c}=C,p=!1;C.isHydrating?C.isHydrating=!1:e||((p=r&&s.transition&&"out-in"===s.transition.mode)&&(r.transition.afterLeave=()=>{o===C.pendingId&&(d(s,c,i===S?g(r):i,0),tX(a))}),r&&(m(r.el)===c&&(i=g(r)),h(r,u,C,!0)),p||d(s,c,i,0)),l3(C,s),C.pendingBranch=null,C.isInFallback=!1;let _=C.parent,b=!1;for(;_;){if(_.pendingBranch){_.effects.push(...a),b=!0;break}_=_.parent}b||p||tX(a),C.effects=[],y&&t&&t.pendingBranch&&f===t.pendingId&&(t.deps--,0!==t.deps||n||t.resolve()),l2(l,"onResolve")},fallback(e){if(!C.pendingBranch)return;let{vnode:t,activeBranch:n,parentComponent:l,container:r,namespace:i}=C;l2(t,"onFallback");let s=g(n),u=()=>{C.isInFallback&&(p(null,e,r,s,l,null,i,o,a),l3(C,e))},c=e.transition&&"out-in"===e.transition.mode;c&&(n.transition.afterLeave=u),C.isInFallback=!0,h(n,l,null,!0),c||u()},move(e,t,n){C.activeBranch&&d(C.activeBranch,e,t,n),C.container=e},next:()=>C.activeBranch&&g(C.activeBranch),registerDep(e,t,n){let l=!!C.pendingBranch;l&&C.deps++;let r=e.vnode.el;e.asyncDep.catch(t=>{tU(t,e,0)}).then(i=>{if(e.isUnmounted||C.isUnmounted||C.pendingId!==e.suspenseId)return;e.asyncResolved=!0;let{vnode:o}=e;rN(e,i,!1),r&&(o.el=r);let a=!r&&e.subTree.el;t(e,o,m(r||e.subTree.el),r?null:g(e.subTree),C,s,n),a&&_(a),lQ(e,o.el),l&&0==--C.deps&&C.resolve()})},unmount(e,t){C.isUnmounted=!0,C.activeBranch&&h(C.activeBranch,n,e,t),C.pendingBranch&&h(C.pendingBranch,n,e,t)}};return C}function l4(e){let t;if(P(e)){let n=ri&&e._c;n&&(e._d=!1,rl()),e=e(),n&&(e._d=!0,t=rn,rr())}return T(e)&&(e=function(e,t=!0){let n;for(let t=0;tt!==e)),e}function l8(e,t){t&&t.pendingBranch?T(e)?t.effects.push(...e):t.effects.push(e):tX(e)}function l3(e,t){e.activeBranch=t;let{vnode:n,parentComponent:l}=e,r=t.el;for(;!r&&t.component;)r=(t=t.component.subTree).el;n.el=r,l&&l.subTree===n&&(l.vnode.el=r,lQ(l,r))}let l5=Symbol.for("v-fgt"),l9=Symbol.for("v-txt"),l7=Symbol.for("v-cmt"),re=Symbol.for("v-stc"),rt=[],rn=null;function rl(e=!1){rt.push(rn=e?null:[])}function rr(){rt.pop(),rn=rt[rt.length-1]||null}let ri=1;function rs(e,t=!1){ri+=e,e<0&&rn&&t&&(rn.hasOnce=!0)}function ro(e){return e.dynamicChildren=ri>0?rn||_:null,rr(),ri>0&&rn&&rn.push(e),e}function ra(e,t,n,l,r){return ro(rh(e,t,n,l,r,!0))}function ru(e){return!!e&&!0===e.__v_isVNode}function rc(e,t){return e.type===t.type&&e.key===t.key}let rf=({key:e})=>null!=e?e:null,rp=({ref:e,ref_key:t,ref_for:n})=>("number"==typeof e&&(e=""+e),null!=e?M(e)||ty(e)||P(e)?{i:t0,r:e,k:t,f:!!n}:e:null);function rd(e,t=null,n=null,l=0,r=null,i=e===l5?0:1,s=!1,o=!1){let a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&rf(t),ref:t&&rp(t),scopeId:t1,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:l,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:t0};return o?(rb(a,n),128&i&&e.normalize(a)):n&&(a.shapeFlag|=M(n)?8:16),ri>0&&!s&&rn&&(a.patchFlag>0||6&i)&&32!==a.patchFlag&&rn.push(a),a}let rh=function(e,t=null,n=null,l=0,r=null,i=!1){var s;if(e&&e!==n6||(e=l7),ru(e)){let l=rv(e,t,!0);return n&&rb(l,n),ri>0&&!i&&rn&&(6&l.shapeFlag?rn[rn.indexOf(e)]=l:rn.push(l)),l.patchFlag=-2,l}if(P(s=e)&&"__vccOpts"in s&&(e=e.__vccOpts),t){let{class:e,style:n}=t=rg(t);e&&!M(e)&&(t.class=eo(e)),L(n)&&(th(n)&&!T(n)&&(n=x({},n)),t.style=el(n))}let o=M(e)?1:l0(e)?128:t3(e)?64:L(e)?4:P(e)?2:0;return rd(e,t,n,l,r,o,i,!0)};function rg(e){return e?th(e)||lb(e)?x({},e):e:null}function rv(e,t,n=!1,l=!1){let{props:r,ref:i,patchFlag:s,children:o,transition:a}=e,u=t?rS(r||{},t):r,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&rf(u),ref:t&&t.ref?n&&i?T(i)?i.concat(rp(t)):[i,rp(t)]:rp(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:o,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==l5?-1===s?16:16|s:s,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&rv(e.ssContent),ssFallback:e.ssFallback&&rv(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&l&&n_(c,a.clone(c)),c}function rm(e=" ",t=0){return rh(l9,null,e,t)}function r_(e){return null==e||"boolean"==typeof e?rh(l7):T(e)?rh(l5,null,e.slice()):ru(e)?ry(e):rh(l9,null,String(e))}function ry(e){return null===e.el&&-1!==e.patchFlag||e.memo?e:rv(e)}function rb(e,t){let n=0,{shapeFlag:l}=e;if(null==t)t=null;else if(T(t))n=16;else if("object"==typeof t){if(65&l){let n=t.default;n&&(n._c&&(n._d=!1),rb(e,n()),n._c&&(n._d=!0));return}{n=32;let l=t._;l||lb(t)?3===l&&t0&&(1===t0.slots._?t._=1:(t._=2,e.patchFlag|=1024)):t._ctx=t0}}else P(t)?(t={default:t,_ctx:t0},n=32):(t=String(t),64&l?(n=16,t=[rm(t)]):n=8);e.children=t,e.shapeFlag|=n}function rS(...e){let t={};for(let n=0;nrE||t0;a=e=>{rE=e},u=e=>{rO=e};let rT=e=>{let t=rE;return a(e),e.scope.on(),()=>{e.scope.off(),a(t)}},rA=()=>{rE&&rE.scope.off(),a(null)};function rR(e){return 4&e.vnode.shapeFlag}let rO=!1;function rN(e,t,n){P(t)?e.render=t:L(t)&&(e.setupState=tk(t)),rP(e,n)}function rP(e,t,n){let l=e.type;if(!e.render){if(!t&&c&&!l.render){let t=l.template||li(e).template;if(t){let{isCustomElement:n,compilerOptions:r}=e.appContext.config,{delimiters:i,compilerOptions:s}=l,o=x(x({isCustomElement:n,delimiters:i},r),s);l.render=c(t,o)}}e.render=l.render||y,f&&f(e)}{let t=rT(e);eA();try{!function(e){let t=li(e),n=e.proxy,l=e.ctx;ll=!1,t.beforeCreate&&lr(t.beforeCreate,e,"bc");let{data:r,computed:i,methods:s,watch:o,provide:a,inject:u,created:c,beforeMount:f,mounted:p,beforeUpdate:d,updated:h,activated:g,deactivated:m,beforeDestroy:_,beforeUnmount:b,destroyed:S,unmounted:C,render:x,renderTracked:w,renderTriggered:E,errorCaptured:k,serverPrefetch:A,expose:R,inheritAttrs:O,components:N,directives:I,filters:D}=t;if(u&&function(e,t,n=y){for(let n in T(e)&&(e=lu(e)),e){let l;let r=e[n];ty(l=L(r)?"default"in r?lm(r.from||n,r.default,!0):lm(r.from||n):lm(r))?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>l.value,set:e=>l.value=e}):t[n]=l}}(u,l,null),s)for(let e in s){let t=s[e];P(t)&&(l[e]=t.bind(n))}if(r){let t=r.call(n,n);L(t)&&(e.data=to(t))}if(ll=!0,i)for(let e in i){let t=i[e],r=P(t)?t.bind(n,n):P(t.get)?t.get.bind(n,n):y,s=rF({get:r,set:!P(t)&&P(t.set)?t.set.bind(n):y});Object.defineProperty(l,e,{enumerable:!0,configurable:!0,get:()=>s.value,set:e=>s.value=e})}if(o)for(let e in o)!function e(t,n,l,r){let i=r.includes(".")?lK(l,r):()=>l[r];if(M(t)){let e=n[t];P(e)&&lH(i,e,void 0)}else if(P(t)){var s;s=t.bind(l),lH(i,s,void 0)}else if(L(t)){if(T(t))t.forEach(t=>e(t,n,l,r));else{let e=P(t.handler)?t.handler.bind(l):n[t.handler];P(e)&&lH(i,e,t)}}}(o[e],l,n,e);if(a){let e=P(a)?a.call(n):a;Reflect.ownKeys(e).forEach(t=>{lv(t,e[t])})}function F(e,t){T(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(c&&lr(c,e,"c"),F(nz,f),F(nq,p),F(nG,d),F(nJ,h),F(nU,g),F(nj,m),F(n1,k),F(n0,w),F(nQ,E),F(nX,b),F(nZ,C),F(nY,A),T(R)){if(R.length){let t=e.exposed||(e.exposed={});R.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t})})}else e.exposed||(e.exposed={})}x&&e.render===y&&(e.render=x),null!=O&&(e.inheritAttrs=O),N&&(e.components=N),I&&(e.directives=I)}(e)}finally{eR(),t()}}}let rM={get:(e,t)=>(eV(e,"get",""),e[t])};function rI(e){return{attrs:new Proxy(e.attrs,rM),slots:e.slots,emit:e.emit,expose:t=>{e.exposed=t||{}}}}function rL(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(tk(tv(e.exposed)),{get:(t,n)=>n in t?t[n]:n in n5?n5[n](e):void 0,has:(e,t)=>t in e||t in n5})):e.proxy}function rD(e,t=!0){return P(e)?e.displayName||e.name:e.name||t&&e.__name}let rF=(e,t)=>(function(e,t,n=!1){let l,r;return P(e)?l=e:(l=e.get,r=e.set),new tP(l,r,n)})(e,0,rO);function rV(e,t,n){let l=arguments.length;return 2!==l?(l>3?n=Array.prototype.slice.call(arguments,2):3===l&&ru(n)&&(n=[n]),rh(e,t,n)):!L(t)||T(t)?rh(e,null,t):ru(t)?rh(e,null,[t]):rh(e,t)}function rU(e,t){let n=e.memo;if(n.length!=t.length)return!1;for(let e=0;e0&&rn&&rn.push(e),!0}let rj="3.5.13",rB="undefined"!=typeof window&&window.trustedTypes;if(rB)try{h=rB.createPolicy("vue",{createHTML:e=>e})}catch(e){}let r$=h?e=>h.createHTML(e):e=>e,rH="undefined"!=typeof document?document:null,rW=rH&&rH.createElement("template"),rK="transition",rz="animation",rq=Symbol("_vtc"),rG={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},rJ=x({},nc,rG),rX=((t=(e,{slots:t})=>rV(nd,rQ(e),t)).displayName="Transition",t.props=rJ,t),rZ=(e,t=[])=>{T(e)?e.forEach(e=>e(...t)):e&&e(...t)},rY=e=>!!e&&(T(e)?e.some(e=>e.length>1):e.length>1);function rQ(e){let t={};for(let n in e)n in rG||(t[n]=e[n]);if(!1===e.css)return t;let{name:n="v",type:l,duration:r,enterFromClass:i=`${n}-enter-from`,enterActiveClass:s=`${n}-enter-active`,enterToClass:o=`${n}-enter-to`,appearFromClass:a=i,appearActiveClass:u=s,appearToClass:c=o,leaveFromClass:f=`${n}-leave-from`,leaveActiveClass:p=`${n}-leave-active`,leaveToClass:d=`${n}-leave-to`}=e,h=function(e){if(null==e)return null;if(L(e))return[ee(e.enter),ee(e.leave)];{let t=ee(e);return[t,t]}}(r),g=h&&h[0],m=h&&h[1],{onBeforeEnter:_,onEnter:y,onEnterCancelled:b,onLeave:S,onLeaveCancelled:C,onBeforeAppear:w=_,onAppear:E=y,onAppearCancelled:k=b}=t,T=(e,t,n,l)=>{e._enterCancelled=l,r1(e,t?c:o),r1(e,t?u:s),n&&n()},A=(e,t)=>{e._isLeaving=!1,r1(e,f),r1(e,d),r1(e,p),t&&t()},R=e=>(t,n)=>{let r=e?E:y,s=()=>T(t,e,n);rZ(r,[t,s]),r2(()=>{r1(t,e?a:i),r0(t,e?c:o),rY(r)||r4(t,l,g,s)})};return x(t,{onBeforeEnter(e){rZ(_,[e]),r0(e,i),r0(e,s)},onBeforeAppear(e){rZ(w,[e]),r0(e,a),r0(e,u)},onEnter:R(!1),onAppear:R(!0),onLeave(e,t){e._isLeaving=!0;let n=()=>A(e,t);r0(e,f),e._enterCancelled?(r0(e,p),r9()):(r9(),r0(e,p)),r2(()=>{e._isLeaving&&(r1(e,f),r0(e,d),rY(S)||r4(e,l,m,n))}),rZ(S,[e,n])},onEnterCancelled(e){T(e,!1,void 0,!0),rZ(b,[e])},onAppearCancelled(e){T(e,!0,void 0,!0),rZ(k,[e])},onLeaveCancelled(e){A(e),rZ(C,[e])}})}function r0(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.add(t)),(e[rq]||(e[rq]=new Set)).add(t)}function r1(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.remove(t));let n=e[rq];n&&(n.delete(t),n.size||(e[rq]=void 0))}function r2(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let r6=0;function r4(e,t,n,l){let r=e._endId=++r6,i=()=>{r===e._endId&&l()};if(null!=n)return setTimeout(i,n);let{type:s,timeout:o,propCount:a}=r8(e,t);if(!s)return l();let u=s+"end",c=0,f=()=>{e.removeEventListener(u,p),i()},p=t=>{t.target===e&&++c>=a&&f()};setTimeout(()=>{c(n[e]||"").split(", "),r=l(`${rK}Delay`),i=l(`${rK}Duration`),s=r3(r,i),o=l(`${rz}Delay`),a=l(`${rz}Duration`),u=r3(o,a),c=null,f=0,p=0;t===rK?s>0&&(c=rK,f=s,p=i.length):t===rz?u>0&&(c=rz,f=u,p=a.length):p=(c=(f=Math.max(s,u))>0?s>u?rK:rz:null)?c===rK?i.length:a.length:0;let d=c===rK&&/\b(transform|all)(,|$)/.test(l(`${rK}Property`).toString());return{type:c,timeout:f,propCount:p,hasTransform:d}}function r3(e,t){for(;e.lengthr5(t)+r5(e[n])))}function r5(e){return"auto"===e?0:1e3*Number(e.slice(0,-1).replace(",","."))}function r9(){return document.body.offsetHeight}let r7=Symbol("_vod"),ie=Symbol("_vsh");function it(e,t){e.style.display=t?e[r7]:"none",e[ie]=!t}let il=Symbol("");function ir(e,t){if(1===e.nodeType){let n=e.style,l="";for(let e in t)n.setProperty(`--${e}`,t[e]),l+=`--${e}: ${t[e]};`;n[il]=l}}let ii=/(^|;)\s*display\s*:/,is=/\s*!important$/;function io(e,t,n){if(T(n))n.forEach(n=>io(e,t,n));else if(null==n&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{let l=function(e,t){let n=iu[t];if(n)return n;let l=K(t);if("filter"!==l&&l in e)return iu[t]=l;l=G(l);for(let n=0;nim||(i_.then(()=>im=0),im=Date.now()),ib=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)>96&&123>e.charCodeAt(2),iS={};function iC(e,t,n){let l=nb(e,t);j(l)&&x(l,t);class r extends iw{constructor(e){super(l,e,n)}}return r.def=l,r}let ix="undefined"!=typeof HTMLElement?HTMLElement:class{};class iw extends ix{constructor(e,t={},n=i0){super(),this._def=e,this._props=t,this._createApp=n,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._ob=null,this.shadowRoot&&n!==i0?this._root=this.shadowRoot:!1!==e.shadowRoot?(this.attachShadow({mode:"open"}),this._root=this.shadowRoot):this._root=this,this._def.__asyncLoader||this._resolveProps(this._def)}connectedCallback(){if(!this.isConnected)return;this.shadowRoot||this._parseSlots(),this._connected=!0;let e=this;for(;e=e&&(e.parentNode||e.host);)if(e instanceof iw){this._parent=e;break}this._instance||(this._resolved?(this._setParent(),this._update()):e&&e._pendingResolve?this._pendingResolve=e._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(e=this._parent){e&&(this._instance.parent=e._instance,this._instance.provides=e._instance.provides)}disconnectedCallback(){this._connected=!1,tq(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null)})}_resolveDef(){if(this._pendingResolve)return;for(let e=0;e{for(let t of e)this._setAttr(t.attributeName)}),this._ob.observe(this,{attributes:!0});let e=(e,t=!1)=>{let n;this._resolved=!0,this._pendingResolve=void 0;let{props:l,styles:r}=e;if(l&&!T(l))for(let e in l){let t=l[e];(t===Number||t&&t.type===Number)&&(e in this._props&&(this._props[e]=ee(this._props[e])),(n||(n=Object.create(null)))[K(e)]=!0)}this._numberProps=n,t&&this._resolveProps(e),this.shadowRoot&&this._applyStyles(r),this._mount(e)},t=this._def.__asyncLoader;t?this._pendingResolve=t().then(t=>e(this._def=t,!0)):e(this._def)}_mount(e){this._app=this._createApp(e),e.configureApp&&e.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);let t=this._instance&&this._instance.exposed;if(t)for(let e in t)k(this,e)||Object.defineProperty(this,e,{get:()=>tw(t[e])})}_resolveProps(e){let{props:t}=e,n=T(t)?t:Object.keys(t||{});for(let e of Object.keys(this))"_"!==e[0]&&n.includes(e)&&this._setProp(e,this[e]);for(let e of n.map(K))Object.defineProperty(this,e,{get(){return this._getProp(e)},set(t){this._setProp(e,t,!0,!0)}})}_setAttr(e){if(e.startsWith("data-v-"))return;let t=this.hasAttribute(e),n=t?this.getAttribute(e):iS,l=K(e);t&&this._numberProps&&this._numberProps[l]&&(n=ee(n)),this._setProp(l,n,!1,!0)}_getProp(e){return this._props[e]}_setProp(e,t,n=!0,l=!1){if(t!==this._props[e]&&(t===iS?delete this._props[e]:(this._props[e]=t,"key"===e&&this._app&&(this._app._ceVNode.key=t)),l&&this._instance&&this._update(),n)){let n=this._ob;n&&n.disconnect(),!0===t?this.setAttribute(q(e),""):"string"==typeof t||"number"==typeof t?this.setAttribute(q(e),t+""):t||this.removeAttribute(q(e)),n&&n.observe(this,{attributes:!0})}}_update(){iQ(this._createVNode(),this._root)}_createVNode(){let e={};this.shadowRoot||(e.onVnodeMounted=e.onVnodeUpdated=this._renderSlots.bind(this));let t=rh(this._def,x(e,this._props));return this._instance||(t.ce=e=>{this._instance=e,e.ce=this,e.isCE=!0;let t=(e,t)=>{this.dispatchEvent(new CustomEvent(e,j(t[0])?x({detail:t},t[0]):{detail:t}))};e.emit=(e,...n)=>{t(e,n),q(e)!==e&&t(q(e),n)},this._setParent()}),t}_applyStyles(e,t){if(!e)return;if(t){if(t===this._def||this._styleChildren.has(t))return;this._styleChildren.add(t)}let n=this._nonce;for(let t=e.length-1;t>=0;t--){let l=document.createElement("style");n&&l.setAttribute("nonce",n),l.textContent=e[t],this.shadowRoot.prepend(l)}}_parseSlots(){let e;let t=this._slots={};for(;e=this.firstChild;){let n=1===e.nodeType&&e.getAttribute("slot")||"default";(t[n]||(t[n]=[])).push(e),this.removeChild(e)}}_renderSlots(){let e=(this._teleportTarget||this).querySelectorAll("slot"),t=this._instance.type.__scopeId;for(let n=0;n{if(!n.length)return;let t=e.moveClass||`${e.name||"v"}-move`;if(!function(e,t,n){let l=e.cloneNode(),r=e[rq];r&&r.forEach(e=>{e.split(/\s+/).forEach(e=>e&&l.classList.remove(e))}),n.split(/\s+/).forEach(e=>e&&l.classList.add(e)),l.style.display="none";let i=1===t.nodeType?t:t.parentNode;i.appendChild(l);let{hasTransform:s}=r8(l);return i.removeChild(l),s}(n[0].el,r.vnode.el,t))return;n.forEach(iN),n.forEach(iP);let l=n.filter(iM);r9(),l.forEach(e=>{let n=e.el,l=n.style;r0(n,t),l.transform=l.webkitTransform=l.transitionDuration="";let r=n[iA]=e=>{(!e||e.target===n)&&(!e||/transform$/.test(e.propertyName))&&(n.removeEventListener("transitionend",r),n[iA]=null,r1(n,t))};n.addEventListener("transitionend",r)})}),()=>{let s=tg(e),o=rQ(s),a=s.tag||l5;if(n=[],l)for(let e=0;e{let t=e.props["onUpdate:modelValue"]||!1;return T(t)?e=>Z(t,e):t};function iL(e){e.target.composing=!0}function iD(e){let t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}let iF=Symbol("_assign"),iV={created(e,{modifiers:{lazy:t,trim:n,number:l}},r){e[iF]=iI(r);let i=l||r.props&&"number"===r.props.type;ih(e,t?"change":"input",t=>{if(t.target.composing)return;let l=e.value;n&&(l=l.trim()),i&&(l=Q(l)),e[iF](l)}),n&&ih(e,"change",()=>{e.value=e.value.trim()}),t||(ih(e,"compositionstart",iL),ih(e,"compositionend",iD),ih(e,"change",iD))},mounted(e,{value:t}){e.value=null==t?"":t},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:l,trim:r,number:i}},s){if(e[iF]=iI(s),e.composing)return;let o=(i||"number"===e.type)&&!/^0\d/.test(e.value)?Q(e.value):e.value,a=null==t?"":t;o===a||document.activeElement===e&&"range"!==e.type&&(l&&t===n||r&&e.value.trim()===a)||(e.value=a)}},iU={deep:!0,created(e,t,n){e[iF]=iI(n),ih(e,"change",()=>{let t=e._modelValue,n=iW(e),l=e.checked,r=e[iF];if(T(t)){let e=ec(t,n),i=-1!==e;if(l&&!i)r(t.concat(n));else if(!l&&i){let n=[...t];n.splice(e,1),r(n)}}else if(R(t)){let e=new Set(t);l?e.add(n):e.delete(n),r(e)}else r(iK(e,l))})},mounted:ij,beforeUpdate(e,t,n){e[iF]=iI(n),ij(e,t,n)}};function ij(e,{value:t,oldValue:n},l){let r;if(e._modelValue=t,T(t))r=ec(t,l.props.value)>-1;else if(R(t))r=t.has(l.props.value);else{if(t===n)return;r=eu(t,iK(e,!0))}e.checked!==r&&(e.checked=r)}let iB={created(e,{value:t},n){e.checked=eu(t,n.props.value),e[iF]=iI(n),ih(e,"change",()=>{e[iF](iW(e))})},beforeUpdate(e,{value:t,oldValue:n},l){e[iF]=iI(l),t!==n&&(e.checked=eu(t,l.props.value))}},i$={deep:!0,created(e,{value:t,modifiers:{number:n}},l){let r=R(t);ih(e,"change",()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?Q(iW(e)):iW(e));e[iF](e.multiple?r?new Set(t):t:t[0]),e._assigning=!0,tq(()=>{e._assigning=!1})}),e[iF]=iI(l)},mounted(e,{value:t}){iH(e,t)},beforeUpdate(e,t,n){e[iF]=iI(n)},updated(e,{value:t}){e._assigning||iH(e,t)}};function iH(e,t){let n=e.multiple,l=T(t);if(!n||l||R(t)){for(let r=0,i=e.options.length;rString(e)===String(s)):i.selected=ec(t,s)>-1}else i.selected=t.has(s)}else if(eu(iW(i),t)){e.selectedIndex!==r&&(e.selectedIndex=r);return}}n||-1===e.selectedIndex||(e.selectedIndex=-1)}}function iW(e){return"_value"in e?e._value:e.value}function iK(e,t){let n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}function iz(e,t,n,l,r){let i=function(e,t){switch(e){case"SELECT":return i$;case"TEXTAREA":return iV;default:switch(t){case"checkbox":return iU;case"radio":return iB;default:return iV}}}(e.tagName,n.props&&n.props.type)[r];i&&i(e,t,n,l)}let iq=["ctrl","shift","alt","meta"],iG={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&0!==e.button,middle:e=>"button"in e&&1!==e.button,right:e=>"button"in e&&2!==e.button,exact:(e,t)=>iq.some(n=>e[`${n}Key`]&&!t.includes(n))},iJ={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},iX=x({patchProp:(e,t,n,l,r,i)=>{let s="svg"===r;"class"===t?function(e,t,n){let l=e[rq];l&&(t=(t?[t,...l]:[...l]).join(" ")),null==t?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}(e,l,s):"style"===t?function(e,t,n){let l=e.style,r=M(n),i=!1;if(n&&!r){if(t){if(M(t))for(let e of t.split(";")){let t=e.slice(0,e.indexOf(":")).trim();null==n[t]&&io(l,t,"")}else for(let e in t)null==n[e]&&io(l,e,"")}for(let e in n)"display"===e&&(i=!0),io(l,e,n[e])}else if(r){if(t!==n){let e=l[il];e&&(n+=";"+e),l.cssText=n,i=ii.test(n)}}else t&&e.removeAttribute("style");r7 in e&&(e[r7]=i?l.display:"",e[ie]&&(l.display="none"))}(e,n,l):S(t)?C(t)||function(e,t,n,l,r=null){let i=e[ig]||(e[ig]={}),s=i[t];if(l&&s)s.value=l;else{let[n,o]=function(e){let t;if(iv.test(e)){let n;for(t={};n=e.match(iv);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[":"===e[2]?e.slice(3):q(e.slice(2)),t]}(t);l?ih(e,n,i[t]=function(e,t){let n=e=>{if(e._vts){if(e._vts<=n.attached)return}else e._vts=Date.now();tV(function(e,t){if(!T(t))return t;{let n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(e=>t=>!t._stopped&&e&&e(t))}}(e,n.value),t,5,[e])};return n.value=e,n.attached=iy(),n}(l,r),o):s&&(!function(e,t,n,l){e.removeEventListener(t,n,l)}(e,n,s,o),i[t]=void 0)}}(e,t,0,l,i):("."===t[0]?(t=t.slice(1),0):"^"===t[0]?(t=t.slice(1),1):!function(e,t,n,l){if(l)return!!("innerHTML"===t||"textContent"===t||t in e&&ib(t)&&P(n));if("spellcheck"===t||"draggable"===t||"translate"===t||"form"===t||"list"===t&&"INPUT"===e.tagName||"type"===t&&"TEXTAREA"===e.tagName)return!1;if("width"===t||"height"===t){let t=e.tagName;if("IMG"===t||"VIDEO"===t||"CANVAS"===t||"SOURCE"===t)return!1}return!(ib(t)&&M(n))&&t in e}(e,t,l,s))?e._isVueCE&&(/[A-Z]/.test(t)||!M(l))?id(e,K(t),l,i,t):("true-value"===t?e._trueValue=l:"false-value"===t&&(e._falseValue=l),ip(e,t,l,s)):(id(e,t,l),e.tagName.includes("-")||"value"!==t&&"checked"!==t&&"selected"!==t||ip(e,t,l,s,i,"value"!==t))}},{insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,l)=>{let r="svg"===t?rH.createElementNS("http://www.w3.org/2000/svg",e):"mathml"===t?rH.createElementNS("http://www.w3.org/1998/Math/MathML",e):n?rH.createElement(e,{is:n}):rH.createElement(e);return"select"===e&&l&&null!=l.multiple&&r.setAttribute("multiple",l.multiple),r},createText:e=>rH.createTextNode(e),createComment:e=>rH.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>rH.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,l,r,i){let s=n?n.previousSibling:t.lastChild;if(r&&(r===i||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),r!==i&&(r=r.nextSibling););else{rW.innerHTML=r$("svg"===l?`${e}`:"mathml"===l?`${e}`:e);let r=rW.content;if("svg"===l||"mathml"===l){let e=r.firstChild;for(;e.firstChild;)r.appendChild(e.firstChild);r.removeChild(e)}t.insertBefore(r,n)}return[s?s.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}}),iZ=!1;function iY(){return p=iZ?p:lI(iX),iZ=!0,p}let iQ=(...e)=>{(p||(p=lL(iX))).render(...e)},i0=(...e)=>{let t=(p||(p=lL(iX))).createApp(...e),{mount:n}=t;return t.mount=e=>{let l=i6(e);if(!l)return;let r=t._component;P(r)||r.render||r.template||(r.template=l.innerHTML),1===l.nodeType&&(l.textContent="");let i=n(l,!1,i2(l));return l instanceof Element&&(l.removeAttribute("v-cloak"),l.setAttribute("data-v-app","")),i},t},i1=(...e)=>{let t=iY().createApp(...e),{mount:n}=t;return t.mount=e=>{let t=i6(e);if(t)return n(t,!0,i2(t))},t};function i2(e){return e instanceof SVGElement?"svg":"function"==typeof MathMLElement&&e instanceof MathMLElement?"mathml":void 0}function i6(e){return M(e)?document.querySelector(e):e}return e.BaseTransition=nd,e.BaseTransitionPropsValidators=nc,e.Comment=l7,e.DeprecationTypes=null,e.EffectScope=eg,e.ErrorCodes={SETUP_FUNCTION:0,0:"SETUP_FUNCTION",RENDER_FUNCTION:1,1:"RENDER_FUNCTION",NATIVE_EVENT_HANDLER:5,5:"NATIVE_EVENT_HANDLER",COMPONENT_EVENT_HANDLER:6,6:"COMPONENT_EVENT_HANDLER",VNODE_HOOK:7,7:"VNODE_HOOK",DIRECTIVE_HOOK:8,8:"DIRECTIVE_HOOK",TRANSITION_HOOK:9,9:"TRANSITION_HOOK",APP_ERROR_HANDLER:10,10:"APP_ERROR_HANDLER",APP_WARN_HANDLER:11,11:"APP_WARN_HANDLER",FUNCTION_REF:12,12:"FUNCTION_REF",ASYNC_COMPONENT_LOADER:13,13:"ASYNC_COMPONENT_LOADER",SCHEDULER:14,14:"SCHEDULER",COMPONENT_UPDATE:15,15:"COMPONENT_UPDATE",APP_UNMOUNT_CLEANUP:16,16:"APP_UNMOUNT_CLEANUP"},e.ErrorTypeStrings=null,e.Fragment=l5,e.KeepAlive={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){let n=rk(),l=n.ctx,r=new Map,i=new Set,s=null,o=n.suspense,{renderer:{p:a,m:u,um:c,o:{createElement:f}}}=l,p=f("div");function d(e){n$(e),c(e,n,o,!0)}function h(e){r.forEach((t,n)=>{let l=rD(t.type);l&&!e(l)&&g(n)})}function g(e){let t=r.get(e);!t||s&&rc(t,s)?s&&n$(s):d(t),r.delete(e),i.delete(e)}l.activate=(e,t,n,l,r)=>{let i=e.component;u(e,t,n,0,o),a(i.vnode,e,t,n,i,o,l,e.slotScopeIds,r),lM(()=>{i.isDeactivated=!1,i.a&&Z(i.a);let t=e.props&&e.props.onVnodeMounted;t&&rC(t,i.parent,e)},o)},l.deactivate=e=>{let t=e.component;lj(t.m),lj(t.a),u(e,p,null,1,o),lM(()=>{t.da&&Z(t.da);let n=e.props&&e.props.onVnodeUnmounted;n&&rC(n,t.parent,e),t.isDeactivated=!0},o)},lH(()=>[e.include,e.exclude],([e,t])=>{e&&h(t=>nV(e,t)),t&&h(e=>!nV(t,e))},{flush:"post",deep:!0});let m=null,_=()=>{null!=m&&(l0(n.subTree.type)?lM(()=>{r.set(m,nH(n.subTree))},n.subTree.suspense):r.set(m,nH(n.subTree)))};return nq(_),nJ(_),nX(()=>{r.forEach(e=>{let{subTree:t,suspense:l}=n,r=nH(t);if(e.type===r.type&&e.key===r.key){n$(r);let e=r.component.da;e&&lM(e,l);return}d(e)})}),()=>{if(m=null,!t.default)return s=null;let n=t.default(),l=n[0];if(n.length>1)return s=null,n;if(!ru(l)||!(4&l.shapeFlag)&&!(128&l.shapeFlag))return s=null,l;let o=nH(l);if(o.type===l7)return s=null,o;let a=o.type,u=rD(nL(o)?o.type.__asyncResolved||{}:a),{include:c,exclude:f,max:p}=e;if(c&&(!u||!nV(c,u))||f&&u&&nV(f,u))return o.shapeFlag&=-257,s=o,l;let d=null==o.key?a:o.key,h=r.get(d);return o.el&&(o=rv(o),128&l.shapeFlag&&(l.ssContent=o)),m=d,h?(o.el=h.el,o.component=h.component,o.transition&&n_(o,o.transition),o.shapeFlag|=512,i.delete(d),i.add(d)):(i.add(d),p&&i.size>parseInt(p,10)&&g(i.values().next().value)),o.shapeFlag|=256,s=o,l0(l.type)?l:o}}},e.ReactiveEffect=em,e.Static=re,e.Suspense={name:"Suspense",__isSuspense:!0,process(e,t,n,l,r,i,s,o,a,u){if(null==e)(function(e,t,n,l,r,i,s,o,a){let{p:u,o:{createElement:c}}=a,f=c("div"),p=e.suspense=l6(e,r,l,t,f,n,i,s,o,a);u(null,p.pendingBranch=e.ssContent,f,null,l,p,i,s),p.deps>0?(l2(e,"onPending"),l2(e,"onFallback"),u(null,e.ssFallback,t,n,l,null,i,s),l3(p,e.ssFallback)):p.resolve(!1,!0)})(t,n,l,r,i,s,o,a,u);else{if(i&&i.deps>0&&!e.suspense.isInFallback){t.suspense=e.suspense,t.suspense.vnode=t,t.el=e.el;return}(function(e,t,n,l,r,i,s,o,{p:a,um:u,o:{createElement:c}}){let f=t.suspense=e.suspense;f.vnode=t,t.el=e.el;let p=t.ssContent,d=t.ssFallback,{activeBranch:h,pendingBranch:g,isInFallback:m,isHydrating:_}=f;if(g)f.pendingBranch=p,rc(p,g)?(a(g,p,f.hiddenContainer,null,r,f,i,s,o),f.deps<=0?f.resolve():m&&!_&&(a(h,d,n,l,r,null,i,s,o),l3(f,d))):(f.pendingId=l1++,_?(f.isHydrating=!1,f.activeBranch=g):u(g,r,f),f.deps=0,f.effects.length=0,f.hiddenContainer=c("div"),m?(a(null,p,f.hiddenContainer,null,r,f,i,s,o),f.deps<=0?f.resolve():(a(h,d,n,l,r,null,i,s,o),l3(f,d))):h&&rc(p,h)?(a(h,p,n,l,r,f,i,s,o),f.resolve(!0)):(a(null,p,f.hiddenContainer,null,r,f,i,s,o),f.deps<=0&&f.resolve()));else if(h&&rc(p,h))a(h,p,n,l,r,f,i,s,o),l3(f,p);else if(l2(t,"onPending"),f.pendingBranch=p,512&p.shapeFlag?f.pendingId=p.component.suspenseId:f.pendingId=l1++,a(null,p,f.hiddenContainer,null,r,f,i,s,o),f.deps<=0)f.resolve();else{let{timeout:e,pendingId:t}=f;e>0?setTimeout(()=>{f.pendingId===t&&f.fallback(d)},e):0===e&&f.fallback(d)}})(e,t,n,l,r,s,o,a,u)}},hydrate:function(e,t,n,l,r,i,s,o,a){let u=t.suspense=l6(t,l,n,e.parentNode,document.createElement("div"),null,r,i,s,o,!0),c=a(e,u.pendingBranch=t.ssContent,n,u,i,s);return 0===u.deps&&u.resolve(!1,!0),c},normalize:function(e){let{shapeFlag:t,children:n}=e,l=32&t;e.ssContent=l4(l?n.default:n),e.ssFallback=l?l4(n.fallback):rh(l7)}},e.Teleport=nn,e.Text=l9,e.TrackOpTypes={GET:"get",HAS:"has",ITERATE:"iterate"},e.Transition=rX,e.TransitionGroup=iO,e.TriggerOpTypes={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},e.VueElement=iw,e.assertNumber=function(e,t){},e.callWithAsyncErrorHandling=tV,e.callWithErrorHandling=tF,e.camelize=K,e.capitalize=G,e.cloneVNode=rv,e.compatUtils=null,e.compile=()=>{},e.computed=rF,e.createApp=i0,e.createBlock=ra,e.createCommentVNode=function(e="",t=!1){return t?(rl(),ra(l7,null,e)):rh(l7,null,e)},e.createElementBlock=function(e,t,n,l,r,i){return ro(rd(e,t,n,l,r,i,!0))},e.createElementVNode=rd,e.createHydrationRenderer=lI,e.createPropsRestProxy=function(e,t){let n={};for(let l in e)t.includes(l)||Object.defineProperty(n,l,{enumerable:!0,get:()=>e[l]});return n},e.createRenderer=function(e){return lL(e)},e.createSSRApp=i1,e.createSlots=function(e,t){for(let n=0;n{let t=l.fn(...e);return t&&(t.key=l.key),t}:l.fn)}return e},e.createStaticVNode=function(e,t){let n=rh(re,null,e);return n.staticCount=t,n},e.createTextVNode=rm,e.createVNode=rh,e.customRef=tA,e.defineAsyncComponent=function(e){let t;P(e)&&(e={loader:e});let{loader:n,loadingComponent:l,errorComponent:r,delay:i=200,hydrate:s,timeout:o,suspensible:a=!0,onError:u}=e,c=null,f=0,p=()=>(f++,c=null,d()),d=()=>{let e;return c||(e=c=n().catch(e=>{if(e=e instanceof Error?e:Error(String(e)),u)return new Promise((t,n)=>{u(e,()=>t(p()),()=>n(e),f+1)});throw e}).then(n=>e!==c&&c?c:(n&&(n.__esModule||"Module"===n[Symbol.toStringTag])&&(n=n.default),t=n,n)))};return nb({name:"AsyncComponentWrapper",__asyncLoader:d,__asyncHydrate(e,n,l){let r=s?()=>{let t=s(l,t=>(function(e,t){if(nA(e)&&"["===e.data){let n=1,l=e.nextSibling;for(;l;){if(1===l.nodeType){if(!1===t(l))break}else if(nA(l)){if("]"===l.data){if(0==--n)break}else"["===l.data&&n++}l=l.nextSibling}}else t(e)})(e,t));t&&(n.bum||(n.bum=[])).push(t)}:l;t?r():d().then(()=>!n.isUnmounted&&r())},get __asyncResolved(){return t},setup(){let e=rE;if(nS(e),t)return()=>nD(t,e);let n=t=>{c=null,tU(t,e,13,!r)};if(a&&e.suspense)return d().then(t=>()=>nD(t,e)).catch(e=>(n(e),()=>r?rh(r,{error:e}):null));let s=tb(!1),u=tb(),f=tb(!!i);return i&&setTimeout(()=>{f.value=!1},i),null!=o&&setTimeout(()=>{if(!s.value&&!u.value){let e=Error(`Async component timed out after ${o}ms.`);n(e),u.value=e}},o),d().then(()=>{s.value=!0,e.parent&&nF(e.parent.vnode)&&e.parent.update()}).catch(e=>{n(e),u.value=e}),()=>s.value&&t?nD(t,e):u.value&&r?rh(r,{error:u.value}):l&&!f.value?rh(l):void 0}})},e.defineComponent=nb,e.defineCustomElement=iC,e.defineEmits=function(){return null},e.defineExpose=function(e){},e.defineModel=function(){},e.defineOptions=function(e){},e.defineProps=function(){return null},e.defineSSRCustomElement=(e,t)=>iC(e,t,i1),e.defineSlots=function(){return null},e.devtools=void 0,e.effect=function(e,t){e.effect instanceof em&&(e=e.effect.fn);let n=new em(e);t&&x(n,t);try{n.run()}catch(e){throw n.stop(),e}let l=n.run.bind(n);return l.effect=n,l},e.effectScope=function(e){return new eg(e)},e.getCurrentInstance=rk,e.getCurrentScope=function(){return r},e.getCurrentWatcher=function(){return d},e.getTransitionRawChildren=ny,e.guardReactiveProps=rg,e.h=rV,e.handleError=tU,e.hasInjectionContext=function(){return!!(rE||t0||lg)},e.hydrate=(...e)=>{iY().hydrate(...e)},e.hydrateOnIdle=(e=1e4)=>t=>{let n=nM(t,{timeout:e});return()=>nI(n)},e.hydrateOnInteraction=(e=[])=>(t,n)=>{M(e)&&(e=[e]);let l=!1,r=e=>{l||(l=!0,i(),t(),e.target.dispatchEvent(new e.constructor(e.type,e)))},i=()=>{n(t=>{for(let n of e)t.removeEventListener(n,r)})};return n(t=>{for(let n of e)t.addEventListener(n,r,{once:!0})}),i},e.hydrateOnMediaQuery=e=>t=>{if(e){let n=matchMedia(e);if(!n.matches)return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t);t()}},e.hydrateOnVisible=e=>(t,n)=>{let l=new IntersectionObserver(e=>{for(let n of e)if(n.isIntersecting){l.disconnect(),t();break}},e);return n(e=>{if(e instanceof Element){if(function(e){let{top:t,left:n,bottom:l,right:r}=e.getBoundingClientRect(),{innerHeight:i,innerWidth:s}=window;return(t>0&&t0&&l0&&n0&&rl.disconnect()},e.initCustomFormatter=function(){},e.initDirectivesForSSR=y,e.inject=lm,e.isMemoSame=rU,e.isProxy=th,e.isReactive=tf,e.isReadonly=tp,e.isRef=ty,e.isRuntimeOnly=()=>!c,e.isShallow=td,e.isVNode=ru,e.markRaw=tv,e.mergeDefaults=function(e,t){let n=ln(e);for(let e in t){if(e.startsWith("__skip"))continue;let l=n[e];l?T(l)||P(l)?l=n[e]={type:l,default:t[e]}:l.default=t[e]:null===l&&(l=n[e]={default:t[e]}),l&&t[`__skip_${e}`]&&(l.skipFactory=!0)}return n},e.mergeModels=function(e,t){return e&&t?T(e)&&T(t)?e.concat(t):x({},ln(e),ln(t)):e||t},e.mergeProps=rS,e.nextTick=tq,e.normalizeClass=eo,e.normalizeProps=function(e){if(!e)return null;let{class:t,style:n}=e;return t&&!M(t)&&(e.class=eo(t)),n&&(e.style=el(n)),e},e.normalizeStyle=el,e.onActivated=nU,e.onBeforeMount=nz,e.onBeforeUnmount=nX,e.onBeforeUpdate=nG,e.onDeactivated=nj,e.onErrorCaptured=n1,e.onMounted=nq,e.onRenderTracked=n0,e.onRenderTriggered=nQ,e.onScopeDispose=function(e,t=!1){r&&r.cleanups.push(e)},e.onServerPrefetch=nY,e.onUnmounted=nZ,e.onUpdated=nJ,e.onWatcherCleanup=tL,e.openBlock=rl,e.popScopeId=function(){t1=null},e.provide=lv,e.proxyRefs=tk,e.pushScopeId=function(e){t1=e},e.queuePostFlushCb=tX,e.reactive=to,e.readonly=tu,e.ref=tb,e.registerRuntimeCompiler=function(e){c=e,f=e=>{e.render._rc&&(e.withProxy=new Proxy(e.ctx,le))}},e.render=iQ,e.renderList=function(e,t,n,l){let r;let i=n&&n[l],s=T(e);if(s||M(e)){let n=s&&tf(e),l=!1;n&&(l=!td(e),e=eB(e)),r=Array(e.length);for(let n=0,s=e.length;nt(e,n,void 0,i&&i[n]));else{let n=Object.keys(e);r=Array(n.length);for(let l=0,s=n.length;l!ru(t)||!!(t.type!==l7&&(t.type!==l5||e(t.children))))?t:null}(i(n)),o=n.key||s&&s.key,a=ra(l5,{key:(o&&!I(o)?o:`_${t}`)+(!s&&l?"_fb":"")},s||(l?l():[]),s&&1===e._?64:-2);return!r&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),i&&i._c&&(i._d=!0),a},e.resolveComponent=function(e,t){return n4(n2,e,!0,t)||e},e.resolveDirective=function(e){return n4("directives",e)},e.resolveDynamicComponent=function(e){return M(e)?n4(n2,e,!1)||e:e||n6},e.resolveFilter=null,e.resolveTransitionHooks=ng,e.setBlockTracking=rs,e.setDevtoolsHook=y,e.setTransitionHooks=n_,e.shallowReactive=ta,e.shallowReadonly=function(e){return tc(e,!0,e4,tn,ts)},e.shallowRef=tS,e.ssrContextKey=lB,e.ssrUtils=null,e.stop=function(e){e.effect.stop()},e.toDisplayString=ep,e.toHandlerKey=J,e.toHandlers=function(e,t){let n={};for(let l in e)n[t&&/[A-Z]/.test(l)?`on:${l}`:J(l)]=e[l];return n},e.toRaw=tg,e.toRef=function(e,t,n){return ty(e)?e:P(e)?new tO(e):L(e)&&arguments.length>1?tN(e,t,n):tb(e)},e.toRefs=function(e){let t=T(e)?Array(e.length):{};for(let n in e)t[n]=tN(e,n);return t},e.toValue=function(e){return P(e)?e():tw(e)},e.transformVNodeArgs=function(e){},e.triggerRef=function(e){e.dep&&e.dep.trigger()},e.unref=tw,e.useAttrs=function(){return lt().attrs},e.useCssModule=function(e="$style"){return m},e.useCssVars=function(e){let t=rk();if(!t)return;let n=t.ut=(n=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(e=>ir(e,n))},l=()=>{let l=e(t.proxy);t.ce?ir(t.ce,l):function e(t,n){if(128&t.shapeFlag){let l=t.suspense;t=l.activeBranch,l.pendingBranch&&!l.isHydrating&&l.effects.push(()=>{e(l.activeBranch,n)})}for(;t.component;)t=t.component.subTree;if(1&t.shapeFlag&&t.el)ir(t.el,n);else if(t.type===l5)t.children.forEach(t=>e(t,n));else if(t.type===re){let{el:e,anchor:l}=t;for(;e&&(ir(e,n),e!==l);)e=e.nextSibling}}(t.subTree,l),n(l)};nG(()=>{tX(l)}),nq(()=>{lH(l,y,{flush:"post"});let e=new MutationObserver(l);e.observe(t.subTree.el.parentNode,{childList:!0}),nZ(()=>e.disconnect())})},e.useHost=iE,e.useId=function(){let e=rk();return e?(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++:""},e.useModel=function(e,t,n=m){let l=rk(),r=K(t),i=q(t),s=lz(e,r),o=tA((s,o)=>{let a,u;let c=m;return l$(()=>{let t=e[r];X(a,t)&&(a=t,o())}),{get:()=>(s(),n.get?n.get(a):a),set(e){let s=n.set?n.set(e):e;if(!X(s,a)&&!(c!==m&&X(e,c)))return;let f=l.vnode.props;f&&(t in f||r in f||i in f)&&(`onUpdate:${t}`in f||`onUpdate:${r}`in f||`onUpdate:${i}`in f)||(a=e,o()),l.emit(`update:${t}`,s),X(e,s)&&X(e,c)&&!X(s,u)&&o(),c=e,u=s}}});return o[Symbol.iterator]=()=>{let e=0;return{next:()=>e<2?{value:e++?s||m:o,done:!1}:{done:!0}}},o},e.useSSRContext=()=>{},e.useShadowRoot=function(){let e=iE();return e&&e.shadowRoot},e.useSlots=function(){return lt().slots},e.useTemplateRef=function(e){let t=rk(),n=tS(null);return t&&Object.defineProperty(t.refs===m?t.refs={}:t.refs,e,{enumerable:!0,get:()=>n.value,set:e=>n.value=e}),n},e.useTransitionState=na,e.vModelCheckbox=iU,e.vModelDynamic={created(e,t,n){iz(e,t,n,null,"created")},mounted(e,t,n){iz(e,t,n,null,"mounted")},beforeUpdate(e,t,n,l){iz(e,t,n,l,"beforeUpdate")},updated(e,t,n,l){iz(e,t,n,l,"updated")}},e.vModelRadio=iB,e.vModelSelect=i$,e.vModelText=iV,e.vShow={beforeMount(e,{value:t},{transition:n}){e[r7]="none"===e.style.display?"":e.style.display,n&&t?n.beforeEnter(e):it(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:l}){!t!=!n&&(l?t?(l.beforeEnter(e),it(e,!0),l.enter(e)):l.leave(e,()=>{it(e,!1)}):it(e,t))},beforeUnmount(e,{value:t}){it(e,t)}},e.version=rj,e.warn=y,e.watch=function(e,t,n){return lH(e,t,n)},e.watchEffect=function(e,t){return lH(e,null,t)},e.watchPostEffect=function(e,t){return lH(e,null,{flush:"post"})},e.watchSyncEffect=l$,e.withAsyncContext=function(e){let t=rk(),n=e();return rA(),D(n)&&(n=n.catch(e=>{throw rT(t),e})),[n,()=>rT(t)]},e.withCtx=t6,e.withDefaults=function(e,t){return null},e.withDirectives=function(e,t){if(null===t0)return e;let n=rL(t0),l=e.dirs||(e.dirs=[]);for(let e=0;e{let n=e._withKeys||(e._withKeys={}),l=t.join(".");return n[l]||(n[l]=n=>{if(!("key"in n))return;let l=q(n.key);if(t.some(e=>e===l||iJ[e]===l))return e(n)})},e.withMemo=function(e,t,n,l){let r=n[l];if(r&&rU(r,e))return r;let i=t();return i.memo=e.slice(),i.cacheIndex=l,n[l]=i},e.withModifiers=(e,t)=>{let n=e._withMods||(e._withMods={}),l=t.join(".");return n[l]||(n[l]=(n,...l)=>{for(let e=0;et6,e}({}); +**/var Vue=function(e){"use strict";var t,n;let l,r,i,s,o,a,u,c,f,p,d,h;function g(e){let t=Object.create(null);for(let n of e.split(","))t[n]=1;return e=>e in t}let m={},_=[],y=()=>{},b=()=>!1,S=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&(e.charCodeAt(2)>122||97>e.charCodeAt(2)),C=e=>e.startsWith("onUpdate:"),x=Object.assign,w=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},E=Object.prototype.hasOwnProperty,k=(e,t)=>E.call(e,t),T=Array.isArray,A=e=>"[object Map]"===F(e),R=e=>"[object Set]"===F(e),O=e=>"[object Date]"===F(e),N=e=>"function"==typeof e,P=e=>"string"==typeof e,M=e=>"symbol"==typeof e,I=e=>null!==e&&"object"==typeof e,L=e=>(I(e)||N(e))&&N(e.then)&&N(e.catch),D=Object.prototype.toString,F=e=>D.call(e),V=e=>"[object Object]"===F(e),U=e=>P(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,j=g(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),B=e=>{let t=Object.create(null);return n=>t[n]||(t[n]=e(n))},$=/-(\w)/g,H=B(e=>e.replace($,(e,t)=>t?t.toUpperCase():"")),W=/\B([A-Z])/g,K=B(e=>e.replace(W,"-$1").toLowerCase()),z=B(e=>e.charAt(0).toUpperCase()+e.slice(1)),q=B(e=>e?`on${z(e)}`:""),G=(e,t)=>!Object.is(e,t),J=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:l,value:n})},Z=e=>{let t=parseFloat(e);return isNaN(t)?e:t},Y=e=>{let t=P(e)?Number(e):NaN;return isNaN(t)?e:t},Q=()=>l||(l="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{}),ee=g("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol");function et(e){if(T(e)){let t={};for(let n=0;n{if(e){let n=e.split(el);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}(l):et(l);if(r)for(let e in r)t[e]=r[e]}return t}if(P(e)||I(e))return e}let en=/;(?![^(]*\))/g,el=/:([^]+)/,er=/\/\*[^]*?\*\//g;function ei(e){let t="";if(P(e))t=e;else if(T(e))for(let n=0;neo(e,t))}let eu=e=>!!(e&&!0===e.__v_isRef),ec=e=>P(e)?e:null==e?"":T(e)||I(e)&&(e.toString===D||!N(e.toString))?eu(e)?ec(e.value):JSON.stringify(e,ef,2):String(e),ef=(e,t)=>{if(eu(t))return ef(e,t.value);if(A(t))return{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],l)=>(e[ep(t,l)+" =>"]=n,e),{})};if(R(t))return{[`Set(${t.size})`]:[...t.values()].map(e=>ep(e))};if(M(t))return ep(t);if(I(t)&&!T(t)&&!V(t))return String(t);return t},ep=(e,t="")=>{var n;return M(e)?`Symbol(${null!=(n=e.description)?n:t})`:e};class ed{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=r,!e&&r&&(this.index=(r.scopes||(r.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){let e,t;if(this._isPaused=!0,this.scopes)for(e=0,t=this.scopes.length;e0&&0==--this._on&&(r=this.prevScope,this.prevScope=void 0)}stop(e){if(this._active){let t,n;for(t=0,this._active=!1,n=this.effects.length;t0)){if(o){let e=o;for(o=void 0;e;){let t=e.next;e.next=void 0,e.flags&=-9,e=t}}for(;s;){let t=s;for(s=void 0;t;){let n=t.next;if(t.next=void 0,t.flags&=-9,1&t.flags)try{t.trigger()}catch(t){e||(e=t)}t=n}}if(e)throw e}}function ey(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function eb(e){let t,n=e.depsTail,l=n;for(;l;){let e=l.prevDep;-1===l.version?(l===n&&(n=e),ex(l),function(e){let{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}(l)):t=l,l.dep.activeLink=l.prevActiveLink,l.prevActiveLink=void 0,l=e}e.deps=t,e.depsTail=n}function eS(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(eC(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function eC(e){if(4&e.flags&&!(16&e.flags)||(e.flags&=-17,e.globalVersion===eR)||(e.globalVersion=eR,!e.isSSR&&128&e.flags&&(!e.deps&&!e._dirty||!eS(e))))return;e.flags|=2;let t=e.dep,n=i,l=ew;i=e,ew=!0;try{ey(e);let n=e.fn(e._value);(0===t.version||G(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(e){throw t.version++,e}finally{i=n,ew=l,eb(e),e.flags&=-3}}function ex(e,t=!1){let{dep:n,prevSub:l,nextSub:r}=e;if(l&&(l.nextSub=r,e.prevSub=void 0),r&&(r.prevSub=l,e.nextSub=void 0),n.subs===e&&(n.subs=l,!l&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)ex(e,!0)}t||--n.sc||!n.map||n.map.delete(n.key)}let ew=!0,eE=[];function ek(){eE.push(ew),ew=!1}function eT(){let e=eE.pop();ew=void 0===e||e}function eA(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let e=i;i=void 0;try{t()}finally{i=e}}}let eR=0;class eO{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class eN{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!i||!ew||i===this.computed)return;let t=this.activeLink;if(void 0===t||t.sub!==i)t=this.activeLink=new eO(i,this),i.deps?(t.prevDep=i.depsTail,i.depsTail.nextDep=t,i.depsTail=t):i.deps=i.depsTail=t,function e(t){if(t.dep.sc++,4&t.sub.flags){let n=t.dep.computed;if(n&&!t.dep.subs){n.flags|=20;for(let t=n.deps;t;t=t.nextDep)e(t)}let l=t.dep.subs;l!==t&&(t.prevSub=l,l&&(l.nextSub=t)),t.dep.subs=t}}(t);else if(-1===t.version&&(t.version=this.version,t.nextDep)){let e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=i.depsTail,t.nextDep=void 0,i.depsTail.nextDep=t,i.depsTail=t,i.deps===t&&(i.deps=e)}return t}trigger(e){this.version++,eR++,this.notify(e)}notify(e){eg++;try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{e_()}}}let eP=new WeakMap,eM=Symbol(""),eI=Symbol(""),eL=Symbol("");function eD(e,t,n){if(ew&&i){let t=eP.get(e);t||eP.set(e,t=new Map);let l=t.get(n);l||(t.set(n,l=new eN),l.map=t,l.key=n),l.track()}}function eF(e,t,n,l,r,i){let s=eP.get(e);if(!s)return void eR++;let o=e=>{e&&e.trigger()};if(eg++,"clear"===t)s.forEach(o);else{let r=T(e),i=r&&U(n);if(r&&"length"===n){let e=Number(l);s.forEach((t,n)=>{("length"===n||n===eL||!M(n)&&n>=e)&&o(t)})}else switch((void 0!==n||s.has(void 0))&&o(s.get(n)),i&&o(s.get(eL)),t){case"add":r?i&&o(s.get("length")):(o(s.get(eM)),A(e)&&o(s.get(eI)));break;case"delete":!r&&(o(s.get(eM)),A(e)&&o(s.get(eI)));break;case"set":A(e)&&o(s.get(eM))}}e_()}function eV(e){let t=td(e);return t===e?t:(eD(t,"iterate",eL),tf(e)?t:t.map(tv))}function eU(e){return eD(e=td(e),"iterate",eL),e}let ej={__proto__:null,[Symbol.iterator](){return eB(this,Symbol.iterator,tv)},concat(...e){return eV(this).concat(...e.map(e=>T(e)?eV(e):e))},entries(){return eB(this,"entries",e=>(e[1]=tv(e[1]),e))},every(e,t){return eH(this,"every",e,t,void 0,arguments)},filter(e,t){return eH(this,"filter",e,t,e=>e.map(tv),arguments)},find(e,t){return eH(this,"find",e,t,tv,arguments)},findIndex(e,t){return eH(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return eH(this,"findLast",e,t,tv,arguments)},findLastIndex(e,t){return eH(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return eH(this,"forEach",e,t,void 0,arguments)},includes(...e){return eK(this,"includes",e)},indexOf(...e){return eK(this,"indexOf",e)},join(e){return eV(this).join(e)},lastIndexOf(...e){return eK(this,"lastIndexOf",e)},map(e,t){return eH(this,"map",e,t,void 0,arguments)},pop(){return ez(this,"pop")},push(...e){return ez(this,"push",e)},reduce(e,...t){return eW(this,"reduce",e,t)},reduceRight(e,...t){return eW(this,"reduceRight",e,t)},shift(){return ez(this,"shift")},some(e,t){return eH(this,"some",e,t,void 0,arguments)},splice(...e){return ez(this,"splice",e)},toReversed(){return eV(this).toReversed()},toSorted(e){return eV(this).toSorted(e)},toSpliced(...e){return eV(this).toSpliced(...e)},unshift(...e){return ez(this,"unshift",e)},values(){return eB(this,"values",tv)}};function eB(e,t,n){let l=eU(e),r=l[t]();return l===e||tf(e)||(r._next=r.next,r.next=()=>{let e=r._next();return e.value&&(e.value=n(e.value)),e}),r}let e$=Array.prototype;function eH(e,t,n,l,r,i){let s=eU(e),o=s!==e&&!tf(e),a=s[t];if(a!==e$[t]){let t=a.apply(e,i);return o?tv(t):t}let u=n;s!==e&&(o?u=function(t,l){return n.call(this,tv(t),l,e)}:n.length>2&&(u=function(t,l){return n.call(this,t,l,e)}));let c=a.call(s,u,l);return o&&r?r(c):c}function eW(e,t,n,l){let r=eU(e),i=n;return r!==e&&(tf(e)?n.length>3&&(i=function(t,l,r){return n.call(this,t,l,r,e)}):i=function(t,l,r){return n.call(this,t,tv(l),r,e)}),r[t](i,...l)}function eK(e,t,n){let l=td(e);eD(l,"iterate",eL);let r=l[t](...n);return(-1===r||!1===r)&&tp(n[0])?(n[0]=td(n[0]),l[t](...n)):r}function ez(e,t,n=[]){ek(),eg++;let l=td(e)[t].apply(e,n);return e_(),eT(),l}let eq=g("__proto__,__v_isRef,__isVue"),eG=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>"arguments"!==e&&"caller"!==e).map(e=>Symbol[e]).filter(M));function eJ(e){M(e)||(e=String(e));let t=td(this);return eD(t,"has",e),t.hasOwnProperty(e)}class eX{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if("__v_skip"===t)return e.__v_skip;let l=this._isReadonly,r=this._isShallow;if("__v_isReactive"===t)return!l;if("__v_isReadonly"===t)return l;if("__v_isShallow"===t)return r;if("__v_raw"===t)return n===(l?r?tr:tl:r?tn:tt).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;let i=T(e);if(!l){let e;if(i&&(e=ej[t]))return e;if("hasOwnProperty"===t)return eJ}let s=Reflect.get(e,t,tm(e)?e:n);return(M(t)?eG.has(t):eq(t))||(l||eD(e,"get",t),r)?s:tm(s)?i&&U(t)?s:s.value:I(s)?l?to(s):ti(s):s}}class eZ extends eX{constructor(e=!1){super(!1,e)}set(e,t,n,l){let r=e[t];if(!this._isShallow){let t=tc(r);if(tf(n)||tc(n)||(r=td(r),n=td(n)),!T(e)&&tm(r)&&!tm(n))if(t)return!1;else return r.value=n,!0}let i=T(e)&&U(t)?Number(t)e,e8=e=>Reflect.getPrototypeOf(e);function e4(e){return function(...t){return"delete"!==e&&("clear"===e?void 0:this)}}function e3(e,t){let n=function(e,t){let n={get(n){let l=this.__v_raw,r=td(l),i=td(n);e||(G(n,i)&&eD(r,"get",n),eD(r,"get",i));let{has:s}=e8(r),o=t?e6:e?tg:tv;return s.call(r,n)?o(l.get(n)):s.call(r,i)?o(l.get(i)):void(l!==r&&l.get(n))},get size(){let t=this.__v_raw;return e||eD(td(t),"iterate",eM),Reflect.get(t,"size",t)},has(t){let n=this.__v_raw,l=td(n),r=td(t);return e||(G(t,r)&&eD(l,"has",t),eD(l,"has",r)),t===r?n.has(t):n.has(t)||n.has(r)},forEach(n,l){let r=this,i=r.__v_raw,s=td(i),o=t?e6:e?tg:tv;return e||eD(s,"iterate",eM),i.forEach((e,t)=>n.call(l,o(e),o(t),r))}};return x(n,e?{add:e4("add"),set:e4("set"),delete:e4("delete"),clear:e4("clear")}:{add(e){t||tf(e)||tc(e)||(e=td(e));let n=td(this);return e8(n).has.call(n,e)||(n.add(e),eF(n,"add",e,e)),this},set(e,n){t||tf(n)||tc(n)||(n=td(n));let l=td(this),{has:r,get:i}=e8(l),s=r.call(l,e);s||(e=td(e),s=r.call(l,e));let o=i.call(l,e);return l.set(e,n),s?G(n,o)&&eF(l,"set",e,n):eF(l,"add",e,n),this},delete(e){let t=td(this),{has:n,get:l}=e8(t),r=n.call(t,e);r||(e=td(e),r=n.call(t,e)),l&&l.call(t,e);let i=t.delete(e);return r&&eF(t,"delete",e,void 0),i},clear(){let e=td(this),t=0!==e.size,n=e.clear();return t&&eF(e,"clear",void 0,void 0),n}}),["keys","values","entries",Symbol.iterator].forEach(l=>{n[l]=function(...n){let r=this.__v_raw,i=td(r),s=A(i),o="entries"===l||l===Symbol.iterator&&s,a=r[l](...n),u=t?e6:e?tg:tv;return e||eD(i,"iterate","keys"===l&&s?eI:eM),{next(){let{value:e,done:t}=a.next();return t?{value:e,done:t}:{value:o?[u(e[0]),u(e[1])]:u(e),done:t}},[Symbol.iterator](){return this}}}}),n}(e,t);return(t,l,r)=>"__v_isReactive"===l?!e:"__v_isReadonly"===l?e:"__v_raw"===l?t:Reflect.get(k(n,l)&&l in t?n:t,l,r)}let e5={get:e3(!1,!1)},e9={get:e3(!1,!0)},e7={get:e3(!0,!1)},te={get:e3(!0,!0)},tt=new WeakMap,tn=new WeakMap,tl=new WeakMap,tr=new WeakMap;function ti(e){return tc(e)?e:ta(e,!1,eQ,e5,tt)}function ts(e){return ta(e,!1,e1,e9,tn)}function to(e){return ta(e,!0,e0,e7,tl)}function ta(e,t,n,l,r){var i;if(!I(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;let s=(i=e).__v_skip||!Object.isExtensible(i)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}(F(i).slice(8,-1));if(0===s)return e;let o=r.get(e);if(o)return o;let a=new Proxy(e,2===s?l:n);return r.set(e,a),a}function tu(e){return tc(e)?tu(e.__v_raw):!!(e&&e.__v_isReactive)}function tc(e){return!!(e&&e.__v_isReadonly)}function tf(e){return!!(e&&e.__v_isShallow)}function tp(e){return!!e&&!!e.__v_raw}function td(e){let t=e&&e.__v_raw;return t?td(t):e}function th(e){return!k(e,"__v_skip")&&Object.isExtensible(e)&&X(e,"__v_skip",!0),e}let tv=e=>I(e)?ti(e):e,tg=e=>I(e)?to(e):e;function tm(e){return!!e&&!0===e.__v_isRef}function t_(e){return tb(e,!1)}function ty(e){return tb(e,!0)}function tb(e,t){return tm(e)?e:new tS(e,t)}class tS{constructor(e,t){this.dep=new eN,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:td(e),this._value=t?e:tv(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||tf(e)||tc(e);G(e=n?e:td(e),t)&&(this._rawValue=e,this._value=n?e:tv(e),this.dep.trigger())}}function tC(e){return tm(e)?e.value:e}let tx={get:(e,t,n)=>"__v_raw"===t?e:tC(Reflect.get(e,t,n)),set:(e,t,n,l)=>{let r=e[t];return tm(r)&&!tm(n)?(r.value=n,!0):Reflect.set(e,t,n,l)}};function tw(e){return tu(e)?e:new Proxy(e,tx)}class tE{constructor(e){this.__v_isRef=!0,this._value=void 0;let t=this.dep=new eN,{get:n,set:l}=e(t.track.bind(t),t.trigger.bind(t));this._get=n,this._set=l}get value(){return this._value=this._get()}set value(e){this._set(e)}}function tk(e){return new tE(e)}class tT{constructor(e,t,n){this._object=e,this._key=t,this._defaultValue=n,this.__v_isRef=!0,this._value=void 0}get value(){let e=this._object[this._key];return this._value=void 0===e?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return function(e,t){let n=eP.get(e);return n&&n.get(t)}(td(this._object),this._key)}}class tA{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function tR(e,t,n){let l=e[t];return tm(l)?l:new tT(e,t,n)}class tO{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new eN(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=eR-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(8&this.flags)&&i!==this)return em(this,!0),!0}get value(){let e=this.dep.track();return eC(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}let tN={},tP=new WeakMap;function tM(e,t=!1,n=d){if(n){let t=tP.get(n);t||tP.set(n,t=[]),t.push(e)}}function tI(e,t=1/0,n){if(t<=0||!I(e)||e.__v_skip||(n=n||new Set).has(e))return e;if(n.add(e),t--,tm(e))tI(e.value,t,n);else if(T(e))for(let l=0;l{tI(e,t,n)});else if(V(e)){for(let l in e)tI(e[l],t,n);for(let l of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,l)&&tI(e[l],t,n)}return e}function tL(e,t,n,l){try{return l?e(...l):e()}catch(e){tF(e,t,n)}}function tD(e,t,n,l){if(N(e)){let r=tL(e,t,n,l);return r&&L(r)&&r.catch(e=>{tF(e,t,n)}),r}if(T(e)){let r=[];for(let i=0;i=tZ(n)?tV.push(e):tV.splice(function(e){let t=tU+1,n=tV.length;for(;t>>1,r=tV[l],i=tZ(r);itZ(e)-tZ(t));if(tj.length=0,tB)return void tB.push(...e);for(t$=0,tB=e;t$null==e.id?2&e.flags?-1:1/0:e.id,tY=null,tQ=null;function t0(e){let t=tY;return tY=e,tQ=e&&e.type.__scopeId||null,t}function t1(e,t=tY,n){if(!t||e._n)return e;let l=(...n)=>{let r;l._d&&l7(-1);let i=t0(t);try{r=e(...n)}finally{t0(i),l._d&&l7(1)}return r};return l._n=!0,l._c=!0,l._d=!0,l}function t2(e,t,n,l){let r=e.dirs,i=t&&t.dirs;for(let s=0;se&&(e.disabled||""===e.disabled),t4=e=>e&&(e.defer||""===e.defer),t3=e=>"undefined"!=typeof SVGElement&&e instanceof SVGElement,t5=e=>"function"==typeof MathMLElement&&e instanceof MathMLElement,t9=(e,t)=>{let n=e&&e.to;return P(n)?t?t(n):null:n},t7={name:"Teleport",__isTeleport:!0,process(e,t,n,l,r,i,s,o,a,u){let{mc:c,pc:f,pbc:p,o:{insert:d,querySelector:h,createText:g,createComment:m}}=u,_=t8(t.props),{shapeFlag:y,children:b,dynamicChildren:S}=t;if(null==e){let e=t.el=g(""),u=t.anchor=g("");d(e,n,l),d(u,n,l);let f=(e,t)=>{16&y&&(r&&r.isCE&&(r.ce._teleportTarget=e),c(b,e,t,r,i,s,o,a))},p=()=>{let e=t.target=t9(t.props,h),n=nn(e,t,g,d);e&&("svg"!==s&&t3(e)?s="svg":"mathml"!==s&&t5(e)&&(s="mathml"),_||(f(e,n),nt(t,!1)))};_&&(f(n,u),nt(t,!0)),t4(t.props)?(t.el.__isMounted=!1,lk(()=>{p(),delete t.el.__isMounted},i)):p()}else{if(t4(t.props)&&!1===e.el.__isMounted)return void lk(()=>{t7.process(e,t,n,l,r,i,s,o,a,u)},i);t.el=e.el,t.targetStart=e.targetStart;let c=t.anchor=e.anchor,d=t.target=e.target,g=t.targetAnchor=e.targetAnchor,m=t8(e.props),y=m?n:d,b=m?c:g;if("svg"===s||t3(d)?s="svg":("mathml"===s||t5(d))&&(s="mathml"),S?(p(e.dynamicChildren,S,y,r,i,s,o),lP(e,t,!0)):a||f(e,t,y,b,r,i,s,o,!1),_)m?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):ne(t,n,c,u,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){let e=t.target=t9(t.props,h);e&&ne(t,e,null,u,0)}else m&&ne(t,d,g,u,1);nt(t,_)}},remove(e,t,n,{um:l,o:{remove:r}},i){let{shapeFlag:s,children:o,anchor:a,targetStart:u,targetAnchor:c,target:f,props:p}=e;if(f&&(r(u),r(c)),i&&r(a),16&s){let e=i||!t8(p);for(let r=0;r{e.isMounted=!0}),nK(()=>{e.isUnmounting=!0}),e}let ns=[Function,Array],no={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:ns,onEnter:ns,onAfterEnter:ns,onEnterCancelled:ns,onBeforeLeave:ns,onLeave:ns,onAfterLeave:ns,onLeaveCancelled:ns,onBeforeAppear:ns,onAppear:ns,onAfterAppear:ns,onAppearCancelled:ns},na=e=>{let t=e.subTree;return t.component?na(t.component):t};function nu(e){let t=e[0];if(e.length>1){for(let n of e)if(n.type!==l2){t=n;break}}return t}let nc={name:"BaseTransition",props:no,setup(e,{slots:t}){let n=ry(),l=ni();return()=>{let r=t.default&&ng(t.default(),!0);if(!r||!r.length)return;let i=nu(r),s=td(e),{mode:o}=s;if(l.isLeaving)return nd(i);let a=nh(i);if(!a)return nd(i);let u=np(a,s,l,n,e=>u=e);a.type!==l2&&nv(a,u);let c=n.subTree&&nh(n.subTree);if(c&&c.type!==l2&&!rl(a,c)&&na(n).type!==l2){let e=np(c,s,l,n);if(nv(c,e),"out-in"===o&&a.type!==l2)return l.isLeaving=!0,e.afterLeave=()=>{l.isLeaving=!1,8&n.job.flags||n.update(),delete e.afterLeave,c=void 0},nd(i);"in-out"===o&&a.type!==l2?e.delayLeave=(e,t,n)=>{nf(l,c)[String(c.key)]=c,e[nl]=()=>{t(),e[nl]=void 0,delete u.delayedLeave,c=void 0},u.delayedLeave=()=>{n(),delete u.delayedLeave,c=void 0}}:c=void 0}else c&&(c=void 0);return i}}};function nf(e,t){let{leavingVNodes:n}=e,l=n.get(t.type);return l||(l=Object.create(null),n.set(t.type,l)),l}function np(e,t,n,l,r){let{appear:i,mode:s,persisted:o=!1,onBeforeEnter:a,onEnter:u,onAfterEnter:c,onEnterCancelled:f,onBeforeLeave:p,onLeave:d,onAfterLeave:h,onLeaveCancelled:g,onBeforeAppear:m,onAppear:_,onAfterAppear:y,onAppearCancelled:b}=t,S=String(e.key),C=nf(n,e),x=(e,t)=>{e&&tD(e,l,9,t)},w=(e,t)=>{let n=t[1];x(e,t),T(e)?e.every(e=>e.length<=1)&&n():e.length<=1&&n()},E={mode:s,persisted:o,beforeEnter(t){let l=a;if(!n.isMounted)if(!i)return;else l=m||a;t[nl]&&t[nl](!0);let r=C[S];r&&rl(e,r)&&r.el[nl]&&r.el[nl](),x(l,[t])},enter(e){let t=u,l=c,r=f;if(!n.isMounted)if(!i)return;else t=_||u,l=y||c,r=b||f;let s=!1,o=e[nr]=t=>{s||(s=!0,t?x(r,[e]):x(l,[e]),E.delayedLeave&&E.delayedLeave(),e[nr]=void 0)};t?w(t,[e,o]):o()},leave(t,l){let r=String(e.key);if(t[nr]&&t[nr](!0),n.isUnmounting)return l();x(p,[t]);let i=!1,s=t[nl]=n=>{i||(i=!0,l(),n?x(g,[t]):x(h,[t]),t[nl]=void 0,C[r]===e&&delete C[r])};C[r]=e,d?w(d,[t,s]):s()},clone(e){let i=np(e,t,n,l,r);return r&&r(i),i}};return E}function nd(e){if(nP(e))return(e=ru(e)).children=null,e}function nh(e){if(!nP(e))return e.type.__isTeleport&&e.children?nu(e.children):e;if(e.component)return e.component.subTree;let{shapeFlag:t,children:n}=e;if(n){if(16&t)return n[0];if(32&t&&N(n.default))return n.default()}}function nv(e,t){6&e.shapeFlag&&e.component?(e.transition=t,nv(e.component.subTree,t)):128&e.shapeFlag?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function ng(e,t=!1,n){let l=[],r=0;for(let i=0;i1)for(let e=0;eny(e,t&&(T(t)?t[i]:t),n,l,r));if(nO(l)&&!r){512&l.shapeFlag&&l.type.__asyncResolved&&l.component.subTree.component&&ny(e,t,n,l.component.subTree);return}let i=4&l.shapeFlag?rA(l.component):l.el,s=r?null:i,{i:o,r:a}=e,u=t&&t.r,c=o.refs===m?o.refs={}:o.refs,f=o.setupState,p=td(f),d=f===m?()=>!1:e=>k(p,e);if(null!=u&&u!==a&&(P(u)?(c[u]=null,d(u)&&(f[u]=null)):tm(u)&&(u.value=null)),N(a))tL(a,o,12,[s,c]);else{let t=P(a),l=tm(a);if(t||l){let o=()=>{if(e.f){let n=t?d(a)?f[a]:c[a]:a.value;r?T(n)&&w(n,i):T(n)?n.includes(i)||n.push(i):t?(c[a]=[i],d(a)&&(f[a]=c[a])):(a.value=[i],e.k&&(c[e.k]=a.value))}else t?(c[a]=s,d(a)&&(f[a]=s)):l&&(a.value=s,e.k&&(c[e.k]=s))};s?(o.id=-1,lk(o,n)):o()}}}let nb=!1,nS=()=>{nb||(console.error("Hydration completed but contains mismatches."),nb=!0)},nC=e=>{if(1===e.nodeType){if(e.namespaceURI.includes("svg")&&"foreignObject"!==e.tagName)return"svg";if(e.namespaceURI.includes("MathML"))return"mathml"}},nx=e=>8===e.nodeType;function nw(e){let{mt:t,p:n,o:{patchProp:l,createText:r,nextSibling:i,parentNode:s,remove:o,insert:a,createComment:u}}=e,c=(n,l,o,u,y,b=!1)=>{b=b||!!l.dynamicChildren;let S=nx(n)&&"["===n.data,C=()=>h(n,l,o,u,y,S),{type:x,ref:w,shapeFlag:E,patchFlag:k}=l,T=n.nodeType;l.el=n,-2===k&&(b=!1,l.dynamicChildren=null);let A=null;switch(x){case l1:3!==T?""===l.children?(a(l.el=r(""),s(n),n),A=n):A=C():(n.data!==l.children&&(nS(),n.data=l.children),A=i(n));break;case l2:_(n)?(A=i(n),m(l.el=n.content.firstChild,n,o)):A=8!==T||S?C():i(n);break;case l6:if(S&&(T=(n=i(n)).nodeType),1===T||3===T){A=n;let e=!l.children.length;for(let t=0;t{s=s||!!t.dynamicChildren;let{type:a,props:u,patchFlag:c,shapeFlag:f,dirs:d,transition:h}=t,g="input"===a||"option"===a;if(g||-1!==c){let a;d&&t2(t,null,n,"created");let y=!1;if(_(e)){y=lN(null,h)&&n&&n.vnode.props&&n.vnode.props.appear;let l=e.content.firstChild;if(y){let e=l.getAttribute("class");e&&(l.$cls=e),h.beforeEnter(l)}m(l,e,n),t.el=e=l}if(16&f&&!(u&&(u.innerHTML||u.textContent))){let l=p(e.firstChild,t,e,n,r,i,s);for(;l;){nT(e,1)||nS();let t=l;l=l.nextSibling,o(t)}}else if(8&f){let n=t.children;` +`===n[0]&&("PRE"===e.tagName||"TEXTAREA"===e.tagName)&&(n=n.slice(1)),e.textContent!==n&&(nT(e,0)||nS(),e.textContent=t.children)}if(u){if(g||!s||48&c){let t=e.tagName.includes("-");for(let r in u)(g&&(r.endsWith("value")||"indeterminate"===r)||S(r)&&!j(r)||"."===r[0]||t)&&l(e,r,null,u[r],void 0,n)}else if(u.onClick)l(e,"onClick",null,u.onClick,void 0,n);else if(4&c&&tu(u.style))for(let e in u.style)u.style[e]}(a=u&&u.onVnodeBeforeMount)&&rv(a,n,t),d&&t2(t,null,n,"beforeMount"),((a=u&&u.onVnodeMounted)||d||y)&&lY(()=>{a&&rv(a,n,t),y&&h.enter(e),d&&t2(t,null,n,"mounted")},r)}return e.nextSibling},p=(e,t,l,s,o,u,f)=>{f=f||!!t.dynamicChildren;let p=t.children,d=p.length;for(let t=0;t{let{slotScopeIds:c}=t;c&&(r=r?r.concat(c):c);let f=s(e),d=p(i(e),t,f,n,l,r,o);return d&&nx(d)&&"]"===d.data?i(t.anchor=d):(nS(),a(t.anchor=u("]"),f,d),d)},h=(e,t,l,r,a,u)=>{if(nT(e.parentElement,1)||nS(),t.el=null,u){let t=g(e);for(;;){let n=i(e);if(n&&n!==t)o(n);else break}}let c=i(e),f=s(e);return o(e),n(null,t,f,c,l,r,nC(f),a),l&&(l.vnode.el=t.el,lz(l,t.el)),c},g=(e,t="[",n="]")=>{let l=0;for(;e;)if((e=i(e))&&nx(e)&&(e.data===t&&l++,e.data===n))if(0===l)return i(e);else l--;return e},m=(e,t,n)=>{let l=t.parentNode;l&&l.replaceChild(e,t);let r=n;for(;r;)r.vnode.el===t&&(r.vnode.el=r.subTree.el=e),r=r.parent},_=e=>1===e.nodeType&&"TEMPLATE"===e.tagName;return[(e,t)=>{if(!t.hasChildNodes()){n(null,e,t),tX(),t._vnode=e;return}c(t.firstChild,e,null,null,null),tX(),t._vnode=e},c]}let nE="data-allow-mismatch",nk={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function nT(e,t){if(0===t||1===t)for(;e&&!e.hasAttribute(nE);)e=e.parentElement;let n=e&&e.getAttribute(nE);if(null==n)return!1;{if(""===n)return!0;let e=n.split(",");return!!(0===t&&e.includes("children"))||e.includes(nk[t])}}let nA=Q().requestIdleCallback||(e=>setTimeout(e,1)),nR=Q().cancelIdleCallback||(e=>clearTimeout(e)),nO=e=>!!e.type.__asyncLoader;function nN(e,t){let{ref:n,props:l,children:r,ce:i}=t.vnode,s=ro(e,l,r);return s.ref=n,s.ce=i,delete t.vnode.ce,s}let nP=e=>e.type.__isKeepAlive;function nM(e,t){return T(e)?e.some(e=>nM(e,t)):P(e)?e.split(",").includes(t):"[object RegExp]"===F(e)&&(e.lastIndex=0,e.test(t))}function nI(e,t){nD(e,"a",t)}function nL(e,t){nD(e,"da",t)}function nD(e,t,n=r_){let l=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()});if(nU(t,l,n),n){let e=n.parent;for(;e&&e.parent;)nP(e.parent.vnode)&&function(e,t,n,l){let r=nU(t,e,l,!0);nz(()=>{w(l[t],r)},n)}(l,t,n,e),e=e.parent}}function nF(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function nV(e){return 128&e.shapeFlag?e.ssContent:e}function nU(e,t,n=r_,l=!1){if(n){let r=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...l)=>{ek();let r=rb(n),i=tD(t,n,e,l);return r(),eT(),i});return l?r.unshift(i):r.push(i),i}}let nj=e=>(t,n=r_)=>{rx&&"sp"!==e||nU(e,(...e)=>t(...e),n)},nB=nj("bm"),n$=nj("m"),nH=nj("bu"),nW=nj("u"),nK=nj("bum"),nz=nj("um"),nq=nj("sp"),nG=nj("rtg"),nJ=nj("rtc");function nX(e,t=r_){nU("ec",e,t)}let nZ="components",nY=Symbol.for("v-ndc");function nQ(e,t,n=!0,l=!1){let r=tY||r_;if(r){let n=r.type;if(e===nZ){let e=rR(n,!1);if(e&&(e===t||e===H(t)||e===z(H(t))))return n}let i=n0(r[e]||n[e],t)||n0(r.appContext[e],t);return!i&&l?n:i}}function n0(e,t){return e&&(e[t]||e[H(t)]||e[z(H(t))])}let n1=e=>e?rC(e)?rA(e):n1(e.parent):null,n2=x(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>n1(e.parent),$root:e=>n1(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>le(e),$forceUpdate:e=>e.f||(e.f=()=>{tz(e.update)}),$nextTick:e=>e.n||(e.n=tK.bind(e.proxy)),$watch:e=>lF.bind(e)}),n6=(e,t)=>e!==m&&!e.__isScriptSetup&&k(e,t),n8={get({_:e},t){let n,l,r;if("__v_skip"===t)return!0;let{ctx:i,setupState:s,data:o,props:a,accessCache:u,type:c,appContext:f}=e;if("$"!==t[0]){let l=u[t];if(void 0!==l)switch(l){case 1:return s[t];case 2:return o[t];case 4:return i[t];case 3:return a[t]}else{if(n6(s,t))return u[t]=1,s[t];if(o!==m&&k(o,t))return u[t]=2,o[t];if((n=e.propsOptions[0])&&k(n,t))return u[t]=3,a[t];if(i!==m&&k(i,t))return u[t]=4,i[t];n9&&(u[t]=0)}}let p=n2[t];return p?("$attrs"===t&&eD(e.attrs,"get",""),p(e)):(l=c.__cssModules)&&(l=l[t])?l:i!==m&&k(i,t)?(u[t]=4,i[t]):k(r=f.config.globalProperties,t)?r[t]:void 0},set({_:e},t,n){let{data:l,setupState:r,ctx:i}=e;return n6(r,t)?(r[t]=n,!0):l!==m&&k(l,t)?(l[t]=n,!0):!k(e.props,t)&&!("$"===t[0]&&t.slice(1)in e)&&(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:l,appContext:r,propsOptions:i}},s){let o;return!!n[s]||e!==m&&k(e,s)||n6(t,s)||(o=i[0])&&k(o,s)||k(l,s)||k(n2,s)||k(r.config.globalProperties,s)},defineProperty(e,t,n){return null!=n.get?e._.accessCache[t]=0:k(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},n4=x({},n8,{get(e,t){if(t!==Symbol.unscopables)return n8.get(e,t,e)},has:(e,t)=>"_"!==t[0]&&!ee(t)});function n3(){let e=ry();return e.setupContext||(e.setupContext=rT(e))}function n5(e){return T(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}let n9=!0;function n7(e,t,n){tD(T(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function le(e){let t,n=e.type,{mixins:l,extends:r}=n,{mixins:i,optionsCache:s,config:{optionMergeStrategies:o}}=e.appContext,a=s.get(n);return a?t=a:i.length||l||r?(t={},i.length&&i.forEach(e=>lt(t,e,o,!0)),lt(t,n,o)):t=n,I(n)&&s.set(n,t),t}function lt(e,t,n,l=!1){let{mixins:r,extends:i}=t;for(let s in i&<(e,i,n,!0),r&&r.forEach(t=>lt(e,t,n,!0)),t)if(l&&"expose"===s);else{let l=ln[s]||n&&n[s];e[s]=l?l(e[s],t[s]):t[s]}return e}let ln={data:ll,props:lo,emits:lo,methods:ls,computed:ls,beforeCreate:li,created:li,beforeMount:li,mounted:li,beforeUpdate:li,updated:li,beforeDestroy:li,beforeUnmount:li,destroyed:li,unmounted:li,activated:li,deactivated:li,errorCaptured:li,serverPrefetch:li,components:ls,directives:ls,watch:function(e,t){if(!e)return t;if(!t)return e;let n=x(Object.create(null),e);for(let l in t)n[l]=li(e[l],t[l]);return n},provide:ll,inject:function(e,t){return ls(lr(e),lr(t))}};function ll(e,t){return t?e?function(){return x(N(e)?e.call(this,this):e,N(t)?t.call(this,this):t)}:t:e}function lr(e){if(T(e)){let t={};for(let n=0;n1)return n&&N(t)?t.call(l&&l.proxy):t}}let ld={},lh=()=>Object.create(ld),lv=e=>Object.getPrototypeOf(e)===ld;function lg(e,t,n,l){let r,[i,s]=e.propsOptions,o=!1;if(t)for(let a in t){let u;if(j(a))continue;let c=t[a];i&&k(i,u=H(a))?s&&s.includes(u)?(r||(r={}))[u]=c:n[u]=c:lB(e.emitsOptions,a)||a in l&&c===l[a]||(l[a]=c,o=!0)}if(s){let t=td(n),l=r||m;for(let r=0;r"_"===e[0]||"$stable"===e,lS=e=>T(e)?e.map(rf):[rf(e)],lC=(e,t,n)=>{if(t._n)return t;let l=t1((...e)=>lS(t(...e)),n);return l._c=!1,l},lx=(e,t,n)=>{let l=e._ctx;for(let n in e){if(lb(n))continue;let r=e[n];if(N(r))t[n]=lC(n,r,l);else if(null!=r){let e=lS(r);t[n]=()=>e}}},lw=(e,t)=>{let n=lS(t);e.slots.default=()=>n},lE=(e,t,n)=>{for(let l in t)(n||!lb(l))&&(e[l]=t[l])},lk=lY;function lT(e){return lA(e,nw)}function lA(e,t){var n;let l,r;Q().__VUE__=!0;let{insert:i,remove:s,patchProp:o,createElement:a,createText:c,createComment:f,setText:p,setElementText:d,parentNode:h,nextSibling:g,setScopeId:b=y,insertStaticContent:S}=e,C=(e,t,n,l=null,r=null,i=null,s,o=null,a=!!t.dynamicChildren)=>{if(e===t)return;e&&!rl(e,t)&&(l=es(e),et(e,r,i,!0),e=null),-2===t.patchFlag&&(a=!1,t.dynamicChildren=null);let{type:u,ref:c,shapeFlag:f}=t;switch(u){case l1:w(e,t,n,l);break;case l2:E(e,t,n,l);break;case l6:null==e&&A(t,n,l,s);break;case l0:U(e,t,n,l,r,i,s,o,a);break;default:1&f?R(e,t,n,l,r,i,s,o,a):6&f?B(e,t,n,l,r,i,s,o,a):64&f?u.process(e,t,n,l,r,i,s,o,a,eu):128&f&&u.process(e,t,n,l,r,i,s,o,a,eu)}null!=c&&r?ny(c,e&&e.ref,i,t||e,!t):null==c&&e&&null!=e.ref&&ny(e.ref,null,i,e,!0)},w=(e,t,n,l)=>{if(null==e)i(t.el=c(t.children),n,l);else{let n=t.el=e.el;t.children!==e.children&&p(n,t.children)}},E=(e,t,n,l)=>{null==e?i(t.el=f(t.children||""),n,l):t.el=e.el},A=(e,t,n,l)=>{[e.el,e.anchor]=S(e.children,t,n,l,e.el,e.anchor)},R=(e,t,n,l,r,i,s,o,a)=>{"svg"===t.type?s="svg":"math"===t.type&&(s="mathml"),null==e?O(t,n,l,r,i,s,o,a):D(e,t,r,i,s,o,a)},O=(e,t,n,l,r,s,u,c)=>{let f,p,{props:h,shapeFlag:g,transition:m,dirs:_}=e;if(f=e.el=a(e.type,s,h&&h.is,h),8&g?d(f,e.children):16&g&&M(e.children,f,null,l,r,lR(e,s),u,c),_&&t2(e,null,l,"created"),P(f,e,e.scopeId,u,l),h){for(let e in h)"value"===e||j(e)||o(f,e,null,h[e],s,l);"value"in h&&o(f,"value",null,h.value,s),(p=h.onVnodeBeforeMount)&&rv(p,l,e)}_&&t2(e,null,l,"beforeMount");let y=lN(r,m);y&&m.beforeEnter(f),i(f,t,n),((p=h&&h.onVnodeMounted)||y||_)&&lk(()=>{p&&rv(p,l,e),y&&m.enter(f),_&&t2(e,null,l,"mounted")},r)},P=(e,t,n,l,r)=>{if(n&&b(e,n),l)for(let t=0;t{for(let u=a;u{let a,u=t.el=e.el,{patchFlag:c,dynamicChildren:f,dirs:p}=t;c|=16&e.patchFlag;let h=e.props||m,g=t.props||m;if(n&&lO(n,!1),(a=g.onVnodeBeforeUpdate)&&rv(a,n,t,e),p&&t2(t,e,n,"beforeUpdate"),n&&lO(n,!0),(h.innerHTML&&null==g.innerHTML||h.textContent&&null==g.textContent)&&d(u,""),f?F(e.dynamicChildren,f,u,n,l,lR(t,r),i):s||G(e,t,u,null,n,l,lR(t,r),i,!1),c>0){if(16&c)V(u,h,g,n,r);else if(2&c&&h.class!==g.class&&o(u,"class",null,g.class,r),4&c&&o(u,"style",h.style,g.style,r),8&c){let e=t.dynamicProps;for(let t=0;t{a&&rv(a,n,t,e),p&&t2(t,e,n,"updated")},l)},F=(e,t,n,l,r,i,s)=>{for(let o=0;o{if(t!==n){if(t!==m)for(let i in t)j(i)||i in n||o(e,i,t[i],null,r,l);for(let i in n){if(j(i))continue;let s=n[i],a=t[i];s!==a&&"value"!==i&&o(e,i,a,s,r,l)}"value"in n&&o(e,"value",t.value,n.value,r)}},U=(e,t,n,l,r,s,o,a,u)=>{let f=t.el=e?e.el:c(""),p=t.anchor=e?e.anchor:c(""),{patchFlag:d,dynamicChildren:h,slotScopeIds:g}=t;g&&(a=a?a.concat(g):g),null==e?(i(f,n,l),i(p,n,l),M(t.children||[],n,p,r,s,o,a,u)):d>0&&64&d&&h&&e.dynamicChildren?(F(e.dynamicChildren,h,n,r,s,o,a),(null!=t.key||r&&t===r.subTree)&&lP(e,t,!0)):G(e,t,n,p,r,s,o,a,u)},B=(e,t,n,l,r,i,s,o,a)=>{t.slotScopeIds=o,null==e?512&t.shapeFlag?r.ctx.activate(t,n,l,s,a):$(t,n,l,r,i,s,a):W(e,t,a)},$=(e,t,n,l,r,i,s)=>{let o=e.component=function(e,t,n){let l=e.type,r=(t?t.appContext:e.appContext)||rg,i={uid:rm++,vnode:e,type:l,parent:t,appContext:r,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new ed(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(r.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:function e(t,n,l=!1){let r=l?l_:n.propsCache,i=r.get(t);if(i)return i;let s=t.props,o={},a=[],u=!1;if(!N(t)){let r=t=>{u=!0;let[l,r]=e(t,n,!0);x(o,l),r&&a.push(...r)};!l&&n.mixins.length&&n.mixins.forEach(r),t.extends&&r(t.extends),t.mixins&&t.mixins.forEach(r)}if(!s&&!u)return I(t)&&r.set(t,_),_;if(T(s))for(let e=0;e{let l=e(t,n,!0);l&&(a=!0,x(o,l))};!l&&n.mixins.length&&n.mixins.forEach(r),t.extends&&r(t.extends),t.mixins&&t.mixins.forEach(r)}return s||a?(T(s)?s.forEach(e=>o[e]=null):x(o,s),I(t)&&r.set(t,o),o):(I(t)&&r.set(t,null),null)}(l,r),emit:null,emitted:null,propsDefaults:m,inheritAttrs:l.inheritAttrs,ctx:m,data:m,props:m,attrs:m,slots:m,refs:m,setupState:m,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return i.ctx={_:i},i.root=t?t.root:i,i.emit=lj.bind(null,i),e.ce&&e.ce(i),i}(e,l,r);nP(e)&&(o.ctx.renderer=eu),function(e,t=!1,n=!1){t&&u(t);let{props:l,children:r}=e.vnode,i=rC(e);!function(e,t,n,l=!1){let r={},i=lh();for(let n in e.propsDefaults=Object.create(null),lg(e,t,r,i),e.propsOptions[0])n in r||(r[n]=void 0);n?e.props=l?r:ts(r):e.type.props?e.props=r:e.props=i,e.attrs=i}(e,l,i,t),((e,t,n)=>{let l=e.slots=lh();if(32&e.vnode.shapeFlag){let e=t.__;e&&X(l,"__",e,!0);let r=t._;r?(lE(l,t,n),n&&X(l,"_",r,!0)):lx(t,l)}else t&&lw(e,t)})(e,r,n||t),i&&function(e,t){let n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,n8);let{setup:l}=n;if(l){ek();let n=e.setupContext=l.length>1?rT(e):null,r=rb(e),i=tL(l,e,0,[e.props,n]),s=L(i);if(eT(),r(),(s||e.sp)&&!nO(e)&&n_(e),s){if(i.then(rS,rS),t)return i.then(n=>{rw(e,n,t)}).catch(t=>{tF(t,e,0)});e.asyncDep=i}else rw(e,i,t)}else rE(e,t)}(e,t),t&&u(!1)}(o,!1,s),o.asyncDep?(r&&r.registerDep(o,z,s),e.el||E(null,o.subTree=ro(l2),t,n)):z(o,e,t,n,r,i,s)},W=(e,t,n)=>{let l=t.component=e.component;if(function(e,t,n){let{props:l,children:r,component:i}=e,{props:s,children:o,patchFlag:a}=t,u=i.emitsOptions;if(t.dirs||t.transition)return!0;if(!n||!(a>=0))return(!!r||!!o)&&(!o||!o.$stable)||l!==s&&(l?!s||lK(l,s,u):!!s);if(1024&a)return!0;if(16&a)return l?lK(l,s,u):!!s;if(8&a){let e=t.dynamicProps;for(let t=0;t{let a=()=>{if(e.isMounted){let t,{next:n,bu:l,u:r,parent:u,vnode:c}=e;{let t=function e(t){let n=t.subTree.component;if(n)if(n.asyncDep&&!n.asyncResolved)return n;else return e(n)}(e);if(t){n&&(n.el=c.el,q(e,n,o)),t.asyncDep.then(()=>{e.isUnmounted||a()});return}}let f=n;lO(e,!1),n?(n.el=c.el,q(e,n,o)):n=c,l&&J(l),(t=n.props&&n.props.onVnodeBeforeUpdate)&&rv(t,u,n,c),lO(e,!0);let p=l$(e),d=e.subTree;e.subTree=p,C(d,p,h(d.el),es(d),e,i,s),n.el=p.el,null===f&&lz(e,p.el),r&&lk(r,i),(t=n.props&&n.props.onVnodeUpdated)&&lk(()=>rv(t,u,n,c),i)}else{let o,{el:a,props:u}=t,{bm:c,m:f,parent:p,root:d,type:h}=e,g=nO(t);if(lO(e,!1),c&&J(c),!g&&(o=u&&u.onVnodeBeforeMount)&&rv(o,p,t),lO(e,!0),a&&r){let t=()=>{e.subTree=l$(e),r(a,e.subTree,e,i,null)};g&&h.__asyncHydrate?h.__asyncHydrate(a,e,t):t()}else{d.ce&&!1!==d.ce._def.shadowRoot&&d.ce._injectChildStyle(h);let r=e.subTree=l$(e);C(null,r,n,l,e,i,s),t.el=r.el}if(f&&lk(f,i),!g&&(o=u&&u.onVnodeMounted)){let e=t;lk(()=>rv(o,p,e),i)}(256&t.shapeFlag||p&&nO(p.vnode)&&256&p.vnode.shapeFlag)&&e.a&&lk(e.a,i),e.isMounted=!0,t=n=l=null}};e.scope.on();let u=e.effect=new ev(a);e.scope.off();let c=e.update=u.run.bind(u),f=e.job=u.runIfDirty.bind(u);f.i=e,f.id=e.uid,u.scheduler=()=>tz(f),lO(e,!0),c()},q=(e,t,n)=>{t.component=e;let l=e.vnode.props;e.vnode=t,e.next=null,function(e,t,n,l){let{props:r,attrs:i,vnode:{patchFlag:s}}=e,o=td(r),[a]=e.propsOptions,u=!1;if((l||s>0)&&!(16&s)){if(8&s){let n=e.vnode.dynamicProps;for(let l=0;l{let{vnode:l,slots:r}=e,i=!0,s=m;if(32&l.shapeFlag){let e=t._;e?n&&1===e?i=!1:lE(r,t,n):(i=!t.$stable,lx(t,r)),s=t}else t&&(lw(e,t),s={default:1});if(i)for(let e in r)lb(e)||null!=s[e]||delete r[e]})(e,t.children,n),ek(),tJ(e),eT()},G=(e,t,n,l,r,i,s,o,a=!1)=>{let u=e&&e.children,c=e?e.shapeFlag:0,f=t.children,{patchFlag:p,shapeFlag:h}=t;if(p>0){if(128&p)return void Y(u,f,n,l,r,i,s,o,a);else if(256&p)return void Z(u,f,n,l,r,i,s,o,a)}8&h?(16&c&&ei(u,r,i),f!==u&&d(n,f)):16&c?16&h?Y(u,f,n,l,r,i,s,o,a):ei(u,r,i,!0):(8&c&&d(n,""),16&h&&M(f,n,l,r,i,s,o,a))},Z=(e,t,n,l,r,i,s,o,a)=>{let u;e=e||_,t=t||_;let c=e.length,f=t.length,p=Math.min(c,f);for(u=0;uf?ei(e,r,i,!0,!1,p):M(t,n,l,r,i,s,o,a,p)},Y=(e,t,n,l,r,i,s,o,a)=>{let u=0,c=t.length,f=e.length-1,p=c-1;for(;u<=f&&u<=p;){let l=e[u],c=t[u]=a?rp(t[u]):rf(t[u]);if(rl(l,c))C(l,c,n,null,r,i,s,o,a);else break;u++}for(;u<=f&&u<=p;){let l=e[f],u=t[p]=a?rp(t[p]):rf(t[p]);if(rl(l,u))C(l,u,n,null,r,i,s,o,a);else break;f--,p--}if(u>f){if(u<=p){let e=p+1,f=ep)for(;u<=f;)et(e[u],r,i,!0),u++;else{let d,h=u,g=u,m=new Map;for(u=g;u<=p;u++){let e=t[u]=a?rp(t[u]):rf(t[u]);null!=e.key&&m.set(e.key,u)}let y=0,b=p-g+1,S=!1,x=0,w=Array(b);for(u=0;u=b){et(c,r,i,!0);continue}if(null!=c.key)l=m.get(c.key);else for(d=g;d<=p;d++)if(0===w[d-g]&&rl(c,t[d])){l=d;break}void 0===l?et(c,r,i,!0):(w[l-g]=u+1,l>=x?x=l:S=!0,C(c,t[l],n,null,r,i,s,o,a),y++)}let E=S?function(e){let t,n,l,r,i,s=e.slice(),o=[0],a=e.length;for(t=0;t>1]]0&&(s[t]=o[l-1]),o[l]=t)}}for(l=o.length,r=o[l-1];l-- >0;)o[l]=r,r=s[r];return o}(w):_;for(d=E.length-1,u=b-1;u>=0;u--){let e=g+u,f=t[e],p=e+1{let{el:o,type:a,transition:u,children:c,shapeFlag:f}=e;if(6&f)return void ee(e.component.subTree,t,n,l);if(128&f)return void e.suspense.move(t,n,l);if(64&f)return void a.move(e,t,n,eu);if(a===l0){i(o,t,n);for(let e=0;e{let r;for(;e&&e!==t;)r=g(e),i(e,n,l),e=r;i(t,n,l)})(e,t,n);if(2!==l&&1&f&&u)if(0===l)u.beforeEnter(o),i(o,t,n),lk(()=>u.enter(o),r);else{let{leave:l,delayLeave:r,afterLeave:a}=u,c=()=>{e.ctx.isUnmounted?s(o):i(o,t,n)},f=()=>{l(o,()=>{c(),a&&a()})};r?r(o,c,f):f()}else i(o,t,n)},et=(e,t,n,l=!1,r=!1)=>{let i,{type:s,props:o,ref:a,children:u,dynamicChildren:c,shapeFlag:f,patchFlag:p,dirs:d,cacheIndex:h}=e;if(-2===p&&(r=!1),null!=a&&(ek(),ny(a,null,n,e,!0),eT()),null!=h&&(t.renderCache[h]=void 0),256&f)return void t.ctx.deactivate(e);let g=1&f&&d,m=!nO(e);if(m&&(i=o&&o.onVnodeBeforeUnmount)&&rv(i,t,e),6&f)er(e.component,n,l);else{if(128&f)return void e.suspense.unmount(n,l);g&&t2(e,null,t,"beforeUnmount"),64&f?e.type.remove(e,t,n,eu,l):c&&!c.hasOnce&&(s!==l0||p>0&&64&p)?ei(c,t,n,!1,!0):(s===l0&&384&p||!r&&16&f)&&ei(u,t,n),l&&en(e)}(m&&(i=o&&o.onVnodeUnmounted)||g)&&lk(()=>{i&&rv(i,t,e),g&&t2(e,null,t,"unmounted")},n)},en=e=>{let{type:t,el:n,anchor:l,transition:r}=e;if(t===l0)return void el(n,l);if(t===l6)return void(({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=g(e),s(e),e=n;s(t)})(e);let i=()=>{s(n),r&&!r.persisted&&r.afterLeave&&r.afterLeave()};if(1&e.shapeFlag&&r&&!r.persisted){let{leave:t,delayLeave:l}=r,s=()=>t(n,i);l?l(e.el,i,s):s()}else i()},el=(e,t)=>{let n;for(;e!==t;)n=g(e),s(e),e=n;s(t)},er=(e,t,n)=>{let{bum:l,scope:r,job:i,subTree:s,um:o,m:a,a:u,parent:c,slots:{__:f}}=e;lM(a),lM(u),l&&J(l),c&&T(f)&&f.forEach(e=>{c.renderCache[e]=void 0}),r.stop(),i&&(i.flags|=8,et(s,e,t,n)),o&&lk(o,t),lk(()=>{e.isUnmounted=!0},t),t&&t.pendingBranch&&!t.isUnmounted&&e.asyncDep&&!e.asyncResolved&&e.suspenseId===t.pendingId&&(t.deps--,0===t.deps&&t.resolve())},ei=(e,t,n,l=!1,r=!1,i=0)=>{for(let s=i;s{if(6&e.shapeFlag)return es(e.component.subTree);if(128&e.shapeFlag)return e.suspense.next();let t=g(e.anchor||e.el),n=t&&t[t6];return n?g(n):t},eo=!1,ea=(e,t,n)=>{null==e?t._vnode&&et(t._vnode,null,null,!0):C(t._vnode||null,e,t,null,null,null,n),t._vnode=e,eo||(eo=!0,tJ(),tX(),eo=!1)},eu={p:C,um:et,m:ee,r:en,mt:$,mc:M,pc:G,pbc:F,n:es,o:e};return t&&([l,r]=t(eu)),{render:ea,hydrate:l,createApp:(n=l,function(e,t=null){N(e)||(e=x({},e)),null==t||I(t)||(t=null);let l=la(),r=new WeakSet,i=[],s=!1,o=l.app={_uid:lu++,_component:e,_props:t,_container:null,_context:l,_instance:null,version:rM,get config(){return l.config},set config(v){},use:(e,...t)=>(r.has(e)||(e&&N(e.install)?(r.add(e),e.install(o,...t)):N(e)&&(r.add(e),e(o,...t))),o),mixin:e=>(l.mixins.includes(e)||l.mixins.push(e),o),component:(e,t)=>t?(l.components[e]=t,o):l.components[e],directive:(e,t)=>t?(l.directives[e]=t,o):l.directives[e],mount(r,i,a){if(!s){let u=o._ceVNode||ro(e,t);return u.appContext=l,!0===a?a="svg":!1===a&&(a=void 0),i&&n?n(u,r):ea(u,r,a),s=!0,o._container=r,r.__vue_app__=o,rA(u.component)}},onUnmount(e){i.push(e)},unmount(){s&&(tD(i,o._instance,16),ea(null,o._container),delete o._container.__vue_app__)},provide:(e,t)=>(l.provides[e]=t,o),runWithContext(e){let t=lc;lc=o;try{return e()}finally{lc=t}}};return o})}}function lR({type:e,props:t},n){return"svg"===n&&"foreignObject"===e||"mathml"===n&&"annotation-xml"===e&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function lO({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function lN(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function lP(e,t,n=!1){let l=e.children,r=t.children;if(T(l)&&T(r))for(let e=0;etD(e,u,t,n);let c=!1;return"post"===s?a.scheduler=e=>{lk(e,u&&u.suspense)}:"sync"!==s&&(c=!0,a.scheduler=(e,t)=>{t?e():tz(e)}),a.augmentJob=e=>{t&&(e.flags|=4),c&&(e.flags|=2,u&&(e.id=u.uid,e.i=u))},function(e,t,n=m){let l,i,s,o,{immediate:a,deep:u,once:c,scheduler:f,augmentJob:p,call:h}=n,g=e=>u?e:tf(e)||!1===u||0===u?tI(e,1):tI(e),_=!1,b=!1;if(tm(e)?(i=()=>e.value,_=tf(e)):tu(e)?(i=()=>g(e),_=!0):T(e)?(b=!0,_=e.some(e=>tu(e)||tf(e)),i=()=>e.map(e=>tm(e)?e.value:tu(e)?g(e):N(e)?h?h(e,2):e():void 0)):i=N(e)?t?h?()=>h(e,2):e:()=>{if(s){ek();try{s()}finally{eT()}}let t=d;d=l;try{return h?h(e,3,[o]):e(o)}finally{d=t}}:y,t&&u){let e=i,t=!0===u?1/0:u;i=()=>tI(e(),t)}let S=r,C=()=>{l.stop(),S&&S.active&&w(S.effects,l)};if(c&&t){let e=t;t=(...t)=>{e(...t),C()}}let x=b?Array(e.length).fill(tN):tN,E=e=>{if(1&l.flags&&(l.dirty||e))if(t){let e=l.run();if(u||_||(b?e.some((e,t)=>G(e,x[t])):G(e,x))){s&&s();let n=d;d=l;try{let n=[e,x===tN?void 0:b&&x[0]===tN?[]:x,o];x=e,h?h(t,3,n):t(...n)}finally{d=n}}}else l.run()};return p&&p(E),(l=new ev(i)).scheduler=f?()=>f(E,!1):E,o=e=>tM(e,!1,l),s=l.onStop=()=>{let e=tP.get(l);if(e){if(h)h(e,4);else for(let t of e)t();tP.delete(l)}},t?a?E(!0):x=l.run():f?f(E.bind(null,!0),!0):l.run(),C.pause=l.pause.bind(l),C.resume=l.resume.bind(l),C.stop=C,C}(e,t,a)}function lF(e,t,n){let l,r=this.proxy,i=P(e)?e.includes(".")?lV(r,e):()=>r[e]:e.bind(r,r);N(t)?l=t:(l=t.handler,n=t);let s=rb(this),o=lD(i,l.bind(r),n);return s(),o}function lV(e,t){let n=t.split(".");return()=>{let t=e;for(let e=0;e"modelValue"===t||"model-value"===t?e.modelModifiers:e[`${t}Modifiers`]||e[`${H(t)}Modifiers`]||e[`${K(t)}Modifiers`];function lj(e,t,...n){let l;if(e.isUnmounted)return;let r=e.vnode.props||m,i=n,s=t.startsWith("update:"),o=s&&lU(r,t.slice(7));o&&(o.trim&&(i=n.map(e=>P(e)?e.trim():e)),o.number&&(i=n.map(Z)));let a=r[l=q(t)]||r[l=q(H(t))];!a&&s&&(a=r[l=q(K(t))]),a&&tD(a,e,6,i);let u=r[l+"Once"];if(u){if(e.emitted){if(e.emitted[l])return}else e.emitted={};e.emitted[l]=!0,tD(u,e,6,i)}}function lB(e,t){return!!e&&!!S(t)&&(k(e,(t=t.slice(2).replace(/Once$/,""))[0].toLowerCase()+t.slice(1))||k(e,K(t))||k(e,t))}function l$(e){let t,n,{type:l,vnode:r,proxy:i,withProxy:s,propsOptions:[o],slots:a,attrs:u,emit:c,render:f,renderCache:p,props:d,data:h,setupState:g,ctx:m,inheritAttrs:_}=e,y=t0(e);try{if(4&r.shapeFlag){let e=s||i;t=rf(f.call(e,e,p,d,g,h,m)),n=u}else t=rf(l.length>1?l(d,{attrs:u,slots:a,emit:c}):l(d,null)),n=l.props?u:lH(u)}catch(n){l8.length=0,tF(n,e,1),t=ro(l2)}let b=t;if(n&&!1!==_){let e=Object.keys(n),{shapeFlag:t}=b;e.length&&7&t&&(o&&e.some(C)&&(n=lW(n,o)),b=ru(b,n,!1,!0))}return r.dirs&&((b=ru(b,null,!1,!0)).dirs=b.dirs?b.dirs.concat(r.dirs):r.dirs),r.transition&&nv(b,r.transition),t=b,t0(y),t}let lH=e=>{let t;for(let n in e)("class"===n||"style"===n||S(n))&&((t||(t={}))[n]=e[n]);return t},lW=(e,t)=>{let n={};for(let l in e)C(l)&&l.slice(9)in t||(n[l]=e[l]);return n};function lK(e,t,n){let l=Object.keys(t);if(l.length!==Object.keys(e).length)return!0;for(let r=0;re.__isSuspense,lG=0;function lJ(e,t){let n=e.props&&e.props[t];N(n)&&n()}function lX(e,t,n,l,r,i,s,o,a,u,c=!1){let f,{p:p,m:d,um:h,n:g,o:{parentNode:m,remove:_}}=u,y=function(e){let t=e.props&&e.props.suspensible;return null!=t&&!1!==t}(e);y&&t&&t.pendingBranch&&(f=t.pendingId,t.deps++);let b=e.props?Y(e.props.timeout):void 0,S=i,C={vnode:e,parent:t,parentComponent:n,namespace:s,container:l,hiddenContainer:r,deps:0,pendingId:lG++,timeout:"number"==typeof b?b:-1,activeBranch:null,pendingBranch:null,isInFallback:!c,isHydrating:c,isUnmounted:!1,effects:[],resolve(e=!1,n=!1){let{vnode:l,activeBranch:r,pendingBranch:s,pendingId:o,effects:a,parentComponent:u,container:c}=C,p=!1;C.isHydrating?C.isHydrating=!1:!e&&((p=r&&s.transition&&"out-in"===s.transition.mode)&&(r.transition.afterLeave=()=>{o===C.pendingId&&(d(s,c,i===S?g(r):i,0),tG(a))}),r&&(m(r.el)===c&&(i=g(r)),h(r,u,C,!0)),p||d(s,c,i,0)),lQ(C,s),C.pendingBranch=null,C.isInFallback=!1;let _=C.parent,b=!1;for(;_;){if(_.pendingBranch){_.effects.push(...a),b=!0;break}_=_.parent}b||p||tG(a),C.effects=[],y&&t&&t.pendingBranch&&f===t.pendingId&&(t.deps--,0!==t.deps||n||t.resolve()),lJ(l,"onResolve")},fallback(e){if(!C.pendingBranch)return;let{vnode:t,activeBranch:n,parentComponent:l,container:r,namespace:i}=C;lJ(t,"onFallback");let s=g(n),u=()=>{C.isInFallback&&(p(null,e,r,s,l,null,i,o,a),lQ(C,e))},c=e.transition&&"out-in"===e.transition.mode;c&&(n.transition.afterLeave=u),C.isInFallback=!0,h(n,l,null,!0),c||u()},move(e,t,n){C.activeBranch&&d(C.activeBranch,e,t,n),C.container=e},next:()=>C.activeBranch&&g(C.activeBranch),registerDep(e,t,n){let l=!!C.pendingBranch;l&&C.deps++;let r=e.vnode.el;e.asyncDep.catch(t=>{tF(t,e,0)}).then(i=>{if(e.isUnmounted||C.isUnmounted||C.pendingId!==e.suspenseId)return;e.asyncResolved=!0;let{vnode:o}=e;rw(e,i,!1),r&&(o.el=r);let a=!r&&e.subTree.el;t(e,o,m(r||e.subTree.el),r?null:g(e.subTree),C,s,n),a&&_(a),lz(e,o.el),l&&0==--C.deps&&C.resolve()})},unmount(e,t){C.isUnmounted=!0,C.activeBranch&&h(C.activeBranch,n,e,t),C.pendingBranch&&h(C.pendingBranch,n,e,t)}};return C}function lZ(e){let t;if(N(e)){let n=l9&&e._c;n&&(e._d=!1,l3()),e=e(),n&&(e._d=!0,t=l4,l5())}return T(e)&&(e=function(e,t=!0){let n;for(let t=0;tt!==e)),e}function lY(e,t){t&&t.pendingBranch?T(e)?t.effects.push(...e):t.effects.push(e):tG(e)}function lQ(e,t){e.activeBranch=t;let{vnode:n,parentComponent:l}=e,r=t.el;for(;!r&&t.component;)r=(t=t.component.subTree).el;n.el=r,l&&l.subTree===n&&(l.vnode.el=r,lz(l,r))}let l0=Symbol.for("v-fgt"),l1=Symbol.for("v-txt"),l2=Symbol.for("v-cmt"),l6=Symbol.for("v-stc"),l8=[],l4=null;function l3(e=!1){l8.push(l4=e?null:[])}function l5(){l8.pop(),l4=l8[l8.length-1]||null}let l9=1;function l7(e,t=!1){l9+=e,e<0&&l4&&t&&(l4.hasOnce=!0)}function re(e){return e.dynamicChildren=l9>0?l4||_:null,l5(),l9>0&&l4&&l4.push(e),e}function rt(e,t,n,l,r){return re(ro(e,t,n,l,r,!0))}function rn(e){return!!e&&!0===e.__v_isVNode}function rl(e,t){return e.type===t.type&&e.key===t.key}let rr=({key:e})=>null!=e?e:null,ri=({ref:e,ref_key:t,ref_for:n})=>("number"==typeof e&&(e=""+e),null!=e?P(e)||tm(e)||N(e)?{i:tY,r:e,k:t,f:!!n}:e:null);function rs(e,t=null,n=null,l=0,r=null,i=+(e!==l0),s=!1,o=!1){let a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&rr(t),ref:t&&ri(t),scopeId:tQ,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:l,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:tY};return o?(rd(a,n),128&i&&e.normalize(a)):n&&(a.shapeFlag|=P(n)?8:16),l9>0&&!s&&l4&&(a.patchFlag>0||6&i)&&32!==a.patchFlag&&l4.push(a),a}let ro=function(e,t=null,n=null,l=0,r=null,i=!1){var s;if(e&&e!==nY||(e=l2),rn(e)){let l=ru(e,t,!0);return n&&rd(l,n),l9>0&&!i&&l4&&(6&l.shapeFlag?l4[l4.indexOf(e)]=l:l4.push(l)),l.patchFlag=-2,l}if(N(s=e)&&"__vccOpts"in s&&(e=e.__vccOpts),t){let{class:e,style:n}=t=ra(t);e&&!P(e)&&(t.class=ei(e)),I(n)&&(tp(n)&&!T(n)&&(n=x({},n)),t.style=et(n))}let o=P(e)?1:lq(e)?128:e.__isTeleport?64:I(e)?4:2*!!N(e);return rs(e,t,n,l,r,o,i,!0)};function ra(e){return e?tp(e)||lv(e)?x({},e):e:null}function ru(e,t,n=!1,l=!1){let{props:r,ref:i,patchFlag:s,children:o,transition:a}=e,u=t?rh(r||{},t):r,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&rr(u),ref:t&&t.ref?n&&i?T(i)?i.concat(ri(t)):[i,ri(t)]:ri(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:o,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==l0?-1===s?16:16|s:s,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&ru(e.ssContent),ssFallback:e.ssFallback&&ru(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&l&&nv(c,a.clone(c)),c}function rc(e=" ",t=0){return ro(l1,null,e,t)}function rf(e){return null==e||"boolean"==typeof e?ro(l2):T(e)?ro(l0,null,e.slice()):rn(e)?rp(e):ro(l1,null,String(e))}function rp(e){return null===e.el&&-1!==e.patchFlag||e.memo?e:ru(e)}function rd(e,t){let n=0,{shapeFlag:l}=e;if(null==t)t=null;else if(T(t))n=16;else if("object"==typeof t)if(65&l){let n=t.default;n&&(n._c&&(n._d=!1),rd(e,n()),n._c&&(n._d=!0));return}else{n=32;let l=t._;l||lv(t)?3===l&&tY&&(1===tY.slots._?t._=1:(t._=2,e.patchFlag|=1024)):t._ctx=tY}else N(t)?(t={default:t,_ctx:tY},n=32):(t=String(t),64&l?(n=16,t=[rc(t)]):n=8);e.children=t,e.shapeFlag|=n}function rh(...e){let t={};for(let n=0;nr_||tY;a=e=>{r_=e},u=e=>{rx=e};let rb=e=>{let t=r_;return a(e),e.scope.on(),()=>{e.scope.off(),a(t)}},rS=()=>{r_&&r_.scope.off(),a(null)};function rC(e){return 4&e.vnode.shapeFlag}let rx=!1;function rw(e,t,n){N(t)?e.render=t:I(t)&&(e.setupState=tw(t)),rE(e,n)}function rE(e,t,n){let l=e.type;if(!e.render){if(!t&&c&&!l.render){let t=l.template||le(e).template;if(t){let{isCustomElement:n,compilerOptions:r}=e.appContext.config,{delimiters:i,compilerOptions:s}=l,o=x(x({isCustomElement:n,delimiters:i},r),s);l.render=c(t,o)}}e.render=l.render||y,f&&f(e)}{let t=rb(e);ek();try{!function(e){let t=le(e),n=e.proxy,l=e.ctx;n9=!1,t.beforeCreate&&n7(t.beforeCreate,e,"bc");let{data:r,computed:i,methods:s,watch:o,provide:a,inject:u,created:c,beforeMount:f,mounted:p,beforeUpdate:d,updated:h,activated:g,deactivated:m,beforeDestroy:_,beforeUnmount:b,destroyed:S,unmounted:C,render:x,renderTracked:w,renderTriggered:E,errorCaptured:k,serverPrefetch:A,expose:R,inheritAttrs:O,components:M,directives:L,filters:D}=t;if(u&&function(e,t,n=y){for(let n in T(e)&&(e=lr(e)),e){let l,r=e[n];tm(l=I(r)?"default"in r?lp(r.from||n,r.default,!0):lp(r.from||n):lp(r))?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>l.value,set:e=>l.value=e}):t[n]=l}}(u,l,null),s)for(let e in s){let t=s[e];N(t)&&(l[e]=t.bind(n))}if(r){let t=r.call(n,n);I(t)&&(e.data=ti(t))}if(n9=!0,i)for(let e in i){let t=i[e],r=N(t)?t.bind(n,n):N(t.get)?t.get.bind(n,n):y,s=rO({get:r,set:!N(t)&&N(t.set)?t.set.bind(n):y});Object.defineProperty(l,e,{enumerable:!0,configurable:!0,get:()=>s.value,set:e=>s.value=e})}if(o)for(let e in o)!function e(t,n,l,r){var i,s,o,a,u,c,f;let p=r.includes(".")?lV(l,r):()=>l[r];if(P(t)){let e=n[t];N(e)&&(i=p,s=e,lD(i,s,void 0))}else if(N(t)){o=p,a=t.bind(l),lD(o,a,void 0)}else if(I(t))if(T(t))t.forEach(t=>e(t,n,l,r));else{let e=N(t.handler)?t.handler.bind(l):n[t.handler];N(e)&&(u=p,c=e,f=t,lD(u,c,f))}}(o[e],l,n,e);if(a){let e=N(a)?a.call(n):a;Reflect.ownKeys(e).forEach(t=>{lf(t,e[t])})}function F(e,t){T(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(c&&n7(c,e,"c"),F(nB,f),F(n$,p),F(nH,d),F(nW,h),F(nI,g),F(nL,m),F(nX,k),F(nJ,w),F(nG,E),F(nK,b),F(nz,C),F(nq,A),T(R))if(R.length){let t=e.exposed||(e.exposed={});R.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t})})}else e.exposed||(e.exposed={});x&&e.render===y&&(e.render=x),null!=O&&(e.inheritAttrs=O),M&&(e.components=M),L&&(e.directives=L)}(e)}finally{eT(),t()}}}let rk={get:(e,t)=>(eD(e,"get",""),e[t])};function rT(e){return{attrs:new Proxy(e.attrs,rk),slots:e.slots,emit:e.emit,expose:t=>{e.exposed=t||{}}}}function rA(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(tw(th(e.exposed)),{get:(t,n)=>n in t?t[n]:n in n2?n2[n](e):void 0,has:(e,t)=>t in e||t in n2})):e.proxy}function rR(e,t=!0){return N(e)?e.displayName||e.name:e.name||t&&e.__name}let rO=(e,t)=>(function(e,t,n=!1){let l,r;return N(e)?l=e:(l=e.get,r=e.set),new tO(l,r,n)})(e,0,rx);function rN(e,t,n){let l=arguments.length;return 2!==l?(l>3?n=Array.prototype.slice.call(arguments,2):3===l&&rn(n)&&(n=[n]),ro(e,t,n)):!I(t)||T(t)?ro(e,null,t):rn(t)?ro(e,null,[t]):ro(e,t)}function rP(e,t){let n=e.memo;if(n.length!=t.length)return!1;for(let e=0;e0&&l4&&l4.push(e),!0}let rM="3.5.17",rI="undefined"!=typeof window&&window.trustedTypes;if(rI)try{h=rI.createPolicy("vue",{createHTML:e=>e})}catch(e){}let rL=h?e=>h.createHTML(e):e=>e,rD="undefined"!=typeof document?document:null,rF=rD&&rD.createElement("template"),rV="transition",rU="animation",rj=Symbol("_vtc"),rB={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},r$=x({},no,rB),rH=((t=(e,{slots:t})=>rN(nc,rz(e),t)).displayName="Transition",t.props=r$,t),rW=(e,t=[])=>{T(e)?e.forEach(e=>e(...t)):e&&e(...t)},rK=e=>!!e&&(T(e)?e.some(e=>e.length>1):e.length>1);function rz(e){let t={};for(let n in e)n in rB||(t[n]=e[n]);if(!1===e.css)return t;let{name:n="v",type:l,duration:r,enterFromClass:i=`${n}-enter-from`,enterActiveClass:s=`${n}-enter-active`,enterToClass:o=`${n}-enter-to`,appearFromClass:a=i,appearActiveClass:u=s,appearToClass:c=o,leaveFromClass:f=`${n}-leave-from`,leaveActiveClass:p=`${n}-leave-active`,leaveToClass:d=`${n}-leave-to`}=e,h=function(e){if(null==e)return null;{if(I(e))return[function(e){return Y(e)}(e.enter),function(e){return Y(e)}(e.leave)];let t=function(e){return Y(e)}(e);return[t,t]}}(r),g=h&&h[0],m=h&&h[1],{onBeforeEnter:_,onEnter:y,onEnterCancelled:b,onLeave:S,onLeaveCancelled:C,onBeforeAppear:w=_,onAppear:E=y,onAppearCancelled:k=b}=t,T=(e,t,n,l)=>{e._enterCancelled=l,rG(e,t?c:o),rG(e,t?u:s),n&&n()},A=(e,t)=>{e._isLeaving=!1,rG(e,f),rG(e,d),rG(e,p),t&&t()},R=e=>(t,n)=>{let r=e?E:y,s=()=>T(t,e,n);rW(r,[t,s]),rJ(()=>{rG(t,e?a:i),rq(t,e?c:o),rK(r)||rZ(t,l,g,s)})};return x(t,{onBeforeEnter(e){rW(_,[e]),rq(e,i),rq(e,s)},onBeforeAppear(e){rW(w,[e]),rq(e,a),rq(e,u)},onEnter:R(!1),onAppear:R(!0),onLeave(e,t){e._isLeaving=!0;let n=()=>A(e,t);rq(e,f),e._enterCancelled?(rq(e,p),r1()):(r1(),rq(e,p)),rJ(()=>{e._isLeaving&&(rG(e,f),rq(e,d),rK(S)||rZ(e,l,m,n))}),rW(S,[e,n])},onEnterCancelled(e){T(e,!1,void 0,!0),rW(b,[e])},onAppearCancelled(e){T(e,!0,void 0,!0),rW(k,[e])},onLeaveCancelled(e){A(e),rW(C,[e])}})}function rq(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.add(t)),(e[rj]||(e[rj]=new Set)).add(t)}function rG(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.remove(t));let n=e[rj];n&&(n.delete(t),n.size||(e[rj]=void 0))}function rJ(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let rX=0;function rZ(e,t,n,l){let r=e._endId=++rX,i=()=>{r===e._endId&&l()};if(null!=n)return setTimeout(i,n);let{type:s,timeout:o,propCount:a}=rY(e,t);if(!s)return l();let u=s+"end",c=0,f=()=>{e.removeEventListener(u,p),i()},p=t=>{t.target===e&&++c>=a&&f()};setTimeout(()=>{c(n[e]||"").split(", "),r=l(`${rV}Delay`),i=l(`${rV}Duration`),s=rQ(r,i),o=l(`${rU}Delay`),a=l(`${rU}Duration`),u=rQ(o,a),c=null,f=0,p=0;t===rV?s>0&&(c=rV,f=s,p=i.length):t===rU?u>0&&(c=rU,f=u,p=a.length):p=(c=(f=Math.max(s,u))>0?s>u?rV:rU:null)?c===rV?i.length:a.length:0;let d=c===rV&&/\b(transform|all)(,|$)/.test(l(`${rV}Property`).toString());return{type:c,timeout:f,propCount:p,hasTransform:d}}function rQ(e,t){for(;e.lengthr0(t)+r0(e[n])))}function r0(e){return"auto"===e?0:1e3*Number(e.slice(0,-1).replace(",","."))}function r1(){return document.body.offsetHeight}let r2=Symbol("_vod"),r6=Symbol("_vsh");function r8(e,t){e.style.display=t?e[r2]:"none",e[r6]=!t}let r4=Symbol("");function r3(e,t){if(1===e.nodeType){let n=e.style,l="";for(let e in t)n.setProperty(`--${e}`,t[e]),l+=`--${e}: ${t[e]};`;n[r4]=l}}let r5=/(^|;)\s*display\s*:/,r9=/\s*!important$/;function r7(e,t,n){if(T(n))n.forEach(n=>r7(e,t,n));else if(null==n&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{let l=function(e,t){let n=it[t];if(n)return n;let l=H(t);if("filter"!==l&&l in e)return it[t]=l;l=z(l);for(let n=0;n111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)>96&&123>e.charCodeAt(2),id={};function ih(e,t,n){let l=nm(e,t);V(l)&&x(l,t);class r extends ig{constructor(e){super(l,e,n)}}return r.def=l,r}let iv="undefined"!=typeof HTMLElement?HTMLElement:class{};class ig extends iv{constructor(e,t={},n=iz){super(),this._def=e,this._props=t,this._createApp=n,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._ob=null,this.shadowRoot&&n!==iz?this._root=this.shadowRoot:!1!==e.shadowRoot?(this.attachShadow({mode:"open"}),this._root=this.shadowRoot):this._root=this}connectedCallback(){if(!this.isConnected)return;this.shadowRoot||this._resolved||this._parseSlots(),this._connected=!0;let e=this;for(;e=e&&(e.parentNode||e.host);)if(e instanceof ig){this._parent=e;break}this._instance||(this._resolved?this._mount(this._def):e&&e._pendingResolve?this._pendingResolve=e._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(e=this._parent){e&&(this._instance.parent=e._instance,this._inheritParentContext(e))}_inheritParentContext(e=this._parent){e&&this._app&&Object.setPrototypeOf(this._app._context.provides,e._instance.provides)}disconnectedCallback(){this._connected=!1,tK(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null)})}_resolveDef(){if(this._pendingResolve)return;for(let e=0;e{for(let t of e)this._setAttr(t.attributeName)}),this._ob.observe(this,{attributes:!0});let e=(e,t=!1)=>{let n;this._resolved=!0,this._pendingResolve=void 0;let{props:l,styles:r}=e;if(l&&!T(l))for(let e in l){let t=l[e];(t===Number||t&&t.type===Number)&&(e in this._props&&(this._props[e]=Y(this._props[e])),(n||(n=Object.create(null)))[H(e)]=!0)}this._numberProps=n,this._resolveProps(e),this.shadowRoot&&this._applyStyles(r),this._mount(e)},t=this._def.__asyncLoader;t?this._pendingResolve=t().then(t=>{t.configureApp=this._def.configureApp,e(this._def=t,!0)}):e(this._def)}_mount(e){this._app=this._createApp(e),this._inheritParentContext(),e.configureApp&&e.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);let t=this._instance&&this._instance.exposed;if(t)for(let e in t)k(this,e)||Object.defineProperty(this,e,{get:()=>tC(t[e])})}_resolveProps(e){let{props:t}=e,n=T(t)?t:Object.keys(t||{});for(let e of Object.keys(this))"_"!==e[0]&&n.includes(e)&&this._setProp(e,this[e]);for(let e of n.map(H))Object.defineProperty(this,e,{get(){return this._getProp(e)},set(t){this._setProp(e,t,!0,!0)}})}_setAttr(e){if(e.startsWith("data-v-"))return;let t=this.hasAttribute(e),n=t?this.getAttribute(e):id,l=H(e);t&&this._numberProps&&this._numberProps[l]&&(n=Y(n)),this._setProp(l,n,!1,!0)}_getProp(e){return this._props[e]}_setProp(e,t,n=!0,l=!1){if(t!==this._props[e]&&(t===id?delete this._props[e]:(this._props[e]=t,"key"===e&&this._app&&(this._app._ceVNode.key=t)),l&&this._instance&&this._update(),n)){let n=this._ob;n&&n.disconnect(),!0===t?this.setAttribute(K(e),""):"string"==typeof t||"number"==typeof t?this.setAttribute(K(e),t+""):t||this.removeAttribute(K(e)),n&&n.observe(this,{attributes:!0})}}_update(){let e=this._createVNode();this._app&&(e.appContext=this._app._context),iK(e,this._root)}_createVNode(){let e={};this.shadowRoot||(e.onVnodeMounted=e.onVnodeUpdated=this._renderSlots.bind(this));let t=ro(this._def,x(e,this._props));return this._instance||(t.ce=e=>{this._instance=e,e.ce=this,e.isCE=!0;let t=(e,t)=>{this.dispatchEvent(new CustomEvent(e,V(t[0])?x({detail:t},t[0]):{detail:t}))};e.emit=(e,...n)=>{t(e,n),K(e)!==e&&t(K(e),n)},this._setParent()}),t}_applyStyles(e,t){if(!e)return;if(t){if(t===this._def||this._styleChildren.has(t))return;this._styleChildren.add(t)}let n=this._nonce;for(let t=e.length-1;t>=0;t--){let l=document.createElement("style");n&&l.setAttribute("nonce",n),l.textContent=e[t],this.shadowRoot.prepend(l)}}_parseSlots(){let e,t=this._slots={};for(;e=this.firstChild;){let n=1===e.nodeType&&e.getAttribute("slot")||"default";(t[n]||(t[n]=[])).push(e),this.removeChild(e)}}_renderSlots(){let e=(this._teleportTarget||this).querySelectorAll("slot"),t=this._instance.type.__scopeId;for(let n=0;n{if(!n.length)return;let t=e.moveClass||`${e.name||"v"}-move`;if(!function(e,t,n){let l=e.cloneNode(),r=e[rj];r&&r.forEach(e=>{e.split(/\s+/).forEach(e=>e&&l.classList.remove(e))}),n.split(/\s+/).forEach(e=>e&&l.classList.add(e)),l.style.display="none";let i=1===t.nodeType?t:t.parentNode;i.appendChild(l);let{hasTransform:s}=rY(l);return i.removeChild(l),s}(n[0].el,r.vnode.el,t)){n=[];return}n.forEach(ix),n.forEach(iw);let l=n.filter(iE);r1(),l.forEach(e=>{let n=e.el,l=n.style;rq(n,t),l.transform=l.webkitTransform=l.transitionDuration="";let r=n[ib]=e=>{(!e||e.target===n)&&(!e||/transform$/.test(e.propertyName))&&(n.removeEventListener("transitionend",r),n[ib]=null,rG(n,t))};n.addEventListener("transitionend",r)}),n=[]}),()=>{let s=td(e),o=rz(s),a=s.tag||l0;if(n=[],l)for(let e=0;e{let t=e.props["onUpdate:modelValue"]||!1;return T(t)?e=>J(t,e):t};function iT(e){e.target.composing=!0}function iA(e){let t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}let iR=Symbol("_assign"),iO={created(e,{modifiers:{lazy:t,trim:n,number:l}},r){e[iR]=ik(r);let i=l||r.props&&"number"===r.props.type;is(e,t?"change":"input",t=>{if(t.target.composing)return;let l=e.value;n&&(l=l.trim()),i&&(l=Z(l)),e[iR](l)}),n&&is(e,"change",()=>{e.value=e.value.trim()}),t||(is(e,"compositionstart",iT),is(e,"compositionend",iA),is(e,"change",iA))},mounted(e,{value:t}){e.value=null==t?"":t},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:l,trim:r,number:i}},s){if(e[iR]=ik(s),e.composing)return;let o=(i||"number"===e.type)&&!/^0\d/.test(e.value)?Z(e.value):e.value,a=null==t?"":t;if(o!==a){if(document.activeElement===e&&"range"!==e.type&&(l&&t===n||r&&e.value.trim()===a))return;e.value=a}}},iN={deep:!0,created(e,t,n){e[iR]=ik(n),is(e,"change",()=>{let t=e._modelValue,n=iD(e),l=e.checked,r=e[iR];if(T(t)){let e=ea(t,n),i=-1!==e;if(l&&!i)r(t.concat(n));else if(!l&&i){let n=[...t];n.splice(e,1),r(n)}}else if(R(t)){let e=new Set(t);l?e.add(n):e.delete(n),r(e)}else r(iF(e,l))})},mounted:iP,beforeUpdate(e,t,n){e[iR]=ik(n),iP(e,t,n)}};function iP(e,{value:t,oldValue:n},l){let r;if(e._modelValue=t,T(t))r=ea(t,l.props.value)>-1;else if(R(t))r=t.has(l.props.value);else{if(t===n)return;r=eo(t,iF(e,!0))}e.checked!==r&&(e.checked=r)}let iM={created(e,{value:t},n){e.checked=eo(t,n.props.value),e[iR]=ik(n),is(e,"change",()=>{e[iR](iD(e))})},beforeUpdate(e,{value:t,oldValue:n},l){e[iR]=ik(l),t!==n&&(e.checked=eo(t,l.props.value))}},iI={deep:!0,created(e,{value:t,modifiers:{number:n}},l){let r=R(t);is(e,"change",()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?Z(iD(e)):iD(e));e[iR](e.multiple?r?new Set(t):t:t[0]),e._assigning=!0,tK(()=>{e._assigning=!1})}),e[iR]=ik(l)},mounted(e,{value:t}){iL(e,t)},beforeUpdate(e,t,n){e[iR]=ik(n)},updated(e,{value:t}){e._assigning||iL(e,t)}};function iL(e,t){let n=e.multiple,l=T(t);if(!n||l||R(t)){for(let r=0,i=e.options.length;rString(e)===String(s)):i.selected=ea(t,s)>-1}else i.selected=t.has(s);else if(eo(iD(i),t)){e.selectedIndex!==r&&(e.selectedIndex=r);return}}n||-1===e.selectedIndex||(e.selectedIndex=-1)}}function iD(e){return"_value"in e?e._value:e.value}function iF(e,t){let n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}function iV(e,t,n,l,r){let i=function(e,t){switch(e){case"SELECT":return iI;case"TEXTAREA":return iO;default:switch(t){case"checkbox":return iN;case"radio":return iM;default:return iO}}}(e.tagName,n.props&&n.props.type)[r];i&&i(e,t,n,l)}let iU=["ctrl","shift","alt","meta"],ij={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&0!==e.button,middle:e=>"button"in e&&1!==e.button,right:e=>"button"in e&&2!==e.button,exact:(e,t)=>iU.some(n=>e[`${n}Key`]&&!t.includes(n))},iB={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},i$=x({patchProp:(e,t,n,l,r,i)=>{let s="svg"===r;if("class"===t){var o=l;let t=e[rj];t&&(o=(o?[o,...t]:[...t]).join(" ")),null==o?e.removeAttribute("class"):s?e.setAttribute("class",o):e.className=o}else"style"===t?function(e,t,n){let l=e.style,r=P(n),i=!1;if(n&&!r){if(t)if(P(t))for(let e of t.split(";")){let t=e.slice(0,e.indexOf(":")).trim();null==n[t]&&r7(l,t,"")}else for(let e in t)null==n[e]&&r7(l,e,"");for(let e in n)"display"===e&&(i=!0),r7(l,e,n[e])}else if(r){if(t!==n){let e=l[r4];e&&(n+=";"+e),l.cssText=n,i=r5.test(n)}}else t&&e.removeAttribute("style");r2 in e&&(e[r2]=i?l.display:"",e[r6]&&(l.display="none"))}(e,n,l):S(t)?C(t)||function(e,t,n,l,r=null){let i=e[io]||(e[io]={}),s=i[t];if(l&&s)s.value=l;else{let[n,o]=function(e){let t;if(ia.test(e)){let n;for(t={};n=e.match(ia);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[":"===e[2]?e.slice(3):K(e.slice(2)),t]}(t);if(l)is(e,n,i[t]=function(e,t){let n=e=>{if(e._vts){if(e._vts<=n.attached)return}else e._vts=Date.now();tD(function(e,t){if(!T(t))return t;{let n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(e=>t=>!t._stopped&&e&&e(t))}}(e,n.value),t,5,[e])};return n.value=e,n.attached=iu||(ic.then(()=>iu=0),iu=Date.now()),n}(l,r),o);else s&&(e.removeEventListener(n,s,o),i[t]=void 0)}}(e,t,0,l,i):("."===t[0]?(t=t.slice(1),0):"^"===t[0]?(t=t.slice(1),1):!function(e,t,n,l){if(l)return!!("innerHTML"===t||"textContent"===t||t in e&&ip(t)&&N(n));if("spellcheck"===t||"draggable"===t||"translate"===t||"autocorrect"===t||"form"===t||"list"===t&&"INPUT"===e.tagName||"type"===t&&"TEXTAREA"===e.tagName)return!1;if("width"===t||"height"===t){let t=e.tagName;if("IMG"===t||"VIDEO"===t||"CANVAS"===t||"SOURCE"===t)return!1}return!(ip(t)&&P(n))&&t in e}(e,t,l,s))?e._isVueCE&&(/[A-Z]/.test(t)||!P(l))?ii(e,H(t),l,i,t):("true-value"===t?e._trueValue=l:"false-value"===t&&(e._falseValue=l),ir(e,t,l,s)):(ii(e,t,l),e.tagName.includes("-")||"value"!==t&&"checked"!==t&&"selected"!==t||ir(e,t,l,s,i,"value"!==t))}},{insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,l)=>{let r="svg"===t?rD.createElementNS("http://www.w3.org/2000/svg",e):"mathml"===t?rD.createElementNS("http://www.w3.org/1998/Math/MathML",e):n?rD.createElement(e,{is:n}):rD.createElement(e);return"select"===e&&l&&null!=l.multiple&&r.setAttribute("multiple",l.multiple),r},createText:e=>rD.createTextNode(e),createComment:e=>rD.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>rD.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,l,r,i){let s=n?n.previousSibling:t.lastChild;if(r&&(r===i||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),r!==i&&(r=r.nextSibling););else{rF.innerHTML=rL("svg"===l?`${e}`:"mathml"===l?`${e}`:e);let r=rF.content;if("svg"===l||"mathml"===l){let e=r.firstChild;for(;e.firstChild;)r.appendChild(e.firstChild);r.removeChild(e)}t.insertBefore(r,n)}return[s?s.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}}),iH=!1;function iW(){return p=iH?p:lT(i$),iH=!0,p}let iK=(...e)=>{(p||(p=lA(i$))).render(...e)},iz=(...e)=>{let t=(p||(p=lA(i$))).createApp(...e),{mount:n}=t;return t.mount=e=>{let l=iJ(e);if(!l)return;let r=t._component;N(r)||r.render||r.template||(r.template=l.innerHTML),1===l.nodeType&&(l.textContent="");let i=n(l,!1,iG(l));return l instanceof Element&&(l.removeAttribute("v-cloak"),l.setAttribute("data-v-app","")),i},t},iq=(...e)=>{let t=iW().createApp(...e),{mount:n}=t;return t.mount=e=>{let t=iJ(e);if(t)return n(t,!0,iG(t))},t};function iG(e){return e instanceof SVGElement?"svg":"function"==typeof MathMLElement&&e instanceof MathMLElement?"mathml":void 0}function iJ(e){return P(e)?document.querySelector(e):e}return e.BaseTransition=nc,e.BaseTransitionPropsValidators=no,e.Comment=l2,e.DeprecationTypes=null,e.EffectScope=ed,e.ErrorCodes={SETUP_FUNCTION:0,0:"SETUP_FUNCTION",RENDER_FUNCTION:1,1:"RENDER_FUNCTION",NATIVE_EVENT_HANDLER:5,5:"NATIVE_EVENT_HANDLER",COMPONENT_EVENT_HANDLER:6,6:"COMPONENT_EVENT_HANDLER",VNODE_HOOK:7,7:"VNODE_HOOK",DIRECTIVE_HOOK:8,8:"DIRECTIVE_HOOK",TRANSITION_HOOK:9,9:"TRANSITION_HOOK",APP_ERROR_HANDLER:10,10:"APP_ERROR_HANDLER",APP_WARN_HANDLER:11,11:"APP_WARN_HANDLER",FUNCTION_REF:12,12:"FUNCTION_REF",ASYNC_COMPONENT_LOADER:13,13:"ASYNC_COMPONENT_LOADER",SCHEDULER:14,14:"SCHEDULER",COMPONENT_UPDATE:15,15:"COMPONENT_UPDATE",APP_UNMOUNT_CLEANUP:16,16:"APP_UNMOUNT_CLEANUP"},e.ErrorTypeStrings=null,e.Fragment=l0,e.KeepAlive={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){let n=ry(),l=n.ctx,r=new Map,i=new Set,s=null,o=n.suspense,{renderer:{p:a,m:u,um:c,o:{createElement:f}}}=l,p=f("div");function d(e){nF(e),c(e,n,o,!0)}function h(e){r.forEach((t,n)=>{let l=rR(t.type);l&&!e(l)&&g(n)})}function g(e){let t=r.get(e);!t||s&&rl(t,s)?s&&nF(s):d(t),r.delete(e),i.delete(e)}l.activate=(e,t,n,l,r)=>{let i=e.component;u(e,t,n,0,o),a(i.vnode,e,t,n,i,o,l,e.slotScopeIds,r),lk(()=>{i.isDeactivated=!1,i.a&&J(i.a);let t=e.props&&e.props.onVnodeMounted;t&&rv(t,i.parent,e)},o)},l.deactivate=e=>{let t=e.component;lM(t.m),lM(t.a),u(e,p,null,1,o),lk(()=>{t.da&&J(t.da);let n=e.props&&e.props.onVnodeUnmounted;n&&rv(n,t.parent,e),t.isDeactivated=!0},o)},lD(()=>[e.include,e.exclude],([e,t])=>{e&&h(t=>nM(e,t)),t&&h(e=>!nM(t,e))},{flush:"post",deep:!0});let m=null,_=()=>{null!=m&&(lq(n.subTree.type)?lk(()=>{r.set(m,nV(n.subTree))},n.subTree.suspense):r.set(m,nV(n.subTree)))};return n$(_),nW(_),nK(()=>{r.forEach(e=>{let{subTree:t,suspense:l}=n,r=nV(t);if(e.type===r.type&&e.key===r.key){nF(r);let e=r.component.da;e&&lk(e,l);return}d(e)})}),()=>{if(m=null,!t.default)return s=null;let n=t.default(),l=n[0];if(n.length>1)return s=null,n;if(!rn(l)||!(4&l.shapeFlag)&&!(128&l.shapeFlag))return s=null,l;let o=nV(l);if(o.type===l2)return s=null,o;let a=o.type,u=rR(nO(o)?o.type.__asyncResolved||{}:a),{include:c,exclude:f,max:p}=e;if(c&&(!u||!nM(c,u))||f&&u&&nM(f,u))return o.shapeFlag&=-257,s=o,l;let d=null==o.key?a:o.key,h=r.get(d);return o.el&&(o=ru(o),128&l.shapeFlag&&(l.ssContent=o)),m=d,h?(o.el=h.el,o.component=h.component,o.transition&&nv(o,o.transition),o.shapeFlag|=512,i.delete(d),i.add(d)):(i.add(d),p&&i.size>parseInt(p,10)&&g(i.values().next().value)),o.shapeFlag|=256,s=o,lq(l.type)?l:o}}},e.ReactiveEffect=ev,e.Static=l6,e.Suspense={name:"Suspense",__isSuspense:!0,process(e,t,n,l,r,i,s,o,a,u){if(null==e){var c=t,f=n,p=l,d=r,h=i,g=s,m=o,_=a,y=u;let{p:e,o:{createElement:b}}=y,S=b("div"),C=c.suspense=lX(c,h,d,f,S,p,g,m,_,y);e(null,C.pendingBranch=c.ssContent,S,null,d,C,g,m),C.deps>0?(lJ(c,"onPending"),lJ(c,"onFallback"),e(null,c.ssFallback,f,p,d,null,g,m),lQ(C,c.ssFallback)):C.resolve(!1,!0)}else{if(i&&i.deps>0&&!e.suspense.isInFallback){t.suspense=e.suspense,t.suspense.vnode=t,t.el=e.el;return}!function(e,t,n,l,r,i,s,o,{p:a,um:u,o:{createElement:c}}){let f=t.suspense=e.suspense;f.vnode=t,t.el=e.el;let p=t.ssContent,d=t.ssFallback,{activeBranch:h,pendingBranch:g,isInFallback:m,isHydrating:_}=f;if(g)f.pendingBranch=p,rl(p,g)?(a(g,p,f.hiddenContainer,null,r,f,i,s,o),f.deps<=0?f.resolve():m&&!_&&(a(h,d,n,l,r,null,i,s,o),lQ(f,d))):(f.pendingId=lG++,_?(f.isHydrating=!1,f.activeBranch=g):u(g,r,f),f.deps=0,f.effects.length=0,f.hiddenContainer=c("div"),m?(a(null,p,f.hiddenContainer,null,r,f,i,s,o),f.deps<=0?f.resolve():(a(h,d,n,l,r,null,i,s,o),lQ(f,d))):h&&rl(p,h)?(a(h,p,n,l,r,f,i,s,o),f.resolve(!0)):(a(null,p,f.hiddenContainer,null,r,f,i,s,o),f.deps<=0&&f.resolve()));else if(h&&rl(p,h))a(h,p,n,l,r,f,i,s,o),lQ(f,p);else if(lJ(t,"onPending"),f.pendingBranch=p,512&p.shapeFlag?f.pendingId=p.component.suspenseId:f.pendingId=lG++,a(null,p,f.hiddenContainer,null,r,f,i,s,o),f.deps<=0)f.resolve();else{let{timeout:e,pendingId:t}=f;e>0?setTimeout(()=>{f.pendingId===t&&f.fallback(d)},e):0===e&&f.fallback(d)}}(e,t,n,l,r,s,o,a,u)}},hydrate:function(e,t,n,l,r,i,s,o,a){let u=t.suspense=lX(t,l,n,e.parentNode,document.createElement("div"),null,r,i,s,o,!0),c=a(e,u.pendingBranch=t.ssContent,n,u,i,s);return 0===u.deps&&u.resolve(!1,!0),c},normalize:function(e){let{shapeFlag:t,children:n}=e,l=32&t;e.ssContent=lZ(l?n.default:n),e.ssFallback=l?lZ(n.fallback):ro(l2)}},e.Teleport=t7,e.Text=l1,e.TrackOpTypes={GET:"get",HAS:"has",ITERATE:"iterate"},e.Transition=rH,e.TransitionGroup=iC,e.TriggerOpTypes={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},e.VueElement=ig,e.assertNumber=function(e,t){},e.callWithAsyncErrorHandling=tD,e.callWithErrorHandling=tL,e.camelize=H,e.capitalize=z,e.cloneVNode=ru,e.compatUtils=null,e.compile=()=>{},e.computed=rO,e.createApp=iz,e.createBlock=rt,e.createCommentVNode=function(e="",t=!1){return t?(l3(),rt(l2,null,e)):ro(l2,null,e)},e.createElementBlock=function(e,t,n,l,r,i){return re(rs(e,t,n,l,r,i,!0))},e.createElementVNode=rs,e.createHydrationRenderer=lT,e.createPropsRestProxy=function(e,t){let n={};for(let l in e)t.includes(l)||Object.defineProperty(n,l,{enumerable:!0,get:()=>e[l]});return n},e.createRenderer=function(e){return lA(e)},e.createSSRApp=iq,e.createSlots=function(e,t){for(let n=0;n{let t=l.fn(...e);return t&&(t.key=l.key),t}:l.fn)}return e},e.createStaticVNode=function(e,t){let n=ro(l6,null,e);return n.staticCount=t,n},e.createTextVNode=rc,e.createVNode=ro,e.customRef=tk,e.defineAsyncComponent=function(e){let t;N(e)&&(e={loader:e});let{loader:n,loadingComponent:l,errorComponent:r,delay:i=200,hydrate:s,timeout:o,suspensible:a=!0,onError:u}=e,c=null,f=0,p=()=>{let e;return c||(e=c=n().catch(e=>{if(e=e instanceof Error?e:Error(String(e)),u)return new Promise((t,n)=>{u(e,()=>t((f++,c=null,p())),()=>n(e),f+1)});throw e}).then(n=>e!==c&&c?c:(n&&(n.__esModule||"Module"===n[Symbol.toStringTag])&&(n=n.default),t=n,n)))};return nm({name:"AsyncComponentWrapper",__asyncLoader:p,__asyncHydrate(e,n,l){let r=s?()=>{let t=s(()=>{l()},t=>(function(e,t){if(nx(e)&&"["===e.data){let n=1,l=e.nextSibling;for(;l;){if(1===l.nodeType){if(!1===t(l))break}else if(nx(l))if("]"===l.data){if(0==--n)break}else"["===l.data&&n++;l=l.nextSibling}}else t(e)})(e,t));t&&(n.bum||(n.bum=[])).push(t),(n.u||(n.u=[])).push(()=>!0)}:l;t?r():p().then(()=>!n.isUnmounted&&r())},get __asyncResolved(){return t},setup(){let e=r_;if(n_(e),t)return()=>nN(t,e);let n=t=>{c=null,tF(t,e,13,!r)};if(a&&e.suspense)return p().then(t=>()=>nN(t,e)).catch(e=>(n(e),()=>r?ro(r,{error:e}):null));let s=t_(!1),u=t_(),f=t_(!!i);return i&&setTimeout(()=>{f.value=!1},i),null!=o&&setTimeout(()=>{if(!s.value&&!u.value){let e=Error(`Async component timed out after ${o}ms.`);n(e),u.value=e}},o),p().then(()=>{s.value=!0,e.parent&&nP(e.parent.vnode)&&e.parent.update()}).catch(e=>{n(e),u.value=e}),()=>s.value&&t?nN(t,e):u.value&&r?ro(r,{error:u.value}):l&&!f.value?ro(l):void 0}})},e.defineComponent=nm,e.defineCustomElement=ih,e.defineEmits=function(){return null},e.defineExpose=function(e){},e.defineModel=function(){},e.defineOptions=function(e){},e.defineProps=function(){return null},e.defineSSRCustomElement=(e,t)=>ih(e,t,iq),e.defineSlots=function(){return null},e.devtools=void 0,e.effect=function(e,t){e.effect instanceof ev&&(e=e.effect.fn);let n=new ev(e);t&&x(n,t);try{n.run()}catch(e){throw n.stop(),e}let l=n.run.bind(n);return l.effect=n,l},e.effectScope=function(e){return new ed(e)},e.getCurrentInstance=ry,e.getCurrentScope=function(){return r},e.getCurrentWatcher=function(){return d},e.getTransitionRawChildren=ng,e.guardReactiveProps=ra,e.h=rN,e.handleError=tF,e.hasInjectionContext=function(){return!!(r_||tY||lc)},e.hydrate=(...e)=>{iW().hydrate(...e)},e.hydrateOnIdle=(e=1e4)=>t=>{let n=nA(t,{timeout:e});return()=>nR(n)},e.hydrateOnInteraction=(e=[])=>(t,n)=>{P(e)&&(e=[e]);let l=!1,r=e=>{l||(l=!0,i(),t(),e.target.dispatchEvent(new e.constructor(e.type,e)))},i=()=>{n(t=>{for(let n of e)t.removeEventListener(n,r)})};return n(t=>{for(let n of e)t.addEventListener(n,r,{once:!0})}),i},e.hydrateOnMediaQuery=e=>t=>{if(e){let n=matchMedia(e);if(!n.matches)return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t);t()}},e.hydrateOnVisible=e=>(t,n)=>{let l=new IntersectionObserver(e=>{for(let n of e)if(n.isIntersecting){l.disconnect(),t();break}},e);return n(e=>{if(e instanceof Element){if(function(e){let{top:t,left:n,bottom:l,right:r}=e.getBoundingClientRect(),{innerHeight:i,innerWidth:s}=window;return(t>0&&t0&&l0&&n0&&rl.disconnect()},e.initCustomFormatter=function(){},e.initDirectivesForSSR=y,e.inject=lp,e.isMemoSame=rP,e.isProxy=tp,e.isReactive=tu,e.isReadonly=tc,e.isRef=tm,e.isRuntimeOnly=()=>!c,e.isShallow=tf,e.isVNode=rn,e.markRaw=th,e.mergeDefaults=function(e,t){let n=n5(e);for(let e in t){if(e.startsWith("__skip"))continue;let l=n[e];l?T(l)||N(l)?l=n[e]={type:l,default:t[e]}:l.default=t[e]:null===l&&(l=n[e]={default:t[e]}),l&&t[`__skip_${e}`]&&(l.skipFactory=!0)}return n},e.mergeModels=function(e,t){return e&&t?T(e)&&T(t)?e.concat(t):x({},n5(e),n5(t)):e||t},e.mergeProps=rh,e.nextTick=tK,e.normalizeClass=ei,e.normalizeProps=function(e){if(!e)return null;let{class:t,style:n}=e;return t&&!P(t)&&(e.class=ei(t)),n&&(e.style=et(n)),e},e.normalizeStyle=et,e.onActivated=nI,e.onBeforeMount=nB,e.onBeforeUnmount=nK,e.onBeforeUpdate=nH,e.onDeactivated=nL,e.onErrorCaptured=nX,e.onMounted=n$,e.onRenderTracked=nJ,e.onRenderTriggered=nG,e.onScopeDispose=function(e,t=!1){r&&r.cleanups.push(e)},e.onServerPrefetch=nq,e.onUnmounted=nz,e.onUpdated=nW,e.onWatcherCleanup=tM,e.openBlock=l3,e.popScopeId=function(){tQ=null},e.provide=lf,e.proxyRefs=tw,e.pushScopeId=function(e){tQ=e},e.queuePostFlushCb=tG,e.reactive=ti,e.readonly=to,e.ref=t_,e.registerRuntimeCompiler=function(e){c=e,f=e=>{e.render._rc&&(e.withProxy=new Proxy(e.ctx,n4))}},e.render=iK,e.renderList=function(e,t,n,l){let r,i=n&&n[l],s=T(e);if(s||P(e)){let n=s&&tu(e),l=!1,o=!1;n&&(l=!tf(e),o=tc(e),e=eU(e)),r=Array(e.length);for(let n=0,s=e.length;nt(e,n,void 0,i&&i[n]));else{let n=Object.keys(e);r=Array(n.length);for(let l=0,s=n.length;l!rn(t)||t.type!==l2&&(t.type!==l0||!!e(t.children)))?t:null}(i(n)),o=n.key||s&&s.key,a=rt(l0,{key:(o&&!M(o)?o:`_${t}`)+(!s&&l?"_fb":"")},s||(l?l():[]),s&&1===e._?64:-2);return!r&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),i&&i._c&&(i._d=!0),a},e.resolveComponent=function(e,t){return nQ(nZ,e,!0,t)||e},e.resolveDirective=function(e){return nQ("directives",e)},e.resolveDynamicComponent=function(e){return P(e)?nQ(nZ,e,!1)||e:e||nY},e.resolveFilter=null,e.resolveTransitionHooks=np,e.setBlockTracking=l7,e.setDevtoolsHook=y,e.setTransitionHooks=nv,e.shallowReactive=ts,e.shallowReadonly=function(e){return ta(e,!0,e2,te,tr)},e.shallowRef=ty,e.ssrContextKey=lI,e.ssrUtils=null,e.stop=function(e){e.effect.stop()},e.toDisplayString=ec,e.toHandlerKey=q,e.toHandlers=function(e,t){let n={};for(let l in e)n[t&&/[A-Z]/.test(l)?`on:${l}`:q(l)]=e[l];return n},e.toRaw=td,e.toRef=function(e,t,n){return tm(e)?e:N(e)?new tA(e):I(e)&&arguments.length>1?tR(e,t,n):t_(e)},e.toRefs=function(e){let t=T(e)?Array(e.length):{};for(let n in e)t[n]=tR(e,n);return t},e.toValue=function(e){return N(e)?e():tC(e)},e.transformVNodeArgs=function(e){},e.triggerRef=function(e){e.dep&&e.dep.trigger()},e.unref=tC,e.useAttrs=function(){return n3().attrs},e.useCssModule=function(e="$style"){return m},e.useCssVars=function(e){let t=ry();if(!t)return;let n=t.ut=(n=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(e=>r3(e,n))},l=()=>{let l=e(t.proxy);t.ce?r3(t.ce,l):function e(t,n){if(128&t.shapeFlag){let l=t.suspense;t=l.activeBranch,l.pendingBranch&&!l.isHydrating&&l.effects.push(()=>{e(l.activeBranch,n)})}for(;t.component;)t=t.component.subTree;if(1&t.shapeFlag&&t.el)r3(t.el,n);else if(t.type===l0)t.children.forEach(t=>e(t,n));else if(t.type===l6){let{el:e,anchor:l}=t;for(;e&&(r3(e,n),e!==l);)e=e.nextSibling}}(t.subTree,l),n(l)};nH(()=>{tG(l)}),n$(()=>{lD(l,y,{flush:"post"});let e=new MutationObserver(l);e.observe(t.subTree.el.parentNode,{childList:!0}),nz(()=>e.disconnect())})},e.useHost=im,e.useId=function(){let e=ry();return e?(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++:""},e.useModel=function(e,t,n=m){let l=ry(),r=H(t),i=K(t),s=lU(e,r),o=tk((s,o)=>{let a,u,c=m;return lL(()=>{let t=e[r];G(a,t)&&(a=t,o())}),{get:()=>(s(),n.get?n.get(a):a),set(e){let s=n.set?n.set(e):e;if(!G(s,a)&&!(c!==m&&G(e,c)))return;let f=l.vnode.props;f&&(t in f||r in f||i in f)&&(`onUpdate:${t}`in f||`onUpdate:${r}`in f||`onUpdate:${i}`in f)||(a=e,o()),l.emit(`update:${t}`,s),G(e,s)&&G(e,c)&&!G(s,u)&&o(),c=e,u=s}}});return o[Symbol.iterator]=()=>{let e=0;return{next:()=>e<2?{value:e++?s||m:o,done:!1}:{done:!0}}},o},e.useSSRContext=()=>{},e.useShadowRoot=function(){let e=im();return e&&e.shadowRoot},e.useSlots=function(){return n3().slots},e.useTemplateRef=function(e){let t=ry(),n=ty(null);return t&&Object.defineProperty(t.refs===m?t.refs={}:t.refs,e,{enumerable:!0,get:()=>n.value,set:e=>n.value=e}),n},e.useTransitionState=ni,e.vModelCheckbox=iN,e.vModelDynamic={created(e,t,n){iV(e,t,n,null,"created")},mounted(e,t,n){iV(e,t,n,null,"mounted")},beforeUpdate(e,t,n,l){iV(e,t,n,l,"beforeUpdate")},updated(e,t,n,l){iV(e,t,n,l,"updated")}},e.vModelRadio=iM,e.vModelSelect=iI,e.vModelText=iO,e.vShow={beforeMount(e,{value:t},{transition:n}){e[r2]="none"===e.style.display?"":e.style.display,n&&t?n.beforeEnter(e):r8(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:l}){!t!=!n&&(l?t?(l.beforeEnter(e),r8(e,!0),l.enter(e)):l.leave(e,()=>{r8(e,!1)}):r8(e,t))},beforeUnmount(e,{value:t}){r8(e,t)}},e.version=rM,e.warn=y,e.watch=function(e,t,n){return lD(e,t,n)},e.watchEffect=function(e,t){return lD(e,null,t)},e.watchPostEffect=function(e,t){return lD(e,null,{flush:"post"})},e.watchSyncEffect=lL,e.withAsyncContext=function(e){let t=ry(),n=e();return rS(),L(n)&&(n=n.catch(e=>{throw rb(t),e})),[n,()=>rb(t)]},e.withCtx=t1,e.withDefaults=function(e,t){return null},e.withDirectives=function(e,t){if(null===tY)return e;let n=rA(tY),l=e.dirs||(e.dirs=[]);for(let e=0;e{let n=e._withKeys||(e._withKeys={}),l=t.join(".");return n[l]||(n[l]=n=>{if(!("key"in n))return;let l=K(n.key);if(t.some(e=>e===l||iB[e]===l))return e(n)})},e.withMemo=function(e,t,n,l){let r=n[l];if(r&&rP(r,e))return r;let i=t();return i.memo=e.slice(),i.cacheIndex=l,n[l]=i},e.withModifiers=(e,t)=>{let n=e._withMods||(e._withMods={}),l=t.join(".");return n[l]||(n[l]=(n,...l)=>{for(let e=0;et1,e}({}); diff --git a/node_modules/vue/jsx-runtime/index.d.ts b/node_modules/vue/jsx-runtime/index.d.ts index a52ac66..af5ffe2 100644 --- a/node_modules/vue/jsx-runtime/index.d.ts +++ b/node_modules/vue/jsx-runtime/index.d.ts @@ -6,7 +6,7 @@ import type { NativeElements, ReservedProps, VNode } from '@vue/runtime-dom' * when ts compilerOptions.jsx is 'react-jsx' or 'react-jsxdev' * https://www.typescriptlang.org/tsconfig#jsxImportSource */ -export { h as jsx, h as jsxDEV, Fragment } from '@vue/runtime-dom' +export { h as jsx, h as jsxDEV, Fragment, h as jsxs } from '@vue/runtime-dom' export namespace JSX { export interface Element extends VNode {} diff --git a/node_modules/vue/package.json b/node_modules/vue/package.json index 8ccab75..a4d45ca 100644 --- a/node_modules/vue/package.json +++ b/node_modules/vue/package.json @@ -1,6 +1,6 @@ { "name": "vue", - "version": "3.5.13", + "version": "3.5.17", "description": "The progressive JavaScript framework for building modern web UI.", "main": "index.js", "module": "dist/vue.runtime.esm-bundler.js", @@ -95,11 +95,11 @@ }, "homepage": "https://github.com/vuejs/core/tree/main/packages/vue#readme", "dependencies": { - "@vue/shared": "3.5.13", - "@vue/compiler-dom": "3.5.13", - "@vue/runtime-dom": "3.5.13", - "@vue/server-renderer": "3.5.13", - "@vue/compiler-sfc": "3.5.13" + "@vue/shared": "3.5.17", + "@vue/runtime-dom": "3.5.17", + "@vue/compiler-dom": "3.5.17", + "@vue/compiler-sfc": "3.5.17", + "@vue/server-renderer": "3.5.17" }, "peerDependencies": { "typescript": "*" diff --git a/node_modules/websocket-stream/index.d.ts b/node_modules/websocket-stream/index.d.ts deleted file mode 100644 index 691351b..0000000 --- a/node_modules/websocket-stream/index.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -// Type definitions for websocket-stream 5.3 -// Project: https://github.com/maxogden/websocket-stream#readme -// Original definitions by: Ben Burns - -import * as WebSocket from 'ws'; -import { Duplex } from 'stream'; -import * as http from 'http'; - -declare namespace WebSocketStream { - type WebSocketDuplex = Duplex & { socket: WebSocket }; - - class Server extends WebSocket.Server { - on(event: 'connection', cb: (this: WebSocket, socket: WebSocket, request: http.IncomingMessage) => void): this; - on(event: 'error', cb: (this: WebSocket, error: Error) => void): this; - on(event: 'headers', cb: (this: WebSocket, headers: string[], request: http.IncomingMessage) => void): this; - on(event: 'listening', cb: (this: WebSocket) => void): this; - on(event: 'stream', cb: (this: WebSocket, stream: WebSocketDuplex, request: http.IncomingMessage) => void): this; - on(event: string | symbol, listener: (this: WebSocket, ...args: any[]) => void): this; - } - - function createServer(opts?: WebSocket.ServerOptions, callback?: () => void): Server; -} - -declare function WebSocketStream(target: string | WebSocket, options?: WebSocket.ClientOptions): WebSocketStream.WebSocketDuplex; -declare function WebSocketStream(target: string | WebSocket, protocols?: string | string[], options?: WebSocket.ClientOptions): WebSocketStream.WebSocketDuplex; - -export = WebSocketStream; diff --git a/node_modules/websocket-stream/package.json b/node_modules/websocket-stream/package.json index 2c37fdf..9e03afe 100644 --- a/node_modules/websocket-stream/package.json +++ b/node_modules/websocket-stream/package.json @@ -1,6 +1,6 @@ { "name": "websocket-stream", - "version": "5.5.2", + "version": "5.2.0", "license": "BSD-2-Clause", "description": "Use websockets with the node streams API. Works in browser and node", "scripts": { @@ -23,21 +23,18 @@ "email": "max@maxogden.com" }, "dependencies": { - "duplexify": "^3.5.1", + "duplexify": "^3.6.1", "inherits": "^2.0.1", - "readable-stream": "^2.3.3", + "readable-stream": "^3.0.0", "safe-buffer": "^5.1.2", - "ws": "^3.2.0", + "ws": "^6.1.2", "xtend": "^4.0.0" }, "devDependencies": { - "@types/node": "^11.13.4", - "@types/ws": "^6.0.1", - "beefy": "^2.1.8", + "beefy": "^2.1.1", "browserify": "^16.2.3", "concat-stream": "^1.6.2", - "tape": "^4.9.1", - "typescript": "^3.4.3" + "tape": "^4.9.1" }, "optionalDependencies": {}, "browser": { diff --git a/node_modules/websocket-stream/stream.js b/node_modules/websocket-stream/stream.js index b066dce..9328589 100644 --- a/node_modules/websocket-stream/stream.js +++ b/node_modules/websocket-stream/stream.js @@ -68,40 +68,24 @@ function WebSocketStream(target, protocols, options) { socket.binaryType = 'arraybuffer' } - - // according to https://github.com/baygeldin/ws-streamify/issues/1 - // Nodejs WebSocketServer cause memory leak - // Handlers like onerror, onclose, onmessage and onopen are accessible via setter/getter - // And setter first of all fires removeAllListeners, that doesnt make inner array of clients on WebSocketServer cleared ever - var eventListenerSupport = ('undefined' === typeof socket.addEventListener) // was already open when passed in if (socket.readyState === socket.OPEN) { stream = proxy + } else if (isBrowser) { + stream = proxy + stream.cork() + socket.onopen = onopenBrowser } else { - stream = stream = duplexify(undefined, undefined, options) - if (!options.objectMode) { - stream._writev = writev - } - - if (eventListenerSupport) { - socket.addEventListener('open', onopen) - } else { - socket.onopen = onopen - } + stream = duplexify.obj() + socket.onopen = onopen } stream.socket = socket - if (eventListenerSupport) { - socket.addEventListener('close', onclose) - socket.addEventListener('error', onerror) - socket.addEventListener('message', onmessage) - } else { - socket.onclose = onclose - socket.onerror = onerror - socket.onmessage = onmessage - } + socket.onclose = onclose + socket.onerror = onerror + socket.onmessage = onmessage proxy.on('close', destroy) @@ -151,6 +135,11 @@ function WebSocketStream(target, protocols, options) { stream.emit('connect') } + function onopenBrowser () { + stream.uncork() + stream.emit('connect') + } + function onclose() { stream.end() stream.destroy() diff --git a/node_modules/websocket-stream/test.js b/node_modules/websocket-stream/test.js index adc2219..d4a891b 100644 --- a/node_modules/websocket-stream/test.js +++ b/node_modules/websocket-stream/test.js @@ -5,7 +5,6 @@ var WebSocketServer = require('ws').Server var http = require('http') var concat = require('concat-stream') var Buffer = require('safe-buffer').Buffer -var ts = require('typescript') test('echo server', function(t) { @@ -306,33 +305,3 @@ test('stop echo', function(t) { t.end() }) }) - -test('typescript compilation', function(t) { - function compile(fileNames, options) { - const program = ts.createProgram(fileNames, options) - const emitResult = program.emit() - - const allDiagnostics = ts.getPreEmitDiagnostics(program).concat(emitResult.diagnostics) - - return allDiagnostics.map(diagnostic => { - if (diagnostic.file) { - let { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start) - let message = ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n") - return `${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}` - } else { - return `${ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n")}` - } - }); - } - - const messages = compile(['./ts-tests.ts'], { - noEmit: true, - noImplicitAny: true, - target: ts.ScriptTarget.ES5, - module: ts.ModuleKind.CommonJS - }) - - t.equal(messages.length, 0, 'no errors emitted') - t.end() -}) - diff --git a/node_modules/websocket-stream/ts-tests.ts b/node_modules/websocket-stream/ts-tests.ts deleted file mode 100644 index d7f41a0..0000000 --- a/node_modules/websocket-stream/ts-tests.ts +++ /dev/null @@ -1,69 +0,0 @@ -import * as WebSocket from 'ws'; -import * as WebSocketStream from './'; - -{ - let ws = new WebSocket('ws://www.host.com/path'); - const stream = WebSocketStream(ws); - ws = stream.socket; - - stream.setEncoding("utf8"); - stream.write("hello world"); - - const message = stream.read(10); - const message2 = stream.read(); -} - -{ - const stream = WebSocketStream('ws://www.host.com/path'); -} - -{ - // stream - url target with subprotocol - const stream = WebSocketStream('ws://www.host.com/path', 'appProtocol-v1'); -} - -{ - // stream - url target with subprotocols, no options - const stream = WebSocketStream('ws://www.host.com/path', ['appProtocol-v1', 'appProtocol-v2']); -} - -{ - // stream - url target with options, no subprotocols - const stream = WebSocketStream('ws://www.host.com/path', { maxPayload: 1024 }); -} - -{ - // stream - url target with subprotocol and options - const stream = WebSocketStream( - 'ws://www.host.com/path', - ['appProtocol-v1', 'appProtocol-v2'], - { maxPayload: 1024 }, - ); -} - -{ - // stream - url target with subprotocols and options - const stream = WebSocketStream( - 'ws://www.host.com/path', - ['appProtocol-v1', 'appProtocol-v2'], - { maxPayload: 1024 }, - ); -} - -{ - // dot server - const wss = new WebSocketStream.Server({port: 8081}); - wss.on('stream', (stream, req) => { - stream.write(stream.read()); - stream.end(); - }); -} - -{ - // dot createServer - const wss = WebSocketStream.createServer({port: 8081}); - wss.on('stream', (stream, req) => { - stream.write(stream.read()); - stream.end(); // closes underlying socket - }); -} diff --git a/node_modules/ws/README.md b/node_modules/ws/README.md index e2cc3bd..2b5c611 100644 --- a/node_modules/ws/README.md +++ b/node_modules/ws/README.md @@ -1,12 +1,12 @@ # ws: a Node.js WebSocket library -[![Version npm](https://img.shields.io/npm/v/ws.svg)](https://www.npmjs.com/package/ws) -[![Linux Build](https://img.shields.io/travis/websockets/ws/master.svg)](https://travis-ci.org/websockets/ws) -[![Windows Build](https://ci.appveyor.com/api/projects/status/github/websockets/ws?branch=master&svg=true)](https://ci.appveyor.com/project/lpinca/ws) -[![Coverage Status](https://img.shields.io/coveralls/websockets/ws/master.svg)](https://coveralls.io/r/websockets/ws?branch=master) +[![Version npm](https://img.shields.io/npm/v/ws.svg?logo=npm)](https://www.npmjs.com/package/ws) +[![Linux Build](https://img.shields.io/travis/websockets/ws/master.svg?logo=travis)](https://travis-ci.org/websockets/ws) +[![Windows Build](https://img.shields.io/appveyor/ci/lpinca/ws/master.svg?logo=appveyor)](https://ci.appveyor.com/project/lpinca/ws) +[![Coverage Status](https://img.shields.io/coveralls/websockets/ws/master.svg)](https://coveralls.io/github/websockets/ws) -ws is a simple to use, blazing fast, and thoroughly tested WebSocket client -and server implementation. +ws is a simple to use, blazing fast, and thoroughly tested WebSocket client and +server implementation. Passes the quite extensive Autobahn test suite: [server][server-report], [client][client-report]. @@ -14,40 +14,45 @@ Passes the quite extensive Autobahn test suite: [server][server-report], **Note**: This module does not work in the browser. The client in the docs is a reference to a back end with the role of a client in the WebSocket communication. Browser clients must use the native -[`WebSocket`](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) object. +[`WebSocket`](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) +object. To make the same code work seamlessly on Node.js and the browser, you +can use one of the many wrappers available on npm, like +[isomorphic-ws](https://github.com/heineiuo/isomorphic-ws). ## Table of Contents -* [Protocol support](#protocol-support) -* [Installing](#installing) - + [Opt-in for performance and spec compliance](#opt-in-for-performance-and-spec-compliance) -* [API docs](#api-docs) -* [WebSocket compression](#websocket-compression) -* [Usage examples](#usage-examples) - + [Sending and receiving text data](#sending-and-receiving-text-data) - + [Sending binary data](#sending-binary-data) - + [Server example](#server-example) - + [Broadcast example](#broadcast-example) - + [ExpressJS example](#expressjs-example) - + [echo.websocket.org demo](#echowebsocketorg-demo) - + [Other examples](#other-examples) -* [Error handling best practices](#error-handling-best-practices) -* [FAQ](#faq) - + [How to get the IP address of the client?](#how-to-get-the-ip-address-of-the-client) - + [How to detect and close broken connections?](#how-to-detect-and-close-broken-connections) - + [How to connect via a proxy?](#how-to-connect-via-a-proxy) -* [Changelog](#changelog) -* [License](#license) +- [Protocol support](#protocol-support) +- [Installing](#installing) + - [Opt-in for performance and spec compliance](#opt-in-for-performance-and-spec-compliance) +- [API docs](#api-docs) +- [WebSocket compression](#websocket-compression) +- [Usage examples](#usage-examples) + - [Sending and receiving text data](#sending-and-receiving-text-data) + - [Sending binary data](#sending-binary-data) + - [Simple server](#simple-server) + - [External HTTP/S server](#external-https-server) + - [Multiple servers sharing a single HTTP/S server](#multiple-servers-sharing-a-single-https-server) + - [Server broadcast](#server-broadcast) + - [echo.websocket.org demo](#echowebsocketorg-demo) + - [Other examples](#other-examples) +- [Error handling best practices](#error-handling-best-practices) +- [FAQ](#faq) + - [How to get the IP address of the client?](#how-to-get-the-ip-address-of-the-client) + - [How to detect and close broken connections?](#how-to-detect-and-close-broken-connections) + - [How to connect via a proxy?](#how-to-connect-via-a-proxy) +- [Changelog](#changelog) +- [License](#license) ## Protocol support -* **HyBi drafts 07-12** (Use the option `protocolVersion: 8`) -* **HyBi drafts 13-17** (Current default, alternatively option `protocolVersion: 13`) +- **HyBi drafts 07-12** (Use the option `protocolVersion: 8`) +- **HyBi drafts 13-17** (Current default, alternatively option + `protocolVersion: 13`) ## Installing ``` -npm install --save ws +npm install ws ``` ### Opt-in for performance and spec compliance @@ -60,8 +65,8 @@ necessarily need to have a C++ compiler installed on your machine. - `npm install --save-optional bufferutil`: Allows to efficiently perform operations such as masking and unmasking the data payload of the WebSocket frames. -- `npm install --save-optional utf-8-validate`: Allows to efficiently check - if a message contains valid UTF-8 as required by the spec. +- `npm install --save-optional utf-8-validate`: Allows to efficiently check if a + message contains valid UTF-8 as required by the spec. ## API docs @@ -69,15 +74,54 @@ See [`/doc/ws.md`](./doc/ws.md) for Node.js-like docs for the ws classes. ## WebSocket compression -ws supports the [permessage-deflate extension][permessage-deflate] which -enables the client and server to negotiate a compression algorithm and its -parameters, and then selectively apply it to the data payloads of each -WebSocket message. +ws supports the [permessage-deflate extension][permessage-deflate] which enables +the client and server to negotiate a compression algorithm and its parameters, +and then selectively apply it to the data payloads of each WebSocket message. -The extension is disabled by default on the server and enabled by default on -the client. It adds a significant overhead in terms of performance and memory +The extension is disabled by default on the server and enabled by default on the +client. It adds a significant overhead in terms of performance and memory consumption so we suggest to enable it only if it is really needed. +Note that Node.js has a variety of issues with high-performance compression, +where increased concurrency, especially on Linux, can lead to [catastrophic +memory fragmentation][node-zlib-bug] and slow performance. If you intend to use +permessage-deflate in production, it is worthwhile to set up a test +representative of your workload and ensure Node.js/zlib will handle it with +acceptable performance and memory usage. + +Tuning of permessage-deflate can be done via the options defined below. You can +also use `zlibDeflateOptions` and `zlibInflateOptions`, which is passed directly +into the creation of [raw deflate/inflate streams][node-zlib-deflaterawdocs]. + +See [the docs][ws-server-options] for more options. + +```js +const WebSocket = require('ws'); + +const wss = new WebSocket.Server({ + port: 8080, + perMessageDeflate: { + zlibDeflateOptions: { + // See zlib defaults. + chunkSize: 1024, + memLevel: 7, + level: 3 + }, + zlibInflateOptions: { + chunkSize: 10 * 1024 + }, + // Other options settable: + clientNoContextTakeover: true, // Defaults to negotiated value. + serverNoContextTakeover: true, // Defaults to negotiated value. + serverMaxWindowBits: 10, // Defaults to negotiated value. + // Below options specified as default values. + concurrencyLimit: 10, // Limits zlib concurrency for perf. + threshold: 1024 // Size (in bytes) below which messages + // should not be compressed. + } +}); +``` + The client will only use the extension if it is supported and enabled on the server. To always disable the extension on the client set the `perMessageDeflate` option to `false`. @@ -126,7 +170,7 @@ ws.on('open', function open() { }); ``` -### Server example +### Simple server ```js const WebSocket = require('ws'); @@ -142,7 +186,68 @@ wss.on('connection', function connection(ws) { }); ``` -### Broadcast example +### External HTTP/S server + +```js +const fs = require('fs'); +const https = require('https'); +const WebSocket = require('ws'); + +const server = new https.createServer({ + cert: fs.readFileSync('/path/to/cert.pem'), + key: fs.readFileSync('/path/to/key.pem') +}); +const wss = new WebSocket.Server({ server }); + +wss.on('connection', function connection(ws) { + ws.on('message', function incoming(message) { + console.log('received: %s', message); + }); + + ws.send('something'); +}); + +server.listen(8080); +``` + +### Multiple servers sharing a single HTTP/S server + +```js +const http = require('http'); +const WebSocket = require('ws'); + +const server = http.createServer(); +const wss1 = new WebSocket.Server({ noServer: true }); +const wss2 = new WebSocket.Server({ noServer: true }); + +wss1.on('connection', function connection(ws) { + // ... +}); + +wss2.on('connection', function connection(ws) { + // ... +}); + +server.on('upgrade', function upgrade(request, socket, head) { + const pathname = url.parse(request.url).pathname; + + if (pathname === '/foo') { + wss1.handleUpgrade(request, socket, head, function done(ws) { + wss1.emit('connection', ws, request); + }); + } else if (pathname === '/bar') { + wss2.handleUpgrade(request, socket, head, function done(ws) { + wss2.emit('connection', ws, request); + }); + } else { + socket.destroy(); + } +}); + +server.listen(8080); +``` + +### Server broadcast ```js const WebSocket = require('ws'); @@ -170,40 +275,6 @@ wss.on('connection', function connection(ws) { }); ``` -### ExpressJS example - -```js -const express = require('express'); -const http = require('http'); -const url = require('url'); -const WebSocket = require('ws'); - -const app = express(); - -app.use(function (req, res) { - res.send({ msg: "hello" }); -}); - -const server = http.createServer(app); -const wss = new WebSocket.Server({ server }); - -wss.on('connection', function connection(ws, req) { - const location = url.parse(req.url, true); - // You might use location.query.access_token to authenticate or share sessions - // or req.headers.cookie (see http://stackoverflow.com/a/16395220/151312) - - ws.on('message', function incoming(message) { - console.log('received: %s', message); - }); - - ws.send('something'); -}); - -server.listen(8080, function listening() { - console.log('Listening on %d', server.address().port); -}); -``` - ### echo.websocket.org demo ```js @@ -255,8 +326,11 @@ ws.send('something', function ack(error) { // Immediate errors can also be handled with `try...catch`, but **note** that // since sends are inherently asynchronous, socket write failures will *not* be // captured when this technique is used. -try { ws.send('something'); } -catch (e) { /* handle error */ } +try { + ws.send('something'); +} catch (e) { + /* handle error */ +} ``` ## FAQ @@ -280,14 +354,14 @@ the `X-Forwarded-For` header. ```js wss.on('connection', function connection(ws, req) { - const ip = req.headers['x-forwarded-for']; + const ip = req.headers['x-forwarded-for'].split(/\s*,\s*/)[0]; }); ``` ### How to detect and close broken connections? -Sometimes the link between the server and the client can be interrupted in a -way that keeps both the server and the client unaware of the broken state of the +Sometimes the link between the server and the client can be interrupted in a way +that keeps both the server and the client unaware of the broken state of the connection (e.g. when pulling the cord). In these cases ping messages can be used as a means to verify that the remote @@ -296,12 +370,14 @@ endpoint is still responsive. ```js const WebSocket = require('ws'); -const wss = new WebSocket.Server({ port: 8080 }); +function noop() {} function heartbeat() { this.isAlive = true; } +const wss = new WebSocket.Server({ port: 8080 }); + wss.on('connection', function connection(ws) { ws.isAlive = true; ws.on('pong', heartbeat); @@ -312,13 +388,40 @@ const interval = setInterval(function ping() { if (ws.isAlive === false) return ws.terminate(); ws.isAlive = false; - ws.ping('', false, true); + ws.ping(noop); }); }, 30000); ``` -Pong messages are automatically sent in response to ping messages as required -by the spec. +Pong messages are automatically sent in response to ping messages as required by +the spec. + +Just like the server example above your clients might as well lose connection +without knowing it. You might want to add a ping listener on your clients to +prevent that. A simple implementation would be: + +```js +const WebSocket = require('ws'); + +function heartbeat() { + clearTimeout(this.pingTimeout); + + // Use `WebSocket#terminate()` and not `WebSocket#close()`. Delay should be + // equal to the interval at which your server sends out pings plus a + // conservative assumption of the latency. + this.pingTimeout = setTimeout(() => { + this.terminate(); + }, 30000 + 1000); +} + +const client = new WebSocket('wss://echo.websocket.org/'); + +client.on('open', heartbeat); +client.on('ping', heartbeat); +client.on('close', function clear() { + clearTimeout(this.pingTimeout); +}); +``` ### How to connect via a proxy? @@ -339,3 +442,8 @@ We're using the GitHub [releases][changelog] for changelog entries. [server-report]: http://websockets.github.io/ws/autobahn/servers/ [permessage-deflate]: https://tools.ietf.org/html/rfc7692 [changelog]: https://github.com/websockets/ws/releases +[node-zlib-bug]: https://github.com/nodejs/node/issues/8871 +[node-zlib-deflaterawdocs]: + https://nodejs.org/api/zlib.html#zlib_zlib_createdeflateraw_options +[ws-server-options]: + https://github.com/websockets/ws/blob/master/doc/ws.md#new-websocketserveroptions-callback diff --git a/node_modules/ws/index.js b/node_modules/ws/index.js index 489e169..b8d6be1 100644 --- a/node_modules/ws/index.js +++ b/node_modules/ws/index.js @@ -1,15 +1,9 @@ -/*! - * ws: a node.js websocket client - * Copyright(c) 2011 Einar Otto Stangvik - * MIT Licensed - */ - 'use strict'; -const WebSocket = require('./lib/WebSocket'); +const WebSocket = require('./lib/websocket'); -WebSocket.Server = require('./lib/WebSocketServer'); -WebSocket.Receiver = require('./lib/Receiver'); -WebSocket.Sender = require('./lib/Sender'); +WebSocket.Server = require('./lib/websocket-server'); +WebSocket.Receiver = require('./lib/receiver'); +WebSocket.Sender = require('./lib/sender'); module.exports = WebSocket; diff --git a/node_modules/ws/lib/BufferUtil.js b/node_modules/ws/lib/BufferUtil.js deleted file mode 100644 index 6a35e8f..0000000 --- a/node_modules/ws/lib/BufferUtil.js +++ /dev/null @@ -1,71 +0,0 @@ -/*! - * ws: a node.js websocket client - * Copyright(c) 2011 Einar Otto Stangvik - * MIT Licensed - */ - -'use strict'; - -const safeBuffer = require('safe-buffer'); - -const Buffer = safeBuffer.Buffer; - -/** - * Merges an array of buffers into a new buffer. - * - * @param {Buffer[]} list The array of buffers to concat - * @param {Number} totalLength The total length of buffers in the list - * @return {Buffer} The resulting buffer - * @public - */ -const concat = (list, totalLength) => { - const target = Buffer.allocUnsafe(totalLength); - var offset = 0; - - for (var i = 0; i < list.length; i++) { - const buf = list[i]; - buf.copy(target, offset); - offset += buf.length; - } - - return target; -}; - -try { - const bufferUtil = require('bufferutil'); - - module.exports = Object.assign({ concat }, bufferUtil.BufferUtil || bufferUtil); -} catch (e) /* istanbul ignore next */ { - /** - * Masks a buffer using the given mask. - * - * @param {Buffer} source The buffer to mask - * @param {Buffer} mask The mask to use - * @param {Buffer} output The buffer where to store the result - * @param {Number} offset The offset at which to start writing - * @param {Number} length The number of bytes to mask. - * @public - */ - const mask = (source, mask, output, offset, length) => { - for (var i = 0; i < length; i++) { - output[offset + i] = source[i] ^ mask[i & 3]; - } - }; - - /** - * Unmasks a buffer using the given mask. - * - * @param {Buffer} buffer The buffer to unmask - * @param {Buffer} mask The mask to use - * @public - */ - const unmask = (buffer, mask) => { - // Required until https://github.com/nodejs/node/issues/9006 is resolved. - const length = buffer.length; - for (var i = 0; i < length; i++) { - buffer[i] ^= mask[i & 3]; - } - }; - - module.exports = { concat, mask, unmask }; -} diff --git a/node_modules/ws/lib/Constants.js b/node_modules/ws/lib/Constants.js index 3904414..4082981 100644 --- a/node_modules/ws/lib/Constants.js +++ b/node_modules/ws/lib/Constants.js @@ -1,10 +1,10 @@ 'use strict'; -const safeBuffer = require('safe-buffer'); - -const Buffer = safeBuffer.Buffer; - -exports.BINARY_TYPES = ['nodebuffer', 'arraybuffer', 'fragments']; -exports.GUID = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'; -exports.EMPTY_BUFFER = Buffer.alloc(0); -exports.NOOP = () => {}; +module.exports = { + BINARY_TYPES: ['nodebuffer', 'arraybuffer', 'fragments'], + GUID: '258EAFA5-E914-47DA-95CA-C5AB0DC85B11', + kStatusCode: Symbol('status-code'), + kWebSocket: Symbol('websocket'), + EMPTY_BUFFER: Buffer.alloc(0), + NOOP: () => {} +}; diff --git a/node_modules/ws/lib/ErrorCodes.js b/node_modules/ws/lib/ErrorCodes.js deleted file mode 100644 index f515571..0000000 --- a/node_modules/ws/lib/ErrorCodes.js +++ /dev/null @@ -1,28 +0,0 @@ -/*! - * ws: a node.js websocket client - * Copyright(c) 2011 Einar Otto Stangvik - * MIT Licensed - */ - -'use strict'; - -module.exports = { - isValidErrorCode: function (code) { - return (code >= 1000 && code <= 1013 && code !== 1004 && code !== 1005 && code !== 1006) || - (code >= 3000 && code <= 4999); - }, - 1000: 'normal', - 1001: 'going away', - 1002: 'protocol error', - 1003: 'unsupported data', - 1004: 'reserved', - 1005: 'reserved for extensions', - 1006: 'reserved for extensions', - 1007: 'inconsistent or invalid data', - 1008: 'policy violation', - 1009: 'message too big', - 1010: 'extension handshake missing', - 1011: 'an unexpected condition prevented the request from being fulfilled', - 1012: 'service restart', - 1013: 'try again later' -}; diff --git a/node_modules/ws/lib/EventTarget.js b/node_modules/ws/lib/EventTarget.js deleted file mode 100644 index c48137b..0000000 --- a/node_modules/ws/lib/EventTarget.js +++ /dev/null @@ -1,151 +0,0 @@ -'use strict'; - -/** - * Class representing an event. - * - * @private - */ -class Event { - /** - * Create a new `Event`. - * - * @param {String} type The name of the event - * @param {Object} target A reference to the target to which the event was dispatched - */ - constructor (type, target) { - this.target = target; - this.type = type; - } -} - -/** - * Class representing a message event. - * - * @extends Event - * @private - */ -class MessageEvent extends Event { - /** - * Create a new `MessageEvent`. - * - * @param {(String|Buffer|ArrayBuffer|Buffer[])} data The received data - * @param {WebSocket} target A reference to the target to which the event was dispatched - */ - constructor (data, target) { - super('message', target); - - this.data = data; - } -} - -/** - * Class representing a close event. - * - * @extends Event - * @private - */ -class CloseEvent extends Event { - /** - * Create a new `CloseEvent`. - * - * @param {Number} code The status code explaining why the connection is being closed - * @param {String} reason A human-readable string explaining why the connection is closing - * @param {WebSocket} target A reference to the target to which the event was dispatched - */ - constructor (code, reason, target) { - super('close', target); - - this.wasClean = target._closeFrameReceived && target._closeFrameSent; - this.reason = reason; - this.code = code; - } -} - -/** - * Class representing an open event. - * - * @extends Event - * @private - */ -class OpenEvent extends Event { - /** - * Create a new `OpenEvent`. - * - * @param {WebSocket} target A reference to the target to which the event was dispatched - */ - constructor (target) { - super('open', target); - } -} - -/** - * This provides methods for emulating the `EventTarget` interface. It's not - * meant to be used directly. - * - * @mixin - */ -const EventTarget = { - /** - * Register an event listener. - * - * @param {String} method A string representing the event type to listen for - * @param {Function} listener The listener to add - * @public - */ - addEventListener (method, listener) { - if (typeof listener !== 'function') return; - - function onMessage (data) { - listener.call(this, new MessageEvent(data, this)); - } - - function onClose (code, message) { - listener.call(this, new CloseEvent(code, message, this)); - } - - function onError (event) { - event.type = 'error'; - event.target = this; - listener.call(this, event); - } - - function onOpen () { - listener.call(this, new OpenEvent(this)); - } - - if (method === 'message') { - onMessage._listener = listener; - this.on(method, onMessage); - } else if (method === 'close') { - onClose._listener = listener; - this.on(method, onClose); - } else if (method === 'error') { - onError._listener = listener; - this.on(method, onError); - } else if (method === 'open') { - onOpen._listener = listener; - this.on(method, onOpen); - } else { - this.on(method, listener); - } - }, - - /** - * Remove an event listener. - * - * @param {String} method A string representing the event type to remove - * @param {Function} listener The listener to remove - * @public - */ - removeEventListener (method, listener) { - const listeners = this.listeners(method); - - for (var i = 0; i < listeners.length; i++) { - if (listeners[i] === listener || listeners[i]._listener === listener) { - this.removeListener(method, listeners[i]); - } - } - } -}; - -module.exports = EventTarget; diff --git a/node_modules/ws/lib/Extensions.js b/node_modules/ws/lib/Extensions.js deleted file mode 100644 index 15fee12..0000000 --- a/node_modules/ws/lib/Extensions.js +++ /dev/null @@ -1,203 +0,0 @@ -'use strict'; - -// -// Allowed token characters: -// -// '!', '#', '$', '%', '&', ''', '*', '+', '-', -// '.', 0-9, A-Z, '^', '_', '`', a-z, '|', '~' -// -// tokenChars[32] === 0 // ' ' -// tokenChars[33] === 1 // '!' -// tokenChars[34] === 0 // '"' -// ... -// -const tokenChars = [ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 15 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 16 - 31 - 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, // 32 - 47 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, // 48 - 63 - 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 64 - 79 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, // 80 - 95 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 96 - 111 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0 // 112 - 127 -]; - -/** - * Adds an offer to the map of extension offers or a parameter to the map of - * parameters. - * - * @param {Object} dest The map of extension offers or parameters - * @param {String} name The extension or parameter name - * @param {(Object|Boolean|String)} elem The extension parameters or the - * parameter value - * @private - */ -function push (dest, name, elem) { - if (Object.prototype.hasOwnProperty.call(dest, name)) dest[name].push(elem); - else dest[name] = [elem]; -} - -/** - * Parses the `Sec-WebSocket-Extensions` header into an object. - * - * @param {String} header The field value of the header - * @return {Object} The parsed object - * @public - */ -function parse (header) { - const offers = {}; - - if (header === undefined || header === '') return offers; - - var params = {}; - var mustUnescape = false; - var isEscaping = false; - var inQuotes = false; - var extensionName; - var paramName; - var start = -1; - var end = -1; - - for (var i = 0; i < header.length; i++) { - const code = header.charCodeAt(i); - - if (extensionName === undefined) { - if (end === -1 && tokenChars[code] === 1) { - if (start === -1) start = i; - } else if (code === 0x20/* ' ' */|| code === 0x09/* '\t' */) { - if (end === -1 && start !== -1) end = i; - } else if (code === 0x3b/* ';' */ || code === 0x2c/* ',' */) { - if (start === -1) throw new Error(`unexpected character at index ${i}`); - - if (end === -1) end = i; - const name = header.slice(start, end); - if (code === 0x2c) { - push(offers, name, params); - params = {}; - } else { - extensionName = name; - } - - start = end = -1; - } else { - throw new Error(`unexpected character at index ${i}`); - } - } else if (paramName === undefined) { - if (end === -1 && tokenChars[code] === 1) { - if (start === -1) start = i; - } else if (code === 0x20 || code === 0x09) { - if (end === -1 && start !== -1) end = i; - } else if (code === 0x3b || code === 0x2c) { - if (start === -1) throw new Error(`unexpected character at index ${i}`); - - if (end === -1) end = i; - push(params, header.slice(start, end), true); - if (code === 0x2c) { - push(offers, extensionName, params); - params = {}; - extensionName = undefined; - } - - start = end = -1; - } else if (code === 0x3d/* '=' */&& start !== -1 && end === -1) { - paramName = header.slice(start, i); - start = end = -1; - } else { - throw new Error(`unexpected character at index ${i}`); - } - } else { - // - // The value of a quoted-string after unescaping must conform to the - // token ABNF, so only token characters are valid. - // Ref: https://tools.ietf.org/html/rfc6455#section-9.1 - // - if (isEscaping) { - if (tokenChars[code] !== 1) { - throw new Error(`unexpected character at index ${i}`); - } - if (start === -1) start = i; - else if (!mustUnescape) mustUnescape = true; - isEscaping = false; - } else if (inQuotes) { - if (tokenChars[code] === 1) { - if (start === -1) start = i; - } else if (code === 0x22/* '"' */ && start !== -1) { - inQuotes = false; - end = i; - } else if (code === 0x5c/* '\' */) { - isEscaping = true; - } else { - throw new Error(`unexpected character at index ${i}`); - } - } else if (code === 0x22 && header.charCodeAt(i - 1) === 0x3d) { - inQuotes = true; - } else if (end === -1 && tokenChars[code] === 1) { - if (start === -1) start = i; - } else if (start !== -1 && (code === 0x20 || code === 0x09)) { - if (end === -1) end = i; - } else if (code === 0x3b || code === 0x2c) { - if (start === -1) throw new Error(`unexpected character at index ${i}`); - - if (end === -1) end = i; - var value = header.slice(start, end); - if (mustUnescape) { - value = value.replace(/\\/g, ''); - mustUnescape = false; - } - push(params, paramName, value); - if (code === 0x2c) { - push(offers, extensionName, params); - params = {}; - extensionName = undefined; - } - - paramName = undefined; - start = end = -1; - } else { - throw new Error(`unexpected character at index ${i}`); - } - } - } - - if (start === -1 || inQuotes) throw new Error('unexpected end of input'); - - if (end === -1) end = i; - const token = header.slice(start, end); - if (extensionName === undefined) { - push(offers, token, {}); - } else { - if (paramName === undefined) { - push(params, token, true); - } else if (mustUnescape) { - push(params, paramName, token.replace(/\\/g, '')); - } else { - push(params, paramName, token); - } - push(offers, extensionName, params); - } - - return offers; -} - -/** - * Serializes a parsed `Sec-WebSocket-Extensions` header to a string. - * - * @param {Object} value The object to format - * @return {String} A string representing the given value - * @public - */ -function format (value) { - return Object.keys(value).map((token) => { - var paramsList = value[token]; - if (!Array.isArray(paramsList)) paramsList = [paramsList]; - return paramsList.map((params) => { - return [token].concat(Object.keys(params).map((k) => { - var p = params[k]; - if (!Array.isArray(p)) p = [p]; - return p.map((v) => v === true ? k : `${k}=${v}`).join('; '); - })).join('; '); - }).join(', '); - }).join(', '); -} - -module.exports = { format, parse }; diff --git a/node_modules/ws/lib/PerMessageDeflate.js b/node_modules/ws/lib/PerMessageDeflate.js deleted file mode 100644 index 6ed12a7..0000000 --- a/node_modules/ws/lib/PerMessageDeflate.js +++ /dev/null @@ -1,507 +0,0 @@ -'use strict'; - -const safeBuffer = require('safe-buffer'); -const Limiter = require('async-limiter'); -const zlib = require('zlib'); - -const bufferUtil = require('./BufferUtil'); - -const Buffer = safeBuffer.Buffer; - -const TRAILER = Buffer.from([0x00, 0x00, 0xff, 0xff]); -const EMPTY_BLOCK = Buffer.from([0x00]); - -const kWriteInProgress = Symbol('write-in-progress'); -const kPendingClose = Symbol('pending-close'); -const kTotalLength = Symbol('total-length'); -const kCallback = Symbol('callback'); -const kBuffers = Symbol('buffers'); -const kError = Symbol('error'); -const kOwner = Symbol('owner'); - -// -// We limit zlib concurrency, which prevents severe memory fragmentation -// as documented in https://github.com/nodejs/node/issues/8871#issuecomment-250915913 -// and https://github.com/websockets/ws/issues/1202 -// -// Intentionally global; it's the global thread pool that's an issue. -// -let zlibLimiter; - -/** - * permessage-deflate implementation. - */ -class PerMessageDeflate { - /** - * Creates a PerMessageDeflate instance. - * - * @param {Object} options Configuration options - * @param {Boolean} options.serverNoContextTakeover Request/accept disabling - * of server context takeover - * @param {Boolean} options.clientNoContextTakeover Advertise/acknowledge - * disabling of client context takeover - * @param {(Boolean|Number)} options.serverMaxWindowBits Request/confirm the - * use of a custom server window size - * @param {(Boolean|Number)} options.clientMaxWindowBits Advertise support - * for, or request, a custom client window size - * @param {Number} options.level The value of zlib's `level` param - * @param {Number} options.memLevel The value of zlib's `memLevel` param - * @param {Number} options.threshold Size (in bytes) below which messages - * should not be compressed - * @param {Number} options.concurrencyLimit The number of concurrent calls to - * zlib - * @param {Boolean} isServer Create the instance in either server or client - * mode - * @param {Number} maxPayload The maximum allowed message length - */ - constructor (options, isServer, maxPayload) { - this._maxPayload = maxPayload | 0; - this._options = options || {}; - this._threshold = this._options.threshold !== undefined - ? this._options.threshold - : 1024; - this._isServer = !!isServer; - this._deflate = null; - this._inflate = null; - - this.params = null; - - if (!zlibLimiter) { - const concurrency = this._options.concurrencyLimit !== undefined - ? this._options.concurrencyLimit - : 10; - zlibLimiter = new Limiter({ concurrency }); - } - } - - /** - * @type {String} - */ - static get extensionName () { - return 'permessage-deflate'; - } - - /** - * Create extension parameters offer. - * - * @return {Object} Extension parameters - * @public - */ - offer () { - const params = {}; - - if (this._options.serverNoContextTakeover) { - params.server_no_context_takeover = true; - } - if (this._options.clientNoContextTakeover) { - params.client_no_context_takeover = true; - } - if (this._options.serverMaxWindowBits) { - params.server_max_window_bits = this._options.serverMaxWindowBits; - } - if (this._options.clientMaxWindowBits) { - params.client_max_window_bits = this._options.clientMaxWindowBits; - } else if (this._options.clientMaxWindowBits == null) { - params.client_max_window_bits = true; - } - - return params; - } - - /** - * Accept extension offer. - * - * @param {Array} paramsList Extension parameters - * @return {Object} Accepted configuration - * @public - */ - accept (paramsList) { - paramsList = this.normalizeParams(paramsList); - - var params; - if (this._isServer) { - params = this.acceptAsServer(paramsList); - } else { - params = this.acceptAsClient(paramsList); - } - - this.params = params; - return params; - } - - /** - * Releases all resources used by the extension. - * - * @public - */ - cleanup () { - if (this._inflate) { - if (this._inflate[kWriteInProgress]) { - this._inflate[kPendingClose] = true; - } else { - this._inflate.close(); - this._inflate = null; - } - } - if (this._deflate) { - if (this._deflate[kWriteInProgress]) { - this._deflate[kPendingClose] = true; - } else { - this._deflate.close(); - this._deflate = null; - } - } - } - - /** - * Accept extension offer from client. - * - * @param {Array} paramsList Extension parameters - * @return {Object} Accepted configuration - * @private - */ - acceptAsServer (paramsList) { - const accepted = {}; - const result = paramsList.some((params) => { - if ( - (this._options.serverNoContextTakeover === false && - params.server_no_context_takeover) || - (this._options.serverMaxWindowBits === false && - params.server_max_window_bits) || - (typeof this._options.serverMaxWindowBits === 'number' && - typeof params.server_max_window_bits === 'number' && - this._options.serverMaxWindowBits > params.server_max_window_bits) || - (typeof this._options.clientMaxWindowBits === 'number' && - !params.client_max_window_bits) - ) { - return; - } - - if ( - this._options.serverNoContextTakeover || - params.server_no_context_takeover - ) { - accepted.server_no_context_takeover = true; - } - if ( - this._options.clientNoContextTakeover || - (this._options.clientNoContextTakeover !== false && - params.client_no_context_takeover) - ) { - accepted.client_no_context_takeover = true; - } - if (typeof this._options.serverMaxWindowBits === 'number') { - accepted.server_max_window_bits = this._options.serverMaxWindowBits; - } else if (typeof params.server_max_window_bits === 'number') { - accepted.server_max_window_bits = params.server_max_window_bits; - } - if (typeof this._options.clientMaxWindowBits === 'number') { - accepted.client_max_window_bits = this._options.clientMaxWindowBits; - } else if ( - this._options.clientMaxWindowBits !== false && - typeof params.client_max_window_bits === 'number' - ) { - accepted.client_max_window_bits = params.client_max_window_bits; - } - return true; - }); - - if (!result) throw new Error("Doesn't support the offered configuration"); - - return accepted; - } - - /** - * Accept extension response from server. - * - * @param {Array} paramsList Extension parameters - * @return {Object} Accepted configuration - * @private - */ - acceptAsClient (paramsList) { - const params = paramsList[0]; - - if ( - this._options.clientNoContextTakeover === false && - params.client_no_context_takeover - ) { - throw new Error('Invalid value for "client_no_context_takeover"'); - } - - if ( - (typeof this._options.clientMaxWindowBits === 'number' && - (!params.client_max_window_bits || - params.client_max_window_bits > this._options.clientMaxWindowBits)) || - (this._options.clientMaxWindowBits === false && - params.client_max_window_bits) - ) { - throw new Error('Invalid value for "client_max_window_bits"'); - } - - return params; - } - - /** - * Normalize extensions parameters. - * - * @param {Array} paramsList Extension parameters - * @return {Array} Normalized extensions parameters - * @private - */ - normalizeParams (paramsList) { - return paramsList.map((params) => { - Object.keys(params).forEach((key) => { - var value = params[key]; - if (value.length > 1) { - throw new Error(`Multiple extension parameters for ${key}`); - } - - value = value[0]; - - switch (key) { - case 'server_no_context_takeover': - case 'client_no_context_takeover': - if (value !== true) { - throw new Error(`invalid extension parameter value for ${key} (${value})`); - } - params[key] = true; - break; - case 'server_max_window_bits': - case 'client_max_window_bits': - if (typeof value === 'string') { - value = parseInt(value, 10); - if ( - Number.isNaN(value) || - value < zlib.Z_MIN_WINDOWBITS || - value > zlib.Z_MAX_WINDOWBITS - ) { - throw new Error(`invalid extension parameter value for ${key} (${value})`); - } - } - if (!this._isServer && value === true) { - throw new Error(`Missing extension parameter value for ${key}`); - } - params[key] = value; - break; - default: - throw new Error(`Not defined extension parameter (${key})`); - } - }); - return params; - }); - } - - /** - * Decompress data. Concurrency limited by async-limiter. - * - * @param {Buffer} data Compressed data - * @param {Boolean} fin Specifies whether or not this is the last fragment - * @param {Function} callback Callback - * @public - */ - decompress (data, fin, callback) { - zlibLimiter.push((done) => { - this._decompress(data, fin, (err, result) => { - done(); - callback(err, result); - }); - }); - } - - /** - * Compress data. Concurrency limited by async-limiter. - * - * @param {Buffer} data Data to compress - * @param {Boolean} fin Specifies whether or not this is the last fragment - * @param {Function} callback Callback - * @public - */ - compress (data, fin, callback) { - zlibLimiter.push((done) => { - this._compress(data, fin, (err, result) => { - done(); - callback(err, result); - }); - }); - } - - /** - * Decompress data. - * - * @param {Buffer} data Compressed data - * @param {Boolean} fin Specifies whether or not this is the last fragment - * @param {Function} callback Callback - * @private - */ - _decompress (data, fin, callback) { - const endpoint = this._isServer ? 'client' : 'server'; - - if (!this._inflate) { - const key = `${endpoint}_max_window_bits`; - const windowBits = typeof this.params[key] !== 'number' - ? zlib.Z_DEFAULT_WINDOWBITS - : this.params[key]; - - this._inflate = zlib.createInflateRaw({ windowBits }); - this._inflate[kTotalLength] = 0; - this._inflate[kBuffers] = []; - this._inflate[kOwner] = this; - this._inflate.on('error', inflateOnError); - this._inflate.on('data', inflateOnData); - } - - this._inflate[kCallback] = callback; - this._inflate[kWriteInProgress] = true; - - this._inflate.write(data); - if (fin) this._inflate.write(TRAILER); - - this._inflate.flush(() => { - const err = this._inflate[kError]; - - if (err) { - this._inflate.close(); - this._inflate = null; - callback(err); - return; - } - - const data = bufferUtil.concat( - this._inflate[kBuffers], - this._inflate[kTotalLength] - ); - - if ( - (fin && this.params[`${endpoint}_no_context_takeover`]) || - this._inflate[kPendingClose] - ) { - this._inflate.close(); - this._inflate = null; - } else { - this._inflate[kWriteInProgress] = false; - this._inflate[kTotalLength] = 0; - this._inflate[kBuffers] = []; - } - - callback(null, data); - }); - } - - /** - * Compress data. - * - * @param {Buffer} data Data to compress - * @param {Boolean} fin Specifies whether or not this is the last fragment - * @param {Function} callback Callback - * @private - */ - _compress (data, fin, callback) { - if (!data || data.length === 0) { - process.nextTick(callback, null, EMPTY_BLOCK); - return; - } - - const endpoint = this._isServer ? 'server' : 'client'; - - if (!this._deflate) { - const key = `${endpoint}_max_window_bits`; - const windowBits = typeof this.params[key] !== 'number' - ? zlib.Z_DEFAULT_WINDOWBITS - : this.params[key]; - - this._deflate = zlib.createDeflateRaw({ - memLevel: this._options.memLevel, - level: this._options.level, - flush: zlib.Z_SYNC_FLUSH, - windowBits - }); - - this._deflate[kTotalLength] = 0; - this._deflate[kBuffers] = []; - - // - // `zlib.DeflateRaw` emits an `'error'` event only when an attempt to use - // it is made after it has already been closed. This cannot happen here, - // so we only add a listener for the `'data'` event. - // - this._deflate.on('data', deflateOnData); - } - - this._deflate[kWriteInProgress] = true; - - this._deflate.write(data); - this._deflate.flush(zlib.Z_SYNC_FLUSH, () => { - var data = bufferUtil.concat( - this._deflate[kBuffers], - this._deflate[kTotalLength] - ); - - if (fin) data = data.slice(0, data.length - 4); - - if ( - (fin && this.params[`${endpoint}_no_context_takeover`]) || - this._deflate[kPendingClose] - ) { - this._deflate.close(); - this._deflate = null; - } else { - this._deflate[kWriteInProgress] = false; - this._deflate[kTotalLength] = 0; - this._deflate[kBuffers] = []; - } - - callback(null, data); - }); - } -} - -module.exports = PerMessageDeflate; - -/** - * The listener of the `zlib.DeflateRaw` stream `'data'` event. - * - * @param {Buffer} chunk A chunk of data - * @private - */ -function deflateOnData (chunk) { - this[kBuffers].push(chunk); - this[kTotalLength] += chunk.length; -} - -/** - * The listener of the `zlib.InflateRaw` stream `'data'` event. - * - * @param {Buffer} chunk A chunk of data - * @private - */ -function inflateOnData (chunk) { - this[kTotalLength] += chunk.length; - - if ( - this[kOwner]._maxPayload < 1 || - this[kTotalLength] <= this[kOwner]._maxPayload - ) { - this[kBuffers].push(chunk); - return; - } - - this[kError] = new Error('max payload size exceeded'); - this[kError].closeCode = 1009; - this.removeListener('data', inflateOnData); - this.reset(); -} - -/** - * The listener of the `zlib.InflateRaw` stream `'error'` event. - * - * @param {Error} err The emitted error - * @private - */ -function inflateOnError (err) { - // - // There is no need to call `Zlib#close()` as the handle is automatically - // closed when an error is emitted. - // - this[kOwner]._inflate = null; - this[kCallback](err); -} diff --git a/node_modules/ws/lib/Receiver.js b/node_modules/ws/lib/Receiver.js index 9119670..0a8d76d 100644 --- a/node_modules/ws/lib/Receiver.js +++ b/node_modules/ws/lib/Receiver.js @@ -1,20 +1,16 @@ -/*! - * ws: a node.js websocket client - * Copyright(c) 2011 Einar Otto Stangvik - * MIT Licensed - */ - 'use strict'; -const safeBuffer = require('safe-buffer'); +const { Writable } = require('stream'); -const PerMessageDeflate = require('./PerMessageDeflate'); -const isValidUTF8 = require('./Validation'); -const bufferUtil = require('./BufferUtil'); -const ErrorCodes = require('./ErrorCodes'); -const constants = require('./Constants'); - -const Buffer = safeBuffer.Buffer; +const PerMessageDeflate = require('./permessage-deflate'); +const { + BINARY_TYPES, + EMPTY_BUFFER, + kStatusCode, + kWebSocket +} = require('./constants'); +const { concat, toArrayBuffer, unmask } = require('./buffer-util'); +const { isValidStatusCode, isValidUTF8 } = require('./validation'); const GET_INFO = 0; const GET_PAYLOAD_LENGTH_16 = 1; @@ -25,17 +21,22 @@ const INFLATING = 5; /** * HyBi Receiver implementation. + * + * @extends stream.Writable */ -class Receiver { +class Receiver extends Writable { /** * Creates a Receiver instance. * + * @param {String} binaryType The type for binary data * @param {Object} extensions An object containing the negotiated extensions * @param {Number} maxPayload The maximum allowed message length - * @param {String} binaryType The type for binary data */ - constructor (extensions, maxPayload, binaryType) { - this._binaryType = binaryType || constants.BINARY_TYPES[0]; + constructor(binaryType, extensions, maxPayload) { + super(); + + this._binaryType = binaryType || BINARY_TYPES[0]; + this[kWebSocket] = undefined; this._extensions = extensions || {}; this._maxPayload = maxPayload | 0; @@ -44,152 +45,132 @@ class Receiver { this._compressed = false; this._payloadLength = 0; + this._mask = undefined; this._fragmented = 0; this._masked = false; this._fin = false; - this._mask = null; this._opcode = 0; this._totalPayloadLength = 0; this._messageLength = 0; this._fragments = []; - this._cleanupCallback = null; - this._hadError = false; - this._dead = false; - this._loop = false; - - this.onmessage = null; - this.onclose = null; - this.onerror = null; - this.onping = null; - this.onpong = null; - this._state = GET_INFO; + this._loop = false; } /** - * Consumes bytes from the available buffered data. + * Implements `Writable.prototype._write()`. * - * @param {Number} bytes The number of bytes to consume - * @return {Buffer} Consumed bytes + * @param {Buffer} chunk The chunk of data to write + * @param {String} encoding The character encoding of `chunk` + * @param {Function} cb Callback + */ + _write(chunk, encoding, cb) { + if (this._opcode === 0x08 && this._state == GET_INFO) return cb(); + + this._bufferedBytes += chunk.length; + this._buffers.push(chunk); + this.startLoop(cb); + } + + /** + * Consumes `n` bytes from the buffered data. + * + * @param {Number} n The number of bytes to consume + * @return {Buffer} The consumed bytes * @private */ - readBuffer (bytes) { - var offset = 0; - var dst; - var l; + consume(n) { + this._bufferedBytes -= n; - this._bufferedBytes -= bytes; + if (n === this._buffers[0].length) return this._buffers.shift(); - if (bytes === this._buffers[0].length) return this._buffers.shift(); - - if (bytes < this._buffers[0].length) { - dst = this._buffers[0].slice(0, bytes); - this._buffers[0] = this._buffers[0].slice(bytes); - return dst; + if (n < this._buffers[0].length) { + const buf = this._buffers[0]; + this._buffers[0] = buf.slice(n); + return buf.slice(0, n); } - dst = Buffer.allocUnsafe(bytes); + const dst = Buffer.allocUnsafe(n); - while (bytes > 0) { - l = this._buffers[0].length; + do { + const buf = this._buffers[0]; - if (bytes >= l) { - this._buffers[0].copy(dst, offset); - offset += l; - this._buffers.shift(); + if (n >= buf.length) { + this._buffers.shift().copy(dst, dst.length - n); } else { - this._buffers[0].copy(dst, offset, 0, bytes); - this._buffers[0] = this._buffers[0].slice(bytes); + buf.copy(dst, dst.length - n, 0, n); + this._buffers[0] = buf.slice(n); } - bytes -= l; - } + n -= buf.length; + } while (n > 0); return dst; } - /** - * Checks if the number of buffered bytes is bigger or equal than `n` and - * calls `cleanup` if necessary. - * - * @param {Number} n The number of bytes to check against - * @return {Boolean} `true` if `bufferedBytes >= n`, else `false` - * @private - */ - hasBufferedBytes (n) { - if (this._bufferedBytes >= n) return true; - - this._loop = false; - if (this._dead) this.cleanup(this._cleanupCallback); - return false; - } - - /** - * Adds new data to the parser. - * - * @public - */ - add (data) { - if (this._dead) return; - - this._bufferedBytes += data.length; - this._buffers.push(data); - this.startLoop(); - } - /** * Starts the parsing loop. * + * @param {Function} cb Callback * @private */ - startLoop () { + startLoop(cb) { + var err; this._loop = true; - while (this._loop) { + do { switch (this._state) { case GET_INFO: - this.getInfo(); + err = this.getInfo(); break; case GET_PAYLOAD_LENGTH_16: - this.getPayloadLength16(); + err = this.getPayloadLength16(); break; case GET_PAYLOAD_LENGTH_64: - this.getPayloadLength64(); + err = this.getPayloadLength64(); break; case GET_MASK: this.getMask(); break; case GET_DATA: - this.getData(); + err = this.getData(cb); break; - default: // `INFLATING` + default: + // `INFLATING` this._loop = false; + return; } - } + } while (this._loop); + + cb(err); } /** * Reads the first two bytes of a frame. * + * @return {(RangeError|undefined)} A possible error * @private */ - getInfo () { - if (!this.hasBufferedBytes(2)) return; + getInfo() { + if (this._bufferedBytes < 2) { + this._loop = false; + return; + } - const buf = this.readBuffer(2); + const buf = this.consume(2); if ((buf[0] & 0x30) !== 0x00) { - this.error(new Error('RSV2 and RSV3 must be clear'), 1002); - return; + this._loop = false; + return error(RangeError, 'RSV2 and RSV3 must be clear', true, 1002); } const compressed = (buf[0] & 0x40) === 0x40; if (compressed && !this._extensions[PerMessageDeflate.extensionName]) { - this.error(new Error('RSV1 must be clear'), 1002); - return; + this._loop = false; + return error(RangeError, 'RSV1 must be clear', true, 1002); } this._fin = (buf[0] & 0x80) === 0x80; @@ -198,96 +179,118 @@ class Receiver { if (this._opcode === 0x00) { if (compressed) { - this.error(new Error('RSV1 must be clear'), 1002); - return; + this._loop = false; + return error(RangeError, 'RSV1 must be clear', true, 1002); } if (!this._fragmented) { - this.error(new Error(`invalid opcode: ${this._opcode}`), 1002); - return; - } else { - this._opcode = this._fragmented; + this._loop = false; + return error(RangeError, 'invalid opcode 0', true, 1002); } + + this._opcode = this._fragmented; } else if (this._opcode === 0x01 || this._opcode === 0x02) { if (this._fragmented) { - this.error(new Error(`invalid opcode: ${this._opcode}`), 1002); - return; + this._loop = false; + return error(RangeError, `invalid opcode ${this._opcode}`, true, 1002); } this._compressed = compressed; } else if (this._opcode > 0x07 && this._opcode < 0x0b) { if (!this._fin) { - this.error(new Error('FIN must be set'), 1002); - return; + this._loop = false; + return error(RangeError, 'FIN must be set', true, 1002); } if (compressed) { - this.error(new Error('RSV1 must be clear'), 1002); - return; + this._loop = false; + return error(RangeError, 'RSV1 must be clear', true, 1002); } if (this._payloadLength > 0x7d) { - this.error(new Error('invalid payload length'), 1002); - return; + this._loop = false; + return error( + RangeError, + `invalid payload length ${this._payloadLength}`, + true, + 1002 + ); } } else { - this.error(new Error(`invalid opcode: ${this._opcode}`), 1002); - return; + this._loop = false; + return error(RangeError, `invalid opcode ${this._opcode}`, true, 1002); } if (!this._fin && !this._fragmented) this._fragmented = this._opcode; - this._masked = (buf[1] & 0x80) === 0x80; if (this._payloadLength === 126) this._state = GET_PAYLOAD_LENGTH_16; else if (this._payloadLength === 127) this._state = GET_PAYLOAD_LENGTH_64; - else this.haveLength(); + else return this.haveLength(); } /** * Gets extended payload length (7+16). * + * @return {(RangeError|undefined)} A possible error * @private */ - getPayloadLength16 () { - if (!this.hasBufferedBytes(2)) return; + getPayloadLength16() { + if (this._bufferedBytes < 2) { + this._loop = false; + return; + } - this._payloadLength = this.readBuffer(2).readUInt16BE(0, true); - this.haveLength(); + this._payloadLength = this.consume(2).readUInt16BE(0); + return this.haveLength(); } /** * Gets extended payload length (7+64). * + * @return {(RangeError|undefined)} A possible error * @private */ - getPayloadLength64 () { - if (!this.hasBufferedBytes(8)) return; + getPayloadLength64() { + if (this._bufferedBytes < 8) { + this._loop = false; + return; + } - const buf = this.readBuffer(8); - const num = buf.readUInt32BE(0, true); + const buf = this.consume(8); + const num = buf.readUInt32BE(0); // // The maximum safe integer in JavaScript is 2^53 - 1. An error is returned // if payload length is greater than this number. // if (num > Math.pow(2, 53 - 32) - 1) { - this.error(new Error('max payload size exceeded'), 1009); - return; + this._loop = false; + return error( + RangeError, + 'Unsupported WebSocket frame: payload length > 2^53 - 1', + false, + 1009 + ); } - this._payloadLength = (num * Math.pow(2, 32)) + buf.readUInt32BE(4, true); - this.haveLength(); + this._payloadLength = num * Math.pow(2, 32) + buf.readUInt32BE(4); + return this.haveLength(); } /** * Payload length has been read. * + * @return {(RangeError|undefined)} A possible error * @private */ - haveLength () { - if (this._opcode < 0x08 && this.maxPayloadExceeded(this._payloadLength)) { - return; + haveLength() { + if (this._payloadLength && this._opcode < 0x08) { + this._totalPayloadLength += this._payloadLength; + if (this._totalPayloadLength > this._maxPayload && this._maxPayload > 0) { + this._loop = false; + return error(RangeError, 'Max payload size exceeded', false, 1009); + } } if (this._masked) this._state = GET_MASK; @@ -299,64 +302,94 @@ class Receiver { * * @private */ - getMask () { - if (!this.hasBufferedBytes(4)) return; + getMask() { + if (this._bufferedBytes < 4) { + this._loop = false; + return; + } - this._mask = this.readBuffer(4); + this._mask = this.consume(4); this._state = GET_DATA; } /** * Reads data bytes. * + * @param {Function} cb Callback + * @return {(Error|RangeError|undefined)} A possible error * @private */ - getData () { - var data = constants.EMPTY_BUFFER; + getData(cb) { + var data = EMPTY_BUFFER; if (this._payloadLength) { - if (!this.hasBufferedBytes(this._payloadLength)) return; + if (this._bufferedBytes < this._payloadLength) { + this._loop = false; + return; + } - data = this.readBuffer(this._payloadLength); - if (this._masked) bufferUtil.unmask(data, this._mask); + data = this.consume(this._payloadLength); + if (this._masked) unmask(data, this._mask); } - if (this._opcode > 0x07) { - this.controlMessage(data); - } else if (this._compressed) { + if (this._opcode > 0x07) return this.controlMessage(data); + + if (this._compressed) { this._state = INFLATING; - this.decompress(data); - } else if (this.pushFragment(data)) { - this.dataMessage(); + this.decompress(data, cb); + return; } + + if (data.length) { + // + // This message is not compressed so its lenght is the sum of the payload + // length of all fragments. + // + this._messageLength = this._totalPayloadLength; + this._fragments.push(data); + } + + return this.dataMessage(); } /** * Decompresses data. * * @param {Buffer} data Compressed data + * @param {Function} cb Callback * @private */ - decompress (data) { + decompress(data, cb) { const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName]; perMessageDeflate.decompress(data, this._fin, (err, buf) => { - if (err) { - this.error(err, err.closeCode === 1009 ? 1009 : 1007); - return; + if (err) return cb(err); + + if (buf.length) { + this._messageLength += buf.length; + if (this._messageLength > this._maxPayload && this._maxPayload > 0) { + return cb( + error(RangeError, 'Max payload size exceeded', false, 1009) + ); + } + + this._fragments.push(buf); } - if (this.pushFragment(buf)) this.dataMessage(); - this.startLoop(); + const er = this.dataMessage(); + if (er) return cb(er); + + this.startLoop(cb); }); } /** * Handles a data message. * + * @return {(Error|undefined)} A possible error * @private */ - dataMessage () { + dataMessage() { if (this._fin) { const messageLength = this._messageLength; const fragments = this._fragments; @@ -370,23 +403,23 @@ class Receiver { var data; if (this._binaryType === 'nodebuffer') { - data = toBuffer(fragments, messageLength); + data = concat(fragments, messageLength); } else if (this._binaryType === 'arraybuffer') { - data = toArrayBuffer(toBuffer(fragments, messageLength)); + data = toArrayBuffer(concat(fragments, messageLength)); } else { data = fragments; } - this.onmessage(data); + this.emit('message', data); } else { - const buf = toBuffer(fragments, messageLength); + const buf = concat(fragments, messageLength); if (!isValidUTF8(buf)) { - this.error(new Error('invalid utf8 sequence'), 1007); - return; + this._loop = false; + return error(Error, 'invalid UTF-8 sequence', true, 1007); } - this.onmessage(buf.toString()); + this.emit('message', buf.toString()); } } @@ -397,157 +430,63 @@ class Receiver { * Handles a control message. * * @param {Buffer} data Data to handle + * @return {(Error|RangeError|undefined)} A possible error * @private */ - controlMessage (data) { + controlMessage(data) { if (this._opcode === 0x08) { - if (data.length === 0) { - this.onclose(1000, ''); - this._loop = false; - this.cleanup(this._cleanupCallback); - } else if (data.length === 1) { - this.error(new Error('invalid payload length'), 1002); - } else { - const code = data.readUInt16BE(0, true); + this._loop = false; - if (!ErrorCodes.isValidErrorCode(code)) { - this.error(new Error(`invalid status code: ${code}`), 1002); - return; + if (data.length === 0) { + this.emit('conclude', 1005, ''); + this.end(); + } else if (data.length === 1) { + return error(RangeError, 'invalid payload length 1', true, 1002); + } else { + const code = data.readUInt16BE(0); + + if (!isValidStatusCode(code)) { + return error(RangeError, `invalid status code ${code}`, true, 1002); } const buf = data.slice(2); if (!isValidUTF8(buf)) { - this.error(new Error('invalid utf8 sequence'), 1007); - return; + return error(Error, 'invalid UTF-8 sequence', true, 1007); } - this.onclose(code, buf.toString()); - this._loop = false; - this.cleanup(this._cleanupCallback); + this.emit('conclude', code, buf.toString()); + this.end(); } - - return; + } else if (this._opcode === 0x09) { + this.emit('ping', data); + } else { + this.emit('pong', data); } - if (this._opcode === 0x09) this.onping(data); - else this.onpong(data); - this._state = GET_INFO; } - - /** - * Handles an error. - * - * @param {Error} err The error - * @param {Number} code Close code - * @private - */ - error (err, code) { - this.onerror(err, code); - this._hadError = true; - this._loop = false; - this.cleanup(this._cleanupCallback); - } - - /** - * Checks payload size, disconnects socket when it exceeds `maxPayload`. - * - * @param {Number} length Payload length - * @private - */ - maxPayloadExceeded (length) { - if (length === 0 || this._maxPayload < 1) return false; - - const fullLength = this._totalPayloadLength + length; - - if (fullLength <= this._maxPayload) { - this._totalPayloadLength = fullLength; - return false; - } - - this.error(new Error('max payload size exceeded'), 1009); - return true; - } - - /** - * Appends a fragment in the fragments array after checking that the sum of - * fragment lengths does not exceed `maxPayload`. - * - * @param {Buffer} fragment The fragment to add - * @return {Boolean} `true` if `maxPayload` is not exceeded, else `false` - * @private - */ - pushFragment (fragment) { - if (fragment.length === 0) return true; - - const totalLength = this._messageLength + fragment.length; - - if (this._maxPayload < 1 || totalLength <= this._maxPayload) { - this._messageLength = totalLength; - this._fragments.push(fragment); - return true; - } - - this.error(new Error('max payload size exceeded'), 1009); - return false; - } - - /** - * Releases resources used by the receiver. - * - * @param {Function} cb Callback - * @public - */ - cleanup (cb) { - this._dead = true; - - if (!this._hadError && (this._loop || this._state === INFLATING)) { - this._cleanupCallback = cb; - } else { - this._extensions = null; - this._fragments = null; - this._buffers = null; - this._mask = null; - - this._cleanupCallback = null; - this.onmessage = null; - this.onclose = null; - this.onerror = null; - this.onping = null; - this.onpong = null; - - if (cb) cb(); - } - } } module.exports = Receiver; /** - * Makes a buffer from a list of fragments. + * Builds an error object. * - * @param {Buffer[]} fragments The list of fragments composing the message - * @param {Number} messageLength The length of the message - * @return {Buffer} + * @param {(Error|RangeError)} ErrorCtor The error constructor + * @param {String} message The error message + * @param {Boolean} prefix Specifies whether or not to add a default prefix to + * `message` + * @param {Number} statusCode The status code + * @return {(Error|RangeError)} The error * @private */ -function toBuffer (fragments, messageLength) { - if (fragments.length === 1) return fragments[0]; - if (fragments.length > 1) return bufferUtil.concat(fragments, messageLength); - return constants.EMPTY_BUFFER; -} +function error(ErrorCtor, message, prefix, statusCode) { + const err = new ErrorCtor( + prefix ? `Invalid WebSocket frame: ${message}` : message + ); -/** - * Converts a buffer to an `ArrayBuffer`. - * - * @param {Buffer} The buffer to convert - * @return {ArrayBuffer} Converted buffer - */ -function toArrayBuffer (buf) { - if (buf.byteOffset === 0 && buf.byteLength === buf.buffer.byteLength) { - return buf.buffer; - } - - return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); + Error.captureStackTrace(err, error); + err[kStatusCode] = statusCode; + return err; } diff --git a/node_modules/ws/lib/Sender.js b/node_modules/ws/lib/Sender.js index 046a0e1..51158b1 100644 --- a/node_modules/ws/lib/Sender.js +++ b/node_modules/ws/lib/Sender.js @@ -1,20 +1,11 @@ -/*! - * ws: a node.js websocket client - * Copyright(c) 2011 Einar Otto Stangvik - * MIT Licensed - */ - 'use strict'; -const safeBuffer = require('safe-buffer'); -const crypto = require('crypto'); +const { randomBytes } = require('crypto'); -const PerMessageDeflate = require('./PerMessageDeflate'); -const bufferUtil = require('./BufferUtil'); -const ErrorCodes = require('./ErrorCodes'); -const constants = require('./Constants'); - -const Buffer = safeBuffer.Buffer; +const PerMessageDeflate = require('./permessage-deflate'); +const { EMPTY_BUFFER } = require('./constants'); +const { isValidStatusCode } = require('./validation'); +const { mask: applyMask, toBuffer } = require('./buffer-util'); /** * HyBi Sender implementation. @@ -26,7 +17,7 @@ class Sender { * @param {net.Socket} socket The connection socket * @param {Object} extensions An object containing the negotiated extensions */ - constructor (socket, extensions) { + constructor(socket, extensions) { this._extensions = extensions || {}; this._socket = socket; @@ -51,8 +42,8 @@ class Sender { * @return {Buffer[]} The framed data as a list of `Buffer` instances * @public */ - static frame (data, options) { - const merge = data.length < 1024 || (options.mask && options.readOnly); + static frame(data, options) { + const merge = options.mask && options.readOnly; var offset = options.mask ? 6 : 2; var payloadLength = data.length; @@ -69,37 +60,31 @@ class Sender { target[0] = options.fin ? options.opcode | 0x80 : options.opcode; if (options.rsv1) target[0] |= 0x40; + target[1] = payloadLength; + if (payloadLength === 126) { - target.writeUInt16BE(data.length, 2, true); + target.writeUInt16BE(data.length, 2); } else if (payloadLength === 127) { - target.writeUInt32BE(0, 2, true); - target.writeUInt32BE(data.length, 6, true); + target.writeUInt32BE(0, 2); + target.writeUInt32BE(data.length, 6); } - if (!options.mask) { - target[1] = payloadLength; - if (merge) { - data.copy(target, offset); - return [target]; - } + if (!options.mask) return [target, data]; - return [target, data]; - } + const mask = randomBytes(4); - const mask = crypto.randomBytes(4); - - target[1] = payloadLength | 0x80; + target[1] |= 0x80; target[offset - 4] = mask[0]; target[offset - 3] = mask[1]; target[offset - 2] = mask[2]; target[offset - 1] = mask[3]; if (merge) { - bufferUtil.mask(data, mask, target, offset, data.length); + applyMask(data, mask, target, offset, data.length); return [target]; } - bufferUtil.mask(data, mask, data, 0, data.length); + applyMask(data, mask, data, 0, data.length); return [target, data]; } @@ -112,25 +97,19 @@ class Sender { * @param {Function} cb Callback * @public */ - close (code, data, mask, cb) { + close(code, data, mask, cb) { var buf; if (code === undefined) { - code = 1000; - } else if (typeof code !== 'number' || !ErrorCodes.isValidErrorCode(code)) { - throw new Error('first argument must be a valid error code number'); - } - - if (data === undefined || data === '') { - if (code === 1000) { - buf = constants.EMPTY_BUFFER; - } else { - buf = Buffer.allocUnsafe(2); - buf.writeUInt16BE(code, 0, true); - } + buf = EMPTY_BUFFER; + } else if (typeof code !== 'number' || !isValidStatusCode(code)) { + throw new TypeError('First argument must be a valid error code number'); + } else if (data === undefined || data === '') { + buf = Buffer.allocUnsafe(2); + buf.writeUInt16BE(code, 0); } else { buf = Buffer.allocUnsafe(2 + Buffer.byteLength(data)); - buf.writeUInt16BE(code, 0, true); + buf.writeUInt16BE(code, 0); buf.write(data, 2); } @@ -149,14 +128,17 @@ class Sender { * @param {Function} cb Callback * @private */ - doClose (data, mask, cb) { - this.sendFrame(Sender.frame(data, { - fin: true, - rsv1: false, - opcode: 0x08, - mask, - readOnly: false - }), cb); + doClose(data, mask, cb) { + this.sendFrame( + Sender.frame(data, { + fin: true, + rsv1: false, + opcode: 0x08, + mask, + readOnly: false + }), + cb + ); } /** @@ -164,26 +146,16 @@ class Sender { * * @param {*} data The message to send * @param {Boolean} mask Specifies whether or not to mask `data` + * @param {Function} cb Callback * @public */ - ping (data, mask) { - var readOnly = true; - - if (!Buffer.isBuffer(data)) { - if (data instanceof ArrayBuffer) { - data = Buffer.from(data); - } else if (ArrayBuffer.isView(data)) { - data = viewToBuffer(data); - } else { - data = Buffer.from(data); - readOnly = false; - } - } + ping(data, mask, cb) { + const buf = toBuffer(data); if (this._deflating) { - this.enqueue([this.doPing, data, mask, readOnly]); + this.enqueue([this.doPing, buf, mask, toBuffer.readOnly, cb]); } else { - this.doPing(data, mask, readOnly); + this.doPing(buf, mask, toBuffer.readOnly, cb); } } @@ -193,16 +165,20 @@ class Sender { * @param {*} data The message to send * @param {Boolean} mask Specifies whether or not to mask `data` * @param {Boolean} readOnly Specifies whether `data` can be modified + * @param {Function} cb Callback * @private */ - doPing (data, mask, readOnly) { - this.sendFrame(Sender.frame(data, { - fin: true, - rsv1: false, - opcode: 0x09, - mask, - readOnly - })); + doPing(data, mask, readOnly, cb) { + this.sendFrame( + Sender.frame(data, { + fin: true, + rsv1: false, + opcode: 0x09, + mask, + readOnly + }), + cb + ); } /** @@ -210,26 +186,16 @@ class Sender { * * @param {*} data The message to send * @param {Boolean} mask Specifies whether or not to mask `data` + * @param {Function} cb Callback * @public */ - pong (data, mask) { - var readOnly = true; - - if (!Buffer.isBuffer(data)) { - if (data instanceof ArrayBuffer) { - data = Buffer.from(data); - } else if (ArrayBuffer.isView(data)) { - data = viewToBuffer(data); - } else { - data = Buffer.from(data); - readOnly = false; - } - } + pong(data, mask, cb) { + const buf = toBuffer(data); if (this._deflating) { - this.enqueue([this.doPong, data, mask, readOnly]); + this.enqueue([this.doPong, buf, mask, toBuffer.readOnly, cb]); } else { - this.doPong(data, mask, readOnly); + this.doPong(buf, mask, toBuffer.readOnly, cb); } } @@ -239,16 +205,20 @@ class Sender { * @param {*} data The message to send * @param {Boolean} mask Specifies whether or not to mask `data` * @param {Boolean} readOnly Specifies whether `data` can be modified + * @param {Function} cb Callback * @private */ - doPong (data, mask, readOnly) { - this.sendFrame(Sender.frame(data, { - fin: true, - rsv1: false, - opcode: 0x0a, - mask, - readOnly - })); + doPong(data, mask, readOnly, cb) { + this.sendFrame( + Sender.frame(data, { + fin: true, + rsv1: false, + opcode: 0x0a, + mask, + readOnly + }), + cb + ); } /** @@ -263,28 +233,16 @@ class Sender { * @param {Function} cb Callback * @public */ - send (data, options, cb) { + send(data, options, cb) { + const buf = toBuffer(data); + const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName]; var opcode = options.binary ? 2 : 1; var rsv1 = options.compress; - var readOnly = true; - - if (!Buffer.isBuffer(data)) { - if (data instanceof ArrayBuffer) { - data = Buffer.from(data); - } else if (ArrayBuffer.isView(data)) { - data = viewToBuffer(data); - } else { - data = Buffer.from(data); - readOnly = false; - } - } - - const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName]; if (this._firstFragment) { this._firstFragment = false; if (rsv1 && perMessageDeflate) { - rsv1 = data.length >= perMessageDeflate._threshold; + rsv1 = buf.length >= perMessageDeflate._threshold; } this._compress = rsv1; } else { @@ -300,22 +258,25 @@ class Sender { rsv1, opcode, mask: options.mask, - readOnly + readOnly: toBuffer.readOnly }; if (this._deflating) { - this.enqueue([this.dispatch, data, this._compress, opts, cb]); + this.enqueue([this.dispatch, buf, this._compress, opts, cb]); } else { - this.dispatch(data, this._compress, opts, cb); + this.dispatch(buf, this._compress, opts, cb); } } else { - this.sendFrame(Sender.frame(data, { - fin: options.fin, - rsv1: false, - opcode, - mask: options.mask, - readOnly - }), cb); + this.sendFrame( + Sender.frame(buf, { + fin: options.fin, + rsv1: false, + opcode, + mask: options.mask, + readOnly: toBuffer.readOnly + }), + cb + ); } } @@ -333,7 +294,7 @@ class Sender { * @param {Function} cb Callback * @private */ - dispatch (data, compress, options, cb) { + dispatch(data, compress, options, cb) { if (!compress) { this.sendFrame(Sender.frame(data, options), cb); return; @@ -343,9 +304,9 @@ class Sender { this._deflating = true; perMessageDeflate.compress(data, options.fin, (_, buf) => { + this._deflating = false; options.readOnly = false; this.sendFrame(Sender.frame(buf, options), cb); - this._deflating = false; this.dequeue(); }); } @@ -355,7 +316,7 @@ class Sender { * * @private */ - dequeue () { + dequeue() { while (!this._deflating && this._queue.length) { const params = this._queue.shift(); @@ -370,7 +331,7 @@ class Sender { * @param {Array} params Send operation parameters. * @private */ - enqueue (params) { + enqueue(params) { this._bufferedBytes += params[1].length; this._queue.push(params); } @@ -382,10 +343,12 @@ class Sender { * @param {Function} cb Callback * @private */ - sendFrame (list, cb) { + sendFrame(list, cb) { if (list.length === 2) { + this._socket.cork(); this._socket.write(list[0]); this._socket.write(list[1], cb); + this._socket.uncork(); } else { this._socket.write(list[0], cb); } @@ -393,20 +356,3 @@ class Sender { } module.exports = Sender; - -/** - * Converts an `ArrayBuffer` view into a buffer. - * - * @param {(DataView|TypedArray)} view The view to convert - * @return {Buffer} Converted view - * @private - */ -function viewToBuffer (view) { - const buf = Buffer.from(view.buffer); - - if (view.byteLength !== view.buffer.byteLength) { - return buf.slice(view.byteOffset, view.byteOffset + view.byteLength); - } - - return buf; -} diff --git a/node_modules/ws/lib/Validation.js b/node_modules/ws/lib/Validation.js index 35c7e4f..479a7db 100644 --- a/node_modules/ws/lib/Validation.js +++ b/node_modules/ws/lib/Validation.js @@ -1,17 +1,30 @@ -/*! - * ws: a node.js websocket client - * Copyright(c) 2011 Einar Otto Stangvik - * MIT Licensed - */ - 'use strict'; try { const isValidUTF8 = require('utf-8-validate'); - module.exports = typeof isValidUTF8 === 'object' - ? isValidUTF8.Validation.isValidUTF8 // utf-8-validate@<3.0.0 - : isValidUTF8; + exports.isValidUTF8 = + typeof isValidUTF8 === 'object' + ? isValidUTF8.Validation.isValidUTF8 // utf-8-validate@<3.0.0 + : isValidUTF8; } catch (e) /* istanbul ignore next */ { - module.exports = () => true; + exports.isValidUTF8 = () => true; } + +/** + * Checks if a status code is allowed in a close frame. + * + * @param {Number} code The status code + * @return {Boolean} `true` if the status code is valid, else `false` + * @public + */ +exports.isValidStatusCode = (code) => { + return ( + (code >= 1000 && + code <= 1013 && + code !== 1004 && + code !== 1005 && + code !== 1006) || + (code >= 3000 && code <= 4999) + ); +}; diff --git a/node_modules/ws/lib/WebSocket.js b/node_modules/ws/lib/WebSocket.js index a8c7b99..af81084 100644 --- a/node_modules/ws/lib/WebSocket.js +++ b/node_modules/ws/lib/WebSocket.js @@ -1,27 +1,30 @@ -/*! - * ws: a node.js websocket client - * Copyright(c) 2011 Einar Otto Stangvik - * MIT Licensed - */ - 'use strict'; const EventEmitter = require('events'); const crypto = require('crypto'); -const Ultron = require('ultron'); const https = require('https'); const http = require('http'); +const net = require('net'); +const tls = require('tls'); const url = require('url'); -const PerMessageDeflate = require('./PerMessageDeflate'); -const EventTarget = require('./EventTarget'); -const Extensions = require('./Extensions'); -const constants = require('./Constants'); -const Receiver = require('./Receiver'); -const Sender = require('./Sender'); +const PerMessageDeflate = require('./permessage-deflate'); +const EventTarget = require('./event-target'); +const extension = require('./extension'); +const Receiver = require('./receiver'); +const Sender = require('./sender'); +const { + BINARY_TYPES, + EMPTY_BUFFER, + GUID, + kStatusCode, + kWebSocket, + NOOP +} = require('./constants'); +const readyStates = ['CONNECTING', 'OPEN', 'CLOSING', 'CLOSED']; const protocolVersions = [8, 13]; -const closeTimeout = 30 * 1000; // Allow 30 seconds to terminate the connection cleanly. +const closeTimeout = 30 * 1000; /** * Class representing a WebSocket. @@ -32,76 +35,70 @@ class WebSocket extends EventEmitter { /** * Create a new `WebSocket`. * - * @param {String} address The URL to which to connect + * @param {(String|url.Url|url.URL)} address The URL to which to connect * @param {(String|String[])} protocols The subprotocols * @param {Object} options Connection options */ - constructor (address, protocols, options) { + constructor(address, protocols, options) { super(); - if (!protocols) { - protocols = []; - } else if (typeof protocols === 'string') { - protocols = [protocols]; - } else if (!Array.isArray(protocols)) { - options = protocols; - protocols = []; - } - this.readyState = WebSocket.CONNECTING; - this.bytesReceived = 0; - this.extensions = {}; this.protocol = ''; - this._binaryType = constants.BINARY_TYPES[0]; - this._finalize = this.finalize.bind(this); + this._binaryType = BINARY_TYPES[0]; this._closeFrameReceived = false; this._closeFrameSent = false; this._closeMessage = ''; this._closeTimer = null; - this._finalized = false; this._closeCode = 1006; + this._extensions = {}; this._receiver = null; this._sender = null; this._socket = null; - this._ultron = null; - if (Array.isArray(address)) { - initAsServerClient.call(this, address[0], address[1], options); + if (address !== null) { + this._isServer = false; + this._redirects = 0; + + if (Array.isArray(protocols)) { + protocols = protocols.join(', '); + } else if (typeof protocols === 'object' && protocols !== null) { + options = protocols; + protocols = undefined; + } + + initAsClient(this, address, protocols, options); } else { - initAsClient.call(this, address, protocols, options); + this._isServer = true; } } - get CONNECTING () { return WebSocket.CONNECTING; } - get CLOSING () { return WebSocket.CLOSING; } - get CLOSED () { return WebSocket.CLOSED; } - get OPEN () { return WebSocket.OPEN; } - - /** - * @type {Number} - */ - get bufferedAmount () { - var amount = 0; - - if (this._socket) { - amount = this._socket.bufferSize + this._sender._bufferedBytes; - } - return amount; + get CONNECTING() { + return WebSocket.CONNECTING; + } + get CLOSING() { + return WebSocket.CLOSING; + } + get CLOSED() { + return WebSocket.CLOSED; + } + get OPEN() { + return WebSocket.OPEN; } /** - * This deviates from the WHATWG interface since ws doesn't support the required - * default "blob" type (instead we define a custom "nodebuffer" type). + * This deviates from the WHATWG interface since ws doesn't support the + * required default "blob" type (instead we define a custom "nodebuffer" + * type). * * @type {String} */ - get binaryType () { + get binaryType() { return this._binaryType; } - set binaryType (type) { - if (constants.BINARY_TYPES.indexOf(type) < 0) return; + set binaryType(type) { + if (!BINARY_TYPES.includes(type)) return; this._binaryType = type; @@ -111,165 +108,113 @@ class WebSocket extends EventEmitter { if (this._receiver) this._receiver._binaryType = type; } + /** + * @type {Number} + */ + get bufferedAmount() { + if (!this._socket) return 0; + + // + // `socket.bufferSize` is `undefined` if the socket is closed. + // + return (this._socket.bufferSize || 0) + this._sender._bufferedBytes; + } + + /** + * @type {String} + */ + get extensions() { + return Object.keys(this._extensions).join(); + } + /** * Set up the socket and the internal resources. * * @param {net.Socket} socket The network socket between the server and client * @param {Buffer} head The first packet of the upgraded stream + * @param {Number} maxPayload The maximum allowed message size * @private */ - setSocket (socket, head) { + setSocket(socket, head, maxPayload) { + const receiver = new Receiver( + this._binaryType, + this._extensions, + maxPayload + ); + + this._sender = new Sender(socket, this._extensions); + this._receiver = receiver; + this._socket = socket; + + receiver[kWebSocket] = this; + socket[kWebSocket] = this; + + receiver.on('conclude', receiverOnConclude); + receiver.on('drain', receiverOnDrain); + receiver.on('error', receiverOnError); + receiver.on('message', receiverOnMessage); + receiver.on('ping', receiverOnPing); + receiver.on('pong', receiverOnPong); + socket.setTimeout(0); socket.setNoDelay(); - this._receiver = new Receiver(this.extensions, this._maxPayload, this.binaryType); - this._sender = new Sender(socket, this.extensions); - this._ultron = new Ultron(socket); - this._socket = socket; - - this._ultron.on('close', this._finalize); - this._ultron.on('error', this._finalize); - this._ultron.on('end', this._finalize); - if (head.length > 0) socket.unshift(head); - this._ultron.on('data', (data) => { - this.bytesReceived += data.length; - this._receiver.add(data); - }); - - this._receiver.onmessage = (data) => this.emit('message', data); - this._receiver.onping = (data) => { - this.pong(data, !this._isServer, true); - this.emit('ping', data); - }; - this._receiver.onpong = (data) => this.emit('pong', data); - this._receiver.onclose = (code, reason) => { - this._closeFrameReceived = true; - this._closeMessage = reason; - this._closeCode = code; - if (!this._finalized) this.close(code, reason); - }; - this._receiver.onerror = (error, code) => { - this._closeMessage = ''; - this._closeCode = code; - - // - // Ensure that the error is emitted even if `WebSocket#finalize()` has - // already been called. - // - this.readyState = WebSocket.CLOSING; - this.emit('error', error); - this.finalize(true); - }; + socket.on('close', socketOnClose); + socket.on('data', socketOnData); + socket.on('end', socketOnEnd); + socket.on('error', socketOnError); this.readyState = WebSocket.OPEN; this.emit('open'); } /** - * Clean up and release internal resources. - * - * @param {(Boolean|Error)} error Indicates whether or not an error occurred - * @private - */ - finalize (error) { - if (this._finalized) return; - - this.readyState = WebSocket.CLOSING; - this._finalized = true; - - if (typeof error === 'object') this.emit('error', error); - if (!this._socket) return this.emitClose(); - - clearTimeout(this._closeTimer); - this._closeTimer = null; - - this._ultron.destroy(); - this._ultron = null; - - this._socket.on('error', constants.NOOP); - - if (!error) this._socket.end(); - else this._socket.destroy(); - - this._socket = null; - this._sender = null; - - this._receiver.cleanup(() => this.emitClose()); - this._receiver = null; - } - - /** - * Emit the `close` event. + * Emit the `'close'` event. * * @private */ - emitClose () { + emitClose() { this.readyState = WebSocket.CLOSED; - this.emit('close', this._closeCode, this._closeMessage); - - if (this.extensions[PerMessageDeflate.extensionName]) { - this.extensions[PerMessageDeflate.extensionName].cleanup(); + if (!this._socket) { + this.emit('close', this._closeCode, this._closeMessage); + return; } - this.extensions = null; + if (this._extensions[PerMessageDeflate.extensionName]) { + this._extensions[PerMessageDeflate.extensionName].cleanup(); + } - this.removeAllListeners(); - } - - /** - * Pause the socket stream. - * - * @public - */ - pause () { - if (this.readyState !== WebSocket.OPEN) throw new Error('not opened'); - - this._socket.pause(); - } - - /** - * Resume the socket stream - * - * @public - */ - resume () { - if (this.readyState !== WebSocket.OPEN) throw new Error('not opened'); - - this._socket.resume(); + this._receiver.removeAllListeners(); + this.emit('close', this._closeCode, this._closeMessage); } /** * Start a closing handshake. * - * +----------+ +-----------+ +----------+ - * + - - -|ws.close()|---->|close frame|-->|ws.close()|- - - - - * +----------+ +-----------+ +----------+ | - * | +----------+ +-----------+ | - * |ws.close()|<----|close frame|<--------+ | - * +----------+ +-----------+ | - * CLOSING | +---+ | CLOSING - * | +---|fin|<------------+ - * | | | +---+ | - * | | +---+ +-------------+ - * | +----------+-->|fin|----->|ws.finalize()| - - + - * | +---+ +-------------+ - * | +-------------+ | - * - - -|ws.finalize()|<--+ - * +-------------+ + * +----------+ +-----------+ +----------+ + * - - -|ws.close()|-->|close frame|-->|ws.close()|- - - + * | +----------+ +-----------+ +----------+ | + * +----------+ +-----------+ | + * CLOSING |ws.close()|<--|close frame|<--+-----+ CLOSING + * +----------+ +-----------+ | + * | | | +---+ | + * +------------------------+-->|fin| - - - - + * | +---+ | +---+ + * - - - - -|fin|<---------------------+ + * +---+ * * @param {Number} code Status code explaining why the connection is closing * @param {String} data A string explaining why the connection is closing * @public */ - close (code, data) { + close(code, data) { if (this.readyState === WebSocket.CLOSED) return; if (this.readyState === WebSocket.CONNECTING) { - this._req.abort(); - this.finalize(new Error('closed before the connection is established')); - return; + const msg = 'WebSocket was closed before the connection was established'; + return abortHandshake(this, this._req, msg); } if (this.readyState === WebSocket.CLOSING) { @@ -286,55 +231,80 @@ class WebSocket extends EventEmitter { if (err) return; this._closeFrameSent = true; - - if (!this._finalized) { - if (this._closeFrameReceived) this._socket.end(); - - // - // Ensure that the connection is cleaned up even when the closing - // handshake fails. - // - this._closeTimer = setTimeout(this._finalize, closeTimeout, true); - } + if (this._closeFrameReceived) this._socket.end(); }); + + // + // Specify a timeout for the closing handshake to complete. + // + this._closeTimer = setTimeout( + this._socket.destroy.bind(this._socket), + closeTimeout + ); } /** - * Send a ping message. + * Send a ping. * - * @param {*} data The message to send + * @param {*} data The data to send * @param {Boolean} mask Indicates whether or not to mask `data` - * @param {Boolean} failSilently Indicates whether or not to throw if `readyState` isn't `OPEN` + * @param {Function} cb Callback which is executed when the ping is sent * @public */ - ping (data, mask, failSilently) { + ping(data, mask, cb) { + if (typeof data === 'function') { + cb = data; + data = mask = undefined; + } else if (typeof mask === 'function') { + cb = mask; + mask = undefined; + } + if (this.readyState !== WebSocket.OPEN) { - if (failSilently) return; - throw new Error('not opened'); + const err = new Error( + `WebSocket is not open: readyState ${this.readyState} ` + + `(${readyStates[this.readyState]})` + ); + + if (cb) return cb(err); + throw err; } if (typeof data === 'number') data = data.toString(); if (mask === undefined) mask = !this._isServer; - this._sender.ping(data || constants.EMPTY_BUFFER, mask); + this._sender.ping(data || EMPTY_BUFFER, mask, cb); } /** - * Send a pong message. + * Send a pong. * - * @param {*} data The message to send + * @param {*} data The data to send * @param {Boolean} mask Indicates whether or not to mask `data` - * @param {Boolean} failSilently Indicates whether or not to throw if `readyState` isn't `OPEN` + * @param {Function} cb Callback which is executed when the pong is sent * @public */ - pong (data, mask, failSilently) { + pong(data, mask, cb) { + if (typeof data === 'function') { + cb = data; + data = mask = undefined; + } else if (typeof mask === 'function') { + cb = mask; + mask = undefined; + } + if (this.readyState !== WebSocket.OPEN) { - if (failSilently) return; - throw new Error('not opened'); + const err = new Error( + `WebSocket is not open: readyState ${this.readyState} ` + + `(${readyStates[this.readyState]})` + ); + + if (cb) return cb(err); + throw err; } if (typeof data === 'number') data = data.toString(); if (mask === undefined) mask = !this._isServer; - this._sender.pong(data || constants.EMPTY_BUFFER, mask); + this._sender.pong(data || EMPTY_BUFFER, mask, cb); } /** @@ -349,32 +319,39 @@ class WebSocket extends EventEmitter { * @param {Function} cb Callback which is executed when data is written out * @public */ - send (data, options, cb) { + send(data, options, cb) { if (typeof options === 'function') { cb = options; options = {}; } if (this.readyState !== WebSocket.OPEN) { - if (cb) cb(new Error('not opened')); - else throw new Error('not opened'); - return; + const err = new Error( + `WebSocket is not open: readyState ${this.readyState} ` + + `(${readyStates[this.readyState]})` + ); + + if (cb) return cb(err); + throw err; } if (typeof data === 'number') data = data.toString(); - const opts = Object.assign({ - binary: typeof data !== 'string', - mask: !this._isServer, - compress: true, - fin: true - }, options); + const opts = Object.assign( + { + binary: typeof data !== 'string', + mask: !this._isServer, + compress: true, + fin: true + }, + options + ); - if (!this.extensions[PerMessageDeflate.extensionName]) { + if (!this._extensions[PerMessageDeflate.extensionName]) { opts.compress = false; } - this._sender.send(data || constants.EMPTY_BUFFER, opts, cb); + this._sender.send(data || EMPTY_BUFFER, opts, cb); } /** @@ -382,22 +359,23 @@ class WebSocket extends EventEmitter { * * @public */ - terminate () { + terminate() { if (this.readyState === WebSocket.CLOSED) return; if (this.readyState === WebSocket.CONNECTING) { - this._req.abort(); - this.finalize(new Error('closed before the connection is established')); - return; + const msg = 'WebSocket was closed before the connection was established'; + return abortHandshake(this, this._req, msg); } - this.finalize(true); + if (this._socket) { + this.readyState = WebSocket.CLOSING; + this._socket.destroy(); + } } } -WebSocket.CONNECTING = 0; -WebSocket.OPEN = 1; -WebSocket.CLOSING = 2; -WebSocket.CLOSED = 3; +readyStates.forEach((readyState, i) => { + WebSocket[readyState] = i; +}); // // Add the `onopen`, `onerror`, `onclose`, and `onmessage` attributes. @@ -411,11 +389,13 @@ WebSocket.CLOSED = 3; * @return {(Function|undefined)} The event listener or `undefined` * @public */ - get () { + get() { const listeners = this.listeners(method); for (var i = 0; i < listeners.length; i++) { if (listeners[i]._listener) return listeners[i]._listener; } + + return undefined; }, /** * Add a listener for the event. @@ -423,7 +403,7 @@ WebSocket.CLOSED = 3; * @param {Function} listener The listener to add * @public */ - set (listener) { + set(listener) { const listeners = this.listeners(method); for (var i = 0; i < listeners.length; i++) { // @@ -441,277 +421,475 @@ WebSocket.prototype.removeEventListener = EventTarget.removeEventListener; module.exports = WebSocket; -/** - * Initialize a WebSocket server client. - * - * @param {http.IncomingMessage} req The request object - * @param {net.Socket} socket The network socket between the server and client - * @param {Buffer} head The first packet of the upgraded stream - * @param {Object} options WebSocket attributes - * @param {Number} options.protocolVersion The WebSocket protocol version - * @param {Object} options.extensions The negotiated extensions - * @param {Number} options.maxPayload The maximum allowed message size - * @param {String} options.protocol The chosen subprotocol - * @private - */ -function initAsServerClient (socket, head, options) { - this.protocolVersion = options.protocolVersion; - this._maxPayload = options.maxPayload; - this.extensions = options.extensions; - this.protocol = options.protocol; - - this._isServer = true; - - this.setSocket(socket, head); -} - /** * Initialize a WebSocket client. * - * @param {String} address The URL to which to connect - * @param {String[]} protocols The list of subprotocols + * @param {WebSocket} websocket The client to initialize + * @param {(String|url.Url|url.URL)} address The URL to which to connect + * @param {String} protocols The subprotocols * @param {Object} options Connection options - * @param {String} options.protocol Value of the `Sec-WebSocket-Protocol` header - * @param {(Boolean|Object)} options.perMessageDeflate Enable/disable permessage-deflate - * @param {Number} options.handshakeTimeout Timeout in milliseconds for the handshake request - * @param {String} options.localAddress Local interface to bind for network connections - * @param {Number} options.protocolVersion Value of the `Sec-WebSocket-Version` header - * @param {Object} options.headers An object containing request headers - * @param {String} options.origin Value of the `Origin` or `Sec-WebSocket-Origin` header - * @param {http.Agent} options.agent Use the specified Agent - * @param {String} options.host Value of the `Host` header - * @param {Number} options.family IP address family to use during hostname lookup (4 or 6). - * @param {Function} options.checkServerIdentity A function to validate the server hostname - * @param {Boolean} options.rejectUnauthorized Verify or not the server certificate - * @param {String} options.passphrase The passphrase for the private key or pfx - * @param {String} options.ciphers The ciphers to use or exclude - * @param {String} options.ecdhCurve The curves for ECDH key agreement to use or exclude - * @param {(String|String[]|Buffer|Buffer[])} options.cert The certificate key - * @param {(String|String[]|Buffer|Buffer[])} options.key The private key - * @param {(String|Buffer)} options.pfx The private key, certificate, and CA certs - * @param {(String|String[]|Buffer|Buffer[])} options.ca Trusted certificates + * @param {(Boolean|Object)} options.perMessageDeflate Enable/disable + * permessage-deflate + * @param {Number} options.handshakeTimeout Timeout in milliseconds for the + * handshake request + * @param {Number} options.protocolVersion Value of the `Sec-WebSocket-Version` + * header + * @param {String} options.origin Value of the `Origin` or + * `Sec-WebSocket-Origin` header + * @param {Number} options.maxPayload The maximum allowed message size + * @param {Boolean} options.followRedirects Whether or not to follow redirects + * @param {Number} options.maxRedirects The maximum number of redirects allowed * @private */ -function initAsClient (address, protocols, options) { - options = Object.assign({ - protocolVersion: protocolVersions[1], - protocol: protocols.join(','), - perMessageDeflate: true, - handshakeTimeout: null, - localAddress: null, - headers: null, - family: null, - origin: null, - agent: null, - host: null, +function initAsClient(websocket, address, protocols, options) { + const opts = Object.assign( + { + protocolVersion: protocolVersions[1], + maxPayload: 100 * 1024 * 1024, + perMessageDeflate: true, + followRedirects: false, + maxRedirects: 10 + }, + options, + { + createConnection: undefined, + socketPath: undefined, + hostname: undefined, + protocol: undefined, + timeout: undefined, + method: undefined, + auth: undefined, + host: undefined, + path: undefined, + port: undefined + } + ); - // - // SSL options. - // - checkServerIdentity: null, - rejectUnauthorized: null, - passphrase: null, - ciphers: null, - ecdhCurve: null, - cert: null, - key: null, - pfx: null, - ca: null - }, options); - - if (protocolVersions.indexOf(options.protocolVersion) === -1) { - throw new Error( - `unsupported protocol version: ${options.protocolVersion} ` + - `(supported versions: ${protocolVersions.join(', ')})` + if (!protocolVersions.includes(opts.protocolVersion)) { + throw new RangeError( + `Unsupported protocol version: ${opts.protocolVersion} ` + + `(supported versions: ${protocolVersions.join(', ')})` ); } - this.protocolVersion = options.protocolVersion; - this._isServer = false; - this.url = address; + var parsedUrl; - const serverUrl = url.parse(address); - const isUnixSocket = serverUrl.protocol === 'ws+unix:'; - - if (!serverUrl.host && (!isUnixSocket || !serverUrl.path)) { - throw new Error('invalid url'); + if (typeof address === 'object' && address.href !== undefined) { + parsedUrl = address; + websocket.url = address.href; + } else { + // + // The WHATWG URL constructor is not available on Node.js < 6.13.0 + // + parsedUrl = url.URL ? new url.URL(address) : url.parse(address); + websocket.url = address; } - const isSecure = serverUrl.protocol === 'wss:' || serverUrl.protocol === 'https:'; + const isUnixSocket = parsedUrl.protocol === 'ws+unix:'; + + if (!parsedUrl.host && (!isUnixSocket || !parsedUrl.pathname)) { + throw new Error(`Invalid URL: ${websocket.url}`); + } + + const isSecure = + parsedUrl.protocol === 'wss:' || parsedUrl.protocol === 'https:'; + const defaultPort = isSecure ? 443 : 80; const key = crypto.randomBytes(16).toString('base64'); - const httpObj = isSecure ? https : http; + const get = isSecure ? https.get : http.get; + const path = parsedUrl.search + ? `${parsedUrl.pathname || '/'}${parsedUrl.search}` + : parsedUrl.pathname || '/'; var perMessageDeflate; - const requestOptions = { - port: serverUrl.port || (isSecure ? 443 : 80), - host: serverUrl.hostname, - path: '/', - headers: { - 'Sec-WebSocket-Version': options.protocolVersion, + opts.createConnection = isSecure ? tlsConnect : netConnect; + opts.defaultPort = opts.defaultPort || defaultPort; + opts.port = parsedUrl.port || defaultPort; + opts.host = parsedUrl.hostname.startsWith('[') + ? parsedUrl.hostname.slice(1, -1) + : parsedUrl.hostname; + opts.headers = Object.assign( + { + 'Sec-WebSocket-Version': opts.protocolVersion, 'Sec-WebSocket-Key': key, - 'Connection': 'Upgrade', - 'Upgrade': 'websocket' - } - }; + Connection: 'Upgrade', + Upgrade: 'websocket' + }, + opts.headers + ); + opts.path = path; + opts.timeout = opts.handshakeTimeout; - if (options.headers) Object.assign(requestOptions.headers, options.headers); - if (options.perMessageDeflate) { + if (opts.perMessageDeflate) { perMessageDeflate = new PerMessageDeflate( - options.perMessageDeflate !== true ? options.perMessageDeflate : {}, - false + opts.perMessageDeflate !== true ? opts.perMessageDeflate : {}, + false, + opts.maxPayload ); - requestOptions.headers['Sec-WebSocket-Extensions'] = Extensions.format({ + opts.headers['Sec-WebSocket-Extensions'] = extension.format({ [PerMessageDeflate.extensionName]: perMessageDeflate.offer() }); } - if (options.protocol) { - requestOptions.headers['Sec-WebSocket-Protocol'] = options.protocol; + if (protocols) { + opts.headers['Sec-WebSocket-Protocol'] = protocols; } - if (options.origin) { - if (options.protocolVersion < 13) { - requestOptions.headers['Sec-WebSocket-Origin'] = options.origin; + if (opts.origin) { + if (opts.protocolVersion < 13) { + opts.headers['Sec-WebSocket-Origin'] = opts.origin; } else { - requestOptions.headers.Origin = options.origin; + opts.headers.Origin = opts.origin; } } - if (options.host) requestOptions.headers.Host = options.host; - if (serverUrl.auth) requestOptions.auth = serverUrl.auth; - - if (options.localAddress) requestOptions.localAddress = options.localAddress; - if (options.family) requestOptions.family = options.family; + if (parsedUrl.auth) { + opts.auth = parsedUrl.auth; + } else if (parsedUrl.username || parsedUrl.password) { + opts.auth = `${parsedUrl.username}:${parsedUrl.password}`; + } if (isUnixSocket) { - const parts = serverUrl.path.split(':'); + const parts = path.split(':'); - requestOptions.socketPath = parts[0]; - requestOptions.path = parts[1]; - } else if (serverUrl.path) { - // - // Make sure that path starts with `/`. - // - if (serverUrl.path.charAt(0) !== '/') { - requestOptions.path = `/${serverUrl.path}`; - } else { - requestOptions.path = serverUrl.path; - } + opts.socketPath = parts[0]; + opts.path = parts[1]; } - var agent = options.agent; + var req = (websocket._req = get(opts)); - // - // A custom agent is required for these options. - // - if ( - options.rejectUnauthorized != null || - options.checkServerIdentity || - options.passphrase || - options.ciphers || - options.ecdhCurve || - options.cert || - options.key || - options.pfx || - options.ca - ) { - if (options.passphrase) requestOptions.passphrase = options.passphrase; - if (options.ciphers) requestOptions.ciphers = options.ciphers; - if (options.ecdhCurve) requestOptions.ecdhCurve = options.ecdhCurve; - if (options.cert) requestOptions.cert = options.cert; - if (options.key) requestOptions.key = options.key; - if (options.pfx) requestOptions.pfx = options.pfx; - if (options.ca) requestOptions.ca = options.ca; - if (options.checkServerIdentity) { - requestOptions.checkServerIdentity = options.checkServerIdentity; - } - if (options.rejectUnauthorized != null) { - requestOptions.rejectUnauthorized = options.rejectUnauthorized; - } - - if (!agent) agent = new httpObj.Agent(requestOptions); - } - - if (agent) requestOptions.agent = agent; - - this._req = httpObj.get(requestOptions); - - if (options.handshakeTimeout) { - this._req.setTimeout(options.handshakeTimeout, () => { - this._req.abort(); - this.finalize(new Error('opening handshake has timed out')); + if (opts.timeout) { + req.on('timeout', () => { + abortHandshake(websocket, req, 'Opening handshake has timed out'); }); } - this._req.on('error', (error) => { - if (this._req.aborted) return; + req.on('error', (err) => { + if (websocket._req.aborted) return; - this._req = null; - this.finalize(error); + req = websocket._req = null; + websocket.readyState = WebSocket.CLOSING; + websocket.emit('error', err); + websocket.emitClose(); }); - this._req.on('response', (res) => { - if (!this.emit('unexpected-response', this._req, res)) { - this._req.abort(); - this.finalize(new Error(`unexpected server response (${res.statusCode})`)); + req.on('response', (res) => { + const location = res.headers.location; + const statusCode = res.statusCode; + + if ( + location && + opts.followRedirects && + statusCode >= 300 && + statusCode < 400 + ) { + if (++websocket._redirects > opts.maxRedirects) { + abortHandshake(websocket, req, 'Maximum redirects exceeded'); + return; + } + + req.abort(); + + const addr = url.URL + ? new url.URL(location, address) + : url.resolve(address, location); + + initAsClient(websocket, addr, protocols, options); + } else if (!websocket.emit('unexpected-response', req, res)) { + abortHandshake( + websocket, + req, + `Unexpected server response: ${res.statusCode}` + ); } }); - this._req.on('upgrade', (res, socket, head) => { - this.emit('headers', res.headers, res); + req.on('upgrade', (res, socket, head) => { + websocket.emit('upgrade', res); // - // The user may have closed the connection from a listener of the `headers` + // The user may have closed the connection from a listener of the `upgrade` // event. // - if (this.readyState !== WebSocket.CONNECTING) return; + if (websocket.readyState !== WebSocket.CONNECTING) return; - this._req = null; + req = websocket._req = null; - const digest = crypto.createHash('sha1') - .update(key + constants.GUID, 'binary') + const digest = crypto + .createHash('sha1') + .update(key + GUID) .digest('base64'); if (res.headers['sec-websocket-accept'] !== digest) { - socket.destroy(); - return this.finalize(new Error('invalid server key')); + abortHandshake(websocket, socket, 'Invalid Sec-WebSocket-Accept header'); + return; } const serverProt = res.headers['sec-websocket-protocol']; - const protList = (options.protocol || '').split(/, */); + const protList = (protocols || '').split(/, */); var protError; - if (!options.protocol && serverProt) { - protError = 'server sent a subprotocol even though none requested'; - } else if (options.protocol && !serverProt) { - protError = 'server sent no subprotocol even though requested'; - } else if (serverProt && protList.indexOf(serverProt) === -1) { - protError = 'server responded with an invalid protocol'; + if (!protocols && serverProt) { + protError = 'Server sent a subprotocol but none was requested'; + } else if (protocols && !serverProt) { + protError = 'Server sent no subprotocol'; + } else if (serverProt && !protList.includes(serverProt)) { + protError = 'Server sent an invalid subprotocol'; } if (protError) { - socket.destroy(); - return this.finalize(new Error(protError)); + abortHandshake(websocket, socket, protError); + return; } - if (serverProt) this.protocol = serverProt; + if (serverProt) websocket.protocol = serverProt; if (perMessageDeflate) { try { - const serverExtensions = Extensions.parse( + const extensions = extension.parse( res.headers['sec-websocket-extensions'] ); - if (serverExtensions[PerMessageDeflate.extensionName]) { - perMessageDeflate.accept( - serverExtensions[PerMessageDeflate.extensionName] - ); - this.extensions[PerMessageDeflate.extensionName] = perMessageDeflate; + if (extensions[PerMessageDeflate.extensionName]) { + perMessageDeflate.accept(extensions[PerMessageDeflate.extensionName]); + websocket._extensions[ + PerMessageDeflate.extensionName + ] = perMessageDeflate; } } catch (err) { - socket.destroy(); - this.finalize(new Error('invalid Sec-WebSocket-Extensions header')); + abortHandshake( + websocket, + socket, + 'Invalid Sec-WebSocket-Extensions header' + ); return; } } - this.setSocket(socket, head); + websocket.setSocket(socket, head, opts.maxPayload); }); } + +/** + * Create a `net.Socket` and initiate a connection. + * + * @param {Object} options Connection options + * @return {net.Socket} The newly created socket used to start the connection + * @private + */ +function netConnect(options) { + // + // Override `options.path` only if `options` is a copy of the original options + // object. This is always true on Node.js >= 8 but not on Node.js 6 where + // `options.socketPath` might be `undefined` even if the `socketPath` option + // was originally set. + // + if (options.protocolVersion) options.path = options.socketPath; + return net.connect(options); +} + +/** + * Create a `tls.TLSSocket` and initiate a connection. + * + * @param {Object} options Connection options + * @return {tls.TLSSocket} The newly created socket used to start the connection + * @private + */ +function tlsConnect(options) { + options.path = undefined; + options.servername = options.servername || options.host; + return tls.connect(options); +} + +/** + * Abort the handshake and emit an error. + * + * @param {WebSocket} websocket The WebSocket instance + * @param {(http.ClientRequest|net.Socket)} stream The request to abort or the + * socket to destroy + * @param {String} message The error message + * @private + */ +function abortHandshake(websocket, stream, message) { + websocket.readyState = WebSocket.CLOSING; + + const err = new Error(message); + Error.captureStackTrace(err, abortHandshake); + + if (stream.setHeader) { + stream.abort(); + stream.once('abort', websocket.emitClose.bind(websocket)); + websocket.emit('error', err); + } else { + stream.destroy(err); + stream.once('error', websocket.emit.bind(websocket, 'error')); + stream.once('close', websocket.emitClose.bind(websocket)); + } +} + +/** + * The listener of the `Receiver` `'conclude'` event. + * + * @param {Number} code The status code + * @param {String} reason The reason for closing + * @private + */ +function receiverOnConclude(code, reason) { + const websocket = this[kWebSocket]; + + websocket._socket.removeListener('data', socketOnData); + websocket._socket.resume(); + + websocket._closeFrameReceived = true; + websocket._closeMessage = reason; + websocket._closeCode = code; + + if (code === 1005) websocket.close(); + else websocket.close(code, reason); +} + +/** + * The listener of the `Receiver` `'drain'` event. + * + * @private + */ +function receiverOnDrain() { + this[kWebSocket]._socket.resume(); +} + +/** + * The listener of the `Receiver` `'error'` event. + * + * @param {(RangeError|Error)} err The emitted error + * @private + */ +function receiverOnError(err) { + const websocket = this[kWebSocket]; + + websocket._socket.removeListener('data', socketOnData); + + websocket.readyState = WebSocket.CLOSING; + websocket._closeCode = err[kStatusCode]; + websocket.emit('error', err); + websocket._socket.destroy(); +} + +/** + * The listener of the `Receiver` `'finish'` event. + * + * @private + */ +function receiverOnFinish() { + this[kWebSocket].emitClose(); +} + +/** + * The listener of the `Receiver` `'message'` event. + * + * @param {(String|Buffer|ArrayBuffer|Buffer[])} data The message + * @private + */ +function receiverOnMessage(data) { + this[kWebSocket].emit('message', data); +} + +/** + * The listener of the `Receiver` `'ping'` event. + * + * @param {Buffer} data The data included in the ping frame + * @private + */ +function receiverOnPing(data) { + const websocket = this[kWebSocket]; + + websocket.pong(data, !websocket._isServer, NOOP); + websocket.emit('ping', data); +} + +/** + * The listener of the `Receiver` `'pong'` event. + * + * @param {Buffer} data The data included in the pong frame + * @private + */ +function receiverOnPong(data) { + this[kWebSocket].emit('pong', data); +} + +/** + * The listener of the `net.Socket` `'close'` event. + * + * @private + */ +function socketOnClose() { + const websocket = this[kWebSocket]; + + this.removeListener('close', socketOnClose); + this.removeListener('end', socketOnEnd); + + websocket.readyState = WebSocket.CLOSING; + + // + // The close frame might not have been received or the `'end'` event emitted, + // for example, if the socket was destroyed due to an error. Ensure that the + // `receiver` stream is closed after writing any remaining buffered data to + // it. If the readable side of the socket is in flowing mode then there is no + // buffered data as everything has been already written and `readable.read()` + // will return `null`. If instead, the socket is paused, any possible buffered + // data will be read as a single chunk and emitted synchronously in a single + // `'data'` event. + // + websocket._socket.read(); + websocket._receiver.end(); + + this.removeListener('data', socketOnData); + this[kWebSocket] = undefined; + + clearTimeout(websocket._closeTimer); + + if ( + websocket._receiver._writableState.finished || + websocket._receiver._writableState.errorEmitted + ) { + websocket.emitClose(); + } else { + websocket._receiver.on('error', receiverOnFinish); + websocket._receiver.on('finish', receiverOnFinish); + } +} + +/** + * The listener of the `net.Socket` `'data'` event. + * + * @param {Buffer} chunk A chunk of data + * @private + */ +function socketOnData(chunk) { + if (!this[kWebSocket]._receiver.write(chunk)) { + this.pause(); + } +} + +/** + * The listener of the `net.Socket` `'end'` event. + * + * @private + */ +function socketOnEnd() { + const websocket = this[kWebSocket]; + + websocket.readyState = WebSocket.CLOSING; + websocket._receiver.end(); + this.end(); +} + +/** + * The listener of the `net.Socket` `'error'` event. + * + * @private + */ +function socketOnError() { + const websocket = this[kWebSocket]; + + this.removeListener('error', socketOnError); + this.on('error', NOOP); + + websocket.readyState = WebSocket.CLOSING; + this.destroy(); +} diff --git a/node_modules/ws/lib/WebSocketServer.js b/node_modules/ws/lib/WebSocketServer.js deleted file mode 100644 index 8ebd6bf..0000000 --- a/node_modules/ws/lib/WebSocketServer.js +++ /dev/null @@ -1,326 +0,0 @@ -/*! - * ws: a node.js websocket client - * Copyright(c) 2011 Einar Otto Stangvik - * MIT Licensed - */ - -'use strict'; - -const safeBuffer = require('safe-buffer'); -const EventEmitter = require('events'); -const crypto = require('crypto'); -const Ultron = require('ultron'); -const http = require('http'); -const url = require('url'); - -const PerMessageDeflate = require('./PerMessageDeflate'); -const Extensions = require('./Extensions'); -const constants = require('./Constants'); -const WebSocket = require('./WebSocket'); - -const Buffer = safeBuffer.Buffer; - -/** - * Class representing a WebSocket server. - * - * @extends EventEmitter - */ -class WebSocketServer extends EventEmitter { - /** - * Create a `WebSocketServer` instance. - * - * @param {Object} options Configuration options - * @param {String} options.host The hostname where to bind the server - * @param {Number} options.port The port where to bind the server - * @param {http.Server} options.server A pre-created HTTP/S server to use - * @param {Function} options.verifyClient An hook to reject connections - * @param {Function} options.handleProtocols An hook to handle protocols - * @param {String} options.path Accept only connections matching this path - * @param {Boolean} options.noServer Enable no server mode - * @param {Boolean} options.clientTracking Specifies whether or not to track clients - * @param {(Boolean|Object)} options.perMessageDeflate Enable/disable permessage-deflate - * @param {Number} options.maxPayload The maximum allowed message size - * @param {Function} callback A listener for the `listening` event - */ - constructor (options, callback) { - super(); - - options = Object.assign({ - maxPayload: 100 * 1024 * 1024, - perMessageDeflate: false, - handleProtocols: null, - clientTracking: true, - verifyClient: null, - noServer: false, - backlog: null, // use default (511 as implemented in net.js) - server: null, - host: null, - path: null, - port: null - }, options); - - if (options.port == null && !options.server && !options.noServer) { - throw new TypeError('missing or invalid options'); - } - - if (options.port != null) { - this._server = http.createServer((req, res) => { - const body = http.STATUS_CODES[426]; - - res.writeHead(426, { - 'Content-Length': body.length, - 'Content-Type': 'text/plain' - }); - res.end(body); - }); - this._server.listen(options.port, options.host, options.backlog, callback); - } else if (options.server) { - this._server = options.server; - } - - if (this._server) { - this._ultron = new Ultron(this._server); - this._ultron.on('listening', () => this.emit('listening')); - this._ultron.on('error', (err) => this.emit('error', err)); - this._ultron.on('upgrade', (req, socket, head) => { - this.handleUpgrade(req, socket, head, (client) => { - this.emit('connection', client, req); - }); - }); - } - - if (options.perMessageDeflate === true) options.perMessageDeflate = {}; - if (options.clientTracking) this.clients = new Set(); - this.options = options; - } - - /** - * Close the server. - * - * @param {Function} cb Callback - * @public - */ - close (cb) { - // - // Terminate all associated clients. - // - if (this.clients) { - for (const client of this.clients) client.terminate(); - } - - const server = this._server; - - if (server) { - this._ultron.destroy(); - this._ultron = this._server = null; - - // - // Close the http server if it was internally created. - // - if (this.options.port != null) return server.close(cb); - } - - if (cb) cb(); - } - - /** - * See if a given request should be handled by this server instance. - * - * @param {http.IncomingMessage} req Request object to inspect - * @return {Boolean} `true` if the request is valid, else `false` - * @public - */ - shouldHandle (req) { - if (this.options.path && url.parse(req.url).pathname !== this.options.path) { - return false; - } - - return true; - } - - /** - * Handle a HTTP Upgrade request. - * - * @param {http.IncomingMessage} req The request object - * @param {net.Socket} socket The network socket between the server and client - * @param {Buffer} head The first packet of the upgraded stream - * @param {Function} cb Callback - * @public - */ - handleUpgrade (req, socket, head, cb) { - socket.on('error', socketError); - - const version = +req.headers['sec-websocket-version']; - const extensions = {}; - - if ( - req.method !== 'GET' || req.headers.upgrade.toLowerCase() !== 'websocket' || - !req.headers['sec-websocket-key'] || (version !== 8 && version !== 13) || - !this.shouldHandle(req) - ) { - return abortConnection(socket, 400); - } - - if (this.options.perMessageDeflate) { - const perMessageDeflate = new PerMessageDeflate( - this.options.perMessageDeflate, - true, - this.options.maxPayload - ); - - try { - const offers = Extensions.parse( - req.headers['sec-websocket-extensions'] - ); - - if (offers[PerMessageDeflate.extensionName]) { - perMessageDeflate.accept(offers[PerMessageDeflate.extensionName]); - extensions[PerMessageDeflate.extensionName] = perMessageDeflate; - } - } catch (err) { - return abortConnection(socket, 400); - } - } - - var protocol = (req.headers['sec-websocket-protocol'] || '').split(/, */); - - // - // Optionally call external protocol selection handler. - // - if (this.options.handleProtocols) { - protocol = this.options.handleProtocols(protocol, req); - if (protocol === false) return abortConnection(socket, 401); - } else { - protocol = protocol[0]; - } - - // - // Optionally call external client verification handler. - // - if (this.options.verifyClient) { - const info = { - origin: req.headers[`${version === 8 ? 'sec-websocket-origin' : 'origin'}`], - secure: !!(req.connection.authorized || req.connection.encrypted), - req - }; - - if (this.options.verifyClient.length === 2) { - this.options.verifyClient(info, (verified, code, message) => { - if (!verified) return abortConnection(socket, code || 401, message); - - this.completeUpgrade( - protocol, - extensions, - version, - req, - socket, - head, - cb - ); - }); - return; - } - - if (!this.options.verifyClient(info)) return abortConnection(socket, 401); - } - - this.completeUpgrade(protocol, extensions, version, req, socket, head, cb); - } - - /** - * Upgrade the connection to WebSocket. - * - * @param {String} protocol The chosen subprotocol - * @param {Object} extensions The accepted extensions - * @param {Number} version The WebSocket protocol version - * @param {http.IncomingMessage} req The request object - * @param {net.Socket} socket The network socket between the server and client - * @param {Buffer} head The first packet of the upgraded stream - * @param {Function} cb Callback - * @private - */ - completeUpgrade (protocol, extensions, version, req, socket, head, cb) { - // - // Destroy the socket if the client has already sent a FIN packet. - // - if (!socket.readable || !socket.writable) return socket.destroy(); - - const key = crypto.createHash('sha1') - .update(req.headers['sec-websocket-key'] + constants.GUID, 'binary') - .digest('base64'); - - const headers = [ - 'HTTP/1.1 101 Switching Protocols', - 'Upgrade: websocket', - 'Connection: Upgrade', - `Sec-WebSocket-Accept: ${key}` - ]; - - if (protocol) headers.push(`Sec-WebSocket-Protocol: ${protocol}`); - if (extensions[PerMessageDeflate.extensionName]) { - const params = extensions[PerMessageDeflate.extensionName].params; - const value = Extensions.format({ - [PerMessageDeflate.extensionName]: [params] - }); - headers.push(`Sec-WebSocket-Extensions: ${value}`); - } - - // - // Allow external modification/inspection of handshake headers. - // - this.emit('headers', headers, req); - - socket.write(headers.concat('\r\n').join('\r\n')); - - const client = new WebSocket([socket, head], null, { - maxPayload: this.options.maxPayload, - protocolVersion: version, - extensions, - protocol - }); - - if (this.clients) { - this.clients.add(client); - client.on('close', () => this.clients.delete(client)); - } - - socket.removeListener('error', socketError); - cb(client); - } -} - -module.exports = WebSocketServer; - -/** - * Handle premature socket errors. - * - * @private - */ -function socketError () { - this.destroy(); -} - -/** - * Close the connection when preconditions are not fulfilled. - * - * @param {net.Socket} socket The socket of the upgrade request - * @param {Number} code The HTTP response status code - * @param {String} [message] The HTTP response body - * @private - */ -function abortConnection (socket, code, message) { - if (socket.writable) { - message = message || http.STATUS_CODES[code]; - socket.write( - `HTTP/1.1 ${code} ${http.STATUS_CODES[code]}\r\n` + - 'Connection: close\r\n' + - 'Content-type: text/html\r\n' + - `Content-Length: ${Buffer.byteLength(message)}\r\n` + - '\r\n' + - message - ); - } - - socket.removeListener('error', socketError); - socket.destroy(); -} diff --git a/node_modules/ws/package.json b/node_modules/ws/package.json index 96d0cb3..5492084 100644 --- a/node_modules/ws/package.json +++ b/node_modules/ws/package.json @@ -1,6 +1,6 @@ { "name": "ws", - "version": "3.3.3", + "version": "6.2.3", "description": "Simple to use, blazing fast and thoroughly tested websocket client and server for Node.js", "keywords": [ "HyBi", @@ -16,31 +16,30 @@ "author": "Einar Otto Stangvik (http://2x.io)", "license": "MIT", "main": "index.js", + "browser": "browser.js", "files": [ + "browser.js", "index.js", - "lib" + "lib/*.js" ], "scripts": { - "test": "eslint . && nyc --reporter=html --reporter=text mocha test/*.test.js", - "integration": "eslint . && mocha test/*.integration.js", - "lint": "eslint ." + "test": "npm run lint && nyc --reporter=html --reporter=text mocha test/*.test.js", + "integration": "npm run lint && mocha test/*.integration.js", + "lint": "eslint --ignore-path .gitignore . && prettier --check --ignore-path .gitignore \"**/*.{json,md,yml}\"" }, "dependencies": { - "async-limiter": "~1.0.0", - "safe-buffer": "~5.1.0", - "ultron": "~1.1.0" + "async-limiter": "~1.0.0" }, "devDependencies": { - "benchmark": "~2.1.2", - "bufferutil": "~3.0.0", - "eslint": "~4.13.0", - "eslint-config-standard": "~10.2.0", - "eslint-plugin-import": "~2.8.0", - "eslint-plugin-node": "~5.2.0", - "eslint-plugin-promise": "~3.6.0", - "eslint-plugin-standard": "~3.0.0", - "mocha": "~4.0.0", - "nyc": "~11.3.0", - "utf-8-validate": "~4.0.0" + "benchmark": "~2.1.4", + "bufferutil": "~4.0.0", + "coveralls": "~3.0.3", + "eslint": "~5.15.0", + "eslint-config-prettier": "~4.1.0", + "eslint-plugin-prettier": "~3.0.0", + "mocha": "~6.0.0", + "nyc": "~13.3.0", + "prettier": "~1.16.1", + "utf-8-validate": "~5.0.0" } } diff --git a/package.json b/package.json index 60976b0..b7ab468 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "dependencies": { "jsencrypt": "^3.3.2", "moment": "^2.30.1", - "mqtt": "^3.0.0", + "mqtt": "^2.18.8", "vue-i18n": "^9.13.1" }, "scripts": { diff --git a/pagesA/home/device/status/index.vue b/pagesA/home/device/status/index.vue index c809518..57fdb84 100644 --- a/pagesA/home/device/status/index.vue +++ b/pagesA/home/device/status/index.vue @@ -13,7 +13,7 @@ + v-if="current==1 && !isRelayProduct && !isVoiceProduct && !isGatewayProduct&&!isdisplay"> @@ -61,15 +61,17 @@ }, watch: { // 兼容小程序 - device: function(newVal, oldVal) { - this.deviceInfo = newVal; - this.isSubDev = newVal.subDeviceList && newVal.subDeviceList.length > 0; - this.isRelayProduct = newVal.productName === '多路控制器'; - this.isVoiceProduct = newVal.productName === '声卡'; - this.isGatewayProduct = newVal.productName === '网关'; - this.isdisplay = newVal.productName === '显卡设置'; - - + device: { + handler(newVal) { + this.deviceInfo = newVal; + this.isSubDev = newVal.subDeviceList && newVal.subDeviceList.length > 0; + this.isRelayProduct = newVal.productName === '多路控制器'; + this.isVoiceProduct = newVal.productName === '声卡'; + this.isGatewayProduct = newVal.productName === '网关'; + this.isdisplay = newVal.productName === '显卡设置'; + }, + immediate: true, + deep: true } }, data() { @@ -91,7 +93,7 @@ this.deviceInfo = this.device; this.isSubDev = this.device.subDeviceList.length > 0; } - this.isRelayProduct = this.device.productName === '继电器测试'; + this.isRelayProduct = this.device.productName === '多路控制器'; this.isVoiceProduct = this.device.productName === '声卡'; this.isGatewayProduct = this.device.productName === '网关卡兼容'; this.isdisplay = this.device.productName === '显卡设置'; diff --git a/pagesA/home/device/status/relay.vue b/pagesA/home/device/status/relay.vue index 14dfc50..3708096 100644 --- a/pagesA/home/device/status/relay.vue +++ b/pagesA/home/device/status/relay.vue @@ -453,6 +453,7 @@ // mqtt回调 /* Mqtt回调处理 */ mqttCallback() { + console.log("mqttCallback") this.$mqttTool.client.on('message', (topic, message, buffer) => { let topics = topic.split('/'); let productId = topics[1]; @@ -475,7 +476,7 @@ else if (topics[3] == 'property' || topics[3] == 'function' || topic.endsWith('ws/service')) { console.log(' 接收到【物模型】主题:', topic); console.log(' 接收到【物模型】内容:', JSON.stringify(message)); - + console.log("message.message") // 更新继电器状态 if (Array.isArray(message.message)) { message.message.forEach(item => { diff --git a/pagesA/home/device/status/voice.vue b/pagesA/home/device/status/voice.vue index 630a982..a748743 100644 --- a/pagesA/home/device/status/voice.vue +++ b/pagesA/home/device/status/voice.vue @@ -46,8 +46,12 @@ 音频开关 - + @@ -103,8 +107,12 @@ - + @@ -298,24 +306,24 @@ required: true } }, - watch: { - device: function(newVal, oldVal) { - console.log("newVal", newVal) - if (newVal.deviceName !== '') { - this.deviceInfo = newVal; - if (this.deviceInfo.deviceType != 3) { - this.operateList = this.deviceInfo.thingsModels && this.deviceInfo.thingsModels.filter(( - item) => item.isReadonly == '0'); - this.attributeList = this.deviceInfo.thingsModels && this.deviceInfo.thingsModels.filter(( - item) => item.isReadonly == '1'); - this.attributeList = this.attributeList.sort((a, b) => b.order - a.order); - this.operateList = this.operateList.sort((a, b) => b.order - a.order); - } - this.updateDeviceStatus(this.deviceInfo); - this.updateBasicSettings(); - } - } - }, + // watch: { + // device: function(newVal, oldVal) { + // console.log("newVal", newVal) + // if (newVal.deviceName !== '') { + // this.deviceInfo = newVal; + // if (this.deviceInfo.deviceType != 3) { + // this.operateList = this.deviceInfo.thingsModels && this.deviceInfo.thingsModels.filter(( + // item) => item.isReadonly == '0'); + // this.attributeList = this.deviceInfo.thingsModels && this.deviceInfo.thingsModels.filter(( + // item) => item.isReadonly == '1'); + // this.attributeList = this.attributeList.sort((a, b) => b.order - a.order); + // this.operateList = this.operateList.sort((a, b) => b.order - a.order); + // } + // this.updateDeviceStatus(this.deviceInfo); + // this.updateBasicSettings(); + // } + // } + // }, data() { return { title: '设备离线', @@ -508,89 +516,198 @@ }); } }, - mqttCallback() { + /* Mqtt回调处理 */ + mqttCallback() { this.$mqttTool.client.on('message', (topic, message, buffer) => { let topics = topic.split('/'); let productId = topics[1]; let deviceNum = topics[2]; message = JSON.parse(message.toString()); - // 只处理当前设备 - if (this.deviceInfo.serialNumber !== deviceNum) return; - if (topics[3] == 'status') { - this.deviceInfo.status = message.status; - this.deviceInfo.isShadow = message.isShadow; - this.deviceInfo.rssi = message.rssi; - this.deviceInfo = Object.assign({}, this.deviceInfo); - this.updateDeviceStatus(this.deviceInfo); - this.updateBasicSettings(); - this.$forceUpdate(); + console.log('接收到【设备状态-运行】主题:', topic); + console.log('接收到【设备状态-运行】内容:', message); + // 更新列表中设备的状态 + if (this.deviceInfo.serialNumber == deviceNum) { + this.deviceInfo.status = message.status; + this.deviceInfo.isShadow = message.isShadow; + this.deviceInfo.rssi = message.rssi; + this.updateDeviceStatus(this.deviceInfo); + } } + //兼容设备回复 if (topics[4] == 'reply') { uni.showToast({ icon: 'none', title: message, }) } - if (topics[3] == 'property' || topics[3] == 'function' || topic.endsWith('ws/service')) { - if (Array.isArray(message.message)) { - let mp3ListChanged = false; - let playListChanged = false; - message.message.forEach(item => { - if (item.id === '103#mp3List') mp3ListChanged = true; - if (item.id === '103#playList') playListChanged = true; - // 你可以在这里补充其他针对性属性的处理 - }); - if (mp3ListChanged) { - const mp3ListModel = this.deviceInfo.thingsModels.find(model => model.id === '103#mp3List'); - if (mp3ListModel && mp3ListModel.shadow) { - try { - const jsonStr = mp3ListModel.shadow.replace('JSON=', ''); - const data = JSON.parse(jsonStr); - if (data && data.mp3_list) { - this.audioList = data.mp3_list.map((item, index) => { - const [id, ...nameArr] = item.split('_'); - const name = nameArr.join('_') || item; - return { - id: Number(id), - name: name, - filename: item - }; - }); - this.audioList = [...this.audioList]; + if (topics[3] == 'property' || topics[3] == 'function' || topic.endsWith( + 'ws/service')) { + console.log('接收到【物模型】主题:', topic); + console.log('接收到【物模型】内容:', message); + // 更新列表中设备的属性 + if (this.deviceInfo.serialNumber == deviceNum) { + for (let j = 0; j < message.message.length; j++) { + let isComplete = false; + // 设备状态 + for (let k = 0; k < this.deviceInfo.thingsModels.length && ! + isComplete; k++) { + if (this.deviceInfo.thingsModels[k].id == message.message[j].id) { + // 普通类型 + this.deviceInfo.thingsModels[k].shadow = message.message[j].value; + isComplete = true; + break; + } else if (this.deviceInfo.thingsModels[k].datatype.type == + "object") { + // 对象类型 + for (let n = 0; n < this.deviceInfo.thingsModels[k] + .datatype.params + .length; n++) { + if (this.deviceInfo.thingsModels[k].datatype.params[n] + .id == message.message[j] + .id) { + this.deviceInfo.thingsModels[k].datatype.params[n] + .shadow = + message.message[j].value; + isComplete = true; + break; + } } - } catch (error) { - console.error('解析音频列表失败:', error); - } - } - } - if (playListChanged) { - const playListModel = this.deviceInfo.thingsModels.find(model => model.id === '103#playList'); - if (playListModel && playListModel.shadow) { - try { - const jsonStr = playListModel.shadow.replace('JSON=', ''); - const data = JSON.parse(jsonStr); - if (data && data.play_list) { - this.defaultList = data.play_list.map((item, index) => { - const beginTime = this.formatSecondsToTime(item.time.begin); - const endTime = this.formatSecondsToTime(item.time.end); - const weekdays = this.convertWeekToArray(item.time.week); - return { - id: index + 1, - name: item.play.filename, - playTime: `${beginTime} - ${endTime}`, - weekdays: weekdays.join(', '), - radarEnabled: item.speed.en === 1, - status: item.play.en === 1 ? '启用' : '禁用', - radarSpeed: item.speed.en === 1 ? `${item.speed.min}-${item.speed.max}km/h` : '' - }; - }); - this.defaultList = [...this.defaultList]; + } else if (this.deviceInfo.thingsModels[k].datatype.type == + "array") { + // 数组类型 + if (this.deviceInfo.thingsModels[k].datatype.arrayType == + "object") { + // 1.对象类型数组,id为数组中一个元素,例如:array_01_gateway_temperature + if (String(message.message[j].id).indexOf("array_") == 0) { + for (let n = 0; n < this.deviceInfo.thingsModels[k] + .datatype + .arrayParams.length; n++) { + for (let m = 0; m < this.deviceInfo + .thingsModels[k].datatype + .arrayParams[n].length; m++) { + if (this.deviceInfo.thingsModels[k] + .datatype.arrayParams[n] + [m].id == message.message[j].id) { + this.deviceInfo.thingsModels[k] + .datatype.arrayParams[n] + [m].shadow = message.message[j].value; + isComplete = true; + break; + } + } + if (isComplete) { + break; + } + } + } else { + // 2.对象类型数组,例如:gateway_temperature,消息ID添加前缀后匹配 + for (let n = 0; n < this.deviceInfo.thingsModels[k] + .datatype + .arrayParams.length; n++) { + for (let m = 0; m < this.deviceInfo + .thingsModels[k].datatype + .arrayParams[n].length; m++) { + let index = n > 9 ? String(n) : '0' + k; + let prefix = 'array_' + index + '_'; + if (this.deviceInfo.thingsModels[k] + .datatype.arrayParams[n] + [m].id == prefix + message.message[j].id) { + this.deviceInfo.thingsModels[k] + .datatype.arrayParams[n] + [m].shadow = message.message[j].value; + isComplete = true; + } + } + if (isComplete) { + break; + } + } + } + } else { + // 整数、小数和字符串类型数组 + for (let n = 0; n < this.deviceInfo.thingsModels[k] + .datatype.arrayModel + .length; n++) { + if (this.deviceInfo.thingsModels[k].datatype + .arrayModel[n].id == + message.message[j].id) { + this.deviceInfo.thingsModels[k].datatype + .arrayModel[n].shadow = + message.message[j].value; + isComplete = true; + break; + } + } } - } catch (error) { - console.error('解析播放列表失败:', error); } - } + }; + // 监测数据 + for (let k = 0; k < this.deviceInfo.chartList.length && ! + isComplete; k++) { + if (this.deviceInfo.chartList[k].id.indexOf("array_") == 0) { + // 数组类型匹配,例如:array_00_gateway_temperature + if (this.deviceInfo.chartList[k].id == message.message[j].id) { + // let shadows = message[j].value.split(","); + this.deviceInfo.chartList[k].shadow = message.message[j].value; + // 更新图表 + for (let m = 0; m < this.monitorChart.length; m++) { + if (this.deviceInfo.chartList[k].id == this + .monitorChart[m].id) { + // uchart中data取值范围0-1,需要最小数+监测值,然后除于区间值 + let value = (Number(message.message[j].value) + Math + .abs(this + .deviceInfo.chartList[k].datatype + .min)) / (Math.abs( + this.deviceInfo.chartList[k] + .datatype.min) + Math + .abs(this.deviceInfo.chartList[k] + .datatype.max)); + this.monitorChart[m].data.series[0].data = + value; + this.monitorChart[m].opts.title.name = message.message[ + j].value + ' ' + + this.deviceInfo.chartList[k].datatype.unit; + break; + } + } + isComplete = true; + break; + } + } else { + // 普通类型匹配 + if (this.deviceInfo.chartList[k].id == message.message[j].id) { + this.deviceInfo.chartList[k].shadow = message.message[j].value; + // 更新图表 + for (let m = 0; m < this.monitorChart.length; m++) { + if (this.deviceInfo.chartList[k].id == this + .monitorChart[m].id) { + // uchart中data取值范围0-1,需要最小数+监测值,然后除于区间值 + let value = (Number(message.message[j].value) + Math + .abs(this + .deviceInfo.chartList[k].datatype + .min)) / (Math.abs( + this.deviceInfo.chartList[k] + .datatype.min) + Math + .abs(this.deviceInfo.chartList[k] + .datatype.max)); + this.monitorChart[m].data.series[0].data = + value; + this.monitorChart[m].opts.title.name = message.message[ + j].value + ' ' + + this.deviceInfo.chartList[k].datatype.unit; + break; + } + } + isComplete = true; + break; + } + } + if (isComplete) { + break; + } + }; + this.updateBasicSettings(); } } } @@ -752,6 +869,12 @@ }; console.log("103#mp3List", JSON.stringify(ttsData)) mp3ListModel.shadow = 'JSON=' + JSON.stringify(ttsData); + // 本地添加 + this.audioList.push({ + id: newId, + name: this.newAudio.name, + filename: `${newId}_${this.newAudio.name}` + }); await this.mqttPublish(this.device, mp3ListModel); this.newAudio = { @@ -859,8 +982,28 @@ if (this.isEditDefault && this.editDefaultIndex !== null) { data.play_list[this.editDefaultIndex] = newPlayItem; + // 本地编辑 + this.defaultList.splice(this.editDefaultIndex, 1, { + id: this.editDefaultIndex + 1, + name: filename, + playTime: `${this.newDefault.startTime} - ${this.newDefault.endTime}`, + weekdays: this.newDefault.repeatDays.map(i => this.weekDays[i]).join(', '), + radarEnabled: this.newDefault.radarEnabled, + status: '启用', + radarSpeed: this.newDefault.radarEnabled ? `${this.newDefault.minSpeed}-${this.newDefault.maxSpeed}km/h` : '' + }); } else { data.play_list.push(newPlayItem); + // 本地添加 + this.defaultList.push({ + id: this.defaultList.length + 1, + name: filename, + playTime: `${this.newDefault.startTime} - ${this.newDefault.endTime}`, + weekdays: this.newDefault.repeatDays.map(i => this.weekDays[i]).join(', '), + radarEnabled: this.newDefault.radarEnabled, + status: '启用', + radarSpeed: this.newDefault.radarEnabled ? `${this.newDefault.minSpeed}-${this.newDefault.maxSpeed}km/h` : '' + }); } console.log(JSON.stringify(data)) playListModel.shadow = 'JSON=' + JSON.stringify(data); @@ -902,58 +1045,53 @@ }, async deleteAudio(index) { if (!this.checkOnline()) return; + // 先本地删除 + const deleted = this.audioList.splice(index, 1); + // 弹窗确认 + uni.showModal({ + title: '提示', + content: '确定要删除该音频吗?', + cancelText: '取消', + confirmText: '确定', + success: async (res) => { + if (res.confirm) { + const mp3ListModel = this.deviceInfo.thingsModels.find(model => model + .id === '103#mp3List'); + if (mp3ListModel && mp3ListModel.shadow) { + try { + const jsonStr = mp3ListModel.shadow.replace('JSON=', ''); + const data = JSON.parse(jsonStr); - try { - uni.showModal({ - title: '提示', - content: '确定要删除该音频吗?', - cancelText: '取消', - confirmText: '确定', - success: async (res) => { - if (res.confirm) { - const mp3ListModel = this.deviceInfo.thingsModels.find(model => model - .id === '103#mp3List'); - if (mp3ListModel && mp3ListModel.shadow) { - try { - const jsonStr = mp3ListModel.shadow.replace('JSON=', ''); - const data = JSON.parse(jsonStr); + if (data.mp3_list) { + data.mp3_list.splice(index, 1); - if (data.mp3_list) { - data.mp3_list.splice(index, 1); + mp3ListModel.shadow = 'JSON=' + JSON.stringify(data); - mp3ListModel.shadow = 'JSON=' + JSON.stringify(data); + await this.mqttPublish(this.device, mp3ListModel); - await this.mqttPublish(this.device, mp3ListModel); - - this.audioList.splice(index, 1); - - uni.showToast({ - title: '删除成功', - icon: 'success' - }); - } - } catch (error) { - console.error('删除音频失败:', error); uni.showToast({ - title: '删除失败: ' + error.message, - icon: 'none' + title: '删除成功', + icon: 'success' }); } + } catch (error) { + // 失败时回滚本地数据 + this.audioList.splice(index, 0, ...deleted); + uni.showToast({ + title: '删除失败: ' + error.message, + icon: 'none' + }); } } + } else { + // 取消时回滚本地数据 + this.audioList.splice(index, 0, ...deleted); } - }); - } catch (error) { - console.error('删除音频失败:', error); - uni.showToast({ - title: '删除失败: ' + error.message, - icon: 'none' - }); - } + } + }); }, - deleteDefault(index) { + async deleteDefault(index) { if (!this.checkOnline()) return; - uni.showModal({ title: '提示', content: '确认删除该播放项吗?', @@ -961,42 +1099,20 @@ confirmText: '确定', success: async (res) => { if (res.confirm) { - const playListModel = this.deviceInfo.thingsModels.find(model => model.id === - '103#playList'); + const playListModel = this.deviceInfo.thingsModels.find(model => model.id === '103#playList'); if (playListModel) { try { const jsonStr = playListModel.shadow.replace('JSON=', ''); const data = JSON.parse(jsonStr); - if (data.play_list) { data.play_list.splice(index, 1); - - data.play_list.forEach((item, index) => { - item.play.num = index + 1; - }); - + data.play_list.forEach((item, idx) => { item.play.num = idx + 1; }); playListModel.shadow = 'JSON=' + JSON.stringify(data); - - try { - await this.mqttPublish(this.device, playListModel); - uni.showToast({ - title: '删除成功', - icon: 'success' - }); - } catch (error) { - console.error('发送删除命令失败:', error); - uni.showToast({ - title: '删除失败', - icon: 'none' - }); - } + await this.mqttPublish(this.device, playListModel); + uni.showToast({ title: '删除成功', icon: 'success' }); } } catch (error) { - console.error('解析或更新播放列表失败:', error); - uni.showToast({ - title: '删除失败', - icon: 'none' - }); + uni.showToast({ title: '删除失败', icon: 'none' }); } } } @@ -1031,6 +1147,7 @@ }, async audioSwitchChange() { if (!this.checkOnline()) return; + // 本地切换已在handleAudioSwitchChange处理 try { const playEnModel = this.device.thingsModels.find(item => item.id === '103#playEn'); if (playEnModel) { @@ -1038,13 +1155,15 @@ await this.mqttPublish(this.device, playEnModel); } } catch (error) { - console.error('切换音频开关失败:', error); - uni.showToast({ - title: '操作失败: ' + error.message, - icon: 'none' - }); + this.audioEnabled = !this.audioEnabled; + uni.showToast({ title: '操作失败: ' + error.message, icon: 'none' }); } }, + handleAudioSwitchChange(e) { + const value = e && e.detail && e.detail.value; + this.audioEnabled = value; + this.audioSwitchChange(); + }, formatTime(seconds) { const minutes = Math.floor(seconds / 60); const remainingSeconds = seconds % 60; @@ -1158,44 +1277,34 @@ return weekdays; }, async handleStatusChange(index, value) { - if (!this.checkOnline()) return; - + value = typeof value !== 'undefined' ? value : arguments[1]; + // 本地切换 + this.defaultList[index].status = value; const playListModel = this.deviceInfo.thingsModels.find(model => model.id === '103#playList'); if (playListModel) { try { const jsonStr = playListModel.shadow.replace('JSON=', ''); const data = JSON.parse(jsonStr); - if (data.play_list) { data.play_list[index].play.en = value === '启用' ? 1 : 0; - playListModel.shadow = 'JSON=' + JSON.stringify(data); - - try { - await this.mqttPublish(this.device, playListModel); - uni.showToast({ - title: '更新成功', - icon: 'success' - }); - } catch (error) { - console.error('发送状态更新命令失败:', error); - uni.showToast({ - title: '更新失败', - icon: 'none' - }); - this.defaultList[index].status = value === '启用' ? '禁用' : '启用'; - } + await this.mqttPublish(this.device, playListModel); + uni.showToast({ title: '更新成功', icon: 'success' }); } } catch (error) { - console.error('解析或更新播放列表失败:', error); - uni.showToast({ - title: '更新失败', - icon: 'none' - }); this.defaultList[index].status = value === '启用' ? '禁用' : '启用'; + uni.showToast({ title: '更新失败', icon: 'none' }); } } }, + handleNativeSwitchChange(e, index) { + // e.detail.value 是布尔值 + const value = e && e.detail && e.detail.value ? '启用' : '禁用'; + // 本地切换 + this.defaultList[index].status = value; + // 复用原有下发逻辑 + this.handleStatusChange(index, value); + }, deleteRecording(index) { uni.showModal({ title: '提示', @@ -1539,6 +1648,7 @@ font-size: 28rpx; color: #606266; text-align: center; + justify-content: center; } }