diff --git a/assets/admin/package-lock.json b/assets/admin/package-lock.json index 6c4a22f0..fdbdc2d7 100644 --- a/assets/admin/package-lock.json +++ b/assets/admin/package-lock.json @@ -21,35 +21,36 @@ }, "devDependencies": { "@vitejs/plugin-vue": "^5.1.0", + "echarts": "^6.1.0", "esbuild": "^0.25.12", "vite": "^6.0.0" } }, "node_modules/@babel/helper-string-parser": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", - "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", + "version": "7.29.11", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.11.tgz", + "integrity": "sha512-snZbO7MEDOof+hvNa97EjEY7qD7h2kwvQr5AJC3ZhQudKW5dnej6k3kP9NQV88hJwaS8vDqRLFo9rivLEhle2g==", "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.28.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz", - "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz", + "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==", "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/parser": { - "version": "7.29.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.3.tgz", - "integrity": "sha512-b3ctpQwp+PROvU/cttc4OYl4MzfJUWy6FZg+PMXfzmt/+39iHVF0sDfqay8TQM3JA2EUOyKcFZt75jWriQijsA==", + "version": "7.29.12", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.12.tgz", + "integrity": "sha512-WJ7JBp/Q4+z/ImydtI7jS6NVco5++632ExBemSX+Ysb+G1lCwQ5BVo3SY+jGGOcZXI4ZccbZSUSJLNBW6eEpJg==", "license": "MIT", "dependencies": { - "@babel/types": "^7.29.0" + "@babel/types": "^7.29.11" }, "bin": { "parser": "bin/babel-parser.js" @@ -59,13 +60,13 @@ } }, "node_modules/@babel/types": { - "version": "7.29.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.0.tgz", - "integrity": "sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==", + "version": "7.29.11", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.11.tgz", + "integrity": "sha512-WCsemW40Cpc6gouC1SrY6PBaZ+oLRlEVY9XBvZBI7il/HyUrb2nJ505wE1MHEFyDZNnrWDEuy4jL50WVHfTTSQ==", "license": "MIT", "dependencies": { - "@babel/helper-string-parser": "^7.27.1", - "@babel/helper-validator-identifier": "^7.28.5" + "@babel/helper-string-parser": "^7.29.11", + "@babel/helper-validator-identifier": "^7.29.7" }, "engines": { "node": ">=6.9.0" @@ -676,9 +677,9 @@ } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", - "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz", + "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==", "license": "MIT" }, "node_modules/@juggle/resize-observer": { @@ -1137,53 +1138,53 @@ } }, "node_modules/@vue/compiler-core": { - "version": "3.5.33", - "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.5.33.tgz", - "integrity": "sha512-3PZLQwFw4Za3TC8t0FvTy3wI16Kt+pmwcgNZca4Pj9iWL2E72a/gZlpBtAJvEdDMdCxdG/qq0C7PN0bsJuv0Rw==", + "version": "3.5.44", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.5.44.tgz", + "integrity": "sha512-k34nCytbK8PQ1gR2mGROYOw6Pnv/mumqIdrZ3x2tbyXZDWm7ViKGLTfdB+DRrWqEQsLgGJvn0WN9jBif5zCTLQ==", "license": "MIT", "dependencies": { - "@babel/parser": "^7.29.2", - "@vue/shared": "3.5.33", + "@babel/parser": "^7.29.9", + "@vue/shared": "3.5.44", "entities": "^7.0.1", "estree-walker": "^2.0.2", - "source-map-js": "^1.2.1" + "source-map-js": "^1.2.2" } }, "node_modules/@vue/compiler-dom": { - "version": "3.5.33", - "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.5.33.tgz", - "integrity": "sha512-PXq0yrfCLzzL07rbXO4awtXY1Z06LG2eu6Adg3RJFa/j3Cii217XxxLXG22N330gw7GmALCY0Z8RgXEviwgpjA==", + "version": "3.5.44", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.5.44.tgz", + "integrity": "sha512-W5AoBFWdw1lQAKiHowkfgFKFab82oSRT6sGsPfw/q1GRjsy/ZJFLHGhJyBRIFN9APLTUduDH9U2JAiPOIyKuYg==", "license": "MIT", "dependencies": { - "@vue/compiler-core": "3.5.33", - "@vue/shared": "3.5.33" + "@vue/compiler-core": "3.5.44", + "@vue/shared": "3.5.44" } }, "node_modules/@vue/compiler-sfc": { - "version": "3.5.33", - "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.5.33.tgz", - "integrity": "sha512-UTUvRO9cY+rROrx/pvN9P5Z7FgA6QGfokUCfhQE4EnmUj3rVnK+CHI0LsEO1pg+I7//iRYMUfcNcCPe7tg0CoA==", + "version": "3.5.44", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.5.44.tgz", + "integrity": "sha512-dzHmQ4jXTpdr5FjIQUeykVakN/uzqFbUo9/C5ikBFg3a3PeM6uRxeczx1ZbXBML0/zJstEh3ygYipzR5Z7b2Pw==", "license": "MIT", "dependencies": { - "@babel/parser": "^7.29.2", - "@vue/compiler-core": "3.5.33", - "@vue/compiler-dom": "3.5.33", - "@vue/compiler-ssr": "3.5.33", - "@vue/shared": "3.5.33", + "@babel/parser": "^7.29.9", + "@vue/compiler-core": "3.5.44", + "@vue/compiler-dom": "3.5.44", + "@vue/compiler-ssr": "3.5.44", + "@vue/shared": "3.5.44", "estree-walker": "^2.0.2", "magic-string": "^0.30.21", - "postcss": "^8.5.10", - "source-map-js": "^1.2.1" + "postcss": "^8.5.29", + "source-map-js": "^1.2.2" } }, "node_modules/@vue/compiler-ssr": { - "version": "3.5.33", - "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.5.33.tgz", - "integrity": "sha512-IErjYdnj1qIupG5xxiVIYiiRvDhGWV4zuh/RCrwfYpuL+HWQzeU6lCk/nF9r7olWMnjKxCAkOctT2qFWFkzb1A==", + "version": "3.5.44", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.5.44.tgz", + "integrity": "sha512-xr5gb1JVHlfXJwSlRz1FeP6uxoazdzHuMTVLE7up+4Vrqxk219CvxLPxD9NXBt47yvZW7+p4DXfyp4O1fkByIA==", "license": "MIT", "dependencies": { - "@vue/compiler-dom": "3.5.33", - "@vue/shared": "3.5.33" + "@vue/compiler-dom": "3.5.44", + "@vue/shared": "3.5.44" } }, "node_modules/@vue/devtools-api": { @@ -1193,53 +1194,51 @@ "license": "MIT" }, "node_modules/@vue/reactivity": { - "version": "3.5.33", - "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.5.33.tgz", - "integrity": "sha512-p8UfIqyIhb0rYGlSgSBV+lPhF2iUSBcRy7enhTmPqKWadHy9kcOFYF1AejYBP9P+avnd3OBbD49DU4pLWX/94A==", + "version": "3.5.44", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.5.44.tgz", + "integrity": "sha512-u+QJdKeBBEADkPdevsL+6E12QlYVfBD8Zcw5qjDQKtamI6l14KyqazJMobhCKelhWN5zpyKUiEDoTyHE93cqWw==", "license": "MIT", "dependencies": { - "@vue/shared": "3.5.33" + "@vue/shared": "3.5.44" } }, "node_modules/@vue/runtime-core": { - "version": "3.5.33", - "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.5.33.tgz", - "integrity": "sha512-UpFF45RI9//a7rvq7RdOQblb4tup7hHG9QsmIrxkFQLzQ7R8/iNQ5LE15NhLZ1/WcHMU2b47u6P33CPUelHyIQ==", + "version": "3.5.44", + "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.5.44.tgz", + "integrity": "sha512-uEa/ndwjhrrhnOfb2p+sZy6zeoamJOISqaLSJGk/8R6nABT1ZldpzcJoPzKj+zHVomVBPcmQYyC2r4LtvDV6CQ==", "license": "MIT", "dependencies": { - "@vue/reactivity": "3.5.33", - "@vue/shared": "3.5.33" + "@vue/reactivity": "3.5.44", + "@vue/shared": "3.5.44" } }, "node_modules/@vue/runtime-dom": { - "version": "3.5.33", - "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.5.33.tgz", - "integrity": "sha512-IOxMsAOwquhfITgmOgaPYl7/j8gKUxUFoflRc+u4LxyD3+783xne8vNta1PONVCvCV9A0w7hkyEepINDqfO0tw==", + "version": "3.5.44", + "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.5.44.tgz", + "integrity": "sha512-3fc4ARcXVhVBaJ3ujWiNZJARD6pkyRcwG+ZYhMzjKtKUp7MAY0HLwr7r3Smep3Li6ZaWT6ewdmx8XqdaD5oNZg==", "license": "MIT", "dependencies": { - "@vue/reactivity": "3.5.33", - "@vue/runtime-core": "3.5.33", - "@vue/shared": "3.5.33", + "@vue/reactivity": "3.5.44", + "@vue/runtime-core": "3.5.44", + "@vue/shared": "3.5.44", "csstype": "^3.2.3" } }, "node_modules/@vue/server-renderer": { - "version": "3.5.33", - "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.5.33.tgz", - "integrity": "sha512-0xylq/8/h44lVG0pZFknv1XIdEgymq2E9n59uTWJBG+dIgiT0TMCSsxrN7nO16Z0MU0MPjFcguBbZV8Itk52Hw==", + "version": "3.5.44", + "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.5.44.tgz", + "integrity": "sha512-R4S1UoH4h5Frrauv8Z5XE5TxV9oBiUSgWIC4TyVK1FK+RocRnOLwFA5Xcmo2011RlgJp+AbZCnw6afrhlgRuUQ==", "license": "MIT", "dependencies": { - "@vue/compiler-ssr": "3.5.33", - "@vue/shared": "3.5.33" - }, - "peerDependencies": { - "vue": "3.5.33" + "@vue/compiler-ssr": "3.5.44", + "@vue/runtime-dom": "3.5.44", + "@vue/shared": "3.5.44" } }, "node_modules/@vue/shared": { - "version": "3.5.33", - "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.5.33.tgz", - "integrity": "sha512-5vR2QIlmaLG77Ygd4pMP6+SGQ5yox9VhtnbDWTy9DzMzdmeLxZ1QqxrywEZ9sa1AVubfIJyaCG3ytyWU81ufcQ==", + "version": "3.5.44", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.5.44.tgz", + "integrity": "sha512-H82XLH0DjmSOdbEwO15x3QTo1f5PWEtv237eLpYKc0mqLu+B8hnq16lFWmuBmNurkeiG3wr+oM1FhOll/YVFRg==", "license": "MIT" }, "node_modules/async-validator": { @@ -1310,6 +1309,17 @@ "date-fns": "^3.0.0 || ^4.0.0" } }, + "node_modules/echarts": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/echarts/-/echarts-6.1.0.tgz", + "integrity": "sha512-q0yaFPggC9FUdsWH4blavRWFmxdrIodbkoKNAjJudAI6CA9gNPxHtV2RcZNEepZVlk4yvBYkOkbk6HIVpIyHZA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "tslib": "2.3.0", + "zrender": "6.1.0" + } + }, "node_modules/entities": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/entities/-/entities-7.0.1.tgz", @@ -1472,9 +1482,9 @@ } }, "node_modules/nanoid": { - "version": "3.3.12", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.12.tgz", - "integrity": "sha512-ZB9RH/39qpq5Vu6Y+NmUaFhQR6pp+M2Xt76XBnEwDaGcVAqhlvxrl3B2bKS5D3NH3QR76v3aSrKaF/Kiy7lEtQ==", + "version": "3.3.20", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz", + "integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==", "funding": [ { "type": "github", @@ -1531,9 +1541,9 @@ } }, "node_modules/postcss": { - "version": "8.5.13", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.13.tgz", - "integrity": "sha512-qif0+jGGZoLWdHey3UFHHWP0H7Gbmsk8T5VEqyYFbWqPr1XqvLGBbk/sl8V5exGmcYJklJOhOQq1pV9IcsiFag==", + "version": "8.5.32", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.32.tgz", + "integrity": "sha512-LJlKCCAUFKOuZxipUdYw1NzIITEsPcgyOG9LkvRJvuKj/bRzbuRY0ARXvL0pWGpsZvn8jku+LMep2eU0seHp8g==", "funding": [ { "type": "opencollective", @@ -1550,9 +1560,9 @@ ], "license": "MIT", "dependencies": { - "nanoid": "^3.3.11", + "nanoid": "^3.3.20", "picocolors": "^1.1.1", - "source-map-js": "^1.2.1" + "source-map-js": "^1.2.2" }, "engines": { "node": "^10 || ^12 || >=14" @@ -1616,9 +1626,9 @@ "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==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.2.tgz", + "integrity": "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==", "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" @@ -1653,6 +1663,13 @@ "integrity": "sha512-M8RGFoKtZ8dF+iwJfAJTOH/SM4KluKOKRJpjCMhI8bG3qB74zrFoArKZ62ll0Fr3mqkMJiQOmWYkdYgDeITYQg==", "license": "MIT" }, + "node_modules/tslib": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", + "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==", + "dev": true, + "license": "0BSD" + }, "node_modules/vdirs": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/vdirs/-/vdirs-0.1.8.tgz", @@ -1666,9 +1683,9 @@ } }, "node_modules/vite": { - "version": "6.4.2", - "resolved": "https://registry.npmjs.org/vite/-/vite-6.4.2.tgz", - "integrity": "sha512-2N/55r4JDJ4gdrCvGgINMy+HH3iRpNIz8K6SFwVsA+JbQScLiC+clmAxBgwiSPgcG9U15QmvqCGWzMbqda5zGQ==", + "version": "6.4.5", + "resolved": "https://registry.npmjs.org/vite/-/vite-6.4.5.tgz", + "integrity": "sha512-4enwjFfi4IwtEh0w+jPzpLVOFQiPHmmzPxcHXQOyEur47o6u0jE573DmGpjA+7irXoMLYRZD5ZaFUEneS3abPg==", "dev": true, "license": "MIT", "dependencies": { @@ -1753,16 +1770,16 @@ } }, "node_modules/vue": { - "version": "3.5.33", - "resolved": "https://registry.npmjs.org/vue/-/vue-3.5.33.tgz", - "integrity": "sha512-1AgChhx5w3ALgT4oK3acm2Es/7jyZhWSVUfs3rOBlGQC0rjEDkS7G4lWlJJGGNQD+BV3reCwbQrOe1mPNwKHBQ==", + "version": "3.5.44", + "resolved": "https://registry.npmjs.org/vue/-/vue-3.5.44.tgz", + "integrity": "sha512-dvvmaOCG7lAMkJTPqPwWeGMsPS6DIsFsfZDUgBp9V6mHf9b3+/wyVwYR4Es+WV6uJC0FKRxp81Obcq0ZwUcGFQ==", "license": "MIT", "dependencies": { - "@vue/compiler-dom": "3.5.33", - "@vue/compiler-sfc": "3.5.33", - "@vue/runtime-dom": "3.5.33", - "@vue/server-renderer": "3.5.33", - "@vue/shared": "3.5.33" + "@vue/compiler-dom": "3.5.44", + "@vue/compiler-sfc": "3.5.44", + "@vue/runtime-dom": "3.5.44", + "@vue/server-renderer": "3.5.44", + "@vue/shared": "3.5.44" }, "peerDependencies": { "typescript": "*" @@ -1849,6 +1866,16 @@ "resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.8.tgz", "integrity": "sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ==", "license": "MIT" + }, + "node_modules/zrender": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/zrender/-/zrender-6.1.0.tgz", + "integrity": "sha512-oEGMDB6pOP2S6OwRR4PdVv610zrjnA3Bh+JnSG12fYJlBKjtNAoEb5fSUoCOOINlH96I2fU38/A2UpRKs67xYQ==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "tslib": "2.3.0" + } } } } diff --git a/assets/admin/package.json b/assets/admin/package.json index 641c7c3a..c7dee7a0 100644 --- a/assets/admin/package.json +++ b/assets/admin/package.json @@ -1 +1 @@ -{"name":"aksrt-admin","version":"1.0.0","private":true,"type":"module","scripts":{"dev":"vite","build":"vite build && node extract-naive-styles.mjs","build:public":"node ../../tools/build-public-assets.mjs","preview":"vite preview"},"dependencies":{"@codemirror/lang-css":"^6.3.1","@codemirror/lang-html":"^6.4.11","@codemirror/lang-javascript":"^6.2.5","@codemirror/theme-one-dark":"^6.1.3","codemirror":"^6.0.2","naive-ui":"^2.40.0","pinia":"^2.2.0","vue":"^3.5.0","vue-router":"^4.4.0","vuedraggable":"^4.1.0"},"devDependencies":{"@vitejs/plugin-vue":"^5.1.0","esbuild":"^0.25.12","vite":"^6.0.0"}} +{"name":"aksrt-admin","version":"1.0.0","private":true,"type":"module","scripts":{"dev":"vite","build":"vite build && node extract-naive-styles.mjs","build:public":"node ../../tools/build-public-assets.mjs","build:pay-charts":"node ../../tools/build-pay-charts.mjs","preview":"vite preview"},"dependencies":{"@codemirror/lang-css":"^6.3.1","@codemirror/lang-html":"^6.4.11","@codemirror/lang-javascript":"^6.2.5","@codemirror/theme-one-dark":"^6.1.3","codemirror":"^6.0.2","naive-ui":"^2.40.0","pinia":"^2.2.0","vue":"^3.5.0","vue-router":"^4.4.0","vuedraggable":"^4.1.0"},"devDependencies":{"@vitejs/plugin-vue":"^5.1.0","echarts":"^6.1.0","esbuild":"^0.25.12","vite":"^6.0.0"},"allowScripts":{"esbuild@0.25.12":true,"vue-demi@0.14.10":true}} \ No newline at end of file diff --git a/assets/css/admin/native-ui.css b/assets/css/admin/native-ui.css index cd69c9ef..8a002c3d 100644 --- a/assets/css/admin/native-ui.css +++ b/assets/css/admin/native-ui.css @@ -516,31 +516,6 @@ a.aksrt-native-stat:focus { outline: 2px solid color-mix(in srgb, var(--an-tone) .aksrt-native-callout.is-warning { background: #fff8eb; border-left-color: var(--an-warning); } .aksrt-native-callout.is-danger { background: #fdf0f2; border-left-color: var(--an-danger); } -/* 快捷入口网格 */ -.aksrt-native-links { - display: grid; - grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); - gap: 10px; - margin: 0; - padding: 0; - list-style: none; -} -.aksrt-native-links li { margin: 0; } -.aksrt-native-links a { - display: flex; - align-items: center; - gap: 10px; - padding: 12px 14px; - color: var(--an-text); - background: var(--an-bg-soft); - border-radius: var(--an-radius-sm); - text-decoration: none; - transition: background .15s, color .15s; -} -.aksrt-native-links a:hover { color: var(--an-primary); background: var(--an-primary-soft); } -.aksrt-native-links a::after { content: "\f345"; margin-left: auto; color: var(--an-muted); font: normal 14px/1 dashicons; } -.aksrt-native-links .dashicons { color: var(--an-primary); } - /* ---------- 分页条(AdminListPagination / paginate_links) ---------- */ .aksrt-native .tablenav { height: auto; margin: 0; padding: 12px 20px; } .aksrt-native .aksrt-native-card .tablenav.bottom { border-top: 1px solid var(--an-border-soft); } diff --git a/assets/css/admin/pay-overview.css b/assets/css/admin/pay-overview.css new file mode 100644 index 00000000..8c8ea8c9 --- /dev/null +++ b/assets/css/admin/pay-overview.css @@ -0,0 +1,284 @@ +/* 支付中心概览(aksrt_pay):今日实时 + 筛选条 + 指标卡 + ECharts 图表 + 转化与退款 + 热销排行 + 待办 + 快捷入口。 + * 复用 native-ui.css 的 --an-* 令牌,规则限定在本页类名下。图表由 assets/js/admin-pay-overview.js 绘制。 */ +.aksrt-po-page [hidden] { display: none !important; } + +/* ---------- 今日实时 ---------- */ +.aksrt-po-live { + display: flex; + flex-wrap: wrap; + align-items: center; + justify-content: space-between; + gap: 8px 24px; + margin: 0 0 16px; + padding: 14px 20px; + background: var(--an-card); + border-radius: var(--an-radius); + box-shadow: var(--an-shadow); +} +.aksrt-po-live__main { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; } +.aksrt-po-live__dot { + width: 8px; + height: 8px; + background: var(--an-primary); + border-radius: 50%; + box-shadow: 0 0 0 4px var(--an-primary-soft); + animation: aksrt-po-pulse 2s ease-in-out infinite; +} +@keyframes aksrt-po-pulse { 50% { box-shadow: 0 0 0 7px transparent; } } +@media (prefers-reduced-motion: reduce) { .aksrt-po-live__dot { animation: none; } } +.aksrt-po-live__label { color: var(--an-muted); } +.aksrt-po-live__value { color: var(--an-text); font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; } +.aksrt-po-live__meta { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--an-muted); font-size: 12px; } + +/* ---------- 筛选条 ---------- */ +.aksrt-po-toolbar { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: 10px 16px; + margin: 0 0 16px; +} +.aksrt-po-seg { + display: inline-flex; + flex-wrap: wrap; + gap: 2px; + padding: 3px; + background: var(--an-card); + border-radius: var(--an-radius-sm); + box-shadow: var(--an-shadow); +} +.aksrt-po-seg button { + padding: 5px 12px; + color: var(--an-text-2); + font-size: 12px; + line-height: 1.5; + background: transparent; + border: 0; + border-radius: 6px; + cursor: pointer; + transition: background .15s, color .15s; +} +.aksrt-po-seg button:hover { color: var(--an-primary); } +.aksrt-po-seg button[aria-pressed="true"] { color: var(--an-primary); font-weight: 600; background: var(--an-primary-soft); } +.aksrt-po-seg button:focus-visible { outline: 2px solid var(--an-primary); outline-offset: 1px; } +.aksrt-po-range { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; color: var(--an-muted); } +.aksrt-po-range label { display: inline-flex; margin: 0; } +.aksrt-po-range-label { color: var(--an-muted); font-size: 12px; } + +/* ---------- 提示 ---------- */ +.aksrt-po-notice { + margin: 0 0 16px; + padding: 10px 14px; + color: var(--an-text-2); + font-size: 12px; + background: #fff8eb; + border-left: 3px solid var(--an-warning); + border-radius: var(--an-radius-sm); +} +.aksrt-po-page .aksrt-po-error { margin: 0 0 16px; } + +/* ---------- 指标卡 ---------- */ +.aksrt-po-kpis { + display: grid; + grid-template-columns: repeat(6, minmax(0, 1fr)); + gap: 12px; + margin: 0 0 16px; +} +.aksrt-po-kpi { + --po-tone: var(--an-primary); + position: relative; + display: flex; + flex-direction: column; + gap: 6px; + min-width: 0; + padding: 16px 18px 14px; + background: var(--an-card); + border-radius: var(--an-radius); + box-shadow: var(--an-shadow); + overflow: hidden; +} +.aksrt-po-kpi::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--po-tone); opacity: .85; } +.aksrt-po-kpi--success { --po-tone: var(--an-primary); } +.aksrt-po-kpi--info { --po-tone: var(--an-info); } +.aksrt-po-kpi--warning { --po-tone: var(--an-warning); } +.aksrt-po-kpi--danger { --po-tone: var(--an-danger); } +.aksrt-po-kpi--primary { --po-tone: #8a63d2; } +.aksrt-po-kpi__label { color: var(--an-muted); font-size: 13px; } +.aksrt-po-kpi__value { + color: var(--an-text); + font-size: 24px; + font-weight: 600; + line-height: 1.2; + font-variant-numeric: tabular-nums; + word-break: break-all; +} +.aksrt-po-kpi__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12px; } +.aksrt-po-kpi__meta { color: var(--an-muted); } + +.aksrt-po-delta { + display: inline-flex; + align-items: center; + padding: 1px 6px; + font-size: 12px; + font-variant-numeric: tabular-nums; + border-radius: 4px; +} +.aksrt-po-delta.is-up { color: var(--an-primary); background: var(--an-primary-soft); } +.aksrt-po-delta.is-down { color: var(--an-danger); background: #fdf0f2; } +.aksrt-po-delta.is-flat { color: var(--an-muted); background: var(--an-bg-soft); } + +/* ---------- 栅格 / 加载态 ---------- */ +.aksrt-po-body { transition: opacity .15s; } +.aksrt-po-body.is-loading { opacity: .55; pointer-events: none; } +.aksrt-po-grid { + display: grid; + gap: 16px; + align-items: stretch; + margin: 0 0 16px; +} +.aksrt-po-grid--main { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); } +.aksrt-po-grid > .aksrt-native-card { margin: 0; } +.aksrt-po-card { display: flex; flex-direction: column; min-width: 0; } +.aksrt-po-card > .aksrt-native-card__body { flex: 1; } + +/* ---------- 图表 ---------- */ +.aksrt-po-chart { width: 100%; min-width: 0; } +.aksrt-po-chart--lg { height: 340px; } +.aksrt-po-chart--md { height: 280px; } + +/* ---------- 转化与退款 ---------- */ +.aksrt-po-funnel { display: flex; flex-direction: column; gap: 16px; margin: 0; padding: 0; list-style: none; } +.aksrt-po-funnel li { display: flex; flex-direction: column; gap: 6px; margin: 0; } +.aksrt-po-funnel__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; } +.aksrt-po-funnel__label { color: var(--an-text-2); } +.aksrt-po-funnel__value { color: var(--an-text); font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; } +.aksrt-po-funnel__bar { display: block; height: 6px; background: var(--an-bg-soft); border-radius: 3px; overflow: hidden; } +.aksrt-po-funnel__bar i { display: block; width: 0; height: 100%; background: var(--an-primary); border-radius: 3px; transition: width .3s; } +.aksrt-po-funnel li[data-metric="close_rate"] .aksrt-po-funnel__bar i { background: var(--an-warning); } +.aksrt-po-funnel li[data-metric="refund_rate"] .aksrt-po-funnel__bar i { background: var(--an-danger); } +.aksrt-po-funnel li[data-metric="created_count"] .aksrt-po-funnel__bar { display: none; } +.aksrt-po-funnel__hint { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--an-muted); font-size: 12px; } + +/* ---------- 热销排行 ---------- */ +.aksrt-po-top .column-rank { width: 44px; text-align: center; } +.aksrt-po-top .column-num { width: 110px; text-align: right; } +.aksrt-po-top .column-share { width: 160px; } +.aksrt-po-top td { vertical-align: middle; } +.aksrt-po-top td.column-num { font-variant-numeric: tabular-nums; } +.aksrt-po-top td a { color: var(--an-text); font-weight: 500; text-decoration: none; } +.aksrt-po-top td a:hover { color: var(--an-primary); } +.aksrt-po-rank { + display: inline-flex; + align-items: center; + justify-content: center; + width: 22px; + height: 22px; + color: var(--an-muted); + font-size: 12px; + font-weight: 600; + background: var(--an-bg-soft); + border-radius: 6px; +} +.aksrt-po-rank.is-top { color: #fff; background: var(--an-primary); } +.aksrt-po-share { display: flex; align-items: center; gap: 8px; color: var(--an-muted); font-size: 12px; font-variant-numeric: tabular-nums; } +.aksrt-po-share > span { flex: 1; height: 6px; background: var(--an-bg-soft); border-radius: 3px; overflow: hidden; } +.aksrt-po-share > span > i { display: block; height: 100%; background: var(--an-primary); border-radius: 3px; } +.aksrt-po-top__empty { padding: 32px 12px !important; color: var(--an-muted); text-align: center; } + +/* ---------- 待办 ---------- */ +.aksrt-po-todo { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; } +.aksrt-po-todo li { margin: 0; } +.aksrt-po-todo__item { + --po-tone: var(--an-muted); + display: flex; + align-items: center; + gap: 10px; + padding: 10px 12px; + color: var(--an-text-2); + background: var(--an-bg-soft); + border-radius: var(--an-radius-sm); + text-decoration: none; + transition: background .15s, color .15s; +} +.aksrt-po-todo__item:hover, +.aksrt-po-todo__item:focus { color: var(--an-text); background: color-mix(in srgb, var(--po-tone) 10%, #fff); } +.aksrt-po-todo__item--danger { --po-tone: var(--an-danger); } +.aksrt-po-todo__item--warning { --po-tone: var(--an-warning); } +.aksrt-po-todo__item--info { --po-tone: var(--an-info); } +.aksrt-po-todo__item--neutral { --po-tone: var(--an-muted); } +.aksrt-po-todo__icon.dashicons { + display: inline-flex; + align-items: center; + justify-content: center; + flex: none; + width: 30px; + height: 30px; + color: var(--po-tone); + font-size: 16px; + background: color-mix(in srgb, var(--po-tone) 12%, #fff); + border-radius: 8px; +} +.aksrt-po-todo__icon.dashicons:before { line-height: 30px; } +.aksrt-po-todo__label { flex: 1; min-width: 0; } +.aksrt-po-todo__value { color: var(--an-text); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; } +.aksrt-po-todo__item--danger .aksrt-po-todo__value { color: var(--an-danger); } +.aksrt-po-todo__item--warning .aksrt-po-todo__value { color: #c27c0e; } +.aksrt-po-todo__item--neutral .aksrt-po-todo__value { color: var(--an-muted); } + +/* ---------- 快捷入口 ---------- */ +.aksrt-po-links { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); + gap: 8px; + margin: 0; + padding: 0; + list-style: none; +} +.aksrt-po-links li { margin: 0; } +.aksrt-po-links a { + display: flex; + align-items: center; + gap: 10px; + height: 100%; + padding: 10px 12px; + color: var(--an-text); + border: 1px solid var(--an-border-soft); + border-radius: var(--an-radius-sm); + text-decoration: none; + box-sizing: border-box; + transition: border-color .15s, background .15s; +} +.aksrt-po-links a:hover, +.aksrt-po-links a:focus { color: var(--an-text); background: var(--an-primary-soft); border-color: color-mix(in srgb, var(--an-primary) 30%, transparent); } +.aksrt-po-links__icon.dashicons { + display: inline-flex; + align-items: center; + justify-content: center; + flex: none; + width: 32px; + height: 32px; + color: var(--an-primary); + font-size: 17px; + background: var(--an-primary-soft); + border-radius: 8px; +} +.aksrt-po-links__icon.dashicons:before { line-height: 32px; } +.aksrt-po-links__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; } +.aksrt-po-links__text strong { font-size: 13px; font-weight: 600; } +.aksrt-po-links__text span { color: var(--an-muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } + +/* ---------- 响应式 ---------- */ +@media (max-width: 1440px) { + .aksrt-po-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } +} +@media (max-width: 1080px) { + .aksrt-po-grid--main { grid-template-columns: minmax(0, 1fr); } +} +@media (max-width: 782px) { + .aksrt-po-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } + .aksrt-po-kpi { padding: 12px 14px; } + .aksrt-po-kpi__value { font-size: 19px; } + .aksrt-po-chart--lg { height: 280px; } + .aksrt-po-chart--md { height: 240px; } + .aksrt-po-top .column-share { display: none; } +} diff --git a/assets/js/admin-pay-overview.js b/assets/js/admin-pay-overview.js new file mode 100644 index 00000000..81a78dbd --- /dev/null +++ b/assets/js/admin-pay-overview.js @@ -0,0 +1,407 @@ +/** + * 支付中心概览:区间筛选 + 指标卡 + ECharts 图表(成交趋势 / 分类成交 / 支付方式)+ 转化与退款 + 热销排行。 + * + * 首屏报表来自页面内 #aksrt-pay-overview-data(PayOverview 输出),之后切换区间 / 分类请求 + * GET aksrt/v1/admin/pay-overview(PayOverviewController)。ECharts 子集由 + * assets/js/runtime/libs/echarts-pay.min.js 提供(window.echarts)。仅本页入队。 + */ +(function () { + 'use strict'; + + var root = document.querySelector('.aksrt-po-page'); + var dataEl = document.getElementById('aksrt-pay-overview-data'); + if (!root || !dataEl || !window.echarts) return; + + var boot; + try { boot = JSON.parse(dataEl.textContent || '{}'); } catch (e) { return; } + + var echarts = window.echarts; + var i18n = boot.i18n || {}; + var currency = boot.currency || ''; + var COLORS = { paid: '#18a058', net: '#2080f0', refund: '#d03050', count: '#f0a020' }; + var PALETTE = ['#18a058', '#2080f0', '#f0a020', '#8a63d2', '#86909c', '#13c2c2', '#eb2f96']; + var TEXT = '#4e5969', MUTED = '#86909c', LINE = '#f0f1f4'; + + var state = { from: boot.initial.from, to: boot.initial.to, group: boot.initial.group || '', report: boot.initial.report }; + var charts = {}; + var reqSeq = 0; + + /* ---------------- 格式化 ---------------- */ + + function money(v) { + return currency + Number(v || 0).toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 }); + } + function int(v) { return Number(v || 0).toLocaleString(); } + function compact(v) { + var n = Math.abs(v); + if (n >= 1e8) return (v / 1e8).toFixed(1).replace(/\.0$/, '') + '亿'; + if (n >= 1e4) return (v / 1e4).toFixed(1).replace(/\.0$/, '') + '万'; + return String(Math.round(v * 100) / 100); + } + function pct(v) { return v === null || v === undefined ? '—' : Number(v).toFixed(1) + '%'; } + function shortLabel(label) { return label.length === 10 ? label.slice(5) : label; } + + /** 环比:基期为 0 时,本期有数为「新增」,否则不可比。 */ + function deltaInfo(cur, prev) { + cur = Number(cur || 0); prev = Number(prev || 0); + if (prev <= 0) return cur > 0 ? { cls: 'is-up', text: i18n.new } : { cls: 'is-flat', text: '—' }; + var d = (cur - prev) / prev * 100; + var cls = d > 0.05 ? 'is-up' : (d < -0.05 ? 'is-down' : 'is-flat'); + return { cls: cls, text: (d > 0.05 ? '↑' : (d < -0.05 ? '↓' : '')) + Math.abs(d).toFixed(1) + '%' }; + } + + /* ---------------- 日期 ---------------- */ + + function parse(s) { var p = s.split('-'); return new Date(Date.UTC(+p[0], +p[1] - 1, +p[2])); } + function fmt(d) { return d.toISOString().slice(0, 10); } + function shift(s, days) { var d = parse(s); d.setUTCDate(d.getUTCDate() + days); return fmt(d); } + function spanDays(a, b) { return Math.round((parse(b) - parse(a)) / 864e5) + 1; } + + function presetRange(key) { + var today = boot.today; + if (key === 'this_month') return [today.slice(0, 8) + '01', today]; + if (key === 'last_month') { + var first = parse(today.slice(0, 8) + '01'); + var lastEnd = new Date(first.getTime() - 864e5); + return [fmt(lastEnd).slice(0, 8) + '01', fmt(lastEnd)]; + } + var n = parseInt(key.slice(1), 10); + return [shift(today, -(n - 1)), today]; + } + + /* ---------------- 数据加载 ---------------- */ + + function setBusy(busy) { + root.classList.toggle('is-loading', busy); + var body = root.querySelector('[data-aksrt-po-body]'); + if (body) body.setAttribute('aria-busy', busy ? 'true' : 'false'); + } + + function showError(msg) { + var box = root.querySelector('[data-aksrt-po-error]'); + if (!box) return; + box.hidden = !msg; + box.querySelector('p').textContent = msg || ''; + } + + function load(from, to, group) { + if (spanDays(from, to) < 1 || spanDays(from, to) > boot.maxDays || to > boot.today) { + showError(i18n.badRange); + return; + } + var seq = ++reqSeq; + var url = boot.rest.url + (boot.rest.url.indexOf('?') === -1 ? '?' : '&') + + 'from=' + encodeURIComponent(from) + '&to=' + encodeURIComponent(to) + '&group=' + encodeURIComponent(group); + setBusy(true); + fetch(url, { credentials: 'same-origin', headers: { 'X-WP-Nonce': boot.rest.nonce } }) + .then(function (res) { return res.json().then(function (json) { return { ok: res.ok, json: json }; }); }) + .then(function (r) { + if (seq !== reqSeq) return; + if (!r.ok || !r.json || !r.json.success) throw new Error((r.json && r.json.message) || i18n.loadError); + state = { from: from, to: to, group: group, report: r.json.data }; + showError(''); + renderAll(); + }) + .catch(function (err) { if (seq === reqSeq) showError(err && err.message ? err.message : i18n.loadError); }) + .then(function () { if (seq === reqSeq) setBusy(false); }); + } + + /* ---------------- 指标卡 / 转化 / 排行 / 提示 ---------------- */ + + function renderKpis(rep) { + var t = rep.totals || {}, p = rep.previous || {}; + var defs = { + paid_amount: [money, function () { return int(t.paid_count) + ' ' + i18n.unit; }], + net_amount: [money, function () { return i18n.refund + ' ' + money(t.refund_amount); }], + paid_count: [int, function () { return ''; }], + buyers: [int, function () { return ''; }], + avg_amount: [money, function () { return ''; }], + refund_amount: [money, function () { return int(t.refund_count) + ' ' + i18n.unit; }], + }; + root.querySelectorAll('[data-kpi]').forEach(function (card) { + var key = card.getAttribute('data-kpi'), def = defs[key]; + if (!def) return; + card.querySelector('[data-kpi-value]').textContent = def[0](t[key]); + card.querySelector('[data-kpi-meta]').textContent = def[1](); + var d = deltaInfo(t[key], p[key]); + var el = card.querySelector('[data-kpi-delta]'); + // 退款上升是坏事:颜色反转。 + var cls = key === 'refund_amount' ? (d.cls === 'is-up' ? 'is-down' : (d.cls === 'is-down' ? 'is-up' : d.cls)) : d.cls; + el.className = 'aksrt-po-delta ' + cls; + el.textContent = i18n.basis + ' ' + d.text; + }); + var label = root.querySelector('[data-aksrt-po-range-label]'); + if (label && rep.range) label.textContent = rep.range.from + ' ~ ' + rep.range.to + '(' + rep.range.days + ' 天)'; + } + + function renderFunnel(rep) { + var t = rep.totals || {}, p = rep.previous || {}; + root.querySelectorAll('[data-aksrt-po-funnel] [data-metric]').forEach(function (li) { + var key = li.getAttribute('data-metric'); + var isCount = key === 'created_count'; + li.querySelector('[data-value]').textContent = isCount ? int(t[key]) : pct(t[key]); + var bar = li.querySelector('[data-bar]'); + bar.style.width = isCount ? '100%' : Math.max(0, Math.min(100, Number(t[key] || 0))) + '%'; + var deltaEl = li.querySelector('[data-delta]'); + if (isCount) { + var d = deltaInfo(t[key], p[key]); + deltaEl.className = 'aksrt-po-delta ' + d.cls; + deltaEl.textContent = i18n.basis + ' ' + d.text; + } else if (p[key] !== null && p[key] !== undefined && t[key] !== null && t[key] !== undefined) { + var diff = Number(t[key]) - Number(p[key]); + var good = key === 'conversion' ? diff >= 0 : diff <= 0; + deltaEl.className = 'aksrt-po-delta ' + (Math.abs(diff) < 0.05 ? 'is-flat' : (good ? 'is-up' : 'is-down')); + deltaEl.textContent = i18n.basis + ' ' + (diff > 0 ? '+' : '') + diff.toFixed(1) + 'pt'; + } else { + deltaEl.className = 'aksrt-po-delta is-flat'; + deltaEl.textContent = ''; + } + }); + } + + function renderTop(rep) { + var body = root.querySelector('[data-aksrt-po-top]'); + if (!body) return; + body.textContent = ''; + var rows = rep.top || []; + if (!rows.length) { + var tr = body.insertRow(), td = tr.insertCell(); + td.colSpan = 5; + td.className = 'aksrt-po-top__empty'; + td.textContent = i18n.noTop; + return; + } + var total = rows.reduce(function (s, r) { return s + Number(r.amount || 0); }, 0) || 1; + rows.forEach(function (r, i) { + var tr = body.insertRow(); + var rank = tr.insertCell(); + rank.className = 'column-rank'; + rank.innerHTML = ''; + rank.firstChild.textContent = String(i + 1); + var title = tr.insertCell(); + if (r.url) { + var a = document.createElement('a'); + a.href = r.url; + a.textContent = r.title; + title.appendChild(a); + } else { + title.textContent = r.title; + } + var count = tr.insertCell(); count.className = 'column-num'; count.textContent = int(r.count); + var amount = tr.insertCell(); amount.className = 'column-num'; amount.textContent = money(r.amount); + var share = tr.insertCell(); share.className = 'column-share'; + var ratio = Number(r.amount || 0) / total * 100; + share.innerHTML = ''; + share.querySelector('i').style.width = ratio.toFixed(1) + '%'; + share.lastChild.textContent = ratio.toFixed(1) + '%'; + }); + } + + function renderExcluded(rep) { + var box = root.querySelector('[data-aksrt-po-excluded]'); + if (!box) return; + var list = rep.excluded || []; + box.hidden = !list.length; + box.textContent = list.length ? i18n.excluded + list.map(function (x) { + return x.currency + ' ' + Number(x.amount).toFixed(2) + '(' + x.count + ' ' + i18n.unit + ')'; + }).join(';') : ''; + } + + /* ---------------- 图表 ---------------- */ + + function chart(key) { + var host = root.querySelector('[data-aksrt-po-chart="' + key + '"]'); + if (!host) return null; + if (!charts[key]) charts[key] = echarts.init(host, null, { renderer: 'svg' }); + return charts[key]; + } + + function baseAxis(labels) { + return { + type: 'category', + boundaryGap: false, + data: labels, + axisLine: { lineStyle: { color: '#e5e6eb' } }, + axisTick: { show: false }, + axisLabel: { color: MUTED, hideOverlap: true, formatter: shortLabel }, + }; + } + function valueAxis(formatter, show) { + return { + type: 'value', + show: show !== false, + splitLine: { lineStyle: { color: LINE } }, + axisLabel: { color: MUTED, formatter: formatter }, + minInterval: 1, + }; + } + function tooltip(formatters) { + return { + trigger: 'axis', + confine: true, + axisPointer: { type: 'line', lineStyle: { color: '#c9cdd4', type: 'dashed' } }, + backgroundColor: '#fff', + borderColor: '#e5e6eb', + textStyle: { color: TEXT, fontSize: 12 }, + extraCssText: 'box-shadow:0 8px 24px rgba(15,23,42,.12);border-radius:8px;', + valueFormatter: formatters, + }; + } + function area(color) { + return { + color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ + { offset: 0, color: color + '38' }, + { offset: 1, color: color + '00' }, + ]), + }; + } + function zoom(n) { + return n > 45 ? [{ type: 'inside', start: 0, end: 100 }, { type: 'slider', height: 18, bottom: 6, borderColor: 'transparent', fillerColor: 'rgba(24,160,88,.12)', handleSize: '80%', showDetail: false }] : []; + } + function emptyGraphic(isEmpty) { + return isEmpty ? [{ type: 'text', left: 'center', top: 'middle', silent: true, style: { text: i18n.empty, fill: MUTED, fontSize: 13 } }] : []; + } + + function renderTrend(rep) { + var c = chart('trend'); + if (!c) return; + var s = rep.series || { labels: [], paid: [], net: [], refund: [], count: [] }; + var n = s.labels.length; + var isEmpty = !s.paid.some(function (v) { return v > 0; }); + var smoothLine = function (name, data, color, extra) { + return Object.assign({ name: name, type: 'line', data: data, smooth: 0.35, showSymbol: false, symbolSize: 6, color: color, lineStyle: { width: 2.25 }, emphasis: { focus: 'series' } }, extra || {}); + }; + c.setOption({ + aria: { enabled: true }, + color: [COLORS.paid, COLORS.net, COLORS.refund, COLORS.count], + grid: { left: 8, right: 8, top: 40, bottom: n > 45 ? 36 : 8, containLabel: true }, + legend: { top: 0, left: 0, icon: 'roundRect', itemWidth: 12, itemHeight: 4, textStyle: { color: TEXT }, selected: { [i18n.refund]: true } }, + tooltip: tooltip(function (v) { return typeof v === 'number' && !Number.isInteger(v) ? money(v) : v; }), + xAxis: baseAxis(s.labels), + yAxis: [valueAxis(compact), valueAxis(function (v) { return v; })], + dataZoom: zoom(n), + graphic: emptyGraphic(isEmpty), + series: [ + smoothLine(i18n.paid, s.paid, COLORS.paid, { areaStyle: area(COLORS.paid), tooltip: { valueFormatter: money } }), + smoothLine(i18n.net, s.net, COLORS.net, { tooltip: { valueFormatter: money } }), + smoothLine(i18n.refund, s.refund, COLORS.refund, { lineStyle: { width: 1.5, type: 'dashed' }, tooltip: { valueFormatter: money } }), + { + name: i18n.count, type: 'line', yAxisIndex: 1, data: s.count, smooth: false, + showSymbol: n <= 31, symbol: 'circle', symbolSize: 5, color: COLORS.count, + lineStyle: { width: 1.5 }, itemStyle: { borderColor: '#fff', borderWidth: 1.5 }, + tooltip: { valueFormatter: function (v) { return int(v) + ' ' + i18n.unit; } }, + }, + ], + }, true); + } + + function renderGroups(rep) { + var c = chart('groups'); + if (!c) return; + var s = rep.series || { labels: [], groups: [] }; + var groups = s.groups || []; + var n = s.labels.length; + c.setOption({ + aria: { enabled: true }, + color: PALETTE, + grid: { left: 8, right: 8, top: 40, bottom: n > 45 ? 36 : 8, containLabel: true }, + legend: { top: 0, left: 0, icon: 'roundRect', itemWidth: 12, itemHeight: 4, textStyle: { color: TEXT } }, + tooltip: tooltip(money), + xAxis: baseAxis(s.labels), + yAxis: valueAxis(compact), + dataZoom: zoom(n), + graphic: emptyGraphic(!groups.length), + series: groups.map(function (g) { + return { name: g.name, type: 'line', data: g.data, smooth: 0.35, showSymbol: false, lineStyle: { width: 2 }, emphasis: { focus: 'series' } }; + }), + }, true); + } + + function renderMethods(rep) { + var c = chart('methods'); + if (!c) return; + var list = rep.methods || []; + var total = list.reduce(function (s, m) { return s + Number(m.amount || 0); }, 0); + c.setOption({ + aria: { enabled: true }, + color: PALETTE, + tooltip: { + trigger: 'item', confine: true, backgroundColor: '#fff', borderColor: '#e5e6eb', textStyle: { color: TEXT, fontSize: 12 }, + formatter: function (p) { return p.marker + p.name + '
' + money(p.value) + '(' + p.percent + '%,' + int(p.data.count) + ' ' + i18n.unit + ')'; }, + }, + legend: { bottom: 0, left: 'center', icon: 'circle', itemWidth: 8, itemHeight: 8, textStyle: { color: TEXT } }, + graphic: list.length ? [{ + type: 'group', left: 'center', top: '36%', silent: true, + children: [ + { type: 'text', style: { text: i18n.total, fill: MUTED, fontSize: 12, align: 'center' }, left: 'center', top: 0 }, + { type: 'text', style: { text: money(total), fill: '#1f2329', fontSize: 16, fontWeight: 600, align: 'center' }, left: 'center', top: 18 }, + ], + }] : emptyGraphic(true), + series: [{ + type: 'pie', radius: ['52%', '72%'], center: ['50%', '44%'], avoidLabelOverlap: true, + itemStyle: { borderColor: '#fff', borderWidth: 2, borderRadius: 4 }, + label: { show: false }, labelLine: { show: false }, + emphasis: { scale: true, scaleSize: 4 }, + data: list.map(function (m) { return { name: m.name, value: m.amount, count: m.count }; }), + }], + }, true); + } + + function renderAll() { + var rep = state.report || {}; + renderKpis(rep); + renderFunnel(rep); + renderTop(rep); + renderExcluded(rep); + renderTrend(rep); + renderGroups(rep); + renderMethods(rep); + } + + /* ---------------- 交互 ---------------- */ + + var presets = root.querySelector('[data-aksrt-po-presets]'); + var form = root.querySelector('[data-aksrt-po-range]'); + + function syncForm() { + if (!form) return; + form.elements.from.value = state.from; + form.elements.to.value = state.to; + form.elements.group.value = state.group; + } + function pressPreset(btn) { + if (!presets) return; + presets.querySelectorAll('button').forEach(function (b) { b.setAttribute('aria-pressed', b === btn ? 'true' : 'false'); }); + } + + if (presets) { + presets.addEventListener('click', function (e) { + var btn = e.target.closest('button[data-preset]'); + if (!btn) return; + var r = presetRange(btn.getAttribute('data-preset')); + pressPreset(btn); + state.from = r[0]; state.to = r[1]; + syncForm(); + load(r[0], r[1], form ? form.elements.group.value : state.group); + }); + } + if (form) { + form.addEventListener('submit', function (e) { + e.preventDefault(); + var from = form.elements.from.value, to = form.elements.to.value; + if (!from || !to || from > to) { showError(i18n.badRange); return; } + pressPreset(null); + load(from, to, form.elements.group.value); + }); + form.elements.group.addEventListener('change', function () { load(state.from, state.to, form.elements.group.value); }); + } + + var resizeTimer; + window.addEventListener('resize', function () { + clearTimeout(resizeTimer); + resizeTimer = setTimeout(function () { Object.keys(charts).forEach(function (k) { charts[k].resize(); }); }, 120); + }); + + syncForm(); + renderAll(); +})(); diff --git a/assets/js/runtime/libs/echarts-pay.min.js b/assets/js/runtime/libs/echarts-pay.min.js new file mode 100644 index 00000000..677ce675 --- /dev/null +++ b/assets/js/runtime/libs/echarts-pay.min.js @@ -0,0 +1,42 @@ +(()=>{var lM=Object.defineProperty;var er=(t,e)=>{for(var r in e)lM(t,r,{get:e[r],enumerable:!0})};var ay={};er(ay,{Axis:()=>Kp,ChartView:()=>ft,ComponentModel:()=>Se,ComponentView:()=>et,List:()=>Ss,Model:()=>Ce,PRIORITY:()=>vg,SeriesModel:()=>Tt,color:()=>of,connect:()=>UR,dataTool:()=>ZR,dependencies:()=>SR,disConnect:()=>FR,disconnect:()=>uw,dispose:()=>VR,env:()=>oe,extendChartView:()=>Sk,extendComponentModel:()=>yk,extendComponentView:()=>_k,extendSeriesModel:()=>xk,format:()=>Jg,getCoordinateSystemDimensions:()=>HR,getInstanceByDom:()=>gg,getInstanceById:()=>GR,getMap:()=>XR,graphic:()=>Qg,helper:()=>Hg,init:()=>zR,innerDrawElementOnCanvas:()=>lp,matrix:()=>wi,number:()=>Kg,parseGeoJSON:()=>Zp,parseGeoJson:()=>Zp,registerAction:()=>mi,registerCoordinateSystem:()=>Sg,registerCustomSeries:()=>YR,registerLayout:()=>bg,registerLoading:()=>xp,registerLocale:()=>dc,registerMap:()=>wg,registerPostInit:()=>_g,registerPostUpdate:()=>xg,registerPreprocessor:()=>yp,registerProcessor:()=>_p,registerTheme:()=>yg,registerTransform:()=>Cg,registerUpdateLifecycle:()=>eu,registerVisual:()=>Ui,setCanvasCreator:()=>WR,setPlatformAPI:()=>Vu,throttle:()=>Xa,time:()=>jg,use:()=>yt,util:()=>$g,vector:()=>gr,version:()=>xR,zrUtil:()=>pe,zrender:()=>Ef});/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */var Ph=function(t,e){return Ph=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(r[n]=i[n])},Ph(t,e)};function L(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Ph(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Ef={};er(Ef,{dispose:()=>ZI,disposeAll:()=>qI,getElementSSRData:()=>Vv,getInstance:()=>KI,init:()=>Df,registerPainter:()=>Fv,registerSSRDataGetter:()=>Gv,version:()=>jI});var uM=(function(){function t(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1}return t})(),fM=(function(){function t(){this.browser=new uM,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow=typeof window!="undefined"}return t})(),Xi=new fM;typeof wx=="object"&&typeof wx.getSystemInfoSync=="function"?(Xi.wxa=!0,Xi.touchEventsSupported=!0):typeof document=="undefined"&&typeof self!="undefined"?Xi.worker=!0:!Xi.hasGlobalWindow||"Deno"in window||typeof navigator!="undefined"&&typeof navigator.userAgent=="string"&&navigator.userAgent.indexOf("Node.js")>-1?(Xi.node=!0,Xi.svgSupported=!0):cM(navigator.userAgent,Xi);function cM(t,e){var r=e.browser,i=t.match(/Firefox\/([\d.]+)/),n=t.match(/MSIE\s([\d.]+)/)||t.match(/Trident\/.+?rv:(([\d.]+))/),a=t.match(/Edge?\/([\d.]+)/),o=/micromessenger/i.test(t);i&&(r.firefox=!0,r.version=i[1]),n&&(r.ie=!0,r.version=n[1]),a&&(r.edge=!0,r.version=a[1],r.newEdge=+a[1].split(".")[0]>18),o&&(r.weChat=!0),e.svgSupported=typeof SVGRect!="undefined",e.touchEventsSupported="ontouchstart"in window&&!r.ie&&!r.edge,e.pointerEventsSupported="onpointerdown"in window&&(r.edge||r.ie&&+r.version>=11);var s=e.domSupported=typeof document!="undefined";if(s){var l=document.documentElement.style;e.transform3dSupported=(r.ie&&"transition"in l||r.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in l)&&!("OTransition"in l),e.transformSupported=e.transform3dSupported||r.ie&&+r.version>=9}}var oe=Xi;var pe={};er(pe,{EPSILON:()=>MM,HashMap:()=>F0,RADIAN_TO_DEGREE:()=>Hn,assert:()=>ze,assignProps:()=>Uh,bind:()=>J,clone:()=>$,concatArray:()=>Vh,createCanvas:()=>bM,createHashMap:()=>G,createObject:()=>bi,curry:()=>be,defaults:()=>re,disableUserSelect:()=>EM,each:()=>T,eqNaN:()=>Si,extend:()=>P,filter:()=>Ae,find:()=>Fh,guid:()=>Vs,hasOwn:()=>Oe,indexOf:()=>ie,inherits:()=>Hs,isArray:()=>k,isArrayLike:()=>je,isBuiltInObject:()=>kh,isDom:()=>zn,isFunction:()=>X,isGradientObject:()=>Un,isImagePatternObject:()=>wM,isNumber:()=>se,isObject:()=>Y,isPrimitive:()=>po,isRegExp:()=>CM,isString:()=>U,isStringSafe:()=>vo,isTypedArray:()=>Ve,keys:()=>ne,logError:()=>Gs,map:()=>z,merge:()=>he,mergeAll:()=>SM,mixin:()=>ct,noop:()=>Me,normalizeCssArray:()=>Vn,reduce:()=>Ct,retrieve:()=>Fn,retrieve2:()=>W,retrieve3:()=>Gt,setAsPrimitive:()=>Gn,slice:()=>Ys,trim:()=>pt});var Fu=12,Nh="sans-serif",Vt=Fu+"px "+Nh,pM=20,hM=100,vM="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function dM(t){var e={};if(typeof JSON=="undefined")return e;for(var r=0;r=0)s=o*r.length;else for(var l=0;l=xM&&(Rh=0),Rh++}function Gs(){for(var t=[],e=0;eYu,applyTransform:()=>Qe,clone:()=>Gh,copy:()=>IM,create:()=>Ti,dist:()=>mo,distSquare:()=>Zi,distance:()=>Zs,distanceSquare:()=>V0,div:()=>RM,dot:()=>kM,len:()=>Yh,lenSquare:()=>Wh,length:()=>LM,lengthSquare:()=>PM,lerp:()=>qs,max:()=>mr,min:()=>dr,mul:()=>NM,negate:()=>BM,normalize:()=>Xh,scale:()=>Xs,scaleAndAdd:()=>OM,set:()=>Ws,sub:()=>Hh});function Ti(t,e){return t==null&&(t=0),e==null&&(e=0),[t,e]}function IM(t,e){return t[0]=e[0],t[1]=e[1],t}function Gh(t){return[t[0],t[1]]}function Ws(t,e,r){return t[0]=e,t[1]=r,t}function Yu(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function OM(t,e,r,i){return t[0]=e[0]+r[0]*i,t[1]=e[1]+r[1]*i,t}function Hh(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function Yh(t){return Math.sqrt(Wh(t))}var LM=Yh;function Wh(t){return t[0]*t[0]+t[1]*t[1]}var PM=Wh;function NM(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t}function RM(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t}function kM(t,e){return t[0]*e[0]+t[1]*e[1]}function Xs(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function Xh(t,e){var r=Yh(e);return r===0?(t[0]=0,t[1]=0):(t[0]=e[0]/r,t[1]=e[1]/r),t}function Zs(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}var mo=Zs;function V0(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}var Zi=V0;function BM(t,e){return t[0]=-e[0],t[1]=-e[1],t}function qs(t,e,r,i){return t[0]=e[0]+i*(r[0]-e[0]),t[1]=e[1]+i*(r[1]-e[1]),t}function Qe(t,e,r){var i=e[0],n=e[1];return t[0]=r[0]*i+r[2]*n+r[4],t[1]=r[1]*i+r[3]*n+r[5],t}function dr(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t}function mr(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t}var go=(function(){function t(e,r){this.target=e,this.topTarget=r&&r.topTarget}return t})(),zM=(function(){function t(e){this.handler=e,e.on("mousedown",this._dragStart,this),e.on("mousemove",this._drag,this),e.on("mouseup",this._dragEnd,this)}return t.prototype._dragStart=function(e){for(var r=e.target;r&&!r.draggable;)r=r.parent||r.__hostTarget;r&&(this._draggingTarget=r,r.dragging=!0,this._x=e.offsetX,this._y=e.offsetY,this.handler.dispatchToElement(new go(r,e),"dragstart",e.event))},t.prototype._drag=function(e){var r=this._draggingTarget;if(r){var i=e.offsetX,n=e.offsetY,a=i-this._x,o=n-this._y;this._x=i,this._y=n,r.drift(a,o,e),this.handler.dispatchToElement(new go(r,e),"drag",e.event);var s=this.handler.findHover(i,n,r).target,l=this._dropTarget;this._dropTarget=s,r!==s&&(l&&s!==l&&this.handler.dispatchToElement(new go(l,e),"dragleave",e.event),s&&s!==l&&this.handler.dispatchToElement(new go(s,e),"dragenter",e.event))}},t.prototype._dragEnd=function(e){var r=this._draggingTarget;r&&(r.dragging=!1),this.handler.dispatchToElement(new go(r,e),"dragend",e.event),this._dropTarget&&this.handler.dispatchToElement(new go(this._dropTarget,e),"drop",e.event),this._draggingTarget=null,this._dropTarget=null},t})(),G0=zM;var UM=(function(){function t(e){e&&(this._$eventProcessor=e)}return t.prototype.on=function(e,r,i,n){this._$handlers||(this._$handlers={});var a=this._$handlers;if(typeof r=="function"&&(n=i,i=r,r=null),!i||!e)return this;var o=this._$eventProcessor;r!=null&&o&&o.normalizeQuery&&(r=o.normalizeQuery(r)),a[e]||(a[e]=[]);for(var s=0;s>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",i[l]+":0",n[u]+":0",i[1-l]+":auto",n[1-u]+":auto",""].join("!important;"),t.appendChild(o),r.push(o)}return e.clearMarkers=function(){T(r,function(f){f.parentNode&&f.parentNode.removeChild(f)})},r}function GM(t,e,r){for(var i=r?"invTrans":"trans",n=e[i],a=e.srcCoords,o=[],s=[],l=!0,u=0;u<4;u++){var f=t[u].getBoundingClientRect(),c=2*u,p=f.left,h=f.top;o.push(p,h),l=l&&a&&p===a[c]&&h===a[c+1],s.push(t[u].offsetLeft,t[u].offsetTop)}return l&&n?n:(e.srcCoords=o,e[i]=r?qh(s,o):qh(o,s))}function jh(t){return t.nodeName.toUpperCase()==="CANVAS"}var HM=/([&<>"'])/g,YM={"&":"&","<":"<",">":">",'"':""","'":"'"};function Je(t){return t==null?"":(t+"").replace(HM,function(e,r){return YM[r]})}var WM=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Qh=[],XM=oe.browser.firefox&&+oe.browser.version.split(".")[0]<39;function Zu(t,e,r,i){return r=r||{},i?W0(t,e,r):XM&&e.layerX!=null&&e.layerX!==e.offsetX?(r.zrX=e.layerX,r.zrY=e.layerY):e.offsetX!=null?(r.zrX=e.offsetX,r.zrY=e.offsetY):W0(t,e,r),r}function W0(t,e,r){if(oe.domSupported&&t.getBoundingClientRect){var i=e.clientX,n=e.clientY;if(jh(t)){var a=t.getBoundingClientRect();r.zrX=i-a.left,r.zrY=n-a.top;return}else if(Xu(Qh,t,i,n)){r.zrX=Qh[0],r.zrY=Qh[1];return}}r.zrX=r.zrY=0}function qu(t){return t||window.event}function Ht(t,e,r){if(e=qu(e),e.zrX!=null)return e;var i=e.type,n=i&&i.indexOf("touch")>=0;if(n){var o=i!=="touchend"?e.targetTouches[0]:e.changedTouches[0];o&&Zu(t,o,e,r)}else{Zu(t,e,e,r);var a=ZM(e);e.zrDelta=a?a/120:-(e.detail||0)/3}var s=e.button;return e.which==null&&s!==void 0&&WM.test(e.type)&&(e.which=s&1?1:s&2?3:s&4?2:0),e}function ZM(t){var e=t.wheelDelta;if(e)return e;var r=t.deltaX,i=t.deltaY;if(r==null||i==null)return e;var n=Math.abs(i!==0?i:r),a=i>0?-1:i<0?1:r>0?-1:1;return 3*n*a}function X0(t,e,r,i){t.addEventListener(e,r,i)}function Z0(t,e,r,i){t.removeEventListener(e,r,i)}var Qr=function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0};function Jh(t){return t.which===2||t.which===3}var K0=(function(){function t(){this._track=[]}return t.prototype.recognize=function(e,r,i){return this._doTrack(e,r,i),this._recognize(e)},t.prototype.clear=function(){return this._track.length=0,this},t.prototype._doTrack=function(e,r,i){var n=e.touches;if(n){for(var a={points:[],touches:[],target:r,event:e},o=0,s=n.length;o1&&i&&i.length>1){var a=q0(i)/q0(n);!isFinite(a)&&(a=1),e.pinchScale=a;var o=qM(i);return e.pinchX=o[0],e.pinchY=o[1],{type:"pinch",target:t[0].target,event:e}}}}};var wi={};er(wi,{clone:()=>KM,copy:()=>Yn,create:()=>xt,identity:()=>yr,invert:()=>tr,mul:()=>Rr,rotate:()=>Wn,scale:()=>ev,translate:()=>yo});function xt(){return[1,0,0,1,0,0]}function yr(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function Yn(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function Rr(t,e,r){var i=e[0]*r[0]+e[2]*r[1],n=e[1]*r[0]+e[3]*r[1],a=e[0]*r[2]+e[2]*r[3],o=e[1]*r[2]+e[3]*r[3],s=e[0]*r[4]+e[2]*r[5]+e[4],l=e[1]*r[4]+e[3]*r[5]+e[5];return t[0]=i,t[1]=n,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t}function yo(t,e,r){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+r[0],t[5]=e[5]+r[1],t}function Wn(t,e,r,i){i===void 0&&(i=[0,0]);var n=e[0],a=e[2],o=e[4],s=e[1],l=e[3],u=e[5],f=Math.sin(r),c=Math.cos(r);return t[0]=n*c+s*f,t[1]=-n*f+s*c,t[2]=a*c+l*f,t[3]=-a*f+c*l,t[4]=c*(o-i[0])+f*(u-i[1])+i[0],t[5]=c*(u-i[1])-f*(o-i[0])+i[1],t}function ev(t,e,r){var i=r[0],n=r[1];return t[0]=e[0]*i,t[1]=e[1]*n,t[2]=e[2]*i,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*n,t}function tr(t,e){var r=e[0],i=e[2],n=e[4],a=e[1],o=e[3],s=e[5],l=r*o-a*i;return l?(l=1/l,t[0]=o*l,t[1]=-a*l,t[2]=-i*l,t[3]=r*l,t[4]=(i*s-o*n)*l,t[5]=(a*n-r*s)*l,t):null}function KM(t){var e=xt();return Yn(e,t),e}var jM=(function(){function t(e,r){this.x=e||0,this.y=r||0}return t.prototype.copy=function(e){return this.x=e.x,this.y=e.y,this},t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.set=function(e,r){return this.x=e,this.y=r,this},t.prototype.equal=function(e){return e.x===this.x&&e.y===this.y},t.prototype.add=function(e){return this.x+=e.x,this.y+=e.y,this},t.prototype.scale=function(e){this.x*=e,this.y*=e},t.prototype.scaleAndAdd=function(e,r){this.x+=e.x*r,this.y+=e.y*r},t.prototype.sub=function(e){return this.x-=e.x,this.y-=e.y,this},t.prototype.dot=function(e){return this.x*e.x+this.y*e.y},t.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},t.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},t.prototype.normalize=function(){var e=this.len();return this.x/=e,this.y/=e,this},t.prototype.distance=function(e){var r=this.x-e.x,i=this.y-e.y;return Math.sqrt(r*r+i*i)},t.prototype.distanceSquare=function(e){var r=this.x-e.x,i=this.y-e.y;return r*r+i*i},t.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},t.prototype.transform=function(e){if(e){var r=this.x,i=this.y;return this.x=e[0]*r+e[2]*i+e[4],this.y=e[1]*r+e[3]*i+e[5],this}},t.prototype.toArray=function(e){return e[0]=this.x,e[1]=this.y,e},t.prototype.fromArray=function(e){this.x=e[0],this.y=e[1]},t.set=function(e,r,i){e.x=r,e.y=i},t.copy=function(e,r){e.x=r.x,e.y=r.y},t.len=function(e){return Math.sqrt(e.x*e.x+e.y*e.y)},t.lenSquare=function(e){return e.x*e.x+e.y*e.y},t.dot=function(e,r){return e.x*r.x+e.y*r.y},t.add=function(e,r,i){e.x=r.x+i.x,e.y=r.y+i.y},t.sub=function(e,r,i){e.x=r.x-i.x,e.y=r.y-i.y},t.scale=function(e,r,i){e.x=r.x*i,e.y=r.y*i},t.scaleAndAdd=function(e,r,i,n){e.x=r.x+i.x*n,e.y=r.y+i.y*n},t.lerp=function(e,r,i,n){var a=1-n;e.x=a*r.x+n*i.x,e.y=a*r.y+n*i.y},t})(),le=jM;var jn=Math.min,_o=Math.max,iv=Math.abs,j0=["x","y"],QM=["width","height"],Xn=new le,Zn=new le,qn=new le,Kn=new le,rr=av(),js=rr.minTv,nv=rr.maxTv,Qs=[0,0],Ci=(function(){function t(e,r,i,n){tv(this,e,r,i,n)}return t.set=function(e,r,i,n,a){return n<0&&(r=r+n,n=-n),a<0&&(i=i+a,a=-a),e.x=r,e.y=i,e.width=n,e.height=a,e},t.prototype.union=function(e){var r=jn(e.x,this.x),i=jn(e.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=_o(e.x+e.width,this.x+this.width)-r:this.width=e.width,isFinite(this.y)&&isFinite(this.height)?this.height=_o(e.y+e.height,this.y+this.height)-i:this.height=e.height,this.x=r,this.y=i},t.prototype.applyTransform=function(e){t.applyTransform(this,this,e)},t.prototype.calculateTransform=function(e){return JM(xt(),this,e)},t.prototype.intersect=function(e,r,i){return t.intersect(this,e,r,i)},t.intersect=function(e,r,i,n){i&&le.set(i,0,0);var a=n&&n.outIntersectRect||null,o=n&&n.clamp;if(a&&(a.x=a.y=a.width=a.height=NaN),!e||!r)return!1;e instanceof t||(e=tv($M,e.x,e.y,e.width,e.height)),r instanceof t||(r=tv(eI,r.x,r.y,r.width,r.height));var s=!!i;rr.reset(n,s);var l=rr.touchThreshold,u=e.x+l,f=e.x+e.width-l,c=e.y+l,p=e.y+e.height-l,h=r.x+l,v=r.x+r.width-l,d=r.y+l,m=r.y+r.height-l;if(u>f||c>p||h>v||d>m)return!1;var g=!(f=e.x&&r<=e.x+e.width&&i>=e.y&&i<=e.y+e.height},t.prototype.contain=function(e,r){return t.contain(this,e,r)},t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.copy=function(e){Q0(this,e)},t.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},t.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},t.prototype.isZero=function(){return this.width===0||this.height===0},t.create=function(e){return new t(e?e.x:0,e?e.y:0,e?e.width:0,e?e.height:0)},t.copy=function(e,r){return e.x=r.x,e.y=r.y,e.width=r.width,e.height=r.height,e},t.applyTransform=function(e,r,i){if(!i){e!==r&&Q0(e,r);return}if(i[1]<1e-5&&i[1]>-1e-5&&i[2]<1e-5&&i[2]>-1e-5){var n=i[0],a=i[3],o=i[4],s=i[5];e.x=r.x*n+o,e.y=r.y*a+s,e.width=r.width*n,e.height=r.height*a,e.width<0&&(e.x+=e.width,e.width=-e.width),e.height<0&&(e.y+=e.height,e.height=-e.height);return}Xn.x=qn.x=r.x,Xn.y=Kn.y=r.y,Zn.x=Kn.x=r.x+r.width,Zn.y=qn.y=r.y+r.height,Xn.transform(i),Kn.transform(i),Zn.transform(i),qn.transform(i),e.x=jn(Xn.x,Zn.x,qn.x,Kn.x),e.y=jn(Xn.y,Zn.y,qn.y,Kn.y);var l=_o(Xn.x,Zn.x,qn.x,Kn.x),u=_o(Xn.y,Zn.y,qn.y,Kn.y);e.width=l-e.x,e.height=u-e.y},t.calculateTransform=function(e,r,i){var n=i.width/r.width,a=i.height/r.height;return e=yr(e||[]),yo(e,e,Ws(rv,-r.x,-r.y)),ev(e,e,Ws(rv,n,a)),yo(e,e,Ws(rv,i.x,i.y)),e},t})(),mF=Ci.create,tv=Ci.set,Q0=Ci.copy,JM=Ci.calculateTransform,gF=Ci.applyTransform,yF=Ci.contain,$M=new Ci(0,0,0,0),eI=new Ci(0,0,0,0),rv=[];function J0(t,e,r,i,n,a,o,s){var l=iv(e-r),u=iv(i-t),f=jn(l,u),c=j0[n],p=j0[1-n],h=QM[n];e=u||!rr.bidirectional)&&(js[c]=-u,js[p]=0,rr.useDir&&rr.calcDirMTV())))}function av(){var t=0,e=new le,r=new le,i={minTv:new le,maxTv:new le,useDir:!1,dirMinTv:new le,touchThreshold:0,bidirectional:!0,negativeSize:!1,reset:function(a,o){i.touchThreshold=0,a&&a.touchThreshold!=null&&(i.touchThreshold=_o(0,a.touchThreshold)),i.negativeSize=!1,o&&(i.minTv.set(1/0,1/0),i.maxTv.set(0,0),i.useDir=!1,a&&a.direction!=null&&(i.useDir=!0,i.dirMinTv.copy(i.minTv),r.copy(i.minTv),t=a.direction,i.bidirectional=a.bidirectional==null||!!a.bidirectional,i.bidirectional||e.set(Math.cos(t),Math.sin(t))))},calcDirMTV:function(){var a=i.minTv,o=i.dirMinTv,s=a.y*a.y+a.x*a.x,l=Math.sin(t),u=Math.cos(t),f=l*a.y+u*a.x;if(n(f)){n(a.x)&&n(a.y)&&o.set(0,0);return}if(r.x=s*u/f,r.y=s*l/f,n(r.x)&&n(r.y)){o.set(0,0);return}(i.bidirectional||e.dot(r)>0)&&r.len()=0;c--){var p=a[c];p!==n&&!p.ignore&&!p.ignoreCoarsePointer&&(!p.parent||!p.parent.ignoreCoarsePointer)&&(ov.copy(p.getBoundingRect()),p.transform&&ov.applyTransform(p.transform),ov.intersect(f)&&s.push(p))}if(s.length)for(var h=4,v=Math.PI/12,d=Math.PI*2,m=0;m4)return;this._downPoint=null}this.dispatchToElement(a,t,e)}});function aI(t,e,r){if(t[t.rectHover?"rectContain":"contain"](e,r)){for(var i=t,n=void 0,a=!1;i;){if(i.ignoreClip&&(a=!0),!a){var o=i.getClipPath();if(o&&!o.contain(e,r))return!1}i.silent&&(n=!0);var s=i.__hostTarget;i=s?i.ignoreHostSilent?null:s:i.parent}return n?e_:!0}return!1}function $0(t,e,r,i,n){for(var a=t.length-1;a>=0;a--){var o=t[a],s=void 0;if(o!==n&&!o.ignore&&(s=aI(o,r,i))&&(!e.topTarget&&(e.topTarget=o),s!==e_)){e.target=o;break}}}function r_(t,e,r){var i=t.painter;return e<0||e>i.getWidth()||r<0||r>i.getHeight()}var i_=t_;var o_=32,$s=7;function oI(t){for(var e=0;t>=o_;)e|=t&1,t>>=1;return t+e}function n_(t,e,r,i){var n=e+1;if(n===r)return 1;if(i(t[n++],t[e])<0){for(;n=0;)n++;return n-e}function sI(t,e,r){for(r--;e>>1,n(a,t[l])<0?s=l:o=l+1;var u=i-o;switch(u){case 3:t[o+3]=t[o+2];case 2:t[o+2]=t[o+1];case 1:t[o+1]=t[o];break;default:for(;u>0;)t[o+u]=t[o+u-1],u--}t[o]=a}}function sv(t,e,r,i,n,a){var o=0,s=0,l=1;if(a(t,e[r+n])>0){for(s=i-n;l0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=n,l+=n}else{for(s=n+1;ls&&(l=s);var u=o;o=n-l,l=n-u}for(o++;o>>1);a(t,e[r+f])>0?o=f+1:l=f}return l}function lv(t,e,r,i,n,a){var o=0,s=0,l=1;if(a(t,e[r+n])<0){for(s=n+1;ls&&(l=s);var u=o;o=n-l,l=n-u}else{for(s=i-n;l=0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=n,l+=n}for(o++;o>>1);a(t,e[r+f])<0?l=f:o=f+1}return l}function lI(t,e){var r=$s,i,n,a=0,o=[];i=[],n=[];function s(h,v){i[a]=h,n[a]=v,a+=1}function l(){for(;a>1;){var h=a-2;if(h>=1&&n[h-1]<=n[h]+n[h+1]||h>=2&&n[h-2]<=n[h]+n[h-1])n[h-1]n[h+1])break;f(h)}}function u(){for(;a>1;){var h=a-2;h>0&&n[h-1]=$s||w>=$s);if(A)break;S<0&&(S=0),S+=2}if(r=S,r<1&&(r=1),v===1){for(g=0;g=0;g--)t[b+g]=t[S+g];t[x]=o[_];return}for(var w=r;;){var A=0,C=0,D=!1;do if(e(o[_],t[y])<0){if(t[x--]=t[y--],A++,C=0,--v===0){D=!0;break}}else if(t[x--]=o[_--],C++,A=0,--m===1){D=!0;break}while((A|C)=0;g--)t[b+g]=t[S+g];if(v===0){D=!0;break}}if(t[x--]=o[_--],--m===1){D=!0;break}if(C=m-sv(t[y],o,0,m,m-1,e),C!==0){for(x-=C,_-=C,m-=C,b=x+1,S=_+1,g=0;g=$s||C>=$s);if(D)break;w<0&&(w=0),w+=2}if(r=w,r<1&&(r=1),m===1){for(x-=v,y-=v,b=x+1,S=y+1,g=v-1;g>=0;g--)t[b+g]=t[S+g];t[x]=o[_]}else{if(m===0)throw new Error;for(S=x-(m-1),g=0;gs&&(l=s),a_(t,r,r+l,r+a,e),a=l}o.pushRun(r,a),o.mergeRuns(),n-=a,r+=a}while(n!==0);o.forceMergeRuns()}}var At=1,Jn=2,qi=4;var s_=!1;function uv(){s_||(s_=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function l_(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.z2-e.z2:t.z-e.z:t.zlevel-e.zlevel}var uI=(function(){function t(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=l_}return t.prototype.traverse=function(e,r){for(var i=0;i=0&&this._roots.splice(n,1)},t.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},t.prototype.getRoots=function(){return this._roots},t.prototype.dispose=function(){this._displayList=null,this._roots=null},t})(),u_=uI;var f_;f_=oe.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(t){return setTimeout(t,16)};var fv=f_;var Ku={linear:function(t){return t},quadraticIn:function(t){return t*t},quadraticOut:function(t){return t*(2-t)},quadraticInOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},cubicIn:function(t){return t*t*t},cubicOut:function(t){return--t*t*t+1},cubicInOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},quarticIn:function(t){return t*t*t*t},quarticOut:function(t){return 1- --t*t*t*t},quarticInOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},quinticIn:function(t){return t*t*t*t*t},quinticOut:function(t){return--t*t*t*t*t+1},quinticInOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},sinusoidalIn:function(t){return 1-Math.cos(t*Math.PI/2)},sinusoidalOut:function(t){return Math.sin(t*Math.PI/2)},sinusoidalInOut:function(t){return .5*(1-Math.cos(Math.PI*t))},exponentialIn:function(t){return t===0?0:Math.pow(1024,t-1)},exponentialOut:function(t){return t===1?1:1-Math.pow(2,-10*t)},exponentialInOut:function(t){return t===0?0:t===1?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(-Math.pow(2,-10*(t-1))+2)},circularIn:function(t){return 1-Math.sqrt(1-t*t)},circularOut:function(t){return Math.sqrt(1- --t*t)},circularInOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},elasticIn:function(t){var e,r=.1,i=.4;return t===0?0:t===1?1:(!r||r<1?(r=1,e=i/4):e=i*Math.asin(1/r)/(2*Math.PI),-(r*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i)))},elasticOut:function(t){var e,r=.1,i=.4;return t===0?0:t===1?1:(!r||r<1?(r=1,e=i/4):e=i*Math.asin(1/r)/(2*Math.PI),r*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/i)+1)},elasticInOut:function(t){var e,r=.1,i=.4;return t===0?0:t===1?1:(!r||r<1?(r=1,e=i/4):e=i*Math.asin(1/r)/(2*Math.PI),(t*=2)<1?-.5*(r*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i)):r*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i)*.5+1)},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},backInOut:function(t){var e=2.5949095;return(t*=2)<1?.5*(t*t*((e+1)*t-e)):.5*((t-=2)*t*((e+1)*t+e)+2)},bounceIn:function(t){return 1-Ku.bounceOut(1-t)},bounceOut:function(t){return t<.36363636363636365?7.5625*t*t:t<.7272727272727273?7.5625*(t-=.5454545454545454)*t+.75:t<.9090909090909091?7.5625*(t-=.8181818181818182)*t+.9375:7.5625*(t-=.9545454545454546)*t+.984375},bounceInOut:function(t){return t<.5?Ku.bounceIn(t*2)*.5:Ku.bounceOut(t*2-1)*.5+.5}},ju=Ku;var Qu=Math.pow,ji=Math.sqrt,$u=1e-8,p_=1e-4,c_=ji(3),Ju=1/3,Jr=Ti(),_r=Ti(),xo=Ti();function Ki(t){return t>-$u&&t<$u}function h_(t){return t>$u||t<-$u}function Ue(t,e,r,i,n){var a=1-n;return a*a*(a*t+3*n*e)+n*n*(n*i+3*a*r)}function cv(t,e,r,i,n){var a=1-n;return 3*(((e-t)*a+2*(r-e)*n)*a+(i-r)*n*n)}function $n(t,e,r,i,n,a){var o=i+3*(e-r)-t,s=3*(r-e*2+t),l=3*(e-t),u=t-n,f=s*s-3*o*l,c=s*l-9*o*u,p=l*l-3*s*u,h=0;if(Ki(f)&&Ki(c))if(Ki(s))a[0]=0;else{var v=-l/s;v>=0&&v<=1&&(a[h++]=v)}else{var d=c*c-4*f*p;if(Ki(d)){var m=c/f,v=-s/o+m,g=-m/2;v>=0&&v<=1&&(a[h++]=v),g>=0&&g<=1&&(a[h++]=g)}else if(d>0){var y=ji(d),_=f*s+1.5*o*(-c+y),x=f*s+1.5*o*(-c-y);_<0?_=-Qu(-_,Ju):_=Qu(_,Ju),x<0?x=-Qu(-x,Ju):x=Qu(x,Ju);var v=(-s-(_+x))/(3*o);v>=0&&v<=1&&(a[h++]=v)}else{var S=(2*f*s-3*o*c)/(2*ji(f*f*f)),b=Math.acos(S)/3,w=ji(f),A=Math.cos(b),v=(-s-2*w*A)/(3*o),g=(-s+w*(A+c_*Math.sin(b)))/(3*o),C=(-s+w*(A-c_*Math.sin(b)))/(3*o);v>=0&&v<=1&&(a[h++]=v),g>=0&&g<=1&&(a[h++]=g),C>=0&&C<=1&&(a[h++]=C)}}return h}function ef(t,e,r,i,n){var a=6*r-12*e+6*t,o=9*e+3*i-3*t-9*r,s=3*e-3*t,l=0;if(Ki(o)){if(h_(a)){var u=-s/a;u>=0&&u<=1&&(n[l++]=u)}}else{var f=a*a-4*o*s;if(Ki(f))n[0]=-a/(2*o);else if(f>0){var c=ji(f),u=(-a+c)/(2*o),p=(-a-c)/(2*o);u>=0&&u<=1&&(n[l++]=u),p>=0&&p<=1&&(n[l++]=p)}}return l}function So(t,e,r,i,n,a){var o=(e-t)*n+t,s=(r-e)*n+e,l=(i-r)*n+r,u=(s-o)*n+o,f=(l-s)*n+s,c=(f-u)*n+u;a[0]=t,a[1]=o,a[2]=u,a[3]=c,a[4]=c,a[5]=f,a[6]=l,a[7]=i}function v_(t,e,r,i,n,a,o,s,l,u,f){var c,p=.005,h=1/0,v,d,m,g;Jr[0]=l,Jr[1]=u;for(var y=0;y<1;y+=.05)_r[0]=Ue(t,r,n,o,y),_r[1]=Ue(e,i,a,s,y),m=Zi(Jr,_r),m=0&&m=0&&u<=1&&(n[l++]=u)}}else{var f=o*o-4*a*s;if(Ki(f)){var u=-o/(2*a);u>=0&&u<=1&&(n[l++]=u)}else if(f>0){var c=ji(f),u=(-o+c)/(2*a),p=(-o-c)/(2*a);u>=0&&u<=1&&(n[l++]=u),p>=0&&p<=1&&(n[l++]=p)}}return l}function tf(t,e,r){var i=t+r-2*e;return i===0?.5:(t-e)/i}function bo(t,e,r,i,n){var a=(e-t)*i+t,o=(r-e)*i+e,s=(o-a)*i+a;n[0]=t,n[1]=a,n[2]=s,n[3]=s,n[4]=o,n[5]=r}function g_(t,e,r,i,n,a,o,s,l){var u,f=.005,c=1/0;Jr[0]=o,Jr[1]=s;for(var p=0;p<1;p+=.05){_r[0]=ot(t,r,n,p),_r[1]=ot(e,i,a,p);var h=Zi(Jr,_r);h=0&&h=1?1:$n(0,i,a,1,l,s)&&Ue(0,n,o,1,s[0])}}}var cI=(function(){function t(e){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=e.life||1e3,this._delay=e.delay||0,this.loop=e.loop||!1,this.onframe=e.onframe||Me,this.ondestroy=e.ondestroy||Me,this.onrestart=e.onrestart||Me,e.easing&&this.setEasing(e.easing)}return t.prototype.step=function(e,r){if(this._inited||(this._startTime=e+this._delay,this._inited=!0),this._paused){this._pausedTime+=r;return}var i=this._life,n=e-this._startTime-this._pausedTime,a=n/i;a<0&&(a=0),a=Math.min(a,1);var o=this.easingFunc,s=o?o(a):a;if(this.onframe(s),a===1)if(this.loop){var l=n%i;this._startTime=e-l,this._pausedTime=0,this.onrestart()}else return!0;return!1},t.prototype.pause=function(){this._paused=!0},t.prototype.resume=function(){this._paused=!1},t.prototype.setEasing=function(e){this.easing=e,this.easingFunc=X(e)?e:ju[e]||To(e)},t})(),__=cI;var of={};er(of,{fastLerp:()=>w_,fastMapToColor:()=>gI,lerp:()=>af,lift:()=>gv,liftColor:()=>Ao,lum:()=>ea,mapToColor:()=>yI,modifyAlpha:()=>_I,modifyHSL:()=>Co,parse:()=>ht,parseCssFloat:()=>Ji,parseCssInt:()=>nf,random:()=>xI,stringify:()=>ei,toHex:()=>mI});var x_=(function(){function t(e){this.value=e}return t})();var pI=(function(){function t(){this._len=0}return t.prototype.insert=function(e){var r=new x_(e);return this.insertEntry(r),r},t.prototype.insertEntry=function(e){this.head?(this.tail.next=e,e.prev=this.tail,e.next=null,this.tail=e):this.head=this.tail=e,this._len++},t.prototype.remove=function(e){var r=e.prev,i=e.next;r?r.next=i:this.head=i,i?i.prev=r:this.tail=r,e.next=e.prev=null,this._len--},t.prototype.len=function(){return this._len},t.prototype.clear=function(){this.head=this.tail=null,this._len=0},t})();var hI=(function(){function t(e){this._list=new pI,this._maxSize=10,this._map={},this._maxSize=e}return t.prototype.put=function(e,r){var i=this._list,n=this._map,a=null;if(n[e]==null){var o=i.len(),s=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var l=i.head;i.remove(l),delete n[l.key],a=l.value,this._lastRemovedEntry=l}s?s.value=r:s=new x_(r),s.key=e,i.insertEntry(s),n[e]=s}return a},t.prototype.get=function(e){var r=this._map[e],i=this._list;if(r!=null)return r!==i.tail&&(i.remove(r),i.insertEntry(r)),r.value},t.prototype.clear=function(){this._list.clear(),this._map={}},t.prototype.len=function(){return this._list.len()},t})(),$r=hI;var S_={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function kr(t){return t=Math.round(t),t<0?0:t>255?255:t}function vI(t){return t=Math.round(t),t<0?0:t>360?360:t}function el(t){return t<0?0:t>1?1:t}function nf(t){var e=t;return e.length&&e.charAt(e.length-1)==="%"?kr(parseFloat(e)/100*255):kr(parseInt(e,10))}function Ji(t){var e=t;return e.length&&e.charAt(e.length-1)==="%"?el(parseFloat(e)/100):el(parseFloat(e))}function vv(t,e,r){return r<0?r+=1:r>1&&(r-=1),r*6<1?t+(e-t)*r*6:r*2<1?e:r*3<2?t+(e-t)*(2/3-r)*6:t}function Qi(t,e,r){return t+(e-t)*r}function xr(t,e,r,i,n){return t[0]=e,t[1]=r,t[2]=i,t[3]=n,t}function dv(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}var T_=new $r(20),rf=null;function wo(t,e){rf&&dv(rf,e),rf=T_.put(t,rf||e.slice())}function ht(t,e){if(t){e=e||[];var r=T_.get(t);if(r)return dv(e,r);t=t+"";var i=t.replace(/ /g,"").toLowerCase();if(i in S_)return dv(e,S_[i]),wo(t,e),e;var n=i.length;if(i.charAt(0)==="#"){if(n===4||n===5){var a=parseInt(i.slice(1,4),16);if(!(a>=0&&a<=4095)){xr(e,0,0,0,1);return}return xr(e,(a&3840)>>4|(a&3840)>>8,a&240|(a&240)>>4,a&15|(a&15)<<4,n===5?parseInt(i.slice(4),16)/15:1),wo(t,e),e}else if(n===7||n===9){var a=parseInt(i.slice(1,7),16);if(!(a>=0&&a<=16777215)){xr(e,0,0,0,1);return}return xr(e,(a&16711680)>>16,(a&65280)>>8,a&255,n===9?parseInt(i.slice(7),16)/255:1),wo(t,e),e}return}var o=i.indexOf("("),s=i.indexOf(")");if(o!==-1&&s+1===n){var l=i.substr(0,o),u=i.substr(o+1,s-(o+1)).split(","),f=1;switch(l){case"rgba":if(u.length!==4)return u.length===3?xr(e,+u[0],+u[1],+u[2],1):xr(e,0,0,0,1);f=Ji(u.pop());case"rgb":if(u.length>=3)return xr(e,nf(u[0]),nf(u[1]),nf(u[2]),u.length===3?f:Ji(u[3])),wo(t,e),e;xr(e,0,0,0,1);return;case"hsla":if(u.length!==4){xr(e,0,0,0,1);return}return u[3]=Ji(u[3]),mv(u,e),wo(t,e),e;case"hsl":if(u.length!==3){xr(e,0,0,0,1);return}return mv(u,e),wo(t,e),e;default:return}}xr(e,0,0,0,1)}}function mv(t,e){var r=(parseFloat(t[0])%360+360)%360/360,i=Ji(t[1]),n=Ji(t[2]),a=n<=.5?n*(i+1):n+i-n*i,o=n*2-a;return e=e||[],xr(e,kr(vv(o,a,r+1/3)*255),kr(vv(o,a,r)*255),kr(vv(o,a,r-1/3)*255),1),t.length===4&&(e[3]=t[3]),e}function dI(t){if(t){var e=t[0]/255,r=t[1]/255,i=t[2]/255,n=Math.min(e,r,i),a=Math.max(e,r,i),o=a-n,s=(a+n)/2,l,u;if(o===0)l=0,u=0;else{s<.5?u=o/(a+n):u=o/(2-a-n);var f=((a-e)/6+o/2)/o,c=((a-r)/6+o/2)/o,p=((a-i)/6+o/2)/o;e===a?l=p-c:r===a?l=1/3+f-p:i===a&&(l=2/3+c-f),l<0&&(l+=1),l>1&&(l-=1)}var h=[l*360,u,s];return t[3]!=null&&h.push(t[3]),h}}function gv(t,e){var r=ht(t);if(r){for(var i=0;i<3;i++)e<0?r[i]=r[i]*(1-e)|0:r[i]=(255-r[i])*e+r[i]|0,r[i]>255?r[i]=255:r[i]<0&&(r[i]=0);return ei(r,r.length===4?"rgba":"rgb")}}function mI(t){var e=ht(t);if(e)return((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1)}function w_(t,e,r){if(!(!(e&&e.length)||!(t>=0&&t<=1))){r=r||[];var i=t*(e.length-1),n=Math.floor(i),a=Math.ceil(i),o=e[n],s=e[a],l=i-n;return r[0]=kr(Qi(o[0],s[0],l)),r[1]=kr(Qi(o[1],s[1],l)),r[2]=kr(Qi(o[2],s[2],l)),r[3]=el(Qi(o[3],s[3],l)),r}}var gI=w_;function af(t,e,r){if(!(!(e&&e.length)||!(t>=0&&t<=1))){var i=t*(e.length-1),n=Math.floor(i),a=Math.ceil(i),o=ht(e[n]),s=ht(e[a]),l=i-n,u=ei([kr(Qi(o[0],s[0],l)),kr(Qi(o[1],s[1],l)),kr(Qi(o[2],s[2],l)),el(Qi(o[3],s[3],l))],"rgba");return r?{color:u,leftIndex:n,rightIndex:a,value:i}:u}}var yI=af;function Co(t,e,r,i){var n=ht(t);if(t)return n=dI(n),e!=null&&(n[0]=vI(X(e)?e(n[0]):e)),r!=null&&(n[1]=Ji(X(r)?r(n[1]):r)),i!=null&&(n[2]=Ji(X(i)?i(n[2]):i)),ei(mv(n),"rgba")}function _I(t,e){var r=ht(t);if(r&&e!=null)return r[3]=el(e),ei(r,"rgba")}function ei(t,e){if(!(!t||!t.length)){var r=t[0]+","+t[1]+","+t[2];return(e==="rgba"||e==="hsva"||e==="hsla")&&(r+=","+t[3]),e+"("+r+")"}}function ea(t,e){var r=ht(t);return r?(.299*r[0]+.587*r[1]+.114*r[2])*r[3]/255+(1-r[3])*e:0}function xI(){return ei([Math.round(Math.random()*255),Math.round(Math.random()*255),Math.round(Math.random()*255)],"rgb")}var b_=new $r(100);function Ao(t){if(U(t)){var e=b_.get(t);return e||(e=gv(t,-.1),b_.put(t,e)),e}else if(Un(t)){var r=P({},t);return r.colorStops=z(t.colorStops,function(i){return{offset:i.offset,color:gv(i.color,-.1)}}),r}return t}var lf=Math.round;function $i(t){var e;if(!t||t==="transparent")t="none";else if(typeof t=="string"&&t.indexOf("rgba")>-1){var r=ht(t);r&&(t="rgb("+r[0]+","+r[1]+","+r[2]+")",e=r[3])}return{color:t,opacity:e==null?1:e}}var C_=1e-4;function ti(t){return t-C_}function sf(t){return lf(t*1e3)/1e3}function uf(t){return lf(t*1e4)/1e4}function A_(t){return"matrix("+sf(t[0])+","+sf(t[1])+","+sf(t[2])+","+sf(t[3])+","+uf(t[4])+","+uf(t[5])+")"}var D_={left:"start",right:"end",center:"middle",middle:"middle"};function E_(t,e,r){return r==="top"?t+=e/2:r==="bottom"&&(t-=e/2),t}function M_(t){return t&&(t.shadowBlur||t.shadowOffsetX||t.shadowOffsetY)}function I_(t){var e=t.style,r=t.getGlobalScale();return[e.shadowColor,(e.shadowBlur||0).toFixed(2),(e.shadowOffsetX||0).toFixed(2),(e.shadowOffsetY||0).toFixed(2),r[0],r[1]].join(",")}function yv(t){return t&&!!t.image}function SI(t){return t&&!!t.svgElement}function tl(t){return yv(t)||SI(t)}function ff(t){return t.type==="linear"}function cf(t){return t.type==="radial"}function pf(t){return t&&(t.type==="linear"||t.type==="radial")}function rl(t){return"url(#"+t+")"}function hf(t){var e=t.getGlobalScale(),r=Math.max(e[0],e[1]);return Math.max(Math.ceil(Math.log(r)/Math.log(10)),1)}function vf(t){var e=t.x||0,r=t.y||0,i=(t.rotation||0)*Hn,n=W(t.scaleX,1),a=W(t.scaleY,1),o=t.skewX||0,s=t.skewY||0,l=[];return(e||r)&&l.push("translate("+e+"px,"+r+"px)"),i&&l.push("rotate("+i+")"),(n!==1||a!==1)&&l.push("scale("+n+","+a+")"),(o||s)&&l.push("skew("+lf(o*Hn)+"deg, "+lf(s*Hn)+"deg)"),l.join(" ")}var O_=(function(){return typeof Buffer!="undefined"&&typeof Buffer.from=="function"?function(t){return Buffer.from(t).toString("base64")}:typeof btoa=="function"&&typeof unescape=="function"&&typeof encodeURIComponent=="function"?function(t){return btoa(unescape(encodeURIComponent(t)))}:function(t){return null}})();var xv=Array.prototype.slice;function Ai(t,e,r){return(e-t)*r+t}function _v(t,e,r,i){for(var n=e.length,a=0;ai?e:t,a=Math.min(r,i),o=n[a-1]||{color:[0,0,0,0],offset:0},s=a;so;if(s)i.length=o;else for(var l=a;l=1},t.prototype.getAdditiveTrack=function(){return this._additiveTrack},t.prototype.addKeyframe=function(e,r,i){this._needsSort=!0;var n=this.keyframes,a=n.length,o=!1,s=P_,l=r;if(je(r)){var u=CI(r);s=u,(u===1&&!se(r[0])||u===2&&!se(r[0][0]))&&(o=!0)}else if(se(r)&&!Si(r))s=mf;else if(U(r))if(!isNaN(+r))s=mf;else{var f=ht(r);f&&(l=f,s=nl)}else if(Un(r)){var c=P({},l);c.colorStops=z(r.colorStops,function(h){return{offset:h.offset,color:ht(h.color)}}),ff(r)?s=Sv:cf(r)&&(s=bv),l=c}a===0?this.valType=s:(s!==this.valType||s===P_)&&(o=!0),this.discrete=this.discrete||o;var p={time:e,value:l,rawValue:r,percent:0};return i&&(p.easing=i,p.easingFunc=X(i)?i:ju[i]||To(i)),n.push(p),p},t.prototype.prepare=function(e,r){var i=this.keyframes;this._needsSort&&i.sort(function(d,m){return d.time-m.time});for(var n=this.valType,a=i.length,o=i[a-1],s=this.discrete,l=gf(n),u=N_(n),f=0;f=0&&!(o[f].percent<=r);f--);f=p(f,s-2)}else{for(f=c;fr);f++);f=p(f-1,s-2)}v=o[f+1],h=o[f]}if(h&&v){this._lastFr=f,this._lastFrP=r;var m=v.percent-h.percent,g=m===0?1:p((r-h.percent)/m,1);v.easingFunc&&(g=v.easingFunc(g));var y=i?this._additiveValue:u?il:e[l];if((gf(a)||u)&&!y&&(y=this._additiveValue=[]),this.discrete)e[l]=g<1?h.rawValue:v.rawValue;else if(gf(a))a===_f?_v(y,h[n],v[n],g):bI(y,h[n],v[n],g);else if(N_(a)){var _=h[n],x=v[n],S=a===Sv;e[l]={type:S?"linear":"radial",x:Ai(_.x,x.x,g),y:Ai(_.y,x.y,g),colorStops:z(_.colorStops,function(w,A){var C=x.colorStops[A];return{offset:Ai(w.offset,C.offset,g),color:yf(_v([],w.color,C.color,g))}}),global:x.global},S?(e[l].x2=Ai(_.x2,x.x2,g),e[l].y2=Ai(_.y2,x.y2,g)):e[l].r=Ai(_.r,x.r,g)}else if(u)_v(y,h[n],v[n],g),i||(e[l]=yf(y));else{var b=Ai(h[n],v[n],g);i?this._additiveValue=b:e[l]=b}i&&this._addToTarget(e)}}},t.prototype._addToTarget=function(e){var r=this.valType,i=this.propName,n=this._additiveValue;r===mf?e[i]=e[i]+n:r===nl?(ht(e[i],il),df(il,il,n,1),e[i]=yf(il)):r===_f?df(e[i],e[i],n,1):r===R_&&L_(e[i],e[i],n,1)},t})(),DI=(function(){function t(e,r,i,n){if(this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=e,this._loop=r,r&&n){Gs("Can' use additive animation on looped animation.");return}this._additiveAnimators=n,this._allowDiscrete=i}return t.prototype.getMaxTime=function(){return this._maxTime},t.prototype.getDelay=function(){return this._delay},t.prototype.getLoop=function(){return this._loop},t.prototype.getTarget=function(){return this._target},t.prototype.changeTarget=function(e){this._target=e},t.prototype.when=function(e,r,i){return this.whenWithKeys(e,r,ne(r),i)},t.prototype.whenWithKeys=function(e,r,i,n){for(var a=this._tracks,o=0;o0&&l.addKeyframe(0,al(u),n),this._trackKeys.push(s)}l.addKeyframe(e,al(r[s]),n)}return this._maxTime=Math.max(this._maxTime,e),this},t.prototype.pause=function(){this._clip.pause(),this._paused=!0},t.prototype.resume=function(){this._clip.resume(),this._paused=!1},t.prototype.isPaused=function(){return!!this._paused},t.prototype.duration=function(e){return this._maxTime=e,this._force=!0,this},t.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var e=this._doneCbs;if(e)for(var r=e.length,i=0;i0)){this._started=1;for(var r=this,i=[],n=this._maxTime||0,a=0;a1){var s=o.pop();a.addKeyframe(s.time,e[n]),a.prepare(this._maxTime,a.getAdditiveTrack())}}}},t})(),ol=DI;function ta(){return new Date().getTime()}var EI=(function(t){L(e,t);function e(r){var i=t.call(this)||this;return i._running=!1,i._time=0,i._pausedTime=0,i._pauseStart=0,i._paused=!1,r=r||{},i.stage=r.stage||{},i}return e.prototype.addClip=function(r){r.animation&&this.removeClip(r),this._head?(this._tail.next=r,r.prev=this._tail,r.next=null,this._tail=r):this._head=this._tail=r,r.animation=this},e.prototype.addAnimator=function(r){r.animation=this;var i=r.getClip();i&&this.addClip(i)},e.prototype.removeClip=function(r){if(r.animation){var i=r.prev,n=r.next;i?i.next=n:this._head=n,n?n.prev=i:this._tail=i,r.next=r.prev=r.animation=null}},e.prototype.removeAnimator=function(r){var i=r.getClip();i&&this.removeClip(i),r.animation=null},e.prototype.update=function(r){for(var i=ta()-this._pausedTime,n=i-this._time,a=this._head;a;){var o=a.next,s=a.step(i,n);s&&(a.ondestroy(),this.removeClip(a)),a=o}this._time=i,r||(this.trigger("frame",n),this.stage.update&&this.stage.update())},e.prototype._startLoop=function(){var r=this;this._running=!0;function i(){r._running&&(fv(i),!r._paused&&r.update())}fv(i)},e.prototype.start=function(){this._running||(this._time=ta(),this._pausedTime=0,this._startLoop())},e.prototype.stop=function(){this._running=!1},e.prototype.pause=function(){this._paused||(this._pauseStart=ta(),this._paused=!0)},e.prototype.resume=function(){this._paused&&(this._pausedTime+=ta()-this._pauseStart,this._paused=!1)},e.prototype.clear=function(){for(var r=this._head;r;){var i=r.next;r.prev=r.next=r.animation=null,r=i}this._head=this._tail=null},e.prototype.isFinished=function(){return this._head==null},e.prototype.animate=function(r,i){i=i||{},this.start();var n=new ol(r,i.loop);return this.addAnimator(n),n},e})(_t),k_=EI;var MI=300,Tv=oe.domSupported,wv=(function(){var t=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],e=["touchstart","touchend","touchmove"],r={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},i=z(t,function(n){var a=n.replace("mouse","pointer");return r.hasOwnProperty(a)?a:n});return{mouse:t,touch:e,pointer:i}})(),B_={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},z_=!1;function Dv(t){var e=t.pointerType;return e==="pen"||e==="touch"}function II(t){t.touching=!0,t.touchTimer!=null&&(clearTimeout(t.touchTimer),t.touchTimer=null),t.touchTimer=setTimeout(function(){t.touching=!1,t.touchTimer=null},700)}function Cv(t){t&&(t.zrByTouch=!0)}function OI(t,e){return Ht(t.dom,new LI(t,e),!0)}function F_(t,e){for(var r=e,i=!1;r&&r.nodeType!==9&&!(i=r.domBelongToZr||r!==e&&r===t.painterRoot);)r=r.parentNode;return i}var LI=(function(){function t(e,r){this.stopPropagation=Me,this.stopImmediatePropagation=Me,this.preventDefault=Me,this.type=r.type,this.target=this.currentTarget=e.dom,this.pointerType=r.pointerType,this.clientX=r.clientX,this.clientY=r.clientY}return t})(),Br={mousedown:function(t){t=Ht(this.dom,t),this.__mayPointerCapture=[t.zrX,t.zrY],this.trigger("mousedown",t)},mousemove:function(t){t=Ht(this.dom,t);var e=this.__mayPointerCapture;e&&(t.zrX!==e[0]||t.zrY!==e[1])&&this.__togglePointerCapture(!0),this.trigger("mousemove",t)},mouseup:function(t){t=Ht(this.dom,t),this.__togglePointerCapture(!1),this.trigger("mouseup",t)},mouseout:function(t){t=Ht(this.dom,t);var e=t.toElement||t.relatedTarget;F_(this,e)||(this.__pointerCapturing&&(t.zrEventControl="no_globalout"),this.trigger("mouseout",t))},wheel:function(t){z_=!0,t=Ht(this.dom,t),this.trigger("mousewheel",t)},mousewheel:function(t){z_||(t=Ht(this.dom,t),this.trigger("mousewheel",t))},touchstart:function(t){t=Ht(this.dom,t),Cv(t),this.__lastTouchMoment=new Date,this.handler.processGesture(t,"start"),Br.mousemove.call(this,t),Br.mousedown.call(this,t)},touchmove:function(t){t=Ht(this.dom,t),Cv(t),this.handler.processGesture(t,"change"),Br.mousemove.call(this,t)},touchend:function(t){t=Ht(this.dom,t),Cv(t),this.handler.processGesture(t,"end"),Br.mouseup.call(this,t),+new Date-+this.__lastTouchMomentW_||t<-W_}var ia=[],Do=[],Iv=xt(),Ov=Math.abs,X_=(function(){function t(){}return t.prototype.getLocalTransform=function(e){return kI(this,e)},t.prototype.setPosition=function(e){this.x=e[0],this.y=e[1]},t.prototype.setScale=function(e){this.scaleX=e[0],this.scaleY=e[1]},t.prototype.setSkew=function(e){this.skewX=e[0],this.skewY=e[1]},t.prototype.setOrigin=function(e){this.originX=e[0],this.originY=e[1]},t.prototype.needLocalTransform=function(){return ra(this.rotation)||ra(this.x)||ra(this.y)||ra(this.scaleX-1)||ra(this.scaleY-1)||ra(this.skewX)||ra(this.skewY)},t.prototype.updateTransform=function(){var e=this.parent&&this.parent.transform,r=this.needLocalTransform(),i=this.transform;if(!(r||e)){i&&(Y_(i),this.invTransform=null);return}i=i||xt(),r?this.getLocalTransform(i):Y_(i),e&&(r?Rr(i,e,i):Yn(i,e)),this.transform=i,this._resolveGlobalScaleRatio(i),this.invTransform=this.invTransform||xt(),tr(this.invTransform,i)},t.prototype._resolveGlobalScaleRatio=function(e){var r=this.globalScaleRatio;if(r!=null&&r!==1){this.getGlobalScale(ia);var i=ia[0]<0?-1:1,n=ia[1]<0?-1:1,a=((ia[0]-i)*r+i)/ia[0]||0,o=((ia[1]-n)*r+n)/ia[1]||0;e[0]*=a,e[1]*=a,e[2]*=o,e[3]*=o}},t.prototype.getComputedTransform=function(){for(var e=this,r=[];e;)r.push(e),e=e.parent;for(;e=r.pop();)e.updateTransform();return this.transform},t.prototype.setLocalTransform=function(e){if(e){var r=e[0]*e[0]+e[1]*e[1],i=e[2]*e[2]+e[3]*e[3],n=Math.atan2(e[1],e[0]),a=Math.PI/2+n-Math.atan2(e[3],e[2]);i=Math.sqrt(i)*Math.cos(a),r=Math.sqrt(r),this.skewX=a,this.skewY=0,this.rotation=-n,this.x=+e[4],this.y=+e[5],this.scaleX=r,this.scaleY=i,this.originX=0,this.originY=0}},t.prototype.decomposeTransform=function(){if(this.transform){var e=this.parent,r=this.transform;e&&e.transform&&(e.invTransform=e.invTransform||xt(),Rr(Do,e.invTransform,r),r=Do);var i=this.originX,n=this.originY;(i||n)&&(Iv[4]=i,Iv[5]=n,Rr(Do,r,Iv),Do[4]-=i,Do[5]-=n,r=Do),this.setLocalTransform(r)}},t.prototype.getGlobalScale=function(e){var r=this.transform;return e=e||[],r?(e[0]=Math.sqrt(r[0]*r[0]+r[1]*r[1]),e[1]=Math.sqrt(r[2]*r[2]+r[3]*r[3]),r[0]<0&&(e[0]=-e[0]),r[3]<0&&(e[1]=-e[1]),e):(e[0]=1,e[1]=1,e)},t.prototype.transformCoordToLocal=function(e,r){var i=[e,r],n=this.invTransform;return n&&Qe(i,i,n),i},t.prototype.transformCoordToGlobal=function(e,r){var i=[e,r],n=this.transform;return n&&Qe(i,i,n),i},t.prototype.getLineScale=function(){var e=this.transform;return e&&Ov(e[0]-1)>1e-10&&Ov(e[3]-1)>1e-10?Math.sqrt(Ov(e[0]*e[3]-e[2]*e[1])):1},t.prototype.copyTransform=function(e){en(this,e)},t.getLocalTransform=function(e,r){r=r||[];var i=e.originX||0,n=e.originY||0,a=e.scaleX,o=e.scaleY,s=e.anchorX,l=e.anchorY,u=e.rotation||0,f=e.x,c=e.y,p=e.skewX?Math.tan(e.skewX):0,h=e.skewY?Math.tan(-e.skewY):0;if(i||n||s||l){var v=i+s,d=n+l;r[4]=-v*a-p*d*o,r[5]=-d*o-h*v*a}else r[4]=r[5]=0;return r[0]=a,r[3]=o,r[1]=h*a,r[2]=p*o,u&&Wn(r,r,u),r[4]+=i+f,r[5]+=n+c,r},t.initDefaultProps=(function(){var e=t.prototype;e.scaleX=e.scaleY=e.globalScaleRatio=1,e.x=e.y=e.originX=e.originY=e.skewX=e.skewY=e.rotation=e.anchorX=e.anchorY=0})(),t})(),kI=X_.getLocalTransform;var Eo=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function en(t,e){return Uh(t,e,Eo)}var Mo=X_;function Ur(t){Sf||(Sf=new $r(100)),t=t||Vt;var e=Sf.get(t);return e||(e={font:t,strWidthCache:new $r(500),asciiWidthMap:null,asciiWidthMapTried:!1,stWideCharWidth:at.measureText("\u56FD",t).width,asciiCharWidth:at.measureText("a",t).width},Sf.put(t,e)),e}var Sf;function BI(t){if(!(Lv>=Z_)){t=t||Vt;for(var e=[],r=+new Date,i=0;i<=127;i++)e[i]=at.measureText(String.fromCharCode(i),t).width;var n=+new Date-r;return n>16?Lv=Z_:n>2&&Lv++,e}}var Lv=0,Z_=5;function Pv(t,e){return t.asciiWidthMapTried||(t.asciiWidthMap=BI(t.font),t.asciiWidthMapTried=!0),0<=e&&e<=127?t.asciiWidthMap!=null?t.asciiWidthMap[e]:t.asciiCharWidth:t.stWideCharWidth}function Fr(t,e){var r=t.strWidthCache,i=r.get(e);return i==null&&(i=at.measureText(e,t.font).width,r.put(e,i)),i}function q_(t,e,r,i){var n=Fr(Ur(e),t),a=na(e),o=tn(0,n,r),s=Di(0,a,i),l=new ae(o,s,n,a);return l}function bf(t,e,r,i){var n=((t||"")+"").split(` +`),a=n.length;if(a===1)return q_(n[0],e,r,i);for(var o=new ae(0,0,0,0),s=0;s=0?parseFloat(t)/100*e:parseFloat(t):t}function aa(t,e,r){var i=e.position||"inside",n=e.distance!=null?e.distance:5,a=r.height,o=r.width,s=a/2,l=r.x,u=r.y,f="left",c="top";if(i instanceof Array)l+=zr(i[0],r.width),u+=zr(i[1],r.height),f=null,c=null;else switch(i){case"left":l-=n,u+=s,f="right",c="middle";break;case"right":l+=n+o,u+=s,c="middle";break;case"top":l+=o/2,u-=n,f="center",c="bottom";break;case"bottom":l+=o/2,u+=a+n,f="center";break;case"inside":l+=o/2,u+=s,f="center",c="middle";break;case"insideLeft":l+=n,u+=s,c="middle";break;case"insideRight":l+=o-n,u+=s,f="right",c="middle";break;case"insideTop":l+=o/2,u+=n,f="center";break;case"insideBottom":l+=o/2,u+=a-n,f="center",c="bottom";break;case"insideTopLeft":l+=n,u+=n;break;case"insideTopRight":l+=o-n,u+=n,f="right";break;case"insideBottomLeft":l+=n,u+=a-n,c="bottom";break;case"insideBottomRight":l+=o-n,u+=a-n,f="right",c="bottom";break}return t=t||{},t.x=l,t.y=u,t.align=f,t.verticalAlign=c,t}var Nv="__zr_normal__",Rv=Eo.concat(["ignore"]),zI=Ct(Eo,function(t,e){return t[e]=!0,t},{ignore:!1}),Io={},UI=new ae(0,0,0,0),Tf=[],wf=0,Oo=1,zv=(function(){function t(e){this.id=Vs(),this.animators=[],this.currentStates=[],this.states={},this._init(e)}return t.prototype._init=function(e){this.attr(e)},t.prototype.drift=function(e,r,i){switch(this.draggable){case"horizontal":r=0;break;case"vertical":e=0;break}var n=this.transform;n||(n=this.transform=[1,0,0,1,0,0]),n[4]+=e,n[5]+=r,this.decomposeTransform(),this.markRedraw()},t.prototype.beforeUpdate=function(){},t.prototype.afterUpdate=function(){},t.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},t.prototype.updateInnerText=function(e){var r=this._textContent;if(r&&(!r.ignore||e)){this.textConfig||(this.textConfig={});var i=this.textConfig,n=i.local,a=r.innerTransformable,o=void 0,s=void 0,l=!1;a.parent=n?this:null;var u=!1;a.copyTransform(r);var f=i.position!=null,c=i.autoOverflowArea,p=void 0;if((c||f)&&(p=UI,i.layoutRect?p.copy(i.layoutRect):p.copy(this.getBoundingRect()),n||p.applyTransform(this.transform)),f){this.calculateTextPosition?this.calculateTextPosition(Io,i,p):aa(Io,i,p),a.x=Io.x,a.y=Io.y,o=Io.align,s=Io.verticalAlign;var h=i.origin;if(h&&i.rotation!=null){var v=void 0,d=void 0;h==="center"?(v=p.width*.5,d=p.height*.5):(v=zr(h[0],p.width),d=zr(h[1],p.height)),u=!0,a.originX=-a.x+v+(n?0:p.x),a.originY=-a.y+d+(n?0:p.y)}}i.rotation!=null&&(a.rotation=i.rotation);var m=i.offset;m&&(a.x+=m[0],a.y+=m[1],u||(a.originX=-m[0],a.originY=-m[1]));var g=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={});if(c){var y=g.overflowRect=g.overflowRect||new ae(0,0,0,0);a.getLocalTransform(Tf),tr(Tf,Tf),ae.copy(y,p),y.applyTransform(Tf)}else g.overflowRect=null;var _=i.inside==null?typeof i.position=="string"&&i.position.indexOf("inside")>=0:i.inside,x=void 0,S=void 0,b=void 0;_&&this.canBeInsideText()?(x=i.insideFill,S=i.insideStroke,(x==null||x==="auto")&&(x=this.getInsideTextFill()),(S==null||S==="auto")&&(S=this.getInsideTextStroke(x),b=!0)):(x=i.outsideFill,S=i.outsideStroke,(x==null||x==="auto")&&(x=this.getOutsideFill()),(S==null||S==="auto")&&(S=this.getOutsideStroke(x),b=!0)),x=x||"#000",(x!==g.fill||S!==g.stroke||b!==g.autoStroke||o!==g.align||s!==g.verticalAlign)&&(l=!0,g.fill=x,g.stroke=S,g.autoStroke=b,g.align=o,g.verticalAlign=s,r.setDefaultTextStyle(g)),r.__dirty|=At,l&&r.dirtyStyle(!0)}},t.prototype.canBeInsideText=function(){return!0},t.prototype.getInsideTextFill=function(){return"#fff"},t.prototype.getInsideTextStroke=function(e){return"#000"},t.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?ul:ll},t.prototype.getOutsideStroke=function(e){var r=this.__zr&&this.__zr.getBackgroundColor(),i=typeof r=="string"&&ht(r);i||(i=[255,255,255,1]);for(var n=i[3],a=this.__zr.isDarkMode(),o=0;o<3;o++)i[o]=i[o]*n+(a?0:255)*(1-n);return i[3]=1,ei(i,"rgba")},t.prototype.traverse=function(e,r){},t.prototype.attrKV=function(e,r){e==="textConfig"?this.setTextConfig(r):e==="textContent"?this.setTextContent(r):e==="clipPath"?this.setClipPath(r):e==="extra"?(this.extra=this.extra||{},P(this.extra,r)):this[e]=r},t.prototype.hide=function(){this.ignore=!0,this.markRedraw()},t.prototype.show=function(){this.ignore=!1,this.markRedraw()},t.prototype.attr=function(e,r){if(typeof e=="string")this.attrKV(e,r);else if(Y(e))for(var i=e,n=ne(i),a=0;a0},t.prototype.getState=function(e){return this.states[e]},t.prototype.ensureState=function(e){var r=this.states;return r[e]||(r[e]={}),r[e]},t.prototype.clearStates=function(e){this.useState(Nv,!1,e)},t.prototype.useState=function(e,r,i,n){var a=e===Nv,o=this.hasState();if(!(!o&&a)){var s=this.currentStates,l=this.stateTransition;if(!(ie(s,e)>=0&&(r||s.length===1))){var u;if(this.stateProxy&&!a&&(u=this.stateProxy(e)),u||(u=this.states&&this.states[e]),!u&&!a){Gs("State "+e+" not exists.");return}a||this.saveCurrentToNormalState(u);var f=this._textContent,c=j_(this,f,u,n);c&&!this.__inHover&&(this.__inHover=c),this._applyStateObj(e,u,this._normalState,r,J_(this,i,l),l);var p=this._textGuide;return f&&f.useState(e,r,i,!!c),p&&p.useState(e,r,i,!!c),a?(this.currentStates=[],this._normalState={}):r?this.currentStates.push(e):this.currentStates=[e],this._updateAnimationTargets(),this.markRedraw(),!c&&this.__inHover&&(this.__inHover=wf,this.__dirty&=~At),u}}},t.prototype.useStates=function(e,r,i){if(!e.length)this.clearStates();else{var n=[],a=this.currentStates,o=e.length,s=o===a.length;if(s){for(var l=0;l=0){var i=this.currentStates.slice();i.splice(r,1),this.useStates(i)}},t.prototype.replaceState=function(e,r,i){var n=this.currentStates.slice(),a=ie(n,e),o=ie(n,r)>=0;a>=0?o?n.splice(a,1):n[a]=r:i&&!o&&n.push(r),this.useStates(n)},t.prototype.toggleState=function(e,r){r?this.useState(e,!0):this.removeState(e)},t.prototype._mergeStates=function(e){for(var r={},i,n=0;n=0&&a.splice(o,1)}),this.animators.push(e),i&&i.animation.addAnimator(e),i&&i.wakeUp()},t.prototype.updateDuringAnimation=function(e){this.markRedraw()},t.prototype.stopAnimation=function(e,r){for(var i=this.animators,n=i.length,a=[],o=0;o0&&r.during&&a[0].during(function(v,d){r.during(d)});for(var p=0;p0||n.force&&!o.length){var A=void 0,C=void 0,D=void 0;if(s){C={},p&&(A={});for(var x=0;x<_;x++){var g=d[x];C[g]=r[g],p?A[g]=i[g]:r[g]=i[g]}}else if(p){D={};for(var x=0;x<_;x++){var g=d[x];D[g]=al(r[g]),VI(r,i,g)}}var S=new ol(r,!1,!1,c?Ae(v,function(I){return I.targetName===e}):null);S.targetName=e,n.scope&&(S.scope=n.scope),p&&A&&S.whenWithKeys(0,A,d),D&&S.whenWithKeys(0,D,d),S.whenWithKeys(u==null?500:u,s?C:i,d).delay(f||0),t.addAnimator(S,e),o.push(S)}}function j_(t,e,r,i){return!(r&&r.hoverLayer||i)||Q_(t)||e&&Q_(e)?wf:Oo}function Q_(t){return t.type==="text"||t.type==="tspan"}function J_(t,e,r){return!e&&!t.__inHover&&r&&r.duration>0}var Cf=zv;var ex=(function(t){L(e,t);function e(r){var i=t.call(this)||this;return i.isGroup=!0,i._children=[],i.attr(r),i}return e.prototype.childrenRef=function(){return this._children},e.prototype.children=function(){return this._children.slice()},e.prototype.childAt=function(r){return this._children[r]},e.prototype.childOfName=function(r){for(var i=this._children,n=0;n=0&&(n.splice(a,0,r),this._doAdd(r))}return this},e.prototype.replace=function(r,i){var n=ie(this._children,r);return n>=0&&this.replaceAt(i,n),this},e.prototype.replaceAt=function(r,i){var n=this._children,a=n[i];if(r&&r!==this&&r.parent!==this&&r!==a){n[i]=r,a.parent=null;var o=this.__zr;o&&a.removeSelfFromZr(o),this._doAdd(r)}return this},e.prototype._doAdd=function(r){r.parent&&r.parent.remove(r),r.parent=this;var i=this.__zr;i&&i!==r.__zr&&r.addSelfToZr(i),i&&i.refresh()},e.prototype.remove=function(r){var i=this.__zr,n=this._children,a=ie(n,r);return a<0?this:(n.splice(a,1),r.parent=null,i&&r.removeSelfFromZr(i),i&&i.refresh(),this)},e.prototype.removeAll=function(){for(var r=this._children,i=this.__zr,n=0;n0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},t.prototype.setSleepAfterStill=function(e){this._sleepAfterStill=e},t.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},t.prototype.refreshHover=function(){this._needsRefreshHover=!0},t.prototype.refreshHoverImmediately=function(){this._disposed||this._refresh({animUpdate:!1,refresh:!1,refreshHover:!0})},t.prototype.resize=function(e){this._disposed||(e=e||{},this.painter.resize(e.width,e.height),this.handler.resize())},t.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},t.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},t.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},t.prototype.setCursorStyle=function(e){this._disposed||this.handler.setCursorStyle(e)},t.prototype.findHover=function(e,r){if(!this._disposed)return this.handler.findHover(e,r)},t.prototype.on=function(e,r,i){return this._disposed||this.handler.on(e,r,i),this},t.prototype.off=function(e,r){this._disposed||this.handler.off(e,r)},t.prototype.trigger=function(e,r){this._disposed||this.handler.trigger(e,r)},t.prototype.clear=function(){if(!this._disposed){for(var e=this.storage.getRoots(),r=0;r0){if(t<=n)return o;if(t>=a)return s}else{if(t>=n)return o;if(t<=a)return s}else{if(t===n)return o;if(t===a)return s}return(t-n)/l*u+o}var we=eO;function eO(t,e,r){switch(t){case"center":case"middle":t="50%";break;case"left":case"top":t="0%";break;case"right":case"bottom":t="100%";break}return If(t,e,r)}function If(t,e,r){return U(t)?tO(t)?parseFloat(t)/100*e+(r||0):parseFloat(t):t==null?NaN:+t}function tO(t){return!!QI(t).match(/%$/)}function de(t,e,r){return isNaN(e)?r?""+t:+t:(e=Ne(ve(0,e),Mf),t=(+t).toFixed(e),r?t:+t)}function rx(t,e,r){return e==null&&(e=10),de(t,e,r)}function Dt(t){return t.sort(function(e,r){return e-r}),t}function ir(t){if(t=+t,isNaN(t))return 0;if(t>1e-14){for(var e=1,r=0;r<15;r++,e*=10)if(Yt(t*e)/e===t)return r}return Hv(t)}function Hv(t){var e=t.toString().toLowerCase(),r=e.indexOf("e"),i=r>0?+e.slice(r+1):0,n=r>0?r:e.length,a=e.indexOf("."),o=a<0?0:n-1-a;return ve(0,o-i)}function ix(t,e){var r=Wt(rn(t[1]-t[0])/fl),i=Yt(rn(Ie(e[1]-e[0]))/fl),n=Ne(ve(-r+i,0),Mf);return isFinite(n)?n:Mf}function Of(t,e,r){var i=Ie(t[1]-t[0]);if(!isFinite(i)||i===0)return NaN;var n=rn(2*Ie(r||1)*Ie(i))/fl,a=rn(Ie(e))/fl,o=ve(0,ri(-n+a));return isFinite(o)||(o=NaN),o}function nx(t,e,r){if(!t[e])return 0;var i=Yv(t,r);return i[e]||0}function Yv(t,e){var r=Ct(t,function(h,v){return h+(isNaN(v)?0:v)},0);if(r===0)return[];for(var i=nn(10,e),n=z(t,function(h){return(isNaN(h)?0:h)/r*i*100}),a=i*100,o=z(n,function(h){return Wt(h)}),s=Ct(o,function(h,v){return h+v},0),l=z(n,function(h,v){return h-o[v]});su&&(u=l[c],f=c);++o[f],l[f]=0,++s}return z(o,function(h){return h/i})}function Ei(t,e){var r=ve(ir(t),ir(e)),i=t+e;return r>Mf?i:de(i,r)}var cl=nn(2,53)-1;function pl(t){var e=JI*2;return(t%e+e)%e}function sa(t){return t>-tx&&t=10&&e++,e}var Wv=2;function Mi(t,e){var r=Po(t),i=nn(10,r),n=t/i,a;return e===Wv?a=1:e?n<1.5?a=1:n<2.5?a=2:n<4?a=3:n<7?a=5:a=10:n<1?a=1:n<2?a=2:n<3?a=3:n<5?a=5:a=10,t=a*i,de(t,-r)}function ax(t,e){var r=(t.length-1)*e+1,i=Wt(r),n=+t[i-1],a=r-i;return a?n+a*(t[i]-n):n}function ox(t){t.sort(function(l,u){return s(l,u,0)?-1:1});for(var e=-1/0,r=1,i=0;i0?e.length:0,this.item=null,this.key=NaN,this},t.prototype.next=function(){return(this._step>0?this._idx=this._end)?(this.item=this._list[this._idx],this.key=this._idx=this._idx+this._step,!0):!1},t})();function St(){return[1/0,-1/0]}function yl(t,e){Vr(e)&&(et[1]&&(t[1]=e))}function Qv(t,e){Vr(e)&&et[1]&&(t[1]=e)}function xx(t,e){Oi(e[0],e[1])&&(e[0]t[1]&&(t[1]=e[1]))}function Vr(t){return t!=null&&isFinite(t)}function Oi(t,e){return Vr(t)&&Vr(e)&&t<=e}function Sx(t){var e=t[1]-t[0];return isFinite(e)&&e>=0}function ko(t){Oi(t[0],t[1])&&t[0]>t[1]&&(t[0]=t[1])}function Bo(){var t="__ec_once_"+dO++;return function(e,r){Oe(e,t)||(e[t]=1,r())}}var dO=vl();function zo(t,e,r){var i=G(),n=0;T(t,function(a){var o=e(a),s=i.get(o)||0;r&&r(a,s),!s&&!r&&(t[n++]=a),i.set(o,s+1)}),r||(t.length=n)}function bx(t){return t.value+""}function Tx(t){return t+""}function Cx(t,e){return W(e,!0)?t.seriesIndex+2:0}function Pf(t,e,r){var i=t.getData().count();return{progressiveRender:r.progressiveEnabled&&e.incrementalPrepareRender&&i>=r.threshold,large:t.get("large")&&i>=t.get("largeThreshold"),modDataCount:t.get("progressiveChunkMode")==="mod"?t.getData().count():null}}function Ax(t,e){return{seriesType:t,overallReset:e}}function on(t){return{overallReset:t}}var mO=".",la="___EC__COMPONENT__CONTAINER___",Dx="___EC__EXTENDED_CLASS___";function Xt(t){var e={main:"",sub:""};if(t){var r=t.split(mO);e.main=r[0]||"",e.sub=r[1]||""}return e}function gO(t){ze(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(t),'componentType "'+t+'" illegal')}function Ex(t){return!!(t&&t[Dx])}function Uo(t,e){t.$constructor=t,t.extend=function(r){var i=this,n;return yO(i)?n=(function(a){L(o,a);function o(){return a.apply(this,arguments)||this}return o})(i):(n=function(){(r.$constructor||i).apply(this,arguments)},Hs(n,this)),P(n.prototype,r),n[Dx]=!0,n.extend=this.extend,n.superCall=xO,n.superApply=SO,n.superClass=i,n}}function yO(t){return X(t)&&/^class\s/.test(Function.prototype.toString.call(t))}function Nf(t,e){t.extend=e.extend}var _O=Math.round(Math.random()*10);function Mx(t){var e=["__\0is_clz",_O++].join("_");t.prototype[e]=!0,t.isInstance=function(r){return!!(r&&r[e])}}function xO(t,e){for(var r=[],i=2;i=0||a&&ie(a,l)<0)){var u=i.getShallow(l,e);u!=null&&(o[t[s][0]]=u)}}return o}}var bO=[["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]],TO=ii(bO),Ix=(function(){function t(){}return t.prototype.getAreaStyle=function(e,r){return TO(this,e,r)},t})();var ed=new $r(50);function Lx(t){if(typeof t=="string"){var e=ed.get(t);return e&&e.image}else return t}function _l(t,e,r,i,n){if(t)if(typeof t=="string"){if(e&&e.__zrImageSrc===t||!r)return e;var a=ed.get(t),o={hostEl:r,cb:i,cbPayload:n};return a?(e=a.image,!Fo(e)&&a.pending.push(o)):(e=at.loadImage(t,Ox,Ox),e.__zrImageSrc=t,ed.put(t,e.__cachedImgObj={image:e,pending:[o]})),e}else return t;else return e}function Ox(){var t=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var e=0;e=s;u++)l-=s;var f=Fr(o,r);return f>l&&(r="",f=0),l=t-f,n.ellipsis=r,n.ellipsisWidth=f,n.contentWidth=l,n.containerWidth=t,n}function zx(t,e,r){var i=r.containerWidth,n=r.contentWidth,a=r.fontMeasureInfo;if(!i){t.textLine="",t.isTruncated=!1;return}var o=Fr(a,e);if(o<=i){t.textLine=e,t.isTruncated=!1;return}for(var s=0;;s++){if(o<=n||s>=r.maxIterations){e+=r.ellipsis;break}var l=s===0?CO(e,n,a):o>0?Math.floor(e.length*n/o):0;e=e.substr(0,l),o=Fr(a,e)}e===""&&(e=r.placeholder),t.textLine=e,t.isTruncated=!0}function CO(t,e,r){for(var i=0,n=0,a=t.length;nm&&h){var _=Math.floor(m/p);v=v||g.length>_,g=g.slice(0,_),y=g.length*p}if(n&&f&&d!=null)for(var x=Bx(d,u,e.ellipsis,{minChar:e.truncateMinChar,placeholder:e.placeholder}),S={},b=0;bv&&rd(a,o.substring(v,m),e,h),rd(a,d[2],e,h,d[1]),v=td.lastIndex}vc){var V=a.lines.length;I>0?(C.tokens=C.tokens.slice(0,I),w(C,E,D),a.lines=a.lines.slice(0,A+1)):a.lines=a.lines.slice(0,A),a.isTruncated=a.isTruncated||a.lines.length0&&v+i.accumWidth>i.width&&(f=e.split(` +`),u=!0),i.accumWidth=v}else{var d=Vx(e,l,i.width,i.breakAll,i.accumWidth);i.accumWidth=d.accumWidth+h,c=d.linesWidths,f=d.lines}}f||(f=e.split(` +`));for(var m=Ur(l),g=0;g=32&&e<=591||e>=880&&e<=4351||e>=4608&&e<=5119||e>=7680&&e<=8303}var MO=Ct(",&?/;] ".split(""),function(t,e){return t[e]=!0,t},{});function IO(t){return EO(t)?!!MO[t]:!0}function Vx(t,e,r,i,n){for(var a=[],o=[],s="",l="",u=0,f=0,c=Ur(e),p=0;pr:n+f+v>r){f?(s||l)&&(d?(s||(s=l,l="",u=0,f=u),a.push(s),o.push(f-u),l+=h,u+=v,s="",f=u):(l&&(s+=l,l="",u=0),a.push(s),o.push(f),s=h,f=v)):d?(a.push(l),o.push(u),l=h,u=v):(a.push(h),o.push(v));continue}f+=v,d?(l+=h,u+=v):(l&&(s+=l,l="",u=0),s+=h)}return l&&(s+=l),s&&(a.push(s),o.push(f)),a.length===1&&(f+=n),{accumWidth:f,lines:a,linesWidths:o}}function nd(t,e,r,i,n,a){if(t.baseX=r,t.baseY=i,t.outerWidth=t.outerHeight=null,!!e){var o=e.width*2,s=e.height*2;ae.set(Nx,tn(r,o,n),Di(i,s,a),o,s),ae.intersect(e,Nx,null,Rx);var l=Rx.outIntersectRect;t.outerWidth=l.width,t.outerHeight=l.height,t.baseX=tn(l.x,l.width,n,!0),t.baseY=Di(l.y,l.height,a,!0)}}var Nx=new ae(0,0,0,0),Rx={outIntersectRect:{},clamp:!0};function ad(t){return t!=null?t+="":t=""}function Gx(t){var e=ad(t.text),r=t.font,i=Fr(Ur(r),e),n=na(r);return Rf(t,i,n,null)}function Rf(t,e,r,i){var n=new ae(tn(t.x||0,e,t.textAlign),Di(t.y||0,r,t.textBaseline),e,r),a=i!=null?i:od(t)?t.lineWidth:0;return a>0&&(n.x-=a/2,n.y-=a/2,n.width+=a,n.height+=a),n}function od(t){var e=t.stroke;return e!=null&&e!=="none"&&t.lineWidth>0}var ud="__zr_style_"+Math.round(Math.random()*10),ni={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},ua={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};ni[ud]=!0;var Hx=["z","z2","invisible"],OO=["invisible"],LO=(function(t){L(e,t);function e(r){return t.call(this,r)||this}return e.prototype._init=function(r){for(var i=ne(r),n=0;n1e-4){s[0]=t-r,s[1]=e-i,l[0]=t+r,l[1]=e+i;return}if(kf[0]=cd(n)*r+t,kf[1]=fd(n)*i+e,Bf[0]=cd(a)*r+t,Bf[1]=fd(a)*i+e,u(s,kf,Bf),f(l,kf,Bf),n=n%fa,n<0&&(n=n+fa),a=a%fa,a<0&&(a=a+fa),n>a&&!o?a+=fa:nn&&(zf[0]=cd(h)*r+t,zf[1]=fd(h)*i+e,u(s,zf,s),f(l,zf,l))}var Ee={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},ca=[],pa=[],oi=[],un=[],si=[],li=[],hd=Math.min,vd=Math.max,ha=Math.cos,va=Math.sin,Li=Math.abs,gd=Math.PI,fn=gd*2,dd=typeof Float32Array!="undefined",xl=[];function md(t){var e=Math.round(t/gd*1e8)/1e8;return e%2*gd}function yd(t,e){var r=md(t[0]);r<0&&(r+=fn);var i=r-t[0],n=t[1];n+=i,!e&&n-r>=fn?n=r+fn:e&&r-n>=fn?n=r-fn:!e&&r>n?n=r+(fn-md(r-n)):e&&r0&&(this._ux=Li(i/Mv/e)||0,this._uy=Li(i/Mv/r)||0)},t.prototype.setDPR=function(e){this.dpr=e},t.prototype.setContext=function(e){this._ctx=e},t.prototype.getContext=function(){return this._ctx},t.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},t.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},t.prototype.moveTo=function(e,r){return this._drawPendingPt(),this.addData(Ee.M,e,r),this._ctx&&this._ctx.moveTo(e,r),this._x0=e,this._y0=r,this._xi=e,this._yi=r,this},t.prototype.lineTo=function(e,r){var i=Li(e-this._xi),n=Li(r-this._yi),a=i>this._ux||n>this._uy;if(this.addData(Ee.L,e,r),this._ctx&&a&&this._ctx.lineTo(e,r),a)this._xi=e,this._yi=r,this._pendingPtDist=0;else{var o=i*i+n*n;o>this._pendingPtDist&&(this._pendingPtX=e,this._pendingPtY=r,this._pendingPtDist=o)}return this},t.prototype.bezierCurveTo=function(e,r,i,n,a,o){return this._drawPendingPt(),this.addData(Ee.C,e,r,i,n,a,o),this._ctx&&this._ctx.bezierCurveTo(e,r,i,n,a,o),this._xi=a,this._yi=o,this},t.prototype.quadraticCurveTo=function(e,r,i,n){return this._drawPendingPt(),this.addData(Ee.Q,e,r,i,n),this._ctx&&this._ctx.quadraticCurveTo(e,r,i,n),this._xi=i,this._yi=n,this},t.prototype.arc=function(e,r,i,n,a,o){this._drawPendingPt(),xl[0]=n,xl[1]=a,yd(xl,o),n=xl[0],a=xl[1];var s=a-n;return this.addData(Ee.A,e,r,i,i,n,s,0,o?0:1),this._ctx&&this._ctx.arc(e,r,i,n,a,o),this._xi=ha(a)*i+e,this._yi=va(a)*i+r,this},t.prototype.arcTo=function(e,r,i,n,a){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(e,r,i,n,a),this},t.prototype.rect=function(e,r,i,n){return this._drawPendingPt(),this._ctx&&this._ctx.rect(e,r,i,n),this.addData(Ee.R,e,r,i,n),this},t.prototype.closePath=function(){this._drawPendingPt(),this.addData(Ee.Z);var e=this._ctx,r=this._x0,i=this._y0;return e&&e.closePath(),this._xi=r,this._yi=i,this},t.prototype.fill=function(e){e&&e.fill(),this.toStatic()},t.prototype.stroke=function(e){e&&e.stroke(),this.toStatic()},t.prototype.len=function(){return this._len},t.prototype.setData=function(e){if(this._saveData){var r=e.length;!(this.data&&this.data.length===r)&&dd&&(this.data=new Float32Array(r));for(var i=0;i0&&o))for(var s=0;sf.length&&(this._expandData(),f=this.data);for(var c=0;c0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},t.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var e=[],r=0;r11&&(this.data=new Float32Array(e)))}},t.prototype.getBoundingRect=function(){oi[0]=oi[1]=si[0]=si[1]=Number.MAX_VALUE,un[0]=un[1]=li[0]=li[1]=-Number.MAX_VALUE;var e=this.data,r=0,i=0,n=0,a=0,o;for(o=0;oi||Li(_)>n||p===r-1)&&(d=Math.sqrt(y*y+_*_),a=m,o=g);break}case Ee.C:{var x=e[p++],S=e[p++],m=e[p++],g=e[p++],b=e[p++],w=e[p++];d=d_(a,o,x,S,m,g,b,w,10),a=b,o=w;break}case Ee.Q:{var x=e[p++],S=e[p++],m=e[p++],g=e[p++];d=y_(a,o,x,S,m,g,10),a=m,o=g;break}case Ee.A:var A=e[p++],C=e[p++],D=e[p++],E=e[p++],I=e[p++],M=e[p++],O=M+I;p+=1,v&&(s=ha(I)*D+A,l=va(I)*E+C),d=vd(D,E)*hd(fn,Math.abs(M)),a=ha(O)*D+A,o=va(O)*E+C;break;case Ee.R:{s=a=e[p++],l=o=e[p++];var N=e[p++],R=e[p++];d=N*2+R*2;break}case Ee.Z:{var y=s-a,_=l-o;d=Math.sqrt(y*y+_*_),a=s,o=l;break}}d>=0&&(u[c++]=d,f+=d)}return this._pathLen=f,f},t.prototype.rebuildPath=function(e,r){var i=this.data,n=this._ux,a=this._uy,o=this._len,s,l,u,f,c,p,h=r<1,v,d,m=0,g=0,y,_=0,x,S;if(!(h&&(this._pathSegLen||this._calculateLength(),v=this._pathSegLen,d=this._pathLen,y=r*d,!y)))e:for(var b=0;b0&&(e.lineTo(x,S),_=0),w){case Ee.M:s=u=i[b++],l=f=i[b++],e.moveTo(u,f);break;case Ee.L:{c=i[b++],p=i[b++];var C=Li(c-u),D=Li(p-f);if(C>n||D>a){if(h){var E=v[g++];if(m+E>y){var I=(y-m)/E;e.lineTo(u*(1-I)+c*I,f*(1-I)+p*I);break e}m+=E}e.lineTo(c,p),u=c,f=p,_=0}else{var M=C*C+D*D;M>_&&(x=c,S=p,_=M)}break}case Ee.C:{var O=i[b++],N=i[b++],R=i[b++],F=i[b++],B=i[b++],V=i[b++];if(h){var E=v[g++];if(m+E>y){var I=(y-m)/E;So(u,O,R,B,I,ca),So(f,N,F,V,I,pa),e.bezierCurveTo(ca[1],pa[1],ca[2],pa[2],ca[3],pa[3]);break e}m+=E}e.bezierCurveTo(O,N,R,F,B,V),u=B,f=V;break}case Ee.Q:{var O=i[b++],N=i[b++],R=i[b++],F=i[b++];if(h){var E=v[g++];if(m+E>y){var I=(y-m)/E;bo(u,O,R,I,ca),bo(f,N,F,I,pa),e.quadraticCurveTo(ca[1],pa[1],ca[2],pa[2]);break e}m+=E}e.quadraticCurveTo(O,N,R,F),u=R,f=F;break}case Ee.A:var H=i[b++],Z=i[b++],Q=i[b++],ee=i[b++],j=i[b++],ce=i[b++],ye=i[b++],He=!i[b++],Fe=Q>ee?Q:ee,Te=Li(Q-ee)>.001,Pe=j+ce,fe=!1;if(h){var E=v[g++];m+E>y&&(Pe=j+ce*(y-m)/E,fe=!0),m+=E}if(Te&&e.ellipse?e.ellipse(H,Z,Q,ee,ye,j,Pe,He):e.arc(H,Z,Fe,j,Pe,He),fe)break e;A&&(s=ha(j)*Q+H,l=va(j)*ee+Z),u=ha(Pe)*Q+H,f=va(Pe)*ee+Z;break;case Ee.R:s=u=i[b],l=f=i[b+1],c=i[b++],p=i[b++];var _e=i[b++],Ut=i[b++];if(h){var E=v[g++];if(m+E>y){var Ye=y-m;e.moveTo(c,p),e.lineTo(c+hd(Ye,_e),p),Ye-=_e,Ye>0&&e.lineTo(c+_e,p+hd(Ye,Ut)),Ye-=Ut,Ye>0&&e.lineTo(c+vd(_e-Ye,0),p+Ut),Ye-=_e,Ye>0&&e.lineTo(c,p+vd(Ut-Ye,0));break e}m+=E}e.rect(c,p,_e,Ut);break;case Ee.Z:if(h){var E=v[g++];if(m+E>y){var I=(y-m)/E;e.lineTo(u*(1-I)+s*I,f*(1-I)+l*I);break e}m+=E}e.closePath(),u=s,f=l}}},t.prototype.clone=function(){var e=new t,r=this.data;return e.data=r.slice?r.slice():Array.prototype.slice.call(r),e._len=this._len,e},t.prototype.canSave=function(){return!!this._saveData},t.CMD=Ee,t.initDefaultProps=(function(){var e=t.prototype;e._saveData=!0,e._ux=0,e._uy=0,e._pendingPtDist=0,e._version=0})(),t})(),bt=NO;function da(t,e,r,i,n,a,o){if(n===0)return!1;var s=n,l=0,u=t;if(o>e+s&&o>i+s||ot+s&&a>r+s||ae+c&&f>i+c&&f>a+c&&f>s+c||ft+c&&u>r+c&&u>n+c&&u>o+c||ue+u&&l>i+u&&l>a+u||lt+u&&s>r+u&&s>n+u||sr||f+un&&(n+=bl);var p=Math.atan2(l,s);return p<0&&(p+=bl),p>=i&&p<=n||p+bl>=i&&p+bl<=n}function Cr(t,e,r,i,n,a){if(a>e&&a>i||an?s:0}var cn=bt.CMD,ma=Math.PI*2,UO=1e-4;function FO(t,e){return Math.abs(t-e)e&&u>i&&u>a&&u>s||u1&&VO(),h=Ue(e,i,a,s,Ar[0]),p>1&&(v=Ue(e,i,a,s,Ar[1]))),p===2?me&&s>i&&s>a||s=0&&u<=1){for(var f=0,c=ot(e,i,a,u),p=0;pr||s<-r)return 0;var l=Math.sqrt(r*r-s*s);Nt[0]=-l,Nt[1]=l;var u=Math.abs(i-n);if(u<1e-4)return 0;if(u>=ma-1e-4){i=0,n=ma;var f=a?1:-1;return o>=Nt[0]+t&&o<=Nt[1]+t?f:0}if(i>n){var c=i;i=n,n=c}i<0&&(i+=ma,n+=ma);for(var p=0,h=0;h<2;h++){var v=Nt[h];if(v+t>o){var d=Math.atan2(s,v),f=a?1:-1;d<0&&(d=ma+d),(d>=i&&d<=n||d+ma>=i&&d+ma<=n)&&(d>Math.PI/2&&d1&&(r||(s+=Cr(l,u,f,c,i,n))),m&&(l=a[v],u=a[v+1],f=l,c=u),d){case cn.M:f=a[v++],c=a[v++],l=f,u=c;break;case cn.L:if(r){if(da(l,u,a[v],a[v+1],e,i,n))return!0}else s+=Cr(l,u,a[v],a[v+1],i,n)||0;l=a[v++],u=a[v++];break;case cn.C:if(r){if(Kx(l,u,a[v++],a[v++],a[v++],a[v++],a[v],a[v+1],e,i,n))return!0}else s+=GO(l,u,a[v++],a[v++],a[v++],a[v++],a[v],a[v+1],i,n)||0;l=a[v++],u=a[v++];break;case cn.Q:if(r){if(jx(l,u,a[v++],a[v++],a[v],a[v+1],e,i,n))return!0}else s+=HO(l,u,a[v++],a[v++],a[v],a[v+1],i,n)||0;l=a[v++],u=a[v++];break;case cn.A:var g=a[v++],y=a[v++],_=a[v++],x=a[v++],S=a[v++],b=a[v++];v+=1;var w=!!(1-a[v++]);p=Math.cos(S)*_+g,h=Math.sin(S)*x+y,m?(f=p,c=h):s+=Cr(l,u,p,h,i,n);var A=(i-g)*x/_+g;if(r){if(Jx(g,y,x,S,S+b,w,e,A,n))return!0}else s+=YO(g,y,x,S,S+b,w,A,n);l=Math.cos(S+b)*_+g,u=Math.sin(S+b)*x+y;break;case cn.R:f=l=a[v++],c=u=a[v++];var C=a[v++],D=a[v++];if(p=f+C,h=c+D,r){if(da(f,c,p,c,e,i,n)||da(p,c,p,h,e,i,n)||da(p,h,f,h,e,i,n)||da(f,h,f,c,e,i,n))return!0}else s+=Cr(p,c,p,h,i,n),s+=Cr(f,h,f,c,i,n);break;case cn.Z:if(r){if(da(l,u,f,c,e,i,n))return!0}else s+=Cr(l,u,f,c,i,n);l=f,u=c;break}}return!r&&!FO(u,c)&&(s+=Cr(l,u,f,c,i,n)||0),s!==0}function eS(t,e,r){return $x(t,0,!1,e,r)}function tS(t,e,r,i){return $x(t,e,!0,r,i)}var Vo=re({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},ni),XO={style:re({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},ua.style)},_d=Eo.concat(["invisible","culling","z","z2","zlevel","parent"]),ZO=(function(t){L(e,t);function e(r){return t.call(this,r)||this}return e.prototype.update=function(){var r=this;t.prototype.update.call(this);var i=this.style;if(i.decal){var n=this._decalEl=this._decalEl||new e;n.buildPath===e.prototype.buildPath&&(n.buildPath=function(l){r.buildPath(l,r.shape)}),n.silent=!0;var a=n.style;for(var o in i)a[o]!==i[o]&&(a[o]=i[o]);a.fill=i.fill?i.decal:null,a.decal=null,a.shadowColor=null,i.strokeFirst&&(a.stroke=null);for(var s=0;s<_d.length;++s)n[_d[s]]=this[_d[s]];n.__dirty|=At}else this._decalEl&&(this._decalEl=null)},e.prototype.getDecalElement=function(){return this._decalEl},e.prototype._init=function(r){var i=ne(r);this.shape=this.getDefaultShape();var n=this.getDefaultStyle();n&&this.useStyle(n);for(var a=0;a.5?ll:i>.2?H_:ul}else if(r)return ul}return ll},e.prototype.getInsideTextStroke=function(r){var i=this.style.fill;if(U(i)){var n=this.__zr,a=!!(n&&n.isDarkMode()),o=ea(r,0)0))},e.prototype.hasFill=function(){var r=this.style,i=r.fill;return i!=null&&i!=="none"},e.prototype.getBoundingRect=function(){var r=this._rect,i=this.style,n=!r;if(n){var a=!1;this.path||(a=!0,this.createPathProxy());var o=this.path;(a||this.__dirty&qi)&&(o.beginPath(),this.buildPath(o,this.shape,!1),this.pathUpdated()),r=o.getBoundingRect()}if(this._rect=r,this.hasStroke()&&this.path&&this.path.len()>0){var s=this._rectStroke||(this._rectStroke=r.clone());if(this.__dirty||n){s.copy(r);var l=i.strokeNoScale?this.getLineScale():1,u=i.lineWidth;if(!this.hasFill()){var f=this.strokeContainThreshold;u=Math.max(u,f==null?4:f)}l>1e-10&&(s.width+=u/l,s.height+=u/l,s.x-=u/l/2,s.y-=u/l/2)}return s}return r},e.prototype.contain=function(r,i){var n=this.transformCoordToLocal(r,i),a=this.getBoundingRect(),o=this.style;if(r=n[0],i=n[1],a.contain(r,i)){var s=this.path;if(this.hasStroke()){var l=o.lineWidth,u=o.strokeNoScale?this.getLineScale():1;if(u>1e-10&&(this.hasFill()||(l=Math.max(l,this.strokeContainThreshold)),tS(s,l/u,r,i)))return!0}if(this.hasFill())return eS(s,r,i)}return!1},e.prototype.dirtyShape=function(){this.__dirty|=qi,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},e.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},e.prototype.animateShape=function(r){return this.animate("shape",r)},e.prototype.updateDuringAnimation=function(r){r==="style"?this.dirtyStyle():r==="shape"?this.dirtyShape():this.markRedraw()},e.prototype.attrKV=function(r,i){r==="shape"?this.setShape(i):t.prototype.attrKV.call(this,r,i)},e.prototype.setShape=function(r,i){var n=this.shape;return n||(n=this.shape={}),typeof r=="string"?n[r]=i:P(n,r),this.dirtyShape(),this},e.prototype.shapeChanged=function(){return!!(this.__dirty&qi)},e.prototype.createStyle=function(r){return bi(Vo,r)},e.prototype._innerSaveToNormal=function(r){t.prototype._innerSaveToNormal.call(this,r);var i=this._normalState;r.shape&&!i.shape&&(i.shape=P({},this.shape))},e.prototype._applyStateObj=function(r,i,n,a,o,s){if(t.prototype._applyStateObj.call(this,r,i,n,a,o,s),this.__inHover!==Oo){var l=!(i&&a),u;if(i&&i.shape?o?a?u=i.shape:(u=P({},n.shape),P(u,i.shape)):(u=P({},a?this.shape:n.shape),P(u,i.shape)):l&&(u=n.shape),u)if(o){this.shape=P({},this.shape);for(var f={},c=ne(u),p=0;pn&&(c=s+l,s*=n/c,l*=n/c),u+f>n&&(c=u+f,u*=n/c,f*=n/c),l+u>a&&(c=l+u,l*=a/c,u*=a/c),s+f>a&&(c=s+f,s*=a/c,f*=a/c),t.moveTo(r+s,i),t.lineTo(r+n-l,i),l!==0&&t.arc(r+n-l,i+l,l,-Math.PI/2,0),t.lineTo(r+n,i+a-u),u!==0&&t.arc(r+n-u,i+a-u,u,0,Math.PI/2),t.lineTo(r+f,i+a),f!==0&&t.arc(r+f,i+a-f,f,Math.PI/2,Math.PI),t.lineTo(r,i+s),s!==0&&t.arc(r+s,i+s,s,Math.PI,Math.PI*1.5),t.closePath()}var Go=Math.round;function Uf(t,e,r){if(e){var i=e.x1,n=e.x2,a=e.y1,o=e.y2;t.x1=i,t.x2=n,t.y1=a,t.y2=o;var s=r&&r.lineWidth;return s&&(Go(i*2)===Go(n*2)&&(t.x1=t.x2=pn(i,s,!0)),Go(a*2)===Go(o*2)&&(t.y1=t.y2=pn(a,s,!0))),t}}function Ff(t,e,r){if(e){var i=e.x,n=e.y,a=e.width,o=e.height;t.x=i,t.y=n,t.width=a,t.height=o;var s=r&&r.lineWidth;return s&&(t.x=pn(i,s,!0),t.y=pn(n,s,!0),t.width=Math.max(pn(i+a,s,!1)-t.x,a===0?0:1),t.height=Math.max(pn(n+o,s,!1)-t.y,o===0?0:1)),t}}function pn(t,e,r){if(!e)return t;var i=Go(t*2);return(i+Go(e))%2===0?i/2:(i+(r?1:-1))/2}var eL=(function(){function t(){this.x=0,this.y=0,this.width=0,this.height=0}return t})();var tL={},aS=(function(t){L(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new eL},e.prototype.buildPath=function(r,i){var n,a,o,s;if(this.subPixelOptimize){var l=Ff(tL,i,this.style);n=l.x,a=l.y,o=l.width,s=l.height,l.r=i.r,i=l}else n=i.x,a=i.y,o=i.width,s=i.height;i.r?nS(r,i):r.rect(n,a,o,s)},e.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},e})(ue);aS.prototype.type="rect";var ge=aS;var oS={fill:"#000"},sS=2,ui={},rL={style:re({fill:!0,stroke:!0,fillOpacity:!0,strokeOpacity:!0,lineWidth:!0,fontSize:!0,lineHeight:!0,width:!0,height:!0,textShadowColor:!0,textShadowBlur:!0,textShadowOffsetX:!0,textShadowOffsetY:!0,backgroundColor:!0,padding:!0,borderColor:!0,borderWidth:!0,borderRadius:!0},ua.style)},dS=(function(t){L(e,t);function e(r){var i=t.call(this)||this;return i.type="text",i._children=[],i._defaultStyle=oS,i.attr(r),i}return e.prototype.childrenRef=function(){return this._children},e.prototype.update=function(){t.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var r=0;r0,I=0;I=0&&(O=b[M],O.align==="right");)this._placeToken(O,r,A,g,I,"right",_),C-=O.width,I-=O.width,M--;for(E+=(f-(E-m)-(y-I)-C)/2;D<=M;)O=b[D],this._placeToken(O,r,A,g,E+O.width/2,"center",_),E+=O.width,D++;g+=A}},e.prototype._placeToken=function(r,i,n,a,o,s,l){var u=i.rich[r.styleName]||{};u.text=r.text;var f=r.verticalAlign,c=a+n/2;f==="top"?c=a+r.height/2:f==="bottom"&&(c=a+n-r.height/2);var p=!r.isLineHolder&&xd(u);p&&this._renderBackground(u,i,s==="right"?o-r.width:s==="center"?o-r.width/2:o,c-r.height/2,r.width,r.height);var h=!!u.backgroundColor,v=r.textPadding;v&&(o=hS(o,s,v),c-=r.height/2-v[0]-r.innerHeight/2);var d=this._getOrCreateChild(ga),m=d.createStyle();d.useStyle(m);var g=this._defaultStyle,y=!1,_=0,x=!1,S=pS("fill"in u?u.fill:"fill"in i?i.fill:(y=!0,g.fill)),b=cS("stroke"in u?u.stroke:"stroke"in i?i.stroke:!h&&!l&&(!g.autoStroke||y)?(_=sS,x=!0,g.stroke):null),w=u.textShadowBlur>0||i.textShadowBlur>0;m.text=r.text,m.x=o,m.y=c,w&&(m.shadowBlur=u.textShadowBlur||i.textShadowBlur||0,m.shadowColor=u.textShadowColor||i.textShadowColor||"transparent",m.shadowOffsetX=u.textShadowOffsetX||i.textShadowOffsetX||0,m.shadowOffsetY=u.textShadowOffsetY||i.textShadowOffsetY||0),m.textAlign=s,m.textBaseline="middle",m.font=r.font||Vt,m.opacity=Gt(u.opacity,i.opacity,1),uS(m,u),b&&(m.lineWidth=Gt(u.lineWidth,i.lineWidth,_),m.lineDash=W(u.lineDash,i.lineDash),m.lineDashOffset=i.lineDashOffset||0,m.stroke=b),S&&(m.fill=S),d.setBoundingRect(Rf(m,r.contentWidth,r.contentHeight,x?0:null))},e.prototype._renderBackground=function(r,i,n,a,o,s){var l=r.backgroundColor,u=r.borderWidth,f=r.borderColor,c=l&&l.image,p=l&&!c,h=r.borderRadius,v=this,d,m;if(p||r.lineHeight||u&&f){d=this._getOrCreateChild(ge),d.useStyle(d.createStyle()),d.style.fill=null;var g=d.shape;g.x=n,g.y=a,g.width=o,g.height=s,g.r=h,d.dirtyShape()}if(p){var y=d.style;y.fill=l||null,y.fillOpacity=W(r.fillOpacity,1)}else if(c){m=this._getOrCreateChild(dt),m.onload=function(){v.dirtyStyle()};var _=m.style;_.image=l.image,_.x=n,_.y=a,_.width=o,_.height=s}if(u&&f){var y=d.style;y.lineWidth=u,y.stroke=f,y.strokeOpacity=W(r.strokeOpacity,1),y.lineDash=r.borderDash,y.lineDashOffset=r.borderDashOffset||0,d.strokeContainThreshold=0,d.hasFill()&&d.hasStroke()&&(y.strokeFirst=!0,y.lineWidth*=2)}var x=(d||m).style;x.shadowBlur=r.shadowBlur||0,x.shadowColor=r.shadowColor||"transparent",x.shadowOffsetX=r.shadowOffsetX||0,x.shadowOffsetY=r.shadowOffsetY||0,x.opacity=Gt(r.opacity,i.opacity,1)},e.makeFont=function(r){var i="";return bd(r)&&(i=[r.fontStyle,r.fontWeight,Sd(r.fontSize),r.fontFamily||"sans-serif"].join(" ")),i&&pt(i)||r.textFont||r.font},e})(ai),iL={left:!0,right:1,center:1},nL={top:1,bottom:1,middle:1},lS=["fontStyle","fontWeight","fontSize","fontFamily"];function Sd(t){return typeof t=="string"&&(t.indexOf("px")!==-1||t.indexOf("rem")!==-1||t.indexOf("em")!==-1)?t:isNaN(+t)?Fu+"px":t+"px"}function uS(t,e){for(var r=0;r=0,a=!1;if(t instanceof ue){var o=wS(t),s=n&&o.selectFill||o.normalFill,l=n&&o.selectStroke||o.normalStroke;if(Ho(s)||Ho(l)){i=i||{};var u=i.style||{};u.fill==="inherit"?(a=!0,i=P({},i),u=P({},u),u.fill=s):!Ho(u.fill)&&Ho(s)?(a=!0,i=P({},i),u=P({},u),u.fill=Ao(s)):!Ho(u.stroke)&&Ho(l)&&(a||(i=P({},i),u=P({},u)),u.stroke=Ao(l)),i.style=u}}if(i&&i.z2==null){a||(i=P({},i));var f=t.z2EmphasisLift;i.z2=t.z2+(f!=null?f:lL)}return i}function vL(t,e,r){if(r&&r.z2==null){r=P({},r);var i=t.z2SelectLift;r.z2=t.z2+(i!=null?i:uL)}return r}function dL(t,e,r){var i=ie(t.currentStates,e)>=0,n=t.style.opacity,a=i?null:pL(t,["opacity"],e,{opacity:1});r=r||{};var o=r.style||{};return o.opacity==null&&(r=P({},r),o=P({opacity:i?n:a.opacity*.1},o),r.style=o),r}function wd(t,e){var r=this.states[t];if(this.style){if(t==="emphasis")return hL(this,t,e,r);if(t==="blur")return dL(this,t,r);if(t==="select")return vL(this,t,r)}return r}function mL(t){t.stateProxy=wd;var e=t.getTextContent(),r=t.getTextGuideLine();e&&(e.stateProxy=wd),r&&(r.stateProxy=wd)}function SS(t,e){!MS(t,e)&&!t.__highByOuter&&Pi(t,CS)}function bS(t,e){!MS(t,e)&&!t.__highByOuter&&Pi(t,AS)}function ya(t,e){t.__highByOuter|=1<<(e||0),Pi(t,CS)}function _a(t,e){!(t.__highByOuter&=~(1<<(e||0)))&&Pi(t,AS)}function ES(t){Pi(t,Ed)}function Id(t){Pi(t,DS)}function Od(t){Pi(t,fL)}function Ld(t){Pi(t,cL)}function MS(t,e){return t.__highDownSilentOnTouch&&e.zrByTouch}function Pd(t){var e=t.getModel(),r=[],i=[];e.eachComponent(function(n,a){var o=Ad(a),s=gS(t,a),l=n==="series";!l&&i.push(s),o.isBlured&&(s.group.traverse(function(u){DS(u)}),l&&r.push(a)),o.isBlured=!1}),T(i,function(n){n&&n.toggleBlurSeries&&n.toggleBlurSeries(r,!1,e)})}function Cd(t,e,r,i){var n=i.getModel();r=r||"coordinateSystem";function a(u,f){for(var c=0;c0){var l={dataIndex:s,seriesIndex:r.seriesIndex};o!=null&&(l.dataType=o),e.push(l)}})}),e}function dn(t,e,r){RS(t,!0),Pi(t,mL),yL(t,e,r)}function gL(t){RS(t,!1)}function Ni(t,e,r,i){i?gL(t):dn(t,e,r)}function yL(t,e,r){var i=me(t);e!=null?(i.focus=e,i.blurScope=r):i.focus&&(i.focus=null)}var TS=["emphasis","blur","select"],_L={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function xa(t,e,r,i){r=r||"itemStyle";for(var n=0;nwa,BezierCurve:()=>Nl,BoundingRect:()=>ae,Circle:()=>Sa,CompoundPath:()=>Zo,Ellipse:()=>Il,Group:()=>xe,HOVER_LAYER_FOR_INCREMENTAL:()=>kl,HOVER_LAYER_FROM_THRESHOLD:()=>Zd,HOVER_LAYER_NO:()=>Xd,Image:()=>dt,IncrementalDisplayable:()=>oc,Line:()=>lr,LinearGradient:()=>qo,OrientedBoundingRect:()=>ac,Path:()=>ue,Point:()=>le,Polygon:()=>Ta,Polyline:()=>Hr,RadialGradient:()=>tc,Rect:()=>ge,Ring:()=>Pl,Sector:()=>sr,Text:()=>De,WH:()=>gn,XY:()=>pi,applyTransform:()=>Ma,calcZ2Range:()=>rP,clipPointsByRect:()=>em,clipRectByRect:()=>tm,createIcon:()=>Ia,decomposeTransform:()=>nP,ensureCopyRect:()=>es,ensureCopyTransform:()=>fc,expandOrShrinkRect:()=>Jo,extendPath:()=>Kd,extendShape:()=>qd,getCurrentCanvasPainter:()=>aP,getShapeClass:()=>jd,getTransform:()=>zl,groupTransition:()=>$d,initProps:()=>it,isBoundingRectAxisAligned:()=>uc,isElementRemoved:()=>Da,lineLineIntersect:()=>hb,linePolygonIntersect:()=>eP,makeImage:()=>Bl,makePath:()=>Qo,mergePath:()=>Qd,payloadDisableAnimation:()=>iP,registerShape:()=>ur,removeElement:()=>Ko,removeElementWithFadeOut:()=>mn,resizePath:()=>lc,retrieveZInfo:()=>yn,setTooltipConfig:()=>$o,subPixelOptimize:()=>JL,subPixelOptimizeLine:()=>Ea,subPixelOptimizeRect:()=>QL,transformDirection:()=>Jd,traverseElements:()=>Oa,traverseUpdateZ:()=>rm,updateProps:()=>Be});var Wo=bt.CMD,xL=[[],[],[]],zS=Math.sqrt,SL=Math.atan2;function kd(t,e){if(e){var r=t.data,i=t.len(),n,a,o,s,l,u,f=Wo.M,c=Wo.C,p=Wo.L,h=Wo.R,v=Wo.A,d=Wo.Q;for(o=0,s=0;o1&&(o*=Bd(v),s*=Bd(v));var d=(n===a?-1:1)*Bd((o*o*(s*s)-o*o*(h*h)-s*s*(p*p))/(o*o*(h*h)+s*s*(p*p)))||0,m=d*o*h/s,g=d*-s*p/o,y=(t+r)/2+Qf(c)*m-jf(c)*g,_=(e+i)/2+jf(c)*m+Qf(c)*g,x=FS([1,0],[(p-m)/o,(h-g)/s]),S=[(p-m)/o,(h-g)/s],b=[(-1*p-m)/o,(-1*h-g)/s],w=FS(S,b);if(zd(S,b)<=-1&&(w=Ml),zd(S,b)>=1&&(w=0),w<0){var A=Math.round(w/Ml*1e6)/1e6;w=Ml*2+A%2*Ml}f.addData(u,y,_,o,s,x,w,c,a)}var bL=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,TL=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function wL(t){var e=new bt;if(!t)return e;var r=0,i=0,n=r,a=i,o,s=bt.CMD,l=t.match(bL);if(!l)return e;for(var u=0;uO*O+N*N&&(A=D,C=E),{cx:A,cy:C,x0:-f,y0:-c,x1:A*(n/S-1),y1:C*(n/S-1)}}function IL(t){var e;if(k(t)){var r=t.length;if(!r)return t;r===1?e=[t[0],t[0],0,0]:r===2?e=[t[0],t[0],t[1],t[1]]:r===3?e=t.concat(t[2]):e=t}else e=[t,t,t,t];return e}function JS(t,e){var r,i=Ol(e.r,0),n=Ol(e.r0||0,0),a=i>0,o=n>0;if(!(!a&&!o)){if(a||(i=n,n=0),n>i){var s=i;i=n,n=s}var l=e.startAngle,u=e.endAngle;if(!(isNaN(l)||isNaN(u))){var f=e.cx,c=e.cy,p=!!e.clockwise,h=jS(u-l),v=h>Ud&&h%Ud;if(v>Gr&&(h=v),!(i>Gr))t.moveTo(f,c);else if(h>Ud-Gr)t.moveTo(f+i*Xo(l),c+i*ba(l)),t.arc(f,c,i,l,u,!p),n>Gr&&(t.moveTo(f+n*Xo(u),c+n*ba(u)),t.arc(f,c,n,u,l,p));else{var d=void 0,m=void 0,g=void 0,y=void 0,_=void 0,x=void 0,S=void 0,b=void 0,w=void 0,A=void 0,C=void 0,D=void 0,E=void 0,I=void 0,M=void 0,O=void 0,N=i*Xo(l),R=i*ba(l),F=n*Xo(u),B=n*ba(u),V=h>Gr;if(V){var H=e.cornerRadius;H&&(r=IL(H),d=r[0],m=r[1],g=r[2],y=r[3]);var Z=jS(i-n)/2;if(_=ci(Z,g),x=ci(Z,y),S=ci(Z,d),b=ci(Z,m),C=w=Ol(_,x),D=A=Ol(S,b),(w>Gr||A>Gr)&&(E=i*Xo(u),I=i*ba(u),M=n*Xo(l),O=n*ba(l),hGr){var Te=ci(g,C),Pe=ci(y,C),fe=Jf(M,O,N,R,i,Te,p),_e=Jf(E,I,F,B,i,Pe,p);t.moveTo(f+fe.cx+fe.x0,c+fe.cy+fe.y0),C0&&t.arc(f+fe.cx,c+fe.cy,Te,Mt(fe.y0,fe.x0),Mt(fe.y1,fe.x1),!p),t.arc(f,c,i,Mt(fe.cy+fe.y1,fe.cx+fe.x1),Mt(_e.cy+_e.y1,_e.cx+_e.x1),!p),Pe>0&&t.arc(f+_e.cx,c+_e.cy,Pe,Mt(_e.y1,_e.x1),Mt(_e.y0,_e.x0),!p))}else t.moveTo(f+N,c+R),t.arc(f,c,i,l,u,!p);if(!(n>Gr)||!V)t.lineTo(f+F,c+B);else if(D>Gr){var Te=ci(d,D),Pe=ci(m,D),fe=Jf(F,B,E,I,n,-Pe,p),_e=Jf(N,R,M,O,n,-Te,p);t.lineTo(f+fe.cx+fe.x0,c+fe.cy+fe.y0),D0&&t.arc(f+fe.cx,c+fe.cy,Pe,Mt(fe.y0,fe.x0),Mt(fe.y1,fe.x1),!p),t.arc(f,c,n,Mt(fe.cy+fe.y1,fe.cx+fe.x1),Mt(_e.cy+_e.y1,_e.cx+_e.x1),p),Te>0&&t.arc(f+_e.cx,c+_e.cy,Te,Mt(_e.y1,_e.x1),Mt(_e.y0,_e.x0),!p))}else t.lineTo(f+F,c+B),t.arc(f,c,n,u,l,p)}t.closePath()}}}var LL=(function(){function t(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0,this.cornerRadius=0}return t})();var $S=(function(t){L(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new LL},e.prototype.buildPath=function(r,i){JS(r,i)},e.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},e})(ue);$S.prototype.type="sector";var sr=$S;var PL=(function(){function t(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return t})();var eb=(function(t){L(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new PL},e.prototype.buildPath=function(r,i){var n=i.cx,a=i.cy,o=Math.PI*2;r.moveTo(n+i.r,a),r.arc(n,a,i.r,0,o,!1),r.moveTo(n+i.r0,a),r.arc(n,a,i.r0,0,o,!0)},e})(ue);eb.prototype.type="ring";var Pl=eb;function Fd(t,e,r,i){var n=[],a=[],o=[],s=[],l,u,f,c;if(i){f=[1/0,1/0],c=[-1/0,-1/0];for(var p=0,h=t.length;p=2){if(i){var a=Fd(n,i,r,e.smoothConstraint);t.moveTo(n[0][0],n[0][1]);for(var o=n.length,s=0;s<(r?o:o-1);s++){var l=a[s*2],u=a[s*2+1],f=n[(s+1)%o];t.bezierCurveTo(l[0],l[1],u[0],u[1],f[0],f[1])}}else{t.moveTo(n[0][0],n[0][1]);for(var s=1,c=n.length;sAa[1]){if(a=!1,mt.negativeSize||i)return a;var l=rc(Aa[0]-Ca[1]),u=rc(Ca[0]-Aa[1]);Vd(l,u)>nc.len()&&(l=u||!mt.bidirectional)&&(le.scale(ic,s,-u*n),mt.useDir&&mt.calcDirMTV()))}}return a},t.prototype._getProjMinMaxOnAxis=function(e,r,i){for(var n=this._axes[e],a=this._origin,o=r[0].dot(n)+a[e],s=o,l=o,u=1;u0){var c=f.duration,p=f.delay,h=f.easing,v={duration:c,delay:p||0,easing:h,done:a,force:!!a||!!o,setToFinal:!u,scope:t,during:o};s?e.animateFrom(r,v):e.animateTo(r,v)}else e.stopAnimation(),!s&&e.attr(r),o&&o(1),a&&a()}function Be(t,e,r,i,n,a){Gd("update",t,e,r,i,n,a)}function it(t,e,r,i,n,a){Gd("enter",t,e,r,i,n,a)}function Da(t){if(!t.__zr)return!0;for(var e=0;eIe(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"}function fb(t){return!t.isGroup}function $L(t){return t.shape!=null}function $d(t,e,r){if(!t||!e)return;function i(o){var s={};return o.traverse(function(l){fb(l)&&l.anid&&(s[l.anid]=l)}),s}function n(o){var s={x:o.x,y:o.y,rotation:o.rotation};return $L(o)&&(s.shape=$(o.shape)),s}var a=i(t);e.traverse(function(o){if(fb(o)&&o.anid){var s=a[o.anid];if(s){var l=n(o);o.attr(n(s)),Be(o,l,r,me(o).dataIndex)}}})}function em(t,e){return z(t,function(r){var i=r[0];i=ve(i,e.x),i=Ne(i,e.x+e.width);var n=r[1];return n=ve(n,e.y),n=Ne(n,e.y+e.height),[i,n]})}function tm(t,e){var r=ve(t.x,e.x),i=Ne(t.x+t.width,e.x+e.width),n=ve(t.y,e.y),a=Ne(t.y+t.height,e.y+e.height);if(i>=r&&a>=n)return{x:r,y:n,width:i-r,height:a-n}}function Ia(t,e,r){var i=P({rectHover:!0},e),n=i.style={strokeNoScale:!0};if(r=r||{x:-1,y:-1,width:2,height:2},t)return t.indexOf("image://")===0?(n.image=t.slice(8),re(n,r),new dt(i)):Qo(t.replace("path://",""),i,r,"center")}function eP(t,e,r,i,n){for(var a=0,o=n[n.length-1];a1)return!1;var m=Hd(h,v,f,c)/p;return!(m<0||m>1)}function Hd(t,e,r,i){return t*i-r*e}function tP(t){return t<=1e-6&&t>=-1e-6}function Jo(t,e,r,i,n){return e==null||(se(e)?Re[0]=Re[1]=Re[2]=Re[3]=e:(Re[0]=e[0],Re[1]=e[1],Re[2]=e[2],Re[3]=e[3]),i&&(Re[0]=ve(0,Re[0]),Re[1]=ve(0,Re[1]),Re[2]=ve(0,Re[2]),Re[3]=ve(0,Re[3])),r&&(Re[0]=-Re[0],Re[1]=-Re[1],Re[2]=-Re[2],Re[3]=-Re[3]),cb(t,Re,"x","width",3,1,n&&n[0]||0),cb(t,Re,"y","height",0,2,n&&n[1]||0)),t}var Re=[0,0,0,0];function cb(t,e,r,i,n,a,o){var s=e[a]+e[n],l=t[i];t[i]+=s,o=ve(0,Ne(o,l)),t[i]=0?-e[n]:e[a]>=0?l+e[a]:Ie(s)>1e-8?(l-o)*e[n]/s:0):t[r]-=e[n]}function $o(t){var e=t.itemTooltipOption,r=t.componentModel,i=t.itemName,n=U(e)?{formatter:e}:e,a=r.mainType,o=r.componentIndex,s={componentType:a,name:i,$vars:["name"]};s[a+"Index"]=o;var l=t.formatterParamsExtra;l&&T(ne(l),function(f){Oe(s,f)||(s[f]=l[f],s.$vars.push(f))});var u=me(t.el);u.componentMainType=a,u.componentIndex=o,u.tooltipConfig={name:i,option:re({content:i,encodeHTMLContent:!0,formatterParams:s},n)}}function Wd(t,e){var r;t.isGroup&&(r=e(t)),r||t.traverse(e)}function Oa(t,e){if(t)if(k(t))for(var r=0;re&&(e=o),oe&&(r=e=0),{min:r,max:e}}function rm(t,e,r){vb(t,e,r,-1/0)}function vb(t,e,r,i){if(t.ignoreModelZ)return i;var n=t.getTextContent(),a=t.getTextGuideLine(),o=t.isGroup;if(o)for(var s=t.childrenRef(),l=0;l=0&&s.push(l)}),s}}function xn(t,e){return he(he({},t,!0),e,!0)}var Eb={time:{month:["January","February","March","April","May","June","July","August","September","October","November","December"],monthAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayOfWeekAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},legend:{selector:{all:"All",inverse:"Inv"}},toolbox:{brush:{title:{rect:"Box Select",polygon:"Lasso Select",lineX:"Horizontally Select",lineY:"Vertically Select",keep:"Keep Selections",clear:"Clear Selections"}},dataView:{title:"Data View",lang:["Data View","Close","Refresh"]},dataZoom:{title:{zoom:"Zoom",back:"Zoom Reset"}},magicType:{title:{line:"Switch to Line Chart",bar:"Switch to Bar Chart",stack:"Stack",tiled:"Tile"}},restore:{title:"Restore"},saveAsImage:{title:"Save as Image",lang:["Right Click to Save Image"]}},series:{typeNames:{pie:"Pie chart",bar:"Bar chart",line:"Line chart",scatter:"Scatter plot",effectScatter:"Ripple scatter plot",radar:"Radar chart",tree:"Tree",treemap:"Treemap",boxplot:"Boxplot",candlestick:"Candlestick",k:"K line chart",heatmap:"Heat map",map:"Map",parallel:"Parallel coordinate map",lines:"Line graph",graph:"Relationship graph",sankey:"Sankey diagram",funnel:"Funnel chart",gauge:"Gauge",pictorialBar:"Pictorial bar",themeRiver:"Theme River Map",sunburst:"Sunburst",custom:"Custom chart",chart:"Chart"}},aria:{general:{withTitle:'This is a chart about "{title}"',withoutTitle:"This is a chart"},series:{single:{prefix:"",withName:" with type {seriesType} named {seriesName}.",withoutName:" with type {seriesType}."},multiple:{prefix:". It consists of {seriesCount} series count.",withName:" The {seriesId} series is a {seriesType} representing {seriesName}.",withoutName:" The {seriesId} series is a {seriesType}.",separator:{middle:"",end:""}}},data:{allData:"The data is as follows: ",partialData:"The first {displayCnt} items are: ",withName:"the data for {name} is {value}",withoutName:"{value}",separator:{middle:", ",end:". "}}}};var Mb={time:{month:["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00\u6708","\u5341\u4E8C\u6708"],monthAbbr:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],dayOfWeek:["\u661F\u671F\u65E5","\u661F\u671F\u4E00","\u661F\u671F\u4E8C","\u661F\u671F\u4E09","\u661F\u671F\u56DB","\u661F\u671F\u4E94","\u661F\u671F\u516D"],dayOfWeekAbbr:["\u65E5","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D"]},legend:{selector:{all:"\u5168\u9009",inverse:"\u53CD\u9009"}},toolbox:{brush:{title:{rect:"\u77E9\u5F62\u9009\u62E9",polygon:"\u5708\u9009",lineX:"\u6A2A\u5411\u9009\u62E9",lineY:"\u7EB5\u5411\u9009\u62E9",keep:"\u4FDD\u6301\u9009\u62E9",clear:"\u6E05\u9664\u9009\u62E9"}},dataView:{title:"\u6570\u636E\u89C6\u56FE",lang:["\u6570\u636E\u89C6\u56FE","\u5173\u95ED","\u5237\u65B0"]},dataZoom:{title:{zoom:"\u533A\u57DF\u7F29\u653E",back:"\u533A\u57DF\u7F29\u653E\u8FD8\u539F"}},magicType:{title:{line:"\u5207\u6362\u4E3A\u6298\u7EBF\u56FE",bar:"\u5207\u6362\u4E3A\u67F1\u72B6\u56FE",stack:"\u5207\u6362\u4E3A\u5806\u53E0",tiled:"\u5207\u6362\u4E3A\u5E73\u94FA"}},restore:{title:"\u8FD8\u539F"},saveAsImage:{title:"\u4FDD\u5B58\u4E3A\u56FE\u7247",lang:["\u53F3\u952E\u53E6\u5B58\u4E3A\u56FE\u7247"]}},series:{typeNames:{pie:"\u997C\u56FE",bar:"\u67F1\u72B6\u56FE",line:"\u6298\u7EBF\u56FE",scatter:"\u6563\u70B9\u56FE",effectScatter:"\u6D9F\u6F2A\u6563\u70B9\u56FE",radar:"\u96F7\u8FBE\u56FE",tree:"\u6811\u56FE",treemap:"\u77E9\u5F62\u6811\u56FE",boxplot:"\u7BB1\u578B\u56FE",candlestick:"K\u7EBF\u56FE",k:"K\u7EBF\u56FE",heatmap:"\u70ED\u529B\u56FE",map:"\u5730\u56FE",parallel:"\u5E73\u884C\u5750\u6807\u56FE",lines:"\u7EBF\u56FE",graph:"\u5173\u7CFB\u56FE",sankey:"\u6851\u57FA\u56FE",funnel:"\u6F0F\u6597\u56FE",gauge:"\u4EEA\u8868\u76D8\u56FE",pictorialBar:"\u8C61\u5F62\u67F1\u56FE",themeRiver:"\u4E3B\u9898\u6CB3\u6D41\u56FE",sunburst:"\u65ED\u65E5\u56FE",custom:"\u81EA\u5B9A\u4E49\u56FE\u8868",chart:"\u56FE\u8868"}},aria:{general:{withTitle:"\u8FD9\u662F\u4E00\u4E2A\u5173\u4E8E\u201C{title}\u201D\u7684\u56FE\u8868\u3002",withoutTitle:"\u8FD9\u662F\u4E00\u4E2A\u56FE\u8868\uFF0C"},series:{single:{prefix:"",withName:"\u56FE\u8868\u7C7B\u578B\u662F{seriesType}\uFF0C\u8868\u793A{seriesName}\u3002",withoutName:"\u56FE\u8868\u7C7B\u578B\u662F{seriesType}\u3002"},multiple:{prefix:"\u5B83\u7531{seriesCount}\u4E2A\u56FE\u8868\u7CFB\u5217\u7EC4\u6210\u3002",withName:"\u7B2C{seriesId}\u4E2A\u7CFB\u5217\u662F\u4E00\u4E2A\u8868\u793A{seriesName}\u7684{seriesType}\uFF0C",withoutName:"\u7B2C{seriesId}\u4E2A\u7CFB\u5217\u662F\u4E00\u4E2A{seriesType}\uFF0C",separator:{middle:"\uFF1B",end:"\u3002"}}},data:{allData:"\u5176\u6570\u636E\u662F\u2014\u2014",partialData:"\u5176\u4E2D\uFF0C\u524D{displayCnt}\u9879\u662F\u2014\u2014",withName:"{name}\u7684\u6570\u636E\u662F{value}",withoutName:"{value}",separator:{middle:"\uFF0C",end:""}}}};var hc="ZH",lm="EN",rs=lm,pc={},um={},vc=oe.domSupported?(function(){var t=(document.documentElement.lang||navigator.language||navigator.browserLanguage||rs).toUpperCase();return t.indexOf(hc)>-1?hc:rs})():rs;function dc(t,e){t=t.toUpperCase(),um[t]=new Ce(e),pc[t]=e}function Ib(t){if(U(t)){var e=pc[t.toUpperCase()]||{};return t===hc||t===lm?$(e):he($(e),$(pc[rs]),!1)}else return he($(t),$(pc[rs]),!1)}function Ob(t){return um[t]}function Lb(){return um[rs]}dc(lm,Eb);dc(hc,Mb);var vP=null;function Ge(){return vP}function mc(t,e){var r=Ge(),i=e.breakOption,n=e.breakParsed;return!n&&r&&(n=r.parseAxisBreakOption(i,t)),n}function Na(t){var e=t.brk;return e?e.breaks:[]}function Ra(t){var e=t.brk;return e?e.hasBreaks():!1}var _c=1e3,xc=_c*60,is=xc*60,cr=is*24,fm=cr*365,dP={year:/({yyyy}|{yy})/,month:/({MMMM}|{MMM}|{MM}|{M})/,day:/({dd}|{d})/,hour:/({HH}|{H}|{hh}|{h})/,minute:/({mm}|{m})/,second:/({ss}|{s})/,millisecond:/({SSS}|{S})/},yc={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}"},mP="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}",gc="{yyyy}-{MM}-{dd}",cm={year:"{yyyy}",month:"{yyyy}-{MM}",day:gc,hour:gc+" "+yc.hour,minute:gc+" "+yc.minute,second:gc+" "+yc.second,millisecond:mP},Kt=["year","month","day","hour","minute","second","millisecond"],Pb=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function Nb(t){return!U(t)&&!X(t)?gP(t):t}function gP(t){t=t||{};var e={},r=!0;return T(Kt,function(i){r&&(r=t[i]==null)}),T(Kt,function(i,n){var a=t[i];e[i]={};for(var o=null,s=n;s>=0;s--){var l=Kt[s],u=Y(a)&&!k(a)?a[l]:a,f=void 0;k(u)?(f=u.slice(),o=f[0]||""):U(u)?(o=u,f=[o]):(o==null?o=yc[i]:dP[l].test(o)||(o=e[l][l][0]+" "+o),f=[o],r&&(f[1]="{primary|"+o+"}")),e[i][l]=f}}),e}function It(t,e){return t+="","0000".substr(0,e-t.length)+t}function ns(t){switch(t){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:return t}}function Rb(t){return t===ns(t)}function kb(t){switch(t){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}function Ri(t,e,r,i){var n=Pt(t),a=n[pm(r)](),o=n[Sc(r)]()+1,s=Math.floor((o-1)/3)+1,l=n[bc(r)](),u=n["get"+(r?"UTC":"")+"Day"](),f=n[Tc(r)](),c=(f-1)%12+1,p=n[wc(r)](),h=n[Cc(r)](),v=n[Ac(r)](),d=f>=12?"pm":"am",m=d.toUpperCase(),g=i instanceof Ce?i:Ob(i||vc)||Lb(),y=g.getModel("time"),_=y.get("month"),x=y.get("monthAbbr"),S=y.get("dayOfWeek"),b=y.get("dayOfWeekAbbr");return(e||"").replace(/{a}/g,d+"").replace(/{A}/g,m+"").replace(/{yyyy}/g,a+"").replace(/{yy}/g,It(a%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,_[o-1]).replace(/{MMM}/g,x[o-1]).replace(/{MM}/g,It(o,2)).replace(/{M}/g,o+"").replace(/{dd}/g,It(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,S[u]).replace(/{ee}/g,b[u]).replace(/{e}/g,u+"").replace(/{HH}/g,It(f,2)).replace(/{H}/g,f+"").replace(/{hh}/g,It(c+"",2)).replace(/{h}/g,c+"").replace(/{mm}/g,It(p,2)).replace(/{m}/g,p+"").replace(/{ss}/g,It(h,2)).replace(/{s}/g,h+"").replace(/{SSS}/g,It(v,3)).replace(/{S}/g,v+"")}function Bb(t,e,r,i,n){var a=null;if(U(r))a=r;else if(X(r)){var o={time:t.time,level:t.time?t.time.level:0},s=Ge();s&&s.makeAxisLabelFormatterParamBreak(o,t.break),a=r(t.value,e,o)}else{var l=t.time;if(l){var u=r[l.lowerTimeUnit][l.upperTimeUnit];a=u[Math.min(l.level,u.length-1)]||""}else{var f=ka(t.value,n);a=r[f][f][0]}}return Ri(new Date(t.value),a,n,i)}function ka(t,e){var r=Pt(t),i=r[Sc(e)]()+1,n=r[bc(e)](),a=r[Tc(e)](),o=r[wc(e)](),s=r[Cc(e)](),l=r[Ac(e)](),u=l===0,f=u&&s===0,c=f&&o===0,p=c&&a===0,h=p&&n===1,v=h&&i===1;return v?"year":h?"month":p?"day":c?"hour":f?"minute":u?"second":"millisecond"}function as(t,e,r){switch(e){case"year":t[hm(r)](0);case"month":t[vm(r)](1);case"day":t[dm(r)](0);case"hour":t[mm(r)](0);case"minute":t[gm(r)](0);case"second":t[ym(r)](0)}return t}function pm(t){return t?"getUTCFullYear":"getFullYear"}function Sc(t){return t?"getUTCMonth":"getMonth"}function bc(t){return t?"getUTCDate":"getDate"}function Tc(t){return t?"getUTCHours":"getHours"}function wc(t){return t?"getUTCMinutes":"getMinutes"}function Cc(t){return t?"getUTCSeconds":"getSeconds"}function Ac(t){return t?"getUTCMilliseconds":"getMilliseconds"}function zb(t){return t?"setUTCFullYear":"setFullYear"}function hm(t){return t?"setUTCMonth":"setMonth"}function vm(t){return t?"setUTCDate":"setDate"}function dm(t){return t?"setUTCHours":"setHours"}function mm(t){return t?"setUTCMinutes":"setMinutes"}function gm(t){return t?"setUTCSeconds":"setSeconds"}function ym(t){return t?"setUTCMilliseconds":"setMilliseconds"}function _m(t,e,r,i,n,a,o,s){var l=new De({style:{text:t,font:e,align:r,verticalAlign:i,padding:n,rich:a,overflow:o?"truncate":null,lineHeight:s}});return l.getBoundingRect()}function Ul(t){if(!hl(t))return U(t)?t:"-";var e=(t+"").split(".");return e[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:"")}function os(t,e){return t=(t||"").toLowerCase().replace(/-(.)/g,function(r,i){return i.toUpperCase()}),e&&t&&(t=t.charAt(0).toUpperCase()+t.slice(1)),t}var di=Vn;function Dc(t,e,r){var i="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}";function n(f){return f&&pt(f)?f:"-"}function a(f){return tt(f)}var o=e==="time",s=t instanceof Date;if(o||s){var l=o?Pt(t):t;if(isNaN(+l)){if(s)return"-"}else return Ri(l,i,r)}if(e==="ordinal")return vo(t)?n(t):se(t)&&a(t)?t+"":"-";var u=Sr(t);return a(u)?Ul(u):vo(t)?n(t):typeof t=="boolean"?t+"":"-"}var Ub=["a","b","c","d","e","f","g"],xm=function(t,e){return"{"+t+(e==null?"":e)+"}"};function ss(t,e,r){k(e)||(e=[e]);var i=e.length;if(!i)return"";for(var n=e[0].$vars||[],a=0;a':'';var o=r.markerId||"markerX";return{renderMode:a,content:"{"+o+"|} ",style:n==="subItem"?{width:4,height:4,borderRadius:2,backgroundColor:i}:{width:10,height:10,borderRadius:5,backgroundColor:i}}}function Fb(t,e,r){(t==="week"||t==="month"||t==="quarter"||t==="half-year"||t==="year")&&(t=`MM-dd +yyyy`);var i=Pt(e),n=r?"getUTC":"get",a=i[n+"FullYear"](),o=i[n+"Month"]()+1,s=i[n+"Date"](),l=i[n+"Hours"](),u=i[n+"Minutes"](),f=i[n+"Seconds"](),c=i[n+"Milliseconds"]();return t=t.replace("MM",It(o,2)).replace("M",o).replace("yyyy",a).replace("yy",It(a%100+"",2)).replace("dd",It(s,2)).replace("d",s).replace("hh",It(l,2)).replace("h",l).replace("mm",It(u,2)).replace("m",u).replace("ss",It(f,2)).replace("s",f).replace("SSS",It(c,3)),t}function Vb(t){return t&&t.charAt(0).toUpperCase()+t.substr(1)}function Yr(t,e){return e=e||"transparent",U(t)?t:Y(t)&&t.colorStops&&(t.colorStops[0]||{}).color||e}var Mc={},bm={},yP=(function(){function t(){this._normalMasterList=[],this._nonSeriesBoxMasterList=[]}return t.prototype.create=function(e,r){this._nonSeriesBoxMasterList=i(Mc,!0),this._normalMasterList=i(bm,!1);function i(n,a){var o=[];return T(n,function(s,l){var u=s.create(e,r);o=o.concat(u||[])}),o}},t.prototype.update=function(e,r){T(this._normalMasterList,function(i){i.update&&i.update(e,r)})},t.prototype.getCoordinateSystems=function(){return this._normalMasterList.concat(this._nonSeriesBoxMasterList)},t.register=function(e,r){if(e==="matrix"||e==="calendar"){Mc[e]=r;return}bm[e]=r},t.get=function(e){return bm[e]||Mc[e]},t})();function _P(t){return!!Mc[t]}var xP=1,Tm=2;function Gb(t){Hb.set(t.fullType,{getCoord2:void 0}).getCoord2=t.getCoord2}var Hb=G();function Oc(t){var e=t.getShallow("coord",!0),r=xP;if(e==null){var i=Hb.get(t.type);i&&i.getCoord2&&(r=Tm,e=i.getCoord2(t))}return{coord:e,from:r}}var ls=0,Ic=1,SP=2;function bP(t,e){var r=t.getShallow("coordinateSystem"),i=t.getShallow("coordinateSystemUsage",!0),n=i!=null,a=ls;if(r){var o=t.mainType==="series";i==null&&(i=o?"data":"box"),i==="data"?(a=Ic,o||(a=ls)):i==="box"&&(a=SP,!o&&!_P(r)&&(a=ls))}return{coordSysType:r,kind:a}}function Yb(t){var e=t.targetModel,r=t.coordSysType,i=t.coordSysProvider,n=t.isDefaultDataCoordSys,a=t.allowNotFound,o=bP(e,!0),s=o.kind,l=o.coordSysType;if(n&&s!==Ic&&(s=Ic,l=r),s===ls||l!==r)return ls;var u=i(r,e);return u?(s===Ic?e.coordinateSystem=u:e.boxCoordinateSystem=u,s):ls}var us=yP;var Pc=T,TP=["left","right","top","bottom","width","height"],Lc=[["width","left","right"],["height","top","bottom"]];function wm(t,e,r,i,n){var a=0,o=0;i==null&&(i=1/0),n==null&&(n=1/0);var s=0;e.eachChild(function(l,u){var f=l.getBoundingRect(),c=e.childAt(u+1),p=c&&c.getBoundingRect(),h,v;if(t==="horizontal"){var d=f.width+(p?-p.x+f.x:0);h=a+d,h>i||l.newline?(a=0,h=d,o+=s+r,s=f.height):s=Math.max(s,f.height)}else{var m=f.height+(p?-p.y+f.y:0);v=o+m,v>n||l.newline?(a+=s+r,o=0,v=m,s=f.width):s=Math.max(s,f.width)}l.newline||(l.x=a,l.y=o,l.markRedraw(),t==="horizontal"?a=h+r:o=v+r)})}var Ba=wm,H3=be(wm,"vertical"),Y3=be(wm,"horizontal");function Wb(t,e){return{left:t.getShallow("left",e),top:t.getShallow("top",e),right:t.getShallow("right",e),bottom:t.getShallow("bottom",e),width:t.getShallow("width",e),height:t.getShallow("height",e)}}function wP(t,e){var r=za(t,e,{enableLayoutOnlyByCenter:!0}),i=t.getBoxLayoutParams(),n,a;if(r.type===Fl.point)a=r.refPoint,n=jt(i,{width:e.getWidth(),height:e.getHeight()});else{var o=t.get("center"),s=k(o)?o:[o,o];n=jt(i,r.refContainer),a=r.boxCoordFrom===Tm?r.refPoint:[we(s[0],n.width)+n.x,we(s[1],n.height)+n.y]}return{viewRect:n,center:a}}function Xb(t,e){var r=wP(t,e),i=r.viewRect,n=r.center,a=t.get("radius");k(a)||(a=[0,a]);var o=we(i.width,e.getWidth()),s=we(i.height,e.getHeight()),l=Math.min(o,s),u=we(a[0],l/2),f=we(a[1],l/2);return{cx:n[0],cy:n[1],r0:u,r:f,viewRect:i}}function jt(t,e,r){r=di(r||0);var i=e.width,n=e.height,a=we(t.left,i),o=we(t.top,n),s=we(t.right,i),l=we(t.bottom,n),u=we(t.width,i),f=we(t.height,n),c=r[2]+r[0],p=r[1]+r[3],h=t.aspect;switch(isNaN(u)&&(u=i-s-p-a),isNaN(f)&&(f=n-l-c-o),h!=null&&(isNaN(u)&&isNaN(f)&&(h>i/n?u=i*.8:f=n*.8),isNaN(u)&&(u=h*f),isNaN(f)&&(f=u/h)),isNaN(a)&&(a=i-s-u-p),isNaN(o)&&(o=n-l-f-c),t.left||t.right){case"center":a=i/2-u/2-r[3];break;case"right":a=i-u-p;break}switch(t.top||t.bottom){case"middle":case"center":o=n/2-f/2-r[0];break;case"bottom":o=n-f-c;break}a=a||0,o=o||0,isNaN(u)&&(u=i-p-a-(s||0)),isNaN(f)&&(f=n-c-o-(l||0));var v=new ae((e.x||0)+a+r[3],(e.y||0)+o+r[0],u,f);return v.margin=r,v}var Fl={rect:1,point:2};function za(t,e,r){var i,n,a,o=t.boxCoordinateSystem,s;if(o){var l=Oc(t),u=l.coord,f=l.from;if(o.dataToLayout){a=Fl.rect,s=f;var c=o.dataToLayout(u);i=c.contentRect||c.rect}else r&&r.enableLayoutOnlyByCenter&&o.dataToPoint&&(a=Fl.point,s=f,n=o.dataToPoint(u))}return a==null&&(a=Fl.rect),a===Fl.rect&&(i||(i={x:0,y:0,width:e.getWidth(),height:e.getHeight()}),n=[i.x+i.width/2,i.y+i.height/2]),{type:a,refContainer:i,refPoint:n,boxCoordFrom:s}}function Sn(t){var e=t.layoutMode||t.constructor.layoutMode;return Y(e)?e:e?{type:e}:null}function pr(t,e,r){var i=r&&r.ignoreSize;!k(i)&&(i=[i,i]);var n=o(Lc[0],0),a=o(Lc[1],1);l(Lc[0],t,n),l(Lc[1],t,a);function o(u,f){var c={},p=0,h={},v=0,d=2;if(Pc(u,function(y){h[y]=t[y]}),Pc(u,function(y){Oe(e,y)&&(c[y]=h[y]=e[y]),s(c,y)&&p++,s(h,y)&&v++}),i[f])return s(e,u[1])?h[u[2]]=null:s(e,u[2])&&(h[u[1]]=null),h;if(v===d||!p)return h;if(p>=d)return c;for(var m=0;m=0;l--)s=he(s,n[l],!0);i.defaultOption=s}return i.defaultOption},e.prototype.getReferringComponents=function(r,i){var n=r+"Index",a=r+"Id";return an(this.ecModel,r,{index:this.get(n,!0),id:this.get(a,!0)},i)},e.prototype.getBoxLayoutParams=function(){return Wb(this,!1)},e.prototype.getZLevelKey=function(){return""},e.prototype.setZLevel=function(r){this.option.zlevel=r},e.protoInitialize=(function(){var r=e.prototype;r.type="component",r.id="",r.name="",r.mainType="",r.subType="",r.componentIndex=0})(),e})(Ce);Nf(fs,Ce);ln(fs);Ab(fs);Db(fs,DP);function DP(t){var e=[];return T(fs.getClassesByMainType(t),function(r){e=e.concat(r.dependencies||r.prototype.dependencies||[])}),e=z(e,function(r){return Xt(r).main}),t!=="dataset"&&ie(e,"dataset")<=0&&e.unshift("dataset"),e}var Se=fs;var Ua={color:{},darkColor:{},size:{}},Xe=Ua.color={theme:["#5070dd","#b6d634","#505372","#ff994d","#0ca8df","#ffd10a","#fb628b","#785db0","#3fbe95"],neutral00:"#fff",neutral05:"#f4f7fd",neutral10:"#e8ebf0",neutral15:"#dbdee4",neutral20:"#cfd2d7",neutral25:"#c3c5cb",neutral30:"#b7b9be",neutral35:"#aaacb2",neutral40:"#9ea0a5",neutral45:"#929399",neutral50:"#86878c",neutral55:"#797b7f",neutral60:"#6d6e73",neutral65:"#616266",neutral70:"#54555a",neutral75:"#48494d",neutral80:"#3c3c41",neutral85:"#303034",neutral90:"#232328",neutral95:"#17171b",neutral99:"#000",accent05:"#eff1f9",accent10:"#e0e4f2",accent15:"#d0d6ec",accent20:"#c0c9e6",accent25:"#b1bbdf",accent30:"#a1aed9",accent35:"#91a0d3",accent40:"#8292cc",accent45:"#7285c6",accent50:"#6578ba",accent55:"#5c6da9",accent60:"#536298",accent65:"#4a5787",accent70:"#404c76",accent75:"#374165",accent80:"#2e3654",accent85:"#252b43",accent90:"#1b2032",accent95:"#121521",transparent:"rgba(0,0,0,0)",highlight:"rgba(255,231,130,0.8)"};P(Xe,{primary:Xe.neutral80,secondary:Xe.neutral70,tertiary:Xe.neutral60,quaternary:Xe.neutral50,disabled:Xe.neutral20,border:Xe.neutral30,borderTint:Xe.neutral20,borderShade:Xe.neutral40,background:Xe.neutral05,backgroundTint:"rgba(234,237,245,0.5)",backgroundTransparent:"rgba(255,255,255,0)",backgroundShade:Xe.neutral10,shadow:"rgba(0,0,0,0.2)",shadowTint:"rgba(129,130,136,0.2)",axisLine:Xe.neutral70,axisLineTint:Xe.neutral40,axisTick:Xe.neutral70,axisTickMinor:Xe.neutral60,axisLabel:Xe.neutral70,axisSplitLine:Xe.neutral15,axisMinorSplitLine:Xe.neutral05});for(bn in Xe)Xe.hasOwnProperty(bn)&&(Cm=Xe[bn],bn==="theme"?Ua.darkColor.theme=Xe.theme.slice():bn==="highlight"?Ua.darkColor.highlight="rgba(255,231,130,0.4)":bn.indexOf("accent")===0?Ua.darkColor[bn]=Co(Cm,null,function(t){return t*.5},function(t){return Math.min(1,1.3-t)}):Ua.darkColor[bn]=Co(Cm,null,function(t){return t*.9},function(t){return 1-Math.pow(t,1.5)}));var Cm,bn;Ua.size={xxs:2,xs:5,s:10,m:15,l:20,xl:30,xxl:40,xxxl:50};var K=Ua;var Zb="";typeof navigator!="undefined"&&(Zb=navigator.platform||"");var cs="rgba(0, 0, 0, 0.2)",qb=K.color.theme[0],EP=Co(qb,null,null,.9),Rc={darkMode:"auto",colorBy:"series",color:K.color.theme,gradientColor:[EP,qb],aria:{decal:{decals:[{color:cs,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:cs,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:cs,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:cs,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:cs,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:cs,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:Zb.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,stateAnimation:{duration:300,easing:"cubicOut"},animation:"auto",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicInOut",animationEasingUpdate:"cubicInOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1};var ut={Must:1,Might:2,Not:3},Kb=te();function jb(t){Kb(t).datasetMap=G()}function Qb(t,e,r){var i={},n=kc(e);if(!n||!t)return i;var a=[],o=[],s=e.ecModel,l=Kb(s).datasetMap,u=n.uid+"_"+r.seriesLayoutBy,f,c;t=t.slice(),T(t,function(d,m){var g=Y(d)?d:t[m]={name:d};g.type==="ordinal"&&f==null&&(f=m,c=v(g)),i[g.name]=[]});var p=l.get(u)||l.set(u,{categoryWayDim:c,valueWayDim:0});T(t,function(d,m){var g=d.name,y=v(d);if(f==null){var _=p.valueWayDim;h(i[g],_,y),h(o,_,y),p.valueWayDim+=y}else if(f===m)h(i[g],0,y),h(a,0,y);else{var _=p.categoryWayDim;h(i[g],_,y),h(o,_,y),p.categoryWayDim+=y}});function h(d,m,g){for(var y=0;ye)return t[i];return t[r-1]}function iT(t,e,r,i,n,a,o){a=a||t;var s=e(a),l=s.paletteIdx||0,u=s.paletteNameMap=s.paletteNameMap||{};if(u.hasOwnProperty(n))return u[n];var f=o==null||!i?r:OP(i,o);if(f=f||r,!(!f||!f.length)){var c=f[l];return n&&(u[n]=c),s.paletteIdx=(l+1)%f.length,c}}function LP(t,e){e(t).paletteIdx=0,e(t).paletteNameMap={}}var zc,Gl,nT,aT="\0_ec_inner",PP=1;var uT=(function(t){L(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.init=function(r,i,n,a,o,s){a=a||{},this.option=null,this._theme=new Ce(a),this._locale=new Ce(o),this._optionManager=s},e.prototype.setOption=function(r,i,n){var a=lT(i);this._optionManager.setOption(r,n,a),this._resetOption(null,a)},e.prototype.resetOption=function(r,i){return this._resetOption(r,lT(i))},e.prototype._resetOption=function(r,i){var n=!1,a=this._optionManager;if(!r||r==="recreate"){var o=a.mountOption(r==="recreate");!this.option||r==="recreate"?nT(this,o):(this.restoreData(),this._mergeOption(o,i)),n=!0}if((r==="timeline"||r==="media")&&this.restoreData(),!r||r==="recreate"||r==="timeline"){var s=a.getTimelineOption(this);s&&(n=!0,this._mergeOption(s,i))}if(!r||r==="recreate"||r==="media"){var l=a.getMediaOption(this);l.length&&T(l,function(u){n=!0,this._mergeOption(u,i)},this)}return n},e.prototype.mergeOption=function(r){this._mergeOption(r,null)},e.prototype._mergeOption=function(r,i){var n=this.option,a=this._componentsMap,o=this._componentsCount,s=[],l=G(),u=i&&i.replaceMergeMainTypeMap;jb(this),T(r,function(c,p){c!=null&&(Se.hasClass(p)?p&&(s.push(p),l.set(p,!0)):n[p]=n[p]==null?$(c):he(n[p],c,!0))}),u&&u.each(function(c,p){Se.hasClass(p)&&!l.get(p)&&(s.push(p),l.set(p,!0))}),Se.topologicalTravel(s,Se.getAllClassMainTypes(),f,this);function f(c){var p=tT(this,c,ke(r[c])),h=a.get(c),v=h?u&&u.get(c)?"replaceMerge":"normalMerge":"replaceAll",d=hx(h,p,v);dx(d,c,Se),n[c]=null,a.set(c,null),o.set(c,0);var m=[],g=[],y=0,_,x;T(d,function(S,b){var w=S.existing,A=S.newOption;if(!A)w&&(w.mergeOption({},this),w.optionUpdated({},!1));else{var C=c==="series",D=Se.getClass(c,S.keyInfo.subType,!C);if(!D){if(0)var E,I;return}if(c==="tooltip"){if(_)return;_=!0}if(w&&w.constructor===D)w.name=S.keyInfo.name,w.mergeOption(A,this),w.optionUpdated(A,!1);else{var M=P({componentIndex:b},S.keyInfo);w=new D(A,this,this,M),P(w,M),S.brandNew&&(w.__requireNewView=!0),w.init(A,this,this),w.optionUpdated(null,!0)}}w?(m.push(w.option),g.push(w),y++):(m.push(void 0),g.push(void 0))},this),n[c]=m,a.set(c,g),o.set(c,y),c==="series"&&zc(this)}this._seriesIndices||zc(this)},e.prototype.getOption=function(){var r=$(this.option);return T(r,function(i,n){if(Se.hasClass(n)){for(var a=ke(i),o=a.length,s=!1,l=o-1;l>=0;l--)a[l]&&!No(a[l])?s=!0:(a[l]=null,!s&&o--);a.length=o,r[n]=a}}),delete r[aT],r},e.prototype.setTheme=function(r){this._theme=new Ce(r),this._resetOption("recreate",null)},e.prototype.getTheme=function(){return this._theme},e.prototype.getLocaleModel=function(){return this._locale},e.prototype.setUpdatePayload=function(r){this._payload=r},e.prototype.getUpdatePayload=function(){return this._payload},e.prototype.getComponent=function(r,i){var n=this._componentsMap.get(r);if(n){var a=n[i||0];if(a)return a;if(i==null){for(var o=0;o=e:r==="max"?t<=e:t===e}function VP(t,e){return t.join(",")===e.join(",")}var fT=BP;var Wr=T,Yl=Y,cT=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function Dm(t){var e=t&&t.itemStyle;if(e)for(var r=0,i=cT.length;r0?r[o-1].seriesModel:null)}),KP(r)}})}function KP(t){T(t,function(e,r){var i=[],n=[NaN,NaN],a=[e.stackResultDimension,e.stackedOverDimension],o=e.data,s=e.isStackedByIndex,l=e.seriesModel.get("stackStrategy")||"samesign";o.modify(a,function(u,f,c){var p=o.get(e.stackedDimension,c);if(isNaN(p))return n;var h,v;s?v=o.getRawIndex(c):h=o.get(e.stackedByDimension,c);for(var d=NaN,m=r-1;m>=0;m--){var g=t[m];if(s||(v=g.data.rawIndexOf(g.stackedByDimension,h)),v>=0){var y=g.data.getByRawIndex(g.stackResultDimension,v);if(l==="all"||l==="positive"&&y>0||l==="negative"&&y<0||l==="samesign"&&p>=0&&y>0||l==="samesign"&&p<=0&&y<0){p=Ei(p,y),d=y;break}}}return i[0]=p,i[1]=d,i})})}var Vc=(function(){function t(e){this.data=e.data||(e.sourceFormat===Zt?{}:[]),this.sourceFormat=e.sourceFormat||Td,this.seriesLayoutBy=e.seriesLayoutBy||or,this.startIndex=e.startIndex||0,this.dimensionsDetectedCount=e.dimensionsDetectedCount,this.metaRawOption=e.metaRawOption;var r=this.dimensionsDefine=e.dimensionsDefine;if(r)for(var i=0;id&&(d=_)}h[0]=v,h[1]=d}},n=function(){return this._data?this._data.length/this._dimSize:0};ST=(e={},e[rt+"_"+or]={pure:!0,appendData:a},e[rt+"_"+fi]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},e[Et]={pure:!0,appendData:a},e[Zt]={pure:!0,appendData:function(o){var s=this._data;T(o,function(l,u){for(var f=s[u]||(s[u]=[]),c=0;c<(l||[]).length;c++)f.push(l[c])})}},e[st]={appendData:a},e[ar]={persistent:!1,pure:!0,appendData:function(o){this._data=o},clean:function(){this._offset+=this.count(),this._data=null}},e);function a(o){for(var s=0;s=0&&(d=o.interpolatedValue[m])}return d!=null?d+"":""})}},t.prototype.getRawValue=function(e,r){return Bi(this.getData(r),e)},t.prototype.formatTooltip=function(e,r,i){},t})();function km(t){var e,r;return Y(t)?t.type&&(r=t):e=t,{text:e,frag:r}}function Tn(t){return new rN(t)}var rN=(function(){function t(e){e=e||{},this._reset=e.reset,this._plan=e.plan,this._count=e.count,this._onDirty=e.onDirty,this._dirty=!0}return t.prototype.perform=function(e){var r=this._upstream,i=e&&e.skip;if(this._dirty&&r){var n=this.context;n.data=n.outputData=r.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this);var a;this._plan&&!i&&(a=this._plan(this.context));var o=f(this._modBy),s=this._modDataCount||0,l=f(e&&e.modBy),u=e&&e.modDataCount||0;(o!==l||s!==u)&&(a="reset");function f(y){return!(y>=1)&&(y=1),y}var c;(this._dirty||a==="reset")&&(this._dirty=!1,c=this._doReset(i)),this._modBy=l,this._modDataCount=u;var p=e&&e.step;if(r?this._dueEnd=r._outputDueEnd:this._dueEnd=this._count?this._count(this.context):1/0,this._progress){var h=this._dueIndex,v=Math.min(p!=null?this._dueIndex+p:1/0,this._dueEnd);if(!i&&(c||h1&&i>0?s:o}};return a;function o(){return e=t?null:le},gte:function(t,e){return t>=e}},nW=(function(){function t(e,r){if(!se(r)){var i="";vt(i)}this._opFn=iN[e],this._rvalFloat=Sr(r)}return t.prototype.evaluate=function(e){return se(e)?this._opFn(e,this._rvalFloat):this._opFn(Sr(e),this._rvalFloat)},t})(),DT=(function(){function t(e,r){var i=e==="desc";this._resultLT=i?1:-1,r==null&&(r=i?"min":"max"),this._incomparable=r==="min"?-1/0:1/0}return t.prototype.evaluate=function(e,r){var i=se(e)?e:Sr(e),n=se(r)?r:Sr(r),a=isNaN(i),o=isNaN(n);if(a&&(i=this._incomparable),o&&(n=this._incomparable),a&&o){var s=U(e),l=U(r);s&&(i=l?e:0),l&&(n=s?r:0)}return in?-this._resultLT:0},t})();var aW=(function(){function t(e,r){this._rval=r,this._isEQ=e,this._rvalTypeof=typeof r,this._rvalFloat=Sr(r)}return t.prototype.evaluate=function(e){var r=e===this._rval;if(!r){var i=typeof e;i!==this._rvalTypeof&&(i==="number"||this._rvalTypeof==="number")&&(r=Sr(e)===this._rvalFloat)}return this._isEQ?r:!r},t})();function Wc(t){var e="",r=-1/0,i=-1/0,n=1/0,a=1/0;return t&&(t.g!=null&&(e+="G"+t.g,r=t.g),t.ge!=null&&(e+="GE"+t.ge,i=t.ge),t.l!=null&&(e+="L"+t.l,n=t.l),t.le!=null&&(e+="LE"+t.le,a=t.le)),{key:e,g:r,ge:i,l:n,le:a}}function Xc(t,e){return e>t.g&&e>=t.ge&&e65535?cN:pN}function hN(t){var e=t.constructor;return e===Array?t.slice():new e(t)}function LT(t,e,r,i,n){var a=PT[r||"float"];if(n){var o=t[e],s=o&&o.length;if(s!==i){for(var l=new a(i),u=0;um[1]&&(m[1]=d)}return this._rawCount=this._count=l,{start:s,end:l}},t.prototype._initDataFromProvider=function(e,r,i){for(var n=this._provider,a=this._chunks,o=this._dimensions,s=o.length,l=this._rawExtent,u=z(o,function(y){return y.property}),f=0;fg[1]&&(g[1]=m)}}!n.persistent&&n.clean&&n.clean(),this._rawCount=this._count=r,this._extent=[]},t.prototype.count=function(){return this._count},t.prototype.get=function(e,r){if(!(r>=0&&r=0&&r=this._rawCount||e<0)return-1;if(!this._indices)return e;var r=this._indices,i=r[e];if(i!=null&&ie)a=o-1;else return o}return-1},t.prototype.getIndices=function(){var e,r=this._indices;if(r){var i=r.constructor,n=this._count;if(i===Array){e=new i(n);for(var a=0;a=c&&y<=p||isNaN(y))&&(l[u++]=d),d++}v=!0}else if(a===2){for(var m=h[n[0]],_=h[n[1]],x=e[n[1]][0],S=e[n[1]][1],g=0;g=c&&y<=p||isNaN(y))&&(b>=x&&b<=S||isNaN(b))&&(l[u++]=d),d++}v=!0}}if(!v)if(a===1)for(var g=0;g=c&&y<=p||isNaN(y))&&(l[u++]=w)}else for(var g=0;ge[D][1])&&(A=!1)}A&&(l[u++]=r.getRawIndex(g))}return ug[1]&&(g[1]=m)}}}},t.prototype.lttbDownSample=function(e,r){var i=this.clone([e],!0),n=i._chunks,a=n[e],o=this.count(),s=0,l=Math.floor(1/r),u=this.getRawIndex(0),f,c,p,h=new(ds(this._rawCount))(Math.min((Math.ceil(o/l)+2)*2,o));h[s++]=u;for(var v=1;vf&&(f=c,p=x)}E>0&&Es&&(d=s-f);for(var m=0;mv&&(v=y,h=f+m)}var _=this.getRawIndex(c),x=this.getRawIndex(h);cf-v&&(l=f-v,s.length=l);for(var d=0;dc[1]&&(c[1]=g),p[h++]=y}return a._count=h,a._indices=p,a._updateGetRawIdx(),a},t.prototype.each=function(e,r){if(this._count)for(var i=e.length,n=this._chunks,a=0,o=this.count();ah&&(h=m))}return l[f]=[p,h]},t.prototype.getRawDataItem=function(e){var r=this.getRawIndex(e);if(this._provider.persistent)return this._provider.getItem(r);for(var i=[],n=this._chunks,a=0;a=0?this._indices[e]:-1},t.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},t.internalField=(function(){function e(r,i,n,a){return vs(r[a],this._dimensions[a])}zm={arrayRows:e,objectRows:function(r,i,n,a){return vs(r[i],this._dimensions[a])},keyedColumns:e,original:function(r,i,n,a){var o=r&&(r.value==null?r:r.value);return vs(o instanceof Array?o[a]:o,this._dimensions[a])},typedArray:function(r,i,n,a){return r[a]}}})(),t})(),Zl=vN;var RT=(function(){function t(e){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=e}return t.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},t.prototype._setLocalSource=function(e,r){this._sourceList=e,this._upstreamSignList=r,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},t.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},t.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},t.prototype._createSource=function(){this._setLocalSource([],[]);var e=this._sourceHost,r=this._getUpstreamSourceManagers(),i=!!r.length,n,a;if(Zc(e)){var o=e,s=void 0,l=void 0,u=void 0;if(i){var f=r[0];f.prepareSource(),u=f.getSource(),s=u.data,l=u.sourceFormat,a=[f._getVersionSign()]}else s=o.get("data",!0),l=Ve(s)?ar:st,a=[];var c=this._getSourceMetaRawOption()||{},p=u&&u.metaRawOption||{},h=W(c.seriesLayoutBy,p.seriesLayoutBy)||null,v=W(c.sourceHeader,p.sourceHeader),d=W(c.dimensions,p.dimensions),m=h!==p.seriesLayoutBy||!!v!=!!p.sourceHeader||d;n=m?[Xl(s,{seriesLayoutBy:h,sourceHeader:v,dimensions:d},l)]:[]}else{var g=e;if(i){var y=this._applyTransform(r);n=y.sourceList,a=y.upstreamSignList}else{var _=g.get("source",!0);n=[Xl(_,this._getSourceMetaRawOption(),null)],a=[]}}this._setLocalSource(n,a)},t.prototype._applyTransform=function(e){var r=this._sourceHost,i=r.get("transform",!0),n=r.get("fromTransformResult",!0);if(n!=null){var a="";e.length!==1&&NT(a)}var o,s=[],l=[];return T(e,function(u){u.prepareSource();var f=u.getSource(n||0),c="";n!=null&&!f&&NT(c),s.push(f),l.push(u._getVersionSign())}),i?o=IT(i,s,{datasetIndex:r.componentIndex}):n!=null&&(o=[xT(s[0])]),{sourceList:o,upstreamSignList:l}},t.prototype._isDirty=function(){if(this._dirty)return!0;for(var e=this._getUpstreamSourceManagers(),r=0;r1||r>0&&!t.noHeader;return T(t.blocks,function(n){var a=UT(n);a>=e&&(e=a+ +(i&&(!a||Fm(n)&&!n.noHeader)))}),e}return 0}function yN(t,e,r,i){var n=e.noHeader,a=xN(UT(e)),o=[],s=e.blocks||[];ze(!s||k(s)),s=s||[];var l=t.orderMode;if(e.sortBlocks&&l){s=s.slice();var u={valueAsc:"asc",valueDesc:"desc"};if(Oe(u,l)){var f=new DT(u[l],null);s.sort(function(d,m){return f.evaluate(d.sortParam,m.sortParam)})}else l==="seriesDesc"&&s.reverse()}T(s,function(d,m){var g=e.valueFormatter,y=zT(d)(g?P(P({},t),{valueFormatter:g}):t,d,m>0?a.html:0,i);y!=null&&o.push(y)});var c=t.renderMode==="richText"?o.join(a.richText):Vm(i,o.join(""),n?r:a.html);if(n)return c;var p=Dc(e.header,"ordinal",t.useUTC),h=BT(i,t.renderMode).nameStyle,v=kT(i);return t.renderMode==="richText"?FT(t,p,h)+a.richText+c:Vm(i,'
'+Je(p)+"
"+c,r)}function _N(t,e,r,i){var n=t.renderMode,a=e.noName,o=e.noValue,s=!e.markerType,l=e.name,u=t.useUTC,f=e.valueFormatter||t.valueFormatter||function(x){return x=k(x)?x:[x],z(x,function(S,b){return Dc(S,k(h)?h[b]:h,u)})};if(!(a&&o)){var c=s?"":t.markupStyleCreator.makeTooltipMarker(e.markerType,e.markerColor||K.color.secondary,n),p=a?"":Dc(l,"ordinal",u),h=e.valueType,v=o?[]:f(e.value,e.rawDataIndex),d=!s||!a,m=!s&&a,g=BT(i,n),y=g.nameStyle,_=g.valueStyle;return n==="richText"?(s?"":c)+(a?"":FT(t,p,y))+(o?"":TN(t,v,d,m,_)):Vm(i,(s?"":c)+(a?"":SN(p,!s,y))+(o?"":bN(v,d,m,_)),r)}}function Gm(t,e,r,i,n,a){if(t){var o=zT(t),s={useUTC:n,renderMode:r,orderMode:i,markupStyleCreator:e,valueFormatter:t.valueFormatter};return o(s,t,0,a)}}function xN(t){return{html:mN[t],richText:gN[t]}}function Vm(t,e,r){var i='
',n="margin: "+r+"px 0 0",a=kT(t);return'
'+e+i+"
"}function SN(t,e,r){var i=e?"margin-left:2px":"";return''+Je(t)+""}function bN(t,e,r,i){var n=r?"10px":"20px",a=e?"float:right;margin-left:"+n:"";return t=k(t)?t:[t],''+z(t,function(o){return Je(o)}).join("  ")+""}function FT(t,e,r){return t.markupStyleCreator.wrapRichTextStyle(e,r)}function TN(t,e,r,i,n){var a=[n],o=i?10:20;return r&&a.push({padding:[0,0,0,o],align:"right"}),t.markupStyleCreator.wrapRichTextStyle(k(e)?e.join(" "):e,a)}function VT(t,e){var r=t.getData().getItemVisual(e,"style"),i=r[t.visualDrawType];return Yr(i)}function qc(t,e){var r=t.get("padding");return r!=null?r:e==="richText"?[8,10]:10}var Kc=(function(){function t(){this.richTextStyles={},this._nextStyleNameId=vl()}return t.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},t.prototype.makeTooltipMarker=function(e,r,i){var n=i==="richText"?this._generateStyleName():null,a=Ec({color:r,type:e,renderMode:i,markerId:n});return U(a)?a:(this.richTextStyles[n]=a.style,a.content)},t.prototype.wrapRichTextStyle=function(e,r){var i={};k(r)?T(r,function(a){return P(i,a)}):P(i,r);var n=this._generateStyleName();return this.richTextStyles[n]=i,"{"+n+"|"+e+"}"},t})();function GT(t){var e=t.series,r=t.dataIndex,i=t.multipleSeries,n=e.getData(),a=n.mapDimensionsAll("defaultedTooltip"),o=a.length,s=e.getRawValue(r),l=k(s),u=VT(e,r),f,c,p,h;if(o>1||l&&!o){var v=wN(s,e,r,a,u);f=v.inlineValues,c=v.inlineValueTypes,p=v.blocks,h=v.inlineValues[0]}else if(o){var d=n.getDimensionInfo(a[0]);h=f=Bi(n,r,a[0]),c=d.type}else h=f=l?s[0]:s;var m=Ro(e),g=m&&e.name||"",y=n.getName(r),_=i?g:y;return Ya("section",{header:g,noHeader:i||!m,sortParam:h,blocks:[Ya("nameValue",{markerType:"item",markerColor:u,name:_,noName:!pt(_),value:f,valueType:c,rawDataIndex:n.getRawIndex(r)})].concat(p||[])})}function wN(t,e,r,i,n){var a=e.getData(),o=Ct(t,function(c,p,h){var v=a.getDimensionInfo(h);return c=c||v&&v.tooltip!==!1&&v.displayName!=null},!1),s=[],l=[],u=[];i.length?T(i,function(c){f(Bi(a,r,c),c)}):T(t,f);function f(c,p){var h=a.getDimensionInfo(p);!h||h.otherDims.tooltip===!1||(o?u.push(Ya("nameValue",{markerType:"subItem",markerColor:n,name:h.displayName,value:c,valueType:h.type})):(s.push(c),l.push(h.type)))}return{inlineValues:s,inlineValueTypes:l,blocks:u}}var wn=te();function jc(t,e){return t.getName(e)||t.getId(e)}var CN="__universalTransitionEnabled",Qc=(function(t){L(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r._selectedDataIndicesMap={},r}return e.prototype.init=function(r,i,n){this.seriesIndex=this.componentIndex,this.dataTask=Tn({count:DN,reset:EN}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(r,n);var a=wn(this).sourceManager=new RT(this);a.prepareSource();var o=this.getInitialData(r,n);YT(o,this),this.dataTask.context.data=o,wn(this).dataBeforeProcessed=o,HT(this),this._initSelectedMapFromData(o)},e.prototype.mergeDefaultAndTheme=function(r,i){var n=Sn(this),a=n?Dr(r):{},o=this.subType;Se.hasClass(o)&&(o+="Series"),he(r,i.getTheme().get(this.subType)),he(r,this.getDefaultOption()),ml(r,"label",["show"]),this.fillDataTextStyle(r.data),n&&pr(r,a,n)},e.prototype.mergeOption=function(r,i){r=he(this.option,r,!0),this.fillDataTextStyle(r.data);var n=Sn(this);n&&pr(this.option,r,n);var a=wn(this).sourceManager;a.dirty(),a.prepareSource();var o=this.getInitialData(r,i);YT(o,this),this.dataTask.dirty(),this.dataTask.context.data=o,wn(this).dataBeforeProcessed=o,HT(this),this._initSelectedMapFromData(o)},e.prototype.fillDataTextStyle=function(r){if(r&&!Ve(r))for(var i=["show"],n=0;n=0&&p<0)&&(c=S,p=x,h=0),x===p&&(f[h++]=m))}return f.length=h,f},e.prototype.formatTooltip=function(r,i,n){return GT({series:this,dataIndex:r,multipleSeries:i})},e.prototype.isAnimationEnabled=function(){var r=this.ecModel;if(oe.node&&!(r&&r.ssr))return!1;var i=this.getShallow("animation");return i&&this.getData().count()>this.getShallow("animationThreshold")&&(i=!1),!!i},e.prototype.restoreData=function(){this.dataTask.dirty()},e.prototype.getColorFromPalette=function(r,i,n){var a=this.ecModel,o=Vl.prototype.getColorFromPalette.call(this,r,i,n);return o||(o=a.getColorFromPalette(r,i,n)),o},e.prototype.coordDimToDataDim=function(r){return this.getRawData().mapDimensionsAll(r)},e.prototype.getProgressive=function(){return this.get("progressive")},e.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},e.prototype.select=function(r,i){this._innerSelect(this.getData(i),r)},e.prototype.unselect=function(r,i){var n=this.option.selectedMap;if(n){var a=this.option.selectedMode,o=this.getData(i);if(a==="series"||n==="all"){this.option.selectedMap={},this._selectedDataIndicesMap={};return}for(var s=0;s=0&&n.push(o)}return n},e.prototype.isSelected=function(r,i){var n=this.option.selectedMap;if(!n)return!1;var a=this.getData(i);return(n==="all"||n[jc(a,r)])&&!a.getItemModel(r).get(["select","disabled"])},e.prototype.isUniversalTransitionEnabled=function(){if(this[CN])return!0;var r=this.option.universalTransition;return r?r===!0?!0:r&&r.enabled:!1},e.prototype._innerSelect=function(r,i){var n,a,o=this.option,s=o.selectedMode,l=i.length;if(!(!s||!l)){if(s==="series")o.selectedMap="all";else if(s==="multiple"){Y(o.selectedMap)||(o.selectedMap={});for(var u=o.selectedMap,f=0;f0&&this._innerSelect(r,i)}},e.registerClass=function(r){return Se.registerClass(r)},e.protoInitialize=(function(){var r=e.prototype;r.type="series.__base__",r.seriesIndex=0,r.ignoreStyleOnData=!1,r.hasSymbolVisual=!1,r.defaultSymbol="circle",r.visualStyleAccessPath="itemStyle",r.visualDrawType="fill"})(),e})(Se);ct(Qc,CT);ct(Qc,Vl);Nf(Qc,Se);function HT(t){var e=t.name;Ro(t)||(t.name=AN(t)||e)}function AN(t){var e=t.getRawData(),r=e.mapDimensionsAll("seriesName"),i=[];return T(r,function(n){var a=e.getDimensionInfo(n);a.displayName&&i.push(a.displayName)}),i.join(" ")}function DN(t){return t.model.getRawData().count()}function EN(t){var e=t.model;return e.setData(e.getRawData().cloneShallow()),MN}function MN(t,e){e.outputData&&t.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function YT(t,e){T(Vh(t.CHANGABLE_METHODS,t.DOWNSAMPLE_METHODS),function(r){t.wrapMethod(r,be(IN,e))})}function IN(t,e){var r=Hm(t);return r&&r.setOutputEnd((e||this).count()),e}function Hm(t){var e=(t.ecModel||{}).scheduler,r=e&&e.getPipeline(t.uid);if(r){var i=r.currentTask;if(i){var n=i.agentStubMap;n&&(i=n.get(t.uid))}return i}}var Tt=Qc;var Ym=(function(){function t(){this.group=new xe,this.uid=_n("viewComponent")}return t.prototype.init=function(e,r){},t.prototype.render=function(e,r,i,n){},t.prototype.dispose=function(e,r){},t.prototype.updateView=function(e,r,i,n){},t.prototype.updateLayout=function(e,r,i,n){},t.prototype.updateVisual=function(e,r,i,n){},t.prototype.toggleBlurSeries=function(e,r,i){},t.prototype.eachRendered=function(e){var r=this.group;r&&r.traverse(e)},t})();Uo(Ym);ln(Ym);var et=Ym;function Wa(){var t=te();return function(e){var r=t(e),i=e.pipelineContext,n=!!r.large,a=!!r.progressiveRender,o=r.large=!!(i&&i.large),s=r.progressiveRender=!!(i&&i.progressiveRender);return(n!==o||a!==s)&&"reset"}}var ZT=te(),ON=Wa(),Wm=(function(){function t(){this.group=new xe,this.uid=_n("viewChart"),this.renderTask=Tn({plan:LN,reset:PN}),this.renderTask.context={view:this}}return t.prototype.init=function(e,r){},t.prototype.render=function(e,r,i,n){},t.prototype.highlight=function(e,r,i,n){var a=e.getData(n&&n.dataType);a&&XT(a,n,"emphasis")},t.prototype.downplay=function(e,r,i,n){var a=e.getData(n&&n.dataType);a&&XT(a,n,"normal")},t.prototype.remove=function(e,r){this.group.removeAll()},t.prototype.dispose=function(e,r){},t.prototype.updateView=function(e,r,i,n){this.render(e,r,i,n)},t.prototype.updateVisual=function(e,r,i,n){this.render(e,r,i,n)},t.prototype.eachRendered=function(e){Oa(this.group,e)},t.markUpdateMethod=function(e,r){ZT(e).updateMethod=r},t.protoInitialize=(function(){var e=t.prototype;e.type="chart"})(),t})();function WT(t,e,r){t&&El(t)&&(e==="emphasis"?ya:_a)(t,r)}function XT(t,e,r){var i=br(t,e),n=e&&e.highlightKey!=null?kS(e.highlightKey):null;i!=null?T(ke(i),function(a){WT(t.getItemGraphicEl(a),r,n)}):t.eachItemGraphicEl(function(a){WT(a,r,n)})}Uo(Wm,["dispose"]);ln(Wm);function LN(t){return ON(t.model)}function PN(t){var e=t.model,r=t.ecModel,i=t.api,n=t.payload,a=e.pipelineContext.progressiveRender,o=t.view,s=n&&ZT(n).updateMethod,l=a?"incrementalPrepareRender":s&&o[s]?s:"render";return l!=="render"&&o[l](e,r,i,n),NN[l]}var NN={incrementalPrepareRender:{progress:function(t,e){e.view.incrementalRender(t,e.model,e.ecModel,e.api,e.payload)}},render:{forceFirstProgress:!0,progress:function(t,e){e.view.render(e.model,e.ecModel,e.api,e.payload)}}},ft=Wm;var Jc="\0__throttleOriginMethod",qT="\0__throttleRate",KT="\0__throttleType";function Xa(t,e,r){var i,n=0,a=0,o=null,s,l,u,f;e=e||0;function c(){a=new Date().getTime(),o=null,t.apply(l,u||[])}var p=function(){for(var h=[],v=0;v=0?c():o=setTimeout(c,-s),n=i};return p.clear=function(){o&&(clearTimeout(o),o=null)},p.debounceNextCall=function(h){f=h},p}function Cn(t,e,r,i){var n=t[e];if(n){var a=n[Jc]||n,o=n[KT],s=n[qT];if(s!==r||o!==i){if(r==null||!i)return t[e]=a;n=t[e]=Xa(a,r,i==="debounce"),n[Jc]=a,n[KT]=i,n[qT]=r}return n}}function Za(t,e){var r=t[e];r&&r[Jc]&&(r.clear&&r.clear(),t[e]=r[Jc])}var jT=te(),QT={itemStyle:ii(om,!0),lineStyle:ii(am,!0)},RN={lineStyle:"stroke",itemStyle:"fill"};function JT(t,e){var r=t.visualStyleMapper||QT[e];return r||(console.warn("Unknown style type '"+e+"'."),QT.itemStyle)}function $T(t,e){var r=t.visualDrawType||RN[e];return r||(console.warn("Unknown style type '"+e+"'."),"fill")}var e1={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var r=t.getData(),i=t.visualStyleAccessPath||"itemStyle",n=t.getModel(i),a=JT(t,i),o=a(n),s=n.getShallow("decal");s&&(r.setVisual("decal",s),s.dirty=!0);var l=$T(t,i),u=o[l],f=X(u)?u:null,c=o.fill==="auto"||o.stroke==="auto";if(!o[l]||f||c){var p=t.getColorFromPalette(t.name,null,e.getSeriesCount());o[l]||(o[l]=p,r.setVisual("colorFromPalette",!0)),o.fill=o.fill==="auto"||X(o.fill)?p:o.fill,o.stroke=o.stroke==="auto"||X(o.stroke)?p:o.stroke}if(r.setVisual("style",o),r.setVisual("drawType",l),!e.isSeriesFiltered(t)&&f)return r.setVisual("colorFromPalette",!1),{dataEach:function(h,v){var d=t.getDataParams(v),m=P({},o);m[l]=f(d),h.setItemVisual(v,"style",m)}}}},ql=new Ce,t1={createOnAllSeries:!0,reset:function(t,e){if(!t.ignoreStyleOnData){var r=t.getData(),i=t.visualStyleAccessPath||"itemStyle",n=JT(t,i),a=r.getVisual("drawType");return{dataEach:r.hasItemOption?function(o,s){var l=o.getRawDataItem(s);if(l&&l[i]){ql.option=l[i];var u=n(ql),f=o.ensureUniqueItemVisual(s,"style");P(f,u),ql.option.decal&&(o.setItemVisual(s,"decal",ql.option.decal),ql.option.decal.dirty=!0),a in u&&o.setItemVisual(s,"colorFromPalette",!1)}}:null}}}},r1={performRawSeries:!0,overallReset:function(t){var e=G();t.eachSeries(function(r){if(!r.isColorBySeries()){var i=r.type+"-"+r.getColorBy();jT(r).scope=e.get(i)||e.set(i,{})}}),t.eachSeries(function(r){if(!r.isColorBySeries()){var i=r.getRawData(),n={},a=r.getData(),o=jT(r).scope,s=r.visualStyleAccessPath||"itemStyle",l=$T(r,s);a.each(function(u){var f=a.getRawIndex(u);n[f]=u}),i.each(function(u){var f=n[u],c=a.getItemVisual(f,"colorFromPalette");if(c){var p=a.ensureUniqueItemVisual(f,"style"),h=i.getName(u)||u+"",v=i.count();p[l]=r.getColorFromPalette(h,o,v)}})}})}};var $c=Math.PI;function Zm(t,e){e=e||{},re(e,{text:"loading",textColor:K.color.primary,fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255,255,255,0.8)",showSpinner:!0,color:K.color.theme[0],spinnerRadius:10,lineWidth:5,zlevel:0});var r=new xe,i=new ge({style:{fill:e.maskColor},zlevel:e.zlevel,z:1e4});r.add(i);var n=new De({style:{text:e.text,fill:e.textColor,fontSize:e.fontSize,fontWeight:e.fontWeight,fontStyle:e.fontStyle,fontFamily:e.fontFamily},zlevel:e.zlevel,z:10001}),a=new ge({style:{fill:"none"},textContent:n,textConfig:{position:"right",distance:10},zlevel:e.zlevel,z:10001});r.add(a);var o;return e.showSpinner&&(o=new wa({shape:{startAngle:-$c/2,endAngle:-$c/2+.1,r:e.spinnerRadius},style:{stroke:e.color,lineCap:"round",lineWidth:e.lineWidth},zlevel:e.zlevel,z:10001}),o.animateShape(!0).when(1e3,{endAngle:$c*3/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:$c*3/2}).delay(300).start("circularInOut"),r.add(o)),r.resize=function(){var s=n.getBoundingRect().width,l=e.showSpinner?e.spinnerRadius:0,u=(t.getWidth()-l*2-(e.showSpinner&&s?10:0)-s)/2-(e.showSpinner&&s?0:5+s/2)+(e.showSpinner?0:s/2)+(s?0:l),f=t.getHeight()/2;e.showSpinner&&o.setShape({cx:u,cy:f}),a.setShape({x:u-l,y:f-l,width:l*2,height:l*2}),i.setShape({x:0,y:0,width:t.getWidth(),height:t.getHeight()})},r.resize(),r}var kN=(function(){function t(e,r,i,n){this._stageTaskMap=G(),this.ecInstance=e,this.api=r,i=this._dataProcessorHandlers=i.slice(),n=this._visualHandlers=n.slice(),this._allHandlers=i.concat(n)}return t.prototype.restoreData=function(e,r){e.restoreData(r),this._stageTaskMap.each(function(i){var n=i.overallTask;n&&n.dirty()})},t.prototype.getPerformArgs=function(e,r){if(e.__pipeline){var i=this._pipelineMap.get(e.__pipeline.id),n=i.context,a=!r&&i.progressiveEnabled&&(!n||n.progressiveRender)&&e.__idxInPipeline>i.blockIndex,o=a?i.step:null,s=n&&n.modDataCount,l=s!=null?Math.ceil(s/o):null;return{step:o,modBy:l,modDataCount:s}}},t.prototype.getPipeline=function(e){return this._pipelineMap.get(e)},t.prototype.updateStreamModes=function(e,r){var i=this._pipelineMap.get(e.uid),n=e.__preparePipelineContext?e.__preparePipelineContext(r,i):Pf(e,r,i);e.pipelineContext=i.context=n},t.prototype.restorePipelines=function(e,r){var i=this,n=i._pipelineMap=G();r.eachSeries(function(a){var o=e.painter.type==="canvas"&&a.getProgressive(),s=a.uid;n.set(s,{id:s,head:null,tail:null,threshold:a.getProgressiveThreshold(),progressiveEnabled:o&&!(a.preventIncremental&&a.preventIncremental()),blockIndex:-1,step:Math.round(o||700),count:0}),i._pipe(a,a.dataTask)})},t.prototype.prepareStageTasks=function(){var e=this._stageTaskMap,r=this.api.getModel(),i=this.api;T(this._allHandlers,function(n){var a=e.get(n.uid)||e.set(n.uid,{}),o="";ze(!(n.reset&&n.overallReset),o),n.reset&&this._createSeriesStageTask(n,a,r,i),n.overallReset&&this._createOverallStageTask(n,a,r,i)},this)},t.prototype.prepareView=function(e,r,i,n){var a=e.renderTask,o=a.context;o.model=r,o.ecModel=i,o.api=n,a.__block=!e.incrementalPrepareRender,this._pipe(r,a)},t.prototype.performDataProcessorTasks=function(e,r){this._performStageTasks(this._dataProcessorHandlers,e,r,{block:!0})},t.prototype.performVisualTasks=function(e,r,i){this._performStageTasks(this._visualHandlers,e,r,i)},t.prototype._performStageTasks=function(e,r,i,n){n=n||{};var a=!1,o=this;T(e,function(l,u){if(!(n.visualType&&n.visualType!==l.visualType)){var f=o._stageTaskMap.get(l.uid),c=f.seriesTaskMap,p=f.overallTask;if(p){var h,v=p.agentStubMap;v.each(function(m){s(n,m)&&(m.dirty(),h=!0)}),h&&p.dirty(),o.updatePayload(p,i);var d=o.getPerformArgs(p,n.block);v.each(function(m){m.perform(d)}),p.perform(d)&&(a=!0)}else c&&c.each(function(m,g){s(n,m)&&m.dirty();var y=o.getPerformArgs(m,n.block);y.skip=!l.performRawSeries&&r.isSeriesFiltered(m.context.model),o.updatePayload(m,i),m.perform(y)&&(a=!0)})}});function s(l,u){return l.setDirty&&(!l.dirtyMap||l.dirtyMap.get(u.__pipeline.id))}this.unfinished=a||this.unfinished},t.prototype.performSeriesTasks=function(e){var r;e.eachSeries(function(i){r=i.dataTask.perform()||r}),this.unfinished=r||this.unfinished},t.prototype.plan=function(){this._pipelineMap.each(function(e){var r=e.tail;do{if(r.__block){e.blockIndex=r.__idxInPipeline;break}r=r.getUpstream()}while(r)})},t.prototype.updatePayload=function(e,r){r!=="remain"&&(e.context.payload=r)},t.prototype._createSeriesStageTask=function(e,r,i,n){var a=this,o=r.seriesTaskMap,s=r.seriesTaskMap=G(),l=e.seriesType,u=e.getTargetSeries;e.createOnAllSeries?i.eachRawSeries(f):l?i.eachRawSeriesByType(l,f):u&&u(i,n).each(f);function f(c){var p=c.uid,h=s.set(p,o&&o.get(p)||Tn({plan:VN,reset:GN,count:YN}));h.context={model:c,ecModel:i,api:n,useClearVisual:e.isVisual&&!e.isLayout,plan:e.plan,reset:e.reset,scheduler:a},a._pipe(c,h)}},t.prototype._createOverallStageTask=function(e,r,i,n){var a=this,o=r.overallTask=r.overallTask||Tn({reset:BN});o.context={ecModel:i,api:n,overallReset:e.overallReset,scheduler:a};var s=o.agentStubMap,l=o.agentStubMap=G(),u=e.seriesType,f=e.getTargetSeries,c=e.dirtyOnOverallProgress,p=!1,h="";ze(!e.createOnAllSeries,h),u?i.eachRawSeriesByType(u,v):f?f(i,n).each(v):T(i.getSeries(),v);function v(d){var m=d.uid,g=l.set(m,s&&s.get(m)||(p=!0,Tn({reset:zN,onDirty:FN})));g.context={model:d,dirtyOnOverallProgress:c},g.agent=o,g.__block=c,a._pipe(d,g)}p&&o.dirty()},t.prototype._pipe=function(e,r){var i=e.uid,n=this._pipelineMap.get(i);!n.head&&(n.head=r),n.tail&&n.tail.pipe(r),n.tail=r,r.__idxInPipeline=n.count++,r.__pipeline=n},t.wrapStageHandler=function(e,r){return X(e)&&(e={overallReset:e,seriesType:WN(e)}),e.uid=_n("stageHandler"),r&&(e.visualType=r),e},t})();function BN(t){t.overallReset(t.ecModel,t.api,t.payload)}function zN(t){return t.dirtyOnOverallProgress&&UN}function UN(){this.agent.dirty(),this.getDownstream().dirty()}function FN(){this.agent&&this.agent.dirty()}function VN(t){return t.plan?t.plan(t.model,t.ecModel,t.api,t.payload):null}function GN(t){t.useClearVisual&&t.data.clearAllVisual();var e=t.resetDefines=ke(t.reset(t.model,t.ecModel,t.api,t.payload));return e.length>1?z(e,function(r,i){return i1(i)}):HN}var HN=i1(0);function i1(t){return function(e,r){var i=r.data,n=r.resetDefines[t];if(n&&n.dataEach)for(var a=e.start;a0&&h===u.length-p.length){var v=u.slice(0,h);v!=="data"&&(r.mainType=v,r[p.toLowerCase()]=l,f=!0)}}s.hasOwnProperty(u)&&(i[u]=l,f=!0),f||(n[u]=l)})}return{cptQuery:r,dataQuery:i,otherQuery:n}},t.prototype.filter=function(e,r){var i=this.eventInfo;if(!i)return!0;var n=i.targetEl,a=i.packedEvent,o=i.model,s=i.view;if(!o||!s)return!0;var l=r.cptQuery,u=r.dataQuery;return f(l,o,"mainType")&&f(l,o,"subType")&&f(l,o,"index","componentIndex")&&f(l,o,"name")&&f(l,o,"id")&&f(u,a,"name")&&f(u,a,"dataIndex")&&f(u,a,"dataType")&&(!s.filterForExposedEvent||s.filterForExposedEvent(e,r.otherQuery,n,a));function f(c,p,h,v){return c[h]==null||p[v||h]===c[h]}},t.prototype.afterTrigger=function(){this.eventInfo=null},t})();var Km=["symbol","symbolSize","symbolRotate","symbolOffset"],c1=Km.concat(["symbolKeepAspect"]),p1={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var r=t.getData();if(t.legendIcon&&r.setVisual("legendIcon",t.legendIcon),!t.hasSymbolVisual)return;for(var i={},n={},a=!1,o=0;o=0&&ja(l)?l:.5;var u=t.createRadialGradient(o,s,0,o,s,l);return u}function Qm(t,e,r){for(var i=e.type==="radial"?oR(t,e,r):aR(t,e,r),n=e.colorStops,a=0;a0)?null:t==="dashed"?[4*e,2*e]:t==="dotted"?[e]:se(t)?[t]:k(t)?t:null}function Jl(t){var e=t.style,r=e.lineDash&&e.lineWidth>0&&sR(e.lineDash,e.lineWidth),i=e.lineDashOffset;if(r){var n=e.strokeNoScale&&t.getLineScale?t.getLineScale():1;n&&n!==1&&(r=z(r,function(a){return a/n}),i/=n)}return[r,i]}var lR=new bt(!0);function op(t){var e=t.stroke;return!(e==null||e==="none"||!(t.lineWidth>0))}function C1(t){return typeof t=="string"&&t!=="none"}function sp(t){var e=t.fill;return e!=null&&e!=="none"}function A1(t,e){if(e.fillOpacity!=null&&e.fillOpacity!==1){var r=t.globalAlpha;t.globalAlpha=e.fillOpacity*e.opacity,t.fill(),t.globalAlpha=r}else t.fill()}function D1(t,e){if(e.strokeOpacity!=null&&e.strokeOpacity!==1){var r=t.globalAlpha;t.globalAlpha=e.strokeOpacity*e.opacity,t.stroke(),t.globalAlpha=r}else t.stroke()}function E1(t,e,r){var i=_l(e.image,e.__image,r);if(Fo(i)){var n=t.createPattern(i,e.repeat||"repeat");if(typeof DOMMatrix=="function"&&n&&n.setTransform){var a=new DOMMatrix;a.translateSelf(e.x||0,e.y||0),a.rotateSelf(0,0,(e.rotation||0)*Hn),a.scaleSelf(e.scaleX||1,e.scaleY||1),n.setTransform(a)}return n}}function uR(t,e,r,i,n){var a,o=op(r),s=sp(r),l=r.strokePercent,u=l<1,f=!e.path;(!e.silent||u)&&f&&e.createPathProxy();var c=e.path||lR,p=e.__dirty;if(!i){var h=r.fill,v=r.stroke,d=s&&!!h.colorStops,m=o&&!!v.colorStops,g=s&&!!h.image,y=o&&!!v.image,_=void 0,x=void 0,S=void 0,b=void 0,w=void 0;(d||m)&&(w=e.getBoundingRect()),d&&(_=p?Qm(t,h,w):e.__canvasFillGradient,e.__canvasFillGradient=_),m&&(x=p?Qm(t,v,w):e.__canvasStrokeGradient,e.__canvasStrokeGradient=x),g&&(S=p||!e.__canvasFillPattern?E1(t,h,e):e.__canvasFillPattern,e.__canvasFillPattern=S),y&&(b=p||!e.__canvasStrokePattern?E1(t,v,e):e.__canvasStrokePattern,e.__canvasStrokePattern=b),d?t.fillStyle=_:g&&(S?t.fillStyle=S:s=!1),m?t.strokeStyle=x:y&&(b?t.strokeStyle=b:o=!1)}var A=e.getGlobalScale();c.setScale(A[0],A[1],e.segmentIgnoreThreshold);var C,D;t.setLineDash&&r.lineDash&&(a=Jl(e),C=a[0],D=a[1]);var E=!0;(f||p&qi)&&(c.setDPR(t.dpr),u?c.setContext(null):(c.setContext(t),E=!1),c.reset(),e.buildPath(c,e.shape,i),c.toStatic(),e.pathUpdated()),E&&c.rebuildPath(t,u?l:1),C&&(t.setLineDash(C),t.lineDashOffset=D),i?(n.batchFill=s,n.batchStroke=o):r.strokeFirst?(o&&D1(t,r),s&&A1(t,r)):(s&&A1(t,r),o&&D1(t,r)),C&&t.setLineDash([])}function fR(t,e,r){var i=e.__image=_l(r.image,e.__image,e,e.onload);if(!(!i||!Fo(i))){var n=r.x||0,a=r.y||0,o=e.getWidth(),s=e.getHeight(),l=i.width/i.height;if(o==null&&s!=null?o=s*l:s==null&&o!=null?s=o/l:o==null&&s==null&&(o=i.width,s=i.height),r.sWidth&&r.sHeight){var u=r.sx||0,f=r.sy||0;t.drawImage(i,u,f,r.sWidth,r.sHeight,n,a,o,s)}else if(r.sx&&r.sy){var u=r.sx,f=r.sy,c=o-u,p=s-f;t.drawImage(i,u,f,c,p,n,a,o,s)}else t.drawImage(i,n,a,o,s)}}function cR(t,e,r){var i,n=r.text;if(n!=null&&(n+=""),n){t.font=r.font||Vt,t.textAlign=r.textAlign,t.textBaseline=r.textBaseline;var a=void 0,o=void 0;t.setLineDash&&r.lineDash&&(i=Jl(e),a=i[0],o=i[1]),a&&(t.setLineDash(a),t.lineDashOffset=o),r.strokeFirst?(op(r)&&t.strokeText(n,r.x,r.y),sp(r)&&t.fillText(n,r.x,r.y)):(sp(r)&&t.fillText(n,r.x,r.y),op(r)&&t.strokeText(n,r.x,r.y)),a&&t.setLineDash([])}}var M1=["shadowBlur","shadowOffsetX","shadowOffsetY"],I1=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function k1(t,e,r,i,n){var a=!1;if(!i&&(r=r||{},e===r))return!1;if(i||e.opacity!==r.opacity){kt(t,n),a=!0;var o=Math.max(Math.min(e.opacity,1),0);t.globalAlpha=isNaN(o)?ni.opacity:o}(i||e.blend!==r.blend)&&(a||(kt(t,n),a=!0),t.globalCompositeOperation=e.blend||ni.blend);for(var s=0;s0&&r.unfinished);r.unfinished||this._zr.flush()}}},e.prototype.getDom=function(){return this._dom},e.prototype.getId=function(){return this.id},e.prototype.getZr=function(){return this._zr},e.prototype.isSSR=function(){return this._ssr},e.prototype.setOption=function(r,i,n){if(!this[nt]){if(this._disposed){this.id;return}var a,o,s;if(Y(i)&&(n=i.lazyUpdate,a=i.silent,o=i.replaceMerge,s=i.transition,i=i.notMerge),this[nt]=!0,_s(this),!this._model||i){var l=new fT(this._api),u=this._theme,f=this._model=new Uc;f.scheduler=this._scheduler,f.ssr=this._ssr,f.init(null,null,null,u,this._locale,l)}this._model.setOption(r,{replaceMerge:o},cg);var c={seriesTransition:s,optionChanged:!0};if(n)this[gt]={silent:a,updateParams:c},this[nt]=!1,this.getZr().wakeUp();else{try{Qa(this),zi.update.call(this,null,c)}catch(p){throw this[gt]=null,this[nt]=!1,p}this._ssr||this._zr.flush(),this[gt]=null,this[nt]=!1,gs.call(this,a),ys.call(this,a)}}},e.prototype.setTheme=function(r,i){if(!this[nt]){if(this._disposed){this.id;return}var n=this._model;if(n){var a=i&&i.silent,o=null;this[gt]&&(a==null&&(a=this[gt].silent),o=this[gt].updateParams,this[gt]=null),this[nt]=!0,_s(this);try{this._updateTheme(r),n.setTheme(this._theme),Qa(this),zi.update.call(this,{type:"setTheme"},o)}catch(s){throw this[nt]=!1,s}this[nt]=!1,gs.call(this,a),ys.call(this,a)}}},e.prototype._updateTheme=function(r){U(r)&&(r=lw[r]),r&&(r=$(r),r&&Fc(r,!0),this._theme=r)},e.prototype.getModel=function(){return this._model},e.prototype.getOption=function(){return this._model&&this._model.getOption()},e.prototype.getWidth=function(){return this._zr.getWidth()},e.prototype.getHeight=function(){return this._zr.getHeight()},e.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||oe.hasGlobalWindow&&window.devicePixelRatio||1},e.prototype.getRenderedCanvas=function(r){return this.renderToCanvas(r)},e.prototype.renderToCanvas=function(r){r=r||{};var i=this._zr.painter;return i.getRenderedCanvas({backgroundColor:r.backgroundColor||this._model.get("backgroundColor"),pixelRatio:r.pixelRatio||this.getDevicePixelRatio()})},e.prototype.renderToSVGString=function(r){r=r||{};var i=this._zr.painter;return i.renderToString({useViewBox:r.useViewBox})},e.prototype.getSvgDataURL=function(){var r=this._zr,i=r.storage.getDisplayList();return T(i,function(n){n.stopAnimation(null,!0)}),r.painter.toDataURL()},e.prototype.getDataURL=function(r){if(this._disposed){this.id;return}r=r||{};var i=r.excludeComponents,n=this._model,a=[],o=this;T(i,function(l){n.eachComponent({mainType:l},function(u){var f=o._componentsMap[u.__viewId];f.group.ignore||(a.push(f),f.group.ignore=!0)})});var s=this._zr.painter.getType()==="svg"?this.getSvgDataURL():this.renderToCanvas(r).toDataURL("image/"+(r&&r.type||"png"));return T(a,function(l){l.group.ignore=!1}),s},e.prototype.getConnectedDataURL=function(r){if(this._disposed){this.id;return}var i=r.type==="svg",n=this.group,a=Math.min,o=Math.max,s=1/0;if(mp[n]){var l=s,u=s,f=-s,c=-s,p=[],h=r&&r.pixelRatio||this.getDevicePixelRatio();T(Ja,function(_,x){if(_.group===n){var S=i?_.getZr().painter.getSvgDom().innerHTML:_.renderToCanvas($(r)),b=_.getDom().getBoundingClientRect();l=a(b.left,l),u=a(b.top,u),f=o(b.right,f),c=o(b.bottom,c),p.push({dom:S,left:b.left,top:b.top})}}),l*=h,u*=h,f*=h,c*=h;var v=f-l,d=c-u,m=at.createCanvas(),g=Df(m,{renderer:i?"svg":"canvas"});if(g.resize({width:v,height:d}),i){var y="";return T(p,function(_){var x=_.left-l,S=_.top-u;y+=''+_.dom+""}),g.painter.getSvgRoot().innerHTML=y,r.connectedBackgroundColor&&g.painter.setBackgroundColor(r.connectedBackgroundColor),g.refreshImmediately(),g.painter.toDataURL()}else return r.connectedBackgroundColor&&g.add(new ge({shape:{x:0,y:0,width:v,height:d},style:{fill:r.connectedBackgroundColor}})),T(p,function(_){var x=new dt({style:{x:_.left*h-l,y:_.top*h-u,image:_.dom}});g.add(x)}),g.refreshImmediately(),m.toDataURL("image/"+(r&&r.type||"png"))}else return this.getDataURL(r)},e.prototype.convertToPixel=function(r,i,n){return cp(this,"convertToPixel",r,i,n)},e.prototype.convertToLayout=function(r,i,n){return cp(this,"convertToLayout",r,i,n)},e.prototype.convertFromPixel=function(r,i,n){return cp(this,"convertFromPixel",r,i,n)},e.prototype.containPixel=function(r,i){if(this._disposed){this.id;return}var n=this._model,a,o=Lf(n,r);return T(o,function(s,l){l.indexOf("Models")>=0&&T(s,function(u){var f=u.coordinateSystem;if(f&&f.containPoint)a=a||!!f.containPoint(i);else if(l==="seriesModels"){var c=this._chartsMap[u.__viewId];c&&c.containPoint&&(a=a||c.containPoint(i,u))}},this)},this),!!a},e.prototype.getVisual=function(r,i){var n=this._model,a=Lf(n,r,{defaultMainType:"series"}),o=a.seriesModel,s=o.getData(),l=a.hasOwnProperty("dataIndexInside")?a.dataIndexInside:a.hasOwnProperty("dataIndex")?s.indexOfRawIndex(a.dataIndex):null;return l!=null?v1(s,l,i):d1(s,i)},e.prototype.getViewOfComponentModel=function(r){return this._componentsMap[r.__viewId]},e.prototype.getViewOfSeriesModel=function(r){return this._chartsMap[r.__viewId]},e.prototype._initEvents=function(){var r=this;T(RR,function(n){var a=function(o){var s=r.getModel(),l=o.target,u,f=n==="globalout";if(f?u={}:l&&qa(l,function(d){var m=me(d);if(m&&m.dataIndex!=null){var g=m.dataModel||s.getSeriesByIndex(m.seriesIndex);return u=g&&g.getDataParams(m.dataIndex,m.dataType,l)||{},!0}else if(m.eventData)return u=P({},m.eventData),!0},!0),u){var c=u.componentType,p=u.componentIndex;(c==="markLine"||c==="markPoint"||c==="markArea")&&(c="series",p=u.seriesIndex);var h=c&&p!=null&&s.getComponent(c,p),v=h&&r[h.mainType==="series"?"_chartsMap":"_componentsMap"][h.__viewId];u.event=o,u.type=n,r._$eventProcessor.eventInfo={targetEl:l,packedEvent:u,model:h,view:v},r.trigger(n,u)}};a.zrEventfulCallAtLast=!0,r._zr.on(n,a,r)});var i=this._messageCenter;T(ug,function(n,a){i.on(a,function(o){r.trigger(a,o)})}),g1(i,this,this._api)},e.prototype.isDisposed=function(){return this._disposed},e.prototype.clear=function(){if(this._disposed){this.id;return}this.setOption({series:[]},!0)},e.prototype.dispose=function(){if(this._disposed){this.id;return}this._disposed=!0;var r=this.getDom();r&&Kv(this.getDom(),mg,"");var i=this,n=i._api,a=i._model;T(i._componentsViews,function(o){o.dispose(a,n)}),T(i._chartsViews,function(o){o.dispose(a,n)}),i._zr.dispose(),i._dom=i._model=i._chartsMap=i._componentsMap=i._chartsViews=i._componentsViews=i._scheduler=i._api=i._zr=i._throttledZrFlush=i._theme=i._coordSysMgr=i._messageCenter=null,delete Ja[i.id]},e.prototype.resize=function(r){if(!this[nt]){if(this._disposed){this.id;return}this._zr.resize(r);var i=this._model;if(this._loadingFX&&this._loadingFX.resize(),!!i){var n=i.resetOption("media"),a=r&&r.silent;this[gt]&&(a==null&&(a=this[gt].silent),n=!0,this[gt]=null),this[nt]=!0,_s(this);try{n&&Qa(this),zi.update.call(this,{type:"resize",animation:P({duration:0},r&&r.animation)})}catch(o){throw this[nt]=!1,o}this[nt]=!1,gs.call(this,a),ys.call(this,a)}}},e.prototype.showLoading=function(r,i){if(this._disposed){this.id;return}if(Y(r)&&(i=r,r=""),r=r||"default",this.hideLoading(),!!pg[r]){var n=pg[r](this._api,i),a=this._zr;this._loadingFX=n,a.add(n)}},e.prototype.hideLoading=function(){if(this._disposed){this.id;return}this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null},e.prototype.makeActionFromEvent=function(r){var i=P({},r);return i.type=lg[r.type],i},e.prototype.dispatchAction=function(r,i){if(this._disposed){this.id;return}if(Y(i)||(i={silent:!!i}),!!vp[r.type]&&this._model){if(this[nt]){this._pendingActions.push(r);return}var n=i.silent;og.call(this,r,n);var a=i.flush;a?this._zr.flush():a!==!1&&oe.browser.weChat&&this._throttledZrFlush(),gs.call(this,n),ys.call(this,n)}},e.prototype.updateLabelLayout=function(){hr.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},e.prototype.appendData=function(r){if(this._disposed){this.id;return}var i=r.seriesIndex,n=this.getModel(),a=n.getSeriesByIndex(i);a.appendData(r),this._scheduler.unfinished=!0,this.getZr().wakeUp()},e.internalField=(function(){Qa=function(c){x1(c._model);var p=c._scheduler;p.restorePipelines(c._zr,c._model),p.prepareStageTasks(),ng(c,!0),ng(c,!1),p.plan()},ng=function(c,p){for(var h=c._model,v=c._scheduler,d=p?c._componentsViews:c._chartsViews,m=p?c._componentsMap:c._chartsMap,g=c._zr,y=c._api,_=0;_W(p.get("hoverLayerThreshold"),Rc.hoverLayerThreshold)&&!oe.node&&!oe.worker;(c._usingTHL||m)&&(p.eachSeries(function(g){if(!g.preventUsingHoverLayer){var y=c._chartsMap[g.__viewId];y.__alive&&y.eachRendered(function(_){var x=_.states.emphasis;x&&x.hoverLayer!==kl&&(x.hoverLayer=m?Zd:Xd)})}}),c._usingTHL=m)}}function s(c,p){var h=c.get("blendMode")||null;p.eachRendered(function(v){v.isGroup||(v.style.blend=h)})}function l(c,p){if(!c.preventAutoZ){var h=yn(c);p.eachRendered(function(v){return rm(v,h.z,h.zlevel),!0})}}function u(c,p){p.eachRendered(function(h){if(!Da(h)){var v=h.getTextContent(),d=h.getTextGuideLine();h.stateTransition&&(h.stateTransition=null),v&&v.stateTransition&&(v.stateTransition=null),d&&d.stateTransition&&(d.stateTransition=null),h.hasState()?(h.prevStates=h.currentStates,h.clearStates()):h.prevStates&&(h.prevStates=null)}})}function f(c,p){var h=c.getModel("stateAnimation"),v=c.isAnimationEnabled(),d=h.get("duration"),m=d>0?{duration:d,delay:h.get("delay"),easing:h.get("easing")}:null;p.eachRendered(function(g){if(g.states&&g.states.emphasis){if(Da(g))return;if(g instanceof ue&&BS(g),g.__dirty){var y=g.prevStates;y&&g.useStates(y)}if(v){g.stateTransition=m;var _=g.getTextContent(),x=g.getTextGuideLine();_&&(_.stateTransition=m),x&&(x.stateTransition=m)}g.__dirty&&a(g)}})}j1=function(c){return new((function(p){L(h,p);function h(){return p!==null&&p.apply(this,arguments)||this}return h.prototype.getCoordinateSystems=function(){return c._coordSysMgr.getCoordinateSystems()},h.prototype.getComponentByElement=function(v){for(;v;){var d=v.__ecComponentInfo;if(d!=null)return c._model.getComponent(d.mainType,d.index);v=v.parent}},h.prototype.enterEmphasis=function(v,d){ya(v,d),Mr(c)},h.prototype.leaveEmphasis=function(v,d){_a(v,d),Mr(c)},h.prototype.enterBlur=function(v){ES(v),Mr(c)},h.prototype.leaveBlur=function(v){Id(v),Mr(c)},h.prototype.enterSelect=function(v){Od(v),Mr(c)},h.prototype.leaveSelect=function(v){Ld(v),Mr(c)},h.prototype.getModel=function(){return c.getModel()},h.prototype.getViewOfComponentModel=function(v){return c.getViewOfComponentModel(v)},h.prototype.getViewOfSeriesModel=function(v){return c.getViewOfSeriesModel(v)},h.prototype.getECUpdateCycleVersion=function(){return c[up]},h.prototype.usingTHL=function(){return c._usingTHL},h})(Hf))(c)},sw=function(c){function p(h,v){for(var d=0;d=0)){J1.push(r);var o=qm.wrapStageHandler(r,n);o.__prio=e,o.__raw=r,t.push(o)}}function xp(t,e){pg[t]=e}function WR(t){Vu({createCanvas:t})}function wg(t,e,r){var i=jm("registerMap");i&&i(t,e,r)}function XR(t){var e=jm("getMap");return e&&e(t)}var Cg=MT;Ui(hg,e1);Ui(gp,t1);Ui(gp,r1);Ui(hg,p1);Ui(gp,h1);Ui(tw,H1);yp(Fc);_p(wR,gT);xp("default",Zm);mi({type:vn,event:vn,update:vn},Me);mi({type:Cl,event:Cl,update:Cl},Me);mi({type:Al,event:Xf,update:Al,action:Me,refineEvent:Ag,publishNonRefinedEvent:!0});mi({type:Wf,event:Xf,update:Wf,action:Me,refineEvent:Ag,publishNonRefinedEvent:!0});mi({type:Dl,event:Xf,update:Dl,action:Me,refineEvent:Ag,publishNonRefinedEvent:!0});function Ag(t,e,r,i){return{eventContent:{selected:NS(r),isFromClick:e.isFromClick||!1}}}yg("default",{});yg("dark",u1);var ZR={};function tu(t){return t==null?0:t.length||1}function fw(t){return t}var KR=(function(){function t(e,r,i,n,a,o){this._old=e,this._new=r,this._oldKeyGetter=i||fw,this._newKeyGetter=n||fw,this.context=a,this._diffModeMultiple=o==="multiple"}return t.prototype.add=function(e){return this._add=e,this},t.prototype.update=function(e){return this._update=e,this},t.prototype.updateManyToOne=function(e){return this._updateManyToOne=e,this},t.prototype.updateOneToMany=function(e){return this._updateOneToMany=e,this},t.prototype.updateManyToMany=function(e){return this._updateManyToMany=e,this},t.prototype.remove=function(e){return this._remove=e,this},t.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},t.prototype._executeOneToOne=function(){var e=this._old,r=this._new,i={},n=new Array(e.length),a=new Array(r.length);this._initIndexMap(e,null,n,"_oldKeyGetter"),this._initIndexMap(r,i,a,"_newKeyGetter");for(var o=0;o1){var f=l.shift();l.length===1&&(i[s]=l[0]),this._update&&this._update(f,o)}else u===1?(i[s]=null,this._update&&this._update(l,o)):this._remove&&this._remove(o)}this._performRestAdd(a,i)},t.prototype._executeMultiple=function(){var e=this._old,r=this._new,i={},n={},a=[],o=[];this._initIndexMap(e,i,a,"_oldKeyGetter"),this._initIndexMap(r,n,o,"_newKeyGetter");for(var s=0;s1&&p===1)this._updateManyToOne&&this._updateManyToOne(f,u),n[l]=null;else if(c===1&&p>1)this._updateOneToMany&&this._updateOneToMany(f,u),n[l]=null;else if(c===1&&p===1)this._update&&this._update(f,u),n[l]=null;else if(c>1&&p>1)this._updateManyToMany&&this._updateManyToMany(f,u),n[l]=null;else if(c>1)for(var h=0;h1)for(var s=0;s30}var iu=Y,An=z,t2=typeof Int32Array=="undefined"?Array:Int32Array,r2="e\0\0",vw=-1,i2=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],n2=["_approximateExtent"],dw,bp,nu,au,Og,ou,Lg,a2=(function(){function t(e,r){this.type="list",this._dimOmitted=!1,this._nameList=[],this._idList=[],this._visual={},this._layout={},this._itemVisuals=[],this._itemLayouts=[],this._graphicEls=[],this._approximateExtent={},this._calculationInfo={},this.hasItemOption=!1,this.TRANSFERABLE_METHODS=["cloneShallow","downSample","minmaxDownSample","lttbDownSample","map"],this.CHANGABLE_METHODS=["filterSelf","selectRange"],this.DOWNSAMPLE_METHODS=["downSample","minmaxDownSample","lttbDownSample"];var i,n=!1;Sp(e)?(i=e.dimensions,this._dimOmitted=e.isDimensionOmitted(),this._schema=e):(n=!0,i=e),i=i||["x","y"];for(var a={},o=[],s={},l=!1,u={},f=0;f=r)){var i=this._store,n=i.getProvider();this._updateOrdinalMeta();var a=this._nameList,o=this._idList,s=n.getSource().sourceFormat,l=s===st;if(l&&!n.pure)for(var u=[],f=e;f0},t.prototype.ensureUniqueItemVisual=function(e,r){var i=this._itemVisuals,n=i[e];n||(n=i[e]={});var a=n[r];return a==null&&(a=this.getVisual(r),k(a)?a=a.slice():iu(a)&&(a=P({},a)),n[r]=a),a},t.prototype.setItemVisual=function(e,r,i){var n=this._itemVisuals[e]||{};this._itemVisuals[e]=n,iu(r)?P(n,r):n[r]=i},t.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},t.prototype.setLayout=function(e,r){iu(e)?P(this._layout,e):this._layout[e]=r},t.prototype.getLayout=function(e){return this._layout[e]},t.prototype.getItemLayout=function(e){return this._itemLayouts[e]},t.prototype.setItemLayout=function(e,r,i){this._itemLayouts[e]=i?P(this._itemLayouts[e]||{},r):r},t.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},t.prototype.setItemGraphicEl=function(e,r){var i=this.hostModel&&this.hostModel.seriesIndex;mS(i,this.dataType,e,r),this._graphicEls[e]=r},t.prototype.getItemGraphicEl=function(e){return this._graphicEls[e]},t.prototype.eachItemGraphicEl=function(e,r){T(this._graphicEls,function(i,n){i&&e&&e.call(r,i,n)})},t.prototype.cloneShallow=function(e){return e||(e=new t(this._schema?this._schema:An(this.dimensions,this._getDimInfo,this),this.hostModel)),Og(e,this),e._store=this._store,e},t.prototype.wrapMethod=function(e,r){var i=this[e];X(i)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(e),this[e]=function(){var n=i.apply(this,arguments);return r.apply(this,[n].concat(Ys(arguments)))})},t.internalField=(function(){dw=function(e){var r=e._invertedIndicesMap;T(r,function(i,n){var a=e._dimInfos[n],o=a.ordinalMeta,s=e._store;if(o){i=r[n]=new t2(o.categories.length);for(var l=0;l1&&(l+="__ec__"+f),n[r]=l}}})(),t})(),Ss=a2;var Hg={};er(Hg,{createDimensions:()=>mw,createList:()=>Z2,createScale:()=>K2,createSymbol:()=>Lt,createTextStyle:()=>Q2,dataStack:()=>q2,enableHoverEmphasis:()=>dn,getECData:()=>me,getLayoutRect:()=>jt,mixinAxisModelCommonMethods:()=>j2});function mw(t,e){return bs(t,e).dimensions}function bs(t,e){ps(t)||(t=hs(t)),e=e||{};var r=e.coordDimensions||[],i=e.dimensionsDefine||t.dimensionsDefine||[],n=G(),a=[],o=o2(t,r,i,e.dimensionsCount),s=e.canOmitUnusedDimensions&&Ig(o),l=i===t.dimensionsDefine,u=l?Mg(t):ru(i),f=e.encodeDefine;!f&&e.encodeDefaulter&&(f=e.encodeDefaulter(t,o));for(var c=G(f),p=new Um(o),h=0;h0&&(C.name=C.name+(D-1))}),new Eg({source:t,dimensions:a,fullDimensionCount:o,dimensionOmitted:s})}function o2(t,e,r,i){var n=Math.max(t.dimensionsDetectedCount||1,e.length,r.length,i||0);return T(e,function(a){var o;Y(a)&&(o=a.dimsDef)&&(n=Math.max(n,o.length))}),n}function s2(t,e,r){if(r||e.hasKey(t)){for(var i=0;e.hasKey(t+i);)i++;t+=i}return e.set(t,!0),t}var l2=(function(){function t(e){this.coordSysDims=[],this.axisMap=G(),this.categoryAxisMap=G(),this.coordSysName=e}return t})();function gw(t){var e=t.get("coordinateSystem"),r=new l2(e),i=u2[e];if(i)return i(t,r,r.axisMap,r.categoryAxisMap),r}var u2={cartesian2d:function(t,e,r,i){var n=t.getReferringComponents("xAxis",We).models[0],a=t.getReferringComponents("yAxis",We).models[0];e.coordSysDims=["x","y"],r.set("x",n),r.set("y",a),Ts(n)&&(i.set("x",n),e.firstCategoryDimIndex=0),Ts(a)&&(i.set("y",a),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=1))},singleAxis:function(t,e,r,i){var n=t.getReferringComponents("singleAxis",We).models[0];e.coordSysDims=["single"],r.set("single",n),Ts(n)&&(i.set("single",n),e.firstCategoryDimIndex=0)},polar:function(t,e,r,i){var n=t.getReferringComponents("polar",We).models[0],a=n.findAxisModel("radiusAxis"),o=n.findAxisModel("angleAxis");e.coordSysDims=["radius","angle"],r.set("radius",a),r.set("angle",o),Ts(a)&&(i.set("radius",a),e.firstCategoryDimIndex=0),Ts(o)&&(i.set("angle",o),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=1))},geo:function(t,e,r,i){e.coordSysDims=["lng","lat"]},parallel:function(t,e,r,i){var n=t.ecModel,a=n.getComponent("parallel",t.get("parallelIndex")),o=e.coordSysDims=a.dimensions.slice();T(a.parallelAxisIndex,function(s,l){var u=n.getComponent("parallelAxis",s),f=o[l];r.set(f,u),Ts(u)&&(i.set(f,u),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=l))})},matrix:function(t,e,r,i){var n=t.getReferringComponents("matrix",We).models[0];e.coordSysDims=["x","y"];var a=n.getDimensionModel("x"),o=n.getDimensionModel("y");r.set("x",a),r.set("y",o),i.set("x",a),i.set("y",o)}};function Ts(t){return t.get("type")==="category"}function Tp(t,e,r){r=r||{};var i=r.byIndex,n=r.stackedCoordDimension,a,o,s;f2(e)?a=e:(o=e.schema,a=o.dimensions,s=e.store);var l=!!(t&&t.get("stack")),u,f,c,p,h=!0;function v(x){return x.type!=="ordinal"&&x.type!=="time"}if(T(a,function(x,S){U(x)&&(a[S]=x={name:x}),v(x)||(h=!1)}),T(a,function(x,S){l&&!x.isExtraCoord&&(!i&&!u&&x.ordinalMeta&&(u=x),!f&&v(x)&&(!h||x.coordDim!=="x"&&x.coordDim!=="angle")&&(!n||n===x.coordDim)&&(f=x))}),f&&!i&&!u&&(i=!0),f){c="__\0ecstackresult_"+t.id,p="__\0ecstackedover_"+t.id,u&&(u.createInvertedIndices=!0);var d=f.coordDim,m=f.type,g=0;T(a,function(x){x.coordDim===d&&g++});var y={name:c,coordDim:d,coordDimIndex:g,type:m,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length},_={name:p,coordDim:p,coordDimIndex:g+1,type:m,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length+1};o?(s&&(y.storeDimIndex=s.ensureCalculationDimension(p,m),_.storeDimIndex=s.ensureCalculationDimension(c,m)),o.appendCalculationDimension(y),o.appendCalculationDimension(_)):(a.push(y),a.push(_))}return{stackedDimension:f&&f.name,stackedByDimension:u&&u.name,isStackedByIndex:i,stackedOverDimension:p,stackResultDimension:c}}function f2(t){return!Sp(t.schema)}function Xr(t,e){return!!e&&e===t.getCalculationInfo("stackedDimension")}function wp(t,e){return Xr(t,e)?t.getCalculationInfo("stackResultDimension"):e}function c2(t,e){var r=t.get("coordinateSystem"),i=us.get(r),n;return e&&e.coordSysDims&&(n=z(e.coordSysDims,function(a){var o={name:a},s=e.axisMap.get(a);if(s){var l=s.get("type");o.type=hw(l)}return o})),n||(n=i&&(i.getDimensionsInfo?i.getDimensionsInfo():i.dimensions.slice())||["x","y"]),n}function p2(t,e,r){var i,n;return r&&T(t,function(a,o){var s=a.coordDim,l=r.categoryAxisMap.get(s);l&&(i==null&&(i=o),a.ordinalMeta=l.getOrdinalMeta(),e&&(a.createInvertedIndices=!0)),a.otherDims.itemName!=null&&(n=!0)}),!n&&i!=null&&(t[i].otherDims.itemName=0),i}function h2(t,e,r){r=r||{};var i=e.getSourceManager(),n,a=!1;t?(a=!0,n=hs(t)):(n=i.getSource(),a=n.sourceFormat===st);var o=gw(e),s=c2(e,o),l=r.useEncodeDefaulter,u=X(l)?l:l?be(Qb,s,e):null,f={coordDimensions:s,generateCoord:r.generateCoord,encodeDefine:e.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!a},c=bs(n,f),p=p2(c.dimensions,r.createInvertedIndices,o),h=a?null:i.getSharedDataStore(c),v=Tp(e,{schema:c,store:h}),d=new Ss(c,e);d.setCalculationInfo(v);var m=p!=null&&v2(n)?function(g,y,_,x){return x===p?_:this.defaultDimValueGetter(g,y,_,x)}:null;return d.hasItemOption=!1,d.initData(a?n:h,null,m),d}function v2(t){if(t.sourceFormat===st){var e=d2(t.data||[]);return!k(Ii(e))}}function d2(t){for(var e=0;e=e[0]&&t<=e[1]},getExtent:function(){return this._extents[Qt].slice()},getExtentUnsafe:function(t){return this._extents[t]},setExtent:function(t,e){_w(this._extents,Qt,t,e)},setExtent2:function(t,e,r){var i=this._extents;i[t]||(i[t]=i[Qt].slice()),_w(i,t,e,r)},freeze:function(){}};function _w(t,e,r,i){Oi(r,i)&&(t[e][0]=r,t[e][1]=i)}function Dp(t){return Es(t)||yi(t)}function Es(t){return t.type==="interval"}function gi(t){return t.type==="time"}function yi(t){return t.type==="log"}function Ze(t){return t.type==="ordinal"}function Tw(t){var e=Po(t),r=nn(10,e),i=Yt(t/r);return i?i===2?i=3:i===3?i=5:i*=2:i=1,de(i*r,-e)}function Zr(t){return ir(t)+2}function lu(t,e){return rn(t)/rn(e)}function Ep(t,e,r){var i=r&&r.lookup;if(i){for(var n=0;n1&&a/o>2&&(n=Math.round(Math.ceil(n/o)*o)),n!==i[0]&&l(i[0],!0,!0);for(var s=n;s<=i[1];s+=o)l(s,!1,s===i[0]||s===i[1]);s-o!==i[1]&&l(i[1],!0,!0);function l(u,f,c){r({value:u,offInterval:f},c)}}var Cw=(function(t){L(e,t);function e(r){var i=t.call(this)||this;i.type="ordinal",i.parse=e.parse,Cp(i,e.decoratedMethods);var n=r.ordinalMeta;n||(n=new su({})),k(n)&&(n=new su({categories:z(n,function(o){return Y(o)?o.value:o})})),i._ordinalMeta=n;var a=As(null,null,r.extent||[0,n.categories.length-1]);return i._mapper=a.mapper,Ap(i,a.mapper),i}return e.parse=function(r){return r==null?r=NaN:U(r)?(r=this._ordinalMeta.getOrdinal(r),r==null&&(r=NaN)):r=Yt(r),r},e.prototype.getTicks=function(){var r=[];return Ip(this,0,function(i){r.push(i)}),r},e.prototype.getMinorTicks=function(r){},e.prototype.setSortInfo=function(r){if(r==null){this._ordinalNumbersByTick=this._ticksByOrdinalNumber=null;return}for(var i=r.ordinalNumbers,n=this._ordinalNumbersByTick=[],a=this._ticksByOrdinalNumber=[],o=0,s=this._ordinalMeta.categories.length,l=Ne(s,i.length);o=0&&r=0&&r=0&&ro[0]&&do[1]||!isFinite(d)||!isFinite(o[1]))break}else{if(m>v)break;d=Ne(d,o[1]),m===v&&(d=o[1])}if(c.push({value:d}),d=de(d+n,s),u){var g=u.calcNiceTickMultiple(d,h);g>=0&&(d=de(d+g*n,s))}if(c.length>0&&d===c[c.length-1].value)break;if(c.length>p)return[]}var y=c.length?c[c.length-1].value:o[1];return a[1]>y&&c.push({value:r.expandToNicedExtent?de(y+n,s):a[1]}),f&&l.pruneTicksByBreak(r.pruneByBreak,c,u.breaks,function(_){return _.value},i.interval,a),f&&r.breakTicks!=="none"&&l.addBreaksToTicks(c,u.breaks,a),c},e.prototype.getMinorTicks=function(r){return Ms(this,r,Na(this),this._cfg.interval)},e.prototype.getLabel=function(r,i){if(r==null)return"";var n=i&&i.precision;n==null?n=ir(r.value)||0:n==="auto"&&(n=this._cfg.intervalPrecision);var a=de(r.value,n,!0);return Ul(a)},e.type="interval",e})(Bt);Bt.registerClass(Dw);var eo=Dw;var b2=function(t,e,r,i){for(;r>>1;t[n][1]16?16:t>7.5?7:t>3.5?4:t>1.5?2:1}function w2(t){var e=30*cr;return t/=e,t>6?6:t>3?3:t>2?2:1}function C2(t){return t/=is,t>12?12:t>6?6:t>3.5?4:t>2?2:1}function Ew(t,e){return t/=e?xc:_c,t>30?30:t>20?20:t>15?15:t>10?10:t>5?5:t>2?2:1}function A2(t){return ve(Mi(t,!0),1)}function D2(t,e,r){var i=Math.max(0,ie(Kt,e)-1);return as(new Date(t),Kt[i],r).getTime()}function E2(t,e){var r=new Date(0);r[t](1);var i=r.getTime();r[t](1+e);var n=r.getTime()-i;return function(a,o){return Math.max(0,Math.round((o-a)/n))}}function M2(t,e,r,i,n,a){var o=3e3,s=Pb,l=0;function u(R,F,B,V,H,Z,Q){for(var ee=E2(H,R),j=F,ce=new Date(j);jo));)if(ce[H](ce[V]()+R),j=ce.getTime(),a){var ye=a.calcNiceTickMultiple(j,ee);ye>0&&(ce[H](ce[V]()+ye*R),j=ce.getTime())}Q.push({value:j,notAdd:j>i[1]})}function f(R,F,B){var V=[],H=!F.length;if(!Iw(ns(R),i[0],i[1],r)){H&&(F=[{value:D2(i[0],R,r)},{value:i[1]}]);for(var Z=0;Z=i[0]&&Q<=i[1]&&u(j,Q,ee,ce,ye,He,V),R==="year"&&B.length>1&&Z===0&&B.unshift({value:B[0].value-j})}}for(var Z=0;Z=i[0]&&x<=i[1]&&h++)}var S=n/e;if(h>S*1.5&&v>S/1.5||(c.push(y),h>S||t===s[d]))break}p=[]}}}for(var b=Ae(z(c,function(R){return Ae(R,function(F){return F.value>=i[0]&&F.value<=i[1]&&!F.notAdd})}),function(R){return R.length>0}),w=b.length-1,A=[],d=0;di[0])&&A.unshift({value:i[0],time:{level:0,upperTimeUnit:O,lowerTimeUnit:O},notNice:!0}),(!M||M.values&&(a=s);var l=Op.length,u=Math.min(b2(Op,a,0,l),l-1),f=Op[u][1],c=Op[Math.max(u-1,0)][0];t.setTimeInterval({approxInterval:a,interval:f,minLevelUnit:c})};Bt.registerClass(Mw);var Lw=Mw;var Lp=0,Pp=1,I2=2,kw=(function(t){L(e,t);function e(r){var i=t.call(this)||this;i.type="log",i.parse=eo.parse,i.base=r.logBase||10;var n=[],a=[],o=i._lookup={from:n,to:a};n[Lp]=n[Pp]=a[Lp]=a[Pp]=NaN,Cp(i,e.mapperMethods);var s=Ge(),l=r.breakOption,u={lookup:o};return s&&s.parseAxisBreakOptionInwardTransform(l,i,{noNegative:!0},I2,u),i.powStub=new eo({breakParsed:u.original}),i.intervalStub=new eo({breakParsed:u.transformed}),Ap(i,i.intervalStub),i}return e.prototype.getTicks=function(r){var i=this.base,n=this.powStub,a=Ge(),o=this.intervalStub,s=o.getExtent(),l=n.getExtent(),u={lookup:{from:s,to:l}};return z(o.getTicks(r||{}),function(f){var c=f.value,p=Ep(c,i,u),h;if(a){var v=a.getTicksBreakOutwardTransform(this,f,Na(n),this._lookup);v&&(h=v.vBreak,p=v.tickVal)}return{value:p,break:h}},this)},e.prototype.getMinorTicks=function(r){return Ms(this,r,Na(this.powStub),this.intervalStub.getConfig().interval)},e.prototype.getLabel=function(r,i){return this.intervalStub.getLabel(r,i)},e.type="log",e.mapperMethods={needTransform:function(){return!0},normalize:function(r){return this.intervalStub.normalize(lu(r,this.base))},scale:function(r){return Ep(this.intervalStub.scale(r),this.base,null)},transformIn:function(r,i){return r=lu(r,this.base),i&&i.depth===Cs?r:this.intervalStub.transformIn(r,i)},transformOut:function(r,i){var n=i?i.depth:null;return Pw.depth=n,Nw.lookup=this._lookup,Ep(n===Cs?r:this.intervalStub.transformOut(r,Pw),this.base,Nw)},contain:function(r){return this.powStub.contain(r)},setExtent:function(r,i){this.setExtent2(Qt,r,i)},setExtent2:function(r,i,n){if(!(!Oi(i,n)||i<=0||n<=0)){var a=Rw,o=Rw;if(r===Qt){var s=this._lookup;a=s.to,o=s.from}this.powStub.setExtent2(r,a[Lp]=i,a[Pp]=n);var l=this.base;this.intervalStub.setExtent2(r,o[Lp]=lu(i,l),o[Pp]=lu(n,l))}},getFilter:function(){return{g:0}},sanitize:function(r,i){return Oi(i[0],i[1])&&tt(r)&&r<=0&&(r=i[0]),r},getDefaultStartValue:function(){return 1},getExtent:function(){return this.powStub.getExtent()},getExtentUnsafe:function(r,i){return i===null?this.powStub.getExtentUnsafe(r,null):this.intervalStub.getExtentUnsafe(r,i)}},e})(Bt);Bt.registerClass(kw);var Pw={},Nw={},Rw=[],Bw=kw;var Np={value:1,category:1,time:1,log:1};var zw=te();function kp(t){var e=t.get("type");return(e==null||!Oe(Np,e)&&!Bt.getClass(e))&&(e="value"),e}function Bp(t,e,r){var i=Ge(),n;switch(i&&(n=Pg(t,e,r)),e){case"category":return new Aw({ordinalMeta:t.getOrdinalMeta?t.getOrdinalMeta():t.getCategories(),extent:St()});case"time":return new Lw({locale:t.ecModel.getLocaleModel(),useUTC:t.ecModel.get("useUTC"),breakOption:n});case"log":return new Bw({logBase:t.get("logBase"),breakOption:n});case"value":return new eo({breakOption:n});default:return new(Bt.getClass(e)||eo)({})}}function Uw(t,e,r){var i=r?$a(t,null):t.getExtentUnsafe(Qt,null),n=i[0],a=i[1];return Oi(n,a)?n===e||a===e?L2:ne?O2:Rp:Rp}var O2=1,L2=2,Rp=3;function Fw(t){zw(t).noOnMyZero=!0}function Vw(t){return zw(t).noOnMyZero}function fu(t){var e=t.getLabelModel().get("formatter");if(t.type==="time"){var r=Nb(e);return function(n,a){return t.scale.getFormattedLabel(n,a,r)}}else{if(U(e))return function(n){var a=t.scale.getLabel(n),o=e.replace("{value}",a!=null?a:"");return o};if(X(e)){if(t.type==="category")return function(n,a){return e(Is(t,n),n.value-t.scale.getExtent()[0],null)};var i=Ge();return function(n,a){var o=null;return i&&(o=i.makeAxisLabelFormatterParamBreak(o,n.break)),e(Is(t,n),a,o)}}else return function(n){return t.scale.getLabel(n)}}}function Is(t,e){var r=t.scale;return Ze(r)?r.getLabel(e):e.value}function zp(t){var e=t.get("interval");return e==null?"auto":e}function Gw(t){return t.type==="category"&&zp(t.getLabelModel())===0}function Hw(t,e){var r={};return T(t.mapDimensionsAll(e),function(i){r[wp(t,i)]=!0}),ne(r)}function En(t){return t==="middle"||t==="center"}function to(t){return t.getShallow("show")}function Pg(t,e,r){var i=t.get("breaks",!0);if(i!=null){if(!Ge())return;if(!r||!P2(e)){if(0)var n;return}return i}}function P2(t){return t!=="category"}function Up(t,e,r,i,n,a){var o=yi(t),s=o?t.intervalStub:t;if(s.setExtent(i[0],i[1]),o){var l=t.powStub,u={depth:Cs},f=t.transformOut(i[0],u),c=t.transformOut(i[1],u),p=ww(r,i);e[0]&&!p[0]&&(f=n[0]),e[1]&&!p[1]&&(c=n[1]),l.setExtent(f,c)}s.setConfig(a)}function Vi(t,e){return Ze(t)?t.getRawOrdinalNumber(e.value):e.value}function Fp(t,e){return Ze(t)&&!!e.get("boundaryGap")}var Vp=(function(){function t(){}return t.prototype.needIncludeZero=function(){return!this.option.scale},t.prototype.getCoordSysModel=function(){},t})();var N2=Bo(),Gp="|&",Os=te(),Hp=-2,Yw=-1,R2=te();function Ww(t,e){var r=t.model,i=Os(Ka(r.ecModel)).keyed,n=i&&i.get(e);return n&&n.get(r.uid)}function Xw(t,e){return Kw(Ww(t,e))}function Zw(t,e){var r=[];return qw(t.model.ecModel,function(i){for(var n=0;n0&&c[1]>0&&!p[0]&&(c[0]=0),c[0]<0&&c[1]<0&&!p[1]&&(c[1]=0));var x=!1;c[0]>c[1]&&(c.reverse(),x=!0);var S=cu(e,r.get("startValue",!0)),b=S!=null;!tt(S)&&n&&(S=e.getDefaultStartValue?e.getDefaultStartValue():0),tt(S)&&(b||!y||_)&&(Sc[1]&&!p[1]&&(c[1]=S,p[1]=!0));var w=this._i={scale:e,dataMM:f,noZoomEffMM:c,zoomMM:[],fixMM:p,zoomFixMM:[!1,!1],startValue:S,isBlank:g,incl0:_,tggAxInv:x,ctnShp:a};tC(w,c)}return t.prototype.makeNoZoom=function(){return this._i.noZoomEffMM.slice()},t.prototype.makeFinal=function(){var e=this._i,r=e.zoomMM,i=e.noZoomEffMM,n=e.zoomFixMM,a=e.fixMM,o={fixMM:a,zoomFixMM:n,isBlank:e.isBlank,incl0:e.incl0,tggAxInv:e.tggAxInv,ctnShp:e.ctnShp,effMM:i.slice()},s=o.effMM;return r[0]!=null&&(s[0]=r[0],a[0]=n[0]=!0),r[1]!=null&&(s[1]=r[1],a[1]=n[1]=!0),tC(e,s),o},t.prototype.makeRenderInfo=function(){return{startValue:this._i.startValue}},t.prototype.setZoomMM=function(e,r){this._i.zoomMM[e]=r},t})();function tC(t,e){var r=t.scale,i=t.dataMM;r.sanitize&&(e[0]=r.sanitize(e[0],i),e[1]=r.sanitize(e[1],i),ko(e))}function cu(t,e){return e==null?null:Si(e)?NaN:t.parse(e)}function U2(t,e){var r;if(Ze(t))r=[0,0];else{var i=e.get("boundaryGap");typeof i=="boolean"&&(i=null),r=k(i)?i:[i,i]}return[rC(r[0]),rC(r[1])]}function rC(t){return zr(typeof t=="boolean"?0:t,1)||0}function oC(t){var e=B2(t.scale);return e.extent||(e.extent=St()),e}function sC(t,e){oC(t).dimIdxInCoord=e.get(t.dim)}function Wp(t,e){var r=t.scale,i=t.model,n=t.dim;r.rawExtentInfo||F2(r,t,n,i,e)}function F2(t,e,r,i,n){var a=oC(e),o=a.extent,s=!1;jw(e,function(f){if(f.boxCoordinateSystem){var c=Oc(f).coord,p=a.dimIdxInCoord;if(p>=0){if(k(c)){var h=c[p];h!=null&&!k(h)&&yl(o,t.parse(h))}}}else if(f.coordinateSystem){var v=f.getData();if(v){var d=t.getFilter?t.getFilter():null;T(Hw(v,r),function(m){xx(o,v.getApproximateExtent(m,d))})}f.__requireStartValue&&f.__requireStartValue(e)&&(s=!0)}});var l=G2(t,e,i),u=new aC(t,i,o,s,l);lC(t,u,n),a.extent=null}function V2(t,e){var r=t.scale;lC(r,new aC(r,t.model,e,!1,!1),z2)}function lC(t,e,r){t.rawExtentInfo=e,e.from=r}function uC(t,e){Fg.set(t,e)}var Fg=G();function Xp(t,e,r,i,n){t.rawExtentInfo||V2({scale:t,model:e},n||St());var a=t.rawExtentInfo.makeFinal(),o=a.effMM;return t.setExtent(o[0],o[1]),t.setBlank(a.isBlank),i&&a.tggAxInv&&r&&!r.get("legacyMinMaxDontInverseAxis")&&(i.inverse=!i.inverse),a}function G2(t,e,r){var i=Fp(t,r),n=r.get("containShape",!0);if(n==null&&!i&&(n=!0),!n)return!1;var a=!1;return zg(e,function(o){a=!!Fg.get(o)||a}),a}function fC(t,e,r,i){if(r.ctnShp){var n;if(zg(t,function(s){var l=Fg.get(s);if(l){var u=l(t,i);u&&(n=n||[0,0],Qv(n,u[0]),Jv(n,u[1]),Fw(t))}}),!!n){var a=e.getExtent();if(Ze(e))t.onBand||e.setExtent2(ws,Ne(a[0],a[0]+n[0]),ve(a[1],a[1]+n[1]));else{var o=a.slice();r.zoomFixMM[0]||(o[0]=Ne(o[0],e.transformOut(e.transformIn(o[0],null)+n[0],null))),r.zoomFixMM[1]||(o[1]=ve(o[1],e.transformOut(e.transformIn(o[1],null)+n[1],null))),(o[0]a[1])&&e.setExtent2(ws,o[0],o[1])}}}}function cC(t,e){var r=yi(t),i=r?t.intervalStub:t,n=e.fixMinMax||[],a=r?t.getExtent():null,o=i.getExtent(),s=Mp(o,n,e.rawExtentResult);i.setExtent(s[0],s[1]),s=i.getExtent();var l=r?Y2(i,e):H2(i,e),u=l.intervalPrecision,f=l.interval,c=e.userInterval;c!=null&&(l.interval=c,l.intervalPrecision=Zr(c)),n[0]||(s[0]=de(Wt(s[0]/f)*f,u)),n[1]||(s[1]=de(ri(s[1]/f)*f,u)),c!=null&&(l.niceExtent=s.slice()),Up(t,n,o,s,a,l)}function H2(t,e){var r=uu(e.splitNumber,5),i=Ds(t),n=e.minInterval,a=e.maxInterval,o=Mi(i/r,!0);n!=null&&oa&&(o=a);var s=Zr(o),l=t.getExtent(),u=[de(ri(l[0]/o)*o,s),de(Wt(l[1]/o)*o,s)];return{interval:o,intervalPrecision:s,niceExtent:u}}function Y2(t,e){var r=uu(e.splitNumber,10),i=t.getExtent(),n=Ds(t),a=ve(Lo(n),1),o=r/n*a;o<=.5&&(a*=10);var s=Zr(a),l=[de(ri(i[0]/a)*a,s),de(Wt(i[1]/a)*a,s)];return{intervalPrecision:s,interval:a,niceExtent:l}}function Vg(t){var e=t.scale,r=t.model,i=r.axis,n=r.ecModel;Gg(e,r,i,n,null)}function Gg(t,e,r,i,n){var a=Xp(t,e,i,r,n),o=Es(t)||gi(t);W2(t,{splitNumber:e.get("splitNumber"),fixMinMax:a.fixMM,userInterval:e.get("interval"),minInterval:o?e.get("minInterval"):null,maxInterval:o?e.get("maxInterval"):null,rawExtentResult:a}),r&&i&&fC(r,t,a,i)}function W2(t,e){X2[t.type](t,e)}var X2={interval:cC,log:cC,time:Ow,ordinal:Me};function Z2(t){return Dn(null,t)}var q2={isDimensionStacked:Xr,enableDataStack:Tp,getStackedDimension:wp};function K2(t,e){var r=e;e instanceof Ce||(r=new Ce(e));var i=kp(r),n=Bp(r,i,!1);return t[1]=0||(pC.push(t),X(t)&&(t={install:t}),t.install(J2))}var $2=1e-8;function hC(t,e){return Math.abs(t-e)<$2}function Yg(t,e,r){var i=0,n=t[0];if(!n)return!1;for(var a=1;an&&(i=o,n=l)}if(i)return rk(i.exterior);var u=this.getBoundingRect();return[u.x+u.width/2,u.y+u.height/2]},e.prototype.getBoundingRect=function(r){var i=this._rect;if(i&&!r)return i;var n=[1/0,1/0],a=[-1/0,-1/0],o=this.geometries;return T(o,function(s){s.type==="polygon"?vC(s.exterior,n,a,r):T(s.points,function(l){vC(l,n,a,r)})}),isFinite(n[0])&&isFinite(n[1])&&isFinite(a[0])&&isFinite(a[1])||(n[0]=n[1]=a[0]=a[1]=0),i=new ae(n[0],n[1],a[0]-n[0],a[1]-n[1]),r||(this._rect=i),i},e.prototype.contain=function(r){var i=this.getBoundingRect(),n=this.geometries;if(!i.contain(r[0],r[1]))return!1;e:for(var a=0,o=n.length;a>1^-(s&1),l=l>>1^-(l&1),s+=n,l+=a,n=s,a=l,i.push([s/r,l/r])}return i}function Zp(t,e){return t=ik(t),z(Ae(t.features,function(r){return r.geometry&&r.properties&&r.geometry.coordinates.length>0}),function(r){var i=r.properties,n=r.geometry,a=[];switch(n.type){case"Polygon":var o=n.coordinates;a.push(new Xg(o[0],o.slice(1)));break;case"MultiPolygon":T(n.coordinates,function(l){l[0]&&a.push(new Xg(l[0],l.slice(1)))});break;case"LineString":a.push(new Zg([n.coordinates]));break;case"MultiLineString":a.push(new Zg(n.coordinates))}var s=new mC(i[e||"name"],a,i.cp);return s.properties=i,s})}var Kg={};er(Kg,{MAX_SAFE_INTEGER:()=>cl,asc:()=>Dt,getPercentWithPrecision:()=>nx,getPixelPrecision:()=>ix,getPrecision:()=>ir,getPrecisionSafe:()=>Hv,isNumeric:()=>hl,isRadianAroundZero:()=>sa,linearMap:()=>Le,nice:()=>Mi,numericToNumber:()=>Sr,parseDate:()=>Pt,parsePercent:()=>we,quantile:()=>ax,quantity:()=>Lo,quantityExponent:()=>Po,reformIntervals:()=>ox,remRadian:()=>pl,round:()=>rx});var jg={};er(jg,{format:()=>Ri,parse:()=>Pt,roundTime:()=>as});var Qg={};er(Qg,{Arc:()=>wa,BezierCurve:()=>Nl,BoundingRect:()=>ae,Circle:()=>Sa,CompoundPath:()=>Zo,Ellipse:()=>Il,Group:()=>xe,Image:()=>dt,IncrementalDisplayable:()=>oc,Line:()=>lr,LinearGradient:()=>qo,Polygon:()=>Ta,Polyline:()=>Hr,RadialGradient:()=>tc,Rect:()=>ge,Ring:()=>Pl,Sector:()=>sr,Text:()=>De,clipPointsByRect:()=>em,clipRectByRect:()=>tm,createIcon:()=>Ia,extendPath:()=>Kd,extendShape:()=>qd,getShapeClass:()=>jd,getTransform:()=>zl,initProps:()=>it,makeImage:()=>Bl,makePath:()=>Qo,mergePath:()=>Qd,registerShape:()=>ur,resizePath:()=>lc,updateProps:()=>Be});var Jg={};er(Jg,{addCommas:()=>Ul,capitalFirst:()=>Vb,encodeHTML:()=>Je,formatTime:()=>Fb,formatTpl:()=>ss,getTextRect:()=>_m,getTooltipMarker:()=>Ec,normalizeCssArray:()=>di,toCamelCase:()=>os,truncateText:()=>id});var $g={};er($g,{bind:()=>J,clone:()=>$,curry:()=>be,defaults:()=>re,each:()=>T,extend:()=>P,filter:()=>Ae,indexOf:()=>ie,inherits:()=>Hs,isArray:()=>k,isFunction:()=>X,isObject:()=>Y,isString:()=>U,map:()=>z,merge:()=>he,reduce:()=>Ct});var nk=te(),pu=te(),Jt={estimate:1,determine:2};function Ls(t){return{out:{noPxChangeTryDetermine:[]},kind:t}}function yC(t,e){var r=t.getLabelModel().get("customValues");if(r){var i=t.scale;return{labels:z(xC(r,i),function(n,a){return{formattedLabel:fu(t)(n,a),rawLabel:i.getLabel(n),tick:n}})}}return t.type==="category"?ak(t,e):sk(t)}function _C(t,e,r){var i=t.scale,n=t.getTickModel().get("customValues");return n?{ticks:xC(n,i)}:t.type==="category"?ok(t,e):{ticks:i.getTicks(r)}}function xC(t,e){var r=e.getExtent(),i=[];return T(t,function(n){n=e.parse(n),n>=r[0]&&n<=r[1]&&i.push(n)}),zo(i,Tx,null),Dt(i),z(i,function(n){return{value:n}})}function ak(t,e){var r=t.getLabelModel(),i=SC(t,r,e);return!r.get("show")||t.scale.isBlank()?{labels:[]}:i}function SC(t,e,r){var i=uk(t),n=zp(e),a=r.kind===Jt.estimate;if(!a){var o=TC(i,n);if(o)return o}var s,l;X(n)?s=qp(t,n,!1):(l=n==="auto"?fk(t,r):n,s=qp(t,l,!1));var u={labels:s,labelCategoryInterval:l};return a?r.out.noPxChangeTryDetermine.push(function(){return ey(i,n,u),!0}):ey(i,n,u),u}function ok(t,e){var r=lk(t),i=zp(e),n=TC(r,i);if(n)return n;var a,o;if((!e.get("show")||t.scale.isBlank())&&(a=[]),X(i))a=qp(t,i,!0);else if(i==="auto"){var s=SC(t,t.getLabelModel(),Ls(Jt.determine));o=s.labelCategoryInterval,a=z(s.labels,function(l){return l.tick})}else o=i,a=qp(t,o,!0);return ey(r,i,{ticks:a,tickCategoryInterval:o})}function sk(t){var e=t.scale.getTicks(),r=fu(t);return{labels:z(e,function(i,n){return{formattedLabel:r(i,n),rawLabel:t.scale.getLabel(i),tick:i}})}}var lk=bC("axisTick"),uk=bC("axisLabel");function bC(t){return function(r){return pu(r)[t]||(pu(r)[t]={list:[]})}}function TC(t,e){for(var r=0;rf&&(u=Math.max(1,Math.floor(l/f)));for(var c=s[0],p=t.dataToCoord(c+1)-t.dataToCoord(c),h=Math.abs(p*Math.cos(a)),v=Math.abs(p*Math.sin(a)),d=0,m=0;c<=s[1];c+=u){var g=0,y=0,_=bf(n({value:c}),i.font,"center","top");g=_.width*1.3,y=_.height*1.3,d=Math.max(d,g,7),m=Math.max(m,y,7)}var x=d/h,S=m/v;isNaN(x)&&(x=1/0),isNaN(S)&&(S=1/0);var b=Math.max(0,Math.floor(Math.min(x,S)));if(r===Jt.estimate)return e.out.noPxChangeTryDetermine.push(J(ck,null,t,b,l)),b;var w=CC(t,b,l);return w!=null?w:b}function ck(t,e,r){return CC(t,e,r)==null}function CC(t,e,r){var i=nk(t.model),n=t.getExtent(),a=i.lastAutoInterval,o=i.lastTickCount;if(a!=null&&o!=null&&Math.abs(a-e)<=1&&Math.abs(o-r)<=1&&a>e&&i.axisExtent0===n[0]&&i.axisExtent1===n[1])return a;i.lastTickCount=r,i.lastAutoInterval=e,i.axisExtent0=n[0],i.axisExtent1=n[1]}function pk(t){var e=t.getLabelModel();return{axisRotate:t.getRotate?t.getRotate():t.isHorizontal&&!t.isHorizontal()?90:0,labelRotate:e.get("rotate")||0,font:e.getFont()}}function qp(t,e,r){var i=fu(t),n=t.scale,a=[],o=X(e);return Ip(n,o?0:e,function(s,l){var u=n.getLabel(s);if(o){var f=!!e(s.value,u);if(s.offInterval=!f,!f&&!l)return}a.push(r?s:{formattedLabel:i(s),rawLabel:u,tick:s})}),a}var hk=.8;function qr(t,e){e=e||{};var r={w:NaN,w2:NaN},i=t.scale,n=e.fromStat,a=e.min,o=bw(i);tt(o)||(o=NaN);var s=t.getExtent(),l=Ie(s[1]-s[0]);return Ze(i)?vk(r,t,o,l):n?dk(r,t,o,l,n):a==null,a!=null&&(r.w=tt(r.w)?ve(a,r.w):a),r}function vk(t,e,r,i){var n=e.onBand,a=r+(n?1:0);a===0&&(a=1),t.w=i/a,!n&&r&&i&&(t.w2=t.w*r/i)}function dk(t,e,r,i,n){var a=!1,o=-1/0;T(n.key?[Xw(e,n.key)]:Zw(e,n.sers||[]),function(s){var l=s.liPosMinGap;l!=null&&(l>0?(l>o&&(o=l),a=!1):l===Hp&&(a=!0))}),tt(r)&&r>0&&tt(o)?(t.w=i/r*o,t.w2=o):a&&(t.w=i*hk,t.w2=t.w*r/i)}var AC=[0,1],mk=(function(){function t(e,r,i){this.onBand=!1,this.inverse=!1,this.dim=e,this.scale=r,this._extent=i||[0,0]}return t.prototype.contain=function(e){var r=this._extent,i=Math.min(r[0],r[1]),n=Math.max(r[0],r[1]);return e>=i&&e<=n},t.prototype.containData=function(e){return this.scale.contain(this.scale.parse(e))},t.prototype.getExtent=function(){return this._extent.slice()},t.prototype.setExtent=function(e,r){var i=this._extent;i[0]=e,i[1]=r},t.prototype.dataToCoord=function(e,r){var i=this.scale;return e=i.normalize(i.parse(e)),Le(e,AC,DC(this),r)},t.prototype.coordToData=function(e,r){var i=Le(e,DC(this),AC,r);return this.scale.scale(i)},t.prototype.pointToData=function(e,r){},t.prototype.getTicksCoords=function(e){e=e||{};var r=e.tickModel||this.getTickModel(),i=_C(this,r,{breakTicks:e.breakTicks,pruneByBreak:e.pruneByBreak}),n=z(i.ticks,function(s){return{coord:this.dataToCoord(Vi(this.scale,s)),tick:s}},this),a=r.get("alignWithLabel"),o=gk(this,n,a);return z(n,function(s){return{coord:s.coord,tickValue:s.tick.value,onBand:o}})},t.prototype.getMinorTicksCoords=function(){if(Ze(this.scale))return[];var e=this.model.getModel("minorTick"),r=e.get("splitNumber");r>0&&r<100||(r=5);var i=this.scale.getMinorTicks(r),n=z(i,function(a){return z(a,function(o){return{coord:this.dataToCoord(o),tickValue:o}},this)},this);return n},t.prototype.getViewLabels=function(e){return e=e||Ls(Jt.determine),yC(this,e).labels},t.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},t.prototype.getTickModel=function(){return this.model.getModel("axisTick")},t.prototype.getBandWidth=function(){return qr(this,{min:1}).w},t.prototype.calculateCategoryInterval=function(e){return e=e||Ls(Jt.determine),wC(this,e)},t})();function DC(t){var e=t.getExtent();if(t.onBand){var r=e[1]-e[0],i=r/t.scale.count()/2;e[0]+=i,e[1]-=i}return e}function gk(t,e,r){var i=e.length;if(!t.onBand||r||!i)return!1;var n=qr(t).w;if(!n)return!1;T(e,function(s){s.coord-=n/2});var a=t.scale.getExtent(),o=e[i-1];return o.tick.offInterval&&e.pop(),e.push({coord:o.coord+n,tick:{value:a[1]+1}}),!0}var Kp=mk;function yk(t){var e=Se.extend(t);return Se.registerClass(e),e}function _k(t){var e=et.extend(t);return et.registerClass(e),e}function xk(t){var e=Tt.extend(t);return Tt.registerClass(e),e}function Sk(t){var e=ft.extend(t);return ft.registerClass(e),e}var hK=Math.PI*2,vK=bt.CMD;function EC(t,e,r,i,n,a,o,s){var l=n-t,u=a-e,f=r-t,c=i-e,p=Math.sqrt(f*f+c*c);f/=p,c/=p;var h=l*f+u*c,v=h/p;s&&(v=Math.min(Math.max(v,0),1)),v*=p;var d=o[0]=t+v*f,m=o[1]=e+v*c;return Math.sqrt((d-n)*(d-n)+(m-a)*(m-a))}var Mn=new le,qe=new le,wt=new le,In=new le,_i=new le;var jp=[],zt=new le;function MC(t,e){if(e<=180&&e>0){e=e/180*Math.PI,Mn.fromArray(t[0]),qe.fromArray(t[1]),wt.fromArray(t[2]),le.sub(In,Mn,qe),le.sub(_i,wt,qe);var r=In.len(),i=_i.len();if(!(r<.001||i<.001)){In.scale(1/r),_i.scale(1/i);var n=In.dot(_i),a=Math.cos(e);if(a1&&le.copy(zt,wt),zt.toArray(t[1])}}}}function IC(t,e,r){if(r<=180&&r>0){r=r/180*Math.PI,Mn.fromArray(t[0]),qe.fromArray(t[1]),wt.fromArray(t[2]),le.sub(In,qe,Mn),le.sub(_i,wt,qe);var i=In.len(),n=_i.len();if(!(i<.001||n<.001)){In.scale(1/i),_i.scale(1/n);var a=In.dot(e),o=Math.cos(r);if(a=l)le.copy(zt,wt);else{zt.scaleAndAdd(_i,s/Math.tan(Math.PI/2-f));var c=wt.x!==qe.x?(zt.x-qe.x)/(wt.x-qe.x):(zt.y-qe.y)/(wt.y-qe.y);if(isNaN(c))return;c<0?le.copy(zt,qe):c>1&&le.copy(zt,wt)}zt.toArray(t[1])}}}}function ty(t,e,r,i){var n=r==="normal",a=n?t:t.ensureState(r);a.ignore=e;var o=i.get("smooth");o=o===!0?.3:Math.max(+o,0)||0,a.shape=a.shape||{},a.shape.smooth=o;var s=i.getModel("lineStyle").getLineStyle();n?t.useStyle(s):a.style=s}function bk(t,e){var r=e.smooth,i=e.points;if(i)if(t.moveTo(i[0][0],i[0][1]),r>0&&i.length>=3){var n=mo(i[0],i[1]),a=mo(i[1],i[2]);if(!n||!a){t.lineTo(i[1][0],i[1][1]),t.lineTo(i[2][0],i[2][1]);return}var o=Math.min(n,a)*r,s=qs([],i[1],i[0],o/n),l=qs([],i[1],i[2],o/a),u=qs([],s,l,.5);t.bezierCurveTo(s[0],s[1],s[0],s[1],u[0],u[1]),t.bezierCurveTo(l[0],l[1],l[0],l[1],i[2][0],i[2][1])}else for(var f=1;f0&&n&&b(-c/a,0,a);var m=t[0],g=t[a-1],y,_;x(),y<0&&w(-y,.8),_<0&&w(_,.8),x(),S(y,_,1),S(_,y,-1),x(),y<0&&A(-y),_<0&&A(_);function x(){y=m.rect[o]-r,_=i-g.rect[o]-g.rect[s]}function S(C,D,E){if(C<0){var I=Math.min(D,-C);if(I>0){b(I*E,0,a);var M=I+C;M<0&&w(-M*E,1)}else w(-C*E,1)}}function b(C,D,E){C!==0&&(f=!0);for(var I=D;I0)for(var M=0;M0;M--){var F=E[M-1]*R;b(-F,M,a)}}}function A(C){var D=C<0?-1:1;C=Math.abs(C);for(var E=Math.ceil(C/(a-1)),I=0;I0?b(E,0,I+1):b(-E,a-I-1,a),C-=E,C<=0)return}return f}function FC(t){var e=[];t.sort(function(u,f){return(f.suggestIgnore?1:0)-(u.suggestIgnore?1:0)||f.priority-u.priority});function r(u){if(!u.ignore){var f=u.ensureState("emphasis");f.ignore==null&&(f.ignore=!1)}u.ignore=!0}for(var i=0;i-1&&(u.style.stroke=u.style.fill,u.style.fill=K.color.neutral00,u.style.lineWidth=2),i},e.type="series.line",e.dependencies=["grid","polar"],e.defaultOption={z:3,coordinateSystem:"cartesian2d",legendHoverLink:!0,clip:!0,label:{position:"top"},endLabel:{show:!1,valueAnimation:!0,distance:8},lineStyle:{width:2,type:"solid"},emphasis:{scale:!0},step:!1,smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:6,symbolRotate:null,showSymbol:!0,showAllSymbol:"auto",connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:1/0,universalTransition:{divideShape:"clone"},triggerLineEvent:!1,triggerEvent:!1},e})(Tt),VC=wk;function Ps(t,e){var r=t.mapDimensionsAll("defaultedLabel"),i=r.length;if(i===1){var n=Bi(t,e,r[0]);return n!=null?n+"":null}else if(i){for(var a=[],o=0;o=0&&i.push(e[a])}return i.join(" ")}var Ck=(function(t){L(e,t);function e(r,i,n,a){var o=t.call(this)||this;return o.updateData(r,i,n,a),o}return e.prototype._createSymbol=function(r,i,n,a,o,s){this.removeAll();var l=Lt(r,-1,-1,2,2,null,s);l.attr({z2:W(o,100),culling:!0,scaleX:a[0]/2,scaleY:a[1]/2}),l.drift=Ak,this._symbolType=r,this.add(l)},e.prototype.stopSymbolAnimation=function(r){this.childAt(0).stopAnimation(null,r)},e.prototype.getSymbolType=function(){return this._symbolType},e.prototype.getSymbolPath=function(){return this.childAt(0)},e.prototype.highlight=function(){ya(this.childAt(0))},e.prototype.downplay=function(){_a(this.childAt(0))},e.prototype.setZ=function(r,i){var n=this.childAt(0);n.zlevel=r,n.z=i},e.prototype.setDraggable=function(r,i){var n=this.childAt(0);n.draggable=r,n.cursor=!i&&r?"move":n.cursor},e.prototype.updateData=function(r,i,n,a){this.silent=!1;var o=r.getItemVisual(i,"symbol")||"circle",s=r.hostModel,l=e.getSymbolSize(r,i),u=e.getSymbolZ2(r,i),f=o!==this._symbolType,c=a&&a.disableAnimation;if(f){var p=r.getItemVisual(i,"symbolKeepAspect");this._createSymbol(o,r,i,l,u,p)}else{var h=this.childAt(0);h.silent=!1;var v={scaleX:l[0]/2,scaleY:l[1]/2};c?h.attr(v):Be(h,v,s,i),jo(h)}if(this._updateCommon(r,i,l,n,a),f){var h=this.childAt(0);if(!c){var v={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:h.style.opacity}};h.scaleX=h.scaleY=0,h.style.opacity=0,it(h,v,s,i)}}c&&this.childAt(0).stopAnimation("leave")},e.prototype._updateCommon=function(r,i,n,a,o){var s=this.childAt(0),l=r.hostModel,u,f,c,p,h,v,d,m,g;if(a&&(u=a.emphasisItemStyle,f=a.blurItemStyle,c=a.selectItemStyle,p=a.focus,h=a.blurScope,d=a.labelStatesModels,m=a.hoverScale,g=a.cursorStyle,v=a.emphasisDisabled),!a||r.hasItemOption){var y=a&&a.itemModel?a.itemModel:r.getItemModel(i),_=y.getModel("emphasis");u=_.getModel("itemStyle").getItemStyle(),c=y.getModel(["select","itemStyle"]).getItemStyle(),f=y.getModel(["blur","itemStyle"]).getItemStyle(),p=_.get("focus"),h=_.get("blurScope"),v=_.get("disabled"),d=vi(y),m=_.getShallow("scale"),g=y.getShallow("cursor")}var x=r.getItemVisual(i,"symbolRotate");s.attr("rotation",(x||0)*Math.PI/180||0);var S=np(r.getItemVisual(i,"symbolOffset"),n);S&&(s.x=S[0],s.y=S[1]),g&&s.attr("cursor",g);var b=r.getItemVisual(i,"style"),w=b.fill;if(s instanceof dt){var A=s.style;s.useStyle(P({image:A.image,x:A.x,y:A.y,width:A.width,height:A.height},b))}else s.__isEmptyBrush?s.useStyle(P({},b)):s.useStyle(b),s.style.decal=null,s.setColor(w,o&&o.symbolInnerColor),s.style.strokeNoScale=!0;var C=r.getItemVisual(i,"liftZ"),D=this._z2;C!=null?D==null&&(this._z2=s.z2,s.z2+=C):D!=null&&(s.z2=D,this._z2=null);var E=o&&o.useNameLabel;hi(s,d,{labelFetcher:l,labelDataIndex:i,defaultText:I,inheritColor:w,defaultOpacity:b.opacity});function I(N){return E?r.getName(N):Ps(r,N)}this._sizeX=n[0]/2,this._sizeY=n[1]/2;var M=s.ensureState("emphasis");M.style=u,s.ensureState("select").style=c,s.ensureState("blur").style=f;var O=m==null||m===!0?Math.max(1.1,3/this._sizeY):isFinite(m)&&m>0?+m:1;M.scaleX=this._sizeX*O,M.scaleY=this._sizeY*O,this.setSymbolScale(1),Ni(this,p,h,v)},e.prototype.setSymbolScale=function(r){this.scaleX=this.scaleY=r},e.prototype.fadeOut=function(r,i,n){var a=this.childAt(0),o=me(this).dataIndex,s=n&&n.animation;if(this.silent=a.silent=!0,n&&n.fadeLabel){var l=a.getTextContent();l&&Ko(l,{style:{opacity:0}},i,{dataIndex:o,removeOpt:s,cb:function(){a.removeTextContent()}})}else a.removeTextContent();Ko(a,{style:{opacity:0},scaleX:0,scaleY:0},i,{dataIndex:o,cb:r,removeOpt:s})},e.getSymbolSize=function(r,i){return T1(r.getItemVisual(i,"symbolSize"))},e.getSymbolZ2=function(r,i){return r.getItemVisual(i,"z2")},e})(xe);function Ak(t,e){this.parent.drift(t,e)}var vu=Ck;function eh(t,e,r,i){return e&&!isNaN(e[0])&&!isNaN(e[1])&&!(i&&i.isIgnore&&i.isIgnore(r))&&!(i&&i.clipShape&&!i.clipShape.contain(e[0],e[1]))&&t.getItemVisual(r,"symbol")!=="none"}function GC(t){return t!=null&&!Y(t)&&(t={isIgnore:t}),t||{}}function HC(t){var e=t.hostModel,r=e.getModel("emphasis");return{emphasisItemStyle:r.getModel("itemStyle").getItemStyle(),blurItemStyle:e.getModel(["blur","itemStyle"]).getItemStyle(),selectItemStyle:e.getModel(["select","itemStyle"]).getItemStyle(),focus:r.get("focus"),blurScope:r.get("blurScope"),emphasisDisabled:r.get("disabled"),hoverScale:r.get("scale"),labelStatesModels:vi(e),cursorStyle:e.get("cursor")}}function YC(t,e,r,i,n,a,o){var s=new t(e,r,i,n);return s.setPosition(a),e.setItemGraphicEl(r,s),o.add(s),s}var Dk=(function(){function t(e){this.group=new xe,this._SymbolCtor=e||vu}return t.prototype.updateData=function(e,r){this._progressiveEls=null,r=GC(r);var i=this.group,n=e.hostModel,a=this._data,o=this._SymbolCtor,s=r.disableAnimation,l=this._seriesScope=HC(e),u={disableAnimation:s},f=r.getSymbolPoint||function(c){return e.getItemLayout(c)};a||i.removeAll(),e.diff(a).add(function(c){var p=f(c);eh(e,p,c,r)&&YC(o,e,c,l,u,p,i)}).update(function(c,p){var h=a.getItemGraphicEl(p),v=f(c);if(!eh(e,v,c,r)){i.remove(h);return}var d=e.getItemVisual(c,"symbol")||"circle",m=h&&h.getSymbolType&&h.getSymbolType();if(!h||m&&m!==d)i.remove(h),h=new o(e,c,l,u),h.setPosition(v);else{h.updateData(e,c,l,u);var g={x:v[0],y:v[1]};s?h.attr(g):Be(h,g,n)}i.add(h),e.setItemGraphicEl(c,h)}).remove(function(c){var p=a.getItemGraphicEl(c);p&&p.fadeOut(function(){i.remove(p)},n)}).execute(),this._getSymbolPoint=f,this._data=e},t.prototype.updateLayout=function(e){var r=this._data;if(r)for(var i=this,n=r.getStore(),a=0,o=n.count();a0?r=i[0]:i[1]<0&&(r=i[1]),r}function rh(t,e,r,i){var n=NaN;t.stacked&&(n=r.get(r.getCalculationInfo("stackedOverDimension"),i)),isNaN(n)&&(n=t.valueStart);var a=t.baseDataOffset,o=[];return o[a]=r.get(t.baseDim,i),o[1-a]=n,e.dataToPoint(o)}function $t(t,e){return!isFinite(t)||!isFinite(e)}var Mk=typeof Float32Array!==hn?Float32Array:void 0,XC=typeof Float64Array!==hn?Float64Array:void 0;function vr(t){return ih({ctor:Mk},t).arr}function ih(t,e){var r=t.arr,i=t.ctor;if(e>cl&&(e=cl),!r||t.typed&&r.length=n||d<0)break;if($t(g,y)){if(l){d+=a;continue}break}if(d===r)t[a>0?"moveTo":"lineTo"](g,y),c=g,p=y;else{var _=g-u,x=y-f;if(_*_+x*x<.5){d+=a;continue}if(o>0){for(var S=d+a,b=e[S*2],w=e[S*2+1];b===g&&w===y&&m=i||$t(b,w))h=g,v=y;else{D=b-u,E=w-f;var O=g-u,N=b-g,R=y-f,F=w-y,B=void 0,V=void 0;if(s==="x"){B=Math.abs(O),V=Math.abs(N);var H=D>0?1:-1;h=g-H*B*o,v=y,I=g+H*V*o,M=y}else if(s==="y"){B=Math.abs(R),V=Math.abs(F);var Z=E>0?1:-1;h=g,v=y-Z*B*o,I=g,M=y+Z*V*o}else B=Math.sqrt(O*O+R*R),V=Math.sqrt(N*N+F*F),C=V/(V+B),h=g-D*o*(1-C),v=y-E*o*(1-C),I=g+D*o*C,M=y+E*o*C,I=On(I,Ln(b,g)),M=On(M,Ln(w,y)),I=Ln(I,On(b,g)),M=Ln(M,On(w,y)),D=I-g,E=M-y,h=g-D*B/V,v=y-E*B/V,h=On(h,Ln(u,g)),v=On(v,Ln(f,y)),h=Ln(h,On(u,g)),v=Ln(v,On(f,y)),D=g-h,E=y-v,I=g+D*V/B,M=y+E*V/B}t.bezierCurveTo(c,p,h,v,g,y),c=I,p=M}else t.lineTo(g,y)}u=g,f=y,d+=a}return m}var ZC=(function(){function t(){this.smooth=0,this.smoothConstraint=!0}return t})(),qC=(function(t){L(e,t);function e(r){var i=t.call(this,r)||this;return i.type="ec-polyline",i}return e.prototype.getDefaultStyle=function(){return{stroke:K.color.neutral99,fill:null}},e.prototype.getDefaultShape=function(){return new ZC},e.prototype.buildPath=function(r,i){var n=i.points,a=0,o=n.length/2;if(i.connectNulls){for(;o>0&&$t(n[o*2-2],n[o*2-1]);o--);for(;a=0){var x=u?(v-l)*_+l:(h-s)*_+s;return u?[r,x]:[x,r]}s=h,l=v;break;case o.C:h=a[c++],v=a[c++],d=a[c++],m=a[c++],g=a[c++],y=a[c++];var S=u?$n(s,h,d,g,r,f):$n(l,v,m,y,r,f);if(S>0)for(var b=0;b=0){var x=u?Ue(l,v,m,y,w):Ue(s,h,d,g,w);return u?[r,x]:[x,r]}}s=g,l=y;break}}},e})(ue);var Ok=(function(t){L(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(ZC),KC=(function(t){L(e,t);function e(r){var i=t.call(this,r)||this;return i.type="ec-polygon",i}return e.prototype.getDefaultShape=function(){return new Ok},e.prototype.buildPath=function(r,i){var n=i.points,a=i.stackedOnPoints,o=0,s=n.length/2,l=i.smoothMonotone;if(i.connectNulls){for(;s>0&&$t(n[s*2-2],n[s*2-1]);s--);for(;oe){a?r.push(o(a,l,e)):n&&r.push(o(n,l,0),o(n,l,e));break}else n&&(r.push(o(n,l,0)),n=null),r.push(l),a=l}return r}function Nk(t,e,r){var i=t.getVisual("visualMeta");if(!(!i||!i.length||!t.count())&&e.type==="cartesian2d"){for(var n,a,o=i.length-1;o>=0;o--){var s=t.getDimensionInfo(i[o].dimension);if(n=s&&s.coordDim,n==="x"||n==="y"){a=i[o];break}}if(a){var l=e.getAxis(n),u=z(a.stops,function(_){return{coord:l.toGlobalCoord(l.dataToCoord(_.value)),color:_.color}}),f=u.length,c=a.outerColors.slice();f&&u[0].coord>u[f-1].coord&&(u.reverse(),c.reverse());var p=Pk(u,n==="x"?r.getWidth():r.getHeight()),h=p.length;if(!h&&f)return u[0].coord<0?c[1]?c[1]:u[f-1].color:c[0]?c[0]:u[0].color;var v=10,d=p[0].coord-v,m=p[h-1].coord+v,g=m-d;if(g<.001)return"transparent";T(p,function(_){_.offset=(_.coord-d)/g}),p.push({offset:h?p[h-1].offset:.5,color:c[1]||"transparent"}),p.unshift({offset:h?p[0].offset:.5,color:c[0]||"transparent"});var y=new qo(0,0,0,0,p,!0);return y[n]=d,y[n+"2"]=m,y}}}function Rk(t,e,r){var i=t.get("showAllSymbol"),n=i==="auto";if(!(i&&!n)){var a=r.getAxesByScale("ordinal")[0];if(a&&!(n&&kk(a,e))){var o=e.mapDimension(a.dim),s={};return T(a.getViewLabels(),function(l){l.tick.offInterval||(s[Vi(a.scale,l.tick)]=1)}),function(l){return!s.hasOwnProperty(e.get(o,l))}}}}function kk(t,e){var r=t.getExtent(),i=Math.abs(r[1]-r[0])/t.scale.count();isNaN(i)&&(i=0);for(var n=e.count(),a=Math.max(1,Math.round(n/5)),o=0;oi)return!1;return!0}function Bk(t){for(var e=t.length/2;e>0&&$t(t[e*2-2],t[e*2-1]);e--);return e-1}function tA(t,e){return[t[e*2],t[e*2+1]]}function zk(t,e,r){for(var i=t.length/2,n=r==="x"?0:1,a,o,s=0,l=-1,u=0;u=e||a>=e&&o<=e){l=u;break}s=u,a=o}return{range:[s,l],t:(e-a)/(o-a)}}function rA(t){if(t.get(["endLabel","show"]))return!0;for(var e=0;e0&&r.get(["emphasis","lineStyle","width"])==="bolder"){var V=v.getState("emphasis").style;V.lineWidth=+v.style.lineWidth+1}me(v).seriesIndex=r.seriesIndex,Ni(v,R,F,B);var H=eA(r.get("smooth")),Z=r.get("smoothMonotone");if(v.setShape({smooth:H,smoothMonotone:Z,connectNulls:w}),d){var Q=s.getCalculationInfo("stackedOnSeries"),ee=0;d.useStyle(re(u.getAreaStyle(),{fill:I,opacity:.7,lineJoin:"bevel",decal:s.getVisual("style").decal})),Q&&(ee=eA(Q.get("smooth"))),d.setShape({smooth:H,stackedOnSmooth:ee,smoothMonotone:Z,connectNulls:w}),xa(d,r,"areaStyle"),me(d).seriesIndex=r.seriesIndex,Ni(d,R,F,B)}var j=this._changePolyState;s.eachItemGraphicEl(function(Te){Te&&(Te.onHoverStateChange=j)}),this._polyline.onHoverStateChange=j,this._data=s,this._coordSys=a,this._stackedOnPoints=S,this._points=f,this._step=D,this._valueOrigin=_;var ce=r.get("triggerEvent"),ye=r.get("triggerLineEvent"),He=ye===!0||ce===!0||ce==="line",Fe=ye===!0||ce===!0||ce==="area";this.packEventData(r,v,He),d&&this.packEventData(r,d,Fe)},e.prototype.packEventData=function(r,i,n){me(i).eventData=n?{componentType:"series",componentSubType:"line",componentIndex:r.componentIndex,seriesIndex:r.seriesIndex,seriesName:r.name,seriesType:"line",selfType:i===this._polygon?"area":"line"}:null},e.prototype.highlight=function(r,i,n,a){var o=r.getData(),s=br(o,a);if(this._changePolyState("emphasis"),!(s instanceof Array)&&s!=null&&s>=0){var l=o.getLayout("points"),u=o.getItemGraphicEl(s);if(!u){var f=l[s*2],c=l[s*2+1];if($t(f,c)||this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(f,c))return;var p=r.get("zlevel")||0,h=r.get("z")||0;u=new vu(o,s),u.x=f,u.y=c,u.setZ(p,h);var v=u.getSymbolPath().getTextContent();v&&(v.zlevel=p,v.z=h,v.z2=this._polyline.z2+1),u.__temp=!0,o.setItemGraphicEl(s,u),u.stopSymbolAnimation(!0),this.group.add(u)}u.highlight()}else ft.prototype.highlight.call(this,r,i,n,a)},e.prototype.downplay=function(r,i,n,a){var o=r.getData(),s=br(o,a);if(this._changePolyState("normal"),s!=null&&s>=0){var l=o.getItemGraphicEl(s);l&&(l.__temp?(o.setItemGraphicEl(s,null),this.group.remove(l)):l.downplay())}else ft.prototype.downplay.call(this,r,i,n,a)},e.prototype._changePolyState=function(r){var i=this._polygon;Md(this._polyline,r),i&&Md(i,r)},e.prototype._newPolyline=function(r){var i=this._polyline;return i&&this._lineGroup.remove(i),i=new qC({shape:{points:r},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(i),this._polyline=i,i},e.prototype._newPolygon=function(r,i){var n=this._polygon;return n&&this._lineGroup.remove(n),n=new KC({shape:{points:r,stackedOnPoints:i},segmentIgnoreThreshold:2}),this._lineGroup.add(n),this._polygon=n,n},e.prototype._initSymbolLabelAnimation=function(r,i,n){var a,o,s=i.getBaseAxis(),l=s.inverse;i.type==="cartesian2d"?(a=s.isHorizontal(),o=!1):i.type==="polar"&&(a=s.dim==="angle",o=!0);var u=r.hostModel,f=u.get("animationDuration");X(f)&&(f=f(null));var c=u.get("animationDelay")||0,p=X(c)?c(null):c;r.eachItemGraphicEl(function(h,v){var d=h;if(d){var m=[h.x,h.y],g=void 0,y=void 0,_=void 0;if(n)if(o){var x=n,S=i.pointToCoord(m);a?(g=x.startAngle,y=x.endAngle,_=-S[1]/180*Math.PI):(g=x.r0,y=x.r,_=S[0])}else{var b=n;a?(g=b.x,y=b.x+b.width,_=h.x):(g=b.y+b.height,y=b.y,_=h.y)}var w=y===g?0:(_-g)/(y-g);l&&(w=1-w);var A=X(c)?c(v):f*w+p,C=d.getSymbolPath(),D=C.getTextContent();d.attr({scaleX:0,scaleY:0}),d.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:A}),D&&D.animateFrom({style:{opacity:0}},{duration:300,delay:A}),C.disableLabelAnimation=!0}})},e.prototype._initOrUpdateEndLabel=function(r,i,n){var a=r.getModel("endLabel");if(rA(r)){var o=r.getData(),s=this._polyline,l=o.getLayout("points");if(!l){s.removeTextContent(),this._endLabel=null;return}var u=this._endLabel;u||(u=this._endLabel=new De({z2:200}),u.ignoreClip=!0,s.setTextContent(this._endLabel),s.disableLabelAnimation=!0);var f=Bk(l);f>=0&&(hi(s,vi(r,"endLabel"),{inheritColor:n,labelFetcher:r,labelDataIndex:f,defaultText:function(c,p,h){return h!=null?$p(o,h):Ps(o,c)},enableTextSetter:!0},Uk(a,i)),s.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},e.prototype._endLabelOnDuring=function(r,i,n,a,o,s,l){var u=this._endLabel,f=this._polyline;if(u){r<1&&a.originalX==null&&(a.originalX=u.x,a.originalY=u.y);var c=n.getLayout("points"),p=n.hostModel,h=p.get("connectNulls"),v=s.get("precision"),d=s.get("distance")||0,m=l.getBaseAxis(),g=m.isHorizontal(),y=m.inverse,_=i.shape,x=y?g?_.x:_.y+_.height:g?_.x+_.width:_.y,S=(g?d:0)*(y?-1:1),b=(g?0:-d)*(y?-1:1),w=g?"x":"y",A=zk(c,x,w),C=A.range,D=C[1]-C[0],E=void 0;if(D>=1){if(D>1&&!h){var I=tA(c,C[0]);u.attr({x:I[0]+S,y:I[1]+b}),o&&(E=p.getRawValue(C[0]))}else{var I=f.getPointOn(x,w);I&&u.attr({x:I[0]+S,y:I[1]+b});var M=p.getRawValue(C[0]),O=p.getRawValue(C[1]);o&&(E=jv(n,v,M,O,A.t))}a.lastFrameIndex=C[0]}else{var N=r===1||a.lastFrameIndex>0?C[0]:0,I=tA(c,N);o&&(E=p.getRawValue(N)),u.attr({x:I[0]+S,y:I[1]+b})}if(o){var R=ts(u);typeof R.setLabelText=="function"&&R.setLabelText(E)}}},e.prototype._doUpdateAnimation=function(r,i,n,a,o,s,l){var u=this._polyline,f=this._polygon,c=r.hostModel,p=oy(this._data,r,this._stackedOnPoints,i,this._coordSys,n,this._valueOrigin,s),h=p.current,v=p.stackedOnCurrent,d=p.next,m=p.stackedOnNext;if(o&&(v=Pn(p.stackedOnCurrent,p.current,n,o,l),h=Pn(p.current,null,n,o,l),m=Pn(p.stackedOnNext,p.next,n,o,l),d=Pn(p.next,null,n,o,l)),$C(h,d)>3e3||f&&$C(v,m)>3e3){u.stopAnimation(),u.setShape({points:d}),f&&(f.stopAnimation(),f.setShape({points:d,stackedOnPoints:m}));return}u.shape.__points=p.current,u.shape.points=h;var g={shape:{points:d}};p.current!==h&&(g.shape.__points=p.next),u.stopAnimation(),Be(u,g,c),f&&(f.setShape({points:h,stackedOnPoints:v}),f.stopAnimation(),Be(f,{shape:{stackedOnPoints:m}},c),u.shape.points!==f.shape.points&&(f.shape.points=u.shape.points));for(var y=[],_=p.status,x=0;x<_.length;x++){var S=_[x].cmd;if(S==="="){var b=r.getItemGraphicEl(_[x].idx1);b&&y.push({el:b,ptIdx:x})}}u.animators&&u.animators.length&&u.animators[0].during(function(){f&&f.dirtyShape();for(var w=u.shape.__points,A=0;Ae&&(e=t[r]);return isFinite(e)?e:NaN},min:function(t){for(var e=1/0,r=0;r10&&o.type==="cartesian2d"&&a){var l=o.getBaseAxis(),u=o.getOtherAxis(l),f=l.getExtent(),c=i.getDevicePixelRatio(),p=Math.abs(f[1]-f[0])*(c||1),h=Math.round(s/p);if(isFinite(h)&&h>1){a==="lttb"?e.setData(n.lttbDownSample(n.mapDimension(u.dim),1/h)):a==="minmax"&&e.setData(n.minmaxDownSample(n.mapDimension(u.dim),1/h));var v=void 0;U(a)?v=Vk[a]:X(a)&&(v=a),v&&e.setData(n.downSample(n.mapDimension(u.dim),1/h,v,Gk))}}}}}function py(t){t.registerChartView(iA),t.registerSeriesModel(VC),t.registerLayout(cy("line",!0)),t.registerVisual({seriesType:"line",reset:function(e){var r=e.getData(),i=e.getModel("lineStyle").getLineStyle();i&&!i.stroke&&(i.stroke=r.getVisual("style").fill),r.setVisual("legendLineStyle",i)}}),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,du("line"))}var Hk=(function(t){L(e,t);function e(r,i,n,a,o){var s=t.call(this,r,i,n)||this;return s.index=0,s.type=a||"value",s.position=o||"bottom",s}return e.prototype.isHorizontal=function(){var r=this.position;return r==="top"||r==="bottom"},e.prototype.getGlobalExtent=function(r){var i=this.getExtent();return i[0]=this.toGlobalCoord(i[0]),i[1]=this.toGlobalCoord(i[1]),r&&i[0]>i[1]&&i.reverse(),i},e.prototype.pointToData=function(r,i){return this.coordToData(this.toLocalCoord(r[this.dim==="x"?0:1]),i)},e.prototype.setCategorySortInfo=function(r){if(this.type!=="category")return!1;this.model.option.categorySortInfo=r,this.scale.setSortInfo(r)},e})(Kp),nA=Hk;var Yk=null;function ro(){return Yk}var aA="expandAxisBreak";var Nn=Math.PI,Wk=[[1,2,1,2],[5,3,5,3],[8,3,8,3]],Xk=[[0,1,0,1],[0,3,0,3],[0,3,0,3]],Rn=te(),lA=te(),vy=(function(){function t(e){this.recordMap={},this.resolveAxisNameOverlap=e}return t.prototype.ensureRecord=function(e){var r=e.axis.dim,i=e.componentIndex,n=this.recordMap,a=n[r]||(n[r]=[]);return a[i]||(a[i]={ready:{}})},t})();function Zk(t,e,r,i){var n=r.axis,a=e.ensureRecord(r),o=[],s,l=gy(t.axisName)&&En(t.nameLocation);T(i,function(v){var d=Kr(v);if(!(!d||d.label.ignore)){o.push(d);var m=a.transGroup;l&&(m.transform?tr(mu,m.transform):yr(mu),d.transform&&Rr(mu,mu,d.transform),ae.copy(ah,d.localRect),ah.applyTransform(mu),s?s.union(ah):ae.copy(s=new ae(0,0,0,0),ah))}});var u=Math.abs(a.dirVec.x)>.1?"x":"y",f=a.transGroup[u];if(o.sort(function(v,d){return Math.abs(v.label[u]-f)-Math.abs(d.label[u]-f)}),l&&s){var c=n.getExtent(),p=Math.min(c[0],c[1]),h=Math.max(c[0],c[1])-p;s.union(new ae(p,0,h,1))}a.stOccupiedRect=s,a.labelInfoList=o}var mu=xt(),ah=new ae(0,0,0,0),dy=function(t,e,r,i,n,a){if(En(t.nameLocation)){var o=a.stOccupiedRect;o&&uA(BC({},o,a.transGroup.transform),i,n)}else my(a.labelInfoList,a.dirVec,i,n)};function uA(t,e,r){var i=new le;Jp(t,e,i,{direction:Math.atan2(r.y,r.x),bidirectional:!1,touchThreshold:.05})&&zC(e,i)}function my(t,e,r,i){for(var n=le.dot(i,e)>=0,a=0,o=t.length;a0?"top":"bottom",a="center"):sa(n-Nn)?(o=i>0?"bottom":"top",a="center"):(o="middle",n>0&&n0?"right":"left":a=i>0?"left":"right"),{rotation:n,textAlign:a,textVerticalAlign:o}},t.makeAxisEventDataBase=function(e){var r={componentType:e.mainType,componentIndex:e.componentIndex};return r[e.mainType+"Index"]=e.componentIndex,r},t.isLabelSilent=function(e){var r=e.get("tooltip");return e.get("silent")||!(e.get("triggerEvent")||r&&r.show)},t})(),qk=["axisLine","axisTickLabelEstimate","axisTickLabelDetermine","axisName"],Kk={axisLine:function(t,e,r,i,n,a,o){if(0)var s;var l=i.get(["axisLine","show"]);if(l==="auto"&&(l=!0,t.raw.axisLineAutoShow!=null&&(l=!!t.raw.axisLineAutoShow)),!!l){var u=i.axis.getExtent(),f=a.transform,c=[u[0],0],p=[u[1],0],h=c[0]>p[0];f&&(Qe(c,c,f),Qe(p,p,f));var v=P({lineCap:"round"},i.getModel(["axisLine","lineStyle"]).getLineStyle()),d={strokeContainThreshold:t.raw.strokeContainThreshold||5,silent:!0,z2:1,style:v};if(i.get(["axisLine","breakLine"])&&Ra(i.axis.scale))ro().buildAxisBreakLine(i,n,a,d);else{var m=new lr(P({shape:{x1:c[0],y1:c[1],x2:p[0],y2:p[1]}},d));Ea(m.shape,m.style.lineWidth),m.anid="line",n.add(m)}var g=i.get(["axisLine","symbol"]);if(g!=null){var y=i.get(["axisLine","symbolSize"]);U(g)&&(g=[g,g]),(U(y)||se(y))&&(y=[y,y]);var _=np(i.get(["axisLine","symbolOffset"])||0,y),x=y[0],S=y[1];T([{rotate:t.rotation+Math.PI/2,offset:_[0],r:0},{rotate:t.rotation-Math.PI/2,offset:_[1],r:Math.sqrt((c[0]-p[0])*(c[0]-p[0])+(c[1]-p[1])*(c[1]-p[1]))}],function(b,w){if(g[w]!=="none"&&g[w]!=null){var A=Lt(g[w],-x/2,-S/2,x,S,v.stroke,!0),C=b.r+b.offset,D=h?p:c;A.attr({rotation:b.rotate,x:D[0]+C*Math.cos(t.rotation),y:D[1]-C*Math.sin(t.rotation),silent:!0,z2:11}),n.add(A)}})}}},axisTickLabelEstimate:function(t,e,r,i,n,a,o,s){if(0)var l;var u=sA(e,n,s);u&&oA(t,e,r,i,n,a,o,Jt.estimate)},axisTickLabelDetermine:function(t,e,r,i,n,a,o,s){if(0)var l;var u=sA(e,n,s);u&&oA(t,e,r,i,n,a,o,Jt.determine);var f=$k(t,n,a,i);Jk(t,e.labelLayoutList,f),eB(t,n,a,i,t.tickDirection)},axisName:function(t,e,r,i,n,a,o,s){var l=r.ensureRecord(i);if(0)var u;e.nameEl&&(n.remove(e.nameEl),e.nameEl=l.nameLayout=l.nameLocation=null);var f=t.axisName;if(gy(f)){var c=t.nameLocation,p=t.nameDirection,h=i.getModel("nameTextStyle"),v=i.get("nameGap")||0,d=i.axis.getExtent(),m=i.axis.inverse?-1:1,g=new le(0,0),y=new le(0,0);c==="start"?(g.x=d[0]-m*v,y.x=-m):c==="end"?(g.x=d[1]+m*v,y.x=m):(g.x=(d[0]+d[1])/2,g.y=t.labelOffset+p*v,y.y=p);var _=xt();y.transform(Wn(_,_,t.rotation));var x=i.get("nameRotate");x!=null&&(x=x*Nn/180);var S,b;En(c)?S=io.innerTextLayout(t.rotation,x!=null?x:t.rotation,p):(S=jk(t.rotation,c,x||0,d),b=t.raw.axisNameAvailableWidth,b!=null&&(b=Math.abs(b/Math.sin(S.rotation)),!isFinite(b)&&(b=null)));var w=h.getFont(),A=i.get("nameTruncate",!0)||{},C=A.ellipsis,D=Fn(t.raw.nameTruncateMaxWidth,A.maxWidth,b),E=s.nameMarginLevel||0,I=new De({x:g.x,y:g.y,rotation:S.rotation,silent:io.isLabelSilent(i),style:fr(h,{text:f,font:w,overflow:"truncate",width:D,ellipsis:C,fill:h.getTextColor()||i.get(["axisLine","lineStyle","color"]),align:h.get("align")||S.textAlign,verticalAlign:h.get("verticalAlign")||S.textVerticalAlign}),z2:1});if($o({el:I,componentModel:i,itemName:f}),I.__fullText=f,I.anid="name",i.get("triggerEvent")){var M=io.makeAxisEventDataBase(i);M.targetType="axisName",M.name=f,me(I).eventData=M}a.add(I),I.updateTransform(),e.nameEl=I;var O=l.nameLayout=Kr({label:I,priority:I.z2,defaultAttr:{ignore:I.ignore},marginDefault:En(c)?Wk[E]:Xk[E]});if(l.nameLocation=c,n.add(I),I.decomposeTransform(),t.shouldNameMoveOverlap&&O){var N=r.ensureRecord(i);r.resolveAxisNameOverlap(t,r,i,O,y,N)}}}};function oA(t,e,r,i,n,a,o,s){cA(e)||tB(t,e,n,s,i,o);var l=e.labelLayoutList;rB(t,i,l,a),aB(i,t.rotation,l);var u=t.optionHideOverlap;Qk(i,l,u),u&&FC(Ae(l,function(f){return f&&!f.label.ignore})),Zk(t,r,i,l)}function jk(t,e,r,i){var n=pl(r-t),a,o,s=i[0]>i[1],l=e==="start"&&!s||e!=="start"&&s;return sa(n-Nn/2)?(o=l?"bottom":"top",a="center"):sa(n-Nn*1.5)?(o=l?"top":"bottom",a="center"):(o="middle",nNn/2?a=l?"left":"right":a=l?"right":"left"),{rotation:n,textAlign:a,textVerticalAlign:o}}function Qk(t,e,r){var i=t.axis,n=t.get(["axisLabel","customValues"]);if(Gw(i))return;function a(u,f,c){var p=Kr(e[f]),h=Kr(e[c]),v=i.scale;if(!(!p||!h)){if(u==null){if(!r&&n)return;var d=Rn(p.label).labelInfo.tick;if(gi(v)&&d.notNice||Ze(v)&&d.offInterval){Ns(p.label);return}}if(u===!1||p.suggestIgnore){Ns(p.label);return}if(h.suggestIgnore){Ns(h.label);return}var m=.1;if(!r){var g=[0,0,0,0];p=ny({marginForce:g},p),h=ny({marginForce:g},h)}Jp(p,h,null,{touchThreshold:m})&&Ns(u?h.label:p.label)}}var o=t.get(["axisLabel","showMinLabel"]),s=t.get(["axisLabel","showMaxLabel"]),l=e.length;a(o,0,1),a(s,l-1,l-2)}function Jk(t,e,r){t.showMinorTicks||T(e,function(i){if(i&&i.label.ignore)for(var n=0;n=0&&_(b,x,S.getStore())})}var h=0;if(p(function(_,x,S){i.set(x.uid,1),(!n||!n.hasKey(x.uid))&&(o=!0),h+=S.count()}),(!n||n.keys().length!==i.keys().length)&&(o=!0),!o&&a!=null){e.liPosMinGap=a;return}ih(no,h);var v=0;p(function(_,x,S){for(var b=0,w=S.count();b0&&y0?Hp:Yw,r.serUids=i}var no=ih({ctor:XC},50);function gA(t){return function(e,r){var i=qr(e,{fromStat:{key:t}});if(tt(i.w2))return[-i.w2/2,i.w2/2]}}function yu(t,e){return t+Gp+e}function yA(t){return mA(),{liPosMinGap:!Ze(t.scale)}}var Hi="bar";function _A(t,e,r,i){eC(t,{key:e,seriesType:r,coordSysType:i,getMetrics:yA})}function xA(t){var e=t.scale.rawExtentInfo.makeRenderInfo().startValue;return e}var yy={left:0,right:0,top:0,bottom:0},_u=["25%","25%"],Ir="cartesian2d",lB=(function(t){L(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.mergeDefaultAndTheme=function(r,i){var n=Dr(r.outerBounds);t.prototype.mergeDefaultAndTheme.apply(this,arguments),n&&r.outerBounds&&pr(r.outerBounds,n)},e.prototype.mergeOption=function(r,i){t.prototype.mergeOption.apply(this,arguments),this.option.outerBounds&&r.outerBounds&&pr(this.option.outerBounds,r.outerBounds)},e.type="grid",e.dependencies=["xAxis","yAxis"],e.layoutMode="box",e.defaultOption={show:!1,z:0,left:"15%",top:65,right:"10%",bottom:80,containLabel:!1,outerBoundsMode:"auto",outerBounds:yy,outerBoundsContain:"all",outerBoundsClampWidth:_u[0],outerBoundsClampHeight:_u[1],backgroundColor:K.color.transparent,borderWidth:1,borderColor:K.color.neutral30},e})(Se),SA=lB;var uB=Bo(),fB="__ec_stack_";function bA(t){return t.get("stack")||fB+t.seriesIndex}function cB(t,e){var r=pB(t,e);return r.columnMap=hB(r),r}function pB(t,e){var r=yu(e,Ir),i=[],n=qr(t,{fromStat:{key:r},min:1});return Bg(t,r,function(a){i.push({barWidth:we(a.get("barWidth"),n.w),barMaxWidth:we(a.get("barMaxWidth"),n.w),barMinWidth:we(a.get("barMinWidth")||(CA(a)?.5:1),n.w),barGap:a.get("barGap"),barCategoryGap:a.get("barCategoryGap"),defaultBarGap:a.get("defaultBarGap"),stackId:bA(a)})}),{bandWidthResult:n,seriesInfo:i}}function hB(t){var e=t.bandWidthResult.w,r=e,i=0,n,a,o=[],s={};T(t.seriesInfo,function(d,m){m||(a=d.defaultBarGap||0);var g=d.stackId;Oe(s,g)||i++;var y=s[g];y||(y=s[g]={width:0,maxWidth:0},o.push(g));var _=d.barWidth;_&&!y.width&&(y.width=_,_=Ne(r,_),r-=_);var x=d.barMaxWidth;x&&(y.maxWidth=x);var S=d.barMinWidth;S&&(y.minWidth=S);var b=d.barGap;b!=null&&(a=b);var w=d.barCategoryGap;w!=null&&(n=w)}),n==null&&(n=ve(35-o.length*4,15)+"%");var l=we(n,e),u=we(a,1),f=(r-l)/(i+(i-1)*u);f=ve(f,0),T(o,function(d){var m=s[d],g=m.maxWidth,y=m.minWidth;if(m.width){var _=m.width;g&&(_=Ne(_,g)),y&&(_=ve(_,y)),m.width=_,r-=_+u*_,i--}else{var _=f;g&&g<_&&(_=Ne(g,r)),y&&y>_&&(_=y),_!==f&&(m.width=_,r-=_+u*_,i--)}}),f=(r-l)/(i+(i-1)*u),f=ve(f,0);var c=0,p;T(o,function(d){var m=s[d];m.width||(m.width=f),p=m,c+=m.width*(1+u)}),p&&(c-=p.width*u);var h={},v=-c/2;return T(o,function(d){var m=s[d];h[d]=h[d]||{bandWidth:e,offset:v,width:m.width},v+=m.width*(1+u)}),h}function TA(t){return{seriesType:t,overallReset:function(e){var r=yu(t,Ir);Qw(e,r,function(i){var n=cB(i,t);Bg(i,r,function(a){var o=n.columnMap[bA(a)];a.getData().setLayout({bandWidth:o.bandWidth,offset:o.offset,size:o.width})})})}}}function wA(t){return{seriesType:t,plan:Wa(),reset:function(e){if(pA(e)){var r=e.getData(),i=e.coordinateSystem,n=i.getBaseAxis(),a=i.getOtherAxis(n),o=r.getDimensionIndex(r.mapDimension(a.dim)),s=r.getDimensionIndex(r.mapDimension(n.dim)),l=e.get("showBackground",!0),u=r.mapDimension(a.dim),f=r.getCalculationInfo("stackResultDimension"),c=Xr(r,u)&&!!r.getCalculationInfo("stackedOnSeries"),p=a.isHorizontal(),h=a.toGlobalCoord(a.dataToCoord(xA(a))),v=CA(e),d=e.get("barMinHeight")||0,m=f&&r.getDimensionIndex(f),g=r.getLayout("size"),y=r.getLayout("offset");return{progress:function(_,x){for(var S=_.count,b=v&&vr(S*3),w=v&&l&&vr(S*3),A=v&&vr(S),C=i.master.getRect(),D=p?C.width:C.height,E,I=x.getStore(),M=0;(E=_.next())!=null;){var O=I.get(c?m:o,E),N=I.get(s,E),R=h,F=void 0;c&&(F=+O-I.get(o,E));var B=void 0,V=void 0,H=void 0,Z=void 0;if(p){var Q=i.dataToPoint([O,N]);c&&(R=i.dataToPoint([F,N])[0]),B=R,V=Q[1]+y,H=Q[0]-R,Z=g,Ie(H)m){_=(b+y)/2;break}S===1&&(x=w-v[0].tickValue)}_==null&&(y?y&&(_=v[v.length-1].coord):_=v[0].coord),s[h]=p.toGlobalCoord(_)}});else{var l=this.getData(),u=l.getLayout("offset"),f=l.getLayout("size"),c=a.getBaseAxis().isHorizontal()?0:1;s[c]+=u+f/2}return s}return[NaN,NaN]},e.prototype.__requireStartValue=function(r){return this.getBaseAxis()!==r},e.type="series.__base_bar__",e.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod",defaultBarGap:"10%"},e})(Tt);Tt.registerClass(DA);var _y=DA;var dB=(function(t){L(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.getInitialData=function(){return Dn(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get("realtimeSort",!0)||null})},e.prototype.getProgressive=function(){return this.get("large")?this.get("progressive"):!1},e.prototype.__preparePipelineContext=function(r,i){var n=Pf(this,r,i);return n.progressiveRender&&(n.large=!0),n},e.prototype.brushSelector=function(r,i,n){return n.rect(i.getItemLayout(r))},e.type="series."+Hi,e.dependencies=["grid","polar"],e.defaultOption=xn(_y.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:K.color.primary,borderWidth:2}},realtimeSort:!1}),e})(_y),EA=dB;var mB=(function(){function t(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0}return t})(),gB=(function(t){L(e,t);function e(r){var i=t.call(this,r)||this;return i.type="sausage",i}return e.prototype.getDefaultShape=function(){return new mB},e.prototype.buildPath=function(r,i){var n=i.cx,a=i.cy,o=Math.max(i.r0||0,0),s=Math.max(i.r,0),l=(s-o)*.5,u=o+l,f=i.startAngle,c=i.endAngle,p=i.clockwise,h=Math.PI*2,v=p?c-fMath.PI/2&&fs)return!0;s=c}return!1},e.prototype._isOrderDifferentInView=function(r,i){for(var n=i.scale,a=n.getExtent(),o=Math.max(0,a[0]),s=Math.min(a[1],n.getOrdinalMeta().categories.length-1);o<=s;++o)if(r.ordinalNumbers[o]!==n.getRawOrdinalNumber(o))return!0},e.prototype._updateSortWithinSameData=function(r,i,n,a){if(this._isOrderChangedWithinSameData(r,i,n)){var o=this._dataSort(r,n,i);this._isOrderDifferentInView(o,n)&&(this._removeOnRenderedListener(a),a.dispatchAction({type:"changeAxisOrder",componentType:n.dim+"Axis",axisId:n.index,sortInfo:o}))}},e.prototype._dispatchInitSort=function(r,i,n){var a=i.baseAxis,o=this._dataSort(r,a,function(s){return r.get(r.mapDimension(i.otherAxis.dim),s)});n.dispatchAction({type:"changeAxisOrder",componentType:a.dim+"Axis",isInitSort:!0,axisId:a.index,sortInfo:o})},e.prototype.remove=function(r,i){this._clear(this._model),this._removeOnRenderedListener(i)},e.prototype.dispose=function(r,i){this._removeOnRenderedListener(i)},e.prototype._removeOnRenderedListener=function(r){this._onRendered&&(r.getZr().off("rendered",this._onRendered),this._onRendered=null)},e.prototype._clear=function(r){var i=this.group,n=this._data;r&&r.isAnimationEnabled()&&n&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],n.eachItemGraphicEl(function(a){mn(a,r,me(a).dataIndex)})):i.removeAll(),this._data=null,this._isFirstFrame=!0},e.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},e.type=Hi,e})(ft),OA={cartesian2d:function(t,e){var r=e.width<0?-1:1,i=e.height<0?-1:1;r<0&&(e.x+=e.width,e.width=-e.width),i<0&&(e.y+=e.height,e.height=-e.height);var n=t.x+t.width,a=t.y+t.height,o=Sy(e.x,t.x),s=by(e.x+e.width,n),l=Sy(e.y,t.y),u=by(e.y+e.height,a),f=sn?s:o,e.y=c&&l>a?u:l,e.width=f?0:s-o,e.height=c?0:u-l,r<0&&(e.x+=e.width,e.width=-e.width),i<0&&(e.y+=e.height,e.height=-e.height),f||c},polar:function(t,e){var r=e.r0<=e.r?1:-1;if(r<0){var i=e.r;e.r=e.r0,e.r0=i}var n=by(e.r,t.r),a=Sy(e.r0,t.r0);e.r=n,e.r0=a;var o=n-a<0;if(r<0){var i=e.r;e.r=e.r0,e.r0=i}return o}},LA={cartesian2d:function(t,e,r,i,n,a,o,s,l){var u=new ge({shape:P({},i),z2:1});if(u.__dataIndex=r,u.name="item",a){var f=u.shape,c=n?"height":"width";f[c]=0}return u},polar:function(t,e,r,i,n,a,o,s,l){var u=!n&&l?xy:sr,f=new u({shape:i,z2:1});f.name="item";var c=FA(n);if(f.calculateTextPosition=MA(c,{isRoundCap:u===xy}),a){var p=f.shape,h=n?"r":"endAngle",v={};p[h]=n?i.r0:i.startAngle,v[h]=i[h],(s?Be:it)(f,{shape:v},a)}return f}};function _B(t,e){var r=t.get("realtimeSort",!0),i=e.getBaseAxis();if(r&&i.type==="category"&&e.type==="cartesian2d")return{baseAxis:i,otherAxis:e.getOtherAxis(i)}}function PA(t,e,r,i,n,a,o,s){var l,u;a?(u={x:i.x,width:i.width},l={y:i.y,height:i.height}):(u={y:i.y,height:i.height},l={x:i.x,width:i.width}),s||(o?Be:it)(r,{shape:l},e,n,null);var f=e?t.baseAxis.model:null;(o?Be:it)(r,{shape:u},f,n)}function NA(t,e){for(var r=0;r0?1:-1,o=i.height>0?1:-1;return{x:i.x+a*n/2,y:i.y+o*n/2,width:i.width-a*n,height:i.height-o*n}},polar:function(t,e,r){var i=t.getItemLayout(e);return{cx:i.cx,cy:i.cy,r0:i.r0,r:i.r,startAngle:i.startAngle,endAngle:i.endAngle,clockwise:i.clockwise}}};function bB(t){return t.startAngle!=null&&t.endAngle!=null&&t.startAngle===t.endAngle}function FA(t){return(function(e){var r=e?"Arc":"Angle";return function(i){switch(i){case"start":case"insideStart":case"end":case"insideEnd":return i+r;default:return i}}})(t)}function kA(t,e,r,i,n,a,o,s){var l=e.getItemVisual(r,"style");if(s){if(!a.get("roundCap")){var f=t.shape,c=ao(i.getModel("itemStyle"),f,!0);P(f,c),t.setShape(f)}}else{var u=i.get(["itemStyle","borderRadius"])||0;t.setShape("r",u)}t.useStyle(l);var p=i.getShallow("cursor");p&&t.attr("cursor",p);var h=s?o?n.r>=n.r0?"endArc":"startArc":n.endAngle>=n.startAngle?"endAngle":"startAngle":o?DB(n,a.coordinateSystem):EB(n,a.coordinateSystem),v=vi(i);hi(t,v,{labelFetcher:a,labelDataIndex:r,defaultText:Ps(a.getData(),r),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:h});var d=t.getTextContent();if(s&&d){var m=i.get(["label","position"]);t.textConfig.inside=m==="middle"?!0:null,IA(t,m==="outside"?h:m,FA(o),i.get(["label","rotate"]))}bb(d,v,a.getRawValue(r),function(y){return $p(e,y)});var g=i.getModel(["emphasis"]);Ni(t,g.get("focus"),g.get("blurScope"),g.get("disabled")),xa(t,i),bB(n)&&(t.style.fill="none",t.style.stroke="none",T(t.states,function(y){y.style&&(y.style.fill=y.style.stroke="none")}))}function TB(t,e){var r=t.get(["itemStyle","borderColor"]);if(!r||r==="none")return 0;var i=t.get(["itemStyle","borderWidth"])||0,n=isNaN(e.width)?Number.MAX_VALUE:Math.abs(e.width),a=isNaN(e.height)?Number.MAX_VALUE:Math.abs(e.height);return Math.min(i,n,a)}var wB=(function(){function t(){}return t})(),BA=(function(t){L(e,t);function e(r){var i=t.call(this,r)||this;return i.type="largeBar",i}return e.prototype.getDefaultShape=function(){return new wB},e.prototype.buildPath=function(r,i){for(var n=i.points,a=this.baseDimIdx,o=1-this.baseDimIdx,s=[],l=[],u=this.barWidth,f=0;f=0?r:null},30,!1);function CB(t,e,r){for(var i=t.baseDimIdx,n=1-i,a=t.shape.points,o=t.largeDataIndices,s=[],l=[],u=t.barWidth,f=0,c=a.length/3;f=s[0]&&e<=s[0]+l[0]&&r>=s[1]&&r<=s[1]+l[1])return o[f]}return-1}function VA(t,e,r){if(nh(r,"cartesian2d")){var i=e,n=r.getArea();return{x:t?i.x:n.x,y:t?n.y:i.y,width:t?i.width:n.width,height:t?n.height:i.height}}else{var n=r.getArea(),a=e;return{cx:n.cx,cy:n.cy,r0:t?n.r0:a.r0,r:t?n.r:a.r,startAngle:t?a.startAngle:0,endAngle:t?a.endAngle:Math.PI*2}}}function AB(t,e,r){var i=t.type==="polar"?sr:ge;return new i({shape:VA(e,r,t),silent:!0,z2:0})}function DB(t,e){if(t.height===0){var r=e.getOtherAxis(e.getBaseAxis());return r.inverse?"bottom":"top"}return t.height>0?"bottom":"top"}function EB(t,e){if(t.width===0){var r=e.getOtherAxis(e.getBaseAxis());return r.inverse?"left":"right"}return t.width>=0?"right":"left"}var GA=yB;function Ty(t){t.registerChartView(GA),t.registerSeriesModel(EA),t.registerLayout(t.PRIORITY.VISUAL.LAYOUT,TA(Hi)),t.registerLayout(t.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,wA(Hi)),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,du(Hi)),t.registerAction({type:"changeAxisOrder",event:"changeAxisOrder",update:"update"},function(e,r){var i=e.componentType||"series";r.eachComponent({mainType:i,query:e},function(n){e.sortInfo&&n.axis.setCategorySortInfo(e.sortInfo)})}),AA(t)}function wy(t){return{seriesType:t,reset:function(e,r){var i=r.findComponents({mainType:"legend"});if(!(!i||!i.length)){var n=e.getData();n.filterSelf(function(a){for(var o=n.getName(a),s=0;s=0},t.prototype.indexOfName=function(e){var r=this._getDataWithEncodedVisual();return r.indexOfName(e)},t.prototype.getItemVisual=function(e,r){var i=this._getDataWithEncodedVisual();return i.getItemVisual(e,r)},t})(),HA=MB;var jr="pie",IB=te(),YA=(function(t){L(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.init=function(r){t.prototype.init.apply(this,arguments),this.legendVisualProvider=new HA(J(this.getData,this),J(this.getRawData,this)),this._defaultLabelLine(r)},e.prototype.mergeOption=function(){t.prototype.mergeOption.apply(this,arguments)},e.prototype.getInitialData=function(){return Cy(this,{coordDimensions:["value"],encodeDefaulter:be(Jb,this)})},e.prototype.getDataParams=function(r){var i=this.getData(),n=IB(i),a=n.seats;if(!a){var o=[];i.each(i.mapDimension("value"),function(l){o.push(l)}),a=n.seats=Yv(o,i.hostModel.get("percentPrecision"))}var s=t.prototype.getDataParams.call(this,r);return s.percent=a[r]||0,s.$vars.push("percent"),s},e.prototype._defaultLabelLine=function(r){ml(r,"labelLine",["show"]);var i=r.labelLine,n=r.emphasis.labelLine;i.show=i.show&&r.label.show,n.show=n.show&&r.emphasis.label.show},e.type="series."+jr,e.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",center:["50%","50%"],radius:[0,"50%"],clockwise:!0,startAngle:90,endAngle:"auto",padAngle:0,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,coordinateSystemUsage:"box",left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:"truncate",position:"outer",alignTo:"none",edgeDistance:"25%",distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:30,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1,borderJoin:"round"},showEmptyCircle:!0,emptyCircleStyle:{color:"lightgray",opacity:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},e})(Tt);Gb({fullType:YA.type,getCoord2:function(t){return t.getShallow("center")}});var WA=YA;var OB=Math.PI/180;function XA(t,e,r,i,n,a,o,s,l,u){if(t.length<2)return;function f(d){for(var m=d.rB,g=m*m,y=0;yr?g:m,S=Math.abs(_.label.y-r);if(S>=x.maxY){var b=_.label.x-e-_.len2*n,w=i+_.len,A=Math.abs(b)t.unconstrainedWidth?null:p:null;i.setStyle("width",h)}KA(a,i)}}}function KA(t,e){ZA.rect=t,iy(ZA,e,PB)}var PB={minMarginForce:[null,0,null,0],marginDefault:[1,0,1,0]},ZA={};function Ay(t){return t.position==="center"}function Dy(t){var e=t.getData(),r=[],i,n,a=!1,o=(t.get("minShowLabelAngle")||0)*OB,s=e.getLayout("viewRect"),l=e.getLayout("r"),u=s.width,f=s.x,c=s.y,p=s.height;function h(b){b.ignore=!0}function v(b){if(!b.ignore)return!0;for(var w in b.states)if(b.states[w].ignore===!1)return!0;return!1}e.each(function(b){var w=e.getItemGraphicEl(b),A=w.shape,C=w.getTextContent(),D=w.getTextGuideLine(),E=e.getItemModel(b),I=E.getModel("label"),M=I.get("position")||E.get(["emphasis","label","position"]),O=I.get("distanceToLabelLine"),N=I.get("alignTo"),R=we(I.get("edgeDistance"),u),F=I.get("bleedMargin");F==null&&(F=Math.min(u,p)>200?10:2);var B=E.getModel("labelLine"),V=B.get("length");V=we(V,u);var H=B.get("length2");if(H=we(H,u),Math.abs(A.endAngle-A.startAngle)0?"right":"left":Q>0?"left":"right"}var Lr=Math.PI,Ft=0,Pr=I.get("rotate");if(se(Pr))Ft=Pr*(Lr/180);else if(M==="center")Ft=0;else if(Pr==="radial"||Pr===!0){var fo=Q<0?-Z+Lr:-Z;Ft=fo}else if(Pr==="tangential"||Pr==="tangential-noflip"&&M!=="outside"&&M!=="outer"){var Nr=Math.atan2(Q,ee);Nr<0&&(Nr=Lr*2+Nr);var Uu=ee>0;Uu&&Pr!=="tangential-noflip"&&(Nr=Lr+Nr),Ft=Nr-Lr}if(a=!!Ft,C.x=j,C.y=ce,C.rotation=Ft,C.setStyle({verticalAlign:"middle"}),Fe){C.setStyle({align:He});var Lh=C.states.select;Lh&&(Lh.x+=C.x,Lh.y+=C.y)}else{var co=new ae(0,0,0,0);KA(co,C),r.push({label:C,labelLine:D,position:M,len:V,len2:H,minTurnAngle:B.get("minTurnAngle"),maxSurfaceAngle:B.get("maxSurfaceAngle"),surfaceNormal:new le(Q,ee),linePoints:ye,textAlign:He,labelDistance:O,labelAlignTo:N,edgeDistance:R,bleedMargin:F,rect:co,unconstrainedWidth:co.width,labelStyleWidth:C.style.width})}w.setTextConfig({inside:Fe})}}),!a&&t.get("avoidLabelOverlap")&&LB(r,i,n,l,u,p,f,c);for(var d=0;dB?(H=O+w*B/2,Z=H):(H=O+C,Z=V-C),i.setItemLayout(F,{angle:B,startAngle:H,endAngle:Z,clockwise:_,cx:o,cy:s,r0:u,r:x?Le(R,b,[u,l]):l}),O=V}),I0){for(var f=o.getItemLayout(0),c=1;isNaN(f&&f.startAngle)&&c=a.r0}},e.type=jr,e})(ft),JA=kB;function My(t){return{seriesType:t,reset:function(e,r){var i=e.getData();i.filterSelf(function(n){var a=i.mapDimension("value"),o=i.get(a,n);return!(se(o)&&!isNaN(o)&&o<0)})}}}function Iy(t){t.registerChartView(JA),t.registerSeriesModel(WA),m1(jr,t.registerAction),t.registerLayout(QA),t.registerProcessor(wy(jr)),t.registerProcessor(My(jr))}var ch=(function(t){L(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",We).models[0]},e.type="cartesian2dAxis",e})(Se);ct(ch,Vp);var $A={show:!0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:"auto",onZeroAxisIndex:null,lineStyle:{color:K.color.axisLine,width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15],breakLine:!0},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12,color:K.color.axisLabel,textMargin:[0,3]},splitLine:{show:!0,showMinLine:!0,showMaxLine:!0,lineStyle:{color:K.color.axisSplitLine,width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:[K.color.backgroundTint,K.color.backgroundTransparent]}},breakArea:{show:!0,itemStyle:{color:K.color.neutral00,borderColor:K.color.border,borderWidth:1,borderType:[3,3],opacity:.6},zigzagAmplitude:4,zigzagMinSpan:4,zigzagMaxSpan:20,zigzagZ:100,expandOnClick:!0},breakLabelLayout:{moveOverlap:"auto"}},BB=he({boundaryGap:!0,deduplication:null,jitter:0,jitterOverlap:!0,jitterMargin:2,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto",show:"auto"},axisLabel:{interval:"auto"}},$A),Oy=he({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:K.color.axisMinorSplitLine,width:1}}},$A),zB=he({splitNumber:6,axisLabel:{rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},Oy),UB=re({logBase:10},Oy),eD={category:BB,value:Oy,time:zB,log:UB};function ph(t,e,r,i){T(Np,function(n,a){var o=he(he({},eD[a],!0),i,!0),s=(function(l){L(u,l);function u(){var f=l!==null&&l.apply(this,arguments)||this;return f.type=e+"Axis."+a,f}return u.prototype.mergeDefaultAndTheme=function(f,c){var p=Sn(this),h=p?Dr(f):{},v=c.getTheme();he(f,v.get(a+"Axis")),he(f,this.getDefaultOption()),f.type=tD(f),p&&pr(f,h,p)},u.prototype.optionUpdated=function(){var f=this.option;f.type==="category"&&(this.__ordinalMeta=su.createByAxisModel(this))},u.prototype.getCategories=function(f){var c=this.option;if(c.type==="category")return f?c.data:this.__ordinalMeta.categories},u.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},u.prototype.updateAxisBreaks=function(f){var c=ro();return c?c.updateModelAxisBreak(this,f):{breaks:[]}},u.type=e+"Axis."+a,u.defaultOption=o,u})(r);t.registerComponentModel(s)}),t.registerSubTypeDefaulter(e+"Axis",tD)}function tD(t){return t.type||(t.data?"category":"value")}var FB=(function(){function t(e){this.type="cartesian",this._dimList=[],this._axes={},this.name=e||""}return t.prototype.getAxis=function(e){return this._axes[e]},t.prototype.getAxes=function(){return z(this._dimList,function(e){return this._axes[e]},this)},t.prototype.getAxesByScale=function(e){return e=e.toLowerCase(),Ae(this.getAxes(),function(r){return r.scale.type===e})},t.prototype.addAxis=function(e){var r=e.dim;this._axes[r]=e,this._dimList.push(r)},t})(),rD=FB;var xu=["x","y"];function iD(t){return(t.type==="interval"||t.type==="time")&&!Ra(t)}var VB=(function(t){L(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=Ir,r.dimensions=xu,r}return e.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var r=this.getAxis("x").scale,i=this.getAxis("y").scale;if(!(!iD(r)||!iD(i))){var n=$a(r,null),a=$a(i,null),o=this.dataToPoint([n[0],a[0]]),s=this.dataToPoint([n[1],a[1]]),l=n[1]-n[0],u=a[1]-a[0];if(!(!l||!u)){var f=(s[0]-o[0])/l,c=(s[1]-o[1])/u,p=o[0]-n[0]*f,h=o[1]-a[0]*c,v=this._transform=[f,0,0,c,p,h];this._invTransform=tr([],v)}}},e.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},e.prototype.containPoint=function(r){var i=this.getAxis("x"),n=this.getAxis("y");return i.contain(i.toLocalCoord(r[0]))&&n.contain(n.toLocalCoord(r[1]))},e.prototype.containData=function(r){return this.getAxis("x").containData(r[0])&&this.getAxis("y").containData(r[1])},e.prototype.containZone=function(r,i){var n=this.dataToPoint(r),a=this.dataToPoint(i),o=this.getArea(),s=new ae(n[0],n[1],a[0]-n[0],a[1]-n[1]);return o.intersect(s)},e.prototype.dataToPoint=function(r,i,n){n=n||[];var a=r[0],o=r[1];if(this._transform&&a!=null&&isFinite(a)&&o!=null&&isFinite(o))return Qe(n,r,this._transform);var s=this.getAxis("x"),l=this.getAxis("y");return n[0]=s.toGlobalCoord(s.dataToCoord(a,i)),n[1]=l.toGlobalCoord(l.dataToCoord(o,i)),n},e.prototype.clampData=function(r,i){var n=this.getAxis("x").scale,a=this.getAxis("y").scale,o=n.getExtent(),s=a.getExtent(),l=n.parse(r[0]),u=a.parse(r[1]);return i=i||[],i[0]=Math.min(Math.max(Math.min(o[0],o[1]),l),Math.max(o[0],o[1])),i[1]=Math.min(Math.max(Math.min(s[0],s[1]),u),Math.max(s[0],s[1])),i},e.prototype.pointToData=function(r,i,n){if(n=n||[],this._invTransform)return Qe(n,r,this._invTransform);var a=this.getAxis("x"),o=this.getAxis("y");return n[0]=a.coordToData(a.toLocalCoord(r[0]),i),n[1]=o.coordToData(o.toLocalCoord(r[1]),i),n},e.prototype.getOtherAxis=function(r){return this.getAxis(r.dim==="x"?"y":"x")},e.prototype.getArea=function(r){r=r||0;var i=this.getAxis("x").getGlobalExtent(),n=this.getAxis("y").getGlobalExtent(),a=Math.min(i[0],i[1])-r,o=Math.min(n[0],n[1])-r,s=Math.max(i[0],i[1])-a+r,l=Math.max(n[0],n[1])-o+r;return new ae(a,o,s,l)},e})(rD),nD=VB;function aD(t,e){var r=t.scale,i=t.model,n=Xp(r,i,i.ecModel,t,null),a=yi(r),o=yi(e)?e.intervalStub:e,s=a?r.intervalStub:r,l=r.base,u=o.getTicks(),f=o.getTicks({expandToNicedExtent:!0}),c=u.length-1,p,h,v;if(c===1)p=h=0,v=1;else if(c===2){var d=Ie(u[0].value-u[1].value),m=Ie(u[1].value-u[2].value);p=h=0,d===m?v=2:(v=1,d=w[1])return!0})):x[1]?(C=w[1],O(function(){if(B(),M=de(I-D*v,E),N(),A<=w[0])return!0})):O(function(){M=de(ri(w[0]/D)*D,E),I=de(Wt(w[1]/D)*D,E);var Q=Yt((I-M)/D);if(Q<=v){var ee=v-Q,j=void 0,ce=n.incl0||a;if(ce&&w[0]===0)j=[0,ee];else if(ce&&w[1]===0)j=[ee,0];else{var ye=Wt(ee/2);j=ee%2===0?[ye,ye]:A+C=w[1])return!0}})}Up(r,x,b,[A,C],S,{interval:D,intervalCount:v,intervalPrecision:E,niceExtent:[M,I]})}var oD=[[3,1],[0,2]],GB=(function(){function t(e,r,i){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=xu,this._initCartesian(e,r,i),this.model=e}return t.prototype.getRect=function(){return this._rect},t.prototype.update=function(e,r){var i=this._axesMap;T(this._axesList,function(o){Wp(o,iC);var s=o.scale;Ze(s)&&s.setSortInfo(o.model.get("categorySortInfo"))});function n(o){for(var s=ne(o),l=[],u=s.length-1;u>=0;u--){var f=o[+s[u]];f.__alignTo?l.push(f):Vg(f)}T(l,function(c){YB(c,c.__alignTo)?Vg(c):aD(c,c.__alignTo.scale)})}n(i.x),n(i.y);var a={};T(i.x,function(o){sD(i,"y",o,a)}),T(i.y,function(o){sD(i,"x",o,a)}),this.resize(this.model,r)},t.prototype.resize=function(e,r,i){var n=za(e,r),a=this._rect=jt(e.getBoxLayoutParams(),n.refContainer),o=this._axesMap,s=this._coordsList,l=e.get("containLabel");if(Ly(o,a),!i){var u=XB(a,s,o,l,r),f=void 0;if(l)cD?(cD(this._axesList,a),Ly(o,a)):f=pD(a.clone(),"axisLabel",null,a,o,u,n);else{var c=ZB(e,a,n),p=c.outerBoundsRect,h=c.parsedOuterBoundsContain,v=c.outerBoundsClamp;p&&(f=pD(p,h,v,a,o,u,n))}hD(a,o,Jt.determine,null,f,n),T(this._coordsList,function(d){d.calcAffineTransform()})}},t.prototype.getAxis=function(e,r){var i=this._axesMap[e];if(i!=null)return i[r||0]},t.prototype.getAxes=function(){return this._axesList.slice()},t.prototype.getCartesian=function(e,r){if(e!=null&&r!=null){var i="x"+e+"y"+r;return this._coordsMap[i]}Y(e)&&(r=e.yAxisIndex,e=e.xAxisIndex);for(var n=0,a=this._coordsList;n=0;n--){var a=t[+e[n]];Dp(a.scale)&&Pg(a.model,a.type,!0)==null&&(a.model.get("alignTicks")&&a.model.get("interval")==null?i.push(a):r=a)}r||(r=i.pop()),r&&T(i,function(o){o.__alignTo=r})}function YB(t,e){return Ra(t.scale)||Ra(e.scale)||e.scale.getTicks().length<2}function WB(t,e){var r=t.getExtent(),i=r[0]+r[1];t.toGlobalCoord=t.dim==="x"?function(n){return n+e}:function(n){return i-n+e},t.toLocalCoord=t.dim==="x"?function(n){return n-e}:function(n){return i-n+e}}function Ly(t,e){T(t.x,function(r){return fD(r,e.x,e.width)}),T(t.y,function(r){return fD(r,e.y,e.height)})}function fD(t,e,r){var i=[0,r],n=t.inverse?1:0;t.setExtent(i[n],i[1-n]),WB(t,e)}var cD;function pD(t,e,r,i,n,a,o){hD(i,n,Jt.estimate,e,!1,o);var s=[0,0,0,0];u(0),u(1),f(i,0,NaN),f(i,1,NaN);var l=Fh(s,function(p){return p>0})==null;return Jo(i,s,!0,!0,r),Ly(n,i),l;function u(p){T(n[pi[p]],function(h){if(to(h.model)){var v=a.ensureRecord(h.model),d=v.labelInfoList;if(d)for(var m=0;m0&&!Si(h)&&h>1e-4&&(p/=h),p}}function XB(t,e,r,i,n){var a=new vy(qB);return T(r,function(o){return T(o,function(s){if(to(s.model)){var l=!i;s.axisBuilder=vA(t,e,s.model,n,a,l)}})}),a}function hD(t,e,r,i,n,a){var o=r===Jt.determine;T(e,function(u){return T(u,function(f){to(f.model)&&(dA(f.axisBuilder,t,f.model),f.axisBuilder.build(o?{axisTickLabelDetermine:!0}:{axisTickLabelEstimate:!0},{noPxChange:n}))})});var s={x:0,y:0};l(0),l(1);function l(u){s[pi[1-u]]=t[gn[u]]<=a.refContainer[gn[u]]*.5?0:1-u===1?2:1}T(e,function(u,f){return T(u,function(c){to(c.model)&&((i==="all"||o)&&c.axisBuilder.build({axisName:!0},{nameMarginLevel:s[f]}),o&&c.axisBuilder.build({axisLine:!0}))})})}function ZB(t,e,r){var i,n=t.get("outerBoundsMode",!0);n==="same"?i=e.clone():(n==null||n==="auto")&&(i=jt(t.get("outerBounds",!0)||yy,r.refContainer));var a=t.get("outerBoundsContain",!0),o;a==null||a==="auto"||ie(["all","axisLabel"],a)<0?o="all":o=a;var s=[If(W(t.get("outerBoundsClampWidth",!0),_u[0]),e.width),If(W(t.get("outerBoundsClampHeight",!0),_u[1]),e.height)];return{outerBoundsRect:i,parsedOuterBoundsContain:o,outerBoundsClamp:s}}var qB=function(t,e,r,i,n,a){var o=r.axis.dim==="x"?"y":"x";dy(t,e,r,i,n,a),En(t.nameLocation)||T(e.recordMap[o],function(s){s&&s.labelInfoList&&s.dirVec&&my(s.labelInfoList,s.dirVec,i,n)})},vD=GB;function dD(t,e){var r={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return KB(r,t,e),r.seriesInvolved&&QB(r,t),r}function KB(t,e,r){var i=e.getComponent("tooltip"),n=e.getComponent("axisPointer"),a=n.get("link",!0)||[],o=[];T(r.getCoordinateSystems(),function(s){if(!s.axisPointerEnabled)return;var l=Rs(s.model),u=t.coordSysAxesInfo[l]={};t.coordSysMap[l]=s;var f=s.model,c=f.getModel("tooltip",i);if(T(s.getAxes(),be(d,!1,null)),s.getTooltipAxes&&i&&c.get("show")){var p=c.get("trigger")==="axis",h=c.get(["axisPointer","type"])==="cross",v=s.getTooltipAxes(c.get(["axisPointer","axis"]));(p||h)&&T(v.baseAxes,be(d,h?"cross":!0,p)),h&&T(v.otherAxes,be(d,"cross",!1))}function d(m,g,y){var _=y.model.getModel("axisPointer",n),x=_.get("show");if(!(!x||x==="auto"&&!m&&!Ny(_))){g==null&&(g=_.get("triggerTooltip")),_=m?jB(y,c,n,e,m,g):_;var S=_.get("snap"),b=_.get("triggerEmphasis"),w=Rs(y.model),A=g||S||y.type==="category",C=t.axesInfo[w]={key:w,axis:y,coordSys:s,axisPointerModel:_,triggerTooltip:g,triggerEmphasis:b,involveSeries:A,snap:S,useHandle:Ny(_),seriesModels:[],linkGroup:null};u[w]=C,t.seriesInvolved=t.seriesInvolved||A;var D=JB(a,y);if(D!=null){var E=o[D]||(o[D]={axesInfo:{}});E.axesInfo[w]=C,E.mapper=a[D].mapper,C.linkGroup=E}}}})}function jB(t,e,r,i,n,a){var o=e.getModel("axisPointer"),s=["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],l={};T(s,function(p){l[p]=$(o.get(p))}),l.snap=t.type!=="category"&&!!a,o.get("type")==="cross"&&(l.type="line");var u=l.label||(l.label={});if(u.show==null&&(u.show=!1),n==="cross"){var f=o.get(["label","show"]);if(u.show=f!=null?f:!0,!a){var c=l.lineStyle=o.get("crossStyle");c&&re(u,c.textStyle)}}return t.model.getModel("axisPointer",new Ce(l,r,i))}function QB(t,e){e.eachSeries(function(r){var i=r.coordinateSystem,n=r.get(["tooltip","trigger"],!0),a=r.get(["tooltip","show"],!0);!i||!i.model||n==="none"||n===!1||n==="item"||a===!1||r.get(["axisPointer","show"],!0)===!1||T(t.coordSysAxesInfo[Rs(i.model)],function(o){var s=o.axis;i.getAxis(s.dim)===s&&(o.seriesModels.push(r),o.seriesDataCount==null&&(o.seriesDataCount=0),o.seriesDataCount+=r.getData().count())})})}function JB(t,e){for(var r=e.model,i=e.dim,n=0;n=0||t===e}function mD(t){var e=hh(t);if(e){var r=e.axisPointerModel,i=e.axis.scale,n=r.option,a=r.get("status"),o=r.get("value");o!=null&&(o=i.parse(o));var s=Ny(r);a==null&&(n.status=s?"show":"hide");var l=i.getExtent();(o==null||o>l[1])&&(o=l[1]),o3?1.4:o>1?1.2:1.1,f=a>0?u:1/u;this._checkTriggerMoveZoom(this,"zoom","zoomOnMouseWheel",r,{scale:f,originX:s,originY:l,isAvailableBehavior:null})}if(n){var c=Math.abs(a),p=(a>0?1:-1)*(c>3?.4:c>1?.15:.05);this._checkTriggerMoveZoom(this,"scrollMove","moveOnMouseWheel",r,{scrollDelta:p,originX:s,originY:l,isAvailableBehavior:null})}}}},e.prototype._pinchHandler=function(r){if(!(zy(this._zr,"globalPan")||Su(r))){var i=r.pinchScale>1?1.1:1/1.1;this._checkTriggerMoveZoom(this,"zoom",null,r,{scale:i,originX:r.pinchX,originY:r.pinchY,isAvailableBehavior:null})}},e.prototype._checkTriggerMoveZoom=function(r,i,n,a,o){r._checkPointer(a,o.originX,o.originY)&&(Qr(a.event),a.__ecRoamConsumed=!0,AD(r,i,n,a,o))},e})(_t);function Su(t){return t.__ecRoamConsumed}var sz=te();function mh(t){var e=sz(t);return e.roam=e.roam||{},e.uniform=e.uniform||{},e}function bu(t,e,r,i){for(var n=mh(t),a=n.roam,o=a[e]=a[e]||[],s=0;sa&&(e[1-i]=Ei(e[i],c.sign*a)),e}function Uy(t,e){var r=t[e]-t[1-e];return{span:Math.abs(r),sign:r>0?-1:r<0?1:e?-1:1}}function ks(t,e){return Math.min(e[1]!=null?e[1]:1/0,Math.max(e[0]!=null?e[0]:-1/0,t))}var oo=te(),ED=$,Fy=J,fz=(function(){function t(){this._dragging=!1,this.animationThreshold=15}return t.prototype.render=function(e,r,i,n){var a=r.get("value"),o=r.get("status");if(this._axisModel=e,this._axisPointerModel=r,this._api=i,!(!n&&this._lastValue===a&&this._lastStatus===o)){this._lastValue=a,this._lastStatus=o;var s=this._group,l=this._handle;if(!o||o==="hide"){s&&s.hide(),l&&l.hide();return}s&&s.show(),l&&l.show();var u={};this.makeElOption(u,a,e,r,i);var f=u.graphicKey;f!==this._lastGraphicKey&&this.clear(i),this._lastGraphicKey=f;var c=this._moveAnimation=this.determineAnimation(e,r);if(!s)s=this._group=new xe,this.createPointerEl(s,u,e,r),this.createLabelEl(s,u,e,r),i.getZr().add(s);else{var p=be(MD,r,c);this.updatePointerEl(s,u,p),this.updateLabelEl(s,u,p,r)}OD(s,r,!0),this._renderHandle(a)}},t.prototype.remove=function(e){this.clear(e)},t.prototype.dispose=function(e){this.clear(e)},t.prototype.determineAnimation=function(e,r){var i=r.get("animation"),n=e.axis,a=n.type==="category",o=r.get("snap");if(!o&&!a)return!1;if(i==="auto"||i==null){var s=this.animationThreshold;if(a&&qr(n).w>s)return!0;if(o){var l=hh(e).seriesDataCount,u=n.getExtent();return Math.abs(u[0]-u[1])/l>s}return!1}return i===!0},t.prototype.makeElOption=function(e,r,i,n,a){},t.prototype.createPointerEl=function(e,r,i,n){var a=r.pointer;if(a){var o=oo(e).pointerEl=new lt[a.type](ED(r.pointer));e.add(o)}},t.prototype.createLabelEl=function(e,r,i,n){if(r.label){var a=oo(e).labelEl=new De(ED(r.label));e.add(a),ID(a,n)}},t.prototype.updatePointerEl=function(e,r,i){var n=oo(e).pointerEl;n&&r.pointer&&(n.setStyle(r.pointer.style),i(n,{shape:r.pointer.shape}))},t.prototype.updateLabelEl=function(e,r,i,n){var a=oo(e).labelEl;a&&(a.setStyle(r.label.style),i(a,{x:r.label.x,y:r.label.y}),ID(a,n))},t.prototype._renderHandle=function(e){if(!(this._dragging||!this.updateHandleTransform)){var r=this._axisPointerModel,i=this._api.getZr(),n=this._handle,a=r.getModel("handle"),o=r.get("status");if(!a.get("show")||!o||o==="hide"){n&&i.remove(n),this._handle=null;return}var s;this._handle||(s=!0,n=this._handle=Ia(a.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(u){Qr(u.event)},onmousedown:Fy(this._onHandleDragMove,this,0,0),drift:Fy(this._onHandleDragMove,this),ondragend:Fy(this._onHandleDragEnd,this)}),i.add(n)),OD(n,r,!1),n.setStyle(a.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var l=a.get("size");k(l)||(l=[l,l]),n.scaleX=l[0]/2,n.scaleY=l[1]/2,Cn(this,"_doDispatchAxisPointer",a.get("throttle")||0,"fixRate"),this._moveHandleToValue(e,s)}},t.prototype._moveHandleToValue=function(e,r){MD(this._axisPointerModel,!r&&this._moveAnimation,this._handle,Vy(this.getHandleTransform(e,this._axisModel,this._axisPointerModel)))},t.prototype._onHandleDragMove=function(e,r){var i=this._handle;if(i){this._dragging=!0;var n=this.updateHandleTransform(Vy(i),[e,r],this._axisModel,this._axisPointerModel);this._payloadInfo=n,i.stopAnimation(),i.attr(Vy(n)),oo(i).lastProp=null,this._doDispatchAxisPointer()}},t.prototype._doDispatchAxisPointer=function(){var e=this._handle;if(e){var r=this._payloadInfo,i=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:r.cursorPoint[0],y:r.cursorPoint[1],tooltipOption:r.tooltipOption,axesInfo:[{axisDim:i.axis.dim,axisIndex:i.componentIndex}]})}},t.prototype._onHandleDragEnd=function(){this._dragging=!1;var e=this._handle;if(e){var r=this._axisPointerModel.get("value");this._moveHandleToValue(r),this._api.dispatchAction({type:"hideTip"})}},t.prototype.clear=function(e){this._lastValue=null,this._lastStatus=null;var r=e.getZr(),i=this._group,n=this._handle;r&&i&&(this._lastGraphicKey=null,i&&r.remove(i),n&&r.remove(n),this._group=null,this._handle=null,this._payloadInfo=null),Za(this,"_doDispatchAxisPointer")},t.prototype.doClear=function(){},t.prototype.buildLabel=function(e,r,i){return i=i||0,{x:e[i],y:e[1-i],width:r[i],height:r[1-i]}},t})();function MD(t,e,r,i){LD(oo(r).lastProp,i)||(oo(r).lastProp=i,e?Be(r,i,t):(r.stopAnimation(),r.attr(i)))}function LD(t,e){if(Y(t)&&Y(e)){var r=!0;return T(e,function(i,n){r=r&&LD(t[n],i)}),!!r}else return t===e}function ID(t,e){t[e.get(["label","show"])?"show":"hide"]()}function Vy(t){return{x:t.x||0,y:t.y||0,rotation:t.rotation||0}}function OD(t,e,r){var i=e.get("z"),n=e.get("zlevel");t&&t.traverse(function(a){a.type!=="group"&&(i!=null&&(a.z=i),n!=null&&(a.zlevel=n),a.silent=r)})}var PD=fz;function ND(t){var e=t.get("type"),r=t.getModel(e+"Style"),i;return e==="line"?(i=r.getLineStyle(),i.fill=null):e==="shadow"&&(i=r.getAreaStyle(),i.stroke=null),i}function cz(t,e,r,i,n){var a=r.get("value"),o=Gy(a,e.axis,e.ecModel,r.get("seriesDataIndices"),{precision:r.get(["label","precision"]),formatter:r.get(["label","formatter"])}),s=r.getModel("label"),l=di(s.get("padding")||0),u=s.getFont(),f=bf(o,u),c=n.position,p=f.width+l[1]+l[3],h=f.height+l[0]+l[2],v=n.align;v==="right"&&(c[0]-=p),v==="center"&&(c[0]-=p/2);var d=n.verticalAlign;d==="bottom"&&(c[1]-=h),d==="middle"&&(c[1]-=h/2),pz(c,p,h,i);var m=s.get("backgroundColor");(!m||m==="auto")&&(m=e.get(["axisLine","lineStyle","color"])),t.label={x:c[0],y:c[1],style:fr(s,{text:o,font:u,fill:s.getTextColor(),padding:l,backgroundColor:m}),z2:10}}function pz(t,e,r,i){var n=i.getWidth(),a=i.getHeight();t[0]=Math.min(t[0]+e,n)-e,t[1]=Math.min(t[1]+r,a)-r,t[0]=Math.max(t[0],0),t[1]=Math.max(t[1],0)}function Gy(t,e,r,i,n){t=e.scale.parse(t);var a=e.scale.getLabel({value:t},{precision:n.precision}),o=n.formatter;if(o){var s={value:Is(e,{value:t}),axisDimension:e.dim,axisIndex:e.index,seriesData:[]};T(i,function(l){var u=r.getSeriesByIndex(l.seriesIndex),f=l.dataIndexInside,c=u&&u.getDataParams(f);c&&s.seriesData.push(c)}),U(o)?a=o.replace("{value}",a):X(o)&&(a=o(s))}return a}function Hy(t,e,r){var i=xt();return Wn(i,i,r.rotation),yo(i,i,r.position),Ma([t.dataToCoord(e),(r.labelOffset||0)+(r.labelDirection||1)*(r.labelMargin||0)],i)}function RD(t,e,r,i,n,a){var o=oh.innerTextLayout(r.rotation,0,r.labelDirection);r.labelMargin=n.get(["label","margin"]),cz(e,i,n,a,{position:Hy(i.axis,t,r),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function kD(t,e,r){return r=r||0,{x1:t[r],y1:t[1-r],x2:e[r],y2:e[1-r]}}function BD(t,e,r){return r=r||0,{x:t[r],y:t[1-r],width:e[r],height:e[1-r]}}function zD(t,e,r){return qr(t,{fromStat:{sers:z(e,function(i){return r.getSeriesByIndex(i.seriesIndex)})},min:1}).w}function UD(t,e,r){return[ve(Ne(e[0],e[1]),t-r/2),Ne(t+r/2,ve(e[0],e[1]))]}var hz=(function(t){L(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.makeElOption=function(r,i,n,a,o){var s=n.axis,l=s.grid,u=a.get("type"),f=s.getGlobalExtent(),c=VD(l,s).getOtherAxis(s).getGlobalExtent(),p=s.toGlobalCoord(s.dataToCoord(i,!0));if(u&&u!=="none"){var h=ND(a),v=vz[u](s,p,f,c,a.get("seriesDataIndices"),a.ecModel);v.style=h,r.graphicKey=v.type,r.pointer=v}var d=gu(l.getRect(),n);RD(i,r,d,n,a,o)},e.prototype.getHandleTransform=function(r,i,n){var a=gu(i.axis.grid.getRect(),i,{labelInside:!1});a.labelMargin=n.get(["handle","margin"]);var o=Hy(i.axis,r,a);return{x:o[0],y:o[1],rotation:a.rotation+(a.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(r,i,n,a){var o=n.axis,s=o.grid,l=o.getGlobalExtent(!0),u=VD(s,o).getOtherAxis(o).getGlobalExtent(),f=o.dim==="x"?0:1,c=[r.x,r.y];c[f]+=i[f],c[f]=Ne(l[1],c[f]),c[f]=ve(l[0],c[f]);var p=(u[1]+u[0])/2,h=[p,p];h[f]=c[f];var v=[{verticalAlign:"middle"},{align:"center"}];return{x:c[0],y:c[1],rotation:r.rotation,cursorPoint:h,tooltipOption:v[f]}},e})(PD);function VD(t,e){var r={};return r[e.dim+"AxisIndex"]=e.index,t.getCartesian(r)}var vz={line:function(t,e,r,i){var n=kD([e,i[0]],[e,i[1]],GD(t));return{type:"Line",subPixelOptimize:!0,shape:n}},shadow:function(t,e,r,i,n,a){var o=zD(t,n,a),s=i[1]-i[0],l=UD(e,r,o),u=l[0],f=l[1];return{type:"Rect",shape:BD([u,i[0]],[f-u,s],GD(t))}}};function GD(t){return t.dim==="x"?0:1}var HD=hz;var dz=(function(t){L(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="axisPointer",e.defaultOption={show:"auto",z:50,type:"line",snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:K.color.border,width:1,type:"dashed"},shadowStyle:{color:K.color.shadowTint},label:{show:!0,formatter:null,precision:"auto",margin:3,color:K.color.neutral00,padding:[5,7,5,7],backgroundColor:K.color.accent60,borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",size:45,margin:50,color:K.color.accent40,throttle:40}},e})(Se),YD=dz;var Wi=te(),mz=T;function gh(t,e,r){if(!oe.node){var i=e.getZr();Wi(i).records||(Wi(i).records={}),gz(i,e);var n=Wi(i).records[t]||(Wi(i).records[t]={});n.handler=r}}function gz(t,e){if(Wi(t).initialized)return;Wi(t).initialized=!0,r("click",be(Yy,"click")),r("mousemove",be(Yy,"mousemove")),r("mousewheel",be(Yy,"mousewheel")),r("globalout",_z);function r(i,n){t.on(i,function(a){var o=xz(e);mz(Wi(t).records,function(s){s&&n(s,a,o.dispatchAction)}),yz(o.pendings,e)})}}function yz(t,e){var r=t.showTip.length,i=t.hideTip.length,n;r?n=t.showTip[r-1]:i&&(n=t.hideTip[i-1]),n&&(n.dispatchAction=null,e.dispatchAction(n))}function _z(t,e,r){t.handler("leave",null,r)}function Yy(t,e,r,i){e.handler(t,r,i)}function xz(t){var e={showTip:[],hideTip:[]},r=function(i){var n=e[i.type];n?n.push(i):(i.dispatchAction=r,t.dispatchAction(i))};return{dispatchAction:r,pendings:e}}function wu(t,e){if(!oe.node){var r=e.getZr(),i=(Wi(r).records||{})[t];i&&(Wi(r).records[t]=null)}}var Sz=(function(t){L(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.render=function(r,i,n){var a=i.getComponent("tooltip"),o=r.get("triggerOn")||a&&a.get("triggerOn")||"mousemove|click|mousewheel";gh("axisPointer",n,function(s,l,u){o!=="none"&&(s==="leave"||o.indexOf(s)>=0)&&u({type:"updateAxisPointer",currTrigger:s,x:l&&l.offsetX,y:l&&l.offsetY})})},e.prototype.remove=function(r,i){wu("axisPointer",i)},e.prototype.dispose=function(r,i){wu("axisPointer",i)},e.type="axisPointer",e})(et),XD=Sz;function Cu(t,e){var r=[],i=t.seriesIndex,n;if(i==null||!(n=e.getSeriesByIndex(i)))return{point:[]};var a=n.getData(),o=br(a,t);if(o==null||o<0||k(o))return{point:[]};var s=a.getItemGraphicEl(o),l=n.coordinateSystem;if(n.getTooltipPosition)r=n.getTooltipPosition(o)||[];else if(l&&l.dataToPoint)if(t.isStacked){var u=l.getBaseAxis(),f=l.getOtherAxis(u),c=f.dim,p=u.dim,h=c==="x"||c==="radius"?1:0,v=a.mapDimension(p),d=[];d[h]=a.get(v,o),d[1-h]=a.get(a.getCalculationInfo("stackResultDimension"),o),r=l.dataToPoint(d)||[]}else r=l.dataToPoint(a.getValues(z(l.dimensions,function(g){return a.mapDimension(g)}),o))||[];else if(s){var m=s.getBoundingRect().clone();m.applyTransform(s.transform),r=[m.x+m.width/2,m.y+m.height/2]}return{point:r,el:s}}var ZD=te();function Wy(t,e,r){var i=t.currTrigger,n=[t.x,t.y],a=t,o=t.dispatchAction||J(r.dispatchAction,r),s=e.getComponent("axisPointer").coordSysAxesInfo;if(s){yh(n)&&(n=Cu({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},e).point);var l=yh(n),u=a.axesInfo,f=s.axesInfo,c=i==="leave"||yh(n),p={},h={},v={list:[],map:{}},d={showPointer:be(Tz,h),showTooltip:be(wz,v)};T(s.coordSysMap,function(g,y){var _=l||g.containPoint(n);T(s.coordSysAxesInfo[y],function(x,S){var b=x.axis,w=Ez(u,x);if(!c&&_&&(!u||w)){var A=w&&w.value;A==null&&!l&&(A=b.pointToData(n)),A!=null&&qD(x,A,d,!1,p)}})});var m={};return T(f,function(g,y){var _=g.linkGroup;_&&!h[y]&&T(_.axesInfo,function(x,S){var b=h[S];if(x!==g&&b){var w=b.value;_.mapper&&(w=g.axis.scale.parse(_.mapper(w,KD(x),KD(g)))),m[g.key]=w}})}),T(m,function(g,y){qD(f[y],g,d,!0,p)}),Cz(h,f,p),Az(v,n,t,o),Dz(f,o,r),p}}function qD(t,e,r,i,n){var a=t.axis;if(!(a.scale.isBlank()||!a.containData(e))){if(!t.involveSeries){r.showPointer(t,e);return}var o=bz(e,t),s=o.payloadBatch,l=o.snapToValue;s[0]&&n.seriesIndex==null&&P(n,s[0]),!i&&t.snap&&a.containData(l)&&l!=null&&(e=l),r.showPointer(t,e,s),r.showTooltip(t,o,l)}}function bz(t,e){var r=e.axis,i=r.dim,n=t,a=[],o=Number.MAX_VALUE,s=-1;return T(e.seriesModels,function(l,u){var f=l.getData().mapDimensionsAll(i),c,p;if(l.getAxisTooltipData){var h=l.getAxisTooltipData(f,t,r);p=h.dataIndices,c=h.nestestValue}else{if(p=l.indicesOfNearest(i,f[0],t,r.type==="category"?.5:null),!p.length)return;c=l.getData().get(f[0],p[0])}if(tt(c)){var v=t-c,d=Math.abs(v);d<=o&&((d=0&&s<0)&&(o=d,s=v,n=c,a.length=0),T(p,function(m){a.push({seriesIndex:l.seriesIndex,dataIndexInside:m,dataIndex:l.getData().getRawIndex(m)})}))}}),{payloadBatch:a,snapToValue:n}}function Tz(t,e,r,i){t[e.key]={value:r,payloadBatch:i}}function wz(t,e,r,i){var n=r.payloadBatch,a=e.axis,o=a.model,s=e.axisPointerModel;if(!(!e.triggerTooltip||!n.length)){var l=e.coordSys.model,u=Rs(l),f=t.map[u];f||(f=t.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},t.list.push(f)),f.dataByAxis.push({axisDim:a.dim,axisIndex:o.componentIndex,axisType:o.type,axisId:o.id,value:i,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:n.slice()})}}function Cz(t,e,r){var i=r.axesInfo=[];T(e,function(n,a){var o=n.axisPointerModel.option,s=t[a];s?(!n.useHandle&&(o.status="show"),o.value=s.value,o.seriesDataIndices=(s.payloadBatch||[]).slice()):!n.useHandle&&(o.status="hide"),o.status==="show"&&i.push({axisDim:n.axis.dim,axisIndex:n.axis.model.componentIndex,value:o.value})})}function Az(t,e,r,i){if(yh(e)||!t.list.length){i({type:"hideTip"});return}var n=((t.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};i({type:"showTip",escapeConnect:!0,x:e[0],y:e[1],tooltipOption:r.tooltipOption,position:r.position,dataIndexInside:n.dataIndexInside,dataIndex:n.dataIndex,seriesIndex:n.seriesIndex,dataByCoordSys:t.list})}function Dz(t,e,r){var i=r.getZr(),n="axisPointerLastHighlights",a=ZD(i)[n]||{},o=ZD(i)[n]={};T(t,function(f,c){var p=f.axisPointerModel.option;p.status==="show"&&f.triggerEmphasis&&T(p.seriesDataIndices,function(h){o[h.seriesIndex+"|"+h.dataIndex]=h})});var s=[],l=[];function u(f){return{seriesIndex:f.seriesIndex,dataIndex:f.dataIndex}}T(a,function(f,c){!o[c]&&l.push(u(f))}),T(o,function(f,c){!a[c]&&s.push(u(f))}),l.length&&r.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),s.length&&r.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:s})}function Ez(t,e){for(var r=0;r<(t||[]).length;r++){var i=t[r];if(e.axis.dim===i.axisDim&&e.axis.model.componentIndex===i.axisIndex)return i}}function KD(t){var e=t.axis.model,r={},i=r.axisDim=t.axis.dim;return r.axisIndex=r[i+"AxisIndex"]=e.componentIndex,r.axisName=r[i+"AxisName"]=e.name,r.axisId=r[i+"AxisId"]=e.id,r}function yh(t){return!t||t[0]==null||isNaN(t[0])||t[1]==null||isNaN(t[1])}function so(t){vh.registerAxisPointerClass("CartesianAxisPointer",HD),t.registerComponentModel(YD),t.registerComponentView(XD),t.registerPreprocessor(function(e){if(e){(!e.axisPointer||e.axisPointer.length===0)&&(e.axisPointer={});var r=e.axisPointer.link;r&&!k(r)&&(e.axisPointer.link=[r])}}),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,{overallReset:function(e,r){e.getComponent("axisPointer").coordSysAxesInfo=dD(e,r)}}),t.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},Wy)}function Xy(t){yt(wD),yt(so)}var Zy=["x","y","radius","angle","single"],Mz=te(),Iz=["cartesian2d","polar","singleAxis"];function jD(t){var e=t.get("coordinateSystem");return ie(Iz,e)>=0}function Or(t){return t+"Axis"}function QD(t,e){var r=G(),i=[],n=G();t.eachComponent({mainType:"dataZoom",query:e},function(f){n.get(f.uid)||s(f)});var a;do a=!1,t.eachComponent("dataZoom",o);while(a);function o(f){!n.get(f.uid)&&l(f)&&(s(f),a=!0)}function s(f){n.set(f.uid,!0),i.push(f),u(f)}function l(f){var c=!1;return f.eachTargetAxis(function(p,h){var v=r.get(p);v&&v[h]&&(c=!0)}),c}function u(f){f.eachTargetAxis(function(c,p){(r.get(c)||r.set(c,[]))[p]=!0})}return i}function _h(t){var e=t.ecModel,r={infoList:[],infoMap:G()};return t.eachTargetAxis(function(i,n){var a=e.getComponent(Or(i),n);if(a){var o=a.getCoordSysModel();if(o){var s=o.uid,l=r.infoMap.get(s);l||(l={model:o,axisModels:[]},r.infoList.push(l),r.infoMap.set(s,l)),l.axisModels.push(a)}}}),r}function JD(t){var e=Mz(ip(t));return e.axisProxyMap||(e.axisProxyMap=G())}function Bs(t){if(t)return JD(t.ecModel).get(t.uid)}function $D(t,e){JD(t.ecModel).set(t.uid,e)}function xh(t,e){var r=e.getAxisModel().axis.__alignTo;return r&&t.getAxisProxy(r.dim,r.model.componentIndex)?Bs(r.model):null}var qy=(function(){function t(){this.indexList=[],this.indexMap=[]}return t.prototype.add=function(e){this.indexMap[e]||(this.indexList.push(e),this.indexMap[e]=!0)},t})(),Oz=(function(t){L(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r._autoThrottle=!0,r._noTarget=!0,r._rangePropMode=["percent","percent"],r}return e.prototype.init=function(r,i,n){var a=eE(r);this.settledOption=a,this.mergeDefaultAndTheme(r,n),this._doInit(a)},e.prototype.mergeOption=function(r){var i=eE(r);he(this.option,r,!0),he(this.settledOption,i,!0),this._doInit(i)},e.prototype._doInit=function(r){var i=this.option;this._setDefaultThrottle(r),this._updateRangeUse(r);var n=this.settledOption;T([["start","startValue"],["end","endValue"]],function(a,o){this._rangePropMode[o]==="value"&&(i[a[0]]=n[a[0]]=null)},this),this._resetTarget()},e.prototype._resetTarget=function(){var r=this.get("orient",!0),i=this._targetAxisInfoMap=G(),n=this._fillSpecifiedTargetAxis(i);n?this._orient=r||this._makeAutoOrientByTargetAxis():(this._orient=r||"horizontal",this._fillAutoTargetAxisByOrient(i,this._orient)),this._noTarget=!0,i.each(function(a){a.indexList.length&&(this._noTarget=!1)},this)},e.prototype._fillSpecifiedTargetAxis=function(r){var i=!1;return T(Zy,function(n){var a=this.getReferringComponents(Or(n),mx);if(a.specified){i=!0;var o=new qy;T(a.models,function(s){o.add(s.componentIndex)}),r.set(n,o)}},this),i},e.prototype._fillAutoTargetAxisByOrient=function(r,i){var n=this.ecModel,a=!0;if(a){var o=i==="vertical"?"y":"x",s=n.findComponents({mainType:o+"Axis"});l(s,o)}if(a){var s=n.findComponents({mainType:"singleAxis",filter:function(f){return f.get("orient",!0)===i}});l(s,"single")}function l(u,f){var c=u[0];if(c){var p=new qy;if(p.add(c.componentIndex),r.set(f,p),a=!1,f==="x"||f==="y"){var h=c.getReferringComponents("grid",We).models[0];h&&T(u,function(v){c.componentIndex!==v.componentIndex&&h===v.getReferringComponents("grid",We).models[0]&&p.add(v.componentIndex)})}}}a&&T(Zy,function(u){if(a){var f=n.findComponents({mainType:Or(u),filter:function(p){return p.get("type",!0)==="category"}});if(f[0]){var c=new qy;c.add(f[0].componentIndex),r.set(u,c),a=!1}}},this)},e.prototype._makeAutoOrientByTargetAxis=function(){var r;return this.eachTargetAxis(function(i){!r&&(r=i)},this),r==="y"?"vertical":"horizontal"},e.prototype._setDefaultThrottle=function(r){if(r.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var i=this.ecModel.option;this.option.throttle=i.animation&&i.animationDurationUpdate>0?100:20}},e.prototype._updateRangeUse=function(r){var i=this._rangePropMode,n=this.get("rangeMode");T([["start","startValue"],["end","endValue"]],function(a,o){var s=r[a[0]]!=null,l=r[a[1]]!=null;s&&!l?i[o]="percent":!s&&l?i[o]="value":n?i[o]=n[o]:s&&(i[o]="percent")})},e.prototype.noTarget=function(){return this._noTarget},e.prototype.getFirstTargetAxisModel=function(){var r;return this.eachTargetAxis(function(i,n){r==null&&(r=this.ecModel.getComponent(Or(i),n))},this),r},e.prototype.eachTargetAxis=function(r,i){this._targetAxisInfoMap.each(function(n,a){T(n.indexList,function(o){r.call(i,a,o)})})},e.prototype.getAxisProxy=function(r,i){return Bs(this.getAxisModel(r,i))},e.prototype.getAxisModel=function(r,i){var n=this._targetAxisInfoMap.get(r);if(n&&n.indexMap[i])return this.ecModel.getComponent(Or(r),i)},e.prototype.setRawRange=function(r){var i=this.option,n=this.settledOption;T([["start","startValue"],["end","endValue"]],function(a){(r[a[0]]!=null||r[a[1]]!=null)&&(i[a[0]]=n[a[0]]=r[a[0]],i[a[1]]=n[a[1]]=r[a[1]])},this),this._updateRangeUse(r)},e.prototype.setCalculatedRange=function(r){var i=this.option;T(["start","startValue","end","endValue"],function(n){i[n]=r[n]})},e.prototype.getPercentRange=function(){var r=this.findRepresentativeAxisProxy();if(r)return r.getWindow().percent},e.prototype.getValueRange=function(r,i){if(r==null&&i==null){var n=this.findRepresentativeAxisProxy();if(n)return n.getWindow().value}else return this.getAxisProxy(r,i).getWindow().value},e.prototype.findRepresentativeAxisProxy=function(r){if(r)return Bs(r);for(var i,n=this._targetAxisInfoMap.keys(),a=0;ao[1];if(_&&!x&&!S)return!0;_&&(m=!0),x&&(v=!0),S&&(d=!0)}return m&&v&&d})}else T(f,function(h){if(a==="empty")l.setData(u=u.map(h,function(d){return s(d)?d:NaN}));else{var v={};v[h]=o,u.selectRange(v)}});T(f,function(h){u.setApproximateExtent(o,h)})}});function s(l){return l>=o[0]&&l<=o[1]}},t.prototype._updateMinMaxSpan=function(){var e=this._minMaxSpan={},r=this._dataZoomModel,i=this._extent;T(["min","max"],function(n){var a=r.get(n+"Span"),o=r.get(n+"ValueSpan");o!=null&&(o=this.getAxisModel().axis.scale.parse(o)),o!=null?a=Le(i[0]+o,i,[0,100],!0):a!=null&&(o=Le(a,[0,100],i,!0)-i[0]),e[n+"Span"]=a,e[n+"ValueSpan"]=o},this)},t})(),tE=Pz;var Nz={dirtyOnOverallProgress:!0,getTargetSeries:function(t){function e(n){t.eachComponent("dataZoom",function(a){a.eachTargetAxis(function(o,s){var l=t.getComponent(Or(o),s);n(o,s,l,a)})})}var r=[];e(function(n,a,o,s){if(!Bs(o)){var l=new tE(n,a,s,t);r.push(l),$D(o,l)}});var i=G();return T(r,function(n){T(n.getTargetSeriesModels(),function(a){i.set(a.uid,a)})}),i},overallReset:function(t,e){t.eachComponent("dataZoom",function(r){var i=[];r.eachTargetAxis(function(n,a){var o=r.getAxisProxy(n,a),s=xh(r,o);s?i.push([o,s]):o.reset(r,null)}),T(i,function(n){n[0].reset(r,n[1].getWindow().percentInverted)}),r.eachTargetAxis(function(n,a){r.getAxisProxy(n,a).filterData(r,e)})}),t.eachComponent("dataZoom",function(r){var i=r.findRepresentativeAxisProxy();if(i){var n=i.getWindow(),a=n.percent,o=n.value;r.setCalculatedRange({start:a[0],end:a[1],startValue:o[0],endValue:o[1]})}})}},rE=Nz;function Ky(t){t.registerAction("dataZoom",function(e,r){var i=QD(r,e);T(i,function(n){n.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})})})}var Rz=Bo();function Au(t){Rz(t,function(){t.registerProcessor(t.PRIORITY.PROCESSOR.FILTER,rE),Ky(t),t.registerSubTypeDefaulter("dataZoom",function(){return"slider"})})}function iE(t,e){var r=di(e.get("padding")),i=e.getItemStyle(["color","opacity"]);i.fill=e.get("backgroundColor");var n=new ge({shape:{x:t.x-r[3],y:t.y-r[0],width:t.width+r[1]+r[3],height:t.height+r[0]+r[2],r:e.get("borderRadius")},style:i,silent:!0,z2:-1});return n}var kz=(function(t){L(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="tooltip",e.dependencies=["axisPointer"],e.defaultOption={z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click|mousewheel",alwaysShowContent:!1,renderMode:"auto",confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,displayTransition:!0,enterable:!1,backgroundColor:K.color.neutral00,shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,defaultBorderColor:K.color.border,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:K.color.borderShade,width:1,type:"dashed",textStyle:{}}},textStyle:{color:K.color.tertiary,fontSize:14}},e})(Se),nE=kz;function bh(t){var e=t.get("confine");return e!=null?!!e:t.get("renderMode")==="richText"}function aE(t){if(oe.domSupported){for(var e=document.documentElement.style,r=0,i=t.length;r-1?(s+="top:50%",l+="translateY(-50%) rotate("+(u=a==="left"?-225:-45)+"deg)"):(s+="left:50%",l+="translateX(-50%) rotate("+(u=a==="top"?225:45)+"deg)");var f=u*Math.PI/180,c=o+n,p=c*Math.abs(Math.cos(f))+c*Math.abs(Math.sin(f)),h=Math.round(((p-Math.SQRT2*n)/2+Math.SQRT2*n-(p-c)/2)*100)/100;s+=";"+a+":-"+h+"px";var v=e+" solid "+n+"px;",d=["position:absolute;width:"+o+"px;height:"+o+"px;z-index:-1;",s+";"+l+";","border-bottom:"+v,"border-right:"+v,"background-color:"+i+";"];return'
'}function Vz(t,e,r){var i="cubic-bezier(0.23,1,0.32,1)",n="",a="";return r&&(n=" "+t/2+"s "+i,a="opacity"+n+",visibility"+n),e||(n=" "+t+"s "+i,a+=(a.length?",":"")+(oe.transformSupported?""+Jy+n:",left"+n+",top"+n)),Bz+":"+a}function lE(t,e,r){var i=t.toFixed(0)+"px",n=e.toFixed(0)+"px";if(!oe.transformSupported)return r?"top:"+n+";left:"+i+";":[["top",n],["left",i]];var a=oe.transform3dSupported,o="translate"+(a?"3d":"")+"("+i+","+n+(a?",0":"")+")";return r?"top:0;left:0;"+Jy+":"+o+";":[["top",0],["left",0],[jy,o]]}function Gz(t){var e=[],r=t.get("fontSize"),i=t.getTextColor();i&&e.push("color:"+i),e.push("font:"+t.getFont());var n=W(t.get("lineHeight"),Math.round(r*3/2));r&&e.push("line-height:"+n+"px");var a=t.get("textShadowColor"),o=t.get("textShadowBlur")||0,s=t.get("textShadowOffsetX")||0,l=t.get("textShadowOffsetY")||0;return a&&o&&e.push("text-shadow:"+s+"px "+l+"px "+o+"px "+a),T(["decoration","align"],function(u){var f=t.get(u);f&&e.push("text-"+u+":"+f)}),e.join(";")}function Hz(t,e,r,i){var n=[],a=t.get("transitionDuration"),o=t.get("backgroundColor"),s=t.get("shadowBlur"),l=t.get("shadowColor"),u=t.get("shadowOffsetX"),f=t.get("shadowOffsetY"),c=t.getModel("textStyle"),p=qc(t,"html"),h=u+"px "+f+"px "+s+"px "+l;return n.push("box-shadow:"+h),e&&a>0&&n.push(Vz(a,r,i)),o&&n.push("background-color:"+o),T(["width","color","radius"],function(v){var d="border-"+v,m=os(d),g=t.get(m);g!=null&&n.push(d+":"+g+(v==="color"?"":"px"))}),n.push(Gz(c)),p!=null&&n.push("padding:"+di(p).join("px ")+"px"),n.join(";")+";"}function uE(t,e,r,i,n){var a=e&&e.painter;if(r){var o=a&&a.getViewportRoot();o&&H0(t,o,r,i,n)}else{t[0]=i,t[1]=n;var s=a&&a.getViewportRootOffset();s&&(t[0]+=s.offsetLeft,t[1]+=s.offsetTop)}t[2]=t[0]/e.getWidth(),t[3]=t[1]/e.getHeight()}var Yz=(function(){function t(e,r){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,oe.wxa)return null;var i=document.createElement("div");i.domBelongToZr=!0,this.el=i;var n=this._zr=e.getZr(),a=r.appendTo,o=a&&(U(a)?document.querySelector(a):zn(a)?a:X(a)&&a(e.getDom()));uE(this._styleCoord,n,o,e.getWidth()/2,e.getHeight()/2),(o||e.getDom()).appendChild(i),this._api=e,this._container=o;var s=this;i.onmouseenter=function(){s._enterable&&(clearTimeout(s._hideTimeout),s._show=!0),s._inContent=!0},i.onmousemove=function(l){if(l=l||window.event,!s._enterable){var u=n.handler,f=n.painter.getViewportRoot();Ht(f,l,!0),u.dispatch("mousemove",l)}},i.onmouseleave=function(){s._inContent=!1,s._enterable&&s._show&&s.hideLater(s._hideDelay)}}return t.prototype.update=function(e){if(!this._container){var r=this._api.getDom(),i=sE(r,"position"),n=r.style;n.position!=="absolute"&&i!=="absolute"&&(n.position="relative")}var a=e.get("alwaysShowContent");a&&this._moveIfResized(),this._alwaysShowContent=a,this._enableDisplayTransition=e.get("displayTransition")&&e.get("transitionDuration")>0,this.el.className=e.get("className")||""},t.prototype.show=function(e,r){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var i=this.el,n=i.style,a=this._styleCoord;i.innerHTML?n.cssText=zz+Hz(e,!this._firstShow,this._longHide,this._enableDisplayTransition)+lE(a[0],a[1],!0)+("border-color:"+Yr(r)+";")+(e.get("extraCssText")||"")+(";pointer-events:"+(this._enterable?"auto":"none")):n.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},t.prototype.setContent=function(e,r,i,n,a){var o=this.el;if(e==null){o.innerHTML="";return}var s="";if(U(a)&&i.get("trigger")==="item"&&!bh(i)&&(s=Fz(i,n,a)),U(e))o.innerHTML=e+s;else if(e){o.innerHTML="",k(e)||(e=[e]);for(var l=0;l=0?this._tryShow(a,o):n==="leave"&&this._hide(o))},this))},e.prototype._keepShow=function(){var r=this._tooltipModel,i=this._ecModel,n=this._api,a=r.get("triggerOn");if(r.get("trigger")!=="axis"&&(this._lastDataByCoordSys=null,this._cbParamsList=null),this._lastX!=null&&this._lastY!=null&&a!=="none"&&a!=="click"){var o=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){!n.isDisposed()&&o.manuallyShowTip(r,i,n,{x:o._lastX,y:o._lastY,dataByCoordSys:o._lastDataByCoordSys})})}},e.prototype.manuallyShowTip=function(r,i,n,a){if(!(a.from===this.uid||oe.node||!n.getDom())){var o=vE(a,n);this._ticket="";var s=a.dataByCoordSys,l=Qz(a,i,n);if(l){var u=l.el.getBoundingRect().clone();u.applyTransform(l.el.transform),this._tryShow({offsetX:u.x+u.width/2,offsetY:u.y+u.height/2,target:l.el,position:a.position,positionDefault:"bottom"},o)}else if(a.tooltip&&a.x!=null&&a.y!=null){var f=Xz;f.x=a.x,f.y=a.y,f.update(),me(f).tooltipConfig={name:null,option:a.tooltip},this._tryShow({offsetX:a.x,offsetY:a.y,target:f},o)}else if(s)this._tryShow({offsetX:a.x,offsetY:a.y,position:a.position,dataByCoordSys:s,tooltipOption:a.tooltipOption},o);else if(a.seriesIndex!=null){if(this._manuallyAxisShowTip(r,i,n,a))return;var c=Cu(a,i),p=c.point[0],h=c.point[1];p!=null&&h!=null&&this._tryShow({offsetX:p,offsetY:h,target:c.el,position:a.position,positionDefault:"bottom"},o)}else a.x!=null&&a.y!=null&&(n.dispatchAction({type:"updateAxisPointer",x:a.x,y:a.y}),this._tryShow({offsetX:a.x,offsetY:a.y,position:a.position,target:n.getZr().findHover(a.x,a.y).target},o))}},e.prototype.manuallyHideTip=function(r,i,n,a){var o=this._tooltipContent;this._tooltipModel&&o.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,this._cbParamsList=null,a.from!==this.uid&&this._hide(vE(a,n))},e.prototype._manuallyAxisShowTip=function(r,i,n,a){var o=a.seriesIndex,s=a.dataIndex,l=i.getComponent("axisPointer").coordSysAxesInfo;if(!(o==null||s==null||l==null)){var u=i.getSeriesByIndex(o);if(u){var f=u.getData(),c=Du([f.getItemModel(s),u,(u.coordinateSystem||{}).model],this._tooltipModel);if(c.get("trigger")==="axis")return n.dispatchAction({type:"updateAxisPointer",seriesIndex:o,dataIndex:s,position:a.position}),!0}}},e.prototype._tryShow=function(r,i){var n=r.target,a=this._tooltipModel;if(a){this._lastX=r.offsetX,this._lastY=r.offsetY;var o=r.dataByCoordSys;if(o&&o.length)this._showAxisTooltip(o,r);else if(n){var s=me(n);if(s.ssrType==="legend")return;this._lastDataByCoordSys=null,this._cbParamsList=null;var l,u;qa(n,function(f){if(f.tooltipDisabled)return l=u=null,!0;l||u||(me(f).dataIndex!=null?l=f:me(f).tooltipConfig!=null&&(u=f))},!0),l?this._showSeriesItemTooltip(r,l,i):u?this._showComponentItemTooltip(r,u,i):this._hide(i)}else this._lastDataByCoordSys=null,this._cbParamsList=null,this._hide(i)}},e.prototype._showOrMove=function(r,i){var n=r.get("showDelay");i=J(i,this),clearTimeout(this._showTimout),n>0?this._showTimout=setTimeout(i,n):i()},e.prototype._showAxisTooltip=function(r,i){var n=this._ecModel,a=this._tooltipModel,o=[i.offsetX,i.offsetY],s=Du([i.tooltipOption],a),l=this._renderMode,u=[],f=Ya("section",{blocks:[],noHeader:!0}),c=[],p=new Kc;T(r,function(y){T(y.dataByAxis,function(_){var x=n.getComponent(_.axisDim+"Axis",_.axisIndex),S=_.value,b=x.axis,w=b.scale.parse(S);if(!(!x||S==null)){var A=Gy(S,b,n,_.seriesDataIndices,_.valueLabelOpt),C=Ya("section",{header:A,noHeader:!pt(A),sortBlocks:!0,blocks:[]});f.blocks.push(C),T(_.seriesDataIndices,function(D){var E=n.getSeriesByIndex(D.seriesIndex),I=D.dataIndexInside,M=E.getDataParams(I);if(!(M.dataIndex<0)){M.axisDim=_.axisDim,M.axisIndex=_.axisIndex,M.axisType=_.axisType,M.axisId=_.axisId,M.axisValue=Is(x.axis,{value:w}),M.axisValueLabel=A,M.marker=p.makeTooltipMarker("item",Yr(M.color),l);var O=km(E.formatTooltip(I,!0,null)),N=O.frag;if(N){var R=Du([E],a).get("valueFormatter");C.blocks.push(R?P({valueFormatter:R},N):N)}O.text&&c.push(O.text),u.push(M)}})}})}),f.blocks.reverse(),c.reverse();var h=i.position,v=s.get("order"),d=Gm(f,p,l,v,n.get("useUTC"),s.get("textStyle"));d&&c.unshift(d);var m=l==="richText"?` + +`:"
",g=c.join(m);this._showOrMove(s,function(){this._updateContentNotChangedOnAxis(r,u)?this._updatePosition(s,h,o[0],o[1],this._tooltipContent,u):this._showTooltipContent(s,g,u,Math.random()+"",o[0],o[1],h,null,p)})},e.prototype._showSeriesItemTooltip=function(r,i,n){var a=this._ecModel,o=me(i),s=o.seriesIndex,l=a.getSeriesByIndex(s),u=o.dataModel||l,f=o.dataIndex,c=o.dataType,p=u.getData(c),h=this._renderMode,v=r.positionDefault,d=Du([p.getItemModel(f),u,l&&(l.coordinateSystem||{}).model],this._tooltipModel,v?{position:v}:null),m=d.get("trigger");if(!(m!=null&&m!=="item")){var g=u.getDataParams(f,c),y=new Kc;g.marker=y.makeTooltipMarker("item",Yr(g.color),h);var _=km(u.formatTooltip(f,!1,c)),x=d.get("order"),S=d.get("valueFormatter"),b=_.frag,w=b?Gm(S?P({valueFormatter:S},b):b,y,h,x,a.get("useUTC"),d.get("textStyle")):_.text,A="item_"+u.name+"_"+f;this._showOrMove(d,function(){this._showTooltipContent(d,w,g,A,r.offsetX,r.offsetY,r.position,r.target,y)}),n({type:"showTip",dataIndexInside:f,dataIndex:p.getRawIndex(f),seriesIndex:s,from:this.uid})}},e.prototype._showComponentItemTooltip=function(r,i,n){var a=this._renderMode==="html",o=me(i),s=o.tooltipConfig,l=s.option||{},u=l.encodeHTMLContent;if(U(l)){var f=l;l={content:f,formatter:f},u=!0}u&&a&&l.content&&(l=$(l),l.content=Je(l.content));var c=[l],p=this._ecModel.getComponent(o.componentMainType,o.componentIndex);p&&c.push(p),c.push({formatter:l.content});var h=r.positionDefault,v=Du(c,this._tooltipModel,h?{position:h}:null),d=v.get("content"),m=Math.random()+"",g=new Kc;this._showOrMove(v,function(){var y=$(v.get("formatterParams")||{});this._showTooltipContent(v,d,y,m,r.offsetX,r.offsetY,r.position,i,g)}),n({type:"showTip",from:this.uid})},e.prototype._showTooltipContent=function(r,i,n,a,o,s,l,u,f){if(this._ticket="",!(!r.get("showContent")||!r.get("show"))){var c=this._tooltipContent;c.setEnterable(r.get("enterable"));var p=r.get("formatter");l=l||r.get("position");var h=i,v=this._getNearestPoint([o,s],n,r.get("trigger"),r.get("borderColor"),r.get("defaultBorderColor",!0)),d=v.color;if(p)if(U(p)){var m=r.ecModel.get("useUTC"),g=k(n)?n[0]:n,y=g&&g.axisType&&g.axisType.indexOf("time")>=0;h=p,y&&(h=Ri(g.axisValue,h,m)),h=ss(h,n,!0)}else if(X(p)){var _=J(function(x,S){x===this._ticket&&(c.setContent(S,f,r,d,l),this._updatePosition(r,l,o,s,c,n,u))},this);this._ticket=a,h=p(n,a,_)}else h=p;c.setContent(h,f,r,d,l),c.show(r,d),this._updatePosition(r,l,o,s,c,n,u)}},e.prototype._getNearestPoint=function(r,i,n,a,o){if(n==="axis"||k(i))return{color:a||o};if(!k(i))return{color:a||i.color||i.borderColor}},e.prototype._updatePosition=function(r,i,n,a,o,s,l){var u=this._api.getWidth(),f=this._api.getHeight();i=i||r.get("position");var c=o.getSize(),p=r.get("align"),h=r.get("verticalAlign"),v=l&&l.getBoundingRect().clone();if(l&&v.applyTransform(l.transform),X(i)&&(i=i([n,a],s,o.el,v,{viewSize:[u,f],contentSize:c.slice()})),k(i))n=we(i[0],u),a=we(i[1],f);else if(Y(i)){var d=i;d.width=c[0],d.height=c[1];var m=jt(d,{width:u,height:f});n=m.x,a=m.y,p=null,h=null}else if(U(i)&&l){var g=jz(i,v,c,r.get("borderWidth"));n=g[0],a=g[1]}else{var g=qz(n,a,o,u,f,p?null:20,h?null:20);n=g[0],a=g[1]}if(p&&(n-=dE(p)?c[0]/2:p==="right"?c[0]:0),h&&(a-=dE(h)?c[1]/2:h==="bottom"?c[1]:0),bh(r)){var g=Kz(n,a,o,u,f);n=g[0],a=g[1]}o.moveTo(n,a)},e.prototype._updateContentNotChangedOnAxis=function(r,i){var n=this._lastDataByCoordSys,a=this._cbParamsList,o=!!n&&n.length===r.length;return o&&T(n,function(s,l){var u=s.dataByAxis||[],f=r[l]||{},c=f.dataByAxis||[];o=o&&u.length===c.length,o&&T(u,function(p,h){var v=c[h]||{},d=p.seriesDataIndices||[],m=v.seriesDataIndices||[];o=o&&p.value===v.value&&p.axisType===v.axisType&&p.axisId===v.axisId&&d.length===m.length,o&&T(d,function(g,y){var _=m[y];o=o&&g.seriesIndex===_.seriesIndex&&g.dataIndex===_.dataIndex}),a&&T(p.seriesDataIndices,function(g){var y=g.seriesIndex,_=i[y],x=a[y];_&&x&&x.data!==_.data&&(o=!1)})})}),this._lastDataByCoordSys=r,this._cbParamsList=i,!!o},e.prototype._hide=function(r){this._lastDataByCoordSys=null,this._cbParamsList=null,r({type:"hideTip",from:this.uid})},e.prototype.dispose=function(r,i){oe.node||!i.getDom()||(Za(this,"_updatePosition"),this._tooltipContent.dispose(),wu("itemTooltip",i),this._tooltipContent=null,this._tooltipModel=null,this._lastDataByCoordSys=null,this._cbParamsList=null)},e.type="tooltip",e})(et);function Du(t,e,r){var i=e.ecModel,n;r?(n=new Ce(r,i,i),n=new Ce(e.option,n,i)):n=e;for(var a=t.length-1;a>=0;a--){var o=t[a];o&&(o instanceof Ce&&(o=o.get("tooltip",!0)),U(o)&&(o={formatter:o}),o&&(n=new Ce(o,n,i)))}return n}function vE(t,e){return t.dispatchAction||J(e.dispatchAction,e)}function qz(t,e,r,i,n,a,o){var s=r.getSize(),l=s[0],u=s[1];return a!=null&&(t+l+a+2>i?t-=l+a:t+=a),o!=null&&(e+u+o>n?e-=u+o:e+=o),[t,e]}function Kz(t,e,r,i,n){var a=r.getSize(),o=a[0],s=a[1];return t=Math.min(t+o,i)-o,e=Math.min(e+s,n)-s,t=Math.max(t,0),e=Math.max(e,0),[t,e]}function jz(t,e,r,i){var n=r[0],a=r[1],o=Math.ceil(Math.SQRT2*i)+8,s=0,l=0,u=e.width,f=e.height;switch(t){case"inside":s=e.x+u/2-n/2,l=e.y+f/2-a/2;break;case"top":s=e.x+u/2-n/2,l=e.y-a-o;break;case"bottom":s=e.x+u/2-n/2,l=e.y+f+o;break;case"left":s=e.x-n-o,l=e.y+f/2-a/2;break;case"right":s=e.x+u+o,l=e.y+f/2-a/2}return[s,l]}function dE(t){return t==="center"||t==="middle"}function Qz(t,e,r){var i=gl(t).queryOptionMap,n=i.keys()[0];if(!(!n||n==="series")){var a=an(e,n,i.get(n),{useDefault:!1,enableAll:!1,enableNone:!1}),o=a.models[0];if(o){var s=r.getViewOfComponentModel(o),l;if(s.group.traverse(function(u){var f=me(u).tooltipConfig;if(f&&f.name===t.name)return l=u,!0}),l)return{componentMainType:n,componentIndex:o.componentIndex,el:l}}}}var mE=Zz;function $y(t){yt(so),t.registerComponentModel(nE),t.registerComponentView(mE),t.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},Me),t.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},Me)}var Jz=function(t,e){if(e==="all")return{type:"all",title:t.getLocaleModel().get(["legend","selector","all"])};if(e==="inverse")return{type:"inverse",title:t.getLocaleModel().get(["legend","selector","inverse"])}},$z=(function(t){L(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.layoutMode={type:"box",ignoreSize:!0},r}return e.prototype.init=function(r,i,n){this.mergeDefaultAndTheme(r,n),r.selected=r.selected||{},this._updateSelector(r)},e.prototype.mergeOption=function(r,i){t.prototype.mergeOption.call(this,r,i),this._updateSelector(r)},e.prototype._updateSelector=function(r){var i=r.selector,n=this.ecModel;i===!0&&(i=r.selector=["all","inverse"]),k(i)&&T(i,function(a,o){U(a)&&(a={type:a}),i[o]=he(a,Jz(n,a.type))})},e.prototype.optionUpdated=function(){this._updateData(this.ecModel);var r=this._data;if(r[0]&&this.get("selectedMode")==="single"){for(var i=!1,n=0;n=0},e.prototype.getOrient=function(){return this.get("orient")==="vertical"?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},e.type="legend.plain",e.dependencies=["series"],e.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",bottom:K.size.m,align:"auto",backgroundColor:K.color.transparent,borderColor:K.color.border,borderRadius:0,borderWidth:0,padding:5,itemGap:8,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:K.color.disabled,inactiveBorderColor:K.color.disabled,inactiveBorderWidth:"auto",itemStyle:{color:"inherit",opacity:"inherit",borderColor:"inherit",borderWidth:"auto",borderCap:"inherit",borderJoin:"inherit",borderDashOffset:"inherit",borderMiterLimit:"inherit"},lineStyle:{width:"auto",color:"inherit",inactiveColor:K.color.disabled,inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:K.color.secondary},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:K.color.tertiary,borderWidth:1,borderColor:K.color.border},emphasis:{selectorLabel:{show:!0,color:K.color.quaternary}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1},triggerEvent:!1},e})(Se),Eu=$z;var Us=be,e0=T,Th=xe,eU=(function(t){L(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.newlineDisabled=!1,r}return e.prototype.init=function(){this.group.add(this._contentGroup=new Th),this.group.add(this._selectorGroup=new Th),this._isFirstRender=!0},e.prototype.getContentGroup=function(){return this._contentGroup},e.prototype.getSelectorGroup=function(){return this._selectorGroup},e.prototype.render=function(r,i,n){var a=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),!!r.get("show",!0)){var o=r.get("align"),s=r.get("orient");(!o||o==="auto")&&(o=r.get("left")==="right"&&s==="vertical"?"right":"left");var l=r.get("selector",!0),u=r.get("selectorPosition",!0);l&&(!u||u==="auto")&&(u=s==="horizontal"?"end":"start"),this.renderInner(o,r,i,n,l,s,u);var f=za(r,n).refContainer,c=r.getBoxLayoutParams(),p=r.get("padding"),h=jt(c,f,p),v=this.layoutInner(r,o,h,a,l,u),d=jt(re({width:v.width,height:v.height},c),f,p);this.group.x=d.x-v.x,this.group.y=d.y-v.y,this.group.markRedraw(),this.group.add(this._backgroundEl=iE(v,r))}},e.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},e.prototype.renderInner=function(r,i,n,a,o,s,l){var u=this.getContentGroup(),f=G(),c=i.get("selectedMode"),p=i.get("triggerEvent"),h=[];n.eachRawSeries(function(v){!v.get("legendHoverLink")&&h.push(v.id)}),e0(i.getData(),function(v,d){var m=this,g=v.get("name");if(!this.newlineDisabled&&(g===""||g===` +`)){var y=new Th;y.newline=!0,u.add(y);return}var _=n.getSeriesByName(g)[0];if(!f.get(g))if(_){var x=_.getData(),S=x.getVisual("legendLineStyle")||{},b=x.getVisual("legendIcon"),w=x.getVisual("style"),A=this._createItem(_,g,d,v,i,r,S,w,b,c,a);A.on("click",Us(gE,g,null,a,h)).on("mouseover",Us(t0,_.name,null,a,h)).on("mouseout",Us(r0,_.name,null,a,h)),n.ssr&&A.eachChild(function(C){var D=me(C);D.seriesIndex=_.seriesIndex,D.dataIndex=d,D.ssrType="legend"}),p&&A.eachChild(function(C){m.packEventData(C,i,_,d,g)}),f.set(g,!0)}else n.eachRawSeries(function(C){var D=this;if(!f.get(g)&&C.legendVisualProvider){var E=C.legendVisualProvider;if(!E.containName(g))return;var I=E.indexOfName(g),M=E.getItemVisual(I,"style"),O=E.getItemVisual(I,"legendIcon"),N=ht(M.fill);N&&N[3]===0&&(N[3]=.2,M=P(P({},M),{fill:ei(N,"rgba")}));var R=this._createItem(C,g,d,v,i,r,{},M,O,c,a);R.on("click",Us(gE,null,g,a,h)).on("mouseover",Us(t0,null,g,a,h)).on("mouseout",Us(r0,null,g,a,h)),n.ssr&&R.eachChild(function(F){var B=me(F);B.seriesIndex=C.seriesIndex,B.dataIndex=d,B.ssrType="legend"}),p&&R.eachChild(function(F){D.packEventData(F,i,C,d,g)}),f.set(g,!0)}},this)},this),o&&this._createSelector(o,i,a,s,l)},e.prototype.packEventData=function(r,i,n,a,o){var s={componentType:"legend",componentIndex:i.componentIndex,dataIndex:a,value:o,seriesIndex:n.seriesIndex};me(r).eventData=s},e.prototype._createSelector=function(r,i,n,a,o){var s=this.getSelectorGroup();e0(r,function(u){var f=u.type,c=new De({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){n.dispatchAction({type:f==="all"?"legendAllSelect":"legendInverseSelect",legendId:i.id})}});s.add(c);var p=i.getModel("selectorLabel"),h=i.getModel(["emphasis","selectorLabel"]);hi(c,{normal:p,emphasis:h},{defaultText:u.title}),dn(c)})},e.prototype._createItem=function(r,i,n,a,o,s,l,u,f,c,p){var h=r.visualDrawType,v=o.get("itemWidth"),d=o.get("itemHeight"),m=o.isSelected(i),g=a.get("symbolRotate"),y=a.get("symbolKeepAspect"),_=a.get("icon");f=_||f||"roundRect";var x=tU(f,a,l,u,h,m,p),S=new Th,b=a.getModel("textStyle");if(X(r.getLegendIcon)&&(!_||_==="inherit"))S.add(r.getLegendIcon({itemWidth:v,itemHeight:d,icon:f,iconRotate:g,itemStyle:x.itemStyle,lineStyle:x.lineStyle,symbolKeepAspect:y}));else{var w=_==="inherit"&&r.getData().getVisual("symbol")?g==="inherit"?r.getData().getVisual("symbolRotate"):g:0;S.add(rU({itemWidth:v,itemHeight:d,icon:f,iconRotate:w,itemStyle:x.itemStyle,lineStyle:x.lineStyle,symbolKeepAspect:y}))}var A=s==="left"?v+5:-5,C=s,D=o.get("formatter"),E=i;U(D)&&D?E=D.replace("{name}",i!=null?i:""):X(D)&&(E=D(i));var I=m?b.getTextColor():a.get("inactiveColor");S.add(new De({style:fr(b,{text:E,x:A,y:d/2,fill:I,align:C,verticalAlign:"middle"},{inheritColor:I})}));var M=new ge({shape:S.getBoundingRect(),style:{fill:"transparent"}}),O=a.getModel("tooltip");return O.get("show")&&$o({el:M,componentModel:o,itemName:i,itemTooltipOption:O.option}),S.add(M),S.eachChild(function(N){N.silent=!0}),M.silent=!c,this.getContentGroup().add(S),dn(S),S.__legendDataIndex=n,S},e.prototype.layoutInner=function(r,i,n,a,o,s){var l=this.getContentGroup(),u=this.getSelectorGroup();Ba(r.get("orient"),l,r.get("itemGap"),n.width,n.height);var f=l.getBoundingRect(),c=[-f.x,-f.y];if(u.markRedraw(),l.markRedraw(),o){Ba("horizontal",u,r.get("selectorItemGap",!0));var p=u.getBoundingRect(),h=[-p.x,-p.y],v=r.get("selectorButtonGap",!0),d=r.getOrient().index,m=d===0?"width":"height",g=d===0?"height":"width",y=d===0?"y":"x";s==="end"?h[d]+=f[m]+v:c[d]+=p[m]+v,h[1-d]+=f[g]/2-p[g]/2,u.x=h[0],u.y=h[1],l.x=c[0],l.y=c[1];var _={x:0,y:0};return _[m]=f[m]+v+p[m],_[g]=Math.max(f[g],p[g]),_[y]=Math.min(0,p[y]+h[1-d]),_}else return l.x=c[0],l.y=c[1],this.group.getBoundingRect()},e.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},e.type="legend.plain",e})(et);function tU(t,e,r,i,n,a,o){function s(m,g){m.lineWidth==="auto"&&(m.lineWidth=g.lineWidth>0?2:0),e0(m,function(y,_){m[_]==="inherit"&&(m[_]=g[_])})}var l=e.getModel("itemStyle"),u=l.getItemStyle(),f=t.lastIndexOf("empty",0)===0?"fill":"stroke",c=l.getShallow("decal");u.decal=!c||c==="inherit"?i.decal:$l(c,o),u.fill==="inherit"&&(u.fill=i[n]),u.stroke==="inherit"&&(u.stroke=i[f]),u.opacity==="inherit"&&(u.opacity=(n==="fill"?i:r).opacity),s(u,i);var p=e.getModel("lineStyle"),h=p.getLineStyle();if(s(h,r),u.fill==="auto"&&(u.fill=i.fill),u.stroke==="auto"&&(u.stroke=i.fill),h.stroke==="auto"&&(h.stroke=i.fill),!a){var v=e.get("inactiveBorderWidth"),d=u[f];u.lineWidth=v==="auto"?i.lineWidth>0&&d?2:0:u.lineWidth,u.fill=e.get("inactiveColor"),u.stroke=e.get("inactiveBorderColor"),h.stroke=p.get("inactiveColor"),h.lineWidth=p.get("inactiveWidth")}return{itemStyle:u,lineStyle:h}}function rU(t){var e=t.icon||"roundRect",r=Lt(e,0,0,t.itemWidth,t.itemHeight,t.itemStyle.fill,t.symbolKeepAspect);return r.setStyle(t.itemStyle),r.rotation=(t.iconRotate||0)*Math.PI/180,r.setOrigin([t.itemWidth/2,t.itemHeight/2]),e.indexOf("empty")>-1&&(r.style.stroke=r.style.fill,r.style.fill=K.color.neutral00,r.style.lineWidth=2),r}function gE(t,e,r,i){r0(t,e,r,i),r.dispatchAction({type:"legendToggleSelect",name:t!=null?t:e}),t0(t,e,r,i)}function t0(t,e,r,i){r.usingTHL()||r.dispatchAction({type:"highlight",seriesName:t,name:e,excludeSeriesId:i})}function r0(t,e,r,i){r.usingTHL()||r.dispatchAction({type:"downplay",seriesName:t,name:e,excludeSeriesId:i})}var wh=eU;function Mu(t,e,r){var i=t==="allSelect"||t==="inverseSelect",n={},a=[];r.eachComponent({mainType:"legend",query:e},function(s){i?s[t]():s[t](e.name),yE(s,n),a.push(s.componentIndex)});var o={};return r.eachComponent("legend",function(s){T(n,function(l,u){s[l?"select":"unSelect"](u)}),yE(s,o)}),i?{selected:o,legendIndex:a}:{name:e.name,selected:o}}function yE(t,e){var r=e||{};return T(t.getData(),function(i){var n=i.get("name");if(!(n===` +`||n==="")){var a=t.isSelected(n);Oe(r,n)?r[n]=r[n]&&a:r[n]=a}}),r}function _E(t){t.registerAction("legendToggleSelect","legendselectchanged",be(Mu,"toggleSelected")),t.registerAction("legendAllSelect","legendselectall",be(Mu,"allSelect")),t.registerAction("legendInverseSelect","legendinverseselect",be(Mu,"inverseSelect")),t.registerAction("legendSelect","legendselected",be(Mu,"select")),t.registerAction("legendUnSelect","legendunselected",be(Mu,"unSelect"))}var xE=on(iU);function iU(t){var e=t.findComponents({mainType:"legend"});e&&e.length&&t.filterSeries(function(r){for(var i=0;in[o],m=[-h.x,-h.y];i||(m[a]=f[u]);var g=[0,0],y=[-v.x,-v.y],_=W(r.get("pageButtonGap",!0),r.get("itemGap",!0));if(d){var x=r.get("pageButtonPosition",!0);x==="end"?y[a]+=n[o]-v[o]:g[a]+=v[o]+_}y[1-a]+=h[s]/2-v[s]/2,f.setPosition(m),c.setPosition(g),p.setPosition(y);var S={x:0,y:0};if(S[o]=d?n[o]:h[o],S[s]=Math.max(h[s],v[s]),S[l]=Math.min(0,v[l]+y[1-a]),c.__rectSize=n[o],d){var b={x:0,y:0};b[o]=Math.max(n[o]-v[o]-_,0),b[s]=S[s],c.setClipPath(new ge({shape:b})),c.__rectSize=b[o]}else p.eachChild(function(A){A.attr({invisible:!0,silent:!0})});var w=this._getPageInfo(r);return w.pageIndex!=null&&Be(f,{x:w.contentPosition[0],y:w.contentPosition[1]},d?r:null),this._updatePageInfoView(r,w),S},e.prototype._pageGo=function(r,i,n){var a=this._getPageInfo(i)[r];a!=null&&n.dispatchAction({type:"legendScroll",scrollDataIndex:a,legendId:i.id})},e.prototype._updatePageInfoView=function(r,i){var n=this._controllerGroup;T(["pagePrev","pageNext"],function(f){var c=f+"DataIndex",p=i[c]!=null,h=n.childOfName(f);h&&(h.setStyle("fill",p?r.get("pageIconColor",!0):r.get("pageIconInactiveColor",!0)),h.cursor=p?"pointer":"default")});var a=n.childOfName("pageText"),o=r.get("pageFormatter"),s=i.pageIndex,l=s!=null?s+1:0,u=i.pageCount;a&&o&&a.setStyle("text",U(o)?o.replace("{current}",l==null?"":l+"").replace("{total}",u==null?"":u+""):o({current:l,total:u}))},e.prototype._getPageInfo=function(r){var i=r.get("scrollDataIndex",!0),n=this.getContentGroup(),a=this._containerGroup.__rectSize,o=r.getOrient().index,s=i0[o],l=n0[o],u=this._findTargetItemIndex(i),f=n.children(),c=f[u],p=f.length,h=p?1:0,v={contentPosition:[n.x,n.y],pageCount:h,pageIndex:h-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!c)return v;var d=x(c);v.contentPosition[o]=-d.s;for(var m=u+1,g=d,y=d,_=null;m<=p;++m)_=x(f[m]),(!_&&y.e>g.s+a||_&&!S(_,g.s))&&(y.i>g.i?g=y:g=_,g&&(v.pageNextDataIndex==null&&(v.pageNextDataIndex=g.i),++v.pageCount)),y=_;for(var m=u-1,g=d,y=d,_=null;m>=-1;--m)_=x(f[m]),(!_||!S(y,_.s))&&g.i=w&&b.s<=w+a}},e.prototype._findTargetItemIndex=function(r){if(!this._showController)return 0;var i,n=this.getContentGroup(),a;return n.eachChild(function(o,s){var l=o.__legendDataIndex;a==null&&l!=null&&(a=s),l===r&&(i=s)}),i!=null?i:a},e.type="legend.scroll",e})(wh),wE=aU;function a0(t){t.registerAction("legendScroll","legendscroll",function(e,r){var i=e.scrollDataIndex;i!=null&&r.eachComponent({mainType:"legend",subType:"scroll",query:e},function(n){n.setScrollDataIndex(i)})})}function CE(t){yt(Ch),t.registerComponentModel(bE),t.registerComponentView(wE),a0(t)}function o0(t){yt(Ch),yt(CE)}var oU=(function(t){L(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="dataZoom.inside",e.defaultOption=xn(zs.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),e})(zs),AE=oU;var s0=te();function DE(t,e,r){s0(t).coordSysRecordMap.each(function(i){var n=i.dataZoomInfoMap.get(e.uid);n&&(n.getRange=r)})}function EE(t,e){for(var r=s0(t).coordSysRecordMap,i=r.keys(),n=0;na[n+i]&&(i=c),o=o&&f.get("preventDefaultMouseMove",!0),s=W(f.get("cursorGrab",!0),s),l=W(f.get("cursorGrabbing",!0),l)}),{controlType:i,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!o,api:r,zInfo:{component:e.model},triggerInfo:{roamTrigger:null,isInSelf:e.containsPoint},cursorGrab:s,cursorGrabbing:l}}}function IE(t){t.registerUpdateLifecycle("coordsys:aftercreate",function(e,r){var i=s0(r),n=i.coordSysRecordMap||(i.coordSysRecordMap=G());n.each(function(a){a.dataZoomInfoMap=null}),e.eachComponent({mainType:"dataZoom",subType:"inside"},function(a){var o=_h(a);T(o.infoList,function(s){var l=s.model.uid,u=n.get(l)||n.set(l,sU(r,s.model)),f=u.dataZoomInfoMap||(u.dataZoomInfoMap=G());f.set(a.uid,{dzReferCoordSysInfo:s,model:a,getRange:null})})}),n.each(function(a){var o=a.controller,s,l=a.dataZoomInfoMap;if(l){var u=l.keys()[0];u!=null&&(s=l.get(u))}if(!s){ME(n,a);return}var f=fU(l,a,r);o.enable(f.controlType,f.opt),Cn(a,"dispatchAction",s.model.get("throttle",!0),"fixRate")})})}var pU=(function(t){L(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="dataZoom.inside",r}return e.prototype.render=function(r,i,n){if(t.prototype.render.apply(this,arguments),r.noTarget()){this._clear();return}this.range=r.getPercentRange(),DE(n,r,{pan:J(l0.pan,this),zoom:J(l0.zoom,this),scrollMove:J(l0.scrollMove,this)})},e.prototype.dispose=function(){this._clear(),t.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){EE(this.api,this.dataZoomModel),this.range=null},e.type="dataZoom.inside",e})(Sh),l0={zoom:function(t,e,r,i){var n=this.range,a=n.slice(),o=t.axisModels[0];if(o){var s=u0[e](null,[i.originX,i.originY],o,r,t),l=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(a[1]-a[0])+a[0],u=Math.max(1/i.scale,0);a[0]=(a[0]-l)*u+l,a[1]=(a[1]-l)*u+l;var f=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();if(Yi(0,a,[0,100],0,f.minSpan,f.maxSpan),this.range=a,n[0]!==a[0]||n[1]!==a[1])return a}},pan:OE(function(t,e,r,i,n,a){var o=u0[i]([a.oldX,a.oldY],[a.newX,a.newY],e,n,r);return o.signal*(t[1]-t[0])*o.pixel/o.pixelLength}),scrollMove:OE(function(t,e,r,i,n,a){var o=u0[i]([0,0],[a.scrollDelta,a.scrollDelta],e,n,r);return o.signal*(t[1]-t[0])*a.scrollDelta})};function OE(t){return function(e,r,i,n){var a=this.range,o=a.slice(),s=e.axisModels[0];if(s){var l=t(o,s,e,r,i,n);if(Yi(l,o,[0,100],"all"),this.range=o,a[0]!==o[0]||a[1]!==o[1])return o}}}var u0={grid:function(t,e,r,i,n){var a=r.axis,o={},s=n.model.coordinateSystem.getRect();return t=t||[0,0],a.dim==="x"?(o.pixel=e[0]-t[0],o.pixelLength=s.width,o.pixelStart=s.x,o.signal=a.inverse?1:-1):(o.pixel=e[1]-t[1],o.pixelLength=s.height,o.pixelStart=s.y,o.signal=a.inverse?-1:1),o},polar:function(t,e,r,i,n){var a=r.axis,o={},s=n.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),u=s.getAngleAxis().getExtent();return t=t?s.pointToCoord(t):[0,0],e=s.pointToCoord(e),r.mainType==="radiusAxis"?(o.pixel=e[0]-t[0],o.pixelLength=l[1]-l[0],o.pixelStart=l[0],o.signal=a.inverse?1:-1):(o.pixel=e[1]-t[1],o.pixelLength=u[1]-u[0],o.pixelStart=u[0],o.signal=a.inverse?-1:1),o},singleAxis:function(t,e,r,i,n){var a=r.axis,o=n.model.coordinateSystem.getRect(),s={};return t=t||[0,0],a.orient==="horizontal"?(s.pixel=e[0]-t[0],s.pixelLength=o.width,s.pixelStart=o.x,s.signal=a.inverse?1:-1):(s.pixel=e[1]-t[1],s.pixelLength=o.height,s.pixelStart=o.y,s.signal=a.inverse?-1:1),s}},LE=pU;function PE(t){Au(t),t.registerComponentModel(AE),t.registerComponentView(LE),IE(t)}var hU=(function(t){L(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="dataZoom.slider",e.layoutMode="box",e.defaultOption=xn(zs.defaultOption,{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,borderColor:K.color.accent10,borderRadius:0,backgroundColor:K.color.transparent,dataBackground:{lineStyle:{color:K.color.accent30,width:.5},areaStyle:{color:K.color.accent20,opacity:.2}},selectedDataBackground:{lineStyle:{color:K.color.accent40,width:.5},areaStyle:{color:K.color.accent20,opacity:.3}},fillerColor:"rgba(135,175,274,0.2)",handleIcon:"path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z",handleSize:"100%",handleStyle:{color:K.color.neutral00,borderColor:K.color.accent20},moveHandleSize:7,moveHandleIcon:"path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z",moveHandleStyle:{color:K.color.accent40,opacity:.5},showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:K.color.tertiary},brushSelect:!0,brushStyle:{color:K.color.accent30,opacity:.3},emphasis:{handleLabel:{show:!0},handleStyle:{borderColor:K.color.accent40},moveHandleStyle:{opacity:.8}},defaultLocationEdgeGap:15}),e})(zs),NE=hU;var Iu=ge,vU=1,f0=30,dU=7,Ou="horizontal",RE="vertical",mU=5,gU=["line","bar","candlestick","scatter"],yU={easing:"cubicOut",duration:100,delay:0},_U=(function(t){L(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r._displayables={},r}return e.prototype.init=function(r,i){this.api=i,this._onBrush=J(this._onBrush,this),this._onBrushEnd=J(this._onBrushEnd,this)},e.prototype.render=function(r,i,n,a){if(t.prototype.render.apply(this,arguments),Cn(this,"_dispatchZoomAction",r.get("throttle"),"fixRate"),this._orient=r.getOrient(),r.get("show")===!1){this.group.removeAll();return}if(r.noTarget()){this._clear(),this.group.removeAll();return}(!a||a.type!=="dataZoom"||a.from!==this.uid)&&this._buildView(),this._updateView()},e.prototype.dispose=function(){this._clear(),t.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){Za(this,"_dispatchZoomAction");var r=this.api.getZr();r.off("mousemove",this._onBrush),r.off("mouseup",this._onBrushEnd)},e.prototype._buildView=function(){var r=this.group;r.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var i=this._displayables.sliderGroup=new xe;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),r.add(i),this._positionGroup()},e.prototype._resetLocation=function(){var r=this.dataZoomModel,i=this.api,n=r.get("brushSelect"),a=n?dU:0,o=za(r,i).refContainer,s=this._findCoordRect(),l=r.get("defaultLocationEdgeGap",!0)||0,u=this._orient===Ou?{right:o.width-s.x-s.width,top:o.height-f0-l-a,width:s.width,height:f0}:{right:l,top:s.y,width:f0,height:s.height},f=Dr(r.option);T(["right","top","width","height"],function(p){f[p]==="ph"&&(f[p]=u[p])});var c=jt(f,o);this._location={x:c.x,y:c.y},this._size=[c.width,c.height],this._orient===RE&&this._size.reverse()},e.prototype._positionGroup=function(){var r=this.group,i=this._location,n=this._orient,a=this.dataZoomModel.getFirstTargetAxisModel(),o=a&&a.get("inverse"),s=this._displayables.sliderGroup,l=(this._dataShadowInfo||{}).otherAxisInverse;s.attr(n===Ou&&!o?{scaleY:l?1:-1,scaleX:1}:n===Ou&&o?{scaleY:l?1:-1,scaleX:-1}:n===RE&&!o?{scaleY:l?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:l?-1:1,scaleX:-1,rotation:Math.PI/2});var u=r.getBoundingRect([s]),f=isNaN(u.x)?0:u.x,c=isNaN(u.y)?0:u.y;r.x=i.x-f,r.y=i.y-c,r.markRedraw()},e.prototype._getViewExtent=function(){return[0,this._size[0]]},e.prototype._renderBackground=function(){var r=this.dataZoomModel,i=this._size,n=this._displayables.sliderGroup,a=r.get("brushSelect");n.add(new Iu({silent:!0,shape:{x:0,y:0,width:i[0],height:i[1]},style:{fill:r.get("backgroundColor")},z2:-40}));var o=new Iu({shape:{x:0,y:0,width:i[0],height:i[1]},style:{fill:"transparent"},z2:0,onclick:J(this._onClickPanel,this)}),s=this.api.getZr();a?(o.on("mousedown",this._onBrushStart,this),o.cursor="crosshair",s.on("mousemove",this._onBrush),s.on("mouseup",this._onBrushEnd)):(s.off("mousemove",this._onBrush),s.off("mouseup",this._onBrushEnd)),n.add(o)},e.prototype._renderDataShadow=function(){var r=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],!r)return;var i=this._size,n=this._shadowSize||[],a=r.series,o=a.getRawData(),s=a.getShadowDim&&a.getShadowDim(),l=s&&o.getDimensionInfo(s)?a.getShadowDim():r.otherDim;if(l==null)return;var u=this._shadowPolygonPts,f=this._shadowPolylinePts;if(o!==this._shadowData||l!==this._shadowDim||i[0]!==n[0]||i[1]!==n[1]){var c=o.getDataExtent(r.thisDim),p=o.getDataExtent(l),h=(p[1]-p[0])*.3;p=[p[0]-h,p[1]+h];var v=[0,i[1]],d=[0,i[0]],m=[[i[0],0],[0,0]],g=[],y=d[1]/Math.max(1,o.count()-1),_=i[0]/(c[1]-c[0]),x=r.thisAxis.type==="time",S=-y,b=Math.round(o.count()/i[0]),w;o.each([r.thisDim,l],function(I,M,O){if(b>0&&O%b){x||(S+=y);return}S=x?(+I-c[0])*_:S+y;var N=M==null||isNaN(M)||M==="",R=N?0:Le(M,p,v,!0);N&&!w&&O?(m.push([m[m.length-1][0],0]),g.push([g[g.length-1][0],0])):!N&&w&&(m.push([S,0]),g.push([S,0])),N||(m.push([S,R]),g.push([S,R])),w=N}),u=this._shadowPolygonPts=m,f=this._shadowPolylinePts=g}this._shadowData=o,this._shadowDim=l,this._shadowSize=[i[0],i[1]];var A=this.dataZoomModel;function C(I){var M=A.getModel(I?"selectedDataBackground":"dataBackground"),O=new xe,N=new Ta({shape:{points:u},segmentIgnoreThreshold:1,style:M.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),R=new Hr({shape:{points:f},segmentIgnoreThreshold:1,style:M.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return O.add(N),O.add(R),O}for(var D=0;D<3;D++){var E=C(D===1);this._displayables.sliderGroup.add(E),this._displayables.dataShadowSegs.push(E)}},e.prototype._prepareDataShadowInfo=function(){var r=this.dataZoomModel,i=r.get("showDataShadow");if(i!==!1){var n,a=this.ecModel;return r.eachTargetAxis(function(o,s){var l=r.getAxisProxy(o,s).getTargetSeriesModels();T(l,function(u){if(!n&&!(i!==!0&&ie(gU,u.get("type"))<0)){var f=a.getComponent(Or(o),s).axis,c=xU(o),p,h=u.coordinateSystem;c!=null&&h.getOtherAxis&&(p=h.getOtherAxis(f).inverse),c=u.getData().mapDimension(c);var v=u.getData().mapDimension(o);n={thisAxis:f,series:u,thisDim:v,otherDim:c,otherAxisInverse:p}}},this)},this),n}},e.prototype._renderHandle=function(){var r=this.group,i=this._displayables,n=i.handles=[null,null],a=i.handleLabels=[null,null],o=this._displayables.sliderGroup,s=this._size,l=this.dataZoomModel,u=this.api,f=l.get("borderRadius")||0,c=l.get("brushSelect"),p=i.filler=new Iu({silent:c,style:{fill:l.get("fillerColor")},textConfig:{position:"inside"}});o.add(p),o.add(new Iu({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:s[0],height:s[1],r:f},style:{stroke:l.get("dataBackgroundColor")||l.get("borderColor"),lineWidth:vU,fill:K.color.transparent}})),T([0,1],function(_){var x=l.get("handleIcon");!Ql[x]&&x.indexOf("path://")<0&&x.indexOf("image://")<0&&(x="path://"+x);var S=Lt(x,-1,0,2,2,null,!0);S.attr({cursor:SU(this._orient),draggable:!0,drift:J(this._onDragMove,this,_),ondragend:J(this._onDragEnd,this),onmouseover:J(this._onOverDataInfoTriggerArea,this,!0),onmouseout:J(this._onOverDataInfoTriggerArea,this,!1),z2:5});var b=S.getBoundingRect(),w=l.get("handleSize");this._handleHeight=we(w,this._size[1]),this._handleWidth=b.width/b.height*this._handleHeight,S.setStyle(l.getModel("handleStyle").getItemStyle()),S.style.strokeNoScale=!0,S.rectHover=!0,S.ensureState("emphasis").style=l.getModel(["emphasis","handleStyle"]).getItemStyle(),dn(S);var A=l.get("handleColor");A!=null&&(S.style.fill=A),o.add(n[_]=S);var C=l.getModel("textStyle"),D=l.get("handleLabel")||{},E=D.show||!1;r.add(a[_]=new De({silent:!0,invisible:!E,style:fr(C,{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:C.getTextColor(),font:C.getFont()}),z2:10}))},this);var h=p;if(c){var v=we(l.get("moveHandleSize"),s[1]),d=i.moveHandle=new ge({style:l.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:s[1]-.5,height:v}}),m=v*.8,g=i.moveHandleIcon=Lt(l.get("moveHandleIcon"),-m/2,-m/2,m,m,K.color.neutral00,!0);g.silent=!0,g.y=s[1]+v/2-.5,d.ensureState("emphasis").style=l.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var y=Math.min(s[1]/2,Math.max(v,10));h=i.moveZone=new ge({invisible:!0,shape:{y:s[1]-y,height:v+y}}),h.on("mouseover",function(){u.enterEmphasis(d)}).on("mouseout",function(){u.leaveEmphasis(d)}),o.add(d),o.add(g),o.add(h)}h.attr({draggable:!0,cursor:"grab",drift:J(this._onActualMoveZoneDrift,this),ondragstart:J(this._onActualMoveZoneDragStart,this),ondragend:J(this._onActualMoveZoneDragEnd,this),onmouseover:J(this._onOverDataInfoTriggerArea,this,!0),onmouseout:J(this._onOverDataInfoTriggerArea,this,!1)})},e.prototype._resetInterval=function(){var r=this._range=this.dataZoomModel.getPercentRange(),i=this._getViewExtent();this._handleEnds=[Le(r[0],[0,100],i,!0),Le(r[1],[0,100],i,!0)]},e.prototype._updateInterval=function(r,i){var n=this.dataZoomModel,a=this._handleEnds,o=this._getViewExtent(),s=n.findRepresentativeAxisProxy().getMinMaxSpan(),l=[0,100];Yi(i,a,o,n.get("zoomLock")?"all":r,s.minSpan!=null?Le(s.minSpan,l,o,!0):null,s.maxSpan!=null?Le(s.maxSpan,l,o,!0):null);var u=this._range,f=this._range=Dt([Le(a[0],o,l,!0),Le(a[1],o,l,!0)]);return!u||u[0]!==f[0]||u[1]!==f[1]},e.prototype._updateView=function(r){var i=this._displayables,n=this._handleEnds,a=Dt(n.slice()),o=this._size;T([0,1],function(h){var v=i.handles[h],d=this._handleHeight;v.attr({scaleX:d/2,scaleY:d/2,x:n[h]+(h?-1:1),y:o[1]/2-d/2})},this),i.filler.setShape({x:a[0],y:0,width:a[1]-a[0],height:o[1]});var s={x:a[0],width:a[1]-a[0]};i.moveHandle&&(i.moveHandle.setShape(s),i.moveZone.setShape(s),i.moveZone.getBoundingRect(),i.moveHandleIcon&&i.moveHandleIcon.attr("x",s.x+s.width/2));for(var l=i.dataShadowSegs,u=[0,a[0],a[1],o[0]],f=0;fi[0]||n[1]<0||n[1]>i[1])){var a=this._handleEnds,o=(a[0]+a[1])/2,s=this._updateInterval("all",n[0]-o);this._updateView(),s&&this._dispatchZoomAction(!1)}},e.prototype._onBrushStart=function(r){var i=r.offsetX,n=r.offsetY;this._brushStart=new le(i,n),this._brushing=!0,this._brushStartTime=+new Date},e.prototype._onBrushEnd=function(r){if(this._brushing){var i=this._displayables.brushRect;if(this._brushing=!1,!!i){i.attr("ignore",!0);var n=i.shape,a=+new Date;if(!(a-this._brushStartTime<200&&Math.abs(n.width)<5)){var o=this._getViewExtent(),s=[0,100],l=this._handleEnds=[n.x,n.x+n.width],u=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();Yi(0,l,o,0,u.minSpan!=null?Le(u.minSpan,s,o,!0):null,u.maxSpan!=null?Le(u.maxSpan,s,o,!0):null),this._range=Dt([Le(l[0],o,s,!0),Le(l[1],o,s,!0)]),this._updateView(),this._dispatchZoomAction(!1)}}}},e.prototype._onBrush=function(r){this._brushing&&(Qr(r.event),this._updateBrushRect(r.offsetX,r.offsetY))},e.prototype._updateBrushRect=function(r,i){var n=this._displayables,a=this.dataZoomModel,o=n.brushRect;o||(o=n.brushRect=new Iu({silent:!0,style:a.getModel("brushStyle").getItemStyle()}),n.sliderGroup.add(o)),o.attr("ignore",!1);var s=this._brushStart,l=this._displayables.sliderGroup,u=l.transformCoordToLocal(r,i),f=l.transformCoordToLocal(s.x,s.y),c=this._size;u[0]=Math.max(Math.min(c[0],u[0]),0),o.setShape({x:f[0],y:0,width:u[0]-f[0],height:c[1]})},e.prototype._dispatchZoomAction=function(r){var i=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:r?yU:null,start:i[0],end:i[1]})},e.prototype._findCoordRect=function(){var r,i=_h(this.dataZoomModel).infoList;if(!r&&i.length){var n=i[0].model.coordinateSystem;r=n.getRect&&n.getRect()}if(!r){var a=this.api.getWidth(),o=this.api.getHeight();r={x:a*.2,y:o*.2,width:a*.6,height:o*.6}}return r},e.type="dataZoom.slider",e})(Sh);function kE(t,e,r,i){var n=t.get("labelFormatter"),a=t.get("labelPrecision");(a==null||a==="auto")&&(a=r.valuePrecision);var o=r.value[e],s=o==null||isNaN(o)?"":Ze(i)||gi(i)?i.getLabel({value:Math.round(o)}):isFinite(a)?de(o,a,!0):o+"";return X(n)?n(o,s):U(n)?n.replace("{value}",s):s}function xU(t){var e={x:"y",y:"x",radius:"angle",angle:"radius"};return e[t]}function SU(t){return t==="vertical"?"ns-resize":"ew-resize"}var BE=_U;function zE(t){t.registerComponentModel(NE),t.registerComponentView(BE),Au(t)}function c0(t){yt(PE),yt(zE)}var bU={label:{enabled:!0},decal:{show:!1}},UE=te(),FE=te(),VE=on(TU);function TU(t,e){var r=t.getModel("aria");if(!r.get("enabled"))return;var i=FE(t).scope||(FE(t).scope={}),n=$(bU);he(n.label,t.getLocaleModel().get("aria"),!1),he(r.option,n,!1),a(),o();function a(){var f=r.getModel("decal"),c=f.get("show");if(c){var p=G();t.eachSeries(function(h){h.isColorBySeries()||(UE(h).scope=p.get(h.type)||p.set(h.type,{}))}),t.eachSeries(function(h){if(X(h.enableAriaDecal)){h.enableAriaDecal();return}var v=h.getData();if(h.isColorBySeries()){var _=Am(h.ecModel,h.name,i,t.getSeriesCount()),x=v.getVisual("decal");v.setVisual("decal",S(x,_))}else{var d=h.getRawData(),m={},g=UE(h).scope;v.each(function(b){var w=v.getRawIndex(b);m[w]=b});var y=d.count();d.each(function(b){var w=m[b],A=d.getName(b)||b+"",C=Am(h.ecModel,A,g,y),D=v.getItemVisual(w,"decal");v.setItemVisual(w,"decal",S(D,C))})}function S(b,w){var A=b?P(P({},w),b):w;return A.dirty=!0,A}})}}function o(){var f=e.getZr().dom;if(f){var c=t.getLocaleModel().get("aria"),p=r.getModel("label");if(p.option=re(p.option,c),!!p.get("enabled")){if(f.setAttribute("role","img"),p.get("description")){f.setAttribute("aria-label",p.get("description"));return}var h=t.getSeriesCount(),v=p.get(["data","maxCount"])||10,d=p.get(["series","maxCount"])||10,m=Math.min(h,d),g;if(!(h<1)){var y=l();if(y){var _=p.get(["general","withTitle"]);g=s(_,{title:y})}else g=p.get(["general","withoutTitle"]);var x=[],S=h>1?p.get(["series","multiple","prefix"]):p.get(["series","single","prefix"]);g+=s(S,{seriesCount:h}),t.eachSeries(function(C,D){if(D1?p.get(["series","multiple",M]):p.get(["series","single",M]),E=s(E,{seriesId:C.seriesIndex,seriesName:C.get("name"),seriesType:u(C.subType)});var O=C.getData();if(O.count()>v){var N=p.get(["data","partialData"]);E+=s(N,{displayCnt:v})}else E+=p.get(["data","allData"]);for(var R=p.get(["data","separator","middle"]),F=p.get(["data","separator","end"]),B=p.get(["data","excludeDimensionId"]),V=[],H=0;H=lo:-u>=lo),h=u>0?u%lo:u%lo+lo,v=!1;p?v=!0:ti(c)?v=!1:v=h>=GE==!!f;var d=e+i*d0(o),m=r+n*v0(o);this._start&&this._add("M",d,m);var g=Math.round(a*wU);if(p){var y=1/this._p,_=(f?1:-1)*(lo-y);this._add("A",i,n,g,1,+f,e+i*d0(o+_),r+n*v0(o+_)),y>.01&&this._add("A",i,n,g,0,+f,d,m)}else{var x=e+i*d0(s),S=r+n*v0(s);this._add("A",i,n,g,+v,+f,x,S)}},t.prototype.rect=function(e,r,i,n){this._add("M",e,r),this._add("l",i,0),this._add("l",0,n),this._add("l",-i,0),this._add("Z")},t.prototype.closePath=function(){this._d.length>0&&this._add("Z")},t.prototype._add=function(e,r,i,n,a,o,s,l,u){for(var f=[],c=this._p,p=1;p"}function OU(t){return""}function Pu(t,e){e=e||{};var r=e.newline?` +`:"";function i(n){var a=n.children,o=n.tag,s=n.attrs,l=n.text;return IU(o,s)+(o!=="style"?Je(l):l||"")+(a?""+r+z(a,function(u){return i(u)}).join(r)+r:"")+OU(o)}return i(t)}function XE(t,e,r){r=r||{};var i=r.newline?` +`:"",n=" {"+i,a=i+"}",o=z(ne(t),function(l){return l+n+z(ne(t[l]),function(u){return u+":"+t[l][u]+";"}).join(i)+a}).join(i),s=z(ne(e),function(l){return"@keyframes "+l+n+z(ne(e[l]),function(u){return u+n+z(ne(e[l][u]),function(f){var c=e[l][u][f];return f==="d"&&(c='path("'+c+'")'),f+":"+c+";"}).join(i)+a}).join(i)+a}).join(i);return!o&&!s?"":[""].join(i)}function Nu(t){return{zrId:t,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function x0(t,e,r,i){return Ke("svg","root",{width:t,height:e,xmlns:HE,"xmlns:xlink":y0,version:"1.1",baseProfile:"full",viewBox:i?"0 0 "+t+" "+e:!1},r)}var LU=0;function Eh(){return LU++}var ZE={cubicIn:"0.32,0,0.67,0",cubicOut:"0.33,1,0.68,1",cubicInOut:"0.65,0,0.35,1",quadraticIn:"0.11,0,0.5,0",quadraticOut:"0.5,1,0.89,1",quadraticInOut:"0.45,0,0.55,1",quarticIn:"0.5,0,0.75,0",quarticOut:"0.25,1,0.5,1",quarticInOut:"0.76,0,0.24,1",quinticIn:"0.64,0,0.78,0",quinticOut:"0.22,1,0.36,1",quinticInOut:"0.83,0,0.17,1",sinusoidalIn:"0.12,0,0.39,0",sinusoidalOut:"0.61,1,0.88,1",sinusoidalInOut:"0.37,0,0.63,1",exponentialIn:"0.7,0,0.84,0",exponentialOut:"0.16,1,0.3,1",exponentialInOut:"0.87,0,0.13,1",circularIn:"0.55,0,1,0.45",circularOut:"0,0.55,0.45,1",circularInOut:"0.85,0,0.15,1"},uo="transform-origin";function PU(t,e,r){var i=P({},t.shape);P(i,e),t.buildPath(r,i);var n=new Ah;return n.reset(hf(t)),r.rebuildPath(n,1),n.generateStr(),n.getStr()}function NU(t,e){var r=e.originX,i=e.originY;(r||i)&&(t[uo]=r+"px "+i+"px")}var RU={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function KE(t,e){var r=e.zrId+"-ani-"+e.cssAnimIdx++;return e.cssAnims[r]=t,r}function kU(t,e,r){var i=t.shape.paths,n={},a,o;if(T(i,function(l){var u=Nu(r.zrId);u.animation=!0,Ru(l,{},u,!0);var f=u.cssAnims,c=u.cssNodes,p=ne(f),h=p.length;if(h){o=p[h-1];var v=f[o];for(var d in v){var m=v[d];n[d]=n[d]||{d:""},n[d].d+=m.d||""}for(var g in c){var y=c[g].animation;y.indexOf(o)>=0&&(a=y)}}}),!!a){e.d=!1;var s=KE(n,r);return a.replace(o,s)}}function qE(t){return U(t)?ZE[t]?"cubic-bezier("+ZE[t]+")":To(t)?t:"":""}function Ru(t,e,r,i){var n=t.animators,a=n.length,o=[];if(t instanceof Zo){var s=kU(t,e,r);if(s)o.push(s);else if(!a)return}else if(!a)return;for(var l={},u=0;u0}).length){var He=KE(w,r);return He+" "+y[0]+" both"}}for(var m in l){var s=d(l[m]);s&&o.push(s)}if(o.length){var g=r.zrId+"-cls-"+Eh();r.cssNodes["."+g]={animation:o.join(",")},e.class=g}}function QE(t,e,r){if(!t.ignore)if(t.isSilent()){var i={"pointer-events":"none"};jE(i,e,r,!0)}else{var n=t.states.emphasis&&t.states.emphasis.style?t.states.emphasis.style:{},a=n.fill;if(!a){var o=t.style&&t.style.fill,s=t.states.select&&t.states.select.style&&t.states.select.style.fill,l=t.currentStates.indexOf("select")>=0&&s||o;l&&(a=Ao(l))}var u=n.lineWidth;if(u){var f=!n.strokeNoScale&&t.transform?t.transform[0]:1;u=u/f}var i={cursor:"pointer"};a&&(i.fill=a),n.stroke&&(i.stroke=n.stroke),u&&(i["stroke-width"]=u),jE(i,e,r,!0)}}function jE(t,e,r,i){var n=JSON.stringify(t),a=r.cssStyleCache[n];a||(a=r.zrId+"-cls-"+Eh(),r.cssStyleCache[n]=a,r.cssNodes["."+a+(i?":hover":"")]=t),e.class=e.class?e.class+" "+a:a}var ku=Math.round;function tM(t){return t&&U(t.src)}function rM(t){return t&&X(t.toDataURL)}function S0(t,e,r,i){g0(function(n,a){var o=n==="fill"||n==="stroke";o&&pf(a)?C0(e,t,n,i):o&&tl(a)?A0(r,t,n,i):t[n]=a,o&&i.ssr&&a==="none"&&(t["pointer-events"]="visible")},e,r,!1),HU(r,t,i)}function b0(t,e){var r=Vv(e);r&&(r.each(function(i,n){i!=null&&(t[(_0+n).toLowerCase()]=i+"")}),e.isSilent()&&(t[_0+"silent"]="true"))}function JE(t){return ti(t[0]-1)&&ti(t[1])&&ti(t[2])&&ti(t[3]-1)}function BU(t){return ti(t[4])&&ti(t[5])}function T0(t,e,r){if(e&&!(BU(e)&&JE(e))){var i=r?10:1e4;t.transform=JE(e)?"translate("+ku(e[4]*i)/i+" "+ku(e[5]*i)/i+")":A_(e)}}function $E(t,e,r){for(var i=t.points,n=[],a=0;aa?(v=r[l+1]==null?null:r[l+1].elm,oM(t,v,r,n,l)):Ih(t,e,i,a))}function Fs(t,e){var r=e.elm=t.elm,i=t.children,n=e.children;t!==e&&(Oh(t,e),L0(e.text)?xi(i)&&xi(n)?i!==n&&qU(r,i,n):xi(n)?(xi(t.text)&&Mh(r,""),oM(r,null,n,0,n.length-1)):xi(i)?Ih(r,i,0,i.length-1):xi(t.text)&&Mh(r,""):t.text!==e.text&&(xi(i)&&Ih(r,i,0,i.length-1),Mh(r,e.text)))}function P0(t,e){if(Bu(t,e))Fs(t,e);else{var r=t.elm,i=I0(r);zu(e),i!==null&&(Bn(i,e.elm,O0(r)),Ih(i,[t],0,0))}return e}var KU=0,jU=(function(){function t(e,r,i){if(this.type="svg",this.configLayer=QU("configLayer"),this.storage=r,this._opts=i=P({},i),this.root=e,this._id="zr"+KU++,this._oldVNode=x0(i.width,i.height),e&&!i.ssr){var n=this._viewport=document.createElement("div");n.style.cssText="position:relative;overflow:hidden";var a=this._svgDom=this._oldVNode.elm=Dh("svg");Oh(null,this._oldVNode),n.appendChild(a),e.appendChild(n)}this.resize(i.width,i.height)}return t.prototype.getType=function(){return this.type},t.prototype.getViewportRoot=function(){return this._viewport},t.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},t.prototype.getSvgDom=function(){return this._svgDom},t.prototype.refresh=function(){if(this.root){var e=this.renderToVNode({willUpdate:!0});e.attrs.style="position:absolute;left:0;top:0;user-select:none",P0(this._oldVNode,e),this._oldVNode=e}},t.prototype.renderOneToVNode=function(e){return w0(e,Nu(this._id))},t.prototype.renderToVNode=function(e){e=e||{};var r=this.storage.getDisplayList(!0),i=this._width,n=this._height,a=Nu(this._id);a.animation=e.animation,a.willUpdate=e.willUpdate,a.compress=e.compress,a.emphasis=e.emphasis,a.ssr=this._opts.ssr;var o=[],s=this._bgVNode=JU(i,n,this._backgroundColor,a);s&&o.push(s);var l=e.compress?null:this._mainVNode=Ke("g","main",{},[]);this._paintList(r,a,l?l.children:o),l&&o.push(l);var u=z(ne(a.defs),function(p){return a.defs[p]});if(u.length&&o.push(Ke("defs","defs",{},u)),e.animation){var f=XE(a.cssNodes,a.cssAnims,{newline:!0});if(f){var c=Ke("style","stl",{},[],f);o.push(c)}}return x0(i,n,o,e.useViewBox)},t.prototype.renderToString=function(e){return e=e||{},Pu(this.renderToVNode({animation:W(e.cssAnimation,!0),emphasis:W(e.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:W(e.useViewBox,!0)}),{newline:!0})},t.prototype.setBackgroundColor=function(e){this._backgroundColor=e},t.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},t.prototype._paintList=function(e,r,i){for(var n=e.length,a=[],o=0,s,l,u=0,f=0;f=0&&!(p&&l&&p[d]===l[d]);d--);for(var m=v-1;m>d;m--)o--,s=a[o-1];for(var g=d+1;ginit(); } +// 支付中心统计的按天缓存:订单状态变化 / 删除时失效(需前后台都挂载,回调不走后台) +if (class_exists('AKSRT\\Payment\\OrderAnalyticsDaily')) { + \AKSRT\Payment\OrderAnalyticsDaily::get_instance()->init(); +} if (class_exists('\AKSRT\Content\Pay')) { \AKSRT\Content\Pay::get_instance()->init(); } diff --git a/src/Admin/Admin.php b/src/Admin/Admin.php index fc68c0d5..ffb56464 100644 --- a/src/Admin/Admin.php +++ b/src/Admin/Admin.php @@ -185,6 +185,7 @@ class Admin { PermissionsController::class, UserController::class, PaymentController::class, + PayOverviewController::class, ToolsController::class, ImportExportController::class, ExtensionController::class, diff --git a/src/Admin/Native/PayMenus.php b/src/Admin/Native/PayMenus.php index e00f8f34..68b92d77 100644 --- a/src/Admin/Native/PayMenus.php +++ b/src/Admin/Native/PayMenus.php @@ -27,23 +27,28 @@ class PayMenus { } NativeUi::boot(); + PayOverview::get_instance()->init(); add_action('admin_menu', [$this, 'register_menus']); add_action('admin_notices', [$this, 'pending_notices']); // Domain admin_post handlers are registered by dedicated modules. } /** - * @return array + * @return array */ private function pages(): array { return [ 'overview' => [ 'slug' => self::MENU_SLUG, + 'icon' => 'dashicons-cart', + 'desc' => '', 'title' => __('概览', 'aksrt'), 'callback' => [$this, 'render_overview_page'], ], 'orders' => [ 'slug' => 'aksrt_orders', + 'icon' => 'dashicons-list-view', + 'desc' => __('收款确认、关闭与退款标记', 'aksrt'), 'title' => __('订单明细', 'aksrt'), 'callback' => static function (): void { if (class_exists('AKSRT\Admin\Native\PayOrders')) { @@ -55,6 +60,8 @@ class PayMenus { ], 'products' => [ 'slug' => 'aksrt_pay_products', + 'icon' => 'dashicons-media-document', + 'desc' => __('付费文章定价与销量', 'aksrt'), 'title' => __('付费文章', 'aksrt'), 'callback' => static function (): void { if (class_exists('AKSRT\\Admin\\Native\\PayProducts')) { @@ -66,6 +73,8 @@ class PayMenus { ], 'coupons' => [ 'slug' => 'aksrt_coupons', + 'icon' => 'dashicons-tickets-alt', + 'desc' => __('创建与批量生成优惠码', 'aksrt'), 'title' => __('优惠码', 'aksrt'), 'callback' => static function (): void { if (class_exists('AKSRT\\Admin\\Native\\PayCoupons')) { @@ -77,6 +86,8 @@ class PayMenus { ], 'charge_cards' => [ 'slug' => 'aksrt_charge_cards', + 'icon' => 'dashicons-id-alt', + 'desc' => __('充值卡密生成与导出', 'aksrt'), 'title' => __('卡密管理', 'aksrt'), 'callback' => static function (): void { if (class_exists('AKSRT\\Admin\\Native\\PayChargeCards')) { @@ -88,6 +99,8 @@ class PayMenus { ], 'income' => [ 'slug' => 'aksrt_income', + 'icon' => 'dashicons-chart-pie', + 'desc' => __('创作者分成结算', 'aksrt'), 'title' => __('创作分成', 'aksrt'), 'callback' => static function (): void { if (class_exists('AKSRT\\Admin\\Native\\PayIncome')) { @@ -99,6 +112,8 @@ class PayMenus { ], 'withdraw' => [ 'slug' => 'aksrt_withdraw', + 'icon' => 'dashicons-money-alt', + 'desc' => __('提现申请审核与打款', 'aksrt'), 'title' => __('提现审核', 'aksrt'), 'callback' => static function (): void { if (class_exists('AKSRT\\Admin\\Native\\PayWithdrawals')) { @@ -164,72 +179,23 @@ class PayMenus { } } - private function ensure_cap(): void { - if (!current_user_can(self::CAPABILITY)) { - wp_die(esc_html__('您没有权限访问此页面。', 'aksrt')); - } - } - - private function page_url(string $slug, array $args = []): string { - return add_query_arg(array_merge(['page' => $slug], $args), admin_url('admin.php')); - } - - /** 快捷入口图标,键同 pages()。 */ - private const PAGE_ICONS = [ - 'orders' => 'dashicons-list-view', - 'products' => 'dashicons-media-document', - 'coupons' => 'dashicons-tickets-alt', - 'charge_cards' => 'dashicons-id-alt', - 'income' => 'dashicons-chart-pie', - 'withdraw' => 'dashicons-money-alt', - ]; - - public function render_overview_page(): void { - $this->ensure_cap(); - - $order_stats = class_exists('\AKSRT\Payment\OrderRepository') - ? \AKSRT\Payment\OrderRepository::get_instance()->get_stats() - : []; - $withdraw_stats = class_exists('\AKSRT\Payment\Withdrawal') - ? \AKSRT\Payment\Withdrawal::get_instance()->get_stats() - : []; - $card_stats = class_exists('\AKSRT\Payment\ChargeCard') - ? \AKSRT\Payment\ChargeCard::get_instance()->get_stats() - : []; - - NativeUi::page_open(); - NativeUi::header( - __('支付中心', 'aksrt'), - __('运营数据入口。配置项仍在 AKSRT 主题设置 SPA。', 'aksrt'), - 'dashicons-cart', - [[ - 'label' => __('打开支付配置(SPA)', 'aksrt'), - 'url' => admin_url('admin.php?page=aksrt-settings#/payment/gateway'), - 'icon' => 'dashicons-admin-generic', - ]] - ); - - NativeUi::stats([ - ['label' => __('订单总数', 'aksrt'), 'value' => (int) ($order_stats['total'] ?? 0), 'url' => $this->page_url('aksrt_orders'), 'icon' => 'dashicons-list-view', 'tone' => 'info'], - ['label' => __('待支付', 'aksrt'), 'value' => (int) ($order_stats['pending'] ?? 0), 'url' => $this->page_url('aksrt_orders', ['status' => 'pending']), 'icon' => 'dashicons-clock', 'tone' => 'warning'], - ['label' => __('已支付', 'aksrt'), 'value' => (int) ($order_stats['paid'] ?? 0), 'url' => $this->page_url('aksrt_orders', ['status' => 'paid']), 'icon' => 'dashicons-yes-alt', 'tone' => 'success'], - ['label' => __('营收', 'aksrt'), 'value' => (string) ($order_stats['revenue'] ?? '0.00'), 'url' => $this->page_url('aksrt_orders'), 'icon' => 'dashicons-chart-line', 'tone' => 'success'], - ['label' => __('待审提现', 'aksrt'), 'value' => (int) ($withdraw_stats['pending'] ?? 0), 'url' => $this->page_url('aksrt_withdraw', ['status' => 'pending']), 'icon' => 'dashicons-money-alt', 'tone' => 'danger'], - ['label' => __('可用卡密', 'aksrt'), 'value' => (int) ($card_stats['active'] ?? 0), 'url' => $this->page_url('aksrt_charge_cards', ['status' => 'active']), 'icon' => 'dashicons-id-alt', 'tone' => 'info'], - ]); - - NativeUi::card_open(__('快捷入口', 'aksrt')); - echo ''; - NativeUi::card_close(); + return $items; + } - NativeUi::page_close(); + public function render_overview_page(): void { + PayOverview::get_instance()->render_page(); } } diff --git a/src/Admin/Native/PayOverview.php b/src/Admin/Native/PayOverview.php new file mode 100644 index 00000000..73d3a292 --- /dev/null +++ b/src/Admin/Native/PayOverview.php @@ -0,0 +1,325 @@ +report($from, $today, ''); + $realtime = $analytics->today_vs_yesterday(); + $symbol = $this->currency_symbol(); + + NativeUi::page_open('aksrt-po-page'); + NativeUi::header( + __('支付中心', 'aksrt'), + __('成交走势、收入结构与待办一览。收款渠道、价格策略等配置在主题设置中修改。', 'aksrt'), + 'dashicons-cart', + [ + ['label' => __('订单明细', 'aksrt'), 'url' => $this->page_url('aksrt_orders'), 'icon' => 'dashicons-list-view'], + ['label' => __('支付配置', 'aksrt'), 'url' => admin_url('admin.php?page=aksrt-settings#/payment/gateway'), 'icon' => 'dashicons-admin-generic', 'primary' => true], + ] + ); + + $this->render_realtime($realtime, $symbol); + $this->render_toolbar($from, $today); + echo ''; + echo ''; + $this->render_kpis(); + + echo '
'; + echo '
'; + $this->chart_card('trend', __('成交趋势', 'aksrt'), __('支付金额、净收入、退款金额曲线与支付订单数折线', 'aksrt'), 'lg'); + $this->render_funnel_card(); + echo '
'; + + echo '
'; + $this->chart_card('groups', __('分类成交', 'aksrt'), __('按商品分类的支付金额曲线', 'aksrt'), 'md'); + $this->chart_card('methods', __('支付方式', 'aksrt'), __('按支付金额的支付方式占比', 'aksrt'), 'md'); + echo '
'; + + echo '
'; + $this->render_top_card(); + $this->render_todo_card(); + echo '
'; + echo '
'; + + $this->render_shortcuts_card(); + + $payload = [ + 'currency' => $symbol, + 'today' => $today, + 'maxDays' => OrderAnalytics::MAX_RANGE_DAYS, + 'rest' => ['url' => rest_url('aksrt/v1/admin/pay-overview'), 'nonce' => wp_create_nonce('wp_rest')], + 'initial' => ['from' => $from, 'to' => $today, 'group' => '', 'report' => $report], + 'i18n' => [ + 'paid' => __('支付金额', 'aksrt'), + 'net' => __('净收入', 'aksrt'), + 'refund' => __('退款金额', 'aksrt'), + 'count' => __('支付订单数', 'aksrt'), + 'unit' => __('笔', 'aksrt'), + 'people' => __('人', 'aksrt'), + 'empty' => __('所选区间暂无成交', 'aksrt'), + 'loadError' => __('统计数据加载失败,请稍后重试。', 'aksrt'), + 'basis' => __('较上一周期', 'aksrt'), + 'new' => __('新增', 'aksrt'), + 'total' => __('合计', 'aksrt'), + 'excluded' => __('以下外币订单未计入统计:', 'aksrt'), + 'noTop' => __('所选区间暂无付费内容成交', 'aksrt'), + 'badRange' => __('请选择有效的日期区间。', 'aksrt'), + ], + ]; + echo ''; + + NativeUi::page_close(); + } + + /* ------------------------------------------------------------------ + * 今日实时(同时段对比,不随区间变化) + * ----------------------------------------------------------------*/ + + /** @param array{today:array{amount:float,count:int},yesterday:array{amount:float,count:int},until:string} $data */ + private function render_realtime(array $data, string $symbol): void { + $amount = (float) $data['today']['amount']; + $prev = (float) $data['yesterday']['amount']; + echo '
'; + echo '
' + . '' . esc_html__('今日支付金额', 'aksrt') . '' + . '' . esc_html($symbol . number_format_i18n($amount, 2)) . '' + . $this->delta_html($amount, $prev) . '
'; + echo '
'; + /* translators: %d order count */ + echo '' . esc_html(sprintf(__('今日 %d 笔', 'aksrt'), (int) $data['today']['count'])) . ''; + echo '' . esc_html(sprintf( + /* translators: 1 time 2 amount 3 order count */ + __('昨日 00:00–%1$s:%2$s,%3$d 笔', 'aksrt'), + $data['until'], + $symbol . number_format_i18n($prev, 2), + (int) $data['yesterday']['count'] + )) . ''; + echo '
'; + } + + /** 同时段环比徽标(服务端渲染,仅今日实时使用;区间指标的环比由前端计算)。 */ + private function delta_html(float $current, float $previous): string { + $basis = __('较昨日同时段', 'aksrt'); + if ($previous <= 0) { + $text = $current > 0 ? __('新增', 'aksrt') : '—'; + $class = $current > 0 ? 'is-up' : 'is-flat'; + } else { + $delta = round(($current - $previous) / $previous * 100, 1); + $class = $delta > 0 ? 'is-up' : ($delta < 0 ? 'is-down' : 'is-flat'); + $text = ($delta > 0 ? '↑' : ($delta < 0 ? '↓' : '')) . number_format_i18n(abs($delta), 1) . '%'; + } + return '' . esc_html($basis . ' ' . $text) . ''; + } + + /* ------------------------------------------------------------------ + * 筛选条 / 指标卡 + * ----------------------------------------------------------------*/ + + private function render_toolbar(string $from, string $to): void { + $presets = [ + 'd7' => __('近 7 天', 'aksrt'), + 'd30' => __('近 30 天', 'aksrt'), + 'd90' => __('近 90 天', 'aksrt'), + 'this_month' => __('本月', 'aksrt'), + 'last_month' => __('上月', 'aksrt'), + 'd365' => __('近一年', 'aksrt'), + ]; + echo '
'; + echo '
'; + foreach ($presets as $key => $label) { + echo ''; + } + echo '
'; + + echo '
'; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo '
'; + echo ''; + echo '
'; + } + + private function render_kpis(): void { + $cards = [ + ['paid_amount', __('支付金额', 'aksrt'), 'success'], + ['net_amount', __('净收入', 'aksrt'), 'info'], + ['paid_count', __('支付订单数', 'aksrt'), 'primary'], + ['buyers', __('支付人数', 'aksrt'), 'primary'], + ['avg_amount', __('客单价', 'aksrt'), 'warning'], + ['refund_amount', __('退款金额', 'aksrt'), 'danger'], + ]; + echo '
'; + foreach ($cards as [$key, $label, $tone]) { + echo '
' + . '' . esc_html($label) . '' + . '—' + . '—' + . '' + . '
'; + } + echo '
'; + } + + /* ------------------------------------------------------------------ + * 卡片 + * ----------------------------------------------------------------*/ + + private function chart_card(string $key, string $title, string $label, string $size): void { + NativeUi::card_open($title, '', false, 'aksrt-po-card'); + echo ''; + NativeUi::card_close(); + } + + private function render_funnel_card(): void { + $rows = [ + ['created_count', __('下单数', 'aksrt'), __('区间内创建的订单', 'aksrt')], + ['conversion', __('支付转化率', 'aksrt'), __('下单后完成支付的比例', 'aksrt')], + ['close_rate', __('超时关闭率', 'aksrt'), __('未支付而关闭的比例', 'aksrt')], + ['refund_rate', __('退款率', 'aksrt'), __('退款金额 ÷ 支付金额', 'aksrt')], + ]; + NativeUi::card_open(__('转化与退款', 'aksrt'), '', false, 'aksrt-po-card'); + echo '
    '; + foreach ($rows as [$key, $label, $hint]) { + echo '
  • ' + . '' . esc_html($label) . '' + . '—
    ' + . '' + . '' . esc_html($hint) . '
  • '; + } + echo '
'; + NativeUi::card_close(); + } + + private function render_top_card(): void { + NativeUi::card_open(__('付费内容热销 TOP 10', 'aksrt'), '', true, 'aksrt-po-card'); + echo '
' + . '' + . '' + . '' + . '' + . '' + . '
' . esc_html__('付费内容热销排行', 'aksrt') . '
#' . esc_html__('文章', 'aksrt') . '' . esc_html__('销量', 'aksrt') . '' . esc_html__('支付金额', 'aksrt') . '' . esc_html__('占比', 'aksrt') . '
'; + NativeUi::card_close(); + } + + private function render_todo_card(): void { + $orders = class_exists('\AKSRT\Payment\OrderRepository') ? \AKSRT\Payment\OrderRepository::get_instance()->get_orders_status_counts() : []; + $withdraw = class_exists('\AKSRT\Payment\Withdrawal') ? \AKSRT\Payment\Withdrawal::get_instance()->get_stats() : []; + $income = class_exists('\AKSRT\Payment\Revenue') ? \AKSRT\Payment\Revenue::get_instance()->get_stats() : []; + $cards = class_exists('\AKSRT\Payment\ChargeCard') ? \AKSRT\Payment\ChargeCard::get_instance()->get_stats() : []; + + $items = [ + [__('待审提现', 'aksrt'), (int) ($withdraw['pending'] ?? 0), $this->page_url('aksrt_withdraw', ['status' => 'pending']), 'dashicons-money-alt', 'danger'], + [__('打款中提现', 'aksrt'), (int) ($withdraw['processing'] ?? 0), $this->page_url('aksrt_withdraw', ['status' => 'processing']), 'dashicons-update', 'warning'], + [__('待结算分成', 'aksrt'), (string) ($income['cash']['pending'] ?? '0.00'), $this->page_url('aksrt_income', ['status' => 'pending']), 'dashicons-chart-pie', 'warning'], + [__('待支付订单', 'aksrt'), (int) ($orders['pending'] ?? 0), $this->page_url('aksrt_orders', ['status' => 'pending']), 'dashicons-clock', 'info'], + [__('可用卡密', 'aksrt'), (int) ($cards['active'] ?? 0), $this->page_url('aksrt_charge_cards', ['status' => 'active']), 'dashicons-id-alt', 'neutral'], + ]; + + NativeUi::card_open(__('待办事项', 'aksrt'), '', false, 'aksrt-po-card'); + echo ''; + NativeUi::card_close(); + } + + private function render_shortcuts_card(): void { + NativeUi::card_open(__('快捷入口', 'aksrt'), '', false, 'aksrt-po-card'); + echo ''; + NativeUi::card_close(); + } + + /* ------------------------------------------------------------------ + * 助手 + * ----------------------------------------------------------------*/ + + private function currency_symbol(): string { + $paid = \AKSRT\Settings\Settings::get_paid_content_settings(); + return (string) ($paid['display']['currency_symbol'] ?? '¥'); + } + + /** @param array $args */ + private function page_url(string $slug, array $args = []): string { + return add_query_arg(array_merge(['page' => $slug], $args), admin_url('admin.php')); + } +} diff --git a/src/Admin/PayOverviewController.php b/src/Admin/PayOverviewController.php new file mode 100644 index 00000000..99c90b3d --- /dev/null +++ b/src/Admin/PayOverviewController.php @@ -0,0 +1,75 @@ + 'GET', + 'callback' => [$this, 'get_overview'], + 'permission_callback' => [$this, 'check_permission'], + 'args' => [ + 'from' => ['type' => 'string', 'required' => true, 'sanitize_callback' => 'sanitize_text_field'], + 'to' => ['type' => 'string', 'required' => true, 'sanitize_callback' => 'sanitize_text_field'], + 'group' => ['type' => 'string', 'default' => '', 'sanitize_callback' => 'sanitize_key'], + ], + ]); + } + + public function get_overview(\WP_REST_Request $request): \WP_REST_Response { + $from = (string) $request->get_param('from'); + $to = (string) $request->get_param('to'); + $group = (string) $request->get_param('group'); + + $error = self::validate_range($from, $to); + if ($error !== '') { + return $this->error($error, 400); + } + if ($group !== '' && !isset(OrderAnalytics::group_labels()[$group])) { + return $this->error(__('商品分类无效。', 'aksrt'), 400); + } + + return $this->success(['data' => OrderAnalytics::get_instance()->report($from, $to, $group)]); + } + + /** 区间校验:合法日期、起止有序、不晚于今天、不超过上限天数。返回空串表示通过。 */ + public static function validate_range(string $from, string $to): string { + if (!OrderAnalyticsDaily::is_date($from) || !OrderAnalyticsDaily::is_date($to)) { + return __('日期格式无效。', 'aksrt'); + } + if ($from > $to) { + return __('开始日期不能晚于结束日期。', 'aksrt'); + } + if ($to > current_time('Y-m-d')) { + return __('结束日期不能晚于今天。', 'aksrt'); + } + if (count(OrderAnalyticsDaily::dates($from, $to)) > OrderAnalytics::MAX_RANGE_DAYS) { + /* translators: %d max days */ + return sprintf(__('统计区间最长 %d 天。', 'aksrt'), OrderAnalytics::MAX_RANGE_DAYS); + } + return ''; + } +} diff --git a/src/Payment/Order.php b/src/Payment/Order.php index bfdeaad0..5bc4e7a8 100644 --- a/src/Payment/Order.php +++ b/src/Payment/Order.php @@ -60,10 +60,6 @@ class Order { return $this->repo()->update_status($order_number, $new_status, $extra); } - public function get_stats(int $user_id = 0): array { - return $this->repo()->get_stats($user_id); - } - public function has_paid_access(int $user_id, string $product_type, int $product_id): bool { return $this->repo()->has_paid_access($user_id, $product_type, $product_id); } diff --git a/src/Payment/OrderAnalytics.php b/src/Payment/OrderAnalytics.php new file mode 100644 index 00000000..b88cb88f --- /dev/null +++ b/src/Payment/OrderAnalytics.php @@ -0,0 +1,379 @@ +|null */ + private ?array $method_labels = null; + + public static function get_instance(): self { + if (null === self::$instance) { + self::$instance = new self(); + } + return self::$instance; + } + + /** @return array 分组键 => 名称(顺序即图例顺序) */ + public static function group_labels(): array { + return [ + self::GROUP_CONTENT => __('付费内容', 'aksrt'), + self::GROUP_VIP => __('会员', 'aksrt'), + self::GROUP_POINTS => __('购买积分', 'aksrt'), + self::GROUP_OTHER => __('其他', 'aksrt'), + ]; + } + + public static function group_of(string $product_type): string { + if (DomainModel::is_resource_product_type($product_type)) { + return self::GROUP_CONTENT; + } + return match ($product_type) { + DomainModel::ORDER_PRODUCT_VIP => self::GROUP_VIP, + DomainModel::ORDER_PRODUCT_POINTS => self::GROUP_POINTS, + default => self::GROUP_OTHER, + }; + } + + /** + * 区间报表。$from / $to 为站点时区 Y-m-d(调用方已校验),$group 为空表示全部分类。 + * + * @return array + */ + public function report(string $from, string $to, string $group = ''): array { + $daily = OrderAnalyticsDaily::get_instance(); + $records = $daily->records($from, $to); + $days = count($records); + $prev_to = OrderAnalyticsDaily::shift($from, -1); + $prev_from = OrderAnalyticsDaily::shift($from, -$days); + $previous = $daily->records($prev_from, $prev_to); + $granularity = $days > self::MONTHLY_THRESHOLD ? 'month' : 'day'; + + return [ + 'range' => ['from' => $from, 'to' => $to, 'days' => $days, 'granularity' => $granularity, 'group' => $group], + 'previous_range' => ['from' => $prev_from, 'to' => $prev_to], + 'totals' => $this->totals($records, $group) + ['buyers' => $this->buyers($from, $to, $group)], + 'previous' => $this->totals($previous, $group) + ['buyers' => $this->buyers($prev_from, $prev_to, $group)], + 'series' => $this->series($records, $group, $granularity), + 'methods' => $this->methods($records, $group), + 'top' => in_array($group, ['', self::GROUP_CONTENT], true) ? $this->top_products($from, $to) : [], + 'excluded' => $this->excluded($from, $to), + ]; + } + + /** + * 今日截至此刻 vs 昨日同一时段(支付侧)。 + * + * @return array{today:array{amount:float,count:int},yesterday:array{amount:float,count:int},until:string} + */ + public function today_vs_yesterday(): array { + $today = current_time('Y-m-d'); + $clock = current_time('H:i:s'); + $yday = OrderAnalyticsDaily::shift($today, -1); + return [ + 'today' => $this->paid_window($today . ' 00:00:00', $today . ' ' . $clock), + 'yesterday' => $this->paid_window($yday . ' 00:00:00', $yday . ' ' . $clock), + 'until' => substr($clock, 0, 5), + ]; + } + + /* ------------------------------------------------------------------ + * 基于按天记录的汇总 + * ----------------------------------------------------------------*/ + + /** @param array> $records */ + private function totals(array $records, string $group): array { + $paid = $paid_count = $refund = $refund_count = $created = $created_paid = $closed = 0; + foreach ($records as $record) { + foreach ($record['paid'] ?? [] as $type => $methods) { + if ($this->in_group((string) $type, $group)) { + foreach ($methods as $cell) { + $paid += (int) $cell[0]; + $paid_count += (int) $cell[1]; + } + } + } + foreach ($record['refund'] ?? [] as $type => $cell) { + if ($this->in_group((string) $type, $group)) { + $refund += (int) $cell[0]; + $refund_count += (int) $cell[1]; + } + } + foreach ($record['created'] ?? [] as $type => $cell) { + if ($this->in_group((string) $type, $group)) { + $created += (int) $cell[0]; + $created_paid += (int) $cell[1]; + $closed += (int) $cell[2]; + } + } + } + + return [ + 'paid_amount' => self::yuan($paid), + 'paid_count' => $paid_count, + 'refund_amount' => self::yuan($refund), + 'refund_count' => $refund_count, + 'net_amount' => self::yuan($paid - $refund), + 'avg_amount' => $paid_count > 0 ? self::yuan((int) round($paid / $paid_count)) : 0.0, + 'refund_rate' => $paid > 0 ? round($refund / $paid * 100, 1) : null, + 'created_count' => $created, + 'conversion' => $created > 0 ? round($created_paid / $created * 100, 1) : null, + 'close_rate' => $created > 0 ? round($closed / $created * 100, 1) : null, + ]; + } + + /** + * 趋势序列:支付金额、退款金额、净收入、支付订单数,以及按分类的支付金额。 + * + * @param array> $records + */ + private function series(array $records, string $group, string $granularity): array { + $buckets = []; + foreach ($records as $date => $record) { + $bucket = $granularity === 'month' ? substr((string) $date, 0, 7) : (string) $date; + $buckets[$bucket] ??= ['paid' => 0, 'refund' => 0, 'count' => 0, 'groups' => array_fill_keys(array_keys(self::group_labels()), 0)]; + foreach ($record['paid'] ?? [] as $type => $methods) { + $type_group = self::group_of((string) $type); + foreach ($methods as $cell) { + $buckets[$bucket]['groups'][$type_group] += (int) $cell[0]; + if ($this->in_group((string) $type, $group)) { + $buckets[$bucket]['paid'] += (int) $cell[0]; + $buckets[$bucket]['count'] += (int) $cell[1]; + } + } + } + foreach ($record['refund'] ?? [] as $type => $cell) { + if ($this->in_group((string) $type, $group)) { + $buckets[$bucket]['refund'] += (int) $cell[0]; + } + } + } + + $out = ['labels' => array_keys($buckets), 'paid' => [], 'refund' => [], 'net' => [], 'count' => [], 'groups' => []]; + $group_data = array_fill_keys(array_keys(self::group_labels()), []); + foreach ($buckets as $bucket) { + $out['paid'][] = self::yuan($bucket['paid']); + $out['refund'][] = self::yuan($bucket['refund']); + $out['net'][] = self::yuan($bucket['paid'] - $bucket['refund']); + $out['count'][] = $bucket['count']; + foreach ($bucket['groups'] as $key => $minor) { + $group_data[$key][] = self::yuan($minor); + } + } + foreach (self::group_labels() as $key => $name) { + if (array_sum($group_data[$key]) > 0) { + $out['groups'][] = ['key' => $key, 'name' => $name, 'data' => $group_data[$key]]; + } + } + return $out; + } + + /** + * 支付方式占比(按支付金额降序)。 + * + * @param array> $records + * @return array + */ + private function methods(array $records, string $group): array { + $sum = []; + foreach ($records as $record) { + foreach ($record['paid'] ?? [] as $type => $methods) { + if (!$this->in_group((string) $type, $group)) { + continue; + } + foreach ($methods as $method => $cell) { + $sum[$method] ??= [0, 0]; + $sum[$method][0] += (int) $cell[0]; + $sum[$method][1] += (int) $cell[1]; + } + } + } + uasort($sum, static fn(array $a, array $b): int => $b[0] <=> $a[0]); + + $out = []; + foreach ($sum as $method => $cell) { + $out[] = ['key' => (string) $method, 'name' => $this->method_label((string) $method), 'amount' => self::yuan($cell[0]), 'count' => $cell[1]]; + } + return $out; + } + + /* ------------------------------------------------------------------ + * 需要直接查询的指标(跨天去重、明细排行、时段对比) + * ----------------------------------------------------------------*/ + + /** 区间内的支付人数(按用户去重;游客订单 user_id=0 不计)。 */ + private function buyers(string $from, string $to, string $group): int { + global $wpdb; + [$where, $params] = $this->paid_window_where($from . ' 00:00:00', $to . ' 23:59:59', $group); + return (int) $wpdb->get_var($wpdb->prepare( + 'SELECT COUNT(DISTINCT user_id) FROM ' . OrderAnalyticsDaily::table() . " WHERE {$where} AND user_id > 0", + $params + )); + } + + /** @return array{amount:float,count:int} */ + private function paid_window(string $start, string $end): array { + global $wpdb; + [$where, $params] = $this->paid_window_where($start, $end, ''); + $row = $wpdb->get_row($wpdb->prepare( + 'SELECT COUNT(*) AS c, COALESCE(SUM(amount), 0) AS a FROM ' . OrderAnalyticsDaily::table() . " WHERE {$where}", + $params + ), ARRAY_A); + return [ + 'amount' => self::yuan(OrderAnalyticsDaily::minor($row['a'] ?? 0)), + 'count' => (int) ($row['c'] ?? 0), + ]; + } + + /** + * 付费内容热销排行(按支付金额)。 + * + * @return array + */ + private function top_products(string $from, string $to): array { + global $wpdb; + [$where, $params] = $this->paid_window_where($from . ' 00:00:00', $to . ' 23:59:59', self::GROUP_CONTENT); + $params[] = self::TOP_LIMIT; + $rows = (array) $wpdb->get_results($wpdb->prepare( + 'SELECT product_id AS id, COUNT(*) AS c, COALESCE(SUM(amount), 0) AS a FROM ' . OrderAnalyticsDaily::table() + . " WHERE {$where} AND product_id > 0 GROUP BY product_id ORDER BY a DESC, c DESC LIMIT %d", + $params + ), ARRAY_A); + + $ids = array_map(static fn(array $row): int => (int) $row['id'], $rows); + if ($ids !== []) { + _prime_post_caches($ids, false, false); + } + $out = []; + foreach ($rows as $row) { + $id = (int) $row['id']; + $title = (string) get_the_title($id); + $out[] = [ + 'id' => $id, + 'title' => $title !== '' ? $title : sprintf(/* translators: %d post ID */ __('文章 #%d', 'aksrt'), $id), + 'url' => (string) get_edit_post_link($id, 'raw'), + 'amount' => self::yuan(OrderAnalyticsDaily::minor($row['a'] ?? 0)), + 'count' => (int) ($row['c'] ?? 0), + ]; + } + return $out; + } + + /** + * 未计入主口径的外币现金订单(按币种),供页面提示。 + * + * @return array + */ + private function excluded(string $from, string $to): array { + global $wpdb; + $paid = OrderAnalyticsDaily::paid_statuses(); + $in = implode(', ', array_fill(0, count($paid), '%s')); + $start = $from . ' 00:00:00'; + $end = $to . ' 23:59:59'; + $guard = OrderAnalyticsDaily::shift($from, -OrderAnalyticsDaily::CREATED_SLACK_DAYS) . ' 00:00:00'; + $rows = (array) $wpdb->get_results($wpdb->prepare( + 'SELECT UPPER(currency) AS cur, COUNT(*) AS c, COALESCE(SUM(amount), 0) AS a FROM ' . OrderAnalyticsDaily::table() + . " WHERE currency NOT IN (%s, 'points') AND payment_method <> 'points' AND product_type <> %s AND status IN ({$in}) + AND created_at >= %s AND created_at <= %s AND COALESCE(paid_at, created_at) BETWEEN %s AND %s + GROUP BY cur ORDER BY c DESC", + array_merge([OrderAnalyticsDaily::CURRENCY, DomainModel::ORDER_PRODUCT_RECHARGE], $paid, [$guard, $end, $start, $end]) + ), ARRAY_A); + return array_map(static fn(array $row): array => [ + 'currency' => (string) $row['cur'], + 'amount' => self::yuan(OrderAnalyticsDaily::minor($row['a'] ?? 0)), + 'count' => (int) ($row['c'] ?? 0), + ], $rows); + } + + /** + * 按支付时间窗口的主口径 WHERE(含 created_at 索引下界)。 + * + * @return array{0:string,1:array} + */ + private function paid_window_where(string $start, string $end, string $group): array { + [$base, $params] = OrderAnalyticsDaily::base_where(); + $paid = OrderAnalyticsDaily::paid_statuses(); + $guard = OrderAnalyticsDaily::shift(substr($start, 0, 10), -OrderAnalyticsDaily::CREATED_SLACK_DAYS) . ' 00:00:00'; + $where = $base . ' AND status IN (' . implode(', ', array_fill(0, count($paid), '%s')) . ')' + . ' AND created_at >= %s AND created_at <= %s AND COALESCE(paid_at, created_at) BETWEEN %s AND %s'; + $params = array_merge($params, $paid, [$guard, $end, $start, $end]); + + if ($group !== '') { + [$group_sql, $group_params] = $this->group_where($group); + $where .= ' AND ' . $group_sql; + $params = array_merge($params, $group_params); + } + return [$where, $params]; + } + + /** @return array{0:string,1:array} */ + private function group_where(string $group): array { + $content = DomainModel::resource_order_product_types(); + $known = array_merge($content, [DomainModel::ORDER_PRODUCT_VIP, DomainModel::ORDER_PRODUCT_POINTS]); + $list = static fn(array $types): string => implode(', ', array_fill(0, count($types), '%s')); + return match ($group) { + self::GROUP_CONTENT => ['product_type IN (' . $list($content) . ')', $content], + self::GROUP_VIP => ['product_type = %s', [DomainModel::ORDER_PRODUCT_VIP]], + self::GROUP_POINTS => ['product_type = %s', [DomainModel::ORDER_PRODUCT_POINTS]], + default => ['product_type NOT IN (' . $list($known) . ')', $known], + }; + } + + /* ------------------------------------------------------------------ + * 助手 + * ----------------------------------------------------------------*/ + + private function in_group(string $product_type, string $group): bool { + return $group === '' || self::group_of($product_type) === $group; + } + + private function method_label(string $method): string { + if ($this->method_labels === null) { + $this->method_labels = [ + 'card_pass' => __('卡密', 'aksrt'), + 'free' => __('免费', 'aksrt'), + '' => __('未知', 'aksrt'), + ]; + if (class_exists('\AKSRT\Payment\Gateway')) { + foreach (Gateway::get_instance()->get_all() as $id => $gateway) { + $this->method_labels[(string) $id] = $gateway->get_name(); + } + } + } + return $this->method_labels[$method] ?? $method; + } + + private static function yuan(int $minor): float { + return round($minor / 100, 2); + } +} diff --git a/src/Payment/OrderAnalyticsDaily.php b/src/Payment/OrderAnalyticsDaily.php new file mode 100644 index 00000000..56a1d712 --- /dev/null +++ b/src/Payment/OrderAnalyticsDaily.php @@ -0,0 +1,281 @@ + [金额分, 笔数] 按支付时间归日 + * refund [product_type] => [金额分, 笔数] 按退款时间归日 + * created [product_type] => [下单数, 已支付数, 已关闭数] 按下单时间归日 + * + * 统计口径(与 OrderAnalytics 一致): + * - 只统计站点主币种(CNY)的现金订单;积分订单与外币订单不进入主口径; + * - 不统计余额充值(预收款,消费时已计入对应订单); + * - 支付侧包含后来退款的订单(paid / refunding / refunded),退款单独记在退款当天, + * 所以历史支付金额不会因为后来的退款而改变。 + * + * 缓存:今天和昨天始终实时查询;更早的日期按月存进 transient(一个月一条), + * 订单状态变化时删除受影响月份;清理 / 删除订单时整体换代。 + * + * 性能:支付时间没有索引,查询额外加 created_at 下界(待支付订单最长 24 小时过期, + * 支付时间不会晚于下单 2 天),让 MySQL 走 idx_created;退款查询走 idx_status。 + * + * @package AKSRT + */ + +namespace AKSRT\Payment; + +use AKSRT\Core\DomainModel; + +defined('ABSPATH') || exit; + +final class OrderAnalyticsDaily { + + /** 主口径币种(订单表 currency 经 sanitize_key 存为小写)。 */ + public const CURRENCY = 'cny'; + + /** 最近 N 天(含今天)不缓存:仍可能有回调、过期关闭等变化。 */ + private const LIVE_DAYS = 2; + + /** 支付时间与下单时间的最大间隔(天),用于 created_at 索引下界。 */ + public const CREATED_SLACK_DAYS = 2; + + private const GEN_OPTION = 'aksrt_pay_analytics_gen'; + private const CACHE_TTL = 30 * DAY_IN_SECONDS; + + private static $instance = null; + + public static function get_instance(): self { + if (null === self::$instance) { + self::$instance = new self(); + } + return self::$instance; + } + + public function init(): void { + add_action('aksrt_order_status_changed', [$this, 'on_status_changed'], 10, 3); + add_action('aksrt_orders_purged', [$this, 'flush']); + } + + /** + * 订单状态变化:删除该订单下单日 / 支付日 / 退款日所在月份的缓存。 + * + * @param mixed $order_number + * @param mixed $status + * @param mixed $order + */ + public function on_status_changed($order_number = '', $status = '', $order = []): void { + if (!is_array($order)) { + return; + } + $cutoff = $this->cache_cutoff(); + $months = []; + foreach (['created_at', 'paid_at', 'refunded_at'] as $field) { + $date = substr((string) ($order[$field] ?? ''), 0, 10); + if (self::is_date($date) && $date <= $cutoff) { + $months[substr($date, 0, 7)] = true; + } + } + foreach (array_keys($months) as $month) { + delete_transient($this->key($month)); + } + } + + /** 整体失效:换代后旧 key 不再被读取,随 TTL 自然过期。 */ + public function flush(): void { + update_option(self::GEN_OPTION, $this->generation() + 1, false); + } + + public function generation(): int { + return (int) get_option(self::GEN_OPTION, 0); + } + + /** 可缓存的最后一天(Y-m-d)。 */ + public function cache_cutoff(): string { + return self::shift(current_time('Y-m-d'), -self::LIVE_DAYS); + } + + /** + * 区间内每天的记录(含首尾),键为 Y-m-d,按日期升序。 + * + * @return array> + */ + public function records(string $from, string $to): array { + $cutoff = $this->cache_cutoff(); + $out = []; + $missing = []; + $by_month = []; + foreach (self::dates($from, $to) as $date) { + $by_month[substr($date, 0, 7)][] = $date; + } + + foreach ($by_month as $month => $dates) { + $cached = $dates[0] <= $cutoff ? get_transient($this->key($month)) : false; + $cached = is_array($cached) ? $cached : []; + foreach ($dates as $date) { + if ($date <= $cutoff && isset($cached[$date])) { + $out[$date] = $cached[$date]; + } else { + $missing[] = $date; + } + } + } + + if ($missing !== []) { + $fresh = $this->query(min($missing), max($missing)); + $store = []; + foreach ($missing as $date) { + $out[$date] = $fresh[$date] ?? self::empty_record(); + if ($date <= $cutoff) { + $store[substr($date, 0, 7)][$date] = $out[$date]; + } + } + foreach ($store as $month => $days) { + $cached = get_transient($this->key($month)); + set_transient($this->key($month), array_merge(is_array($cached) ? $cached : [], $days), self::CACHE_TTL); + } + } + + ksort($out); + return $out; + } + + /* ------------------------------------------------------------------ + * 查询 + * ----------------------------------------------------------------*/ + + /** @return array> */ + private function query(string $from, string $to): array { + global $wpdb; + + $table = self::table(); + $start = $from . ' 00:00:00'; + $end = $to . ' 23:59:59'; + $guard = self::shift($from, -self::CREATED_SLACK_DAYS) . ' 00:00:00'; + [$base, $base_params] = self::base_where(); + $paid = self::paid_statuses(); + $paid_in = implode(', ', array_fill(0, count($paid), '%s')); + $records = []; + + // 支付:按支付时间归日。 + $rows = $wpdb->get_results($wpdb->prepare( + "SELECT DATE(COALESCE(paid_at, created_at)) AS d, product_type AS t, payment_method AS m, + COUNT(*) AS c, COALESCE(SUM(amount), 0) AS a + FROM {$table} + WHERE {$base} AND status IN ({$paid_in}) + AND created_at >= %s AND created_at <= %s + AND COALESCE(paid_at, created_at) BETWEEN %s AND %s + GROUP BY d, t, m", + array_merge($base_params, $paid, [$guard, $end, $start, $end]) + ), ARRAY_A); + foreach ((array) $rows as $row) { + $date = (string) ($row['d'] ?? ''); + $type = sanitize_key((string) ($row['t'] ?? '')); + $method = sanitize_key((string) ($row['m'] ?? '')); + $records[$date] ??= self::empty_record(); + $cell = $records[$date]['paid'][$type][$method] ?? [0, 0]; + $records[$date]['paid'][$type][$method] = [$cell[0] + self::minor($row['a'] ?? 0), $cell[1] + (int) ($row['c'] ?? 0)]; + } + + // 退款:按退款时间归日(缺失时回落支付 / 下单时间)。 + $rows = $wpdb->get_results($wpdb->prepare( + "SELECT DATE(COALESCE(refunded_at, paid_at, created_at)) AS d, product_type AS t, + COUNT(*) AS c, COALESCE(SUM(amount), 0) AS a + FROM {$table} + WHERE {$base} AND status = %s + AND COALESCE(refunded_at, paid_at, created_at) BETWEEN %s AND %s + GROUP BY d, t", + array_merge($base_params, [DomainModel::ORDER_STATUS_REFUNDED, $start, $end]) + ), ARRAY_A); + foreach ((array) $rows as $row) { + $date = (string) ($row['d'] ?? ''); + $type = sanitize_key((string) ($row['t'] ?? '')); + $records[$date] ??= self::empty_record(); + $cell = $records[$date]['refund'][$type] ?? [0, 0]; + $records[$date]['refund'][$type] = [$cell[0] + self::minor($row['a'] ?? 0), $cell[1] + (int) ($row['c'] ?? 0)]; + } + + // 下单:按下单时间归日,用于支付转化率与关闭率。 + $rows = $wpdb->get_results($wpdb->prepare( + "SELECT DATE(created_at) AS d, product_type AS t, COUNT(*) AS c, + SUM(CASE WHEN status IN ({$paid_in}) THEN 1 ELSE 0 END) AS p, + SUM(CASE WHEN status = %s THEN 1 ELSE 0 END) AS x + FROM {$table} + WHERE {$base} AND created_at BETWEEN %s AND %s + GROUP BY d, t", + array_merge($paid, [DomainModel::ORDER_STATUS_CLOSED], $base_params, [$start, $end]) + ), ARRAY_A); + foreach ((array) $rows as $row) { + $date = (string) ($row['d'] ?? ''); + $type = sanitize_key((string) ($row['t'] ?? '')); + $records[$date] ??= self::empty_record(); + $cell = $records[$date]['created'][$type] ?? [0, 0, 0]; + $records[$date]['created'][$type] = [ + $cell[0] + (int) ($row['c'] ?? 0), + $cell[1] + (int) ($row['p'] ?? 0), + $cell[2] + (int) ($row['x'] ?? 0), + ]; + } + + return $records; + } + + /* ------------------------------------------------------------------ + * 共享口径(OrderAnalytics 的区间查询也用这些) + * ----------------------------------------------------------------*/ + + public static function table(): string { + return \AKSRT\Core\DBMigrator::table('order'); + } + + /** @return array{0:string,1:array} 主口径 WHERE 片段(主币种、非积分、非充值)。 */ + public static function base_where(): array { + return [ + 'currency = %s AND payment_method <> %s AND product_type <> %s', + [self::CURRENCY, 'points', DomainModel::ORDER_PRODUCT_RECHARGE], + ]; + } + + /** @return string[] 曾经支付成功的状态:支付侧统计包含后来退款的订单。 */ + public static function paid_statuses(): array { + return array_values(array_unique(array_merge( + DomainModel::paid_order_statuses(), + [DomainModel::ORDER_STATUS_REFUNDED] + ))); + } + + /** 数据库 DECIMAL 字符串 → 分。 */ + public static function minor($value): int { + return (int) round(((float) $value) * 100); + } + + /** @return array{paid:array,refund:array,created:array} */ + public static function empty_record(): array { + return ['paid' => [], 'refund' => [], 'created' => []]; + } + + public static function is_date(string $date): bool { + if (!preg_match('/^(\d{4})-(\d{2})-(\d{2})$/', $date, $m)) { + return false; + } + return checkdate((int) $m[2], (int) $m[3], (int) $m[1]); + } + + /** 纯日期加减(UTC 计算,不受夏令时影响)。 */ + public static function shift(string $date, int $days): string { + $base = new \DateTimeImmutable($date, new \DateTimeZone('UTC')); + return $base->modify(($days >= 0 ? '+' : '') . $days . ' days')->format('Y-m-d'); + } + + /** @return string[] 从 $from 到 $to 的连续日期。 */ + public static function dates(string $from, string $to): array { + $dates = []; + for ($d = $from; $d <= $to; $d = self::shift($d, 1)) { + $dates[] = $d; + } + return $dates; + } + + private function key(string $month): string { + return 'aksrt_pa_' . $this->generation() . '_' . str_replace('-', '', $month); + } +} diff --git a/src/Payment/OrderRepository.php b/src/Payment/OrderRepository.php index 2b2c81ab..a236ee4e 100644 --- a/src/Payment/OrderRepository.php +++ b/src/Payment/OrderRepository.php @@ -10,6 +10,7 @@ defined('ABSPATH') || exit; class OrderRepository { use OrderRepositoryCore; use OrderRepositoryAdmin; + use OrderRepositoryAttempts; private static $instance = null; private int $status_transaction_depth = 0; diff --git a/src/Payment/OrderRepositoryAttempts.php b/src/Payment/OrderRepositoryAttempts.php new file mode 100644 index 00000000..c132b662 --- /dev/null +++ b/src/Payment/OrderRepositoryAttempts.php @@ -0,0 +1,182 @@ + $patch + */ + public function merge_meta(string $order_number, array $patch): bool { + global $wpdb; + + $order = $this->get($order_number); + if (!$order) { + return false; + } + + $meta = is_array($order['meta_payload'] ?? null) ? $order['meta_payload'] : []; + foreach ($patch as $key => $value) { + $meta[(string) $key] = $value; + } + + $encoded = wp_json_encode($meta, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); + if (!is_string($encoded)) { + return false; + } + + $updated = $wpdb->update( + $this->table(), + ['note' => $encoded], + ['order_number' => $order_number], + ['%s'], + ['%s'] + ); + + return $updated !== false; + } + + /** + * Resolve a local order from a provider out_trade_no (base or attempt-suffixed). + * + * The authoritative mapping is the order's own meta (provider_out_trade_no / + * provider_out_trade_nos); the prefix heuristic is only a fallback and must + * never be the sole resolver, otherwise a truncated attempt number would + * strand a real payment. + */ + public function resolve_by_out_trade_no(string $out_trade_no): ?array { + global $wpdb; + + $out_trade_no = sanitize_text_field($out_trade_no); + if ($out_trade_no === '') { + return null; + } + + $direct = $this->get($out_trade_no); + if ($direct) { + return $direct; + } + + // Authoritative: the attempt number was recorded in the order note JSON. + $needle = '"provider_out_trade_no":"' . $out_trade_no . '"'; + $row = $wpdb->get_row( + $wpdb->prepare( + "SELECT * FROM {$this->table()} WHERE note LIKE %s ORDER BY id DESC LIMIT 1", + '%' . $wpdb->esc_like($needle) . '%' + ), + ARRAY_A + ); + if (is_array($row)) { + return $this->expire_order_if_due($this->normalize_row($row)); + } + + // Superseded attempts stay in the history array. + $history_needle = '"' . $out_trade_no . '"'; + $row = $wpdb->get_row( + $wpdb->prepare( + "SELECT * FROM {$this->table()} + WHERE note LIKE %s AND note LIKE %s + ORDER BY id DESC LIMIT 1", + '%' . $wpdb->esc_like('"provider_out_trade_nos"') . '%', + '%' . $wpdb->esc_like($history_needle) . '%' + ), + ARRAY_A + ); + if (is_array($row)) { + return $this->expire_order_if_due($this->normalize_row($row)); + } + + // Last resort: {order_number}P{n} prefix heuristic. + if (preg_match('/^(.+)P([0-9]{1,3})$/', $out_trade_no, $m)) { + $base = $this->get($m[1]); + if ($base) { + return $base; + } + } + + return null; + } + + /** + * Provider out_trade_no currently bound to this order (falls back to order_number). + * + * @param array $order + */ + public static function provider_out_trade_no(array $order): string { + $meta = is_array($order['meta_payload'] ?? null) ? $order['meta_payload'] : []; + $out = sanitize_text_field((string) ($meta['provider_out_trade_no'] ?? '')); + if ($out !== '') { + return $out; + } + return sanitize_text_field((string) ($order['order_number'] ?? '')); + } + + /** + * Allocate a new provider out_trade_no for a payment attempt. + * First attempt uses bare order_number; later attempts append Pn (WeChat limit 32). + * + * @return array{out_trade_no:string,attempt:int,previous:string}|null + */ + public function allocate_payment_attempt(string $order_number): ?array { + $order = $this->get($order_number); + if (!$order) { + return null; + } + + $meta = is_array($order['meta_payload'] ?? null) ? $order['meta_payload'] : []; + $previous = sanitize_text_field((string) ($meta['provider_out_trade_no'] ?? '')); + $history = is_array($meta['provider_out_trade_nos'] ?? null) ? $meta['provider_out_trade_nos'] : []; + + // First provider submission keeps the bare order number. + // Re-pay (provider_out_trade_no already set) always mints a new suffix so + // WeChat/Alipay/Epay accept the order when amount/subject/notify changed. + if ($previous === '') { + $attempt = 1; + $out = $order_number; + } else { + $attempt = max(1, (int) ($meta['pay_attempt'] ?? 1)) + 1; + $suffix = 'P' . $attempt; + $base = $order_number; + if (strlen($base) + strlen($suffix) > 32) { + $base = substr($base, 0, 32 - strlen($suffix)); + } + $out = $base . $suffix; + if ($previous !== '' && !in_array($previous, $history, true)) { + $history[] = $previous; + } + } + + if (!in_array($out, $history, true)) { + $history[] = $out; + } + if (count($history) > 20) { + $history = array_slice($history, -20); + } + + $ok = $this->merge_meta($order_number, [ + 'pay_attempt' => $attempt, + 'provider_out_trade_no' => $out, + 'provider_out_trade_nos' => array_values($history), + ]); + if (!$ok) { + return null; + } + + return [ + 'out_trade_no' => $out, + 'attempt' => $attempt, + 'previous' => $previous, + ]; + } +} diff --git a/src/Payment/OrderRepositoryCore.php b/src/Payment/OrderRepositoryCore.php index 74b6a031..c5c0ce6f 100644 --- a/src/Payment/OrderRepositoryCore.php +++ b/src/Payment/OrderRepositoryCore.php @@ -641,7 +641,12 @@ trait OrderRepositoryCore { AND cancelled_at < %s", $cutoff )); - return $deleted === false ? 0 : (int) $deleted; + $deleted = $deleted === false ? 0 : (int) $deleted; + if ($deleted > 0) { + /** 订单被物理删除:统计缓存需整体失效。 */ + do_action('aksrt_orders_purged'); + } + return $deleted; } @@ -656,51 +661,15 @@ trait OrderRepositoryCore { return false; } $ok = $wpdb->delete($this->table(), ['order_number' => $order_number], ['%s']); - return $ok !== false && $ok > 0; - } - - - - /** - * 获取订单统计 - */ - public function get_stats(int $user_id = 0): array { - global $wpdb; - - $this->expire_pending_orders($user_id > 0 ? $user_id : null); - - $where = "WHERE status IN ('pending', 'paid', 'refunding', 'refunded', 'closed')"; - $params = []; - if ($user_id > 0) { - $where .= ' AND user_id = %d'; - $params[] = $user_id; - } - - $sql = "SELECT - COUNT(*) as total, - SUM(CASE WHEN status = 'pending' THEN 1 ELSE 0 END) as pending, - SUM(CASE WHEN status IN ('paid','refunding') THEN 1 ELSE 0 END) as paid, - SUM(CASE WHEN status = 'refunded' THEN 1 ELSE 0 END) as refunded, - SUM(CASE WHEN status = 'closed' THEN 1 ELSE 0 END) as closed, - SUM(CASE WHEN status IN ('paid','refunding') THEN amount ELSE 0 END) as revenue - FROM {$this->table()} {$where}"; - - if (!empty($params)) { - $row = $wpdb->get_row($wpdb->prepare($sql, $params), ARRAY_A); - } else { - $row = $wpdb->get_row($sql, ARRAY_A); + $ok = $ok !== false && $ok > 0; + if ($ok) { + do_action('aksrt_orders_purged'); } - - return [ - 'total' => (int) ($row['total'] ?? 0), - 'pending' => (int) ($row['pending'] ?? 0), - 'paid' => (int) ($row['paid'] ?? 0), - 'refunded' => (int) ($row['refunded'] ?? 0), - 'closed' => (int) ($row['closed'] ?? 0), - 'revenue' => $this->cash_decimal((string) ($row['revenue'] ?? '0')), - ]; + return $ok; } + + public function dispatch_managed_status_events(): void { $events = $this->status_after_commit_events; $this->status_after_commit_events = []; @@ -850,16 +819,6 @@ trait OrderRepositoryCore { } } - private function cash_decimal(string $value): string { - try { - return \AKSRT\Ledger\AssetAmount::balance($value)->decimal(); - } catch (\InvalidArgumentException $e) { - return '0.00'; - } - } - - - private function find_latest_success_order(int $user_id, string $product_type, int $product_id = 0, bool $ignore_product_id = false): ?array { global $wpdb; @@ -913,171 +872,4 @@ trait OrderRepositoryCore { return \AKSRT\Finance\BusinessNumber::allocate(); } - /** - * Merge keys into the order note JSON payload (meta_payload). - * - * @param array $patch - */ - public function merge_meta(string $order_number, array $patch): bool { - global $wpdb; - - $order = $this->get($order_number); - if (!$order) { - return false; - } - - $meta = is_array($order['meta_payload'] ?? null) ? $order['meta_payload'] : []; - foreach ($patch as $key => $value) { - $meta[(string) $key] = $value; - } - - $encoded = wp_json_encode($meta, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); - if (!is_string($encoded)) { - return false; - } - - $updated = $wpdb->update( - $this->table(), - ['note' => $encoded], - ['order_number' => $order_number], - ['%s'], - ['%s'] - ); - - return $updated !== false; - } - - /** - * Resolve a local order from a provider out_trade_no (base or attempt-suffixed). - * - * The authoritative mapping is the order's own meta (provider_out_trade_no / - * provider_out_trade_nos); the prefix heuristic is only a fallback and must - * never be the sole resolver, otherwise a truncated attempt number would - * strand a real payment. - */ - public function resolve_by_out_trade_no(string $out_trade_no): ?array { - global $wpdb; - - $out_trade_no = sanitize_text_field($out_trade_no); - if ($out_trade_no === '') { - return null; - } - - $direct = $this->get($out_trade_no); - if ($direct) { - return $direct; - } - - // Authoritative: the attempt number was recorded in the order note JSON. - $needle = '"provider_out_trade_no":"' . $out_trade_no . '"'; - $row = $wpdb->get_row( - $wpdb->prepare( - "SELECT * FROM {$this->table()} WHERE note LIKE %s ORDER BY id DESC LIMIT 1", - '%' . $wpdb->esc_like($needle) . '%' - ), - ARRAY_A - ); - if (is_array($row)) { - return $this->expire_order_if_due($this->normalize_row($row)); - } - - // Superseded attempts stay in the history array. - $history_needle = '"' . $out_trade_no . '"'; - $row = $wpdb->get_row( - $wpdb->prepare( - "SELECT * FROM {$this->table()} - WHERE note LIKE %s AND note LIKE %s - ORDER BY id DESC LIMIT 1", - '%' . $wpdb->esc_like('"provider_out_trade_nos"') . '%', - '%' . $wpdb->esc_like($history_needle) . '%' - ), - ARRAY_A - ); - if (is_array($row)) { - return $this->expire_order_if_due($this->normalize_row($row)); - } - - // Last resort: {order_number}P{n} prefix heuristic. - if (preg_match('/^(.+)P([0-9]{1,3})$/', $out_trade_no, $m)) { - $base = $this->get($m[1]); - if ($base) { - return $base; - } - } - - return null; - } - - /** - * Provider out_trade_no currently bound to this order (falls back to order_number). - * - * @param array $order - */ - public static function provider_out_trade_no(array $order): string { - $meta = is_array($order['meta_payload'] ?? null) ? $order['meta_payload'] : []; - $out = sanitize_text_field((string) ($meta['provider_out_trade_no'] ?? '')); - if ($out !== '') { - return $out; - } - return sanitize_text_field((string) ($order['order_number'] ?? '')); - } - - /** - * Allocate a new provider out_trade_no for a payment attempt. - * First attempt uses bare order_number; later attempts append Pn (WeChat limit 32). - * - * @return array{out_trade_no:string,attempt:int,previous:string}|null - */ - public function allocate_payment_attempt(string $order_number): ?array { - $order = $this->get($order_number); - if (!$order) { - return null; - } - - $meta = is_array($order['meta_payload'] ?? null) ? $order['meta_payload'] : []; - $previous = sanitize_text_field((string) ($meta['provider_out_trade_no'] ?? '')); - $history = is_array($meta['provider_out_trade_nos'] ?? null) ? $meta['provider_out_trade_nos'] : []; - - // First provider submission keeps the bare order number. - // Re-pay (provider_out_trade_no already set) always mints a new suffix so - // WeChat/Alipay/Epay accept the order when amount/subject/notify changed. - if ($previous === '') { - $attempt = 1; - $out = $order_number; - } else { - $attempt = max(1, (int) ($meta['pay_attempt'] ?? 1)) + 1; - $suffix = 'P' . $attempt; - $base = $order_number; - if (strlen($base) + strlen($suffix) > 32) { - $base = substr($base, 0, 32 - strlen($suffix)); - } - $out = $base . $suffix; - if ($previous !== '' && !in_array($previous, $history, true)) { - $history[] = $previous; - } - } - - if (!in_array($out, $history, true)) { - $history[] = $out; - } - if (count($history) > 20) { - $history = array_slice($history, -20); - } - - $ok = $this->merge_meta($order_number, [ - 'pay_attempt' => $attempt, - 'provider_out_trade_no' => $out, - 'provider_out_trade_nos' => array_values($history), - ]); - if (!$ok) { - return null; - } - - return [ - 'out_trade_no' => $out, - 'attempt' => $attempt, - 'previous' => $previous, - ]; - } - } diff --git a/tools/build-pay-charts.mjs b/tools/build-pay-charts.mjs new file mode 100644 index 00000000..e4b9844a --- /dev/null +++ b/tools/build-pay-charts.mjs @@ -0,0 +1,29 @@ +/** + * 打包支付中心概览用的 ECharts 子集。 + * + * cd assets/admin && npm run build:pay-charts + * + * echarts 是 assets/admin 的 devDependency;产物入库,部署时无需安装 node 依赖。 + */ +import { createRequire } from 'node:module'; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; + +const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..'); +const adminDir = path.join(repoRoot, 'assets/admin'); +const require = createRequire(path.join(adminDir, 'package.json')); +const { build } = require('esbuild'); + +const outfile = path.join(repoRoot, 'assets/js/runtime/libs/echarts-pay.min.js'); + +await build({ + entryPoints: [path.join(repoRoot, 'tools/echarts-pay-overview.entry.mjs')], + outfile, + bundle: true, + format: 'iife', + minify: true, + target: ['es2018'], + legalComments: 'inline', + nodePaths: [path.join(adminDir, 'node_modules')], + logLevel: 'info', +}); diff --git a/tools/echarts-pay-overview.entry.mjs b/tools/echarts-pay-overview.entry.mjs new file mode 100644 index 00000000..cd0569cf --- /dev/null +++ b/tools/echarts-pay-overview.entry.mjs @@ -0,0 +1,32 @@ +/** + * 支付中心概览专用的 ECharts 按需入口(由 tools/build-pay-charts.mjs 打包)。 + * + * 只注册概览页用到的图表与组件,打包为 IIFE 并挂到 window.echarts。 + * 产物:assets/js/runtime/libs/echarts-pay.min.js(入库,后台只在 aksrt_pay 页入队)。 + */ +import * as echarts from 'echarts/core'; +import { LineChart, BarChart, PieChart } from 'echarts/charts'; +import { + GridComponent, + TooltipComponent, + LegendComponent, + DataZoomComponent, + AxisPointerComponent, + AriaComponent, +} from 'echarts/components'; +import { SVGRenderer } from 'echarts/renderers'; + +echarts.use([ + LineChart, + BarChart, + PieChart, + GridComponent, + TooltipComponent, + LegendComponent, + DataZoomComponent, + AxisPointerComponent, + AriaComponent, + SVGRenderer, +]); + +window.echarts = echarts;